@upstash/workflow 0.1.0 → 0.1.1-canary
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/{chunk-JDMP6KKR.mjs → chunk-YW5KUHA2.mjs} +34 -20
- package/cloudflare.d.mts +4 -2
- package/cloudflare.d.ts +4 -2
- package/cloudflare.js +37 -23
- package/cloudflare.mjs +4 -4
- package/h3.d.mts +7 -5
- package/h3.d.ts +7 -5
- package/h3.js +36 -22
- package/h3.mjs +3 -3
- package/hono.d.mts +1 -1
- package/hono.d.ts +1 -1
- package/hono.js +35 -21
- package/hono.mjs +2 -2
- package/index.d.mts +5 -3
- package/index.d.ts +5 -3
- package/index.js +34 -20
- package/index.mjs +1 -1
- package/nextjs.d.mts +7 -4
- package/nextjs.d.ts +7 -4
- package/nextjs.js +44 -28
- package/nextjs.mjs +11 -9
- package/package.json +1 -99
- package/solidjs.d.mts +4 -2
- package/solidjs.d.ts +4 -2
- package/solidjs.js +36 -22
- package/solidjs.mjs +3 -3
- package/svelte.d.mts +4 -2
- package/svelte.d.ts +4 -2
- package/svelte.js +37 -23
- package/svelte.mjs +4 -4
- package/{types-CfN1Epuj.d.mts → types-D8FBKkto.d.mts} +12 -2
- package/{types-CfN1Epuj.d.ts → types-D8FBKkto.d.ts} +12 -2
package/solidjs.js
CHANGED
|
@@ -474,6 +474,7 @@ var WORKFLOW_ID_HEADER = "Upstash-Workflow-RunId";
|
|
|
474
474
|
var WORKFLOW_INIT_HEADER = "Upstash-Workflow-Init";
|
|
475
475
|
var WORKFLOW_URL_HEADER = "Upstash-Workflow-Url";
|
|
476
476
|
var WORKFLOW_FAILURE_HEADER = "Upstash-Workflow-Is-Failure";
|
|
477
|
+
var WORKFLOW_FEATURE_HEADER = "Upstash-Feature-Set";
|
|
477
478
|
var WORKFLOW_PROTOCOL_VERSION = "1";
|
|
478
479
|
var WORKFLOW_PROTOCOL_VERSION_HEADER = "Upstash-Workflow-Sdk-Version";
|
|
479
480
|
var DEFAULT_CONTENT_TYPE = "application/json";
|
|
@@ -559,13 +560,13 @@ var handleThirdPartyCallResult = async (request, requestPayload, client, workflo
|
|
|
559
560
|
try {
|
|
560
561
|
if (request.headers.get("Upstash-Workflow-Callback")) {
|
|
561
562
|
const callbackMessage = JSON.parse(requestPayload);
|
|
562
|
-
if (!(callbackMessage.status >= 200 && callbackMessage.status < 300)) {
|
|
563
|
+
if (!(callbackMessage.status >= 200 && callbackMessage.status < 300) && callbackMessage.maxRetries && callbackMessage.retried !== callbackMessage.maxRetries) {
|
|
563
564
|
await debug?.log("WARN", "SUBMIT_THIRD_PARTY_RESULT", {
|
|
564
565
|
status: callbackMessage.status,
|
|
565
566
|
body: atob(callbackMessage.body)
|
|
566
567
|
});
|
|
567
568
|
console.warn(
|
|
568
|
-
`Workflow Warning: "context.call" failed with status ${callbackMessage.status} and will retry (
|
|
569
|
+
`Workflow Warning: "context.call" failed with status ${callbackMessage.status} and will retry (retried ${callbackMessage.retried ?? 0} out of ${callbackMessage.maxRetries} times). Error Message:
|
|
569
570
|
${atob(callbackMessage.body)}`
|
|
570
571
|
);
|
|
571
572
|
return ok("call-will-retry");
|
|
@@ -602,7 +603,11 @@ ${atob(callbackMessage.body)}`
|
|
|
602
603
|
stepId: Number(stepIdString),
|
|
603
604
|
stepName,
|
|
604
605
|
stepType,
|
|
605
|
-
out:
|
|
606
|
+
out: {
|
|
607
|
+
status: callbackMessage.status,
|
|
608
|
+
body: atob(callbackMessage.body),
|
|
609
|
+
header: callbackMessage.header
|
|
610
|
+
},
|
|
606
611
|
concurrent: Number(concurrentString)
|
|
607
612
|
};
|
|
608
613
|
await debug?.log("SUBMIT", "SUBMIT_THIRD_PARTY_RESULT", {
|
|
@@ -637,15 +642,24 @@ var getHeaders = (initHeaderValue, workflowRunId, workflowUrl, userHeaders, step
|
|
|
637
642
|
[WORKFLOW_INIT_HEADER]: initHeaderValue,
|
|
638
643
|
[WORKFLOW_ID_HEADER]: workflowRunId,
|
|
639
644
|
[WORKFLOW_URL_HEADER]: workflowUrl,
|
|
640
|
-
[
|
|
641
|
-
|
|
642
|
-
[`Upstash-Failure-Callback-Forward-${WORKFLOW_FAILURE_HEADER}`]: "true",
|
|
643
|
-
"Upstash-Failure-Callback": failureUrl
|
|
644
|
-
} : {},
|
|
645
|
-
...retries === void 0 ? {} : {
|
|
646
|
-
"Upstash-Retries": retries.toString()
|
|
647
|
-
}
|
|
645
|
+
[WORKFLOW_FEATURE_HEADER]: "WF_NoDelete",
|
|
646
|
+
[`Upstash-Forward-${WORKFLOW_PROTOCOL_VERSION_HEADER}`]: WORKFLOW_PROTOCOL_VERSION
|
|
648
647
|
};
|
|
648
|
+
if (failureUrl) {
|
|
649
|
+
if (!step?.callUrl) {
|
|
650
|
+
baseHeaders[`Upstash-Failure-Callback-Forward-${WORKFLOW_FAILURE_HEADER}`] = "true";
|
|
651
|
+
}
|
|
652
|
+
baseHeaders["Upstash-Failure-Callback"] = failureUrl;
|
|
653
|
+
}
|
|
654
|
+
if (step?.callUrl) {
|
|
655
|
+
baseHeaders["Upstash-Retries"] = "0";
|
|
656
|
+
if (retries) {
|
|
657
|
+
baseHeaders["Upstash-Callback-Retries"] = retries.toString();
|
|
658
|
+
baseHeaders["Upstash-Failure-Callback-Retries"] = retries.toString();
|
|
659
|
+
}
|
|
660
|
+
} else if (retries !== void 0) {
|
|
661
|
+
baseHeaders["Upstash-Retries"] = retries.toString();
|
|
662
|
+
}
|
|
649
663
|
if (userHeaders) {
|
|
650
664
|
for (const header of userHeaders.keys()) {
|
|
651
665
|
if (step?.callHeaders) {
|
|
@@ -1504,15 +1518,12 @@ var WorkflowContext = class {
|
|
|
1504
1518
|
* @returns call result (parsed as JSON if possible)
|
|
1505
1519
|
*/
|
|
1506
1520
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-parameters
|
|
1507
|
-
async call(stepName,
|
|
1521
|
+
async call(stepName, callSettings) {
|
|
1522
|
+
const { url, method = "GET", body, headers = {} } = callSettings;
|
|
1508
1523
|
const result = await this.addStep(
|
|
1509
|
-
new LazyCallStep(stepName, url, method, body, headers
|
|
1524
|
+
new LazyCallStep(stepName, url, method, body, headers)
|
|
1510
1525
|
);
|
|
1511
|
-
|
|
1512
|
-
return JSON.parse(result);
|
|
1513
|
-
} catch {
|
|
1514
|
-
return result;
|
|
1515
|
-
}
|
|
1526
|
+
return result;
|
|
1516
1527
|
}
|
|
1517
1528
|
async waitForEvent(stepName, eventId, timeout) {
|
|
1518
1529
|
const result = await this.addStep(
|
|
@@ -1880,6 +1891,7 @@ var serve = (routeFunction, options) => {
|
|
|
1880
1891
|
} = processOptions(options);
|
|
1881
1892
|
const debug = WorkflowLogger.getLogger(verbose);
|
|
1882
1893
|
const handler = async (request) => {
|
|
1894
|
+
await debug?.log("INFO", "ENDPOINT_START");
|
|
1883
1895
|
const { workflowUrl, workflowFailureUrl } = await determineUrls(
|
|
1884
1896
|
request,
|
|
1885
1897
|
url,
|
|
@@ -1923,7 +1935,8 @@ var serve = (routeFunction, options) => {
|
|
|
1923
1935
|
url: workflowUrl,
|
|
1924
1936
|
failureUrl: workflowFailureUrl,
|
|
1925
1937
|
debug,
|
|
1926
|
-
env
|
|
1938
|
+
env,
|
|
1939
|
+
retries
|
|
1927
1940
|
});
|
|
1928
1941
|
const authCheck = await DisabledWorkflowContext.tryAuthentication(
|
|
1929
1942
|
routeFunction,
|
|
@@ -1966,7 +1979,7 @@ var serve = (routeFunction, options) => {
|
|
|
1966
1979
|
await debug?.log("INFO", "RESPONSE_DEFAULT");
|
|
1967
1980
|
return onStepFinish("no-workflow-id", "fromCallback");
|
|
1968
1981
|
};
|
|
1969
|
-
|
|
1982
|
+
const safeHandler = async (request) => {
|
|
1970
1983
|
try {
|
|
1971
1984
|
return await handler(request);
|
|
1972
1985
|
} catch (error) {
|
|
@@ -1976,6 +1989,7 @@ var serve = (routeFunction, options) => {
|
|
|
1976
1989
|
});
|
|
1977
1990
|
}
|
|
1978
1991
|
};
|
|
1992
|
+
return { handler: safeHandler };
|
|
1979
1993
|
};
|
|
1980
1994
|
|
|
1981
1995
|
// src/client/index.ts
|
|
@@ -1990,10 +2004,10 @@ var serve2 = (routeFunction, options) => {
|
|
|
1990
2004
|
status: 405
|
|
1991
2005
|
});
|
|
1992
2006
|
}
|
|
1993
|
-
const serveHandler = serve(routeFunction, options);
|
|
2007
|
+
const { handler: serveHandler } = serve(routeFunction, options);
|
|
1994
2008
|
return await serveHandler(event.request);
|
|
1995
2009
|
};
|
|
1996
|
-
return handler;
|
|
2010
|
+
return { POST: handler };
|
|
1997
2011
|
};
|
|
1998
2012
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1999
2013
|
0 && (module.exports = {
|
package/solidjs.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
serve
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-YW5KUHA2.mjs";
|
|
4
4
|
|
|
5
5
|
// platforms/solidjs.ts
|
|
6
6
|
var serve2 = (routeFunction, options) => {
|
|
@@ -11,10 +11,10 @@ var serve2 = (routeFunction, options) => {
|
|
|
11
11
|
status: 405
|
|
12
12
|
});
|
|
13
13
|
}
|
|
14
|
-
const serveHandler = serve(routeFunction, options);
|
|
14
|
+
const { handler: serveHandler } = serve(routeFunction, options);
|
|
15
15
|
return await serveHandler(event.request);
|
|
16
16
|
};
|
|
17
|
-
return handler;
|
|
17
|
+
return { POST: handler };
|
|
18
18
|
};
|
|
19
19
|
export {
|
|
20
20
|
serve2 as serve
|
package/svelte.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { RequestHandler } from '@sveltejs/kit';
|
|
2
|
-
import { R as RouteFunction, W as WorkflowServeOptions } from './types-
|
|
2
|
+
import { R as RouteFunction, W as WorkflowServeOptions } from './types-D8FBKkto.mjs';
|
|
3
3
|
import '@upstash/qstash';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -13,6 +13,8 @@ import '@upstash/qstash';
|
|
|
13
13
|
*/
|
|
14
14
|
declare const serve: <TInitialPayload = unknown>(routeFunction: RouteFunction<TInitialPayload>, options: Omit<WorkflowServeOptions<Response, TInitialPayload>, "onStepFinish"> & {
|
|
15
15
|
env: WorkflowServeOptions["env"];
|
|
16
|
-
}) =>
|
|
16
|
+
}) => {
|
|
17
|
+
POST: RequestHandler;
|
|
18
|
+
};
|
|
17
19
|
|
|
18
20
|
export { serve };
|
package/svelte.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { RequestHandler } from '@sveltejs/kit';
|
|
2
|
-
import { R as RouteFunction, W as WorkflowServeOptions } from './types-
|
|
2
|
+
import { R as RouteFunction, W as WorkflowServeOptions } from './types-D8FBKkto.js';
|
|
3
3
|
import '@upstash/qstash';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -13,6 +13,8 @@ import '@upstash/qstash';
|
|
|
13
13
|
*/
|
|
14
14
|
declare const serve: <TInitialPayload = unknown>(routeFunction: RouteFunction<TInitialPayload>, options: Omit<WorkflowServeOptions<Response, TInitialPayload>, "onStepFinish"> & {
|
|
15
15
|
env: WorkflowServeOptions["env"];
|
|
16
|
-
}) =>
|
|
16
|
+
}) => {
|
|
17
|
+
POST: RequestHandler;
|
|
18
|
+
};
|
|
17
19
|
|
|
18
20
|
export { serve };
|
package/svelte.js
CHANGED
|
@@ -474,6 +474,7 @@ var WORKFLOW_ID_HEADER = "Upstash-Workflow-RunId";
|
|
|
474
474
|
var WORKFLOW_INIT_HEADER = "Upstash-Workflow-Init";
|
|
475
475
|
var WORKFLOW_URL_HEADER = "Upstash-Workflow-Url";
|
|
476
476
|
var WORKFLOW_FAILURE_HEADER = "Upstash-Workflow-Is-Failure";
|
|
477
|
+
var WORKFLOW_FEATURE_HEADER = "Upstash-Feature-Set";
|
|
477
478
|
var WORKFLOW_PROTOCOL_VERSION = "1";
|
|
478
479
|
var WORKFLOW_PROTOCOL_VERSION_HEADER = "Upstash-Workflow-Sdk-Version";
|
|
479
480
|
var DEFAULT_CONTENT_TYPE = "application/json";
|
|
@@ -559,13 +560,13 @@ var handleThirdPartyCallResult = async (request, requestPayload, client, workflo
|
|
|
559
560
|
try {
|
|
560
561
|
if (request.headers.get("Upstash-Workflow-Callback")) {
|
|
561
562
|
const callbackMessage = JSON.parse(requestPayload);
|
|
562
|
-
if (!(callbackMessage.status >= 200 && callbackMessage.status < 300)) {
|
|
563
|
+
if (!(callbackMessage.status >= 200 && callbackMessage.status < 300) && callbackMessage.maxRetries && callbackMessage.retried !== callbackMessage.maxRetries) {
|
|
563
564
|
await debug?.log("WARN", "SUBMIT_THIRD_PARTY_RESULT", {
|
|
564
565
|
status: callbackMessage.status,
|
|
565
566
|
body: atob(callbackMessage.body)
|
|
566
567
|
});
|
|
567
568
|
console.warn(
|
|
568
|
-
`Workflow Warning: "context.call" failed with status ${callbackMessage.status} and will retry (
|
|
569
|
+
`Workflow Warning: "context.call" failed with status ${callbackMessage.status} and will retry (retried ${callbackMessage.retried ?? 0} out of ${callbackMessage.maxRetries} times). Error Message:
|
|
569
570
|
${atob(callbackMessage.body)}`
|
|
570
571
|
);
|
|
571
572
|
return ok("call-will-retry");
|
|
@@ -602,7 +603,11 @@ ${atob(callbackMessage.body)}`
|
|
|
602
603
|
stepId: Number(stepIdString),
|
|
603
604
|
stepName,
|
|
604
605
|
stepType,
|
|
605
|
-
out:
|
|
606
|
+
out: {
|
|
607
|
+
status: callbackMessage.status,
|
|
608
|
+
body: atob(callbackMessage.body),
|
|
609
|
+
header: callbackMessage.header
|
|
610
|
+
},
|
|
606
611
|
concurrent: Number(concurrentString)
|
|
607
612
|
};
|
|
608
613
|
await debug?.log("SUBMIT", "SUBMIT_THIRD_PARTY_RESULT", {
|
|
@@ -637,15 +642,24 @@ var getHeaders = (initHeaderValue, workflowRunId, workflowUrl, userHeaders, step
|
|
|
637
642
|
[WORKFLOW_INIT_HEADER]: initHeaderValue,
|
|
638
643
|
[WORKFLOW_ID_HEADER]: workflowRunId,
|
|
639
644
|
[WORKFLOW_URL_HEADER]: workflowUrl,
|
|
640
|
-
[
|
|
641
|
-
|
|
642
|
-
[`Upstash-Failure-Callback-Forward-${WORKFLOW_FAILURE_HEADER}`]: "true",
|
|
643
|
-
"Upstash-Failure-Callback": failureUrl
|
|
644
|
-
} : {},
|
|
645
|
-
...retries === void 0 ? {} : {
|
|
646
|
-
"Upstash-Retries": retries.toString()
|
|
647
|
-
}
|
|
645
|
+
[WORKFLOW_FEATURE_HEADER]: "WF_NoDelete",
|
|
646
|
+
[`Upstash-Forward-${WORKFLOW_PROTOCOL_VERSION_HEADER}`]: WORKFLOW_PROTOCOL_VERSION
|
|
648
647
|
};
|
|
648
|
+
if (failureUrl) {
|
|
649
|
+
if (!step?.callUrl) {
|
|
650
|
+
baseHeaders[`Upstash-Failure-Callback-Forward-${WORKFLOW_FAILURE_HEADER}`] = "true";
|
|
651
|
+
}
|
|
652
|
+
baseHeaders["Upstash-Failure-Callback"] = failureUrl;
|
|
653
|
+
}
|
|
654
|
+
if (step?.callUrl) {
|
|
655
|
+
baseHeaders["Upstash-Retries"] = "0";
|
|
656
|
+
if (retries) {
|
|
657
|
+
baseHeaders["Upstash-Callback-Retries"] = retries.toString();
|
|
658
|
+
baseHeaders["Upstash-Failure-Callback-Retries"] = retries.toString();
|
|
659
|
+
}
|
|
660
|
+
} else if (retries !== void 0) {
|
|
661
|
+
baseHeaders["Upstash-Retries"] = retries.toString();
|
|
662
|
+
}
|
|
649
663
|
if (userHeaders) {
|
|
650
664
|
for (const header of userHeaders.keys()) {
|
|
651
665
|
if (step?.callHeaders) {
|
|
@@ -1504,15 +1518,12 @@ var WorkflowContext = class {
|
|
|
1504
1518
|
* @returns call result (parsed as JSON if possible)
|
|
1505
1519
|
*/
|
|
1506
1520
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-parameters
|
|
1507
|
-
async call(stepName,
|
|
1521
|
+
async call(stepName, callSettings) {
|
|
1522
|
+
const { url, method = "GET", body, headers = {} } = callSettings;
|
|
1508
1523
|
const result = await this.addStep(
|
|
1509
|
-
new LazyCallStep(stepName, url, method, body, headers
|
|
1524
|
+
new LazyCallStep(stepName, url, method, body, headers)
|
|
1510
1525
|
);
|
|
1511
|
-
|
|
1512
|
-
return JSON.parse(result);
|
|
1513
|
-
} catch {
|
|
1514
|
-
return result;
|
|
1515
|
-
}
|
|
1526
|
+
return result;
|
|
1516
1527
|
}
|
|
1517
1528
|
async waitForEvent(stepName, eventId, timeout) {
|
|
1518
1529
|
const result = await this.addStep(
|
|
@@ -1880,6 +1891,7 @@ var serve = (routeFunction, options) => {
|
|
|
1880
1891
|
} = processOptions(options);
|
|
1881
1892
|
const debug = WorkflowLogger.getLogger(verbose);
|
|
1882
1893
|
const handler = async (request) => {
|
|
1894
|
+
await debug?.log("INFO", "ENDPOINT_START");
|
|
1883
1895
|
const { workflowUrl, workflowFailureUrl } = await determineUrls(
|
|
1884
1896
|
request,
|
|
1885
1897
|
url,
|
|
@@ -1923,7 +1935,8 @@ var serve = (routeFunction, options) => {
|
|
|
1923
1935
|
url: workflowUrl,
|
|
1924
1936
|
failureUrl: workflowFailureUrl,
|
|
1925
1937
|
debug,
|
|
1926
|
-
env
|
|
1938
|
+
env,
|
|
1939
|
+
retries
|
|
1927
1940
|
});
|
|
1928
1941
|
const authCheck = await DisabledWorkflowContext.tryAuthentication(
|
|
1929
1942
|
routeFunction,
|
|
@@ -1966,7 +1979,7 @@ var serve = (routeFunction, options) => {
|
|
|
1966
1979
|
await debug?.log("INFO", "RESPONSE_DEFAULT");
|
|
1967
1980
|
return onStepFinish("no-workflow-id", "fromCallback");
|
|
1968
1981
|
};
|
|
1969
|
-
|
|
1982
|
+
const safeHandler = async (request) => {
|
|
1970
1983
|
try {
|
|
1971
1984
|
return await handler(request);
|
|
1972
1985
|
} catch (error) {
|
|
@@ -1976,6 +1989,7 @@ var serve = (routeFunction, options) => {
|
|
|
1976
1989
|
});
|
|
1977
1990
|
}
|
|
1978
1991
|
};
|
|
1992
|
+
return { handler: safeHandler };
|
|
1979
1993
|
};
|
|
1980
1994
|
|
|
1981
1995
|
// src/client/index.ts
|
|
@@ -1984,10 +1998,10 @@ var import_qstash5 = require("@upstash/qstash");
|
|
|
1984
1998
|
// platforms/svelte.ts
|
|
1985
1999
|
var serve2 = (routeFunction, options) => {
|
|
1986
2000
|
const handler = async ({ request }) => {
|
|
1987
|
-
const
|
|
1988
|
-
return await
|
|
2001
|
+
const { handler: serveHandler } = serve(routeFunction, options);
|
|
2002
|
+
return await serveHandler(request);
|
|
1989
2003
|
};
|
|
1990
|
-
return handler;
|
|
2004
|
+
return { POST: handler };
|
|
1991
2005
|
};
|
|
1992
2006
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1993
2007
|
0 && (module.exports = {
|
package/svelte.mjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
serve
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-YW5KUHA2.mjs";
|
|
4
4
|
|
|
5
5
|
// platforms/svelte.ts
|
|
6
6
|
var serve2 = (routeFunction, options) => {
|
|
7
7
|
const handler = async ({ request }) => {
|
|
8
|
-
const
|
|
9
|
-
return await
|
|
8
|
+
const { handler: serveHandler } = serve(routeFunction, options);
|
|
9
|
+
return await serveHandler(request);
|
|
10
10
|
};
|
|
11
|
-
return handler;
|
|
11
|
+
return { POST: handler };
|
|
12
12
|
};
|
|
13
13
|
export {
|
|
14
14
|
serve2 as serve
|
|
@@ -374,7 +374,12 @@ declare class WorkflowContext<TInitialPayload = unknown> {
|
|
|
374
374
|
* @param headers call headers
|
|
375
375
|
* @returns call result (parsed as JSON if possible)
|
|
376
376
|
*/
|
|
377
|
-
call
|
|
377
|
+
call(stepName: string, callSettings: {
|
|
378
|
+
url: string;
|
|
379
|
+
method?: HTTPMethods;
|
|
380
|
+
body?: unknown;
|
|
381
|
+
headers?: Record<string, string>;
|
|
382
|
+
}): Promise<CallResponse>;
|
|
378
383
|
waitForEvent(stepName: string, eventId: string, timeout: string | number): Promise<WaitStepResponse>;
|
|
379
384
|
/**
|
|
380
385
|
* Adds steps to the executor. Needed so that it can be overwritten in
|
|
@@ -612,5 +617,10 @@ type WaitStepResponse = {
|
|
|
612
617
|
timeout: boolean;
|
|
613
618
|
notifyBody: unknown;
|
|
614
619
|
};
|
|
620
|
+
type CallResponse = {
|
|
621
|
+
status: number;
|
|
622
|
+
body: unknown;
|
|
623
|
+
header: Record<string, string[]>;
|
|
624
|
+
};
|
|
615
625
|
|
|
616
|
-
export { type AsyncStepFunction as A, type FinishCondition as F, type LogLevel as L, type NotifyResponse as N, type ParallelCallState as P, type RouteFunction as R, type Step as S, type WorkflowServeOptions as W, WorkflowContext as a, type WorkflowClient as b, type WorkflowReceiver as c, StepTypes as d, type StepType as e, type RawStep as f, type SyncStepFunction as g, type StepFunction as h, type FailureFunctionPayload as i, type RequiredExceptFields as j, type WaitResult as k, type Waiter as l, type WaitRequest as m, type WaitStepResponse as n, type WorkflowLoggerOptions as o, WorkflowLogger as p };
|
|
626
|
+
export { type AsyncStepFunction as A, type CallResponse as C, type FinishCondition as F, type LogLevel as L, type NotifyResponse as N, type ParallelCallState as P, type RouteFunction as R, type Step as S, type WorkflowServeOptions as W, WorkflowContext as a, type WorkflowClient as b, type WorkflowReceiver as c, StepTypes as d, type StepType as e, type RawStep as f, type SyncStepFunction as g, type StepFunction as h, type FailureFunctionPayload as i, type RequiredExceptFields as j, type WaitResult as k, type Waiter as l, type WaitRequest as m, type WaitStepResponse as n, type WorkflowLoggerOptions as o, WorkflowLogger as p };
|
|
@@ -374,7 +374,12 @@ declare class WorkflowContext<TInitialPayload = unknown> {
|
|
|
374
374
|
* @param headers call headers
|
|
375
375
|
* @returns call result (parsed as JSON if possible)
|
|
376
376
|
*/
|
|
377
|
-
call
|
|
377
|
+
call(stepName: string, callSettings: {
|
|
378
|
+
url: string;
|
|
379
|
+
method?: HTTPMethods;
|
|
380
|
+
body?: unknown;
|
|
381
|
+
headers?: Record<string, string>;
|
|
382
|
+
}): Promise<CallResponse>;
|
|
378
383
|
waitForEvent(stepName: string, eventId: string, timeout: string | number): Promise<WaitStepResponse>;
|
|
379
384
|
/**
|
|
380
385
|
* Adds steps to the executor. Needed so that it can be overwritten in
|
|
@@ -612,5 +617,10 @@ type WaitStepResponse = {
|
|
|
612
617
|
timeout: boolean;
|
|
613
618
|
notifyBody: unknown;
|
|
614
619
|
};
|
|
620
|
+
type CallResponse = {
|
|
621
|
+
status: number;
|
|
622
|
+
body: unknown;
|
|
623
|
+
header: Record<string, string[]>;
|
|
624
|
+
};
|
|
615
625
|
|
|
616
|
-
export { type AsyncStepFunction as A, type FinishCondition as F, type LogLevel as L, type NotifyResponse as N, type ParallelCallState as P, type RouteFunction as R, type Step as S, type WorkflowServeOptions as W, WorkflowContext as a, type WorkflowClient as b, type WorkflowReceiver as c, StepTypes as d, type StepType as e, type RawStep as f, type SyncStepFunction as g, type StepFunction as h, type FailureFunctionPayload as i, type RequiredExceptFields as j, type WaitResult as k, type Waiter as l, type WaitRequest as m, type WaitStepResponse as n, type WorkflowLoggerOptions as o, WorkflowLogger as p };
|
|
626
|
+
export { type AsyncStepFunction as A, type CallResponse as C, type FinishCondition as F, type LogLevel as L, type NotifyResponse as N, type ParallelCallState as P, type RouteFunction as R, type Step as S, type WorkflowServeOptions as W, WorkflowContext as a, type WorkflowClient as b, type WorkflowReceiver as c, StepTypes as d, type StepType as e, type RawStep as f, type SyncStepFunction as g, type StepFunction as h, type FailureFunctionPayload as i, type RequiredExceptFields as j, type WaitResult as k, type Waiter as l, type WaitRequest as m, type WaitStepResponse as n, type WorkflowLoggerOptions as o, WorkflowLogger as p };
|