@trigger.dev/sdk 0.2.20 → 0.2.22-next.0
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/index.d.ts +8 -0
- package/dist/index.js +477 -220
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -410,6 +410,11 @@ type FetchResponse<TResponseBodySchema extends z.ZodTypeAny = z.ZodTypeAny> = {
|
|
|
410
410
|
};
|
|
411
411
|
type TriggerFetch = <TBodySchema extends z.ZodTypeAny = z.ZodTypeAny>(key: string, url: string | URL, options: FetchOptions<TBodySchema>) => Promise<FetchResponse<TBodySchema>>;
|
|
412
412
|
type TriggerRunOnceCallback = (idempotencyKey: string) => Promise<any>;
|
|
413
|
+
interface TriggerKeyValueStorage {
|
|
414
|
+
get<T>(key: string): Promise<T | undefined>;
|
|
415
|
+
set<T>(key: string, value: T): Promise<void>;
|
|
416
|
+
delete(key: string): Promise<void>;
|
|
417
|
+
}
|
|
413
418
|
interface TriggerContext {
|
|
414
419
|
id: string;
|
|
415
420
|
environment: string;
|
|
@@ -423,6 +428,9 @@ interface TriggerContext {
|
|
|
423
428
|
runOnce<T extends TriggerRunOnceCallback>(key: string, callback: T): Promise<Awaited<ReturnType<T>>>;
|
|
424
429
|
runOnceLocalOnly<T extends TriggerRunOnceCallback>(key: string, callback: T): Promise<Awaited<ReturnType<T>>>;
|
|
425
430
|
fetch: TriggerFetch;
|
|
431
|
+
kv: TriggerKeyValueStorage;
|
|
432
|
+
globalKv: TriggerKeyValueStorage;
|
|
433
|
+
runKv: TriggerKeyValueStorage;
|
|
426
434
|
}
|
|
427
435
|
interface TriggerLogger {
|
|
428
436
|
debug(message: string, properties?: Record<string, any>): Promise<void>;
|