internetarchive-ts - v0.1.0
    Preparing search index...

    Class IaCatalogBeta

    This class represents the Archive.org catalog. You can use this class to access and submit tasks from the catalog.

    This is a low-level interface, and in most cases the functions in the internetarchive-ts module and methods in IaSession should be used.

    It uses the archive.org Tasks API

    import { getSession, IaCatalog } from "internetarchive-ts";
    const s = getSession();
    const c = new Catalog(s);
    let tasks = c.getTasks('nasa');
    Index

    Constructors

    Properties

    session: IaSession

    An IaSession object

    url: string

    Methods

    • Beta

      Returns rate limit for specified task type

      Type Parameters

      • T extends
            | "book_op.php"
            | "bup.php"
            | "delete.php"
            | "derive.php"
            | "fixer.php"
            | "make_dark.php"
            | "make_undark.php"
            | "rename.php"

      Parameters

      • cmd:
            | "book_op.php"
            | "bup.php"
            | "delete.php"
            | "derive.php"
            | "fixer.php"
            | "make_dark.php"
            | "make_undark.php"
            | "rename.php" = 'derive.php'

        Task type

      Returns Promise<
          {
              cmd: T;
              tasks_blocked_by_offline: number;
              tasks_inflight: number;
              tasks_limit: number;
          },
      >

      Rate limit object

    • Beta

      Get the total counts of catalog tasks meeting all criteria, organized by run status (queued, running, error, and paused). Important: If the supplied identifier does not exist, this method does not fail!

      Parameters

      • identifier: string

        Item identifier. Both '*' (asterisk) and '%' (percentage sign) may be used as wildcard characters within criteria that accept them.

      • params: {
            args?: string;
            cmd?: string;
            cursor?: string;
            limit?: number;
            priority?: number;
            server?: string;
            submitter?: string;
            "submittime<"?: string;
            "submittime<="?: string;
            "submittime>"?: string;
            "submittime>="?: string;
            task_id?: number;
            wait_admin?: number;
        } = {}

        Query parameters

        • Optionalargs?: string

          Argument list (see below; may be wildcarded)

        • Optionalcmd?: string

          Task command (e.g., archive.php, modify_xml.php, etc.; may be wildcarded)

        • Optionalcursor?: string

          Cursor for pagination

        • Optionallimit?: number

          The current default is 50 tasks per request, but the caller may request more with the limit parameter The current maximum limit is 500 tasks. Values outside this range are clamped to the server maximum. If the caller wishes to receive all tasks in a single round-trip, they may set limit=0 in the request query.

          50
          
        • Optionalpriority?: number

          Generally from 10 to -10

        • Optionalserver?: string

          IA node task will or was executed upon (may be wildcarded)

        • Optionalsubmitter?: string

          User submitting task (may be wildcarded)

        • Optionalsubmittime<?: string

          Filter by submit time lower than supplied time. Time must be formatted as "YYYY-MM-DD"

        • Optionalsubmittime<=?: string

          Filter by submit time lower or equal to supplied time. Time must be formatted as "YYYY-MM-DD"

        • Optionalsubmittime>?: string

          Filter by submit time greater than supplied time. Time must be formatted as "YYYY-MM-DD"

        • Optionalsubmittime>=?: string

          Filter by submit time greater or equal to supplied time. Time must be formatted as "YYYY-MM-DD"

        • Optionaltask_id?: number

          Task identifier

        • Optionalwait_admin?: number

          Task run state (see below)

      Returns Promise<IaTaskSummary>

      the total counts of catalog tasks meeting all criteria

      IaApiError

    • Beta

      Get a list of all tasks meeting all criteria. The list is ordered by submission time.

      Parameters

      • params: {
            args?: string;
            catalog?: 0 | 1;
            cmd?: string;
            cursor?: string;
            history?: 0 | 1;
            identifier?: string;
            priority?: number;
            server?: string;
            submitter?: string;
            "submittime<"?: string;
            "submittime<="?: string;
            "submittime>"?: string;
            "submittime>="?: string;
            task_id?: number;
            wait_admin?: number;
        } = {}
        • Optionalargs?: string

          Argument list (see below; may be wildcarded)

        • Optionalcatalog?: 0 | 1

          A list of all active tasks (queued, running, error, or paused) matching the supplied criteria

        • Optionalcmd?: string

          Task command (e.g., archive.php, modify_xml.php, etc.; may be wildcarded)

        • Optionalcursor?: string

          Cursor for pagination

        • Optionalhistory?: 0 | 1

          A list of all completed tasks matching the supplied criteria

        • Optionalidentifier?: string

          The item identifier, if provided will return tasks for only this item filtered by other criteria provided in params.

        • Optionalpriority?: number

          Generally from 10 to -10

        • Optionalserver?: string

          IA node task will or was executed upon (may be wildcarded)

        • Optionalsubmitter?: string

          User submitting task (may be wildcarded)

        • Optionalsubmittime<?: string

          Filter by submit time lower than supplied time. Time must be formatted as "YYYY-MM-DD"

        • Optionalsubmittime<=?: string

          Filter by submit time lower or equal to supplied time. Time must be formatted as "YYYY-MM-DD"

        • Optionalsubmittime>?: string

          Filter by submit time greater than supplied time. Time must be formatted as "YYYY-MM-DD"

        • Optionalsubmittime>=?: string

          Filter by submit time greater or equal to supplied time. Time must be formatted as "YYYY-MM-DD"

        • Optionaltask_id?: number

          Task identifier

        • Optionalwait_admin?: number

          Task run state (see below)

      Returns Promise<IaCatalogTask[]>

      A list of all tasks meeting all criteria.

    • Beta

      A generator that can make arbitrary requests to the Tasks API. It handles paging (via cursor) automatically.

      Parameters

      • params: {
            args?: string;
            catalog?: 0 | 1;
            cmd?: string;
            cursor?: string;
            history?: 0 | 1;
            identifier?: string;
            limit?: number;
            priority?: number;
            server?: string;
            submitter?: string;
            "submittime<"?: string;
            "submittime<="?: string;
            "submittime>"?: string;
            "submittime>="?: string;
            summary?: 0 | 1;
            task_id?: number;
            wait_admin?: number;
        } = {}

        Query parameters, refer to Tasks API for available parameters.

        • Optionalargs?: string

          Argument list (see below; may be wildcarded)

        • Optionalcatalog?: 0 | 1

          A list of all active tasks (queued, running, error, or paused) matching the supplied criteria

        • Optionalcmd?: string

          Task command (e.g., archive.php, modify_xml.php, etc.; may be wildcarded)

        • Optionalcursor?: string

          Cursor for pagination

        • Optionalhistory?: 0 | 1

          A list of all completed tasks matching the supplied criteria

        • Optionalidentifier?: string

          The item identifier, if provided will return tasks for only this item filtered by other criteria provided in params.

        • Optionallimit?: number

          The current default is 50 tasks per request, but the caller may request more with the limit parameter The current maximum limit is 500 tasks. Values outside this range are clamped to the server maximum. If the caller wishes to receive all tasks in a single round-trip, they may set limit=0 in the request query.

          50
          
        • Optionalpriority?: number

          Generally from 10 to -10

        • Optionalserver?: string

          IA node task will or was executed upon (may be wildcarded)

        • Optionalsubmitter?: string

          User submitting task (may be wildcarded)

        • Optionalsubmittime<?: string

          Filter by submit time lower than supplied time. Time must be formatted as "YYYY-MM-DD"

        • Optionalsubmittime<=?: string

          Filter by submit time lower or equal to supplied time. Time must be formatted as "YYYY-MM-DD"

        • Optionalsubmittime>?: string

          Filter by submit time greater than supplied time. Time must be formatted as "YYYY-MM-DD"

        • Optionalsubmittime>=?: string

          Filter by submit time greater or equal to supplied time. Time must be formatted as "YYYY-MM-DD"

        • Optionalsummary?: 0 | 1

          Total counts of catalog tasks meeting all criteria organized by run status (queued, running, error, and paused). Historical totals are currently unavailable.

          1
          
        • Optionaltask_id?: number

          Task identifier

        • Optionalwait_admin?: number

          Task run state (see below)

      Returns AsyncGenerator<IaCatalogTask>

      An AsyncGenerator that yields IaCatalogTask objects

    • Beta

      Create iterator that iterates over all catalog tasks

      Parameters

      • params: {
            args?: string;
            catalog?: 0 | 1;
            cmd?: string;
            cursor?: string;
            history?: 0 | 1;
            identifier?: string;
            priority?: number;
            server?: string;
            submitter?: string;
            "submittime<"?: string;
            "submittime<="?: string;
            "submittime>"?: string;
            "submittime>="?: string;
            task_id?: number;
            wait_admin?: number;
        } = {}

        Params

        • Optionalargs?: string

          Argument list (see below; may be wildcarded)

        • Optionalcatalog?: 0 | 1

          A list of all active tasks (queued, running, error, or paused) matching the supplied criteria

        • Optionalcmd?: string

          Task command (e.g., archive.php, modify_xml.php, etc.; may be wildcarded)

        • Optionalcursor?: string

          Cursor for pagination

        • Optionalhistory?: 0 | 1

          A list of all completed tasks matching the supplied criteria

        • Optionalidentifier?: string

          The item identifier, if provided will return tasks for only this item filtered by other criteria provided in params.

        • Optionalpriority?: number

          Generally from 10 to -10

        • Optionalserver?: string

          IA node task will or was executed upon (may be wildcarded)

        • Optionalsubmitter?: string

          User submitting task (may be wildcarded)

        • Optionalsubmittime<?: string

          Filter by submit time lower than supplied time. Time must be formatted as "YYYY-MM-DD"

        • Optionalsubmittime<=?: string

          Filter by submit time lower or equal to supplied time. Time must be formatted as "YYYY-MM-DD"

        • Optionalsubmittime>?: string

          Filter by submit time greater than supplied time. Time must be formatted as "YYYY-MM-DD"

        • Optionalsubmittime>=?: string

          Filter by submit time greater or equal to supplied time. Time must be formatted as "YYYY-MM-DD"

        • Optionaltask_id?: number

          Task identifier

        • Optionalwait_admin?: number

          Task run state (see below)

      Returns AsyncGenerator<IaCatalogTask>

    • Beta

      Make a GET request to the Tasks API

      Type Parameters

      • T extends
            | IaApiGetTasksResult
            | {
                cmd: | "book_op.php"
                | "bup.php"
                | "delete.php"
                | "derive.php"
                | "fixer.php"
                | "make_dark.php"
                | "make_undark.php"
                | "rename.php";
                tasks_blocked_by_offline: number;
                tasks_inflight: number;
                tasks_limit: number;
            }

      Parameters

      • params: {
            args?: string;
            catalog?: 0 | 1;
            cmd?: string;
            cursor?: string;
            history?: 0 | 1;
            identifier?: string;
            limit?: number;
            priority?: number;
            server?: string;
            submitter?: string;
            "submittime<"?: string;
            "submittime<="?: string;
            "submittime>"?: string;
            "submittime>="?: string;
            summary?: 0 | 1;
            task_id?: number;
            wait_admin?: number;
        } = {}

        Query parameters

        • Optionalargs?: string

          Argument list (see below; may be wildcarded)

        • Optionalcatalog?: 0 | 1

          A list of all active tasks (queued, running, error, or paused) matching the supplied criteria

        • Optionalcmd?: string

          Task command (e.g., archive.php, modify_xml.php, etc.; may be wildcarded)

        • Optionalcursor?: string

          Cursor for pagination

        • Optionalhistory?: 0 | 1

          A list of all completed tasks matching the supplied criteria

        • Optionalidentifier?: string

          The item identifier, if provided will return tasks for only this item filtered by other criteria provided in params.

        • Optionallimit?: number

          The current default is 50 tasks per request, but the caller may request more with the limit parameter The current maximum limit is 500 tasks. Values outside this range are clamped to the server maximum. If the caller wishes to receive all tasks in a single round-trip, they may set limit=0 in the request query.

          50
          
        • Optionalpriority?: number

          Generally from 10 to -10

        • Optionalserver?: string

          IA node task will or was executed upon (may be wildcarded)

        • Optionalsubmitter?: string

          User submitting task (may be wildcarded)

        • Optionalsubmittime<?: string

          Filter by submit time lower than supplied time. Time must be formatted as "YYYY-MM-DD"

        • Optionalsubmittime<=?: string

          Filter by submit time lower or equal to supplied time. Time must be formatted as "YYYY-MM-DD"

        • Optionalsubmittime>?: string

          Filter by submit time greater than supplied time. Time must be formatted as "YYYY-MM-DD"

        • Optionalsubmittime>=?: string

          Filter by submit time greater or equal to supplied time. Time must be formatted as "YYYY-MM-DD"

        • Optionalsummary?: 0 | 1

          Total counts of catalog tasks meeting all criteria organized by run status (queued, running, error, and paused). Historical totals are currently unavailable.

          1
          
        • Optionaltask_id?: number

          Task identifier

        • Optionalwait_admin?: number

          Task run state (see below)

      Returns Promise<T>

      Response