@hatchet-dev/typescript-sdk 0.9.0 → 0.10.0

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.
@@ -4,7 +4,7 @@ import { ClientConfig } from '../hatchet-client/client-config';
4
4
  import { Logger } from '../../util/logger';
5
5
  import WorkflowRunRef from '../../util/workflow-run-ref';
6
6
  import { Api } from '../rest';
7
- import { WorkflowRunStatus, WorkflowRunStatusList } from '../rest/generated/data-contracts';
7
+ import { WebhookWorkerCreateRequest, WorkflowRunStatus, WorkflowRunStatusList } from '../rest/generated/data-contracts';
8
8
  import { ListenerClient } from '../listener/listener-client';
9
9
  type WorkflowMetricsQuery = {
10
10
  workflowId?: string;
@@ -51,6 +51,7 @@ export declare class AdminClient {
51
51
  */
52
52
  put_rate_limit(key: string, limit: number, duration: RateLimitDuration): Promise<void>;
53
53
  putRateLimit(key: string, limit: number, duration?: RateLimitDuration): Promise<void>;
54
+ registerWebhook(data: WebhookWorkerCreateRequest): Promise<import("axios").AxiosResponse<import("../rest/generated/data-contracts").WebhookWorkerCreated, any>>;
54
55
  /**
55
56
  * @deprecated use runWorkflow instead
56
57
  */
@@ -90,6 +90,11 @@ class AdminClient {
90
90
  }
91
91
  });
92
92
  }
93
+ registerWebhook(data) {
94
+ return __awaiter(this, void 0, void 0, function* () {
95
+ return this.api.webhookCreate(this.tenantId, data);
96
+ });
97
+ }
93
98
  /**
94
99
  * @deprecated use runWorkflow instead
95
100
  */
@@ -29,4 +29,5 @@ export declare class HatchetClient {
29
29
  static init(config?: Partial<ClientConfig>, options?: HatchetClientOptions, axiosConfig?: AxiosRequestConfig): HatchetClient;
30
30
  run(workflow: string | Workflow): Promise<Worker>;
31
31
  worker(workflow: string | Workflow, maxRuns?: number): Promise<Worker>;
32
+ webhooks(workflows: Workflow[]): import("../worker/handler").WebhookHandler;
32
33
  }
@@ -142,5 +142,11 @@ class HatchetClient {
142
142
  return worker;
143
143
  });
144
144
  }
145
+ webhooks(workflows) {
146
+ const worker = new worker_1.Worker(this, {
147
+ name: 'webhook-worker',
148
+ });
149
+ return worker.getHandler(workflows);
150
+ }
145
151
  }
146
152
  exports.HatchetClient = HatchetClient;
