MapColonies Authentication
    Preparing search index...

    This class handles all the database interactions required to creating a bundle.

    Index

    Constructors

    • Initializes the class for communication with the database. The dataSource should point to a database initialized with the model defined in the auth-core package.

      Parameters

      • pool: Pool

      Returns BundleDatabase

      ConnectionNotInitializedError If the dataSource is not initialized.

    Methods

    • Parameters

      • env: "np" | "stage" | "prod"

      Returns Promise<
          | {
              assets: { name: string; version: number }[]
              | null;
              connections: { name: string; version: number }[] | null;
              createdAt: Date;
              environment: "np" | "stage" | "prod";
              hash: string | null;
              id: number;
              keyVersion: number | null;
              metadata: Record<string, unknown> | null;
              opaVersion: string;
              revision: string;
          }
          | null,
      >

    • Retrieves all the latest assets, connections and key versions based on requested environment

      Parameters

      • env: "np" | "stage" | "prod"

        The environment for which to retrieve the versions

      Returns Promise<BundleContentVersions>

      An object describing all the latest versions

    • Saved the metadata of the bundle into the database

      Parameters

      • versions: BundleContentVersions

        The versions of the bundle content

      • hash: string

        The md5 hash of the created bundle tarball

      • revision: string

      Returns Promise<number>

      The ID of the created bundle