@hatchet-dev/typescript-sdk 1.9.3 → 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.
@@ -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, V1CancelledTasks, V1CancelTaskRequest, V1CELDebugRequest, V1CELDebugResponse, V1CreateFilterRequest, V1DagChildren, V1EventList, V1Filter, V1FilterList, V1LogLineList, V1ReplayedTasks, 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
  /**
@@ -403,6 +403,72 @@ 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>>;
406
472
  /**
407
473
  * @description Evaluate a CEL expression against provided input data.
408
474
  *
@@ -234,6 +234,54 @@ 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));
237
285
  /**
238
286
  * @description Evaluate a CEL expression against provided input data.
239
287
  *
@@ -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;
@@ -1761,6 +1790,45 @@ export interface V1CreateFilterRequest {
1761
1790
  /** The payload for the filter */
1762
1791
  payload?: object;
1763
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
+ };
1764
1832
  export interface V1UpdateFilterRequest {
1765
1833
  /** The expression for the filter */
1766
1834
  expression?: string;
@@ -11,7 +11,7 @@
11
11
  * ---------------------------------------------------------------
12
12
  */
13
13
  Object.defineProperty(exports, "__esModule", { value: true });
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.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";
@@ -23,25 +23,25 @@ class PinoLogger {
23
23
  this.context = context;
24
24
  }
25
25
  debug(message, extra) {
26
- logger.debug(message, extra);
26
+ logger.debug(extra, message);
27
27
  }
28
28
  info(message, extra) {
29
- logger.info(message, extra);
29
+ logger.info(extra, message);
30
30
  }
31
31
  green(message, extra) {
32
- logger.info(`%c${message}`, extra);
32
+ logger.info(extra, `%c${message}`);
33
33
  }
34
34
  warn(message, error, extra) {
35
- logger.warn(`${message} ${error}`, extra);
35
+ logger.warn(extra, `${message} ${error}`);
36
36
  }
37
37
  error(message, error, extra) {
38
- logger.error(`${message} ${error}`, extra);
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', extra);
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",
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.6.0",
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.8.4",
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/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const HATCHET_VERSION = "1.9.3";
1
+ export declare const HATCHET_VERSION = "1.9.4";
package/version.js CHANGED
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.HATCHET_VERSION = void 0;
4
- exports.HATCHET_VERSION = '1.9.3';
4
+ exports.HATCHET_VERSION = '1.9.4';