Skip to main content

TypeScript SDK Reference

api/client.gen.GitRepository

A git repository.

Hierarchy

  • BaseClient

    GitRepository

Constructors

constructor

new GitRepository(parent?, _id?): GitRepository

Constructor is used for internal usage only, do not create object from it.

Parameters

NameType
parent?Object
parent.ctxContext
parent.queryTree?QueryTree[]
_id?GitRepositoryID

Returns

GitRepository

Overrides

BaseClient.constructor

Properties

_id

Private Optional Readonly _id: GitRepositoryID = undefined

Methods

branch

branch(name): GitRef

Returns details of a branch.

Parameters

NameTypeDescription
namestringBranch's name (e.g., "main").

Returns

GitRef


commit

commit(id): GitRef

Returns details of a commit.

Parameters

NameTypeDescription
idstringIdentifier of the commit (e.g., "b6315d8f2810962c601af73f86831f6866ea798b").

Returns

GitRef


head(): GitRef

Returns details for HEAD.

Returns

GitRef


id

id(): Promise<GitRepositoryID>

A unique identifier for this GitRepository.

Returns

Promise<GitRepositoryID>


ref

ref(name): GitRef

Returns details of a ref.

Parameters

NameTypeDescription
namestringRef's name (can be a commit identifier, a tag name, a branch name, or a fully-qualified ref).

Returns

GitRef


tag

tag(name): GitRef

Returns details of a tag.

Parameters

NameTypeDescription
namestringTag's name (e.g., "v0.3.9").

Returns

GitRef


tags

tags(opts?): Promise<string[]>

tags that match any of the given glob patterns.

Parameters

NameType
opts?GitRepositoryTagsOpts

Returns

Promise<string[]>


with

with(arg): GitRepository

Call the provided function with current GitRepository.

This is useful for reusability and readability by not breaking the calling chain.

Parameters

NameType
arg(param: GitRepository) => GitRepository

Returns

GitRepository


withAuthHeader

withAuthHeader(header): GitRepository

Header to authenticate the remote with.

Parameters

NameTypeDescription
headerSecretSecret used to populate the Authorization HTTP header

Returns

GitRepository


withAuthToken

withAuthToken(token): GitRepository

Token to authenticate the remote with.

Parameters

NameTypeDescription
tokenSecretSecret used to populate the password during basic HTTP Authorization

Returns

GitRepository