Support for additional S3 providers (#71)

* support for other s3 providers

* remove redundant route options

* use type safe env

* prettier
This commit is contained in:
Mert Demir
2024-02-01 07:00:19 +09:00
committed by GitHub
parent e6467b41fc
commit 08d75fd75c
5 changed files with 35 additions and 10 deletions

View File

@@ -17,12 +17,14 @@ const envSchema = z
S3_UPLOAD_SECRET: z.string().optional(),
S3_UPLOAD_BUCKET: z.string().optional(),
S3_UPLOAD_REGION: z.string().optional(),
S3_UPLOAD_ENDPOINT: z.string().optional(),
NEXT_PUBLIC_ENABLE_RECEIPT_EXTRACT: z.coerce.boolean().default(false),
OPENAI_API_KEY: z.string().optional(),
})
.superRefine((env, ctx) => {
if (
env.NEXT_PUBLIC_ENABLE_EXPENSE_DOCUMENTS &&
// S3_UPLOAD_ENDPOINT is fully optional as it will only be used for providers other than AWS
(!env.S3_UPLOAD_BUCKET ||
!env.S3_UPLOAD_KEY ||
!env.S3_UPLOAD_REGION ||