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.

91 lines (90 loc) 3.61 kB
import 'reflect-metadata'; import { Bundle, Maybe } from '@worktif/utils'; import { PurewsContainer } from './purews.container'; import { BundleAws } from './bundle.types'; /** * The `BundlePurews` class is a specialized subclass of the `Bundle` class. * It integrates advanced dependency management and configuration capabilities, * tailored to work within the context of the Purews framework. This class * includes functionality for stack-based storage, dependency injection, and service access. */ export declare class BundlePurews extends Bundle { /** * Represents an instance of the PurewsContainer with a default scope of 'Singleton'. * * This container is used to manage dependencies and their lifecycle within an application. * The container allows for efficient dependency injection, where dependencies are managed * and instantiated based on the specified scope, ensuring proper resource management * and control over instantiations. * * The defaultScope property indicates the lifecycle scope of managed instances. In this case, the * value is set to 'Singleton', meaning that only one instance of each dependency will be created * and shared across the application. */ protected container: PurewsContainer; /** * Initializes a new instance of the Bundle class. * * During initialization, this constructor: * 1. Sets up the dependency injection container * 2. Loads environment configuration * 3. Initializes the CLI logger plugin * * @throws {Error} If required dependencies cannot be resolved * @constructor */ constructor(support?: boolean); /** * Provides access to CLI-related functionality, including logging capabilities. * * @returns {BundleAws} An object containing CLI utilities and logger instance * @example * ```typescript * const bundle = new Bundle(); * bundle.cli.logger.info('Application started'); * ``` */ get aws(): BundleAws; /** * Retrieves a value from the internal stack based on the provided key. * * @param {string} key - The key used to lookup the value in the stack. * @return {Maybe<any>} The value associated with the given key, or `null`/`undefined` if the key does not exist. */ protected fromStack(key: string): Maybe<any>; /** * Provides access to the environment configuration. * * @returns {EnvConfigPurews} The current environment configuration instance * @example * ```typescript * const bundle = new Bundle(); * const stage = bundle.env.bundle.stage; * ``` */ get env(): any; /** * Configures the dependency injection container with required bindings. * * This method: * 1. Binds environment configuration * 2. Sets up factory for CLI logger plugin * 3. Configures dependencies for logger plugin * * @private * @returns {void} * @throws {Error} If binding configuration fails */ protected injectContainer(): void; } /** * Represents an instance of a Bundle. * * A `Bundle` is typically used to contain and manage a collection of resources, objects, * or functionalities packaged together for a specific purpose within the application. * It can act as a modular container, providing encapsulation and organizational structure. * * This variable holds a new instance of the Bundle class, ready for customization * or further configuration as required by the business logic. */ export declare const bundlePurews: BundlePurews;