Git Product home page Git Product logo

jet-client-support's People

Contributors

antonshuvaev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

jet-client-support's Issues

Support files as values to variables

Is your feature request related to a problem?

No

Describe the solution you'd like

I'd like to be able to specify a value as a file location that automatically resolves and the content of the file gets put into the variable. E.g. jwt below would have the value of file:///Users/nl/work/data/jwt. This would facility not having to paste the JWT each time.

{
staging: {
baseUrl: "https://taskmanagement.cognosos.dev/api/v0",
jwt: "file:///Users/nl/work/data/jwt"
},
}

Additional context

No response

Support finding requests/folders by Name, Description, or Endpoint.

Is your feature request related to a problem?

Currently, as far as I understand, the jc.findFolder() and jc.findRequest() functions can only search by ID, even though the ID of these objects are not exposed anywhere and must be found by checking the JetClient state JSON.

Describe the solution you'd like

Ideally, new methods would be created.

The ability to use {{variables}} in the strings without needing to call jc.variables etc. would be a very nice feature. Perhaps passing {{variables}} could be a boolean value?
e.g., jc.findFolderByName(folderName: string, parseVariables: boolean)
Used like: jc.findFolderByName("{{integrationFolder}}", true)

Finding folders:

  • findFolderById(idPrefix: string)
    • Replacement for the current findFolder() method, don't remove findFolder(), to keep backwards compatibility, but having a dedicated method for finding by ID would help with understanding at a glance. (Perhaps mark the current method as @deprecated?)
  • findFolderByName(folderName: string)
    • Finds folder by the name.
    • e.g., jc.findFolderByName("My API")
  • findFolderByDescription(folderDescription: string)
    • Finds folder by the description.
    • e.g., jc.findFolderByDescription("Testing API")

Finding requests:

  • findRequestById(idPrefix: string)
    • Replacement for the current findRequest() method, don't remove findRequest(), to keep backwards compatibility, but having a dedicated method for finding by ID would help with understanding at a glance. (Perhaps mark the current method as @deprecated?)
  • findRequestByName(requestName: string)
    • Finds request by the name.
    • e.g., jc.findRequestByName("Login Client")
  • findRequestByDescription(requestDescription: string)
    • Finds request by the name.
    • e.g., jc.findRequestByDescription("Posts client credentials")
  • findRequestByUrl(requestMethod: HttpMethod|string, requestUrl: string)
    • Finds request by the URL, it should also allow for specifying the request method, (GET, POST, etc.).
    • e.g., jc.findRequestByUrl(HttpMethod.POST, "{{clientUrl}}/login", true) (This example uses the {{variable}} parse boolean)

Additional context

No response

History akin to what the default Http client generates

Is your feature request related to a problem?

I'd like to keep a record (and do comparisons) between different results from the response.. The default http client generates file based results. Those results are available to be reviewed at a later time.

Describe the solution you'd like

Allow for the results to be saved automatically into a history like feature that the regular Http client generates.

Additional context

No response

Add support for request / response visualisation

Is your feature request related to a problem?

It seems it is not yet possible to visualise the requests / response sent in a format similar to Postman' console. having such visualisation can be very useful to debug missing variables or to see the exact content sent to the server.

Describe the solution you'd like

I'd suggest to integrate a "console" similar to Postman' console in the services tool window that could summarise the requests and their responses.

