@trigger.dev/sdk 3.0.0-beta.51 → 3.0.0-beta.52
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/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/v3/index.d.mts +1 -1
- package/dist/v3/index.d.ts +1 -1
- package/dist/v3/index.js +19 -9
- package/dist/v3/index.js.map +1 -1
- package/dist/v3/index.mjs +19 -9
- package/dist/v3/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/v3/index.d.mts
CHANGED
|
@@ -764,7 +764,7 @@ type TaskRunOptions = {
|
|
|
764
764
|
/**
|
|
765
765
|
* Tags to attach to the run. Tags can be used to filter runs in the dashboard and using the SDK.
|
|
766
766
|
*
|
|
767
|
-
* You can set up to
|
|
767
|
+
* You can set up to 5 tags per run, they must be less than 64 characters each.
|
|
768
768
|
*
|
|
769
769
|
* We recommend prefixing tags with a namespace using an underscore or colon, like `user_1234567` or `org:9876543`.
|
|
770
770
|
*
|
package/dist/v3/index.d.ts
CHANGED
|
@@ -764,7 +764,7 @@ type TaskRunOptions = {
|
|
|
764
764
|
/**
|
|
765
765
|
* Tags to attach to the run. Tags can be used to filter runs in the dashboard and using the SDK.
|
|
766
766
|
*
|
|
767
|
-
* You can set up to
|
|
767
|
+
* You can set up to 5 tags per run, they must be less than 64 characters each.
|
|
768
768
|
*
|
|
769
769
|
* We recommend prefixing tags with a namespace using an underscore or colon, like `user_1234567` or `org:9876543`.
|
|
770
770
|
*
|
package/dist/v3/index.js
CHANGED
|
@@ -19,7 +19,7 @@ var __publicField = (obj, key, value) => {
|
|
|
19
19
|
};
|
|
20
20
|
|
|
21
21
|
// package.json
|
|
22
|
-
var version = "3.0.0-beta.
|
|
22
|
+
var version = "3.0.0-beta.52";
|
|
23
23
|
|
|
24
24
|
// src/v3/tracer.ts
|
|
25
25
|
var tracer = new v3.TriggerTracer({
|
|
@@ -746,23 +746,33 @@ function queue(options) {
|
|
|
746
746
|
}
|
|
747
747
|
__name(queue, "queue");
|
|
748
748
|
function createTask(params) {
|
|
749
|
+
const customQueue = params.queue ? queue({
|
|
750
|
+
name: params.queue?.name ?? `task/${params.id}`,
|
|
751
|
+
...params.queue
|
|
752
|
+
}) : void 0;
|
|
749
753
|
const task3 = {
|
|
750
754
|
id: params.id,
|
|
751
755
|
trigger: async (payload, options) => {
|
|
752
756
|
const taskMetadata = v3.taskCatalog.getTaskMetadata(params.id);
|
|
753
|
-
return await trigger_internal(taskMetadata && taskMetadata.exportName ? `${taskMetadata.exportName}.trigger()` : `trigger()`, params.id, payload,
|
|
757
|
+
return await trigger_internal(taskMetadata && taskMetadata.exportName ? `${taskMetadata.exportName}.trigger()` : `trigger()`, params.id, payload, {
|
|
758
|
+
queue: customQueue,
|
|
759
|
+
...options
|
|
760
|
+
});
|
|
754
761
|
},
|
|
755
762
|
batchTrigger: async (items) => {
|
|
756
763
|
const taskMetadata = v3.taskCatalog.getTaskMetadata(params.id);
|
|
757
|
-
return await batchTrigger_internal(taskMetadata && taskMetadata.exportName ? `${taskMetadata.exportName}.batchTrigger()` : `batchTrigger()`, params.id, items);
|
|
764
|
+
return await batchTrigger_internal(taskMetadata && taskMetadata.exportName ? `${taskMetadata.exportName}.batchTrigger()` : `batchTrigger()`, params.id, items, void 0, customQueue);
|
|
758
765
|
},
|
|
759
766
|
triggerAndWait: async (payload, options) => {
|
|
760
767
|
const taskMetadata = v3.taskCatalog.getTaskMetadata(params.id);
|
|
761
|
-
return await triggerAndWait_internal(taskMetadata && taskMetadata.exportName ? `${taskMetadata.exportName}.triggerAndWait()` : `triggerAndWait()`, params.id, payload,
|
|
768
|
+
return await triggerAndWait_internal(taskMetadata && taskMetadata.exportName ? `${taskMetadata.exportName}.triggerAndWait()` : `triggerAndWait()`, params.id, payload, {
|
|
769
|
+
queue: customQueue,
|
|
770
|
+
...options
|
|
771
|
+
});
|
|
762
772
|
},
|
|
763
773
|
batchTriggerAndWait: async (items) => {
|
|
764
774
|
const taskMetadata = v3.taskCatalog.getTaskMetadata(params.id);
|
|
765
|
-
return await batchTriggerAndWait_internal(taskMetadata && taskMetadata.exportName ? `${taskMetadata.exportName}.batchTriggerAndWait()` : `batchTriggerAndWait()`, params.id, items);
|
|
775
|
+
return await batchTriggerAndWait_internal(taskMetadata && taskMetadata.exportName ? `${taskMetadata.exportName}.batchTriggerAndWait()` : `batchTriggerAndWait()`, params.id, items, void 0, customQueue);
|
|
766
776
|
}
|
|
767
777
|
};
|
|
768
778
|
v3.taskCatalog.registerTaskMetadata({
|
|
@@ -856,7 +866,7 @@ async function trigger_internal(name2, id, payload, options, requestOptions) {
|
|
|
856
866
|
return handle;
|
|
857
867
|
}
|
|
858
868
|
__name(trigger_internal, "trigger_internal");
|
|
859
|
-
async function batchTrigger_internal(name2, id, items, requestOptions) {
|
|
869
|
+
async function batchTrigger_internal(name2, id, items, requestOptions, queue2) {
|
|
860
870
|
const apiClient = v3.apiClientManager.client;
|
|
861
871
|
if (!apiClient) {
|
|
862
872
|
throw apiClientMissingError();
|
|
@@ -867,7 +877,7 @@ async function batchTrigger_internal(name2, id, items, requestOptions) {
|
|
|
867
877
|
return {
|
|
868
878
|
payload: payloadPacket.data,
|
|
869
879
|
options: {
|
|
870
|
-
queue: item.options?.queue,
|
|
880
|
+
queue: item.options?.queue ?? queue2,
|
|
871
881
|
concurrencyKey: item.options?.concurrencyKey,
|
|
872
882
|
test: v3.taskContext.ctx?.run.isTest,
|
|
873
883
|
payloadType: payloadPacket.dataType,
|
|
@@ -974,7 +984,7 @@ async function triggerAndWait_internal(name2, id, payload, options, requestOptio
|
|
|
974
984
|
});
|
|
975
985
|
}
|
|
976
986
|
__name(triggerAndWait_internal, "triggerAndWait_internal");
|
|
977
|
-
async function batchTriggerAndWait_internal(name2, id, items, requestOptions) {
|
|
987
|
+
async function batchTriggerAndWait_internal(name2, id, items, requestOptions, queue2) {
|
|
978
988
|
const ctx = v3.taskContext.ctx;
|
|
979
989
|
if (!ctx) {
|
|
980
990
|
throw new Error("batchTriggerAndWait can only be used from inside a task.run()");
|
|
@@ -991,7 +1001,7 @@ async function batchTriggerAndWait_internal(name2, id, items, requestOptions) {
|
|
|
991
1001
|
payload: payloadPacket.data,
|
|
992
1002
|
options: {
|
|
993
1003
|
lockToVersion: v3.taskContext.worker?.version,
|
|
994
|
-
queue: item.options?.queue,
|
|
1004
|
+
queue: item.options?.queue ?? queue2,
|
|
995
1005
|
concurrencyKey: item.options?.concurrencyKey,
|
|
996
1006
|
test: v3.taskContext.ctx?.run.isTest,
|
|
997
1007
|
payloadType: payloadPacket.dataType,
|