chore: merge hoppscotch/main into hoppscotch/next

This commit is contained in:
jamesgeorge007 2025-05-08 16:44:12 +05:30
commit c28e4103a8
16 changed files with 81 additions and 33 deletions

View file

@ -52,7 +52,7 @@
"execa@0.10.0": "2.0.0", "execa@0.10.0": "2.0.0",
"@babel/runtime@<7.26.10": "7.26.10", "@babel/runtime@<7.26.10": "7.26.10",
"apiconnect-wsdl": "2.0.36", "apiconnect-wsdl": "2.0.36",
"@xmldom/xmldom": "0.9.8" "@xmldom/xmldom": "0.8.10"
}, },
"packageExtensions": { "packageExtensions": {
"@hoppscotch/httpsnippet": { "@hoppscotch/httpsnippet": {

View file

@ -1,6 +1,6 @@
{ {
"name": "hoppscotch-backend", "name": "hoppscotch-backend",
"version": "2025.4.1", "version": "2025.4.2",
"description": "", "description": "",
"author": "", "author": "",
"private": true, "private": true,

View file

@ -1,7 +1,7 @@
{ {
"name": "@hoppscotch/common", "name": "@hoppscotch/common",
"private": true, "private": true,
"version": "2025.4.1", "version": "2025.4.2",
"scripts": { "scripts": {
"dev": "pnpm exec npm-run-all -p -l dev:*", "dev": "pnpm exec npm-run-all -p -l dev:*",
"test": "vitest --run", "test": "vitest --run",

View file

@ -312,7 +312,14 @@ const samples = [
body: null, body: null,
}, },
params: [], params: [],
headers: [], headers: [
{
active: true,
key: "Authorization",
value: "Basic dXNlcjpwYXNz",
description: "",
},
],
preRequestScript: "", preRequestScript: "",
testScript: "", testScript: "",
requestVariables: [], requestVariables: [],
@ -335,7 +342,14 @@ const samples = [
body: null, body: null,
}, },
params: [], params: [],
headers: [], headers: [
{
active: true,
key: "Authorization",
value: "Basic 77898dXNlcjpwYXNz",
description: "",
},
],
preRequestScript: "", preRequestScript: "",
testScript: "", testScript: "",
requestVariables: [], requestVariables: [],
@ -360,7 +374,15 @@ const samples = [
body: null, body: null,
}, },
params: [], params: [],
headers: [], headers: [
{
active: true,
key: "Authorization",
value:
"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c",
description: "",
},
],
preRequestScript: "", preRequestScript: "",
testScript: "", testScript: "",
requestVariables: [], requestVariables: [],
@ -980,6 +1002,12 @@ data2: {"type":"test2","typeId":"123"}`,
}, },
params: [], params: [],
headers: [ headers: [
{
active: true,
key: "Authorization",
value: "Basic YXNkZmdoOjEyMzQ=",
description: "",
},
{ {
active: true, active: true,
key: "User-Agent", key: "User-Agent",

View file

@ -70,9 +70,6 @@ export const recordToHoppHeaders = (
description: "", description: "",
})), })),
A.filter( A.filter(
(header) => (header) => header.key !== "content-type" && header.key !== "Content-Type"
header.key !== "Authorization" &&
header.key !== "content-type" &&
header.key !== "Content-Type"
) )
) )

View file

@ -34,13 +34,29 @@ const processParams = (params: [string, string][]): [string, string][] => {
const isEncodingRequired = const isEncodingRequired =
encodeMode === "enable" || (encodeMode === "auto" && needsEncoding(value)) encodeMode === "enable" || (encodeMode === "auto" && needsEncoding(value))
const encodedKey = isEncodingRequired ? encodeParam(key) : key
const encodedValue = isEncodingRequired ? encodeParam(value) : value const encodedValue = isEncodingRequired ? encodeParam(value) : value
return [encodedKey, encodedValue] return [key, encodedValue]
}) })
} }
const buildQueryString = (params: [string, string][]): string =>
params.map(([k, v]) => `${encodeURIComponent(k)}=${v}`).join("&")
const combineWithExistingSearch = (urlObj: URL, queryString: string): URL => {
const existingSearch =
urlObj.search.length > 1 ? urlObj.search.substring(1) : ""
urlObj.search = pipe(
existingSearch,
O.fromPredicate((s) => s.length > 0),
O.map((s) => `${s}&${queryString}`),
O.getOrElse(() => queryString)
)
return urlObj
}
const updateUrl = ( const updateUrl = (
url: string, url: string,
params: [string, string][] params: [string, string][]
@ -50,10 +66,17 @@ const updateUrl = (
() => new URL(url), () => new URL(url),
(e) => new Error(`Invalid URL: ${e}`) (e) => new Error(`Invalid URL: ${e}`)
), ),
E.map((u) => { E.map((urlObj) => {
processParams(params).forEach(([k, v]) => u.searchParams.append(k, v)) const processedParams = processParams(params)
return decodeURIComponent(u.toString())
}) if (processedParams.length > 0) {
const queryString = buildQueryString(processedParams)
return combineWithExistingSearch(urlObj, queryString)
}
return urlObj
}),
E.map((u) => u.toString())
) )
export const preProcessRelayRequest = (req: RelayRequest): RelayRequest => export const preProcessRelayRequest = (req: RelayRequest): RelayRequest =>

View file

@ -48,7 +48,7 @@ export class InstanceSwitcherService extends Service<ConnectionState> {
const instance: VendoredInstance = { const instance: VendoredInstance = {
type: "vendored", type: "vendored",
displayName: "Hoppscotch", displayName: "Hoppscotch",
version: "25.4.1", version: "25.4.2",
} }
this.state$.next({ this.state$.next({
@ -121,7 +121,7 @@ export class InstanceSwitcherService extends Service<ConnectionState> {
const instance: VendoredInstance = { const instance: VendoredInstance = {
type: "vendored", type: "vendored",
displayName: "Hoppscotch", displayName: "Hoppscotch",
version: "25.4.1", version: "25.4.2",
} }
this.state$.next({ this.state$.next({

View file

@ -1,7 +1,7 @@
{ {
"name": "hoppscotch-desktop", "name": "hoppscotch-desktop",
"private": true, "private": true,
"version": "25.4.1", "version": "25.4.2",
"type": "module", "type": "module",
"scripts": { "scripts": {
"dev": "vite", "dev": "vite",

View file

@ -2033,7 +2033,7 @@ dependencies = [
[[package]] [[package]]
name = "hoppscotch-desktop" name = "hoppscotch-desktop"
version = "25.4.1" version = "25.4.2"
dependencies = [ dependencies = [
"axum", "axum",
"file-rotate", "file-rotate",

View file

@ -1,6 +1,6 @@
[package] [package]
name = "hoppscotch-desktop" name = "hoppscotch-desktop"
version = "25.4.1" version = "25.4.2"
description = "Desktop App for hoppscotch.io" description = "Desktop App for hoppscotch.io"
authors = ["CuriousCorrelation"] authors = ["CuriousCorrelation"]
edition = "2021" edition = "2021"

View file

@ -1,7 +1,7 @@
{ {
"$schema": "https://schema.tauri.app/config/2", "$schema": "https://schema.tauri.app/config/2",
"productName": "Hoppscotch", "productName": "Hoppscotch",
"version": "25.4.1", "version": "25.4.2",
"identifier": "io.hoppscotch.desktop", "identifier": "io.hoppscotch.desktop",
"build": { "build": {
"beforeDevCommand": "pnpm dev", "beforeDevCommand": "pnpm dev",

View file

@ -1,7 +1,7 @@
{ {
"name": "@hoppscotch/selfhost-web", "name": "@hoppscotch/selfhost-web",
"private": true, "private": true,
"version": "2025.4.1", "version": "2025.4.2",
"type": "module", "type": "module",
"scripts": { "scripts": {
"dev:vite": "vite", "dev:vite": "vite",

View file

@ -47,7 +47,7 @@ pub struct Bundle {
impl Bundle { impl Bundle {
pub fn new(bundle_version: Option<String>, content: Vec<u8>, signature: Signature, files: Vec<FileEntry>) -> Self { pub fn new(bundle_version: Option<String>, content: Vec<u8>, signature: Signature, files: Vec<FileEntry>) -> Self {
let metadata = BundleMetadata { let metadata = BundleMetadata {
version: "2025.4.1".to_string(), version: "2025.4.2".to_string(),
created_at: Utc::now(), created_at: Utc::now(),
signature, signature,
manifest: Manifest { files }, manifest: Manifest { files },

View file

@ -54,7 +54,7 @@ impl Default for ServerConfig {
Self { Self {
port: default_port(), port: default_port(),
max_bundle_size: default_max_bundle_size(), max_bundle_size: default_max_bundle_size(),
bundle_version: Some("2025.4.1".to_string()), bundle_version: Some("2025.4.2".to_string()),
csp_directives: None, csp_directives: None,
signing_key: None, signing_key: None,
verifying_key: None, verifying_key: None,
@ -75,7 +75,7 @@ impl ServerConfig {
Self { Self {
signing_key: Some(key_pair.signing_key), signing_key: Some(key_pair.signing_key),
verifying_key: Some(key_pair.verifying_key), verifying_key: Some(key_pair.verifying_key),
bundle_version: Some("2025.4.1".to_string()), bundle_version: Some("2025.4.2".to_string()),
frontend_path, frontend_path,
is_dev: cfg!(debug_assertions), is_dev: cfg!(debug_assertions),
..Default::default() ..Default::default()

View file

@ -1,7 +1,7 @@
{ {
"name": "hoppscotch-sh-admin", "name": "hoppscotch-sh-admin",
"private": true, "private": true,
"version": "2025.4.1", "version": "2025.4.2",
"type": "module", "type": "module",
"scripts": { "scripts": {
"dev": "pnpm exec npm-run-all -p -l dev:*", "dev": "pnpm exec npm-run-all -p -l dev:*",

View file

@ -22,7 +22,7 @@ overrides:
execa@0.10.0: 2.0.0 execa@0.10.0: 2.0.0
'@babel/runtime@<7.26.10': 7.26.10 '@babel/runtime@<7.26.10': 7.26.10
apiconnect-wsdl: 2.0.36 apiconnect-wsdl: 2.0.36
'@xmldom/xmldom': 0.9.8 '@xmldom/xmldom': 0.8.10
packageExtensionsChecksum: sha256-Qhsch/G1LLagBL1kRb8nf11C5HcyCWi8Px3h3uWxYUw= packageExtensionsChecksum: sha256-Qhsch/G1LLagBL1kRb8nf11C5HcyCWi8Px3h3uWxYUw=
@ -6205,9 +6205,9 @@ packages:
resolution: {integrity: sha512-4jXDeZ4IH4bylZ6wu14VEx0aDXXhrN4TC279v9rPmn08g4EYekcYf8wdcOOnS9STjDkb6x77/6xBUTqxGgjr8g==} resolution: {integrity: sha512-4jXDeZ4IH4bylZ6wu14VEx0aDXXhrN4TC279v9rPmn08g4EYekcYf8wdcOOnS9STjDkb6x77/6xBUTqxGgjr8g==}
engines: {node: '>=18.0.0'} engines: {node: '>=18.0.0'}
'@xmldom/xmldom@0.9.8': '@xmldom/xmldom@0.8.10':
resolution: {integrity: sha512-p96FSY54r+WJ50FIOsCOjyj/wavs8921hG5+kVMmZgKcvIKxMXHTrjNJvRgWa/zuX3B6t2lijLNFaOyuxUH+2A==} resolution: {integrity: sha512-2WALfTl4xo2SkGCYRt6rDTFfk9R1czmBvUQy12gK2KuRKIpWEhcbbzy8EZXtz/jkRqHX8bFEc6FC1HjX4TUWYw==}
engines: {node: '>=14.6'} engines: {node: '>=10.0.0'}
'@xtuc/ieee754@1.2.0': '@xtuc/ieee754@1.2.0':
resolution: {integrity: sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA==} resolution: {integrity: sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA==}
@ -19138,7 +19138,7 @@ snapshots:
fast-querystring: 1.1.2 fast-querystring: 1.1.2
tslib: 2.8.0 tslib: 2.8.0
'@xmldom/xmldom@0.9.8': {} '@xmldom/xmldom@0.8.10': {}
'@xtuc/ieee754@1.2.0': {} '@xtuc/ieee754@1.2.0': {}
@ -19299,7 +19299,7 @@ snapshots:
apiconnect-wsdl@2.0.36(openapi-types@12.1.3): apiconnect-wsdl@2.0.36(openapi-types@12.1.3):
dependencies: dependencies:
'@xmldom/xmldom': 0.9.8 '@xmldom/xmldom': 0.8.10
iconv-lite: 0.6.3 iconv-lite: 0.6.3
js-yaml: 4.1.0 js-yaml: 4.1.0
jszip: 3.10.1 jszip: 3.10.1