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

    Class IaBaseItem<ItemMetaType, ItemFileMetaType>Abstract Beta

    The base class for an Internet Archive Item, providing common methods of IaItem and IaCollection

    Type Parameters

    Hierarchy (View Summary)

    Implements

    Index

    Constructors

    Properties

    exists: boolean = false
    session: IaSession

    Accessors

    • get created(): number
      Beta

      Date the item was created on

      Returns number

    • get d1(): string | undefined
      Beta

      The primary data node the item is stored on

      Returns string | undefined

    • get d2(): string | undefined
      Beta

      The secondary (backup) data node the item is stored on (unless stored on a solo node)

      Returns string | undefined

    • get dir(): string
      Beta

      The item's absolute pathname (on both data nodes)

      Returns string

    • get files(): {
          [K in string
          | number
          | symbol]: (
              {
                  format: IaFileFormat;
                  md5: string;
                  mtime: `${number}`;
                  name: string;
                  size: `${number}`;
                  source: IaFileSource;
                  [key: string]: IaMetadataValidFieldType
                  | IaMetadataValidFieldType[];
              } & Partial<
                  IaRawMetadata<
                      Omit<ItemFileMetaType, keyof IaFileBasicMetadata<string>>,
                  >,
              >
          )[K]
      }[]
      Beta

      File metadata for this item

      Returns {
          [K in string | number | symbol]: (
              {
                  format: IaFileFormat;
                  md5: string;
                  mtime: `${number}`;
                  name: string;
                  size: `${number}`;
                  source: IaFileSource;
                  [key: string]: IaMetadataValidFieldType
                  | IaMetadataValidFieldType[];
              } & Partial<
                  IaRawMetadata<
                      Omit<ItemFileMetaType, keyof IaFileBasicMetadata<string>>,
                  >,
              >
          )[K]
      }[]

    • get files_count(): number
      Beta

      Total number of files in the item

      Returns number

    • get has_redrow(): boolean
      Beta

      Indicates one or more tasks are red (halted due to error)

      Returns boolean

    • get identifier(): {
          [K in string
          | number
          | symbol]: (
              {
                  addeddate?: string;
                  collection: string
                  | string[];
                  identifier: string;
                  mediatype:
                      | "collection"
                      | "account"
                      | "audio"
                      | "data"
                      | "etree"
                      | "image"
                      | "movies"
                      | "software"
                      | "texts"
                      | "web";
                  publicdate?: string;
                  search_collection?: string;
              } & IaBaseMetadataType & Partial<IaRawMetadata<ItemMetaType>>
          )[K]
      }["identifier"]
      Beta

      Returns {
          [K in string | number | symbol]: (
              {
                  addeddate?: string;
                  collection: string
                  | string[];
                  identifier: string;
                  mediatype:
                      | "collection"
                      | "account"
                      | "audio"
                      | "data"
                      | "etree"
                      | "image"
                      | "movies"
                      | "software"
                      | "texts"
                      | "web";
                  publicdate?: string;
                  search_collection?: string;
              } & IaBaseMetadataType & Partial<IaRawMetadata<ItemMetaType>>
          )[K]
      }["identifier"]

    • get is_collection(): boolean
      Beta

      The item is a collection

      Returns boolean

    • get is_dark(): boolean
      Beta

      The item was darked and is unavailable

      Returns boolean

    • get item_last_updated(): number
      Beta

      The time when the item was last modified

      Returns number

    • get item_size(): number
      Beta

      Total size in bytes of all files in the item

      Returns number

    • get metadata(): {
          [K in string
          | number
          | symbol]: (
              {
                  addeddate?: string;
                  collection: string
                  | string[];
                  identifier: string;
                  mediatype:
                      | "collection"
                      | "account"
                      | "audio"
                      | "data"
                      | "etree"
                      | "image"
                      | "movies"
                      | "software"
                      | "texts"
                      | "web";
                  publicdate?: string;
                  search_collection?: string;
              } & IaBaseMetadataType & Partial<IaRawMetadata<ItemMetaType>>
          )[K]
      }
      Beta

      Item Metadata

      Returns {
          [K in string | number | symbol]: (
              {
                  addeddate?: string;
                  collection: string
                  | string[];
                  identifier: string;
                  mediatype:
                      | "collection"
                      | "account"
                      | "audio"
                      | "data"
                      | "etree"
                      | "image"
                      | "movies"
                      | "software"
                      | "texts"
                      | "web";
                  publicdate?: string;
                  search_collection?: string;
              } & IaBaseMetadataType & Partial<IaRawMetadata<ItemMetaType>>
          )[K]
      }

    • get nodownload(): boolean
      Beta

      The item is not ready for downloading

      Returns boolean

    • get pending_tasks(): boolean
      Beta

      Indicates one or more tasks are queued or running

      Returns boolean

    • get server(): string
      Beta

      The preferred server for reading the item's contents. Callers should use this node when constructing a URL

      Returns string

    • get servers_unavailable(): boolean
      Beta

      One or both servers are unavailable, that is, inaccessible for some reason (network problems, under service, etc.)

      Returns boolean

    • get solo(): boolean
      Beta

      The item is only stored on a single node (rare)

      Returns boolean

    • get workable_servers(): string[]
      Beta

      A list of data nodes currently available for accessing the item's contents

      Returns string[]

    Methods

    • Beta

      Create hash of this item based on the stringified metadata object.

      Returns string

      MD5 hash as string