@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 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 { AlarmHandler, ExecutionContext, FetchHandler, MessageHandler, Ploy, WorkflowHandlers, } from "./ploy.js";
5
- export type { AlarmBinding, AlarmEvent, AlarmOptions } from "./alarm.js";
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 AlarmHandler<TEnv = unknown> = (event: AlarmEvent, env: TEnv, ctx: ExecutionContext) => void | Promise<void>;
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 Ploy<TEnv = unknown> {
13
+ export interface PloyHandler<TEnv = unknown> {
14
14
  fetch?: FetchHandler<TEnv>;
15
15
  message?: MessageHandler<TEnv>;
16
- alarm?: AlarmHandler<TEnv>;
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 AlarmOptions {
1
+ export interface TimerOptions {
2
2
  payload?: unknown;
3
3
  intervalMs?: number;
4
4
  }
5
- export interface AlarmBinding {
6
- set: (id: string, scheduledTime: Date | number, options?: AlarmOptions | unknown) => Promise<void>;
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 AlarmEvent {
15
+ export interface TimerEvent {
16
16
  id: string;
17
17
  scheduledTime: number;
18
18
  payload?: unknown;
package/dist/timer.js ADDED
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=timer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"timer.js","sourceRoot":"","sources":["../src/timer.ts"],"names":[],"mappings":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meetploy/types",
3
- "version": "1.7.0",
3
+ "version": "1.8.0",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",
package/dist/alarm.js DELETED
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=alarm.js.map
package/dist/alarm.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"alarm.js","sourceRoot":"","sources":["../src/alarm.ts"],"names":[],"mappings":""}