Commit Graph

47 Commits

Author SHA1 Message Date
George He
056a4bcf4c chore(sdk): avoid invalid cookie blocking sending request (#8464) 2025-03-20 10:41:12 +08:00
George He
369b7c5b69 refactor(sdk): improve url parsing for valid or invalid url cases (#8439)
* refactor(sdk): improve url parsing for valid or invalid url cases

* fix: building error
2025-03-11 08:42:19 +00:00
George He
5194212fa7 fix(sdk): change insomnia.test mechanism to improve the nested test cases (#8388)
* fix: change insomnia.test mechanism to improve the nested test cases

* fix: support await tests and add auto-complete .test and .expect
2025-02-26 11:47:32 +08:00
George He
b80f68a4bd feat: support folder-env for replaceIn method in rendering (#8392) 2025-02-24 10:56:52 +08:00
Kent Wang
3abe124e27 feat: Using global private environment to save secrets[INS-4715] (#8233)
* add logic to handle vault secret items(vault environment)
* add modal to confirm export private environment when user exports global environment*
* mask all secret items value when export
* add logic to handle vault key reset and input request
* add encrypt/decrypt and remove secret function
* move removeAllSecrets function to modal
* basic integration with srp api
* api and encrypt/decrypt integration
* add modal for secrets environment variable without vault key hint
* integration with sse event of reset vault key
* add enableVaultInScripts settings to allow using vault in script
* add insomnia.vault to insomnia script
* Modify rendering logic to expose decrypted secrets to script
* remove keytar and use electron safestorage instead
* Do not allow set method in vault script
* add support for legacy environment with vault as environment key
* remove duplicate file due to rebase
2025-02-17 18:32:20 +08:00
George He
3ac16abe93 fix(sdk): get response size from bytesRead value (#8313)
* fix: get response size from bytesRead value

* fix: lint error
2025-02-17 18:13:59 +08:00
George He
3e9ead3b9c feat(sdk): enable folder env interfaces for manipulation in script (#8348)
* feat: enable folder env interfaces for manipulation in script

* fix: lint

* Fix table view environment not updated issue[INS-4875] (#8360)

* Fix table view environment not updated issue

* fix: fix comments and improve the test

---------

Co-authored-by: Kent Wang <kent.wang@konghq.com>
2025-02-17 14:20:31 +08:00
George He
c814d98e02 Fix/sdk/tagged url (#8361)
* fix: handle several different template syntaxes in url

* inso -> es2021

* fix: init certs in script

---------

Co-authored-by: Ryan Willis <ryan.willis@konghq.com>
2025-02-13 23:52:16 +08:00
Filipe Freire
62a21d367c fix: template render error [INS-4962] (#8338)
* fix: template render error [INS-4962]

* fix test

* improvements

* improvement

* improve tests
2025-02-06 16:01:19 +00:00
George He
95f524bbce fix(sdk): misc fixes and improvements (#8297)
* fix: include multiline and fileName in the multipart req body

* fix: reject setting null to insomnia.variables

* fix: comment

* fix: also update the scriptExecutor with getExistingConsole

* feat: support escape sequences for formatting in console

* fix: update test ouput

* refactor: support escape seqs

* fix: cli smoke test failed
2025-01-21 17:13:23 +08:00
Ryan Willis
78a97f4bfb fix: prevent unparseable response cookie from causing request to fail [INS-4851] (#8289)
* fix: prevent unparseable response cookie from causing request to fail

* loosen cookie parsing
2025-01-14 10:46:12 -07:00
George He
8f6ffa4e31 fix: add basic support for insomnia.request.size() (#8281) 2025-01-09 02:25:56 +00:00
George He
37ef377e8b feat(runner/settings): enable logging switch configuration (#8194)
* feat: enable configuration for turning on/off logging

* fix: lint error

* test: add a smoke test

* fix: smoke test

* fix: smoke test

* fix: smoke tests

* fix: make runtime as optional arg with default value

* chore: enable log

* chore: turn off flag

* fix: turn off restriction

* fix: failed to run smoke tests

* fix: remove unnecessary changes

* fix: unnecessary changes
2025-01-07 11:08:37 +08:00
Ryan Willis
90bd25c55f fix: pre-request script variable hostname certificate resolution [INS-4733] (#8249)
* fix: pre-request script variable hostname certificate resolution

* type fix

* fix failing test

* fully replace url tpls, default to http
2025-01-03 13:16:24 -07:00
George He
de29164483 fix(sdk): support async function in insomnia.test (#8243)
* fix: support async function in insomnia.test

* test: fix and add test

* fix: test failed

* fix: update the solution

* fix: lint

* fix: test failure

* fix: use regexp as replaceAll doesn't available

* chore: remove useless code
2024-12-23 03:39:50 +00:00
George He
12cb2fc842 fix(sdk): failed to transform proxy port between sdk and renderer (#8175)
* fix: update the proxy transforming between sdk and inso

* fix: lint error

* fix: smoke test

* chore: enable sentry for the hidden window

* chore: add tag for sentry reporting
2024-11-20 16:06:03 +08:00
George He
8fad1200ba fix(runner): extend insomnia.variables.set lifetime to whole execution period (#8157)
* fix(runner): extend insomnia.variables.set effect to whole execution period

* fix: lint error

* fix: update unit test

* fix: smoke test failed

* chore: enable rendering transient variables

* chore: unify variable names

* test: add smoke test
2024-11-13 17:52:03 +08:00
George He
e0f0813175 feat(runner): support several cases for setNextRequest (#8088)
* feat(runner): support several cases for setNextRequest

* fix: lint error

* fix: test errors

* refactor: add a test and simplify the logic

* fix: runner test failed

* fix: update the classname of items in the request list
2024-10-22 09:00:06 +00:00
George He
63054335ab fix(sdk): certificate 'disabled' property value gets lost in script execution (#7988) 2024-09-23 08:47:04 +00:00
Jack Kavanagh
deccf97204 feat: after-response cli (#7931)
* wip

* add after response example and wiring

* add tests and tap output

* check error case

* add reporters

* test reporters

* only list tests with results

* add failing test

* rename config function

* add test title
2024-09-12 11:30:24 +02:00
George He
58bea08bdb chore: return friendly message when sendRequest sees an error (#7911) 2024-09-06 03:18:20 +00:00
George He
02027fe5e1 chore(runner): cleaning up runner-pr1 and resolve conflicts (#7878)
* feat: log request testing results and return them to the main renderer

* fix: lint error

* fix: install chai with unified version across packages

* chore: restore package-lock

* chore: restore package-lock

* feat(GUI): enable test results pane (#7737)

* feat: enable the test result pane

* test: bring back tests and cleanups

* chore: replace tabitem with tabpanel

* chore: useMemo for test result counts

* refactor: abstract RequestTestResultRows as a component

* chore: cleanup package lock

* chore: restore package lock

* feat: enable collection runner

* fix: cli test failed

* fix: lint error

* fix: race condition in canceling runner

* fix: runner is not canceled when there's an exception

* fix: lint error

* 1.fix after response iteration and eventname issue

* chore: disable the flaky test

---------

Co-authored-by: Kent Wang <kent.wang@konghq.com>
2024-08-28 19:07:14 +08:00
Jack Kavanagh
02f5bf4d4d inso cli scripting first pass (#7790)
* poc

* add header test

* fix lint

* fix types

* make require work

* low cost abstraction

* test insomnia.sendRequest

* remove execa

* split tests and improve docs

* dynamic import to fix build
2024-08-27 09:36:17 +00:00
Jack Kavanagh
ecba036fe3 vitest (#7754)
* vitest
- testing package

* remove jest and tidy

* sdk tests pass

* remove tsconfig

* vitest insomnia-inso

* snapshots

* clean up

* remove skipped logs

---------

Co-authored-by: gatzjames <jamesgatzos@gmail.com>
2024-07-25 13:37:15 +01:00
Hexxa
7a235c9ba7 fix: lost <disabled> in header transforming and blank req body (#7738) 2024-07-25 16:25:28 +08:00
Hexxa
be2426ae82 fix: clean up sdk types (#7721) 2024-07-16 10:50:36 +02:00
Jack Kavanagh
570c1c0055 verbatim syntax (#7718) 2024-07-15 11:44:21 +02:00
Jack Kavanagh
03581544cf split test job into app and cli (#7685)
* split

* add build sr

* adjust timeouts

* fix test

* fix timeout

* typo
2024-07-10 10:18:12 +02:00
Novsochetra
91b6297d51 chore: duplicate / for import insomnia-sdk/src/objects/(interfaces.ts,request.ts) (#7686) 2024-07-10 10:40:27 +08:00
Hexxa
f5886d3908 fix: generating curl command returns <getTime> error (#7648)
* fix: generating curl command returns <getTime> error

* fix: improve transforming

* test: clean up sdk cookie and add transforming tests

* chore: add comments
2024-07-04 03:28:34 +00:00
James Gatz
3ab6165f52 fix(Cookie expires): Invalid date on cookie expires (#7614)
* Fix always running after-response script

* Fix invalid date in cookies
2024-06-28 16:06:05 +02:00
Hexxa
cb4ec74a2a fix: help to handle @ when it is not encoded in url (#7609)
* fix: help to handle @ when it is not escaped in url

* test: add tests and comments
2024-06-28 21:02:59 +08:00
Hexxa
e410998552 refactor: enable active global environment and map it to the sdk (#7533)
* feat: refactor the environment mapping between inso and script sdk

* feat: enable global environment in the sdk

* fix: disable global cases

* refactor: pass select global env to script execution and persist it after execution

* fix: lint error

* fix: some minor fixes

* fix: undefined is persisted as globals

* chore: add some comments about the mapping rule

* refactor: enable menu items for global environment manipulation (#7589)
2024-06-26 08:41:02 +00:00
Hexxa
9dd5bdc71a fix: add missing methods depending on the interpolator (#7560) 2024-06-20 09:50:08 +02:00
Jack Kavanagh
eac1e63f00 feat: Import/folder-auth (#7505)
* console logs

* import auth from folders

* just in case

* restore inheritance behaviour

* add auth node to snapshot
2024-06-06 12:11:11 +00:00
Hexxa
57e9898bf0 chore: rename variable properties to improve readability (#7480)
* chore: rename variable properties to improve readability

* fix: type check issue
2024-06-05 09:18:12 +00:00
Hexxa
c9b0f3cf8b fix: add jsonSchema assertion chain (#7481) 2024-06-05 09:02:34 +00:00
Hexxa
42cd078b87 fix: add a missing assertion chain for the response entity (#7474) 2024-06-03 09:08:26 +00:00
pimothyxd
109258db41 fix: minor typo in interpolator (#7473) 2024-06-03 10:10:22 +08:00
Hexxa
5d08381be5 fix: support generating values with faker.js in scripting (#7454)
* fix: support generating values with faker.js in scripting

* fix: relax timeout for one case and remove a duplicated case

* fix: test is flaky because of timeout

* fix: incorrect test selector

* fix: waiting before checking

* fix: replace clicking with assertion

* fix: relax the external timeout a bit
2024-05-28 15:28:49 +08:00
Hexxa
46b6ea811e feat: enable major features of the after-response script (#7411)
* feat: update data model and request-pane to support post-req-script

* fix: unit test failed

* feat: integrate post-request script to the engine - INS-3785,INS-3786 (#7329)

* feat: integrate post-request script to the engine

* refactor: some minor improvements

* fix: lint error

* chore: clean up typings

* refactor: separate transforming into sync and async parts

* use named args

* fix: renaming pre-req vars, functions and 2 minor fixes

* fix: the error message is updated

* feat: add snippets for post-request scripting (#7395)

* feat: enable extended assertion chains on `insomnia.response` (#7396)

* feat: add snippets for post-request scripting

* feat(sdk): support response.to.have assertion for verifying response

* chore: fix lint error

---------

Co-authored-by: jackkav <jackkav@gmail.com>

* test: add tests for post-request scripts and post-request scripts - INS-3786 (#7331)

* test: add some tests for post-req script and script engine

* fix: incorrect script type

* chore: refresh package-lock after merging

* chore: clean up package-lock.json

* fix: failed tests after rebasing

* feat: support importing post-req script from Postman (#7423)

* feat: support importing post-req script from Postman

* fix: introduce post-req script property for merged changes

* test: add a test case for importing scripts

* fix: add missing fixture

* chore: remove row after merging

* chore: rename to after-response-script

* fix test

* refresh lock

* update snapshot

* extract pre request logic to function

* refresh lock again

* throw on base env

* fix: revert the logic which rejects the case of unselected environment

---------

Co-authored-by: jackkav <jackkav@gmail.com>
2024-05-23 15:25:35 +08:00
Hexxa
7cfead4452 fix: minor fixes such as multiple registing and gql request body modification (#7299) 2024-04-23 12:18:56 +02:00
Hexxa
ba610daca3 fix: insomnia.environment.name is missing (#7289) 2024-04-22 16:57:36 +08:00
alongdate
78d054b6e1 chore: fix some typos in comments (#7283)
Signed-off-by: alongdate <alongyear@outlook.com>
2024-04-19 12:24:01 +02:00
Hexxa
03c74532c0 feat(hidden-win): try to simulate the existing behavior of handling async tasks (#7281) 2024-04-19 12:23:33 +02:00
Hexxa
dac3401c80 fix: some minor fixes for the pre-request scripting (#7284)
* fix: insomnia.request.name is missing

* feat: enable console.log

* fix: insomnia.info is missing

* fix: lint error
2024-04-19 11:48:05 +02:00
Hexxa
2d9e2da52e chore(pre-req script): move all sdk files to sdk workspace - INS-3379 (#7255)
* feat: move script sdk to one workspace and update importing paths

* test: add jest config for enabling tests

* fix: failed to build package because of missing .node loader
2024-04-12 22:24:14 +08:00