UNPKG

2.13 kBTypeScriptView Raw
1import { AxiosPromise } from "axios";
2import { WrapOptions } from "retry";
3/**
4 * Scheme and hostname (authority) of the Atomist webhook URL.
5 */
6export declare function webhookBaseUrl(): string;
7/**
8 * Atomist webhooks supported by these functions.
9 */
10export declare type AtomistWebhookType = "application" | "build" | "link-image";
11/**
12 * Post payload to the Atomist webhook URL. It will retry
13 * several times.
14 *
15 * @param webhook type of webhook
16 * @param payload object to post
17 * @param workspaceId Atomist team ID
18 * @param retryOptions change default retry options
19 * @return response of post operation
20 */
21export declare function postAtomistWebhook(webhook: AtomistWebhookType, payload: any, workspaceId: string, retryOptions?: WrapOptions): AxiosPromise<any>;
22/**
23 * Atomist generic build webhook payload repository structure.
24 */
25export interface AtomistBuildRepository {
26 owner_name: string;
27 name: string;
28}
29/**
30 * Atomist generic build trigger types.
31 */
32export declare type AtomistBuildType = "cron" | "pull_request" | "push" | "tag" | "manual";
33/**
34 * Atomist generic build statuses.
35 */
36export declare type AtomistBuildStatus = "started" | "failed" | "error" | "passed" | "canceled";
37/**
38 * Atomist generic build post payload structure.
39 */
40export interface AtomistBuild {
41 repository: AtomistBuildRepository;
42 number?: number;
43 name?: string;
44 compare_url?: string;
45 type: AtomistBuildType;
46 pull_request_number?: number;
47 build_url?: string;
48 status: AtomistBuildStatus;
49 id?: string;
50 commit: string;
51 tag?: string;
52 branch?: string;
53 provider?: string;
54}
55/**
56 * Atomist link image commit information structure.
57 */
58export interface AtomistLinkImageGit {
59 owner: string;
60 repo: string;
61 sha: string;
62}
63/**
64 * Atomist link image image information structure.
65 */
66export interface AtomistLinkImageDocker {
67 image: string;
68}
69/**
70 * Atomist link image post payload structure.
71 */
72export interface AtomistLinkImage {
73 git: AtomistLinkImageGit;
74 docker: AtomistLinkImageDocker;
75 type: "link-image";
76}
77//# sourceMappingURL=atomistWebhook.d.ts.map
\No newline at end of file