Helper class for creating and parsing static Data Packages

Constructors

Properties

contents: {
    _attributes: {
        ignore: boolean;
        zipEntry: string;
    };
    Parameter: {
        _attributes: {
            name: string;
            value: string;
        };
    }[] | {
        _attributes: {
            name: string;
            value: string;
        };
    };
}[]
destroyed: boolean
path: string
settings: {
    name: string;
    onReceiveDelete?: boolean;
    onReceiveImport?: boolean;
    uid: string;
    [k: string]: boolean | string | undefined;
}
version: string

Methods

  • Add a CoT marker to the Package

    Parameters

    • cot: default
    • opts: {
          ignore: boolean;
      } = ...
      • ignore: boolean

    Returns Promise<void>

  • Add any file to a Package

    Parameters

    • file: string | Buffer | Readable

      Input ReadableStream of File at attach

    • opts: {
          attachment?: string;
          ignore?: boolean;
          name: string;
          uid?: string;
      }

      Options

      • Optionalattachment?: string

        Should the file be associated as an attachment to a CoT. If so this should contain the UID of the CoT

      • Optionalignore?: boolean

        Should the file be ignore, defaults to false

      • name: string

        Filename for the file

      • Optionaluid?: string

        Optional UID for the File, a UUID will be generated if not supplied

    Returns Promise<void>

  • Return attachments that are associated in the Manifest with a given CoT Note: this does not return files that are NOT associated with a CoT

    Parameters

    • opts: {
          respectIgnore: boolean;
      } = ...
      • respectIgnore: boolean

    Returns Promise<Map<string, {
        _attributes: {
            ignore: boolean;
            zipEntry: string;
        };
        Parameter: {
            _attributes: {
                name: string;
                value: string;
            };
        }[] | {
            _attributes: {
                name: string;
                value: string;
            };
        };
    }[]>>

  • Return CoT objects for all CoT type features in the Data Package

    CoTs have their attachment_list field populated if parseAttachments is set to true. While this field is populated automatically by some ATAK actions such as QuickPic other attachment actions do not automatically populate this field other than the link provided between a CoT and it's attachment in the MANIFEST file

    Parameters

    • opts: {
          parseAttachments: boolean;
          respectIgnore: boolean;
      } = ...
      • parseAttachments: boolean
      • respectIgnore: boolean

    Returns Promise<default[]>

  • Destory the underlying FS resources and prevent further mutation

    Returns Promise<void>

  • Return a list of files that are NOT attachments or CoT markers The Set returned has a list of file paths that can be passed to getFile(path)

    Parameters

    • opts: {
          respectIgnore: boolean;
      } = ...
      • respectIgnore: boolean

    Returns Promise<Set<string>>

  • Compile the DataPackage into a TAK compatible ZIP File Note this function can be called multiple times and does not affect the ability of the class to continue building a Package

    Returns Promise<string>

  • Get any file from a Package

    Parameters

    • path: string

    Returns Promise<Readable>

  • When DataPackages are uploaded to TAK Server they generally use an EUD calculated Hash

    Parameters

    • entry: string

    Returns Promise<string>

  • Return a string version of the Manifest document

    Returns string

  • The Package should be imported and then removed

    Returns void

  • The Package should be imported and the package retained

    Returns void

  • When DataPackages are uploaded to TAK Server they generally use an EUD calculated Hash

    Parameters

    • path: string

    Returns Promise<string>