Helper class for creating and parsing static Data Packages

Constructors

  • Parameters

    • Optionaluid: string

      Unique ID of the Data Package

    • Optionalname: string

      Human Readable name of the DataPackage

    Returns DataPackage

Properties

contents: {
    _attributes: { ignore: boolean; zipEntry: string };
    Parameter:
        | { _attributes: { name: string; value: string } }[]
        | { _attributes: { name: string; value: string } };
}[]
destroyed: boolean

Indcates that the DataPackage has been destroyed and all local files removed

path: string

The local path to the Data Package working directory

settings: {
    name: string;
    onReceiveDelete?: boolean;
    onReceiveImport?: boolean;
    uid: string;
    [k: string]: undefined | string | boolean;
}
unknown: Record<string, unknown>
version: string

DataPackage schema version - 2 is most common

Methods

  • Add a CoT marker to the Package

    Parameters

    • cot: default
    • opts: { 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 } = ...

    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 } = ...

    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 } = ...

    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>

  • Parameters

    • path: string

    Returns Promise<Buffer>

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

    Parameters

    • entry: string

    Returns Promise<string>

  • Mission Sync archived are returned in DataPackage format Return true if the DataPackage is a MissionSync Archive

    Returns boolean

  • Return a string version of the Manifest document

    Returns string

  • 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>

  • Return a DataPackage version of a raw Data Package Zip

    Parameters

    • input: string | URL

      path to zipped DataPackage on disk

    • Optionalopts: { strict?: boolean }

      Parser Options

      • Optionalstrict?: boolean

        By default the DataPackage must contain a manifest file, turning strict mode off will generate a manifest based on the contents of the file

    Returns Promise<DataPackage>