Using the service tool window will allow to either visualise all requests sent in a single view, or visualise them per collection / JetClient requests (similarly to DataGrip' visualisation of SQL requests).

Additional context

No response

Generate code snippet from request

Is your feature request related to a problem?

No problem. New feature request.

Describe the solution you'd like

A drop down button or side panel that will generate code snippets based on the current request and the language selected from a drop down. Similar to how Postman does it today.

Additional context

No response

XDebug Toggle

Is your feature request related to a problem?

No

Describe the solution you'd like

An option that could be enabled in the plugin settings to add a toggle for sending the XDebug header on requests. Other REST clients tend to support this via plugins or settings so it would be nice if Jet Client did as well.

Additional context

Functionality-wise, it would just need to add a XDEBUG_SESSION cookie to the request it sends. The value for this cookie could also be something set inside the plugin settings so that it could be customized for each project if needed.

Having the toggle itself be a button or checkbox near the Send button to enable/disable including this cookie would make life a lot easier when working with PHP APIs.

Make Spring import free

Is your feature request related to a problem?

Make Spring import free as this is main feature that user must like which helps developer to test api as fast

Describe the solution you'd like

Remove paid option from this particular feature

Additional context

No response

API export option

Is your feature request related to a problem?

yes, as developer import a api but cannot export too

make a API can be export which we have import on jetClient so we can provide api to team member

Describe the solution you'd like

add a feature to export api which will support on postman and other api testing software

Additional context

No response

Per-API-Call disabling of redirect

Is your feature request related to a problem?

Some API calls will return data that you do not quite know what to look for to parse until you see it, and in JC you cannot see it until you disable it in the settings globally and close and reopen the IDE.

Describe the solution you'd like

Ideally, have a per API settings panel where this can be changed, as likely there will be other settings needed eventually that might be added. (This is the approach taken by PostMan IIRC)

Optionally, have a directive similar to the IntelliJ http-client that might be inserted in the PreRequest tab (and which might also be used for other use cases later)

Additional context

No response

Curl import

Is your feature request related to a problem?

Should be easier to add curl requests.

Describe the solution you'd like

Would be great to be able to paste a curl command into the url and get all the params parsed and imported. Check Insomnia.

Additional context

No response

The content is not sent to my API

Describe the bug
I'm sending a PUT request with all the required information (Header, URL, Body), but the body is not sent from JetClient to my API, so I'm receiving an empty request.

Steps to reproduce

API software: PHP/Symfony API.

#[Route('/order', name: 'updateOrder', methods: ['PUT'])]
    public function updateOrder (Request $request): JsonResponse {
        
        if (!$request->headers->has('Accept') || $request->headers->get('Accept') !== 'application/json') {
            return new JsonResponse('Unauthorized', Response::HTTP_UNAUTHORIZED);
        }
        
        $jsonResponse = new JsonResponse([
            'code' => $request->getAcceptableContentTypes(),
            'message' => $request->getContent()
        ]);
        $jsonResponse->setStatusCode(Response::HTTP_OK);
        
        return $jsonResponse;
    }

This is the information I'm sending this payload. If I use Postman, HttpClient, or CURL in the terminal, it works, but when using JetClient, the content is not sent.

PUT https://127.0.0.1:8000/order
Accept: application/json
Content-Type: application/json

{
  "id" : 3,
  "order": 12345,
  "customer": 12345,
  "createdAt": "2023-12-17 03:40:12.454603"
}

JetClient Request.

image

Result with Empty content:

image

HttpClient Request

image

Expected behavior
The expected behavior is to receive the full content when using the JetClient plugin

Environment information:

  • OS: macOS Sonoma 14.2 (23C64)
  • IDE version: Build #PS-233.11799.297, built on December 11, 2023 \ Runtime version: 17.0.9+7-b1087.7 aarch64 \ VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
  • plugin version: 2023.1.19-233

Contrast with light theme

Is your feature request related to a problem?

As outlined in review comment 80821.

Describe the solution you'd like

It seems restarting the editor fixed the dark theme issues I noticed but flipped the issue to affect light themes somehow... anyway... When using the standard light or third party light themes, there are contrast issues in the tabs for requests.

Below is an example using the standard light theme:

Bildschirm­foto 2023-03-17 um 15 25 52

Below is an example using the third party cyan light theme:

Bildschirm­foto 2023-03-17 um 15 25 24

I am using the new UI mode in the editor if that helps.

Additional context

If the dark mode breaks again, I will update this issue.

Setting Environment Variable not working properly for imported postman collection or other

Describe the bug
If I import collection from Postman and in request test script I write some code to store response output in some variable ,so that variable defining is not happening properly.
refer below code
jc.folderVariables.setLocalEnv("api-auth-token-external", aaaggtokenValue.data.token);

This was converted from postman testscript to JC script
but when I run the API new variable gets created like
{
api: {
auth: {
token: {
external: "some value"
}
}
}
}

Instead, it should be stored as
{
"api-auth-token-external": "some value"
}

Environment information:

  • OS: MAC
  • IDE version: WebStorm 2023.1.3
  • plugin version: 2023.1.15-231

JetClient on Mac not using colorization or completion

Describe the bug
The test console for writing tests does not show color, syntax highlighting or completion when writing tests. This makes learning how to use jetclient very difficult as there doesn't seem to be any documentation online for this tool.

Outside of Jetclient, things work normally as expected.

Screenshot 2023-12-10 at 9 46 56 PM

Expected behavior
I would expect color highlighting and online documentation similiar to the youtube documents at https://youtu.be/hLPhPuoYjCY?si=REJM3ssi4JcBVXZn&t=377

Environment information:
JetClient : 2023-01-15-223
Android Studio Giraffe | 2022.3.1 Patch 1
MacOS 14.1 (Sonoma)

  • OS:
  • IDE version:
  • plugin version:

Add support for OAuth2 implicit flow

Is your feature request related to a problem?

Trying to get the authentication working when using Amazon Cognito as the OAuth2 provider.

Describe the solution you'd like

Add support for the Implicit flow. If you specify the response type as token when hitting the authorize endpoint with implicit grant enabled for that client then it will return the access token directly in the redirect with no extra steps needed.

Additional context

Their /oauth2/token endpoint requires a separate client since it requires a client secret to utilize. When setting up app clients inside Cognito, if you choose to support Authentication Code flow then it won't allow you to select the Client Credentials. Same if you select Client Credentials, it won't let you then select Authentication Code.

Curl import errors

Describe the bug
Importing the following curl results in two errors:

  1. The JSON string is not unescaped in the JSON body view.
  2. When trying to send the request JetClient complains that the Content-Length is present twice and no request is made unless you remove the imported header.

Steps to reproduce
Import this curl by pasting it into the address field:

 curl \
 -X POST \
 -H "Content-Length: 123" \
 -H "Content-Type: application/json; charset=UTF-8" \
 --data "{\"id\":\"b2f1c32b\"}" \
 "https://foo.com"

Expected behavior

  1. Should parse JSON if Content-Type is set to application/json
  2. Should remove the extra Content-Length? Or not add an automatic one?

Environment information:

  • OS: MacOS
  • IDE version: Build #PY-232.9559.58, built on August 22, 2023
  • plugin version: 2024.1.0-232

Add action to encode component

Is your feature request related to a problem?

Encoding URI components is very common when they contains special characters such as / to be used as variables or URI params, but JetClient currently does not have any to do so.

Describe the solution you'd like

When right clicking on a string, add an option to encode the selected text, or the whole string if no text is selected.

Additional context

No response

Unknown identifier: valuesOf

Describe the Issue

Hi,

An issue found on "porting over" a working http-client API to JetClient. On request made that leads to a redirect (and with auto redirect disabled) I parse the redirect headers for the location header values.

On the http-client syntax, it works with the following:

> {% client.global.set("redirect_URL", response.headers.valuesOf("Location")[0]); %}

And on the JetClient side, I have the following which I believe is correct

jc.folderVariables.setLocalEnv("report_url", jc.response.headers.valuesOf("location")[0])

but it generates the "Unknown identifier: valuesOf" error

It does seem to parse the command in the window properly in that the syntax checker correctly inserts the "name:" and "headerName" tags.

I get the same behavior on Linux and Windows clients and on different headers

Steps to reproduce?

1. Add a `jc.folderVariables.setLocalEnv("report_url", jc.response.headers.valuesOf("location")[0])` command to parse response header and add to variable

2. Encounter error in log as indicated

Operating System

Windows

IDE

Pycharm 2023.1 (Professional Edition)

JetClient version

2023.1.8

Relevant log output

2023-04-24 12:30:08,049 [8719623]   INFO - #io.jetclient.eL - Error while running script
TypeError: invokeMember (valuesOf) on io.jetclient.js.bindings.s failed due to: Unknown identifier: valuesOf
	at <js> :module:eval(test-script-45a36f6a.js:2:47-82)
	at org.graalvm.polyglot.Context.eval(Context.java:399)
	at io.jetclient.eL.a(SourceFile:271)
	at io.jetclient.eL.runTestsScript(SourceFile:216)
	at io.jetclient.a$c.completed(SourceFile:316)
	at io.jetclient.a$c.completed(SourceFile:290)
	at org.apache.hc.core5.concurrent.BasicFuture.completed(BasicFuture.java:123)
	at org.apache.hc.core5.concurrent.ComplexFuture.completed(ComplexFuture.java:72)
	at org.apache.hc.client5.http.impl.async.InternalAbstractHttpAsyncClient$1$1.completed(InternalAbstractHttpAsyncClient.java:280)
	at org.apache.hc.core5.http.nio.support.AbstractAsyncResponseConsumer.consumeResponse(AbstractAsyncResponseConsumer.java:114)
	at org.apache.hc.client5.http.impl.async.InternalAbstractHttpAsyncClient$1.handleResponse(InternalAbstractHttpAsyncClient.java:275)
	at org.apache.hc.client5.http.impl.async.AsyncHttpRequestRetryExec$1.handleResponse(AsyncHttpRequestRetryExec.java:118)
	at org.apache.hc.client5.http.impl.async.AsyncProtocolExec$1.handleResponse(AsyncProtocolExec.java:230)
	at org.apache.hc.client5.http.impl.async.HttpAsyncMainClientExec$1.consumeResponse(HttpAsyncMainClientExec.java:210)
	at org.apache.hc.core5.http2.impl.nio.ClientH2StreamHandler.consumeHeader(ClientH2StreamHandler.java:212)
	at org.apache.hc.core5.http2.impl.nio.AbstractH2StreamMultiplexer$H2Stream.consumeHeader(AbstractH2StreamMultiplexer.java:1628)
	at org.apache.hc.core5.http2.impl.nio.AbstractH2StreamMultiplexer.consumeHeaderFrame(AbstractH2StreamMultiplexer.java:1108)
	at org.apache.hc.core5.http2.impl.nio.AbstractH2StreamMultiplexer.consumeFrame(AbstractH2StreamMultiplexer.java:783)
	at org.apache.hc.core5.http2.impl.nio.AbstractH2StreamMultiplexer.onInput(AbstractH2StreamMultiplexer.java:445)
	at org.apache.hc.core5.http2.impl.nio.AbstractH2IOEventHandler.inputReady(AbstractH2IOEventHandler.java:65)
	at org.apache.hc.core5.http2.impl.nio.ClientH2IOEventHandler.inputReady(ClientH2IOEventHandler.java:39)
	at org.apache.hc.core5.reactor.ssl.SSLIOSession.decryptData(SSLIOSession.java:600)
	at org.apache.hc.core5.reactor.ssl.SSLIOSession.access$200(SSLIOSession.java:74)
	at org.apache.hc.core5.reactor.ssl.SSLIOSession$1.inputReady(SSLIOSession.java:202)
	at org.apache.hc.core5.reactor.InternalDataChannel.onIOEvent(InternalDataChannel.java:142)
	at org.apache.hc.core5.reactor.InternalChannel.handleIOEvent(InternalChannel.java:51)
	at org.apache.hc.core5.reactor.SingleCoreIOReactor.processEvents(SingleCoreIOReactor.java:178)
	at org.apache.hc.core5.reactor.SingleCoreIOReactor.doExecute(SingleCoreIOReactor.java:127)
	at org.apache.hc.core5.reactor.AbstractSingleCoreIOReactor.execute(AbstractSingleCoreIOReactor.java:86)
	at org.apache.hc.core5.reactor.IOReactorWorker.run(IOReactorWorker.java:44)
	at java.base/java.lang.Thread.run(Thread.java:833)

Screenshots, Videos, Additional Context

No response

Query Param hides if unchecked and doesn't show up if checked.

Describe the bug
If the checkbox of the query parameter form is unchecked, then then both the key and values hide and don't become visible if checkbox is checked again.
image

Steps to reproduce

  • Add query parameter key and value
  • Uncheck the checkbox

Expected behavior
It should not hide, instead it should just not get applied to the url

Environment information:

  • OS:
    Sonoma v14.0

  • IDE version:
    WebStorm 2023.2.4
    Build #WS-232.10203.14, built on October 25, 2023

  • plugin version:
    2023.1.18-232

JetClient should better display when a request is running

Is your feature request related to a problem?

There is currently no clear visual way to know if a request is running as the plugin does not grey the previous response and does not display any spinner in the client. Only the progress of a task in the bottom right of the IDE shows that something is going on.

Describe the solution you'd like

When a request is run, the response part should be greyed / overlayed by a spinner to clearly let user know a request is ongoing. This could also be used to easily cancel a request in case it takes too long (ex: attempting to run a request that cannot execute because of a networking issue and will timeout only after a minute or two).

Additional context

No response

Add interoperability with JetBrains HTTP Client

Is your feature request related to a problem?

JetBrains' HTTP Client and JetClient are two HTTP clients residing in the same IDE, meaning they could be used by people concurrently based on their needs / each team member preference.
Currently, one should maintain requests in both format, and JetBrains' HTTP Client being bundled, some may find it cumbersome to switch without an automated way to do so.

Describe the solution you'd like

The plugin would offer to import or export requests from / to the format used by JetBrains' HTTP client. We could even imagine a scenario where requests would be saved in their format instead of JSON, allowing JetClient to become a powerful GUI for JetBrains native format.

Additional context

JetBrains HTTP Client (plugin ID com.jetbrains.restClient) contains a feature to import / export requests to different format (located in com.intellij.httpClient.converters package).
I don't know if their API is stable enough / extendable, but it may be interesting to see if an importer similar to the cURL one could be implemented to easily interact with their requests.

Another solution would be to read their representation of a request, but I have no idea if this is feasible or not.

Add a way to visualize logging done in pre-requests and tests

Is your feature request related to a problem?

When building a pre-request or test script, it is common to use console.log() and similar functions to debug the JS code executed. Currently, there is no way to visualise these logs from the IDE (currently using DataGrip).

Describe the solution you'd like

A panel displaying the logs produced from pre-requests and tests. It might be part of the visualization described in #2, or a dedicated tool window (but I am not sure adding tool window is the most UX friendly way to approach this).

Additional context

With this issue and #2, the plugin would have a visualization similar to Postman' console.

API Request to an application using a self-signed certificate will not work

Describe the bug

Applications using a self-signed certificate not running on a standard port won't work

Steps to reproduce

  1. Have an application expose an API to a non-standard port with a self-signed certificate
  2. Execute a request to that API
  3. Allow the self-signed certificate
  4. Observe the error Error: Certificate for IP> doesn't match any of the subject alternative names: []

Expected behavior

The request should go through, and retrieve the response of the API request.

Environment information:

  • OS: Windows 10 22H2 19045.2846
  • IDE version: IDEA 2023.1.1 Ultimate Edition #IU-231.8770.65
  • plugin version: 2023.1.9-231

API Documentation

Is your feature request related to a problem?

I am using Jet client for testing of my api endpoint. It would be really helpful to some how write documentation about my api to help me remember of the payloads that are optionals and possible values. It would also be nice or good to have if that documentation could be exported in openapi

Describe the solution you'd like

I am using Jet client for testing of my api endpoint. It would be really helpful to some how write documentation about my api to help me remember of the payloads that are optionals and possible values. It would also be nice or good to have if that documentation could be exported in openapi

Additional context

No response

Add support for 2023.1 version

Is your feature request related to a problem?

The plugin is currently only available for 2022.* releases.

Describe the solution you'd like

I'd like to be able to test the plugin on the latest EAP / beta as the 2023.1 version is close to be released.

Additional context

No response

Allow Binary as a POST body type

Is your feature request related to a problem?

Currently, to send binary data I have to create and pick a file. However, my application uses many small binary packets in place of JSON. In order to simulate these requests I would have to make a file for every type of POST request.

Describe the solution you'd like

It would be really neat to have a "binary" type where hexadecimal or base-64 encoded binary could be submitted into the input box for the body, which would then be converted into a raw byte array for transit.

Inputting binary in hex form would look like this:
83 A3 69 6E 74 01 A5 66 6C 6F 61 74 CB 3F E0 00 00 00 00 00 00 A7 62 6F 6F 6C 65 61 6E C3

And Base64 like this:
gqVoZWxsb6V3b3JsZKRib29sww==

Inputting binary data would have be in a text form because it needs to be represented somehow, but having to save a file for each message really disrupts from the flow of having everything in the editor.

Additional context

No response

Question: How can we suppress a redirect on a Get Request?

Hi,

Please let me know if such questions should be sent elsewhere

I have a Get request that gets redirected but I need to suppress the redirect to be able to parse the headers of the initial response. In Postman there is a toggle for this in the Settings for the request, and in the bundled http-client there is a # @no-redirect directive that can be used. I looked through the docs but did not find anything related to this.

Thanks!

ink

OAuth 2 - Implicit Flow, Access Token not loaded

Describe the bug
I configured OAuth 2 Implicit Grant flow via Microsoft Entra. The Access Token call was successful, and Entra issued an Access Token, but this token was not loaded to the plugin config.

image
image

Steps to reproduce

  1. Set OAuth 2 as the Auth type
  2. Choose Implicit as Grant Type
  3. On Microsoft Entra (formerly Azure Active Directory), register an application to be able to obtain a Client ID and configure Redirect URIs --> Web
  4. In plugin OAuth 2 Options set:
  5. Hit the "GET NEW ACCESS TOKEN" button

Expected behavior
After hitting the button, Call Auth Service and automatically import obtained token to the plugin configuration.

Environment information:

  • OS: Windows 11 23H2 (OS Build 22631.2262)
  • IDE version: IntelliJ IDEA 2023.2.1 (Ultimate Edition), Build #IU-232.9559.62, built on August 23, 2023
  • plugin version: 2023.1.14-232

Add a way to predefine local variables when sharing a colleciton

Is your feature request related to a problem?

Currently, only shared variables are carried along a folder and there are no way to specify which local variables can be set. This complicate the discoverability of local variables in a folder.

Describe the solution you'd like

Add a way to list the local variables that could be set by a developer in a folder, exported without their value. This can be useful e.g. to set values specific to a developer or machine (ex: API credential, local port / URL,...) that are not suitable to be added as shared variables or that would expose information.

We could even imagine a way to specify which variables are expected by an environment group, like the URL / Port in the "application environment" env, and user ID / email / API Credential for an "API Instance" env.

Additional context

JetClient could use JSON Schema as a source for this as it is compatible with JSON5. We could also imagine exporting the current local variables to a JSON Schema to generate it as a draft.

Add GraphQL support

Is your feature request related to a problem?

While it is technically possible to execute GraphQL requests, you have to manually write JSON request with GraphQL payload as a string without syntax highlighting and autocomplete.

Describe the solution you'd like

It will be very convenient to have the following features, that will help with GraphQL requests:

  • GraphQL Text body format to get a syntax highlighting/autocomplete from existing GraphQL plugin
  • Proper JSON request payload construction if GraphQL format is selected
  • Request variables (same as folder/global variables, but for this request with the priority in resolution) – and this one maybe helpful not only for GraphQL

Additional context

No response

Raw data and headers of the Request being sent

Is your feature request related to a problem?

No problem associated with this feature request.

Describe the solution you'd like

When a request is made, there are tabs in the response area to see the raw data received and all the headers that were sent with the response. There are times when it would be useful to see the raw data and headers of the actual request being sent, to know for a fact what is being sent. Right now, when I need to verify the data on the wire being sent for the request, I have to fire up Wireshark to see it. It would be convenient if that raw data/headers were available from within JetClient.

Additional context

No response

Font sizes

Describe the bug
Font sizes are inconsistent, expecially in URL field, where the font size is almost unreadable (very small), while rest verb field is big and bold

Expected behavior
Add setting for font size in plugin configuration panel

Environment information:

  • OS: Linux
  • IDE version: 2023.1.3
  • plugin version: latest

TypeError: Cannot load Module 'chai' when running request with a test (request works fine without Test)

Describe the Issue

I have some requests that work in http-client in PyCharm that I want to forklift into JetClient

a POST request works fine if the Tests tab is empty, but as soon as I include the following:

jc.globalVariables.setEnv("job_id", jc.response.json().job.id, "Talkdesk")

and rerun the request I get the error. I am trying to parse the response from this request to assign a variable, 'job_id' to use in subsequent requests. The relevant code in the http-client works fine with the following:

> {% client.global.set("job_id", response.body.job.id); %}

I am completely new to JetClient (just subscribed) and have very little experience with PostMan though I have it installed so I might be missing something simple, but this does work on the http-client

Steps to reproduce?

1. take a working POST request with no Test content
2. add `jc.globalVariables.setEnv("job_id", jc.response.json().job.id, "Talkdesk")` as a test
3. request fails to run and generates the provided error

Operating System

Windows

IDE

Pycharm 2023.1 (Professional Edition)

JetClient version

2023.1.7-231

Relevant log output

2023-04-21 11:19:06,808 [13808139]   INFO - #io.jetclient.a - Failed to execute request
TypeError: Cannot load module: 'chai'
	at <js> :program(Unnamed:4:48-62)
	at org.graalvm.polyglot.Context.eval(Context.java:425)
	at io.jetclient.eL.createJsContext(SourceFile:100)
	at io.jetclient.a.executeRequest(SourceFile:247)
	at io.jetclient.a$e.run(SourceFile:209)
	at com.intellij.openapi.progress.impl.CoreProgressManager.startTask(CoreProgressManager.java:429)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.startTask(ProgressManagerImpl.java:114)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcessWithProgressAsynchronously$6(CoreProgressManager.java:480)
	at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$3(ProgressRunner.java:252)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:186)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$13(CoreProgressManager.java:604)
	at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:679)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:635)
	at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:603)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:60)
	at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:173)
	at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$4(ProgressRunner.java:252)
	at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:702)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:699)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:699)
	at java.base/java.lang.Thread.run(Thread.java:833)

