zerot
    Preparing search index...

    Variable ContractTemplatesConst

    ContractTemplates: {
        adminOnly: (operation: string) => ContractOptions;
        batchOperation: (itemContract: ContractOptions) => ContractOptions;
        publicAPI: (operation: string) => ContractOptions;
        userCRUD: (requiredRole?: string) => ContractOptions;
    } = ...

    Provides a collection of predefined contract templates for common use cases. These templates help quickly apply standard sets of conditions to methods.

    Type declaration

    • adminOnly: (operation: string) => ContractOptions

      Template for operations accessible only by administrators. Requires "admin" role authentication and applies rate limiting and audit logging.

    • batchOperation: (itemContract: ContractOptions) => ContractOptions

      Template for batch processing operations. Requires admin authentication and validates that the input is an array within a size limit. Applies audit logging.

    • publicAPI: (operation: string) => ContractOptions

      Template for public API endpoints that do not require authentication. Applies basic input validation, rate limiting, and audit logging.

    • userCRUD: (requiredRole?: string) => ContractOptions

      Template for basic CRUD operations on user resources. Requires authentication, input validation, ownership check, and applies rate limiting and audit logging.