Compare commits

...

23 Commits

Author SHA1 Message Date
d92f0fb2e2 1.0.16 2019-08-26 17:08:10 +02:00
b858f9f711 fix(core): update 2019-08-26 17:08:09 +02:00
50cc5fdbe6 1.0.15 2019-08-25 17:19:13 +02:00
386d848d51 fix(core): update 2019-08-25 17:19:12 +02:00
9db92be274 1.0.14 2019-08-25 10:42:47 +02:00
4a06bedf3b 1.0.13 2019-08-23 18:01:38 +02:00
9787adf3f0 fix(core): update 2019-08-23 18:01:37 +02:00
280e67b86b 1.0.12 2019-08-23 17:07:34 +02:00
592e941211 fix(core): update 2019-08-23 17:07:34 +02:00
68ec93459b 1.0.11 2019-08-23 17:01:26 +02:00
8a4b3fa47e fix(core): update 2019-08-23 17:01:26 +02:00
ad7c2e97b8 1.0.10 2019-08-23 16:37:40 +02:00
0ff28152f3 fix(core): update 2019-08-23 16:37:40 +02:00
4718a03d7d 1.0.9 2019-08-23 14:53:39 +02:00
f99f79efb1 fix(core): update 2019-08-23 14:53:39 +02:00
ac653ac082 1.0.8 2019-08-23 14:50:12 +02:00
a8ee6b733f fix(core): update 2019-08-23 14:50:11 +02:00
f0117a0921 1.0.7 2019-08-23 14:47:39 +02:00
4af2d3f712 fix(core): update 2019-08-23 14:47:38 +02:00
0d7146d234 1.0.6 2019-08-23 14:42:19 +02:00
dfeda9b36a fix(core): update 2019-08-23 14:42:19 +02:00
0010aa1ccb 1.0.5 2019-08-23 14:35:51 +02:00
5afae8c158 fix(core): update 2019-08-23 14:35:50 +02:00
9 changed files with 158 additions and 158 deletions

View File

@ -1,5 +1,7 @@
# gitzone ci_default
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
variables:
GIT_STRATEGY: clone
cache:
paths:
@ -27,6 +29,8 @@ snyk:
stage: security
script:
- npmci npm prepare
- npmci node install stable
- npmci command npm cache clean --force
- npmci command npm install -g snyk
- npmci command npm install --ignore-scripts
- npmci command snyk test
@ -38,11 +42,11 @@ snyk:
# test stage
# ====================
testLTS:
testStable:
stage: test
script:
- npmci npm prepare
- npmci node install lts
- npmci node install stable
- npmci npm install
- npmci npm test
coverage: /\d+.?\d+?\%\s*coverage/

170
package-lock.json generated
View File

