feat: platform independent core and the new desktop app (#4684)
* feat(desktop): init
* feat(desktop): external app download and setup
* feat(desktop): offload app load to plugin system
* perf(desktop): add rdbms facade and caching layer
* feat: parallelize signing, shared trust, lru cache
* feat: webapp encoder + compressor + hasher server
* feat(desktop): app autoupdate with hashed loader
* feat(kernel): init `hoppscotch-kernel`
* feat(kernel): `io`
* feat(kernel): `network`
* feat(kernel): `network` - native interceptor
* feat(kernel): `network` - interceptor - rest
* feat(kernel): `network` - interceptor - graphql
* feat(kernel): `network` - interceptor - capabilities
* feat(kernel): `network` - interceptor - `FormData`
* feat(kernel): `network` - interceptor - `oauth2.0`
* feat(kernel): `store`
* feat(desktop): dragging, traffic light, plugin workspaces
* feat(kernel|wip): `store`
* feat(kernel): `network` - capabilities - with active
* feat(kernel|wip): `network` - interceptor - `proxy`
* feat(kernel|wip): `network` - relay ext
* feat(kernel): `network` - interceptor - `proxy`
* feat(kernel): `network` - interceptor - decoding
* feat(kernel): `network` - interceptor - Kernel Err
* feat(kernel): `network` - flow transformation
* feat(kernel): `network` - request status
* fix(desktop): repositioning traffic lights on fullscreen exit
* feat(kernel): `network` - interceptor - `agent`
* feat(kernel): `store` - track updates
* feat(kernel): `network` - interceptor - extension
* feat(kernel): `network` - updates as overrides
* feat(interceptor): pre-process request encoding
* fix(ui): mismatched extension button size/position
* feat(kernel): `network` - interceptor - `browser`
* feat(native): common certs componsable
* fix(kernel): interceptor selection store and json parse
* feat(kernel): `network` - consistent multipart encoding
* feat(kernel): `network` - interceptor - `OAuth2.0`
* feat(kernel): `network` - interceptor - cookie support
* feat(agent): registration list, log-sink, relay
* feat(kernel): `network` - interceptor subtitles
* feat(kernel): `store` - persist network settings
* fix(agent): encrypted ser/de certificate requests
* feat(kernel): `kernelInterceptor` spotlight service
* fix(kernel): gql introspection edge-case schema
* ref: conditionals for migrated components
* feat(kernel): `localaccess` capability via relay
* feat(kernel): `network` - explicit types and lint
* feat(kernel): `store` - isolate host and platform
* feat(kernel): `store` - persistence service
* fix(infra): whitelisted origins, non-std engines
* feat(desktop): impl deep-link callbacks
* feat(kernel): `auth`
* feat(kernel): `io` - event listeners
* feat(kernel): platform migration
* fix: dep `vue` import on Win 11
Fixes `error TS2305: Module '"vue"' has no exported member
'VueConstructor'.` arising from `splitpane` dependency.
* fix(webapp-server): platform independent res paths
* feat(desktop): auth and emit via embedded server
* feat(platform): host, csp and bundle compatibility
- Bundle name format for using as host
- Windows UI handler HWND casting and version detection
- CSP headers type handling in URI protocol
- Protocol whitelist in env config
* feat(desktop|wip): login flow with `auth-tokens`
feat(desktop|wip): typesafe auth
* feat(backend): `auth` token flow, gql/websocket
feat(desktop): working auth for gql
feat: gql client with refresh token
* feat(backend): `auth` token flow, authorization bearer
* fix(gen): qualifier clash when invalidating cache
* feat(common): coordinated initialization service
* fix(desktop): appload persistence in data json
* feat(desktop|wip): desktop icons and updater
* fix: typos in readme docs
* fix: docker ignore copying on windows
* fix: update `.lock` file after rebase
* fix: `persistenceService` setup in tests
* fix: remove old console logs
* fix: console error on invalid schema
Show console error if default value is used when loading invalid data from
local storage
* fix(test): `PersistenceService` methods
* fix(test): `PersistenceService` rest tab state
* fix(test): `PersistenceService` gql tab state
* fix(test): `PersistenceService` global env
* fix(test): `PersistenceService` mqtt request
* fix(test): `PersistenceService` sse request
* fix(test): `PersistenceService` socketio request
* fix(test): `PersistenceService` websocket request
* fix(test): `PersistenceService` secret environment
* fix(test): `PersistenceService` selected env
* fix(test): `PersistenceService` collections
* fix(test): `PersistenceService` environments
* fix(test): `PersistenceService` history
* fix(test): `PersistenceService` settings
* fix(test): `PersistenceService` migrations
* fix(test): `InspectionService` request inspector
* feat(desktop): button to clear bundle/key cache
This is useful when there are partial updates to the web app or bundle gen server
which haven't been correctly propagated when the app bundle was downloaded.
If the user were to change the self host instance without updating the
desktop app; which is possible albeit rarely under very certain circumstances,
desktop app will refuse to load the bundle, this is because the desktop app
cannot differentiate between partial updates vs incorrect bundle being hosted
since both will fail verification.
The button lets the user decide what should be the appropriate action,
clear the bundle and trust the hosted app
or make sure the app is built and hosted correctly.
* fix(desktop): enforce one version per instance
This was part of a leftover scaffolding from development.
* fix(desktop): bundle url not stored after download
* fix(desktop): stalling progress on updates
* fix(backend): helper to parse cookie into kv-pairs
* feat(desktop): launch session on working endpoints
* fix(common): preserve `auth` structure and default
* fix: loading native networking with kernel mode
* fix: fallback for unhandled response error
* fix: `urlencoded` content request processing
* feat: `interceptor` - error mapping for `browser`
* fix: backwards compatibility for `digest` auth
* fix: platform check for `initializationService`
* fix: `interceptor` - analytics `strategy` resolution
* fix: `interceptor` - check for `cookies` component
* fix: enable digest auth support for `native`
* test: `interceptor` - kernel interceptor
* fix(relay): `grantType` casing for OAuth2.0
* test(wip): kernel transformers
* fix(relay): auth headers discarding others
* fix(desktop): http version deserialization
* fix(common): `grantType` extractor, auth processor
* fix: `PersistenceService` - parsing edge cases
* fix(infra): post rebase fixup
* fix(web): component structure and lint
* fix(desktop): cohesive splash opener, scroll url section
* fix: explicit auto auth and docs on url auth
* fix(relay): special chars failing proxy auth
* fix: finer cert control setting option
* fix: post-rebase fixup
* feat(appload): ability to vendor pre-built bytes
* fix: avoid copying over `target` dir in containers
* fix: auth key missing in capability set
* fix(desktop): relax `refresh_token` requirement
This is to support Firebase token
* fix(desktop): normalization for Windows WebView
* feat(desktop): instance switcher and vendored app
* fix(desktop): merge artifacts and conflicts
* feat(desktop): instance switcher improvements
* fix: derive instance name from normalized name
* fix: pkg links, lints and UI edge cases
* feat(desktop): restore window state after relaunch
* fix(desktop): distinguish header for cloud/default
* fix: instance switcher in web mode
* fix: close dropdown on new instance modal
* fix: whitelist vendored app origin
* feat(desktop): platform parity - `collections`
* fix: history entries population desync
* fix(desktop): check for history storage status
* fix(desktop): safe parse `globalEnv`
* feat(desktop): platform parity - `environment`
* fix: use settings store for proxy url
* fix: lint, unused imports
* fix: proxy input enabled for other interceptors
* feat: reverse proxy for desktop app server
* fix: duplicate entries after connecting to sh
* fix: specify instance org qualified
* fix: remove debugging logs
* feat(desktop): enable `devtools` in release builds
* fix(desktop): prepend protocol validation edgecase
* feat(desktop): clear cache on removing instance
* fix: better response toast message
* fix: avoid reverse proxy for webapp server
* fix(desktop): ignore subpath in instance name
* feat: switcher ui/ux improvements
* feat: more switcher ui/ux improvements
* feat(server): specify bundle version at build time
* fix(desktop): missing migration as rebase artifact
* fix: minor switcher ui/ux improvement
* fix: rebase artifacts
* fix: consolidated toast on success
* fix: missing i18n strings
* fix(desktop): handle drag and drop fe side
* feat: confirmation modal on instance removal
* chore: minor UI update
* chore: minor UI changes
* fix: gql connection partial refactor
* fix: resolve merge artifacts
* chore: prod lint
* feat(desktop): better desktop app update ux
* fix: broken gql connection.ts
---------
Co-authored-by: nivedin <nivedinp@gmail.com>
Co-authored-by: Andrew Bastin <andrewbastin.k@gmail.com>
2025-02-27 18:31:25 +00:00
|
|
|
import type {
|
|
|
|
|
StorageOptions,
|
|
|
|
|
StoreError,
|
|
|
|
|
StoreEvents,
|
|
|
|
|
StoreEventEmitter,
|
2026-03-26 12:30:51 +00:00
|
|
|
ScopedStore,
|
feat: platform independent core and the new desktop app (#4684)
* feat(desktop): init
* feat(desktop): external app download and setup
* feat(desktop): offload app load to plugin system
* perf(desktop): add rdbms facade and caching layer
* feat: parallelize signing, shared trust, lru cache
* feat: webapp encoder + compressor + hasher server
* feat(desktop): app autoupdate with hashed loader
* feat(kernel): init `hoppscotch-kernel`
* feat(kernel): `io`
* feat(kernel): `network`
* feat(kernel): `network` - native interceptor
* feat(kernel): `network` - interceptor - rest
* feat(kernel): `network` - interceptor - graphql
* feat(kernel): `network` - interceptor - capabilities
* feat(kernel): `network` - interceptor - `FormData`
* feat(kernel): `network` - interceptor - `oauth2.0`
* feat(kernel): `store`
* feat(desktop): dragging, traffic light, plugin workspaces
* feat(kernel|wip): `store`
* feat(kernel): `network` - capabilities - with active
* feat(kernel|wip): `network` - interceptor - `proxy`
* feat(kernel|wip): `network` - relay ext
* feat(kernel): `network` - interceptor - `proxy`
* feat(kernel): `network` - interceptor - decoding
* feat(kernel): `network` - interceptor - Kernel Err
* feat(kernel): `network` - flow transformation
* feat(kernel): `network` - request status
* fix(desktop): repositioning traffic lights on fullscreen exit
* feat(kernel): `network` - interceptor - `agent`
* feat(kernel): `store` - track updates
* feat(kernel): `network` - interceptor - extension
* feat(kernel): `network` - updates as overrides
* feat(interceptor): pre-process request encoding
* fix(ui): mismatched extension button size/position
* feat(kernel): `network` - interceptor - `browser`
* feat(native): common certs componsable
* fix(kernel): interceptor selection store and json parse
* feat(kernel): `network` - consistent multipart encoding
* feat(kernel): `network` - interceptor - `OAuth2.0`
* feat(kernel): `network` - interceptor - cookie support
* feat(agent): registration list, log-sink, relay
* feat(kernel): `network` - interceptor subtitles
* feat(kernel): `store` - persist network settings
* fix(agent): encrypted ser/de certificate requests
* feat(kernel): `kernelInterceptor` spotlight service
* fix(kernel): gql introspection edge-case schema
* ref: conditionals for migrated components
* feat(kernel): `localaccess` capability via relay
* feat(kernel): `network` - explicit types and lint
* feat(kernel): `store` - isolate host and platform
* feat(kernel): `store` - persistence service
* fix(infra): whitelisted origins, non-std engines
* feat(desktop): impl deep-link callbacks
* feat(kernel): `auth`
* feat(kernel): `io` - event listeners
* feat(kernel): platform migration
* fix: dep `vue` import on Win 11
Fixes `error TS2305: Module '"vue"' has no exported member
'VueConstructor'.` arising from `splitpane` dependency.
* fix(webapp-server): platform independent res paths
* feat(desktop): auth and emit via embedded server
* feat(platform): host, csp and bundle compatibility
- Bundle name format for using as host
- Windows UI handler HWND casting and version detection
- CSP headers type handling in URI protocol
- Protocol whitelist in env config
* feat(desktop|wip): login flow with `auth-tokens`
feat(desktop|wip): typesafe auth
* feat(backend): `auth` token flow, gql/websocket
feat(desktop): working auth for gql
feat: gql client with refresh token
* feat(backend): `auth` token flow, authorization bearer
* fix(gen): qualifier clash when invalidating cache
* feat(common): coordinated initialization service
* fix(desktop): appload persistence in data json
* feat(desktop|wip): desktop icons and updater
* fix: typos in readme docs
* fix: docker ignore copying on windows
* fix: update `.lock` file after rebase
* fix: `persistenceService` setup in tests
* fix: remove old console logs
* fix: console error on invalid schema
Show console error if default value is used when loading invalid data from
local storage
* fix(test): `PersistenceService` methods
* fix(test): `PersistenceService` rest tab state
* fix(test): `PersistenceService` gql tab state
* fix(test): `PersistenceService` global env
* fix(test): `PersistenceService` mqtt request
* fix(test): `PersistenceService` sse request
* fix(test): `PersistenceService` socketio request
* fix(test): `PersistenceService` websocket request
* fix(test): `PersistenceService` secret environment
* fix(test): `PersistenceService` selected env
* fix(test): `PersistenceService` collections
* fix(test): `PersistenceService` environments
* fix(test): `PersistenceService` history
* fix(test): `PersistenceService` settings
* fix(test): `PersistenceService` migrations
* fix(test): `InspectionService` request inspector
* feat(desktop): button to clear bundle/key cache
This is useful when there are partial updates to the web app or bundle gen server
which haven't been correctly propagated when the app bundle was downloaded.
If the user were to change the self host instance without updating the
desktop app; which is possible albeit rarely under very certain circumstances,
desktop app will refuse to load the bundle, this is because the desktop app
cannot differentiate between partial updates vs incorrect bundle being hosted
since both will fail verification.
The button lets the user decide what should be the appropriate action,
clear the bundle and trust the hosted app
or make sure the app is built and hosted correctly.
* fix(desktop): enforce one version per instance
This was part of a leftover scaffolding from development.
* fix(desktop): bundle url not stored after download
* fix(desktop): stalling progress on updates
* fix(backend): helper to parse cookie into kv-pairs
* feat(desktop): launch session on working endpoints
* fix(common): preserve `auth` structure and default
* fix: loading native networking with kernel mode
* fix: fallback for unhandled response error
* fix: `urlencoded` content request processing
* feat: `interceptor` - error mapping for `browser`
* fix: backwards compatibility for `digest` auth
* fix: platform check for `initializationService`
* fix: `interceptor` - analytics `strategy` resolution
* fix: `interceptor` - check for `cookies` component
* fix: enable digest auth support for `native`
* test: `interceptor` - kernel interceptor
* fix(relay): `grantType` casing for OAuth2.0
* test(wip): kernel transformers
* fix(relay): auth headers discarding others
* fix(desktop): http version deserialization
* fix(common): `grantType` extractor, auth processor
* fix: `PersistenceService` - parsing edge cases
* fix(infra): post rebase fixup
* fix(web): component structure and lint
* fix(desktop): cohesive splash opener, scroll url section
* fix: explicit auto auth and docs on url auth
* fix(relay): special chars failing proxy auth
* fix: finer cert control setting option
* fix: post-rebase fixup
* feat(appload): ability to vendor pre-built bytes
* fix: avoid copying over `target` dir in containers
* fix: auth key missing in capability set
* fix(desktop): relax `refresh_token` requirement
This is to support Firebase token
* fix(desktop): normalization for Windows WebView
* feat(desktop): instance switcher and vendored app
* fix(desktop): merge artifacts and conflicts
* feat(desktop): instance switcher improvements
* fix: derive instance name from normalized name
* fix: pkg links, lints and UI edge cases
* feat(desktop): restore window state after relaunch
* fix(desktop): distinguish header for cloud/default
* fix: instance switcher in web mode
* fix: close dropdown on new instance modal
* fix: whitelist vendored app origin
* feat(desktop): platform parity - `collections`
* fix: history entries population desync
* fix(desktop): check for history storage status
* fix(desktop): safe parse `globalEnv`
* feat(desktop): platform parity - `environment`
* fix: use settings store for proxy url
* fix: lint, unused imports
* fix: proxy input enabled for other interceptors
* feat: reverse proxy for desktop app server
* fix: duplicate entries after connecting to sh
* fix: specify instance org qualified
* fix: remove debugging logs
* feat(desktop): enable `devtools` in release builds
* fix(desktop): prepend protocol validation edgecase
* feat(desktop): clear cache on removing instance
* fix: better response toast message
* fix: avoid reverse proxy for webapp server
* fix(desktop): ignore subpath in instance name
* feat: switcher ui/ux improvements
* feat: more switcher ui/ux improvements
* feat(server): specify bundle version at build time
* fix(desktop): missing migration as rebase artifact
* fix: minor switcher ui/ux improvement
* fix: rebase artifacts
* fix: consolidated toast on success
* fix: missing i18n strings
* fix(desktop): handle drag and drop fe side
* feat: confirmation modal on instance removal
* chore: minor UI update
* chore: minor UI changes
* fix: gql connection partial refactor
* fix: resolve merge artifacts
* chore: prod lint
* feat(desktop): better desktop app update ux
* fix: broken gql connection.ts
---------
Co-authored-by: nivedin <nivedinp@gmail.com>
Co-authored-by: Andrew Bastin <andrewbastin.k@gmail.com>
2025-02-27 18:31:25 +00:00
|
|
|
} from "@hoppscotch/kernel"
|
2026-03-26 12:30:51 +00:00
|
|
|
import { extendStore } from "@hoppscotch/kernel"
|
feat: platform independent core and the new desktop app (#4684)
* feat(desktop): init
* feat(desktop): external app download and setup
* feat(desktop): offload app load to plugin system
* perf(desktop): add rdbms facade and caching layer
* feat: parallelize signing, shared trust, lru cache
* feat: webapp encoder + compressor + hasher server
* feat(desktop): app autoupdate with hashed loader
* feat(kernel): init `hoppscotch-kernel`
* feat(kernel): `io`
* feat(kernel): `network`
* feat(kernel): `network` - native interceptor
* feat(kernel): `network` - interceptor - rest
* feat(kernel): `network` - interceptor - graphql
* feat(kernel): `network` - interceptor - capabilities
* feat(kernel): `network` - interceptor - `FormData`
* feat(kernel): `network` - interceptor - `oauth2.0`
* feat(kernel): `store`
* feat(desktop): dragging, traffic light, plugin workspaces
* feat(kernel|wip): `store`
* feat(kernel): `network` - capabilities - with active
* feat(kernel|wip): `network` - interceptor - `proxy`
* feat(kernel|wip): `network` - relay ext
* feat(kernel): `network` - interceptor - `proxy`
* feat(kernel): `network` - interceptor - decoding
* feat(kernel): `network` - interceptor - Kernel Err
* feat(kernel): `network` - flow transformation
* feat(kernel): `network` - request status
* fix(desktop): repositioning traffic lights on fullscreen exit
* feat(kernel): `network` - interceptor - `agent`
* feat(kernel): `store` - track updates
* feat(kernel): `network` - interceptor - extension
* feat(kernel): `network` - updates as overrides
* feat(interceptor): pre-process request encoding
* fix(ui): mismatched extension button size/position
* feat(kernel): `network` - interceptor - `browser`
* feat(native): common certs componsable
* fix(kernel): interceptor selection store and json parse
* feat(kernel): `network` - consistent multipart encoding
* feat(kernel): `network` - interceptor - `OAuth2.0`
* feat(kernel): `network` - interceptor - cookie support
* feat(agent): registration list, log-sink, relay
* feat(kernel): `network` - interceptor subtitles
* feat(kernel): `store` - persist network settings
* fix(agent): encrypted ser/de certificate requests
* feat(kernel): `kernelInterceptor` spotlight service
* fix(kernel): gql introspection edge-case schema
* ref: conditionals for migrated components
* feat(kernel): `localaccess` capability via relay
* feat(kernel): `network` - explicit types and lint
* feat(kernel): `store` - isolate host and platform
* feat(kernel): `store` - persistence service
* fix(infra): whitelisted origins, non-std engines
* feat(desktop): impl deep-link callbacks
* feat(kernel): `auth`
* feat(kernel): `io` - event listeners
* feat(kernel): platform migration
* fix: dep `vue` import on Win 11
Fixes `error TS2305: Module '"vue"' has no exported member
'VueConstructor'.` arising from `splitpane` dependency.
* fix(webapp-server): platform independent res paths
* feat(desktop): auth and emit via embedded server
* feat(platform): host, csp and bundle compatibility
- Bundle name format for using as host
- Windows UI handler HWND casting and version detection
- CSP headers type handling in URI protocol
- Protocol whitelist in env config
* feat(desktop|wip): login flow with `auth-tokens`
feat(desktop|wip): typesafe auth
* feat(backend): `auth` token flow, gql/websocket
feat(desktop): working auth for gql
feat: gql client with refresh token
* feat(backend): `auth` token flow, authorization bearer
* fix(gen): qualifier clash when invalidating cache
* feat(common): coordinated initialization service
* fix(desktop): appload persistence in data json
* feat(desktop|wip): desktop icons and updater
* fix: typos in readme docs
* fix: docker ignore copying on windows
* fix: update `.lock` file after rebase
* fix: `persistenceService` setup in tests
* fix: remove old console logs
* fix: console error on invalid schema
Show console error if default value is used when loading invalid data from
local storage
* fix(test): `PersistenceService` methods
* fix(test): `PersistenceService` rest tab state
* fix(test): `PersistenceService` gql tab state
* fix(test): `PersistenceService` global env
* fix(test): `PersistenceService` mqtt request
* fix(test): `PersistenceService` sse request
* fix(test): `PersistenceService` socketio request
* fix(test): `PersistenceService` websocket request
* fix(test): `PersistenceService` secret environment
* fix(test): `PersistenceService` selected env
* fix(test): `PersistenceService` collections
* fix(test): `PersistenceService` environments
* fix(test): `PersistenceService` history
* fix(test): `PersistenceService` settings
* fix(test): `PersistenceService` migrations
* fix(test): `InspectionService` request inspector
* feat(desktop): button to clear bundle/key cache
This is useful when there are partial updates to the web app or bundle gen server
which haven't been correctly propagated when the app bundle was downloaded.
If the user were to change the self host instance without updating the
desktop app; which is possible albeit rarely under very certain circumstances,
desktop app will refuse to load the bundle, this is because the desktop app
cannot differentiate between partial updates vs incorrect bundle being hosted
since both will fail verification.
The button lets the user decide what should be the appropriate action,
clear the bundle and trust the hosted app
or make sure the app is built and hosted correctly.
* fix(desktop): enforce one version per instance
This was part of a leftover scaffolding from development.
* fix(desktop): bundle url not stored after download
* fix(desktop): stalling progress on updates
* fix(backend): helper to parse cookie into kv-pairs
* feat(desktop): launch session on working endpoints
* fix(common): preserve `auth` structure and default
* fix: loading native networking with kernel mode
* fix: fallback for unhandled response error
* fix: `urlencoded` content request processing
* feat: `interceptor` - error mapping for `browser`
* fix: backwards compatibility for `digest` auth
* fix: platform check for `initializationService`
* fix: `interceptor` - analytics `strategy` resolution
* fix: `interceptor` - check for `cookies` component
* fix: enable digest auth support for `native`
* test: `interceptor` - kernel interceptor
* fix(relay): `grantType` casing for OAuth2.0
* test(wip): kernel transformers
* fix(relay): auth headers discarding others
* fix(desktop): http version deserialization
* fix(common): `grantType` extractor, auth processor
* fix: `PersistenceService` - parsing edge cases
* fix(infra): post rebase fixup
* fix(web): component structure and lint
* fix(desktop): cohesive splash opener, scroll url section
* fix: explicit auto auth and docs on url auth
* fix(relay): special chars failing proxy auth
* fix: finer cert control setting option
* fix: post-rebase fixup
* feat(appload): ability to vendor pre-built bytes
* fix: avoid copying over `target` dir in containers
* fix: auth key missing in capability set
* fix(desktop): relax `refresh_token` requirement
This is to support Firebase token
* fix(desktop): normalization for Windows WebView
* feat(desktop): instance switcher and vendored app
* fix(desktop): merge artifacts and conflicts
* feat(desktop): instance switcher improvements
* fix: derive instance name from normalized name
* fix: pkg links, lints and UI edge cases
* feat(desktop): restore window state after relaunch
* fix(desktop): distinguish header for cloud/default
* fix: instance switcher in web mode
* fix: close dropdown on new instance modal
* fix: whitelist vendored app origin
* feat(desktop): platform parity - `collections`
* fix: history entries population desync
* fix(desktop): check for history storage status
* fix(desktop): safe parse `globalEnv`
* feat(desktop): platform parity - `environment`
* fix: use settings store for proxy url
* fix: lint, unused imports
* fix: proxy input enabled for other interceptors
* feat: reverse proxy for desktop app server
* fix: duplicate entries after connecting to sh
* fix: specify instance org qualified
* fix: remove debugging logs
* feat(desktop): enable `devtools` in release builds
* fix(desktop): prepend protocol validation edgecase
* feat(desktop): clear cache on removing instance
* fix: better response toast message
* fix: avoid reverse proxy for webapp server
* fix(desktop): ignore subpath in instance name
* feat: switcher ui/ux improvements
* feat: more switcher ui/ux improvements
* feat(server): specify bundle version at build time
* fix(desktop): missing migration as rebase artifact
* fix: minor switcher ui/ux improvement
* fix: rebase artifacts
* fix: consolidated toast on success
* fix: missing i18n strings
* fix(desktop): handle drag and drop fe side
* feat: confirmation modal on instance removal
* chore: minor UI update
* chore: minor UI changes
* fix: gql connection partial refactor
* fix: resolve merge artifacts
* chore: prod lint
* feat(desktop): better desktop app update ux
* fix: broken gql connection.ts
---------
Co-authored-by: nivedin <nivedinp@gmail.com>
Co-authored-by: Andrew Bastin <andrewbastin.k@gmail.com>
2025-02-27 18:31:25 +00:00
|
|
|
import * as E from "fp-ts/Either"
|
|
|
|
|
import { getModule } from "."
|
2025-11-26 06:04:47 +00:00
|
|
|
import { getKernelMode } from "@hoppscotch/kernel"
|
2026-03-26 12:30:51 +00:00
|
|
|
import { diag } from "./log"
|
|
|
|
|
|
|
|
|
|
// on desktop, org webviews share the same app:// origin as the main webview
|
|
|
|
|
// (to keep Tauri IPC working). the org context is passed as a query param
|
|
|
|
|
// (?org=test-org.hoppscotch.io) instead. we include it in the store path so
|
|
|
|
|
// each org gets its own store file on disk, preserving per-org isolation for
|
|
|
|
|
// auth tokens, settings, collections, etc.
|
|
|
|
|
//
|
|
|
|
|
// the org param is the raw host (e.g. "test-org.hoppscotch.io") so we
|
|
|
|
|
// sanitize it the same way Tauri sanitizes window labels: replace all
|
|
|
|
|
// non-alphanumeric chars with underscores. this produces the same filename
|
|
|
|
|
// as the old per-hostname approach (test_org_hoppscotch_io.hoppscotch.store)
|
|
|
|
|
// the ?org= query param is preserved across Vue Router navigations by
|
|
|
|
|
// a beforeEach guard in modules/router.ts, and survives full-page reloads
|
|
|
|
|
// because Tauri sets it on the initial webview URL
|
|
|
|
|
const orgParam = new URLSearchParams(window.location.search).get("org")
|
2026-04-28 09:29:10 +00:00
|
|
|
const HOST_SCOPED_STORE_PATH = orgParam
|
2026-03-26 12:30:51 +00:00
|
|
|
? `${orgParam.replace(/[^a-zA-Z0-9]/g, "_")}.hoppscotch.store`
|
|
|
|
|
: `${window.location.host}.hoppscotch.store`
|
|
|
|
|
|
2026-04-28 09:29:10 +00:00
|
|
|
// process-wide store file shared across orgs. holds machine-level state
|
|
|
|
|
// (desktop settings, recent-instances list, update state) that should
|
|
|
|
|
// not vary per organization. file name matches the path each shell's
|
|
|
|
|
// own `kernel/store.ts` wrapper writes to and the path
|
|
|
|
|
// `DesktopPersistenceService` uses on the Tauri side, so common
|
|
|
|
|
// composables that bind here read/write the same physical file the
|
|
|
|
|
// shell does.
|
|
|
|
|
const UNIFIED_STORE_PATH = "hoppscotch-unified.store"
|
|
|
|
|
|
2026-03-26 12:30:51 +00:00
|
|
|
diag("store", "--- COMMON store.ts module evaluated ---")
|
|
|
|
|
diag("store", "orgParam:", orgParam ?? "(none)")
|
2026-04-28 09:29:10 +00:00
|
|
|
diag("store", "HOST_SCOPED_STORE_PATH:", HOST_SCOPED_STORE_PATH)
|
|
|
|
|
diag("store", "UNIFIED_STORE_PATH:", UNIFIED_STORE_PATH)
|
2026-03-26 12:30:51 +00:00
|
|
|
diag("store", "window.location.host:", window.location.host)
|
|
|
|
|
diag("store", "window.location.href:", window.location.href)
|
2025-05-21 13:38:55 +00:00
|
|
|
|
2026-04-28 09:29:10 +00:00
|
|
|
// Lazy-loaded Tauri APIs. Module-scoped so every scoped store shares
|
|
|
|
|
// the init step and the loaded modules. Web mode never resolves these
|
|
|
|
|
// because `isInitd` returns early outside desktop.
|
2025-11-26 06:04:47 +00:00
|
|
|
let invoke:
|
|
|
|
|
| (<T>(cmd: string, args?: Record<string, unknown>) => Promise<T>)
|
|
|
|
|
| undefined
|
|
|
|
|
let join: ((...paths: string[]) => Promise<string>) | undefined
|
|
|
|
|
|
|
|
|
|
// Single init promise to avoid multiple imports and race conditions
|
|
|
|
|
let initPromise: Promise<void> | undefined
|
|
|
|
|
|
|
|
|
|
const isInitd = async () => {
|
|
|
|
|
if (getKernelMode() !== "desktop") return
|
|
|
|
|
|
|
|
|
|
if (!initPromise) {
|
|
|
|
|
initPromise = Promise.all([
|
|
|
|
|
import("@tauri-apps/api/core").then((module) => {
|
|
|
|
|
invoke = module.invoke
|
|
|
|
|
}),
|
|
|
|
|
import("@tauri-apps/api/path").then((module) => {
|
|
|
|
|
join = module.join
|
|
|
|
|
}),
|
|
|
|
|
]).then(() => {})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
await initPromise
|
|
|
|
|
}
|
|
|
|
|
|
2025-11-25 12:39:18 +00:00
|
|
|
export const getConfigDir = async (): Promise<string> => {
|
2025-11-26 06:04:47 +00:00
|
|
|
await isInitd()
|
|
|
|
|
if (!invoke) throw new Error("getConfigDir is only available in desktop mode")
|
2025-11-25 12:39:18 +00:00
|
|
|
return await invoke<string>("get_config_dir")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export const getBackupDir = async (): Promise<string> => {
|
2025-11-26 06:04:47 +00:00
|
|
|
await isInitd()
|
|
|
|
|
if (!invoke) throw new Error("getBackupDir is only available in desktop mode")
|
2025-11-25 12:39:18 +00:00
|
|
|
return await invoke<string>("get_backup_dir")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export const getLatestDir = async (): Promise<string> => {
|
2025-11-26 06:04:47 +00:00
|
|
|
await isInitd()
|
|
|
|
|
if (!invoke) throw new Error("getLatestDir is only available in desktop mode")
|
2025-11-25 12:39:18 +00:00
|
|
|
return await invoke<string>("get_latest_dir")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export const getStoreDir = async (): Promise<string> => {
|
2025-11-26 06:04:47 +00:00
|
|
|
await isInitd()
|
|
|
|
|
if (!invoke) throw new Error("getStoreDir is only available in desktop mode")
|
2025-11-25 12:39:18 +00:00
|
|
|
return await invoke<string>("get_store_dir")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export const getInstanceDir = async (): Promise<string> => {
|
2025-11-26 06:04:47 +00:00
|
|
|
await isInitd()
|
|
|
|
|
if (!invoke)
|
|
|
|
|
throw new Error("getInstanceDir is only available in desktop mode")
|
2025-11-25 12:39:18 +00:00
|
|
|
return await invoke<string>("get_instance_dir")
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-26 12:30:51 +00:00
|
|
|
export const getLogsDir = async (): Promise<string> => {
|
|
|
|
|
await isInitd()
|
|
|
|
|
if (!invoke) throw new Error("getLogsDir is only available in desktop mode")
|
|
|
|
|
return await invoke<string>("get_logs_dir")
|
|
|
|
|
}
|
|
|
|
|
|
2026-04-28 09:29:10 +00:00
|
|
|
// Factory for a Store wrapper bound to a specific store file. Each
|
|
|
|
|
// instance keeps its own resolved-path cache so two scoped stores
|
|
|
|
|
// never alias their absolute paths. Tauri-API loading and kernel
|
|
|
|
|
// module access are module-scoped above, so the factory only
|
|
|
|
|
// handles the per-store concerns.
|
|
|
|
|
function createScopedStore(staticPath: string) {
|
|
|
|
|
let cachedStorePath: string | undefined
|
2026-01-06 08:38:29 +00:00
|
|
|
|
2026-04-28 09:29:10 +00:00
|
|
|
const getStorePath = async (): Promise<string> => {
|
|
|
|
|
if (cachedStorePath) {
|
|
|
|
|
diag(
|
|
|
|
|
"store",
|
|
|
|
|
`getStorePath(${staticPath}): returning cached:`,
|
|
|
|
|
cachedStorePath
|
|
|
|
|
)
|
|
|
|
|
return cachedStorePath
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (getKernelMode() === "desktop") {
|
|
|
|
|
await isInitd()
|
|
|
|
|
if (join) {
|
|
|
|
|
try {
|
|
|
|
|
const storeDir = await getStoreDir()
|
|
|
|
|
cachedStorePath = await join(storeDir, staticPath)
|
|
|
|
|
diag(
|
|
|
|
|
"store",
|
|
|
|
|
`getStorePath(${staticPath}): resolved desktop path:`,
|
|
|
|
|
cachedStorePath
|
|
|
|
|
)
|
|
|
|
|
return cachedStorePath
|
|
|
|
|
} catch (error) {
|
|
|
|
|
diag(
|
|
|
|
|
"store",
|
|
|
|
|
`getStorePath(${staticPath}): failed to get store dir:`,
|
|
|
|
|
String(error)
|
|
|
|
|
)
|
|
|
|
|
console.error("Failed to get store directory:", error)
|
|
|
|
|
}
|
2025-11-26 06:04:47 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2026-04-28 09:29:10 +00:00
|
|
|
cachedStorePath = staticPath
|
|
|
|
|
diag(
|
|
|
|
|
"store",
|
|
|
|
|
`getStorePath(${staticPath}): using fallback path:`,
|
|
|
|
|
cachedStorePath
|
|
|
|
|
)
|
|
|
|
|
return cachedStorePath
|
|
|
|
|
}
|
2025-11-25 12:39:18 +00:00
|
|
|
|
feat: platform independent core and the new desktop app (#4684)
* feat(desktop): init
* feat(desktop): external app download and setup
* feat(desktop): offload app load to plugin system
* perf(desktop): add rdbms facade and caching layer
* feat: parallelize signing, shared trust, lru cache
* feat: webapp encoder + compressor + hasher server
* feat(desktop): app autoupdate with hashed loader
* feat(kernel): init `hoppscotch-kernel`
* feat(kernel): `io`
* feat(kernel): `network`
* feat(kernel): `network` - native interceptor
* feat(kernel): `network` - interceptor - rest
* feat(kernel): `network` - interceptor - graphql
* feat(kernel): `network` - interceptor - capabilities
* feat(kernel): `network` - interceptor - `FormData`
* feat(kernel): `network` - interceptor - `oauth2.0`
* feat(kernel): `store`
* feat(desktop): dragging, traffic light, plugin workspaces
* feat(kernel|wip): `store`
* feat(kernel): `network` - capabilities - with active
* feat(kernel|wip): `network` - interceptor - `proxy`
* feat(kernel|wip): `network` - relay ext
* feat(kernel): `network` - interceptor - `proxy`
* feat(kernel): `network` - interceptor - decoding
* feat(kernel): `network` - interceptor - Kernel Err
* feat(kernel): `network` - flow transformation
* feat(kernel): `network` - request status
* fix(desktop): repositioning traffic lights on fullscreen exit
* feat(kernel): `network` - interceptor - `agent`
* feat(kernel): `store` - track updates
* feat(kernel): `network` - interceptor - extension
* feat(kernel): `network` - updates as overrides
* feat(interceptor): pre-process request encoding
* fix(ui): mismatched extension button size/position
* feat(kernel): `network` - interceptor - `browser`
* feat(native): common certs componsable
* fix(kernel): interceptor selection store and json parse
* feat(kernel): `network` - consistent multipart encoding
* feat(kernel): `network` - interceptor - `OAuth2.0`
* feat(kernel): `network` - interceptor - cookie support
* feat(agent): registration list, log-sink, relay
* feat(kernel): `network` - interceptor subtitles
* feat(kernel): `store` - persist network settings
* fix(agent): encrypted ser/de certificate requests
* feat(kernel): `kernelInterceptor` spotlight service
* fix(kernel): gql introspection edge-case schema
* ref: conditionals for migrated components
* feat(kernel): `localaccess` capability via relay
* feat(kernel): `network` - explicit types and lint
* feat(kernel): `store` - isolate host and platform
* feat(kernel): `store` - persistence service
* fix(infra): whitelisted origins, non-std engines
* feat(desktop): impl deep-link callbacks
* feat(kernel): `auth`
* feat(kernel): `io` - event listeners
* feat(kernel): platform migration
* fix: dep `vue` import on Win 11
Fixes `error TS2305: Module '"vue"' has no exported member
'VueConstructor'.` arising from `splitpane` dependency.
* fix(webapp-server): platform independent res paths
* feat(desktop): auth and emit via embedded server
* feat(platform): host, csp and bundle compatibility
- Bundle name format for using as host
- Windows UI handler HWND casting and version detection
- CSP headers type handling in URI protocol
- Protocol whitelist in env config
* feat(desktop|wip): login flow with `auth-tokens`
feat(desktop|wip): typesafe auth
* feat(backend): `auth` token flow, gql/websocket
feat(desktop): working auth for gql
feat: gql client with refresh token
* feat(backend): `auth` token flow, authorization bearer
* fix(gen): qualifier clash when invalidating cache
* feat(common): coordinated initialization service
* fix(desktop): appload persistence in data json
* feat(desktop|wip): desktop icons and updater
* fix: typos in readme docs
* fix: docker ignore copying on windows
* fix: update `.lock` file after rebase
* fix: `persistenceService` setup in tests
* fix: remove old console logs
* fix: console error on invalid schema
Show console error if default value is used when loading invalid data from
local storage
* fix(test): `PersistenceService` methods
* fix(test): `PersistenceService` rest tab state
* fix(test): `PersistenceService` gql tab state
* fix(test): `PersistenceService` global env
* fix(test): `PersistenceService` mqtt request
* fix(test): `PersistenceService` sse request
* fix(test): `PersistenceService` socketio request
* fix(test): `PersistenceService` websocket request
* fix(test): `PersistenceService` secret environment
* fix(test): `PersistenceService` selected env
* fix(test): `PersistenceService` collections
* fix(test): `PersistenceService` environments
* fix(test): `PersistenceService` history
* fix(test): `PersistenceService` settings
* fix(test): `PersistenceService` migrations
* fix(test): `InspectionService` request inspector
* feat(desktop): button to clear bundle/key cache
This is useful when there are partial updates to the web app or bundle gen server
which haven't been correctly propagated when the app bundle was downloaded.
If the user were to change the self host instance without updating the
desktop app; which is possible albeit rarely under very certain circumstances,
desktop app will refuse to load the bundle, this is because the desktop app
cannot differentiate between partial updates vs incorrect bundle being hosted
since both will fail verification.
The button lets the user decide what should be the appropriate action,
clear the bundle and trust the hosted app
or make sure the app is built and hosted correctly.
* fix(desktop): enforce one version per instance
This was part of a leftover scaffolding from development.
* fix(desktop): bundle url not stored after download
* fix(desktop): stalling progress on updates
* fix(backend): helper to parse cookie into kv-pairs
* feat(desktop): launch session on working endpoints
* fix(common): preserve `auth` structure and default
* fix: loading native networking with kernel mode
* fix: fallback for unhandled response error
* fix: `urlencoded` content request processing
* feat: `interceptor` - error mapping for `browser`
* fix: backwards compatibility for `digest` auth
* fix: platform check for `initializationService`
* fix: `interceptor` - analytics `strategy` resolution
* fix: `interceptor` - check for `cookies` component
* fix: enable digest auth support for `native`
* test: `interceptor` - kernel interceptor
* fix(relay): `grantType` casing for OAuth2.0
* test(wip): kernel transformers
* fix(relay): auth headers discarding others
* fix(desktop): http version deserialization
* fix(common): `grantType` extractor, auth processor
* fix: `PersistenceService` - parsing edge cases
* fix(infra): post rebase fixup
* fix(web): component structure and lint
* fix(desktop): cohesive splash opener, scroll url section
* fix: explicit auto auth and docs on url auth
* fix(relay): special chars failing proxy auth
* fix: finer cert control setting option
* fix: post-rebase fixup
* feat(appload): ability to vendor pre-built bytes
* fix: avoid copying over `target` dir in containers
* fix: auth key missing in capability set
* fix(desktop): relax `refresh_token` requirement
This is to support Firebase token
* fix(desktop): normalization for Windows WebView
* feat(desktop): instance switcher and vendored app
* fix(desktop): merge artifacts and conflicts
* feat(desktop): instance switcher improvements
* fix: derive instance name from normalized name
* fix: pkg links, lints and UI edge cases
* feat(desktop): restore window state after relaunch
* fix(desktop): distinguish header for cloud/default
* fix: instance switcher in web mode
* fix: close dropdown on new instance modal
* fix: whitelist vendored app origin
* feat(desktop): platform parity - `collections`
* fix: history entries population desync
* fix(desktop): check for history storage status
* fix(desktop): safe parse `globalEnv`
* feat(desktop): platform parity - `environment`
* fix: use settings store for proxy url
* fix: lint, unused imports
* fix: proxy input enabled for other interceptors
* feat: reverse proxy for desktop app server
* fix: duplicate entries after connecting to sh
* fix: specify instance org qualified
* fix: remove debugging logs
* feat(desktop): enable `devtools` in release builds
* fix(desktop): prepend protocol validation edgecase
* feat(desktop): clear cache on removing instance
* fix: better response toast message
* fix: avoid reverse proxy for webapp server
* fix(desktop): ignore subpath in instance name
* feat: switcher ui/ux improvements
* feat: more switcher ui/ux improvements
* feat(server): specify bundle version at build time
* fix(desktop): missing migration as rebase artifact
* fix: minor switcher ui/ux improvement
* fix: rebase artifacts
* fix: consolidated toast on success
* fix: missing i18n strings
* fix(desktop): handle drag and drop fe side
* feat: confirmation modal on instance removal
* chore: minor UI update
* chore: minor UI changes
* fix: gql connection partial refactor
* fix: resolve merge artifacts
* chore: prod lint
* feat(desktop): better desktop app update ux
* fix: broken gql connection.ts
---------
Co-authored-by: nivedin <nivedinp@gmail.com>
Co-authored-by: Andrew Bastin <andrewbastin.k@gmail.com>
2025-02-27 18:31:25 +00:00
|
|
|
const module = () => getModule("store")
|
|
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
capabilities: () => module().capabilities,
|
2025-05-21 13:38:55 +00:00
|
|
|
|
|
|
|
|
init: async () => {
|
2025-11-25 12:39:18 +00:00
|
|
|
const storePath = await getStorePath()
|
2026-04-28 09:29:10 +00:00
|
|
|
diag("store", `Store.init(${staticPath}) called with path:`, storePath)
|
2026-03-26 12:30:51 +00:00
|
|
|
const result = await module().init(storePath)
|
2026-04-28 09:29:10 +00:00
|
|
|
diag("store", `Store.init(${staticPath}) completed for path:`, storePath)
|
2026-03-26 12:30:51 +00:00
|
|
|
return result
|
2025-05-21 13:38:55 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
|
|
set: async (
|
feat: platform independent core and the new desktop app (#4684)
* feat(desktop): init
* feat(desktop): external app download and setup
* feat(desktop): offload app load to plugin system
* perf(desktop): add rdbms facade and caching layer
* feat: parallelize signing, shared trust, lru cache
* feat: webapp encoder + compressor + hasher server
* feat(desktop): app autoupdate with hashed loader
* feat(kernel): init `hoppscotch-kernel`
* feat(kernel): `io`
* feat(kernel): `network`
* feat(kernel): `network` - native interceptor
* feat(kernel): `network` - interceptor - rest
* feat(kernel): `network` - interceptor - graphql
* feat(kernel): `network` - interceptor - capabilities
* feat(kernel): `network` - interceptor - `FormData`
* feat(kernel): `network` - interceptor - `oauth2.0`
* feat(kernel): `store`
* feat(desktop): dragging, traffic light, plugin workspaces
* feat(kernel|wip): `store`
* feat(kernel): `network` - capabilities - with active
* feat(kernel|wip): `network` - interceptor - `proxy`
* feat(kernel|wip): `network` - relay ext
* feat(kernel): `network` - interceptor - `proxy`
* feat(kernel): `network` - interceptor - decoding
* feat(kernel): `network` - interceptor - Kernel Err
* feat(kernel): `network` - flow transformation
* feat(kernel): `network` - request status
* fix(desktop): repositioning traffic lights on fullscreen exit
* feat(kernel): `network` - interceptor - `agent`
* feat(kernel): `store` - track updates
* feat(kernel): `network` - interceptor - extension
* feat(kernel): `network` - updates as overrides
* feat(interceptor): pre-process request encoding
* fix(ui): mismatched extension button size/position
* feat(kernel): `network` - interceptor - `browser`
* feat(native): common certs componsable
* fix(kernel): interceptor selection store and json parse
* feat(kernel): `network` - consistent multipart encoding
* feat(kernel): `network` - interceptor - `OAuth2.0`
* feat(kernel): `network` - interceptor - cookie support
* feat(agent): registration list, log-sink, relay
* feat(kernel): `network` - interceptor subtitles
* feat(kernel): `store` - persist network settings
* fix(agent): encrypted ser/de certificate requests
* feat(kernel): `kernelInterceptor` spotlight service
* fix(kernel): gql introspection edge-case schema
* ref: conditionals for migrated components
* feat(kernel): `localaccess` capability via relay
* feat(kernel): `network` - explicit types and lint
* feat(kernel): `store` - isolate host and platform
* feat(kernel): `store` - persistence service
* fix(infra): whitelisted origins, non-std engines
* feat(desktop): impl deep-link callbacks
* feat(kernel): `auth`
* feat(kernel): `io` - event listeners
* feat(kernel): platform migration
* fix: dep `vue` import on Win 11
Fixes `error TS2305: Module '"vue"' has no exported member
'VueConstructor'.` arising from `splitpane` dependency.
* fix(webapp-server): platform independent res paths
* feat(desktop): auth and emit via embedded server
* feat(platform): host, csp and bundle compatibility
- Bundle name format for using as host
- Windows UI handler HWND casting and version detection
- CSP headers type handling in URI protocol
- Protocol whitelist in env config
* feat(desktop|wip): login flow with `auth-tokens`
feat(desktop|wip): typesafe auth
* feat(backend): `auth` token flow, gql/websocket
feat(desktop): working auth for gql
feat: gql client with refresh token
* feat(backend): `auth` token flow, authorization bearer
* fix(gen): qualifier clash when invalidating cache
* feat(common): coordinated initialization service
* fix(desktop): appload persistence in data json
* feat(desktop|wip): desktop icons and updater
* fix: typos in readme docs
* fix: docker ignore copying on windows
* fix: update `.lock` file after rebase
* fix: `persistenceService` setup in tests
* fix: remove old console logs
* fix: console error on invalid schema
Show console error if default value is used when loading invalid data from
local storage
* fix(test): `PersistenceService` methods
* fix(test): `PersistenceService` rest tab state
* fix(test): `PersistenceService` gql tab state
* fix(test): `PersistenceService` global env
* fix(test): `PersistenceService` mqtt request
* fix(test): `PersistenceService` sse request
* fix(test): `PersistenceService` socketio request
* fix(test): `PersistenceService` websocket request
* fix(test): `PersistenceService` secret environment
* fix(test): `PersistenceService` selected env
* fix(test): `PersistenceService` collections
* fix(test): `PersistenceService` environments
* fix(test): `PersistenceService` history
* fix(test): `PersistenceService` settings
* fix(test): `PersistenceService` migrations
* fix(test): `InspectionService` request inspector
* feat(desktop): button to clear bundle/key cache
This is useful when there are partial updates to the web app or bundle gen server
which haven't been correctly propagated when the app bundle was downloaded.
If the user were to change the self host instance without updating the
desktop app; which is possible albeit rarely under very certain circumstances,
desktop app will refuse to load the bundle, this is because the desktop app
cannot differentiate between partial updates vs incorrect bundle being hosted
since both will fail verification.
The button lets the user decide what should be the appropriate action,
clear the bundle and trust the hosted app
or make sure the app is built and hosted correctly.
* fix(desktop): enforce one version per instance
This was part of a leftover scaffolding from development.
* fix(desktop): bundle url not stored after download
* fix(desktop): stalling progress on updates
* fix(backend): helper to parse cookie into kv-pairs
* feat(desktop): launch session on working endpoints
* fix(common): preserve `auth` structure and default
* fix: loading native networking with kernel mode
* fix: fallback for unhandled response error
* fix: `urlencoded` content request processing
* feat: `interceptor` - error mapping for `browser`
* fix: backwards compatibility for `digest` auth
* fix: platform check for `initializationService`
* fix: `interceptor` - analytics `strategy` resolution
* fix: `interceptor` - check for `cookies` component
* fix: enable digest auth support for `native`
* test: `interceptor` - kernel interceptor
* fix(relay): `grantType` casing for OAuth2.0
* test(wip): kernel transformers
* fix(relay): auth headers discarding others
* fix(desktop): http version deserialization
* fix(common): `grantType` extractor, auth processor
* fix: `PersistenceService` - parsing edge cases
* fix(infra): post rebase fixup
* fix(web): component structure and lint
* fix(desktop): cohesive splash opener, scroll url section
* fix: explicit auto auth and docs on url auth
* fix(relay): special chars failing proxy auth
* fix: finer cert control setting option
* fix: post-rebase fixup
* feat(appload): ability to vendor pre-built bytes
* fix: avoid copying over `target` dir in containers
* fix: auth key missing in capability set
* fix(desktop): relax `refresh_token` requirement
This is to support Firebase token
* fix(desktop): normalization for Windows WebView
* feat(desktop): instance switcher and vendored app
* fix(desktop): merge artifacts and conflicts
* feat(desktop): instance switcher improvements
* fix: derive instance name from normalized name
* fix: pkg links, lints and UI edge cases
* feat(desktop): restore window state after relaunch
* fix(desktop): distinguish header for cloud/default
* fix: instance switcher in web mode
* fix: close dropdown on new instance modal
* fix: whitelist vendored app origin
* feat(desktop): platform parity - `collections`
* fix: history entries population desync
* fix(desktop): check for history storage status
* fix(desktop): safe parse `globalEnv`
* feat(desktop): platform parity - `environment`
* fix: use settings store for proxy url
* fix: lint, unused imports
* fix: proxy input enabled for other interceptors
* feat: reverse proxy for desktop app server
* fix: duplicate entries after connecting to sh
* fix: specify instance org qualified
* fix: remove debugging logs
* feat(desktop): enable `devtools` in release builds
* fix(desktop): prepend protocol validation edgecase
* feat(desktop): clear cache on removing instance
* fix: better response toast message
* fix: avoid reverse proxy for webapp server
* fix(desktop): ignore subpath in instance name
* feat: switcher ui/ux improvements
* feat: more switcher ui/ux improvements
* feat(server): specify bundle version at build time
* fix(desktop): missing migration as rebase artifact
* fix: minor switcher ui/ux improvement
* fix: rebase artifacts
* fix: consolidated toast on success
* fix: missing i18n strings
* fix(desktop): handle drag and drop fe side
* feat: confirmation modal on instance removal
* chore: minor UI update
* chore: minor UI changes
* fix: gql connection partial refactor
* fix: resolve merge artifacts
* chore: prod lint
* feat(desktop): better desktop app update ux
* fix: broken gql connection.ts
---------
Co-authored-by: nivedin <nivedinp@gmail.com>
Co-authored-by: Andrew Bastin <andrewbastin.k@gmail.com>
2025-02-27 18:31:25 +00:00
|
|
|
namespace: string,
|
|
|
|
|
key: string,
|
|
|
|
|
value: unknown,
|
|
|
|
|
options?: StorageOptions
|
2025-05-21 13:38:55 +00:00
|
|
|
): Promise<E.Either<StoreError, void>> => {
|
2025-11-25 12:39:18 +00:00
|
|
|
const storePath = await getStorePath()
|
2026-04-28 09:29:10 +00:00
|
|
|
diag(
|
|
|
|
|
"store",
|
|
|
|
|
`Store.set(${namespace}, ${key}) on ${staticPath}:`,
|
|
|
|
|
storePath
|
|
|
|
|
)
|
2025-11-25 12:39:18 +00:00
|
|
|
return module().set(storePath, namespace, key, value, options)
|
2025-05-21 13:38:55 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
|
|
get: async <T>(
|
feat: platform independent core and the new desktop app (#4684)
* feat(desktop): init
* feat(desktop): external app download and setup
* feat(desktop): offload app load to plugin system
* perf(desktop): add rdbms facade and caching layer
* feat: parallelize signing, shared trust, lru cache
* feat: webapp encoder + compressor + hasher server
* feat(desktop): app autoupdate with hashed loader
* feat(kernel): init `hoppscotch-kernel`
* feat(kernel): `io`
* feat(kernel): `network`
* feat(kernel): `network` - native interceptor
* feat(kernel): `network` - interceptor - rest
* feat(kernel): `network` - interceptor - graphql
* feat(kernel): `network` - interceptor - capabilities
* feat(kernel): `network` - interceptor - `FormData`
* feat(kernel): `network` - interceptor - `oauth2.0`
* feat(kernel): `store`
* feat(desktop): dragging, traffic light, plugin workspaces
* feat(kernel|wip): `store`
* feat(kernel): `network` - capabilities - with active
* feat(kernel|wip): `network` - interceptor - `proxy`
* feat(kernel|wip): `network` - relay ext
* feat(kernel): `network` - interceptor - `proxy`
* feat(kernel): `network` - interceptor - decoding
* feat(kernel): `network` - interceptor - Kernel Err
* feat(kernel): `network` - flow transformation
* feat(kernel): `network` - request status
* fix(desktop): repositioning traffic lights on fullscreen exit
* feat(kernel): `network` - interceptor - `agent`
* feat(kernel): `store` - track updates
* feat(kernel): `network` - interceptor - extension
* feat(kernel): `network` - updates as overrides
* feat(interceptor): pre-process request encoding
* fix(ui): mismatched extension button size/position
* feat(kernel): `network` - interceptor - `browser`
* feat(native): common certs componsable
* fix(kernel): interceptor selection store and json parse
* feat(kernel): `network` - consistent multipart encoding
* feat(kernel): `network` - interceptor - `OAuth2.0`
* feat(kernel): `network` - interceptor - cookie support
* feat(agent): registration list, log-sink, relay
* feat(kernel): `network` - interceptor subtitles
* feat(kernel): `store` - persist network settings
* fix(agent): encrypted ser/de certificate requests
* feat(kernel): `kernelInterceptor` spotlight service
* fix(kernel): gql introspection edge-case schema
* ref: conditionals for migrated components
* feat(kernel): `localaccess` capability via relay
* feat(kernel): `network` - explicit types and lint
* feat(kernel): `store` - isolate host and platform
* feat(kernel): `store` - persistence service
* fix(infra): whitelisted origins, non-std engines
* feat(desktop): impl deep-link callbacks
* feat(kernel): `auth`
* feat(kernel): `io` - event listeners
* feat(kernel): platform migration
* fix: dep `vue` import on Win 11
Fixes `error TS2305: Module '"vue"' has no exported member
'VueConstructor'.` arising from `splitpane` dependency.
* fix(webapp-server): platform independent res paths
* feat(desktop): auth and emit via embedded server
* feat(platform): host, csp and bundle compatibility
- Bundle name format for using as host
- Windows UI handler HWND casting and version detection
- CSP headers type handling in URI protocol
- Protocol whitelist in env config
* feat(desktop|wip): login flow with `auth-tokens`
feat(desktop|wip): typesafe auth
* feat(backend): `auth` token flow, gql/websocket
feat(desktop): working auth for gql
feat: gql client with refresh token
* feat(backend): `auth` token flow, authorization bearer
* fix(gen): qualifier clash when invalidating cache
* feat(common): coordinated initialization service
* fix(desktop): appload persistence in data json
* feat(desktop|wip): desktop icons and updater
* fix: typos in readme docs
* fix: docker ignore copying on windows
* fix: update `.lock` file after rebase
* fix: `persistenceService` setup in tests
* fix: remove old console logs
* fix: console error on invalid schema
Show console error if default value is used when loading invalid data from
local storage
* fix(test): `PersistenceService` methods
* fix(test): `PersistenceService` rest tab state
* fix(test): `PersistenceService` gql tab state
* fix(test): `PersistenceService` global env
* fix(test): `PersistenceService` mqtt request
* fix(test): `PersistenceService` sse request
* fix(test): `PersistenceService` socketio request
* fix(test): `PersistenceService` websocket request
* fix(test): `PersistenceService` secret environment
* fix(test): `PersistenceService` selected env
* fix(test): `PersistenceService` collections
* fix(test): `PersistenceService` environments
* fix(test): `PersistenceService` history
* fix(test): `PersistenceService` settings
* fix(test): `PersistenceService` migrations
* fix(test): `InspectionService` request inspector
* feat(desktop): button to clear bundle/key cache
This is useful when there are partial updates to the web app or bundle gen server
which haven't been correctly propagated when the app bundle was downloaded.
If the user were to change the self host instance without updating the
desktop app; which is possible albeit rarely under very certain circumstances,
desktop app will refuse to load the bundle, this is because the desktop app
cannot differentiate between partial updates vs incorrect bundle being hosted
since both will fail verification.
The button lets the user decide what should be the appropriate action,
clear the bundle and trust the hosted app
or make sure the app is built and hosted correctly.
* fix(desktop): enforce one version per instance
This was part of a leftover scaffolding from development.
* fix(desktop): bundle url not stored after download
* fix(desktop): stalling progress on updates
* fix(backend): helper to parse cookie into kv-pairs
* feat(desktop): launch session on working endpoints
* fix(common): preserve `auth` structure and default
* fix: loading native networking with kernel mode
* fix: fallback for unhandled response error
* fix: `urlencoded` content request processing
* feat: `interceptor` - error mapping for `browser`
* fix: backwards compatibility for `digest` auth
* fix: platform check for `initializationService`
* fix: `interceptor` - analytics `strategy` resolution
* fix: `interceptor` - check for `cookies` component
* fix: enable digest auth support for `native`
* test: `interceptor` - kernel interceptor
* fix(relay): `grantType` casing for OAuth2.0
* test(wip): kernel transformers
* fix(relay): auth headers discarding others
* fix(desktop): http version deserialization
* fix(common): `grantType` extractor, auth processor
* fix: `PersistenceService` - parsing edge cases
* fix(infra): post rebase fixup
* fix(web): component structure and lint
* fix(desktop): cohesive splash opener, scroll url section
* fix: explicit auto auth and docs on url auth
* fix(relay): special chars failing proxy auth
* fix: finer cert control setting option
* fix: post-rebase fixup
* feat(appload): ability to vendor pre-built bytes
* fix: avoid copying over `target` dir in containers
* fix: auth key missing in capability set
* fix(desktop): relax `refresh_token` requirement
This is to support Firebase token
* fix(desktop): normalization for Windows WebView
* feat(desktop): instance switcher and vendored app
* fix(desktop): merge artifacts and conflicts
* feat(desktop): instance switcher improvements
* fix: derive instance name from normalized name
* fix: pkg links, lints and UI edge cases
* feat(desktop): restore window state after relaunch
* fix(desktop): distinguish header for cloud/default
* fix: instance switcher in web mode
* fix: close dropdown on new instance modal
* fix: whitelist vendored app origin
* feat(desktop): platform parity - `collections`
* fix: history entries population desync
* fix(desktop): check for history storage status
* fix(desktop): safe parse `globalEnv`
* feat(desktop): platform parity - `environment`
* fix: use settings store for proxy url
* fix: lint, unused imports
* fix: proxy input enabled for other interceptors
* feat: reverse proxy for desktop app server
* fix: duplicate entries after connecting to sh
* fix: specify instance org qualified
* fix: remove debugging logs
* feat(desktop): enable `devtools` in release builds
* fix(desktop): prepend protocol validation edgecase
* feat(desktop): clear cache on removing instance
* fix: better response toast message
* fix: avoid reverse proxy for webapp server
* fix(desktop): ignore subpath in instance name
* feat: switcher ui/ux improvements
* feat: more switcher ui/ux improvements
* feat(server): specify bundle version at build time
* fix(desktop): missing migration as rebase artifact
* fix: minor switcher ui/ux improvement
* fix: rebase artifacts
* fix: consolidated toast on success
* fix: missing i18n strings
* fix(desktop): handle drag and drop fe side
* feat: confirmation modal on instance removal
* chore: minor UI update
* chore: minor UI changes
* fix: gql connection partial refactor
* fix: resolve merge artifacts
* chore: prod lint
* feat(desktop): better desktop app update ux
* fix: broken gql connection.ts
---------
Co-authored-by: nivedin <nivedinp@gmail.com>
Co-authored-by: Andrew Bastin <andrewbastin.k@gmail.com>
2025-02-27 18:31:25 +00:00
|
|
|
namespace: string,
|
|
|
|
|
key: string
|
2025-05-21 13:38:55 +00:00
|
|
|
): Promise<E.Either<StoreError, T | undefined>> => {
|
2025-11-25 12:39:18 +00:00
|
|
|
const storePath = await getStorePath()
|
2026-04-28 09:29:10 +00:00
|
|
|
diag(
|
|
|
|
|
"store",
|
|
|
|
|
`Store.get(${namespace}, ${key}) on ${staticPath}:`,
|
|
|
|
|
storePath
|
|
|
|
|
)
|
2026-03-26 12:30:51 +00:00
|
|
|
const result = await module().get<T>(storePath, namespace, key)
|
|
|
|
|
if (E.isRight(result)) {
|
|
|
|
|
const val = result.right
|
|
|
|
|
const shape =
|
|
|
|
|
val === undefined
|
|
|
|
|
? "undefined"
|
|
|
|
|
: val === null
|
|
|
|
|
? "null"
|
|
|
|
|
: typeof val === "object"
|
|
|
|
|
? `object(${Object.keys(val as Record<string, unknown>).length} keys)`
|
|
|
|
|
: typeof val
|
2026-04-28 09:29:10 +00:00
|
|
|
diag(
|
|
|
|
|
"store",
|
|
|
|
|
`Store.get(${namespace}, ${key}) on ${staticPath} => Right(${shape})`
|
|
|
|
|
)
|
2026-03-26 12:30:51 +00:00
|
|
|
} else {
|
2026-04-28 09:29:10 +00:00
|
|
|
diag(
|
|
|
|
|
"store",
|
|
|
|
|
`Store.get(${namespace}, ${key}) on ${staticPath} => Left:`,
|
|
|
|
|
result.left
|
|
|
|
|
)
|
2026-03-26 12:30:51 +00:00
|
|
|
}
|
|
|
|
|
return result
|
2025-05-21 13:38:55 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
|
|
remove: async (
|
feat: platform independent core and the new desktop app (#4684)
* feat(desktop): init
* feat(desktop): external app download and setup
* feat(desktop): offload app load to plugin system
* perf(desktop): add rdbms facade and caching layer
* feat: parallelize signing, shared trust, lru cache
* feat: webapp encoder + compressor + hasher server
* feat(desktop): app autoupdate with hashed loader
* feat(kernel): init `hoppscotch-kernel`
* feat(kernel): `io`
* feat(kernel): `network`
* feat(kernel): `network` - native interceptor
* feat(kernel): `network` - interceptor - rest
* feat(kernel): `network` - interceptor - graphql
* feat(kernel): `network` - interceptor - capabilities
* feat(kernel): `network` - interceptor - `FormData`
* feat(kernel): `network` - interceptor - `oauth2.0`
* feat(kernel): `store`
* feat(desktop): dragging, traffic light, plugin workspaces
* feat(kernel|wip): `store`
* feat(kernel): `network` - capabilities - with active
* feat(kernel|wip): `network` - interceptor - `proxy`
* feat(kernel|wip): `network` - relay ext
* feat(kernel): `network` - interceptor - `proxy`
* feat(kernel): `network` - interceptor - decoding
* feat(kernel): `network` - interceptor - Kernel Err
* feat(kernel): `network` - flow transformation
* feat(kernel): `network` - request status
* fix(desktop): repositioning traffic lights on fullscreen exit
* feat(kernel): `network` - interceptor - `agent`
* feat(kernel): `store` - track updates
* feat(kernel): `network` - interceptor - extension
* feat(kernel): `network` - updates as overrides
* feat(interceptor): pre-process request encoding
* fix(ui): mismatched extension button size/position
* feat(kernel): `network` - interceptor - `browser`
* feat(native): common certs componsable
* fix(kernel): interceptor selection store and json parse
* feat(kernel): `network` - consistent multipart encoding
* feat(kernel): `network` - interceptor - `OAuth2.0`
* feat(kernel): `network` - interceptor - cookie support
* feat(agent): registration list, log-sink, relay
* feat(kernel): `network` - interceptor subtitles
* feat(kernel): `store` - persist network settings
* fix(agent): encrypted ser/de certificate requests
* feat(kernel): `kernelInterceptor` spotlight service
* fix(kernel): gql introspection edge-case schema
* ref: conditionals for migrated components
* feat(kernel): `localaccess` capability via relay
* feat(kernel): `network` - explicit types and lint
* feat(kernel): `store` - isolate host and platform
* feat(kernel): `store` - persistence service
* fix(infra): whitelisted origins, non-std engines
* feat(desktop): impl deep-link callbacks
* feat(kernel): `auth`
* feat(kernel): `io` - event listeners
* feat(kernel): platform migration
* fix: dep `vue` import on Win 11
Fixes `error TS2305: Module '"vue"' has no exported member
'VueConstructor'.` arising from `splitpane` dependency.
* fix(webapp-server): platform independent res paths
* feat(desktop): auth and emit via embedded server
* feat(platform): host, csp and bundle compatibility
- Bundle name format for using as host
- Windows UI handler HWND casting and version detection
- CSP headers type handling in URI protocol
- Protocol whitelist in env config
* feat(desktop|wip): login flow with `auth-tokens`
feat(desktop|wip): typesafe auth
* feat(backend): `auth` token flow, gql/websocket
feat(desktop): working auth for gql
feat: gql client with refresh token
* feat(backend): `auth` token flow, authorization bearer
* fix(gen): qualifier clash when invalidating cache
* feat(common): coordinated initialization service
* fix(desktop): appload persistence in data json
* feat(desktop|wip): desktop icons and updater
* fix: typos in readme docs
* fix: docker ignore copying on windows
* fix: update `.lock` file after rebase
* fix: `persistenceService` setup in tests
* fix: remove old console logs
* fix: console error on invalid schema
Show console error if default value is used when loading invalid data from
local storage
* fix(test): `PersistenceService` methods
* fix(test): `PersistenceService` rest tab state
* fix(test): `PersistenceService` gql tab state
* fix(test): `PersistenceService` global env
* fix(test): `PersistenceService` mqtt request
* fix(test): `PersistenceService` sse request
* fix(test): `PersistenceService` socketio request
* fix(test): `PersistenceService` websocket request
* fix(test): `PersistenceService` secret environment
* fix(test): `PersistenceService` selected env
* fix(test): `PersistenceService` collections
* fix(test): `PersistenceService` environments
* fix(test): `PersistenceService` history
* fix(test): `PersistenceService` settings
* fix(test): `PersistenceService` migrations
* fix(test): `InspectionService` request inspector
* feat(desktop): button to clear bundle/key cache
This is useful when there are partial updates to the web app or bundle gen server
which haven't been correctly propagated when the app bundle was downloaded.
If the user were to change the self host instance without updating the
desktop app; which is possible albeit rarely under very certain circumstances,
desktop app will refuse to load the bundle, this is because the desktop app
cannot differentiate between partial updates vs incorrect bundle being hosted
since both will fail verification.
The button lets the user decide what should be the appropriate action,
clear the bundle and trust the hosted app
or make sure the app is built and hosted correctly.
* fix(desktop): enforce one version per instance
This was part of a leftover scaffolding from development.
* fix(desktop): bundle url not stored after download
* fix(desktop): stalling progress on updates
* fix(backend): helper to parse cookie into kv-pairs
* feat(desktop): launch session on working endpoints
* fix(common): preserve `auth` structure and default
* fix: loading native networking with kernel mode
* fix: fallback for unhandled response error
* fix: `urlencoded` content request processing
* feat: `interceptor` - error mapping for `browser`
* fix: backwards compatibility for `digest` auth
* fix: platform check for `initializationService`
* fix: `interceptor` - analytics `strategy` resolution
* fix: `interceptor` - check for `cookies` component
* fix: enable digest auth support for `native`
* test: `interceptor` - kernel interceptor
* fix(relay): `grantType` casing for OAuth2.0
* test(wip): kernel transformers
* fix(relay): auth headers discarding others
* fix(desktop): http version deserialization
* fix(common): `grantType` extractor, auth processor
* fix: `PersistenceService` - parsing edge cases
* fix(infra): post rebase fixup
* fix(web): component structure and lint
* fix(desktop): cohesive splash opener, scroll url section
* fix: explicit auto auth and docs on url auth
* fix(relay): special chars failing proxy auth
* fix: finer cert control setting option
* fix: post-rebase fixup
* feat(appload): ability to vendor pre-built bytes
* fix: avoid copying over `target` dir in containers
* fix: auth key missing in capability set
* fix(desktop): relax `refresh_token` requirement
This is to support Firebase token
* fix(desktop): normalization for Windows WebView
* feat(desktop): instance switcher and vendored app
* fix(desktop): merge artifacts and conflicts
* feat(desktop): instance switcher improvements
* fix: derive instance name from normalized name
* fix: pkg links, lints and UI edge cases
* feat(desktop): restore window state after relaunch
* fix(desktop): distinguish header for cloud/default
* fix: instance switcher in web mode
* fix: close dropdown on new instance modal
* fix: whitelist vendored app origin
* feat(desktop): platform parity - `collections`
* fix: history entries population desync
* fix(desktop): check for history storage status
* fix(desktop): safe parse `globalEnv`
* feat(desktop): platform parity - `environment`
* fix: use settings store for proxy url
* fix: lint, unused imports
* fix: proxy input enabled for other interceptors
* feat: reverse proxy for desktop app server
* fix: duplicate entries after connecting to sh
* fix: specify instance org qualified
* fix: remove debugging logs
* feat(desktop): enable `devtools` in release builds
* fix(desktop): prepend protocol validation edgecase
* feat(desktop): clear cache on removing instance
* fix: better response toast message
* fix: avoid reverse proxy for webapp server
* fix(desktop): ignore subpath in instance name
* feat: switcher ui/ux improvements
* feat: more switcher ui/ux improvements
* feat(server): specify bundle version at build time
* fix(desktop): missing migration as rebase artifact
* fix: minor switcher ui/ux improvement
* fix: rebase artifacts
* fix: consolidated toast on success
* fix: missing i18n strings
* fix(desktop): handle drag and drop fe side
* feat: confirmation modal on instance removal
* chore: minor UI update
* chore: minor UI changes
* fix: gql connection partial refactor
* fix: resolve merge artifacts
* chore: prod lint
* feat(desktop): better desktop app update ux
* fix: broken gql connection.ts
---------
Co-authored-by: nivedin <nivedinp@gmail.com>
Co-authored-by: Andrew Bastin <andrewbastin.k@gmail.com>
2025-02-27 18:31:25 +00:00
|
|
|
namespace: string,
|
|
|
|
|
key: string
|
2025-05-21 13:38:55 +00:00
|
|
|
): Promise<E.Either<StoreError, boolean>> => {
|
2025-11-25 12:39:18 +00:00
|
|
|
const storePath = await getStorePath()
|
|
|
|
|
return module().remove(storePath, namespace, key)
|
2025-05-21 13:38:55 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
|
|
clear: async (namespace?: string): Promise<E.Either<StoreError, void>> => {
|
2025-11-25 12:39:18 +00:00
|
|
|
const storePath = await getStorePath()
|
|
|
|
|
return module().clear(storePath, namespace)
|
2025-05-21 13:38:55 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
|
|
has: async (
|
feat: platform independent core and the new desktop app (#4684)
* feat(desktop): init
* feat(desktop): external app download and setup
* feat(desktop): offload app load to plugin system
* perf(desktop): add rdbms facade and caching layer
* feat: parallelize signing, shared trust, lru cache
* feat: webapp encoder + compressor + hasher server
* feat(desktop): app autoupdate with hashed loader
* feat(kernel): init `hoppscotch-kernel`
* feat(kernel): `io`
* feat(kernel): `network`
* feat(kernel): `network` - native interceptor
* feat(kernel): `network` - interceptor - rest
* feat(kernel): `network` - interceptor - graphql
* feat(kernel): `network` - interceptor - capabilities
* feat(kernel): `network` - interceptor - `FormData`
* feat(kernel): `network` - interceptor - `oauth2.0`
* feat(kernel): `store`
* feat(desktop): dragging, traffic light, plugin workspaces
* feat(kernel|wip): `store`
* feat(kernel): `network` - capabilities - with active
* feat(kernel|wip): `network` - interceptor - `proxy`
* feat(kernel|wip): `network` - relay ext
* feat(kernel): `network` - interceptor - `proxy`
* feat(kernel): `network` - interceptor - decoding
* feat(kernel): `network` - interceptor - Kernel Err
* feat(kernel): `network` - flow transformation
* feat(kernel): `network` - request status
* fix(desktop): repositioning traffic lights on fullscreen exit
* feat(kernel): `network` - interceptor - `agent`
* feat(kernel): `store` - track updates
* feat(kernel): `network` - interceptor - extension
* feat(kernel): `network` - updates as overrides
* feat(interceptor): pre-process request encoding
* fix(ui): mismatched extension button size/position
* feat(kernel): `network` - interceptor - `browser`
* feat(native): common certs componsable
* fix(kernel): interceptor selection store and json parse
* feat(kernel): `network` - consistent multipart encoding
* feat(kernel): `network` - interceptor - `OAuth2.0`
* feat(kernel): `network` - interceptor - cookie support
* feat(agent): registration list, log-sink, relay
* feat(kernel): `network` - interceptor subtitles
* feat(kernel): `store` - persist network settings
* fix(agent): encrypted ser/de certificate requests
* feat(kernel): `kernelInterceptor` spotlight service
* fix(kernel): gql introspection edge-case schema
* ref: conditionals for migrated components
* feat(kernel): `localaccess` capability via relay
* feat(kernel): `network` - explicit types and lint
* feat(kernel): `store` - isolate host and platform
* feat(kernel): `store` - persistence service
* fix(infra): whitelisted origins, non-std engines
* feat(desktop): impl deep-link callbacks
* feat(kernel): `auth`
* feat(kernel): `io` - event listeners
* feat(kernel): platform migration
* fix: dep `vue` import on Win 11
Fixes `error TS2305: Module '"vue"' has no exported member
'VueConstructor'.` arising from `splitpane` dependency.
* fix(webapp-server): platform independent res paths
* feat(desktop): auth and emit via embedded server
* feat(platform): host, csp and bundle compatibility
- Bundle name format for using as host
- Windows UI handler HWND casting and version detection
- CSP headers type handling in URI protocol
- Protocol whitelist in env config
* feat(desktop|wip): login flow with `auth-tokens`
feat(desktop|wip): typesafe auth
* feat(backend): `auth` token flow, gql/websocket
feat(desktop): working auth for gql
feat: gql client with refresh token
* feat(backend): `auth` token flow, authorization bearer
* fix(gen): qualifier clash when invalidating cache
* feat(common): coordinated initialization service
* fix(desktop): appload persistence in data json
* feat(desktop|wip): desktop icons and updater
* fix: typos in readme docs
* fix: docker ignore copying on windows
* fix: update `.lock` file after rebase
* fix: `persistenceService` setup in tests
* fix: remove old console logs
* fix: console error on invalid schema
Show console error if default value is used when loading invalid data from
local storage
* fix(test): `PersistenceService` methods
* fix(test): `PersistenceService` rest tab state
* fix(test): `PersistenceService` gql tab state
* fix(test): `PersistenceService` global env
* fix(test): `PersistenceService` mqtt request
* fix(test): `PersistenceService` sse request
* fix(test): `PersistenceService` socketio request
* fix(test): `PersistenceService` websocket request
* fix(test): `PersistenceService` secret environment
* fix(test): `PersistenceService` selected env
* fix(test): `PersistenceService` collections
* fix(test): `PersistenceService` environments
* fix(test): `PersistenceService` history
* fix(test): `PersistenceService` settings
* fix(test): `PersistenceService` migrations
* fix(test): `InspectionService` request inspector
* feat(desktop): button to clear bundle/key cache
This is useful when there are partial updates to the web app or bundle gen server
which haven't been correctly propagated when the app bundle was downloaded.
If the user were to change the self host instance without updating the
desktop app; which is possible albeit rarely under very certain circumstances,
desktop app will refuse to load the bundle, this is because the desktop app
cannot differentiate between partial updates vs incorrect bundle being hosted
since both will fail verification.
The button lets the user decide what should be the appropriate action,
clear the bundle and trust the hosted app
or make sure the app is built and hosted correctly.
* fix(desktop): enforce one version per instance
This was part of a leftover scaffolding from development.
* fix(desktop): bundle url not stored after download
* fix(desktop): stalling progress on updates
* fix(backend): helper to parse cookie into kv-pairs
* feat(desktop): launch session on working endpoints
* fix(common): preserve `auth` structure and default
* fix: loading native networking with kernel mode
* fix: fallback for unhandled response error
* fix: `urlencoded` content request processing
* feat: `interceptor` - error mapping for `browser`
* fix: backwards compatibility for `digest` auth
* fix: platform check for `initializationService`
* fix: `interceptor` - analytics `strategy` resolution
* fix: `interceptor` - check for `cookies` component
* fix: enable digest auth support for `native`
* test: `interceptor` - kernel interceptor
* fix(relay): `grantType` casing for OAuth2.0
* test(wip): kernel transformers
* fix(relay): auth headers discarding others
* fix(desktop): http version deserialization
* fix(common): `grantType` extractor, auth processor
* fix: `PersistenceService` - parsing edge cases
* fix(infra): post rebase fixup
* fix(web): component structure and lint
* fix(desktop): cohesive splash opener, scroll url section
* fix: explicit auto auth and docs on url auth
* fix(relay): special chars failing proxy auth
* fix: finer cert control setting option
* fix: post-rebase fixup
* feat(appload): ability to vendor pre-built bytes
* fix: avoid copying over `target` dir in containers
* fix: auth key missing in capability set
* fix(desktop): relax `refresh_token` requirement
This is to support Firebase token
* fix(desktop): normalization for Windows WebView
* feat(desktop): instance switcher and vendored app
* fix(desktop): merge artifacts and conflicts
* feat(desktop): instance switcher improvements
* fix: derive instance name from normalized name
* fix: pkg links, lints and UI edge cases
* feat(desktop): restore window state after relaunch
* fix(desktop): distinguish header for cloud/default
* fix: instance switcher in web mode
* fix: close dropdown on new instance modal
* fix: whitelist vendored app origin
* feat(desktop): platform parity - `collections`
* fix: history entries population desync
* fix(desktop): check for history storage status
* fix(desktop): safe parse `globalEnv`
* feat(desktop): platform parity - `environment`
* fix: use settings store for proxy url
* fix: lint, unused imports
* fix: proxy input enabled for other interceptors
* feat: reverse proxy for desktop app server
* fix: duplicate entries after connecting to sh
* fix: specify instance org qualified
* fix: remove debugging logs
* feat(desktop): enable `devtools` in release builds
* fix(desktop): prepend protocol validation edgecase
* feat(desktop): clear cache on removing instance
* fix: better response toast message
* fix: avoid reverse proxy for webapp server
* fix(desktop): ignore subpath in instance name
* feat: switcher ui/ux improvements
* feat: more switcher ui/ux improvements
* feat(server): specify bundle version at build time
* fix(desktop): missing migration as rebase artifact
* fix: minor switcher ui/ux improvement
* fix: rebase artifacts
* fix: consolidated toast on success
* fix: missing i18n strings
* fix(desktop): handle drag and drop fe side
* feat: confirmation modal on instance removal
* chore: minor UI update
* chore: minor UI changes
* fix: gql connection partial refactor
* fix: resolve merge artifacts
* chore: prod lint
* feat(desktop): better desktop app update ux
* fix: broken gql connection.ts
---------
Co-authored-by: nivedin <nivedinp@gmail.com>
Co-authored-by: Andrew Bastin <andrewbastin.k@gmail.com>
2025-02-27 18:31:25 +00:00
|
|
|
namespace: string,
|
|
|
|
|
key: string
|
2025-05-21 13:38:55 +00:00
|
|
|
): Promise<E.Either<StoreError, boolean>> => {
|
2025-11-25 12:39:18 +00:00
|
|
|
const storePath = await getStorePath()
|
|
|
|
|
return module().has(storePath, namespace, key)
|
2025-05-21 13:38:55 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
|
|
listNamespaces: async (): Promise<E.Either<StoreError, string[]>> => {
|
2025-11-25 12:39:18 +00:00
|
|
|
const storePath = await getStorePath()
|
|
|
|
|
return module().listNamespaces(storePath)
|
2025-05-21 13:38:55 +00:00
|
|
|
},
|
|
|
|
|
|
2025-06-13 04:25:05 +00:00
|
|
|
listKeys: async (
|
|
|
|
|
namespace: string
|
|
|
|
|
): Promise<E.Either<StoreError, string[]>> => {
|
2025-11-25 12:39:18 +00:00
|
|
|
const storePath = await getStorePath()
|
|
|
|
|
return module().listKeys(storePath, namespace)
|
2025-05-21 13:38:55 +00:00
|
|
|
},
|
|
|
|
|
|
2025-06-13 04:25:05 +00:00
|
|
|
watch: async (
|
|
|
|
|
namespace: string,
|
|
|
|
|
key: string
|
|
|
|
|
): Promise<StoreEventEmitter<StoreEvents>> => {
|
2025-11-25 12:39:18 +00:00
|
|
|
const storePath = await getStorePath()
|
|
|
|
|
return module().watch(storePath, namespace, key)
|
2025-05-21 13:38:55 +00:00
|
|
|
},
|
2026-03-26 12:30:51 +00:00
|
|
|
|
|
|
|
|
extend: async (namespace: string): Promise<ScopedStore> => {
|
|
|
|
|
const storePath = await getStorePath()
|
|
|
|
|
return extendStore(module(), storePath, namespace)
|
|
|
|
|
},
|
feat: platform independent core and the new desktop app (#4684)
* feat(desktop): init
* feat(desktop): external app download and setup
* feat(desktop): offload app load to plugin system
* perf(desktop): add rdbms facade and caching layer
* feat: parallelize signing, shared trust, lru cache
* feat: webapp encoder + compressor + hasher server
* feat(desktop): app autoupdate with hashed loader
* feat(kernel): init `hoppscotch-kernel`
* feat(kernel): `io`
* feat(kernel): `network`
* feat(kernel): `network` - native interceptor
* feat(kernel): `network` - interceptor - rest
* feat(kernel): `network` - interceptor - graphql
* feat(kernel): `network` - interceptor - capabilities
* feat(kernel): `network` - interceptor - `FormData`
* feat(kernel): `network` - interceptor - `oauth2.0`
* feat(kernel): `store`
* feat(desktop): dragging, traffic light, plugin workspaces
* feat(kernel|wip): `store`
* feat(kernel): `network` - capabilities - with active
* feat(kernel|wip): `network` - interceptor - `proxy`
* feat(kernel|wip): `network` - relay ext
* feat(kernel): `network` - interceptor - `proxy`
* feat(kernel): `network` - interceptor - decoding
* feat(kernel): `network` - interceptor - Kernel Err
* feat(kernel): `network` - flow transformation
* feat(kernel): `network` - request status
* fix(desktop): repositioning traffic lights on fullscreen exit
* feat(kernel): `network` - interceptor - `agent`
* feat(kernel): `store` - track updates
* feat(kernel): `network` - interceptor - extension
* feat(kernel): `network` - updates as overrides
* feat(interceptor): pre-process request encoding
* fix(ui): mismatched extension button size/position
* feat(kernel): `network` - interceptor - `browser`
* feat(native): common certs componsable
* fix(kernel): interceptor selection store and json parse
* feat(kernel): `network` - consistent multipart encoding
* feat(kernel): `network` - interceptor - `OAuth2.0`
* feat(kernel): `network` - interceptor - cookie support
* feat(agent): registration list, log-sink, relay
* feat(kernel): `network` - interceptor subtitles
* feat(kernel): `store` - persist network settings
* fix(agent): encrypted ser/de certificate requests
* feat(kernel): `kernelInterceptor` spotlight service
* fix(kernel): gql introspection edge-case schema
* ref: conditionals for migrated components
* feat(kernel): `localaccess` capability via relay
* feat(kernel): `network` - explicit types and lint
* feat(kernel): `store` - isolate host and platform
* feat(kernel): `store` - persistence service
* fix(infra): whitelisted origins, non-std engines
* feat(desktop): impl deep-link callbacks
* feat(kernel): `auth`
* feat(kernel): `io` - event listeners
* feat(kernel): platform migration
* fix: dep `vue` import on Win 11
Fixes `error TS2305: Module '"vue"' has no exported member
'VueConstructor'.` arising from `splitpane` dependency.
* fix(webapp-server): platform independent res paths
* feat(desktop): auth and emit via embedded server
* feat(platform): host, csp and bundle compatibility
- Bundle name format for using as host
- Windows UI handler HWND casting and version detection
- CSP headers type handling in URI protocol
- Protocol whitelist in env config
* feat(desktop|wip): login flow with `auth-tokens`
feat(desktop|wip): typesafe auth
* feat(backend): `auth` token flow, gql/websocket
feat(desktop): working auth for gql
feat: gql client with refresh token
* feat(backend): `auth` token flow, authorization bearer
* fix(gen): qualifier clash when invalidating cache
* feat(common): coordinated initialization service
* fix(desktop): appload persistence in data json
* feat(desktop|wip): desktop icons and updater
* fix: typos in readme docs
* fix: docker ignore copying on windows
* fix: update `.lock` file after rebase
* fix: `persistenceService` setup in tests
* fix: remove old console logs
* fix: console error on invalid schema
Show console error if default value is used when loading invalid data from
local storage
* fix(test): `PersistenceService` methods
* fix(test): `PersistenceService` rest tab state
* fix(test): `PersistenceService` gql tab state
* fix(test): `PersistenceService` global env
* fix(test): `PersistenceService` mqtt request
* fix(test): `PersistenceService` sse request
* fix(test): `PersistenceService` socketio request
* fix(test): `PersistenceService` websocket request
* fix(test): `PersistenceService` secret environment
* fix(test): `PersistenceService` selected env
* fix(test): `PersistenceService` collections
* fix(test): `PersistenceService` environments
* fix(test): `PersistenceService` history
* fix(test): `PersistenceService` settings
* fix(test): `PersistenceService` migrations
* fix(test): `InspectionService` request inspector
* feat(desktop): button to clear bundle/key cache
This is useful when there are partial updates to the web app or bundle gen server
which haven't been correctly propagated when the app bundle was downloaded.
If the user were to change the self host instance without updating the
desktop app; which is possible albeit rarely under very certain circumstances,
desktop app will refuse to load the bundle, this is because the desktop app
cannot differentiate between partial updates vs incorrect bundle being hosted
since both will fail verification.
The button lets the user decide what should be the appropriate action,
clear the bundle and trust the hosted app
or make sure the app is built and hosted correctly.
* fix(desktop): enforce one version per instance
This was part of a leftover scaffolding from development.
* fix(desktop): bundle url not stored after download
* fix(desktop): stalling progress on updates
* fix(backend): helper to parse cookie into kv-pairs
* feat(desktop): launch session on working endpoints
* fix(common): preserve `auth` structure and default
* fix: loading native networking with kernel mode
* fix: fallback for unhandled response error
* fix: `urlencoded` content request processing
* feat: `interceptor` - error mapping for `browser`
* fix: backwards compatibility for `digest` auth
* fix: platform check for `initializationService`
* fix: `interceptor` - analytics `strategy` resolution
* fix: `interceptor` - check for `cookies` component
* fix: enable digest auth support for `native`
* test: `interceptor` - kernel interceptor
* fix(relay): `grantType` casing for OAuth2.0
* test(wip): kernel transformers
* fix(relay): auth headers discarding others
* fix(desktop): http version deserialization
* fix(common): `grantType` extractor, auth processor
* fix: `PersistenceService` - parsing edge cases
* fix(infra): post rebase fixup
* fix(web): component structure and lint
* fix(desktop): cohesive splash opener, scroll url section
* fix: explicit auto auth and docs on url auth
* fix(relay): special chars failing proxy auth
* fix: finer cert control setting option
* fix: post-rebase fixup
* feat(appload): ability to vendor pre-built bytes
* fix: avoid copying over `target` dir in containers
* fix: auth key missing in capability set
* fix(desktop): relax `refresh_token` requirement
This is to support Firebase token
* fix(desktop): normalization for Windows WebView
* feat(desktop): instance switcher and vendored app
* fix(desktop): merge artifacts and conflicts
* feat(desktop): instance switcher improvements
* fix: derive instance name from normalized name
* fix: pkg links, lints and UI edge cases
* feat(desktop): restore window state after relaunch
* fix(desktop): distinguish header for cloud/default
* fix: instance switcher in web mode
* fix: close dropdown on new instance modal
* fix: whitelist vendored app origin
* feat(desktop): platform parity - `collections`
* fix: history entries population desync
* fix(desktop): check for history storage status
* fix(desktop): safe parse `globalEnv`
* feat(desktop): platform parity - `environment`
* fix: use settings store for proxy url
* fix: lint, unused imports
* fix: proxy input enabled for other interceptors
* feat: reverse proxy for desktop app server
* fix: duplicate entries after connecting to sh
* fix: specify instance org qualified
* fix: remove debugging logs
* feat(desktop): enable `devtools` in release builds
* fix(desktop): prepend protocol validation edgecase
* feat(desktop): clear cache on removing instance
* fix: better response toast message
* fix: avoid reverse proxy for webapp server
* fix(desktop): ignore subpath in instance name
* feat: switcher ui/ux improvements
* feat: more switcher ui/ux improvements
* feat(server): specify bundle version at build time
* fix(desktop): missing migration as rebase artifact
* fix: minor switcher ui/ux improvement
* fix: rebase artifacts
* fix: consolidated toast on success
* fix: missing i18n strings
* fix(desktop): handle drag and drop fe side
* feat: confirmation modal on instance removal
* chore: minor UI update
* chore: minor UI changes
* fix: gql connection partial refactor
* fix: resolve merge artifacts
* chore: prod lint
* feat(desktop): better desktop app update ux
* fix: broken gql connection.ts
---------
Co-authored-by: nivedin <nivedinp@gmail.com>
Co-authored-by: Andrew Bastin <andrewbastin.k@gmail.com>
2025-02-27 18:31:25 +00:00
|
|
|
} as const
|
2026-04-28 09:29:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Org-scoped store. Holds per-org state (auth tokens, collections,
|
|
|
|
|
// environments, settings that vary by organization). Default Store
|
|
|
|
|
// for almost every consumer in common.
|
|
|
|
|
export const Store = createScopedStore(HOST_SCOPED_STORE_PATH)
|
|
|
|
|
|
|
|
|
|
// Process-wide store shared across orgs. Holds machine-level state
|
|
|
|
|
// like desktop settings, the recent-instances list, and update state.
|
|
|
|
|
// Use this for anything that should persist regardless of which org
|
|
|
|
|
// the user is viewing, and for state that the desktop shell also
|
|
|
|
|
// reads or writes through its own kernel/store wrapper.
|
|
|
|
|
export const UnifiedStore = createScopedStore(UNIFIED_STORE_PATH)
|