@upstash/qstash 2.7.6 → 2.7.8
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/README.md +1 -2
- package/{chunk-NMSGEGBP.js → chunk-5OXFLS25.js} +3 -3
- package/{chunk-IJ3475FO.mjs → chunk-HS75QP5Z.mjs} +1 -1
- package/{chunk-B3NB4QLV.mjs → chunk-SFN2PBFB.mjs} +58 -28
- package/{chunk-WQZ4U6LJ.js → chunk-XY54CU56.js} +59 -29
- package/{client-aUVEwn93.d.mts → client-BsCzCprQ.d.mts} +12 -1
- package/{client-aUVEwn93.d.ts → client-BsCzCprQ.d.ts} +12 -1
- package/cloudflare.d.mts +1 -1
- package/cloudflare.d.ts +1 -1
- package/cloudflare.js +2 -2
- package/cloudflare.mjs +1 -1
- package/h3.d.mts +1 -1
- package/h3.d.ts +1 -1
- package/h3.js +4 -4
- package/h3.mjs +3 -3
- package/hono.d.mts +1 -1
- package/hono.d.ts +1 -1
- package/hono.js +2 -2
- package/hono.mjs +1 -1
- package/index.d.mts +16 -3
- package/index.d.ts +16 -3
- package/index.js +5 -3
- package/index.mjs +4 -2
- package/nextjs.d.mts +1 -1
- package/nextjs.d.ts +1 -1
- package/nextjs.js +6 -6
- package/nextjs.mjs +1 -1
- package/nuxt.js +4 -4
- package/nuxt.mjs +3 -3
- package/package.json +1 -1
- package/solidjs.d.mts +1 -1
- package/solidjs.d.ts +1 -1
- package/solidjs.js +4 -4
- package/solidjs.mjs +2 -2
- package/svelte.d.mts +1 -1
- package/svelte.d.ts +1 -1
- package/svelte.js +4 -4
- package/svelte.mjs +2 -2
- package/workflow.d.mts +1 -1
- package/workflow.d.ts +1 -1
- package/workflow.js +2 -2
- package/workflow.mjs +1 -1
- /package/{chunk-S7JMIMW4.mjs → chunk-CIVGPRQN.mjs} +0 -0
- /package/{chunk-IJ5AEYLN.js → chunk-VN7YQ2UN.js} +0 -0
package/README.md
CHANGED
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|