@@ -1,4 +1,4 @@
1
- import { APIMeta, AcceptInviteRequest, CreateAPITokenRequest, CreateAPITokenResponse, CreatePullRequestFromStepRun, CreateSNSIntegrationRequest, CreateTenantAlertEmailGroupRequest, CreateTenantInviteRequest, CreateTenantRequest, EventData, EventKey, EventKeyList, EventList, EventOrderByDirection, EventOrderByField, EventSearch, GetStepRunDiffResponse, LinkGithubRepositoryRequest, ListAPIMetaIntegration, ListAPITokensResponse, ListGithubAppInstallationsResponse, ListGithubBranchesResponse, ListGithubReposResponse, ListPullRequestsResponse, ListSNSIntegrations, ListSlackWebhooks, LogLineLevelField, LogLineList, LogLineOrderByDirection, LogLineOrderByField, LogLineSearch, PullRequestState, RejectInviteRequest, ReplayEventRequest, RerunStepRunRequest, SNSIntegration, StepRun, StepRunEventList, Tenant, TenantAlertEmailGroup, TenantAlertEmailGroupList, TenantAlertingSettings, TenantInvite, TenantInviteList, TenantMember, TenantMemberList, TenantResourcePolicy, TriggerWorkflowRunRequest, UpdateTenantAlertEmailGroupRequest, UpdateTenantInviteRequest, UpdateTenantRequest, User, UserChangePasswordRequest, UserLoginRequest, UserRegisterRequest, UserTenantMembershipsList, Worker, WorkerList, Workflow, WorkflowID, WorkflowList, WorkflowMetrics, WorkflowRun, WorkflowRunList, WorkflowRunStatus, WorkflowRunStatusList, WorkflowRunsCancelRequest, WorkflowRunsMetrics, WorkflowVersion, WorkflowVersionDefinition } from './data-contracts';
1
+ import { AcceptInviteRequest, APIErrors, 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, StepRunArchiveList, 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
  /**
@@ -28,6 +28,15 @@ export declare class Api<SecurityDataType = unknown> extends HttpClient<Security
28
28
  * @request GET:/api/v1/meta
29
29
  */
30
30
  metadataGet: (params?: RequestParams) => Promise<import("axios").AxiosResponse<APIMeta, any>>;
31
+ /**
32
+ * @description Gets metadata for the Hatchet cloud instance
33
+ *
34
+ * @tags Metadata
35
+ * @name CloudMetadataGet
36
+ * @summary Get cloud metadata
37
+ * @request GET:/api/v1/cloud/metadata
38
+ */
39
+ cloudMetadataGet: (params?: RequestParams) => Promise<import("axios").AxiosResponse<APIErrors, any>>;
31
40
  /**
32
41
  * @description List all integrations
33
42
  *
@@ -83,26 +92,6 @@ export declare class Api<SecurityDataType = unknown> extends HttpClient<Security
83
92
  * @request GET:/api/v1/users/github/callback
84
93
  */
85
94
  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
95
  /**
107
96
  * @description Starts the OAuth flow
108
97
  *
@@ -123,24 +112,6 @@ export declare class Api<SecurityDataType = unknown> extends HttpClient<Security
123
112
  * @secure
124
113
  */
125
114
  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
115
  /**
145
116
  * @description SNS event
146
117
  *
@@ -427,6 +398,24 @@ export declare class Api<SecurityDataType = unknown> extends HttpClient<Security
427
398
  * @secure
428
399
  */
429
400
  apiTokenUpdateRevoke: (apiToken: string, params?: RequestParams) => Promise<import("axios").AxiosResponse<void, any>>;
401
+ /**
402
+ * @description Get the queue metrics for the tenant
403
+ *
404
+ * @tags Workflow
405
+ * @name TenantGetQueueMetrics
406
+ * @summary Get workflow metrics
407
+ * @request GET:/api/v1/tenants/{tenant}/queue-metrics
408
+ * @secure
409
+ */
410
+ tenantGetQueueMetrics: (tenant: string, query?: {
411
+ /** A list of workflow IDs to filter by */
412
+ workflows?: WorkflowID[];
413
+ /**
414
+ * A list of metadata key value pairs to filter by
415
+ * @example ["key1:value1","key2:value2"]
416
+ */
417
+ additionalMetadata?: string[];
418
+ }, params?: RequestParams) => Promise<import("axios").AxiosResponse<TenantQueueMetrics, any>>;
430
419
  /**
431
420
  * @description Lists all events for a tenant.
432
421
  *
@@ -465,6 +454,16 @@ export declare class Api<SecurityDataType = unknown> extends HttpClient<Security
465
454
  */
466
455
  additionalMetadata?: string[];
467
456
  }, params?: RequestParams) => Promise<import("axios").AxiosResponse<EventList, any>>;
457
+ /**
458
+ * @description Creates a new event.
459
+ *
460
+ * @tags Event
461
+ * @name EventCreate
462
+ * @summary Create event
463
+ * @request POST:/api/v1/tenants/{tenant}/events
464
+ * @secure
465
+ */
466
+ eventCreate: (tenant: string, data: CreateEventRequest, params?: RequestParams) => Promise<import("axios").AxiosResponse<Event, any>>;
468
467
  /**
469
468
  * @description Replays a list of events.
470
469
  *
@@ -611,16 +610,6 @@ export declare class Api<SecurityDataType = unknown> extends HttpClient<Security
611
610
  */
