@hatchet-dev/typescript-sdk 1.9.2 → 1.9.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/rest/generated/Api.d.ts +89 -3
- package/clients/rest/generated/Api.js +70 -2
- package/clients/rest/generated/data-contracts.d.ts +105 -1
- package/clients/rest/generated/data-contracts.js +19 -1
- package/examples/byo-logger.js +6 -6
- package/package.json +3 -3
- package/v1/client/client.d.ts +7 -0
- package/v1/client/client.interface.d.ts +2 -0
- package/v1/client/client.js +11 -0
- package/v1/client/features/cel.d.ts +31 -0
- package/v1/client/features/cel.js +61 -0
- package/v1/client/features/runs.d.ts +2 -2
- package/version.d.ts +1 -1
- package/version.js +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AcceptInviteRequest, APIErrors, APIMeta, BulkCreateEventRequest, BulkCreateEventResponse, CancelEventRequest, CreateAPITokenRequest, CreateAPITokenResponse, CreateCronWorkflowTriggerRequest, CreateEventRequest, CreateSNSIntegrationRequest, CreateTenantAlertEmailGroupRequest, CreateTenantInviteRequest, CreateTenantRequest, CronWorkflows, CronWorkflowsList, CronWorkflowsOrderByField, Event, EventData, EventKey, EventKeyList, EventList, EventOrderByDirection, EventOrderByField, EventSearch, ListAPIMetaIntegration, ListAPITokensResponse, ListSlackWebhooks, ListSNSIntegrations, LogLineLevelField, LogLineList, LogLineOrderByDirection, LogLineOrderByField, LogLineSearch, RateLimitList, RateLimitOrderByDirection, RateLimitOrderByField, RejectInviteRequest, ReplayEventRequest, ReplayWorkflowRunsRequest, ReplayWorkflowRunsResponse, RerunStepRunRequest, ScheduledRunStatus, ScheduledWorkflows, ScheduledWorkflowsList, ScheduledWorkflowsOrderByField, ScheduleWorkflowRunRequest, SNSIntegration, StepRun, StepRunArchiveList, StepRunEventList, Tenant, TenantAlertEmailGroup, TenantAlertEmailGroupList, TenantAlertingSettings, TenantInvite, TenantInviteList, TenantMember, TenantMemberList, TenantQueueMetrics, TenantResourcePolicy, TenantStepRunQueueMetrics, TriggerWorkflowRunRequest, UpdateTenantAlertEmailGroupRequest, UpdateTenantInviteRequest, UpdateTenantRequest, UpdateWorkerRequest, User, UserChangePasswordRequest, UserLoginRequest, UserRegisterRequest, UserTenantMembershipsList, V1CancelTaskRequest, V1CreateFilterRequest, V1DagChildren, V1EventList, V1Filter, V1FilterList, V1LogLineList, V1ReplayTaskRequest, V1TaskEventList, V1TaskPointMetrics, V1TaskRunMetrics, V1TaskStatus, V1TaskSummary, V1TaskSummaryList, V1TaskTimingList, V1TriggerWorkflowRunRequest, V1UpdateFilterRequest, V1WorkflowRunDetails, V1WorkflowRunDisplayNameList, WebhookWorkerCreated, WebhookWorkerCreateRequest, WebhookWorkerListResponse, WebhookWorkerRequestListResponse, Worker, WorkerList, Workflow, WorkflowID, WorkflowKindList, WorkflowList, WorkflowMetrics, WorkflowRun, WorkflowRunList, WorkflowRunOrderByDirection, WorkflowRunOrderByField, WorkflowRunsCancelRequest, WorkflowRunShape, WorkflowRunsMetrics, WorkflowRunStatus, WorkflowRunStatusList, WorkflowUpdateRequest, WorkflowVersion, WorkflowWorkersCount } from './data-contracts';
|
|
1
|
+
import { AcceptInviteRequest, APIErrors, APIMeta, BulkCreateEventRequest, BulkCreateEventResponse, CancelEventRequest, CreateAPITokenRequest, CreateAPITokenResponse, CreateCronWorkflowTriggerRequest, CreateEventRequest, CreateSNSIntegrationRequest, CreateTenantAlertEmailGroupRequest, CreateTenantInviteRequest, CreateTenantRequest, CronWorkflows, CronWorkflowsList, CronWorkflowsOrderByField, Event, EventData, EventKey, EventKeyList, EventList, EventOrderByDirection, EventOrderByField, EventSearch, ListAPIMetaIntegration, ListAPITokensResponse, ListSlackWebhooks, ListSNSIntegrations, LogLineLevelField, LogLineList, LogLineOrderByDirection, LogLineOrderByField, LogLineSearch, RateLimitList, RateLimitOrderByDirection, RateLimitOrderByField, RejectInviteRequest, ReplayEventRequest, ReplayWorkflowRunsRequest, ReplayWorkflowRunsResponse, RerunStepRunRequest, ScheduledRunStatus, ScheduledWorkflows, ScheduledWorkflowsList, ScheduledWorkflowsOrderByField, ScheduleWorkflowRunRequest, SNSIntegration, StepRun, StepRunArchiveList, StepRunEventList, Tenant, TenantAlertEmailGroup, TenantAlertEmailGroupList, TenantAlertingSettings, TenantInvite, TenantInviteList, TenantMember, TenantMemberList, TenantQueueMetrics, TenantResourcePolicy, TenantStepRunQueueMetrics, TriggerWorkflowRunRequest, UpdateTenantAlertEmailGroupRequest, UpdateTenantInviteRequest, UpdateTenantRequest, UpdateWorkerRequest, User, UserChangePasswordRequest, UserLoginRequest, UserRegisterRequest, UserTenantMembershipsList, V1CancelledTasks, V1CancelTaskRequest, V1CELDebugRequest, V1CELDebugResponse, V1CreateFilterRequest, V1CreateWebhookRequest, V1DagChildren, V1EventList, V1Filter, V1FilterList, V1LogLineList, V1ReplayedTasks, V1ReplayTaskRequest, V1TaskEventList, V1TaskPointMetrics, V1TaskRunMetrics, V1TaskStatus, V1TaskSummary, V1TaskSummaryList, V1TaskTimingList, V1TriggerWorkflowRunRequest, V1UpdateFilterRequest, V1Webhook, V1WebhookList, V1WebhookSourceName, V1WorkflowRunDetails, V1WorkflowRunDisplayNameList, WebhookWorkerCreated, WebhookWorkerCreateRequest, WebhookWorkerListResponse, WebhookWorkerRequestListResponse, Worker, WorkerList, Workflow, WorkflowID, WorkflowKindList, WorkflowList, WorkflowMetrics, WorkflowRun, WorkflowRunList, WorkflowRunOrderByDirection, WorkflowRunOrderByField, WorkflowRunsCancelRequest, WorkflowRunShape, WorkflowRunsMetrics, WorkflowRunStatus, WorkflowRunStatusList, WorkflowUpdateRequest, WorkflowVersion, WorkflowWorkersCount } from './data-contracts';
|
|
2
2
|
import { HttpClient, RequestParams } from './http-client';
|
|
3
3
|
export declare class Api<SecurityDataType = unknown> extends HttpClient<SecurityDataType> {
|
|
4
4
|
/**
|
|
@@ -54,7 +54,7 @@ export declare class Api<SecurityDataType = unknown> extends HttpClient<Security
|
|
|
54
54
|
* @request POST:/api/v1/stable/tenants/{tenant}/tasks/cancel
|
|
55
55
|
* @secure
|
|
56
56
|
*/
|
|
57
|
-
v1TaskCancel: (tenant: string, data: V1CancelTaskRequest, params?: RequestParams) => Promise<import("axios").AxiosResponse<
|
|
57
|
+
v1TaskCancel: (tenant: string, data: V1CancelTaskRequest, params?: RequestParams) => Promise<import("axios").AxiosResponse<V1CancelledTasks, any>>;
|
|
58
58
|
/**
|
|
59
59
|
* @description Replay tasks
|
|
60
60
|
*
|
|
@@ -64,7 +64,7 @@ export declare class Api<SecurityDataType = unknown> extends HttpClient<Security
|
|
|
64
64
|
* @request POST:/api/v1/stable/tenants/{tenant}/tasks/replay
|
|
65
65
|
* @secure
|
|
66
66
|
*/
|
|
67
|
-
v1TaskReplay: (tenant: string, data: V1ReplayTaskRequest, params?: RequestParams) => Promise<import("axios").AxiosResponse<
|
|
67
|
+
v1TaskReplay: (tenant: string, data: V1ReplayTaskRequest, params?: RequestParams) => Promise<import("axios").AxiosResponse<V1ReplayedTasks, any>>;
|
|
68
68
|
/**
|
|
69
69
|
* @description Lists all tasks that belong a specific list of dags
|
|
70
70
|
*
|
|
@@ -403,6 +403,82 @@ export declare class Api<SecurityDataType = unknown> extends HttpClient<Security
|
|
|
403
403
|
* @secure
|
|
404
404
|
*/
|
|
405
405
|
v1FilterUpdate: (tenant: string, v1Filter: string, data: V1UpdateFilterRequest, params?: RequestParams) => Promise<import("axios").AxiosResponse<V1Filter, any>>;
|
|
406
|
+
/**
|
|
407
|
+
* @description Lists all webhook for a tenant.
|
|
408
|
+
*
|
|
409
|
+
* @tags Webhook
|
|
410
|
+
* @name V1WebhookList
|
|
411
|
+
* @summary List webhooks
|
|
412
|
+
* @request GET:/api/v1/stable/tenants/{tenant}/webhooks
|
|
413
|
+
* @secure
|
|
414
|
+
*/
|
|
415
|
+
v1WebhookList: (tenant: string, query?: {
|
|
416
|
+
/**
|
|
417
|
+
* The number to skip
|
|
418
|
+
* @format int64
|
|
419
|
+
*/
|
|
420
|
+
offset?: number;
|
|
421
|
+
/**
|
|
422
|
+
* The number to limit by
|
|
423
|
+
* @format int64
|
|
424
|
+
*/
|
|
425
|
+
limit?: number;
|
|
426
|
+
/** The source names to filter by */
|
|
427
|
+
sourceNames?: V1WebhookSourceName[];
|
|
428
|
+
/** The webhook names to filter by */
|
|
429
|
+
webhookNames?: string[];
|
|
430
|
+
}, params?: RequestParams) => Promise<import("axios").AxiosResponse<V1WebhookList, any>>;
|
|
431
|
+
/**
|
|
432
|
+
* @description Create a new webhook
|
|
433
|
+
*
|
|
434
|
+
* @tags Webhook
|
|
435
|
+
* @name V1WebhookCreate
|
|
436
|
+
* @summary Create a webhook
|
|
437
|
+
* @request POST:/api/v1/stable/tenants/{tenant}/webhooks
|
|
438
|
+
* @secure
|
|
439
|
+
*/
|
|
440
|
+
v1WebhookCreate: (tenant: string, data: V1CreateWebhookRequest, params?: RequestParams) => Promise<import("axios").AxiosResponse<V1Webhook, any>>;
|
|
441
|
+
/**
|
|
442
|
+
* @description Get a webhook by its name
|
|
443
|
+
*
|
|
444
|
+
* @tags Webhook
|
|
445
|
+
* @name V1WebhookGet
|
|
446
|
+
* @summary Get a webhook
|
|
447
|
+
* @request GET:/api/v1/stable/tenants/{tenant}/webhooks/{v1-webhook}
|
|
448
|
+
* @secure
|
|
449
|
+
*/
|
|
450
|
+
v1WebhookGet: (tenant: string, v1Webhook: string, params?: RequestParams) => Promise<import("axios").AxiosResponse<V1Webhook, any>>;
|
|
451
|
+
/**
|
|
452
|
+
* @description Delete a webhook
|
|
453
|
+
*
|
|
454
|
+
* @tags Webhook
|
|
455
|
+
* @name V1WebhookDelete
|
|
456
|
+
* @request DELETE:/api/v1/stable/tenants/{tenant}/webhooks/{v1-webhook}
|
|
457
|
+
* @secure
|
|
458
|
+
*/
|
|
459
|
+
v1WebhookDelete: (tenant: string, v1Webhook: string, params?: RequestParams) => Promise<import("axios").AxiosResponse<V1Webhook, any>>;
|
|
460
|
+
/**
|
|
461
|
+
* @description Post an incoming webhook message
|
|
462
|
+
*
|
|
463
|
+
* @tags Webhook
|
|
464
|
+
* @name V1WebhookReceive
|
|
465
|
+
* @summary Post a webhook message
|
|
466
|
+
* @request POST:/api/v1/stable/tenants/{tenant}/webhooks/{v1-webhook}
|
|
467
|
+
*/
|
|
468
|
+
v1WebhookReceive: (tenant: string, v1Webhook: string, data?: any, params?: RequestParams) => Promise<import("axios").AxiosResponse<{
|
|
469
|
+
/** @example "OK" */
|
|
470
|
+
message?: string;
|
|
471
|
+
}, any>>;
|
|
472
|
+
/**
|
|
473
|
+
* @description Evaluate a CEL expression against provided input data.
|
|
474
|
+
*
|
|
475
|
+
* @tags CEL
|
|
476
|
+
* @name V1CelDebug
|
|
477
|
+
* @summary Debug a CEL expression
|
|
478
|
+
* @request POST:/api/v1/stable/tenants/{tenant}/cel/debug
|
|
479
|
+
* @secure
|
|
480
|
+
*/
|
|
481
|
+
v1CelDebug: (tenant: string, data: V1CELDebugRequest, params?: RequestParams) => Promise<import("axios").AxiosResponse<V1CELDebugResponse, any>>;
|
|
406
482
|
/**
|
|
407
483
|
* @description Gets the readiness status
|
|
408
484
|
*
|
|
@@ -1674,4 +1750,14 @@ export declare class Api<SecurityDataType = unknown> extends HttpClient<Security
|
|
|
1674
1750
|
/** @example "1.0.0" */
|
|
1675
1751
|
version: string;
|
|
1676
1752
|
}, any>>;
|
|
1753
|
+
/**
|
|
1754
|
+
* @description Get the prometheus metrics for the tenant
|
|
1755
|
+
*
|
|
1756
|
+
* @tags Tenant
|
|
1757
|
+
* @name TenantGetPrometheusMetrics
|
|
1758
|
+
* @summary Get prometheus metrics
|
|
1759
|
+
* @request GET:/api/v1/tenants/{tenant}/prometheus-metrics
|
|
1760
|
+
* @secure
|
|
1761
|
+
*/
|
|
1762
|
+
tenantGetPrometheusMetrics: (tenant: string, params?: RequestParams) => Promise<import("axios").AxiosResponse<string, any>>;
|
|
1677
1763
|
}
|
|
@@ -55,7 +55,7 @@ class Api extends http_client_1.HttpClient {
|
|
|
55
55
|
* @request POST:/api/v1/stable/tenants/{tenant}/tasks/cancel
|
|
56
56
|
* @secure
|
|
57
57
|
*/
|
|
58
|
-
this.v1TaskCancel = (tenant, data, params = {}) => this.request(Object.assign({ path: `/api/v1/stable/tenants/${tenant}/tasks/cancel`, method: 'POST', body: data, secure: true, type: http_client_1.ContentType.Json }, params));
|
|
58
|
+
this.v1TaskCancel = (tenant, data, params = {}) => this.request(Object.assign({ path: `/api/v1/stable/tenants/${tenant}/tasks/cancel`, method: 'POST', body: data, secure: true, type: http_client_1.ContentType.Json, format: 'json' }, params));
|
|
59
59
|
/**
|
|
60
60
|
* @description Replay tasks
|
|
61
61
|
*
|
|
@@ -65,7 +65,7 @@ class Api extends http_client_1.HttpClient {
|
|
|
65
65
|
* @request POST:/api/v1/stable/tenants/{tenant}/tasks/replay
|
|
66
66
|
* @secure
|
|
67
67
|
*/
|
|
68
|
-
this.v1TaskReplay = (tenant, data, params = {}) => this.request(Object.assign({ path: `/api/v1/stable/tenants/${tenant}/tasks/replay`, method: 'POST', body: data, secure: true, type: http_client_1.ContentType.Json }, params));
|
|
68
|
+
this.v1TaskReplay = (tenant, data, params = {}) => this.request(Object.assign({ path: `/api/v1/stable/tenants/${tenant}/tasks/replay`, method: 'POST', body: data, secure: true, type: http_client_1.ContentType.Json, format: 'json' }, params));
|
|
69
69
|
/**
|
|
70
70
|
* @description Lists all tasks that belong a specific list of dags
|
|
71
71
|
*
|
|
@@ -234,6 +234,64 @@ class Api extends http_client_1.HttpClient {
|
|
|
234
234
|
* @secure
|
|
235
235
|
*/
|
|
236
236
|
this.v1FilterUpdate = (tenant, v1Filter, data, params = {}) => this.request(Object.assign({ path: `/api/v1/stable/tenants/${tenant}/filters/${v1Filter}`, method: 'PATCH', body: data, secure: true, type: http_client_1.ContentType.Json, format: 'json' }, params));
|
|
237
|
+
/**
|
|
238
|
+
* @description Lists all webhook for a tenant.
|
|
239
|
+
*
|
|
240
|
+
* @tags Webhook
|
|
241
|
+
* @name V1WebhookList
|
|
242
|
+
* @summary List webhooks
|
|
243
|
+
* @request GET:/api/v1/stable/tenants/{tenant}/webhooks
|
|
244
|
+
* @secure
|
|
245
|
+
*/
|
|
246
|
+
this.v1WebhookList = (tenant, query, params = {}) => this.request(Object.assign({ path: `/api/v1/stable/tenants/${tenant}/webhooks`, method: 'GET', query: query, secure: true, format: 'json' }, params));
|
|
247
|
+
/**
|
|
248
|
+
* @description Create a new webhook
|
|
249
|
+
*
|
|
250
|
+
* @tags Webhook
|
|
251
|
+
* @name V1WebhookCreate
|
|
252
|
+
* @summary Create a webhook
|
|
253
|
+
* @request POST:/api/v1/stable/tenants/{tenant}/webhooks
|
|
254
|
+
* @secure
|
|
255
|
+
*/
|
|
256
|
+
this.v1WebhookCreate = (tenant, data, params = {}) => this.request(Object.assign({ path: `/api/v1/stable/tenants/${tenant}/webhooks`, method: 'POST', body: data, secure: true, type: http_client_1.ContentType.Json, format: 'json' }, params));
|
|
257
|
+
/**
|
|
258
|
+
* @description Get a webhook by its name
|
|
259
|
+
*
|
|
260
|
+
* @tags Webhook
|
|
261
|
+
* @name V1WebhookGet
|
|
262
|
+
* @summary Get a webhook
|
|
263
|
+
* @request GET:/api/v1/stable/tenants/{tenant}/webhooks/{v1-webhook}
|
|
264
|
+
* @secure
|
|
265
|
+
*/
|
|
266
|
+
this.v1WebhookGet = (tenant, v1Webhook, params = {}) => this.request(Object.assign({ path: `/api/v1/stable/tenants/${tenant}/webhooks/${v1Webhook}`, method: 'GET', secure: true, format: 'json' }, params));
|
|
267
|
+
/**
|
|
268
|
+
* @description Delete a webhook
|
|
269
|
+
*
|
|
270
|
+
* @tags Webhook
|
|
271
|
+
* @name V1WebhookDelete
|
|
272
|
+
* @request DELETE:/api/v1/stable/tenants/{tenant}/webhooks/{v1-webhook}
|
|
273
|
+
* @secure
|
|
274
|
+
*/
|
|
275
|
+
this.v1WebhookDelete = (tenant, v1Webhook, params = {}) => this.request(Object.assign({ path: `/api/v1/stable/tenants/${tenant}/webhooks/${v1Webhook}`, method: 'DELETE', secure: true, format: 'json' }, params));
|
|
276
|
+
/**
|
|
277
|
+
* @description Post an incoming webhook message
|
|
278
|
+
*
|
|
279
|
+
* @tags Webhook
|
|
280
|
+
* @name V1WebhookReceive
|
|
281
|
+
* @summary Post a webhook message
|
|
282
|
+
* @request POST:/api/v1/stable/tenants/{tenant}/webhooks/{v1-webhook}
|
|
283
|
+
*/
|
|
284
|
+
this.v1WebhookReceive = (tenant, v1Webhook, data, params = {}) => this.request(Object.assign({ path: `/api/v1/stable/tenants/${tenant}/webhooks/${v1Webhook}`, method: 'POST', body: data, format: 'json' }, params));
|
|
285
|
+
/**
|
|
286
|
+
* @description Evaluate a CEL expression against provided input data.
|
|
287
|
+
*
|
|
288
|
+
* @tags CEL
|
|
289
|
+
* @name V1CelDebug
|
|
290
|
+
* @summary Debug a CEL expression
|
|
291
|
+
* @request POST:/api/v1/stable/tenants/{tenant}/cel/debug
|
|
292
|
+
* @secure
|
|
293
|
+
*/
|
|
294
|
+
this.v1CelDebug = (tenant, data, params = {}) => this.request(Object.assign({ path: `/api/v1/stable/tenants/${tenant}/cel/debug`, method: 'POST', body: data, secure: true, type: http_client_1.ContentType.Json, format: 'json' }, params));
|
|
237
295
|
/**
|
|
238
296
|
* @description Gets the readiness status
|
|
239
297
|
*
|
|
@@ -1164,6 +1222,16 @@ class Api extends http_client_1.HttpClient {
|
|
|
1164
1222
|
* @request GET:/api/v1/version
|
|
1165
1223
|
*/
|
|
1166
1224
|
this.infoGetVersion = (params = {}) => this.request(Object.assign({ path: `/api/v1/version`, method: 'GET', format: 'json' }, params));
|
|
1225
|
+
/**
|
|
1226
|
+
* @description Get the prometheus metrics for the tenant
|
|
1227
|
+
*
|
|
1228
|
+
* @tags Tenant
|
|
1229
|
+
* @name TenantGetPrometheusMetrics
|
|
1230
|
+
* @summary Get prometheus metrics
|
|
1231
|
+
* @request GET:/api/v1/tenants/{tenant}/prometheus-metrics
|
|
1232
|
+
* @secure
|
|
1233
|
+
*/
|
|
1234
|
+
this.tenantGetPrometheusMetrics = (tenant, params = {}) => this.request(Object.assign({ path: `/api/v1/tenants/${tenant}/prometheus-metrics`, method: 'GET', secure: true }, params));
|
|
1167
1235
|
}
|
|
1168
1236
|
}
|
|
1169
1237
|
exports.Api = Api;
|
|
@@ -531,6 +531,8 @@ export interface V1EventList {
|
|
|
531
531
|
*/
|
|
532
532
|
filterId?: string;
|
|
533
533
|
}[];
|
|
534
|
+
/** The name of the webhook that triggered this event, if applicable. */
|
|
535
|
+
triggeringWebhookName?: string;
|
|
534
536
|
}[];
|
|
535
537
|
}
|
|
536
538
|
export interface V1FilterList {
|
|
@@ -555,6 +557,33 @@ export interface V1Filter {
|
|
|
555
557
|
/** Additional payload data associated with the filter */
|
|
556
558
|
payload: object;
|
|
557
559
|
}
|
|
560
|
+
export interface V1WebhookList {
|
|
561
|
+
pagination?: PaginationResponse;
|
|
562
|
+
rows?: V1Webhook[];
|
|
563
|
+
}
|
|
564
|
+
export interface V1Webhook {
|
|
565
|
+
metadata: APIResourceMeta;
|
|
566
|
+
/** The ID of the tenant associated with this webhook. */
|
|
567
|
+
tenantId: string;
|
|
568
|
+
/** The name of the webhook */
|
|
569
|
+
name: string;
|
|
570
|
+
/** The name of the source for this webhook */
|
|
571
|
+
sourceName: V1WebhookSourceName;
|
|
572
|
+
/** The CEL expression to use for the event key. This is used to create the event key from the webhook payload. */
|
|
573
|
+
eventKeyExpression: string;
|
|
574
|
+
/** The type of authentication to use for the webhook */
|
|
575
|
+
authType: V1WebhookAuthType;
|
|
576
|
+
}
|
|
577
|
+
export declare enum V1WebhookSourceName {
|
|
578
|
+
GENERIC = "GENERIC",
|
|
579
|
+
GITHUB = "GITHUB",
|
|
580
|
+
STRIPE = "STRIPE"
|
|
581
|
+
}
|
|
582
|
+
export declare enum V1WebhookAuthType {
|
|
583
|
+
BASIC = "BASIC",
|
|
584
|
+
API_KEY = "API_KEY",
|
|
585
|
+
HMAC = "HMAC"
|
|
586
|
+
}
|
|
558
587
|
export interface RateLimit {
|
|
559
588
|
/** The key for the rate limit. */
|
|
560
589
|
key: string;
|
|
@@ -1092,7 +1121,7 @@ export interface SemaphoreSlots {
|
|
|
1092
1121
|
* @format uuid
|
|
1093
1122
|
*/
|
|
1094
1123
|
workflowRunId: string;
|
|
1095
|
-
status
|
|
1124
|
+
status?: StepRunStatus;
|
|
1096
1125
|
}
|
|
1097
1126
|
export interface RecentStepRuns {
|
|
1098
1127
|
metadata: APIResourceMeta;
|
|
@@ -1484,6 +1513,11 @@ export interface V1TaskSummary {
|
|
|
1484
1513
|
*/
|
|
1485
1514
|
workflowVersionId?: string;
|
|
1486
1515
|
workflowConfig?: object;
|
|
1516
|
+
/**
|
|
1517
|
+
* The external ID of the parent task.
|
|
1518
|
+
* @format uuid
|
|
1519
|
+
*/
|
|
1520
|
+
parentTaskExternalId?: string;
|
|
1487
1521
|
}
|
|
1488
1522
|
export interface V1DagChildren {
|
|
1489
1523
|
/** @format uuid */
|
|
@@ -1511,6 +1545,14 @@ export interface V1TaskEventList {
|
|
|
1511
1545
|
attempt?: number;
|
|
1512
1546
|
}[];
|
|
1513
1547
|
}
|
|
1548
|
+
export interface V1ReplayedTasks {
|
|
1549
|
+
/** The list of task external ids that were replayed */
|
|
1550
|
+
ids?: string[];
|
|
1551
|
+
}
|
|
1552
|
+
export interface V1CancelledTasks {
|
|
1553
|
+
/** The list of task external ids that were cancelled */
|
|
1554
|
+
ids?: string[];
|
|
1555
|
+
}
|
|
1514
1556
|
export declare enum V1TaskStatus {
|
|
1515
1557
|
QUEUED = "QUEUED",
|
|
1516
1558
|
RUNNING = "RUNNING",
|
|
@@ -1748,6 +1790,45 @@ export interface V1CreateFilterRequest {
|
|
|
1748
1790
|
/** The payload for the filter */
|
|
1749
1791
|
payload?: object;
|
|
1750
1792
|
}
|
|
1793
|
+
export type V1CreateWebhookRequest = ({
|
|
1794
|
+
/** The name of the source for this webhook */
|
|
1795
|
+
sourceName: V1WebhookSourceName;
|
|
1796
|
+
/** The name of the webhook */
|
|
1797
|
+
name: string;
|
|
1798
|
+
/** The CEL expression to use for the event key. This is used to create the event key from the webhook payload. */
|
|
1799
|
+
eventKeyExpression: string;
|
|
1800
|
+
} & {
|
|
1801
|
+
/** The type of authentication to use for the webhook */
|
|
1802
|
+
authType: 'BASIC';
|
|
1803
|
+
auth: {
|
|
1804
|
+
/** The username for basic auth */
|
|
1805
|
+
username: string;
|
|
1806
|
+
/** The password for basic auth */
|
|
1807
|
+
password: string;
|
|
1808
|
+
};
|
|
1809
|
+
}) | {
|
|
1810
|
+
/** The type of authentication to use for the webhook */
|
|
1811
|
+
authType: 'API_KEY';
|
|
1812
|
+
auth: {
|
|
1813
|
+
/** The name of the header to use for the API key */
|
|
1814
|
+
headerName: string;
|
|
1815
|
+
/** The API key to use for authentication */
|
|
1816
|
+
apiKey: string;
|
|
1817
|
+
};
|
|
1818
|
+
} | {
|
|
1819
|
+
/** The type of authentication to use for the webhook */
|
|
1820
|
+
authType: 'HMAC';
|
|
1821
|
+
auth: {
|
|
1822
|
+
/** The HMAC algorithm to use for the webhook */
|
|
1823
|
+
algorithm: 'SHA1' | 'SHA256' | 'SHA512' | 'MD5';
|
|
1824
|
+
/** The encoding to use for the HMAC signature */
|
|
1825
|
+
encoding: 'HEX' | 'BASE64' | 'BASE64URL';
|
|
1826
|
+
/** The name of the header to use for the HMAC signature */
|
|
1827
|
+
signatureHeaderName: string;
|
|
1828
|
+
/** The secret key used to sign the HMAC signature */
|
|
1829
|
+
signingSecret: string;
|
|
1830
|
+
};
|
|
1831
|
+
};
|
|
1751
1832
|
export interface V1UpdateFilterRequest {
|
|
1752
1833
|
/** The expression for the filter */
|
|
1753
1834
|
expression?: string;
|
|
@@ -1756,3 +1837,26 @@ export interface V1UpdateFilterRequest {
|
|
|
1756
1837
|
/** The payload for the filter */
|
|
1757
1838
|
payload?: object;
|
|
1758
1839
|
}
|
|
1840
|
+
export interface V1CELDebugRequest {
|
|
1841
|
+
/** The CEL expression to evaluate */
|
|
1842
|
+
expression: string;
|
|
1843
|
+
/** The input, which simulates the workflow run input */
|
|
1844
|
+
input: object;
|
|
1845
|
+
/** The filter payload, which simulates a payload set on a previous-created filter */
|
|
1846
|
+
filterPayload?: object;
|
|
1847
|
+
/** Additional metadata, which simulates metadata that could be sent with an event or a workflow run */
|
|
1848
|
+
additionalMetadata?: object;
|
|
1849
|
+
}
|
|
1850
|
+
export interface V1CELDebugResponse {
|
|
1851
|
+
/** The status of the CEL evaluation */
|
|
1852
|
+
status: V1CELDebugResponseStatus;
|
|
1853
|
+
/** The result of the CEL expression evaluation, if successful */
|
|
1854
|
+
output?: boolean;
|
|
1855
|
+
/** The error message if the evaluation failed */
|
|
1856
|
+
error?: string;
|
|
1857
|
+
}
|
|
1858
|
+
/** The status of the CEL evaluation */
|
|
1859
|
+
export declare enum V1CELDebugResponseStatus {
|
|
1860
|
+
SUCCESS = "SUCCESS",
|
|
1861
|
+
ERROR = "ERROR"
|
|
1862
|
+
}
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* ---------------------------------------------------------------
|
|
12
12
|
*/
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
-
exports.V1LogLineLevel = exports.V1TaskRunStatus = exports.V1TaskStatus = exports.WebhookWorkerRequestMethod = exports.LogLineOrderByDirection = exports.LogLineOrderByField = exports.LogLineLevel = exports.PullRequestState = exports.WorkerRuntimeSDKs = exports.StepRunEventSeverity = exports.StepRunEventReason = exports.StepRunStatus = exports.JobRunStatus = exports.WorkflowKind = exports.WorkflowRunStatus = exports.WorkflowRunOrderByDirection = exports.WorkflowRunOrderByField = exports.CronWorkflowsOrderByField = exports.ScheduledRunStatus = exports.ScheduledWorkflowsOrderByField = exports.RateLimitOrderByDirection = exports.RateLimitOrderByField = exports.EventOrderByDirection = exports.EventOrderByField = exports.TenantResource = exports.TenantMemberRole = void 0;
|
|
14
|
+
exports.V1CELDebugResponseStatus = exports.V1LogLineLevel = exports.V1TaskRunStatus = exports.V1TaskStatus = exports.WebhookWorkerRequestMethod = exports.LogLineOrderByDirection = exports.LogLineOrderByField = exports.LogLineLevel = exports.PullRequestState = exports.WorkerRuntimeSDKs = exports.StepRunEventSeverity = exports.StepRunEventReason = exports.StepRunStatus = exports.JobRunStatus = exports.WorkflowKind = exports.WorkflowRunStatus = exports.WorkflowRunOrderByDirection = exports.WorkflowRunOrderByField = exports.CronWorkflowsOrderByField = exports.ScheduledRunStatus = exports.ScheduledWorkflowsOrderByField = exports.RateLimitOrderByDirection = exports.RateLimitOrderByField = exports.V1WebhookAuthType = exports.V1WebhookSourceName = exports.EventOrderByDirection = exports.EventOrderByField = exports.TenantResource = exports.TenantMemberRole = void 0;
|
|
15
15
|
var TenantMemberRole;
|
|
16
16
|
(function (TenantMemberRole) {
|
|
17
17
|
TenantMemberRole["OWNER"] = "OWNER";
|
|
@@ -37,6 +37,18 @@ var EventOrderByDirection;
|
|
|
37
37
|
EventOrderByDirection["Asc"] = "asc";
|
|
38
38
|
EventOrderByDirection["Desc"] = "desc";
|
|
39
39
|
})(EventOrderByDirection || (exports.EventOrderByDirection = EventOrderByDirection = {}));
|
|
40
|
+
var V1WebhookSourceName;
|
|
41
|
+
(function (V1WebhookSourceName) {
|
|
42
|
+
V1WebhookSourceName["GENERIC"] = "GENERIC";
|
|
43
|
+
V1WebhookSourceName["GITHUB"] = "GITHUB";
|
|
44
|
+
V1WebhookSourceName["STRIPE"] = "STRIPE";
|
|
45
|
+
})(V1WebhookSourceName || (exports.V1WebhookSourceName = V1WebhookSourceName = {}));
|
|
46
|
+
var V1WebhookAuthType;
|
|
47
|
+
(function (V1WebhookAuthType) {
|
|
48
|
+
V1WebhookAuthType["BASIC"] = "BASIC";
|
|
49
|
+
V1WebhookAuthType["API_KEY"] = "API_KEY";
|
|
50
|
+
V1WebhookAuthType["HMAC"] = "HMAC";
|
|
51
|
+
})(V1WebhookAuthType || (exports.V1WebhookAuthType = V1WebhookAuthType = {}));
|
|
40
52
|
var RateLimitOrderByField;
|
|
41
53
|
(function (RateLimitOrderByField) {
|
|
42
54
|
RateLimitOrderByField["Key"] = "key";
|
|
@@ -199,3 +211,9 @@ var V1LogLineLevel;
|
|
|
199
211
|
V1LogLineLevel["WARN"] = "WARN";
|
|
200
212
|
V1LogLineLevel["ERROR"] = "ERROR";
|
|
201
213
|
})(V1LogLineLevel || (exports.V1LogLineLevel = V1LogLineLevel = {}));
|
|
214
|
+
/** The status of the CEL evaluation */
|
|
215
|
+
var V1CELDebugResponseStatus;
|
|
216
|
+
(function (V1CELDebugResponseStatus) {
|
|
217
|
+
V1CELDebugResponseStatus["SUCCESS"] = "SUCCESS";
|
|
218
|
+
V1CELDebugResponseStatus["ERROR"] = "ERROR";
|
|
219
|
+
})(V1CELDebugResponseStatus || (exports.V1CELDebugResponseStatus = V1CELDebugResponseStatus = {}));
|
package/examples/byo-logger.js
CHANGED
|
@@ -23,25 +23,25 @@ class PinoLogger {
|
|
|
23
23
|
this.context = context;
|
|
24
24
|
}
|
|
25
25
|
debug(message, extra) {
|
|
26
|
-
logger.debug(
|
|
26
|
+
logger.debug(extra, message);
|
|
27
27
|
}
|
|
28
28
|
info(message, extra) {
|
|
29
|
-
logger.info(
|
|
29
|
+
logger.info(extra, message);
|
|
30
30
|
}
|
|
31
31
|
green(message, extra) {
|
|
32
|
-
logger.info(`%c${message}
|
|
32
|
+
logger.info(extra, `%c${message}`);
|
|
33
33
|
}
|
|
34
34
|
warn(message, error, extra) {
|
|
35
|
-
logger.warn(`${message} ${error}
|
|
35
|
+
logger.warn(extra, `${message} ${error}`);
|
|
36
36
|
}
|
|
37
37
|
error(message, error, extra) {
|
|
38
|
-
logger.error(`${message} ${error}
|
|
38
|
+
logger.error(extra, `${message} ${error}`);
|
|
39
39
|
}
|
|
40
40
|
// optional util method
|
|
41
41
|
util(key, message, extra) {
|
|
42
42
|
// for example you may want to expose a trace method
|
|
43
43
|
if (key === 'trace') {
|
|
44
|
-
logger.info('trace'
|
|
44
|
+
logger.info(extra, 'trace');
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hatchet-dev/typescript-sdk",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.4",
|
|
4
4
|
"description": "Background task orchestration & visibility for developers",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"grpc-tools": "^1.13.0",
|
|
68
68
|
"jest": "^29.7.0",
|
|
69
69
|
"jest-tsd": "^0.2.2",
|
|
70
|
-
"pino": "^9.
|
|
70
|
+
"pino": "^9.8.0",
|
|
71
71
|
"prettier": "^3.5.3",
|
|
72
72
|
"resolve-tspaths": "^0.8.23",
|
|
73
73
|
"ts-jest": "^29.3.1",
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
"@bufbuild/protobuf": "^2.2.5",
|
|
82
82
|
"@types/qs": "^6.9.18",
|
|
83
83
|
"abort-controller-x": "^0.4.3",
|
|
84
|
-
"axios": "^1.
|
|
84
|
+
"axios": "^1.11.0",
|
|
85
85
|
"long": "^5.3.1",
|
|
86
86
|
"nice-grpc": "^2.1.12",
|
|
87
87
|
"nice-grpc-common": "^2.0.2",
|
package/v1/client/client.d.ts
CHANGED
|
@@ -18,6 +18,7 @@ import { AdminClient } from './admin';
|
|
|
18
18
|
import { FiltersClient } from './features/filters';
|
|
19
19
|
import { ScheduleClient } from './features/schedules';
|
|
20
20
|
import { CronClient } from './features/crons';
|
|
21
|
+
import { CELClient } from './features/cel';
|
|
21
22
|
import { TenantClient } from './features/tenant';
|
|
22
23
|
/**
|
|
23
24
|
* HatchetV1 implements the main client interface for interacting with the Hatchet workflow engine.
|
|
@@ -129,6 +130,12 @@ export declare class HatchetClient implements IHatchetClient {
|
|
|
129
130
|
* @returns A promise that resolves with the workflow result
|
|
130
131
|
*/
|
|
131
132
|
run<I extends InputType = UnknownInputType, O extends OutputType = void>(workflow: BaseWorkflowDeclaration<I, O> | string | V0Workflow, input: I, options?: RunOpts): Promise<O>;
|
|
133
|
+
private _cel;
|
|
134
|
+
/**
|
|
135
|
+
* Get the CEL client for debugging CEL expressions
|
|
136
|
+
* @returns A CEL client instance
|
|
137
|
+
*/
|
|
138
|
+
get cel(): CELClient;
|
|
132
139
|
private _crons;
|
|
133
140
|
/**
|
|
134
141
|
* Get the cron client for creating and managing cron workflow runs
|
|
@@ -6,8 +6,10 @@ import { WorkflowsClient } from './features/workflows';
|
|
|
6
6
|
import { AdminClient } from './admin';
|
|
7
7
|
import { ScheduleClient } from './features/schedules';
|
|
8
8
|
import { CronClient } from './features/crons';
|
|
9
|
+
import { CELClient } from './features/cel';
|
|
9
10
|
export interface IHatchetClient {
|
|
10
11
|
_v0: LegacyHatchetClient;
|
|
12
|
+
cel: CELClient;
|
|
11
13
|
metrics: MetricsClient;
|
|
12
14
|
runs: RunsClient;
|
|
13
15
|
workflows: WorkflowsClient;
|
package/v1/client/client.js
CHANGED
|
@@ -35,6 +35,7 @@ const admin_1 = require("./admin");
|
|
|
35
35
|
const filters_1 = require("./features/filters");
|
|
36
36
|
const schedules_1 = require("./features/schedules");
|
|
37
37
|
const crons_1 = require("./features/crons");
|
|
38
|
+
const cel_1 = require("./features/cel");
|
|
38
39
|
const tenant_1 = require("./features/tenant");
|
|
39
40
|
/**
|
|
40
41
|
* HatchetV1 implements the main client interface for interacting with the Hatchet workflow engine.
|
|
@@ -191,6 +192,16 @@ class HatchetClient {
|
|
|
191
192
|
return run.output;
|
|
192
193
|
});
|
|
193
194
|
}
|
|
195
|
+
/**
|
|
196
|
+
* Get the CEL client for debugging CEL expressions
|
|
197
|
+
* @returns A CEL client instance
|
|
198
|
+
*/
|
|
199
|
+
get cel() {
|
|
200
|
+
if (!this._cel) {
|
|
201
|
+
this._cel = new cel_1.CELClient(this);
|
|
202
|
+
}
|
|
203
|
+
return this._cel;
|
|
204
|
+
}
|
|
194
205
|
/**
|
|
195
206
|
* Get the cron client for creating and managing cron workflow runs
|
|
196
207
|
* @returns A cron client instance
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { V1CELDebugResponseStatus } from '../../../clients/rest/generated/data-contracts';
|
|
2
|
+
import { HatchetClient } from '../client';
|
|
3
|
+
export type DebugCELInput = {
|
|
4
|
+
expression: string;
|
|
5
|
+
input: Record<string, any>;
|
|
6
|
+
additionalMetadata?: Record<string, string>;
|
|
7
|
+
filterPayload?: Record<string, any>;
|
|
8
|
+
};
|
|
9
|
+
export type CELEvaluationResult = {
|
|
10
|
+
status: V1CELDebugResponseStatus.SUCCESS;
|
|
11
|
+
output: boolean;
|
|
12
|
+
} | {
|
|
13
|
+
status: V1CELDebugResponseStatus.ERROR;
|
|
14
|
+
error: string;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Client for debugging CEL expressions.
|
|
18
|
+
*/
|
|
19
|
+
export declare class CELClient {
|
|
20
|
+
api: HatchetClient['api'];
|
|
21
|
+
tenantId: string;
|
|
22
|
+
constructor(client: HatchetClient);
|
|
23
|
+
/**
|
|
24
|
+
* Debug a CEL expression with the provided input, filter payload, and optional metadata. Useful for testing and validating CEL expressions and debugging issues in production.
|
|
25
|
+
*
|
|
26
|
+
* @param input - The input data to evaluate the CEL expression against.
|
|
27
|
+
* @returns A promise that resolves to the evaluation result, which can either be a success with an output or an error with a message.
|
|
28
|
+
* @throws Will throw an error if the input is invalid or the API call fails.
|
|
29
|
+
*/
|
|
30
|
+
debug(input: DebugCELInput): Promise<CELEvaluationResult>;
|
|
31
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.CELClient = void 0;
|
|
13
|
+
const axios_1 = require("axios");
|
|
14
|
+
const data_contracts_1 = require("../../../clients/rest/generated/data-contracts");
|
|
15
|
+
/**
|
|
16
|
+
* Client for debugging CEL expressions.
|
|
17
|
+
*/
|
|
18
|
+
class CELClient {
|
|
19
|
+
constructor(client) {
|
|
20
|
+
this.api = client.api;
|
|
21
|
+
this.tenantId = client.tenantId;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Debug a CEL expression with the provided input, filter payload, and optional metadata. Useful for testing and validating CEL expressions and debugging issues in production.
|
|
25
|
+
*
|
|
26
|
+
* @param input - The input data to evaluate the CEL expression against.
|
|
27
|
+
* @returns A promise that resolves to the evaluation result, which can either be a success with an output or an error with a message.
|
|
28
|
+
* @throws Will throw an error if the input is invalid or the API call fails.
|
|
29
|
+
*/
|
|
30
|
+
debug(input) {
|
|
31
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
32
|
+
var _a;
|
|
33
|
+
try {
|
|
34
|
+
const response = yield this.api.v1CelDebug(this.tenantId, input);
|
|
35
|
+
if (response.data.status === data_contracts_1.V1CELDebugResponseStatus.ERROR) {
|
|
36
|
+
if (!response.data.error) {
|
|
37
|
+
throw new Error('No error message received from CEL debug API.');
|
|
38
|
+
}
|
|
39
|
+
return {
|
|
40
|
+
status: data_contracts_1.V1CELDebugResponseStatus.ERROR,
|
|
41
|
+
error: response.data.error,
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
if (response.data.output === undefined) {
|
|
45
|
+
throw new Error('No output received from CEL debug API.');
|
|
46
|
+
}
|
|
47
|
+
return {
|
|
48
|
+
status: data_contracts_1.V1CELDebugResponseStatus.SUCCESS,
|
|
49
|
+
output: response.data.output,
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
catch (err) {
|
|
53
|
+
if (err instanceof axios_1.AxiosError) {
|
|
54
|
+
throw new Error(JSON.stringify((_a = err.response) === null || _a === void 0 ? void 0 : _a.data.errors));
|
|
55
|
+
}
|
|
56
|
+
throw err;
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
exports.CELClient = CELClient;
|
|
@@ -68,8 +68,8 @@ export declare class RunsClient {
|
|
|
68
68
|
get<T = any>(run: string | WorkflowRunRef<T>): Promise<import("../../../clients/rest/generated/data-contracts").V1WorkflowRunDetails>;
|
|
69
69
|
get_status<T = any>(run: string | WorkflowRunRef<T>): Promise<V1TaskStatus>;
|
|
70
70
|
list(opts?: Partial<ListRunsOpts>): Promise<import("../../../clients/rest/generated/data-contracts").V1TaskSummaryList>;
|
|
71
|
-
cancel(opts: CancelRunOpts): Promise<import("axios").AxiosResponse<
|
|
72
|
-
replay(opts: ReplayRunOpts): Promise<import("axios").AxiosResponse<
|
|
71
|
+
cancel(opts: CancelRunOpts): Promise<import("axios").AxiosResponse<import("../../../clients/rest/generated/data-contracts").V1CancelledTasks, any>>;
|
|
72
|
+
replay(opts: ReplayRunOpts): Promise<import("axios").AxiosResponse<import("../../../clients/rest/generated/data-contracts").V1ReplayedTasks, any>>;
|
|
73
73
|
private prepareFilter;
|
|
74
74
|
private prepareListFilter;
|
|
75
75
|
runRef<T extends Record<string, any> = any>(id: string): WorkflowRunRef<T>;
|
package/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const HATCHET_VERSION = "1.9.
|
|
1
|
+
export declare const HATCHET_VERSION = "1.9.4";
|
package/version.js
CHANGED