|
|
4
4
|
|
|
5
|
-
> [!NOTE]
|
|
6
|
-
> **This project is in GA Stage.**
|
|
5
|
+
> [!NOTE] > **This project is in GA Stage.**
|
|
7
6
|
> The Upstash Professional Support fully covers this project. It receives regular updates, and bug fixes.
|
|
8
7
|
> The Upstash team is committed to maintaining and improving its functionality.
|
|
9
8
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkXY54CU56js = require('./chunk-XY54CU56.js');
|
|
5
5
|
|
|
6
6
|
// node_modules/defu/dist/defu.mjs
|
|
7
7
|
function isPlainObject(value) {
|
|
@@ -340,7 +340,7 @@ var verifySignatureH3 = (handler, config) => {
|
|
|
340
340
|
"nextSigningKey is required, either in the config or as env variable QSTASH_NEXT_SIGNING_KEY"
|
|
341
341
|
);
|
|
342
342
|
}
|
|
343
|
-
const receiver = new (0,
|
|
343
|
+
const receiver = new (0, _chunkXY54CU56js.Receiver)({
|
|
344
344
|
currentSigningKey,
|
|
345
345
|
nextSigningKey
|
|
346
346
|
});
|
|
@@ -391,7 +391,7 @@ var serve2 = (routeFunction, options) => {
|
|
|
391
391
|
body: await readRawBody(event),
|
|
392
392
|
method: "POST"
|
|
393
393
|
});
|
|
394
|
-
const serveHandler =
|
|
394
|
+
const serveHandler = _chunkXY54CU56js.serve.call(void 0, routeFunction, options);
|
|
395
395
|
return await serveHandler(request);
|
|
396
396
|
});
|
|
397
397
|
return handler;
|
|
@@ -670,6 +670,18 @@ var NANOID_LENGTH = 21;
|
|
|
670
670
|
function nanoid() {
|
|
671
671
|
return [...crypto.getRandomValues(new Uint8Array(NANOID_LENGTH))].map((x) => NANOID_CHARS[x % NANOID_CHARS.length]).join("");
|
|
672
672
|
}
|
|
673
|
+
function decodeBase64(base64) {
|
|
674
|
+
try {
|
|
675
|
+
const binString = atob(base64);
|
|
676
|
+
const intArray = Uint8Array.from(binString, (m) => m.codePointAt(0));
|
|
677
|
+
return new TextDecoder().decode(intArray);
|
|
678
|
+
} catch (error) {
|
|
679
|
+
console.warn(
|
|
680
|
+
`Upstash Qstash: Failed while decoding base64 "${base64}". Decoding with atob and returning it instead. Error: ${error}`
|
|
681
|
+
);
|
|
682
|
+
return atob(base64);
|
|
683
|
+
}
|
|
684
|
+
}
|
|
673
685
|
|
|
674
686
|
// src/client/queue.ts
|
|
675
687
|
var Queue = class {
|
|
@@ -1159,6 +1171,17 @@ var Client = class {
|
|
|
1159
1171
|
}
|
|
1160
1172
|
};
|
|
1161
1173
|
|
|
1174
|
+
// src/client/workflow/constants.ts
|
|
1175
|
+
var WORKFLOW_ID_HEADER = "Upstash-Workflow-RunId";
|
|
1176
|
+
var WORKFLOW_INIT_HEADER = "Upstash-Workflow-Init";
|
|
1177
|
+
var WORKFLOW_URL_HEADER = "Upstash-Workflow-Url";
|
|
1178
|
+
var WORKFLOW_FAILURE_HEADER = "Upstash-Workflow-Is-Failure";
|
|
1179
|
+
var WORKFLOW_PROTOCOL_VERSION = "1";
|
|
1180
|
+
var WORKFLOW_PROTOCOL_VERSION_HEADER = "Upstash-Workflow-Sdk-Version";
|
|
1181
|
+
var DEFAULT_CONTENT_TYPE = "application/json";
|
|
1182
|
+
var NO_CONCURRENCY = 1;
|
|
1183
|
+
var DEFAULT_RETRIES = 3;
|
|
1184
|
+
|
|
1162
1185
|
// node_modules/neverthrow/dist/index.es.js
|
|
1163
1186
|
var defaultErrorConfig = {
|
|
1164
1187
|
withStackTrace: false
|
|
@@ -1531,28 +1554,19 @@ var Err = class {
|
|
|
1531
1554
|
};
|
|
1532
1555
|
var fromThrowable = Result.fromThrowable;
|
|
1533
1556
|
|
|
1534
|
-
// src/client/workflow/constants.ts
|
|
1535
|
-
var WORKFLOW_ID_HEADER = "Upstash-Workflow-RunId";
|
|
1536
|
-
var WORKFLOW_INIT_HEADER = "Upstash-Workflow-Init";
|
|
1537
|
-
var WORKFLOW_URL_HEADER = "Upstash-Workflow-Url";
|
|
1538
|
-
var WORKFLOW_FAILURE_HEADER = "Upstash-Workflow-Is-Failure";
|
|
1539
|
-
var WORKFLOW_PROTOCOL_VERSION = "1";
|
|
1540
|
-
var WORKFLOW_PROTOCOL_VERSION_HEADER = "Upstash-Workflow-Sdk-Version";
|
|
1541
|
-
var DEFAULT_CONTENT_TYPE = "application/json";
|
|
1542
|
-
var NO_CONCURRENCY = 1;
|
|
1543
|
-
|
|
1544
1557
|
// src/client/workflow/types.ts
|
|
1545
1558
|
var StepTypes = ["Initial", "Run", "SleepFor", "SleepUntil", "Call"];
|
|
1546
1559
|
|
|
1547
1560
|
// src/client/workflow/workflow-requests.ts
|
|
1548
|
-
var triggerFirstInvocation = async (workflowContext, debug) => {
|
|
1561
|
+
var triggerFirstInvocation = async (workflowContext, retries, debug) => {
|
|
1549
1562
|
const headers = getHeaders(
|
|
1550
1563
|
"true",
|
|
1551
1564
|
workflowContext.workflowRunId,
|
|
1552
1565
|
workflowContext.url,
|
|
1553
1566
|
workflowContext.headers,
|
|
1554
1567
|
void 0,
|
|
1555
|
-
workflowContext.failureUrl
|
|
1568
|
+
workflowContext.failureUrl,
|
|
1569
|
+
retries
|
|
1556
1570
|
);
|
|
1557
1571
|
await debug?.log("SUBMIT", "SUBMIT_FIRST_INVOCATION", {
|
|
1558
1572
|
headers,
|
|
@@ -1607,18 +1621,18 @@ var recreateUserHeaders = (headers) => {
|
|
|
1607
1621
|
}
|
|
1608
1622
|
return filteredHeaders;
|
|
1609
1623
|
};
|
|
1610
|
-
var handleThirdPartyCallResult = async (request, requestPayload, client, workflowUrl, failureUrl, debug) => {
|
|
1624
|
+
var handleThirdPartyCallResult = async (request, requestPayload, client, workflowUrl, failureUrl, retries, debug) => {
|
|
1611
1625
|
try {
|
|
1612
1626
|
if (request.headers.get("Upstash-Workflow-Callback")) {
|
|
1613
1627
|
const callbackMessage = JSON.parse(requestPayload);
|
|
1614
1628
|
if (!(callbackMessage.status >= 200 && callbackMessage.status < 300)) {
|
|
1615
1629
|
await debug?.log("WARN", "SUBMIT_THIRD_PARTY_RESULT", {
|
|
1616
1630
|
status: callbackMessage.status,
|
|
1617
|
-
body:
|
|
1631
|
+
body: decodeBase64(callbackMessage.body)
|
|
1618
1632
|
});
|
|
1619
1633
|
console.warn(
|
|
1620
1634
|
`Workflow Warning: "context.call" failed with status ${callbackMessage.status} and will retry (if there are retries remaining). Error Message:
|
|
1621
|
-
${
|
|
1635
|
+
${decodeBase64(callbackMessage.body)}`
|
|
1622
1636
|
);
|
|
1623
1637
|
return ok("call-will-retry");
|
|
1624
1638
|
}
|
|
@@ -1647,13 +1661,14 @@ ${atob(callbackMessage.body)}`
|
|
|
1647
1661
|
workflowUrl,
|
|
1648
1662
|
userHeaders,
|
|
1649
1663
|
void 0,
|
|
1650
|
-
failureUrl
|
|
1664
|
+
failureUrl,
|
|
1665
|
+
retries
|
|
1651
1666
|
);
|
|
1652
1667
|
const callResultStep = {
|
|
1653
1668
|
stepId: Number(stepIdString),
|
|
1654
1669
|
stepName,
|
|
1655
1670
|
stepType,
|
|
1656
|
-
out:
|
|
1671
|
+
out: decodeBase64(callbackMessage.body),
|
|
1657
1672
|
concurrent: Number(concurrentString)
|
|
1658
1673
|
};
|
|
1659
1674
|
await debug?.log("SUBMIT", "SUBMIT_THIRD_PARTY_RESULT", {
|
|
@@ -1683,7 +1698,7 @@ ${atob(callbackMessage.body)}`
|
|
|
1683
1698
|
);
|
|
1684
1699
|
}
|
|
1685
1700
|
};
|
|
1686
|
-
var getHeaders = (initHeaderValue, workflowRunId, workflowUrl, userHeaders, step, failureUrl) => {
|
|
1701
|
+
var getHeaders = (initHeaderValue, workflowRunId, workflowUrl, userHeaders, step, failureUrl, retries) => {
|
|
1687
1702
|
const baseHeaders = {
|
|
1688
1703
|
[WORKFLOW_INIT_HEADER]: initHeaderValue,
|
|
1689
1704
|
[WORKFLOW_ID_HEADER]: workflowRunId,
|
|
@@ -1692,7 +1707,10 @@ var getHeaders = (initHeaderValue, workflowRunId, workflowUrl, userHeaders, step
|
|
|
1692
1707
|
...failureUrl ? {
|
|
1693
1708
|
[`Upstash-Failure-Callback-Forward-${WORKFLOW_FAILURE_HEADER}`]: "true",
|
|
1694
1709
|
"Upstash-Failure-Callback": failureUrl
|
|
1695
|
-
} : {}
|
|
1710
|
+
} : {},
|
|
1711
|
+
...retries === void 0 ? {} : {
|
|
1712
|
+
"Upstash-Retries": retries.toString()
|
|
1713
|
+
}
|
|
1696
1714
|
};
|
|
1697
1715
|
if (userHeaders) {
|
|
1698
1716
|
for (const header of userHeaders.keys()) {
|
|
@@ -1987,7 +2005,8 @@ var AutoExecutor = class _AutoExecutor {
|
|
|
1987
2005
|
this.context.url,
|
|
1988
2006
|
this.context.headers,
|
|
1989
2007
|
singleStep,
|
|
1990
|
-
this.context.failureUrl
|
|
2008
|
+
this.context.failureUrl,
|
|
2009
|
+
this.context.retries
|
|
1991
2010
|
);
|
|
1992
2011
|
const willWait = singleStep.concurrent === NO_CONCURRENCY || singleStep.stepId === 0;
|
|
1993
2012
|
return singleStep.callUrl ? (
|
|
@@ -2356,6 +2375,10 @@ var WorkflowContext = class {
|
|
|
2356
2375
|
* Default value is set to `process.env`.
|
|
2357
2376
|
*/
|
|
2358
2377
|
env;
|
|
2378
|
+
/**
|
|
2379
|
+
* Number of retries
|
|
2380
|
+
*/
|
|
2381
|
+
retries;
|
|
2359
2382
|
constructor({
|
|
2360
2383
|
qstashClient,
|
|
2361
2384
|
workflowRunId,
|
|
@@ -2366,7 +2389,8 @@ var WorkflowContext = class {
|
|
|
2366
2389
|
debug,
|
|
2367
2390
|
initialPayload,
|
|
2368
2391
|
rawInitialPayload,
|
|
2369
|
-
env
|
|
2392
|
+
env,
|
|
2393
|
+
retries
|
|
2370
2394
|
}) {
|
|
2371
2395
|
this.qstashClient = qstashClient;
|
|
2372
2396
|
this.workflowRunId = workflowRunId;
|
|
@@ -2377,6 +2401,7 @@ var WorkflowContext = class {
|
|
|
2377
2401
|
this.requestPayload = initialPayload;
|
|
2378
2402
|
this.rawInitialPayload = rawInitialPayload ?? JSON.stringify(this.requestPayload);
|
|
2379
2403
|
this.env = env ?? {};
|
|
2404
|
+
this.retries = retries ?? DEFAULT_RETRIES;
|
|
2380
2405
|
this.executor = new AutoExecutor(this, this.steps, debug);
|
|
2381
2406
|
}
|
|
2382
2407
|
/**
|
|
@@ -2513,7 +2538,8 @@ var DisabledWorkflowContext = class _DisabledWorkflowContext extends WorkflowCon
|
|
|
2513
2538
|
failureUrl: context.failureUrl,
|
|
2514
2539
|
initialPayload: context.requestPayload,
|
|
2515
2540
|
rawInitialPayload: context.rawInitialPayload,
|
|
2516
|
-
env: context.env
|
|
2541
|
+
env: context.env,
|
|
2542
|
+
retries: context.retries
|
|
2517
2543
|
});
|
|
2518
2544
|
try {
|
|
2519
2545
|
await routeFunction(disabledContext);
|
|
@@ -2585,7 +2611,7 @@ var getPayload = async (request) => {
|
|
|
2585
2611
|
};
|
|
2586
2612
|
var parsePayload = (rawPayload) => {
|
|
2587
2613
|
const [encodedInitialPayload, ...encodedSteps] = JSON.parse(rawPayload);
|
|
2588
|
-
const rawInitialPayload =
|
|
2614
|
+
const rawInitialPayload = decodeBase64(encodedInitialPayload.body);
|
|
2589
2615
|
const initialStep = {
|
|
2590
2616
|
stepId: 0,
|
|
2591
2617
|
stepName: "init",
|
|
@@ -2595,7 +2621,7 @@ var parsePayload = (rawPayload) => {
|
|
|
2595
2621
|
};
|
|
2596
2622
|
const stepsToDecode = encodedSteps.filter((step) => step.callType === "step");
|
|
2597
2623
|
const otherSteps = stepsToDecode.map((rawStep) => {
|
|
2598
|
-
return JSON.parse(
|
|
2624
|
+
return JSON.parse(decodeBase64(rawStep.body));
|
|
2599
2625
|
});
|
|
2600
2626
|
const steps = [initialStep, ...otherSteps];
|
|
2601
2627
|
return {
|
|
@@ -2693,13 +2719,13 @@ var handleFailure = async (request, requestPayload, qstashClient, initialPayload
|
|
|
2693
2719
|
const { status, header, body, url, sourceHeader, sourceBody, workflowRunId } = JSON.parse(
|
|
2694
2720
|
requestPayload
|
|
2695
2721
|
);
|
|
2696
|
-
const decodedBody = body ?
|
|
2722
|
+
const decodedBody = body ? decodeBase64(body) : "{}";
|
|
2697
2723
|
const errorPayload = JSON.parse(decodedBody);
|
|
2698
2724
|
const {
|
|
2699
2725
|
rawInitialPayload,
|
|
2700
2726
|
steps,
|
|
2701
2727
|
isLastDuplicate: _isLastDuplicate
|
|
2702
|
-
} = await parseRequest(
|
|
2728
|
+
} = await parseRequest(decodeBase64(sourceBody), false, debug);
|
|
2703
2729
|
const workflowContext = new WorkflowContext({
|
|
2704
2730
|
qstashClient,
|
|
2705
2731
|
workflowRunId,
|
|
@@ -2751,6 +2777,7 @@ var processOptions = (options) => {
|
|
|
2751
2777
|
}) : void 0,
|
|
2752
2778
|
baseUrl: environment.UPSTASH_WORKFLOW_URL,
|
|
2753
2779
|
env: environment,
|
|
2780
|
+
retries: DEFAULT_RETRIES,
|
|
2754
2781
|
...options
|
|
2755
2782
|
};
|
|
2756
2783
|
};
|
|
@@ -2765,7 +2792,8 @@ var serve = (routeFunction, options) => {
|
|
|
2765
2792
|
failureUrl,
|
|
2766
2793
|
failureFunction,
|
|
2767
2794
|
baseUrl,
|
|
2768
|
-
env
|
|
2795
|
+
env,
|
|
2796
|
+
retries
|
|
2769
2797
|
} = processOptions(options);
|
|
2770
2798
|
const debug = WorkflowLogger.getLogger(verbose);
|
|
2771
2799
|
const handler = async (request) => {
|
|
@@ -2835,6 +2863,7 @@ var serve = (routeFunction, options) => {
|
|
|
2835
2863
|
qstashClient,
|
|
2836
2864
|
workflowUrl,
|
|
2837
2865
|
workflowFailureUrl,
|
|
2866
|
+
retries,
|
|
2838
2867
|
debug
|
|
2839
2868
|
);
|
|
2840
2869
|
if (callReturnCheck.isErr()) {
|
|
@@ -2843,7 +2872,7 @@ var serve = (routeFunction, options) => {
|
|
|
2843
2872
|
});
|
|
2844
2873
|
throw callReturnCheck.error;
|
|
2845
2874
|
} else if (callReturnCheck.value === "continue-workflow") {
|
|
2846
|
-
const result = isFirstInvocation ? await triggerFirstInvocation(workflowContext, debug) : await triggerRouteFunction({
|
|
2875
|
+
const result = isFirstInvocation ? await triggerFirstInvocation(workflowContext, retries, debug) : await triggerRouteFunction({
|
|
2847
2876
|
onStep: async () => routeFunction(workflowContext),
|
|
2848
2877
|
onCleanup: async () => {
|
|
2849
2878
|
await triggerWorkflowDelete(workflowContext, debug);
|
|
@@ -2907,6 +2936,7 @@ export {
|
|
|
2907
2936
|
custom,
|
|
2908
2937
|
Chat,
|
|
2909
2938
|
Messages,
|
|
2939
|
+
decodeBase64,
|
|
2910
2940
|
Schedules,
|
|
2911
2941
|
UrlGroups,
|
|
2912
2942
|
StepTypes,
|
|
@@ -670,6 +670,18 @@ var NANOID_LENGTH = 21;
|
|
|
670
670
|
function nanoid() {
|
|
671
671
|
return [...crypto.getRandomValues(new Uint8Array(NANOID_LENGTH))].map((x) => NANOID_CHARS[x % NANOID_CHARS.length]).join("");
|
|
672
672
|
}
|
|
673
|
+
function decodeBase64(base64) {
|
|
674
|
+
try {
|
|
675
|
+
const binString = atob(base64);
|
|
676
|
+
const intArray = Uint8Array.from(binString, (m) => m.codePointAt(0));
|
|
677
|
+
return new TextDecoder().decode(intArray);
|
|
678
|
+
} catch (error) {
|
|
679
|
+
console.warn(
|
|
680
|
+
`Upstash Qstash: Failed while decoding base64 "${base64}". Decoding with atob and returning it instead. Error: ${error}`
|
|
681
|
+
);
|
|
682
|
+
return atob(base64);
|
|
683
|
+
}
|
|
684
|
+
}
|
|
673
685
|
|
|
674
686
|
// src/client/queue.ts
|
|
675
687
|
var Queue = class {
|
|
@@ -1159,6 +1171,17 @@ var Client = class {
|
|
|
1159
1171
|
}
|
|
1160
1172
|
};
|
|
1161
1173
|
|
|
1174
|
+
// src/client/workflow/constants.ts
|
|
1175
|
+
var WORKFLOW_ID_HEADER = "Upstash-Workflow-RunId";
|
|
1176
|
+
var WORKFLOW_INIT_HEADER = "Upstash-Workflow-Init";
|
|
1177
|
+
var WORKFLOW_URL_HEADER = "Upstash-Workflow-Url";
|
|
1178
|
+
var WORKFLOW_FAILURE_HEADER = "Upstash-Workflow-Is-Failure";
|
|
1179
|
+
var WORKFLOW_PROTOCOL_VERSION = "1";
|
|
1180
|
+
var WORKFLOW_PROTOCOL_VERSION_HEADER = "Upstash-Workflow-Sdk-Version";
|
|
1181
|
+
var DEFAULT_CONTENT_TYPE = "application/json";
|
|
1182
|
+
var NO_CONCURRENCY = 1;
|
|
1183
|
+
var DEFAULT_RETRIES = 3;
|
|
1184
|
+
|
|
1162
1185
|
// node_modules/neverthrow/dist/index.es.js
|
|
1163
1186
|
var defaultErrorConfig = {
|
|
1164
1187
|
withStackTrace: false
|
|
@@ -1531,28 +1554,19 @@ var Err = class {
|
|
|
1531
1554
|
};
|
|
1532
1555
|
var fromThrowable = Result.fromThrowable;
|
|
1533
1556
|
|
|
1534
|
-
// src/client/workflow/constants.ts
|
|
1535
|
-
var WORKFLOW_ID_HEADER = "Upstash-Workflow-RunId";
|
|
1536
|
-
var WORKFLOW_INIT_HEADER = "Upstash-Workflow-Init";
|
|
1537
|
-
var WORKFLOW_URL_HEADER = "Upstash-Workflow-Url";
|
|
1538
|
-
var WORKFLOW_FAILURE_HEADER = "Upstash-Workflow-Is-Failure";
|
|
1539
|
-
var WORKFLOW_PROTOCOL_VERSION = "1";
|
|
1540
|
-
var WORKFLOW_PROTOCOL_VERSION_HEADER = "Upstash-Workflow-Sdk-Version";
|
|
1541
|
-
var DEFAULT_CONTENT_TYPE = "application/json";
|
|
1542
|
-
var NO_CONCURRENCY = 1;
|
|
1543
|
-
|
|
1544
1557
|
// src/client/workflow/types.ts
|
|
1545
1558
|
var StepTypes = ["Initial", "Run", "SleepFor", "SleepUntil", "Call"];
|
|
1546
1559
|
|
|
1547
1560
|
// src/client/workflow/workflow-requests.ts
|
|
1548
|
-
var triggerFirstInvocation = async (workflowContext, debug) => {
|
|
1561
|
+
var triggerFirstInvocation = async (workflowContext, retries, debug) => {
|
|
1549
1562
|
const headers = getHeaders(
|
|
1550
1563
|
"true",
|
|
1551
1564
|
workflowContext.workflowRunId,
|
|
1552
1565
|
workflowContext.url,
|
|
1553
1566
|
workflowContext.headers,
|
|
1554
1567
|
void 0,
|
|
1555
|
-
workflowContext.failureUrl
|
|
1568
|
+
workflowContext.failureUrl,
|
|
1569
|
+
retries
|
|
1556
1570
|
);
|
|
1557
1571
|
await _optionalChain([debug, 'optionalAccess', _33 => _33.log, 'call', _34 => _34("SUBMIT", "SUBMIT_FIRST_INVOCATION", {
|
|
1558
1572
|
headers,
|
|
@@ -1607,18 +1621,18 @@ var recreateUserHeaders = (headers) => {
|
|
|
1607
1621
|
}
|
|
1608
1622
|
return filteredHeaders;
|
|
1609
1623
|
};
|
|
1610
|
-
var handleThirdPartyCallResult = async (request, requestPayload, client, workflowUrl, failureUrl, debug) => {
|
|
1624
|
+
var handleThirdPartyCallResult = async (request, requestPayload, client, workflowUrl, failureUrl, retries, debug) => {
|
|
1611
1625
|
try {
|
|
1612
1626
|
if (request.headers.get("Upstash-Workflow-Callback")) {
|
|
1613
1627
|
const callbackMessage = JSON.parse(requestPayload);
|
|
1614
1628
|
if (!(callbackMessage.status >= 200 && callbackMessage.status < 300)) {
|
|
1615
1629
|
await _optionalChain([debug, 'optionalAccess', _39 => _39.log, 'call', _40 => _40("WARN", "SUBMIT_THIRD_PARTY_RESULT", {
|
|
1616
1630
|
status: callbackMessage.status,
|
|
1617
|
-
body:
|
|
1631
|
+
body: decodeBase64(callbackMessage.body)
|
|
1618
1632
|
})]);
|
|
1619
1633
|
console.warn(
|
|
1620
1634
|
`Workflow Warning: "context.call" failed with status ${callbackMessage.status} and will retry (if there are retries remaining). Error Message:
|
|
1621
|
-
${
|
|
1635
|
+
${decodeBase64(callbackMessage.body)}`
|
|
1622
1636
|
);
|
|
1623
1637
|
return ok("call-will-retry");
|
|
1624
1638
|
}
|
|
@@ -1647,13 +1661,14 @@ ${atob(callbackMessage.body)}`
|
|
|
1647
1661
|
workflowUrl,
|
|
1648
1662
|
userHeaders,
|
|
1649
1663
|
void 0,
|
|
1650
|
-
failureUrl
|
|
1664
|
+
failureUrl,
|
|
1665
|
+
retries
|
|
1651
1666
|
);
|
|
1652
1667
|
const callResultStep = {
|
|
1653
1668
|
stepId: Number(stepIdString),
|
|
1654
1669
|
stepName,
|
|
1655
1670
|
stepType,
|
|
1656
|
-
out:
|
|
1671
|
+
out: decodeBase64(callbackMessage.body),
|
|
1657
1672
|
concurrent: Number(concurrentString)
|
|
1658
1673
|
};
|
|
1659
1674
|
await _optionalChain([debug, 'optionalAccess', _41 => _41.log, 'call', _42 => _42("SUBMIT", "SUBMIT_THIRD_PARTY_RESULT", {
|
|
@@ -1683,7 +1698,7 @@ ${atob(callbackMessage.body)}`
|
|
|
1683
1698
|
);
|
|
1684
1699
|
}
|
|
1685
1700
|
};
|
|
1686
|
-
var getHeaders = (initHeaderValue, workflowRunId, workflowUrl, userHeaders, step, failureUrl) => {
|
|
1701
|
+
var getHeaders = (initHeaderValue, workflowRunId, workflowUrl, userHeaders, step, failureUrl, retries) => {
|
|
1687
1702
|
const baseHeaders = {
|
|
1688
1703
|
[WORKFLOW_INIT_HEADER]: initHeaderValue,
|
|
1689
1704
|
[WORKFLOW_ID_HEADER]: workflowRunId,
|
|
@@ -1692,7 +1707,10 @@ var getHeaders = (initHeaderValue, workflowRunId, workflowUrl, userHeaders, step
|
|
|
1692
1707
|
...failureUrl ? {
|
|
1693
1708
|
[`Upstash-Failure-Callback-Forward-${WORKFLOW_FAILURE_HEADER}`]: "true",
|
|
1694
1709
|
"Upstash-Failure-Callback": failureUrl
|
|
1695
|
-
} : {}
|
|
1710
|
+
} : {},
|
|
1711
|
+
...retries === void 0 ? {} : {
|
|
1712
|
+
"Upstash-Retries": retries.toString()
|
|
1713
|
+
}
|
|
1696
1714
|
};
|
|
1697
1715
|
if (userHeaders) {
|
|
1698
1716
|
for (const header of userHeaders.keys()) {
|
|
@@ -1987,7 +2005,8 @@ var AutoExecutor = (_class3 = class _AutoExecutor {
|
|
|
1987
2005
|
this.context.url,
|
|
1988
2006
|
this.context.headers,
|
|
1989
2007
|
singleStep,
|
|
1990
|
-
this.context.failureUrl
|
|
2008
|
+
this.context.failureUrl,
|
|
2009
|
+
this.context.retries
|
|
1991
2010
|
);
|
|
1992
2011
|
const willWait = singleStep.concurrent === NO_CONCURRENCY || singleStep.stepId === 0;
|
|
1993
2012
|
return singleStep.callUrl ? (
|
|
@@ -2356,6 +2375,10 @@ var WorkflowContext = class {
|
|
|
2356
2375
|
* Default value is set to `process.env`.
|
|
2357
2376
|
*/
|
|
2358
2377
|
|
|
2378
|
+
/**
|
|
2379
|
+
* Number of retries
|
|
2380
|
+
*/
|
|
2381
|
+
|
|
2359
2382
|
constructor({
|
|
2360
2383
|
qstashClient,
|
|
2361
2384
|
workflowRunId,
|
|
@@ -2366,7 +2389,8 @@ var WorkflowContext = class {
|
|
|
2366
2389
|
debug,
|
|
2367
2390
|
initialPayload,
|
|
2368
2391
|
rawInitialPayload,
|
|
2369
|
-
env
|
|
2392
|
+
env,
|
|
2393
|
+
retries
|
|
2370
2394
|
}) {
|
|
2371
2395
|
this.qstashClient = qstashClient;
|
|
2372
2396
|
this.workflowRunId = workflowRunId;
|
|
@@ -2377,6 +2401,7 @@ var WorkflowContext = class {
|
|
|
2377
2401
|
this.requestPayload = initialPayload;
|
|
2378
2402
|
this.rawInitialPayload = _nullishCoalesce(rawInitialPayload, () => ( JSON.stringify(this.requestPayload)));
|
|
2379
2403
|
this.env = _nullishCoalesce(env, () => ( {}));
|
|
2404
|
+
this.retries = _nullishCoalesce(retries, () => ( DEFAULT_RETRIES));
|
|
2380
2405
|
this.executor = new AutoExecutor(this, this.steps, debug);
|
|
2381
2406
|
}
|
|
2382
2407
|
/**
|
|
@@ -2513,7 +2538,8 @@ var DisabledWorkflowContext = (_class8 = class _DisabledWorkflowContext extends
|
|
|
2513
2538
|
failureUrl: context.failureUrl,
|
|
2514
2539
|
initialPayload: context.requestPayload,
|
|
2515
2540
|
rawInitialPayload: context.rawInitialPayload,
|
|
2516
|
-
env: context.env
|
|
2541
|
+
env: context.env,
|
|
2542
|
+
retries: context.retries
|
|
2517
2543
|
});
|
|
2518
2544
|
try {
|
|
2519
2545
|
await routeFunction(disabledContext);
|
|
@@ -2585,7 +2611,7 @@ var getPayload = async (request) => {
|
|
|
2585
2611
|
};
|
|
2586
2612
|
var parsePayload = (rawPayload) => {
|
|
2587
2613
|
const [encodedInitialPayload, ...encodedSteps] = JSON.parse(rawPayload);
|
|
2588
|
-
const rawInitialPayload =
|
|
2614
|
+
const rawInitialPayload = decodeBase64(encodedInitialPayload.body);
|
|
2589
2615
|
const initialStep = {
|
|
2590
2616
|
stepId: 0,
|
|
2591
2617
|
stepName: "init",
|
|
@@ -2595,7 +2621,7 @@ var parsePayload = (rawPayload) => {
|
|
|
2595
2621
|
};
|
|
2596
2622
|
const stepsToDecode = encodedSteps.filter((step) => step.callType === "step");
|
|
2597
2623
|
const otherSteps = stepsToDecode.map((rawStep) => {
|
|
2598
|
-
return JSON.parse(
|
|
2624
|
+
return JSON.parse(decodeBase64(rawStep.body));
|
|
2599
2625
|
});
|
|
2600
2626
|
const steps = [initialStep, ...otherSteps];
|
|
2601
2627
|
return {
|
|
@@ -2693,13 +2719,13 @@ var handleFailure = async (request, requestPayload, qstashClient, initialPayload
|
|
|
2693
2719
|
const { status, header, body, url, sourceHeader, sourceBody, workflowRunId } = JSON.parse(
|
|
2694
2720
|
requestPayload
|
|
2695
2721
|
);
|
|
2696
|
-
const decodedBody = body ?
|
|
2722
|
+
const decodedBody = body ? decodeBase64(body) : "{}";
|
|
2697
2723
|
const errorPayload = JSON.parse(decodedBody);
|
|
2698
2724
|
const {
|
|
2699
2725
|
rawInitialPayload,
|
|
2700
2726
|
steps,
|
|
2701
2727
|
isLastDuplicate: _isLastDuplicate
|
|
2702
|
-
} = await parseRequest(
|
|
2728
|
+
} = await parseRequest(decodeBase64(sourceBody), false, debug);
|
|
2703
2729
|
const workflowContext = new WorkflowContext({
|
|
2704
2730
|
qstashClient,
|
|
2705
2731
|
workflowRunId,
|
|
@@ -2751,6 +2777,7 @@ var processOptions = (options) => {
|
|
|
2751
2777
|
}) : void 0,
|
|
2752
2778
|
baseUrl: environment.UPSTASH_WORKFLOW_URL,
|
|
2753
2779
|
env: environment,
|
|
2780
|
+
retries: DEFAULT_RETRIES,
|
|
2754
2781
|
...options
|
|
2755
2782
|
};
|
|
2756
2783
|
};
|
|
@@ -2765,7 +2792,8 @@ var serve = (routeFunction, options) => {
|
|
|
2765
2792
|
failureUrl,
|
|
2766
2793
|
failureFunction,
|
|
2767
2794
|
baseUrl,
|
|
2768
|
-
env
|
|
2795
|
+
env,
|
|
2796
|
+
retries
|
|
2769
2797
|
} = processOptions(options);
|
|
2770
2798
|
const debug = WorkflowLogger.getLogger(verbose);
|
|
2771
2799
|
const handler = async (request) => {
|
|
@@ -2835,6 +2863,7 @@ var serve = (routeFunction, options) => {
|
|
|
2835
2863
|
qstashClient,
|
|
2836
2864
|
workflowUrl,
|
|
2837
2865
|
workflowFailureUrl,
|
|
2866
|
+
retries,
|
|
2838
2867
|
debug
|
|
2839
2868
|
);
|
|
2840
2869
|
if (callReturnCheck.isErr()) {
|
|
@@ -2843,7 +2872,7 @@ var serve = (routeFunction, options) => {
|
|
|
2843
2872
|
})]);
|
|
2844
2873
|
throw callReturnCheck.error;
|
|
2845
2874
|
} else if (callReturnCheck.value === "continue-workflow") {
|
|
2846
|
-
const result = isFirstInvocation ? await triggerFirstInvocation(workflowContext, debug) : await triggerRouteFunction({
|
|
2875
|
+
const result = isFirstInvocation ? await triggerFirstInvocation(workflowContext, retries, debug) : await triggerRouteFunction({
|
|
2847
2876
|
onStep: async () => routeFunction(workflowContext),
|
|
2848
2877
|
onCleanup: async () => {
|
|
2849
2878
|
await triggerWorkflowDelete(workflowContext, debug);
|
|
@@ -2917,4 +2946,5 @@ var Workflow = class {
|
|
|
2917
2946
|
|
|
2918
2947
|
|
|
2919
2948
|
|
|
2920
|
-
|
|
2949
|
+
|
|
2950
|
+
exports.SignatureError = SignatureError; exports.Receiver = Receiver; exports.QstashError = QstashError; exports.QstashRatelimitError = QstashRatelimitError; exports.QstashChatRatelimitError = QstashChatRatelimitError; exports.QstashDailyRatelimitError = QstashDailyRatelimitError; exports.QStashWorkflowError = QStashWorkflowError; exports.QStashWorkflowAbort = QStashWorkflowAbort; exports.formatWorkflowError = formatWorkflowError; exports.setupAnalytics = setupAnalytics; exports.upstash = upstash; exports.openai = openai; exports.custom = custom; exports.Chat = Chat; exports.Messages = Messages; exports.decodeBase64 = decodeBase64; exports.Schedules = Schedules; exports.UrlGroups = UrlGroups; exports.StepTypes = StepTypes; exports.WorkflowContext = WorkflowContext; exports.DisabledWorkflowContext = DisabledWorkflowContext; exports.WorkflowLogger = WorkflowLogger; exports.processOptions = processOptions; exports.serve = serve; exports.Workflow = Workflow; exports.Client = Client;
|
|
@@ -1103,7 +1103,11 @@ declare class WorkflowContext<TInitialPayload = unknown> {
|
|
|
1103
1103
|
* Default value is set to `process.env`.
|
|
1104
1104
|
*/
|
|
1105
1105
|
readonly env: Record<string, string | undefined>;
|
|
1106
|
-
|
|
1106
|
+
/**
|
|
1107
|
+
* Number of retries
|
|
1108
|
+
*/
|
|
1109
|
+
readonly retries: number;
|
|
1110
|
+
constructor({ qstashClient, workflowRunId, headers, steps, url, failureUrl, debug, initialPayload, rawInitialPayload, env, retries, }: {
|
|
1107
1111
|
qstashClient: WorkflowClient;
|
|
1108
1112
|
workflowRunId: string;
|
|
1109
1113
|
headers: Headers;
|
|
@@ -1114,6 +1118,7 @@ declare class WorkflowContext<TInitialPayload = unknown> {
|
|
|
1114
1118
|
initialPayload: TInitialPayload;
|
|
1115
1119
|
rawInitialPayload?: string;
|
|
1116
1120
|
env?: Record<string, string | undefined>;
|
|
1121
|
+
retries?: number;
|
|
1117
1122
|
});
|
|
1118
1123
|
/**
|
|
1119
1124
|
* Executes a workflow step
|
|
@@ -1401,6 +1406,12 @@ type WorkflowServeOptions<TResponse extends Response = Response, TInitialPayload
|
|
|
1401
1406
|
* Useful in cases like cloudflare with hono.
|
|
1402
1407
|
*/
|
|
1403
1408
|
env?: Record<string, string | undefined>;
|
|
1409
|
+
/**
|
|
1410
|
+
* Number of retries to use in workflow requests
|
|
1411
|
+
*
|
|
1412
|
+
* 3 by default
|
|
1413
|
+
*/
|
|
1414
|
+
retries?: number;
|
|
1404
1415
|
};
|
|
1405
1416
|
/**
|
|
1406
1417
|
* Payload passed as body in failureFunction
|
|
@@ -1103,7 +1103,11 @@ declare class WorkflowContext<TInitialPayload = unknown> {
|
|
|
1103
1103
|
* Default value is set to `process.env`.
|
|
1104
1104
|
*/
|
|
1105
1105
|
readonly env: Record<string, string | undefined>;
|
|
1106
|
-
|
|
1106
|
+
/**
|
|
1107
|
+
* Number of retries
|
|
1108
|
+
*/
|
|
1109
|
+
readonly retries: number;
|
|
1110
|
+
constructor({ qstashClient, workflowRunId, headers, steps, url, failureUrl, debug, initialPayload, rawInitialPayload, env, retries, }: {
|
|
1107
1111
|
qstashClient: WorkflowClient;
|
|
1108
1112
|
workflowRunId: string;
|
|
1109
1113
|
headers: Headers;
|
|
@@ -1114,6 +1118,7 @@ declare class WorkflowContext<TInitialPayload = unknown> {
|
|
|
1114
1118
|
initialPayload: TInitialPayload;
|
|
1115
1119
|
rawInitialPayload?: string;
|
|
1116
1120
|
env?: Record<string, string | undefined>;
|
|
1121
|
+
retries?: number;
|
|
1117
1122
|
});
|
|
1118
1123
|
/**
|
|
1119
1124
|
* Executes a workflow step
|
|
@@ -1401,6 +1406,12 @@ type WorkflowServeOptions<TResponse extends Response = Response, TInitialPayload
|
|
|
1401
1406
|
* Useful in cases like cloudflare with hono.
|
|
1402
1407
|
*/
|
|
1403
1408
|
env?: Record<string, string | undefined>;
|
|
1409
|
+
/**
|
|
1410
|
+
* Number of retries to use in workflow requests
|
|
1411
|
+
*
|
|
1412
|
+
* 3 by default
|
|
1413
|
+
*/
|
|
1414
|
+
retries?: number;
|
|
1404
1415
|
};
|
|
1405
1416
|
/**
|
|
1406
1417
|
* Payload passed as body in failureFunction
|
package/cloudflare.d.mts
CHANGED
package/cloudflare.d.ts
CHANGED
package/cloudflare.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkXY54CU56js = require('./chunk-XY54CU56.js');
|
|
4
4
|
|
|
5
5
|
// platforms/cloudflare.ts
|
|
6
6
|
var getArgs = (args) => {
|
|
@@ -24,7 +24,7 @@ var getArgs = (args) => {
|
|
|
24
24
|
var serve2 = (routeFunction, options) => {
|
|
25
25
|
const handler = async (...args) => {
|
|
26
26
|
const { request, env } = getArgs(args);
|
|
27
|
-
const serveHandler =
|
|
27
|
+
const serveHandler = _chunkXY54CU56js.serve.call(void 0, routeFunction, {
|
|
28
28
|
env,
|
|
29
29
|
...options
|
|
30
30
|
});
|
package/cloudflare.mjs
CHANGED
package/h3.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as h3 from 'h3';
|
|
2
2
|
import { H3Event } from 'h3';
|
|
3
|
-
import { a2 as RouteFunction, a3 as WorkflowServeOptions } from './client-
|
|
3
|
+
import { a2 as RouteFunction, a3 as WorkflowServeOptions } from './client-BsCzCprQ.mjs';
|
|
4
4
|
import 'neverthrow';
|
|
5
5
|
|
|
6
6
|
type VerifySignatureConfig = {
|
package/h3.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as h3 from 'h3';
|
|
2
2
|
import { H3Event } from 'h3';
|
|
3
|
-
import { a2 as RouteFunction, a3 as WorkflowServeOptions } from './client-
|
|
3
|
+
import { a2 as RouteFunction, a3 as WorkflowServeOptions } from './client-BsCzCprQ.js';
|
|
4
4
|
import 'neverthrow';
|
|
5
5
|
|
|
6
6
|
type VerifySignatureConfig = {
|
package/h3.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
require('./chunk-
|
|
6
|
-
require('./chunk-
|
|
4
|
+
var _chunk5OXFLS25js = require('./chunk-5OXFLS25.js');
|
|
5
|
+
require('./chunk-VN7YQ2UN.js');
|
|
6
|
+
require('./chunk-XY54CU56.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
exports.serve =
|
|
10
|
+
exports.serve = _chunk5OXFLS25js.serve; exports.verifySignatureH3 = _chunk5OXFLS25js.verifySignatureH3;
|
package/h3.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
serve,
|
|
3
3
|
verifySignatureH3
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-HS75QP5Z.mjs";
|
|
5
|
+
import "./chunk-CIVGPRQN.mjs";
|
|
6
|
+
import "./chunk-SFN2PBFB.mjs";
|
|
7
7
|
export {
|
|
8
8
|
serve,
|
|
9
9
|
verifySignatureH3
|
package/hono.d.mts
CHANGED
package/hono.d.ts
CHANGED
package/hono.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkXY54CU56js = require('./chunk-XY54CU56.js');
|
|
4
4
|
|
|
5
5
|
// platforms/hono.ts
|
|
6
6
|
var serve2 = (routeFunction, options) => {
|
|
7
7
|
const handler = async (context) => {
|
|
8
8
|
const environment = context.env;
|
|
9
9
|
const request = context.req.raw;
|
|
10
|
-
const serveHandler =
|
|
10
|
+
const serveHandler = _chunkXY54CU56js.serve.call(void 0, routeFunction, {
|
|
11
11
|
// when hono is used without cf workers, it sends a DebugHTTPServer
|
|
12
12
|
// object in `context.env`. don't pass env if this is the case:
|
|
13
13
|
env: "QSTASH_TOKEN" in environment ? environment : void 0,
|
package/hono.mjs
CHANGED
package/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { R as RateLimit, C as ChatRateLimit, S as Step, F as FailureFunctionPayload } from './client-
|
|
2
|
-
export { A as AddEndpointsRequest, $ as AnalyticsConfig, a0 as AnalyticsSetup, B as BodyInit, y as Chat, D as ChatCompletion, I as ChatCompletionChunk, z as ChatCompletionMessage, T as ChatRequest, f as Client, n as CreateScheduleRequest, p as Endpoint, t as Event, u as EventPayload, E as EventsRequest, v as GetEventsPayload, G as GetEventsResponse, H as HTTPMethods, w as HeadersInit, M as Message, k as MessagePayload, l as Messages, O as OpenAIChatModel, N as PromptChatRequest, _ as ProviderReturnType, P as PublishBatchRequest, e as PublishJsonRequest, d as PublishRequest, j as PublishResponse, g as PublishToApiResponse, i as PublishToUrlGroupsResponse, h as PublishToUrlResponse, Q as QueueRequest, c as Receiver, a as ReceiverConfig, q as RemoveEndpointsRequest, x as RequestOptions, m as Schedule, o as Schedules, b as SignatureError, s as State, K as StreamDisabled, J as StreamEnabled, L as StreamParameter, U as UrlGroup, r as UrlGroups, V as VerifyRequest, W as WithCursor, X as custom, Y as openai, a1 as setupAnalytics, Z as upstash } from './client-
|
|
1
|
+
import { R as RateLimit, C as ChatRateLimit, S as Step, F as FailureFunctionPayload } from './client-BsCzCprQ.mjs';
|
|
2
|
+
export { A as AddEndpointsRequest, $ as AnalyticsConfig, a0 as AnalyticsSetup, B as BodyInit, y as Chat, D as ChatCompletion, I as ChatCompletionChunk, z as ChatCompletionMessage, T as ChatRequest, f as Client, n as CreateScheduleRequest, p as Endpoint, t as Event, u as EventPayload, E as EventsRequest, v as GetEventsPayload, G as GetEventsResponse, H as HTTPMethods, w as HeadersInit, M as Message, k as MessagePayload, l as Messages, O as OpenAIChatModel, N as PromptChatRequest, _ as ProviderReturnType, P as PublishBatchRequest, e as PublishJsonRequest, d as PublishRequest, j as PublishResponse, g as PublishToApiResponse, i as PublishToUrlGroupsResponse, h as PublishToUrlResponse, Q as QueueRequest, c as Receiver, a as ReceiverConfig, q as RemoveEndpointsRequest, x as RequestOptions, m as Schedule, o as Schedules, b as SignatureError, s as State, K as StreamDisabled, J as StreamEnabled, L as StreamParameter, U as UrlGroup, r as UrlGroups, V as VerifyRequest, W as WithCursor, X as custom, Y as openai, a1 as setupAnalytics, Z as upstash } from './client-BsCzCprQ.mjs';
|
|
3
3
|
import 'neverthrow';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -51,4 +51,17 @@ declare class QStashWorkflowAbort extends Error {
|
|
|
51
51
|
*/
|
|
52
52
|
declare const formatWorkflowError: (error: unknown) => FailureFunctionPayload;
|
|
53
53
|
|
|
54
|
-
|
|
54
|
+
/**
|
|
55
|
+
* When the base64 string has unicode characters, atob doesn't decode
|
|
56
|
+
* them correctly since it only outputs ASCII characters. Therefore,
|
|
57
|
+
* instead of using atob, we properly decode them.
|
|
58
|
+
*
|
|
59
|
+
* If the decoding into unicode somehow fails, returns the result of atob
|
|
60
|
+
*
|
|
61
|
+
* https://developer.mozilla.org/en-US/docs/Glossary/Base64#the_unicode_problem
|
|
62
|
+
*
|
|
63
|
+
* @param base64 encoded string
|
|
64
|
+
*/
|
|
65
|
+
declare function decodeBase64(base64: string): string;
|
|
66
|
+
|
|
67
|
+
export { ChatRateLimit, QStashWorkflowAbort, QStashWorkflowError, QstashChatRatelimitError, QstashDailyRatelimitError, QstashError, QstashRatelimitError, RateLimit, decodeBase64, formatWorkflowError };
|
package/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { R as RateLimit, C as ChatRateLimit, S as Step, F as FailureFunctionPayload } from './client-
|
|
2
|
-
export { A as AddEndpointsRequest, $ as AnalyticsConfig, a0 as AnalyticsSetup, B as BodyInit, y as Chat, D as ChatCompletion, I as ChatCompletionChunk, z as ChatCompletionMessage, T as ChatRequest, f as Client, n as CreateScheduleRequest, p as Endpoint, t as Event, u as EventPayload, E as EventsRequest, v as GetEventsPayload, G as GetEventsResponse, H as HTTPMethods, w as HeadersInit, M as Message, k as MessagePayload, l as Messages, O as OpenAIChatModel, N as PromptChatRequest, _ as ProviderReturnType, P as PublishBatchRequest, e as PublishJsonRequest, d as PublishRequest, j as PublishResponse, g as PublishToApiResponse, i as PublishToUrlGroupsResponse, h as PublishToUrlResponse, Q as QueueRequest, c as Receiver, a as ReceiverConfig, q as RemoveEndpointsRequest, x as RequestOptions, m as Schedule, o as Schedules, b as SignatureError, s as State, K as StreamDisabled, J as StreamEnabled, L as StreamParameter, U as UrlGroup, r as UrlGroups, V as VerifyRequest, W as WithCursor, X as custom, Y as openai, a1 as setupAnalytics, Z as upstash } from './client-
|
|
1
|
+
import { R as RateLimit, C as ChatRateLimit, S as Step, F as FailureFunctionPayload } from './client-BsCzCprQ.js';
|
|
2
|
+
export { A as AddEndpointsRequest, $ as AnalyticsConfig, a0 as AnalyticsSetup, B as BodyInit, y as Chat, D as ChatCompletion, I as ChatCompletionChunk, z as ChatCompletionMessage, T as ChatRequest, f as Client, n as CreateScheduleRequest, p as Endpoint, t as Event, u as EventPayload, E as EventsRequest, v as GetEventsPayload, G as GetEventsResponse, H as HTTPMethods, w as HeadersInit, M as Message, k as MessagePayload, l as Messages, O as OpenAIChatModel, N as PromptChatRequest, _ as ProviderReturnType, P as PublishBatchRequest, e as PublishJsonRequest, d as PublishRequest, j as PublishResponse, g as PublishToApiResponse, i as PublishToUrlGroupsResponse, h as PublishToUrlResponse, Q as QueueRequest, c as Receiver, a as ReceiverConfig, q as RemoveEndpointsRequest, x as RequestOptions, m as Schedule, o as Schedules, b as SignatureError, s as State, K as StreamDisabled, J as StreamEnabled, L as StreamParameter, U as UrlGroup, r as UrlGroups, V as VerifyRequest, W as WithCursor, X as custom, Y as openai, a1 as setupAnalytics, Z as upstash } from './client-BsCzCprQ.js';
|
|
3
3
|
import 'neverthrow';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -51,4 +51,17 @@ declare class QStashWorkflowAbort extends Error {
|
|
|
51
51
|
*/
|
|
52
52
|
declare const formatWorkflowError: (error: unknown) => FailureFunctionPayload;
|
|
53
53
|
|
|
54
|
-
|
|
54
|
+
/**
|
|
55
|
+
* When the base64 string has unicode characters, atob doesn't decode
|
|
56
|
+
* them correctly since it only outputs ASCII characters. Therefore,
|
|
57
|
+
* instead of using atob, we properly decode them.
|
|
58
|
+
*
|
|
59
|
+
* If the decoding into unicode somehow fails, returns the result of atob
|
|
60
|
+
*
|
|
61
|
+
* https://developer.mozilla.org/en-US/docs/Glossary/Base64#the_unicode_problem
|
|
62
|
+
*
|
|
63
|
+
* @param base64 encoded string
|
|
64
|
+
*/
|
|
65
|
+
declare function decodeBase64(base64: string): string;
|
|
66
|
+
|
|
67
|
+
export { ChatRateLimit, QStashWorkflowAbort, QStashWorkflowError, QstashChatRatelimitError, QstashDailyRatelimitError, QstashError, QstashRatelimitError, RateLimit, decodeBase64, formatWorkflowError };
|
package/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('./chunk-
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('./chunk-VN7YQ2UN.js');
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
|
|
21
|
-
var _chunkWQZ4U6LJjs = require('./chunk-WQZ4U6LJ.js');
|
|
22
21
|
|
|
22
|
+
var _chunkXY54CU56js = require('./chunk-XY54CU56.js');
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
|
|
@@ -38,4 +38,6 @@ var _chunkWQZ4U6LJjs = require('./chunk-WQZ4U6LJ.js');
|
|
|
38
38
|
|
|
39
39
|
|
|
40
40
|
|
|
41
|
-
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
exports.Chat = _chunkXY54CU56js.Chat; exports.Client = _chunkXY54CU56js.Client; exports.Messages = _chunkXY54CU56js.Messages; exports.QStashWorkflowAbort = _chunkXY54CU56js.QStashWorkflowAbort; exports.QStashWorkflowError = _chunkXY54CU56js.QStashWorkflowError; exports.QstashChatRatelimitError = _chunkXY54CU56js.QstashChatRatelimitError; exports.QstashDailyRatelimitError = _chunkXY54CU56js.QstashDailyRatelimitError; exports.QstashError = _chunkXY54CU56js.QstashError; exports.QstashRatelimitError = _chunkXY54CU56js.QstashRatelimitError; exports.Receiver = _chunkXY54CU56js.Receiver; exports.Schedules = _chunkXY54CU56js.Schedules; exports.SignatureError = _chunkXY54CU56js.SignatureError; exports.UrlGroups = _chunkXY54CU56js.UrlGroups; exports.custom = _chunkXY54CU56js.custom; exports.decodeBase64 = _chunkXY54CU56js.decodeBase64; exports.formatWorkflowError = _chunkXY54CU56js.formatWorkflowError; exports.openai = _chunkXY54CU56js.openai; exports.setupAnalytics = _chunkXY54CU56js.setupAnalytics; exports.upstash = _chunkXY54CU56js.upstash;
|
package/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "./chunk-
|
|
1
|
+
import "./chunk-CIVGPRQN.mjs";
|
|
2
2
|
import {
|
|
3
3
|
Chat,
|
|
4
4
|
Client,
|
|
@@ -14,11 +14,12 @@ import {
|
|
|
14
14
|
SignatureError,
|
|
15
15
|
UrlGroups,
|
|
16
16
|
custom,
|
|
17
|
+
decodeBase64,
|
|
17
18
|
formatWorkflowError,
|
|
18
19
|
openai,
|
|
19
20
|
setupAnalytics,
|
|
20
21
|
upstash
|
|
21
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-SFN2PBFB.mjs";
|
|
22
23
|
export {
|
|
23
24
|
Chat,
|
|
24
25
|
Client,
|
|
@@ -34,6 +35,7 @@ export {
|
|
|
34
35
|
SignatureError,
|
|
35
36
|
UrlGroups,
|
|
36
37
|
custom,
|
|
38
|
+
decodeBase64,
|
|
37
39
|
formatWorkflowError,
|
|
38
40
|
openai,
|
|
39
41
|
setupAnalytics,
|
package/nextjs.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { NextApiHandler } from 'next';
|
|
2
2
|
import { NextRequest, NextFetchEvent, NextResponse } from 'next/server';
|
|
3
|
-
import { a2 as RouteFunction, a3 as WorkflowServeOptions } from './client-
|
|
3
|
+
import { a2 as RouteFunction, a3 as WorkflowServeOptions } from './client-BsCzCprQ.mjs';
|
|
4
4
|
import 'neverthrow';
|
|
5
5
|
|
|
6
6
|
type VerifySignatureConfig = {
|
package/nextjs.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { NextApiHandler } from 'next';
|
|
2
2
|
import { NextRequest, NextFetchEvent, NextResponse } from 'next/server';
|
|
3
|
-
import { a2 as RouteFunction, a3 as WorkflowServeOptions } from './client-
|
|
3
|
+
import { a2 as RouteFunction, a3 as WorkflowServeOptions } from './client-BsCzCprQ.js';
|
|
4
4
|
import 'neverthrow';
|
|
5
5
|
|
|
6
6
|
type VerifySignatureConfig = {
|
package/nextjs.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkXY54CU56js = require('./chunk-XY54CU56.js');
|
|
5
5
|
|
|
6
6
|
// platforms/nextjs.ts
|
|
7
7
|
var _server = require('next/server');
|
|
@@ -19,7 +19,7 @@ function verifySignature(handler, config) {
|
|
|
19
19
|
"nextSigningKey is required, either in the config or as env variable QSTASH_NEXT_SIGNING_KEY"
|
|
20
20
|
);
|
|
21
21
|
}
|
|
22
|
-
const receiver = new (0,
|
|
22
|
+
const receiver = new (0, _chunkXY54CU56js.Receiver)({
|
|
23
23
|
currentSigningKey,
|
|
24
24
|
nextSigningKey
|
|
25
25
|
});
|
|
@@ -71,7 +71,7 @@ function verifySignatureEdge(handler, config) {
|
|
|
71
71
|
"nextSigningKey is required, either in the config or as env variable QSTASH_NEXT_SIGNING_KEY"
|
|
72
72
|
);
|
|
73
73
|
}
|
|
74
|
-
const receiver = new (0,
|
|
74
|
+
const receiver = new (0, _chunkXY54CU56js.Receiver)({
|
|
75
75
|
currentSigningKey,
|
|
76
76
|
nextSigningKey
|
|
77
77
|
});
|
|
@@ -111,7 +111,7 @@ function verifySignatureAppRouter(handler, config) {
|
|
|
111
111
|
"nextSigningKey is required, either in the config or as env variable QSTASH_NEXT_SIGNING_KEY"
|
|
112
112
|
);
|
|
113
113
|
}
|
|
114
|
-
const receiver = new (0,
|
|
114
|
+
const receiver = new (0, _chunkXY54CU56js.Receiver)({
|
|
115
115
|
currentSigningKey,
|
|
116
116
|
nextSigningKey
|
|
117
117
|
});
|
|
@@ -139,7 +139,7 @@ function verifySignatureAppRouter(handler, config) {
|
|
|
139
139
|
};
|
|
140
140
|
}
|
|
141
141
|
var serve2 = (routeFunction, options) => {
|
|
142
|
-
const handler =
|
|
142
|
+
const handler = _chunkXY54CU56js.serve.call(void 0, routeFunction, {
|
|
143
143
|
onStepFinish: (workflowRunId) => new (0, _server.NextResponse)(JSON.stringify({ workflowRunId }), { status: 200 }),
|
|
144
144
|
...options
|
|
145
145
|
});
|
|
@@ -148,7 +148,7 @@ var serve2 = (routeFunction, options) => {
|
|
|
148
148
|
};
|
|
149
149
|
};
|
|
150
150
|
var servePagesRouter = (routeFunction, options) => {
|
|
151
|
-
const handler =
|
|
151
|
+
const handler = _chunkXY54CU56js.serve.call(void 0, routeFunction, options);
|
|
152
152
|
return async (req, res) => {
|
|
153
153
|
if (_optionalChain([req, 'access', _10 => _10.method, 'optionalAccess', _11 => _11.toUpperCase, 'call', _12 => _12()]) !== "POST") {
|
|
154
154
|
res.status(405).json("Only POST requests are allowed in worklfows");
|
package/nextjs.mjs
CHANGED
package/nuxt.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
5
|
-
require('./chunk-
|
|
3
|
+
var _chunk5OXFLS25js = require('./chunk-5OXFLS25.js');
|
|
4
|
+
require('./chunk-VN7YQ2UN.js');
|
|
5
|
+
require('./chunk-XY54CU56.js');
|
|
6
6
|
|
|
7
7
|
// platforms/nuxt.ts
|
|
8
|
-
var verifySignatureNuxt =
|
|
8
|
+
var verifySignatureNuxt = _chunk5OXFLS25js.verifySignatureH3;
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
exports.verifySignatureNuxt = verifySignatureNuxt;
|
package/nuxt.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
verifySignatureH3
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-HS75QP5Z.mjs";
|
|
4
|
+
import "./chunk-CIVGPRQN.mjs";
|
|
5
|
+
import "./chunk-SFN2PBFB.mjs";
|
|
6
6
|
|
|
7
7
|
// platforms/nuxt.ts
|
|
8
8
|
var verifySignatureNuxt = verifySignatureH3;
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"v2.7.
|
|
1
|
+
{"version":"v2.7.8","name":"@upstash/qstash","description":"Official Typescript client for QStash","author":"Andreas Thomas <dev@chronark.com>","license":"MIT","homepage":"https://github.com/upstash/sdk-qstash-ts#readme","repository":{"type":"git","url":"git+https://github.com/upstash/sdk-qstash-ts.git"},"bugs":{"url":"https://github.com/upstash/sdk-qstash-ts/issues"},"main":"./index.js","module":"./index.mjs","types":"./index.d.ts","files":["./**"],"exports":{".":{"import":"./index.mjs","require":"./index.js"},"./nextjs":{"import":"./nextjs.js","require":"./nextjs.js"},"./dist/nextjs":{"import":"./nextjs.js","require":"./nextjs.js"},"./h3":{"types":"./h3.d.ts","import":"./h3.mjs","require":"./h3.js"},"./nuxt":{"types":"./nuxt.d.ts","import":"./nuxt.mjs","require":"./nuxt.js"},"./svelte":{"types":"./svelte.d.ts","import":"./svelte.mjs","require":"./svelte.js"},"./solidjs":{"types":"./solidjs.d.ts","import":"./solidjs.mjs","require":"./solidjs.js"},"./workflow":{"types":"./workflow.d.ts","import":"./workflow.mjs","require":"./workflow.js"},"./hono":{"types":"./hono.d.ts","import":"./hono.mjs","require":"./hono.js"},"./cloudflare":{"types":"./cloudflare.d.ts","import":"./cloudflare.mjs","require":"./cloudflare.js"}},"typesVersions":{"*":{"nextjs":["./nextjs.d.ts"]}},"keywords":["qstash","queue","events","serverless","upstash"],"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/**/*.{js,ts,tsx}\" --quiet --fix"},"devDependencies":{"@commitlint/cli":"^19.2.2","@commitlint/config-conventional":"^19.2.2","@solidjs/start":"^1.0.6","@sveltejs/kit":"^2.5.18","@types/bun":"^1.1.1","@types/crypto-js":"^4.2.0","@typescript-eslint/eslint-plugin":"^7.0.1","@typescript-eslint/parser":"^7.0.1","ai":"^3.1.28","bun-types":"^1.1.7","eslint":"^8","eslint-plugin-unicorn":"^51.0.1","h3":"^1.12.0","hono":"^4.5.8","husky":"^9.0.10","neverthrow":"^7.0.1","next":"^14.0.2","prettier":"^3.2.5","tsup":"latest","typescript":"^5.4.5","undici-types":"^6.16.0","vitest":"latest"},"dependencies":{"crypto-js":">=4.2.0","jose":"^5.2.3"}}
|
package/solidjs.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { APIHandler, APIEvent } from '@solidjs/start/server';
|
|
2
|
-
import { a2 as RouteFunction, a3 as WorkflowServeOptions } from './client-
|
|
2
|
+
import { a2 as RouteFunction, a3 as WorkflowServeOptions } from './client-BsCzCprQ.mjs';
|
|
3
3
|
import 'neverthrow';
|
|
4
4
|
|
|
5
5
|
type VerifySignatureConfig = {
|
package/solidjs.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { APIHandler, APIEvent } from '@solidjs/start/server';
|
|
2
|
-
import { a2 as RouteFunction, a3 as WorkflowServeOptions } from './client-
|
|
2
|
+
import { a2 as RouteFunction, a3 as WorkflowServeOptions } from './client-BsCzCprQ.js';
|
|
3
3
|
import 'neverthrow';
|
|
4
4
|
|
|
5
5
|
type VerifySignatureConfig = {
|
package/solidjs.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }require('./chunk-
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }require('./chunk-VN7YQ2UN.js');
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _chunkXY54CU56js = require('./chunk-XY54CU56.js');
|
|
6
6
|
|
|
7
7
|
// platforms/solidjs.ts
|
|
8
8
|
var verifySignatureSolidjs = (handler, config) => {
|
|
@@ -14,7 +14,7 @@ var verifySignatureSolidjs = (handler, config) => {
|
|
|
14
14
|
if (!nextSigningKey) {
|
|
15
15
|
throw new Error("nextSigningKey is required, either in the config or from the env");
|
|
16
16
|
}
|
|
17
|
-
const receiver = new (0,
|
|
17
|
+
const receiver = new (0, _chunkXY54CU56js.Receiver)({
|
|
18
18
|
currentSigningKey,
|
|
19
19
|
nextSigningKey
|
|
20
20
|
});
|
|
@@ -45,7 +45,7 @@ var serve2 = (routeFunction, options) => {
|
|
|
45
45
|
if (method.toUpperCase() !== "POST") {
|
|
46
46
|
return new Response("Only POST requests are allowed in worklfows", { status: 405 });
|
|
47
47
|
}
|
|
48
|
-
const serveHandler =
|
|
48
|
+
const serveHandler = _chunkXY54CU56js.serve.call(void 0, routeFunction, options);
|
|
49
49
|
return await serveHandler(event.request);
|
|
50
50
|
};
|
|
51
51
|
return handler;
|
package/solidjs.mjs
CHANGED
package/svelte.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { RequestHandler } from '@sveltejs/kit';
|
|
2
|
-
import { a2 as RouteFunction, a3 as WorkflowServeOptions } from './client-
|
|
2
|
+
import { a2 as RouteFunction, a3 as WorkflowServeOptions } from './client-BsCzCprQ.mjs';
|
|
3
3
|
import 'neverthrow';
|
|
4
4
|
|
|
5
5
|
type VerifySignatureConfig = {
|
package/svelte.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { RequestHandler } from '@sveltejs/kit';
|
|
2
|
-
import { a2 as RouteFunction, a3 as WorkflowServeOptions } from './client-
|
|
2
|
+
import { a2 as RouteFunction, a3 as WorkflowServeOptions } from './client-BsCzCprQ.js';
|
|
3
3
|
import 'neverthrow';
|
|
4
4
|
|
|
5
5
|
type VerifySignatureConfig = {
|
package/svelte.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('./chunk-
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('./chunk-VN7YQ2UN.js');
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _chunkXY54CU56js = require('./chunk-XY54CU56.js');
|
|
6
6
|
|
|
7
7
|
// platforms/svelte.ts
|
|
8
8
|
var verifySignatureSvelte = (handler, config) => {
|
|
@@ -14,7 +14,7 @@ var verifySignatureSvelte = (handler, config) => {
|
|
|
14
14
|
if (!nextSigningKey) {
|
|
15
15
|
throw new Error("nextSigningKey is required, either in the config or from the env");
|
|
16
16
|
}
|
|
17
|
-
const receiver = new (0,
|
|
17
|
+
const receiver = new (0, _chunkXY54CU56js.Receiver)({
|
|
18
18
|
currentSigningKey,
|
|
19
19
|
nextSigningKey
|
|
20
20
|
});
|
|
@@ -42,7 +42,7 @@ var verifySignatureSvelte = (handler, config) => {
|
|
|
42
42
|
};
|
|
43
43
|
var serve2 = (routeFunction, options) => {
|
|
44
44
|
const handler = async ({ request }) => {
|
|
45
|
-
const serveMethod =
|
|
45
|
+
const serveMethod = _chunkXY54CU56js.serve.call(void 0, routeFunction, options);
|
|
46
46
|
return await serveMethod(request);
|
|
47
47
|
};
|
|
48
48
|
return handler;
|
package/svelte.mjs
CHANGED
package/workflow.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { af as AsyncStepFunction, a8 as DisabledWorkflowContext, F as FailureFunctionPayload, ai as FinishCondition, ak as LogLevel, ah as ParallelCallState, ad as RawStep, aj as RequiredExceptFields, a2 as RouteFunction, S as Step, ag as StepFunction, ac as StepType, ab as StepTypes, ae as SyncStepFunction, a4 as Workflow, a9 as WorkflowClient, a7 as WorkflowContext, am as WorkflowLogger, al as WorkflowLoggerOptions, aa as WorkflowReceiver, a3 as WorkflowServeOptions, a5 as processOptions, a6 as serve } from './client-
|
|
1
|
+
export { af as AsyncStepFunction, a8 as DisabledWorkflowContext, F as FailureFunctionPayload, ai as FinishCondition, ak as LogLevel, ah as ParallelCallState, ad as RawStep, aj as RequiredExceptFields, a2 as RouteFunction, S as Step, ag as StepFunction, ac as StepType, ab as StepTypes, ae as SyncStepFunction, a4 as Workflow, a9 as WorkflowClient, a7 as WorkflowContext, am as WorkflowLogger, al as WorkflowLoggerOptions, aa as WorkflowReceiver, a3 as WorkflowServeOptions, a5 as processOptions, a6 as serve } from './client-BsCzCprQ.mjs';
|
|
2
2
|
import 'neverthrow';
|
package/workflow.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { af as AsyncStepFunction, a8 as DisabledWorkflowContext, F as FailureFunctionPayload, ai as FinishCondition, ak as LogLevel, ah as ParallelCallState, ad as RawStep, aj as RequiredExceptFields, a2 as RouteFunction, S as Step, ag as StepFunction, ac as StepType, ab as StepTypes, ae as SyncStepFunction, a4 as Workflow, a9 as WorkflowClient, a7 as WorkflowContext, am as WorkflowLogger, al as WorkflowLoggerOptions, aa as WorkflowReceiver, a3 as WorkflowServeOptions, a5 as processOptions, a6 as serve } from './client-
|
|
1
|
+
export { af as AsyncStepFunction, a8 as DisabledWorkflowContext, F as FailureFunctionPayload, ai as FinishCondition, ak as LogLevel, ah as ParallelCallState, ad as RawStep, aj as RequiredExceptFields, a2 as RouteFunction, S as Step, ag as StepFunction, ac as StepType, ab as StepTypes, ae as SyncStepFunction, a4 as Workflow, a9 as WorkflowClient, a7 as WorkflowContext, am as WorkflowLogger, al as WorkflowLoggerOptions, aa as WorkflowReceiver, a3 as WorkflowServeOptions, a5 as processOptions, a6 as serve } from './client-BsCzCprQ.js';
|
|
2
2
|
import 'neverthrow';
|
package/workflow.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _chunkXY54CU56js = require('./chunk-XY54CU56.js');
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
@@ -15,4 +15,4 @@ var _chunkWQZ4U6LJjs = require('./chunk-WQZ4U6LJ.js');
|
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
exports.DisabledWorkflowContext =
|
|
18
|
+
exports.DisabledWorkflowContext = _chunkXY54CU56js.DisabledWorkflowContext; exports.StepTypes = _chunkXY54CU56js.StepTypes; exports.Workflow = _chunkXY54CU56js.Workflow; exports.WorkflowContext = _chunkXY54CU56js.WorkflowContext; exports.WorkflowLogger = _chunkXY54CU56js.WorkflowLogger; exports.processOptions = _chunkXY54CU56js.processOptions; exports.serve = _chunkXY54CU56js.serve;
|
package/workflow.mjs
CHANGED
|
File without changes
|
|
File without changes
|