* [INS-1697] Create WebSocket Request (#5041)
* add fail safe
Co-authored-by: Mark Kim <mark.kim@konghq.com>
* Websockets IPC API (#5044)
* add url to ws-request model
* fix webSocketRequest typo and add url
* add websocket api and expose it through preload ipc
* add typings
Co-authored-by: Mark Kim <mark.kim@konghq.com>
* [INS-1701] Create/Close Websocket Connection (#5046)
* add websocket action bar and its components
* remove comments
* clean up
* reflect on the electron api
* remove unused files
* import name change
* add styling
* remove commet
* add suggested changes
* remove default value
* Add WebSocketRequest to sidebar and update types (#5048)
* [INS-1700] Delete Websocket Request (#5055)
* add websocket actions dropdown
* add actions to websocket request in sidebar
* [INS-1703] Display WebSocket messages - first pass (#5054)
* Update event types to improve inference
* Update websocket response pane to fetch/subscribe and display the events
* [INS-1693] Add WS echo server for smoke tests (#5050)
Co-authored-by: Dimitri Mitropoulos <dimitrimitropoulos@gmail.com>
* fix sidebar unit tests (#5064)
* [INS-1776] adds `ws` dependency explicitly (#5066)
* [INS-1702] WebSocket Send Message (#5052)
* add initial changes for websocket message
* add abstraction for db operation and websocket operation
* remove console
* add rename
* add basic testing
* add basic testing
* add unit tests
* add form event type
* add comments
* disallow exporting context directly
* add suggested changes
* refresh the query
* using useDeepCompareEffect
* rename variable
* add mock
* clean up
* clean up
* correct the file name
* add some changes
* removing nedb-context and its hooks
* remove database changes for event sending
* [INS-1778] Fix Global Module Typing Issue (#5065)
* fix typings
* add jest import
* [INS-1703] View WebSocket Messages (#5074)
* save changes
* add styles and move files around
* remove unused code
* clean up some components
* add clean up
* add timestamp component
* add unit tests
* add case
* add style changes
* [INS-1786] WebSocket headers tab (#5080)
* first ui pass
* extract and wire up bulk editor
* raise ready state, move send
* add upgrade header debug logs
* can pass header to websocket upgrade
* implement readOnly headers
* add upgrade event and sent headers
* clean up
* fill out http upgrade into the event
* change upgrade message
* read only headers while connected
* remove upgrade event
* revert bulk editor change
* fix header editable toggle
* add nunjucks todos
* improve readOnly implementation
* disable codemirror/nunjucks for websocket headers
* take calculated headers out of the data model
* move hardcoded default headers down the tree
* fix request url rendering issue
* removed spammy warning
* clarify prop name
* refine pair typing
* change placeholder
* remove readOnly header property
* fix readOnly header layout
* Update packages/insomnia/src/ui/components/dropdowns/websocket-request-actions-dropdown.tsx
* Show HTTP->WS upgrade (handshake) (#5091)
* first pass as event
* add handshake ui
* add timeline tab
* simplify ResponseTimelineViewer
* transform res debug modal to change timeline props
* decouple timeline fetching from timeline component
* timeline ui pass
* record headers in request and response models
* can view timeline history
* write timeline to file
* some timeline
* can persist event logs
* put interface beside usage
* add note
* add event log history
* remove table event row
* tidying up
* make ws colors match
* enable multiple open connections
* close open connections at app exit
* remove old test
* Update packages/insomnia/src/models/request-version.ts
* fix type
* default readystate
* fix preview css scroll
Co-authored-by: James Gatz <jamesgatzos@gmail.com>
* INS-1788: Add control flow to improve responsiveness. (#5094)
* INS-1788: Add control flow for responsiveness.
This prevents events from flooding the UI thread entirely.
* Add additional code comments.
* fixup: webSocketEvent -> webSocketEvents
* display response headers (#5102)
* Show errors in timeline (#5100)
* remove unused context provider
* show errors in event tab
* updates timeline with message and close
* clean up
* show errors in timeline
* fix WebSocket capitalisation
* make timeline reader specific to ws
* write outbound messages to the timeline
* fix type
* Make the head row sticky in the events table (#5103)
* Add client certificate support to websocket connections (#5112)
* [INS-1810] close connection on response change (#5104)
* close ws connection when response is changed
* add delete logic for the queue mapg
* set error response to active response
* useRef for CodeEditor
* extract closeRequest
* use requestId to eliminate inconsistencies
* refactor extract clean up methods
* timeline feedback
* change type annotation
* fix type
* Revert "use requestId to eliminate inconsistencies"
This reverts commit 98335a927e.
* [INS-1803] show cookie tab in response pane (#5105)
* hard code sending and storing to true
* make tab naming consistent
* hard code cookie settings to false
* fix headers isDisabled bug
* [INS-1805] Add Auth Header Tab (#5115)
* add minimal change to the auth flow
* add disable state
* adding dropdown disable
* simplify reducer
* fix lint
* [INS-1839] Rename tab Header everywhere (#5119)
* can import/export websocket requests (#5122)
* use responseId for timeline name (#5124)
* add react-virtual to virtualize the event log view (#5126)
* [INS-1833] Include Auth Header in Headers mapping for WebSocket Connection (#5120)
* add auth to the header
* remove console log
* remove unneeded async
* add success redirect logic to websocket server
* add unexpected-response handler
* remove digest auth (#5129)
* remove auth header and outbound message timeline (#5130)
* [INS-1840] Add Connected Status Label and Extras (#5131)
* add status related changes
* text label change
* WebSocket ipc typing proposal (#5125)
* make consistent with main bridge
* rename webSocket
* remove deviated mock
* use consistent arrow function defintions
* Update packages/insomnia/src/main/network/websocket.ts
* Set the environment for websocket responses (#5132)
* first pass (#5123)
* [INS-1843] Add more checks to WS smoke test (#5138)
* Fix failing websocket smoke test
* Add remaining websocket smoke server endopints to fixtures
* Add checks for basic-auth, bearer and redirect
* Rm assertion
* can select payload type (#5133)
* Implement nunjucks rendering for websocket urls, authentication, headers and urls (#5134)
* fix websocket->webSocket (#5142)
* bug fix (#5144)
* INS-1844: Implement basic event view functionality. (#5146)
* INS-1844: Implement basic event view functionality
* CSS fix to align Preview button with tab buttons.
* Reverse the order of WebSocket events (#5148)
* Reverse the event log order in the view and subscribe to messages after the latest
* WebSocket response model (#5147)
* init websocket-response model
* add websocket response model
* remove unused timeline getter
* remove unused functionality from the ws-response model
* can select and save payload message and preview mode (#5143)
* [INS-1838] Add Empty State (#5140)
* add empty state
* use the empty state pane
Co-authored-by: gatzjames <jamesgatzos@gmail.com>
* Bug/stabilise-ws-fetch-method (#5152)
* just poll
* remove cts and eventlog channel
* Fix/nitpicks (#5156)
* remove unused names
* fix copypasta icon
* ensure all subcompnent drop state on request change
* move empty state to response pane
* add websockets to quick switch (#5159)
* [INS-1800] Remove value validity check in the WebSocket headers (#5154)
* remove valid value check in the headers
* add header name filtering
Co-authored-by: Dimitri Mitropoulos <dimitrimitropoulos@gmail.com>
Co-authored-by: Mark Kim <mark.kim@konghq.com>
Co-authored-by: Filipe Freire <livrofubia@gmail.com>
Co-authored-by: Jack Kavanagh <jackkav@gmail.com>
Co-authored-by: John Chadwick <86682572+johnwchadwick@users.noreply.github.com>
Co-authored-by: David Marby <david@dmarby.se>
* fix: set default header f
Set deafult header for isomorphic-git httpClient.
Deafult behaviour for cli git command adds "Accept: */*" header,
to mimic this behaviour an defaultGitAcceptHeader will be set and merged with optional provided config headers.
#2220
* fix: change default header behaviour
faulty behaviour of merge with config headers, so currently no merge with config.headers
* Fix bug where we always only send the Accept header, and miss other headers
Co-authored-by: nHuebner <nico.huebner.1985@gmail.com>
Co-authored-by: Filipe Freire <livrofubia@gmail.com>
Co-authored-by: Dimitri Mitropoulos <dimitrimitropoulos@gmail.com>
Co-authored-by: Mark Kim <103070941+marckong@users.noreply.github.com>
Co-authored-by: Dimitri Mitropoulos <dimitrimitropoulos@gmail.com>
Co-authored-by: Mark Kim <103070941+marckong@users.noreply.github.com>
Fixes the input `.focus()` method call. The simplest fix was to revert the change in 3cf464d059.
There do not seem to be any new problems in the current application from reverting this commit's relevant changes, indicating that the original cause of the bug is no longer present.
* adds GitHubStarsButton
* adds incognito mode functionality
* adds segment
* update: only show stars on dashboard
I missed a comment on the ticket
* cancel fetch if component is no longer mounted
* new design
* change footer link (per request) now that the same link's in the header
* inlines links components per review feedback
* adds caching for fetched value to overcome over-rendering
* first pass
* remove old
* remove delete drill prop
* remove two more drills
* two more drills
* remove one drill
* constify
* two more drills
* remove preview mode get/set drills
* undrill exportAsHAR
* undrill debug response download
* undrill prettify option
* save ipc for next pass
* fix delete response
* make delete function uniform
* address feedback comments
* transform
* nest components to remove drills
* sort props
* rename overloaded children prop
* check for the length of children in request-group-row
Co-authored-by: gatzjames <jamesgatzos@gmail.com>
* add unit test for dropdown component
* refactor dropdown to function component wip
* use useLayoutEffect for updating the position
* update types to use DropdownHandle
* remove unused forcedposition
* remove dropup
* add warning about dropdown container
* add useCallback/useMemo
* re-export the container id for tests
* split the state
* Fix issue with activity toggle accessibility
* add unit tests
* update styled components to the object format
Co-authored-by: Mark Kim <mark.kim@konghq.com>
Co-authored-by: gatzjames <jamesgatzos@gmail.com>
* remove nunjucks usage from core themes
* adds package downloader script
* adds runtime validation for plugins still using nunjucks
* generateThemeCSS no longer needs to be async
* removes Nunjucks as valid type
* fix: edit cookie shows expires as an Invalid Date
* refactor: using date-fns for validation
* use datetime-local input and transform
* use defaultValue
Co-authored-by: tangweikun <tangweikun@corp.netease.com>
Co-authored-by: jackkav <jackkav@gmail.com>
* first pass
* simplify timeouts+intervals
Co-authored-by: James Gatz <jamesgatzos@gmail.com>
* use key to tidy up url bar
* fix lint error in hook
* fix type-check
* add border-right
* Update packages/insomnia/src/ui/css/components/request-url-bar.less
Co-authored-by: Filipe Freire <livrofubia@gmail.com>
* use --hl
Co-authored-by: James Gatz <jamesgatzos@gmail.com>
Co-authored-by: Filipe Freire <livrofubia@gmail.com>
* editable
* wrapper debug
* method dropdown
* request actions dropdown
* response history dropdown
* wrapper home
* copy button
* auth dropdown
* env dropdown
* content type dropdown
* fix types
* second pass
* response csv viewer
* useCallback pass
* more useCallbacks
* wrapper unit test
* simplify pagelayout
* fix editable bug in unit test
* wrapper unit test useCallbacks
* some gentle tidying
* useCallback usage for async func
* switch to useInterval
* updates types for Editable, Highlight, et al.
* moves usage after declaration
* extracts FC for AuthDropdown items
* removes some prop drilling and extracts component
* adds mandaotry useCallback, rm unused props, types
* use named exports from react npm like rest of project
eventually, we will remove usages of `React` default export since it's a hack from half a decade ago that's no longer necessary now that jsx-transform is a thing.
* removes unnecessary useImperativeHandle (we learn somethin' every day)
* adds necessary useCallback, removes unnecessary useImparativeHandle, TS
* fixes types for useRef (turns out you don't need null in the generic)
* removes unused props
* fixes types from ref helpers
* fixes return from useCallback
* updates useCallback usages
* fixes bind
* fixes lint
for some reason, kept getting:
```
insomnia: /home/dimitri/src/github.com/Kong/insomnia/packages/insomnia/src/preload.js
insomnia: 0:0 error Parsing error: "parserOptions.project" has been set for @typescript-eslint/parser.
insomnia: The file does not match your project config: packages/insomnia/src/preload.js.
insomnia: The file must be included in at least one of the projects provided
```
* revert incomplete type change
* remove unnecessary useEffect
Co-authored-by: Dimitri Mitropoulos <dimitrimitropoulos@gmail.com>
apply font-ligatures-variant style to all elements
Co-authored-by: Vincenzo De Petris <vincenzodepetris@gmail.it>
Co-authored-by: Filipe Freire <livrofubia@gmail.com>
* commit progress
* save changes
* add components and $schema
* add components and $schema
* adding a doc
* add typings
* fix unit tests
* fix unit tests
* add fix and verified with kong cli
* fix unit tests
* Improve types and parameter/body resolution
Co-authored-by: Mark Kim <marckong@users.noreply.github.com>
* fix circular "components" issue
Co-authored-by: gatzjames <jamesgatzos@gmail.com>
Co-authored-by: Mark Kim <marckong@users.noreply.github.com>
* feat: make NumberSetting support step
* fix: correct request timeout help message
* make default step 1 for NumberInput
* Provide similar experience for other inputs with ms
Co-authored-by: tangweikun <tangweikun@corp.netease.com>
Co-authored-by: gatzjames <jamesgatzos@gmail.com>
In some cases, the notifications endpoint can return a 204 response with
no body. This commit fixes a regression where this causes a warning.
Note that there is no user facing impact.
* add hack
* adding the empty string check else where
* limiting the event scope
This merge will close the following draft PR for its spike work as well.
* Enable noImplicitAny.
* extracts PreviewMode
* Update packages/insomnia/src/network/certificate-url-parse.ts
* Add missing type.
* un-any-ifies some of the modal onDone callbacks
easy enough.
* few more onDone, but the async ones this time
* Get rid of jsonlint any.
* adds noImplicitAny support for insomnia-smoke-test
* fixes playwright type error
* avoid full @ts-ignore in playwright
Co-authored-by: Dimitri Mitropoulos <dimitrimitropoulos@gmail.com>
* Make Button onClick prop more typeable
Swaps the order of the arguments so that the optional arg is second.
* Review fixes.
* removes some implicit any's
* NoticeTable to FC
might as well, at this point. we're trying to do these as we can as they present themselves
* fixes margin for collapse icon (broken before this PR)
and removes an unnecessary type parameter
Co-authored-by: Dimitri Mitropoulos <dimitrimitropoulos@gmail.com>
* can make grpc request
* can create GraphQL request
* remove hotkey logic
* remove new request modal
* match new hotkey to old quick request
* add request shortcuts to folder context menu
* merge both old hotkeys to new one
* added requestType to segment
* fix feedback
* fix requestType is event
* default to HTTP request
* add gitlab oauth provider and ui
* add gitlab remaining
* add graphql field in query
* add gitlab oauth provider and ui
* add gitlab remaining
* add graphql field in query
* add some changes for testing
* add gitlab oauth provider and ui
* add gitlab remaining
* add graphql field in query
* add some changes for testing
* add some changes
* modify test
* try to refresh the token on git auth failure
* use localStorage to retrieve the session token
* simplify e2e tests for gitlab
* read the gitlab config from the api
* refresh the token if unauthorised
* use the rest api to fetch the user's data
* add loading state for config and handle 4xx errors in the ui
Co-authored-by: jackkav <jackkav@gmail.com>
* improve config fetching
* fix(e2e): add mock route for config
* Fix fetching gitlab config from the API
* add src as dep to avatar component hook
Co-authored-by: Mark Kim <yowmark613@gmail.com>
Co-authored-by: jackkav <jackkav@gmail.com>
Co-authored-by: David Marby <david@dmarby.se>
*Added the unreserved character ~ and the reserved characters '(), to the URL matching regex since these can appear without being URL encoded.
*Added test for tilde in URL
* move some operations to main
* move more options to main
* move cookies and multipart
* remove cert legacy migration
* move auth and aws helper
* move certs options to main
* remove libcurl usage from renderer and tidy
* extract oauth2 flow back to renderer
* add parse headers tests
* minimally type req
* organise libcurl-promise by req properties
* minimally type used settings
* tidy up debug timeline
* fix cookie bug
* tasty little parsing function refactor
* doh! trim
* tidy up set cookie method/self review
* extracted functions from set-cookie logic
* refactoring with tests
* formatting after rebase
* clarification of duplicate header support
* tighten up parse headers
* simplify aws signing
* fix app version imports
* ⚡️ vite
* replace webpack with esbuild in build script
* move build sr to esbuild
* esbuild send-request shim
* remove main externals
* fix lint
* remove webpack from insomnia-testing
* removes more webpack stuff
TODO after this PR: make debugging work again
* pin swagger-ui-react to version before esm change
* restore prepare script to build in bootstrap
* use default tsconfig for eslint and apply fixes
* bundle insomnia-components as cjs/esm
* makes ca_certs.ts pass linting
* builds types for insomnia-components
* improve build script for production
* skip typechecking insomnia-components
* separate package from build
* add electron to externals
* add preload bundling and fix build output
* exclude grpc/proto-loader from the bundle
* move node packages to commonjs
* don't bundle grpc since it's a node module
* fix content security error
* use vite lib mode for insomnia-components
* tidy up vite config and tsconfig options
* update package-locks
* use process.env. for static build time variables
* fix vscode debugging
Co-authored-by: jackkav <jackkav@gmail.com>
Co-authored-by: Dimitri Mitropoulos <dimitrimitropoulos@gmail.com>
* extract db out of _actuallySend setup
* extract transform response headers
* extract send body
* simplify set cookie function
* remove respond and error helpers
* decouple body options from renderer
* fix tests
* fix cancel
* remove unused envid from _actuallysend
* remove unused body settings
* simplify aws error logic
* remove validate override/code review
* add envid back in for posterity
* fix test
* split body parsers
* extract set headers
* decouple multipart and headers
* raise unused props
* body compression must be overriden to null
* remove extra return/code review
* upgrades styled-components
* lockfiles
* map styled-components to the insomnia-app node_modules to fix React version mismatch
Co-authored-by: gatzjames <jamesgatzos@gmail.com>
* Concating x-kong-security-openid-connect config with security schemas config
* Removing enabled as it is enabled by default
* Small improvement + add tests
Co-authored-by: Dimitri Mitropoulos <dimitrimitropoulos@gmail.com>
Co-authored-by: Filipe Freire <livrofubia@gmail.com>
Co-authored-by: Dimitri Mitropoulos <dimitrimitropoulos@gmail.com>
* decouple modal and form
* separate the github settings forms
* switch the tab order in the repo settings modal
* change the github uri field to be required
* update types for the git repo form
Co-authored-by: gatzjames <jamesgatzos@gmail.com>