From 58ae9d537c3e2afbf0480305a8fb599759862a0d Mon Sep 17 00:00:00 2001 From: Andreas Weber Date: Sun, 12 Feb 2023 21:26:45 +0100 Subject: [PATCH] docs: update changelog --- CHANGELOG.md | 82 +++++++++++++++++++--- package-lock.json | 18 ++--- package.json | 4 +- src/plugins/kafka/kafkaHttpRegionParser.ts | 2 +- 4 files changed, 85 insertions(+), 21 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e790049e..71944e1f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,21 +1,85 @@ -## 6.0.0 (2023-02-xx) +## 6.0.0 (2023-02-12) #### Breaking Changes -- Protocol Specific Request Clients are replaced with generic interface RequestClient. -- use `$requestClient.send()` to send string or Buffer with current client -- add EventListener `$requestClient.on('message', (response) => ...)` to access respones of client +- Protocol Specific Request Clients are replaced with generic interface RequestClient (`$requestClient`). - to access previous Client you can use `$requestClient.nativeClient` - removed Variables: amqpClient, amqpChannel, grpcStream, mqttClient, websocketClient - - requireUncached is removed #### Features -- simplified asserts ([docs](https://httpyac.github.io/guide/assert.html)) -- support Intellij Request Body separator -- support Intellij TextResponseStreaming (onEachLIne, onEachMessage) -- add `proxyExcludeList` config (AnWeber/vscode-httpyac#176) +- use `$requestClient.send()` to send string or Buffer with current client. Add EventListener `$requestClient.on('message', (response) => ...)` to access respones of client + +``` +MQTT tcp://broker.hivemq.com +topic: httpyac + +{{@streaming + async function writeStream(){ + await sleep(1000); + $requestClient.on("message", (response) => { + console.info(response); + }); + $requestClient.send("find me"); + await sleep(1000); + $requestClient.send("wait for response"); + await sleep(1000); + } + exports.waitPromise = writeStream(); +}} +``` + +- extended and simpler assert logic ([docs](https://httpyac.github.io/guide/assert.html)) + +``` +GET https://httpbin.org/anything + +?? status == 200 +``` + +- multiple specification of request body per response (like Intellij Request Body separator) + +``` +MQTT tcp://broker.hivemq.com +topic: httpyac + +Send one +=== +Send two +=== wait-for-server +=== wait-for-server +Send three +``` + +- websocket requests with same url as a websocket request are requested with the same url. You can keep a WebSocket Client open and send additional requests. + +``` +# @keepStreaming +wss://scrumpoker.foo + +### +wss://scrumpoker.foo +["CONNECT\naccept-version:1.1,1.0\nheart-beat:10000,10000\n\n\u0000"] +=== +["SUBSCRIBE\nid:sub-0\ndestination:/user/topic/username\n\n\u0000"] +=== +["SUBSCRIBE\nid:sub-1\ndestination:/user/topic/notification\n\n\u0000"] +=== +["SUBSCRIBE\nid:sub-3\ndestination:/topic/setting/cardset/{{roomId}}\n\n\u0000"] +=== +["SEND\ndestination:/ws/room/register\n\n{\"roomID\":\"{{roomId}}\"}\u0000"] +=== +["SEND\ndestination:/ws/user/username\n\n{\"username\":\"httpyac\"}\u0000"] +### +wss://scrumpoker.foo +["SEND\ndestination:/ws/room/{{roomId}}/estimate\n\n{\"estimation\":\"5\"}\u0000"] + +``` + +- add parallel option to cli and test runner to execute requests in parallel. +- process each line of an event stream like Intellij ([see](https://www.jetbrains.com/help/idea/http-response-handling-examples.html#stream_scripting)) +- add `proxyExcludeList` config to exclude some url from proxy calls (AnWeber/vscode-httpyac#176) #### Fixes diff --git a/package-lock.json b/package-lock.json index 45d491ad..7ebce8a5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "httpyac", - "version": "5.10.2", + "version": "6.0.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "httpyac", - "version": "5.10.2", + "version": "6.0.0", "license": "MIT", "dependencies": { "@cloudamqp/amqp-client": "^2.1.1", @@ -47,7 +47,7 @@ "@trivago/prettier-plugin-sort-imports": "^4.0.0", "@types/aws4": "^1.11.2", "@types/encodeurl": "^1.0.0", - "@types/eventsource": "^1.1.10", + "@types/eventsource": "1.1.10", "@types/inquirer": "^9.0.3", "@types/jest": "^29.2.6", "@types/lodash": "^4.14.191", @@ -2244,9 +2244,9 @@ "dev": true }, "node_modules/@types/eventsource": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/@types/eventsource/-/eventsource-1.1.11.tgz", - "integrity": "sha512-L7wLDZlWm5mROzv87W0ofIYeQP5K2UhoFnnUyEWLKM6UBb0ZNRgAqp98qE5DkgfBXdWfc2kYmw9KZm4NLjRbsw==", + "version": "1.1.10", + "resolved": "https://registry.npmjs.org/@types/eventsource/-/eventsource-1.1.10.tgz", + "integrity": "sha512-rYzRmJSnm44Xb7FICRXEjwe/26ZiiS+VMGmuD17PevMP56cGgLEsaM955sYQW0S+K7h+mPOL70vGf1hi4WDjVA==", "dev": true }, "node_modules/@types/graceful-fs": { @@ -11771,9 +11771,9 @@ "dev": true }, "@types/eventsource": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/@types/eventsource/-/eventsource-1.1.11.tgz", - "integrity": "sha512-L7wLDZlWm5mROzv87W0ofIYeQP5K2UhoFnnUyEWLKM6UBb0ZNRgAqp98qE5DkgfBXdWfc2kYmw9KZm4NLjRbsw==", + "version": "1.1.10", + "resolved": "https://registry.npmjs.org/@types/eventsource/-/eventsource-1.1.10.tgz", + "integrity": "sha512-rYzRmJSnm44Xb7FICRXEjwe/26ZiiS+VMGmuD17PevMP56cGgLEsaM955sYQW0S+K7h+mPOL70vGf1hi4WDjVA==", "dev": true }, "@types/graceful-fs": { diff --git a/package.json b/package.json index 1e70aa22..a14de7db 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "license": "MIT", "publisher": "AnWeber", "description": "HTTP/REST CLI Client for *.http files", - "version": "5.10.2", + "version": "6.0.0", "homepage": "https://github.com/AnWeber/httpyac", "repository": { "type": "git", @@ -69,7 +69,7 @@ "@trivago/prettier-plugin-sort-imports": "^4.0.0", "@types/aws4": "^1.11.2", "@types/encodeurl": "^1.0.0", - "@types/eventsource": "^1.1.10", + "@types/eventsource": "1.1.10", "@types/inquirer": "^9.0.3", "@types/jest": "^29.2.6", "@types/lodash": "^4.14.191", diff --git a/src/plugins/kafka/kafkaHttpRegionParser.ts b/src/plugins/kafka/kafkaHttpRegionParser.ts index 213f4bc3..06c0427d 100644 --- a/src/plugins/kafka/kafkaHttpRegionParser.ts +++ b/src/plugins/kafka/kafkaHttpRegionParser.ts @@ -5,7 +5,7 @@ import { KafkaRequestClient } from './kafkaRequestClient'; export const parseKafkaLine = utils.parseRequestLineFactory({ protocol: 'KAFKA', - methodRegex: /^\s*(kafka)\s*(?.+?)\s*$/iu, + methodRegex: /^\s*(kafka)\s+(?.+?)\s*$/iu, requestClientFactory(request, context) { return new KafkaRequestClient(request, context); },