Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface ConfigService

A Config Service API which provides client side methods to manage configuration files residing in config server repository.

interface

Hierarchy

  • ConfigService

Index

Methods

create

  • create(path: string, configData: ConfigData, annex: boolean, comment: string): Promise<ConfigId>
  • Creates a file at a specified path with given data and comment.

    Parameters

    • path: string

      the file path relative to the repository root

    • configData: ConfigData

      contents of the file

    • annex: boolean

      true if the file is annex and requires special handling (external storage)

    • comment: string

      comment to associate with this operation

    Returns Promise<ConfigId>

    ConfigId as Promise

delete

  • delete(path: string, comment: string): Promise<void>
  • Deletes the given config file (older versions will still be available)

    Parameters

    • path: string

      the file path relative to the repository root

    • comment: string

      comment to associate with this operation

    Returns Promise<void>

exists

  • exists(path: string, id?: ConfigId): Promise<boolean>
  • Returns true if the given path exists and is being managed

    Parameters

    • path: string

      the file path relative to the repository root

    • Optional id: ConfigId

      revision of the file

    Returns Promise<boolean>

    boolean as Promise

getActive

getActiveByTime

  • Returns the content of active version of the file at the given path as it existed on the given instant

    Parameters

    • path: string

      the file path relative to the repository root

    • time: Date

      the target instant

    Returns Promise<Option<ConfigData>>

    Option as Promise

getActiveVersion

getById

getByTime

  • Gets the file at the given path as it existed on the given instant. If instant is before the file was created, the initial version is returned. If instant is after the last change, the most recent version is returned.

    Parameters

    • path: string

      the file path relative to the repository root

    • time: Date

      the target instant

    Returns Promise<Option<ConfigData>>

    Option as Promise

getLatest

getMetadata

history

  • history(path: string, from: Date, to: Date, maxResults: number): Promise<ConfigFileRevision[]>
  • Returns the history of versions of the file at the given path for a range of period specified by from and to. The size of the list is limited upto maxResults.

    Parameters

    • path: string

      the file path relative to the repository root

    • from: Date

      the start of the history range

    • to: Date

      the end of the history range

    • maxResults: number

      the maximum number of history results to return (default: unlimited)

    Returns Promise<ConfigFileRevision[]>

    ConfigFileRevision[] as Promise

historyActive

  • historyActive(path: string, from: Date, to: Date, maxResults: number): Promise<ConfigFileRevision[]>
  • Returns the history of active versions of the file at the given path for a range of period specified by from and to. The size of the list is limited upto maxResults.

    Parameters

    • path: string

      the file path relative to the repository root

    • from: Date

      the start of the history range

    • to: Date

      the end of the history range

    • maxResults: number

      the maximum number of history results to return (default: unlimited)

    Returns Promise<ConfigFileRevision[]>

    ConfigFileRevision[] as Promise

list

  • Returns a list containing all of the known config files of given type(Annex or Normal) and whose name matches the provided pattern

    Parameters

    • Optional params: { pattern?: string; type?: FileType }

      optional file type(Annex or Normal) and optional pattern to match against the file name

      • Optional pattern?: string
      • Optional type?: FileType

    Returns Promise<ConfigFileInfo[]>

    ConfigFileInfo[] as Promise

resetActiveVersion

  • resetActiveVersion(path: string, comment: string): Promise<void>
  • Resets the "active version" of the file at the given path to the latest version.

    Parameters

    • path: string

      the file path relative to the repository root

    • comment: string

      comment to associate with this operation

    Returns Promise<void>

setActiveVersion

  • setActiveVersion(path: string, id: ConfigId, comment: string): Promise<void>
  • Sets the active version to be the version provided for the file at the given path. If this method is not called, the active version will always be the version with which the file was created After calling this method, the version with the given Id will be the active version.

    Parameters

    • path: string

      the file path relative to the repository root

    • id: ConfigId

      an id used to specify a specific version (by default the id of the version with which the file was created i.e. 1)

    • comment: string

      comment to associate with this operation

    Returns Promise<void>

update

  • Updates the file content at a specified path with given data and comment.

    Parameters

    • path: string

      the file path relative to the repository root

    • configData: ConfigData

      contents of the file

    • comment: string

      comment to associate with this operation

    Returns Promise<ConfigId>

    ConfigId as Promise

Generated using TypeDoc