Compare commits
4 Commits
release/20
...
2023.12.5
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4bd54b12cd | ||
|
|
ed6e9b6954 | ||
|
|
dfdd44b4ed | ||
|
|
fc34871dae |
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "hoppscotch-backend",
|
"name": "hoppscotch-backend",
|
||||||
"version": "2023.12.4",
|
"version": "2023.12.5",
|
||||||
"description": "",
|
"description": "",
|
||||||
"author": "",
|
"author": "",
|
||||||
"private": true,
|
"private": true,
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@hoppscotch/common",
|
"name": "@hoppscotch/common",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "2023.12.4",
|
"version": "2023.12.5",
|
||||||
"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",
|
||||||
|
|||||||
@@ -112,7 +112,7 @@ const handleAccessTokenRequest = async () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const envs = getCombinedEnvVariables()
|
const envs = getCombinedEnvVariables()
|
||||||
const envVars = [...envs.selected.variables, ...envs.global]
|
const envVars = [...envs.selected, ...envs.global]
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const tokenReqParams = {
|
const tokenReqParams = {
|
||||||
|
|||||||
@@ -568,7 +568,18 @@ export function getLegacyGlobalEnvironment(): Environment | null {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function getGlobalVariables(): Environment["variables"] {
|
export function getGlobalVariables(): Environment["variables"] {
|
||||||
return environmentsStore.value.globals
|
return environmentsStore.value.globals.map(
|
||||||
|
(env: Environment["variables"][number]) => {
|
||||||
|
if (env.key && "value" in env && !("secret" in env)) {
|
||||||
|
return {
|
||||||
|
...(env as Environment["variables"][number]),
|
||||||
|
secret: false,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return env
|
||||||
|
}
|
||||||
|
) as Environment["variables"]
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getGlobalVariableID() {
|
export function getGlobalVariableID() {
|
||||||
|
|||||||
@@ -425,7 +425,10 @@ export class PersistenceService extends Service {
|
|||||||
|
|
||||||
if (globalIndex !== -1) {
|
if (globalIndex !== -1) {
|
||||||
const globalEnv = environmentsData[globalIndex]
|
const globalEnv = environmentsData[globalIndex]
|
||||||
globalEnv.variables.forEach((variable) => addGlobalEnvVariable(variable))
|
globalEnv.variables.forEach(
|
||||||
|
(variable: Environment["variables"][number]) =>
|
||||||
|
addGlobalEnvVariable(variable)
|
||||||
|
)
|
||||||
|
|
||||||
// Remove global from environments
|
// Remove global from environments
|
||||||
environmentsData.splice(globalIndex, 1)
|
environmentsData.splice(globalIndex, 1)
|
||||||
@@ -628,7 +631,7 @@ export class PersistenceService extends Service {
|
|||||||
|
|
||||||
private setupGlobalEnvsPersistence() {
|
private setupGlobalEnvsPersistence() {
|
||||||
const globalEnvKey = "globalEnv"
|
const globalEnvKey = "globalEnv"
|
||||||
let globalEnvData: Environment["variables"] = JSON.parse(
|
let globalEnvData: z.infer<typeof GLOBAL_ENV_SCHEMA> = JSON.parse(
|
||||||
window.localStorage.getItem(globalEnvKey) || "[]"
|
window.localStorage.getItem(globalEnvKey) || "[]"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -644,7 +647,7 @@ export class PersistenceService extends Service {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
setGlobalEnvVariables(globalEnvData)
|
setGlobalEnvVariables(globalEnvData as Environment["variables"])
|
||||||
|
|
||||||
globalEnv$.subscribe((vars) => {
|
globalEnv$.subscribe((vars) => {
|
||||||
window.localStorage.setItem(globalEnvKey, JSON.stringify(vars))
|
window.localStorage.setItem(globalEnvKey, JSON.stringify(vars))
|
||||||
|
|||||||
@@ -229,24 +229,24 @@ export const MQTT_REQUEST_SCHEMA = z.nullable(
|
|||||||
.strict()
|
.strict()
|
||||||
)
|
)
|
||||||
|
|
||||||
export const GLOBAL_ENV_SCHEMA = z.union([
|
const EnvironmentVariablesSchema = z.union([
|
||||||
z.array(z.never()),
|
z.object({
|
||||||
|
key: z.string(),
|
||||||
z.array(
|
value: z.string(),
|
||||||
z.union([
|
secret: z.literal(false).catch(false),
|
||||||
z.object({
|
}),
|
||||||
key: z.string(),
|
z.object({
|
||||||
secret: z.literal(true),
|
key: z.string(),
|
||||||
}),
|
secret: z.literal(true),
|
||||||
z.object({
|
}),
|
||||||
key: z.string(),
|
z.object({
|
||||||
value: z.string(),
|
key: z.string(),
|
||||||
secret: z.literal(false),
|
value: z.string(),
|
||||||
}),
|
}),
|
||||||
])
|
|
||||||
),
|
|
||||||
])
|
])
|
||||||
|
|
||||||
|
export const GLOBAL_ENV_SCHEMA = z.array(EnvironmentVariablesSchema)
|
||||||
|
|
||||||
const OperationTypeSchema = z.enum([
|
const OperationTypeSchema = z.enum([
|
||||||
"subscription",
|
"subscription",
|
||||||
"query",
|
"query",
|
||||||
@@ -364,22 +364,6 @@ const HoppTestDataSchema = z.lazy(() =>
|
|||||||
.strict()
|
.strict()
|
||||||
)
|
)
|
||||||
|
|
||||||
const EnvironmentVariablesSchema = z.union([
|
|
||||||
z.object({
|
|
||||||
key: z.string(),
|
|
||||||
value: z.string(),
|
|
||||||
secret: z.literal(false),
|
|
||||||
}),
|
|
||||||
z.object({
|
|
||||||
key: z.string(),
|
|
||||||
secret: z.literal(true),
|
|
||||||
}),
|
|
||||||
z.object({
|
|
||||||
key: z.string(),
|
|
||||||
value: z.string(),
|
|
||||||
}),
|
|
||||||
])
|
|
||||||
|
|
||||||
export const SECRET_ENVIRONMENT_VARIABLE_SCHEMA = z.union([
|
export const SECRET_ENVIRONMENT_VARIABLE_SCHEMA = z.union([
|
||||||
z.object({}).strict(),
|
z.object({}).strict(),
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ export const V1_SCHEMA = z.object({
|
|||||||
z.object({
|
z.object({
|
||||||
key: z.string(),
|
key: z.string(),
|
||||||
value: z.string(),
|
value: z.string(),
|
||||||
secret: z.literal(false),
|
secret: z.literal(false).catch(false),
|
||||||
}),
|
}),
|
||||||
])
|
])
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@hoppscotch/selfhost-desktop",
|
"name": "@hoppscotch/selfhost-desktop",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "2023.12.4",
|
"version": "2023.12.5",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev:vite": "vite",
|
"dev:vite": "vite",
|
||||||
|
|||||||
@@ -1260,7 +1260,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "hoppscotch-desktop"
|
name = "hoppscotch-desktop"
|
||||||
version = "23.12.4"
|
version = "23.12.5"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cocoa 0.25.0",
|
"cocoa 0.25.0",
|
||||||
"hex_color",
|
"hex_color",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "hoppscotch-desktop"
|
name = "hoppscotch-desktop"
|
||||||
version = "23.12.4"
|
version = "23.12.5"
|
||||||
description = "A Tauri App"
|
description = "A Tauri App"
|
||||||
authors = ["you"]
|
authors = ["you"]
|
||||||
license = ""
|
license = ""
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
},
|
},
|
||||||
"package": {
|
"package": {
|
||||||
"productName": "Hoppscotch",
|
"productName": "Hoppscotch",
|
||||||
"version": "23.12.4"
|
"version": "23.12.5"
|
||||||
},
|
},
|
||||||
"tauri": {
|
"tauri": {
|
||||||
"allowlist": {
|
"allowlist": {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@hoppscotch/selfhost-web",
|
"name": "@hoppscotch/selfhost-web",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "2023.12.4",
|
"version": "2023.12.5",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev:vite": "vite",
|
"dev:vite": "vite",
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "hoppscotch-sh-admin",
|
"name": "hoppscotch-sh-admin",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "2023.12.4",
|
"version": "2023.12.5",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "pnpm exec npm-run-all -p -l dev:*",
|
"dev": "pnpm exec npm-run-all -p -l dev:*",
|
||||||
|
|||||||
Reference in New Issue
Block a user