@hatchet-dev/typescript-sdk 1.26.0 → 1.26.1
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/dispatcher/action-listener.d.ts +1 -0
- package/clients/dispatcher/action-listener.js +5 -0
- package/clients/rest/generated/Api.d.ts +77 -3
- package/clients/rest/generated/Api.js +42 -2
- package/clients/rest/generated/data-contracts.d.ts +126 -2
- package/clients/rest/generated/data-contracts.js +26 -1
- package/opentelemetry/instrumentor.js +2 -1
- package/package.json +3 -3
- package/v1/client/worker/context.d.ts +8 -1
- package/v1/client/worker/context.js +11 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
|
@@ -11,6 +11,7 @@ export type ActionKey = `${string}/${number}`;
|
|
|
11
11
|
export type Action = AssignedAction & {
|
|
12
12
|
readonly key: ActionKey;
|
|
13
13
|
};
|
|
14
|
+
export declare function workflowNameFromAction(action: Pick<AssignedAction, 'actionId' | 'jobName'>): string;
|
|
14
15
|
export declare function createAction(assignedAction: AssignedAction): Action;
|
|
15
16
|
export declare class ActionListener {
|
|
16
17
|
config: ClientConfig;
|
|
@@ -66,6 +66,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
66
66
|
};
|
|
67
67
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
68
68
|
exports.ActionListener = void 0;
|
|
69
|
+
exports.workflowNameFromAction = workflowNameFromAction;
|
|
69
70
|
exports.createAction = createAction;
|
|
70
71
|
const nice_grpc_1 = require("nice-grpc");
|
|
71
72
|
const grpc_error_1 = require("../../util/grpc-error");
|
|
@@ -80,6 +81,10 @@ var ListenStrategy;
|
|
|
80
81
|
ListenStrategy[ListenStrategy["LISTEN_STRATEGY_V1"] = 1] = "LISTEN_STRATEGY_V1";
|
|
81
82
|
ListenStrategy[ListenStrategy["LISTEN_STRATEGY_V2"] = 2] = "LISTEN_STRATEGY_V2";
|
|
82
83
|
})(ListenStrategy || (ListenStrategy = {}));
|
|
84
|
+
function workflowNameFromAction(action) {
|
|
85
|
+
const separatorIndex = action.actionId.lastIndexOf(':');
|
|
86
|
+
return separatorIndex === -1 ? action.jobName : action.actionId.substring(0, separatorIndex);
|
|
87
|
+
}
|
|
83
88
|
function createAction(assignedAction) {
|
|
84
89
|
const action = assignedAction;
|
|
85
90
|
Object.defineProperty(action, 'key', {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { APIErrors, APIMeta, AcceptInviteRequest, BulkCreateEventRequest, CancelEventRequest, CreateAPITokenRequest, CreateAPITokenResponse, CreateCronWorkflowTriggerRequest, CreateEventRequest, CreateSNSIntegrationRequest, CreateTenantAlertEmailGroupRequest, CreateTenantInviteRequest, CreateTenantRequest, CronWorkflows, CronWorkflowsList, CronWorkflowsOrderByField, Event, EventData, EventKey, EventKeyList, EventList, EventOrderByDirection, EventOrderByField, EventSearch, Events, FeatureFlagEvaluationResult, FeatureFlagId, ListAPIMetaIntegration, ListAPITokensResponse, ListSNSIntegrations, ListSlackWebhooks, OtelSpanList, RateLimitList, RateLimitOrderByDirection, RateLimitOrderByField, RejectInviteRequest, ReplayEventRequest, ReplayWorkflowRunsRequest, ReplayWorkflowRunsResponse, RerunStepRunRequest, SNSIntegration, ScheduleWorkflowRunRequest, ScheduledRunStatus, ScheduledWorkflows, ScheduledWorkflowsBulkDeleteRequest, ScheduledWorkflowsBulkDeleteResponse, ScheduledWorkflowsBulkUpdateRequest, ScheduledWorkflowsBulkUpdateResponse, ScheduledWorkflowsList, ScheduledWorkflowsOrderByField, StepRun, StepRunArchiveList, StepRunEventList, TaskStats, Tenant, TenantAlertEmailGroup, TenantAlertEmailGroupList, TenantAlertingSettings, TenantInvite, TenantInviteList, TenantMember, TenantMemberList, TenantQueueMetrics, TenantResourcePolicy, TenantStepRunQueueMetrics, TriggerWorkflowRunRequest, UpdateCronWorkflowTriggerRequest, UpdateScheduledWorkflowRunRequest, UpdateTenantAlertEmailGroupRequest, UpdateTenantInviteRequest, UpdateTenantMemberRequest, UpdateTenantRequest, UpdateWorkerRequest, User, UserChangePasswordRequest, UserLoginRequest, UserRegisterRequest, UserTenantMembershipsList, V1BranchDurableTaskRequest, V1BranchDurableTaskResponse, V1CELDebugRequest, V1CELDebugResponse, V1CancelTaskRequest, V1CancelledTasks, V1CreateFilterRequest, V1CreateWebhookRequest, V1DagChildren, V1Event, V1EventList, V1Filter, V1FilterList, V1LogLineLevel, V1LogLineList, V1LogLineOrderByDirection, V1LogsPointMetrics, V1ReplayTaskRequest, V1ReplayedTasks, V1RestoreTaskResponse, V1RunningFilter, V1TaskEventList, V1TaskPointMetrics, V1TaskRunMetrics, V1TaskStatus, V1TaskSummary, V1TaskSummaryList, V1TaskTimingList, V1TriggerWorkflowRunRequest, V1UpdateFilterRequest, V1UpdateWebhookRequest, V1Webhook, V1WebhookList, V1WebhookResponse, V1WebhookSourceName, V1WorkflowRunDetails, V1WorkflowRunDisplayNameList, V1WorkflowRunExternalIdList, WebhookWorkerCreateRequest, WebhookWorkerCreated, WebhookWorkerListResponse, WebhookWorkerRequestListResponse, Worker, WorkerList, Workflow, WorkflowID, WorkflowKindList, WorkflowList, WorkflowMetrics, WorkflowRun, WorkflowRunList, WorkflowRunOrderByDirection, WorkflowRunOrderByField, WorkflowRunShape, WorkflowRunStatus, WorkflowRunStatusList, WorkflowRunsCancelRequest, WorkflowRunsMetrics, WorkflowUpdateRequest, WorkflowVersion, WorkflowWorkersCount } from './data-contracts';
|
|
1
|
+
import { APIErrors, APIMeta, AcceptInviteRequest, BulkCreateEventRequest, CancelEventRequest, CreateAPITokenRequest, CreateAPITokenResponse, CreateCronWorkflowTriggerRequest, CreateEventRequest, CreateSNSIntegrationRequest, CreateTenantAlertEmailGroupRequest, CreateTenantInviteRequest, CreateTenantRequest, CronWorkflows, CronWorkflowsList, CronWorkflowsOrderByField, Event, EventData, EventKey, EventKeyList, EventList, EventOrderByDirection, EventOrderByField, EventSearch, Events, FeatureFlagEvaluationResult, FeatureFlagId, ListAPIMetaIntegration, ListAPITokensResponse, ListSNSIntegrations, ListSlackWebhooks, OtelSpanList, RateLimitList, RateLimitOrderByDirection, RateLimitOrderByField, RejectInviteRequest, ReplayEventRequest, ReplayWorkflowRunsRequest, ReplayWorkflowRunsResponse, RerunStepRunRequest, SNSIntegration, ScheduleWorkflowRunRequest, ScheduledRunStatus, ScheduledWorkflows, ScheduledWorkflowsBulkDeleteRequest, ScheduledWorkflowsBulkDeleteResponse, ScheduledWorkflowsBulkUpdateRequest, ScheduledWorkflowsBulkUpdateResponse, ScheduledWorkflowsList, ScheduledWorkflowsOrderByField, StepRun, StepRunArchiveList, StepRunEventList, TaskStats, Tenant, TenantAlertEmailGroup, TenantAlertEmailGroupList, TenantAlertingSettings, TenantInvite, TenantInviteList, TenantMember, TenantMemberList, TenantQueueMetrics, TenantResourcePolicy, TenantStepRunQueueMetrics, TriggerRunResult, TriggerWorkflowRunRequest, UpdateCronWorkflowTriggerRequest, UpdateScheduledWorkflowRunRequest, UpdateTenantAlertEmailGroupRequest, UpdateTenantInviteRequest, UpdateTenantMemberRequest, UpdateTenantRequest, UpdateWorkerRequest, User, UserChangePasswordRequest, UserLoginRequest, UserRegisterRequest, UserTenantMembershipsList, V1AdditionalMetadataOperator, V1BranchDurableTaskRequest, V1BranchDurableTaskResponse, V1CELDebugRequest, V1CELDebugResponse, V1CancelTaskRequest, V1CancelledTasks, V1CreateFilterRequest, V1CreateWebhookRequest, V1DagChildren, V1DurableEventLogList, V1Event, V1EventList, V1Filter, V1FilterList, V1LogLineLevel, V1LogLineList, V1LogLineOrderByDirection, V1LogsPointMetrics, V1ReplayTaskRequest, V1ReplayedTasks, V1RestoreTaskResponse, V1RunningFilter, V1TaskEventList, V1TaskPointMetrics, V1TaskRunMetrics, V1TaskStatus, V1TaskSummary, V1TaskSummaryList, V1TaskTimingList, V1TriggerWorkflowRunRequest, V1UpdateFilterRequest, V1UpdateWebhookRequest, V1Webhook, V1WebhookList, V1WebhookResponse, V1WebhookSourceName, V1WorkflowRunDetails, V1WorkflowRunDisplayNameList, V1WorkflowRunExternalIdList, WebhookWorkerCreateRequest, WebhookWorkerCreated, WebhookWorkerListResponse, WebhookWorkerRequestListResponse, Worker, WorkerList, WorkerStatus, Workflow, WorkflowID, WorkflowKindList, WorkflowList, WorkflowMetrics, WorkflowRun, WorkflowRunList, WorkflowRunOrderByDirection, WorkflowRunOrderByField, WorkflowRunShape, WorkflowRunStatus, WorkflowRunStatusList, WorkflowRunsCancelRequest, WorkflowRunsMetrics, 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
|
/**
|
|
@@ -224,6 +224,8 @@ export declare class Api<SecurityDataType = unknown> extends HttpClient<Security
|
|
|
224
224
|
until?: string;
|
|
225
225
|
/** Additional metadata k-v pairs to filter by */
|
|
226
226
|
additional_metadata?: string[];
|
|
227
|
+
/** How to combine multiple additional_metadata pairs. OR matches runs containing any pair, AND matches runs containing all pairs. Defaults to OR. */
|
|
228
|
+
additional_metadata_operator?: V1AdditionalMetadataOperator;
|
|
227
229
|
/** The workflow ids to find runs for */
|
|
228
230
|
workflow_ids?: string[];
|
|
229
231
|
/**
|
|
@@ -253,6 +255,8 @@ export declare class Api<SecurityDataType = unknown> extends HttpClient<Security
|
|
|
253
255
|
include_payloads?: boolean;
|
|
254
256
|
/** Filter within the RUNNING status bucket. ALL returns both on-worker and evicted tasks, ON_WORKER returns only tasks running on a worker, EVICTED returns only evicted tasks. Defaults to ALL. */
|
|
255
257
|
running_filter?: V1RunningFilter;
|
|
258
|
+
/** The idempotency key(s) to filter for */
|
|
259
|
+
idempotency_keys?: string[];
|
|
256
260
|
}, params?: RequestParams) => Promise<import("axios").AxiosResponse<V1TaskSummaryList, any, {}>>;
|
|
257
261
|
/**
|
|
258
262
|
* @description Lists displayable names of workflow runs for a tenant
|
|
@@ -316,6 +320,27 @@ export declare class Api<SecurityDataType = unknown> extends HttpClient<Security
|
|
|
316
320
|
* @secure
|
|
317
321
|
*/
|
|
318
322
|
v1DurableTaskBranch: (tenant: string, data: V1BranchDurableTaskRequest, params?: RequestParams) => Promise<import("axios").AxiosResponse<V1BranchDurableTaskResponse, any, {}>>;
|
|
323
|
+
/**
|
|
324
|
+
* @description Lists all event log entries for a durable task.
|
|
325
|
+
*
|
|
326
|
+
* @tags Durable Tasks
|
|
327
|
+
* @name V1DurableTaskEventLogList
|
|
328
|
+
* @summary List durable event log
|
|
329
|
+
* @request GET:/api/v1/stable/tenants/{tenant}/durable-tasks/{durable-task}
|
|
330
|
+
* @secure
|
|
331
|
+
*/
|
|
332
|
+
v1DurableTaskEventLogList: (tenant: string, durableTask: string, query?: {
|
|
333
|
+
/**
|
|
334
|
+
* The number of event log entries to skip
|
|
335
|
+
* @format int64
|
|
336
|
+
*/
|
|
337
|
+
offset?: number;
|
|
338
|
+
/**
|
|
339
|
+
* The number of event log entries to limit by
|
|
340
|
+
* @format int64
|
|
341
|
+
*/
|
|
342
|
+
limit?: number;
|
|
343
|
+
}, params?: RequestParams) => Promise<import("axios").AxiosResponse<V1DurableEventLogList, any, {}>>;
|
|
319
344
|
/**
|
|
320
345
|
* @description Get a workflow run and its metadata to display on the "detail" page
|
|
321
346
|
*
|
|
@@ -1216,6 +1241,19 @@ export declare class Api<SecurityDataType = unknown> extends HttpClient<Security
|
|
|
1216
1241
|
/** The order direction */
|
|
1217
1242
|
orderByDirection?: RateLimitOrderByDirection;
|
|
1218
1243
|
}, params?: RequestParams) => Promise<import("axios").AxiosResponse<RateLimitList, any, {}>>;
|
|
1244
|
+
/**
|
|
1245
|
+
* @description Delete a rate limit for a tenant.
|
|
1246
|
+
*
|
|
1247
|
+
* @tags Rate Limits
|
|
1248
|
+
* @name RateLimitDelete
|
|
1249
|
+
* @summary Delete rate limit
|
|
1250
|
+
* @request DELETE:/api/v1/tenants/{tenant}/rate-limits
|
|
1251
|
+
* @secure
|
|
1252
|
+
*/
|
|
1253
|
+
rateLimitDelete: (tenant: string, query: {
|
|
1254
|
+
/** The limit key */
|
|
1255
|
+
key: string;
|
|
1256
|
+
}, params?: RequestParams) => Promise<import("axios").AxiosResponse<void, any, {}>>;
|
|
1219
1257
|
/**
|
|
1220
1258
|
* @description Gets a list of tenant members
|
|
1221
1259
|
*
|
|
@@ -1404,6 +1442,16 @@ export declare class Api<SecurityDataType = unknown> extends HttpClient<Security
|
|
|
1404
1442
|
* @secure
|
|
1405
1443
|
*/
|
|
1406
1444
|
workflowScheduledUpdate: (tenant: string, scheduledWorkflowRun: string, data: UpdateScheduledWorkflowRunRequest, params?: RequestParams) => Promise<import("axios").AxiosResponse<ScheduledWorkflows, any, {}>>;
|
|
1445
|
+
/**
|
|
1446
|
+
* @description Trigger a scheduled workflow run immediately for a tenant
|
|
1447
|
+
*
|
|
1448
|
+
* @tags Workflow
|
|
1449
|
+
* @name WorkflowScheduledTrigger
|
|
1450
|
+
* @summary Trigger scheduled workflow run
|
|
1451
|
+
* @request POST:/api/v1/tenants/{tenant}/workflows/scheduled/{scheduled-workflow-run}
|
|
1452
|
+
* @secure
|
|
1453
|
+
*/
|
|
1454
|
+
workflowScheduledTrigger: (tenant: string, scheduledWorkflowRun: string, params?: RequestParams) => Promise<import("axios").AxiosResponse<TriggerRunResult, any, {}>>;
|
|
1407
1455
|
/**
|
|
1408
1456
|
* @description Bulk delete scheduled workflow runs for a tenant
|
|
1409
1457
|
*
|
|
@@ -1505,6 +1553,16 @@ export declare class Api<SecurityDataType = unknown> extends HttpClient<Security
|
|
|
1505
1553
|
* @secure
|
|
1506
1554
|
*/
|
|
1507
1555
|
workflowCronUpdate: (tenant: string, cronWorkflow: string, data: UpdateCronWorkflowTriggerRequest, params?: RequestParams) => Promise<import("axios").AxiosResponse<void, any, {}>>;
|
|
1556
|
+
/**
|
|
1557
|
+
* @description Trigger a cron workflow immediately for a tenant
|
|
1558
|
+
*
|
|
1559
|
+
* @tags Workflow
|
|
1560
|
+
* @name WorkflowCronTrigger
|
|
1561
|
+
* @summary Trigger cron job workflow run immediately
|
|
1562
|
+
* @request POST:/api/v1/tenants/{tenant}/workflows/crons/{cron-workflow}
|
|
1563
|
+
* @secure
|
|
1564
|
+
*/
|
|
1565
|
+
workflowCronTrigger: (tenant: string, cronWorkflow: string, params?: RequestParams) => Promise<import("axios").AxiosResponse<TriggerRunResult, any, {}>>;
|
|
1508
1566
|
/**
|
|
1509
1567
|
* @description Cancel a batch of workflow runs
|
|
1510
1568
|
*
|
|
@@ -1887,7 +1945,20 @@ export declare class Api<SecurityDataType = unknown> extends HttpClient<Security
|
|
|
1887
1945
|
* @request GET:/api/v1/tenants/{tenant}/worker
|
|
1888
1946
|
* @secure
|
|
1889
1947
|
*/
|
|
1890
|
-
workerList: (tenant: string,
|
|
1948
|
+
workerList: (tenant: string, query?: {
|
|
1949
|
+
/**
|
|
1950
|
+
* The number to skip
|
|
1951
|
+
* @format int64
|
|
1952
|
+
*/
|
|
1953
|
+
offset?: number;
|
|
1954
|
+
/**
|
|
1955
|
+
* The number to limit by
|
|
1956
|
+
* @format int64
|
|
1957
|
+
*/
|
|
1958
|
+
limit?: number;
|
|
1959
|
+
/** Filter by worker status */
|
|
1960
|
+
statuses?: WorkerStatus[];
|
|
1961
|
+
}, params?: RequestParams) => Promise<import("axios").AxiosResponse<WorkerList, any, {}>>;
|
|
1891
1962
|
/**
|
|
1892
1963
|
* @description Update a worker
|
|
1893
1964
|
*
|
|
@@ -1993,7 +2064,10 @@ export declare class Api<SecurityDataType = unknown> extends HttpClient<Security
|
|
|
1993
2064
|
* @request GET:/api/v1/tenants/{tenant}/task-stats
|
|
1994
2065
|
* @secure
|
|
1995
2066
|
*/
|
|
1996
|
-
tenantGetTaskStats: (tenant: string,
|
|
2067
|
+
tenantGetTaskStats: (tenant: string, query?: {
|
|
2068
|
+
/** Task names that must appear in the response. Missing tasks are zero-filled so KEDA's metrics-api JSONPath always resolves. */
|
|
2069
|
+
taskNames?: string[];
|
|
2070
|
+
}, params?: RequestParams) => Promise<import("axios").AxiosResponse<TaskStats, any, {}>>;
|
|
1997
2071
|
/**
|
|
1998
2072
|
* @description Evaluate a feature flag for a tenant
|
|
1999
2073
|
*
|
|
@@ -156,6 +156,16 @@ class Api extends http_client_1.HttpClient {
|
|
|
156
156
|
* @secure
|
|
157
157
|
*/
|
|
158
158
|
this.v1DurableTaskBranch = (tenant, data, params = {}) => this.request(Object.assign({ path: `/api/v1/stable/tenants/${tenant}/durable-tasks/branch`, method: 'POST', body: data, secure: true, type: http_client_1.ContentType.Json, format: 'json' }, params));
|
|
159
|
+
/**
|
|
160
|
+
* @description Lists all event log entries for a durable task.
|
|
161
|
+
*
|
|
162
|
+
* @tags Durable Tasks
|
|
163
|
+
* @name V1DurableTaskEventLogList
|
|
164
|
+
* @summary List durable event log
|
|
165
|
+
* @request GET:/api/v1/stable/tenants/{tenant}/durable-tasks/{durable-task}
|
|
166
|
+
* @secure
|
|
167
|
+
*/
|
|
168
|
+
this.v1DurableTaskEventLogList = (tenant, durableTask, query, params = {}) => this.request(Object.assign({ path: `/api/v1/stable/tenants/${tenant}/durable-tasks/${durableTask}`, method: 'GET', query: query, secure: true, format: 'json' }, params));
|
|
159
169
|
/**
|
|
160
170
|
* @description Get a workflow run and its metadata to display on the "detail" page
|
|
161
171
|
*
|
|
@@ -859,6 +869,16 @@ class Api extends http_client_1.HttpClient {
|
|
|
859
869
|
* @secure
|
|
860
870
|
*/
|
|
861
871
|
this.rateLimitList = (tenant, query, params = {}) => this.request(Object.assign({ path: `/api/v1/tenants/${tenant}/rate-limits`, method: 'GET', query: query, secure: true, format: 'json' }, params));
|
|
872
|
+
/**
|
|
873
|
+
* @description Delete a rate limit for a tenant.
|
|
874
|
+
*
|
|
875
|
+
* @tags Rate Limits
|
|
876
|
+
* @name RateLimitDelete
|
|
877
|
+
* @summary Delete rate limit
|
|
878
|
+
* @request DELETE:/api/v1/tenants/{tenant}/rate-limits
|
|
879
|
+
* @secure
|
|
880
|
+
*/
|
|
881
|
+
this.rateLimitDelete = (tenant, query, params = {}) => this.request(Object.assign({ path: `/api/v1/tenants/${tenant}/rate-limits`, method: 'DELETE', query: query, secure: true }, params));
|
|
862
882
|
/**
|
|
863
883
|
* @description Gets a list of tenant members
|
|
864
884
|
*
|
|
@@ -989,6 +1009,16 @@ class Api extends http_client_1.HttpClient {
|
|
|
989
1009
|
* @secure
|
|
990
1010
|
*/
|
|
991
1011
|
this.workflowScheduledUpdate = (tenant, scheduledWorkflowRun, data, params = {}) => this.request(Object.assign({ path: `/api/v1/tenants/${tenant}/workflows/scheduled/${scheduledWorkflowRun}`, method: 'PATCH', body: data, secure: true, type: http_client_1.ContentType.Json, format: 'json' }, params));
|
|
1012
|
+
/**
|
|
1013
|
+
* @description Trigger a scheduled workflow run immediately for a tenant
|
|
1014
|
+
*
|
|
1015
|
+
* @tags Workflow
|
|
1016
|
+
* @name WorkflowScheduledTrigger
|
|
1017
|
+
* @summary Trigger scheduled workflow run
|
|
1018
|
+
* @request POST:/api/v1/tenants/{tenant}/workflows/scheduled/{scheduled-workflow-run}
|
|
1019
|
+
* @secure
|
|
1020
|
+
*/
|
|
1021
|
+
this.workflowScheduledTrigger = (tenant, scheduledWorkflowRun, params = {}) => this.request(Object.assign({ path: `/api/v1/tenants/${tenant}/workflows/scheduled/${scheduledWorkflowRun}`, method: 'POST', secure: true, format: 'json' }, params));
|
|
992
1022
|
/**
|
|
993
1023
|
* @description Bulk delete scheduled workflow runs for a tenant
|
|
994
1024
|
*
|
|
@@ -1059,6 +1089,16 @@ class Api extends http_client_1.HttpClient {
|
|
|
1059
1089
|
* @secure
|
|
1060
1090
|
*/
|
|
1061
1091
|
this.workflowCronUpdate = (tenant, cronWorkflow, data, params = {}) => this.request(Object.assign({ path: `/api/v1/tenants/${tenant}/workflows/crons/${cronWorkflow}`, method: 'PATCH', body: data, secure: true, type: http_client_1.ContentType.Json }, params));
|
|
1092
|
+
/**
|
|
1093
|
+
* @description Trigger a cron workflow immediately for a tenant
|
|
1094
|
+
*
|
|
1095
|
+
* @tags Workflow
|
|
1096
|
+
* @name WorkflowCronTrigger
|
|
1097
|
+
* @summary Trigger cron job workflow run immediately
|
|
1098
|
+
* @request POST:/api/v1/tenants/{tenant}/workflows/crons/{cron-workflow}
|
|
1099
|
+
* @secure
|
|
1100
|
+
*/
|
|
1101
|
+
this.workflowCronTrigger = (tenant, cronWorkflow, params = {}) => this.request(Object.assign({ path: `/api/v1/tenants/${tenant}/workflows/crons/${cronWorkflow}`, method: 'POST', secure: true, format: 'json' }, params));
|
|
1062
1102
|
/**
|
|
1063
1103
|
* @description Cancel a batch of workflow runs
|
|
1064
1104
|
*
|
|
@@ -1268,7 +1308,7 @@ class Api extends http_client_1.HttpClient {
|
|
|
1268
1308
|
* @request GET:/api/v1/tenants/{tenant}/worker
|
|
1269
1309
|
* @secure
|
|
1270
1310
|
*/
|
|
1271
|
-
this.workerList = (tenant, params = {}) => this.request(Object.assign({ path: `/api/v1/tenants/${tenant}/worker`, method: 'GET', secure: true, format: 'json' }, params));
|
|
1311
|
+
this.workerList = (tenant, query, params = {}) => this.request(Object.assign({ path: `/api/v1/tenants/${tenant}/worker`, method: 'GET', query: query, secure: true, format: 'json' }, params));
|
|
1272
1312
|
/**
|
|
1273
1313
|
* @description Update a worker
|
|
1274
1314
|
*
|
|
@@ -1371,7 +1411,7 @@ class Api extends http_client_1.HttpClient {
|
|
|
1371
1411
|
* @request GET:/api/v1/tenants/{tenant}/task-stats
|
|
1372
1412
|
* @secure
|
|
1373
1413
|
*/
|
|
1374
|
-
this.tenantGetTaskStats = (tenant, params = {}) => this.request(Object.assign({ path: `/api/v1/tenants/${tenant}/task-stats`, method: 'GET', secure: true, format: 'json' }, params));
|
|
1414
|
+
this.tenantGetTaskStats = (tenant, query, params = {}) => this.request(Object.assign({ path: `/api/v1/tenants/${tenant}/task-stats`, method: 'GET', query: query, secure: true, format: 'json' }, params));
|
|
1375
1415
|
/**
|
|
1376
1416
|
* @description Evaluate a feature flag for a tenant
|
|
1377
1417
|
*
|
|
@@ -23,7 +23,9 @@ export declare enum PullRequestState {
|
|
|
23
23
|
Closed = "closed"
|
|
24
24
|
}
|
|
25
25
|
export declare enum FeatureFlagId {
|
|
26
|
-
TenantLogWorkflowFilterEnabled = "tenant-log-workflow-filter-enabled"
|
|
26
|
+
TenantLogWorkflowFilterEnabled = "tenant-log-workflow-filter-enabled",
|
|
27
|
+
TraceMinimapEnabled = "trace-minimap-enabled",
|
|
28
|
+
OrganizationSsoEnabled = "organization-sso-enabled"
|
|
27
29
|
}
|
|
28
30
|
export declare enum WebhookWorkerRequestMethod {
|
|
29
31
|
GET = "GET",
|
|
@@ -41,6 +43,11 @@ export declare enum WorkerType {
|
|
|
41
43
|
MANAGED = "MANAGED",
|
|
42
44
|
WEBHOOK = "WEBHOOK"
|
|
43
45
|
}
|
|
46
|
+
export declare enum WorkerStatus {
|
|
47
|
+
ACTIVE = "ACTIVE",
|
|
48
|
+
INACTIVE = "INACTIVE",
|
|
49
|
+
PAUSED = "PAUSED"
|
|
50
|
+
}
|
|
44
51
|
export declare enum WorkflowRunOrderByField {
|
|
45
52
|
CreatedAt = "createdAt",
|
|
46
53
|
StartedAt = "startedAt",
|
|
@@ -224,11 +231,25 @@ export declare enum OtelSpanKind {
|
|
|
224
231
|
PRODUCER = "PRODUCER",
|
|
225
232
|
CONSUMER = "CONSUMER"
|
|
226
233
|
}
|
|
234
|
+
export declare enum V1DurableWaitConditionKind {
|
|
235
|
+
SLEEP = "SLEEP",
|
|
236
|
+
USER_EVENT = "USER_EVENT",
|
|
237
|
+
CHILD_WORKFLOW = "CHILD_WORKFLOW"
|
|
238
|
+
}
|
|
239
|
+
export declare enum V1DurableEventLogKind {
|
|
240
|
+
RUN = "RUN",
|
|
241
|
+
WAIT_FOR = "WAIT_FOR",
|
|
242
|
+
MEMO = "MEMO"
|
|
243
|
+
}
|
|
227
244
|
export declare enum V1RunningFilter {
|
|
228
245
|
ALL = "ALL",
|
|
229
246
|
EVICTED = "EVICTED",
|
|
230
247
|
ON_WORKER = "ON_WORKER"
|
|
231
248
|
}
|
|
249
|
+
export declare enum V1AdditionalMetadataOperator {
|
|
250
|
+
OR = "OR",
|
|
251
|
+
AND = "AND"
|
|
252
|
+
}
|
|
232
253
|
export declare enum V1LogLineOrderByDirection {
|
|
233
254
|
ASC = "ASC",
|
|
234
255
|
DESC = "DESC"
|
|
@@ -317,6 +338,8 @@ export interface V1TaskSummary {
|
|
|
317
338
|
displayName: string;
|
|
318
339
|
/** The duration of the task run, in milliseconds. */
|
|
319
340
|
duration?: number;
|
|
341
|
+
/** Whether this task was created as a durable task. */
|
|
342
|
+
isDurable?: boolean;
|
|
320
343
|
/** The error message of the task run (for the latest run) */
|
|
321
344
|
errorMessage?: string;
|
|
322
345
|
/**
|
|
@@ -388,6 +411,8 @@ export interface V1TaskSummary {
|
|
|
388
411
|
* @format uuid
|
|
389
412
|
*/
|
|
390
413
|
parentTaskExternalId?: string;
|
|
414
|
+
/** The idempotency key that was claimed by the task run */
|
|
415
|
+
idempotencyKey?: string;
|
|
391
416
|
}
|
|
392
417
|
export interface APIError {
|
|
393
418
|
/**
|
|
@@ -557,6 +582,8 @@ export interface V1TriggerWorkflowRunRequest {
|
|
|
557
582
|
additionalMetadata?: object;
|
|
558
583
|
/** The priority of the workflow run. */
|
|
559
584
|
priority?: number;
|
|
585
|
+
/** A boolean flag indicating whether to only return the id of the created run. */
|
|
586
|
+
return_only_id?: boolean;
|
|
560
587
|
}
|
|
561
588
|
export interface V1WorkflowRun {
|
|
562
589
|
metadata: APIResourceMeta;
|
|
@@ -673,6 +700,60 @@ export interface V1BranchDurableTaskResponse {
|
|
|
673
700
|
*/
|
|
674
701
|
branchId: number;
|
|
675
702
|
}
|
|
703
|
+
export interface V1DurableWaitCondition {
|
|
704
|
+
kind: V1DurableWaitConditionKind;
|
|
705
|
+
/** @format int64 */
|
|
706
|
+
sleepDurationMs?: number;
|
|
707
|
+
eventKey?: string;
|
|
708
|
+
workflowName?: string;
|
|
709
|
+
}
|
|
710
|
+
export interface V1WaitItem {
|
|
711
|
+
kind?: V1DurableWaitConditionKind;
|
|
712
|
+
/** @format int64 */
|
|
713
|
+
sleepDurationMs?: number;
|
|
714
|
+
eventKey?: string;
|
|
715
|
+
workflowName?: string;
|
|
716
|
+
or?: V1DurableWaitCondition[];
|
|
717
|
+
}
|
|
718
|
+
export type V1WaitData = V1WaitItem[];
|
|
719
|
+
export interface V1DurableEventLogEntry {
|
|
720
|
+
/**
|
|
721
|
+
* The monotonically increasing node id in the event log.
|
|
722
|
+
* @format int64
|
|
723
|
+
*/
|
|
724
|
+
nodeId: number;
|
|
725
|
+
/**
|
|
726
|
+
* The branch id when this entry was first seen.
|
|
727
|
+
* @format int64
|
|
728
|
+
*/
|
|
729
|
+
branchId: number;
|
|
730
|
+
kind: V1DurableEventLogKind;
|
|
731
|
+
waitData?: V1WaitData;
|
|
732
|
+
/** Whether this entry has been satisfied. */
|
|
733
|
+
isSatisfied: boolean;
|
|
734
|
+
/**
|
|
735
|
+
* When this entry was satisfied, if it has been satisfied.
|
|
736
|
+
* @format date-time
|
|
737
|
+
*/
|
|
738
|
+
satisfiedAt?: string;
|
|
739
|
+
/**
|
|
740
|
+
* When this entry was inserted.
|
|
741
|
+
* @format date-time
|
|
742
|
+
*/
|
|
743
|
+
insertedAt: string;
|
|
744
|
+
/** A user-provided message or label, sent when establishing a durable wait. */
|
|
745
|
+
userMessage?: string;
|
|
746
|
+
/**
|
|
747
|
+
* The external id of the durable task this event log entry is associated with.
|
|
748
|
+
* @format uuid
|
|
749
|
+
* @minLength 36
|
|
750
|
+
* @maxLength 36
|
|
751
|
+
*/
|
|
752
|
+
taskExternalId: string;
|
|
753
|
+
/** The display name of the durable task this event log entry is associated with. */
|
|
754
|
+
taskDisplayName: string;
|
|
755
|
+
}
|
|
756
|
+
export type V1DurableEventLogList = V1DurableEventLogEntry[];
|
|
676
757
|
export interface OtelSpan {
|
|
677
758
|
traceId: string;
|
|
678
759
|
spanId: string;
|
|
@@ -803,6 +884,10 @@ export interface Tenant {
|
|
|
803
884
|
version: TenantVersion;
|
|
804
885
|
/** The environment type of the tenant. */
|
|
805
886
|
environment?: TenantEnvironment;
|
|
887
|
+
/** The server URL for the tenant (includes scheme) */
|
|
888
|
+
serverUrl?: string;
|
|
889
|
+
/** Control-plane shard region for the tenant (e.g. aws:us-west-2). */
|
|
890
|
+
region?: string;
|
|
806
891
|
}
|
|
807
892
|
export interface V1EventWorkflowRunSummary {
|
|
808
893
|
/**
|
|
@@ -942,6 +1027,8 @@ export interface V1Webhook {
|
|
|
942
1027
|
staticPayload?: object;
|
|
943
1028
|
/** The type of authentication to use for the webhook */
|
|
944
1029
|
authType: V1WebhookAuthType;
|
|
1030
|
+
/** Whether to return the triggered event as the response payload when this webhook is triggered */
|
|
1031
|
+
returnEventAsResponsePayload?: boolean;
|
|
945
1032
|
}
|
|
946
1033
|
export interface V1WebhookList {
|
|
947
1034
|
pagination?: PaginationResponse;
|
|
@@ -958,6 +1045,8 @@ export interface V1CreateWebhookRequestBase {
|
|
|
958
1045
|
scopeExpression?: string;
|
|
959
1046
|
/** The static payload to use for the webhook. This is used to send a static payload with the webhook. */
|
|
960
1047
|
staticPayload?: object;
|
|
1048
|
+
/** Whether to return the triggered event as the response payload when this webhook is triggered */
|
|
1049
|
+
returnEventAsResponsePayload?: boolean;
|
|
961
1050
|
}
|
|
962
1051
|
export interface V1WebhookBasicAuth {
|
|
963
1052
|
/** The username for basic auth */
|
|
@@ -1010,6 +1099,8 @@ export interface V1UpdateWebhookRequest {
|
|
|
1010
1099
|
scopeExpression?: string;
|
|
1011
1100
|
/** The static payload to use for the webhook. This is used to send a static payload with the webhook. */
|
|
1012
1101
|
staticPayload?: object;
|
|
1102
|
+
/** Whether to return the triggered event as the response payload when this webhook is triggered */
|
|
1103
|
+
returnEventAsResponsePayload?: boolean;
|
|
1013
1104
|
}
|
|
1014
1105
|
export interface V1CELDebugRequest {
|
|
1015
1106
|
/** The CEL expression to evaluate */
|
|
@@ -1076,6 +1167,26 @@ export interface APIMeta {
|
|
|
1076
1167
|
* @example true
|
|
1077
1168
|
*/
|
|
1078
1169
|
allowChangePassword?: boolean;
|
|
1170
|
+
/**
|
|
1171
|
+
* whether or not observability (trace collection) is enabled on this instance
|
|
1172
|
+
* @example false
|
|
1173
|
+
*/
|
|
1174
|
+
observabilityEnabled?: boolean;
|
|
1175
|
+
/**
|
|
1176
|
+
* whether or not a Prometheus federation server is configured (SERVER_PROMETHEUS_SERVER_URL) on this instance
|
|
1177
|
+
* @example false
|
|
1178
|
+
*/
|
|
1179
|
+
prometheusServerEnabled?: boolean;
|
|
1180
|
+
/**
|
|
1181
|
+
* whether or not authentication is disabled (authdisabled build) on this instance
|
|
1182
|
+
* @example false
|
|
1183
|
+
*/
|
|
1184
|
+
authDisabled?: boolean;
|
|
1185
|
+
/**
|
|
1186
|
+
* the embedded worker API token, only set on authdisabled builds
|
|
1187
|
+
* @example "eyJhbGciOiJFUzI1NiIs..."
|
|
1188
|
+
*/
|
|
1189
|
+
authDisabledToken?: string;
|
|
1079
1190
|
}
|
|
1080
1191
|
export interface APIMetaIntegration {
|
|
1081
1192
|
/**
|
|
@@ -1225,6 +1336,8 @@ export interface TenantMember {
|
|
|
1225
1336
|
role: TenantMemberRole;
|
|
1226
1337
|
/** The tenant associated with this tenant member. */
|
|
1227
1338
|
tenant?: Tenant;
|
|
1339
|
+
/** Whether this membership was explicitly granted (as opposed to synced via user-group tags). Only explicit members can have their role edited or be removed. */
|
|
1340
|
+
manually_added?: boolean;
|
|
1228
1341
|
}
|
|
1229
1342
|
export interface UserTenantMembershipsList {
|
|
1230
1343
|
pagination?: PaginationResponse;
|
|
@@ -1595,6 +1708,15 @@ export interface ScheduledWorkflowsList {
|
|
|
1595
1708
|
rows?: ScheduledWorkflows[];
|
|
1596
1709
|
pagination?: PaginationResponse;
|
|
1597
1710
|
}
|
|
1711
|
+
export interface TriggerRunResult {
|
|
1712
|
+
/**
|
|
1713
|
+
* The external ID of the triggered workflow run
|
|
1714
|
+
* @format uuid
|
|
1715
|
+
* @minLength 36
|
|
1716
|
+
* @maxLength 36
|
|
1717
|
+
*/
|
|
1718
|
+
externalId: string;
|
|
1719
|
+
}
|
|
1598
1720
|
export interface UpdateScheduledWorkflowRunRequest {
|
|
1599
1721
|
/** @format date-time */
|
|
1600
1722
|
triggerAt: string;
|
|
@@ -2087,7 +2209,7 @@ export interface Worker {
|
|
|
2087
2209
|
/** The recent step runs for the worker. */
|
|
2088
2210
|
recentStepRuns?: RecentStepRuns[];
|
|
2089
2211
|
/** The status of the worker. */
|
|
2090
|
-
status?:
|
|
2212
|
+
status?: WorkerStatus;
|
|
2091
2213
|
/** Slot availability and limits for this worker (slot_type -> { available, limit }). */
|
|
2092
2214
|
slotConfig?: Record<string, WorkerSlotConfig>;
|
|
2093
2215
|
/**
|
|
@@ -2175,6 +2297,8 @@ export interface TaskStatusStat {
|
|
|
2175
2297
|
concurrency?: ConcurrencyStat[];
|
|
2176
2298
|
/** @format date-time */
|
|
2177
2299
|
oldest?: string;
|
|
2300
|
+
/** @format date-time */
|
|
2301
|
+
oldestExcludingRetries?: string;
|
|
2178
2302
|
}
|
|
2179
2303
|
export interface TaskStat {
|
|
2180
2304
|
queued?: TaskStatusStat;
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* ---------------------------------------------------------------
|
|
12
12
|
*/
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
-
exports.V1TaskStatus = exports.V1WorkflowType = exports.V1TaskEventType = exports.V1LogLineLevel = exports.V1LogLineOrderByDirection = exports.V1RunningFilter = exports.OtelSpanKind = exports.OtelStatusCode = exports.TenantVersion = exports.TenantEnvironment = exports.V1WebhookSourceName = exports.V1WebhookAuthType = exports.V1WebhookHMACAlgorithm = exports.V1WebhookHMACEncoding = exports.V1CELDebugResponseStatus = exports.TenantResource = exports.TenantMemberRole = exports.WorkflowRunStatus = exports.EventOrderByField = exports.EventOrderByDirection = exports.RateLimitOrderByField = exports.RateLimitOrderByDirection = exports.ScheduledWorkflowsMethod = exports.ScheduledWorkflowsOrderByField = exports.WorkflowRunOrderByDirection = exports.ScheduledRunStatus = exports.CronWorkflowsMethod = exports.CronWorkflowsOrderByField = exports.ConcurrencyLimitStrategy = exports.ConcurrencyScope = exports.StepRunStatus = exports.JobRunStatus = exports.StepRunEventReason = exports.StepRunEventSeverity = exports.WorkflowKind = exports.WorkflowRunOrderByField = exports.WorkerType = exports.WorkerRuntimeSDKs = exports.WebhookWorkerRequestMethod = exports.FeatureFlagId = exports.PullRequestState = exports.LogLineLevel = exports.LogLineOrderByField = exports.LogLineOrderByDirection = exports.V1TaskRunStatus = void 0;
|
|
14
|
+
exports.V1TaskStatus = exports.V1WorkflowType = exports.V1TaskEventType = exports.V1LogLineLevel = exports.V1LogLineOrderByDirection = exports.V1AdditionalMetadataOperator = exports.V1RunningFilter = exports.V1DurableEventLogKind = exports.V1DurableWaitConditionKind = exports.OtelSpanKind = exports.OtelStatusCode = exports.TenantVersion = exports.TenantEnvironment = exports.V1WebhookSourceName = exports.V1WebhookAuthType = exports.V1WebhookHMACAlgorithm = exports.V1WebhookHMACEncoding = exports.V1CELDebugResponseStatus = exports.TenantResource = exports.TenantMemberRole = exports.WorkflowRunStatus = exports.EventOrderByField = exports.EventOrderByDirection = exports.RateLimitOrderByField = exports.RateLimitOrderByDirection = exports.ScheduledWorkflowsMethod = exports.ScheduledWorkflowsOrderByField = exports.WorkflowRunOrderByDirection = exports.ScheduledRunStatus = exports.CronWorkflowsMethod = exports.CronWorkflowsOrderByField = exports.ConcurrencyLimitStrategy = exports.ConcurrencyScope = exports.StepRunStatus = exports.JobRunStatus = exports.StepRunEventReason = exports.StepRunEventSeverity = exports.WorkflowKind = exports.WorkflowRunOrderByField = exports.WorkerStatus = exports.WorkerType = exports.WorkerRuntimeSDKs = exports.WebhookWorkerRequestMethod = exports.FeatureFlagId = exports.PullRequestState = exports.LogLineLevel = exports.LogLineOrderByField = exports.LogLineOrderByDirection = exports.V1TaskRunStatus = void 0;
|
|
15
15
|
var V1TaskRunStatus;
|
|
16
16
|
(function (V1TaskRunStatus) {
|
|
17
17
|
V1TaskRunStatus["PENDING"] = "PENDING";
|
|
@@ -44,6 +44,8 @@ var PullRequestState;
|
|
|
44
44
|
var FeatureFlagId;
|
|
45
45
|
(function (FeatureFlagId) {
|
|
46
46
|
FeatureFlagId["TenantLogWorkflowFilterEnabled"] = "tenant-log-workflow-filter-enabled";
|
|
47
|
+
FeatureFlagId["TraceMinimapEnabled"] = "trace-minimap-enabled";
|
|
48
|
+
FeatureFlagId["OrganizationSsoEnabled"] = "organization-sso-enabled";
|
|
47
49
|
})(FeatureFlagId || (exports.FeatureFlagId = FeatureFlagId = {}));
|
|
48
50
|
var WebhookWorkerRequestMethod;
|
|
49
51
|
(function (WebhookWorkerRequestMethod) {
|
|
@@ -64,6 +66,12 @@ var WorkerType;
|
|
|
64
66
|
WorkerType["MANAGED"] = "MANAGED";
|
|
65
67
|
WorkerType["WEBHOOK"] = "WEBHOOK";
|
|
66
68
|
})(WorkerType || (exports.WorkerType = WorkerType = {}));
|
|
69
|
+
var WorkerStatus;
|
|
70
|
+
(function (WorkerStatus) {
|
|
71
|
+
WorkerStatus["ACTIVE"] = "ACTIVE";
|
|
72
|
+
WorkerStatus["INACTIVE"] = "INACTIVE";
|
|
73
|
+
WorkerStatus["PAUSED"] = "PAUSED";
|
|
74
|
+
})(WorkerStatus || (exports.WorkerStatus = WorkerStatus = {}));
|
|
67
75
|
var WorkflowRunOrderByField;
|
|
68
76
|
(function (WorkflowRunOrderByField) {
|
|
69
77
|
WorkflowRunOrderByField["CreatedAt"] = "createdAt";
|
|
@@ -277,12 +285,29 @@ var OtelSpanKind;
|
|
|
277
285
|
OtelSpanKind["PRODUCER"] = "PRODUCER";
|
|
278
286
|
OtelSpanKind["CONSUMER"] = "CONSUMER";
|
|
279
287
|
})(OtelSpanKind || (exports.OtelSpanKind = OtelSpanKind = {}));
|
|
288
|
+
var V1DurableWaitConditionKind;
|
|
289
|
+
(function (V1DurableWaitConditionKind) {
|
|
290
|
+
V1DurableWaitConditionKind["SLEEP"] = "SLEEP";
|
|
291
|
+
V1DurableWaitConditionKind["USER_EVENT"] = "USER_EVENT";
|
|
292
|
+
V1DurableWaitConditionKind["CHILD_WORKFLOW"] = "CHILD_WORKFLOW";
|
|
293
|
+
})(V1DurableWaitConditionKind || (exports.V1DurableWaitConditionKind = V1DurableWaitConditionKind = {}));
|
|
294
|
+
var V1DurableEventLogKind;
|
|
295
|
+
(function (V1DurableEventLogKind) {
|
|
296
|
+
V1DurableEventLogKind["RUN"] = "RUN";
|
|
297
|
+
V1DurableEventLogKind["WAIT_FOR"] = "WAIT_FOR";
|
|
298
|
+
V1DurableEventLogKind["MEMO"] = "MEMO";
|
|
299
|
+
})(V1DurableEventLogKind || (exports.V1DurableEventLogKind = V1DurableEventLogKind = {}));
|
|
280
300
|
var V1RunningFilter;
|
|
281
301
|
(function (V1RunningFilter) {
|
|
282
302
|
V1RunningFilter["ALL"] = "ALL";
|
|
283
303
|
V1RunningFilter["EVICTED"] = "EVICTED";
|
|
284
304
|
V1RunningFilter["ON_WORKER"] = "ON_WORKER";
|
|
285
305
|
})(V1RunningFilter || (exports.V1RunningFilter = V1RunningFilter = {}));
|
|
306
|
+
var V1AdditionalMetadataOperator;
|
|
307
|
+
(function (V1AdditionalMetadataOperator) {
|
|
308
|
+
V1AdditionalMetadataOperator["OR"] = "OR";
|
|
309
|
+
V1AdditionalMetadataOperator["AND"] = "AND";
|
|
310
|
+
})(V1AdditionalMetadataOperator || (exports.V1AdditionalMetadataOperator = V1AdditionalMetadataOperator = {}));
|
|
286
311
|
var V1LogLineOrderByDirection;
|
|
287
312
|
(function (V1LogLineOrderByDirection) {
|
|
288
313
|
V1LogLineOrderByDirection["ASC"] = "ASC";
|
|
@@ -20,6 +20,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
21
|
exports.HatchetInstrumentor = void 0;
|
|
22
22
|
const version_1 = require("../version");
|
|
23
|
+
const action_listener_1 = require("../clients/dispatcher/action-listener");
|
|
23
24
|
const opentelemetry_1 = require("../util/opentelemetry");
|
|
24
25
|
const parse_1 = require("../util/parse");
|
|
25
26
|
const types_1 = require("./types");
|
|
@@ -69,7 +70,7 @@ function getActionOtelAttributes(action, excludedAttributes = [], workerId) {
|
|
|
69
70
|
[opentelemetry_1.OTelAttribute.CHILD_WORKFLOW_INDEX]: action.childWorkflowIndex,
|
|
70
71
|
[opentelemetry_1.OTelAttribute.CHILD_WORKFLOW_KEY]: action.childWorkflowKey,
|
|
71
72
|
[opentelemetry_1.OTelAttribute.ACTION_PAYLOAD]: action.actionPayload,
|
|
72
|
-
[opentelemetry_1.OTelAttribute.WORKFLOW_NAME]: action
|
|
73
|
+
[opentelemetry_1.OTelAttribute.WORKFLOW_NAME]: (0, action_listener_1.workflowNameFromAction)(action),
|
|
73
74
|
[opentelemetry_1.OTelAttribute.ACTION_NAME]: action.actionId,
|
|
74
75
|
[opentelemetry_1.OTelAttribute.STEP_NAME]: action.taskName,
|
|
75
76
|
[opentelemetry_1.OTelAttribute.WORKFLOW_ID]: action.workflowId,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hatchet-dev/typescript-sdk",
|
|
3
|
-
"version": "1.26.
|
|
3
|
+
"version": "1.26.1",
|
|
4
4
|
"description": "Background task orchestration & visibility for developers",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"@anthropic-ai/claude-agent-sdk": "^0.3.148",
|
|
60
60
|
"@grpc/grpc-js": "^1.14.3",
|
|
61
61
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
62
|
-
"@openai/agents": "0.
|
|
62
|
+
"@openai/agents": "0.13.2",
|
|
63
63
|
"@opentelemetry/api": "^1.9.0",
|
|
64
64
|
"@opentelemetry/core": "^2.0.0",
|
|
65
65
|
"@opentelemetry/exporter-trace-otlp-grpc": "^0.220.0",
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
"@anthropic-ai/claude-agent-sdk": "^0.3.148",
|
|
92
92
|
"@grpc/grpc-js": "^1.14.3",
|
|
93
93
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
94
|
-
"@openai/agents": "0.
|
|
94
|
+
"@openai/agents": "0.13.2",
|
|
95
95
|
"@opentelemetry/api": "^1.9.0",
|
|
96
96
|
"@opentelemetry/core": "^2.0.0",
|
|
97
97
|
"@opentelemetry/exporter-trace-otlp-grpc": "^0.220.0",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* @module Context
|
|
9
9
|
*/
|
|
10
10
|
import { Priority, RunOpts, TaskWorkflowDeclaration, BaseWorkflowDeclaration as WorkflowV1 } from '../../declaration';
|
|
11
|
-
import { Action } from '../../../clients/dispatcher/action-listener';
|
|
11
|
+
import type { Action } from '../../../clients/dispatcher/action-listener';
|
|
12
12
|
import { Logger, LogLevel } from '../../../util/logger';
|
|
13
13
|
import WorkflowRunRef from '../../../util/workflow-run-ref';
|
|
14
14
|
import { Conditions } from '../../conditions';
|
|
@@ -144,8 +144,15 @@ export declare class Context<T, K = {}> {
|
|
|
144
144
|
/**
|
|
145
145
|
* Gets the name of the current workflow.
|
|
146
146
|
* @returns The name of the workflow.
|
|
147
|
+
* @deprecated This method returns the task name. Use {@link workflowNameV1} for the workflow
|
|
148
|
+
* name or {@link taskName} for the task name.
|
|
147
149
|
*/
|
|
148
150
|
workflowName(): string;
|
|
151
|
+
/**
|
|
152
|
+
* Gets the name of the current workflow.
|
|
153
|
+
* @returns The name of the workflow.
|
|
154
|
+
*/
|
|
155
|
+
workflowNameV1(): string;
|
|
149
156
|
/**
|
|
150
157
|
* Gets the user data associated with the workflow.
|
|
151
158
|
* @returns The user data.
|
|
@@ -24,6 +24,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
24
24
|
exports.DurableContext = exports.Context = exports.ContextWorker = void 0;
|
|
25
25
|
const declaration_1 = require("../../declaration");
|
|
26
26
|
const hatchet_error_1 = __importDefault(require("../../../util/errors/hatchet-error"));
|
|
27
|
+
const action_listener_1 = require("../../../clients/dispatcher/action-listener");
|
|
27
28
|
const parse_1 = require("../../../util/parse");
|
|
28
29
|
const conditions_1 = require("../../conditions");
|
|
29
30
|
const transformer_1 = require("../../conditions/transformer");
|
|
@@ -210,10 +211,19 @@ class Context {
|
|
|
210
211
|
/**
|
|
211
212
|
* Gets the name of the current workflow.
|
|
212
213
|
* @returns The name of the workflow.
|
|
214
|
+
* @deprecated This method returns the task name. Use {@link workflowNameV1} for the workflow
|
|
215
|
+
* name or {@link taskName} for the task name.
|
|
213
216
|
*/
|
|
214
217
|
workflowName() {
|
|
215
218
|
return this.action.jobName;
|
|
216
219
|
}
|
|
220
|
+
/**
|
|
221
|
+
* Gets the name of the current workflow.
|
|
222
|
+
* @returns The name of the workflow.
|
|
223
|
+
*/
|
|
224
|
+
workflowNameV1() {
|
|
225
|
+
return (0, action_listener_1.workflowNameFromAction)(this.action);
|
|
226
|
+
}
|
|
217
227
|
/**
|
|
218
228
|
* Gets the user data associated with the workflow.
|
|
219
229
|
* @returns The user data.
|
|
@@ -288,7 +298,7 @@ class Context {
|
|
|
288
298
|
return Promise.resolve();
|
|
289
299
|
}
|
|
290
300
|
const logger = this.v1.config.logger('ctx', this.v1.config.log_level);
|
|
291
|
-
const contextExtra = Object.assign({ workflowRunId: this.action.workflowRunId, taskRunExternalId: this.action.taskRunExternalId, retryCount: this.action.retryCount, workflowName: this.
|
|
301
|
+
const contextExtra = Object.assign({ workflowRunId: this.action.workflowRunId, taskRunExternalId: this.action.taskRunExternalId, retryCount: this.action.retryCount, workflowName: this.workflowNameV1() }, extra === null || extra === void 0 ? void 0 : extra.extra);
|
|
292
302
|
const promises = [];
|
|
293
303
|
if (!level || level === 'INFO') {
|
|
294
304
|
promises.push(logger.info(message, contextExtra));
|
package/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const HATCHET_VERSION = "1.26.
|
|
1
|
+
export declare const HATCHET_VERSION = "1.26.1";
|
package/version.js
CHANGED