Screenshots, Videos, Additional Context

No response

When adding a JWT token a space is inserted in the beginning

Describe the Issue

When adding a JWT token a space is inserted in the beginning of the token.

Steps to reproduce?

1. Create a request with a JWT token in Auth tab (select Token).
2. Paste JWT
3. Send request

Checking the token on the server shows that a space was added in the beginning. .strip() on the server removes the space and makes it work.

Operating System

MacOS

IDE

Pycharm 2022.3.3 Pro

JetClient version

2023.1.4-223

Relevant log output

No response

Screenshots, Videos, Additional Context

No response

Path variables are not displayed when you import an openapi (swagger) file

Describe the bug

When you import an openapi file
and you navigate to an imported request whose url is like for example {{baseUrl}}/persons/{uid}
the path variables editor (for uid in this case) is not displayed.

You have to click in the url text and press for example a space
in order for the editor to wake up and display the path variables

Environment information:

  • OS: macos ventura 13.3.1
  • IDE version: IntelliJ IDEA 2023.1.2
  • plugin version: 2023.1.10-231

Syntax highlighting in Pre-request and Test

Is your feature request related to a problem?

No syntax highlighting in Pre-request and Test

Describe the solution you'd like

Please add a syntax highlighting in Pre-request and Test

Additional context

