@hatchet-dev/typescript-sdk 1.35.1 → 1.37.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/clients/rest/generated/Api.d.ts +85 -1
- package/clients/rest/generated/Api.js +30 -0
- package/clients/rest/generated/data-contracts.d.ts +11 -0
- package/package.json +1 -1
- package/protoc/dispatcher/dispatcher.d.ts +4 -0
- package/protoc/dispatcher/dispatcher.js +42 -2
- package/protoc/v1/streams.d.ts +34 -0
- package/protoc/v1/streams.js +279 -5
- package/protoc-es/dispatcher/dispatcher_pb.d.ts +12 -0
- package/protoc-es/dispatcher/dispatcher_pb.js +1 -1
- package/protoc-es/v1/streams_pb.d.ts +79 -0
- package/protoc-es/v1/streams_pb.js +12 -2
- package/v1/client/duration.js +3 -3
- package/v1/client/features/streams.d.ts +22 -0
- package/v1/client/features/streams.js +93 -13
- package/v1/client/worker/engine-version.d.ts +2 -0
- package/v1/client/worker/engine-version.js +7 -0
- package/v1/client/worker/worker-internal.d.ts +2 -0
- package/v1/client/worker/worker-internal.js +20 -1
- package/v1/examples/durable-streams/benchmark.d.ts +34 -0
- package/v1/examples/durable-streams/benchmark.js +120 -0
- package/v1/examples/e2e-worker.js +52 -49
- package/v1/examples/retry_after/run.d.ts +1 -0
- package/v1/examples/retry_after/run.js +21 -0
- package/v1/examples/retry_after/worker.d.ts +1 -0
- package/v1/examples/retry_after/worker.js +24 -0
- package/v1/examples/retry_after/workflow.d.ts +9 -0
- package/v1/examples/retry_after/workflow.js +40 -0
- package/v1/task.d.ts +13 -0
- package/v1/task.js +14 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/v1/examples/durable-streams/publish-latency.d.ts +0 -15
- package/v1/examples/durable-streams/publish-latency.js +0 -50
|
@@ -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, 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';
|
|
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, V1StreamPayloadRef, V1TaskEventList, V1TaskPointMetrics, V1TaskRunMetrics, V1TaskStatus, V1TaskSummary, V1TaskSummaryList, V1TaskTimingList, V1TriggerWorkflowRunRequest, V1UpdateFilterRequest, V1UpdateWebhookRequest, V1Webhook, V1WebhookList, V1WebhookResponse, V1WebhookSourceName, V1WorkflowRunCount, 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
|
/**
|
|
@@ -257,7 +257,65 @@ export declare class Api<SecurityDataType = unknown> extends HttpClient<Security
|
|
|
257
257
|
running_filter?: V1RunningFilter;
|
|
258
258
|
/** The idempotency key(s) to filter for */
|
|
259
259
|
idempotency_keys?: string[];
|
|
260
|
+
/** A flag for whether or not to count the matching runs in order to populate `pagination.num_pages`. Defaults to `true` if unset. When `false`, `pagination.num_pages` is `0`, and the count can be fetched separately from the count endpoint. */
|
|
261
|
+
include_num_pages?: boolean;
|
|
260
262
|
}, params?: RequestParams) => Promise<import("axios").AxiosResponse<V1TaskSummaryList, any, {}>>;
|
|
263
|
+
/**
|
|
264
|
+
* @description Counts the workflow runs for a tenant matching the provided filters. The count is capped, so it is a lower bound when it reaches the cap.
|
|
265
|
+
*
|
|
266
|
+
* @tags Workflow Runs
|
|
267
|
+
* @name V1WorkflowRunCountGet
|
|
268
|
+
* @summary Count workflow runs
|
|
269
|
+
* @request GET:/api/v1/stable/tenants/{tenant}/workflow-runs/count
|
|
270
|
+
* @secure
|
|
271
|
+
*/
|
|
272
|
+
v1WorkflowRunCountGet: (tenant: string, query: {
|
|
273
|
+
/** A list of statuses to filter by */
|
|
274
|
+
statuses?: V1TaskStatus[];
|
|
275
|
+
/**
|
|
276
|
+
* The earliest date to filter by
|
|
277
|
+
* @format date-time
|
|
278
|
+
*/
|
|
279
|
+
since: string;
|
|
280
|
+
/**
|
|
281
|
+
* The latest date to filter by
|
|
282
|
+
* @format date-time
|
|
283
|
+
*/
|
|
284
|
+
until?: string;
|
|
285
|
+
/** Additional metadata k-v pairs to filter by */
|
|
286
|
+
additional_metadata?: string[];
|
|
287
|
+
/** How to combine multiple additional_metadata pairs. OR matches runs containing any pair, AND matches runs containing all pairs. Defaults to OR. */
|
|
288
|
+
additional_metadata_operator?: V1AdditionalMetadataOperator;
|
|
289
|
+
/** The workflow ids to find runs for */
|
|
290
|
+
workflow_ids?: string[];
|
|
291
|
+
/**
|
|
292
|
+
* The worker id to filter by
|
|
293
|
+
* @format uuid
|
|
294
|
+
* @minLength 36
|
|
295
|
+
* @maxLength 36
|
|
296
|
+
*/
|
|
297
|
+
worker_id?: string;
|
|
298
|
+
/** Whether to include DAGs or only to include tasks */
|
|
299
|
+
only_tasks: boolean;
|
|
300
|
+
/**
|
|
301
|
+
* The parent task external id to filter by
|
|
302
|
+
* @format uuid
|
|
303
|
+
* @minLength 36
|
|
304
|
+
* @maxLength 36
|
|
305
|
+
*/
|
|
306
|
+
parent_task_external_id?: string;
|
|
307
|
+
/**
|
|
308
|
+
* The external id of the event that triggered the workflow run
|
|
309
|
+
* @format uuid
|
|
310
|
+
* @minLength 36
|
|
311
|
+
* @maxLength 36
|
|
312
|
+
*/
|
|
313
|
+
triggering_event_external_id?: string;
|
|
314
|
+
/** 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. */
|
|
315
|
+
running_filter?: V1RunningFilter;
|
|
316
|
+
/** The idempotency key(s) to filter for */
|
|
317
|
+
idempotency_keys?: string[];
|
|
318
|
+
}, params?: RequestParams) => Promise<import("axios").AxiosResponse<V1WorkflowRunCount, any, {}>>;
|
|
261
319
|
/**
|
|
262
320
|
* @description Lists displayable names of workflow runs for a tenant
|
|
263
321
|
*
|
|
@@ -341,6 +399,32 @@ export declare class Api<SecurityDataType = unknown> extends HttpClient<Security
|
|
|
341
399
|
*/
|
|
342
400
|
limit?: number;
|
|
343
401
|
}, params?: RequestParams) => Promise<import("axios").AxiosResponse<V1DurableEventLogList, any, {}>>;
|
|
402
|
+
/**
|
|
403
|
+
* @description Get a durable stream payload uploaded ahead of its publish, by the payload_ref of the message that references it.
|
|
404
|
+
*
|
|
405
|
+
* @tags Streams
|
|
406
|
+
* @name V1StreamPayloadGet
|
|
407
|
+
* @summary Get stream payload
|
|
408
|
+
* @request GET:/api/v1/stable/tenants/{tenant}/streams/payloads
|
|
409
|
+
* @secure
|
|
410
|
+
*/
|
|
411
|
+
v1StreamPayloadGet: (tenant: string, query: {
|
|
412
|
+
/** The payload_ref of the stream message */
|
|
413
|
+
ref: string;
|
|
414
|
+
}, params?: RequestParams) => Promise<import("axios").AxiosResponse<File, any, {}>>;
|
|
415
|
+
/**
|
|
416
|
+
* @description Upload a payload too large for a gRPC publish, then publish the message with the returned ref as its payload_ref.
|
|
417
|
+
*
|
|
418
|
+
* @tags Streams
|
|
419
|
+
* @name V1StreamPayloadUpload
|
|
420
|
+
* @summary Upload stream payload
|
|
421
|
+
* @request POST:/api/v1/stable/tenants/{tenant}/streams/payloads
|
|
422
|
+
* @secure
|
|
423
|
+
*/
|
|
424
|
+
v1StreamPayloadUpload: (tenant: string, data: {
|
|
425
|
+
/** @format binary */
|
|
426
|
+
payload: File;
|
|
427
|
+
}, params?: RequestParams) => Promise<import("axios").AxiosResponse<V1StreamPayloadRef, any, {}>>;
|
|
344
428
|
/**
|
|
345
429
|
* @description Get a workflow run and its metadata to display on the "detail" page
|
|
346
430
|
*
|
|
@@ -116,6 +116,16 @@ class Api extends http_client_1.HttpClient {
|
|
|
116
116
|
* @secure
|
|
117
117
|
*/
|
|
118
118
|
this.v1WorkflowRunList = (tenant, query, params = {}) => this.request(Object.assign({ path: `/api/v1/stable/tenants/${tenant}/workflow-runs`, method: 'GET', query: query, secure: true, format: 'json' }, params));
|
|
119
|
+
/**
|
|
120
|
+
* @description Counts the workflow runs for a tenant matching the provided filters. The count is capped, so it is a lower bound when it reaches the cap.
|
|
121
|
+
*
|
|
122
|
+
* @tags Workflow Runs
|
|
123
|
+
* @name V1WorkflowRunCountGet
|
|
124
|
+
* @summary Count workflow runs
|
|
125
|
+
* @request GET:/api/v1/stable/tenants/{tenant}/workflow-runs/count
|
|
126
|
+
* @secure
|
|
127
|
+
*/
|
|
128
|
+
this.v1WorkflowRunCountGet = (tenant, query, params = {}) => this.request(Object.assign({ path: `/api/v1/stable/tenants/${tenant}/workflow-runs/count`, method: 'GET', query: query, secure: true, format: 'json' }, params));
|
|
119
129
|
/**
|
|
120
130
|
* @description Lists displayable names of workflow runs for a tenant
|
|
121
131
|
*
|
|
@@ -166,6 +176,26 @@ class Api extends http_client_1.HttpClient {
|
|
|
166
176
|
* @secure
|
|
167
177
|
*/
|
|
168
178
|
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));
|
|
179
|
+
/**
|
|
180
|
+
* @description Get a durable stream payload uploaded ahead of its publish, by the payload_ref of the message that references it.
|
|
181
|
+
*
|
|
182
|
+
* @tags Streams
|
|
183
|
+
* @name V1StreamPayloadGet
|
|
184
|
+
* @summary Get stream payload
|
|
185
|
+
* @request GET:/api/v1/stable/tenants/{tenant}/streams/payloads
|
|
186
|
+
* @secure
|
|
187
|
+
*/
|
|
188
|
+
this.v1StreamPayloadGet = (tenant, query, params = {}) => this.request(Object.assign({ path: `/api/v1/stable/tenants/${tenant}/streams/payloads`, method: 'GET', query: query, secure: true }, params));
|
|
189
|
+
/**
|
|
190
|
+
* @description Upload a payload too large for a gRPC publish, then publish the message with the returned ref as its payload_ref.
|
|
191
|
+
*
|
|
192
|
+
* @tags Streams
|
|
193
|
+
* @name V1StreamPayloadUpload
|
|
194
|
+
* @summary Upload stream payload
|
|
195
|
+
* @request POST:/api/v1/stable/tenants/{tenant}/streams/payloads
|
|
196
|
+
* @secure
|
|
197
|
+
*/
|
|
198
|
+
this.v1StreamPayloadUpload = (tenant, data, params = {}) => this.request(Object.assign({ path: `/api/v1/stable/tenants/${tenant}/streams/payloads`, method: 'POST', body: data, secure: true, type: http_client_1.ContentType.FormData, format: 'json' }, params));
|
|
169
199
|
/**
|
|
170
200
|
* @description Get a workflow run and its metadata to display on the "detail" page
|
|
171
201
|
*
|
|
@@ -574,6 +574,13 @@ export interface V1TaskSummaryList {
|
|
|
574
574
|
/** The list of tasks */
|
|
575
575
|
rows: V1TaskSummary[];
|
|
576
576
|
}
|
|
577
|
+
export interface V1WorkflowRunCount {
|
|
578
|
+
/**
|
|
579
|
+
* The number of workflow runs matching the filters
|
|
580
|
+
* @format int64
|
|
581
|
+
*/
|
|
582
|
+
count: number;
|
|
583
|
+
}
|
|
577
584
|
export interface V1WorkflowRunDisplayName {
|
|
578
585
|
metadata: APIResourceMeta;
|
|
579
586
|
displayName: string;
|
|
@@ -766,6 +773,10 @@ export interface V1DurableEventLogEntry {
|
|
|
766
773
|
taskDisplayName: string;
|
|
767
774
|
}
|
|
768
775
|
export type V1DurableEventLogList = V1DurableEventLogEntry[];
|
|
776
|
+
export interface V1StreamPayloadRef {
|
|
777
|
+
/** Publish the message with this as its payload_ref */
|
|
778
|
+
ref: string;
|
|
779
|
+
}
|
|
769
780
|
export interface OtelSpan {
|
|
770
781
|
traceId: string;
|
|
771
782
|
spanId: string;
|
package/package.json
CHANGED
|
@@ -252,6 +252,8 @@ export interface StepActionEvent {
|
|
|
252
252
|
retryCount?: number | undefined;
|
|
253
253
|
/** a flag indicating if the task should _not_ be retried */
|
|
254
254
|
shouldNotRetry?: boolean | undefined;
|
|
255
|
+
/** the delay in milliseconds before the next attempt (FAILED only) */
|
|
256
|
+
retryAfterMs?: number | undefined;
|
|
255
257
|
}
|
|
256
258
|
export interface BatchActionEventItem {
|
|
257
259
|
/** the task external run id */
|
|
@@ -262,6 +264,8 @@ export interface BatchActionEventItem {
|
|
|
262
264
|
retryCount?: number | undefined;
|
|
263
265
|
/** a flag indicating if the task should _not_ be retried (FAILED only) */
|
|
264
266
|
shouldNotRetry?: boolean | undefined;
|
|
267
|
+
/** the delay in milliseconds before the next attempt (FAILED only) */
|
|
268
|
+
retryAfterMs?: number | undefined;
|
|
265
269
|
}
|
|
266
270
|
export interface BatchActionEvent {
|
|
267
271
|
/** the id of the worker */
|
|
@@ -2322,6 +2322,7 @@ function createBaseStepActionEvent() {
|
|
|
2322
2322
|
eventPayload: '',
|
|
2323
2323
|
retryCount: undefined,
|
|
2324
2324
|
shouldNotRetry: undefined,
|
|
2325
|
+
retryAfterMs: undefined,
|
|
2325
2326
|
};
|
|
2326
2327
|
}
|
|
2327
2328
|
exports.StepActionEvent = {
|
|
@@ -2359,6 +2360,9 @@ exports.StepActionEvent = {
|
|
|
2359
2360
|
if (message.shouldNotRetry !== undefined) {
|
|
2360
2361
|
writer.uint32(88).bool(message.shouldNotRetry);
|
|
2361
2362
|
}
|
|
2363
|
+
if (message.retryAfterMs !== undefined) {
|
|
2364
|
+
writer.uint32(96).int64(message.retryAfterMs);
|
|
2365
|
+
}
|
|
2362
2366
|
return writer;
|
|
2363
2367
|
},
|
|
2364
2368
|
decode(input, length) {
|
|
@@ -2445,6 +2449,13 @@ exports.StepActionEvent = {
|
|
|
2445
2449
|
message.shouldNotRetry = reader.bool();
|
|
2446
2450
|
continue;
|
|
2447
2451
|
}
|
|
2452
|
+
case 12: {
|
|
2453
|
+
if (tag !== 96) {
|
|
2454
|
+
break;
|
|
2455
|
+
}
|
|
2456
|
+
message.retryAfterMs = longToNumber(reader.int64());
|
|
2457
|
+
continue;
|
|
2458
|
+
}
|
|
2448
2459
|
}
|
|
2449
2460
|
if ((tag & 7) === 4 || tag === 0) {
|
|
2450
2461
|
break;
|
|
@@ -2510,6 +2521,11 @@ exports.StepActionEvent = {
|
|
|
2510
2521
|
: isSet(object.should_not_retry)
|
|
2511
2522
|
? globalThis.Boolean(object.should_not_retry)
|
|
2512
2523
|
: undefined,
|
|
2524
|
+
retryAfterMs: isSet(object.retryAfterMs)
|
|
2525
|
+
? globalThis.Number(object.retryAfterMs)
|
|
2526
|
+
: isSet(object.retry_after_ms)
|
|
2527
|
+
? globalThis.Number(object.retry_after_ms)
|
|
2528
|
+
: undefined,
|
|
2513
2529
|
};
|
|
2514
2530
|
},
|
|
2515
2531
|
toJSON(message) {
|
|
@@ -2547,13 +2563,16 @@ exports.StepActionEvent = {
|
|
|
2547
2563
|
if (message.shouldNotRetry !== undefined) {
|
|
2548
2564
|
obj.shouldNotRetry = message.shouldNotRetry;
|
|
2549
2565
|
}
|
|
2566
|
+
if (message.retryAfterMs !== undefined) {
|
|
2567
|
+
obj.retryAfterMs = Math.round(message.retryAfterMs);
|
|
2568
|
+
}
|
|
2550
2569
|
return obj;
|
|
2551
2570
|
},
|
|
2552
2571
|
create(base) {
|
|
2553
2572
|
return exports.StepActionEvent.fromPartial(base !== null && base !== void 0 ? base : {});
|
|
2554
2573
|
},
|
|
2555
2574
|
fromPartial(object) {
|
|
2556
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
2575
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
2557
2576
|
const message = createBaseStepActionEvent();
|
|
2558
2577
|
message.workerId = (_a = object.workerId) !== null && _a !== void 0 ? _a : '';
|
|
2559
2578
|
message.jobId = (_b = object.jobId) !== null && _b !== void 0 ? _b : '';
|
|
@@ -2566,6 +2585,7 @@ exports.StepActionEvent = {
|
|
|
2566
2585
|
message.eventPayload = (_j = object.eventPayload) !== null && _j !== void 0 ? _j : '';
|
|
2567
2586
|
message.retryCount = (_k = object.retryCount) !== null && _k !== void 0 ? _k : undefined;
|
|
2568
2587
|
message.shouldNotRetry = (_l = object.shouldNotRetry) !== null && _l !== void 0 ? _l : undefined;
|
|
2588
|
+
message.retryAfterMs = (_m = object.retryAfterMs) !== null && _m !== void 0 ? _m : undefined;
|
|
2569
2589
|
return message;
|
|
2570
2590
|
},
|
|
2571
2591
|
};
|
|
@@ -2575,6 +2595,7 @@ function createBaseBatchActionEventItem() {
|
|
|
2575
2595
|
eventPayload: '',
|
|
2576
2596
|
retryCount: undefined,
|
|
2577
2597
|
shouldNotRetry: undefined,
|
|
2598
|
+
retryAfterMs: undefined,
|
|
2578
2599
|
};
|
|
2579
2600
|
}
|
|
2580
2601
|
exports.BatchActionEventItem = {
|
|
@@ -2591,6 +2612,9 @@ exports.BatchActionEventItem = {
|
|
|
2591
2612
|
if (message.shouldNotRetry !== undefined) {
|
|
2592
2613
|
writer.uint32(32).bool(message.shouldNotRetry);
|
|
2593
2614
|
}
|
|
2615
|
+
if (message.retryAfterMs !== undefined) {
|
|
2616
|
+
writer.uint32(40).int64(message.retryAfterMs);
|
|
2617
|
+
}
|
|
2594
2618
|
return writer;
|
|
2595
2619
|
},
|
|
2596
2620
|
decode(input, length) {
|
|
@@ -2628,6 +2652,13 @@ exports.BatchActionEventItem = {
|
|
|
2628
2652
|
message.shouldNotRetry = reader.bool();
|
|
2629
2653
|
continue;
|
|
2630
2654
|
}
|
|
2655
|
+
case 5: {
|
|
2656
|
+
if (tag !== 40) {
|
|
2657
|
+
break;
|
|
2658
|
+
}
|
|
2659
|
+
message.retryAfterMs = longToNumber(reader.int64());
|
|
2660
|
+
continue;
|
|
2661
|
+
}
|
|
2631
2662
|
}
|
|
2632
2663
|
if ((tag & 7) === 4 || tag === 0) {
|
|
2633
2664
|
break;
|
|
@@ -2658,6 +2689,11 @@ exports.BatchActionEventItem = {
|
|
|
2658
2689
|
: isSet(object.should_not_retry)
|
|
2659
2690
|
? globalThis.Boolean(object.should_not_retry)
|
|
2660
2691
|
: undefined,
|
|
2692
|
+
retryAfterMs: isSet(object.retryAfterMs)
|
|
2693
|
+
? globalThis.Number(object.retryAfterMs)
|
|
2694
|
+
: isSet(object.retry_after_ms)
|
|
2695
|
+
? globalThis.Number(object.retry_after_ms)
|
|
2696
|
+
: undefined,
|
|
2661
2697
|
};
|
|
2662
2698
|
},
|
|
2663
2699
|
toJSON(message) {
|
|
@@ -2674,18 +2710,22 @@ exports.BatchActionEventItem = {
|
|
|
2674
2710
|
if (message.shouldNotRetry !== undefined) {
|
|
2675
2711
|
obj.shouldNotRetry = message.shouldNotRetry;
|
|
2676
2712
|
}
|
|
2713
|
+
if (message.retryAfterMs !== undefined) {
|
|
2714
|
+
obj.retryAfterMs = Math.round(message.retryAfterMs);
|
|
2715
|
+
}
|
|
2677
2716
|
return obj;
|
|
2678
2717
|
},
|
|
2679
2718
|
create(base) {
|
|
2680
2719
|
return exports.BatchActionEventItem.fromPartial(base !== null && base !== void 0 ? base : {});
|
|
2681
2720
|
},
|
|
2682
2721
|
fromPartial(object) {
|
|
2683
|
-
var _a, _b, _c, _d;
|
|
2722
|
+
var _a, _b, _c, _d, _e;
|
|
2684
2723
|
const message = createBaseBatchActionEventItem();
|
|
2685
2724
|
message.taskRunExternalId = (_a = object.taskRunExternalId) !== null && _a !== void 0 ? _a : '';
|
|
2686
2725
|
message.eventPayload = (_b = object.eventPayload) !== null && _b !== void 0 ? _b : '';
|
|
2687
2726
|
message.retryCount = (_c = object.retryCount) !== null && _c !== void 0 ? _c : undefined;
|
|
2688
2727
|
message.shouldNotRetry = (_d = object.shouldNotRetry) !== null && _d !== void 0 ? _d : undefined;
|
|
2728
|
+
message.retryAfterMs = (_e = object.retryAfterMs) !== null && _e !== void 0 ? _e : undefined;
|
|
2689
2729
|
return message;
|
|
2690
2730
|
},
|
|
2691
2731
|
};
|
package/protoc/v1/streams.d.ts
CHANGED
|
@@ -7,6 +7,11 @@ export interface PublishStreamMessageRequest {
|
|
|
7
7
|
payload: Uint8Array;
|
|
8
8
|
producerId: string;
|
|
9
9
|
producerSeq: number;
|
|
10
|
+
/**
|
|
11
|
+
* instead of payload: a ref returned by the stream payload upload endpoint,
|
|
12
|
+
* for payloads too large for one gRPC message
|
|
13
|
+
*/
|
|
14
|
+
payloadRef: string;
|
|
10
15
|
}
|
|
11
16
|
export interface PublishStreamMessageResponse {
|
|
12
17
|
}
|
|
@@ -24,12 +29,31 @@ export interface StreamEntry {
|
|
|
24
29
|
payload: Uint8Array;
|
|
25
30
|
cursor: string;
|
|
26
31
|
createdAt: Date | undefined;
|
|
32
|
+
/** instead of payload: fetch it from the stream payload endpoint by this ref */
|
|
33
|
+
payloadRef: string;
|
|
34
|
+
}
|
|
35
|
+
export interface GetStreamTopicMetadataRequest {
|
|
36
|
+
namespace: string;
|
|
37
|
+
topic: string;
|
|
38
|
+
}
|
|
39
|
+
/** Counts and the latest message cover only what's within the tenant's retention. */
|
|
40
|
+
export interface StreamTopicMetadata {
|
|
41
|
+
namespace: string;
|
|
42
|
+
topic: string;
|
|
43
|
+
tenantId: string;
|
|
44
|
+
/** resumes a subscription after the newest retained message; unset when none is retained */
|
|
45
|
+
latestCursor?: string | undefined;
|
|
46
|
+
messageCount: number;
|
|
47
|
+
/** when the newest retained message was stored; unset when none is retained */
|
|
48
|
+
lastPublishedAt: Date | undefined;
|
|
27
49
|
}
|
|
28
50
|
export declare const PublishStreamMessageRequest: MessageFns<PublishStreamMessageRequest>;
|
|
29
51
|
export declare const PublishStreamMessageResponse: MessageFns<PublishStreamMessageResponse>;
|
|
30
52
|
export declare const SubscribeStreamRequest: MessageFns<SubscribeStreamRequest>;
|
|
31
53
|
export declare const StreamMessage: MessageFns<StreamMessage>;
|
|
32
54
|
export declare const StreamEntry: MessageFns<StreamEntry>;
|
|
55
|
+
export declare const GetStreamTopicMetadataRequest: MessageFns<GetStreamTopicMetadataRequest>;
|
|
56
|
+
export declare const StreamTopicMetadata: MessageFns<StreamTopicMetadata>;
|
|
33
57
|
export type V1StreamsDefinition = typeof V1StreamsDefinition;
|
|
34
58
|
export declare const V1StreamsDefinition: {
|
|
35
59
|
readonly name: "V1Streams";
|
|
@@ -51,15 +75,25 @@ export declare const V1StreamsDefinition: {
|
|
|
51
75
|
readonly responseStream: true;
|
|
52
76
|
readonly options: {};
|
|
53
77
|
};
|
|
78
|
+
readonly getTopicMetadata: {
|
|
79
|
+
readonly name: "GetTopicMetadata";
|
|
80
|
+
readonly requestType: typeof GetStreamTopicMetadataRequest;
|
|
81
|
+
readonly requestStream: false;
|
|
82
|
+
readonly responseType: typeof StreamTopicMetadata;
|
|
83
|
+
readonly responseStream: false;
|
|
84
|
+
readonly options: {};
|
|
85
|
+
};
|
|
54
86
|
};
|
|
55
87
|
};
|
|
56
88
|
export interface V1StreamsServiceImplementation<CallContextExt = {}> {
|
|
57
89
|
publish(request: PublishStreamMessageRequest, context: CallContext & CallContextExt): Promise<DeepPartial<PublishStreamMessageResponse>>;
|
|
58
90
|
subscribe(request: SubscribeStreamRequest, context: CallContext & CallContextExt): ServerStreamingMethodResult<DeepPartial<StreamMessage>>;
|
|
91
|
+
getTopicMetadata(request: GetStreamTopicMetadataRequest, context: CallContext & CallContextExt): Promise<DeepPartial<StreamTopicMetadata>>;
|
|
59
92
|
}
|
|
60
93
|
export interface V1StreamsClient<CallOptionsExt = {}> {
|
|
61
94
|
publish(request: DeepPartial<PublishStreamMessageRequest>, options?: CallOptions & CallOptionsExt): Promise<PublishStreamMessageResponse>;
|
|
62
95
|
subscribe(request: DeepPartial<SubscribeStreamRequest>, options?: CallOptions & CallOptionsExt): AsyncIterable<StreamMessage>;
|
|
96
|
+
getTopicMetadata(request: DeepPartial<GetStreamTopicMetadataRequest>, options?: CallOptions & CallOptionsExt): Promise<StreamTopicMetadata>;
|
|
63
97
|
}
|
|
64
98
|
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
65
99
|
export type DeepPartial<T> = T extends Builtin ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
|