@meetploy/types 1.4.0 → 1.6.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/alarm.d.ts +14 -0
- package/dist/alarm.js +2 -0
- package/dist/alarm.js.map +1 -0
- package/dist/fs.d.ts +26 -0
- package/dist/fs.js +2 -0
- package/dist/fs.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/ploy.d.ts +2 -0
- package/dist/scheduled.d.ts +7 -0
- package/dist/scheduled.js +2 -0
- package/dist/scheduled.js.map +1 -0
- package/package.json +1 -1
package/dist/alarm.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface AlarmBinding {
|
|
2
|
+
set: (id: string, scheduledTime: Date | number, payload?: unknown) => Promise<void>;
|
|
3
|
+
get: (id: string) => Promise<{
|
|
4
|
+
id: string;
|
|
5
|
+
scheduledTime: number;
|
|
6
|
+
payload?: unknown;
|
|
7
|
+
} | null>;
|
|
8
|
+
delete: (id: string) => Promise<void>;
|
|
9
|
+
}
|
|
10
|
+
export interface AlarmEvent {
|
|
11
|
+
id: string;
|
|
12
|
+
scheduledTime: number;
|
|
13
|
+
payload?: unknown;
|
|
14
|
+
}
|
package/dist/alarm.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alarm.js","sourceRoot":"","sources":["../src/alarm.ts"],"names":[],"mappings":""}
|
package/dist/fs.d.ts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export interface FileStoragePutOptions {
|
|
2
|
+
contentType?: string;
|
|
3
|
+
}
|
|
4
|
+
export interface FileStorageListOptions {
|
|
5
|
+
prefix?: string;
|
|
6
|
+
limit?: number;
|
|
7
|
+
}
|
|
8
|
+
export interface FileStorageObject {
|
|
9
|
+
body: string;
|
|
10
|
+
contentType: string;
|
|
11
|
+
size: number;
|
|
12
|
+
}
|
|
13
|
+
export interface FileStorageKey {
|
|
14
|
+
key: string;
|
|
15
|
+
size: number;
|
|
16
|
+
contentType: string;
|
|
17
|
+
}
|
|
18
|
+
export interface FileStorageListResult {
|
|
19
|
+
keys: FileStorageKey[];
|
|
20
|
+
}
|
|
21
|
+
export interface FileStorageBinding {
|
|
22
|
+
put: (key: string, value: string, options?: FileStoragePutOptions) => Promise<void>;
|
|
23
|
+
get: (key: string) => Promise<FileStorageObject | null>;
|
|
24
|
+
delete: (key: string) => Promise<void>;
|
|
25
|
+
list: (options?: FileStorageListOptions) => Promise<FileStorageListResult>;
|
|
26
|
+
}
|
package/dist/fs.js
ADDED
package/dist/fs.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fs.js","sourceRoot":"","sources":["../src/fs.ts"],"names":[],"mappings":""}
|
package/dist/index.d.ts
CHANGED
|
@@ -4,4 +4,6 @@ export type { WorkflowBinding, WorkflowContext, WorkflowExecution, WorkflowExecu
|
|
|
4
4
|
export type { ExecutionContext, FetchHandler, MessageHandler, Ploy, WorkflowHandlers, } from "./ploy.js";
|
|
5
5
|
export type { CacheBinding } from "./cache.js";
|
|
6
6
|
export type { StateBinding } from "./state.js";
|
|
7
|
+
export type { FileStorageBinding, FileStorageObject, FileStorageKey, FileStorageListResult, FileStoragePutOptions, FileStorageListOptions, } from "./fs.js";
|
|
8
|
+
export type { ScheduledEvent, ScheduledHandler } from "./scheduled.js";
|
|
7
9
|
export type { PloyAuth, PloyUser } from "./auth.js";
|
package/dist/ploy.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { QueueMessageEvent } from "./queue.js";
|
|
2
|
+
import type { ScheduledHandler } from "./scheduled.js";
|
|
2
3
|
import type { WorkflowHandler } from "./workflow.js";
|
|
3
4
|
export type FetchHandler<TEnv = unknown> = (request: Request, env: TEnv, ctx: ExecutionContext) => Response | Promise<Response>;
|
|
4
5
|
export type MessageHandler<TEnv = unknown> = (event: QueueMessageEvent, env: TEnv, ctx: ExecutionContext) => void | Promise<void>;
|
|
@@ -11,4 +12,5 @@ export interface Ploy<TEnv = unknown> {
|
|
|
11
12
|
fetch?: FetchHandler<TEnv>;
|
|
12
13
|
message?: MessageHandler<TEnv>;
|
|
13
14
|
workflows?: WorkflowHandlers<TEnv>;
|
|
15
|
+
scheduled?: ScheduledHandler<TEnv>;
|
|
14
16
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ExecutionContext } from "./ploy.js";
|
|
2
|
+
export interface ScheduledEvent {
|
|
3
|
+
cron: string;
|
|
4
|
+
scheduledTime: number;
|
|
5
|
+
noRetry: () => void;
|
|
6
|
+
}
|
|
7
|
+
export type ScheduledHandler<TEnv = unknown> = (event: ScheduledEvent, env: TEnv, ctx: ExecutionContext) => void | Promise<void>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scheduled.js","sourceRoot":"","sources":["../src/scheduled.ts"],"names":[],"mappings":""}
|