@@ -654,9 +654,26 @@ export class EnvironmentVariablesRepository implements Repository {
654654 }
655655}
656656
657+ export const RuntimeEnvironmentForEnvRepoPayload = {
658+ select : {
659+ id : true ,
660+ slug : true ,
661+ type : true ,
662+ projectId : true ,
663+ apiKey : true ,
664+ organizationId : true ,
665+ } ,
666+ } as const ;
667+
668+ export type RuntimeEnvironmentForEnvRepo = Prisma . RuntimeEnvironmentGetPayload <
669+ typeof RuntimeEnvironmentForEnvRepoPayload
670+ > ;
671+
657672export const environmentVariablesRepository = new EnvironmentVariablesRepository ( ) ;
658673
659- export async function resolveVariablesForEnvironment ( runtimeEnvironment : RuntimeEnvironment ) {
674+ export async function resolveVariablesForEnvironment (
675+ runtimeEnvironment : RuntimeEnvironmentForEnvRepo
676+ ) {
660677 const projectSecrets = await environmentVariablesRepository . getEnvironmentVariables (
661678 runtimeEnvironment . projectId ,
662679 runtimeEnvironment . id
@@ -672,7 +689,9 @@ export async function resolveVariablesForEnvironment(runtimeEnvironment: Runtime
672689 return [ ...overridableTriggerVariables , ...projectSecrets , ...builtInVariables ] ;
673690}
674691
675- async function resolveOverridableTriggerVariables ( runtimeEnvironment : RuntimeEnvironment ) {
692+ async function resolveOverridableTriggerVariables (
693+ runtimeEnvironment : RuntimeEnvironmentForEnvRepo
694+ ) {
676695 let result : Array < EnvironmentVariable > = [
677696 {
678697 key : "TRIGGER_REALTIME_STREAM_VERSION" ,
@@ -683,7 +702,7 @@ async function resolveOverridableTriggerVariables(runtimeEnvironment: RuntimeEnv
683702 return result ;
684703}
685704
686- async function resolveBuiltInDevVariables ( runtimeEnvironment : RuntimeEnvironment ) {
705+ async function resolveBuiltInDevVariables ( runtimeEnvironment : RuntimeEnvironmentForEnvRepo ) {
687706 let result : Array < EnvironmentVariable > = [
688707 {
689708 key : "OTEL_EXPORTER_OTLP_ENDPOINT" ,
@@ -745,7 +764,7 @@ async function resolveBuiltInDevVariables(runtimeEnvironment: RuntimeEnvironment
745764 return [ ...result , ...commonVariables ] ;
746765}
747766
748- async function resolveBuiltInProdVariables ( runtimeEnvironment : RuntimeEnvironment ) {
767+ async function resolveBuiltInProdVariables ( runtimeEnvironment : RuntimeEnvironmentForEnvRepo ) {
749768 let result : Array < EnvironmentVariable > = [
750769 {
751770 key : "TRIGGER_SECRET_KEY" ,
@@ -838,7 +857,7 @@ async function resolveBuiltInProdVariables(runtimeEnvironment: RuntimeEnvironmen
838857}
839858
840859async function resolveCommonBuiltInVariables (
841- runtimeEnvironment : RuntimeEnvironment
860+ runtimeEnvironment : RuntimeEnvironmentForEnvRepo
842861) : Promise < Array < EnvironmentVariable > > {
843862 return [ ] ;
844863}
0 commit comments