-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(plugin-system): Added a new package to support plugin-driven app…
…lications
- Loading branch information
1 parent
74dcfd9
commit 081bd2c
Showing
33 changed files
with
3,648 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,190 @@ | ||
## API Report File for "@storm-stack/plugin-system" | ||
|
||
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). | ||
```ts | ||
import pino from "pino"; | ||
import { StormConfig } from "@storm-software/config-tools"; | ||
import { Temporal } from "@js-temporal/polyfill"; | ||
import * as z from "zod"; | ||
|
||
// @public (undocumented) | ||
interface DefinitionFileContents { | ||
// (undocumented) | ||
content: string; | ||
// (undocumented) | ||
filePath: string; | ||
} | ||
export { DefinitionFileContents }; | ||
export { DefinitionFileContents as DefinitionFileContents_alias_1 }; | ||
|
||
// @public (undocumented) | ||
interface IPluginLoader<TPluginModule = any> { | ||
// (undocumented) | ||
execute: ( | ||
instance: PluginInstance, | ||
options: Record<string, any> | ||
) => Promise<void>; | ||
// (undocumented) | ||
isValid: (module: TPluginModule) => boolean; | ||
// (undocumented) | ||
load: (definition: PluginDefinition) => Promise<TPluginModule>; | ||
} | ||
export { IPluginLoader }; | ||
export { IPluginLoader as IPluginLoader_alias_1 }; | ||
|
||
// @public (undocumented) | ||
interface IPluginManager { | ||
discover(): Promise<Set<PluginDefinition>>; | ||
instantiate( | ||
provider: string, | ||
options?: Record<string, any> | ||
): Promise<PluginInstance>; | ||
register(provider: string): boolean; | ||
} | ||
export { IPluginManager }; | ||
export { IPluginManager as IPluginManager_alias_1 }; | ||
|
||
// @public (undocumented) | ||
interface PluginDefinition<TPluginOptions = any> { | ||
configPath?: string; | ||
dependencies: string[]; | ||
description?: string; | ||
id: string; | ||
imagePath?: string; | ||
loader: string; | ||
name: string; | ||
options: TPluginOptions; | ||
packagePath: string; | ||
provider: string; | ||
tags: string[]; | ||
version: string; | ||
} | ||
export { PluginDefinition }; | ||
export { PluginDefinition as PluginDefinition_alias_1 }; | ||
|
||
// @public (undocumented) | ||
type PluginDiscoveryMode = "auto" | "fallback" | "none"; | ||
|
||
// @public (undocumented) | ||
const PluginDiscoveryMode: { | ||
AUTO: PluginDiscoveryMode; | ||
FALLBACK: PluginDiscoveryMode; | ||
NONE: PluginDiscoveryMode; | ||
}; | ||
export { PluginDiscoveryMode }; | ||
export { PluginDiscoveryMode as PluginDiscoveryMode_alias_1 }; | ||
|
||
// @public (undocumented) | ||
interface PluginInstance<TPluginModule = any, TPluginOptions = any> { | ||
// (undocumented) | ||
definition: PluginDefinition<TPluginOptions>; | ||
// (undocumented) | ||
executionDateTime: StormDateTime; | ||
// (undocumented) | ||
loader: IPluginLoader<TPluginModule>; | ||
// (undocumented) | ||
module: TPluginModule; | ||
// (undocumented) | ||
options: TPluginOptions; | ||
} | ||
export { PluginInstance }; | ||
export { PluginInstance as PluginInstance_alias_1 }; | ||
|
||
// @public | ||
abstract class PluginLoader<TPluginModule = any> | ||
implements IPluginLoader<TPluginModule> | ||
{ | ||
// (undocumented) | ||
abstract execute: ( | ||
instance: PluginInstance<any, any>, | ||
options: Record<string, any> | ||
) => Promise<void>; | ||
// (undocumented) | ||
isValid: (module: TPluginModule) => boolean; | ||
// (undocumented) | ||
load: (definition: PluginDefinition<any>) => Promise<TPluginModule>; | ||
} | ||
export { PluginLoader }; | ||
export { PluginLoader as PluginLoader_alias_1 }; | ||
export { PluginLoader as PluginLoader_alias_2 }; | ||
|
||
// @public | ||
class PluginManager { | ||
// (undocumented) | ||
static create: ( | ||
logger: StormLog, | ||
config: Omit<Partial<PluginManagerConfig>, "defaultLoader"> & | ||
PluginManagerConfig["defaultLoader"] | ||
) => Promise<PluginManager>; | ||
// (undocumented) | ||
discover: () => Promise<Map<string, PluginDefinition<any>>>; | ||
// (undocumented) | ||
execute: ( | ||
provider: string, | ||
options?: Record<string, any>, | ||
executionDateTime?: StormDateTime | ||
) => Promise<Record<string, Error | null>>; | ||
// (undocumented) | ||
getLoaders(): Map<string, IPluginLoader>; | ||
// (undocumented) | ||
getRegistry(): Map<string, PluginDefinition<any>>; | ||
// (undocumented) | ||
getStore(): Map<string, PluginInstance>; | ||
// (undocumented) | ||
instantiate: ( | ||
provider: string, | ||
options?: Record<string, any> | ||
) => Promise<PluginInstance>; | ||
// (undocumented) | ||
register: (provider: string) => Promise<PluginDefinition>; | ||
} | ||
export { PluginManager }; | ||
export { PluginManager as PluginManager_alias_1 }; | ||
export { PluginManager as PluginManager_alias_2 }; | ||
|
||
// @public (undocumented) | ||
interface PluginManagerConfig { | ||
defaultLoader: string; | ||
discoveryMode: PluginDiscoveryMode; | ||
rootPath: string; | ||
useNodeModules: boolean; | ||
} | ||
export { PluginManagerConfig }; | ||
export { PluginManagerConfig as PluginManagerConfig_alias_1 }; | ||
|
||
// @public (undocumented) | ||
type PluginSystemErrorCode = | ||
| ErrorCode | ||
| "module_not_found" | ||
| "plugin_not_found" | ||
| "plugin_loading_failure"; | ||
|
||
// @public (undocumented) | ||
const PluginSystemErrorCode: { | ||
module_not_found: PluginSystemErrorCode; | ||
plugin_not_found: PluginSystemErrorCode; | ||
plugin_loading_failure: PluginSystemErrorCode; | ||
success: ErrorCode; | ||
missing_issue_code: ErrorCode; | ||
invalid_config: ErrorCode; | ||
failed_to_load_file: ErrorCode; | ||
missing_context: ErrorCode; | ||
record_not_found: ErrorCode; | ||
required_field_missing: ErrorCode; | ||
database_query_error: ErrorCode; | ||
model_validation_error: ErrorCode; | ||
field_validation_error: ErrorCode; | ||
invalid_parameter: ErrorCode; | ||
invalid_request: ErrorCode; | ||
type_error: ErrorCode; | ||
processing_error: ErrorCode; | ||
internal_server_error: ErrorCode; | ||
user_not_logged_in: ErrorCode; | ||
unknown_cause: ErrorCode; | ||
}; | ||
export { PluginSystemErrorCode }; | ||
export { PluginSystemErrorCode as PluginSystemErrorCode_alias_1 }; | ||
|
||
// (No @packageDocumentation comment for this package) | ||
``` |
Oops, something went wrong.