612
611
  version?: string;
613
612
  }, 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
613
  /**
625
614
  * @description Get the metrics for a workflow version
626
615
  *
@@ -631,21 +620,11 @@ export declare class Api<SecurityDataType = unknown> extends HttpClient<Security
631
620
  * @secure
632
621
  */
633
622
  workflowGetMetrics: (workflow: string, query?: {
634
- /** A status of workflow runs to filter by */
623
+ /** A status of workflow run statuses to filter by */
635
624
  status?: WorkflowRunStatus;
636
625
  /** A group key to filter metrics by */
637
626
  groupKey?: string;
638
627
  }, 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
628
  /**
650
629
  * @description Lists log lines for a step run.
651
630
  *
@@ -675,16 +654,6 @@ export declare class Api<SecurityDataType = unknown> extends HttpClient<Security
675
654
  /** The order direction */
676
655
  orderByDirection?: LogLineOrderByDirection;
677
656
  }, 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
657
  /**
689
658
  * @description List events for a step run
690
659
  *
@@ -706,6 +675,27 @@ export declare class Api<SecurityDataType = unknown> extends HttpClient<Security
706
675
  */
707
676
  limit?: number;
708
677
  }, params?: RequestParams) => Promise<import("axios").AxiosResponse<StepRunEventList, any>>;
678
+ /**
679
+ * @description List archives for a step run
680
+ *
681
+ * @tags Step Run
682
+ * @name StepRunListArchives
683
+ * @summary List archives for step run
684
+ * @request GET:/api/v1/step-runs/{step-run}/archives
685
+ * @secure
686
+ */
687
+ stepRunListArchives: (stepRun: string, query?: {
688
+ /**
689
+ * The number to skip
690
+ * @format int64
691
+ */
692
+ offset?: number;
693
+ /**
694
+ * The number to limit by
695
+ * @format int64
696
+ */
697
+ limit?: number;
698
+ }, params?: RequestParams) => Promise<import("axios").AxiosResponse<StepRunArchiveList, any>>;
709
699
  /**
710
700
  * @description Get all workflow runs for a tenant
711
701
  *
@@ -816,19 +806,6 @@ export declare class Api<SecurityDataType = unknown> extends HttpClient<Security
816
806
  * @secure
817
807
  */
818
808
  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
809
  /**
833
810
  * @description Get a step run by id
834
811
  *
@@ -890,33 +867,30 @@ export declare class Api<SecurityDataType = unknown> extends HttpClient<Security
890
867
  */
891
868
  workerGet: (worker: string, params?: RequestParams) => Promise<import("axios").AxiosResponse<Worker, any>>;
892
869
  /**
893
- * @description List Github App installations
870
+ * @description Lists all webhooks
894
871
  *
895
- * @tags Github
896
- * @name GithubAppListInstallations
897
- * @summary List Github App installations
898
- * @request GET:/api/v1/github-app/installations
872
+ * @name WebhookList
873
+ * @summary List webhooks
874
+ * @request GET:/api/v1/tenants/{tenant}/webhook-workers
899
875
  * @secure
900
876
  */
901
- githubAppListInstallations: (params?: RequestParams) => Promise<import("axios").AxiosResponse<ListGithubAppInstallationsResponse, any>>;
877
+ webhookList: (tenant: string, params?: RequestParams) => Promise<import("axios").AxiosResponse<WebhookWorkerListResponse, any>>;
902
878
  /**
903
- * @description List Github App repositories
879
+ * @description Creates a webhook
904
880
  *
905
- * @tags Github
906
- * @name GithubAppListRepos
907
- * @summary List Github App repositories
908
- * @request GET:/api/v1/github-app/installations/{gh-installation}/repos
881
+ * @name WebhookCreate
882
+ * @summary Create a webhook
883
+ * @request POST:/api/v1/tenants/{tenant}/webhook-workers
909
884
  * @secure
910
885
  */
