UNPKG

@worktif/purews

Version:

Work TIF TypeScript-based AWS infrastructure toolkit featuring DynamoDB integration, AppSync support, SES functionality, and GraphQL capabilities with comprehensive audit logging and AWS Signature V4 authentication.

92 lines (91 loc) 4.25 kB
import 'reflect-metadata'; import { z } from 'zod'; import { EnvConfigDefault, EnvConfigSchemaDefault, Maybe } from '@worktif/utils'; import { EnvConfigPurewsSchema } from '@config/env.config.purews.types'; /** * Schema definition for the environment configuration object using Zod. * This schema validates the structure of the `envConfigSchema` object, * ensuring that all expected environment configuration entries adhere to the specified structure and data types. * * The schema primarily includes configuration settings for AWS services: * - DynamoDB * - AppSync * - S3 Bucket * - Simple Email Service (SES) * * The configuration object is organized hierarchically: * - `aws.resources`: Contains nested configurations for each AWS resource. * - Subsections within `resources`, such as `dynamoDb`, `appSync`, `s3Bucket`, and `ses`, define specific settings for each resource. */ export declare const envConfigPurewsSchema: z.ZodObject<{ aws: z.ZodObject<{ resources: z.ZodObject<{ appSync: z.ZodObject<{ AWS_APP_SYNC_APP_URL: z.ZodOptional<z.ZodNullable<z.ZodString>>; AWS_APP_SYNC_API_KEY: z.ZodOptional<z.ZodNullable<z.ZodString>>; AWS_APP_SYNC_APP_ID: z.ZodOptional<z.ZodNullable<z.ZodString>>; AWS_APP_SYNC_APP_REAL_TIME_URL: z.ZodOptional<z.ZodNullable<z.ZodString>>; }, z.core.$strip>; ses: z.ZodObject<{ SES_NOTIFICATION_EMAIL: z.ZodOptional<z.ZodNullable<z.ZodString>>; }, z.core.$strip>; }, z.core.$strip>; }, z.core.$strip>; }, z.core.$strip>; /** * The EnvConfigLocal class extends the EnvConfig class, providing configurations * tailored for the local environment setup. This class retrieves and validates * environment variable values and integrates them into the application configuration. * * It includes definitions for DynamoDB settings, AWS configurations, and default environment settings. */ export declare class EnvConfigPurews extends EnvConfigDefault { /** * Represents the AWS configuration for a given environment. This configuration * includes various AWS services and their respective properties required for the * application's integration. * * Properties: * - `appSync`: Configuration details for the AWS AppSync service. * - `appId`: The unique identifier of the AppSync application. * - `apiKey`: The API key used for accessing the AppSync API. * - `appUrl`: The URL of the AppSync API. * - `appRealTimeUrl`: The real-time URL of the AppSync API. * * - `ses`: Configuration details for the AWS Simple Email Service (SES). * - `notificationEmail`: The email address used for sending notifications. * * - `s3`: Configuration details for the AWS Simple Storage Service (S3). * - `website`: The endpoint of the S3 bucket used for website hosting. */ aws: EnvConfigDefault['defaults']['aws'] & { appSync: { appId?: Maybe<string>; apiKey?: Maybe<string>; appUrl?: Maybe<string>; appRealTimeUrl?: Maybe<string>; }; ses: { notificationEmail?: Maybe<string>; }; }; /** * Represents the default environment configuration object. * This variable combines both the default environment configuration schema (`EnvConfigSchemaDefault`) * and the environment configuration for pure WebSocket schema (`EnvConfigPurewsSchema`). * It provides a baseline configuration that can be used throughout the application * to determine the default behavior and settings for the environment and WebSocket integration. * * The merged structure ensures compatibility and accessibility to all required * environment settings as well as WebSocket-specific configurations. */ defaultEnv: EnvConfigSchemaDefault & EnvConfigPurewsSchema; /** * Constructs a new instance of the class. * * Retrieves configuration values from the environment variables, validates them, and sets them as properties. * * @throws {ZodError} - If the validation of environment variables fails. */ constructor(); }