Constructors

Properties

httpClient: HttpClient
options?: {
    setScanner?: boolean;
    testmode?: boolean;
}
token?: null | string
default: typeof InternetArchive

Methods

  • Creates an Item in a Collection (Uploads a file and adds metadata).

    Parameters

    • item: {
          collection: string;
          identifier: string;
          mediatype:
              | "data"
              | "collection"
              | "audio"
              | "etree"
              | "image"
              | "movies"
              | "software"
              | "texts"
              | "web";
          metadata?: Record<string, unknown>;
          upload: FileUpload;
      }

      identifier, collection, mediatype, upload, metadata.

      • collection: string

        The collection that the item belongs to.

      • identifier: string

        The unique identifier for the item.

      • mediatype:
            | "data"
            | "collection"
            | "audio"
            | "etree"
            | "image"
            | "movies"
            | "software"
            | "texts"
            | "web"

        The item mediatype.

      • Optionalmetadata?: Record<string, unknown>

        The item metadata (optional).

      • upload: FileUpload

        The item upload.

    Returns Promise<CreateItemResponse>

    The item identifier, metadata, and upload filename.

  • Returns Items based on filters and options.

    Parameters

    • items: {
          filters: {
              collection?: string;
              creator?: string;
              subject?: string;
          };
          options?: {
              fields?: string;
              rows?: string;
          };
      }

      filters (collection, subject, creator) and options (fields, rows).

      • filters: {
            collection?: string;
            creator?: string;
            subject?: string;
        }

        Filter by collection, subject, creator.

        • Optionalcollection?: string
        • Optionalcreator?: string
        • Optionalsubject?: string
      • Optionaloptions?: {
            fields?: string;
            rows?: string;
        }

        Options to specify fields returned and amount of items.

        • Optionalfields?: string
        • Optionalrows?: string

    Returns Promise<GetItemsResponse>

    The responseHeader and response with items as docs.

  • Uploads a File to a parent Item.

    Parameters

    • upload: {
          file: FileUpload;
          identifier: string;
          mediatype:
              | "data"
              | "collection"
              | "audio"
              | "etree"
              | "image"
              | "movies"
              | "software"
              | "texts"
              | "web";
      }

      identifier, mediatype, file.

      • file: FileUpload

        The upload file.

      • identifier: string

        The unique identifier of the parent item.

      • mediatype:
            | "data"
            | "collection"
            | "audio"
            | "etree"
            | "image"
            | "movies"
            | "software"
            | "texts"
            | "web"

        The upload mediatype.

    Returns Promise<void>