@dmno/configraph
Advanced tools
Comparing version 0.0.1 to 0.0.2
@@ -94,6 +94,8 @@ import graphlib from '@dagrejs/graphlib'; | ||
schemaErrors?: Array<SerializedConfigraphError>; | ||
ownedPluginNames: Array<string>; | ||
injectedPluginNames: Array<string>; | ||
ownedPluginIds: Array<string>; | ||
injectedPluginIds: Array<string>; | ||
icon?: string; | ||
color?: string; | ||
}; | ||
type SerializedConfigraphPlugin = Pick<ConfigraphPlugin, 'pluginType' | 'instanceId' | 'isValid' | 'isSchemaValid' | 'parentEntityId'> & { | ||
type SerializedConfigraphPlugin = Pick<ConfigraphPlugin, 'pluginType' | 'instanceId' | 'isValid' | 'isSchemaValid' | 'parentEntityId' | 'injectedByEntityIds' | 'icon' | 'packageMetadata'> & { | ||
usedByConfigItemResolverPaths?: Array<string>; | ||
@@ -103,3 +105,4 @@ schemaErrors?: Array<SerializedConfigraphError>; | ||
}; | ||
type SerializedConfigraphNode = Pick<ConfigraphNode, 'key' | 'isValid' | 'isSchemaValid' | 'resolvedRawValue' | 'resolvedValue' | 'isResolved'> & { | ||
type SerializedConfigraphNode = Pick<ConfigraphNode, 'key' | 'isValid' | 'isSchemaValid' | 'resolvedValue' | 'resolvedRawValue' | 'isResolved'> & { | ||
id: string; | ||
dataType: SerializedConfigraphDataType; | ||
@@ -112,2 +115,3 @@ children: Record<string, SerializedConfigraphNode>; | ||
resolver?: SerializedResolver; | ||
isCoerced?: boolean; | ||
mappedToNodePath: string | undefined; | ||
@@ -144,2 +148,8 @@ overrides?: Array<ConfigValueOverride>; | ||
type PluginInputValue = InlineValueResolverDef; | ||
type PluginPackageMetadata = { | ||
name: string; | ||
version: string; | ||
repositoryUrl?: string; | ||
websiteUrl?: string; | ||
}; | ||
declare abstract class ConfigraphPlugin<NodeMetadata = unknown, EntityClass extends ConfigraphEntity = ConfigraphEntity> { | ||
@@ -149,2 +159,3 @@ readonly instanceId: string; | ||
inputSchema: PluginInputSchema<NodeMetadata>; | ||
packageJson?: any; | ||
}; | ||
@@ -156,2 +167,3 @@ /** name of the plugin itself - which is the name of the class */ | ||
get parentEntityId(): string; | ||
injectedByEntityIds: Array<string>; | ||
readonly inputSchema: PluginInputSchema<NodeMetadata>; | ||
@@ -161,7 +173,9 @@ internalEntity?: EntityClass; | ||
inputSchema: PluginInputSchema<NodeMetadata>; | ||
packageJson?: any; | ||
}); | ||
static packageMetadata?: PluginPackageMetadata; | ||
EntityClass: (new (...args: Array<any>) => N); | ||
initInternalEntity(graphRoot: Configraph, parentEntityId: string): void; | ||
resolvers: Array<ConfigValueResolver>; | ||
createResolver(def: Parameters<typeof createResolver>[0]): ReturnType<typeof createResolver>; | ||
createResolver(defOrFn: ConfigValueResolverDef | (() => ConfigValueResolverDef | ConfigValueResolver)): ConfigValueResolver; | ||
/** fetch a resolved plugin input value within a resolver function */ | ||
@@ -173,2 +187,3 @@ inputValue(inputKey: string): ConfigValue; | ||
get schemaErrors(): SchemaError[] | undefined; | ||
get packageMetadata(): PluginPackageMetadata | undefined; | ||
toCoreJSON(): SerializedConfigraphPlugin; | ||
@@ -225,13 +240,10 @@ } | ||
externalDocs?: ExternalDocsEntry | Array<ExternalDocsEntry>; | ||
/** dmno config ui specific options */ | ||
ui?: { | ||
/** icon to use, see https://icones.js.org/ for available options | ||
* @example mdi:aws | ||
*/ | ||
icon?: string; | ||
/** color (any valid css color) | ||
* @example FF0000 | ||
*/ | ||
color?: string; | ||
}; | ||
/** icon to use, see https://icones.js.org/ for available options | ||
* @example mdi:aws | ||
*/ | ||
icon?: string; | ||
/** color (any valid css color) | ||
* @example FF0000 | ||
*/ | ||
color?: string; | ||
}; | ||
@@ -259,2 +271,4 @@ declare class ConfigraphEntity<EntityMetadata = unknown, NodeMetadata = unknown, N extends ConfigraphNode = ConfigraphNode> { | ||
get label(): ConfigraphEntityDef<EntityMetadata, NodeMetadata>["label"]; | ||
get color(): ConfigraphEntityDef<EntityMetadata, NodeMetadata>["color"]; | ||
get icon(): ConfigraphEntityDef<EntityMetadata, NodeMetadata>["icon"]; | ||
get isRoot(): boolean; | ||
@@ -286,2 +300,4 @@ get parentEntity(): ConfigraphEntity | undefined; | ||
injectedPluginIds: string[]; | ||
color: ConfigraphEntityDef<EntityMetadata, NodeMetadata>["color"]; | ||
icon: ConfigraphEntityDef<EntityMetadata, NodeMetadata>["icon"]; | ||
}; | ||
@@ -298,3 +314,3 @@ } | ||
type MaybePromise<T> = T | Promise<T>; | ||
type ResolverDefinition = { | ||
type ConfigValueResolverDef = { | ||
createdByPluginId?: string; | ||
@@ -322,3 +338,3 @@ /** set a specific icon for the resolver, will default to the plugin's icon if set */ | ||
}); | ||
declare function createResolver(def: ResolverDefinition): ConfigValueResolver; | ||
declare function createResolver(defOrFn: ConfigValueResolverDef | (() => ConfigValueResolverDef | ConfigValueResolver)): ConfigValueResolver; | ||
type ResolverBranchDefinition = { | ||
@@ -332,4 +348,4 @@ id: string; | ||
declare class ConfigValueResolver { | ||
readonly def: ResolverDefinition; | ||
constructor(def: ResolverDefinition); | ||
readonly def: ConfigValueResolverDef; | ||
constructor(def: ConfigValueResolverDef); | ||
linkedBranch?: ConfigValueResolverBranch; | ||
@@ -348,2 +364,3 @@ branches: Array<ConfigValueResolverBranch> | undefined; | ||
get configNode(): ConfigraphNode; | ||
get isAttachedToConfigNode(): boolean; | ||
get parentResolver(): ConfigValueResolver | undefined; | ||
@@ -491,2 +508,4 @@ get branchIdPath(): string | undefined; | ||
coerce(val: any, ctx?: ResolverContext): any | CoercionError; | ||
/** helper to run coerce and validate - useful if using data types outside of dmno */ | ||
coerceAndValidate(val: any): any; | ||
/** helper to unroll config schema using the type chain of parent "extends" */ | ||
@@ -662,2 +681,3 @@ private getDefItem; | ||
sourceType: string; | ||
icon: string; | ||
sourceLabel?: string; | ||
@@ -702,2 +722,3 @@ /** the value of the override */ | ||
children: Record<string, typeof this>; | ||
get flatChildren(): Array<typeof this>; | ||
get parentNode(): ConfigraphNode | undefined; | ||
@@ -796,2 +817,2 @@ get parentEntity(): ConfigraphEntity | undefined; | ||
export { type CacheMode, CoercionError, ConfigLoadError, type ConfigValue, ConfigValueResolver, Configraph, ConfigraphBaseTypes, ConfigraphCacheEntry, ConfigraphCachingProvider, ConfigraphDataType, type ConfigraphDataTypeDefinition, type ConfigraphDataTypeDefinitionOrShorthand, type ConfigraphDataTypeFactoryFn, ConfigraphDataTypesRegistry, ConfigraphEntity, ConfigraphEntityTemplate, ConfigraphError, ConfigraphNode, type ConfigraphPickSchemaEntryOrShorthand, ConfigraphPlugin, type ConfigraphTypeExtendsDefinition, EmptyRequiredValueError, type ErrorLocation, type ErrorWithMetadata, type ExternalDocsEntry, type InlineValueResolverDef, type PluginInputValue, ResolutionError, ResolverContext, SchemaError, type SerializedConfigraphDataType, type SerializedConfigraphEntity, type SerializedConfigraphError, type SerializedConfigraphNode, type SerializedConfigraphPlugin, type SerializedGraph, type SerializedResolver, type SerializedResolverBranch, type TypeValidationResult, ValidationError, cacheFunctionResult, collect, configPath, createConfigraphDataType, createResolver, getResolverCtx, getTsDefinitionForNode, inject, switchBy, switchByDmnoEnv, switchByNodeEnv }; | ||
export { type CacheMode, CoercionError, ConfigLoadError, type ConfigValue, ConfigValueResolver, type ConfigValueResolverDef, Configraph, ConfigraphBaseTypes, ConfigraphCacheEntry, ConfigraphCachingProvider, ConfigraphDataType, type ConfigraphDataTypeDefinition, type ConfigraphDataTypeDefinitionOrShorthand, type ConfigraphDataTypeFactoryFn, ConfigraphDataTypesRegistry, ConfigraphEntity, type ConfigraphEntityDef, ConfigraphEntityTemplate, ConfigraphError, ConfigraphNode, type ConfigraphPickSchemaEntryOrShorthand, ConfigraphPlugin, type ConfigraphTypeExtendsDefinition, EmptyRequiredValueError, type ErrorLocation, type ErrorWithMetadata, type ExternalDocsEntry, type InlineValueResolverDef, type PluginInputValue, ResolutionError, ResolverContext, SchemaError, type SerializedConfigraphDataType, type SerializedConfigraphEntity, type SerializedConfigraphError, type SerializedConfigraphNode, type SerializedConfigraphPlugin, type SerializedGraph, type SerializedResolver, type SerializedResolverBranch, type TypeValidationResult, ValidationError, cacheFunctionResult, collect, configPath, createConfigraphDataType, createResolver, getResolverCtx, getTsDefinitionForNode, inject, switchBy, switchByDmnoEnv, switchByNodeEnv }; |
{ | ||
"name": "@dmno/configraph", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "reactive configuration graph - core that powers DMNO", | ||
@@ -34,5 +34,5 @@ "author": "dmno-dev", | ||
"tsup": "^8.2.4", | ||
"vite-node": "^2.1.1", | ||
"vite-node": "^2.1.2", | ||
"vite-tsconfig-paths": "^5.0.1", | ||
"vitest": "^2.1.1", | ||
"vitest": "^2.1.2", | ||
"@dmno/encryption-lib": "0.0.0", | ||
@@ -39,0 +39,0 @@ "@dmno/eslint-config": "0.0.0", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
348934
3177
1