No response

Follow standard "open in split view" JetBrains behaviour when focused on draft in tool window

Description

I use JetBrains products almost entirely from the keyboard, and In my typical workflow using JetClient (which is pure awesomeness by the way 😊👏) I want to open a JetClient request in split view to the side of the request handler code I'm working on.

Problem

Currently the standard shortcut for Open In Right Split (shift + return), when a request is focused in the tool window folder structure, doesn't behave the same as everywhere else in JetBrains IDEs, but instead opens the draft in the editor window in place of the current file.

Solution

  • Follow the convention of shift + return executing Open In Right Split.
  • Possibly add a context menu on right clicking a draft for mouse users as well?

Tabbed field navigation

Is your feature request related to a problem?

There is no problem related to this feature request.

Describe the solution you'd like

In the Multipart Form editor, it would be handy to be able to tab to the next field. So if I am typing in the Key field, I could hit Tab and the focus would move to the Value field. If I am in the Value field and hit Tab, it would move focus to the type select field on the next line. If focus is on the Type select field, and you hit Tab, focus would move to the Key field. That way when inputing form data with a number of fields, it would greatly increase efficiency rather than they way it is now where you have to move from the keyboard to the mouse, select the field, move from mouse to keyboard, and so on.

Additional context

No response

Add ability to create bookmarks of requests

