@hatchet-dev/typescript-sdk 0.8.0-alpha.3 → 0.8.0-alpha.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/clients/admin/admin-client.d.ts +13 -7
- package/clients/admin/admin-client.js +23 -18
- package/clients/dispatcher/heartbeat/heartbeat-controller.d.ts +0 -1
- package/clients/hatchet-client/hatchet-client.js +1 -1
- package/clients/listener/child-listener-client.d.ts +0 -1
- package/clients/listener/listener-client.d.ts +6 -14
- package/clients/listener/listener-client.js +16 -85
- package/clients/rest/generated/Api.d.ts +44 -117
- package/clients/rest/generated/Api.js +34 -112
- package/clients/rest/generated/data-contracts.d.ts +33 -54
- package/clients/rest/generated/http-client.js +2 -2
- package/clients/worker/handler.d.ts +2 -2
- package/clients/worker/handler.js +48 -38
- package/clients/worker/worker.d.ts +1 -2
- package/clients/worker/worker.js +1 -3
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/package.json +2 -2
- package/protoc/dispatcher/dispatcher.js +13 -13
- package/protoc/workflows/workflows.js +5 -5
- package/step.d.ts +11 -13
- package/step.js +13 -70
- package/util/config-loader/token.js +2 -3
- package/util/parse.js +1 -2
- package/util/retrier.js +1 -2
- package/util/thread-helper.d.ts +0 -1
- package/util/thread-helper.js +1 -2
- package/util/workflow-run-ref.d.ts +17 -0
- package/util/workflow-run-ref.js +94 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AcceptInviteRequest, APIMeta, CreateAPITokenRequest, CreateAPITokenResponse, CreateEventRequest, CreateSNSIntegrationRequest, CreateTenantAlertEmailGroupRequest, CreateTenantInviteRequest, CreateTenantRequest, Event, EventData, EventKey, EventKeyList, EventList, EventOrderByDirection, EventOrderByField, EventSearch, ListAPIMetaIntegration, ListAPITokensResponse, ListSlackWebhooks, ListSNSIntegrations, LogLineLevelField, LogLineList, LogLineOrderByDirection, LogLineOrderByField, LogLineSearch, RejectInviteRequest, ReplayEventRequest, RerunStepRunRequest, SNSIntegration, StepRun, StepRunEventList, Tenant, TenantAlertEmailGroup, TenantAlertEmailGroupList, TenantAlertingSettings, TenantInvite, TenantInviteList, TenantMember, TenantMemberList, TenantQueueMetrics, TenantResourcePolicy, TriggerWorkflowRunRequest, UpdateTenantAlertEmailGroupRequest, UpdateTenantInviteRequest, UpdateTenantRequest, User, UserChangePasswordRequest, UserLoginRequest, UserRegisterRequest, UserTenantMembershipsList, WebhookWorkerCreated, WebhookWorkerCreateRequest, WebhookWorkerListResponse, Worker, WorkerList, Workflow, WorkflowID, WorkflowList, WorkflowMetrics, WorkflowRun, WorkflowRunList, WorkflowRunsCancelRequest, WorkflowRunsMetrics, WorkflowRunStatus, WorkflowRunStatusList, WorkflowVersion, WorkflowVersionDefinition } from './data-contracts';
|
|
2
2
|
import { HttpClient, RequestParams } from './http-client';
|
|
3
3
|
export declare class Api<SecurityDataType = unknown> extends HttpClient<SecurityDataType> {
|
|
4
4
|
/**
|
|
@@ -83,26 +83,6 @@ export declare class Api<SecurityDataType = unknown> extends HttpClient<Security
|
|
|
83
83
|
* @request GET:/api/v1/users/github/callback
|
|
84
84
|
*/
|
|
85
85
|
userUpdateGithubOauthCallback: (params?: RequestParams) => Promise<import("axios").AxiosResponse<any, any>>;
|
|
86
|
-
/**
|
|
87
|
-
* @description Starts the OAuth flow
|
|
88
|
-
*
|
|
89
|
-
* @tags User
|
|
90
|
-
* @name UserUpdateGithubAppOauthStart
|
|
91
|
-
* @summary Start OAuth flow
|
|
92
|
-
* @request GET:/api/v1/users/github-app/start
|
|
93
|
-
* @secure
|
|
94
|
-
*/
|
|
95
|
-
userUpdateGithubAppOauthStart: (params?: RequestParams) => Promise<import("axios").AxiosResponse<any, any>>;
|
|
96
|
-
/**
|
|
97
|
-
* @description Completes the OAuth flow
|
|
98
|
-
*
|
|
99
|
-
* @tags User
|
|
100
|
-
* @name UserUpdateGithubAppOauthCallback
|
|
101
|
-
* @summary Complete OAuth flow
|
|
102
|
-
* @request GET:/api/v1/users/github-app/callback
|
|
103
|
-
* @secure
|
|
104
|
-
*/
|
|
105
|
-
userUpdateGithubAppOauthCallback: (params?: RequestParams) => Promise<import("axios").AxiosResponse<any, any>>;
|
|
106
86
|
/**
|
|
107
87
|
* @description Starts the OAuth flow
|
|
108
88
|
*
|
|
@@ -123,24 +103,6 @@ export declare class Api<SecurityDataType = unknown> extends HttpClient<Security
|
|
|
123
103
|
* @secure
|
|
124
104
|
*/
|
|
125
105
|
userUpdateSlackOauthCallback: (params?: RequestParams) => Promise<import("axios").AxiosResponse<any, any>>;
|
|
126
|
-
/**
|
|
127
|
-
* @description Github App global webhook
|
|
128
|
-
*
|
|
129
|
-
* @tags Github
|
|
130
|
-
* @name GithubUpdateGlobalWebhook
|
|
131
|
-
* @summary Github app global webhook
|
|
132
|
-
* @request POST:/api/v1/github/webhook
|
|
133
|
-
*/
|
|
134
|
-
githubUpdateGlobalWebhook: (params?: RequestParams) => Promise<import("axios").AxiosResponse<void, any>>;
|
|
135
|
-
/**
|
|
136
|
-
* @description Github App tenant webhook
|
|
137
|
-
*
|
|
138
|
-
* @tags Github
|
|
139
|
-
* @name GithubUpdateTenantWebhook
|
|
140
|
-
* @summary Github app tenant webhook
|
|
141
|
-
* @request POST:/api/v1/github/webhook/{webhook}
|
|
142
|
-
*/
|
|
143
|
-
githubUpdateTenantWebhook: (webhook: string, params?: RequestParams) => Promise<import("axios").AxiosResponse<void, any>>;
|
|
144
106
|
/**
|
|
145
107
|
* @description SNS event
|
|
146
108
|
*
|
|
@@ -427,6 +389,24 @@ export declare class Api<SecurityDataType = unknown> extends HttpClient<Security
|
|
|
427
389
|
* @secure
|
|
428
390
|
*/
|
|
429
391
|
apiTokenUpdateRevoke: (apiToken: string, params?: RequestParams) => Promise<import("axios").AxiosResponse<void, any>>;
|
|
392
|
+
/**
|
|
393
|
+
* @description Get the queue metrics for the tenant
|
|
394
|
+
*
|
|
395
|
+
* @tags Workflow
|
|
396
|
+
* @name TenantGetQueueMetrics
|
|
397
|
+
* @summary Get workflow metrics
|
|
398
|
+
* @request GET:/api/v1/tenants/{tenant}/queue-metrics
|
|
399
|
+
* @secure
|
|
400
|
+
*/
|
|
401
|
+
tenantGetQueueMetrics: (tenant: string, query?: {
|
|
402
|
+
/** A list of workflow IDs to filter by */
|
|
403
|
+
workflows?: WorkflowID[];
|
|
404
|
+
/**
|
|
405
|
+
* A list of metadata key value pairs to filter by
|
|
406
|
+
* @example ["key1:value1","key2:value2"]
|
|
407
|
+
*/
|
|
408
|
+
additionalMetadata?: string[];
|
|
409
|
+
}, params?: RequestParams) => Promise<import("axios").AxiosResponse<TenantQueueMetrics, any>>;
|
|
430
410
|
/**
|
|
431
411
|
* @description Lists all events for a tenant.
|
|
432
412
|
*
|
|
@@ -465,6 +445,16 @@ export declare class Api<SecurityDataType = unknown> extends HttpClient<Security
|
|
|
465
445
|
*/
|
|
466
446
|
additionalMetadata?: string[];
|
|
467
447
|
}, params?: RequestParams) => Promise<import("axios").AxiosResponse<EventList, any>>;
|
|
448
|
+
/**
|
|
449
|
+
* @description Creates a new event.
|
|
450
|
+
*
|
|
451
|
+
* @tags Event
|
|
452
|
+
* @name EventCreate
|
|
453
|
+
* @summary Create event
|
|
454
|
+
* @request POST:/api/v1/tenants/{tenant}/events
|
|
455
|
+
* @secure
|
|
456
|
+
*/
|
|
457
|
+
eventCreate: (tenant: string, data: CreateEventRequest, params?: RequestParams) => Promise<import("axios").AxiosResponse<Event, any>>;
|
|
468
458
|
/**
|
|
469
459
|
* @description Replays a list of events.
|
|
470
460
|
*
|
|
@@ -535,7 +525,7 @@ export declare class Api<SecurityDataType = unknown> extends HttpClient<Security
|
|
|
535
525
|
* @secure
|
|
536
526
|
*/
|
|
537
527
|
workflowRunCancel: (tenant: string, data: WorkflowRunsCancelRequest, params?: RequestParams) => Promise<import("axios").AxiosResponse<{
|
|
538
|
-
workflowRunIds?: string[]
|
|
528
|
+
workflowRunIds?: string[];
|
|
539
529
|
}, any>>;
|
|
540
530
|
/**
|
|
541
531
|
* @description Get a workflow for a tenant
|
|
@@ -611,16 +601,6 @@ export declare class Api<SecurityDataType = unknown> extends HttpClient<Security
|
|
|
611
601
|
*/
|
|
612
602
|
version?: string;
|
|
613
603
|
}, params?: RequestParams) => Promise<import("axios").AxiosResponse<WorkflowVersionDefinition, any>>;
|
|
614
|
-
/**
|
|
615
|
-
* @description Link a github repository to a workflow
|
|
616
|
-
*
|
|
617
|
-
* @tags Workflow
|
|
618
|
-
* @name WorkflowUpdateLinkGithub
|
|
619
|
-
* @summary Link github repository
|
|
620
|
-
* @request POST:/api/v1/workflows/{workflow}/link-github
|
|
621
|
-
* @secure
|
|
622
|
-
*/
|
|
623
|
-
workflowUpdateLinkGithub: (workflow: string, data: LinkGithubRepositoryRequest, params?: RequestParams) => Promise<import("axios").AxiosResponse<Workflow, any>>;
|
|
624
604
|
/**
|
|
625
605
|
* @description Get the metrics for a workflow version
|
|
626
606
|
*
|
|
@@ -631,21 +611,11 @@ export declare class Api<SecurityDataType = unknown> extends HttpClient<Security
|
|
|
631
611
|
* @secure
|
|
632
612
|
*/
|
|
633
613
|
workflowGetMetrics: (workflow: string, query?: {
|
|
634
|
-
/** A status of workflow
|
|
614
|
+
/** A status of workflow run statuses to filter by */
|
|
635
615
|
status?: WorkflowRunStatus;
|
|
636
616
|
/** A group key to filter metrics by */
|
|
637
617
|
groupKey?: string;
|
|
638
618
|
}, params?: RequestParams) => Promise<import("axios").AxiosResponse<WorkflowMetrics, any>>;
|
|
639
|
-
/**
|
|
640
|
-
* @description Create a pull request for a workflow
|
|
641
|
-
*
|
|
642
|
-
* @tags Workflow
|
|
643
|
-
* @name StepRunUpdateCreatePr
|
|
644
|
-
* @summary Create pull request
|
|
645
|
-
* @request POST:/api/v1/step-runs/{step-run}/create-pr
|
|
646
|
-
* @secure
|
|
647
|
-
*/
|
|
648
|
-
stepRunUpdateCreatePr: (stepRun: string, data: CreatePullRequestFromStepRun, params?: RequestParams) => Promise<import("axios").AxiosResponse<CreatePullRequestFromStepRun, any>>;
|
|
649
619
|
/**
|
|
650
620
|
* @description Lists log lines for a step run.
|
|
651
621
|
*
|
|
@@ -675,16 +645,6 @@ export declare class Api<SecurityDataType = unknown> extends HttpClient<Security
|
|
|
675
645
|
/** The order direction */
|
|
676
646
|
orderByDirection?: LogLineOrderByDirection;
|
|
677
647
|
}, params?: RequestParams) => Promise<import("axios").AxiosResponse<LogLineList, any>>;
|
|
678
|
-
/**
|
|
679
|
-
* @description Get the diff for a step run between the most recent run and the first run.
|
|
680
|
-
*
|
|
681
|
-
* @tags Workflow
|
|
682
|
-
* @name StepRunGetDiff
|
|
683
|
-
* @summary Get diff
|
|
684
|
-
* @request GET:/api/v1/step-runs/{step-run}/diff
|
|
685
|
-
* @secure
|
|
686
|
-
*/
|
|
687
|
-
stepRunGetDiff: (stepRun: string, params?: RequestParams) => Promise<import("axios").AxiosResponse<GetStepRunDiffResponse, any>>;
|
|
688
648
|
/**
|
|
689
649
|
* @description List events for a step run
|
|
690
650
|
*
|
|
@@ -816,19 +776,6 @@ export declare class Api<SecurityDataType = unknown> extends HttpClient<Security
|
|
|
816
776
|
* @secure
|
|
817
777
|
*/
|
|
818
778
|
workflowRunGet: (tenant: string, workflowRun: string, params?: RequestParams) => Promise<import("axios").AxiosResponse<WorkflowRun, any>>;
|
|
819
|
-
/**
|
|
820
|
-
* @description List all pull requests for a workflow run
|
|
821
|
-
*
|
|
822
|
-
* @tags Workflow
|
|
823
|
-
* @name WorkflowRunListPullRequests
|
|
824
|
-
* @summary List pull requests
|
|
825
|
-
* @request GET:/api/v1/tenants/{tenant}/workflow-runs/{workflow-run}/prs
|
|
826
|
-
* @secure
|
|
827
|
-
*/
|
|
828
|
-
workflowRunListPullRequests: (tenant: string, workflowRun: string, query?: {
|
|
829
|
-
/** The pull request state */
|
|
830
|
-
state?: PullRequestState;
|
|
831
|
-
}, params?: RequestParams) => Promise<import("axios").AxiosResponse<ListPullRequestsResponse, any>>;
|
|
832
779
|
/**
|
|
833
780
|
* @description Get a step run by id
|
|
834
781
|
*
|
|
@@ -889,42 +836,12 @@ export declare class Api<SecurityDataType = unknown> extends HttpClient<Security
|
|
|
889
836
|
* @secure
|
|
890
837
|
*/
|
|
891
838
|
workerGet: (worker: string, params?: RequestParams) => Promise<import("axios").AxiosResponse<Worker, any>>;
|
|
892
|
-
/**
|
|
893
|
-
* @description List Github App installations
|
|
894
|
-
*
|
|
895
|
-
* @tags Github
|
|
896
|
-
* @name GithubAppListInstallations
|
|
897
|
-
* @summary List Github App installations
|
|
898
|
-
* @request GET:/api/v1/github-app/installations
|
|
899
|
-
* @secure
|
|
900
|
-
*/
|
|
901
|
-
githubAppListInstallations: (params?: RequestParams) => Promise<import("axios").AxiosResponse<ListGithubAppInstallationsResponse, any>>;
|
|
902
|
-
/**
|
|
903
|
-
* @description List Github App repositories
|
|
904
|
-
*
|
|
905
|
-
* @tags Github
|
|
906
|
-
* @name GithubAppListRepos
|
|
907
|
-
* @summary List Github App repositories
|
|
908
|
-
* @request GET:/api/v1/github-app/installations/{gh-installation}/repos
|
|
909
|
-
* @secure
|
|
910
|
-
*/
|
|
911
|
-
githubAppListRepos: (ghInstallation: string, params?: RequestParams) => Promise<import("axios").AxiosResponse<ListGithubReposResponse, any>>;
|
|
912
|
-
/**
|
|
913
|
-
* @description List Github App branches
|
|
914
|
-
*
|
|
915
|
-
* @tags Github
|
|
916
|
-
* @name GithubAppListBranches
|
|
917
|
-
* @summary List Github App branches
|
|
918
|
-
* @request GET:/api/v1/github-app/installations/{gh-installation}/repos/{gh-repo-owner}/{gh-repo-name}/branches
|
|
919
|
-
* @secure
|
|
920
|
-
*/
|
|
921
|
-
githubAppListBranches: (ghInstallation: string, ghRepoOwner: string, ghRepoName: string, params?: RequestParams) => Promise<import("axios").AxiosResponse<ListGithubBranchesResponse, any>>;
|
|
922
839
|
/**
|
|
923
840
|
* @description Lists all webhooks
|
|
924
841
|
*
|
|
925
842
|
* @name WebhookList
|
|
926
843
|
* @summary List webhooks
|
|
927
|
-
* @request GET:/api/v1/
|
|
844
|
+
* @request GET:/api/v1/tenants/{tenant}/webhook-workers
|
|
928
845
|
* @secure
|
|
929
846
|
*/
|
|
930
847
|
webhookList: (tenant: string, params?: RequestParams) => Promise<import("axios").AxiosResponse<WebhookWorkerListResponse, any>>;
|
|
@@ -933,7 +850,17 @@ export declare class Api<SecurityDataType = unknown> extends HttpClient<Security
|
|
|
933
850
|
*
|
|
934
851
|
* @name WebhookCreate
|
|
935
852
|
* @summary Create a webhook
|
|
936
|
-
* @request POST:/api/v1/
|
|
853
|
+
* @request POST:/api/v1/tenants/{tenant}/webhook-workers
|
|
854
|
+
* @secure
|
|
855
|
+
*/
|
|
856
|
+
webhookCreate: (tenant: string, data: WebhookWorkerCreateRequest, params?: RequestParams) => Promise<import("axios").AxiosResponse<WebhookWorkerCreated, any>>;
|
|
857
|
+
/**
|
|
858
|
+
* @description Deletes a webhook
|
|
859
|
+
*
|
|
860
|
+
* @name WebhookDelete
|
|
861
|
+
* @summary Delete a webhook
|
|
862
|
+
* @request DELETE:/api/v1/webhook-workers/{webhook}
|
|
863
|
+
* @secure
|
|
937
864
|
*/
|
|
938
|
-
|
|
865
|
+
webhookDelete: (webhook: string, params?: RequestParams) => Promise<import("axios").AxiosResponse<void, any>>;
|
|
939
866
|
}
|
|
@@ -97,26 +97,6 @@ class Api extends http_client_1.HttpClient {
|
|
|
97
97
|
* @request GET:/api/v1/users/github/callback
|
|
98
98
|
*/
|
|
99
99
|
this.userUpdateGithubOauthCallback = (params = {}) => this.request(Object.assign({ path: `/api/v1/users/github/callback`, method: 'GET' }, params));
|
|
100
|
-
/**
|
|
101
|
-
* @description Starts the OAuth flow
|
|
102
|
-
*
|
|
103
|
-
* @tags User
|
|
104
|
-
* @name UserUpdateGithubAppOauthStart
|
|
105
|
-
* @summary Start OAuth flow
|
|
106
|
-
* @request GET:/api/v1/users/github-app/start
|
|
107
|
-
* @secure
|
|
108
|
-
*/
|
|
109
|
-
this.userUpdateGithubAppOauthStart = (params = {}) => this.request(Object.assign({ path: `/api/v1/users/github-app/start`, method: 'GET', secure: true }, params));
|
|
110
|
-
/**
|
|
111
|
-
* @description Completes the OAuth flow
|
|
112
|
-
*
|
|
113
|
-
* @tags User
|
|
114
|
-
* @name UserUpdateGithubAppOauthCallback
|
|
115
|
-
* @summary Complete OAuth flow
|
|
116
|
-
* @request GET:/api/v1/users/github-app/callback
|
|
117
|
-
* @secure
|
|
118
|
-
*/
|
|
119
|
-
this.userUpdateGithubAppOauthCallback = (params = {}) => this.request(Object.assign({ path: `/api/v1/users/github-app/callback`, method: 'GET', secure: true }, params));
|
|
120
100
|
/**
|
|
121
101
|
* @description Starts the OAuth flow
|
|
122
102
|
*
|
|
@@ -137,24 +117,6 @@ class Api extends http_client_1.HttpClient {
|
|
|
137
117
|
* @secure
|
|
138
118
|
*/
|
|
139
119
|
this.userUpdateSlackOauthCallback = (params = {}) => this.request(Object.assign({ path: `/api/v1/users/slack/callback`, method: 'GET', secure: true }, params));
|
|
140
|
-
/**
|
|
141
|
-
* @description Github App global webhook
|
|
142
|
-
*
|
|
143
|
-
* @tags Github
|
|
144
|
-
* @name GithubUpdateGlobalWebhook
|
|
145
|
-
* @summary Github app global webhook
|
|
146
|
-
* @request POST:/api/v1/github/webhook
|
|
147
|
-
*/
|
|
148
|
-
this.githubUpdateGlobalWebhook = (params = {}) => this.request(Object.assign({ path: `/api/v1/github/webhook`, method: 'POST' }, params));
|
|
149
|
-
/**
|
|
150
|
-
* @description Github App tenant webhook
|
|
151
|
-
*
|
|
152
|
-
* @tags Github
|
|
153
|
-
* @name GithubUpdateTenantWebhook
|
|
154
|
-
* @summary Github app tenant webhook
|
|
155
|
-
* @request POST:/api/v1/github/webhook/{webhook}
|
|
156
|
-
*/
|
|
157
|
-
this.githubUpdateTenantWebhook = (webhook, params = {}) => this.request(Object.assign({ path: `/api/v1/github/webhook/${webhook}`, method: 'POST' }, params));
|
|
158
120
|
/**
|
|
159
121
|
* @description SNS event
|
|
160
122
|
*
|
|
@@ -441,6 +403,16 @@ class Api extends http_client_1.HttpClient {
|
|
|
441
403
|
* @secure
|
|
442
404
|
*/
|
|
443
405
|
this.apiTokenUpdateRevoke = (apiToken, params = {}) => this.request(Object.assign({ path: `/api/v1/api-tokens/${apiToken}`, method: 'POST', secure: true }, params));
|
|
406
|
+
/**
|
|
407
|
+
* @description Get the queue metrics for the tenant
|
|
408
|
+
*
|
|
409
|
+
* @tags Workflow
|
|
410
|
+
* @name TenantGetQueueMetrics
|
|
411
|
+
* @summary Get workflow metrics
|
|
412
|
+
* @request GET:/api/v1/tenants/{tenant}/queue-metrics
|
|
413
|
+
* @secure
|
|
414
|
+
*/
|
|
415
|
+
this.tenantGetQueueMetrics = (tenant, query, params = {}) => this.request(Object.assign({ path: `/api/v1/tenants/${tenant}/queue-metrics`, method: 'GET', query: query, secure: true, format: 'json' }, params));
|
|
444
416
|
/**
|
|
445
417
|
* @description Lists all events for a tenant.
|
|
446
418
|
*
|
|
@@ -451,6 +423,16 @@ class Api extends http_client_1.HttpClient {
|
|
|
451
423
|
* @secure
|
|
452
424
|
*/
|
|
453
425
|
this.eventList = (tenant, query, params = {}) => this.request(Object.assign({ path: `/api/v1/tenants/${tenant}/events`, method: 'GET', query: query, secure: true, format: 'json' }, params));
|
|
426
|
+
/**
|
|
427
|
+
* @description Creates a new event.
|
|
428
|
+
*
|
|
429
|
+
* @tags Event
|
|
430
|
+
* @name EventCreate
|
|
431
|
+
* @summary Create event
|
|
432
|
+
* @request POST:/api/v1/tenants/{tenant}/events
|
|
433
|
+
* @secure
|
|
434
|
+
*/
|
|
435
|
+
this.eventCreate = (tenant, data, params = {}) => this.request(Object.assign({ path: `/api/v1/tenants/${tenant}/events`, method: 'POST', body: data, secure: true, type: http_client_1.ContentType.Json, format: 'json' }, params));
|
|
454
436
|
/**
|
|
455
437
|
* @description Replays a list of events.
|
|
456
438
|
*
|
|
@@ -571,16 +553,6 @@ class Api extends http_client_1.HttpClient {
|
|
|
571
553
|
* @secure
|
|
572
554
|
*/
|
|
573
555
|
this.workflowVersionGetDefinition = (workflow, query, params = {}) => this.request(Object.assign({ path: `/api/v1/workflows/${workflow}/versions/definition`, method: 'GET', query: query, secure: true, format: 'json' }, params));
|
|
574
|
-
/**
|
|
575
|
-
* @description Link a github repository to a workflow
|
|
576
|
-
*
|
|
577
|
-
* @tags Workflow
|
|
578
|
-
* @name WorkflowUpdateLinkGithub
|
|
579
|
-
* @summary Link github repository
|
|
580
|
-
* @request POST:/api/v1/workflows/{workflow}/link-github
|
|
581
|
-
* @secure
|
|
582
|
-
*/
|
|
583
|
-
this.workflowUpdateLinkGithub = (workflow, data, params = {}) => this.request(Object.assign({ path: `/api/v1/workflows/${workflow}/link-github`, method: 'POST', body: data, secure: true, type: http_client_1.ContentType.Json, format: 'json' }, params));
|
|
584
556
|
/**
|
|
585
557
|
* @description Get the metrics for a workflow version
|
|
586
558
|
*
|
|
@@ -591,16 +563,6 @@ class Api extends http_client_1.HttpClient {
|
|
|
591
563
|
* @secure
|
|
592
564
|
*/
|
|
593
565
|
this.workflowGetMetrics = (workflow, query, params = {}) => this.request(Object.assign({ path: `/api/v1/workflows/${workflow}/metrics`, method: 'GET', query: query, secure: true, format: 'json' }, params));
|
|
594
|
-
/**
|
|
595
|
-
* @description Create a pull request for a workflow
|
|
596
|
-
*
|
|
597
|
-
* @tags Workflow
|
|
598
|
-
* @name StepRunUpdateCreatePr
|
|
599
|
-
* @summary Create pull request
|
|
600
|
-
* @request POST:/api/v1/step-runs/{step-run}/create-pr
|
|
601
|
-
* @secure
|
|
602
|
-
*/
|
|
603
|
-
this.stepRunUpdateCreatePr = (stepRun, data, params = {}) => this.request(Object.assign({ path: `/api/v1/step-runs/${stepRun}/create-pr`, method: 'POST', body: data, secure: true, type: http_client_1.ContentType.Json, format: 'json' }, params));
|
|
604
566
|
/**
|
|
605
567
|
* @description Lists log lines for a step run.
|
|
606
568
|
*
|
|
@@ -611,16 +573,6 @@ class Api extends http_client_1.HttpClient {
|
|
|
611
573
|
* @secure
|
|
612
574
|
*/
|
|
613
575
|
this.logLineList = (stepRun, query, params = {}) => this.request(Object.assign({ path: `/api/v1/step-runs/${stepRun}/logs`, method: 'GET', query: query, secure: true, format: 'json' }, params));
|
|
614
|
-
/**
|
|
615
|
-
* @description Get the diff for a step run between the most recent run and the first run.
|
|
616
|
-
*
|
|
617
|
-
* @tags Workflow
|
|
618
|
-
* @name StepRunGetDiff
|
|
619
|
-
* @summary Get diff
|
|
620
|
-
* @request GET:/api/v1/step-runs/{step-run}/diff
|
|
621
|
-
* @secure
|
|
622
|
-
*/
|
|
623
|
-
this.stepRunGetDiff = (stepRun, params = {}) => this.request(Object.assign({ path: `/api/v1/step-runs/${stepRun}/diff`, method: 'GET', secure: true, format: 'json' }, params));
|
|
624
576
|
/**
|
|
625
577
|
* @description List events for a step run
|
|
626
578
|
*
|
|
@@ -661,16 +613,6 @@ class Api extends http_client_1.HttpClient {
|
|
|
661
613
|
* @secure
|
|
662
614
|
*/
|
|
663
615
|
this.workflowRunGet = (tenant, workflowRun, params = {}) => this.request(Object.assign({ path: `/api/v1/tenants/${tenant}/workflow-runs/${workflowRun}`, method: 'GET', secure: true, format: 'json' }, params));
|
|
664
|
-
/**
|
|
665
|
-
* @description List all pull requests for a workflow run
|
|
666
|
-
*
|
|
667
|
-
* @tags Workflow
|
|
668
|
-
* @name WorkflowRunListPullRequests
|
|
669
|
-
* @summary List pull requests
|
|
670
|
-
* @request GET:/api/v1/tenants/{tenant}/workflow-runs/{workflow-run}/prs
|
|
671
|
-
* @secure
|
|
672
|
-
*/
|
|
673
|
-
this.workflowRunListPullRequests = (tenant, workflowRun, query, params = {}) => this.request(Object.assign({ path: `/api/v1/tenants/${tenant}/workflow-runs/${workflowRun}/prs`, method: 'GET', query: query, secure: true, format: 'json' }, params));
|
|
674
616
|
/**
|
|
675
617
|
* @description Get a step run by id
|
|
676
618
|
*
|
|
@@ -731,53 +673,33 @@ class Api extends http_client_1.HttpClient {
|
|
|
731
673
|
* @secure
|
|
732
674
|
*/
|
|
733
675
|
this.workerGet = (worker, params = {}) => this.request(Object.assign({ path: `/api/v1/workers/${worker}`, method: 'GET', secure: true, format: 'json' }, params));
|
|
734
|
-
/**
|
|
735
|
-
* @description List Github App installations
|
|
736
|
-
*
|
|
737
|
-
* @tags Github
|
|
738
|
-
* @name GithubAppListInstallations
|
|
739
|
-
* @summary List Github App installations
|
|
740
|
-
* @request GET:/api/v1/github-app/installations
|
|
741
|
-
* @secure
|
|
742
|
-
*/
|
|
743
|
-
this.githubAppListInstallations = (params = {}) => this.request(Object.assign({ path: `/api/v1/github-app/installations`, method: 'GET', secure: true, format: 'json' }, params));
|
|
744
|
-
/**
|
|
745
|
-
* @description List Github App repositories
|
|
746
|
-
*
|
|
747
|
-
* @tags Github
|
|
748
|
-
* @name GithubAppListRepos
|
|
749
|
-
* @summary List Github App repositories
|
|
750
|
-
* @request GET:/api/v1/github-app/installations/{gh-installation}/repos
|
|
751
|
-
* @secure
|
|
752
|
-
*/
|
|
753
|
-
this.githubAppListRepos = (ghInstallation, params = {}) => this.request(Object.assign({ path: `/api/v1/github-app/installations/${ghInstallation}/repos`, method: 'GET', secure: true, format: 'json' }, params));
|
|
754
|
-
/**
|
|
755
|
-
* @description List Github App branches
|
|
756
|
-
*
|
|
757
|
-
* @tags Github
|
|
758
|
-
* @name GithubAppListBranches
|
|
759
|
-
* @summary List Github App branches
|
|
760
|
-
* @request GET:/api/v1/github-app/installations/{gh-installation}/repos/{gh-repo-owner}/{gh-repo-name}/branches
|
|
761
|
-
* @secure
|
|
762
|
-
*/
|
|
763
|
-
this.githubAppListBranches = (ghInstallation, ghRepoOwner, ghRepoName, params = {}) => this.request(Object.assign({ path: `/api/v1/github-app/installations/${ghInstallation}/repos/${ghRepoOwner}/${ghRepoName}/branches`, method: 'GET', secure: true, format: 'json' }, params));
|
|
764
676
|
/**
|
|
765
677
|
* @description Lists all webhooks
|
|
766
678
|
*
|
|
767
679
|
* @name WebhookList
|
|
768
680
|
* @summary List webhooks
|
|
769
|
-
* @request GET:/api/v1/
|
|
681
|
+
* @request GET:/api/v1/tenants/{tenant}/webhook-workers
|
|
770
682
|
* @secure
|
|
771
683
|
*/
|
|
772
|
-
this.webhookList = (tenant, params = {}) => this.request(Object.assign({ path: `/api/v1/
|
|
684
|
+
this.webhookList = (tenant, params = {}) => this.request(Object.assign({ path: `/api/v1/tenants/${tenant}/webhook-workers`, method: 'GET', secure: true, format: 'json' }, params));
|
|
773
685
|
/**
|
|
774
686
|
* @description Creates a webhook
|
|
775
687
|
*
|
|
776
688
|
* @name WebhookCreate
|
|
777
689
|
* @summary Create a webhook
|
|
778
|
-
* @request POST:/api/v1/
|
|
690
|
+
* @request POST:/api/v1/tenants/{tenant}/webhook-workers
|
|
691
|
+
* @secure
|
|
692
|
+
*/
|
|
693
|
+
this.webhookCreate = (tenant, data, params = {}) => this.request(Object.assign({ path: `/api/v1/tenants/${tenant}/webhook-workers`, method: 'POST', body: data, secure: true, type: http_client_1.ContentType.Json, format: 'json' }, params));
|
|
694
|
+
/**
|
|
695
|
+
* @description Deletes a webhook
|
|
696
|
+
*
|
|
697
|
+
* @name WebhookDelete
|
|
698
|
+
* @summary Delete a webhook
|
|
699
|
+
* @request DELETE:/api/v1/webhook-workers/{webhook}
|
|
700
|
+
* @secure
|
|
779
701
|
*/
|
|
780
|
-
this.
|
|
702
|
+
this.webhookDelete = (webhook, params = {}) => this.request(Object.assign({ path: `/api/v1/webhook-workers/${webhook}`, method: 'DELETE', secure: true }, params));
|
|
781
703
|
}
|
|
782
704
|
}
|
|
783
705
|
exports.Api = Api;
|
|
@@ -283,6 +283,19 @@ export interface TenantInviteList {
|
|
|
283
283
|
pagination?: PaginationResponse;
|
|
284
284
|
rows?: TenantInvite[];
|
|
285
285
|
}
|
|
286
|
+
export interface QueueMetrics {
|
|
287
|
+
/** The number of items in the queue. */
|
|
288
|
+
numQueued: number;
|
|
289
|
+
/** The number of items running. */
|
|
290
|
+
numRunning: number;
|
|
291
|
+
/** The number of items pending. */
|
|
292
|
+
numPending: number;
|
|
293
|
+
}
|
|
294
|
+
export interface TenantQueueMetrics {
|
|
295
|
+
/** The total queue metrics. */
|
|
296
|
+
total?: QueueMetrics;
|
|
297
|
+
workflow?: Record<string, QueueMetrics>;
|
|
298
|
+
}
|
|
286
299
|
export interface AcceptInviteRequest {
|
|
287
300
|
/**
|
|
288
301
|
* @minLength 36
|
|
@@ -342,6 +355,14 @@ export interface EventData {
|
|
|
342
355
|
/** The data for the event (JSON bytes). */
|
|
343
356
|
data: string;
|
|
344
357
|
}
|
|
358
|
+
export interface CreateEventRequest {
|
|
359
|
+
/** The key for the event. */
|
|
360
|
+
key: string;
|
|
361
|
+
/** The data for the event. */
|
|
362
|
+
data: object;
|
|
363
|
+
/** Additional metadata for the event. */
|
|
364
|
+
additionalMetadata?: object;
|
|
365
|
+
}
|
|
345
366
|
export interface EventWorkflowRunSummary {
|
|
346
367
|
/**
|
|
347
368
|
* The number of pending runs.
|
|
@@ -404,7 +425,6 @@ export interface Workflow {
|
|
|
404
425
|
lastRun?: WorkflowRun;
|
|
405
426
|
/** The jobs of the workflow. */
|
|
406
427
|
jobs?: Job[];
|
|
407
|
-
deployment?: WorkflowDeploymentConfig;
|
|
408
428
|
}
|
|
409
429
|
export interface WorkflowConcurrency {
|
|
410
430
|
/**
|
|
@@ -417,22 +437,6 @@ export interface WorkflowConcurrency {
|
|
|
417
437
|
/** An action which gets the concurrency group for the WorkflowRun. */
|
|
418
438
|
getConcurrencyGroup: string;
|
|
419
439
|
}
|
|
420
|
-
export interface WorkflowDeploymentConfig {
|
|
421
|
-
metadata: APIResourceMeta;
|
|
422
|
-
/** The repository name. */
|
|
423
|
-
gitRepoName: string;
|
|
424
|
-
/** The repository owner. */
|
|
425
|
-
gitRepoOwner: string;
|
|
426
|
-
/** The repository branch. */
|
|
427
|
-
gitRepoBranch: string;
|
|
428
|
-
/** The Github App installation. */
|
|
429
|
-
githubAppInstallation?: GithubAppInstallation;
|
|
430
|
-
/**
|
|
431
|
-
* The id of the Github App installation.
|
|
432
|
-
* @format uuid
|
|
433
|
-
*/
|
|
434
|
-
githubAppInstallationId: string;
|
|
435
|
-
}
|
|
436
440
|
export interface WorkflowVersionMeta {
|
|
437
441
|
metadata: APIResourceMeta;
|
|
438
442
|
/** The version of the workflow. */
|
|
@@ -756,40 +760,6 @@ export interface TriggerWorkflowRunRequest {
|
|
|
756
760
|
input: object;
|
|
757
761
|
additionalMetadata?: object;
|
|
758
762
|
}
|
|
759
|
-
export interface LinkGithubRepositoryRequest {
|
|
760
|
-
/**
|
|
761
|
-
* The repository name.
|
|
762
|
-
* @minLength 36
|
|
763
|
-
* @maxLength 36
|
|
764
|
-
*/
|
|
765
|
-
installationId: string;
|
|
766
|
-
/** The repository name. */
|
|
767
|
-
gitRepoName: string;
|
|
768
|
-
/** The repository owner. */
|
|
769
|
-
gitRepoOwner: string;
|
|
770
|
-
/** The repository branch. */
|
|
771
|
-
gitRepoBranch: string;
|
|
772
|
-
}
|
|
773
|
-
export interface GithubBranch {
|
|
774
|
-
branch_name: string;
|
|
775
|
-
is_default: boolean;
|
|
776
|
-
}
|
|
777
|
-
export interface GithubRepo {
|
|
778
|
-
repo_owner: string;
|
|
779
|
-
repo_name: string;
|
|
780
|
-
}
|
|
781
|
-
export interface GithubAppInstallation {
|
|
782
|
-
metadata: APIResourceMeta;
|
|
783
|
-
installation_settings_url: string;
|
|
784
|
-
account_name: string;
|
|
785
|
-
account_avatar_url: string;
|
|
786
|
-
}
|
|
787
|
-
export interface ListGithubAppInstallationsResponse {
|
|
788
|
-
pagination: PaginationResponse;
|
|
789
|
-
rows: GithubAppInstallation[];
|
|
790
|
-
}
|
|
791
|
-
export type ListGithubReposResponse = GithubRepo[];
|
|
792
|
-
export type ListGithubBranchesResponse = GithubBranch[];
|
|
793
763
|
export interface CreatePullRequestFromStepRun {
|
|
794
764
|
branchName: string;
|
|
795
765
|
}
|
|
@@ -896,16 +866,25 @@ export interface WorkflowMetrics {
|
|
|
896
866
|
}
|
|
897
867
|
export interface WebhookWorker {
|
|
898
868
|
metadata: APIResourceMeta;
|
|
869
|
+
/** The name of the webhook worker. */
|
|
870
|
+
name: string;
|
|
871
|
+
/** The webhook url. */
|
|
872
|
+
url: string;
|
|
873
|
+
}
|
|
874
|
+
export interface WebhookWorkerCreated {
|
|
875
|
+
metadata: APIResourceMeta;
|
|
876
|
+
/** The name of the webhook worker. */
|
|
877
|
+
name: string;
|
|
899
878
|
/** The webhook url. */
|
|
900
879
|
url: string;
|
|
901
880
|
/** The secret key for validation. */
|
|
902
881
|
secret: string;
|
|
903
882
|
}
|
|
904
883
|
export interface WebhookWorkerCreateRequest {
|
|
884
|
+
/** The name of the webhook worker. */
|
|
885
|
+
name: string;
|
|
905
886
|
/** The webhook url. */
|
|
906
887
|
url: string;
|
|
907
|
-
/** The workflow IDs or names to register for this webhook worker. If not provided, workflows will be automatically detected. */
|
|
908
|
-
workflows?: string[];
|
|
909
888
|
/**
|
|
910
889
|
* The secret key for validation. If not provided, a random secret will be generated.
|
|
911
890
|
* @minLength 32
|
|
@@ -913,7 +892,7 @@ export interface WebhookWorkerCreateRequest {
|
|
|
913
892
|
secret?: string;
|
|
914
893
|
}
|
|
915
894
|
export interface WebhookWorkerCreateResponse {
|
|
916
|
-
worker?:
|
|
895
|
+
worker?: WebhookWorkerCreated;
|
|
917
896
|
}
|
|
918
897
|
export interface WebhookWorkerListResponse {
|
|
919
898
|
pagination?: PaginationResponse;
|
|
@@ -49,8 +49,8 @@ class HttpClient {
|
|
|
49
49
|
this.setSecurityData = (data) => {
|
|
50
50
|
this.securityData = data;
|
|
51
51
|
};
|
|
52
|
-
this.request = (
|
|
53
|
-
var { secure, path, type, query, format, body } =
|
|
52
|
+
this.request = (_a) => __awaiter(this, void 0, void 0, function* () {
|
|
53
|
+
var { secure, path, type, query, format, body } = _a, params = __rest(_a, ["secure", "path", "type", "query", "format", "body"]);
|
|
54
54
|
const secureParams = ((typeof secure === 'boolean' ? secure : this.secure) &&
|
|
55
55
|
this.securityWorker &&
|
|
56
56
|
(yield this.securityWorker(this.securityData))) ||
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import { IncomingMessage, ServerResponse } from 'http';
|
|
3
2
|
import { Workflow } from '../../workflow';
|
|
4
3
|
import { Worker } from './worker';
|
|
@@ -20,7 +19,8 @@ export declare class WebhookHandler {
|
|
|
20
19
|
* @throws {HatchetError} - If no secret is provided.
|
|
21
20
|
* @throws {HatchetError} - If no body is provided.
|
|
22
21
|
*/
|
|
23
|
-
handle(body: string | undefined,
|
|
22
|
+
handle(body: string | undefined, signature: string | string[] | undefined | null, secret: string | undefined): Promise<void>;
|
|
23
|
+
private checkSignature;
|
|
24
24
|
private getHealthcheckResponse;
|
|
25
25
|
/**
|
|
26
26
|
* Express Handler
|