@trigger.dev/core 0.0.0-prerelease-20251218163312 → 0.0.0-prerelease-20260120115202
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commonjs/v3/apiClient/index.d.ts +3 -0
- package/dist/commonjs/v3/apiClient/index.js +7 -0
- package/dist/commonjs/v3/apiClient/index.js.map +1 -1
- package/dist/commonjs/v3/idempotency-key-catalog/catalog.d.ts +9 -0
- package/dist/commonjs/v3/idempotency-key-catalog/catalog.js +3 -0
- package/dist/commonjs/v3/idempotency-key-catalog/catalog.js.map +1 -0
- package/dist/commonjs/v3/idempotency-key-catalog/index.d.ts +9 -0
- package/dist/commonjs/v3/idempotency-key-catalog/index.js +33 -0
- package/dist/commonjs/v3/idempotency-key-catalog/index.js.map +1 -0
- package/dist/commonjs/v3/idempotency-key-catalog/lruIdempotencyKeyCatalog.d.ts +8 -0
- package/dist/commonjs/v3/idempotency-key-catalog/lruIdempotencyKeyCatalog.js +35 -0
- package/dist/commonjs/v3/idempotency-key-catalog/lruIdempotencyKeyCatalog.js.map +1 -0
- package/dist/commonjs/v3/idempotency-key-catalog/lruIdempotencyKeyCatalog.test.d.ts +1 -0
- package/dist/commonjs/v3/idempotency-key-catalog/lruIdempotencyKeyCatalog.test.js +161 -0
- package/dist/commonjs/v3/idempotency-key-catalog/lruIdempotencyKeyCatalog.test.js.map +1 -0
- package/dist/commonjs/v3/idempotency-key-catalog-api.d.ts +3 -0
- package/dist/commonjs/v3/idempotency-key-catalog-api.js +9 -0
- package/dist/commonjs/v3/idempotency-key-catalog-api.js.map +1 -0
- package/dist/commonjs/v3/idempotencyKeys.d.ts +54 -2
- package/dist/commonjs/v3/idempotencyKeys.js +101 -2
- package/dist/commonjs/v3/idempotencyKeys.js.map +1 -1
- package/dist/commonjs/v3/imports/superjson-cjs.cjs.map +1 -0
- package/dist/commonjs/v3/imports/superjson.d.ts +1 -0
- package/dist/commonjs/v3/imports/superjson.js +13 -0
- package/dist/commonjs/v3/runEngineWorker/supervisor/http.d.ts +61 -60
- package/dist/commonjs/v3/runEngineWorker/supervisor/schemas.d.ts +191 -184
- package/dist/commonjs/v3/runEngineWorker/workload/http.d.ts +46 -45
- package/dist/commonjs/v3/runEngineWorker/workload/schemas.d.ts +163 -156
- package/dist/commonjs/v3/schemas/api.d.ts +254 -56
- package/dist/commonjs/v3/schemas/api.js +17 -3
- package/dist/commonjs/v3/schemas/api.js.map +1 -1
- package/dist/commonjs/v3/schemas/checkpoints.d.ts +66 -66
- package/dist/commonjs/v3/schemas/common.d.ts +215 -177
- package/dist/commonjs/v3/schemas/common.js +6 -0
- package/dist/commonjs/v3/schemas/common.js.map +1 -1
- package/dist/commonjs/v3/schemas/messages.d.ts +2149 -2032
- package/dist/commonjs/v3/schemas/runEngine.d.ts +157 -150
- package/dist/commonjs/v3/schemas/schemas.d.ts +281 -262
- package/dist/commonjs/v3/schemas/webhooks.d.ts +68 -68
- package/dist/commonjs/v3/serverOnly/idempotencyKeys.d.ts +36 -0
- package/dist/commonjs/v3/serverOnly/idempotencyKeys.js +58 -0
- package/dist/commonjs/v3/serverOnly/idempotencyKeys.js.map +1 -0
- package/dist/commonjs/v3/serverOnly/index.d.ts +1 -0
- package/dist/commonjs/v3/serverOnly/index.js +1 -0
- package/dist/commonjs/v3/serverOnly/index.js.map +1 -1
- package/dist/commonjs/v3/utils/flattenAttributes.d.ts +2 -2
- package/dist/commonjs/v3/utils/flattenAttributes.js +24 -13
- package/dist/commonjs/v3/utils/flattenAttributes.js.map +1 -1
- package/dist/commonjs/v3/utils/globals.d.ts +2 -0
- package/dist/commonjs/v3/utils/globals.js.map +1 -1
- package/dist/commonjs/v3/utils/ioSerialization.js +15 -27
- package/dist/commonjs/v3/utils/ioSerialization.js.map +1 -1
- package/dist/commonjs/version.js +1 -1
- package/dist/esm/v3/apiClient/index.d.ts +3 -0
- package/dist/esm/v3/apiClient/index.js +8 -1
- package/dist/esm/v3/apiClient/index.js.map +1 -1
- package/dist/esm/v3/idempotency-key-catalog/catalog.d.ts +9 -0
- package/dist/esm/v3/idempotency-key-catalog/catalog.js +2 -0
- package/dist/esm/v3/idempotency-key-catalog/catalog.js.map +1 -0
- package/dist/esm/v3/idempotency-key-catalog/index.d.ts +9 -0
- package/dist/esm/v3/idempotency-key-catalog/index.js +29 -0
- package/dist/esm/v3/idempotency-key-catalog/index.js.map +1 -0
- package/dist/esm/v3/idempotency-key-catalog/lruIdempotencyKeyCatalog.d.ts +8 -0
- package/dist/esm/v3/idempotency-key-catalog/lruIdempotencyKeyCatalog.js +31 -0
- package/dist/esm/v3/idempotency-key-catalog/lruIdempotencyKeyCatalog.js.map +1 -0
- package/dist/esm/v3/idempotency-key-catalog/lruIdempotencyKeyCatalog.test.d.ts +1 -0
- package/dist/esm/v3/idempotency-key-catalog/lruIdempotencyKeyCatalog.test.js +159 -0
- package/dist/esm/v3/idempotency-key-catalog/lruIdempotencyKeyCatalog.test.js.map +1 -0
- package/dist/esm/v3/idempotency-key-catalog-api.d.ts +3 -0
- package/dist/esm/v3/idempotency-key-catalog-api.js +6 -0
- package/dist/esm/v3/idempotency-key-catalog-api.js.map +1 -0
- package/dist/esm/v3/idempotencyKeys.d.ts +54 -2
- package/dist/esm/v3/idempotencyKeys.js +99 -2
- package/dist/esm/v3/idempotencyKeys.js.map +1 -1
- package/dist/esm/v3/imports/superjson.d.ts +2 -0
- package/dist/esm/v3/imports/superjson.js +10 -0
- package/dist/esm/v3/imports/superjson.js.map +1 -0
- package/dist/esm/v3/runEngineWorker/supervisor/http.d.ts +61 -60
- package/dist/esm/v3/runEngineWorker/supervisor/schemas.d.ts +191 -184
- package/dist/esm/v3/runEngineWorker/workload/http.d.ts +46 -45
- package/dist/esm/v3/runEngineWorker/workload/schemas.d.ts +163 -156
- package/dist/esm/v3/schemas/api.d.ts +254 -56
- package/dist/esm/v3/schemas/api.js +14 -0
- package/dist/esm/v3/schemas/api.js.map +1 -1
- package/dist/esm/v3/schemas/checkpoints.d.ts +66 -66
- package/dist/esm/v3/schemas/common.d.ts +215 -177
- package/dist/esm/v3/schemas/common.js +6 -0
- package/dist/esm/v3/schemas/common.js.map +1 -1
- package/dist/esm/v3/schemas/messages.d.ts +2149 -2032
- package/dist/esm/v3/schemas/runEngine.d.ts +157 -150
- package/dist/esm/v3/schemas/schemas.d.ts +281 -262
- package/dist/esm/v3/schemas/webhooks.d.ts +68 -68
- package/dist/esm/v3/serverOnly/idempotencyKeys.d.ts +36 -0
- package/dist/esm/v3/serverOnly/idempotencyKeys.js +51 -0
- package/dist/esm/v3/serverOnly/idempotencyKeys.js.map +1 -0
- package/dist/esm/v3/serverOnly/index.d.ts +1 -0
- package/dist/esm/v3/serverOnly/index.js +1 -0
- package/dist/esm/v3/serverOnly/index.js.map +1 -1
- package/dist/esm/v3/utils/flattenAttributes.d.ts +2 -2
- package/dist/esm/v3/utils/flattenAttributes.js +24 -13
- package/dist/esm/v3/utils/flattenAttributes.js.map +1 -1
- package/dist/esm/v3/utils/globals.d.ts +2 -0
- package/dist/esm/v3/utils/globals.js.map +1 -1
- package/dist/esm/v3/utils/ioSerialization.js +9 -24
- package/dist/esm/v3/utils/ioSerialization.js.map +1 -1
- package/dist/esm/version.js +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,21 @@
|
|
|
1
|
+
import type { IdempotencyKeyOptions, IdempotencyKeyScope } from "./idempotency-key-catalog/catalog.js";
|
|
1
2
|
import { IdempotencyKey } from "./types/idempotencyKeys.js";
|
|
3
|
+
import type { ZodFetchOptions } from "./apiClient/core.js";
|
|
4
|
+
export type { IdempotencyKeyScope, IdempotencyKeyOptions } from "./idempotency-key-catalog/catalog.js";
|
|
5
|
+
/**
|
|
6
|
+
* Extracts the user-provided key and scope from an idempotency key created with `idempotencyKeys.create()`.
|
|
7
|
+
*
|
|
8
|
+
* @param idempotencyKey The idempotency key to extract options from
|
|
9
|
+
* @returns The original key and scope, or undefined if the key doesn't have attached options
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```typescript
|
|
13
|
+
* const key = await idempotencyKeys.create("my-key", { scope: "global" });
|
|
14
|
+
* const options = getIdempotencyKeyOptions(key);
|
|
15
|
+
* // options = { key: "my-key", scope: "global" }
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export declare function getIdempotencyKeyOptions(idempotencyKey: IdempotencyKey | string): IdempotencyKeyOptions | undefined;
|
|
2
19
|
export declare function isIdempotencyKey(value: string | string[] | IdempotencyKey): value is IdempotencyKey;
|
|
3
20
|
export declare function flattenIdempotencyKey(idempotencyKey?: IdempotencyKey | string | string[] | (undefined | IdempotencyKey | string | string[])[]): IdempotencyKey | string | string[] | undefined;
|
|
4
21
|
export declare function makeIdempotencyKey(idempotencyKey?: IdempotencyKey | string | string[]): Promise<IdempotencyKey | undefined>;
|
|
@@ -38,7 +55,7 @@ export declare function makeIdempotencyKey(idempotencyKey?: IdempotencyKey | str
|
|
|
38
55
|
* ```
|
|
39
56
|
*/
|
|
40
57
|
export declare function createIdempotencyKey(key: string | string[], options?: {
|
|
41
|
-
scope?:
|
|
58
|
+
scope?: IdempotencyKeyScope;
|
|
42
59
|
}): Promise<IdempotencyKey>;
|
|
43
60
|
type AttemptKeyMaterial = {
|
|
44
61
|
run: {
|
|
@@ -50,4 +67,39 @@ type AttemptKeyMaterial = {
|
|
|
50
67
|
};
|
|
51
68
|
/** Creates a unique key for each attempt. */
|
|
52
69
|
export declare function attemptKey(ctx: AttemptKeyMaterial): string;
|
|
53
|
-
export {
|
|
70
|
+
export type ResetIdempotencyKeyOptions = {
|
|
71
|
+
scope?: IdempotencyKeyScope;
|
|
72
|
+
/** Required if scope is "run" or "attempt" to reconstruct the hash */
|
|
73
|
+
parentRunId?: string;
|
|
74
|
+
/** Required if scope is "attempt" to reconstruct the hash */
|
|
75
|
+
attemptNumber?: number;
|
|
76
|
+
};
|
|
77
|
+
/**
|
|
78
|
+
* Resets an idempotency key, effectively deleting it from the associated task.
|
|
79
|
+
*
|
|
80
|
+
* @param taskIdentifier The task identifier (e.g., "my-task")
|
|
81
|
+
* @param idempotencyKey The idempotency key to reset. Can be:
|
|
82
|
+
* - An `IdempotencyKey` created with `idempotencyKeys.create()` (options are extracted automatically)
|
|
83
|
+
* - A string or string array (requires `options.scope` and potentially `options.parentRunId`)
|
|
84
|
+
* @param options Options for reconstructing the hash if needed
|
|
85
|
+
* @param requestOptions Optional fetch options
|
|
86
|
+
*
|
|
87
|
+
* @example
|
|
88
|
+
* ```typescript
|
|
89
|
+
* // Using a key created with idempotencyKeys.create() - options are extracted automatically
|
|
90
|
+
* const key = await idempotencyKeys.create("my-key", { scope: "global" });
|
|
91
|
+
* await idempotencyKeys.reset("my-task", key);
|
|
92
|
+
*
|
|
93
|
+
* // Using a raw string with global scope
|
|
94
|
+
* await idempotencyKeys.reset("my-task", "my-key", { scope: "global" });
|
|
95
|
+
*
|
|
96
|
+
* // Using a raw string with run scope (requires parentRunId)
|
|
97
|
+
* await idempotencyKeys.reset("my-task", "my-key", {
|
|
98
|
+
* scope: "run",
|
|
99
|
+
* parentRunId: "run_abc123"
|
|
100
|
+
* });
|
|
101
|
+
* ```
|
|
102
|
+
*/
|
|
103
|
+
export declare function resetIdempotencyKey(taskIdentifier: string, idempotencyKey: IdempotencyKey | string | string[], options?: ResetIdempotencyKeyOptions, requestOptions?: ZodFetchOptions): Promise<{
|
|
104
|
+
id: string;
|
|
105
|
+
}>;
|
|
@@ -1,8 +1,34 @@
|
|
|
1
|
+
import { apiClientManager } from "./apiClientManager-api.js";
|
|
2
|
+
import { idempotencyKeyCatalog } from "./idempotency-key-catalog-api.js";
|
|
1
3
|
import { taskContext } from "./task-context-api.js";
|
|
2
4
|
import { digestSHA256 } from "./utils/crypto.js";
|
|
5
|
+
/**
|
|
6
|
+
* Extracts the user-provided key and scope from an idempotency key created with `idempotencyKeys.create()`.
|
|
7
|
+
*
|
|
8
|
+
* @param idempotencyKey The idempotency key to extract options from
|
|
9
|
+
* @returns The original key and scope, or undefined if the key doesn't have attached options
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```typescript
|
|
13
|
+
* const key = await idempotencyKeys.create("my-key", { scope: "global" });
|
|
14
|
+
* const options = getIdempotencyKeyOptions(key);
|
|
15
|
+
* // options = { key: "my-key", scope: "global" }
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export function getIdempotencyKeyOptions(idempotencyKey) {
|
|
19
|
+
// Look up options from the catalog using the hash string
|
|
20
|
+
if (typeof idempotencyKey === "string") {
|
|
21
|
+
return idempotencyKeyCatalog.getKeyOptions(idempotencyKey);
|
|
22
|
+
}
|
|
23
|
+
return undefined;
|
|
24
|
+
}
|
|
3
25
|
export function isIdempotencyKey(value) {
|
|
4
26
|
// Cannot check the brand at runtime because it doesn't exist (it's a TypeScript-only construct)
|
|
5
|
-
|
|
27
|
+
// Check for primitive strings only (we no longer use String objects)
|
|
28
|
+
if (typeof value === "string") {
|
|
29
|
+
return value.length === 64;
|
|
30
|
+
}
|
|
31
|
+
return false;
|
|
6
32
|
}
|
|
7
33
|
export function flattenIdempotencyKey(idempotencyKey) {
|
|
8
34
|
if (!idempotencyKey) {
|
|
@@ -69,7 +95,13 @@ export async function makeIdempotencyKey(idempotencyKey) {
|
|
|
69
95
|
* ```
|
|
70
96
|
*/
|
|
71
97
|
export async function createIdempotencyKey(key, options) {
|
|
72
|
-
const
|
|
98
|
+
const scope = options?.scope ?? "run";
|
|
99
|
+
const keyArray = Array.isArray(key) ? key : [key];
|
|
100
|
+
const userKey = keyArray.join("-");
|
|
101
|
+
const idempotencyKey = await generateIdempotencyKey(keyArray.concat(injectScope(scope)));
|
|
102
|
+
// Register the original key and scope in the catalog for later extraction
|
|
103
|
+
idempotencyKeyCatalog.registerKeyOptions(idempotencyKey, { key: userKey, scope });
|
|
104
|
+
// Return primitive string cast as IdempotencyKey
|
|
73
105
|
return idempotencyKey;
|
|
74
106
|
}
|
|
75
107
|
function injectScope(scope) {
|
|
@@ -96,4 +128,69 @@ async function generateIdempotencyKey(keyMaterial) {
|
|
|
96
128
|
export function attemptKey(ctx) {
|
|
97
129
|
return `${ctx.run.id}-${ctx.attempt.number}`;
|
|
98
130
|
}
|
|
131
|
+
/**
|
|
132
|
+
* Resets an idempotency key, effectively deleting it from the associated task.
|
|
133
|
+
*
|
|
134
|
+
* @param taskIdentifier The task identifier (e.g., "my-task")
|
|
135
|
+
* @param idempotencyKey The idempotency key to reset. Can be:
|
|
136
|
+
* - An `IdempotencyKey` created with `idempotencyKeys.create()` (options are extracted automatically)
|
|
137
|
+
* - A string or string array (requires `options.scope` and potentially `options.parentRunId`)
|
|
138
|
+
* @param options Options for reconstructing the hash if needed
|
|
139
|
+
* @param requestOptions Optional fetch options
|
|
140
|
+
*
|
|
141
|
+
* @example
|
|
142
|
+
* ```typescript
|
|
143
|
+
* // Using a key created with idempotencyKeys.create() - options are extracted automatically
|
|
144
|
+
* const key = await idempotencyKeys.create("my-key", { scope: "global" });
|
|
145
|
+
* await idempotencyKeys.reset("my-task", key);
|
|
146
|
+
*
|
|
147
|
+
* // Using a raw string with global scope
|
|
148
|
+
* await idempotencyKeys.reset("my-task", "my-key", { scope: "global" });
|
|
149
|
+
*
|
|
150
|
+
* // Using a raw string with run scope (requires parentRunId)
|
|
151
|
+
* await idempotencyKeys.reset("my-task", "my-key", {
|
|
152
|
+
* scope: "run",
|
|
153
|
+
* parentRunId: "run_abc123"
|
|
154
|
+
* });
|
|
155
|
+
* ```
|
|
156
|
+
*/
|
|
157
|
+
export async function resetIdempotencyKey(taskIdentifier, idempotencyKey, options, requestOptions) {
|
|
158
|
+
const client = apiClientManager.clientOrThrow();
|
|
159
|
+
// If the key is already a 64-char hash, use it directly
|
|
160
|
+
if (typeof idempotencyKey === "string" && idempotencyKey.length === 64) {
|
|
161
|
+
return client.resetIdempotencyKey(taskIdentifier, idempotencyKey, requestOptions);
|
|
162
|
+
}
|
|
163
|
+
// Try to extract options from an IdempotencyKey created with idempotencyKeys.create()
|
|
164
|
+
const attachedOptions = typeof idempotencyKey === "string"
|
|
165
|
+
? getIdempotencyKeyOptions(idempotencyKey)
|
|
166
|
+
: undefined;
|
|
167
|
+
const scope = attachedOptions?.scope ?? options?.scope ?? "run";
|
|
168
|
+
const keyArray = Array.isArray(idempotencyKey)
|
|
169
|
+
? idempotencyKey
|
|
170
|
+
: [attachedOptions?.key ?? String(idempotencyKey)];
|
|
171
|
+
// Build scope suffix based on scope type
|
|
172
|
+
let scopeSuffix = [];
|
|
173
|
+
switch (scope) {
|
|
174
|
+
case "run": {
|
|
175
|
+
const parentRunId = options?.parentRunId ?? taskContext?.ctx?.run.id;
|
|
176
|
+
if (!parentRunId) {
|
|
177
|
+
throw new Error("resetIdempotencyKey: parentRunId is required for 'run' scope when called outside a task context");
|
|
178
|
+
}
|
|
179
|
+
scopeSuffix = [parentRunId];
|
|
180
|
+
break;
|
|
181
|
+
}
|
|
182
|
+
case "attempt": {
|
|
183
|
+
const parentRunId = options?.parentRunId ?? taskContext?.ctx?.run.id;
|
|
184
|
+
const attemptNumber = options?.attemptNumber ?? taskContext?.ctx?.attempt.number;
|
|
185
|
+
if (!parentRunId || attemptNumber === undefined) {
|
|
186
|
+
throw new Error("resetIdempotencyKey: parentRunId and attemptNumber are required for 'attempt' scope when called outside a task context");
|
|
187
|
+
}
|
|
188
|
+
scopeSuffix = [parentRunId, attemptNumber.toString()];
|
|
189
|
+
break;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
// Generate the hash using the same algorithm as createIdempotencyKey
|
|
193
|
+
const hash = await generateIdempotencyKey(keyArray.concat(scopeSuffix));
|
|
194
|
+
return client.resetIdempotencyKey(taskIdentifier, hash, requestOptions);
|
|
195
|
+
}
|
|
99
196
|
//# sourceMappingURL=idempotencyKeys.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"idempotencyKeys.js","sourceRoot":"","sources":["../../../src/v3/idempotencyKeys.ts"],"names":[],"mappings":"AAAA,OAAO,E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AC,mBAAmB,CAAC,cAAc,EAAE,IAAI,EAAE,cAAc,CAAC,CAAC;AAC1E,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// @ts-ignore
|
|
2
|
+
import superjson from "superjson";
|
|
3
|
+
superjson.registerCustom({
|
|
4
|
+
isApplicable: (v) => typeof Buffer === "function" && Buffer.isBuffer(v),
|
|
5
|
+
serialize: (v) => [...v],
|
|
6
|
+
deserialize: (v) => Buffer.from(v),
|
|
7
|
+
}, "buffer");
|
|
8
|
+
// @ts-ignore
|
|
9
|
+
export default superjson;
|
|
10
|
+
//# sourceMappingURL=superjson.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"superjson.js","sourceRoot":"","sources":["../../../../src/v3/imports/superjson.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,OAAO,SAAS,MAAM,WAAW,CAAC;AAElC,SAAS,CAAC,cAAc,CACtB;IACE,YAAY,EAAE,CAAC,CAAC,EAAe,EAAE,CAAC,OAAO,MAAM,KAAK,UAAU,IAAI,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC;IACpF,SAAS,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC;IACxB,WAAW,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;CACnC,EACD,QAAQ,CACT,CAAC;AAEF,aAAa;AACb,eAAe,SAAS,CAAC"}
|
|
@@ -17,6 +17,20 @@ export declare class SupervisorHttpClient {
|
|
|
17
17
|
};
|
|
18
18
|
}>>;
|
|
19
19
|
dequeue(body: WorkerApiDequeueRequestBody): Promise<import("../../zodfetch.js").ApiResult<{
|
|
20
|
+
run: {
|
|
21
|
+
id: string;
|
|
22
|
+
isTest: boolean;
|
|
23
|
+
machine: {
|
|
24
|
+
cpu: number;
|
|
25
|
+
memory: number;
|
|
26
|
+
name: "micro" | "small-1x" | "small-2x" | "medium-1x" | "medium-2x" | "large-1x" | "large-2x";
|
|
27
|
+
centsPerMs: number;
|
|
28
|
+
};
|
|
29
|
+
traceContext: Record<string, unknown>;
|
|
30
|
+
friendlyId: string;
|
|
31
|
+
attemptNumber: number;
|
|
32
|
+
masterQueue: string;
|
|
33
|
+
};
|
|
20
34
|
version: "1";
|
|
21
35
|
environment: {
|
|
22
36
|
type: "PRODUCTION" | "STAGING" | "DEVELOPMENT" | "PREVIEW";
|
|
@@ -33,20 +47,6 @@ export declare class SupervisorHttpClient {
|
|
|
33
47
|
friendlyId?: string | undefined;
|
|
34
48
|
imagePlatform?: string | undefined;
|
|
35
49
|
};
|
|
36
|
-
run: {
|
|
37
|
-
id: string;
|
|
38
|
-
isTest: boolean;
|
|
39
|
-
machine: {
|
|
40
|
-
cpu: number;
|
|
41
|
-
memory: number;
|
|
42
|
-
name: "micro" | "small-1x" | "small-2x" | "medium-1x" | "medium-2x" | "large-1x" | "large-2x";
|
|
43
|
-
centsPerMs: number;
|
|
44
|
-
};
|
|
45
|
-
traceContext: Record<string, unknown>;
|
|
46
|
-
friendlyId: string;
|
|
47
|
-
attemptNumber: number;
|
|
48
|
-
masterQueue: string;
|
|
49
|
-
};
|
|
50
50
|
snapshot: {
|
|
51
51
|
id: string;
|
|
52
52
|
createdAt: Date;
|
|
@@ -100,6 +100,20 @@ export declare class SupervisorHttpClient {
|
|
|
100
100
|
}[]>>;
|
|
101
101
|
/** @deprecated Not currently used */
|
|
102
102
|
dequeueFromVersion(deploymentId: string, maxRunCount?: number, runnerId?: string): Promise<import("../../zodfetch.js").ApiResult<{
|
|
103
|
+
run: {
|
|
104
|
+
id: string;
|
|
105
|
+
isTest: boolean;
|
|
106
|
+
machine: {
|
|
107
|
+
cpu: number;
|
|
108
|
+
memory: number;
|
|
109
|
+
name: "micro" | "small-1x" | "small-2x" | "medium-1x" | "medium-2x" | "large-1x" | "large-2x";
|
|
110
|
+
centsPerMs: number;
|
|
111
|
+
};
|
|
112
|
+
traceContext: Record<string, unknown>;
|
|
113
|
+
friendlyId: string;
|
|
114
|
+
attemptNumber: number;
|
|
115
|
+
masterQueue: string;
|
|
116
|
+
};
|
|
103
117
|
version: "1";
|
|
104
118
|
environment: {
|
|
105
119
|
type: "PRODUCTION" | "STAGING" | "DEVELOPMENT" | "PREVIEW";
|
|
@@ -116,20 +130,6 @@ export declare class SupervisorHttpClient {
|
|
|
116
130
|
friendlyId?: string | undefined;
|
|
117
131
|
imagePlatform?: string | undefined;
|
|
118
132
|
};
|
|
119
|
-
run: {
|
|
120
|
-
id: string;
|
|
121
|
-
isTest: boolean;
|
|
122
|
-
machine: {
|
|
123
|
-
cpu: number;
|
|
124
|
-
memory: number;
|
|
125
|
-
name: "micro" | "small-1x" | "small-2x" | "medium-1x" | "medium-2x" | "large-1x" | "large-2x";
|
|
126
|
-
centsPerMs: number;
|
|
127
|
-
};
|
|
128
|
-
traceContext: Record<string, unknown>;
|
|
129
|
-
friendlyId: string;
|
|
130
|
-
attemptNumber: number;
|
|
131
|
-
masterQueue: string;
|
|
132
|
-
};
|
|
133
133
|
snapshot: {
|
|
134
134
|
id: string;
|
|
135
135
|
createdAt: Date;
|
|
@@ -204,6 +204,37 @@ export declare class SupervisorHttpClient {
|
|
|
204
204
|
};
|
|
205
205
|
} & {
|
|
206
206
|
execution: {
|
|
207
|
+
run: {
|
|
208
|
+
payload: string;
|
|
209
|
+
id: string;
|
|
210
|
+
payloadType: string;
|
|
211
|
+
tags: string[];
|
|
212
|
+
isTest: boolean;
|
|
213
|
+
createdAt: Date;
|
|
214
|
+
startedAt: Date;
|
|
215
|
+
metadata?: Record<string, import("../../../index.js").DeserializedJson> | undefined;
|
|
216
|
+
idempotencyKey?: string | undefined;
|
|
217
|
+
idempotencyKeyScope?: "run" | "attempt" | "global" | undefined;
|
|
218
|
+
maxAttempts?: number | undefined;
|
|
219
|
+
version?: string | undefined;
|
|
220
|
+
maxDuration?: number | undefined;
|
|
221
|
+
priority?: number | undefined;
|
|
222
|
+
baseCostInCents?: number | undefined;
|
|
223
|
+
parentTaskRunId?: string | undefined;
|
|
224
|
+
rootTaskRunId?: string | undefined;
|
|
225
|
+
durationMs?: number | undefined;
|
|
226
|
+
costInCents?: number | undefined;
|
|
227
|
+
region?: string | undefined;
|
|
228
|
+
} & {
|
|
229
|
+
traceContext?: Record<string, unknown> | undefined;
|
|
230
|
+
realtimeStreamsVersion?: string | undefined;
|
|
231
|
+
};
|
|
232
|
+
attempt: {
|
|
233
|
+
number: number;
|
|
234
|
+
startedAt: Date;
|
|
235
|
+
} & {
|
|
236
|
+
[k: string]: unknown;
|
|
237
|
+
};
|
|
207
238
|
task: {
|
|
208
239
|
id: string;
|
|
209
240
|
filePath: string;
|
|
@@ -252,36 +283,6 @@ export declare class SupervisorHttpClient {
|
|
|
252
283
|
name: "micro" | "small-1x" | "small-2x" | "medium-1x" | "medium-2x" | "large-1x" | "large-2x";
|
|
253
284
|
centsPerMs: number;
|
|
254
285
|
};
|
|
255
|
-
attempt: {
|
|
256
|
-
number: number;
|
|
257
|
-
startedAt: Date;
|
|
258
|
-
} & {
|
|
259
|
-
[k: string]: unknown;
|
|
260
|
-
};
|
|
261
|
-
run: {
|
|
262
|
-
payload: string;
|
|
263
|
-
id: string;
|
|
264
|
-
payloadType: string;
|
|
265
|
-
tags: string[];
|
|
266
|
-
isTest: boolean;
|
|
267
|
-
createdAt: Date;
|
|
268
|
-
startedAt: Date;
|
|
269
|
-
metadata?: Record<string, import("../../../index.js").DeserializedJson> | undefined;
|
|
270
|
-
idempotencyKey?: string | undefined;
|
|
271
|
-
maxAttempts?: number | undefined;
|
|
272
|
-
version?: string | undefined;
|
|
273
|
-
maxDuration?: number | undefined;
|
|
274
|
-
priority?: number | undefined;
|
|
275
|
-
baseCostInCents?: number | undefined;
|
|
276
|
-
parentTaskRunId?: string | undefined;
|
|
277
|
-
rootTaskRunId?: string | undefined;
|
|
278
|
-
durationMs?: number | undefined;
|
|
279
|
-
costInCents?: number | undefined;
|
|
280
|
-
region?: string | undefined;
|
|
281
|
-
} & {
|
|
282
|
-
traceContext?: Record<string, unknown> | undefined;
|
|
283
|
-
realtimeStreamsVersion?: string | undefined;
|
|
284
|
-
};
|
|
285
286
|
batch?: {
|
|
286
287
|
id: string;
|
|
287
288
|
} | undefined;
|
|
@@ -333,7 +334,6 @@ export declare class SupervisorHttpClient {
|
|
|
333
334
|
}>>;
|
|
334
335
|
getLatestSnapshot(runId: string, runnerId?: string): Promise<import("../../zodfetch.js").ApiResult<{
|
|
335
336
|
execution: {
|
|
336
|
-
version: "1";
|
|
337
337
|
run: {
|
|
338
338
|
status: import("../../index.js").TaskRunStatus;
|
|
339
339
|
id: string;
|
|
@@ -341,6 +341,7 @@ export declare class SupervisorHttpClient {
|
|
|
341
341
|
attemptNumber?: number | null | undefined;
|
|
342
342
|
taskEventStore?: string | undefined;
|
|
343
343
|
};
|
|
344
|
+
version: "1";
|
|
344
345
|
snapshot: {
|
|
345
346
|
id: string;
|
|
346
347
|
createdAt: Date;
|
|
@@ -388,7 +389,6 @@ export declare class SupervisorHttpClient {
|
|
|
388
389
|
}>>;
|
|
389
390
|
getSnapshotsSince(runId: string, snapshotId: string, runnerId?: string): Promise<import("../../zodfetch.js").ApiResult<{
|
|
390
391
|
snapshots: {
|
|
391
|
-
version: "1";
|
|
392
392
|
run: {
|
|
393
393
|
status: import("../../index.js").TaskRunStatus;
|
|
394
394
|
id: string;
|
|
@@ -396,6 +396,7 @@ export declare class SupervisorHttpClient {
|
|
|
396
396
|
attemptNumber?: number | null | undefined;
|
|
397
397
|
taskEventStore?: string | undefined;
|
|
398
398
|
};
|
|
399
|
+
version: "1";
|
|
399
400
|
snapshot: {
|
|
400
401
|
id: string;
|
|
401
402
|
createdAt: Date;
|