{"_id":"@mihanizm56/fetch-api","_rev":"302-deaf918b5e07eef18dc8ff0b5812508e","name":"@mihanizm56/fetch-api","dist-tags":{"latest":"3.10.1","beta":"4.0.0-beta.5"},"versions":{"1.0.0":{"name":"@mihanizm56/fetch-api","version":"1.0.0","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"test:watch":"jest --watch","test":"set CI=true && jest","test:coverage":"jest --coverage","compile":"tsc","lint":"npx eslint . --ext .ts --fix","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/api-service.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/api-service/issues"},"homepage":"https://github.com/mihanizm56/api-service#readme","dependencies":{"typescript":"3.8.3"},"devDependencies":{"@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@types/node":"12.11.7","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","commitizen":"4.0.3","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","husky":"3.0.9","jest":"25.1.0","npm-audit-resolver":"2.1.0","prettier":"1.18.2","source-map-explorer":"2.1.2","ts-jest":"25.2.1"},"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"gitHead":"329f55bbcdf8b39f20c7aa5e4e64ff862c858b69","_id":"@mihanizm56/fetch-api@1.0.0","_nodeVersion":"12.11.1","_npmVersion":"6.14.2","dist":{"integrity":"sha512-8Iq7DMvrbyy+TzMW5AbHHina3bBCV7WiZBh12IcZF61unbUo05gar9pd6yKILAKuObB4j5URdUBAcehYeiRl+Q==","shasum":"47912896edb58a5331e127b507cf6b8b764e5060","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-1.0.0.tgz","fileCount":73,"unpackedSize":48442,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJedriICRA9TVsSAnZWagAAnPMP/jpBjHtL+xNyuqKRvLci\nQz2F4W3m33Zr30HOuVHNztPXcJfHpfPjJXP/D3edeZO/bm+UjYXOXSvG+hfS\nEpcNJp8gs1YPbPUnTHoxX61qb5xqElZlMr+SISAho2FQaCpRsK4rJ/zoUHl4\nxWqc1O+MefSE1Bbw8DVCrlncB8PBcI0KB6Y4XotFNap5z/e2t/Z8aLRLGzHp\neijvjeJKOFPYyhLRdB/dJz+4mBwDpGb8XMf0qLysLPyKxEIc4dkg4SVVw1Dq\nPhPa7LVlYA7tkT+F8k224CbcUlwOCkagopbSHPwegA1QXH3uJMmt801IFGSQ\nIO+8Lpshv9xlEZ+eIpnIHR9TVIJPm+p7KE/ZZ74Dcah5xJKqYHKO9Oc2BSpi\nzjsBK446PwkD7ZemREu+NV1TS9b6p4ybKaG3ltEkMB3JTMDU0XMLpRgvpjr2\nFI8XvzTnSu1tqOi23wQL9gK5/NVq8bgoFLjBzm8nSTjQ316YgCeefypaDQjq\nervRYqTV8czCR58QYOOO6vrqj/gpvOgxLFuIVNmztdLfZUZIX4w43lF2fDFU\nhUcbhy/51Y7WL/gYkzw+DTrreFM9o4fWV57ZR92Ufzi+Hsq5/SZIEAHsf4f0\naNIfjlykdMhSrVOtlK7glzrsCB79dWCJ4eF7YSussIIg1huZcs7a9np//RJs\nBG53\r\n=QXUo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIExkVjKB0qsDmv+gyGYysGY56s69lvSWsGrQx+8inYXKAiEA8udiky0kf5+pfzLKwmGBNyIzHj37dmslfggFH4YZBcY="}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_1.0.0_1584838792277_0.7800154086908426"},"_hasShrinkwrap":false},"1.0.1":{"name":"@mihanizm56/fetch-api","version":"1.0.1","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"test:watch":"jest --watch","test":"set CI=true && jest","test:coverage":"jest --coverage","compile":"tsc","lint":"npx eslint . --ext .ts --fix","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/api-service.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/api-service/issues"},"homepage":"https://github.com/mihanizm56/api-service#readme","dependencies":{"typescript":"3.8.3"},"devDependencies":{"@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@types/node":"12.11.7","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","commitizen":"4.0.3","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","husky":"3.0.9","jest":"25.1.0","npm-audit-resolver":"2.1.0","prettier":"1.18.2","ts-jest":"25.2.1"},"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"gitHead":"8972c45354f3373ac6727ed7e4ef0391e52c5948","_id":"@mihanizm56/fetch-api@1.0.1","_nodeVersion":"12.11.1","_npmVersion":"6.14.2","dist":{"integrity":"sha512-Fc9VEZmsS83eGc9YRqu9DROB6LplBFvXPSFjBJn2f4zVVi0+lEpInFq2oIBsJTNY/OwPVYWqXB4NsuRNhRTePQ==","shasum":"64b27ffbe9a5a7b5c5cf266ad678e9795eb5ddc8","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-1.0.1.tgz","fileCount":73,"unpackedSize":48406,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJedrnICRA9TVsSAnZWagAALgoQAI1pyGxBnNkNPGQ61Cfn\nsA9b6K3r2yv/DyAu9r3+WmOCXbUixEanDIr5SqWmLheNSFfjBOeXBkdFREk9\nDeLVnWm6p38kvLJZqRkmeNyzQuxr5KqzXt7HOH3BPzgSQ43KC3XKSCZp7+e8\nYZMz0Q4u4AzX8qbW2AJ4DdRHLSpWf1R7XJ4AHvUTZsJ+628E3lZVxlmnClzA\nSaLoMAAaMK06B25ldJbNB/Tgfh55ONwyAq4Vcmm5DUmb886DAkmrOWPRUGmr\nE9Lwger8l2eodJD06FoQa3cpWZHeEzQZExARMdym0+pnj6GkbXZZxdjc52A+\n//KBRCVuV83LZztnilXqVsbw48hbjTdkgsHZoeSDc2cv5mL6PTXxJmrY7tCQ\n2S64XpG8pIIKYANId+EonWwoUGDOoxgt25pILEVzouHfMMSWXbyd0Zuu4Xrq\npvCvGgclmR2l4uwYJUau/PmqZ9xxVo/DKOITIj+EOBT2oQ7auSfLvv+WSyr6\nVJavvlOOLZjHmiyZxF9p7buz3pgDrhvjzvrkungxiNFMHmJ7Rg/n4h7+sMYk\nQ0nZIbmSQOjvLY1IxmteKii+kWD4Z7k5k8ua9wPnGTYX32s53C82B3JOT5LD\nvFmQ/DDTShaplGGBhIODMaiMbKPwzLVtfhhUXUcN8AP/gDcW1bfX1njDI9wV\nBQPx\r\n=x081\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDGk9nWOJeUC73aR/vJOzReZvoIWqptG5mm14hAYwVXXwIhAOkmtuVxUbYT60EozvFKlnd4UsTR8mgOu9eKJW790dgm"}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_1.0.1_1584839111564_0.9594352179836501"},"_hasShrinkwrap":false},"1.0.2":{"name":"@mihanizm56/fetch-api","version":"1.0.2","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"test:watch":"jest --watch","test":"set CI=true && jest","test:coverage":"jest --coverage","compile":"tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint . --ext .ts --fix","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","publish":"npm publish --access=public"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/api-service.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/api-service/issues"},"homepage":"https://github.com/mihanizm56/api-service#readme","dependencies":{"typescript":"3.8.3"},"devDependencies":{"@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@types/node":"12.11.7","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","commitizen":"4.0.3","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","husky":"3.0.9","jest":"25.1.0","npm-audit-resolver":"2.1.0","prettier":"1.18.2","ts-jest":"25.2.1","tsconfig-paths":"^3.9.0","tscpaths":"0.0.9","typescript-transform-paths":"^1.1.14"},"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"gitHead":"2d29f94993059c049e65b3751e206b6d34ca74fd","_id":"@mihanizm56/fetch-api@1.0.2","_nodeVersion":"12.11.1","_npmVersion":"6.14.2","dist":{"integrity":"sha512-XbD0TVOA532jKVIV6EMCbJMeVB+6TjdbBVLxh2Ml1tQFImgHOp5eLpNLRpXALP3tXiHntlXY8ljdeQc06Z9ydg==","shasum":"5c81267b4a8a705e28e981e20b7808c74adbb998","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-1.0.2.tgz","fileCount":66,"unpackedSize":46162,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJedtw/CRA9TVsSAnZWagAAyhYQAITYq5uMQN6CyosKQfvP\nYolRPg1ZxPLR9le7q+gUHC9uR6oicSwFqhUe/q97VQcp3cFy8QFn/KbPZ/mQ\naOveFGWNF1LhGgDnl6QfGeDusM3/OCjFoFThCvNzwJ/DYNjZERfvAKgEi5+u\neJEzR6amm9k51e9DI8Wa6efiHZ6g30qsMYMfL1kyxB/T9gieeBhmfbcvizKT\nu/wmp6hbudc+VGzErYxljwMfrarBHE/w3j2naocpMPpgNspSi8z1xBAj2rQv\ncRNClW187enhKToFipcnGf23SeteGdGvDXG/LjoBR26KtS9VyI70Om7kzDkW\ntRPz7mNoYx5RGpCfaxU8DVg6Wh6KNKOu4JWF+MSH1ZWveAWSlcr5oHeE6gzg\nwfnAtzRetd4KdK+Cdd3cKez5myzbgkWiCbBZB1+4x8gF4km0wcEkGMdJJCah\nRJS1tzCPNbYGD8MvQXGqTwfpwbTnefuQwRYgAutYouflv7pcZ3c8yu59NJ50\nknL3MMxYGYABfkF/iD1RxUthhUxEWT/DmT87tF55GpsrEfasI3DtUhNJzeJi\n5I/AS+joy63IBB87rLpm8hf/oUPuPB1EowlxxGFI1MYrugWPcRB6H2lghoMi\nlKLRIC3xjAnujgl/pHjLM7yqg1s0A47As2nKYdN2jE+7l4TMBjlRTkuNNmxX\nDU9J\r\n=T2L/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC6qfC5xYeXdlkte5h26XDI4k6BiT1PM6R60U65oAgekgIgZrTSsgSD02dOPMih7P0blvpmjqF+tNXFJTLBmxEjOyk="}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_1.0.2_1584847935039_0.4461618238204308"},"_hasShrinkwrap":false},"1.0.3":{"name":"@mihanizm56/fetch-api","version":"1.0.3","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"test:watch":"jest --watch","test":"set CI=true && jest","test:coverage":"jest --coverage","compile":"tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint . --ext .ts --fix","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","publish":"npm publish --access=public"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/api-service.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/api-service/issues"},"homepage":"https://github.com/mihanizm56/api-service#readme","dependencies":{"typescript":"3.8.3"},"devDependencies":{"@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@types/node":"12.11.7","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","commitizen":"4.0.3","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","husky":"3.0.9","jest":"25.1.0","npm-audit-resolver":"2.1.0","prettier":"1.18.2","ts-jest":"25.2.1","tsconfig-paths":"^3.9.0","tscpaths":"0.0.9","typescript-transform-paths":"^1.1.14"},"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"gitHead":"2d29f94993059c049e65b3751e206b6d34ca74fd","_id":"@mihanizm56/fetch-api@1.0.3","_nodeVersion":"12.11.1","_npmVersion":"6.14.2","dist":{"integrity":"sha512-JTgCEELb3OwA49rYsmjzg0xSDJQlIFYDHMbwoPFr3T6jO8w0lJmnhHPifAyZSWCDS3oS3LLrSAkGB4Igek6VCQ==","shasum":"c33406e6e4d21cc2fa638bc0de1ee1bda2f00fc7","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-1.0.3.tgz","fileCount":66,"unpackedSize":46162,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJedtxaCRA9TVsSAnZWagAAyTEP/0GCFTuoFfbGBs9OODQb\nBAHylvXgC+9uyIPjqi1eqLBI4bu6uZQP4A3t7nJcYv2dwUM8UhYukRSSECAS\nSCKknANOlvEht+WMQZJcFd80sOCoal4OuZT8OftM7dH+kvsnGYswAajNJx70\n1mgBqxZLTnWDj5Iu88PIH5C5A1KXbFi9Z8RkRYmpQSo8uwkJtZu6iav/O8yP\nEHE2rdEfbJgd9PzjC8TqbY18LydppMrWILNd42P1wfK1mqhylKZYryHaKYQU\nbCKcVU8RSQeVYAry3DYa8RUCsXr8XGnX9qGA74WdtzfVJ20FsAzbwwG0N28z\ntOeCozajOFECMRdTK4FtOIeSyCYc5Wk/8Gsg532FB05Tm4eCP615SAqn+vJY\nutO3frdXPGr3Un2k2zvEpcaAa7b/bCgfZVCwcKI4ShCB4zA38AwwqI8ziLB4\naDYOffj5FncYEN4Ze1KgZNSgwRuTom4EaF5MRVmx0jw9j2zrTSqVQE5Wz97N\nHBf2aVKy0GWiOlzR+FXF5xVD7FRbiPuGsyu8dZEAkmR5oAak9H1Gb+V3zCDx\nBU0/F4+ghsluuOQIUt7ujUXbRfqBCde+lxCgN3iKgvydoLjjhVUCAGbqj6UJ\nTQBMOWN9EtEgQg5bKWLHphGzVuwensr3MB4+VPhAI4GEH0nXwr1nCGt1n+KT\nUDZt\r\n=vIOh\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBhFGexGbX209kEoJOhyEG2npjQjUKMuknUV4VBuOlSNAiADd6nhtPTfUQKnArgxrZCAQk3cU5WXRfWT6Z5A8C3ofQ=="}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_1.0.3_1584847962203_0.1551988269694604"},"_hasShrinkwrap":false},"1.0.4":{"name":"@mihanizm56/fetch-api","version":"1.0.4","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"test:watch":"jest --watch","test":"set CI=true && jest","test:coverage":"jest --coverage","compile":"tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint . --ext .ts --fix","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","pub":"npm publish --access=public"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/api-service.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/api-service/issues"},"homepage":"https://github.com/mihanizm56/api-service#readme","dependencies":{"typescript":"3.8.3"},"devDependencies":{"@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@types/node":"12.11.7","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","commitizen":"4.0.3","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","husky":"3.0.9","jest":"25.1.0","npm-audit-resolver":"2.1.0","prettier":"1.18.2","ts-jest":"25.2.1","tsconfig-paths":"^3.9.0","tscpaths":"0.0.9","typescript-transform-paths":"^1.1.14"},"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"gitHead":"1bc5ea9b6cff2e989cd18b5bd2d30535b9496815","_id":"@mihanizm56/fetch-api@1.0.4","_nodeVersion":"12.11.1","_npmVersion":"6.14.2","dist":{"integrity":"sha512-OSDG/2cP8Toebp5eDhIWSysHGSTpmed0dlxpFChTj3NeV5Ouf0SSpyq+0d2F476a37ND4W98kPWqal3y3IxLkQ==","shasum":"aca962caa8e4072916c7814aafe3af9a088a5898","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-1.0.4.tgz","fileCount":66,"unpackedSize":46286,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJedt/wCRA9TVsSAnZWagAARyoP/15r5zRnaVCYjRXySNNg\nm6P0E7HBm/UKkz/6NNO2AWN2N1uwjQKnxTFPXqu3473o2HZunqQw9KCFI3kU\nY1dkz7/qIrP4nL7eZnPca1/0x7N/hjW23LVKt9LvnwWYPogtWVnC1qoHekUE\n6ZXG8zorG6VZyHFDNK70oWuqQ7URMJEqoHr7EYjpK9MxS464BxhMDllvMatL\nDQH4fjlGQQ61SN99rDPZyhCGY8Wodxn/TNzqNJsDZZpW1JeRLGFg/lfftlNl\nydP6BKoYBmKJizjz0uL+oab7Oz5yRiKnkGDC8iuvXJuvlvP2zEYfg2P6/uwl\nhDoCoIxfEoCuFytZNspDjGxfNKEUv8FzBK7sxSsBcAeT4bHbMJir/2LTUEqE\nfuTW+VFasSfTGPl3v11/VwuY058kxKSB6kQw3wKBiGaN394ceuYGeVqZazyr\nA7BzNs5R6gHKFbqNHLpbxQbltNUkEjCIUyL0AEv7TES35c40EzkO8FDcqcc1\n5LBKe5xcydm9rAvxHUpUaKoB99Uk1eQOUYaeI90t64qlR160plRpG7B+/voe\nGacBMuS9av1Vla49lW1IZPh3Sw1qrtueDSwnQ0G3tmnHcalEcGv/KMt812EA\nzGUhHU8GlP32vNP0XaZhzrCXm+8kWtRe6xtbBimnof02zB/g5XgLbDz5jB/B\nXNjy\r\n=X3g7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGTeF9CozTHCilfmYSYetA+v+4SMJOxlBoNN3tws7D1AAiAhjfwjY7ex40anQonVhdF9sFuS1XJHsqWQodrX+nxDTg=="}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_1.0.4_1584848879998_0.4817996987153612"},"_hasShrinkwrap":false},"1.0.5":{"name":"@mihanizm56/fetch-api","version":"1.0.5","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"test:watch":"jest --watch","test":"set CI=true && jest","test:coverage":"jest --coverage","compile":"tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint . --ext .ts --fix","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","pub":"npm publish --access=public"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/api-service.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/api-service/issues"},"homepage":"https://github.com/mihanizm56/api-service#readme","dependencies":{"typescript":"3.8.3"},"devDependencies":{"@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@types/node":"12.11.7","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","commitizen":"4.0.3","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","husky":"3.0.9","jest":"25.1.0","npm-audit-resolver":"2.1.0","prettier":"1.18.2","ts-jest":"25.2.1","tsconfig-paths":"^3.9.0","tscpaths":"0.0.9","typescript-transform-paths":"^1.1.14"},"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"gitHead":"8f5b931deb3a62cc58abde6f0ad9e6d6a0a6c41d","_id":"@mihanizm56/fetch-api@1.0.5","_nodeVersion":"12.11.1","_npmVersion":"6.14.2","dist":{"integrity":"sha512-YC6JDwIaeslvhMiDl9VtCePwN8II6VqMqYqq34dzx64WOyWB4bwHAKHqCcTKIVR0ZW7+urHSh7EqyAO5KIMvrA==","shasum":"c1b304c447c4e3ecf6ca4d59bd32d04a8d424665","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-1.0.5.tgz","fileCount":66,"unpackedSize":46553,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeduI7CRA9TVsSAnZWagAAQ90P/jRogzGuD9k0xw+G8t2M\nEUPyfYeJCbIH0Lnzlf+3nLvmhtVsLYizILDgSmjt6wImIW1S92nPj/vJwUxs\nzyjc3BMXeDZNhWqVKz9UizWF+BlQ3y3HJ5HnJ02qVXxvBeSVY9nBxSTQky30\nPUlDpOa8cMH2dLHcvcK+jnqXRIevgxGQ8Dp6RdQeZjq62EhEKaFHjFVjor6M\n/3434tI6IDv8xWLIipjEDcGgt7ErHhnFzJZmHaLPI18ARA+29GR98ikTCR9q\nh400uDDBMZ48ql9yzzHl/bjZeqJ1NQR3hWyLi3F1sdyCYacCeCd69U9zH13G\n26WRZ0gjxnqdrWd9InfL/Tm8nk4+Y+J8TVcd3++4Gs54phdSlsXZXgMgqi1a\nVMYCfX4EqPsFl/Eka99J0LEa1knpRp3xlVrMacKAYT1ZX5MXX0Ezqzfw2U40\ny5QZuCYiTw7AobFkKZrE1XkdDgvcvTtN2CbGlYfa9xdaMcTq8m0onRVybMkf\noJxTJ1yI71RpLqEUjPGMnysAab2qsLcfD6GqIOnN+FOrBTnydjCBcuC0qJDB\nkjRvicFyb7GCeUrdqMM7hFcMQTRbkTMaGXM1aJHlATPBZ1e/yx4A+vqWyoPv\nO46USloFO0QrttquFi/uME4dGazQvF4vPiNGnqvzQW9f5Po3UduYnrWIOXN0\nNMys\r\n=gawm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIH05ur/NBkmfeXzSAL3W3JlcTMFXuIyJYHnE/weDcr22AiB5smMl0ZSNqhQcVy1W5d9f/GgmCWvNMBfZjTqjSQk2jg=="}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_1.0.5_1584849467069_0.20595369594191415"},"_hasShrinkwrap":false},"1.0.6":{"name":"@mihanizm56/fetch-api","version":"1.0.6","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"test:watch":"jest --watch","test":"set CI=true && jest","test:coverage":"jest --coverage","compile":"tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint . --ext .ts --fix","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","pub":"npm publish --access=public"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/api-service.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/api-service/issues"},"homepage":"https://github.com/mihanizm56/api-service#readme","dependencies":{"typescript":"3.8.3"},"devDependencies":{"@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@types/node":"12.11.7","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","commitizen":"4.0.3","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","husky":"3.0.9","jest":"25.1.0","npm-audit-resolver":"2.1.0","prettier":"1.18.2","ts-jest":"25.2.1","tsconfig-paths":"^3.9.0","tscpaths":"0.0.9","typescript-transform-paths":"^1.1.14"},"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"gitHead":"af920e8e87d7c31b75f8bc917f125f58988173c1","_id":"@mihanizm56/fetch-api@1.0.6","_nodeVersion":"12.11.1","_npmVersion":"6.14.2","dist":{"integrity":"sha512-OJh3GsxGn+vvLEn//5kuga1+yG+cAFhUacCzPAaUiXScOXgdQKUFAB5mZsu025yay8LoZMqTgxmovLmte1K0eg==","shasum":"a73ec953d5f02572ea3133dd62deba459b9e7a00","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-1.0.6.tgz","fileCount":66,"unpackedSize":46585,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeduMtCRA9TVsSAnZWagAAL5UP/2NOYbkmGwtc5CMc1z2l\nhFp6WowatvaJLA9CXnpBY3z67nYXiXIpfaGL64JBD71JzcVAp4beKrsqnbld\nKiIznRRexlUN2IfMYogQndUNcqgBX2DT+o472iseOjg225SDz0ttTocNQ8Zn\nLXTUq3qr+D0IGOcVLHlz5+MD0lH8L3/s7Kvm9QftTYphyc1Ud61PJjAKkMOl\n+y+Zh49cL6eQ4VwYQDrbUGyhmimtuGbQgQAA1mXuJ/0uowhe+PD+dozq04kS\nvf4LyHtz+nAlAymviDQBRYX1pFVg7SArod7ekvpi/AG28x3gsKsC+8jpl2O+\nwIRUPlyFtSB57dC3VaRk3t9UplAsnQzAUt7SExX7L6Hf0NYUETbaRjXlZl6G\nA7yg/3fPFWCG+5HspI5pMuAOOTwf+eakSAdCfSZXsCY0HZ9d8LSKlhRCysYG\nXs5LSiI9QOWbWPJlrINu30jsfVKIDd+MLJSLEHnGOq+NCgKZrCCaZTDjKiox\nNPkBHpKUm7b49foA/tlRAQ3nHfgY8K5kpuR5+K9SGDLu1TLZo0qjBpNCF6RC\n7Q4WA9LypU8Q1ovuWh3qlBvjXjylCM9t2/NqG/w7H7pg6kvlqf9yX8zZVor3\n7XVkYc8JhKI49XYV7Tkxhm1REyrhfW8C6Qigc/JWNvIYSNWqHH4lhqzgUlkh\nSYPh\r\n=HPUw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDymbHGrPtmfLZ192UvElt6UHRWv9y6S/mQPJh0seLhgQIhANdEY6kWOTQl6s1mu7+hMK115/fi+yfqgGnWwTtg7u0p"}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_1.0.6_1584849708696_0.0030666446678844217"},"_hasShrinkwrap":false},"1.0.7":{"name":"@mihanizm56/fetch-api","version":"1.0.7","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"test:watch":"jest --watch","test":"set CI=true && jest","test:coverage":"jest --coverage","compile":"tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint . --ext .ts --fix","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","pub":"npm publish --access=public"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/api-service.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/api-service/issues"},"homepage":"https://github.com/mihanizm56/api-service#readme","dependencies":{"typescript":"3.8.3"},"devDependencies":{"@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@types/node":"12.11.7","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","commitizen":"4.0.3","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","husky":"3.0.9","jest":"25.1.0","npm-audit-resolver":"2.1.0","prettier":"1.18.2","ts-jest":"25.2.1","tsconfig-paths":"^3.9.0","tscpaths":"0.0.9","typescript-transform-paths":"^1.1.14"},"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"gitHead":"126e5c1d44fd05f197063c4603df16d85f661a7c","_id":"@mihanizm56/fetch-api@1.0.7","_nodeVersion":"12.11.1","_npmVersion":"6.14.2","dist":{"integrity":"sha512-NKpN/axSxW6qNXYpV0QFcwjTFbNpYq2rCcGrlmnrcBEDBGC5XDbf0S2eJlWR/YKfmVnp3+YWy46InmpHvMJukQ==","shasum":"b26b5f005b9abb7e30680d52d8ce7401d33dfa9f","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-1.0.7.tgz","fileCount":69,"unpackedSize":46909,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJedupcCRA9TVsSAnZWagAAgpQP/2NPJ/S05po9jsDD7eK8\nfXkaTiG46708gLVJA945D9NBNj1OJwvoaCh63q2yPQU8CqGSWHE0+gskrX5s\ncJpxhUMWUtrpMTzR7zLVXQVOLGU0+A2R7jLKyOL30UZePjDATi8L0BFgfo9X\n4Fqn7gaixh1t7dBy56ja75xgFzoSjzun8cafr4SogyQbe3KvvaHEPVbgKr9S\nM/MDDoVWU8ZaiVCvkNEqROebcYshjAyM0/AtSi9xWJxnVltM9zE99tQV1G4p\n2QbVsutsbb/M82ZY/ZEfCIdSU0aaqTqMWek7wMlPFUz/Rw54wlz1HpW6YOmV\ngdKmCku1YgSS4eSe2GYPiSWFDwAesNUwkBHy/y79lshZH0LhXzeBOjDezkPQ\nXqcwZDbj4LrrGJOOAm4XkX1vVy4c5c3KSYiYrNSGqrkujeOh4uWoKwUYW+Af\n/81bqzLyAXmglhaj+5TXOecwQGQpEgW6WZfkyP9paGpcHBqK1fCt/QjYL/pr\n+aDfayc2pIJOZSe0O92niMlLnzLB2yIm7eeFQzdRbJ2pKrUYjbDEGhgB4OXP\nYqdgH2asTUvXWZwomxh6v9JVv64ZnURwoMOdmDSL7eteMz7sLg6ZdGveDVWS\n5+bXKYM/8wm5SqudPpPbAijNR2oUjgCz3sJxSK5gDV8t5evnwrfXR+uVrEWI\nCwoE\r\n=OjP0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCJbVEIZvCgWVfUcT2hKGuFB+Tvpm6it5AkLQNGGy5k4gIgB+gwEMcC/m0DhsZF8NJ+AXsubumqcbbpWBwFWtv9ke8="}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_1.0.7_1584851547939_0.8944450818160965"},"_hasShrinkwrap":false},"1.1.0":{"name":"@mihanizm56/fetch-api","version":"1.1.0","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"test:watch":"jest --watch","test":"set CI=true && jest","test:coverage":"jest --coverage","compile":"tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint . --ext .ts --fix","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","pub":"npm publish --access=public"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/api-service.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/api-service/issues"},"homepage":"https://github.com/mihanizm56/api-service#readme","dependencies":{"typescript":"3.8.3"},"devDependencies":{"@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@types/node":"12.11.7","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","commitizen":"4.0.3","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","husky":"3.0.9","jest":"25.1.0","npm-audit-resolver":"2.1.0","prettier":"1.18.2","ts-jest":"25.2.1","tsconfig-paths":"^3.9.0","tscpaths":"0.0.9","typescript-transform-paths":"^1.1.14"},"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"gitHead":"1fc748b15198ded606a011009e8d72065b3b21fd","_id":"@mihanizm56/fetch-api@1.1.0","_nodeVersion":"12.11.1","_npmVersion":"6.14.2","dist":{"integrity":"sha512-i6Y4Hc9pPP/dKxanRXWgC+UdShAQ4duoRA9UeO0qnqbFgkSsjuNRou8yh0UXR9PQBOM0LqWX9GrAm/tCrBNNIQ==","shasum":"05954cc98ab0c455228be8d0f5d81c71a8b9468d","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-1.1.0.tgz","fileCount":87,"unpackedSize":52989,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJedwLmCRA9TVsSAnZWagAAONoP/0cJFKD116DcSJlKTH6r\niBgtsiB+hkiCsdo3CSU2UzKcEhdD7pUPzJ0NR2cR/YYZMR25AzcxcuQuoHzO\nzKs2Jl55wJU0Exr+4M4z4uP9DbztDZuaDr3VAqYhe0jaffcwPBL1O1w0mMbj\nSiiBs8sqqGYd6lthqjqgaHRAFR/HzaonNCLoey0vUWrrnIi2XHv9ATLqxx5f\n5nF5hDTp5aJWA+mfDUrth1L22j0MlaXw+Z11r2522srZXVyuK+FTX5oweHCx\nRM2t589YKz7MIliuvLBbyzxXdThxG8GQWWzSep5V5oKqzjC/Lf+kRiXBWmsi\nf+8/auQxvGctJj6ucDZKc5hMgDmt9RKbte9U0xOLKz/NqVp0ftze3klpc/dp\nujuftBkI5NiBR8icvHaL7A9qRgsIbI1REfxrrAew6i0/VQPR3pgHzypkpnet\nCRrh00XBnAz3wk2ASZukVxqy0Fr4L/zcyXRZ/xqms/GTRRsrDpn/+jN5yqs6\nJZHh1F91H5P3urOissnsr/aQb5v6rYoqA6NHWRU2s5TKkh94G0zc40SUIqwK\nVMy4Gtb6TIoL3vPhKGGQaljL+EnzQ+63zSDr++MXm4lLNYkGLLhFnjqFlHEy\nVruvQ7+fJumvLYLi1UVFaU18XzS87ZQyoHCOhryQ2qrjbcUBuTFFB1f+2//8\nCxeb\r\n=DAzD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAcCG207GwZVP0SKD+FGEOUWn1c3fInUMr1ECOeXSYI8AiApUH4/v1WQZL0muPgTUlDzxNdKCQ6XQ6+K2QiOCR7LOA=="}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_1.1.0_1584857829862_0.740385448050257"},"_hasShrinkwrap":false},"1.1.1":{"name":"@mihanizm56/fetch-api","version":"1.1.1","description":"api servise","main":"dist/index.js","types":"dist/index.ts","scripts":{"test:watch":"jest --watch","test":"set CI=true && jest","test:coverage":"jest --coverage","compile":"tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint . --ext .ts --fix","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","pub":"npm publish --access=public"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/api-service.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/api-service/issues"},"homepage":"https://github.com/mihanizm56/api-service#readme","dependencies":{"typescript":"3.8.3"},"devDependencies":{"@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@types/node":"12.11.7","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","commitizen":"4.0.3","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","husky":"3.0.9","jest":"25.1.0","npm-audit-resolver":"2.1.0","prettier":"1.18.2","ts-jest":"25.2.1","tsconfig-paths":"^3.9.0","tscpaths":"0.0.9","typescript-transform-paths":"^1.1.14"},"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"gitHead":"264082727383af4aa1d7f6cef9d4356b995eb6ad","_id":"@mihanizm56/fetch-api@1.1.1","_nodeVersion":"12.13.0","_npmVersion":"6.14.2","dist":{"integrity":"sha512-5bSmgpJuIolmhqsiEkmYmtAEK0loEf3vPK9/HRxRDLl1aaG9/MDgLE7+ys/SaD6hKJWD1uUphn4QnWYUy0pnfw==","shasum":"0b91324c205b43da3a4194c631ea1ad5866347aa","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-1.1.1.tgz","fileCount":72,"unpackedSize":49746,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJedwYbCRA9TVsSAnZWagAAgxUP/14nfmK1ESp0X7TYRPKY\nebeqVaiHYRfvwCtuyUHX1xe22fjMx5b7+eg7oxuoVfmae6BFevWUIHsPiFmT\nDjrGHIXt5/W2GJL57/ssfVTEeeHj0QhXgFJv7Tz9pj/6X66ZV9584/6x8SIQ\nTY81FYhvZTHaDmT2xJC3LTyXupXDkCEQRXds7AQ5f36kklQmaREkoAXoq3gX\ngf6iRykluVqD8MmeSDLc/4LX9drLW7ijUZ3YTxYgTmeirjiVoabQnLu6Cakr\nLoNpLATXNAwe0EjD2XsbAhJN/l1EWOrOTCMIyxWGgU2jprpHw7Y8SQ8P1fdd\nyOelZSspNvzgaVxlIOACcshBmU9zKrUG4QmYM2ag+L8zuefgUjF29Vwye1hj\nRv/IfB28U0S59eEdmNgdwstfWp+kEFYbdYL6ljzhjp9spbInPORKFcSHgryS\ngbkZvrmfbO9eGq1m5tTNv0e6bRdCBEBJe2GduW1U3UmmpSR1HTfXxjgMkYtG\nOqA1ejDUTAnETwxg8gwmWvAllePPhgQYZFGKXxI+VGM7Zy2sj4fyquo5YepD\n3fL8k4v0fvLXtfi0fD1O/3zwB3y/s0i99hf1128+kxp8/aEbNei1o9YJ4s3v\ngfCaabmJsEUCnfQKRdPX9UmFXramU0VTD6+/fD5KCH6gDrVQnqyWqFLy9TbK\nDOWz\r\n=i9Ca\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIG44WmG/nrOeQYkbJqd8mUTgv4+BvSuYOpA8bV3cBUdGAiEA4hCZdOxJPj/EBfdJmj9j06kk/CkDBTQtdt+aV9eHgbo="}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_1.1.1_1584858651338_0.48994796382686556"},"_hasShrinkwrap":false},"1.1.2":{"name":"@mihanizm56/fetch-api","version":"1.1.2","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"test:watch":"jest --watch","test":"set CI=true && jest","test:coverage":"jest --coverage","compile":"tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint . --ext .ts --fix","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","pub":"npm publish --access=public"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/api-service.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/api-service/issues"},"homepage":"https://github.com/mihanizm56/api-service#readme","dependencies":{"typescript":"3.8.3"},"devDependencies":{"@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@types/node":"12.11.7","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","commitizen":"4.0.3","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","husky":"3.0.9","jest":"25.1.0","npm-audit-resolver":"2.1.0","prettier":"1.18.2","ts-jest":"25.2.1","tsconfig-paths":"^3.9.0","tscpaths":"0.0.9","typescript-transform-paths":"^1.1.14"},"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"gitHead":"119cd64a6dcbc8bd13f6e748c89781e4aac4d16f","_id":"@mihanizm56/fetch-api@1.1.2","_nodeVersion":"12.13.0","_npmVersion":"6.14.2","dist":{"integrity":"sha512-aUJlPVNJ7grMtuKsJigmW4JnuhAyAdZbHL7RJvi9Sh12VGKKS4FmGtmJdLuWFQu+zLKNFLOLRCcoXW4riRZi6A==","shasum":"f82ed8a605ae46792092caaa5749da7dc1661b4b","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-1.1.2.tgz","fileCount":72,"unpackedSize":49748,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJed8FNCRA9TVsSAnZWagAAqtkP/jw6IcNwZoKKou1vq0Iq\nl21QllnKgReZ6tvcZhthEmtCD30dfQKiHYUJ4cobb56AmnNpOgLmLqjFJuGR\nQEuKsfLAbQrVWWtNC1e0lBt+8SW0cFuMIgFoX1smyGWUC1z8lz3iDTGfNUF2\n0LYuDvlkzlqc6tpzHUd7FJRmb+ICd6izUjYkUB04QUPmaGAT3A/gL5BkujtE\nVSJ8+WJZ7Je85PDGFBeHFEU0ncOcVNMocc92U/sDAbKTo41fLlJWie3Fl1H3\nO9ONL/i6asvwwLK2wV/0Nts6bMm+GqerBexszlXXHpBc0l9Cnz6XjCitGZy0\nIOuS5tSXInDHadW35XaFrC236h7EK7roGenVEG6HCTTPQ9C+bPrt+DN0/OL7\nqTnz0pWypCHw8dlKs2p8qrTD2egpfAB0JTZaF2/hrO2RP6zShEzr/mTVhkqY\nMWhXtHXKQ8ioBSZp3IqaYuWlOYbFXPeweZuk9n/vcwi9HpRrEwSdJjh7ZVuC\n5RWFdzoNqGLlp/xqbIc6oVy6v0ynekFjKMUIWcxs6TDCZAK7Q9ln1TCq90ux\nVt4wku7UW313C4r0azBV/LnT5yp9/I9f0eGRuh7TH/wt0KPfdXO+KqgraPmB\nUIi/+4LjMF0iCf+9fKzX1KPhmjtP3mhi1hBAat6/rohuMwneMnX6rBAnJ7hB\nsAzy\r\n=nbqZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFueTO+qITV0g0LKqKrz12eaBLI65YJwJTOUQ2ZwX6W+AiEAr4vy+G0gkaPYn/Atrfa8cdG6imPu/00h2vwNV3anDp8="}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_1.1.2_1584906573147_0.35608794580971903"},"_hasShrinkwrap":false},"1.1.3":{"name":"@mihanizm56/fetch-api","version":"1.1.3","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"test:watch":"jest --watch","test":"set CI=true && jest","test:coverage":"jest --coverage","compile":"tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint . --ext .ts --fix","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","pub":"npm publish --access=public"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/api-service.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/api-service/issues"},"homepage":"https://github.com/mihanizm56/api-service#readme","dependencies":{"typescript":"3.8.3"},"devDependencies":{"@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@types/node":"12.11.7","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","commitizen":"4.0.3","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","husky":"3.0.9","jest":"25.1.0","npm-audit-resolver":"2.1.0","prettier":"1.18.2","ts-jest":"25.2.1","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript-transform-paths":"1.1.14"},"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"gitHead":"d338529d603582ec37a17c2421302659858c905b","_id":"@mihanizm56/fetch-api@1.1.3","_nodeVersion":"12.13.0","_npmVersion":"6.14.2","dist":{"integrity":"sha512-fHiQyX/7sRWiyc/BnrCVDoYK6ej/vGSGohi3q/0On6ccHD7Dq2w0niVEwdZNsEnBunO8bLqc/xm8jHIVAcUjcg==","shasum":"f5e6dea875edf63f88a5b816ca34435b8ce9ef05","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-1.1.3.tgz","fileCount":72,"unpackedSize":49746,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJed8NdCRA9TVsSAnZWagAAYYMP/1hbmmrrgs0YGsfqQXGr\nte1A848uQgemHCjRNxsfQTvC04aTdZeAPn0SYiHWXMUnusRTPNE8er4twaph\n9iCQEbHvDaiN1SyHFF8N49rZtqHjfh2LPSVmJutOCsddXUsT4XeorUTnRRp4\n+sp5g3mxq8+KnrdU9Q48XI5wm8S8lJ6hEWBOnZfX9ttVDwwN/7B21X5J6HdT\ne+jFBDyDA/bzg0H5tukG7IU2VbGJbh6BHs4fBU1Dv+NPhpZ5xhBYrPRx7JP1\nu1f9skIBn/JKCiwP39kD5hU+hEm2KkW8gJ33O0hLL6LSu1SxF6+8cSohIPsb\noWC94+mVqV6R9kLMV0BD9Z9GQSsui+UbewtgYXXvD+OBL2xDoRUymGt36XFm\nWApHMHsKYm6ftsCpVBqnCSawLMSZQw8wCXH990kghtyjci0Fp5FLqlimnY7a\nfTsaTv+1O3Ix0OpOgbcwO8EHJzFJTGIhAXQYuj5BSZDu1w3ALm0J4Fa7ae6D\nKTbuIM3zpclHdVz61suioprY8sU2LyPwwrVUM08KYt9wJkdqw057J5qj7Y/F\nw/QSdrtUI0yGuugFHoZTysyTDvvQ5mIO3uuhBwLHknFwi9bF40pUdmrRbA9B\nRXxXQcUeizYSiKhsG4VWwQfNMVw3qlWafn3Wjbw05NCKV5DSNW91ZMK+AwK5\ngXyg\r\n=ZBCM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAWG8VvE4AQVy8xIePbNP8MvK/o/U+UI6o27JXceIC8EAiAhTMc0ZleSFv/abs4GSJ/FcD6rhBSxjMnKKkFsZb1kEw=="}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_1.1.3_1584907100673_0.3297328411851561"},"_hasShrinkwrap":false},"1.1.4":{"name":"@mihanizm56/fetch-api","version":"1.1.4","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"test:watch":"jest --watch","test":"set CI=true && jest","test:coverage":"jest --coverage","compile":"tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint . --ext .ts --fix","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","pub":"npm publish --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/api-service.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/api-service/issues"},"homepage":"https://github.com/mihanizm56/api-service#readme","dependencies":{"typescript":"3.8.3"},"devDependencies":{"@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@types/node":"12.11.7","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","commitizen":"4.0.3","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","husky":"3.0.9","jest":"25.1.0","npm-audit-resolver":"2.1.0","prettier":"1.18.2","ts-jest":"25.2.1","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript-transform-paths":"1.1.14","pkgfiles":"^2.3.2"},"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"gitHead":"61adc292287fd3a4b630586cbb0c160598726eda","_id":"@mihanizm56/fetch-api@1.1.4","_nodeVersion":"12.13.0","_npmVersion":"6.14.2","dist":{"integrity":"sha512-7Gikhu0mVuQt2SzYVQkeFQ8a1XOCR0dtQ5131cQqheCuUZEHpwR2wDbhfdN2kMtv9Ne2yNG5ttEowUCR9YEouQ==","shasum":"70daa1e89a52a560cc1a51dc489741f36242b60c","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-1.1.4.tgz","fileCount":42,"unpackedSize":435751,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJed//uCRA9TVsSAnZWagAAQQwP/2sH0sKLYKz6j8fJQq8+\n9Pnp6NyA9vuYF/sV79E7gXpn/0LusKYyVtI8tuov3JdZ2h0y1oL8EvNCH6o+\nXkse+R2LnEWoajsmxNPOTaTqvXgKUiQLxE3eltZ1XQksC2d1+lAUtm+VK9hL\n5Qm8RFYBc5mvMy/NzQkJLccld0pRGxxWWxnbZloOj3DlUMWv6AZeLj1fllGY\nHeHBv6mhfl0xkb01oxFO1mIkfBWd9MzBb2uDU5BeYrRuxEzVBWHePnml0pNd\nVedKYVYS7YmIlLccJZQYrrwrhBvF2CfHQLP6VbcdkreiDkfldj5Uz60vEXo5\nbO0pdtZ8caJ4Kk0nKt/FYhVVTXPL5M4i/n4gA37kn99tpOPX5yy8UPmJ0JiW\nmIQU+6og9LCvXOotZShm5SnG5AWUNN+jLl/oG/NZAWWBOlrj/2HR4tE87fDO\nlr04AQa9wv4058Yh3wZJL0iHtCQjUftvkLnIg5PyZZjDCNZ3lSM/prVz45ei\n3IQGUTO0UXbuf/qSiS3rN0xBlxn9dk7VpRDGuMOzUhtFoQBgivyyNQg8SZyy\n9xkYRmPkd3TkGV63tCDTsTOBLJ8X+/yM97mATkHPX0Zg557CHryds8Ok7wi6\nTFlZuy9Hx1DlavdprKk0rRq5+vempEw1wVrJ2qr2B1uC5/UhXKOJz5UoZIA+\nLyae\r\n=7DrY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBg/4/deJEvlYyTadmo9sD3/YGZzrjIZt6BsMSqklfppAiA3m2YYP0PZYch6M9xMLanWISWgvqHX3m5H7yo2Q7p5Ng=="}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_1.1.4_1584922606509_0.22535134410467372"},"_hasShrinkwrap":false},"1.1.5":{"name":"@mihanizm56/fetch-api","version":"1.1.5","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"test:watch":"jest --watch","test":"set CI=true && jest","test:coverage":"jest --coverage","compile":"tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint . --ext .ts --fix","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","pub":"npm publish --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/api-service.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/api-service/issues"},"homepage":"https://github.com/mihanizm56/api-service#readme","dependencies":{"typescript":"3.8.3"},"devDependencies":{"@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@types/node":"12.11.7","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","commitizen":"4.0.3","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","husky":"3.0.9","jest":"25.1.0","npm-audit-resolver":"2.1.0","prettier":"1.18.2","ts-jest":"25.2.1","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript-transform-paths":"1.1.14","pkgfiles":"^2.3.2"},"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"gitHead":"7f60e44e5b897fb496d72c6eca58f850270850f0","_id":"@mihanizm56/fetch-api@1.1.5","_nodeVersion":"12.13.0","_npmVersion":"6.14.2","dist":{"integrity":"sha512-q21g923pcce51ht9qyuXNbVBr3X0QRG5eD4dcFfEr3d7HrQDoR32RTOk10/w2sadkS3R7NCJ6tG7VlkcDXwytQ==","shasum":"c534ebb281b290fa953f0c40047b27bb25486280","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-1.1.5.tgz","fileCount":41,"unpackedSize":28858,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeeABgCRA9TVsSAnZWagAAGCsQAIPxmhTNZmxQ70u1MnFD\n+GBwDTzXbXtLx/YdZ/XomcKsTJWd7pl9en1DP5yMymBPBnlUVbTZBVGCS2vp\n5tM+JBglvpGOkGb3588TFnZj3XE1R6nGLhGTp3wmK5GAUAoVkP6OqYcr7MGj\nDNY4LbC0b0FruKe+C1en33oXj19ydRwRMOW+7rArJ0Kjuc52tPHnbqxXu6ca\ne6r/cjb3JIXZsD8IUtExq7JMl2KJsfTq5VawVV+wJ1JKtA9z+V5wS55AsKZh\n3XbWG0P07/rM39nHeJJmSeTHe4tmQIn3XQzBQEySZe5gAF+5Pb5JEQMySVOu\nm2hWEcmqGzLHCg1wo2JfsZug8u2IHRqOlGr9ddlaiphklpfaREgL0Nf2VA+k\n0Iioc70Zthiir2n1XNwCKVi1RIweqahbSS9QkmYM3/ZotIUub8hlUx0j3vsi\nuEYM/vv5K0nz1N7Q/a+I9vRUyNMwJIMVnwjrRO0pKLEB6Ok/D3WoiuvxyuDi\nmnt8OqA7NPnJvOWJkj+fDeOaEe1eW8w8wMZuZSuGd3c816c9d4vFTGk4BiS+\nyZaKFOOUvGNWlM1hsJThMYQl/F9bi+Q8FoZPmwKxH3wQBWJha6mlBCdwzBiu\nwvaCVYEuZQG8LU5hLZc3h2KmyK94oaXromJ6jwm9uxlRF1LBFlPJMdRHazdX\n3rPI\r\n=XzQY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCaYbq0Mtdwnk0wXSaUtO5Tt+WwnPngAJOANsEV0hV5CgIgR835Tx4uBhbMhWhS7Jnjck1ML8/vaaUWR2US7xoMG+4="}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_1.1.5_1584922720259_0.032670769824855395"},"_hasShrinkwrap":false},"1.1.6":{"name":"@mihanizm56/fetch-api","version":"1.1.6","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"test:watch":"jest --watch","test":"set CI=true && jest","test:coverage":"jest --coverage","compile":"tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint . --ext .ts --fix","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","pub":"npm publish --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/api-service.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/api-service/issues"},"homepage":"https://github.com/mihanizm56/api-service#readme","dependencies":{"typescript":"3.8.3"},"devDependencies":{"@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@types/node":"12.11.7","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","commitizen":"4.0.3","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","husky":"3.0.9","jest":"25.1.0","npm-audit-resolver":"2.1.0","prettier":"1.18.2","ts-jest":"25.2.1","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript-transform-paths":"1.1.14","pkgfiles":"2.3.2"},"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"gitHead":"aba0ad6d417bd9363c1d78a19810cb4c27744790","_id":"@mihanizm56/fetch-api@1.1.6","_nodeVersion":"12.13.0","_npmVersion":"6.14.2","dist":{"integrity":"sha512-+etxyAz/aC9VFehATkkw05paJASDQ2OGBkyzys8p1KCtIMDy9/U57iZrzDjfVdPBL87OoZfF+YIZFwjnfattfQ==","shasum":"bd73bedcafb6044098d7af517f09182592b17a15","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-1.1.6.tgz","fileCount":41,"unpackedSize":28854,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeeAKKCRA9TVsSAnZWagAAZpYQAJ3dF2ZRdCDJyVvKerfV\nt6Pddb7DU+rslTEaz9+iKbqdynivPmv6DF/4ONiqOzcHDE6n5eB8hfUH8uYD\n6K7oLge3DHyzrb7pVZ4zfJhKsLSjPUKrbrZnnpM5/w0JE2Cuus9hHVlL9TUP\nZJFs5DhXT6KaFy/QOWoXd7oBZP844uWOSGmI30smJqLmXdBA3TAivc8bjwlJ\n60s8MqCkgktSn0GMLn65nVYIqSlzzdWc/SomPPB8XSkSNslWZk/V16FA6sqG\nlj8krmKD1wCTj4Hj/77D4z9ssycebKj29SMZMNoQNFYDnOY/yQPRZb9WgC9r\nBbfJ4sjJL9b6mjluHmsUSNtzrkH0o/4RiWNj+F77tmNE0NccZPJjwTsH4BFu\nX/z0lc0kfWU5FKck0d2brHujbd7SSFZSw58CiKf9PuE4pah8QybpO6jf3RvI\nWuXgHvtgaHCcfGlVGLQ1YXYLS8lvfSqdhf6YJDaX0inxPNwN8OnaTgH1/uhn\njHWhwXKyXnBhmI2mqINCt/wyIG+b5UzBABJTbrF8ckp0cctZpu4B3yBbhsoZ\n1KNZafcv6qz1BI6ZEXpqHon/vE0A+Tk1so0KzwuSMiLAzLD+cMOtBrdQofOt\nkXAh0uoba1EKrOx0IhoELyDkQjlgoYsN/J9i5y2VnMxNUE5D+z0qfNg+loEe\nO2l6\r\n=Wxeo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIERMq0SUenQ0KVEv3li8b0hCyiqSVk8nbDPB5+pRKJ5zAiEA9WjkhaqP4GGTWFxrq6RSqeyEWvgcBJJOQZw0Eji4CA0="}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_1.1.6_1584923273946_0.8860132654418886"},"_hasShrinkwrap":false},"1.1.7":{"name":"@mihanizm56/fetch-api","version":"1.1.7","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"test:watch":"jest --watch","test":"set CI=true && jest","test:coverage":"jest --coverage","compile":"tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint . --ext .ts --fix","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","pub":"npm publish --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/api-service.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/api-service/issues"},"homepage":"https://github.com/mihanizm56/api-service#readme","dependencies":{"typescript":"3.8.3"},"devDependencies":{"@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@types/node":"12.11.7","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","commitizen":"4.0.3","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","husky":"3.0.9","jest":"25.1.0","npm-audit-resolver":"2.1.0","prettier":"1.18.2","ts-jest":"25.2.1","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript-transform-paths":"1.1.14","pkgfiles":"2.3.2"},"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"gitHead":"d3b58e4477d04be57c15a9746898cc171cd0b764","_id":"@mihanizm56/fetch-api@1.1.7","_nodeVersion":"12.13.0","_npmVersion":"6.14.2","dist":{"integrity":"sha512-8prMQVxaPeHmjw/r0i5gzOgs/KHfWG0reyCeDTZ7AaKZiZB2guHlVAecffGJRP9BVPPwkN4g8EpRsU1gLzNg6Q==","shasum":"0ecd44d01557ceb54a0f152564b4976387d04e08","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-1.1.7.tgz","fileCount":41,"unpackedSize":28850,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeeANwCRA9TVsSAnZWagAA6XMP/3CutJT+UuYkBhtEzDq6\nKuCPivp+InpZKJA2tnE9oz04awcILYqWR19x+tY5nRw2ERgC/I6vpFywbY06\negsCZL+RLpOw4T6TDhy4QXH5iWzg/Iu+VjQvWoE8TGxXvtn4QfVe2MjRalm5\nADOllVVnDDGcOj4Iub5F9PYjcuiLgtJAVB9csjg7IVQu6z4f9OMX//Fb1aav\nhYmHu8V7P/wQkvoc0pH3fxeMcfIqOqSeuLMaQt1006Zm+Rz7JnpRh4dDm4tG\n1bfa/Mu1bhZAdW1pCiQOM8SXlnKahI4ug1uKC5opefg3g0dWqHXTcmucfTFW\nbr8N1f+uUW0/4i+4OezGtsGYBTAw+CpCUeE0FA+tFQDGKkBtEps9d4W2SHeL\nv3NTPusDt41bB5zxep0D4+ZkySSxzPUZTpdtlXPhaks8LtwfR/Ff5TJxKj6t\nGq2DAxDrst058Fo5sq0DNNGHbYQDnIE/v3tOVUCwJOA8cwYZPpeSBRzbE6vl\n1L3TDMQ06cNsjR8Pk56sso2dL0fnwx0I74U0uNvI33j6dULmsojvmIo7Yj2P\nLjV6stbb4zLu7jir5ixxsOvpP2EMzkmCsJtWQ+2UrBsEPQy3G0cKI4/AOkcg\n+VXdru8EIFbx1/r/FjWdf+XHZnny/be3plNTbXHZ3QTGq6Z6HYtOCxh4WIk2\n++Sl\r\n=KKPB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD0qtaY+FGY0u+Cg7lgCkJPn9e3iICjhxz2vxxNr9cDiwIge23z1qSwqkYfVl1E7OF22jWyVounR6BwzRaLWF9F3rs="}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_1.1.7_1584923504000_0.08562772793222662"},"_hasShrinkwrap":false},"2.0.0":{"name":"@mihanizm56/fetch-api","version":"2.0.0","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"test:watch":"jest --watch","test":"set CI=true && jest","test:coverage":"jest --coverage","compile":"tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint . --ext .ts --fix","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","pub":"npm publish --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/api-service.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/api-service/issues"},"homepage":"https://github.com/mihanizm56/api-service#readme","dependencies":{"@hapi/joi":"^17.1.1","@types/joi":"^14.3.4","typescript":"3.8.3"},"devDependencies":{"@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@types/node":"12.11.7","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","commitizen":"4.0.3","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","husky":"3.0.9","jest":"25.1.0","npm-audit-resolver":"2.1.0","prettier":"1.18.2","ts-jest":"25.2.1","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript-transform-paths":"1.1.14","pkgfiles":"2.3.2"},"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"gitHead":"3a6ad4e200ba3fc361663077c9aeb9feb6b84d86","_id":"@mihanizm56/fetch-api@2.0.0","_nodeVersion":"12.13.0","_npmVersion":"6.14.2","dist":{"integrity":"sha512-uPQc2efmpJ47YD6HHts0brlaijGzfzLvfmwBnr5eV8nSM01QxjgsCAFGzEWfW5h30IXDc6OyHq9xNlxP0FVCJw==","shasum":"86d42684f48c8494aada71b26f7cf979741b7343","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-2.0.0.tgz","fileCount":41,"unpackedSize":30152,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeeVHOCRA9TVsSAnZWagAAnpAP/Rca47BemRShZ7qIybGZ\nLr/8KD9IzAhKRzubhqIKuL1poRk4kM0pgECsLukQ+imiLZ+2vOseXq4LEzbx\n74b8XWdXgTqNoZeHDxrjNWphb6VwvQnHRVFvyRjCUf0k7e9IUs9ak6kPRzxn\nJgn19V8Vw1BmTdE5qPnQnCE0QcBh6qtRCvdOgLOVissytG1bZsuXnhiCVdcq\ncS0FYY15yLTkSLid3irJyBm78CLxYpBwq2vY6inH4artHx/hzY05X0iujMNV\n9Xf0zqfsuVgVHeONIZ4H74z0o+JZ36QUyKNByba2ZcCbjf4K8QT1/jnAHKtl\nt8yT3Vn4na+ea54i2F+UtH2B30KaCevfCZHbLkpmuzn0cHvEe+e2uB5YlCyV\nj5YI2ekKr+rnB0Vxx+wqEXsQmpb/KwGirXu8vxZK1LUkU2HUNYnXaW3YSejL\n8H7dWEeLpQwMftrwm1lcHiYruftH1eQVjjbxIy3AI7i1+Xm2ouE/EbrI+Y0M\njodqSS27y8erTpKWInemLCLh5cNYBl6XJDttSD5CxxgaupljaS2mMyKJ+v5I\nwWJIYqh33AZWthrF/POQJFAmOIu4d5hFDnXsMTDUjYpmGq9vHxRWnk3szQan\ntoyDIqiA+cqBkEB3rhJLlGoTyrbVWi2FJMxwBZTLgUx+wbv8/TwXJ1iXCj6O\neSoT\r\n=f1ys\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAsxh5AMFoeUQ8r9yqWai9al3HgIApjgGWj4qiCsaq0oAiEAqneF8KZHrFISUS++HGyXDY9kaAwiYeCj1nmBqtgBIhQ="}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_2.0.0_1585009101906_0.2798519106491102"},"_hasShrinkwrap":false},"2.0.1":{"name":"@mihanizm56/fetch-api","version":"2.0.1","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"test:watch":"jest --watch","test":"set CI=true && jest","test:coverage":"jest --coverage","compile":"tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint . --ext .ts --fix","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","pub":"npm publish --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/api-service.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/api-service/issues"},"homepage":"https://github.com/mihanizm56/api-service#readme","dependencies":{"@hapi/joi":"^17.1.1","@types/joi":"^14.3.4","typescript":"3.8.3"},"devDependencies":{"@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@types/node":"12.11.7","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","commitizen":"4.0.3","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","husky":"3.0.9","jest":"25.1.0","npm-audit-resolver":"2.1.0","prettier":"1.18.2","ts-jest":"25.2.1","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript-transform-paths":"1.1.14","pkgfiles":"2.3.2"},"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"gitHead":"5ef9bfd53470e4e951a26d2c8acb3c635f1c7a7e","_id":"@mihanizm56/fetch-api@2.0.1","_nodeVersion":"12.13.0","_npmVersion":"6.14.2","dist":{"integrity":"sha512-DY8Lw0b24cMiRHTFdhmchF9vsQSasriZrRjV9igGxn5yeBXNNWRdgIsUABg896oP2VboCmIuhu4l/VoUwjey0A==","shasum":"1c42009db6a8f39fc5922b2dd93ad74568a8f128","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-2.0.1.tgz","fileCount":41,"unpackedSize":30175,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeeVVHCRA9TVsSAnZWagAA2PAP/R1vMhL0kzbvDL2Kt0PN\nxFqUgGZ6+dHwqSVyIeK8Jw4XT6QckTSW4GF9LuEs6aYnwIsoOOgbHlkGP1lv\n1+M5mb44WAf4/sMpADEjQt/Hln5c/Pw2bnquzHmV5qK9HpOmJ1ESfWJx8l/n\nKOwaiIWO2+S5QRseb7T82Mn3oJ/UIU7JRy73zt9TIyIjlRfGIaSzk1c8yTsY\n6T+mBqVzRBtmkl4d2o4FLbqIgQXFtdkYE2PZDzkP9cCIUImszIWPlcGzq7i+\ntl0I5DyZ8KsBrHuaQd1EPbJCkmqFRQ+jPpYwyZGPpax9E3GKNfjJb+sbbu4C\nrPZI4vnIsY1DB8iTSTQuMay4+LJ7bf7ZWCTnNPJ3s/YkNLSGyagjdAo0vdFG\nM3T0YwNTApN3xUf9iPmqOmVOu4Kw/EDpIzGwPuSIVIWikf3XR45CddtgnOVB\nay7vlf7rvPFOni5asOAcPkbuJbU+zvCdH3Q4vtohMJpNfQOQ5mwf+xYJNRhK\nLl21ryEn0w4FFb6SYRaftus2hjJPge1A8jLwCOSbR+9yg8lIOFqJcxHSKBDc\njVzflpQQmd5TpvpLDUol7BQCqjq78/jGAOdoQLoO0tREjVTEtLiLfn64FZU4\n7LDiEwVWBWAaVNhyk0MF4yJd+X5bttbDZRXLoZ5Yj7txYsAvsvz5vtLxYsA+\nWjH8\r\n=ONd1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDN5+sFngnMRGmPDEGWFa3COtInFCRA3ALnozAvfTnCWAIgMl+vHdz0YEYPnqH3soxoh6AoM2Mi6M9mLHFOS7IvZ5M="}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_2.0.1_1585009990810_0.8942117226660866"},"_hasShrinkwrap":false},"2.0.2":{"name":"@mihanizm56/fetch-api","version":"2.0.2","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"test:watch":"jest --watch","test":"set CI=true && jest","test:coverage":"jest --coverage","compile":"tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint . --ext .ts --fix","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","pub":"npm publish --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/api-service.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/api-service/issues"},"homepage":"https://github.com/mihanizm56/api-service#readme","dependencies":{"@hapi/joi":"^17.1.1","@types/joi":"^14.3.4","typescript":"3.8.3"},"devDependencies":{"@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@types/node":"12.11.7","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","commitizen":"4.0.3","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","husky":"3.0.9","jest":"25.1.0","npm-audit-resolver":"2.1.0","prettier":"1.18.2","ts-jest":"25.2.1","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript-transform-paths":"1.1.14","pkgfiles":"2.3.2"},"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"gitHead":"bad1a99a2f7deedda72a4297d40de4d599abc504","_id":"@mihanizm56/fetch-api@2.0.2","_nodeVersion":"12.13.0","_npmVersion":"6.14.2","dist":{"integrity":"sha512-qTB/mT4aSJTgHF5g09mEtt2iY8gikC07Ise0WfDFZBmmwWZZlkETKE8N+UEq7CiWAa9B0j4BIaf6Qdm5vtrhtw==","shasum":"42e27b6f87eb1daa277ef450f6213af13b61dc84","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-2.0.2.tgz","fileCount":41,"unpackedSize":30453,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeeVe+CRA9TVsSAnZWagAA+/EP/3VjXkL/SKckC00yvP2P\n02la2k5lYx5s7Vf6rIFaOIUIMEAdZqZ/FbvoJ8FnKw4Rw0/zEtaHZI2lSSft\nQLVzDtyrXvgB2gzqGpW0hJTF9QMc8APN4Mdu9abHqoiBRh3SvKWP3srh6E3h\n0OG7qe0aIRfqOlvwgg3MaTuNNGMGYU3ksdFWipGCzu+ZMlzSeyXqGWtZ06qO\n6uC0iYCp5umF36KkvurPaP2P/VrtjCwyT1DFRnU3Bn9TPkHgu5ZuTPei0W1O\nQ2Ku1ebr532EsM4hNfk+/jfnSwPTKamRv5Md/4dM/u0rIxl/Yf87weUbeegQ\nOsxKIpuIZ+CAEg8e5cq5jU4tzMhrno0rNI5qp+yJBjYhLrekcYBevkLa1tBp\ni6hr6GdT58Q4uf6RMfy/udt7SL5P+WoWKq0ArPn32S4Zqg+qbJZhqGlzmdOS\n42JrnWEJZeTaBZ47SUeapDHHyztqScuMsV+/JdjHoH4eL2xA02KI839ihHkD\n//58XwNa0cmo6rcTnuCbbz6cWGw32U8dpcJEKeUYm36GxsYOyvDK4XokoDir\nUgI0J2XwWWbW+XVkvfIkwJ0TnfZqj2ZKggZVOklRuLDsT707xxH3kwVXv5gj\nQGcXBkDgomCPY9vxJ7cyOcAIQxb4UjHxjuwpFdrjNpXRyOH8c/iUIaNRnQJ7\nL8HM\r\n=jHbn\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEmR7WEtxgXwM4qh920uYwkAospnTKwfDPDAjkR3EuNVAiEAieJkGA5QcMvsGgR1AcGWIpLYXYescFLDA29R8fi4VRE="}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_2.0.2_1585010622444_0.2574035094826381"},"_hasShrinkwrap":false},"2.0.3":{"name":"@mihanizm56/fetch-api","version":"2.0.3","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"test:watch":"jest --watch","test":"set CI=true && jest","test:coverage":"jest --coverage","compile":"tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint . --ext .ts --fix","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","pub":"npm publish --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/api-service.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/api-service/issues"},"homepage":"https://github.com/mihanizm56/api-service#readme","dependencies":{"@hapi/joi":"^17.1.1","@types/joi":"^14.3.4","typescript":"3.8.3"},"devDependencies":{"@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@types/node":"12.11.7","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","commitizen":"4.0.3","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","husky":"3.0.9","jest":"25.1.0","npm-audit-resolver":"2.1.0","prettier":"1.18.2","ts-jest":"25.2.1","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript-transform-paths":"1.1.14","pkgfiles":"2.3.2"},"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"gitHead":"5ed7b9508c072bc98a90fd29d849ebd76ac2add5","_id":"@mihanizm56/fetch-api@2.0.3","_nodeVersion":"12.13.0","_npmVersion":"6.14.2","dist":{"integrity":"sha512-GQ2pdsmbR7Vq8qjL45yIX4V1hJBZmvUw3aY7TOpvz8HOQH+0Bq+yT3sB0F9rv3u89G4XA4VwRlhM1RAiLoMsGw==","shasum":"0d24fd030fdd41bdd27d488e217c947e6ece379c","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-2.0.3.tgz","fileCount":41,"unpackedSize":30458,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeeVh0CRA9TVsSAnZWagAA5gAP/RUs0mNbDfX9Wyh44hQf\nrNB+S2W/fZaOTIpX62CQ0I5IyCzsS9C6ABgTJ89kpjstgnYXrOTRiTtpQUiq\nlolOYKITkyXqcgzflb2+sao3fuk+nZjqAu4+b1IWXbJNdMAouYFVeKpZL+Vo\nIeEF6NwEpyQ+1gUBI1x2vESfja8vN8a6YpoXdXhhxezDCS8tD+wwF8aObUvM\nu8usoDocyP7UoTMYn72W8xVWKG8uTNgtUUBRSfQmaptRwFI4NXvateNZdGkt\nvHt7u9NrbpAQlvj/U+sDV7r1hpaS6FotTEqiM97M9QHlNlwWzTQcc++azGc9\nZVaDvu7Fjc2tikAgYXcP9p/9EcTQ4hHadNc7RjVF6UYECxFtcs0ChTZWsx33\neS+HTTCDik7AP3WikEFqnc23AYcX68Z/cfXrGWWqI84fDrEXnj/oyJC805fw\ngHErhAQrgGbu5ij4J9l4pkyEDJKKOGbbANq3OWItxytSezcQk5X1M4N0M6MI\nLg4aCcbuzcuxRZ4k/bFHwRPF27Zc+IKPwVQRAaA0io52sa+xTmSt94c7gF7v\nyb1MsOQoPujeEwNSymFAw5peXjuTpziNwWH4f/gn221/Kpg0vppxavotpcI4\nKZXtukWhjNblvd+NgiKkv0ZkaMdJ8cqZTpN/CfOWa3J8z2ziSTPWFs4nmWZQ\nFdhp\r\n=ZLlZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC5ltO4ms0cBzR0OUT/gAmkIwjGvRS1LsK2r10hY+SfcQIgSxoDsi3ZLsdCBMDcnj+sUBo/dOPSWrXor97D1lfrnwI="}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_2.0.3_1585010803796_0.38348347685395967"},"_hasShrinkwrap":false},"2.0.4":{"name":"@mihanizm56/fetch-api","version":"2.0.4","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"test:watch":"jest --watch","test":"set CI=true && jest","test:coverage":"jest --coverage","compile":"tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint . --ext .ts --fix","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","pub":"npm publish --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/api-service.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/api-service/issues"},"homepage":"https://github.com/mihanizm56/api-service#readme","dependencies":{"@hapi/joi":"^17.1.1","@types/joi":"^14.3.4","typescript":"3.8.3"},"devDependencies":{"@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@types/node":"12.11.7","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","commitizen":"4.0.3","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","husky":"3.0.9","jest":"25.1.0","npm-audit-resolver":"2.1.0","prettier":"1.18.2","ts-jest":"25.2.1","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript-transform-paths":"1.1.14","pkgfiles":"2.3.2"},"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"gitHead":"2b9714093bf72b212bf80d502acadf9bc9241d8c","_id":"@mihanizm56/fetch-api@2.0.4","_nodeVersion":"12.13.0","_npmVersion":"6.14.2","dist":{"integrity":"sha512-BwVuJdfJxMZfa0e4yNgMkQ0H9qf0LmHCUBzh80CuynDJReuJvceuqVF2gy3v2sWZkNWPMdKiPcYS7HLDF3c2LA==","shasum":"326ff39121021ccb7c9f85fa80ae74b5843bc0a9","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-2.0.4.tgz","fileCount":41,"unpackedSize":30556,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeeVvrCRA9TVsSAnZWagAAY7QP/Rs3XgO/1xNC3lcuKPsL\nbZ93eBQ6dxi8tva+CnVRzsuLZYWdxK852OmWnZ6fkYTBAeR4lZ0RjWzw2oiQ\nIWct4E/+vVjsy29VRIxcnYd4oe1THYdDP8cuWAWx4LIQzN8e/lngAnpHHiVp\nCvVTwvokIcREh+mTOpHudbj45rjrzvTVja1LiGxmUbSwh0H0mTdeOb43S0mh\nr2q1EeftBenDAnkm/6cR73Uyj77JPKjx9AE2sakjIO7JVFNftaHEYUcXdcMy\ntTnG8KfL0jPpoz82PagfD2aTyZ/AvR91Ut8QjOjKJ7DsrTxoa+suozfZ2ian\nbrobLc3C7G3qU1Hr00fwdWG9u8bqlrWh8PsXN9L815uhACRZGIF53Zep99m0\nRm7gts9ZW9qibUSJ3rqT5mXH01UKavQuiURge9AxtSDPK21pApw7ITgacOGf\n2GfnNzbyhy3ORQZetwI37D5Qc7v9+EH4uvJxAe/BuGaDfvHUWJD43OY0l7Qj\nhSw+O31uyygOe/JQOGGgc0aQvRKuYDEz0Z6ZNtl7nFNUqLjwxDmb668YfjHq\nCycy2cBMvzdviUS5l1+WxD+BGHWagsbCRBIRaXIG07X83WQ4cjvJSCMgtVVJ\nKQeeCO5kRZmQ0Y2wtcvetSKNBg8LVmxe6WpKi7n0H7XKD+y/xK/O8KFVSahZ\nvyWS\r\n=uuMn\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIENDBLWB8FmtlpVNhCV7zmy7YzQ0AQpnos3T9NUTotP6AiB0SIsKVST66XTFNOZCNz/y/AskAm2viArOIdTNj6XBNA=="}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_2.0.4_1585011691191_0.6912761869780188"},"_hasShrinkwrap":false},"2.0.5":{"name":"@mihanizm56/fetch-api","version":"2.0.5","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"test:watch":"jest --watch","test":"set CI=true && jest","test:coverage":"jest --coverage","compile":"tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint . --ext .ts --fix","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","pub":"npm publish --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/api-service.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/api-service/issues"},"homepage":"https://github.com/mihanizm56/api-service#readme","dependencies":{"@hapi/joi":"^17.1.1","@types/joi":"^14.3.4","typescript":"3.8.3"},"devDependencies":{"@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@types/node":"12.11.7","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","commitizen":"4.0.3","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","husky":"3.0.9","jest":"25.1.0","npm-audit-resolver":"2.1.0","prettier":"1.18.2","ts-jest":"25.2.1","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript-transform-paths":"1.1.14","pkgfiles":"2.3.2"},"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"gitHead":"6e75c3813bbc0f0c695f42cfc0673521a994843e","_id":"@mihanizm56/fetch-api@2.0.5","_nodeVersion":"12.13.0","_npmVersion":"6.14.2","dist":{"integrity":"sha512-vSp2tkyjQfxyy1iwN+eLZ+HVJlYdMgGGIk4craWi+nFoI+mt0+PeEEDQ+enaAKVwC0OWwk/2A9hxiI4NHjfPUQ==","shasum":"2ee0b46ac7c54d02aaa60b0ce4c3574e102a664d","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-2.0.5.tgz","fileCount":41,"unpackedSize":30509,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeeV2mCRA9TVsSAnZWagAATJkQAIqjTpUwSKFtf0f6kkAm\nFFiMQmun8XUFrS9uJ65TnK6EK+gQ1i+Mc3A7Rf9nfmg0wlM0ZMy9CC1fKf2+\nbYVlHo0PZg0F8TEiDtRvaOK1MiMD8vCJUuFW2Dk/RoVBP92VzRUS86vL6j0z\nl3KyiwSN/fdQx64fZKZsWEnyegyKWMm3joNRiKyPcl0Dne9PohCz2qbjoaIm\n54VRCnvomjsa8eDEg77qvWTG74EKv5klQUknuwqKB5gwZT42QOnLU8yb/ZZP\nKLvufjqo02lmTP21OPAqVtdAfK+3n3bG/ajGcW/YQcFMxm7QdU0CeFIEeY5G\n5Vj/bD5PmuB7Fdwkulw+csum/IOf885JqtWKM/rNqexcYZYq/CPmsCRaQ44k\nYuv0yOBMp2Tj3OqHI2hMJLMUUO8B9eDAPMDtP7Mt+HDTagVX7vIPSo23HYRC\nbW1ZDCXLLZuRtXl9ajCrpNbRg08zggBKodc2jn/ModvnXIrA1PZqrZII36pM\n9KYRkiHFO7giDOX5Q2znEJBxp251tQ4yy33Jr/nmzWrNhvzXvsSViS5mVLST\nEDtDOAcDDLd8MePV9MCfzpazKRWkZw4EHWJbr7zfi5wc94ishv+ulEGZnJOB\nO0Euq9DMYfZtWs2rbIM3IvEthV7RNNHicEw1xcpAyPbjbsV51Ld/9RIz9zwm\nLi5m\r\n=kUvb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCM41XpkRDRfHhSn+IhiUCZ4A5AdGm8UptOlF/MrQwFbgIgIZsJiBiasCZjRpD/zcXm96AAriNC0q7LaDFbFTgXg40="}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_2.0.5_1585012134327_0.4588621082602853"},"_hasShrinkwrap":false},"2.1.0":{"name":"@mihanizm56/fetch-api","version":"2.1.0","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"test:watch":"jest --watch","test":"set CI=true && jest","test:coverage":"jest --coverage","compile":"tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint . --ext .ts --fix","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","pub":"npm publish --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/api-service.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/api-service/issues"},"homepage":"https://github.com/mihanizm56/api-service#readme","dependencies":{"@hapi/joi":"^17.1.1","@types/joi":"^14.3.4","typescript":"3.8.3"},"devDependencies":{"@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@types/node":"12.11.7","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","commitizen":"4.0.3","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","husky":"3.0.9","jest":"25.1.0","npm-audit-resolver":"2.1.0","prettier":"1.18.2","ts-jest":"25.2.1","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript-transform-paths":"1.1.14","pkgfiles":"2.3.2"},"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"gitHead":"e99aafa7ec14fc79f805c24c00c34aba407cf360","_id":"@mihanizm56/fetch-api@2.1.0","_nodeVersion":"12.13.0","_npmVersion":"6.14.2","dist":{"integrity":"sha512-hcy59nYXtorVw7wEEby9FiScwlvfKi94DM0AZwsxgYGuzEBZQew4SduPdIlXuDBjKsQlOd2D1Wsctc4vwrd3cg==","shasum":"739c52a93dbbdaa5b6533c569e566f4231532b6a","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-2.1.0.tgz","fileCount":41,"unpackedSize":30638,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeeWF8CRA9TVsSAnZWagAAAEsQAJDZbjrbNj9UCTbbfdfe\nIMVTFfnijBUy00hUhYiMHZ/yCQURQgoJRfzMP0aQIqo2I3oAhASqIePEuI4k\nFEljrQU17MRh9RmOBhz6fHIDAKrQe8aaDebrhiwUCJf400BWeCxTWRJXTtVk\nXelDEnltzx7UiOC7CfbozWkrDBDWLAqpwyypjsGiC2ABorR5eDB/9FIx5puT\nAtJfpsBRcsV98fbcgjGl7St84ys95r0OiIOaryj4JJGVBgb7N0QmiR6hGv2A\nSCp6Dgil4fFyHrRyn5NtMVtrNLPM8+8RwLFZfoLNKBt0a5ETdJa3CCEp8TEz\nVqt0ZxAyQr4Gx3eRjvU1ffdQ2YhvUvRBYP85WxhufcsTwJrXKyYb+5HFtchk\nQW09XUmN7cSqtcL6t/hkYBTSA2E4soIrSoK1uFrRniRl0JhmkoYljG8GOFWR\nr5taSqn9D/sK2gUuOT9OZJevWgn4ej85O8y+Hu0bQJLiVzBtngndIIpPj3M+\nOHsgmRXGiDWwNSF+jKMAt7lcS7SNJ3BGsvRiTGB3I2LIWOR3UxpQK0Hpudyy\nz89r6s7MqtIOFjRHudSWQ9EcHf12FbrM0TUfPZ5FVn1h1XprJ2qxuP2yNGPi\n9xQp/HiKKgDXvA8X9OZc7QVYw8U5GZx9tOHDG/kW4UMQ4HZU5LrpDNXZTEHQ\n5Vf/\r\n=qGD+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHjOcUs4/+/LS89cxZHUt6zMlrtYsDosP1l6dGipwxd0AiBPlm1nxKSIfdrXWCdNGHED4Xpq/iQDAzZGuTeDwV+EjA=="}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_2.1.0_1585013116497_0.20903060498884662"},"_hasShrinkwrap":false},"2.1.1":{"name":"@mihanizm56/fetch-api","version":"2.1.1","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"test:watch":"jest --watch","test":"set CI=true && jest","test:coverage":"jest --coverage","compile":"tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint . --ext .ts --fix","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","pub":"npm publish --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"^17.1.1","@types/joi":"^14.3.4","typescript":"3.8.3"},"devDependencies":{"@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@types/node":"12.11.7","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","commitizen":"4.0.3","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","husky":"3.0.9","jest":"25.1.0","npm-audit-resolver":"2.1.0","prettier":"1.18.2","ts-jest":"25.2.1","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript-transform-paths":"1.1.14","pkgfiles":"2.3.2"},"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"gitHead":"1785ad9080bdbe0541a2809b193d994f46b6d80c","_id":"@mihanizm56/fetch-api@2.1.1","_nodeVersion":"12.13.0","_npmVersion":"6.14.2","dist":{"integrity":"sha512-M4UIZhplczMpxv+bzuKkHRiy9CZDnhmf1aH1q9JSDJpecLywPWM9x+27OapF2advqDUy5GciGe/SUVFOJnpE6g==","shasum":"1683686283f5fe817967a77755b58c72950c242e","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-2.1.1.tgz","fileCount":41,"unpackedSize":30728,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeeWYqCRA9TVsSAnZWagAAoWMQAIp0jT8ZPftNExXr8gwd\nXRtgqiZnCVo0cilxr0oC0KE+VWzZbOVJHd6YmKpQd6M0OCzDO+RK4T/zOB1F\nzHRPtytegYiFiU84TC+3PG5AUL8sr/TmODeMz0zeOXjmxjXEkjtwqHJPtUse\n99ioPEF96w/1YZjHP/AaS+OepymvNA0YWmOxdJZNRiko9uHHPXRMJLBz3/gq\nyVZ3ZoG5u9WNbW4zrDCRdvJJqsWzImrjL3QjKLmX4fiGLpiBuzMANWLbpKAD\nHf54n7hfLMQ0unypDBZzC91EZL0SeVU8T62piMqmRyzEPqr6K7xEiph7C1rS\nCzByvIHDdptkOkGZfSyqV5Thj/+B5BgzEO1ZLEMHvcAxCrtgO+btYgtnmQvA\n4NvD4/ZpDmHe2NKb/WupH9gt78ltYDda41D3Zm1uT24Swkuq2ludoCXJMmz2\nzpSgBQ8mgZd7nfPHD1pTZpDbzj/q776nVV80HM7oA+s/95zm9oqr75yRxf+o\nIbvNiLeYBPORd8NnMo7fq2Yh2eQp3u+ltSIEP/l5bn43FuyHW9UaPN8citNx\nG4/RIh6mzhIVlrsq9bxObganO843/ZINwV1j3YTwanvkq/Xsn3CmrpwCzEFL\nedu9Axwo/9IGdbZ+JPu0Yr/aZFX3gSsRMxdKBdViPG5uErpIWT7coRBoWBB/\nTtIK\r\n=743x\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBNECyoHyN8rXzJKRv2hKwe8gLauAHJb3AZtiUtAr7CNAiEApS0hEATnnSWLbm4OhIsdmpoWbTOqIqjsAOdZ0NUqtT8="}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_2.1.1_1585014313727_0.7558376643024949"},"_hasShrinkwrap":false},"2.1.2":{"name":"@mihanizm56/fetch-api","version":"2.1.2","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"test:watch":"jest --watch","test":"set CI=true && jest","test:coverage":"jest --coverage","compile":"tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint . --ext .ts --fix","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","pub":"npm publish --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"^17.1.1","@types/joi":"^14.3.4","typescript":"3.8.3"},"devDependencies":{"@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@types/node":"12.11.7","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","commitizen":"4.0.3","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","husky":"3.0.9","jest":"25.1.0","npm-audit-resolver":"2.1.0","prettier":"1.18.2","ts-jest":"25.2.1","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript-transform-paths":"1.1.14","pkgfiles":"2.3.2"},"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"gitHead":"9bb52ba414e8759bfb84878b2ab6955586292b77","_id":"@mihanizm56/fetch-api@2.1.2","_nodeVersion":"12.13.0","_npmVersion":"6.14.2","dist":{"integrity":"sha512-rb/hjdtuv7P/OVCrwhd7uE3mhpPuK3fh+316y8+gDuLWze/PCukxMYuIwzvF+J0XEXRFtp3QfM/AFJgtrDj7Yw==","shasum":"e4de26d031789e3899a22858a6a44ca675c7ea00","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-2.1.2.tgz","fileCount":41,"unpackedSize":31283,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeeWd/CRA9TVsSAnZWagAApfQQAITeTCQTjXRTRAC1qaw/\nvsWrsj3wtyuq32k64/cI7y85j1EBher0fVygsi8UIMUyfOgUZ+3KAMgIz5jR\nAfcvN/MF88v55OGIidO2Rks7OyuiWQctBbK0w4E/JT4NTs6vbc+rYUo/xH2G\nmIr/t2yS2uBs1tN9TQPEHDmPOXmW3cQC6BL5pvhJNqIg304RUDofv8VxebKG\nTyiAQ8ssjvisrDLnPqtxPh1xxT4b3OTUrYlEIZMLTalW8MCzZB4TCUvOKuVU\ndfI70wPy7OAuciGGWCebU8JsKo8l3kQLAWIX3NdTen9eZybv0A9yy2fDIt//\njJZ9hPgnf4bN4ek4x9iGF4Rf757WL7pvo+u6b6jpqr0g4eKDJfrJdxcR/ar8\ntL7DuFI8rIC3rDnQte9HSrUZQIxWHm8x6NbXdwRfE4eySW8iL+l43erVbZSA\nT2vrZiJWu2e2eYMTM+cBsI3HB6+p7ZEzsKMpNt+Ap8HiV/8pkNkaDhERzYqb\nEQU5MhAqWGkJiAJENRyPR70gFDV/1q/FA/CHq8J+TgrL9Slclui7OugOTEhy\ni2u+I3rNKf9NFHh8lEZxpl1ua5oVyFAnm8hlzm8lJZQWHwUc6YcdHUSm3jFV\nlbR5tXfNcSmqkmBH/PQlR3I0TuyrNP/RP1IptivdnZV9k3xnXKPrGpaZvuK6\nbcWB\r\n=Myqe\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCVTF8byzMUs7y06RwiQtqpg919c/lfYbfn/A7gHEWRXwIgc9+Z/OKnEFLSshun3PKYTi83s4Wqv+4CkluCtGKIT0I="}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_2.1.2_1585014654833_0.9143002995891143"},"_hasShrinkwrap":false},"2.2.0":{"name":"@mihanizm56/fetch-api","version":"2.2.0","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"test:watch":"jest --watch","test":"set CI=true && jest","test:coverage":"jest --coverage","compile":"tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint . --ext .ts --fix","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","pub":"npm publish --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","node-fetch":"2.6.0","typescript":"3.8.3"},"devDependencies":{"@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","commitizen":"4.0.3","cz-customizable":"6.2.0","eslint":"^6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","husky":"3.0.9","jest":"25.1.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.2.1","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript-transform-paths":"1.1.14"},"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"gitHead":"ef9a9ef3553523121aa1bccce215b057e6af534e","_id":"@mihanizm56/fetch-api@2.2.0","_nodeVersion":"12.13.0","_npmVersion":"6.14.2","dist":{"integrity":"sha512-Amglo02hcNtbMU98zrRa4U8AAqulLoHkJb2LKid1A6YXdM0shzMjBSlMz4MLs7tM+/2enGuGfv/dlC5hVCD5Zw==","shasum":"6ab8a18240f3b86213f48be8d3157496498fa1a4","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-2.2.0.tgz","fileCount":49,"unpackedSize":48850,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJef9VGCRA9TVsSAnZWagAAIgwP/ioyMM3AAQSOhYm8W3mq\nFpvucUQmTgNW3LlznCMbpK7Bs2iLFahQ2wXs68ChSXWvnmShJBi7VZaYhwYa\nDlh7DI2FJZYTYXVuzsIYsd9TE7EbKOxdC07p8iKExMad6KmdaJricJVx+1BV\n9f59EKZRtCOVGTy1GY8fI+U1dZ2AynoeB0xwnJUucEsIftVes9MjUE46sh90\nib+JqbU7tTjc3kt3vGR3KL9xOFYehbNNvOf5P49FZF1xT1+FxBRSRsRW/k+N\noqE4avyL8Jy7BdaKvlnIoApWMyUoMEOzVeiaF/lUz6tEJVuAz7T6ZTGxdmEQ\nML5rg91A2y3V71vEvNZroBx/2xlLwG/ENUSITTnMgOd7v409DyMzyMa0zTnm\nTe4CLibxjgpVauihFDurzNoRb22TZg1PPUdH76PM1v6j1WEPSx2CD/RDKar9\n3voEct1YFT/03+2FT5dN1xIQzRKSdxOKK8evmNyTRM/u6sE4Clh7B9CiS0yB\niAidxMtVd2LJcyoOYsPVU4IbDYjNJOGRlNfNIL6gCSPXcTP8XAvRhM9JRL2X\n+8KJdmQSNFVbRE2NVBNcouBbqypz052yob9DW9pDH5BRx8sr+X03aXRiiKnv\nSuSzYpc3DjcfCR1+g6oPQU7qyDJ73xYf+4OCtGLgWMV0upWCuVpqVjetwqAV\nlvnb\r\n=RTK+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIExyHA2RD3q8svh72aUjfz8nbsPv7pAWq7mSEbD+FQ8GAiA0HxUi94yTTyexFmuEZfH20C59FlDa71IzIHgZ/3gjVg=="}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_2.2.0_1585435973828_0.8100875556013991"},"_hasShrinkwrap":false},"3.0.1":{"name":"@mihanizm56/fetch-api","version":"3.0.1","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"test:watch":"jest --watch","test":"set CI=true && jest","test:coverage":"jest --coverage","compile":"tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint . --ext .ts --fix","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","pub":"npm publish --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","node-fetch":"2.6.0","typescript":"3.8.3"},"devDependencies":{"@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","commitizen":"4.0.3","cz-customizable":"6.2.0","eslint":"^6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","husky":"3.0.9","jest":"25.1.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.2.1","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript-transform-paths":"1.1.14"},"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"gitHead":"36a229ab7c0a16397fdbb37a134a613bad8afc21","_id":"@mihanizm56/fetch-api@3.0.1","_nodeVersion":"12.13.0","_npmVersion":"6.14.2","dist":{"integrity":"sha512-QtqZerCM4HaykAYEgrikfhMi781enMBqb83BVF2t9GPXrXCBGRrhUmYMFAhMYT63ELJ2nsg4Haxb6860DJv4WQ==","shasum":"c92b286df1787bf9828daeac3deda5b74dde6460","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.0.1.tgz","fileCount":51,"unpackedSize":54961,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJef+ivCRA9TVsSAnZWagAA3AkP/1TAMYDBVmYLEyyqDMcE\nP25N1A55Bf16xZExQ2YMnDGaBR/gId09mS9bb6o0zWPAEDawULHsWfM8Uef+\nyhq18nGyojrmBkUmi0yWtjE9h2NPpcB7XpHE1BBj0Z20d6rwZoP2wEBBBgPL\nLZwNNth0iTLylajZNfeyOmW2zl5+K/U3AJQnL44JS4TF6xLwZDhXOD62bDKn\nbv9455zXv9OGvwWmLsRZOo+dYnzRRWNoVi4B1V5y+BGpX/htVHlNOk7CXME6\n4PyF0l7QcBxdQMSEK47bb5Bz9E4CoKcWJgxkxCs+XCrQh+UK1YxwA0mCkr4C\nVNXVlzoA4wFCmY5Gppjw9wFxv+P7eWrBjHPDBBBdMQuoKFL4bpCcfR7fIF7P\nfkKKZlusJwKa+sdyxzet4Fe+xU544xwUSobh10ov3vFPwmcj/6BcckoFLxo/\noVbaxiDPNrwesrUtRisljFFzz/Lgy5G3pWInapNqvD3l+In94UB4pR/FCWqE\nuARljM7JR5BO5taPq4F/tI5myLiJDqqObWDv5Y9b23SvClsb9oFJrRTTEupN\neaDmwimdnYoFFndUHV8wHkwlyv0Kb+eXUaEYr+yEdYpJHjxPyFIbwHVW5RhX\nnUrsKHLaI7y467yqXRU2cLhVujJP7yLiy47GeBWs1SQezT5lNfeR0TiiFmIc\nv5nq\r\n=IqBS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDsJP/REWKT5696UJVXwa80eO3pVvgKPnEcJfT9GVEZwgIgX9kKne0Whvro7uj3iV1ovulMlgsOn+jGYTuifRB/rf8="}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.0.1_1585440942939_0.6429518710148392"},"_hasShrinkwrap":false},"3.0.3":{"name":"@mihanizm56/fetch-api","version":"3.0.3","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"test:watch":"jest --watch","test":"set CI=true && jest","test:coverage":"jest --coverage","compile":"tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint . --ext .ts --fix","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","pub":"npm publish --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","node-fetch":"2.6.0","typescript":"3.8.3"},"devDependencies":{"@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","commitizen":"4.0.3","cz-customizable":"6.2.0","eslint":"^6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","husky":"3.0.9","jest":"25.1.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.2.1","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript-transform-paths":"1.1.14"},"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"gitHead":"4898a6a55faa049cbf4f6fa01a86ae64a87d3efe","_id":"@mihanizm56/fetch-api@3.0.3","_nodeVersion":"12.13.0","_npmVersion":"6.14.2","dist":{"integrity":"sha512-miJaa1A8VH3n5LuKtyzZnpZk3FwCi1O56yiaTIXjn5V9+9cTNeF7D/KpuBD9T2MJtnEI3GOhzMeNn9CQAhjT7g==","shasum":"ba429cec11c74db880f21b8bda844e7b58d450e8","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.0.3.tgz","fileCount":51,"unpackedSize":56373,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJef+4SCRA9TVsSAnZWagAAKDQP/11i6aXmwqoPNdKkt+2s\nr8PQYxFII9qsz1fAqVoi0b6rmVXdMshECNA9149qHVz/MAmiCW38pq2Dftrq\nR9WrpkwlX7Vb55BmWz45xvUnRXXSa6OiykM7ZEUT50Fj9twdJ85I54eP+2Ss\ni4t4fyaW2lI9iCa0z5hueHuFDE7ZAlCMOVHbvNsDymNXlIgpihc/lRZTQIIw\n1PyhQxFzjhAUKAW7Ch2jy2TtvZxxg5IA6McpAWGy21liOD+VvAWV4Ib7izwk\n8ekMDrBl+r5Q7wUpvt+Ff1+CgITPeLEnIpvSIBtdAv7WRjpUDjplHPDOsmO8\nhcNI4RZdKv0mZxYW7smX4fOrmNsSArTbxorOQOXugvLwkC4ltV4VquAdrq49\n2Z6VZP/5m5KWyFRLHdGQwl+0C2rjDf2UCbFLxiXL2YMMdKMwHl/Ls4HXTC11\nFws6fp//V4aAwNiN/4ultziT8EzjFMO9IC0ZBKF/f2TpHlmKPXtr/AfqsnIb\nA3NLaYlUHHPkDPdA+CEp7EPDoyokdvu7FaEFH2fFRB5wLj61yrOqVlJOWi3b\nYA6oqDCxT5ig5OrGonGFwqR+e/d8V12+R9m8QWyvVpn5DJJm4O0KBfT2JjN5\niU2gWYHAyujYjmLN3kyuaX9+5/qBVOh5H59QnU/DULxJq+90ZkdL+ZYx6yu8\n0jdC\r\n=Rsyh\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEQ+VWNp3btl8BctHDSXFhz02SGnq+Npkl6A6GyUcFN0AiEAgmSHoTdRRdxkBS6/9VxgTZkmDX7SVLzQszfYhNRSE0U="}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.0.3_1585442322208_0.3366019177392121"},"_hasShrinkwrap":false},"3.0.4":{"name":"@mihanizm56/fetch-api","version":"3.0.4","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"test:watch":"jest --watch","test":"set CI=true && jest","test:coverage":"jest --coverage","compile":"tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint . --ext .ts --fix","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","pub":"npm publish --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","node-fetch":"2.6.0","typescript":"3.8.3"},"devDependencies":{"@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","commitizen":"4.0.3","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","husky":"3.0.9","jest":"25.1.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.2.1","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript-transform-paths":"1.1.14"},"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"gitHead":"e9482b1fba3f2e9dbcecaefe20496a0ddce19b2d","_id":"@mihanizm56/fetch-api@3.0.4","_nodeVersion":"12.13.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-OpdKjKy1IMlW3HituuyxSiPoZIDQ9GwaUi1HWkcAm3QMyamiM8kQX3GjU8X+yd4Z4qH1e6JaCzETNezOLVg9gg==","shasum":"2daba4945ca200333cb0b1572e42bf6af70a9262","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.0.4.tgz","fileCount":53,"unpackedSize":56969,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJehUGlCRA9TVsSAnZWagAAfgQQAKJ7OCwqGrwQMPYbhwmP\nP/7f3EAIVilgmpXLG54vY7mHJpu8Cv7tWms4aQuwAXZnXXe8mLCiqkOwudyA\nOK04uALRx2VoWYEcqkAVCwkQ77sOwQhKfsgr3azLXM5h/cGH4lD2cYxozxgv\nP2fKsx2JLGtxF0J+0NNMsQAiXIXOPyBIsYg1qAKCY9uuQC59Elorjv9Mfc+j\nD0doBtiJ+DwO2z4tgK4nkb/0Av4u9SDr+zEbjsDF7ElHZ7SgaGdQe3QvaxC0\n5Z1aZJd2FBEFt2u9jSJJlMsMoka8PYrCFRVTYDx/D/vp4cEA6mBxh+9MrK5H\nRMSTVqqvSA76ZzZHl7tpGz2Ici9EsL9qRT/xC3iQnliYvP4Micvf6f4Ls1yC\nBt9sQbMs3tZ8OLc01QlAYu/gCEMBauU+3QGs7K/ysNp6S8Ov265tG7DB8tTe\nIgXaLxt5crLgA0G6pIwf/Ypi0VVtEiarDIAZvOXnO5bJEh42clOs1GzXgAxD\nxhX2US0VIES2XmcXf+CuWhQAIRukyvVbitJFzL5cV/IwQyuUoIEhTSLYvkYF\nJewSK0+lEZVEVAZ9XlH7mJV/2UApMWA09kpKfoq22TY+a3Mqp53Q4OUfucDD\n8E2F7WIfEnXx7/O6Clu4l1I22KJHqFjJTcuRJA3E+qUlR3LAslLUajrmC9fr\nZMce\r\n=VGXk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIArK55ltkT0+cxXc/qmqGSxc5QHSFlT/txh9jz6MweHqAiBEPpK6+EtiNcgGoLqhxPUjrUvdfCgXxhTWm0yW1Iog6g=="}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.0.4_1585791397406_0.7602189715284575"},"_hasShrinkwrap":false},"2.1.3":{"name":"@mihanizm56/fetch-api","version":"2.1.3","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"test:watch":"jest --watch","test":"set CI=true && jest","test:coverage":"jest --coverage","compile":"tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint . --ext .ts --fix","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","pub":"npm publish --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"^17.1.1","@types/joi":"^14.3.4","typescript":"3.8.3"},"devDependencies":{"@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@types/node":"12.11.7","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","commitizen":"4.0.3","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","husky":"3.0.9","jest":"25.1.0","npm-audit-resolver":"2.1.0","prettier":"1.18.2","ts-jest":"25.2.1","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript-transform-paths":"1.1.14","pkgfiles":"2.3.2"},"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"gitHead":"1a44efeab7af7586dd0b1d93375993c1f054ca3b","_id":"@mihanizm56/fetch-api@2.1.3","_nodeVersion":"12.13.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-WlkdOTmEP+ne13EQNbjvYbewbVLZ8v3/8AGqnBXbkzQfcn8LzmQKPw6E96JVBabj1P2kSI5BHC2SuznJIG7hwQ==","shasum":"420715c0b9363b0901eb4ef2c55d131602e3d173","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-2.1.3.tgz","fileCount":53,"unpackedSize":51338,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJehUXWCRA9TVsSAnZWagAA3qwQAIBzCNu3mCmzxL5ZNX3O\nfBOC/8Cqx1/hgdEEM73Z/k1EkmbepwOnBXVsgbVQ/s7cm8LAks7w4qH/ecxA\nVmX/aOCFZDoEKp6WUm4edXt/IwIi2Gp2JXp6tmZl3hXVIQZ6BDiK2056ge/m\nbsB8muWowPKefy6XOsWsHnVR+grlQHbxPc79wYnpwrXNHcZHK2OmqtNx9IPO\nNOTlLmxWdoE+FT/rIrWJz2jD8cz2on3b3MOmh/QQWqH3cXQIGe4v9lPv4f3l\nUC9Ivy6TLd+GtDjn3wwH/oi8bHGbTnatL5D+eesdBQ7Jta/4QNXg9ZB6GOBK\nZW+LD/QS3Tu8/pDWfqieXr7f6acRGzYz18tBI1EXTjCChQ3jiN63ZfIFZYEO\nVTvHYVl94X7jodHiaF4v7pTgGEC3m6eqew4D35lCTPuVBI6gKRhhv6Hfi1f/\nWG4uEhJgv2XXebCTa1H4KKdmrW7pjc7x+DBDnh5gIUjUFVPsjRrLp1TqT6fS\nY7/nFejyPPaFfzd1/YPsKtDZ7Vdficjq7prZP4Zb8MRXYn6URb5+ebPSNuQl\naBXZSmlt8avP+MT7lViP0EhZnVt65ptMLlMJ7ck53X8Enj6M3C82bx6TVzu7\nLHl5Jvbp1HT5A9JFaAiCGuWSeb8F9cM8Q86sRZudHkOICOUXDHudvUlu4YZu\nLsj7\r\n=4XvV\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHNEbEKWEtkd+CkBhgHyDs2mFpOWwkoKzx7qpPo7h4fhAiEA+XxHuj/6J2XC4PqAicRo/HQUcEm8ha9IFC+vAnzba3c="}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_2.1.3_1585792469872_0.21885162804189817"},"_hasShrinkwrap":false},"2.2.1":{"name":"@mihanizm56/fetch-api","version":"2.2.1","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"test:watch":"jest --watch","test":"set CI=true && jest","test:coverage":"jest --coverage","compile":"tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint . --ext .ts --fix","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","pub":"npm publish --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","node-fetch":"2.6.0","typescript":"3.8.3"},"devDependencies":{"@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","commitizen":"4.0.3","cz-customizable":"6.2.0","eslint":"^6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","husky":"3.0.9","jest":"25.1.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.2.1","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript-transform-paths":"1.1.14"},"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"gitHead":"c002073e91100fbbebd250f56212db234461d247","_id":"@mihanizm56/fetch-api@2.2.1","_nodeVersion":"12.13.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-DLWZdatKtltddbKfSwZj1q0vPcSbYcake07UqkE52hOmMt0RUCqepBqRRS7QYIlgZosADdtIBjn7FO7LajKdXg==","shasum":"24841664a3d389a7d4e3a4f81dd8e057927fa7d3","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-2.2.1.tgz","fileCount":53,"unpackedSize":51240,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJehUjOCRA9TVsSAnZWagAATQsQAKCB//nOttYLgGqM1k3I\nC3FOW2R/KhU9UXRsejJM+qEbI/1dwZHhsWvOtP3PcHhwmWbS6fVg11IGwftf\nzq57GGS9PPzItLzRw4eSKObJAZQsOylzI9h4nlZxQ6kQYApTCuwikijctAS3\nQ4KMoaQOT2rFgM6jhXXc359VbLaCslxw/Njvlqf6Fj/kvMX3Jv3UoY/oVuQ5\nl4Z16RDeWdiEr7Bl1Pc9WmXnTdOFS3joGkNq0aOqDBMFVmtCJ252x+JY5uTh\nKaf20ciHIbCjxOUU4vVGAO8sZoILoWCod9ujjLhvhp0JUXdyylkN+OkkY8yn\nvKdSakFgbWi5VgH7HAPoRouw8E6To61zZonS2cq718xln/qxVTQjcnAs4n6F\ngwIZ5RGBkVVawJUYhHmUD7IDy96vz4oneea8UqaNYjFdTYrHoJW2la8GbhE9\nSOf9dpDefxbmublAYCrai9fzotpX0AOWaklwGYOKjtfF4Y0Hyf0vx6O0ezdW\nvn0/76wsKPzyLJSf1Q8huJX/+3KzsfYvwzeIPAMY3Q8JSrloDwqKqQToEoSf\nMNcR6KcNw5y0ZZCfGgxSnQk8s7ANYPus8hxqlfLX8j9AaIuy+I/KKg0JJHMJ\nrJjQgOj+Y+OB3SWZHBX/HYvEZCu7kJyM+DPx6KIBdlaAKW+aAZSxFCondE46\nd5Dn\r\n=IrAZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIA+2VTGIZlLHH3FLtNzLpxBu2BO7fMagEK9SZDbhFCGJAiEAwsaOOJlDWh+u38en26fM66m5EXXjQ3PoBQt1iA3mqv8="}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_2.2.1_1585793230457_0.40804038940968446"},"_hasShrinkwrap":false},"3.0.5":{"name":"@mihanizm56/fetch-api","version":"3.0.5","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"set CI=true && jest","test:coverage":"jest --coverage","compile":"tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint . --ext .ts --fix","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","pub":"npm publish --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","node-fetch":"2.6.0","typescript":"3.8.3"},"devDependencies":{"@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"^25.2.6","body-parser":"1.19.0","commitizen":"4.0.3","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.2.1","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Sollution for http/1.1 isomorphic fetch\n\n### Benefits:\n\n- Provides validation for responses (based on @hapi/joi Schema validation)\n- Provides query-params serialize\n- Provides cancel-request if the timeout is higher than 60 seconds\n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error from `errorsMap`\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure\n- Works in browser and node environments\n\n#### RestRequest input options:\n\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body (you have to JSON or FormData it by youself)\n- mode('cors' | 'no-cors'): the cors type\n- parseType('json' | 'blob'): the type to parse the response (json by default)\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- errorsMap(object): the object with the errors keys and translated values (TIMEOUT_ERROR and REQUEST_DEFAULT_ERROR fields are required, others must be provided according to the backend errors)\n\n#### RestRequest output options:\n\n- error (boolean) - the flag of the response status\n- errorText (string) - the main error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional multiple errors from the backend\n\n#### JSONRPCRequest input options:\n\n- the same as RestRequest input options\n- id (string | number) - the request id\n\n#### JSONRPCRequest output options:\n\n- jsonrpc (string) - version of json-rpc\n- result (object | array) - the main data from the backend\n- error (object) - (non required, exists only if there is an error) the error object with message and code from the backend\n- id (string | number) - the request id\n\n## Examples of usage\n\n### REST API\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### get request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IRESTResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IRESTResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    errorsMap: {\n      TIMEOUT_ERROR: \"Превышено ожидание запроса\",\n      REQUEST_DEFAULT_ERROR: \"Системная ошибка\",\n      [FORBIDDEN]: \"Данное действие недоступно\"\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required()\n          })\n        )\n      })\n    })\n  });\n```\n\n#### post(put/patch/delete have the same format) request\n\n```javascript\nimport { RestRequest, IRESTResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IRESTResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    errorsMap: {\n      TIMEOUT_ERROR: \"Превышено ожидание запроса\",\n      REQUEST_DEFAULT_ERROR: \"Системная ошибка\",\n      [FORBIDDEN]: \"Данное действие недоступно\"\n    },\n    body: JSON.stringify(someData),\n    mode: \"cors\",\n    parseType: \"blob\",\n    queryParams: {\n      id: \"test_id_123\"\n    },\n    headers: {\n      \"Content-Type\": \"application/json\"\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\"))\n    })\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createReviseRequest(\n  someData\n);\n```\n\n### JSON-RPC API\n\n```javascript\nimport { JSONRPCRequest, IJSONRPCResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createItemsRequest = ({\n  someData,\n  requestId\n}): Promise<IJSONRPCResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint: \"http://localhost:3000\",\n    errorsMap: {\n      TIMEOUT_ERROR: \"Превышено ожидание запроса\",\n      REQUEST_DEFAULT_ERROR: \"Системная ошибка\"\n    },\n    body: JSON.stringify({ ...someData, id: requestId }),\n    mode: \"cors\",\n    queryParams: {\n      id: \"123\"\n    },\n    responseSchema: Joi.object({\n      items: Joi.array().items(\n        Joi.object({\n          id: Joi.string().required(),\n          name: Joi.string().required(),\n          name: Joi.string()\n        })\n      )\n    }),\n    id: requestId\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { jsonrpc, result, error, id } = await createItemsRequest({\n  someData,\n  requestId: \"1\"\n});\n```\n","readmeFilename":"README.md","gitHead":"c0126517920301efd3c0f81fcfb44b69328b37e4","_id":"@mihanizm56/fetch-api@3.0.5","_nodeVersion":"12.13.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-YAEilmCNNeRowiQcDXfrO100nv4gXb28pfe4j8aK13vIPTBSNDm8kgczBfNnaot52cfZDE1vBh0PB5xdkiNGuA==","shasum":"13fb1213a3d62e015dbdd80a5a435070f4a379b9","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.0.5.tgz","fileCount":57,"unpackedSize":57445,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeh8XOCRA9TVsSAnZWagAA6fUP/3BFTTIuZWCUlfDWtkge\nl+vTGqMVDuFoXgstrFQQlj+J+y1OKpyUAusnuOHicLUz2xjkTWJEvdxOH+Dt\nl6/o1/YXGKZMBaduSIn7xJ7xsRIAo3NAXgK/s+d9Nq+/1IeClge69lqn8hpr\nwKtdv+YtST2rNevQlCNugSMaiXtOqHHYcl8eBgkfna/3Et/QSdQ7/8m5CXOW\nCHCvjvyCVfEH4c9KFLFbNcRrYsrPVul0u5iGpXJ4EjcbaG8iicFVlhOPQ8s7\nnzIKCJhkigV7LtFGOBMdYovjB8VISo9+6117iZJpxOceZWLVSarLaSDlTzuA\nvrXBMWiULlO5BEkQSrDWMQPbqkhFuNVPVUq3Wxssuoo78e4y+NykBmi8U7z3\n4z9A1PXVLGChz6gdHmYNdqbiMXQoqs1H6CX/xm44LB/YxAyRqLVWNmV4clrl\npRb+mWnT6qIHxdgdxNO07Ms69V/VFic9O3eLwEfT39f5xumTuYySrYEgZjMH\nLBvN+J37NzaJ90Jmi798VCvYmp6Z8FOBqk5BHzZKTGe63o2LEDzd1Hpcbwbc\nty/m8o7ak9nX35wpgRHs+FKsmKB+Ix7g7PFTD6UBRyZsyxvHbeWnrQC0O4Qb\nJeOm/CI6x6SKbvWGLMruBg4HjpCcLbgU32Fi/T+6//VlE9EVKmFSy9n31f+1\nKIjq\r\n=WQgg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQClK4sImo4KsWoZfwcyDlh3WJ7CmFopq+kX0b9dkonorQIhAMy86Vowpuh5tIgGkOgMgrHIBhNgSjmDRWZr2XTm7xbn"}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.0.5_1585956301728_0.7965739863533001"},"_hasShrinkwrap":false},"3.0.5-beta.1":{"name":"@mihanizm56/fetch-api","version":"3.0.5-beta.1","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"set CI=true && jest","test:coverage":"jest --coverage","compile":"tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint . --ext .ts --fix","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","pub":"npm publish --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","node-fetch":"2.6.0","typescript":"3.8.3"},"devDependencies":{"@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"^25.2.6","body-parser":"1.19.0","commitizen":"4.0.3","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.2.1","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Sollution for http/1.1 isomorphic fetch\n\n### Benefits:\n\n- Provides validation for responses (based on @hapi/joi Schema validation)\n- Provides query-params serialize\n- Provides cancel-request if the timeout is higher than 60 seconds\n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error from `errorsMap`\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure\n- Works in browser and node environments\n\n#### RestRequest input options:\n\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body (you have to JSON or FormData it by youself)\n- mode('cors' | 'no-cors'): the cors type\n- parseType('json' | 'blob'): the type to parse the response (json by default)\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- errorsMap(object): the object with the errors keys and translated values (TIMEOUT_ERROR and REQUEST_DEFAULT_ERROR fields are required, others must be provided according to the backend errors)\n\n#### RestRequest output options:\n\n- error (boolean) - the flag of the response status\n- errorText (string) - the main error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional multiple errors from the backend\n\n#### JSONRPCRequest input options:\n\n- the same as RestRequest input options\n- id (string | number) - the request id\n\n#### JSONRPCRequest output options:\n\n- jsonrpc (string) - version of json-rpc\n- result (object | array) - the main data from the backend\n- error (object) - (non required, exists only if there is an error) the error object with message and code from the backend\n- id (string | number) - the request id\n\n## Examples of usage\n\n### REST API\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### get request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IRESTResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IRESTResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    errorsMap: {\n      TIMEOUT_ERROR: \"Превышено ожидание запроса\",\n      REQUEST_DEFAULT_ERROR: \"Системная ошибка\",\n      [FORBIDDEN]: \"Данное действие недоступно\"\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required()\n          })\n        )\n      })\n    })\n  });\n```\n\n#### post(put/patch/delete have the same format) request\n\n```javascript\nimport { RestRequest, IRESTResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IRESTResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    errorsMap: {\n      TIMEOUT_ERROR: \"Превышено ожидание запроса\",\n      REQUEST_DEFAULT_ERROR: \"Системная ошибка\",\n      [FORBIDDEN]: \"Данное действие недоступно\"\n    },\n    body: JSON.stringify(someData),\n    mode: \"cors\",\n    parseType: \"blob\",\n    queryParams: {\n      id: \"test_id_123\"\n    },\n    headers: {\n      \"Content-Type\": \"application/json\"\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\"))\n    })\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createReviseRequest(\n  someData\n);\n```\n\n### JSON-RPC API\n\n```javascript\nimport { JSONRPCRequest, IJSONRPCResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createItemsRequest = ({\n  someData,\n  requestId\n}): Promise<IJSONRPCResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint: \"http://localhost:3000\",\n    errorsMap: {\n      TIMEOUT_ERROR: \"Превышено ожидание запроса\",\n      REQUEST_DEFAULT_ERROR: \"Системная ошибка\"\n    },\n    body: JSON.stringify({ ...someData, id: requestId }),\n    mode: \"cors\",\n    queryParams: {\n      id: \"123\"\n    },\n    responseSchema: Joi.object({\n      items: Joi.array().items(\n        Joi.object({\n          id: Joi.string().required(),\n          name: Joi.string().required(),\n          name: Joi.string()\n        })\n      )\n    }),\n    id: requestId\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { jsonrpc, result, error, id } = await createItemsRequest({\n  someData,\n  requestId: \"1\"\n});\n```\n","readmeFilename":"README.md","gitHead":"9982d8bc234cac955746204ee83d4c91abcf3f44","_id":"@mihanizm56/fetch-api@3.0.5-beta.1","_nodeVersion":"12.13.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-s75st+eJk/DQCwapo7ZdTcGiGmdw6y1YC22f5w/9ftVFWGbwA4QR6rOQVKhICnFJoqAr61piBZnuYFwjUuQxmQ==","shasum":"e309967cb8255c3936a4ff93f17d3bd07e6c8d9c","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.0.5-beta.1.tgz","fileCount":57,"unpackedSize":57452,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeh8adCRA9TVsSAnZWagAA32IQAIMZ3NR4GgjHo7/vomW2\nixEpuYjaEIqUIT4JMSZigy6+PMhHgdEmwZMnjBbnAbxyb3W7Siu+zrrIwbLP\nUB0XcXKGUMg1TttZjIGRlC3m8rhWZwOY7M7v6iGSQzLbhx1mOt3nqH6dmlhR\nfnLZQgi2pZkPKyP51p9t9YYwbZjRAPPwzPcIS7FrLCBpMvgoM4mKpy/ptDOx\nuE++oZguELrJFYufYYN9zXDJ2Hlr4gqsX/NiwLCjI/tpmfy27kfTrkwdCCPP\ndrSLqMFrn3lkdA7qrMIDsC149NEPaIfX16gycevoUK4jXpVUksgxdbzEuruo\nu6rr46DMHCmiq0qlVVKcu1jt0HoRTDOflT8xDTQHqsWW5NtW6Pypn+9oZqhx\nyr08+FhFmwph6Wx0ThQ0QDZa362KdPvWxcKxYxGJ9HQDxKKZGC1hvcD818kq\nIaPSUK8DwsFCNGisxDJt109bgqVuP8+0XLOXcK2soSOItclabG+R94VPvKDA\nkc4wgBLYa1GfboIq+RA2NUg93CA43UGr76uVy3/4nnAip8gpzTjFKwzUTIxF\n3/S0g5f1rNBnTzreU+zgUylRkx6gxL+9aunUAJsk0gqv6JLhn7PGd3xZTsEO\ny0pt//ay0S/HoodqAhlgnpv5W4isIR4MngGuxPbGGbhL5mMni8oP1G3dEcRt\n4ZKf\r\n=D9tv\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICH7DZqshZkdL1IFZDxrIbJm/4j2ASuyP8hUW1E2oOXIAiEAzf3NP9yZDRhRqV6fKqEf/7BYw1vx4fNvsY0hDLSAJO8="}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.0.5-beta.1_1585956509290_0.7857110089152475"},"_hasShrinkwrap":false},"3.0.5-beta.2":{"name":"@mihanizm56/fetch-api","version":"3.0.5-beta.2","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"set CI=true && jest","test:coverage":"jest --coverage","compile":"tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint . --ext .ts --fix","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","pub":"npm publish --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","node-fetch":"2.6.0","typescript":"3.8.3"},"devDependencies":{"@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"^25.2.6","body-parser":"1.19.0","commitizen":"4.0.3","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.2.1","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Sollution for http/1.1 isomorphic fetch\n\n### Benefits:\n\n- Provides validation for responses (based on @hapi/joi Schema validation)\n- Provides query-params serialize\n- Provides cancel-request if the timeout is higher than 60 seconds\n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error from `errorsMap`\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure\n- Works in browser and node environments\n\n#### RestRequest input options:\n\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body (you have to JSON or FormData it by youself)\n- mode('cors' | 'no-cors'): the cors type\n- parseType('json' | 'blob'): the type to parse the response (json by default)\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- errorsMap(object): the object with the errors keys and translated values (TIMEOUT_ERROR and REQUEST_DEFAULT_ERROR fields are required, others must be provided according to the backend errors)\n\n#### RestRequest output options:\n\n- error (boolean) - the flag of the response status\n- errorText (string) - the main error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional multiple errors from the backend\n\n#### JSONRPCRequest input options:\n\n- the same as RestRequest input options\n- id (string | number) - the request id\n\n#### JSONRPCRequest output options:\n\n- jsonrpc (string) - version of json-rpc\n- result (object | array) - the main data from the backend\n- error (object) - (non required, exists only if there is an error) the error object with message and code from the backend\n- id (string | number) - the request id\n\n## Examples of usage\n\n### REST API\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### get request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IRESTResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IRESTResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    errorsMap: {\n      TIMEOUT_ERROR: \"Превышено ожидание запроса\",\n      REQUEST_DEFAULT_ERROR: \"Системная ошибка\",\n      [FORBIDDEN]: \"Данное действие недоступно\"\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required()\n          })\n        )\n      })\n    })\n  });\n```\n\n#### post(put/patch/delete have the same format) request\n\n```javascript\nimport { RestRequest, IRESTResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IRESTResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    errorsMap: {\n      TIMEOUT_ERROR: \"Превышено ожидание запроса\",\n      REQUEST_DEFAULT_ERROR: \"Системная ошибка\",\n      [FORBIDDEN]: \"Данное действие недоступно\"\n    },\n    body: JSON.stringify(someData),\n    mode: \"cors\",\n    parseType: \"blob\",\n    queryParams: {\n      id: \"test_id_123\"\n    },\n    headers: {\n      \"Content-Type\": \"application/json\"\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\"))\n    })\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createReviseRequest(\n  someData\n);\n```\n\n### JSON-RPC API\n\n```javascript\nimport { JSONRPCRequest, IJSONRPCResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createItemsRequest = ({\n  someData,\n  requestId\n}): Promise<IJSONRPCResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint: \"http://localhost:3000\",\n    errorsMap: {\n      TIMEOUT_ERROR: \"Превышено ожидание запроса\",\n      REQUEST_DEFAULT_ERROR: \"Системная ошибка\"\n    },\n    body: JSON.stringify({ ...someData, id: requestId }),\n    mode: \"cors\",\n    queryParams: {\n      id: \"123\"\n    },\n    responseSchema: Joi.object({\n      items: Joi.array().items(\n        Joi.object({\n          id: Joi.string().required(),\n          name: Joi.string().required(),\n          name: Joi.string()\n        })\n      )\n    }),\n    id: requestId\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { jsonrpc, result, error, id } = await createItemsRequest({\n  someData,\n  requestId: \"1\"\n});\n```\n","readmeFilename":"README.md","gitHead":"900854c8b68fa2273198fcf1434b781c1bec50c5","_id":"@mihanizm56/fetch-api@3.0.5-beta.2","_nodeVersion":"12.13.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-+vaDlY78yeJvwHdS2GFeSorCnWuPFjXoK9xfe7I6LDcKfVQaQQaB06hpFOGFYs40fm8ynOqC8aSKEtXdCRXqAg==","shasum":"ff107e8f948b219b318ec6aa985f5f4adfe2b389","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.0.5-beta.2.tgz","fileCount":57,"unpackedSize":57429,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeh9PyCRA9TVsSAnZWagAA5jwP/23kVf37xLTpMP5sPGva\n/uZVTabVcAmdAN1wwIphtJ3EYP5pvFrXtzzNJQaZ0AvbKiN3iI/tM6derK6/\nTuB1l8mKPaEgpmBnBYzhbKU88vMupk+ZMmo+8NtOfLpeuzNtnMmsQwhKFmAb\nVut7TsUEqJe9Yf/DcHawdGE5IfVcQTUyuEr5xBLwtj0MCuta6RRJajwT8jK4\nnLWCkILjt68HKvK1TCjpDhLPgspWz6RhhjT+4TeYl2CbeVbJK4o0i5nEJyE+\nsnaNhwlTfbl2/HT9Iw0PJSrHVq7VkjvEvKqe+4ky8PtmNcHl9aicwDrR0zDE\n9s1GAk9yXDa/1KCJP9A2G4TGXR5LIAf4sDW43lHUp0zyR9ZzgK1DUUwGgKyU\nf8tk5bIQJe8drnCbReJcOAbIwOPzF6ujuZ1nRlUeotVBBarOQJgHq7bDMPYb\nYSVQPudy1gCP2PAXykDNQ1fstPsE0QXkaSX5/YH4XmU8i4j/GTO3E5AtJODz\nP0PIamZaY8Pm/5bCW1CVa1zTySmo7trLtLiLemyG40yLxS+HQ1WFaOXbNkWD\naioZmYy1jyo6Pd3rv+OJXOwFiRPY6pOeaul7Dp1OyYOQYZLDP4pjfW5WgIa7\nzNTAtz3+XUe0MDt6+7u8CR0DjQg/Lb6s7LCxIzz9Iwz5Ym8WscxudkJT7+NS\n51sP\r\n=wHPv\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCL8XnFCf3Y8XR36Ncmgkkqdqm2eJ5RB/Zna0vWMrZXMgIhAOukIbBbNSBiFqyLWSH/c6polS8j/hcM8UeFK/T3l6Q0"}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.0.5-beta.2_1585959922401_0.3830251627449799"},"_hasShrinkwrap":false},"3.0.5-beta.3":{"name":"@mihanizm56/fetch-api","version":"3.0.5-beta.3","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"set CI=true && jest","test:coverage":"jest --coverage","compile":"tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint . --ext .ts --fix","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","pub":"npm publish --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","node-fetch":"2.6.0","typescript":"3.8.3"},"devDependencies":{"@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.0.3","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.2.1","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"gitHead":"0ac1716b6cd1ebbdbf8e85f4315f9f1b564fe276","_id":"@mihanizm56/fetch-api@3.0.5-beta.3","_nodeVersion":"12.13.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-W/n3K7BO22lV0VTKS/YcF/Zu6R+1QKxYHxeMa3GEYj8Qe1lMFh1yyfbexTpsTsJG/slCmxP7R2ofl29KDwVY7Q==","shasum":"1ff328cb4485b44009225aae0eb4cd5ac82f7e71","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.0.5-beta.3.tgz","fileCount":51,"unpackedSize":57454,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeiJrVCRA9TVsSAnZWagAAF9oQAI6iqp/gbe1h94VZfagw\nlkuQ1UhA4ySZjj+6uMJEpvVOOSSzmurbpDKJv6r/4is8jvOlQTN42Y1QeTxH\n+GgBx7N2/zPKt23Bp5RdtHpjIthcd2tRsKX1eOe728mC0bhL/0Hm2YxLvU1G\nY1nZweSPx7EUFGfJ78lMQYhAiMrPcS+rduE9OPkZPn7bdkjmedfpBNnZAtXa\n/xHuX6rooZ6Pem0drYl8P5GHN77xxfeA5jg1mh24tOLU9KogkAg7MZemZKcr\ntXr1ysiZl7WVvzFSecpr9kDkImCOmRwGnS1dfabaRXnPP3BITONndBSY/TfC\n9NVZO2lnf2dRdQtl5SxefcuHrTakIqGMQqrlLMWRkynG+/ksuvT2p8iBbX35\nYlJP7tU1HbDzPGObO3T0TPt6F4keZxoYbo1DWE1Y6mX/uNevcxaalWeR19qx\nO1uXVX+PgTftp7LzFHF4mVR/3RAy1KePxqo4N5SCFACpEAYi5dc1yDZ4SCuh\nUotEXuCUktoG/UYFLJCwTKNJrHuvRU/WbSbRyLnGvg4oJWqeQq9bjYS1TPr5\n4VQjW/MfRnqbVxkTyjxGxi5UeEpBirCDMFumF5a+DMck67thlB5/jZ3UDjw5\n1YzCw1DsVxvb2xuBx48vt08O1iNU7oB2LKOKF/X9jjdzOqETzpUGJv6zE3Lp\n+u0j\r\n=pa/k\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD24snlT1xHrC2p3kfUrT9+88ZmTeMqSvk4YD/afG4gtwIgdyxJ4KkHEMhV+coGmBwCA03gWz3Zq+DW2O1s08FdF/s="}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.0.5-beta.3_1586010837343_0.09827609703256779"},"_hasShrinkwrap":false},"3.0.5-beta.4":{"name":"@mihanizm56/fetch-api","version":"3.0.5-beta.4","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"set CI=true && jest","test:coverage":"jest --coverage","compile":"tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint . --ext .ts --fix","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","pub":"npm publish --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","node-fetch":"2.6.0","typescript":"3.8.3"},"devDependencies":{"@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.0.3","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.2.1","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Sollution for http/1.1 isomorphic fetch\n\n### Benefits:\n\n- Provides validation for responses (based on @hapi/joi Schema validation)\n- Provides query-params serialize\n- Provides cancel-request if the timeout is higher than 60 seconds\n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error from `errorsMap`\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure\n- Works in browser and node environments\n\n#### RestRequest input options:\n\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body (you have to JSON or FormData it by youself)\n- mode('cors' | 'no-cors'): the cors type\n- parseType('json' | 'blob'): the type to parse the response (json by default)\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- errorsMap(object): the object with the errors keys and translated values (TIMEOUT_ERROR and REQUEST_DEFAULT_ERROR fields are required, others must be provided according to the backend errors)\n\n#### RestRequest output options:\n\n- error (boolean) - the flag of the response status\n- errorText (string) - the main error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional multiple errors from the backend\n\n#### JSONRPCRequest input options:\n\n- the same as RestRequest input options\n- id (string | number) - the request id\n\n#### JSONRPCRequest output options:\n\n- jsonrpc (string) - version of json-rpc\n- result (object | array) - the main data from the backend\n- error (object) - (non required, exists only if there is an error) the error object with message and code from the backend\n- id (string | number) - the request id\n\n## Examples of usage\n\n### REST API\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### get request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IRESTResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IRESTResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    errorsMap: {\n      TIMEOUT_ERROR: \"Превышено ожидание запроса\",\n      REQUEST_DEFAULT_ERROR: \"Системная ошибка\",\n      [FORBIDDEN]: \"Данное действие недоступно\"\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required()\n          })\n        )\n      })\n    })\n  });\n```\n\n#### post(put/patch/delete have the same format) request\n\n```javascript\nimport { RestRequest, IRESTResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IRESTResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    errorsMap: {\n      TIMEOUT_ERROR: \"Превышено ожидание запроса\",\n      REQUEST_DEFAULT_ERROR: \"Системная ошибка\",\n      [FORBIDDEN]: \"Данное действие недоступно\"\n    },\n    body: JSON.stringify(someData),\n    mode: \"cors\",\n    parseType: \"blob\",\n    queryParams: {\n      id: \"test_id_123\"\n    },\n    headers: {\n      \"Content-Type\": \"application/json\"\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\"))\n    })\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createReviseRequest(\n  someData\n);\n```\n\n### JSON-RPC API\n\n```javascript\nimport { JSONRPCRequest, IJSONRPCResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createItemsRequest = ({\n  someData,\n  requestId\n}): Promise<IJSONRPCResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint: \"http://localhost:3000\",\n    errorsMap: {\n      TIMEOUT_ERROR: \"Превышено ожидание запроса\",\n      REQUEST_DEFAULT_ERROR: \"Системная ошибка\"\n    },\n    body: JSON.stringify({ ...someData, id: requestId }),\n    mode: \"cors\",\n    queryParams: {\n      id: \"123\"\n    },\n    responseSchema: Joi.object({\n      items: Joi.array().items(\n        Joi.object({\n          id: Joi.string().required(),\n          name: Joi.string().required(),\n          name: Joi.string()\n        })\n      )\n    }),\n    id: requestId\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { jsonrpc, result, error, id } = await createItemsRequest({\n  someData,\n  requestId: \"1\"\n});\n```\n","readmeFilename":"README.md","gitHead":"a7bf1b13d058ea32ad6bb98284354f571624b594","_id":"@mihanizm56/fetch-api@3.0.5-beta.4","_nodeVersion":"12.13.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-1zCruZcn7jPfka9nKYBdpfvAS4N+lo/1CpDggMnydjrVK3G+Ye/jU3s4xOuODKjRbPTnAFY1OhtGuiB0kQYNow==","shasum":"3ca548ad60afae3523de18f5b994e1613edcf186","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.0.5-beta.4.tgz","fileCount":51,"unpackedSize":57454,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeiJwbCRA9TVsSAnZWagAAxvYP/3W/d2UmHXuiAk1vNL6i\nQLRu+kZLnMYCRKQKg44tIZDv5E4AUcG+wp0bu70jcSK/k3Zr67uQ+hwWKYqm\nenwGEdUTLZS0SLftEov8km5xqEvfa1V52kxvdUTLiNfgF+KG5To/xNZw8Sye\ndXwQywty9Z/kcxgtYosxdgLCOajX1P19/cCf99XkAofO99D0pSx3XCMhDKtm\nANqC2AtO7sh1618UBG0jz/5pzNKT4wY+26cRcJHSjU3+d/89hleuqeEKXxDU\nBdC3KfGkIKJkEnQVeMd937XSV5HuulVc/tjC7kAmEWKhpg9IIXyOeQ+cuocI\nVbXeb5g1iDQB/wDxUmP2dpAQglizR9qZ/op3SMpOcAV+9vwEMwE5ATtYGFKb\nPRt0bqrDVBVz7vYgYmZYewRnSeQzexCQB9f/Ly6ATUEwMWyel7fEZ+43PJE2\nkt556W4d/md8wHNrIMYciBraIkUC7SYCeQKMub/qf4o96rksGQJ/qVPDU6Z2\nZweidomkw2slKcxGehLzH2Xg+fc3kym2mZIXqvWLJr0DDSPG46/AK2VyKgO8\ntAK2t0QrwjphXwgG7NdmCHtrZGweuPzY0/QBZ+am3ZZBFnJ2HcGoev2U9LV8\n5He+O+XdTkqr9dPxz60JtZJKMiLxUQrk3OvFlmAM7+RH+Dnr2nY/i4maq1zT\n7eYK\r\n=jy1l\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFvdVdVXfxjsSBC4JK99a5/YGMzaezfkindQuB0i+UJzAiABYLmSJm/fb++AX15jcO3PzWSMiclDnrJ367y64y3iZA=="}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.0.5-beta.4_1586011162872_0.7732526119365217"},"_hasShrinkwrap":false},"3.0.5-beta.5":{"name":"@mihanizm56/fetch-api","version":"3.0.5-beta.5","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"set CI=true && jest","test:coverage":"jest --coverage","compile":"tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint . --ext .ts --fix","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","pub":"npm publish --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","node-fetch":"2.6.0","typescript":"3.8.3"},"devDependencies":{"@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.0.3","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.2.1","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Sollution for http/1.1 isomorphic fetch\n\n### Benefits:\n\n- Provides validation for responses (based on @hapi/joi Schema validation)\n- Provides query-params serialize\n- Provides cancel-request if the timeout is higher than 60 seconds\n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error from `errorsMap`\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure\n- Works in browser and node environments\n\n#### RestRequest input options:\n\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body (you have to JSON or FormData it by youself)\n- mode('cors' | 'no-cors'): the cors type\n- parseType('json' | 'blob'): the type to parse the response (json by default)\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- errorsMap(object): the object with the errors keys and translated values (TIMEOUT_ERROR and REQUEST_DEFAULT_ERROR fields are required, others must be provided according to the backend errors)\n\n#### RestRequest output options:\n\n- error (boolean) - the flag of the response status\n- errorText (string) - the main error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional multiple errors from the backend\n\n#### JSONRPCRequest input options:\n\n- the same as RestRequest input options\n- id (string | number) - the request id\n\n#### JSONRPCRequest output options:\n\n- jsonrpc (string) - version of json-rpc\n- result (object | array) - the main data from the backend\n- error (object) - (non required, exists only if there is an error) the error object with message and code from the backend\n- id (string | number) - the request id\n\n## Examples of usage\n\n### REST API\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### get request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IRESTResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IRESTResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    errorsMap: {\n      TIMEOUT_ERROR: \"Превышено ожидание запроса\",\n      REQUEST_DEFAULT_ERROR: \"Системная ошибка\",\n      [FORBIDDEN]: \"Данное действие недоступно\"\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required()\n          })\n        )\n      })\n    })\n  });\n```\n\n#### post(put/patch/delete have the same format) request\n\n```javascript\nimport { RestRequest, IRESTResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IRESTResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    errorsMap: {\n      TIMEOUT_ERROR: \"Превышено ожидание запроса\",\n      REQUEST_DEFAULT_ERROR: \"Системная ошибка\",\n      [FORBIDDEN]: \"Данное действие недоступно\"\n    },\n    body: JSON.stringify(someData),\n    mode: \"cors\",\n    parseType: \"blob\",\n    queryParams: {\n      id: \"test_id_123\"\n    },\n    headers: {\n      \"Content-Type\": \"application/json\"\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\"))\n    })\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createReviseRequest(\n  someData\n);\n```\n\n### JSON-RPC API\n\n```javascript\nimport { JSONRPCRequest, IJSONRPCResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createItemsRequest = ({\n  someData,\n  requestId\n}): Promise<IJSONRPCResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint: \"http://localhost:3000\",\n    errorsMap: {\n      TIMEOUT_ERROR: \"Превышено ожидание запроса\",\n      REQUEST_DEFAULT_ERROR: \"Системная ошибка\"\n    },\n    body: JSON.stringify({ ...someData, id: requestId }),\n    mode: \"cors\",\n    queryParams: {\n      id: \"123\"\n    },\n    responseSchema: Joi.object({\n      items: Joi.array().items(\n        Joi.object({\n          id: Joi.string().required(),\n          name: Joi.string().required(),\n          name: Joi.string()\n        })\n      )\n    }),\n    id: requestId\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { jsonrpc, result, error, id } = await createItemsRequest({\n  someData,\n  requestId: \"1\"\n});\n```\n","readmeFilename":"README.md","gitHead":"ac4bf63fb902da68cd9433f9e1935c831255166a","_id":"@mihanizm56/fetch-api@3.0.5-beta.5","_nodeVersion":"12.13.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-ZUVY2CMDikWW2t55PSpr4HADIYYTmrnydhIZz3otcjENFjYiu858I2e8m5If1FFgeQ8+xIs8EMYtVZUJwzJIDA==","shasum":"7af512ee25e133939e98bb2900a45465ad14b5b3","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.0.5-beta.5.tgz","fileCount":51,"unpackedSize":57454,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeiJx9CRA9TVsSAnZWagAAQDUP+QDnh/H3+8MHsdJtfLSM\n4WcKXbFI64xjdJYENnzSdyv3358o2OWYwIN/KXh68OBp0DfmkQ4CWWopwske\nX/ZZUVeLjCNkPAaelhKKytj3dCiesHb9nUO1OIzIsWgUFxBxTqmTpy64dx+j\n5vyXoVMB2wWmhAmk0s/1H/zVlbEBMMzyZlTHN4XUfrPApG62kwzXSwJZAmuR\nAxOEQNpQtF/9+H9JTSe8x9iyJfff4q2R9pIN0DnOw0PuMtIySePl4ldObgNe\nNrFbXBIX7tmGqfeKQXYzWO7DZtJaXm/8qtvt04YxG4XBJbS3qmWEb5fsGmYR\nH6iDPFeWZLZWe3Dmjtpo7LgEA0HYI3Sr3pzpa0dH3vfZrWc75u3Z0yVohO8q\n4k6L26YtVuIPp+UG9YDJ3yneezgj3lxif4EnAwkozqSNPFN0b6e2BZnT43Ko\nIb91ok+HHnRMVJJn3qdYyBEy2piWRva2kUJoNDyvnVgpfZlfqI2VoFco57uQ\nRiLlpjOn6aviZ59i1F45/xKfmMxOFGEWaox5VzikwTdNX1aDhX91FJBqbQGl\nGRF1CNYZLVQcEMoVt/YCZ/+6HmyPfc2AvTmJto2JxJ8gzoRZ6UmQQVPCCooN\nuhrzv39dVEoxD9qDFUkCRKVIVoxtX6krOFgyX7IxOtnGVYUFtEqszEHKMVG0\nrcpZ\r\n=hzSi\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCHqSwe0+csrxVyeFJfQk/c6clCagnZbf9y+z/cP5enOQIhAM0UOwxnrfdE9gzHmK8cyE9vM649SpWi6ETfdknrjE4u"}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.0.5-beta.5_1586011260724_0.6772072589350586"},"_hasShrinkwrap":false},"3.0.5-beta.6":{"name":"@mihanizm56/fetch-api","version":"3.0.5-beta.6","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"set CI=true && jest","test:coverage":"jest --coverage","compile":"tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint . --ext .ts --fix","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","pub":"npm publish --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","node-fetch":"2.6.0","typescript":"3.8.3"},"devDependencies":{"@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.0.3","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.2.1","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Sollution for http/1.1 isomorphic fetch\n\n### Benefits:\n\n- Provides validation for responses (based on @hapi/joi Schema validation)\n- Provides query-params serialize\n- Provides cancel-request if the timeout is higher than 60 seconds\n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error from `errorsMap`\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure\n- Works in browser and node environments\n\n#### RestRequest input options:\n\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body (you have to JSON or FormData it by youself)\n- mode('cors' | 'no-cors'): the cors type\n- parseType('json' | 'blob'): the type to parse the response (json by default)\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- errorsMap(object): the object with the errors keys and translated values (TIMEOUT_ERROR and REQUEST_DEFAULT_ERROR fields are required, others must be provided according to the backend errors)\n\n#### RestRequest output options:\n\n- error (boolean) - the flag of the response status\n- errorText (string) - the main error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional multiple errors from the backend\n\n#### JSONRPCRequest input options:\n\n- the same as RestRequest input options\n- id (string | number) - the request id\n\n#### JSONRPCRequest output options:\n\n- jsonrpc (string) - version of json-rpc\n- result (object | array) - the main data from the backend\n- error (object) - (non required, exists only if there is an error) the error object with message and code from the backend\n- id (string | number) - the request id\n\n## Examples of usage\n\n### REST API\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### get request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IRESTResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IRESTResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    errorsMap: {\n      TIMEOUT_ERROR: \"Превышено ожидание запроса\",\n      REQUEST_DEFAULT_ERROR: \"Системная ошибка\",\n      [FORBIDDEN]: \"Данное действие недоступно\"\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required()\n          })\n        )\n      })\n    })\n  });\n```\n\n#### post(put/patch/delete have the same format) request\n\n```javascript\nimport { RestRequest, IRESTResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IRESTResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    errorsMap: {\n      TIMEOUT_ERROR: \"Превышено ожидание запроса\",\n      REQUEST_DEFAULT_ERROR: \"Системная ошибка\",\n      [FORBIDDEN]: \"Данное действие недоступно\"\n    },\n    body: JSON.stringify(someData),\n    mode: \"cors\",\n    parseType: \"blob\",\n    queryParams: {\n      id: \"test_id_123\"\n    },\n    headers: {\n      \"Content-Type\": \"application/json\"\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\"))\n    })\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createReviseRequest(\n  someData\n);\n```\n\n### JSON-RPC API\n\n```javascript\nimport { JSONRPCRequest, IJSONRPCResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createItemsRequest = ({\n  someData,\n  requestId\n}): Promise<IJSONRPCResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint: \"http://localhost:3000\",\n    errorsMap: {\n      TIMEOUT_ERROR: \"Превышено ожидание запроса\",\n      REQUEST_DEFAULT_ERROR: \"Системная ошибка\"\n    },\n    body: JSON.stringify({ ...someData, id: requestId }),\n    mode: \"cors\",\n    queryParams: {\n      id: \"123\"\n    },\n    responseSchema: Joi.object({\n      items: Joi.array().items(\n        Joi.object({\n          id: Joi.string().required(),\n          name: Joi.string().required(),\n          name: Joi.string()\n        })\n      )\n    }),\n    id: requestId\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { jsonrpc, result, error, id } = await createItemsRequest({\n  someData,\n  requestId: \"1\"\n});\n```\n","readmeFilename":"README.md","gitHead":"52ad7e85690430985bb560de5e61cec8b04958d8","_id":"@mihanizm56/fetch-api@3.0.5-beta.6","_nodeVersion":"12.13.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-3x1YhRj3T3DBFBpb+roGA5decdGxtuQsKEzNNDWB8zHWjURsrexXa/5e7ckqmXATxRkVR9LkoLnWqrCkl6mszw==","shasum":"c66e003bcba39a578ecd178ce9cb7c848b3b4bc6","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.0.5-beta.6.tgz","fileCount":51,"unpackedSize":57520,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeiJ5LCRA9TVsSAnZWagAAby8P/3QWZ2XAUCenodVv5X/3\nxvh5apdch3xgXf5rzQyQUIgznKpwnAlx5a5fi1R8sJZOSni78x2GdAcM7lQT\ni5MyZJqhjQJBSetzawzPYAcVBulxhR0y02O2wJW0nwg+344MRTsKwZhRCuUk\n9hVwwCvT0vaJevLKRpNSSbxONBIJYmrQ6V2i8zIurY/PX+M1PEnI1+MG+wkp\nF9XhWCYNcGaND8J69HQeXwIxKuw3NLhQHTxBrWnc1RaDsZd7KeVN6CzOUYOC\n5NvUQYdVkDpd5wrlzFsyuGNshbggVdX7BP8B3EZNa2DHAieukH4IUWzzx96b\nJDcJCbbx27vHpKEMZdMQhzrhOfMyCXy2j0+9LxfGr/KpbYEYbOARPQO0fJ0Q\n+k/uowD8yFsa1ekiW8cfRzE2rIWtMLTVC++VzhW8/iBaOu7TsLgxSNH56wm5\nbfrk6QOzTOuQGcAZsD4YXC+dR82dkOyl0+9Zawhocr8bttuhj+IeDFnU0sEv\nKQDCgBst3A4JcDujsMV4zcotjcT+slh14V1HvlLQNCtxe3ndX0F4VuSw7iJo\nV914NheTUH6FatCdnrDufXFdEJu8Oft2MswGlOetK7KuER4coG1iKs86fTlB\nAjwW/WrTbBE/5eGROxOXrBvTNOArDAdVQIldsQnwYC9MRuMIE/9+vOTmYjHP\nqrzA\r\n=VHyi\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDEb1JMdX7YFVk0E30wqZ9cdut8tY8/hFDKYJV7+0WCdgIhAK4FKaaadgWyYyCTICKvmAhYcj2SpFZ0FReKvu4EvPF0"}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.0.5-beta.6_1586011723320_0.16978483832687674"},"_hasShrinkwrap":false},"3.0.5-beta.7":{"name":"@mihanizm56/fetch-api","version":"3.0.5-beta.7","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"set CI=true && jest","test:coverage":"jest --coverage","compile":"tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint . --ext .ts --fix","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","pub":"npm publish --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","node-fetch":"2.6.0","typescript":"3.8.3"},"devDependencies":{"@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.0.3","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.2.1","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Sollution for http/1.1 isomorphic fetch\n\n### Benefits:\n\n- Provides validation for responses (based on @hapi/joi Schema validation)\n- Provides query-params serialize\n- Provides cancel-request if the timeout is higher than 60 seconds\n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error from `errorsMap`\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure\n- Works in browser and node environments\n\n#### RestRequest input options:\n\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body (you have to JSON or FormData it by youself)\n- mode('cors' | 'no-cors'): the cors type\n- parseType('json' | 'blob'): the type to parse the response (json by default)\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- errorsMap(object): the object with the errors keys and translated values (TIMEOUT_ERROR and REQUEST_DEFAULT_ERROR fields are required, others must be provided according to the backend errors)\n\n#### RestRequest output options:\n\n- error (boolean) - the flag of the response status\n- errorText (string) - the main error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional multiple errors from the backend\n\n#### JSONRPCRequest input options:\n\n- the same as RestRequest input options\n- id (string | number) - the request id\n\n#### JSONRPCRequest output options:\n\n- jsonrpc (string) - version of json-rpc\n- result (object | array) - the main data from the backend\n- error (object) - (non required, exists only if there is an error) the error object with message and code from the backend\n- id (string | number) - the request id\n\n## Examples of usage\n\n### REST API\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### get request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IRESTResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IRESTResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    errorsMap: {\n      TIMEOUT_ERROR: \"Превышено ожидание запроса\",\n      REQUEST_DEFAULT_ERROR: \"Системная ошибка\",\n      [FORBIDDEN]: \"Данное действие недоступно\"\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required()\n          })\n        )\n      })\n    })\n  });\n```\n\n#### post(put/patch/delete have the same format) request\n\n```javascript\nimport { RestRequest, IRESTResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IRESTResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    errorsMap: {\n      TIMEOUT_ERROR: \"Превышено ожидание запроса\",\n      REQUEST_DEFAULT_ERROR: \"Системная ошибка\",\n      [FORBIDDEN]: \"Данное действие недоступно\"\n    },\n    body: JSON.stringify(someData),\n    mode: \"cors\",\n    parseType: \"blob\",\n    queryParams: {\n      id: \"test_id_123\"\n    },\n    headers: {\n      \"Content-Type\": \"application/json\"\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\"))\n    })\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createReviseRequest(\n  someData\n);\n```\n\n### JSON-RPC API\n\n```javascript\nimport { JSONRPCRequest, IJSONRPCResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createItemsRequest = ({\n  someData,\n  requestId\n}): Promise<IJSONRPCResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint: \"http://localhost:3000\",\n    errorsMap: {\n      TIMEOUT_ERROR: \"Превышено ожидание запроса\",\n      REQUEST_DEFAULT_ERROR: \"Системная ошибка\"\n    },\n    body: JSON.stringify({ ...someData, id: requestId }),\n    mode: \"cors\",\n    queryParams: {\n      id: \"123\"\n    },\n    responseSchema: Joi.object({\n      items: Joi.array().items(\n        Joi.object({\n          id: Joi.string().required(),\n          name: Joi.string().required(),\n          name: Joi.string()\n        })\n      )\n    }),\n    id: requestId\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { jsonrpc, result, error, id } = await createItemsRequest({\n  someData,\n  requestId: \"1\"\n});\n```\n","readmeFilename":"README.md","gitHead":"108075d101a24f5331a05c909b4595cfe92f0265","_id":"@mihanizm56/fetch-api@3.0.5-beta.7","_nodeVersion":"12.13.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-eMCS9heKcEjJzpPBjIi0ETATlEZTvmlheaZ10FjpmJxFAQ3eWxDoDyON6SWSbiNIxsVwVZt2KWGLvXbQV0NTTg==","shasum":"72e81c33d252d5ba64e46dfe92f8d927885ca935","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.0.5-beta.7.tgz","fileCount":51,"unpackedSize":57531,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeiJ8KCRA9TVsSAnZWagAABdsP/1j5k4amySn/oCg3Z/p1\nnFMMN+V84LdsrFId7yKfjGqrw8+egqO7U4Y/oQzaL6Dlz6vHdtvVGr5+ZO4F\nC5j4zlGPdTKDYs+rtuCy75cKtAt9b1t7BTPShiehdJ7B/yVqYtqPX6DLyDCZ\nVtNoWHACdAs9a9iD+i/0SoAnysU6FB2W17+8NLfNfq3KWjSj71tJ/fzmVEwS\nE/bMeW2dzaKtZJ1Qppp/FCUL5hFsP8bfdjqT34mYirjlXMA81heXmCXhoD3u\n3Je7kjJAQfExIuvWgcBbQZFsn+YLqRZWG9ikXPEVeyamDCI4VgAZ0nu+ql2p\nibYwtcBqci3M0kHSG0WB0XvjqBOnUpJt6AoR+DK0WSqh4WyRCFmJJTnUU+Hi\nEj/uq6HywaJa0d2EGP+9SEVfptf614GFUxZA01NJzMONHH8GB3vO1EpGnEv/\nSqi4ck4JDaQfysCR/CTN81QqdYSTlY8ld5jDISQyF0+udAJ0ZEhjeujGSNVw\nKarSKWGXd4MQR0aAB4ClJTGn/B+yDiuDpQ5VbnWCkdcsLsT0juoI7x/W/8EL\nx8owqJ9HMuZE03BSz5nSjEtaQtKABmJ/8+SWy0LSBybXCyB4RdBtzDuMd7mX\nVkWTjiC8EbMFZL6ko0+QJXPF2ryVPN4GA09fgxtqPy8nHd4bw2v6jGHHgCvv\nZvfD\r\n=2shb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDOK78pt/dJYjPD6aAevqLpz4u3bRkidt+Z7z8IN7t3iAiAbCMeGFIBb/UlhL1/Nfn/D+d2HWFiSvlZpbtN8H4RPUw=="}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.0.5-beta.7_1586011914048_0.9068638305398264"},"_hasShrinkwrap":false},"3.0.5-beta.8":{"name":"@mihanizm56/fetch-api","version":"3.0.5-beta.8","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"set CI=true && jest","test:coverage":"jest --coverage","compile":"tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint . --ext .ts --fix","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","pub":"npm publish --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","node-fetch":"2.6.0","typescript":"3.8.3"},"devDependencies":{"@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.0.3","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.2.1","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Sollution for http/1.1 isomorphic fetch\n\n### Benefits:\n\n- Provides validation for responses (based on @hapi/joi Schema validation)\n- Provides query-params serialize\n- Provides cancel-request if the timeout is higher than 60 seconds\n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error from `errorsMap`\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure\n- Works in browser and node environments\n\n#### RestRequest input options:\n\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body (you have to JSON or FormData it by youself)\n- mode('cors' | 'no-cors'): the cors type\n- parseType('json' | 'blob'): the type to parse the response (json by default)\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- errorsMap(object): the object with the errors keys and translated values (TIMEOUT_ERROR and REQUEST_DEFAULT_ERROR fields are required, others must be provided according to the backend errors)\n\n#### RestRequest output options:\n\n- error (boolean) - the flag of the response status\n- errorText (string) - the main error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional multiple errors from the backend\n\n#### JSONRPCRequest input options:\n\n- the same as RestRequest input options\n- id (string | number) - the request id\n\n#### JSONRPCRequest output options:\n\n- jsonrpc (string) - version of json-rpc\n- result (object | array) - the main data from the backend\n- error (object) - (non required, exists only if there is an error) the error object with message and code from the backend\n- id (string | number) - the request id\n\n## Examples of usage\n\n### REST API\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### get request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IRESTResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IRESTResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    errorsMap: {\n      TIMEOUT_ERROR: \"Превышено ожидание запроса\",\n      REQUEST_DEFAULT_ERROR: \"Системная ошибка\",\n      [FORBIDDEN]: \"Данное действие недоступно\"\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required()\n          })\n        )\n      })\n    })\n  });\n```\n\n#### post(put/patch/delete have the same format) request\n\n```javascript\nimport { RestRequest, IRESTResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IRESTResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    errorsMap: {\n      TIMEOUT_ERROR: \"Превышено ожидание запроса\",\n      REQUEST_DEFAULT_ERROR: \"Системная ошибка\",\n      [FORBIDDEN]: \"Данное действие недоступно\"\n    },\n    body: JSON.stringify(someData),\n    mode: \"cors\",\n    parseType: \"blob\",\n    queryParams: {\n      id: \"test_id_123\"\n    },\n    headers: {\n      \"Content-Type\": \"application/json\"\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\"))\n    })\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createReviseRequest(\n  someData\n);\n```\n\n### JSON-RPC API\n\n```javascript\nimport { JSONRPCRequest, IJSONRPCResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createItemsRequest = ({\n  someData,\n  requestId\n}): Promise<IJSONRPCResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint: \"http://localhost:3000\",\n    errorsMap: {\n      TIMEOUT_ERROR: \"Превышено ожидание запроса\",\n      REQUEST_DEFAULT_ERROR: \"Системная ошибка\"\n    },\n    body: JSON.stringify({ ...someData, id: requestId }),\n    mode: \"cors\",\n    queryParams: {\n      id: \"123\"\n    },\n    responseSchema: Joi.object({\n      items: Joi.array().items(\n        Joi.object({\n          id: Joi.string().required(),\n          name: Joi.string().required(),\n          name: Joi.string()\n        })\n      )\n    }),\n    id: requestId\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { jsonrpc, result, error, id } = await createItemsRequest({\n  someData,\n  requestId: \"1\"\n});\n```\n","readmeFilename":"README.md","gitHead":"4bea93b10a8009cf8598ba04dd30be901494b4d3","_id":"@mihanizm56/fetch-api@3.0.5-beta.8","_nodeVersion":"12.13.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-c5UvHqsWVwLjrXVeLW/NK0Eb3J5dxcmR7U4EhIYHCbe1N/9EnVoXNPUYTGqViPXiqLJuIx4YciIUE2/+EmMF1g==","shasum":"d944ae7c7370d16fecf4f0da32a276dd4935df68","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.0.5-beta.8.tgz","fileCount":51,"unpackedSize":57314,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeiKCLCRA9TVsSAnZWagAAKccP/igUnjzt/KbBf+mMb/5I\n8XL8XI2OYBE90NbQsVvhXuKTZuPSnk/S093iHjfSAfW9f4Q/lA3gcnUtkgIh\nsiHfn7N45NJH5z/lFPQR13a2FvAnE7HRHLHZyRJR4Xl4LGM4bCyzDQTRc8dM\nxS+bNwAAQ9163U3JAusq3Gr/EpGtOqpPXaGpJOgTOiTw85e8dy6Hq0Id9aAs\ndD2yhpL2b2zS8vQKTlgfRIkZ63NYtNxFcnoRPI2oV3p/+AGAbfNEe+pOnOvx\n2gqmmXpsyFA0cptYokDz7CGqFFkmk33cLte3gUDTMIPFY3slkOjFcgyvH2Z2\nvrF/zD1RJ1cQRPHKfldu5gv/jlWBTXQyw/bo8g3YSJwUJaOkUHgfYFBJyZg3\nxG5YLil385BC8eqlu7XD9stDMHtpirEd5AkBrgZ1ykwGbAryofN/ypQQQqac\nJ7aa/IDACX5gXoX2Syh6k7yf/jXkYTPOiGNDTHsE2RzYhhlm0hCkvJWO71CB\niZIT4OUZeLXigRFXf974e9fiAqB3XnA4TuditbPDA21PKwtaDg6z58FWQLyr\ntSVOM0y6xYRX907QpIdayfnWhfTSXwfan5DU2f6eiitrCpNaIhebqRtHW9kB\n9JLL7wbH1r2Ce7gW0X+KapDvAYsmNxoToksvbyDLJ29RKxX+yfzPbVw8o2GB\n9+LP\r\n=ZzxB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFvfvE+dA8BiFEImv8o+r7kCG8sSC7DAZDBCscXqf96JAiEAqG1XdGA/VHkDieaIfA7SR2GkjP7+1zaQGC21437qpiI="}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.0.5-beta.8_1586012298610_0.10645483266423961"},"_hasShrinkwrap":false},"3.0.5-beta.9":{"name":"@mihanizm56/fetch-api","version":"3.0.5-beta.9","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"set CI=true && jest","test:coverage":"jest --coverage","compile":"tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint . --ext .ts --fix","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","pub":"npm publish --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","node-fetch":"2.6.0","typescript":"3.8.3"},"devDependencies":{"@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.0.3","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.2.1","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Sollution for http/1.1 isomorphic fetch\n\n### Benefits:\n\n- Provides validation for responses (based on @hapi/joi Schema validation)\n- Provides query-params serialize\n- Provides cancel-request if the timeout is higher than 60 seconds\n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error from `errorsMap`\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure\n- Works in browser and node environments\n\n#### RestRequest input options:\n\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body (you have to JSON or FormData it by youself)\n- mode('cors' | 'no-cors'): the cors type\n- parseType('json' | 'blob'): the type to parse the response (json by default)\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- errorsMap(object): the object with the errors keys and translated values (TIMEOUT_ERROR and REQUEST_DEFAULT_ERROR fields are required, others must be provided according to the backend errors)\n\n#### RestRequest output options:\n\n- error (boolean) - the flag of the response status\n- errorText (string) - the main error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional multiple errors from the backend\n\n#### JSONRPCRequest input options:\n\n- the same as RestRequest input options\n- id (string | number) - the request id\n\n#### JSONRPCRequest output options:\n\n- jsonrpc (string) - version of json-rpc\n- result (object | array) - the main data from the backend\n- error (object) - (non required, exists only if there is an error) the error object with message and code from the backend\n- id (string | number) - the request id\n\n## Examples of usage\n\n### REST API\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### get request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IRESTResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IRESTResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    errorsMap: {\n      TIMEOUT_ERROR: \"Превышено ожидание запроса\",\n      REQUEST_DEFAULT_ERROR: \"Системная ошибка\",\n      [FORBIDDEN]: \"Данное действие недоступно\"\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required()\n          })\n        )\n      })\n    })\n  });\n```\n\n#### post(put/patch/delete have the same format) request\n\n```javascript\nimport { RestRequest, IRESTResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IRESTResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    errorsMap: {\n      TIMEOUT_ERROR: \"Превышено ожидание запроса\",\n      REQUEST_DEFAULT_ERROR: \"Системная ошибка\",\n      [FORBIDDEN]: \"Данное действие недоступно\"\n    },\n    body: JSON.stringify(someData),\n    mode: \"cors\",\n    parseType: \"blob\",\n    queryParams: {\n      id: \"test_id_123\"\n    },\n    headers: {\n      \"Content-Type\": \"application/json\"\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\"))\n    })\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createReviseRequest(\n  someData\n);\n```\n\n### JSON-RPC API\n\n```javascript\nimport { JSONRPCRequest, IJSONRPCResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createItemsRequest = ({\n  someData,\n  requestId\n}): Promise<IJSONRPCResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint: \"http://localhost:3000\",\n    errorsMap: {\n      TIMEOUT_ERROR: \"Превышено ожидание запроса\",\n      REQUEST_DEFAULT_ERROR: \"Системная ошибка\"\n    },\n    body: JSON.stringify({ ...someData, id: requestId }),\n    mode: \"cors\",\n    queryParams: {\n      id: \"123\"\n    },\n    responseSchema: Joi.object({\n      items: Joi.array().items(\n        Joi.object({\n          id: Joi.string().required(),\n          name: Joi.string().required(),\n          name: Joi.string()\n        })\n      )\n    }),\n    id: requestId\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { jsonrpc, result, error, id } = await createItemsRequest({\n  someData,\n  requestId: \"1\"\n});\n```\n","readmeFilename":"README.md","gitHead":"6831448f558d384e2a6e096adc834c64b31bedf3","_id":"@mihanizm56/fetch-api@3.0.5-beta.9","_nodeVersion":"12.13.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-zSsQtABI2YYstvlBAR3qllj3JEsWFumlIxHe8Qv+OF048mGw4WIggXr5aeHxzIanBig6GqYknDPRIWWiISgA3g==","shasum":"20c036708a43f1d95eff17fb32bfb248005cae88","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.0.5-beta.9.tgz","fileCount":51,"unpackedSize":57442,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeiKJICRA9TVsSAnZWagAAz/QP/19vfYaUM2GlPTUrfx/2\nrED6xBv+gwk4xngO2m5qNyeddeOacS+Kxf39aP7kphqE3mFaHs2dOzcpzemT\ng0txOAEGMIPv+f+U5FoV9ajexYp78/3t2UrGnknaFKwUt1ZSM38AICDGRDEU\nUO+aXsCsA5mnXRu+bW7+EaJ6j0qVut3/IxcWGD0PuB3GJlBbJvXa/anni23A\ngTKz97CxW4tBl+miyhyQEOZAPY20jdSQjwxom2V4Cc6LPLaxoQ0rZzqKq3c3\nDCmBES3eA6SlVBLyvMlt8P8wMpIXJHpqbbqHmz8Np+DvfMHlsFQ2GDBF4ODr\niOo8KyDbV+2fyyUuIDYtM58DlGUHwlW9+9/DhZBV0iwOYsDB+HNdzAOebL4H\nQzO9wN/kBwXunVC0uCqwfshmMzCntfsCQTm0U8q4EocOJx6/N+LoxxOKlU8F\nSRlcWNuEBS5oi2CYUPjNIoGuD+HnaE8dOc1Gqh8ymdI4lQZaWEHQyHAWyMQh\nZL1TDULWIUauntHP08JWbl4QRvZUk2OMKn5PwZUXh7cQ/0UhJ3c+qfK2WOWU\nOr+YkzvCiEIUZgruksSmTAMwhnsNzGYVAuoPksMQjrFWYHiguks6l7shFEm/\nPZs1IdbyqGKmlLxHs/1QXQyCh8/1pXTHH+Qetqwu0D0OLM/nF3lX86NLlr/L\nIHkH\r\n=L3GH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDFgZZcICrtHwfpqtuyebBjB6bmIFJAgGTND9VOxxHbVQIhAOvR7nESr3t2TmVtSl0SYkAD1U8JM+9qzRzqR5LnFRXf"}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.0.5-beta.9_1586012743756_0.04901779168153708"},"_hasShrinkwrap":false},"3.0.5-beta.10":{"name":"@mihanizm56/fetch-api","version":"3.0.5-beta.10","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"set CI=true && jest","test:coverage":"jest --coverage","compile":"tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint . --ext .ts --fix","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","pub":"npm publish --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","node-fetch":"2.6.0","typescript":"3.8.3"},"devDependencies":{"@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.0.3","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.2.1","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Sollution for http/1.1 isomorphic fetch\n\n### Benefits:\n\n- Provides validation for responses (based on @hapi/joi Schema validation)\n- Provides query-params serialize\n- Provides cancel-request if the timeout is higher than 60 seconds\n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error from `errorsMap`\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure\n- Works in browser and node environments\n\n#### RestRequest input options:\n\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body (you have to JSON or FormData it by youself)\n- mode('cors' | 'no-cors'): the cors type\n- parseType('json' | 'blob'): the type to parse the response (json by default)\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- errorsMap(object): the object with the errors keys and translated values (TIMEOUT_ERROR and REQUEST_DEFAULT_ERROR fields are required, others must be provided according to the backend errors)\n\n#### RestRequest output options:\n\n- error (boolean) - the flag of the response status\n- errorText (string) - the main error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional multiple errors from the backend\n\n#### JSONRPCRequest input options:\n\n- the same as RestRequest input options\n- id (string | number) - the request id\n\n#### JSONRPCRequest output options:\n\n- jsonrpc (string) - version of json-rpc\n- result (object | array) - the main data from the backend\n- error (object) - (non required, exists only if there is an error) the error object with message and code from the backend\n- id (string | number) - the request id\n\n## Examples of usage\n\n### REST API\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### get request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IRESTResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IRESTResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    errorsMap: {\n      TIMEOUT_ERROR: \"Превышено ожидание запроса\",\n      REQUEST_DEFAULT_ERROR: \"Системная ошибка\",\n      [FORBIDDEN]: \"Данное действие недоступно\"\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required()\n          })\n        )\n      })\n    })\n  });\n```\n\n#### post(put/patch/delete have the same format) request\n\n```javascript\nimport { RestRequest, IRESTResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IRESTResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    errorsMap: {\n      TIMEOUT_ERROR: \"Превышено ожидание запроса\",\n      REQUEST_DEFAULT_ERROR: \"Системная ошибка\",\n      [FORBIDDEN]: \"Данное действие недоступно\"\n    },\n    body: JSON.stringify(someData),\n    mode: \"cors\",\n    parseType: \"blob\",\n    queryParams: {\n      id: \"test_id_123\"\n    },\n    headers: {\n      \"Content-Type\": \"application/json\"\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\"))\n    })\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createReviseRequest(\n  someData\n);\n```\n\n### JSON-RPC API\n\n```javascript\nimport { JSONRPCRequest, IJSONRPCResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createItemsRequest = ({\n  someData,\n  requestId\n}): Promise<IJSONRPCResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint: \"http://localhost:3000\",\n    errorsMap: {\n      TIMEOUT_ERROR: \"Превышено ожидание запроса\",\n      REQUEST_DEFAULT_ERROR: \"Системная ошибка\"\n    },\n    body: JSON.stringify({ ...someData, id: requestId }),\n    mode: \"cors\",\n    queryParams: {\n      id: \"123\"\n    },\n    responseSchema: Joi.object({\n      items: Joi.array().items(\n        Joi.object({\n          id: Joi.string().required(),\n          name: Joi.string().required(),\n          name: Joi.string()\n        })\n      )\n    }),\n    id: requestId\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { jsonrpc, result, error, id } = await createItemsRequest({\n  someData,\n  requestId: \"1\"\n});\n```\n","readmeFilename":"README.md","gitHead":"46456c963dab0ef7b32c6fffa027d98b6f15f9d1","_id":"@mihanizm56/fetch-api@3.0.5-beta.10","_nodeVersion":"12.13.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-FZXsRFHYPdTuaq9TESHBzBshUDcDH5Ias9aA2q3fa1+XrPn47Ev3a8hfLCwLyOsJWadwD4ZtY2y/8QmCAm7ccQ==","shasum":"64ecf09f920548d05dc2adae2d1e48cfbdfa819f","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.0.5-beta.10.tgz","fileCount":51,"unpackedSize":57559,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeiKYKCRA9TVsSAnZWagAA6MMP/iSykWhZ7+4yfi1K2AGA\nZ61GxHwyaJPHbVbHoUQ1VBYR6js9ADzi/10sj9XLQoop0tVqsKTjeLadoIhC\n69xTmBshwpjXNc7yQM7D5Orw3LDXwAKwJ1+fdtQ5fGUNRVn7EpR0jsnRvPJo\nPa6bQTO+on22ECkrh1Yv80rVOqc+6V23t8zPb3T4xmhdfvTuTRmGk7NWgkhX\ndrIA4D8J38zF6qlmh1A+/QuB1CC/6rM2x/kArHLCJ0eV5AXmuuUmhm9y9BxE\n8rq/UHdUZGlvDwTwQn1dLj5JKtJlyaiiLtEaEUPcNDSM2hS521m8wivR/kWj\nRQh2KfQWIZFgzsV1nohSf3d//S418+Wm+ra1l30LFmSoZnsWqQ3BtQfKMuGK\nZb377GP7sR0t9iN8eR8MVVWcUU/pW0qM5QEF1gZwxczXwAxOROnpHrcFCxdd\nYomaSPA0DU02UwrtMTs2E4dmFyJA9KjIwmjGCQr9+tlvzDfV7YSJA0dVX3we\nKaiT1TwCJaq6WWDVkTR1X2MQai3lPDS4lGMDegUK4DxQrVFq5YHS3Q95+wTl\nn/PhAf+CrTcQnq4s7LZ1mP7+sgZRYnjQAwWscIVwUF2CkUwl9PhuZszMBYqe\nnJt6BKXDasmqc+8fo+0fLnsqMxfhA0B/g2DMebIqh+AONi+WcEd4Fk6R36a/\nRirK\r\n=Irj6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEOK6F8Zd9E6sFON8pzk075JrNY+KENza0AbiAPElD/PAiAGk79DVb0y7nVnrkaC+VoScxbmo516KCChZH/aCzGRQg=="}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.0.5-beta.10_1586013705665_0.9396259716391424"},"_hasShrinkwrap":false},"3.0.5-beta.11":{"name":"@mihanizm56/fetch-api","version":"3.0.5-beta.11","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"set CI=true && jest","test:coverage":"jest --coverage","compile":"tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint . --ext .ts --fix","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","pub":"npm publish --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","node-fetch":"2.6.0","typescript":"3.8.3"},"devDependencies":{"@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.0.3","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.2.1","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Sollution for http/1.1 isomorphic fetch\n\n### Benefits:\n\n- Provides validation for responses (based on @hapi/joi Schema validation)\n- Provides query-params serialize\n- Provides cancel-request if the timeout is higher than 60 seconds\n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error from `errorsMap`\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure\n- Works in browser and node environments\n\n#### RestRequest input options:\n\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body (you have to JSON or FormData it by youself)\n- mode('cors' | 'no-cors'): the cors type\n- parseType('json' | 'blob'): the type to parse the response (json by default)\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- errorsMap(object): the object with the errors keys and translated values (TIMEOUT_ERROR and REQUEST_DEFAULT_ERROR fields are required, others must be provided according to the backend errors)\n\n#### RestRequest output options:\n\n- error (boolean) - the flag of the response status\n- errorText (string) - the main error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional multiple errors from the backend\n\n#### JSONRPCRequest input options:\n\n- the same as RestRequest input options\n- id (string | number) - the request id\n\n#### JSONRPCRequest output options:\n\n- jsonrpc (string) - version of json-rpc\n- result (object | array) - the main data from the backend\n- error (object) - (non required, exists only if there is an error) the error object with message and code from the backend\n- id (string | number) - the request id\n\n## Examples of usage\n\n### REST API\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### get request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IRESTResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IRESTResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    errorsMap: {\n      TIMEOUT_ERROR: \"Превышено ожидание запроса\",\n      REQUEST_DEFAULT_ERROR: \"Системная ошибка\",\n      [FORBIDDEN]: \"Данное действие недоступно\"\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required()\n          })\n        )\n      })\n    })\n  });\n```\n\n#### post(put/patch/delete have the same format) request\n\n```javascript\nimport { RestRequest, IRESTResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IRESTResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    errorsMap: {\n      TIMEOUT_ERROR: \"Превышено ожидание запроса\",\n      REQUEST_DEFAULT_ERROR: \"Системная ошибка\",\n      [FORBIDDEN]: \"Данное действие недоступно\"\n    },\n    body: JSON.stringify(someData),\n    mode: \"cors\",\n    parseType: \"blob\",\n    queryParams: {\n      id: \"test_id_123\"\n    },\n    headers: {\n      \"Content-Type\": \"application/json\"\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\"))\n    })\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createReviseRequest(\n  someData\n);\n```\n\n### JSON-RPC API\n\n```javascript\nimport { JSONRPCRequest, IJSONRPCResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createItemsRequest = ({\n  someData,\n  requestId\n}): Promise<IJSONRPCResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint: \"http://localhost:3000\",\n    errorsMap: {\n      TIMEOUT_ERROR: \"Превышено ожидание запроса\",\n      REQUEST_DEFAULT_ERROR: \"Системная ошибка\"\n    },\n    body: JSON.stringify({ ...someData, id: requestId }),\n    mode: \"cors\",\n    queryParams: {\n      id: \"123\"\n    },\n    responseSchema: Joi.object({\n      items: Joi.array().items(\n        Joi.object({\n          id: Joi.string().required(),\n          name: Joi.string().required(),\n          name: Joi.string()\n        })\n      )\n    }),\n    id: requestId\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { jsonrpc, result, error, id } = await createItemsRequest({\n  someData,\n  requestId: \"1\"\n});\n```\n","readmeFilename":"README.md","gitHead":"7efec887b8cafae96bb9bc28aadb921a8f91551b","_id":"@mihanizm56/fetch-api@3.0.5-beta.11","_nodeVersion":"12.13.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-uK/OeLnnuWgXuQfOyDiyOHTpNBjpyJGqMVZWIMRps/QFLqcfA7GFrhUGk8+NO43rjLYwXAmFgfTHF7rSVbq05w==","shasum":"7b78db2fec42cb9cb885984f8602dd5dc6170e6d","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.0.5-beta.11.tgz","fileCount":51,"unpackedSize":57591,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeiKcWCRA9TVsSAnZWagAA9kQP/jYH7M8dYY7FWRwPMXUP\nApCaKsVfOXSqeJnsXFH7meMIXa+b8+Y8SvfBosVXfLOHlzugYFgmO8vr9aCb\nNHjf+Sv/q8ew+mcdvX2NuSr9Q3ToTvkyGUdK4st1RHL1WyMecVSM+ZuRAXeD\nRJJpLEIkA/9sPGr9t0mUROuYkMhxMQYoOZlURSxEGihrcRQ9WzF5lFwPOHHx\nkyv0+fzljKrIlbK3E+uE3dntJTtyD40N/CKheEHJ1i5zepi2afUSfWEku+mN\nk9H/Ju9HrzOqSvwWwDb3/eaVXY+ZYeVgzDHONVh0xTm2oyV1i2o5EalZSo2C\nQSSbKqxMYypXoxa87SNtU6aMVaLykcqNyjJMImuyOcQiko6eI/MyLTHc1V+q\nGjPMmbyFzDF479+CBZ37tNR4zgqMsE1zXbqiJT0E59yZaciYk1X5na1Ks5ww\n7YCTvjN/6MWsDOM1Z1WRT1fIJISEiXOKtdmYZKn90prCe1z+ou5L0/Ypm43i\nrM1IKUcmKIDIbHmfyoPMa4lTVhPYZbzgchKTBBn2uboua3x5tR9/Dx5H6c6T\nWR4wxwNnjaLOoGpSA74aiozrLbsPK3t4zBRMYQd6bz0P7rJ6RIIf1FUybSVc\nXmDaSbAzXjRzAgMXVMaH7uCmuDPDRAnr6bfZ4cd3vK+YBc+hWcZryqg14AsO\nktE3\r\n=xtvq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDEKAsV3EGy0uEL/wcuA82Xkl7IrztnrNupyr15Mz1QvAIgIzCcBB5V2x5NMOctRgXnl+RaxLQc0RfPVta9PFi0qwY="}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.0.5-beta.11_1586013973744_0.15150547807983528"},"_hasShrinkwrap":false},"3.0.5-beta.12":{"name":"@mihanizm56/fetch-api","version":"3.0.5-beta.12","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"set CI=true && jest","test:coverage":"jest --coverage","compile":"tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint . --ext .ts --fix","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","pub":"npm publish --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","node-fetch":"2.6.0","typescript":"3.8.3"},"devDependencies":{"@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.0.3","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.2.1","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Sollution for http/1.1 isomorphic fetch\n\n### Benefits:\n\n- Provides validation for responses (based on @hapi/joi Schema validation)\n- Provides query-params serialize\n- Provides cancel-request if the timeout is higher than 60 seconds\n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error from `errorsMap`\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure\n- Works in browser and node environments\n\n#### RestRequest input options:\n\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body (you have to JSON or FormData it by youself)\n- mode('cors' | 'no-cors'): the cors type\n- parseType('json' | 'blob'): the type to parse the response (json by default)\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- errorsMap(object): the object with the errors keys and translated values (TIMEOUT_ERROR and REQUEST_DEFAULT_ERROR fields are required, others must be provided according to the backend errors)\n\n#### RestRequest output options:\n\n- error (boolean) - the flag of the response status\n- errorText (string) - the main error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional multiple errors from the backend\n\n#### JSONRPCRequest input options:\n\n- the same as RestRequest input options\n- id (string | number) - the request id\n\n#### JSONRPCRequest output options:\n\n- jsonrpc (string) - version of json-rpc\n- result (object | array) - the main data from the backend\n- error (object) - (non required, exists only if there is an error) the error object with message and code from the backend\n- id (string | number) - the request id\n\n## Examples of usage\n\n### REST API\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### get request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IRESTResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IRESTResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    errorsMap: {\n      TIMEOUT_ERROR: \"Превышено ожидание запроса\",\n      REQUEST_DEFAULT_ERROR: \"Системная ошибка\",\n      [FORBIDDEN]: \"Данное действие недоступно\"\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required()\n          })\n        )\n      })\n    })\n  });\n```\n\n#### post(put/patch/delete have the same format) request\n\n```javascript\nimport { RestRequest, IRESTResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IRESTResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    errorsMap: {\n      TIMEOUT_ERROR: \"Превышено ожидание запроса\",\n      REQUEST_DEFAULT_ERROR: \"Системная ошибка\",\n      [FORBIDDEN]: \"Данное действие недоступно\"\n    },\n    body: JSON.stringify(someData),\n    mode: \"cors\",\n    parseType: \"blob\",\n    queryParams: {\n      id: \"test_id_123\"\n    },\n    headers: {\n      \"Content-Type\": \"application/json\"\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\"))\n    })\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createReviseRequest(\n  someData\n);\n```\n\n### JSON-RPC API\n\n```javascript\nimport { JSONRPCRequest, IJSONRPCResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createItemsRequest = ({\n  someData,\n  requestId\n}): Promise<IJSONRPCResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint: \"http://localhost:3000\",\n    errorsMap: {\n      TIMEOUT_ERROR: \"Превышено ожидание запроса\",\n      REQUEST_DEFAULT_ERROR: \"Системная ошибка\"\n    },\n    body: JSON.stringify({ ...someData, id: requestId }),\n    mode: \"cors\",\n    queryParams: {\n      id: \"123\"\n    },\n    responseSchema: Joi.object({\n      items: Joi.array().items(\n        Joi.object({\n          id: Joi.string().required(),\n          name: Joi.string().required(),\n          name: Joi.string()\n        })\n      )\n    }),\n    id: requestId\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { jsonrpc, result, error, id } = await createItemsRequest({\n  someData,\n  requestId: \"1\"\n});\n```\n","readmeFilename":"README.md","gitHead":"e557dda4c591ce4444ff9e9d17665989d56c9ad9","_id":"@mihanizm56/fetch-api@3.0.5-beta.12","_nodeVersion":"12.13.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-2lMzeenyCtozbhG6Tsmntomqvy/JDA5I5s59hvCyPbLjgKzEccLINYo8O37oV0Q1pVP6LX6j5ZhVLmOD3m2Sfw==","shasum":"72a0529a205505a69e4a1fcbc304e8326b5123a4","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.0.5-beta.12.tgz","fileCount":51,"unpackedSize":57591,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeiKf8CRA9TVsSAnZWagAAn2sP/2fZKhCs5kkh6fJVqQfF\nLk3BZOxyjuApKjGUUnAj6pFhpM1mn8Wp+T6tAkCjpOJjvxWMWw/4Ir9ApE7M\noeduELD9Kq0lioMfM8yWyGF+v9TzIMFNMHOY2laWBIHvIlOnX1DsSFquOW39\n/lIbyK/Jixv81EypYG6OOnY1JjkqM1wavI+9D8o0LII7bBaj1Nhe5iA3RJb7\n5dP+ixVuzNnv8FW92C4qaq3/8pWX6THSKyRIcHgPGyXnwWbg5Bvp4np6Vj6t\nPJFfCo2ILrjRyVTqGdqrU4XamYhpV8N4PpgDW81TJynlJAREtR9K5u4+3sT1\ns9JcJQUaLK42Inu0h9lsziSJHGIvGPuimpAOSUMZrq32YFpjEpGq9+jvCqT5\nduk3L1zd9cb/fVD9P+om4M0VMZeGkK4TyfpGpauSTkPdS/f9XSd4H0UFThMN\ne+cq3G8XuZ7MXUExYTbUronp1mDs4JYhwS0VeT21yllgmVwnm0GqMTP458cs\nMCUDcRBZzevV9r/pjYUK+y4qGdVuRF1xKfUeMaGZSk50ZKR6w4o/QCHYSlY7\nM1XiwykwOXToODN9N6Hjxu7ldaCN8wLooejHgW8pybVUNpL9wnYUOuQ831Dt\nly77sQVApgXJdF1lpuR9WlguaI1r3BBnM/+7leWkyrjCG6jeWMvPTIaQev94\nI450\r\n=cfno\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEPMV2NGwyRlrJ+GF9UGXOgFGRt9Jr14aDXYsC4VqXhaAiEA1JLV9xBVI1o+745HRnrzaz8l6suk8TjCb8yR0zftvaM="}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.0.5-beta.12_1586014203820_0.1620874503506209"},"_hasShrinkwrap":false},"3.0.5-beta.14":{"name":"@mihanizm56/fetch-api","version":"3.0.5-beta.14","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"set CI=true && jest","test:coverage":"jest --coverage","compile":"tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint . --ext .ts --fix","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","pub":"npm publish --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","node-fetch":"2.6.0","typescript":"3.8.3"},"devDependencies":{"@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.0.3","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.2.1","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Sollution for http/1.1 isomorphic fetch\n\n### Benefits:\n\n- Provides validation for responses (based on @hapi/joi Schema validation)\n- Provides query-params serialize\n- Provides cancel-request if the timeout is higher than 60 seconds\n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error from `errorsMap`\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure\n- Works in browser and node environments\n\n#### RestRequest input options:\n\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body (you have to JSON or FormData it by youself)\n- mode('cors' | 'no-cors'): the cors type\n- parseType('json' | 'blob'): the type to parse the response (json by default)\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- errorsMap(object): the object with the errors keys and translated values (TIMEOUT_ERROR and REQUEST_DEFAULT_ERROR fields are required, others must be provided according to the backend errors)\n\n#### RestRequest output options:\n\n- error (boolean) - the flag of the response status\n- errorText (string) - the main error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional multiple errors from the backend\n\n#### JSONRPCRequest input options:\n\n- the same as RestRequest input options\n- id (string | number) - the request id\n\n#### JSONRPCRequest output options:\n\n- jsonrpc (string) - version of json-rpc\n- result (object | array) - the main data from the backend\n- error (object) - (non required, exists only if there is an error) the error object with message and code from the backend\n- id (string | number) - the request id\n\n## Examples of usage\n\n### REST API\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### get request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IRESTResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IRESTResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    errorsMap: {\n      TIMEOUT_ERROR: \"Превышено ожидание запроса\",\n      REQUEST_DEFAULT_ERROR: \"Системная ошибка\",\n      [FORBIDDEN]: \"Данное действие недоступно\"\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required()\n          })\n        )\n      })\n    })\n  });\n```\n\n#### post(put/patch/delete have the same format) request\n\n```javascript\nimport { RestRequest, IRESTResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IRESTResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    errorsMap: {\n      TIMEOUT_ERROR: \"Превышено ожидание запроса\",\n      REQUEST_DEFAULT_ERROR: \"Системная ошибка\",\n      [FORBIDDEN]: \"Данное действие недоступно\"\n    },\n    body: JSON.stringify(someData),\n    mode: \"cors\",\n    parseType: \"blob\",\n    queryParams: {\n      id: \"test_id_123\"\n    },\n    headers: {\n      \"Content-Type\": \"application/json\"\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\"))\n    })\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createReviseRequest(\n  someData\n);\n```\n\n### JSON-RPC API\n\n```javascript\nimport { JSONRPCRequest, IJSONRPCResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createItemsRequest = ({\n  someData,\n  requestId\n}): Promise<IJSONRPCResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint: \"http://localhost:3000\",\n    errorsMap: {\n      TIMEOUT_ERROR: \"Превышено ожидание запроса\",\n      REQUEST_DEFAULT_ERROR: \"Системная ошибка\"\n    },\n    body: JSON.stringify({ ...someData, id: requestId }),\n    mode: \"cors\",\n    queryParams: {\n      id: \"123\"\n    },\n    responseSchema: Joi.object({\n      items: Joi.array().items(\n        Joi.object({\n          id: Joi.string().required(),\n          name: Joi.string().required(),\n          name: Joi.string()\n        })\n      )\n    }),\n    id: requestId\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { jsonrpc, result, error, id } = await createItemsRequest({\n  someData,\n  requestId: \"1\"\n});\n```\n","readmeFilename":"README.md","gitHead":"f31580c34a2c99815eccefd07d76ca8ac612ffb4","_id":"@mihanizm56/fetch-api@3.0.5-beta.14","_nodeVersion":"12.13.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-L1arnWxqWk5TYhmtcEZosO/YHbzQL0PVjJJ/NAJTV/J7ZmEpi7mDkBDveJD9kiVsn/k67iUAJzQd0cN89E2l+Q==","shasum":"2ea58cd1b7454bbc85e5b0525dce3936d8a2074f","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.0.5-beta.14.tgz","fileCount":51,"unpackedSize":57952,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeiK+CCRA9TVsSAnZWagAANB0P/i6TLbXCvXdwgLFsDYES\nZd1MpUj1/14PwNRUgW7z7F5YiKuBqnivquVllKRunUrPrY3VgZa2LNFZ6QfX\nUmvisj4wOLC2ik4QghwQ5N+zXicNBOmPLsEmDMyE2YqLgHX9mbqyekB6Svje\nx0Yhzfnw4vMV4abg74azqi+GWpfCIehx41bRPnMrq38UsHu+N/zeKkg/xmWH\nF2IuI+j/QhQZsmOCJugd7xmQdLggU2tW/k4CxUgaSx1qNwnIT8ktaMGM8Oyh\nwmdSyAnpgIaV3u7Z3A4T7UtMLwoucjH02rVA3EN7JbvkD59sv7PJKSGGCwg9\nKFKpXOHxVAB4kJNjjwbs27uRab2g5h8O1m3Z3PUKB1NhLErQiTuWgWfdFMIV\nAov5BN3P3/AL0DDxU1NVtIjj6ao5Oy4IYfcP4wLNZTzsCJUJWLwSvZ91eBgL\n7HWaQradJV1rTDndmeJ7/vw4lLsYkTkJMthqDMxrhge+//ojW414VeTQSE1k\nu3ctHegLf0pId8x3R8NyOslZj6KP4Ko5omLzIUL4avphpbziM5K2EpKCDzo6\nA/YshCGHb+/N8UPbZgExmQS4uuX1l4YjDTJHOUfoyh+u86+QjaQPOc6zhjjL\nlp9/NZJ+qreCWP58LadgG1CvV8dxywa9Ss/I2jASzYCoR5xWtW01zUv2ziuj\n4uln\r\n=Hueo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGAp2zJsMPncYOKDO3Wfp0ofwdqz2xJiRD+O3ipVc5iZAiAdZ/YWxhb/2tswgN++EnVyOFwgWq4bbFrr0hHSQrKbQw=="}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.0.5-beta.14_1586016129782_0.6957496665268867"},"_hasShrinkwrap":false},"3.0.5-beta.15":{"name":"@mihanizm56/fetch-api","version":"3.0.5-beta.15","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"set CI=true && jest","test:coverage":"jest --coverage","compile":"tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint . --ext .ts --fix","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","pub":"npm publish --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","node-fetch":"2.6.0","typescript":"3.8.3"},"devDependencies":{"@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.0.3","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.2.1","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Sollution for http/1.1 isomorphic fetch\n\n### Benefits:\n\n- Provides validation for responses (based on @hapi/joi Schema validation)\n- Provides query-params serialize\n- Provides cancel-request if the timeout is higher than 60 seconds\n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error from `errorsMap`\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure\n- Works in browser and node environments\n\n#### RestRequest input options:\n\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body (you have to JSON or FormData it by youself)\n- mode('cors' | 'no-cors'): the cors type\n- parseType('json' | 'blob'): the type to parse the response (json by default)\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- errorsMap(object): the object with the errors keys and translated values (TIMEOUT_ERROR and REQUEST_DEFAULT_ERROR fields are required, others must be provided according to the backend errors)\n\n#### RestRequest output options:\n\n- error (boolean) - the flag of the response status\n- errorText (string) - the main error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional multiple errors from the backend\n\n#### JSONRPCRequest input options:\n\n- the same as RestRequest input options\n- id (string | number) - the request id\n\n#### JSONRPCRequest output options:\n\n- jsonrpc (string) - version of json-rpc\n- result (object | array) - the main data from the backend\n- error (object) - (non required, exists only if there is an error) the error object with message and code from the backend\n- id (string | number) - the request id\n\n## Examples of usage\n\n### REST API\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### get request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IRESTResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IRESTResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    errorsMap: {\n      TIMEOUT_ERROR: \"Превышено ожидание запроса\",\n      REQUEST_DEFAULT_ERROR: \"Системная ошибка\",\n      [FORBIDDEN]: \"Данное действие недоступно\"\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required()\n          })\n        )\n      })\n    })\n  });\n```\n\n#### post(put/patch/delete have the same format) request\n\n```javascript\nimport { RestRequest, IRESTResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IRESTResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    errorsMap: {\n      TIMEOUT_ERROR: \"Превышено ожидание запроса\",\n      REQUEST_DEFAULT_ERROR: \"Системная ошибка\",\n      [FORBIDDEN]: \"Данное действие недоступно\"\n    },\n    body: JSON.stringify(someData),\n    mode: \"cors\",\n    parseType: \"blob\",\n    queryParams: {\n      id: \"test_id_123\"\n    },\n    headers: {\n      \"Content-Type\": \"application/json\"\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\"))\n    })\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createReviseRequest(\n  someData\n);\n```\n\n### JSON-RPC API\n\n```javascript\nimport { JSONRPCRequest, IJSONRPCResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createItemsRequest = ({\n  someData,\n  requestId\n}): Promise<IJSONRPCResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint: \"http://localhost:3000\",\n    errorsMap: {\n      TIMEOUT_ERROR: \"Превышено ожидание запроса\",\n      REQUEST_DEFAULT_ERROR: \"Системная ошибка\"\n    },\n    body: JSON.stringify({ ...someData, id: requestId }),\n    mode: \"cors\",\n    queryParams: {\n      id: \"123\"\n    },\n    responseSchema: Joi.object({\n      items: Joi.array().items(\n        Joi.object({\n          id: Joi.string().required(),\n          name: Joi.string().required(),\n          name: Joi.string()\n        })\n      )\n    }),\n    id: requestId\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { jsonrpc, result, error, id } = await createItemsRequest({\n  someData,\n  requestId: \"1\"\n});\n```\n","readmeFilename":"README.md","gitHead":"2101384aab6197f4d57cfc6de2c2d976e9fd8f4a","_id":"@mihanizm56/fetch-api@3.0.5-beta.15","_nodeVersion":"12.13.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-/1rOiPEgjCLRO5rt+7YP3myfCbdtJ7o6kQ4KBBb+xryAHFt9+2cSX3Pjin3rFBbEs1WepVj4mVQj/VoaLQ8MxQ==","shasum":"95623dcf0fa8977ac221aea5ae5e3f6f2c73251a","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.0.5-beta.15.tgz","fileCount":59,"unpackedSize":63188,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeiN3vCRA9TVsSAnZWagAAA/oP/Ri6+/xnv7LIIM5gPFdh\nTmuQnYPjy8gNEZz+KN+5VavPOSLKKhVtPoYEu4isg2/YshQcnHOSOsiMuuLk\nP+FGeZAJKUwBI/3BJ/ZwLW3iRtgGG9YU1K9F0Fanmn/2VTA62d3wiyuPHOPH\nUR8dbnUSrHHcAbxBO2eWnFsxHiXo1B/iUtd3QtF9UgPtAmTYiBBsENK3uLg3\njupkK9spbPpuWUN1RzSEmbRVYGRKRWJ9H76w5N/pTlBKXp0mZLHzxTffycGZ\n0qwgoeJhVjruAPzSxGWclQIRX/FapmNon1jl4cyaLJIei5ifaFwet9ikJ06i\ndN42DmyS4Boiocf7zVFLrkLNKI+rTbWwD0N6DR9bVyqCSop6KtWv5D2OuzPw\n1Ff5/IAQ0jJig/EQ0QZFKnNrKUSKCBDy94VCWumxifuBTmQmTem+A9KSvv2u\nLWwHDLa8O9Z9NWhznMwW4HGUfdBgUDabh1ZD31382jLi0EsUR2yLfyA6hYrn\nJVSR+q2Z2YMN02Ii/SIRrCsiA4XfYsaDn8oe6U3YDw3x3BmDcm4vXa4Vfj/v\nTj+slG5e9GpUUeh7nJO2BCSlyMg2bAgYgFv0i0irrZxYVVHTL6OJpvGiC7Of\ng/E83NgZ8yqrEkatX2cVvXF1n5BZUx4HgGiEn/wPMxbEiA8XV78C0+9HcApT\nPD8m\r\n=P2+C\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBBf97ccYz4AixZN1yW3tkp5qwK11H77G3kj/Qa1nGATAiBSDPOv9wJAKk/LVUfcq6eMy2o3iFOx61DpTSVuuJK4rg=="}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.0.5-beta.15_1586028015006_0.2515083187902407"},"_hasShrinkwrap":false},"3.0.5-beta.16":{"name":"@mihanizm56/fetch-api","version":"3.0.5-beta.16","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"set CI=true && jest","test:coverage":"jest --coverage","compile":"tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint . --ext .ts --fix","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","pub":"npm publish --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","node-fetch":"2.6.0","typescript":"3.8.3"},"devDependencies":{"@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.0.3","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.2.1","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"gitHead":"a33bb5ab7c6e9f77dbb9dd1e66db665a93a0c2c1","_id":"@mihanizm56/fetch-api@3.0.5-beta.16","_nodeVersion":"12.13.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-9DllntnACB4ZkG5N4tW1993z3DIyC/1mBrnZxglnARsMGoZJHlsZTwmcCPiqlWEEog63GZrhGJ+bCLjpTb2/kw==","shasum":"5cb58db49bfc658098999b797a1e93d18256a900","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.0.5-beta.16.tgz","fileCount":59,"unpackedSize":63169,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeiPnQCRA9TVsSAnZWagAApaEP/RD8lzxrIkh47Rh1dFro\nhgIPmEAQODtfblxeZqoEkMaIp06y5UsRIk0C6YX23qsHryNeoZzWobKkEZg/\n/2akkkRk18soQ0y/52/A7LpGTWdyTg16cIWItOD1qjPzIwuOpTL7Elv4c4/y\nhUvlN35iskTOlYnZcV3bQH62qNcK6kfva+82PWJtduwiuCTJT04eSaDkYgOL\noTcfVVWjdrtelavyZMaZtQcA4jQfnwrs544fqK4xluqWiF/GCB1opiTnHeyk\n/pyUs1s6JCsU3dc/p/OwNc78gajC4DLxY0jpnbgornwDx6CQgpIzBWhB1T/7\nCfTgzpqbETU12t1M6AgmixWugNszUfbSGvuk2Vab6RSg7uIYlSZHERdthsut\n4BPIjhQgal3KFxgH3msduV4P6/p4dCdny+ZHu+Pi0XhAgrIAuq84tTi9tSOp\nnhz4qSpRO94uCJiacfwYRMTSq1c+yATKcoMxfdrYiO/GFaWR5IyHnYeTMhm2\n+pCkrd6/eWR5BwfRA0zbmiiHyUSmxnck2K5J/FnWr8UPIsOC2U+o8GANorwL\nVrO31W+rOyASibxgteNZzWIWmOlbornU7AvRIm/vOFFauQlsfYpAxUOrqmPC\npnVJzB+MxXa8Ogq29N32IpYYHjWsh4y2aKglc3Jv42yNbyBrGDKwlMdZ1XU2\nRpqe\r\n=xvC7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFquJtYaaL9oW05Oep50GYgVGp2LykvlBIoV0ipVJVWiAiEAwgv3Bcz/r+xKDs77r93K8kQ3ymEZiWhfirW5I9hQwA0="}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.0.5-beta.16_1586035152054_0.45002755818289786"},"_hasShrinkwrap":false},"3.0.5-beta.17":{"name":"@mihanizm56/fetch-api","version":"3.0.5-beta.17","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"set CI=true && jest","test:coverage":"jest --coverage","compile":"tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint . --ext .ts --fix","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","pub":"npm publish --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","node-fetch":"2.6.0","typescript":"3.8.3"},"devDependencies":{"@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.0.3","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.2.1","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Sollution for http/1.1 isomorphic fetch\n\n### Benefits:\n\n- Provides validation for responses (based on @hapi/joi Schema validation)\n- Provides query-params serialize\n- Provides cancel-request if the timeout is higher than 60 seconds\n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error from `errorsMap`\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure\n- Works in browser and node environments\n\n#### RestRequest input options:\n\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body (you have to JSON or FormData it by youself)\n- mode('cors' | 'no-cors'): the cors type\n- parseType('json' | 'blob'): the type to parse the response (json by default)\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- errorsMap(object): the object with the errors keys and translated values (TIMEOUT_ERROR and REQUEST_DEFAULT_ERROR fields are required, others must be provided according to the backend errors)\n\n#### RestRequest output options:\n\n- error (boolean) - the flag of the response status\n- errorText (string) - the main error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional multiple errors from the backend\n\n#### JSONRPCRequest input options:\n\n- the same as RestRequest input options\n- id (string | number) - the request id\n\n#### JSONRPCRequest output options:\n\n- jsonrpc (string) - version of json-rpc\n- result (object | array) - the main data from the backend\n- error (object) - (non required, exists only if there is an error) the error object with message and code from the backend\n- id (string | number) - the request id\n\n## Examples of usage\n\n### REST API\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### get request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IRESTResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IRESTResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    errorsMap: {\n      TIMEOUT_ERROR: \"Превышено ожидание запроса\",\n      REQUEST_DEFAULT_ERROR: \"Системная ошибка\",\n      [FORBIDDEN]: \"Данное действие недоступно\"\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required()\n          })\n        )\n      })\n    })\n  });\n```\n\n#### post(put/patch/delete have the same format) request\n\n```javascript\nimport { RestRequest, IRESTResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IRESTResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    errorsMap: {\n      TIMEOUT_ERROR: \"Превышено ожидание запроса\",\n      REQUEST_DEFAULT_ERROR: \"Системная ошибка\",\n      [FORBIDDEN]: \"Данное действие недоступно\"\n    },\n    body: JSON.stringify(someData),\n    mode: \"cors\",\n    parseType: \"blob\",\n    queryParams: {\n      id: \"test_id_123\"\n    },\n    headers: {\n      \"Content-Type\": \"application/json\"\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\"))\n    })\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createReviseRequest(\n  someData\n);\n```\n\n### JSON-RPC API\n\n```javascript\nimport { JSONRPCRequest, IJSONRPCResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createItemsRequest = ({\n  someData,\n  requestId\n}): Promise<IJSONRPCResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint: \"http://localhost:3000\",\n    errorsMap: {\n      TIMEOUT_ERROR: \"Превышено ожидание запроса\",\n      REQUEST_DEFAULT_ERROR: \"Системная ошибка\"\n    },\n    body: JSON.stringify({ ...someData, id: requestId }),\n    mode: \"cors\",\n    queryParams: {\n      id: \"123\"\n    },\n    responseSchema: Joi.object({\n      items: Joi.array().items(\n        Joi.object({\n          id: Joi.string().required(),\n          name: Joi.string().required(),\n          name: Joi.string()\n        })\n      )\n    }),\n    id: requestId\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { jsonrpc, result, error, id } = await createItemsRequest({\n  someData,\n  requestId: \"1\"\n});\n```\n","readmeFilename":"README.md","gitHead":"a11e84744a795d5dcc2918e161ce28a89e4b4833","_id":"@mihanizm56/fetch-api@3.0.5-beta.17","_nodeVersion":"12.13.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-I68+W7OzkhJE+a3zag4eU6dWwPl4MPq0N4u9xKX1xU0MewgcjOBDICESnr9r8a8Oac974NAFZat7ubXGsKM4sw==","shasum":"a0079d382c4eb4db2c3b2fa3e2cd06baa8ffc791","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.0.5-beta.17.tgz","fileCount":59,"unpackedSize":63169,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeiP1xCRA9TVsSAnZWagAAA8EP/RlADFswXCmC3mNvuUZA\n1uK0ybSM10nxTKTJ7/7JDRHyv7Y/X3eSphFaB56mY0Mg1Zwy0KKIe98Yr0sd\n+hQFirJS25poZA067ha4ptG2ZOgPk3QlS6K6HCR9NPUHjGzjSgdqDUvV6D+Y\nKpgZcmMBHYcqPqpLOsSIT82Q6KKu7IzY3+Nth/JK3JQz3osS9VI0BRVtWcjg\nuSzH8JpGXTKhLPqyfEvr19Hewvn82JR0zGy00wDmQdffD/hi/Q530VsoM7ZH\n4nxwHs7ANml+/E1ZTtEkYU+uBAxEDE+UOo7UTuMYBlEZyUp9LclQcVRfprUw\nEHj5zBmoiuBn5h62cik1g/eQW9mK/Sy7wh6W13fahhyvNIRpCfKCSh6vVFNQ\nRRcjB3tHtvwKpLefS8FXeNjvYbRJqI0kFVAq5bQnQLDuGPZ/YeML/2u+ngNX\ndeQ8O5Oygnt3BRM/28YgFt3zpwMmlKGx2exT2e2uuLRytK/eFmCTT5f+/cVh\nP/feeDcmF9EV+nz0VZwuMrV8HQ6g0f7oKKJGvu67apAWXghIJdmgb4ilb6Vz\nMFskIp7AyeXWsx4/jk/KbDyGYcOUUEtZNXtIlw64ywgDVBbwLc1Kd9XSGD6R\nBnPW89ieptWgp4proQcNU0SBqCVU4RPLehd+ILdOYNdd0ChsxP2sg0RhS4CD\ncDzy\r\n=a97B\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBTdjgU5oEIyBPNNEw3lXHIMrQbEMPYWcot+bgjivEi0AiEA4/DPMGCvYPAKYoj4jfQ/awSLm8PmO2cnVTvIQ/g+8Mw="}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.0.5-beta.17_1586036081480_0.6652860921615478"},"_hasShrinkwrap":false},"3.1.0":{"name":"@mihanizm56/fetch-api","version":"3.1.0","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"set CI=true && jest","test:coverage":"jest --coverage","compile":"tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint . --ext .ts --fix","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","pub":"npm publish --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","node-fetch":"2.6.0","typescript":"3.8.3"},"devDependencies":{"@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.0.3","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.2.1","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"gitHead":"95b4c06c34a28af629ac5a0102059b5b99703a0d","_id":"@mihanizm56/fetch-api@3.1.0","_nodeVersion":"12.13.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-paDD1InPda8Vpx44GFl78wMhBvjCzKF6A7HZaHWfiNq348CsDKBQuSJ5/cWpWOarPSrVdlCsVj9Q9XRt+aaUnA==","shasum":"e6672c9f69246490912c9b31eb10208b375c2044","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.1.0.tgz","fileCount":59,"unpackedSize":62723,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeiQePCRA9TVsSAnZWagAA6/wP/RpErTZ6eQg/5vFlwvwY\nZjvvZmUjy0e6fZJGNCEnE+4L/lBc8HmtMwPevC+H3jIQdOStkw204DxxQzhg\nAPp+UsPV6ioy9v9yOj+FnuBfzQBrU+fYUh6PnST/RCV0iqHJ1GJ3Fx7u9ztB\nYL2oXpSicTcRnF7Jhx/YpCU6C6VlOIvjTUwl6KUSH5IuHVfZGuk6kFukNvB9\n2ufPo3/D8ZEc2v17HW/BQOJf+RIoB8AkFy+hjzxLHMlZjSytVvdiDP8qAwqf\n1L7lyoVuEn1mh+tAcW8I4/H9sMv2b9xv/p4IotMD1fA1q0PKi+pf9ff5D1XZ\njjnzjRSd3OXkJg7goBin9MQVCvPoVn1dZWNiuuLgB/2Vmh8v77krETJKzCmL\npBqUxtbTIFf9k3qAD2sb1GJVRjmJNxJdTweuWteDkaVGWgDbf5hzfyCDocNm\n0QxLpTzIjVLYeR+nIr568/+JsymXDfRmhXAzg+jzw/DHKKfXOv08BmTz+2qB\nT+tpC+S8hOEECeBa3d80NoZ/a8LoF/jZmv11UizDPI636DEB0gUsKxMbf4Jn\nXvnOMRNQwU805b5PlczsuXzfjx2xWFVNU71EN/rBFASdOB1caurUNcogz0rv\nalCuQVzr+YFvR6UF2T5bPlgoiaiVBzZi4bkle2vaAXUu39KhoxRGK8gTWthe\nh4xp\r\n=sQGK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC74ypHHQIySdlptpEPqfPq/ilBMegdD0na8kEVIzlZfwIhAOHwRj228mCoitakjr4aNNmAnJXzTTYpxwJ0cfgp8kTN"}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.1.0_1586038670998_0.7912956141920362"},"_hasShrinkwrap":false},"3.0.5-beta.18":{"name":"@mihanizm56/fetch-api","version":"3.0.5-beta.18","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"set CI=true && jest","test:coverage":"jest --coverage","compile":"tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint . --ext .ts --fix","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","pub":"npm publish --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","node-fetch":"2.6.0"},"devDependencies":{"typescript":"3.8.3","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.0.3","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.2.1","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Sollution for http/1.1 isomorphic fetch\n\n### Benefits:\n\n- Provides validation for responses (based on @hapi/joi Schema validation)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize\n- Provides cancel-request if the timeout is higher than 60 seconds\n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error from errorsMap parameter\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure\n- Works in browser and node environments\n\n#### RestRequest input options:\n\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- parseType('json' | 'blob'): the type to parse the response (json by default)\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- errorsMap(object): the object with the errors keys and translated values (TIMEOUT_ERROR and REQUEST_DEFAULT_ERROR fields are required, others must be provided according to the backend errors)\n\n#### RestRequest output options:\n\n- error (boolean) - the flag of the response status\n- errorText (string) - the main error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional multiple errors from the backend\n\n## Examples of usage\n\n### REST API\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### get request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    errorsMap: {\n      TIMEOUT_ERROR: \"Превышено ожидание запроса\",\n      REQUEST_DEFAULT_ERROR: \"Системная ошибка\",\n      [FORBIDDEN]: \"Данное действие недоступно\"\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required()\n          })\n        )\n      })\n    })\n  });\n```\n\n#### post(put/patch/delete have the same format) request\n\n```javascript\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    errorsMap: {\n      TIMEOUT_ERROR: \"Превышено ожидание запроса\",\n      REQUEST_DEFAULT_ERROR: \"Системная ошибка\",\n      [FORBIDDEN]: \"Данное действие недоступно\"\n    },\n    body: JSON.stringify(someData),\n    mode: \"cors\",\n    parseType: \"blob\",\n    queryParams: {\n      id: \"test_id_123\"\n    },\n    headers: {\n      \"Content-Type\": \"application/json\"\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\"))\n    })\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createReviseRequest(\n  someData\n);\n```\n\n### JSON-RPC API\n\n```javascript\nimport { JSONRPCRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createItemsRequest = (someData): Promise<IResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint: \"http://localhost:3000\",\n    errorsMap: {\n      TIMEOUT_ERROR: \"Превышено ожидание запроса\",\n      REQUEST_DEFAULT_ERROR: \"Системная ошибка\"\n    },\n    body: {\n      method: 'some method',\n      params: 123\n    }\n    mode: \"cors\",\n    queryParams: {\n      id: \"123\"\n    },\n    responseSchema: Joi.object({\n      items: Joi.array().items(\n        Joi.object({\n          id: Joi.string().required(),\n          name: Joi.string().required(),\n          name: Joi.string()\n        })\n      )\n    }),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(someData);\n```\n","readmeFilename":"README.md","gitHead":"539d4e09301b128b53e1601ebba4d3a20fb03fed","_id":"@mihanizm56/fetch-api@3.0.5-beta.18","_nodeVersion":"12.13.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-WHi49fc6VJvZ30ADljvPocJzRit6/Qz9CXa3m9Wofcyi+RKBViwMgh5hXa1QMaVIgb8RzZGPzVjxdm+SNbv3dQ==","shasum":"aafc6d4bdd2428cc96adcc51ad1799f6fc0d3263","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.0.5-beta.18.tgz","fileCount":59,"unpackedSize":62731,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeiQifCRA9TVsSAnZWagAAElQP/ic/PVElUTCoKxTO2EUL\nDBJdxnml8WNA8yjZlyM8NlDJqbxsmydPywECFWf4QVE8og4LKbqT04KVF/c4\nSv0w6K8sL95u43ZEgo9WomgZtFbf4l4BfxrpX+4p49EuTf7+Lya5qPafmct+\nLRZ8+i5eGwj1XBkbdkOQ9vECl0/tJxk4VFlmttuhw9TUFoXCqgZqLWW/pU6A\nh3CNZziOqCj2Y2/0iFLp0aWBGE0uTTdD4JTM8isiimpA25DVd7pQHupLVscz\nCgttYYKIXO/q2vfQ6uwKuAOwPVJihAcqbj4oNu4za86ct7MHEDr/eAXlydfC\nn1lft+ZWgpZJcOPA8cDiPmR5SfiHi5Eq7T1+mB2/bgASOUO2DeOrHVznJGMq\nt8iQldyHwaBM2PNiu1A6TFygjRKYB22CsEk+gR1fyjLsJHM7mthr9uj0sgEP\nUmWUlAW5CwdQDCrsvpwjeO7yX2/3aAdHSXxquzScRL7YHTd+3jvSbZBjNUFZ\nJDBf6bgbEknuJEefCw8yoqJ59pSuyOg5nuaCNb8m6MPrNpz038V8U67iglLq\nvG28ZMCCVyRJsJVjadm0g2sCiE2tTXhImBSxQ/6AQIPytgyLAbLpNS5KQF6r\nxRcznwyuH9ACDY6JO9r9WQH0g97fG8zDdAhGO7/tnb2JmhFrPhNi/J4wc10a\nWvSs\r\n=SDVP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFmjJOKgSvm5fOOWzqY9i+9MeqbUjxej90siyxTYKTtgAiBgcwZBD/SUG/aGbQDXyGiasVf7yV/FWEIOQxA3AHe6Fw=="}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.0.5-beta.18_1586038943233_0.13449677868265386"},"_hasShrinkwrap":false},"3.1.1":{"name":"@mihanizm56/fetch-api","version":"3.1.1","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"set CI=true && jest","test:coverage":"jest --coverage","compile":"tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint . --ext .ts --fix","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","pub":"npm publish --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","node-fetch":"2.6.0"},"devDependencies":{"typescript":"3.8.3","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.0.3","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.2.1","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"gitHead":"12cbd000b5c33573e7aed6266e326aa876ef3cb1","_id":"@mihanizm56/fetch-api@3.1.1","_nodeVersion":"12.13.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-okquGZnMnBNpaChp8fv4i6XYo/p3mWPa9KO3SUox99N82XKYop7q8m1bsCtuxirLV9j8EqUuDKG9QXncv29QEw==","shasum":"6b8e9d470bcc623010d1d8379ad61c717d9651cb","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.1.1.tgz","fileCount":59,"unpackedSize":62723,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeiQm8CRA9TVsSAnZWagAAwyQP/22c3/rQRD1P+QZkApCT\nyzSkKvk0QBtX/+wUbhxHS1y13oPuromRoPGwzwV4Gfw72epgkeVmCf7BFYOK\n9GZB06MFFzh+ONywhyHA6etfOsNJzDE0IBpRfb9z3caDCAIySiyUTUkrLzWZ\n3WvTzUHwN+RDVp3xPhzja2JAno/By4Mac0FVcrZFvEEzYPT+v94yHXAXYPDS\nZfFWFIo4gqB1G+PAhw1x/JK2qKOBq3dKAvhxk6Wtu/1VRSQtK3o/04TD3RKR\n1+eXL9Uyoho7+sT08sk/WIaOChM+0Jj+ZniURyHDvTkHmPYwCJEEUDmuUBdD\n6vmN59DaJmuuLfTsygBMBeiLhCOMWPpTVLZCgo1q/H0BzcaObnj3xwVM8DvI\nyCRgwo8VXC7bEWvj4r9Bl8oL/lg461KIijNGut5FHSIO14ksxuW7WtAIsww4\n050/vQkvUbET6S/zqCJeiIgSMp/VxNOr3/9y8JZYpPB1mxpIgXKtiXZEn3JW\nfEXkra1OwJbEuvVvwd85hLzcqhE7tuCRJcMNojpoOUbPWN9R5lcGMQJuuwa4\nnsdB/tvBnyoGSqtsQP/9slyLWPt727uCVdbFYzwGq30S/rMHjyEME5smnPoB\nUe+39MzjUZ9Y0g/E1bA8RXXXMHvG1J9/0EaN/A0Y0x9+MSM0jWnw4Ysah+MV\ng5SL\r\n=JLPN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHLpWy8Pb1X817TLhLF2YGIwLgIFbOcXUbn35D1op0ZAAiEA/zonYTSqsX2Yo1vE0y8eva+G7qDvVVCMowCFPHOkJow="}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.1.1_1586039227506_0.6134280220196182"},"_hasShrinkwrap":false},"3.1.2":{"name":"@mihanizm56/fetch-api","version":"3.1.2","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"set CI=true && jest","test:coverage":"jest --coverage","compile":"tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint . --ext .ts --fix","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","pub":"npm publish --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","node-fetch":"2.6.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.5"},"devDependencies":{"typescript":"3.8.3","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.0.3","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.2.1","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"gitHead":"074188278526721dbd2e8923ce0e60810d8879bc","_id":"@mihanizm56/fetch-api@3.1.2","_nodeVersion":"12.13.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-BE9NfPTXNrKIQPlwt45DBH+I33cdJCKTCdRqxWxWRmRbWj9JBRZXXow33dps4lQKNl4YeDqLf36gmFSFiRnxzA==","shasum":"e07ed70951803b4a84a6adfc17cb9d3263002b0a","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.1.2.tgz","fileCount":59,"unpackedSize":62785,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeiQ0PCRA9TVsSAnZWagAAn54P/iqYMmOb2YwTfJhpCBrm\nVI6DyYRepNzYXRtlZvV+Q8TmnRqiwAgYvrgIdrsoEzHhOSz52W3FbXTfPV6Z\nosdZQOQRLrrk6aOBm22t0qY9gvGaRzElmT2mtZ9otg2DSv4Z2tR99+rbNBQi\nnQipSrp+lFHEtYK2L0QxTelKTzdIm7zh89Ot68ZWtCj3xnGGGZKrS4W5mySP\nI3nElDeXpbZoBtFors0BtVkPfVq0AZjeKY7TC43hGXce+PEajBNBcRupUZ0g\nUk1yXrpkZ5NcDmj7DFYEn0w6DvK9y3LKBJEw8xLJOk0waV2aXjyck8RPWjkQ\nFyjNuNIhUqJTiVoef7DZFZKpVvIgF1fSAlHmD40WM3mrcvEfwlAlEsU2AKS3\nlor5J5IdH2zl5+j9cSe8V54oyaRTe+I9hXPBodH2Ctsqri5UuREdEigDjs8n\nJ9BWwZyuxUELmZEtNToJoUtjaoErVxD3aWpEpwetj+ziN2ZE9tBvohd3k/RH\nlh5uQMVS+nNxzbnti/jwCxWQghixwBciK0fAVENqjAnkIEAett2eUp6nWaqV\nUzFa8W/EV6qvMRtKbsebiWwN81DnqS+LaeC7PmH1chyOlCDZmrp+TGgkwF2f\nL7h/AcffMNBRDztQp8lxzRY016+19G/sn9ZEikFb76ou+wujYHe7IrzIaphR\nyQcr\r\n=Ak2m\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDUBtDcCCDlpRcEYuruPHJC4TXQovJDUXblMVLFD+ugRwIgAYkz5XaLSnGJxH8FxGBnBU5/d3JfwAYhgMEtIePiHc4="}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.1.2_1586040079436_0.7290126807207313"},"_hasShrinkwrap":false},"3.1.4":{"name":"@mihanizm56/fetch-api","version":"3.1.4","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"set CI=true && jest","test:coverage":"jest --coverage","compile":"tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint . --ext .ts --fix","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","pub":"npm publish --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","node-fetch":"2.6.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.5"},"devDependencies":{"typescript":"3.8.3","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.0.3","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.2.1","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"gitHead":"ca47f37190609134331a410c1245951cfadf401c","_id":"@mihanizm56/fetch-api@3.1.4","_nodeVersion":"12.13.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-IRWQBxu2tRvcrotSEA0j1LcLhx/2S1nWN21M1AIqlVvrq95dKpvpMAKYFOK0+f4uSwqAGWZK0pP2jnPG8LD2Fg==","shasum":"ab3b4badd40c44bcbad8e678506246c3bf5ab0a7","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.1.4.tgz","fileCount":59,"unpackedSize":62854,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJei6x3CRA9TVsSAnZWagAAKHcP/ihRXUuQlguhy+cTMt3G\nGEEirvLkUVnMq9SA/bv5G4uANp8+seeXtSzWRyzWGYL+sh+bi3C7tHpf4bA5\naCBIGLMegX4HrjOzfMXzQMOGvSeAqG9nJLokPZOTkF4Mm2DSVGlMNylkQkcn\nc5ueCUzQUaKhDDx9JfMGeJYSdv4miaq6EHDrLRlG/VcPHDUqw3iyV6n7q2+i\n8jaQQq0EQKBGI5osmW3VVqZts9bClpEgTsC0QQalm/79g/iJduMfX7rue1QQ\nFTlxGFb9VAHJU6edcKL/+i2y3nEeYV7gIK3xbUcqCFLRQ37xRcV87Ma0hMU1\n+C0BPcDeWckRS1hg0b47CMh6IB9AcpS2Pbg93/tAR88c2tigoErmBibwu57V\nbeAQ4Hoe5dTRp2hiZppvj2u7G2NJeYwsn2LotGBSa7OIZWEq5lTMaxLB1FTp\naJw6Hlcclo8S1nK8iF2UZFtqSf7mRPMJMgDhAJDrH5aHBAFRaijtGCUvYnQ1\nlA00+99YEENQ2qRLurgPgDW3ki5zB18mXblXmayHI4UbcV/VFITVHeWriwQh\nj3tgUjmvmy26fesUotEk930Hx2INDdw97c8AIU/a+5tR3ECDg4nUS66AhWdD\nEL1tPC7PBwv2G1RnPP6O6haIjzpX7Nh3wyCB2xBXsfNqazZt9fFJHnLeTQ1Y\n+qtR\r\n=xatn\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCBXOvQfSqOCFyU6wExkuaAbWZC9OIz0gI/iwh0FX1RWQIhAIZH8+NbbpvWh7jLmnuLdzJ0VyDNB6nJiSGImWTKHqs/"}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.1.4_1586211958496_0.7245985010713321"},"_hasShrinkwrap":false},"3.2.0-beta.0":{"name":"@mihanizm56/fetch-api","version":"3.2.0-beta.0","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"set CI=true && jest","test:coverage":"jest --coverage","compile":"tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint . --ext .ts --fix","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","pub":"npm publish --access=public","beta":"npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","node-fetch":"2.6.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.5"},"devDependencies":{"typescript":"3.8.3","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.0.3","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.2.1","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Sollution for http/1.1 isomorphic fetch\n\n### Benefits:\n\n- Provides validation for responses (based on @hapi/joi Schema validation)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize\n- Provides cancel-request if the timeout is higher than 60 seconds\n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error from errorsMap parameter\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure\n- Works in browser and node environments\n\n#### RestRequest input options:\n\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- parseType('json' | 'blob'): the type to parse the response (json by default)\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- errorsMap(object): the object with the errors keys and translated values (TIMEOUT_ERROR and REQUEST_DEFAULT_ERROR fields are required, others must be provided according to the backend errors)\n\n#### RestRequest output options:\n\n- error (boolean) - the flag of the response status\n- errorText (string) - the main error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional multiple errors from the backend\n\n## Examples of usage\n\n### REST API\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### get request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    errorsMap: {\n      TIMEOUT_ERROR: \"Превышено ожидание запроса\",\n      REQUEST_DEFAULT_ERROR: \"Системная ошибка\",\n      [FORBIDDEN]: \"Данное действие недоступно\"\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required()\n          })\n        )\n      })\n    })\n  });\n```\n\n#### post(put/patch/delete have the same format) request\n\n```javascript\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    errorsMap: {\n      TIMEOUT_ERROR: \"Превышено ожидание запроса\",\n      REQUEST_DEFAULT_ERROR: \"Системная ошибка\",\n      [FORBIDDEN]: \"Данное действие недоступно\"\n    },\n    body: JSON.stringify(someData),\n    mode: \"cors\",\n    parseType: \"blob\",\n    queryParams: {\n      id: \"test_id_123\"\n    },\n    headers: {\n      \"Content-Type\": \"application/json\"\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\"))\n    })\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createReviseRequest(\n  someData\n);\n```\n\n### JSON-RPC API\n\n```javascript\nimport { JSONRPCRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createItemsRequest = (someData): Promise<IResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint: \"http://localhost:3000\",\n    errorsMap: {\n      TIMEOUT_ERROR: \"Превышено ожидание запроса\",\n      REQUEST_DEFAULT_ERROR: \"Системная ошибка\"\n    },\n    body: {\n      method: 'some method',\n      params: 123\n    }\n    mode: \"cors\",\n    queryParams: {\n      id: \"123\"\n    },\n    responseSchema: Joi.object({\n      items: Joi.array().items(\n        Joi.object({\n          id: Joi.string().required(),\n          name: Joi.string().required(),\n          name: Joi.string()\n        })\n      )\n    }),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(someData);\n```\n","readmeFilename":"README.md","gitHead":"d47a975b15e5205ce40c121fbdcfc64205d0b3b3","_id":"@mihanizm56/fetch-api@3.2.0-beta.0","_nodeVersion":"12.13.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-jW3QWWltblEM8Ld+6AuecL6jB9IP2xveT29B0ayU3TK0McmjumEkAqWmRGIBU+6qTlEYZgBzoBkguAzXGN1SlQ==","shasum":"b456ef2630b175f5f6bc56ea59f1adc6d409fe24","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.2.0-beta.0.tgz","fileCount":69,"unpackedSize":73449,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJekO8MCRA9TVsSAnZWagAAQYgP/js1JCxra7CDKdrLSwXr\nUIEOQT4FUlUke010p+O0/tpfjBLdTv2YDco+dFHDfjFbxubgHk/CvAsRXjRG\nXHcOW/vUhj5o8OWtEOqBjPnWrFkE09VsVX0dcbxHY+wbaX2AUCmnaVQUAquF\nO2DEFIiEa7tXFFCj+aNpAbHSnr2T6YuVv4o3VqEia6gcDZwbgVo4DDFmUJYA\n4gUI5aB3/Co8ggB0r/dMIDsxgRWy78IWw3VlGmuhJy9M/eEWhWcumNMxoKti\njrGxdujKUIb+giCUjYTp/dMSXAHjCao7ADCfXrTcmxHKPPd6/8y4YMm8nAnY\n/fN900tvO5Vd5TGrEQ3WUETeIHLa7qG78KHb8w43YvsJh7YQYrneBcGineRq\nvmKIRw9/4blakSYjhkDyL5e9tzPSK2xwMmPEou7xl4vxt1Mop1W8mZE+bD97\ntoMd8kxFZ+1nTHZyr/EBxG8Tfaf2lBFSvTrsNY9CASvJAbyyBi4nGxJB+wop\nkIgqoBaB9pdQxqo88IHBS36A9jHGahN+5UQSEzXoMcay5rvz7jgC5/d1MtGc\npgA5+5TK1ypW5KWcWiWOsTBeGCGS1CWKz3WZlIwiGDoGaL89OqPSBVs8uhJd\nsyUfvRPcglC8RN4gLuwr+nqqilC9OIAsBeoplBRFVHC6nk/JQdtMTO74nXXX\nj3rI\r\n=tOXl\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDBf619al9HnMBcz2nKYK4H3olYFSe+7hi4F/WPq+k0KAIgX/eBxAsVowZjQqaRJAu0s/Dyy8FZespTijHI73UQq7E="}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.2.0-beta.0_1586556683806_0.5918150838907572"},"_hasShrinkwrap":false},"3.2.0-beta.1":{"name":"@mihanizm56/fetch-api","version":"3.2.0-beta.1","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"set CI=true && jest","test:coverage":"jest --coverage","compile":"tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint . --ext .ts --fix","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","pub":"npm publish --access=public","beta":"npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","node-fetch":"2.6.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.5"},"devDependencies":{"typescript":"3.8.3","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.0.3","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.2.1","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Sollution for http/1.1 isomorphic fetch\n\n### Benefits:\n\n- Provides validation for responses (based on @hapi/joi Schema validation)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize\n- Provides cancel-request if the timeout is higher than 60 seconds\n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error from errorsMap parameter\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure\n- Works in browser and node environments\n\n#### RestRequest input options:\n\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- parseType('json' | 'blob'): the type to parse the response (json by default)\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- errorsMap(object): the object with the errors keys and translated values (TIMEOUT_ERROR and REQUEST_DEFAULT_ERROR fields are required, others must be provided according to the backend errors)\n\n#### RestRequest output options:\n\n- error (boolean) - the flag of the response status\n- errorText (string) - the main error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional multiple errors from the backend\n\n## Examples of usage\n\n### REST API\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### get request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    errorsMap: {\n      TIMEOUT_ERROR: \"Превышено ожидание запроса\",\n      REQUEST_DEFAULT_ERROR: \"Системная ошибка\",\n      [FORBIDDEN]: \"Данное действие недоступно\"\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required()\n          })\n        )\n      })\n    })\n  });\n```\n\n#### post(put/patch/delete have the same format) request\n\n```javascript\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    errorsMap: {\n      TIMEOUT_ERROR: \"Превышено ожидание запроса\",\n      REQUEST_DEFAULT_ERROR: \"Системная ошибка\",\n      [FORBIDDEN]: \"Данное действие недоступно\"\n    },\n    body: JSON.stringify(someData),\n    mode: \"cors\",\n    parseType: \"blob\",\n    queryParams: {\n      id: \"test_id_123\"\n    },\n    headers: {\n      \"Content-Type\": \"application/json\"\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\"))\n    })\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createReviseRequest(\n  someData\n);\n```\n\n### JSON-RPC API\n\n```javascript\nimport { JSONRPCRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createItemsRequest = (someData): Promise<IResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint: \"http://localhost:3000\",\n    errorsMap: {\n      TIMEOUT_ERROR: \"Превышено ожидание запроса\",\n      REQUEST_DEFAULT_ERROR: \"Системная ошибка\"\n    },\n    body: {\n      method: 'some method',\n      params: 123\n    }\n    mode: \"cors\",\n    queryParams: {\n      id: \"123\"\n    },\n    responseSchema: Joi.object({\n      items: Joi.array().items(\n        Joi.object({\n          id: Joi.string().required(),\n          name: Joi.string().required(),\n          name: Joi.string()\n        })\n      )\n    }),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(someData);\n```\n","readmeFilename":"README.md","gitHead":"2bfb2b14ce4ee4023cfc19c55dc2516b3ed0e09b","_id":"@mihanizm56/fetch-api@3.2.0-beta.1","_nodeVersion":"12.13.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-9wXKbRdtdAGITZ8NnJM2RexqK3zrmpigqHy7AgSiFgpUaMG5EpT9ByzTOnvDAAJpmdAB4JfZH4HMo1fHHVXo2Q==","shasum":"8a41ec1155a7e96aa639e1b70ea1b3010c883b04","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.2.0-beta.1.tgz","fileCount":69,"unpackedSize":73359,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJekRC1CRA9TVsSAnZWagAAdTQP/j5v12YmFYEcl9yhMqo2\ne0VPl6Kvr2aH9COmrMITQA6qpD/YMVxeEpb/sDDfnmnQtfw/zdg1aO4UoC0P\nyb+BqJzc3/409yBQzwcl0COnoLmHD5buB1WTTJErjMcdcFM3Fv9cSdy5zli3\n3eSGvH8PLJlWlwdWccs0ZFnUeidX7e7lx6ZOH4uguYYxoeDsscdXV4dxABv3\nEl2WKso23AuBAe0hvGobw/e2fH0gkE1BQCA0ZdPs1iilaImf8+3Tb/OwwWkb\nnTEcgwlLAYg5Dxl7LZ75juCxB5WY6//O9B0+fq90w1ZVNswjZDfDbOjD+dqG\npgh/Oz66Mdxr8D8GXaZoHwnwFOZNFXL6hbp7Qr0whD+qiTe4zodRxrY7RQLl\nx1+FhIPWtcYm0wXd1Rrf9eCq2kG+oUqxLvfyWh27wmN54DB2PyNj9EImIhkl\n/AJVqpBM9TlPsXBtTq5AwPRnKm67TXrI7I5jW6Qm6S5mA4Qw/0L/DXDRg4uA\n4464Mm33oKpLqV6RtjLakmdQRpkFyFLO0SnT+bK1IInOhQqTKX+itWyoN5k8\naZk/Zq4jOfh/+9FFh0ZKhcso3Td+UtA4y5Zv98YrmTRG7eSrBQ/wslhfYSkC\nfdcaMsHpNQh7bTb5MesSRmNYI2AjacJI1+bc7vRoo651QbhGGJNtXpHsUtU5\nxNP/\r\n=KP6a\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAOLwRnJh7vE6zbxyblwWzL4gJENRM7pzjNynFh3p/MAAiAtxTOib/ywjQxvKRlBgqSI4QYd7tysfQaEag23/BjfqQ=="}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.2.0-beta.1_1586565301417_0.6080293417626361"},"_hasShrinkwrap":false},"3.2.0-beta.2":{"name":"@mihanizm56/fetch-api","version":"3.2.0-beta.2","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"set CI=true && jest","test:coverage":"jest --coverage","compile":"tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint . --ext .ts --fix","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","pub":"npm publish --access=public","beta":"npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","node-fetch":"2.6.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.5"},"devDependencies":{"typescript":"3.8.3","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.0.3","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.2.1","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Sollution for http/1.1 isomorphic fetch\n\n### Benefits:\n\n- Provides validation for responses (based on @hapi/joi Schema validation)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize\n- Provides cancel-request if the timeout is higher than 60 seconds\n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error from errorsMap parameter\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure\n- Works in browser and node environments\n\n#### RestRequest input options:\n\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- parseType('json' | 'blob'): the type to parse the response (json by default)\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- errorsMap(object): the object with the errors keys and translated values (TIMEOUT_ERROR and REQUEST_DEFAULT_ERROR fields are required, others must be provided according to the backend errors)\n\n#### RestRequest output options:\n\n- error (boolean) - the flag of the response status\n- errorText (string) - the main error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional multiple errors from the backend\n\n## Examples of usage\n\n### REST API\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### get request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    errorsMap: {\n      TIMEOUT_ERROR: \"Превышено ожидание запроса\",\n      REQUEST_DEFAULT_ERROR: \"Системная ошибка\",\n      [FORBIDDEN]: \"Данное действие недоступно\"\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required()\n          })\n        )\n      })\n    })\n  });\n```\n\n#### post(put/patch/delete have the same format) request\n\n```javascript\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    errorsMap: {\n      TIMEOUT_ERROR: \"Превышено ожидание запроса\",\n      REQUEST_DEFAULT_ERROR: \"Системная ошибка\",\n      [FORBIDDEN]: \"Данное действие недоступно\"\n    },\n    body: JSON.stringify(someData),\n    mode: \"cors\",\n    parseType: \"blob\",\n    queryParams: {\n      id: \"test_id_123\"\n    },\n    headers: {\n      \"Content-Type\": \"application/json\"\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\"))\n    })\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createReviseRequest(\n  someData\n);\n```\n\n### JSON-RPC API\n\n```javascript\nimport { JSONRPCRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createItemsRequest = (someData): Promise<IResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint: \"http://localhost:3000\",\n    errorsMap: {\n      TIMEOUT_ERROR: \"Превышено ожидание запроса\",\n      REQUEST_DEFAULT_ERROR: \"Системная ошибка\"\n    },\n    body: {\n      method: 'some method',\n      params: 123\n    }\n    mode: \"cors\",\n    queryParams: {\n      id: \"123\"\n    },\n    responseSchema: Joi.object({\n      items: Joi.array().items(\n        Joi.object({\n          id: Joi.string().required(),\n          name: Joi.string().required(),\n          name: Joi.string()\n        })\n      )\n    }),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(someData);\n```\n","readmeFilename":"README.md","gitHead":"2fa46be8acb7ef949343c9cd150400a4b49d1e7f","_id":"@mihanizm56/fetch-api@3.2.0-beta.2","_nodeVersion":"12.13.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-WFueU99bQJug80rPoVf4nciKiqZz9zEjqRgDAY1pM7IKxnDUoHEy2Jsax7hK5AKnhUv7qM0zTBMuS1S+CJYTqg==","shasum":"2a744e04294ec68102d06973e8b49d281b3b59bf","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.2.0-beta.2.tgz","fileCount":69,"unpackedSize":75299,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJekSbFCRA9TVsSAnZWagAAv3IP/jcFq4hXYqYWshACq0oX\nHu2INHfx1WnaPOrUD2QpqNmYOCysbYJaYFeb3LIWwPEXug6rA+naUXu05cri\nbDGApXmCtVhq9vPUrA5oU2XkI6ErjlToejCawGeOC86chwZ4Y4Lh9FyyM+8v\nmUN0DN6d7ta69SVIhSADIYlPSmMPLnMwa/jhTZJhzXgSpe6L4eNSQqriXua/\nW4nZE8eBLqQ5DcdJ/ZoIdW1WSLB4NhbVakob8p4TfUvlR+unmO2Rs3RlBCYz\nDLTvKuAJGZaKMj9fd/L3cIez9nvyi3LeG4NJIOHlT5OIGz930sp7OczA+Qb3\nRZ65ktHikrY72hJo4NtrmdKf6vPLKgRvDc6NzDCCzZjwjzzvvXKSprnazypv\ne/kDwa5XVEPIRl2twdZT8A5+drMPgP9PXmr8Jv9jlVDemmrCLO/Umy+6oFXd\nEyyRihOthih2tOaUp8Gac+/NYEskbf2/NM+6GGk4w6FrEL4YmDc+JTkCKTwD\nvV1C7QMx5cRFzHGoSg70QDi6d1zk6YsilJczNgFX+2YEs+VnJ2jgWSde/pvr\nPDDZuwyUENBMUEeh9gsj8vfoALuO3pxYpEyN+ERIG29YXD4KFL2aPbeZrmYv\nueWqk0sS9XY+K5CC1KcXLLOpnO8wyqB7agyPF5yWCa9kRwnxKREp04UCc0NR\nn8b2\r\n=ddYY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD4Fvdc6ASuUY2jx1KX6BnUijBv3wFQQJP3ChYv1j9KhwIhAOcyTni3fVccbG30JnxsGt6wMRT0G52vL4CYv/kzlZCR"}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.2.0-beta.2_1586570948486_0.9235547811775286"},"_hasShrinkwrap":false},"3.2.0-beta.3":{"name":"@mihanizm56/fetch-api","version":"3.2.0-beta.3","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"set CI=true && jest","test:coverage":"jest --coverage","compile":"tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint . --ext .ts --fix","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","pub":"npm publish --access=public","beta":"npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","node-fetch":"2.6.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.5"},"devDependencies":{"typescript":"3.8.3","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.0.3","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.2.1","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Sollution for http/1.1 isomorphic fetch\n\n### Benefits:\n\n- Provides validation for responses (based on @hapi/joi Schema validation)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize\n- Provides cancel-request if the timeout is higher than 60 seconds\n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error from errorsMap parameter\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure\n- Works in browser and node environments\n\n#### RestRequest input options:\n\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- parseType('json' | 'blob'): the type to parse the response (json by default)\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- errorsMap(object): the object with the errors keys and translated values (TIMEOUT_ERROR and REQUEST_DEFAULT_ERROR fields are required, others must be provided according to the backend errors)\n\n#### RestRequest output options:\n\n- error (boolean) - the flag of the response status\n- errorText (string) - the main error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional multiple errors from the backend\n\n## Examples of usage\n\n### REST API\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### get request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    errorsMap: {\n      TIMEOUT_ERROR: \"Превышено ожидание запроса\",\n      REQUEST_DEFAULT_ERROR: \"Системная ошибка\",\n      [FORBIDDEN]: \"Данное действие недоступно\"\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required()\n          })\n        )\n      })\n    })\n  });\n```\n\n#### post(put/patch/delete have the same format) request\n\n```javascript\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    errorsMap: {\n      TIMEOUT_ERROR: \"Превышено ожидание запроса\",\n      REQUEST_DEFAULT_ERROR: \"Системная ошибка\",\n      [FORBIDDEN]: \"Данное действие недоступно\"\n    },\n    body: JSON.stringify(someData),\n    mode: \"cors\",\n    parseType: \"blob\",\n    queryParams: {\n      id: \"test_id_123\"\n    },\n    headers: {\n      \"Content-Type\": \"application/json\"\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\"))\n    })\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createReviseRequest(\n  someData\n);\n```\n\n### JSON-RPC API\n\n```javascript\nimport { JSONRPCRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createItemsRequest = (someData): Promise<IResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint: \"http://localhost:3000\",\n    errorsMap: {\n      TIMEOUT_ERROR: \"Превышено ожидание запроса\",\n      REQUEST_DEFAULT_ERROR: \"Системная ошибка\"\n    },\n    body: {\n      method: 'some method',\n      params: 123\n    }\n    mode: \"cors\",\n    queryParams: {\n      id: \"123\"\n    },\n    responseSchema: Joi.object({\n      items: Joi.array().items(\n        Joi.object({\n          id: Joi.string().required(),\n          name: Joi.string().required(),\n          name: Joi.string()\n        })\n      )\n    }),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(someData);\n```\n","readmeFilename":"README.md","gitHead":"a1173471d9b37333038e11b73c51d7247716e615","_id":"@mihanizm56/fetch-api@3.2.0-beta.3","_nodeVersion":"12.13.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-LfwXNF/5jTfmz1Muf66oE9bqtV91EREQynHyBxX3lsSzVSlj6ib2+yECgNmu48qbFYMCQFofwL2jCuJwBCPt4Q==","shasum":"b3edd1d4fc3fa6cc6521ba148657500d1b22878b","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.2.0-beta.3.tgz","fileCount":69,"unpackedSize":75351,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJekSsDCRA9TVsSAnZWagAAPjgP/0QW6SWpdmzSIX4FR03Y\n1NjFGGszYCBZonG3nspqWnv8zLAS/JEqIQgSMcC8gJb+1Us2EOJZaFsI3wlf\nCdDxGwiAscERMDQCR6HZFcgFOytf0aPxL4azZ8RkqGH685sic0oFCIIbSG7y\nisDRjw2Inl+ePm6pQJxMl72PpL7TU8mkQr72GDHRMnIMMHroOsoYLnEFC/W/\nlF+jyjyeC3NX92KgOqY7ex3JAlBNh2+QFUTV2solsfhvIWLjxg6b9U4fr1CV\n5xuBLpQwQ9TcdXUnsOeerX2fLJzHX37JlJNHLIILZDzogQiGJtQMRpcuOn5s\nxoezVWge1mu2BTk77B5p8uzzrDd7fjWAhneGo3Rsie4bJ+0Vq3JAUuYvrGZN\nPgLsvbYCJQof92aV3jWaoWwNAVygb1tHN0LQQJcl72qKuCdHhvyVnOWMHt/t\n6oC/iLxw442PPdxLesm4CH49r4Ze5r7JdqTiSxtUNRGZbmOdyxY/MbsppQFs\nsZGniQ5g/yuPXBS8Sad7bjKRlEtXaxWV4KLKDNf22wduA9OuJ9/1uPfYvvD8\nAbewWalGdqTFOUSbNUXg+d487RJXYxv5BQ2diDDdBcNm5Buxwn3Vrz6Schyt\nF3cjQNxZF9KGL1YAlpoPWuMYa51zWJq29Amhv8ZOODpgpQwUvMQR3imC1vYN\nVH8N\r\n=YOy8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFcK5lZM81jEUid0dJEHZVZ7QWXJDaQGFQpvo/MHkYjxAiEAy+ISJ6l8xx41Uvt61PNDKgT0GvleMzfdAN8ZKNlfnGw="}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.2.0-beta.3_1586572035214_0.15971906904499167"},"_hasShrinkwrap":false},"3.2.0-beta.4":{"name":"@mihanizm56/fetch-api","version":"3.2.0-beta.4","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"set CI=true && jest","test:coverage":"jest --coverage","compile":"tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint . --ext .ts --fix","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","pub":"npm publish --access=public","beta":"npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","node-fetch":"2.6.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.5"},"devDependencies":{"typescript":"3.8.3","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.0.3","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.2.1","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Sollution for http/1.1 isomorphic fetch\n\n### Benefits:\n\n- Provides validation for responses (based on @hapi/joi Schema validation)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize\n- Provides cancel-request if the timeout is higher than 60 seconds\n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error from errorsMap parameter\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure\n- Works in browser and node environments\n\n#### RestRequest input options:\n\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- parseType('json' | 'blob'): the type to parse the response (json by default)\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- errorsMap(object): the object with the errors keys and translated values (TIMEOUT_ERROR and REQUEST_DEFAULT_ERROR fields are required, others must be provided according to the backend errors)\n\n#### RestRequest output options:\n\n- error (boolean) - the flag of the response status\n- errorText (string) - the main error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional multiple errors from the backend\n\n## Examples of usage\n\n### REST API\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### get request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    errorsMap: {\n      TIMEOUT_ERROR: \"Превышено ожидание запроса\",\n      REQUEST_DEFAULT_ERROR: \"Системная ошибка\",\n      [FORBIDDEN]: \"Данное действие недоступно\"\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required()\n          })\n        )\n      })\n    })\n  });\n```\n\n#### post(put/patch/delete have the same format) request\n\n```javascript\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    errorsMap: {\n      TIMEOUT_ERROR: \"Превышено ожидание запроса\",\n      REQUEST_DEFAULT_ERROR: \"Системная ошибка\",\n      [FORBIDDEN]: \"Данное действие недоступно\"\n    },\n    body: JSON.stringify(someData),\n    mode: \"cors\",\n    parseType: \"blob\",\n    queryParams: {\n      id: \"test_id_123\"\n    },\n    headers: {\n      \"Content-Type\": \"application/json\"\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\"))\n    })\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createReviseRequest(\n  someData\n);\n```\n\n### JSON-RPC API\n\n```javascript\nimport { JSONRPCRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createItemsRequest = (someData): Promise<IResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint: \"http://localhost:3000\",\n    errorsMap: {\n      TIMEOUT_ERROR: \"Превышено ожидание запроса\",\n      REQUEST_DEFAULT_ERROR: \"Системная ошибка\"\n    },\n    body: {\n      method: 'some method',\n      params: 123\n    }\n    mode: \"cors\",\n    queryParams: {\n      id: \"123\"\n    },\n    responseSchema: Joi.object({\n      items: Joi.array().items(\n        Joi.object({\n          id: Joi.string().required(),\n          name: Joi.string().required(),\n          name: Joi.string()\n        })\n      )\n    }),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(someData);\n```\n","readmeFilename":"README.md","gitHead":"62bf52c830d05e36f85a18052da4a0c65902d308","_id":"@mihanizm56/fetch-api@3.2.0-beta.4","_nodeVersion":"12.13.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-U0n1Hi3bK+I0TLN2hvpO0Dhz8pZzLAz75ZKFkcKOdD0S8PFq3EuEHffT1bfo6ji6VketYshu1SNcUAv0ok/Nsg==","shasum":"c1be54a9fc0a668d1bd5995b4ded2df99771e803","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.2.0-beta.4.tgz","fileCount":69,"unpackedSize":76450,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJekcNTCRA9TVsSAnZWagAA+UAP/1TBmevVBuOihi4Npnrd\nLeZHbDSiXL72j4sd0XhCWKq4IgNw+VCghJ74taZBNp7mWtxUKYI6xIHgH9EI\nl1yHb5MMGYM/AhYF/vD+w2cqrN0M1yBWbbGyeIpS7U8Kh+eF9GUwQO0ynMVI\npYfEtDeaQTEwm7hYlt2ygtkUtNQ37ooJC1p+voCp368QCfK2bSpIbxHhQpin\nOu0Ya5WNpn9njd7HyNqrrizGRmIhD7GkvY2HEjjRn7++E8ZAu1RU16HRNt14\nZaUHZUYyyZZIFx+ShZn8gLI4vj44QMoD26MKAPCij2AAUaNXM3aVMkcrTnds\nGNSysr6doxgUA9/n6XC03Tznnepi7WyH8ZrjOhdsGduiVzVDzHwNyYTwRu7s\n9ZsW6jkcIJCEQbfnfAzURzHXF0ssdZAacdRfDpH1GMkqjQz5ezWugAFix/7t\nb8mpgawGrOkYSZUZGtxCr6JRk5Z0UDBiVSfY+tH88TWQJz6SBWZLueDiZ5iq\n9rEzzP3Zc1aiXnlbquaM8tN28YlUpRik6gPK+39brIGpDcu1ESgkKNY2hPiJ\n5HoaN00T29bxys6HvkJyNrd4Ziinlni77OtedRKHxxAFQKWxGDPBMMbDS49q\nCOUf0tEMcau1QcdWotNXaYIeE1ClJ43UD1cx+NvY+cPZ7Db9bRTZZLqq+QPK\n2Loo\r\n=vjIq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCcu427U7FoD4t07H53Uil+Erxczw9cKiamkcsiqzFeiwIhAL/J40eryv2KZ7gpJ6Xd+iODHb+S0PZLRjJctilWSbyq"}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.2.0-beta.4_1586611027282_0.15407900703664423"},"_hasShrinkwrap":false},"3.2.0-beta.5":{"name":"@mihanizm56/fetch-api","version":"3.2.0-beta.5","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"set CI=true && jest","test:coverage":"jest --coverage","compile":"tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint . --ext .ts --fix","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","pub":"npm publish --access=public","beta":"npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","node-fetch":"2.6.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.5"},"devDependencies":{"typescript":"3.8.3","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.0.3","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.2.1","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Sollution for http/1.1 isomorphic fetch\n\n### Benefits:\n\n- Provides validation for responses (based on @hapi/joi Schema validation)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize\n- Provides cancel-request if the timeout is higher than 60 seconds\n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error from errorsMap parameter\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure\n- Works in browser and node environments\n\n#### RestRequest input options:\n\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- parseType('json' | 'blob'): the type to parse the response (json by default)\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- errorsMap(object): the object with the errors keys and translated values (TIMEOUT_ERROR and REQUEST_DEFAULT_ERROR fields are required, others must be provided according to the backend errors)\n\n#### RestRequest output options:\n\n- error (boolean) - the flag of the response status\n- errorText (string) - the main error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional multiple errors from the backend\n\n## Examples of usage\n\n### REST API\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### get request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    errorsMap: {\n      TIMEOUT_ERROR: \"Превышено ожидание запроса\",\n      REQUEST_DEFAULT_ERROR: \"Системная ошибка\",\n      [FORBIDDEN]: \"Данное действие недоступно\"\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required()\n          })\n        )\n      })\n    })\n  });\n```\n\n#### post(put/patch/delete have the same format) request\n\n```javascript\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    errorsMap: {\n      TIMEOUT_ERROR: \"Превышено ожидание запроса\",\n      REQUEST_DEFAULT_ERROR: \"Системная ошибка\",\n      [FORBIDDEN]: \"Данное действие недоступно\"\n    },\n    body: JSON.stringify(someData),\n    mode: \"cors\",\n    parseType: \"blob\",\n    queryParams: {\n      id: \"test_id_123\"\n    },\n    headers: {\n      \"Content-Type\": \"application/json\"\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\"))\n    })\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createReviseRequest(\n  someData\n);\n```\n\n### JSON-RPC API\n\n```javascript\nimport { JSONRPCRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createItemsRequest = (someData): Promise<IResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint: \"http://localhost:3000\",\n    errorsMap: {\n      TIMEOUT_ERROR: \"Превышено ожидание запроса\",\n      REQUEST_DEFAULT_ERROR: \"Системная ошибка\"\n    },\n    body: {\n      method: 'some method',\n      params: 123\n    }\n    mode: \"cors\",\n    queryParams: {\n      id: \"123\"\n    },\n    responseSchema: Joi.object({\n      items: Joi.array().items(\n        Joi.object({\n          id: Joi.string().required(),\n          name: Joi.string().required(),\n          name: Joi.string()\n        })\n      )\n    }),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(someData);\n```\n","readmeFilename":"README.md","gitHead":"c9ec5d71120d2c294b1a34330d499c4d72e8c315","_id":"@mihanizm56/fetch-api@3.2.0-beta.5","_nodeVersion":"12.13.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-Gcn3K7WFzBiWslWaRe2MQFrrYk5ujyKUpaY/FTw+a5f/M6Yh2F3cCK67zzbAOB1XCclkaXCgF4FA4W6M4XLApA==","shasum":"e32a196580a0d1d4c731926fbac2871b2bd400c3","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.2.0-beta.5.tgz","fileCount":69,"unpackedSize":76560,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJekcbZCRA9TVsSAnZWagAAKlQP/jxIRdhXZ8TXzugEJykM\nJkGPIZ8b6sGOAuiLMqRpBpN83su0U5cGNrrAja8eM8IkazDkqD54dKJWYrhc\nEbVWZIW+Sm7mXVuUZbwjoZjLV6otWvKLrIrAs0og5EykZem35suyxqT6806B\nRQVexf7xdglcWddezXpebqfcStvhwBErJrTSj6HvaxDR6RA8xXCFwV71xig/\nzwppV5MMDbVfuSoUI2iEiWbKbw34etrfchH1We2xIL8deyglt2SjFM1hCmFL\nnwaM+3WgjGQADWEcgQSuYOS1EqTgk3YV5r+y6S5At8AANyXBee7KaJ/QUJoU\nkztzYq7sMzlRlrFmHmZ0c61jwZqeRXSkCJf8YnMZLiIV7dvXEF/pJxstFsLc\nb27smBpyl0Eii823kFzVSIQ1Fii65oj/gQRIo32+xO6pTzX0afPouTnvPrxN\neuBUPjIyLKPSB/T+1Qd4ZTEzZ6Ml1Hrdn3ivdq7vioxTL9L5OkHYN8YlKuHe\nNgJ/WL1HjPpxtLh/Y47kYERLRZ2b9kF6/u/sOjsjqi9T/6oy2QOlVRGT3DgK\nQeefZLV+p90fmllMwguAAWzSJIR5xC7ibfUZb7iyo/7wE0qla0GBVxCCYMI4\ngFs/Qp19+brjEdBdOlVc1SvoEg3q0iW2tWllr9F95Dk1IfMCiGkji2cjV9Qm\nzAl0\r\n=2bkb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDh2FOjys70v2dijzM+8XPrAXbI1ch5QUlgnkphu6WiUgIhALw7ROfRByhE9nyOtIUXx5Icu6NQqP7OqyIR5m6ZpQi0"}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.2.0-beta.5_1586611928891_0.27937010613895263"},"_hasShrinkwrap":false},"3.2.0-beta.6":{"name":"@mihanizm56/fetch-api","version":"3.2.0-beta.6","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"set CI=true && jest","test:coverage":"jest --coverage","compile":"tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint . --ext .ts --fix","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","pub":"npm publish --access=public","beta":"npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","node-fetch":"2.6.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.5"},"devDependencies":{"typescript":"3.8.3","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.0.3","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.2.1","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Sollution for http/1.1 isomorphic fetch\n\n### Benefits:\n\n- Provides validation for responses (based on @hapi/joi Schema validation)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize\n- Provides cancel-request if the timeout is higher than 60 seconds\n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error from errorsMap parameter\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure\n- Works in browser and node environments\n\n#### RestRequest input options:\n\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- parseType('json' | 'blob'): the type to parse the response (json by default)\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- errorsMap(object): the object with the errors keys and translated values (TIMEOUT_ERROR and REQUEST_DEFAULT_ERROR fields are required, others must be provided according to the backend errors)\n\n#### RestRequest output options:\n\n- error (boolean) - the flag of the response status\n- errorText (string) - the main error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional multiple errors from the backend\n\n## Examples of usage\n\n### REST API\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### get request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    errorsMap: {\n      TIMEOUT_ERROR: \"Превышено ожидание запроса\",\n      REQUEST_DEFAULT_ERROR: \"Системная ошибка\",\n      [FORBIDDEN]: \"Данное действие недоступно\"\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required()\n          })\n        )\n      })\n    })\n  });\n```\n\n#### post(put/patch/delete have the same format) request\n\n```javascript\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    errorsMap: {\n      TIMEOUT_ERROR: \"Превышено ожидание запроса\",\n      REQUEST_DEFAULT_ERROR: \"Системная ошибка\",\n      [FORBIDDEN]: \"Данное действие недоступно\"\n    },\n    body: JSON.stringify(someData),\n    mode: \"cors\",\n    parseType: \"blob\",\n    queryParams: {\n      id: \"test_id_123\"\n    },\n    headers: {\n      \"Content-Type\": \"application/json\"\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\"))\n    })\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createReviseRequest(\n  someData\n);\n```\n\n### JSON-RPC API\n\n```javascript\nimport { JSONRPCRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createItemsRequest = (someData): Promise<IResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint: \"http://localhost:3000\",\n    errorsMap: {\n      TIMEOUT_ERROR: \"Превышено ожидание запроса\",\n      REQUEST_DEFAULT_ERROR: \"Системная ошибка\"\n    },\n    body: {\n      method: 'some method',\n      params: 123\n    }\n    mode: \"cors\",\n    queryParams: {\n      id: \"123\"\n    },\n    responseSchema: Joi.object({\n      items: Joi.array().items(\n        Joi.object({\n          id: Joi.string().required(),\n          name: Joi.string().required(),\n          name: Joi.string()\n        })\n      )\n    }),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(someData);\n```\n","readmeFilename":"README.md","gitHead":"c9ec5d71120d2c294b1a34330d499c4d72e8c315","_id":"@mihanizm56/fetch-api@3.2.0-beta.6","_nodeVersion":"12.13.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-EKtX7EbnWhgMpfRUzpNJhMvGzz2Y8EA8TIUwYZMJjmkC9taQTvTzQbeevsehmTUz/9u6eAJWMAzLTnCbzYjvWA==","shasum":"8b7b9aadfada0b39c9e1c111c5dbda1308e9eb82","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.2.0-beta.6.tgz","fileCount":69,"unpackedSize":76892,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJekcxtCRA9TVsSAnZWagAApnQQAJr4Qh3NruVSyS1P0HB6\njeqhTJgwT/XQl9nFh5t/WefghYKzYRemrj0ZisRfb+Aquq8BfJT8OAcg4b7C\nSB3Oq6zHHA1gDUsBcNOFDzNmw6WHhcIT8cs12CdYT0bF77deTCECZiDy/G1O\nHUDDH3BW3whZLg4jW4dIDk3ThqHylnJvKT/ht0ZGvFLlKl00A24LZBgN6CG7\n6VYtHoxocialRW5JGEI0/m+E7t8Xp3iser06e2USAnj63MJYy0KYK1WBRrFv\nVdVmL251/NUp1PMJpZST3h54zCzUI6LS9IdMmD0V1YSW0kNMeibZQalZSHFm\ni4tcawRhz5zXh9GXNveceKms0XG1Y93Bx7RfBWZdsjbs7QpR1/C/6OJbx3F6\nMR4t7JrbTljgDmNFczviy8M8sj0EPdCY6+l25IlnAqO/WZrthoPBxisCMqId\n64+3FQJhahfADQ0dlwjQ1ATblvGOb0FwE2BPgyCx5FKh7ncZ/CPc7k1Fsr4j\ncbyFx+fhPKfUGouRMi4hGuzq2H4aiCy9MRBlyDsiBDEQmaUz4XMHgXO6Us4M\nahxcqE+TbTIrbTndO+dMYr21Dh3PG3P7OqpWuK219bcSzUe9Ffk/AFlCUZgn\n5ZDIEav4ugJkdQGN+UeWW0xoGj76nMrMrs6dvwX3VNwQhdqLlN9fFpB5Gjbk\n2x9T\r\n=Ap+K\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHUtyUYpBuJQXwQESKVPQI73ccSOeI1rqnXC8x9yUR7FAiEA0gKp4zha4y0sKw0tDx76cpVgaR6GDAMW+NVoTihQhVU="}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.2.0-beta.6_1586613356659_0.058337195793909835"},"_hasShrinkwrap":false},"3.2.0-beta.7":{"name":"@mihanizm56/fetch-api","version":"3.2.0-beta.7","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"set CI=true && jest","test:coverage":"jest --coverage","lint":"npx eslint . --ext .ts --fix","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","pub":"npm publish --access=public","beta":"npm publish --tag beta --access=public","size":"pkgfiles","build":"cross-env NODE_ENV=production webpack --mode production"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","node-fetch":"2.6.0"},"devDependencies":{"@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","awesome-typescript-loader":"^5.2.1","babel-jest":"25.2.6","body-parser":"1.19.0","clean-webpack-plugin":"3.0.0","commitizen":"4.0.3","cross-env":"7.0.2","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.2.1","ts-loader":"6.2.2","typescript":"3.8.3","webpack":"4.42.1","webpack-bundle-analyzer":"3.6.1","webpack-cli":"3.3.11"},"browserslist":"> 0.25%, not dead","browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Sollution for http/1.1 isomorphic fetch\n\n### Benefits:\n\n- Provides validation for responses (based on @hapi/joi Schema validation)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize\n- Provides cancel-request if the timeout is higher than 60 seconds\n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error from errorsMap parameter\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure\n- Works in browser and node environments\n\n#### RestRequest input options:\n\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- parseType('json' | 'blob'): the type to parse the response (json by default)\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- errorsMap(object): the object with the errors keys and translated values (TIMEOUT_ERROR and REQUEST_DEFAULT_ERROR fields are required, others must be provided according to the backend errors)\n\n#### RestRequest output options:\n\n- error (boolean) - the flag of the response status\n- errorText (string) - the main error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional multiple errors from the backend\n\n## Examples of usage\n\n### REST API\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### get request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    errorsMap: {\n      TIMEOUT_ERROR: \"Превышено ожидание запроса\",\n      REQUEST_DEFAULT_ERROR: \"Системная ошибка\",\n      [FORBIDDEN]: \"Данное действие недоступно\"\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required()\n          })\n        )\n      })\n    })\n  });\n```\n\n#### post(put/patch/delete have the same format) request\n\n```javascript\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    errorsMap: {\n      TIMEOUT_ERROR: \"Превышено ожидание запроса\",\n      REQUEST_DEFAULT_ERROR: \"Системная ошибка\",\n      [FORBIDDEN]: \"Данное действие недоступно\"\n    },\n    body: JSON.stringify(someData),\n    mode: \"cors\",\n    parseType: \"blob\",\n    queryParams: {\n      id: \"test_id_123\"\n    },\n    headers: {\n      \"Content-Type\": \"application/json\"\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\"))\n    })\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createReviseRequest(\n  someData\n);\n```\n\n### JSON-RPC API\n\n```javascript\nimport { JSONRPCRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createItemsRequest = (someData): Promise<IResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint: \"http://localhost:3000\",\n    errorsMap: {\n      TIMEOUT_ERROR: \"Превышено ожидание запроса\",\n      REQUEST_DEFAULT_ERROR: \"Системная ошибка\"\n    },\n    body: {\n      method: 'some method',\n      params: 123\n    }\n    mode: \"cors\",\n    queryParams: {\n      id: \"123\"\n    },\n    responseSchema: Joi.object({\n      items: Joi.array().items(\n        Joi.object({\n          id: Joi.string().required(),\n          name: Joi.string().required(),\n          name: Joi.string()\n        })\n      )\n    }),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(someData);\n```\n","readmeFilename":"README.md","gitHead":"c9ec5d71120d2c294b1a34330d499c4d72e8c315","_id":"@mihanizm56/fetch-api@3.2.0-beta.7","_nodeVersion":"12.13.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-HQdXz/R0D70aN9Ev7rJh9PJECmPUyN7amyh2QVLwUO0kQ2XfHKEMjad+2cN7IWsa8aFXbeBmLHnFMm85xOvPdQ==","shasum":"e1b7a4635bd9e0658020c025c16aea690dc5bcdb","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.2.0-beta.7.tgz","fileCount":28,"unpackedSize":39383,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJekf3HCRA9TVsSAnZWagAA5woP/ji7IJmWW5Kg3tnv/WSO\ndtuUC1EZILJUhZQpvZNIA2iiDqyMtSaakwwHA/uTWxwT9Vh50kGMSFORQSBG\nWml3oHxjw2r6Z8l1tTkypB7talERFQtAwJVvYMsfHpIEj3oN74H7pEa/8nQx\nlPNzCHJigIa4GYKY3vN0uhd0X9MRO1DsoTOI63IJel8NSojmvQtLgoPwMkoe\n8KVKzPzvWOmafiZO3i00BLkh5U5yXwv9IKzdjAB8UFictohGmM1rgLRpsqgX\nKK9exNDNYS8XdtU9e3Xu3t0qCiXs3kF64O0UD8pocr7fCU4r2g+s8F57dh7c\n0paD6HIKlz3pMwkpbE0AxILXfDmZbuucI24xgniDmKd4W90KEz8EHs1x2JfP\nD/hFociSM6KlSd+edPLsj0OomkXfF8yuGd4nuGkHFQDQf17R1y7hulMQDxHo\nKr7lonjx7C0GgiQ63Hg3jGWghA1ZIsRNBtcHCCs7jkF9DtTR0ZXYBbSFiIr+\nsrBK87j4l/b/K7Q4zCFFxBd99tIhLD6nt7o0UDr3/376DkvyayDb1xOLplyE\nlduaGSqvJha8ws6D37E3tJzKAHnkPvDHnhEeTV47De8l9HQULRgPhbIJD0mC\nHgC0VICePcBQIdva32QymlzVZ8da/c3AbHkhB4P4n77r4ZZTp2ScN3zXhcsN\ny5Gy\r\n=2dkr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAnEPfDvAtwcLEU7lRDJvdYdZYOHXqw6V1FUiVEpwC77AiAvp6suuhLLJ/rndhiniNcq1Pv4Sa7+Bf+EQaZud0HZYQ=="}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.2.0-beta.7_1586625990844_0.8344485407190378"},"_hasShrinkwrap":false},"3.2.0-beta.8":{"name":"@mihanizm56/fetch-api","version":"3.2.0-beta.8","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"set CI=true && jest","test:coverage":"jest --coverage","lint":"npx eslint . --ext .ts --fix","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","pub":"npm publish --access=public","beta":"npm publish --tag beta --access=public","size":"pkgfiles","build":"cross-env NODE_ENV=production webpack --mode production","compile":"tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","node-fetch":"2.6.0"},"devDependencies":{"@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","awesome-typescript-loader":"^5.2.1","babel-jest":"25.2.6","body-parser":"1.19.0","clean-webpack-plugin":"3.0.0","commitizen":"4.0.3","cross-env":"7.0.2","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.2.1","ts-loader":"6.2.2","typescript":"3.8.3","webpack":"4.42.1","webpack-bundle-analyzer":"3.6.1","webpack-cli":"3.3.11","tscpaths":"0.0.9"},"browserslist":"> 0.25%, not dead","browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Sollution for http/1.1 isomorphic fetch\n\n### Benefits:\n\n- Provides validation for responses (based on @hapi/joi Schema validation)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize\n- Provides cancel-request if the timeout is higher than 60 seconds\n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error from errorsMap parameter\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure\n- Works in browser and node environments\n\n#### RestRequest input options:\n\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- parseType('json' | 'blob'): the type to parse the response (json by default)\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- errorsMap(object): the object with the errors keys and translated values (TIMEOUT_ERROR and REQUEST_DEFAULT_ERROR fields are required, others must be provided according to the backend errors)\n\n#### RestRequest output options:\n\n- error (boolean) - the flag of the response status\n- errorText (string) - the main error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional multiple errors from the backend\n\n## Examples of usage\n\n### REST API\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### get request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    errorsMap: {\n      TIMEOUT_ERROR: \"Превышено ожидание запроса\",\n      REQUEST_DEFAULT_ERROR: \"Системная ошибка\",\n      [FORBIDDEN]: \"Данное действие недоступно\"\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required()\n          })\n        )\n      })\n    })\n  });\n```\n\n#### post(put/patch/delete have the same format) request\n\n```javascript\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    errorsMap: {\n      TIMEOUT_ERROR: \"Превышено ожидание запроса\",\n      REQUEST_DEFAULT_ERROR: \"Системная ошибка\",\n      [FORBIDDEN]: \"Данное действие недоступно\"\n    },\n    body: JSON.stringify(someData),\n    mode: \"cors\",\n    parseType: \"blob\",\n    queryParams: {\n      id: \"test_id_123\"\n    },\n    headers: {\n      \"Content-Type\": \"application/json\"\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\"))\n    })\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createReviseRequest(\n  someData\n);\n```\n\n### JSON-RPC API\n\n```javascript\nimport { JSONRPCRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createItemsRequest = (someData): Promise<IResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint: \"http://localhost:3000\",\n    errorsMap: {\n      TIMEOUT_ERROR: \"Превышено ожидание запроса\",\n      REQUEST_DEFAULT_ERROR: \"Системная ошибка\"\n    },\n    body: {\n      method: 'some method',\n      params: 123\n    }\n    mode: \"cors\",\n    queryParams: {\n      id: \"123\"\n    },\n    responseSchema: Joi.object({\n      items: Joi.array().items(\n        Joi.object({\n          id: Joi.string().required(),\n          name: Joi.string().required(),\n          name: Joi.string()\n        })\n      )\n    }),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(someData);\n```\n","readmeFilename":"README.md","gitHead":"609e447b21bb0e45c8182916333c762d218be547","_id":"@mihanizm56/fetch-api@3.2.0-beta.8","_nodeVersion":"12.13.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-KPKqFyXTtTimBEfuUKUECGokUjRLicRR90d7J/W16dLag4c7ETLja8QhAMAokx+OTFcueQIm7y1KSrzXtD/tWw==","shasum":"66605b045b1fda9dadc124f22eb7a1144c3cc17f","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.2.0-beta.8.tgz","fileCount":28,"unpackedSize":39502,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJekgZ5CRA9TVsSAnZWagAASmEQAJD6Vbw5XcWu4tx3e3Jd\nhCHb4uum6dUrzbLOurUI6Gb2f1aNcGJog29+dwss0E89sHMp5LxlJ0BtCxDp\nplz44bVrup+pdV+QJNlmwjTKt+Kn6XWKfhTjenJEzJDoE9TvGhXBgmLIJjC2\nouQcs8xTsyCA57fsvuWfegavj8FYY5Fc3T8nyGyEsFg2JhKTi2S5nacvwE16\nE4BVbalvuOuIoCE1DwHZo186N54DK+D5T911fJjU3xTApsL8g17PcVgzUuOR\nfMIQDVyly9bXMF6Wh+q+B25zK0zuaWAuGcDfj9XZy3hsWIMP/NDeV/VWdQtx\n4IuyV0XPZuu/CYJlcn5nYovvLd2JNgQutcysELe/pev7fhTyu8VwCw0g1eJU\nTz3bGQVhLs9DnIuO/NOZ+Gy/0wfsVWrkoXhoxX0gdmzGZH16DoMcQy1ZA5Kq\nOVEgeYQke0JseKXRZLETs+o6YxfNjo6rKwmEBVYc35/VWhRV25lo96U0j95Z\njhcdZHkxqvByJmG/wL74MLvkM6SpCkdUhXmVnvrXrILOraUK+AZ/0n3OEYSK\nSm+qh48CzfbWZbfSPkBndbBLfXnEZXl9/35SHlETL71z4dd9NLPLGMYqYxCP\nSJRrUkrfyPfeWdC/XtkuCaK8ckY+15QYBYiKXXIvgCFOcWy7KBfsIPAuynLG\n3bXt\r\n=0mXc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEuWHFCMEBLU9Y6XVO9KnOWJAfkX8TDZOwKwQonHGNVRAiBrcXHf3FlexukEbbvZG6/pac0MZ9l9+lXl4rzVV5+/lw=="}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.2.0-beta.8_1586628216839_0.7583500903061959"},"_hasShrinkwrap":false},"3.2.0-beta.9":{"name":"@mihanizm56/fetch-api","version":"3.2.0-beta.9","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"set CI=true && jest","test:coverage":"jest --coverage","compile":"tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint . --ext .ts --fix","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","pub":"npm publish --access=public","beta":"npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","node-fetch":"2.6.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.5"},"devDependencies":{"typescript":"3.8.3","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.0.3","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.2.1","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"gitHead":"c9ec5d71120d2c294b1a34330d499c4d72e8c315","readme":"# @mihanizm56/fetch-api\n\n## Sollution for http/1.1 isomorphic fetch\n\n### Benefits:\n\n- Provides validation for responses (based on @hapi/joi Schema validation)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize\n- Provides cancel-request if the timeout is higher than 60 seconds\n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error from errorsMap parameter\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure\n- Works in browser and node environments\n\n#### RestRequest input options:\n\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- parseType('json' | 'blob'): the type to parse the response (json by default)\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- errorsMap(object): the object with the errors keys and translated values (TIMEOUT_ERROR and REQUEST_DEFAULT_ERROR fields are required, others must be provided according to the backend errors)\n\n#### RestRequest output options:\n\n- error (boolean) - the flag of the response status\n- errorText (string) - the main error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional multiple errors from the backend\n\n## Examples of usage\n\n### REST API\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### get request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    errorsMap: {\n      TIMEOUT_ERROR: \"Превышено ожидание запроса\",\n      REQUEST_DEFAULT_ERROR: \"Системная ошибка\",\n      [FORBIDDEN]: \"Данное действие недоступно\"\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required()\n          })\n        )\n      })\n    })\n  });\n```\n\n#### post(put/patch/delete have the same format) request\n\n```javascript\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    errorsMap: {\n      TIMEOUT_ERROR: \"Превышено ожидание запроса\",\n      REQUEST_DEFAULT_ERROR: \"Системная ошибка\",\n      [FORBIDDEN]: \"Данное действие недоступно\"\n    },\n    body: JSON.stringify(someData),\n    mode: \"cors\",\n    parseType: \"blob\",\n    queryParams: {\n      id: \"test_id_123\"\n    },\n    headers: {\n      \"Content-Type\": \"application/json\"\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\"))\n    })\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createReviseRequest(\n  someData\n);\n```\n\n### JSON-RPC API\n\n```javascript\nimport { JSONRPCRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createItemsRequest = (someData): Promise<IResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint: \"http://localhost:3000\",\n    errorsMap: {\n      TIMEOUT_ERROR: \"Превышено ожидание запроса\",\n      REQUEST_DEFAULT_ERROR: \"Системная ошибка\"\n    },\n    body: {\n      method: 'some method',\n      params: 123\n    }\n    mode: \"cors\",\n    queryParams: {\n      id: \"123\"\n    },\n    responseSchema: Joi.object({\n      items: Joi.array().items(\n        Joi.object({\n          id: Joi.string().required(),\n          name: Joi.string().required(),\n          name: Joi.string()\n        })\n      )\n    }),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(someData);\n```\n","readmeFilename":"README.md","_id":"@mihanizm56/fetch-api@3.2.0-beta.9","_nodeVersion":"12.13.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-QzsOP0GyOOwUzjBuXNsu+IYhGovpnot3YsPStHDvyzNVKL6GqT8NaTrDda504XQZM3SB/VUGB0QdXFmd+7avqQ==","shasum":"0666618a3b3c1e6ca0cbae6dd26910eb28f727d7","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.2.0-beta.9.tgz","fileCount":51,"unpackedSize":58283,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJekybBCRA9TVsSAnZWagAAh6UP/2sDm5Io/HU/AjX/93SU\nUQ/2/NWpn8UHWI65myaF+B5v74vKC1ecUZCq1YSrSBFCJMseVek98WfzP6WJ\n3/UR4gKx4OsmO/fqzVfQP1PxOMplZrqsIpwoGtyPEmQXx9NH3VYMqJVSLVHZ\nj4uINt41/2K5NohtBHXyKL4+YaJp0WPJlhZ4sWNF99o17q4l2/FGM7F3k5SR\n+2mE1ybXkOHE1dQ0rPzoqJGY54UnHGiflyLPYmFu+BNrb4a430P5H/MwJqiJ\nyzRBo2DkFrWC0X0wbfnFEtPiX3rCIlioL8pdJmzMnlueIWnDkeTLJ1oOLn6R\n08SnCrwaf8RYaVtlZnZfXM5oQilvuZ8V4kuK+O9eM4zloXWfSQqEQdcMbBsX\ng+q5Tq3j9B+z1zr0dK5+1s2z6tVBTZIqMXi7KPPJXVh2vqQapakEF2NeeZNp\niA0h3onMnhilS9/qzqlE4x6cVYpG2ORygdkiTnlBGFPc1bkIaFbtmRNOzN+D\npFSdboOo/3aFM2mkUFoI1eNKzTQd6uhxI6k7zPhtHB1q2m8Y/c06cx5QW34t\nv1H8dX4a/JDaCmHOfYzaAq5mOsLDdG8iGK4xRinWHimJ3xf4YMXxSeiQVOo9\nLRQswBZDwaDYzPQgnml2/XdwPMt8Au05VRCY/ZIwPpWha01uUyACdBGIpk2W\nVrlN\r\n=ECTM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHqn2YdrLcGLGytnt+bfoo5AAaTWbYjtMlXZEAIrPltBAiEA30+SImJnLCcNnntBDX5Em3yRG6XVTXZn+HBbUwil2PM="}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.2.0-beta.9_1586702016779_0.16969340302741487"},"_hasShrinkwrap":false},"3.2.0-beta.10":{"name":"@mihanizm56/fetch-api","version":"3.2.0-beta.10","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"set CI=true && jest","test:coverage":"jest --coverage","compile":"tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint . --ext .ts --fix","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","pub":"npm publish --access=public","beta":"npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","node-fetch":"2.6.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.5"},"devDependencies":{"typescript":"3.8.3","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.0.3","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.2.1","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Sollution for http/1.1 isomorphic fetch\n\n### Benefits:\n\n- Provides validation for responses (based on @hapi/joi Schema validation)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize\n- Provides cancel-request if the timeout is higher than 60 seconds\n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error from errorsMap parameter\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure\n- Works in browser and node environments\n\n#### RestRequest input options:\n\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- parseType('json' | 'blob'): the type to parse the response (json by default)\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- errorsMap(object): the object with the errors keys and translated values (TIMEOUT_ERROR and REQUEST_DEFAULT_ERROR fields are required, others must be provided according to the backend errors)\n\n#### RestRequest output options:\n\n- error (boolean) - the flag of the response status\n- errorText (string) - the main error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional multiple errors from the backend\n\n## Examples of usage\n\n### REST API\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### get request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    errorsMap: {\n      TIMEOUT_ERROR: \"Превышено ожидание запроса\",\n      REQUEST_DEFAULT_ERROR: \"Системная ошибка\",\n      [FORBIDDEN]: \"Данное действие недоступно\"\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required()\n          })\n        )\n      })\n    })\n  });\n```\n\n#### post(put/patch/delete have the same format) request\n\n```javascript\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    errorsMap: {\n      TIMEOUT_ERROR: \"Превышено ожидание запроса\",\n      REQUEST_DEFAULT_ERROR: \"Системная ошибка\",\n      [FORBIDDEN]: \"Данное действие недоступно\"\n    },\n    body: JSON.stringify(someData),\n    mode: \"cors\",\n    parseType: \"blob\",\n    queryParams: {\n      id: \"test_id_123\"\n    },\n    headers: {\n      \"Content-Type\": \"application/json\"\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\"))\n    })\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createReviseRequest(\n  someData\n);\n```\n\n### JSON-RPC API\n\n```javascript\nimport { JSONRPCRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createItemsRequest = (someData): Promise<IResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint: \"http://localhost:3000\",\n    errorsMap: {\n      TIMEOUT_ERROR: \"Превышено ожидание запроса\",\n      REQUEST_DEFAULT_ERROR: \"Системная ошибка\"\n    },\n    body: {\n      method: 'some method',\n      params: 123\n    }\n    mode: \"cors\",\n    queryParams: {\n      id: \"123\"\n    },\n    responseSchema: Joi.object({\n      items: Joi.array().items(\n        Joi.object({\n          id: Joi.string().required(),\n          name: Joi.string().required(),\n          name: Joi.string()\n        })\n      )\n    }),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(someData);\n```\n","readmeFilename":"README.md","gitHead":"b744911da9abda45f56b6643b3b07b5df982dfc6","_id":"@mihanizm56/fetch-api@3.2.0-beta.10","_nodeVersion":"12.13.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-d/Si/NQt4tlHMIzJd86nXjoAMtSLdyMUHmgM4uaMJNAixEmjyD+9JCY7k3DizU51DqrQG7KxxS7jSZN5zUKLDQ==","shasum":"617511c0e0e2dac72b3de1587fb2cff82032f9e3","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.2.0-beta.10.tgz","fileCount":51,"unpackedSize":57400,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJel94JCRA9TVsSAnZWagAAOoMP/R9Ya4EdlJs8AkLFQYgm\nCVGINpibaRmdchrFhbY/zx4tTeDKV42jmBh+qFHfyXc6c9qUAx31LtnDv3KF\nPjr5WZkcLqNWF5+J+A6JwJyKD8A6Fnjzg4yDKGnKBhqImEJYkOv5hmrt2DHW\n4O5ATRq5cogWbG5sonySh0HFdJZzwakBdruOzDQ/JdfRkbjex+qS/oCFZ6Cf\naIIGZp7hH79H3hXCtnjxeSvLCf06Zqpkb/kO2/apcwH+saYXtFqH5spp2Xim\nRisIsVpuKTCVrWJq6TUsJb8K6aabqO6i9T/K2U3Y+ivCP6SSN9Lfb/HxytEZ\nyV0fLSnBab1aWTBUmwxO+GRBH6SsgAWC7zBAa5IEVWL1EK8UPr58AWz8g25m\nTsogAoGcnq+yFcRIt22BUH0SzaD3oE/krEgDkMdczI4G6Aqa6psGIy5v4uEo\nx5RzZHxZL11f34py10VoL2qZl8ZhOBgLvXsxkD2pqBuIceZRhCc88/BuzQeH\nhiPpQLVQJUOzdHyjKJk+iOAuIkKB07SnAaUbVkGKtCm0RJmvnmJZlnQPmmmA\ndMctKRFsKEEs4gVd5S+zaxcK6E6AoRuELcLNAw+gWnEN5FP/3avKuzbpyhwf\ngYqiyvHdGea1cy+KsOONUL8raImAePEaDUzMZ48NBVfT26UqbUaQxBucLagE\nyDGt\r\n=osa6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEk4v2lFecsO47lVmtkCIZubM1oIUFf3B7/6n5JcodeYAiBzhz11GIeniMiat7cfDY8ugEF4zQyGbo/K8AZcNslJ/w=="}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.2.0-beta.10_1587011081442_0.4722127913788876"},"_hasShrinkwrap":false},"3.2.0-beta.11":{"name":"@mihanizm56/fetch-api","version":"3.2.0-beta.11","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"set CI=true && jest","test:coverage":"jest --coverage","compile":"tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint . --ext .ts --fix","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","pub":"npm publish --access=public","beta":"npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","node-fetch":"2.6.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.5"},"devDependencies":{"typescript":"3.8.3","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.0.3","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.2.1","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Sollution for http/1.1 isomorphic fetch\n\n### Benefits:\n\n- Provides validation for responses (based on @hapi/joi Schema validation)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize\n- Provides cancel-request if the timeout is higher than 60 seconds\n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error from errorsMap parameter\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure\n- Works in browser and node environments\n\n#### RestRequest input options:\n\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- parseType('json' | 'blob'): the type to parse the response (json by default)\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- errorsMap(object): the object with the errors keys and translated values (TIMEOUT_ERROR and REQUEST_DEFAULT_ERROR fields are required, others must be provided according to the backend errors)\n\n#### RestRequest output options:\n\n- error (boolean) - the flag of the response status\n- errorText (string) - the main error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional multiple errors from the backend\n\n## Examples of usage\n\n### REST API\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### get request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    errorsMap: {\n      TIMEOUT_ERROR: \"Превышено ожидание запроса\",\n      REQUEST_DEFAULT_ERROR: \"Системная ошибка\",\n      [FORBIDDEN]: \"Данное действие недоступно\"\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required()\n          })\n        )\n      })\n    })\n  });\n```\n\n#### post(put/patch/delete have the same format) request\n\n```javascript\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    errorsMap: {\n      TIMEOUT_ERROR: \"Превышено ожидание запроса\",\n      REQUEST_DEFAULT_ERROR: \"Системная ошибка\",\n      [FORBIDDEN]: \"Данное действие недоступно\"\n    },\n    body: JSON.stringify(someData),\n    mode: \"cors\",\n    parseType: \"blob\",\n    queryParams: {\n      id: \"test_id_123\"\n    },\n    headers: {\n      \"Content-Type\": \"application/json\"\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\"))\n    })\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createReviseRequest(\n  someData\n);\n```\n\n### JSON-RPC API\n\n```javascript\nimport { JSONRPCRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createItemsRequest = (someData): Promise<IResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint: \"http://localhost:3000\",\n    errorsMap: {\n      TIMEOUT_ERROR: \"Превышено ожидание запроса\",\n      REQUEST_DEFAULT_ERROR: \"Системная ошибка\"\n    },\n    body: {\n      method: 'some method',\n      params: 123\n    }\n    mode: \"cors\",\n    queryParams: {\n      id: \"123\"\n    },\n    responseSchema: Joi.object({\n      items: Joi.array().items(\n        Joi.object({\n          id: Joi.string().required(),\n          name: Joi.string().required(),\n          name: Joi.string()\n        })\n      )\n    }),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(someData);\n```\n","readmeFilename":"README.md","gitHead":"1badfcc25138b037189c30bd79503a76bf18b78f","_id":"@mihanizm56/fetch-api@3.2.0-beta.11","_nodeVersion":"12.13.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-Jdzbu9VvHfH8GmpFUicxrYK6QV/k40sWLHOVwuCbTluwis91sXhwAZZSktqlrcvQBHRmQjtrpFu7lvnChdryYA==","shasum":"824263dc0c0c8727d3e9b73bf4c8a54c6b4d4bcf","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.2.0-beta.11.tgz","fileCount":51,"unpackedSize":57424,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJemhzWCRA9TVsSAnZWagAAgdQP/3/7YrrYD5Tj/7ZXTMas\nLRJFamq5YU34RFhVIXgfe9+oabMdBaoBNCLiM5Upl8YEYnFq09SuT7m2RH6t\nCZYMay11Fe3xgEW8MJmw/Qo1U8skd83en1FGSVztr77/FUZnC2NxpNlxuEKA\nNs67F441IykQkAYaX3zqz4cEC728Na8Euhf/3N6eIhBye1WItNOAbjGWWaP1\nrJDPZ5SwcqtZ1M9Zdzs19/LNyeAywOaYvyAEfsTer7KFlwAoaIKMs6eLlXz6\nLMOyo1INUwSW4c58gVJ5vKeOuteIobLs1lxhoeZGqy049/oV4CAtQJ1tJ1iF\nrnZn8ib+H0bcdQG8OVXY8jaoE1anqd0iMBZY5kizqPnp7sf5SiUXsVzRmG/1\nASzy6QO6mpi4pA0yFVtSBSpQMjhotsLrpxUpd4LDf5VM4bhViisKvITPABT1\nL2Uz7pxEZtuRZmIh9NZ5YKGQxscXsZe7CjjbrXrGVUc0OF5zK2Opm18d0oqy\n1cqU/4Y9cVMQlDej5kK0J9fkqG2ZISPpranww46o9M+yvBONZ3RdY0g9XlcX\n+lWuZic89oHD7kHcvdT5MA5x9MZdigFVTpwxkRQ16pM0SSYCYTCFHMFnQcN0\nwObX/kme6l97OQAl+Wr/M/g34u8f9thlptII82D+ZpGY5I1BENPb5WWc58He\n6llC\r\n=9MRR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC2okCJXq1jGwZ3+Cjf3nUA42la8sRbdgPAB1nKpdoxCAiEApZdQapAAY2ederWTbwT0vlx0LUaXYzUaXmYTjRIQ3Nk="}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.2.0-beta.11_1587158229543_0.15780990558773444"},"_hasShrinkwrap":false},"3.2.0-beta.12":{"name":"@mihanizm56/fetch-api","version":"3.2.0-beta.12","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"set CI=true && jest","test:coverage":"jest --coverage","compile":"tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint . --ext .ts --fix","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","pub":"npm publish --access=public","beta":"npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","node-fetch":"2.6.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.5"},"devDependencies":{"typescript":"3.8.3","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.0.3","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.2.1","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Sollution for http/1.1 isomorphic fetch\n\n### Benefits:\n\n- Provides validation for responses (based on @hapi/joi Schema validation)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize\n- Provides cancel-request if the timeout is higher than 60 seconds\n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error from errorsMap parameter\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure\n- Works in browser and node environments\n\n#### RestRequest input options:\n\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- parseType('json' | 'blob'): the type to parse the response (json by default)\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- errorsMap(object): the object with the errors keys and translated values (TIMEOUT_ERROR and REQUEST_DEFAULT_ERROR fields are required, others must be provided according to the backend errors)\n\n#### RestRequest output options:\n\n- error (boolean) - the flag of the response status\n- errorText (string) - the main error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional multiple errors from the backend\n\n## Examples of usage\n\n### REST API\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### get request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    errorsMap: {\n      TIMEOUT_ERROR: \"Превышено ожидание запроса\",\n      REQUEST_DEFAULT_ERROR: \"Системная ошибка\",\n      [FORBIDDEN]: \"Данное действие недоступно\"\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required()\n          })\n        )\n      })\n    })\n  });\n```\n\n#### post(put/patch/delete have the same format) request\n\n```javascript\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    errorsMap: {\n      TIMEOUT_ERROR: \"Превышено ожидание запроса\",\n      REQUEST_DEFAULT_ERROR: \"Системная ошибка\",\n      [FORBIDDEN]: \"Данное действие недоступно\"\n    },\n    body: JSON.stringify(someData),\n    mode: \"cors\",\n    parseType: \"blob\",\n    queryParams: {\n      id: \"test_id_123\"\n    },\n    headers: {\n      \"Content-Type\": \"application/json\"\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\"))\n    })\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createReviseRequest(\n  someData\n);\n```\n\n### JSON-RPC API\n\n```javascript\nimport { JSONRPCRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createItemsRequest = (someData): Promise<IResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint: \"http://localhost:3000\",\n    errorsMap: {\n      TIMEOUT_ERROR: \"Превышено ожидание запроса\",\n      REQUEST_DEFAULT_ERROR: \"Системная ошибка\"\n    },\n    body: {\n      method: 'some method',\n      params: 123\n    }\n    mode: \"cors\",\n    queryParams: {\n      id: \"123\"\n    },\n    responseSchema: Joi.object({\n      items: Joi.array().items(\n        Joi.object({\n          id: Joi.string().required(),\n          name: Joi.string().required(),\n          name: Joi.string()\n        })\n      )\n    }),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(someData);\n```\n","readmeFilename":"README.md","gitHead":"1e0b46436bac0de5984763663a574217b8a67876","_id":"@mihanizm56/fetch-api@3.2.0-beta.12","_nodeVersion":"12.13.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-hXeaityII2HcmMEXUwHXaGJefERyYYxE86wo8Ky2P2AgLFCk9UIVJ1c0TRNCeRNNfZ5pOYWHE1giPuegpeMT2Q==","shasum":"1df6b3e9c1332f4984a54c46a7f7c9b3315599ae","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.2.0-beta.12.tgz","fileCount":51,"unpackedSize":58355,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJem5T2CRA9TVsSAnZWagAAP7cP/R0E+s2bSTitVl9ve/pQ\n/Ix/iFoMwR/22A7v/8Jb8WHxX1EeZs58XkgulJgVlHiZb3rys9HLgiHkVOR7\nMuiYFpoBysWM7xcfpnVNoI1Ufv0kKeMYHU1mkGH/OPJ5MUQ6LHtiIn4aal9r\nDxc5eUt5pDihVaO5Z5RhQldlfp3mSTlWWZ5uwSEc6Y4zIKtjWvZScCX1vE7y\npx6vTdltCBw9zA5ygzuJ8zXiL1JiH0MjkZvGR05cXDspjY/BDQ0Oskgm46YM\nB0GYN3MSaM6lZxcAhg25bx9B9Igw/GB+G2LvffQMSLa9rpAzSoR1GP8iodz/\nmqMg7MGjGWXoGR0iTIguFe3ONVeO7/N7uj3II7Z0ooroyESoVvXW+Eo28JtF\nrMqIi5bsAReg3e4x/eHnK7dWS3ABROhl8A1QKIQmH+mOlQ6XtX1R0ayR/BmF\nPSuyaDM3qSOdpTt4BLwfUc1EsTVeH2tB9TC70xo4SCzl86fbzgZci06uxFgP\nauYCVoY7bwmJH00GKrJ8POgOgYuVlDrGa1Y0RMcAaGPdVam2AKmPfdAcz91/\naXUSVBOZ/e828brHrLbXqte1vItsoWZy+EjQ7wEzAqO2Lbo8HA8Ejgb408mR\nN1uFQat6hSiGePsCW692adt+W3XSvpXZNqvaDdKcMIA3AVXjNuQIE6l05g+a\nYMI/\r\n=3VZp\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC+co2Rt4Ba9gA3dRz3fwo4LhgA1+jkCVbQ6zfja7KIGAiEAv0jI8wFSTbubVlh9p4qrQKssGIxeAgPcUsKzHcLxYag="}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.2.0-beta.12_1587254517755_0.7473203184636021"},"_hasShrinkwrap":false},"3.2.0-beta.13":{"name":"@mihanizm56/fetch-api","version":"3.2.0-beta.13","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"set CI=true && jest","test:coverage":"jest --coverage","compile":"tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint . --ext .ts --fix","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","pub":"npm publish --access=public","beta":"npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","node-fetch":"2.6.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.5"},"devDependencies":{"typescript":"3.8.3","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.0.3","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.2.1","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Sollution for http/1.1 isomorphic fetch\n\n### Benefits:\n\n- Provides validation for responses (based on @hapi/joi Schema validation)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize\n- Provides cancel-request if the timeout is higher than 60 seconds\n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error from errorsMap parameter\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure\n- Works in browser and node environments\n\n#### RestRequest input options:\n\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- parseType('json' | 'blob'): the type to parse the response (json by default)\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- errorsMap(object): the object with the errors keys and translated values (TIMEOUT_ERROR and REQUEST_DEFAULT_ERROR fields are required, others must be provided according to the backend errors)\n\n#### RestRequest output options:\n\n- error (boolean) - the flag of the response status\n- errorText (string) - the main error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional multiple errors from the backend\n\n## Examples of usage\n\n### REST API\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### get request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    errorsMap: {\n      TIMEOUT_ERROR: \"Превышено ожидание запроса\",\n      REQUEST_DEFAULT_ERROR: \"Системная ошибка\",\n      [FORBIDDEN]: \"Данное действие недоступно\"\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required()\n          })\n        )\n      })\n    })\n  });\n```\n\n#### post(put/patch/delete have the same format) request\n\n```javascript\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    errorsMap: {\n      TIMEOUT_ERROR: \"Превышено ожидание запроса\",\n      REQUEST_DEFAULT_ERROR: \"Системная ошибка\",\n      [FORBIDDEN]: \"Данное действие недоступно\"\n    },\n    body: JSON.stringify(someData),\n    mode: \"cors\",\n    parseType: \"blob\",\n    queryParams: {\n      id: \"test_id_123\"\n    },\n    headers: {\n      \"Content-Type\": \"application/json\"\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\"))\n    })\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createReviseRequest(\n  someData\n);\n```\n\n### JSON-RPC API\n\n```javascript\nimport { JSONRPCRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createItemsRequest = (someData): Promise<IResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint: \"http://localhost:3000\",\n    errorsMap: {\n      TIMEOUT_ERROR: \"Превышено ожидание запроса\",\n      REQUEST_DEFAULT_ERROR: \"Системная ошибка\"\n    },\n    body: {\n      method: 'some method',\n      params: 123\n    }\n    mode: \"cors\",\n    queryParams: {\n      id: \"123\"\n    },\n    responseSchema: Joi.object({\n      items: Joi.array().items(\n        Joi.object({\n          id: Joi.string().required(),\n          name: Joi.string().required(),\n          name: Joi.string()\n        })\n      )\n    }),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(someData);\n```\n","readmeFilename":"README.md","gitHead":"58eb9ff3fb257ffbba0e33d813fbefb75282896d","_id":"@mihanizm56/fetch-api@3.2.0-beta.13","_nodeVersion":"12.13.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-J03Fhf0aDcwdbAT5GgGqcpBb2ipLQBEXZO9UDYnujxvv76OvHUM1jjMwsgt8isrCBqOLcmsCRshqvYh63z5W5A==","shasum":"5605432053f71168f0a69b6a580ba888e77e5417","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.2.0-beta.13.tgz","fileCount":51,"unpackedSize":58357,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJem5j0CRA9TVsSAnZWagAADbwP/285pAOw1dFnDwGcvnJu\nayDg9jj1gkVbq+dOnpW6bqiYaU0/nnGH2wz7x9mLitn4QzlZfbcbEJCBnxCH\ndyHKfzJWBbUSV71wsGNlBUJNcyBuIGSfepPO1INIsNbru+JyBny/Cuqvobpk\nLM+V/gz43aAwggMAfEQfBjs1bFGqO5/pNDvg/1W3M1bGr/U5fqbdQAAwXALW\nisgRXebI/FIf/5mrerafPnh8QPtyGtplDPLDMVh1gA0t2lBVqCqmNw+sF7av\nB2thVA/p9kWFHPlYw5xU54hwvHg9TxhJv6jH65ADteMqhiCjCbxAf5kfiI3J\nOBb4ZnyKUPGS7KrSfr+T9TfJha40leOQczFmPcf9WDFmUdFv5kJ+gq/tB+8R\nO7KuYqFZ0muhiLfKvIjP6v96414QH1dRw73iVmLE3kpvoKTKQnvUtuBiCkPU\nKOaGyj0jOUsmnuTdXNSXzpbFxHneTsZFr3tVtp8sdhAsLzcsl+hEjSTm7eFA\n04QCd9wcprd2oS2fx/03yVEgwSk3t+UBzHRbT9HfnMyCUkO3HCaoXRJUbiBm\nNGzpB3pMnBe9xTq0VhazISWjTBDk83zI6QQMUOl8Y34Cf2hcvdkpPUOFyqlE\nzoM2q3CP4RRGpY7mf5pu3z08GiGDYkduk6f6qMsklaMQRL9rv11wqYMAeUgP\nUSNO\r\n=amOg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC4xSczQDoJel/2WlscfjXMTxhvw21bzcnRcGYC0O20bAiEAuPpsGz4UDrfOF17/t1htyb9uroDkKtRzp7eD296bBXw="}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.2.0-beta.13_1587255540098_0.855122578562092"},"_hasShrinkwrap":false},"3.2.0-beta.14":{"name":"@mihanizm56/fetch-api","version":"3.2.0-beta.14","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"set CI=true && jest","test:coverage":"jest --coverage","compile":"tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint . --ext .ts --fix","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","release":"npm publish --access=public","beta":"npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","node-fetch":"2.6.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.5"},"devDependencies":{"typescript":"3.8.3","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.0.3","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.2.1","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Sollution for http/1.1 isomorphic fetch\n\n### Benefits:\n\n- Provides validation for responses (based on @hapi/joi Schema validation)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize\n- Provides cancel-request if the timeout is higher than 60 seconds\n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error from errorsMap parameter\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure\n- Works in browser and node environments\n\n#### RestRequest input options:\n\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- parseType('json' | 'blob'): the type to parse the response (json by default)\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- errorsMap(object): the object with the errors keys and translated values (TIMEOUT_ERROR and REQUEST_DEFAULT_ERROR fields are required, others must be provided according to the backend errors)\n\n#### RestRequest output options:\n\n- error (boolean) - the flag of the response status\n- errorText (string) - the main error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional multiple errors from the backend\n\n## Examples of usage\n\n### REST API\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### get request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    errorsMap: {\n      TIMEOUT_ERROR: \"Превышено ожидание запроса\",\n      REQUEST_DEFAULT_ERROR: \"Системная ошибка\",\n      [FORBIDDEN]: \"Данное действие недоступно\"\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required()\n          })\n        )\n      })\n    })\n  });\n```\n\n#### post(put/patch/delete have the same format) request\n\n```javascript\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    errorsMap: {\n      TIMEOUT_ERROR: \"Превышено ожидание запроса\",\n      REQUEST_DEFAULT_ERROR: \"Системная ошибка\",\n      [FORBIDDEN]: \"Данное действие недоступно\"\n    },\n    body: JSON.stringify(someData),\n    mode: \"cors\",\n    parseType: \"blob\",\n    queryParams: {\n      id: \"test_id_123\"\n    },\n    headers: {\n      \"Content-Type\": \"application/json\"\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\"))\n    })\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createReviseRequest(\n  someData\n);\n```\n\n### JSON-RPC API\n\n```javascript\nimport { JSONRPCRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createItemsRequest = (someData): Promise<IResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint: \"http://localhost:3000\",\n    errorsMap: {\n      TIMEOUT_ERROR: \"Превышено ожидание запроса\",\n      REQUEST_DEFAULT_ERROR: \"Системная ошибка\"\n    },\n    body: {\n      method: 'some method',\n      params: 123\n    }\n    mode: \"cors\",\n    queryParams: {\n      id: \"123\"\n    },\n    responseSchema: Joi.object({\n      items: Joi.array().items(\n        Joi.object({\n          id: Joi.string().required(),\n          name: Joi.string().required(),\n          name: Joi.string()\n        })\n      )\n    }),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(someData);\n```\n","readmeFilename":"README.md","gitHead":"4fa38ca5468632a0cb1abfe1a7d4ad19c51b9fa3","_id":"@mihanizm56/fetch-api@3.2.0-beta.14","_nodeVersion":"12.13.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-MAhrVig8/Fu+yfMf8L8dY7d+B2b9nWhPtuu/NyZ6jeJxkeLpfWHrAFrLwMRUsTIwYkEngSQzQzYKRmeP+U35vA==","shasum":"76855f8289a9804349318063a93a756a0ad17b05","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.2.0-beta.14.tgz","fileCount":51,"unpackedSize":58499,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJenJk9CRA9TVsSAnZWagAAvF0QAJp0QVzkKaDhKqBYqofo\nPnnFK9IyrvC517e1fj/oV+2S0PAEv3qSuTtfQUKVBCZtK32OC5AHG8+9XAx3\nuj5xdbdrBqjJOAIrSFtMdnu8Te13nR2g43IfYQkOf+5EJGywnrpRJ+rCvbC2\njeIzAo1F3DeZlP5N9PSN+712O0gzZ0QcTtsPXdLujTMxulSRpJI82E6PXwUi\nl5bZNyz6STs8IzjaHGaeoTV6a0EeCsse1ViLLZDwWzZb9YpB2juWTsqFpZKS\nU2RQoTxwGrWrF56+KTCFGGMfbsClXvQU9FxMTe/26se+H947Ok1xBV5QwP5x\neBKpE6nxJ2aQlmPkCFpRo+qiY58pM5qeOCeTevoTCjZ9Fvbkd7sKs5iIRA8N\ncuFAhzuLshGuLXIrMTdoxFspGRxeffJtBx9rx3GHOgQ8Jiom4uoaDeGZOlCN\n0Ee5Q55GsRvdqE6SzkJXTCfEt33LGk+WifzYyNeuTxWCAhxJdItI1xUG1YYY\ngkSxKr3IxMOcJCreyhEdGjA+n2Uof69FU/aU4UXcjtCuN+IKO8w6O7XJJIpY\nMIRWJmGwICqMY5pc76zbelTalJegjO8LWEqNQq8icUMCMQeQdNGzJbLFbca/\nnrxQGA+8D9M731ZBz6J4N3AzPRvWAccNQMX0Nave19nZa0po5ailjaGQS23Q\n5R9u\r\n=qC1p\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDJ17QFMZ6gdBc1mPSje8CeGrQXE0+35uI9w7VFxyHPqwIhAKsxh9cDAxXhsv5WVjVHD0kbb4bunGZ/LZxfBYWnTKbL"}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.2.0-beta.14_1587321149205_0.08392598299271081"},"_hasShrinkwrap":false},"3.2.0-beta.15":{"name":"@mihanizm56/fetch-api","version":"3.2.0-beta.15","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"set CI=true && jest","test:coverage":"jest --coverage","build":"tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint . --ext .ts --fix","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","release":"npm publish --access=public","beta":"npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","node-fetch":"2.6.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.5"},"devDependencies":{"typescript":"3.8.3","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.0.3","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.2.1","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Sollution for http/1.1 isomorphic fetch\n\n### Benefits:\n\n- Provides validation for responses (based on @hapi/joi Schema validation)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize\n- Provides cancel-request if the timeout is higher than 60 seconds\n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error from errorsMap parameter\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure\n- Works in browser and node environments\n\n#### RestRequest input options:\n\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- parseType('json' | 'blob'): the type to parse the response (json by default)\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- errorsMap(object): the object with the errors keys and translated values (TIMEOUT_ERROR and REQUEST_DEFAULT_ERROR fields are required, others must be provided according to the backend errors)\n\n#### RestRequest output options:\n\n- error (boolean) - the flag of the response status\n- errorText (string) - the main error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional multiple errors from the backend\n\n## Examples of usage\n\n### REST API\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### get request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    errorsMap: {\n      TIMEOUT_ERROR: \"Превышено ожидание запроса\",\n      REQUEST_DEFAULT_ERROR: \"Системная ошибка\",\n      [FORBIDDEN]: \"Данное действие недоступно\"\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required()\n          })\n        )\n      })\n    })\n  });\n```\n\n#### post(put/patch/delete have the same format) request\n\n```javascript\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    errorsMap: {\n      TIMEOUT_ERROR: \"Превышено ожидание запроса\",\n      REQUEST_DEFAULT_ERROR: \"Системная ошибка\",\n      [FORBIDDEN]: \"Данное действие недоступно\"\n    },\n    body: JSON.stringify(someData),\n    mode: \"cors\",\n    parseType: \"blob\",\n    queryParams: {\n      id: \"test_id_123\"\n    },\n    headers: {\n      \"Content-Type\": \"application/json\"\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\"))\n    })\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createReviseRequest(\n  someData\n);\n```\n\n### JSON-RPC API\n\n```javascript\nimport { JSONRPCRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createItemsRequest = (someData): Promise<IResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint: \"http://localhost:3000\",\n    errorsMap: {\n      TIMEOUT_ERROR: \"Превышено ожидание запроса\",\n      REQUEST_DEFAULT_ERROR: \"Системная ошибка\"\n    },\n    body: {\n      method: 'some method',\n      params: 123\n    }\n    mode: \"cors\",\n    queryParams: {\n      id: \"123\"\n    },\n    responseSchema: Joi.object({\n      items: Joi.array().items(\n        Joi.object({\n          id: Joi.string().required(),\n          name: Joi.string().required(),\n          name: Joi.string()\n        })\n      )\n    }),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(someData);\n```\n","readmeFilename":"README.md","gitHead":"db3cf0f236b3efb4d3b913645403b8a8c88f60c1","_id":"@mihanizm56/fetch-api@3.2.0-beta.15","_nodeVersion":"12.13.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-5TaX0n1/EeSM5I6+h6LpiSKtGP4iYnDoZHTdGzFqwX9QUhPwfMwRL+CuQF0xbT/OathFTDA80ipogbq7Bigq4Q==","shasum":"8ddd5d71aa418d45ac536df2c6405285974393ca","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.2.0-beta.15.tgz","fileCount":51,"unpackedSize":58593,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJenKdOCRA9TVsSAnZWagAAvycP/27eeR9ZAJlEhotgphKn\nby9agFi0k+9Vbl3Jt3Hb5dIiYBZIhz5mWVdIA6d+8qApf467r+jNfeRGiHy8\ncbmEII6bTDPkXAl+DBB0mCOZfYVNSx1dTJq5sLaN+nmmH/1DzrLEmOI+wwBr\n3+hfiU5wQtKT7fHsDIP1sk7HdQheCevwu212/FqMC9B7cJkCB9JZSwKD8JI8\nyqfG1xUfAnajpyb4InkK4I3/QETpxL4mKiXrUcDDqf0mCsgXFLpPRHWB8MoT\noabW87RXj69Ki/qnSHgA8YsqsjmuIVQHxp2uHVXvZSJze1a+4sdDOzdX6VRc\n/rpSRi7hqnNSoow+2yoVyUPGLqHwZdaahscTT6yoiRKPwE3yWSYlAeyvWS5e\nK3GJ/mb1GAMOK/x2sOhycIiouTpVQcgI/dCZpfPzxhRXYxoLwQTdLN97icop\n478pkn11TxgAbCnQO5WGIzJlc2v2TGc75WV4VnnAgTjsP60KCeNL2ad2Cr6m\nHAFLA5RdA5ILv+QUGmOEWu5A0GR7bPRG+EP/AVMIZHwoN0HdeUCxB3sU+1IB\n34RlRwtUkdJ5yY+Nuvz4c5KmW2AGUc/ejs0EcfgvpnG/wV0mxwr+VEIEkzJC\ndbUiDwJyx51VzhcyO37rBGWVLG/biBXNcaUosv2llZMzrLndKYUPlvaeVvDq\nzeGt\r\n=AgEL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBsejjl89EY8pqXVAeEQipjxdPNoaLNRO42IgXnNylw0AiAKmLeUmTkGXJNbadE21g77yLDIQdCEhs/LuKCoXEemtA=="}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.2.0-beta.15_1587324749811_0.3279757732214108"},"_hasShrinkwrap":false},"3.2.0-beta.16":{"name":"@mihanizm56/fetch-api","version":"3.2.0-beta.16","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"set CI=true && jest","test:coverage":"jest --coverage","build":"tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint . --ext .ts --fix","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","release":"npm publish --access=public","beta":"npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","node-fetch":"2.6.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.5"},"devDependencies":{"typescript":"3.8.3","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.0.3","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.2.1","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Sollution for http/1.1 isomorphic fetch\n\n### Benefits:\n\n- Provides validation for responses (based on @hapi/joi Schema validation)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize\n- Provides cancel-request if the timeout is higher than 60 seconds\n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error from errorsMap parameter\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure\n- Works in browser and node environments\n\n#### RestRequest input options:\n\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- parseType('json' | 'blob'): the type to parse the response (json by default)\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- errorsMap(object): the object with the errors keys and translated values (TIMEOUT_ERROR and REQUEST_DEFAULT_ERROR fields are required, others must be provided according to the backend errors)\n\n#### RestRequest output options:\n\n- error (boolean) - the flag of the response status\n- errorText (string) - the main error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional multiple errors from the backend\n\n## Examples of usage\n\n### REST API\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### get request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    errorsMap: {\n      TIMEOUT_ERROR: \"Превышено ожидание запроса\",\n      REQUEST_DEFAULT_ERROR: \"Системная ошибка\",\n      [FORBIDDEN]: \"Данное действие недоступно\"\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required()\n          })\n        )\n      })\n    })\n  });\n```\n\n#### post(put/patch/delete have the same format) request\n\n```javascript\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    errorsMap: {\n      TIMEOUT_ERROR: \"Превышено ожидание запроса\",\n      REQUEST_DEFAULT_ERROR: \"Системная ошибка\",\n      [FORBIDDEN]: \"Данное действие недоступно\"\n    },\n    body: JSON.stringify(someData),\n    mode: \"cors\",\n    parseType: \"blob\",\n    queryParams: {\n      id: \"test_id_123\"\n    },\n    headers: {\n      \"Content-Type\": \"application/json\"\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\"))\n    })\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createReviseRequest(\n  someData\n);\n```\n\n### JSON-RPC API\n\n```javascript\nimport { JSONRPCRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createItemsRequest = (someData): Promise<IResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint: \"http://localhost:3000\",\n    errorsMap: {\n      TIMEOUT_ERROR: \"Превышено ожидание запроса\",\n      REQUEST_DEFAULT_ERROR: \"Системная ошибка\"\n    },\n    body: {\n      method: 'some method',\n      params: 123\n    }\n    mode: \"cors\",\n    queryParams: {\n      id: \"123\"\n    },\n    responseSchema: Joi.object({\n      items: Joi.array().items(\n        Joi.object({\n          id: Joi.string().required(),\n          name: Joi.string().required(),\n          name: Joi.string()\n        })\n      )\n    }),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(someData);\n```\n","readmeFilename":"README.md","gitHead":"f5b42acf8752c7c64c2d8144a49fe312b7531d6a","_id":"@mihanizm56/fetch-api@3.2.0-beta.16","_nodeVersion":"12.13.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-wDDofPb8zvin2zwU2SSER7ypk5dsCO1n5vi7fHb0K8OAIFYAm1fcRv9yst+KbQUmervbtTmNlCcmBsQDjszKIQ==","shasum":"4d5e275fae2d9c621c4c39d394fb0f7aa97b7302","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.2.0-beta.16.tgz","fileCount":51,"unpackedSize":58530,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJenYxyCRA9TVsSAnZWagAA4lQQAJxifFtvIDcc9ix7a9is\ne/dsLKK7SDmPx2ObHFXy46o+tyo8zid0JC+HfXioT6oyzlNaElSD+bcA5t9m\nmFJ/X6r/9qWJK1V91mto8+fyBEhMf7gyKNL+lWUGzRD4KjBYu1BsyZYn1PaB\nyg/X3GC5Z1uKprygxFmPBDzkZygSGYUnZuF+pL63HlqCG1/OWBxfdyw2EESx\nszfR+kgu3zVrLBlJycJCGDliqZB4wV9QmeTlk0xA5hKfC6jIef5LRTr1g1nc\nnbL+JTPu7f4OzmTX3N5dnjW9VcftZMQZCAOdRv12zgVh9ZPLcXjnucbmqaEd\nHXd0NSnifayMn7j0+qdzLtAJG8Hg7lE444zOfr0Ncq91RN4uCb6EB98qd/hX\nmREx/DJUHljU3YYHkMIRQPly7VxcR3IekbvGrs+iC1jk0FXR/VNHjQ/oZbL1\nwZdVs1hWBg2AotPvuBGqwy+SGl+TKhtoj3muSD5kQRJEyGPsqy/BByK6huTJ\n0h2KfOiV4C1+nI5FEiGxs8ObxeoayP6q1SzSbKS1V9ls/Ilq80OhAJ5fbMPB\nqniO5MgBL6fgEJnDIjFy+lDd8oDus6awyKM9/djSjDhoWNnLu4R2T7NQttmn\n2BwuPKquMcc1V6FR3srf/16BGMqBpWvXKCydoXht3HnaS0GFJBNCieOl1wwP\nAIgk\r\n=23Ek\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIElxbAeSProCbDNxffucjk3Vo5KI7+IRIg0wPOrZaYk2AiATbBdXydgKdWIbWrQqJjTq2g5wfY5unclF9CShtlBTLQ=="}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.2.0-beta.16_1587383409745_0.8887772014196254"},"_hasShrinkwrap":false},"3.2.0-beta.17":{"name":"@mihanizm56/fetch-api","version":"3.2.0-beta.17","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"set CI=true && jest","test:coverage":"jest --coverage","build":"tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint . --ext .ts --fix","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","release":"npm publish --access=public","beta":"npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","node-fetch":"2.6.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.5"},"devDependencies":{"typescript":"3.8.3","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.0.3","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.2.1","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Sollution for http/1.1 isomorphic fetch\n\n### Benefits:\n\n- Provides validation for responses (based on @hapi/joi Schema validation)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize\n- Provides cancel-request if the timeout is higher than 60 seconds\n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error from errorsMap parameter\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure\n- Works in browser and node environments\n\n#### RestRequest input options:\n\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- parseType('json' | 'blob'): the type to parse the response (json by default)\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- errorsMap(object): the object with the errors keys and translated values (TIMEOUT_ERROR and REQUEST_DEFAULT_ERROR fields are required, others must be provided according to the backend errors)\n\n#### RestRequest output options:\n\n- error (boolean) - the flag of the response status\n- errorText (string) - the main error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional multiple errors from the backend\n\n## Examples of usage\n\n### REST API\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### get request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    errorsMap: {\n      TIMEOUT_ERROR: \"Превышено ожидание запроса\",\n      REQUEST_DEFAULT_ERROR: \"Системная ошибка\",\n      [FORBIDDEN]: \"Данное действие недоступно\"\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required()\n          })\n        )\n      })\n    })\n  });\n```\n\n#### post(put/patch/delete have the same format) request\n\n```javascript\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    errorsMap: {\n      TIMEOUT_ERROR: \"Превышено ожидание запроса\",\n      REQUEST_DEFAULT_ERROR: \"Системная ошибка\",\n      [FORBIDDEN]: \"Данное действие недоступно\"\n    },\n    body: JSON.stringify(someData),\n    mode: \"cors\",\n    parseType: \"blob\",\n    queryParams: {\n      id: \"test_id_123\"\n    },\n    headers: {\n      \"Content-Type\": \"application/json\"\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\"))\n    })\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createReviseRequest(\n  someData\n);\n```\n\n### JSON-RPC API\n\n```javascript\nimport { JSONRPCRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createItemsRequest = (someData): Promise<IResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint: \"http://localhost:3000\",\n    errorsMap: {\n      TIMEOUT_ERROR: \"Превышено ожидание запроса\",\n      REQUEST_DEFAULT_ERROR: \"Системная ошибка\"\n    },\n    body: {\n      method: 'some method',\n      params: 123\n    }\n    mode: \"cors\",\n    queryParams: {\n      id: \"123\"\n    },\n    responseSchema: Joi.object({\n      items: Joi.array().items(\n        Joi.object({\n          id: Joi.string().required(),\n          name: Joi.string().required(),\n          name: Joi.string()\n        })\n      )\n    }),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(someData);\n```\n","readmeFilename":"README.md","gitHead":"f5b42acf8752c7c64c2d8144a49fe312b7531d6a","_id":"@mihanizm56/fetch-api@3.2.0-beta.17","_nodeVersion":"12.13.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-LG6IjFEcNnIyVMdn4rq1B4snBzOmft0CUlsemEde/52z0rJs+c69yv9VIIHGecZ6hmnKg9d2N/ElMfpD/Ld0Sg==","shasum":"093ade131637aec81ba45a924b855eaa4a163e5b","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.2.0-beta.17.tgz","fileCount":51,"unpackedSize":58752,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeniXLCRA9TVsSAnZWagAAjO0QAIVqAMAql3WT3pUeXPl9\nOa7I9Q1+Z3sgaBaJzoztUjDWlPKoWQgxGdfJaOmHvv68MCq+JT/FqsayWMun\nvx7oT6PYepzuUkmwR4krNtWa0GqNc2VsPipyyNEj0YPdlyssBwQJZYHpfp9w\nhJ/ED8CRpT16sQYUdCIXDOx1UGMJU9CXDwvpNG0G6rZXh0a3WzWUdV6+c2Hf\nLTnUneo3JKC0XE7yIgcfOZ/73vg/L2E1bWrWryoqmKtroKNFuS+q1FP8851+\nZ+KGmWCyw7zC1ieSaq+66otrqRtF8lqMn2ZQ6fD6DXCxSL+c6FzVNXSIp1B5\njGq7fkrEIqBnH6axR04SW//9H3VC52FdyZIASTzE46y1xgUk/8XHZB5265+B\nWkGVqiSxZb+Qrm5ad7cs7QVMSOQ+XvhocGIos9/Wnil8WGNOE957MKcyAxgp\nGHLfflsh37c0zLTr6s34l1xrAk5syIBW+eC+NAQnR8SFIMj9+n00cGDyQHfo\nS09bIrsOx3nOMryb+tOuIl9seYt0RwhUryyD+a0YGApCrPPbwLkRqA+guGSy\nK8bXEKrBVF2Gh7GXbxm90VflFD5OEuTEnDpqR6i9+MiAk8VG/Kn2R+UlWcZJ\nRLCThqPPzMeRgvZt08Gg4gW/fvhNIK/1DDeB5flVuDvSlppR9tEnqxhxvSI4\nJ942\r\n=8w/U\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCSQJkZLUcQ06Txps8P0QulQxRnkWq4CUied10ExELN+gIgXDVYBM8q/PvbFrQE8jQQVEoZCiuMFWvpMWsnmTioOT0="}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.2.0-beta.17_1587422667331_0.5505250387210088"},"_hasShrinkwrap":false},"3.2.0-beta.18":{"name":"@mihanizm56/fetch-api","version":"3.2.0-beta.18","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"set CI=true && jest","test:coverage":"jest --coverage","build":"tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint . --ext .ts --fix","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","release":"npm publish --access=public","beta":"npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","node-fetch":"2.6.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.5"},"devDependencies":{"typescript":"3.8.3","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.0.3","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.2.1","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Sollution for http/1.1 isomorphic fetch\n\n### Benefits:\n\n- Provides validation for responses (based on @hapi/joi Schema validation)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize\n- Provides cancel-request if the timeout is higher than 60 seconds\n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error from errorsMap parameter\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure\n- Works in browser and node environments\n\n#### RestRequest input options:\n\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- parseType('json' | 'blob'): the type to parse the response (json by default)\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- errorsMap(object): the object with the errors keys and translated values (TIMEOUT_ERROR and REQUEST_DEFAULT_ERROR fields are required, others must be provided according to the backend errors)\n\n#### RestRequest output options:\n\n- error (boolean) - the flag of the response status\n- errorText (string) - the main error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional multiple errors from the backend\n\n## Examples of usage\n\n### REST API\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### get request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    errorsMap: {\n      TIMEOUT_ERROR: \"Превышено ожидание запроса\",\n      REQUEST_DEFAULT_ERROR: \"Системная ошибка\",\n      [FORBIDDEN]: \"Данное действие недоступно\"\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required()\n          })\n        )\n      })\n    })\n  });\n```\n\n#### post(put/patch/delete have the same format) request\n\n```javascript\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    errorsMap: {\n      TIMEOUT_ERROR: \"Превышено ожидание запроса\",\n      REQUEST_DEFAULT_ERROR: \"Системная ошибка\",\n      [FORBIDDEN]: \"Данное действие недоступно\"\n    },\n    body: JSON.stringify(someData),\n    mode: \"cors\",\n    parseType: \"blob\",\n    queryParams: {\n      id: \"test_id_123\"\n    },\n    headers: {\n      \"Content-Type\": \"application/json\"\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\"))\n    })\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createReviseRequest(\n  someData\n);\n```\n\n### JSON-RPC API\n\n```javascript\nimport { JSONRPCRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createItemsRequest = (someData): Promise<IResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint: \"http://localhost:3000\",\n    errorsMap: {\n      TIMEOUT_ERROR: \"Превышено ожидание запроса\",\n      REQUEST_DEFAULT_ERROR: \"Системная ошибка\"\n    },\n    body: {\n      method: 'some method',\n      params: 123\n    }\n    mode: \"cors\",\n    queryParams: {\n      id: \"123\"\n    },\n    responseSchema: Joi.object({\n      items: Joi.array().items(\n        Joi.object({\n          id: Joi.string().required(),\n          name: Joi.string().required(),\n          name: Joi.string()\n        })\n      )\n    }),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(someData);\n```\n","readmeFilename":"README.md","gitHead":"ec0b0167a2314e1a0b2a7a69e0e0b0c326bf75d4","_id":"@mihanizm56/fetch-api@3.2.0-beta.18","_nodeVersion":"12.13.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-iRav6mf8X/ZlWTZlo3nweZyK2sK1iash6DnmKPQt0YGnLHvXSxGPWqy/qktEifX3jyt6Uxv6vH5TaZlZDDYQ0Q==","shasum":"09aca0820fb89b3834e70dabf8cd4e2ecccf3ad9","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.2.0-beta.18.tgz","fileCount":51,"unpackedSize":58792,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeni8OCRA9TVsSAnZWagAAip0P/iTwvuMwBeLJIPYOiVHW\n1qt6yhetVInae4i9Bn2IgXxsfi1TIMGcr8oHVU6Hc/gaB7kHonJrZpd57Ujd\ngFpudpoTrFTegCJOeU0sHlw2mYheRiF8c63K7yrmoooMoWAo/msReZLOsaY2\nedcWx4MRIMiWqx2vn506HTgmLqEbOrIIcnqPIKai6B2Nz1QciM8bdIbCsjjf\np7jd76gZvxfw9k0CuVUoAuCSC5Br0Bv2gQvR+U08a5PdpN0FG9RpuTQhxQU2\nUjIczXU7aHkwPHuIbYiGLdF1TG89BkfPGEJmrQTLejlfEE2R9ipcyNT6DLvp\nlaK+Ejm0qskm+PQuKoc/jBAiwe0tv/KockfUDIXhELbNHg4Ik/7gpXAKS9gr\ndoSzD+z9FqHJnnk/N2F6/0JvYpq7PtEybgBZL7deyHP/iFlaqEFhYu4hxz9R\ntvcBHUMHoiJ7PKRWTOsJKYBnPQ0UMhx4EIgpz7uzs/f7AC8AUiKf72hLOn3L\n/I00mkCJs5wrS8BnFQ1qbjBHKHOldnmCdmPViCGkKYTkbukNdajcQJx7WKJv\nQHTM/AZVk8+jqDCPDNDUVklB02U72jTEKn2CiDcCKZxAP5zTBlvJuvIPf2RA\n9JLI9soQGwXEaTE5kE1Cs5uqDWXkMaYo6xnRPUSCv27+I91/ZLnoUwuv+/qz\ngXyR\r\n=M7Nj\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFunMqTwPHEivwr6hPlu60LWyCrmfX9Gxm2hv77hBTJhAiEAt0XOBK0qZDb+YzDX/cluek8HBzSUM+jNuCu4483I2mk="}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.2.0-beta.18_1587425038281_0.6846975298255251"},"_hasShrinkwrap":false},"3.2.0-beta.19":{"name":"@mihanizm56/fetch-api","version":"3.2.0-beta.19","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"set CI=true && jest","test:coverage":"jest --coverage","build":"tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint . --ext .ts --fix","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","release":"npm publish --access=public","beta":"npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","node-fetch":"2.6.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.5"},"devDependencies":{"@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"^4.0.4","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.2.1","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript":"3.8.3","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Sollution for http/1.1 isomorphic fetch\n\n### Benefits:\n\n- Provides validation for responses (based on @hapi/joi Schema validation)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize\n- Provides cancel-request if the timeout is higher than 60 seconds\n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error from errorsMap parameter\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure\n- Works in browser and node environments\n\n#### RestRequest input options:\n\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- parseType('json' | 'blob'): the type to parse the response (json by default)\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- errorsMap(object): the object with the errors keys and translated values (TIMEOUT_ERROR and REQUEST_DEFAULT_ERROR fields are required, others must be provided according to the backend errors)\n\n#### RestRequest output options:\n\n- error (boolean) - the flag of the response status\n- errorText (string) - the main error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional multiple errors from the backend\n\n## Examples of usage\n\n### REST API\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### get request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    errorsMap: {\n      TIMEOUT_ERROR: \"Превышено ожидание запроса\",\n      REQUEST_DEFAULT_ERROR: \"Системная ошибка\",\n      [FORBIDDEN]: \"Данное действие недоступно\"\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required()\n          })\n        )\n      })\n    })\n  });\n```\n\n#### post(put/patch/delete have the same format) request\n\n```javascript\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    errorsMap: {\n      TIMEOUT_ERROR: \"Превышено ожидание запроса\",\n      REQUEST_DEFAULT_ERROR: \"Системная ошибка\",\n      [FORBIDDEN]: \"Данное действие недоступно\"\n    },\n    body: JSON.stringify(someData),\n    mode: \"cors\",\n    parseType: \"blob\",\n    queryParams: {\n      id: \"test_id_123\"\n    },\n    headers: {\n      \"Content-Type\": \"application/json\"\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\"))\n    })\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createReviseRequest(\n  someData\n);\n```\n\n### JSON-RPC API\n\n```javascript\nimport { JSONRPCRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createItemsRequest = (someData): Promise<IResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint: \"http://localhost:3000\",\n    errorsMap: {\n      TIMEOUT_ERROR: \"Превышено ожидание запроса\",\n      REQUEST_DEFAULT_ERROR: \"Системная ошибка\"\n    },\n    body: {\n      method: 'some method',\n      params: 123\n    }\n    mode: \"cors\",\n    queryParams: {\n      id: \"123\"\n    },\n    responseSchema: Joi.object({\n      items: Joi.array().items(\n        Joi.object({\n          id: Joi.string().required(),\n          name: Joi.string().required(),\n          name: Joi.string()\n        })\n      )\n    }),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(someData);\n```\n","readmeFilename":"README.md","gitHead":"9e40d803e3a1352c85acc848b56c8f7c8a9a3b0f","_id":"@mihanizm56/fetch-api@3.2.0-beta.19","_nodeVersion":"12.13.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-W99iAY/KEfGOhX32+FfVWagVu1zLNveCjw8JFGEKRT9gX805BA/VnQcRdU5Bw/f82p9yNqwzzdw3Kii84x8KPg==","shasum":"96ea2afff3c35c5c3f8a89a5d7ce2dd0bf69b636","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.2.0-beta.19.tgz","fileCount":51,"unpackedSize":58998,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJenstDCRA9TVsSAnZWagAAhu4P/jJ3GR2nOLMrJJPawxWx\nDBZNGAgSGh6ULEhke34p/NNj80c6KnGW93LrwJ9/ZaAjDLu2pSOs3FhIYj5p\nbmJl0xwZg1MZwqMeW0CXbDNeZ5fl7+ygEFg+Ez0iNMYm3dmsPsyWsiwu199P\nFrH46pblEuZ3mRiHNCg8np73EFVwd7L1ozayfpPu5vd1eP8Ff0MO+pmyoOPr\nkyegYNvsFcacY2D1lQX45GslKZSygpLIw4AI+5VS2w/Oir6Mq2d9w5zQX0Q6\nmcB214PFAmrauczgNjaOVB3WD4W1DD0o0MRYvJAZDpqkxA7tW5ZbIR6OMiyZ\nrB+b+3zQWTOePBkEwKuU90JxTlIvAY9hM7fPrP6UAkt6+kH+SnpsoosycKIp\nj3pprOdNVWAl0ZXH6O9CP0n4O3x8JzFBmtQm5jfj8y252GTiTMwrtQ/HssbH\naGisp/T8BZrmUvVxlLbnU8FAzO6M6n5+ZFf3gNtyITrt4n6zzecuF0xmtnao\n2FfVfn4E3ur3v8yEOtXurs/u/iAbYHkDS9UVIi7k1uEnJAEVfoVcH4QUvVnJ\nriLSDbcyXAnWPsRe7l+C3yV1WgEi9lBkKYoTCKt2IES+8ulTL72bDgbMBa1F\nIQJa9JNh0sWMSM5b3KdFuKV2b5+/kxaB4tE/jqEtRMk/nuSqfpaeZaESshpi\nEcMB\r\n=/hjs\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDmuMhyXVLP4peJPlKkaeSKoPHALosUtDh5an3Cmi7V1wIgDWV7xD0k5Xg+UqTYrQUQoBAYiJrIbpcZQOZXeMLfv0c="}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.2.0-beta.19_1587465026595_0.9613477659846037"},"_hasShrinkwrap":false},"3.2.1":{"name":"@mihanizm56/fetch-api","version":"3.2.1","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"set CI=true && jest","test:coverage":"jest --coverage","build":"tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint . --ext .ts --fix","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","release":"npm publish --access=public","beta":"npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","node-fetch":"2.6.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.5"},"devDependencies":{"@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"^4.0.4","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.2.1","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript":"3.8.3","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"gitHead":"35c113d551c3d5a1547cf304db66524053eacb3d","_id":"@mihanizm56/fetch-api@3.2.1","_nodeVersion":"12.13.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-F1I6mIDq6I3p8LKYwE6TrpFMM1fM8bQJj7vSwEBzzm/xHdsHjHrW4lJNOrvTsnANCv/C9TombQHboGCOxOPHdw==","shasum":"2ccbdfbecef0282e0bbba0bc74faa01cfda2e131","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.2.1.tgz","fileCount":51,"unpackedSize":58990,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJen5vtCRA9TVsSAnZWagAAgOgQAJ+XbxaT04oWKPX2k6hu\nv3KAbLMKGW7BIQOh0LYTIK67qa7LxmvTgEmNua0e7M2Wif+xUnCXx5ec5RZF\n83PgbSFEUmkpb8ISbKb8OSslf9KY/LL0rcVsD+4Y6JCFlHjBLKg/3kBYsLsO\nAXLi6zmBGWNt36KEpiFjyB7tpvtI4t60sM3FphdgyZkkgJc5+OJemikyPjpt\nuMpaSNRPRmzbSVdPP355NqLItKhz+GXyr1D1VaQsuY6TuaaYJl8vqQzOJp53\nH8eSycJinPOqLB2KRZhi5EbNnVVNJ9RATbvPaHmclIDzmeRxT1nQRWo4wtC4\n9qxd/z0Rf8Kotg6gwLVvluMPxHGkuseLSd1x2uRJhhYxs5kx3Z0rGP3fili1\nNQOq3Zk+04+k9pcTu7X9/4lp0QOxOy8dsl8AOEl7nfCEPr7meyKkckcsTdTb\nPJnvu+TfftzaaIHwgZsE9E+4EGpJKFdpqAn1MXAW+5HtZddijMi035loUGOd\nd4sL8j5nT6dVlvMl/mTeTSQ4NjE+OnXnwme7435NCbZRwaluVxEW0QkcC1gk\nAvOBAaU6LzUoVtKKGyEC1LxLAjJ6yuryFbanx6omuh7DeYk2szJzO+Iarsw0\n+wNDAQFEEdxGnYQLEJtps0w30LONCY4rnoiwhtbWu58b3v90mAAxOOGjue/y\nNTcS\r\n=5+Md\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCqXEn7G8pz+nBwO4hNQ8COMxcNN6fJweVH3BN5Dm3quwIhAL4Mna4+vtbh4JeelRab/3XDgDvibXlvk3SB7pYblvgU"}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.2.1_1587518445307_0.23827383146681558"},"_hasShrinkwrap":false},"3.3.0-beta.0":{"name":"@mihanizm56/fetch-api","version":"3.3.0-beta.0","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"set CI=true && jest","test:coverage":"jest --coverage","build":"tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint . --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","release":"npm publish --access=public","beta":"npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","node-fetch":"2.6.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.5"},"devDependencies":{"@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.0.4","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"^25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript":"3.8.3","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Sollution for http/1.1 isomorphic fetch\n\n### Benefits:\n\n- Provides validation for responses (based on @hapi/joi Schema validation)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize\n- Provides cancel-request if the timeout is higher than 60 seconds\n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error from langDict parameter\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure\n- Works in browser and node environments\n\n#### RestRequest input options:\n\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- parseType('json' | 'blob'): the type to parse the response (json by default)\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- langDict(object): the object with the errors keys and translated values ('timeout error' and 'timeout error' others must be provided by default - others must be provided from the whole language dictionary)\n\n#### RestRequest output options:\n\n- error (boolean) - the flag of the response status\n- errorText (string) - the main error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional multiple errors from the backend\n\n## Examples of usage\n\n### REST API\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### get request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    langDict = {\n      'network-error': {\n        text: 'Системная ошибка',\n      },\n      'timeout-error': {\n        text: 'Превышено время ожидания ответа',\n      },\n      'test error': {\n        text: 'Тестовая ошибка',\n      },\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          }).unknown()\n        ),\n      }).unknown(),\n    }).unknown(),\n  });\n```\n\n#### post(put/patch/delete have the same format) request\n\n```javascript\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    langDict = {\n      'network-error': {\n        text: 'Системная ошибка',\n      },\n      'timeout-error': {\n        text: 'Превышено время ожидания ответа',\n      },\n    },\n    body: JSON.stringify(someData),\n    mode: \"cors\",\n    parseType: \"blob\",\n    queryParams: {\n      id: \"test_id_123\",\n    },\n    headers: {\n      \"Content-Type\": \"application/json\",\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\")),\n    }).unknown(),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createReviseRequest(\n  someData\n);\n```\n\n### JSON-RPC API\n\n```javascript\nimport { JSONRPCRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createItemsRequest = (someData): Promise<IResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint: \"http://localhost:3000\",\n    langDict = {\n      'network-error': {\n        text: 'Системная ошибка',\n      },\n      'timeout-error': {\n        text: 'Превышено время ожидания ответа',\n      },\n    },\n    body: {\n      method: 'some method',\n      params: 123\n    }\n    mode: \"cors\",\n    queryParams: {\n      id: \"123\"\n    },\n    responseSchema: Joi.object({\n      items: Joi.array().items(\n        Joi.object({\n          id: Joi.string().required(),\n          name: Joi.string().required(),\n          name: Joi.string()\n        }).unknown()\n      )\n    }).unknown(),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n","readmeFilename":"README.md","gitHead":"1404d06ce1240be26ca62674ed5aacddc85a22f9","_id":"@mihanizm56/fetch-api@3.3.0-beta.0","_nodeVersion":"12.13.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-qPBF6IKgdZ4TdQXig26dB6Myc7oHEEBnUqWi8cttJlDkccf4k6R2r2ZEdN92dot3p+l1sTtuji+e1Or+BLu1jA==","shasum":"c82713da508dbcbcf639543736ec968a65a35d9b","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.3.0-beta.0.tgz","fileCount":53,"unpackedSize":61151,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeq4HcCRA9TVsSAnZWagAAKeIP/03SXkv1i/kAt1UQRLeI\nUj8VeU5JwDvP449TEmLj1mGbhNZ9lGSBb7jsff+aRW9OgC+l/j+n2XosY6IG\n0/tm2FKEheBjn/5hPV7Tq6nZK6bF+4lgQR8ph+H36rsu+wxGdpMBXkj+4N47\nJebytpLJXUhPTisEcZqNR6Pu9Jjsj+qLzWz4ql8VDYWSxmJBzeGFM1KccIPB\nDwKpscUMWJCxcxb/e0bHX9E/VVKoSMJVwXG7c8QKdgJ1RdE34trXfLyyd1jt\nkt7etj8GE9h5m7EGv2DKB7iJd/OWCLeROVX2qiuJTspy2PDUUDTyhRoD5D3o\n7bcZnUxftGbmSd+MSGz+YGzC7Sh/EFkxJnN+WwPUhXoPgZ6MynWuiEw0tB1o\nE3hYPjvRFxuMB6yFdi0pK4p6dbZkoFiPt8MxfD6HuYxcL5N1y2yJnc365Csm\nm29uTJD+fS4NctQM1oW6aPUv93K5+hGc9pYGQ6KacLAjvNvHltMLYQHXenjD\nDMS8ZWtuAgmeRjTl7YI6AEtGD9Y+RusIA7lGOR5YBk9AaE7Z9ZgcDsmXqPwB\nSfCDKx1IDjXBK/fq3k5L0/Xt+mRgA5tFO1GUDrkTercKRSVaDGZjTiwNlfjX\nt6GWbN+pO4JHKbVkDvx2qBXWM6rLTXC8Qi0H+cctAy3yfy2TTauP+rs7AKfF\nrapT\r\n=O3HS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDX+2ml1iNLAkBMKaWfDbCabj/SnQUBMGD+4LvdBgAeIAIgFYpMXwzbWSZC7E9R658mfvHfPs5ylfdppOl557wmqKM="}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.3.0-beta.0_1588298203304_0.27632904774713607"},"_hasShrinkwrap":false},"3.3.0-beta.1":{"name":"@mihanizm56/fetch-api","version":"3.3.0-beta.1","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"set CI=true && jest","test:coverage":"jest --coverage","build":"tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint . --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","release":"npm publish --access=public","beta":"npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","node-fetch":"2.6.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.5"},"devDependencies":{"@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.0.4","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"^25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript":"3.8.3","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Sollution for http/1.1 isomorphic fetch\n\n### Benefits:\n\n- Provides validation for responses (based on @hapi/joi Schema validation)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize\n- Provides cancel-request if the timeout is higher than 60 seconds\n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure\n- Works in browser and node environments\n\n#### RestRequest input options:\n\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- parseType('json' | 'blob'): the type to parse the response (json by default)\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n\n#### RestRequest output options:\n\n- error (boolean) - the flag of the response status\n- errorText (string) - the main error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional multiple errors from the backend\n\n## Examples of usage\n\n### REST API\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### get request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          }).unknown()\n        ),\n      }).unknown(),\n    }).unknown(),\n  });\n```\n\n#### post(put/patch/delete have the same format) request\n\n```javascript\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    body: JSON.stringify(someData),\n    mode: \"cors\",\n    parseType: \"blob\",\n    queryParams: {\n      id: \"test_id_123\",\n    },\n    headers: {\n      \"Content-Type\": \"application/json\",\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\")),\n    }).unknown(),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createReviseRequest(\n  someData\n);\n```\n\n### JSON-RPC API\n\n```javascript\nimport { JSONRPCRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createItemsRequest = (someData): Promise<IResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint: \"http://localhost:3000\",\n    body: {\n      method: 'some method',\n      params: 123\n    }\n    mode: \"cors\",\n    queryParams: {\n      id: \"123\"\n    },\n    responseSchema: Joi.object({\n      items: Joi.array().items(\n        Joi.object({\n          id: Joi.string().required(),\n          name: Joi.string().required(),\n          name: Joi.string()\n        }).unknown()\n      )\n    }).unknown(),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n","readmeFilename":"README.md","gitHead":"a364f6a7065dcc8b6ec2f621507f211fbccf5bc5","_id":"@mihanizm56/fetch-api@3.3.0-beta.1","_nodeVersion":"12.13.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-wTDLtbIbr/UcsLgMN3nxi9VXYKdVP7yn+1tG5q+B8mm8AGcdItmmQr6RqG+LlQCs3dgtdVYlYLclSDwvTA3vAw==","shasum":"cb3b69dadd9a47b0579a28c8093d51df04c911a9","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.3.0-beta.1.tgz","fileCount":53,"unpackedSize":60199,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeq4J8CRA9TVsSAnZWagAAHJoP/1Pxx4HmodU1i/TRohCO\nZRwyO5CdJtgZZ2l75ZEigrmSd3aYH6VZ2B+oXodtoPLqKxuHBPu4MX/xK7vv\nFjPatmMaJvGyP/Bjt6jblWhtdLPbKbybUmcEi/vmQWHDHVPZW5iTkZBhI5ik\nNhu3rSd0y703fCT7VzqEw/PWMYyIImn+oKQXtnSp3y20lipzdTxLCCTu9bKf\nwXU31jA73rM48fyFFyAyoIIkwAmgLSRGCKUYvnVOP6gQ+f7KwblgnmarTYjN\nPh8+kZF8IsdiCmekDSkv/TkSNED6nxcNabD0PbglhpUowiB26pMF6oHjeHDW\n/ayOj4DKqEaeZsTexZjfeq3C4JJX+x93tqDB8lA5vTd2JJSmtTEx6FamFh09\nVYlzM/D83UWI84+Hkr67JSFZQG1jWciWn8Vrq1WHtP+ExASHMoAW1ny5DnHV\n1BRRkwbMkejpFGiEzELc+ZUaeZx0C/N6E6Imo5WzHuxqi4hhlWaFuojSaP5A\nmhMypYfhOYQ5QnBNv/fo3C14LkGwAlImv6LW5asAvrauaOPvt9+CPQUHczo7\n+OlpwPKmQXJ2Fcg8wJI8hY7ZINadSDnZNHL4fvxe0HkoGqdphmREN3P7C2pC\n2YwGnkIDSXUDce5KhgiRjNWe5rGERyFeR9WRWRNdFkiPAUaBPfe9vRO/4UPs\nJMsA\r\n=5/Bx\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFkmNTDKfJS3yq/QUy0A7O1SrMGJXSngjsOBXy6TafUsAiByytJfVtkLzgoGy0QUCvlRSEEGWdTF2sjgdllciNp4mg=="}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.3.0-beta.1_1588298363685_0.43393097064157415"},"_hasShrinkwrap":false},"3.3.0-beta.2":{"name":"@mihanizm56/fetch-api","version":"3.3.0-beta.2","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint . --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","release":"npm publish --access=public","beta":"npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","node-fetch":"2.6.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.5"},"devDependencies":{"@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.0.4","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"^25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript":"3.8.3","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Sollution for http/1.1 isomorphic fetch\n\n### Benefits:\n\n- Provides validation for responses (based on @hapi/joi Schema validation)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize\n- Provides cancel-request if the timeout is higher than 60 seconds\n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure\n- Works in browser and node environments\n\n#### RestRequest input options:\n\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- parseType('json' | 'blob'): the type to parse the response (json by default)\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n\n#### RestRequest output options:\n\n- error (boolean) - the flag of the response status\n- errorText (string) - the main error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional multiple errors from the backend\n\n## Examples of usage\n\n### REST API\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### get request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          }).unknown()\n        ),\n      }).unknown(),\n    }).unknown(),\n  });\n```\n\n#### post(put/patch/delete have the same format) request\n\n```javascript\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    body: JSON.stringify(someData),\n    mode: \"cors\",\n    parseType: \"blob\",\n    queryParams: {\n      id: \"test_id_123\",\n    },\n    headers: {\n      \"Content-Type\": \"application/json\",\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\")),\n    }).unknown(),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createReviseRequest(\n  someData\n);\n```\n\n### JSON-RPC API\n\n```javascript\nimport { JSONRPCRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createItemsRequest = (someData): Promise<IResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint: \"http://localhost:3000\",\n    body: {\n      method: 'some method',\n      params: 123\n    }\n    mode: \"cors\",\n    queryParams: {\n      id: \"123\"\n    },\n    responseSchema: Joi.object({\n      items: Joi.array().items(\n        Joi.object({\n          id: Joi.string().required(),\n          name: Joi.string().required(),\n          name: Joi.string()\n        }).unknown()\n      )\n    }).unknown(),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n","readmeFilename":"README.md","gitHead":"a364f6a7065dcc8b6ec2f621507f211fbccf5bc5","_id":"@mihanizm56/fetch-api@3.3.0-beta.2","_nodeVersion":"12.13.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-6MDMQW1V0TyI6IhCUoGLJKYhDPVHiF2DjDJdwomw6pk79IID6it8BBz0tOluF1bXlqB2fKurARQVdHBFV91ENA==","shasum":"8e9c28c29f3c2407fc46372bd14007a965ce59db","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.3.0-beta.2.tgz","fileCount":47,"unpackedSize":58327,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJesI3zCRA9TVsSAnZWagAAuMYP/0dW1EdUFog7mPbs8ExL\nE+XRh8nMlB5x4ajCrZX50ZzCRNr/dobGYWqEDDjWLbAk4y60zCMIFhhSPatA\nIzdNTc2rfoze5Q60gjj/yhwNqXqirktK+Qkxqxu2qlL4bdGZm163aNczK6mH\na8eE0efFSsWgoDsI+zRXVuAZTHxumLO//7bGfCK3zr2vOL+JgOaclIyUa9Uv\nYUMYwvsqz6yAZdzprgBvhN/XIeGO55SZxX3KXYWIUiPY4o/J3rpXt7TZIoh0\nns8XmDsV8UwbFN9V/1VsXjWFL23ZnLp1g5LI4GBfmI8l4pRcTo6t9039rbFD\nEZCdY6wOJMH3tPQXFJ0CUKKyamo+PH+hsWtAhujXbKrQBJh0CJc9662FTp3W\nOfx4TqTotSLLZx+ZzR0AB089RFya+s1cmCJ9GPJTFKxA+GmcQ4plemFkvvNa\nhB85MGqZpUHttDLmwv1qFaRzQku7f2SN9Qs8/oH3qv8bVJS2cGKXJqjkjhPr\nOcj1hdppYDIB4Dbwk69C5Nkc534gMuAVvGChv0JW+Kw0auG4uO3WDZ0rBsk0\nzJXk/3l/MQObD1QrJmn8vnObGWKdz596/CcoUDQsd92ohiXzPwXOSTxtUkMN\nLea+he2nlw1mNQ3UkH95kTtCAema8z8ZmyBYpbskebfDBs+PZxBOKYL8OXDx\n5d+H\r\n=IiQ/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD3kL6/GTt2wyj4rWQvelTx1ybpbpHgF/sJZTHgBY1mCAIhANj/HU9i6hnDyd91Wge+81Me9TwdX/391Njjy5hPoAR5"}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.3.0-beta.2_1588628978520_0.18420375935849265"},"_hasShrinkwrap":false},"3.3.0-beta.5":{"name":"@mihanizm56/fetch-api","version":"3.3.0-beta.5","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint . --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","release":"npm publish --access=public","beta":"npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","node-fetch":"2.6.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.5"},"devDependencies":{"@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.0.4","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"^25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript":"3.8.3","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Sollution for http/1.1 isomorphic fetch\n\n### Benefits:\n\n- Provides validation for responses (based on @hapi/joi Schema validation)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize\n- Provides cancel-request if the timeout is higher than 60 seconds\n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure\n- Works in browser and node environments\n\n#### RestRequest input options:\n\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- parseType('json' | 'blob'): the type to parse the response (json by default)\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n\n#### RestRequest output options:\n\n- error (boolean) - the flag of the response status\n- errorText (string) - the main error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional multiple errors from the backend\n\n## Examples of usage\n\n### REST API\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### get request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          }).unknown()\n        ),\n      }).unknown(),\n    }).unknown(),\n  });\n```\n\n#### post(put/patch/delete have the same format) request\n\n```javascript\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    body: JSON.stringify(someData),\n    mode: \"cors\",\n    parseType: \"blob\",\n    queryParams: {\n      id: \"test_id_123\",\n    },\n    headers: {\n      \"Content-Type\": \"application/json\",\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\")),\n    }).unknown(),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createReviseRequest(\n  someData\n);\n```\n\n### JSON-RPC API\n\n```javascript\nimport { JSONRPCRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createItemsRequest = (someData): Promise<IResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint: \"http://localhost:3000\",\n    body: {\n      method: 'some method',\n      params: 123\n    }\n    mode: \"cors\",\n    queryParams: {\n      id: \"123\"\n    },\n    responseSchema: Joi.object({\n      items: Joi.array().items(\n        Joi.object({\n          id: Joi.string().required(),\n          name: Joi.string().required(),\n          name: Joi.string()\n        }).unknown()\n      )\n    }).unknown(),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n","readmeFilename":"README.md","gitHead":"a364f6a7065dcc8b6ec2f621507f211fbccf5bc5","_id":"@mihanizm56/fetch-api@3.3.0-beta.5","_nodeVersion":"12.13.0","_npmVersion":"6.14.5","dist":{"integrity":"sha512-yZtjVfsA/4csajT24QtdQCpltkmnDxWgsJdA+lFHifITYeveVQwUvrDS1LhVfSSrZkutWcO7kL9WrqgI0qLcvA==","shasum":"ee72985c22e64fde15395c6f0bc9d58df0b02077","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.3.0-beta.5.tgz","fileCount":47,"unpackedSize":58184,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJes0/fCRA9TVsSAnZWagAAcl0P/RIlnxUoNJlR3VqVqsT2\nm67Gnbg7t7bLTZXPiNoUhtx2MNdHZC1s9sJCjg0AWQF3FvyWq0UfcWUI/pnW\noxzZhIeEF22aiw6Q0HzF+PkQ5EiyOu9xYLOocYWQds5k+bqdllZsjJp3S32v\nCvFKfJPNKqftnSkiDh9+ix6aTWM3uYPhduQ1bgynnCIhsYBlm3piFV2rbe41\nz4ctJlBo7cVaHVPc1w6Fx7CmHf/QDEc1eqNI1LibGI2nj4W/tnHsqRgTeyxa\n83uzK7XiXn3ZVRHjYHwaxhlX/b8Ogvi0gy+Knr1kn1Wij2mu4nili9AVhaLa\nyoXmMTeEKynQtumDKO2NX8mbi7QHLcKz4JX7lxXil4EzCswnHBDz6fdiZDV1\nHxpNiFvlUnRaUeaWRPCGpqWewBT04RxMm3jF2o8yMEI45AddLcsGvxjCVzVx\n/RHs4tHWsyaXMOVxNkAfc20H0qa8eyTLkXWjzo28pzWuep6lBEZwpwfmYCWK\ncbs+/bURFbgtc6hOj/6EuaY2VvZmZOlpD7ttAArUg8qvlAenw31tMi1afWZO\nhR4/MPrFeB1sqGY4DkBuMxVteejg6KXfcck/yJ6Ta/4KeoxNfVVEAzT84aIT\nUXIQtxQyr1bSlsFG4maBVa1+TQtWJZ/qr78XblEFNBOHhHZNJM4rTNKgYeyG\nKzEX\r\n=3OpL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCW8MX7UwXJdWRUZoywFqDHNpBWljl9vrPkEBgRa7tnwQIgeGzQym1ragaW7Ua7UuZ3NQMCS2bH9qRPkzZqD5xvcPs="}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.3.0-beta.5_1588809695281_0.24160949498405038"},"_hasShrinkwrap":false},"3.3.0-beta.6":{"name":"@mihanizm56/fetch-api","version":"3.3.0-beta.6","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint . --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","node-fetch":"2.6.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.5"},"devDependencies":{"@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.0.4","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"^25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript":"3.8.3","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"gitHead":"23fcaefe2f3aa4fdfe65882ceb06b9ec81af1f4a","_id":"@mihanizm56/fetch-api@3.3.0-beta.6","_nodeVersion":"12.13.0","_npmVersion":"6.14.5","dist":{"integrity":"sha512-UxvQUzHjiZmWGc7q3LqZDdY9oHR/Cm7ZIVgZISKQRzFVtMBJMX9VHIiYV9rIEZEPz7O2ukMJeNTryShWJwn55Q==","shasum":"53dadd55bf5c7ca13da4e2f470f6a28850e1b18f","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.3.0-beta.6.tgz","fileCount":47,"unpackedSize":58244,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJes1CKCRA9TVsSAnZWagAAsiwP/3Iqz428DHyOnEq3EHRm\ntODptl2AxXTp9t7tMasTPlFx/LtTbLHn2MPwIHjKvQGwsRQcOKKvn+eC504E\n81GSMzCzMhykitt80Ium9foudgEIFna5VkUdlnRPG6CDX1UGx1Yr8vLeKZmm\nYy/82TdKycAy2wqCetlWhXRrNgsd9YDhlTfs3jIT1QN1DPFjPX4LT/Y4S2R/\nr6roW/DLbP1yI70Cee8Jl9a2WgvroYSkPdfZqp3MvYocbo2Oc9DUmb737Dfi\nHueHyqGczNvIp9UtthMgATCB5ezyMnBfKp1oNMnpvmrcyhcjEu2cI3R50jy+\nzb8i7cQNlNBcG1cpb8gdFmnSs/iRxYfVN3HRGvqRLlKtUywXJWhW7EHLaE9v\nl3o5r7I/osSHcJ8g54J2qL05/TNbErl0Kcfp3yE2SkvQ54GbHhIAToOZlxdC\naY6dvi4puVFTgzxQ4KDH2ZUUmiXs9pq3KALMnNbB6a+DlUglOSzzYHsBZd/l\nudRysRiTwJGpuC54Dm54siyy6wRwAG0niTej/YZhfmq0kLzgCktuXi3UmL0G\n2wM0ShbFoY+if/Tgr4cjjSbgB7LfhZkG8suVY4x/tEcxx34+2az12flESasm\n7EPMXARmm9D5hx5jZ48YvgwWpSSeKNRclwxD0G3pSp8kOg9JYd1KfUZB490Q\nOHJF\r\n=dOZF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCroJPwdmd0gRh59/R3LA/rdIio7UBB4oAwRhOijPjrCwIhAO+BjbkOu8w2/ilcncMSOMDpX6OadUPjyIXzaLYie9FP"}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.3.0-beta.6_1588809866288_0.593623727539357"},"_hasShrinkwrap":false},"3.3.0-beta.7":{"name":"@mihanizm56/fetch-api","version":"3.3.0-beta.7","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint . --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","node-fetch":"2.6.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.5"},"devDependencies":{"@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.0.4","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"^25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript":"3.8.3","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for http/1.1 isomorphic fetch\n\n### Benefits:\n\n- Provides validation for responses (based on @hapi/joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize\n- Provides cancel-request if the timeout is higher than 60 seconds\n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in browser and node environments (>ie11)\n\n#### RestRequest input options:\n\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- parseType('json' | 'blob'): the type to parse the response (json by default)\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use @hapi/joi\n\n#### RestRequest output options:\n\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n\n## Features and recommendations\n- body will be serialized in JSON if body data NOT FormData\n- try to use .unknown() method with objects in Joi Schemas because your backend may be extended \nand without this method the responce data may be not valid\n\n## Examples of usage\n\n### REST API\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### get request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          }).unknown()\n        ),\n      }).unknown(),\n    }).unknown(),\n  });\n```\n\n#### post(put/patch/delete have the same format) request\n\n```javascript\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    body: someData,\n    mode: \"cors\",\n    parseType: \"blob\",\n    queryParams: {\n      id: \"test_id_123\",\n    },\n    headers: {\n      \"Content-Type\": \"application/json\",\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\")),\n    }).unknown(),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createReviseRequest(\n  someData\n);\n```\n\n### JSON-RPC API\n\n```javascript\nimport { JSONRPCRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createItemsRequest = (someData): Promise<IResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint: \"http://localhost:3000\",\n    body: {\n      method: 'some method',\n      params: 123\n    }\n    mode: \"cors\",\n    queryParams: {\n      id: \"123\"\n    },\n    responseSchema: Joi.object({\n      items: Joi.array().items(\n        Joi.object({\n          id: Joi.string().required(),\n          name: Joi.string().required(),\n          name: Joi.string()\n        }).unknown()\n      )\n    }).unknown(),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n","readmeFilename":"README.md","gitHead":"5fb40a5fd8133f6210917cf8779d65c95edfb7ce","_id":"@mihanizm56/fetch-api@3.3.0-beta.7","_nodeVersion":"12.13.0","_npmVersion":"6.14.5","dist":{"integrity":"sha512-29BOsITSuh7hBRc0Mp8urHiRfVZJiwLkzQqbL9zLDhumKc+pVxT8aqvaJYzSf4j2GBmBugTVnkAsnN/6eLSXsg==","shasum":"6199a1ab53a0d58487b51b93fefbacdaa5af221c","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.3.0-beta.7.tgz","fileCount":47,"unpackedSize":59096,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJes1hwCRA9TVsSAnZWagAAjrQP/jw+nizBlPmIm/kepw+s\n/ZO24wnr3T/SFYo9NxzEqcacqr2KtiJcGuf0FZ+87/qED41wHs8eqxsasg2S\nEh4rUTWynW3M1hfQOncLBLPKZ4L/g+N31TpZcyjbdvTfJwlpTrmvGkIa0bkp\n1ABxq9vjCnxLgYvOob+ED3ZcqoDss5NDkVkJnT1eYmnD2WPzDjaTzqQoLTnh\ni0LOXCiP191DOkCfWm2qmtA+EYUHf1UarVlHJ+CcjypR9xCYyGu9NFd0GgUR\noZ3jIeJb3Y0tqXGgZN0Finpn6AaJhipx6DSlZqbgKOBnl/PRBagpu0w9oUwS\nC17Vf9fxaqLSrmcJyQtNoh/rwW7ZftoQnLsev3nJgJopJUs8M69Gt/r+9u5J\nJyhKVY7qysWYdAtUNhygsFdvtXk13x/IuF+30JpOqKAvitIZneQHyURf0vN2\naCybPgCJ+D3V2dQn4qypi1sbvsdgH6Q84s1w1cmkvRTcKs+AMukMiy+UNpnk\n6q3zOfzQ0YboYZb3wVYQ3g0XSDuw6AKLlpF9Se7X5Qq0hp6f2ii189p3qLer\neJlYdbHbDja1SvfKSHgb47j4Uw8HVO2r6Duv2KlnaDzn0z4eLJMmQlNE0jAF\nb/3NfZZht3YgP8H6VDwSlyHBMSWiMHvYU0711kBxPzhPtjAiK1+ENbOWBos+\n8dPw\r\n=kCdA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD45nJLCt/QOp14/m7ZEhyy0pgMhFTQFsnPRO0CKjfgaAIhAJ+DFOVnclShzs6uA+Fkr237B7Oq7y5HkrJMj0N4u0+V"}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.3.0-beta.7_1588811888252_0.8016713411898653"},"_hasShrinkwrap":false},"3.3.0-beta.9":{"name":"@mihanizm56/fetch-api","version":"3.3.0-beta.9","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint . --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","node-fetch":"2.6.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.5"},"devDependencies":{"@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.0.4","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"^25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript":"3.8.3","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for http/1.1 isomorphic fetch\n\n### Benefits:\n\n- Provides validation for responses (based on @hapi/joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize\n- Provides cancel-request if the timeout is higher than 60 seconds\n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in browser and node environments (>ie11)\n\n#### RestRequest input options:\n\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- parseType('json' | 'blob'): the type to parse the response (json by default)\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use @hapi/joi\n\n#### RestRequest output options:\n\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n\n## Features and recommendations\n- body will be serialized in JSON if body data NOT FormData\n- try to use .unknown() method with objects in Joi Schemas because your backend may be extended \nand without this method the responce data may be not valid\n\n## Examples of usage\n\n### REST API\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### get request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          }).unknown()\n        ),\n      }).unknown(),\n    }).unknown(),\n  });\n```\n\n#### post(put/patch/delete have the same format) request\n\n```javascript\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    body: someData,\n    mode: \"cors\",\n    parseType: \"blob\",\n    queryParams: {\n      id: \"test_id_123\",\n    },\n    headers: {\n      \"Content-Type\": \"application/json\",\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\")),\n    }).unknown(),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createReviseRequest(\n  someData\n);\n```\n\n### JSON-RPC API\n\n```javascript\nimport { JSONRPCRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createItemsRequest = (someData): Promise<IResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint: \"http://localhost:3000\",\n    body: {\n      method: 'some method',\n      params: 123\n    }\n    mode: \"cors\",\n    queryParams: {\n      id: \"123\"\n    },\n    responseSchema: Joi.object({\n      items: Joi.array().items(\n        Joi.object({\n          id: Joi.string().required(),\n          name: Joi.string().required(),\n          name: Joi.string()\n        }).unknown()\n      )\n    }).unknown(),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n","readmeFilename":"README.md","gitHead":"86826d1adf6413852033d493823f460d2cce7d1a","_id":"@mihanizm56/fetch-api@3.3.0-beta.9","_nodeVersion":"12.13.0","_npmVersion":"6.14.5","dist":{"integrity":"sha512-AihKhw/f8AdPN1u8m1md5+irjN8rrO/xCwjcEsm7eemTmgA5XfLvKAJIfntpUlu7XJZRjp/34DLPzY8lUmwTzA==","shasum":"2b429a04bff8dde096d7d8669a637b1782128371","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.3.0-beta.9.tgz","fileCount":47,"unpackedSize":59631,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJetLuaCRA9TVsSAnZWagAAv7oQAJEC0Vl2AyPeQZkfpsSE\n2oQDFg+T8rosVh8aOqQSZBujsLvxpVH5ohmdjElSIUintnJR6y9H5KNw7ukS\nfsTlCfXCP7mVUd1oZgdoq1IyzHdn0Jp48QyhFGGtv69ofP30oa72LBP6hCoz\noCtMnVF3p4mqYto1HYmXqXQ6Zn4o8xNPOJosg48JNTQVzfVaQqpUXceNasUu\nFm/pjDBuWZT1nYQ16iOoaEAyVm7+YpaO9xyy1G/BVT6w1Gs7NcsYvXFPaBy5\nykdFMsJ56gcvOuo1TFSM/ViYq/X2hEIthOpVy79MhpgYjSyNR4bDZJMwtviY\nyhOR52XEJSLKp10dktmdZ3XTU1dQoumstvRatduNEZbdLtMVzMuZW5OlgbkY\ng44b/qFR9h1X2VZ0kvB5AkysDL+4wk5IjNkHmhgBuAFSVaG2tVD9aqkLPR5S\ndIPAe3Mc3KhDPWttGLC+34oKnGKxOuZ9kYIdBy+O2CShbcF61rv5zJ63R090\nKRnAtnWJnXE48P0Zdv2sfUPqe3IT3pn63UFolRIaxC081QLGxga7kulO8Rl4\nKWw8AGEALb/eNii7JEOAYNNcPb+3rOaoBN73nxlTxk7BoxiGv1V1u8O48tra\nzTHSNgyYogbG3SBFALiVJtWk8mtO0rfwSLcrj10Gwj565AEwzjQfuqjW0OeT\n25xi\r\n=8WSw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDgTrFcs2lC8kwimgeWOEFgriPUY6VXmnHma7epl85urgIhAP+q69RAHbJf1+tYUusNW0isrleOfMcBzlQH7FDM+dVV"}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.3.0-beta.9_1588902810284_0.8204106394008059"},"_hasShrinkwrap":false},"3.3.0-beta.10":{"name":"@mihanizm56/fetch-api","version":"3.3.0-beta.10","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint . --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","node-fetch":"2.6.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.5"},"devDependencies":{"@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.0.4","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"^25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript":"3.8.3","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"gitHead":"2276ae17c753f85b268849f56d2b390745865494","_id":"@mihanizm56/fetch-api@3.3.0-beta.10","_nodeVersion":"12.13.0","_npmVersion":"6.14.5","dist":{"integrity":"sha512-hyfA7T9VbuT0dbBJYejmAATByphpEYhGx/eAAPUtM1/6DiGokriJNk2oFv9EIM53vplWm5ZlK/xgVB2QL0ZDJA==","shasum":"26d95308d9489c6f0bcf22918e1d9cc96eec82c0","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.3.0-beta.10.tgz","fileCount":49,"unpackedSize":63413,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeu0utCRA9TVsSAnZWagAAXSAP/jJEr6JckSwnLrIOTK0/\n2mkWNFT0liJRaRcctCehwyCHXp13bYG/g4ippZxK5HffNgqn+8e9NSb7ly+6\n4EeuoWbLFymtVWhA70tfmtvF84BTAeZzgEsxo313UP1YeWa1YWlP/yF9w/rd\nD/0tuTVcCl3l2Q0k1uB9DCpm6yfY5BVyJgobKuD1BYsLhmJwEExvnc8H59CR\ng9iiRQ/GCnPsn6kLVjVTrHH0C0QRwqXoqVt7Q1hCxydEXtfQStAmdS2a8zLV\n2eWh/RsVUL+kp9IkBhObYMAfOaEgomTVaOKZqZJhofYDufjFXapH5mHGcsOr\nXo8iOC3Txgbd1waC09rfi2PVBwmf+deVDHzGMHIVqczAkM/dg0FZ0Sa4ybvW\nDUGuaxBlYT+F5PJVEkfKzP9NgL/AUee1x3xHjRDwdptFyOb8dFCweoXMrDFI\narYt7mI/RQRmtO1dIVINJdTSTb64AbHsieBbDV1nKy0uh7FQxRLY10BUJtoI\nN5rizNEpo8i1x88d8Y7VVFFdAr+pTm9XetJCMEJD6f2p1ojySkAQwtA7lmms\nPolzJ+BJ88artN5swnpUsLZoatnk0f8ccc5QYtWM7BXnS/+bBGKVH8XJMdf9\n9Jiv27r6Zv972Qm4U7/+ciWqVnKx8AhF1G2JZT+QZzgRhrXd+DrHeS+CLR+Z\nawTD\r\n=vl96\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIG8z8NCrCeF27x7TF6TY1wzugUXjklm+UW22nxospQLYAiEAgJO8BMLqIO44eSWiVhBeJX5gs46DAmnuBko9htb3srE="}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.3.0-beta.10_1589332908833_0.896896521514426"},"_hasShrinkwrap":false},"3.3.0-beta.11":{"name":"@mihanizm56/fetch-api","version":"3.3.0-beta.11","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint . --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","node-fetch":"2.6.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.5"},"devDependencies":{"@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.0.4","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"^25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript":"3.8.3","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"gitHead":"87ebf507393b4ab3bc21153e12bdbb4a226ee17d","_id":"@mihanizm56/fetch-api@3.3.0-beta.11","_nodeVersion":"12.13.0","_npmVersion":"6.14.5","dist":{"integrity":"sha512-wRlyIke5qb+nxOWfw/OeBtG5IqvM2zchONnxI8l+Emaa2Mj4holV9mHX+tauC/B5Jxfd/xpZZWgrpJfKD4D4yA==","shasum":"46fcaf3b4b916c9b3fc412da55fc188ed354f3c8","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.3.0-beta.11.tgz","fileCount":49,"unpackedSize":63413,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJevA2JCRA9TVsSAnZWagAAydoQAKNLvLy41sGGtaQVOVhu\nyyz7skBS6AwNBykGCWyPUVQhOzg8dNfzzRb9Jy4oyD53ENFGz7lsuB0vi2z0\n28/vRDAju+cK6ce9vMh99kNIQssLdZ46+sR1OwchLqAipBT6Km3ToEWsD7Ms\n4fR86n/eC7bmP5uutbmlmt3Ow/ZI4WAQv83bc2SiExM2qMv4BZDjgn9RnDwR\n8RE/u+UjwLu3Xw2TfuTYwv3lnw0uMW98eOu0tI8Qi+YB0VUi7lj8I3bEwQ9x\nhgQOST6sVX7HPTPRQ2I4DWhOuF7T4Ka/JoiEh4Gtf2DequpYqvSljGHY02AD\ns/i5UJlvGPiS4nrHS9zChUpa6Hnff9BNFZnz1eqJ0p6ARWpCi6Xc//yRyAIS\nKsLUHryiNl931jJoS1esXv99g7CQdxW1JHUE1lUXz3kJ+W14wvXIgitMD0hZ\niPi8xevtz76mbC8b0+Z7lgvdg+FfQ6k8/ZcUt0dehOQjTUORgmBDT8MJx9Gq\nU0Wna1/+Wam5imcAZ3dwEwZNmhvan/w1Tm5rmxA3ShVjEx8e4+pVGIr7m693\nCIhHZlJjWzel3UF99C386whaaK/IiCNc+7fMmJoPq6gDwi9qAu6Bq832iB0C\n8z8VY6QKTlAf/pXj5Qs4fm8cQxH6NHYEX7lhwqTscJviSqSXOplnmwsr45+4\nJJ7Y\r\n=MZTk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCCVqohFWWctkYnEXwBmsFP6Ruo/dbY+QQlSupWrI92nAIhAPlauEmNpxRkr/igfvs0EAaEQ5JzDQgW8Bcsc97AWsNu"}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.3.0-beta.11_1589382537227_0.36296248660547215"},"_hasShrinkwrap":false},"3.3.1":{"name":"@mihanizm56/fetch-api","version":"3.3.1","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","node-fetch":"2.6.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.5"},"devDependencies":{"@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.0.4","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"^25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript":"3.8.3","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"gitHead":"03a24c6ee00b08b1c47d5f5008ba76a2f94e75d5","_id":"@mihanizm56/fetch-api@3.3.1","_nodeVersion":"12.13.0","_npmVersion":"6.14.5","dist":{"integrity":"sha512-d+noBMS4pX1UffQjP7yCG+pocEHMS4mWY8yfMS51H9IY6xZPQ7LSgDlbBOzW2SfBaoUdUFjTutKIUXB4/PNJEg==","shasum":"f3a6ed724e5b996c8965617ed07524a2a42edb48","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.3.1.tgz","fileCount":49,"unpackedSize":74348,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJev2fDCRA9TVsSAnZWagAAhrMP/iK56QNK1kiqImbLKF6m\n3e5WREtvJC47OPa1eYI/VJ/IlNQVymYXtL5WnCD2K9PZxWvgkx9i3FixLwZh\nFyerQuYy9kd3ajvFI0qp06hxZfpgNbfpOug0REz7mZ8EoXoYd2T2mh2kN73m\nsVpZhrz8CV5fr9W4EfdzXQh0D0WjvcY7bK7InD3Mz7kmMcQY+a7R635iLgPj\nAbaKPocGjmrhhCuuL3PW+yjgekMLc5SSowXe1BzEdQ5pr2G9g/pBltwvB5g5\nVGqXiwU5gEQc4cbMTQUoAfln5bNTfMtlrTdIK2OBz1BSBtgSNGD+lNc7VEU3\nJZUt7PfPRHVrYMxAZ6w9OOurnPu6LIwIA7GBPM+im7958GYU3Vz3MX+QH31t\nJHDHeqgnRgqDbZaF91/GXLwV5FY/cfyodG+LrWvbAgNtU7cDTMJXdpfyB4JF\n8VSPhpr7XpVMoZmn5rx2OoL4YqGQ357UBrdS0Eu8oxSWpVDTzfMhs1RJLxNI\nEVTsS8qF0gYawypnIGcwQ0VUZbmpu2apukW9pkSnWFpngJdGUpGgnTlGebDe\nHjU5RZzRiZWVuNybYQ0vr2XwZlw/fuancQJxadqS2jyKcJLMZofwTCSHFp5C\nmFATvYrcb4v3kIRfhMXE5pzT2oHz/wzEZCYH0NWzCBhjKsPnb/ZTvDlrMe1M\n7eed\r\n=gP10\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHx9BNZBiEmTRH4i4KzUBv5mtPQ/grC2UQoIBbGn5LRNAiBq7i3nY1OK24Xc3LtQ3q1YEiQpz2Sdp7C66qZdhCxXwA=="}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.3.1_1589602242484_0.6869278824653462"},"_hasShrinkwrap":false},"3.3.2-beta.0":{"name":"@mihanizm56/fetch-api","version":"3.3.2-beta.0","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"","server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","node-fetch":"2.6.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.5"},"devDependencies":{"@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","colors":"1.4.0","commitizen":"4.0.4","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript":"3.8.3","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for http/1.1 isomorphic fetch\n\n### Benefits:\n\n- Provides validation for responses (based on @hapi/joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize\n- Provides cancel-request if the timeout is higher than 60 seconds\n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in browser and node environments (>ie11)\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in\n  hard-structured responce format or not (both interfaces are the same)\n\n#### Request input options:\n\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use @hapi/joi\n\n#### Request output options:\n\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n\n- body will be serialized in JSON if body data NOT FormData\n- try to use .unknown() method with objects in Joi Schemas because your backend may be extended\n  and without this method the responce data may be not valid\n\n## Examples of usage\n\n### REST API\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### get request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          }).unknown()\n        ),\n      }).unknown(),\n    }).unknown(),\n  });\n```\n\n#### get request with blob parse\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getPhotoRequest = (): Promise<IResponse> =>\n  new RestRequest().getBlobRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    responseSchema: Joi.any()\n  });\n```\n\n#### get PURE REST request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { PureRestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new PureRestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          }).unknown()\n        ),\n      }).unknown(),\n    }).unknown(),\n  });\n```\n\n#### post(put/patch/delete have the same format) request\n\n```javascript\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    body: someData,\n    mode: \"cors\",\n    queryParams: {\n      id: \"test_id_123\",\n    },\n    headers: {\n      \"Content-Type\": \"application/json\",\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\")),\n    }).unknown(),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createReviseRequest(\n  someData\n);\n```\n\n### JSON-RPC API\n\n```javascript\nimport { JSONRPCRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createItemsRequest = (someData): Promise<IResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint: \"http://localhost:3000\",\n    body: {\n      method: 'some method',\n      params: 123\n    }\n    queryParams: {\n      id: \"123\"\n    },\n    responseSchema: Joi.object({\n      items: Joi.array().items(\n        Joi.object({\n          id: Joi.string().required(),\n          name: Joi.string().required(),\n          name: Joi.string()\n        }).unknown()\n      )\n    }).unknown(),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n","readmeFilename":"README.md","gitHead":"50557dfddc0f194487ad82ba9e5a5d304e5ab028","_id":"@mihanizm56/fetch-api@3.3.2-beta.0","_nodeVersion":"12.13.0","_npmVersion":"6.14.5","dist":{"integrity":"sha512-GTARWDcvXU6xZXauU/yORPXviO4SlUUhGs9avsb+DvIQDXvc9Btz6Ah4jRP8joacMMdqaw/agw2E3Xae3uu7SQ==","shasum":"b07f6e3e074c3481f077191c856abeb3b0fb7e57","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.3.2-beta.0.tgz","fileCount":49,"unpackedSize":74396,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJev2xjCRA9TVsSAnZWagAAAAgQAIl6Y6U1q2VE4jvcTyYu\nF0bPv+zurLmsRiXD8nRGGMtEQdy7ryCTbn86KRL39UEHRV345rytCjj2kLsp\nY11lrFgCsFbq+cKh1PaafTcnJ3PF/0m67pCnUXAc28xgX4JB3NpJZhr1VpFm\nY1v2jWDatoHUZG0EJ3FZlRfIq2vkuP2WChfmxVsMcxoyR+SF43/1ttLj5Gja\nFjTdu4dXnfE6ZSL7mlgyaEtzxe/dGa4Em4j5awVGXKiYBdtUtSZF+EwqSJDL\nG0OWJ/Hea3XJOk1gdcQR+qQh1xtzCIATVbQCOpvWOub3css63ezgL5Q1yUQH\nH8jgNP4OY90wwAmDcwkSE9LIWcV9qhEVtcSwR5RGQGUkrboXT51WAGtKI+df\n56l4Laic/RNwmVED4pqNQV1n/nPRMsJ0pof+X7W4eCFs0hRKYIacXkgPxVrE\nkJ4/V38Kk4bqcSNadrPQg8LUuzaLip3nqxtQUE18fQYSWpBZwlZWBBiaABn+\nbaHmK+6Lvlqmlb1IS0Hn4Ih1DXmqAy1pveZgro0NkaQA1EzW9S3QbHJ3tqoC\nm7Hqtt/Prig0NdB3DorZCqxqBP2giMsSo/VibskewvYlXd1VmRfPk9JRyM1Y\nnUULN75xHBwnjQWLdnKXwU09f7hY8HXuvHJKYlOffoU+0wszHAzwA8B0Nwup\nXgIU\r\n=SYHb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEuFYWv6FzvneDGoJWcTzok0LYv0YowBKYmBJw7vz2LQAiBdO6lopfK41KruTzVWuvXSxFWwr2dqWR3mlxFTjCXjgw=="}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.3.2-beta.0_1589603427297_0.49259305961081723"},"_hasShrinkwrap":false},"3.3.2-beta.1":{"name":"@mihanizm56/fetch-api","version":"3.3.2-beta.1","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","node-fetch":"2.6.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.5"},"devDependencies":{"@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","colors":"1.4.0","commitizen":"4.0.4","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript":"3.8.3","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for http/1.1 isomorphic fetch\n\n### Benefits:\n\n- Provides validation for responses (based on @hapi/joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize\n- Provides cancel-request if the timeout is higher than 60 seconds\n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in browser and node environments (>ie11)\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in\n  hard-structured responce format or not (both interfaces are the same)\n\n#### Request input options:\n\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use @hapi/joi\n\n#### Request output options:\n\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n\n- body will be serialized in JSON if body data NOT FormData\n- try to use .unknown() method with objects in Joi Schemas because your backend may be extended\n  and without this method the responce data may be not valid\n\n## Examples of usage\n\n### REST API\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### get request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          }).unknown()\n        ),\n      }).unknown(),\n    }).unknown(),\n  });\n```\n\n#### get request with blob parse\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getPhotoRequest = (): Promise<IResponse> =>\n  new RestRequest().getBlobRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    responseSchema: Joi.any()\n  });\n```\n\n#### get PURE REST request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { PureRestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new PureRestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          }).unknown()\n        ),\n      }).unknown(),\n    }).unknown(),\n  });\n```\n\n#### post(put/patch/delete have the same format) request\n\n```javascript\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    body: someData,\n    mode: \"cors\",\n    queryParams: {\n      id: \"test_id_123\",\n    },\n    headers: {\n      \"Content-Type\": \"application/json\",\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\")),\n    }).unknown(),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createReviseRequest(\n  someData\n);\n```\n\n### JSON-RPC API\n\n```javascript\nimport { JSONRPCRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createItemsRequest = (someData): Promise<IResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint: \"http://localhost:3000\",\n    body: {\n      method: 'some method',\n      params: 123\n    }\n    queryParams: {\n      id: \"123\"\n    },\n    responseSchema: Joi.object({\n      items: Joi.array().items(\n        Joi.object({\n          id: Joi.string().required(),\n          name: Joi.string().required(),\n          name: Joi.string()\n        }).unknown()\n      )\n    }).unknown(),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n","readmeFilename":"README.md","gitHead":"77cf04fbfe749105942602e683a652f98e4d620d","_id":"@mihanizm56/fetch-api@3.3.2-beta.1","_nodeVersion":"12.13.0","_npmVersion":"6.14.5","dist":{"integrity":"sha512-f4RUreQS9/nNRANXab1jtuC5rVwUJyPJSrGQoqWYhruX+i488su4Q43OAMmDm9bltC8EiAXm1ubOP2efsEZ+ZA==","shasum":"2b241c80580a82dc6bc09026fce766967fc57662","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.3.2-beta.1.tgz","fileCount":49,"unpackedSize":74423,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJev2y6CRA9TVsSAnZWagAAdJYP/0XVG/IA7pOz5C78gyfq\nCYy1ZJhAKU2e+SQTO7WWO2zprqASF4OnSzg2LJ8PU88vLnmIf/yicLCmVqcE\n/T53vVGCDTW9F1tAalVsTHNuIsOZqdfpJosAVHvFsm/XxHjxd/cWzSldgenU\nUVH4FzqHgWEd64cno0rG3PPRYV4aAydiaxYxRQgpCLHoHF40YytjrWcjglth\nEbKr5/KNmLcmgr76eXU/9fjOZ7DZfYKFhm+hKf59r7xg1+EpUnhfOGX0Sw80\nSD2PfTQn4u0f5Xaidb1jCXZ5PkhQun9NKXfrOroTya3tR9RgNohILh0MDybf\nLSUWl97GKi5YzHFA6As1fOCMFIJwqu9Y4DUemnGrZylbeVit7Se8VxL/Vu4K\nt5AoprMZcwhGdapO5l2oGv9DzqMd5uT8rIgYIe09lUfb1KUAt0V6yIlP5UTb\nUZVqpXMyr5yQ1UNnhqdfsKkSd8JKDySyzgioPn0kn5dw4yALncXPUxf1IcPm\nEVvq/qleOJEBa3ePrwwLwdSeBryL1xBj71UHOi4FOeAWAN9F30lJkevneVEb\nFPYNkmcqqjPxs7qh4NC/yVdXsqXGXsKLwLy8HEjfwfgTdMCpifHQ5+bV70OW\n3sLgeJT/7PBJtiAyPBB8Ju8Vhsbo+BWQrX/yn0eKHN7ewRjF2EAmMPy5r4xq\nyVVe\r\n=QVLf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCdjSVpP+fhIbcv+Ntnvv+Cu7R11LA8Co9JDg+1ipJ9tgIgP9ORb45H/hbq7NrxxycB45BCBRGFaoEVRHCaWjt38bs="}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.3.2-beta.1_1589603514192_0.4346853033296607"},"_hasShrinkwrap":false},"3.3.2-beta.2":{"name":"@mihanizm56/fetch-api","version":"3.3.2-beta.2","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","node-fetch":"2.6.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.5"},"devDependencies":{"@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","colors":"1.4.0","commitizen":"4.0.4","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript":"3.8.3","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for http/1.1 isomorphic fetch\n\n### Benefits:\n\n- Provides validation for responses (based on @hapi/joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize\n- Provides cancel-request if the timeout is higher than 60 seconds\n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in browser and node environments (>ie11)\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in\n  hard-structured responce format or not (both interfaces are the same)\n\n#### Request input options:\n\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use @hapi/joi\n\n#### Request output options:\n\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n\n- body will be serialized in JSON if body data NOT FormData\n- try to use .unknown() method with objects in Joi Schemas because your backend may be extended\n  and without this method the responce data may be not valid\n\n## Examples of usage\n\n### REST API\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### get request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          }).unknown()\n        ),\n      }).unknown(),\n    }).unknown(),\n  });\n```\n\n#### get request with blob parse\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getPhotoRequest = (): Promise<IResponse> =>\n  new RestRequest().getBlobRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    responseSchema: Joi.any()\n  });\n```\n\n#### get PURE REST request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { PureRestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new PureRestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          }).unknown()\n        ),\n      }).unknown(),\n    }).unknown(),\n  });\n```\n\n#### post(put/patch/delete have the same format) request\n\n```javascript\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    body: someData,\n    mode: \"cors\",\n    queryParams: {\n      id: \"test_id_123\",\n    },\n    headers: {\n      \"Content-Type\": \"application/json\",\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\")),\n    }).unknown(),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createReviseRequest(\n  someData\n);\n```\n\n### JSON-RPC API\n\n```javascript\nimport { JSONRPCRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createItemsRequest = (someData): Promise<IResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint: \"http://localhost:3000\",\n    body: {\n      method: 'some method',\n      params: 123\n    }\n    queryParams: {\n      id: \"123\"\n    },\n    responseSchema: Joi.object({\n      items: Joi.array().items(\n        Joi.object({\n          id: Joi.string().required(),\n          name: Joi.string().required(),\n          name: Joi.string()\n        }).unknown()\n      )\n    }).unknown(),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n","readmeFilename":"README.md","gitHead":"e73c8db46ae60e2b0e2d38706c31bff04f580040","_id":"@mihanizm56/fetch-api@3.3.2-beta.2","_nodeVersion":"12.13.0","_npmVersion":"6.14.5","dist":{"integrity":"sha512-d/t4VbU8K2dYLcqdSKwgb5LqA84rXsZ33qg3GSwynLHRonLSJZYi4r3P3p3pMntDrD5Det56abhe4FU4PSre6A==","shasum":"6f977a0c55cccccb72bbe70a50435f7ba9e09051","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.3.2-beta.2.tgz","fileCount":50,"unpackedSize":74752,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJev21RCRA9TVsSAnZWagAALs4P/AySlj6bC0NAXqbcLQFz\nsY6z8j8UjLfLMeGysb3DfaiGnquVQRCzexAs1XPYGCdTJX2/+ZNBJo9wSn6q\n0IadflKV4JSLRnD7VU8t/HORLXOSdaULhfBYL1MSQya0qK7M9KxKvdbtlnha\nEj3x0bK2D0t/MS13wH80Hm8KKitxkj24wn410mVLIsl1IhqBIuf0vMqqOE0B\nuJ4p5YdrZzqohdd/hvPQC4kKOfHWm+JPvMJIrauuNB6w1whm4A9mH9Xr8+IL\n4wscLaICidQQfV2I/jeGNG61i7fRzGNZ0BPy/PXP1cScAn9+HzxtD+ImvmHN\nzNnfoOIloQOT491Dn5ycZO85C6zBAnhuL44cskCSuwY7u2FeT3PkTdT4xuSc\n3b1cZn4pQdGli0rUwzqTL6jrH36uwer/++p5yuCTvqZjoGeVhAZbhuSZxlHZ\nBc/xJVF8+w0Cz9iJZSz3dKTMKXlbUkJ/xJMQ1g9sTVXuiOuKeUCC6inWbh+K\nyS1NjmZ4LlGeAUXfwanrV2tPoNiQz3SAbPY0t6Ev13idyfjtBl53Cvm8RKw4\nzW985CgY2FMmng2qNPgqfN2/SR5AxYBi9zIy0pVagLIdY8Sq0Na/OEGAiy2i\n0vHVmrJv8bkQYaZbde7eYr9g9YdTMrZY118wxwpenfnYkZf5MuXUD6tRnPAX\ni+bz\r\n=2Zga\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFu1wj1OvWXMo6+sPTqeYIt7vUi8BlsxGhqRP0aEJjQ0AiEAkGDN8aPNtkkEYB5KcLYVN5//14k7y0jkxIDZ4Q/M954="}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.3.2-beta.2_1589603665179_0.01158169143645349"},"_hasShrinkwrap":false},"3.3.2-beta.3":{"name":"@mihanizm56/fetch-api","version":"3.3.2-beta.3","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","node-fetch":"2.6.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","colors":"1.4.0"},"devDependencies":{"@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.0.4","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript":"3.8.3","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for http/1.1 isomorphic fetch\n\n### Benefits:\n\n- Provides validation for responses (based on @hapi/joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize\n- Provides cancel-request if the timeout is higher than 60 seconds\n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in browser and node environments (>ie11)\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in\n  hard-structured responce format or not (both interfaces are the same)\n\n#### Request input options:\n\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use @hapi/joi\n\n#### Request output options:\n\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n\n- body will be serialized in JSON if body data NOT FormData\n- try to use .unknown() method with objects in Joi Schemas because your backend may be extended\n  and without this method the responce data may be not valid\n\n## Examples of usage\n\n### REST API\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### get request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          }).unknown()\n        ),\n      }).unknown(),\n    }).unknown(),\n  });\n```\n\n#### get request with blob parse\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getPhotoRequest = (): Promise<IResponse> =>\n  new RestRequest().getBlobRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    responseSchema: Joi.any()\n  });\n```\n\n#### get PURE REST request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { PureRestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new PureRestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          }).unknown()\n        ),\n      }).unknown(),\n    }).unknown(),\n  });\n```\n\n#### post(put/patch/delete have the same format) request\n\n```javascript\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    body: someData,\n    mode: \"cors\",\n    queryParams: {\n      id: \"test_id_123\",\n    },\n    headers: {\n      \"Content-Type\": \"application/json\",\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\")),\n    }).unknown(),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createReviseRequest(\n  someData\n);\n```\n\n### JSON-RPC API\n\n```javascript\nimport { JSONRPCRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createItemsRequest = (someData): Promise<IResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint: \"http://localhost:3000\",\n    body: {\n      method: 'some method',\n      params: 123\n    }\n    queryParams: {\n      id: \"123\"\n    },\n    responseSchema: Joi.object({\n      items: Joi.array().items(\n        Joi.object({\n          id: Joi.string().required(),\n          name: Joi.string().required(),\n          name: Joi.string()\n        }).unknown()\n      )\n    }).unknown(),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n","readmeFilename":"README.md","gitHead":"b08643f9be2c3f7b8926c66a0009d42fd46f0cb0","_id":"@mihanizm56/fetch-api@3.3.2-beta.3","_nodeVersion":"12.13.0","_npmVersion":"6.14.5","dist":{"integrity":"sha512-TgiufTItSNwNHkkY15xq3UGkB0Ihw1uHMNy4ieQJ7MQRG7k1+rWcceki7xYtZl5VZ86sIxjsXFa1xR8+/twiyQ==","shasum":"e75b97192b5d0a72669545b7065b735345a8d189","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.3.2-beta.3.tgz","fileCount":50,"unpackedSize":74752,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJev23DCRA9TVsSAnZWagAArXgQAIeqbXP6oeERzEhLE1Cv\nk8UbM+bELLpyA0UFegFuKpMOuW/s6LDwupkW4+ycsZBZv8CLgkf1NmFkChQX\n0ToLrWVpoJKB9uYDgTjW3FZb4QDGi/tgJP8fmHCKXcAaLhf8WE9WcqpewL6n\nlBV+WtiwLHL+blBYsM4ygAXfyJ6SB0OjSVCa0gT0J7ETMdmI/7qA7pDz5EGC\n7yn45D0VMKrgCOD74W+6lTVtgQEMNA11WwunB9YEealkHI7rjQxwQi9HukfX\nckfRYZjg/x9CdoWu1FFuWb/WZF9NXwpDOLTM/PRLb6C+PHW1kY0/34uXQyqo\nJs2XElUD/mSelJ7NfIIzXgZFCV6tPePsy0r5ve8cD8tGNP0acGkf9mDSi0sr\ndCglihqv6LlrsKEhdXEO4xSUaYEzNUVcolufHijIotd1diX3HqWV6pxbcYmC\ntNiQydAyYZt3YtHOGjzG2NAaWW/wRhigqVNVl8UvgHrcpBh6TIpDT/P/HHZ3\n8XmVYAPwGAwD0Bsyy4nWxBaufMxhsyjQzhIADD+XLJEKj7wIsJm++HHXfiTH\nWWC/R+L9J739/T2cHMZYOlpWwrDZzDYV2lMjoEBV6MDsmOvQ8nV8yns3z/+z\n4FX5hFXtQKzACq10IF0Lf5X0Z0QIIjKB58rBJCNV8pMpjuUcYp+xhAAAcytW\nFSl9\r\n=osNI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDRHpDfx/BliRD2mLBpsRNVmcqSjhTJvscyP47loW4kCAIgHFfPhveR9CNlclHQRBbT42FFr96vq7YmgBL0gdr/AWQ="}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.3.2-beta.3_1589603778887_0.6342310663218078"},"_hasShrinkwrap":false},"3.3.2-beta.4":{"name":"@mihanizm56/fetch-api","version":"3.3.2-beta.4","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","node-fetch":"2.6.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","colors":"1.4.0"},"devDependencies":{"@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.0.4","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript":"3.8.3","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for http/1.1 isomorphic fetch\n\n### Benefits:\n\n- Provides validation for responses (based on @hapi/joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize\n- Provides cancel-request if the timeout is higher than 60 seconds\n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in browser and node environments (>ie11)\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in\n  hard-structured responce format or not (both interfaces are the same)\n\n#### Request input options:\n\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use @hapi/joi\n\n#### Request output options:\n\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n\n- body will be serialized in JSON if body data NOT FormData\n- try to use .unknown() method with objects in Joi Schemas because your backend may be extended\n  and without this method the responce data may be not valid\n\n## Examples of usage\n\n### REST API\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### get request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          }).unknown()\n        ),\n      }).unknown(),\n    }).unknown(),\n  });\n```\n\n#### get request with blob parse\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getPhotoRequest = (): Promise<IResponse> =>\n  new RestRequest().getBlobRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    responseSchema: Joi.any()\n  });\n```\n\n#### get PURE REST request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { PureRestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new PureRestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          }).unknown()\n        ),\n      }).unknown(),\n    }).unknown(),\n  });\n```\n\n#### post(put/patch/delete have the same format) request\n\n```javascript\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    body: someData,\n    mode: \"cors\",\n    queryParams: {\n      id: \"test_id_123\",\n    },\n    headers: {\n      \"Content-Type\": \"application/json\",\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\")),\n    }).unknown(),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createReviseRequest(\n  someData\n);\n```\n\n### JSON-RPC API\n\n```javascript\nimport { JSONRPCRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createItemsRequest = (someData): Promise<IResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint: \"http://localhost:3000\",\n    body: {\n      method: 'some method',\n      params: 123\n    }\n    queryParams: {\n      id: \"123\"\n    },\n    responseSchema: Joi.object({\n      items: Joi.array().items(\n        Joi.object({\n          id: Joi.string().required(),\n          name: Joi.string().required(),\n          name: Joi.string()\n        }).unknown()\n      )\n    }).unknown(),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n","readmeFilename":"README.md","gitHead":"9769574585a08174b6f739ee317d140406c2e5ac","_id":"@mihanizm56/fetch-api@3.3.2-beta.4","_nodeVersion":"12.13.0","_npmVersion":"6.14.5","dist":{"integrity":"sha512-I8e61howuTVsoVW4go7eHc/IMVey+pw1GO4zN9drfgxwWpIgJHm9YS7zWf4rOr1H6FDcyVPwlkpSW9w5reytVA==","shasum":"6c43dc604e9c6d1a75f3ffb9bc9e427b0b2a64b6","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.3.2-beta.4.tgz","fileCount":50,"unpackedSize":74830,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJev24ZCRA9TVsSAnZWagAApTgP/jiEZgniuhJ5UneWv5EA\n5n2f/mpjLpEcmoy48932p8O8EHXf811bSdXRsVwg8VeTDIV5Mv+oOqwsMPV9\nAg2dbu42Vi0TBzEBZXQ9sCLXswQeGbsgo7Cn7OsUrKz2Jd+quUCAKeea9ylP\n+YvtZmzDWwubLb0JOEgEP2SWgaY7/i8VPHYAIXmtKP+uoD1XmVGT76N3hOx2\nZ5tXuNLOphQO93/pMmBzHUclIqMVKtuxM3Vu96FVj+/DdjZPBO2c5n7tddKK\nSA9iSu8VqzzRDlbVen4TbFlPM34L8DdFXFVLj61jm7oHvSzEH2GGaCQf1jZd\nTytptihxUBYVkxXZApCJb3CzRzpFsg4AS6/YFtVnbBiaMfH9oSnv7EJT9Z8+\nJkgCfq9Ms4HfEyb4Rj7K3/lnu3ugwofSo1sJ6xxFpzrno96tgRdIypaTLyrP\nGUa/5TqgewfsUyzeTBEL4QIOhJ+ym8m8dJM/r76FfF7g8uAlDT4iur//4AS5\noAnnXb170+gs60iOTsMo1g4N4WLfqU5qDoo/I+1qDftNrtSWCnollkCr7k7D\niflCEcGbByDIaTTEa3WRoRDmFMJpXB3VdnB6wgGKrpXw6HchT2n+6HNwtIsd\nJCIvgbWhOxdejOo1cMQq9gwX4WtKvj6KAEDkKY8bXTjBTE7pWQ/usmRtJ92c\nwPxd\r\n=lOl2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF6T5zPTr7TW3TAS3lGo9onK10ukixwmtbPIJxfT+PdkAiAyhEz6aQcGm0gdcz5nI62kn2y9Xfrpd/9SVkqFOLs6bQ=="}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.3.2-beta.4_1589603865127_0.7509509037620627"},"_hasShrinkwrap":false},"3.3.2-beta.5":{"name":"@mihanizm56/fetch-api","version":"3.3.2-beta.5","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","node-fetch":"2.6.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","colors":"1.4.0"},"devDependencies":{"@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.0.4","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript":"3.8.3","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for http/1.1 isomorphic fetch\n\n### Benefits:\n\n- Provides validation for responses (based on @hapi/joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize\n- Provides cancel-request if the timeout is higher than 60 seconds\n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in browser and node environments (>ie11)\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in\n  hard-structured responce format or not (both interfaces are the same)\n\n#### Request input options:\n\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use @hapi/joi\n\n#### Request output options:\n\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n\n- body will be serialized in JSON if body data NOT FormData\n- try to use .unknown() method with objects in Joi Schemas because your backend may be extended\n  and without this method the responce data may be not valid\n\n## Examples of usage\n\n### REST API\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### get request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          }).unknown()\n        ),\n      }).unknown(),\n    }).unknown(),\n  });\n```\n\n#### get request with blob parse\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getPhotoRequest = (): Promise<IResponse> =>\n  new RestRequest().getBlobRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    responseSchema: Joi.any()\n  });\n```\n\n#### get PURE REST request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { PureRestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new PureRestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          }).unknown()\n        ),\n      }).unknown(),\n    }).unknown(),\n  });\n```\n\n#### post(put/patch/delete have the same format) request\n\n```javascript\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    body: someData,\n    mode: \"cors\",\n    queryParams: {\n      id: \"test_id_123\",\n    },\n    headers: {\n      \"Content-Type\": \"application/json\",\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\")),\n    }).unknown(),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createReviseRequest(\n  someData\n);\n```\n\n### JSON-RPC API\n\n```javascript\nimport { JSONRPCRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createItemsRequest = (someData): Promise<IResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint: \"http://localhost:3000\",\n    body: {\n      method: 'some method',\n      params: 123\n    }\n    queryParams: {\n      id: \"123\"\n    },\n    responseSchema: Joi.object({\n      items: Joi.array().items(\n        Joi.object({\n          id: Joi.string().required(),\n          name: Joi.string().required(),\n          name: Joi.string()\n        }).unknown()\n      )\n    }).unknown(),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n","readmeFilename":"README.md","gitHead":"a522c5bf0f757c8edfbaf4e80bc4a2711c894413","_id":"@mihanizm56/fetch-api@3.3.2-beta.5","_nodeVersion":"12.13.0","_npmVersion":"6.14.5","dist":{"integrity":"sha512-l+4e3HSwCjO7AKO5pAMQXTThfRRiDtCiqwieZm8EqRH7Fsqxjr5dCTY7gN1SiMo712fGEfQEnFP21Ezo5t5x6g==","shasum":"9f8327c8f325d89f489754c2da0af504564b62ac","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.3.2-beta.5.tgz","fileCount":50,"unpackedSize":74822,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJev263CRA9TVsSAnZWagAA/p0P/j746jHM3C6NF8Xl90tG\nuu1Oszbt2iK2pelgDAZcxm7rEFOUJM03UgbFteE+DOleIkLN5LUUYSwqTYbe\nMWeKIplFldfmlnflbahfHOL5clOaDsDk1gi35Gr4sII7nO9kajTWfBw3jVrQ\nL6aSJ9rDkAapb/0P3HdFfXXRIbhBx1eHY+ha0nYYk+OpGjLDII2+uxuZDfNd\n1uoXHoP8oosWMChLvqZ8ZpWEejGCxxvjTO+kTzup86SgYKEUwGWSdtHESL6u\nTcEHabFZTZOcnhMnhBRS5jn5E8JiQpmaygnNDm0EziruzCLBsSZex8FMqbHc\nNaQy3laS4HliHJ2eqP6qJ6A0vNCnIjxS6rkQO9PnhD7Ri3WagmMaQ/ziZqgP\n7woluVCWa1UwK/ZLSAzWQn+gXQeKt+IJLUVXi0dZRubm5UCdwR67y1lmdQg/\nhojzHWQCmMN5nrEV2ZCwssp9OjyL9KlHe0qpv6CTganuhOBXjTG2I0S91BDc\n2kSzZm2SzbfuNodc91BvVrbMiTIX0x7uF5RPF913s07gBbLZ/fJzZqjgnK7z\nRwN0iTzHGIM7zY33fUtPxMnfnNviLtmjWLxRcOdYCAXdzPOOQmIz3Wp/Sfr8\nKg7rj4yqvSX6Qp6EfJpTIdgvaqCVwqDUNuE5YVPIDqMU2FHc+NgthzjqOgvr\nh//l\r\n=i1vM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD9uaaDIRrNV8JUcd9BERilB0UlV2FZo+0WothQlKyqsAIhAO6pmtVeLbOhcFVdmOR8VY3Ch1GLZCKQgHQ+N9EqBY11"}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.3.2-beta.5_1589604022694_0.4306310485038063"},"_hasShrinkwrap":false},"3.3.2":{"name":"@mihanizm56/fetch-api","version":"3.3.2","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","node-fetch":"2.6.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","colors":"1.4.0"},"devDependencies":{"@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.0.4","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript":"3.8.3","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"gitHead":"5b3e1aeabf17d6ffc5efe848d7d9a2a60e86ab38","_id":"@mihanizm56/fetch-api@3.3.2","_nodeVersion":"12.13.0","_npmVersion":"6.14.5","dist":{"integrity":"sha512-DB/V47/cfu3hLUMNSdiyQNEJPt9bAyVoCVV+fH4rH3/cen7woW40gx75LFXuBd0UvcOpcjT5lBW3dWkz9hbafA==","shasum":"9f8058fc032bbfe64a9b692f8ba843c020d4b6c8","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.3.2.tgz","fileCount":50,"unpackedSize":74815,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJev3AdCRA9TVsSAnZWagAAZP0P/AvbCCDg5PtQy5jG4z+I\n6FE+hXTmlnFhp3Cs3rggnG2cUdgRA6P9nqbuHn5k2VbNrNw9KVJbIUDuSfhg\nVWjfYp4Nkih4HX8XTIAGTM0/u0Ihu7uaWbdYXAzxr6JpBv1BD6dygn8BHE2G\nPqtEHGrvsYSOnUJanmjUwa7KzRx1XbtlmglYMP6tJrx2UgafBSkbtN426WTO\niHl76hE754Cq/LPigtFqvU7jriRCyUn7GoodiwkEXTt4a4PvYdivxJ0ZgdW1\nirG1e1mFY9ULEEBBYKBrlJvTkUoOS5+stx2f8xb+JYIJQWEaHTj7OF7gZMHQ\n+R+P//nhz2QFE7rcUQAeQP4IDknv9Xk+BxCzHw5b95HddSQk2WyhTMCLUZIg\nthPjEj66smX2GFEyry2PvhayOBOsODsn4P9PcOdUKkcFDPH9VgcZIaqSf1CE\nOvtefrRRv4iN5Wo7P2pQJe7Ybii6AvZjuWf5vDkvrOrqsIajzdPHU2zauRx/\nlHOqyBsSv/spae6UBENsru9xzBjsfpo3BdRYw+t/hkaWsDBfA1HBR10b2HE9\n71AGAKqRX/pG3jlWn3y9tErIRJ73vbLC70FNhA+BGohVLzSwq07sLnXLqWA1\nCNo936gt57QbG+dmM2SzRx1kGuzCpxuLHON3Nbnx9queYzxBgrdlZUytyH+z\nIeTf\r\n=Kpmk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHVWub3MphrPGVljR59OuzfWVjK5bR3y8pCfNG2QQmHjAiAjIBh8oljwEusmX4KGqB20V5tSJj/xn/6gpl4IZsnrnQ=="}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.3.2_1589604380833_0.1985973533833807"},"_hasShrinkwrap":false},"3.3.3-beta.0":{"name":"@mihanizm56/fetch-api","version":"3.3.3-beta.0","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","node-fetch":"2.6.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","colors":"1.4.0"},"devDependencies":{"@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.0.4","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript":"3.8.3","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for http/1.1 isomorphic fetch\n\n### Benefits:\n\n- Provides validation for responses (based on @hapi/joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize\n- Provides cancel-request if the timeout is higher than 60 seconds\n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in browser and node environments (>ie11)\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in\n  hard-structured responce format or not (both interfaces are the same)\n\n#### Request input options:\n\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use @hapi/joi\n\n#### Request output options:\n\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n\n- body will be serialized in JSON if body data NOT FormData\n- try to use .unknown() method with objects in Joi Schemas because your backend may be extended\n  and without this method the responce data may be not valid\n\n## Examples of usage\n\n### REST API\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### get request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          }).unknown()\n        ),\n      }).unknown(),\n    }).unknown(),\n  });\n```\n\n#### get request with blob parse\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getPhotoRequest = (): Promise<IResponse> =>\n  new RestRequest().getBlobRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    responseSchema: Joi.any()\n  });\n```\n\n#### get PURE REST request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { PureRestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new PureRestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          }).unknown()\n        ),\n      }).unknown(),\n    }).unknown(),\n  });\n```\n\n#### post(put/patch/delete have the same format) request\n\n```javascript\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    body: someData,\n    mode: \"cors\",\n    queryParams: {\n      id: \"test_id_123\",\n    },\n    headers: {\n      \"Content-Type\": \"application/json\",\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\")),\n    }).unknown(),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createReviseRequest(\n  someData\n);\n```\n\n### JSON-RPC API\n\n```javascript\nimport { JSONRPCRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createItemsRequest = (someData): Promise<IResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint: \"http://localhost:3000\",\n    body: {\n      method: 'some method',\n      params: 123\n    }\n    queryParams: {\n      id: \"123\"\n    },\n    responseSchema: Joi.object({\n      items: Joi.array().items(\n        Joi.object({\n          id: Joi.string().required(),\n          name: Joi.string().required(),\n          name: Joi.string()\n        }).unknown()\n      )\n    }).unknown(),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n","readmeFilename":"README.md","gitHead":"ceb649e74cfe88726f59dbf97aa5637ad321e098","_id":"@mihanizm56/fetch-api@3.3.3-beta.0","_nodeVersion":"12.13.0","_npmVersion":"6.14.5","dist":{"integrity":"sha512-jxRLOIocj2EvKnn3g6FiKQ9O6tfigmc0N7z4Z8QlqEuIJvyN6rC1KpGikU953yxDAbeWXsogPFLCIcc8cW6yQg==","shasum":"c8eb79f6f35bed69e729a246195a2621904144f0","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.3.3-beta.0.tgz","fileCount":50,"unpackedSize":75303,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJexHwzCRA9TVsSAnZWagAAftYQAIBZYyj5IPpR2a1Vp+S9\n1LksjViRJ5VcVrKQ2NwPNxXGBGdvmBaQnKyLD0S32NRHWoDSKX1VR7Xlvf06\n3XBKMA6D5axzszWUTUqx4gvfpO+5bTeC6dqchfarvoujHI7J972rCLoPBkFj\nNbgtABNSJfiy96qQm1BD1Y1dqMokNETm+I0Z0D+fnX13lMkBxBxYgQDu2qQh\nabdVahiKUqH04CeMPOhVfK58khgGRaSC8mhx0Vfku8att0Sa8lFn3mnv0Qof\nP9o7TofOgv7HbE4vO6JdLmi+kwAKuA0QO8zgdn2VjqEk4va2Du5tVlRCd4Ex\nXtvjSMNoUMxNJIi6fTW95+ICgKVALBt0fC0YGBQn+m0+ZUkpr/d/nUbGNyk1\nkb84Fb623l4DKh5IxBxCMPNDmF+2VQTNwLY2kTf6BUnW5tuhr41S4p/P/gTi\nEyKincPWHHzpDNltS/LyFVxss0HB2WglAQNN9fO2VLQ6wddmuXQ/+2aDKQYH\nn2ZPP0CQ4rvcGleDjBYnTlq1VV16f8h2yGcefH0op1zaHLP3LBARYHNe8Tkh\n3i4THdB2PA6dNiIr8B60zGqez5fASqKVsBYNykIo58/ecGEPAXmtSWEASzl2\n+hZtelcsRMh51is6N1pZ+VsRrpijVuTyoGpySxdONqQ4qP+Iq3qmUstnW8XJ\nqbxJ\r\n=Oli8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICJqrIVjOBz1HaeAIXXX9nfNu68vXfSvnP9kpTj3DcO1AiAKv69gqR4YDlpb+s46SdNGsKnJ1JVWQ6ykkdrEmMoZvA=="}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.3.3-beta.0_1589935155014_0.6328947483671201"},"_hasShrinkwrap":false},"3.3.3":{"name":"@mihanizm56/fetch-api","version":"3.3.3","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","node-fetch":"2.6.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","colors":"1.4.0"},"devDependencies":{"@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.0.4","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript":"3.8.3","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"gitHead":"7879f463fe773ba845d97474691d9656e1252207","_id":"@mihanizm56/fetch-api@3.3.3","_nodeVersion":"12.13.0","_npmVersion":"6.14.5","dist":{"integrity":"sha512-/Bdkaxgp+s4LBPNwa6JVv9G/FwHcosSpm2KVzvxC4jjZOE0Rso7U/tSpgAz6dNbJ6RVVN0jdyquu5Czrs+wfBg==","shasum":"94a8dbaff33558a49d2314a413eb5d7f3cf4f88c","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.3.3.tgz","fileCount":50,"unpackedSize":75296,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJexIT5CRA9TVsSAnZWagAA/ZMP+wdHpp5XvX+EhxJGubIh\nThO1jedbHQ33hqaNngorQTAekkzzzqORxuYR2yoJJJ+dWaw4EDoN+jnCJl5+\nb5MTF77SxG80U9eNUpVrhLPIq6sFpuhEMwMHhWN0EYhmjVmZ/50Ncj3d9YvW\nQybveTrZiHolNIVcysWi4LlP+JqFKPe0JBnMIy4GDfqA5Xt454+k3uCpGOxP\nswyd+pIfSmPBkEPhhVA3HU6QcCYlCWmjR8NbWpX0Wn1Ro8h9OK/wEc/9/djE\nOBFUGSqd7q63O8TGkGZ1J6xk0V27GK6MSVCg4zXfMviyA25X6MxqOimf4fgi\nDpyJaiXv9AmkiOvLAqKbgKtUH0zKZw3Pw8BZ1O8G8wYFLRH4uajgRiAIUT/o\n5EuFurHoj8jsVNsqD8RL1Ers7LEnbZx6zrQBD6um2bDys0BLxH8z19aWraBj\n4qnQZ7jL3pX9A6VzxYrLOPiMfkMG2MFGTFh+GkZj8Mnvn5WomalmG7BqznAV\nkmHWSQdwdwwG69xGjLHqzF3yPKrvLzRE85y4n9Qp8QOkXV9cYNf+WGfnA+f+\nGrrETMnbXG3UMvkkVW/j06JeJXzgKVKEOKeIn60romIatZitr6jEOFjpzF4y\nZN+VU5PS/zgX/VFvdpGqv6eYjPKSwX1pGcha5+S5u0yW31tDE1KnxJfQobYP\nSX8h\r\n=Sibg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAbFgfFIgCGNGEMl/XYs0o9Ecx3uZbUqZzIP7qJ/YInqAiAuDcQu5pedqOcbyEiE7V6gCUqBVB/BjHmL4r4ykf0P5Q=="}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.3.3_1589937400348_0.8384885860767657"},"_hasShrinkwrap":false},"3.3.4-beta.0":{"name":"@mihanizm56/fetch-api","version":"3.3.4-beta.0","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","node-fetch":"2.6.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","colors":"1.4.0"},"devDependencies":{"@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.0.4","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript":"3.8.3","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for http/1.1 isomorphic fetch\n\n### Benefits:\n\n- Provides validation for responses (based on @hapi/joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize\n- Provides cancel-request if the timeout is higher than 60 seconds\n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in browser and node environments (>ie11)\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in\n  hard-structured responce format or not (both interfaces are the same)\n\n#### Request input options:\n\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use @hapi/joi\n\n#### Request output options:\n\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n\n- body will be serialized in JSON if body data NOT FormData\n- try to use .unknown() method with objects in Joi Schemas because your backend may be extended\n  and without this method the responce data may be not valid\n\n## Examples of usage\n\n### REST API\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### get request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          }).unknown()\n        ),\n      }).unknown(),\n    }).unknown(),\n  });\n```\n\n#### get request with blob parse\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getPhotoRequest = (): Promise<IResponse> =>\n  new RestRequest().getBlobRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    responseSchema: Joi.any()\n  });\n```\n\n#### get PURE REST request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { PureRestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new PureRestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          }).unknown()\n        ),\n      }).unknown(),\n    }).unknown(),\n  });\n```\n\n#### post(put/patch/delete have the same format) request\n\n```javascript\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    body: someData,\n    mode: \"cors\",\n    queryParams: {\n      id: \"test_id_123\",\n    },\n    headers: {\n      \"Content-Type\": \"application/json\",\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\")),\n    }).unknown(),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createReviseRequest(\n  someData\n);\n```\n\n### JSON-RPC API\n\n```javascript\nimport { JSONRPCRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createItemsRequest = (someData): Promise<IResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint: \"http://localhost:3000\",\n    body: {\n      method: 'some method',\n      params: 123\n    }\n    queryParams: {\n      id: \"123\"\n    },\n    responseSchema: Joi.object({\n      items: Joi.array().items(\n        Joi.object({\n          id: Joi.string().required(),\n          name: Joi.string().required(),\n          name: Joi.string()\n        }).unknown()\n      )\n    }).unknown(),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n","readmeFilename":"README.md","gitHead":"b21285f76fc6bae501db4a13f68c876ee0326af8","_id":"@mihanizm56/fetch-api@3.3.4-beta.0","_nodeVersion":"12.13.0","_npmVersion":"6.14.5","dist":{"integrity":"sha512-sBfIaD3ffVqGLR8TqK+fxHk6FSlFJrcwvBpvhVwWWzieollHHrXgYHd7GZuA8SUgqzOLrAkK3xZACJJjH/Q/rg==","shasum":"cb694e6ca3c5a3557357361c4e0fcf4973e984bf","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.3.4-beta.0.tgz","fileCount":56,"unpackedSize":77951,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJexrdXCRA9TVsSAnZWagAAiwcP/jEr8aPI/8zEn1HYdiDj\n2eClYSs1e1Oti38BAF9Ka37HOIyZglXxd6QTtS5pV8A5LKQohF2voybHGu7p\np3P4/bwJdH1YejeBd+g0UrtQxLbpD7zij03pFCXIjQ53k4ss8b2ThZQjqNbL\nRV4uCxwFTx8e2DW8YEGqLJVerA179djOzQT08uwd7tLDoAg474mhQtv0ioy/\nX3O134vkFwt3uRgVjddU13HBb771cz7qCCZyWq1tRj17RtZJKPUsaz4HyF+H\nJBCEWEl4Murqh6idVJ/CPtB7s0n8KR4tAZmrSQn8l/rdVRAzx2fnvlyYDThS\nvt2uvwTjfAWl365zuzfrul3nR/rOjX/WWx8FzdxkbYWTD6kjdAl87mE1yDq7\n8MW1ua6++VXgpmBAmx28AB5DLNyWr3Qyp/m9Avg5/076Pfg36+d9r+qxcH0Y\n2jqxrq3bRJUFhxMWl3UpeGSckTOppb9kMhw8sqLUZ95vSAeBKsjtEqvt1yyc\n5kVqEC2x7Etwic/KX9QtTOfGhSjgayYzqQC45PkzsRDboGvf+kM94C+nAbc+\nyTgUcXYCnCR0QOcN5ozFyw6ltkex9EOJ1lqXLjOhF9XSwUZQTIQ5XJu30DlN\nc8IfkqkPLC0eoaCm8SDP7jGYMFSlCdq40ktGK6OpCqDIrZL0hqOYRjdTzYxT\njZDS\r\n=A3tp\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDmWAsJ8fZ7i1iKtxUJ1jplFp6OTAEEHm9T14xwH3YXIwIhAPqP49FAGv5gyUyeSndW5PrHVW1LvtOpcrsLWg8TW6Uc"}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.3.4-beta.0_1590081366366_0.06824572914946514"},"_hasShrinkwrap":false},"3.3.4-beta.1":{"name":"@mihanizm56/fetch-api","version":"3.3.4-beta.1","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","node-fetch":"2.6.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","colors":"1.4.0"},"devDependencies":{"@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.0.4","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript":"3.8.3","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for http/1.1 isomorphic fetch\n\n### Benefits:\n\n- Provides validation for responses (based on @hapi/joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize\n- Provides cancel-request if the timeout is higher than 60 seconds\n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in browser and node environments (>ie11)\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in\n  hard-structured responce format or not (both interfaces are the same)\n\n#### Request input options:\n\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use @hapi/joi\n\n#### Request output options:\n\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n\n- body will be serialized in JSON if body data NOT FormData\n- try to use .unknown() method with objects in Joi Schemas because your backend may be extended\n  and without this method the responce data may be not valid\n\n## Examples of usage\n\n### REST API\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### get request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          }).unknown()\n        ),\n      }).unknown(),\n    }).unknown(),\n  });\n```\n\n#### get request with blob parse\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getPhotoRequest = (): Promise<IResponse> =>\n  new RestRequest().getBlobRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    responseSchema: Joi.any()\n  });\n```\n\n#### get PURE REST request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { PureRestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new PureRestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          }).unknown()\n        ),\n      }).unknown(),\n    }).unknown(),\n  });\n```\n\n#### post(put/patch/delete have the same format) request\n\n```javascript\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    body: someData,\n    mode: \"cors\",\n    queryParams: {\n      id: \"test_id_123\",\n    },\n    headers: {\n      \"Content-Type\": \"application/json\",\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\")),\n    }).unknown(),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createReviseRequest(\n  someData\n);\n```\n\n### JSON-RPC API\n\n```javascript\nimport { JSONRPCRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createItemsRequest = (someData): Promise<IResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint: \"http://localhost:3000\",\n    body: {\n      method: 'some method',\n      params: 123\n    }\n    queryParams: {\n      id: \"123\"\n    },\n    responseSchema: Joi.object({\n      items: Joi.array().items(\n        Joi.object({\n          id: Joi.string().required(),\n          name: Joi.string().required(),\n          name: Joi.string()\n        }).unknown()\n      )\n    }).unknown(),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n","readmeFilename":"README.md","gitHead":"0ff19931a9efdba62c3c2871206420c6bbf49383","_id":"@mihanizm56/fetch-api@3.3.4-beta.1","_nodeVersion":"12.13.0","_npmVersion":"6.14.5","dist":{"integrity":"sha512-gbwC8kiajIAXVSBBAOZyFp7gzUQP791NUbophQV1/y8tW3hRV3FDGNbOnuhF4zYZg261JJkJ/tKfETmKL1A6ug==","shasum":"24171f572b5618fa5de4039f6a39f66a4f270c85","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.3.4-beta.1.tgz","fileCount":56,"unpackedSize":77935,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJex7HECRA9TVsSAnZWagAAKycP/192CnMG28lrI2GlySUS\nxZc2r88j5r3CiWmJYVBLe1xAdZUqyxNigWV1W+qUkPwMn6mLlL3GjLwlXFJ/\nglDvKOSUc/2Kqtf5Iqf/r9VoxMfLIwCO91mewxE3DHqZK+Fty7O5zJedGM45\nh2Gt16u7V8B+d+R10ywSHlmFZh3+Wc6HxCcIs1+8siv9ZGpqChLzDo7C06su\nCMSQvc7buVwbqWB+6DS6yooi40noraS/H1ojifssJKkQxbY0W0PerueYKnus\nSV6Xnk8QQStivERUaLbsE+Xt5bEI2NZ3iHWrCFhpCj0KThNpmARHvxG2d1D9\ncHYOud1WyM1Fs8zmqnmzZTql0L89TyTz6pYSar8RcoBHspNtSmADwup4/usq\nbnXPJCWsnL6eyyqBQ48WX9wE6zq1JkYFmmWdaOUsK9MqOS+aWCBPt/wcYJuf\n++10ezUhqLInFv4LCGmYlR0sKj39sFiQ0fbaiPSO+bs5CZ/E88hOsVzs4Y+u\n3wvFqbqndzcquqVCkDIP7H75v+N+CZUJIYGTZNEsbpMT1ucae5zrpPuHk8hg\nI2B6CDZ0Wl90EneEz9vYqxhc8EHu266P9qkynvP9AtZaRc/wHWN0W+CIIIIC\n/m1itXcTOSlrqiX18VWKEEhThz83zhawGpN0yxmDOl5W99HGcnd//jQfFbUo\n23sH\r\n=RSgP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCID9I89768T0/Tijm4OTMUS9WN+0jpesga0/fIX6jNJuiAiEAtuWe1L20rZOnq0AaTQox6CX0CpY/p5B+uXG2AODL+m4="}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.3.4-beta.1_1590145475713_0.5292269305745405"},"_hasShrinkwrap":false},"3.3.4":{"name":"@mihanizm56/fetch-api","version":"3.3.4","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","node-fetch":"2.6.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","colors":"1.4.0"},"devDependencies":{"@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.0.4","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript":"3.8.3","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"gitHead":"2328c85c058d426fc73c6cf7afe38904d260ab35","_id":"@mihanizm56/fetch-api@3.3.4","_nodeVersion":"12.13.0","_npmVersion":"6.14.5","dist":{"integrity":"sha512-IUrL8+KpmFXpC8zTaE3U6cowIDl7ZKKtBfw3aAmaVcoQaS8ytQ5247+E7MlDoevZEXyZth3cFwnteaW1Wqw9Ww==","shasum":"6e3326cc04976c0bc6c15303a14d06c91838d098","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.3.4.tgz","fileCount":56,"unpackedSize":77945,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJex+PCCRA9TVsSAnZWagAAvPkP/ApoffHTxU1bGPZlSZU9\nXPzTFK5DOPrE8YUukCdAeyc90u/6nncY1HdGWE2r3o82szUA6rrSfh039w2r\nG6jtFxJrAthX6W7xp30uOJNxhT4AGMnDflTcC+J50eb3uCk4DG2aflLn7c29\nWBguaj9aA6ifzcMGyz+LCj1o9D7BA3QAse0LRhlCXYOLWYzNotIRi2vU1LHr\n6GxIjP9taCCIJ6G4Tr6WBCpqn8NqbEOF8n9nOs21EkPmstkp2f6jX7mseriz\nRsJlsTiqNDFKqDFXb+LXAh8MdGQtfEqvqGsLL2r3FZNB4ztQgSeGUeDHOnfR\nL1ympmuw0OSdX63tXtgviLbAzUhxpFp9RpyIOtUxtXcqAFdYheqN0NIGUJUk\niEicQh5nuzD5h83i0z3pTYJkVpujU7scCHHPv9l+8gu/jI5AhKsufXfyWNtR\nEWVFiHRjtyNnW1CDyoVIwWag1V7fbQy+Wc8SVwuKk//GFL1HAZGbumGbl51x\nby+4d/WPhRXU/a0N1A/0NzF3p2I2g270gj255wfVq1oTwS3Zmm/4Xb9rHYzf\nN6K0I5bOm7bfXAC0q7lNF1XlIQ4SCTPL302qHONUaEfj1nfSY6bsLdyGTih6\nn8ks3G9PVk6YxdKt9OmV6F9G9gOF/usGO/Sq3bNAGAVENw5AjO14ZF5N3IOU\n6VRh\r\n=FNMc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHwsNF9ueyhWosLBraGwu7eJFYyZEHGnu1BOrxOZWVKMAiEAvCzNYVAqpiuyE1AaouT2ARUdvcg2plXG8RbTGgECins="}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.3.4_1590158273911_0.5885970269943845"},"_hasShrinkwrap":false},"3.3.5-beta.1":{"name":"@mihanizm56/fetch-api","version":"3.3.5-beta.1","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","node-fetch":"2.6.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","colors":"1.4.0"},"devDependencies":{"@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.0.4","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript":"3.8.3","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for http/1.1 isomorphic fetch\n\n### Benefits:\n\n- Provides validation for responses (based on @hapi/joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize\n- Provides cancel-request if the timeout is higher than 60 seconds\n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in browser and node environments (>ie11)\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in\n  hard-structured responce format or not (both interfaces are the same)\n\n#### Request input options:\n\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use @hapi/joi\n\n#### Request output options:\n\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n\n- body will be serialized in JSON if body data NOT FormData\n- try to use .unknown() method with objects in Joi Schemas because your backend may be extended\n  and without this method the responce data may be not valid\n\n## Examples of usage\n\n### REST API\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### get request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          }).unknown()\n        ),\n      }).unknown(),\n    }).unknown(),\n  });\n```\n\n#### get request with blob parse\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getPhotoRequest = (): Promise<IResponse> =>\n  new RestRequest().getBlobRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    responseSchema: Joi.any()\n  });\n```\n\n#### get PURE REST request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { PureRestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new PureRestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          }).unknown()\n        ),\n      }).unknown(),\n    }).unknown(),\n  });\n```\n\n#### post(put/patch/delete have the same format) request\n\n```javascript\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    body: someData,\n    mode: \"cors\",\n    queryParams: {\n      id: \"test_id_123\",\n    },\n    headers: {\n      \"Content-Type\": \"application/json\",\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\")),\n    }).unknown(),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createReviseRequest(\n  someData\n);\n```\n\n### JSON-RPC API\n\n```javascript\nimport { JSONRPCRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createItemsRequest = (someData): Promise<IResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint: \"http://localhost:3000\",\n    body: {\n      method: 'some method',\n      params: 123\n    }\n    queryParams: {\n      id: \"123\"\n    },\n    responseSchema: Joi.object({\n      items: Joi.array().items(\n        Joi.object({\n          id: Joi.string().required(),\n          name: Joi.string().required(),\n          name: Joi.string()\n        }).unknown()\n      )\n    }).unknown(),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n","readmeFilename":"README.md","gitHead":"2328c85c058d426fc73c6cf7afe38904d260ab35","_id":"@mihanizm56/fetch-api@3.3.5-beta.1","_nodeVersion":"12.13.0","_npmVersion":"6.14.5","dist":{"integrity":"sha512-J7asTxwonF6xlvMyJVwkMgJidyAJVHt3HqHweT7f/Fy6xGKuE60tjLQ4mFkenfnK6KIFqSL5836ayTzsr0opFA==","shasum":"8015a9b8c08e92205a00a554d0c7cc2002236803","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.3.5-beta.1.tgz","fileCount":56,"unpackedSize":77976,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJezmXsCRA9TVsSAnZWagAAIT4P/3CeMuuBiOwGt7VUDy57\nU8bM61F9LgG5YsntlKa5OP5SyvmwgGPVehdxGZvlbStUl6bY15hSMpXjg2rh\nxJ+otyJKT2kmptxpxaC87c+lBNX90kVV1X47TSMFr6gTEtSqcA74hIfFDmTZ\nFczLqBoSuR7xz2zqkD5PH3g1v+ZYawH8HlOATvf54+pcPYujypD2uNADIj+P\nKJAWI3qi/U6yjoYYVFmh4L+ol53Js4P2AHbv2VNZKfJZ875Lb62Tpv9QSuxT\nFHVIMSb/x0ivK5ywWmFNoUd1XgTezA6WwGz6fV0txMaJPis7LUTz+0D/OpMT\nlkk7PSP4ZjNYYRrOS/zD5sHZ4EJh0+PE4kUDWwjmOKhtkRYkh6skhPUZVY/L\naKUZAZmTMSdfiBHzw18qRm/lW/PdaE1k9K/McOqc4j5s8mWi19mIyFzkJdgG\nN3WntjclZHMFk59Y13RlBOFDUov+S3PtDx5otTo3z16Qi9VnZvM1LYxUUYU5\n3qhEkihnwuPkn6swAX5G/w/8NTUn/3kTHp3AFkhfpMtF3Xqyj3PXqBaCTVmA\nHdUUum/F52Pu9vaOt2tqRwzSAimj/fqsbsRG5P1jb58ma4ZlJT1A0k+3Hyp8\n723CS7uwBoIGnyQmqkRI49uQuvDLuho4XCdqml+mwD4EYy1pWRgmkKtJTFM4\nrnhz\r\n=Rw7/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBnl5Qm5xHNOEuDVxpaGNPW/KU1Rj8VMtnyfeRHGWlEBAiEA+vjjoJYVOLf/ESkZ0iGJLJgq5knUMWn7Ng4saAIBA2M="}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.3.5-beta.1_1590584812116_0.7641258233866199"},"_hasShrinkwrap":false},"3.3.5-passport.1":{"name":"@mihanizm56/fetch-api","version":"3.3.5-passport.1","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","node-fetch":"2.6.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","colors":"1.4.0"},"devDependencies":{"@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.0.4","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript":"3.8.3","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for http/1.1 isomorphic fetch\n\n### Benefits:\n\n- Provides validation for responses (based on @hapi/joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize\n- Provides cancel-request if the timeout is higher than 60 seconds\n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in browser and node environments (>ie11)\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in\n  hard-structured responce format or not (both interfaces are the same)\n\n#### Request input options:\n\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use @hapi/joi\n\n#### Request output options:\n\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n\n- body will be serialized in JSON if body data NOT FormData\n- try to use .unknown() method with objects in Joi Schemas because your backend may be extended\n  and without this method the responce data may be not valid\n\n## Examples of usage\n\n### REST API\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### get request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          }).unknown()\n        ),\n      }).unknown(),\n    }).unknown(),\n  });\n```\n\n#### get request with blob parse\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getPhotoRequest = (): Promise<IResponse> =>\n  new RestRequest().getBlobRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    responseSchema: Joi.any()\n  });\n```\n\n#### get PURE REST request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { PureRestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new PureRestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          }).unknown()\n        ),\n      }).unknown(),\n    }).unknown(),\n  });\n```\n\n#### post(put/patch/delete have the same format) request\n\n```javascript\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    body: someData,\n    mode: \"cors\",\n    queryParams: {\n      id: \"test_id_123\",\n    },\n    headers: {\n      \"Content-Type\": \"application/json\",\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\")),\n    }).unknown(),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createReviseRequest(\n  someData\n);\n```\n\n### JSON-RPC API\n\n```javascript\nimport { JSONRPCRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createItemsRequest = (someData): Promise<IResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint: \"http://localhost:3000\",\n    body: {\n      method: 'some method',\n      params: 123\n    }\n    queryParams: {\n      id: \"123\"\n    },\n    responseSchema: Joi.object({\n      items: Joi.array().items(\n        Joi.object({\n          id: Joi.string().required(),\n          name: Joi.string().required(),\n          name: Joi.string()\n        }).unknown()\n      )\n    }).unknown(),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n","readmeFilename":"README.md","gitHead":"2328c85c058d426fc73c6cf7afe38904d260ab35","_id":"@mihanizm56/fetch-api@3.3.5-passport.1","_nodeVersion":"12.13.0","_npmVersion":"6.14.5","dist":{"integrity":"sha512-JkXpzG5OtxD61PJhfXgo3K5boxts+gcH0F9lSpzFhRwVjzEdE962S37iJKE8pDmrfDMs09ksxgGJeVBdvU4pLA==","shasum":"4276a599176a5b5e738f37fab3789285334d98b9","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.3.5-passport.1.tgz","fileCount":56,"unpackedSize":77980,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJezqaSCRA9TVsSAnZWagAAQeIP/i/YD+Ovatd+Jz50uUfE\n4USwmR93jJ9FaSyuluUG5RZZ7bmfkvFjWzLTb6+KJLVFILrYwxiQok5LzMXe\nCMJQRyQMWJcm8tBLlcMskRQnHoqoROAls4l8LcgXS3G/jAJY/zdb+WJOwHHc\nAeeAHvACruNldl2hcL3EUEnut5YHnttUle5pelR5yqEp0/+pl9QDe3rhafF2\n1FsdFCn1axjLDGouuux0d+FfMT9i4WqJSm26hKN0CTlVymHtqxpo9tgxo9aD\nWkviO2uuGc36VX/P+hMW/zRCyMjwvDzEFTzkEqIHk0CsfSAVTxqIYYIhxpAY\n1FXVCRpNnHCw2x6//WnslMx+2vsJAwWiNq/Wv5GNHOq/fcAEXJgO0oAybpDi\n/JT4YWmmLrTQcl96SD/VGkbNFTZidnPM4o2JpzLYgLc2K3iSfmwORBw8509q\n8jYevu2c3j4Niu8u35OKEuZTWwz5EqxcegGHXwNB6pBKg9q61/okLHPj1Cpg\npcQNlsMdufLC8OL5ybSyqacOkQWOK0AgJkJjYEcLUFRONyoIzTWRSQqfuTcK\nflTnxLvPwYOrOLkByXoXxpDR8l4yehGnU6L1V8UGW3R/GkedwcVVUncAkDrX\n54zmLkMKNh0jnxqhAh1cA1Igx/nLXbxuPUiIltxkbiIkFy9QI9eNJvqBPZd5\nuC/K\r\n=SR46\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCCas/JD+w0s3cSV9JUviqtRBoRY/GsQpEayS1SMUlDVAIgAthT2KHQ5OouJHZhUMTJEEWlxRsW5gRHdzP/ZRNExwU="}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.3.5-passport.1_1590601361664_0.9413399755277116"},"_hasShrinkwrap":false},"3.3.5-passport.2":{"name":"@mihanizm56/fetch-api","version":"3.3.5-passport.2","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","node-fetch":"2.6.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","colors":"1.4.0"},"devDependencies":{"@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.0.4","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript":"3.8.3","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for http/1.1 isomorphic fetch\n\n### Benefits:\n\n- Provides validation for responses (based on @hapi/joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize\n- Provides cancel-request if the timeout is higher than 60 seconds\n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in browser and node environments (>ie11)\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in\n  hard-structured responce format or not (both interfaces are the same)\n\n#### Request input options:\n\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use @hapi/joi\n\n#### Request output options:\n\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n\n- body will be serialized in JSON if body data NOT FormData\n- try to use .unknown() method with objects in Joi Schemas because your backend may be extended\n  and without this method the responce data may be not valid\n\n## Examples of usage\n\n### REST API\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### get request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          }).unknown()\n        ),\n      }).unknown(),\n    }).unknown(),\n  });\n```\n\n#### get request with blob parse\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getPhotoRequest = (): Promise<IResponse> =>\n  new RestRequest().getBlobRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    responseSchema: Joi.any()\n  });\n```\n\n#### get PURE REST request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { PureRestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new PureRestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          }).unknown()\n        ),\n      }).unknown(),\n    }).unknown(),\n  });\n```\n\n#### post(put/patch/delete have the same format) request\n\n```javascript\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    body: someData,\n    mode: \"cors\",\n    queryParams: {\n      id: \"test_id_123\",\n    },\n    headers: {\n      \"Content-Type\": \"application/json\",\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\")),\n    }).unknown(),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createReviseRequest(\n  someData\n);\n```\n\n### JSON-RPC API\n\n```javascript\nimport { JSONRPCRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createItemsRequest = (someData): Promise<IResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint: \"http://localhost:3000\",\n    body: {\n      method: 'some method',\n      params: 123\n    }\n    queryParams: {\n      id: \"123\"\n    },\n    responseSchema: Joi.object({\n      items: Joi.array().items(\n        Joi.object({\n          id: Joi.string().required(),\n          name: Joi.string().required(),\n          name: Joi.string()\n        }).unknown()\n      )\n    }).unknown(),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n","readmeFilename":"README.md","gitHead":"2328c85c058d426fc73c6cf7afe38904d260ab35","_id":"@mihanizm56/fetch-api@3.3.5-passport.2","_nodeVersion":"12.13.0","_npmVersion":"6.14.5","dist":{"integrity":"sha512-dlazoJSF2m86YqFbFqWdtPV3ZK+5lb0LA7SbG01zWjqpReSMy5R7FIRAjFIyJz3F1NqgF/hllhP+gAFr8MqyYQ==","shasum":"f32b3643270761371fffc457afd386d2583b503d","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.3.5-passport.2.tgz","fileCount":56,"unpackedSize":77980,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJezrGiCRA9TVsSAnZWagAAs0oQAIKAfwk/OrtlSUlUTNKJ\nmNLJTPqHXkTzZ4Nk2B1OIr3EnRmkUOWTYlI5qB6JkdtN8S39Ohawbep7t/R0\n4KxMgmtk7a/0khgV/Wy5Fuob9FypG9lI69XnCjK+jbdE02n8N2/tBDsv+MIR\naN5AQWfqthD2+PnhQrJS9my5VV8IHoQDO7lgz4zhiWDeaZwHngHsZwBF92Ej\n1JgO9UYWaYAw78ZVNPP2gAxbsmwnXENE5uJzveI5bEwHeOn9YurjodrGnOcw\nuQFh6g5l6akUDyoCi5w857xcVBdjs/X4Im9dEX86/iUEUNwDauMb98hyShlP\nyGRdoUm0D+ctwty/lwDac5zl3eEInBl8ZC7Xk1CTX1J7KNhtXs2W8EMS04Fs\nY8dTxPuQ5H476AcvXEU5bOidcZgVMSUtpniXeDV3uOzj6f2tIC/bfmRzTU6L\nMRIN7uBudimN4sT3pPtssGpAYRNPhmrGzJfwPi/bQJqZrQJwFEU5vOR32dFE\nQxxmpd4GQkgk8FV/XU6my2iztp0iCCNUR4B2GzY6hANV1irNptaVm4OFmy4E\n2zSShpMv8H1kbrBvgOFj8YXTkCSWlvq9FjqeEM3ogizMbPZL3W56NktHuanV\nD1aRr876QKoW0XBkOaCkw0tC6drvIm4zt/J4ANUG0W22KGmHaWfBpf3XQlye\n8QPx\r\n=IONY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD5tQmWGwO4UnSLeboB+uXNrDhLOwFQGiQ3dx8UbYRc1AIgKscefkAx+Xhgh1iP/6/3+9FJDhIvMqWX1PQP4eCGvMo="}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.3.5-passport.2_1590604193507_0.511644700044394"},"_hasShrinkwrap":false},"3.3.5-passport.3":{"name":"@mihanizm56/fetch-api","version":"3.3.5-passport.3","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","node-fetch":"2.6.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","colors":"1.4.0"},"devDependencies":{"@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.0.4","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript":"3.8.3","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for http/1.1 isomorphic fetch\n\n### Benefits:\n\n- Provides validation for responses (based on @hapi/joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize\n- Provides cancel-request if the timeout is higher than 60 seconds\n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in browser and node environments (>ie11)\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in\n  hard-structured responce format or not (both interfaces are the same)\n\n#### Request input options:\n\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use @hapi/joi\n\n#### Request output options:\n\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n\n- body will be serialized in JSON if body data NOT FormData\n- try to use .unknown() method with objects in Joi Schemas because your backend may be extended\n  and without this method the responce data may be not valid\n\n## Examples of usage\n\n### REST API\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### get request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          }).unknown()\n        ),\n      }).unknown(),\n    }).unknown(),\n  });\n```\n\n#### get request with blob parse\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getPhotoRequest = (): Promise<IResponse> =>\n  new RestRequest().getBlobRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    responseSchema: Joi.any()\n  });\n```\n\n#### get PURE REST request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { PureRestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new PureRestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          }).unknown()\n        ),\n      }).unknown(),\n    }).unknown(),\n  });\n```\n\n#### post(put/patch/delete have the same format) request\n\n```javascript\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    body: someData,\n    mode: \"cors\",\n    queryParams: {\n      id: \"test_id_123\",\n    },\n    headers: {\n      \"Content-Type\": \"application/json\",\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\")),\n    }).unknown(),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createReviseRequest(\n  someData\n);\n```\n\n### JSON-RPC API\n\n```javascript\nimport { JSONRPCRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createItemsRequest = (someData): Promise<IResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint: \"http://localhost:3000\",\n    body: {\n      method: 'some method',\n      params: 123\n    }\n    queryParams: {\n      id: \"123\"\n    },\n    responseSchema: Joi.object({\n      items: Joi.array().items(\n        Joi.object({\n          id: Joi.string().required(),\n          name: Joi.string().required(),\n          name: Joi.string()\n        }).unknown()\n      )\n    }).unknown(),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n","readmeFilename":"README.md","gitHead":"2328c85c058d426fc73c6cf7afe38904d260ab35","_id":"@mihanizm56/fetch-api@3.3.5-passport.3","_nodeVersion":"12.13.0","_npmVersion":"6.14.5","dist":{"integrity":"sha512-B2ygXR8HXkJ7roUn1zdzVnfcsVPyGneCsW0AqLEvC3edol+iiblUW7HwqG2D6JFBseX/NMoFcfsr5vVjWyYJQg==","shasum":"70bb91764c82153f3a72ba4e485d5d454705c624","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.3.5-passport.3.tgz","fileCount":56,"unpackedSize":78006,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJezrGyCRA9TVsSAnZWagAAX8UP/i79ZYMWee38/xfzGpQS\nAwUjh6eGMdqYO4dhj2tiMAHOF+OPs9GaQe5Gdcw2Y3K7YLq5T/fT5/ATIhAm\n+fK8xReltMywvU3k1by+kALs//8N2EDc5Zt/M9L17YGCF29R3+37yPgaeh+/\nfYK4MwrBAeBCpa+dKkvloSdmTBkcmivNsTgU65346RIsvQWTkHQagb29+3qx\nFV5+y6M6Tuqj7IdGS55sGw/ELakVX7K+fnVxl/pXY36vMbMDd40pJykx6clY\nD3kRVa38VUjaM2yz8qzoMyfObawOtgWONMmYWunYMG7/0w7OFiCiQgiOJFKc\nnxFmty1tPG0ZetbSqLxiy/lVnUv+BeoOnetBD7eoeusefg8hKHaRl+SDo2j/\n3tStrLKPVTJoff4CoflvMKfORJLkdzbvKW++E05flsOua/lLMHchHiauN/Lk\nriIeWG+Xl9LY8f0jKnvTE34bx3uGN8Yuziy7WMG5pU3FN/37OklT0wKsXVYC\nKZbm074y/YWoLgo3LpXsz3QbGiM0baNqkyRgfhNbqslcLsKXSgntOgUwYFwm\nIonGXuxOpScmVkAXhwsoqfbFyC+MBBzt1wOgIl09x4MPV/kLqIFzuV9y4asF\n8VlVe2y/6LMxTGULope2Nd5cBrFT2Bh3aMzppxc7MpA3FIIE2Ip9rqFWfrBE\nT+um\r\n=bVUg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCUeklL1Sargs7bthL+vCI8ycg4U8JrsSp0dVc9Y6to0AIhAKn48XCVbqmtHZ5ri9pCuvSJBO7vLez8fqLiCAedZSXm"}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.3.5-passport.3_1590604209681_0.6384032916893259"},"_hasShrinkwrap":false},"3.3.5-passport.4":{"name":"@mihanizm56/fetch-api","version":"3.3.5-passport.4","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","node-fetch":"2.6.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","colors":"1.4.0","abortcontroller-polyfill":"1.4.0"},"devDependencies":{"@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.0.4","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript":"3.8.3","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for http/1.1 isomorphic fetch\n\n### Benefits:\n\n- Provides validation for responses (based on @hapi/joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize\n- Provides cancel-request if the timeout is higher than 60 seconds\n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in browser and node environments (>ie11)\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in\n  hard-structured responce format or not (both interfaces are the same)\n\n#### Request input options:\n\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use @hapi/joi\n\n#### Request output options:\n\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n\n- body will be serialized in JSON if body data NOT FormData\n- try to use .unknown() method with objects in Joi Schemas because your backend may be extended\n  and without this method the responce data may be not valid\n\n## Examples of usage\n\n### REST API\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### get request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          }).unknown()\n        ),\n      }).unknown(),\n    }).unknown(),\n  });\n```\n\n#### get request with blob parse\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getPhotoRequest = (): Promise<IResponse> =>\n  new RestRequest().getBlobRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    responseSchema: Joi.any()\n  });\n```\n\n#### get PURE REST request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { PureRestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new PureRestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          }).unknown()\n        ),\n      }).unknown(),\n    }).unknown(),\n  });\n```\n\n#### post(put/patch/delete have the same format) request\n\n```javascript\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    body: someData,\n    mode: \"cors\",\n    queryParams: {\n      id: \"test_id_123\",\n    },\n    headers: {\n      \"Content-Type\": \"application/json\",\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\")),\n    }).unknown(),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createReviseRequest(\n  someData\n);\n```\n\n### JSON-RPC API\n\n```javascript\nimport { JSONRPCRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createItemsRequest = (someData): Promise<IResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint: \"http://localhost:3000\",\n    body: {\n      method: 'some method',\n      params: 123\n    }\n    queryParams: {\n      id: \"123\"\n    },\n    responseSchema: Joi.object({\n      items: Joi.array().items(\n        Joi.object({\n          id: Joi.string().required(),\n          name: Joi.string().required(),\n          name: Joi.string()\n        }).unknown()\n      )\n    }).unknown(),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n","readmeFilename":"README.md","gitHead":"2328c85c058d426fc73c6cf7afe38904d260ab35","_id":"@mihanizm56/fetch-api@3.3.5-passport.4","_nodeVersion":"12.13.0","_npmVersion":"6.14.5","dist":{"integrity":"sha512-Th+uV3Gozhj09vCti4Y5MjM1Po7j4LfE8I37B5n+x+Fugi1mTjf745MrENJS9437lysgPB7qtotkamYwl/oy0Q==","shasum":"025150097ea5a224dfc20a80f337edd1c70b8b3a","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.3.5-passport.4.tgz","fileCount":56,"unpackedSize":78172,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe0Sh9CRA9TVsSAnZWagAADQcQAICaea7kvYzHdncSCKzi\nRtoGYLWNWzZtu+utLtes6lSQzZ3uz5/wrEyJ/OfAsOPIbMi5LsHiOgxBAGc7\npR9+X8S6sM5MZufVH4jLyIdOnCcZAsOaH5ahOxiHL0SUqHZjDRYncQAoyt5G\nFLDiEsJSdrRnzyGC1GFLp1NkWdb/CiPcRPqWCnjQ6EtXKRnlwG3fOFYULnh9\nsw6TW8O35EELFi9x11lYIP/PfbIYmvzgO9P48aduWz9xP+PKwKolfOwKwKZO\nYB9I7ng9wl6sRqvAwCJHsqlMFNS+N+HaoZFrS63bVBIF/sTgxSG6MKcXgWRb\nHjc5nheW8V2f7pllaZz+eSwa1IXfJt34JneD839W+mRTx13xDXZrq01eLZxP\nJDOX+alyIDgysI821Rq1KiMFXzfz03ulH/jvhXlePh4K1kqxWsUVH0/ZMynX\nxQXNJnl07Sf0t97c3TkBiE1832iFVsBfOY+T2LA7jU4/6hUh0lmlCgeX/+0h\nmf8F5013dXMr/v63kET2FvQlyuQ/vLvmaRqEg3YcBljEPyk7SHDi0mAjf1Mf\nJczaB3PRV9VHD88FVUQyN+rQ4LzmVtVK/vW5hzVqGUAdG/oIWBAFvnibgqw6\nmbQHBudvfsc6+eXw02Q8L3r0s7lHMVsgNKPoJvPLMMQf3wOfr67eS7wAAbIM\nkvV2\r\n=FUrC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGDqZsAAHkj0MUoIH0k/Dc7Ydz/bwb2MBb6eFGV+vC1tAiASaYVE9uSF0pe518ko4W6H66SAcr6jWLw+2eNkd/R50A=="}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.3.5-passport.4_1590765692503_0.7202511398094873"},"_hasShrinkwrap":false},"3.3.5-beta.10":{"name":"@mihanizm56/fetch-api","version":"3.3.5-beta.10","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","node-fetch":"2.6.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","colors":"1.4.0","abortcontroller-polyfill":"1.4.0"},"devDependencies":{"@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.0.4","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript":"3.8.3","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for http/1.1 isomorphic fetch\n\n### Benefits:\n\n- Provides validation for responses (based on @hapi/joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize\n- Provides cancel-request if the timeout is higher than 60 seconds\n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in\n  hard-structured responce format or not (both interfaces are the same)\n\n#### Request input options:\n\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use @hapi/joi\n\n#### Request output options:\n\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n\n- body will be serialized in JSON if body data NOT FormData\n- try to use .unknown() method with objects in Joi Schemas because your backend may be extended\n  and without this method the responce data may be not valid\n\n## Examples of usage\n\n### REST API\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### get request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          }).unknown()\n        ),\n      }).unknown(),\n    }).unknown(),\n  });\n```\n\n#### get request with blob parse\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getPhotoRequest = (): Promise<IResponse> =>\n  new RestRequest().getBlobRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    responseSchema: Joi.any()\n  });\n```\n\n#### get PURE REST request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { PureRestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new PureRestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          }).unknown()\n        ),\n      }).unknown(),\n    }).unknown(),\n  });\n```\n\n#### post(put/patch/delete have the same format) request\n\n```javascript\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    body: someData,\n    mode: \"cors\",\n    queryParams: {\n      id: \"test_id_123\",\n    },\n    headers: {\n      \"Content-Type\": \"application/json\",\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\")),\n    }).unknown(),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createReviseRequest(\n  someData\n);\n```\n\n### JSON-RPC API\n\n```javascript\nimport { JSONRPCRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createItemsRequest = (someData): Promise<IResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint: \"http://localhost:3000\",\n    body: {\n      method: 'some method',\n      params: 123\n    }\n    queryParams: {\n      id: \"123\"\n    },\n    responseSchema: Joi.object({\n      items: Joi.array().items(\n        Joi.object({\n          id: Joi.string().required(),\n          name: Joi.string().required(),\n          name: Joi.string()\n        }).unknown()\n      )\n    }).unknown(),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n","readmeFilename":"README.md","gitHead":"e93ee7547f9f9ad003c3b8e57cc64e25d0a55609","_id":"@mihanizm56/fetch-api@3.3.5-beta.10","_nodeVersion":"12.13.0","_npmVersion":"6.14.5","dist":{"integrity":"sha512-jiCfyLyn+5rqDfx/NbiBK/88lv2YjQ2SQvqkhD85+Bszz5+jlCjaPKBGGU1iV2+qgD9a8LJ6lBOOtgK4nVbdrg==","shasum":"665b76a39f4b5afc329fdc884c1ff695ce28f454","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.3.5-beta.10.tgz","fileCount":56,"unpackedSize":79744,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe0vbgCRA9TVsSAnZWagAA2usQAICXk6rJwXJB0P4HUzeD\ntX8qhz7XSqnQhE0hGyAnNSU2bCu0R6pCCYvKjpNNI9eB7oSmYok8Nb12sXz7\n1GedJ5IP2OHbodyrIwvVS+lTNiC/pUNKY3z9Rzj5potcr+KVUmxiQOL3O2Gg\nFrsK42js+SC73iOwJXLUEr8o5bCczkSN2l33eafFvIeyBnJHwr/PTNZR0COe\n0VQmU+AYwfAoXqxa/lSPAbtYsiZG5Sy8nfs7VE6pXmipg84mRNZ9g1jYGZuK\nnlg7k4Eo27IFeqPrpKiA754Qck0wc/pNWpH7+tfB6WpV/otJLbcd9cxTIsq/\nRCr5X9UmDkK74pbYtvqd5U9Ra2NOzjeC5jqjMFm+l9Xuzjvv2pa0iOJRKNLr\nWH4MKYAa01mXCcrfbcTjITWoKnzhiMsei36J7WUiiLd+6CfTC3yGHOkxNQB8\n+xUZV1ujIM1iQHJJWvyEZ/sVqid7nBYFpvVjUBFQovvt5auPWhWcJKEVzmIY\n8k1dwoD5VTqun6/lgtibCXmgBrWmCHaCrRPtyHhx0RyLdsPnS/OqiuOffXR5\nIIpns/arSnk7yIjV1vQAL+mXLoLSz3+hTlx9n9pdWlTL7LnUzb1Ywalh0C15\n+THBKgJjwgkHlpxe7suitAOwa49FJccqUaLLChpyXJvdMR4I6/uYO3TQOnZY\niHio\r\n=drj5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC9Rlca1/AJ8uX1KD0CpAlqRUwqDBtW2OomCM1bzPwLBAiAHODDMSMqplr1ghEzwn7/bl+HL6x5w7uEg1LH0ujEuZg=="}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.3.5-beta.10_1590884063782_0.623011586595188"},"_hasShrinkwrap":false},"3.3.5":{"name":"@mihanizm56/fetch-api","version":"3.3.5","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","node-fetch":"2.6.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","colors":"1.4.0","abortcontroller-polyfill":"1.4.0"},"devDependencies":{"@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.0.4","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript":"3.8.3","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"gitHead":"2a3ff3903734eeeef921a0ab873bed66ed68e641","_id":"@mihanizm56/fetch-api@3.3.5","_nodeVersion":"12.13.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-nKPDmMUga//2RfluPitmBAQL1dbYVIGpQ/DZjc4pxwWIAZZxTwjcFvqH0PSNCRcYa/gqvUCmrf5rrNzX10w6Iw==","shasum":"cad94cd7031334aeb170ec0e3d6ffae0381a77dd","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.3.5.tgz","fileCount":56,"unpackedSize":79737,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe1SfcCRA9TVsSAnZWagAA4ZEQAJOZZfvwU9NGNx9rdiGn\n0ZqRMzOnlWLmFvWr/ghM/IQ71TVWpzB/QZMEoctdnHOgW3aMvQxJRc0Ux7gF\nUv5BFAXcs0nlyRT3Oe4QiF2NiLOWcKeo+3mKkl6gZHxL+L2udu3O7YR+MusL\nECtraIRZ1p+MPZkKy1oLDJWZfgMvMmB6U7wdujnItFihsoCqGLnGj5A7xB87\n/MbknBco/G3PKRrGwa3PKO+fxg/A+bx+aM0Ax3cbPHWK8oi3OzCmNTC6EDus\nTqb2wci1Kds27Novl1/iM3YbN57SihBN1TwZHkcVFi6EOfKw978ZiH96bAYe\nZFx8IuNEOdjfSedRDYn/YQ7BcIEYFH9CvS4pbmERwh3nMomhY0EtQD77ehBD\nBAWhDNlV0D7DxNpvnSOBoYK8JKEs9Zm4N8oLZXx//3AWBOJAsVFE3431Xt0b\nQFa1TJeGlL+lqTv3isuXNYmMEweqA50J0Mu62uHwQu4wx/7A1LDi2HnobCSF\nn/enCWH2dI6MkhgTakWR8YnqMJA55Bfouc/hs4gmu4K7zoTP6z0bw1XpcIXO\nIiVRIOBRR/DW6ghLb1kyR4MBNgWVS+ODj12F6w95N3a9S7yqP8eCJon7+NOa\nkDvVFWFEk7HWClJuB/Jvzw6RKd04EA/3R8ipp+Y4U+2WZDGZjHmULqbLxd9g\n/pLl\r\n=fVmT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCID6N5FzHLhzGIDc9LpdOtMl5AzcuIGdIK7ykFXYNu5IiAiEApC0FI9WILvxPt70yoKtjEIIQKvbbfz6aWk6GW9fMo/E="}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.3.5_1591027676071_0.1904919478380176"},"_hasShrinkwrap":false},"3.3.6":{"name":"@mihanizm56/fetch-api","version":"3.3.6","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","node-fetch":"2.6.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","colors":"1.4.0"},"devDependencies":{"@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.0.4","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript":"3.8.3","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"gitHead":"84ad7c65b600000b7da0254709811521810f0bf4","_id":"@mihanizm56/fetch-api@3.3.6","_nodeVersion":"12.13.0","_npmVersion":"6.14.5","dist":{"integrity":"sha512-5qTm7fFxy16Nv/kyQiczH8IXo7hk9HIlcQcJmJNuJfHGV5Yox9mEpsoE+/76NZqovKOrVRLxtNWTjYSoHDF4OA==","shasum":"7d6e8e5a298136180d61850de2d89b7a29a4cc05","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.3.6.tgz","fileCount":56,"unpackedSize":79766,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe3Zh4CRA9TVsSAnZWagAAowIP/Rziewc0klcdfU4hTO+P\n8ImgQjspaxdxx0UTucqvwGeUSazkY7O6UC0pGSDqqiCdl2uuTd+dNxOyvK3p\n9dt7oG/GDteTfUA5otpTZhxHupnGuRTyvmWPduYM54k+j/HHjAS2t/NitVk6\nhMPLDIVT2ifhzkTwSp1Hzq0SeixYiSkZJAdow8Y2UUejCNvvmJ5Nn5Z0nfBm\nnGGqbEw5hZ5Izzzr0Iy7B/Vss/uSinHacjEPpyIoX4IdAhXDCyW4hSgNlSq/\ndIIEBS5IrHGrJPln+olcHUqK3bATkIxXK8LmZQpQqGRDJNhUDdNCenq2rrEL\n64UkD+r4Bl9KMGNBeqqiuZL/w3obWaCCIz/Q8MGGIotctT+HmSct/DDAaipU\n7PIzE51xqAgQAq0w3kNiHuaG8g9uhymExhtrQ5KiLpwSkuKVBbV5RJhidgW5\nrTI4+XXZsHv9gDDtmsRLXkuv8zOc5RkC3jodMYbsVa4U5rp7kn/3H7Ien1Ti\nyh1Y29z4PcYVDWnyB3MhJR+V+MX7n7ZxsC199ZQri4uIaO/HBhvqeIF/VeuT\ngnjOCqbMF5bZK1vQa5p8yTq9qr0lp3hHUevg6VsK9LxGiDaZeV8CbOtp5vQD\nfIRsEotVD6NKQEBJGpGOQp/44vW4F+1mxhiac97pZyZBWroZTjGcrCiK6qOY\nJIPa\r\n=2q7O\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCsrz7kL6aV5EbSFZFfKxZRDe7zAMybBYV1/TX8/mSXvgIhAKGpcyUJZ9b7ZmRaY0oqJ9UoUx+vt0iKGYx+rgkrnRLL"}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.3.6_1591580791621_0.9788733947129649"},"_hasShrinkwrap":false},"3.3.6-beta.1":{"name":"@mihanizm56/fetch-api","version":"3.3.6-beta.1","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","node-fetch":"2.6.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","colors":"1.4.0"},"devDependencies":{"@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.0.4","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript":"3.8.3","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for http/1.1 isomorphic fetch\n\n### Benefits:\n\n- Provides validation for responses (based on @hapi/joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize\n- Provides cancel-request if the timeout is higher than 60 seconds\n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in\n  hard-structured responce format or not (both interfaces are the same)\n\n#### Request input options:\n\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use @hapi/joi\n\n#### Request output options:\n\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n\n- body will be serialized in JSON if body data NOT FormData\n- try to use .unknown() method with objects in Joi Schemas because your backend may be extended\n  and without this method the responce data may be not valid\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n## Examples of usage\n\n### REST API\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### get request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          }).unknown()\n        ),\n      }).unknown(),\n    }).unknown(),\n  });\n```\n\n#### get request with blob parse\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getPhotoRequest = (): Promise<IResponse> =>\n  new RestRequest().getBlobRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    responseSchema: Joi.any()\n  });\n```\n\n#### get PURE REST request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { PureRestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new PureRestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          }).unknown()\n        ),\n      }).unknown(),\n    }).unknown(),\n  });\n```\n\n#### post(put/patch/delete have the same format) request\n\n```javascript\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    body: someData,\n    mode: \"cors\",\n    queryParams: {\n      id: \"test_id_123\",\n    },\n    headers: {\n      \"Content-Type\": \"application/json\",\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\")),\n    }).unknown(),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createReviseRequest(\n  someData\n);\n```\n\n### JSON-RPC API\n\n```javascript\nimport { JSONRPCRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createItemsRequest = (someData): Promise<IResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint: \"http://localhost:3000\",\n    body: {\n      method: 'some method',\n      params: 123\n    }\n    queryParams: {\n      id: \"123\"\n    },\n    responseSchema: Joi.object({\n      items: Joi.array().items(\n        Joi.object({\n          id: Joi.string().required(),\n          name: Joi.string().required(),\n          name: Joi.string()\n        }).unknown()\n      )\n    }).unknown(),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n","readmeFilename":"README.md","gitHead":"008c4abe4a9b07e0f0a316b4bc2e2973ff11bf22","_id":"@mihanizm56/fetch-api@3.3.6-beta.1","_nodeVersion":"12.13.0","_npmVersion":"6.14.5","dist":{"integrity":"sha512-2xMlV0x4Qe6R0X0+4tVEsK4wOj2wK4adHgWPLBe9PV3rUQuIzjOVQPgWwOFVm8erubnHIud4rMfU4L/f/r3EjA==","shasum":"66ea900723c4a5720a2df76663156c3bad6a1b3a","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.3.6-beta.1.tgz","fileCount":56,"unpackedSize":79673,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe55bKCRA9TVsSAnZWagAA09cP/jSUZHrAtUlKu/S6eX+J\nluY+BU2IfmaBPUJEg1C2fsvV90HDKNZBVBkZEm7yY9LLdQzzuaPMFVKn6nrr\novZS9JYgJlNp0MjgH+EOt3DExU26b+AE95DTxCp1Nv/Fn1ohRL6RMveSJ4Wb\ntHDwnMDxwx7RmfwEytzPOH244PjAA65hfTnSWYQcpodkDEb41hAB1bWptHpc\nBeC/mVaOjh7d2KRyneLSw9kYNNmQYd+1B2kZtHMrdxJ4nyANTKVhBO+6qnf8\ncRVIStrYawUxxdvlmq/uOYh942XRqhdGypn9C12X3A8CRxWMFpwRakksexaT\n+EYMOVhTBPbBZZW71qXLisyt4yYvZTDJb1I2KdXeuMTUcRWF8ECe5HrBAj8e\nvhHKTmINR9Ze6ucZgiCOLKBH2PqXmyNXWhAMPD7thFsJztaDGfXsQpe9UoOs\nm1O0titdtNW5zCRWDLs6Ln0LKvYOZE4WWlkFDoWV8upL1IBZDRdFA8q6hB8W\nyja4PwP6wvllGiIgLw5Kvz4UhE0802unPtERLkkGf2/UMwvjytOeGgfC9ed7\ns25NkKPEriAVC9e3VbxWuJ336Jds9lfOxtwf8mDYTdk4GrfE+mhUzuqDFB9l\nJcuO3zyM0VwarDanTV8wz3o0C66EscVLKitlixm1m6jNVPtMoFhBm2JSffu5\njhKc\r\n=QZNP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHVd/JRP3nFqcVlWfJCfgLjKRNXt0Lx+YzkzwHfcc5caAiANVYTo99ODZJcFlxFXaNaDUxMUYPdYEio/1ywIDMTzEw=="}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.3.6-beta.1_1592235722362_0.8726980221437257"},"_hasShrinkwrap":false},"3.3.7-beta.1":{"name":"@mihanizm56/fetch-api","version":"3.3.7-beta.1","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","node-fetch":"2.6.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","colors":"1.4.0"},"devDependencies":{"@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.0.4","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript":"3.8.3","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for http/1.1 isomorphic fetch\n\n### Benefits:\n\n- Provides validation for responses (based on @hapi/joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize\n- Provides cancel-request if the timeout is higher than 60 seconds\n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in\n  hard-structured responce format or not (both interfaces are the same)\n\n#### Request input options:\n\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use @hapi/joi\n\n#### Request output options:\n\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n\n- body will be serialized in JSON if body data NOT FormData\n- try to use .unknown() method with objects in Joi Schemas because your backend may be extended\n  and without this method the responce data may be not valid\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n## Examples of usage\n\n### REST API\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### get request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          }).unknown()\n        ),\n      }).unknown(),\n    }).unknown(),\n  });\n```\n\n#### get request with blob parse\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getPhotoRequest = (): Promise<IResponse> =>\n  new RestRequest().getBlobRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    responseSchema: Joi.any()\n  });\n```\n\n#### get PURE REST request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { PureRestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new PureRestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          }).unknown()\n        ),\n      }).unknown(),\n    }).unknown(),\n  });\n```\n\n#### post(put/patch/delete have the same format) request\n\n```javascript\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    body: someData,\n    mode: \"cors\",\n    queryParams: {\n      id: \"test_id_123\",\n    },\n    headers: {\n      \"Content-Type\": \"application/json\",\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\")),\n    }).unknown(),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createReviseRequest(\n  someData\n);\n```\n\n### JSON-RPC API\n\n```javascript\nimport { JSONRPCRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createItemsRequest = (someData): Promise<IResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint: \"http://localhost:3000\",\n    body: {\n      method: 'some method',\n      params: 123\n    }\n    queryParams: {\n      id: \"123\"\n    },\n    responseSchema: Joi.object({\n      items: Joi.array().items(\n        Joi.object({\n          id: Joi.string().required(),\n          name: Joi.string().required(),\n          name: Joi.string()\n        }).unknown()\n      )\n    }).unknown(),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n","readmeFilename":"README.md","gitHead":"d8de5ae88b1ce25c1b4c1532fed047ae2d20692e","_id":"@mihanizm56/fetch-api@3.3.7-beta.1","_nodeVersion":"12.13.0","_npmVersion":"6.14.5","dist":{"integrity":"sha512-1sv6zNRKYvfdSPUUjrnIYZN0Lu9K8QuaEDfl4c3hYlfenOamGTS3EBEDyMrslMt6g9uP9enHaVCU1uy6PVt5Hg==","shasum":"dddbb425f9b55e8ef9b3bf5f191ab162c141571c","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.3.7-beta.1.tgz","fileCount":56,"unpackedSize":79673,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe55cfCRA9TVsSAnZWagAAQs0P/3OOFi+BhS5T0e3jNqA6\nLwre7D+rBBKCnfhTfORYzyPAM74/Y9tm/ft1R1T9FP9XoX1CVAcl++mEoB12\nHCJHFeapLM1RrylimlwgyyvPxYOV+YtO9S0Cj8EiUYKvIT0YIfwGdo/xc6tp\nUcDGuhUrZTyIlzH8poRG9dIKoqaA65VyG0eiw8qvyZfVgllIvPJiP6c9cRTE\nM/i8hJBl0oIkxo87+tAYFPHbcy7qh3YA4bWYf1JyZ/TEJDU85vUQE2r7GSAz\nB6V5BRP5SHGlNhB+sDl0l73D8ivFbIkbNx+tniiCa03GBymTxzbskaSJogoc\nt/L5AfWeJTatbXsLWFYfBmkGaz1mRepqLmOU5Ppugw42KDjGy+P7JefGDjGt\nxyY6NdPU6gWIZqYBwYEUo8Xj+yetPyHPJO0uIVr2tlJxURSZZMqJhDfAHO0s\n0P/4hrNc7S+n/bRYhrFtRvR2U7ThJ1ig6xXNHfBkQKardUOJHsxieOTsDqqb\nuKJZT3jMkNVdUpvEpdC00SB4rL6MICfRl6CXG51kX09comjTUqH/AZsJOK24\nmGZyixtO+kquRXCNTLZQJUw8Ah30UJ/6UhV8G2BCyoOZtG61OWCJrMkFR/f2\nbgMvswe9BN2kkCIgL3JoOuYz0eUdjsBVNaCcIXuagz4FmuJe5LK209I6ZK88\nhLr4\r\n=CS+g\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCwjA6M/jqPeWaGuCpiwC1vwkpHAszUWL07gie8onhgRQIgLUufhwUDBH+X4PTgtgB2zldbBoOyimNGa7+5C41QCdw="}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.3.7-beta.1_1592235806976_0.6663725247329384"},"_hasShrinkwrap":false},"3.3.7-beta.2":{"name":"@mihanizm56/fetch-api","version":"3.3.7-beta.2","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","node-fetch":"2.6.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","colors":"1.4.0"},"devDependencies":{"@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.0.4","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript":"3.8.3","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for http/1.1 isomorphic fetch\n\n### Benefits:\n\n- Provides validation for responses (based on @hapi/joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize\n- Provides cancel-request if the timeout is higher than 60 seconds\n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in\n  hard-structured responce format or not (both interfaces are the same)\n\n#### Request input options:\n\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use @hapi/joi\n\n#### Request output options:\n\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n\n- body will be serialized in JSON if body data NOT FormData\n- try to use .unknown() method with objects in Joi Schemas because your backend may be extended\n  and without this method the responce data may be not valid\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n## Examples of usage\n\n### REST API\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### get request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          }).unknown()\n        ),\n      }).unknown(),\n    }).unknown(),\n  });\n```\n\n#### get request with blob parse\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getPhotoRequest = (): Promise<IResponse> =>\n  new RestRequest().getBlobRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    responseSchema: Joi.any()\n  });\n```\n\n#### get PURE REST request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { PureRestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new PureRestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          }).unknown()\n        ),\n      }).unknown(),\n    }).unknown(),\n  });\n```\n\n#### post(put/patch/delete have the same format) request\n\n```javascript\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    body: someData,\n    mode: \"cors\",\n    queryParams: {\n      id: \"test_id_123\",\n    },\n    headers: {\n      \"Content-Type\": \"application/json\",\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\")),\n    }).unknown(),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createReviseRequest(\n  someData\n);\n```\n\n### JSON-RPC API\n\n```javascript\nimport { JSONRPCRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createItemsRequest = (someData): Promise<IResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint: \"http://localhost:3000\",\n    body: {\n      method: 'some method',\n      params: 123\n    }\n    queryParams: {\n      id: \"123\"\n    },\n    responseSchema: Joi.object({\n      items: Joi.array().items(\n        Joi.object({\n          id: Joi.string().required(),\n          name: Joi.string().required(),\n          name: Joi.string()\n        }).unknown()\n      )\n    }).unknown(),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n","readmeFilename":"README.md","gitHead":"8f2e20e37af457638a167daba27aa89505ef568f","_id":"@mihanizm56/fetch-api@3.3.7-beta.2","_nodeVersion":"12.13.0","_npmVersion":"6.14.5","dist":{"integrity":"sha512-LLymEW8kLJNkqu+aYEM54sDB8Hms4brYY0rqsAKs8P+/5ON0K5mdtFvZgIc3IrixYXuJZ2TbAgrjGhZ2+Lkrlw==","shasum":"27d83f182ed7afb81ba6fe49675c892b51bcf8c6","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.3.7-beta.2.tgz","fileCount":56,"unpackedSize":79481,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe6fgoCRA9TVsSAnZWagAApvEP/3HY1aFfLLKKHddR8UkS\nbiRHYdG7jJxtqbHD48kF3cwXhZG3RdgOSD8lOr/kHsvZ1T3XjBJ4WucYI4wn\na4nwsLaoXEG5kUvgI0drlrfPtIS9eXMQ+Lts9Xtq5PZpxZyz8nPoC+TBY7HG\n/l8dQ4Dmk+ZTWq/I48OLulHzGOAE6l35gD6864M3D0bPmAZNfv1x+2wqQFCv\nyYkOj29pHQMjHY8hUTKV1Phjho/9edvaVWwWWy6shNbJHCDmq+fnIw1Mr87N\nHuS/6POmn8AsqMxIJ6BXAGlXSu0TFNmSp0dLjIIqGB1mksWwwV+IpESPg7H6\nFtIa4o1KOK1vSUbhwtcSVagEi2Y4VogftG9kyVVf7W6siQ3JsNHx4aE9vQzu\n3i/pUpfz/vvE0vLE0VPmkwJR5OtYQm2We41KyYxG4gj/26PlBsqsAewggLNb\n7njLQm7O5nGIwcmexi9urtPEib9mgFuGPCiiq+ZWSCgits2oYvBAKwKSdJSj\nKukfaBYLxdAMJtUht2LvD7xaElvd9o1PZ1eZsj83iSReoZ0hndVnLyuelTwR\n+j7FHTv5JVTxGnVbGnpdvd9xvh5aoA62h8i8MvhJAcNJQsA/Gfu5wkJTsnjU\nroUypUt38VF4eshTr/miwagYQhKlZSzBULeMbUtvoqf7MtAzPGMZaP+BE4wT\nMl77\r\n=8atZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIE53UOcyp/49mbgOhsfhoRiiLqr/hwW763s4xZMCn03kAiB1/NnU3ZyT+ElBkRIEkVc2b1+uT9XvMra6isUR+rxH+Q=="}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.3.7-beta.2_1592391720164_0.9682789554100091"},"_hasShrinkwrap":false},"3.3.7":{"name":"@mihanizm56/fetch-api","version":"3.3.7","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","node-fetch":"2.6.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","colors":"1.4.0"},"devDependencies":{"@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.0.4","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript":"3.8.3","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"gitHead":"40dd9849883711c2d0132c845bd44225550c41a9","_id":"@mihanizm56/fetch-api@3.3.7","_nodeVersion":"12.13.0","_npmVersion":"6.14.5","dist":{"integrity":"sha512-otWLw/SYwiYLM/xDToeKemtaydTR0n2foJ+1FbejtuR0I9QyiqcwHiQNK2n7HOUJNK5bnIUGBWe/29iKBGGs7w==","shasum":"46b11512bf108775d4970f6fa6692415388c570f","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.3.7.tgz","fileCount":56,"unpackedSize":79474,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe7qLdCRA9TVsSAnZWagAAkyQP/2HKtZjLlOtke1fTb4wT\neVHMTQDsG4HbAsiX4eVXCYeLYoiLh9Mr3VMSkQHGisBvjv9WczeFdVCsejll\nH9dcIxBAeBa+jjLFg+zH2vyR+7YoSNal+g5A8xOIMY/XIb9XWEQDXQeTrHc7\nO/8RU0bqUgMLm8vQBu5OoU1S01EGrrFVx+hMZd/NzbaKUrfp2XX35lI+RrSY\nFFcwQ4adeWxkbm9hLFkePemZxvKcn6x/J2oCj5jn/UoGcW8AOsd4WnERW6Ox\n2wDzfbCBXkWeDM9bN8u0S6l1RmShj5lnMzKG6ga49XFr8PNHrzUXkCV1ssED\nBVyCso+QvNZb7okBLLY7enY5ISvvqpmy27SZdVTJZ0+IJwi58NwH7dPG2GXZ\nCGJNcczuTx3eeYcHyeJUmxNX794NCHHG7lVUpHnFS9DTG4B7Bg5/UhVmWt31\nIx9KUhem4dFCuUtmvxvANroRnzFcBi1UawFG0fSWZt4tV8QLoWCpGZhzb67p\nieG++af3FJnCPB152Yf7Mm1ql7VAeBdVPUXa6YQ43uPHuQUxWTWQn0Ch3+r4\n7NYLDeVnRBc66uNT4rXcHlhrJbkqzmbKwiil53J/3K/9Wktsf5X2Ls3iIXmp\n537oM9k05FL73TcWPgfZZeXS4QZl8xegu+Pa7AHOqrIqpylzWLkuczciGDFa\nW2l3\r\n=tG44\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGSzJ3SdxfTXuXz6mnwyuMQZ3+MJ2wF4XWD7lfuNEjmQAiByiwPAeKHJExFqh1zJ1kFZWMXWL9lsT/xTi4avDxKUGw=="}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.3.7_1592697565056_0.7755413242974329"},"_hasShrinkwrap":false},"3.3.8":{"name":"@mihanizm56/fetch-api","version":"3.3.8","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","node-fetch":"2.6.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","colors":"1.4.0"},"devDependencies":{"@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.0.4","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript":"3.8.3","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"gitHead":"09352608961d1a97ff8422b96e756ee4f7c2db42","_id":"@mihanizm56/fetch-api@3.3.8","_nodeVersion":"12.13.0","_npmVersion":"6.14.5","dist":{"integrity":"sha512-3II1jRKYCnHZIR9pZAyNFpk5kkmlCrxUuVig4PdVOccL0agMZMtLSaSVjbD3B+1PLCrnyky+d1cUn8ieIh+L4A==","shasum":"5f767cf8608984171dfadbefe99fc74fb0427fc3","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.3.8.tgz","fileCount":56,"unpackedSize":79547,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe7qOPCRA9TVsSAnZWagAADt4P/2C8NlkClc/T1kG7n8EX\nza78qGFEftH3aAlrqUXL+lFbUKXLG/LFUWK6skTrtZqO2b4Zx4Z38BXPOVsX\nuE14OhZSGGi6kSQj/Krb18+Og0OZE7Ek/AHkCYgy03IMwzHMrBDhBhwv431g\nVEdOgRmrPx/GaWoKZodNIPU/bKhn8ZZglOgtFgKuZ7GawvC1TtQMZDKL0lkJ\nf0/PYKZNyHqnWN/iCBYm9qoIE+3GCT61azDT/IB7VBY94p6gFSRmhjwB5eu8\nG+oOHGIWd7Nbq5PHw79iKo9r6MlhZLPWc6QRJTuKD01WD6pwkjLMzBaS9JNY\nnWK22KIt89vpH+Hg52633vL0QMTlU3Ix3M2HiRuZThWlwRcYWyFc/UnyMH6o\naaqvxvd3XRnbim3quvK0am/XWeTFhCWOppS7SslM4JbKe29mH/wWHY8UtOPN\nII0BEJjHHfZcho/o7MV0YPAToJe6jAawWM3tDa8nqY1itSjISBK2fiXTlUc1\nINL8PEajJNBN/n2zW2WeqwK9gzvWGHKvsS4jLsCDbfaue3fEl17Ko8i6M0dG\nAWdxdVOWVEz6jTCfqzKioxrQ9ejYlePeBZx9CwZA3ukuPMulUH3qVitNkM4L\nYNSxBJJoD7jhiJYLkVv9tmOusD3/SWp4ZcIyWfv3Iw9KLXKhTByyZFSx3UHq\nteeG\r\n=P0R9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCID9DKK6KGaeS+VXxGK8lGwmZzCgRrFGaU2pPaeAYL0CWAiEAstSIZyLnYGO54o6Tm4Usx2BUMJsE3wh4hh9aWwX9Cis="}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.3.8_1592697743308_0.527628943496047"},"_hasShrinkwrap":false},"3.3.9-beta.0":{"name":"@mihanizm56/fetch-api","version":"3.3.9-beta.0","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","node-fetch":"2.6.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","colors":"1.4.0"},"devDependencies":{"@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.0.4","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript":"3.8.3","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for http/1.1 isomorphic fetch\n\n### Benefits:\n\n- Provides validation for responses (based on @hapi/joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize\n- Provides cancel-request if the timeout is higher than 60 seconds\n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in\n  hard-structured responce format or not (both interfaces are the same)\n\n#### Request input options:\n\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use @hapi/joi\n- customTimeout(number) - milliseconds for cancel the request on timeout\n\n#### Request output options:\n\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n\n- body will be serialized in JSON if body data NOT FormData\n- try to use .unknown() method with objects in Joi Schemas because your backend may be extended\n  and without this method the responce data may be not valid\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n## Examples of usage\n\n### REST API\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### get request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          }).unknown()\n        ),\n      }).unknown(),\n    }).unknown(),\n  });\n```\n\n#### get request with blob parse\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getPhotoRequest = (): Promise<IResponse> =>\n  new RestRequest().getBlobRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    responseSchema: Joi.any()\n  });\n```\n\n#### get PURE REST request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { PureRestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new PureRestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          }).unknown()\n        ),\n      }).unknown(),\n    }).unknown(),\n  });\n```\n\n#### post(put/patch/delete have the same format) request\n\n```javascript\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    body: someData,\n    mode: \"cors\",\n    queryParams: {\n      id: \"test_id_123\",\n    },\n    headers: {\n      \"Content-Type\": \"application/json\",\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\")),\n    }).unknown(),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createReviseRequest(\n  someData\n);\n```\n\n### JSON-RPC API\n\n```javascript\nimport { JSONRPCRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createItemsRequest = (someData): Promise<IResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint: \"http://localhost:3000\",\n    body: {\n      method: 'some method',\n      params: 123\n    }\n    queryParams: {\n      id: \"123\"\n    },\n    responseSchema: Joi.object({\n      items: Joi.array().items(\n        Joi.object({\n          id: Joi.string().required(),\n          name: Joi.string().required(),\n          name: Joi.string()\n        }).unknown()\n      )\n    }).unknown(),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n","readmeFilename":"README.md","gitHead":"0dcd291a8e01950cbc9ff173c5d02cee05377d4c","_id":"@mihanizm56/fetch-api@3.3.9-beta.0","_nodeVersion":"12.13.0","_npmVersion":"6.14.5","dist":{"integrity":"sha512-/8oFcr8H8kJgQr0pJPXbVwwNXFqSK1DcsES+/Pmu1RAhmsx9WjzYrC6oMjhWuTqYuQRISK03H6k3xPRKkfkatw==","shasum":"0807db8e399d7765d251c3de202160406e38a28d","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.3.9-beta.0.tgz","fileCount":56,"unpackedSize":79603,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe9ecCCRA9TVsSAnZWagAAZp4P/2i/rPHd1unVMdtBNMkR\nJ1YspHfKPLkiPdIheemwo/UzSU6rw7HLxT0dZXU+TbUbVspZC0RKUDtEWgOK\nl0jbY/TqcK3Et5+cVpzVYHdkfVQPgHf+I4tCvZ5BzUleHdlv9F6U648DdztX\nsgVtbt37Uwoyb9S19metPM2ysmbwK/9sb0aMkshvxElXygYv6oc5vrVzNCwH\n9uR95Dg9GUNd4Y0XLTgW/J5v5XzpOBowye5nPOsio84lgX7rcPHORaCf49EX\nlqEsCi0TVa+SYRDNfMINhbWrPRaWQtZRC2WPOHKBEsJZdGQwAGE44s8VvPc5\nmKhR17GnS0rAGYkFIOYWTyFp66UqMKg5GX2cH441zB+KszF6nSPoeeDxEKSi\n+npzlb8BaHgCtAiYETD94D1M/LZdro9hvHd9dNmhAmtpVNSURJBUVq8/Gw3e\niTwlSekdGJVyJGtdTGSi6RrGsHvV7avVFta+beMBRsJzAXQepjt9W9DSbNsB\n7HW5E9i4pwcqq7/QKQJaPKyYGCeRBwWsz9Wlp2u65YDsHkttUsmZ3D7wPAOd\nzYjOtzL9/7fueaZ1uk9I719zfPTxG5EkXSae55cb2/8CzpItsztUhYg8DA8p\nm5+5zZDy24i7Xp7wQkusTAGSrveKtTpxnFjuAIU/BpQN0rSzpXCUYYwOSR9H\nXf0N\r\n=kbEQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCrh4WNuXiFJk2ZPXJ5C7IdgAmUiJgh7R8cacLcvkRHAQIgJjDehVPzYvcmRmSpep5+pI2aZ17Le6kXd6+kIi1Fz1U="}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.3.9-beta.0_1593173762158_0.9113813507177477"},"_hasShrinkwrap":false},"3.3.9-beta.1":{"name":"@mihanizm56/fetch-api","version":"3.3.9-beta.1","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","node-fetch":"2.6.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","colors":"1.4.0"},"devDependencies":{"@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.0.4","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript":"3.8.3","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for http/1.1 isomorphic fetch\n\n### Benefits:\n\n- Provides validation for responses (based on @hapi/joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize\n- Provides cancel-request if the timeout is higher than 60 seconds\n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in\n  hard-structured responce format or not (both interfaces are the same)\n\n#### Request input options:\n\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use @hapi/joi\n- customTimeout(number) - milliseconds for cancel the request on timeout\n\n#### Request output options:\n\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n\n- body will be serialized in JSON if body data NOT FormData\n- try to use .unknown() method with objects in Joi Schemas because your backend may be extended\n  and without this method the responce data may be not valid\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n## Examples of usage\n\n### REST API\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### get request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          }).unknown()\n        ),\n      }).unknown(),\n    }).unknown(),\n  });\n```\n\n#### get request with blob parse\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getPhotoRequest = (): Promise<IResponse> =>\n  new RestRequest().getBlobRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    responseSchema: Joi.any()\n  });\n```\n\n#### get PURE REST request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { PureRestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new PureRestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          }).unknown()\n        ),\n      }).unknown(),\n    }).unknown(),\n  });\n```\n\n#### post(put/patch/delete have the same format) request\n\n```javascript\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    body: someData,\n    mode: \"cors\",\n    queryParams: {\n      id: \"test_id_123\",\n    },\n    headers: {\n      \"Content-Type\": \"application/json\",\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\")),\n    }).unknown(),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createReviseRequest(\n  someData\n);\n```\n\n### JSON-RPC API\n\n```javascript\nimport { JSONRPCRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createItemsRequest = (someData): Promise<IResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint: \"http://localhost:3000\",\n    body: {\n      method: 'some method',\n      params: 123\n    }\n    queryParams: {\n      id: \"123\"\n    },\n    responseSchema: Joi.object({\n      items: Joi.array().items(\n        Joi.object({\n          id: Joi.string().required(),\n          name: Joi.string().required(),\n          name: Joi.string()\n        }).unknown()\n      )\n    }).unknown(),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n","readmeFilename":"README.md","gitHead":"adf387d9ec715e1aa3801cbd0a0f7316fcd80c3a","_id":"@mihanizm56/fetch-api@3.3.9-beta.1","_nodeVersion":"12.13.0","_npmVersion":"6.14.5","dist":{"integrity":"sha512-7SuatG5dyO2BcuXp+qi3VtCli65X2lI+D0nxy/OEFCn/LjGeCbLBpDCHh/gBVlUpXa3sYYMUaL4wn4akQwAMHg==","shasum":"b550619e5fa1e44bfc0c08fd3effb8aae8a6f256","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.3.9-beta.1.tgz","fileCount":56,"unpackedSize":79734,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe9eg9CRA9TVsSAnZWagAA6RsP/A+0kgbJaFxrS5lwXWgs\nkzjZLase0YRPfVxMEhZPHOerffm8s7SjxP3/bU5z6QQof3sb4vw137ENzGB1\nlCtW8qiWHcIHeyqgfvfGHG/OzuNUaeR46zYr0Vj4o1qdb/yMp+yefYuXEmA3\nxSAkDuB8V0toSOqf71MEUbHA8J4FNke/Qh4EDX0YGZzjZ3aTyk5zuxa7OtUu\nFYAVJQNNGdRUe9aU2xlApapsMJ9SEM/tpDLzuBRjOMk/KjKL+tIoS6N9g5pR\nO9NBej4+0OdappV3wy0i7bvtRFViquecY5hA/56VkD8IGqRHQUl4TjuMYInD\nSBg6zPSk2AfjbOfhjmPjc8qGPAE97DjBFjwM6TVBq4+9NTRq3twF9PJFcLIe\nYqre83MX+LfQc3LLFcWXRl+Ys+K6rmVnoyUaNupLK9vkFp3PkmNXk7GMfOua\ntT7EMUnTtL9vqX+/qBUnHVYzWilYE6P366JGUv8lSi/6ERt4qOgqWRygpGeD\nxXIyr7BYI/0gZNg7ix6XJ6N0t1z2LJZjVYppo1FWqnm3iBeVZfMKkmcuxgGw\nsV4HOPPwdlqqMsnWkvYBUJyn7VF+nb6tuMq2ut5e1ac4d/jpAYWqpisKf3FL\nx9HyHTlSrmbo63G8IrV2SXhobbwkVYtRsQSxPUOwrXPrcsaFXO/mH9vurRpZ\njo9Q\r\n=iYh+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCqkdbH3X+ENYDRSN06mTDPL9K/HfK3UCEndrTel4NCtgIgQBvbyE/0WM7ik15hq1NakWuTAFlsYLghEmN+NSsiMRA="}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.3.9-beta.1_1593174076872_0.47842897580633204"},"_hasShrinkwrap":false},"3.3.9-beta.3":{"name":"@mihanizm56/fetch-api","version":"3.3.9-beta.3","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","node-fetch":"2.6.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","colors":"1.4.0"},"devDependencies":{"@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.0.4","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript":"3.8.3","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for http/1.1 isomorphic fetch\n\n### Benefits:\n\n- Provides validation for responses (based on @hapi/joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize\n- Provides cancel-request if the timeout is higher than 60 seconds\n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in\n  hard-structured responce format or not (both interfaces are the same)\n\n#### Request input options:\n\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use @hapi/joi\n- customTimeout(number) - milliseconds for cancel the request on timeout\n\n#### Request output options:\n\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n\n- body will be serialized in JSON if body data NOT FormData\n- try to use .unknown() method with objects in Joi Schemas because your backend may be extended\n  and without this method the responce data may be not valid\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n## Examples of usage\n\n### REST API\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### get request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          }).unknown()\n        ),\n      }).unknown(),\n    }).unknown(),\n  });\n```\n\n#### get request with blob parse\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getPhotoRequest = (): Promise<IResponse> =>\n  new RestRequest().getBlobRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    responseSchema: Joi.any()\n  });\n```\n\n#### get PURE REST request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { PureRestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new PureRestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          }).unknown()\n        ),\n      }).unknown(),\n    }).unknown(),\n  });\n```\n\n#### post(put/patch/delete have the same format) request\n\n```javascript\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    body: someData,\n    mode: \"cors\",\n    queryParams: {\n      id: \"test_id_123\",\n    },\n    headers: {\n      \"Content-Type\": \"application/json\",\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\")),\n    }).unknown(),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createReviseRequest(\n  someData\n);\n```\n\n### JSON-RPC API\n\n```javascript\nimport { JSONRPCRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createItemsRequest = (someData): Promise<IResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint: \"http://localhost:3000\",\n    body: {\n      method: 'some method',\n      params: 123\n    }\n    queryParams: {\n      id: \"123\"\n    },\n    responseSchema: Joi.object({\n      items: Joi.array().items(\n        Joi.object({\n          id: Joi.string().required(),\n          name: Joi.string().required(),\n          name: Joi.string()\n        }).unknown()\n      )\n    }).unknown(),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n","readmeFilename":"README.md","gitHead":"771cb1ef711fa64f58274958c2aa30828d53d220","_id":"@mihanizm56/fetch-api@3.3.9-beta.3","_nodeVersion":"12.13.0","_npmVersion":"6.14.5","dist":{"integrity":"sha512-oQg+HJdTfuLzCnROgd8wCv+tiP1p5nGj45JWT0A2HXNx6EvlAU1I7D3ZmvPNXSS66N1vwnI/DWsVn/klBC+jVg==","shasum":"bb546a53fa79cf59f924a97e7d3f38e3e23d12f0","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.3.9-beta.3.tgz","fileCount":56,"unpackedSize":80687,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe+La2CRA9TVsSAnZWagAAvaUP/i/FiDES65NxpoT2dvq4\nRACrH5Z4LcuVj06WOMfKd3WL/Co6Z8W4esIKBXtwYMzacL+iPifvttxHbTF2\ns21cMxiXT+pXdFD7jkXfO+sIc23eSC0UoPW8lmLoRUsKZsxxsgFGUTDcBFkT\nx0q3i5PKLmlH+w+vLAp1AxijnfLREhxYPfJFdpf0QuKv/BS2xfGw22P80WQW\nBLFEqFBbfnwRRps0+fYqv3AgBbGG2fmtNExrkqNH2IVdQpxGahpUKejV0jRD\nEEgiQsbnP6wClM3LYN6IfiE1q/qzk8vsHh7W0aSNXNMLkjmDDFbm3Sr4Y2ag\n4U8dZ7SHz6LLosRgmRojJhyIHt51T8QYwqR5Qm2goL6jbTxztlJfF26BaJgQ\nKCvV4oo+BRseCMbcYqzKgMy58GUGFvbO2GLm71n3BaI4IPtDu8AdmhyCBk+z\nd08lOHBE82vJBQUwAaFJ2B6W1AoADBCi4686X0xYwiHTxXr4ZKZURh+VxrTm\nnRhk7pChs7r/FJRNmGbrNc2T/aWfreT20WqXzeg5hQQdKiKRXyB22Gu3gslG\niaF4ecd0Kp/Bb1eOMPTJBbHKEoM9v7wxKgWG7yXotmLwUxe0Cc/VwS3QV73S\nmc66np4+MQ8s6PFk3+SkblYkPn6Wk3whtrBHtY+FiAiFSxP1RImCIc8PWMjh\nfL83\r\n=8xL3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCvt5t9YnI9lPK8g3NkJ4cnkexWbOcuS9td7vkKd5rvSQIges8rmL2bA+OeOyZU+UuttR/MERPTB8RSPIcw8zPS9Ng="}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.3.9-beta.3_1593358005340_0.16052861373273752"},"_hasShrinkwrap":false},"3.3.9":{"name":"@mihanizm56/fetch-api","version":"3.3.9","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","node-fetch":"2.6.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","colors":"1.4.0"},"devDependencies":{"@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.0.4","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript":"3.8.3","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"gitHead":"9eeaad2e1c97507904df71942efb46d458752562","_id":"@mihanizm56/fetch-api@3.3.9","_nodeVersion":"12.13.0","_npmVersion":"6.14.5","dist":{"integrity":"sha512-uJ9MJGFWk9ZbvIziTsmmkaux7e6cZkrDJz1NZNXsnPbiPuPjZqRVOUcYgsPIdjPXrQH0zyQkqxXobMztXNG9DQ==","shasum":"a6617af5eb05f43d8d9dbbf3e46220a96e727d9d","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.3.9.tgz","fileCount":56,"unpackedSize":80680,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe+LjyCRA9TVsSAnZWagAAhIsP/2kiaAv2jVe4xY//I7NU\nqO2/ksFdosU5WhRkGN2gSvCkfbAlHxHYVHDh36Lt5xCghiw/z9XirGNq7Auc\nzAnjSzEb9rq+sJhYxgTiXLiv87ACUyyorPujLGS9IC/HZe+eV2Oi1CO85MYR\nOtQ+8UUmsTJ5+Ckee7+sriamDjaEkgahBETPQUkynKAFBs3bKzqKmZPaxojj\npnxJRND81DeM0C80tjJeU5PetjBV2C+216lHwyP/jBuKTUaNCluE96EmQAVb\nrGRBAkZhdczMxrAuXHElzlj4Eu15hX68pXJmmTo3U2vbjQFrxmwKyfrsY4+H\n9XWDW2Um9L8yqULW3rZhJGwcyHjSTm0kLWFXR28YvEjOMtvzJ2G/a+Gi3Qp8\nwMuO/vj+bX7XOva3S7K0tciLkinVMK1zditWt4EVwlA1nNHRDsJ04ceKMDZN\nbfux9VYFiYPiBYVig3+sX2WpO2e92xBeYFpal3SGYRP1mTexYkvVrOmwhUTm\nuvqMjzjdiMjtGV9YvCkQMXIGrgXOIYBPfVib/UOC3kvnCMj9D7eMRk/0i2Uq\npeSgPbwscQoZd3ojK9w0gn9gi8XIVuQ/D8LsPpKYk393U8L3KhPlqcOMSrMN\ntq/+CE9W3zFwgJjLOwcjNEfXVxi20COpLgS1GMeILY1FO4dak6HVA6mqIIf+\nHLMa\r\n=mrq0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC34OnsUVa8y7X82KImLIhQlbSfqiHeaSfWDtN0tqYtFQIhAOD+qOyLaVIi0wg9RFsWVesb3iX00Cyd2Db3Sarg3Om/"}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.3.9_1593358577569_0.6102927880108253"},"_hasShrinkwrap":false},"3.3.10":{"name":"@mihanizm56/fetch-api","version":"3.3.10","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","node-fetch":"2.6.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","colors":"1.4.0"},"devDependencies":{"@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.0.4","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript":"3.8.3","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"gitHead":"66b1c9505be29469a570d5c2b669c96ab110e9fe","_id":"@mihanizm56/fetch-api@3.3.10","_nodeVersion":"12.13.0","_npmVersion":"6.14.5","dist":{"integrity":"sha512-Zlx1SvcD2hu070KQPLCnol3x7fAx8HAp+7wqUzLzrprQeZRYPOx1cSYQmgpaHhacXjcWTlj85MqYb+9UcjJEOQ==","shasum":"ade950186f37de9e17cfb8cb6ae534cd1e5dda00","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.3.10.tgz","fileCount":56,"unpackedSize":81569,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe+Tj/CRA9TVsSAnZWagAAq3oQAIshsaOGXG8uotWJIYgR\n9X9TlnEu2UGLYAmGfgEBj+S2VwTEU3pzFEme2+FFLaahTclbt1hGCiHbg3Z0\n0ZHKcy7N3UglP+wKz5K43MSvSYURnYOOBrgESsDYsZtaZD8sNDedxmPS7xkP\n0ogEprg1qorMrYMG42jGkCXLqZIffX3IlbKHrstKzfbJ68d23mNaT7h5/DFF\nmVfF/IdCRCTRbriRH7HQaryOQJZEe8g3CHwuZggol2ar8WbUjz3DuryyQ3A0\n+9zGVMkDjHtY5U+10Ut2b54d/zD3OMcvAZGKweUl+JUBR6UAwwTm3hP52X3G\nv3AFrewz0w6lPRwUeVEmNY8gDxvvraNZTBZ4oljdK5glFVUnJUI+W0aGT2R4\nB6QlvmE7uIbGAVXWkvBAhRo+UFSZ14JuBRwxcfLxJuaozvP463oU0GrRZwpX\npQtFdLfRkQs5ZBVBD98DOyybQ4sOuwz6szjWbGHvNleBacyRDWQ/mAmu4wA0\ndp4WzsgeZlNHGhFClvjVInvG8yg4EO2jY+5si6N8nILNJtFQdXgf3f1Yu12j\n7rhalYP4KmtYo5zNuUETRT5b3r0DMpCSbMAt51IlA8k1aXxhpDFnLqb6aDt3\n0iBX+2+wkBvIwttuUPAAg47pOPu3xNNuKsCsLN1rRpeBHEUW0JEsM0G2/rEZ\nyASG\r\n=i7Ar\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDDXmNlvTj8LYZsa2NGpCIe7nmF1hnrA2wUEl/gf2JMJAIgNECy5n0kyZz57xJ40tBbnQbm4jc2JqUvuVDOYgW6PUE="}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.3.10_1593391359151_0.13837854288940865"},"_hasShrinkwrap":false},"3.3.11-beta.0":{"name":"@mihanizm56/fetch-api","version":"3.3.11-beta.0","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","node-fetch":"2.6.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","colors":"1.4.0"},"devDependencies":{"@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.0.4","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript":"3.8.3","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for http/1.1 isomorphic fetch\n\n### Benefits:\n\n- Provides validation for responses (based on @hapi/joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize\n- Provides cancel-request if the timeout is higher than 60 seconds\n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in\n  hard-structured responce format or not (both interfaces are the same)\n\n#### Request input options:\n\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use @hapi/joi\n- customTimeout(number) - milliseconds for cancel the request on timeout\n\n#### Request output options:\n\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n\n- body will be serialized in JSON if body data NOT FormData\n- try to use .unknown() method with objects in Joi Schemas because your backend may be extended\n  and without this method the responce data may be not valid\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n## Examples of usage\n\n### REST API\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### get request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          }).unknown()\n        ),\n      }).unknown(),\n    }).unknown(),\n  });\n```\n\n#### get request with blob parse\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getPhotoRequest = (): Promise<IResponse> =>\n  new RestRequest().getBlobRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    responseSchema: Joi.any()\n  });\n```\n\n#### get PURE REST request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { PureRestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new PureRestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          }).unknown()\n        ),\n      }).unknown(),\n    }).unknown(),\n  });\n```\n\n#### post(put/patch/delete have the same format) request\n\n```javascript\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    body: someData,\n    mode: \"cors\",\n    queryParams: {\n      id: \"test_id_123\",\n    },\n    headers: {\n      \"Content-Type\": \"application/json\",\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\")),\n    }).unknown(),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createReviseRequest(\n  someData\n);\n```\n\n### JSON-RPC API\n\n```javascript\nimport { JSONRPCRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createItemsRequest = (someData): Promise<IResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint: \"http://localhost:3000\",\n    body: {\n      method: 'some method',\n      params: 123\n    }\n    queryParams: {\n      id: \"123\"\n    },\n    responseSchema: Joi.object({\n      items: Joi.array().items(\n        Joi.object({\n          id: Joi.string().required(),\n          name: Joi.string().required(),\n          name: Joi.string()\n        }).unknown()\n      )\n    }).unknown(),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n","readmeFilename":"README.md","gitHead":"dae842d68303ea0dafcf3c12f5baae23c81dc628","_id":"@mihanizm56/fetch-api@3.3.11-beta.0","_nodeVersion":"12.13.0","_npmVersion":"6.14.5","dist":{"integrity":"sha512-Ot35jLEx3Z+MvZghvSGNRKs0De6iYZ652IlouJXOMHiacxT/5BNxIZoBbDgJiZv7izr08HPP3A36u4D6DMiUHg==","shasum":"0aec21fcaaa0f76e7b05a69d212cc63312b06a83","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.3.11-beta.0.tgz","fileCount":56,"unpackedSize":81576,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe+UYACRA9TVsSAnZWagAA7HQP/jXKkZWrg1ubPFlMDsRt\n90szCfPSD6+1c8aMwbM0JMHKn4ZdsLOEEy0VREGDyEGW5KLbhsR5hWM4WhNl\nnws8xCjStikqb+S8wWlT/enP5spFZvsdV8rnGVbLG9ii7blmgOEvIZl4tfLX\nN2RocXSiwNUzRrIknUecjZba6s1Pv+Qc10zQYQg8Sm4nkojT+CinZFJPjdfe\nr/qIbR3N8ARf+u00/unsUDeTw3Bpwl6VdUEKyOE1GSVAK4mRelDf+/mwIw1z\nOeQ8wJCkZU30v27jHm5htVkjHbKlNeytWA0I0EezmVHPXuz8ff3DYgdelrN2\nmXDOjlmMSaitjCrt0vt3YRHIC73upDzYhoZ1nX5RbSiiicEammQxx8mms8ex\n+B0f2kgCAQ/dpLuhuvKaVjizg/WQGcsp6zgOXVFimXRf9GXedvnHWuWulQe8\nZH7ouRI5b4prIL1V9EpjUD+9K6+Idn6TlMoGkx2rhnO7sXFY8iaP1PPpekay\nwBlthS+X2gkw59Glf0GASNRybji7D6BMh72wmnQNGty1elrmw0kHoFh1UQ1K\n+rTEA7VelqqqqH64EYgXCeBLjPwBJOufZHovtxKBZ04qt1M2vK3ldQwCz7X0\nYyuRSZnxcq39UaQnWe10PlbwPUKJGWTVASLKu6gdGtXizJpS3yEIOtQLsgT9\nDgO0\r\n=Y6Eq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDhzOCpb/MsNH8n+e/fYNhNV0SVCOak9pb2L/frFuq6HgIhAL8tZYNGkt8lu8SwRX5X66fw7k54KyNKTICPyuV8Yakv"}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.3.11-beta.0_1593394688476_0.3381689156458787"},"_hasShrinkwrap":false},"3.3.11":{"name":"@mihanizm56/fetch-api","version":"3.3.11","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","node-fetch":"2.6.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","colors":"1.4.0"},"devDependencies":{"@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.0.4","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript":"3.8.3","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"gitHead":"01ad04f64039122782382b08ee142cc6eddaef86","_id":"@mihanizm56/fetch-api@3.3.11","_nodeVersion":"12.13.0","_npmVersion":"6.14.5","dist":{"integrity":"sha512-kVUnNVZ1WKKUV5r4OPgjg1GY/jf8u68bNT8NhMGvlMANJeSvdGVdbOaI6ruKknE3AIScad3xQOCiYsw+pglZ5Q==","shasum":"8580fcbb177dc2f6ab179f91c804b914f8bd7c9e","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.3.11.tgz","fileCount":56,"unpackedSize":81569,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe+VLeCRA9TVsSAnZWagAAYp4P/jbhLnGeOSI2IQKUqh/U\n18lcqOfK7d4AEokV4i5GO7+Jy6HDBToeWegagw5hkOzinPqXTuyIov5vzsQi\n71u/qH18jhgMrn6G/TZbEWg02kAoCq9ELSMnNjZRS4Kw15lBDaY4ZidBfKTG\njHUYh5VnvPL4vcNfmmbeUMN2VaMQCLZYtiUK7EoZcTfkToBVvJQun1CVJMsl\n2bM4vr3TAvbUpd5nHbzImBR+k3+UODea3HPJjPNVuyhNKPO6Zor6w9QsA4Ck\nfj91i7GI3GlB5khA55Hb1dCXWTGyjTkkp6s40L7gRp5zsCyDmevDuFOKTVPb\nzO33I7R35G9S7nieLezBnmIrffwVE3CBBWkFAB0Fp1gJEWwi6Z53gbDRwK/z\nG+AEtOutrIHhfloK8p7l69HXdY2ttkKnGA/EaZLIDQFYhJ0RtuNLKOCSWfAC\nYRUHapfYbozYFMjE+2SPpl+Egyf1msNVy6xHJrVRqlIpCEJd5sT8TIPq8wIH\nOvAg2QptyFbrfETk1PKcIAL3oy/iOMoE9jLjHWAVrO7iRXLN8QwrdySmlv+K\ngseqZ1MtKk4LOj7SlR1XgXIFmxERxJZSENXShCMxkw1De6bwUerlXHFMvZIq\nu/Vv68XQYLU8FynewwdVU7X2qSOeX4tN5hFvfpuusvZDK8Q2ootyVdZaQNsi\n9k+W\r\n=O0s6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCI6E1B6XCy7ZbXS6S/3nz1ELnMP+zymf6aPa9VaZlSbwIhAKdPJJYgjjPpGORtdYMnCTgDpwQqiz/Vej0FzuCFUca5"}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.3.11_1593397982063_0.25927961622571427"},"_hasShrinkwrap":false},"3.3.12-beta.1":{"name":"@mihanizm56/fetch-api","version":"3.3.12-beta.1","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","node-fetch":"2.6.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","colors":"1.4.0"},"devDependencies":{"@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.0.4","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript":"3.8.3","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for http/1.1 isomorphic fetch\n\n### Benefits:\n\n- Provides validation for responses (based on @hapi/joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize\n- Provides cancel-request if the timeout is higher than 60 seconds\n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in\n  hard-structured responce format or not (both interfaces are the same)\n\n#### Request input options:\n\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use @hapi/joi\n- customTimeout(number) - milliseconds for cancel the request on timeout\n\n#### Request output options:\n\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n\n- body will be serialized in JSON if body data NOT FormData\n- try to use .unknown() method with objects in Joi Schemas because your backend may be extended\n  and without this method the responce data may be not valid\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n## Examples of usage\n\n### REST API\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### get request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          }).unknown()\n        ),\n      }).unknown(),\n    }).unknown(),\n  });\n```\n\n#### get request with blob parse\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getPhotoRequest = (): Promise<IResponse> =>\n  new RestRequest().getBlobRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    responseSchema: Joi.any()\n  });\n```\n\n#### get PURE REST request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { PureRestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new PureRestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          }).unknown()\n        ),\n      }).unknown(),\n    }).unknown(),\n  });\n```\n\n#### post(put/patch/delete have the same format) request\n\n```javascript\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    body: someData,\n    mode: \"cors\",\n    queryParams: {\n      id: \"test_id_123\",\n    },\n    headers: {\n      \"Content-Type\": \"application/json\",\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\")),\n    }).unknown(),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createReviseRequest(\n  someData\n);\n```\n\n### JSON-RPC API\n\n```javascript\nimport { JSONRPCRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createItemsRequest = (someData): Promise<IResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint: \"http://localhost:3000\",\n    body: {\n      method: 'some method',\n      params: 123\n    }\n    queryParams: {\n      id: \"123\"\n    },\n    responseSchema: Joi.object({\n      items: Joi.array().items(\n        Joi.object({\n          id: Joi.string().required(),\n          name: Joi.string().required(),\n          name: Joi.string()\n        }).unknown()\n      )\n    }).unknown(),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n","readmeFilename":"README.md","gitHead":"c2e5c379eea2e09919261da5ca5dd34149b86cec","_id":"@mihanizm56/fetch-api@3.3.12-beta.1","_nodeVersion":"12.13.0","_npmVersion":"6.14.5","dist":{"integrity":"sha512-2cwb5VGGnw0cGQxaX1khntQVcvjlzNbHwvxLIHD5uWJwRrmHJ8Oyf577QMw6SK5mSzGh7mRU8VDO2HMBtrTTYA==","shasum":"452c56ec2a3b6a59bac9bcfe2c9fd60fb9d43e9e","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.3.12-beta.1.tgz","fileCount":56,"unpackedSize":81855,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe+5vDCRA9TVsSAnZWagAArhgP/jQyL5DrmKWWfU+BG+hL\nI2/ib9JxiGvvCQDcd73WPyPKpjqYZFm6eQ4p71wjgG0FhUXmX0RMh5TRklrO\nzbTVTq+BkLJNVIw0jYXaZB6A83sVmr43ZrP+pfpu97nqeSjAyOi5Sun5i1Se\njfy6ZD9e/ul8jntIjxcwLe+WAGiygAMuI6r+IMx/LHWCeoPAW3iszPNixQ0i\nLn+ALkU3qUNPsY8aLJKr8dwWmkMa4wrdChzV1Ys2ztbaIMk6MxevE4Baf1J+\nfAwAVp8oo/jiprx5/uiip0j6A22gcVVX79pgOrkdEV1sJ0jlw6xPwe+wkD9I\nRzGkTQReJg/55jooB4nYQNjWRDvVNDga/0fsMrK274v7al2jZzO9cwKXuleY\nuGGTs4IdaRgwNuJL7ZAL4M067gB2XHoCDPB8ihzSU8HEyE+VmEHvIXJn9FZ9\niShgiU0KeCapJOD5JsTMRIJekgm/sFISGUPJVSrSu52xy7tKml3FfbFbwzfN\nJrQlQWECGu0BEmBgr5SQo7a35EL5pnDRZ6+7oh7gYHlOyrmkfy53h6kO2A26\nNIzRa0qnjY3Nbtbs+3P5s/BOIsRXiWOnclzPLi/eIDTAZDZV5eWY2/yBXNfm\nNkzODHRjNSXKnWhsXU3tOdg/6cUF5B2Lfbww7BEqvz3Qhpb82CPcqqB7lmYA\nlmo9\r\n=gTsM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDaaj2FYaOcatqOYAU+FN64a1L60epBQygY/Tv0dzyEUgIhALfqIfDw6W3pYgt62pDXBemZRNMQYSFUWRZCVKvhfxqd"}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.3.12-beta.1_1593547714487_0.640432669983211"},"_hasShrinkwrap":false},"3.3.12":{"name":"@mihanizm56/fetch-api","version":"3.3.12","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","node-fetch":"2.6.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","colors":"1.4.0"},"devDependencies":{"@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.0.4","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript":"3.8.3","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"gitHead":"7a03c31d70d75204a0273bf61240d09e3072c8cd","_id":"@mihanizm56/fetch-api@3.3.12","_nodeVersion":"12.13.0","_npmVersion":"6.14.5","dist":{"integrity":"sha512-RJb+BWaUqY+Q/xLXo5z9D2a8DhbFXzBVBClp4y3EveKBan24pg8LMVuSSXWx+iGMurKFUiOP0JzBhbzRc50EQw==","shasum":"8ea30c937b0d4db14f9fb56ff8be88752e9b22c7","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.3.12.tgz","fileCount":56,"unpackedSize":81848,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe+5yVCRA9TVsSAnZWagAAm7YP/3f17rYI89coioRkgTqF\nZIkoJ9f8MjN0GtJ7TimrNSkdXJayUkQYuxXCbrzPY3pBPnqEGmk2wq8rc3xG\n9NIpgzW/x9V38jdSKMnlilon1IuwWONLVRf2xwUv2WUbmUqwf2WZ2DNp0x2j\npkUo1YgxAe7yPosaJf2kmm82uq59YAgYwXp4Is3v0Rzbcl4tZLvvUXGDQMbm\nos85YsRu1njTeuBelr8b67e+SFViT5Ftl3GDzD36Eh3vjN6SqwKKW1GpKT8V\nJt4F+CIF034WVlHvoTJdNxAcRpSFIImArr+QIxzA+stjyl1VhtEyNORCzAPU\nRcF0X3RAaHVU7PtPHKPYPSivRfpt3AoWrht6SHKPfDpuahMFb7WMCaryQcmR\n9WTVZ8ALMkdpFxIIydG8ME1F0SEDDhQpwPCH4sPD018xX0Fvvxrzej1AlnMU\nAt4mzqo7vskJ0R3cWprbeKu+rO575lnj1NlLhAynkwVHLZY2wIORrgRN4lAE\npn1EBzcfxUEgYYAF47U7Dggl94beVQMfTS8Y2idLyswRyrVLQNUMAOD9Fptw\nDofj3YtqY1CJKLhBww1KVBzV6ifJXRV6mWBX3JMYyg47n0B3PgeUVrznXury\nJrY/iXGviYT1dxWQg6Zk9qBmDYRdF1EcgxiANpflCBjHQBXK2JwRw6vk6dfm\nGw8A\r\n=Bs/B\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGMknF0Rbn5NJrzjMl3BodDUiEJxx83i7PYc43Xz11nDAiEAvLU43No2UqBGxcaMv9X/xMFM9Ra6AGBVXDq49YvpgiE="}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.3.12_1593547925149_0.4560123329797243"},"_hasShrinkwrap":false},"3.3.13-beta.1":{"name":"@mihanizm56/fetch-api","version":"3.3.13-beta.1","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","node-fetch":"2.6.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","colors":"1.4.0"},"devDependencies":{"@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.0.4","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript":"3.8.3","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for http/1.1 isomorphic fetch\n\n### Benefits:\n\n- Provides validation for responses (based on @hapi/joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize\n- Provides cancel-request if the timeout is higher than 60 seconds\n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in\n  hard-structured responce format or not (both interfaces are the same)\n\n#### Request input options:\n\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use @hapi/joi\n- customTimeout(number) - milliseconds for cancel the request on timeout\n\n#### Request output options:\n\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n\n- body will be serialized in JSON if body data NOT FormData\n- try to use .unknown() method with objects in Joi Schemas because your backend may be extended\n  and without this method the responce data may be not valid\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n## Examples of usage\n\n### REST API\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### get request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          }).unknown()\n        ),\n      }).unknown(),\n    }).unknown(),\n  });\n```\n\n#### get request with blob parse\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getPhotoRequest = (): Promise<IResponse> =>\n  new RestRequest().getBlobRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    responseSchema: Joi.any()\n  });\n```\n\n#### get PURE REST request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { PureRestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new PureRestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          }).unknown()\n        ),\n      }).unknown(),\n    }).unknown(),\n  });\n```\n\n#### post(put/patch/delete have the same format) request\n\n```javascript\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    body: someData,\n    mode: \"cors\",\n    queryParams: {\n      id: \"test_id_123\",\n    },\n    headers: {\n      \"Content-Type\": \"application/json\",\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\")),\n    }).unknown(),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createReviseRequest(\n  someData\n);\n```\n\n### JSON-RPC API\n\n```javascript\nimport { JSONRPCRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createItemsRequest = (someData): Promise<IResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint: \"http://localhost:3000\",\n    body: {\n      method: 'some method',\n      params: 123\n    }\n    queryParams: {\n      id: \"123\"\n    },\n    responseSchema: Joi.object({\n      items: Joi.array().items(\n        Joi.object({\n          id: Joi.string().required(),\n          name: Joi.string().required(),\n          name: Joi.string()\n        }).unknown()\n      )\n    }).unknown(),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n","readmeFilename":"README.md","gitHead":"330c7711e75f938dc53173b2bedcfc55f680ecb8","_id":"@mihanizm56/fetch-api@3.3.13-beta.1","_nodeVersion":"12.13.0","_npmVersion":"6.14.5","dist":{"integrity":"sha512-fvc2dz9h3xG8Bv+rX5kSnWEnAE5RVCaTOes0eU3fh6RyuFonCyz0/Whkzus5gWMGOMY6zqVvcwtJYRwESR0cLA==","shasum":"036515394f8e0f6762f3ec0c39a91cc156813444","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.3.13-beta.1.tgz","fileCount":56,"unpackedSize":81430,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe/G4kCRA9TVsSAnZWagAAOGEP/0XaxI9OLXYeDOpQcJ60\njDm3nszwkwA/TRj5x4ueurf3hcQxlxCsQqe0I7smzVJrJrlihVDD6GgkTJTC\nDFAh7Fv3EvEe4v0QwmOvQc1qvVVeuk/Y53dn/Fk7IY5IJMmKB214qLLwtlU7\nrnlsuLyh6VIbHrCZ5YST9Hyu+Qlt+6UrGVubODFLP/0dn4s/Uw2Xz6zcgMSC\nGwfORvGb1neLU7jAK90bG3aCR9ajR6STGCisl0jz8/JxtlaEEWa4JgISNBMV\nHtTaq0qJjag4fabtaEe8RYtpbpbwYiJ/TzZqg4MGnk/1Lvy6TnAiu3V1rY07\ngcAr8TXaUHqG9pinxFcUQZat3ueehb35KUoiQo+Px7Rg0+VK6T2GETCf0IIM\nu16RIC44VFBprau3ZwCFB8p8r6giJ+1/XayS52Gd1NbnQeH+W+NrgOsKR6Ll\nb2rSaZgokUKqUHfWoar6q77TTu7eZNaF0mmbzDXql1HzHKMi5oixP6Eo1UjO\n7shb+2tOmdMGzQm+N2R1SATgpX1gh8RL7khLJ5OF0rRzEZEN6qoUl6ZDDtrq\n3ImmM/u/A2rH0QK3MdVtdVE3lM3ExzwQBT+zG6IDjAIq5+cqX/dcavDbikit\nUuY3f2u9X+Y2yH/S5a0F2egKZk54QEhKVB643TJgjHFOFrYAa2GZWYMjOlJh\niTr5\r\n=0dZG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICUuiPIhCyLXLldnL+vRXq9+8sKZcjWki4j4Q3XLZ993AiEAh9a/Rdk6umy9jiDSQaYnVQGaDXZ0DCqoL5iQbRwfADM="}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.3.13-beta.1_1593601571748_0.15472090999318677"},"_hasShrinkwrap":false},"3.3.13":{"name":"@mihanizm56/fetch-api","version":"3.3.13","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","node-fetch":"2.6.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","colors":"1.4.0"},"devDependencies":{"@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.0.4","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript":"3.8.3","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"gitHead":"5bec4103b7eee843f1511e11e4b4cbb2d4511041","_id":"@mihanizm56/fetch-api@3.3.13","_nodeVersion":"12.13.0","_npmVersion":"6.14.5","dist":{"integrity":"sha512-lWkdbREuClCoxdQjWAjSn3GsO0hkxSMVliTwkvWpuK2zDKIGMHdAieZ+tQ+JB5JNm7kp6TE0F8gfbtbOan6atQ==","shasum":"21d716a95a137646850b07f5c74f56b015ad1413","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.3.13.tgz","fileCount":56,"unpackedSize":81423,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe/HcLCRA9TVsSAnZWagAAuzgQAIyx2dqt5zfx0ZngaMQm\noUsazbFUEiALhB7ovNAz3849+sUN0dx4C71aGn5KGHzqsmjkAgBXkmkAQHuW\nug+Zl4ZnLnR8ZIYPPAfrR0wH02h7dHKSroqyNDFeWQvZGR4PceoL4bjhOWSC\nxC4TJhx8IqMn2TR6fPeu/cpqkqc/7xSsstlyuH968eCWeUcpV8SVCEJqW71g\nAgIfMO7e0hehiQXCMrEmwp6DHuPr2bSFBRpo3QBsdF3Y5FRoaAGcoACG/7SC\nuLJGEXgFdyAJXGPmhgr40pM7zDoZTSyC6yW4nLgcV+TUV3eb1V/sAhsk5mV5\ny9Aou9N+woP4jvgRqLjv3deaYn5Dm8CtB5JjQrmrUjV/uUsFyCZq9AWf5wPY\nQ6c7ykdaQZeUH5sW8VlK7VKy1wJlu/GMcRS5tZzGMog8jKxsn+YYh1k1soXX\nFA7Di/nyTsAmOeWvW+wstX8wWjmKJU2swK9EluAbX2TfKHrlm+Y9903rHs28\nsUuQAsj1H1kWAdjCAT/YmaaPSkCMAe3dtQIqyB/IlU15SV/j1w6q7juaPKlf\n+D1/rAhAxPrC9fr7oURYrON54en1Xq4t9qVXFIwVDiO4/FDV4Xz4hHXxMzzu\nYByXppvhzubjPsswoNfxatqozKQuG8j5lz17ulA/oR0ygNjAzJgtBuq2+rv1\n3d0H\r\n=YlVA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDjwVPx7N7sjYdw4JZZsFRHiygtcLjLSWVuHzndyLk2EAIgahwm0qhq2Vmod1PDLfAUGNA2Qh74Y7m0T0rgpxjSTaY="}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.3.13_1593603851449_0.03968316430461427"},"_hasShrinkwrap":false},"3.3.14-beta.1":{"name":"@mihanizm56/fetch-api","version":"3.3.14-beta.1","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","node-fetch":"2.6.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","colors":"1.4.0"},"devDependencies":{"@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.0.4","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript":"3.8.3","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for http/1.1 isomorphic fetch\n\n### Benefits:\n\n- Provides validation for responses (based on @hapi/joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize\n- Provides cancel-request if the timeout is higher than 60 seconds\n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in\n  hard-structured responce format or not (both interfaces are the same)\n\n#### Request input options:\n\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use @hapi/joi\n- customTimeout(number) - milliseconds for cancel the request on timeout\n\n#### Request output options:\n\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n\n- body will be serialized in JSON if body data NOT FormData\n- try to use .unknown() method with objects in Joi Schemas because your backend may be extended\n  and without this method the responce data may be not valid\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n## Examples of usage\n\n### REST API\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### get request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          }).unknown()\n        ),\n      }).unknown(),\n    }).unknown(),\n  });\n```\n\n#### get request with blob parse\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getPhotoRequest = (): Promise<IResponse> =>\n  new RestRequest().getBlobRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    responseSchema: Joi.any()\n  });\n```\n\n#### get PURE REST request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { PureRestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new PureRestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          }).unknown()\n        ),\n      }).unknown(),\n    }).unknown(),\n  });\n```\n\n#### post(put/patch/delete have the same format) request\n\n```javascript\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    body: someData,\n    mode: \"cors\",\n    queryParams: {\n      id: \"test_id_123\",\n    },\n    headers: {\n      \"Content-Type\": \"application/json\",\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\")),\n    }).unknown(),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createReviseRequest(\n  someData\n);\n```\n\n### JSON-RPC API\n\n```javascript\nimport { JSONRPCRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createItemsRequest = (someData): Promise<IResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint: \"http://localhost:3000\",\n    body: {\n      method: 'some method',\n      params: 123\n    }\n    queryParams: {\n      id: \"123\"\n    },\n    responseSchema: Joi.object({\n      items: Joi.array().items(\n        Joi.object({\n          id: Joi.string().required(),\n          name: Joi.string().required(),\n          name: Joi.string()\n        }).unknown()\n      )\n    }).unknown(),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n","readmeFilename":"README.md","gitHead":"b1c948f4fb01801b12cc34f8b6d956454470e825","_id":"@mihanizm56/fetch-api@3.3.14-beta.1","_nodeVersion":"12.13.0","_npmVersion":"6.14.5","dist":{"integrity":"sha512-rTnD+Raf8OGXzpZAsNpwPqGJP5fyyvCboICnDqRWuHqvFJ+hMB2D+c+35OkzzwVM9+RFYQDZHV8WaEPOp7Vh5g==","shasum":"2cc6373f0a941c07de4b04029a47b9a23403cbca","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.3.14-beta.1.tgz","fileCount":56,"unpackedSize":82054,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfAdpbCRA9TVsSAnZWagAAjGcP/RiQl+e0LjmMWj1An8d8\n/jfxBHgIAZiSyhqouiPHvT7wzXwt3MQ1CLXPr1BnxVQOb8xA14WjUKmqMMTR\nI3FXYozj9OZNLtqEbL7z2n75yK555yczGK28kGObNUPsH9oYTfp/B/E5EBLw\nBvF6rCtLz6z7tHn5m7a9dCACCtItC+tj6DlxKJnUDMrHFDwgmuO1BKYMqI2t\n4SoIinKLGZ+kDBYy0j4RJEibmbhTrrkqkanc30w1R4nYBKO/6IqG2okBcPCx\nwaxo9vpY5kTElALoIA5pFa0ADU+Tr/tDoUi2raYaA/WZswJCho4SEM6Ev2rF\n4+W+77UkoUdFzuNKbBOd1OJXQOlF05ZgBopiBKPT+dfvJXfkDVBcxVJ6lAL8\nlFUGxaySmOZvYSpPKnSSiCwoJY8UrwZ98LiRAwta+ijkC4i4MRHDCsqX0+TM\nZosQyTSYs9EI/WxtH6w1ZU/g5h9+nE1yBYpjkxn6qr0psD62OqNtbrcllac0\nN/pg9C7AhuoC3XjQ488/h683GpGV7eY0W+oWhrBd9/hBNMzbVdK5DMC9wbaC\nExyt4ENCdjTPIq37LjzLmnVGQPq3dPtc8yZ5XjQcXwaVd+bWxNc4ehamPGXu\nIR/cLj5esVqmPCArkfuhSWcOCq4IQZfoTJsjMf+CamSDR8J6/nB2p2pflBli\ngxUt\r\n=AqYq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGPkWANvpRhr2dmTLmWyVtzrGf8qNW0S5hE5+tZFReR6AiEA4zPkIMHPj4qjnJOfXkfRE+kX7h0N+vJTDMQ5Yioh7Ro="}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.3.14-beta.1_1593956955259_0.15139427416654017"},"_hasShrinkwrap":false},"3.3.14-beta.2":{"name":"@mihanizm56/fetch-api","version":"3.3.14-beta.2","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","colors":"1.4.0","node-fetch":"2.6.0","query-string":"6.13.1"},"devDependencies":{"@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.0.4","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript":"3.8.3","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for http/1.1 isomorphic fetch\n\n### Benefits:\n\n- Provides validation for responses (based on @hapi/joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize\n- Provides cancel-request if the timeout is higher than 60 seconds\n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in\n  hard-structured responce format or not (both interfaces are the same)\n\n#### Request input options:\n\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use @hapi/joi\n- customTimeout(number) - milliseconds for cancel the request on timeout\n\n#### Request output options:\n\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n\n- body will be serialized in JSON if body data NOT FormData\n- try to use .unknown() method with objects in Joi Schemas because your backend may be extended\n  and without this method the responce data may be not valid\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n## Examples of usage\n\n### REST API\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### get request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          }).unknown()\n        ),\n      }).unknown(),\n    }).unknown(),\n  });\n```\n\n#### get request with blob parse\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getPhotoRequest = (): Promise<IResponse> =>\n  new RestRequest().getBlobRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    responseSchema: Joi.any()\n  });\n```\n\n#### get PURE REST request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { PureRestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new PureRestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          }).unknown()\n        ),\n      }).unknown(),\n    }).unknown(),\n  });\n```\n\n#### post(put/patch/delete have the same format) request\n\n```javascript\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    body: someData,\n    mode: \"cors\",\n    queryParams: {\n      id: \"test_id_123\",\n    },\n    headers: {\n      \"Content-Type\": \"application/json\",\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\")),\n    }).unknown(),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createReviseRequest(\n  someData\n);\n```\n\n### JSON-RPC API\n\n```javascript\nimport { JSONRPCRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createItemsRequest = (someData): Promise<IResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint: \"http://localhost:3000\",\n    body: {\n      method: 'some method',\n      params: 123\n    }\n    queryParams: {\n      id: \"123\"\n    },\n    responseSchema: Joi.object({\n      items: Joi.array().items(\n        Joi.object({\n          id: Joi.string().required(),\n          name: Joi.string().required(),\n          name: Joi.string()\n        }).unknown()\n      )\n    }).unknown(),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n","readmeFilename":"README.md","gitHead":"98645c698969a9745a79ea285c3c05c840963f66","_id":"@mihanizm56/fetch-api@3.3.14-beta.2","_nodeVersion":"12.13.0","_npmVersion":"6.14.5","dist":{"integrity":"sha512-0WH854WMLQmrUGr8kxRK7EEsLTJjS4uG4tdQh9A135aXP6uKRrmTfZojPg8ETTEVXr2cq5Nj89Ca6KyFDQbDzw==","shasum":"e5ecc857254e1661b0c92ff50ba199ddac38b5c5","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.3.14-beta.2.tgz","fileCount":56,"unpackedSize":81988,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfAjD6CRA9TVsSAnZWagAArAIP/03mCAKupF1cb56pr/33\nmbZ/ZyEu7IryCC8P/hoHQuWm7mg2QOZO/ib239SFE+l5hna6D1sJXKe3t6Ym\nS5PFip3epRcmYBi0O4n+j/jO8Idw1XPbQd1+OhJUraXg/MNynd601yneqvE8\n4o5sEsPyy5rkExA6N3AJXBivPIQeEvJzFSvU8sAWE/QkM7vna7jOIzwiRO89\nJIsnYdVetwtRHplgCNnnyDnh5tK6FQo+sFVydtvAC0+UL/Wx0IZ0RXOHyGRZ\nkyj6CpyiuzPNwASE0SQ3yLdCb0mKyIXQepQM3hOsP0gp+a6hrb01A/C1TwUs\n3V1Pubh+Ds1WW2NAkod90eRNAhdRLk9h84kAdlmiE6pWf1lF2lwgK/RAUA22\ngWCG2TfddELKE/5REKcMQJH5m0cMy5gyS9CeSRogeC26UF3++qzaWOOlrQhO\nvpcuR0mJpJ0PElCKu23oz0likyfvHRq/DiITjTT4ifZ9/o3QPAJRuFwwxqJ/\nVwbUeo3QnDHBAA+TyExit1lek4JzyOa6VwpqhbsEzS3pEMxMI6g3qQTBIQsP\nN09lnOvBuQkO65/Oj1RExQZCbj6mXr9IxcsAoZlhiPkkz+hvcYEbZoJaNWz6\nJP0ZcfMyC1oPhM0wvLGogyb9sFGfd8KN5payq32UzdjLvkmpleW5sty99SHq\nI8EE\r\n=pRKK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICpNU0yxkUNQ5zxP3KrGNuv8yssH4t1+EABvtssgHVRBAiBCs+iA6mmcydUhq0xGtCljYu7IhhqAFqi3z6pzJi/yiQ=="}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.3.14-beta.2_1593979130047_0.5465861791506121"},"_hasShrinkwrap":false},"3.3.14":{"name":"@mihanizm56/fetch-api","version":"3.3.14","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","colors":"1.4.0","node-fetch":"2.6.0","query-string":"6.13.1"},"devDependencies":{"@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.0.4","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript":"3.8.3","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"gitHead":"eb1f7a18e9a1a08feb46b66cde93dfd14a7a46e2","_id":"@mihanizm56/fetch-api@3.3.14","_nodeVersion":"12.13.0","_npmVersion":"6.14.5","dist":{"integrity":"sha512-STXKgh3cWAuw1hw5iuVxuXyRYIDUKCOPx//8sg58DDLIpyTUXt/I9ObcAqevKzVnIIW/HowBXAKFU7pHLHdycw==","shasum":"33faa0d0f54e72a42e88a82475020154b4553d92","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.3.14.tgz","fileCount":54,"unpackedSize":82657,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfAkh0CRA9TVsSAnZWagAA1jcP/A6aRxij0O8bIihKbW83\n2tAwl6x3RTlbAr2Xib5kQcz3IRjLcdP9y4YTqGSqn67RCQJR0xjUqSmv/nF/\nG0lFitchOCep89uY/zS2QyrvzeRAIkaBk9NPPutpEmp7mxTEZkoyPwWwgoNi\npRaitBhsOp0VJItoPD1GFmosJTtIZxfmcwSYIy8W+1fopPv/555LSRR0HUOp\nb3jeWoZLMJwDrbaSZY1xuO4l0zE/YtP6s1n+RF34vkaH0/SlbfO+8U0q0WZH\nukxzvndg9wLHnnuHjuXgBfHIqC0+MwDUP4CjdyC5u7XRUascQXrMn4UGlTTJ\nz+afGt6JftReGnMYk7AU2fUnAIvO0lUImHrVjm5cKR7sX043SnWWu5QcdI6M\ndlbw7+iz/KnHl53wVVZwszf71gRlvzo/J+vYRor69Xs75ogo8lAx09PycAVo\nVavzLG8OAFULte/Nx2o4nyiBitGRQG6nGImA607Yar1G6svuJ5zq7m2NewRP\n0zRPHNxgfmTbJ8cAUJ4rqiU1xBhtx4u8eQaICP+JuErrjOouyDfWg/P0g1sq\nRLKkK9dtgQPPoYHffdCkLjcmSu+HWfV3l9TH2lAJuc80Kiy4+NWnQU0E0NUw\nrhAtld+N3CjJezkN1YtB0T5fVAz/xvuy7YtQUwJzkeNQumev5kPyefly12Fx\nJ3Uq\r\n=xF26\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCksEito26SXaJDK07Y8xgXjqie3KFeC1jKiUs4v4jmJAIhAJMUq5uxbCktTzPIbWIzJm23A0S5q8iVvn8UsD/9208E"}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.3.14_1593985139587_0.26577047749167604"},"_hasShrinkwrap":false},"3.3.15-beta-1":{"name":"@mihanizm56/fetch-api","version":"3.3.15-beta-1","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","colors":"1.4.0","node-fetch":"2.6.0","query-string":"6.13.1"},"devDependencies":{"@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.0.4","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript":"3.8.3","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for http/1.1 isomorphic fetch\n\n### Benefits:\n\n- Provides validation for responses (based on @hapi/joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services)\nhttps://www.npmjs.com/package/query-string is used\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in\n  hard-structured responce format or not (both interfaces are the same)\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n\n#### Request input options:\n\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use @hapi/joi\n- customTimeout(number) - milliseconds for cancel the request on timeout\n\n#### Request output options:\n\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n\n- body will be serialized in JSON if body data NOT FormData\n- try to use .unknown() method with objects in Joi Schemas because your backend may be extended\n  and without this method the responce data may be not valid\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n## Examples of usage\n\n### REST API\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### get request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          }).unknown()\n        ),\n      }).unknown(),\n    }).unknown(),\n  });\n```\n\n#### get request with blob parse\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getPhotoRequest = (): Promise<IResponse> =>\n  new RestRequest().getBlobRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    responseSchema: Joi.any()\n  });\n```\n\n#### get PURE REST request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { PureRestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new PureRestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          }).unknown()\n        ),\n      }).unknown(),\n    }).unknown(),\n  });\n```\n\n#### post(put/patch/delete have the same format) request\n\n```javascript\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    body: someData,\n    mode: \"cors\",\n    queryParams: {\n      id: \"test_id_123\",\n    },\n    headers: {\n      \"Content-Type\": \"application/json\",\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\")),\n    }).unknown(),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createReviseRequest(\n  someData\n);\n```\n\n### JSON-RPC API\n\n```javascript\nimport { JSONRPCRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createItemsRequest = (someData): Promise<IResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint: \"http://localhost:3000\",\n    body: {\n      method: 'some method',\n      params: 123\n    }\n    queryParams: {\n      stringId: \"123\"\n      someArray: ['1', 1, '2', 2],\n      numberId: 100\n    },\n    responseSchema: Joi.object({\n      items: Joi.array().items(\n        Joi.object({\n          id: Joi.string().required(),\n          name: Joi.string().required(),\n          name: Joi.string()\n        }).unknown()\n      )\n    }).unknown(),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n\n#### Cancelling the request\n\n```javascript\nimport { RestRequest, IResponse, ABORT_REQUEST_EVENT_NAME } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    body: someData,\n    abortRequestId: '1',\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\")),\n    }).unknown(),\n  });\n);\n\ndocument.dispatchEvent(\n  new CustomEvent(ABORT_REQUEST_EVENT_NAME, {\n    detail: { id: '1' },\n  }),\n);\n```","readmeFilename":"README.md","gitHead":"81ea48ec199d7beae1361b99a5c9690d43022d32","_id":"@mihanizm56/fetch-api@3.3.15-beta-1","_nodeVersion":"12.13.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-xXZQDrM+vcTmk4LdlmbFR6l+ydpmeZ7TZKC4Y7hwEjMxtY7Xodio/+1fHJfV1Y7yL/bSbjIbLnq1iaZSbRZTKw==","shasum":"cdabaec6a6dceac3ac45ec30ddfa867077e5011b","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.3.15-beta-1.tgz","fileCount":56,"unpackedSize":84052,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfGG/wCRA9TVsSAnZWagAAmAkQAIFGWAH9Hw0OCzhvKhCp\n4HmD/TyiB2psx6wQo4Ta7Qy3IunzGosrS7zZqFECn+UII9tBZf6HJXe/scyt\nwM3emFzWhpgY171W8hF96qLV8MisDFsoKk39uuQC01dT5ghseHKdabBoJexW\naoluUmyZrrhEdWhOASmjTIPDpDF8mlEouQ+eKGPbAVqk1woon49IyiyzVACn\nhQB4CKtzJsfjkCVRL8nTHuC7tCsLm8SP11corixCRIcMoi6oSaeVLwP32Uhc\n7Luz2fCFijHrxj9KJhyf+HFhpb3tkgREZd7HvwPyG7vkpGD3WdOKTlARlh04\nzGUCwrcfknaBhlbulD/BeS82zKmzsEjzbV2/J/6bqpebVmutgbr2ts9o2HhA\nUVXVX5lnLihLogxmZUORtsrWhfaU5GsDh69klU5HhisZhPdNg4RNYbZc4+6I\nJOZRUTU84JNnOMBo8llZaTvj1iSx94S7fIb1UddI5/giidqAUo9LtgRaCe/r\nAAGBIqz7Rr8xu8dZ8XfANpa8kIloNRqhIS0/fmnEj00LJit/UGOWCs+HwlpE\nOhfr1clWa4L3x6u8Xas1mRJJuXkMsAtKR/JvWO0fyQ67aEnUdJd4mAZtC+dD\nxg5fFzCrQwfD6GZXCZfjgkCgvCsNuI0x8LA3ynDktU9Gs0LLyK2Jyimc/3JB\nTles\r\n=d07o\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIALPc8M0ArEcOPgxtjRevvFEkNn2qwKgGpFCrpGevg4QAiA9nc5C+WxHr0j03U6JI1mVJ+qOJ9mMhstHR+bUtJE3JQ=="}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.3.15-beta-1_1595437039995_0.39541821828208734"},"_hasShrinkwrap":false},"3.3.15":{"name":"@mihanizm56/fetch-api","version":"3.3.15","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","colors":"1.4.0","node-fetch":"2.6.0","query-string":"6.13.1"},"devDependencies":{"@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.0.4","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript":"3.8.3","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"gitHead":"20990f5d5406771fee58f168fc8832f0fd4fe272","_id":"@mihanizm56/fetch-api@3.3.15","_nodeVersion":"12.13.0","_npmVersion":"6.14.6","dist":{"integrity":"sha512-G+ZG29pTCJ7H7S0RYVNdKFV30cj8VVv39Hnuay8kEcn6v4OEU9KP9BjRScOtpan6faF1R2K2m7YVA9qba6TZAQ==","shasum":"d2ac5a93a18a70e9f2ee08111aa9a79ab50042d3","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.3.15.tgz","fileCount":56,"unpackedSize":84045,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfHLzNCRA9TVsSAnZWagAA7dYP/jPDLk/FBdgK7FRzygAQ\nnIIA9AKbskwXTjBoHosmCJR5yE86MHYfsJiifMLlUvfFiJBPbRfF9L4gmqop\n0kkjPmTDqGqPPjzGieTYAjj6KijqGvcOHrKB9pELBfSgTJcStvamGoqEnbWg\nGbgQXRzq6O8tAJwI5LC+5gnx0P3zSIA5PyLD2NUGNpj5wCfHqa0i3bmA/0ht\n8m/lrpx0sLLFvpN04gV3BlhyBKQyLq/fXelmeZTW02CjW4Fti3rR58Q/vYLT\nF/pY5twhrjKcbuB3j2bjKQq2arlcqCGE8qRSSH+6EijaCaezelis0fTFymvk\ntrcbVt+w+ANtFwZbkQ8Mu9k8Zg9ijejnSMlaawrXIYP3e0nx6nkl9bbnq4wc\nwjMjpBfdQbM1hS1/eWQeUGXofgd7UftaSiim+UhniC0fnXgo3Yl5QxB5NUc7\npkkoUC3pEqHAyvUfkGmITh8HK958HiPSz/YrMNgdetnLxwXtOHHaAlVngbe0\nTYkCjjcq6dS/rjQVRv/Pyqb7E35BJ0PnOhPyzyWJKXTUQrSBZ0RNiM+tK3FC\nwzaPeprC2qke29M3k9Jl7axObL2lNzPy54D1hTiF1tKRPSMcaY433lBliOfM\n/HmdGtfZWM7YMWgQUimIk1Lq36qMkZ22ZhGD+v0lthgoiw035iTn88E3J1jr\nr3t1\r\n=yeNn\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDM5Rnir6VkY0/kM2mlD5uqR6NwEXOPgV6Jiwt1rw1glAIhAOFh+gplJdLs7mCcI3kiMESSUHf8ZdDjUHp8Gj9OAqpO"}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.3.15_1595718860700_0.5266134450473732"},"_hasShrinkwrap":false},"3.3.16-beta.1":{"name":"@mihanizm56/fetch-api","version":"3.3.16-beta.1","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","colors":"1.4.0","node-fetch":"2.6.0","query-string":"6.13.1"},"devDependencies":{"@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.0.4","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript":"3.8.3","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for http/1.1 isomorphic fetch\n\n### Benefits:\n\n- Provides validation for responses (based on @hapi/joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services)\nhttps://www.npmjs.com/package/query-string is used\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in\n  hard-structured responce format or not (both interfaces are the same)\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n\n#### Request input options:\n\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use @hapi/joi\n- customTimeout(number) - milliseconds for cancel the request on timeout\n\n#### Request output options:\n\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n\n- body will be serialized in JSON if body data NOT FormData\n- try to use .unknown() method with objects in Joi Schemas because your backend may be extended\n  and without this method the responce data may be not valid\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n## Examples of usage\n\n### REST API\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### get request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          }).unknown()\n        ),\n      }).unknown(),\n    }).unknown(),\n  });\n```\n\n#### get request with blob parse\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getPhotoRequest = (): Promise<IResponse> =>\n  new RestRequest().getBlobRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    responseSchema: Joi.any()\n  });\n```\n\n#### get PURE REST request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { PureRestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new PureRestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          }).unknown()\n        ),\n      }).unknown(),\n    }).unknown(),\n  });\n```\n\n#### post(put/patch/delete have the same format) request\n\n```javascript\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    body: someData,\n    mode: \"cors\",\n    queryParams: {\n      id: \"test_id_123\",\n    },\n    headers: {\n      \"Content-Type\": \"application/json\",\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\")),\n    }).unknown(),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createReviseRequest(\n  someData\n);\n```\n\n### JSON-RPC API\n\n```javascript\nimport { JSONRPCRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createItemsRequest = (someData): Promise<IResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint: \"http://localhost:3000\",\n    body: {\n      method: 'some method',\n      params: 123\n    }\n    queryParams: {\n      stringId: \"123\"\n      someArray: ['1', 1, '2', 2],\n      numberId: 100\n    },\n    responseSchema: Joi.object({\n      items: Joi.array().items(\n        Joi.object({\n          id: Joi.string().required(),\n          name: Joi.string().required(),\n          name: Joi.string()\n        }).unknown()\n      )\n    }).unknown(),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n\n#### Cancelling the request\n\n```javascript\nimport { RestRequest, IResponse, ABORT_REQUEST_EVENT_NAME } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    body: someData,\n    abortRequestId: '1',\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\")),\n    }).unknown(),\n  });\n);\n\ndocument.dispatchEvent(\n  new CustomEvent(ABORT_REQUEST_EVENT_NAME, {\n    detail: { id: '1' },\n  }),\n);\n```","readmeFilename":"README.md","gitHead":"0ed94f83cb9aad7d549a47f6cf364acf865cf25a","_id":"@mihanizm56/fetch-api@3.3.16-beta.1","_nodeVersion":"12.13.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-1CyYDaqQUxxaFIUgQWVn7tBpiaDxPajLD94JTQfyoNVpgPu0VxLgAyk27LJmSpOdhi/03IkJ0XfaufQ3SQobAw==","shasum":"226075ed732af7be9cc82550754e2a833bdf7572","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.3.16-beta.1.tgz","fileCount":56,"unpackedSize":83921,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfSte8CRA9TVsSAnZWagAAUMcP/0sLmp9xx4HqXICkgD3p\n1fH7VD82hmZIE4P0dOMdWRj0kptMSjQDTNuAeqrxH8/y/yJP/4Q8bkaDsUiE\nIVR4Ii6ja6XRFU2DLSAcHde7Thosf+Zo0AtuqsXgFffe9bRATBw3CpT1rna8\nOt856JxIr1Sv5jBSELoTUcdbdlb+1Wa3p/r1qF95i8cJqdGFea70OwzlS5IU\nseuqhAzunMlfgF1aJZ0+17KANM8DJrOrNrl7zYD567gcwEdWtlfBEkFk7rqJ\ncQpIGSfeRqdwJm8FLypjY9ywuOZWaVqGSD+zCSfWIe11I+AHGXdGd4UUDgtL\nRioEoKd0hXwlbgV0QATnu1/g9f2/w48Pyt5xNhUiP81fF8I3ZBnlTsES0dZL\nymcgGYCPBrGxOFPgshcJZlNCtlv/NXGZM/g76KKJHmjlZN3zGn0Kl2XKwx2o\nhERJUvXrom7+QsLf1trEX/JbIESLAdBNx8i3GadyQljq6cfOY6KWrZf0FTFt\n7sze8/xF0nYVefwk5GCHpNcNtQwTQF4PV6jVGdQK0d7O8G/Z/ME+diJmgz0B\nsJPmcoIVdEaB5IPMd/R/w+DxRvOMzG0ftRUZRyuglwyUrwATsieUD8PczX1z\nf1j45qZGm60LUeq1SoiaJQDHefwkSsd2k0E7Ag2vz3eJRIAr67GsT36AJzdE\nMFAy\r\n=aGmg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAPiNnp0yiw8jISQtPjzmELoDws3mKYyE/xaiYUCIZ7SAiEAvAvud+8TDb3EdClH/qvmWSQ/RiI4X7DDy3INeXCQYbU="}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.3.16-beta.1_1598740411947_0.5276782812008813"},"_hasShrinkwrap":false},"3.3.16-beta.2":{"name":"@mihanizm56/fetch-api","version":"3.3.16-beta.2","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","colors":"1.4.0","node-fetch":"2.6.0","query-string":"6.13.1"},"devDependencies":{"@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.0.4","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript":"3.8.3","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for http/1.1 isomorphic fetch\n\n### Benefits:\n\n- Provides validation for responses (based on @hapi/joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services)\nhttps://www.npmjs.com/package/query-string is used\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in\n  hard-structured responce format or not (both interfaces are the same)\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n\n#### Request input options:\n\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use @hapi/joi\n- customTimeout(number) - milliseconds for cancel the request on timeout\n\n#### Request output options:\n\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n\n- body will be serialized in JSON if body data NOT FormData\n- try to use .unknown() method with objects in Joi Schemas because your backend may be extended\n  and without this method the responce data may be not valid\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n## Examples of usage\n\n### REST API\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### get request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          }).unknown()\n        ),\n      }).unknown(),\n    }).unknown(),\n  });\n```\n\n#### get request with blob parse\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getPhotoRequest = (): Promise<IResponse> =>\n  new RestRequest().getBlobRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    responseSchema: Joi.any()\n  });\n```\n\n#### get PURE REST request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { PureRestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new PureRestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          }).unknown()\n        ),\n      }).unknown(),\n    }).unknown(),\n  });\n```\n\n#### post(put/patch/delete have the same format) request\n\n```javascript\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    body: someData,\n    mode: \"cors\",\n    queryParams: {\n      id: \"test_id_123\",\n    },\n    headers: {\n      \"Content-Type\": \"application/json\",\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\")),\n    }).unknown(),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createReviseRequest(\n  someData\n);\n```\n\n### JSON-RPC API\n\n```javascript\nimport { JSONRPCRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createItemsRequest = (someData): Promise<IResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint: \"http://localhost:3000\",\n    body: {\n      method: 'some method',\n      params: 123\n    }\n    queryParams: {\n      stringId: \"123\"\n      someArray: ['1', 1, '2', 2],\n      numberId: 100\n    },\n    responseSchema: Joi.object({\n      items: Joi.array().items(\n        Joi.object({\n          id: Joi.string().required(),\n          name: Joi.string().required(),\n          name: Joi.string()\n        }).unknown()\n      )\n    }).unknown(),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n\n#### Cancelling the request\n\n```javascript\nimport { RestRequest, IResponse, ABORT_REQUEST_EVENT_NAME } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    body: someData,\n    abortRequestId: '1',\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\")),\n    }).unknown(),\n  });\n);\n\ndocument.dispatchEvent(\n  new CustomEvent(ABORT_REQUEST_EVENT_NAME, {\n    detail: { id: '1' },\n  }),\n);\n```","readmeFilename":"README.md","gitHead":"8a8c21ca62d85b3548eec691444fd4ef765f5c40","_id":"@mihanizm56/fetch-api@3.3.16-beta.2","_nodeVersion":"12.13.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-iwIngPL0a8WHVArNEegTxLOjI+oOlhx5ldGZrv0iR+dx7mdTMNEIF6vGZhW0SQgji7n1S2xkp6By8CEv3wON4Q==","shasum":"a7a77f4117b56271eb14f5b99c2d1763a59ed060","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.3.16-beta.2.tgz","fileCount":56,"unpackedSize":84108,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfTLr9CRA9TVsSAnZWagAA2UUQAKAVjHkmshON8yh9jx4A\n0SD2fQeoAkjdhCo1kSv7Blab0/GJUH5CzrPB+Dde2hy1Q290X0CQwO9Ot+WT\nZt3aAQs2txlgRsAJTe/TSTB3LOp6eLkNXhfW6sVotsgIzy4mO8ZpX211fkyR\ndvHgoehXny6HmeRwpWwhzVFZcibq5zZ2WEiXyh4xVter8OxL0lh9sAKQ8DE0\nEVm+hnTePUiD8mj347PG0B1UskM4ywpShz+0DLjW+OJCgdJV77zyJfkWFygI\nHAFnIrIDJzCK8DH5D1VmnjhF2n/HbmBzKPGO2AeOK4tYyTBK7GqC5Jcp/wDg\nztKIHKgXPZAeQUgTT8WSVnBnUHyeuNGGyGwlh/tB2HPVukDb/7TsAGlHRs8b\nLHyL7XX115MPHnIaeNx9Gi05HF1OtYl2iv8uMRLJ6wuhOtIZFiAL1jt6R2oe\nBmNVaQOjTnpsNEP0YzS6iIJoEH6DMc+6q4sahfoUT4tEoURp4SdLhey7QC24\nFJgd9H5XQLNwzOSnG2RZVuUSP1BXrHsIPSSuXpTP/NZ1GrKmk5zDNvuVJOWb\n+pEisoECp5LU8YBySt87L50Uv4rF0gS8kfbC+YxvzU/1E0GLjJXyZfKNByQV\nbRX4547M0swiS+mmcPKN/XllxQ86FU1E44C0b7xzL9UbOC3OSsVyyWnjhdS4\n2LKz\r\n=tjGw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDDxPP5dBDTK5NAG89l0Pt6JRKY5+7hFLfCh6d97g18fwIhANuQVT42+FdSnmctqYkVLhw6kWT5goLmXc+FjCAoTAoc"}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.3.16-beta.2_1598864125179_0.12468145246730011"},"_hasShrinkwrap":false},"3.3.16-beta.3":{"name":"@mihanizm56/fetch-api","version":"3.3.16-beta.3","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","colors":"1.4.0","node-fetch":"2.6.0","query-string":"6.13.1"},"devDependencies":{"@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.0.4","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript":"3.8.3","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for http/1.1 isomorphic fetch\n\n### Benefits:\n\n- Provides validation for responses (based on @hapi/joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services)\nhttps://www.npmjs.com/package/query-string is used\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in\n  hard-structured responce format or not (both interfaces are the same)\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n\n#### Request input options:\n\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use @hapi/joi\n- customTimeout(number) - milliseconds for cancel the request on timeout\n\n#### Request output options:\n\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n\n- body will be serialized in JSON if body data NOT FormData\n- try to use .unknown() method with objects in Joi Schemas because your backend may be extended\n  and without this method the responce data may be not valid\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n## Examples of usage\n\n### REST API\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### get request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          }).unknown()\n        ),\n      }).unknown(),\n    }).unknown(),\n  });\n```\n\n#### get request with blob parse\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getPhotoRequest = (): Promise<IResponse> =>\n  new RestRequest().getBlobRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    responseSchema: Joi.any()\n  });\n```\n\n#### get PURE REST request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { PureRestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new PureRestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          }).unknown()\n        ),\n      }).unknown(),\n    }).unknown(),\n  });\n```\n\n#### post(put/patch/delete have the same format) request\n\n```javascript\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    body: someData,\n    mode: \"cors\",\n    queryParams: {\n      id: \"test_id_123\",\n    },\n    headers: {\n      \"Content-Type\": \"application/json\",\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\")),\n    }).unknown(),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createReviseRequest(\n  someData\n);\n```\n\n### JSON-RPC API\n\n```javascript\nimport { JSONRPCRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createItemsRequest = (someData): Promise<IResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint: \"http://localhost:3000\",\n    body: {\n      method: 'some method',\n      params: 123\n    }\n    queryParams: {\n      stringId: \"123\"\n      someArray: ['1', 1, '2', 2],\n      numberId: 100\n    },\n    responseSchema: Joi.object({\n      items: Joi.array().items(\n        Joi.object({\n          id: Joi.string().required(),\n          name: Joi.string().required(),\n          name: Joi.string()\n        }).unknown()\n      )\n    }).unknown(),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n\n#### Cancelling the request\n\n```javascript\nimport { RestRequest, IResponse, ABORT_REQUEST_EVENT_NAME } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    body: someData,\n    abortRequestId: '1',\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\")),\n    }).unknown(),\n  });\n);\n\ndocument.dispatchEvent(\n  new CustomEvent(ABORT_REQUEST_EVENT_NAME, {\n    detail: { id: '1' },\n  }),\n);\n```","readmeFilename":"README.md","gitHead":"2c99fc3bbdd89bcf7f955e22fc48f6f25db798c3","_id":"@mihanizm56/fetch-api@3.3.16-beta.3","_nodeVersion":"12.13.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-aObKIYlZz1+4D5TZAkmZ7kuyDmuBwRYe7/re6rPEzE5jF3vrDxSJFTT2N9wmCDCsKOBHvfs9IMyXaMbzA4D79w==","shasum":"9c520ca2b359f4371988f373f511dafa99b277e3","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.3.16-beta.3.tgz","fileCount":56,"unpackedSize":84109,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfTLuBCRA9TVsSAnZWagAAtt0P/2s82meRv41vajFg3JgB\ndDHJyVCqNEVDbLiaXdK9s9DrepFtev2C6MHX29Y4FqNrhWP/dZuxunjy/lki\nzicO5TRUNUletPLnSU9XIqWa0S8nbHCqTlVSjRPKM5V2J7+t/TM4TXTLProR\nW74rALP4MhWriB1Ul0wOOwsT45lMXxET8lkHr4F4lsbumAx7wf1ul9n7Rz1k\nDjexwhjtTnnhVeuPmgQGk7zpw6EVAROo444GFa8F5Y/Bb0XaoLjKRsEsLAWz\n+VQtcY3K1DxSCXvrABICfkbrE+uQGuzGoX9bvDaW3GPPn9tmizKhEoLtqrHV\njSmMUrq8YJa5zGBbm1fjWLJKDF/ANcrHEYdLUe9mtXcoh/a0SGxwkMoy0H0e\nQHKZxqz8xAeWKM0IgK3gLb+e4gpTj49nfkaprJDaD30N15Fw7wv8hnGaANdN\n1DyAA/HWVk5HrxLlWIXc+NxLaIzoLRXmijCzJtbMWDWy9eg9QA594FWMdlm+\nOsnonlgTkOoyH1qKdO2IkM/IfVDH6N5Gao7g5xI+2DLNlEEtVDyBQV+72tBz\nEsK/R0vFmxD+ec08OVu0D7LBcn3+38a2eF6qK5tPgYp6lwvnBKKp6GP9CGor\nuyc6LkgdEpjyQpOz4VKqra7SVvvL5YKgF4mxZVdeykQgq31YVhXm+goFYn25\n6LCu\r\n=7qS5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAOOClVfDUbwejm+gp8FF7ESTCZ0jDoXWUsVtNrQjJGxAiA877/LlkfU1gSBJJjJebk88EZjtaLdFiuu+lCmsZOD5A=="}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.3.16-beta.3_1598864257178_0.9659420327240644"},"_hasShrinkwrap":false},"3.3.16-beta.4":{"name":"@mihanizm56/fetch-api","version":"3.3.16-beta.4","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","colors":"1.4.0","node-fetch":"2.6.0","query-string":"6.13.1"},"devDependencies":{"@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.0.4","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript":"3.8.3","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for http/1.1 isomorphic fetch\n\n### Benefits:\n\n- Provides validation for responses (based on @hapi/joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services)\nhttps://www.npmjs.com/package/query-string is used\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in\n  hard-structured responce format or not (both interfaces are the same)\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n\n#### Request input options:\n\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use @hapi/joi\n- customTimeout(number) - milliseconds for cancel the request on timeout\n\n#### Request output options:\n\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n\n- body will be serialized in JSON if body data NOT FormData\n- try to use .unknown() method with objects in Joi Schemas because your backend may be extended\n  and without this method the responce data may be not valid\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n## Examples of usage\n\n### REST API\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### get request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          }).unknown()\n        ),\n      }).unknown(),\n    }).unknown(),\n  });\n```\n\n#### get request with blob parse\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getPhotoRequest = (): Promise<IResponse> =>\n  new RestRequest().getBlobRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    responseSchema: Joi.any()\n  });\n```\n\n#### get PURE REST request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { PureRestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new PureRestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          }).unknown()\n        ),\n      }).unknown(),\n    }).unknown(),\n  });\n```\n\n#### post(put/patch/delete have the same format) request\n\n```javascript\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    body: someData,\n    mode: \"cors\",\n    queryParams: {\n      id: \"test_id_123\",\n    },\n    headers: {\n      \"Content-Type\": \"application/json\",\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\")),\n    }).unknown(),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createReviseRequest(\n  someData\n);\n```\n\n### JSON-RPC API\n\n```javascript\nimport { JSONRPCRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createItemsRequest = (someData): Promise<IResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint: \"http://localhost:3000\",\n    body: {\n      method: 'some method',\n      params: 123\n    }\n    queryParams: {\n      stringId: \"123\"\n      someArray: ['1', 1, '2', 2],\n      numberId: 100\n    },\n    responseSchema: Joi.object({\n      items: Joi.array().items(\n        Joi.object({\n          id: Joi.string().required(),\n          name: Joi.string().required(),\n          name: Joi.string()\n        }).unknown()\n      )\n    }).unknown(),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n\n#### Cancelling the request\n\n```javascript\nimport { RestRequest, IResponse, ABORT_REQUEST_EVENT_NAME } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    body: someData,\n    abortRequestId: '1',\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\")),\n    }).unknown(),\n  });\n);\n\ndocument.dispatchEvent(\n  new CustomEvent(ABORT_REQUEST_EVENT_NAME, {\n    detail: { id: '1' },\n  }),\n);\n```","readmeFilename":"README.md","gitHead":"b2cb69b69b479ddcf16c36f33de5669b49416753","_id":"@mihanizm56/fetch-api@3.3.16-beta.4","_nodeVersion":"12.13.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-MKPbuMZs1+JATfn0G+YbLVaxJuJQuOEtUQdUZxNfyoHCpRz6oxg4NlM02S0/nl0I74nhfQcnnMhBJlxltoiDcg==","shasum":"8cac95eea730d0c4acedc78a5085135429cfc72d","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.3.16-beta.4.tgz","fileCount":56,"unpackedSize":86754,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfVUn/CRA9TVsSAnZWagAA7XAQAJLpjgQ3F2RnAnwUHYPf\nwD21V4DldgnhJCq6D0yoiEPtR+oKKwKKZ6N9SdCwlMLvstcXNbLwqNEzPcbP\n+3eZTrKF5Ro0/0V8zv5qFSzwEDglEPnqfALHze08LMN+cCOHFNRZOLWKzMOf\nHknAYqj7xZPbNqDN4iUsA3smeEMS5ZWrQvcGBb7ZlwPmz6jXbut3JmG6BNsK\nPk6e/vI4apM0JtH4uTbryY3epYKJcG0utLs/6+sz2JetMk92xlBnMle1BVZ+\nhwPaOEoVEZQDhSSF7K7cxgZkgPkbolLAzNl7/zD5ZoYnvehjaH7TD9AH4BWx\nluy6VA1EUe7QDOVQXXxsb0auGTJvx+85MshysDSFmqelpzu01OGHqzib3V6D\nloBKZBuhzFgDiIh78whWodDs39xf4nmVeM4Ovuc5RETb8bLudknELWEEqk+z\nSiZ96eXkyLS9feYTSo9f6khTybDFRj31P7awBpHukPDUXTrVgNUj834rUZ1r\n/FaYAFjhQYFeTeIDDxtxSMZDdWTk0/R6N8+kngm28qxvPfTErcY3RKLKg4z5\noLWp5loyJVvNN9OAZsvvSGOI69b2j42aGVTGGqi+6G90yrgAXqZD+kzzeyGp\nRpMMr9sDukUcqWQKa7YdRJMxXkZcr4wt3yMzzfwYtQ3OGu3zqk7HdprmB5TV\nYN5W\r\n=UfCc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDW0/3ukv460ALfcSXGQuXbGvgjfHt0EmHIiwPmvQp8MAIgLGEiTi0hBqEdHPMBdBR4Lmzh7PqPaEFApsYwCck/Mvs="}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.3.16-beta.4_1599425022637_0.260404345593795"},"_hasShrinkwrap":false},"3.3.16-beta.5":{"name":"@mihanizm56/fetch-api","version":"3.3.16-beta.5","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","colors":"1.4.0","node-fetch":"2.6.0","query-string":"6.13.1"},"devDependencies":{"@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.0.4","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript":"3.8.3","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for http/1.1 isomorphic fetch\n\n### Benefits:\n\n- Provides validation for responses (based on @hapi/joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services)\nhttps://www.npmjs.com/package/query-string is used\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in\n  hard-structured responce format or not (both interfaces are the same)\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n\n#### Request input options:\n\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use @hapi/joi\n- customTimeout(number) - milliseconds for cancel the request on timeout\n\n#### Request output options:\n\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n\n- body will be serialized in JSON if body data NOT FormData\n- try to use .unknown() method with objects in Joi Schemas because your backend may be extended\n  and without this method the responce data may be not valid\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n## Examples of usage\n\n### REST API\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### get request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          }).unknown()\n        ),\n      }).unknown(),\n    }).unknown(),\n  });\n```\n\n#### get request with blob parse\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getPhotoRequest = (): Promise<IResponse> =>\n  new RestRequest().getBlobRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    responseSchema: Joi.any()\n  });\n```\n\n#### get PURE REST request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { PureRestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new PureRestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          }).unknown()\n        ),\n      }).unknown(),\n    }).unknown(),\n  });\n```\n\n#### post(put/patch/delete have the same format) request\n\n```javascript\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    body: someData,\n    mode: \"cors\",\n    queryParams: {\n      id: \"test_id_123\",\n    },\n    headers: {\n      \"Content-Type\": \"application/json\",\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\")),\n    }).unknown(),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createReviseRequest(\n  someData\n);\n```\n\n### JSON-RPC API\n\n```javascript\nimport { JSONRPCRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createItemsRequest = (someData): Promise<IResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint: \"http://localhost:3000\",\n    body: {\n      method: 'some method',\n      params: 123\n    }\n    queryParams: {\n      stringId: \"123\"\n      someArray: ['1', 1, '2', 2],\n      numberId: 100\n    },\n    responseSchema: Joi.object({\n      items: Joi.array().items(\n        Joi.object({\n          id: Joi.string().required(),\n          name: Joi.string().required(),\n          name: Joi.string()\n        }).unknown()\n      )\n    }).unknown(),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n\n#### Cancelling the request\n\n```javascript\nimport { RestRequest, IResponse, ABORT_REQUEST_EVENT_NAME } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    body: someData,\n    abortRequestId: '1',\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\")),\n    }).unknown(),\n  });\n);\n\ndocument.dispatchEvent(\n  new CustomEvent(ABORT_REQUEST_EVENT_NAME, {\n    detail: { id: '1' },\n  }),\n);\n```","readmeFilename":"README.md","gitHead":"935da290cd0a134f8420dcba26f1ae7ec237b5af","_id":"@mihanizm56/fetch-api@3.3.16-beta.5","_nodeVersion":"12.13.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-wYBZDQ0nYGi6hAPA5r7ZxA7SPY0nFFObUeacKQgyYWrPoFOUDyDAJltKNNRZHwO3qAm5y8jpiAtXwhF2vp55qw==","shasum":"a7b61a12d49ace58b1a5d0b7ba9423d42bf7f9ab","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.3.16-beta.5.tgz","fileCount":58,"unpackedSize":95102,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfV3LoCRA9TVsSAnZWagAA4hsP/ikLv7sd+pS+V1ie6L/C\nHzgSIgk8hgMC3KDmDTQ+zUfCtb9pAE8eHvNmBUCnKYj7BZyJ8/qUOz25k6Ui\nIMruwvZxAulnfDRXyoUKH3QzB7dFv0it7kgAGg+LJct76nLoeG/WsIJejSjD\niBgwCxoamK/l1Ok7m9RNpmn69w1rliqzZcvLQLuJi0ipgJWNkiioduWTVL/A\n/Wlwz6EjzmAYRDyqHm65E5GSdU9TOMdY6dQSuzAh535rkIslnugy5kAZPlJ4\nhad98e3+ArhByWUljbK8g0OCuNo64/BuHhhoQRlM7BDCmOHLfTWntZgT3DK6\nATktHE5FB0UufobmywG2hDd5VNawlUwV6jUErBObQNXxQS8URFVt01jN8GR0\nWo5SCR3SSoET4v81t4UgDteUFjJTFkeciZizUj5lh/+2tSiP2KZ0VM5bWi38\nw+HDw7d6+42/loXKDMolfLApRL9LEnSzmYVqiUtVJUp/EHqx2ZZbgi1YK9yX\nLRjJXGlfvNGOZ379+0U9etOVC24WYGFOkg7ffGb6JJC69rR0ws19ej9EdWJ6\niBc059UkPUjT9nB77YgwTt9nh2ZXAjn51mnaP8J2B4zu8sNqYE3m0Sh7jegL\nwSAO/vOUzsqujD6Xg996S35mfzg3kLNCsZM1AlD725mNXs1jwlSf+551myHv\nWUA8\r\n=/VWx\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHKNwPj2+2VqYymbLhPk1XBpGRx/gPaKJfhh0kwBCGVkAiEAxgOqZ3sMJlPyHLIDEK8fFCx1XdNWovQ29GAO1c1/EE0="}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.3.16-beta.5_1599566567836_0.11221517743058973"},"_hasShrinkwrap":false},"3.3.16-beta.6":{"name":"@mihanizm56/fetch-api","version":"3.3.16-beta.6","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","colors":"1.4.0","node-fetch":"2.6.0","query-string":"6.13.1"},"devDependencies":{"@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.0.4","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript":"3.8.3","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for http/1.1 isomorphic fetch\n\n### Benefits:\n\n- Provides validation for responses (based on @hapi/joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services)\nhttps://www.npmjs.com/package/query-string is used\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in\n  hard-structured responce format or not (both interfaces are the same)\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n\n#### Request input options:\n\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use @hapi/joi\n- customTimeout(number) - milliseconds for cancel the request on timeout\n\n#### Request output options:\n\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n\n- body will be serialized in JSON if body data NOT FormData\n- try to use .unknown() method with objects in Joi Schemas because your backend may be extended\n  and without this method the responce data may be not valid\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n## Examples of usage\n\n### REST API\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### get request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          }).unknown()\n        ),\n      }).unknown(),\n    }).unknown(),\n  });\n```\n\n#### get request with blob parse\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getPhotoRequest = (): Promise<IResponse> =>\n  new RestRequest().getBlobRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    responseSchema: Joi.any()\n  });\n```\n\n#### get PURE REST request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { PureRestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new PureRestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          }).unknown()\n        ),\n      }).unknown(),\n    }).unknown(),\n  });\n```\n\n#### post(put/patch/delete have the same format) request\n\n```javascript\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    body: someData,\n    mode: \"cors\",\n    queryParams: {\n      id: \"test_id_123\",\n    },\n    headers: {\n      \"Content-Type\": \"application/json\",\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\")),\n    }).unknown(),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createReviseRequest(\n  someData\n);\n```\n\n### JSON-RPC API\n\n```javascript\nimport { JSONRPCRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createItemsRequest = (someData): Promise<IResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint: \"http://localhost:3000\",\n    body: {\n      method: 'some method',\n      params: 123\n    }\n    queryParams: {\n      stringId: \"123\"\n      someArray: ['1', 1, '2', 2],\n      numberId: 100\n    },\n    responseSchema: Joi.object({\n      items: Joi.array().items(\n        Joi.object({\n          id: Joi.string().required(),\n          name: Joi.string().required(),\n          name: Joi.string()\n        }).unknown()\n      )\n    }).unknown(),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n\n#### Cancelling the request\n\n```javascript\nimport { RestRequest, IResponse, ABORT_REQUEST_EVENT_NAME } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    body: someData,\n    abortRequestId: '1',\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\")),\n    }).unknown(),\n  });\n);\n\ndocument.dispatchEvent(\n  new CustomEvent(ABORT_REQUEST_EVENT_NAME, {\n    detail: { id: '1' },\n  }),\n);\n```","readmeFilename":"README.md","gitHead":"724e46316f6530ea704bd2485e047b82eead1fde","_id":"@mihanizm56/fetch-api@3.3.16-beta.6","_nodeVersion":"12.13.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-M4Wc4PGRnT/zFAhQ24KH8cHQNyt7NPwFZHeA+tlLM43RFPtCDkilKmNQmKPZ/Ro+iyFDzw0EbrRN3SLQOEtpAQ==","shasum":"b5df245963b3a865da00ca882fc9df31f418dab5","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.3.16-beta.6.tgz","fileCount":58,"unpackedSize":95178,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfV5U+CRA9TVsSAnZWagAAgB4QAIHFM2wjpE42tlKf1HTc\nkcVyRQ2wbYz0oqOjk/bcIqAWR5GfyBXz8zYdRYmF4NP5WstrOPFLJkwUTOTy\nTdZfo0wkknticEJBfuoWZlWiUD8BRmA1WFR80ot0aCYke7+Jgf4hy/EFJlna\nw+jtKDbjYfc/ZY/rN4oXnYdteIQppdv4NSbYmkylWOj4G+Qh49RRPQqyGkq/\n7qIsPfy2hqbfPy8I78WfhEoD0yaDxbhZhAG5KjIXtSntnfl+SazhdE0S03GM\nLXCJPCrfDNtvIpqQBxItDbHguX07mysYDT4g2lW8h675gg6H+VAGviOsrAyo\nnqou7eAd2NkPq4ky7ObqkVbbN6wc8m57QCO2aR6pHzBVPVKe+rK24ez+6UwL\nHmQS0v2ylXPdxG8J/oaCtKyBwUQfMOd2BzQKtGVxXrIjVZ3xb7zZrFG3AOxX\nZjQ3t6t2T9bRVFQcQOOnH1+o/o4zjJWbKmEIGiSlOEfnvaUmYok3SDuaSkk6\nrsC0N6ReLeF01EnODCr0QlY2/2CXYEgq/QBwysdaM6Ld5Lw1xgsX9eHAXN6B\n5w2OpTaX35Zi0nkVM6xCxMd5e51L/C2w7/4CvZbuOCU4Vc9lIkaAMaaWujn4\ntq8oSwrSmYypyfW0b61JsQ3DZHFC5nzoNw5C50qhX//U4c7dBYwlWkHq9G28\nyCbW\r\n=/igm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCpUMw1qjc/6EEI2N6tbYtp6OsSTGiwR2Ri6R/fsZK9JwIhAMgpBdbdEiScmUiuOJ38O6wlraNvX4Gm/q3mljmEOPai"}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.3.16-beta.6_1599575357842_0.8154770047282585"},"_hasShrinkwrap":false},"3.3.16-beta.7":{"name":"@mihanizm56/fetch-api","version":"3.3.16-beta.7","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","colors":"1.4.0","node-fetch":"2.6.0","query-string":"6.13.1"},"devDependencies":{"@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.0.4","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript":"3.8.3","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for http/1.1 isomorphic fetch\n\n### Benefits:\n\n- Provides validation for responses (based on @hapi/joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services)\nhttps://www.npmjs.com/package/query-string is used\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in\n  hard-structured responce format or not (both interfaces are the same)\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n\n#### Request input options:\n\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use @hapi/joi\n- customTimeout(number) - milliseconds for cancel the request on timeout\n\n#### Request output options:\n\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n\n- body will be serialized in JSON if body data NOT FormData\n- try to use .unknown() method with objects in Joi Schemas because your backend may be extended\n  and without this method the responce data may be not valid\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n## Examples of usage\n\n### REST API\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### get request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          }).unknown()\n        ),\n      }).unknown(),\n    }).unknown(),\n  });\n```\n\n#### get request with blob parse\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getPhotoRequest = (): Promise<IResponse> =>\n  new RestRequest().getBlobRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    responseSchema: Joi.any()\n  });\n```\n\n#### get PURE REST request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { PureRestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new PureRestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          }).unknown()\n        ),\n      }).unknown(),\n    }).unknown(),\n  });\n```\n\n#### post(put/patch/delete have the same format) request\n\n```javascript\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    body: someData,\n    mode: \"cors\",\n    queryParams: {\n      id: \"test_id_123\",\n    },\n    headers: {\n      \"Content-Type\": \"application/json\",\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\")),\n    }).unknown(),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createReviseRequest(\n  someData\n);\n```\n\n### JSON-RPC API\n\n```javascript\nimport { JSONRPCRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createItemsRequest = (someData): Promise<IResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint: \"http://localhost:3000\",\n    body: {\n      method: 'some method',\n      params: 123\n    }\n    queryParams: {\n      stringId: \"123\"\n      someArray: ['1', 1, '2', 2],\n      numberId: 100\n    },\n    responseSchema: Joi.object({\n      items: Joi.array().items(\n        Joi.object({\n          id: Joi.string().required(),\n          name: Joi.string().required(),\n          name: Joi.string()\n        }).unknown()\n      )\n    }).unknown(),\n  });\n```\n\n### JSON-RPC API (with batching)\n\n```javascript\nimport { JSONRPCRequest, IResponse } from \"@mihanizm56/fetch-api\";\nimport Joi from '@hapi/joi'\n\nconst responseSchemaObjectOne = Joi.object({\n  foo: Joi.string().required(),\n}).unknown();\n\nconst responseSchemaObjectTwo = Joi.object({\n  foo: Joi.string().required(),\n}).unknown();\n\nexport const createItemsRequest = (someData): Promise<IResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint:\n      'http://localhost:8080/json-rpc/positive?batch=true&twoSchemas=true',\n    body: [\n      { method: 'listCountries', params: {} },\n      { method: 'listCountries', params: {} },\n    ],\n    isBatchRequest: true,\n    responseSchema: [responseSchemaObjectOne, responseSchemaObjectTwo],\n  });\n```\n\n#### Please, be careful. The response will be the object:\n```javascript\n{\n  error: boolean,\n  data: Array<IResponse>,\n  additionalErrors: null,\n  errorText: string,\n  code: number\n}\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n\n#### Cancelling the request\n\n```javascript\nimport { RestRequest, IResponse, ABORT_REQUEST_EVENT_NAME } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    body: someData,\n    abortRequestId: '1',\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\")),\n    }).unknown(),\n  });\n);\n\ndocument.dispatchEvent(\n  new CustomEvent(ABORT_REQUEST_EVENT_NAME, {\n    detail: { id: '1' },\n  }),\n);\n```","readmeFilename":"README.md","gitHead":"bb4c6efe203c71cb322138b23b84b66cf78954e0","_id":"@mihanizm56/fetch-api@3.3.16-beta.7","_nodeVersion":"12.13.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-OIQU0rDjhEz7Bz/NXHanKfTd+aytRq3VEWLSv9uJTstp4j6s7IaK3yLqCaF+agTIhYFKsTDTxJQZcml9CLBgGg==","shasum":"97e957880b0d8d6ae777c44a10c420dbe7610707","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.3.16-beta.7.tgz","fileCount":58,"unpackedSize":96168,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfV6IICRA9TVsSAnZWagAAHYAP/1oNlMi9iVm588RsmYP/\nmjv1SVsxKnIprbbQ08Ewq1FegiRf0cdroRvLt01aDGSj1Y97GZDfI6V92RBa\nPU7NYv9tT2KPsbQUvZwjP/g8zvC4HW2GjR4duMB+zO5LucnJQj8DVt9SJjYC\nwGsQAkfpYshBPDm7EbCkCoWS3JjMu1HSzvlnEhXv9UFl2yq4VJiP9PaMu2F3\niuY2cEa7NZSoXO6d/evsRihTFXFb+ZxLxwEwaNFSexQRDuBVBoObXRkoAzC4\n6O2YyVoINLH5jc2LHk8Dya/vM2xpEouB1ZxrCYUEoelxqAlqmDdLdQDJ8ZCs\nFcbSXVJR60dm+GgtzGz7GQfR7R/JCkwHLTKRp7VOql0YjnYq2PeriIuYTDK8\nzX8VggpynGn0cYDFyIK7tYthMWeARrR3w4lmzdc4mWMye0n5pztHvgtKIK/F\nTcNSo3aPBSWVVIrOpYst32Pf5wf0Ji+RHxEK9Kb0TA5yWqu7P4aBgzAEjFs1\nBsfUAzhwkOXsP6x6oQMBeMZYpBcRfa+OY1R0e0TlO+EUdeyOYBRxKnMHr2V0\nAcayEETD8cP6i6IP5azyZiQJg6WZk5q12WPdQs9FNz8Jl806ZNYykDhGBIkp\n7FdYsdZN75xEYTm3KKMiuxWHiOZ11KospU6LR0usyo3m4Ml+WAjtTnOx0AyB\nAEpu\r\n=67Ex\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIE4nFGiiQ7qNsyhxDRIQsPYpY2aZRQjV2l3S/M7xRQdqAiEAmdqxOMrqQQowxHDuhqNDTsVnBLDfddI40x9zPaIzu9Q="}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.3.16-beta.7_1599578631687_0.3854572021735545"},"_hasShrinkwrap":false},"3.3.16":{"name":"@mihanizm56/fetch-api","version":"3.3.16","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","colors":"1.4.0","node-fetch":"2.6.0","query-string":"6.13.1"},"devDependencies":{"@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.0.4","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript":"3.8.3","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"gitHead":"d9eaf1c46577cb5ba9db4b29745d76b41207b694","_id":"@mihanizm56/fetch-api@3.3.16","_nodeVersion":"12.13.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-yv2T5MhTXnJcEq0CVyFbMf4dAj9luQEFUbc63FBzUS2Rwg30LtDJdgdD0dZy8eSFoywlQv1pf4u1q/phULacCw==","shasum":"8866d3e2fa70af56a2caf85542a76ed0bbb2aa1c","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.3.16.tgz","fileCount":58,"unpackedSize":96161,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfW8lzCRA9TVsSAnZWagAAPJ8QAIz9qjU3rrIUqXVISaM2\nDOVbIegwX14da9iGuwKrw0H34TjZLj0BIKmm2UIfLZMderXqOyncXWkJgRjk\nffhjc3ZVbVhsT4DRYI+jhxs1+3Lv61EpQsCjd7xXBbf2vjvSdDUWowXdKhEC\nSqIL6cTlPoMFbvldJn3FK0rV+DJu2brH0XsXJOj79B3EFDjOUoaDrhrZV2bW\n+1ofdK0wmFZboXimJMDziVhi56urOnJdVkiFVthaZYWaPvigXzZYPZ5be+pr\nfvCnItKFn9VFN9FwldaeeNBlIj0C5IywRzR8ohOnLrP2Thg9OBUIL/f+Bo5p\nthad3JlIrAWi1NOrdAa/VYdYC2LLtqhp85KvrMd3IZPW4fWVVTq4Gk9Nn1zA\nGoSH8wWGwMOns+SLNS9WRK4V8fD3cai+eNw/7FS+0Z1ATp0ZlCMsXGRwXOxA\nULp6JvEFHaRI7/3TtfzMjNu2EUUDHr2xBQRxE4hzJhAp3klWrcwpi6NymWOF\nIdp6tTU0HJPaFzjLamvOc2j3Dt1n+rax51jGIibSydnlU1oW5dtCSYh/mfAF\nLHJOz5YVOwSr5Qyzs+bSzdpqexMOM5rWl9FxU6Sy5jiTHPofre0U8zXfxXfC\nzazCJhKGuOkZpEaP1goEhLerqECJ4cx5inyM09EpI5TTSpuV0vmpqAi76GFn\nTOTD\r\n=LTel\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDp9AAyHHMtYaIWOxAg7GaQpiO74DWRl+4G18UYCzA05QIgGEJsM9D49eqXy3LlFdgUMOpbLTBMbaapJ8auZERcu1g="}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.3.16_1599850866769_0.2550340754977849"},"_hasShrinkwrap":false},"3.3.17":{"name":"@mihanizm56/fetch-api","version":"3.3.17","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","colors":"1.4.0","node-fetch":"2.6.1","query-string":"6.13.1"},"devDependencies":{"@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.0.4","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript":"3.8.3","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"gitHead":"181836f9081d38ad2e82f097da57bcc37da76df1","_id":"@mihanizm56/fetch-api@3.3.17","_nodeVersion":"12.13.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-a28ahy3k0u7NQB/DHm66EimbXlaxnlqwvkGftWJaAy5Abtjsid2MyAgWY1UvirWXcAUjKCiFRwnRfl1ECSyKsA==","shasum":"1d3fb53dc83a891b2c3f4f8900bcf283862b3fb5","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.3.17.tgz","fileCount":62,"unpackedSize":104659,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfZ/dCCRA9TVsSAnZWagAAY1AP/jBIW6J38Qa+ONUniP0N\nTWC/EUX2hJtpSX95R1jAa6OK6lG9Z9A8eLNv38mEN/hHdnp8VCoeUoKgWT9Y\nMAclh8RU/dJcg9WR6EsD9TCfzl0942yoLILZBXWxq9gUGngLdjshEpafByXB\nx7zgyEmz5YluuDsNkIQb9FjhxlWmsdk4T4k8JBhubG1YbzWb3RhvZTJQwVcE\nJh8CiH0ruDXzQ9WiI3ieT+DQ0+vKNFigK/us8wfaM+lr5e+syQ6jaWKUO7ED\nG8Z4ZHXGs6P794XPMIY3oGuBX5+trzRp30WdqB9fot1Asz774VrIDh5x+ivN\nzre6Jdz53UxtdpZkk4GhBjDXgBIywizKrILjQAg1EII9pvMUMntrCR5d/rH6\npU5GcknxS+TzGHAx4S6sMHZXc3YDIeABAALv5MK9AtL2wlATGgrEFAQcfear\nxuF2QMD08BgVRLtfn4gvb9+sAg/pHvaHcdUQX/tyF13yY4+fWUTcrwpMRBh6\nfYFIYAUXuCfxc7t+lbS77r4b9csY8C54tK6vn6RtsQ0pZQ4gmiJrx6+Tmrgy\n2tH3oSNsXGCf6SGCUng/BuqxEPZCXeasSxxnnUY0IumUOSSB4fyQojVVhyog\npUkYwnbCBIL66IV2t0gGJlBb4/7r0PK2yx+TuZagIGRiAJ5dCfLP/enjqfWZ\ncz18\r\n=jlWh\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBnWXUoMI7jDsB8x7puDBUNrFYHox8spaUhYzzwBGxsRAiBnz3eLNYiDHg5RWUS9DNtpopY3GptQkBPlQz6hGlQHGg=="}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.3.17_1600649025484_0.691821579515963"},"_hasShrinkwrap":false},"3.3.18-beta.1":{"name":"@mihanizm56/fetch-api","version":"3.3.18-beta.1","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","colors":"1.4.0","node-fetch":"2.6.1","query-string":"6.13.1"},"devDependencies":{"@commitlint/cli":"8.2.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.0.4","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript":"3.8.3","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for the isomorphic fetch\n\n### Benefits:\n\n- Provides validation for responses (based on @hapi/joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services)\nhttps://www.npmjs.com/package/query-string is used\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in\n  hard-structured responce format or not (both interfaces are the same)\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n- Provides the ability to handle the response progress\n\n#### Request input options:\n\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use @hapi/joi\n- customTimeout(number) - milliseconds for cancel the request on timeout\n\n#### Request output options:\n\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n\n- body will be serialized in JSON if body data NOT FormData\n- try to use .unknown() method with objects in Joi Schemas because your backend may be extended\n  and without this method the responce data may be not valid\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n## Examples of usage\n\n### REST API\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### get request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          }).unknown()\n        ),\n      }).unknown(),\n    }).unknown(),\n  });\n```\n\n#### get request with PROGRESS callbacks\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          }).unknown()\n        ),\n      }).unknown(),\n    }).unknown(),\n    progressOptions: {\n      onLoaded: (total) => console.log(total) \n      // onLoaded callback will be called after \n      // the whole response will be done\n      // WARNING - not availiable on nodejs environment\n      onProgress: ({ total, current}) => console.log(total, current)\n      // onProgress callback will be triggered during the response progress\n      // till the response will be done\n      // WARNING - not availiable on nodejs environment\n    },\n  });\n```\n\n#### get request with blob parse\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getPhotoRequest = (): Promise<IResponse> =>\n  new RestRequest().getBlobRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    responseSchema: Joi.any()\n  });\n```\n\n#### get PURE REST request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { PureRestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new PureRestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          }).unknown()\n        ),\n      }).unknown(),\n    }).unknown(),\n  });\n```\n\n#### post(put/patch/delete have the same format) request\n\n```javascript\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    body: someData,\n    mode: \"cors\",\n    queryParams: {\n      id: \"test_id_123\",\n    },\n    headers: {\n      \"Content-Type\": \"application/json\",\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\")),\n    }).unknown(),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createReviseRequest(\n  someData\n);\n```\n\n### JSON-RPC API\n\n```javascript\nimport { JSONRPCRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createItemsRequest = (someData): Promise<IResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint: \"http://localhost:3000\",\n    body: {\n      method: 'some method',\n      params: 123\n    }\n    queryParams: {\n      stringId: \"123\"\n      someArray: ['1', 1, '2', 2],\n      numberId: 100\n    },\n    responseSchema: Joi.object({\n      items: Joi.array().items(\n        Joi.object({\n          id: Joi.string().required(),\n          name: Joi.string().required(),\n          name: Joi.string()\n        }).unknown()\n      )\n    }).unknown(),\n  });\n```\n\n### JSON-RPC API (with batching)\n\n```javascript\nimport { JSONRPCRequest, IResponse } from \"@mihanizm56/fetch-api\";\nimport Joi from '@hapi/joi'\n\nconst responseSchemaObjectOne = Joi.object({\n  foo: Joi.string().required(),\n}).unknown();\n\nconst responseSchemaObjectTwo = Joi.object({\n  foo: Joi.string().required(),\n}).unknown();\n\nexport const createItemsRequest = (someData): Promise<IResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint:\n      'http://localhost:8080/json-rpc/positive?batch=true&twoSchemas=true',\n    body: [\n      { method: 'listCountries', params: {} },\n      { method: 'listCountries', params: {} },\n    ],\n    isBatchRequest: true,\n    responseSchema: [responseSchemaObjectOne, responseSchemaObjectTwo],\n  });\n```\n\n#### Please, be careful. The response will be the object:\n```javascript\n{\n  error: boolean,\n  data: Array<IResponse>,\n  additionalErrors: null,\n  errorText: string,\n  code: number\n}\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n\n#### Cancelling the request\n\n```javascript\nimport { RestRequest, IResponse, ABORT_REQUEST_EVENT_NAME } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    body: someData,\n    abortRequestId: '1',\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\")),\n    }).unknown(),\n  });\n);\n\ndocument.dispatchEvent(\n  new CustomEvent(ABORT_REQUEST_EVENT_NAME, {\n    detail: { id: '1' },\n  }),\n);\n```","readmeFilename":"README.md","gitHead":"4ccb309b6250f028f519a8614b0ef914c7067cb0","_id":"@mihanizm56/fetch-api@3.3.18-beta.1","_nodeVersion":"12.13.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-A7GeXrsTd1M5lvbpQ4yQAExr3zj7A3CHbMgG9EvfGsv30ZCZ6VK6RSpvmRbwPgfChjiwHSjaVipz7/61ORWveA==","shasum":"6f8081620199e571f25c2010d3c78a5ca54e8b25","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.3.18-beta.1.tgz","fileCount":62,"unpackedSize":105761,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfaKQ3CRA9TVsSAnZWagAAVr0P/0gX9VQxzUspH2o0wFMQ\nBio6jlsKALbxCARqgAsRXJYFdCyR8D+5sZAph5Yc+VVvAqMaS2c1EGPdpX4K\nIGaeg0lmq3nuiOl3zdEcR7ZeVO8BDHEV1nP95Gj4TwtmYGu76XkHg3D4K6eb\nTgN8sz5RT4YFdmvd7g1w8ivzNAUp7Vt68xUamUS+D2KNJEmwsx94cBt95Q75\nFMuxxZUImOb5kgcCwvjbkXsmddtz4TsMAhEQhcM2BWFvSuD9SIebevM6vS56\ncOz5NJvogkI7TLIW8zDHLCVn8wref2d1zEGo21b/D2WjBTD4VAOtGzxK7rfc\nr20dTedbpKLgOHEUnH4nr0hFKew8QdTUHBU5B6UPzcE4e15VsL+8rzT8NBME\n3vcxWvD2oHqRXClOnmPFuq9Jx8HeLS7731pQBliAzf4+ILNLM/HTeKjRHz5n\nSjHULPVkWDfyxEOrN7zgzrHkxdejHubWO0jNIb0R5Dx6sye+OmP3LeCNe+cH\nHQbP/3XPLIZb+YMQjqVAX314fRgtKAh6Bimtc4kbNz2MoCv9UknUT+13fKVR\n4VRPce807A8uzHMgivlaKQvbu8NM8aUC52XvVQ0Dp7ABPD+JaFzDYN9mpzZc\nIguq42MaVors5RVs4uAFXchgYPfXk8Fw2eZNvu6UoZoHE+0QmTNM2ZfkRkaK\nXOfw\r\n=dEzi\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFPcq6orR3itjsJmrlxgSq9fu1SW2dXxg1pSXUForfIVAiAjLHrtkmInKffiwXnWvKKRCaG7SQHiEW/DmfKjPw2GOg=="}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.3.18-beta.1_1600693303258_0.2199009834701715"},"_hasShrinkwrap":false},"3.3.18":{"name":"@mihanizm56/fetch-api","version":"3.3.18","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","colors":"1.4.0","node-fetch":"2.6.1","query-string":"6.13.1"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.1","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript":"3.8.3","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"gitHead":"d757afc9bd5e4546a8a8276bac822b99c5f49541","_id":"@mihanizm56/fetch-api@3.3.18","_nodeVersion":"12.13.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-kDwyOjKDtPdMMHqGOhAB/8QFeVYa9RPv3vRXasFjKUGOytceBNxbrBJUJwO0yo+aLfOq8u02RPjL04RdZwku1Q==","shasum":"1d59057a609e56b1dd56409f67db3926a5b6bff7","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.3.18.tgz","fileCount":62,"unpackedSize":105406,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfbHk+CRA9TVsSAnZWagAA/DMP/ie+/tZluKyqP+dgbimU\nq2UluZXOKapI5sdq9gXEonxQ6X9Wg1kSUHQN0Ph6A15tj9f8xnWR5ek6ztcY\nkMfGWs5VF+QZfjAaG7pv8Xzc2Mo+leRU8lBHDKxzOJZ3mmbDufcyJ40cM/TG\njPfyQJpodrTcLvdKJDZ/5XGhilejzz8Wp+0qOH2Hb7QR3fepK5ESelsiIBa6\ni+mBwPr++vMZ5FZgh0nJdZdPXX1Whgs7mDU2HPxV1ga0E+7qAvQ5ZRpJZfJD\nfUQQSBWs4HUWCgtmoK+y0Ptf9Z8X6QaXybTcW7cVFhft4zPaEGOQzfMjpX8Y\n2hk3oZeJiEjrFfirFbzJo+DfVRHCTCiXCEhpeYs2mYpRYGFjJne4c+wVGPhG\nmMo15AJZG08sfVDXZO0zR1+0OzsZgNQdE9BllHPCBmyoUp/SV0erocx142+3\nkcwwBeX+yqTOCrxSMzLUvikNXa3p2EOkp5YfiMzbEVInwst2+J7ST4kuMo+F\nuvQxmq4JlaCgwevwPL46uCWwV58JYYpFcmLG3YpJgrGKERKIWUyg2JGq8w0e\nRFX6v37JMUChCd8AQoFuS5qUhZfo0pPBanJA2WXRIJPRMm/KxQSF+PkMCX4V\nXOTPqUnSXkvMjj7DihZDE77YyKUOjG36efLqWlm9rgTxe3Nf1LRsIWCvwI79\nW3DE\r\n=v2yx\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDhnom5iGafLLQb1sYwsVMFNOop99YsrN+m2+zsrLSRcAIgMR20SavI9GXNEHgnmbsFQHEiYA3+Gxoz5D+EGjfyKr0="}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.3.18_1600944446026_0.6869103580055516"},"_hasShrinkwrap":false},"3.3.19-beta.2":{"name":"@mihanizm56/fetch-api","version":"3.3.19-beta.2","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","colors":"1.4.0","node-fetch":"2.6.1","query-string":"6.13.1"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.1","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript":"3.8.3","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for the isomorphic fetch\n\n### Benefits:\n\n- Provides validation for responses (based on @hapi/joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services)\nhttps://www.npmjs.com/package/query-string is used\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in\n  hard-structured responce format or not (both interfaces are the same)\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n- Provides the ability to handle the response progress\n\n#### Request input options:\n\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use @hapi/joi\n- customTimeout(number) - milliseconds for cancel the request on timeout\n\n#### Request output options:\n\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n\n- body will be serialized in JSON if body data NOT FormData\n- try to use .unknown() method with objects in Joi Schemas because your backend may be extended\n  and without this method the responce data may be not valid\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n## Examples of usage\n\n### REST API\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### get request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          }).unknown()\n        ),\n      }).unknown(),\n    }).unknown(),\n  });\n```\n\n#### get request with PROGRESS callbacks\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          }).unknown()\n        ),\n      }).unknown(),\n    }).unknown(),\n    progressOptions: {\n      onLoaded: (total) => console.log(total) \n      // onLoaded callback will be called after \n      // the whole response will be done\n      // WARNING - not availiable on nodejs environment\n      onProgress: ({ total, current}) => console.log(total, current)\n      // onProgress callback will be triggered during the response progress\n      // till the response will be done\n      // WARNING - not availiable on nodejs environment\n    },\n  });\n```\n\n#### get request with blob parse\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getPhotoRequest = (): Promise<IResponse> =>\n  new RestRequest().getBlobRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    responseSchema: Joi.any()\n  });\n```\n\n#### get PURE REST request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { PureRestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new PureRestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          }).unknown()\n        ),\n      }).unknown(),\n    }).unknown(),\n  });\n```\n\n#### post(put/patch/delete have the same format) request\n\n```javascript\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    body: someData,\n    mode: \"cors\",\n    queryParams: {\n      id: \"test_id_123\",\n    },\n    headers: {\n      \"Content-Type\": \"application/json\",\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\")),\n    }).unknown(),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createReviseRequest(\n  someData\n);\n```\n\n### JSON-RPC API\n\n```javascript\nimport { JSONRPCRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createItemsRequest = (someData): Promise<IResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint: \"http://localhost:3000\",\n    body: {\n      method: 'some method',\n      params: 123\n    }\n    queryParams: {\n      stringId: \"123\"\n      someArray: ['1', 1, '2', 2],\n      numberId: 100\n    },\n    responseSchema: Joi.object({\n      items: Joi.array().items(\n        Joi.object({\n          id: Joi.string().required(),\n          name: Joi.string().required(),\n          name: Joi.string()\n        }).unknown()\n      )\n    }).unknown(),\n  });\n```\n\n### JSON-RPC API (with batching)\n\n```javascript\nimport { JSONRPCRequest, IResponse } from \"@mihanizm56/fetch-api\";\nimport Joi from '@hapi/joi'\n\nconst responseSchemaObjectOne = Joi.object({\n  foo: Joi.string().required(),\n}).unknown();\n\nconst responseSchemaObjectTwo = Joi.object({\n  foo: Joi.string().required(),\n}).unknown();\n\nexport const createItemsRequest = (someData): Promise<IResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint:\n      'http://localhost:8080/json-rpc/positive?batch=true&twoSchemas=true',\n    body: [\n      { method: 'listCountries', params: {} },\n      { method: 'listCountries', params: {} },\n    ],\n    isBatchRequest: true,\n    responseSchema: [responseSchemaObjectOne, responseSchemaObjectTwo],\n  });\n```\n\n#### Please, be careful. The response will be the object:\n```javascript\n{\n  error: boolean,\n  data: Array<IResponse>,\n  additionalErrors: null,\n  errorText: string,\n  code: number\n}\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n\n#### Cancelling the request\n\n```javascript\nimport { RestRequest, IResponse, ABORT_REQUEST_EVENT_NAME } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    body: someData,\n    abortRequestId: '1',\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\")),\n    }).unknown(),\n  });\n);\n\ndocument.dispatchEvent(\n  new CustomEvent(ABORT_REQUEST_EVENT_NAME, {\n    detail: { id: '1' },\n  }),\n);\n```","readmeFilename":"README.md","gitHead":"683b8a3c12f9d8dd1db317320aff5d5e57954318","_id":"@mihanizm56/fetch-api@3.3.19-beta.2","_nodeVersion":"12.13.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-uqfEagutjq2kvE99g/eCHGEbKAIUYizagIQO1vyDYPadz7Fa5ZVPT1KVAYhmNhB9wx8/J0gfN3jDW7rTYQQT/Q==","shasum":"9720744aef029ddb2bf7e94f1d0b05db4a0105b6","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.3.19-beta.2.tgz","fileCount":62,"unpackedSize":105495,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfcPWDCRA9TVsSAnZWagAAxCoP/iZzGxG0fUMrFuYUhPXa\nyaa3RvKG5ygqKG5hNTthhTjIzJB6A2uYPipP07JSYG1ZFoiKsn4gumbZweTB\nE4a+fugSMZKaZPBwLZ0Dql7S/9bBVLNJL4bpySncMr4SMaFfAXRunbWT/vJS\nbnsdc1TOPXJAEgpk/u27GiIC6F+dHArpv7gQdyc0+dgBgoadsfl/p6oYaXN7\nymkiPywYg3cYrCTLRLhVHEyIPWrM8yq2VglLuKGD2hl5J2k+q3umavQys40x\njkakw5xEOBO77MAyd7msv7Nq+q4RRViLB1vJ0kbol3EnYL2QOgenj2d8l13a\nsxrQVmiNyCe4TWUSqw0t4FSDSvRrgv/iFZi1Hw8y1tHwqWc0Xsd8BLAbLvKn\niVw9S0K/FZkKPtUSVbZdZvGXpa7ijjvNi7pTKxXMl97NdC+B2WCvnEbDJeT7\naAhn9xGJ8aBb21JIxHVA+Bi4CVtXcHDUTLpY8lIZ5xhCE6iOdNAGtrliWXTI\nVycMXyN6isMQg/xrncTlhml83RPtjnB03NOUVUrXB9pmI2wGalNBShxd4n1e\n2s4Xdk8uW+alKyi8TeUKWvaChkkOclhLpF3K77IcvylQabYqzMAamVCchvhi\nfXeyetw8ftt4JarUXLs2Vk5ZqyQCcdCQPI01IKaZwa4BEG0bf2plkObcqesK\nmnMl\r\n=G6PO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC1q5DtXHfw5nz2dFoz8K5RG47d79QbfS3mZTMn7saNOAiBIvqpPc/w77szNtD1yn6rZl9KmA8hOw1WU/1ncRc39lQ=="}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.3.19-beta.2_1601238403017_0.0402049657762773"},"_hasShrinkwrap":false},"3.3.19-beta.3":{"name":"@mihanizm56/fetch-api","version":"3.3.19-beta.3","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","colors":"1.4.0","node-fetch":"2.6.1","query-string":"6.13.1"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.1","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript":"3.8.3","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for the isomorphic fetch\n\n### Benefits:\n\n- Provides validation for responses (based on @hapi/joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services)\nhttps://www.npmjs.com/package/query-string is used\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in\n  hard-structured responce format or not (both interfaces are the same)\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n- Provides the ability to handle the response progress\n\n#### Request input options:\n\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use @hapi/joi\n- customTimeout(number) - milliseconds for cancel the request on timeout\n\n#### Request output options:\n\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n\n- body will be serialized in JSON if body data NOT FormData\n- try to use .unknown() method with objects in Joi Schemas because your backend may be extended\n  and without this method the responce data may be not valid\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n## Examples of usage\n\n### REST API\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### get request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          }).unknown()\n        ),\n      }).unknown(),\n    }).unknown(),\n  });\n```\n\n#### get request with PROGRESS callbacks\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          }).unknown()\n        ),\n      }).unknown(),\n    }).unknown(),\n    progressOptions: {\n      onLoaded: (total) => console.log(total) \n      // onLoaded callback will be called after \n      // the whole response will be done\n      // WARNING - not availiable on nodejs environment\n      onProgress: ({ total, current}) => console.log(total, current)\n      // onProgress callback will be triggered during the response progress\n      // till the response will be done\n      // WARNING - not availiable on nodejs environment\n    },\n  });\n```\n\n#### get request with blob parse\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getPhotoRequest = (): Promise<IResponse> =>\n  new RestRequest().getBlobRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    responseSchema: Joi.any()\n  });\n```\n\n#### get PURE REST request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { PureRestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new PureRestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          }).unknown()\n        ),\n      }).unknown(),\n    }).unknown(),\n  });\n```\n\n#### post(put/patch/delete have the same format) request\n\n```javascript\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    body: someData,\n    mode: \"cors\",\n    queryParams: {\n      id: \"test_id_123\",\n    },\n    headers: {\n      \"Content-Type\": \"application/json\",\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\")),\n    }).unknown(),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createReviseRequest(\n  someData\n);\n```\n\n### JSON-RPC API\n\n```javascript\nimport { JSONRPCRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createItemsRequest = (someData): Promise<IResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint: \"http://localhost:3000\",\n    body: {\n      method: 'some method',\n      params: 123\n    }\n    queryParams: {\n      stringId: \"123\"\n      someArray: ['1', 1, '2', 2],\n      numberId: 100\n    },\n    responseSchema: Joi.object({\n      items: Joi.array().items(\n        Joi.object({\n          id: Joi.string().required(),\n          name: Joi.string().required(),\n          name: Joi.string()\n        }).unknown()\n      )\n    }).unknown(),\n  });\n```\n\n### JSON-RPC API (with batching)\n\n```javascript\nimport { JSONRPCRequest, IResponse } from \"@mihanizm56/fetch-api\";\nimport Joi from '@hapi/joi'\n\nconst responseSchemaObjectOne = Joi.object({\n  foo: Joi.string().required(),\n}).unknown();\n\nconst responseSchemaObjectTwo = Joi.object({\n  foo: Joi.string().required(),\n}).unknown();\n\nexport const createItemsRequest = (someData): Promise<IResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint:\n      'http://localhost:8080/json-rpc/positive?batch=true&twoSchemas=true',\n    body: [\n      { method: 'listCountries', params: {} },\n      { method: 'listCountries', params: {} },\n    ],\n    isBatchRequest: true,\n    responseSchema: [responseSchemaObjectOne, responseSchemaObjectTwo],\n  });\n```\n\n#### Please, be careful. The response will be the object:\n```javascript\n{\n  error: boolean,\n  data: Array<IResponse>,\n  additionalErrors: null,\n  errorText: string,\n  code: number\n}\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n\n#### Cancelling the request\n\n```javascript\nimport { RestRequest, IResponse, ABORT_REQUEST_EVENT_NAME } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    body: someData,\n    abortRequestId: '1',\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\")),\n    }).unknown(),\n  });\n);\n\ndocument.dispatchEvent(\n  new CustomEvent(ABORT_REQUEST_EVENT_NAME, {\n    detail: { id: '1' },\n  }),\n);\n```","readmeFilename":"README.md","gitHead":"24b0610693bf27ab17b114820713913b0c32e522","_id":"@mihanizm56/fetch-api@3.3.19-beta.3","_nodeVersion":"12.13.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-tR6JuYYpawJxily8XuxjoGiJC5Af3ryIlIUEijEUqz0jyuIN9uyg0WFZjLdO0dX+LTpRrDpMRTJ/+9rPM5IYug==","shasum":"b7f6d6e300d904be7e67b3d1ce9105fba5cb155f","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.3.19-beta.3.tgz","fileCount":62,"unpackedSize":105470,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfcP1BCRA9TVsSAnZWagAAjkkP/2wLKRoNJvXJ/sx7h3DZ\nywBLMC0dMZWmx8Zsajy7iIcmsfWtBuOEnil7s8yZ+Ocs8XRfakNVtXiDIemC\n2xR1FJteTK3qXwhhKXX93cURCi4lgwFtgZJJSAtv5Qc/ZNPtP8zi08eo1Rrd\nXPuTTywFxo9VP7HZrA0N4KfQHtDHCeQmFY5ATewRrcUbmKSt+WDS7RiHGp5x\nTkp9gnpPhxH4SLxxolVemLjlz5qpzrT960Pd1aS/TvWX1N19iThAoyJG1N1A\n1gDKSc6zPTra0vSmqEDYmdjavxeX00LvsmMZZLvxOdtXBlVglf4f1q4+6S8c\n5LvCyUPR52D2MA0p+rB8CWBDEuSBSsTmuEQ9/iTPxjnJt2+Gu8WJB+rywDx6\n1YAcOlb4A2EBYUu9bImvFFDg4JUfHnYpqnqBJRXCk+78TaZcYCIXmk+wUexd\n8kJA8RKJ+mBV3Ht+553VUziLyfg+BvBSV2ltqLP+KJkbaU+r7am+iAxcFU8r\n/Fv2emL5LOMrdObcB8eRZDzfGPmXBxoObeOyNATXlwYf7SN34uqIeqgSLxZj\nBwK+XRDMX6/Mvc+8gO27GNfqxhn+64g7H5BP2gYIgyfUeJ7jIe2lTU1ntOX3\nM+bVPS8fnBM0+6hAg1VXX0jRtB97/5qIOidGLJHOi6Am+KQ35ffpNMPnVU/O\nz3gq\r\n=1xl2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDPyYysg/LlbKuJQMSFdkqIJtPbYnYdoTR2hAbGoVQM1QIhANz2xGce5dRzE8YoJGXDv401ZVzkrcHbtW6TMcgcjDvu"}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.3.19-beta.3_1601240384808_0.4639628280245305"},"_hasShrinkwrap":false},"3.3.19-beta.4":{"name":"@mihanizm56/fetch-api","version":"3.3.19-beta.4","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","colors":"1.4.0","node-fetch":"2.6.1","query-string":"6.13.1"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.1","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript":"3.8.3","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for the isomorphic fetch\n\n### Benefits:\n\n- Provides validation for responses (based on @hapi/joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services)\nhttps://www.npmjs.com/package/query-string is used\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in\n  hard-structured responce format or not (both interfaces are the same)\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n- Provides the ability to handle the response progress\n\n#### Request input options:\n\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use @hapi/joi\n- customTimeout(number) - milliseconds for cancel the request on timeout\n\n#### Request output options:\n\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n\n- body will be serialized in JSON if body data NOT FormData\n- try to use .unknown() method with objects in Joi Schemas because your backend may be extended\n  and without this method the responce data may be not valid\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n## Examples of usage\n\n### REST API\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### get request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          }).unknown()\n        ),\n      }).unknown(),\n    }).unknown(),\n  });\n```\n\n#### get request with PROGRESS callbacks\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          }).unknown()\n        ),\n      }).unknown(),\n    }).unknown(),\n    progressOptions: {\n      onLoaded: (total) => console.log(total) \n      // onLoaded callback will be called after \n      // the whole response will be done\n      // WARNING - not availiable on nodejs environment\n      onProgress: ({ total, current}) => console.log(total, current)\n      // onProgress callback will be triggered during the response progress\n      // till the response will be done\n      // WARNING - not availiable on nodejs environment\n    },\n  });\n```\n\n#### get request with blob parse\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getPhotoRequest = (): Promise<IResponse> =>\n  new RestRequest().getBlobRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    responseSchema: Joi.any()\n  });\n```\n\n#### get PURE REST request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { PureRestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new PureRestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          }).unknown()\n        ),\n      }).unknown(),\n    }).unknown(),\n  });\n```\n\n#### post(put/patch/delete have the same format) request\n\n```javascript\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    body: someData,\n    mode: \"cors\",\n    queryParams: {\n      id: \"test_id_123\",\n    },\n    headers: {\n      \"Content-Type\": \"application/json\",\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\")),\n    }).unknown(),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createReviseRequest(\n  someData\n);\n```\n\n### JSON-RPC API\n\n```javascript\nimport { JSONRPCRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createItemsRequest = (someData): Promise<IResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint: \"http://localhost:3000\",\n    body: {\n      method: 'some method',\n      params: 123\n    }\n    queryParams: {\n      stringId: \"123\"\n      someArray: ['1', 1, '2', 2],\n      numberId: 100\n    },\n    responseSchema: Joi.object({\n      items: Joi.array().items(\n        Joi.object({\n          id: Joi.string().required(),\n          name: Joi.string().required(),\n          name: Joi.string()\n        }).unknown()\n      )\n    }).unknown(),\n  });\n```\n\n### JSON-RPC API (with batching)\n\n```javascript\nimport { JSONRPCRequest, IResponse } from \"@mihanizm56/fetch-api\";\nimport Joi from '@hapi/joi'\n\nconst responseSchemaObjectOne = Joi.object({\n  foo: Joi.string().required(),\n}).unknown();\n\nconst responseSchemaObjectTwo = Joi.object({\n  foo: Joi.string().required(),\n}).unknown();\n\nexport const createItemsRequest = (someData): Promise<IResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint:\n      'http://localhost:8080/json-rpc/positive?batch=true&twoSchemas=true',\n    body: [\n      { method: 'listCountries', params: {} },\n      { method: 'listCountries', params: {} },\n    ],\n    isBatchRequest: true,\n    responseSchema: [responseSchemaObjectOne, responseSchemaObjectTwo],\n  });\n```\n\n#### Please, be careful. The response will be the object:\n```javascript\n{\n  error: boolean,\n  data: Array<IResponse>,\n  additionalErrors: null,\n  errorText: string,\n  code: number\n}\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n\n#### Cancelling the request\n\n```javascript\nimport { RestRequest, IResponse, ABORT_REQUEST_EVENT_NAME } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    body: someData,\n    abortRequestId: '1',\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\")),\n    }).unknown(),\n  });\n);\n\ndocument.dispatchEvent(\n  new CustomEvent(ABORT_REQUEST_EVENT_NAME, {\n    detail: { id: '1' },\n  }),\n);\n```","readmeFilename":"README.md","gitHead":"163fbf644dd0d68c8ab5e700e5e9cddcebac8bdb","_id":"@mihanizm56/fetch-api@3.3.19-beta.4","_nodeVersion":"12.13.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-rC3DmNpqPl0CFIuVguX5RHkIO///aiLx2hGhUqJWqTFnVhatjIzbcL48/B+X9HWS3ZQ/J1PO9AFSClTDEGrR1g==","shasum":"db80d72016155215340ab8b8bd13e20b4d24366d","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.3.19-beta.4.tgz","fileCount":62,"unpackedSize":105298,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfcQqaCRA9TVsSAnZWagAATr8P/1NP4uFYvgtX+GhVSWE/\nlXbNeE284UGELXHQQyZQP+snT39s8pitkjrjPIklv9Kat2TzzAs1AILsrJa4\nccwKMtdJk365AGTkfgiT7SjHI6nUNfcmXasEPvvM8BpFl085mOqPBb5CZUfc\nwXU9R24aABbjAxiBAbcyM/fOQi4O4vO5QXA0dNZQNDzJG4v05wBFB4KeYpUI\nHIMewOOUVt1dRNbI8WGw1nksyaz2hBH4BXbM2vucH5ZabMq5v0uyoEl3jfTf\nToFV20x8lDBDX2XNeH5L8QqLNbzRtdHt/7Y8/u17ni60s7WWIX3+iNwwjcwm\nKtKbNXA2IUJnGh8v9YXcCxprZATP4bzXc7Jdcwi4/TePNbyrJSZiQNdmG+4d\nmenOKnNKrzOuID6ZLleTnzns8PPbuTvnvO85SRbp5dfSWcBKzF7GztuKk4P1\nNPcssHRReBa0IwFpunhj6uPchliD8yVhbe/3V2UH7ZQpM/+FqF3V/jlwOz52\nc/KIkr4Q14GVVHHMOboaKCib0X4EYM4N+c1H6pZ0TAoPlMNk8S6L/EGbHgPX\nlEn1ZemxLBnh0Fn7TYNdllGdgZUxTOTYBFX8vBvztiRDC3e3sxI5Z0Cngubn\nEVA+z0jGPUBZlGBMmS+BVcaXyPJpgqAIPLhbfMB5hGY15tFbGRAFWDpzbJg9\nwk4X\r\n=6AhG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIH8Yvki+FVaM7Nw/n0vZgxFxpzqom1olJ8PX1MwNaRPHAiB4X+Y+5KDcYJEQRPoNirlvOakIkM5SY5lWVuP2o5Xz2A=="}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.3.19-beta.4_1601243802211_0.12693705113069997"},"_hasShrinkwrap":false},"3.3.19":{"name":"@mihanizm56/fetch-api","version":"3.3.19","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","colors":"1.4.0","node-fetch":"2.6.1","query-string":"6.13.1"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.1","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript":"3.8.3","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"gitHead":"e586408534a673b9519512fce7746d2133eb486a","_id":"@mihanizm56/fetch-api@3.3.19","_nodeVersion":"12.13.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-T57ejPQtnVRV4P7kv/OrgrkDkxr/h+8JXhPgxBYNQkPn9y3xqNMjexOYSlLmFeu6AXaUwoHpW4mh0X8qjfnS/A==","shasum":"0a0fc06ff77218d6a641a20628af36d4ca490261","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.3.19.tgz","fileCount":62,"unpackedSize":105291,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfcRN7CRA9TVsSAnZWagAA2iIP/2ZVGASxA+g2vwXwAAXA\nuqRaDPDfoMnvMD4lI8WYn7wIwRZcmU3319wSKcnTPvGKPHYmTj0uwoAVPVqn\naOd5EpPyVmizIHp52lGvXRIzD+YguSkUuCamwOunEbNtpChtupGqYYgmpFdd\nmB4SNk58wqwypQC3ldEwZoY8H+BoYePG30tQgV5UglX4qGV3UAeG2TdoclTb\nR3MIohPnnG9sJJ31DXdjPNIvziNY2geuJv4FXg4mBtHTcWAxFAWW4UojDzuF\nVjfYkdj2w5gzARfunKuZCLDcLDx+0f0XmcLZTpNi4/ircRclr0y2CnKjMFLs\nGa18Higs+3kfJNLA9lxxI2vDoalODNsi3U4G636O9IEgXd8Z4BkUHlLGm9JM\nESmUC0A7EnHJwteQK6YVRPrJYfFqFt74359MhFenSrtbrEyjccYYwyNRARlV\nFDjcbxhYajn+jVMTPtcI9HW6fOSySDsp6YdBOe4sWztBTyndExomp1D0NhiU\nsh67me88m7iPcCFmYHrfV2rnyweKEbpparR8ivZtpdOygtPLSFwsb3I4v7+3\n8R18a5ycKam69N3cmmRy47pby1wNKRN+OOfRuxbQpa8wyyo0/vZ4hse4br0J\nY+HwK2AXmweP4VZuCi1+TsdviLpZYiBMDBFDtgu1yAA5J+wQhCuazvcGLC8r\nz4gM\r\n=A7ih\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG2BQUiinFkGOLJnU8uw9TPq/LgMGPuUhxTjCHbUAtZ0AiB8N/Dz2j7MlCSUpn2gXWGCXQLr4Q9pWpfuEZJmuavSbg=="}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.3.19_1601246074752_0.33122296565620446"},"_hasShrinkwrap":false},"3.4.0-beta.1":{"name":"@mihanizm56/fetch-api","version":"3.4.0-beta.1","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","colors":"1.4.0","node-fetch":"2.6.1","query-string":"6.13.1"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.1","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript":"3.8.3","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for the isomorphic fetch\n\n### Benefits:\n\n- Provides validation for responses (based on @hapi/joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services)\nhttps://www.npmjs.com/package/query-string is used\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in\n  hard-structured responce format or not (both interfaces are the same)\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n- Provides the ability to handle the response progress\n\n#### Request input options:\n\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use @hapi/joi\n- customTimeout(number) - milliseconds for cancel the request on timeout\n\n#### Request output options:\n\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n\n- body will be serialized in JSON if body data NOT FormData\n- try to use .unknown() method with objects in Joi Schemas because your backend may be extended\n  and without this method the responce data may be not valid\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n## Examples of usage\n\n### REST API\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### get request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          }).unknown()\n        ),\n      }).unknown(),\n    }).unknown(),\n  });\n```\n\n#### get request with PROGRESS callbacks\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          }).unknown()\n        ),\n      }).unknown(),\n    }).unknown(),\n    progressOptions: {\n      onLoaded: (total) => console.log(total) \n      // onLoaded callback will be called after \n      // the whole response will be done\n      // WARNING - not availiable on nodejs environment\n      onProgress: ({ total, current}) => console.log(total, current)\n      // onProgress callback will be triggered during the response progress\n      // till the response will be done\n      // WARNING - not availiable on nodejs environment\n    },\n  });\n```\n\n#### get request with blob parse\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getPhotoRequest = (): Promise<IResponse> =>\n  new RestRequest().getBlobRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    responseSchema: Joi.any()\n  });\n```\n\n#### get PURE REST request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { PureRestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new PureRestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          }).unknown()\n        ),\n      }).unknown(),\n    }).unknown(),\n  });\n```\n\n#### post(put/patch/delete have the same format) request\n\n```javascript\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    body: someData,\n    mode: \"cors\",\n    queryParams: {\n      id: \"test_id_123\",\n    },\n    headers: {\n      \"Content-Type\": \"application/json\",\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\")),\n    }).unknown(),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createReviseRequest(\n  someData\n);\n```\n\n### JSON-RPC API\n\n```javascript\nimport { JSONRPCRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createItemsRequest = (someData): Promise<IResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint: \"http://localhost:3000\",\n    body: {\n      method: 'some method',\n      params: 123\n    }\n    queryParams: {\n      stringId: \"123\"\n      someArray: ['1', 1, '2', 2],\n      numberId: 100\n    },\n    responseSchema: Joi.object({\n      items: Joi.array().items(\n        Joi.object({\n          id: Joi.string().required(),\n          name: Joi.string().required(),\n          name: Joi.string()\n        }).unknown()\n      )\n    }).unknown(),\n  });\n```\n\n### JSON-RPC API (with batching)\n\n```javascript\nimport { JSONRPCRequest, IResponse } from \"@mihanizm56/fetch-api\";\nimport Joi from '@hapi/joi'\n\nconst responseSchemaObjectOne = Joi.object({\n  foo: Joi.string().required(),\n}).unknown();\n\nconst responseSchemaObjectTwo = Joi.object({\n  foo: Joi.string().required(),\n}).unknown();\n\nexport const createItemsRequest = (someData): Promise<IResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint:\n      'http://localhost:8080/json-rpc/positive?batch=true&twoSchemas=true',\n    body: [\n      { method: 'listCountries', params: {} },\n      { method: 'listCountries', params: {} },\n    ],\n    isBatchRequest: true,\n    responseSchema: [responseSchemaObjectOne, responseSchemaObjectTwo],\n  });\n```\n\n#### Please, be careful. The response will be the object:\n```javascript\n{\n  error: boolean,\n  data: Array<IResponse>,\n  additionalErrors: null,\n  errorText: string,\n  code: number\n}\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n\n#### Cancelling the request\n\n```javascript\nimport { RestRequest, IResponse, ABORT_REQUEST_EVENT_NAME } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    body: someData,\n    abortRequestId: '1',\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\")),\n    }).unknown(),\n  });\n);\n\ndocument.dispatchEvent(\n  new CustomEvent(ABORT_REQUEST_EVENT_NAME, {\n    detail: { id: '1' },\n  }),\n);\n```","readmeFilename":"README.md","gitHead":"cbb399417b45a325b6f1eb18c28f9f69260f6445","_id":"@mihanizm56/fetch-api@3.4.0-beta.1","_nodeVersion":"12.13.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-/HsbgzmB+PL/uVCm1d9iS0YIkRfJFQI9YbJLavBQZczXEgoZKJhBUFiOkErwmLdjGaYwFJJXi/VoLUhe+z6tWw==","shasum":"f3b3bab7b598d153c11bd38099582281c335536d","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.4.0-beta.1.tgz","fileCount":64,"unpackedSize":108404,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfc9v3CRA9TVsSAnZWagAAxfgQAIoSj9b9KqRoXcyG/8OD\n0aPhYbtzM7nHowM8xHHs+JfA0SaY3UVg9J634W3NXrg5KeKpW1o/f2ypTOMf\nDPC14RyABrUwdgZGiuS4UABmeaQFzVzO47bKiaSggZN4bo7lNQs4cNGIEO29\nn65w4BXQ38iigzAJneYvgPezsS5SmA/rXyxf9udkQt238WY4dTzO42lGI+ll\noy9DWtydbBfYN1OzLCvDzyNcWL6s82CvLO24FPUHcFOA7X8tHOkh2IZ7vDuu\nHZJF527J5+YPbCNtY87mrVxehQvF+55l17NEwYOnrmFgsuQG68RiDWUi6Qlj\nomZQIu6sSFGp25IJbLCa/ym9eWL0knxc1UYXx2jQNstRRu830qObxHY02l7H\nPKBQiPU3au/cboxE9ejvwAFw1SNm78qC/Ss9fv0AJhua84WBuSrdp5cBESsh\nxPV4KLnJ1acX2NBDoLqDOLA/+oo3MZLro7r9daN1XIoipGBy147nY2LAIDo+\nRb1rfyeyfMOTKWwUl4DApswgvuRQKSI4EHWdatuLBCtoVcBUMksVF1zQAnCb\nXTZp3qO8IwgFGEoTFkd4Af9BhQiXzMFxsmRQIx5WgN+MsfOmrnkZwRD/5nEc\ngm8eS6U7JR55D8v87LHCPj3YLPO0hZVZ/PiosUraMcr1fGvLw6qBdAvifIXZ\n/EO4\r\n=h7P1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCLvJRC3P++1C27Laj1Je0m9mUVq1iRF9d+or8yIHo5lwIhAI/gyo3eXsZqPovhmKwHunixaErTSdLpqDHj4BiT2895"}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.4.0-beta.1_1601428471174_0.6454944885007676"},"_hasShrinkwrap":false},"3.4.0-beta.2":{"name":"@mihanizm56/fetch-api","version":"3.4.0-beta.2","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","colors":"1.4.0","json-mask":"1.0.2","node-fetch":"2.6.1","query-string":"6.13.1"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.1","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript":"3.8.3","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for the isomorphic fetch\n\n### Benefits:\n\n- Provides validation for responses (based on @hapi/joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services)\nhttps://www.npmjs.com/package/query-string is used\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in\n  hard-structured responce format or not (both interfaces are the same)\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n- Provides the ability to handle the response progress\n\n#### Request input options:\n\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use @hapi/joi\n- customTimeout(number) - milliseconds for cancel the request on timeout\n\n#### Request output options:\n\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n\n- body will be serialized in JSON if body data NOT FormData\n- try to use .unknown() method with objects in Joi Schemas because your backend may be extended\n  and without this method the responce data may be not valid\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n## Examples of usage\n\n### REST API\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### get request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          }).unknown()\n        ),\n      }).unknown(),\n    }).unknown(),\n  });\n```\n\n#### get request with PROGRESS callbacks\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          }).unknown()\n        ),\n      }).unknown(),\n    }).unknown(),\n    progressOptions: {\n      onLoaded: (total) => console.log(total) \n      // onLoaded callback will be called after \n      // the whole response will be done\n      // WARNING - not availiable on nodejs environment\n      onProgress: ({ total, current}) => console.log(total, current)\n      // onProgress callback will be triggered during the response progress\n      // till the response will be done\n      // WARNING - not availiable on nodejs environment\n    },\n  });\n```\n\n#### get request with blob parse\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getPhotoRequest = (): Promise<IResponse> =>\n  new RestRequest().getBlobRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    responseSchema: Joi.any()\n  });\n```\n\n#### get PURE REST request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { PureRestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new PureRestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          }).unknown()\n        ),\n      }).unknown(),\n    }).unknown(),\n  });\n```\n\n#### post(put/patch/delete have the same format) request\n\n```javascript\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    body: someData,\n    mode: \"cors\",\n    queryParams: {\n      id: \"test_id_123\",\n    },\n    headers: {\n      \"Content-Type\": \"application/json\",\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\")),\n    }).unknown(),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createReviseRequest(\n  someData\n);\n```\n\n### JSON-RPC API\n\n```javascript\nimport { JSONRPCRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createItemsRequest = (someData): Promise<IResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint: \"http://localhost:3000\",\n    body: {\n      method: 'some method',\n      params: 123\n    }\n    queryParams: {\n      stringId: \"123\"\n      someArray: ['1', 1, '2', 2],\n      numberId: 100\n    },\n    responseSchema: Joi.object({\n      items: Joi.array().items(\n        Joi.object({\n          id: Joi.string().required(),\n          name: Joi.string().required(),\n          name: Joi.string()\n        }).unknown()\n      )\n    }).unknown(),\n  });\n```\n\n### JSON-RPC API (with batching)\n\n```javascript\nimport { JSONRPCRequest, IResponse } from \"@mihanizm56/fetch-api\";\nimport Joi from '@hapi/joi'\n\nconst responseSchemaObjectOne = Joi.object({\n  foo: Joi.string().required(),\n}).unknown();\n\nconst responseSchemaObjectTwo = Joi.object({\n  foo: Joi.string().required(),\n}).unknown();\n\nexport const createItemsRequest = (someData): Promise<IResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint:\n      'http://localhost:8080/json-rpc/positive?batch=true&twoSchemas=true',\n    body: [\n      { method: 'listCountries', params: {} },\n      { method: 'listCountries', params: {} },\n    ],\n    isBatchRequest: true,\n    responseSchema: [responseSchemaObjectOne, responseSchemaObjectTwo],\n  });\n```\n\n#### Please, be careful. The response will be the object:\n```javascript\n{\n  error: boolean,\n  data: Array<IResponse>,\n  additionalErrors: null,\n  errorText: string,\n  code: number\n}\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n\n#### Cancelling the request\n\n```javascript\nimport { RestRequest, IResponse, ABORT_REQUEST_EVENT_NAME } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    body: someData,\n    abortRequestId: '1',\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\")),\n    }).unknown(),\n  });\n);\n\ndocument.dispatchEvent(\n  new CustomEvent(ABORT_REQUEST_EVENT_NAME, {\n    detail: { id: '1' },\n  }),\n);\n```","readmeFilename":"README.md","gitHead":"ed108c2a6d13ea6273cd9694620cabd1e7cae97b","_id":"@mihanizm56/fetch-api@3.4.0-beta.2","_nodeVersion":"12.13.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-WrvR7VulHNs2xAlNlIXzx9EHEJ5tPS5iwANJUqvw9piHAjE87HwMBmcnahsV9/UbVvQQdd6JoMXvyVJKplTI5Q==","shasum":"b6423afe7f14bc6625fcf9394b52968c02640a8a","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.4.0-beta.2.tgz","fileCount":64,"unpackedSize":107996,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfdScOCRA9TVsSAnZWagAAqYAP/3UAyVqEi/MUK0U/a86J\nGVnEAcrwwJvXfJBUg6Al+4CXgW9zh2INWthRUywNeKGow5dqUMaJPt8qfeDF\nfs4QeW62SK3MnVlbRNMsOk3IwUvgIdXjXt3AX2M7hQ1S2UxDJWPvs0kh9jc3\nlsosKTZA6tHBA9jpOWv/XW5YncLmvClPTxLI/le0JA+tLrwtWDFQbBoTiZk3\nCOBXl9MBCzvC+QegIM27LkCibN3/CIsthzQ+jAVDNyuHVaguCdtDf3YvnKVI\n9rC390Fkq1uuDjKXEN/Th2vCxEHBreDbqE8wR3oEmFKxi3Y47WQC1XeDmoY6\niP2dWrHwnPEfYAwZ+gPIdFsIdiX+DzRm5NikNE5D/Q2jbgTw2siWZn9kTygi\nDsGTxkyVaLCHAeX+0wIvuhtIO1JLSCi0YA7W7ZjQNatWmpxCwnyHeVJA0WxA\nPREyKuBMReFj5x0XgoZ1WKO5kkRDEFlZZkHQJAALODCi9ZvWf8GaQKYB8T15\nbtJxP594ST9S/J58CMdGbrisIrrOAyjz2HricKfohpQpZqwYrzMtHH5NvAHY\n9z94nvBi4lccdKongZylcnJAEOFozXEDVrvOReFZL1QvBCTwDgyWsX9rc2XY\nsZMuYbBqRdaZQYSO8KkUrXOtkmDlzAIkV8bqgN4r6sgPV/anzPTnQCMWBdht\nW+H+\r\n=ZkMJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBRVHR4MMBlblgNEwMITk4HDsQ9XwfBxUlAm7+GsPrj3AiAHRItelXH7Jin4pfZ+swt2XjKly/T3WBuCKih8Riwgng=="}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.4.0-beta.2_1601513229503_0.48358783832260266"},"_hasShrinkwrap":false},"3.4.0-beta.3":{"name":"@mihanizm56/fetch-api","version":"3.4.0-beta.3","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","colors":"1.4.0","json-mask":"1.0.2","node-fetch":"2.6.1","query-string":"6.13.1"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.1","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript":"3.8.3","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for the isomorphic fetch\n\n### Benefits:\n\n- Provides validation for responses (based on @hapi/joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services)\nhttps://www.npmjs.com/package/query-string is used\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in\n  hard-structured responce format or not (both interfaces are the same)\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n- Provides the ability to handle the response progress\n\n#### Request input options:\n\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use @hapi/joi\n- customTimeout(number) - milliseconds for cancel the request on timeout\n\n#### Request output options:\n\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n\n- body will be serialized in JSON if body data NOT FormData\n- try to use .unknown() method with objects in Joi Schemas because your backend may be extended\n  and without this method the responce data may be not valid\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n## Examples of usage\n\n### REST API\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### get request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          }).unknown()\n        ),\n      }).unknown(),\n    }).unknown(),\n  });\n```\n\n#### get request with PROGRESS callbacks\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          }).unknown()\n        ),\n      }).unknown(),\n    }).unknown(),\n    progressOptions: {\n      onLoaded: (total) => console.log(total) \n      // onLoaded callback will be called after \n      // the whole response will be done\n      // WARNING - not availiable on nodejs environment\n      onProgress: ({ total, current}) => console.log(total, current)\n      // onProgress callback will be triggered during the response progress\n      // till the response will be done\n      // WARNING - not availiable on nodejs environment\n    },\n  });\n```\n\n#### get request with blob parse\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getPhotoRequest = (): Promise<IResponse> =>\n  new RestRequest().getBlobRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    responseSchema: Joi.any()\n  });\n```\n\n#### get PURE REST request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { PureRestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new PureRestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          }).unknown()\n        ),\n      }).unknown(),\n    }).unknown(),\n  });\n```\n\n#### post(put/patch/delete have the same format) request\n\n```javascript\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    body: someData,\n    mode: \"cors\",\n    queryParams: {\n      id: \"test_id_123\",\n    },\n    headers: {\n      \"Content-Type\": \"application/json\",\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\")),\n    }).unknown(),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createReviseRequest(\n  someData\n);\n```\n\n### JSON-RPC API\n\n```javascript\nimport { JSONRPCRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createItemsRequest = (someData): Promise<IResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint: \"http://localhost:3000\",\n    body: {\n      method: 'some method',\n      params: 123\n    }\n    queryParams: {\n      stringId: \"123\"\n      someArray: ['1', 1, '2', 2],\n      numberId: 100\n    },\n    responseSchema: Joi.object({\n      items: Joi.array().items(\n        Joi.object({\n          id: Joi.string().required(),\n          name: Joi.string().required(),\n          name: Joi.string()\n        }).unknown()\n      )\n    }).unknown(),\n  });\n```\n\n### JSON-RPC API (with batching)\n\n```javascript\nimport { JSONRPCRequest, IResponse } from \"@mihanizm56/fetch-api\";\nimport Joi from '@hapi/joi'\n\nconst responseSchemaObjectOne = Joi.object({\n  foo: Joi.string().required(),\n}).unknown();\n\nconst responseSchemaObjectTwo = Joi.object({\n  foo: Joi.string().required(),\n}).unknown();\n\nexport const createItemsRequest = (someData): Promise<IResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint:\n      'http://localhost:8080/json-rpc/positive?batch=true&twoSchemas=true',\n    body: [\n      { method: 'listCountries', params: {} },\n      { method: 'listCountries', params: {} },\n    ],\n    isBatchRequest: true,\n    responseSchema: [responseSchemaObjectOne, responseSchemaObjectTwo],\n  });\n```\n\n#### Please, be careful. The response will be the object:\n```javascript\n{\n  error: boolean,\n  data: Array<IResponse>,\n  additionalErrors: null,\n  errorText: string,\n  code: number\n}\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n\n#### Cancelling the request\n\n```javascript\nimport { RestRequest, IResponse, ABORT_REQUEST_EVENT_NAME } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    body: someData,\n    abortRequestId: '1',\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\")),\n    }).unknown(),\n  });\n);\n\ndocument.dispatchEvent(\n  new CustomEvent(ABORT_REQUEST_EVENT_NAME, {\n    detail: { id: '1' },\n  }),\n);\n```","readmeFilename":"README.md","gitHead":"87a31b3b1a33550a3b4b5c8acc6b3b51ecfdf656","_id":"@mihanizm56/fetch-api@3.4.0-beta.3","_nodeVersion":"12.13.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-cvkT+ViIzgNwH6MqmIEWYuI2U6sJJi0bG22vDWIUdBsHwpCRQuEO3IomSEJS0rNPc1wqtCoQvCxT97oglrFlsg==","shasum":"9f1aeabe5e0cdfdbea44ff89ec23608a49a2de84","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.4.0-beta.3.tgz","fileCount":64,"unpackedSize":108577,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfdSo6CRA9TVsSAnZWagAApjgP/izOe/Ck61PANstV3k8Y\nwkwhbW49zRlYzUCx1lszVoWzUljn5dzxKQLXaeIMAWUb4widN4VPB1eAJF1r\nZDtPRXY5ICMrdI5X3Lm1oIDUopAWMLhZRbbRx6ACXbARXdHNp2tmBnFeflbK\nTUbCTk8Ch3I0I7+3KQRaDfupPhapso1xO8SqDqG69xRh0zG6GgTqjdaPRv44\nsVqiHpX9olWG63I101qY0Nbci/XKh08ZL5c5HaQl+hl1zTfjeHnyvOgL1bgL\nny/FwiQieuUbyY1miKLnuvqXKkSvymnRMqscdVRS81T5E+HXxHzbV31bb3Gm\nz4EFZVu99l9l6GNvrR+lYAbNcDD4OnLSwCFxxUiSHFaPMbB5wbrv9zEnbw+f\nD2tYtMMBQ40u8qAcaWWQtw+7UFq4ROGUAxnv7bemSczrIip3c5Ay2oXLqQkV\nrqeTyqy/EeGUMw7LzHK7L1rfc7HdhCIJw8ige9bEUy0+7hKx/oGbBpEj18+0\nJYJFLe2PvR7YKg45cwI63KSwOuW3H1FG/RNymCyeD+shGJRsGNlFHe4PxKEs\n6TxOwxtvLTrPvdM83lvmIHvaR/3zIKqpHHw67IQ3FKwkBKcPS9SUjKK1ccD0\nEfa94YGZ6F7PxIo1oocbdaWJDVnsVhZ2DDCr9Pmkjm6o0aUbv3a7Yg5dj9cb\nunAv\r\n=UCqK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBAf2MlCSxOd+x6OxXXc61iQzttKM6viwWfzHKKN7dgjAiEAm0vMLa/ydAdlJ4urea/i0zC/nUJVnyoNT4w+7bseAOo="}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.4.0-beta.3_1601514041384_0.37157506282784847"},"_hasShrinkwrap":false},"3.4.0-beta.4":{"name":"@mihanizm56/fetch-api","version":"3.4.0-beta.4","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","colors":"1.4.0","json-mask":"1.0.2","node-fetch":"2.6.1","query-string":"6.13.1"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.1","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript":"3.8.3","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for the isomorphic fetch\n\n### Benefits:\n\n- Provides validation for responses (based on @hapi/joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services)\nhttps://www.npmjs.com/package/query-string is used\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in\n  hard-structured responce format or not (both interfaces are the same)\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n- Provides the ability to handle the response progress\n\n#### Request input options:\n\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use @hapi/joi\n- customTimeout(number) - milliseconds for cancel the request on timeout\n\n#### Request output options:\n\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n\n- body will be serialized in JSON if body data NOT FormData\n- try to use .unknown() method with objects in Joi Schemas because your backend may be extended\n  and without this method the responce data may be not valid\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n## Examples of usage\n\n### REST API\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### get request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          }).unknown()\n        ),\n      }).unknown(),\n    }).unknown(),\n  });\n```\n\n#### get request with PROGRESS callbacks\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          }).unknown()\n        ),\n      }).unknown(),\n    }).unknown(),\n    progressOptions: {\n      onLoaded: (total) => console.log(total) \n      // onLoaded callback will be called after \n      // the whole response will be done\n      // WARNING - not availiable on nodejs environment\n      onProgress: ({ total, current}) => console.log(total, current)\n      // onProgress callback will be triggered during the response progress\n      // till the response will be done\n      // WARNING - not availiable on nodejs environment\n    },\n  });\n```\n\n#### get request with blob parse\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getPhotoRequest = (): Promise<IResponse> =>\n  new RestRequest().getBlobRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    responseSchema: Joi.any()\n  });\n```\n\n#### get PURE REST request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { PureRestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new PureRestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          }).unknown()\n        ),\n      }).unknown(),\n    }).unknown(),\n  });\n```\n\n#### post(put/patch/delete have the same format) request\n\n```javascript\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    body: someData,\n    mode: \"cors\",\n    queryParams: {\n      id: \"test_id_123\",\n    },\n    headers: {\n      \"Content-Type\": \"application/json\",\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\")),\n    }).unknown(),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createReviseRequest(\n  someData\n);\n```\n\n### JSON-RPC API\n\n```javascript\nimport { JSONRPCRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createItemsRequest = (someData): Promise<IResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint: \"http://localhost:3000\",\n    body: {\n      method: 'some method',\n      params: 123\n    }\n    queryParams: {\n      stringId: \"123\"\n      someArray: ['1', 1, '2', 2],\n      numberId: 100\n    },\n    responseSchema: Joi.object({\n      items: Joi.array().items(\n        Joi.object({\n          id: Joi.string().required(),\n          name: Joi.string().required(),\n          name: Joi.string()\n        }).unknown()\n      )\n    }).unknown(),\n  });\n```\n\n### JSON-RPC API (with batching)\n\n```javascript\nimport { JSONRPCRequest, IResponse } from \"@mihanizm56/fetch-api\";\nimport Joi from '@hapi/joi'\n\nconst responseSchemaObjectOne = Joi.object({\n  foo: Joi.string().required(),\n}).unknown();\n\nconst responseSchemaObjectTwo = Joi.object({\n  foo: Joi.string().required(),\n}).unknown();\n\nexport const createItemsRequest = (someData): Promise<IResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint:\n      'http://localhost:8080/json-rpc/positive?batch=true&twoSchemas=true',\n    body: [\n      { method: 'listCountries', params: {} },\n      { method: 'listCountries', params: {} },\n    ],\n    isBatchRequest: true,\n    responseSchema: [responseSchemaObjectOne, responseSchemaObjectTwo],\n  });\n```\n\n#### Please, be careful. The response will be the object:\n```javascript\n{\n  error: boolean,\n  data: Array<IResponse>,\n  additionalErrors: null,\n  errorText: string,\n  code: number\n}\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n\n#### Cancelling the request\n\n```javascript\nimport { RestRequest, IResponse, ABORT_REQUEST_EVENT_NAME } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    body: someData,\n    abortRequestId: '1',\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\")),\n    }).unknown(),\n  });\n);\n\ndocument.dispatchEvent(\n  new CustomEvent(ABORT_REQUEST_EVENT_NAME, {\n    detail: { id: '1' },\n  }),\n);\n```","readmeFilename":"README.md","gitHead":"220845f09f7c47346bce8d2f01b732c3c3fb54d9","_id":"@mihanizm56/fetch-api@3.4.0-beta.4","_nodeVersion":"12.13.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-+7T+87WwkdLCB+M9wJF7Jja9vmglb+A4JdjdlY9fmQj9kYBelhOj+C0CFkIK07xnhd4B6XuKPTJ+L+hJ5JBbqQ==","shasum":"ae430586a1ece5a219796e65a87deac916c0214f","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.4.0-beta.4.tgz","fileCount":64,"unpackedSize":108601,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfdSwjCRA9TVsSAnZWagAA0MUP/itJLHuAa8qLgTiZaQwI\n/LEYz1AKCYKXQhfgQqrVc3SViu/PkSLWPvi6sn2Gzo7I+prxbWi13dmYlPiz\nT6cMvLiTbt2LqrZfoZ5HSd7ix+QqfBV8HNNL2aq5Dq3RW8sWe/b4C1Nr48ph\nKi6W98DwGsNb7GwOcaNwf5fWhVuVstHbOoNDfbIP4gFNm2ZOYbywblwUcNCh\nE4ofvaFXqMyLd61/Yhjw0VJs1NqHhww267qGpAQ2WFpTEJ/uyDeoZX472Ged\nxc8HF4HB9B7bPRos6n8nvuziulp8uOmfI3ntnkCBVmy1f7UsbxPmcR60SDE7\n4Pilj9UEf0P3VhMxuCkqCwVf4P1FOSWmpOEU3sYw9FwEzJv0bATZUFt6q5Ry\nsb5o41feLqfiCGsPPur5ApQY514tPvvZKmGXc2f8YRBoFYg9RmDrrDxINo4X\ncplN9J4TTDxSSQ1zP/7/ruDWAk+TJBHCFgCldhKgALOruIMSVFUh+3Bdq9m2\nBFVlRFMgCDEZhOe2jCUNV0bjaGDQ2pQQpQOeVtVr3t3BX2frb22oD+Eq34Vc\n7u5/Q72vYxJlqAGJCzjqVb22ERehu0NdPmYX1tMHnboR3iwaQAAEIGxl95ed\nqhLHQ/hkole4SRseEaD+nZm2IBQjucbe6mGbzfGrLesRc2XYohtRKvMFLmMg\nG/Hk\r\n=tImU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHwnnqCoyrohXw46/4T+TAle2r4BL/AZtLBk5UiE53e1AiArgaotL8YCXSif5AZ6JDbNhCjanXYQUrcMcSc/ud3xuw=="}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.4.0-beta.4_1601514531257_0.08267267627579611"},"_hasShrinkwrap":false},"3.3.20":{"name":"@mihanizm56/fetch-api","version":"3.3.20","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","colors":"1.4.0","json-mask":"1.0.2","node-fetch":"2.6.1","query-string":"6.13.1"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.1","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript":"3.8.3","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"gitHead":"df64a48efc9d84b95d665d8710264a7b6ee3ce75","_id":"@mihanizm56/fetch-api@3.3.20","_nodeVersion":"12.13.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-gVDEbsEk4thvK96748fFe7oUUlluS8HgrU8ezbGJ3UyVAZRMxVcGlGFZYt2hY0de4VPNV4fF3oh0k40b2ywWtw==","shasum":"0d6358d297960a8675da0637dd36f222429b7d6e","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.3.20.tgz","fileCount":64,"unpackedSize":110145,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfdS9OCRA9TVsSAnZWagAAPv8P/ikEqyVUv3BDBpkajzbI\nJ4UbkA96NdvW1ygZSYf43n3voNjmmJFR1POnwujh/ATdCy59u0c0XSdi/JvQ\n/ZxOdxXFF9d/a6KZ6ZL+c2PKG+bY/rnJtcT4FD1HJkpM0Sal7OvOcy49lf9c\naJiC9i1iCZtxmMQQRTH2yhPOp8anPAqytXSql0quJPh11fL2vcN2Q8BRgRGB\nnIEh3RUUOlXHyYtTE0nm1NvT4oOwTE4Mj8Jn9ocuOIurVCmtNlxAg9hJfcVq\n23zsUN6AT2K1os321CwkjjI4t+imfhILGjn2o6/o82oU7BE+e+9OcMtAvQK8\njrgNt7nqSwPSeIMFUdj1UfTafY4AfUtTwk0ggZnxZuHXIEpVl2M1NKIivKQX\nXifmLFhh2NUNkrI1sI//29oefEmI/SVqoXwdaAVq/Rt1+vcRlrmvDCUcmW4y\n0aBURqEIH+h7L58qfDPZT57AFaYkdAWbPzCDLr0rfdypzPlrRiMoxk5Ubxx+\ncSmdkHS9ZQjiRBGm6FqJSELhehiqsLor7iY0POnxHrBKO5BsE3YOqGmlWRWL\nt2V8YQxBqaGg1mN59gU4MC9d5Dp/HadJOr920a1PCwVlqAAilGhA4TY2Oq6m\nePE5F6q/cGC7r/ZBoO28zhm1TPaXbjgUXvwJSyXqo13JSncMF0mjxl1+OEiP\nsbEF\r\n=+xRa\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGfG6BkvmKUrHQ/iFYGoLnyJyPFI8PSrFAkmdl3URew3AiEA64uv9whV9/etWzr+tDMTGywGvIjSXurFgdpJJJVc8nE="}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.3.20_1601515341626_0.5123089423707576"},"_hasShrinkwrap":false},"3.3.21":{"name":"@mihanizm56/fetch-api","version":"3.3.21","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","colors":"1.4.0","json-mask":"1.0.2","node-fetch":"2.6.1","query-string":"6.13.1"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.1","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript":"3.8.3","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"gitHead":"8c5e26831939c2d063aad38fb9867e3c817ffa09","_id":"@mihanizm56/fetch-api@3.3.21","_nodeVersion":"12.11.1","_npmVersion":"6.14.2","dist":{"integrity":"sha512-MQd6WGZs8eA6bQnetOwyfqjC+u7OFRwjmzMU8uDMzNJpw5ThSBwrCijliyiLc/G2dYzRf8O4A4o3hu/iv3jvjQ==","shasum":"02ec097c6348bdc5e8ddb879d874652f4c1c28b3","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.3.21.tgz","fileCount":64,"unpackedSize":112337,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfdh0jCRA9TVsSAnZWagAAVVoP/0GSAAiZXJ1g7zNBiyzh\nxRmQqwgH5Izho6DY4Lk3PUOkMOAKFH+NtdUApW6nMcBdPM6wMer8tT1sTMG5\nUOymOB67MIMlHSw7rXqL4PuXJxDyPto6nHLN7Uh7BooioCTcgDvpVhPnKrWs\nuGZ3MOYSyxENMu+3k6XCl2mzX0BxqUOUTQTRoXAFehywoBp+tOlzDqUV3jA/\n0+aM5+bm4yo2SMoMAxPZlgFw4tgYb2rSoN6h4a6mvuCnHHCg6DWSZL2PDcao\nYRd9Lktg78DKZ2I8qxSd2annstc+prjkGGKXffRapNRd7bub1vsb3rm3ORwA\nGwUcjGgBOYNIC2a71BlmJHutmPbG4miUDN+jktGiwddXdGg10iOLI5PhXkzt\ncH6ATf3STAHQkLiWihXyKXBj/3hN1IY1xdadp13gTJlOZD+6wF3EimeoRSgH\nqhRTgZYpJfuw56IFR0abuvaq3ujklm+2gse2Dl93eQ+V0PSXbWHMdEDCqKB/\nXbK3vRG5TLhVKzy3etSPKo6ah6e6XuR6RuqWw8tQSU5YqIYeXNH7Kyq85opC\nkZn+uGTYJRPW6i2BI63rZuRw8Xj8QeAVjRhuU3A4/YZXQXh7yp+jrhPIf5oo\nUDREpOTJIaTrRuIE8b0xqNtfV5VLrrxCansHJ4B1sNWuhawaGSygU0mApCmH\npGX+\r\n=3x47\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDumkuHV8HW/iK3MXD4isc36g+EsZYwAY2SK311BTaIWAiEAp4kF/ITC4sNTW7WF8/jmEj0KaploCxT0+dW6XQgIkcA="}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.3.21_1601576226628_0.21954794597038574"},"_hasShrinkwrap":false},"3.3.21-beta.1":{"name":"@mihanizm56/fetch-api","version":"3.3.21-beta.1","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","colors":"1.4.0","json-mask":"1.0.2","node-fetch":"2.6.1","query-string":"6.13.1"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.1","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript":"3.8.3","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"readme":"# @mihanizm56/fetch-api\r\n\r\n## Solution for the isomorphic fetch\r\n\r\n### Benefits:\r\n\r\n- Provides validation for responses (based on @hapi/joi Schema validation and may use your own validation function)\r\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\r\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services)\r\nhttps://www.npmjs.com/package/query-string is used\r\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \r\n- Provides error catching (you dont need to use try/catch)\r\n- Provides the ability to match the exact error translation\r\n- Provides different kinds of the response formats to parse\r\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\r\n- Works in modern browsers and ie11\r\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in\r\n  hard-structured responce format or not (both interfaces are the same)\r\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\r\n- Provides the ability to handle the response progress\r\n- Provides the ability to select necessary fields from the response (json-mask library used)\r\n\r\n#### Request input options:\r\n\r\n- endpoint(string): the request url\r\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\r\n- body(JSON | FormData): the request body\r\n- mode('cors' | 'no-cors'): the cors type\r\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\r\n- headers(object): the object with the headers\r\n- translateFunction(function): function that will be called with error text key and params (key, params)\r\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\r\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\r\n- extraValidationCallback(function): callback that can be used for custom response <br/>\r\n  data validation or if you don't want to use @hapi/joi\r\n- customTimeout(number) - milliseconds for cancel the request on timeout\r\n\r\n#### Request output options:\r\n\r\n- error (boolean) - the flag of the response status\r\n- errorText (string) - the text error message from the backend\r\n- data (object) - the main data from the backend\r\n- additionalErrors (object) - the additional error data from the backend\r\n- code (number) - status-code from backend\r\n\r\n## Features and recommendations\r\n\r\n- body will be serialized in JSON if body data NOT FormData\r\n- try to use .unknown() method with objects in Joi Schemas because your backend may be extended\r\n  and without this method the responce data may be not valid\r\n\r\n## !!! Attention !!!\r\n### If you need to support ie11 - please add the following polyfills\r\n\r\n```javascript\r\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\r\nimport 'whatwg-fetch';\r\n```\r\n\r\n## Examples of usage\r\n\r\n### REST API\r\n\r\n#### installation\r\n\r\n```javascript\r\nnpm install @mihanizm56/fetch-api\r\n```\r\n\r\n#### get request\r\n\r\n```javascript\r\nimport Joi from \"@hapi/joi\";\r\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\r\n\r\nexport const getContractsRequest = (): Promise<IResponse> =>\r\n  new RestRequest().getRequest({\r\n    endpoint: \"http://localhost:3000\",\r\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\r\n    isErrorTextStraightToOutput: true,\r\n    responseSchema: Joi.object({\r\n      username: Joi.string().required(),\r\n      password: Joi.string().required(),\r\n      info: Joi.object({\r\n        count: Joi.number().required(),\r\n        killers: Joi.array().items(\r\n          Joi.object({\r\n            username: Joi.string().required(),\r\n            count: Joi.number().required(),\r\n          }).unknown()\r\n        ),\r\n      }).unknown(),\r\n    }).unknown(),\r\n  });\r\n```\r\n\r\n#### get request with response fields selection (Be ensure that selected field is guarded with the responseSchema)\r\n\r\n```javascript\r\nimport Joi from \"@hapi/joi\";\r\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\r\n\r\nexport const getContractsRequest = (): Promise<IResponse> =>\r\n  new RestRequest().getRequest({\r\n    endpoint: \"http://localhost:3000\",\r\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\r\n    isErrorTextStraightToOutput: true,\r\n    selectData: 'username,password', // the output will be {data:{ username, password }, etc...}\r\n    responseSchema: Joi.object({\r\n      username: Joi.string().required(),\r\n      password: Joi.string().required(),\r\n      info: Joi.object({\r\n        count: Joi.number().required(),\r\n        killers: Joi.array().items(\r\n          Joi.object({\r\n            username: Joi.string().required(),\r\n            count: Joi.number().required(),\r\n          }).unknown()\r\n        ),\r\n      }).unknown(),\r\n    }).unknown(),\r\n    progressOptions: {\r\n      onLoaded: (total) => console.log(total) \r\n      // onLoaded callback will be called after \r\n      // the whole response will be done\r\n      // WARNING - not availiable on nodejs environment\r\n      onProgress: ({ total, current}) => console.log(total, current)\r\n      // onProgress callback will be triggered during the response progress\r\n      // till the response will be done\r\n      // WARNING - not availiable on nodejs environment\r\n    },\r\n  });\r\n```\r\n\r\n#### get request with PROGRESS callbacks\r\n\r\n```javascript\r\nimport Joi from \"@hapi/joi\";\r\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\r\n\r\nexport const getContractsRequest = (): Promise<IResponse> =>\r\n  new RestRequest().getRequest({\r\n    endpoint: \"http://localhost:3000\",\r\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\r\n    isErrorTextStraightToOutput: true,\r\n    responseSchema: Joi.object({\r\n      username: Joi.string().required(),\r\n      password: Joi.string().required(),\r\n      info: Joi.object({\r\n        count: Joi.number().required(),\r\n        killers: Joi.array().items(\r\n          Joi.object({\r\n            username: Joi.string().required(),\r\n            count: Joi.number().required(),\r\n          }).unknown()\r\n        ),\r\n      }).unknown(),\r\n    }).unknown(),\r\n    progressOptions: {\r\n      onLoaded: (total) => console.log(total) \r\n      // onLoaded callback will be called after \r\n      // the whole response will be done\r\n      // WARNING - not availiable on nodejs environment\r\n      onProgress: ({ total, current}) => console.log(total, current)\r\n      // onProgress callback will be triggered during the response progress\r\n      // till the response will be done\r\n      // WARNING - not availiable on nodejs environment\r\n    },\r\n  });\r\n```\r\n\r\n#### get request with blob parse\r\n\r\n```javascript\r\nimport Joi from \"@hapi/joi\";\r\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\r\n\r\nexport const getPhotoRequest = (): Promise<IResponse> =>\r\n  new RestRequest().getBlobRequest({\r\n    endpoint: \"http://localhost:3000\",\r\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\r\n    responseSchema: Joi.any()\r\n  });\r\n```\r\n\r\n#### get PURE REST request\r\n\r\n```javascript\r\nimport Joi from \"@hapi/joi\";\r\nimport { PureRestRequest, IResponse } from \"@mihanizm56/fetch-api\";\r\n\r\nexport const getContractsRequest = (): Promise<IResponse> =>\r\n  new PureRestRequest().getRequest({\r\n    endpoint: \"http://localhost:3000\",\r\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\r\n    isErrorTextStraightToOutput: true,\r\n    responseSchema: Joi.object({\r\n      username: Joi.string().required(),\r\n      password: Joi.string().required(),\r\n      info: Joi.object({\r\n        count: Joi.number().required(),\r\n        killers: Joi.array().items(\r\n          Joi.object({\r\n            username: Joi.string().required(),\r\n            count: Joi.number().required(),\r\n          }).unknown()\r\n        ),\r\n      }).unknown(),\r\n    }).unknown(),\r\n  });\r\n```\r\n\r\n#### post(put/patch/delete have the same format) request\r\n\r\n```javascript\r\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\r\n\r\nexport const createReviseRequest = (someData): Promise<IResponse> =>\r\n  new RestRequest().postRequest({\r\n    endpoint: \"http://localhost:3000\",\r\n    body: someData,\r\n    mode: \"cors\",\r\n    queryParams: {\r\n      id: \"test_id_123\",\r\n    },\r\n    headers: {\r\n      \"Content-Type\": \"application/json\",\r\n    },\r\n    responseSchema: Joi.object({\r\n      username: Joi.string().required(),\r\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\")),\r\n    }).unknown(),\r\n  });\r\n```\r\n\r\n#### The usage of the request api\r\n\r\n```javascript\r\nconst { error, errorText, data, additionalErrors } = await createReviseRequest(\r\n  someData\r\n);\r\n```\r\n\r\n### JSON-RPC API\r\n\r\n```javascript\r\nimport { JSONRPCRequest, IResponse } from \"@mihanizm56/fetch-api\";\r\n\r\nexport const createItemsRequest = (someData): Promise<IResponse> =>\r\n  new JSONRPCRequest().makeRequest({\r\n    endpoint: \"http://localhost:3000\",\r\n    body: {\r\n      method: 'some method',\r\n      params: 123\r\n    }\r\n    queryParams: {\r\n      stringId: \"123\"\r\n      someArray: ['1', 1, '2', 2],\r\n      numberId: 100\r\n    },\r\n    responseSchema: Joi.object({\r\n      items: Joi.array().items(\r\n        Joi.object({\r\n          id: Joi.string().required(),\r\n          name: Joi.string().required(),\r\n          name: Joi.string()\r\n        }).unknown()\r\n      )\r\n    }).unknown(),\r\n  });\r\n```\r\n\r\n### JSON-RPC API (with batching)\r\n\r\n```javascript\r\nimport { JSONRPCRequest, IResponse } from \"@mihanizm56/fetch-api\";\r\nimport Joi from '@hapi/joi'\r\n\r\nconst responseSchemaObjectOne = Joi.object({\r\n  foo: Joi.string().required(),\r\n}).unknown();\r\n\r\nconst responseSchemaObjectTwo = Joi.object({\r\n  foo: Joi.string().required(),\r\n}).unknown();\r\n\r\nexport const createItemsRequest = (someData): Promise<IResponse> =>\r\n  new JSONRPCRequest().makeRequest({\r\n    endpoint:\r\n      'http://localhost:8080/json-rpc/positive?batch=true&twoSchemas=true',\r\n    body: [\r\n      { method: 'listCountries', params: {} },\r\n      { method: 'listCountries', params: {} },\r\n    ],\r\n    isBatchRequest: true,\r\n    responseSchema: [responseSchemaObjectOne, responseSchemaObjectTwo],\r\n  });\r\n```\r\n\r\n#### Please, be careful. The response will be the object:\r\n```javascript\r\n{\r\n  error: boolean,\r\n  data: Array<IResponse>,\r\n  additionalErrors: null,\r\n  errorText: string,\r\n  code: number\r\n}\r\n```\r\n\r\n#### The usage of the request api\r\n\r\n```javascript\r\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\r\n  someData\r\n);\r\n```\r\n\r\n#### Cancelling the request\r\n\r\n```javascript\r\nimport { RestRequest, IResponse, ABORT_REQUEST_EVENT_NAME } from \"@mihanizm56/fetch-api\";\r\n\r\nexport const createReviseRequest = (someData): Promise<IResponse> =>\r\n  new RestRequest().postRequest({\r\n    endpoint: \"http://localhost:3000\",\r\n    body: someData,\r\n    abortRequestId: '1',\r\n    responseSchema: Joi.object({\r\n      username: Joi.string().required(),\r\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\")),\r\n    }).unknown(),\r\n  });\r\n);\r\n\r\ndocument.dispatchEvent(\r\n  new CustomEvent(ABORT_REQUEST_EVENT_NAME, {\r\n    detail: { id: '1' },\r\n  }),\r\n);\r\n```","readmeFilename":"README.md","gitHead":"4581d5344dfa25d5a3d4b2abcdbec737b0c42a57","_id":"@mihanizm56/fetch-api@3.3.21-beta.1","_nodeVersion":"12.11.1","_npmVersion":"6.14.2","dist":{"integrity":"sha512-N/HmZJ1GQ+zVcCxyP1DZlNJgX6P+Hkp8RPiH9GILo+06b8oUoIpckfJZljlQ/0H+tRaNjd0SGUEsPKgkqeBiag==","shasum":"5c6a26634f1f0e54c57af47708b47c151f01abc5","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.3.21-beta.1.tgz","fileCount":64,"unpackedSize":112323,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfdlKlCRA9TVsSAnZWagAA2V0P/3l4Agcgj90zLRDBnUjC\n8dKW3ss3HnrnSXljkNUvqTDpvSvPfX131r9COXpzszTNsbvypqNzp/Cmp1Nt\nhvec1Km98uhTDI232gXWsocSoogB2pfo4sX65J4C1QQplAlNeIBQxhHsPf+K\n+0cc+2MrmDm775zVS8dAYI6hrpgYO/G/Q2eoiLVBpaMi2+BqwSLDNy+4yLDP\noUyKFy4hQiSxgOC9HeQz9J1uzj9fiPUPNmsdOQAnwkfiU03BBgATQ/sQvmkt\n1qsrSPy4mG9cL4MB1gcNy3lIo7D4/b1osDy0NNILstik/I23QsmeDSQNgFXC\npg66OEkEABRcEW1nmo+78d6ZBMN7k4l1Z4yMwgwwWcQj4uMQcnxEXnHhXmeq\ndOnfbQFb+bwmJAVz9VijHjEb9F32gd4wpvc3Y34pbL90KlMF5fBCiVYjb+BA\nyEm/e3Dkm98n5BGr4WZrHcgqu76X+NNzLKDOJH4sabc8dqaZI9MIJrvaqWny\nW9Ld1xw0wAzNmPCn/T/icygSig4gWCN1MYIKAgKlllfi9xp7cZXAJPsMmFB5\nJjIqwjYwhKypYaVcF0H1VNsFakBp6s3WO0EJWLRD+jkbgIDqn66LvifI8DzL\n4WPFpRa4OqNp6DWivuvU24iFwrcaQoXVPgYoiMvjT/TnbetG4Pn4UOwVC97L\nAFsz\r\n=rl79\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDen/maOQ+n6pfkL/hxGnXfmfQQRp1aQoMQl06CqrDhrgIhANOWlzcy/imcSyz90nbrKEwdnqhXtVPOZytx1+IoDjgd"}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.3.21-beta.1_1601589925088_0.7116006077526942"},"_hasShrinkwrap":false},"3.3.22":{"name":"@mihanizm56/fetch-api","version":"3.3.22","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","colors":"1.4.0","json-mask":"1.0.2","node-fetch":"2.6.1","query-string":"6.13.1"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.1","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript":"3.8.3","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"gitHead":"2a3eff1f63585b4ce426be7833d8fbcaa1bf545f","_id":"@mihanizm56/fetch-api@3.3.22","_nodeVersion":"12.13.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-M1dbbDQ91HYLX+eC0fHqM/GeXl2LrqKWITMRL6508GwCSLoYr8ZbjwvL+Khnngy5LNOx+leViAzU+1TOIJX0qg==","shasum":"0b62b8910ba2b409b515c65635b221f9938a1ff7","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.3.22.tgz","fileCount":64,"unpackedSize":110020,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfdo5jCRA9TVsSAnZWagAA1JYP/0vWUEIlzGIXnAVMzuJ5\nU1hQghkAp9cyHCHsstmkEP+69l//tTm6UmhIkv421kOfa+ysiMun8WDB3Y6d\n68qr6aW0ufBMUlzb+2RuwQDR67KDxR5HFey5YyyVEs+v1XE+6KaPO48q+BO+\nhyUKFzqU1UQfuliXGM8Z0Y3bDf7/NCXa4+uNoF1F8WFscujNv5LZYaghbA5y\n4fNxIrSKsno3ivLCCLSIvsjr7AUlckk4U/zlc+hyAgo/uB9vw9EtnfdI62ou\nJ8xTZCXBdwbwTWh9aoaZ8t94YdqdRGeVgS6qxmXrZwAW44NdLPo75Nu92ibQ\nAzg7dGgAsW01id7T7OrtGqlPSWE0zXKhWFn1q3ZMeLgQxQD60Up/uTM7aQ8J\nbqRAvbxLcSCq3B2z2RjU3THs1OTZh2TVYs+KzUPzLtv+KdPbRznNFXm6rZyL\n0wBbj5UAAYs3Jrc0kLS28O5w05LoEMJQjfCXyi3g7ZIO2pHAb/ySc7u4RW3d\nXGt5hN79qFjpSvsrBvtMiMqXS293yP/8IfLztqBmeWwIIQsi6PwXM3fAbgnQ\nasw5BFzF7Q/12gl0EKaaihUC2Nhraasu8b6qeE7o/Ot+7eealkC57WMQpcfu\nKF8oc2Fb45diomEsOescCjgn7bYC5zmF8TcOjtkBMxMhldbylJo7NgDaWHZO\nNUgL\r\n=spfK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD2y/JkqbduZl0t9F1V+7HE0QAxsQJA0v8lqfNimtT9DwIgftk0sE9DYyhvs9kZIbuTVn2CCwni2jFREuQE/dGmKVU="}]},"maintainers":[{"name":"mihanizm56","email":"m.727507@gmail.com"}],"_npmUser":{"name":"mihanizm56","email":"m.727507@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.3.22_1601605218626_0.6048933892490791"},"_hasShrinkwrap":false},"3.3.23-beta.1":{"name":"@mihanizm56/fetch-api","version":"3.3.23-beta.1","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","colors":"1.4.0","json-mask":"1.0.2","node-fetch":"2.6.1","query-string":"6.13.1"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.1","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript":"3.8.3","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for the isomorphic fetch\n\n### Benefits:\n\n- Provides validation for responses (based on @hapi/joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services)\nhttps://www.npmjs.com/package/query-string is used\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in\n  hard-structured responce format or not (both interfaces are the same)\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n- Provides the ability to handle the response progress\n- Provides the ability to select necessary fields from the response (json-mask library used)\n\n#### Request input options:\n\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use @hapi/joi\n- customTimeout(number) - milliseconds for cancel the request on timeout\n\n#### Request output options:\n\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n\n- body will be serialized in JSON if body data NOT FormData\n- try to use .unknown() method with objects in Joi Schemas because your backend may be extended\n  and without this method the responce data may be not valid\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n## Examples of usage\n\n### REST API\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### get request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          }).unknown()\n        ),\n      }).unknown(),\n    }).unknown(),\n  });\n```\n\n#### get request with response fields selection (Be ensure that selected field is guarded with the responseSchema)\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    selectData: 'username,password', // the output will be {data:{ username, password }, etc...}\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          }).unknown()\n        ),\n      }).unknown(),\n    }).unknown(),\n    progressOptions: {\n      onLoaded: (total) => console.log(total) \n      // onLoaded callback will be called after \n      // the whole response will be done\n      // WARNING - not availiable on nodejs environment\n      onProgress: ({ total, current}) => console.log(total, current)\n      // onProgress callback will be triggered during the response progress\n      // till the response will be done\n      // WARNING - not availiable on nodejs environment\n    },\n  });\n```\n\n\n#### get request with PROGRESS callbacks\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          }).unknown()\n        ),\n      }).unknown(),\n    }).unknown(),\n    progressOptions: {\n      onLoaded: (total) => console.log(total) \n      // onLoaded callback will be called after \n      // the whole response will be done\n      // WARNING - not availiable on nodejs environment\n      onProgress: ({ total, current}) => console.log(total, current)\n      // onProgress callback will be triggered during the response progress\n      // till the response will be done\n      // WARNING - not availiable on nodejs environment\n    },\n  });\n```\n\n#### get request with blob parse\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getPhotoRequest = (): Promise<IResponse> =>\n  new RestRequest().getBlobRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    responseSchema: Joi.any()\n  });\n```\n\n#### get PURE REST request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { PureRestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new PureRestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          }).unknown()\n        ),\n      }).unknown(),\n    }).unknown(),\n  });\n```\n\n#### post(put/patch/delete have the same format) request\n\n```javascript\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    body: someData,\n    mode: \"cors\",\n    queryParams: {\n      id: \"test_id_123\",\n    },\n    headers: {\n      \"Content-Type\": \"application/json\",\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\")),\n    }).unknown(),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createReviseRequest(\n  someData\n);\n```\n\n### JSON-RPC API\n\n```javascript\nimport { JSONRPCRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createItemsRequest = (someData): Promise<IResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint: \"http://localhost:3000\",\n    body: {\n      method: 'some method',\n      params: 123\n    }\n    queryParams: {\n      stringId: \"123\"\n      someArray: ['1', 1, '2', 2],\n      numberId: 100\n    },\n    responseSchema: Joi.object({\n      items: Joi.array().items(\n        Joi.object({\n          id: Joi.string().required(),\n          name: Joi.string().required(),\n          name: Joi.string()\n        }).unknown()\n      )\n    }).unknown(),\n  });\n```\n\n### JSON-RPC API (with batching)\n\n```javascript\nimport { JSONRPCRequest, IResponse } from \"@mihanizm56/fetch-api\";\nimport Joi from '@hapi/joi'\n\nconst responseSchemaObjectOne = Joi.object({\n  foo: Joi.string().required(),\n}).unknown();\n\nconst responseSchemaObjectTwo = Joi.object({\n  foo: Joi.string().required(),\n}).unknown();\n\nexport const createItemsRequest = (someData): Promise<IResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint:\n      'http://localhost:8080/json-rpc/positive?batch=true&twoSchemas=true',\n    body: [\n      { method: 'listCountries', params: {} },\n      { method: 'listCountries', params: {} },\n    ],\n    isBatchRequest: true,\n    responseSchema: [responseSchemaObjectOne, responseSchemaObjectTwo],\n  });\n```\n\n#### Please, be careful. The response will be the object:\n```javascript\n{\n  error: boolean,\n  data: Array<IResponse>,\n  additionalErrors: null,\n  errorText: string,\n  code: number\n}\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n\n#### Cancelling the request\n\n```javascript\nimport { RestRequest, IResponse, ABORT_REQUEST_EVENT_NAME } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    body: someData,\n    abortRequestId: '1',\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\")),\n    }).unknown(),\n  });\n);\n\ndocument.dispatchEvent(\n  new CustomEvent(ABORT_REQUEST_EVENT_NAME, {\n    detail: { id: '1' },\n  }),\n);\n```","readmeFilename":"README.md","gitHead":"f7c4adb357c9513b4ebabb472682abebcbca2f6a","_id":"@mihanizm56/fetch-api@3.3.23-beta.1","_nodeVersion":"12.13.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-n8Mn5xb/YDtYgipYgybNvylT5OirvNbosnvUKzYuLh8jWYinhRQh2+RnFWYAwODRlBwBfHmFbMv2KmGHfdF1Lw==","shasum":"09c1c305e05e65b1831d7134fbdc2e203a3bb437","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.3.23-beta.1.tgz","fileCount":64,"unpackedSize":111380,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJffR/ZCRA9TVsSAnZWagAAxGMP/3QEj2UUfsPhuWxuhQVl\nCtTJfUHzvzKsK/lW87e+jVaiha1//Vv8ZbIXGCBcvcmkufBRL+GNvYyASXkN\nzrRa+t/1Ujkt+OoKdaODdBKshUPPxVhYdiEszdj9xVfhZ7ZT0ht5Zf389X85\nnt+nERgk1l/WEF5OGm2zRKzWL83EfT00FrYlFW8sRf3tu8YZvD0ib9xJNOFN\nwVtn8S9P/8GIv/mRtbINy6K0RLv1a96xTn/9ykd1hB6wPWupmQ9g5UyYJJwp\njCKHPEK4HZRG4mNRPkWRlQ9+x/VYnvAE1hrmtP1o9DnGI7rvwlACk64F8toI\na6kOHsIwjIHzAP9F2RwnW44SwGNxmOqNvbb9+XS3vUPOkHtAfKZjbs23MBJT\nMqiiMqKF4pwJ00BX9zYppD58TFQS4QQ6cfu1YVB0pyXMJbcmotX4Uf/so9AD\nFvBo7PXC1Hlrs9mFNC3o49rYaLl5Ve8F3YRJPKqudsknXwpnDrqg4cvA65YL\nF6us3jf8qSYZwRTy1iijpEyqCNdf1J+6wIwBNRzXKazYUlnKUFlQVrzt2qY6\nqnKUIx/EcDXv9IIW0juP5YRJc1+aRBY/40UsISGQ5mzPsOoPHrXygZNsxoYC\nBuXlf2Od1c94ollUOO2jkwqamA9UpyERouWFgLI9ZAulmBcG7+DD1niU+aKL\nztoR\r\n=2zkq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFIPjsrwZIr3kdnqDmvPVKqElb0Nkmnf+rJv2ayIZM80AiB1OCA4iXUyE8zepJr2dF4Q8krrrevNCboDwP90a75UXA=="}]},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.3.23-beta.1_1602035672437_0.5164284565289907"},"_hasShrinkwrap":false},"3.4.0-beta.5":{"name":"@mihanizm56/fetch-api","version":"3.4.0-beta.5","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","colors":"1.4.0","json-mask":"1.0.2","node-fetch":"2.6.1","query-string":"6.13.1"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.1","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript":"3.8.3","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for the isomorphic fetch\n\n### Benefits:\n\n- Provides validation for responses (based on @hapi/joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services)\nhttps://www.npmjs.com/package/query-string is used\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in\n  hard-structured responce format or not (both interfaces are the same)\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n- Provides the ability to handle the response progress\n- Provides the ability to select necessary fields from the response (json-mask library used)\n- Provides the ability to use persistent params for all requests\n\n#### Request input options:\n\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use @hapi/joi\n- customTimeout(number) - milliseconds for cancel the request on timeout\n\n#### Request output options:\n\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n\n- body will be serialized in JSON if body data NOT FormData\n- try to use .unknown() method with objects in Joi Schemas because your backend may be extended\n  and without this method the responce data may be not valid\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n## Examples of usage\n\n### REST API\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### get request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          }).unknown()\n        ),\n      }).unknown(),\n    }).unknown(),\n  });\n```\n\n#### get request with response fields selection (Be ensure that selected field is guarded with the responseSchema)\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    selectData: 'username,password', // the output will be {data:{ username, password }, etc...}\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          }).unknown()\n        ),\n      }).unknown(),\n    }).unknown(),\n    progressOptions: {\n      onLoaded: (total) => console.log(total) \n      // onLoaded callback will be called after \n      // the whole response will be done\n      // WARNING - not availiable on nodejs environment\n      onProgress: ({ total, current}) => console.log(total, current)\n      // onProgress callback will be triggered during the response progress\n      // till the response will be done\n      // WARNING - not availiable on nodejs environment\n    },\n  });\n```\n\n\n#### get request with PROGRESS callbacks\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          }).unknown()\n        ),\n      }).unknown(),\n    }).unknown(),\n    progressOptions: {\n      onLoaded: (total) => console.log(total) \n      // onLoaded callback will be called after \n      // the whole response will be done\n      // WARNING - not availiable on nodejs environment\n      onProgress: ({ total, current}) => console.log(total, current)\n      // onProgress callback will be triggered during the response progress\n      // till the response will be done\n      // WARNING - not availiable on nodejs environment\n    },\n  });\n```\n\n#### get request with blob parse\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getPhotoRequest = (): Promise<IResponse> =>\n  new RestRequest().getBlobRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    responseSchema: Joi.any()\n  });\n```\n\n#### get PURE REST request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { PureRestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new PureRestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          }).unknown()\n        ),\n      }).unknown(),\n    }).unknown(),\n  });\n```\n\n#### post(put/patch/delete have the same format) request\n\n```javascript\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    body: someData,\n    mode: \"cors\",\n    queryParams: {\n      id: \"test_id_123\",\n    },\n    headers: {\n      \"Content-Type\": \"application/json\",\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\")),\n    }).unknown(),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createReviseRequest(\n  someData\n);\n```\n\n### JSON-RPC API\n\n```javascript\nimport { JSONRPCRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createItemsRequest = (someData): Promise<IResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint: \"http://localhost:3000\",\n    body: {\n      method: 'some method',\n      params: 123\n    }\n    queryParams: {\n      stringId: \"123\"\n      someArray: ['1', 1, '2', 2],\n      numberId: 100\n    },\n    responseSchema: Joi.object({\n      items: Joi.array().items(\n        Joi.object({\n          id: Joi.string().required(),\n          name: Joi.string().required(),\n          name: Joi.string()\n        }).unknown()\n      )\n    }).unknown(),\n  });\n```\n\n### JSON-RPC API (with batching)\n\n```javascript\nimport { JSONRPCRequest, IResponse } from \"@mihanizm56/fetch-api\";\nimport Joi from '@hapi/joi'\n\nconst responseSchemaObjectOne = Joi.object({\n  foo: Joi.string().required(),\n}).unknown();\n\nconst responseSchemaObjectTwo = Joi.object({\n  foo: Joi.string().required(),\n}).unknown();\n\nexport const createItemsRequest = (someData): Promise<IResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint:\n      'http://localhost:8080/json-rpc/positive?batch=true&twoSchemas=true',\n    body: [\n      { method: 'listCountries', params: {} },\n      { method: 'listCountries', params: {} },\n    ],\n    isBatchRequest: true,\n    responseSchema: [responseSchemaObjectOne, responseSchemaObjectTwo],\n  });\n```\n\n#### Please, be careful. The response will be the object:\n```javascript\n{\n  error: boolean,\n  data: Array<IResponse>,\n  additionalErrors: null,\n  errorText: string,\n  code: number\n}\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n\n#### Cancelling the request\n\n```javascript\nimport { RestRequest, IResponse, ABORT_REQUEST_EVENT_NAME } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    body: someData,\n    abortRequestId: '1',\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\")),\n    }).unknown(),\n  });\n);\n\ndocument.dispatchEvent(\n  new CustomEvent(ABORT_REQUEST_EVENT_NAME, {\n    detail: { id: '1' },\n  }),\n);\n```\n\n#### Set persist options to all requests\n\n```javascript\nimport { FetchProxyMaker } from \"@mihanizm56/fetch-api\";\n\nnew FetchProxyMaker().setPersistentOptions(() => ({\n  headers: {\n    foo: 'bar',\n  },\n}));\n```\n","readmeFilename":"README.md","gitHead":"8962cd1d01cadf2c60a532281869e522acedaf9d","_id":"@mihanizm56/fetch-api@3.4.0-beta.5","_nodeVersion":"12.13.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-ZmxUSV8gfhIgKPKsEEx/oDYUooxOXIPPqujVHuNuyjwIJQ0AL64ivlN4PVMgjYJZLnhmHJnVdjoRuj5fqtt8qw==","shasum":"4348645f4e650ae19dd6b90acc43380465e2739c","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.4.0-beta.5.tgz","fileCount":66,"unpackedSize":113373,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfkIw7CRA9TVsSAnZWagAAHxAP/ipdgnmuW9tein81y4gK\nIPQE/DJugn/FI4CXMwMizeYakbONoosgBHdYqn+QRoa+1sUaTZjvYQhixupA\nzzwYFA8+auLV3OORcCkvmu+lH+LmNy4wMBlcM0L1jE5H7YLStkfbkg3Tss0i\niGzARntaWkhh0Anynx2DrqhRMZqhIcN3V6e7+F/LwSJmgqHzxnO/QKTwvokS\nN9rgCfrGDzDgqLHyZe4IYkfgUDUmslgLMLT83+Q5keg4jARVVu6Frh1LFpLD\nr97isy3KJ5K9HifVkH4+DsbQ8YNCE/9KThOH1ajtdi2g7naRnwS2gDeNyVIQ\nThXfNY0/4YOROOHiq1DZbLMrla5ukULoEdXiAa8UOYkvNTT1vexBwMaIiAi0\nCfpobFa/qgRH/E6TsbFpc+Do1+E6OfH1uWrRTHEJATUUE5elre/q6z3JXAMr\nfg4Dbdki2d/qg9FpbEYzjkXDTX1D7HlvI9db6vBEEdL0wZ773bOq0gYA/Gss\nvC7xyrjQ8Itfc6ASeVgVW2y+R5sC2P7KvLBmgAzdGOL38Ql2VUOsaQFsG01m\nFooEN+j1AV5OdIvFjUCS/t3eAZPchxUEh8Nde2MTEftp2s/nomc47v3pKRi9\n7AV5K7ajYn3uMECQPjdkV/68DWn5MOxoQ3U0Z8+OEwd0DRUyUuBcwMthahMg\nnYCX\r\n=Ff1/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD9tQU91sycvv+/IhqKk57oADJQyKk7q3Ke0dKGzoF0LQIhAOaDyL/Lq6Nhvwvlu6sHaWNldIcV2OvJ63a9UVsv3XMf"}]},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.4.0-beta.5_1603308603184_0.6093545311334441"},"_hasShrinkwrap":false},"3.4.0-beta.6":{"name":"@mihanizm56/fetch-api","version":"3.4.0-beta.6","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","colors":"1.4.0","json-mask":"1.0.2","node-fetch":"2.6.1","query-string":"6.13.1"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.1","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript":"3.8.3","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for the isomorphic fetch\n\n### Benefits:\n\n- Provides validation for responses (based on @hapi/joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services)\nhttps://www.npmjs.com/package/query-string is used\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in\n  hard-structured responce format or not (both interfaces are the same)\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n- Provides the ability to handle the response progress\n- Provides the ability to select necessary fields from the response (json-mask library used)\n- Provides the ability to use persistent params for all requests\n\n#### Request input options:\n\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use @hapi/joi\n- customTimeout(number) - milliseconds for cancel the request on timeout\n\n#### Request output options:\n\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n\n- body will be serialized in JSON if body data NOT FormData\n- try to use .unknown() method with objects in Joi Schemas because your backend may be extended\n  and without this method the responce data may be not valid\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n## Examples of usage\n\n### REST API\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### get request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          }).unknown()\n        ),\n      }).unknown(),\n    }).unknown(),\n  });\n```\n\n#### get request with response fields selection (Be ensure that selected field is guarded with the responseSchema)\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    selectData: 'username,password', // the output will be {data:{ username, password }, etc...}\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          }).unknown()\n        ),\n      }).unknown(),\n    }).unknown(),\n    progressOptions: {\n      onLoaded: (total) => console.log(total) \n      // onLoaded callback will be called after \n      // the whole response will be done\n      // WARNING - not availiable on nodejs environment\n      onProgress: ({ total, current}) => console.log(total, current)\n      // onProgress callback will be triggered during the response progress\n      // till the response will be done\n      // WARNING - not availiable on nodejs environment\n    },\n  });\n```\n\n\n#### get request with PROGRESS callbacks\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          }).unknown()\n        ),\n      }).unknown(),\n    }).unknown(),\n    progressOptions: {\n      onLoaded: (total) => console.log(total) \n      // onLoaded callback will be called after \n      // the whole response will be done\n      // WARNING - not availiable on nodejs environment\n      onProgress: ({ total, current}) => console.log(total, current)\n      // onProgress callback will be triggered during the response progress\n      // till the response will be done\n      // WARNING - not availiable on nodejs environment\n    },\n  });\n```\n\n#### get request with blob parse\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getPhotoRequest = (): Promise<IResponse> =>\n  new RestRequest().getBlobRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    responseSchema: Joi.any()\n  });\n```\n\n#### get PURE REST request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { PureRestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new PureRestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          }).unknown()\n        ),\n      }).unknown(),\n    }).unknown(),\n  });\n```\n\n#### post(put/patch/delete have the same format) request\n\n```javascript\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    body: someData,\n    mode: \"cors\",\n    queryParams: {\n      id: \"test_id_123\",\n    },\n    headers: {\n      \"Content-Type\": \"application/json\",\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\")),\n    }).unknown(),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createReviseRequest(\n  someData\n);\n```\n\n### JSON-RPC API\n\n```javascript\nimport { JSONRPCRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createItemsRequest = (someData): Promise<IResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint: \"http://localhost:3000\",\n    body: {\n      method: 'some method',\n      params: 123\n    }\n    queryParams: {\n      stringId: \"123\"\n      someArray: ['1', 1, '2', 2],\n      numberId: 100\n    },\n    responseSchema: Joi.object({\n      items: Joi.array().items(\n        Joi.object({\n          id: Joi.string().required(),\n          name: Joi.string().required(),\n          name: Joi.string()\n        }).unknown()\n      )\n    }).unknown(),\n  });\n```\n\n### JSON-RPC API (with batching)\n\n```javascript\nimport { JSONRPCRequest, IResponse } from \"@mihanizm56/fetch-api\";\nimport Joi from '@hapi/joi'\n\nconst responseSchemaObjectOne = Joi.object({\n  foo: Joi.string().required(),\n}).unknown();\n\nconst responseSchemaObjectTwo = Joi.object({\n  foo: Joi.string().required(),\n}).unknown();\n\nexport const createItemsRequest = (someData): Promise<IResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint:\n      'http://localhost:8080/json-rpc/positive?batch=true&twoSchemas=true',\n    body: [\n      { method: 'listCountries', params: {} },\n      { method: 'listCountries', params: {} },\n    ],\n    isBatchRequest: true,\n    responseSchema: [responseSchemaObjectOne, responseSchemaObjectTwo],\n  });\n```\n\n#### Please, be careful. The response will be the object:\n```javascript\n{\n  error: boolean,\n  data: Array<IResponse>,\n  additionalErrors: null,\n  errorText: string,\n  code: number\n}\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n\n#### Cancelling the request\n\n```javascript\nimport { RestRequest, IResponse, ABORT_REQUEST_EVENT_NAME } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    body: someData,\n    abortRequestId: '1',\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\")),\n    }).unknown(),\n  });\n);\n\ndocument.dispatchEvent(\n  new CustomEvent(ABORT_REQUEST_EVENT_NAME, {\n    detail: { id: '1' },\n  }),\n);\n```\n\n#### Set persist options to all requests\n\n```javascript\nimport { FetchProxyMaker } from \"@mihanizm56/fetch-api\";\n\nnew FetchProxyMaker().setPersistentOptions(() => ({\n  headers: {\n    foo: 'bar',\n  },\n}));\n```\n","readmeFilename":"README.md","gitHead":"d13f1b02765b53f91f9980eadfeb413884ad7510","_id":"@mihanizm56/fetch-api@3.4.0-beta.6","_nodeVersion":"12.13.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-2bTeJGkmivj4H10RsNvQlXj8ImRlZ1VMXG14HdUSd3pDCYZH2LFVj53/Se0AZb25fGps4TG2u2iSgb2EfFX0zA==","shasum":"f6090521fd58305bf34618aa1eb23602e1cffc3a","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.4.0-beta.6.tgz","fileCount":66,"unpackedSize":113918,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfn+GwCRA9TVsSAnZWagAAi5YP/ApUNg96X8f/mQ5Co7IF\n8Ri/x0HdPMjjGVBMRx2k3sqYhhrYZYOFn6a7943393ZhLZO7QPOdH7vI1q62\nNvm7GL3RDdj8HxYr8hotXk7tVWtGtmA9RJgaVXy2+RMzmcyRiBCtGEJILHTO\ntmS4CjPYSRpy/8T74xu33lNfZBXMrvr0xa5876HFZyXlxrgeaHWzXdXvvvte\n2p6gxV1DGFgdAZOManPNypKdLZUZmcS1iKE+p6TtJ/dfY4efb4q+1zIl4ZUH\n1Lc/c5/G0azZWinqqEoiCu0tBgJKzNH0oqdKBAIHCtsUwx93megOzmK4Meol\nnwfwb5t03AtDz+6UgFjv1lQoaiME1HwOLi5tZVF6anL3y+JJgrVJTEGtMF+z\nXSA1j+y9J8WAx7AAmgUEP7eLEUWlbgxZqT7C3rc+nTwH2ofgetP1cRNdliqc\nDyAkzURUT9bxow1LCIzlmvaguDHdbc6lPwCj/gI2A1dpoSMBp4f2hJwW2cN7\nJYKY3eRsEo5I1R+HcbmPcaHAaAmxIcMK0gPbFPrCzB4Nuu8Nv9xDq4FDxIex\nr0C6hlTMipfuQ4EVYuIO/sCXBboplty34wROL+5ymQDtQTgJHeV+gqgNPyG6\nC/t8pY0v7SlaL62ZGf6hFAYvaLCn6/LHKIzriEq/c/iQ8m4sxFiASiOVJdT+\noKK2\r\n=FVko\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCKbWMNbukyiKyhXScRJXuDxVPMIuuQjBg09we9oH0IsQIhAPUmf0JExYFzU4jN8Ajb+dL/hSCEPg4VDmd3EJ8I+N4t"}]},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.4.0-beta.6_1604313520317_0.9983386152152827"},"_hasShrinkwrap":false},"3.3.23":{"name":"@mihanizm56/fetch-api","version":"3.3.23","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","colors":"1.4.0","json-mask":"1.0.2","node-fetch":"2.6.1","query-string":"6.13.1"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.1","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript":"3.8.3","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"gitHead":"577e3cbfbd1a317b609aa375aca97d5c3daafb9f","_id":"@mihanizm56/fetch-api@3.3.23","_nodeVersion":"12.13.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-t/HtuiZyeMmCDUoKfXdRQ/zq1FL7ZtUUsJeYTwXdqaRzg3LvuRdecRdQYjzQBqRAOndG3q/XBM0YEhEV06ctcQ==","shasum":"03ac9a70aa1954e8f2b59a723841796722ce5398","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.3.23.tgz","fileCount":64,"unpackedSize":110599,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfn++fCRA9TVsSAnZWagAAoaIP/1ZgV/sgpZEtLFyWAqSl\nb8MeGp2TsmD+Mj5Tz/dP+nLiEjGxdVNVXZLFGykGbWgiU65Oeg+TXgxCdBF2\nhIipoJYG7eA1v473AbndIc5ft/GTWQhAc0Z7CJ6MT5QHfGfbRUG+zFx0UuCI\noIK2+cULzCzdp7OJi740n7JddZpopX5VvjLT7QzK985H+1JQ+GZfPSQQbPXO\nbquVBWkHi5O5MNoD5X3g0XKw/CBeGSgZFKQvHKFP4aJOfY8tEBIJ1AZYO0a6\nAv1rPzBrKfK8/AWWZgfXVCuJiHjImam9dUmXih2viOEZgm0MU/jfcW4EU/5F\nBhqvB/RWhMFWazLMDNZjC3yP8AY9nQMR3svdsDtiaxlAvNWTLkILmc1cWNBL\nR0qPwmi+ittZyWKhom8YLlQVkJr7btynsS/padkB7eLc+H/3vga5pb8MZxWV\nHT+hXNYxQOgrSpHKM5MmTZAHjRUv6DYzfjQpQPCieaWJaN2X7L17fv6W35MH\nQVErwfOEcatHye1AXqFp0n+pMIcudAlBhTf4/GooiQ2EN5kTbnSKMqSsfIlh\n6gL7K7oU0HLJ/wd3QVB4dOQhZ9szbztdrxDsPrirl6KMPt8SEuJ4RmykbMKz\nhUy6qdV083cUJA2Xd37Q+s0Z/icbRjzYs3gZMaZqlBb8PtWNvUZ65/6qHhTG\ndxa4\r\n=21lx\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD32WAfruFI1+/5MCQegwcvJouvEZ3tmDHK7VtN9S7A/QIhAKdqjb+SViVbY+YyTFs9wygP1SKrAzSQYDk3DtWniywj"}]},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.3.23_1604317081121_0.34063189981028463"},"_hasShrinkwrap":false},"3.4.0":{"name":"@mihanizm56/fetch-api","version":"3.4.0","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"6.13.7"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.1","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript":"3.8.3","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && npm run lint && npm run packages-vulnerability-check && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"gitHead":"b4014c8fef24306096a09387470d77105ce0d977","_id":"@mihanizm56/fetch-api@3.4.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-vYOpIrJ7Fhq2wfbIPQZQN4GLz4aANg44X/rJLugKjPlHw+qVfCdO7GlDBlVL3FMIuE0UnvbVdd8Z73P+ny4ZPw==","shasum":"aea626c5889564b7b30849e1d912e12050dea0bd","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.4.0.tgz","fileCount":66,"unpackedSize":113385,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfqFwvCRA9TVsSAnZWagAAjDcQAJ6ExrYvgSCtlNAKuuu7\nygUlbuGRzLeTPF6N4oA9+cm1Rbmw6juc9LoohqbA2oCRZnOYpuBNj7vgvCO+\ngylKQgYGC9r3ZPTTx93JRWec3Yr/Nar+VgqrjsiPo0LRX3HfU9ylWZtW90Kn\n/+sXfELkFW+UlPCpWsu5ZenpPEipV3VJQwTjAE9KHwh3w8UDH+fSgCGWCLFv\nAj9UOfIFEPLYaF/2PaaCDQWE562Y0nRascpTTsnUGs9VjMF58cQvz3e1++9y\nh8BU/nS+zS/1Bpr/pZaJYKSS/zdE8YqnmV4iahpH3sJVzGXPG7UGGT4gyz+H\n1rJqwdWeySfd5i0l7ceev5vlmeb38VMMCZCManmGkevc5sWxwpHOynfMhbGM\nrCrGykCFTNTarmkqeK2lKgLJgTn4cs2hNZBlIWl55FkRTQxhhJKimazO53CK\nT9V5CfFusTM7GWVyfEL0omDIV7t4PgO4WPcHem5fa/b6U354uAxPu/FSk46b\nu4ad//DNY4zurf9cvvCN6bnBo7jcvoJG8AfaAs9sH17Z3PIzItgPz5egl8xL\nSgVTUxiFVYrOd6np/p+D9FOWUXXsEjOfO9EUmjUukie97vu+3sNGgMZwNM0X\naTz+t48dKfD/f0hbJuD1EOB0u6fEv86uk2HM+LcgSM60AymAD0ODX+vwB+RU\ndnPP\r\n=CwpK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEpXF3tAsw+m7JABNUZbLOs/5yGU8VcbbtX1+eV4rVBRAiAIKqMIjRFkR37cDuLIfi0VflUsmJrh+Cz34vNTFxhoLQ=="}]},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.4.0_1604869166969_0.24461371349830952"},"_hasShrinkwrap":false},"3.4.1":{"name":"@mihanizm56/fetch-api","version":"3.4.1","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"6.13.7"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.1","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript":"3.8.3","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && npm run lint && npm run packages-vulnerability-check && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"gitHead":"4aa53d3f1d6aa83b64450339cb3851a77cada8cd","_id":"@mihanizm56/fetch-api@3.4.1","_nodeVersion":"12.13.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-dCzo3TJoyvc6Rs2ltzC1DGeRGu1tckPeJXWb8jUAhZp5wjtECFs0s0rogGrbLEVDhXyNU1Gzo2F/r6CXiBbjig==","shasum":"7f9ec3d5b206dc7f4c72aec1d2560f998fa4792c","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.4.1.tgz","fileCount":66,"unpackedSize":113465,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfq69UCRA9TVsSAnZWagAAJv0P+gMnAHEAcpGZqAXhMPNh\nhuOB+yhO4vDhdfqWsOB1tI3jep5M0psTs26VCXVaYbrHFHCkM9b2lsIvfTCS\nmq8L9QDXHbdZx4Xy3iE2tgcBXF6CihbPkqMJuXqeWCymf7bW3SQG6dfwzLTW\nyQ7oDz7T87AyZxo2+NqktyjKF2XMtP96Y1h3fpSUj4RRBRIBqA9clHWQ1NDn\nyi94/gQz0rcUrwDtX4Z6KbTzOlh+ND6gCJ0uQJ8gQtjxTTtEyHClWy1FlLTT\nwTmE8k7Jqnh7KRbGmFX3LbWqLot2v9rWWjZlTMKz/EaRgHqbxghQExo94IGw\nkAw2bA9PRnvq2naNrkr0lgml4AmSX1vV6s1e2FFq9leZ8f3mWbcROkPQBM/c\nWBXqCYWnbasc+lXA4o9Lc1kMZcU7Qy2G3zFBLngB5ukVtAHb8XGjk8t3ZezB\nlORPwbsIBtj7piHK6vcAyAQ+KtBdLwZZx+FD/1m1vnkwbJ1Kfaax5fvENc7v\nlgUWCOTLq9c43sXo/6PWiV/cULkQUiogB7x3jSrQ9Q1hqFd9/zlKg9046wde\n0Ohqyse845/vpRiFrAgEx1hkt1yi+yFe0A8P6KZT3/7Run1uZbYRZH62aFMc\nQmIL7KaozdGKew1wZ7RawMVAGCQknTASF/TynrFZyaEXNdayyDIgCDgonTpA\nAXsw\r\n=5IFs\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHHeRhnZv/GbNM92IViMAClnXjZtmqlQCEp6AIKg25XLAiEA6LZx0f/HL3RDztyLF9eI9esEPGxd2jbb1ExZmg+u5UU="}]},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.4.1_1605087060005_0.6887859378745966"},"_hasShrinkwrap":false},"3.4.2-beta.1":{"name":"@mihanizm56/fetch-api","version":"3.4.2-beta.1","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"6.13.7"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.1","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript":"3.8.3","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && npm run lint && npm run packages-vulnerability-check && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for the isomorphic fetch\n\n### Benefits:\n\n- Provides validation for responses (based on @hapi/joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services)\nhttps://www.npmjs.com/package/query-string is used\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in\n  hard-structured responce format or not (both interfaces are the same)\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n- Provides the ability to handle the response progress\n- Provides the ability to select necessary fields from the response (json-mask library used)\n- Provides the ability to use persistent params for all requests\n\n#### Request input options:\n\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use @hapi/joi\n- customTimeout(number) - milliseconds for cancel the request on timeout\n\n#### Request output options:\n\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n\n- body will be serialized in JSON if body data NOT FormData\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n## Examples of usage\n\n### REST API\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### get request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          })\n        ),\n      }),\n    }),\n  });\n```\n\n#### get request with response fields selection (Be ensure that selected field is guarded with the responseSchema)\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    selectData: 'username,password', // the output will be {data:{ username, password }, etc...}\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          })\n        ),\n      }),\n    }),\n    progressOptions: {\n      onLoaded: (total) => console.log(total) \n      // onLoaded callback will be called after \n      // the whole response will be done\n      // WARNING - not availiable on nodejs environment\n      onProgress: ({ total, current}) => console.log(total, current)\n      // onProgress callback will be triggered during the response progress\n      // till the response will be done\n      // WARNING - not availiable on nodejs environment\n    },\n  });\n```\n\n\n#### get request with PROGRESS callbacks\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          })\n        ),\n      }),\n    }),\n    progressOptions: {\n      onLoaded: (total) => console.log(total) \n      // onLoaded callback will be called after \n      // the whole response will be done\n      // WARNING - not availiable on nodejs environment\n      onProgress: ({ total, current}) => console.log(total, current)\n      // onProgress callback will be triggered during the response progress\n      // till the response will be done\n      // WARNING - not availiable on nodejs environment\n    },\n  });\n```\n\n#### get request with blob parse\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getPhotoRequest = (): Promise<IResponse> =>\n  new RestRequest().getBlobRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    responseSchema: Joi.any()\n  });\n```\n\n#### get PURE REST request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { PureRestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new PureRestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          })\n        ),\n      }),\n    }),\n  });\n```\n\n#### post(put/patch/delete have the same format) request\n\n```javascript\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    body: someData,\n    mode: \"cors\",\n    queryParams: {\n      id: \"test_id_123\",\n    },\n    headers: {\n      \"Content-Type\": \"application/json\",\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\")),\n    }),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createReviseRequest(\n  someData\n);\n```\n\n### JSON-RPC API\n\n```javascript\nimport { JSONRPCRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createItemsRequest = (someData): Promise<IResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint: \"http://localhost:3000\",\n    body: {\n      method: 'some method',\n      params: 123\n    }\n    queryParams: {\n      stringId: \"123\"\n      someArray: ['1', 1, '2', 2],\n      numberId: 100\n    },\n    responseSchema: Joi.object({\n      items: Joi.array().items(\n        Joi.object({\n          id: Joi.string().required(),\n          name: Joi.string().required(),\n          name: Joi.string()\n        })\n      )\n    }),\n  });\n```\n\n### JSON-RPC API (with batching)\n\n```javascript\nimport { JSONRPCRequest, IResponse } from \"@mihanizm56/fetch-api\";\nimport Joi from '@hapi/joi'\n\nconst responseSchemaObjectOne = Joi.object({\n  foo: Joi.string().required(),\n});\n\nconst responseSchemaObjectTwo = Joi.object({\n  foo: Joi.string().required(),\n});\n\nexport const createItemsRequest = (someData): Promise<IResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint:\n      'http://localhost:8080/json-rpc/positive?batch=true&twoSchemas=true',\n    body: [\n      { method: 'listCountries', params: {} },\n      { method: 'listCountries', params: {} },\n    ],\n    isBatchRequest: true,\n    responseSchema: [responseSchemaObjectOne, responseSchemaObjectTwo],\n  });\n```\n\n#### Please, be careful. The response will be the object:\n```javascript\n{\n  error: boolean,\n  data: Array<IResponse>,\n  additionalErrors: null,\n  errorText: string,\n  code: number\n}\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n\n#### Cancelling the request\n\n```javascript\nimport { RestRequest, IResponse, ABORT_REQUEST_EVENT_NAME } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    body: someData,\n    abortRequestId: '1',\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\")),\n    }),\n  });\n);\n\ndocument.dispatchEvent(\n  new CustomEvent(ABORT_REQUEST_EVENT_NAME, {\n    detail: { id: '1' },\n  }),\n);\n```\n\n#### Set persist options to all requests\n\n```javascript\nimport { FetchProxyMaker } from \"@mihanizm56/fetch-api\";\n\nnew FetchProxyMaker().setPersistentOptions(() => ({\n  headers: {\n    foo: 'bar',\n  },\n}));\n```\n","readmeFilename":"README.md","gitHead":"5f503d27013f527ce17f844f463639fe11d898a8","_id":"@mihanizm56/fetch-api@3.4.2-beta.1","_nodeVersion":"12.13.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-riTWsAVsh5Mk1Ky3aWzM8RgyJVBrjwsqZxgEaeAALELVnTcB7AFSupVD036019ScqgE80Umt2Vc3F8pEqL4+SQ==","shasum":"bd3b1dc47d2d77309d80d7880db1e6325a8d8e54","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.4.2-beta.1.tgz","fileCount":66,"unpackedSize":113496,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfq7HrCRA9TVsSAnZWagAA9J4P/RHOtgSTQvTJeMkJgZ6O\nDWp9KtEh9nfb9ZCYsFa65BcpzP8TTC4Oj9tP9bUmcCkhOYrMm0BMsqLJN70t\n+vRf1ZgFtoqZ2s7zIUH95v4pkkXzwPqtgaGVB33uJx5j69puuXkEAmd20m57\nMSewpqBxDWgmHtbClaO+koItR3mQb9A6j/U64MjMGakdNghJCK2t8bZXFVBe\nA1VSDh7z1rhzzEtaufT+q0LKryo7nWY4Ma6xOzDnowgU6VJB5tUp1pekSmJD\nRNtn2TUJlR/WGdPcjGDs+VkImGubhNBtcBUr6Pa4NNF93p0S0NcOf6lJneCr\nNuX3WLFnGU54CFh8f3XXH5f6URJBnK6Hb3BV2be6wVQ7wv8+5Ggg6NZ2ybqd\nw4dGJI7/qbGNoMjj4C8IafgEiMQTd8wuwGYqtY5ebOZ5Y15ZazZPRzANDgV/\nioo0YTMU852bnvdmMjiScLfhmjHeGcEvCFbowJBnIpHhb2D4EJIkst+j6fW1\nAmZKerSKXWSPt67H7MPsCwYi0Bu2uNJ0ePZxNoDWYGurYamI40uBd2/wquzs\ntPVvQHcQtdy4e6daF9nd9z5jMDjbUtXDc3WE7EM/Nbd+VfMAJPLXhyAZO0un\nQpcTWtwWR5BZhQTIimNpS/QyIvWiXeHepJ+cYecPUgjpBvvD38cmYjYoy/jE\nF8V2\r\n=omWQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCHzzFMwta3Mmc8ydBOp5VAO7NUsZKtFNS3pt79VLBVa0CIQCJSNN8LPMcHkRazqq6ro85ZuUPm/rCMgWrr9FDcpNZ6A=="}]},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.4.2-beta.1_1605087722800_0.21548184090645983"},"_hasShrinkwrap":false},"3.4.2-beta.2":{"name":"@mihanizm56/fetch-api","version":"3.4.2-beta.2","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"6.13.7"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.1","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript":"3.8.3","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && npm run lint && npm run packages-vulnerability-check && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for the isomorphic fetch\n\n### Benefits:\n\n- Provides validation for responses (based on @hapi/joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services)\nhttps://www.npmjs.com/package/query-string is used\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in\n  hard-structured responce format or not (both interfaces are the same)\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n- Provides the ability to handle the response progress\n- Provides the ability to select necessary fields from the response (json-mask library used)\n- Provides the ability to use persistent params for all requests\n\n#### Request input options:\n\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use @hapi/joi\n- customTimeout(number) - milliseconds for cancel the request on timeout\n\n#### Request output options:\n\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n\n- body will be serialized in JSON if body data NOT FormData\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n## Examples of usage\n\n### REST API\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### get request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          })\n        ),\n      }),\n    }),\n  });\n```\n\n#### get request with response fields selection (Be ensure that selected field is guarded with the responseSchema)\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    selectData: 'username,password', // the output will be {data:{ username, password }, etc...}\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          })\n        ),\n      }),\n    }),\n    progressOptions: {\n      onLoaded: (total) => console.log(total) \n      // onLoaded callback will be called after \n      // the whole response will be done\n      // WARNING - not availiable on nodejs environment\n      onProgress: ({ total, current}) => console.log(total, current)\n      // onProgress callback will be triggered during the response progress\n      // till the response will be done\n      // WARNING - not availiable on nodejs environment\n    },\n  });\n```\n\n\n#### get request with PROGRESS callbacks\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          })\n        ),\n      }),\n    }),\n    progressOptions: {\n      onLoaded: (total) => console.log(total) \n      // onLoaded callback will be called after \n      // the whole response will be done\n      // WARNING - not availiable on nodejs environment\n      onProgress: ({ total, current}) => console.log(total, current)\n      // onProgress callback will be triggered during the response progress\n      // till the response will be done\n      // WARNING - not availiable on nodejs environment\n    },\n  });\n```\n\n#### get request with blob parse\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getPhotoRequest = (): Promise<IResponse> =>\n  new RestRequest().getBlobRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    responseSchema: Joi.any()\n  });\n```\n\n#### get PURE REST request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { PureRestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new PureRestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          })\n        ),\n      }),\n    }),\n  });\n```\n\n#### post(put/patch/delete have the same format) request\n\n```javascript\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    body: someData,\n    mode: \"cors\",\n    queryParams: {\n      id: \"test_id_123\",\n    },\n    headers: {\n      \"Content-Type\": \"application/json\",\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\")),\n    }),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createReviseRequest(\n  someData\n);\n```\n\n### JSON-RPC API\n\n```javascript\nimport { JSONRPCRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createItemsRequest = (someData): Promise<IResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint: \"http://localhost:3000\",\n    body: {\n      method: 'some method',\n      params: 123\n    }\n    queryParams: {\n      stringId: \"123\"\n      someArray: ['1', 1, '2', 2],\n      numberId: 100\n    },\n    responseSchema: Joi.object({\n      items: Joi.array().items(\n        Joi.object({\n          id: Joi.string().required(),\n          name: Joi.string().required(),\n          name: Joi.string()\n        })\n      )\n    }),\n  });\n```\n\n### JSON-RPC API (with batching)\n\n```javascript\nimport { JSONRPCRequest, IResponse } from \"@mihanizm56/fetch-api\";\nimport Joi from '@hapi/joi'\n\nconst responseSchemaObjectOne = Joi.object({\n  foo: Joi.string().required(),\n});\n\nconst responseSchemaObjectTwo = Joi.object({\n  foo: Joi.string().required(),\n});\n\nexport const createItemsRequest = (someData): Promise<IResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint:\n      'http://localhost:8080/json-rpc/positive?batch=true&twoSchemas=true',\n    body: [\n      { method: 'listCountries', params: {} },\n      { method: 'listCountries', params: {} },\n    ],\n    isBatchRequest: true,\n    responseSchema: [responseSchemaObjectOne, responseSchemaObjectTwo],\n  });\n```\n\n#### Please, be careful. The response will be the object:\n```javascript\n{\n  error: boolean,\n  data: Array<IResponse>,\n  additionalErrors: null,\n  errorText: string,\n  code: number\n}\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n\n#### Cancelling the request\n\n```javascript\nimport { RestRequest, IResponse, ABORT_REQUEST_EVENT_NAME } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    body: someData,\n    abortRequestId: '1',\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\")),\n    }),\n  });\n);\n\ndocument.dispatchEvent(\n  new CustomEvent(ABORT_REQUEST_EVENT_NAME, {\n    detail: { id: '1' },\n  }),\n);\n```\n\n#### Set persist options to all requests\n\n```javascript\nimport { FetchProxyMaker } from \"@mihanizm56/fetch-api\";\n\nnew FetchProxyMaker().setPersistentOptions(() => ({\n  headers: {\n    foo: 'bar',\n  },\n}));\n```\n","readmeFilename":"README.md","gitHead":"0ddc3d3ccdfafc7353fd4fc1eca259d83f801667","_id":"@mihanizm56/fetch-api@3.4.2-beta.2","_nodeVersion":"12.13.0","_npmVersion":"6.14.9","dist":{"integrity":"sha512-GL+Zt6jmOmEUeShz3WL9WRNtiTzIph6iX+7ShtFQr1Pp4jkj2dwFnicB1+qOPB3Xq7FcNM3IBYou8r4FMYcqfw==","shasum":"7430f18580c1abc85144033646ae700fc956413c","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.4.2-beta.2.tgz","fileCount":66,"unpackedSize":113526,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfvUf/CRA9TVsSAnZWagAAV4QP/2UptNpIw0zMO7yAJt9t\n6qNiMvAq9AnMgqzvy45kYDLbw0a/EBQXk5ttIUa2ixNFYbVejwrQ6/VVA31u\nhfXNMJ6tU7P85w4UI+E2gIVzp2kHBWlzpobCZ5NGYVIQx6Jt3bWUl/1jKrLv\nS0WN4s8bH8kdoFo8qbbZebelA9gcs9GvHojjZTkRclxotukYIMVuh9CXTW8G\nScxvjSOxQyQTaMZJm/ZrD8PNvunxPOV3CJoFmFGGXC7uZPYwD/eFmkSeAqjG\n97HljF2fPxeM7onVPMaDV7xFDb/8sSbvjrAGjpua4fclWaDn7hXOqoz8B43l\n6q+tMJUrY0cOryEh6WH8p4gHLOAWhDfntI3XVWSvYvODWWnGfCxddx6ji6d9\n5jmw85I0jlj6QBJEghKZYBMx+sCYW7NztgYB9JG8W5lDZXBQsnqoGB8LxEmd\nh4smWetoMxQ7hjZ7hxliNCaqy++NAznXJ9/Ejarc8aP/+z+CVahX2tvktk/L\n8VbCWwxLyhGa4GesxTP+urSMLO239Sk1M6B1zFoQoeoJ2HO2OQN4gODmzBhN\ncIKezkz2e9QHcJDUF9+ysYeJwRJAjBk/fnzFvn2rHNQLlLSn0dLQTaJjt6FR\namrsfajv5CICZecDMB74bhBuOz+MAnG9k2P1C8SAOQtNC0d92Efu+lBIE9xc\nhxm1\r\n=tO2H\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDcF+OS+CVoZKjCI3MNJYegfsOjOVlzFX4W2Y8ku+nS9AiEA2vBMpktCEit0f1ttUwbfYXjiR/FTDQwXxg4L063VIlA="}]},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.4.2-beta.2_1606240255366_0.7411974847522445"},"_hasShrinkwrap":false},"3.4.2":{"name":"@mihanizm56/fetch-api","version":"3.4.2","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"6.13.7"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.1","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript":"3.8.3","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && npm run lint && npm run packages-vulnerability-check && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"gitHead":"4b61ed207370e3ccb3da2c74496d12afc2ff53e5","_id":"@mihanizm56/fetch-api@3.4.2","_nodeVersion":"12.13.0","_npmVersion":"6.14.9","dist":{"integrity":"sha512-mfDdi+e1LZcGScvfja2r+HwBvULoduKRUC+PxVSy5rPVirICnAtXw6QMtAK6PRbilcr0ZUeNgo/8avQTDvDcJQ==","shasum":"38d15aaea381c971eb76bb10efd5560554d03e3d","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.4.2.tgz","fileCount":66,"unpackedSize":113519,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfvUhVCRA9TVsSAnZWagAA70IQAJBSiFuhz+QnOlEQBPuy\nOahwT08zS7aQh9Jy2QnE4172VpHbaya72iBbcXGhynk5pha0Je2C5uNjTXfl\nzHFxX4j+PCI2e50O9bMJOnPDLrwhomhZtvx5zoMY99loAjEIPSOPld2r7sws\n043thLJxPjRYBtFIIPYHsqCxSEJ2U4O8Hs1Wa0VC3OIQlrNKUL0dM5DnVIxG\nfOidu+RcgGNjZ+lR2wxVFKIKcBQ8pjKghNsCYIMl9qoS40nINm8bhG5UJ5Zx\n8Y1u9duFQtpReNxkUQ3A8Tzs1Ini+j0Po+FBPaINR4Y2ImogcLP+sRtCLK4b\ngy/WLNCwalkzVQZD6X6ExpE2vyLkVVlLtdRKzf8ZtWGxfpZJD9IAL3hHz0JW\nkBZp/RdPXuTgSFpc1H23JvKopmgJfMLxlxsu5LIhHKjsjLu1+vsWfO9RzD6J\n/qVlNmiljaz6jtaKJL5Zs0h2LtmitC5bw+0I7wAv2K0exrIT03TsHtE9dfkc\nf0Jy8owK5qdgYv518m2HS8C6AkfJv4En5iDOam66x6UwEmybMkOKXSIhsMUM\nDZYiG9Z+SLIGLVPcrBfxohdbPSOUzveouzfr0Ze7TQh3r2Lz2cgwwHeK1H6P\n7m1EmLks1LGiWDShdtGcHkBoqg7YdGm1dvb98RUT3f0mrlydbhyswxlb8hX3\nWUkr\r\n=omyy\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDjeudgtHxezgYY6e7rrP4Ao0aWVdrXgzoNnwOQKMYCFQIgBsCG15dL4wz6L0a9OYCF+jYseTD/zUcROAExhDq6qkg="}]},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.4.2_1606240340506_0.3141981479077025"},"_hasShrinkwrap":false},"3.4.3-beta.1":{"name":"@mihanizm56/fetch-api","version":"3.4.3-beta.1","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"6.13.7"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.1","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript":"3.8.3","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && npm run lint && npm run packages-vulnerability-check && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for the isomorphic fetch\n\n### Benefits:\n\n- Provides validation for responses (based on @hapi/joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services)\nhttps://www.npmjs.com/package/query-string is used\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in\n  hard-structured responce format or not (both interfaces are the same)\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n- Provides the ability to handle the response progress\n- Provides the ability to select necessary fields from the response (json-mask library used)\n- Provides the ability to use persistent params for all requests\n\n#### Request input options:\n\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use @hapi/joi\n- customTimeout(number) - milliseconds for cancel the request on timeout\n\n#### Request output options:\n\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n\n- body will be serialized in JSON if body data NOT FormData\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n## Examples of usage\n\n### REST API\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### get request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          })\n        ),\n      }),\n    }),\n  });\n```\n\n#### get request with response fields selection (Be ensure that selected field is guarded with the responseSchema)\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    selectData: 'username,password', // the output will be {data:{ username, password }, etc...}\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          })\n        ),\n      }),\n    }),\n    progressOptions: {\n      onLoaded: (total) => console.log(total) \n      // onLoaded callback will be called after \n      // the whole response will be done\n      // WARNING - not availiable on nodejs environment\n      onProgress: ({ total, current}) => console.log(total, current)\n      // onProgress callback will be triggered during the response progress\n      // till the response will be done\n      // WARNING - not availiable on nodejs environment\n    },\n  });\n```\n\n\n#### get request with PROGRESS callbacks\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          })\n        ),\n      }),\n    }),\n    progressOptions: {\n      onLoaded: (total) => console.log(total) \n      // onLoaded callback will be called after \n      // the whole response will be done\n      // WARNING - not availiable on nodejs environment\n      onProgress: ({ total, current}) => console.log(total, current)\n      // onProgress callback will be triggered during the response progress\n      // till the response will be done\n      // WARNING - not availiable on nodejs environment\n    },\n  });\n```\n\n#### get request with blob parse\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getPhotoRequest = (): Promise<IResponse> =>\n  new RestRequest().getBlobRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    responseSchema: Joi.any()\n  });\n```\n\n#### get PURE REST request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { PureRestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new PureRestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          })\n        ),\n      }),\n    }),\n  });\n```\n\n#### post(put/patch/delete have the same format) request\n\n```javascript\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    body: someData,\n    mode: \"cors\",\n    queryParams: {\n      id: \"test_id_123\",\n    },\n    headers: {\n      \"Content-Type\": \"application/json\",\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\")),\n    }),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createReviseRequest(\n  someData\n);\n```\n\n### JSON-RPC API\n\n```javascript\nimport { JSONRPCRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createItemsRequest = (someData): Promise<IResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint: \"http://localhost:3000\",\n    body: {\n      method: 'some method',\n      params: 123\n    }\n    queryParams: {\n      stringId: \"123\"\n      someArray: ['1', 1, '2', 2],\n      numberId: 100\n    },\n    responseSchema: Joi.object({\n      items: Joi.array().items(\n        Joi.object({\n          id: Joi.string().required(),\n          name: Joi.string().required(),\n          name: Joi.string()\n        })\n      )\n    }),\n  });\n```\n\n### JSON-RPC API (with batching)\n\n```javascript\nimport { JSONRPCRequest, IResponse } from \"@mihanizm56/fetch-api\";\nimport Joi from '@hapi/joi'\n\nconst responseSchemaObjectOne = Joi.object({\n  foo: Joi.string().required(),\n});\n\nconst responseSchemaObjectTwo = Joi.object({\n  foo: Joi.string().required(),\n});\n\nexport const createItemsRequest = (someData): Promise<IResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint:\n      'http://localhost:8080/json-rpc/positive?batch=true&twoSchemas=true',\n    body: [\n      { method: 'listCountries', params: {} },\n      { method: 'listCountries', params: {} },\n    ],\n    isBatchRequest: true,\n    responseSchema: [responseSchemaObjectOne, responseSchemaObjectTwo],\n  });\n```\n\n#### Please, be careful. The response will be the object:\n```javascript\n{\n  error: boolean,\n  data: Array<IResponse>,\n  additionalErrors: null,\n  errorText: string,\n  code: number\n}\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n\n#### Cancelling the request\n\n```javascript\nimport { RestRequest, IResponse, ABORT_REQUEST_EVENT_NAME } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    body: someData,\n    abortRequestId: '1',\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\")),\n    }),\n  });\n);\n\ndocument.dispatchEvent(\n  new CustomEvent(ABORT_REQUEST_EVENT_NAME, {\n    detail: { id: '1' },\n  }),\n);\n```\n\n#### Set persist options to all requests\n\n```javascript\nimport { FetchProxyMaker } from \"@mihanizm56/fetch-api\";\n\nnew FetchProxyMaker().setPersistentOptions(() => ({\n  headers: {\n    foo: 'bar',\n  },\n}));\n```\n","readmeFilename":"README.md","gitHead":"ba571a90618b8b3f68bc718664ded21018ce4883","_id":"@mihanizm56/fetch-api@3.4.3-beta.1","_nodeVersion":"12.13.0","_npmVersion":"6.14.9","dist":{"integrity":"sha512-oM5+9CvWlof7Vs9unB91KPoM/GstxB0due9YJ2q00vUnFv4ReWawU0L+t3qQelBVGBPSfzw1cuc0ecWU1JT/tQ==","shasum":"5a13618e5e9a2f54d081dadb3c75f93e27d0d7ce","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.4.3-beta.1.tgz","fileCount":66,"unpackedSize":113935,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfxMWoCRA9TVsSAnZWagAA1boP/RPTLpIAjPERpOooT3i+\nc8kpm1duHvdiSeKWqSOjMe3fYGHvu+soY5H8xaecn1BU6W+QjZsgXOOsghSy\nj9+ybk1LCvMK+ekQiAe5+oq3L1Kf2DkGypvo00slqYV/frlIXQksmlnzSgCv\nirRQrOWIeRFw8GxFktLE2WZvyezZM7X8hgRg6bxVKrOX0CpFu0Q7o1Va8Yjr\nmkJUo17U8bL9AIZ7Brs3ISdG1FRvwz9dWF2ejKVkNilVJWqQFoQIaE7WOKOo\nc9ltb+60j0Eq+S2Rz6937VqsPVtO2nnlPrTTBFt7qbEcxudEXhhJdPCKnIdz\nZilNM3w3cEHW12yK6VBYI1QOsnYK3l41B7VOpcFSb6ZplVxH4tz+gF/rw0Dw\nCqIWLpj3jAa0bF+ryAdeK8X8i5wLQSqQptFLaRPzQ7s+3wf8tRmMJ7miihtv\nQ2RU067W5YKmB3wctQgdO4q/I9kXTevO4EEDmRnYt24vUZ+mvdoYAkRJOWcV\nNT/auZFwjIzn6fGP2tg2vn8LTwFeHnvuTWAwITB5lzmCaeGcCu5vyHBFf9cx\niFjYOtVPhjeulnN51ViuQTHvkzqL5Mg85vovpJSasKZ0QoAVpXOlqRjGpyBA\nJOirBDL+KB0UxNHSJ8f/PhFLBLZnoPXh+yk8oXDh/O0qbv9F6A3BS7/rxZC9\nKuAQ\r\n=EGn6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIH6pFLonrwFFuh7H7rewUebGbVx+Sqhb3vMeUrkdA1UwAiB6pwde9zSdlYT8FvQPbZwvVBwjiLBJJLwfT0GUZOUXKA=="}]},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.4.3-beta.1_1606731176399_0.8328396792958013"},"_hasShrinkwrap":false},"3.4.3-beta.2":{"name":"@mihanizm56/fetch-api","version":"3.4.3-beta.2","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"6.13.7"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.1","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript":"3.8.3","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && npm run lint && npm run packages-vulnerability-check && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for the isomorphic fetch\n\n### Benefits:\n\n- Provides validation for responses (based on @hapi/joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services)\nhttps://www.npmjs.com/package/query-string is used\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in\n  hard-structured responce format or not (both interfaces are the same)\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n- Provides the ability to handle the response progress\n- Provides the ability to select necessary fields from the response (json-mask library used)\n- Provides the ability to use persistent params for all requests\n\n#### Request input options:\n\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use @hapi/joi\n- customTimeout(number) - milliseconds for cancel the request on timeout\n\n#### Request output options:\n\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n\n- body will be serialized in JSON if body data NOT FormData\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n## Examples of usage\n\n### REST API\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### get request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          })\n        ),\n      }),\n    }),\n  });\n```\n\n#### get request with response fields selection (Be ensure that selected field is guarded with the responseSchema)\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    selectData: 'username,password', // the output will be {data:{ username, password }, etc...}\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          })\n        ),\n      }),\n    }),\n    progressOptions: {\n      onLoaded: (total) => console.log(total) \n      // onLoaded callback will be called after \n      // the whole response will be done\n      // WARNING - not availiable on nodejs environment\n      onProgress: ({ total, current}) => console.log(total, current)\n      // onProgress callback will be triggered during the response progress\n      // till the response will be done\n      // WARNING - not availiable on nodejs environment\n    },\n  });\n```\n\n\n#### get request with PROGRESS callbacks\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          })\n        ),\n      }),\n    }),\n    progressOptions: {\n      onLoaded: (total) => console.log(total) \n      // onLoaded callback will be called after \n      // the whole response will be done\n      // WARNING - not availiable on nodejs environment\n      onProgress: ({ total, current}) => console.log(total, current)\n      // onProgress callback will be triggered during the response progress\n      // till the response will be done\n      // WARNING - not availiable on nodejs environment\n    },\n  });\n```\n\n#### get request with blob parse\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getPhotoRequest = (): Promise<IResponse> =>\n  new RestRequest().getBlobRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    responseSchema: Joi.any()\n  });\n```\n\n#### get PURE REST request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { PureRestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new PureRestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          })\n        ),\n      }),\n    }),\n  });\n```\n\n#### post(put/patch/delete have the same format) request\n\n```javascript\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    body: someData,\n    mode: \"cors\",\n    queryParams: {\n      id: \"test_id_123\",\n    },\n    headers: {\n      \"Content-Type\": \"application/json\",\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\")),\n    }),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createReviseRequest(\n  someData\n);\n```\n\n### JSON-RPC API\n\n```javascript\nimport { JSONRPCRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createItemsRequest = (someData): Promise<IResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint: \"http://localhost:3000\",\n    body: {\n      method: 'some method',\n      params: 123\n    }\n    queryParams: {\n      stringId: \"123\"\n      someArray: ['1', 1, '2', 2],\n      numberId: 100\n    },\n    responseSchema: Joi.object({\n      items: Joi.array().items(\n        Joi.object({\n          id: Joi.string().required(),\n          name: Joi.string().required(),\n          name: Joi.string()\n        })\n      )\n    }),\n  });\n```\n\n### JSON-RPC API (with batching)\n\n```javascript\nimport { JSONRPCRequest, IResponse } from \"@mihanizm56/fetch-api\";\nimport Joi from '@hapi/joi'\n\nconst responseSchemaObjectOne = Joi.object({\n  foo: Joi.string().required(),\n});\n\nconst responseSchemaObjectTwo = Joi.object({\n  foo: Joi.string().required(),\n});\n\nexport const createItemsRequest = (someData): Promise<IResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint:\n      'http://localhost:8080/json-rpc/positive?batch=true&twoSchemas=true',\n    body: [\n      { method: 'listCountries', params: {} },\n      { method: 'listCountries', params: {} },\n    ],\n    isBatchRequest: true,\n    responseSchema: [responseSchemaObjectOne, responseSchemaObjectTwo],\n  });\n```\n\n#### Please, be careful. The response will be the object:\n```javascript\n{\n  error: boolean,\n  data: Array<IResponse>,\n  additionalErrors: null,\n  errorText: string,\n  code: number\n}\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n\n#### Cancelling the request\n\n```javascript\nimport { RestRequest, IResponse, ABORT_REQUEST_EVENT_NAME } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    body: someData,\n    abortRequestId: '1',\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\")),\n    }),\n  });\n);\n\ndocument.dispatchEvent(\n  new CustomEvent(ABORT_REQUEST_EVENT_NAME, {\n    detail: { id: '1' },\n  }),\n);\n```\n\n#### Set persist options to all requests\n\n```javascript\nimport { FetchProxyMaker } from \"@mihanizm56/fetch-api\";\n\nnew FetchProxyMaker().setPersistentOptions(() => ({\n  headers: {\n    foo: 'bar',\n  },\n}));\n```\n","readmeFilename":"README.md","gitHead":"7120496dfc9ef4048ba5e6e6add30d8660f90dba","_id":"@mihanizm56/fetch-api@3.4.3-beta.2","_nodeVersion":"12.13.0","_npmVersion":"6.14.9","dist":{"integrity":"sha512-uDwH1VUi2ZDF1RPXWjVKoRmvkUME42LZKL+Ld+m/AT9bOFZTiNxFnqxlGoe+kkzmyqEl3a/HBOTzlXJuMa0EvA==","shasum":"4aca6f3f251fa30dc124aac7cf79d2bb8df34737","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.4.3-beta.2.tgz","fileCount":66,"unpackedSize":113935,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfxMaOCRA9TVsSAnZWagAAnDAP/j0RkHGU1nkZgQM/DQBn\njKG1ZTEX3PoTTPoLlCVf31a8GcCjKJGSCeOxl0v0maLMTx4gCcCerJe1eG9v\nZzkjm4cnDubjE7L20EarN0uWhs1d0gTdxGRbTG7i8fTVjP1tpsGHzv4Xd2mF\n0LSR4FuT4jLaJ4SbAbDKYH/KR8Tg40AzWcJjAOmOQy69/b2IGmmNyzMO7gVg\nJ2j71I6QzkX1LeDowqPOO76D71c3t3DOeC5gAvk5Oc2AotM+NilUfqHyNYLG\nwjSvCRzKv41tcDfyuzwuOYg/gUdbXSIZKo3RLxupXX4KY03jKJLMDMsyVLF4\nMPsaTy7+5mdt96jyUWaQzlEZQ8Tz7J1480WceOWtSLrijPRDp1oBSmu+DBj9\njP5uWpWk+2W9qoOtPkadtn4z00DwiGcAcy/s28XzEyN7UAMcqZXrUhkxFaEE\nqklQQF7MRvZYzODz+NmNYoO/ZAQiUlIRzBCM0esaWJD+cyKAGLN3DAo0ub2j\nRzLLN6hgnEr9+0thN9J7RrLgmlqzEqeONtvffu8ibKy+AuxB356LtxgDvFzu\nSVts82xriZJTcAh9uD7y/urJUAp7bArDTb+jIm9wzwa7FbTbL225awE7I5OW\nerOKII1KQc64mQWFm8oDNXCLsyyezXfUVu/9BL86zsLSCz/mw9LY+LzDDnvw\n10G6\r\n=t2Ee\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC/TdCxo5AHKPlHuQSlf8ChHxNiFrFeUU721NsRlNt8XAIgQ6itLH6cQ1Sh//k2L0j6DogocNny3ShRubfDikYCiyc="}]},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.4.3-beta.2_1606731406354_0.6448920164695553"},"_hasShrinkwrap":false},"3.4.3-beta.3":{"name":"@mihanizm56/fetch-api","version":"3.4.3-beta.3","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"6.13.7"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.1","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript":"3.8.3","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && npm run lint && npm run packages-vulnerability-check && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for the isomorphic fetch\n\n### Benefits:\n\n- Provides validation for responses (based on @hapi/joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services)\nhttps://www.npmjs.com/package/query-string is used\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in\n  hard-structured responce format or not (both interfaces are the same)\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n- Provides the ability to handle the response progress\n- Provides the ability to select necessary fields from the response (json-mask library used)\n- Provides the ability to use persistent params for all requests\n\n#### Request input options:\n\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use @hapi/joi\n- customTimeout(number) - milliseconds for cancel the request on timeout\n\n#### Request output options:\n\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n\n- body will be serialized in JSON if body data NOT FormData\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n## Examples of usage\n\n### REST API\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### get request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          })\n        ),\n      }),\n    }),\n  });\n```\n\n#### get request with response fields selection (Be ensure that selected field is guarded with the responseSchema)\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    selectData: 'username,password', // the output will be {data:{ username, password }, etc...}\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          })\n        ),\n      }),\n    }),\n    progressOptions: {\n      onLoaded: (total) => console.log(total) \n      // onLoaded callback will be called after \n      // the whole response will be done\n      // WARNING - not availiable on nodejs environment\n      onProgress: ({ total, current}) => console.log(total, current)\n      // onProgress callback will be triggered during the response progress\n      // till the response will be done\n      // WARNING - not availiable on nodejs environment\n    },\n  });\n```\n\n\n#### get request with PROGRESS callbacks\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          })\n        ),\n      }),\n    }),\n    progressOptions: {\n      onLoaded: (total) => console.log(total) \n      // onLoaded callback will be called after \n      // the whole response will be done\n      // WARNING - not availiable on nodejs environment\n      onProgress: ({ total, current}) => console.log(total, current)\n      // onProgress callback will be triggered during the response progress\n      // till the response will be done\n      // WARNING - not availiable on nodejs environment\n    },\n  });\n```\n\n#### get request with blob parse\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getPhotoRequest = (): Promise<IResponse> =>\n  new RestRequest().getBlobRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    responseSchema: Joi.any()\n  });\n```\n\n#### get PURE REST request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { PureRestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new PureRestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          })\n        ),\n      }),\n    }),\n  });\n```\n\n#### post(put/patch/delete have the same format) request\n\n```javascript\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    body: someData,\n    mode: \"cors\",\n    queryParams: {\n      id: \"test_id_123\",\n    },\n    headers: {\n      \"Content-Type\": \"application/json\",\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\")),\n    }),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createReviseRequest(\n  someData\n);\n```\n\n### JSON-RPC API\n\n```javascript\nimport { JSONRPCRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createItemsRequest = (someData): Promise<IResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint: \"http://localhost:3000\",\n    body: {\n      method: 'some method',\n      params: 123\n    }\n    queryParams: {\n      stringId: \"123\"\n      someArray: ['1', 1, '2', 2],\n      numberId: 100\n    },\n    responseSchema: Joi.object({\n      items: Joi.array().items(\n        Joi.object({\n          id: Joi.string().required(),\n          name: Joi.string().required(),\n          name: Joi.string()\n        })\n      )\n    }),\n  });\n```\n\n### JSON-RPC API (with batching)\n\n```javascript\nimport { JSONRPCRequest, IResponse } from \"@mihanizm56/fetch-api\";\nimport Joi from '@hapi/joi'\n\nconst responseSchemaObjectOne = Joi.object({\n  foo: Joi.string().required(),\n});\n\nconst responseSchemaObjectTwo = Joi.object({\n  foo: Joi.string().required(),\n});\n\nexport const createItemsRequest = (someData): Promise<IResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint:\n      'http://localhost:8080/json-rpc/positive?batch=true&twoSchemas=true',\n    body: [\n      { method: 'listCountries', params: {} },\n      { method: 'listCountries', params: {} },\n    ],\n    isBatchRequest: true,\n    responseSchema: [responseSchemaObjectOne, responseSchemaObjectTwo],\n  });\n```\n\n#### Please, be careful. The response will be the object:\n```javascript\n{\n  error: boolean,\n  data: Array<IResponse>,\n  additionalErrors: null,\n  errorText: string,\n  code: number\n}\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n\n#### Cancelling the request\n\n```javascript\nimport { RestRequest, IResponse, ABORT_REQUEST_EVENT_NAME } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    body: someData,\n    abortRequestId: '1',\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\")),\n    }),\n  });\n);\n\ndocument.dispatchEvent(\n  new CustomEvent(ABORT_REQUEST_EVENT_NAME, {\n    detail: { id: '1' },\n  }),\n);\n```\n\n#### Set persist options to all requests\n\n```javascript\nimport { FetchProxyMaker } from \"@mihanizm56/fetch-api\";\n\nnew FetchProxyMaker().setPersistentOptions(() => ({\n  headers: {\n    foo: 'bar',\n  },\n}));\n```\n","readmeFilename":"README.md","gitHead":"7be7f3300cf68cfc471b3063e9d5ce48a7dff1b0","_id":"@mihanizm56/fetch-api@3.4.3-beta.3","_nodeVersion":"12.13.0","_npmVersion":"6.14.9","dist":{"integrity":"sha512-PrYaTRhfF+0q/FXOyhyWnNZ0VXN/nTv1E2Ej5RH6Iwyhc3V227JO0/qDVlur3S8tgeovdEW5vQOLuBbapNvIPA==","shasum":"34a881adf32aefeefce3b70abdf95ea42a96c26a","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.4.3-beta.3.tgz","fileCount":66,"unpackedSize":114268,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfxMowCRA9TVsSAnZWagAAjBYP/1864H1I1Ky5uPtnz4vq\nvbb8r7urgwO4WWmIHvNHC74vHAAVlHjUpy95teXxYqXhXaJsEUvUzTu3M6lH\nbIinCkofPR9nwQseZHmwDFYLwG+/JDizRBOIHCuBtBffiZl3ycCsF33uLanw\nGszI/Fw5gFgRqbx/4S7LYTEgbgLHO0XAOSJFw54zNuc3zDqDWEDZkjQh9D6x\no1gUsoZ74fRPHT3rLaLRAEPYK/PkDVw7VqXiq3VyJCwWLaojAtPGLuadiFwn\neB+Lb/tfSukzIblAqj9OlhhaYkeVLHvsaE5lmNODqu5yoeAqN62Zj/hd8tez\n1Ghox5jStujX7Qbyq6VTtS1TgrxiLjP9odu6bO9RSudElOypIKbriSKIR4+L\n6utzQs39DULjk4jeJGORS88rm/l0UqL5FYTWDzrwwAoRHTyeuVhhC3XDvXMd\nFvcmGuiNKyJOccMuamtxYRn9WOrlEHUaRpu5qOzHzRKNJnAoRFRBiDoA/amM\neY56R0wXc2zpZRN4z8DFqEdAYnmO0GvgzAsbYdkyFORPwNcs5DGOZ2jGCfTZ\nbpb/UtmMIuS9T9G3PbSNZNUkD0Ld1QFxs2nMOmMhTahvBsNM79z259GRA/Ua\nb85eh1r1xsQ3xJZRAqz49EL++5dInojHXwpnUCxGgPNfJNHI8HIGULQ4O/iu\ncqNU\r\n=D22s\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDXOSxcO/6L4g9e51d9edohDEEU0DLfQ3NFmJXTCp9QcQIhAIMWZYR2Wwss0BWtZqHtipj9gvBThUzZjFOxXJEoOHbk"}]},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.4.3-beta.3_1606732336402_0.7769349069229303"},"_hasShrinkwrap":false},"3.4.3":{"name":"@mihanizm56/fetch-api","version":"3.4.3","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","save":"npm run commit && git push && npm version patch && git push && npm run pub","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"6.13.7"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.1","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript":"3.8.3","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && npm run lint && npm run packages-vulnerability-check && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"gitHead":"e80c5ffbd12801f9482cb9258a6dd8b967cb4f7f","_id":"@mihanizm56/fetch-api@3.4.3","_nodeVersion":"12.13.0","_npmVersion":"6.14.9","dist":{"integrity":"sha512-wM9mGK9Wt0GndPefiQ5bpGLAKaXDf2m08uoO/eH2HiIN8i/9UUOGPDEw8fme3PNVd3VZU4ajaH8yKz8YmsuoAw==","shasum":"006201d38e4c0389032bc44053e6cffd4fb44e60","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.4.3.tgz","fileCount":66,"unpackedSize":114261,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfxOm4CRA9TVsSAnZWagAAJawP/302VrYIm60z+VHZSyaP\nG/y0oSdCvEJYWt7jnUi5iSZgj+20DD7gSdJvUiWpRi+mdRSw7L6c8g2Fu3GP\nGjSr1clCwCIkZ/6N7MBJyUe7uMQNQEiv5RH2CoxXMqg6e0SxhQ+CubUiRLdA\n0C8n2PphbAtIJ648LbfaI2MXrxd3tgD89IuqYfO4mlxnTRMh9Rd6JQ7tG+Pu\njRL8rzPRcvyb5jFORr9w9UAM0SHJx0n8zNoHPQvhVVkylnzsR2JRa3Ds6SMQ\n0fWJ8IcNVsxDzhOSWrk0l1nQdEIClx4oTAXkx/rE2IKdWFn62suLvMtNKBSa\nMYGz1yfPw8DItpPq1dScatg4MNIovUj6Vz4yvNRxnRl9kKUje0eEKrx7/O3h\ndxzR4x6rrZZwOVV6Ud5i946TdSv4LxB4akiDzy4rbpVC7wfKLiCdi+FMUjZa\nDw90YxYk9MSPfopEoHcRaX9v/tFIVjXnp5copSQLPE8WRXI4PCmOAUUkeA0N\n+A4DE7oxmtc1mtmfjw+Y2/cYXfBwkB1+LpQ4qkeVQdShLMs75+MgN/o1LeE0\nzOEbFapV3985AcQQpRjHjYAiTe78miLcY9323pRz4R4PeVXOiywbcAo67eqY\nlYqYxHltMt18w+4evEA7OeH/xQzLUpGiCiDD/dYbFCtfNkIcrlbBAJJbRqL7\n5mqe\r\n=qXXb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCrISGRcN9s/en4slo9JZy/cqNOSSr6EPvryrMw2/4YpAIhAITIKx+M1/Uo0z5rj7SaOn/1dGP3CZwf+BQoMMoluuKy"}]},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.4.3_1606740408370_0.26278261528511204"},"_hasShrinkwrap":false},"3.4.4-beta.1":{"name":"@mihanizm56/fetch-api","version":"3.4.4-beta.1","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"6.13.7"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.1","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript":"3.8.3","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && npm run lint && npm run packages-vulnerability-check && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for the isomorphic fetch\n\n### Benefits:\n\n- Provides validation for responses (based on @hapi/joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services)\nhttps://www.npmjs.com/package/query-string is used\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in\n  hard-structured responce format or not (both interfaces are the same)\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n- Provides the ability to handle the response progress\n- Provides the ability to select necessary fields from the response (json-mask library used)\n- Provides the ability to use persistent params for all requests\n\n#### Request input options:\n\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use @hapi/joi\n- customTimeout(number) - milliseconds for cancel the request on timeout\n\n#### Request output options:\n\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n\n- body will be serialized in JSON if body data NOT FormData\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n## Examples of usage\n\n### REST API\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### get request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          })\n        ),\n      }),\n    }),\n  });\n```\n\n#### get request with response fields selection (Be ensure that selected field is guarded with the responseSchema)\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    selectData: 'username,password', // the output will be {data:{ username, password }, etc...}\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          })\n        ),\n      }),\n    }),\n    progressOptions: {\n      onLoaded: (total) => console.log(total) \n      // onLoaded callback will be called after \n      // the whole response will be done\n      // WARNING - not availiable on nodejs environment\n      onProgress: ({ total, current}) => console.log(total, current)\n      // onProgress callback will be triggered during the response progress\n      // till the response will be done\n      // WARNING - not availiable on nodejs environment\n    },\n  });\n```\n\n\n#### get request with PROGRESS callbacks\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          })\n        ),\n      }),\n    }),\n    progressOptions: {\n      onLoaded: (total) => console.log(total) \n      // onLoaded callback will be called after \n      // the whole response will be done\n      // WARNING - not availiable on nodejs environment\n      onProgress: ({ total, current}) => console.log(total, current)\n      // onProgress callback will be triggered during the response progress\n      // till the response will be done\n      // WARNING - not availiable on nodejs environment\n    },\n  });\n```\n\n#### get request with blob parse\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getPhotoRequest = (): Promise<IResponse> =>\n  new RestRequest().getBlobRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    responseSchema: Joi.any()\n  });\n```\n\n#### get PURE REST request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { PureRestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new PureRestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          })\n        ),\n      }),\n    }),\n  });\n```\n\n#### post(put/patch/delete have the same format) request\n\n```javascript\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    body: someData,\n    mode: \"cors\",\n    queryParams: {\n      id: \"test_id_123\",\n    },\n    headers: {\n      \"Content-Type\": \"application/json\",\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\")),\n    }),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createReviseRequest(\n  someData\n);\n```\n\n### JSON-RPC API\n\n```javascript\nimport { JSONRPCRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createItemsRequest = (someData): Promise<IResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint: \"http://localhost:3000\",\n    body: {\n      method: 'some method',\n      params: 123\n    }\n    queryParams: {\n      stringId: \"123\"\n      someArray: ['1', 1, '2', 2],\n      numberId: 100\n    },\n    responseSchema: Joi.object({\n      items: Joi.array().items(\n        Joi.object({\n          id: Joi.string().required(),\n          name: Joi.string().required(),\n          name: Joi.string()\n        })\n      )\n    }),\n  });\n```\n\n### JSON-RPC API (with batching)\n\n```javascript\nimport { JSONRPCRequest, IResponse } from \"@mihanizm56/fetch-api\";\nimport Joi from '@hapi/joi'\n\nconst responseSchemaObjectOne = Joi.object({\n  foo: Joi.string().required(),\n});\n\nconst responseSchemaObjectTwo = Joi.object({\n  foo: Joi.string().required(),\n});\n\nexport const createItemsRequest = (someData): Promise<IResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint:\n      'http://localhost:8080/json-rpc/positive?batch=true&twoSchemas=true',\n    body: [\n      { method: 'listCountries', params: {} },\n      { method: 'listCountries', params: {} },\n    ],\n    isBatchRequest: true,\n    responseSchema: [responseSchemaObjectOne, responseSchemaObjectTwo],\n  });\n```\n\n#### Please, be careful. The response will be the object:\n```javascript\n{\n  error: boolean,\n  data: Array<IResponse>,\n  additionalErrors: null,\n  errorText: string,\n  code: number\n}\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n\n#### Cancelling the request\n\n```javascript\nimport { RestRequest, IResponse, ABORT_REQUEST_EVENT_NAME } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    body: someData,\n    abortRequestId: '1',\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\")),\n    }),\n  });\n);\n\ndocument.dispatchEvent(\n  new CustomEvent(ABORT_REQUEST_EVENT_NAME, {\n    detail: { id: '1' },\n  }),\n);\n```\n\n#### Set persist options to all requests\n\n```javascript\nimport { FetchProxyMaker } from \"@mihanizm56/fetch-api\";\n\nnew FetchProxyMaker().setPersistentOptions(() => ({\n  headers: {\n    foo: 'bar',\n  },\n}));\n```\n","readmeFilename":"README.md","gitHead":"c7f760ec2a20396fbb5b135a10af96cb759cd6da","_id":"@mihanizm56/fetch-api@3.4.4-beta.1","_nodeVersion":"12.13.0","_npmVersion":"6.14.9","dist":{"integrity":"sha512-YutmhfAB2gmaKTgqD+mQt1twR3bQCvXDRAAANTy0ZgHimoT0+1GxGknAaBYUi+oqNw3v3I2lhrigGmFLw26fbQ==","shasum":"ced962b47bf516efa00230b961cf36a2fe2ece29","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.4.4-beta.1.tgz","fileCount":66,"unpackedSize":115154,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf19yQCRA9TVsSAnZWagAAeqkP/RZJ1AmWU7lJPZbjhGXd\npoWjf98lBYCd6o4fu51bSOlVFa+qoRSoozctFf9wjOTRZPYu8gQXTziyPXwW\n4rSyBrL9pgLOL3bvkzn1ThPJrAlxM+81imyWZBOXOPfSGlCvbG9Ac+F1aExd\nl8xYrUiB5D/yuYdRRjLoGz9d0KXVuLxk0cbFFWb2aYiduojbhf64hWU5Wm8v\nLKVk8rW2V36uxncoICxtYkOZi9aeijFvLkxAgDuoWGfoN54wTSOGzaP8aPZV\nohR2pc+Y7l97M8FIFekxqmgXRxK1CyEJZvf95n3Olfd5qpmPcxOImQv/nQmo\n/wN43pQ8dU+inuSIcjQcK+3O9apazYQ8xICw605thw4/Q+dbGiyQE2EnFe8U\nSRGxvfWZUVoy8Gs+3X6w8/m+0JIGZ/PrxMz4titxNeQQhK8kpg6yXncAVODx\nVqz0i4twCyPeUEa65UWj3DZLc9S7buvxxtJCeL6Z8iFejQvlQx68va09xlx4\nkxY/+y4I/IVJxDAtZxuo31yNH0HbSjgNGEf5pTwZZ7wIM8fs2crcrKzkc3fP\nIuQpkzFLU3ApwPwo0fhLd9aGsXMpEjWaaQ8/qpOO0GgHCqu1UcwFkoT58xAX\n+GJDXDqAQWuE1gsillsM9s4cEBD4Za20BYyyutMr9Kh/h+nvt6D7u6gEfGDO\nyEU6\r\n=fCJd\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIApSks7+dgfb03kcBgxWmAz4fMspkfEX99GfVw82zSKjAiBCUWPB1VC9ACrzvhBi1T0UF82vYNsk3X+PSH/w+WWPBw=="}]},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.4.4-beta.1_1607982223833_0.8755111497085311"},"_hasShrinkwrap":false},"3.4.4":{"name":"@mihanizm56/fetch-api","version":"3.4.4","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"6.13.7"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.1","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript":"3.8.3","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && npm run lint && npm run packages-vulnerability-check && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"gitHead":"1aac23de99adbad7cc1a284ebdacf272ec1c8db0","_id":"@mihanizm56/fetch-api@3.4.4","_nodeVersion":"12.13.0","_npmVersion":"6.14.9","dist":{"integrity":"sha512-EEbKLhZomIxGwmV34Us2D7Rr3MvU9w7Nv9SiYJGoU013gw7m4p1T8kBqHamcp6LD+tpnqIgkXnmn0R+RKW2ywg==","shasum":"b300f14eeb3742d620fd557473cc3a0c5cfc3f11","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.4.4.tgz","fileCount":66,"unpackedSize":115147,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf193QCRA9TVsSAnZWagAAJ6IP/RB9cOFRID/3xLp3ISms\nsRruxHyOZKrPFCw5S8KVn60cyOHi6DLOHLnRoSomNwVMAQzYI2P+LquCCxwc\nWpN4qUxQzw/4p+dq2GohvkKQV9PL/JZgtM/VdVouKEoNYdy49S7xFHQ93XhM\nhTXf3jf6SCdG0MYZIuK6lYW18Il2PsI9WfCvaFBvU9uQK6l0tSpr/Lyp/tn8\nMRFH4o24BKSNVg9C9vubiupyK1lzXTPQVe3ys+U/uOpnU7qUTb0zXdnQFeZU\nDGsCt+M1eq+H80ZmesXUzt8wrUvF7/oFHrs7x3BQ66lPXEyDE8qDF/O7AG8f\nXeQ0GEfZprMqKJrVkt6iONbXWRZmjgohFFVD2t+JWSHUumcOUPqnwiCvbwU2\nbmI8AFs4MPdf3ZFB/aKRpZ/GYZd+F8KvaGKjT7I6XFfFEe+kN7WYGOFscqPn\nF38EOIc0PZWrXxMNtKGX72gJ3ucns+n/QnZke9Fo8G4u5T8VX3R7sn/Ehwh3\netE82gSlm2N50Goq+JtZh3mXGDYwedfmZdqnspvp1pKIRzIEvAuYfBEDjKbC\ngRqohQG3/okKH5/Z9AXMU/p2QcmNTyHHcHR7t9zQrVDsdTONubHgmOQP3ODt\nUy3cDEHaTkDySRw2H7TdwQZl+kICMwubaDlREzl/NTctgpoihQSIq2BCqQ/w\nJSjs\r\n=NSbo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICVJRMRfsZca1rCZUZMuo9gEs6Ch6wyUFRWfJpe8K4gAAiEA/fSJqk7GNqPAz0fBGdIveaebMnv90K9yFvLWT6ZmYNI="}]},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.4.4_1607982544352_0.01135543259640559"},"_hasShrinkwrap":false},"3.4.5":{"name":"@mihanizm56/fetch-api","version":"3.4.5","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"6.13.7"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.1","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript":"3.8.3","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && npm run lint && npm run packages-vulnerability-check && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"gitHead":"bf83c209abfcd0ef7615871fd956d81fe92bc419","_id":"@mihanizm56/fetch-api@3.4.5","_nodeVersion":"12.13.0","_npmVersion":"6.14.9","dist":{"integrity":"sha512-67WuJHTOcU9w/wcckSRTfutuU3fxPy6ksv7GO7oDkxsncQ0JkLqBfWEl+6wT/2kRZwEwTBq67WVojLhJIbKG1Q==","shasum":"560e169c4624fa959e5aef2e3cf18c81bdb11bf1","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.4.5.tgz","fileCount":66,"unpackedSize":115289,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf2VTkCRA9TVsSAnZWagAAdYMP/RKoI4ghdH6GicXv06dH\nUxapxfKrKuL+kxXkuG6s//DMaxhB2kNddFr5wvhzN+zVVDWmW2+QMzfC2Hi7\n9R0Jo+5+5hkc3NhlTE3MyAK2Jdk6IQLx75fNodhQE/LmKIIM1QzlbE92NpNs\n3rcCaK3X8dYlIe2zFqnuOhZOcJCrTOTWcDZRjUoz1YQ4E1MHfv2U+fF35GFD\nd8xPluUyTseWPHSWdSzG+kKCjAqnhu8CQz/kINyQNlD1lG5LhujoyU6t5cBj\nun+Op+qlsgTTxlp4fXT7TCLfMwow/85GNL4SQV+/9oSLJB1KgVoa61aiyeul\nBbwbZE1i3nFIKQwyrD+oRJtrdsHBRKxVbVxVBe+zhUDZISbSJFksjW/B7nx/\nncpI5EiZJi1lk4HwCTotj+XkYhiGsZx3063cgIEgMzq4vw2DxRHbWMc8A12U\nUQhCEmKmoX4n/HHAHV2JdZt04CRk+3XVJbn+BuMzrxS7H9uKrndVx6l1gm7n\n345PNShf/ZjajZaWD9L1BqSYM4NnzCPajmY/F6Zwel2wyRQw1d2SFO2qMcTv\nuSa9MLN3uQFZmh9KSK2w7AjkG+WwVj+CLWf+rqDtoKx2x8C2s9h1/txGV/eC\nZ/6pS+UEK9eSqh9NZdrnMuiQw8RttAkzfWFr+UvzC5dM/peZYojzLzYdGJYY\n5hI3\r\n=Q9XH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICMQtVe0Af5rk+dztJFQbtqBWGuvjTC6P4Eml5sfHALfAiAsYezBzD3U0Z5inyIUk9KCIVvPFVvahkZBZAIUjSUHlQ=="}]},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.4.5_1608078563802_0.17299321626499675"},"_hasShrinkwrap":false},"3.5.0-beta.1":{"name":"@mihanizm56/fetch-api","version":"3.5.0-beta.1","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"6.13.7"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.1","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript":"3.8.3","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && npm run lint && npm run packages-vulnerability-check && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for the isomorphic fetch\n\n### Benefits:\n\n- Provides validation for responses (based on @hapi/joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services)\nhttps://www.npmjs.com/package/query-string is used\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in\n  hard-structured responce format or not (both interfaces are the same)\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n- Provides the ability to handle the response progress\n- Provides the ability to select necessary fields from the response (json-mask library used)\n- Provides the ability to use persistent params for all requests\n\n#### Request input options:\n\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use @hapi/joi\n- customTimeout(number) - milliseconds for cancel the request on timeout\n\n#### Request output options:\n\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n\n- body will be serialized in JSON if body data NOT FormData\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n## Examples of usage\n\n### REST API\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### get request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          })\n        ),\n      }),\n    }),\n  });\n```\n\n#### get request with response fields selection (Be ensure that selected field is guarded with the responseSchema)\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    selectData: 'username,password', // the output will be {data:{ username, password }, etc...}\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          })\n        ),\n      }),\n    }),\n    progressOptions: {\n      onLoaded: (total) => console.log(total) \n      // onLoaded callback will be called after \n      // the whole response will be done\n      // WARNING - not availiable on nodejs environment\n      onProgress: ({ total, current}) => console.log(total, current)\n      // onProgress callback will be triggered during the response progress\n      // till the response will be done\n      // WARNING - not availiable on nodejs environment\n    },\n  });\n```\n\n\n#### get request with PROGRESS callbacks\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          })\n        ),\n      }),\n    }),\n    progressOptions: {\n      onLoaded: (total) => console.log(total) \n      // onLoaded callback will be called after \n      // the whole response will be done\n      // WARNING - not availiable on nodejs environment\n      onProgress: ({ total, current}) => console.log(total, current)\n      // onProgress callback will be triggered during the response progress\n      // till the response will be done\n      // WARNING - not availiable on nodejs environment\n    },\n  });\n```\n\n#### get request with blob parse\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getPhotoRequest = (): Promise<IResponse> =>\n  new RestRequest().getBlobRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    responseSchema: Joi.any()\n  });\n```\n\n#### get PURE REST request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { PureRestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new PureRestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          })\n        ),\n      }),\n    }),\n  });\n```\n\n#### post(put/patch/delete have the same format) request\n\n```javascript\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    body: someData,\n    mode: \"cors\",\n    queryParams: {\n      id: \"test_id_123\",\n    },\n    headers: {\n      \"Content-Type\": \"application/json\",\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\")),\n    }),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createReviseRequest(\n  someData\n);\n```\n\n### JSON-RPC API\n\n```javascript\nimport { JSONRPCRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createItemsRequest = (someData): Promise<IResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint: \"http://localhost:3000\",\n    body: {\n      method: 'some method',\n      params: 123\n    }\n    queryParams: {\n      stringId: \"123\"\n      someArray: ['1', 1, '2', 2],\n      numberId: 100\n    },\n    responseSchema: Joi.object({\n      items: Joi.array().items(\n        Joi.object({\n          id: Joi.string().required(),\n          name: Joi.string().required(),\n          name: Joi.string()\n        })\n      )\n    }),\n  });\n```\n\n### JSON-RPC API (with batching)\n\n```javascript\nimport { JSONRPCRequest, IResponse } from \"@mihanizm56/fetch-api\";\nimport Joi from '@hapi/joi'\n\nconst responseSchemaObjectOne = Joi.object({\n  foo: Joi.string().required(),\n});\n\nconst responseSchemaObjectTwo = Joi.object({\n  foo: Joi.string().required(),\n});\n\nexport const createItemsRequest = (someData): Promise<IResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint:\n      'http://localhost:8080/json-rpc/positive?batch=true&twoSchemas=true',\n    body: [\n      { method: 'listCountries', params: {} },\n      { method: 'listCountries', params: {} },\n    ],\n    isBatchRequest: true,\n    responseSchema: [responseSchemaObjectOne, responseSchemaObjectTwo],\n  });\n```\n\n#### Please, be careful. The response will be the object:\n```javascript\n{\n  error: boolean,\n  data: Array<IResponse>,\n  additionalErrors: null,\n  errorText: string,\n  code: number\n}\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n\n#### Cancelling the request\n\n```javascript\nimport { RestRequest, IResponse, ABORT_REQUEST_EVENT_NAME } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    body: someData,\n    abortRequestId: '1',\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\")),\n    }),\n  });\n);\n\ndocument.dispatchEvent(\n  new CustomEvent(ABORT_REQUEST_EVENT_NAME, {\n    detail: { id: '1' },\n  }),\n);\n```\n\n#### Set persist options to all requests\n\n```javascript\nimport { FetchProxyMaker } from \"@mihanizm56/fetch-api\";\n\nnew FetchProxyMaker().setPersistentOptions(() => ({\n  headers: {\n    foo: 'bar',\n  },\n}));\n```\n","readmeFilename":"README.md","gitHead":"7e9f1366277f54fac92c7c2e7386dcf0503441e4","_id":"@mihanizm56/fetch-api@3.5.0-beta.1","_nodeVersion":"12.13.0","_npmVersion":"6.14.9","dist":{"integrity":"sha512-d3LcLp9824abACxrK3ogScXvlNAruHfIEsxKJ/P/x55Bs3FTCyef/Dd7l958w3+6gqoO7vEKynoKutPi70rGMA==","shasum":"376e6264c4d3789ee25f67c9b356517dc596f4b9","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.5.0-beta.1.tgz","fileCount":66,"unpackedSize":115665,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf5ljPCRA9TVsSAnZWagAAjG4P/3xxnXQrJM+/VgMoOP0H\nVkjZzfXyFuX5CmPG4vXDj71Crc5V2TdEMKoJPqUr1H+2+etfZmW0XMq2pgdg\nQWR694QCuSquaPEgrfy9OBsJNYCro3ay59GWbpLtHaB8Yy8shUgRi9ql4mlJ\nFxV+lCRPT9EjvuMFgn4qGuiieV+LIzLpIyVy7xVxWYRRqYhDBMGhuDzk0ImM\nZfqLmUDEWXaVLB8R1TRiR2JJoucHH04Vg169AvvOoeaLaDyngolnrnY0RLF1\nf+AyCjbdEDjcwG76AxDWPy74ttrhPZwlGHW1PdazfHg5qeRc1XxMq0wSPR4v\nF3cb6Wc5Oh8ecJec5xMLr45jJTTx5IHHCX9o9CKwlVPd319TjRXuJu1EdrhH\nSd1qSY42cKLsDgryy+Y2u3QZeclx5eQ2j1ZeHnhJ/imrrVAKlAqWBmhL5Dnj\n12ipboAh/eO3BDASZBB6bY2nEYHoPNY/pEyQgKrHBPA06V+lwHBqNlL0chLX\nlJQTxXWrnqbLkBwD90gtUCgqW7qYJwNPU/ZYHvFzYfTtbJZ7jc4IL+XHx7Ir\n1wgUtMpceL6eiIALeZYuFYGKtP7TJUMD/FA2l8V+nDBoDHrNwWxBM1FKCMj5\nzge2d8Zm5ZrCiyZ3YWrhvImVl+3Wvw2kcCytUwQvDebX754uEEvQEkKuNgQ4\nhEOI\r\n=MVhY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFJvJJwNzoe1OvAWTXhawx1wrmsTGFuhIZ510CVo8b2CAiBbN1yNnBaiMbAjPXVFSdj9jGLe4R8foFGZXAvVlF1rvg=="}]},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.5.0-beta.1_1608931535052_0.7752061858809858"},"_hasShrinkwrap":false},"3.5.0-beta.2":{"name":"@mihanizm56/fetch-api","version":"3.5.0-beta.2","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"6.13.7"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@types/jest":"24.9.1","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.1","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript":"3.8.3","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && npm run lint && npm run packages-vulnerability-check && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for the isomorphic fetch\n\n### Benefits:\n\n- Provides validation for responses (based on @hapi/joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services)\nhttps://www.npmjs.com/package/query-string is used\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in\n  hard-structured responce format or not (both interfaces are the same)\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n- Provides the ability to handle the response progress\n- Provides the ability to select necessary fields from the response (json-mask library used)\n- Provides the ability to use persistent params for all requests\n\n#### Request input options:\n\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use @hapi/joi\n- customTimeout(number) - milliseconds for cancel the request on timeout\n\n#### Request output options:\n\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n\n- body will be serialized in JSON if body data NOT FormData\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n## Examples of usage\n\n### REST API\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### get request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          })\n        ),\n      }),\n    }),\n  });\n```\n\n#### get request with response fields selection (Be ensure that selected field is guarded with the responseSchema)\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    selectData: 'username,password', // the output will be {data:{ username, password }, etc...}\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          })\n        ),\n      }),\n    }),\n    progressOptions: {\n      onLoaded: (total) => console.log(total) \n      // onLoaded callback will be called after \n      // the whole response will be done\n      // WARNING - not availiable on nodejs environment\n      onProgress: ({ total, current}) => console.log(total, current)\n      // onProgress callback will be triggered during the response progress\n      // till the response will be done\n      // WARNING - not availiable on nodejs environment\n    },\n  });\n```\n\n\n#### get request with PROGRESS callbacks\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          })\n        ),\n      }),\n    }),\n    progressOptions: {\n      onLoaded: (total) => console.log(total) \n      // onLoaded callback will be called after \n      // the whole response will be done\n      // WARNING - not availiable on nodejs environment\n      onProgress: ({ total, current}) => console.log(total, current)\n      // onProgress callback will be triggered during the response progress\n      // till the response will be done\n      // WARNING - not availiable on nodejs environment\n    },\n  });\n```\n\n#### get request with blob parse\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getPhotoRequest = (): Promise<IResponse> =>\n  new RestRequest().getBlobRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    responseSchema: Joi.any()\n  });\n```\n\n#### get PURE REST request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { PureRestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new PureRestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          })\n        ),\n      }),\n    }),\n  });\n```\n\n#### post(put/patch/delete have the same format) request\n\n```javascript\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    body: someData,\n    mode: \"cors\",\n    queryParams: {\n      id: \"test_id_123\",\n    },\n    headers: {\n      \"Content-Type\": \"application/json\",\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\")),\n    }),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createReviseRequest(\n  someData\n);\n```\n\n### JSON-RPC API\n\n```javascript\nimport { JSONRPCRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createItemsRequest = (someData): Promise<IResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint: \"http://localhost:3000\",\n    body: {\n      method: 'some method',\n      params: 123\n    }\n    queryParams: {\n      stringId: \"123\"\n      someArray: ['1', 1, '2', 2],\n      numberId: 100\n    },\n    responseSchema: Joi.object({\n      items: Joi.array().items(\n        Joi.object({\n          id: Joi.string().required(),\n          name: Joi.string().required(),\n          name: Joi.string()\n        })\n      )\n    }),\n  });\n```\n\n### JSON-RPC API (with batching)\n\n```javascript\nimport { JSONRPCRequest, IResponse } from \"@mihanizm56/fetch-api\";\nimport Joi from '@hapi/joi'\n\nconst responseSchemaObjectOne = Joi.object({\n  foo: Joi.string().required(),\n});\n\nconst responseSchemaObjectTwo = Joi.object({\n  foo: Joi.string().required(),\n});\n\nexport const createItemsRequest = (someData): Promise<IResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint:\n      'http://localhost:8080/json-rpc/positive?batch=true&twoSchemas=true',\n    body: [\n      { method: 'listCountries', params: {} },\n      { method: 'listCountries', params: {} },\n    ],\n    isBatchRequest: true,\n    responseSchema: [responseSchemaObjectOne, responseSchemaObjectTwo],\n  });\n```\n\n#### Please, be careful. The response will be the object:\n```javascript\n{\n  error: boolean,\n  data: Array<IResponse>,\n  additionalErrors: null,\n  errorText: string,\n  code: number\n}\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n\n#### Cancelling the request\n\n```javascript\nimport { RestRequest, IResponse, ABORT_REQUEST_EVENT_NAME } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    body: someData,\n    abortRequestId: '1',\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\")),\n    }),\n  });\n);\n\ndocument.dispatchEvent(\n  new CustomEvent(ABORT_REQUEST_EVENT_NAME, {\n    detail: { id: '1' },\n  }),\n);\n```\n\n#### Set persist options to all requests\n\n```javascript\nimport { FetchProxyMaker } from \"@mihanizm56/fetch-api\";\n\nnew FetchProxyMaker().setPersistentOptions(() => ({\n  headers: {\n    foo: 'bar',\n  },\n}));\n```\n","readmeFilename":"README.md","gitHead":"2d4c8b6a98878b63c946bfc4e73e1f809e7cb9d6","_id":"@mihanizm56/fetch-api@3.5.0-beta.2","_nodeVersion":"12.13.0","_npmVersion":"6.14.9","dist":{"integrity":"sha512-+plClKn0TyjwqpHhGbZCSujOYVZ9x4+b+F/NSaAjHF1WNNu9/jgIXopzo9lfwbgC7M1JCSauedHnjKRZwEzjrQ==","shasum":"524f3885b89f55ee727d3bc700ab4af9f6137aeb","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.5.0-beta.2.tgz","fileCount":66,"unpackedSize":115603,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf5337CRA9TVsSAnZWagAAbGQP/3v5be6QJIcFNtJdkEmm\nGeK0jqFTP7PKBg2B5HKtajNZrOMVX9uPVIcwR6CbL77tJ2xsHNrUwVCSm9k3\n4rrnG4o605F44eyDLcJONbDmmVrJQTRFzrGpcYUu//GS7lFNuukMJLkc7eO4\n9yPw5UdckAdCK9eKGh62oFzAy2GWjhlkLztQOHypA//pxy4K5ZPxAKCk5Cg0\nAL/1LI8DtKndpS0xO6Av/xyyPHwupEEDAT/b4kZ3bbEz1KtmArWGXVAfTFRD\n88chUpGc7AOhrfJPI433VMUL5pIRA1Pd5bX2SAe66q/vJGAR+ZchMrbJMT9o\n3h6W8+6MdAin4+7hjTVn/MC5+OUXIod7mqWjl2YiF9VJYIm0fQYGGpumlIjQ\nElDRw8HuVrtOvMO9TaSKxT2skhsoFTd0bT6vkn/5fjKfVtktgCPbtaa6EoqN\n5EGDLzngwPn+7HGTvLtikyLviqNryvNvIlhxq3IYBCw9djOKbFAe4wtx3z3a\nkhOS+vOrufXCPPkYhsK3692K4rg9kZt8jdnQiP6PoZlIcPQj1eTbob/J7Ubw\nmDKSaDJcmZlTvNQcW2Hp/GNKX34Xlwflvhe9YCSE7KnL4W1Dzj+SmWT3TdaR\nmHO6DNZHt4DcpXKaGru76uLGeFTTrRoZz+Dmk1AsAhNFyXjUL7JvglObBXWY\nwY70\r\n=NRR1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCk44k7Ybs+gtOeKsnB5ueh2voV28+vRCEB6qItz6PyZgIgIPx0cIm+TfFYG2SbfdrBglyaKGV6TtlD60VKrOfL6x0="}]},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.5.0-beta.2_1609006586198_0.39315446296288625"},"_hasShrinkwrap":false},"3.5.0-beta.3":{"name":"@mihanizm56/fetch-api","version":"3.5.0-beta.3","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"6.13.7"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@types/jest":"24.9.1","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.1","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript":"3.9.3","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && npm run lint && npm run packages-vulnerability-check && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for the isomorphic fetch\n\n### Benefits:\n\n- Provides validation for responses (based on @hapi/joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services)\nhttps://www.npmjs.com/package/query-string is used\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in\n  hard-structured responce format or not (both interfaces are the same)\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n- Provides the ability to handle the response progress\n- Provides the ability to select necessary fields from the response (json-mask library used)\n- Provides the ability to use persistent params for all requests\n\n#### Request input options:\n\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use @hapi/joi\n- customTimeout(number) - milliseconds for cancel the request on timeout\n\n#### Request output options:\n\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n\n- body will be serialized in JSON if body data NOT FormData\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n## Examples of usage\n\n### REST API\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### get request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          })\n        ),\n      }),\n    }),\n  });\n```\n\n#### get request with response fields selection (Be ensure that selected field is guarded with the responseSchema)\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    selectData: 'username,password', // the output will be {data:{ username, password }, etc...}\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          })\n        ),\n      }),\n    }),\n    progressOptions: {\n      onLoaded: (total) => console.log(total) \n      // onLoaded callback will be called after \n      // the whole response will be done\n      // WARNING - not availiable on nodejs environment\n      onProgress: ({ total, current}) => console.log(total, current)\n      // onProgress callback will be triggered during the response progress\n      // till the response will be done\n      // WARNING - not availiable on nodejs environment\n    },\n  });\n```\n\n\n#### get request with PROGRESS callbacks\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          })\n        ),\n      }),\n    }),\n    progressOptions: {\n      onLoaded: (total) => console.log(total) \n      // onLoaded callback will be called after \n      // the whole response will be done\n      // WARNING - not availiable on nodejs environment\n      onProgress: ({ total, current}) => console.log(total, current)\n      // onProgress callback will be triggered during the response progress\n      // till the response will be done\n      // WARNING - not availiable on nodejs environment\n    },\n  });\n```\n\n#### get request with blob parse\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getPhotoRequest = (): Promise<IResponse> =>\n  new RestRequest().getBlobRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    responseSchema: Joi.any()\n  });\n```\n\n#### get PURE REST request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { PureRestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new PureRestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          })\n        ),\n      }),\n    }),\n  });\n```\n\n#### post(put/patch/delete have the same format) request\n\n```javascript\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    body: someData,\n    mode: \"cors\",\n    queryParams: {\n      id: \"test_id_123\",\n    },\n    headers: {\n      \"Content-Type\": \"application/json\",\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\")),\n    }),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createReviseRequest(\n  someData\n);\n```\n\n### JSON-RPC API\n\n```javascript\nimport { JSONRPCRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createItemsRequest = (someData): Promise<IResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint: \"http://localhost:3000\",\n    body: {\n      method: 'some method',\n      params: 123\n    }\n    queryParams: {\n      stringId: \"123\"\n      someArray: ['1', 1, '2', 2],\n      numberId: 100\n    },\n    responseSchema: Joi.object({\n      items: Joi.array().items(\n        Joi.object({\n          id: Joi.string().required(),\n          name: Joi.string().required(),\n          name: Joi.string()\n        })\n      )\n    }),\n  });\n```\n\n### JSON-RPC API (with batching)\n\n```javascript\nimport { JSONRPCRequest, IResponse } from \"@mihanizm56/fetch-api\";\nimport Joi from '@hapi/joi'\n\nconst responseSchemaObjectOne = Joi.object({\n  foo: Joi.string().required(),\n});\n\nconst responseSchemaObjectTwo = Joi.object({\n  foo: Joi.string().required(),\n});\n\nexport const createItemsRequest = (someData): Promise<IResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint:\n      'http://localhost:8080/json-rpc/positive?batch=true&twoSchemas=true',\n    body: [\n      { method: 'listCountries', params: {} },\n      { method: 'listCountries', params: {} },\n    ],\n    isBatchRequest: true,\n    responseSchema: [responseSchemaObjectOne, responseSchemaObjectTwo],\n  });\n```\n\n#### Please, be careful. The response will be the object:\n```javascript\n{\n  error: boolean,\n  data: Array<IResponse>,\n  additionalErrors: null,\n  errorText: string,\n  code: number\n}\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n\n#### Cancelling the request\n\n```javascript\nimport { RestRequest, IResponse, ABORT_REQUEST_EVENT_NAME } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    body: someData,\n    abortRequestId: '1',\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\")),\n    }),\n  });\n);\n\ndocument.dispatchEvent(\n  new CustomEvent(ABORT_REQUEST_EVENT_NAME, {\n    detail: { id: '1' },\n  }),\n);\n```\n\n#### Set persist options to all requests\n\n```javascript\nimport { FetchProxyMaker } from \"@mihanizm56/fetch-api\";\n\nnew FetchProxyMaker().setPersistentOptions(() => ({\n  headers: {\n    foo: 'bar',\n  },\n}));\n```\n","readmeFilename":"README.md","gitHead":"96b472ab811d7ae94653a7537e6870c627bddcc1","_id":"@mihanizm56/fetch-api@3.5.0-beta.3","_nodeVersion":"12.13.0","_npmVersion":"6.14.9","dist":{"integrity":"sha512-Rr/8a2aG+oVC2x7NWL1DLetlC01SHEb54NFm42EhPZjQOmdnEaCfhq1x5wRQ3c/We6c2acLzWOoIJIdHF/SYlQ==","shasum":"83991793581c12fa54e74b42cd8e341773edf42e","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.5.0-beta.3.tgz","fileCount":66,"unpackedSize":115953,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf54J+CRA9TVsSAnZWagAALOUP/ijOStlu2r/z/MKU/jlJ\n/BgCbGFowWQjny6GdIR0wKpB2fM1JgSeiLQoR+uvrPFw0xTE08uHs7wVlGg9\nt10Db8DVSx80XpGL7jMNpkLBKlzDLJ+QOg2rmCu1rSiuLG1v9RShFoUHyyqI\nHQx+qtnGBVUr8MmV/+nLQcBM9HxWAjZT1vupoLZBhW3gLQ5F3StL5vydjNG3\nFR95vmpWi3bLfzPNbtQjMXAKixCaq2M9wQcavNMcc8xLmXZtLJ0HtLlnHlSX\n6WOA4d/LnL7boBBkVwSGiFxUFpYcz/4zGZhrqX7ZZDWlsl1m7I8nExQdhV3w\nQ84prw/u1nq0J3Xay4PF1P7mdmkRi8BzeSnIV/C1JssVy99yUst8B3DpxN6/\n/cA1fwEtJ+szTU99DA2dO3tNlxKYVh7ecRWm2+gNZiWeYPdiRlAcNssz96wt\ngOVVbHNRWAoXWIFvlSSFtm/pL3AK4u44yoEnfN/dtGKD8P5HYY6+IwenWP8G\nS+a/cFQ+U4FYQepwLLyBz8gq+z1I3vQmZT+ZulDsFEjYKtERLFjzDN0EmmJ8\n/6yDsAX77xeEYHr93jR3AnFz6/K3rlU6/xcRF2nvF4augAQ2/0GfyIcuFcLv\ngQT3UfQGHcHGCGOersUkWbHKcUnJ/TxhTacprGiiqydpEhsGTgRR69PzL7wu\nFiQc\r\n=5PEO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAPhlHRtQsamVHxCo5Nb4LEnvAD2Mp0s1AOXwACyLhaHAiAOD1Z8yVsC9hyibMsAqIf3aojeBZzGc2qQBA5o3IZyAw=="}]},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.5.0-beta.3_1609007742229_0.8472670133430262"},"_hasShrinkwrap":false},"3.5.0-beta.4":{"name":"@mihanizm56/fetch-api","version":"3.5.0-beta.4","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"6.13.7"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@types/jest":"24.9.1","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.1","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript":"3.8.3","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && npm run lint && npm run packages-vulnerability-check && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for the isomorphic fetch\n\n### Benefits:\n\n- Provides validation for responses (based on @hapi/joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services, https://www.npmjs.com/package/query-string is used)\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in the\n  hard-structured response format\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n- Provides the ability to handle the response progress\n- Provides the ability to select necessary fields from the response (https://github.com/nemtsov/json-mask#readme used)\n- Provides the ability to use persistent params for all requests\n- Provides the ability to retry requests\n\n#### Request input options:\n\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use @hapi/joi\n- customTimeout(number) - milliseconds for cancel the request on timeout (or a number of requests if the \"retry\" parameter is activated) \n- retry - number of requests try to request if the response is negative\n\n#### Request output options:\n\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n\n- body will be serialized in JSON if body data NOT FormData\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n## Examples of usage\n\n### REST API\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### get request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          })\n        ),\n      }),\n    }),\n  });\n```\n\n#### get request with response fields selection (Be ensure that selected field is guarded with the responseSchema)\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    selectData: 'username,password', // the output will be {data:{ username, password }, etc...}\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          })\n        ),\n      }),\n    }),\n    progressOptions: {\n      onLoaded: (total) => console.log(total) \n      // onLoaded callback will be called after \n      // the whole response will be done\n      // WARNING - not availiable on nodejs environment\n      onProgress: ({ total, current}) => console.log(total, current)\n      // onProgress callback will be triggered during the response progress\n      // till the response will be done\n      // WARNING - not availiable on nodejs environment\n    },\n  });\n```\n\n\n#### get request with PROGRESS callbacks\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          })\n        ),\n      }),\n    }),\n    progressOptions: {\n      onLoaded: (total) => console.log(total) \n      // onLoaded callback will be called after \n      // the whole response will be done\n      // WARNING - not availiable on nodejs environment\n      onProgress: ({ total, current}) => console.log(total, current)\n      // onProgress callback will be triggered during the response progress\n      // till the response will be done\n      // WARNING - not availiable on nodejs environment\n    },\n  });\n```\n\n#### get request with blob parse\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getPhotoRequest = (): Promise<IResponse> =>\n  new RestRequest().getBlobRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    responseSchema: Joi.any()\n  });\n```\n\n#### get PURE REST request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { PureRestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new PureRestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          })\n        ),\n      }),\n    }),\n  });\n```\n\n#### post(put/patch/delete have the same format) request\n\n```javascript\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    body: someData,\n    mode: \"cors\",\n    queryParams: {\n      id: \"test_id_123\",\n    },\n    headers: {\n      \"Content-Type\": \"application/json\",\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\")),\n    }),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createReviseRequest(\n  someData\n);\n```\n\n### JSON-RPC API\n\n```javascript\nimport { JSONRPCRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createItemsRequest = (someData): Promise<IResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint: \"http://localhost:3000\",\n    body: {\n      method: 'some method',\n      params: 123\n    }\n    queryParams: {\n      stringId: \"123\"\n      someArray: ['1', 1, '2', 2],\n      numberId: 100\n    },\n    responseSchema: Joi.object({\n      items: Joi.array().items(\n        Joi.object({\n          id: Joi.string().required(),\n          name: Joi.string().required(),\n          name: Joi.string()\n        })\n      )\n    }),\n  });\n```\n\n### JSON-RPC API (with batching)\n\n```javascript\nimport { JSONRPCRequest, IResponse } from \"@mihanizm56/fetch-api\";\nimport Joi from '@hapi/joi'\n\nconst responseSchemaObjectOne = Joi.object({\n  foo: Joi.string().required(),\n});\n\nconst responseSchemaObjectTwo = Joi.object({\n  foo: Joi.string().required(),\n});\n\nexport const createItemsRequest = (someData): Promise<IResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint:\n      'http://localhost:8080/json-rpc/positive?batch=true&twoSchemas=true',\n    body: [\n      { method: 'listCountries', params: {} },\n      { method: 'listCountries', params: {} },\n    ],\n    isBatchRequest: true,\n    responseSchema: [responseSchemaObjectOne, responseSchemaObjectTwo],\n  });\n```\n\n#### Please, be careful. The response will be the object:\n```javascript\n{\n  error: boolean,\n  data: Array<IResponse>,\n  additionalErrors: null,\n  errorText: string,\n  code: number\n}\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n\n#### Cancelling the request\n\n```javascript\nimport { RestRequest, IResponse, ABORT_REQUEST_EVENT_NAME } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    body: someData,\n    abortRequestId: '1',\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\")),\n    }),\n  });\n);\n\ndocument.dispatchEvent(\n  new CustomEvent(ABORT_REQUEST_EVENT_NAME, {\n    detail: { id: '1' },\n  }),\n);\n```\n\n#### Set persist options to all requests\n\n```javascript\nimport { FetchProxyMaker } from \"@mihanizm56/fetch-api\";\n\nnew FetchProxyMaker().setPersistentOptions(() => ({\n  headers: {\n    foo: 'bar',\n  },\n}));\n```\n","readmeFilename":"README.md","gitHead":"18387804edb2781cd57753b354e63f4c19058371","_id":"@mihanizm56/fetch-api@3.5.0-beta.4","_nodeVersion":"12.13.0","_npmVersion":"6.14.9","dist":{"integrity":"sha512-q1Bhp9TwbRt1AfYXwhJxxWGD5K4mc00PgNTQxB+cv6aOpNCexuehXa+dVxus429DFvuB58rE9N71l07EhHP+Dw==","shasum":"443b38fa7cd1ad1b82554b1b3be8bd1dc860eae8","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.5.0-beta.4.tgz","fileCount":66,"unpackedSize":116101,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf6mL7CRA9TVsSAnZWagAAQeMP+QHdLDNg0GOtgnx2V/mf\nkDbUqoDeHsARha2BLgoRVCY6LGr67jqTUk6qaRbyJoo5bGlE48OsGYfLA65L\n560fpu1QTVYJ/0R9rv8lcoauEWILVacVAvsBi3JNAs9StLiqvWSYToCi+ws3\nR0IyvO9oVk0rEFDBINf5p9SSDxsQmeaORaQCONMCAlA8TeGiNW332Y36Ee8g\netGNEJt8epdggxIwhLPowLsJPZCOb4KrbUgajekk15+YdoQ8aY8tRGSg5xx3\n+WoiDgRYftNIc36Jzg3dSgqEwcR9FN86B1O5hGYvVqIiElR3MHmg6meJFGIt\n/hPoXpfLdX9iyaNa2whTs+7D5PLatXreNVdh86N6dIhziIvA/7J1Y3L7YJc6\nQ8Lev2+DUelWXG61Lkd4wyyJJWMBQfEAXsPPHB+X+RITAJLOieD8q0sSaSd8\nzSMS4PrN9f0aXfK+cQWEEIA2yqaHx8VTApDx2x2xw4Fv3nJrifx0x5eZfnjc\nosGqVLOM4qACtwisDfMJq3Bi0TyXHAJP+byI/4zVqu8b3ZHbkSN0geLiHo59\nDJmI6BCNsVvu1jv7UwLmgrF+oBxFX2mLOmFrvWYqx6G5ppsc1zGgZ2iIJZvl\n22BkW8Jxg5a0cFpn+FlDN7YeUqu+rLSPyo+N8veQ5qNkHxZM5MPMTUdo28Ij\nv9kz\r\n=cZWt\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDukrNOsiAmVgjgokg0nee2dL8sxEIC61EdnupGYR9yYQIhAMQIKMtPtZ65z7MJdipSAOWe58H4ebA4D9UnQ3XmGvq0"}]},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.5.0-beta.4_1609196282875_0.48206283804032934"},"_hasShrinkwrap":false},"3.5.0":{"name":"@mihanizm56/fetch-api","version":"3.5.0","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"6.13.7"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@types/jest":"24.9.1","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.1","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript":"3.8.3","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && npm run lint && npm run packages-vulnerability-check && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"gitHead":"29ae69daafe4d59edea01a7a7bf441297228f385","_id":"@mihanizm56/fetch-api@3.5.0","_nodeVersion":"12.13.0","_npmVersion":"6.14.10","dist":{"integrity":"sha512-nxh9GtCUlCxzmmDWK89dSxdOvXtsAFSid5zy2LySbOfVRlgPmKC3W5jPTDF2gUaz0d2i4hBYSvuBxF1X5A+ptQ==","shasum":"1f22fff5f6a40d7ab13f4027a0f22003c6dc6726","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.5.0.tgz","fileCount":66,"unpackedSize":116100,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf8KR+CRA9TVsSAnZWagAAg9EP/iYMfGE4ID6flJNWgdy0\nIDfZWF6ygAT5rAIeiDSNx+dZ6Q96EJhu84oTWHY7jVAKaat83/kl5D7pbcFg\ncZdjo7EYgFREXW8i0g9olNtsS+FzscfgxXgYkoO2OZ3etk0jv+DnEVc7UX0/\nQ55k0rmjm29ewvUSeyc4ZwOJdnuFP5UjCC915kGFW6n5Tc1CrZPLOTzjHI9x\nFGXorsrhysx3wJDmT033puU5pgRcKwfc+LSq+3aA6rEUVObES3b3qKrMnPWf\nBv7rP0tjWLlduQQ2sIQ+BsN9DnAijomDnCMjrBohJecHl3TR0SEMyBL8BzgB\nOMlAK1ooYHTS2xpiIRalt/6aOwV/4PlB/oejJoUUxSmAa6JTadkFKGqgo3dh\nMvwkwMGw8g/vdzIKsCsOnkKlHmf3evajdjruAaIZWMVXymw1hWH3NMj/MGhR\n2UC/1XiN2+mPVfthtuZ56DyqPeiRWPoKpAp8T700mnAoZELblG8lVYY09sVv\nCx8kmrFmohmInzpmrBrhnt5XH+PxfuJVVAga3WYfiQyZTBFjC7Upbfn/qvJ3\nG+uSL5pw74BNeqgJIyZovMqoTOJOkg3vkA744Vh6RGcKSB31zSFrm+Y3hbkN\nDl98eiamjpSrRhLY9GwyF2Hf0P3gbxx63i1ToNiP4CKlrDwR2k/l5lmKOJ0+\nId6v\r\n=51QR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCUW6q/0RYVR2CSmZJ/g3OkMntHNYHV/7UdcLEnz/rI5wIhANYnHYeYMYkzEi4o8QaRqM+0r62yBsMvuTgyvn9dQQiJ"}]},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.5.0_1609606269773_0.30596907073308044"},"_hasShrinkwrap":false},"3.5.1":{"name":"@mihanizm56/fetch-api","version":"3.5.1","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"6.13.7"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@types/jest":"24.9.1","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.1","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript":"3.8.3","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && npm run lint && npm run packages-vulnerability-check && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"gitHead":"45cb5caff3b32f1165bffdbf6827ab3ea33676c3","_id":"@mihanizm56/fetch-api@3.5.1","_nodeVersion":"12.13.0","_npmVersion":"6.14.10","dist":{"integrity":"sha512-WK1aeTu2qcsRUMPmLhft7BUGWfhzcxTKMOyzlCzzGl4nbqFPgWGvTrJh1rAqnR3ENzeuihtLHvs4aSUwFIksJg==","shasum":"e349868583f7a1a234530b9aeca034ac9747fe4e","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.5.1.tgz","fileCount":66,"unpackedSize":116196,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf8N8jCRA9TVsSAnZWagAAYFsQAJPX1JNAsNQGn9NQZmrL\nJ5moMEofbYeg6lSVEKgb1+avCuPhQzt4DomzV/+8dgz9pYIfIvXKizS+bvsj\nEDe72btZKRx+aMNF/AXRc+0RKg3goGNw0G2rF4BrbFYMvsYk5YT1zC6vtT5n\n3xPnxPGoFLXJuDwOS74kw3QF70Yvgph5yCBj8D51KgAAn+U5Zouj1FyT5mDD\nWBgVQSVYYxRoBmA13PDZQUoHPanhLEUlvaygbDKLUSSjKkkkkQzcMiOPwJKc\n3YG4DzJW+PqpAm+gtMT4JHaomBlRwii/r86vmTSqKGKkBKFQBea1LZ3LScqF\njNSsVrMZY9ov7Rq1P4PyXQm9yRkzDc4g29JqghrZHLnlkeuzIl3q+m7pvqqk\n1H3AMgviWCQ2mbv9U3jxccM2Ugj2YU6bJ0FPG9TjS2IBsO3FR8HGmkqzO3ps\nTqbGSd1GJJm3ebHE3QNI7iXTATlpdxfRIot+WooznItpmgPUdKMhzIL1JOc5\nRFDz6JwMVahCWts3Z3yDHBhSXb5Z8gOFaHMMaubFRj+R1Og74GFc49s7tQ8w\nxJYjvbdY1fX4iq7CRvI5F8s33qm5EJjrbURR1vof5Cd95yw++d/qI6aGDaU+\nEwV4IJWvn7hpIbqk0OzOIyz6OLftrohsuSgZ1eSuBfmYOdJZA8Yd/LePaxY2\nDKK/\r\n=P626\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICD6M3+eEaobS4xUDwTuYHK/tJvF+TtKyQoUcGuRsqYwAiEAxJi2bCENCaZ4CB0GxExQ7PhgNjTcKyn8ZwgEEg6N/v8="}]},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.5.1_1609621283348_0.32207938424029736"},"_hasShrinkwrap":false},"3.5.2-beta.1":{"name":"@mihanizm56/fetch-api","version":"3.5.2-beta.1","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"6.13.7"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@types/jest":"24.9.1","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.1","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript":"3.8.3","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && npm run lint && npm run packages-vulnerability-check && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for the isomorphic fetch\n\n### Benefits:\n\n- Provides validation for responses (based on @hapi/joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services, https://www.npmjs.com/package/query-string is used)\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in the\n  hard-structured response format\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n- Provides the ability to handle the response progress\n- Provides the ability to select necessary fields from the response (https://github.com/nemtsov/json-mask#readme used)\n- Provides the ability to use persistent params for all requests\n- Provides the ability to retry requests\n\n#### Request input options:\n\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use @hapi/joi\n- customTimeout(number) - milliseconds for cancel the request on timeout (or a full package of requests if the \"retry\" parameter is activated) \n- retry - number of requests try to request if the response is negative\n\n#### Request output options:\n\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n\n- body will be serialized in JSON if body data NOT FormData\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n## Examples of usage\n\n### REST API\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### get request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          })\n        ),\n      }),\n    }),\n  });\n```\n\n#### get request with response fields selection (Be ensure that selected field is guarded with the responseSchema)\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    selectData: 'username,password', // the output will be {data:{ username, password }, etc...}\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          })\n        ),\n      }),\n    }),\n    progressOptions: {\n      onLoaded: (total) => console.log(total) \n      // onLoaded callback will be called after \n      // the whole response will be done\n      // WARNING - not availiable on nodejs environment\n      onProgress: ({ total, current}) => console.log(total, current)\n      // onProgress callback will be triggered during the response progress\n      // till the response will be done\n      // WARNING - not availiable on nodejs environment\n    },\n  });\n```\n\n\n#### get request with PROGRESS callbacks\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          })\n        ),\n      }),\n    }),\n    progressOptions: {\n      onLoaded: (total) => console.log(total) \n      // onLoaded callback will be called after \n      // the whole response will be done\n      // WARNING - not availiable on nodejs environment\n      onProgress: ({ total, current}) => console.log(total, current)\n      // onProgress callback will be triggered during the response progress\n      // till the response will be done\n      // WARNING - not availiable on nodejs environment\n    },\n  });\n```\n\n#### get request with blob parse\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getPhotoRequest = (): Promise<IResponse> =>\n  new RestRequest().getBlobRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    responseSchema: Joi.any()\n  });\n```\n\n#### get PURE REST request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { PureRestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new PureRestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          })\n        ),\n      }),\n    }),\n  });\n```\n\n#### post(put/patch/delete have the same format) request\n\n```javascript\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    body: someData,\n    mode: \"cors\",\n    queryParams: {\n      id: \"test_id_123\",\n    },\n    headers: {\n      \"Content-Type\": \"application/json\",\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\")),\n    }),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createReviseRequest(\n  someData\n);\n```\n\n### JSON-RPC API\n\n```javascript\nimport { JSONRPCRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createItemsRequest = (someData): Promise<IResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint: \"http://localhost:3000\",\n    body: {\n      method: 'some method',\n      params: 123\n    }\n    queryParams: {\n      stringId: \"123\"\n      someArray: ['1', 1, '2', 2],\n      numberId: 100\n    },\n    responseSchema: Joi.object({\n      items: Joi.array().items(\n        Joi.object({\n          id: Joi.string().required(),\n          name: Joi.string().required(),\n          name: Joi.string()\n        })\n      )\n    }),\n  });\n```\n\n### JSON-RPC API (with batching)\n\n```javascript\nimport { JSONRPCRequest, IResponse } from \"@mihanizm56/fetch-api\";\nimport Joi from '@hapi/joi'\n\nconst responseSchemaObjectOne = Joi.object({\n  foo: Joi.string().required(),\n});\n\nconst responseSchemaObjectTwo = Joi.object({\n  foo: Joi.string().required(),\n});\n\nexport const createItemsRequest = (someData): Promise<IResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint:\n      'http://localhost:8080/json-rpc/positive?batch=true&twoSchemas=true',\n    body: [\n      { method: 'listCountries', params: {} },\n      { method: 'listCountries', params: {} },\n    ],\n    isBatchRequest: true,\n    responseSchema: [responseSchemaObjectOne, responseSchemaObjectTwo],\n  });\n```\n\n#### Please, be careful. The response will be the object:\n```javascript\n{\n  error: boolean,\n  data: Array<IResponse>,\n  additionalErrors: null,\n  errorText: string,\n  code: number\n}\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n\n#### Cancelling the request\n\n```javascript\nimport { RestRequest, IResponse, ABORT_REQUEST_EVENT_NAME } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    body: someData,\n    abortRequestId: '1',\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\")),\n    }),\n  });\n);\n\ndocument.dispatchEvent(\n  new CustomEvent(ABORT_REQUEST_EVENT_NAME, {\n    detail: { id: '1' },\n  }),\n);\n```\n\n#### Set persist options to all requests\n\n```javascript\nimport { FetchProxyMaker } from \"@mihanizm56/fetch-api\";\n\nnew FetchProxyMaker().setPersistentOptions(() => ({\n  headers: {\n    foo: 'bar',\n  },\n}));\n```\n","readmeFilename":"README.md","gitHead":"02a692465f03a2eb042d106b8581f303cd3d9463","_id":"@mihanizm56/fetch-api@3.5.2-beta.1","_nodeVersion":"12.13.0","_npmVersion":"6.14.10","dist":{"integrity":"sha512-Hqbo6Y5qJv13DOfzKbf46iHehGDZ8PhKM+plQ5iIrq+IbBrKb6oLQfp9KTGkMbdbeROwk9gk3BZ4VsVoVgJMFw==","shasum":"33c49b7280e530a11bcbfa32ccde073a815cf0df","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.5.2-beta.1.tgz","fileCount":74,"unpackedSize":124633,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf/IibCRA9TVsSAnZWagAAEZQP/RzFsR78d/8gbDDCKwPu\nje9hA4dnH6njK0q+lpUOXZDpR6mUz/DNxhWoaxmGKrCWnJJUCNfK2q8xhJAJ\n4jY33qEJlmJJWy3a0Q0zN5lqP8EeIVGdaYF/Z1vXCBdAdd63zyKOxXExbDHo\nyKIszJuLvvXe3fHfDXxe6090N9i2JGepjnsana9mBU0iY2OiqlMCttypcaRT\n5JRk68vcFGEPwU7iJ81jzmyByF350Pu8wxYN4NqriRME/VxZGsAK3M9OgLLp\nmkWN9UqQvtKeh2YuHiiv5r72gJmXO0KXUBWN8bJ4hj0Wxcddg+MR3+c4wa6Q\nyAyoPNlhnKQ8e8tN91P61hWuUzSO/N25Kx8HUTHNMJWaauMNm66JX/E3pJuV\npqo94VFi+QrFaUhgLGDqs5h0NHwwfqKbgQmPWWlHiVrIKJzXUDRwvzSxgOGF\nltCWKt1p7mVCBTT/O/y6MFhpXZuU1XqNGh4iZbR3zjzM2Hzqa65Fo3d3AM5g\nqbsGfs1+C+MvVXtW70xE1aaX7EL0FYP01bzbeWASXk+w1SjSVV/3JGXRCxED\nEhm74T4mjUyVwRTdLjWmTk4mfMWK1k5/j/mggI67VLTDRLdEHR57n/YZ6tCg\neJkWf328m7ZMatkBnWqOPKN2+ivl/rHmSo+DCRlYgs5MmOqUZaww4TCfVMpV\n1u2+\r\n=ftML\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDBpsGApCozeNFboxE54QIvJIpoKCYhfGKYVdd8+ye+2QIhAJ67w7GKxFCf+R3EMSzcIbbf34ehz8oUL6hA7xKRa2vz"}]},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.5.2-beta.1_1610385562850_0.6880003560793262"},"_hasShrinkwrap":false},"3.5.2-beta.2":{"name":"@mihanizm56/fetch-api","version":"3.5.2-beta.2","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"6.13.7"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@types/jest":"24.9.1","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.1","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript":"3.8.3","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && npm run lint && npm run packages-vulnerability-check && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for the isomorphic fetch\n\n### Benefits:\n\n- Provides validation for responses (based on @hapi/joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services, https://www.npmjs.com/package/query-string is used)\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in the\n  hard-structured response format\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n- Provides the ability to handle the response progress\n- Provides the ability to select necessary fields from the response (https://github.com/nemtsov/json-mask#readme used)\n- Provides the ability to use persistent params for all requests\n- Provides the ability to retry requests\n\n#### Request input options:\n\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use @hapi/joi\n- customTimeout(number) - milliseconds for cancel the request on timeout (or a full package of requests if the \"retry\" parameter is activated) \n- retry - number of requests try to request if the response is negative\n\n#### Request output options:\n\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n\n- body will be serialized in JSON if body data NOT FormData\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n## Examples of usage\n\n### REST API\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### get request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          })\n        ),\n      }),\n    }),\n  });\n```\n\n#### get request with response fields selection (Be ensure that selected field is guarded with the responseSchema)\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    selectData: 'username,password', // the output will be {data:{ username, password }, etc...}\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          })\n        ),\n      }),\n    }),\n    progressOptions: {\n      onLoaded: (total) => console.log(total) \n      // onLoaded callback will be called after \n      // the whole response will be done\n      // WARNING - not availiable on nodejs environment\n      onProgress: ({ total, current}) => console.log(total, current)\n      // onProgress callback will be triggered during the response progress\n      // till the response will be done\n      // WARNING - not availiable on nodejs environment\n    },\n  });\n```\n\n\n#### get request with PROGRESS callbacks\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          })\n        ),\n      }),\n    }),\n    progressOptions: {\n      onLoaded: (total) => console.log(total) \n      // onLoaded callback will be called after \n      // the whole response will be done\n      // WARNING - not availiable on nodejs environment\n      onProgress: ({ total, current}) => console.log(total, current)\n      // onProgress callback will be triggered during the response progress\n      // till the response will be done\n      // WARNING - not availiable on nodejs environment\n    },\n  });\n```\n\n#### get request with blob parse\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getPhotoRequest = (): Promise<IResponse> =>\n  new RestRequest().getBlobRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    responseSchema: Joi.any()\n  });\n```\n\n#### get PURE REST request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { PureRestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new PureRestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          })\n        ),\n      }),\n    }),\n  });\n```\n\n#### post(put/patch/delete have the same format) request\n\n```javascript\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    body: someData,\n    mode: \"cors\",\n    queryParams: {\n      id: \"test_id_123\",\n    },\n    headers: {\n      \"Content-Type\": \"application/json\",\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\")),\n    }),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createReviseRequest(\n  someData\n);\n```\n\n### JSON-RPC API\n\n```javascript\nimport { JSONRPCRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createItemsRequest = (someData): Promise<IResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint: \"http://localhost:3000\",\n    body: {\n      method: 'some method',\n      params: 123\n    }\n    queryParams: {\n      stringId: \"123\"\n      someArray: ['1', 1, '2', 2],\n      numberId: 100\n    },\n    responseSchema: Joi.object({\n      items: Joi.array().items(\n        Joi.object({\n          id: Joi.string().required(),\n          name: Joi.string().required(),\n          name: Joi.string()\n        })\n      )\n    }),\n  });\n```\n\n### JSON-RPC API (with batching)\n\n```javascript\nimport { JSONRPCRequest, IResponse } from \"@mihanizm56/fetch-api\";\nimport Joi from '@hapi/joi'\n\nconst responseSchemaObjectOne = Joi.object({\n  foo: Joi.string().required(),\n});\n\nconst responseSchemaObjectTwo = Joi.object({\n  foo: Joi.string().required(),\n});\n\nexport const createItemsRequest = (someData): Promise<IResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint:\n      'http://localhost:8080/json-rpc/positive?batch=true&twoSchemas=true',\n    body: [\n      { method: 'listCountries', params: {} },\n      { method: 'listCountries', params: {} },\n    ],\n    isBatchRequest: true,\n    responseSchema: [responseSchemaObjectOne, responseSchemaObjectTwo],\n  });\n```\n\n#### Please, be careful. The response will be the object:\n```javascript\n{\n  error: boolean,\n  data: Array<IResponse>,\n  additionalErrors: null,\n  errorText: string,\n  code: number\n}\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n\n#### Cancelling the request\n\n```javascript\nimport { RestRequest, IResponse, ABORT_REQUEST_EVENT_NAME } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    body: someData,\n    abortRequestId: '1',\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\")),\n    }),\n  });\n);\n\ndocument.dispatchEvent(\n  new CustomEvent(ABORT_REQUEST_EVENT_NAME, {\n    detail: { id: '1' },\n  }),\n);\n```\n\n#### Set persist options to all requests\n\n```javascript\nimport { FetchProxyMaker } from \"@mihanizm56/fetch-api\";\n\nnew FetchProxyMaker().setPersistentOptions(() => ({\n  headers: {\n    foo: 'bar',\n  },\n}));\n```\n","readmeFilename":"README.md","gitHead":"e3b23df9f4d403859c271efb8b3dd1a0584d9aff","_id":"@mihanizm56/fetch-api@3.5.2-beta.2","_nodeVersion":"12.13.0","_npmVersion":"6.14.10","dist":{"integrity":"sha512-SJQgrG5JUn9iunfjg5ML6/y8ZkJ9KPEaSfmL5PQO7rpqkxr4F9t47LMp5KFrrn/9SIuEe7Vdlmrx3j2ybmjb9A==","shasum":"f24a05aecdb02c70c01835754321e9c38a5f90f3","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.5.2-beta.2.tgz","fileCount":70,"unpackedSize":125140,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgAWphCRA9TVsSAnZWagAAyoAQAJsvQmK04G6ksc/u5MRq\nBCZCGv8Q1+MOlWMsTJK3lDzfU5dy6O9n1/hj5sYZYw9ezE4buTVzSnKpBjT5\n6KhPdlm5vvYWjSaTvtCVFjVoXlUxGKHCz8GtMyssGnIi32jWq4Q1g870ZLSu\nwUEutMcn3265RuB6Aae9CyOSUurKczEO0bHoGC0sDWAHvV5e1rMFO8HOdqTJ\n9RuKrDdF7lCc8f2We48FF7qG9hBVG2gmXtQvaT03ZqngWtpTV8ySoMnl7DC9\n6HNJJl86GJKySm0QTRx3rjMT943pQgHAz1y5z3T6T+2oCkPLGnbjtQGuac3j\nXCZKZ4AdOmT1AsXQTtgwFH+xoRXWq7+QkTjxXwO4D566nbK+2gJxmaVQcQWo\nS7/ikifF1tDTP6YNVohAvJ2WMnJ9llnfIb4NwePTxuyh4kIIfIJqEfAz8VD+\nJ5dHoNF5z9/v5JoCm7g7cvW9sPVcKm34DM+W3+2iHSQxjNm8ZDv/ANIkwEWc\nCOrCQ05/2qSYGhfpJRPVEUV7YMpi60R2d+iYYJF1zvvq8j6+HlvIO/qCWDCb\nxlIl+5ozmN/6kyEXiSe0Rwk+Am8WC+097Fmzezhy8fvFrHMlw31OubzetZgG\nHpR2CHTskTQvvgDJOK5bEYc3M50igWw79tativsAZmRugGUtqVaj1G6GAC7O\nnCwn\r\n=A4QL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIA3vN3bVg0zdPH2Iy4c++tGK5JSzqyXzo4mr6BzRbNgBAiBjY597cCtSGNki3/PiWMphDyPZhJtFnQ6HGU6SUP5HfA=="}]},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.5.2-beta.2_1610705504383_0.3185042198926602"},"_hasShrinkwrap":false},"3.4.6-beta.1":{"name":"@mihanizm56/fetch-api","version":"3.4.6-beta.1","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"6.13.7"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.1","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript":"3.8.3","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && npm run lint && npm run packages-vulnerability-check && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"gitHead":"e043434a7b1fb1a8a936ad967f80771e881e6fb1","readme":"# @mihanizm56/fetch-api\n\n## Solution for the isomorphic fetch\n\n### Benefits:\n\n- Provides validation for responses (based on @hapi/joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services)\nhttps://www.npmjs.com/package/query-string is used\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in\n  hard-structured responce format or not (both interfaces are the same)\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n- Provides the ability to handle the response progress\n- Provides the ability to select necessary fields from the response (json-mask library used)\n- Provides the ability to use persistent params for all requests\n\n#### Request input options:\n\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use @hapi/joi\n- customTimeout(number) - milliseconds for cancel the request on timeout\n\n#### Request output options:\n\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n\n- body will be serialized in JSON if body data NOT FormData\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n## Examples of usage\n\n### REST API\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### get request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          })\n        ),\n      }),\n    }),\n  });\n```\n\n#### get request with response fields selection (Be ensure that selected field is guarded with the responseSchema)\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    selectData: 'username,password', // the output will be {data:{ username, password }, etc...}\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          })\n        ),\n      }),\n    }),\n    progressOptions: {\n      onLoaded: (total) => console.log(total) \n      // onLoaded callback will be called after \n      // the whole response will be done\n      // WARNING - not availiable on nodejs environment\n      onProgress: ({ total, current}) => console.log(total, current)\n      // onProgress callback will be triggered during the response progress\n      // till the response will be done\n      // WARNING - not availiable on nodejs environment\n    },\n  });\n```\n\n\n#### get request with PROGRESS callbacks\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new RestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          })\n        ),\n      }),\n    }),\n    progressOptions: {\n      onLoaded: (total) => console.log(total) \n      // onLoaded callback will be called after \n      // the whole response will be done\n      // WARNING - not availiable on nodejs environment\n      onProgress: ({ total, current}) => console.log(total, current)\n      // onProgress callback will be triggered during the response progress\n      // till the response will be done\n      // WARNING - not availiable on nodejs environment\n    },\n  });\n```\n\n#### get request with blob parse\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getPhotoRequest = (): Promise<IResponse> =>\n  new RestRequest().getBlobRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    responseSchema: Joi.any()\n  });\n```\n\n#### get PURE REST request\n\n```javascript\nimport Joi from \"@hapi/joi\";\nimport { PureRestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const getContractsRequest = (): Promise<IResponse> =>\n  new PureRestRequest().getRequest({\n    endpoint: \"http://localhost:3000\",\n    translateFunction = (key, options) => `${key}:${JSON.stringify(options)}`,\n    isErrorTextStraightToOutput: true,\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().required(),\n      info: Joi.object({\n        count: Joi.number().required(),\n        killers: Joi.array().items(\n          Joi.object({\n            username: Joi.string().required(),\n            count: Joi.number().required(),\n          })\n        ),\n      }),\n    }),\n  });\n```\n\n#### post(put/patch/delete have the same format) request\n\n```javascript\nimport { RestRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    body: someData,\n    mode: \"cors\",\n    queryParams: {\n      id: \"test_id_123\",\n    },\n    headers: {\n      \"Content-Type\": \"application/json\",\n    },\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\")),\n    }),\n  });\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createReviseRequest(\n  someData\n);\n```\n\n### JSON-RPC API\n\n```javascript\nimport { JSONRPCRequest, IResponse } from \"@mihanizm56/fetch-api\";\n\nexport const createItemsRequest = (someData): Promise<IResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint: \"http://localhost:3000\",\n    body: {\n      method: 'some method',\n      params: 123\n    }\n    queryParams: {\n      stringId: \"123\"\n      someArray: ['1', 1, '2', 2],\n      numberId: 100\n    },\n    responseSchema: Joi.object({\n      items: Joi.array().items(\n        Joi.object({\n          id: Joi.string().required(),\n          name: Joi.string().required(),\n          name: Joi.string()\n        })\n      )\n    }),\n  });\n```\n\n### JSON-RPC API (with batching)\n\n```javascript\nimport { JSONRPCRequest, IResponse } from \"@mihanizm56/fetch-api\";\nimport Joi from '@hapi/joi'\n\nconst responseSchemaObjectOne = Joi.object({\n  foo: Joi.string().required(),\n});\n\nconst responseSchemaObjectTwo = Joi.object({\n  foo: Joi.string().required(),\n});\n\nexport const createItemsRequest = (someData): Promise<IResponse> =>\n  new JSONRPCRequest().makeRequest({\n    endpoint:\n      'http://localhost:8080/json-rpc/positive?batch=true&twoSchemas=true',\n    body: [\n      { method: 'listCountries', params: {} },\n      { method: 'listCountries', params: {} },\n    ],\n    isBatchRequest: true,\n    responseSchema: [responseSchemaObjectOne, responseSchemaObjectTwo],\n  });\n```\n\n#### Please, be careful. The response will be the object:\n```javascript\n{\n  error: boolean,\n  data: Array<IResponse>,\n  additionalErrors: null,\n  errorText: string,\n  code: number\n}\n```\n\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n\n#### Cancelling the request\n\n```javascript\nimport { RestRequest, IResponse, ABORT_REQUEST_EVENT_NAME } from \"@mihanizm56/fetch-api\";\n\nexport const createReviseRequest = (someData): Promise<IResponse> =>\n  new RestRequest().postRequest({\n    endpoint: \"http://localhost:3000\",\n    body: someData,\n    abortRequestId: '1',\n    responseSchema: Joi.object({\n      username: Joi.string().required(),\n      password: Joi.string().pattern(new RegExp(\"^[a-zA-Z0-9]{3,30}$\")),\n    }),\n  });\n);\n\ndocument.dispatchEvent(\n  new CustomEvent(ABORT_REQUEST_EVENT_NAME, {\n    detail: { id: '1' },\n  }),\n);\n```\n\n#### Set persist options to all requests\n\n```javascript\nimport { FetchProxyMaker } from \"@mihanizm56/fetch-api\";\n\nnew FetchProxyMaker().setPersistentOptions(() => ({\n  headers: {\n    foo: 'bar',\n  },\n}));\n```\n","readmeFilename":"README.md","_id":"@mihanizm56/fetch-api@3.4.6-beta.1","_nodeVersion":"12.13.0","_npmVersion":"6.14.10","dist":{"integrity":"sha512-8Dd3sn924vzStFMaLAUJzX4c+gkdQECJQYkxDpi/2J/mQ/X9HFTBgf/voFQkZxla3XgPAKewNvTe+RxZlawhaA==","shasum":"b18a2c71625e178a88494172b8aeb1e46333461c","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.4.6-beta.1.tgz","fileCount":66,"unpackedSize":116150,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgAWtSCRA9TVsSAnZWagAAXdEP/2M3aH3NmL5WDNmmUvCu\nd8gcxw6UoGoYkQ40CYSMesB53493xDiVkwBag1xGJ93qC9joT145cmVKOFOJ\nWCXL0Y2Y/Krrd4iWzkDhG8zT92KEYY6GHXn6/ImwCJE+0IHjaYR3mGyYtxgF\nhErOghxcjI5ZDNltqCaW7q8GhHLswZf8T/KohIoGcF1A9o4yxVa4I1XoTqp9\nIRY8ANrCXAIZh04MW7ZOvhdQiENgyPqDxa22k3h0jBq4HVzasvnnBdzHO3QE\n7orSicnrW1+kRNoVZkCnPUeYdO7PQEETyCjX62GUMAUE62tYOdvu5Z1Ermdt\nc0sg97Hqvonjrqkn2jD3Nr78dWDDz/oxDc+7st6NP0hInecgUU0X2yrS8se3\nIutZqz5+SKUgMhCiimEQC4k0iMbUl4DqwAWw2rJjpY8Mq6X8EAGXg7owtSH7\n5r+6HV+PbSlVNagA6MkeONaV9oeorL+tBb0wo/WYCT4zb6CI3PHfrXPykr07\nT9U+O4ewH/NJoRt1uq3BM4E25Btvjsghq2e02ETuljLST8GkULT75bmNXksl\n2Ldn7Z61Ip9ada5ITz1dxE+IfyIRoF5zz5s1JdT37co6wPFDwTz+xsDOx5yL\nUPqoFfEwHbh4dkdG7rRaRRAvdaJ8bgYCECkkUD/XnaTesgkEI0yUmtbxto9R\nhgQu\r\n=GDqb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCEvshDy69Z0vFXSCG6iE9SD2a3XQ7GQdNp6AbhUBta+gIhAK1BTzy9viLrZNsgBoPg6hznE1D8P0ITXj3p7GG03E1t"}]},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.4.6-beta.1_1610705746029_0.3952605167780341"},"_hasShrinkwrap":false},"3.4.6":{"name":"@mihanizm56/fetch-api","version":"3.4.6","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node ./integrational-tests/server/index.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"6.13.7"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.5","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.1","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript":"3.8.3","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && npm run lint && npm run packages-vulnerability-check && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"gitHead":"5916d211c626ac9f6c506db23280643fca7d008a","_id":"@mihanizm56/fetch-api@3.4.6","_nodeVersion":"12.13.0","_npmVersion":"6.14.10","dist":{"integrity":"sha512-1ExleNDsO3vFY6pTGcnkUmNoThU8NYgo5m/FfHh0r6kX/82NbwCsK4KUfW9evQpVsn5/N1xMZ11b25Jmy52KAA==","shasum":"2e445219303d87f85395bf4335bba25386f33ac3","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.4.6.tgz","fileCount":66,"unpackedSize":116143,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgAWxhCRA9TVsSAnZWagAAmwIQAJyxcNaVczPILZ9NFOag\nY5MyJOT+27/MaII/ic447Uk406MptMJQNR5kNnwEJ5qRlmcYr0AUf4Bj2KsP\n5uuF38fEpVK9tsTTwVgTgrNl5qu5AUem96ZVZDbYfq3yi74gdGKHIk0tEN/8\nFS8W0f3lsVYSFCnOwJpR7q8OiurpUBPJr8cFuk+R1cx8mi0gglLexhoU7RcR\nzX8pIgvGpXKdRbxXKSsSQMKN2A0rfl16VYgrM0SB6vE/k5DEC3e2naDgbYkG\nLOIfJUpx2n5y2DgCB3cvMohB8pHuVRFhzm/PMJc7wXEHjxQfgs/F7/jBQg3d\noR6vWLXZN/TsO7F0WrXcR9qeAMz+MWCrB2xmAJbz1RWaTc68HOl20pkbzwEb\nxadU/LumLpO2b6qvyRaeRXeNoVLY5GhdjMZGztJAwE44i1NCf3CfcNcllzSp\nkaGzVCU+A5TBF3l5xHziMuf8F9IL/3aDsvRvLmt7C9dwetNPJ7lzJkb5PqBj\ns2MHbn5x0zKkqRZ1SwJ47xlt09FeukolK8E9nIEiPKARvKhTj0RxfoRof2SV\nnGWu01uiMiqc4v74pd+4s/NMAnxhscfyfKdtZY2Q7EiKl8ewKu4IF2eWjZgZ\n4e20OS/tMLiTFYmkMsb0eUWhVPQ+w28YKYTURkEMR3D/IAekheqMNwcAA4Tk\nN/Yr\r\n=CY2D\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDNVRpt8Be03dokfz18LvgJgOWxozrwGuXq9EjTjbDoMgIgfitcohKO/wWGse5bMMxZObr+XZAFfLUcSj7K5/4acxY="}]},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.4.6_1610706016699_0.5507100690260274"},"_hasShrinkwrap":false},"3.5.2":{"name":"@mihanizm56/fetch-api","version":"3.5.2","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"6.13.7"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@types/jest":"24.9.1","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.1","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript":"3.8.3","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && npm run lint && npm run packages-vulnerability-check && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"gitHead":"8f53a3230f32e62312beff1f7ba3e438e8c3b7df","_id":"@mihanizm56/fetch-api@3.5.2","_nodeVersion":"12.13.0","_npmVersion":"6.14.10","dist":{"integrity":"sha512-JUV/ZYcuj/l7eSMR2jFKvQ58hHXiDjoj55/HwQwJqJfcDz5sOnPzsgYVUxJTgfTTDTwS4oflYhQhNTZLt+qxOA==","shasum":"f74ebf0c10f67711776aaa4e1c7f20859423726c","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.5.2.tgz","fileCount":70,"unpackedSize":125133,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgB0qgCRA9TVsSAnZWagAAbtwP/R2UuQHb+xPdjWfgj9ud\nmu8hKoxn6UQDl0MAsOPCiu3S+6WOXhXyRvWyWpufGyUv9o95YulmNfrpryY4\n8iL7V6DrpkdmBRrJrDfZNNpNDuhubYHHElR5vgoo+2HIZAdh7doWYmRxvN9i\nxyfJTmBOrOYGLxkD4Sd9R8oTN9ATykTrnFT42Aqq/JQSJ1N8P+Vik/PoMF7n\nach+HIiQzPzVC20TQKYUqvc9wqZ+OXffcdNf4Wpkyf/sV5GFxvHmhYApw1I6\nD02hueKB5GRcECtST+juocTT8lLEPkRDPokWBsyptTxcasTRwSIK338gjx3g\ngOxNTgrbBWp1JgAAh7ZFMzG8Bl+WWDfR671qtF7ahyZILAxiSMoCnNIenppJ\n/GtiBddoWWIBYMQlzUaRb7lCdwYxyx2RNXM1OYXLRgquCxg8iJUo+n0iBFDI\nyZWaNQ2eLLPL2Z8IaTpPht7RIfxBgxqkhuqWzFXRcAwjewTIUuK/oW7tFFTI\nmp+xGCN5+vW35yrvJosE+uikle4MhUA7pHCCJ03rkUI0RIpEJJV50DoEVkXr\nlQKEtmHQtV1/4YuU6JwSYeCJ21FixV9NWoz1s9JeMWEuqKrsYq9PYPdlcYKr\nMOOZCIPBBMc4PuHsGuucG4lWlPX2OL946w8C41orz8pujyIGoWoOpftoTeTQ\nUAit\r\n=5sAS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFMNFgKpAnXUtEVBn02y9DHYtVjSVRjuIyDkawEPvNaVAiEA1Vp7+3mF6nGUryR1GPn9BaXqDWtfQ00aIp/51vhbZX4="}]},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.5.2_1611090592121_0.5202256925316788"},"_hasShrinkwrap":false},"3.6.0":{"name":"@mihanizm56/fetch-api","version":"3.6.0","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"6.13.7"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.1","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.18.2","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript":"3.8.3","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && npm run lint && npm run packages-vulnerability-check && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"gitHead":"87f96054f7efd79f312b544fdd39812454e71e38","_id":"@mihanizm56/fetch-api@3.6.0","_nodeVersion":"12.13.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-XUuycSsITQsnmGzH9kVN5JPCYSvKcV8DBtbGFJMPoAmRU/U6wgY1FjTNO79WL/XLryybU48MjPDgClezUCU+AQ==","shasum":"88a7aeaa2153c9aa5dee19143c5ac70b5ebc25c6","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.6.0.tgz","fileCount":72,"unpackedSize":118155,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgFJF1CRA9TVsSAnZWagAAoQoP/0f6N8RUGHt+rqDO7glU\nTyA3SrxoRLBamabSRPlrt5nuc4aeiMMWZYgD9v3tgChUmCGTIDNWeLLdgV+a\nTqJv/WuSHzYgNP9SwDqIxNGGrFh5FUkwgWwiQK+7N9oTWyQV892TXjDP7Kly\nwhNCa9upc3blDlucHiymWLXevkgwsVpri+cnY+1yXO/qVL7kSxJkboLQJYFq\nbe04kKMANmrhfOrVv/YsZhSqE7VTHJGVfJ/tlm0kQzX99l9G+kxWuHOobGXG\nE/GpfZQFA1qAu/gOP5qDpdaLBzCcZnCFHzQ9A0TFRDA5wqUOnq5/d1aaYOpT\nkX87uK8Co0ImNeMPSIZ2BGYM3X387mCcBQKmWQSF49jBx28KvzMEoz8xPAO/\nL2AITAXrlezWt3+TKX6/7d3c/dm4LLpgm5+Pg9MZ6fXgJeCEJdxCx9JVgD0W\nNwRZYO/Oyz761R7SH26JblZlJrFb6MogpKj+iis6S8PrM6khPr+Omkf/0YHC\n3YE1JXQSVMOZtpi6SDf3ahvOLwDm6hH0CIFb8GIAiHdN7T3q6ZMFKep+mfTS\nCof/zWwUhru41FMMSoCO0vRmvG+rbbedlONYsv6XZ1SpjgfxxYDDl6DN8eWP\nKC5t3dcYpSyRHjUIFDIZ4f4gqt2ahv6Iprs211pS+adFVndaYf7EubQhy0m3\nM24p\r\n=bDah\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDHMkxmPvLC5FoPShKeEqDE4W/02iBq63w/ZTV7FmvwlgIgSZ+pTv1VqG7fGQyN6JJSJRHjlkvbNf16/XUEtSAzibQ="}]},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.6.0_1611960692949_0.2762756561680024"},"_hasShrinkwrap":false},"3.6.1-beta.1":{"name":"@mihanizm56/fetch-api","version":"3.6.1-beta.1","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"6.13.7"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.1","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.20.1","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript":"3.8.3","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for the isomorphic fetch\n### [Documentation here](https://mihanizm56.github.io/fetch-api/)\n\n### Benefits:\n- Provides validation for responses (based on @hapi/joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services, https://www.npmjs.com/package/query-string is used)\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in the\n  hard-structured response format\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n- Provides the ability to handle the response progress\n- Provides the ability to select necessary fields from the response (https://github.com/nemtsov/json-mask#readme used)\n- Provides the ability to use persistent params for all requests\n- Provides the ability to retry requests\n\n#### Request input options:\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use @hapi/joi\n- customTimeout(number) - milliseconds for cancel the request on timeout (or a full package of requests if the \"retry\" parameter is activated) \n- retry - number of requests try to request if the response is negative\n\n#### Request output options:\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n- body will be serialized in JSON if body data NOT FormData\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### Please, be careful. The response will be the object:\n```javascript\n{\n  error: boolean,\n  data: Array<IResponse>,\n  additionalErrors: null,\n  errorText: string,\n  code: number\n}\n```\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n#### Set persist options to all requests\n\n```javascript\nimport { FetchProxyMaker } from \"@mihanizm56/fetch-api\";\n\nnew FetchProxyMaker().setResponseTrackCallback((requestData) => ({\n // do some metrics or logging here\n}));\n```\n\n#### Set callback for metrics for all requests\n\n```javascript\nimport { FetchProxyMaker } from \"@mihanizm56/fetch-api\";\n\nnew FetchProxyMaker().setPersistentOptions(() => ({\n  headers: {\n    foo: 'bar',\n  },\n}));\n```","readmeFilename":"README.md","gitHead":"7d6d84bf3daf1746522dcb739bc4dae33e99c9d8","_id":"@mihanizm56/fetch-api@3.6.1-beta.1","_nodeVersion":"12.17.0","_npmVersion":"7.5.2","dist":{"integrity":"sha512-VS+W/KhUmTNelvUxpx/fU/DfObvzk9MNLzBTgUg1GOn/pSlN6tbM6/9t5YWyJA4HUWz8eR8d6vgOIJaJxh4wxw==","shasum":"39eb5f1a8482bbd49832ec55ef357b4311c95df8","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.6.1-beta.1.tgz","fileCount":72,"unpackedSize":120955,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgHzrzCRA9TVsSAnZWagAA6SoQAKCIIRUkQtRrrgtot8ro\nt0hnwmXF5a+nffZLWQpIHu//fs4IoA+LFdzni/HSZgciO+srvKKozOyfjmBx\noervdYpzdw4WuIp7iXTYoEydKXI9lO4YDvlE70N7jsutvNEInrRLL066r6Vc\nBbSuGGfYbEtI3V8R1XPo5hI9s/rWjeT345b2DsudrnY4Jv5d7vUP91Mo357i\nvQB3qh9SV1PMjjwjRlM0fJr8/SnIm0lNhxl7bBUGrsJutREItdWazc/c+LSg\nVIgWukRMuK7d8uxCBHQKJgYIrIOHV6nmacad5aakrChaSyL3Jhx4kha0FFvQ\ncuOJh97asNMk3yVOHUfGwBmxCTs+OqesPqf6ko3QUaRyWpV2kW5JQ3vkrZTI\nRqz6ytJ1zNKNn350S8x7MY5IqLMVywo1lyf3pdeBOzMj6S89inEQl88aDrYr\nnI3ebv7mZDl7G2batlQKdqSZ2b3zR3t/TM6DuCNbY1GQr0cIgswrbH6OvVtg\nBL5Bjsb+E8fMPIphwLs8EGoFfo5tv/DE6FZ3XbtPt7yPEwADjixsmi94nf7P\n0Cr2r2FN3kvWFQUix7A7qbTCUs7olOmddG2MbriKpYrCon9cscnyH3sHagqM\nKJvkWnBeNORY+v9PMkBulj7f5bDmn9RKex3d+1kAvWkLcBdIPqPNRFseRFP0\nd6Ee\r\n=OXzQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBAlLlICNq7oaFC7qGe9BXlfOHGr4hSV/ZgvQDYfde1YAiEA5qQ/e+4QY7qS50lJ1buNfTuhptqwP9JwhgyARJKcaM8="}]},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.6.1-beta.1_1612659442422_0.4026300585390461"},"_hasShrinkwrap":false},"3.6.1-beta.2":{"name":"@mihanizm56/fetch-api","version":"3.6.1-beta.2","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"6.13.7"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.1","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.20.1","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript":"3.8.3","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for the isomorphic fetch\n### [Documentation here](https://mihanizm56.github.io/fetch-api/)\n\n### Benefits:\n- Provides validation for responses (based on @hapi/joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services, https://www.npmjs.com/package/query-string is used)\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in the\n  hard-structured response format\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n- Provides the ability to handle the response progress\n- Provides the ability to select necessary fields from the response (https://github.com/nemtsov/json-mask#readme used)\n- Provides the ability to use persistent params for all requests\n- Provides the ability to retry requests\n\n#### Request input options:\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use @hapi/joi\n- customTimeout(number) - milliseconds for cancel the request on timeout (or a full package of requests if the \"retry\" parameter is activated) \n- retry - number of requests try to request if the response is negative\n\n#### Request output options:\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n- body will be serialized in JSON if body data NOT FormData\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### Please, be careful. The response will be the object:\n```javascript\n{\n  error: boolean,\n  data: Array<IResponse>,\n  additionalErrors: null,\n  errorText: string,\n  code: number\n}\n```\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n#### Set persist options to all requests\n\n```javascript\nimport { FetchProxyMaker } from \"@mihanizm56/fetch-api\";\n\nnew FetchProxyMaker().setResponseTrackCallback((requestData) => ({\n // do some metrics or logging here\n}));\n```\n\n#### Set callback for metrics for all requests\n\n```javascript\nimport { FetchProxyMaker } from \"@mihanizm56/fetch-api\";\n\nnew FetchProxyMaker().setPersistentOptions(() => ({\n  headers: {\n    foo: 'bar',\n  },\n}));\n```","readmeFilename":"README.md","gitHead":"9ca08fcb32ee74bf2d90a3d91bca0a298b9a0f82","_id":"@mihanizm56/fetch-api@3.6.1-beta.2","_nodeVersion":"12.17.0","_npmVersion":"7.5.2","dist":{"integrity":"sha512-l206SYmVBcjKSaQcpRYUT9sPpa48tpM/ljfRMmavFvbb8Wlgw0iNhpvgK65PFhV+JROTsO4etv0QgQ0tFSnJ1w==","shasum":"875e62bbe13d35268d0c5e4c0513043431ef1c05","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.6.1-beta.2.tgz","fileCount":72,"unpackedSize":120954,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgHzxqCRA9TVsSAnZWagAAqPAP/0EFHqSklyXtYUY/Cup/\nsTr1YtaOy1DJYVs7I/BAu8tINwLooqANI4qystU5plG1/Hk7gC56V/kFWaUG\n9HkIkX7+2IWNt1kO93rjetlC/IOCo/wKB4PBPTdo7ydyqMDxkVKmwBq3EvYp\nxQN78stGd8qIvuhNdIaBjXhc5ab6QO7BUf9GlJKl2ycR7CVtDaoTVRKiOSLn\nkhxN+9wy4WLZ6dcKOqNfFhPqCVpTVdXDA5dZhrkRuQFNC6J4/p2EPMjnY4u4\nPJ4yscexWO1DWBvFzrHPqEPmip4sEmnOW4oFM0OBmKYjodo8GmnNaGUaUS8r\n/5DepD/MJtpHiH6OGPU4EV5gFxDK+0NduAQYjTeSS6nwrRtmDBsNkd8gTdwn\nxWiR9h6XWcXBDP36Xg6uHekeL7hrz8E7M/FxteaNFppdqouTvTQ9yEJFDqsZ\nNs2vmfU42mMjmiXA2aUpx1ACwPSwOFGSY/z1N5HYLpRSjDV1PtzWbn4Ic+44\nqHy30E9yfzy1sXpK9ISEsb5D8glYLYaz9gL+4ghBtqwr4S2PKHp3+fa3dsQ0\n194HLEDqj5bFpCqSUx+DXzQD74GFtj/A6PAzOBCYhVeAJQuNXLQy7vdDZg2f\nUk6X4r0BIcIXaFEx9OGoG1uyE7qr1K4Jifo6G1+rXA408WLRrKkl/IIl+K9U\n1HN9\r\n=UYFk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDmVEUS36o5IwTQdW/qJssqEMjSuk4cRh06h/02pV384AiEA+G9EnpUyL4tOdxHVxW2xCLQRmj6kCvyIPlR2pZ1ooQ0="}]},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.6.1-beta.2_1612659817962_0.2974837103943966"},"_hasShrinkwrap":false},"3.6.1-beta.3":{"name":"@mihanizm56/fetch-api","version":"3.6.1-beta.3","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"6.13.7"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.1","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.20.1","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript":"3.8.3","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for the isomorphic fetch\n### [Documentation here](https://mihanizm56.github.io/fetch-api/)\n\n### Benefits:\n- Provides validation for responses (based on @hapi/joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services, https://www.npmjs.com/package/query-string is used)\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in the\n  hard-structured response format\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n- Provides the ability to handle the response progress\n- Provides the ability to select necessary fields from the response (https://github.com/nemtsov/json-mask#readme used)\n- Provides the ability to use persistent params for all requests\n- Provides the ability to retry requests\n\n#### Request input options:\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use @hapi/joi\n- customTimeout(number) - milliseconds for cancel the request on timeout (or a full package of requests if the \"retry\" parameter is activated) \n- retry - number of requests try to request if the response is negative\n\n#### Request output options:\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n- body will be serialized in JSON if body data NOT FormData\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### Please, be careful. The response will be the object:\n```javascript\n{\n  error: boolean,\n  data: Array<IResponse>,\n  additionalErrors: null,\n  errorText: string,\n  code: number\n}\n```\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n#### Set persist options to all requests\n\n```javascript\nimport { FetchProxyMaker } from \"@mihanizm56/fetch-api\";\n\nnew FetchProxyMaker().setResponseTrackCallback(({\n  requestParams, // all request parameters\n  response, //  pure response protected object\n  pureResponseData, // response body without formatting\n  requestError: boolean, // is request crashed\n  formattedResponseData // formatted response data in IResponse interface\n}) => ({\n // do some metrics or logging here\n}));\n```\n\n#### Set callback for metrics for all requests\n\n```javascript\nimport { FetchProxyMaker } from \"@mihanizm56/fetch-api\";\n\nnew FetchProxyMaker().setPersistentOptions(() => ({\n  headers: {\n    foo: 'bar',\n  },\n}));\n```","readmeFilename":"README.md","gitHead":"f963710e4b0a5d8760c1ba8c15fb4959eeff0b69","_id":"@mihanizm56/fetch-api@3.6.1-beta.3","_nodeVersion":"12.17.0","_npmVersion":"7.4.0","dist":{"integrity":"sha512-Cf6HQ/VzUst7EZopM5YGbBFohUirsXAREa4c9aWf7j+CIx0lSS2YHl2PxunPaCMbzkcpRLLYfO7rVsZk7/V2tQ==","shasum":"4fa792bcf0ab6c69752e12b024d7c9a48710831b","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.6.1-beta.3.tgz","fileCount":72,"unpackedSize":121734,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgIWi/CRA9TVsSAnZWagAA/voP/0kEpySL8Kgdq/eiEupb\nzvTEv6e2KSgj1uTu1aAey9HTkTCGuK6Wp/62eCuystMDFskRiEqmGpvAMyXQ\nH2FN/EIDLv6/u4qAdiRaIlyEfvZu02q10zFDHdF2Qla6hmHQ9Jqc9PoPkBD0\nEH3/oz8nFozAPLgQc2A4uFivNSqJec/XP/MASsDllB6/Z51Mhd9zXswEXIsM\nyWcNB6mmcqUUnDzZNYnqm/QnoBHpyKWcjrIlnW6rr0yQUMGECdB9T86UFErh\nTN5dxLbXW1xBP2wnUh7IVb01JkAvEZXk8Fd1EztmiYxfcklSfzdM8lo/p5QJ\nnhMWJ/Fjy4ih7htmYy4i0ktrS2R4suHhY8PRzafKK3Jto5BODYLymkVnJKTZ\n3y+xUfQRlOJkilFxyNIL24yzfCQbqkkRHwBQ7Et3aL2sHT2wgmyn7vX9x8FK\n7ta0wEHg4LD59haJMPloZ3589Du9boxMlvf8dcckK61juiXoEPwJVLRD1TMe\ncEgA3dvejOqKgGtV5PAXiKBFH+VgHucpG651gngPvvFHXHLakQRR4wwixVy5\npOoggwBWHRxLzPXydQ9+qcLO6A7zj3r1/M4nuXqTw0lThyXa+qsK1/dZ9CNV\n5gZMQJiC8f8gH7P4xeTL3UxpEaTv/am6LDuZr+RvlGaRGE8s0qGC3ofcLdJR\n/TWA\r\n=nmIx\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDWiig9Nts5/UUmwkvpSiDcbxJ6aPOO1H7Ionb/dlHg2QIgD5gify3wCdm+FRrlwMcictY+dfjuvfsrvsbTTdLpmmU="}]},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.6.1-beta.3_1612802238492_0.8669221575410728"},"_hasShrinkwrap":false},"3.6.1-beta.4":{"name":"@mihanizm56/fetch-api","version":"3.6.1-beta.4","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"6.13.7"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.1","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.20.1","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript":"3.8.3","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for the isomorphic fetch\n### [Documentation here](https://mihanizm56.github.io/fetch-api/)\n\n### Benefits:\n- Provides validation for responses (based on @hapi/joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services, https://www.npmjs.com/package/query-string is used)\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in the\n  hard-structured response format\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n- Provides the ability to handle the response progress\n- Provides the ability to select necessary fields from the response (https://github.com/nemtsov/json-mask#readme used)\n- Provides the ability to use persistent params for all requests\n- Provides the ability to retry requests\n\n#### Request input options:\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use @hapi/joi\n- customTimeout(number) - milliseconds for cancel the request on timeout (or a full package of requests if the \"retry\" parameter is activated) \n- retry - number of requests try to request if the response is negative\n\n#### Request output options:\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n- body will be serialized in JSON if body data NOT FormData\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### Please, be careful. The response will be the object:\n```javascript\n{\n  error: boolean,\n  data: Array<IResponse>,\n  additionalErrors: null,\n  errorText: string,\n  code: number\n}\n```\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n#### Set persist options to all requests\n\n```javascript\nimport { FetchProxyMaker } from \"@mihanizm56/fetch-api\";\n\nnew FetchProxyMaker().setResponseTrackCallback(({\n  requestParams, // all request parameters\n  response, //  pure response protected object\n  pureResponseData, // response body without formatting\n  requestError: boolean, // is request crashed\n  formattedResponseData // formatted response data in IResponse interface\n}) => ({\n // do some metrics or logging here\n}));\n```\n\n#### Set callback for metrics for all requests\n\n```javascript\nimport { FetchProxyMaker } from \"@mihanizm56/fetch-api\";\n\nnew FetchProxyMaker().setPersistentOptions(() => ({\n  headers: {\n    foo: 'bar',\n  },\n}));\n```","readmeFilename":"README.md","gitHead":"2276957ba976bf646aef341e9d9c9947e7b6aeae","_id":"@mihanizm56/fetch-api@3.6.1-beta.4","_nodeVersion":"12.17.0","_npmVersion":"7.4.0","dist":{"integrity":"sha512-x/4CNa2rR5pcuokSx71bFKJLN+ue3Dt5PtLzQL2QezmzLnov7wdyyt9nkJlKDVOmzb0u/UKsTDylsUth1r1Owg==","shasum":"5f9e7fc207b15c53e25b7e449c2691ab9d5bb81e","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.6.1-beta.4.tgz","fileCount":72,"unpackedSize":121952,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgIWrnCRA9TVsSAnZWagAAntsP+gNxXrKUyQPd8fpcpAdw\nwFdxNzeN013/M5RNhh/KgSlpsKrIqriilb2/S+SY1sSrwD8LwGv4GBYvo2JH\nVj209bGNckV/h9h1iCOUUD/3lJiVMN4HUQk41SjHzn8nMbW8oBqJ7Gb3k3p9\nHPe8yzZkYGAOkOSDqa1oQQuaR+qErtBTwZXxLiybI36z106MHR1JpfvOGkMd\ngQCU5QYJhfqBJr73X7Prt0gMwTnTghHlqsBqstc7EC2ns79r075mrL14hxdV\nykX1lSj3R9moidDu7K0aDLZLLoOZP0M47zK0QZKSwBh65pVV82PLayTkU/v1\no/ZsPYUHT9egqAKFrHBEI6oinGYmELcF2qoNBTDQ5jtQIb6zJX33LgPWrUIl\nTL4C+Q57ncOUIDpWntfntynV8FJE70+t6kbGVAtfB44SmZTzdy1thb885iDg\nNbEhdXz/x8Xg3bGaqHimrAy4EY8A/6loJTGkiuWcIuIlGVs8mzuJ0YrOg2Kw\nZBUpTRC7ciaZMemNOHIluLom7i1igcMySG1UlWinrl7+bjmuGqblu1OSFK/0\n1lgn6zVLY78lv48oDdM3z5gqjvIB2BYrJZFqla0ZDHLiUlrvHjWbv08GzBu3\nnNJULFz4PLPm1GgIf98SLKOaa7TbM6PFrY+8m8eqQgt89KluoAb3XKwU8vaA\nCAjd\r\n=RETz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDCUmYvt1lVf4Smgdcf2GPIfGk3dqo4sd8VnZKntEBRLwIhAPGFXfN9i3+TacPd/HAYwCDjG0OahZ1RbxCGGee8NrZL"}]},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.6.1-beta.4_1612802791042_0.9250064585024356"},"_hasShrinkwrap":false},"3.6.1":{"name":"@mihanizm56/fetch-api","version":"3.6.1","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"6.13.7"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.1","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.20.1","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript":"3.8.3","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"gitHead":"a867aa96be20059f9a0e0e65bbf320e518a64733","_id":"@mihanizm56/fetch-api@3.6.1","_nodeVersion":"12.17.0","_npmVersion":"7.4.0","dist":{"integrity":"sha512-6MfMGKR6LpJUvgF/gMUajfy0SSetZrWhNpW7NaI5NW4xxRHs8RnOKOblQYhTCwC+MVnx3vzNhwkgGGtx6UWdVg==","shasum":"98f3a1a9159050cf04d97eedd9695ce69a6ccbe4","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.6.1.tgz","fileCount":72,"unpackedSize":122002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgIY/jCRA9TVsSAnZWagAAA7gP/01WW/yLh/Bj5W7FTObo\nnBR/PMEcx5xhka4246GkR24LWtFykhHQClWN1s/FYyStICLYRaQ3Mn21xRp5\nb8ojdTFkgXMT860edtceOC+Nk4duX+AnG4fxzwOlAWP/zTFXL/6xhjbc3CkA\nkOR5Vq4+X9qv1/VnSd2ZKvQxZLU/VrWpSf/XejWOBtzb3N0IrFJIAwkrdeQz\nj5Vvu8XwrV0SwMMuZhDFSm5XOMxXrYhON7t9zL/hPkwl4eIjG9hfqk/OOun/\n29fBOwTGvpnKoeNEOjGXC+nr/BQjceepGvelPbocyfKxL6mrBCf10VnCeeD9\njZMh/vmlz+LmDznVRwDXXv57tHHdNUKu+iSmiCse9o9YowUyXrD+DzPq/UCO\n6oOsRiQXsMVYlQ4HjxdUXYm/0uI5sc3HbqlmKIfuar7EFIX75TiYpgkzjKr5\nk+dZUlE+2THNEFrmKGM0RvKqJKO+LlwBVjZ7GQnky/HxtzZnpqtQ1cvC3Fga\nTrgr+2rKX2hHiXBM3Othh4X8VXEZrhWNoyqdXjtwE8BuXbDeIrE6ErEOgBxm\nZfSswytg0higBQbyZjUuCWgF8xEg+Bh7PeHs9a0W8KryWAPKyay3nsl/hB4m\neTK/ievTwKNrPk4BAYcM66PQbjaGJBXeE8UGpVZfWkmLCSOW+o92JMt8UCB5\nvynF\r\n=YxD7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCiraiI3VbGvy8kU/xEFyNIrAw92zTq9jPlZsCZ6mmBrAIhANqbKuU5wAHkkKw5xaTfPVBdxdrMfwrCJCWVTWWCK7YS"}]},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.6.1_1612812259268_0.09581954065470333"},"_hasShrinkwrap":false},"3.6.2-beta.1":{"name":"@mihanizm56/fetch-api","version":"3.6.2-beta.1","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"6.13.7"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.1","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.20.1","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript":"3.8.3","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for the isomorphic fetch\n### [Documentation here](https://mihanizm56.github.io/fetch-api/)\n\n### Benefits:\n- Provides validation for responses (based on @hapi/joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services, https://www.npmjs.com/package/query-string is used)\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in the\n  hard-structured response format\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n- Provides the ability to handle the response progress\n- Provides the ability to select necessary fields from the response (https://github.com/nemtsov/json-mask#readme used)\n- Provides the ability to use persistent params for all requests\n- Provides the ability to retry requests\n\n#### Request input options:\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use @hapi/joi\n- customTimeout(number) - milliseconds for cancel the request on timeout (or a full package of requests if the \"retry\" parameter is activated) \n- retry - number of requests try to request if the response is negative\n\n#### Request output options:\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n- body will be serialized in JSON if body data NOT FormData\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### Please, be careful. The response will be the object:\n```javascript\n{\n  error: boolean,\n  data: Array<IResponse>,\n  additionalErrors: null,\n  errorText: string,\n  code: number\n}\n```\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n#### Set persist options to all requests\n\n```javascript\nimport { FetchProxyMaker } from \"@mihanizm56/fetch-api\";\n\nnew FetchProxyMaker().setResponseTrackCallback(({\n  requestParams, // all request parameters\n  response, //  pure response protected object\n  pureResponseData, // response body without formatting\n  requestError: boolean, // is request crashed\n  formattedResponseData // formatted response data in IResponse interface\n}) => ({\n // do some metrics or logging here\n}));\n```\n\n#### Set callback for metrics for all requests\n\n```javascript\nimport { FetchProxyMaker } from \"@mihanizm56/fetch-api\";\n\nnew FetchProxyMaker().setPersistentOptions(() => ({\n  headers: {\n    foo: 'bar',\n  },\n}));\n```","readmeFilename":"README.md","gitHead":"84519804b5328144446131ad60e6fcec5cd75f07","_id":"@mihanizm56/fetch-api@3.6.2-beta.1","_nodeVersion":"14.15.4","_npmVersion":"6.14.10","dist":{"integrity":"sha512-XvuC63ruIQD4GzFcpsaADvsMMlz5N5TGJ9Mw5efI8bnVXKJNErW2/X3l2o8IKS9X9px+k1OJk/VwhpARFIwU4g==","shasum":"2692515793cc29f590064fbcb0a559c8f4d755ad","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.6.2-beta.1.tgz","fileCount":72,"unpackedSize":123304,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgIdCSCRA9TVsSAnZWagAA3eYP/02qT6DIqCFtLxI/WXG4\nXA6+wi9rDPHeO6mt6r2RkqNnsI/leIjj8dJZBtdqrpI9sPc0gF2RJ+Trjhn5\n/Lr7nPKRtlKnKWznKOkPhax/Gen3SEYDK5FfQoVZIBe0OIsZ7d+5EAA2GBxS\nXl1+dBEI28QFfaKj5JSdJW6Fk6jsBatQkmdecdmoAsRfKLreObE6iKE6AukH\nDv98L9IPGJIxdyDSbIVY+6mEK8/Owpv38OtfBlJ21Dvf4TcmJGeRVlINwbc+\nakJJicT1f/TkYhaSKROcO1JC1ZvQ5uWDAGNe1GGs5zR4MvTwK5yiZVLdwiYb\ncI7SitxV3IL0eHNmf3c2SmFd1KBafXqCONvTFmAHYDXME0lOEGFXw8ytMTIU\nQKZT1NFsBWO4uDHlG0WIZMtwXDu5c69AYIBwcPCbTAih2oHWXgFlwwg8jpSJ\nSbjeeTsYtCB0BRw3wu9XQ9K1Cq4bjvo0Akj3sOA/rqJdmbL7UCGje0o7N2Zt\nflLQ/sj0tsOfOTVJ+nLs8pVBd32/rpl7z8zngxjsZU9RfmcRb742PObPz/cx\nHeydL1l941HjFmWW5nMSTiUKcxctpWX+BGJax1pq2omv55ksGbQpMc8TUlXc\nVJqKlm4voYl1Cjv7mFf+tuZSNvJ13UzdVpNHuoDXoKJTOzu52Ud7LELeY5lF\nfYe2\r\n=Pzc6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICmGBeyOY+6McFbdxcUO7nnSxv1RKh8AiPWsrhl/7k7iAiB0KPDws30ZCGJLXaDrqOGyj4dHAxxr7CwuRb8LSAj/oA=="}]},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.6.2-beta.1_1612828817747_0.28152080370443566"},"_hasShrinkwrap":false},"3.6.2-beta.2":{"name":"@mihanizm56/fetch-api","version":"3.6.2-beta.2","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"6.13.7"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.1","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.20.1","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript":"3.8.3","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for the isomorphic fetch\n### [Documentation here](https://mihanizm56.github.io/fetch-api/)\n\n### Benefits:\n- Provides validation for responses (based on @hapi/joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services, https://www.npmjs.com/package/query-string is used)\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in the\n  hard-structured response format\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n- Provides the ability to handle the response progress\n- Provides the ability to select necessary fields from the response (https://github.com/nemtsov/json-mask#readme used)\n- Provides the ability to use persistent params for all requests\n- Provides the ability to retry requests\n\n#### Request input options:\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use @hapi/joi\n- customTimeout(number) - milliseconds for cancel the request on timeout (or a full package of requests if the \"retry\" parameter is activated) \n- retry - number of requests try to request if the response is negative\n\n#### Request output options:\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n- body will be serialized in JSON if body data NOT FormData\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### Please, be careful. The response will be the object:\n```javascript\n{\n  error: boolean,\n  data: Array<IResponse>,\n  additionalErrors: null,\n  errorText: string,\n  code: number\n}\n```\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n#### Set persist options to all requests\n\n```javascript\nimport { FetchProxyMaker } from \"@mihanizm56/fetch-api\";\n\nnew FetchProxyMaker().setResponseTrackCallback(({\n  requestParams, // all request parameters\n  response, //  pure response protected object\n  pureResponseData, // response body without formatting\n  requestError: boolean, // is request crashed\n  formattedResponseData // formatted response data in IResponse interface\n}) => ({\n // do some metrics or logging here\n}));\n```\n\n#### Set callback for metrics for all requests\n\n```javascript\nimport { FetchProxyMaker } from \"@mihanizm56/fetch-api\";\n\nnew FetchProxyMaker().setPersistentOptions(() => ({\n  headers: {\n    foo: 'bar',\n  },\n}));\n```","readmeFilename":"README.md","gitHead":"9b70391a81dcd1bc0c14eed77dda4fd5a5e20bd2","_id":"@mihanizm56/fetch-api@3.6.2-beta.2","_nodeVersion":"14.15.4","_npmVersion":"6.14.10","dist":{"integrity":"sha512-Y/M7gWnFaoJpTZCMGJur/e0hl36Cw7kZdqeFUQN7TEVR87QSVCLNzzklQiAaNCe3wcYXmEJ8hMO+rJ09Ya6EWQ==","shasum":"f59ff051784af5b6ea40baa7a5a0301648d019e5","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.6.2-beta.2.tgz","fileCount":72,"unpackedSize":123894,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgIdPPCRA9TVsSAnZWagAAnFIP/jjLcvBOt2OhSRND8Cow\nzokvDzxOgnj31LcCWrHN30VSbzqps0NkMNVSiP/ZgiTI/Lv2yqargBqpR/1m\nMkUwsIf7tf6uLjGkFO0LoD1bdzyIJg+mD4o2r80U14YMuh+n9QVR3p/Tn72Y\nknFWYLb+kk6W6r4lwqILX26n0aoyD/b81FQRDH0yUAvAZcdjBIJo53wxSjfq\nc1dovMV2MVvhod46jK/G64yHKk0pPNqamvJqw9GboBv+z8UOclg7Xni5QASK\nHlwzbY3G64ivwgIPkMlCO/z+s28gsvd4+2PRKQvAY48a8uodhUXFMjZcQ5S4\n3QYcjFIBRJ5YOy7rPMX6pX1fAMMeV07IqfXxwtsqvao4eszM362Hesik+ngJ\nhhsU2myojGSelnndEuDJE7U3eg7h8p8xOpQq1s1MR1c37FZbuNcNgoWzINSm\n27uuvXzMsCfmjg4TQWqlUO+YcA1fX4TrxvA+LMM5Asp2McGsj5PAJ5blgJrt\nwsQpeviabRgOxn2s91cDPLGp8oHvp3RKBiCgvGZXW1zTpAl1LTIWONtgIuZU\nVRoMMirAhU9xXSLnOYKzuYOczC8D7sSHKVIkfs/t9fknU/ZOkdnLe8xR4i4C\n3dVWx1PR+dsTWZ2NZ9lvbQFJA8bw0wY+qPmaH8luQ8wxHWLteXadyXAqQVce\n2nt/\r\n=IrT/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDUK94KY7JrkWiWx9CqouS7yNtm14TcyGv6aoDgn8CcugIhAMjdkf9987TSEDfbzMuMsBCXYMDZwShzQVARXUzv55dE"}]},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.6.2-beta.2_1612829646894_0.45924658095006254"},"_hasShrinkwrap":false},"3.6.2-beta.3":{"name":"@mihanizm56/fetch-api","version":"3.6.2-beta.3","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"6.13.7"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.1","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.20.1","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript":"3.8.3","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for the isomorphic fetch\n### [Documentation here](https://mihanizm56.github.io/fetch-api/)\n\n### Benefits:\n- Provides validation for responses (based on @hapi/joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services, https://www.npmjs.com/package/query-string is used)\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in the\n  hard-structured response format\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n- Provides the ability to handle the response progress\n- Provides the ability to select necessary fields from the response (https://github.com/nemtsov/json-mask#readme used)\n- Provides the ability to use persistent params for all requests\n- Provides the ability to retry requests\n\n#### Request input options:\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use @hapi/joi\n- customTimeout(number) - milliseconds for cancel the request on timeout (or a full package of requests if the \"retry\" parameter is activated) \n- retry - number of requests try to request if the response is negative\n\n#### Request output options:\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n- body will be serialized in JSON if body data NOT FormData\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### Please, be careful. The response will be the object:\n```javascript\n{\n  error: boolean,\n  data: Array<IResponse>,\n  additionalErrors: null,\n  errorText: string,\n  code: number\n}\n```\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n#### Set persist options to all requests\n\n```javascript\nimport { FetchProxyMaker } from \"@mihanizm56/fetch-api\";\n\nnew FetchProxyMaker().setResponseTrackCallback(({\n  requestParams, // all request parameters\n  response, //  pure response protected object\n  pureResponseData, // response body without formatting\n  requestError: boolean, // is request crashed\n  formattedResponseData // formatted response data in IResponse interface\n}) => ({\n // do some metrics or logging here\n}));\n```\n\n#### Set callback for metrics for all requests\n\n```javascript\nimport { FetchProxyMaker } from \"@mihanizm56/fetch-api\";\n\nnew FetchProxyMaker().setPersistentOptions(() => ({\n  headers: {\n    foo: 'bar',\n  },\n}));\n```","readmeFilename":"README.md","gitHead":"a9ee83395380aa93a6fc7d481c7dd70628fad7ed","_id":"@mihanizm56/fetch-api@3.6.2-beta.3","_nodeVersion":"12.17.0","_npmVersion":"7.4.0","dist":{"integrity":"sha512-kgEsiuyssWsBG1hqleefRCia6/IsuvQ2qeO0iFmABDKmbfNQll50EQHbNjstYc7UkROOv8EizkKfAP01HBJGjw==","shasum":"790a0ea93f76fd0a11cda6dfc2a9b0d10cd55d78","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.6.2-beta.3.tgz","fileCount":72,"unpackedSize":123893,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgInJSCRA9TVsSAnZWagAAdZ4P/2KwkGtAYGdH8IZBqrq1\nin/yP8ID6d1FrG25Ywe0bP5yumwwMXrmNOL01sXsheqy3V5g/mxmrgThBpLI\nO+qiAXlJ0M3WU743BWZ6JRMj/TmWI2ssDLzDs5nPjImn/yefdzGYHIkj0OS3\nluNOeJgKGON7onhjcrg/8JUYxcz5c7ln+8C+fRBcOJxIylawy13Be6KlAoWO\n4ljIIYXb+62+cRu7o1iJuZeGXZ5h1TO4U4CDeskSGFsO01F4EyBxecVvQJv9\nU7Tqz2O9FWaOvzqzgXcTANrEMTr4Lk+RKIVjTKlorFn5UO5YfJ3HsDmakePX\n6hX+bS68z7FG1uz3OMS3JxlxeWyWBVkJjciuhDNvsQYnOHMAHeNAG180F9iA\n94LItK2/PfIC9lt1VMw/8EzZsHsmmFmASWsKFSZSu5Z2LBjB6plf1fqCTAbs\nDnanMue79C1dN0KZC+Bhifl4YWX/E9N5GglRa/Cpjc3yM2WUDNPDTuzPEP50\nIAFCjGX/CdJ5W+VqAYxI+whM4lrccrKPqKsA5F3aNpszf5+wSciJhxdNcvDA\nRdMU8S7rX7KgyfB+Dh7hSlEmu4dsgSiYGj0JayhkJgaQlrX6upXhqC1xHzC/\nCV1YnjcHRhC3zrJQMgqGTT2E45DgAoH6FmSGPtyVghxVH1qnGQ4XIsr7/Gtn\nZh09\r\n=hH2u\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFX3U950/5yyKxCpabj1S3CiZiPRZ5rX8hKFxi/MPZgrAiEA8+2RQQN6Rxm/wYsVKWyFqmaV0K1dF9kSaaiDxMKWSnk="}]},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.6.2-beta.3_1612870225600_0.6786654526581224"},"_hasShrinkwrap":false},"3.6.2":{"name":"@mihanizm56/fetch-api","version":"3.6.2","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"@hapi/joi":"17.1.1","colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"6.13.7"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.1","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.20.1","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript":"3.8.3","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"gitHead":"d62e5c55b60ce87d6b8b9b1a04a2fa9083546f03","_id":"@mihanizm56/fetch-api@3.6.2","_nodeVersion":"12.17.0","_npmVersion":"7.4.0","dist":{"integrity":"sha512-G1WUpA0wwgv71JBWyc/mTAugvg1iZUN8eW8zhsyUvgSBjEs6I5r5dc+RohjLsNLOaw6sLbr5v310jUVM6zBdeg==","shasum":"9a18c7c0201f107bb5890d0ea374542f5e26fa49","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.6.2.tgz","fileCount":72,"unpackedSize":123886,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgIsXKCRA9TVsSAnZWagAAjO4P/RDErIcxHnfLdtcudGpm\nUslrD7BJKcCcXefXIkUf+6oBY6jy56524zM2wM1kPaBZMYD4BHJUfw/QvmEX\nbJV2CKfhKj8eV3yqurQZWx0/8syFxGAKOJwPY2iBwhItamyWU+J9peZ2eOim\nWqW1S+bikDhqPX19mi6hTCUC5PxF/7A6JOuRnyXcrI0fPFMPuTr+a0S4Jvu9\n+xG8ko/w5UTq7t9ONqd474KZ2FR3C2IWAOanYp2biZ0bg2+vCf3sXfM0Y43I\nHNQGwrRiRBGf3+Ou0Q5nadL1u+NPazgnsRnw10CnSDbN9tu5lk7EgJXxxWTI\nJ2bW6HJ1mirPuVzA8ltT6/Vwg7ec0GtLKzBQHr30VyQL8cQ1Il/PN0LRn+gU\n0LZsFqcAVn07NazcIvpaQd9AmdZtn+iilQlvcmFLcAiqjIzz6zKlISwOYn3v\nl5Rc74oZkkCdGQjUlYIMp+DjgfEoThFEBsrg4CQN3gXYzv7TIfMJkceiX/Qd\nS+VkME9W2nnmEwTUDoHMxjgB3fVlLxiNOTBzKWGLzxSShAm7jrwP97+4EYUF\n1tFKm9Cj35fyF6jTa0zJIPHK3OuGUmKIH3oqDVrFCOT7k3s9NwrfFGtOTl9u\nB6xt1K3TwY7mWAP75t5moCtNiZ1+6A4lumUkOhyCq9smqq7d5YbF6JxeV9GU\nZMr2\r\n=LY09\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC6Fu8RHgMp6FiEk7h785VmGWx4qkCQglHdQ8WW3F5JPAiBIeWYIg6tj1r2vEjS8H/vHdK07LNxWrTCmxCa8+Y//Fg=="}]},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.6.2_1612891593754_0.24180607735253945"},"_hasShrinkwrap":false},"4.0.0-beta.0":{"name":"@mihanizm56/fetch-api","version":"4.0.0-beta.0","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"6.13.7"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.1","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.20.1","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript-transform-paths":"1.1.14","typescript":"4.1.5","@hapi/joi":"17.1.1"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for the isomorphic fetch\n### [Documentation here](https://mihanizm56.github.io/fetch-api/)\n\n### Benefits:\n- Provides validation for responses (based on @hapi/joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services, https://www.npmjs.com/package/query-string is used)\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in the\n  hard-structured response format\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n- Provides the ability to handle the response progress\n- Provides the ability to select necessary fields from the response (https://github.com/nemtsov/json-mask#readme used)\n- Provides the ability to use persistent params for all requests\n- Provides the ability to retry requests\n\n#### Request input options:\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use @hapi/joi\n- customTimeout(number) - milliseconds for cancel the request on timeout (or a full package of requests if the \"retry\" parameter is activated) \n- retry - number of requests try to request if the response is negative\n\n#### Request output options:\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n- body will be serialized in JSON if body data NOT FormData\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### Please, be careful. The response will be the object:\n```javascript\n{\n  error: boolean,\n  data: Array<IResponse>,\n  additionalErrors: null,\n  errorText: string,\n  code: number\n}\n```\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n#### Set persist options to all requests\n\n```javascript\nimport { FetchProxyMaker } from \"@mihanizm56/fetch-api\";\n\nnew FetchProxyMaker().setResponseTrackCallback(({\n  requestParams, // all request parameters\n  response, //  pure response protected object\n  pureResponseData, // response body without formatting\n  requestError: boolean, // is request crashed\n  formattedResponseData // formatted response data in IResponse interface\n}) => ({\n // do some metrics or logging here\n}));\n```\n\n#### Set callback for metrics for all requests\n\n```javascript\nimport { FetchProxyMaker } from \"@mihanizm56/fetch-api\";\n\nnew FetchProxyMaker().setPersistentOptions(() => ({\n  headers: {\n    foo: 'bar',\n  },\n}));\n```","readmeFilename":"README.md","gitHead":"f5357ef209f148e198f75dfb49089c78d85dacd6","_id":"@mihanizm56/fetch-api@4.0.0-beta.0","_nodeVersion":"12.17.0","_npmVersion":"7.4.0","dist":{"integrity":"sha512-53jP+0sNKT8vR+lkPdlcuPAizM5Rc59cHW7yC7u88IA/fQd8mlPnxq0xsQVzZsx2Eb8yoNJb2OccTgyhyBVBOg==","shasum":"297214fc59b02b73fcb536f8b6d7e7138ac40008","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-4.0.0-beta.0.tgz","fileCount":74,"unpackedSize":129559,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgMpe1CRA9TVsSAnZWagAAR2cQAKQUj/1Pu//CrakDdl78\nf+QqXN27o/3QhTztCpNZJ9D71stAy50AYOOouMyzO2W7kfy8qzYoxp/lrHcd\nkg6dl2usEQlftx6Pmd1Pfx4mabj/ExSt2dui72EftK/QEiEi3ZedOhuUnH4/\n1kGCKXi9OSnp9CdPPFmjEEV1KjqHhry0WcUCVFepWIOyw+pBXx5sLt4s7GNM\nHBPcbaSb3juobGIFbPeuuore0SnANTWlZsB6Wg8uyt8xL8LJowIe5/a4up2J\n7TNClVDAmt/C/NPX/4svLsQ9VQjI5PuTkDYSA5HY6Sh47oM4fV2l2yKuqdHr\naJ+x8DdCfANjtysOyIryGzpblsQkakeDhCcRlmjxElvOUdwzh068Kt0iL/Q6\nfstDUQzuISh3p7Ay6/QHXTHhPIsEIHxbqQImiTsHX2fKc1kYM8JX8gPAnc71\naM5UB3+OMmxvRljjWpUjC850mYtPweskny1DuajcJRIkLdikvaF/oGXQwGsP\nEvRG60snSqAuNthWB3a2H8avlWg4bpWevFh6nE/T6l3yU55Nul4I8BDRjml1\n7WwU+75i39/USxb9qGu4Cg1/P95rVZeaDH5bozBKh6l+sGgAz+jJbEwUzXda\nzBXqs396cAMHZZ23cJ7BQkxg5QN8t10JDz1UYlk10ZkAafVxfgR4QhKsNj++\nquuq\r\n=/zSm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHmfgvBlA0gre3KKvbsnRpHioKYNure4EitH9/Q7WoEaAiEA2FskKpCqLbxVvCqVjHDiizjXCoyaSd6TjgwoxP+00No="}]},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_4.0.0-beta.0_1613928373206_0.19359297492697558"},"_hasShrinkwrap":false},"3.6.3-beta.0":{"name":"@mihanizm56/fetch-api","version":"3.6.3-beta.0","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"6.13.7"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.1","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.20.1","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript-transform-paths":"1.1.14","typescript":"4.1.5","@hapi/joi":"17.1.1"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for the isomorphic fetch\n### [Documentation here](https://mihanizm56.github.io/fetch-api/)\n\n### Benefits:\n- Provides validation for responses (based on @hapi/joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services, https://www.npmjs.com/package/query-string is used)\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in the\n  hard-structured response format\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n- Provides the ability to handle the response progress\n- Provides the ability to select necessary fields from the response (https://github.com/nemtsov/json-mask#readme used)\n- Provides the ability to use persistent params for all requests\n- Provides the ability to retry requests\n\n#### Request input options:\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use @hapi/joi\n- customTimeout(number) - milliseconds for cancel the request on timeout (or a full package of requests if the \"retry\" parameter is activated) \n- retry - number of requests try to request if the response is negative\n\n#### Request output options:\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n- body will be serialized in JSON if body data NOT FormData\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### Please, be careful. The response will be the object:\n```javascript\n{\n  error: boolean,\n  data: Array<IResponse>,\n  additionalErrors: null,\n  errorText: string,\n  code: number\n}\n```\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n#### Set persist options to all requests\n\n```javascript\nimport { FetchProxyMaker } from \"@mihanizm56/fetch-api\";\n\nnew FetchProxyMaker().setResponseTrackCallback(({\n  requestParams, // all request parameters\n  response, //  pure response protected object\n  pureResponseData, // response body without formatting\n  requestError: boolean, // is request crashed\n  formattedResponseData // formatted response data in IResponse interface\n}) => ({\n // do some metrics or logging here\n}));\n```\n\n#### Set callback for metrics for all requests\n\n```javascript\nimport { FetchProxyMaker } from \"@mihanizm56/fetch-api\";\n\nnew FetchProxyMaker().setPersistentOptions(() => ({\n  headers: {\n    foo: 'bar',\n  },\n}));\n```","readmeFilename":"README.md","gitHead":"85e2265f6dd6850c145e4de081dd7e587063eae9","_id":"@mihanizm56/fetch-api@3.6.3-beta.0","_nodeVersion":"12.17.0","_npmVersion":"7.4.0","dist":{"integrity":"sha512-+2C/WCzXiwZj4MXbXULoQuyCJ08msKcf3HI+F7eAkw4WfNs/qDKqWhmjWiPr+KY4ZRUXGdtCJHnQPs282Y8yzA==","shasum":"fa65b5121a04419f9787129d951019246f4e4eec","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.6.3-beta.0.tgz","fileCount":74,"unpackedSize":129473,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgMqMhCRA9TVsSAnZWagAAtj0P/ivNlafLrUuIiLgmFgQ/\nRgcrA4/FOMyadPpSIr5JhnCADNOM0i2DcJNbk3ignEmHVGStPXYVdX6Xa1Lv\npSAHBvUo3T296BzH2AWTm8j55y+xQIAqTzH97tMyP6xZCgOsaisn2NYaRID/\ntu9lHoehHTdqN76uotvPif0Aipu3I/Uv440bE97siK5FoNox3NUBZAY4kSlA\nrokzo7QB1bP95XM0flMpe713wAqAxhJaZfBfLrTCrO+2EXpJx8vERhHFJLwB\ngXeTZTmjTdAXt6FE78Qso3xoL2P+jaELmbxz/vDQcl1soN93aKe6ZZYGGGKL\nqETUB7LCZMmPuTtCQMO5s4EzRBI6XOtdKwcqcELertzaEr6+sW1NxdhBiEGy\nVAE+VhuRkzgfFuXErBET1crJ0U3LS1xt9sEN0iNgj0NL0vUPEeTM6d7dzi5J\nE7AehBEWP7TNnZsz4N8koSUi4IYfUuqQ+hHRabw08I6MfwunI1VvkCSxrXmh\nfStfrM0A69j39TlaNBNAeMBuhuKdNC/oVyiR46zX4PSOquRiYfh6Heu7pEzL\nXnd08lAgTWKh//XbK2/P3HK0Fn4xD3SP/1+vnCYDihBJ5g5/1TjC2AHEXuxJ\nNV8yGExallGAyrcCrstEnTL4pptc1lcjaf8VOfbYZMnb3NLOAAicF57oQD8u\nPeZj\r\n=S1hj\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD615S7KaB4jxxcrnbKYV+F0fjOEJk0TulwkOD3WMS0xAIgeuG4+OrZNeRZRQ4I0tCYUShAivSUO56JhBMv5zmPQEU="}]},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.6.3-beta.0_1613931297162_0.8002196392105831"},"_hasShrinkwrap":false},"3.6.3":{"name":"@mihanizm56/fetch-api","version":"3.6.3","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"6.13.7"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.1","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.20.1","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript-transform-paths":"1.1.14","typescript":"4.1.5","@hapi/joi":"17.1.1"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"gitHead":"2510d6096aef9c8ef3db7f1554355865f981ff0d","_id":"@mihanizm56/fetch-api@3.6.3","_nodeVersion":"12.17.0","_npmVersion":"7.6.0","dist":{"integrity":"sha512-RVugym3J5i1C9jNEO5XRPmaU3YvhJmcsRQAGdT4jn9YDBERHVymRSTD+LQL2HWT+/V6KnYjvKY3tWKVk00XU6Q==","shasum":"10c27a63546cfddd849fd18f78746430651759c2","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.6.3.tgz","fileCount":74,"unpackedSize":129466,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgOlEiCRA9TVsSAnZWagAAhNIP/iExAfi1RYYzhGrxaRbH\nKXFKW9MkFHmLWX8z4gwqpiB7ZUCY+aLGlWMsMPcfT3gS4vCD0F2u1Epte+ju\niWnzgxpxkHt5TauoI7Q4QtCiy6qhAAX2qzDl0bT9nGPins4SqXQD0DQo5nT3\n2L8GwZRADGGalJrugPRTJyuzGuZEVFaKISxp5076LwirfcfXqoYtE8wpF89N\nT7ppfbzbSv0ZLRQjSuW8RwW5cyu+lgazOyjabqffStvAdoGe1/AJ+NnqOlBr\nk9teLnSNsJSGf6ZAAze/5ml4gxIECPkX8LZoaCHV8IWyWl8IaxVqLFl8q3Be\nBwgnkauh1zVDpN35W26tKy6hOZgj51uKSi4tuLVG9pgQlvNdXaNxTT8fL1mb\nJ9HMR0aVdQCqgXMW/+YFYVWjFaWbxtgv3kE36uHUISkv7zltXW5y1vx9fEWM\nzcvFGX5hCKLKIXOL/p6SMSkHsqET56A4DyZ2DA4mBcQAggccHFcQyZbVITxm\nx9RNFCazb9IyII5G2HZuicvQwVDIy7s0huHostfuZIOPOOe0J8Njkr+P1Xw1\n1OAMKARvsIAsHWtFKqafcG88dMmbFGqfU62y72437NCmR9d76VniNuqFE2vP\nNdo4bQVMCDjw4PfUFmI0wakFg9mcFSn0ds1h9Xm0whR2/JRtQk4+X3jb0VBU\nKqst\r\n=wzrq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCpWpiFX8KG/8G+EkJEfhFgkAYPABB2qxyUJy47248EMAIgUhHluUNopF61Kt//wnvm+ibZeqKyKAFxYHvMBQY4+eI="}]},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.6.3_1614434593572_0.1343819590172901"},"_hasShrinkwrap":false},"3.7.0-beta.1":{"name":"@mihanizm56/fetch-api","version":"3.7.0-beta.1","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"6.13.7"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.1","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.20.1","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript-transform-paths":"1.1.14","typescript":"4.1.5","@hapi/joi":"17.1.1"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for the isomorphic fetch\n### [Documentation here](https://mihanizm56.github.io/fetch-api/)\n\n### Benefits:\n- Provides validation for responses (based on @hapi/joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services, https://www.npmjs.com/package/query-string is used)\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in the\n  hard-structured response format\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n- Provides the ability to handle the response progress\n- Provides the ability to select necessary fields from the response (https://github.com/nemtsov/json-mask#readme used)\n- Provides the ability to use persistent params for all requests\n- Provides the ability to retry requests\n- Provides the ability to logging your error requests\n\n#### Request input options:\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use @hapi/joi\n- customTimeout(number) - milliseconds for cancel the request on timeout (or a full package of requests if the \"retry\" parameter is activated) \n- retry - number of requests try to request if the response is negative\n\n#### Request output options:\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n- body will be serialized in JSON if body data NOT FormData\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### Please, be careful. The response will be the object:\n```javascript\n{\n  error: boolean,\n  data: Array<IResponse>,\n  additionalErrors: null,\n  errorText: string,\n  code: number\n}\n```\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n#### Set persist options to all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setResponseTrackCallback(({\n  requestParams, // all request parameters\n  response, //  pure response protected object\n  pureResponseData, // response body without formatting\n  requestError: boolean, // is request crashed\n  formattedResponseData // formatted response data in IResponse interface\n}) => ({\n // do some metrics or logging here\n}));\n```\n\n#### Set callback for metrics for all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setPersistentOptions(() => ({\n  headers: {\n    foo: 'bar',\n  },\n}));\n```","readmeFilename":"README.md","gitHead":"785ba181b96135309946e64c459cf59798f547e9","_id":"@mihanizm56/fetch-api@3.7.0-beta.1","_nodeVersion":"12.13.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-ChlwTfGq0mEFpA37iEiGQdEi2fbj7NukEilfJbBoDWMSDqvCLynvzTW0E+2yeHdDosm0sljptz4HDw2JvRF3ZQ==","shasum":"7a1b368659740e19a110af0b71ebb2d33508f03e","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.7.0-beta.1.tgz","fileCount":78,"unpackedSize":136397,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgSBD6CRA9TVsSAnZWagAAZKkQAJgOLUaOjwAE8e0OU/sD\nvk1fmmKuTKYFzwusWaI89pwy5qT1TmahVeWNs1LrmFcB6jlAI7w7rIDTKPTi\n1ji7FGhQCcaFI3GEM8C7uWWa+l4GJayBpP/pocM2wpjQzpk15L/0RP5L+L5+\n63kElXFIQGMGib+WqUTf+6YohF4MCbv8aAj1lJGMPQJfDfT7EugXU/vFRNyO\nrFGNS3avJ8MbJU13G1l3qibiHH99KOCPNWXVdIDA14yCA8lpqI/inFnfUnP6\n1Gb7Quz3sntbFH4NZwkNxW56M6GtYowoTSZ7NP8A5bPkvcCg20K8tNd49m5Q\nz6c5wf14FJOdHrI5Gz9V4bKFa+3fRTviOALuvR7G79U14K8FHHoZ7irxOPdi\n8vP/9c9dISLLju9Uf7QfEPbcmxJ6XXx2zGngTdeKnrIcrhMmbObK3XBluuEa\noLs1MECa73CJ2jI58BkE8WxITvJsovmt///IGVJq9kaJVpXHXTNXydKgSqXE\n3/26qDpqfs8J8Na8VKs7rL5p5das7Nq6aMyLsqms5BFssKeQLrTMktTKHrgY\nPQwMm09XwPABuq6wc4FxAinmigBpUrAcMLZifPHbHiJJOmDIybvkL3aCroMR\nWcDl/lVoQ3inDWevP1u69qTmTzhKkow/irNCQRSp5QZn8YqhGFy3OZzZHY5V\nPR07\r\n=Z4SY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICgT3wa3BYB+tU0fOeSVo7bRJeU++MoD7M/omHuzA6CDAiEA2gBTkMxOiGT8SelMvjNyTU+CzQJS3Jt+PDfO3qHxlsI="}]},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.7.0-beta.1_1615335674044_0.15765106642768378"},"_hasShrinkwrap":false},"3.7.0-beta.2":{"name":"@mihanizm56/fetch-api","version":"3.7.0-beta.2","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"6.13.7"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.1","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.20.1","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript-transform-paths":"1.1.14","typescript":"4.1.5","@hapi/joi":"17.1.1"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for the isomorphic fetch\n### [Documentation here](https://mihanizm56.github.io/fetch-api/)\n\n### Benefits:\n- Provides validation for responses (based on @hapi/joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services, https://www.npmjs.com/package/query-string is used)\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in the\n  hard-structured response format\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n- Provides the ability to handle the response progress\n- Provides the ability to select necessary fields from the response (https://github.com/nemtsov/json-mask#readme used)\n- Provides the ability to use persistent params for all requests\n- Provides the ability to retry requests\n- Provides the ability to logging your error requests\n\n#### Request input options:\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use @hapi/joi\n- customTimeout(number) - milliseconds for cancel the request on timeout (or a full package of requests if the \"retry\" parameter is activated) \n- retry - number of requests try to request if the response is negative\n\n#### Request output options:\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n- body will be serialized in JSON if body data NOT FormData\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### Please, be careful. The response will be the object:\n```javascript\n{\n  error: boolean,\n  data: Array<IResponse>,\n  additionalErrors: null,\n  errorText: string,\n  code: number\n}\n```\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n#### Set persist options to all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setResponseTrackCallback(({\n  requestParams, // all request parameters\n  response, //  pure response protected object\n  pureResponseData, // response body without formatting\n  requestError: boolean, // is request crashed\n  formattedResponseData // formatted response data in IResponse interface\n}) => ({\n // do some metrics or logging here\n}));\n```\n\n#### Set callback for metrics for all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setPersistentOptions(() => ({\n  headers: {\n    foo: 'bar',\n  },\n}));\n```","readmeFilename":"README.md","gitHead":"397efb5d23f7f2a31c48ba11ba367a9ed3da4af5","_id":"@mihanizm56/fetch-api@3.7.0-beta.2","_nodeVersion":"12.13.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-vBF2Fx3XLmyJ6yLfWENTVi+Zs9kHqqxJJ6+3svLVNNp6piSuILE9S4mqmWgPw0Bx4+sKlzN2hCftbG1g5c8LAw==","shasum":"ea0d64f2421346d74dd044023f429bd5083f926f","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.7.0-beta.2.tgz","fileCount":78,"unpackedSize":136333,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgSOjfCRA9TVsSAnZWagAAI7UP/iZV30bbfHqetR445kG2\nkJIkhZ2T1guLmNmgsdjqqxCyzxpeBiTaR78cbreTopA5XWHQ3ZBR6sRCoKhp\nu3X59q/G5iY57RPKL4g3ZylieBEoH/mCKjRiswWyGfyzdmy2hEDtjb7o+Plk\nVrOx1f4/vUgEg9cHpVMVrotqzdksan9UpygPir+VMinjA8cFEsgRFEP8z8Bb\nr0EApEgEqvecMINfP7qeaGxz4Hoc6U7359do8LDSpnyhlx5iC7PfOueegoqV\nu+NdO4Kx3pyhtpV1vYsouqRVy43DWZ6p8/3ACsjCGPyKaFVsbLuCgULEaCxP\nB4nkmlh1uMiK8SH2nsTBIDTVvN3Ou8LgwvUIW6jc8GK6XNTGFzquX4GTI0qn\njlx6M7+RIt8cgNdQhOHRSq8BEuvSH2k7G6MRkPXpZlj4yfnD6jQtw4WMrcTs\nLrPIS20zxAh4+Zzoioc9Z5Szz5uEyaj2h/D4duKTVt4Pq3AxwHREXzKG7Z7W\nkFZfTUTbpKArsCM/94td6JDxtpHMZZwwXGkRyVkWNSWSh7htmJeXXg0D3lTq\nRn2YusWbZZp7DvoicTGPhm50ZCtUr0oTHLYhe5fd7Cj+m9x00IRjT6RP7OLk\nYd8magvG106cBSBnQGbDNwm5q57Q1tjYIdZfDIC3CmWQxlFLcvRoZ8KcrUVx\np53m\r\n=fgMz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDU95WTlQ+s5G/yts2sB9D2xaUU7xVeuLuAVjfgbCHPrQIgLcDnKgZvwhJ4TuFuyB2rsSUiVXL0821C9ziubchduKQ="}]},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.7.0-beta.2_1615390943114_0.559392746690041"},"_hasShrinkwrap":false},"3.7.0-beta.3":{"name":"@mihanizm56/fetch-api","version":"3.7.0-beta.3","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"6.13.7"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.1","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.20.1","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript-transform-paths":"1.1.14","typescript":"4.1.5","@hapi/joi":"17.1.1"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for the isomorphic fetch\n### [Documentation here](https://mihanizm56.github.io/fetch-api/)\n\n### Benefits:\n- Provides validation for responses (based on @hapi/joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services, https://www.npmjs.com/package/query-string is used)\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in the\n  hard-structured response format\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n- Provides the ability to handle the response progress\n- Provides the ability to select necessary fields from the response (https://github.com/nemtsov/json-mask#readme used)\n- Provides the ability to use persistent params for all requests\n- Provides the ability to retry requests\n- Provides the ability to logging your error requests\n\n#### Request input options:\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use @hapi/joi\n- customTimeout(number) - milliseconds for cancel the request on timeout (or a full package of requests if the \"retry\" parameter is activated) \n- retry - number of requests try to request if the response is negative\n\n#### Request output options:\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n- body will be serialized in JSON if body data NOT FormData\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### Please, be careful. The response will be the object:\n```javascript\n{\n  error: boolean,\n  data: Array<IResponse>,\n  additionalErrors: null,\n  errorText: string,\n  code: number\n}\n```\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n#### Set persist options to all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setResponseTrackCallback(({\n  requestParams, // all request parameters\n  response, //  pure response protected object\n  pureResponseData, // response body without formatting\n  requestError: boolean, // is request crashed\n  formattedResponseData // formatted response data in IResponse interface\n}) => ({\n // do some metrics or logging here\n}));\n```\n\n#### Set callback for metrics for all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setPersistentOptions(() => ({\n  headers: {\n    foo: 'bar',\n  },\n}));\n```","readmeFilename":"README.md","gitHead":"d5ed588e3a8b3e0e133ef6a03627b516482a6b3b","_id":"@mihanizm56/fetch-api@3.7.0-beta.3","_nodeVersion":"12.13.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-3SqL0nK7qWj4g1ptU8cTRKW4SHNMAlQ2DHwt/7K/FxXFGZ141cQmcVZ8iZ+FhzL15fFyG5rb4XJ+EaVB/d5ONg==","shasum":"77f27ad1b3caf5bd11a7f58155e507fa329f99fe","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.7.0-beta.3.tgz","fileCount":78,"unpackedSize":136648,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgSRphCRA9TVsSAnZWagAAXZQP/jcgxjnmZdgm7vDJT+2M\nac9tOz7vtOyKFT/30DvbjeWuMyu9U17aKfx/BioPfw8mSM4KrFIujviSnvfb\nmJYaj15cCG1EDVnu6y/ucXvENitc+9u29u01Ap9t7iLEaOeo3l6pLRaHyQOG\n7mtAl9A8ZhyKGmH2OS3p9wq39nG6ZCm40l7B03Lb8DUd+SoxqkHsH06C+tKr\nbHZFwuz0XEgk8s41TFoTZ3RPvnzfuSilLIjYDccTiByDIlXdJe5xi2+1ajii\nFY5QXh18LYa1YxDTN2T8+ZvKks2tNfLSxHiZXXM7TLIqN0GtwvcmNARFuouG\nEw4QehuQxLyamkoBWslcSVEzoDgg/zM/G2BTS/AkPKbl6a5+rc5DePqzRNBz\n0G695VMj2B1ZH2BGxV2iq2DvheVUu6/9UmyRJL8lCUZJbl7C44AT32q1Ehha\n8MsNUsxYjqY9UfZBZBqn5HHbCElSax40leEdJDDOZIbx4ea+N0jN1ogGurcL\nJBNIjmCq06kYdmAtDESHHlmURldCFmIyTYqea1vn2EscbnPl/5d2gWMk1l3R\nzFCEu9paM7KRNsmBvanb6zt3fkmN6tRViNUB8W/AkxxhF5LT7Wyz7SmLPTpC\n6cXldq4ukkFiK0zFmWjRm5ijs4D+BZEoq1E+/ReT+PacTOTJH/2QWLe7bPl8\nuLn/\r\n=3qtA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQClMUlHaLIMIX+17dIffFvpOlP7aEbnFrsIs+pX2zGzOAIgQufSMvxVcwaWzDgO/I8onR7v+lITKtBK7iuXTzbPzxA="}]},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.7.0-beta.3_1615403616623_0.5278785628742253"},"_hasShrinkwrap":false},"3.7.0-beta.4":{"name":"@mihanizm56/fetch-api","version":"3.7.0-beta.4","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"6.13.7"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.1","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.20.1","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript-transform-paths":"1.1.14","typescript":"4.1.5","@hapi/joi":"17.1.1"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for the isomorphic fetch\n### [Documentation here](https://mihanizm56.github.io/fetch-api/)\n\n### Benefits:\n- Provides validation for responses (based on @hapi/joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services, https://www.npmjs.com/package/query-string is used)\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in the\n  hard-structured response format\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n- Provides the ability to handle the response progress\n- Provides the ability to select necessary fields from the response (https://github.com/nemtsov/json-mask#readme used)\n- Provides the ability to use persistent params for all requests\n- Provides the ability to retry requests\n- Provides the ability to logging your error requests\n\n#### Request input options:\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use @hapi/joi\n- customTimeout(number) - milliseconds for cancel the request on timeout (or a full package of requests if the \"retry\" parameter is activated) \n- retry - number of requests try to request if the response is negative\n\n#### Request output options:\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n- body will be serialized in JSON if body data NOT FormData\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### Please, be careful. The response will be the object:\n```javascript\n{\n  error: boolean,\n  data: Array<IResponse>,\n  additionalErrors: null,\n  errorText: string,\n  code: number\n}\n```\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n#### Set persist options to all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setResponseTrackCallback(({\n  requestParams, // all request parameters\n  response, //  pure response protected object\n  pureResponseData, // response body without formatting\n  requestError: boolean, // is request crashed\n  formattedResponseData // formatted response data in IResponse interface\n}) => ({\n // do some metrics or logging here\n}));\n```\n\n#### Set callback for metrics for all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setPersistentOptions(() => ({\n  headers: {\n    foo: 'bar',\n  },\n}));\n```","readmeFilename":"README.md","gitHead":"8ff8cc2a46429881179f70449120a2f14277a153","_id":"@mihanizm56/fetch-api@3.7.0-beta.4","_nodeVersion":"12.13.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-xWiMDA9iLdYgfdcpHDOAgot0UYOSMeufsyXykmtlv8u2b212FhyZ/h10iDwWzAHbG/j5e2DBv/tYr4sYusRmUQ==","shasum":"8213fb349112f51a8858cb9fd38807ade3d736b9","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.7.0-beta.4.tgz","fileCount":78,"unpackedSize":136724,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgSUXTCRA9TVsSAnZWagAAVqEP/jBfuHQpVqbXaEQWAmdm\nMhoQwmkfObTEYnVVuXHMhkoQoVebifzwq2YbEJhcvphaMkHVSwzA0fkt578g\nCqZLbB+72+LiuXvuDJIbBNPxNtXOiuTYq9PaA609BI5lNGnwSMKWo5SqQGrv\nxpALACOYsI/BnyJaANXWrkRUtv1stysciDKCvQN+CxoubTMQc9csC46ySUqe\nA72Qk7PnnTHM6tcOpM3fjDZql1HPbaURb/YJ5YitkduBD9SgyIgS4hsTKpKz\nqBUCqeSJNMhOA/1JR5G/t8RUFDqfUtkpG0unl5J5Sp/z+GGw0IVQJwzwUMTO\nMXQOmUl+Py9S1w4HHgcs1qjCcmWMrftE/zWxcsSadbs3Js7QUyUmQPKuPZGf\nrLjPmLPlVelYVSAPJSobSneKIuf4V3Pu/k8olGmxNgnc3G+0IF2WgCHaCXQn\nFSEidLaN+IHzVmNqOcjpdOv0oBWUpEjn+cTOO8N6/Kiyf6tj2cHVT2WYA4ZU\nyhq+GEHKvEv8i2fldpFCCibeyXgzfxiaIE8N2XL38Z4by+TQG0A6C7w2VLit\nyChgDtIqAi6RlHcKmkHs6qWV4TrvC8wWhTxkOexLipPvRjQwm5/40l0joEJh\nF7+fMNFXP95PKMaHT/nlls/YqZLNceCaB/o5TeK/5BaUv6U6YnlEBjaAI4M0\nxqjz\r\n=C+mp\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEg1MX+xwsQMKRMAa0LOtko3bVNkRo7U8PwKDIh8kEhHAiEAsfZehYy525UrqLY+sx4AyawEhI/9eY69qs2IlPxijnM="}]},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.7.0-beta.4_1615414739160_0.9790385486854252"},"_hasShrinkwrap":false},"3.7.0-beta.5":{"name":"@mihanizm56/fetch-api","version":"3.7.0-beta.5","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"6.13.7"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.1","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.20.1","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript-transform-paths":"1.1.14","typescript":"4.1.5","@hapi/joi":"17.1.1"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for the isomorphic fetch\n### [Documentation here](https://mihanizm56.github.io/fetch-api/)\n\n### Benefits:\n- Provides validation for responses (based on @hapi/joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services, https://www.npmjs.com/package/query-string is used)\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in the\n  hard-structured response format\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n- Provides the ability to handle the response progress\n- Provides the ability to select necessary fields from the response (https://github.com/nemtsov/json-mask#readme used)\n- Provides the ability to use persistent params for all requests\n- Provides the ability to retry requests\n- Provides the ability to logging your error requests\n\n#### Request input options:\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use @hapi/joi\n- customTimeout(number) - milliseconds for cancel the request on timeout (or a full package of requests if the \"retry\" parameter is activated) \n- retry - number of requests try to request if the response is negative\n\n#### Request output options:\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n- body will be serialized in JSON if body data NOT FormData\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### Please, be careful. The response will be the object:\n```javascript\n{\n  error: boolean,\n  data: Array<IResponse>,\n  additionalErrors: null,\n  errorText: string,\n  code: number\n}\n```\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n#### Set persist options to all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setResponseTrackCallback(({\n  requestParams, // all request parameters\n  response, //  pure response protected object\n  pureResponseData, // response body without formatting\n  requestError: boolean, // is request crashed\n  formattedResponseData // formatted response data in IResponse interface\n}) => ({\n // do some metrics or logging here\n}));\n```\n\n#### Set callback for metrics for all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setPersistentOptions(() => ({\n  headers: {\n    foo: 'bar',\n  },\n}));\n```","readmeFilename":"README.md","gitHead":"4bfa19729b382d384d65f5fd427dbf95bcba5f92","_id":"@mihanizm56/fetch-api@3.7.0-beta.5","_nodeVersion":"12.13.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-sjUCn+hxPMoz+er/inYgIxF8O4utmoxZw2tilQjqpb5Dz958UAV6mp2LMxOGjs+pjkodfvUhlDDub77rYWBa/g==","shasum":"985f275c65ce4333e27c20bae1387cf10f2e58a3","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.7.0-beta.5.tgz","fileCount":78,"unpackedSize":136760,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgSdzbCRA9TVsSAnZWagAAjVQP/Aiq8q8k/IiBSbWNYC2r\nofOObdyTzKDo8fiQ6heoWX61D+ahDo3XaZqI5cymHgJhgI5K8EC/0NUCebiK\nlTaPb4NHjc9VaveuGoWlzbFwY5gAWdtTlaWG6NAIyCl2aumun8pqAbu0G06G\nKRIRGCKf27i9DVOnFiMKjoyn0ZoSsSdJQO92wVVzNkgBgmK9+y4SBknbAS12\nCR9IQlnOtoaNVbHw5dU4HIhiJQcnyAnX8ed/qqE2SS+FVrF4o+e4EekccR/i\n6vTSRC9RrtYUEmWBB8sM9A9YWYGzA8GcotX7UDB/BfV6zcNQFfpQT9yvqwpt\nDsElw+Sef1KGQo1YERhCQuOPVGmWv71By7X7+mg0U0bXDg1Ln31YflpzIY1X\n+uuj/A422RT6eqWQa2YCYbeWnt8HIZhFO1gVZpZwYTToo64RHr7nBCgAq1Jg\n7AMMLwWt4ZbqeTA+ANv6BE1t54JJqS9DHv/4WD6rKxTq2DXpUlql/kwhUtpt\n9l+Y2jRAfeJzoEsdIv/ePJoR/2WIQ4/nyE3gFNSUFwCLlZPVELlsZfN5hmPa\nym5rl03KK5n7aaqXTv5AgAuM9devTDL5mkjW+vBuT5gTZWIlp/AkHRSiXA4o\nDsYpmSF3s32aqbhGZxD7v2mvq6RbPxWBHFyS1RTrReZRHTdOsSzOWhm6XmOL\ndwC1\r\n=JY8M\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCfW9RMifQyoHgPgf7m8RzvPEU6CMwYHmHf7M5nGJ64WQIhAOpgnFvurbY7r1eoQXk7Kh0piFeZm+DSHZ4KuilMiuWO"}]},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.7.0-beta.5_1615453402694_0.20137029134151696"},"_hasShrinkwrap":false},"3.7.0-beta.6":{"name":"@mihanizm56/fetch-api","version":"3.7.0-beta.6","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"6.13.7"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.1","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.20.1","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript-transform-paths":"1.1.14","typescript":"4.1.5","@hapi/joi":"17.1.1"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for the isomorphic fetch\n### [Documentation here](https://mihanizm56.github.io/fetch-api/)\n\n### Benefits:\n- Provides validation for responses (based on @hapi/joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services, https://www.npmjs.com/package/query-string is used)\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in the\n  hard-structured response format\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n- Provides the ability to handle the response progress\n- Provides the ability to select necessary fields from the response (https://github.com/nemtsov/json-mask#readme used)\n- Provides the ability to use persistent params for all requests\n- Provides the ability to retry requests\n- Provides the ability to logging your error requests\n\n#### Request input options:\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use @hapi/joi\n- customTimeout(number) - milliseconds for cancel the request on timeout (or a full package of requests if the \"retry\" parameter is activated) \n- retry - number of requests try to request if the response is negative\n\n#### Request output options:\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n- body will be serialized in JSON if body data NOT FormData\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### Please, be careful. The response will be the object:\n```javascript\n{\n  error: boolean,\n  data: Array<IResponse>,\n  additionalErrors: null,\n  errorText: string,\n  code: number\n}\n```\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n#### Set persist options to all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setResponseTrackCallback(({\n  requestParams, // all request parameters\n  response, //  pure response protected object\n  pureResponseData, // response body without formatting\n  requestError: boolean, // is request crashed\n  formattedResponseData // formatted response data in IResponse interface\n}) => ({\n // do some metrics or logging here\n}));\n```\n\n#### Set callback for metrics for all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setPersistentOptions(() => ({\n  headers: {\n    foo: 'bar',\n  },\n}));\n```","readmeFilename":"README.md","gitHead":"8c14ec7fe2c616082976c0420485e3f23986d126","_id":"@mihanizm56/fetch-api@3.7.0-beta.6","_nodeVersion":"12.13.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-gq9dxNHLfXXJMs3bMuneyybnY4FCWof3bKTJHdUzafcQEBqD4hbmvpNqDdHcSuZ4O7AuUDUTrxnUz/E64HVHOw==","shasum":"577b2e78adbdbcb0aac08bfc7d8cb673600bc1a9","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.7.0-beta.6.tgz","fileCount":78,"unpackedSize":136735,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgSeClCRA9TVsSAnZWagAA6F0P/2oadzSgvIQx1Fzje4uP\nhOlB/luUVa1FSFlmIhzrRxr2itHpKWABZlBRAxrxMzjZy0yUrGGpfz9DEUaF\nfbJCw9lhnwQFtkPim8J8jry2OlZAVIP7MdwDVJbSHez4sZph7Aeo0mw8Xp5D\nD8+AaF3Jol7qZ7AHLr6078SS/qUuOluj2hcLETiQO7BKyZK7osAVSQvdjTWf\nbPNiBrfyBYouGS8nVUBu0pEKoq+IunOwW+JHbvE1MEmTYHk2w7l0+tUhfdsR\nptKegOW4bT1Af37cg73kX3MI45euWTd3sD+IutsG0Uzl9n7ORpHV5v3yBxK2\nGkl63zeLHyRM52nt6Sk9zpJsMz2QAkhoK4lDouJxREhn1VbQQJEI1tn6PJs8\nPQMjXuF+n/Wod6Fa3JxUIIZgqvny0FQPVUcVk0tPh14DsjQrfz+cDyZ3y3FJ\nwomeHm+xsmm6mj4dhfiQ6YuSxYPvySYUPFOd48h3Scx2nzVQBjO+h2Evcfc1\niLf1UEhQV+cY6N7v/ZpUCj+oe8gvMd+f+VN66UcOfB+ponISyykVsUrOqkUm\nutjjpkH+iGip9PHCr58qWph1XWFP6oBAT3T58oSV/pqeLBy8kVuD9DhECk+8\nSsmduOHWW6Y+5HdqqT+6ckLLCdOHpAQjqUJqP7pdVc4EqpN9xRzmmy60Ktfu\n2Glm\r\n=T/kM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC+l6xko3lD7XzIvSySWXjnwKYWyLQ0LEAoiZy8xniitAIgXMwMC/wa0LXMTszbr/Q3juWt3PE1CSrO9cCA7gzDTvk="}]},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.7.0-beta.6_1615454373022_0.831516406354063"},"_hasShrinkwrap":false},"3.7.0-beta.7":{"name":"@mihanizm56/fetch-api","version":"3.7.0-beta.7","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"6.13.7"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.1","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.20.1","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript-transform-paths":"1.1.14","typescript":"4.1.5","@hapi/joi":"17.1.1"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for the isomorphic fetch\n### [Documentation here](https://mihanizm56.github.io/fetch-api/)\n\n### Benefits:\n- Provides validation for responses (based on @hapi/joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services, https://www.npmjs.com/package/query-string is used)\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in the\n  hard-structured response format\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n- Provides the ability to handle the response progress\n- Provides the ability to select necessary fields from the response (https://github.com/nemtsov/json-mask#readme used)\n- Provides the ability to use persistent params for all requests\n- Provides the ability to retry requests\n- Provides the ability to logging your error requests\n\n#### Request input options:\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use @hapi/joi\n- customTimeout(number) - milliseconds for cancel the request on timeout (or a full package of requests if the \"retry\" parameter is activated) \n- retry - number of requests try to request if the response is negative\n\n#### Request output options:\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n- body will be serialized in JSON if body data NOT FormData\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### Please, be careful. The response will be the object:\n```javascript\n{\n  error: boolean,\n  data: Array<IResponse>,\n  additionalErrors: null,\n  errorText: string,\n  code: number\n}\n```\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n#### Set persist options to all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setResponseTrackCallback(({\n  requestParams, // all request parameters\n  response, //  pure response protected object\n  pureResponseData, // response body without formatting\n  requestError: boolean, // is request crashed\n  formattedResponseData // formatted response data in IResponse interface\n}) => ({\n // do some metrics or logging here\n}));\n```\n\n#### Set callback for metrics for all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setPersistentOptions(() => ({\n  headers: {\n    foo: 'bar',\n  },\n}));\n```","readmeFilename":"README.md","gitHead":"5824a198e0419d0db75d01514bbbe6c88aeb32df","_id":"@mihanizm56/fetch-api@3.7.0-beta.7","_nodeVersion":"12.13.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-wQq6moRrSEniG3joKCAMJ8V13psVGoevkJjo7UGxbR9IO+WujCgESKwHl1ay77axDinKNJPQSdXn1AKFrasz8w==","shasum":"b284109a8c1f9e11746a97662deb4208931af16d","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.7.0-beta.7.tgz","fileCount":78,"unpackedSize":136765,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgSh1NCRA9TVsSAnZWagAAR4EQAJOJdUbV3JqsIJo03Caa\nZMD0TgZAvL45oPTUKiWdPYX1772GA/1iteP3HXj03UYNEVmA9lwSSx9/xb0w\nKoIRQYfAVtjGnGIgvMs8gWpoG/Ta/mDgzq2kMkqVtjRrIHHM8Kx6xApO4ZuN\naAkKIOvZDvOR9ERUFprWHAmQIcmmw1dyBZQs983+9M22jU+zzAR3giwLx92y\nzI/ZpXR6+0BsUsaB5AG9EL0ogRRDgdD6aOMrngHKiWGPjmnUKnDdl4I5TOlJ\nHcLJaKUBqVCaqCCmF0ea6uFOJ6t8DUWejDjkEfoe4lqxpEe0Nd5hOIynoz56\nGGt01SeudlIZWemzGWAIQoI5BSglbX91z4AFp/Vw2iETsdWa0Y71EHxyFZY/\n7+OImyfM341EZP5jzHwmr5vXp+IX5JB+C4STbH5X9NYzjCUH3PNvvEL45iX+\n7Wp+4RAIwueSZIVs2lh77sUJ22iUt+FNf7f7PNiIDFJeQ+hCEfkjJ/USeZUr\njVoF7MFYrZ1JZ8e0BK4avqT9QKPCM9VlSDAkpNLarQhOu2gJ37W7EVYxl4Vq\n11KGzdhhrzoZPGNMtiwl0jW3EL6sQS6+mFGgj6hAzN9Tqvdwrmb4v8WPWP6/\nYiBw9u9YpQedy4NETyyvnj5E4SuLbSpMDFOXB5hqoITzMWXeh/ryVDIpfQEV\n8Yi/\r\n=UYhf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEiTpmeFfN1Hl81d4ZmiaphobqlxYtyoq5RXPpwD2NiNAiEA2T+MkQNWIfn7QoeB/Z1Xyld7vEfyLMgjzbdix51JAeU="}]},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.7.0-beta.7_1615469900573_0.5144106135681137"},"_hasShrinkwrap":false},"3.7.0-beta.8":{"name":"@mihanizm56/fetch-api","version":"3.7.0-beta.8","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"6.13.7"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.1","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.20.1","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript-transform-paths":"1.1.14","typescript":"4.1.5","@hapi/joi":"17.1.1"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for the isomorphic fetch\n### [Documentation here](https://mihanizm56.github.io/fetch-api/)\n\n### Benefits:\n- Provides validation for responses (based on @hapi/joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services, https://www.npmjs.com/package/query-string is used)\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in the\n  hard-structured response format\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n- Provides the ability to handle the response progress\n- Provides the ability to select necessary fields from the response (https://github.com/nemtsov/json-mask#readme used)\n- Provides the ability to use persistent params for all requests\n- Provides the ability to retry requests\n- Provides the ability to logging your error requests\n\n#### Request input options:\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use @hapi/joi\n- customTimeout(number) - milliseconds for cancel the request on timeout (or a full package of requests if the \"retry\" parameter is activated) \n- retry - number of requests try to request if the response is negative\n\n#### Request output options:\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n- body will be serialized in JSON if body data NOT FormData\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### Please, be careful. The response will be the object:\n```javascript\n{\n  error: boolean,\n  data: Array<IResponse>,\n  additionalErrors: null,\n  errorText: string,\n  code: number\n}\n```\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n#### Set persist options to all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setResponseTrackCallback(({\n  requestParams, // all request parameters\n  response, //  pure response protected object\n  pureResponseData, // response body without formatting\n  requestError: boolean, // is request crashed\n  formattedResponseData // formatted response data in IResponse interface\n}) => ({\n // do some metrics or logging here\n}));\n```\n\n#### Set callback for metrics for all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setPersistentOptions(() => ({\n  headers: {\n    foo: 'bar',\n  },\n}));\n```","readmeFilename":"README.md","gitHead":"fcdb4338db561d60747af61fdc07aa8b085dcb0e","_id":"@mihanizm56/fetch-api@3.7.0-beta.8","_nodeVersion":"12.13.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-vHs6ww2ISMXtYO4SkTj9ADttlD2jzFz/o4c+wRle/G9YjSjiAhkKc5qvfYQX8KPcYKs3aIWoJVrLDpz7QgWAcw==","shasum":"32083ee000c003ad469704a368e97ec05c5bd7d6","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.7.0-beta.8.tgz","fileCount":78,"unpackedSize":136798,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgSmLDCRA9TVsSAnZWagAAFjYQAJJQQdOHsapGaor/6d96\nMoEzqSjdPMY7SR5fHNVFeER6Dddqnvqr36jK0c7evdAs9cTpqnwa3qSAmSvE\nPWwAFua4arb5TDPh8fGJIySvvm7Mr9T1d7jjgtRYYbwAkYWIvLB8AIJ+FvAv\nkAt3321Y/hlfmoJFhsaWvnPp+fOYRCeN+doJYsPqE/UYp1jcwOV612rcClj3\n2Vj4j6Fl6F/2Nw902VuEXbbXRnji7X27c0k//X/xnFM765IwMYZ8IkiHbwcY\nxca2XLuqHhOdqeJJJ0wEhmOs0OT6AnZT27cpIR4jIyjChJVIAzVFbpC+WZJ4\nNZiMI92IuTVH7leBZ7X5BBRCsPn5IVZ0/zknFBjIDOPlLd/rLqTZ3oLtGfEC\nbazH832aDnKqXNfMPKEStt759qsaGgtYZS9Ty9iK/h8HfhJCcd8Bv3X92s7e\niOULoEdy/bzYhSlr2UPqZoS2ZVYNADoVeX9FXnzc9LWswTYlHlztIs/9pRWv\nPSkyDDvCTeM1AbSIEVqhVDX5hZ9/5a8m6k2ihY8y9Xds9RmlwyvJyyUeTXpn\n2hXlqfttt3eSxqVpfG+l4swHqMtHtQ1Q49GCe34QMctwY+SGsYVENv86s6IU\nlzeXHq9bfBpzF1xfU9GChAeJgVwuWrBnk060DzYT0/Kt+vrn6/QERsUY/J+J\nLGpX\r\n=WCiM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFJYVoHqzOegPBLl19F0gdCSMaabwn7t92zXkN9OocYXAiAX4U2ZfXdC8Pm7Fk4jnhAncBMt00lbP/+upWJhWuRiUw=="}]},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.7.0-beta.8_1615487682592_0.060608463721016914"},"_hasShrinkwrap":false},"3.7.0-beta.9":{"name":"@mihanizm56/fetch-api","version":"3.7.0-beta.9","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"6.13.7"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.1","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.20.1","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript-transform-paths":"1.1.14","typescript":"4.1.5","@hapi/joi":"17.1.1"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for the isomorphic fetch\n### [Documentation here](https://mihanizm56.github.io/fetch-api/)\n\n### Benefits:\n- Provides validation for responses (based on @hapi/joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services, https://www.npmjs.com/package/query-string is used)\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in the\n  hard-structured response format\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n- Provides the ability to handle the response progress\n- Provides the ability to select necessary fields from the response (https://github.com/nemtsov/json-mask#readme used)\n- Provides the ability to use persistent params for all requests\n- Provides the ability to retry requests\n- Provides the ability to logging your error requests\n\n#### Request input options:\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use @hapi/joi\n- customTimeout(number) - milliseconds for cancel the request on timeout (or a full package of requests if the \"retry\" parameter is activated) \n- retry - number of requests try to request if the response is negative\n\n#### Request output options:\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n- body will be serialized in JSON if body data NOT FormData\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### Please, be careful. The response will be the object:\n```javascript\n{\n  error: boolean,\n  data: Array<IResponse>,\n  additionalErrors: null,\n  errorText: string,\n  code: number\n}\n```\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n#### Set persist options to all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setResponseTrackCallback(({\n  requestParams, // all request parameters\n  response, //  pure response protected object\n  pureResponseData, // response body without formatting\n  requestError: boolean, // is request crashed\n  formattedResponseData // formatted response data in IResponse interface\n}) => ({\n // do some metrics or logging here\n}));\n```\n\n#### Set callback for metrics for all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setPersistentOptions(() => ({\n  headers: {\n    foo: 'bar',\n  },\n}));\n```","readmeFilename":"README.md","gitHead":"a57a88dc766c52d2e1fa05d270d59afd827d7047","_id":"@mihanizm56/fetch-api@3.7.0-beta.9","_nodeVersion":"12.13.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-cQ1XQzVI/YIikANW+1jWeLcQUX8R0juSjqvL3l4P9VGhjf0kydzwKyYilU+F6HCU4kDQRyeo9F3sK4GBLk7lZw==","shasum":"0f21e22da2f676c443d99660039abd01d53d1ae0","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.7.0-beta.9.tgz","fileCount":78,"unpackedSize":136754,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgSmP9CRA9TVsSAnZWagAANqIP/0vbj1GwmSYE8nIqhcX4\nv87d853sPNs1+GDlqPOW4i5aGUTWMi7jY4dnI6UrdxkTqTO7dYXcmOJ7lo09\n/g/AEba+nEt7t7kjT7QsK5AMFWBDU5yzILxEBlTo5KU/64XX9CWFRX+tKZ6/\nZlOrEdFWvRok07MgJqSDi9w91t8p4qxBwvWEJ0UL1mYwrBNLb0ugBnbshUJX\nFxf5g6n8kJekeNsg5m9Lv1COw2eobAnbgZMXahFvvB5zr09jrVLexpn8PEUm\nPAwUariZ8GUMdpzJaz7KZaDHloNFsN/XMi1vRjo1G5Xu283MH3Rwula7/6Xb\nMe5117GP1qPFRLPdV1Elnl92vhFVUYr5YGfKu1sj+zUuzaDoX1R9rLJBhEKw\ngCzueyAucqVLViYHvvx/Fb7mZbNpmhk18whTnF3fWnZTDTVvabWZraDsOtFN\nxzmpEBuuHM5FCeM8YKeTk5Wti37v7YC0htFAX4LS+NeEC4TnHdBNRSyN+Uen\nAt0v9HDJ7tzTXz/YU7dGsoEE4NgkdDvEvWobFE/x0cTgYOXiY1qnuMKH/vKi\ngyyFVR8s1nxxswHdDyuOMLm8pyISwnh7UDdCemTp0ZDXoBRNJXy/1NhIhqR9\nP3unOdxq/SnbekIXvmXfsjU+b0LWpfq5U7xdaw6cEGcnYTxGkK5MVk+5srjo\nyy5e\r\n=+Nvq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIG+QPt6QhEQjCaJU5pa5bJzip+MWPTTNvrCZ5MiIFz3uAiEA/pQ/1pNHjjvuKfFEuoRSoOV30QDFYQ4housgHmbLd/M="}]},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.7.0-beta.9_1615487996625_0.504018873724887"},"_hasShrinkwrap":false},"3.7.0":{"name":"@mihanizm56/fetch-api","version":"3.7.0","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"6.13.7"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.1","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.20.1","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript-transform-paths":"1.1.14","typescript":"4.1.5","@hapi/joi":"17.1.1"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"gitHead":"7ba72df54e13b4bbc611b83a9b699cbd38ed9517","_id":"@mihanizm56/fetch-api@3.7.0","_nodeVersion":"12.13.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-zRvZocgVx2Q8f5g/RYENW0SoBTbP8wfiAHkva6d6dCTRIqBWlaT81H7tSV8QD6Syw5yp/IB+XoCJo/dveAU2Wg==","shasum":"df4f926db65fa6227ee10617ba3de4d40164ace5","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.7.0.tgz","fileCount":78,"unpackedSize":136747,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgSnJjCRA9TVsSAnZWagAA0nYQAIEmgIXWQjTouQxJaDgX\ndgc+9HVm5DI4s+XFwCyOj+twWg6AdirXC8JMR2/+nFYVRRcWjPcqB9dTRDKI\nh6Iik0CDMEaaUf1idTiUA8gTdFv2G2RWELiVogx1kS5Mh4PurglnwL50+yYt\n05IH7xLdA+owtqoxjIw8WYzW53nMrHp7Rm0XUanmOehI0azLWw3CSpcD5m4j\neRBy/qY4+TcTn37ZBXhJbbnAe8NMGwhYYxQ9/AfOfdlpi9zZHNDaN4AydtYJ\ndAwTQx7Kz0/mcEJ8+ruE3LfQS35wArDlfJ4AlOEKfJisejdyK/7q4Os/oZov\n2ubKPsXDCajdfLsCS5timwcEhne/dsticSZo7cR43LPZbiku7gClnyxjLUw1\nTCHJGRZMi63q6Inwc1KrG426qkRxpv46Shmoujhc/EPp15nnAyaliZ38MvvQ\nt13YrX4c+BNoVtaZ2MhlCZPJrIIlI52B0yBITpSUHG80CZhEl7zl4k6+dqDZ\nuj/YHXoWytXQ+ynaMweXfslktv/Xl1+xIK1tb+9uoITTIrzrqGkLmYtk061S\ndnETxFEqnHMR0Jcvd7e7vfN6BtZuJrysW2UUFtdxBXi2/cRuYB+gXFW0FCgN\nsNs/1QcvWTfDhJrKe1xZOlFEtQa/joZqiwW3mVICfILlc9YGRm0qCkIZMi4k\nPsuw\r\n=iImH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDJe06INI4HJ9fli14n9+F8gw3X8SKiFkEgj91sk2axQAiAdEIeBYiqd/U3iU/9naBfncRneGMnX1jTcaUrYngEWOQ=="}]},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.7.0_1615491682663_0.3697940821199446"},"_hasShrinkwrap":false},"3.7.1-beta.1":{"name":"@mihanizm56/fetch-api","version":"3.7.1-beta.1","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"6.13.7"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.1","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.20.1","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript-transform-paths":"1.1.14","typescript":"4.1.5","@hapi/joi":"17.1.1"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for the isomorphic fetch\n### [Documentation here](https://mihanizm56.github.io/fetch-api/)\n\n### Benefits:\n- Provides validation for responses (based on @hapi/joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services, https://www.npmjs.com/package/query-string is used)\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in the\n  hard-structured response format\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n- Provides the ability to handle the response progress\n- Provides the ability to select necessary fields from the response (https://github.com/nemtsov/json-mask#readme used)\n- Provides the ability to use persistent params for all requests\n- Provides the ability to retry requests\n- Provides the ability to logging your error requests\n\n#### Request input options:\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use @hapi/joi\n- customTimeout(number) - milliseconds for cancel the request on timeout (or a full package of requests if the \"retry\" parameter is activated) \n- retry - number of requests try to request if the response is negative\n\n#### Request output options:\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n- body will be serialized in JSON if body data NOT FormData\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### Please, be careful. The response will be the object:\n```javascript\n{\n  error: boolean,\n  data: Array<IResponse>,\n  additionalErrors: null,\n  errorText: string,\n  code: number\n}\n```\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n#### Set persist options to all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setResponseTrackCallback(({\n  requestParams, // all request parameters\n  response, //  pure response protected object\n  pureResponseData, // response body without formatting\n  requestError: boolean, // is request crashed\n  formattedResponseData // formatted response data in IResponse interface\n}) => ({\n // do some metrics or logging here\n}));\n```\n\n#### Set callback for metrics for all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setPersistentOptions(() => ({\n  headers: {\n    foo: 'bar',\n  },\n}));\n```","readmeFilename":"README.md","gitHead":"af7552781e1e8bafc907bb16eea4c3d794aff9bf","_id":"@mihanizm56/fetch-api@3.7.1-beta.1","_nodeVersion":"12.13.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-A4pj57IaDhUWg3P8/UCKxZQryIH8taWOjZuAnA0e3NFjFnPStEwVUM/jsfuOt/KUQ+5CvHKphLrEvg0HyeHgWg==","shasum":"8c08dea8b866e4bf98ae8648170d7d680a6c3938","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.7.1-beta.1.tgz","fileCount":78,"unpackedSize":136975,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgaeLUCRA9TVsSAnZWagAAOeIQAJTILqarDKvVuhyksCXp\nwdENsQaiOqrLTvuQsZutUWjrhhft+wZ267soNiEkMy2I5ZPLIPnjzcDzQaRX\nQKo7qeumwiUNo/bBGd75m1HyWF/UZN4zQ2PG0lA7W/fqWFy2VWnmE5cGXVSs\nvVO6JE1yxHhf+ZIyjZmpI+0uMybaZEU4//n9Sv4BeEbaJ/5Vs1pBiyTqGws0\nTbG69zqPu3qgbF4jbYLdOz0nxDpvGImsdZf+7hdnd/JHIPTFMnUeVLK7BXZH\nzF003gqvwCxAW9NgFSjzFGey3QF09k+sAKleqZFg9/QvQy3hcJ3yVHPuRg3F\n1IEtvMLhoBzatyuidEau0EzqvpglAgPFpuXPyuD4SD59I/S7gItX9wWqbkMP\n0+ffWv20rrDq9LMwAgciqMb3aN5RldIMgfPNXy0pV2jmfoP8/pvjQWB2YogT\nbFcXPrGw89MhshUckomyCkmqMNtvh4cyo4y146LvnxZVj9Q81YaQ5j74niov\nDEc/S07IHLFoGummrB2KjYCzjW/MLi5MBdUeHKhBZb1+ge1/gm8S298PyLSK\ne/M3RZbPjUJFRE/Ia12JcwMFpFDSEaKWAGtwUb5PTH9B6WRyS8Xk6NNRsL+w\nP21bm1jiIvX1aKKHBjSqhmIe+tWafBLzlN18yBt4/fkNJIKCxa3dLGlO8Wc6\nuTtD\r\n=LJTP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGqhaLX2Wh9l3VeuOIXTRax/BSHEXOWV9zbvln7mkQ69AiEAj5HNBse/6JJalkzcYiQ32lvOqTOYIFbIxyHBYVyfbdk="}]},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.7.1-beta.1_1617552083693_0.17613469248281888"},"_hasShrinkwrap":false},"3.7.1":{"name":"@mihanizm56/fetch-api","version":"3.7.1","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"6.13.7"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.1","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.20.1","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript-transform-paths":"1.1.14","typescript":"4.1.5","@hapi/joi":"17.1.1"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"gitHead":"ebe2ddedd90c08d0bdf452635897381fc2364025","_id":"@mihanizm56/fetch-api@3.7.1","_nodeVersion":"12.13.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-svdJcSzhk1lcfJu4uTxb/LC9EsD6IFfddKqXTBh4qH6yTS+3cuEM3LYBE9x4V/QoK+OAbkoiKJ4EXklg3XS3IQ==","shasum":"78df4aac3571cd45aca9ed78f3985f9029209ca5","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.7.1.tgz","fileCount":78,"unpackedSize":136968,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgaeZQCRA9TVsSAnZWagAAYXIQAJNdMltNKX298gn35UYG\nKPgDHBkVdPrf94+gNmq9F0Tq8owSI0edFLIkKsxAA2ixextH4IDBi4wAq8R3\nSL+rMzRTn/VxepBsp/qj3GXAMzN/5e1uDm3BGkS4J1oG29N2nGZLVhe6y9d3\nM6hW58Akz+bgtZ6sK3hlT7sGBK/TTgI7TgUTH7mXnE8BNJZRm9cclTTJzr7Z\ncQuzwMZ3zBAxg33pO89vkPEQXsL7OyfgmfdTtNOcQ7HJ2q8W/2usTGO5evg6\nOCS5aXUhC4ZSSIGfmZPQHRAXLJYNR/HZym5ai5frW498h3tHg8wJh+URS7QX\nd2kbYMrayf4kgW1R8DVlNiPMv3BUjm5BaBI23fJaO9YuYX8PdFDcoN4lg8nN\n/wx2RC2jyvehKxD2QIyyDTFhcwVK3gtAHXawPuxOmgSWvDbpqJYVPyTFiJDd\nrTZOMRV6ud1zi5bOfPrIhIElG5zYrZQkEde3pIX66FWbwnvr7imSNs9ZQnOY\nCji9PtCB6b/N3L/TjGU1lY4cUjnJsSaJPDmZ24VcQnafoCnN/jF8ELu4Go9j\nnMTZHR0q+1DQLPb1J+MVLtAG+zwKQerqy+ZHdLEsz2ITQoQN6gsNEFmT8abl\nvrpZfP2FwwITsWeXdk1V5V5gwWi6H17l4Cvujz+FfXyjPHG5T8VVa12Jb7Bb\nl318\r\n=nsvc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD17pmV7RrfDb1+P7//ldlgFQDzhd5FT93cSj6MRXXV2QIgT8ANjKRXFAo5ED/16uE/IRBwd+Ny8tdOmpwaGYMMoI4="}]},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.7.1_1617552976490_0.23818795001478676"},"_hasShrinkwrap":false},"3.7.2-beta.1":{"name":"@mihanizm56/fetch-api","version":"3.7.2-beta.1","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"6.13.7"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.1","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.20.1","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript-transform-paths":"1.1.14","typescript":"4.1.5","@hapi/joi":"17.1.1"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for the isomorphic fetch\n### [Documentation here](https://mihanizm56.github.io/fetch-api/)\n\n### Benefits:\n- Provides validation for responses (based on @hapi/joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services, https://www.npmjs.com/package/query-string is used)\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in the\n  hard-structured response format\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n- Provides the ability to handle the response progress\n- Provides the ability to select necessary fields from the response (https://github.com/nemtsov/json-mask#readme used)\n- Provides the ability to use persistent params for all requests\n- Provides the ability to retry requests\n- Provides the ability to logging your error requests\n\n#### Request input options:\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use @hapi/joi\n- customTimeout(number) - milliseconds for cancel the request on timeout (or a full package of requests if the \"retry\" parameter is activated) \n- retry - number of requests try to request if the response is negative\n\n#### Request output options:\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n- body will be serialized in JSON if body data NOT FormData\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### Please, be careful. The response will be the object:\n```javascript\n{\n  error: boolean,\n  data: Array<IResponse>,\n  additionalErrors: null,\n  errorText: string,\n  code: number\n}\n```\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n#### Set persist options to all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setResponseTrackCallback(({\n  requestParams, // all request parameters\n  response, //  pure response protected object\n  pureResponseData, // response body without formatting\n  requestError: boolean, // is request crashed\n  formattedResponseData // formatted response data in IResponse interface\n}) => ({\n // do some metrics or logging here\n}));\n```\n\n#### Set callback for metrics for all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setPersistentOptions(() => ({\n  headers: {\n    foo: 'bar',\n  },\n}));\n```","readmeFilename":"README.md","gitHead":"5a04bb178b06aa833df9a6dde5011c2b303d34fa","_id":"@mihanizm56/fetch-api@3.7.2-beta.1","_nodeVersion":"12.13.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-PpGV20C3Oc7Go2LHUWvlbjiXxqYCndleWaLc+WWWq+aq/UBiCu5afZXsxUmGVkjcIAnK20cBalWLgylioKIm7w==","shasum":"c76e4f2b96a7ec77ed7371b3e62f38accac1db70","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.7.2-beta.1.tgz","fileCount":80,"unpackedSize":141544,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgdsZLCRA9TVsSAnZWagAADEoP/iO5hDzAsu4GJW+blu/x\nZT5GF9t4tZLxyJGzGqnVimEZAqirKZbqU/wuDQWOFTFPu6vxMnyq4fIcxOde\nCoY2bYIPyTQsWRvHqDmRXICWc4O3eCBt5yRHAc5udnS5RN3ZyfrmvZcIYZ6u\nue/dGEGdMlcS4siXWux73cDgpADGBjAu1xO0M7X3Lc9NhFgPkucOZg7gm1BS\nNQMX7RLjCEDgIm1pnNvpGtGarYbfq0sP5N2JMIGomKSikPBZpnONukLfXLka\nczJZf4BWai04LubeXJTcxyh1hbZd209fpKp9864KiOzuJbpKc964lCQHLpwi\nvpImhrCpgbpIjUXuoA+n5x7vITZwN6xyfyXZ6BOuP21ozBzgxFaWYgpB3r90\n63FedkZ/MEkrtfYbjKl1Vl1MZHk9x/Hd95gGYFbrdBNA+0/yKgSv7kwW7Xy9\nTLaIlVMyoXdU7gmfjNWEGapQGM7socVkVFaNFhd2fsMdxXi85Q+c49vGLd2v\ng5HYHVlOUdVCzbJidZk3W+lppb5UzvyQcSbZPpnY+bXjgl4wWHHsqGSkUjfQ\nHZbTshs/30V854oovsDfI68lmQw6fLTsWwmaTcUUy7BXPG7kjddU6mVXyOdd\nEwBigjABINCOe7MgLbgIR4MyN6Bza9fhvajcvgjxMJ4jE3Mh3tLMo+JEPBU4\no0yo\r\n=4cjf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDjuwGQaLcqCAE26WyBCSw8k6vRXiRkN2v6Mn2GZA9FngIgZuSQTbzQbyyscnV33xxomt3lknudqWs++lxzz4wD4UI="}]},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.7.2-beta.1_1618396746355_0.2750540502413126"},"_hasShrinkwrap":false},"3.7.2-beta.2":{"name":"@mihanizm56/fetch-api","version":"3.7.2-beta.2","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"6.13.7"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.1","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.20.1","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript-transform-paths":"1.1.14","typescript":"4.1.5","@hapi/joi":"17.1.1"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for the isomorphic fetch\n### [Documentation here](https://mihanizm56.github.io/fetch-api/)\n\n### Benefits:\n- Provides validation for responses (based on @hapi/joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services, https://www.npmjs.com/package/query-string is used)\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in the\n  hard-structured response format\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n- Provides the ability to handle the response progress\n- Provides the ability to select necessary fields from the response (https://github.com/nemtsov/json-mask#readme used)\n- Provides the ability to use persistent params for all requests\n- Provides the ability to retry requests\n- Provides the ability to logging your error requests\n\n#### Request input options:\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use @hapi/joi\n- customTimeout(number) - milliseconds for cancel the request on timeout (or a full package of requests if the \"retry\" parameter is activated) \n- retry - number of requests try to request if the response is negative\n\n#### Request output options:\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n- body will be serialized in JSON if body data NOT FormData\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### Please, be careful. The response will be the object:\n```javascript\n{\n  error: boolean,\n  data: Array<IResponse>,\n  additionalErrors: null,\n  errorText: string,\n  code: number\n}\n```\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n#### Set persist options to all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setResponseTrackCallback(({\n  requestParams, // all request parameters\n  response, //  pure response protected object\n  pureResponseData, // response body without formatting\n  requestError: boolean, // is request crashed\n  formattedResponseData // formatted response data in IResponse interface\n}) => ({\n // do some metrics or logging here\n}));\n```\n\n#### Set callback for metrics for all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setPersistentOptions(() => ({\n  headers: {\n    foo: 'bar',\n  },\n}));\n```","readmeFilename":"README.md","gitHead":"78cadac61674007464eeed6f1c61d078d52cf2c9","_id":"@mihanizm56/fetch-api@3.7.2-beta.2","_nodeVersion":"12.13.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-WNYGOYtdZ9KRk1OtDTA8dWwN/DapXmJT9fgck6rhWo8HH2u5/YEErc0r2UgIil6oxbGK5BxojYC75jjVTAy4cA==","shasum":"a407e42638ef94b6b1bf9f4533dc85c9be628fd7","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.7.2-beta.2.tgz","fileCount":78,"unpackedSize":141337,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgdseuCRA9TVsSAnZWagAA4TkP/35YIQkF+omr/UBo3FrO\nNIGcLypr4Rym0JP955u3/py6/V4hBhFGZoe7+kxdIGARL/UaUuS5MqR5sex4\nc3LI4o+OCeLRNOiM3G670CU3AibqXl4F1d7JO2BUTT413AToDU4jLtbRV0PK\nIMOd8RU3PQrsOF4HHl6FhIP49CWcAXPnCggrak6VRDA7l4OrwAWU6joefx0E\nr5ifB2Oi82CfHnGWbKueLafT2rOxuDTm5/R5jfcam7N4ycNPGoTZDk0+uOTo\noPiRAy/+GXjcePXLq5uX/WFRwUWQM6Gato0WQmKWWtA+2TAhmzSBCieLDWNj\nyNb75s9b3tSAcWIpJYiM93w4NxS4Zxj5ukIxhxyyJ1fnRg791ocHnK0w/63r\nESt40sSDbV6IJsoKrrfYWebCPQ5qvaN1m1DtFLrCo+gJv40rg/vRQtohnGRz\n7rJFnGyvRB2FIiozWHk6wvg6DPxOIs6WWiT0JOffhWDK+hmqrJtB/OEmrXpx\n2nvkELH/KxfExUGG7i6oJv9Bqe0p2NG1f+f/ZDexYi8uKvBdUE5tqx8vqrla\n4SbOO0WDKo/R2lBB6UoC+xLnGu/0W1CtQkm9MI1I57tRB1lYGdI6RocGVgrd\nAsWEXrO1W+284nT6GQd4QyIHwIbH9q4Sh7OYZSuoCugQ38JA/806W809qdWh\nY7Sd\r\n=HCQm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCYRRM6e1w/14W2V/RrXnVtuWbl5Pu1C4dNyj5wqk0aNAIgYdH/DRo1++bZsgcKjclJuc7q5lKVenm4sgoNVJmdQAc="}]},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.7.2-beta.2_1618397101623_0.42062107857805975"},"_hasShrinkwrap":false},"3.7.2":{"name":"@mihanizm56/fetch-api","version":"3.7.2","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"6.13.7"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.1","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.20.1","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript-transform-paths":"1.1.14","typescript":"4.1.5","@hapi/joi":"17.1.1"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"gitHead":"470083172ff113b4f22cd18cb83e8c8ee698c7c8","_id":"@mihanizm56/fetch-api@3.7.2","_nodeVersion":"12.13.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-uHWx11KVsAZC3xVuemt04kDDBgyTcJsPR2OWPFz6dKDD1QS2QDahsHvVOzZJw8Reh8cGGmvq75En9lVIv9pBQg==","shasum":"69b881c0c9759d895925a84625c2b68561b364d2","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.7.2.tgz","fileCount":78,"unpackedSize":141330,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgeXhvCRA9TVsSAnZWagAAUHUP/1Ymk2Co2WMjaEgfk+dR\nEXLjLXLEE0XP6PmQGfFcHrWqiXv9rfu82WPz8VxjvjZZrL4+knCiHRMlbYU1\nEuqgkYhv25DLgNO5lfyLEHkjTplDA1dM6BOQgKPbmAoNTaWM/ivnGc19MQd8\nJpPm3VpyIUclEpcsISDoiiTOG35d6ZuDveemLFU6RFKUDMhbevcWlHY6lTmA\nGZ+wuyRQsm6Friyk6jrfutvhsMRoyGmj9koysvAUvEYb+cnZvztkKf22rtvw\nYUPDqNs3Wv7TkzCNmtTVAo7SGJwxvwc0lqrSXjkxXlLDeCb1VLYUvBaGqmwq\nLHdoTC1F38L2VEBDJWzYedqBBw3PZrzOAs7QVYh4PwyO1XDFc55mns4S85D2\n+EoZeyGCLruKbZPaJ1ObnWyMSioOIfdHgU+BWqgkCKUHC8lEKecwk5J3y9XF\nHDXkvZE/S0uW74YH3JxxX8w/CAesmCDJOcSFcwzJVuY/cZMMFJPY25gcfDNu\nXrYBEq+4bKV/kvC7UeN2nZDfXXZNfpC3hi8YfoFPAysXIP5VBt72oc1Xwjnz\nrh6Enw+P2N/NBr4/ypBlIZolNEX/hT/qUlqCeu1GCjek2wk3tJlQ+vAzKTix\nDpxR6vHd0i7hWOSf8WxTEg781puoSpepOy49vSLmG0GK8hn9sr7mFwPBw3Yr\nXDAF\r\n=+o4d\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDEgA67JDwIDAxtohWZKv3DPkqxhyBMmSKewOcgwTJdnQIhAKC9LjaRqOOTD+6qVFM2QpjiPeHcsSm7InEl9aGYYVB6"}]},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.7.2_1618573423250_0.5609016615599496"},"_hasShrinkwrap":false},"3.7.3-beta.1":{"name":"@mihanizm56/fetch-api","version":"3.7.3-beta.1","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"6.13.7"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.1","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.20.1","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript-transform-paths":"1.1.14","typescript":"4.1.5","@hapi/joi":"17.1.1"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for the isomorphic fetch\n### [Documentation here](https://mihanizm56.github.io/fetch-api/)\n\n### Benefits:\n- Provides validation for responses (based on @hapi/joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services, https://www.npmjs.com/package/query-string is used)\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in the\n  hard-structured response format\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n- Provides the ability to handle the response progress\n- Provides the ability to select necessary fields from the response (https://github.com/nemtsov/json-mask#readme used)\n- Provides the ability to use persistent params for all requests\n- Provides the ability to retry requests\n- Provides the ability to logging your error requests\n\n#### Request input options:\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use @hapi/joi\n- customTimeout(number) - milliseconds for cancel the request on timeout (or a full package of requests if the \"retry\" parameter is activated) \n- retry - number of requests try to request if the response is negative\n\n#### Request output options:\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n- body will be serialized in JSON if body data NOT FormData\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### Please, be careful. The response will be the object:\n```javascript\n{\n  error: boolean,\n  data: Array<IResponse>,\n  additionalErrors: null,\n  errorText: string,\n  code: number\n}\n```\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n#### Set persist options to all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setResponseTrackCallback(({\n  requestParams, // all request parameters\n  response, //  pure response protected object\n  pureResponseData, // response body without formatting\n  requestError: boolean, // is request crashed\n  formattedResponseData // formatted response data in IResponse interface\n}) => ({\n // do some metrics or logging here\n}));\n```\n\n#### Set callback for metrics for all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setPersistentOptions(() => ({\n  headers: {\n    foo: 'bar',\n  },\n}));\n```","readmeFilename":"README.md","gitHead":"6bdf05cb3e78ef593ca4e154e8bc2fa1abbf8b5f","_id":"@mihanizm56/fetch-api@3.7.3-beta.1","_nodeVersion":"12.13.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-OoQRO5aUQpO/QkawTfavFmBiYfDzR/6DTa/JnCqNIQRi75O+htNIN0zF4m9CapLXIAFyIEORduvIi+CBv/2QVA==","shasum":"d64e74be9c33863c91b697ee3d7403cbb2e4fa04","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.7.3-beta.1.tgz","fileCount":80,"unpackedSize":142810,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJghDOgCRA9TVsSAnZWagAA5ngQAJjyXJdi4CUr1rl1JCtA\n2vx+mRkFD9xW3+xytvZle97m0uwhts3K+4udRKuFrobt3YpjciCqM0tMetVN\n8ifDhV5c0BI2E1tooDnVv2s/8jQnazViDAymBI4NzPWw6MiaBnlSdLcml/aJ\ntp/CwKHvFj/g6jP5ZbkhKI+wOL3CKw5pTjr03Xbu8/cJhVASbU6Wjhz9rxfI\nY9jiM7yKUnvd6VLXjTVcaIj0iSOzPyGMeBUKT0NzuuPSjja12fUANcndOuw+\nyO3JCAphtEfPaHSULCm9L/lCjbnC3Rh8WBMLBTVOcaZd2HJDalv27lAEc/J3\nX1W3sNjF/tP6v9VYVqmc/bsoDIno2AOgnGHpThOI2C1ELedTgMpnqUTM9z7h\nmKtQonRs9Bsv5r/kMymdj11DbINK/tB/AJwW2sHg4/RXp61/B7yUWGhTG0DR\nkOuR31MuQu+T6cAtwPHbMh6YamshzaWgm4aLi22Zp8btY2/CcreOUtt/vZEg\nsyRzno+XmVeP45YvGd0k7PpTdts7vJyA+BwCZ5KD7iMxmX/fuZIScAxVq6sY\nGafHGoYJEeDndFLyT3GMuhqDxmOG/L3zNbBaG8GLaThdJ4TIoBV4pkHi7jSk\niqaCrF8fQJgFeAPFkFb7OYDMxxCiwBqwR/SSmeIbVWu/RxWHPw0LmAa29WF/\nWeJo\r\n=SxSf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD0bNyBhUVz0Ch4VoXn/2njjRVYXZUrp4QaOAIBrh/o0AIgaKfd8w22veJYRCe/5zuJzsTaUy6iJSX0zjomDL5uZ48="}]},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.7.3-beta.1_1619276704342_0.7010489798464961"},"_hasShrinkwrap":false},"3.7.3":{"name":"@mihanizm56/fetch-api","version":"3.7.3","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"6.13.7"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.1","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.20.1","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript-transform-paths":"1.1.14","typescript":"4.1.5","@hapi/joi":"17.1.1"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"gitHead":"14e7f01dbbe89ae3f5770a2bbecf095e48c52c6d","_id":"@mihanizm56/fetch-api@3.7.3","_nodeVersion":"12.13.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-UB4H5RrYAMRvUgG5lxOA1f+Nt9MRhn+MkTvXYcthW6xNZCNmBdkufFd7hC4YIIkvNbkCIpqMKQNx+c1znreR0A==","shasum":"96ae71235d22181bed84c39719a8f85aa5d6caae","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.7.3.tgz","fileCount":80,"unpackedSize":142803,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJghsmsCRA9TVsSAnZWagAAt6wP/2CTeZrGHMTkN0o4I5Tr\nM6LJ1Rf7AaM9tngCX29x1BmDil8+w0vC+AAbP4K4XW6tq1HjShAQX6cyDPal\nklursKmU9cvRoTmeWFxx+TLoGltjh3pYqpn3nJDTsbcCF0VU0eI9q3bI5gyx\n9bgKJxYupEFCVSYLVDDANF0hSnhY4eHkWZeR//CyvquUVvkUQf/ssvJxmsib\n9nPb2IGw+hHtY6Yohn70pDq3h3QXMZM5LvFowvSGBUB1MN1J4hSXiaPgL/CN\nmHHY2QHQCLaubvZfG/PTrmVHpb1UOz5KSy9CVAmEfnOQYCz4Rv/PSERFwWDi\n7iD0smG9nomkccs3LkKLxpRYtrq4aRZ26OPlYdPSiknuncsKg1T21cgE0lw/\npvc9z1EpCb98xRtOAj0/X2Y9VbHURyRDoOPKYZo85JtYJxcmZwT+Lue6zRkx\nr19Ah5a9XeJ/d/dZeVTJtr1t+GA01E6W6ZBAXXs6RcZBHBkONNRe3IABcyIe\nRt2PcBkAdTfhKQsUxtJDr4tc3PfnZ9+bMj8Y0LJDGgyCN7L0WRX6RZAUKoOS\n2w8Q8SzVVUpudfDKP13N27gluHI1IozumVB2h39goVnYyzrvsDT0j979cxbc\n/sLZrrjQ1nmhUNBpWsT5wFzdD5V+DYAai8N6YvtyKmnHpU7OhJY3fxsNd6jS\nJP0l\r\n=hLRU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBsnqDghLwETA0GtQ0fHPhsvyh+6kJG2A3rYghTqTIfOAiEA5MJSpc1q7dMyRTxvCwrNErI3l3GCx2/9zJW/3QpUJBo="}]},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.7.3_1619446187525_0.68657771794761"},"_hasShrinkwrap":false},"3.7.4-beta.1":{"name":"@mihanizm56/fetch-api","version":"3.7.4-beta.1","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix --max-warnings=0 --cache --cache-location .eslintinfo","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"6.13.7"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.1","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.20.1","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript-transform-paths":"1.1.14","typescript":"4.1.5","@hapi/joi":"17.1.1"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for the isomorphic fetch\n### [Documentation here](https://mihanizm56.github.io/fetch-api/)\n\n### Benefits:\n- Provides validation for responses (based on @hapi/joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services, https://www.npmjs.com/package/query-string is used)\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in the\n  hard-structured response format\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n- Provides the ability to handle the response progress\n- Provides the ability to select necessary fields from the response (https://github.com/nemtsov/json-mask#readme used)\n- Provides the ability to use persistent params for all requests\n- Provides the ability to retry requests\n- Provides the ability to logging your error requests\n\n#### Request input options:\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use @hapi/joi\n- customTimeout(number) - milliseconds for cancel the request on timeout (or a full package of requests if the \"retry\" parameter is activated) \n- retry - number of requests try to request if the response is negative\n\n#### Request output options:\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n- body will be serialized in JSON if body data NOT FormData\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### Please, be careful. The response will be the object:\n```javascript\n{\n  error: boolean,\n  data: Array<IResponse>,\n  additionalErrors: null,\n  errorText: string,\n  code: number\n}\n```\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n#### Set persist options to all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setResponseTrackCallback(({\n  requestParams, // all request parameters\n  response, //  pure response protected object\n  pureResponseData, // response body without formatting\n  requestError: boolean, // is request crashed\n  formattedResponseData // formatted response data in IResponse interface\n}) => ({\n // do some metrics or logging here\n}));\n```\n\n#### Set callback for metrics for all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setPersistentOptions(() => ({\n  headers: {\n    foo: 'bar',\n  },\n}));\n```","readmeFilename":"README.md","gitHead":"7f7538752613ffb54a68bd2be494c4fd36ea8ef5","_id":"@mihanizm56/fetch-api@3.7.4-beta.1","_nodeVersion":"12.13.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-N23823Cs6wtkLnMzLo/Ei94JMOioTdrlIzWQ/2BZymf3071DeWyrsYOmOeZrvFv1CJ1lnB/40H6Y0B8MPLX7WQ==","shasum":"7782ffe451680477dc0e6fe6271e73ddb46e4180","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.7.4-beta.1.tgz","fileCount":80,"unpackedSize":143760,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgth+PCRA9TVsSAnZWagAATBIQAJs8uyGdEwfXak2Ch0Z0\nMJXVBjCItfwFF5TaPuuTKd3W9hzn1xfM5OsnXNozNI6s6p2Lu6th1r9HLMid\nY6JXP+YFvBtnbr3RPRueicYpNGV0oXEhPcp1e84I3FBe3nCVELRIgv9aQJoG\nF34cLzhg0/C9N8x1E0D4AOOiNt1mej2b4e4+10IuDaFLPDS6v5ZaKJmvhPJp\n9pDlH+JNnEzBgITxQorIZX7VYY0D/+HgWpC1VnTa6DC1D8j42CzwlOp0oHoL\nJ9qou5oBlpSSKtbDL3zlIJIj1mxszgqTXUSv/9XwUWizJqB6gJnhdz+/20eT\noTwBiL4amcJ2IiXNoxzRjkJUt/V0UiAdu3UVUxMGyacefic9cunS7nPnszfT\nPd/URG8KwRu0wl018q5J+NizIrEhueSgHCZhmjqIlivgit9Czez+K5iup/0M\nOI7yUEeDitkSay2Fw9wuNXypwOVZIViC58xVpTy2BWBU8DiqJrFg60QiR5wt\nRKl8UCF1H/b1BNs5pxg0hvs+rzqJB9Ev0EwCjuZZv06exwZzjSfzTI5A8qgY\nJ+h9uByFLGnrYPLbRKMMkPqnlIpPxzB7QI9xms7x4ROrGGWLjS0kKaXAzUL0\n9Tv1s/3o3x97eVIgEwTU9F5LOqjUbCspxeDs/JDExJ19EEsvxrD13wi0yqey\nnYHV\r\n=KAEE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC8NNkrzFittba/CCwFHdvyXGMhHZTqK7tJROt1ufHzhQIhAMdK4edZwVvIm52kXbYcgjvXCQcTUFz73SE4X+EUqNGq"}]},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.7.4-beta.1_1622548366722_0.25548931086697735"},"_hasShrinkwrap":false},"3.7.4-beta.2":{"name":"@mihanizm56/fetch-api","version":"3.7.4-beta.2","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix --max-warnings=0 --cache --cache-location .eslintinfo","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"6.13.7"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.1","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.20.1","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript-transform-paths":"1.1.14","typescript":"4.1.5","@hapi/joi":"17.1.1"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for the isomorphic fetch\n### [Documentation here](https://mihanizm56.github.io/fetch-api/)\n\n### Benefits:\n- Provides validation for responses (based on @hapi/joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services, https://www.npmjs.com/package/query-string is used)\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in the\n  hard-structured response format\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n- Provides the ability to handle the response progress\n- Provides the ability to select necessary fields from the response (https://github.com/nemtsov/json-mask#readme used)\n- Provides the ability to use persistent params for all requests\n- Provides the ability to retry requests\n- Provides the ability to logging your error requests\n\n#### Request input options:\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use @hapi/joi\n- customTimeout(number) - milliseconds for cancel the request on timeout (or a full package of requests if the \"retry\" parameter is activated) \n- retry - number of requests try to request if the response is negative\n\n#### Request output options:\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n- body will be serialized in JSON if body data NOT FormData\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### Please, be careful. The response will be the object:\n```javascript\n{\n  error: boolean,\n  data: Array<IResponse>,\n  additionalErrors: null,\n  errorText: string,\n  code: number\n}\n```\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n#### Set persist options to all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setResponseTrackCallback(({\n  requestParams, // all request parameters\n  response, //  pure response protected object\n  pureResponseData, // response body without formatting\n  requestError: boolean, // is request crashed\n  formattedResponseData // formatted response data in IResponse interface\n}) => ({\n // do some metrics or logging here\n}));\n```\n\n#### Set callback for metrics for all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setPersistentOptions(() => ({\n  headers: {\n    foo: 'bar',\n  },\n}));\n```","readmeFilename":"README.md","gitHead":"dc56f1eefe5d6b46cb1c2171d105a638df72689a","_id":"@mihanizm56/fetch-api@3.7.4-beta.2","_nodeVersion":"12.13.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-UNW9a79B6+GFfCyGIU64LF2LatBQPVowzHFy54gCoQVaw5ZE7ppIL/JlF2QjcT5gcTKCBDI2/xT3ty/8+91ocw==","shasum":"dbd5c87d433c5bc757cb894f62b47826b7b1fa13","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.7.4-beta.2.tgz","fileCount":80,"unpackedSize":143815,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgtiDgCRA9TVsSAnZWagAAJPAP/i3zUtnj3Z+rW0kVTXoC\ntTa6IIsY2ZRWzn6kfnP16qeYLyTJ4jLz3uR0eQuPYZlwb+MXZ9mKtpzecbRb\nuN+q1F0pbGfu4n5yGXKDISD3FJhFlPHXVvfTmxheoNkZdMdLtx0DfAdFXgZf\nHeqqoPpV2+OGwlZcib7t5VZ2SG/GcXP9TBXXIJjfYvTnWGFnI89CCKyQSHQC\ngaPdFOT5FbEvG9TEA4XfDzMksaMzml+z6LEiStXEQjwjH4Keh8uOk7Nv9x9x\ni8aB/jiVa6u3IVQffTl+p2UVFP62PECJP6WuBAvIQjMGIkV2/M3F3lqotpck\nq4w+mmuuoYlq7XfqFlaA5N5w44LNJUOkaRVkfB6I+76qHuqqGCNCUVzkFIVN\n8DoY0Rpg1IL4UleFtyucG51a7OC0y6/7OnxLEKokJDTWNb7piaU/2AucLmpo\npYfRLgTtcna7uRQ6hhgsDo0ZLGs0gHwoDx/nNERyk4w+b1CgFJZoy21t5/ZX\ncpZNdwrcBIzeQjZiWcxgFddTsdPG6lmb4q5cl+20EMDlyiugls4gJbQ/lTIg\ne12uYcP/4ikYE8gHRzYgmhMB8qRgzK9pkvr5dqQQOe5Qx5sLoso8FY5lTV/c\niuuZV8/8pdvH+/J5q66ZogJf+dokx0rad01YQRQa4Oci3XS70plSQwHvznC7\nvVYL\r\n=RwGE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHWEz30yBn59RtkxijiJIJhmVs73XvlC7nti4m6R6HAGAiBF1Sexih8ZX93tvMccJ0HSoeosJ6PivylvY9mK12UVWg=="}]},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.7.4-beta.2_1622548704035_0.9507171967171488"},"_hasShrinkwrap":false},"3.7.4-beta.3":{"name":"@mihanizm56/fetch-api","version":"3.7.4-beta.3","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix --max-warnings=0 --cache --cache-location .eslintinfo","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"6.13.7"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.1","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.20.1","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript-transform-paths":"1.1.14","typescript":"4.1.5","@hapi/joi":"17.1.1"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for the isomorphic fetch\n### [Documentation here](https://mihanizm56.github.io/fetch-api/)\n\n### Benefits:\n- Provides validation for responses (based on @hapi/joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services, https://www.npmjs.com/package/query-string is used)\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in the\n  hard-structured response format\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n- Provides the ability to handle the response progress\n- Provides the ability to select necessary fields from the response (https://github.com/nemtsov/json-mask#readme used)\n- Provides the ability to use persistent params for all requests\n- Provides the ability to retry requests\n- Provides the ability to logging your error requests\n\n#### Request input options:\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use @hapi/joi\n- customTimeout(number) - milliseconds for cancel the request on timeout (or a full package of requests if the \"retry\" parameter is activated) \n- retry - number of requests try to request if the response is negative\n\n#### Request output options:\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n- body will be serialized in JSON if body data NOT FormData\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### Please, be careful. The response will be the object:\n```javascript\n{\n  error: boolean,\n  data: Array<IResponse>,\n  additionalErrors: null,\n  errorText: string,\n  code: number\n}\n```\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n#### Set persist options to all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setResponseTrackCallback(({\n  requestParams, // all request parameters\n  response, //  pure response protected object\n  pureResponseData, // response body without formatting\n  requestError: boolean, // is request crashed\n  formattedResponseData // formatted response data in IResponse interface\n}) => ({\n // do some metrics or logging here\n}));\n```\n\n#### Set callback for metrics for all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setPersistentOptions(() => ({\n  headers: {\n    foo: 'bar',\n  },\n}));\n```","readmeFilename":"README.md","gitHead":"f1f6c9db238e05a9ab2d3d9d05e1252ca1a9968c","_id":"@mihanizm56/fetch-api@3.7.4-beta.3","_nodeVersion":"12.13.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-5WygbebXTMljv8I6mdGc7NEIuxih4SYzpTlTjnihICeY1IubyCaXoZGC9QvN9bFA9qXcwa4dUeMWsJ5MCLGl4w==","shasum":"e7d692b6959c1bf29b3a363ced0e20d0a4a52987","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.7.4-beta.3.tgz","fileCount":80,"unpackedSize":143961,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgtiOuCRA9TVsSAnZWagAAo60QAIdLBr7LWJfF3TY0MlVs\nl2UGUVGYPw89wvWoaFYtQ6h0Toht1y3wKS6hmREizL70gero9UEhh2CK/691\n0UsA201IqLKUefGIeMe4CHmNfXwwTarPnVSZ4IfC9H0KKn0IMyXGuvvD5DcN\na8fYoBjwFduga/xWvLcq2NjAM22S8OGPc1nWC9IOwOmE1dS50/SAJUCyiKNx\nBwcW7yr/P7lnJ4nfnr5CCaoVb8086BjJUukvRrrmHAhAoO0OgMUKV3CCUc32\n0aKhonlHJyPIifi3um5ciMzYmYvEXVs/4Q6bL3AeFQafQRNxrBFkH1bgIyqR\nnGqBPJZ344HzLgHQAof2IcEIL0DA+56zuDCGRvgYXCSyxwmoIpLiQMirV58c\ncWk3+2RuslJiP8pKn+HdWmgf3OiXHi7p8iZmYtHECYQyHivV/LMHE6UPbvvh\nwiqcjcBFakM64yXWWVxKDJDLR4ZoX6JZ9vSQTiYyc5EdZGSq/42NKOaZd/g1\n/L/iTszAXle2VIXEiYOGHMRaJfOjkMm+kda9Dty0M2oQ9PqQZrOYvy7FTX0k\nLrIuMHp41a4tSc3qi63eTsSxSvWYLIhh5coTLRBVoHZcOwJAXwe+RpZHIKwA\n3eH6cvdU4NQ8sbbg8GEnl46/HhbBOvNKomNxhnQmP4B9BU2niVAUHsqurtjz\n7O8S\r\n=wUDr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC118Pq3cbsObXhaId1PreZr9Cme7URHYUaBEycpAEUSgIhAKzRG1ipqeidu3dKM8uEqXU+R+mTfA/xWCBwKLzXUAJx"}]},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.7.4-beta.3_1622549422297_0.5407182846294392"},"_hasShrinkwrap":false},"3.7.4-beta.4":{"name":"@mihanizm56/fetch-api","version":"3.7.4-beta.4","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix --max-warnings=0 --cache --cache-location .eslintinfo","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"6.13.7"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.1","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.20.1","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript-transform-paths":"1.1.14","typescript":"4.1.5","@hapi/joi":"17.1.1"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for the isomorphic fetch\n### [Documentation here](https://mihanizm56.github.io/fetch-api/)\n\n### Benefits:\n- Provides validation for responses (based on @hapi/joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services, https://www.npmjs.com/package/query-string is used)\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in the\n  hard-structured response format\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n- Provides the ability to handle the response progress\n- Provides the ability to select necessary fields from the response (https://github.com/nemtsov/json-mask#readme used)\n- Provides the ability to use persistent params for all requests\n- Provides the ability to retry requests\n- Provides the ability to logging your error requests\n\n#### Request input options:\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use @hapi/joi\n- customTimeout(number) - milliseconds for cancel the request on timeout (or a full package of requests if the \"retry\" parameter is activated) \n- retry - number of requests try to request if the response is negative\n\n#### Request output options:\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n- body will be serialized in JSON if body data NOT FormData\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### Please, be careful. The response will be the object:\n```javascript\n{\n  error: boolean,\n  data: Array<IResponse>,\n  additionalErrors: null,\n  errorText: string,\n  code: number\n}\n```\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n#### Set persist options to all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setResponseTrackCallback(({\n  requestParams, // all request parameters\n  response, //  pure response protected object\n  pureResponseData, // response body without formatting\n  requestError: boolean, // is request crashed\n  formattedResponseData // formatted response data in IResponse interface\n}) => ({\n // do some metrics or logging here\n}));\n```\n\n#### Set callback for metrics for all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setPersistentOptions(() => ({\n  headers: {\n    foo: 'bar',\n  },\n}));\n```","readmeFilename":"README.md","gitHead":"9e100a2b0251625844eb4493df7be2b7db8858a5","_id":"@mihanizm56/fetch-api@3.7.4-beta.4","_nodeVersion":"12.13.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-HnXCrRp2GE2IIY7VU6t2XEHCcKm5vKYSDin9mRV9lOlMz5vPMcIWOmEveMnS26BpdWQ5P0YId4PtA0nPiFqsdg==","shasum":"a3a3e21318b93f92e1f8cefca11e8be6afe7c8b7","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.7.4-beta.4.tgz","fileCount":80,"unpackedSize":143935,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgtjdiCRA9TVsSAnZWagAABDEQAJKzXxLlebVYB0PxUuC+\n+hmTblsaX3RYK2TXAtOQMadkGu+Ax+HDnX5BC4RxJhL2lKpunTNNE3wNKh9H\nKdSGqvRzo9hG/qSB2PUtpdrqUUyjK0BcLZhqrGtHera+sJTYe7O45eKitT6s\njRR6Cea9D2HVhCt/pB7lNshIuTJ8dIlEWAcVuRpqImkAEzvARBF5uMPJGPCV\nzJDSKM8tcX+zAY0XZKmf0xYRAJ+Dh+RsVCVBbudE1d2fdFCoIgQ5ozUpMEur\nJY08eP5cJGA3Y7ULtn6Nr5bjQUleNLFx04f0hMakEzpX3SU1nsbga5KJSB4G\nSuzxdsLfvyn+Vqbmx/bFI9meuWwYe0tCVG9L+se92NoJsMrIaEYKdGRS5xlM\nhPMMRIwleglBNk3po11pAl5VFECmOhp1vDgKbh7ooKTqEbWdUN0LfCyHE8xN\nd4RqBfaZl2YMBD8qL2SNtrvf0VUoiCDuSpsErvOcsBfeDWwYEMwuB/tP29RI\nSJpuLwmkFfseetR9OnmvJ9FE9n05sjv8jnUC7d5XfP1hTU38SUiHR6zCamf9\nUlrtPr+/Xr/0fhK/657gOoqOUS5X5brfewwKkFhQq1lnlxgnM+RmhzmWi5sZ\nsGWeQVih/cN8t5WgSX9oM28+hH80l7wCdflzH1WkmB8DY44I+aLTsehUnHhY\naAd6\r\n=Z/H4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDYc9DrxCLjR5aUQJWWRM596JcaOVE6VFiVA9WzqpvFzgIgJDDo0NxSN28IKC5sPoElnH74JE4Y4ImmqVZTaI9aujk="}]},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.7.4-beta.4_1622554465367_0.2937089522721763"},"_hasShrinkwrap":false},"3.7.4":{"name":"@mihanizm56/fetch-api","version":"3.7.4","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix --max-warnings=0 --cache --cache-location .eslintinfo","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"6.13.7"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"24.9.1","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.1","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.20.1","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.1.0","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript-transform-paths":"1.1.14","typescript":"4.1.5","@hapi/joi":"17.1.1"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"gitHead":"d0acfa049aa53ccd80f473802e9b1839f05e0c6f","_id":"@mihanizm56/fetch-api@3.7.4","_nodeVersion":"12.13.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-3arHWpG2MWXsM1BeCFwceuKBOy8A5glwX0awD3UGtnMa+skwTKTpdl9t9umAqJU9fZzOAhZ5yxBgshBpOYPo2A==","shasum":"d34e0da45ea47ae5abf9f8f3f09ef1ce65ca5224","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.7.4.tgz","fileCount":80,"unpackedSize":143928,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgtjlfCRA9TVsSAnZWagAACjYP/3gVDLwvcpwu63ePT/Yh\n/MlwQqm0ZTAPZwQh11PJ+8Ye9nsPzaF9DBy+Hs/R3/nAb870tbH/59ydzrVy\nffglIE8rLLvAAq6Vo37/MGlnRsx5IqZosz6L/mlijxIJjgMIjYjjyIZTVX1A\nDyPiYMBVNlRIDMMknvss9brhpsHnGn3G/Z+B05+SH9Fm884+BwFgiRdiGwXx\noKMrpmcbN3PlNSirnPPQjY32Jm+bOsaM530wvBdTjjBIVCbkXs8QqF8tC63E\nIIvcYIQCLm9plFDFxpaRw1/0YFK5EfznQ4fnq4I41ob+6e2ztUX25mNrWEmX\n+QrEjg/LLvshkDp4/qI/Q53+jhqPLJI/nLhM/6HAEknDfXtECEUinTHKagU2\nSdXmAER0bpZ8rizotLay0GxDDP0fMVxQMUYyfCs0hHcQGlir9tqIpPw99V80\nC/ochYMt1S+7TrAD9JbZlEfHiF64cRHwX7dgQ6UbU+bAPnvGhsZoEgdnOfeN\nlIErtE89BgCj6DhfF8/oxC01J/A65OoP295rmiDMv8q+qpwhiRdj9yks9aUE\ngOdG/fZlnHSktLbIv2QzQUxsNp9U/vMDSMV4GhFx9GUZAGFsxPUCPC1L+l2S\nubcQTONphv22AkxcgmfRg7m9uqHnNEsLIw9xL+VklkHbMLP2TAptnWSeD6LP\nP0O8\r\n=2RP8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCv6bZ7vOJFPlrEBhT0zCKvm6W5QEG/+9bSHC6KXFeOMQIgKH7mQX0mHtfZ1bO87NoVfd5JUT7F943idN6ZIe73ESQ="}]},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.7.4_1622554974942_0.6394644121148276"},"_hasShrinkwrap":false},"3.8.0-beta.1":{"name":"@mihanizm56/fetch-api","version":"3.8.0-beta.1","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix --max-warnings=0 --cache --cache-location .eslintinfo","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"6.13.7"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"25.1.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.1","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.20.1","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.5.4","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tsconfig-paths":"3.9.0","tscpaths":"0.0.9","typescript-transform-paths":"1.1.14","typescript":"4.1.5","@hapi/joi":"17.1.1"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for the isomorphic fetch\n### [Documentation here](https://mihanizm56.github.io/fetch-api/)\n\n### Benefits:\n- Provides validation for responses (based on @hapi/joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services, https://www.npmjs.com/package/query-string is used)\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in the\n  hard-structured response format\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n- Provides the ability to handle the response progress\n- Provides the ability to select necessary fields from the response (https://github.com/nemtsov/json-mask#readme used)\n- Provides the ability to use persistent params for all requests\n- Provides the ability to retry requests\n- Provides the ability to logging your error requests\n\n#### Request input options:\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use @hapi/joi\n- customTimeout(number) - milliseconds for cancel the request on timeout (or a full package of requests if the \"retry\" parameter is activated) \n- retry - number of requests try to request if the response is negative\n\n#### Request output options:\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n- body will be serialized in JSON if body data NOT FormData\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### Please, be careful. The response will be the object:\n```javascript\n{\n  error: boolean,\n  data: Array<IResponse>,\n  additionalErrors: null,\n  errorText: string,\n  code: number\n}\n```\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n#### Set persist options to all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setResponseTrackCallback(({\n  requestParams, // all request parameters\n  response, //  pure response protected object\n  pureResponseData, // response body without formatting\n  requestError: boolean, // is request crashed\n  formattedResponseData // formatted response data in IResponse interface\n}) => ({\n // do some metrics or logging here\n}));\n```\n\n#### Set callback for metrics for all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setPersistentOptions(() => ({\n  headers: {\n    foo: 'bar',\n  },\n}));\n```","readmeFilename":"README.md","gitHead":"d0acfa049aa53ccd80f473802e9b1839f05e0c6f","_id":"@mihanizm56/fetch-api@3.8.0-beta.1","_nodeVersion":"12.13.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-ft/7RYP8clqTcmPfvKLl7/Lj5pwZC6lBK5aeVXTJonwXCfCAfhQV9msklQjnyE9xBeHTaEbVvaUS+NvWs9vnEg==","shasum":"2ab5423ffadb01758cbf1ade13f3178d58d08c88","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.8.0-beta.1.tgz","fileCount":82,"unpackedSize":149155,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg35veCRA9TVsSAnZWagAAawIP/RQXZ6MFnBagHu+vSsbF\nE1APPoUKADSVBAsBCnD/fqArBg5dxDutzJJwpTXrqod5RrRsq8QOfwvEYG+4\nDNRFUD5ooxA74E80rF9wxJi0m1L2JzR2xgpo5zBqwcnvNw+d3YVoRyqAgqRk\nPtrNDOJLEfv3c/Akm+qZKL13uYjaXArCECXctczqGqYSOeJQlPSnmHoyWo98\nsBt/aYgVgAeqw1xh53u5LBNoxIkf+8U9bZLPEwzCV/4OeG6QXV2Cg/tvu4MN\nk7Va7eULZP5owT3wOcbjTTfOkT16XtcX2Z3LrfaVDBsQfiSUO6/fhUZlZg7p\noY0ecWaczkDZCgCWn/0pgMvp7LXE1jdKlz67aY3Y8fjCwseIjXY9h12KDNLb\nzIt3F2Vuj1Z6UxS14We4LMFLbJr/6hVTIt7I3ExF0rZhtwZhavwMRtw10vkg\n72mVzn5GQbj16Czu5B6/GMU4V94SNR6VrVWzfzt/yuRqHr+4dcWD1ttgbN6A\n+xbDu0MX3Hv92eBncfEEfRSXvOROsyi9gqE10UMr/fjKlXPivdl+B/5J7WPe\nOjRUEweLT4+LYUjRmUGiCb85smzYNZ/SsHpfyQTvJj36V03/Yq64zGOuU1sk\nJ6ohva5x8R0PSPRFMEcdOz9JqvUzXopAo8HrKZ6Ji6HJ5c3Scz9GzcMUKBxy\nczZI\r\n=rH+H\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD/zOJBH+5U+t4W+0HVvti9/pS2qR+WTnlDLfTjjTVB1QIhAI0QKD84sudJhSLWzDGtD8XAh6PZhiwXlcQtgAX3BzJq"}]},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.8.0-beta.1_1625267166214_0.28401494345661105"},"_hasShrinkwrap":false},"3.8.0":{"name":"@mihanizm56/fetch-api","version":"3.8.0","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix --max-warnings=0 --cache --cache-location .eslintinfo","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"6.13.7"},"devDependencies":{"@commitlint/cli":"11.0.0","@hapi/joi":"17.1.1","@types/jest":"25.1.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.4","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.20.1","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.5.4","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tscpaths":"0.0.9","typescript":"4.1.5","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"gitHead":"8814db29298b3a1dbaacf57c9b54f69baa1a7be3","_id":"@mihanizm56/fetch-api@3.8.0","_nodeVersion":"12.13.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-CbEz/wk1b7VmPpMmt0PzWF/oxEmanXfTIG4Clik6FgzIxzrx2XIxOEwkBnU1VTNE8AlE9aavZcBnYVaO2rnAjA==","shasum":"f4cd08495552b14dfbe12a8e1b1563a20c6bb528","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.8.0.tgz","fileCount":82,"unpackedSize":149161,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg5P1ECRA9TVsSAnZWagAAAfQP/icQw5XLYJ1Y9gmXUguR\neqWT1a9sJj3RRAwyOsAb/COHkRHgx6P19rlc3swcqG390nc1g88uCY9zQD6m\nA7cOHTZ8G+FAYjfwY2UP+ixZ3Os2V3xtDoti0ER/W/Q/9vNU0RWvyzt7BqBu\nkliKZmTNq/c/6fiW1DKjt7WoJFWYP5n47KQT59b8Hg347EiBtICzQWlQtIw9\nvaOIUMz2CkToLyDQBzIRA4EG/j/7uXoy4P9nXEUHiUp3eyPH/gra/RgQ/KDd\nK3xCUkM19RU2wQLeUtzD1iCdgKL9hKX6srMBxeAx2xBd4QedZDvshLY3nvgx\nnwYJO7WPbKNYlFAPTG4Mlg76GMKLvaw3xL2sSq8+TGsNBbAdK7J2kVJ0/9Rf\nbt7esJOjp4j0VuEuzTowLAaOPXd+JI3B4S5yeOIQHAQ6thNZNtbjwAtfu3oA\nTNRt/xjedzdWE8fO9lklwo12tvfc6GWiEB8inc33z806/5nnebPYZCqf0ROn\ncrGRhJCA/PBZh6WlPMyKDALwzLTJ29wqtEsVF17K+U8aWwt75ASEMgBpvteA\n509mBzsvKnll/3D5ZJn7vzTAz71d2shNUJOT7HLLA/IhFl62cL2LjHcQdJHP\newWg0yFowlk7igLBMoPB87GexhrNScX01QSLtb2TYEUIsF6/O+iMDxzr8Scx\noRyx\r\n=mpUC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCsFh4Ur3OVY1dkVxe3ij8o3El4yua9BY3bgL4JC4WpmAIhAOGd9JZ147nYUaRr90LSLi7mBi/DDNHwSvKIz9vbHpmV"}]},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.8.0_1625619779757_0.7221090431017549"},"_hasShrinkwrap":false},"3.8.1-beta.1":{"name":"@mihanizm56/fetch-api","version":"3.8.1-beta.1","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix --max-warnings=0 --cache --cache-location .eslintinfo","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"6.13.7"},"devDependencies":{"@commitlint/cli":"11.0.0","@hapi/joi":"17.1.1","@types/jest":"25.1.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.4","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.20.1","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.5.4","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tscpaths":"0.0.9","typescript":"4.1.5","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for the isomorphic fetch\n### [Documentation here](https://mihanizm56.github.io/fetch-api/)\n\n### Benefits:\n- Provides validation for responses (based on @hapi/joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services, https://www.npmjs.com/package/query-string is used)\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in the\n  hard-structured response format\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n- Provides the ability to handle the response progress\n- Provides the ability to select necessary fields from the response (https://github.com/nemtsov/json-mask#readme used)\n- Provides the ability to use persistent params for all requests\n- Provides the ability to retry requests\n- Provides the ability to logging your error requests\n\n#### Request input options:\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use @hapi/joi\n- customTimeout(number) - milliseconds for cancel the request on timeout (or a full package of requests if the \"retry\" parameter is activated) \n- retry - number of requests try to request if the response is negative\n\n#### Request output options:\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n- body will be serialized in JSON if body data NOT FormData\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### Please, be careful. The response will be the object:\n```javascript\n{\n  error: boolean,\n  data: Array<IResponse>,\n  additionalErrors: null,\n  errorText: string,\n  code: number\n}\n```\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n#### Set persist options to all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setResponseTrackCallback(({\n  requestParams, // all request parameters\n  response, //  pure response protected object\n  pureResponseData, // response body without formatting\n  requestError: boolean, // is request crashed\n  formattedResponseData // formatted response data in IResponse interface\n}) => ({\n // do some metrics or logging here\n}));\n```\n\n#### Set callback for metrics for all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setPersistentOptions(() => ({\n  headers: {\n    foo: 'bar',\n  },\n}));\n```","readmeFilename":"README.md","gitHead":"8d2f09a704d16e85ad9be9ebae4042fff993b9ad","_id":"@mihanizm56/fetch-api@3.8.1-beta.1","_nodeVersion":"12.13.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-vdmHWilrB+GhSFCCuyvc6c1jThGx8rSuv1uxsnrxMiU2EaVXtL5QQVepUm0qfXe2acXBH3kxnbrt3wBYA8U06A==","shasum":"895b15e32f4521a5ea07e8e6067b230123856f3a","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.8.1-beta.1.tgz","fileCount":82,"unpackedSize":149115,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg7WqDCRA9TVsSAnZWagAAfJYP/3M5I36WRkhw9tzTsk7P\nXoytipiZfofiFCOwhP3OOSnlh6kvChd0dV/xsDWAvONmiICsc2+VJjfEJzkG\n10O+2wuCZOvbG7roN1GAzfYtuWQqd6MSHEDrZumtm3OIc5LHXDWWOI5z1rdi\nGcZ+rZpNWQ8xUuNRW8aHvrLMRtMbunqvbh6CdiCD3HjyXSMZvhMRUPSx2aby\nkWp1PAKN/4uCiFc/k1072Qv111K39T/9TcEn1xb4bp5sfUkUz3NoTZ4aqHtm\noc1WekZ/jOftoeX/vbGrhliM/MH67cI+8FN9+YoIjXDxEIn3+ehXgYUamj3p\nmKNDMVuPv3MEbbpTMeY8OobLgDU7bWdmHegLle4+zgw4sm7l0+4XAwb4QG8L\nDVCPl1z3Ji39VLMYfm7pz3Ew2VfydjTPUDiikKAoQEnzjQR98gTviloUFcGb\ntvYJQQKYjOtPE8bZAtxmErBK0W2Wf/vrTGqzFLCBfbsHto+JXemfneWZ6B+x\n9niJ4zDAJnellB6Yp9EoAXbiRPVgfjgonJWnfJZIS+OuXJ18it+Yxcgv2d2E\nmRkYmA6VfPe3gnLE6WhCgSqdXYoefgEvmcpnQIQTbMj918GqE2Mmf1YWjd20\n6I/wp+Ndj2HQ8tVUHaYwu9B8/BtgoWHPZILM6RlftgQViHAxPJ3PAxrVv59b\nAYTk\r\n=5y8W\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIE9uY8ggMe/1NjA14Kg0NiCjBfxl9oJH/0rZk4/vGkQBAiEA2nOkTBdO2tqRwVTwhaPi7A2YauM7c4tglwX5MgbCC2Q="}]},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.8.1-beta.1_1626172034818_0.8827827830742045"},"_hasShrinkwrap":false},"3.8.1":{"name":"@mihanizm56/fetch-api","version":"3.8.1","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix --max-warnings=0 --cache --cache-location .eslintinfo","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"6.13.7"},"devDependencies":{"@commitlint/cli":"11.0.0","@hapi/joi":"17.1.1","@types/jest":"25.1.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.4","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.20.1","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.5.4","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tscpaths":"0.0.9","typescript":"4.1.5","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"gitHead":"9c2c59266ca5d644f819ebf5a51588d33cbe0d55","_id":"@mihanizm56/fetch-api@3.8.1","_nodeVersion":"12.13.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-fSBxuHVSWgbcqAqqRV4ZdeMnKyBkm9sLWz2x3/gcxDe7ij3swplu3E/0TZGt3Mz4GaZhBUtq+jbSO94yZ3qfFQ==","shasum":"c41d8de8c199055aa0b23bb0d4d80367315c72e3","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.8.1.tgz","fileCount":82,"unpackedSize":149108,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg7WsrCRA9TVsSAnZWagAAjFEP/iOtv+KCwJlzmBPocBKb\n7VmavV6Q2ELz8cqwxUWlfbzSegFQbMjCofDInEJk03kUefWWN/XgW94Nd99Z\nwR83bdXNuN4YsRIiFqdafkGTNTnVpp1OXydr+Y38B7HU55OqhIWEEBCZRL7y\nAGwhC2XNBiGj3mKJJeEUFzHUYA1EG09OU7/A9t2WJIhaqmvgDRWwVSLmHfMJ\nDNl5Ec6HiH2MH7uVX1z8hZLT/bioDHe9StAegadRjGRnSa2jHTiESKjVygwA\npF3+a3Uky86+ZWRSz5d5TUUd6SGowmOyyYwDSIgU/HmCVWHWZhbNluVkAbF9\nKPfZe/YSLg2iPTfHGlnOdp7oA2VDs63O0L6Pl0ah1tZWldZJ2cGzteIHN4T3\n9Zob0dD3R+GfuiY53CWfG1/f4V2h/SfF8YwhVtHUThBf35Ppr8OpXJ8H70yx\nAZJffhticecKdVXDHNU08nfSTmQd7dZ0m7QaZZw0A3oyHjuZrv8WpQhGgdFz\nL8Cene0s+anKmdi3VZ7YHZ3D5YU6237D6C9zqPAEMb2tmayoTf6yIw1zSVB9\ngomvhvmiNad9yN8a6GmR9yPfOm+cssJWPQuWJyFPsmqVYQB4RNwMOowupvED\n2yffC4lDP2bjumCo7EKqUlw4zSdItCHKFbenkLnozOu5rmR28F8zXPc015gW\nWlWd\r\n=9lR6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHgVEBeshvA4pKblc5vyP0TMwr5GYnYdZh65le0+vx4sAiAnnzfRQOkg75weo9P+b+rU5E3Dr/28OFs+lkiDXtjBhQ=="}]},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.8.1_1626172202936_0.371360544269852"},"_hasShrinkwrap":false},"3.8.2-beta.1":{"name":"@mihanizm56/fetch-api","version":"3.8.2-beta.1","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix --max-warnings=0 --cache --cache-location .eslintinfo","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"6.13.7"},"devDependencies":{"@commitlint/cli":"11.0.0","@hapi/joi":"17.1.1","@types/jest":"25.1.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.4","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.20.1","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.5.4","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tscpaths":"0.0.9","typescript":"4.1.5","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for the isomorphic fetch\n### [Documentation here](https://mihanizm56.github.io/fetch-api/)\n\n### Benefits:\n- Provides validation for responses (based on @hapi/joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services, https://www.npmjs.com/package/query-string is used)\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in the\n  hard-structured response format\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n- Provides the ability to handle the response progress\n- Provides the ability to select necessary fields from the response (https://github.com/nemtsov/json-mask#readme used)\n- Provides the ability to use persistent params for all requests\n- Provides the ability to retry requests\n- Provides the ability to logging your error requests\n\n#### Request input options:\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use @hapi/joi\n- customTimeout(number) - milliseconds for cancel the request on timeout (or a full package of requests if the \"retry\" parameter is activated) \n- retry - number of requests try to request if the response is negative\n\n#### Request output options:\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n- body will be serialized in JSON if body data NOT FormData\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### Please, be careful. The response will be the object:\n```javascript\n{\n  error: boolean,\n  data: Array<IResponse>,\n  additionalErrors: null,\n  errorText: string,\n  code: number\n}\n```\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n#### Set persist options to all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setResponseTrackCallback(({\n  requestParams, // all request parameters\n  response, //  pure response protected object\n  pureResponseData, // response body without formatting\n  requestError: boolean, // is request crashed\n  formattedResponseData // formatted response data in IResponse interface\n}) => ({\n // do some metrics or logging here\n}));\n```\n\n#### Set callback for metrics for all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setPersistentOptions(() => ({\n  headers: {\n    foo: 'bar',\n  },\n}));\n```","readmeFilename":"README.md","gitHead":"4d7d3622a36834c22f84869ddee15050a0fa7cd0","_id":"@mihanizm56/fetch-api@3.8.2-beta.1","_nodeVersion":"12.13.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-42LJ+S/oQsjC236G5JyuYs90jYibLM/OA4kjbAw801QVSmSbxX7Bf7vwqnE4AWRliFbrHiI/IV+GBo+iD3NgRw==","shasum":"ed2e7701673a63804628729bcefc262f524c70cc","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.8.2-beta.1.tgz","fileCount":86,"unpackedSize":152815,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhBybnCRA9TVsSAnZWagAAGVoP/2mB4CpO8t7qFbxhkQGL\nkqJnNWZ5p1NjhjSlIIsZdmkuAgLiy+Mm/yP1IOMJR7HLrhSVqs6xh5FGt80U\nPTBKcLzQqlRr8/927GkRmpVH63yJgE3oS20W+n9u4FakQYOasXvIX0Eu9QBd\n6pH2e8xi7QlIk3np0ukVqPRkmHiJrsg1Ihc5vioCWSxqQbwzFeHmTL3LZRw0\nwK8BIs6RDLN/EgUCq4Jd+zwKSaZTSukTQqvrZWnXrTn0TP5Bpy38jlx3MPWA\n04i29hdO0YWOW55xUt1yzXa1PtaZ4SWFek8gdAEEM3xujET1jVt2AbKpqQ66\nWVh6Yec+fIaDc+HEDXujDwhBNVsS0HzLm2QJppwixMW6jKqvYpRpA2DfgIhL\n6KVWNJKNxKK14AIXIW6zddLczPe6irfilM6r4QmUnEswDDiZhJOCMMfzwMQZ\n7HH7ZuDNbAEe4rWQgckSx7T+qU8J0gpDHAuEOWaBEzDO1WSCG4W0hevqlzwR\noPjxvMtdoPeJgHTWh9kcpaweymDS3LgkE/zJVhutzfOXfBXc7pbUVR57Iex3\nRsMYAN3LfT/QTsxydcwxpQi7CfPBwmGLTSvV6wFOZ2DaqTNhdw9w20IYUAVJ\nVWMhP1i90/fn/od+juTiO/OWeos5IqO5q4Sm1XXGf/oF04EhbiH9G0EJt0/j\nj1bp\r\n=EBhL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGRFAjlz/OKWWm/+O+yRJa62mI9zV/vHGJSfmYRzePxfAiEA5DVcJRRvyN/QnHJMSFOM1ZXigvvEC21e5MjoO8mk5fo="}]},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.8.2-beta.1_1627858663307_0.7364811627250989"},"_hasShrinkwrap":false},"3.8.2-beta.2":{"name":"@mihanizm56/fetch-api","version":"3.8.2-beta.2","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix --max-warnings=0 --cache --cache-location .eslintinfo","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"6.13.7"},"devDependencies":{"@commitlint/cli":"11.0.0","@hapi/joi":"17.1.1","@types/jest":"25.1.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.4","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.20.1","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.5.4","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tscpaths":"0.0.9","typescript":"4.1.5","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for the isomorphic fetch\n### [Documentation here](https://mihanizm56.github.io/fetch-api/)\n\n### Benefits:\n- Provides validation for responses (based on @hapi/joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services, https://www.npmjs.com/package/query-string is used)\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in the\n  hard-structured response format\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n- Provides the ability to handle the response progress\n- Provides the ability to select necessary fields from the response (https://github.com/nemtsov/json-mask#readme used)\n- Provides the ability to use persistent params for all requests\n- Provides the ability to retry requests\n- Provides the ability to logging your error requests\n\n#### Request input options:\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use @hapi/joi\n- customTimeout(number) - milliseconds for cancel the request on timeout (or a full package of requests if the \"retry\" parameter is activated) \n- retry - number of requests try to request if the response is negative\n\n#### Request output options:\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n- body will be serialized in JSON if body data NOT FormData\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### Please, be careful. The response will be the object:\n```javascript\n{\n  error: boolean,\n  data: Array<IResponse>,\n  additionalErrors: null,\n  errorText: string,\n  code: number\n}\n```\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n#### Set persist options to all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setResponseTrackCallback(({\n  requestParams, // all request parameters\n  response, //  pure response protected object\n  pureResponseData, // response body without formatting\n  requestError: boolean, // is request crashed\n  formattedResponseData // formatted response data in IResponse interface\n}) => ({\n // do some metrics or logging here\n}));\n```\n\n#### Set callback for metrics for all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setPersistentOptions(() => ({\n  headers: {\n    foo: 'bar',\n  },\n}));\n```","readmeFilename":"README.md","gitHead":"ca6946c934f2b8468a1cfa80ad23b91dab1ad0c3","_id":"@mihanizm56/fetch-api@3.8.2-beta.2","_nodeVersion":"12.13.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-mdEePq84zD9OfCJipFY0+/lzJ7JL6Smy0T0PVHis3S29tT38HLtsaXGkFvl9wZvmifgr5ncRZUYFyLgB5irsXw==","shasum":"74ef1dec90e47eb3fba1e0627d907ee12f441504","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.8.2-beta.2.tgz","fileCount":86,"unpackedSize":155780,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhB/g7CRA9TVsSAnZWagAAfB8P/jcZMsZ+CaQ79Q2lQgkM\n8mHyJKAGiKnuwIfQlV18c0FVzNDl6CX8Kfn6BeO/msGRGte7y2ABMOzOsBpi\nCLihrQ7fOfNSHP0EjQJ67+ATun4zyD+DkYH3tRQFVRNSqJX32Ta8XqxpoTXQ\nW3ESiaxbchRXbT5XeV3G4Etrl4XRJCx+cXgLx4j3yhkeIInVya0H7xeYFThb\nqNA/8UvR8Hzt21WmZt97bLiMOSyOjTWXGwnooBioUGhFPuwlC+4W3HOcdMOK\nyK4KEj/qiTOZqBKzE9uXy42hLyeJOnXJTAc5pIqk5a18G4ZcbSryvnD5A/hG\neF7A1zj8T0pVxrJsfacQimp+n/cDBsx1htMOBXP97FkAhQJmGcdnzhsjY+yw\nW6+yrT9Cq8TxwpPj5flkim10ub6JH2wMrjMSfGRCbUkiErI7RqbojmOi3NM5\nJ/lc52yJNOzDXYjxNtLa7hG5jn6HSWDEkG59n0HuAfokzF4U5nlvQo3tswbw\nTfPre4Vm36lDqxvSngoIRrYKHvoiUWFCfQnGgzWgFUiYuNA5zygsphFp159k\nzodiG2E3uSQjNVDn7sSwxBo/1YUYcOCJh4ReRZImOMB4fLl0AYSPbAgUwnSK\naH/fnlyVMpDjpMHMQILa52crM4gfje1PhNIEaJooDXBaeO348EthlGZmdR0u\nF72G\r\n=yYze\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDk6DG+Sh/7eqEm1KKAtMqmWQD6aRrGQT6136JOB+V5pQIgRwC0u9iD80WvbmGy7QGmFgSw1U4kpnRKMvd8MeLZuTM="}]},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.8.2-beta.2_1627912251247_0.20465683172515958"},"_hasShrinkwrap":false},"3.8.2-beta.3":{"name":"@mihanizm56/fetch-api","version":"3.8.2-beta.3","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix --max-warnings=0 --cache --cache-location .eslintinfo","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"6.13.7"},"devDependencies":{"@commitlint/cli":"11.0.0","@hapi/joi":"17.1.1","@types/jest":"25.1.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.4","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.20.1","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.5.4","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tscpaths":"0.0.9","typescript":"4.1.5","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for the isomorphic fetch\n### [Documentation here](https://mihanizm56.github.io/fetch-api/)\n\n### Benefits:\n- Provides validation for responses (based on @hapi/joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services, https://www.npmjs.com/package/query-string is used)\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in the\n  hard-structured response format\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n- Provides the ability to handle the response progress\n- Provides the ability to select necessary fields from the response (https://github.com/nemtsov/json-mask#readme used)\n- Provides the ability to use persistent params for all requests\n- Provides the ability to retry requests\n- Provides the ability to logging your error requests\n\n#### Request input options:\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use @hapi/joi\n- customTimeout(number) - milliseconds for cancel the request on timeout (or a full package of requests if the \"retry\" parameter is activated) \n- retry - number of requests try to request if the response is negative\n\n#### Request output options:\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n- body will be serialized in JSON if body data NOT FormData\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### Please, be careful. The response will be the object:\n```javascript\n{\n  error: boolean,\n  data: Array<IResponse>,\n  additionalErrors: null,\n  errorText: string,\n  code: number\n}\n```\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n#### Set persist options to all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setResponseTrackCallback(({\n  requestParams, // all request parameters\n  response, //  pure response protected object\n  pureResponseData, // response body without formatting\n  requestError: boolean, // is request crashed\n  formattedResponseData // formatted response data in IResponse interface\n}) => ({\n // do some metrics or logging here\n}));\n```\n\n#### Set callback for metrics for all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setPersistentOptions(() => ({\n  headers: {\n    foo: 'bar',\n  },\n}));\n```","readmeFilename":"README.md","gitHead":"da7d9519c3e865365f42384fe687575b63c5b70e","_id":"@mihanizm56/fetch-api@3.8.2-beta.3","_nodeVersion":"12.13.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-vrqYKT8bVdCdgnB7Q3Q5mLcq37l/MKpr6Fd/zd9BnAII5SU6TOAAMAtEMyqtvMC71Dv6d7VADhWxW15McUd4yg==","shasum":"031875d378d74a8b837c3c6650c78873038b2486","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.8.2-beta.3.tgz","fileCount":86,"unpackedSize":156035,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhCIhACRA9TVsSAnZWagAAJDQP/1VRClJ0A8ufSJ281nbt\nZ5lt48sJ/dZqSYPgpC8MJ2/09fqhjy4S41pkHAsnKOABZqhAnK8I6KyCGAK5\nfYizDbbeEC4DqyXwyUbUkjOHJcC2DPC5unyR0M1cUPxm32wg0rnf/MQID5v1\n3tkIGe6jDINA0NHkScTMnhdpBOlO2Issg+2F70Bim2UE9oi+o1ynNvA7MT84\nDk3iwF9ufpUDxcMImIaGe36BvK4Mxo6LWxRi6c2w7SCiDAwNj39QVUtWTD3h\nLWyoFlQm14P39W61CSZyBn1r7epfxphuR5dukyROkucR7Uf4pRRwew7CdpUx\nC9ZQyYad4lTmFEv7JWDK7jiiV9Q6zsQFMJyE/ZDBNRC+9CkBIwADPwk2gs8h\nlImVYmoJcJ9bbmjcw/OzSmVmsh3Q3casoAdiNmIIYkVHptve4S8D0Br97sHq\nzNHNgIpLnDvj1MLiwN3fjRrkYij26fg3Jzl0fuZaEWbmS8yNla2oWIzDyLLt\nljcduTEYrxA9+1fau5AWg+2YG+V6zmWe7gZRP/ckUzvIB0jMB6V7KV7G38Hl\nXdO4RMu7p0I06NNWENLGTs5CjS0yfn7hZoYE4CiMtuFNZQi3UTRsIzQ/LmPu\ncsYeAuGT/UMxUiLJLhUSdLAfpyWjH4DOs5O7w5OJPJ8I2ZnNaPOHj3R8zavq\nk08n\r\n=mkIN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDmLJSEBgqzSaD8I4rXjBixUAJwd8cC7hK54X1k/Y+SmAIgaQT7ev3TCan6qVyjg86w3MD1IFVd7Fnh+iq0kGHyEwI="}]},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.8.2-beta.3_1627949120070_0.7701960121147193"},"_hasShrinkwrap":false},"3.8.2-beta.4":{"name":"@mihanizm56/fetch-api","version":"3.8.2-beta.4","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix --max-warnings=0 --cache --cache-location .eslintinfo","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"6.13.7"},"devDependencies":{"@commitlint/cli":"11.0.0","@hapi/joi":"17.1.1","@types/jest":"25.1.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.4","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.20.1","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.5.4","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tscpaths":"0.0.9","typescript":"4.1.5","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for the isomorphic fetch\n### [Documentation here](https://mihanizm56.github.io/fetch-api/)\n\n### Benefits:\n- Provides validation for responses (based on @hapi/joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services, https://www.npmjs.com/package/query-string is used)\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in the\n  hard-structured response format\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n- Provides the ability to handle the response progress\n- Provides the ability to select necessary fields from the response (https://github.com/nemtsov/json-mask#readme used)\n- Provides the ability to use persistent params for all requests\n- Provides the ability to retry requests\n- Provides the ability to logging your error requests\n\n#### Request input options:\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use @hapi/joi\n- customTimeout(number) - milliseconds for cancel the request on timeout (or a full package of requests if the \"retry\" parameter is activated) \n- retry - number of requests try to request if the response is negative\n\n#### Request output options:\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n- body will be serialized in JSON if body data NOT FormData\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### Please, be careful. The response will be the object:\n```javascript\n{\n  error: boolean,\n  data: Array<IResponse>,\n  additionalErrors: null,\n  errorText: string,\n  code: number\n}\n```\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n#### Set persist options to all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setResponseTrackCallback(({\n  requestParams, // all request parameters\n  response, //  pure response protected object\n  pureResponseData, // response body without formatting\n  requestError: boolean, // is request crashed\n  formattedResponseData // formatted response data in IResponse interface\n}) => ({\n // do some metrics or logging here\n}));\n```\n\n#### Set callback for metrics for all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setPersistentOptions(() => ({\n  headers: {\n    foo: 'bar',\n  },\n}));\n```","readmeFilename":"README.md","gitHead":"c7c094a5c542a9ae53e819262c9da3206d85c338","_id":"@mihanizm56/fetch-api@3.8.2-beta.4","_nodeVersion":"12.13.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-8cT5ON8w4t63qZ4HLk/GtojtlxTaIfOH8XKMa1B6uOxLpuH6F4GFjHKEI5kr9as2fQD4gBzDlmr8aIKFSRvbIg==","shasum":"8b353f20c2e6a075802339162fffc5d6c8ea398a","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.8.2-beta.4.tgz","fileCount":86,"unpackedSize":155114,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhCnPuCRA9TVsSAnZWagAAracP/3m6+abQ9ON+UzaZjf1R\npoPIG/CPrlOQFm4/0OM6c2Ek6fomKlltrgmNmMJIufvUW9Y6BXnw1uAgH1ZK\n9grI0eJDWGATOaBxK3UjYMB3VhninEcft6+C3/OpK0/H5HkoD9K0KiQzAos1\nAfa7gd5nzW/Zgj7Up/kOPmmtrUMTQo/bpS9e2SV/LVKqr+jo+ORFJTv+jlWl\nLuZ124fGXbkXdUQ8O0XyOijDmTcR5taBz960CkVU1tTlTUwzqk1bAWUzVWY4\n7xeye+YhMnW14iLLHsfGZ2g6nE2M0/NP8CfqjNjDU3kVYIQdwBafCeqCvDXq\n+6pp+SEO58YATQGfD2i9HlpGIGDPCJcWfSjDcAJDYGpVpEYKR74aK26oELz2\ncBkJSZoiAJivNj7CkKKrSxSoM5P1zJ4Ai8P/pXyTFdB5AUnePWJjJYtOEtXe\nBfCjzVJytaHSEklyQ4bMjSVO3HBauDO4zEwXfnVI20HPKU5fyV+yZefUVmxt\nnWONEXgPFysqNkgY8xkS4ToqDsqCOd1aSQmP9v5hDSoiL+H23LaicpjIXsTk\ntPlN3oJEA6MvfIxvfRId0TuG2ZXORXhVMsp+I7N6gBPA5wXIFwWGfVwgDGen\ndce4KfjvBSfl9WHq9e8eyRx5jLyIut6OmpOThrZzYV3g9Vuh64gnoWG9amgP\n/3ts\r\n=6MxC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDfEy9qpkZr2YBW/Ma2uC+15vd61yl47fdJH579IaQyNgIhANfnzcxl2y4fTQ9zFqOpyrsZEB2OOlmrTnsPYohFXDqd"}]},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.8.2-beta.4_1628074990065_0.8186426312830093"},"_hasShrinkwrap":false},"3.8.2":{"name":"@mihanizm56/fetch-api","version":"3.8.2","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix --max-warnings=0 --cache --cache-location .eslintinfo","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"6.13.7"},"devDependencies":{"@commitlint/cli":"11.0.0","@hapi/joi":"17.1.1","@types/jest":"25.1.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.4","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.20.1","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.5.4","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tscpaths":"0.0.9","typescript":"4.1.5","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"gitHead":"a1e474599c02c63be171bc0cad17bbe296571887","_id":"@mihanizm56/fetch-api@3.8.2","_nodeVersion":"12.13.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-ZKSyQZ+8+Np0dBGpt1E0yBHaVjzgd8izsaChiNi5y4cK8Xu93psATqkZ+Wvcs4qVRZ00327wtdSb4Cz3GH/0gA==","shasum":"fd867ad1690e8c1b2ea894365c2d79b699e041ac","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.8.2.tgz","fileCount":86,"unpackedSize":155107,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhEoTJCRA9TVsSAnZWagAAqvwP/2w/L2mDGkKDa9mTnU1p\na9kqnf/1N3Xqck7Fwt+f7l6RLMq8cNNNMgKQttTh+Lw7B+bNHKYUHHh/OU6R\nA5kyWxl1A0Q85IILBq1BYg92heGjbLu6rVZRoHW9KS5fxIEz5D35XZneehl7\nh1O+DlITk8zKnTwBDDBvItZ/+4rs8cVIllg7MlSOBcisfGyeZGhzsPyZdyAa\ndvPeNUYTFxlUd+cGvG/BPDdAxJkjFxVBc6kgWFl4aLG5SEsr3J9IzycyHFML\nuhIdy4KtUthU6SRI1zf5fdJEmyyLqs1C9jKJjc/g1rGNbjOCCgNc5mX/ex8Q\nnU9ZJgnC0UPgL3NH4psEZy1Bu1yj8mb93fy071cVPYUqnNeN7rjV5AelYy42\npllFtkYj1ZKkSS9fesYHCGaC8o0gG7zurq4hpR+8uj9pgGFlRAuCnHoeR2P+\n1BwQheiIjDktyQ37E88gQxUNH8kcxK9USaCYrKxNVJeGE+KyOIe/mpzMzDn9\nEwwbQ/spV1oBaJbCm2toCl+FanjIqL7A1VZTGdeVC9WrNtJX7wUfjnTinXSd\n7909QT4HixG6bJmqQ1QqEZg/atIdByVvk2HPJV/zkDHIzd1apqUzpjP0jzCU\nNlInN74Kc1NWCEM+1CwZXZ08/CG2ddtx/KePMV5wBn//ieU9nXRFbvLq7rn9\nxvVY\r\n=3Dun\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDg72Qg5YBgR2kW9W/VF/M83HdkzDKLCl0Fe5/D50WY4gIhANjtNpKDS0AKJISdh4rpBEzQS+ZBz3XJmAT6HAJlie2e"}]},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.8.2_1628603593117_0.12951329803169598"},"_hasShrinkwrap":false},"3.8.3":{"name":"@mihanizm56/fetch-api","version":"3.8.3","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix --max-warnings=0 --cache --cache-location .eslintinfo","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"6.13.7"},"devDependencies":{"@commitlint/cli":"11.0.0","@hapi/joi":"17.1.1","@types/jest":"25.1.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.4","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.20.1","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.5.4","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tscpaths":"0.0.9","typescript":"4.1.5","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"gitHead":"46932ffcdb1b6f0e2264d3d81eb44a17d3834e1f","_id":"@mihanizm56/fetch-api@3.8.3","_nodeVersion":"12.13.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-fIJQM1nn9cgyi3oM1tWUT8Smdka6qHbWLMtqBHCJPJ0AQep3xO63MHy1h4gAWShKQI1inwZxnGcKh0VwmbDDuQ==","shasum":"f7517ea2c60d00252a7fc8688d9baf9f8d6ed769","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.8.3.tgz","fileCount":88,"unpackedSize":162697,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhGu12CRA9TVsSAnZWagAAFrgP/34FOU4gd/VmyE1d17i7\nVdVHxKwQiZPezHMyXvvf+XwAWSfz7zAU3RrSVPsBv+AOEOLO0q4FbqY71py5\niTZiNmPAwZaootPMvb0rdIsIlvGMfNnpdPfJ8slDTPoucjuRCT4JIAG+0eRW\nkK7UGx+Of+du3icVVMoCoKCeVqb8UZ9UTRHzTMt7cdiMc4tRNiwubpa/1e9R\nqJ/E/xqaLzSaaLIUNmYG1sba3w+Eo49R5A6K+0m9RCSjqD6W5Eaxk0NNs3/L\nkOcfPDDbXnkQxy2cHKyUS5zPpWU5HOjrjQWjOL3UjnZA1X0Ds6PiAWKvD+rs\n9NCOjMkAREQs7Vh8WHqe7YsZWjptS8iH7mxDWi60AiIrsDP1bXDTgwTxLcbo\njtifRYkNmqvytnnlj4LbXBSi+tg20u1QrUi4WPRfDnF5QjoDhyq65CqtS01D\nYsw98xQR2R7tz4Aqg7QMM3+rqVgJxsGRcMZRyU7UoFzpm99s5tMgds7AooTo\n3iOR/6HX/eb+aZplldUd/a/oyuIz/KLSDXdmR3ve7y0/qoINg7DKF5ENMAHT\nYDETQIQbjOwIxLqKx+3VLsdco3kdE3NmSlMkvAHhEYHxTpNB3XRB0gGN8g4u\nt312DjanEqVYuaVZ/FICnJPvAGoSycr8K5gtSQ5/bE7LeTqZAtCHaUfSV/qc\n0Nfv\r\n=PQQd\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGz8I+bT1myvE3dknyV6eXTExwnMds/9s/MlpKM9NDfGAiAIq5Tt0aSuZXl8XAmXoMwOFLLel0a+SslI5AnqqLWTTw=="}]},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.8.3_1629154678657_0.8083242490481"},"_hasShrinkwrap":false},"3.8.4-beta.1":{"name":"@mihanizm56/fetch-api","version":"3.8.4-beta.1","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix --max-warnings=0 --cache --cache-location .eslintinfo","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"6.13.7"},"devDependencies":{"@commitlint/cli":"11.0.0","@hapi/joi":"17.1.1","@types/jest":"25.1.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.4","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.20.1","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.5.4","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tscpaths":"0.0.9","typescript":"4.1.5","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for the isomorphic fetch\n### [Documentation here](https://mihanizm56.github.io/fetch-api/)\n\n### Benefits:\n- Provides validation for responses (based on @hapi/joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services, https://www.npmjs.com/package/query-string is used)\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in the\n  hard-structured response format\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n- Provides the ability to handle the response progress\n- Provides the ability to select necessary fields from the response (https://github.com/nemtsov/json-mask#readme used)\n- Provides the ability to use persistent params for all requests\n- Provides the ability to retry requests\n- Provides the ability to logging your error requests\n\n#### Request input options:\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use @hapi/joi\n- customTimeout(number) - milliseconds for cancel the request on timeout (or a full package of requests if the \"retry\" parameter is activated) \n- retry - number of requests try to request if the response is negative\n\n#### Request output options:\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n- body will be serialized in JSON if body data NOT FormData\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### Please, be careful. The response will be the object:\n```javascript\n{\n  error: boolean,\n  data: Array<IResponse>,\n  additionalErrors: null,\n  errorText: string,\n  code: number\n}\n```\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n#### Set persist options to all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setResponseTrackCallback(({\n  requestParams, // all request parameters\n  response, //  pure response protected object\n  pureResponseData, // response body without formatting\n  requestError: boolean, // is request crashed\n  formattedResponseData // formatted response data in IResponse interface\n}) => ({\n // do some metrics or logging here\n}));\n```\n\n#### Set callback for metrics for all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setPersistentOptions(() => ({\n  headers: {\n    foo: 'bar',\n  },\n}));\n```","readmeFilename":"README.md","gitHead":"91867085246ec2c468a7f95e3c430d6661ab2b67","_id":"@mihanizm56/fetch-api@3.8.4-beta.1","_nodeVersion":"12.13.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-41mg+cDDLBgFlLES8Cm0zfbdznhVJWqbmG1QAprUaYtuTOFZCGbybSMX11EbjdGySA6op7WPd1W2sgXeRjtm2Q==","shasum":"49b762e84b4fdfae269ee33e89537639a79dd658","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.8.4-beta.1.tgz","fileCount":88,"unpackedSize":162775,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhGvMfCRA9TVsSAnZWagAAM3oP/2KSaEmgb4ma2vQmHINV\naQZNB5KQ8G+kj89zf2B9wIfaNl7PGIU07f1nEnu9KIHGjLoMqaOtX3s1NyGX\nYo5L6LGVtQ9Ix63TnthpHZ0LxvDorp5Dyj0G+HtXo+o2GW26FHbbk1k12yDh\nrqukNxmOThqKZOVudphvyEZEstcMEOl3B+nyHn4mqzg1Pnl7s4d/kpdfTWbs\nUhOFsV67PHOqkDacgjFLmfEUfg8MY3DxC9sAsChaBiZAgdxxiF05sl9w9Lm4\nZSYX5A9ltSwWLe5VP8UJwfvcN0cQxmqnifQbkcAy2nLF/K42WUYt9YG3vFRN\nBIugI6l/nctpvIPAXRDU7ZA/gFbg/AJGeksdkyQcYZl+hOjwmbLotM9qm0Yl\nwpHqsct+INDxQHcDMYMpneiIhGgkEHIekkd4I9BhuE0n8WxuY5uK0zQ9P77T\nHS8JTK48FN6iNicK89MT/4JSVMYNm1M0O7fprx7GDJpmhldIqIJ1l0RZcK9D\nYzSlWcQW35eqy9Ljo046GxNL8/RZi2rybhyANMAsZRnnOkaifx4ixfBhvcWY\nSVw7T3NI82OrwusY7fpNu5XRAg+eqIgDThrIpjr/+Sp5qbQI4c8UrmAOnhK1\nFBnT8DVfy9urcaIXJmpTsAVWNgGjiekPjapFnNQWTKFZmTMGlIHK3sniXv6h\n5j1t\r\n=nTH3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDEJULJUeXa1pO498CQy35Mpyofe03ELTmxp3UkNngP8wIhAMhodl5f61FOlhjs1eyto93XPE2G3VeiOKSLIYu7XyfU"}]},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.8.4-beta.1_1629156126886_0.5034025496787808"},"_hasShrinkwrap":false},"3.8.4":{"name":"@mihanizm56/fetch-api","version":"3.8.4","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix --max-warnings=0 --cache --cache-location .eslintinfo","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"6.13.7"},"devDependencies":{"@commitlint/cli":"11.0.0","@hapi/joi":"17.1.1","@types/jest":"25.1.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.4","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.20.1","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.5.4","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tscpaths":"0.0.9","typescript":"4.3.5","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"gitHead":"813258d8e55e08ba3d1e172c9321579c875dfdb1","_id":"@mihanizm56/fetch-api@3.8.4","_nodeVersion":"12.13.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-rw8Ma7AQQJUs7bKLmzJTa080AkfG/4jTnw5S5XhG0D8kTlqPU8aJrzlWgorEWGPBNtLrxCzG8aOYxfS0zlf09g==","shasum":"96940677e6b0d11b6351c1e43a2a897d77c59e04","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.8.4.tgz","fileCount":88,"unpackedSize":165010,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhHYS4CRA9TVsSAnZWagAAsM4P/Rlk2ddkWE6wOtIdO2RK\nM3y8Unic/lY7QwubvTcISPb6ygM4q0Z4c4S4QTvz6VzHo2Uoi/O531LWoLJR\n6n8pkAHtjxs49Q3JfrR7cCgkouh4KA1cBbZNPpjgJOV+tMlvZ5R7WXvc5lN4\nMhiIUdhGxPvMNZlJwBA16Qis1v4GM5kwLPQNEfxxa58lcK3TeA4dvNgUMTJ0\nv27mujsTVT44etaz/sItqs3Ac2vFuZqto7TOHJtzWyB/0LAbGpvHl75oRxLG\nowvWF+TQI3T0uOD4unsvw2W7XGzQJUlivGQ28nrnqePzPTg8shYMrWyZZ8az\nK678o1frCjb2KS0VKRm51LIvCavsl8eB9zLb6nJqcBOoJL9vB1DaNhYPsaqY\n92Hkb9pdKpDrLIeSbGrgMY69YLuEpjRzI1hm2ml3iwfHsnhHuHUg+iMplwMV\nru3FMMjZjgEf4JCplSM0PUs/SFfz9qcAf6xJC6W0Yo+quXnkm7ItZQ95bjWe\ngLsIwnTDrrpyecxsUMKKGGO2/iOpGWw8pfxVSseXEJkBeu+UJ2tv6j/jdohl\nBky+nIFVLDvP3PG//G1/t8/EoeaS3g9/zVQevbj0ofM0gxkxfEKKzLYFo2mA\nPTozGbj/byzse5+0WRw08RiAO744cB+TnuvbkDhiSrwZcl4b0JIV6H7l9qcX\niSH6\r\n=q+w4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDp0MuViRleWvZ2/Yq/szGcXcoxRTQxN1wSf4BWPSLGkAIgYyK1BudcTgNAWDefW+Tmy20Y93399z1tbwI9Wv0UxAg="}]},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.8.4_1629324472208_0.21094636873197636"},"_hasShrinkwrap":false},"3.8.5-beta.1":{"name":"@mihanizm56/fetch-api","version":"3.8.5-beta.1","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix --max-warnings=0 --cache --cache-location .eslintinfo","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"6.13.7"},"devDependencies":{"@commitlint/cli":"11.0.0","@hapi/joi":"17.1.1","@types/jest":"25.1.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.4","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.20.1","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.5.4","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tscpaths":"0.0.9","typescript":"4.3.5","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for the isomorphic fetch\n### [Documentation here](https://mihanizm56.github.io/fetch-api/)\n\n### Benefits:\n- Provides validation for responses (based on @hapi/joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services, https://www.npmjs.com/package/query-string is used)\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in the\n  hard-structured response format\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n- Provides the ability to handle the response progress\n- Provides the ability to select necessary fields from the response (https://github.com/nemtsov/json-mask#readme used)\n- Provides the ability to use persistent params for all requests\n- Provides the ability to retry requests\n- Provides the ability to logging your error requests\n\n#### Request input options:\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use @hapi/joi\n- customTimeout(number) - milliseconds for cancel the request on timeout (or a full package of requests if the \"retry\" parameter is activated) \n- retry - number of requests try to request if the response is negative\n\n#### Request output options:\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n- body will be serialized in JSON if body data NOT FormData\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### Please, be careful. The response will be the object:\n```javascript\n{\n  error: boolean,\n  data: Array<IResponse>,\n  additionalErrors: null,\n  errorText: string,\n  code: number\n}\n```\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n#### Set persist options to all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setResponseTrackCallback(({\n  requestParams, // all request parameters\n  response, //  pure response protected object\n  pureResponseData, // response body without formatting\n  requestError: boolean, // is request crashed\n  formattedResponseData // formatted response data in IResponse interface\n}) => ({\n // do some metrics or logging here\n}));\n```\n\n#### Set callback for metrics for all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setPersistentOptions(() => ({\n  headers: {\n    foo: 'bar',\n  },\n}));\n```","readmeFilename":"README.md","gitHead":"103f0c90d46d4262a8979f603caf4cac7b97a971","_id":"@mihanizm56/fetch-api@3.8.5-beta.1","_nodeVersion":"12.13.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-UetDbFNIHP4XxqNokBv6Tza5CM/GmmEdPcl6K7IggXt1PAqgZrxRH7OJxR0q0JcRrzoDrJKgdqoPaqu4+Y5+EQ==","shasum":"1a7729e5665184370db497fe2c57173cf23884e1","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.8.5-beta.1.tgz","fileCount":88,"unpackedSize":165065,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhHkCiCRA9TVsSAnZWagAAdD0P/2g77SABH7vihYHqsLcS\nMK7lewRrSggU5iWJU1SXGdsMQiRmfzZQu9tU31p0OblDF7I3ff3VOB+cUiYV\n5IEq0Wywz3y3QVGLuLsB0PvbkzUVqlDBidX3mcW0BdjuruUMXxx4BmibMlx5\nPzpOivsWClV9g2OG4u3EqsTN/KmUYdT5G78iJwkNiZgH0LynZIOGzGPskGB6\nsSYCZjNBNYbNFglbqpzAqoQMUqCErKIgisHN2dJbkOdmPkEPHVBJSR7+/hXH\nC1kPmm7259iZBKAKpdO86f/i3ZZweOSv42IuUf2gqOtU7nI/S/dcPLN0oFDp\nDK/bcXGsrbCSfq37i50Mtwe+mG17trUa8W8JBJogKWim7UZ81KKfhM7iI+H8\n00a7kJW7WOInF2janW3IHNK4ceOJmCVJHtzbP7Iqlhd5lb/uAeuXOTa4hnCr\nDWNePHRVGE5fkslCRpt8voUR7BbyBiNiIzfuQOS06ABbkJYscYtEJqjPnuX/\n3nrGWAGgMeXbNhG4UoKrGbkCVl3E0vtEwc0fpbRU0GcY9FbdskS0STyQfuaq\n63T/hS7vKYcCYjUmyUa2PCyLrfkcQMtCFTmpic6fBVFCCJBnJZucCa4EnfT3\nCO9th0ESMaHaS1Ze4yxZdSW0bUHnGboZ6ulVIJkWDEKfDxcg38Mfvk0yslns\njuLT\r\n=7tcn\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHEB9eTUK5sPiPfnMz6OwEV+AV9Hsb5H2BvH4EdIvauxAiEA/kCbZjghq33d7BfUeLQnjMoc+5uD4mHUzescVqPSW+0="}]},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.8.5-beta.1_1629372578560_0.752208104469545"},"_hasShrinkwrap":false},"3.8.5":{"name":"@mihanizm56/fetch-api","version":"3.8.5","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix --max-warnings=0 --cache --cache-location .eslintinfo","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"6.13.7"},"devDependencies":{"@commitlint/cli":"11.0.0","@hapi/joi":"17.1.1","@types/jest":"25.1.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.4","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.20.1","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.5.4","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tscpaths":"0.0.9","typescript":"4.3.5","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"gitHead":"d39d6fbb82c8406c6fb3ea167497686bb73d6ab8","_id":"@mihanizm56/fetch-api@3.8.5","_nodeVersion":"12.13.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-iIZM4kMMWIrYlf/AyBh/NCCvM6IHVJsb3y21D+gYsC3AtJzDnCWnFAfGwlYIowTYZLXro/HMK/7jUOEI3ecR8w==","shasum":"12174c19dc6c85828f31e71f37d015e81d224f44","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.8.5.tgz","fileCount":88,"unpackedSize":165058,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhHkfVCRA9TVsSAnZWagAAvskQAJ10Bt056M83XQCH/c/F\nU9mNGXkgaCOIS7kIDkZkGzJevi19aLDOewCjTdMIYGKIqQTLuMTEVrlUdXuf\nmXROZBYW3G2DV7iv6AUdgYXnuZvnJjzatqpYa5CtrzWSp3uQquFMuL/OelkI\ng/PZMEuSSuDDusS2VR/EiMcRseuc4EgdKcd2spc0nyK0EPBi/6X85o5gncNB\n0gW7R89heuesWU0cDmy5bennebYBC3uQX/vRfrBQZBRXHW4XngVW/GLZDMTH\nFXBDFCQRbJP0rMQ23ND61O68q43pg15NyX+MI7QckV9DBx8ZFi8TwvRFO2vE\nnBABQSoAZnBpByuB3c7PQcP5eRw5QI+2JW1N5HoUmxsgUVHxMyTeT09FoRfV\n1yEViC3ti+jYWsJFdkW+vE/dTZKTcbVmmcXmMsXSvROWGfFbLOyjj2xOI0hX\nscKg8I2MkVG7S6pFB+ZdFsqS8jE/atxhFsWxyDPjkqLxV7Q7j31Y9aDTxdYu\nZTLYyL+qdgfF1wG/D74MSgT/Cl7ecLKREmkWt+O+lrO0K39VtS3TvImw98Ab\ne/ln2oh29sQiVv0frpV/urzoN98YN5ME3nudyObIPHwQgh/EDBER34/LI3gb\nOk3W6Zkh4Mj9jUxoSj1QzWNKst07KU1oX9TAJOcotUWn2ccoWxRwhWVmcaTt\nibxd\r\n=mbvy\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD5hcxH19HHwXMVPZZuaJRIw/iOwM+Hp1XGIgczDI7+1wIgSVwRd5wgKhNZAbA0sG98wrsF9g13CUXjtCf9IwVyWnQ="}]},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.8.5_1629374421679_0.2673442528188128"},"_hasShrinkwrap":false},"3.8.6-beta.1":{"name":"@mihanizm56/fetch-api","version":"3.8.6-beta.1","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix --max-warnings=0 --cache --cache-location .eslintinfo","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"6.13.7"},"devDependencies":{"@commitlint/cli":"11.0.0","@hapi/joi":"17.1.1","@types/jest":"25.1.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.4","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.20.1","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.5.4","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tscpaths":"0.0.9","typescript":"4.3.5","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for the isomorphic fetch\n### [Documentation here](https://mihanizm56.github.io/fetch-api/)\n\n### Benefits:\n- Provides validation for responses (based on @hapi/joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services, https://www.npmjs.com/package/query-string is used)\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in the\n  hard-structured response format\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n- Provides the ability to handle the response progress\n- Provides the ability to select necessary fields from the response (https://github.com/nemtsov/json-mask#readme used)\n- Provides the ability to use persistent params for all requests\n- Provides the ability to retry requests\n- Provides the ability to logging your error requests\n\n#### Request input options:\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use @hapi/joi\n- customTimeout(number) - milliseconds for cancel the request on timeout (or a full package of requests if the \"retry\" parameter is activated) \n- retry - number of requests try to request if the response is negative\n\n#### Request output options:\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n- body will be serialized in JSON if body data NOT FormData\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### Please, be careful. The response will be the object:\n```javascript\n{\n  error: boolean,\n  data: Array<IResponse>,\n  additionalErrors: null,\n  errorText: string,\n  code: number\n}\n```\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n#### Set persist options to all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setResponseTrackCallback(({\n  requestParams, // all request parameters\n  response, //  pure response protected object\n  pureResponseData, // response body without formatting\n  requestError: boolean, // is request crashed\n  formattedResponseData // formatted response data in IResponse interface\n}) => ({\n // do some metrics or logging here\n}));\n```\n\n#### Set callback for metrics for all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setPersistentOptions(() => ({\n  headers: {\n    foo: 'bar',\n  },\n}));\n```","readmeFilename":"README.md","gitHead":"fdc82ec2312e478a1caa11b2f9b5357bdc4387b3","_id":"@mihanizm56/fetch-api@3.8.6-beta.1","_nodeVersion":"12.13.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-D1020DSklTYFZpz4YDXDfMHMkNacNUnqv33Jwqp7FGoTkm9l3XizTS0BTkeLanLYpEq4xZpO3xq8+BgbScwbog==","shasum":"976cdecedb45cba27ab83129ac69dee7d3a5dc99","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.8.6-beta.1.tgz","fileCount":88,"unpackedSize":165116,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEUNOZj8hZ6Q2Xk7qiGbZpZXl9uT69n8VxFyZJ2LV0bIAiEAlBiP/xBvItRyeJel3WZzeLBzc7Ko6WYNWJ40UdKAFOs="}]},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.8.6-beta.1_1632780508900_0.1572929452302374"},"_hasShrinkwrap":false},"3.8.6-beta.2":{"name":"@mihanizm56/fetch-api","version":"3.8.6-beta.2","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix --max-warnings=0 --cache --cache-location .eslintinfo","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"6.13.7"},"devDependencies":{"@commitlint/cli":"11.0.0","@hapi/joi":"17.1.1","@types/jest":"25.1.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.4","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.20.1","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.5.4","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tscpaths":"0.0.9","typescript":"4.3.5","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for the isomorphic fetch\n### [Documentation here](https://mihanizm56.github.io/fetch-api/)\n\n### Benefits:\n- Provides validation for responses (based on @hapi/joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services, https://www.npmjs.com/package/query-string is used)\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in the\n  hard-structured response format\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n- Provides the ability to handle the response progress\n- Provides the ability to select necessary fields from the response (https://github.com/nemtsov/json-mask#readme used)\n- Provides the ability to use persistent params for all requests\n- Provides the ability to retry requests\n- Provides the ability to logging your error requests\n\n#### Request input options:\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by @hapi/joi <br/>(you must use the @hapi/joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use @hapi/joi\n- customTimeout(number) - milliseconds for cancel the request on timeout (or a full package of requests if the \"retry\" parameter is activated) \n- retry - number of requests try to request if the response is negative\n\n#### Request output options:\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n- body will be serialized in JSON if body data NOT FormData\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### Please, be careful. The response will be the object:\n```javascript\n{\n  error: boolean,\n  data: Array<IResponse>,\n  additionalErrors: null,\n  errorText: string,\n  code: number\n}\n```\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n#### Set persist options to all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setResponseTrackCallback(({\n  requestParams, // all request parameters\n  response, //  pure response protected object\n  pureResponseData, // response body without formatting\n  requestError: boolean, // is request crashed\n  formattedResponseData // formatted response data in IResponse interface\n}) => ({\n // do some metrics or logging here\n}));\n```\n\n#### Set callback for metrics for all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setPersistentOptions(() => ({\n  headers: {\n    foo: 'bar',\n  },\n}));\n```","readmeFilename":"README.md","gitHead":"6730214bf622f56b64562e0f9e385b380eec428c","_id":"@mihanizm56/fetch-api@3.8.6-beta.2","_nodeVersion":"12.13.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-vaGof4bLLt8mtVnb9EaAZENqma3LrO/A9tKM5YsYBb4X/ggarGHPooOP2DyU7EDOaTmjYCYUESOzmAqlUd0IZQ==","shasum":"f5d0c6ceb94c7e968a31ea30daa1d568e5e06727","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.8.6-beta.2.tgz","fileCount":90,"unpackedSize":172460,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCl0GIDPHtVv2ANwCz6cot+bp4E2VLelggzxuUexcXvTgIgUdyyuKkKgc8OI9j6P7fSvf9XIb+WZFEadyTJsD+Wrow="}]},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.8.6-beta.2_1635893751312_0.3533455399632677"},"_hasShrinkwrap":false},"3.8.6-beta.3":{"name":"@mihanizm56/fetch-api","version":"3.8.6-beta.3","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix --max-warnings=0 --cache --cache-location .eslintinfo","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"7.0.1"},"devDependencies":{"@commitlint/cli":"11.0.0","colors":"1.4.0","@types/jest":"25.1.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.4","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.20.1","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.5.4","joi":"17.4.2","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tscpaths":"0.0.9","typescript":"4.3.5","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for the isomorphic fetch\n### [Documentation here](https://mihanizm56.github.io/fetch-api/)\n\n### Benefits:\n- Provides validation for responses (based on joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services, https://www.npmjs.com/package/query-string is used)\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in the\n  hard-structured response format\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n- Provides the ability to handle the response progress\n- Provides the ability to select necessary fields from the response (https://github.com/nemtsov/json-mask#readme used)\n- Provides the ability to use persistent params for all requests\n- Provides the ability to retry requests\n- Provides the ability to logging your error requests\n\n#### Request input options:\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by joi <br/>(you must use the joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use joi\n- customTimeout(number) - milliseconds for cancel the request on timeout (or a full package of requests if the \"retry\" parameter is activated) \n- retry - number of requests try to request if the response is negative\n\n#### Request output options:\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n- body will be serialized in JSON if body data NOT FormData\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### Please, be careful. The response will be the object:\n```javascript\n{\n  error: boolean,\n  data: Array<IResponse>,\n  additionalErrors: null,\n  errorText: string,\n  code: number\n}\n```\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n#### Set persist options to all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setResponseTrackCallback(({\n  requestParams, // all request parameters\n  response, //  pure response protected object\n  pureResponseData, // response body without formatting\n  requestError: boolean, // is request crashed\n  formattedResponseData // formatted response data in IResponse interface\n}) => ({\n // do some metrics or logging here\n}));\n```\n\n#### Set callback for metrics for all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setPersistentOptions(() => ({\n  headers: {\n    foo: 'bar',\n  },\n}));\n```","readmeFilename":"README.md","gitHead":"a04d11049dd3c0e841f81d8a0a3e9b6b8f275f36","_id":"@mihanizm56/fetch-api@3.8.6-beta.3","_nodeVersion":"12.18.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-zW3HjhvvTjfYP0HukZJk246NYgVRqizdJ6CzOqvGSnaSlDcyzpMPfP7jTx/Gj8f7dhoBgjaXrdbwD1texo0tzA==","shasum":"3799ff6919d1198c73d34fd6fde51c7516b5b5e4","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.8.6-beta.3.tgz","fileCount":90,"unpackedSize":172429,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDG6PNMCtgozpNXmTM64vFfUn9wvZhfd3pFlQE7OMtUYgIgGZKc8ixNw8HDKQWhM7YEnCFXz5np1pUZ5AT1wpJMncM="}]},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.8.6-beta.3_1636041052822_0.04152382079890793"},"_hasShrinkwrap":false},"3.8.6":{"name":"@mihanizm56/fetch-api","version":"3.8.6","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix --max-warnings=0 --cache --cache-location .eslintinfo","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"7.0.1"},"devDependencies":{"@commitlint/cli":"11.0.0","colors":"1.4.0","@types/jest":"25.1.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.4","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.20.1","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.5.4","joi":"17.4.2","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tscpaths":"0.0.9","typescript":"4.3.5","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"gitHead":"9147093c029f021ec0f05d677b0b8099bca4a11b","_id":"@mihanizm56/fetch-api@3.8.6","_nodeVersion":"14.18.1","_npmVersion":"6.14.15","dist":{"integrity":"sha512-iUy++VfinHA5QqA1j0DwRUxeIVoravJ/34w2bdr6VV+ia1c2hlDX9xZ+xwrR2XoBOpM9fpDADl3/8/2mRp8IoA==","shasum":"b23fc089d86a59fb3e9293ed9383c5ec587be6df","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.8.6.tgz","fileCount":90,"unpackedSize":172422,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAiZxWW1kkJX6wXHOHVZE/Tp9TwpLYi6BG3A/hPH9SCzAiEAtAdIHu0UMGSukFUtjQ8IB82Op9ar1trh/rCYXdT5JIE="}]},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.8.6_1636041193137_0.6048712472838877"},"_hasShrinkwrap":false},"3.8.7":{"name":"@mihanizm56/fetch-api","version":"3.8.7","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix --max-warnings=0 --cache --cache-location .eslintinfo","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"7.0.1"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"25.1.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.4","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.20.1","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.5.4","joi":"17.4.2","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tscpaths":"0.0.9","typescript":"4.3.5","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"gitHead":"9147093c029f021ec0f05d677b0b8099bca4a11b","_id":"@mihanizm56/fetch-api@3.8.7","_nodeVersion":"12.18.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-M1LJupVDMnydOoyfdtBVbDPgzwAqC+QpSMz29e/HoRWu7C7rENnkQOhuu3dbL7Ccru0LI6VTHtethHyJNmGj8A==","shasum":"2c6b3a7779c30d74a729bd6918597e026868851d","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.8.7.tgz","fileCount":90,"unpackedSize":172422,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC9Zk2oIAPCYK3XGnVpBgIAT7F53o2JxISZnKsmnPnKcAIgZUQOUvNBswiQv5vjxDrMdfV/wQmSGKI5Bwd82VuDqlI="}]},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.8.7_1636041297068_0.6863228210354384"},"_hasShrinkwrap":false},"3.8.8-beta.1":{"name":"@mihanizm56/fetch-api","version":"3.8.8-beta.1","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix --max-warnings=0 --cache --cache-location .eslintinfo","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"7.0.1"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"25.1.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.4","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.20.1","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.5.4","joi":"17.4.2","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tscpaths":"0.0.9","typescript":"4.3.5","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for the isomorphic fetch\n### [Documentation here](https://mihanizm56.github.io/fetch-api/)\n\n### Benefits:\n- Provides validation for responses (based on joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services, https://www.npmjs.com/package/query-string is used)\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in the\n  hard-structured response format\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n- Provides the ability to handle the response progress\n- Provides the ability to select necessary fields from the response (https://github.com/nemtsov/json-mask#readme used)\n- Provides the ability to use persistent params for all requests\n- Provides the ability to retry requests\n- Provides the ability to logging your error requests\n\n#### Request input options:\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by joi <br/>(you must use the joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use joi\n- customTimeout(number) - milliseconds for cancel the request on timeout (or a full package of requests if the \"retry\" parameter is activated) \n- retry - number of requests try to request if the response is negative\n\n#### Request output options:\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n- body will be serialized in JSON if body data NOT FormData\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### Please, be careful. The response will be the object:\n```javascript\n{\n  error: boolean,\n  data: Array<IResponse>,\n  additionalErrors: null,\n  errorText: string,\n  code: number\n}\n```\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n#### Set persist options to all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setResponseTrackCallback(({\n  requestParams, // all request parameters\n  response, //  pure response protected object\n  pureResponseData, // response body without formatting\n  requestError: boolean, // is request crashed\n  formattedResponseData // formatted response data in IResponse interface\n}) => ({\n // do some metrics or logging here\n}));\n```\n\n#### Set callback for metrics for all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setPersistentOptions(() => ({\n  headers: {\n    foo: 'bar',\n  },\n}));\n```","readmeFilename":"README.md","gitHead":"383becdbd30a4f0eabc82be4e79b3d66d8645103","_id":"@mihanizm56/fetch-api@3.8.8-beta.1","_nodeVersion":"12.18.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-otUlpJW3FAe9nztyHJabQ1IaNn9U82T7pQ7tJb7Sac3K4jC8f0QT2ZztWW4Am8ypvZ0pnvyWXtuzAF93UZQuLA==","shasum":"66d63a067be4ea507110a3333417ecfeeec2c256","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.8.8-beta.1.tgz","fileCount":90,"unpackedSize":175105,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCz2xU9aB6Nef5IEeMEST6KKRYFvVYtx+RFRNFxq4aV/QIhANFwKuXNGQFCjJUYUEr08uAdT85nJ2MzREachQaAi76g"}]},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.8.8-beta.1_1636111324054_0.5617470295704412"},"_hasShrinkwrap":false},"3.8.8-beta.2":{"name":"@mihanizm56/fetch-api","version":"3.8.8-beta.2","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix --max-warnings=0 --cache --cache-location .eslintinfo","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"7.0.1"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"25.1.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.4","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.20.1","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.5.4","joi":"17.4.2","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tscpaths":"0.0.9","typescript":"4.3.5","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for the isomorphic fetch\n### [Documentation here](https://mihanizm56.github.io/fetch-api/)\n\n### Benefits:\n- Provides validation for responses (based on joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services, https://www.npmjs.com/package/query-string is used)\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in the\n  hard-structured response format\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n- Provides the ability to handle the response progress\n- Provides the ability to select necessary fields from the response (https://github.com/nemtsov/json-mask#readme used)\n- Provides the ability to use persistent params for all requests\n- Provides the ability to retry requests\n- Provides the ability to logging your error requests\n\n#### Request input options:\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by joi <br/>(you must use the joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use joi\n- customTimeout(number) - milliseconds for cancel the request on timeout (or a full package of requests if the \"retry\" parameter is activated) \n- retry - number of requests try to request if the response is negative\n\n#### Request output options:\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n- body will be serialized in JSON if body data NOT FormData\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### Please, be careful. The response will be the object:\n```javascript\n{\n  error: boolean,\n  data: Array<IResponse>,\n  additionalErrors: null,\n  errorText: string,\n  code: number\n}\n```\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n#### Set persist options to all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setResponseTrackCallback(({\n  requestParams, // all request parameters\n  response, //  pure response protected object\n  pureResponseData, // response body without formatting\n  requestError: boolean, // is request crashed\n  formattedResponseData // formatted response data in IResponse interface\n}) => ({\n // do some metrics or logging here\n}));\n```\n\n#### Set callback for metrics for all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setPersistentOptions(() => ({\n  headers: {\n    foo: 'bar',\n  },\n}));\n```","readmeFilename":"README.md","gitHead":"f5b89e98a9306299d2df9d61ea4b0b34c34d513d","_id":"@mihanizm56/fetch-api@3.8.8-beta.2","_nodeVersion":"12.18.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-ME2n/LmN/T8u2D5n8H1kVTsgZGJ+BrQ4hVg+zSLFH/rM6DxgvQmoZmwrebQaZtOyGsU78sFpueCA48GZADRH8A==","shasum":"ae656b270546bc63313d6c45642eb2dbaf5c05ec","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.8.8-beta.2.tgz","fileCount":90,"unpackedSize":175130,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIE2Q4TvmuH9QL/L1c3unKciJmyniNoikT5IN+5fyTTiyAiEA8tSPezxNzdNkcS15ramJfgGI+D+b7GI3gkAohKpTF0k="}]},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.8.8-beta.2_1636112076482_0.697447180989458"},"_hasShrinkwrap":false},"3.8.8":{"name":"@mihanizm56/fetch-api","version":"3.8.8","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix --max-warnings=0 --cache --cache-location .eslintinfo","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"7.0.1"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"25.1.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"2.5.0","@typescript-eslint/parser":"2.5.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.4","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"6.8.0","eslint-config-airbnb-base":"14.1.0","eslint-config-prettier":"6.5.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.0.0","eslint-loader":"3.0.2","eslint-plugin-import":"2.20.1","eslint-plugin-prettier":"3.1.1","eslint-plugin-security":"1.4.0","express":"4.17.1","husky":"3.0.9","jest":"25.5.4","joi":"17.4.2","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","prettier":"1.18.2","ts-jest":"25.4.0","tscpaths":"0.0.9","typescript":"4.3.5","typescript-transform-paths":"1.1.14"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"gitHead":"9fe68b12a95c544adf0b7a9ab3f31c579ebdeb2c","_id":"@mihanizm56/fetch-api@3.8.8","_nodeVersion":"12.18.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-vAVa4GInCwbsrvLRWtPOJLbLD4EGRx5CZQ7UK53ashdLxjt0e4b6y+nq4b08p67X8gSsuP8al07qiYGvwwOrxA==","shasum":"856aa537fa4a5a3fe6c265df1b6e137bf24075b8","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.8.8.tgz","fileCount":90,"unpackedSize":175155,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAFUcC4/g0qrDEsblVj7qnvwLUWqPdP3kHJKej/dex9jAiEAzBpcnmMNr09vq/e+Az+ofULlAaghYbR+OUWgkknJuLI="}]},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.8.8_1636113451720_0.15025027377774758"},"_hasShrinkwrap":false},"3.8.9":{"name":"@mihanizm56/fetch-api","version":"3.8.9","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","engines":{"node":">=12 <13"},"scripts":{"install":"node config/install/mark.js","server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix --max-warnings=0 --cache --cache-location .eslintinfo","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"7.0.1"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"25.1.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"5.3.0","@typescript-eslint/parser":"5.3.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.4","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"8.2.0","eslint-config-airbnb-base":"15.0.0","eslint-config-prettier":"8.3.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.5.0","eslint-loader":"4.0.2","eslint-plugin-import":"2.25.3","eslint-plugin-prettier":"4.0.0","eslint-plugin-security":"1.4.0","prettier":"2.4.1","express":"4.17.1","husky":"3.0.9","jest":"25.5.4","joi":"17.4.2","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","ts-jest":"25.4.0","tscpaths":"0.0.9","typescript":"4.4.4"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"gitHead":"f1127dbc3ac267ffd4fb4c44bf8eb7c671cb1496","_id":"@mihanizm56/fetch-api@3.8.9","_nodeVersion":"12.22.7","_npmVersion":"6.14.15","dist":{"integrity":"sha512-rxFEVyd0EMQ0IPM5CZV9MXaCHj8s/mACYSptm2YT8qpRBCEQFzca8kbKn6QbtnnESUxelUZhoL9rAtR68qciTw==","shasum":"05282f6e9d8088ab521a74d9a0d037f784122e5b","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.8.9.tgz","fileCount":90,"unpackedSize":176089,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhlrt6CRA9TVsSAnZWagAAexUP/2WK1ZEHYFqysfr+1mqS\nCHDZeVF1JonBip69bx02oHloUrC2rcPYl2DYM/EO5z+XDbw/2zNS54T5s9pJ\nNh2+e4szMnt1JYvp5Fu+bEIocu2qqs76u6fDgiG2Li47PPx7EXDWb7rZlyoK\naqjcW0lXQeGB9vT8fZY10tcUya3ITlbeJrcbTGsCs+wfaQexCtT/anbs/SQ/\nU0H7yvPoVamgTXiLuir3FMv/RDWSFZsdetvdagvQSZHkUU3P4JbWWq69/Oaj\n7xVWHWHqPhPsnxpW0SZWh4+snBYjLdEKgVwJEOzWFBdlGbXbm2k9AruyDKdy\n0AvEHNQI3U2V21Rnp57Oo+1nOHG42QZwpyChvtsr/2a726WL9ulvl/EoBSb1\nbcRMbuP+cGSBpAoxopZQnaFq2jURWWrjW5L1hGW9i1sq6J1eiF6943QgnWOt\n9NlvoDTB3myrVQoi/HBXZMl6cxTEn4WTy2zdTj6E1h3p0pTHsXVq+SkAyPdJ\nLknPxp5kFeQPRycwwqBkndh7H718JGLbsD5o8JJl5eqBKXlxJNrztQkmHF1z\n6bMt/BuokCg09vExcqoU+eDr77jtAUMVs4udkYYhFovk9/VBYwTJle8AsaW3\nQPRl17pyFeBtnG3JZusVg5/1DqMTs4/KiDjtXSrjUIXXAmvd4GRPt1OOBwt4\nKJsU\r\n=ikQN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGwpbFmwNsz90UDIZshZ8ErN6bvH2SR9tbc3nigvhduUAiBhtg9b5M7ULI2OiqVq8z4WxOrK4WOA7uW1NOxG+j2LOg=="}]},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.8.9_1637268345976_0.48836929287202935"},"_hasShrinkwrap":false},"3.8.10":{"name":"@mihanizm56/fetch-api","version":"3.8.10","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix --max-warnings=0 --cache --cache-location .eslintinfo","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"7.0.1"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"25.1.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"5.3.0","@typescript-eslint/parser":"5.3.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.4","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"8.2.0","eslint-config-airbnb-base":"15.0.0","eslint-config-prettier":"8.3.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.5.0","eslint-loader":"4.0.2","eslint-plugin-import":"2.25.3","eslint-plugin-prettier":"4.0.0","eslint-plugin-security":"1.4.0","prettier":"2.4.1","express":"4.17.1","husky":"3.0.9","jest":"25.5.4","joi":"17.4.2","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","ts-jest":"25.4.0","tscpaths":"0.0.9","typescript":"4.4.4"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"gitHead":"cf9fc9ece2086051f89a3ae0403a63cba19afe26","_id":"@mihanizm56/fetch-api@3.8.10","_nodeVersion":"12.22.7","_npmVersion":"6.14.15","dist":{"integrity":"sha512-o7AM720O0MRIGTGe24G0MLg1WUjsh7xwod329V4pNmQy7myssy5aLRDhbw4Hy2eTzBWHEFYpldzzqvv5y3H2jA==","shasum":"0b5972ccac74736a932aeff5671b557604266eba","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.8.10.tgz","fileCount":90,"unpackedSize":176047,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhlr0VCRA9TVsSAnZWagAA314QAIrMRpMRRg+pVOivHTED\nGqIpqOkHs29jzsDy/7xK+0bgiNJOYZhDCUmCGZ9YjdQyNiQHTlKQrzxrWB/E\nztjDO8xWOBQaXXqy9YzFv8KM6YxQAok1uapVm0D6RRpcObNFlrHG8X2PjpZa\nDOSfjSW8RduDkyPRuZvLuvWbH1P1ZohpCCQuyEaEjI0RqiVvSXoE6PD8KdJP\nWGGULCg6DNMvpnVw/ALFVmexUoOCodKs5biIrmy/N0lOqVjxYoAdwpasBl42\n09F8MqYasD85nwwaWHISu26FiEclUafAW1ah9/QdDQvQH+ypnm+hh4/diPCu\nSS+56oHsg2lkAUxdFu7093v1DHYVqr9UM7aT9Im0KNzQcukd7DO266gCP8+0\nS6twcBGFPUZ2t+SH6Qu0pqJYTVX+0RbDwNpJYTLddgOWpm4JFd7Km6Mnht5j\nVdr7mZHqIv3yFA7O1TNO1NLcK/8O3ARMeAIdejigzTQ97/h7aQeO/xUzBTxT\nIp5EExoYcm8MoGJiByGhTnGsj9v2CQ4hW0o1mD5xcbydga+3bZazQHCkQvJJ\nslZN26fUrQ1clMHKqCWVmXQTyMmPydb8ezqXBaDovKcZEadfAY9SzcVUht39\noFk562QdEyPCyfNXBQ3AtFVKbjX/KND1Kj46mzAmswi+u1L5Qz0TZ1edg4P5\nqM8w\r\n=2mdL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEmQwrpaMxR3ci1/JutSEk9Pc6hZPksqIOwVpI3e2H2oAiAyyOJCo775X3bUTamVmQ3p/k1qwImv69Q+MSlM4e7dYw=="}]},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.8.10_1637268757316_0.7140030649157183"},"_hasShrinkwrap":false},"3.8.10-beta.1":{"name":"@mihanizm56/fetch-api","version":"3.8.10-beta.1","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix --max-warnings=0 --cache --cache-location .eslintinfo","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"7.0.1"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"25.1.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"5.3.0","@typescript-eslint/parser":"5.3.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.4","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"8.2.0","eslint-config-airbnb-base":"15.0.0","eslint-config-prettier":"8.3.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.5.0","eslint-loader":"4.0.2","eslint-plugin-import":"2.25.3","eslint-plugin-prettier":"4.0.0","eslint-plugin-security":"1.4.0","prettier":"2.4.1","express":"4.17.1","husky":"3.0.9","jest":"25.5.4","joi":"17.4.2","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","ts-jest":"25.4.0","tscpaths":"0.0.9","typescript":"4.4.4"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for the isomorphic fetch\n### [Documentation here](https://mihanizm56.github.io/fetch-api/)\n\n### Benefits:\n- Provides validation for responses (based on joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services, https://www.npmjs.com/package/query-string is used)\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in the\n  hard-structured response format\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n- Provides the ability to handle the response progress\n- Provides the ability to select necessary fields from the response (https://github.com/nemtsov/json-mask#readme used)\n- Provides the ability to use persistent params for all requests\n- Provides the ability to retry requests\n- Provides the ability to logging your error requests\n\n#### Request input options:\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by joi <br/>(you must use the joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use joi\n- customTimeout(number) - milliseconds for cancel the request on timeout (or a full package of requests if the \"retry\" parameter is activated) \n- retry - number of requests try to request if the response is negative\n\n#### Request output options:\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n- body will be serialized in JSON if body data NOT FormData\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### Please, be careful. The response will be the object:\n```javascript\n{\n  error: boolean,\n  data: Array<IResponse>,\n  additionalErrors: null,\n  errorText: string,\n  code: number\n}\n```\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n#### Set persist options to all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setResponseTrackCallback(({\n  requestParams, // all request parameters\n  response, //  pure response protected object\n  pureResponseData, // response body without formatting\n  requestError: boolean, // is request crashed\n  formattedResponseData // formatted response data in IResponse interface\n}) => ({\n // do some metrics or logging here\n}));\n```\n\n#### Set callback for metrics for all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setPersistentOptions(() => ({\n  headers: {\n    foo: 'bar',\n  },\n}));\n```","readmeFilename":"README.md","gitHead":"224ffe2b610688968eb2393f3660fd2408446c94","_id":"@mihanizm56/fetch-api@3.8.10-beta.1","_nodeVersion":"12.22.7","_npmVersion":"6.14.15","dist":{"integrity":"sha512-Hh+FKkGFidK3xqggmi84m1AJqfRDat+BhFEGoctZogdvRiNXuNTuogSJVC44ZDTIce2dfWMGsOHLZzBEmSbznQ==","shasum":"d0df18037ee23af722aa8b0c04f490a8dc47c6ae","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.8.10-beta.1.tgz","fileCount":92,"unpackedSize":178140,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhrgtYCRA9TVsSAnZWagAAyJwP+wXsk/MQ0noaJmzZlbsT\nJarbqsMUn1pbV7gi6Lv4M8kuH9teS+veAhpIbnJe7y+GAnoS415/sRZMO9G0\nPztPqUGKswNoWdxO0+rP7OkNiRtA8wxNhqK+jyjKmk9ealMaoTqpW2vBA3qo\nUwqJvLoQMuwTGTPMWrF+4oggIOotEh50kl3EdZgHHhlmWxVTbtXkDh0689Im\n+5DDlhaI9ic4/wEncOZRGBMb0XQQRJbifD9VlOaDyI/dI2wN8zW5CmNXpho5\nm7UAjwauZsxe4kwryQBhdLkV+FjwArBzg9HcY0xO2bytVjxL9120YKmfjajj\nB2T+1nihnwVA3NJa/XgdGJ68Z3rSOmVdh5bB1tJxMmL26LM9p0d+7Mfx/ywK\n604Zd2LKPIAIcIxZvdAjomZv/2mAOfF3kkNdVSb9Y+YzzerwS0/wNh8XNuJF\nuk4gjwcMhc/ppXS8UyELsA1zeC49mcZZnrAhNH9SukBKcGSDU7nEz/YGWsFq\nN51lhBC2QnzV0i0l04osTNnm41r0P1uCCPDv28V8wzuL5URzinnslIoy170Y\njzk5zVARvYrAznmlMvd29UQO9gQ5FMUSZxeCLW5zbqWk8Ze/Vnt0IB/NGzWL\neKHK5KVKEIxWGQ/CQ7q/suYX/ah8NWnFG+453crS5tyhTqp1d4N79Ne5g1zq\n8TNP\r\n=lRLa\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCpRv6qDCrse1gyw6v2FIwZc4SM7iP6T3W4DSYSTySnswIgaGZzz9qBe5SWWrZFmkItcSDTj+MCcbrm/jsr7B+MPVk="}]},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.8.10-beta.1_1638796120407_0.561959725114233"},"_hasShrinkwrap":false},"3.8.11":{"name":"@mihanizm56/fetch-api","version":"3.8.11","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix --max-warnings=0 --cache --cache-location .eslintinfo","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"7.0.1"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"25.1.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"5.3.0","@typescript-eslint/parser":"5.3.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.4","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"8.2.0","eslint-config-airbnb-base":"15.0.0","eslint-config-prettier":"8.3.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.5.0","eslint-loader":"4.0.2","eslint-plugin-import":"2.25.3","eslint-plugin-prettier":"4.0.0","eslint-plugin-security":"1.4.0","prettier":"2.4.1","express":"4.17.1","husky":"3.0.9","jest":"25.5.4","joi":"17.4.2","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","ts-jest":"25.4.0","tscpaths":"0.0.9","typescript":"4.4.4"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"gitHead":"de7d0f54ad281296a8ed3da28a4159820be36a37","_id":"@mihanizm56/fetch-api@3.8.11","_nodeVersion":"12.22.7","_npmVersion":"6.14.15","dist":{"integrity":"sha512-0xhQ4JQooFJdz/2/0OCeyJIM6pXYe3QVHDDxPBOdMvoASOGruDeqvSzGzVdpprM9tzSHCSUqwEWaFfyuC/3ZNQ==","shasum":"9170b8da15dbc86b2f6d6979972aba0f9c7d3a16","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.8.11.tgz","fileCount":92,"unpackedSize":177395,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhriDHCRA9TVsSAnZWagAAA5QP/0xLM6Xv6UQ2x8u3XQ6Q\noFJtLEjW+p7PkQa2eDPnI3qRrQc2aivkh/3BAaEmTOcF611fwRD4naLne1LW\ngyP4YPZ9ycU3c3Hivx0MMCmx4N6RzTgdnPwvmtj1B0/pLHieKjicHQcH3dU9\n5oDaC21zoKrHMAd172KkUPzq2EbLqZMt+8VmxEmtZHQsW8QIWpgR6l6gP8Tt\ngJN11m20S8NKhxEambJa7Zzr5i/wcs843B7VQbvZ2LgE/3HqksHH8oc5gFIK\nxEszpTUdKASFl2VieELmktmWlajv4BR5c+rl4dwGpiBd32Js2sNObhbLLcoc\n1QAo2vIv/D3dSzQ9nvTj12o4ZcQN3Wy6c24x0kdBmSoLtwEhEtb6jkRkZPfV\nRDLAzqw+UiCszRd5DQGfMjzJ+6H4mwIMFpOtamsRdTiyvwgXtQub0JG0BdAu\ns3ZqTod4kvYLLsGbZsFBbm9hHUscv7CFaq/um7QGgp5nE3xDROkhS0TueGGq\nrtwrlfz8GTkryF2PlLJ8Cm/cNODSbRfz3LOkdEpWHfWnEJorbGvCU0jQLD5I\nZzwYOB/V4HD19d0guqseds0FFBRGXGxEX1QsA13gqr8gJyNLu8sDfVdYz9XA\nEdAUMO+p9gQU773k12lI4AJFxPSy2idSD13yqpt1VsrjsOOSfh5DaoIO3gWY\n38CH\r\n=YfS4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCd8n4D5PYhvBmVsE8BWynXJ62uwlSCshtYbYK2oHq/SAIhAPuOKbb5KTyZwwXxGLERqJCxtPOdfrh/I8Y6tknjk17/"}]},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.8.11_1638801607733_0.7021140304960234"},"_hasShrinkwrap":false},"3.8.12-beta.1":{"name":"@mihanizm56/fetch-api","version":"3.8.12-beta.1","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix --max-warnings=0 --cache --cache-location .eslintinfo","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"7.0.1"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"25.1.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"5.3.0","@typescript-eslint/parser":"5.3.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.4","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"8.2.0","eslint-config-airbnb-base":"15.0.0","eslint-config-prettier":"8.3.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.5.0","eslint-loader":"4.0.2","eslint-plugin-import":"2.25.3","eslint-plugin-prettier":"4.0.0","eslint-plugin-security":"1.4.0","prettier":"2.4.1","express":"4.17.1","husky":"3.0.9","jest":"25.5.4","joi":"17.4.2","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","ts-jest":"25.4.0","tscpaths":"0.0.9","typescript":"4.4.4"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for the isomorphic fetch\n### [Documentation here](https://mihanizm56.github.io/fetch-api/)\n\n### Benefits:\n- Provides validation for responses (based on joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services, https://www.npmjs.com/package/query-string is used)\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in the\n  hard-structured response format\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n- Provides the ability to handle the response progress\n- Provides the ability to select necessary fields from the response (https://github.com/nemtsov/json-mask#readme used)\n- Provides the ability to use persistent params for all requests\n- Provides the ability to retry requests\n- Provides the ability to logging your error requests\n\n#### Request input options:\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by joi <br/>(you must use the joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use joi\n- customTimeout(number) - milliseconds for cancel the request on timeout (or a full package of requests if the \"retry\" parameter is activated) \n- retry - number of requests try to request if the response is negative\n\n#### Request output options:\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n- body will be serialized in JSON if body data NOT FormData\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### Please, be careful. The response will be the object:\n```javascript\n{\n  error: boolean,\n  data: Array<IResponse>,\n  additionalErrors: null,\n  errorText: string,\n  code: number\n}\n```\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n#### Set persist options to all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setResponseTrackCallback(({\n  requestParams, // all request parameters\n  response, //  pure response protected object\n  pureResponseData, // response body without formatting\n  requestError: boolean, // is request crashed\n  formattedResponseData // formatted response data in IResponse interface\n}) => ({\n // do some metrics or logging here\n}));\n```\n\n#### Set callback for metrics for all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setPersistentOptions(() => ({\n  headers: {\n    foo: 'bar',\n  },\n}));\n```","readmeFilename":"README.md","gitHead":"c9850338610655008e6a2f76196e1cf9e0640a4d","_id":"@mihanizm56/fetch-api@3.8.12-beta.1","_nodeVersion":"12.13.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-P3R9v7sP8rRrxv6huufqvav0idd3UO2JO8saWlVurXGCTrs3CmXg+UUt6tl3159vnJy3H3Ql5A1b0tgxVnraNQ==","shasum":"6f520ac19f26d7f12d8c31cc0de5f30b2dc25111","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.8.12-beta.1.tgz","fileCount":92,"unpackedSize":177510,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhsfZ2CRA9TVsSAnZWagAADWIP/RHZapxY95uE4FHYhyqD\nunJ8k5YjJ8slMxRyJbB8WvhTRDQf6ZIHTGhgKTNp0JcfnYI4frczYU/ZAswu\n6GyaZlU8DZ/qQVhQqGC1ZItPSWgHDkeFGXd8qUt1bIAdopP3EQ7xFeSzAJZ4\n9aPO/7aLIuUTRAIzQTX9WWm8nKwXQYJg4JTd5Ch6VPLisqHMh8QLsaK6oSHs\n/tIVQ/iRSaOFw70GtHubEhVYBUPak7/Xr2IkPwQ4088xuxz6FMFbUL32U5c2\nRd4KluXRIYZwiEZyQB6Y0iIwokmBlZKyEiEUJJGIglnkONwfrm+C6sVXEe0P\nJEf/5s56nE1iDhYVvwOtx24dUWMTKpv52uHC5sr4VTkOpLI7eWgrg/zi4Da9\noEiXmLRstQuCxSivbLB0fFoLph7hyldX1ZIodWROWheFa2FEO6l+CPjDoV+7\nL6jFQ4ydvLHW6fhTUvVClSV0kQxI44SmUAC1eLjZ8IkIMPwGbMwUtr4mMouP\nGoMrK7uFwEaM6asyN7/r/v1lOTm8Ch6ISfYJwux1xoQiSozjETbikYlLs6Tz\nr1VNkl9LJgEhLIFVU5UnUa80ZFm2seaU23aivVkbWkSyOUloDcO7+KZPKu9W\nYzl4jf2RDG6TbXw22ZosfMtAkNKYPgx7SMEZA8EngnuRdjtWi2r7zTINmmuh\n9oB8\r\n=2ted\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEkmZQ400m5zfvsYYJpyzyGAOUaUmD290odHFt2Dj9jlAiEA78Q2EFLJgfNQ6jzPQE9y4EAN9RTr2tLpIu93ARJTf0k="}]},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.8.12-beta.1_1639052917874_0.6345376512187701"},"_hasShrinkwrap":false},"3.8.12-beta.2":{"name":"@mihanizm56/fetch-api","version":"3.8.12-beta.2","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix --max-warnings=0 --cache --cache-location .eslintinfo","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"7.0.1"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"25.1.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"5.3.0","@typescript-eslint/parser":"5.3.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.4","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"8.2.0","eslint-config-airbnb-base":"15.0.0","eslint-config-prettier":"8.3.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.5.0","eslint-loader":"4.0.2","eslint-plugin-import":"2.25.3","eslint-plugin-prettier":"4.0.0","eslint-plugin-security":"1.4.0","prettier":"2.4.1","express":"4.17.1","husky":"3.0.9","jest":"25.5.4","joi":"17.4.2","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","ts-jest":"25.4.0","tscpaths":"0.0.9","typescript":"4.4.4"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for the isomorphic fetch\n### [Documentation here](https://mihanizm56.github.io/fetch-api/)\n\n### Benefits:\n- Provides validation for responses (based on joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services, https://www.npmjs.com/package/query-string is used)\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in the\n  hard-structured response format\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n- Provides the ability to handle the response progress\n- Provides the ability to select necessary fields from the response (https://github.com/nemtsov/json-mask#readme used)\n- Provides the ability to use persistent params for all requests\n- Provides the ability to retry requests\n- Provides the ability to logging your error requests\n\n#### Request input options:\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by joi <br/>(you must use the joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use joi\n- customTimeout(number) - milliseconds for cancel the request on timeout (or a full package of requests if the \"retry\" parameter is activated) \n- retry - number of requests try to request if the response is negative\n\n#### Request output options:\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n- body will be serialized in JSON if body data NOT FormData\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### Please, be careful. The response will be the object:\n```javascript\n{\n  error: boolean,\n  data: Array<IResponse>,\n  additionalErrors: null,\n  errorText: string,\n  code: number\n}\n```\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n#### Set persist options to all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setResponseTrackCallback(({\n  requestParams, // all request parameters\n  response, //  pure response protected object\n  pureResponseData, // response body without formatting\n  requestError: boolean, // is request crashed\n  formattedResponseData // formatted response data in IResponse interface\n}) => ({\n // do some metrics or logging here\n}));\n```\n\n#### Set callback for metrics for all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setPersistentOptions(() => ({\n  headers: {\n    foo: 'bar',\n  },\n}));\n```","readmeFilename":"README.md","gitHead":"a5b0e622665ddc8be4a1a7bae6564055053c53fe","_id":"@mihanizm56/fetch-api@3.8.12-beta.2","_nodeVersion":"12.22.7","_npmVersion":"6.14.15","dist":{"integrity":"sha512-j9OktnwfvmSIaSDIqjjlv5OYsabdlH2l2y1f9yqeiUygi0y4NUWFkyO8oCmiPc8wOhNmHazf9gRtkqPj2AMT8g==","shasum":"bc8100f9c2bb51edee2cbcb2c3eeda3f1e3c8047","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.8.12-beta.2.tgz","fileCount":92,"unpackedSize":178203,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh01ajCRA9TVsSAnZWagAAN0EP/jfPp651FO1+SS0iDuFt\ngQp/e/WkIyRnIbQGoRnFvG8L8DKwbmDhmDomQTPinVaeBi1Mt/8wIcBnDwvu\njFKRJuFP/XQ3UQ2FzPdetjhx3WrlhlYpcYwvzKTuC3QN5W8MjrIb5hMcsx4P\nKXjgV7cK7nXI9vOqb3RWVAKOKc/KxRWr5ijEq6M+u57uzoT8qLi+9WF9hlEL\npLOKu59JsibNGlU2/8e+0D2R8xt6gU1vyp2JD7DmOw66G9eKgtAOWJx0OPvi\nDKkf1JP1usOmDL165YuePb1B6EKhGz0fvUt4JXlEw/lNYhl6HU1qHBEdIxbQ\nTqX6wvVHmTvGETt/y8IxL/Bg+vkff5z6dQAK8uj7NaAQzHTXn9Uny51JAvV1\nY5sSXeJgvy8d6rlOGp9pR6QSPvVbMN1GZsdSgw3VUoTD5uPxWwolbpsfKnRB\nl+N5gK+SVOJNUwkqEx3sMGDTtOG5mSHlld8eLLHLrM6W3/ZPUhCkFtJJkRXn\n5zefXwFzEp4xlZFSSq1KCoNcAvuCvBEy0Od5bwiNFskhxprSKM6MLPav6zkr\n0SJe3bJTJ16h3JGliQFDzmMhDj9vJztDNfJOJlkRdHgRyUT8Yuw3bAMOiPia\njVQQFrxjL5tji721W8lBibpILIBv28VK0BZJpCRTNho9FbxP7f7RRXh+9AMz\nWdOs\r\n=6Eo/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD/SySBbYiinNtIGh1L3OfVF8+TyzTBu40lvlM1LYEw2gIgDa4SmgDE+wfthgmN6rf/4VY05s32+JSYEbGfrxJZGEI="}]},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.8.12-beta.2_1641240227736_0.11825996288165852"},"_hasShrinkwrap":false},"3.8.12-beta.3":{"name":"@mihanizm56/fetch-api","version":"3.8.12-beta.3","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix --max-warnings=0 --cache --cache-location .eslintinfo","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"7.0.1"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"25.1.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"5.3.0","@typescript-eslint/parser":"5.3.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.4","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"8.2.0","eslint-config-airbnb-base":"15.0.0","eslint-config-prettier":"8.3.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.5.0","eslint-loader":"4.0.2","eslint-plugin-import":"2.25.3","eslint-plugin-prettier":"4.0.0","eslint-plugin-security":"1.4.0","prettier":"2.4.1","express":"4.17.1","husky":"3.0.9","jest":"25.5.4","joi":"17.4.2","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","ts-jest":"25.4.0","tscpaths":"0.0.9","typescript":"4.4.4"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for the isomorphic fetch\n### [Documentation here](https://mihanizm56.github.io/fetch-api/)\n\n### Benefits:\n- Provides validation for responses (based on joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services, https://www.npmjs.com/package/query-string is used)\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in the\n  hard-structured response format\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n- Provides the ability to handle the response progress\n- Provides the ability to select necessary fields from the response (https://github.com/nemtsov/json-mask#readme used)\n- Provides the ability to use persistent params for all requests\n- Provides the ability to retry requests\n- Provides the ability to logging your error requests\n\n#### Request input options:\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by joi <br/>(you must use the joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use joi\n- customTimeout(number) - milliseconds for cancel the request on timeout (or a full package of requests if the \"retry\" parameter is activated) \n- retry - number of requests try to request if the response is negative\n\n#### Request output options:\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n- body will be serialized in JSON if body data NOT FormData\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### Please, be careful. The response will be the object:\n```javascript\n{\n  error: boolean,\n  data: Array<IResponse>,\n  additionalErrors: null,\n  errorText: string,\n  code: number\n}\n```\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n#### Set persist options to all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setResponseTrackCallback(({\n  requestParams, // all request parameters\n  response, //  pure response protected object\n  pureResponseData, // response body without formatting\n  requestError: boolean, // is request crashed\n  formattedResponseData // formatted response data in IResponse interface\n}) => ({\n // do some metrics or logging here\n}));\n```\n\n#### Set callback for metrics for all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setPersistentOptions(() => ({\n  headers: {\n    foo: 'bar',\n  },\n}));\n```","readmeFilename":"README.md","gitHead":"2d8ed6570a2d9352675b0150eb5250efd0b60603","_id":"@mihanizm56/fetch-api@3.8.12-beta.3","_nodeVersion":"12.22.7","_npmVersion":"6.14.15","dist":{"integrity":"sha512-GThLzANss6JjdAQdJOaHuZXpCFeEGjFkuuvEuDmxOtoszJZVxaG/UaSNxaSVWNyZBPu/biR0+0s6Hna0tHGZiw==","shasum":"89e9b201deacf84e6165155a7cf7c1348019de82","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.8.12-beta.3.tgz","fileCount":92,"unpackedSize":178494,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh01k6CRA9TVsSAnZWagAAGPIP/3RcI1KnfAFgeahfxaIG\nt/clxU4cG+08UpepMXPGZh4dVS2vMZDRogTFwqEeLSmOWnYvt6KKCqCHUCA+\ndJxgSc8KBZBevF9NCgG9qDpr+0a29z4wfXkFg+RELA1IcVxjz0Z9+cM7NH2R\ntXNMAlyj2kfDMoQOyAZc/g6bv+rqB3TMbYySOtGhLH8s+2+WUktVgHP2dWQu\nkRv34fEMkVhH2FRzSlzT2+qZ3Nu79Ww1P/aL12Hrv6o/NHUfxKBLgY2EGNvQ\nQ9mJh86knoTFjxen1RpeBV7gP22fnN7fJClMk82faLrMMeXLYd4hol1RvNAT\nxuaxwIksK7wfOVt3qQBA2OxmoawaJQR+szQKToK/8wy8KqW3o5QO5K4/DBDc\ndDobJazP1w+3eenhcjiSPoN4wb5RO/1OkqaQ2vil8Hu1yaRjX8YwTpcjU1Qn\n4EmpOg7A4uLiTM/Nc7jdlmRjF1JBV+eQRhWM5DFnCyl8Zd3sHuXuyd7anY9n\nx33b7e/AOaPvE+EpN5j5mqeR4fEmS5/1TeXiPyqMUx9SEwkHXOCXLC3sq+ra\nau2QVeX7FSFz01tb/KuRsy6roOffcBFlaGnUO1zd67cTXtQdy9cCjOKL6UMq\n0ZsQDUFhpa1ArEk9U+V04OzeNJbWn2azfBytDI/nj4ROBsLy4DmqGEFdF9NZ\ni9ZA\r\n=wcFI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIG88FFVA9vV4wRZFSgZRuGoNaRBF5AB+Mz6xvEvXKjz+AiEAxJW4ZhfN7G5RDIwECbFj5ZvxkhLB18u4XTpF7qxX5ik="}]},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.8.12-beta.3_1641240890791_0.10449679469465667"},"_hasShrinkwrap":false},"3.8.12":{"name":"@mihanizm56/fetch-api","version":"3.8.12","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix --max-warnings=0 --cache --cache-location .eslintinfo","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"7.0.1"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"25.1.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"5.3.0","@typescript-eslint/parser":"5.3.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.4","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"8.2.0","eslint-config-airbnb-base":"15.0.0","eslint-config-prettier":"8.3.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.5.0","eslint-loader":"4.0.2","eslint-plugin-import":"2.25.3","eslint-plugin-prettier":"4.0.0","eslint-plugin-security":"1.4.0","prettier":"2.4.1","express":"4.17.1","husky":"3.0.9","jest":"25.5.4","joi":"17.4.2","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","ts-jest":"25.4.0","tscpaths":"0.0.9","typescript":"4.4.4"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"gitHead":"331682c72ec36ecedc9b7ad44603e5ecb05406d4","_id":"@mihanizm56/fetch-api@3.8.12","_nodeVersion":"12.22.7","_npmVersion":"6.14.15","dist":{"integrity":"sha512-+P92PrnuNqi1F+Oocv9Bny1reNmXqMpU3m0oj3NmlipnLjyNEuf1kzTNBdz9hBPAtpCmihsp/ohvvsj0gA0nyA==","shasum":"5e58ea7c01656c3ff1aaf9c73ba8e4b977300b17","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.8.12.tgz","fileCount":92,"unpackedSize":178913,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh4CLbCRA9TVsSAnZWagAAn3QP/i+8SHXK1hAhftde48hy\n6grLhTxgnWznph8brd7xFtsPDsCdEEV//+F73GxqBoKuA+r2dO7AHpQ65JT1\n63GSTtYmtBmd+kNc/8ErrPYYrIF5e2Ctdg07S8nTakulU7wE0XfTdJ8vcaXF\nKVF3CmFGddNvwWHi9umunVpbrQJK27P34JVZzHLe47TXIXEy279oRtAVTGBv\nY2SEWnBsIgcxQXoQEC6R5cJseWXjqDDP0jgY4vnTe7ro/KBcnt1ucqUe7q8C\nSw6CHqduwAhdQmOZruIT39tITzgB3dzzzrzHgGCbQouzUepM8jaqIrt0qDEL\nDX4jgt2GJaNvIYn9xwUcoXvhs4pzKMUorCXDn6g6DT3S5J/VHux7sxaUCZeE\n8NXA/H1Yxjay6dk4fjX9Lvj9vYQfbxmalszH+0W2GYOSFyv6mEMqAosDuT/X\nBIYsKJPPlxVISW0ud2GAdJfUaSlgb9eMSDiYv+ps5EU+OqjIDs7GH11OoJmV\nsYqLF1bS7DqYo3R0yJ6TnLKw4ij/xJmeNWlX5VKl7xE40hIrOvTd59QTPqRu\nr4br+ukE/TVkkuSC74a7wEh7EFMeMsLme3bNKV3VFTmV8ptWxfGTWi+o6VyE\nDCKsJTytE3SKSpRdAosBi2OC5GJSCoJPJQYhRXgFB+66QkPeWWh/ZfPv9Lct\nmvN8\r\n=fTsJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCHecActjBqKGB2S9me0M7Dxn0EkQ2jA8ZtgMlsmgPThwIgNNof1zbBrJLKT85J9D3Vh7nEo5CgBF0xepddM9UO/cY="}]},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.8.12_1642078938821_0.05701989706152988"},"_hasShrinkwrap":false},"3.8.13-beta.1":{"name":"@mihanizm56/fetch-api","version":"3.8.13-beta.1","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix --max-warnings=0 --cache --cache-location .eslintinfo","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"7.0.1"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"25.1.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"5.3.0","@typescript-eslint/parser":"5.3.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.4","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"8.2.0","eslint-config-airbnb-base":"15.0.0","eslint-config-prettier":"8.3.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.5.0","eslint-loader":"4.0.2","eslint-plugin-import":"2.25.3","eslint-plugin-prettier":"4.0.0","eslint-plugin-security":"1.4.0","prettier":"2.4.1","express":"4.17.1","husky":"3.0.9","jest":"25.5.4","joi":"17.4.2","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","ts-jest":"25.4.0","tscpaths":"0.0.9","typescript":"4.4.4"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for the isomorphic fetch\n### [Documentation here](https://mihanizm56.github.io/fetch-api/)\n\n### Benefits:\n- Provides validation for responses (based on joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services, https://www.npmjs.com/package/query-string is used)\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in the\n  hard-structured response format\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n- Provides the ability to handle the response progress\n- Provides the ability to select necessary fields from the response (https://github.com/nemtsov/json-mask#readme used)\n- Provides the ability to use persistent params for all requests\n- Provides the ability to retry requests\n- Provides the ability to logging your error requests\n\n#### Request input options:\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by joi <br/>(you must use the joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use joi\n- customTimeout(number) - milliseconds for cancel the request on timeout (or a full package of requests if the \"retry\" parameter is activated) \n- retry - number of requests try to request if the response is negative\n\n#### Request output options:\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n- body will be serialized in JSON if body data NOT FormData\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### Please, be careful. The response will be the object:\n```javascript\n{\n  error: boolean,\n  data: Array<IResponse>,\n  additionalErrors: null,\n  errorText: string,\n  code: number\n}\n```\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n#### Set persist options to all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setResponseTrackCallback(({\n  requestParams, // all request parameters\n  response, //  pure response protected object\n  pureResponseData, // response body without formatting\n  requestError: boolean, // is request crashed\n  formattedResponseData // formatted response data in IResponse interface\n}) => ({\n // do some metrics or logging here\n}));\n```\n\n#### Set callback for metrics for all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setPersistentOptions(() => ({\n  headers: {\n    foo: 'bar',\n  },\n}));\n```","readmeFilename":"README.md","gitHead":"226a41dd9bfae756a1f84d40fb778efefa801d5e","_id":"@mihanizm56/fetch-api@3.8.13-beta.1","_nodeVersion":"12.22.7","_npmVersion":"6.14.15","dist":{"integrity":"sha512-zYwfNonDAvJxkRPHm0+oJr9BwHfRgyuZfSt8iAZut1Z3AWF/gfk1nevfV3QaJfDnzr6TgF8wnfc5gqgT9U7QcA==","shasum":"f5901b1b1e6c173c95e346dffedaf832c1c57a6f","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.8.13-beta.1.tgz","fileCount":92,"unpackedSize":179146,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiBoLECRA9TVsSAnZWagAAxpIP/RElQsMU1Ub9Bbqjq7Ph\nApjE8hIoLTCASZpwUaj8I8c73nY7bEdEWOw4+P9TUDLtXK4z458TJBD28cNU\nRWtCJDXb99hMVzLw8gLutz3ErUbKqtzz1roWZgTIEdkyTKTgGYcMPImmXfZm\n8TAsWWIbenY4PRSfGzlqva2HoKAYpFC8zn+Sya3ud8TP6NEJELuDw7NJFDxC\nYvjAMiU+A1XtnsYw4DLO95zZFrYAM6HLXD6PETIQQ8UsgoAgde3ph2krpXkr\nqYaxQA80BqpA/YL5dwLIrpsZ9xwf4sMIoJK7T50KCRbR7zFG/rL4TZ0VmHPi\nfKm5sZ90DMbkly9pl+UPZxRQCtVkuE10v0rjOtsKWixHv1VBwSAli0kWtZQi\nOUgaJ9fXu/N94d9v0bF3QTBtCkpoxdJPVdz1YRicriQE80fARedft4JSVwzV\njooYPRiRG1SX/pNR7oBiwqgLBp12H3yNod3OHjWfN8ffOTHflZ3ouKXXqkHF\nfKPp/BlzRe1s2kPX+plAqYnn3zKYDpWy02bL8aU2vygdvzeWk5ipRKXHF5XF\n6YAA5j92a6GAiZbs3cjRCmU8qbVygx+FOZTeFlXVO1TikNU0WawEFTAce4D4\nmgPZPuHFi7h467kC5cBKsQ6ZSRSzuP8yy8LzzcwJ3VaPtMqb+qPzDRjrNvDU\nAhvV\r\n=pZ9r\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICBGhPqhvlyR00eByGlySVj6f9vcvQ1afIgK0ByRxzfKAiEAu068VejLe20NXvxVBesxxqxExr4RmNlH1Q9FdDD56lo="}]},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.8.13-beta.1_1644593860421_0.915088758155999"},"_hasShrinkwrap":false},"3.8.13-beta.2":{"name":"@mihanizm56/fetch-api","version":"3.8.13-beta.2","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix --max-warnings=0 --cache --cache-location .eslintinfo","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"7.0.1"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"25.1.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"5.3.0","@typescript-eslint/parser":"5.3.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.4","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"8.2.0","eslint-config-airbnb-base":"15.0.0","eslint-config-prettier":"8.3.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.5.0","eslint-loader":"4.0.2","eslint-plugin-import":"2.25.3","eslint-plugin-prettier":"4.0.0","eslint-plugin-security":"1.4.0","prettier":"2.4.1","express":"4.17.1","husky":"3.0.9","jest":"25.5.4","joi":"17.4.2","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","ts-jest":"25.4.0","tscpaths":"0.0.9","typescript":"4.4.4"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for the isomorphic fetch\n### [Documentation here](https://mihanizm56.github.io/fetch-api/)\n\n### Benefits:\n- Provides validation for responses (based on joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services, https://www.npmjs.com/package/query-string is used)\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in the\n  hard-structured response format\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n- Provides the ability to handle the response progress\n- Provides the ability to select necessary fields from the response (https://github.com/nemtsov/json-mask#readme used)\n- Provides the ability to use persistent params for all requests\n- Provides the ability to retry requests\n- Provides the ability to logging your error requests\n\n#### Request input options:\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by joi <br/>(you must use the joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use joi\n- customTimeout(number) - milliseconds for cancel the request on timeout (or a full package of requests if the \"retry\" parameter is activated) \n- retry - number of requests try to request if the response is negative\n\n#### Request output options:\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n- body will be serialized in JSON if body data NOT FormData\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### Please, be careful. The response will be the object:\n```javascript\n{\n  error: boolean,\n  data: Array<IResponse>,\n  additionalErrors: null,\n  errorText: string,\n  code: number\n}\n```\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n#### Set persist options to all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setResponseTrackCallback(({\n  requestParams, // all request parameters\n  response, //  pure response protected object\n  pureResponseData, // response body without formatting\n  requestError: boolean, // is request crashed\n  formattedResponseData // formatted response data in IResponse interface\n}) => ({\n // do some metrics or logging here\n}));\n```\n\n#### Set callback for metrics for all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setPersistentOptions(() => ({\n  headers: {\n    foo: 'bar',\n  },\n}));\n```","readmeFilename":"README.md","gitHead":"c79787f26e7980cc39220beb096e228e1afc4402","_id":"@mihanizm56/fetch-api@3.8.13-beta.2","_nodeVersion":"12.22.7","_npmVersion":"6.14.15","dist":{"integrity":"sha512-VchwRKPzsBqXdLcXqUyh12QVWCG5DiiA+/RmCjdoUR78m1Ndao62fh1w+X+ea2mILPiLduOrw7FqCaMzKyeIzA==","shasum":"ef501501b375b5409b99e7604d76419d4cba36b4","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.8.13-beta.2.tgz","fileCount":92,"unpackedSize":179512,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiCCsSCRA9TVsSAnZWagAAPjMQAIWk1Lkq9H5txwIUFTO6\nxNKIxA5rEUelYwtBQbzabT8PmJ6j8xZ9l710719/D1P7VhNDEENVMN7OnOEo\nflqXQwBbiD1x/rsbKvzv9z+d0/eMuFvWhliMcB0pl4gmzPD9wtuo8hFfwLlS\nzmhaue4e/+FHC38lJPd9SQ80hY5JmYgKNXuQjK7OWBgrdqdLoybzEDt7WOer\nLlpnVwrJYZ4FyftRe3IeL/xDuWx4fJ0nFUt8BcFN88ldhbNKa/oUdzjntm3w\nBCn4FwpCcIKG0c1fbuSHHWc4044be71cHEY5Q8lY6INlcgxMzrpPHaqyQxl6\nYckX6VB+VBqmX/mLfBiWhUCvJienkCj4/CBL40nqlLdSVJjfVi51IUmsN3nh\n8TR35tc4WBdLIo4QNR4Mn/LnnBEk/+UdQBV0TSL3a3XaYBnUxfiJpOpunzv0\nBnw6AYihL1yzoOKrzTb6Ltm6B9qf+qSiUrPGli4Ne8Y+zgnv8YHumpvl8/Ac\nIZKo6ykeuSUvOsvuFJQdwzb5uePn3A6UoxeBJNir9Pi847QGY0QXK+J49XdK\n8IGtFQ9dXqVzXzFFe0U+1FExeEjfVRC/5wfv5Je1Nqsx78kJi7gMHtHgrgmh\nQu7m+MI+8vJz7gkwC87e63/C3WvR1qdqgv4GZAO1HGylt/MsJl/REzrUHAOz\n5lkX\r\n=SDKy\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDukV0K2rcmFocEvekUjFDRJDCGk030l8pJYWxcdTnSBwIgYK323nfdfyRCy5TjNmNwxKQ6UdAGZWVJm7L4G5OLOgg="}]},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.8.13-beta.2_1644702482012_0.5271946610066711"},"_hasShrinkwrap":false},"3.8.13-beta.3":{"name":"@mihanizm56/fetch-api","version":"3.8.13-beta.3","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix --max-warnings=0 --cache --cache-location .eslintinfo","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"7.0.1"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"25.1.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"5.3.0","@typescript-eslint/parser":"5.3.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.4","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"8.2.0","eslint-config-airbnb-base":"15.0.0","eslint-config-prettier":"8.3.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.5.0","eslint-loader":"4.0.2","eslint-plugin-import":"2.25.3","eslint-plugin-prettier":"4.0.0","eslint-plugin-security":"1.4.0","prettier":"2.4.1","express":"4.17.1","husky":"3.0.9","jest":"25.5.4","joi":"17.4.2","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","ts-jest":"25.4.0","tscpaths":"0.0.9","typescript":"4.4.4"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for the isomorphic fetch\n### [Documentation here](https://mihanizm56.github.io/fetch-api/)\n\n### Benefits:\n- Provides validation for responses (based on joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services, https://www.npmjs.com/package/query-string is used)\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in the\n  hard-structured response format\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n- Provides the ability to handle the response progress\n- Provides the ability to select necessary fields from the response (https://github.com/nemtsov/json-mask#readme used)\n- Provides the ability to use persistent params for all requests\n- Provides the ability to retry requests\n- Provides the ability to logging your error requests\n\n#### Request input options:\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by joi <br/>(you must use the joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use joi\n- customTimeout(number) - milliseconds for cancel the request on timeout (or a full package of requests if the \"retry\" parameter is activated) \n- retry - number of requests try to request if the response is negative\n\n#### Request output options:\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n- body will be serialized in JSON if body data NOT FormData\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### Please, be careful. The response will be the object:\n```javascript\n{\n  error: boolean,\n  data: Array<IResponse>,\n  additionalErrors: null,\n  errorText: string,\n  code: number\n}\n```\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n#### Set persist options to all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setResponseTrackCallback(({\n  requestParams, // all request parameters\n  response, //  pure response protected object\n  pureResponseData, // response body without formatting\n  requestError: boolean, // is request crashed\n  formattedResponseData // formatted response data in IResponse interface\n}) => ({\n // do some metrics or logging here\n}));\n```\n\n#### Set callback for metrics for all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setPersistentOptions(() => ({\n  headers: {\n    foo: 'bar',\n  },\n}));\n```","readmeFilename":"README.md","gitHead":"161dc82d58e0abc620105dad0186a45096603de2","_id":"@mihanizm56/fetch-api@3.8.13-beta.3","_nodeVersion":"12.22.7","_npmVersion":"6.14.15","dist":{"integrity":"sha512-sIJjYhhFD7i7u7nspSmWKcNzWGagxjGMbg/C4Qv/njKcwSQynZ0BOP3aZvBdMZOZY5fe6ygSQ+MauX/KhrhDiw==","shasum":"b5b83c4ae09824541a854add2c61e2990c5bd779","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.8.13-beta.3.tgz","fileCount":92,"unpackedSize":179734,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiCTFGCRA9TVsSAnZWagAA5pEP/0J1N2gVxiuYA6yKqJGq\nPePJOnvVIlJ9imVnktAwsGOBw+fgAzwleGQFLoCWoey4g0ap+REb1iN5eWnP\nd7K6ounmWQ+2G0fCMyNlSokAiaxlWqT/sE/b/XAulkixALuHiJnlrGe0qnfO\neaNZY416FgbXotuN5kbL0lr6LKzh7V8Q1FZjXW05iSmdL93bRoMgV01RFuZx\nNZj2Az5+jrl+73mgY3zWPdSb/4SoJj18pcVFcy50Hn2WGnMnQOY2fOIY7joZ\nGkwjWTQldwOvw+w/Bfc0CXwKKBBhJ02IlLSbbAdl3mxeV5m6uuMwj2Q1v/UD\n75URvcsw4ykMbILoaiHPGeayquFOoR+kIU7PnM8XIXSjM29Qh9VEnz5vXT2O\n/iUsNGtLgubPUz9oXffeX2dtjTtLmOP8XQcC/mu05eBwyZIBc6N0JVMIGapY\ng09vf+pJVc/tP5+qSiYbLNN5EYZaKeHp82Uu0pevWtNJHB6H/elMtRg2Mih8\nPeal7AQwXHST9Uxjl8ge5EWGt8Duvotgfj9lSlVrauGXleWA7vE7bHBcWqz1\npiEONk1yEG4iF4CLdTUvBwcilvKAW6GfS3ZvfM1nmDRv72gFTYaOktOxMSuJ\nwnSXIrsfVTqPZ7lM3D/VHAZghg88z4ABCbE265VLW8GAgfflK2UucV1EViCh\nb7z4\r\n=eeO0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAjyr6zqStyTEVVJRQsQq1PXeAWVPcxO76vpJKYRO5OIAiEA3bLJwOIQs5z0K6CEweCJXRc5AqSiVhW0W+TfR3MwbrQ="}]},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.8.13-beta.3_1644769605887_0.39419454774650253"},"_hasShrinkwrap":false},"3.8.13-beta.4":{"name":"@mihanizm56/fetch-api","version":"3.8.13-beta.4","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix --max-warnings=0 --cache --cache-location .eslintinfo","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"7.0.1"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"25.1.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"5.3.0","@typescript-eslint/parser":"5.3.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.4","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"8.2.0","eslint-config-airbnb-base":"15.0.0","eslint-config-prettier":"8.3.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.5.0","eslint-loader":"4.0.2","eslint-plugin-import":"2.25.3","eslint-plugin-prettier":"4.0.0","eslint-plugin-security":"1.4.0","prettier":"2.4.1","express":"4.17.1","husky":"3.0.9","jest":"25.5.4","joi":"17.4.2","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","ts-jest":"25.4.0","tscpaths":"0.0.9","typescript":"4.4.4"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for the isomorphic fetch\n### [Documentation here](https://mihanizm56.github.io/fetch-api/)\n\n### Benefits:\n- Provides validation for responses (based on joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services, https://www.npmjs.com/package/query-string is used)\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in the\n  hard-structured response format\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n- Provides the ability to handle the response progress\n- Provides the ability to select necessary fields from the response (https://github.com/nemtsov/json-mask#readme used)\n- Provides the ability to use persistent params for all requests\n- Provides the ability to retry requests\n- Provides the ability to logging your error requests\n\n#### Request input options:\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by joi <br/>(you must use the joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use joi\n- customTimeout(number) - milliseconds for cancel the request on timeout (or a full package of requests if the \"retry\" parameter is activated) \n- retry - number of requests try to request if the response is negative\n\n#### Request output options:\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n- body will be serialized in JSON if body data NOT FormData\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### Please, be careful. The response will be the object:\n```javascript\n{\n  error: boolean,\n  data: Array<IResponse>,\n  additionalErrors: null,\n  errorText: string,\n  code: number\n}\n```\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n#### Set persist options to all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setResponseTrackCallback(({\n  requestParams, // all request parameters\n  response, //  pure response protected object\n  pureResponseData, // response body without formatting\n  requestError: boolean, // is request crashed\n  formattedResponseData // formatted response data in IResponse interface\n}) => ({\n // do some metrics or logging here\n}));\n```\n\n#### Set callback for metrics for all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setPersistentOptions(() => ({\n  headers: {\n    foo: 'bar',\n  },\n}));\n```","readmeFilename":"README.md","gitHead":"067b7d25f45624d32ec52095c1858e4206ccf3f4","_id":"@mihanizm56/fetch-api@3.8.13-beta.4","_nodeVersion":"12.22.7","_npmVersion":"6.14.15","dist":{"integrity":"sha512-u/OVp0/I6KM39MGO8u/h2jaB8747hRk2lKdpr4mNPEyLalYqcSpBzbvr5ztRKXwe9j9Ot6cOYv2qrE/OrB3EhA==","shasum":"aaf64a934298ab9772fab4c16dff5da40936ada7","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.8.13-beta.4.tgz","fileCount":92,"unpackedSize":180533,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiMNBYACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr4kxAAgWHyLXw98BEiXAYIoID9v5HbEMis1g2ana1cTgack8U8kqUs\r\nymUmXXmk3A0Vym/ORhvb/g9uFd42MzfxiBczl9a+4YrgBm1ubQUbzUEJCmgR\r\ndOMUDQRixjYuQ14aGitXfJ1mYYJdFJMqtTsPXvhaL9lMXl3W+5iZdz49RBq6\r\nhBjJZrIBqxUo22aenhrEsSCRTMvFqWPkhSbGmAVvOQrEZGPK3/3dyiK/tt9H\r\ntN31BENDOEegLErXOxD4y40RdSTdBgf9pHKY89Q71Au5SjXpLf6LkF3ZiPJC\r\nnO2v/rbAi/3WSPU1qRmZOb5aQZjgCLsCGH4lrHSakussmvngYwgUBq26opaH\r\nd+zPNUhTqOqGmjY1z0kqoBfQgLnNRc3RJ1/ADgpj1lU1PYW7EwMU6FF3Clou\r\n8r7mhDb6QmtHt2Hoz/iRkkvb+6VHllt8L7Tn3QWyxYKQ9V4KzPcoxWysMQFZ\r\n1DJSxcWmX87Efl4AF7lAfuQQWJ6KNtb2VZV30GwmvHf1aLa/KqLehZeuiGJz\r\neXWDz7cpRJHu1hxwA6q93U9DhsyF1UI1xnEb3xZ5F/cotZLqY3tmh4icN/1p\r\nrFxEZ6KKs6VavyrpXMwQiM5JHxI63xwAqb/dw7jR7E1gKwcLnMgPsRB6Qtp1\r\nwvtjR10QHJQLWGV7rpzB4UzGfyQwT5xxqFA=\r\n=pXDW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAl0K0ajGMcPGNZhqyB8HBCjo7ttRwQhfx/UWxj/c74eAiEAjgGnytQtIqtw3vY+YByhOb9sRBBeD8HzsjzvhUqWRDA="}]},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.8.13-beta.4_1647366232375_0.2101397651656347"},"_hasShrinkwrap":false},"3.8.13":{"name":"@mihanizm56/fetch-api","version":"3.8.13","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix --max-warnings=0 --cache --cache-location .eslintinfo","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"7.0.1"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"25.1.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"5.3.0","@typescript-eslint/parser":"5.3.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.4","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"8.2.0","eslint-config-airbnb-base":"15.0.0","eslint-config-prettier":"8.3.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.5.0","eslint-loader":"4.0.2","eslint-plugin-import":"2.25.3","eslint-plugin-prettier":"4.0.0","eslint-plugin-security":"1.4.0","prettier":"2.4.1","express":"4.17.1","husky":"3.0.9","jest":"25.5.4","joi":"17.4.2","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","ts-jest":"25.4.0","tscpaths":"0.0.9","typescript":"4.4.4"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"gitHead":"cea57371142ba8ddd746499033062942159cb018","_id":"@mihanizm56/fetch-api@3.8.13","_nodeVersion":"12.22.7","_npmVersion":"6.14.15","dist":{"integrity":"sha512-fv1seFY4LhB3UpJA6MflbTv/pVfaWaFdiHcWy/PcU8QVetVkga2SOpvwMg5b2UJ+mOIeMgsAFJaf76k+tBIt/w==","shasum":"3b27efa8f1a0be0e251c3c91be939f6f7de6e3cf","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.8.13.tgz","fileCount":92,"unpackedSize":180526,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiMc92ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp2rA/8C1ROzJX5OZAH+1kxmBeukDbcVizvPhIHL0pLDZJDDYaZusO3\r\nIfQNhCJzG9pHlsjIQZaqdSSVfm0RXx0V0e172Auqaeap6JdlvDVw5yZiN5ms\r\nzKMZnv9suwvKb0rUm0eV8k2c8nriveMnVdBI+RbsS0vH37UlQ1PJu42bgELR\r\nuGBbXGrJm6ezgvnmYC90CXZM/NipLOOztNznHIADlVzzovgQVD8f7vbxs5No\r\nZIUB5n/lZy6U/ai64sjYgiILy9RlNZq9kYDKUPZqvhGDYKwoJHEpbTOO05NH\r\nICerBNBpxRzNBJE1JRNTcRFtqsdDjXp7uWepLqgqsWktCSBcjBkq0NIOcgR0\r\nMsoa+Qdi+SeKW/zIJfhMzWEMdkAsWC8A95AIccj2/BEs2B7UQBuXV5UwpftD\r\nAYWi/n6+raDu4CTfvpC447wPKCnG8dlZsazNYLekXkI2muB+fNLk9P+7+FNd\r\nqDmYzUoe1aG8j2LK0Kfrc1BoBosW3JgmOp7ro4SFCyBk7d2jSYefM4JnLxMs\r\nBPoY+gQeAyzrpoVNIKyphPEbA1YJDqwI+VUKDqi6Fl+DkHO05pxqiBR9npdD\r\nrlBUs0KrLGcwWRkog59N8Q/VnvsVFRGZlVp3NNK28n5C+betCw9+t6fGT+fo\r\nyJSLDb4MqZVLcLYxDpLHZgVdBFmBQJcmxSU=\r\n=2F4u\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCmf+6pBGAJcZKzQzlpohsIFkHLaCwvQxlVjPprGylBjQIgbuTCc95qrF8GY9iru8IBq5zb/Mf8IgIDWObhXEzeOIs="}]},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.8.13_1647431542211_0.2737809062365504"},"_hasShrinkwrap":false},"3.8.14":{"name":"@mihanizm56/fetch-api","version":"3.8.14","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix --max-warnings=0 --cache --cache-location .eslintinfo","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"7.0.1"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"25.1.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"5.3.0","@typescript-eslint/parser":"5.3.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.4","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"8.2.0","eslint-config-airbnb-base":"15.0.0","eslint-config-prettier":"8.3.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.5.0","eslint-loader":"4.0.2","eslint-plugin-import":"2.25.3","eslint-plugin-prettier":"4.0.0","eslint-plugin-security":"1.4.0","prettier":"2.4.1","express":"4.17.1","husky":"3.0.9","jest":"25.5.4","joi":"17.4.2","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","ts-jest":"25.4.0","tscpaths":"0.0.9","typescript":"4.4.4"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"gitHead":"85bad46ff0468ee6238aa47a8ed321bd55c412aa","_id":"@mihanizm56/fetch-api@3.8.14","_nodeVersion":"12.22.7","_npmVersion":"6.14.15","dist":{"integrity":"sha512-BDB0RAVpfK0kflXaRL6/hjebpvr3Py9rmSU2ujdG1j6Wnvqt6XgXm/9YLX1/wTHEuLwUJA1vKuCdgi1pRr0Hyw==","shasum":"30401c23ea6f7b4ac5ce2b56b97612bced74067b","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.8.14.tgz","fileCount":92,"unpackedSize":180610,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDNGF6C7krJmDt6iOUbAG9wf9ZfjaH47Yj78Xcg/Kwv+AIgD956cl+JbCH5VmkKGGVnpBtJ9ggQysoXBbqvOdXA7BQ="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJihNHuACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmof8Q//Z6EPfYpfXRNZE4IevVlRIzrbW0zCTSZ+NBDz1IzxQ9ppdipv\r\nBlbbQ6wJkBqelaiFMQxejUWDIxq2pmSMlnAxmfF5egHZgbCbV9caE2fc2sxa\r\nllUsmXlPmVOgTMm0yxi5Y/Smf1Ln4ISW5i5jiSUyJd9GMS77AtGL4a1n2dUk\r\nH/AYdjTW1EKxmdQgybj/P47L1H+VJ8lBJWuvyciDH4C7xVTLdR05lGU3b/F9\r\n2hsCbPC/09QI9XePh6lHvOjRRJ0Rbhe8OiDezNckXX0jKZgA2f60eZY0hwZV\r\nc54MYfFMXax9A1h9NtI3vh6z5TYcWtA8BkTo4NNd3xeOzV9R4oYYu4vz3U3H\r\nebL4jB8cBv1Es95skORcB2TOY4KIEoilBVndN+xJNqk6TTaDDiQAcyWpBToH\r\nZxStVOVNBmBV7LE1e74/00yUZDJRNAhvVH5IC8dhKtScJ2DKRZtbbCdwXbKl\r\n//Em358L+JATclSiqNgtlMjcfjfYopGkMeGxnlhn8z32L5r+vcaTzDDAmh/O\r\nHuO8h49uFohmoJydxRZOEw/QTI1Mu7NmOBmhMD16ExSOUHajiE80UNC2+z6m\r\n+Ia7cJMsv7VixniCO69mbsvNfzgYfUv6x8ECDIl6VYPdeGBQJ4u9cPrA36gJ\r\nGlei/RiPyWFcKoMjDPWz3LjDOpSoDeqbI2Y=\r\n=X9JJ\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.8.14_1652871661923_0.3736435415746946"},"_hasShrinkwrap":false},"3.8.15":{"name":"@mihanizm56/fetch-api","version":"3.8.15","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix --max-warnings=0 --cache --cache-location .eslintinfo","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"7.0.1"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"25.1.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"5.3.0","@typescript-eslint/parser":"5.3.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.4","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"8.2.0","eslint-config-airbnb-base":"15.0.0","eslint-config-prettier":"8.3.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.5.0","eslint-loader":"4.0.2","eslint-plugin-import":"2.25.3","eslint-plugin-prettier":"4.0.0","eslint-plugin-security":"1.4.0","prettier":"2.4.1","express":"4.17.1","husky":"3.0.9","jest":"25.5.4","joi":"17.4.2","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","ts-jest":"25.4.0","tscpaths":"0.0.9","typescript":"4.4.4"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"gitHead":"304b1226e8cd6789dc1261dab2cb51a7e6457895","_id":"@mihanizm56/fetch-api@3.8.15","_nodeVersion":"12.22.7","_npmVersion":"6.14.15","dist":{"integrity":"sha512-eyVAolibNGL4xJ1OsJ6EEVstcPNpLZ1BvWYu9gK2zrS+AYfc3urF3xMu2SQr8MO/laodaXmR2IxanZ/+3rWxRw==","shasum":"f814f387244762d670335081795df31a1e609047","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.8.15.tgz","fileCount":92,"unpackedSize":180981,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCID+exuL2zwN29kDSdMZOyt9jQ1abOtPM+Zgn5416oFQgAiEArcsn3yuH5d7WyhzkpvTPO02CjWEceB/z2GyEBvfKgAc="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJihW6cACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqo5g/9FckgD8k/+s8SS3y3TZJtNBPvqMlkD7nX0kXFWeEtkwOhHoS8\r\nzF5G70GOB0H4yTDJWmnSB8aeQG3/m9D+IvW5EYg0NXm4C/tSgN0PAsOBusRZ\r\nfLsIcwcwFAuOsP5ZuIErJ7o+/l68XJA2kwGmj4Tx4iJd3vMAjFi8mdEqI1iQ\r\n7DI219RhP7ku6otpfjm+kP73kXnTsPYXSsL5rpA6rjIkX3+jdM6JJufzTAtz\r\nsWEmsYY6OW0S4FEO5H9nU+t/dmJhf4BdtWwxJTrZ9KULuu1FRWfaf7iXGhrr\r\ntGSzo+riXL7FPgIlc4SVZkyvLJ+lWgRKnlVYkDFAL+as7XJynNM8+c1qIJxp\r\nYvjyHdfuWzmP0ddMlwxLUHMf4rbkdLELEz0V/EyCe6zJmLAYDV9BKMoWpB6p\r\nEp3r3rhss6hikjjzG/x93WnAtpQmVeIw5FmnJy36bR3GZc2X2V5pxiO6GOIf\r\nikmgwsXdF1iHGtHyCL+rz+GUgGBd2+/xtILFDCdHeMxq2qsQCKB91l66D4gK\r\nZunqnW5F/DXj2ptAWwknbdlk/IwWm9c4+6LEk5FasYq8bBsqtCsx+tp69/ND\r\nW5UbHrFJqkOrTMOtmJ4bONRC+gUqD1ghVBkURhz+FNzrGtHvm4aN41oGVdSo\r\nr5+BjWizK1RJB2/i8UKMwhUknsub0/agVYw=\r\n=lhbT\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.8.15_1652911772467_0.15705729176923122"},"_hasShrinkwrap":false},"3.8.16-beta.1":{"name":"@mihanizm56/fetch-api","version":"3.8.16-beta.1","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix --max-warnings=0 --cache --cache-location .eslintinfo","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"7.0.1"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"25.1.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"5.3.0","@typescript-eslint/parser":"5.3.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.4","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"8.2.0","eslint-config-airbnb-base":"15.0.0","eslint-config-prettier":"8.3.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.5.0","eslint-loader":"4.0.2","eslint-plugin-import":"2.25.3","eslint-plugin-prettier":"4.0.0","eslint-plugin-security":"1.4.0","prettier":"2.4.1","express":"4.17.1","husky":"3.0.9","jest":"25.5.4","joi":"17.4.2","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","ts-jest":"25.4.0","tscpaths":"0.0.9","typescript":"4.4.4"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for the isomorphic fetch\n### [Documentation here](https://mihanizm56.github.io/fetch-api/)\n\n### Benefits:\n- Provides validation for responses (based on joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services, https://www.npmjs.com/package/query-string is used)\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in the\n  hard-structured response format\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n- Provides the ability to handle the response progress\n- Provides the ability to select necessary fields from the response (https://github.com/nemtsov/json-mask#readme used)\n- Provides the ability to use persistent params for all requests\n- Provides the ability to retry requests\n- Provides the ability to logging your error requests\n\n#### Request input options:\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by joi <br/>(you must use the joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use joi\n- customTimeout(number) - milliseconds for cancel the request on timeout (or a full package of requests if the \"retry\" parameter is activated) \n- retry - number of requests try to request if the response is negative\n\n#### Request output options:\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n- body will be serialized in JSON if body data NOT FormData\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### Please, be careful. The response will be the object:\n```javascript\n{\n  error: boolean,\n  data: Array<IResponse>,\n  additionalErrors: null,\n  errorText: string,\n  code: number\n}\n```\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n#### Set persist options to all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setResponseTrackCallback(({\n  requestParams, // all request parameters\n  response, //  pure response protected object\n  pureResponseData, // response body without formatting\n  requestError: boolean, // is request crashed\n  formattedResponseData // formatted response data in IResponse interface\n}) => ({\n // do some metrics or logging here\n}));\n```\n\n#### Set callback for metrics for all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setPersistentOptions(() => ({\n  headers: {\n    foo: 'bar',\n  },\n}));\n```","readmeFilename":"README.md","gitHead":"fc4ec7f98286b3c046ede180ae179e8cf0001d86","_id":"@mihanizm56/fetch-api@3.8.16-beta.1","_nodeVersion":"12.22.7","_npmVersion":"6.14.15","dist":{"integrity":"sha512-CzucKxYNRGwLZpwmZLdXP9HGbjeldrB6LBeUSdPqu5MbU2SR+i4fxoianpWMU3ezYdBOK88L66TYeiVi4kqV8Q==","shasum":"30d9a5883a406b526ee1fe759062419e4818ae62","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.8.16-beta.1.tgz","fileCount":92,"unpackedSize":181506,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCFT/EvdOkNUYU2gwCppcm52KpWmV/IOuo10cZDJfzFkAIhAP8gwPg1lQesLyH0WIPCc5cAMHcvXysxt5SVZftE9M8d"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJihXtWACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqW7w/7BhtBYaBo7oXvXbL1B7bnRbHfdOC7VT/QZm6VfCgPZ8YCZqwV\r\nAfK50mhwj92qNeoEKiu4P+rZVrBB2hW6boN9+DwJrnWLDgmS5TL+fczl/L9K\r\npX83NkQUZQvjeH0s+47KyulOsP2zVKeFLdnwXeHomcqzNiPXN3TYlz1MRYWs\r\n3KY0pQkzPA5pkFabZwVoqmUpL43DQP/4tQcHQMFPaw3/ID/O97EtCB1f76G3\r\nI3nv6nmL3RCCSbMfJRRkr6+5eXZjedrIj5PTH5FhHMp7a5SP9ossoUX3EgB1\r\nEVYU6BTRYiv2g0D/KpBYACHrW79SJwSKvuvewLdlstbY6cPD2eUHoGdrwXZf\r\nPnIOpS2dprtSjs2WC7uwRIyclcaLCLQ/wLDT/KJS1aGO7Jm1lr6ErXH6WF0e\r\n0zBaPM4txH1kjsGp83SL3m8F5C9IlfaGua0CK/w8BzpDFY0wDVR7dIzgXbjt\r\ngGZlU+dkdW20hXZ+NGbUnMczt+UqIt5tjIUq1HUwZwybPRl9Hq4apGhR8gfe\r\nl35yvtgEGAN9Nw7sQ1lTz2tjvQPdPYCqqROeJd0sB18ff39ntDnSNSTiWXMA\r\nMO4lbBQoX9CN8xicEm4ggP//AChfF3MtMs0/NmKEC2WLGZGIiJDYrz+QSCuH\r\nMsyp67VUhamrD5UZxf9uCnJAjT9aK36n060=\r\n=PZs/\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.8.16-beta.1_1652915030550_0.17994508319663738"},"_hasShrinkwrap":false},"3.8.16":{"name":"@mihanizm56/fetch-api","version":"3.8.16","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix --max-warnings=0 --cache --cache-location .eslintinfo","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"7.0.1"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"25.1.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"5.3.0","@typescript-eslint/parser":"5.3.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.4","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"8.2.0","eslint-config-airbnb-base":"15.0.0","eslint-config-prettier":"8.3.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.5.0","eslint-loader":"4.0.2","eslint-plugin-import":"2.25.3","eslint-plugin-prettier":"4.0.0","eslint-plugin-security":"1.4.0","prettier":"2.4.1","express":"4.17.1","husky":"3.0.9","jest":"25.5.4","joi":"17.4.2","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","ts-jest":"25.4.0","tscpaths":"0.0.9","typescript":"4.4.4"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"gitHead":"b799fe6c5b5f1c5184b72631c1df66148638378d","_id":"@mihanizm56/fetch-api@3.8.16","_nodeVersion":"12.22.7","_npmVersion":"6.14.15","dist":{"integrity":"sha512-qfBrR+utNcbv1wM239pu1Gb+39cooXxx4K6COVxSrvbNcsmhFVBVlCD6aCS9KwPffDHCyEwbFHccngd+x7h1ig==","shasum":"f9f11fba5c32668407cd1b1b7c624268faade98d","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.8.16.tgz","fileCount":92,"unpackedSize":181499,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD1cm2/7fROdc0uuBEOZHUTUP3+t0XFjkyV25TjDXqw8gIgS4B3jS0/XgPjyjEQnkZru6burt7T0DEWBGu5WAcWApE="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJikMEHACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmocnxAAnDxkmEt6T9xeZjXPHTX8J9+vVyRxilz6+Gx3zGAPFGLaabXi\r\nFYufJOTxODxq+JsmPBkTh0kGeKG0YtYC+tit//IB6OM3cW9uxkCiXJme4DqQ\r\nBjVg1Fez7zrxw/UtWdQROhsPoFQWUyjSSikJYjcj7Tbp30hr61KevQQMWHJK\r\nnRDzq9HaOjkt+I8zc9DiY1GGh2H7eEK1aMCvgrYQ2kFE8KSpNmZyqZ5YJfAk\r\nzlJ2wU5Tif9nMTct6TK+b3+TK1ykYS6D/2F24RJpF+8vcqLQI/yvFxyYWTsQ\r\nVIqcstPFJf4f7ULtiJwMALKzCbAdW+rrFQ/AAR9X8uPuR7cYj2TjqsIe9Ix8\r\nFxqaKRVxL4md+NUjWZNIm5gC2JP/wkvEKj/nby1ANKXG1pTfa6g8rw8j8tbE\r\nL2YrDVnc2AdwSHCrr2w45EaspIgGuhRhuvQc3Ww4fVEhT2fwVvAo+Rq8vs4J\r\nGjK3NmMOpn/MxLcTjiel8EZ/+vmGLlyrf/23vSBuct5OfjDmrMdiKHnrwbWD\r\n3DXWQH0IMCJD86Ds9KfoqIruZejojnfF+aO9zOaPgoUW8PMc3k7bGm/tKHtp\r\nbsRfqjb0s4OOtFETQjRionUcQNR12jBr6hub4OQ9EmZMbMm1QsFkPrYTmmX3\r\n/JkrIr+57B1d0+5KIRT3E0ZSGdqaYkWSri8=\r\n=kzI7\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.8.16_1653653767496_0.3115120267646905"},"_hasShrinkwrap":false},"3.8.17-beta.1":{"name":"@mihanizm56/fetch-api","version":"3.8.17-beta.1","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix --max-warnings=0 --cache --cache-location .eslintinfo","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"7.0.1"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"25.1.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"5.3.0","@typescript-eslint/parser":"5.3.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.4","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"8.2.0","eslint-config-airbnb-base":"15.0.0","eslint-config-prettier":"8.3.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.5.0","eslint-loader":"4.0.2","eslint-plugin-import":"2.25.3","eslint-plugin-prettier":"4.0.0","eslint-plugin-security":"1.4.0","prettier":"2.4.1","express":"4.17.1","husky":"3.0.9","jest":"25.5.4","joi":"17.4.2","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","ts-jest":"25.4.0","tscpaths":"0.0.9","typescript":"4.4.4"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for the isomorphic fetch\n### [Documentation here](https://mihanizm56.github.io/fetch-api/)\n\n### Benefits:\n- Provides validation for responses (based on joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services, https://www.npmjs.com/package/query-string is used)\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in the\n  hard-structured response format\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n- Provides the ability to handle the response progress\n- Provides the ability to select necessary fields from the response (https://github.com/nemtsov/json-mask#readme used)\n- Provides the ability to use persistent params for all requests\n- Provides the ability to retry requests\n- Provides the ability to logging your error requests\n\n#### Request input options:\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by joi <br/>(you must use the joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use joi\n- customTimeout(number) - milliseconds for cancel the request on timeout (or a full package of requests if the \"retry\" parameter is activated) \n- retry - number of requests try to request if the response is negative\n\n#### Request output options:\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n- body will be serialized in JSON if body data NOT FormData\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### Please, be careful. The response will be the object:\n```javascript\n{\n  error: boolean,\n  data: Array<IResponse>,\n  additionalErrors: null,\n  errorText: string,\n  code: number\n}\n```\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n#### Set persist options to all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setResponseTrackCallback(({\n  requestParams, // all request parameters\n  response, //  pure response protected object\n  pureResponseData, // response body without formatting\n  requestError: boolean, // is request crashed\n  formattedResponseData // formatted response data in IResponse interface\n}) => ({\n // do some metrics or logging here\n}));\n```\n\n#### Set callback for metrics for all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setPersistentOptions(() => ({\n  headers: {\n    foo: 'bar',\n  },\n}));\n```","readmeFilename":"README.md","gitHead":"4da6bc5df5b23b792f6c97c5cf39716667258e52","_id":"@mihanizm56/fetch-api@3.8.17-beta.1","_nodeVersion":"12.22.7","_npmVersion":"6.14.15","dist":{"integrity":"sha512-l5meI64UyhPAeXj14UBBNN5FSfm99kueaJXEG67JFo01SozhMsx9tl9zfR+Il1eLQ6IuDd9ORZeIzg7/Sk8tSA==","shasum":"4db0ed2d3e7d3c9268c7760fca0833343aa9110e","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.8.17-beta.1.tgz","fileCount":92,"unpackedSize":182251,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDUQO1djxtF8GFOEjFWWbeVpQDfGgkoQkD3Fcdi+8YtCwIhAOExTp+brJ7+WsyPAuNQO8jGhZ25IrjU6QhXeuk+htex"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJinUmXACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoPaw/9HmyliBfa/SbZSArKOuZeb8RW3e3eI+m7WcGmblT3/LhTbu0I\r\nft9F7JNCLg+xvIc4wUjOHu5BNdwNRIh+rptnkfKUYeg23eio1AWVGYJmCvms\r\n6YbHxbHA9pKToBgCP3iOW65wfUef0zp+nKDFAQoUWCwrRMBlwPaP+C+nFU3v\r\ncWJzPeVk8LZtQ8Y1um+IGbf2tMS5oUzd/3zWw30ma87zqgiU0zCfCeY7HUBx\r\nfO4v+NbNI5TJO7a8yMaDOkc9HR/mZXSsTR5WXRtCQVSYSfUAo4U1SYn5qbh6\r\nhYh73o8y/fqL3zZEyGgKr76CExLKL/sTQcC8+FixSJEd8q2sy1a9/cncR9kQ\r\n+j/X1IfFOmuCQU18wTfC5KzCI5WTnqsOO9WaHgJGzto4x4Kmzl2VMxj5PgXI\r\nvLsG4gGjvieE/bcF72QijAnVI2dHWqpApKB6P1xZNLMGIxOcS7ne2rUD+4DQ\r\nG7YdPoW9fae5FGOfGpKLu+7avimHYxW2m5QFCVlZ7acoufILsMsHJgIWZGbj\r\nbw9BV5du95vNu9a8hH7kzuI4WRaUIm+32OaMKA05Pf/zPmIisJsz7Bd5doQK\r\nURiZJWuiXzw83LsDXbBuD7KmwyatvaOraT8YKo1GX29gAXe7I/m/tdLFfiQy\r\nBEjnollnIv6OwJn+wbQe+jHiaLHItgu/6Hs=\r\n=NESY\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.8.17-beta.1_1654475159059_0.16387005868826687"},"_hasShrinkwrap":false},"3.8.17":{"name":"@mihanizm56/fetch-api","version":"3.8.17","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix --max-warnings=0 --cache --cache-location .eslintinfo","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"7.0.1"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"25.1.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"5.3.0","@typescript-eslint/parser":"5.3.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.4","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"8.2.0","eslint-config-airbnb-base":"15.0.0","eslint-config-prettier":"8.3.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.5.0","eslint-loader":"4.0.2","eslint-plugin-import":"2.25.3","eslint-plugin-prettier":"4.0.0","eslint-plugin-security":"1.4.0","prettier":"2.4.1","express":"4.17.1","husky":"3.0.9","jest":"25.5.4","joi":"17.4.2","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","ts-jest":"25.4.0","tscpaths":"0.0.9","typescript":"4.4.4"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"gitHead":"fa1d33ca60509ae01f452c7a5c67e0dfe2b1c376","_id":"@mihanizm56/fetch-api@3.8.17","_nodeVersion":"12.22.7","_npmVersion":"6.14.15","dist":{"integrity":"sha512-RxFUJfHa0zHNhkzCxzY0Fv9XmtqDpoUL11dSjIT5J0HvHTspWkqJHZZsPE9OVCwDKP4XCiMzqFnrhCnOg9K8og==","shasum":"b20d40cb03548b5870954a19500cc8fdea13a589","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.8.17.tgz","fileCount":92,"unpackedSize":182244,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAKDcRPeeLf3fuHmWEQlQq8YZN1DJXu8oydkKAGq7xv5AiEAzm1pLLnyONr+367oLu19Ty3DEqy5YDtkJVKRYLXXCGc="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJivDHcACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoCkQ/7B4cjAplNhcAk/9KHfzycx5Qirfu11HaAWw3FEXcFPycscErq\r\nWhCSHNJrFPvKUDrIt2fc9UBKL6b9Eoc4uh8gR/aaHVcSxlYYwPyZtsCJNQbo\r\nUgwpy7oYYvFYNVer1kCWFX2aoO1/nxB88ka5xpms58czuU05uWSDcu9fgPt/\r\ntBRpPiJ6cHyg2WlTHDvhgrXGk6PzxM0h1OanWQzkhZedFshMthBhboIwyIdw\r\n5TdrITpUDQACzFkNl4hOuLjWhaBXAdK1cCTOnrZSI5sFcU4wfJxfSnut90/p\r\nHj8bLJ6WNqIKyJX6q9FGyp1Rkgqd8P18P2c0jPHnVMavL/043emEXGCD6H37\r\nCz+8aMs6S3fxTQMI7UkAinB7keehUE03k/rjURqJvuQKolPlGK9CQKqArGdI\r\numAK0UHLcR/5ujUbVili7EAMF86U8HFuiCqqKCNLIXiXRvHGnwbSqB1Wv7AY\r\nR8YWaP9WWg72IBPGu2Vdd9HiOdlwGOvq5GicvCENjcRHdGIT2pvSZg6JWozr\r\n3vQomHn68NOd3592HdA2GDvXOSut7W33Y9T6gcJhLSxwVCB/0JsORW41ww4C\r\nOEV09TCmLIdVy2PQenaSAW5Fiic5abMsaTcG6EArTGUA+VcJ9r6igiF3w79/\r\nwsOLhSCtY0B206wcxKEskf4e8GoeofZJe4c=\r\n=cv6N\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.8.17_1656500700612_0.8232240153791459"},"_hasShrinkwrap":false},"3.8.18":{"name":"@mihanizm56/fetch-api","version":"3.8.18","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"install":"node config/install/mark.js","server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix --max-warnings=0 --cache --cache-location .eslintinfo","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"7.0.1"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"25.1.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"5.3.0","@typescript-eslint/parser":"5.3.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.4","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"8.2.0","eslint-config-airbnb-base":"15.0.0","eslint-config-prettier":"8.3.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.5.0","eslint-loader":"4.0.2","eslint-plugin-import":"2.25.3","eslint-plugin-prettier":"4.0.0","eslint-plugin-security":"1.4.0","prettier":"2.4.1","express":"4.17.1","husky":"3.0.9","jest":"25.5.4","joi":"17.4.2","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","ts-jest":"25.4.0","tscpaths":"0.0.9","typescript":"4.4.4"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"gitHead":"23c5ef09da08e44516a259bdb4058755f4245631","_id":"@mihanizm56/fetch-api@3.8.18","_nodeVersion":"12.22.7","_npmVersion":"6.14.15","dist":{"integrity":"sha512-CS8diIJM2Zh05SBUf/EXYCocax2RIvmJeLULAdlfCEuh71eikPc9MnEDIgnpnVYRwHD9uIBqoS0b/tiat2qT0Q==","shasum":"a9fd0c53cd656d372211a7a0481b95838a6fa139","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.8.18.tgz","fileCount":92,"unpackedSize":182829,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAtsGfVBiQdGkvDFTIa0RheAA/yN34/ixfPdH4qOiNDhAiEA6RQEWcO3NunVhwrTMXL6SU2pOKZ7cNno9CNJYnZpAMY="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjQbXHACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoPWA//cqgxDYmHOzu7zVmlGujexYqD3Q0lijzph93fuquHvtPAbBJp\r\nD1A5DgfKt/vS2CZnibXsrbXK0YX06B8tvYcBcT3AAMhC5hfNKov7yXPwyKoo\r\nJAEBeEP5nXCMjbQGtv7lZGGkjsyodiMCaUjIunoSA2JrSBk4ZtoJhCw9KXid\r\nn9aRuiqNjDS35DHK7Y0ZX2MM9+FE30hndeHFPT68/OOb4q6YhgUOXgmRJyhU\r\nyqhJNVcsHddGaJZf0845TKcR9dza7n2hFsR3uH9A+AryBayOtxNXkRT8juQr\r\nsc/Oj2A34yR3OmTe9TJ3CYaRrsK5BWSNGyuKQR20YRPunV9QJb0sJkWQGNqj\r\n75UZAKc6Nja1iTKcVf6MMfMm18s3eVXThHt0shgrrqoWkUPyyD96GZyr6dfJ\r\nxSkRQZZmw1JF4W4m6/KBKz0KckIEaGQ+IiurOvxRBiLnfwU++sV8CgjYdfQG\r\nCZkFd7Kxls1PVszhcsBW4dIhYjEfbzfBz21awz0EtOoP02amGRr+iXDxhOQd\r\n9nFqcd0lIH/280KjpUOBQjxmLy6FKwRZVm+UnnZpanfXMkfaiuycUYG3ZEYj\r\nliRAzKdGsgbFkdRPAmcA6rmgM53mTpK7U59wFX6cmqizyYRHAOyMnZTZXQLY\r\nZXIvKdXZltBgo1LJdvBWMFB9uY45Xr4w1DE=\r\n=ET+i\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.8.18_1665250759607_0.16503827446622243"},"_hasShrinkwrap":false},"3.8.19":{"name":"@mihanizm56/fetch-api","version":"3.8.19","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix --max-warnings=0 --cache --cache-location .eslintinfo","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"7.0.1"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"25.1.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"5.3.0","@typescript-eslint/parser":"5.3.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.4","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"8.2.0","eslint-config-airbnb-base":"15.0.0","eslint-config-prettier":"8.3.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.5.0","eslint-loader":"4.0.2","eslint-plugin-import":"2.25.3","eslint-plugin-prettier":"4.0.0","eslint-plugin-security":"1.4.0","prettier":"2.4.1","express":"4.17.1","husky":"3.0.9","jest":"25.5.4","joi":"17.4.2","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","ts-jest":"25.4.0","tscpaths":"0.0.9","typescript":"4.4.4"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"gitHead":"bd14e933a56ada0d91677ff37332141412c6e056","_id":"@mihanizm56/fetch-api@3.8.19","_nodeVersion":"12.22.7","_npmVersion":"6.14.15","dist":{"integrity":"sha512-KYLrfc4n+HoE17HHcu2t+ObLeIxBaJxfa/Vm9Sm6/lJZBx9q57zxO3xM7T6KES4dEkljBrvM8yveQqno+AC3fg==","shasum":"fb95865c6d268e5cd61be201bb1a70c999287017","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.8.19.tgz","fileCount":91,"unpackedSize":182311,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDTUiRe3uO12EHMWZOz7VJl3hf5+Lf/hYsV4PqUTIZ6rgIhALb8NkrhoDqJndENGbUfdCUTaGqs+mOQzLFBXfqiX74a"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjSx7hACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpLiw//Snal1S3hJ7JmXbRj5z1jw/h0XFkxo73Fkoj/9zCyMU5Slg9g\r\n6SOwftNzd7VGSBve8uioYHKEQjR3LNHAiEPRCHNkcqqMReUlMEp3s5k7R3QO\r\ntut5fBa66utEWWz1jCgIXrJ3scGkUjNHdmHyYKErj963CSXby5MLhtd5fdtr\r\nNF7WuEdViTWy7m2gnDILVCuuO8v9KtPO8JKSZRM8oks7DYKh6voC16/vcOyj\r\n66AaAIeS7EmiF60uDLk5Pl7vQX5pwvB+ZU0Yd4JeNbZAJ3WECc1/LRPSwc51\r\nv4gm+oyJAuwSJU7qWWqwZzEnrBQ+uk78uMy91IiD4rLxZj/bSmcXGUhiOY/9\r\ngf6uKPz/vEKcWjgsFuQL4HgEOF3710ubp/WkVmK5RO4IyZzYIQZzgZeNswWU\r\nirnrKQeZvnMgdvCdJXPJMXwSHmShDRG3jv9XjLyveIXTXuQMg0xWVZV6AtXR\r\noBhoh4rOBq+0SY3eOrlGRX0/HErb9ER+1Ky/JlK0ELo54gqyNwjwstwjaDBg\r\ntzDeOCs6F0g4BSim1lYUscHZUhY5d2dGSL86wZcVD3cKL2cbycHXDSCwLGdf\r\niltr8deOGPmhsGrOZM8odrJdI8/zVDaqba1J5bsyHObmIfDWfKHFYQT2Vvjh\r\nYemc22UQZFjJB7QGHiOww0w7edWARO4vNhQ=\r\n=5ObN\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.8.19_1665867489384_0.28781752888781753"},"_hasShrinkwrap":false},"3.8.20-beta.1":{"name":"@mihanizm56/fetch-api","version":"3.8.20-beta.1","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix --max-warnings=0 --cache --cache-location .eslintinfo","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"7.0.1"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"25.1.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"5.3.0","@typescript-eslint/parser":"5.3.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.4","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"8.2.0","eslint-config-airbnb-base":"15.0.0","eslint-config-prettier":"8.3.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.5.0","eslint-loader":"4.0.2","eslint-plugin-import":"2.25.3","eslint-plugin-prettier":"4.0.0","eslint-plugin-security":"1.4.0","prettier":"2.4.1","express":"4.17.1","husky":"3.0.9","jest":"25.5.4","joi":"17.4.2","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","ts-jest":"25.4.0","tscpaths":"0.0.9","typescript":"4.4.4"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for the isomorphic fetch\n### [Documentation here](https://mihanizm56.github.io/fetch-api/)\n\n### Benefits:\n- Provides validation for responses (based on joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services, https://www.npmjs.com/package/query-string is used)\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in the\n  hard-structured response format\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n- Provides the ability to handle the response progress\n- Provides the ability to select necessary fields from the response (https://github.com/nemtsov/json-mask#readme used)\n- Provides the ability to use persistent params for all requests\n- Provides the ability to retry requests\n- Provides the ability to logging your error requests\n\n#### Request input options:\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by joi <br/>(you must use the joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use joi\n- customTimeout(number) - milliseconds for cancel the request on timeout (or a full package of requests if the \"retry\" parameter is activated) \n- retry - number of requests try to request if the response is negative\n\n#### Request output options:\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n- body will be serialized in JSON if body data NOT FormData\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### Please, be careful. The response will be the object:\n```javascript\n{\n  error: boolean,\n  data: Array<IResponse>,\n  additionalErrors: null,\n  errorText: string,\n  code: number\n}\n```\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n#### Set persist options to all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setResponseTrackCallback(({\n  requestParams, // all request parameters\n  response, //  pure response protected object\n  pureResponseData, // response body without formatting\n  requestError: boolean, // is request crashed\n  formattedResponseData // formatted response data in IResponse interface\n}) => ({\n // do some metrics or logging here\n}));\n```\n\n#### Set callback for metrics for all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setPersistentOptions(() => ({\n  headers: {\n    foo: 'bar',\n  },\n}));\n```","readmeFilename":"README.md","gitHead":"9b641048dfc700f8245948692bdc481c5167c3df","_id":"@mihanizm56/fetch-api@3.8.20-beta.1","_nodeVersion":"12.22.7","_npmVersion":"6.14.15","dist":{"integrity":"sha512-BYaYqFQfQpnl1cyW3IMf9eM8wqGQkboJDXJe9npsXKhAkeVeZ8Kwg3qfWka7/P003FUgcyNbbXzrpxzrQb/vnA==","shasum":"98e97f537d9d0d102f01b766d93ccc08006f885d","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.8.20-beta.1.tgz","fileCount":91,"unpackedSize":182698,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD/mxGIfE3L95ZvgcmkH7Uggo76C7iNnEIqDzAAWP3mvgIgHCAClW+W58+JG/xUtbEuD+Wvv77gKrd54/KOrqI59a4="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjTvG/ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqmgA/+J6Ddbd2PkICcToVbHwM/I4Ugp8JmTGTnS0Ri9Bl/xPqKEkrv\r\nWuSKgdht51TswvieqifS2tIY4jXrPM2JXuQOx6Az4FB63I5Az/hXGg39GaTq\r\nemBg7TYfgJGaBC5FQIpVipOhextYyuiKuNLu/wt9GnJdSIXAfa/jw94QOboP\r\n69P7ZGnYEpOqFqABFkEqK4ZBK7iLoWDByFihxArUoTEVh2bvTmZGze02K4HN\r\nVtITWYZTYxRfQbudlGjxKohwGeC5vK4+3TEEDoCEzAjT1WavBgdOIcizQMhS\r\nQUqy285ay+ryfFmhlj2B8TthZ8ZcvOfQxbD1GTZylhkosHqR/KbKlTdFLFpP\r\nuBpTrR3aU2o+0CORoaRgFm2cPSM4KikDbh5i2dwB+OKlOEkN1Da62FXCI4UK\r\nxAya99egxrQDnUSbn3pfJeIZbw4IhSikwyGTRsS8Dz0R+kbTKnfhYbfE8moH\r\n3V4OC8lVi/qmeYozJ6/x+vchxh3Eh9ahVW/MJ9wtFhh7sbJMtxcuhDABOjgo\r\nsZndPRr2RDbsbnwNdS9T+EkymdD2esllq8ljSOGlIwd+PpoFipd3F4xVwAmo\r\nXxd07DLiMU/ZNhBTCF04ja8XwDi5ja2n2yzwZvMp94SjrBP8rq0jf9h/X2lW\r\nKNTIR7xTxKoVi288V4ozheQwLIrlooru7aQ=\r\n=LFrl\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.8.20-beta.1_1666118079291_0.5488789836725583"},"_hasShrinkwrap":false},"3.8.20-beta.2":{"name":"@mihanizm56/fetch-api","version":"3.8.20-beta.2","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix --max-warnings=0 --cache --cache-location .eslintinfo","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","node-fetch":"2.6.1","query-string":"7.0.1"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"25.1.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"5.3.0","@typescript-eslint/parser":"5.3.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.4","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"8.2.0","eslint-config-airbnb-base":"15.0.0","eslint-config-prettier":"8.3.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.5.0","eslint-loader":"4.0.2","eslint-plugin-import":"2.25.3","eslint-plugin-prettier":"4.0.0","eslint-plugin-security":"1.4.0","prettier":"2.4.1","express":"4.17.1","husky":"3.0.9","jest":"25.5.4","joi":"17.4.2","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","ts-jest":"25.4.0","tscpaths":"0.0.9","typescript":"4.4.4"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for the isomorphic fetch\n### [Documentation here](https://mihanizm56.github.io/fetch-api/)\n\n### Benefits:\n- Provides validation for responses (based on joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services, https://www.npmjs.com/package/query-string is used)\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in the\n  hard-structured response format\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n- Provides the ability to handle the response progress\n- Provides the ability to use persistent params for all requests\n- Provides the ability to retry requests\n- Provides the ability to logging your error requests\n\n#### Request input options:\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by joi <br/>(you must use the joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use joi\n- customTimeout(number) - milliseconds for cancel the request on timeout (or a full package of requests if the \"retry\" parameter is activated) \n- retry - number of requests try to request if the response is negative\n\n#### Request output options:\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n- body will be serialized in JSON if body data NOT FormData\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### Please, be careful. The response will be the object:\n```javascript\n{\n  error: boolean,\n  data: Array<IResponse>,\n  additionalErrors: null,\n  errorText: string,\n  code: number\n}\n```\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n#### Set persist options to all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setResponseTrackCallback(({\n  requestParams, // all request parameters\n  response, //  pure response protected object\n  pureResponseData, // response body without formatting\n  requestError: boolean, // is request crashed\n  formattedResponseData // formatted response data in IResponse interface\n}) => ({\n // do some metrics or logging here\n}));\n```\n\n#### Set callback for metrics for all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setPersistentOptions(() => ({\n  headers: {\n    foo: 'bar',\n  },\n}));\n```","readmeFilename":"README.md","gitHead":"0a91410e96e57f2f274ab70b8f3638181ede52d0","_id":"@mihanizm56/fetch-api@3.8.20-beta.2","_nodeVersion":"12.22.12","_npmVersion":"6.14.16","dist":{"integrity":"sha512-rNMf8AhbdkSX+Pf6NJqOdm/mP0NOA3LJfDBmf2y9OOG37DgAmLXMWlQ4/cUN5auJdFal8FsDMBlNMXBxX12CIg==","shasum":"08aa804b2f5553579a14f29321f8b3ea75de212c","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.8.20-beta.2.tgz","fileCount":89,"unpackedSize":180310,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEj6U4RIZK8+Xy8uvg18uj8c2wGAVYddFLHrx56k7tZQAiBS/rjSltARl0sC3NV04f1iy2aSNyuSVmsxZ/px0fgdoA=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjVEErACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrh7w//UMBeOdw9uISz8e00XgqGqGPatVvHqP+eTrN3BmNpLzYl8s0B\r\nYGy1Y53pBMefLcnbXPQ8idC2jYEwRpvOAAIWOmWjCJbJLndkaFMpSjZUvElm\r\nnOuGa0JE6Ny2ehimd1ljKWOIN0Oq/UGhkh24DMlY5J8SehqE73obplXHR0UF\r\nGujvxb69hS8wkP+hU3w+7tFVyRodmNN3cH6tJRZ98B/3eEgiAq4QyeQtsKGQ\r\ni6LBTiv5MLJVZe16sGyHvKx2IpXQCcvA1V9cAQB/28eNEHSVBj4r+jmU8gzw\r\nnV+vL9Cg/IgdpRhNQNVgx04WOFoafrkN45A+kga1vq7veCUNREyUa2mWMeHX\r\ntAxqnHcrumMomH//7T8t+jyI+1yyx4Jme/OBWeVXCHwstUxDcy1MGkiQJUY+\r\n2yP8cL7SSpxrVXKH6mxRZmobF1xPi2tuQ7FuxBWVZ6+CLepWDUL3OCW1nC8G\r\nT/2OLgyWSWURpq81Vfil/k38ZtluWefsXyOooYPIE1PFkd/zRoQf1WZdLNVW\r\nnsK+l/Yr8LX/5a7Rt9yyHlI7iqIbS99R3oTMXhsbO0EvPnlkqWVTNSrlL2pY\r\n3LrXdVDQyYUkJ0PMD5SX4FNzUqcUZhy7zvQZ04FFqocXl1PXwEUDvJvFx+s0\r\n5ebK2w5BT1oM8rAlK9m82E+uxY1C0T54u/Y=\r\n=Mkij\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.8.20-beta.2_1666466091644_0.7129554800070099"},"_hasShrinkwrap":false},"3.8.20":{"name":"@mihanizm56/fetch-api","version":"3.8.20","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix --max-warnings=0 --cache --cache-location .eslintinfo","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"7.0.1"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"25.1.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"5.3.0","@typescript-eslint/parser":"5.3.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.4","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"8.2.0","eslint-config-airbnb-base":"15.0.0","eslint-config-prettier":"8.3.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.5.0","eslint-loader":"4.0.2","eslint-plugin-import":"2.25.3","eslint-plugin-prettier":"4.0.0","eslint-plugin-security":"1.4.0","prettier":"2.4.1","express":"4.17.1","husky":"3.0.9","jest":"25.5.4","joi":"17.4.2","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","ts-jest":"25.4.0","tscpaths":"0.0.9","typescript":"4.4.4"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"gitHead":"649e7ddc2183ce4ea8e3d417f9605e9db00ef89f","_id":"@mihanizm56/fetch-api@3.8.20","_nodeVersion":"12.22.12","_npmVersion":"6.14.16","dist":{"integrity":"sha512-wM5pNVOoMLFJFJ3W1uh7SU1e5zqJ7wjy6Rj/xSSmMQthvdmrp1b9i7zjaB5xmTPnWd015GMIMXTdh8pVRUvi2w==","shasum":"c517b6f0ff17d4afce54fdde40566b8d71f7e9aa","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.8.20.tgz","fileCount":91,"unpackedSize":182691,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHb1pvmeviegsNevmXMPI65cF+BoZWDLgXIDacvXVfuZAiBhFiSTK/xBi9kIGI/p6lsRz9sBcP9mDsmR+UanyW6IMg=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjejoWACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrRjg/+KPvbnvU1vygiv50Mt5AoPEi0Hi44Z5WESC51P/OyO2KCsLkD\r\ntMDqjZOizRm6iK0y7SHogYAeZ03vRKVHBWhXdKb4NPl+9IW6K3Wp+bFxr8D2\r\nFujgVimImkIeokjkOFFHnFlCjyIXP1y0Izcob6duM0K5PM3408v00J993j+M\r\nnJf9S6ma8bzdTkBhl3Io6KN/rG2WB33mOHqdnI2dc92rlHKpZbk8sZ8xYDj1\r\nhG3EFdqtkpVuaPiUQk55Xj7mReuKn18Vc6Z17tFZ64UY+IURaodbM1dH1pVn\r\nETw2Lwl6FykUh2c/NhU9F8EGcLpT+cRiosLNE/u+xr5Xc0gL34n67u0Wnf6Z\r\nmlP+zrXutrkKqk+2gLCsK2XAAw7YqQQctcLKNyjbe/yQnpUL2BaODzyf8sAb\r\nd7QBHknqx64hWGJt8ZOPkFS86YLGQXfGgkl9Kr9M8wsLd107QXB99BVZpfUX\r\nSco9R1mqcoaTi9M3D3zijtmzepdKClsHpNV5ANBTRqQUiluDR1UtakS0iYj8\r\nxrNKTlu9LL5Aw5djPEcXNB3YN0QD1lzcHAQeRvuzUcBy8t1+cvIVFIM+uLE4\r\nxpQfNxa8TvA8BNvC6j7SMIzoyUpXvgdPu5AqWVtguJ6jUARlsHQQJHtC6b1h\r\nLmUcMRss+Ph+6+aicE/IINsE7N9MrV7npx4=\r\n=HAzm\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.8.20_1668954645948_0.48479881281801807"},"_hasShrinkwrap":false},"3.9.0-beta.1":{"name":"@mihanizm56/fetch-api","version":"3.9.0-beta.1","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix --max-warnings=0 --cache --cache-location .eslintinfo","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"7.0.1"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"25.1.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"5.3.0","@typescript-eslint/parser":"5.3.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.4","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"8.2.0","eslint-config-airbnb-base":"15.0.0","eslint-config-prettier":"8.3.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.5.0","eslint-loader":"4.0.2","eslint-plugin-import":"2.25.3","eslint-plugin-prettier":"4.0.0","eslint-plugin-security":"1.4.0","prettier":"2.4.1","express":"4.17.1","husky":"3.0.9","jest":"25.5.4","joi":"17.4.2","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","ts-jest":"25.4.0","tscpaths":"0.0.9","typescript":"4.4.4"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for the isomorphic fetch\n### [Documentation here](https://mihanizm56.github.io/fetch-api/)\n\n### Benefits:\n- Provides validation for responses (based on joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services, https://www.npmjs.com/package/query-string is used)\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in the\n  hard-structured response format\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n- Provides the ability to handle the response progress\n- Provides the ability to select necessary fields from the response (https://github.com/nemtsov/json-mask#readme used)\n- Provides the ability to use persistent params for all requests\n- Provides the ability to retry requests\n- Provides the ability to logging your error requests\n\n#### Request input options:\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by joi <br/>(you must use the joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use joi\n- customTimeout(number) - milliseconds for cancel the request on timeout (or a full package of requests if the \"retry\" parameter is activated) \n- retry - number of requests try to request if the response is negative\n\n#### Request output options:\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n- body will be serialized in JSON if body data NOT FormData\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### Please, be careful. The response will be the object:\n```javascript\n{\n  error: boolean,\n  data: Array<IResponse>,\n  additionalErrors: null,\n  errorText: string,\n  code: number\n}\n```\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n#### Set persist options to all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setResponseTrackCallback(({\n  requestParams, // all request parameters\n  response, //  pure response protected object\n  pureResponseData, // response body without formatting\n  requestError: boolean, // is request crashed\n  formattedResponseData // formatted response data in IResponse interface\n}) => ({\n // do some metrics or logging here\n}));\n```\n\n#### Set callback for metrics for all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setPersistentOptions(() => ({\n  headers: {\n    foo: 'bar',\n  },\n}));\n```","readmeFilename":"README.md","gitHead":"649e7ddc2183ce4ea8e3d417f9605e9db00ef89f","_id":"@mihanizm56/fetch-api@3.9.0-beta.1","_nodeVersion":"12.22.12","_npmVersion":"6.14.16","dist":{"integrity":"sha512-7epxgymwuXTxEFo/SdaZrJxWBkPec7lGCN3Omg41z4ddm8KjJPsRER/7xq/AOoKDVBexR/uXMNqqqLXZFlHHfA==","shasum":"f4c8801f7a26b9b6061cfb178c8ae99920e06bc9","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.9.0-beta.1.tgz","fileCount":113,"unpackedSize":240058,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBSUWpdn6DPysN0eifNCivfcixwnEffpId0PeuajkWe8AiEAvWijvRwA16+1XMRq8mG6l6SOe0L0Esy9o5Fxutvu23E="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjejpAACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrvmA/7Bqhl8Kt3j9okA+vhA5dQXqdsXchB+F19r3dbGDA6rqPCVEwV\r\nNkrvRfvJYRqUAt7tQwo5yLKZ98YGOfdmPoYWuuPOA2fp8TEnnDTrNGjaff28\r\nTqPieajSg+WGL7w2VtUoB7Qfap7Cxql/GrhV+1Od294jFreQOSXCz/tROrpS\r\nxA8uId7NfqfKwkiiAOUVs20pN5npLG9eNcbzb2AUKWRMmQ+No52AQwSN0rCG\r\nNa+ZyKkozw5mytW79v7fUq6UHB+qTthJJejY3rAfXJpiBuYM8FWRASKX3QW9\r\njCP3gJflHcL+Kq15mrrkAegfxBlVdaP59Jay0SxBUHcK6sZyiGupM2wxngZG\r\ny28PR4PqMPAT06nowoqgaqy4U5iGQd9yeUO7CrWY0nih9yw3sSWB4PLLhC0c\r\n45wRlGp9vRKibBNLWFWdnBfBl6Nwzc5wddSNsxd2gDHOS1kE5o0VbVTnUZuK\r\nMVX2GFl02YfKTZK5OtETDhhHARxoWXFWvyXoNsPC5/TUcbw4nbRC7oUEP5XK\r\nrUZnAZ+gmwOUjHyqqa8r1SvDFnGGtRUQbo24iQ77pLjMcWj44x6JEYAYCsMM\r\nP5wAaVylBJ0KfYzXtp5h/RvkHWgT31TPyyJpgVbr8T1j30FikyzluCUGP8EV\r\nnVHiTTVgX8qHl7fgoAR0sg41U7F9Li9M3qA=\r\n=Eu1k\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.9.0-beta.1_1668954687964_0.6611103853594711"},"_hasShrinkwrap":false},"3.9.0-beta.2":{"name":"@mihanizm56/fetch-api","version":"3.9.0-beta.2","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix --max-warnings=0 --cache --cache-location .eslintinfo","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"7.0.1"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"25.1.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"5.3.0","@typescript-eslint/parser":"5.3.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.4","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"8.2.0","eslint-config-airbnb-base":"15.0.0","eslint-config-prettier":"8.3.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.5.0","eslint-loader":"4.0.2","eslint-plugin-import":"2.25.3","eslint-plugin-prettier":"4.0.0","eslint-plugin-security":"1.4.0","prettier":"2.4.1","express":"4.17.1","husky":"3.0.9","jest":"25.5.4","joi":"17.4.2","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","ts-jest":"25.4.0","tscpaths":"0.0.9","typescript":"4.4.4"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for the isomorphic fetch\n### [Documentation here](https://mihanizm56.github.io/fetch-api/)\n\n### Benefits:\n- Provides validation for responses (based on joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services, https://www.npmjs.com/package/query-string is used)\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in the\n  hard-structured response format\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n- Provides the ability to handle the response progress\n- Provides the ability to select necessary fields from the response (https://github.com/nemtsov/json-mask#readme used)\n- Provides the ability to use persistent params for all requests\n- Provides the ability to retry requests\n- Provides the ability to logging your error requests\n\n#### Request input options:\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by joi <br/>(you must use the joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use joi\n- customTimeout(number) - milliseconds for cancel the request on timeout (or a full package of requests if the \"retry\" parameter is activated) \n- retry - number of requests try to request if the response is negative\n\n#### Request output options:\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n- body will be serialized in JSON if body data NOT FormData\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### Please, be careful. The response will be the object:\n```javascript\n{\n  error: boolean,\n  data: Array<IResponse>,\n  additionalErrors: null,\n  errorText: string,\n  code: number\n}\n```\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n#### Set persist options to all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setResponseTrackCallback(({\n  requestParams, // all request parameters\n  response, //  pure response protected object\n  pureResponseData, // response body without formatting\n  requestError: boolean, // is request crashed\n  formattedResponseData // formatted response data in IResponse interface\n}) => ({\n // do some metrics or logging here\n}));\n```\n\n#### Set callback for metrics for all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setPersistentOptions(() => ({\n  headers: {\n    foo: 'bar',\n  },\n}));\n```","readmeFilename":"README.md","gitHead":"4c9bd589588fd2e89e42fedebd3f1ec0052886d2","_id":"@mihanizm56/fetch-api@3.9.0-beta.2","_nodeVersion":"12.22.12","_npmVersion":"6.14.16","dist":{"integrity":"sha512-wKBhO/BwhBdhMx9pG/BkGwb/S8yB4peV3UWYCzd30JNjxc9p9N4ebXoekY5jHchyr7m1rBQI6nJemJG19oC7oQ==","shasum":"4093232c2cdf8214d46d0ea254dd2e1899d20476","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.9.0-beta.2.tgz","fileCount":113,"unpackedSize":240825,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDY2hDdQsB9KWVZFYRBWbhQ+rJcFfudsvrVeaOC4EaOOAiEAv3CODTI7Wc8NL7XCN8OCaadZbOZNzY7KBwHrbhx7H6A="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjfj30ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpO1Q/9EG5CQs3VKauMVn+9NkYPv9Mmv0SI09rQ2LVKRULlWW8tULNG\r\naioClH6NETJysyjQZjJQFbRlLynrc9as70xg/im6M1Ps2Kl2/nnLgAX0zlnA\r\n+gxcfh5vXqh/hbKlnNrMT+c/bfQK1NcKLJDeh8XXwkNeJCEoIyfaDtlKMSZP\r\naZ45eb2dTMUCkKMiHr9RMs/5ZJD6Hy7kMPBXewE92kaOjloFXcy3CUdLcmxZ\r\nl5nYaArgPNL6ieulI8ChN1CcT2o2GjR1keIMYVOyi78PQht62CpHhlzRH4x6\r\n7DyhDfDMq3NP1EdCr7k0jHvX2Tpg0MffeRPLvHDrjP6GUu3mtDCEyO20Sv3Z\r\nRZulG2D3u9bp/8wjQfdOFYzJ7hy1bSCZa4J1vT+qZ3dXZhFYgs3qVUBnF0PJ\r\n774/9GVNy2NmOUrdUFzjtOwO/WizuZZqrwY1Jd706tmdISQy0WgN2AwVifdp\r\nrokCPMrJmf5+2+Kzt0ZmOTqwpeSTu7TH3UtNpt3PEgWwomE4TOSwbyRItcLE\r\n1jshST7Zk2XNhkRGw3qJQvQzs4qoeGOt8b1jTtS4n6hfjQl+F2vOKIpk+VXw\r\nhtDIPHNViZQLm89fmNXfZ/K+cE+R89+NYW6EmY35xZcnBT8Gxf0h17P9MHBg\r\nl+tdCmCFFUW60Jer9aC9rgScdfcJp2NHlTU=\r\n=O3xg\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.9.0-beta.2_1669217780442_0.8549718096281964"},"_hasShrinkwrap":false},"3.9.0-beta.3":{"name":"@mihanizm56/fetch-api","version":"3.9.0-beta.3","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix --max-warnings=0 --cache --cache-location .eslintinfo","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"7.0.1"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"25.1.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"5.3.0","@typescript-eslint/parser":"5.3.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.4","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"8.2.0","eslint-config-airbnb-base":"15.0.0","eslint-config-prettier":"8.3.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.5.0","eslint-loader":"4.0.2","eslint-plugin-import":"2.25.3","eslint-plugin-prettier":"4.0.0","eslint-plugin-security":"1.4.0","prettier":"2.4.1","express":"4.17.1","husky":"3.0.9","jest":"25.5.4","joi":"17.4.2","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","ts-jest":"25.4.0","tscpaths":"0.0.9","typescript":"4.4.4"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for the isomorphic fetch\n### [Documentation here](https://mihanizm56.github.io/fetch-api/)\n\n### Benefits:\n- Provides validation for responses (based on joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services, https://www.npmjs.com/package/query-string is used)\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in the\n  hard-structured response format\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n- Provides the ability to handle the response progress\n- Provides the ability to select necessary fields from the response (https://github.com/nemtsov/json-mask#readme used)\n- Provides the ability to use persistent params for all requests\n- Provides the ability to retry requests\n- Provides the ability to logging your error requests\n\n#### Request input options:\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by joi <br/>(you must use the joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use joi\n- customTimeout(number) - milliseconds for cancel the request on timeout (or a full package of requests if the \"retry\" parameter is activated) \n- retry - number of requests try to request if the response is negative\n\n#### Request output options:\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n- body will be serialized in JSON if body data NOT FormData\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### Please, be careful. The response will be the object:\n```javascript\n{\n  error: boolean,\n  data: Array<IResponse>,\n  additionalErrors: null,\n  errorText: string,\n  code: number\n}\n```\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n#### Set persist options to all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setResponseTrackCallback(({\n  requestParams, // all request parameters\n  response, //  pure response protected object\n  pureResponseData, // response body without formatting\n  requestError: boolean, // is request crashed\n  formattedResponseData // formatted response data in IResponse interface\n}) => ({\n // do some metrics or logging here\n}));\n```\n\n#### Set callback for metrics for all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setPersistentOptions(() => ({\n  headers: {\n    foo: 'bar',\n  },\n}));\n```","readmeFilename":"README.md","gitHead":"4c9bd589588fd2e89e42fedebd3f1ec0052886d2","_id":"@mihanizm56/fetch-api@3.9.0-beta.3","_nodeVersion":"18.11.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-isouB4kT8ar3TzGxVXZk6wwwkdU7KCCRbddalmEqWup7ZDF+mK0uYD5hfxVsrLJMEKyUXZygBX49mn0bgyKKGQ==","shasum":"1a4bf2042457fa3ab9e9ac98297d5c962163c99d","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.9.0-beta.3.tgz","fileCount":113,"unpackedSize":241182,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCiJnagRsTAECeIiSdDp1Ta2wTMc4VUjZD5kavc0OB/HQIhAMfkPCq5Bi2oPByyhmjsGGIDFNuqu17G8hPJzOwwUHhX"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjfnW+ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmql2w/9Et8AP2i3W7AKMf0siQMxBjO3VeEmEsrdzp7gvoFdDUORKTAI\r\n12pdAj/snhNZd8fGijQJUXA0x8mcG3mwqM0eEDlFmf7a4dKysx582MQid4Fs\r\n/T+wAICYDMJw7n/44fRVzSJ8g2glSvlPjdA9Lh82IiMJYGVBoVb5Wbfsji8I\r\nJYiNGUQ/7MDmPdX4U1vaBaPKk2bvLtUnYnQzGovQzd5cFGgpDQd5d7vInNLQ\r\nEBivsHK/FIP70fs9QpAexTy4YRzQ3nRsArJAZGUCKXA+0EHi/SjvIZMhSOc/\r\nb8O7zhnglZqnuinVwHZ8oZJvn2c+jqnsRa56KxJhQ396B+tn+T04zpZiWTgU\r\nySYVzSLHwTpIsz0B18StsRlV3W8POlgBPr83OWnvyMiSYlfesMN/Eq2UfRPs\r\nVpgoWfniwUJ1EoYs/5piOGlkrgOkvMg7Co9rOegHfjAE+lguxzulW3m/hm2M\r\nPt1pyQQseiXH5qWMZj77oeec7g09qSqqzysVSdMFOLkauoWibAd0mlF3aybk\r\n9lpHtWw7de0ZjwZguh78hRdWdgmX9kD7DLDIXk4WNzg7WpcFxuVPivHYCd2G\r\neTIcwaxG99at9FJT5GZ0wM0LuYsgf2n9mDZH71ufhhxzlYcQLppsTbR4YNKc\r\nMX+NL+glCg9P88Ztv3Nq007Ic1t8NgueOXc=\r\n=LixD\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.9.0-beta.3_1669232062752_0.49605050512604043"},"_hasShrinkwrap":false},"3.9.0-beta.4":{"name":"@mihanizm56/fetch-api","version":"3.9.0-beta.4","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix --max-warnings=0 --cache --cache-location .eslintinfo","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"7.0.1"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"25.1.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"5.3.0","@typescript-eslint/parser":"5.3.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.4","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"8.2.0","eslint-config-airbnb-base":"15.0.0","eslint-config-prettier":"8.3.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.5.0","eslint-loader":"4.0.2","eslint-plugin-import":"2.25.3","eslint-plugin-prettier":"4.0.0","eslint-plugin-security":"1.4.0","prettier":"2.4.1","express":"4.17.1","husky":"3.0.9","jest":"25.5.4","joi":"17.4.2","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","ts-jest":"25.4.0","tscpaths":"0.0.9","typescript":"4.4.4"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for the isomorphic fetch\n### [Documentation here](https://mihanizm56.github.io/fetch-api/)\n\n### Benefits:\n- Provides validation for responses (based on joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services, https://www.npmjs.com/package/query-string is used)\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in the\n  hard-structured response format\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n- Provides the ability to handle the response progress\n- Provides the ability to select necessary fields from the response (https://github.com/nemtsov/json-mask#readme used)\n- Provides the ability to use persistent params for all requests\n- Provides the ability to retry requests\n- Provides the ability to logging your error requests\n\n#### Request input options:\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by joi <br/>(you must use the joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use joi\n- customTimeout(number) - milliseconds for cancel the request on timeout (or a full package of requests if the \"retry\" parameter is activated) \n- retry - number of requests try to request if the response is negative\n\n#### Request output options:\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n- body will be serialized in JSON if body data NOT FormData\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### Please, be careful. The response will be the object:\n```javascript\n{\n  error: boolean,\n  data: Array<IResponse>,\n  additionalErrors: null,\n  errorText: string,\n  code: number\n}\n```\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n#### Set persist options to all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setResponseTrackCallback(({\n  requestParams, // all request parameters\n  response, //  pure response protected object\n  pureResponseData, // response body without formatting\n  requestError: boolean, // is request crashed\n  formattedResponseData // formatted response data in IResponse interface\n}) => ({\n // do some metrics or logging here\n}));\n```\n\n#### Set callback for metrics for all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setPersistentOptions(() => ({\n  headers: {\n    foo: 'bar',\n  },\n}));\n```","readmeFilename":"README.md","gitHead":"d9cf6c85559dfdf2a77a9a5d2271d5a1817bc4a7","_id":"@mihanizm56/fetch-api@3.9.0-beta.4","_nodeVersion":"12.22.12","_npmVersion":"6.14.16","dist":{"integrity":"sha512-212Ce6RllMSSKHbP7mZIw1e/nnigVuxc/HTAqTzdc9WyRflkCuMiQ0V8f/kQ3QTcX5dEQ3HGQhoFsMdACWNIzw==","shasum":"62e0e0b39ab4cae9d466c29acebca63d1315aa92","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.9.0-beta.4.tgz","fileCount":113,"unpackedSize":241189,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEpClDlZ5WHaNjFSCjVZuJi7jhi1k/1zXb1xasisX8/fAiB0pOVXQn6xR+uHvqXUvDSgzIO5gOW6f8hMQ5Q1LC/ZQQ=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjf55KACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo7+Q/9GNM55B2VJ7FzV08QooJ+NaXc0tJfjBUaKIQwjafHzPxmd4Y9\r\nXQywkpToeVFWv7YxRxylxuKqtyBWPGNVLWjRmTpel1F+TKghQWFnQILDrs4b\r\nfQeR0EWDZ5EhkhbGEHGaG5fYm9Cg8+cwoZae91rQVYplRVsvCvQPgg4ODbXa\r\n+WSMRYsVrJpRGfDAnE5IcagVLx/HWEOjpoa9oMWz8gr4x64RzT74Mn0/t+Cd\r\n8IxT59cHm53bP5qhXtnNYqT8SD6UesoBBoEQH6+i0+PbpVmPCfMlbMkyKRdP\r\nZ41yVPECzjfV+hAnRhOf2zFInUJgsayzNfEup/LYWZNhvaYX2BccfVIKcPsf\r\n8z5s3RBKNL+Wz0QimypFOyuoLqGs4ySOlFX6m5SfCqoJqeUl+sC49uUMpzxI\r\nHSW6zLKZ0rvL2GbnBGFVbvliO5FcZDhxUG/6A6485z1fIxtbK/2UmBBV2HB5\r\nyUkXf+RS4Mw2tSERNIYalZpeHWOIgrHUddOxpxw5HrsbpEY/pVV1kr8dtNYS\r\nW1XDO9eeiqzJ+yiDVuOeV4iCsHo9FdD82bNcqC8Rth14szFYLaDHVTzyaHxl\r\nZZ7UC7rBmfkbtQT2WDxrGU86ipGFZdztL0cnUYy/3aDUkFeSgDFIgneHVmP4\r\n73d6qv1OmN5BaewXv0Su/M2JHORFfmRV23Q=\r\n=9nDL\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.9.0-beta.4_1669307978500_0.4636231120533354"},"_hasShrinkwrap":false},"3.9.0-beta.5":{"name":"@mihanizm56/fetch-api","version":"3.9.0-beta.5","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix --max-warnings=0 --cache --cache-location .eslintinfo","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"7.0.1"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"25.1.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"5.3.0","@typescript-eslint/parser":"5.3.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.4","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"8.2.0","eslint-config-airbnb-base":"15.0.0","eslint-config-prettier":"8.3.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.5.0","eslint-loader":"4.0.2","eslint-plugin-import":"2.25.3","eslint-plugin-prettier":"4.0.0","eslint-plugin-security":"1.4.0","prettier":"2.4.1","express":"4.17.1","husky":"3.0.9","jest":"25.5.4","joi":"17.4.2","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","ts-jest":"25.4.0","tscpaths":"0.0.9","typescript":"4.4.4"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for the isomorphic fetch\n### [Documentation here](https://mihanizm56.github.io/fetch-api/)\n\n### Benefits:\n- Provides validation for responses (based on joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services, https://www.npmjs.com/package/query-string is used)\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in the\n  hard-structured response format\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n- Provides the ability to handle the response progress\n- Provides the ability to select necessary fields from the response (https://github.com/nemtsov/json-mask#readme used)\n- Provides the ability to use persistent params for all requests\n- Provides the ability to retry requests\n- Provides the ability to logging your error requests\n\n#### Request input options:\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by joi <br/>(you must use the joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use joi\n- customTimeout(number) - milliseconds for cancel the request on timeout (or a full package of requests if the \"retry\" parameter is activated) \n- retry - number of requests try to request if the response is negative\n\n#### Request output options:\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n- body will be serialized in JSON if body data NOT FormData\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### Please, be careful. The response will be the object:\n```javascript\n{\n  error: boolean,\n  data: Array<IResponse>,\n  additionalErrors: null,\n  errorText: string,\n  code: number\n}\n```\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n#### Set persist options to all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setResponseTrackCallback(({\n  requestParams, // all request parameters\n  response, //  pure response protected object\n  pureResponseData, // response body without formatting\n  requestError: boolean, // is request crashed\n  formattedResponseData // formatted response data in IResponse interface\n}) => ({\n // do some metrics or logging here\n}));\n```\n\n#### Set callback for metrics for all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setPersistentOptions(() => ({\n  headers: {\n    foo: 'bar',\n  },\n}));\n```","readmeFilename":"README.md","gitHead":"2e1e5627de852f08380df44238d53796be4475b6","_id":"@mihanizm56/fetch-api@3.9.0-beta.5","_nodeVersion":"12.22.12","_npmVersion":"6.14.16","dist":{"integrity":"sha512-AyYjCjT1M4bOArht71epHOj/asU5Re9drUcXl3OJXH8ZynO45RbgB6pQ3X/NQ2K57azn/lTcbtIeYuyKDnF6SA==","shasum":"8cfea34da5870fc8621e5c2b3ce7534820a97892","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.9.0-beta.5.tgz","fileCount":117,"unpackedSize":251030,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIALZXZfVupqErqw3e6u50yMOqmyGWDZF4sSSJoJth3uKAiAg50MaiflV6iZ8AjDZ+OzZiB81SVIBPrGFdBg6lJjnIg=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjgrIlACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq1kA//asEpUgiCR7kN2SQkH6vOAzKZi2f+U8xG2Qb9TjIBKEAkezEg\r\nNRbqhfFVe1mqJ2zfaN+i2r9Vl0s6EznA/Wk/hyZqy1BZ6fRGK1WU8Y1Dfnxx\r\nfEa2U8VBrKdEX9uWon23YKhuqLQ1LoXITLAztemhBeoO5NRY55aEoaBR/RgW\r\n81MVeEv2hI+T4HPPVKQiUJpFKStMzw2j8KT56cMHRnlfp09JBGVROuOrDbzN\r\nN9iTyLiOLuv378O5QUTEv79s0YCOLtZlW+guJo6Uq9l3ZEwEMYuK9wN/JvAE\r\nmQU92MEtXx4FIDvK98Rh6Mkw14VXN4e+dSHPoRMjkmpAE1XW57NSDmRmKV43\r\n5v5U4AnZRystDtL6BnfZLaMxiPqtFjJhRX9lHMUuUwslJwW48WpznM7lopW+\r\niwCg/zO3cOXJjpMvbhqQpm8CxAsxc8gypJ96+IxUvXEq3pEM4dGIUYDvJe09\r\nggLjtsJxCfZoWw4b39Rj84UdwFpc9im8+yg8g16EdyPhUPhnSoqq1eOR3Ug1\r\nGAgRDCP8QkZCtPM2ffIaseZctzxtjpg+lBXb7EJRpMXo3yfLv799uMktT+iY\r\nDLtfSsUxsNMX4P7RmupAKsOzhLG+BhshDLc1tbLfvhGgw0pqnNsLK6rAWKB6\r\nXTdnm8B3PKdQcqEisNtEWJA8gGfDGBuFCHQ=\r\n=f5ra\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.9.0-beta.5_1669509669253_0.7703021387990356"},"_hasShrinkwrap":false},"3.9.0-beta.6":{"name":"@mihanizm56/fetch-api","version":"3.9.0-beta.6","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix --max-warnings=0 --cache --cache-location .eslintinfo","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"7.0.1"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"25.1.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"5.3.0","@typescript-eslint/parser":"5.3.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.4","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"8.2.0","eslint-config-airbnb-base":"15.0.0","eslint-config-prettier":"8.3.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.5.0","eslint-loader":"4.0.2","eslint-plugin-import":"2.25.3","eslint-plugin-prettier":"4.0.0","eslint-plugin-security":"1.4.0","prettier":"2.4.1","express":"4.17.1","husky":"3.0.9","jest":"25.5.4","joi":"17.4.2","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","ts-jest":"25.4.0","tscpaths":"0.0.9","typescript":"4.4.4"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for the isomorphic fetch\n### [Documentation here](https://mihanizm56.github.io/fetch-api/)\n\n### Benefits:\n- Provides validation for responses (based on joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services, https://www.npmjs.com/package/query-string is used)\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in the\n  hard-structured response format\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n- Provides the ability to handle the response progress\n- Provides the ability to select necessary fields from the response (https://github.com/nemtsov/json-mask#readme used)\n- Provides the ability to use persistent params for all requests\n- Provides the ability to retry requests\n- Provides the ability to logging your error requests\n\n#### Request input options:\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by joi <br/>(you must use the joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use joi\n- customTimeout(number) - milliseconds for cancel the request on timeout (or a full package of requests if the \"retry\" parameter is activated) \n- retry - number of requests try to request if the response is negative\n\n#### Request output options:\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n- body will be serialized in JSON if body data NOT FormData\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### Please, be careful. The response will be the object:\n```javascript\n{\n  error: boolean,\n  data: Array<IResponse>,\n  additionalErrors: null,\n  errorText: string,\n  code: number\n}\n```\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n#### Set persist options to all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setResponseTrackCallback(({\n  requestParams, // all request parameters\n  response, //  pure response protected object\n  pureResponseData, // response body without formatting\n  requestError: boolean, // is request crashed\n  formattedResponseData // formatted response data in IResponse interface\n}) => ({\n // do some metrics or logging here\n}));\n```\n\n#### Set callback for metrics for all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setPersistentOptions(() => ({\n  headers: {\n    foo: 'bar',\n  },\n}));\n```","readmeFilename":"README.md","gitHead":"2e1e5627de852f08380df44238d53796be4475b6","_id":"@mihanizm56/fetch-api@3.9.0-beta.6","_nodeVersion":"18.11.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-9XJIsGifps5w2X61OamZRntK5s268YmD6Vv6/Q6CvVh3uuaauI9Inh8FdfqELTq8yPh8UapJbRnBCFlkX1Fs6Q==","shasum":"88a546705ff9d46dc7b360ab93ed8ea424c939ae","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.9.0-beta.6.tgz","fileCount":117,"unpackedSize":254627,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFs8CaBVfUW/LXKwf3h7C6gONzAuujrZI2Y+ZpjjukOcAiB3kl7STZASioRzWUea/BlE2/rtvPKIfIuWmfZ+OAv3iA=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjgr07ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoWzQ//TMyoFSj09rQc4BHAEBxZIKdb2eRbyLhWphI+O1TMoH781Kox\r\np2TvpEexAYM6WYrzxPaNLnQgSdse9xDLv1ZMQVER4Rp9zlIL1t9EUYICe+Uo\r\nDy1ajTrgVynlY4kNwQF9KLfSXp5vwOzugFHA7xckO7SWiI54VuDO+mPA5/tO\r\nLxjwSa/vjYXsJf/Z/uMn9grkYExok7Z/6k7pbWJi6GmZVKA9+yOMCNPDX4lh\r\na0TVSx6AautXn7E+Vma8zmBpn8h3yJRrZJP85dUtnk9NgzdMuIjunHrvu1f6\r\nX2lAOUpBQEqOKngCSp8uY10bYZUciIarpRMkYcLdnZaqqvbp95v+VkHSSczh\r\n6MIfunJVBsDyYmtHtLhFFb/ZPXq6pQg4VLukRTdl85u0eTQhPlLG6aqtlgGA\r\nySjgbiAn7KNC+P4F41ZrJ3yGB2WkPLwfZaX/kwHIUrX/91uuhgK2wOiMqVwn\r\n81QZTR75TdoGk3nc48+AEWuggEaPwpfbI5MgsUf/Y5MRXNnRq6L/oByuCVxP\r\nMOaMJPC8TUH1T2TiDx2eKmJ2dgZTUE9piTqt7+xUUYTV3G5DpafvFGLZxvgR\r\nyByrP/1RFxfyCjO7UHnGYHBcercSvdenO1fxs0Kb7FU8XnpbmXYkGOzEjUQH\r\nkcsmZGgnhdwsNoq1Gt2UEZktEJEsAVrCKW4=\r\n=5pnA\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.9.0-beta.6_1669512507598_0.029565407916841036"},"_hasShrinkwrap":false},"3.9.0-beta.7":{"name":"@mihanizm56/fetch-api","version":"3.9.0-beta.7","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix --max-warnings=0 --cache --cache-location .eslintinfo","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"7.0.1"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"25.1.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"5.3.0","@typescript-eslint/parser":"5.3.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.4","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"8.2.0","eslint-config-airbnb-base":"15.0.0","eslint-config-prettier":"8.3.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.5.0","eslint-loader":"4.0.2","eslint-plugin-import":"2.25.3","eslint-plugin-prettier":"4.0.0","eslint-plugin-security":"1.4.0","prettier":"2.4.1","express":"4.17.1","husky":"3.0.9","jest":"25.5.4","joi":"17.4.2","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","ts-jest":"25.4.0","tscpaths":"0.0.9","typescript":"4.4.4"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for the isomorphic fetch\n### [Documentation here](https://mihanizm56.github.io/fetch-api/)\n\n### Benefits:\n- Provides validation for responses (based on joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services, https://www.npmjs.com/package/query-string is used)\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in the\n  hard-structured response format\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n- Provides the ability to handle the response progress\n- Provides the ability to select necessary fields from the response (https://github.com/nemtsov/json-mask#readme used)\n- Provides the ability to use persistent params for all requests\n- Provides the ability to retry requests\n- Provides the ability to logging your error requests\n\n#### Request input options:\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by joi <br/>(you must use the joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use joi\n- customTimeout(number) - milliseconds for cancel the request on timeout (or a full package of requests if the \"retry\" parameter is activated) \n- retry - number of requests try to request if the response is negative\n\n#### Request output options:\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n- body will be serialized in JSON if body data NOT FormData\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### Please, be careful. The response will be the object:\n```javascript\n{\n  error: boolean,\n  data: Array<IResponse>,\n  additionalErrors: null,\n  errorText: string,\n  code: number\n}\n```\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n#### Set persist options to all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setResponseTrackCallback(({\n  requestParams, // all request parameters\n  response, //  pure response protected object\n  pureResponseData, // response body without formatting\n  requestError: boolean, // is request crashed\n  formattedResponseData // formatted response data in IResponse interface\n}) => ({\n // do some metrics or logging here\n}));\n```\n\n#### Set callback for metrics for all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setPersistentOptions(() => ({\n  headers: {\n    foo: 'bar',\n  },\n}));\n```","readmeFilename":"README.md","gitHead":"8430ac891c17bad82d4de1977c5fcab057417c3d","_id":"@mihanizm56/fetch-api@3.9.0-beta.7","_nodeVersion":"12.22.12","_npmVersion":"6.14.16","dist":{"integrity":"sha512-RyNzJPP00Ghkd2ybYZc9kjkVIxJTMPg4lnY2wmVmj1mLZI+By7QlpBx9b+ILaNFbMieSoEjSv1JjgknOzS0znQ==","shasum":"387043d4d04fbd65e45731f2a23271a949ce0db8","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.9.0-beta.7.tgz","fileCount":117,"unpackedSize":253694,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDGpYVVJfMg9BArKpZNvrcAosvfrCeXq8Cq4LH76imTDQIgLJEXtHADScK3jiiWxEOtgkk1FjjXZ3bi8ciIV3u2EGo="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjgr9VACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrJ1xAAmEo2PGsYuQnX7DMdijXFiz3lAFiP2MZC7q51W08x1snia0KL\r\nxji3JVfUPnQNS+0e8mGS03btwXld2ih6lRPqyzGXvkhq1gS7TBTgP5az0QpM\r\nqztOzRn5evRAxqOtB5Qkw6DaBRR8bdF2b4ygddpachv00MidKvJ0fhCVL7YM\r\ndqouiXs2Xb1I2RS5Ru48DOE09sxfAa3buOjHSEud3wqkqnrYTSG0AmmwRjqd\r\nQsHrWtDt/sTk6g8SXmzlWYnFkad3fhjV7oDvr/UsXI0BgxmuUZITzSAff0NJ\r\n4hMUSuW83vNBmzmqgiwHZ7BRQqUBnbirAVsFIJJtDHlhAijgcRhBJmoD1xrl\r\n1fSvNw/TAtyD6MW8RFOzbBEwZZcV0RGHq/D+T30oIfMcOz6/Gv0Dm2UvBC2E\r\nSlnPplkuJQyK4JAFbLPVu9COGT1B8cydyGG+ZDTVFh7cIcLbWy/PrRT/BHvW\r\nWkYWZxcNbWbM0PY3y27Ec/3fK4tWIeLjC8glOP3vbagQwTAzYXHQM90IOixE\r\noO+NM6EFH6iZZzYqErGkqavlL4mZg83V6Y+EuEeSSOLqh5Zv4c4ORvZUuGqa\r\nfUltkwu21B0ewU+NgtZkNY6Ii3ViCmt/SRuHGgFaKNFKj5ogMIxb+DA/SXsg\r\nFGusiAxTvrU/5OyV74jpJPW2bURZOfgG0ck=\r\n=5zlp\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.9.0-beta.7_1669513045680_0.7432246711333768"},"_hasShrinkwrap":false},"3.9.0-beta.8":{"name":"@mihanizm56/fetch-api","version":"3.9.0-beta.8","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix --max-warnings=0 --cache --cache-location .eslintinfo","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"7.0.1"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"25.1.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"5.3.0","@typescript-eslint/parser":"5.3.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.4","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"8.2.0","eslint-config-airbnb-base":"15.0.0","eslint-config-prettier":"8.3.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.5.0","eslint-loader":"4.0.2","eslint-plugin-import":"2.25.3","eslint-plugin-prettier":"4.0.0","eslint-plugin-security":"1.4.0","prettier":"2.4.1","express":"4.17.1","husky":"3.0.9","jest":"25.5.4","joi":"17.4.2","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","ts-jest":"25.4.0","tscpaths":"0.0.9","typescript":"4.4.4"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for the isomorphic fetch\n### [Documentation here](https://mihanizm56.github.io/fetch-api/)\n\n### Benefits:\n- Provides validation for responses (based on joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services, https://www.npmjs.com/package/query-string is used)\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in the\n  hard-structured response format\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n- Provides the ability to handle the response progress\n- Provides the ability to select necessary fields from the response (https://github.com/nemtsov/json-mask#readme used)\n- Provides the ability to use persistent params for all requests\n- Provides the ability to retry requests\n- Provides the ability to logging your error requests\n\n#### Request input options:\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by joi <br/>(you must use the joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use joi\n- customTimeout(number) - milliseconds for cancel the request on timeout (or a full package of requests if the \"retry\" parameter is activated) \n- retry - number of requests try to request if the response is negative\n\n#### Request output options:\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n- body will be serialized in JSON if body data NOT FormData\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### Please, be careful. The response will be the object:\n```javascript\n{\n  error: boolean,\n  data: Array<IResponse>,\n  additionalErrors: null,\n  errorText: string,\n  code: number\n}\n```\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n#### Set persist options to all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setResponseTrackCallback(({\n  requestParams, // all request parameters\n  response, //  pure response protected object\n  pureResponseData, // response body without formatting\n  requestError: boolean, // is request crashed\n  formattedResponseData // formatted response data in IResponse interface\n}) => ({\n // do some metrics or logging here\n}));\n```\n\n#### Set callback for metrics for all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setPersistentOptions(() => ({\n  headers: {\n    foo: 'bar',\n  },\n}));\n```","readmeFilename":"README.md","gitHead":"8430ac891c17bad82d4de1977c5fcab057417c3d","_id":"@mihanizm56/fetch-api@3.9.0-beta.8","_nodeVersion":"18.11.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-kcHBu90Nh5CqGB9FijqD95CUB7vw9WEEq+jTM7DGTxY6j8n+/9cH+9Q5qptmpar4+fd6B/rNuQ0oOA2rJshD6w==","shasum":"f5ac3d77309bf009737c22d98d3090da72da5798","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.9.0-beta.8.tgz","fileCount":117,"unpackedSize":253107,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFttqAR+z0rZ37x54SEZjmjNnMJck9CDOV/nXfKo5MMmAiEAiACXZxTiOrqWobfr8K86fnNWdVtKRXtVzZNzp5VWd0U="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjgsB5ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpZAQ//WmpdyMEJIju74HBcHdGcs5d//oeieRByTX8QXVBxQtZz6y67\r\nk+HnPqmAorZls6RxFQ+YQayTsxP4h3lICNuJTAvaSO6+2Bs4PqWu8AGdo7kp\r\nDkEm3JBw6TaXOMKARMee4sLodmOctT/6BTxnBK3RlZIeKX6flfws1kp5lCWu\r\n2a9Je3h1RurLEIEToC9gwrb2Lerf29rGrn9WURXYv9/cVyRSviphmPTrSv6T\r\n9P7aYN+YeAtT4Xx3ohPXd7q0QFtmoQVN+VgnVjPCsW4ZKHgc19gGdKm2EYRG\r\njcYE4aaYtpiJJFJYxu1c5EJTi/Plztn6IfD7Hg72Zn8vPvuHyTnEv3IVVLRx\r\nTFZLsd0+4yk6b4qGWH/IfAjZGoqTQDURtAh/Gu12Mf7xiJRWBZTfS2GO2SAS\r\nxALLx4fP0K7XMZTQ7xZ87lphNOpP5HNiUG3wtave5mJYNYah05hBdIVcUJbh\r\nKv8ZnErOISMHL5J1Etxslc6odSzmeyLmoXVxxFho4Xvv9XNf2HCniYVJD8ul\r\ndxYkRyaESAYu1CshbiCswpcwvpuE6bFHKzYCXmb6tp1Zu+gIZSztlx2l9dyk\r\nrv+IDcPxSNoa2uZffzrNdcCn2ZieAHb8HbACtZ4FoT5u0g4cEkD6FoRFQHm8\r\nKLpHuEjC2lIUfTxVpbXLIMkiUskedwEnXcI=\r\n=MdTa\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.9.0-beta.8_1669513337193_0.3932709968440937"},"_hasShrinkwrap":false},"3.9.0-beta.9":{"name":"@mihanizm56/fetch-api","version":"3.9.0-beta.9","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix --max-warnings=0 --cache --cache-location .eslintinfo","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"7.0.1"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"25.1.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"5.3.0","@typescript-eslint/parser":"5.3.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.4","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"8.2.0","eslint-config-airbnb-base":"15.0.0","eslint-config-prettier":"8.3.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.5.0","eslint-loader":"4.0.2","eslint-plugin-import":"2.25.3","eslint-plugin-prettier":"4.0.0","eslint-plugin-security":"1.4.0","prettier":"2.4.1","express":"4.17.1","husky":"3.0.9","jest":"25.5.4","joi":"17.4.2","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","ts-jest":"25.4.0","tscpaths":"0.0.9","typescript":"4.4.4"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for the isomorphic fetch\n### [Documentation here](https://mihanizm56.github.io/fetch-api/)\n\n### Benefits:\n- Provides validation for responses (based on joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services, https://www.npmjs.com/package/query-string is used)\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in the\n  hard-structured response format\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n- Provides the ability to handle the response progress\n- Provides the ability to select necessary fields from the response (https://github.com/nemtsov/json-mask#readme used)\n- Provides the ability to use persistent params for all requests\n- Provides the ability to retry requests\n- Provides the ability to logging your error requests\n\n#### Request input options:\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by joi <br/>(you must use the joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use joi\n- customTimeout(number) - milliseconds for cancel the request on timeout (or a full package of requests if the \"retry\" parameter is activated) \n- retry - number of requests try to request if the response is negative\n\n#### Request output options:\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n- body will be serialized in JSON if body data NOT FormData\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### Please, be careful. The response will be the object:\n```javascript\n{\n  error: boolean,\n  data: Array<IResponse>,\n  additionalErrors: null,\n  errorText: string,\n  code: number\n}\n```\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n#### Set persist options to all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setResponseTrackCallback(({\n  requestParams, // all request parameters\n  response, //  pure response protected object\n  pureResponseData, // response body without formatting\n  requestError: boolean, // is request crashed\n  formattedResponseData // formatted response data in IResponse interface\n}) => ({\n // do some metrics or logging here\n}));\n```\n\n#### Set callback for metrics for all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setPersistentOptions(() => ({\n  headers: {\n    foo: 'bar',\n  },\n}));\n```","readmeFilename":"README.md","gitHead":"d2b442a659a371a220a6454d5730047df222a2a1","_id":"@mihanizm56/fetch-api@3.9.0-beta.9","_nodeVersion":"18.11.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-R2/3BTYvI78Pggq0tZf4RcJOvweJdTELzEVkim8oQM8b3cwVXE4zNUzonRvTSMrv68Jjy8yKJtkMAHOZR05DYA==","shasum":"801f4a10493439de1efa140ceb06f0dbf14c1a15","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.9.0-beta.9.tgz","fileCount":117,"unpackedSize":253134,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDEG/BCNbS4ZX8bUdG2ngR7sKWgKq89FerUnCXnhFaD4AIgZ6oNrzP+PfqAW+X+mRnoDRfXh/cAKFIflGogKRsGpEk="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjgsD1ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqfSxAAn7OZoYWikCn0LUlmXRVVwCO80kT2/Xt7X1cWoJP88QkGza1n\r\naCpcuc0zgn0NGWIlenZ1Wxw70nW3cCHkR4/1DIlRJQssA7ftItSAwS7KbbGf\r\nQFEtVS2jhcxEvHMQ7bmgg1jWZ+VlrJbpHqCSbprmcG4oXp/L6zsucYYhf4tZ\r\nKiNuiCD4s8Cchr8w7kEYuHkLwChr6v3PzqsO8+K39yxePIG8ERl/c6ZiszGp\r\nw9oJQFw8D5GSwvVj+4aZ26TPfQK+jgvdH9vT2UuUmVNmjLh2Y9ik9SPPskCE\r\niHEWuuQaLy41VTDKQLYDIfGUlmRStKx016SrU4VEQ8vwIvcn1PdJbLa8ZVqa\r\nlcTLjqrW6CV/XuBW7+8gVSW3+C3fgWGHkZz2Ng9QQ8onOS5JetibNgclbFWV\r\nNLEUUK+Vb3cBVUMlhkrFtUI8mG3IS3F7+f2h17JOKl7T6ehwjJGdTGhRgjgd\r\nyTfEa1ia91KbBQnI+sPZlaRbaPs9BxRLRmqnprlg/xNu2gFOhWrFhlRTYjFg\r\nJ9Jj3YVrFjoZakCCZluk7Ru4swElohO4f6+G4oOVwcnEkroc2e2lQIerH6M6\r\no66LHEI9QH7yNxP0haBkF8W6VMFPi9KzhziR0VzhHwpWTM8CTPjF4EWr9u2X\r\n2GR1VEND1SlCsxIMbDNtpgweG96fPvUUSwk=\r\n=FFnZ\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.9.0-beta.9_1669513460772_0.4563954943855162"},"_hasShrinkwrap":false},"3.9.0-beta.10":{"name":"@mihanizm56/fetch-api","version":"3.9.0-beta.10","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix --max-warnings=0 --cache --cache-location .eslintinfo","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"7.0.1"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"25.1.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"5.3.0","@typescript-eslint/parser":"5.3.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.4","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"8.2.0","eslint-config-airbnb-base":"15.0.0","eslint-config-prettier":"8.3.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.5.0","eslint-loader":"4.0.2","eslint-plugin-import":"2.25.3","eslint-plugin-prettier":"4.0.0","eslint-plugin-security":"1.4.0","prettier":"2.4.1","express":"4.17.1","husky":"3.0.9","jest":"25.5.4","joi":"17.4.2","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","ts-jest":"25.4.0","tscpaths":"0.0.9","typescript":"4.4.4"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for the isomorphic fetch\n### [Documentation here](https://mihanizm56.github.io/fetch-api/)\n\n### Benefits:\n- Provides validation for responses (based on joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services, https://www.npmjs.com/package/query-string is used)\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in the\n  hard-structured response format\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n- Provides the ability to handle the response progress\n- Provides the ability to select necessary fields from the response (https://github.com/nemtsov/json-mask#readme used)\n- Provides the ability to use persistent params for all requests\n- Provides the ability to retry requests\n- Provides the ability to logging your error requests\n\n#### Request input options:\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by joi <br/>(you must use the joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use joi\n- customTimeout(number) - milliseconds for cancel the request on timeout (or a full package of requests if the \"retry\" parameter is activated) \n- retry - number of requests try to request if the response is negative\n\n#### Request output options:\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n- body will be serialized in JSON if body data NOT FormData\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### Please, be careful. The response will be the object:\n```javascript\n{\n  error: boolean,\n  data: Array<IResponse>,\n  additionalErrors: null,\n  errorText: string,\n  code: number\n}\n```\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n#### Set persist options to all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setResponseTrackCallback(({\n  requestParams, // all request parameters\n  response, //  pure response protected object\n  pureResponseData, // response body without formatting\n  requestError: boolean, // is request crashed\n  formattedResponseData // formatted response data in IResponse interface\n}) => ({\n // do some metrics or logging here\n}));\n```\n\n#### Set callback for metrics for all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setPersistentOptions(() => ({\n  headers: {\n    foo: 'bar',\n  },\n}));\n```","readmeFilename":"README.md","gitHead":"01fa6a480a301c8f23eabe7817ae119cf8329b2d","_id":"@mihanizm56/fetch-api@3.9.0-beta.10","_nodeVersion":"18.11.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-2jOvdesIruHMfNYJ2NS6cMRI2aSWWECnJ5hbU0nDxCJ5RPrYYDa+hDot6Um5YvQqYP9FxV33NYRoNqHYGKOZ4A==","shasum":"a5f96b283d4176b2ad0725ef57ac6e145d3712c7","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.9.0-beta.10.tgz","fileCount":117,"unpackedSize":253191,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC89UDseqV6zMVrFjxy/TDKXMc+BTmLULAe49G59nJZpAiAo1nZaf4nO6IOnMvE/jb1tFJHegRthXoiWfbfEWEMWUw=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjgsHwACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq+9A/8C2mHH3Oxo17JX3STEeUYY6XXAoKI3P/1TtWOQONykRYDA7Oo\r\nzZIGRj6ElqFeUZrKoEiMCRsyUhNBwJfcaUKZbcP6yY6ECkfVhU/g+VWfOVPV\r\ntkDvghwRaYp6GE/1Wo+cPPmGpkkIBf4WcT1LTcYTi3K5OxciLw6zm/b9Af75\r\nEdjmpg4tfDe5VrU3QusFsEzdzsUXqoOExPJokNUB/1GGPa7D+Bz2TjMKWu/r\r\nNl1aA53E42oWTZPNlf0b2ikP0k/LU91wiDlkgBw8oSZ3YQKQZi2BrImgYUW7\r\nNoFVLxydpAxAZNR4H/LzEQFs5V1tzoq6EMvidh6xXYdcn5EYax+riI/YbshX\r\nuwDYF+jzwigTSXzlsfxiHjGDCAGMnu3zbb4aactkZbH2UQ/e+DEgFQWEk88X\r\necxr2x9FokXu5VGkzX2coQ7jd7fDyvGWUoWwpgd4rvwMAfdpSK0Nk1LrcI2B\r\n+DVgil8/i3IH83k3UCDveK3mI/MgoUCBXz/HET4gwtMhWprrtywyjm7rlDqr\r\nwMWAkfJivbhraJ/M+o75idB1L7cRHW8LLwryNqkCmXYV4BBTTljUyB2mVnw7\r\n9hIhPTtDvorDqQYET+BmWS0f7ZaOB3ROIB/kjE1dpqLy6BEstemZwwgd9qnR\r\nuYDw855OQ3/+OVoBuzHcqyutEaePoTqBek4=\r\n=4CXm\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.9.0-beta.10_1669513712193_0.26291217851940996"},"_hasShrinkwrap":false},"3.9.0-beta.11":{"name":"@mihanizm56/fetch-api","version":"3.9.0-beta.11","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix --max-warnings=0 --cache --cache-location .eslintinfo","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"7.0.1"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"25.1.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"5.3.0","@typescript-eslint/parser":"5.3.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.4","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"8.2.0","eslint-config-airbnb-base":"15.0.0","eslint-config-prettier":"8.3.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.5.0","eslint-loader":"4.0.2","eslint-plugin-import":"2.25.3","eslint-plugin-prettier":"4.0.0","eslint-plugin-security":"1.4.0","prettier":"2.4.1","express":"4.17.1","husky":"3.0.9","jest":"25.5.4","joi":"17.4.2","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","ts-jest":"25.4.0","tscpaths":"0.0.9","typescript":"4.4.4"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for the isomorphic fetch\n### [Documentation here](https://mihanizm56.github.io/fetch-api/)\n\n### Benefits:\n- Provides validation for responses (based on joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services, https://www.npmjs.com/package/query-string is used)\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in the\n  hard-structured response format\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n- Provides the ability to handle the response progress\n- Provides the ability to select necessary fields from the response (https://github.com/nemtsov/json-mask#readme used)\n- Provides the ability to use persistent params for all requests\n- Provides the ability to retry requests\n- Provides the ability to logging your error requests\n\n#### Request input options:\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by joi <br/>(you must use the joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use joi\n- customTimeout(number) - milliseconds for cancel the request on timeout (or a full package of requests if the \"retry\" parameter is activated) \n- retry - number of requests try to request if the response is negative\n\n#### Request output options:\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n- body will be serialized in JSON if body data NOT FormData\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### Please, be careful. The response will be the object:\n```javascript\n{\n  error: boolean,\n  data: Array<IResponse>,\n  additionalErrors: null,\n  errorText: string,\n  code: number\n}\n```\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n#### Set persist options to all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setResponseTrackCallback(({\n  requestParams, // all request parameters\n  response, //  pure response protected object\n  pureResponseData, // response body without formatting\n  requestError: boolean, // is request crashed\n  formattedResponseData // formatted response data in IResponse interface\n}) => ({\n // do some metrics or logging here\n}));\n```\n\n#### Set callback for metrics for all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setPersistentOptions(() => ({\n  headers: {\n    foo: 'bar',\n  },\n}));\n```","readmeFilename":"README.md","gitHead":"9c6c19a64d1e8bf7500337b8c5759e2a48af74a9","_id":"@mihanizm56/fetch-api@3.9.0-beta.11","_nodeVersion":"18.11.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-TCexQl43mPIJbVDhZxCkOVhNlOTcmVEf5VT1LX7Op6QcZYTb9C5joIfXLS9MTHd1FZ8Fu8FSQ5sfOPNUWfqwBw==","shasum":"048467cb7b21217fcc1e91ace7388477af223d2e","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.9.0-beta.11.tgz","fileCount":117,"unpackedSize":253150,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDC0L4NoPjG092nispoyv3DD3ynpnSpInDNBCnemlCivwIhAPrr+SmKmRVFZ5KBoLVKVho577kpwStZxRKmUg+n7H52"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjgsR0ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrzDQ//c2JB1QMsLPPMbW73YlfJiE4681OB7OVAVQFlSPaANWCrd110\r\ni6dU0gDfXY8UlDIR3OIzDY2bTWPQXKeJW2DiYWVLh2a/8mXuu0Nfis1UbjK0\r\nVg8C2ELaIS+0NMA46V7xURmE2tRjN8zSfxpZv3LSP2JbsUh/9BdmrRtEdypZ\r\n/lmqgW6deAJR1AYEo12fzUv5uknOKdCz+93EL3SEhWAIhdkNelq8rORQC2Xu\r\nItzVXqKFTeCqO0ysjpni1Ew0jtZxhR32ElqFurOc2GS1yC0LR78S5pwtbuQ6\r\nGR+dcxEouUzUIbpccLwKgjEE4KVOsLNs8VzD1qPi4gSt+k6CtNghUQyAEfm+\r\nAdgOzfAqkacnWuV0YJgDKNBrlamnqHDgnA2g28KGcT7/wASnvPr9lX1Plsk8\r\nbh5RkyiSrNl2uqyyAlY1qRErH1Mved7d+yYwgn3g4NnJ6MEGg5+DAIN0rVZx\r\nnREjINnZ8l1lS+gWbwIK8p/474zL9CiBWYuOLTPk0G2FGeH9SsjrfweTjgZk\r\n8WQEYDixFG7j9vy986nG3LPdoN/cyab77QD0Cz3XNeyKhBtHAk810gSpkfqd\r\nN/isQEoBJ/ZuTk3HeWl8aBqRc9f6kLgPT+oWo1TSAXckplcfAeeTMmiFgk+n\r\nkJMcTan1GWPm0EJRXyl4p96fxePgxLE2gkk=\r\n=wPAI\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.9.0-beta.11_1669514356450_0.08293929937249556"},"_hasShrinkwrap":false},"3.9.0":{"name":"@mihanizm56/fetch-api","version":"3.9.0","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix --max-warnings=0 --cache --cache-location .eslintinfo","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"7.0.1"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"25.1.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"5.3.0","@typescript-eslint/parser":"5.3.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.4","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"8.2.0","eslint-config-airbnb-base":"15.0.0","eslint-config-prettier":"8.3.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.5.0","eslint-loader":"4.0.2","eslint-plugin-import":"2.25.3","eslint-plugin-prettier":"4.0.0","eslint-plugin-security":"1.4.0","prettier":"2.4.1","express":"4.17.1","husky":"3.0.9","jest":"25.5.4","joi":"17.4.2","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","ts-jest":"25.4.0","tscpaths":"0.0.9","typescript":"4.4.4"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"gitHead":"9ded2a563cb0e4bacde15959d13b0a65a06d5ba9","_id":"@mihanizm56/fetch-api@3.9.0","_nodeVersion":"12.22.12","_npmVersion":"6.14.16","dist":{"integrity":"sha512-EEw7xUbnV/cZoduhh/rMHMkP0pp1jShTEsxY9TbvfutUZrMxYFSEA1wFHyw25n9bCjehqPMvvV8qyaFEphKbbQ==","shasum":"6921b0fd1eac8a966fcf7b2a116e498bed88583a","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.9.0.tgz","fileCount":117,"unpackedSize":253142,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCWx0bD5Mp0CGhRmABZNkvOea+re+1xyK7xfc2uB8qZbgIgYKzgLsm0CHvUIxiuRtB/VR3cpN+P5euYd8Lg0I08JsE="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjg5AfACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqH3A/7B1xCrVrwzPSti8tRHWSpKnfANRkWIXSyZITJdV1YfPUJSBGG\r\n1WH1v/cdsghxrxhhSFEBl3c3pW5FXehauSfAGWWUuDRu9Ibc2wEwSdyJPh57\r\ny9/NS4ZiQF1cpsRGd1hp5TRIJTpt/bTZydqPbtaMpBkqiGdtlfS+ZqBgQfUT\r\nuJFVJ2QdRpIirYoltpTue4pdSK3r/4aQjO7xHodt5juUlNe39ax99b8oe0Vw\r\nNDZb8YyUvhBCLQGXZnUGW+nHaGJu66PhhzWleAmIBVO61mCQPEju/ONRXJKr\r\nVJYo81fb8n5nfK488tS9xOVmg9Tkbcm+kLxh2d0qw6ozDXEhp4tEcI89dK44\r\ng0rchCWRjSlnGMmq1lq4jKXIyXiEhSwICTZTcGcCb9FWhXPC2G5UA/CgZ0u8\r\nWCcd7dZz3M0V/P2enzDSplgKj0u4sX+bfTQwbYb+M7cxFNmp855YwubP6i/0\r\nVmZp4Yz5KUyCexm5IAt6uVd9Z4O42yU9sWvRQgN/80oAFZafwYlXbXIwuxKU\r\nA7A0RW1XmoSxKOPMKqpsqXdvtW6K0cfbRIYZSurp1LOUphVT8AZWC4U24gEy\r\n9XztERcYIZUQZTzJAE4wY43+BmwKNjrzG4RZOBM8b3hHh4FDhiDGLeszvRl8\r\n0tn8rUffAdGh5QDItu6QyPDe0W2F/IbNPQA=\r\n=qV0X\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.9.0_1669566495171_0.6438875934155635"},"_hasShrinkwrap":false},"3.9.1":{"name":"@mihanizm56/fetch-api","version":"3.9.1","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix --max-warnings=0 --cache --cache-location .eslintinfo","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"7.0.1"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"25.1.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"5.3.0","@typescript-eslint/parser":"5.3.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.4","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"8.2.0","eslint-config-airbnb-base":"15.0.0","eslint-config-prettier":"8.3.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.5.0","eslint-loader":"4.0.2","eslint-plugin-import":"2.25.3","eslint-plugin-prettier":"4.0.0","eslint-plugin-security":"1.4.0","prettier":"2.4.1","express":"4.17.1","husky":"3.0.9","jest":"25.5.4","joi":"17.4.2","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","ts-jest":"25.4.0","tscpaths":"0.0.9","typescript":"4.4.4"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"gitHead":"afb2686634ff88e7ebd9c07d7f0dab541eddf10b","_id":"@mihanizm56/fetch-api@3.9.1","_nodeVersion":"12.22.12","_npmVersion":"6.14.16","dist":{"integrity":"sha512-jH7lzaheAR6/XsVLYBu2jiYwcSnNYlcq2+3Kmh1hAzQ28PaCk0ObEVHTqBg5/44gJHNtGuJ64f70JOnskcRobw==","shasum":"da1ebebcd8a3c0e1dfb916b4ded3c06f262482cc","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.9.1.tgz","fileCount":117,"unpackedSize":253355,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCnje6wXj306RxW4vbfMtHiSk4HCWNL2YfV5LEAIDCV8gIhAOsTcxXJOaDXB/TsdurOnXOYd5igQ/IQAnTTLP9lVI7K"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjg589ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqcMw//T6Yi8uvUTXOkdY8DUMfEDJ3X9H/GZygDord2W4tHu0T8KJN/\r\nZn9uPwQKsFDGV2reA/y/xaHXlmrT0PsHWhGwvjCmZjw8oCakFnaTik1R1WLY\r\n3+Lanbt2IWU78GpuFd1YDujoW6+LdfXtT9XjzkOaVz8W+farGBUK0IYEPXrH\r\n7L0d8uzubBBZnzTAaK2dhhKqHlf4wwoiL7zeOT3N8rNZQw//VK1EdkCBl4S+\r\nutQykO85zdO9JBKgvFFgtcks2rrDLGlN4V5+Ispiz01+RJSCX0+yTZrktT6E\r\nS3q8I/yoVbwNsOkvEsfIK99KIYpZm5+9pGZZ7RUezmWbwgWpBwmY5YGEArK2\r\n3PqC90fNSJIf+rOu9O/GaScrEpmCJLCCXREY70JYCaqbtEZdr1hV3RDg9sj0\r\nQeovd3D2eYKBWQVvylpOODet0A0ufUsotQPLmCQSmQQDIyg9rtmKEcJWbBl9\r\n8NRoBrKod2jzVP64775pSqofEhnNsKNqJgItOoy+Cn2v54UJeSiUfCWJRkha\r\ntJmCvDo19AjhooirR0UO4fPcOZKz1rC0NQX2+TFeAjx7Ll2BaC46UwFAYVM+\r\nt1kY8duzdBYstHtCA1CBa2xOt+h+gHUheoJia3GrfbIv1Hfw+adcYaSKeBd3\r\nJzklp8RPWWRcxI7jQkwH2QZvF0ihhp8cWE0=\r\n=jomi\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.9.1_1669570365409_0.3898846937867071"},"_hasShrinkwrap":false},"3.9.2-beta.1":{"name":"@mihanizm56/fetch-api","version":"3.9.2-beta.1","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix --max-warnings=0 --cache --cache-location .eslintinfo","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"7.0.1"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"25.1.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"5.3.0","@typescript-eslint/parser":"5.3.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.4","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"8.2.0","eslint-config-airbnb-base":"15.0.0","eslint-config-prettier":"8.3.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.5.0","eslint-loader":"4.0.2","eslint-plugin-import":"2.25.3","eslint-plugin-prettier":"4.0.0","eslint-plugin-security":"1.4.0","prettier":"2.4.1","express":"4.17.1","husky":"3.0.9","jest":"25.5.4","joi":"17.4.2","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","ts-jest":"25.4.0","tscpaths":"0.0.9","typescript":"4.4.4"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for the isomorphic fetch\n### [Documentation here](https://mihanizm56.github.io/fetch-api/)\n\n### Benefits:\n- Provides validation for responses (based on joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services, https://www.npmjs.com/package/query-string is used)\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in the\n  hard-structured response format\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n- Provides the ability to handle the response progress\n- Provides the ability to select necessary fields from the response (https://github.com/nemtsov/json-mask#readme used)\n- Provides the ability to use persistent params for all requests\n- Provides the ability to retry requests\n- Provides the ability to logging your error requests\n\n#### Request input options:\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by joi <br/>(you must use the joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use joi\n- customTimeout(number) - milliseconds for cancel the request on timeout (or a full package of requests if the \"retry\" parameter is activated) \n- retry - number of requests try to request if the response is negative\n\n#### Request output options:\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n- body will be serialized in JSON if body data NOT FormData\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### Please, be careful. The response will be the object:\n```javascript\n{\n  error: boolean,\n  data: Array<IResponse>,\n  additionalErrors: null,\n  errorText: string,\n  code: number\n}\n```\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n#### Set persist options to all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setResponseTrackCallback(({\n  requestParams, // all request parameters\n  response, //  pure response protected object\n  pureResponseData, // response body without formatting\n  requestError: boolean, // is request crashed\n  formattedResponseData // formatted response data in IResponse interface\n}) => ({\n // do some metrics or logging here\n}));\n```\n\n#### Set callback for metrics for all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setPersistentOptions(() => ({\n  headers: {\n    foo: 'bar',\n  },\n}));\n```","readmeFilename":"README.md","gitHead":"2c38bb92228892ab9f75a69ed54a6f20f8f73e31","_id":"@mihanizm56/fetch-api@3.9.2-beta.1","_nodeVersion":"12.22.12","_npmVersion":"6.14.16","dist":{"integrity":"sha512-Ro5sybO3crukNhsYSxQSz7ZsMARUUFU5YEHxMvAhIxp3RInYfT4Gqsf5SiXzW0vZnwWebUFfxpn2AAKJyxZaWQ==","shasum":"5ed2180ea20547dd5c75999be9825e76ed25b910","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.9.2-beta.1.tgz","fileCount":117,"unpackedSize":253424,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDYe/VMXXi6Am+XT3LU633YjZWBM3LjYnigoOlQd3TMzQIhAJts9SxDZFAlJ8aowSQHbhg+7O6gES6uoUPzVPmeqs/P"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjhTRKACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoZLw//djGlFKP+AycSZW1eIK/2vtoQ32G5QTVU7eKcb9q2xm3wNb7n\r\nPPRHjYtyD+Hte9M+989pcXoFTXsAP16dFf4Qg/XOpTGScRxEGGLvZJqRLShC\r\ns1jetPxXTfbzjaJM4ZQiKDHd78KuJEGD/fWm4suTElSOTMIw3UvvaOiJXK5p\r\nQh2u+whNUHQpaqpehvoIKtdqvUIIazo+ElRNxZ5WYxkmEDPZNkppqBWrh/qE\r\nKGh+EF+14yEwa1Md7USH/cdalKrpaoIks+9N8lNmBx5fF3Fr+Rm2eUhC6mwl\r\ntb1/Kd0bob8U9bSjrzY1fxx302d5ENyzNFMocvbei5nDFN7pULS14gdpsP6a\r\nNQ2O6s8TPXfB7wqRq+fafHEcypE6wZvabvYW+VjgxWE8Pk1FsPOYASqWXglx\r\ngMzTyarbSGNWWIs50kw9tbzTR6HdSQushyaxT7gzLB5+C+mnCdWVRzncZcyd\r\nSNqxKXdfub2C/RFiU4RI7k3gmltz5rqEEvYmd+UC2x0awvlW/QF0Vfbmo0fy\r\n16hRhUQRXnpDmlrH4jlswO78xVvHOTgbmDmOltDaBtBCyBztI383P3I1Z2Hl\r\nHbT5JtTIvvN81oboXnFJYaPwcSYUVDer0XI4dQ6tI0Hn16GAkxyzADTKuiVK\r\na/BBWXY6KdEGoVbbv/rdv4saaEIq2uX4SzM=\r\n=L0vl\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.9.2-beta.1_1669674058137_0.9877524673988061"},"_hasShrinkwrap":false},"3.9.2-beta.2":{"name":"@mihanizm56/fetch-api","version":"3.9.2-beta.2","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix --max-warnings=0 --cache --cache-location .eslintinfo","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"7.0.1"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"25.1.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"5.3.0","@typescript-eslint/parser":"5.3.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.4","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"8.2.0","eslint-config-airbnb-base":"15.0.0","eslint-config-prettier":"8.3.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.5.0","eslint-loader":"4.0.2","eslint-plugin-import":"2.25.3","eslint-plugin-prettier":"4.0.0","eslint-plugin-security":"1.4.0","prettier":"2.4.1","express":"4.17.1","husky":"3.0.9","jest":"25.5.4","joi":"17.4.2","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","ts-jest":"25.4.0","tscpaths":"0.0.9","typescript":"4.4.4"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for the isomorphic fetch\n### [Documentation here](https://mihanizm56.github.io/fetch-api/)\n\n### Benefits:\n- Provides validation for responses (based on joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services, https://www.npmjs.com/package/query-string is used)\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in the\n  hard-structured response format\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n- Provides the ability to handle the response progress\n- Provides the ability to select necessary fields from the response (https://github.com/nemtsov/json-mask#readme used)\n- Provides the ability to use persistent params for all requests\n- Provides the ability to retry requests\n- Provides the ability to logging your error requests\n\n#### Request input options:\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by joi <br/>(you must use the joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use joi\n- customTimeout(number) - milliseconds for cancel the request on timeout (or a full package of requests if the \"retry\" parameter is activated) \n- retry - number of requests try to request if the response is negative\n\n#### Request output options:\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n- body will be serialized in JSON if body data NOT FormData\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### Please, be careful. The response will be the object:\n```javascript\n{\n  error: boolean,\n  data: Array<IResponse>,\n  additionalErrors: null,\n  errorText: string,\n  code: number\n}\n```\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n#### Set persist options to all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setResponseTrackCallback(({\n  requestParams, // all request parameters\n  response, //  pure response protected object\n  pureResponseData, // response body without formatting\n  requestError: boolean, // is request crashed\n  formattedResponseData // formatted response data in IResponse interface\n}) => ({\n // do some metrics or logging here\n}));\n```\n\n#### Set callback for metrics for all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setPersistentOptions(() => ({\n  headers: {\n    foo: 'bar',\n  },\n}));\n```","readmeFilename":"README.md","gitHead":"d0c753b7600d0dec1e377b00e5bf622113c96787","_id":"@mihanizm56/fetch-api@3.9.2-beta.2","_nodeVersion":"12.22.12","_npmVersion":"6.14.16","dist":{"integrity":"sha512-YngSDlMExG84o5GngD8nvy1k/bD7tDpvk8LRZJ7mfVzEi6AgbCSIYZI0h7zPTOPT6pewxeD1PT+W5nL0+v553Q==","shasum":"9fabd4449049f4586e1c4ddc16a6ed6516c8b2a6","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.9.2-beta.2.tgz","fileCount":117,"unpackedSize":255955,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCf3cEFw/nIIvmeETBgU3bnqldqVZbTPjI9hpdCcUmHAgIhALbEhA+zr0Ufp5Zg7KHZ1giqxphHwxB7Tu35njYOGPf+"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjhUGMACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqfYA//RKMN+GXWRN4kS7IZr4585a0ZkDQvaXKVwWNTx/0YyJfcBYud\r\naKj91seiQEMyXr+/1ujE8fLAan9K8Xmh/NbfHmeKcHRhRsewdBmxKgLK9iNX\r\nuYlQ1Xu7uj6nI7kY7vrmYOMdrXS+SVVFGaNw1ae4NCi4c5HzK8Oo0aMwaR6V\r\n6cOmcTj+CebWKI4oj90E6ZCYCjKzlpvY0qGYnfjyd8HbnR4E8zjlzyQ1iTCf\r\nR1uFo68YxXeOmSIZnD9ZbZNgwUaiAqvuELArof4Ei6cILYTjULtKwSGEhXwI\r\n7UHh0PnZPaM/jTAuLmcSxVwEHJYo2eAZ8LAga/21C8F9EL0Rzj36Mnvz6tus\r\nA6IbzG9xRy7nmUCb7OOwXqKwdbLiwc1cWq5yJcAMyQ4fCJlSmyRTq1AnWzeq\r\nACiFPhrJDdQIOFz5/O4yRDvdM41Fw3NQH2yQC+M80zccZPwvVExiFvuncf3w\r\nNzKWyNQ1V9UNrQr7jDyueqmYS2qQN3/ebqiM6JoLTVj0uBOQef8/x7rHsdNB\r\n9CWD7RY0gfFBX/gblEg8WbFFuS5n5lqoXB9+JH/y0SKAVWRLujyQiGSCz1Ee\r\nLutTrmmGRrv9O6OjnXOC1NZkonHlXR9JDiMYR5p5FxjsCRwp5c9eGOKdB67I\r\nZYlaY72Crrgtqf2ev5sF2AvqNXoGs7EbbkQ=\r\n=KK/Q\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.9.2-beta.2_1669677452498_0.2488812136789904"},"_hasShrinkwrap":false},"3.9.2-beta.3":{"name":"@mihanizm56/fetch-api","version":"3.9.2-beta.3","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix --max-warnings=0 --cache --cache-location .eslintinfo","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"7.0.1"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"25.1.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"5.3.0","@typescript-eslint/parser":"5.3.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.4","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"8.2.0","eslint-config-airbnb-base":"15.0.0","eslint-config-prettier":"8.3.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.5.0","eslint-loader":"4.0.2","eslint-plugin-import":"2.25.3","eslint-plugin-prettier":"4.0.0","eslint-plugin-security":"1.4.0","prettier":"2.4.1","express":"4.17.1","husky":"3.0.9","jest":"25.5.4","joi":"17.4.2","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","ts-jest":"25.4.0","tscpaths":"0.0.9","typescript":"4.4.4"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for the isomorphic fetch\n### [Documentation here](https://mihanizm56.github.io/fetch-api/)\n\n### Benefits:\n- Provides validation for responses (based on joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services, https://www.npmjs.com/package/query-string is used)\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in the\n  hard-structured response format\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n- Provides the ability to handle the response progress\n- Provides the ability to select necessary fields from the response (https://github.com/nemtsov/json-mask#readme used)\n- Provides the ability to use persistent params for all requests\n- Provides the ability to retry requests\n- Provides the ability to logging your error requests\n\n#### Request input options:\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by joi <br/>(you must use the joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use joi\n- customTimeout(number) - milliseconds for cancel the request on timeout (or a full package of requests if the \"retry\" parameter is activated) \n- retry - number of requests try to request if the response is negative\n\n#### Request output options:\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n- body will be serialized in JSON if body data NOT FormData\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### Please, be careful. The response will be the object:\n```javascript\n{\n  error: boolean,\n  data: Array<IResponse>,\n  additionalErrors: null,\n  errorText: string,\n  code: number\n}\n```\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n#### Set persist options to all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setResponseTrackCallback(({\n  requestParams, // all request parameters\n  response, //  pure response protected object\n  pureResponseData, // response body without formatting\n  requestError: boolean, // is request crashed\n  formattedResponseData // formatted response data in IResponse interface\n}) => ({\n // do some metrics or logging here\n}));\n```\n\n#### Set callback for metrics for all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setPersistentOptions(() => ({\n  headers: {\n    foo: 'bar',\n  },\n}));\n```","readmeFilename":"README.md","gitHead":"4c31611915afa50aef209ba3945d297170d0d5ac","_id":"@mihanizm56/fetch-api@3.9.2-beta.3","_nodeVersion":"12.22.12","_npmVersion":"6.14.16","dist":{"integrity":"sha512-rmh4jIKb+RqHFY0YyeLJzhSQrm90A7FF8cTeGTHCaQSGRCqQcXfJBE+vz1oaMHucfGOY2e1kEKj8uMcl7VQnEw==","shasum":"b45b13a3b2e145119f7b053a2cb4235513ae3f7b","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.9.2-beta.3.tgz","fileCount":117,"unpackedSize":256117,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDtt8wugLYN5am8TnhXgOyHpJes7XGP4PRPC+u5YCwrKwIgYJF2LHpGUCXUydkK8FYeHVM74mtn71d1UCXyU8tRpOk="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjh4uRACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq0dQ//emQHITmbKXX3y4jTg8m7+52fE7xnD+9sN+WwBpG2FjST8aFr\r\naemB2o64Fuq8uW/yCIX7EVM+kR4HUQH2gka/8Fr6W346Icv0UhRchR3Ao3zw\r\nBKNGlVmez3iyTPnYD3EjM1sT9/UvSe6KG1IWyd/E/2AQre+kB4zmVRrSggRq\r\nnVZ8WTjQ2YP97KzxAdWa5xfqen4ESn5JZpBX2dzFg/Wv7NxpatJxblIbaEJv\r\nfJty/b1paAMRNIBYmJINo9mkCwGowgdZ/HmdgBkyUk7bNhv7Tlmh38KYT0Sx\r\nGYRJks/mn2XkMkGXxh9KRUpv0MK4GcT+hJ0eOaoUHavMRml+7gW7pcBMUiTI\r\nPSd75QHwAWXzApQ0D0h7Ly1s6cuAsB/4ywayeU7dxlYgn6R5OQwYgypaCZSc\r\nT5QXrv7FLftNAgIYxo2WyVhsLI2aVH9gqdECCrh106eT63ywgH0l84UmPCaG\r\nPyJhC/EEGhusCuIjAWlt4RDBi8Xn3edG3GklwDEwmATCLrXuPrxS4790qvf1\r\nc3se+q6WeDE6KjYjsbpiSTppT/lEM6Ryq+2uQmvo2COJ+SD7KcwaRVLSvNWL\r\nyC/FQJchmHxe7fj8wnfguPkz6Mr/aA4e2jWhkRPeUkHG+SVyj3E5ZeopvhPH\r\nzqa+mzAHTGo6x3F6A/LhdBibXKVnsw/j2ZI=\r\n=McCE\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.9.2-beta.3_1669827473229_0.4948048023058933"},"_hasShrinkwrap":false},"3.9.2-beta.4":{"name":"@mihanizm56/fetch-api","version":"3.9.2-beta.4","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix --max-warnings=0 --cache --cache-location .eslintinfo","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"7.0.1"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"25.1.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"5.3.0","@typescript-eslint/parser":"5.3.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.4","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"8.2.0","eslint-config-airbnb-base":"15.0.0","eslint-config-prettier":"8.3.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.5.0","eslint-loader":"4.0.2","eslint-plugin-import":"2.25.3","eslint-plugin-prettier":"4.0.0","eslint-plugin-security":"1.4.0","prettier":"2.4.1","express":"4.17.1","husky":"3.0.9","jest":"25.5.4","joi":"17.4.2","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","ts-jest":"25.4.0","tscpaths":"0.0.9","typescript":"4.4.4"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for the isomorphic fetch\n### [Documentation here](https://mihanizm56.github.io/fetch-api/)\n\n### Benefits:\n- Provides validation for responses (based on joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services, https://www.npmjs.com/package/query-string is used)\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in the\n  hard-structured response format\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n- Provides the ability to handle the response progress\n- Provides the ability to select necessary fields from the response (https://github.com/nemtsov/json-mask#readme used)\n- Provides the ability to use persistent params for all requests\n- Provides the ability to retry requests\n- Provides the ability to logging your error requests\n\n#### Request input options:\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by joi <br/>(you must use the joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use joi\n- customTimeout(number) - milliseconds for cancel the request on timeout (or a full package of requests if the \"retry\" parameter is activated) \n- retry - number of requests try to request if the response is negative\n\n#### Request output options:\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n- body will be serialized in JSON if body data NOT FormData\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### Please, be careful. The response will be the object:\n```javascript\n{\n  error: boolean,\n  data: Array<IResponse>,\n  additionalErrors: null,\n  errorText: string,\n  code: number\n}\n```\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n#### Set persist options to all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setResponseTrackCallback(({\n  requestParams, // all request parameters\n  response, //  pure response protected object\n  pureResponseData, // response body without formatting\n  requestError: boolean, // is request crashed\n  formattedResponseData // formatted response data in IResponse interface\n}) => ({\n // do some metrics or logging here\n}));\n```\n\n#### Set callback for metrics for all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setPersistentOptions(() => ({\n  headers: {\n    foo: 'bar',\n  },\n}));\n```","readmeFilename":"README.md","gitHead":"82b0fec4eb9ed179f6641a0dd7899a0756e6d61f","_id":"@mihanizm56/fetch-api@3.9.2-beta.4","_nodeVersion":"12.22.12","_npmVersion":"6.14.16","dist":{"integrity":"sha512-RW29j2zOXL3uq4w/wnNbbuGMeAccfI05UKoLTqaNQ1nUIv3gGvIJJ5VutUWSz6/fNYCDVqClKIQoFzYNoPzfNw==","shasum":"3e768a06a35a1149282f38404de47f6194969619","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.9.2-beta.4.tgz","fileCount":119,"unpackedSize":260726,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEb70Z8w/JjUcpiuhuaL3tykop5JNJuW2reNRPeJm6DFAiEAt+qc4eb66YRvj3+AvSMOGe7iQaNQT/u0C9hBcslgkgg="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjh6+tACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpVIRAAmDjHM9gYE4lPg+b2aS6Y7M3wgPM/aT7o/rQkGxi56lJSFDaz\r\nro59IZiHb1pCd5KwJ0vKSi2LXyY30UW/4ZojkEfLgtIdrXOxJ2C+UH0LRK22\r\nVBu8BdlKd0mbE8MZnEhgE9TG1C9UXq4fMZaKUw96DHkGTGvLUn9oZfD5EBYz\r\nL0EZ3SnU5FD26y+NFYUIb+9D18ofEEiWxWinWsgF/XOCD9Oa1vZ9CH8NAEUe\r\nCpbLoZTiZFLx2CkQveb5paJyrI5cXDT1nVe/oPAbPoMtcVzqf3tcY2OLcNa3\r\n+oY5IqnuMQ3XL4JjquZ4BGbm+bkgMy3hrDne0oqgcAL9gWA36RmyexH+QYHo\r\ntx/NUSKB8RXm8+32/iUqWHcu3ashon/OuJZrDngXaYj9TL8vC8ErGUqnHix0\r\nHKIKai6fe9XoRw6s2Z7Qc6zVLbIWpnsSzpE0gWZJ9KY5SOLIzjeWG2CYAw92\r\nM5CVoDMam+mSBe+gDmuv+d4i13tYq7FxX4s46j6A4Y2dkkfGCPSTCviz185U\r\nLgqVhZlJ5BQ41uCuVQ+KQs9tp1u4HiixNLZs9+9owbzHlwsroOox9YQyT1g2\r\n/3qdnkEEYBhvtw5sc0wUvITsgRxIUE6Hqqp8beJ1BtJsu0HwXKqTAgfBc7Ae\r\nYTjknHW1iufptMp2tgb8whc5Syg5jebcAms=\r\n=JHTt\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.9.2-beta.4_1669836717620_0.46946562471274156"},"_hasShrinkwrap":false},"3.9.2-beta.5":{"name":"@mihanizm56/fetch-api","version":"3.9.2-beta.5","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix --max-warnings=0 --cache --cache-location .eslintinfo","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"7.0.1"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"25.1.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"5.3.0","@typescript-eslint/parser":"5.3.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.4","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"8.2.0","eslint-config-airbnb-base":"15.0.0","eslint-config-prettier":"8.3.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.5.0","eslint-loader":"4.0.2","eslint-plugin-import":"2.25.3","eslint-plugin-prettier":"4.0.0","eslint-plugin-security":"1.4.0","prettier":"2.4.1","express":"4.17.1","husky":"3.0.9","jest":"25.5.4","joi":"17.4.2","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","ts-jest":"25.4.0","tscpaths":"0.0.9","typescript":"4.4.4"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for the isomorphic fetch\n### [Documentation here](https://mihanizm56.github.io/fetch-api/)\n\n### Benefits:\n- Provides validation for responses (based on joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services, https://www.npmjs.com/package/query-string is used)\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in the\n  hard-structured response format\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n- Provides the ability to handle the response progress\n- Provides the ability to select necessary fields from the response (https://github.com/nemtsov/json-mask#readme used)\n- Provides the ability to use persistent params for all requests\n- Provides the ability to retry requests\n- Provides the ability to logging your error requests\n\n#### Request input options:\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by joi <br/>(you must use the joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use joi\n- customTimeout(number) - milliseconds for cancel the request on timeout (or a full package of requests if the \"retry\" parameter is activated) \n- retry - number of requests try to request if the response is negative\n\n#### Request output options:\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n- body will be serialized in JSON if body data NOT FormData\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### Please, be careful. The response will be the object:\n```javascript\n{\n  error: boolean,\n  data: Array<IResponse>,\n  additionalErrors: null,\n  errorText: string,\n  code: number\n}\n```\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n#### Set persist options to all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setResponseTrackCallback(({\n  requestParams, // all request parameters\n  response, //  pure response protected object\n  pureResponseData, // response body without formatting\n  requestError: boolean, // is request crashed\n  formattedResponseData // formatted response data in IResponse interface\n}) => ({\n // do some metrics or logging here\n}));\n```\n\n#### Set callback for metrics for all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setPersistentOptions(() => ({\n  headers: {\n    foo: 'bar',\n  },\n}));\n```","readmeFilename":"README.md","gitHead":"52f0603513882dc556b891c524d17ce4734b7cbb","_id":"@mihanizm56/fetch-api@3.9.2-beta.5","_nodeVersion":"12.22.12","_npmVersion":"6.14.16","dist":{"integrity":"sha512-f3pR8Oa7VvK4qLjoI0S8rm8DUB6b2tAj4vMcSltbtfVTxSrLZXOuDaf+00bTYih42d9TMTKlQlFKYF7dmd1q+Q==","shasum":"42e718a7abdd8deca82b690550e5e0e1d62a8fdd","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.9.2-beta.5.tgz","fileCount":119,"unpackedSize":261044,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICocKvaJIgg6IKUzjLfeqvaKt16+1qDlfsCmXBDt9HFCAiEA6tj3dqa4qvG2/PisrmSSfiTbtvwRV4pyggKB5+Hnb+I="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjimkVACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoBjQ//QvkmzenFEvQ4KkHkPekyDQp0wGcQzydoapi9CBu7cDVQOipX\r\njY3jPrZ5lE8YRxv8H1fzoE2qvgnvj10+oLKxDNanDsx7myPCArh/51OF++nA\r\nRqMiH2Z3sLnApW30z+04Wg5jVjv2Njc5ZWdYejIs1PoBjotJ8uQ9ne6xKyTy\r\neVisyRZsRQ6X3GrSZ3uUhJkAA5fsh6Mdk3OKnTMLQ+aRCzYRxkEfHs9WVk3c\r\nQRIR/UN6CWi5r/3EJel+99KDUEhXo9ScplLHdAk5+HqhQht0Nog588d+hNgm\r\nzsSiHbfF7E1pHucfFFdIykwFjKMHVVH0DA+le1dkVroKWDmkOJ3CVi7m5siw\r\nKSt2yIjfne4Rzqo/EW28SLsr02C9Bs/H7MFfnFL/XJplkOdJ3hrFRlyjm6Ok\r\nL2NmvRq0SoJrNFk5ieOx4RZTIGq+0hq3Q8Hpw3SEPtBIZG1v4hN6AM3dkvAe\r\n/U2Bf4Bm5yzmrFVKLxAseaoP5AzPNPrINg1g+XyaPWbBvz+GMA9tkTiIj4Qo\r\novITNNL+A0aCJBn9604/8Jrst0OebcPyZFo501uooOhb890j4RAp0dpa3WqD\r\npTJJScf5PEGYGJx0zqp2FyeFryxslX7+IOWb6l3q9vYpvHw0rNuY9GQ9++9w\r\n7c8KWiVYJslqK1l3bhLgugQCUEvq3eIHy1w=\r\n=x57y\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.9.2-beta.5_1670015253595_0.0002340839107455306"},"_hasShrinkwrap":false},"3.9.2-beta.6":{"name":"@mihanizm56/fetch-api","version":"3.9.2-beta.6","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix --max-warnings=0 --cache --cache-location .eslintinfo","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"7.0.1"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"25.1.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"5.3.0","@typescript-eslint/parser":"5.3.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.4","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"8.2.0","eslint-config-airbnb-base":"15.0.0","eslint-config-prettier":"8.3.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.5.0","eslint-loader":"4.0.2","eslint-plugin-import":"2.25.3","eslint-plugin-prettier":"4.0.0","eslint-plugin-security":"1.4.0","prettier":"2.4.1","express":"4.17.1","husky":"3.0.9","jest":"25.5.4","joi":"17.4.2","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","ts-jest":"25.4.0","tscpaths":"0.0.9","typescript":"4.4.4"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for the isomorphic fetch\n### [Documentation here](https://mihanizm56.github.io/fetch-api/)\n\n### Benefits:\n- Provides validation for responses (based on joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services, https://www.npmjs.com/package/query-string is used)\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in the\n  hard-structured response format\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n- Provides the ability to handle the response progress\n- Provides the ability to select necessary fields from the response (https://github.com/nemtsov/json-mask#readme used)\n- Provides the ability to use persistent params for all requests\n- Provides the ability to retry requests\n- Provides the ability to logging your error requests\n\n#### Request input options:\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by joi <br/>(you must use the joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use joi\n- customTimeout(number) - milliseconds for cancel the request on timeout (or a full package of requests if the \"retry\" parameter is activated) \n- retry - number of requests try to request if the response is negative\n\n#### Request output options:\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n- body will be serialized in JSON if body data NOT FormData\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### Please, be careful. The response will be the object:\n```javascript\n{\n  error: boolean,\n  data: Array<IResponse>,\n  additionalErrors: null,\n  errorText: string,\n  code: number\n}\n```\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n#### Set persist options to all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setResponseTrackCallback(({\n  requestParams, // all request parameters\n  response, //  pure response protected object\n  pureResponseData, // response body without formatting\n  requestError: boolean, // is request crashed\n  formattedResponseData // formatted response data in IResponse interface\n}) => ({\n // do some metrics or logging here\n}));\n```\n\n#### Set callback for metrics for all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setPersistentOptions(() => ({\n  headers: {\n    foo: 'bar',\n  },\n}));\n```","readmeFilename":"README.md","gitHead":"9420bc06f84e2b31f643767e05dc0f74c7e0fec6","_id":"@mihanizm56/fetch-api@3.9.2-beta.6","_nodeVersion":"12.22.12","_npmVersion":"6.14.16","dist":{"integrity":"sha512-uund6c5DdXNxv6mTBEgjeqXOUyI7gQM/HgM6FZWxCLP1yiHedDUBDNoSTEu99ZFLSDxPDr6slOp1r/sqyvtAXg==","shasum":"86cc04e43ebbd56f15587cd5b995836c4fc38f83","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.9.2-beta.6.tgz","fileCount":119,"unpackedSize":261462,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGKVnKvP3BDGwPsukaducQiy16DSIqbl5gKp8fSbUbSUAiAfxCYuh5xCuXyedSb5p5H4WmyzQFqjdnFqpU1ShFXUpg=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjinSPACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrCwg/8CAqpZCRMf3eJL+wTgE29eHenPMQGG0hw4xOU1+l5aQGhAPvR\r\nR/BodkRtm8t3XUlfpWEkjSqsb3bCCFnG+kIngs5DxS+tjdRmv57MC0gbGygx\r\nMRV1BJ8uBc/XKDJ055GoW+oK1eur6+PW41IdJHJsHAO3zy0XqorgzgntQ0zs\r\ndLdQRHM52CT9acRmHQIzPXYapChGOfdvC38cS6NH3L1653IOnFs5/4uA0pZH\r\nO7FaAe9ZR6PagIl6VqI9/ZzdxI9dSIn2Z5alS3bb49/qfWCr51En3nwSUo+c\r\nZ65Z0amEpMVbBelF8svkAdQOzTLb6q2LT3aIjC97wF2JUC3rr/9Gr31Ckrsh\r\na+wOA5H78FbvW7pwdnMCqoqrduF3hqdaIv6fvV03bvRWd6GAWE+kiTLqThyg\r\n3+PZcKRVp4OXMv/qHqPtl19wLOZqhYzRhV4AURDalXgvEIzbvDnLy6zIS+DO\r\n53OKz4mMXdsKiWhBnBA55YbPgPwt7ZFMziAShCVuigkzYOzijEG7urdh0Cme\r\nA09Tn5JKnGiHEPLSK86IiGYiucxLiWa54GZahT5TFNhef92Jvq33xnnbGAYA\r\n11lWa62Ryy3MTI04cZ3/h3HLx/ukbbICq4e+BP0nUakx84oKQWKuPNxVa+zE\r\npXf8OH026Q7rkVl2E/lKUtEME0JA9migIr8=\r\n=sxT8\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.9.2-beta.6_1670018190764_0.18176908781645484"},"_hasShrinkwrap":false},"3.9.2-beta.7":{"name":"@mihanizm56/fetch-api","version":"3.9.2-beta.7","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix --max-warnings=0 --cache --cache-location .eslintinfo","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"7.0.1"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"25.1.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"5.3.0","@typescript-eslint/parser":"5.3.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.4","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"8.2.0","eslint-config-airbnb-base":"15.0.0","eslint-config-prettier":"8.3.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.5.0","eslint-loader":"4.0.2","eslint-plugin-import":"2.25.3","eslint-plugin-prettier":"4.0.0","eslint-plugin-security":"1.4.0","prettier":"2.4.1","express":"4.17.1","husky":"3.0.9","jest":"25.5.4","joi":"17.4.2","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","ts-jest":"25.4.0","tscpaths":"0.0.9","typescript":"4.4.4"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for the isomorphic fetch\n### [Documentation here](https://mihanizm56.github.io/fetch-api/)\n\n### Benefits:\n- Provides validation for responses (based on joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services, https://www.npmjs.com/package/query-string is used)\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in the\n  hard-structured response format\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n- Provides the ability to handle the response progress\n- Provides the ability to select necessary fields from the response (https://github.com/nemtsov/json-mask#readme used)\n- Provides the ability to use persistent params for all requests\n- Provides the ability to retry requests\n- Provides the ability to logging your error requests\n\n#### Request input options:\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by joi <br/>(you must use the joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use joi\n- customTimeout(number) - milliseconds for cancel the request on timeout (or a full package of requests if the \"retry\" parameter is activated) \n- retry - number of requests try to request if the response is negative\n\n#### Request output options:\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n- body will be serialized in JSON if body data NOT FormData\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### Please, be careful. The response will be the object:\n```javascript\n{\n  error: boolean,\n  data: Array<IResponse>,\n  additionalErrors: null,\n  errorText: string,\n  code: number\n}\n```\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n#### Set persist options to all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setResponseTrackCallback(({\n  requestParams, // all request parameters\n  response, //  pure response protected object\n  pureResponseData, // response body without formatting\n  requestError: boolean, // is request crashed\n  formattedResponseData // formatted response data in IResponse interface\n}) => ({\n // do some metrics or logging here\n}));\n```\n\n#### Set callback for metrics for all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setPersistentOptions(() => ({\n  headers: {\n    foo: 'bar',\n  },\n}));\n```","readmeFilename":"README.md","gitHead":"ed9426a20942ec87b9af0ade6ba9a0a9c1acf83e","_id":"@mihanizm56/fetch-api@3.9.2-beta.7","_nodeVersion":"12.22.12","_npmVersion":"6.14.16","dist":{"integrity":"sha512-GKl2oxt4cmx4d4SVWXTbNvfCKTXhEWs3YW0oXfdzRiZ7dHxCrpqgBw/2V/Ug7+qJjmkDGyb9J9XASh+7nx+U7A==","shasum":"50ff537fa1d4c7b5ebd31b28f91288d628c866cb","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.9.2-beta.7.tgz","fileCount":119,"unpackedSize":261460,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGHuwTq8c91KgJxRERoi9YBw8ey9i+X1llChGsFb4ZwyAiA1mhvsjE7Dn2PrpsRNHzzhluVBzBBFp42GOOz4xDdJDQ=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjipBYACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoOKA//ScpllBJe6xWwCjBxB6oPNxed69fNGOXqZ/ez0MQP8o/q7cRA\r\nFHeDl0ECP/horPOojCSavj/E4HUbkCw0t0N/4oJAocofttVDr3cypjZds9FD\r\nmrdd5fBuJ7yh5BJ9CRGr/jifsULgNwGQivjEVUD81GzhIgBZY27pyIucfVSt\r\nf0XtY/Y85OnGq8f6aRq46NkXHY1VrxdSKZc/+yMMSlQtJ1aP9oRQrrhMdhFz\r\nUJ05Tbhm1u/yGNQqpVmDHgnH4/lwGM+bBeNr5l8V1AoB3KAmPO7ohGiaGyvn\r\nPWB94w/mtOPvoLfPA5ag+4fP0q1NqrNL3nzfysabO5JEA5VZ6jVi5MQISZLK\r\n1Bs5pNczJdIepd0N99QjFYELqo4EQ8YKvUX65B+MLj2UKIC3eX2gZ6ETRxcl\r\nvrLD86Eb57fD0hcOhPv6yNV21E3QuiTjfp8+2r8n7hl1eppIizGaq/e1PNpR\r\nj/OPJYrHXGPWxdu26yl213FcsTSVrEPDz2QPsJcDKazarsUoSFGKJy5nJTAL\r\nLZgV53fHB/16ihvi4zFdTVrXDurty7tQMqiu/68LJuzK6b+h34Gmf6OH2D7q\r\numk4sJtnD40lnByih5Ls8J6bVVAcocCQk4+t+oGEoZN/uOX7VrSmYNN8ElZV\r\n4rr3ErsV0Qgj2lDHgteumjLadQPEp+bxAic=\r\n=yjBm\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.9.2-beta.7_1670025304636_0.2822216664317465"},"_hasShrinkwrap":false},"3.9.2-beta.8":{"name":"@mihanizm56/fetch-api","version":"3.9.2-beta.8","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix --max-warnings=0 --cache --cache-location .eslintinfo","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"7.0.1"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"25.1.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"5.3.0","@typescript-eslint/parser":"5.3.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.4","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"8.2.0","eslint-config-airbnb-base":"15.0.0","eslint-config-prettier":"8.3.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.5.0","eslint-loader":"4.0.2","eslint-plugin-import":"2.25.3","eslint-plugin-prettier":"4.0.0","eslint-plugin-security":"1.4.0","prettier":"2.4.1","express":"4.17.1","husky":"3.0.9","jest":"25.5.4","joi":"17.4.2","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","ts-jest":"25.4.0","tscpaths":"0.0.9","typescript":"4.4.4"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for the isomorphic fetch\n### [Documentation here](https://mihanizm56.github.io/fetch-api/)\n\n### Benefits:\n- Provides validation for responses (based on joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services, https://www.npmjs.com/package/query-string is used)\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in the\n  hard-structured response format\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n- Provides the ability to handle the response progress\n- Provides the ability to select necessary fields from the response (https://github.com/nemtsov/json-mask#readme used)\n- Provides the ability to use persistent params for all requests\n- Provides the ability to retry requests\n- Provides the ability to logging your error requests\n\n#### Request input options:\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by joi <br/>(you must use the joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use joi\n- customTimeout(number) - milliseconds for cancel the request on timeout (or a full package of requests if the \"retry\" parameter is activated) \n- retry - number of requests try to request if the response is negative\n\n#### Request output options:\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n- body will be serialized in JSON if body data NOT FormData\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### Please, be careful. The response will be the object:\n```javascript\n{\n  error: boolean,\n  data: Array<IResponse>,\n  additionalErrors: null,\n  errorText: string,\n  code: number\n}\n```\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n#### Set persist options to all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setResponseTrackCallback(({\n  requestParams, // all request parameters\n  response, //  pure response protected object\n  pureResponseData, // response body without formatting\n  requestError: boolean, // is request crashed\n  formattedResponseData // formatted response data in IResponse interface\n}) => ({\n // do some metrics or logging here\n}));\n```\n\n#### Set callback for metrics for all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setPersistentOptions(() => ({\n  headers: {\n    foo: 'bar',\n  },\n}));\n```","readmeFilename":"README.md","gitHead":"d0dd0b8aeaf54d6103d7bb19a503067418a393af","_id":"@mihanizm56/fetch-api@3.9.2-beta.8","_nodeVersion":"12.22.12","_npmVersion":"6.14.16","dist":{"integrity":"sha512-F9+lzVsr09anNwRyrGdodbbYr2BYT80jvlFmLRBYI1nK62B2J+uMESuOTEMZSMBQ3Z6VRhAVpa8xlkxAsOTPEA==","shasum":"7315818cfc8cc70787df05b11134b77b57db571f","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.9.2-beta.8.tgz","fileCount":119,"unpackedSize":261510,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAkx1dbJ4Y7SE4h7u2+R1wOvHfaUaLTRn8Q9zd8gChNPAiEApDD6yBfna3YpwVk1nzcYJv6giGAA5rY/Ehz2/08nsqQ="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjipTdACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmprpg/5ATJLjkg59GAVJClDgKaGU4hQ3fBOvc0FL2Sj7NoZHYhsK/T3\r\niNRnukSxU+Vw45cHk8I28tcIKUYM5AdBWmY6V3WMJ3zly2/MU9Kawkpmdq4m\r\n9Ia3qjO39dKEL+DFdrVNEtsDtafGRa06r1/xxleWSH4Ckk9ucSs2z1H9Ztgo\r\nZbgtkpld7neH2voZzxER6YszDU2i/njLkj+1jV1dkIJLL/H8yzVv+8+vezUp\r\nO5JSyuQnqNfDRNPN7f9HvAOk9ojcZzzcI3rsoJ6SpigX7wpy2DNdoNoVemp/\r\n0JytqUUgCLZ6uqER/lrD7tFcZvIQvjy2sjpk+8xfQnUSko/HJfCx1keBS39e\r\nomG0uviJAk7zBzMymvaZQAVj54vSTtzvL/IHthaYx9MrShecgaCca6igPbMz\r\n1kd1rJhiHoBNaMMmS0JEHMqT24E/qIkbWgENL6ZLa8rMPKmwPAwAKwQ4q/wQ\r\nlLSFEMjVbFj6eOgAq3kVkO2Z3apy9ZCOHeoKDE95HQhpR4yscQTIAiSXftMh\r\nHiIbZrx535tHEBRg0lZPJIdx7x1Vkephqwc6OXzyku/9NKrqYav3wMlbSoqU\r\nmm/gt96wVxbzonUPK/DnA6tjg0Ij3fssTNXyMxUKYGG6HY9P3uHdBf/fawOa\r\ndhYPXIJh7z7k9VwyOsV9AM9/H/xJvubf4Ko=\r\n=qSdV\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.9.2-beta.8_1670026461426_0.7419712735047004"},"_hasShrinkwrap":false},"3.9.2-beta.9":{"name":"@mihanizm56/fetch-api","version":"3.9.2-beta.9","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix --max-warnings=0 --cache --cache-location .eslintinfo","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"7.0.1"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"25.1.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"5.3.0","@typescript-eslint/parser":"5.3.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.4","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"8.2.0","eslint-config-airbnb-base":"15.0.0","eslint-config-prettier":"8.3.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.5.0","eslint-loader":"4.0.2","eslint-plugin-import":"2.25.3","eslint-plugin-prettier":"4.0.0","eslint-plugin-security":"1.4.0","prettier":"2.4.1","express":"4.17.1","husky":"3.0.9","jest":"25.5.4","joi":"17.4.2","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","ts-jest":"25.4.0","tscpaths":"0.0.9","typescript":"4.4.4"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for the isomorphic fetch\n### [Documentation here](https://mihanizm56.github.io/fetch-api/)\n\n### Benefits:\n- Provides validation for responses (based on joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services, https://www.npmjs.com/package/query-string is used)\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in the\n  hard-structured response format\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n- Provides the ability to handle the response progress\n- Provides the ability to select necessary fields from the response (https://github.com/nemtsov/json-mask#readme used)\n- Provides the ability to use persistent params for all requests\n- Provides the ability to retry requests\n- Provides the ability to logging your error requests\n\n#### Request input options:\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by joi <br/>(you must use the joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use joi\n- customTimeout(number) - milliseconds for cancel the request on timeout (or a full package of requests if the \"retry\" parameter is activated) \n- retry - number of requests try to request if the response is negative\n\n#### Request output options:\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n- body will be serialized in JSON if body data NOT FormData\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### Please, be careful. The response will be the object:\n```javascript\n{\n  error: boolean,\n  data: Array<IResponse>,\n  additionalErrors: null,\n  errorText: string,\n  code: number\n}\n```\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n#### Set persist options to all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setResponseTrackCallback(({\n  requestParams, // all request parameters\n  response, //  pure response protected object\n  pureResponseData, // response body without formatting\n  requestError: boolean, // is request crashed\n  formattedResponseData // formatted response data in IResponse interface\n}) => ({\n // do some metrics or logging here\n}));\n```\n\n#### Set callback for metrics for all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setPersistentOptions(() => ({\n  headers: {\n    foo: 'bar',\n  },\n}));\n```","readmeFilename":"README.md","gitHead":"6f088d84758cfee6c200af267815d4e99d2d819c","_id":"@mihanizm56/fetch-api@3.9.2-beta.9","_nodeVersion":"12.22.12","_npmVersion":"6.14.16","dist":{"integrity":"sha512-f2V00xcPVehZ72Wxtu/7Q/sCiuMANBLYhKYp99Z5uVbB1RyAj0GnqhSPJkQxteP+C8Z6YN8b+p23LgcQtmtAZA==","shasum":"b87990db979c0d0fa938c629d501171cc651ebc4","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.9.2-beta.9.tgz","fileCount":119,"unpackedSize":263985,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFIik5sObdv46wX9sXGRPNHdxpj8Pv7AjlOUOFH5XF0WAiBpY4WCHC7rpldfi2E/WZov26g4gF/fW8UaLqTF+9EclQ=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjkHGJACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq28g/9G6ebmY/IqqdOiPbUifaKP0KDENRHnusrGCLrbNpvMRty8xas\r\nx26YZizwjCGsm3iWkmLi8fT+p+sXH42ee727NCx7MAl2LGwoPecmem5298dk\r\nGpdiycGsNiCT9p5CXV6i4QucgxPAjdJlX+G8YYjwdD5q1XFjBYN65Qc6K6qD\r\nH8+xke4QbjzrBgqUAYmUiAfDVWNoFuPJy+RaFpjAtabA4p6bIf4HieZpr/Ga\r\nivoXookdkZbTFB3PC5MUUaIFy7tYe2lg9Kfvh7raIh0N0u0svgG4Td/EvyfL\r\njlPlaFIXjZoUHsA3VLWuj667umYohpb3EDZ8H2PxcAV4crPSn3BYBULPzKoM\r\nIIIAQET8xjTpjQNyP2eCbq4lgzcpxJRyFa3diNV6styvHim+ArIx58V8Swp/\r\nEy2LoR394X1kt6phdS0Aln7bL443sMUKbt7olpDjHRtpRGhN4ZEpy70IaR4l\r\nVkIqcSU4A8ZufsLKbfnQbkCmnHsoecOry5yabjiDwKmKf6Oi/EuqgpldOH+k\r\nkZyKcGttMBmfe6pS+HSKB50KPs/AXuYtBHtvAMgnv8RFda09N9DM9KATAIFK\r\nVRdeyUcj0OI/LLitxIs2cDBjhYszyDAVuBCjubG5PtlJ9iSxxTSWHWd3ORnR\r\nXa1Ne/+C3ms1ThRy3PgSeqSrOangQX7FvBQ=\r\n=6RTs\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.9.2-beta.9_1670410633674_0.46775146993970496"},"_hasShrinkwrap":false},"3.9.2-beta.10":{"name":"@mihanizm56/fetch-api","version":"3.9.2-beta.10","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix --max-warnings=0 --cache --cache-location .eslintinfo","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"7.0.1"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"25.1.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"5.3.0","@typescript-eslint/parser":"5.3.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.4","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"8.2.0","eslint-config-airbnb-base":"15.0.0","eslint-config-prettier":"8.3.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.5.0","eslint-loader":"4.0.2","eslint-plugin-import":"2.25.3","eslint-plugin-prettier":"4.0.0","eslint-plugin-security":"1.4.0","prettier":"2.4.1","express":"4.17.1","husky":"3.0.9","jest":"25.5.4","joi":"17.4.2","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","ts-jest":"25.4.0","tscpaths":"0.0.9","typescript":"4.4.4"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for the isomorphic fetch\n### [Documentation here](https://mihanizm56.github.io/fetch-api/)\n\n### Benefits:\n- Provides validation for responses (based on joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services, https://www.npmjs.com/package/query-string is used)\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in the\n  hard-structured response format\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n- Provides the ability to handle the response progress\n- Provides the ability to select necessary fields from the response (https://github.com/nemtsov/json-mask#readme used)\n- Provides the ability to use persistent params for all requests\n- Provides the ability to retry requests\n- Provides the ability to logging your error requests\n\n#### Request input options:\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by joi <br/>(you must use the joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use joi\n- customTimeout(number) - milliseconds for cancel the request on timeout (or a full package of requests if the \"retry\" parameter is activated) \n- retry - number of requests try to request if the response is negative\n\n#### Request output options:\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n- body will be serialized in JSON if body data NOT FormData\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### Please, be careful. The response will be the object:\n```javascript\n{\n  error: boolean,\n  data: Array<IResponse>,\n  additionalErrors: null,\n  errorText: string,\n  code: number\n}\n```\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n#### Set persist options to all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setResponseTrackCallback(({\n  requestParams, // all request parameters\n  response, //  pure response protected object\n  pureResponseData, // response body without formatting\n  requestError: boolean, // is request crashed\n  formattedResponseData // formatted response data in IResponse interface\n}) => ({\n // do some metrics or logging here\n}));\n```\n\n#### Set callback for metrics for all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setPersistentOptions(() => ({\n  headers: {\n    foo: 'bar',\n  },\n}));\n```","readmeFilename":"README.md","gitHead":"1656a0298090ab5ac4a4e173274d869db1678552","_id":"@mihanizm56/fetch-api@3.9.2-beta.10","_nodeVersion":"12.22.12","_npmVersion":"6.14.16","dist":{"integrity":"sha512-lq77piCaiPgXE+1QJbgx9VloJyJGmIu3GXRTYN/OEF5p5EpXPQEl9L5MPNGKMsgQFjcEzUkoxVs3mLGkRFXlCA==","shasum":"bea8dc043cf3d950ffac31c32cd2d5de1a3b45e5","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.9.2-beta.10.tgz","fileCount":119,"unpackedSize":264854,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC75sZSao9PFDOG2ZN7aAAfjlymOzbbVL43x0a9SwAtnQIhAIlOuRNfbwGUgduUu2ey11+LF1FrssnI1+VwCG6VKUdF"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjkMmQACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpjVA/7Bqw+jTWYzSqUCpm+SulP5f3Uey48YXQDLfPgQoueeZXP6sdl\r\nTHnhL9YQ3axlnkP4joWshAhOJZw01Klb1gpj+ai8MbiUjH3mr1bkqnboRiAD\r\nxWPXZBNScdEFGYYvZRvNJBTb8jWOUMYai6P0kxEA2kCkpZbQs2OR/f8sjzbH\r\navKPPlYPBNDG0EPPtSg6gGh45MHnOAccrZEPPjQiL0Z5Rdpt7mSsnjQnrU+9\r\nXkOAg74KsMWsbo5XdG6vw4bLL4bbokATwAdU+jbi1XTnYCznxV8UoDFf/iAy\r\nOz/f7fVgXpLj/5jUgqJa9MStRmlqsKBgwhFLSinTm2JgJS/0wbvtgUiIIdNJ\r\nKg2rERH7tYe2BQytWTK7bOLKLAMShXUyTxdOk1bbL0tlg3rvAizVkzAx/t58\r\n0+NRp/p7MsyW7RlI0v/1E+EvQeq+qeUOAru9YWQjLA07ZwkZxa9D1xSTFbPW\r\nx0FcG0PKTvhu9r1uKP1Rc0V04P96nWl/xw5d8Zj5BJUgMuKQwvMTUrTpN9ub\r\nFUA/OLdK+juaYuhMWNV7sTAMlEMUE3kKge6MzUJTX3Rd9FJx8YFKPvUXd93m\r\nScB4w18viuN4A05dT1Zus5/rjFTd86F9syjP6/WxyTAStFLRnDonxVvh7Mm+\r\nbwA1+moQJs01Mh7WFUYGjySBB7yVU3+q6MA=\r\n=NjO9\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.9.2-beta.10_1670433168105_0.2716574858423608"},"_hasShrinkwrap":false},"3.9.2-beta.11":{"name":"@mihanizm56/fetch-api","version":"3.9.2-beta.11","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix --max-warnings=0 --cache --cache-location .eslintinfo","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"7.0.1"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"25.1.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"5.3.0","@typescript-eslint/parser":"5.3.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.4","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"8.2.0","eslint-config-airbnb-base":"15.0.0","eslint-config-prettier":"8.3.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.5.0","eslint-loader":"4.0.2","eslint-plugin-import":"2.25.3","eslint-plugin-prettier":"4.0.0","eslint-plugin-security":"1.4.0","prettier":"2.4.1","express":"4.17.1","husky":"3.0.9","jest":"25.5.4","joi":"17.4.2","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","ts-jest":"25.4.0","tscpaths":"0.0.9","typescript":"4.4.4"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for the isomorphic fetch\n### [Documentation here](https://mihanizm56.github.io/fetch-api/)\n\n### Benefits:\n- Provides validation for responses (based on joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services, https://www.npmjs.com/package/query-string is used)\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in the\n  hard-structured response format\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n- Provides the ability to handle the response progress\n- Provides the ability to select necessary fields from the response (https://github.com/nemtsov/json-mask#readme used)\n- Provides the ability to use persistent params for all requests\n- Provides the ability to retry requests\n- Provides the ability to logging your error requests\n\n#### Request input options:\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by joi <br/>(you must use the joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use joi\n- customTimeout(number) - milliseconds for cancel the request on timeout (or a full package of requests if the \"retry\" parameter is activated) \n- retry - number of requests try to request if the response is negative\n\n#### Request output options:\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n- body will be serialized in JSON if body data NOT FormData\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### Please, be careful. The response will be the object:\n```javascript\n{\n  error: boolean,\n  data: Array<IResponse>,\n  additionalErrors: null,\n  errorText: string,\n  code: number\n}\n```\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n#### Set persist options to all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setResponseTrackCallback(({\n  requestParams, // all request parameters\n  response, //  pure response protected object\n  pureResponseData, // response body without formatting\n  requestError: boolean, // is request crashed\n  formattedResponseData // formatted response data in IResponse interface\n}) => ({\n // do some metrics or logging here\n}));\n```\n\n#### Set callback for metrics for all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setPersistentOptions(() => ({\n  headers: {\n    foo: 'bar',\n  },\n}));\n```","readmeFilename":"README.md","gitHead":"e710548eac562b06a4fc5a6d51affdf9f24fe750","_id":"@mihanizm56/fetch-api@3.9.2-beta.11","_nodeVersion":"12.22.12","_npmVersion":"6.14.16","dist":{"integrity":"sha512-EwuWbAZSONDGsm3ozKD1ltpDSNnTWL0F98dGg0AD765YloU/AGwXWGAsUdT+bzPXEOIgnyI0GCxZY6Xmy2ToUw==","shasum":"b7a5a42d659e9392ab26bb301b27131f0b5e4a42","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.9.2-beta.11.tgz","fileCount":119,"unpackedSize":265794,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQChK1Ilh9RYm2Yz5Xr1GCedj49NxYUjbq/zXsEygCNdLQIhAKWbBK2RcO6eOk4EPkJ6+bito+SRXtwM5jwrIo/v5FYy"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjkQopACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp09RAAkrVJMJZBKG1HYK+BLCfENH6izr8s2cy8SZtEziP5NnNxdffw\r\nOQ5XFLP/PIqCcA7Vs57jjP/00GhXxj+P7qmPF+e6YevHdSke6Ood9ypTnF1W\r\nLS65iiTAZmrZomSh2hYPXwEpYQ8xzNsMtzC3sZbgQ/UghaFKfAhZ4Tv1+I8q\r\nGaQe7QneYFPB4xYsYfATXxLCOHsKMqtTRuKxrFCeqYgwWGj51VkPpixxAM0P\r\n8x3ZQE9w2HMpTzktuRK8MZHM65XEAs3FBD23wZ1kC4Zuwk/ot7nv26VSaOrv\r\nojKraffm6RPc55TeGXNlp7JuIUmlWxSNobv7CudIr4MU7Ef0EMazXdOdw+wr\r\nXHPknc5LH800l19PG7GkHUxGnbsT9IDuIaGu88/gAtMVA6zpmltownf+JXkm\r\nNfyVYuFgaNC2PgYf3jQS+W50Xhy+3TJWIDet4D4WMFTrPsoRqyu3Zf4ZDvGh\r\nBfvAqTbXqFxxVR3Dnpa51Fh/CJf2WP2qMv3Y5cusbHUnot/sCU+HXNrDt0l1\r\nPiy64eogG1dtuG0nxF4JJxde+Q9gMlvmq3Sv2JOKdKhcEuIZ7o8hNez1EJhx\r\nAkXMGogSF/PCnGTLlWPn7Hp5fkqb2pVkR1viX9WrNzMUUvB626GlpPGTfuMa\r\n+kIwwQ4+zV1tbtgcoEuTONlDL9A6dFciXZs=\r\n=T3mK\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.9.2-beta.11_1670449705696_0.7031223108508655"},"_hasShrinkwrap":false},"3.9.2-beta.12":{"name":"@mihanizm56/fetch-api","version":"3.9.2-beta.12","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix --max-warnings=0 --cache --cache-location .eslintinfo","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"7.0.1"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"25.1.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"5.3.0","@typescript-eslint/parser":"5.3.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.4","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"8.2.0","eslint-config-airbnb-base":"15.0.0","eslint-config-prettier":"8.3.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.5.0","eslint-loader":"4.0.2","eslint-plugin-import":"2.25.3","eslint-plugin-prettier":"4.0.0","eslint-plugin-security":"1.4.0","prettier":"2.4.1","express":"4.17.1","husky":"3.0.9","jest":"25.5.4","joi":"17.4.2","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","ts-jest":"25.4.0","tscpaths":"0.0.9","typescript":"4.4.4"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for the isomorphic fetch\n### [Documentation here](https://mihanizm56.github.io/fetch-api/)\n\n### Benefits:\n- Provides validation for responses (based on joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services, https://www.npmjs.com/package/query-string is used)\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in the\n  hard-structured response format\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n- Provides the ability to handle the response progress\n- Provides the ability to select necessary fields from the response (https://github.com/nemtsov/json-mask#readme used)\n- Provides the ability to use persistent params for all requests\n- Provides the ability to retry requests\n- Provides the ability to logging your error requests\n\n#### Request input options:\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by joi <br/>(you must use the joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use joi\n- customTimeout(number) - milliseconds for cancel the request on timeout (or a full package of requests if the \"retry\" parameter is activated) \n- retry - number of requests try to request if the response is negative\n\n#### Request output options:\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n- body will be serialized in JSON if body data NOT FormData\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### Please, be careful. The response will be the object:\n```javascript\n{\n  error: boolean,\n  data: Array<IResponse>,\n  additionalErrors: null,\n  errorText: string,\n  code: number\n}\n```\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n#### Set persist options to all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setResponseTrackCallback(({\n  requestParams, // all request parameters\n  response, //  pure response protected object\n  pureResponseData, // response body without formatting\n  requestError: boolean, // is request crashed\n  formattedResponseData // formatted response data in IResponse interface\n}) => ({\n // do some metrics or logging here\n}));\n```\n\n#### Set callback for metrics for all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setPersistentOptions(() => ({\n  headers: {\n    foo: 'bar',\n  },\n}));\n```","readmeFilename":"README.md","gitHead":"5701dca6c546110a4045f46fd3e85f3aca8bac60","_id":"@mihanizm56/fetch-api@3.9.2-beta.12","_nodeVersion":"12.22.12","_npmVersion":"6.14.16","dist":{"integrity":"sha512-P8Ak2b8kPkEVJLaWX6Mpa+4AmrkQw9LLNzr8SycxqN0Co4P6fQE/uuHk7i1n5jvYzChJXYf5w74YKuJhojG8qA==","shasum":"d08b71b49efe3af3dbc15d58baa14aa32bfe6a2b","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.9.2-beta.12.tgz","fileCount":119,"unpackedSize":266349,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCdz76hhL+MU1iWdWANw2eQ2LF74TQnFwzCOIehikBM1QIgDb3UscGHNZBVF87AWtfMhQEyOZBG3IN5bpcVZbjwN/E="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjkQyEACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmobNA//Wg/MZhvPmCDlKWlLA/md9KEo+OipBQvxR617xsfnIxNUFnjv\r\nTCPm4/TUl4TGvDaw7gPupmXXBadYFeiPIp6OMtLCBzfeOKoWaFApw8n6Fcd7\r\nG+9Sor7sJcrcNI5YaB0jGHF7eDKmOVeshFnwmfxZLLCH7UIP0VLlDPVVzbW6\r\naLADiqXDpYBGVsb5f0tIAHvNWTfAaZGHKQjDCJ0nzxhyx4UvDBIzNkt8OmHi\r\nFYQRhaVpKtbz2VrhX15nEnM78/CNYhIFs7R/1eXCaUZ8e7ol/HAn00f0pUsh\r\nuP0vECf9pV0zXpRUE092ahN26t0MX6fkAu1LIyEwHf/WHI9N4X1AiHAfRLna\r\nDHhP+8MmKoxlrikQz7WX8/wqHf5bVZ5QD1QkI47pURJJZx2oXPoJiIPt3OAO\r\nHt8IoQOwM7tQbVzATo4gBSFTyLtDdCkfFW56YWCcKWT6Qi72b5EEV/R0eFWE\r\nZAZrrPxIe4g47XR8ry/AAQ+CyGXuNZHejXZ+aqDYh2Vt177wqcafXo2t0xd8\r\nEt46ULMZEtM8YQkj2/ac0WFblT7yB/0to0N7wls/v0zMFzlIClTnDSY7yS5e\r\n/7iJN5IVTYbdp4wmrYhi8Hf4K8HjWX1ziWdUkjnUFd2buzApIWy7LQvMKB+u\r\nTlceOvrpf732bmC9PLznPUcD1k6Qp5P6a/k=\r\n=gfdd\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.9.2-beta.12_1670450307845_0.44800108316823106"},"_hasShrinkwrap":false},"3.9.2-beta.13":{"name":"@mihanizm56/fetch-api","version":"3.9.2-beta.13","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix --max-warnings=0 --cache --cache-location .eslintinfo","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"7.0.1"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"25.1.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"5.3.0","@typescript-eslint/parser":"5.3.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.4","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"8.2.0","eslint-config-airbnb-base":"15.0.0","eslint-config-prettier":"8.3.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.5.0","eslint-loader":"4.0.2","eslint-plugin-import":"2.25.3","eslint-plugin-prettier":"4.0.0","eslint-plugin-security":"1.4.0","prettier":"2.4.1","express":"4.17.1","husky":"3.0.9","jest":"25.5.4","joi":"17.4.2","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","ts-jest":"25.4.0","tscpaths":"0.0.9","typescript":"4.4.4"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for the isomorphic fetch\n### [Documentation here](https://mihanizm56.github.io/fetch-api/)\n\n### Benefits:\n- Provides validation for responses (based on joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services, https://www.npmjs.com/package/query-string is used)\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in the\n  hard-structured response format\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n- Provides the ability to handle the response progress\n- Provides the ability to select necessary fields from the response (https://github.com/nemtsov/json-mask#readme used)\n- Provides the ability to use persistent params for all requests\n- Provides the ability to retry requests\n- Provides the ability to logging your error requests\n\n#### Request input options:\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by joi <br/>(you must use the joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use joi\n- customTimeout(number) - milliseconds for cancel the request on timeout (or a full package of requests if the \"retry\" parameter is activated) \n- retry - number of requests try to request if the response is negative\n\n#### Request output options:\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n- body will be serialized in JSON if body data NOT FormData\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### Please, be careful. The response will be the object:\n```javascript\n{\n  error: boolean,\n  data: Array<IResponse>,\n  additionalErrors: null,\n  errorText: string,\n  code: number\n}\n```\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n#### Set persist options to all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setResponseTrackCallback(({\n  requestParams, // all request parameters\n  response, //  pure response protected object\n  pureResponseData, // response body without formatting\n  requestError: boolean, // is request crashed\n  formattedResponseData // formatted response data in IResponse interface\n}) => ({\n // do some metrics or logging here\n}));\n```\n\n#### Set callback for metrics for all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setPersistentOptions(() => ({\n  headers: {\n    foo: 'bar',\n  },\n}));\n```","readmeFilename":"README.md","gitHead":"7b93daac77c6c190a1f98fa867b0b6ba06a20fca","_id":"@mihanizm56/fetch-api@3.9.2-beta.13","_nodeVersion":"12.22.12","_npmVersion":"6.14.16","dist":{"integrity":"sha512-faODjp67Og2WrN1cvtPdtBKcIf6QWdRs2t+ZIvM99w6AGBm1uyN8vmy9c2VFNthS0Wn4A0d/91yW+iajPu4NiQ==","shasum":"04ba1cc87859803a7cb3511f0b54c9fb0393cd64","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.9.2-beta.13.tgz","fileCount":119,"unpackedSize":266833,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD9nR9YvaX/bZXP3Gt4tIY4KV/hVX6vIGfTp/F+RbyK1AIgfO5JcDda82xyf/mjWGx6mr8vQ5qPR3bd4QwLNX0dO8c="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjkgMLACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmod1g/+Pt5q12PeUHbrFJywARtZwfqfgI7ZZdlqHF4L/egLIs6AdLcy\r\nNXH3EG3azF83gSmheNbZqwKx1b54mZZSGh31zYQGZHL2XZcPAhP3LRtOfyMZ\r\nvtSz0lij0NY7aPkbmCI2I/0b/hgQ0oA9g8l+rq9Nvl1XPqfAmrsHJ3cIOjRh\r\nIo0ghcabasV4TD7xqBzuUOiK8Ip0ooJD+uP4h6uwlpsEd27FCgx5VodCD1Y5\r\nkCCCNlxgv+AoPujSYpD7fer4SqsEgO7PZMP+klXAnmdNxkxnTCV3B4A2mFrm\r\nxZmZLMyFiYHkhUlbOx0nOx7eZEmAhkRmaDxTaJK15jeeO2vzmWwxUwBLGzXR\r\nkVzmRGjcy7YP7tgNbRApHeDGlnCnbd4yMexMwO4QYrugZC3i0OyfVSbd/oUH\r\nBTnabd8Mzh85ljL1Lg5ua8mFYozJltCDTRKhuWu0uE3JSpddAyef7l7uKpo8\r\nBeF4Q8gbXvD9G2C9ARznNA8OJUTP6A4ox5p7o+gNJZHOMJfRO0JT+sud2Ehe\r\nG4oeGVJVO4unZl2j4cO3ZGaer/ovd11Xe33GU5pmxmBHKcWHcgSYPBMxZW+V\r\nG13DrW/2lNoxWu0+gW1zPs89bxFp4u7FBXhj8WnT5OxVyqY9IlXCV0iGCJIN\r\nlo9DPDBWgHm6P0AvZx40cZO+cwL3p9Ktvm0=\r\n=4RYw\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.9.2-beta.13_1670513419418_0.505188896781434"},"_hasShrinkwrap":false},"3.9.2":{"name":"@mihanizm56/fetch-api","version":"3.9.2","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix --max-warnings=0 --cache --cache-location .eslintinfo","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"7.0.1"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"25.1.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"5.3.0","@typescript-eslint/parser":"5.3.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.4","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"8.2.0","eslint-config-airbnb-base":"15.0.0","eslint-config-prettier":"8.3.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.5.0","eslint-loader":"4.0.2","eslint-plugin-import":"2.25.3","eslint-plugin-prettier":"4.0.0","eslint-plugin-security":"1.4.0","prettier":"2.4.1","express":"4.17.1","husky":"3.0.9","jest":"25.5.4","joi":"17.4.2","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","ts-jest":"25.4.0","tscpaths":"0.0.9","typescript":"4.4.4"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"gitHead":"89af628f1f0f992078e2addb0b13babdb103d7b0","_id":"@mihanizm56/fetch-api@3.9.2","_nodeVersion":"12.22.12","_npmVersion":"6.14.16","dist":{"integrity":"sha512-K68K0Jox8TDxXsxRgbic8R8hGr/8lfCNKSWZidnz/meiu6p+6epSj3u6DBEzVAkh5KaY9Isf8Topumo+EFCdUw==","shasum":"14efb73f3dbd8e47d5ecd0bea2878f0dcfd8c229","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.9.2.tgz","fileCount":119,"unpackedSize":266825,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFUVGEmIFUiZcEGELSK6jjznJpJPjV/plbSfB1kDGZFaAiBYDy3cdlqP3jZo4IbtILBSY8JOMusEgBSupI3WFvgGJQ=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjmeeCACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmojtQ/9EJ35Wcd/99ssgRGL4onRrD2oJlUxbeQPzWL8XnuOPpqtZoG5\r\nwjRQjaZIshHXJGojrFTo6CHOedjY8jydelnKAiLcTNtTimM1YtEN6AS+EI+4\r\nBfb+hUtliXXQZmzOJzhvFJ42+rJIPUgZ/gXMktS+hKsUIdUfWqwEjWhUr2DT\r\nqYrskh71M5c77JP0ky0e81XG8KiaeDV6ue2BspoY4lUvpGlg++d+xtb6eIzc\r\nBDbyOA08ByoxmiVieJxULbparmjKPzsXLxc42dBRCjwx2mBlEZopmPg6MP4Q\r\n/nY7BJ5U3LI5KjBBdBPXFsXc7MhQgOc08g1g4MfpWYciekM4aaYaR2Gmc+St\r\nt+q1tdz865UULeiqyBrfDOL3g/wMiTnvm9vij7Z3AmxjgA86bzLtIVeriKN1\r\nbc5VcVJoQTkTO51mkK0QUFls3d/4BY4EW2dQzLMtLIJKvzftsvjWyrL0l9MQ\r\n5TO2GnfjaJoXsg/B1EbCaCKwg0kadXMLGiJjqxPhj9VJGjVnsg/p4P3wQpsr\r\nMb9wi8dLRLv2ZljQTA/KrCCnRBNXwup8URvWvTag7SFZv6lGqsgPhPrF+RvC\r\n7Rov9RGbCMTdyyMKEPUbVUOSCbfDzcfIK/eK5QlmrMxe9VfUrNDFgjSdfibf\r\na608TOwJo3w+dt+eIsKPjpbtmpnLcUPx5yQ=\r\n=JSRJ\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.9.2_1671030658628_0.29455050313448017"},"_hasShrinkwrap":false},"3.9.3-beta.1":{"name":"@mihanizm56/fetch-api","version":"3.9.3-beta.1","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix --max-warnings=0 --cache --cache-location .eslintinfo","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"7.0.1"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"25.1.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"5.3.0","@typescript-eslint/parser":"5.3.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.4","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"8.2.0","eslint-config-airbnb-base":"15.0.0","eslint-config-prettier":"8.3.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.5.0","eslint-loader":"4.0.2","eslint-plugin-import":"2.25.3","eslint-plugin-prettier":"4.0.0","eslint-plugin-security":"1.4.0","prettier":"2.4.1","express":"4.17.1","husky":"3.0.9","jest":"25.5.4","joi":"17.4.2","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","ts-jest":"25.4.0","tscpaths":"0.0.9","typescript":"4.4.4"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"gitHead":"1ab75d9cf2c9130299c1b7454ce6140a08e79180","_id":"@mihanizm56/fetch-api@3.9.3-beta.1","_nodeVersion":"12.22.12","_npmVersion":"6.14.16","dist":{"integrity":"sha512-dtePLi4tINHcQdc7wh51ZscutjVT6OqpLl7QzR/sBU6IlcSbiWWbqZQ7xLT3N1FcgkPG4m3CvbJBLzQxudgTBA==","shasum":"5ef2334a9870b9b29e71db2a5307fdb44c3bd6cf","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.9.3-beta.1.tgz","fileCount":119,"unpackedSize":267365,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDbzo3X8LwK07pyMTboEDE9e5HsCTu5JZwx0mHXq+XMjAIhAMCGlv3DtzX65Sd8LuOj3w5r8tkjRr9dq+pDPOYYVGvW"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjmfx2ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpg6Q//TzSNOSzwjlNx7Z2SFbBEqFxKr0+VoJwfxfJo8ZGQBvt7GYT2\r\nfCqEcF+Dii4jYMOE5Kj30y1bibkr9PyHqALr8pO64Jzc+aWOU+5TeTI8Icds\r\nI/Lhi+OWBP6eCnwfa0Z+MSWIbgt4Tq2F+UJK2dJw+9oz+EaJx6OibYsfndAL\r\nPv4mmY8X3j2ShcFS8KXVpArjzG7b3+l2F4+VUYEFa3lhx+LWaOqSw1aCz4Mw\r\n51fXhrv5jiL1VvXoi7KdTns43EaX9YOIhD20D9eRu6VJ1XvdTtAemVGu+Qig\r\nNzqPyGT6z5by2sP25bTegeMs/VFkIBUCgVDToqd86/mFEFj4W02+PjfQ9t0g\r\nm3TYPg1vRLK+walgGYKjGDz8IG3dIGXBtJZ4IPHDiqmfS9S7dKWJHMrKqAVb\r\nynbEA1phOEHKVtReqjV+5g80H8SI8Rdp4rOrfJaNL0Xti1+02/M3MsQfKcph\r\n6u/M6wik8Bl0fHAP8OuWzi3T1Kh3MhNN8eZi4GEuO5DxCPGvM3QePzK3RbL7\r\nu0pZJQ0cXEzuHEtzPwNkwNv+hwEC5BPYB9qAeT47N4+RxSwDRYeAdp737DBf\r\ncIWTszXLILHD1P0a8WGDtg3sf9M73jPN2keiIpY4SJJ0axzX4AxigtEcM4Y/\r\nuC9Lypg+ehhMIM0+Pr6DmOBejQtA+AKI558=\r\n=bCWN\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.9.3-beta.1_1671036021901_0.1701100918813916"},"_hasShrinkwrap":false},"3.9.3-beta.2":{"name":"@mihanizm56/fetch-api","version":"3.9.3-beta.2","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix --max-warnings=0 --cache --cache-location .eslintinfo","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"7.0.1"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"25.1.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"5.3.0","@typescript-eslint/parser":"5.3.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.4","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"8.2.0","eslint-config-airbnb-base":"15.0.0","eslint-config-prettier":"8.3.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.5.0","eslint-loader":"4.0.2","eslint-plugin-import":"2.25.3","eslint-plugin-prettier":"4.0.0","eslint-plugin-security":"1.4.0","prettier":"2.4.1","express":"4.17.1","husky":"3.0.9","jest":"25.5.4","joi":"17.4.2","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","ts-jest":"25.4.0","tscpaths":"0.0.9","typescript":"4.4.4"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for the isomorphic fetch\n### [Documentation here](https://mihanizm56.github.io/fetch-api/)\n\n### Benefits:\n- Provides validation for responses (based on joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services, https://www.npmjs.com/package/query-string is used)\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in the\n  hard-structured response format\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n- Provides the ability to handle the response progress\n- Provides the ability to select necessary fields from the response (https://github.com/nemtsov/json-mask#readme used)\n- Provides the ability to use persistent params for all requests\n- Provides the ability to retry requests\n- Provides the ability to logging your error requests\n\n#### Request input options:\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by joi <br/>(you must use the joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use joi\n- customTimeout(number) - milliseconds for cancel the request on timeout (or a full package of requests if the \"retry\" parameter is activated) \n- retry - number of requests try to request if the response is negative\n\n#### Request output options:\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n- body will be serialized in JSON if body data NOT FormData\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### Please, be careful. The response will be the object:\n```javascript\n{\n  error: boolean,\n  data: Array<IResponse>,\n  additionalErrors: null,\n  errorText: string,\n  code: number\n}\n```\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n#### Set persist options to all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setResponseTrackCallback(({\n  requestParams, // all request parameters\n  response, //  pure response protected object\n  pureResponseData, // response body without formatting\n  requestError: boolean, // is request crashed\n  formattedResponseData // formatted response data in IResponse interface\n}) => ({\n // do some metrics or logging here\n}));\n```\n\n#### Set callback for metrics for all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setPersistentOptions(() => ({\n  headers: {\n    foo: 'bar',\n  },\n}));\n```","readmeFilename":"README.md","gitHead":"264c3a1d8e9a9c0ac84b6000263eb4bf553cc4f7","_id":"@mihanizm56/fetch-api@3.9.3-beta.2","_nodeVersion":"12.22.12","_npmVersion":"6.14.16","dist":{"integrity":"sha512-9ChNMDZ/ANYIkmV2ez635aiY+NXfWTsc3iHKMHho+vUEAisLbseo+EJrax2LT/Ec0lP/pnX/rRrz+T2jidgLRQ==","shasum":"ea2ba5b459405cc19ea85b7eed3d9d66f7d80ca1","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.9.3-beta.2.tgz","fileCount":119,"unpackedSize":266965,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC5gmZxUyIHgmIyhx9L3g4GdlyEDOw8ZHRiO5pQx9Im8gIgOWt3U9ALLZComlO98MJSKg1WoiQBh75UZCeKNVDZULk="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjmj1JACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpXJxAAgAv0/j+nXVllRcORY3O4zYITywaJFJBtPOjImrxNldFvTs8U\r\nVb3GcDwuw7qrgO0At4jO/RxTWYA61RXGY3gLZqqWMDXsI8tMbYlCU2JIRTxG\r\nRGo7vnBfTQzu+Huq9V0HhGd+axhEs5x+PgLFilG1giNLSjE3PwDi97DPpM78\r\nKINyjZN5M990rmfqSAnd2STuR5JOPocfMdquxLAmjvO2OG7fBbkZidZcS4Fl\r\nF0AzDwKeR9r5rRI6UPRlIIMAVNUYWdcldkjMpXjLG13zYvyHefzfiisQxPte\r\nk0/Q0vRxGhxoBHAlDLbKHzFQ6bD3hDCD1grFGrkkmH8E2ZTJa43kntFEtbYS\r\nCFvvhboLuslX1cEQBUTYF3LoecjVn7tsRI7bT9EYUvxdRUzH21p0co3JyJDd\r\nSLY2imPvQefp4KR096xrRh2zL/IqO8c/63zWk+w3SoMdSF+v/DxDyjGqcqji\r\nSSlSej9GdUjZxIc3cBfMpFuoDpN47mGBw/sQRSIsnr0j4lPI9GFEyAj5HZle\r\ng1/j+nbS8hMBM5tzMh2gnDQeD3lTRa8HFopZjmaBcbaZ7n4vbkTqQ+rH6xjI\r\nhpC+6E0nYvtIXMWm04dJdTo++9Jyeh+vifdQNlsT7o9dmmmwvkknTnZL862l\r\n7wSRQcHZQBv36x9LdxbXvvRvnVrjlNplb2U=\r\n=frCI\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.9.3-beta.2_1671052617646_0.25505738855146554"},"_hasShrinkwrap":false},"3.9.3":{"name":"@mihanizm56/fetch-api","version":"3.9.3","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix --max-warnings=0 --cache --cache-location .eslintinfo","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"7.0.1"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"25.1.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"5.3.0","@typescript-eslint/parser":"5.3.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.4","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"8.2.0","eslint-config-airbnb-base":"15.0.0","eslint-config-prettier":"8.3.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.5.0","eslint-loader":"4.0.2","eslint-plugin-import":"2.25.3","eslint-plugin-prettier":"4.0.0","eslint-plugin-security":"1.4.0","prettier":"2.4.1","express":"4.17.1","husky":"3.0.9","jest":"25.5.4","joi":"17.4.2","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","ts-jest":"25.4.0","tscpaths":"0.0.9","typescript":"4.4.4"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"gitHead":"d69bb87bc78a28732232b93b5439fa655678b11a","_id":"@mihanizm56/fetch-api@3.9.3","_nodeVersion":"12.22.12","_npmVersion":"6.14.16","dist":{"integrity":"sha512-/c6x6ZM04p0/23fhgz4VRrYfAnFl23KcCuW7j1/LdI0FAOlM1T+AYBKe4Cx3rnoZVP4VwQ5kVAbcMLhk89HkSA==","shasum":"7759c217c1b8f04c4f9275eecd3e5b2c4cc0a975","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.9.3.tgz","fileCount":119,"unpackedSize":266958,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFrdiR2RD3HvVNjn7Fr8IEiiOiH5r5d4zb29lInk610TAiA/HetKl45X6D+YlTuj66qBHJb1MFfMA5Cv7WcKjG24BA=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjoEJGACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoYQQ/+LmBQZR6uINuq+oj/2gP2Kw6PTPopRjb4MZkdAGzUKsmrD2Ke\r\nBV0a0fJ4/JdsHH5w19/x020z488zbyKOod6G5qQrTdfVEMI4sn1+ovgh1LLB\r\nqwP2l2LkZGvIpA4k0UU07mlnHPg65zwanK049rp0V98Bywr0j6hm+FWNQTAx\r\nKpYing3ZNo9bB1MKYvKfnUEXyQusgKK71nQ4JLfitaC8gkQkuPf+A5n/jWfD\r\noC6M4iN5ZcmE3QBoO+vzSyPtRiT4MndgBkUEZRSkkn2+ao7XuMDXhO9UIjs5\r\nCXVRP+hcqtJBGf1WPXGjt2esxTLJLczwEsc0aYdvwhP0OMMCVgs/UhGQ0Iwg\r\nHtBUkpLVo0J8IW+STgbKrhAtl3FJUSQkvk3Wx3FSC4JupNyFBkMi/UhivOu0\r\nYvcpLLbcdv+/EakpX8b78TuuZA3qcQ7E3MIHoGeG8JZRR5nMzJHRxIHhjZIV\r\nenR53917BEUGhKFhGrQjS16aDpZlfKClKKVYmSAvI0z1Q6RribiORRd2ykRe\r\nRse23Q7BbDuYLB7DFecloH8bLmpz4DTvLm//fFp+fF5bYWLDo1hUtN5EraQt\r\n/4kx5TKpYMlPCzfy+uyuE8abHVB4zoK2NYaWr3fu9TG+ucjIQn9Z4VZeOe5U\r\nTzfskxk4xP9uAyOc43BmLxwnjlQLxro9CD4=\r\n=lS4W\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.9.3_1671447110592_0.8251809250691096"},"_hasShrinkwrap":false},"3.9.4-beta.1":{"name":"@mihanizm56/fetch-api","version":"3.9.4-beta.1","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix --max-warnings=0 --cache --cache-location .eslintinfo","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"7.0.1"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"25.1.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"5.3.0","@typescript-eslint/parser":"5.3.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.4","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"8.2.0","eslint-config-airbnb-base":"15.0.0","eslint-config-prettier":"8.3.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.5.0","eslint-loader":"4.0.2","eslint-plugin-import":"2.25.3","eslint-plugin-prettier":"4.0.0","eslint-plugin-security":"1.4.0","prettier":"2.4.1","express":"4.17.1","husky":"3.0.9","jest":"25.5.4","joi":"17.4.2","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","ts-jest":"25.4.0","tscpaths":"0.0.9","typescript":"4.4.4"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for the isomorphic fetch\n### [Documentation here](https://mihanizm56.github.io/fetch-api/)\n\n### Benefits:\n- Provides validation for responses (based on joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services, https://www.npmjs.com/package/query-string is used)\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in the\n  hard-structured response format\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n- Provides the ability to handle the response progress\n- Provides the ability to select necessary fields from the response (https://github.com/nemtsov/json-mask#readme used)\n- Provides the ability to use persistent params for all requests\n- Provides the ability to retry requests\n- Provides the ability to logging your error requests\n\n#### Request input options:\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by joi <br/>(you must use the joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use joi\n- customTimeout(number) - milliseconds for cancel the request on timeout (or a full package of requests if the \"retry\" parameter is activated) \n- retry - number of requests try to request if the response is negative\n\n#### Request output options:\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n- body will be serialized in JSON if body data NOT FormData\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### Please, be careful. The response will be the object:\n```javascript\n{\n  error: boolean,\n  data: Array<IResponse>,\n  additionalErrors: null,\n  errorText: string,\n  code: number\n}\n```\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n#### Set persist options to all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setResponseTrackCallback(({\n  requestParams, // all request parameters\n  response, //  pure response protected object\n  pureResponseData, // response body without formatting\n  requestError: boolean, // is request crashed\n  formattedResponseData // formatted response data in IResponse interface\n}) => ({\n // do some metrics or logging here\n}));\n```\n\n#### Set callback for metrics for all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setPersistentOptions(() => ({\n  headers: {\n    foo: 'bar',\n  },\n}));\n```","readmeFilename":"README.md","gitHead":"4a07c2e18540e28ec4d9186c16297ca466fc90de","_id":"@mihanizm56/fetch-api@3.9.4-beta.1","_nodeVersion":"12.22.12","_npmVersion":"6.14.16","dist":{"integrity":"sha512-4ShC+y7Z8IU+1gBAMec/DgqUa+2vVxO3EEBYQ/+XWWw0oX5P894ncs9IhHgDSWw0U13w9WKRddyIC7WuxO/sJA==","shasum":"13a3a127778babbf304f2448c9fb3f24de26d7ca","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.9.4-beta.1.tgz","fileCount":119,"unpackedSize":267069,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCppoTP6MxoZ0fZUKb+zdC4vs2FKnehbT089QRMNgKSvQIgNW6qC96JfD7r8/cVZH9CMRwdGWWFNxqc1q5D4xPJhdI="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjoJKKACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqQbBAAjmEX/fhzEoBKhb3gUps+XFazs6Kl4Gg2HMyNPOW2VAo5JxIN\r\nbKeqAjg8tm65eCWaTEbDnMrecZrw72N5pUEmz1hOtEj0e1L1Y8VN5mWyPin6\r\n5mzH9R2kQMW5+GYL8S1XU+KcZGVF1uERw15Wfuj5HmpAc7eMJht0cmhAsQwS\r\nDjY3IXJGahEVHPLfN4MGRGzVFVbo1AhnnwuDf6oVOuoztnyM6+KpgNTOCyFO\r\nLBsugmzbesbECPOxxIlN7INYrZA6v68BJLFJoJd01zzHRfUGeJGKlCfW1EkG\r\nsB46rAmTT1omjoyUXd/5BYlEYaHOWlQIRnokkQ7T6didvTrDumm/8yBHOx/h\r\n6mZT6BIv1uiRC/a+JMkiLP909ffz91MnZneZxTEhh8rR9He9bL9Yp6THD2OU\r\nCD5UOfKmtyN65oHrjbzMjZHgUj6bFWfBBVh0TPLxZcQlCSFfPRnbLpjJ3SDB\r\nJplVZFkepY6n4sFwpooNCUKUQTHNKjbVs1mJ7MJaIiSEIv81GXYlapyoiNmM\r\n/s2vcMyM65zMYBfUCQNwIxa2lx8OTqng6GiafJYxzKvXuf3GFXEsGkpvvdWv\r\ncyiviKeGMf+Sl16yzP/GRaYox9LUl9/bdqAi+i1lPQJEyzR1KrOkcxP+BT4A\r\n4BAJAsDfGrWxwdDw87YSgBrbKB7skSAsG8o=\r\n=5QP2\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.9.4-beta.1_1671467658449_0.4305457416042744"},"_hasShrinkwrap":false},"3.9.4-beta.2":{"name":"@mihanizm56/fetch-api","version":"3.9.4-beta.2","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix --max-warnings=0 --cache --cache-location .eslintinfo","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"7.0.1"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"25.1.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"5.3.0","@typescript-eslint/parser":"5.3.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.4","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"8.2.0","eslint-config-airbnb-base":"15.0.0","eslint-config-prettier":"8.3.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.5.0","eslint-loader":"4.0.2","eslint-plugin-import":"2.25.3","eslint-plugin-prettier":"4.0.0","eslint-plugin-security":"1.4.0","prettier":"2.4.1","express":"4.17.1","husky":"3.0.9","jest":"25.5.4","joi":"17.4.2","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","ts-jest":"25.4.0","tscpaths":"0.0.9","typescript":"4.4.4"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for the isomorphic fetch\n### [Documentation here](https://mihanizm56.github.io/fetch-api/)\n\n### Benefits:\n- Provides validation for responses (based on joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services, https://www.npmjs.com/package/query-string is used)\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in the\n  hard-structured response format\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n- Provides the ability to handle the response progress\n- Provides the ability to select necessary fields from the response (https://github.com/nemtsov/json-mask#readme used)\n- Provides the ability to use persistent params for all requests\n- Provides the ability to retry requests\n- Provides the ability to logging your error requests\n\n#### Request input options:\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by joi <br/>(you must use the joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use joi\n- customTimeout(number) - milliseconds for cancel the request on timeout (or a full package of requests if the \"retry\" parameter is activated) \n- retry - number of requests try to request if the response is negative\n\n#### Request output options:\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n- body will be serialized in JSON if body data NOT FormData\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### Please, be careful. The response will be the object:\n```javascript\n{\n  error: boolean,\n  data: Array<IResponse>,\n  additionalErrors: null,\n  errorText: string,\n  code: number\n}\n```\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n#### Set persist options to all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setResponseTrackCallback(({\n  requestParams, // all request parameters\n  response, //  pure response protected object\n  pureResponseData, // response body without formatting\n  requestError: boolean, // is request crashed\n  formattedResponseData // formatted response data in IResponse interface\n}) => ({\n // do some metrics or logging here\n}));\n```\n\n#### Set callback for metrics for all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setPersistentOptions(() => ({\n  headers: {\n    foo: 'bar',\n  },\n}));\n```","readmeFilename":"README.md","gitHead":"dc1cd67c0f54a348d5732fef2aa1b581ee54f67c","_id":"@mihanizm56/fetch-api@3.9.4-beta.2","_nodeVersion":"12.22.12","_npmVersion":"6.14.16","dist":{"integrity":"sha512-v5flt03rLI28OPDlJDBErD53o3CcpEXumWS1Sw2hP9eVIqdPP3el7OOJJY4L09T4UTpUHL1Sddri379/bGohyQ==","shasum":"a0b63680e11a72f5011f84fe21f810aa5891ec66","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.9.4-beta.2.tgz","fileCount":123,"unpackedSize":282395,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGAauq9y2DXPxnd2NkjuZx6bfYzYBiQlctovqCugFnudAiBlJfHm8m2OcFAQpbZg3LGXriCzNnIDhvlPUBLf+Ap9yQ=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjpJ2mACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmojqQ//d65a00DDoSWPUlWdzfAzwJJNgFhBVBjBcpspogyh2OBTQpWH\r\ne7BvwGo5YV9qToRoMQxYM4UtqMPgbR9MpHK8EO7CefGHLh+XKBu7ir6VJMeC\r\noz4i8AYKW3I9+SAyKXvFlvGHPHoE97O4jWpY2t0ILQT69CZMafjnXeZFPzFo\r\nsI7OXoiPYsqtuAl+Dlh6T1Gu0Xlk0AdzbRw/IC+o2fLqrYGehmiUbbuAm0Hs\r\nlt9ZnxKlt/2LjeaYZ+vziLgr1tWY2JrP60iY3AGUbvFJjTcmiWGqxFQ5m21i\r\n7aFjsinJbfs5JBSnK7c0s6Dm915nMfYmJWBYdANZ4NCqb2KBU00vaPXX9eL5\r\nRPD7H1u2jTv6lKf1NZLCyWrMvLV5haDqyPS6vyKYgKki8eKd/af0g4qGIwRS\r\n06mNBd0LtwfiE70y7OkQAsxCkch51DMumM5OjuhTAIwpFzisNAAkmCn1mTu3\r\nhCAnfNTwjN9gJrcejs5BBD6IppTJgI5lNMt4hY8/4AUX+0BoFeXLAnGrsGVc\r\nrC/WLsHIqHEpd+YQkA+uKVT1LDqKGubB3U8kvmOkzeVBqVCxjEWkqXdeqfxu\r\ncdg/DEl0cqEqVfCD6kmtXaaFtiHD+UI/r589fKmtBCVZt/hCB6lY7Z89bqPb\r\nluEchfCdrF6hT9J11sPb4eBjd7EnyFGYttk=\r\n=hqyB\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.9.4-beta.2_1671732646636_0.2595302692324186"},"_hasShrinkwrap":false},"3.9.4-beta.3":{"name":"@mihanizm56/fetch-api","version":"3.9.4-beta.3","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix --max-warnings=0 --cache --cache-location .eslintinfo","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"7.0.1"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"25.1.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"5.3.0","@typescript-eslint/parser":"5.3.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.4","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"8.2.0","eslint-config-airbnb-base":"15.0.0","eslint-config-prettier":"8.3.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.5.0","eslint-loader":"4.0.2","eslint-plugin-import":"2.25.3","eslint-plugin-prettier":"4.0.0","eslint-plugin-security":"1.4.0","prettier":"2.4.1","express":"4.17.1","husky":"3.0.9","jest":"25.5.4","joi":"17.4.2","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","ts-jest":"25.4.0","tscpaths":"0.0.9","typescript":"4.4.4"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for the isomorphic fetch\n### [Documentation here](https://mihanizm56.github.io/fetch-api/)\n\n### Benefits:\n- Provides validation for responses (based on joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services, https://www.npmjs.com/package/query-string is used)\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in the\n  hard-structured response format\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n- Provides the ability to handle the response progress\n- Provides the ability to select necessary fields from the response (https://github.com/nemtsov/json-mask#readme used)\n- Provides the ability to use persistent params for all requests\n- Provides the ability to retry requests\n- Provides the ability to logging your error requests\n\n#### Request input options:\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by joi <br/>(you must use the joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use joi\n- customTimeout(number) - milliseconds for cancel the request on timeout (or a full package of requests if the \"retry\" parameter is activated) \n- retry - number of requests try to request if the response is negative\n\n#### Request output options:\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n- body will be serialized in JSON if body data NOT FormData\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### Please, be careful. The response will be the object:\n```javascript\n{\n  error: boolean,\n  data: Array<IResponse>,\n  additionalErrors: null,\n  errorText: string,\n  code: number\n}\n```\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n#### Set persist options to all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setResponseTrackCallback(({\n  requestParams, // all request parameters\n  response, //  pure response protected object\n  pureResponseData, // response body without formatting\n  requestError: boolean, // is request crashed\n  formattedResponseData // formatted response data in IResponse interface\n}) => ({\n // do some metrics or logging here\n}));\n```\n\n#### Set callback for metrics for all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setPersistentOptions(() => ({\n  headers: {\n    foo: 'bar',\n  },\n}));\n```","readmeFilename":"README.md","gitHead":"30fd87007987399bea926fdcd7529737a1f8ab7b","_id":"@mihanizm56/fetch-api@3.9.4-beta.3","_nodeVersion":"12.22.12","_npmVersion":"6.14.16","dist":{"integrity":"sha512-RdFcxxWS1Asp5ndBrotHdoBs6iTeUY+wtCu+AATowftLmXhI58IUdJ9HDQCIN9/hR27lPtos7cmYtD9nY0XY0g==","shasum":"6b62159c6d6c85b40f2a0afc841360518e410ba4","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.9.4-beta.3.tgz","fileCount":123,"unpackedSize":284962,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDaYW7ohvzcTrho5w0SwNNvo1lh8IbQhu5PX15DhfH7lwIgCLQHu++JLbssWtQuUXcWD0wcINd7xBeO+YGlBIlNqII="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjpPj+ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo38w/6AhNajL8+nabsPKaczYw2Mwdxbo10JEShjxyYxKtEukGq/PtH\r\nmwZToj1Aex3uhYA/eVQWuLqVikn8E+2KE0tMPrld65o72DzkP7BsPidQHw9M\r\nBY8FfHlIAV6jz1GMLZgE0yxXoIV7IP1bI10ZYXoeuuPnBBHPz+m7FAHDLEjR\r\nPKhhgP73J3eTv/G990OoIeFRdPjLFB1SGYxSr/vh4sAQVNmWluFLlkUaZm92\r\ncvTt/Td6If236FJr7zQzz7UBKH0jci31kWFxHiTQzDR7XvvuVwTkjMAlrOes\r\nBNgV9GQBeQ9hEgp1r5kL8gHNSQfp01v8ORqWxLzVhqoUR5nOL3rmiuoStPq2\r\n7pFkrz9pOH5qcjVGYcBuPqF3HnZ99aqecjwXA7+MiFgyGAKIZ7moJhntbkIx\r\nuK9H56Eb6Y5jNPi1jzAQyWAxuAg05exUomqCFjA5+av2Q8EMGvXzsXmOg4Do\r\nmIV/8WZaCYXRdLiRTYgKs8kLPPCEKBgTKZMMb+jzsZ3PuOi9LSvAgTew6bHv\r\nmgWi3NnDbCl4gNoZMyj/rpf/0VrbhJqEUE1LPJyXTXDprmADnl68ds9lu/dn\r\nLVNz28ev2aAdMHCLyRNJfz1UpGvS9nqtvaj3nbX8WEb0nxYFT+mOS3nfgyrJ\r\n21rszI3+yBLHR9BSYFVQ6rfPuOYetkLA1vo=\r\n=KCpf\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.9.4-beta.3_1671756030801_0.6118253591071299"},"_hasShrinkwrap":false},"3.9.4-beta.4":{"name":"@mihanizm56/fetch-api","version":"3.9.4-beta.4","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix --max-warnings=0 --cache --cache-location .eslintinfo","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"7.0.1"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"25.1.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"5.3.0","@typescript-eslint/parser":"5.3.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.4","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"8.2.0","eslint-config-airbnb-base":"15.0.0","eslint-config-prettier":"8.3.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.5.0","eslint-loader":"4.0.2","eslint-plugin-import":"2.25.3","eslint-plugin-prettier":"4.0.0","eslint-plugin-security":"1.4.0","prettier":"2.4.1","express":"4.17.1","husky":"3.0.9","jest":"25.5.4","joi":"17.4.2","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","ts-jest":"25.4.0","tscpaths":"0.0.9","typescript":"4.4.4"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for the isomorphic fetch\n### [Documentation here](https://mihanizm56.github.io/fetch-api/)\n\n### Benefits:\n- Provides validation for responses (based on joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services, https://www.npmjs.com/package/query-string is used)\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in the\n  hard-structured response format\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n- Provides the ability to handle the response progress\n- Provides the ability to select necessary fields from the response (https://github.com/nemtsov/json-mask#readme used)\n- Provides the ability to use persistent params for all requests\n- Provides the ability to retry requests\n- Provides the ability to logging your error requests\n\n#### Request input options:\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by joi <br/>(you must use the joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use joi\n- customTimeout(number) - milliseconds for cancel the request on timeout (or a full package of requests if the \"retry\" parameter is activated) \n- retry - number of requests try to request if the response is negative\n\n#### Request output options:\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n- body will be serialized in JSON if body data NOT FormData\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### Please, be careful. The response will be the object:\n```javascript\n{\n  error: boolean,\n  data: Array<IResponse>,\n  additionalErrors: null,\n  errorText: string,\n  code: number\n}\n```\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n#### Set persist options to all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setResponseTrackCallback(({\n  requestParams, // all request parameters\n  response, //  pure response protected object\n  pureResponseData, // response body without formatting\n  requestError: boolean, // is request crashed\n  formattedResponseData // formatted response data in IResponse interface\n}) => ({\n // do some metrics or logging here\n}));\n```\n\n#### Set callback for metrics for all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setPersistentOptions(() => ({\n  headers: {\n    foo: 'bar',\n  },\n}));\n```","readmeFilename":"README.md","gitHead":"459c357dce2e97dfcb42a4e98b96f9710c9db43c","_id":"@mihanizm56/fetch-api@3.9.4-beta.4","_nodeVersion":"12.22.12","_npmVersion":"6.14.16","dist":{"integrity":"sha512-4sM8ziX5oLOOYW5RhzVjAQwXPMLlDyf9Uz+haESpVxZmFNdBK0YJQD8hX6Br2xy/IaBrr/XKdv3v6ndI9lqC/w==","shasum":"c5f93ca34a621911e86e5c819207a27585ad7474","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.9.4-beta.4.tgz","fileCount":123,"unpackedSize":288043,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEalWMvZmo57xXPwDKA/R7vN8u9x8xc/1dTW0Mfqja8MAiEAlM4D3p4IARdXLkWDqXBjEd7+eg3wefk6GzY6pGXisgs="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjpP+AACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpWeA//YIQjTKKsabxwqiXtot6wDT2JJ6Og6IMT4bgK7egJQRLWaQqm\r\nzWIT7VVDG2cTsAjWEmnU+Uoiie2DGxyMmTxsH/ITwxsmnvd0jyDeNyf5yZ1H\r\nsEySiWBKAYss7l5/CpEbppX9nZoxlthTyfDOqJ1E9Ws4/sxCSZnQm7DiZ4R1\r\nSonz8bInnYsuQ9LDsfvQ94+VYP9KEFDS6XCybDvkDrrc2otkc2ddtcr5Hufv\r\nl3sqiHxEEO4qNtTFSB6eIQebA6oEzRl7fHCYz/fi2V3RnDO75HVT7QeQZ+Gu\r\nDaosD2UzeIzNF2flaMHKKQV4wBlH4Q8l4cwl3bB1GJKs2i0U6fvLKMsBHMIF\r\nYsgIGpGPnzpQhvZE0y/+i6+F4eiR0p0s0f/dQVt4u7mneLJLG9kXpCmloAps\r\nZZrqSC7U6KWqPynQKWj26MMPsb4u15YfMD5cN19gtoYjJYDsUkZYVwFNoXlB\r\neI9zM7VZcaunlU7NCZXv9yYtBALmkjUwv+m3VmcfIjyvV/4wac6Y2J+8Ld/0\r\nqVrI3mcVvoDqnRm/lcnqZUivnPV0C3NO1jvgVNvz6JiBfjFDmac8uFhf36aA\r\nWcdoGu4ZloguJ48RQz2j6j8qkZNZ6UQFvyhKgyJw2teNjUEC1qAamz6l1m+1\r\nMMgVU8EgoydAl1ggmYknj4nJVUhz23dUZiY=\r\n=WCMt\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.9.4-beta.4_1671757696619_0.49161229055146016"},"_hasShrinkwrap":false},"3.9.4-beta.5":{"name":"@mihanizm56/fetch-api","version":"3.9.4-beta.5","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix --max-warnings=0 --cache --cache-location .eslintinfo","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"7.0.1"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"25.1.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"5.3.0","@typescript-eslint/parser":"5.3.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.4","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"8.2.0","eslint-config-airbnb-base":"15.0.0","eslint-config-prettier":"8.3.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.5.0","eslint-loader":"4.0.2","eslint-plugin-import":"2.25.3","eslint-plugin-prettier":"4.0.0","eslint-plugin-security":"1.4.0","prettier":"2.4.1","express":"4.17.1","husky":"3.0.9","jest":"25.5.4","joi":"17.4.2","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","ts-jest":"25.4.0","tscpaths":"0.0.9","typescript":"4.4.4"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for the isomorphic fetch\n### [Documentation here](https://mihanizm56.github.io/fetch-api/)\n\n### Benefits:\n- Provides validation for responses (based on joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services, https://www.npmjs.com/package/query-string is used)\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in the\n  hard-structured response format\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n- Provides the ability to handle the response progress\n- Provides the ability to select necessary fields from the response (https://github.com/nemtsov/json-mask#readme used)\n- Provides the ability to use persistent params for all requests\n- Provides the ability to retry requests\n- Provides the ability to logging your error requests\n\n#### Request input options:\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by joi <br/>(you must use the joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use joi\n- customTimeout(number) - milliseconds for cancel the request on timeout (or a full package of requests if the \"retry\" parameter is activated) \n- retry - number of requests try to request if the response is negative\n\n#### Request output options:\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n- body will be serialized in JSON if body data NOT FormData\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### Please, be careful. The response will be the object:\n```javascript\n{\n  error: boolean,\n  data: Array<IResponse>,\n  additionalErrors: null,\n  errorText: string,\n  code: number\n}\n```\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n#### Set persist options to all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setResponseTrackCallback(({\n  requestParams, // all request parameters\n  response, //  pure response protected object\n  pureResponseData, // response body without formatting\n  requestError: boolean, // is request crashed\n  formattedResponseData // formatted response data in IResponse interface\n}) => ({\n // do some metrics or logging here\n}));\n```\n\n#### Set callback for metrics for all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setPersistentOptions(() => ({\n  headers: {\n    foo: 'bar',\n  },\n}));\n```","readmeFilename":"README.md","gitHead":"ced1133e721ec488762c77e21dd748fd2b52cd4c","_id":"@mihanizm56/fetch-api@3.9.4-beta.5","_nodeVersion":"12.22.12","_npmVersion":"6.14.16","dist":{"integrity":"sha512-8E5IFWeF43oe0TUB53Zmzxsm4N25UcS+etICgzkz0gGqKfR7FAf1nKQnJpfTunftwyiJTN1NvTDYoHttCnglUQ==","shasum":"3b6debd3655ccb151faa8210cb4ba997d1b8c85d","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.9.4-beta.5.tgz","fileCount":123,"unpackedSize":288041,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICz7M7EYbxTdxPAgVpfTYLIJSAjH1EVjUEcnM3EXlBJcAiB+MvcxNP5fmJ5LkoHXXY5g05KwMm1DjOoIGCN0pkINFA=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjpjwJACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr9zxAAodJllnrZsdCpqe1eJIr5wONA0Qd0ax1epsxMLcJDqvecw2a4\r\nKc1WLuAjIU+0dEoVE3VxXmNXcWY+Wnk2UG+1S4PvZL5dLNJ2OG/1/4AMNckw\r\nOBxfvGTUn6NrV2Hj8xQ+ixSIm9JdT0foy5Sbcc/kx0x92MiwCjGIQkAwzL1d\r\n89FpFg98F+2QNqQWKUVQgbyjTe17quyDDW1eZEkRhWpTRJztFYMj/yA6H+yc\r\n9AMBtQ5M1eozresbqF8MtiUbY5+Ccwnt+lmFxDYO1pAUzsiZx3WCutiW59UC\r\nbxa9GtRgfmy0bFfAiHl6yrPo/5lvCWLtV55BY79Wmya9c8NSWLR6rF5H1CzX\r\nyAXsDJHQWhBnElI5umW5F6a7GJdYa1FzRYDGTHFpi/u+o3Q2iwhYqG0QpKz4\r\nzG0Jz/q1f59btlR7E7qykIGLxZsAWUFgGv4VPsfYC3Ek7H/Ovd4s4j0QRsXk\r\niNwdSnI07uyDCidUtNZ6c49GPUgx7DDn77V1bCsaOByzitVjLVQsW7Wecran\r\nx9u2u660MO4uaizEP1Egs4L4l8vx4vInraqX12M8NK1i3++CV6rpmj5uhijw\r\nyN64GObmUY2pP6n3yA/Nq2itJ/kDjCh2eyuZlk+1LrRpwL1+9uea79hJYtip\r\nsB7n861xae4IzSIxi+joASddHBPxG2zqZ00=\r\n=Hse9\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.9.4-beta.5_1671838729303_0.1769597858996228"},"_hasShrinkwrap":false},"3.9.4-beta.6":{"name":"@mihanizm56/fetch-api","version":"3.9.4-beta.6","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix --max-warnings=0 --cache --cache-location .eslintinfo","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"7.0.1"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"25.1.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"5.3.0","@typescript-eslint/parser":"5.3.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.4","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"8.2.0","eslint-config-airbnb-base":"15.0.0","eslint-config-prettier":"8.3.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.5.0","eslint-loader":"4.0.2","eslint-plugin-import":"2.25.3","eslint-plugin-prettier":"4.0.0","eslint-plugin-security":"1.4.0","prettier":"2.4.1","express":"4.17.1","husky":"3.0.9","jest":"25.5.4","joi":"17.4.2","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","ts-jest":"25.4.0","tscpaths":"0.0.9","typescript":"4.4.4"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for the isomorphic fetch\n### [Documentation here](https://mihanizm56.github.io/fetch-api/)\n\n### Benefits:\n- Provides validation for responses (based on joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services, https://www.npmjs.com/package/query-string is used)\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in the\n  hard-structured response format\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n- Provides the ability to handle the response progress\n- Provides the ability to select necessary fields from the response (https://github.com/nemtsov/json-mask#readme used)\n- Provides the ability to use persistent params for all requests\n- Provides the ability to retry requests\n- Provides the ability to logging your error requests\n\n#### Request input options:\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by joi <br/>(you must use the joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use joi\n- customTimeout(number) - milliseconds for cancel the request on timeout (or a full package of requests if the \"retry\" parameter is activated) \n- retry - number of requests try to request if the response is negative\n\n#### Request output options:\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n- body will be serialized in JSON if body data NOT FormData\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### Please, be careful. The response will be the object:\n```javascript\n{\n  error: boolean,\n  data: Array<IResponse>,\n  additionalErrors: null,\n  errorText: string,\n  code: number\n}\n```\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n#### Set persist options to all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setResponseTrackCallback(({\n  requestParams, // all request parameters\n  response, //  pure response protected object\n  pureResponseData, // response body without formatting\n  requestError: boolean, // is request crashed\n  formattedResponseData // formatted response data in IResponse interface\n}) => ({\n // do some metrics or logging here\n}));\n```\n\n#### Set callback for metrics for all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setPersistentOptions(() => ({\n  headers: {\n    foo: 'bar',\n  },\n}));\n```","readmeFilename":"README.md","gitHead":"ad5970787b6e353e5be34c645a680f449b13e17b","_id":"@mihanizm56/fetch-api@3.9.4-beta.6","_nodeVersion":"12.22.12","_npmVersion":"6.14.16","dist":{"integrity":"sha512-Km0S1f7gl73XOBKue4k49pAiwQW38bd/dXRU02pTXaqoWTqIpq+kydP0Lzr8DvylERhUMFLG5kSa0yRk4S78vQ==","shasum":"26ba94df3981922b31c8afea4b15dc57ce740e2e","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.9.4-beta.6.tgz","fileCount":123,"unpackedSize":288703,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDEVJv3DuejHJHbCT95DRFlzwNK3w2AMq6Aq20rEyZE8QIgA8ulM837eIufb4Ey3xAjAjhZXN8rJvf2N1VoYqXRSmo="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjqhpvACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpzgxAAnpMBSPmgTlyvqOu+CuyTorXpguTidu6VP1cyuzy9pADyQeij\r\nF9uBpdCY1NBaijkUSm8jZKLDFaxGSwkjmLhyvMJCPNRo0yM3KvetNdRjcL4g\r\nrG2oiP1zAzL3x5KepKokj262PAcuBUpM+W08xCy4OF1mxOaW0fb72xqvoCGn\r\nDvTIfXlKA9IPnGSNj6JzNtD7tPsAlRb+ExK7OcendtEanIPept6b5LEgWWts\r\n1/MyrPBVi16+phSrDfHK42FB1lfPqBY6D7kJZf6kY9KcQpMCFh8VxCQON6AF\r\nvwDQP0NYWNVxMoIMTB3YO8daZiQDb5XBMMTadLjGSoBalbtJwPg+K4Mf95MF\r\n/GUGuHQCN5a0qleqotUrLXPG711woNAnX1Kw6hEs0fPIq0eDTTffZ9wI45wn\r\nVqvtMiPhyJg8Cq6vaELDBym6QIEXQirbAAW0uv6wqvo8vZSubyP72U0UZ2YU\r\nU4Slr4Rlc5zM8D6QcaAwr64/nFOjlzQqej1ax9TuemjNGmp1aSJkOBOYksNr\r\nB3of5sCOGH10qp7FywVfsIp5jo1dTzVtpX/SB4P/l6TvoSHT3+y7D9vOaZTP\r\nBssbLi37k7sJf8/aqsrocEd7ssANSWLap3b7328D0R+MNvqHB1D5XkKM9iSW\r\njZ90p1d/wJzcxXkSNte0PoY7drmZcN+whOM=\r\n=fdWH\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.9.4-beta.6_1672092271577_0.1698571571904537"},"_hasShrinkwrap":false},"3.9.4":{"name":"@mihanizm56/fetch-api","version":"3.9.4","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix --max-warnings=0 --cache --cache-location .eslintinfo","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"7.0.1"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"25.1.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"5.3.0","@typescript-eslint/parser":"5.3.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.4","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"8.2.0","eslint-config-airbnb-base":"15.0.0","eslint-config-prettier":"8.3.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.5.0","eslint-loader":"4.0.2","eslint-plugin-import":"2.25.3","eslint-plugin-prettier":"4.0.0","eslint-plugin-security":"1.4.0","prettier":"2.4.1","express":"4.17.1","husky":"3.0.9","jest":"25.5.4","joi":"17.4.2","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","ts-jest":"25.4.0","tscpaths":"0.0.9","typescript":"4.4.4"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"gitHead":"db2b60ecd55478c04bc387c1180759b75bd7d814","_id":"@mihanizm56/fetch-api@3.9.4","_nodeVersion":"12.22.12","_npmVersion":"6.14.16","dist":{"integrity":"sha512-tFYj/KLigqIDdPZKAHjTcZcSvz9V+1yIOY5Mg4pQg4tZP8+jY4PwkncxMveA3vnDPZCSnHllI3ZBQLZdUppJpQ==","shasum":"81381d162dccfea8b8c1c57572b0273838ff3bd3","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.9.4.tgz","fileCount":123,"unpackedSize":288696,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEUoSS3P9E6X5F9VJI54SlnMv5vzhX3qmsFoIrU/n2I8AiBDdoS2PebA4QTwWg+r6fTyjinhOb72r5q3SQMEMVKCTg=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjrwDUACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqovRAAlPmqNnpT0anhwMQEMcMI7d2AoSLN64rmtF74bWQIeQckKigN\r\nZAkl01VLfwKyHZqOL/oYabIdRr33VKV9vWfVJn8eD8zxJLX9liNEMIcIyqtJ\r\n3dpPE7aofJTsVh4Yj91PGTIHZNhB4kkFw4cl10PoYLW2ifLrcvdhIJGzseBJ\r\njDcWxfDFMVVYGrEJCHygRxteMLY8WF1v16Et54i4AmDejJoiV5FT2jEEmchb\r\ncQYByR6XQrsZJxaap30zUTqfjF1ZcBj4ZFsw4/Z++12ctSV4r4rF45ePfPWB\r\npos+vUt83mh9N/VGSorLhXBm89QL+JAMzkRX37OAx0xIExLzozPMa/bEiS6T\r\nxI7E5U/5Irl5kdIZ4kTv9yHMRy/Uwu/5snhRA4gCitO7wBfjTUqCMQReh89v\r\nqk6mAF1b/9nRClXWFp/xdRMKyCwmqyvUU1LXwWN6ZEew/SV1L40LcexfLnyq\r\n6ZnJPORKdcMKLXySVA5K66rm8f9d2Usm/uPUmJgs/dtVDvcZHF5RvGSyc7Ek\r\na+36agJBqwWLCG/O7S/6WzyTESWJnSX5WuNAFoHwBFKq8PQ2wRwYaqIjMV4r\r\n7gi7z89Rr4Or4WYKNHdDA/BQnrFldXpA17vDcumd9RcAvYYf3G5Q1eUCddVg\r\nVVLXkTHQoNV3TEyR99oUvRHSVSlr9mKADRE=\r\n=6Z+q\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.9.4_1672413395927_0.30553333955372985"},"_hasShrinkwrap":false},"3.10.0-beta.1":{"name":"@mihanizm56/fetch-api","version":"3.10.0-beta.1","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix --max-warnings=0 --cache --cache-location .eslintinfo","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"7.0.1"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"25.1.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"5.3.0","@typescript-eslint/parser":"5.3.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.4","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"8.2.0","eslint-config-airbnb-base":"15.0.0","eslint-config-prettier":"8.3.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.5.0","eslint-loader":"4.0.2","eslint-plugin-import":"2.25.3","eslint-plugin-prettier":"4.0.0","eslint-plugin-security":"1.4.0","prettier":"2.4.1","express":"4.17.1","husky":"3.0.9","jest":"25.5.4","joi":"17.4.2","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","ts-jest":"25.4.0","tscpaths":"0.0.9","typescript":"4.4.4"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for the isomorphic fetch\n### [Documentation here](https://mihanizm56.github.io/fetch-api/)\n\n### Benefits:\n- Provides validation for responses (based on joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services, https://www.npmjs.com/package/query-string is used)\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in the\n  hard-structured response format\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n- Provides the ability to handle the response progress\n- Provides the ability to select necessary fields from the response (https://github.com/nemtsov/json-mask#readme used)\n- Provides the ability to use persistent params for all requests\n- Provides the ability to retry requests\n- Provides the ability to logging your error requests\n\n#### Request input options:\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by joi <br/>(you must use the joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use joi\n- customTimeout(number) - milliseconds for cancel the request on timeout (or a full package of requests if the \"retry\" parameter is activated) \n- retry - number of requests try to request if the response is negative\n\n#### Request output options:\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n- body will be serialized in JSON if body data NOT FormData\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### Please, be careful. The response will be the object:\n```javascript\n{\n  error: boolean,\n  data: Array<IResponse>,\n  additionalErrors: null,\n  errorText: string,\n  code: number\n}\n```\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n#### Set persist options to all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setResponseTrackCallback(({\n  requestParams, // all request parameters\n  response, //  pure response protected object\n  pureResponseData, // response body without formatting\n  requestError: boolean, // is request crashed\n  formattedResponseData // formatted response data in IResponse interface\n}) => ({\n // do some metrics or logging here\n}));\n```\n\n#### Set callback for metrics for all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setPersistentOptions(() => ({\n  headers: {\n    foo: 'bar',\n  },\n}));\n```","readmeFilename":"README.md","gitHead":"089f9c9fd2c517ed999a39920e8be0d2a55ccfb2","_id":"@mihanizm56/fetch-api@3.10.0-beta.1","_nodeVersion":"12.22.12","_npmVersion":"6.14.16","dist":{"integrity":"sha512-K9W0HtrErx5936clV5Mbrwh/FII6bdjlOTQ6hNiLLcnhOjXD6m0/C5ulRae1adRWNWDuwXCEMrMCnI+BmwKdRA==","shasum":"f4d106d1e9a8b51543794163c57db6b0c325a090","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.10.0-beta.1.tgz","fileCount":125,"unpackedSize":303802,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD9P9GUcCmghVqyB38IwA0HMAVxB4LlS9H8kBXBl5/a/AIhAIiqZpN15WALLISRbUvTJY1PwfERTvDM/P3HdOB8G+kU"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjyd6ZACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrtVQ/9F7hTrsTU+WKNmWV6JyhoIlnIxYFUz/UohiwtHTOp/EcRgU1U\r\n7v/UUEq2ztGm2Ki/rzWMeZ6e5wE2Ah0OIKgUuhVEmUwP2v/ndJKCKr60XYFf\r\nEWDIpq/wVjXCM07msprriurVctzeTfxxTrOBUhEIF6esuSPWUyexn14pnn7i\r\na/c9NF2du3+cPiehUAnwmE49XUyVCdBihVj8JsF0Sg4PxY7lQDuHadfg5Cjg\r\n7Y3R6kLDBAoFUmbhGzkN/7LGEhRjLaY8KnJZshrMm3yIaN9rfi+ZJ8oH0zC1\r\nFpKzB9fDoRyIH0swzTU8rG0enw5PPqbGWhibkIviebn5HHo5gSkgCRvPuWCG\r\ntXqKassgdPyPwUnmwgdRQZDx2nLHWuIXaqhkhGwiJ8ci+c4//G7LEdOKzEDR\r\nw78K4QAUYHerO395rlnsVMPFIWG/sk2VV1xBFc3etgwt3vtebakY1VTbZE6t\r\nnuF8xkVXWEFIpuONE09PgiqOGQGZMnQ2p3rBxwJAkMD4dwvNZPaz9BbkG4zW\r\n81ZsgSVNOwijkBCqmecTncus2GCgMd+CA8lc7fa+RsMXxtoldAecrXfE3rgn\r\nMtSpv6v2Kg6RnQ8+85CuqU1kQbCKbYLY91KFZlNxbM584SElhoc395PzwS8m\r\n6NqbRrByPdf8VRcfqfr6MOvHeBZ2ARLeOnI=\r\n=h87F\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.10.0-beta.1_1674174105076_0.05356278540231996"},"_hasShrinkwrap":false},"3.10.0-beta.2":{"name":"@mihanizm56/fetch-api","version":"3.10.0-beta.2","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix --max-warnings=0 --cache --cache-location .eslintinfo","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"7.0.1"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"25.1.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"5.3.0","@typescript-eslint/parser":"5.3.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.4","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"8.2.0","eslint-config-airbnb-base":"15.0.0","eslint-config-prettier":"8.3.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.5.0","eslint-loader":"4.0.2","eslint-plugin-import":"2.25.3","eslint-plugin-prettier":"4.0.0","eslint-plugin-security":"1.4.0","prettier":"2.4.1","express":"4.17.1","husky":"3.0.9","jest":"25.5.4","joi":"17.4.2","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","ts-jest":"25.4.0","tscpaths":"0.0.9","typescript":"4.4.4"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for the isomorphic fetch\n### [Documentation here](https://mihanizm56.github.io/fetch-api/)\n\n### Benefits:\n- Provides validation for responses (based on joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services, https://www.npmjs.com/package/query-string is used)\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in the\n  hard-structured response format\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n- Provides the ability to handle the response progress\n- Provides the ability to select necessary fields from the response (https://github.com/nemtsov/json-mask#readme used)\n- Provides the ability to use persistent params for all requests\n- Provides the ability to retry requests\n- Provides the ability to logging your error requests\n\n#### Request input options:\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by joi <br/>(you must use the joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use joi\n- customTimeout(number) - milliseconds for cancel the request on timeout (or a full package of requests if the \"retry\" parameter is activated) \n- retry - number of requests try to request if the response is negative\n\n#### Request output options:\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n- body will be serialized in JSON if body data NOT FormData\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### Please, be careful. The response will be the object:\n```javascript\n{\n  error: boolean,\n  data: Array<IResponse>,\n  additionalErrors: null,\n  errorText: string,\n  code: number\n}\n```\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n#### Set persist options to all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setResponseTrackCallback(({\n  requestParams, // all request parameters\n  response, //  pure response protected object\n  pureResponseData, // response body without formatting\n  requestError: boolean, // is request crashed\n  formattedResponseData // formatted response data in IResponse interface\n}) => ({\n // do some metrics or logging here\n}));\n```\n\n#### Set callback for metrics for all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setPersistentOptions(() => ({\n  headers: {\n    foo: 'bar',\n  },\n}));\n```","readmeFilename":"README.md","gitHead":"250ec45f128c3634a6f651a91cce496ef4ad9ede","_id":"@mihanizm56/fetch-api@3.10.0-beta.2","_nodeVersion":"12.22.12","_npmVersion":"6.14.16","dist":{"integrity":"sha512-tC+BrehwyNaRLPUNjfBPxlxmC2KfNW/24OqTKakxfB8kIbGzDQ4lk3JF+d52umTjGi8ielDKIE3yxgaQyXoXyg==","shasum":"b767dedb501137a0651d8dc3204836e8f4e540fc","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.10.0-beta.2.tgz","fileCount":125,"unpackedSize":303798,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDfW9K0IMVwV9tgy33P1tSnrFXQkU6CC/I1u5I9hfitfgIgRThooEXdR3KmNgVCVDBtOlum65ftAyVGmm1PsBpbUGA="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjyx9ZACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmoy+A//aD68q+XFw83DvDHb48ZsYlwBOdJBT1fNe0F+8ku63I3XkWaG\r\nsvJQFDLKh9dn7dUDHHyHT/MwKyodJlFnwtc6WkhFdZEfYt4tyooReFvw14yq\r\nplqHJVzEFGujgaMv5hGhVz11maaLGzurUAcHYgg4uGr6v9EtqlakZ8zBExrl\r\nMxe5GMxgrCtcD+aZItunwE0166EVu6+UdgWdvyFFzDx4fSu0NnLxQ0I1LxEm\r\n4lW9/tkvx0JJwTrdItB6EbV90SToQjzI0qbl3X20Z7OSRy4XyA/1O3hpgN9Z\r\n84zC2ledeIes6uIZmiCL69hNSolFRl+d2uaOWI/9nzE9A0mXB5SB4lr8e/xw\r\nDwDXZ75AbJhYuJCtwr3mKO3wpNwSLcKLEVonaC9ipiN/VhcbI8ztNHWr+EmC\r\nvqoTnPwU1R1aNekxju8l7tct/jwCGxuvTj5Ec10cdggU6EirfVR92L2yGo8/\r\nNZxMHYZ6KOVKKxrg3f/0PjQ/mcBnOQv7IfXPDlFuPSxcE1BnolUJHM8FentY\r\noFE4aJtlOUSsOZ2tZqV+Q19ygF9eiw+UT6LWPq0JvN/b4907tGJy3e+V98ra\r\nAHmFldcGtwPJdgA3IRngEoOLkeBJOXg8XWIJNP/ftovwnw63t85h5JRP2jTO\r\nXJmlskkA/09B8fGVcMH1wpEoxIfXLSXkTn0=\r\n=RThJ\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.10.0-beta.2_1674256216776_0.3818563924873928"},"_hasShrinkwrap":false},"3.10.0":{"name":"@mihanizm56/fetch-api","version":"3.10.0","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix --max-warnings=0 --cache --cache-location .eslintinfo","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","json-mask":"1.0.4","node-fetch":"2.6.1","query-string":"7.0.1"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"25.1.0","@types/joi":"14.3.4","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"5.3.0","@typescript-eslint/parser":"5.3.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.4","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"8.2.0","eslint-config-airbnb-base":"15.0.0","eslint-config-prettier":"8.3.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.5.0","eslint-loader":"4.0.2","eslint-plugin-import":"2.25.3","eslint-plugin-prettier":"4.0.0","eslint-plugin-security":"1.4.0","prettier":"2.4.1","express":"4.17.1","husky":"3.0.9","jest":"25.5.4","joi":"17.4.2","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","ts-jest":"25.4.0","tscpaths":"0.0.9","typescript":"4.4.4"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"gitHead":"ef90c1426a7c18838f397fc1b90f2e0d1a472d09","_id":"@mihanizm56/fetch-api@3.10.0","_nodeVersion":"12.22.12","_npmVersion":"6.14.16","dist":{"integrity":"sha512-m0c+JIuLgVmJ4T0zfe3WUT6DdZNO5h46y44vK0V51kGQJKwzOdb1S02tv+Svuc98Cg76OW2201JiEmYSuyWFMg==","shasum":"6d60442a75ebd535e86533d3e2a36f9326ac631f","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.10.0.tgz","fileCount":125,"unpackedSize":303760,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHLx4SBulMDdKg/6qEUr0+BQlQMcDsjt8PyLI1dPDaqQAiEA76eYGlMfmw2w/+Mmoj9IrU2ocNXdnIf8HL6tT89e3pE="}]},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.10.0_1696814695916_0.41634708296464473"},"_hasShrinkwrap":false},"3.10.1-beta.1":{"name":"@mihanizm56/fetch-api","version":"3.10.1-beta.1","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix --max-warnings=0 --cache --cache-location .eslintinfo","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","json-mask":"1.0.4","query-string":"7.0.1"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"25.1.0","@types/joi":"14.3.4","node-fetch":"2.6.1","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"5.3.0","@typescript-eslint/parser":"5.3.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.4","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"8.2.0","eslint-config-airbnb-base":"15.0.0","eslint-config-prettier":"8.3.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.5.0","eslint-loader":"4.0.2","eslint-plugin-import":"2.25.3","eslint-plugin-prettier":"4.0.0","eslint-plugin-security":"1.4.0","prettier":"2.4.1","express":"4.17.1","husky":"3.0.9","jest":"25.5.4","joi":"17.4.2","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","ts-jest":"25.4.0","tscpaths":"0.0.9","typescript":"4.4.4"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for the isomorphic fetch\n### [Documentation here](https://mihanizm56.github.io/fetch-api/)\n\n### Benefits:\n- Provides validation for responses (based on joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services, https://www.npmjs.com/package/query-string is used)\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in the\n  hard-structured response format\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n- Provides the ability to handle the response progress\n- Provides the ability to select necessary fields from the response (https://github.com/nemtsov/json-mask#readme used)\n- Provides the ability to use persistent params for all requests\n- Provides the ability to retry requests\n- Provides the ability to logging your error requests\n\n#### Request input options:\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by joi <br/>(you must use the joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use joi\n- customTimeout(number) - milliseconds for cancel the request on timeout (or a full package of requests if the \"retry\" parameter is activated) \n- retry - number of requests try to request if the response is negative\n\n#### Request output options:\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n- body will be serialized in JSON if body data NOT FormData\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### Please, be careful. The response will be the object:\n```javascript\n{\n  error: boolean,\n  data: Array<IResponse>,\n  additionalErrors: null,\n  errorText: string,\n  code: number\n}\n```\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n#### Set persist options to all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setResponseTrackCallback(({\n  requestParams, // all request parameters\n  response, //  pure response protected object\n  pureResponseData, // response body without formatting\n  requestError: boolean, // is request crashed\n  formattedResponseData // formatted response data in IResponse interface\n}) => ({\n // do some metrics or logging here\n}));\n```\n\n#### Set callback for metrics for all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setPersistentOptions(() => ({\n  headers: {\n    foo: 'bar',\n  },\n}));\n```","readmeFilename":"README.md","gitHead":"a763c78ca8dda13c3bb66351144c66b720bd0099","_id":"@mihanizm56/fetch-api@3.10.1-beta.1","_nodeVersion":"12.22.12","_npmVersion":"6.14.16","dist":{"integrity":"sha512-Ttwu1ZvPq/XbQZJOlg/K9qnpfp/qa0KMnAYFGbFynRpaQhGrMR6OQd9Db6HTvU8xs/I84saC2aVtwqxlvaMIxA==","shasum":"3dd39847d127c234711e6a801532746620c810a3","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.10.1-beta.1.tgz","fileCount":125,"unpackedSize":303767,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBevER5MQgS8LiztutF7hSA7rKX7blL2rnuyU+bfW7lsAiEA//CGO0JrI7SwYFcWx/0SkiLhnKJ6mtmETS82P/RDLYg="}]},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.10.1-beta.1_1696815083449_0.7549399765520073"},"_hasShrinkwrap":false},"3.10.1":{"name":"@mihanizm56/fetch-api","version":"3.10.1","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix --max-warnings=0 --cache --cache-location .eslintinfo","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","json-mask":"1.0.4","query-string":"7.0.1"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"25.1.0","@types/joi":"14.3.4","node-fetch":"2.6.1","@types/node-fetch":"2.5.7","@typescript-eslint/eslint-plugin":"5.3.0","@typescript-eslint/parser":"5.3.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.4","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"8.2.0","eslint-config-airbnb-base":"15.0.0","eslint-config-prettier":"8.3.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.5.0","eslint-loader":"4.0.2","eslint-plugin-import":"2.25.3","eslint-plugin-prettier":"4.0.0","eslint-plugin-security":"1.4.0","prettier":"2.4.1","express":"4.17.1","husky":"3.0.9","jest":"25.5.4","joi":"17.4.2","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","ts-jest":"25.4.0","tscpaths":"0.0.9","typescript":"4.4.4"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"gitHead":"8f1f0a74a40a012ade8783ae64a56953eabc49ea","_id":"@mihanizm56/fetch-api@3.10.1","_nodeVersion":"12.22.12","_npmVersion":"6.14.16","dist":{"integrity":"sha512-zHGXKmnv4Bdf5VUutN+1Zaw7X3xs1nw+FIpUWnvY7Kn80J9GMvId9pKESeoi5hp7HfZwMStifPvQ/ugOotV3ew==","shasum":"6808637f188ca9d3eea426c73da02e3a80315d1b","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-3.10.1.tgz","fileCount":125,"unpackedSize":303814,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDNcS7abooXYOTbvhD0Y9c72lf8TFh5nDIYQzRRxpu9gAiAy0G68AzAMno+PCVvIxNMUBgg2/Esf6vMkgqZ9D8Ohpg=="}]},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_3.10.1_1696815737358_0.4155770051121974"},"_hasShrinkwrap":false},"4.0.0-beta.1":{"name":"@mihanizm56/fetch-api","version":"4.0.0-beta.1","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","engines":{"node":">=20.0.0"},"scripts":{"server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix --max-warnings=0 --cache --cache-location .eslintinfo","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","json-mask":"1.0.4","query-string":"7.0.1"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"25.1.0","@types/joi":"14.3.4","@typescript-eslint/eslint-plugin":"5.3.0","@typescript-eslint/parser":"5.3.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.4","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"8.2.0","eslint-config-airbnb-base":"15.0.0","eslint-config-prettier":"8.3.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.5.0","eslint-loader":"4.0.2","eslint-plugin-import":"2.25.3","eslint-plugin-prettier":"4.0.0","eslint-plugin-security":"1.4.0","prettier":"2.4.1","express":"4.17.1","husky":"3.0.9","jest":"25.5.4","joi":"17.4.2","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","ts-jest":"25.4.0","tscpaths":"0.0.9","typescript":"4.4.4"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for the isomorphic fetch\n### [Documentation here](https://mihanizm56.github.io/fetch-api/)\n\n### Benefits:\n- Provides validation for responses (based on joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services, https://www.npmjs.com/package/query-string is used)\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in the\n  hard-structured response format\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n- Provides the ability to handle the response progress\n- Provides the ability to select necessary fields from the response (https://github.com/nemtsov/json-mask#readme used)\n- Provides the ability to use persistent params for all requests\n- Provides the ability to retry requests\n- Provides the ability to logging your error requests\n\n#### Request input options:\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by joi <br/>(you must use the joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use joi\n- customTimeout(number) - milliseconds for cancel the request on timeout (or a full package of requests if the \"retry\" parameter is activated) \n- retry - number of requests try to request if the response is negative\n\n#### Request output options:\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n- body will be serialized in JSON if body data NOT FormData\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### Please, be careful. The response will be the object:\n```javascript\n{\n  error: boolean,\n  data: Array<IResponse>,\n  additionalErrors: null,\n  errorText: string,\n  code: number\n}\n```\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n#### Set persist options to all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setResponseTrackCallback(({\n  requestParams, // all request parameters\n  response, //  pure response protected object\n  pureResponseData, // response body without formatting\n  requestError: boolean, // is request crashed\n  formattedResponseData // formatted response data in IResponse interface\n}) => ({\n // do some metrics or logging here\n}));\n```\n\n#### Set callback for metrics for all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setPersistentOptions(() => ({\n  headers: {\n    foo: 'bar',\n  },\n}));\n```","readmeFilename":"README.md","gitHead":"8f1f0a74a40a012ade8783ae64a56953eabc49ea","_id":"@mihanizm56/fetch-api@4.0.0-beta.1","_nodeVersion":"14.20.1","_npmVersion":"6.14.17","dist":{"integrity":"sha512-zb8rytaffW1zlKEjKfaUQIgxZo8XDQpgkzRX4vL0YL6zKnM46pmTl9NmUMibiYrB2wmROk/QTP11sORt5EwAdQ==","shasum":"9f39a1f94aced7de9da9ae231210a155fd170f43","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-4.0.0-beta.1.tgz","fileCount":125,"unpackedSize":303331,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCyu2GmAGQS/439hzPyXlV9sQncqQz6uw9B9munZ6Fj8gIgebwWTDk5H5b4Vln9XUneZdm/F18u3hnkDLjK+eEic+s="}]},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_4.0.0-beta.1_1701999285478_0.3918410092327893"},"_hasShrinkwrap":false},"4.0.0-beta.3":{"name":"@mihanizm56/fetch-api","version":"4.0.0-beta.3","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","engines":{"node":">=20.0.0"},"scripts":{"server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix --max-warnings=0 --cache --cache-location .eslintinfo","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","json-mask":"1.0.4","query-string":"7.0.1"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"25.1.0","@types/joi":"14.3.4","@typescript-eslint/eslint-plugin":"5.3.0","@typescript-eslint/parser":"5.3.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.4","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"8.2.0","eslint-config-airbnb-base":"15.0.0","eslint-config-prettier":"8.3.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.5.0","eslint-loader":"4.0.2","eslint-plugin-import":"2.25.3","eslint-plugin-prettier":"4.0.0","eslint-plugin-security":"1.4.0","prettier":"2.4.1","express":"4.17.1","husky":"3.0.9","jest":"25.5.4","joi":"17.4.2","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","ts-jest":"25.4.0","tscpaths":"0.0.9","typescript":"4.4.4"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"readme":"# @mihanizm56/fetch-api\n\n## Solution for the isomorphic fetch\n### [Documentation here](https://mihanizm56.github.io/fetch-api/)\n\n### Benefits:\n- Provides validation for responses (based on joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services, https://www.npmjs.com/package/query-string is used)\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in the\n  hard-structured response format\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n- Provides the ability to handle the response progress\n- Provides the ability to select necessary fields from the response (https://github.com/nemtsov/json-mask#readme used)\n- Provides the ability to use persistent params for all requests\n- Provides the ability to retry requests\n- Provides the ability to logging your error requests\n\n#### Request input options:\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by joi <br/>(you must use the joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use joi\n- customTimeout(number) - milliseconds for cancel the request on timeout (or a full package of requests if the \"retry\" parameter is activated) \n- retry - number of requests try to request if the response is negative\n\n#### Request output options:\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n- body will be serialized in JSON if body data NOT FormData\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### Please, be careful. The response will be the object:\n```javascript\n{\n  error: boolean,\n  data: Array<IResponse>,\n  additionalErrors: null,\n  errorText: string,\n  code: number\n}\n```\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n#### Set persist options to all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setResponseTrackCallback(({\n  requestParams, // all request parameters\n  response, //  pure response protected object\n  pureResponseData, // response body without formatting\n  requestError: boolean, // is request crashed\n  formattedResponseData // formatted response data in IResponse interface\n}) => ({\n // do some metrics or logging here\n}));\n```\n\n#### Set callback for metrics for all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setPersistentOptions(() => ({\n  headers: {\n    foo: 'bar',\n  },\n}));\n```","readmeFilename":"README.md","gitHead":"3c435d7f2d2e65a1ce1f4f5a82f80d22e9a48791","_id":"@mihanizm56/fetch-api@4.0.0-beta.3","_nodeVersion":"12.22.12","_npmVersion":"6.14.16","dist":{"integrity":"sha512-TpFzMpzyArbAfPYLEelL4/mNkvLWfR8QRaxyP2cad8uX7TtJ8dWXVNkSKe8/+sELfUfG8iifC5L/oOM2YFQ3TA==","shasum":"4b21fae1165e0f8cb151d18369cb91f52e2c20d7","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-4.0.0-beta.3.tgz","fileCount":125,"unpackedSize":303325,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGLsOwvJv4BRdZrtADScdsGOVb7GS1qmsTI3wQaCFYVOAiEAt3dJXAgOdwqaUjgfGARoEqaBYUYnY7dM8eAjSK5dmfs="}]},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_4.0.0-beta.3_1702575081476_0.44792107049113095"},"_hasShrinkwrap":false},"4.0.0-beta.4":{"name":"@mihanizm56/fetch-api","version":"4.0.0-beta.4","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","engines":{"node":">=20.0.0"},"scripts":{"server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix --max-warnings=0 --cache --cache-location .eslintinfo","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","json-mask":"1.0.4","query-string":"7.0.1"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"25.1.0","@types/joi":"14.3.4","@typescript-eslint/eslint-plugin":"5.3.0","@typescript-eslint/parser":"5.3.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.4","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"8.2.0","eslint-config-airbnb-base":"15.0.0","eslint-config-prettier":"8.3.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.5.0","eslint-loader":"4.0.2","eslint-plugin-import":"2.25.3","eslint-plugin-prettier":"4.0.0","eslint-plugin-security":"1.4.0","prettier":"2.4.1","express":"4.17.1","husky":"3.0.9","jest":"25.5.4","joi":"17.4.2","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","ts-jest":"25.4.0","tscpaths":"0.0.9","typescript":"4.4.4"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"_id":"@mihanizm56/fetch-api@4.0.0-beta.4","readme":"# @mihanizm56/fetch-api\n\n## Solution for the isomorphic fetch\n### [Documentation here](https://mihanizm56.github.io/fetch-api/)\n\n### Benefits:\n- Provides validation for responses (based on joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services, https://www.npmjs.com/package/query-string is used)\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in the\n  hard-structured response format\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n- Provides the ability to handle the response progress\n- Provides the ability to select necessary fields from the response (https://github.com/nemtsov/json-mask#readme used)\n- Provides the ability to use persistent params for all requests\n- Provides the ability to retry requests\n- Provides the ability to logging your error requests\n\n#### Request input options:\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by joi <br/>(you must use the joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use joi\n- customTimeout(number) - milliseconds for cancel the request on timeout (or a full package of requests if the \"retry\" parameter is activated) \n- retry - number of requests try to request if the response is negative\n\n#### Request output options:\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n- body will be serialized in JSON if body data NOT FormData\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### Please, be careful. The response will be the object:\n```javascript\n{\n  error: boolean,\n  data: Array<IResponse>,\n  additionalErrors: null,\n  errorText: string,\n  code: number\n}\n```\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n#### Set persist options to all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setResponseTrackCallback(({\n  requestParams, // all request parameters\n  response, //  pure response protected object\n  pureResponseData, // response body without formatting\n  requestError: boolean, // is request crashed\n  formattedResponseData // formatted response data in IResponse interface\n}) => ({\n // do some metrics or logging here\n}));\n```\n\n#### Set callback for metrics for all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setPersistentOptions(() => ({\n  headers: {\n    foo: 'bar',\n  },\n}));\n```","readmeFilename":"README.md","gitHead":"81bd5611aa487e2c5b513ccefb3cc52c88679afc","_nodeVersion":"20.10.0","_npmVersion":"10.2.3","dist":{"integrity":"sha512-I0T6QxzeeXkKGhzPVtG4QjZAMnCrBprH3CvdPA1XZ3dIW6lzyo2+66kreYP6PQUOsGjnJn22irv1piCGLpzQYw==","shasum":"607139a3dd7c9b96fb30c545a7e4cddeb0b59a5f","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-4.0.0-beta.4.tgz","fileCount":3,"unpackedSize":8187,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCJAWu/CQ0cNBrToW+2KQCCA2OAbtifHuIuZCRVC5wnFgIhALoHKhh7QCfXBUbv5N7LEAI2Q9OnRb6an/KP5YPKi/td"}]},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_4.0.0-beta.4_1702596296650_0.312311323854884"},"_hasShrinkwrap":false},"4.0.0-beta.5":{"name":"@mihanizm56/fetch-api","version":"4.0.0-beta.5","description":"api servise","main":"dist/index.js","types":"dist/index.d.ts","engines":{"node":">=20.0.0"},"scripts":{"server":"node integrational-tests/setup/runner.js","test:watch":"jest --watch","test":"npm run build && set CI=true && jest","test:coverage":"jest --coverage","build":"rm -fr ./dist && tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./lib -o ./dist","lint":"npx eslint ./lib --ext .ts --fix --max-warnings=0 --cache --cache-location .eslintinfo","stop":"sudo kill $(sudo lsof -t -i:8080)","commit":"git add . && git commit --no-edit","packages-vulnerability-check":"check-audit","release":"npm run commit && git push && npm publish --access=public","beta":"npm run commit && git push && npm publish --tag beta --access=public","size":"pkgfiles"},"repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"license":"MIT","bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"homepage":"https://github.com/mihanizm56/fetch-api#readme","dependencies":{"colors":"1.4.0","json-mask":"1.0.4","query-string":"7.0.1"},"devDependencies":{"@commitlint/cli":"11.0.0","@types/jest":"25.1.0","@types/joi":"14.3.4","@typescript-eslint/eslint-plugin":"5.3.0","@typescript-eslint/parser":"5.3.0","babel-jest":"25.2.6","body-parser":"1.19.0","commitizen":"4.2.4","cors":"2.8.5","cz-customizable":"6.2.0","eslint":"8.2.0","eslint-config-airbnb-base":"15.0.0","eslint-config-prettier":"8.3.0","eslint-import-resolver-alias":"1.1.2","eslint-import-resolver-typescript":"2.5.0","eslint-loader":"4.0.2","eslint-plugin-import":"2.25.3","eslint-plugin-prettier":"4.0.0","eslint-plugin-security":"1.4.0","prettier":"2.4.1","express":"4.17.1","husky":"3.0.9","jest":"25.5.4","joi":"17.4.2","morgan":"1.10.0","npm-audit-resolver":"2.1.0","pkgfiles":"2.3.2","ts-jest":"25.4.0","tscpaths":"0.0.9","typescript":"4.4.4"},"browser":false,"config":{"commitizen":{"path":"node_modules/cz-customizable"},"cz-customizable":{"config":"config/git/commitizen.js"}},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS -g config/git/commitlint.js","pre-commit":"npm run test && git add .","pre-push":"npm run size","prepare-commit-msg":"node ./config/git/prepare-commit.js"}},"_id":"@mihanizm56/fetch-api@4.0.0-beta.5","readme":"# @mihanizm56/fetch-api\n\n## Solution for the isomorphic fetch\n### [Documentation here](https://mihanizm56.github.io/fetch-api/)\n\n### Benefits:\n- Provides validation for responses (based on joi Schema validation and may use your own validation function)\n- Provides the ability to make rest-api and json-rpc protocol requests in One interface\n- Provides query-params serialize (booleans,strings,numbers,arrays of numbers or strings and variable serialize options for different backend services, https://www.npmjs.com/package/query-string is used)\n- Provides cancel-request if the timeout is higher than timeout value (60 seconds by default) \n- Provides error catching (you dont need to use try/catch)\n- Provides the ability to match the exact error translation\n- Provides different kinds of the response formats to parse\n- Returns ALWAYS the hard prepared response structure (data, error, errorText, additionalErrors)\n- Works in modern browsers and ie11\n- Provides two main classes for REST API - RestRequest and PureRestReques. <br/> The difference is in the\n  hard-structured response format\n- Provides the ability to cancel the request by throwing the special event (ABORT_REQUEST_EVENT_NAME)\n- Provides the ability to handle the response progress\n- Provides the ability to select necessary fields from the response (https://github.com/nemtsov/json-mask#readme used)\n- Provides the ability to use persistent params for all requests\n- Provides the ability to retry requests\n- Provides the ability to logging your error requests\n\n#### Request input options:\n- endpoint(string): the request url\n- responseSchema: the response Schema that parsed by joi <br/>(you must use the joi in your project and insert the response Schema into this field)\n- body(JSON | FormData): the request body\n- mode('cors' | 'no-cors'): the cors type\n- queryParams(object): the object with the query parameters (they will be serialized automatically)\n- headers(object): the object with the headers\n- translateFunction(function): function that will be called with error text key and params (key, params)\n- isErrorTextStraightToOutput(boolean): flag not to prepare error text value - it <br/>\n  goes straight from backend (\"errorText\" if REST and \"message\" if JSON-RPC)\n- extraValidationCallback(function): callback that can be used for custom response <br/>\n  data validation or if you don't want to use joi\n- customTimeout(number) - milliseconds for cancel the request on timeout (or a full package of requests if the \"retry\" parameter is activated) \n- retry - number of requests try to request if the response is negative\n\n#### Request output options:\n- error (boolean) - the flag of the response status\n- errorText (string) - the text error message from the backend\n- data (object) - the main data from the backend\n- additionalErrors (object) - the additional error data from the backend\n- code (number) - status-code from backend\n\n## Features and recommendations\n- body will be serialized in JSON if body data NOT FormData\n\n## !!! Attention !!!\n### If you need to support ie11 - please add the following polyfills\n\n```javascript\nimport 'abortcontroller-polyfill/dist/polyfill-patch-fetch';\nimport 'whatwg-fetch';\n```\n\n#### installation\n\n```javascript\nnpm install @mihanizm56/fetch-api\n```\n\n#### Please, be careful. The response will be the object:\n```javascript\n{\n  error: boolean,\n  data: Array<IResponse>,\n  additionalErrors: null,\n  errorText: string,\n  code: number\n}\n```\n#### The usage of the request api\n\n```javascript\nconst { error, errorText, data, additionalErrors } = await createItemsRequest(\n  someData\n);\n```\n#### Set persist options to all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setResponseTrackCallback(({\n  requestParams, // all request parameters\n  response, //  pure response protected object\n  pureResponseData, // response body without formatting\n  requestError: boolean, // is request crashed\n  formattedResponseData // formatted response data in IResponse interface\n}) => ({\n // do some metrics or logging here\n}));\n```\n\n#### Set callback for metrics for all requests\n\n```javascript\nimport { ProxyController } from \"@mihanizm56/fetch-api\";\n\nnew ProxyController().setPersistentOptions(() => ({\n  headers: {\n    foo: 'bar',\n  },\n}));\n```","readmeFilename":"README.md","gitHead":"81bd5611aa487e2c5b513ccefb3cc52c88679afc","_nodeVersion":"20.10.0","_npmVersion":"10.2.3","dist":{"integrity":"sha512-DC3qUIef5ds1eMppM/hUCwaUWm3x259sQw7aDhR4MS3OcIVsk7qtUG0hKkdde4R8TaG3VIujOqKHHJGuzXe/uA==","shasum":"14edf2ee47ebc31bb8534e07ce579c56ea400513","tarball":"https://registry.npmjs.org/@mihanizm56/fetch-api/-/fetch-api-4.0.0-beta.5.tgz","fileCount":125,"unpackedSize":303318,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCNLPWz+p0senRnRI265wa6BMvytYT02D+jNvwWiKHS9AIgC6B+yytX/pqdG05OPfcJ1qeb39CoMv9u+rfe7KiRkak="}]},"_npmUser":{"name":"mihanizm56","email":"m727507.56@mail.ru"},"directories":{},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fetch-api_4.0.0-beta.5_1702596408222_0.9590928695656762"},"_hasShrinkwrap":false}},"time":{"created":"2020-03-22T00:59:52.035Z","1.0.0":"2020-03-22T00:59:52.436Z","modified":"2023-12-14T23:26:48.654Z","1.0.1":"2020-03-22T01:05:11.762Z","1.0.2":"2020-03-22T03:32:15.145Z","1.0.3":"2020-03-22T03:32:42.305Z","1.0.4":"2020-03-22T03:48:00.150Z","1.0.5":"2020-03-22T03:57:47.179Z","1.0.6":"2020-03-22T04:01:48.898Z","1.0.7":"2020-03-22T04:32:28.197Z","1.1.0":"2020-03-22T06:17:09.987Z","1.1.1":"2020-03-22T06:30:51.507Z","1.1.2":"2020-03-22T19:49:33.295Z","1.1.3":"2020-03-22T19:58:20.817Z","1.1.4":"2020-03-23T00:16:46.616Z","1.1.5":"2020-03-23T00:18:40.360Z","1.1.6":"2020-03-23T00:27:54.073Z","1.1.7":"2020-03-23T00:31:44.127Z","2.0.0":"2020-03-24T00:18:22.008Z","2.0.1":"2020-03-24T00:33:10.934Z","2.0.2":"2020-03-24T00:43:42.686Z","2.0.3":"2020-03-24T00:46:43.948Z","2.0.4":"2020-03-24T01:01:31.511Z","2.0.5":"2020-03-24T01:08:54.653Z","2.1.0":"2020-03-24T01:25:16.662Z","2.1.1":"2020-03-24T01:45:13.879Z","2.1.2":"2020-03-24T01:50:54.940Z","2.2.0":"2020-03-28T22:52:53.992Z","3.0.1":"2020-03-29T00:15:43.148Z","3.0.3":"2020-03-29T00:38:42.348Z","3.0.4":"2020-04-02T01:36:37.557Z","2.1.3":"2020-04-02T01:54:30.023Z","2.2.1":"2020-04-02T02:07:10.669Z","3.0.5":"2020-04-03T23:25:01.863Z","3.0.5-beta.1":"2020-04-03T23:28:29.439Z","3.0.5-beta.2":"2020-04-04T00:25:22.611Z","3.0.5-beta.3":"2020-04-04T14:33:57.482Z","3.0.5-beta.4":"2020-04-04T14:39:22.967Z","3.0.5-beta.5":"2020-04-04T14:41:00.846Z","3.0.5-beta.6":"2020-04-04T14:48:43.472Z","3.0.5-beta.7":"2020-04-04T14:51:54.135Z","3.0.5-beta.8":"2020-04-04T14:58:18.800Z","3.0.5-beta.9":"2020-04-04T15:05:43.937Z","3.0.5-beta.10":"2020-04-04T15:21:45.796Z","3.0.5-beta.11":"2020-04-04T15:26:13.902Z","3.0.5-beta.12":"2020-04-04T15:30:03.973Z","3.0.5-beta.14":"2020-04-04T16:02:09.950Z","3.0.5-beta.15":"2020-04-04T19:20:15.107Z","3.0.5-beta.16":"2020-04-04T21:19:12.200Z","3.0.5-beta.17":"2020-04-04T21:34:41.582Z","3.1.0":"2020-04-04T22:17:51.142Z","3.0.5-beta.18":"2020-04-04T22:22:23.366Z","3.1.1":"2020-04-04T22:27:07.752Z","3.1.2":"2020-04-04T22:41:19.566Z","3.1.4":"2020-04-06T22:25:58.650Z","3.2.0-beta.0":"2020-04-10T22:11:23.947Z","3.2.0-beta.1":"2020-04-11T00:35:01.544Z","3.2.0-beta.2":"2020-04-11T02:09:08.615Z","3.2.0-beta.3":"2020-04-11T02:27:15.412Z","3.2.0-beta.4":"2020-04-11T13:17:07.402Z","3.2.0-beta.5":"2020-04-11T13:32:09.018Z","3.2.0-beta.6":"2020-04-11T13:55:56.818Z","3.2.0-beta.7":"2020-04-11T17:26:30.980Z","3.2.0-beta.8":"2020-04-11T18:03:37.068Z","3.2.0-beta.9":"2020-04-12T14:33:36.964Z","3.2.0-beta.10":"2020-04-16T04:24:41.574Z","3.2.0-beta.11":"2020-04-17T21:17:09.662Z","3.2.0-beta.12":"2020-04-19T00:01:57.957Z","3.2.0-beta.13":"2020-04-19T00:19:00.238Z","3.2.0-beta.14":"2020-04-19T18:32:29.325Z","3.2.0-beta.15":"2020-04-19T19:32:29.949Z","3.2.0-beta.16":"2020-04-20T11:50:09.875Z","3.2.0-beta.17":"2020-04-20T22:44:27.516Z","3.2.0-beta.18":"2020-04-20T23:23:58.408Z","3.2.0-beta.19":"2020-04-21T10:30:26.814Z","3.2.1":"2020-04-22T01:20:45.476Z","3.3.0-beta.0":"2020-05-01T01:56:43.437Z","3.3.0-beta.1":"2020-05-01T01:59:23.811Z","3.3.0-beta.2":"2020-05-04T21:49:38.634Z","3.3.0-beta.5":"2020-05-07T00:01:35.407Z","3.3.0-beta.6":"2020-05-07T00:04:26.456Z","3.3.0-beta.7":"2020-05-07T00:38:08.372Z","3.3.0-beta.9":"2020-05-08T01:53:30.382Z","3.3.0-beta.10":"2020-05-13T01:21:48.935Z","3.3.0-beta.11":"2020-05-13T15:08:57.399Z","3.3.1":"2020-05-16T04:10:42.702Z","3.3.2-beta.0":"2020-05-16T04:30:27.473Z","3.3.2-beta.1":"2020-05-16T04:31:54.301Z","3.3.2-beta.2":"2020-05-16T04:34:25.290Z","3.3.2-beta.3":"2020-05-16T04:36:18.987Z","3.3.2-beta.4":"2020-05-16T04:37:45.239Z","3.3.2-beta.5":"2020-05-16T04:40:22.823Z","3.3.2":"2020-05-16T04:46:20.960Z","3.3.3-beta.0":"2020-05-20T00:39:15.123Z","3.3.3":"2020-05-20T01:16:40.532Z","3.3.4-beta.0":"2020-05-21T17:16:06.484Z","3.3.4-beta.1":"2020-05-22T11:04:35.915Z","3.3.4":"2020-05-22T14:37:54.016Z","3.3.5-beta.1":"2020-05-27T13:06:52.213Z","3.3.5-passport.1":"2020-05-27T17:42:41.777Z","3.3.5-passport.2":"2020-05-27T18:29:53.619Z","3.3.5-passport.3":"2020-05-27T18:30:09.819Z","3.3.5-passport.4":"2020-05-29T15:21:32.661Z","3.3.5-beta.10":"2020-05-31T00:14:23.957Z","3.3.5":"2020-06-01T16:07:56.244Z","3.3.6":"2020-06-08T01:46:31.851Z","3.3.6-beta.1":"2020-06-15T15:42:02.505Z","3.3.7-beta.1":"2020-06-15T15:43:27.094Z","3.3.7-beta.2":"2020-06-17T11:02:00.279Z","3.3.7":"2020-06-20T23:59:25.259Z","3.3.8":"2020-06-21T00:02:23.571Z","3.3.9-beta.0":"2020-06-26T12:16:02.488Z","3.3.9-beta.1":"2020-06-26T12:21:17.032Z","3.3.9-beta.3":"2020-06-28T15:26:45.527Z","3.3.9":"2020-06-28T15:36:17.697Z","3.3.10":"2020-06-29T00:42:39.301Z","3.3.11-beta.0":"2020-06-29T01:38:08.622Z","3.3.11":"2020-06-29T02:33:02.205Z","3.3.12-beta.1":"2020-06-30T20:08:34.642Z","3.3.12":"2020-06-30T20:12:05.289Z","3.3.13-beta.1":"2020-07-01T11:06:11.867Z","3.3.13":"2020-07-01T11:44:11.587Z","3.3.14-beta.1":"2020-07-05T13:49:15.458Z","3.3.14-beta.2":"2020-07-05T19:58:50.209Z","3.3.14":"2020-07-05T21:38:59.717Z","3.3.15-beta-1":"2020-07-22T16:57:20.314Z","3.3.15":"2020-07-25T23:14:20.912Z","3.3.16-beta.1":"2020-08-29T22:33:32.077Z","3.3.16-beta.2":"2020-08-31T08:55:25.291Z","3.3.16-beta.3":"2020-08-31T08:57:37.316Z","3.3.16-beta.4":"2020-09-06T20:43:42.873Z","3.3.16-beta.5":"2020-09-08T12:02:47.952Z","3.3.16-beta.6":"2020-09-08T14:29:17.985Z","3.3.16-beta.7":"2020-09-08T15:23:51.878Z","3.3.16":"2020-09-11T19:01:06.914Z","3.3.17":"2020-09-21T00:43:45.644Z","3.3.18-beta.1":"2020-09-21T13:01:43.395Z","3.3.18":"2020-09-24T10:47:26.151Z","3.3.19-beta.2":"2020-09-27T20:26:43.161Z","3.3.19-beta.3":"2020-09-27T20:59:44.938Z","3.3.19-beta.4":"2020-09-27T21:56:42.353Z","3.3.19":"2020-09-27T22:34:35.005Z","3.4.0-beta.1":"2020-09-30T01:14:31.391Z","3.4.0-beta.2":"2020-10-01T00:47:09.663Z","3.4.0-beta.3":"2020-10-01T01:00:41.784Z","3.4.0-beta.4":"2020-10-01T01:08:51.481Z","3.3.20":"2020-10-01T01:22:21.769Z","3.3.21":"2020-10-01T18:17:06.770Z","3.3.21-beta.1":"2020-10-01T22:05:25.232Z","3.3.22":"2020-10-02T02:20:18.720Z","3.3.23-beta.1":"2020-10-07T01:54:32.588Z","3.4.0-beta.5":"2020-10-21T19:30:03.402Z","3.4.0-beta.6":"2020-11-02T10:38:40.433Z","3.3.23":"2020-11-02T11:38:01.290Z","3.4.0":"2020-11-08T20:59:27.104Z","3.4.1":"2020-11-11T09:31:00.161Z","3.4.2-beta.1":"2020-11-11T09:42:02.959Z","3.4.2-beta.2":"2020-11-24T17:50:55.508Z","3.4.2":"2020-11-24T17:52:20.640Z","3.4.3-beta.1":"2020-11-30T10:12:56.519Z","3.4.3-beta.2":"2020-11-30T10:16:46.497Z","3.4.3-beta.3":"2020-11-30T10:32:16.544Z","3.4.3":"2020-11-30T12:46:48.496Z","3.4.4-beta.1":"2020-12-14T21:43:43.976Z","3.4.4":"2020-12-14T21:49:04.559Z","3.4.5":"2020-12-16T00:29:24.003Z","3.5.0-beta.1":"2020-12-25T21:25:35.202Z","3.5.0-beta.2":"2020-12-26T18:16:26.344Z","3.5.0-beta.3":"2020-12-26T18:35:42.363Z","3.5.0-beta.4":"2020-12-28T22:58:03.035Z","3.5.0":"2021-01-02T16:51:09.886Z","3.5.1":"2021-01-02T21:01:23.515Z","3.5.2-beta.1":"2021-01-11T17:19:22.999Z","3.5.2-beta.2":"2021-01-15T10:11:44.613Z","3.4.6-beta.1":"2021-01-15T10:15:46.207Z","3.4.6":"2021-01-15T10:20:16.843Z","3.5.2":"2021-01-19T21:09:52.270Z","3.6.0":"2021-01-29T22:51:33.058Z","3.6.1-beta.1":"2021-02-07T00:57:22.546Z","3.6.1-beta.2":"2021-02-07T01:03:38.128Z","3.6.1-beta.3":"2021-02-08T16:37:18.628Z","3.6.1-beta.4":"2021-02-08T16:46:31.151Z","3.6.1":"2021-02-08T19:24:19.412Z","3.6.2-beta.1":"2021-02-09T00:00:17.857Z","3.6.2-beta.2":"2021-02-09T00:14:07.012Z","3.6.2-beta.3":"2021-02-09T11:30:25.787Z","3.6.2":"2021-02-09T17:26:33.870Z","4.0.0-beta.0":"2021-02-21T17:26:13.369Z","3.6.3-beta.0":"2021-02-21T18:14:57.322Z","3.6.3":"2021-02-27T14:03:13.762Z","3.7.0-beta.1":"2021-03-10T00:21:14.217Z","3.7.0-beta.2":"2021-03-10T15:42:23.280Z","3.7.0-beta.3":"2021-03-10T19:13:36.861Z","3.7.0-beta.4":"2021-03-10T22:18:59.327Z","3.7.0-beta.5":"2021-03-11T09:03:23.041Z","3.7.0-beta.6":"2021-03-11T09:19:33.195Z","3.7.0-beta.7":"2021-03-11T13:38:20.727Z","3.7.0-beta.8":"2021-03-11T18:34:42.772Z","3.7.0-beta.9":"2021-03-11T18:39:56.759Z","3.7.0":"2021-03-11T19:41:22.808Z","3.7.1-beta.1":"2021-04-04T16:01:23.861Z","3.7.1":"2021-04-04T16:16:16.636Z","3.7.2-beta.1":"2021-04-14T10:39:06.518Z","3.7.2-beta.2":"2021-04-14T10:45:01.880Z","3.7.2":"2021-04-16T11:43:43.371Z","3.7.3-beta.1":"2021-04-24T15:05:04.466Z","3.7.3":"2021-04-26T14:09:47.670Z","3.7.4-beta.1":"2021-06-01T11:52:46.856Z","3.7.4-beta.2":"2021-06-01T11:58:24.158Z","3.7.4-beta.3":"2021-06-01T12:10:22.490Z","3.7.4-beta.4":"2021-06-01T13:34:25.614Z","3.7.4":"2021-06-01T13:42:55.086Z","3.8.0-beta.1":"2021-07-02T23:06:06.395Z","3.8.0":"2021-07-07T01:02:59.879Z","3.8.1-beta.1":"2021-07-13T10:27:14.959Z","3.8.1":"2021-07-13T10:30:03.098Z","3.8.2-beta.1":"2021-08-01T22:57:43.468Z","3.8.2-beta.2":"2021-08-02T13:50:51.360Z","3.8.2-beta.3":"2021-08-03T00:05:20.278Z","3.8.2-beta.4":"2021-08-04T11:03:10.190Z","3.8.2":"2021-08-10T13:53:13.255Z","3.8.3":"2021-08-16T22:57:58.862Z","3.8.4-beta.1":"2021-08-16T23:22:07.036Z","3.8.4":"2021-08-18T22:07:52.346Z","3.8.5-beta.1":"2021-08-19T11:29:38.702Z","3.8.5":"2021-08-19T12:00:21.894Z","3.8.6-beta.1":"2021-09-27T22:08:29.065Z","3.8.6-beta.2":"2021-11-02T22:55:51.476Z","3.8.6-beta.3":"2021-11-04T15:50:52.974Z","3.8.6":"2021-11-04T15:53:13.516Z","3.8.7":"2021-11-04T15:54:57.229Z","3.8.8-beta.1":"2021-11-05T11:22:04.190Z","3.8.8-beta.2":"2021-11-05T11:34:36.630Z","3.8.8":"2021-11-05T11:57:31.886Z","3.8.9":"2021-11-18T20:45:46.155Z","3.8.10":"2021-11-18T20:52:37.495Z","3.8.10-beta.1":"2021-12-06T13:08:40.546Z","3.8.11":"2021-12-06T14:40:07.917Z","3.8.12-beta.1":"2021-12-09T12:28:38.036Z","3.8.12-beta.2":"2022-01-03T20:03:47.914Z","3.8.12-beta.3":"2022-01-03T20:14:50.979Z","3.8.12":"2022-01-13T13:02:19.236Z","3.8.13-beta.1":"2022-02-11T15:37:40.746Z","3.8.13-beta.2":"2022-02-12T21:48:02.181Z","3.8.13-beta.3":"2022-02-13T16:26:46.073Z","3.8.13-beta.4":"2022-03-15T17:43:52.604Z","3.8.13":"2022-03-16T11:52:22.423Z","3.8.14":"2022-05-18T11:01:02.063Z","3.8.15":"2022-05-18T22:09:32.621Z","3.8.16-beta.1":"2022-05-18T23:03:50.743Z","3.8.16":"2022-05-27T12:16:07.767Z","3.8.17-beta.1":"2022-06-06T00:25:59.289Z","3.8.17":"2022-06-29T11:05:00.840Z","3.8.18":"2022-10-08T17:39:19.817Z","3.8.19":"2022-10-15T20:58:09.601Z","3.8.20-beta.1":"2022-10-18T18:34:39.444Z","3.8.20-beta.2":"2022-10-22T19:14:51.807Z","3.8.20":"2022-11-20T14:30:46.098Z","3.9.0-beta.1":"2022-11-20T14:31:28.113Z","3.9.0-beta.2":"2022-11-23T15:36:20.656Z","3.9.0-beta.3":"2022-11-23T19:34:22.952Z","3.9.0-beta.4":"2022-11-24T16:39:38.704Z","3.9.0-beta.5":"2022-11-27T00:41:09.424Z","3.9.0-beta.6":"2022-11-27T01:28:27.833Z","3.9.0-beta.7":"2022-11-27T01:37:25.881Z","3.9.0-beta.8":"2022-11-27T01:42:17.354Z","3.9.0-beta.9":"2022-11-27T01:44:20.969Z","3.9.0-beta.10":"2022-11-27T01:48:32.457Z","3.9.0-beta.11":"2022-11-27T01:59:16.633Z","3.9.0":"2022-11-27T16:28:15.486Z","3.9.1":"2022-11-27T17:32:45.583Z","3.9.2-beta.1":"2022-11-28T22:20:58.377Z","3.9.2-beta.2":"2022-11-28T23:17:32.649Z","3.9.2-beta.3":"2022-11-30T16:57:53.510Z","3.9.2-beta.4":"2022-11-30T19:31:57.792Z","3.9.2-beta.5":"2022-12-02T21:07:33.776Z","3.9.2-beta.6":"2022-12-02T21:56:30.988Z","3.9.2-beta.7":"2022-12-02T23:55:04.808Z","3.9.2-beta.8":"2022-12-03T00:14:21.605Z","3.9.2-beta.9":"2022-12-07T10:57:13.836Z","3.9.2-beta.10":"2022-12-07T17:12:48.268Z","3.9.2-beta.11":"2022-12-07T21:48:25.899Z","3.9.2-beta.12":"2022-12-07T21:58:28.161Z","3.9.2-beta.13":"2022-12-08T15:30:19.680Z","3.9.2":"2022-12-14T15:10:58.863Z","3.9.3-beta.1":"2022-12-14T16:40:22.068Z","3.9.3-beta.2":"2022-12-14T21:16:57.799Z","3.9.3":"2022-12-19T10:51:50.780Z","3.9.4-beta.1":"2022-12-19T16:34:18.646Z","3.9.4-beta.2":"2022-12-22T18:10:46.868Z","3.9.4-beta.3":"2022-12-23T00:40:30.960Z","3.9.4-beta.4":"2022-12-23T01:08:16.888Z","3.9.4-beta.5":"2022-12-23T23:38:49.449Z","3.9.4-beta.6":"2022-12-26T22:04:31.729Z","3.9.4":"2022-12-30T15:16:36.104Z","3.10.0-beta.1":"2023-01-20T00:21:45.312Z","3.10.0-beta.2":"2023-01-20T23:10:17.029Z","3.10.0":"2023-10-09T01:24:56.282Z","3.10.1-beta.1":"2023-10-09T01:31:23.749Z","3.10.1":"2023-10-09T01:42:17.612Z","4.0.0-beta.1":"2023-12-08T01:34:45.766Z","4.0.0-beta.3":"2023-12-14T17:31:21.637Z","4.0.0-beta.4":"2023-12-14T23:24:56.857Z","4.0.0-beta.5":"2023-12-14T23:26:48.433Z"},"maintainers":[{"name":"mihanizm56","email":"m727507.56@mail.ru"}],"description":"api servise","homepage":"https://github.com/mihanizm56/fetch-api#readme","repository":{"type":"git","url":"git+https://github.com/mihanizm56/fetch-api.git"},"author":{"name":"mihanizm56"},"bugs":{"url":"https://github.com/mihanizm56/fetch-api/issues"},"license":"MIT","readme":"","readmeFilename":""}