diff --git a/src/control.d.ts b/src/control.d.ts deleted file mode 100644 index 3bdf378..0000000 --- a/src/control.d.ts +++ /dev/null @@ -1,221 +0,0 @@ -export type PriorityLevel = 'required' | 'important' | 'standard' | 'optional' | 'extra' -export type PackageType = 'deb' | 'udeb' - -// TODO: ^([^<(]+?)?[ \t]*(?:<([^>(]+?)>)?[ \t]*(?:\(([^)]+?)\)|$) -export interface MaintainerField { - name: string - email?: string - website?: string -} - -export interface IBinaryControl { - /** - * A string depicting the name of the package. - * - * Represents the `Package` key on the control contents. - * - * For the technical specification, see: - * https://www.debian.org/doc/debian-policy/ch-controlfields.html#package - */ - package: string - - /** - * An optional string depicting the name of a source package. - * - * Represents the `Source` key on the control contents. - * - * For the technical specification, see: - * https://www.debian.org/doc/debian-policy/ch-controlfields.html#source - */ - source?: string - - /** - * A string depicting the version of a package. - * - * Represents the `Version` key on the control contents. - * - * For the technical specification, see: - * https://www.debian.org/doc/debian-policy/ch-controlfields.html#version - */ - version: string - - /** - * An optional string depicting the section that a package belongs to. - * - * Represents the `Section` key on the control contents. - * - * For the technical specification, see: - * https://www.debian.org/doc/debian-policy/ch-controlfields.html#section - */ - section?: string - - /** - * An optional string depicting a package's priority. - * - * Represents the `Priority` key on the control contents. - * - * For the technical specification, see: - * https://www.debian.org/doc/debian-policy/ch-controlfields.html#priority - */ - priority?: PriorityLevel - - /** - * A string representing the package's target architecture. - * - * Represents the `Architecture` key on the control contents. - * - * For the technical specification, see: - * https://www.debian.org/doc/debian-policy/ch-controlfields.html#architecture - */ - architecture: string - - /** - * An optional boolean that marks a package as essential or not. - * - * Represents the `Essential` key on the control contents. - * - * For the technical specification, see: - * https://www.debian.org/doc/debian-policy/ch-controlfields.html#essential - */ - essential?: boolean - - /** - * An optional array that represents a package's dependencies. - * - * Represents the `Depends` key on the control contents. - * - * For the technical specification, see: - * https://www.debian.org/doc/debian-policy/ch-controlfields.html#package-interrelationship-fields-depends-pre-depends-recommends-suggests-breaks-conflicts-provides-replaces-enhances - */ - depends?: string[] - - /** - * An optional array that represents a package's predependencies. - * - * Represents the `Pre-Depends` key on the control contents. - * - * For the technical specification, see: - * https://www.debian.org/doc/debian-policy/ch-controlfields.html#package-interrelationship-fields-depends-pre-depends-recommends-suggests-breaks-conflicts-provides-replaces-enhances - */ - preDepends?: string[] - - /** - * An optional array that represents packages recommended with the target package. - * - * Represents the `Recommends` key on the control contents. - * - * For the technical specification, see: - * https://www.debian.org/doc/debian-policy/ch-controlfields.html#package-interrelationship-fields-depends-pre-depends-recommends-suggests-breaks-conflicts-provides-replaces-enhances - */ - recommends?: string[] - - /** - * An optional array that represents packages suggested with the target package. - * - * Represents the `Suggests` key on the control contents. - * - * For the technical specification, see: - * https://www.debian.org/doc/debian-policy/ch-controlfields.html#package-interrelationship-fields-depends-pre-depends-recommends-suggests-breaks-conflicts-provides-replaces-enhances - */ - suggests?: string[] - - /** - * An optional array that represents packages that the target package replaces. - * - * Represents the `Replaces` key on the control contents. - * - * For the technical specification, see: - * https://www.debian.org/doc/debian-policy/ch-controlfields.html#package-interrelationship-fields-depends-pre-depends-recommends-suggests-breaks-conflicts-provides-replaces-enhances - */ - replaces?: string[] - - /** - * An optional array that represents packages that the target package enhances. - * - * Represents the `Enhances` key on the control contents. - * - * For the technical specification, see: - * https://www.debian.org/doc/debian-policy/ch-controlfields.html#package-interrelationship-fields-depends-pre-depends-recommends-suggests-breaks-conflicts-provides-replaces-enhances - */ - enhances?: string[] - - /** - * An optional array that represents packages that the target package breaks. - * - * Represents the `Breaks` key on the control contents. - * - * For the technical specification, see: - * https://www.debian.org/doc/debian-policy/ch-controlfields.html#package-interrelationship-fields-depends-pre-depends-recommends-suggests-breaks-conflicts-provides-replaces-enhances - */ - breaks?: string[] - - /** - * An optional array that represents packages that conflict with the target package. - * - * Represents the `Conflicts` key on the control contents. - * - * For the technical specification, see: - * https://www.debian.org/doc/debian-policy/ch-controlfields.html#package-interrelationship-fields-depends-pre-depends-recommends-suggests-breaks-conflicts-provides-replaces-enhances - */ - conflicts?: string[] - - /** - * An optional number representing the size of the package when installed. - * - * Represents the `Installed-Size` key on the control contents. - * - * For the technical specification, see: - * https://www.debian.org/doc/debian-policy/ch-controlfields.html#installed-size - */ - installedSize?: number - - /** - * A string representing the package maintainer. - * - * Represents the `Maintainer` key on the control contents. - * - * For the technical specification, see: - * https://www.debian.org/doc/debian-policy/ch-controlfields.html#maintainer - */ - maintainer: string - - /** - * A string representing the package description. - * - * Represents the `Description` key on the control contents. - * - * For the technical specification, see: - * https://www.debian.org/doc/debian-policy/ch-controlfields.html#description - */ - description: string - - /** - * An optional string representing the package's homepage URL. - * - * Represents the `Homepage` key on the control contents. - * - * For the technical specification, see: - * https://www.debian.org/doc/debian-policy/ch-controlfields.html#homepage - */ - homepage?: string - - /** - * An optional string representing the system which built the package. - * - * Represents the `Built-Using` key on the control contents. - * - * For the technical specification, see: - * https://www.debian.org/doc/debian-policy/ch-relationships.html#s-built-using - */ - builtUsing?: string - - /** - * An optional string representing the package's type. - * - * Represents the `Package-Type` key on the control contents. - * - * For the technical specification, see: - * https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-package-type - */ - packageType?: PackageType -} diff --git a/src/control.ts b/src/control.ts index 4c30a4d..a597d19 100644 --- a/src/control.ts +++ b/src/control.ts @@ -1,7 +1,228 @@ -import type { IBinaryControl, PackageType, PriorityLevel } from './control.d' import { parseBoolean, parseKV } from '.' import { APTBase } from './base' +export type PriorityLevel = 'required' | 'important' | 'standard' | 'optional' | 'extra' +export type PackageType = 'deb' | 'udeb' + +// TODO: ^([^<(]+?)?[ \t]*(?:<([^>(]+?)>)?[ \t]*(?:\(([^)]+?)\)|$) +export interface MaintainerField { + name: string + email?: string + website?: string +} + +export interface IBinaryControl { + /** + * A string depicting the name of the package. + * + * Represents the `Package` key on the control contents. + * + * For the technical specification, see: + * https://www.debian.org/doc/debian-policy/ch-controlfields.html#package + */ + package: string + + /** + * An optional string depicting the name of a source package. + * + * Represents the `Source` key on the control contents. + * + * For the technical specification, see: + * https://www.debian.org/doc/debian-policy/ch-controlfields.html#source + */ + source?: string + + /** + * A string depicting the version of a package. + * + * Represents the `Version` key on the control contents. + * + * For the technical specification, see: + * https://www.debian.org/doc/debian-policy/ch-controlfields.html#version + */ + version: string + + /** + * An optional string depicting the section that a package belongs to. + * + * Represents the `Section` key on the control contents. + * + * For the technical specification, see: + * https://www.debian.org/doc/debian-policy/ch-controlfields.html#section + */ + section?: string + + /** + * An optional string depicting a package's priority. + * + * Represents the `Priority` key on the control contents. + * + * For the technical specification, see: + * https://www.debian.org/doc/debian-policy/ch-controlfields.html#priority + */ + priority?: PriorityLevel + + /** + * A string representing the package's target architecture. + * + * Represents the `Architecture` key on the control contents. + * + * For the technical specification, see: + * https://www.debian.org/doc/debian-policy/ch-controlfields.html#architecture + */ + architecture: string + + /** + * An optional boolean that marks a package as essential or not. + * + * Represents the `Essential` key on the control contents. + * + * For the technical specification, see: + * https://www.debian.org/doc/debian-policy/ch-controlfields.html#essential + */ + essential?: boolean + + /** + * An optional array that represents a package's dependencies. + * + * Represents the `Depends` key on the control contents. + * + * For the technical specification, see: + * https://www.debian.org/doc/debian-policy/ch-controlfields.html#package-interrelationship-fields-depends-pre-depends-recommends-suggests-breaks-conflicts-provides-replaces-enhances + */ + depends?: string[] + + /** + * An optional array that represents a package's predependencies. + * + * Represents the `Pre-Depends` key on the control contents. + * + * For the technical specification, see: + * https://www.debian.org/doc/debian-policy/ch-controlfields.html#package-interrelationship-fields-depends-pre-depends-recommends-suggests-breaks-conflicts-provides-replaces-enhances + */ + preDepends?: string[] + + /** + * An optional array that represents packages recommended with the target package. + * + * Represents the `Recommends` key on the control contents. + * + * For the technical specification, see: + * https://www.debian.org/doc/debian-policy/ch-controlfields.html#package-interrelationship-fields-depends-pre-depends-recommends-suggests-breaks-conflicts-provides-replaces-enhances + */ + recommends?: string[] + + /** + * An optional array that represents packages suggested with the target package. + * + * Represents the `Suggests` key on the control contents. + * + * For the technical specification, see: + * https://www.debian.org/doc/debian-policy/ch-controlfields.html#package-interrelationship-fields-depends-pre-depends-recommends-suggests-breaks-conflicts-provides-replaces-enhances + */ + suggests?: string[] + + /** + * An optional array that represents packages that the target package replaces. + * + * Represents the `Replaces` key on the control contents. + * + * For the technical specification, see: + * https://www.debian.org/doc/debian-policy/ch-controlfields.html#package-interrelationship-fields-depends-pre-depends-recommends-suggests-breaks-conflicts-provides-replaces-enhances + */ + replaces?: string[] + + /** + * An optional array that represents packages that the target package enhances. + * + * Represents the `Enhances` key on the control contents. + * + * For the technical specification, see: + * https://www.debian.org/doc/debian-policy/ch-controlfields.html#package-interrelationship-fields-depends-pre-depends-recommends-suggests-breaks-conflicts-provides-replaces-enhances + */ + enhances?: string[] + + /** + * An optional array that represents packages that the target package breaks. + * + * Represents the `Breaks` key on the control contents. + * + * For the technical specification, see: + * https://www.debian.org/doc/debian-policy/ch-controlfields.html#package-interrelationship-fields-depends-pre-depends-recommends-suggests-breaks-conflicts-provides-replaces-enhances + */ + breaks?: string[] + + /** + * An optional array that represents packages that conflict with the target package. + * + * Represents the `Conflicts` key on the control contents. + * + * For the technical specification, see: + * https://www.debian.org/doc/debian-policy/ch-controlfields.html#package-interrelationship-fields-depends-pre-depends-recommends-suggests-breaks-conflicts-provides-replaces-enhances + */ + conflicts?: string[] + + /** + * An optional number representing the size of the package when installed. + * + * Represents the `Installed-Size` key on the control contents. + * + * For the technical specification, see: + * https://www.debian.org/doc/debian-policy/ch-controlfields.html#installed-size + */ + installedSize?: number + + /** + * A string representing the package maintainer. + * + * Represents the `Maintainer` key on the control contents. + * + * For the technical specification, see: + * https://www.debian.org/doc/debian-policy/ch-controlfields.html#maintainer + */ + maintainer: string + + /** + * A string representing the package description. + * + * Represents the `Description` key on the control contents. + * + * For the technical specification, see: + * https://www.debian.org/doc/debian-policy/ch-controlfields.html#description + */ + description: string + + /** + * An optional string representing the package's homepage URL. + * + * Represents the `Homepage` key on the control contents. + * + * For the technical specification, see: + * https://www.debian.org/doc/debian-policy/ch-controlfields.html#homepage + */ + homepage?: string + + /** + * An optional string representing the system which built the package. + * + * Represents the `Built-Using` key on the control contents. + * + * For the technical specification, see: + * https://www.debian.org/doc/debian-policy/ch-relationships.html#s-built-using + */ + builtUsing?: string + + /** + * An optional string representing the package's type. + * + * Represents the `Package-Type` key on the control contents. + * + * For the technical specification, see: + * https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-package-type + */ + packageType?: PackageType +} + /** * Class representing a binary control file * diff --git a/src/packages.d.ts b/src/packages.d.ts deleted file mode 100644 index 2d3d199..0000000 --- a/src/packages.d.ts +++ /dev/null @@ -1,74 +0,0 @@ -import type { IBinaryControl } from './control.d' - -interface IPackage extends IBinaryControl { - /** - * A string depicting the file location of the package. - * - * Represents the `Filename` key on the control contents. - * - * For the technical specification, see: - * https://wiki.debian.org/DebianRepository/Format#Filename - */ - filename: string - - - /** - * A number depicting the size of the package. - * - * Represents the `Size` key on the control contents. - * - * For the technical specification, see: - * https://wiki.debian.org/DebianRepository/Format#Size.2C_MD5sum.2C_SHA1.2C_SHA256.2C_SHA512 - */ - size: number - - /** - * Optional list of MD5 file hashes. - * - * Represents the `MD5sum` key on the Release contents. - * - * For the technical specification, see: - * https://wiki.debian.org/DebianRepository/Format#Size.2C_MD5sum.2C_SHA1.2C_SHA256.2C_SHA512 - */ - md5?: string - - /** - * Optional list of SHA1 file hashes. - * - * Represents the `SHA1` key on the Release contents. - * - * For the technical specification, see: - * https://wiki.debian.org/DebianRepository/Format#Size.2C_MD5sum.2C_SHA1.2C_SHA256.2C_SHA512 - */ - sha1?: string - - /** - * Optional list of SHA256 file hashes. - * - * Represents the `SHA256` key on the Release contents. - * - * For the technical specification, see: - * https://wiki.debian.org/DebianRepository/Format#Size.2C_MD5sum.2C_SHA1.2C_SHA256.2C_SHA512 - */ - sha256?: string - - /** - * Optional list of SHA512 file hashes. - * - * Represents the `SHA512` key on the Release contents. - * - * For the technical specification, see: - * https://wiki.debian.org/DebianRepository/Format#Size.2C_MD5sum.2C_SHA1.2C_SHA256.2C_SHA512 - */ - sha512?: string - - /** - * An optional string containing the hash of the full english description. - * - * Represents the `Description-md5` key on the Release contents. - * - * For the technical specification, see: - * https://wiki.debian.org/DebianRepository/Format#Description-md5 - */ - descriptionMd5?: string -} diff --git a/src/packages.ts b/src/packages.ts index 7fda00e..f24475b 100644 --- a/src/packages.ts +++ b/src/packages.ts @@ -1,5 +1,77 @@ -import { BinaryControl } from '.' -import type { IPackage } from './packages.d' +import { BinaryControl, IBinaryControl } from '.' + +interface IPackage extends IBinaryControl { + /** + * A string depicting the file location of the package. + * + * Represents the `Filename` key on the control contents. + * + * For the technical specification, see: + * https://wiki.debian.org/DebianRepository/Format#Filename + */ + filename: string + + + /** + * A number depicting the size of the package. + * + * Represents the `Size` key on the control contents. + * + * For the technical specification, see: + * https://wiki.debian.org/DebianRepository/Format#Size.2C_MD5sum.2C_SHA1.2C_SHA256.2C_SHA512 + */ + size: number + + /** + * Optional list of MD5 file hashes. + * + * Represents the `MD5sum` key on the Release contents. + * + * For the technical specification, see: + * https://wiki.debian.org/DebianRepository/Format#Size.2C_MD5sum.2C_SHA1.2C_SHA256.2C_SHA512 + */ + md5?: string + + /** + * Optional list of SHA1 file hashes. + * + * Represents the `SHA1` key on the Release contents. + * + * For the technical specification, see: + * https://wiki.debian.org/DebianRepository/Format#Size.2C_MD5sum.2C_SHA1.2C_SHA256.2C_SHA512 + */ + sha1?: string + + /** + * Optional list of SHA256 file hashes. + * + * Represents the `SHA256` key on the Release contents. + * + * For the technical specification, see: + * https://wiki.debian.org/DebianRepository/Format#Size.2C_MD5sum.2C_SHA1.2C_SHA256.2C_SHA512 + */ + sha256?: string + + /** + * Optional list of SHA512 file hashes. + * + * Represents the `SHA512` key on the Release contents. + * + * For the technical specification, see: + * https://wiki.debian.org/DebianRepository/Format#Size.2C_MD5sum.2C_SHA1.2C_SHA256.2C_SHA512 + */ + sha512?: string + + /** + * An optional string containing the hash of the full english description. + * + * Represents the `Description-md5` key on the Release contents. + * + * For the technical specification, see: + * https://wiki.debian.org/DebianRepository/Format#Description-md5 + */ + descriptionMd5?: string +} /** * Class representing a single package in a packages file diff --git a/src/release.d.ts b/src/release.d.ts deleted file mode 100644 index d4ed1e5..0000000 --- a/src/release.d.ts +++ /dev/null @@ -1,219 +0,0 @@ -export type ReleaseHash = { - /** - * Name of the file that has been hashed - */ - filename: string - - /** - * Hash-sum value representing the hashing algorithm - */ - hash: string - - /** - * File-size value - */ - size: number -} - -export interface IRelease { - /** - * Parsed array of strings depicting the supported architectures. - * - * Represents the `Architectures` key on the Release contents. - * - * For the technical specification, see: - * https://wiki.debian.org/DebianRepository/Format#Architectures - */ - architectures: string[] - - /** - * Optional boolean value depicting the support for the `all` value in `Architectures`. - * - * Represents the `No-Support-For-Architecture-All` key on Release contents. - * - * For the technical specification, see: - * https://wiki.debian.org/DebianRepository/Format#No-Support-for-Architecture-all - */ - noSupportForArchitectureAll?: boolean - - /** - * Optional string depicting a possible multi-line description set by the repository. - * - * Represents the `Description` key on Release contents. - * - * For the technical specification, see: - * https://wiki.debian.org/DebianRepository/Format - */ - description?: string - - /** - * Optional string depicting a single line of free-form text set by the repository. - * - * Represents the `Origin` key on Release contents. - * - * For the technical specification, see: - * https://wiki.debian.org/DebianRepository/Format#Origin - */ - origin?: string - - /** - * Optional string depicting a single line of free-form text set by the repository. - * - * Represents the `Label` key on Release contents. - * - * For the technical specification, see: - * https://wiki.debian.org/DebianRepository/Format#Label - */ - label?: string - - /** - * Required string value that desrcibes the suite on distribution repositories. - * - * Represents the `Suite` key on Release contents. - * - * For the technical specification, see: - * https://wiki.debian.org/DebianRepository/Format#Suite - */ - suite: string | undefined - - /** - * Codename identifier specified in the repository release. - * - * Represents the `Codename` key on Release contents. - * - * For the technical specification, see: - * https://wiki.debian.org/DebianRepository/Format#Codename - */ - codename: string | undefined - - /** - * Version string set by the repository. - * - * Represents the `Version` key on Release contents. - * - * For the technical specification, see: - * https://wiki.debian.org/DebianRepository/Format#Version - */ - version?: string - - /** - * Parsed date string from the repository. - * - * Represents the `Date` key on Release contents. - * - * For the technical specification, see: - * https://wiki.debian.org/DebianRepository/Format#Date.2C_Valid-Until - */ - date?: Date - - /** - * Parsed date till valid string from the repository. - * - * Represents the `Valid-Until` key on Release contents. - * - * For the technical specification, see: - * https://wiki.debian.org/DebianRepository/Format#Date.2C_Valid-Until - */ - validUntil?: Date - - /** - * Parsed array of strings depicting the available components. - * - * Represents the `Components` key on the Release contents. - * - * For the technical specification, see: - * https://wiki.debian.org/DebianRepository/Format#Components - */ - components: string[] - - /** - * Optional list of MD5 file hashes. - * - * Represents the `MD5Sum` key on the Release contents. - * - * For the technical specification, see: - * https://wiki.debian.org/DebianRepository/Format#MD5Sum.2C_SHA1.2C_SHA256 - */ - md5?: ReleaseHash[] - - /** - * Optional list of SHA1 file hashes. - * - * Represents the `SHA1` key on the Release contents. - * - * For the technical specification, see: - * https://wiki.debian.org/DebianRepository/Format#MD5Sum.2C_SHA1.2C_SHA256 - */ - sha1?: ReleaseHash[] - - /** - * Optional list of SHA256 file hashes. - * - * Represents the `SHA256` key on the Release contents. - * - * For the technical specification, see: - * https://wiki.debian.org/DebianRepository/Format#MD5Sum.2C_SHA1.2C_SHA256 - */ - sha256?: ReleaseHash[] - - /** - * Optional list of SHA512 file hashes. - * - * Represents the `SHA512` key on the Release contents. - * - * For the technical specification, see: - * https://wiki.debian.org/DebianRepository/Format#MD5Sum.2C_SHA1.2C_SHA256 - */ - sha512?: ReleaseHash[] - - - /** - * Optional boolean value that tells if the client should automatically upgrade. - * - * Represents the `NotAutomatic` key on the Release contents. - * - * For the technical specification, see: - * https://wiki.debian.org/DebianRepository/Format#NotAutomatic_and_ButAutomaticUpgrades - */ - notAutomatic?: boolean - - /** - * Optional boolean value that pins upgrades on newer package versions. - * - * Represents the `ButAutomaticUpgrades` key on the Release contents. - * - * For the technical specification, see: - * https://wiki.debian.org/DebianRepository/Format#NotAutomatic_and_ButAutomaticUpgrades - */ - butAutomaticUpgrades?: boolean - - /** - * An optional boolean value that indicates the server supports the 'by-hash' locations. - * - * Represents the `Acquire-By-Hash` key on the Release contents. - * - * For the technical specification, see: - * https://wiki.debian.org/DebianRepository/Format#Acquire-By-Hash - */ - acquireByHash?: boolean - - /** - * Optional field containing a list of OpenGPG fingerprints that have signed the Release. - * - * Represents the `Signed-By` key on the Release contents. - * - * For the technical specification, see: - * https://wiki.debian.org/DebianRepository/Format#Signed-By - */ - signedBy?: string[] - - /** - * Optional boolean value that indicates if package downloads require authorization. - * - * Represents the `Packages-Require-Authorization` key on the Release contents. - * - * For the technical specification, see: - * https://wiki.debian.org/DebianRepository/Format#Packages-Require-Authorization - */ - packagesRequireAuthorization?: boolean -} diff --git a/src/release.ts b/src/release.ts index 6edf774..ede18e8 100644 --- a/src/release.ts +++ b/src/release.ts @@ -1,6 +1,225 @@ import { parseKV, parseBoolean } from '.' import { APTBase } from './base' -import type { IRelease, ReleaseHash } from './release.d' + +export type ReleaseHash = { + /** + * Name of the file that has been hashed + */ + filename: string + + /** + * Hash-sum value representing the hashing algorithm + */ + hash: string + + /** + * File-size value + */ + size: number +} + +export interface IRelease { + /** + * Parsed array of strings depicting the supported architectures. + * + * Represents the `Architectures` key on the Release contents. + * + * For the technical specification, see: + * https://wiki.debian.org/DebianRepository/Format#Architectures + */ + architectures: string[] + + /** + * Optional boolean value depicting the support for the `all` value in `Architectures`. + * + * Represents the `No-Support-For-Architecture-All` key on Release contents. + * + * For the technical specification, see: + * https://wiki.debian.org/DebianRepository/Format#No-Support-for-Architecture-all + */ + noSupportForArchitectureAll?: boolean + + /** + * Optional string depicting a possible multi-line description set by the repository. + * + * Represents the `Description` key on Release contents. + * + * For the technical specification, see: + * https://wiki.debian.org/DebianRepository/Format + */ + description?: string + + /** + * Optional string depicting a single line of free-form text set by the repository. + * + * Represents the `Origin` key on Release contents. + * + * For the technical specification, see: + * https://wiki.debian.org/DebianRepository/Format#Origin + */ + origin?: string + + /** + * Optional string depicting a single line of free-form text set by the repository. + * + * Represents the `Label` key on Release contents. + * + * For the technical specification, see: + * https://wiki.debian.org/DebianRepository/Format#Label + */ + label?: string + + /** + * Required string value that desrcibes the suite on distribution repositories. + * + * Represents the `Suite` key on Release contents. + * + * For the technical specification, see: + * https://wiki.debian.org/DebianRepository/Format#Suite + */ + suite: string | undefined + + /** + * Codename identifier specified in the repository release. + * + * Represents the `Codename` key on Release contents. + * + * For the technical specification, see: + * https://wiki.debian.org/DebianRepository/Format#Codename + */ + codename: string | undefined + + /** + * Version string set by the repository. + * + * Represents the `Version` key on Release contents. + * + * For the technical specification, see: + * https://wiki.debian.org/DebianRepository/Format#Version + */ + version?: string + + /** + * Parsed date string from the repository. + * + * Represents the `Date` key on Release contents. + * + * For the technical specification, see: + * https://wiki.debian.org/DebianRepository/Format#Date.2C_Valid-Until + */ + date?: Date + + /** + * Parsed date till valid string from the repository. + * + * Represents the `Valid-Until` key on Release contents. + * + * For the technical specification, see: + * https://wiki.debian.org/DebianRepository/Format#Date.2C_Valid-Until + */ + validUntil?: Date + + /** + * Parsed array of strings depicting the available components. + * + * Represents the `Components` key on the Release contents. + * + * For the technical specification, see: + * https://wiki.debian.org/DebianRepository/Format#Components + */ + components: string[] + + /** + * Optional list of MD5 file hashes. + * + * Represents the `MD5Sum` key on the Release contents. + * + * For the technical specification, see: + * https://wiki.debian.org/DebianRepository/Format#MD5Sum.2C_SHA1.2C_SHA256 + */ + md5?: ReleaseHash[] + + /** + * Optional list of SHA1 file hashes. + * + * Represents the `SHA1` key on the Release contents. + * + * For the technical specification, see: + * https://wiki.debian.org/DebianRepository/Format#MD5Sum.2C_SHA1.2C_SHA256 + */ + sha1?: ReleaseHash[] + + /** + * Optional list of SHA256 file hashes. + * + * Represents the `SHA256` key on the Release contents. + * + * For the technical specification, see: + * https://wiki.debian.org/DebianRepository/Format#MD5Sum.2C_SHA1.2C_SHA256 + */ + sha256?: ReleaseHash[] + + /** + * Optional list of SHA512 file hashes. + * + * Represents the `SHA512` key on the Release contents. + * + * For the technical specification, see: + * https://wiki.debian.org/DebianRepository/Format#MD5Sum.2C_SHA1.2C_SHA256 + */ + sha512?: ReleaseHash[] + + + /** + * Optional boolean value that tells if the client should automatically upgrade. + * + * Represents the `NotAutomatic` key on the Release contents. + * + * For the technical specification, see: + * https://wiki.debian.org/DebianRepository/Format#NotAutomatic_and_ButAutomaticUpgrades + */ + notAutomatic?: boolean + + /** + * Optional boolean value that pins upgrades on newer package versions. + * + * Represents the `ButAutomaticUpgrades` key on the Release contents. + * + * For the technical specification, see: + * https://wiki.debian.org/DebianRepository/Format#NotAutomatic_and_ButAutomaticUpgrades + */ + butAutomaticUpgrades?: boolean + + /** + * An optional boolean value that indicates the server supports the 'by-hash' locations. + * + * Represents the `Acquire-By-Hash` key on the Release contents. + * + * For the technical specification, see: + * https://wiki.debian.org/DebianRepository/Format#Acquire-By-Hash + */ + acquireByHash?: boolean + + /** + * Optional field containing a list of OpenGPG fingerprints that have signed the Release. + * + * Represents the `Signed-By` key on the Release contents. + * + * For the technical specification, see: + * https://wiki.debian.org/DebianRepository/Format#Signed-By + */ + signedBy?: string[] + + /** + * Optional boolean value that indicates if package downloads require authorization. + * + * Represents the `Packages-Require-Authorization` key on the Release contents. + * + * For the technical specification, see: + * https://wiki.debian.org/DebianRepository/Format#Packages-Require-Authorization + */ + packagesRequireAuthorization?: boolean +} /** * Class representing a release file