@ -1,23 +1,13 @@
{
"name": "@apiglobal/typedrequest",
"version": "1.0.4",
"version": "1.0.16",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"@airbnb/node-memwatch": {
"version": "1.0.2",
"resolved": "https://verdaccio.lossless.one/@airbnb%2fnode-memwatch/-/node-memwatch-1.0.2.tgz",
"integrity": "sha512-2R+MEEMSTUdKwQ6NFWkyA/UNoSjL1tMldZqJbZpgXSwNMBzlNlkUWEXKu9RqTTMkDqJRfGJ2VDs8gPlPK2APDQ==",
"dev": true,
"requires": {
"bindings": "^1.3.0",
"nan": "^2.9.2"
}
},
"@apiglobal/typedrequest-interfaces": {
"version": "1.0.4",
"resolved": "https://verdaccio.lossless.one/@apiglobal%2ftypedrequest-interfaces/-/typedrequest-interfaces-1.0.4.tgz",
"integrity": "sha512-ZlpTVg0KPZchPmJS2Ke11MWbvWBi2lS5ewBrCip+X/fGawDPDwXpIZvOqP5ATzr7JlZQyiLFhE3h59yZTHVHcA=="
"version": "1.0.7",
"resolved": "https://registry.npmjs.org/@apiglobal/typedrequest-interfaces/-/typedrequest-interfaces-1.0.7.tgz",
"integrity": "sha512-yPl0UcLFMwSQL7bK52wVjkgvadC+x2YS3+7T15V1A1dXNxa96yd4WX1fqcKqwnBrvYexq/8FaxWGi98tZ0oNwg=="
},
"@babel/code-frame": {
"version": "7.5.5",
@ -108,10 +98,9 @@
}
},
"@pushrocks/lik": {
"version": "3.0.10",
"resolved": "https://verdaccio.lossless.one/@pushrocks%2flik/-/lik-3.0.10.tgz",
"integrity": "sha512-iWG06QsrL6AAnjPRWMVz4bRaRE0jJt/HgEK0YeLqaSBLY8ju4ps1j4lEN8VrUlXGZyPB6UGQfcreesO24buYhQ==",
"dev": true,
"version": "3.0.11",
"resolved": "https://verdaccio.lossless.one/@pushrocks%2flik/-/lik-3.0.11.tgz",
"integrity": "sha512-SDKRPj9+xBTqozlDPcA7O6BcccM1Tw/sXPVP+OnhNxCubDZ/L2kGNpPpqm43NJUoNxSSo5wdBw4N7MAFYCGdVg==",
"requires": {
"@pushrocks/smartdelay": "^2.0.3",
"@pushrocks/smartpromise": "^3.0.2",
@ -149,7 +138,6 @@
"version": "2.0.3",
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartdelay/-/smartdelay-2.0.3.tgz",
"integrity": "sha512-TXKDDqsc7sBTLl+oiYNaF6IdNk1n70i8ur8QfwcUU6tegTnrEkvMWy9h5Zdty/fq1ioCNpKLvuXoA+fgYVwKGQ==",
"dev": true,
"requires": {
"@pushrocks/smartpromise": "^3.0.2"
}
@ -158,7 +146,6 @@
"version": "2.0.3",
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartevent/-/smartevent-2.0.3.tgz",
"integrity": "sha512-x4B1mzzE6LrMATXsRLNuZpMTlB2JodL44MA4bF4FucU3SBBiWhFv3CFJRlO9B23SKZ1fwdJQrk2lT7YTUHXXJQ==",
"dev": true,
"requires": {
"@pushrocks/smartpromise": "^2.0.5"
},
@ -166,8 +153,7 @@
"@pushrocks/smartpromise": {
"version": "2.0.5",
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartpromise/-/smartpromise-2.0.5.tgz",
"integrity": "sha512-9j/chLtIiNkR0MDw7Mpxg9slxAVvAQwUZuiaPYX5KpHdKxQaHLI1VZ8IN0vPhwlfgNO4i4vGXV0wB8BvSDj03g==",
"dev": true
"integrity": "sha512-9j/chLtIiNkR0MDw7Mpxg9slxAVvAQwUZuiaPYX5KpHdKxQaHLI1VZ8IN0vPhwlfgNO4i4vGXV0wB8BvSDj03g=="
}
}
},
@ -199,6 +185,16 @@
"vinyl-file": "^3.0.0"
}
},
"@pushrocks/smartjson": {
"version": "3.0.8",
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartjson/-/smartjson-3.0.8.tgz",
"integrity": "sha512-EjC3611RSZaZmK+nXxXrYDBxdxYWtrxjOrZtQzbYn0yM33KSCH0sLIAG8B2wYZVAOj4A2pC8mVxFSJ1w3iRFHg==",
"requires": {
"@types/fast-json-stable-stringify": "^2.0.0",
"fast-json-stable-stringify": "^2.0.0",
"lodash.clonedeep": "^4.5.0"
}
},
"@pushrocks/smartlog": {
"version": "2.0.19",
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartlog/-/smartlog-2.0.19.tgz",
@ -268,7 +264,6 @@
"version": "2.0.3",
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartrx/-/smartrx-2.0.3.tgz",
"integrity": "sha512-OWxagu+CBdPaq76AIg91hJyrNhDTlEpesj01ooWCeVIaLY3G7yvFkqHsEKNOwPUG1LzCWmjq1l1dHQx9p2vJ9A==",
"dev": true,
"requires": {
"@pushrocks/lik": "^3.0.2",
"@pushrocks/smartevent": "^2.0.3",
@ -279,8 +274,7 @@
"@pushrocks/smartpromise": {
"version": "2.0.5",
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartpromise/-/smartpromise-2.0.5.tgz",
"integrity": "sha512-9j/chLtIiNkR0MDw7Mpxg9slxAVvAQwUZuiaPYX5KpHdKxQaHLI1VZ8IN0vPhwlfgNO4i4vGXV0wB8BvSDj03g==",
"dev": true
"integrity": "sha512-9j/chLtIiNkR0MDw7Mpxg9slxAVvAQwUZuiaPYX5KpHdKxQaHLI1VZ8IN0vPhwlfgNO4i4vGXV0wB8BvSDj03g=="
}
}
},
@ -301,7 +295,6 @@
"version": "3.0.12",
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmarttime/-/smarttime-3.0.12.tgz",
"integrity": "sha512-NoMt1NUhNqcF5y7fCTHoC3d/+MobzgNUg6yHbSGxFRaentQzCrMPNahQIVLbrAStf03LUUBePUjSRdPYucP1gw==",
"dev": true,
"requires": {
"@pushrocks/smartpromise": "^3.0.2",
"@types/cron": "^1.7.1",
@ -311,15 +304,14 @@
}
},
"@pushrocks/tapbundle": {
"version": "3.0.11",
"resolved": "https://verdaccio.lossless.one/@pushrocks%2ftapbundle/-/tapbundle-3.0.11.tgz",
"integrity": "sha512-s7epZfJZX+LsBVmIYvoaY4WtgPvRLnHZMVTpQAPJGMBqxJAQxhQ2wvGJjmqMAGhhznAHI6t4g+m0KTp3vFIRVg==",
"version": "3.0.13",
"resolved": "https://verdaccio.lossless.one/@pushrocks%2ftapbundle/-/tapbundle-3.0.13.tgz",
"integrity": "sha512-23O4UMBafCuD+RnUlXNvtT9DGbL1HMD+xZE1Zcr7Ll7WvgxUgRQQfk9kq6qbLLbjaRe1J2Ijsgh1HuZbBaucLQ==",
"dev": true,
"requires": {
"@pushrocks/early": "^3.0.3",
"@pushrocks/smartdelay": "^2.0.3",
"@pushrocks/smartpromise": "^3.0.2",
"leakage": "^0.4.0",
"smartchai": "^2.0.1"
}
},
@ -351,12 +343,16 @@
"version": "1.7.1",
"resolved": "https://verdaccio.lossless.one/@types%2fcron/-/cron-1.7.1.tgz",
"integrity": "sha512-48brwgU18DqA0mQX1As5OcJEo1yNjaXMM6Mk4r8K1dOzLJRQ37FE/kCivKx7ClKEHfhX2FdcxKzJ1B744a+V3A==",
"dev": true,
"requires": {
"@types/node": "*",
"moment": ">=2.14.0"
}
},
"@types/fast-json-stable-stringify": {
"version": "2.0.0",
"resolved": "https://verdaccio.lossless.one/@types%2ffast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz",
"integrity": "sha512-mky/O83TXmGY39P1H9YbUpjV6l6voRYlufqfFCvel8l1phuy8HRjdWc1rrPuN53ITBJlbyMSV6z3niOySO5pgQ=="
},
"@types/figures": {
"version": "3.0.1",
"resolved": "https://verdaccio.lossless.one/@types%2ffigures/-/figures-3.0.1.tgz",
@ -386,20 +382,17 @@
"@types/luxon": {
"version": "1.15.2",
"resolved": "https://verdaccio.lossless.one/@types%2fluxon/-/luxon-1.15.2.tgz",
"integrity": "sha512-zHPoyVrLvNaiMRYdhmh88Rn489ZgAgbc6iLxR5Yi0VCNfeNYHcszbhJV2vDHLNrVGy35BPtWBRn4OP2F9BBvFw==",
"dev": true
"integrity": "sha512-zHPoyVrLvNaiMRYdhmh88Rn489ZgAgbc6iLxR5Yi0VCNfeNYHcszbhJV2vDHLNrVGy35BPtWBRn4OP2F9BBvFw=="
},
"@types/minimatch": {
"version": "3.0.3",
"resolved": "https://verdaccio.lossless.one/@types%2fminimatch/-/minimatch-3.0.3.tgz",
"integrity": "sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA==",
"dev": true
"integrity": "sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA=="
},
"@types/node": {
"version": "10.14.16",
"resolved": "https://verdaccio.lossless.one/@types%2fnode/-/node-10.14.16.tgz",
"integrity": "sha512-/opXIbfn0P+VLt+N8DE4l8Mn8rbhiJgabU96ZJ0p9mxOkIks5gh6RUnpHak7Yh0SFkyjO/ODbxsQQPV2bpMmyA==",
"dev": true
"version": "12.7.2",
"resolved": "https://verdaccio.lossless.one/@types%2fnode/-/node-12.7.2.tgz",
"integrity": "sha512-dyYO+f6ihZEtNPDcWNR1fkoTDf3zAK3lAABDze3mz6POyIercH0lEUawUFXlG8xaQZmm1yEBON/4TsYv/laDYg=="
},
"@types/vinyl": {
"version": "2.0.3",
@ -472,23 +465,12 @@
"balanced-match": {
"version": "1.0.0",
"resolved": "https://verdaccio.lossless.one/balanced-match/-/balanced-match-1.0.0.tgz",
"integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=",
"dev": true
},
"bindings": {
"version": "1.5.0",
"resolved": "https://verdaccio.lossless.one/bindings/-/bindings-1.5.0.tgz",
"integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==",
"dev": true,
"requires": {
"file-uri-to-path": "1.0.0"
}
"integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c="
},
"brace-expansion": {
"version": "1.1.11",
"resolved": "https://verdaccio.lossless.one/brace-expansion/-/brace-expansion-1.1.11.tgz",
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
"dev": true,
"requires": {
"balanced-match": "^1.0.0",
"concat-map": "0.0.1"
@ -651,8 +633,7 @@
"concat-map": {
"version": "0.0.1",
"resolved": "https://verdaccio.lossless.one/concat-map/-/concat-map-0.0.1.tgz",
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=",
"dev": true
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s="
},
"core-util-is": {
"version": "1.0.2",
@ -664,7 +645,6 @@
"version": "1.7.1",
"resolved": "https://verdaccio.lossless.one/cron/-/cron-1.7.1.tgz",
"integrity": "sha512-gmMB/pJcqUVs/NklR1sCGlNYM7TizEw+1gebz20BMc/8bTm/r7QUp3ZPSPlG8Z5XRlvb7qhjEjq/+bdIfUCL2A==",
"dev": true,
"requires": {
"moment-timezone": "^0.5.x"
}
@ -734,12 +714,6 @@
"once": "^1.4.0"
}
},
"es6-error": {
"version": "4.1.1",
"resolved": "https://verdaccio.lossless.one/es6-error/-/es6-error-4.1.1.tgz",
"integrity": "sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg==",
"dev": true
},
"escape-string-regexp": {
"version": "1.0.5",
"resolved": "https://verdaccio.lossless.one/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
@ -773,6 +747,11 @@
"strip-eof": "^1.0.0"
}
},
"fast-json-stable-stringify": {
"version": "2.0.0",
"resolved": "https://verdaccio.lossless.one/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz",
"integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I="
},
"figures": {
"version": "3.0.0",
"resolved": "https://verdaccio.lossless.one/figures/-/figures-3.0.0.tgz",
@ -782,12 +761,6 @@
"escape-string-regexp": "^1.0.5"
}
},
"file-uri-to-path": {
"version": "1.0.0",
"resolved": "https://verdaccio.lossless.one/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz",
"integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==",
"dev": true
},
"find-up": {
"version": "3.0.0",
"resolved": "https://verdaccio.lossless.one/find-up/-/find-up-3.0.0.tgz",
@ -972,25 +945,6 @@
"invert-kv": "^2.0.0"
}
},
"leakage": {
"version": "0.4.0",
"resolved": "https://verdaccio.lossless.one/leakage/-/leakage-0.4.0.tgz",
"integrity": "sha512-x7gYK5n5dPkHDZWJ2Kh8Ag1hZNzUh+HtXn8Bv1aDdN6o6ONPCJ8sOfFq+kxcULJFp3lXaCjXb3iXOLmQRbBLwA==",
"dev": true,
"requires": {
"@airbnb/node-memwatch": "^1.0.2",
"es6-error": "^4.0.2",
"left-pad": "^1.1.3",
"minimist": "^1.2.0",
"pretty-bytes": "^4.0.2"
}
},
"left-pad": {
"version": "1.3.0",
"resolved": "https://verdaccio.lossless.one/left-pad/-/left-pad-1.3.0.tgz",
"integrity": "sha512-XI5MPzVNApjAyhQzphX8BkmKsKUxD4LdyK24iZeQGinBN9yTQT3bFlCBy/aVx2HrNcqQGsdot8ghrjyrvMCoEA==",
"dev": true
},
"locate-path": {
"version": "3.0.0",
"resolved": "https://verdaccio.lossless.one/locate-path/-/locate-path-3.0.0.tgz",
@ -1001,6 +955,11 @@
"path-exists": "^3.0.0"
}
},
"lodash.clonedeep": {
"version": "4.5.0",
"resolved": "https://verdaccio.lossless.one/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz",
"integrity": "sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8="
},
"log-symbols": {
"version": "2.2.0",
"resolved": "https://verdaccio.lossless.one/log-symbols/-/log-symbols-2.2.0.tgz",
@ -1013,8 +972,7 @@
"luxon": {
"version": "1.17.2",
"resolved": "https://verdaccio.lossless.one/luxon/-/luxon-1.17.2.tgz",
"integrity": "sha512-qELKtIj3HD41N+MvgoxArk8DZGUb4Gpiijs91oi+ZmKJzRlxY6CoyTwNoUwnogCVs4p8HuxVJDik9JbnYgrCng==",
"dev": true
"integrity": "sha512-qELKtIj3HD41N+MvgoxArk8DZGUb4Gpiijs91oi+ZmKJzRlxY6CoyTwNoUwnogCVs4p8HuxVJDik9JbnYgrCng=="
},
"make-error": {
"version": "1.3.5",
@ -1065,15 +1023,14 @@
"version": "3.0.4",
"resolved": "https://verdaccio.lossless.one/minimatch/-/minimatch-3.0.4.tgz",
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
"dev": true,
"requires": {
"brace-expansion": "^1.1.7"
}
},
"minimist": {
"version": "1.2.0",
"resolved": "https://verdaccio.lossless.one/minimist/-/minimist-1.2.0.tgz",
"integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=",
"version": "0.0.8",
"resolved": "https://verdaccio.lossless.one/minimist/-/minimist-0.0.8.tgz",
"integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=",
"dev": true
},
"mkdirp": {
@ -1083,37 +1040,21 @@
"dev": true,
"requires": {
"minimist": "0.0.8"
},
"dependencies": {
"minimist": {
"version": "0.0.8",
"resolved": "https://verdaccio.lossless.one/minimist/-/minimist-0.0.8.tgz",
"integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=",
"dev": true
}
}
},
"moment": {
"version": "2.24.0",
"resolved": "https://verdaccio.lossless.one/moment/-/moment-2.24.0.tgz",
"integrity": "sha512-bV7f+6l2QigeBBZSM/6yTNq4P2fNpSWj/0e7jQcy87A8e7o2nAfP/34/2ky5Vw4B9S446EtIhodAzkFCcR4dQg==",
"dev": true
"integrity": "sha512-bV7f+6l2QigeBBZSM/6yTNq4P2fNpSWj/0e7jQcy87A8e7o2nAfP/34/2ky5Vw4B9S446EtIhodAzkFCcR4dQg=="
},
"moment-timezone": {
"version": "0.5.26",
"resolved": "https://verdaccio.lossless.one/moment-timezone/-/moment-timezone-0.5.26.tgz",
"integrity": "sha512-sFP4cgEKTCymBBKgoxZjYzlSovC20Y6J7y3nanDc5RoBIXKlZhoYwBoZGe3flwU6A372AcRwScH8KiwV6zjy1g==",
"dev": true,
"requires": {
"moment": ">= 2.9.0"
}
},
"nan": {
"version": "2.14.0",
"resolved": "https://verdaccio.lossless.one/nan/-/nan-2.14.0.tgz",
"integrity": "sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==",
"dev": true
},
"nice-try": {
"version": "1.0.5",
"resolved": "https://verdaccio.lossless.one/nice-try/-/nice-try-1.0.5.tgz",
@ -1281,12 +1222,6 @@
"integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=",
"dev": true
},
"pretty-bytes": {
"version": "4.0.2",
"resolved": "https://verdaccio.lossless.one/pretty-bytes/-/pretty-bytes-4.0.2.tgz",
"integrity": "sha1-sr+C5zUNZcbDOqlaqlpPYyf2HNk=",
"dev": true
},
"process-nextick-args": {
"version": "2.0.1",
"resolved": "https://verdaccio.lossless.one/process-nextick-args/-/process-nextick-args-2.0.1.tgz",
@ -1365,7 +1300,6 @@
"version": "6.5.2",
"resolved": "https://verdaccio.lossless.one/rxjs/-/rxjs-6.5.2.tgz",
"integrity": "sha512-HUb7j3kvb7p7eCUHE3FqjoDsC1xfZQ4AHFWfTKSpZ+sAhhz5X1WX0ZuUqWbzB2QhSLp3DoLUG+hMdEDKqWo2Zg==",
"dev": true,
"requires": {
"tslib": "^1.9.0"
}
@ -1519,8 +1453,7 @@
"symbol-tree": {
"version": "3.2.4",
"resolved": "https://verdaccio.lossless.one/symbol-tree/-/symbol-tree-3.2.4.tgz",
"integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==",
"dev": true
"integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw=="
},
"ts-node": {
"version": "8.3.0",
@ -1538,8 +1471,7 @@
"tslib": {
"version": "1.10.0",
"resolved": "https://verdaccio.lossless.one/tslib/-/tslib-1.10.0.tgz",
"integrity": "sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ==",
"dev": true
"integrity": "sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ=="
},
"tslint": {
"version": "5.19.0",

View File

@ -1,6 +1,6 @@
{
"name": "@apiglobal/typedrequest",
"version": "1.0.4",
"version": "1.0.16",
"private": false,
"description": "make typed requests towards apis",
"main": "dist/index.js",
@ -15,13 +15,15 @@
"devDependencies": {
"@gitzone/tsbuild": "^2.0.22",
"@gitzone/tstest": "^1.0.15",
"@pushrocks/tapbundle": "^3.0.7",
"@types/node": "^10.11.7",
"@pushrocks/tapbundle": "^3.0.13",
"@types/node": "^12.7.2",
"tslint": "^5.19.0",
"tslint-config-prettier": "^1.18.0"
},
"dependencies": {
"@apiglobal/typedrequest-interfaces": "^1.0.4",
"@apiglobal/typedrequest-interfaces": "^1.0.7",
"@pushrocks/lik": "^3.0.11",
"@pushrocks/smartjson": "^3.0.8",
"@pushrocks/smartrequest": "^1.1.23"
},
"files": [

View File

@ -2,6 +2,7 @@ import { expect, tap } from '@pushrocks/tapbundle';
import * as typedrequest from '../ts/index';
tap.test('first test', async () => {
typedrequest.TypedRequest;
});
tap.start();

View File

@ -1,27 +1,3 @@
import * as plugins from './typedrequest.plugins';
export class TypedRequest<T extends plugins.typedRequestInterfaces.ITypedRequest> {
public urlEndPoint: string;
public method: string;
// STATIC
constructor(urlEndPointArg: string, methodArg: T['method']) {
this.urlEndPoint = urlEndPointArg;
this.method = methodArg;
};
/**
* firest the request
*/
public async fire(fireArg: T['request']): Promise<T['response']> {
const response = await plugins.smartrequest.request(this.urlEndPoint, {
method: 'POST',
requestBody: {
method: this.method,
request: fireArg,
response: null
}
});
return response.body.response;
}
}
export * from './typedrequest.classes.typedrequest';
export * from './typedrequest.classes.typedhandler';
export * from './typedrequest.classes.typedrouter';

View File

@ -0,0 +1,29 @@
import * as plugins from './typedrequest.plugins';
type THandlerFunction<T extends plugins.typedRequestInterfaces.ITypedRequest> = (requestArg: T['request']) => Promise<T['response']>;
/**
* typed handler for dealing with typed requests
*/
export class TypedHandler<T extends plugins.typedRequestInterfaces.ITypedRequest> {
public method: string;
private handlerFunction: THandlerFunction<T>;
constructor(methodArg: T['method'], handlerFunctionArg: THandlerFunction<T>) {
this.method = methodArg;
this.handlerFunction = handlerFunctionArg;
}
/**
* adds a response to the typedRequest
* @param typedRequestArg
*/
public async addResponse(typedRequestArg: T) {
if (typedRequestArg.method !== this.method) {
throw new Error('this handler has been given a wrong method to answer to. Please use a TypedRouter to filter requests');
}
const response = await this.handlerFunction(typedRequestArg.request);
typedRequestArg.response = response;
return typedRequestArg;
}
}

View File

@ -0,0 +1,27 @@
import * as plugins from './typedrequest.plugins';
export class TypedRequest<T extends plugins.typedRequestInterfaces.ITypedRequest> {
public urlEndPoint: string;
public method: string;
// STATIC
constructor(urlEndPointArg: string, methodArg: T['method']) {
this.urlEndPoint = urlEndPointArg;
this.method = methodArg;
}
/**
* firest the request
*/
public async fire(fireArg: T['request']): Promise<T['response']> {
const response = await plugins.smartrequest.request(this.urlEndPoint, {
method: 'POST',
requestBody: {
method: this.method,
request: fireArg,
response: null
}
});
return response.body.response;
}
}

View File

@ -0,0 +1,31 @@
import * as plugins from './typedrequest.plugins';
import { TypedHandler } from './typedrequest.classes.typedhandler';
/**
* A typed router decides on which typed handler to call based on the method
* specified in the typed request
* This is thought for reusing the same url endpoint for different methods
*/
export class TypedRouter {
public handlerMap = new plugins.lik.Objectmap<
TypedHandler<plugins.typedRequestInterfaces.ITypedRequest>
>();
/**
* adds the handler to the routing map
* @param handlerArg
*/
public addTypedHandler<T extends plugins.typedRequestInterfaces.ITypedRequest>(handlerArg: TypedHandler<T>) {
this.handlerMap.add(handlerArg);
}
public async addResponse(typedRequest: plugins.typedRequestInterfaces.ITypedRequest) {
const typedHandler = this.handlerMap.find(handler => {
return handler.method === typedRequest.method;
});
typedRequest = await typedHandler.addResponse(typedRequest);
return typedRequest;
}
}

View File

@ -1,13 +1,11 @@
// apiglobal scope
import * as typedRequestInterfaces from '@apiglobal/typedrequest-interfaces';
export {
typedRequestInterfaces
};
export { typedRequestInterfaces };
// pushrocks scope
import * as lik from '@pushrocks/lik';
import * as smartrequest from '@pushrocks/smartrequest';
import * as smartjson from '@pushrocks/smartjson';
export {
smartrequest
};
export { lik, smartrequest, smartjson };