@workflow/world-testing 4.1.0-beta.69 → 4.1.0-beta.70
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.
|
@@ -2730,7 +2730,7 @@ var require_token_util = __commonJS({
|
|
|
2730
2730
|
getTokenPayload: /* @__PURE__ */ __name(() => getTokenPayload, "getTokenPayload"),
|
|
2731
2731
|
getVercelCliToken: /* @__PURE__ */ __name(() => getVercelCliToken, "getVercelCliToken"),
|
|
2732
2732
|
getVercelDataDir: /* @__PURE__ */ __name(() => getVercelDataDir, "getVercelDataDir"),
|
|
2733
|
-
getVercelOidcToken: /* @__PURE__ */ __name(() =>
|
|
2733
|
+
getVercelOidcToken: /* @__PURE__ */ __name(() => getVercelOidcToken6, "getVercelOidcToken"),
|
|
2734
2734
|
isExpired: /* @__PURE__ */ __name(() => isExpired, "isExpired"),
|
|
2735
2735
|
loadToken: /* @__PURE__ */ __name(() => loadToken, "loadToken"),
|
|
2736
2736
|
saveToken: /* @__PURE__ */ __name(() => saveToken, "saveToken")
|
|
@@ -2765,7 +2765,7 @@ var require_token_util = __commonJS({
|
|
|
2765
2765
|
return JSON.parse(token).token;
|
|
2766
2766
|
}
|
|
2767
2767
|
__name(getVercelCliToken, "getVercelCliToken");
|
|
2768
|
-
async function
|
|
2768
|
+
async function getVercelOidcToken6(authToken, projectId, teamId) {
|
|
2769
2769
|
try {
|
|
2770
2770
|
const url2 = `https://api.vercel.com/v1/projects/${projectId}/token?source=vercel-oidc-refresh${teamId ? `&teamId=${teamId}` : ""}`;
|
|
2771
2771
|
const res = await fetch(url2, {
|
|
@@ -2786,7 +2786,7 @@ var require_token_util = __commonJS({
|
|
|
2786
2786
|
throw new import_token_error.VercelOidcTokenError(`Failed to refresh OIDC token`, e);
|
|
2787
2787
|
}
|
|
2788
2788
|
}
|
|
2789
|
-
__name(
|
|
2789
|
+
__name(getVercelOidcToken6, "getVercelOidcToken");
|
|
2790
2790
|
function assertVercelOidcTokenResponse(res) {
|
|
2791
2791
|
if (!res || typeof res !== "object") {
|
|
2792
2792
|
throw new TypeError("Expected an object");
|
|
@@ -2950,13 +2950,13 @@ var require_get_vercel_oidc_token = __commonJS({
|
|
|
2950
2950
|
var __toCommonJS2 = /* @__PURE__ */ __name((mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod), "__toCommonJS");
|
|
2951
2951
|
var get_vercel_oidc_token_exports = {};
|
|
2952
2952
|
__export2(get_vercel_oidc_token_exports, {
|
|
2953
|
-
getVercelOidcToken: /* @__PURE__ */ __name(() =>
|
|
2953
|
+
getVercelOidcToken: /* @__PURE__ */ __name(() => getVercelOidcToken6, "getVercelOidcToken"),
|
|
2954
2954
|
getVercelOidcTokenSync: /* @__PURE__ */ __name(() => getVercelOidcTokenSync2, "getVercelOidcTokenSync")
|
|
2955
2955
|
});
|
|
2956
2956
|
module2.exports = __toCommonJS2(get_vercel_oidc_token_exports);
|
|
2957
2957
|
var import_get_context = require_get_context();
|
|
2958
2958
|
var import_token_error = require_token_error();
|
|
2959
|
-
async function
|
|
2959
|
+
async function getVercelOidcToken6() {
|
|
2960
2960
|
let token = "";
|
|
2961
2961
|
let err;
|
|
2962
2962
|
try {
|
|
@@ -2982,7 +2982,7 @@ ${error48.message}`;
|
|
|
2982
2982
|
}
|
|
2983
2983
|
return token;
|
|
2984
2984
|
}
|
|
2985
|
-
__name(
|
|
2985
|
+
__name(getVercelOidcToken6, "getVercelOidcToken");
|
|
2986
2986
|
function getVercelOidcTokenSync2() {
|
|
2987
2987
|
const token = (0, import_get_context.getContext)().headers?.["x-vercel-oidc-token"] ?? process.env.VERCEL_OIDC_TOKEN;
|
|
2988
2988
|
if (!token) {
|
|
@@ -28043,7 +28043,7 @@ var require_token_util2 = __commonJS({
|
|
|
28043
28043
|
findProjectInfo: /* @__PURE__ */ __name(() => findProjectInfo, "findProjectInfo"),
|
|
28044
28044
|
getTokenPayload: /* @__PURE__ */ __name(() => getTokenPayload, "getTokenPayload"),
|
|
28045
28045
|
getVercelDataDir: /* @__PURE__ */ __name(() => getVercelDataDir, "getVercelDataDir"),
|
|
28046
|
-
getVercelOidcToken: /* @__PURE__ */ __name(() =>
|
|
28046
|
+
getVercelOidcToken: /* @__PURE__ */ __name(() => getVercelOidcToken6, "getVercelOidcToken"),
|
|
28047
28047
|
getVercelToken: /* @__PURE__ */ __name(() => getVercelToken2, "getVercelToken"),
|
|
28048
28048
|
isExpired: /* @__PURE__ */ __name(() => isExpired, "isExpired"),
|
|
28049
28049
|
loadToken: /* @__PURE__ */ __name(() => loadToken, "loadToken"),
|
|
@@ -28105,7 +28105,7 @@ var require_token_util2 = __commonJS({
|
|
|
28105
28105
|
}
|
|
28106
28106
|
}
|
|
28107
28107
|
__name(getVercelToken2, "getVercelToken");
|
|
28108
|
-
async function
|
|
28108
|
+
async function getVercelOidcToken6(authToken, projectId, teamId) {
|
|
28109
28109
|
const url2 = `https://api.vercel.com/v1/projects/${projectId}/token?source=vercel-oidc-refresh${teamId ? `&teamId=${teamId}` : ""}`;
|
|
28110
28110
|
const res = await fetch(url2, {
|
|
28111
28111
|
method: "POST",
|
|
@@ -28122,7 +28122,7 @@ var require_token_util2 = __commonJS({
|
|
|
28122
28122
|
assertVercelOidcTokenResponse(tokenRes);
|
|
28123
28123
|
return tokenRes;
|
|
28124
28124
|
}
|
|
28125
|
-
__name(
|
|
28125
|
+
__name(getVercelOidcToken6, "getVercelOidcToken");
|
|
28126
28126
|
function assertVercelOidcTokenResponse(res) {
|
|
28127
28127
|
if (!res || typeof res !== "object") {
|
|
28128
28128
|
throw new TypeError(
|
|
@@ -28297,13 +28297,13 @@ var require_get_vercel_oidc_token2 = __commonJS({
|
|
|
28297
28297
|
var __toCommonJS2 = /* @__PURE__ */ __name((mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod), "__toCommonJS");
|
|
28298
28298
|
var get_vercel_oidc_token_exports = {};
|
|
28299
28299
|
__export2(get_vercel_oidc_token_exports, {
|
|
28300
|
-
getVercelOidcToken: /* @__PURE__ */ __name(() =>
|
|
28300
|
+
getVercelOidcToken: /* @__PURE__ */ __name(() => getVercelOidcToken6, "getVercelOidcToken"),
|
|
28301
28301
|
getVercelOidcTokenSync: /* @__PURE__ */ __name(() => getVercelOidcTokenSync2, "getVercelOidcTokenSync")
|
|
28302
28302
|
});
|
|
28303
28303
|
module2.exports = __toCommonJS2(get_vercel_oidc_token_exports);
|
|
28304
28304
|
var import_get_context = require_get_context2();
|
|
28305
28305
|
var import_token_error = require_token_error2();
|
|
28306
|
-
async function
|
|
28306
|
+
async function getVercelOidcToken6(options) {
|
|
28307
28307
|
let token = "";
|
|
28308
28308
|
let err;
|
|
28309
28309
|
try {
|
|
@@ -28333,7 +28333,7 @@ ${error48.message}`;
|
|
|
28333
28333
|
}
|
|
28334
28334
|
return token;
|
|
28335
28335
|
}
|
|
28336
|
-
__name(
|
|
28336
|
+
__name(getVercelOidcToken6, "getVercelOidcToken");
|
|
28337
28337
|
function getVercelOidcTokenSync2() {
|
|
28338
28338
|
const token = (0, import_get_context.getContext)().headers?.["x-vercel-oidc-token"] ?? process.env.VERCEL_OIDC_TOKEN;
|
|
28339
28339
|
if (!token) {
|
|
@@ -49017,17 +49017,86 @@ var LOCAL_QUEUE_MAX_VISIBILITY = parseInt(process.env.WORKFLOW_LOCAL_QUEUE_MAX_V
|
|
|
49017
49017
|
var MAX_SAFE_TIMEOUT_MS = 2147483647;
|
|
49018
49018
|
var DEFAULT_CONCURRENCY_LIMIT = 1e3;
|
|
49019
49019
|
var WORKFLOW_LOCAL_QUEUE_CONCURRENCY = parseInt(process.env.WORKFLOW_LOCAL_QUEUE_CONCURRENCY ?? "0", 10) || DEFAULT_CONCURRENCY_LIMIT;
|
|
49020
|
-
function
|
|
49020
|
+
function getQueueRoute(queueName) {
|
|
49021
|
+
if (queueName.startsWith("__wkf_step_")) {
|
|
49022
|
+
return { pathname: "step", prefix: "__wkf_step_" };
|
|
49023
|
+
}
|
|
49024
|
+
if (queueName.startsWith("__wkf_workflow_")) {
|
|
49025
|
+
return { pathname: "flow", prefix: "__wkf_workflow_" };
|
|
49026
|
+
}
|
|
49027
|
+
throw new Error("Unknown queue name prefix");
|
|
49028
|
+
}
|
|
49029
|
+
__name(getQueueRoute, "getQueueRoute");
|
|
49030
|
+
function createQueueExecutor(config3) {
|
|
49021
49031
|
const httpAgent = new import_undici.Agent({
|
|
49022
49032
|
headersTimeout: 0,
|
|
49023
49033
|
connections: 1e3,
|
|
49024
49034
|
keepAliveTimeout: 3e4
|
|
49025
49035
|
});
|
|
49036
|
+
const directHandlers = /* @__PURE__ */ new Map();
|
|
49037
|
+
const executeMessage = /* @__PURE__ */ __name(async ({ queueName, messageId, attempt, body, headers: extraHeaders }) => {
|
|
49038
|
+
const { pathname, prefix } = getQueueRoute(queueName);
|
|
49039
|
+
const headers = {
|
|
49040
|
+
...extraHeaders,
|
|
49041
|
+
"content-type": "application/json",
|
|
49042
|
+
"x-vqs-queue-name": queueName,
|
|
49043
|
+
"x-vqs-message-id": messageId,
|
|
49044
|
+
"x-vqs-message-attempt": String(attempt)
|
|
49045
|
+
};
|
|
49046
|
+
const directHandler = directHandlers.get(prefix);
|
|
49047
|
+
let response;
|
|
49048
|
+
if (directHandler) {
|
|
49049
|
+
const req = new Request("http://localhost/.well-known/workflow/v1/" + pathname, {
|
|
49050
|
+
method: "POST",
|
|
49051
|
+
headers,
|
|
49052
|
+
body
|
|
49053
|
+
});
|
|
49054
|
+
response = await directHandler(req);
|
|
49055
|
+
} else {
|
|
49056
|
+
const baseUrl = await resolveBaseUrl(config3);
|
|
49057
|
+
response = await fetch(`${baseUrl}/.well-known/workflow/v1/${pathname}`, {
|
|
49058
|
+
method: "POST",
|
|
49059
|
+
duplex: "half",
|
|
49060
|
+
dispatcher: httpAgent,
|
|
49061
|
+
headers,
|
|
49062
|
+
body
|
|
49063
|
+
});
|
|
49064
|
+
}
|
|
49065
|
+
const text = await response.text();
|
|
49066
|
+
if (!response.ok) {
|
|
49067
|
+
return {
|
|
49068
|
+
type: "error",
|
|
49069
|
+
status: response.status,
|
|
49070
|
+
text,
|
|
49071
|
+
headers: Object.fromEntries(response.headers.entries())
|
|
49072
|
+
};
|
|
49073
|
+
}
|
|
49074
|
+
try {
|
|
49075
|
+
const timeoutSeconds = Number(JSON.parse(text).timeoutSeconds);
|
|
49076
|
+
if (Number.isFinite(timeoutSeconds) && timeoutSeconds >= 0) {
|
|
49077
|
+
return { type: "reschedule", timeoutSeconds };
|
|
49078
|
+
}
|
|
49079
|
+
} catch {
|
|
49080
|
+
}
|
|
49081
|
+
return { type: "completed" };
|
|
49082
|
+
}, "executeMessage");
|
|
49083
|
+
return {
|
|
49084
|
+
executeMessage,
|
|
49085
|
+
registerHandler(prefix, handler) {
|
|
49086
|
+
directHandlers.set(prefix, handler);
|
|
49087
|
+
},
|
|
49088
|
+
async close() {
|
|
49089
|
+
await httpAgent.close();
|
|
49090
|
+
}
|
|
49091
|
+
};
|
|
49092
|
+
}
|
|
49093
|
+
__name(createQueueExecutor, "createQueueExecutor");
|
|
49094
|
+
function createQueue(config3) {
|
|
49095
|
+
const executor = createQueueExecutor(config3);
|
|
49026
49096
|
const transport = new JsonTransport();
|
|
49027
49097
|
const generateId2 = monotonicFactory();
|
|
49028
49098
|
const semaphore = new import_async_sema.Sema(WORKFLOW_LOCAL_QUEUE_CONCURRENCY);
|
|
49029
49099
|
const inflightMessages = /* @__PURE__ */ new Map();
|
|
49030
|
-
const directHandlers = /* @__PURE__ */ new Map();
|
|
49031
49100
|
const queue = /* @__PURE__ */ __name(async (queueName, message, opts) => {
|
|
49032
49101
|
const cleanup = [];
|
|
49033
49102
|
if (opts?.idempotencyKey) {
|
|
@@ -49037,17 +49106,7 @@ function createQueue(config3) {
|
|
|
49037
49106
|
}
|
|
49038
49107
|
}
|
|
49039
49108
|
const body = transport.serialize(message);
|
|
49040
|
-
|
|
49041
|
-
let prefix;
|
|
49042
|
-
if (queueName.startsWith("__wkf_step_")) {
|
|
49043
|
-
pathname = `step`;
|
|
49044
|
-
prefix = "__wkf_step_";
|
|
49045
|
-
} else if (queueName.startsWith("__wkf_workflow_")) {
|
|
49046
|
-
pathname = `flow`;
|
|
49047
|
-
prefix = "__wkf_workflow_";
|
|
49048
|
-
} else {
|
|
49049
|
-
throw new Error("Unknown queue name prefix");
|
|
49050
|
-
}
|
|
49109
|
+
getQueueRoute(queueName);
|
|
49051
49110
|
const messageId = MessageId.parse(`msg_${generateId2()}`);
|
|
49052
49111
|
if (opts?.idempotencyKey) {
|
|
49053
49112
|
const key = opts.idempotencyKey;
|
|
@@ -49064,55 +49123,31 @@ function createQueue(config3) {
|
|
|
49064
49123
|
}
|
|
49065
49124
|
try {
|
|
49066
49125
|
let defaultRetriesLeft = 3;
|
|
49067
|
-
const directHandler = directHandlers.get(prefix);
|
|
49068
49126
|
for (let attempt = 0; defaultRetriesLeft > 0; attempt++) {
|
|
49069
49127
|
defaultRetriesLeft--;
|
|
49070
|
-
|
|
49071
|
-
|
|
49072
|
-
|
|
49073
|
-
|
|
49074
|
-
|
|
49075
|
-
|
|
49076
|
-
|
|
49077
|
-
|
|
49078
|
-
|
|
49079
|
-
const req = new Request("http://localhost/.well-known/workflow/v1/" + pathname, {
|
|
49080
|
-
method: "POST",
|
|
49081
|
-
headers,
|
|
49082
|
-
body
|
|
49083
|
-
});
|
|
49084
|
-
response = await directHandler(req);
|
|
49085
|
-
} else {
|
|
49086
|
-
const baseUrl = await resolveBaseUrl(config3);
|
|
49087
|
-
response = await fetch(`${baseUrl}/.well-known/workflow/v1/${pathname}`, {
|
|
49088
|
-
method: "POST",
|
|
49089
|
-
duplex: "half",
|
|
49090
|
-
dispatcher: httpAgent,
|
|
49091
|
-
headers,
|
|
49092
|
-
body
|
|
49093
|
-
});
|
|
49128
|
+
const result = await executor.executeMessage({
|
|
49129
|
+
queueName,
|
|
49130
|
+
messageId,
|
|
49131
|
+
attempt: attempt + 1,
|
|
49132
|
+
body,
|
|
49133
|
+
headers: opts?.headers
|
|
49134
|
+
});
|
|
49135
|
+
if (result.type === "completed") {
|
|
49136
|
+
return;
|
|
49094
49137
|
}
|
|
49095
|
-
|
|
49096
|
-
|
|
49097
|
-
|
|
49098
|
-
|
|
49099
|
-
if (Number.isFinite(timeoutSeconds) && timeoutSeconds >= 0) {
|
|
49100
|
-
if (timeoutSeconds > 0) {
|
|
49101
|
-
const timeoutMs = Math.min(timeoutSeconds * 1e3, MAX_SAFE_TIMEOUT_MS);
|
|
49102
|
-
await (0, import_promises3.setTimeout)(timeoutMs);
|
|
49103
|
-
}
|
|
49104
|
-
defaultRetriesLeft++;
|
|
49105
|
-
continue;
|
|
49106
|
-
}
|
|
49107
|
-
} catch {
|
|
49138
|
+
if (result.type === "reschedule") {
|
|
49139
|
+
if (result.timeoutSeconds > 0) {
|
|
49140
|
+
const timeoutMs = Math.min(result.timeoutSeconds * 1e3, MAX_SAFE_TIMEOUT_MS);
|
|
49141
|
+
await (0, import_promises3.setTimeout)(timeoutMs);
|
|
49108
49142
|
}
|
|
49109
|
-
|
|
49143
|
+
defaultRetriesLeft++;
|
|
49144
|
+
continue;
|
|
49110
49145
|
}
|
|
49111
49146
|
console.error(`[local world] Failed to queue message`, {
|
|
49112
49147
|
queueName,
|
|
49113
|
-
text,
|
|
49114
|
-
status:
|
|
49115
|
-
headers:
|
|
49148
|
+
text: result.text,
|
|
49149
|
+
status: result.status,
|
|
49150
|
+
headers: result.headers,
|
|
49116
49151
|
body: body.toString()
|
|
49117
49152
|
});
|
|
49118
49153
|
}
|
|
@@ -49175,11 +49210,9 @@ function createQueue(config3) {
|
|
|
49175
49210
|
queue,
|
|
49176
49211
|
createQueueHandler,
|
|
49177
49212
|
getDeploymentId,
|
|
49178
|
-
registerHandler
|
|
49179
|
-
directHandlers.set(prefix, handler);
|
|
49180
|
-
},
|
|
49213
|
+
registerHandler: executor.registerHandler,
|
|
49181
49214
|
async close() {
|
|
49182
|
-
await
|
|
49215
|
+
await executor.close();
|
|
49183
49216
|
}
|
|
49184
49217
|
};
|
|
49185
49218
|
}
|
|
@@ -53112,7 +53145,7 @@ var RpcService3 = SemanticConvention3("rpc.service");
|
|
|
53112
53145
|
var RpcMethod3 = SemanticConvention3("rpc.method");
|
|
53113
53146
|
|
|
53114
53147
|
// ../world-vercel/dist/version.js
|
|
53115
|
-
var version2 = "4.1.0-beta.
|
|
53148
|
+
var version2 = "4.1.0-beta.43";
|
|
53116
53149
|
|
|
53117
53150
|
// ../world-vercel/dist/utils.js
|
|
53118
53151
|
var WORKFLOW_SERVER_URL_OVERRIDE = "";
|
|
@@ -53440,6 +53473,50 @@ function createQueue2(config3) {
|
|
|
53440
53473
|
}
|
|
53441
53474
|
__name(createQueue2, "createQueue");
|
|
53442
53475
|
|
|
53476
|
+
// ../world-vercel/dist/resolve-latest-deployment.js
|
|
53477
|
+
var import_oidc4 = __toESM(require_dist2(), 1);
|
|
53478
|
+
var ResolveLatestDeploymentResponseSchema = object({
|
|
53479
|
+
id: string2()
|
|
53480
|
+
});
|
|
53481
|
+
function createResolveLatestDeploymentId(config3) {
|
|
53482
|
+
return /* @__PURE__ */ __name(async function resolveLatestDeploymentId() {
|
|
53483
|
+
const currentDeploymentId = process.env.VERCEL_DEPLOYMENT_ID;
|
|
53484
|
+
if (!currentDeploymentId) {
|
|
53485
|
+
throw new Error("Cannot resolve latest deployment: VERCEL_DEPLOYMENT_ID environment variable is not set");
|
|
53486
|
+
}
|
|
53487
|
+
const oidcToken = await (0, import_oidc4.getVercelOidcToken)().catch(() => null);
|
|
53488
|
+
const token = config3?.token ?? oidcToken ?? process.env.VERCEL_TOKEN;
|
|
53489
|
+
if (!token) {
|
|
53490
|
+
throw new Error("Cannot resolve latest deployment: no OIDC token or VERCEL_TOKEN available");
|
|
53491
|
+
}
|
|
53492
|
+
const url2 = `https://api.vercel.com/v1/workflow/resolve-latest-deployment/${encodeURIComponent(currentDeploymentId)}`;
|
|
53493
|
+
const response = await fetch(url2, {
|
|
53494
|
+
method: "GET",
|
|
53495
|
+
headers: {
|
|
53496
|
+
authorization: `Bearer ${token}`
|
|
53497
|
+
},
|
|
53498
|
+
// @ts-expect-error -- undici dispatcher is accepted by Node.js fetch but not in @types/node's RequestInit
|
|
53499
|
+
dispatcher: getDispatcher()
|
|
53500
|
+
});
|
|
53501
|
+
if (!response.ok) {
|
|
53502
|
+
let body;
|
|
53503
|
+
try {
|
|
53504
|
+
body = await response.text();
|
|
53505
|
+
} catch {
|
|
53506
|
+
body = "<unable to read response body>";
|
|
53507
|
+
}
|
|
53508
|
+
throw new Error(`Failed to resolve latest deployment for ${currentDeploymentId}: HTTP ${response.status} ${response.statusText}${body ? ` \u2014 ${body}` : ""}`);
|
|
53509
|
+
}
|
|
53510
|
+
const data = await response.json();
|
|
53511
|
+
const result = ResolveLatestDeploymentResponseSchema.safeParse(data);
|
|
53512
|
+
if (!result.success) {
|
|
53513
|
+
throw new Error(`Invalid response from Vercel API: expected { id: string }. Zod error: ${result.error.message}`);
|
|
53514
|
+
}
|
|
53515
|
+
return result.data.id;
|
|
53516
|
+
}, "resolveLatestDeploymentId");
|
|
53517
|
+
}
|
|
53518
|
+
__name(createResolveLatestDeploymentId, "createResolveLatestDeploymentId");
|
|
53519
|
+
|
|
53443
53520
|
// ../world-vercel/dist/refs.js
|
|
53444
53521
|
function isRefDescriptor(value) {
|
|
53445
53522
|
return typeof value === "object" && value !== null && "_type" in value && "_ref" in value && typeof value._ref === "string" && value._type === "RemoteRef";
|
|
@@ -53605,7 +53682,7 @@ async function getWorkflowRun(id, params, config3) {
|
|
|
53605
53682
|
const searchParams = new URLSearchParams();
|
|
53606
53683
|
searchParams.set("remoteRefBehavior", remoteRefBehavior);
|
|
53607
53684
|
const queryString = searchParams.toString();
|
|
53608
|
-
const endpoint = `/v2/runs/${id}${queryString ? `?${queryString}` : ""}`;
|
|
53685
|
+
const endpoint = `/v2/runs/${encodeURIComponent(id)}${queryString ? `?${queryString}` : ""}`;
|
|
53609
53686
|
try {
|
|
53610
53687
|
const run = await makeRequest({
|
|
53611
53688
|
endpoint,
|
|
@@ -53628,7 +53705,7 @@ async function cancelWorkflowRunV1(id, params, config3) {
|
|
|
53628
53705
|
const searchParams = new URLSearchParams();
|
|
53629
53706
|
searchParams.set("remoteRefBehavior", remoteRefBehavior);
|
|
53630
53707
|
const queryString = searchParams.toString();
|
|
53631
|
-
const endpoint = `/v1/runs/${id}/cancel${queryString ? `?${queryString}` : ""}`;
|
|
53708
|
+
const endpoint = `/v1/runs/${encodeURIComponent(id)}/cancel${queryString ? `?${queryString}` : ""}`;
|
|
53632
53709
|
try {
|
|
53633
53710
|
const run = await makeRequest({
|
|
53634
53711
|
endpoint,
|
|
@@ -53732,7 +53809,7 @@ async function listWorkflowRunSteps(params, config3) {
|
|
|
53732
53809
|
const remoteRefBehavior = resolveData === "none" ? "lazy" : "resolve";
|
|
53733
53810
|
searchParams.set("remoteRefBehavior", remoteRefBehavior);
|
|
53734
53811
|
const queryString = searchParams.toString();
|
|
53735
|
-
const endpoint = `/v2/runs/${runId}/steps${queryString ? `?${queryString}` : ""}`;
|
|
53812
|
+
const endpoint = `/v2/runs/${encodeURIComponent(runId)}/steps${queryString ? `?${queryString}` : ""}`;
|
|
53736
53813
|
const response = await makeRequest({
|
|
53737
53814
|
endpoint,
|
|
53738
53815
|
options: { method: "GET" },
|
|
@@ -53751,7 +53828,7 @@ async function getStep(runId, stepId, params, config3) {
|
|
|
53751
53828
|
const searchParams = new URLSearchParams();
|
|
53752
53829
|
searchParams.set("remoteRefBehavior", remoteRefBehavior);
|
|
53753
53830
|
const queryString = searchParams.toString();
|
|
53754
|
-
const endpoint = runId ? `/v2/runs/${runId}/steps/${stepId}${queryString ? `?${queryString}` : ""}` : `/v2/steps/${stepId}${queryString ? `?${queryString}` : ""}`;
|
|
53831
|
+
const endpoint = runId ? `/v2/runs/${encodeURIComponent(runId)}/steps/${encodeURIComponent(stepId)}${queryString ? `?${queryString}` : ""}` : `/v2/steps/${encodeURIComponent(stepId)}${queryString ? `?${queryString}` : ""}`;
|
|
53755
53832
|
const step = await makeRequest({
|
|
53756
53833
|
endpoint,
|
|
53757
53834
|
options: { method: "GET" },
|
|
@@ -53894,7 +53971,7 @@ async function getEvent(runId, eventId, params, config3) {
|
|
|
53894
53971
|
const searchParams = new URLSearchParams();
|
|
53895
53972
|
searchParams.set("remoteRefBehavior", remoteRefBehavior);
|
|
53896
53973
|
const queryString = searchParams.toString();
|
|
53897
|
-
const endpoint = `/v2/runs/${runId}/events/${eventId}${queryString ? `?${queryString}` : ""}`;
|
|
53974
|
+
const endpoint = `/v2/runs/${encodeURIComponent(runId)}/events/${encodeURIComponent(eventId)}${queryString ? `?${queryString}` : ""}`;
|
|
53898
53975
|
const event = await makeRequest({
|
|
53899
53976
|
endpoint,
|
|
53900
53977
|
options: { method: "GET" },
|
|
@@ -53928,7 +54005,7 @@ async function getWorkflowRunEvents(params, config3) {
|
|
|
53928
54005
|
searchParams.set("remoteRefBehavior", "lazy");
|
|
53929
54006
|
const queryString = searchParams.toString();
|
|
53930
54007
|
const query = queryString ? `?${queryString}` : "";
|
|
53931
|
-
const endpoint = correlationId ? `/v2/events${query}` : `/v2/runs/${runId}/events${query}`;
|
|
54008
|
+
const endpoint = correlationId ? `/v2/events${query}` : `/v2/runs/${encodeURIComponent(runId)}/events${query}`;
|
|
53932
54009
|
let refResolveConcurrency;
|
|
53933
54010
|
const response = await makeRequest({
|
|
53934
54011
|
endpoint,
|
|
@@ -53980,7 +54057,7 @@ async function createWorkflowRunEvent(id, data, params, config3) {
|
|
|
53980
54057
|
return { run };
|
|
53981
54058
|
}
|
|
53982
54059
|
const wireResult2 = await makeRequest({
|
|
53983
|
-
endpoint: `/v1/runs/${id}/events`,
|
|
54060
|
+
endpoint: `/v1/runs/${encodeURIComponent(id)}/events`,
|
|
53984
54061
|
options: { method: "POST" },
|
|
53985
54062
|
data,
|
|
53986
54063
|
config: config3,
|
|
@@ -53994,7 +54071,7 @@ async function createWorkflowRunEvent(id, data, params, config3) {
|
|
|
53994
54071
|
throw new WorkflowAPIError(validationError, { status: 400 });
|
|
53995
54072
|
}
|
|
53996
54073
|
}
|
|
53997
|
-
const runIdPath = id === null ? "null" : id;
|
|
54074
|
+
const runIdPath = id === null ? "null" : encodeURIComponent(id);
|
|
53998
54075
|
const remoteRefBehavior = eventsNeedingResolve.has(data.eventType) ? "resolve" : "lazy";
|
|
53999
54076
|
if (remoteRefBehavior === "resolve") {
|
|
54000
54077
|
const wireResult2 = await makeRequest({
|
|
@@ -54070,7 +54147,7 @@ async function listHooks(params, config3) {
|
|
|
54070
54147
|
__name(listHooks, "listHooks");
|
|
54071
54148
|
async function getHook(hookId, params, config3) {
|
|
54072
54149
|
const resolveData = params?.resolveData || "all";
|
|
54073
|
-
const endpoint = `/v2/hooks/${hookId}`;
|
|
54150
|
+
const endpoint = `/v2/hooks/${encodeURIComponent(hookId)}`;
|
|
54074
54151
|
const hook = await makeRequest({
|
|
54075
54152
|
endpoint,
|
|
54076
54153
|
options: { method: "GET" },
|
|
@@ -54183,7 +54260,7 @@ __name(createStorage2, "createStorage");
|
|
|
54183
54260
|
// ../world-vercel/dist/streamer.js
|
|
54184
54261
|
function getStreamUrl(name, runId, httpConfig) {
|
|
54185
54262
|
if (runId) {
|
|
54186
|
-
return new URL(`${httpConfig.baseUrl}/v2/runs/${runId}/stream/${encodeURIComponent(name)}`);
|
|
54263
|
+
return new URL(`${httpConfig.baseUrl}/v2/runs/${encodeURIComponent(runId)}/stream/${encodeURIComponent(name)}`);
|
|
54187
54264
|
}
|
|
54188
54265
|
return new URL(`${httpConfig.baseUrl}/v2/stream/${encodeURIComponent(name)}`);
|
|
54189
54266
|
}
|
|
@@ -54264,7 +54341,7 @@ function createStreamer2(config3) {
|
|
|
54264
54341
|
},
|
|
54265
54342
|
async listStreamsByRunId(runId) {
|
|
54266
54343
|
const httpConfig = await getHttpConfig(config3);
|
|
54267
|
-
const url2 = new URL(`${httpConfig.baseUrl}/v2/runs/${runId}/streams`);
|
|
54344
|
+
const url2 = new URL(`${httpConfig.baseUrl}/v2/runs/${encodeURIComponent(runId)}/streams`);
|
|
54268
54345
|
const response = await fetch(url2, {
|
|
54269
54346
|
headers: httpConfig.headers
|
|
54270
54347
|
});
|
|
@@ -54284,7 +54361,8 @@ function createVercelWorld(config3) {
|
|
|
54284
54361
|
...createQueue2(config3),
|
|
54285
54362
|
...createStorage2(config3),
|
|
54286
54363
|
...createStreamer2(config3),
|
|
54287
|
-
getEncryptionKeyForRun: createGetEncryptionKeyForRun(projectId, config3?.projectConfig?.teamId, config3?.token)
|
|
54364
|
+
getEncryptionKeyForRun: createGetEncryptionKeyForRun(projectId, config3?.projectConfig?.teamId, config3?.token),
|
|
54365
|
+
resolveLatestDeploymentId: createResolveLatestDeploymentId(config3)
|
|
54288
54366
|
};
|
|
54289
54367
|
}
|
|
54290
54368
|
__name(createVercelWorld, "createVercelWorld");
|
|
@@ -59012,7 +59090,7 @@ function getWritable(options = {}) {
|
|
|
59012
59090
|
__name(getWritable, "getWritable");
|
|
59013
59091
|
|
|
59014
59092
|
// ../workflow/dist/stdlib.js
|
|
59015
|
-
var fetch = globalThis[/* @__PURE__ */ Symbol.for("WORKFLOW_USE_STEP")]("step//workflow@4.2.0-beta.
|
|
59093
|
+
var fetch = globalThis[/* @__PURE__ */ Symbol.for("WORKFLOW_USE_STEP")]("step//workflow@4.2.0-beta.69//fetch");
|
|
59016
59094
|
|
|
59017
59095
|
// ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/core.js
|
|
59018
59096
|
var NEVER = Object.freeze({
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": "1.0.0",
|
|
3
3
|
"steps": {
|
|
4
|
-
"workflow/dist/
|
|
5
|
-
"
|
|
6
|
-
"stepId": "
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
4
|
+
"workflow/dist/internal/builtins.js": {
|
|
5
|
+
"__builtin_response_array_buffer": {
|
|
6
|
+
"stepId": "__builtin_response_array_buffer"
|
|
7
|
+
},
|
|
8
|
+
"__builtin_response_json": {
|
|
9
|
+
"stepId": "__builtin_response_json"
|
|
10
|
+
},
|
|
11
|
+
"__builtin_response_text": {
|
|
12
|
+
"stepId": "__builtin_response_text"
|
|
12
13
|
}
|
|
13
14
|
},
|
|
14
15
|
"workflows/addition.ts": {
|
|
@@ -29,34 +30,33 @@
|
|
|
29
30
|
"stepId": "step//./workflows/retriable-and-fatal//stepThatThrowsRetryableError"
|
|
30
31
|
}
|
|
31
32
|
},
|
|
32
|
-
"workflow/dist/
|
|
33
|
-
"
|
|
34
|
-
"stepId": "
|
|
35
|
-
},
|
|
36
|
-
"__builtin_response_json": {
|
|
37
|
-
"stepId": "__builtin_response_json"
|
|
38
|
-
},
|
|
39
|
-
"__builtin_response_text": {
|
|
40
|
-
"stepId": "__builtin_response_text"
|
|
33
|
+
"workflow/dist/stdlib.js": {
|
|
34
|
+
"fetch": {
|
|
35
|
+
"stepId": "step//workflow@4.2.0-beta.69//fetch"
|
|
41
36
|
}
|
|
42
37
|
},
|
|
43
38
|
"workflows/noop.ts": {
|
|
44
39
|
"noop": {
|
|
45
40
|
"stepId": "step//./workflows/noop//noop"
|
|
46
41
|
}
|
|
42
|
+
},
|
|
43
|
+
"workflows/hooks.ts": {
|
|
44
|
+
"writeEvent": {
|
|
45
|
+
"stepId": "step//./workflows/hooks//writeEvent"
|
|
46
|
+
}
|
|
47
47
|
}
|
|
48
48
|
},
|
|
49
49
|
"workflows": {
|
|
50
|
-
"workflows/
|
|
51
|
-
"
|
|
52
|
-
"workflowId": "workflow//./workflows/
|
|
50
|
+
"workflows/addition.ts": {
|
|
51
|
+
"addition": {
|
|
52
|
+
"workflowId": "workflow//./workflows/addition//addition",
|
|
53
53
|
"graph": {
|
|
54
54
|
"nodes": [
|
|
55
55
|
{
|
|
56
56
|
"id": "start",
|
|
57
57
|
"type": "workflowStart",
|
|
58
58
|
"data": {
|
|
59
|
-
"label": "Start:
|
|
59
|
+
"label": "Start: addition",
|
|
60
60
|
"nodeKind": "workflow_start"
|
|
61
61
|
}
|
|
62
62
|
},
|
|
@@ -80,16 +80,16 @@
|
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
82
|
},
|
|
83
|
-
"workflows/
|
|
84
|
-
"
|
|
85
|
-
"workflowId": "workflow//./workflows/
|
|
83
|
+
"workflows/null-byte.ts": {
|
|
84
|
+
"nullByteWorkflow": {
|
|
85
|
+
"workflowId": "workflow//./workflows/null-byte//nullByteWorkflow",
|
|
86
86
|
"graph": {
|
|
87
87
|
"nodes": [
|
|
88
88
|
{
|
|
89
89
|
"id": "start",
|
|
90
90
|
"type": "workflowStart",
|
|
91
91
|
"data": {
|
|
92
|
-
"label": "Start:
|
|
92
|
+
"label": "Start: nullByteWorkflow",
|
|
93
93
|
"nodeKind": "workflow_start"
|
|
94
94
|
}
|
|
95
95
|
},
|
|
@@ -113,16 +113,16 @@
|
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
115
|
},
|
|
116
|
-
"workflows/
|
|
117
|
-
"
|
|
118
|
-
"workflowId": "workflow//./workflows/
|
|
116
|
+
"workflows/retriable-and-fatal.ts": {
|
|
117
|
+
"retryableAndFatalErrorWorkflow": {
|
|
118
|
+
"workflowId": "workflow//./workflows/retriable-and-fatal//retryableAndFatalErrorWorkflow",
|
|
119
119
|
"graph": {
|
|
120
120
|
"nodes": [
|
|
121
121
|
{
|
|
122
122
|
"id": "start",
|
|
123
123
|
"type": "workflowStart",
|
|
124
124
|
"data": {
|
|
125
|
-
"label": "Start:
|
|
125
|
+
"label": "Start: retryableAndFatalErrorWorkflow",
|
|
126
126
|
"nodeKind": "workflow_start"
|
|
127
127
|
}
|
|
128
128
|
},
|
|
@@ -146,16 +146,16 @@
|
|
|
146
146
|
}
|
|
147
147
|
}
|
|
148
148
|
},
|
|
149
|
-
"workflows/
|
|
150
|
-
"
|
|
151
|
-
"workflowId": "workflow//./workflows/
|
|
149
|
+
"workflows/noop.ts": {
|
|
150
|
+
"brokenWf": {
|
|
151
|
+
"workflowId": "workflow//./workflows/noop//brokenWf",
|
|
152
152
|
"graph": {
|
|
153
153
|
"nodes": [
|
|
154
154
|
{
|
|
155
155
|
"id": "start",
|
|
156
156
|
"type": "workflowStart",
|
|
157
157
|
"data": {
|
|
158
|
-
"label": "Start:
|
|
158
|
+
"label": "Start: brokenWf",
|
|
159
159
|
"nodeKind": "workflow_start"
|
|
160
160
|
}
|
|
161
161
|
},
|
|
@@ -179,16 +179,16 @@
|
|
|
179
179
|
}
|
|
180
180
|
}
|
|
181
181
|
},
|
|
182
|
-
"workflows/
|
|
183
|
-
"
|
|
184
|
-
"workflowId": "workflow//./workflows/
|
|
182
|
+
"workflows/hooks.ts": {
|
|
183
|
+
"collectWithHook": {
|
|
184
|
+
"workflowId": "workflow//./workflows/hooks//collectWithHook",
|
|
185
185
|
"graph": {
|
|
186
186
|
"nodes": [
|
|
187
187
|
{
|
|
188
188
|
"id": "start",
|
|
189
189
|
"type": "workflowStart",
|
|
190
190
|
"data": {
|
|
191
|
-
"label": "Start:
|
|
191
|
+
"label": "Start: collectWithHook",
|
|
192
192
|
"nodeKind": "workflow_start"
|
|
193
193
|
}
|
|
194
194
|
},
|