Virtual Package Format
  • 14 Mar 2023
  • 1 Minute to read
  • Dark
    Light
  • PDF

Virtual Package Format

  • Dark
    Light
  • PDF

Article Summary

There's not much to the virtual package; it's just a JSON-based text file with a .vpack file extension.

The file is formatted just like a universal package manifest file (e.g. upack.json), and follows the same specification, except that there are two additional properties:

PropertyFormat
contentsRAn array of at least one item, containing any of the following:
metaContentssame as contents property

Specifications

Virtual Content Object

This object describes a remote file or folder within either the root of the content (package/) or package root (/) folder, depending on whether it's within the contents or metaContents property.

PropertyFormat
typeA string of either virtualDirectory or virtualFile that describes the content to be added. The default value is virtualDirectory, and is used only in the case of missing property. All other values (including null or empty) are invalid.
virtualPathA string of a path to a file or folder within either the root of the content (package/) or package root (/) folder, depending on whether the object is within the contents or metaContents property.

A missing property, or null, empty, or "/" string means the root within that path.

When used in metaContent, a value of upack.json is invalid, as the manifest can never be virtualized. A value that begins with package/ is also invalid for metaContent.
sourceOne of the following values:

Package Source Object

This object describes where either a virtualFile or virtualFolder (as specified by the parent object) can be found.

PropertyFormat
groupA string of the referenced package group. When not specified, the empty group is used.
nameRA string of the referenced package name.
versionRA string of the referenced package version.
hashA package hash string used to verify the package file
packagePathA string containing the path within the package file (i.e. under the / directory of the archive file) the content can be found. A missing property or null value will default to package/.

File Source Object

This object describes where a virtualFile can be found.

PropertyFormat
urlRA string of an absolute HTTP/HTTPS resource where file contents can be found
hashA hash string with the same format as a package hash string is used to verify the file

Examples

The contents property is required.

Minimal

{
 "name": "HDARS.Combined",
 "version": "1.3.9",
 "contents": [ "HDARS.Web:1.3.9", "HDARS.API:1.3.9"  ]
}

Path References

{
 "group": "initrode/vendors/abl",
 "name": "ABLast.AstDist",
 "version": "2.2.1",
 "contents": [
   {
    "type": "virtualDirectory",
    "virtualPath": "vendors/common/ast",
    "source": "initrode/vendors/abl/ABlast:2.2.1:ab60bf74fc8147ca41bd53bdb1defc3aae35bc91"
   },
   {
    "type": "virtualFile",
    "virtualPath": "common/logo/logo.png",
    "source": "http://proget/endpoints/customer-assets/content/ast-logo.png"
   }
  ]

Was this article helpful?