feat: missing files from last commit

This commit is contained in:
Daniel Maurer
2023-07-21 14:59:57 +02:00
committed by nivedin
parent 7d61e69b3d
commit 088f1d6b47
4 changed files with 46 additions and 38 deletions

View File

@@ -120,7 +120,7 @@ import IconTrash2 from "~icons/lucide/trash-2"
import IconDone from "~icons/lucide/check"
import IconPlus from "~icons/lucide/plus"
import IconTrash from "~icons/lucide/trash"
import IconLock from "~icons/lucide/lock"
import IconLock from "~icons/lucide/lock"
import { clone } from "lodash-es"
import { computed, ref, watch } from "vue"
import * as E from "fp-ts/Either"

View File

@@ -149,7 +149,7 @@ import IconTrash from "~icons/lucide/trash"
import IconTrash2 from "~icons/lucide/trash-2"
import IconDone from "~icons/lucide/check"
import IconPlus from "~icons/lucide/plus"
import IconLock from "~icons/lucide/lock"
import IconLock from "~icons/lucide/lock"
import { platform } from "~/platform"
type EnvironmentVariable = {

View File

@@ -87,28 +87,32 @@ export const execPreRequestScript = (
}
})
const envSetHandle = vm.newFunction("set", (keyHandle, valueHandle) => {
const key: unknown = vm.dump(keyHandle)
const value: unknown = vm.dump(valueHandle)
const envSetHandle = vm.newFunction(
"set",
(keyHandle, valueHandle, secretHandle) => {
const key: unknown = vm.dump(keyHandle)
const value: unknown = vm.dump(valueHandle)
const secret: boolean = vm.dump(secretHandle)
if (typeof key !== "string") {
return {
error: vm.newString("Expected key to be a string"),
}
}
if (typeof value !== "string") {
return {
error: vm.newString("Expected value to be a string"),
}
}
currentEnvs = setEnv(key, value, secret, currentEnvs)
if (typeof key !== "string") {
return {
error: vm.newString("Expected key to be a string"),
value: vm.undefined,
}
}
if (typeof value !== "string") {
return {
error: vm.newString("Expected value to be a string"),
}
}
currentEnvs = setEnv(key, value, currentEnvs)
return {
value: vm.undefined,
}
})
)
const envResolveHandle = vm.newFunction("resolve", (valueHandle) => {
const value: unknown = vm.dump(valueHandle)

View File

@@ -527,28 +527,32 @@ export const execTestScript = (
}
)
const envSetHandle = vm.newFunction("set", (keyHandle, valueHandle) => {
const key: unknown = vm.dump(keyHandle)
const value: unknown = vm.dump(valueHandle)
const envSetHandle = vm.newFunction(
"set",
(keyHandle, valueHandle, secretHandle) => {
const key: unknown = vm.dump(keyHandle)
const value: unknown = vm.dump(valueHandle)
const secret: boolean = vm.dump(secretHandle)
if (typeof key !== "string") {
return {
error: vm.newString("Expected key to be a string"),
}
}
if (typeof value !== "string") {
return {
error: vm.newString("Expected value to be a string"),
}
}
currentEnvs = setEnv(key, value, secret, currentEnvs)
if (typeof key !== "string") {
return {
error: vm.newString("Expected key to be a string"),
value: vm.undefined,
}
}
if (typeof value !== "string") {
return {
error: vm.newString("Expected value to be a string"),
}
}
currentEnvs = setEnv(key, value, currentEnvs)
return {
value: vm.undefined,
}
})
)
const envResolveHandle = vm.newFunction("resolve", (valueHandle) => {
const value: unknown = vm.dump(valueHandle)