@trigger.dev/sdk 4.6.4 → 4.7.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/dist/commonjs/v3/ai.d.ts +5 -2
- package/dist/commonjs/v3/ai.js +189 -266
- package/dist/commonjs/v3/ai.js.map +1 -1
- package/dist/commonjs/v3/chat-client.js +7 -0
- package/dist/commonjs/v3/chat-client.js.map +1 -1
- package/dist/commonjs/v3/chat-server.d.ts +1 -0
- package/dist/commonjs/v3/chat-server.js +8 -0
- package/dist/commonjs/v3/chat-server.js.map +1 -1
- package/dist/commonjs/v3/chat.d.ts +28 -4
- package/dist/commonjs/v3/chat.js +41 -9
- package/dist/commonjs/v3/chat.js.map +1 -1
- package/dist/commonjs/v3/chatRouteWait.d.ts +21 -0
- package/dist/commonjs/v3/chatRouteWait.js +43 -0
- package/dist/commonjs/v3/chatRouteWait.js.map +1 -0
- package/dist/commonjs/v3/compactionResponse.js +5 -0
- package/dist/commonjs/v3/compactionResponse.js.map +1 -1
- package/dist/commonjs/v3/concurrency-shared.d.ts +13 -0
- package/dist/commonjs/v3/concurrency-shared.js +35 -0
- package/dist/commonjs/v3/concurrency-shared.js.map +1 -0
- package/dist/commonjs/v3/concurrencyLimits.d.ts +73 -0
- package/dist/commonjs/v3/concurrencyLimits.js +166 -0
- package/dist/commonjs/v3/concurrencyLimits.js.map +1 -0
- package/dist/commonjs/v3/index.d.ts +2 -1
- package/dist/commonjs/v3/index.js +3 -1
- package/dist/commonjs/v3/index.js.map +1 -1
- package/dist/commonjs/v3/managedChatResponse.d.ts +44 -0
- package/dist/commonjs/v3/managedChatResponse.js +233 -0
- package/dist/commonjs/v3/managedChatResponse.js.map +1 -0
- package/dist/commonjs/v3/queues.d.ts +31 -0
- package/dist/commonjs/v3/queues.js +31 -0
- package/dist/commonjs/v3/queues.js.map +1 -1
- package/dist/commonjs/v3/shared.d.ts +18 -1
- package/dist/commonjs/v3/shared.js +137 -47
- package/dist/commonjs/v3/shared.js.map +1 -1
- package/dist/commonjs/v3/steeringContext.d.ts +41 -0
- package/dist/commonjs/v3/steeringContext.js +118 -0
- package/dist/commonjs/v3/steeringContext.js.map +1 -0
- package/dist/commonjs/v3/transcriptStorage.d.ts +4 -1
- package/dist/commonjs/v3/transcriptStorage.js +51 -4
- package/dist/commonjs/v3/transcriptStorage.js.map +1 -1
- package/dist/commonjs/version.js +1 -1
- package/dist/esm/v3/ai.d.ts +5 -2
- package/dist/esm/v3/ai.js +189 -266
- package/dist/esm/v3/ai.js.map +1 -1
- package/dist/esm/v3/chat-client.js +7 -0
- package/dist/esm/v3/chat-client.js.map +1 -1
- package/dist/esm/v3/chat-server.d.ts +1 -0
- package/dist/esm/v3/chat-server.js +8 -0
- package/dist/esm/v3/chat-server.js.map +1 -1
- package/dist/esm/v3/chat.d.ts +28 -4
- package/dist/esm/v3/chat.js +41 -9
- package/dist/esm/v3/chat.js.map +1 -1
- package/dist/esm/v3/chatRouteWait.d.ts +21 -0
- package/dist/esm/v3/chatRouteWait.js +40 -0
- package/dist/esm/v3/chatRouteWait.js.map +1 -0
- package/dist/esm/v3/compactionResponse.js +5 -0
- package/dist/esm/v3/compactionResponse.js.map +1 -1
- package/dist/esm/v3/concurrency-shared.d.ts +13 -0
- package/dist/esm/v3/concurrency-shared.js +31 -0
- package/dist/esm/v3/concurrency-shared.js.map +1 -0
- package/dist/esm/v3/concurrencyLimits.d.ts +73 -0
- package/dist/esm/v3/concurrencyLimits.js +158 -0
- package/dist/esm/v3/concurrencyLimits.js.map +1 -0
- package/dist/esm/v3/index.d.ts +2 -1
- package/dist/esm/v3/index.js +2 -1
- package/dist/esm/v3/index.js.map +1 -1
- package/dist/esm/v3/managedChatResponse.d.ts +44 -0
- package/dist/esm/v3/managedChatResponse.js +228 -0
- package/dist/esm/v3/managedChatResponse.js.map +1 -0
- package/dist/esm/v3/queues.d.ts +31 -0
- package/dist/esm/v3/queues.js +31 -0
- package/dist/esm/v3/queues.js.map +1 -1
- package/dist/esm/v3/shared.d.ts +18 -1
- package/dist/esm/v3/shared.js +136 -47
- package/dist/esm/v3/shared.js.map +1 -1
- package/dist/esm/v3/steeringContext.d.ts +41 -0
- package/dist/esm/v3/steeringContext.js +113 -0
- package/dist/esm/v3/steeringContext.js.map +1 -0
- package/dist/esm/v3/transcriptStorage.d.ts +4 -1
- package/dist/esm/v3/transcriptStorage.js +51 -4
- package/dist/esm/v3/transcriptStorage.js.map +1 -1
- package/dist/esm/version.js +1 -1
- package/docs/ai-chat/client-protocol.mdx +3 -1
- package/docs/ai-chat/error-handling.mdx +44 -76
- package/docs/ai-chat/fast-starts.mdx +1 -1
- package/docs/ai-chat/frontend.mdx +27 -21
- package/docs/ai-chat/patterns/branching-conversations.mdx +95 -230
- package/docs/ai-chat/patterns/human-in-the-loop.mdx +166 -164
- package/docs/ai-chat/patterns/tool-result-auditing.mdx +28 -27
- package/docs/ai-chat/patterns/version-upgrades.mdx +4 -4
- package/docs/ai-chat/pending-messages.mdx +19 -5
- package/docs/ai-chat/quick-start.mdx +26 -20
- package/docs/ai-chat/reference.mdx +21 -3
- package/docs/ai-chat/sessions.mdx +1 -1
- package/docs/ai-chat/testing.mdx +16 -4
- package/docs/concurrency.mdx +384 -0
- package/docs/database-connections.mdx +3 -3
- package/docs/deploy-environment-variables.mdx +6 -0
- package/docs/deployment/atomic-deployment.mdx +416 -132
- package/docs/deployment/overview.mdx +2 -2
- package/docs/github-actions.mdx +2 -2
- package/docs/github-integration.mdx +2 -2
- package/docs/idempotency.mdx +43 -5
- package/docs/introduction.mdx +1 -1
- package/docs/limits.mdx +16 -6
- package/docs/observability/query.mdx +25 -0
- package/docs/queues.mdx +271 -0
- package/docs/reports.mdx +1 -1
- package/docs/runs/priority.mdx +2 -25
- package/docs/self-hosting/env/webapp.mdx +7 -0
- package/docs/tasks/overview.mdx +3 -5
- package/docs/troubleshooting-alerts.mdx +124 -1
- package/docs/troubleshooting.mdx +12 -0
- package/docs/vercel-integration.mdx +6 -7
- package/docs/versioning.mdx +1 -1
- package/docs/writing-tasks-introduction.mdx +2 -1
- package/package.json +2 -2
- package/docs/deployment/version-skew-protection.mdx +0 -492
- package/docs/queue-concurrency.mdx +0 -358
package/dist/esm/v3/shared.js
CHANGED
|
@@ -2,31 +2,106 @@ import { SpanKind } from "@opentelemetry/api";
|
|
|
2
2
|
import { accessoryAttributes, apiClientManager, ApiError, conditionallyExportPacket, conditionallyImportPacket, convertToolParametersToSchema, createErrorFromCauses, createErrorTaskError, defaultRetryOptions, flattenIdempotencyKey, generateFriendlyId, getIdempotencyKeyOptions, getSchemaParseFn, lifecycleHooks, makeIdempotencyKey, packetRequiresOffloading, parsePacket, RateLimitError, resourceCatalog, runtime, SemanticInternalAttributes, stringifyIO, SubtaskUnwrapError, taskContext, TaskRunPromise, } from "@trigger.dev/core/v3";
|
|
3
3
|
import { resolveTriggerExternalDeploymentId, scopedEnvVar } from "./externalDeploymentId.js";
|
|
4
4
|
import { tracer } from "./tracer.js";
|
|
5
|
+
import { triggerConcurrencyBody, validateConcurrencyLimitName } from "./concurrency-shared.js";
|
|
5
6
|
export { SubtaskUnwrapError, TaskRunPromise };
|
|
7
|
+
/** A task's `queue` is a queue object or a string reference to a queue defined elsewhere. */
|
|
8
|
+
function normalizeTaskQueue(queue) {
|
|
9
|
+
if (!queue) {
|
|
10
|
+
return {};
|
|
11
|
+
}
|
|
12
|
+
return { queue: typeof queue === "string" ? { name: queue } : queue };
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Validates and normalizes the task `concurrency` option into its manifest shape:
|
|
16
|
+
* at most one inline limit (caps this task) plus up to two named limits (shared).
|
|
17
|
+
*/
|
|
18
|
+
function normalizeTaskConcurrency(taskId, concurrency) {
|
|
19
|
+
if (!concurrency) {
|
|
20
|
+
return undefined;
|
|
21
|
+
}
|
|
22
|
+
const items = Array.isArray(concurrency) ? concurrency : [concurrency];
|
|
23
|
+
const inline = [];
|
|
24
|
+
const limits = [];
|
|
25
|
+
for (const item of items) {
|
|
26
|
+
if (typeof item === "string") {
|
|
27
|
+
limits.push(item);
|
|
28
|
+
}
|
|
29
|
+
else if (item &&
|
|
30
|
+
typeof item === "object" &&
|
|
31
|
+
"name" in item &&
|
|
32
|
+
typeof item.name === "string") {
|
|
33
|
+
validateConcurrencyLimitName(item.name);
|
|
34
|
+
resourceCatalog.registerConcurrencyLimitMetadata(item);
|
|
35
|
+
limits.push(item.name);
|
|
36
|
+
}
|
|
37
|
+
else if (item && typeof item === "object") {
|
|
38
|
+
inline.push({ perKey: item.perKey, total: item.total });
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
if (inline.length > 1) {
|
|
42
|
+
throw new Error(`Task "${taskId}": concurrency accepts at most one inline limit. Give shared limits a name with concurrencyLimit().`);
|
|
43
|
+
}
|
|
44
|
+
if (limits.length > 2) {
|
|
45
|
+
throw new Error(`Task "${taskId}": concurrency accepts at most two named limits.`);
|
|
46
|
+
}
|
|
47
|
+
return {
|
|
48
|
+
inline: inline[0],
|
|
49
|
+
limits: limits.length > 0 ? limits : undefined,
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
/** Builds the queue field of a trigger request body. */
|
|
53
|
+
function triggerQueueBody(queue, fallbackQueueName) {
|
|
54
|
+
const name = queue ?? fallbackQueueName;
|
|
55
|
+
return { queue: name ? { name } : undefined };
|
|
56
|
+
}
|
|
6
57
|
export function queue(options) {
|
|
7
58
|
resourceCatalog.registerQueueMetadata(options);
|
|
8
59
|
// @ts-expect-error
|
|
9
60
|
options[Symbol.for("trigger.dev/queue")] = true;
|
|
10
61
|
return options;
|
|
11
62
|
}
|
|
63
|
+
/**
|
|
64
|
+
* Declares a named, shareable concurrency limit. Tasks hold it via their `concurrency`
|
|
65
|
+
* option; every task holding the same limit draws from the same pools.
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
*
|
|
69
|
+
* ```ts
|
|
70
|
+
* export const openaiLimit = concurrencyLimit({ name: "openai", total: 25 });
|
|
71
|
+
*
|
|
72
|
+
* export const generateSummary = task({
|
|
73
|
+
* id: "generate-summary",
|
|
74
|
+
* concurrency: [{ total: 5 }, openaiLimit],
|
|
75
|
+
* run: async (payload) => {},
|
|
76
|
+
* });
|
|
77
|
+
* ```
|
|
78
|
+
*/
|
|
79
|
+
export function concurrencyLimit(options) {
|
|
80
|
+
validateConcurrencyLimitName(options.name);
|
|
81
|
+
resourceCatalog.registerConcurrencyLimitMetadata(options);
|
|
82
|
+
// @ts-expect-error
|
|
83
|
+
options[Symbol.for("trigger.dev/concurrencyLimit")] = true;
|
|
84
|
+
return options;
|
|
85
|
+
}
|
|
12
86
|
export function createTask(params) {
|
|
87
|
+
const normalizedQueue = normalizeTaskQueue(params.queue);
|
|
13
88
|
const task = {
|
|
14
89
|
id: params.id,
|
|
15
90
|
description: params.description,
|
|
16
91
|
jsonSchema: params.jsonSchema,
|
|
17
92
|
trigger: async (payload, options) => {
|
|
18
93
|
return await trigger_internal("trigger()", params.id, payload, undefined, {
|
|
19
|
-
queue:
|
|
94
|
+
queue: normalizedQueue.queue?.name,
|
|
20
95
|
...options,
|
|
21
96
|
});
|
|
22
97
|
},
|
|
23
98
|
batchTrigger: async (items, options) => {
|
|
24
|
-
return await batchTrigger_internal("batchTrigger()", params.id, items, options, undefined, undefined,
|
|
99
|
+
return await batchTrigger_internal("batchTrigger()", params.id, items, options, undefined, undefined, normalizedQueue.queue?.name);
|
|
25
100
|
},
|
|
26
101
|
triggerAndWait: (payload, options, requestOptions) => {
|
|
27
102
|
return new TaskRunPromise((resolve, reject) => {
|
|
28
103
|
triggerAndWait_internal("triggerAndWait()", params.id, payload, undefined, {
|
|
29
|
-
queue:
|
|
104
|
+
queue: normalizedQueue.queue?.name,
|
|
30
105
|
...options,
|
|
31
106
|
}, requestOptions)
|
|
32
107
|
.then((result) => {
|
|
@@ -40,7 +115,7 @@ export function createTask(params) {
|
|
|
40
115
|
triggerAndSubscribe: (payload, options) => {
|
|
41
116
|
return new TaskRunPromise((resolve, reject) => {
|
|
42
117
|
triggerAndSubscribe_internal("triggerAndSubscribe()", params.id, payload, undefined, {
|
|
43
|
-
queue:
|
|
118
|
+
queue: normalizedQueue.queue?.name,
|
|
44
119
|
...options,
|
|
45
120
|
})
|
|
46
121
|
.then((result) => {
|
|
@@ -52,14 +127,15 @@ export function createTask(params) {
|
|
|
52
127
|
}, params.id);
|
|
53
128
|
},
|
|
54
129
|
batchTriggerAndWait: async (items, options) => {
|
|
55
|
-
return await batchTriggerAndWait_internal("batchTriggerAndWait()", params.id, items, undefined, options, undefined,
|
|
130
|
+
return await batchTriggerAndWait_internal("batchTriggerAndWait()", params.id, items, undefined, options, undefined, normalizedQueue.queue?.name);
|
|
56
131
|
},
|
|
57
132
|
};
|
|
58
133
|
registerTaskLifecycleHooks(params.id, params);
|
|
59
134
|
resourceCatalog.registerTaskMetadata({
|
|
60
135
|
id: params.id,
|
|
61
136
|
description: params.description,
|
|
62
|
-
queue:
|
|
137
|
+
queue: normalizedQueue.queue,
|
|
138
|
+
concurrency: normalizeTaskConcurrency(params.id, params.concurrency),
|
|
63
139
|
retry: params.retry ? { ...defaultRetryOptions, ...params.retry } : undefined,
|
|
64
140
|
machine: typeof params.machine === "string" ? { preset: params.machine } : params.machine,
|
|
65
141
|
triggerSource: params.triggerSource,
|
|
@@ -71,8 +147,14 @@ export function createTask(params) {
|
|
|
71
147
|
run: params.run,
|
|
72
148
|
},
|
|
73
149
|
});
|
|
74
|
-
const queue =
|
|
75
|
-
|
|
150
|
+
const queue = normalizedQueue.queue;
|
|
151
|
+
/**
|
|
152
|
+
* A string queue name (bare or as a tuple's first element) is a REFERENCE to a
|
|
153
|
+
* queue defined elsewhere; registering it would create an empty definition that
|
|
154
|
+
* can shadow the real one depending on module evaluation order.
|
|
155
|
+
*/
|
|
156
|
+
const homeIsReference = typeof params.queue === "string";
|
|
157
|
+
if (queue && typeof queue.name === "string" && !homeIsReference) {
|
|
76
158
|
resourceCatalog.registerQueueMetadata({
|
|
77
159
|
name: queue.name,
|
|
78
160
|
concurrencyLimit: queue.concurrencyLimit,
|
|
@@ -105,23 +187,24 @@ export function createSchemaTask(params) {
|
|
|
105
187
|
const parsePayload = params.schema
|
|
106
188
|
? getSchemaParseFn(params.schema)
|
|
107
189
|
: undefined;
|
|
190
|
+
const normalizedQueue = normalizeTaskQueue(params.queue);
|
|
108
191
|
const task = {
|
|
109
192
|
id: params.id,
|
|
110
193
|
description: params.description,
|
|
111
194
|
schema: params.schema,
|
|
112
195
|
trigger: async (payload, options, requestOptions) => {
|
|
113
196
|
return await trigger_internal("trigger()", params.id, payload, parsePayload, {
|
|
114
|
-
queue:
|
|
197
|
+
queue: normalizedQueue.queue?.name,
|
|
115
198
|
...options,
|
|
116
199
|
}, requestOptions);
|
|
117
200
|
},
|
|
118
201
|
batchTrigger: async (items, options, requestOptions) => {
|
|
119
|
-
return await batchTrigger_internal("batchTrigger()", params.id, items, options, parsePayload, requestOptions,
|
|
202
|
+
return await batchTrigger_internal("batchTrigger()", params.id, items, options, parsePayload, requestOptions, normalizedQueue.queue?.name);
|
|
120
203
|
},
|
|
121
204
|
triggerAndWait: (payload, options) => {
|
|
122
205
|
return new TaskRunPromise((resolve, reject) => {
|
|
123
206
|
triggerAndWait_internal("triggerAndWait()", params.id, payload, parsePayload, {
|
|
124
|
-
queue:
|
|
207
|
+
queue: normalizedQueue.queue?.name,
|
|
125
208
|
...options,
|
|
126
209
|
})
|
|
127
210
|
.then((result) => {
|
|
@@ -135,7 +218,7 @@ export function createSchemaTask(params) {
|
|
|
135
218
|
triggerAndSubscribe: (payload, options) => {
|
|
136
219
|
return new TaskRunPromise((resolve, reject) => {
|
|
137
220
|
triggerAndSubscribe_internal("triggerAndSubscribe()", params.id, payload, parsePayload, {
|
|
138
|
-
queue:
|
|
221
|
+
queue: normalizedQueue.queue?.name,
|
|
139
222
|
...options,
|
|
140
223
|
})
|
|
141
224
|
.then((result) => {
|
|
@@ -147,14 +230,15 @@ export function createSchemaTask(params) {
|
|
|
147
230
|
}, params.id);
|
|
148
231
|
},
|
|
149
232
|
batchTriggerAndWait: async (items, options) => {
|
|
150
|
-
return await batchTriggerAndWait_internal("batchTriggerAndWait()", params.id, items, parsePayload, options, undefined,
|
|
233
|
+
return await batchTriggerAndWait_internal("batchTriggerAndWait()", params.id, items, parsePayload, options, undefined, normalizedQueue.queue?.name);
|
|
151
234
|
},
|
|
152
235
|
};
|
|
153
236
|
registerTaskLifecycleHooks(params.id, params);
|
|
154
237
|
resourceCatalog.registerTaskMetadata({
|
|
155
238
|
id: params.id,
|
|
156
239
|
description: params.description,
|
|
157
|
-
queue:
|
|
240
|
+
queue: normalizedQueue.queue,
|
|
241
|
+
concurrency: normalizeTaskConcurrency(params.id, params.concurrency),
|
|
158
242
|
retry: params.retry ? { ...defaultRetryOptions, ...params.retry } : undefined,
|
|
159
243
|
machine: typeof params.machine === "string" ? { preset: params.machine } : params.machine,
|
|
160
244
|
triggerSource: params.triggerSource,
|
|
@@ -167,8 +251,14 @@ export function createSchemaTask(params) {
|
|
|
167
251
|
},
|
|
168
252
|
schema: params.schema,
|
|
169
253
|
});
|
|
170
|
-
const queue =
|
|
171
|
-
|
|
254
|
+
const queue = normalizedQueue.queue;
|
|
255
|
+
/**
|
|
256
|
+
* A string queue name (bare or as a tuple's first element) is a REFERENCE to a
|
|
257
|
+
* queue defined elsewhere; registering it would create an empty definition that
|
|
258
|
+
* can shadow the real one depending on module evaluation order.
|
|
259
|
+
*/
|
|
260
|
+
const homeIsReference = typeof params.queue === "string";
|
|
261
|
+
if (queue && typeof queue.name === "string" && !homeIsReference) {
|
|
172
262
|
resourceCatalog.registerQueueMetadata({
|
|
173
263
|
name: queue.name,
|
|
174
264
|
concurrencyLimit: queue.concurrencyLimit,
|
|
@@ -307,7 +397,8 @@ export async function batchTriggerById(...args) {
|
|
|
307
397
|
task: item.id,
|
|
308
398
|
payload: payloadPacket.data,
|
|
309
399
|
options: {
|
|
310
|
-
|
|
400
|
+
...triggerQueueBody(item.options?.queue),
|
|
401
|
+
...triggerConcurrencyBody(item.options?.concurrency),
|
|
311
402
|
concurrencyKey: item.options?.concurrencyKey,
|
|
312
403
|
test: taskContext.ctx?.run.isTest,
|
|
313
404
|
payloadType: payloadPacket.dataType,
|
|
@@ -403,7 +494,8 @@ export async function batchTriggerByIdAndWait(...args) {
|
|
|
403
494
|
payload: payloadPacket.data,
|
|
404
495
|
options: {
|
|
405
496
|
lockToVersion: taskContext.worker?.version,
|
|
406
|
-
|
|
497
|
+
...triggerQueueBody(item.options?.queue),
|
|
498
|
+
...triggerConcurrencyBody(item.options?.concurrency),
|
|
407
499
|
concurrencyKey: item.options?.concurrencyKey,
|
|
408
500
|
test: taskContext.ctx?.run.isTest,
|
|
409
501
|
payloadType: payloadPacket.dataType,
|
|
@@ -500,7 +592,8 @@ export async function batchTriggerTasks(...args) {
|
|
|
500
592
|
task: item.task.id,
|
|
501
593
|
payload: payloadPacket.data,
|
|
502
594
|
options: {
|
|
503
|
-
|
|
595
|
+
...triggerQueueBody(item.options?.queue),
|
|
596
|
+
...triggerConcurrencyBody(item.options?.concurrency),
|
|
504
597
|
concurrencyKey: item.options?.concurrencyKey,
|
|
505
598
|
test: taskContext.ctx?.run.isTest,
|
|
506
599
|
payloadType: payloadPacket.dataType,
|
|
@@ -597,7 +690,8 @@ export async function batchTriggerAndWaitTasks(...args) {
|
|
|
597
690
|
payload: payloadPacket.data,
|
|
598
691
|
options: {
|
|
599
692
|
lockToVersion: taskContext.worker?.version,
|
|
600
|
-
|
|
693
|
+
...triggerQueueBody(item.options?.queue),
|
|
694
|
+
...triggerConcurrencyBody(item.options?.concurrency),
|
|
601
695
|
concurrencyKey: item.options?.concurrencyKey,
|
|
602
696
|
test: taskContext.ctx?.run.isTest,
|
|
603
697
|
payloadType: payloadPacket.dataType,
|
|
@@ -955,7 +1049,8 @@ async function* transformBatchItemsStream(items, options) {
|
|
|
955
1049
|
task: item.id,
|
|
956
1050
|
payload: payloadPacket.data,
|
|
957
1051
|
options: {
|
|
958
|
-
|
|
1052
|
+
...triggerQueueBody(item.options?.queue),
|
|
1053
|
+
...triggerConcurrencyBody(item.options?.concurrency),
|
|
959
1054
|
concurrencyKey: item.options?.concurrencyKey,
|
|
960
1055
|
test: taskContext.ctx?.run.isTest,
|
|
961
1056
|
payloadType: payloadPacket.dataType,
|
|
@@ -998,7 +1093,8 @@ async function* transformBatchItemsStreamForWait(items, options) {
|
|
|
998
1093
|
payload: payloadPacket.data,
|
|
999
1094
|
options: {
|
|
1000
1095
|
lockToVersion: taskContext.worker?.version,
|
|
1001
|
-
|
|
1096
|
+
...triggerQueueBody(item.options?.queue),
|
|
1097
|
+
...triggerConcurrencyBody(item.options?.concurrency),
|
|
1002
1098
|
concurrencyKey: item.options?.concurrencyKey,
|
|
1003
1099
|
test: taskContext.ctx?.run.isTest,
|
|
1004
1100
|
payloadType: payloadPacket.dataType,
|
|
@@ -1037,7 +1133,8 @@ async function* transformBatchByTaskItemsStream(items, options) {
|
|
|
1037
1133
|
task: item.task.id,
|
|
1038
1134
|
payload: payloadPacket.data,
|
|
1039
1135
|
options: {
|
|
1040
|
-
|
|
1136
|
+
...triggerQueueBody(item.options?.queue),
|
|
1137
|
+
...triggerConcurrencyBody(item.options?.concurrency),
|
|
1041
1138
|
concurrencyKey: item.options?.concurrencyKey,
|
|
1042
1139
|
test: taskContext.ctx?.run.isTest,
|
|
1043
1140
|
payloadType: payloadPacket.dataType,
|
|
@@ -1079,7 +1176,8 @@ async function* transformBatchByTaskItemsStreamForWait(items, options) {
|
|
|
1079
1176
|
payload: payloadPacket.data,
|
|
1080
1177
|
options: {
|
|
1081
1178
|
lockToVersion: taskContext.worker?.version,
|
|
1082
|
-
|
|
1179
|
+
...triggerQueueBody(item.options?.queue),
|
|
1180
|
+
...triggerConcurrencyBody(item.options?.concurrency),
|
|
1083
1181
|
concurrencyKey: item.options?.concurrencyKey,
|
|
1084
1182
|
test: taskContext.ctx?.run.isTest,
|
|
1085
1183
|
payloadType: payloadPacket.dataType,
|
|
@@ -1115,11 +1213,8 @@ async function* transformSingleTaskBatchItemsStream(taskIdentifier, items, parse
|
|
|
1115
1213
|
task: taskIdentifier,
|
|
1116
1214
|
payload: payloadPacket.data,
|
|
1117
1215
|
options: {
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
: queue
|
|
1121
|
-
? { name: queue }
|
|
1122
|
-
: undefined,
|
|
1216
|
+
...triggerQueueBody(item.options?.queue, queue),
|
|
1217
|
+
...triggerConcurrencyBody(item.options?.concurrency),
|
|
1123
1218
|
concurrencyKey: item.options?.concurrencyKey,
|
|
1124
1219
|
test: taskContext.ctx?.run.isTest,
|
|
1125
1220
|
payloadType: payloadPacket.dataType,
|
|
@@ -1164,11 +1259,8 @@ async function* transformSingleTaskBatchItemsStreamForWait(taskIdentifier, items
|
|
|
1164
1259
|
payload: payloadPacket.data,
|
|
1165
1260
|
options: {
|
|
1166
1261
|
lockToVersion: taskContext.worker?.version,
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
: queue
|
|
1170
|
-
? { name: queue }
|
|
1171
|
-
: undefined,
|
|
1262
|
+
...triggerQueueBody(item.options?.queue, queue),
|
|
1263
|
+
...triggerConcurrencyBody(item.options?.concurrency),
|
|
1172
1264
|
concurrencyKey: item.options?.concurrencyKey,
|
|
1173
1265
|
test: taskContext.ctx?.run.isTest,
|
|
1174
1266
|
payloadType: payloadPacket.dataType,
|
|
@@ -1201,7 +1293,8 @@ async function trigger_internal(name, id, payload, parsePayload, options, reques
|
|
|
1201
1293
|
const handle = await apiClient.triggerTask(id, {
|
|
1202
1294
|
payload: triggerPayloadPacket.data,
|
|
1203
1295
|
options: {
|
|
1204
|
-
|
|
1296
|
+
...triggerQueueBody(options?.queue),
|
|
1297
|
+
...triggerConcurrencyBody(options?.concurrency),
|
|
1205
1298
|
concurrencyKey: options?.concurrencyKey,
|
|
1206
1299
|
test: taskContext.ctx?.run.isTest,
|
|
1207
1300
|
payloadType: triggerPayloadPacket.dataType,
|
|
@@ -1261,11 +1354,8 @@ async function batchTrigger_internal(name, taskIdentifier, items, options, parse
|
|
|
1261
1354
|
task: taskIdentifier,
|
|
1262
1355
|
payload: payloadPacket.data,
|
|
1263
1356
|
options: {
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
: queue
|
|
1267
|
-
? { name: queue }
|
|
1268
|
-
: undefined,
|
|
1357
|
+
...triggerQueueBody(item.options?.queue, queue),
|
|
1358
|
+
...triggerConcurrencyBody(item.options?.concurrency),
|
|
1269
1359
|
concurrencyKey: item.options?.concurrencyKey,
|
|
1270
1360
|
test: taskContext.ctx?.run.isTest,
|
|
1271
1361
|
payloadType: payloadPacket.dataType,
|
|
@@ -1386,7 +1476,8 @@ async function triggerAndWait_internal(name, id, payload, parsePayload, options,
|
|
|
1386
1476
|
payload: triggerPayloadPacket.data,
|
|
1387
1477
|
options: {
|
|
1388
1478
|
lockToVersion: taskContext.worker?.version, // Lock to current version because we're waiting for it to finish
|
|
1389
|
-
|
|
1479
|
+
...triggerQueueBody(options?.queue),
|
|
1480
|
+
...triggerConcurrencyBody(options?.concurrency),
|
|
1390
1481
|
concurrencyKey: options?.concurrencyKey,
|
|
1391
1482
|
test: taskContext.ctx?.run.isTest,
|
|
1392
1483
|
payloadType: triggerPayloadPacket.dataType,
|
|
@@ -1447,7 +1538,8 @@ async function triggerAndSubscribe_internal(name, id, payload, parsePayload, opt
|
|
|
1447
1538
|
payload: triggerPayloadPacket.data,
|
|
1448
1539
|
options: {
|
|
1449
1540
|
lockToVersion: taskContext.worker?.version,
|
|
1450
|
-
|
|
1541
|
+
...triggerQueueBody(options?.queue),
|
|
1542
|
+
...triggerConcurrencyBody(options?.concurrency),
|
|
1451
1543
|
concurrencyKey: options?.concurrencyKey,
|
|
1452
1544
|
test: taskContext.ctx?.run.isTest,
|
|
1453
1545
|
payloadType: triggerPayloadPacket.dataType,
|
|
@@ -1582,11 +1674,8 @@ async function batchTriggerAndWait_internal(name, id, items, parsePayload, optio
|
|
|
1582
1674
|
payload: payloadPacket.data,
|
|
1583
1675
|
options: {
|
|
1584
1676
|
lockToVersion: taskContext.worker?.version,
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
: queue
|
|
1588
|
-
? { name: queue }
|
|
1589
|
-
: undefined,
|
|
1677
|
+
...triggerQueueBody(item.options?.queue, queue),
|
|
1678
|
+
...triggerConcurrencyBody(item.options?.concurrency),
|
|
1590
1679
|
concurrencyKey: item.options?.concurrencyKey,
|
|
1591
1680
|
test: taskContext.ctx?.run.isTest,
|
|
1592
1681
|
payloadType: payloadPacket.dataType,
|