feat: add file storage service and update configurations

refactor: migrate to tsup for builds and update tsconfigs
fix: update error handling and validation in payment service
chore: update package scripts and dependencies
docs: update README and env examples
This commit is contained in:
Yuu Ottosoka
2025-07-12 16:01:57 +03:00
parent c0c04bbdba
commit f9ecac94f2
67 changed files with 3308 additions and 695 deletions

View File

@@ -1,11 +1,11 @@
import { parseEnv } from 'znv';
import { z } from 'zod';
import type { ConfigSchema, ConfigOptions, InferConfig } from './types';
import { parseEnv } from "znv";
import { z } from "zod";
import type { ConfigSchema, ConfigOptions, InferConfig } from "./types";
export const createConfig = <T extends ConfigSchema>(
options: ConfigOptions<T>,
): InferConfig<T> => {
const { schema, env = process.env, prefix = '' } = options;
const { schema, env = process.env, prefix = "" } = options;
// Add prefix to schema keys if provided
const prefixedSchema = prefix
@@ -14,7 +14,7 @@ export const createConfig = <T extends ConfigSchema>(
acc[`${prefix}${key}`] = zodSchema;
return acc;
},
{} as Record<string, z.ZodTypeAny>
{} as Record<string, z.ZodTypeAny>,
)
: schema;

View File

@@ -1,2 +1,2 @@
export * from './create-config';
export * from './types';
export * from "./create-config";
export * from "./types";

View File

@@ -1,4 +1,4 @@
import { z } from 'zod';
import { z } from "zod";
export type ConfigSchema = Record<string, z.ZodTypeAny>;