every-plugin 0.0.2 → 0.0.4
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/package.json +1 -1
- package/dist/errors.d.ts +0 -8
- package/dist/index.d.ts +0 -6
- package/dist/plugin.d.ts +0 -66
package/package.json
CHANGED
package/dist/errors.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export declare class PluginExecutionError extends Error {
|
|
2
|
-
readonly retryable: boolean;
|
|
3
|
-
constructor(message: string, retryable?: boolean);
|
|
4
|
-
}
|
|
5
|
-
export declare class ConfigurationError extends PluginExecutionError {
|
|
6
|
-
constructor(message: string);
|
|
7
|
-
}
|
|
8
|
-
//# sourceMappingURL=errors.d.ts.map
|
package/dist/index.d.ts
DELETED
package/dist/plugin.d.ts
DELETED
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import type { JSONSchemaType } from "ajv/dist/2020";
|
|
2
|
-
import { Context, type Effect } from "effect";
|
|
3
|
-
import { z } from 'zod';
|
|
4
|
-
import type { ConfigurationError, PluginExecutionError } from "./errors";
|
|
5
|
-
export declare const createOutputSchema: <T extends z.ZodTypeAny>(dataSchema: T) => z.ZodObject<{
|
|
6
|
-
success: z.ZodBoolean;
|
|
7
|
-
data: z.ZodOptional<T>;
|
|
8
|
-
errors: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
9
|
-
message: z.ZodString;
|
|
10
|
-
details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
11
|
-
stack: z.ZodOptional<z.ZodString>;
|
|
12
|
-
}, z.core.$strip>>>;
|
|
13
|
-
}, z.core.$strip>;
|
|
14
|
-
export declare function createConfigSchema(): z.ZodObject<{
|
|
15
|
-
variables: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
16
|
-
secrets: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
17
|
-
}>;
|
|
18
|
-
export declare function createConfigSchema<V extends z.ZodTypeAny>(variablesSchema?: V): z.ZodObject<{
|
|
19
|
-
variables: z.ZodOptional<V>;
|
|
20
|
-
secrets: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
21
|
-
}>;
|
|
22
|
-
export declare function createConfigSchema<V extends z.ZodTypeAny, S extends z.ZodTypeAny>(variablesSchema?: V, secretsSchema?: S): z.ZodObject<{
|
|
23
|
-
variables: z.ZodOptional<V>;
|
|
24
|
-
secrets: z.ZodOptional<S>;
|
|
25
|
-
}>;
|
|
26
|
-
export declare function createInputSchema<I extends z.ZodTypeAny>(inputSchema: I): I;
|
|
27
|
-
export declare const ErrorDetailsSchema: z.ZodObject<{
|
|
28
|
-
message: z.ZodString;
|
|
29
|
-
details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
30
|
-
stack: z.ZodOptional<z.ZodString>;
|
|
31
|
-
}, z.core.$strip>;
|
|
32
|
-
export type ErrorDetails = z.infer<typeof ErrorDetailsSchema>;
|
|
33
|
-
export type Config<V extends z.ZodTypeAny = z.ZodRecord<z.ZodString, z.ZodUnknown>, S extends z.ZodTypeAny = z.ZodRecord<z.ZodString, z.ZodUnknown>> = z.infer<ReturnType<typeof createConfigSchema<V, S>>>;
|
|
34
|
-
export type Input<I extends z.ZodTypeAny> = z.infer<ReturnType<typeof createInputSchema<I>>>;
|
|
35
|
-
export type Output<T extends z.ZodTypeAny> = z.infer<ReturnType<typeof createOutputSchema<T>>>;
|
|
36
|
-
export interface Plugin<TInputSchema extends z.ZodTypeAny, TOutputSchema extends z.ZodTypeAny, TConfigSchema extends z.ZodTypeAny> {
|
|
37
|
-
readonly id: string;
|
|
38
|
-
readonly type: PluginType;
|
|
39
|
-
initialize(config?: z.infer<TConfigSchema>): Effect.Effect<void, ConfigurationError, PluginLoggerTag>;
|
|
40
|
-
execute(input: z.infer<TInputSchema>): Effect.Effect<z.infer<TOutputSchema>, PluginExecutionError, PluginLoggerTag>;
|
|
41
|
-
shutdown(): Effect.Effect<void, never, PluginLoggerTag>;
|
|
42
|
-
}
|
|
43
|
-
export type PluginType = "transformer" | "distributor" | "source";
|
|
44
|
-
export interface PluginMetadata {
|
|
45
|
-
remoteUrl: string;
|
|
46
|
-
type?: PluginType;
|
|
47
|
-
configSchema: JSONSchemaType<any>;
|
|
48
|
-
inputSchema: JSONSchemaType<any>;
|
|
49
|
-
outputSchema: JSONSchemaType<any>;
|
|
50
|
-
version?: string;
|
|
51
|
-
description?: string;
|
|
52
|
-
}
|
|
53
|
-
export interface PluginRegistry {
|
|
54
|
-
[pluginId: string]: PluginMetadata;
|
|
55
|
-
}
|
|
56
|
-
export interface PluginLogger {
|
|
57
|
-
readonly logInfo: (message: string, context?: unknown) => Effect.Effect<void>;
|
|
58
|
-
readonly logWarning: (message: string, context?: unknown) => Effect.Effect<void>;
|
|
59
|
-
readonly logError: (message: string, error?: unknown, context?: unknown) => Effect.Effect<void>;
|
|
60
|
-
readonly logDebug: (message: string, context?: unknown) => Effect.Effect<void>;
|
|
61
|
-
}
|
|
62
|
-
declare const PluginLoggerTag_base: Context.TagClass<PluginLoggerTag, "PluginLogger", PluginLogger>;
|
|
63
|
-
export declare class PluginLoggerTag extends PluginLoggerTag_base {
|
|
64
|
-
}
|
|
65
|
-
export {};
|
|
66
|
-
//# sourceMappingURL=plugin.d.ts.map
|