Member Junction
    Preparing search index...

    Adapter that lists and downloads MemberJunction releases from GitHub.

    All network calls use the unauthenticated GitHub REST API with a User-Agent: MJ-Installer header. The unauthenticated rate limit is 60 requests per hour per IP, which is sufficient for installer workflows.

    The provider first attempts to use formal GitHub Releases (which include uploaded ZIP assets and release notes). If no releases are found, it falls back to listing git tags and constructing zipball download URLs.

    Index

    Constructors

    Methods

    • Download a release ZIP archive to a local file path.

      Streams the download to disk to avoid holding the entire archive in memory. Follows HTTP redirects automatically (GitHub often 302-redirects to a CDN). Enforces a DOWNLOAD_TIMEOUT_MS timeout via AbortController.

      Parameters

      • downloadUrl: string

        URL to download from (zipball URL or asset URL).

      • destPath: string

        Absolute path where the ZIP file will be written.

      • OptionalonProgress: (percent: number) => void

        Optional callback invoked with download percentage (0–100) as data arrives when the server provides a Content-Length header. When Content-Length is missing (e.g., API zipball fallback), the callback is invoked with -1 on each chunk so the caller can display bytes-received instead of a percentage bar.

      Returns Promise<void>

      Error if the HTTP request fails, times out, or the response has no body.

      const provider = new GitHubReleaseProvider();
      const version = await provider.GetReleaseByTag('v5.1.0');
      await provider.DownloadRelease(version.DownloadUrl, '/tmp/mj.zip', (pct) => {
      if (pct >= 0) process.stdout.write(`\rDownloading... ${pct}%`);
      else process.stdout.write(`\rDownloading...`);
      });
    • Get a specific version by its git tag name.

      Tries to resolve as a formal GitHub Release first. If the release is not found (404), falls back to looking up the tag via the Commits API to get the commit date and constructs a zipball download URL.

      Parameters

      • tag: string

        The git tag to look up (e.g., "v5.1.0").

      Returns Promise<VersionInfo>

      A VersionInfo for the requested tag.

      Error if the tag does not exist in the repository.

      const provider = new GitHubReleaseProvider();
      const version = await provider.GetReleaseByTag('v5.1.0');
      console.log(version.DownloadUrl);
    • List available MemberJunction versions, sorted most recent first.

      Tries formal GitHub Releases first (up to 50). If no releases are found, falls back to listing git tags (up to 30) and fetching commit dates for the most recent MAX_TAG_DATE_LOOKUPS tags.

      Parameters

      • includePrerelease: boolean = false

        If true, includes releases marked as prerelease on GitHub. Defaults to false.

      Returns Promise<VersionInfo[]>

      Array of VersionInfo objects sorted by release date descending.

      Error if the GitHub API request fails.

      const provider = new GitHubReleaseProvider();
      const stable = await provider.ListReleases();
      const all = await provider.ListReleases(true); // includes prereleases