every-plugin 0.0.3 → 0.0.5

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/errors.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  export declare class PluginExecutionError extends Error {
2
- readonly retryable: boolean;
3
- constructor(message: string, retryable?: boolean);
2
+ readonly retryable: boolean;
3
+ constructor(message: string, retryable?: boolean);
4
4
  }
5
5
  export declare class ConfigurationError extends PluginExecutionError {
6
- constructor(message: string);
6
+ constructor(message: string);
7
7
  }
8
- //# sourceMappingURL=errors.d.ts.map
8
+ //# sourceMappingURL=errors.d.ts.map
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  export { Effect } from "effect";
2
2
  export { z } from "zod";
3
- export * from "./errors";
4
- export * from "./plugin";
5
- export * from "./source";
6
- //# sourceMappingURL=index.d.ts.map
3
+ export * from './errors';
4
+ export * from './plugin';
5
+ export * from './source';
6
+ //# sourceMappingURL=index.d.ts.map
package/dist/plugin.d.ts CHANGED
@@ -1,122 +1,66 @@
1
1
  import type { JSONSchemaType } from "ajv/dist/2020";
2
2
  import { Context, type Effect } from "effect";
3
- import { z } from "zod";
3
+ import { z } from 'zod';
4
4
  import type { ConfigurationError, PluginExecutionError } from "./errors";
5
- export declare const createOutputSchema: <T extends z.ZodTypeAny>(
6
- dataSchema: T,
7
- ) => z.ZodObject<
8
- {
9
- success: z.ZodBoolean;
10
- data: z.ZodOptional<T>;
11
- errors: z.ZodOptional<
12
- z.ZodArray<
13
- z.ZodObject<
14
- {
15
- message: z.ZodString;
16
- details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
17
- stack: z.ZodOptional<z.ZodString>;
18
- },
19
- z.core.$strip
20
- >
21
- >
22
- >;
23
- },
24
- z.core.$strip
25
- >;
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>;
26
14
  export declare function createConfigSchema(): z.ZodObject<{
27
- variables: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
28
- secrets: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
15
+ variables: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
16
+ secrets: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
29
17
  }>;
30
- export declare function createConfigSchema<V extends z.ZodTypeAny>(
31
- variablesSchema?: V,
32
- ): z.ZodObject<{
33
- variables: z.ZodOptional<V>;
34
- secrets: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
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>>;
35
21
  }>;
36
- export declare function createConfigSchema<
37
- V extends z.ZodTypeAny,
38
- S extends z.ZodTypeAny,
39
- >(
40
- variablesSchema?: V,
41
- secretsSchema?: S,
42
- ): z.ZodObject<{
43
- variables: z.ZodOptional<V>;
44
- secrets: z.ZodOptional<S>;
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>;
45
25
  }>;
46
- export declare function createInputSchema<I extends z.ZodTypeAny>(
47
- inputSchema: I,
48
- ): I;
49
- export declare const ErrorDetailsSchema: z.ZodObject<
50
- {
51
- message: z.ZodString;
52
- details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
53
- stack: z.ZodOptional<z.ZodString>;
54
- },
55
- z.core.$strip
56
- >;
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>;
57
32
  export type ErrorDetails = z.infer<typeof ErrorDetailsSchema>;
58
- export type Config<
59
- V extends z.ZodTypeAny = z.ZodRecord<z.ZodString, z.ZodUnknown>,
60
- S extends z.ZodTypeAny = z.ZodRecord<z.ZodString, z.ZodUnknown>,
61
- > = z.infer<ReturnType<typeof createConfigSchema<V, S>>>;
62
- export type Input<I extends z.ZodTypeAny> = z.infer<
63
- ReturnType<typeof createInputSchema<I>>
64
- >;
65
- export type Output<T extends z.ZodTypeAny> = z.infer<
66
- ReturnType<typeof createOutputSchema<T>>
67
- >;
68
- export interface Plugin<
69
- TInputSchema extends z.ZodTypeAny,
70
- TOutputSchema extends z.ZodTypeAny,
71
- TConfigSchema extends z.ZodTypeAny,
72
- > {
73
- readonly id: string;
74
- readonly type: PluginType;
75
- initialize(
76
- config?: z.infer<TConfigSchema>,
77
- ): Effect.Effect<void, ConfigurationError, PluginLoggerTag>;
78
- execute(
79
- input: z.infer<TInputSchema>,
80
- ): Effect.Effect<
81
- z.infer<TOutputSchema>,
82
- PluginExecutionError,
83
- PluginLoggerTag
84
- >;
85
- shutdown(): Effect.Effect<void, never, PluginLoggerTag>;
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>;
86
42
  }
87
43
  export type PluginType = "transformer" | "distributor" | "source";
88
44
  export interface PluginMetadata {
89
- remoteUrl: string;
90
- type?: PluginType;
91
- configSchema: JSONSchemaType<any>;
92
- inputSchema: JSONSchemaType<any>;
93
- outputSchema: JSONSchemaType<any>;
94
- version?: string;
95
- description?: string;
45
+ remoteUrl: string;
46
+ type?: PluginType;
47
+ configSchema: JSONSchemaType<any>;
48
+ inputSchema: JSONSchemaType<any>;
49
+ outputSchema: JSONSchemaType<any>;
50
+ version?: string;
51
+ description?: string;
96
52
  }
97
53
  export interface PluginRegistry {
98
- [pluginId: string]: PluginMetadata;
54
+ [pluginId: string]: PluginMetadata;
99
55
  }
100
56
  export interface PluginLogger {
101
- readonly logInfo: (message: string, context?: unknown) => Effect.Effect<void>;
102
- readonly logWarning: (
103
- message: string,
104
- context?: unknown,
105
- ) => Effect.Effect<void>;
106
- readonly logError: (
107
- message: string,
108
- error?: unknown,
109
- context?: unknown,
110
- ) => Effect.Effect<void>;
111
- readonly logDebug: (
112
- message: string,
113
- context?: unknown,
114
- ) => Effect.Effect<void>;
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>;
115
61
  }
116
- declare const PluginLoggerTag_base: Context.TagClass<
117
- PluginLoggerTag,
118
- "PluginLogger",
119
- PluginLogger
120
- >;
121
- export declare class PluginLoggerTag extends PluginLoggerTag_base {}
122
- //# sourceMappingURL=plugin.d.ts.map
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
package/package.json CHANGED
@@ -1,9 +1,8 @@
1
1
  {
2
2
  "name": "every-plugin",
3
- "version": "0.0.3",
3
+ "version": "0.0.5",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
- "type": "module",
7
6
  "files": [
8
7
  "dist"
9
8
  ],