Documentation
    Preparing search index...

    The stub class uses tempura template engine to process a stub template and generate a resource file.

    Finding the correct stub to use is outside of the scope of this class.

    Index

    Constructors

    Methods

    Constructors

    • Creates a new Stub instance

      Parameters

      • app: Application<any>

        The application instance

      • stubContents: string

        The raw contents of the stub template

      • stubPath: string

        The absolute path to the stub file

      Returns Stub

    Methods

    • Prepare stub to be written to the disk

      Parameters

      • stubData: Record<string, any>

        The data to use for stub preparation

      Returns Promise<
          {
              contents: string;
              destination: any;
              force: any;
              attributes: Record<string, any>;
          },
      >

      Promise that resolves to the prepared stub data

    • Generate resource for the stub. Writes file to the disk

      Parameters

      • stubData: Record<string, any>

        The data to use for stub generation

      Returns Promise<
          | {
              contents: string;
              destination: any;
              attributes: Record<string, any>;
              status: "created";
              skipReason: null;
          }
          | {
              contents: string;
              destination: any;
              attributes: Record<string, any>;
              status: "force_created";
              skipReason: null;
          }
          | {
              contents: string;
              destination: any;
              attributes: Record<string, any>;
              status: "skipped";
              skipReason: string;
          },
      >

      Promise that resolves to generation result with status