911
- githubAppListRepos: (ghInstallation: string, params?: RequestParams) => Promise<import("axios").AxiosResponse<ListGithubReposResponse, any>>;
886
+ webhookCreate: (tenant: string, data: WebhookWorkerCreateRequest, params?: RequestParams) => Promise<import("axios").AxiosResponse<WebhookWorkerCreated, any>>;
912
887
  /**
913
- * @description List Github App branches
888
+ * @description Deletes a webhook
914
889
  *
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
890
+ * @name WebhookDelete
891
+ * @summary Delete a webhook
892
+ * @request DELETE:/api/v1/webhook-workers/{webhook}
919
893
  * @secure
920
894
  */
921
- githubAppListBranches: (ghInstallation: string, ghRepoOwner: string, ghRepoName: string, params?: RequestParams) => Promise<import("axios").AxiosResponse<ListGithubBranchesResponse, any>>;
895
+ webhookDelete: (webhook: string, params?: RequestParams) => Promise<import("axios").AxiosResponse<void, any>>;
922
896
  }
@@ -42,6 +42,15 @@ class Api extends http_client_1.HttpClient {
42
42
  * @request GET:/api/v1/meta
43
43
  */
44
44
  this.metadataGet = (params = {}) => this.request(Object.assign({ path: `/api/v1/meta`, method: 'GET', format: 'json' }, params));
45
+ /**
46
+ * @description Gets metadata for the Hatchet cloud instance
47
+ *
48
+ * @tags Metadata
49
+ * @name CloudMetadataGet
50
+ * @summary Get cloud metadata
51
+ * @request GET:/api/v1/cloud/metadata
52
+ */
53
+ this.cloudMetadataGet = (params = {}) => this.request(Object.assign({ path: `/api/v1/cloud/metadata`, method: 'GET', format: 'json' }, params));
45
54
  /**
46
55
  * @description List all integrations
47
56
  *
@@ -97,26 +106,6 @@ class Api extends http_client_1.HttpClient {
97
106
  * @request GET:/api/v1/users/github/callback
98
107
  */
99
108
  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
109
  /**
121
110
  * @description Starts the OAuth flow
122
111
  *
@@ -137,24 +126,6 @@ class Api extends http_client_1.HttpClient {
137
126
  * @secure
138
127
  */
139
128
  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
129
  /**
159
130
  * @description SNS event
160
131
  *
@@ -441,6 +412,16 @@ class Api extends http_client_1.HttpClient {
441
412
  * @secure
442
413
  */
443
414
  this.apiTokenUpdateRevoke = (apiToken, params = {}) => this.request(Object.assign({ path: `/api/v1/api-tokens/${apiToken}`, method: 'POST', secure: true }, params));
415
+ /**
416
+ * @description Get the queue metrics for the tenant
417
+ *
418
+ * @tags Workflow
419
+ * @name TenantGetQueueMetrics
420
+ * @summary Get workflow metrics
421
+ * @request GET:/api/v1/tenants/{tenant}/queue-metrics
422
+ * @secure
423
+ */
424
+ 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
425
  /**
445
426
  * @description Lists all events for a tenant.
446
427
  *
@@ -451,6 +432,16 @@ class Api extends http_client_1.HttpClient {
451
432
  * @secure
452
433
  */
453
434
  this.eventList = (tenant, query, params = {}) => this.request(Object.assign({ path: `/api/v1/tenants/${tenant}/events`, method: 'GET', query: query, secure: true, format: 'json' }, params));
435
+ /**
436
+ * @description Creates a new event.
437
+ *
438
+ * @tags Event
439
+ * @name EventCreate
440
+ * @summary Create event
441
+ * @request POST:/api/v1/tenants/{tenant}/events
442
+ * @secure
443
+ */
444
+ 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
445
  /**
455
446
  * @description Replays a list of events.
456
447
  *
@@ -571,16 +562,6 @@ class Api extends http_client_1.HttpClient {
571
562
  * @secure
572
563
  */
573
564
  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
565
  /**
585
566
  * @description Get the metrics for a workflow version
586
567
  *
@@ -591,16 +572,6 @@ class Api extends http_client_1.HttpClient {
591
572
  * @secure
592
573
  */
593
574
  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
575
  /**
605
576
  * @description Lists log lines for a step run.
606
577
  *
@@ -611,16 +582,6 @@ class Api extends http_client_1.HttpClient {
611
582
  * @secure
612
583
  */
613
584
  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
585
  /**
625
586
  * @description List events for a step run
626
587
  *
@@ -631,6 +592,16 @@ class Api extends http_client_1.HttpClient {
631
592
  * @secure
632
593
  */
633
594
  this.stepRunListEvents = (stepRun, query, params = {}) => this.request(Object.assign({ path: `/api/v1/step-runs/${stepRun}/events`, method: 'GET', query: query, secure: true, format: 'json' }, params));
595
+ /**
596
+ * @description List archives for a step run
597
+ *
598
+ * @tags Step Run
599
+ * @name StepRunListArchives
600
+ * @summary List archives for step run
601
+ * @request GET:/api/v1/step-runs/{step-run}/archives
602
+ * @secure
603
+ */
604
+ this.stepRunListArchives = (stepRun, query, params = {}) => this.request(Object.assign({ path: `/api/v1/step-runs/${stepRun}/archives`, method: 'GET', query: query, secure: true, format: 'json' }, params));
634
605
  /**
635
606
  * @description Get all workflow runs for a tenant
636
607
  *
@@ -661,16 +632,6 @@ class Api extends http_client_1.HttpClient {
661
632
  * @secure
662
633
  */
663
634
  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
635
  /**
675
636
  * @description Get a step run by id
676
637
  *
@@ -732,35 +693,32 @@ class Api extends http_client_1.HttpClient {
732
693
  */
733
694
  this.workerGet = (worker, params = {}) => this.request(Object.assign({ path: `/api/v1/workers/${worker}`, method: 'GET', secure: true, format: 'json' }, params));
734
695
  /**
735
- * @description List Github App installations
696
+ * @description Lists all webhooks
736
697
  *
737
- * @tags Github
738
- * @name GithubAppListInstallations
739
- * @summary List Github App installations
740
- * @request GET:/api/v1/github-app/installations
698
+ * @name WebhookList
699
+ * @summary List webhooks
700
+ * @request GET:/api/v1/tenants/{tenant}/webhook-workers
741
701
  * @secure
742
702
  */
743
- this.githubAppListInstallations = (params = {}) => this.request(Object.assign({ path: `/api/v1/github-app/installations`, method: 'GET', secure: true, format: 'json' }, params));
703
+ this.webhookList = (tenant, params = {}) => this.request(Object.assign({ path: `/api/v1/tenants/${tenant}/webhook-workers`, method: 'GET', secure: true, format: 'json' }, params));
744
704
  /**
745
- * @description List Github App repositories
705
+ * @description Creates a webhook
746
706
  *
747
- * @tags Github
748
- * @name GithubAppListRepos
749
- * @summary List Github App repositories
750
- * @request GET:/api/v1/github-app/installations/{gh-installation}/repos
707
+ * @name WebhookCreate
708
+ * @summary Create a webhook
709
+ * @request POST:/api/v1/tenants/{tenant}/webhook-workers
751
710
  * @secure
752
711
  */
753
- this.githubAppListRepos = (ghInstallation, params = {}) => this.request(Object.assign({ path: `/api/v1/github-app/installations/${ghInstallation}/repos`, method: 'GET', secure: true, format: 'json' }, params));
712
+ 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));
754
713
  /**
755
- * @description List Github App branches
714
+ * @description Deletes a webhook
756
715
  *
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
716
+ * @name WebhookDelete
717
+ * @summary Delete a webhook
718
+ * @request DELETE:/api/v1/webhook-workers/{webhook}
761
719
  * @secure
762
720
  */
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));
721
+ this.webhookDelete = (webhook, params = {}) => this.request(Object.assign({ path: `/api/v1/webhook-workers/${webhook}`, method: 'DELETE', secure: true }, params));
764
722
  }
765
723
  }
766
724
  exports.Api = Api;