Is your feature request related to a problem?

In large projects with a large number of endpoints it is time consuming to find the request you want to execute in such a large tree of requests. This applies more when you import swagger specs where you do not control how the requests are organized.

Describe the solution you'd like

It would be very helpful if you could create a folder called Bookmarks for example where you can place pointers to other requests. This way you can for example group together and organize the endpoints you use the most.

Additional context

No response

Import sync folder does not keep folder in sync after importing

Describe the bug
After importing a Sync Folder in JetClient tree the folder is not acting like a sync folder.
It does not monitor diffs and buttons Show Diff, Save and Restore are disabled.

Steps to reproduce

  1. Create a Collection and sync it to a path like for example /Users/geo/jetclient
  2. Create a Folder in collection with sync enabled
  3. Add some requests in folder

at this point everything works as expected

  1. Either import the /Users/geo/jetclient sync folder to another intellij project
    or just delete the collection from jetclient tree and reimport the /Users/geo/jetclient sync folder
  2. Now the collection does not act as synced

Environment information:

  • OS: macos ventura 13.3.1
  • IDE version: IntelliJ IDEA 2023.1.2
  • plugin version: 2023.1.10-231

Support for secret values to prevent commiting them to repository

Is your feature request related to a problem?

Security issues may arise due to commiting secret keys or passwords to a VCS.

