circleci-api
Version:
A Node and Browser client for the CircleCI API, written in TypeScript.
53 lines (52 loc) • 2.53 kB
TypeScript
import { GitInfo, CheckoutKeyResponse, CheckoutKey, DeleteCheckoutKeyResponse, CircleOptions } from "../types";
/**
* Lists the checkout keys for a project
*
* @see https://circleci.com/docs/api/v1-reference/#list-checkout-keys
* @example GET : https://circleci.com/api/v1.1/project/:vcs-type/:username/:project/checkout-key
*
* @param token CircleCI API token
* @param circleHost Provide custom url for CircleCI
* @param vcs Git information for project
* @returns list of checkout keys for a specific project
*/
export declare function getCheckoutKeys(token: string, { circleHost, ...vcs }: GitInfo & CircleOptions): Promise<CheckoutKeyResponse>;
/**
* Create a checkout key for a project
*
* @see https://circleci.com/docs/api/v1-reference/#new-checkout-key
* @example POST : https://circleci.com/api/v1.1/project/:vcs-type/:username/:project/checkout-key
*
* @param token CircleCI API token
* @param key Key to create for project
* @param vcs Git information for project
* @param circleHost Provide custom url for CircleCI
* @returns New checkout key
*/
export declare function createCheckoutKey(token: string, key: CheckoutKey, { circleHost, ...vcs }: GitInfo & CircleOptions): Promise<CheckoutKeyResponse>;
/**
* Get a single checkout key from it's fingerprint
*
* @see https://circleci.com/docs/api/v1-reference/#get-checkout-key
* @example POST : https://circleci.com/api/v1.1/project/:vcs-type/:username/:project/checkout-key
*
* @param token CircleCI API token
* @param fingerprint Fingerprint of the key to fetch
* @param circleHost Provide custom url for CircleCI
* @param vcs Git information for project
* @returns list of checkout keys for a specific project
*/
export declare function getCheckoutKey(token: string, fingerprint: string, { circleHost, ...vcs }: GitInfo & CircleOptions): Promise<CheckoutKeyResponse>;
/**
* Deletes a checkout key
*
* @see https://circleci.com/docs/api/v1-reference/#delete-checkout-key
* @example DELETE : https://circleci.com/api/v1.1/project/:vcs-type/:username/:project/checkout-key/:fingerprint
*
* @param token CircleCI API token
* @param fingerprint Fingerprint of the key to delete
* @param circleHost Provide custom url for CircleCI
* @param vcs Git information for project
* @returns Status message of deletion
*/
export declare function deleteCheckoutKey(token: string, fingerprint: string, { circleHost, ...vcs }: GitInfo & CircleOptions): Promise<DeleteCheckoutKeyResponse>;