@meetploy/types 1.7.0 → 1.8.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 +2 -2
- package/dist/ploy.d.ts +5 -4
- package/dist/{alarm.d.ts → timer.d.ts} +4 -4
- package/dist/timer.js +2 -0
- package/dist/timer.js.map +1 -0
- package/package.json +1 -1
- package/dist/alarm.js +0 -2
- package/dist/alarm.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export type { D1Database, D1PreparedStatement, D1Result, D1ResultMeta, } from "./db.js";
|
|
2
2
|
export type { QueueBinding, QueueBatchMessage, QueueMessageEvent, QueueSendOptions, QueueSendResult, QueueSendBatchResult, } from "./queue.js";
|
|
3
3
|
export type { WorkflowBinding, WorkflowContext, WorkflowExecution, WorkflowExecutionStatus, WorkflowHandler, WorkflowStep, WorkflowStepOptions, WorkflowTriggerResult, } from "./workflow.js";
|
|
4
|
-
export type {
|
|
5
|
-
export type {
|
|
4
|
+
export type { TimerHandler, ExecutionContext, FetchHandler, MessageHandler, Ploy, PloyHandler, WorkflowHandlers, } from "./ploy.js";
|
|
5
|
+
export type { TimerBinding, TimerEvent, TimerOptions } from "./timer.js";
|
|
6
6
|
export type { CacheBinding } from "./cache.js";
|
|
7
7
|
export type { StateBinding } from "./state.js";
|
|
8
8
|
export type { FileStorageBinding, FileStorageObject, FileStorageKey, FileStorageListResult, FileStoragePutOptions, FileStorageListOptions, } from "./fs.js";
|
package/dist/ploy.d.ts
CHANGED
|
@@ -1,19 +1,20 @@
|
|
|
1
|
-
import type { AlarmEvent } from "./alarm.js";
|
|
2
1
|
import type { QueueMessageEvent } from "./queue.js";
|
|
3
2
|
import type { ScheduledHandler } from "./scheduled.js";
|
|
3
|
+
import type { TimerEvent } from "./timer.js";
|
|
4
4
|
import type { WorkflowHandler } from "./workflow.js";
|
|
5
5
|
export type FetchHandler<TEnv = unknown> = (request: Request, env: TEnv, ctx: ExecutionContext) => Response | Promise<Response>;
|
|
6
6
|
export type MessageHandler<TEnv = unknown> = (event: QueueMessageEvent, env: TEnv, ctx: ExecutionContext) => void | Promise<void>;
|
|
7
|
-
export type
|
|
7
|
+
export type TimerHandler<TEnv = unknown> = (event: TimerEvent, env: TEnv, ctx: ExecutionContext) => void | Promise<void>;
|
|
8
8
|
export interface ExecutionContext {
|
|
9
9
|
waitUntil: (promise: Promise<unknown>) => void;
|
|
10
10
|
passThroughOnException: () => void;
|
|
11
11
|
}
|
|
12
12
|
export type WorkflowHandlers<TEnv = unknown> = Record<string, WorkflowHandler<TEnv, any, any>>;
|
|
13
|
-
export interface
|
|
13
|
+
export interface PloyHandler<TEnv = unknown> {
|
|
14
14
|
fetch?: FetchHandler<TEnv>;
|
|
15
15
|
message?: MessageHandler<TEnv>;
|
|
16
|
-
|
|
16
|
+
timer?: TimerHandler<TEnv>;
|
|
17
17
|
workflows?: WorkflowHandlers<TEnv>;
|
|
18
18
|
scheduled?: ScheduledHandler<TEnv>;
|
|
19
19
|
}
|
|
20
|
+
export type Ploy<TEnv = unknown> = PloyHandler<TEnv>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export interface
|
|
1
|
+
export interface TimerOptions {
|
|
2
2
|
payload?: unknown;
|
|
3
3
|
intervalMs?: number;
|
|
4
4
|
}
|
|
5
|
-
export interface
|
|
6
|
-
set: (id: string, scheduledTime: Date | number, options?:
|
|
5
|
+
export interface TimerBinding {
|
|
6
|
+
set: (id: string, scheduledTime: Date | number, options?: TimerOptions | unknown) => Promise<void>;
|
|
7
7
|
get: (id: string) => Promise<{
|
|
8
8
|
id: string;
|
|
9
9
|
scheduledTime: number;
|
|
@@ -12,7 +12,7 @@ export interface AlarmBinding {
|
|
|
12
12
|
} | null>;
|
|
13
13
|
delete: (id: string) => Promise<void>;
|
|
14
14
|
}
|
|
15
|
-
export interface
|
|
15
|
+
export interface TimerEvent {
|
|
16
16
|
id: string;
|
|
17
17
|
scheduledTime: number;
|
|
18
18
|
payload?: unknown;
|
package/dist/timer.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timer.js","sourceRoot":"","sources":["../src/timer.ts"],"names":[],"mappings":""}
|
package/package.json
CHANGED
package/dist/alarm.js
DELETED
package/dist/alarm.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"alarm.js","sourceRoot":"","sources":["../src/alarm.ts"],"names":[],"mappings":""}
|