Describe the solution you'd like

A way to define variables with secret values, so they aren't commited to the repository even if the Save functionality is used.
As a partial solution, these values could be stored in a folder that isn't typically commited, like the .idea folder.

Additional context

No response

Add ability to import from C# projects

Is your feature request related to a problem?

At the moment, I am unable to import my endpoints my C# dotnet project. I am using rider can detect the endpoints.

Describe the solution you'd like

Being able to easily import collections based on the project I am working on would be a game changer.

Additional context

No response

Add support for importing Postman requests / collections

Is your feature request related to a problem?

I'd like to migrate my APIs from Postman to JetClient.

Describe the solution you'd like

Postman using JSON format, the plugin would be able to read the exported request / collection / workspace(?) into JetClient format.

Additional context

I create this issue to follow it and know when it'll be made available, as I could read more format will be added later.

Add documentation in the test library type definition file

Is your feature request related to a problem?

There is no documentation beyond the method' declaration displayed in the IDE when writing a test / pre-request script.

Describe the solution you'd like

Adding documentation to jet-client.d.ts would allow it to be displayed directly in the IDE when writing code instead of having to lookup in the lib documentation on Github.

Additional context

No response

Is there a way to prevent Request being made on Pre-Request script?

Is your feature request related to a problem?

Let's say I have a Request but I only want that being run on a specific condition.
In general, I can just write throw new Error("cause of the error"); and thats it.

