@upstash/workflow 0.2.10-unicode-rc → 0.2.11
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/astro.d.mts +2 -2
- package/astro.d.ts +2 -2
- package/astro.js +8 -6
- package/astro.mjs +1 -1
- package/{chunk-N2WV5VCD.mjs → chunk-WQAJ2RSZ.mjs} +8 -6
- package/cloudflare.d.mts +2 -2
- package/cloudflare.d.ts +2 -2
- package/cloudflare.js +8 -6
- package/cloudflare.mjs +1 -1
- package/express.d.mts +2 -2
- package/express.d.ts +2 -2
- package/express.js +8 -6
- package/express.mjs +1 -1
- package/h3.d.mts +2 -2
- package/h3.d.ts +2 -2
- package/h3.js +8 -6
- package/h3.mjs +1 -1
- package/hono.d.mts +3 -3
- package/hono.d.ts +3 -3
- package/hono.js +8 -6
- package/hono.mjs +1 -1
- package/index.d.mts +28 -2
- package/index.d.ts +28 -2
- package/index.js +8 -6
- package/index.mjs +1 -1
- package/nextjs.d.mts +2 -2
- package/nextjs.d.ts +2 -2
- package/nextjs.js +8 -6
- package/nextjs.mjs +1 -1
- package/package.json +1 -1
- package/{serve-many-jCRazho9.d.ts → serve-many-DNnLsDIp.d.ts} +1 -1
- package/{serve-many-wMUWrSIP.d.mts → serve-many-Fuovl7gl.d.mts} +1 -1
- package/solidjs.d.mts +1 -1
- package/solidjs.d.ts +1 -1
- package/solidjs.js +8 -6
- package/solidjs.mjs +1 -1
- package/svelte.d.mts +2 -2
- package/svelte.d.ts +2 -2
- package/svelte.js +8 -6
- package/svelte.mjs +1 -1
- package/{types-Dg_9L83G.d.ts → types-DS9q8FyV.d.mts} +1 -0
- package/{types-Dg_9L83G.d.mts → types-DS9q8FyV.d.ts} +1 -0
package/astro.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { APIContext, APIRoute } from 'astro';
|
|
2
|
-
import { e as WorkflowContext, k as PublicServeOptions, t as InvokableWorkflow } from './types-
|
|
3
|
-
import { s as serveManyBase } from './serve-many-
|
|
2
|
+
import { e as WorkflowContext, k as PublicServeOptions, t as InvokableWorkflow } from './types-DS9q8FyV.mjs';
|
|
3
|
+
import { s as serveManyBase } from './serve-many-Fuovl7gl.mjs';
|
|
4
4
|
import '@upstash/qstash';
|
|
5
5
|
import 'zod';
|
|
6
6
|
import 'ai';
|
package/astro.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { APIContext, APIRoute } from 'astro';
|
|
2
|
-
import { e as WorkflowContext, k as PublicServeOptions, t as InvokableWorkflow } from './types-
|
|
3
|
-
import { s as serveManyBase } from './serve-many-
|
|
2
|
+
import { e as WorkflowContext, k as PublicServeOptions, t as InvokableWorkflow } from './types-DS9q8FyV.js';
|
|
3
|
+
import { s as serveManyBase } from './serve-many-DNnLsDIp.js';
|
|
4
4
|
import '@upstash/qstash';
|
|
5
5
|
import 'zod';
|
|
6
6
|
import 'ai';
|
package/astro.js
CHANGED
|
@@ -1189,7 +1189,8 @@ var getHeaders = ({
|
|
|
1189
1189
|
flowControl,
|
|
1190
1190
|
callFlowControl
|
|
1191
1191
|
}) => {
|
|
1192
|
-
const
|
|
1192
|
+
const callHeaders = new Headers(step?.callHeaders);
|
|
1193
|
+
const contentType = (callHeaders.get("content-type") ? callHeaders.get("content-type") : userHeaders?.get("Content-Type") ? userHeaders.get("Content-Type") : void 0) ?? DEFAULT_CONTENT_TYPE;
|
|
1193
1194
|
const baseHeaders = {
|
|
1194
1195
|
[WORKFLOW_INIT_HEADER]: initHeaderValue,
|
|
1195
1196
|
[WORKFLOW_ID_HEADER]: workflowRunId,
|
|
@@ -1486,7 +1487,7 @@ var invokeWorkflow = async ({
|
|
|
1486
1487
|
headers: Object.fromEntries(
|
|
1487
1488
|
Object.entries(invokerHeaders).map((pairs) => [pairs[0], [pairs[1]]])
|
|
1488
1489
|
),
|
|
1489
|
-
workflowRunId,
|
|
1490
|
+
workflowRunId: context.workflowRunId,
|
|
1490
1491
|
workflowUrl: context.url,
|
|
1491
1492
|
step: invokeStep
|
|
1492
1493
|
};
|
|
@@ -1780,7 +1781,7 @@ var AutoExecutor = class _AutoExecutor {
|
|
|
1780
1781
|
});
|
|
1781
1782
|
throw new WorkflowAbort(invokeStep.stepName, invokeStep);
|
|
1782
1783
|
}
|
|
1783
|
-
const result = await this.context.qstashClient.
|
|
1784
|
+
const result = await this.context.qstashClient.batch(
|
|
1784
1785
|
steps.map((singleStep, index) => {
|
|
1785
1786
|
const lazyStep = lazySteps[index];
|
|
1786
1787
|
const { headers } = getHeaders({
|
|
@@ -1810,7 +1811,7 @@ var AutoExecutor = class _AutoExecutor {
|
|
|
1810
1811
|
{
|
|
1811
1812
|
headers,
|
|
1812
1813
|
method: singleStep.callMethod,
|
|
1813
|
-
body: singleStep.callBody,
|
|
1814
|
+
body: JSON.stringify(singleStep.callBody),
|
|
1814
1815
|
url: singleStep.callUrl
|
|
1815
1816
|
}
|
|
1816
1817
|
) : (
|
|
@@ -1820,7 +1821,7 @@ var AutoExecutor = class _AutoExecutor {
|
|
|
1820
1821
|
{
|
|
1821
1822
|
headers,
|
|
1822
1823
|
method: "POST",
|
|
1823
|
-
body: singleStep,
|
|
1824
|
+
body: JSON.stringify(singleStep),
|
|
1824
1825
|
url: this.context.url,
|
|
1825
1826
|
notBefore: willWait ? singleStep.sleepUntil : void 0,
|
|
1826
1827
|
delay: willWait ? singleStep.sleepFor : void 0
|
|
@@ -1828,8 +1829,9 @@ var AutoExecutor = class _AutoExecutor {
|
|
|
1828
1829
|
);
|
|
1829
1830
|
})
|
|
1830
1831
|
);
|
|
1832
|
+
const _result = result;
|
|
1831
1833
|
await this.debug?.log("INFO", "SUBMIT_STEP", {
|
|
1832
|
-
messageIds:
|
|
1834
|
+
messageIds: _result.map((message) => {
|
|
1833
1835
|
return {
|
|
1834
1836
|
message: message.messageId
|
|
1835
1837
|
};
|
package/astro.mjs
CHANGED
|
@@ -859,7 +859,8 @@ var getHeaders = ({
|
|
|
859
859
|
flowControl,
|
|
860
860
|
callFlowControl
|
|
861
861
|
}) => {
|
|
862
|
-
const
|
|
862
|
+
const callHeaders = new Headers(step?.callHeaders);
|
|
863
|
+
const contentType = (callHeaders.get("content-type") ? callHeaders.get("content-type") : userHeaders?.get("Content-Type") ? userHeaders.get("Content-Type") : void 0) ?? DEFAULT_CONTENT_TYPE;
|
|
863
864
|
const baseHeaders = {
|
|
864
865
|
[WORKFLOW_INIT_HEADER]: initHeaderValue,
|
|
865
866
|
[WORKFLOW_ID_HEADER]: workflowRunId,
|
|
@@ -1153,7 +1154,7 @@ var invokeWorkflow = async ({
|
|
|
1153
1154
|
headers: Object.fromEntries(
|
|
1154
1155
|
Object.entries(invokerHeaders).map((pairs) => [pairs[0], [pairs[1]]])
|
|
1155
1156
|
),
|
|
1156
|
-
workflowRunId,
|
|
1157
|
+
workflowRunId: context.workflowRunId,
|
|
1157
1158
|
workflowUrl: context.url,
|
|
1158
1159
|
step: invokeStep
|
|
1159
1160
|
};
|
|
@@ -1915,7 +1916,7 @@ var AutoExecutor = class _AutoExecutor {
|
|
|
1915
1916
|
});
|
|
1916
1917
|
throw new WorkflowAbort(invokeStep.stepName, invokeStep);
|
|
1917
1918
|
}
|
|
1918
|
-
const result = await this.context.qstashClient.
|
|
1919
|
+
const result = await this.context.qstashClient.batch(
|
|
1919
1920
|
steps.map((singleStep, index) => {
|
|
1920
1921
|
const lazyStep = lazySteps[index];
|
|
1921
1922
|
const { headers } = getHeaders({
|
|
@@ -1945,7 +1946,7 @@ var AutoExecutor = class _AutoExecutor {
|
|
|
1945
1946
|
{
|
|
1946
1947
|
headers,
|
|
1947
1948
|
method: singleStep.callMethod,
|
|
1948
|
-
body: singleStep.callBody,
|
|
1949
|
+
body: JSON.stringify(singleStep.callBody),
|
|
1949
1950
|
url: singleStep.callUrl
|
|
1950
1951
|
}
|
|
1951
1952
|
) : (
|
|
@@ -1955,7 +1956,7 @@ var AutoExecutor = class _AutoExecutor {
|
|
|
1955
1956
|
{
|
|
1956
1957
|
headers,
|
|
1957
1958
|
method: "POST",
|
|
1958
|
-
body: singleStep,
|
|
1959
|
+
body: JSON.stringify(singleStep),
|
|
1959
1960
|
url: this.context.url,
|
|
1960
1961
|
notBefore: willWait ? singleStep.sleepUntil : void 0,
|
|
1961
1962
|
delay: willWait ? singleStep.sleepFor : void 0
|
|
@@ -1963,8 +1964,9 @@ var AutoExecutor = class _AutoExecutor {
|
|
|
1963
1964
|
);
|
|
1964
1965
|
})
|
|
1965
1966
|
);
|
|
1967
|
+
const _result = result;
|
|
1966
1968
|
await this.debug?.log("INFO", "SUBMIT_STEP", {
|
|
1967
|
-
messageIds:
|
|
1969
|
+
messageIds: _result.map((message) => {
|
|
1968
1970
|
return {
|
|
1969
1971
|
message: message.messageId
|
|
1970
1972
|
};
|
package/cloudflare.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { R as RouteFunction, k as PublicServeOptions, t as InvokableWorkflow } from './types-
|
|
2
|
-
import { s as serveManyBase } from './serve-many-
|
|
1
|
+
import { R as RouteFunction, k as PublicServeOptions, t as InvokableWorkflow } from './types-DS9q8FyV.mjs';
|
|
2
|
+
import { s as serveManyBase } from './serve-many-Fuovl7gl.mjs';
|
|
3
3
|
import '@upstash/qstash';
|
|
4
4
|
import 'zod';
|
|
5
5
|
import 'ai';
|
package/cloudflare.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { R as RouteFunction, k as PublicServeOptions, t as InvokableWorkflow } from './types-
|
|
2
|
-
import { s as serveManyBase } from './serve-many-
|
|
1
|
+
import { R as RouteFunction, k as PublicServeOptions, t as InvokableWorkflow } from './types-DS9q8FyV.js';
|
|
2
|
+
import { s as serveManyBase } from './serve-many-DNnLsDIp.js';
|
|
3
3
|
import '@upstash/qstash';
|
|
4
4
|
import 'zod';
|
|
5
5
|
import 'ai';
|
package/cloudflare.js
CHANGED
|
@@ -1189,7 +1189,8 @@ var getHeaders = ({
|
|
|
1189
1189
|
flowControl,
|
|
1190
1190
|
callFlowControl
|
|
1191
1191
|
}) => {
|
|
1192
|
-
const
|
|
1192
|
+
const callHeaders = new Headers(step?.callHeaders);
|
|
1193
|
+
const contentType = (callHeaders.get("content-type") ? callHeaders.get("content-type") : userHeaders?.get("Content-Type") ? userHeaders.get("Content-Type") : void 0) ?? DEFAULT_CONTENT_TYPE;
|
|
1193
1194
|
const baseHeaders = {
|
|
1194
1195
|
[WORKFLOW_INIT_HEADER]: initHeaderValue,
|
|
1195
1196
|
[WORKFLOW_ID_HEADER]: workflowRunId,
|
|
@@ -1486,7 +1487,7 @@ var invokeWorkflow = async ({
|
|
|
1486
1487
|
headers: Object.fromEntries(
|
|
1487
1488
|
Object.entries(invokerHeaders).map((pairs) => [pairs[0], [pairs[1]]])
|
|
1488
1489
|
),
|
|
1489
|
-
workflowRunId,
|
|
1490
|
+
workflowRunId: context.workflowRunId,
|
|
1490
1491
|
workflowUrl: context.url,
|
|
1491
1492
|
step: invokeStep
|
|
1492
1493
|
};
|
|
@@ -1780,7 +1781,7 @@ var AutoExecutor = class _AutoExecutor {
|
|
|
1780
1781
|
});
|
|
1781
1782
|
throw new WorkflowAbort(invokeStep.stepName, invokeStep);
|
|
1782
1783
|
}
|
|
1783
|
-
const result = await this.context.qstashClient.
|
|
1784
|
+
const result = await this.context.qstashClient.batch(
|
|
1784
1785
|
steps.map((singleStep, index) => {
|
|
1785
1786
|
const lazyStep = lazySteps[index];
|
|
1786
1787
|
const { headers } = getHeaders({
|
|
@@ -1810,7 +1811,7 @@ var AutoExecutor = class _AutoExecutor {
|
|
|
1810
1811
|
{
|
|
1811
1812
|
headers,
|
|
1812
1813
|
method: singleStep.callMethod,
|
|
1813
|
-
body: singleStep.callBody,
|
|
1814
|
+
body: JSON.stringify(singleStep.callBody),
|
|
1814
1815
|
url: singleStep.callUrl
|
|
1815
1816
|
}
|
|
1816
1817
|
) : (
|
|
@@ -1820,7 +1821,7 @@ var AutoExecutor = class _AutoExecutor {
|
|
|
1820
1821
|
{
|
|
1821
1822
|
headers,
|
|
1822
1823
|
method: "POST",
|
|
1823
|
-
body: singleStep,
|
|
1824
|
+
body: JSON.stringify(singleStep),
|
|
1824
1825
|
url: this.context.url,
|
|
1825
1826
|
notBefore: willWait ? singleStep.sleepUntil : void 0,
|
|
1826
1827
|
delay: willWait ? singleStep.sleepFor : void 0
|
|
@@ -1828,8 +1829,9 @@ var AutoExecutor = class _AutoExecutor {
|
|
|
1828
1829
|
);
|
|
1829
1830
|
})
|
|
1830
1831
|
);
|
|
1832
|
+
const _result = result;
|
|
1831
1833
|
await this.debug?.log("INFO", "SUBMIT_STEP", {
|
|
1832
|
-
messageIds:
|
|
1834
|
+
messageIds: _result.map((message) => {
|
|
1833
1835
|
return {
|
|
1834
1836
|
message: message.messageId
|
|
1835
1837
|
};
|
package/cloudflare.mjs
CHANGED
package/express.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as express_serve_static_core from 'express-serve-static-core';
|
|
2
|
-
import { R as RouteFunction, W as WorkflowServeOptions, t as InvokableWorkflow } from './types-
|
|
2
|
+
import { R as RouteFunction, W as WorkflowServeOptions, t as InvokableWorkflow } from './types-DS9q8FyV.mjs';
|
|
3
3
|
import { Router } from 'express';
|
|
4
|
-
import { s as serveManyBase } from './serve-many-
|
|
4
|
+
import { s as serveManyBase } from './serve-many-Fuovl7gl.mjs';
|
|
5
5
|
import '@upstash/qstash';
|
|
6
6
|
import 'zod';
|
|
7
7
|
import 'ai';
|
package/express.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as express_serve_static_core from 'express-serve-static-core';
|
|
2
|
-
import { R as RouteFunction, W as WorkflowServeOptions, t as InvokableWorkflow } from './types-
|
|
2
|
+
import { R as RouteFunction, W as WorkflowServeOptions, t as InvokableWorkflow } from './types-DS9q8FyV.js';
|
|
3
3
|
import { Router } from 'express';
|
|
4
|
-
import { s as serveManyBase } from './serve-many-
|
|
4
|
+
import { s as serveManyBase } from './serve-many-DNnLsDIp.js';
|
|
5
5
|
import '@upstash/qstash';
|
|
6
6
|
import 'zod';
|
|
7
7
|
import 'ai';
|
package/express.js
CHANGED
|
@@ -24861,7 +24861,8 @@ var getHeaders = ({
|
|
|
24861
24861
|
flowControl,
|
|
24862
24862
|
callFlowControl
|
|
24863
24863
|
}) => {
|
|
24864
|
-
const
|
|
24864
|
+
const callHeaders = new Headers(step?.callHeaders);
|
|
24865
|
+
const contentType = (callHeaders.get("content-type") ? callHeaders.get("content-type") : userHeaders?.get("Content-Type") ? userHeaders.get("Content-Type") : void 0) ?? DEFAULT_CONTENT_TYPE;
|
|
24865
24866
|
const baseHeaders = {
|
|
24866
24867
|
[WORKFLOW_INIT_HEADER]: initHeaderValue,
|
|
24867
24868
|
[WORKFLOW_ID_HEADER]: workflowRunId,
|
|
@@ -25158,7 +25159,7 @@ var invokeWorkflow = async ({
|
|
|
25158
25159
|
headers: Object.fromEntries(
|
|
25159
25160
|
Object.entries(invokerHeaders).map((pairs) => [pairs[0], [pairs[1]]])
|
|
25160
25161
|
),
|
|
25161
|
-
workflowRunId,
|
|
25162
|
+
workflowRunId: context.workflowRunId,
|
|
25162
25163
|
workflowUrl: context.url,
|
|
25163
25164
|
step: invokeStep
|
|
25164
25165
|
};
|
|
@@ -25452,7 +25453,7 @@ var AutoExecutor = class _AutoExecutor {
|
|
|
25452
25453
|
});
|
|
25453
25454
|
throw new WorkflowAbort(invokeStep.stepName, invokeStep);
|
|
25454
25455
|
}
|
|
25455
|
-
const result = await this.context.qstashClient.
|
|
25456
|
+
const result = await this.context.qstashClient.batch(
|
|
25456
25457
|
steps.map((singleStep, index) => {
|
|
25457
25458
|
const lazyStep = lazySteps[index];
|
|
25458
25459
|
const { headers } = getHeaders({
|
|
@@ -25482,7 +25483,7 @@ var AutoExecutor = class _AutoExecutor {
|
|
|
25482
25483
|
{
|
|
25483
25484
|
headers,
|
|
25484
25485
|
method: singleStep.callMethod,
|
|
25485
|
-
body: singleStep.callBody,
|
|
25486
|
+
body: JSON.stringify(singleStep.callBody),
|
|
25486
25487
|
url: singleStep.callUrl
|
|
25487
25488
|
}
|
|
25488
25489
|
) : (
|
|
@@ -25492,7 +25493,7 @@ var AutoExecutor = class _AutoExecutor {
|
|
|
25492
25493
|
{
|
|
25493
25494
|
headers,
|
|
25494
25495
|
method: "POST",
|
|
25495
|
-
body: singleStep,
|
|
25496
|
+
body: JSON.stringify(singleStep),
|
|
25496
25497
|
url: this.context.url,
|
|
25497
25498
|
notBefore: willWait ? singleStep.sleepUntil : void 0,
|
|
25498
25499
|
delay: willWait ? singleStep.sleepFor : void 0
|
|
@@ -25500,8 +25501,9 @@ var AutoExecutor = class _AutoExecutor {
|
|
|
25500
25501
|
);
|
|
25501
25502
|
})
|
|
25502
25503
|
);
|
|
25504
|
+
const _result = result;
|
|
25503
25505
|
await this.debug?.log("INFO", "SUBMIT_STEP", {
|
|
25504
|
-
messageIds:
|
|
25506
|
+
messageIds: _result.map((message) => {
|
|
25505
25507
|
return {
|
|
25506
25508
|
message: message.messageId
|
|
25507
25509
|
};
|
package/express.mjs
CHANGED
package/h3.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as h3 from 'h3';
|
|
2
|
-
import { R as RouteFunction, k as PublicServeOptions, t as InvokableWorkflow } from './types-
|
|
3
|
-
import { s as serveManyBase } from './serve-many-
|
|
2
|
+
import { R as RouteFunction, k as PublicServeOptions, t as InvokableWorkflow } from './types-DS9q8FyV.mjs';
|
|
3
|
+
import { s as serveManyBase } from './serve-many-Fuovl7gl.mjs';
|
|
4
4
|
import '@upstash/qstash';
|
|
5
5
|
import 'zod';
|
|
6
6
|
import 'ai';
|
package/h3.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as h3 from 'h3';
|
|
2
|
-
import { R as RouteFunction, k as PublicServeOptions, t as InvokableWorkflow } from './types-
|
|
3
|
-
import { s as serveManyBase } from './serve-many-
|
|
2
|
+
import { R as RouteFunction, k as PublicServeOptions, t as InvokableWorkflow } from './types-DS9q8FyV.js';
|
|
3
|
+
import { s as serveManyBase } from './serve-many-DNnLsDIp.js';
|
|
4
4
|
import '@upstash/qstash';
|
|
5
5
|
import 'zod';
|
|
6
6
|
import 'ai';
|
package/h3.js
CHANGED
|
@@ -1501,7 +1501,8 @@ var getHeaders = ({
|
|
|
1501
1501
|
flowControl,
|
|
1502
1502
|
callFlowControl
|
|
1503
1503
|
}) => {
|
|
1504
|
-
const
|
|
1504
|
+
const callHeaders = new Headers(step?.callHeaders);
|
|
1505
|
+
const contentType = (callHeaders.get("content-type") ? callHeaders.get("content-type") : userHeaders?.get("Content-Type") ? userHeaders.get("Content-Type") : void 0) ?? DEFAULT_CONTENT_TYPE;
|
|
1505
1506
|
const baseHeaders = {
|
|
1506
1507
|
[WORKFLOW_INIT_HEADER]: initHeaderValue,
|
|
1507
1508
|
[WORKFLOW_ID_HEADER]: workflowRunId,
|
|
@@ -1798,7 +1799,7 @@ var invokeWorkflow = async ({
|
|
|
1798
1799
|
headers: Object.fromEntries(
|
|
1799
1800
|
Object.entries(invokerHeaders).map((pairs) => [pairs[0], [pairs[1]]])
|
|
1800
1801
|
),
|
|
1801
|
-
workflowRunId,
|
|
1802
|
+
workflowRunId: context.workflowRunId,
|
|
1802
1803
|
workflowUrl: context.url,
|
|
1803
1804
|
step: invokeStep
|
|
1804
1805
|
};
|
|
@@ -2092,7 +2093,7 @@ var AutoExecutor = class _AutoExecutor {
|
|
|
2092
2093
|
});
|
|
2093
2094
|
throw new WorkflowAbort(invokeStep.stepName, invokeStep);
|
|
2094
2095
|
}
|
|
2095
|
-
const result = await this.context.qstashClient.
|
|
2096
|
+
const result = await this.context.qstashClient.batch(
|
|
2096
2097
|
steps.map((singleStep, index) => {
|
|
2097
2098
|
const lazyStep = lazySteps[index];
|
|
2098
2099
|
const { headers } = getHeaders({
|
|
@@ -2122,7 +2123,7 @@ var AutoExecutor = class _AutoExecutor {
|
|
|
2122
2123
|
{
|
|
2123
2124
|
headers,
|
|
2124
2125
|
method: singleStep.callMethod,
|
|
2125
|
-
body: singleStep.callBody,
|
|
2126
|
+
body: JSON.stringify(singleStep.callBody),
|
|
2126
2127
|
url: singleStep.callUrl
|
|
2127
2128
|
}
|
|
2128
2129
|
) : (
|
|
@@ -2132,7 +2133,7 @@ var AutoExecutor = class _AutoExecutor {
|
|
|
2132
2133
|
{
|
|
2133
2134
|
headers,
|
|
2134
2135
|
method: "POST",
|
|
2135
|
-
body: singleStep,
|
|
2136
|
+
body: JSON.stringify(singleStep),
|
|
2136
2137
|
url: this.context.url,
|
|
2137
2138
|
notBefore: willWait ? singleStep.sleepUntil : void 0,
|
|
2138
2139
|
delay: willWait ? singleStep.sleepFor : void 0
|
|
@@ -2140,8 +2141,9 @@ var AutoExecutor = class _AutoExecutor {
|
|
|
2140
2141
|
);
|
|
2141
2142
|
})
|
|
2142
2143
|
);
|
|
2144
|
+
const _result = result;
|
|
2143
2145
|
await this.debug?.log("INFO", "SUBMIT_STEP", {
|
|
2144
|
-
messageIds:
|
|
2146
|
+
messageIds: _result.map((message) => {
|
|
2145
2147
|
return {
|
|
2146
2148
|
message: message.messageId
|
|
2147
2149
|
};
|
package/h3.mjs
CHANGED
package/hono.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Context } from 'hono';
|
|
2
|
-
import { R as RouteFunction, k as PublicServeOptions, t as InvokableWorkflow } from './types-
|
|
2
|
+
import { R as RouteFunction, k as PublicServeOptions, t as InvokableWorkflow } from './types-DS9q8FyV.mjs';
|
|
3
3
|
import { Variables } from 'hono/types';
|
|
4
|
-
import { s as serveManyBase } from './serve-many-
|
|
4
|
+
import { s as serveManyBase } from './serve-many-Fuovl7gl.mjs';
|
|
5
5
|
import '@upstash/qstash';
|
|
6
6
|
import 'zod';
|
|
7
7
|
import 'ai';
|
|
@@ -27,7 +27,7 @@ declare const serve: <TInitialPayload = unknown, TBindings extends WorkflowBindi
|
|
|
27
27
|
Bindings: TBindings;
|
|
28
28
|
Variables: TVariables;
|
|
29
29
|
}>) => Promise<Response>);
|
|
30
|
-
declare const createWorkflow: <TInitialPayload, TResult>(routeFunction: RouteFunction<TInitialPayload, TResult>, options?: PublicServeOptions<TInitialPayload> | undefined) => InvokableWorkflow<TInitialPayload, TResult>;
|
|
30
|
+
declare const createWorkflow: <TInitialPayload = unknown, TResult = unknown, TBindings extends WorkflowBindings = WorkflowBindings, TVariables extends Variables = object>(routeFunction: RouteFunction<TInitialPayload, TResult>, options?: PublicServeOptions<TInitialPayload> | undefined) => InvokableWorkflow<TInitialPayload, TResult>;
|
|
31
31
|
declare const serveMany: (workflows: Parameters<typeof serveManyBase>[0]["workflows"], options?: Parameters<typeof serveManyBase>[0]["options"]) => (context: Context<{
|
|
32
32
|
Bindings: WorkflowBindings;
|
|
33
33
|
Variables: object;
|
package/hono.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Context } from 'hono';
|
|
2
|
-
import { R as RouteFunction, k as PublicServeOptions, t as InvokableWorkflow } from './types-
|
|
2
|
+
import { R as RouteFunction, k as PublicServeOptions, t as InvokableWorkflow } from './types-DS9q8FyV.js';
|
|
3
3
|
import { Variables } from 'hono/types';
|
|
4
|
-
import { s as serveManyBase } from './serve-many-
|
|
4
|
+
import { s as serveManyBase } from './serve-many-DNnLsDIp.js';
|
|
5
5
|
import '@upstash/qstash';
|
|
6
6
|
import 'zod';
|
|
7
7
|
import 'ai';
|
|
@@ -27,7 +27,7 @@ declare const serve: <TInitialPayload = unknown, TBindings extends WorkflowBindi
|
|
|
27
27
|
Bindings: TBindings;
|
|
28
28
|
Variables: TVariables;
|
|
29
29
|
}>) => Promise<Response>);
|
|
30
|
-
declare const createWorkflow: <TInitialPayload, TResult>(routeFunction: RouteFunction<TInitialPayload, TResult>, options?: PublicServeOptions<TInitialPayload> | undefined) => InvokableWorkflow<TInitialPayload, TResult>;
|
|
30
|
+
declare const createWorkflow: <TInitialPayload = unknown, TResult = unknown, TBindings extends WorkflowBindings = WorkflowBindings, TVariables extends Variables = object>(routeFunction: RouteFunction<TInitialPayload, TResult>, options?: PublicServeOptions<TInitialPayload> | undefined) => InvokableWorkflow<TInitialPayload, TResult>;
|
|
31
31
|
declare const serveMany: (workflows: Parameters<typeof serveManyBase>[0]["workflows"], options?: Parameters<typeof serveManyBase>[0]["options"]) => (context: Context<{
|
|
32
32
|
Bindings: WorkflowBindings;
|
|
33
33
|
Variables: object;
|
package/hono.js
CHANGED
|
@@ -1189,7 +1189,8 @@ var getHeaders = ({
|
|
|
1189
1189
|
flowControl,
|
|
1190
1190
|
callFlowControl
|
|
1191
1191
|
}) => {
|
|
1192
|
-
const
|
|
1192
|
+
const callHeaders = new Headers(step?.callHeaders);
|
|
1193
|
+
const contentType = (callHeaders.get("content-type") ? callHeaders.get("content-type") : userHeaders?.get("Content-Type") ? userHeaders.get("Content-Type") : void 0) ?? DEFAULT_CONTENT_TYPE;
|
|
1193
1194
|
const baseHeaders = {
|
|
1194
1195
|
[WORKFLOW_INIT_HEADER]: initHeaderValue,
|
|
1195
1196
|
[WORKFLOW_ID_HEADER]: workflowRunId,
|
|
@@ -1486,7 +1487,7 @@ var invokeWorkflow = async ({
|
|
|
1486
1487
|
headers: Object.fromEntries(
|
|
1487
1488
|
Object.entries(invokerHeaders).map((pairs) => [pairs[0], [pairs[1]]])
|
|
1488
1489
|
),
|
|
1489
|
-
workflowRunId,
|
|
1490
|
+
workflowRunId: context.workflowRunId,
|
|
1490
1491
|
workflowUrl: context.url,
|
|
1491
1492
|
step: invokeStep
|
|
1492
1493
|
};
|
|
@@ -1780,7 +1781,7 @@ var AutoExecutor = class _AutoExecutor {
|
|
|
1780
1781
|
});
|
|
1781
1782
|
throw new WorkflowAbort(invokeStep.stepName, invokeStep);
|
|
1782
1783
|
}
|
|
1783
|
-
const result = await this.context.qstashClient.
|
|
1784
|
+
const result = await this.context.qstashClient.batch(
|
|
1784
1785
|
steps.map((singleStep, index) => {
|
|
1785
1786
|
const lazyStep = lazySteps[index];
|
|
1786
1787
|
const { headers } = getHeaders({
|
|
@@ -1810,7 +1811,7 @@ var AutoExecutor = class _AutoExecutor {
|
|
|
1810
1811
|
{
|
|
1811
1812
|
headers,
|
|
1812
1813
|
method: singleStep.callMethod,
|
|
1813
|
-
body: singleStep.callBody,
|
|
1814
|
+
body: JSON.stringify(singleStep.callBody),
|
|
1814
1815
|
url: singleStep.callUrl
|
|
1815
1816
|
}
|
|
1816
1817
|
) : (
|
|
@@ -1820,7 +1821,7 @@ var AutoExecutor = class _AutoExecutor {
|
|
|
1820
1821
|
{
|
|
1821
1822
|
headers,
|
|
1822
1823
|
method: "POST",
|
|
1823
|
-
body: singleStep,
|
|
1824
|
+
body: JSON.stringify(singleStep),
|
|
1824
1825
|
url: this.context.url,
|
|
1825
1826
|
notBefore: willWait ? singleStep.sleepUntil : void 0,
|
|
1826
1827
|
delay: willWait ? singleStep.sleepFor : void 0
|
|
@@ -1828,8 +1829,9 @@ var AutoExecutor = class _AutoExecutor {
|
|
|
1828
1829
|
);
|
|
1829
1830
|
})
|
|
1830
1831
|
);
|
|
1832
|
+
const _result = result;
|
|
1831
1833
|
await this.debug?.log("INFO", "SUBMIT_STEP", {
|
|
1832
|
-
messageIds:
|
|
1834
|
+
messageIds: _result.map((message) => {
|
|
1833
1835
|
return {
|
|
1834
1836
|
message: message.messageId
|
|
1835
1837
|
};
|
package/hono.mjs
CHANGED
package/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { R as RouteFunction, W as WorkflowServeOptions, E as ExclusiveValidationOptions, T as Telemetry, S as StepType, a as RawStep, N as NotifyResponse, b as Waiter, c as Step } from './types-
|
|
2
|
-
export { A as AsyncStepFunction, C as CallResponse, r as CallSettings, D as Duration, l as FailureFunctionPayload, F as FinishCondition, H as HeaderParams, t as InvokableWorkflow, s as InvokeStepResponse, I as InvokeWorkflowRequest, L as LazyInvokeStepParams, u as LogLevel, p as NotifyStepResponse, P as ParallelCallState, k as PublicServeOptions, m as RequiredExceptFields, j as StepFunction, h as StepTypes, i as SyncStepFunction, q as WaitEventOptions, n as WaitRequest, o as WaitStepResponse, f as WorkflowClient, e as WorkflowContext, w as WorkflowLogger, v as WorkflowLoggerOptions, g as WorkflowReceiver, d as WorkflowTool } from './types-
|
|
1
|
+
import { R as RouteFunction, W as WorkflowServeOptions, E as ExclusiveValidationOptions, T as Telemetry, S as StepType, a as RawStep, N as NotifyResponse, b as Waiter, c as Step } from './types-DS9q8FyV.mjs';
|
|
2
|
+
export { A as AsyncStepFunction, C as CallResponse, r as CallSettings, D as Duration, l as FailureFunctionPayload, F as FinishCondition, H as HeaderParams, t as InvokableWorkflow, s as InvokeStepResponse, I as InvokeWorkflowRequest, L as LazyInvokeStepParams, u as LogLevel, p as NotifyStepResponse, P as ParallelCallState, k as PublicServeOptions, m as RequiredExceptFields, j as StepFunction, h as StepTypes, i as SyncStepFunction, q as WaitEventOptions, n as WaitRequest, o as WaitStepResponse, f as WorkflowClient, e as WorkflowContext, w as WorkflowLogger, v as WorkflowLoggerOptions, g as WorkflowReceiver, d as WorkflowTool } from './types-DS9q8FyV.mjs';
|
|
3
3
|
import { HTTPMethods, State, FlowControl, Client as Client$1, QstashError } from '@upstash/qstash';
|
|
4
4
|
import 'zod';
|
|
5
5
|
import 'ai';
|
|
@@ -251,6 +251,32 @@ type WorkflowRunLog = {
|
|
|
251
251
|
*
|
|
252
252
|
*/
|
|
253
253
|
steps: StepLogGroup[];
|
|
254
|
+
/**
|
|
255
|
+
* If the workflow returned a response, the stringified state of this
|
|
256
|
+
* response will be available in the workflowRunResponse field.
|
|
257
|
+
*
|
|
258
|
+
* To restore it to its original format, use JSON.parse.
|
|
259
|
+
*/
|
|
260
|
+
workflowRunResponse?: string;
|
|
261
|
+
/**
|
|
262
|
+
* Information on the invoker workflow run, if any
|
|
263
|
+
*/
|
|
264
|
+
invoker?: {
|
|
265
|
+
/**
|
|
266
|
+
* run id of the invoker workflow
|
|
267
|
+
*/
|
|
268
|
+
workflowRunId: string;
|
|
269
|
+
/**
|
|
270
|
+
* URL of the invoker workflow
|
|
271
|
+
*/
|
|
272
|
+
workflowUrl: string;
|
|
273
|
+
/**
|
|
274
|
+
* Time when the invoker workflow run was created
|
|
275
|
+
*
|
|
276
|
+
* in unix milliseconds format
|
|
277
|
+
*/
|
|
278
|
+
workflowRunCreatedAt: number;
|
|
279
|
+
};
|
|
254
280
|
};
|
|
255
281
|
type WorkflowRunLogs = {
|
|
256
282
|
cursor: string;
|
package/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { R as RouteFunction, W as WorkflowServeOptions, E as ExclusiveValidationOptions, T as Telemetry, S as StepType, a as RawStep, N as NotifyResponse, b as Waiter, c as Step } from './types-
|
|
2
|
-
export { A as AsyncStepFunction, C as CallResponse, r as CallSettings, D as Duration, l as FailureFunctionPayload, F as FinishCondition, H as HeaderParams, t as InvokableWorkflow, s as InvokeStepResponse, I as InvokeWorkflowRequest, L as LazyInvokeStepParams, u as LogLevel, p as NotifyStepResponse, P as ParallelCallState, k as PublicServeOptions, m as RequiredExceptFields, j as StepFunction, h as StepTypes, i as SyncStepFunction, q as WaitEventOptions, n as WaitRequest, o as WaitStepResponse, f as WorkflowClient, e as WorkflowContext, w as WorkflowLogger, v as WorkflowLoggerOptions, g as WorkflowReceiver, d as WorkflowTool } from './types-
|
|
1
|
+
import { R as RouteFunction, W as WorkflowServeOptions, E as ExclusiveValidationOptions, T as Telemetry, S as StepType, a as RawStep, N as NotifyResponse, b as Waiter, c as Step } from './types-DS9q8FyV.js';
|
|
2
|
+
export { A as AsyncStepFunction, C as CallResponse, r as CallSettings, D as Duration, l as FailureFunctionPayload, F as FinishCondition, H as HeaderParams, t as InvokableWorkflow, s as InvokeStepResponse, I as InvokeWorkflowRequest, L as LazyInvokeStepParams, u as LogLevel, p as NotifyStepResponse, P as ParallelCallState, k as PublicServeOptions, m as RequiredExceptFields, j as StepFunction, h as StepTypes, i as SyncStepFunction, q as WaitEventOptions, n as WaitRequest, o as WaitStepResponse, f as WorkflowClient, e as WorkflowContext, w as WorkflowLogger, v as WorkflowLoggerOptions, g as WorkflowReceiver, d as WorkflowTool } from './types-DS9q8FyV.js';
|
|
3
3
|
import { HTTPMethods, State, FlowControl, Client as Client$1, QstashError } from '@upstash/qstash';
|
|
4
4
|
import 'zod';
|
|
5
5
|
import 'ai';
|
|
@@ -251,6 +251,32 @@ type WorkflowRunLog = {
|
|
|
251
251
|
*
|
|
252
252
|
*/
|
|
253
253
|
steps: StepLogGroup[];
|
|
254
|
+
/**
|
|
255
|
+
* If the workflow returned a response, the stringified state of this
|
|
256
|
+
* response will be available in the workflowRunResponse field.
|
|
257
|
+
*
|
|
258
|
+
* To restore it to its original format, use JSON.parse.
|
|
259
|
+
*/
|
|
260
|
+
workflowRunResponse?: string;
|
|
261
|
+
/**
|
|
262
|
+
* Information on the invoker workflow run, if any
|
|
263
|
+
*/
|
|
264
|
+
invoker?: {
|
|
265
|
+
/**
|
|
266
|
+
* run id of the invoker workflow
|
|
267
|
+
*/
|
|
268
|
+
workflowRunId: string;
|
|
269
|
+
/**
|
|
270
|
+
* URL of the invoker workflow
|
|
271
|
+
*/
|
|
272
|
+
workflowUrl: string;
|
|
273
|
+
/**
|
|
274
|
+
* Time when the invoker workflow run was created
|
|
275
|
+
*
|
|
276
|
+
* in unix milliseconds format
|
|
277
|
+
*/
|
|
278
|
+
workflowRunCreatedAt: number;
|
|
279
|
+
};
|
|
254
280
|
};
|
|
255
281
|
type WorkflowRunLogs = {
|
|
256
282
|
cursor: string;
|
package/index.js
CHANGED
|
@@ -1201,7 +1201,8 @@ var getHeaders = ({
|
|
|
1201
1201
|
flowControl,
|
|
1202
1202
|
callFlowControl
|
|
1203
1203
|
}) => {
|
|
1204
|
-
const
|
|
1204
|
+
const callHeaders = new Headers(step?.callHeaders);
|
|
1205
|
+
const contentType = (callHeaders.get("content-type") ? callHeaders.get("content-type") : userHeaders?.get("Content-Type") ? userHeaders.get("Content-Type") : void 0) ?? DEFAULT_CONTENT_TYPE;
|
|
1205
1206
|
const baseHeaders = {
|
|
1206
1207
|
[WORKFLOW_INIT_HEADER]: initHeaderValue,
|
|
1207
1208
|
[WORKFLOW_ID_HEADER]: workflowRunId,
|
|
@@ -1437,7 +1438,7 @@ var invokeWorkflow = async ({
|
|
|
1437
1438
|
headers: Object.fromEntries(
|
|
1438
1439
|
Object.entries(invokerHeaders).map((pairs) => [pairs[0], [pairs[1]]])
|
|
1439
1440
|
),
|
|
1440
|
-
workflowRunId,
|
|
1441
|
+
workflowRunId: context.workflowRunId,
|
|
1441
1442
|
workflowUrl: context.url,
|
|
1442
1443
|
step: invokeStep
|
|
1443
1444
|
};
|
|
@@ -1731,7 +1732,7 @@ var AutoExecutor = class _AutoExecutor {
|
|
|
1731
1732
|
});
|
|
1732
1733
|
throw new WorkflowAbort(invokeStep.stepName, invokeStep);
|
|
1733
1734
|
}
|
|
1734
|
-
const result = await this.context.qstashClient.
|
|
1735
|
+
const result = await this.context.qstashClient.batch(
|
|
1735
1736
|
steps.map((singleStep, index) => {
|
|
1736
1737
|
const lazyStep = lazySteps[index];
|
|
1737
1738
|
const { headers } = getHeaders({
|
|
@@ -1761,7 +1762,7 @@ var AutoExecutor = class _AutoExecutor {
|
|
|
1761
1762
|
{
|
|
1762
1763
|
headers,
|
|
1763
1764
|
method: singleStep.callMethod,
|
|
1764
|
-
body: singleStep.callBody,
|
|
1765
|
+
body: JSON.stringify(singleStep.callBody),
|
|
1765
1766
|
url: singleStep.callUrl
|
|
1766
1767
|
}
|
|
1767
1768
|
) : (
|
|
@@ -1771,7 +1772,7 @@ var AutoExecutor = class _AutoExecutor {
|
|
|
1771
1772
|
{
|
|
1772
1773
|
headers,
|
|
1773
1774
|
method: "POST",
|
|
1774
|
-
body: singleStep,
|
|
1775
|
+
body: JSON.stringify(singleStep),
|
|
1775
1776
|
url: this.context.url,
|
|
1776
1777
|
notBefore: willWait ? singleStep.sleepUntil : void 0,
|
|
1777
1778
|
delay: willWait ? singleStep.sleepFor : void 0
|
|
@@ -1779,8 +1780,9 @@ var AutoExecutor = class _AutoExecutor {
|
|
|
1779
1780
|
);
|
|
1780
1781
|
})
|
|
1781
1782
|
);
|
|
1783
|
+
const _result = result;
|
|
1782
1784
|
await this.debug?.log("INFO", "SUBMIT_STEP", {
|
|
1783
|
-
messageIds:
|
|
1785
|
+
messageIds: _result.map((message) => {
|
|
1784
1786
|
return {
|
|
1785
1787
|
message: message.messageId
|
|
1786
1788
|
};
|
package/index.mjs
CHANGED
package/nextjs.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { NextApiHandler, NextApiRequest, NextApiResponse } from 'next';
|
|
2
|
-
import { R as RouteFunction, k as PublicServeOptions, t as InvokableWorkflow } from './types-
|
|
3
|
-
import { s as serveManyBase } from './serve-many-
|
|
2
|
+
import { R as RouteFunction, k as PublicServeOptions, t as InvokableWorkflow } from './types-DS9q8FyV.mjs';
|
|
3
|
+
import { s as serveManyBase } from './serve-many-Fuovl7gl.mjs';
|
|
4
4
|
import '@upstash/qstash';
|
|
5
5
|
import 'zod';
|
|
6
6
|
import 'ai';
|
package/nextjs.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { NextApiHandler, NextApiRequest, NextApiResponse } from 'next';
|
|
2
|
-
import { R as RouteFunction, k as PublicServeOptions, t as InvokableWorkflow } from './types-
|
|
3
|
-
import { s as serveManyBase } from './serve-many-
|
|
2
|
+
import { R as RouteFunction, k as PublicServeOptions, t as InvokableWorkflow } from './types-DS9q8FyV.js';
|
|
3
|
+
import { s as serveManyBase } from './serve-many-DNnLsDIp.js';
|
|
4
4
|
import '@upstash/qstash';
|
|
5
5
|
import 'zod';
|
|
6
6
|
import 'ai';
|
package/nextjs.js
CHANGED
|
@@ -1192,7 +1192,8 @@ var getHeaders = ({
|
|
|
1192
1192
|
flowControl,
|
|
1193
1193
|
callFlowControl
|
|
1194
1194
|
}) => {
|
|
1195
|
-
const
|
|
1195
|
+
const callHeaders = new Headers(step?.callHeaders);
|
|
1196
|
+
const contentType = (callHeaders.get("content-type") ? callHeaders.get("content-type") : userHeaders?.get("Content-Type") ? userHeaders.get("Content-Type") : void 0) ?? DEFAULT_CONTENT_TYPE;
|
|
1196
1197
|
const baseHeaders = {
|
|
1197
1198
|
[WORKFLOW_INIT_HEADER]: initHeaderValue,
|
|
1198
1199
|
[WORKFLOW_ID_HEADER]: workflowRunId,
|
|
@@ -1489,7 +1490,7 @@ var invokeWorkflow = async ({
|
|
|
1489
1490
|
headers: Object.fromEntries(
|
|
1490
1491
|
Object.entries(invokerHeaders).map((pairs) => [pairs[0], [pairs[1]]])
|
|
1491
1492
|
),
|
|
1492
|
-
workflowRunId,
|
|
1493
|
+
workflowRunId: context.workflowRunId,
|
|
1493
1494
|
workflowUrl: context.url,
|
|
1494
1495
|
step: invokeStep
|
|
1495
1496
|
};
|
|
@@ -1783,7 +1784,7 @@ var AutoExecutor = class _AutoExecutor {
|
|
|
1783
1784
|
});
|
|
1784
1785
|
throw new WorkflowAbort(invokeStep.stepName, invokeStep);
|
|
1785
1786
|
}
|
|
1786
|
-
const result = await this.context.qstashClient.
|
|
1787
|
+
const result = await this.context.qstashClient.batch(
|
|
1787
1788
|
steps.map((singleStep, index) => {
|
|
1788
1789
|
const lazyStep = lazySteps[index];
|
|
1789
1790
|
const { headers } = getHeaders({
|
|
@@ -1813,7 +1814,7 @@ var AutoExecutor = class _AutoExecutor {
|
|
|
1813
1814
|
{
|
|
1814
1815
|
headers,
|
|
1815
1816
|
method: singleStep.callMethod,
|
|
1816
|
-
body: singleStep.callBody,
|
|
1817
|
+
body: JSON.stringify(singleStep.callBody),
|
|
1817
1818
|
url: singleStep.callUrl
|
|
1818
1819
|
}
|
|
1819
1820
|
) : (
|
|
@@ -1823,7 +1824,7 @@ var AutoExecutor = class _AutoExecutor {
|
|
|
1823
1824
|
{
|
|
1824
1825
|
headers,
|
|
1825
1826
|
method: "POST",
|
|
1826
|
-
body: singleStep,
|
|
1827
|
+
body: JSON.stringify(singleStep),
|
|
1827
1828
|
url: this.context.url,
|
|
1828
1829
|
notBefore: willWait ? singleStep.sleepUntil : void 0,
|
|
1829
1830
|
delay: willWait ? singleStep.sleepFor : void 0
|
|
@@ -1831,8 +1832,9 @@ var AutoExecutor = class _AutoExecutor {
|
|
|
1831
1832
|
);
|
|
1832
1833
|
})
|
|
1833
1834
|
);
|
|
1835
|
+
const _result = result;
|
|
1834
1836
|
await this.debug?.log("INFO", "SUBMIT_STEP", {
|
|
1835
|
-
messageIds:
|
|
1837
|
+
messageIds: _result.map((message) => {
|
|
1836
1838
|
return {
|
|
1837
1839
|
message: message.messageId
|
|
1838
1840
|
};
|
package/nextjs.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@upstash/workflow","version":"v0.2.
|
|
1
|
+
{"name":"@upstash/workflow","version":"v0.2.11","description":"Durable, Reliable and Performant Serverless Functions","main":"./index.js","module":"./index.mjs","types":"./index.d.ts","files":["./*"],"exports":{".":{"import":"./index.mjs","require":"./index.js"},"./dist/nextjs":{"import":"./nextjs.mjs","require":"./nextjs.js"},"./nextjs":{"import":"./nextjs.mjs","require":"./nextjs.js"},"./h3":{"import":"./h3.mjs","require":"./h3.js"},"./svelte":{"import":"./svelte.mjs","require":"./svelte.js"},"./solidjs":{"import":"./solidjs.mjs","require":"./solidjs.js"},"./workflow":{"import":"./workflow.mjs","require":"./workflow.js"},"./hono":{"import":"./hono.mjs","require":"./hono.js"},"./cloudflare":{"import":"./cloudflare.mjs","require":"./cloudflare.js"},"./astro":{"import":"./astro.mjs","require":"./astro.js"},"./express":{"import":"./express.mjs","require":"./express.js"}},"scripts":{"build":"tsup && cp README.md ./dist/ && cp package.json ./dist/ && cp LICENSE ./dist/","test":"bun test src","fmt":"prettier --write .","lint":"tsc && eslint \"{src,platforms}/**/*.{js,ts,tsx}\" --quiet --fix","check-exports":"bun run build && cd dist && attw -P"},"repository":{"type":"git","url":"git+https://github.com/upstash/workflow-ts.git"},"keywords":["upstash","qstash","workflow","serverless"],"author":"Cahid Arda Oz","license":"MIT","bugs":{"url":"https://github.com/upstash/workflow-ts/issues"},"homepage":"https://github.com/upstash/workflow-ts#readme","devDependencies":{"@commitlint/cli":"^19.5.0","@commitlint/config-conventional":"^19.5.0","@eslint/js":"^9.11.1","@solidjs/start":"^1.0.8","@sveltejs/kit":"^2.6.1","@types/bun":"^1.1.10","@types/express":"^5.0.0","astro":"^4.16.7","eslint":"^9.11.1","eslint-plugin-unicorn":"^55.0.0","express":"^4.21.1","globals":"^15.10.0","h3":"^1.12.0","hono":"^4.6.20","husky":"^9.1.6","next":"^14.2.14","prettier":"3.3.3","tsup":"^8.3.0","typescript":"^5.7.2","typescript-eslint":"^8.18.0"},"dependencies":{"@ai-sdk/openai":"^1.0.15","@upstash/qstash":"^2.7.22","ai":"^4.0.30","zod":"^3.24.1"},"directories":{"example":"examples"}}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { k as PublicServeOptions, R as RouteFunction, t as InvokableWorkflow } from './types-
|
|
1
|
+
import { k as PublicServeOptions, R as RouteFunction, t as InvokableWorkflow } from './types-DS9q8FyV.js';
|
|
2
2
|
|
|
3
3
|
type OmitOptionsInServeMany<TOptions> = Omit<TOptions, "env" | "url" | "schema" | "initialPayloadParser">;
|
|
4
4
|
declare const serveManyBase: <THandler extends (...params: any[]) => any, TOptions extends OmitOptionsInServeMany<PublicServeOptions> = OmitOptionsInServeMany<PublicServeOptions>, TServeParams extends [routeFunction: RouteFunction<any, any>, options: TOptions] = [routeFunction: RouteFunction<any, any>, options: TOptions]>({ workflows, getUrl, serveMethod, options, }: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { k as PublicServeOptions, R as RouteFunction, t as InvokableWorkflow } from './types-
|
|
1
|
+
import { k as PublicServeOptions, R as RouteFunction, t as InvokableWorkflow } from './types-DS9q8FyV.mjs';
|
|
2
2
|
|
|
3
3
|
type OmitOptionsInServeMany<TOptions> = Omit<TOptions, "env" | "url" | "schema" | "initialPayloadParser">;
|
|
4
4
|
declare const serveManyBase: <THandler extends (...params: any[]) => any, TOptions extends OmitOptionsInServeMany<PublicServeOptions> = OmitOptionsInServeMany<PublicServeOptions>, TServeParams extends [routeFunction: RouteFunction<any, any>, options: TOptions] = [routeFunction: RouteFunction<any, any>, options: TOptions]>({ workflows, getUrl, serveMethod, options, }: {
|
package/solidjs.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { APIEvent } from '@solidjs/start/server';
|
|
2
|
-
import { R as RouteFunction, k as PublicServeOptions } from './types-
|
|
2
|
+
import { R as RouteFunction, k as PublicServeOptions } from './types-DS9q8FyV.mjs';
|
|
3
3
|
import '@upstash/qstash';
|
|
4
4
|
import 'zod';
|
|
5
5
|
import 'ai';
|
package/solidjs.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { APIEvent } from '@solidjs/start/server';
|
|
2
|
-
import { R as RouteFunction, k as PublicServeOptions } from './types-
|
|
2
|
+
import { R as RouteFunction, k as PublicServeOptions } from './types-DS9q8FyV.js';
|
|
3
3
|
import '@upstash/qstash';
|
|
4
4
|
import 'zod';
|
|
5
5
|
import 'ai';
|
package/solidjs.js
CHANGED
|
@@ -1187,7 +1187,8 @@ var getHeaders = ({
|
|
|
1187
1187
|
flowControl,
|
|
1188
1188
|
callFlowControl
|
|
1189
1189
|
}) => {
|
|
1190
|
-
const
|
|
1190
|
+
const callHeaders = new Headers(step?.callHeaders);
|
|
1191
|
+
const contentType = (callHeaders.get("content-type") ? callHeaders.get("content-type") : userHeaders?.get("Content-Type") ? userHeaders.get("Content-Type") : void 0) ?? DEFAULT_CONTENT_TYPE;
|
|
1191
1192
|
const baseHeaders = {
|
|
1192
1193
|
[WORKFLOW_INIT_HEADER]: initHeaderValue,
|
|
1193
1194
|
[WORKFLOW_ID_HEADER]: workflowRunId,
|
|
@@ -1423,7 +1424,7 @@ var invokeWorkflow = async ({
|
|
|
1423
1424
|
headers: Object.fromEntries(
|
|
1424
1425
|
Object.entries(invokerHeaders).map((pairs) => [pairs[0], [pairs[1]]])
|
|
1425
1426
|
),
|
|
1426
|
-
workflowRunId,
|
|
1427
|
+
workflowRunId: context.workflowRunId,
|
|
1427
1428
|
workflowUrl: context.url,
|
|
1428
1429
|
step: invokeStep
|
|
1429
1430
|
};
|
|
@@ -1717,7 +1718,7 @@ var AutoExecutor = class _AutoExecutor {
|
|
|
1717
1718
|
});
|
|
1718
1719
|
throw new WorkflowAbort(invokeStep.stepName, invokeStep);
|
|
1719
1720
|
}
|
|
1720
|
-
const result = await this.context.qstashClient.
|
|
1721
|
+
const result = await this.context.qstashClient.batch(
|
|
1721
1722
|
steps.map((singleStep, index) => {
|
|
1722
1723
|
const lazyStep = lazySteps[index];
|
|
1723
1724
|
const { headers } = getHeaders({
|
|
@@ -1747,7 +1748,7 @@ var AutoExecutor = class _AutoExecutor {
|
|
|
1747
1748
|
{
|
|
1748
1749
|
headers,
|
|
1749
1750
|
method: singleStep.callMethod,
|
|
1750
|
-
body: singleStep.callBody,
|
|
1751
|
+
body: JSON.stringify(singleStep.callBody),
|
|
1751
1752
|
url: singleStep.callUrl
|
|
1752
1753
|
}
|
|
1753
1754
|
) : (
|
|
@@ -1757,7 +1758,7 @@ var AutoExecutor = class _AutoExecutor {
|
|
|
1757
1758
|
{
|
|
1758
1759
|
headers,
|
|
1759
1760
|
method: "POST",
|
|
1760
|
-
body: singleStep,
|
|
1761
|
+
body: JSON.stringify(singleStep),
|
|
1761
1762
|
url: this.context.url,
|
|
1762
1763
|
notBefore: willWait ? singleStep.sleepUntil : void 0,
|
|
1763
1764
|
delay: willWait ? singleStep.sleepFor : void 0
|
|
@@ -1765,8 +1766,9 @@ var AutoExecutor = class _AutoExecutor {
|
|
|
1765
1766
|
);
|
|
1766
1767
|
})
|
|
1767
1768
|
);
|
|
1769
|
+
const _result = result;
|
|
1768
1770
|
await this.debug?.log("INFO", "SUBMIT_STEP", {
|
|
1769
|
-
messageIds:
|
|
1771
|
+
messageIds: _result.map((message) => {
|
|
1770
1772
|
return {
|
|
1771
1773
|
message: message.messageId
|
|
1772
1774
|
};
|
package/solidjs.mjs
CHANGED
package/svelte.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as _sveltejs_kit from '@sveltejs/kit';
|
|
2
2
|
import { RequestHandler } from '@sveltejs/kit';
|
|
3
|
-
import { R as RouteFunction, k as PublicServeOptions, t as InvokableWorkflow } from './types-
|
|
4
|
-
import { s as serveManyBase } from './serve-many-
|
|
3
|
+
import { R as RouteFunction, k as PublicServeOptions, t as InvokableWorkflow } from './types-DS9q8FyV.mjs';
|
|
4
|
+
import { s as serveManyBase } from './serve-many-Fuovl7gl.mjs';
|
|
5
5
|
import '@upstash/qstash';
|
|
6
6
|
import 'zod';
|
|
7
7
|
import 'ai';
|
package/svelte.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as _sveltejs_kit from '@sveltejs/kit';
|
|
2
2
|
import { RequestHandler } from '@sveltejs/kit';
|
|
3
|
-
import { R as RouteFunction, k as PublicServeOptions, t as InvokableWorkflow } from './types-
|
|
4
|
-
import { s as serveManyBase } from './serve-many-
|
|
3
|
+
import { R as RouteFunction, k as PublicServeOptions, t as InvokableWorkflow } from './types-DS9q8FyV.js';
|
|
4
|
+
import { s as serveManyBase } from './serve-many-DNnLsDIp.js';
|
|
5
5
|
import '@upstash/qstash';
|
|
6
6
|
import 'zod';
|
|
7
7
|
import 'ai';
|
package/svelte.js
CHANGED
|
@@ -1189,7 +1189,8 @@ var getHeaders = ({
|
|
|
1189
1189
|
flowControl,
|
|
1190
1190
|
callFlowControl
|
|
1191
1191
|
}) => {
|
|
1192
|
-
const
|
|
1192
|
+
const callHeaders = new Headers(step?.callHeaders);
|
|
1193
|
+
const contentType = (callHeaders.get("content-type") ? callHeaders.get("content-type") : userHeaders?.get("Content-Type") ? userHeaders.get("Content-Type") : void 0) ?? DEFAULT_CONTENT_TYPE;
|
|
1193
1194
|
const baseHeaders = {
|
|
1194
1195
|
[WORKFLOW_INIT_HEADER]: initHeaderValue,
|
|
1195
1196
|
[WORKFLOW_ID_HEADER]: workflowRunId,
|
|
@@ -1486,7 +1487,7 @@ var invokeWorkflow = async ({
|
|
|
1486
1487
|
headers: Object.fromEntries(
|
|
1487
1488
|
Object.entries(invokerHeaders).map((pairs) => [pairs[0], [pairs[1]]])
|
|
1488
1489
|
),
|
|
1489
|
-
workflowRunId,
|
|
1490
|
+
workflowRunId: context.workflowRunId,
|
|
1490
1491
|
workflowUrl: context.url,
|
|
1491
1492
|
step: invokeStep
|
|
1492
1493
|
};
|
|
@@ -1780,7 +1781,7 @@ var AutoExecutor = class _AutoExecutor {
|
|
|
1780
1781
|
});
|
|
1781
1782
|
throw new WorkflowAbort(invokeStep.stepName, invokeStep);
|
|
1782
1783
|
}
|
|
1783
|
-
const result = await this.context.qstashClient.
|
|
1784
|
+
const result = await this.context.qstashClient.batch(
|
|
1784
1785
|
steps.map((singleStep, index) => {
|
|
1785
1786
|
const lazyStep = lazySteps[index];
|
|
1786
1787
|
const { headers } = getHeaders({
|
|
@@ -1810,7 +1811,7 @@ var AutoExecutor = class _AutoExecutor {
|
|
|
1810
1811
|
{
|
|
1811
1812
|
headers,
|
|
1812
1813
|
method: singleStep.callMethod,
|
|
1813
|
-
body: singleStep.callBody,
|
|
1814
|
+
body: JSON.stringify(singleStep.callBody),
|
|
1814
1815
|
url: singleStep.callUrl
|
|
1815
1816
|
}
|
|
1816
1817
|
) : (
|
|
@@ -1820,7 +1821,7 @@ var AutoExecutor = class _AutoExecutor {
|
|
|
1820
1821
|
{
|
|
1821
1822
|
headers,
|
|
1822
1823
|
method: "POST",
|
|
1823
|
-
body: singleStep,
|
|
1824
|
+
body: JSON.stringify(singleStep),
|
|
1824
1825
|
url: this.context.url,
|
|
1825
1826
|
notBefore: willWait ? singleStep.sleepUntil : void 0,
|
|
1826
1827
|
delay: willWait ? singleStep.sleepFor : void 0
|
|
@@ -1828,8 +1829,9 @@ var AutoExecutor = class _AutoExecutor {
|
|
|
1828
1829
|
);
|
|
1829
1830
|
})
|
|
1830
1831
|
);
|
|
1832
|
+
const _result = result;
|
|
1831
1833
|
await this.debug?.log("INFO", "SUBMIT_STEP", {
|
|
1832
|
-
messageIds:
|
|
1834
|
+
messageIds: _result.map((message) => {
|
|
1833
1835
|
return {
|
|
1834
1836
|
message: message.messageId
|
|
1835
1837
|
};
|
package/svelte.mjs
CHANGED
|
@@ -1014,6 +1014,7 @@ declare class WorkflowContext<TInitialPayload = unknown> {
|
|
|
1014
1014
|
* Neeeded to resolve import issues
|
|
1015
1015
|
*/
|
|
1016
1016
|
type WorkflowClient = {
|
|
1017
|
+
batch: InstanceType<typeof Client>["batch"];
|
|
1017
1018
|
batchJSON: InstanceType<typeof Client>["batchJSON"];
|
|
1018
1019
|
publishJSON: InstanceType<typeof Client>["publishJSON"];
|
|
1019
1020
|
publish: InstanceType<typeof Client>["publish"];
|
|
@@ -1014,6 +1014,7 @@ declare class WorkflowContext<TInitialPayload = unknown> {
|
|
|
1014
1014
|
* Neeeded to resolve import issues
|
|
1015
1015
|
*/
|
|
1016
1016
|
type WorkflowClient = {
|
|
1017
|
+
batch: InstanceType<typeof Client>["batch"];
|
|
1017
1018
|
batchJSON: InstanceType<typeof Client>["batchJSON"];
|
|
1018
1019
|
publishJSON: InstanceType<typeof Client>["publishJSON"];
|
|
1019
1020
|
publish: InstanceType<typeof Client>["publish"];
|