Compare commits

..

3 Commits

Author SHA1 Message Date
nivedin
5a453cf2ce fix: update schema validation type for restTab test 2024-02-13 17:39:00 +05:30
nivedin
d72fdd1118 chore: minor refactor 2024-02-13 17:39:00 +05:30
nivedin
1d7c0c0ba1 fix: team secret env tooltip update bug 2024-02-13 17:39:00 +05:30
13 changed files with 46 additions and 44 deletions

View File

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

View File

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

View File

@@ -112,7 +112,7 @@ const handleAccessTokenRequest = async () => {
}
const envs = getCombinedEnvVariables()
const envVars = [...envs.selected, ...envs.global]
const envVars = [...envs.selected.variables, ...envs.global]
try {
const tokenReqParams = {

View File

@@ -568,18 +568,7 @@ export function getLegacyGlobalEnvironment(): Environment | null {
}
export function getGlobalVariables(): Environment["variables"] {
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"]
return environmentsStore.value.globals
}
export function getGlobalVariableID() {

View File

@@ -425,10 +425,7 @@ export class PersistenceService extends Service {
if (globalIndex !== -1) {
const globalEnv = environmentsData[globalIndex]
globalEnv.variables.forEach(
(variable: Environment["variables"][number]) =>
addGlobalEnvVariable(variable)
)
globalEnv.variables.forEach((variable) => addGlobalEnvVariable(variable))
// Remove global from environments
environmentsData.splice(globalIndex, 1)
@@ -631,7 +628,7 @@ export class PersistenceService extends Service {
private setupGlobalEnvsPersistence() {
const globalEnvKey = "globalEnv"
let globalEnvData: z.infer<typeof GLOBAL_ENV_SCHEMA> = JSON.parse(
let globalEnvData: Environment["variables"] = JSON.parse(
window.localStorage.getItem(globalEnvKey) || "[]"
)
@@ -647,7 +644,7 @@ export class PersistenceService extends Service {
)
}
setGlobalEnvVariables(globalEnvData as Environment["variables"])
setGlobalEnvVariables(globalEnvData)
globalEnv$.subscribe((vars) => {
window.localStorage.setItem(globalEnvKey, JSON.stringify(vars))

View File

@@ -229,23 +229,23 @@ export const MQTT_REQUEST_SCHEMA = z.nullable(
.strict()
)
const EnvironmentVariablesSchema = z.union([
z.object({
key: z.string(),
value: z.string(),
secret: z.literal(false).catch(false),
}),
z.object({
key: z.string(),
secret: z.literal(true),
}),
z.object({
key: z.string(),
value: z.string(),
}),
])
export const GLOBAL_ENV_SCHEMA = z.union([
z.array(z.never()),
export const GLOBAL_ENV_SCHEMA = z.array(EnvironmentVariablesSchema)
z.array(
z.union([
z.object({
key: z.string(),
secret: z.literal(true),
}),
z.object({
key: z.string(),
value: z.string(),
secret: z.literal(false),
}),
])
),
])
const OperationTypeSchema = z.enum([
"subscription",
@@ -364,6 +364,22 @@ const HoppTestDataSchema = z.lazy(() =>
.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([
z.object({}).strict(),

View File

@@ -15,7 +15,7 @@ export const V1_SCHEMA = z.object({
z.object({
key: z.string(),
value: z.string(),
secret: z.literal(false).catch(false),
secret: z.literal(false),
}),
])
),

View File

@@ -1,7 +1,7 @@
{
"name": "@hoppscotch/selfhost-desktop",
"private": true,
"version": "2023.12.5",
"version": "2023.12.4",
"type": "module",
"scripts": {
"dev:vite": "vite",

View File

@@ -1260,7 +1260,7 @@ dependencies = [
[[package]]
name = "hoppscotch-desktop"
version = "23.12.5"
version = "23.12.4"
dependencies = [
"cocoa 0.25.0",
"hex_color",

View File

@@ -1,6 +1,6 @@
[package]
name = "hoppscotch-desktop"
version = "23.12.5"
version = "23.12.4"
description = "A Tauri App"
authors = ["you"]
license = ""

View File

@@ -8,7 +8,7 @@
},
"package": {
"productName": "Hoppscotch",
"version": "23.12.5"
"version": "23.12.4"
},
"tauri": {
"allowlist": {

View File

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

View File

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