Documentation
    Preparing search index...

    Interface INestiaConfig

    Definition for the nestia.config.ts file.

    Jeongho Nam - https://github.com/samchon

    interface INestiaConfig {
        assert?: boolean;
        clone?: boolean;
        distribute?: string;
        e2e?: string;
        input: string | IInput | (() => Promise<INestApplication<any>>) | string[];
        json?: boolean;
        keyword?: boolean;
        output?: string;
        primitive?: boolean;
        propagate?: boolean;
        simulate?: boolean;
        swagger?: ISwaggerConfig;
    }
    Index

    Properties

    assert?: boolean

    Whether to assert parameter types or not.

    If you configure this property to be true, all of the function parameters of SDK library would be checked through typia.assert<T>() function.

    This option would make your SDK library compilation time a little bit slower, but would enahcne the type safety even in the runtime level.

    false
    
    clone?: boolean

    Whether to clone DTO structures or not.

    If being configured, all of DTOs used in the backend server would be cloned into the structures directory, and the SDK library would be refer to the cloned DTOs instead of the original.

    false
    
    distribute?: string

    Target directory that SDK distribution files would be placed in.

    If you configure this property and runs npx nestia sdk command, distribution environments for the SDK library would be generated.

    After the SDK library generation, move to the distribute directory, and runs npm publish command, then you can share SDK library with other client (frontend) developers.

    Recommend to use "packages/api" value.

    e2e?: string

    Target directory that e2e test functions would be placed in.

    If you configure this property and runs npx nestia e2e command, @nestia/sdk will analyze your NestJS backend server code, and generates e2e test functions for every API endpoints.

    If not configured, you can't run npx nestia e2e command.

    input: string | IInput | (() => Promise<INestApplication<any>>) | string[]

    Accessor of controller classes.

    You can specify target controller classes within two ways.

    • Asynchronous function returning INestApplication instance
    • Specify the path or directory of controller class files
    json?: boolean

    Whether to optimize JSON string conversion 10x faster or not.

    If you configure this property to be true, the SDK library would utilize the typia.assertStringify<T>() function to boost up JSON serialization speed and ensure type safety.

    This option would make your SDK library compilation time a little bit slower, but would enhance JSON serialization speed 10x faster. Also, it can ensure type safety even in the runtime level.

    false
    
    keyword?: boolean
    false
    
    output?: string

    Response directory that SDK would be placed in.

    If not configured, you can't build the SDK library.

    primitive?: boolean

    Whether to wrap DTO by primitive type.

    If you don't configure this property as false, all of DTOs in the SDK library would be automatically wrapped by Primitive type.

    For refenrece, if a DTO type be capsuled by the Primitive type, all of methods in the DTO type would be automatically erased. Also, if the DTO has a toJSON() method, the DTO type would be automatically converted to return type of the toJSON() method.

    true
    
    propagate?: boolean

    Whether to use propagation mode or not.

    If being configured, interaction functions of the SDK library would perform the propagation mode. The propagation mode means that never throwing exception even when status code is not 200 (or 201), but just returning the IPropagation typed instance, which can specify its body type through discriminated union determined by status code.

    false
    
    simulate?: boolean

    Allow simulation mode.

    If you configure this property to be true, the SDK library would be contain simulation mode. In the simulation mode, the SDK library would not communicate with the real backend server, but just returns random mock-up data with requestion data validation.

    For reference, random mock-up data would be generated by typia.random<T>() function.

    false
    
    swagger?: ISwaggerConfig

    Building swagger.json is also possible.

    If not specified, you can't build the swagger.json.