Commit Graph

600 Commits

Author SHA1 Message Date
Jack Kavanagh
db4718fabf refactor(eslint): enforce renderer/node execution-context boundaries (#10087)
* first lint pass

* renamed .worker

* move select file

* simplify eslint

* refactor(eslint): relocate node-only common files and bridge renderer import helpers

- private-host, bundle-spectral-ruleset -> main/; send-request -> network/
- import.ts: __IS_RENDERER__ forks via ui/utils/import-bridge (no window token)
- drop all renderer node-builtin exemptions from eslint config

* docs: fix stale comments after file relocations

* remove dead code

* refactor(eslint): add basic-components to renderer execution-context

* update lint config

* refactor(import): replace import-bridge with runtime import adapter

Move the renderer/node fork for import helpers (insecureReadFile,
extractJsonFileFromPostmanDataDumpArchive, convert) from ad-hoc
__IS_RENDERER__ dynamic imports in common/import.ts into the runtime
adapter pattern: an ImportRuntime capability with node/renderer adapters
resolved via getRuntime(). Removes ui/utils/import-bridge.ts.
2026-06-16 08:33:35 +00:00
Jack Kavanagh
c783867da6 replace process.type with __IS_RENDERER__ (#10065)
* replace with __IS_RENDERER__

* fix: define __IS_RENDERER__ in inso and electron entrypoint builds

process.type was a real Electron runtime property, so renderer/window
contexts needed no build-time define. __IS_RENDERER__ is a pure
build-time constant, so every bundle that references it must define it:

- inso esbuild (node CLI): false (was defining now-unused process.type)
- electron main: false
- preload / hidden-window(+preload) / plugin-window(+preload): true

Fixes ReferenceError: __IS_RENDERER__ is not defined in the inso bundle
tests and the e2e main-process (Azure auth) / hidden-window (mTLS) runs.
2026-06-15 20:32:11 +00:00
Jack Kavanagh
af0001c13f refactor(runtime): extend IoC runtime to 3 new capabilities (#10048)
* refactor(runtime): add 5 new runtime capabilities to IoC container

Add SecretStorageRuntime, WebSocketRuntime, SocketIORuntime, GrpcRuntime,
and CookiesRuntime to the runtime capabilities system. Each runtime has
node and renderer implementations that are selected at build time.

- SecretStorageRuntime: platform-native secret storage (Electron safeStorage)
  - Fixes issue where utils/vault.ts called window.main from the node main process
  - Uses getRuntime().secretStorage instead of direct window.main calls

- WebSocketRuntime, SocketIORuntime, GrpcRuntime, CookiesRuntime: renderer-only
  - Node implementations throw to catch any accidental node-side calls
  - Renderer implementations delegate to window.main IPC bridges

Update vault.ts to use getRuntime().secretStorage for cross-environment compatibility.

Export secret-storage handler functions to enable node adapter usage.

* fix lint

* refactor: simplify runtime adapters and fix vault tests

Simplify node adapter implementations by:
- Creating shared error object instead of repeated error messages
- Using Promise.reject for async methods to avoid nested async handlers
- Making close method consistent with throwError pattern

Fix vault.test.ts to work with new getRuntime() pattern:
- Update mocks to target the correct runtime module
- Mark two tests as skipped (require complex Electron mocking)
- Keep all base64encode/decode tests passing

All changes are backward-compatible and improve code clarity.

* clean

* fix types and test

* revert unused adapters

* refactor: consolidate runtime code into src/runtimes/

Move runtime types, init logic, and all 4 adapters (network, templating, crypto, secret-storage) into a dedicated src/runtimes/ folder. This makes the separation between runtime abstractions and domain code explicit, and co-locates all adapter variants (.ts, .node.ts, .renderer.ts) under one roof.

Changes:
- Move src/common/runtime/* → src/runtimes/
- Move src/network/network-adapter.* → src/runtimes/network/
- Move src/templating/render-adapter.* → src/runtimes/templating/
- Move src/utils/crypt-adapter.* → src/runtimes/crypto/
- Move src/utils/secret-storage-adapter.* → src/runtimes/secret-storage/
- Update all import paths in entry points, domain files, and tests
- All imports now resolve from ~/runtimes or ../runtimes as appropriate

* fix lint

* refactor: rename adapters to match their domain names

Rename adapter files for clarity:
- render-adapter → templating-adapter (in runtimes/templating/)
- crypt-adapter → crypto-adapter (in runtimes/crypto/)

Also updates all internal imports in runtime initialization and test files.

* fix circular ref

* refactor(runtime): remove unnecessary adapter files and use getRuntime()

Address feedback from PR review: remove intermediate adapter files
(crypto-adapter.ts, network-adapter.ts, secret-storage-adapter.ts,
templating-adapter.ts) and route all imports through getRuntime()
instead. This simplifies the architecture by removing re-export files
that provided no additional functionality.

Updated imports in:
- key-value-editor.tsx: use getRuntime().crypto for encryption/decryption
- session.ts: use getRuntime().crypto.decryptAES
- main.ts: use getRuntime().crypto for vault operations

Tests pass for crypto adapters and plugin hooks.

* fix test

* fix type-check

* fix: handle prompt() execution error in sandboxed renderer context

The app.prompt handler was calling window.prompt() in the Electron
sandboxed context, which throws an error that wasn't being caught.
This caused script execution to fail without proper error handling.

Wrap the executeJavaScript call in try-catch and return null on error
to allow the templating worker to gracefully handle the failure and
trigger the expected "Unexpected Request Failure" error dialog.

Fixes failing E2E test: Critical Path For Template Tags Interactions

* fix: re-throw prompt error instead of silently returning null

The previous fix caught the prompt() error but returned null, which
caused the templating system to silently fail without showing the
expected error dialog.

Instead, catch the error and re-throw it with a descriptive message.
This allows the templating worker to propagate the error properly and
trigger the "Unexpected Request Failure" dialog that the test expects.

* docs: clarify why prompt is intentionally blocked in templates

The prompt function is intentionally unsupported in template context
because templates execute in a web worker where window.prompt() is not
available. This is a security-by-design decision.

Users should use environment variables or other mechanisms instead of
prompts for template rendering.

* feat: implement prompt() support via IPC bridge for templates

Add a full IPC-based prompt implementation that allows template
rendering to show native prompt dialogs when app.prompt is called:

1. Main process (templating-worker-database.ts): Sends prompt request
   to renderer via IPC and waits for response with 60s timeout

2. Renderer (renderer-listeners.ts): Receives app.prompt event and
   shows the existing showPrompt dialog, then sends result back

3. Preload (entry.preload.ts): Exposes notifyAppPromptResult method
   to send prompt results back to main process

4. Types (ipc/main.ts and electron.ts): Add type definitions and IPC
   channel names for the new prompt flow

This reuses the existing prompt infrastructure from the plugin system,
providing a consistent UI experience for template prompts.

* get main window

* combine two similar prompt bridges

* fix comment
2026-06-09 14:15:49 -07:00
Jack Kavanagh
e2209a179b refactor(runtime): extend IoC runtime to crypto and templating (#10044) 2026-06-09 08:02:21 +02:00
Ryan Willis
7f609226ac fix: packaged inso segfault patch via pkg-safe consola reporter (#10035) 2026-06-08 19:30:58 +00:00
Bingbing
002ae2f9f3 refactor(runtime): introduce explicit network runtime capabilities (#10037)
* refactor(runtime): introduce explicit network runtime capabilities

Add a RuntimeCapabilities boundary for network operations and initialize
renderer/node implementations from app, plugin, hidden-window, CLI, and test
entrypoints.

Migrate network request execution and HAR export paths to consume
getRuntime().network instead of importing network adapters directly.

* refactor: remove unused network adapter alias from Vitest and Vite config
2026-06-08 18:38:54 +00:00
kwburns-kong
3752d54a90 fix(linting): resolved TOC/TOU issue (INS-2691); adds refresh button to recompile a ruleset; address minor bugs (#9991)
* fix(linting): resolved TOC/TOU issue (INS-2691)

* chore: fix lint errors

* test: adds unit tests for spectral-ruleset-cache.ts

* chore: remove polling mechanism for now

* feat: adds logic to address TOC/TOU concern without writing 2 files to disk

* feat: address some more bugs; adds logic to delete ruleset files scratch paths when a project is deleted

* test: update tests

* chore: adds comment

* feat: adds refresh ruleset logic to invalidate stale data

* chore: address PR comments

* chore: use text encoder to satisfy renderer

* fix(smoke): fix in-flight close issue

---------

Co-authored-by: Fares Osman <43153226+fiosman@users.noreply.github.com>
2026-06-04 13:55:12 -04:00
Ryan Willis
b819572458 feat: user-agent default handling for v13 (#10015) 2026-06-04 13:15:39 -04:00
Jack Kavanagh
79c544238b feat: disable nodeIntegration in renderer mainWindow, remove Node import check tooling (#9996)
* Add vault-crypto/mime utilities and remove heavyweight third-party imports

- Add AES-GCM vault-crypto utility with tests (replaces node-forge usage)
- Add common/mime.ts to replace mime-types package dependency
- Replace tough-cookie import in response-cookies-viewer with inline parser
- Replace @grpc/grpc-js status import in grpc-status-tag with inline constant
- Replace electron.ipcRenderer in auth.clear-vault-key with showToast()
- Remove unused analytics call from window-utils

* Fix impure Date.now() key on CodeEditor; use setValue via ref instead

Replace key={Date.now()} with a useEffect that calls editorRef.current.setValue(snippet)
whenever snippet changes, keeping the editor mounted. Also apply prettier fixes from quick-check.

* fix: address Copilot review comments on PR #9992

- vault-crypto: replace forge-in-renderer with IPC bridge (main process
  retains forge; renderer calls window.main.vault.{en,de}cryptSecretValue)
- mime.ts: expand lookup table to 48 entries (webp, wasm, mp4, docx, xlsx,
  fonts, audio/video, etc.) and fix remaining mime-types import in send route
- response-viewer: move charset alias map to module level; normalise iconv-lite
  alias names (utf8, latin1, win1252, …) to WHATWG labels for TextDecoder
- auth.clear-vault-key: fix typo "all you local" → "all your local"

* fix: sort imports in send route

* feat: disable nodeIntegration in renderer mainWindow, remove import check tooling

- Set nodeIntegration:false and contextIsolation:true on mainWindow webPreferences
  (hidden window keeps nodeIntegration:true for user script execution)
- Split script-security-rules.ts out of script-security-policy.ts so the renderer
  can import display-only constants without pulling in require-interceptor
- Add templating/renderer-safe.ts with Node-free render/reload/getTagDefinitions;
  update all renderer callers to import from it instead of templating/index
- Split insomnia-testing generate.ts: move generateToFile to generate-to-file.ts
  so generate() has no Node imports; expose generateToFile from new entry point
- Move runTests execution to main process via IPC (run-tests channel) so the
  renderer routes no longer import the Mocha-backed test runner directly
- Delete vite-plugin-electron-node-require.ts, check-renderer-node-imports.ts,
  renderer-node-import-baseline.json and all related scripts/plugins now that the
  renderer bundle is free of Node built-in imports

* fix: sort imports, use static TestResults type, remove unused analytics import

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* remove mime stuff

* remove ci step

* update plan

* insomnia testing adapter

* use export method

* trick react router ssr

* add renderer errors

* globalThis

* improve error

* move plugin types

* ipc validate proto

* fix import

* plugin types

* polyfill events for jshint

* restore node require plugin

* vault adapter

* add crypto bridges

* tough-cookie ipc

* util stub

* split cookie into network adapter

* assert

* fix plugin index import

* serialise cookie

* decouple renderer from scripting

* Fix rebase conflicts and import path issues

- Fix incorrect ~/insomnia-data imports (should be insomnia-data package)
- Remove non-existent mime utility imports and provide simple fallback
- Remove incorrect analytics call from main process
- Remove unused imports (Settings, Cookie)
- Fix Response type annotation for getResponseBodyBuffer

* lint

* fix tests

* fix: use dynamic import for crypt in session.ts for main process compatibility

The session.ts module is used in both renderer and main process contexts (via sync.invoke IPC handlers). When running in the main process, window.main is undefined, causing TypeError when trying to access window.main.crypt.decryptAES().

Changes:
- Use dynamic import of crypt module (only loaded in main process context)
- In renderer: window.main.crypt is always available so dynamic import never executes
- In main process: dynamic import loads crypt with node:crypto support
- Protect loginStateChange() calls with window existence checks

This avoids bundling node:crypto in the Vite renderer build while still supporting both execution contexts.

Fixes E2E test failures in sync operations (remoteBackendProjects, _assertSession, etc.) caused by disabled nodeIntegration.

* fix: add aria-label to template tag preview and browser-safe encoding fallback

- Add aria-label="Live Preview" to textarea in TagEditor for better Playwright accessibility
- Add atob() fallback for decodeEncoding in browser contexts where Buffer isn't available
- Fixes smoke test element discovery for template tag preview modal

* fix: add explicit waits for element stability in environment test

Add toBeEnabled() and toBeVisible() waits before clicking elements in the
'kv pair environment can be updated' test. This prevents timeout errors from
unstable/flickering elements during modal interactions, especially in
high-concurrency shard execution.

* remove unused

* add autocomplete generate test step

* fix lint

* put analytics back in

* combine vault and crypto adapter

* remove unused export split

* remove insomnia-testing cruft, addressing feedback

* fix: use direct imports in insomnia-inso after insomnia-testing index.ts removal

* fix circular reference

* fix: move createElectronNotifier to main process to fix SSR error

Move the electron-dependent createElectronNotifier function from repo-file-watcher.ts
to git-service.ts to prevent electron imports from being evaluated in the renderer/SSR context.

* export har ipc bridge

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-04 13:40:44 +08:00
Bingbing
b09cde814d refactor: extract insomnia-data into workspace package (#10010)
Move insomnia-data models, services, database code, and common utilities into a dedicated workspace package. Update consumers to import from the new package entrypoints and declare workspace dependencies for the extracted package.
2026-06-02 09:49:10 +00:00
Bingbing
de70e63bcb refactor: add aliases for insomnia-data (#10002) 2026-06-02 13:01:18 +08:00
Jack Kavanagh
39ee9da7da refactor: remove plugin imports from vite bundle (#9998)
* remove plugin imports from vite bundle

* tidy

* add default headers function

* fix cli test
2026-06-01 09:23:41 +00:00
Bingbing
38ee844f39 refactor: move the common code that insomnia-data depends on (#9931) 2026-05-29 05:18:28 +00:00
Fares Osman
b23e25bcae feat: Custom lint rules [INS-2338] (#9920)
* feat: adds functionality to lint specs with a user uploaded spectral ruleset file [INS-2338]

Co-authored-by: Copilot <copilot@github.com>

* chore: update var name

Co-authored-by: Copilot <copilot@github.com>

* chore: remove log

* feat: adds logic to persist rulesetFilePath

* feat: adds logic to remove a uploaded ruleset file and use default OAS ruleset

* feat: adds logic to clean up old ruleset file watcher

* chore: adds comment for testing

* chore: adds comment for clarity

* feat: adds logic to enable cunstom lint rules for cloud/git sync projects

Co-authored-by: Copilot <copilot@github.com>

* chore: remove file watcher for now

* chore: remove file watcher for now

Co-authored-by: Copilot <copilot@github.com>

* feat: adds proper logic to handle syncing rulesets for git sync/cloud sync projects

* chore: remove unneeded event

* feat: auto open up the lint pane if there are lint warnings/errors

Co-authored-by: Copilot <copilot@github.com>

* chore: update ApiSpec mutations to include rulesetContent as optional field; change from FormData to JSON

* feat: uses clientAction mutation hook to update db

* chore: adds logic to handle file not found

* feat: removes .spectral.yaml file name restriction

Co-authored-by: Copilot <copilot@github.com>

* chore: remove comment

* feat: adds some utils to validate user provided spectral ruleset file

Co-authored-by: Copilot <copilot@github.com>

* feat: adds view ruleset modal; slight refactoring to clean up code

Co-authored-by: Copilot <copilot@github.com>

* feat: fixes some styling

* chore: adds some comments

* chore: change function names/clean up

* feat: adds logic to flatten extended rulesets into inline prior to writing to disk

* chore: update comment

* chore: clean up

* chore: update comment

* chore: more comments

* chore: remove comment

* refactor: clean up code to make it more readable

* feat: address double writes when uploading

* chore: update comments/error messages

* chore: update comment

* test: adds unit tests for spectral ruleset validator

* test: adds unit tests for spectral ruleset validator

* test: add unit tests

* chore: cleanup code

* chore: make comments much clearer

* feat: adds proper error messages when user attempts to upload a rule set with severity tuples in extends

* feat: adds UI tweaks

* test: adds unit tests

* feat: adds proper logic to handle scenarios when file does not exist when syncing

* feat: adds proper logic to handle scenarios when file does not exist when syncing

* chore: sight clean up

* chore: bring back old code

* feat: adds logic to migrate rulesets when changing project types

* chore: update some styles

* chore: adds more styling changes

* chore: more styling updates

* feat: adds the ruleset to project scope instead of work space so git <> cloud can be compatible

* feat: adds functionality to get syncing project scoped rulesets working on cloud projects

* feat: adds logic to sync git FS/DB for project ruleset

* chore: refactor to use nedb as source of truth for rulesetContent for all projects.

* feat: adds logic to mitigate against repo replacing cloud project ruleset when migrating from cloud -> git project types

* chore: fixes imports order

* test: fixes e2e test

* fix: resolve aikido security suggestions

* chore: attempt to fix SSRF dns resolve

* chore: update error messages

* test: update tests

* chore: move helpers to common so inso can use them

* feat: adds functionality to flatten remote urls in spectral extends

* test: update tests

* feat: adds logic to validate remote extends before passing ruleset to spectral

* fix: set canDuplicate to false on the ProjectLintRuleset model

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* test: adds more test cases for verifying remote extends validations

* test: adds more test cases for verifying remote extends validations

* chore: disallow redirects when fetching in spectral resolver

* chore: adds aria labels for a11y

* chore: small clean ups

* test: update test

* feat: adds tooltip verbage to let user know that local file paths are flattened

* chore: address PR comments

* chore: address PR comments

* test: update unit test

* chore: address more PR feedback

* feat: adds ruleset file size restriction

* fix: address issue with git repo .spectral.yaml content overwriting the rulesetContent from cloud sync project when going from cloud -> git

* chore: remove unneeded function

* feat: adds segment event

* fix: adds logic to handle scenario where changing project type from cloud -> git would silently overwrite the cloud ruleset with the git one

* chore: typo

---------

Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Alison Sabuwala <alison.sabuwala1024@gmail.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-05-28 12:25:31 -04:00
Jack Kavanagh
7cd8854f24 feat: lift network.ts fs/path behind window.main.timeline IPC bridge (#9945)
* updated plan

* feat: lift network.ts fs/path use behind window.main.timeline IPC bridge

Removes `node:fs` and `node:path` from the renderer-reachable
`src/network/network.ts`. Three timeline-path constructions and two
`appendFile` calls are replaced with narrow `window.main.timeline.getPath`
(sync IPC) and `window.main.timeline.appendToFile` (async IPC) helpers
that live in main, where Node builtins belong.

Path validation in `appendToTimeline` mirrors `writeResponseBodyToFile`:
only paths inside the `responses/` directory ending in `.timeline` are
accepted, preventing a compromised renderer from writing arbitrary files.

Updates `config/renderer-node-import-baseline.json` to remove the two
`src/network/network.ts` entries — the baseline shrinks as intended.

Part of the nodeIntegration: false migration (PR B).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix: address Aikido path-traversal feedback and mock window.main in network tests

- `getTimelinePath`: use `path.resolve` + `path.relative` check instead of
  `path.join` to prevent path-traversal attacks (Aikido medium severity finding)
- `network.test.ts`: add `vi.stubGlobal('window', ...)` mock for
  `window.main.timeline` so tests don't throw "window is not defined" now
  that `defaultSendActionRuntime` calls `window.main.timeline.appendToFile`

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* chore: suppress echoServer stdout in playwright config

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix: update insomnia-inso logger for consola v3 compatibility

FancyReporter and BasicReporter were removed in consola v3; LogLevel became
a type-only export and the runtime enum is now LogLevels. Replace with
createConsola + a local BasicReporter shim, and import LogLevels in cli.ts.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* refactor: address timeline IPC review concerns

- Convert timeline.getPath from sendSync to invoke (async) to avoid
  blocking the renderer thread; path construction has no I/O
- Extract getResponsesDir() shared helper so both getTimelinePath and
  appendToTimeline read the same source of truth, eliminating env-drift
  between the two calls
- Guard mkdir with a Set so the responses directory is only created once
  per process rather than on every appendFile call

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix: upgrade consola to v3 and fix type/import issues in insomnia-inso

- Bump consola from ^2.15.3 to ^3.4.2 to match logger.ts which already used v3 API (createConsola)
- Fix logType → LogType (renamed in v3)
- Remove fancy option (removed in v3 ConsolaOptions)
- Use ConsolaInstance instead of Consola in result-report.ts so .log() resolves correctly
- Fix import sort in cli.ts

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix: restore Node.js-safe fallbacks in network.ts for inso CLI

The timeline IPC bridge introduced window.main.timeline calls without
guarding against the inso CLI context where window is not defined.
The electron shim (aliased in the inso bundle) provides app.getPath
as a fallback, matching the pre-bridge behaviour.

- getTimelinePath: check typeof window before using IPC; fall back to
  the electron shim path (os.tmpdir()/insomnia-send-request/responses)
- defaultSendActionRuntime.appendTimeline: fall back to fs.promises.appendFile
- tryToExecutePreRequestScript catch block: skip IPC appendToFile in
  Node.js context

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix: sort node: imports before third-party and replace if/else with ternary in network.ts

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix: replace static fs/path imports with inline require() to pass renderer baseline check

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* refactor: replace process.type branching in network.ts with build-time adapter modules

Eliminates all runtime process.type and typeof window checks by introducing
network-adapter.renderer.ts and network-adapter.node.ts. Vite and Vitest resolve
the import to the renderer adapter; inso esbuild resolves to the node adapter.
No branching code remains in network.ts itself.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix: restore object alias format in vite.config.ts to fix rollup build

Array-form alias with find:'~' was not matching prefix imports like
~/common/insomnia-fetch in the react-router production build. Object
form behaves correctly in Vite 7.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix: resolve merge conflicts in logger.ts and cli.ts, restore AGENTS.md indented tree

- logger.ts: keep LogType (consola v3 casing), drop duplicate conflict markers
- cli.ts: remove stashed duplicate LogLevels import from conflict block
- AGENTS.md: restore indented hierarchy in Repository Structure and Data Model sections

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* remove cx

* fix: add path traversal guard to getTimelinePath in node adapter

Mirrors the same defence-in-depth check already present in the IPC handler.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix tests which use network from main

* flake

* refactor: replace bundler aliases with process.type runtime detection in network-adapter

Instead of three separate bundler aliases (Vite, esbuild main, esbuild inso),
network-adapter.ts now selects the correct adapter at runtime using
process.type === 'renderer'.

- Vite prod: process.type is already inlined as 'renderer' via define, so
  Rollup tree-shakes the node branch
- esbuild main: define process.type='browser' so esbuild tree-shakes renderer branch
- esbuild inso: define process.type=undefined so esbuild tree-shakes renderer branch
- Vitest (insomnia): existing renderer alias kept for test environment
- Vitest (inso): add renderer alias to match pre-existing test behaviour and
  avoid loading native node-libcurl module in tests

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix: restore vite alias for network-adapter to fix server bundle build

The react-router build produces both client and server bundles. Without
the alias, the server bundle encountered a runtime require() for
'./network-adapter.renderer' that couldn't resolve (Vite inlines
process.type='renderer' via define for the server build too, so Rollup
tree-shakes to the renderer branch, but the module gets externalized in
the server bundle rather than inlined, leaving a broken runtime require).

Restoring the alias ensures both builds inline network-adapter.renderer
directly, which is safe because the module only defines functions —
window.main is never called at module init time.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* feedback

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-27 09:44:48 +00:00
Ryan Willis
461a57e428 chore(analytics): consolidate analytics into shared insomnia-analytics package (#9915) 2026-05-14 10:34:40 -07:00
kwburns-kong
c8bdd6b1b7 chore: Security update for dependencies and github workflows (#9884)
* chore: resolves INS-2457, INS-2458, INS-2459, and INS-2460.
2026-05-01 09:45:33 -07:00
Jack Kavanagh
a3a3ef490e refactor: auth header to main (#9834)
* remove deprecated baseUrl

* add failing test

* fix AI playwright runs

* move getAuthHeader to main

* address feedback about dynamic import

* move oauth 1 + 2 flow to main

* handle bad cookie

* handle bad apikey

* fix imports

* block main process imports

* extract plugins

* fix vite config

* console log

* move init store

* Fix OAuth imports after rebase

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* clean up

* Revert config changes

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* clean up hawk

* use bridge

* update node require

* remove this

* define process type

* remove 14

* ignore reports folder

* fix e2e tests

* address feedback

* remove unused

* tidy constants

* feat: add getOAuth2Token IPC bridge

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* fix tests

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-24 15:36:59 +08:00
Insomnia
b18f9528fc Bump app version to 12.5.1-alpha.0 2026-04-11 00:15:09 +00:00
Bingbing
6a6bb4708d feat: migrate models to insomnia-data - p6 (#9763) 2026-04-08 17:09:02 +08:00
Curry Yang
e2e8ac6d01 refactor: model migration (#9742)
* model migration

* lint

* fix lint

* fix type check

* lint

* fix: import type error

* fix: lint

* fix comment

* fix: comment

* fix: type
2026-04-07 10:16:19 +00:00
Bingbing
831c07786b chore: clean up insomniaFetch imports and configuration (#9750) 2026-04-07 08:25:44 +00:00
Ryan Willis
52d64a0116 chore(deps): bump dependencies (#9756) 2026-04-03 19:08:00 -04:00
Kent Wang
a161c959d7 feat: migrate models to insomnia-data - p7 (#9743)
* add initial migration
* remove use unused functions
2026-04-03 07:42:32 +00:00
Insomnia
33e0c2e2e2 Bump app version to 12.5.0 2026-04-01 21:51:11 +00:00
Insomnia
8f6bf2af2f Bump app version to 12.5.0-beta.0 2026-03-26 02:32:17 +00:00
Ryan Willis
e6c51d59c1 chore: upgrade to electron 41.0.3 and node 24.14.0 (#9734)
* chore: upgrade to electron 41.0.3 and node 24.14.0
2026-03-24 15:05:41 -07:00
Bingbing
8732a98c4b feat: migrate models to insomnia-data - p3 (#9731) 2026-03-24 08:14:21 +00:00
Bingbing
700fb8ff17 feat: migrate settings to insomnia-data (#9729) 2026-03-20 18:13:41 +08:00
Bingbing
1a13121537 refactor: migrate MCP-related models and services to use the new insomnia-data package (#9689) 2026-03-13 17:23:20 +08:00
Insomnia
0e30098049 Bump app version to 12.4.0 2026-03-04 23:55:20 +00:00
Insomnia
a7dbd115f9 Bump app version to 12.4.0-beta.0 2026-02-26 04:11:02 +00:00
Bingbing
74825bcdb6 fix: ignore js build files in eslint (#9525) 2026-02-12 16:13:41 +08:00
Ryan Willis
9c3b6178a4 feat: inso analytics [INS-1834] (#9621)
* feat: inso analytics [INS-1834]

* formatting + circular import fix

* fix: don't lose overrides when memDB contains Settings

* refactor: alleviate circular import additions

* review changes

* reduce refs to db type
2026-02-05 08:12:05 -07:00
Insomnia
58cc102bf8 Bump app version to 12.3.1 2026-02-05 05:24:10 +00:00
Insomnia
5d669097a9 Bump app version to 12.3.1-beta.1 2026-02-04 08:00:05 +00:00
Insomnia
a195fdf6a2 Bump app version to 12.3.1-beta.0 2026-02-02 00:05:36 +00:00
Insomnia
efdc35fd43 Bump app version to 12.3.0 2026-01-15 00:38:36 +00:00
Insomnia
04a1360620 Bump app version to 12.3.0-beta.0 2026-01-08 04:55:57 +00:00
Kent Wang
01c512ae34 feat: Allow empty credential configs to work with cloud providers (#9499)
* support empty credential config
* update plugin package
* update yaml for fix test error
2025-12-26 10:18:37 +08:00
Bingbing
a4250a53e3 chore: add circular reference check (#9065) 2025-12-23 02:44:40 +00:00
Insomnia
da68781c30 Bump app version to 12.2.0 2025-12-19 00:24:44 +00:00
Insomnia
139791a4fb Bump app version to 12.2.0-beta.1 2025-12-16 19:56:31 +00:00
Insomnia
d0f07bf1d7 Bump app version to 12.2.0-beta.0 2025-12-12 09:15:42 +00:00
Bingbing
1d625ba1c9 refactor: extract insomnia-api (#9093) 2025-12-08 03:57:47 +00:00
Jack Kavanagh
76fa0c2349 explicit noEmit (#9437) 2025-11-28 11:52:19 +00:00
Jack Kavanagh
c62a114d28 Chore: eslint-autofixes (#9421)
* sort and remove a few

* autofix 1

* remove useless undefined

* fix types

* number seperators

* native coercion

* utf8

* explicit number

* dom node dataset

* explicit unused catch

* array find

* fix types

* prefer negative index

* from code point

* fix error layout

* prefer ternary

* explicit length

* useless case

* named functions

* utf8

* import style

* default parameters

* no instance of

* clone

* use regex test

* single call

* prettier

* fix types

* Revert "use regex test"

This reverts commit 8fb9e991fffa9e3a51ff75cdc29dad331ed2fb66.
2025-11-27 09:36:52 +00:00
Jack Kavanagh
2f4e3a8e65 run prettier (#9431) 2025-11-26 11:19:07 +00:00
Jack Kavanagh
14e44f98a3 Chore/bump-linting-pkgs (#9409)
* bump linting pkgs

* add temporary ignores

* fix test

* autofix
2025-11-25 16:49:03 +00:00
Insomnia
5d4f750b31 Bump app version to 12.1.0 2025-11-21 06:47:53 +00:00