In my case I would like to use console.log() or console.info() before throwing an error but because of the throw new the console message is not displayed.

Describe the solution you'd like

Would it be possible to use return false; and still logging to console?

Currently the script return false; results the following:
image

When I would use return false I would expect that the Request is not being made at all.

Additional context

No response

Websocket

Is your feature request related to a problem?

It is not related to a problem

Describe the solution you'd like

Web socket client would be handy for testing a server. I could see initiating a connection and then having 2 views. One view could show any data being received from the server. Displaying textual data and maybe even have a prettifier for known formats. Maybe a hex output for binary data.

Second view would be a simple input textarea field where users could type in some JSON or any text data and send to the server over the socket.

Something as simple as that for the first round would be considerably handy.

Additional context

Postman application does implement a websockets interface and could be used as an example.

Being able to navigate from source code to request, and vice versa

Is your feature request related to a problem?

The examples given in the video only apply to Kotlin. I have found no way to go from a PHP source code to the API call (or vice versa).

This forces me to write comments such as,

/** * JETClient: see Tracking:/permissions/{user} */

to do the navigation manually.

To have a way of going back, I have to add a fake parameter such as "source": "/lib/cust/api/permissions/Handler.php@1285"

Describe the solution you'd like

In the PHPDoc of a method, I might have either a "@JetClient pointer-to-api-call" or a "@see jetclient:pointer-to-api-call", directly sending me to the relevant API call.

Having a way to go back would also be great (possibly offering a choice of all the places where a @JetClient pointer-to-THIS-api-call is present).

Additional context

No response

Multipart/form with file - Content length too long

I am using JetClient to test some multipart/form upload of files, which I see jetClient can do. I am using it with a paid license. When I select an image file of size 184K for one of the parts and try to submit the request, I get the message "Error: Content length is too long: 184882".

I pulled up WireShark and I did not see any requests being made on the network so this isn't coming from the API server. Is this some kind of limit imposed within JetClient, and if so, is it adjustable?

}Dan

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.