@vlian/framework 1.0.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/LICENSE +191 -0
- package/README.md +130 -0
- package/dist/components/index.cjs +6 -0
- package/dist/components/index.cjs.map +1 -0
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.js +3 -0
- package/dist/components/index.js.map +1 -0
- package/dist/core/Test.cjs +66 -0
- package/dist/core/Test.cjs.map +1 -0
- package/dist/core/Test.d.ts +6 -0
- package/dist/core/Test.d.ts.map +1 -0
- package/dist/core/Test.js +15 -0
- package/dist/core/Test.js.map +1 -0
- package/dist/core/app/AppContext.cjs +344 -0
- package/dist/core/app/AppContext.cjs.map +1 -0
- package/dist/core/app/AppContext.d.ts +110 -0
- package/dist/core/app/AppContext.d.ts.map +1 -0
- package/dist/core/app/AppContext.js +333 -0
- package/dist/core/app/AppContext.js.map +1 -0
- package/dist/core/app/AppContext.types.cjs +6 -0
- package/dist/core/app/AppContext.types.cjs.map +1 -0
- package/dist/core/app/AppContext.types.d.ts +147 -0
- package/dist/core/app/AppContext.types.d.ts.map +1 -0
- package/dist/core/app/AppContext.types.js +5 -0
- package/dist/core/app/AppContext.types.js.map +1 -0
- package/dist/core/app/BasicLayout.cjs +89 -0
- package/dist/core/app/BasicLayout.cjs.map +1 -0
- package/dist/core/app/BasicLayout.d.ts +13 -0
- package/dist/core/app/BasicLayout.d.ts.map +1 -0
- package/dist/core/app/BasicLayout.js +39 -0
- package/dist/core/app/BasicLayout.js.map +1 -0
- package/dist/core/app/DefaultApp.cjs +201 -0
- package/dist/core/app/DefaultApp.cjs.map +1 -0
- package/dist/core/app/DefaultApp.d.ts +31 -0
- package/dist/core/app/DefaultApp.d.ts.map +1 -0
- package/dist/core/app/DefaultApp.js +192 -0
- package/dist/core/app/DefaultApp.js.map +1 -0
- package/dist/core/app/index.cjs +43 -0
- package/dist/core/app/index.cjs.map +1 -0
- package/dist/core/app/index.d.ts +9 -0
- package/dist/core/app/index.d.ts.map +1 -0
- package/dist/core/app/index.js +7 -0
- package/dist/core/app/index.js.map +1 -0
- package/dist/core/config/AppConfig.cjs +141 -0
- package/dist/core/config/AppConfig.cjs.map +1 -0
- package/dist/core/config/AppConfig.d.ts +89 -0
- package/dist/core/config/AppConfig.d.ts.map +1 -0
- package/dist/core/config/AppConfig.js +133 -0
- package/dist/core/config/AppConfig.js.map +1 -0
- package/dist/core/config/ConfigLoader.cjs +243 -0
- package/dist/core/config/ConfigLoader.cjs.map +1 -0
- package/dist/core/config/ConfigLoader.d.ts +103 -0
- package/dist/core/config/ConfigLoader.d.ts.map +1 -0
- package/dist/core/config/ConfigLoader.js +229 -0
- package/dist/core/config/ConfigLoader.js.map +1 -0
- package/dist/core/config/ConfigValidator.cjs +135 -0
- package/dist/core/config/ConfigValidator.cjs.map +1 -0
- package/dist/core/config/ConfigValidator.d.ts +85 -0
- package/dist/core/config/ConfigValidator.d.ts.map +1 -0
- package/dist/core/config/ConfigValidator.js +121 -0
- package/dist/core/config/ConfigValidator.js.map +1 -0
- package/dist/core/config/index.cjs +30 -0
- package/dist/core/config/index.cjs.map +1 -0
- package/dist/core/config/index.d.ts +7 -0
- package/dist/core/config/index.d.ts.map +1 -0
- package/dist/core/config/index.js +7 -0
- package/dist/core/config/index.js.map +1 -0
- package/dist/core/dev/DevTools.cjs +374 -0
- package/dist/core/dev/DevTools.cjs.map +1 -0
- package/dist/core/dev/DevTools.d.ts +47 -0
- package/dist/core/dev/DevTools.d.ts.map +1 -0
- package/dist/core/dev/DevTools.js +363 -0
- package/dist/core/dev/DevTools.js.map +1 -0
- package/dist/core/error/ErrorBoundary.cjs +331 -0
- package/dist/core/error/ErrorBoundary.cjs.map +1 -0
- package/dist/core/error/ErrorBoundary.d.ts +123 -0
- package/dist/core/error/ErrorBoundary.d.ts.map +1 -0
- package/dist/core/error/ErrorBoundary.js +327 -0
- package/dist/core/error/ErrorBoundary.js.map +1 -0
- package/dist/core/error/index.cjs +26 -0
- package/dist/core/error/index.cjs.map +1 -0
- package/dist/core/error/index.d.ts +6 -0
- package/dist/core/error/index.d.ts.map +1 -0
- package/dist/core/error/index.js +5 -0
- package/dist/core/error/index.js.map +1 -0
- package/dist/core/index.cjs +140 -0
- package/dist/core/index.cjs.map +1 -0
- package/dist/core/index.d.ts +53 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +66 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/initialization/InitializationErrorThrower.cjs +77 -0
- package/dist/core/initialization/InitializationErrorThrower.cjs.map +1 -0
- package/dist/core/initialization/InitializationErrorThrower.d.ts +8 -0
- package/dist/core/initialization/InitializationErrorThrower.d.ts.map +1 -0
- package/dist/core/initialization/InitializationErrorThrower.js +30 -0
- package/dist/core/initialization/InitializationErrorThrower.js.map +1 -0
- package/dist/core/initialization/index.cjs +28 -0
- package/dist/core/initialization/index.cjs.map +1 -0
- package/dist/core/initialization/index.d.ts +8 -0
- package/dist/core/initialization/index.d.ts.map +1 -0
- package/dist/core/initialization/index.js +7 -0
- package/dist/core/initialization/index.js.map +1 -0
- package/dist/core/initialization/initialization.cjs +211 -0
- package/dist/core/initialization/initialization.cjs.map +1 -0
- package/dist/core/initialization/initialization.d.ts +127 -0
- package/dist/core/initialization/initialization.d.ts.map +1 -0
- package/dist/core/initialization/initialization.js +224 -0
- package/dist/core/initialization/initialization.js.map +1 -0
- package/dist/core/initialization/initializationErrorState.cjs +68 -0
- package/dist/core/initialization/initializationErrorState.cjs.map +1 -0
- package/dist/core/initialization/initializationErrorState.d.ts +36 -0
- package/dist/core/initialization/initializationErrorState.d.ts.map +1 -0
- package/dist/core/initialization/initializationErrorState.js +60 -0
- package/dist/core/initialization/initializationErrorState.js.map +1 -0
- package/dist/core/middleware.cjs +75 -0
- package/dist/core/middleware.cjs.map +1 -0
- package/dist/core/middleware.d.ts +37 -0
- package/dist/core/middleware.d.ts.map +1 -0
- package/dist/core/middleware.js +61 -0
- package/dist/core/middleware.js.map +1 -0
- package/dist/core/plugin/PluginEventBus.cjs +300 -0
- package/dist/core/plugin/PluginEventBus.cjs.map +1 -0
- package/dist/core/plugin/PluginEventBus.d.ts +170 -0
- package/dist/core/plugin/PluginEventBus.d.ts.map +1 -0
- package/dist/core/plugin/PluginEventBus.js +286 -0
- package/dist/core/plugin/PluginEventBus.js.map +1 -0
- package/dist/core/plugin/PluginSandbox.cjs +139 -0
- package/dist/core/plugin/PluginSandbox.cjs.map +1 -0
- package/dist/core/plugin/PluginSandbox.d.ts +102 -0
- package/dist/core/plugin/PluginSandbox.d.ts.map +1 -0
- package/dist/core/plugin/PluginSandbox.js +125 -0
- package/dist/core/plugin/PluginSandbox.js.map +1 -0
- package/dist/core/plugin.cjs +496 -0
- package/dist/core/plugin.cjs.map +1 -0
- package/dist/core/plugin.d.ts +221 -0
- package/dist/core/plugin.d.ts.map +1 -0
- package/dist/core/plugin.js +438 -0
- package/dist/core/plugin.js.map +1 -0
- package/dist/core/router/RouterManager.cjs +239 -0
- package/dist/core/router/RouterManager.cjs.map +1 -0
- package/dist/core/router/RouterManager.d.ts +83 -0
- package/dist/core/router/RouterManager.d.ts.map +1 -0
- package/dist/core/router/RouterManager.js +223 -0
- package/dist/core/router/RouterManager.js.map +1 -0
- package/dist/core/router/adapter/AdapterManager.cjs +237 -0
- package/dist/core/router/adapter/AdapterManager.cjs.map +1 -0
- package/dist/core/router/adapter/AdapterManager.d.ts +95 -0
- package/dist/core/router/adapter/AdapterManager.d.ts.map +1 -0
- package/dist/core/router/adapter/AdapterManager.js +221 -0
- package/dist/core/router/adapter/AdapterManager.js.map +1 -0
- package/dist/core/router/adapter/index.cjs +24 -0
- package/dist/core/router/adapter/index.cjs.map +1 -0
- package/dist/core/router/adapter/index.d.ts +7 -0
- package/dist/core/router/adapter/index.d.ts.map +1 -0
- package/dist/core/router/adapter/index.js +7 -0
- package/dist/core/router/adapter/index.js.map +1 -0
- package/dist/core/router/adapter/react-router/ReactRouterAdapter.cjs +130 -0
- package/dist/core/router/adapter/react-router/ReactRouterAdapter.cjs.map +1 -0
- package/dist/core/router/adapter/react-router/ReactRouterAdapter.d.ts +44 -0
- package/dist/core/router/adapter/react-router/ReactRouterAdapter.d.ts.map +1 -0
- package/dist/core/router/adapter/react-router/ReactRouterAdapter.js +116 -0
- package/dist/core/router/adapter/react-router/ReactRouterAdapter.js.map +1 -0
- package/dist/core/router/adapter/react-router/index.cjs +22 -0
- package/dist/core/router/adapter/react-router/index.cjs.map +1 -0
- package/dist/core/router/adapter/react-router/index.d.ts +5 -0
- package/dist/core/router/adapter/react-router/index.d.ts.map +1 -0
- package/dist/core/router/adapter/react-router/index.js +5 -0
- package/dist/core/router/adapter/react-router/index.js.map +1 -0
- package/dist/core/router/adapter/types.cjs +8 -0
- package/dist/core/router/adapter/types.cjs.map +1 -0
- package/dist/core/router/adapter/types.d.ts +112 -0
- package/dist/core/router/adapter/types.d.ts.map +1 -0
- package/dist/core/router/adapter/types.js +7 -0
- package/dist/core/router/adapter/types.js.map +1 -0
- package/dist/core/router/dev/RouterDevTools.cjs +410 -0
- package/dist/core/router/dev/RouterDevTools.cjs.map +1 -0
- package/dist/core/router/dev/RouterDevTools.d.ts +10 -0
- package/dist/core/router/dev/RouterDevTools.d.ts.map +1 -0
- package/dist/core/router/dev/RouterDevTools.js +363 -0
- package/dist/core/router/dev/RouterDevTools.js.map +1 -0
- package/dist/core/router/dev/index.cjs +22 -0
- package/dist/core/router/dev/index.cjs.map +1 -0
- package/dist/core/router/dev/index.d.ts +5 -0
- package/dist/core/router/dev/index.d.ts.map +1 -0
- package/dist/core/router/dev/index.js +5 -0
- package/dist/core/router/dev/index.js.map +1 -0
- package/dist/core/router/dynamic/DynamicRouteManager.cjs +195 -0
- package/dist/core/router/dynamic/DynamicRouteManager.cjs.map +1 -0
- package/dist/core/router/dynamic/DynamicRouteManager.d.ts +72 -0
- package/dist/core/router/dynamic/DynamicRouteManager.d.ts.map +1 -0
- package/dist/core/router/dynamic/DynamicRouteManager.js +179 -0
- package/dist/core/router/dynamic/DynamicRouteManager.js.map +1 -0
- package/dist/core/router/dynamic/index.cjs +22 -0
- package/dist/core/router/dynamic/index.cjs.map +1 -0
- package/dist/core/router/dynamic/index.d.ts +5 -0
- package/dist/core/router/dynamic/index.d.ts.map +1 -0
- package/dist/core/router/dynamic/index.js +5 -0
- package/dist/core/router/dynamic/index.js.map +1 -0
- package/dist/core/router/errors/RouterError.cjs +63 -0
- package/dist/core/router/errors/RouterError.cjs.map +1 -0
- package/dist/core/router/errors/RouterError.d.ts +48 -0
- package/dist/core/router/errors/RouterError.d.ts.map +1 -0
- package/dist/core/router/errors/RouterError.js +48 -0
- package/dist/core/router/errors/RouterError.js.map +1 -0
- package/dist/core/router/errors/index.cjs +22 -0
- package/dist/core/router/errors/index.cjs.map +1 -0
- package/dist/core/router/errors/index.d.ts +5 -0
- package/dist/core/router/errors/index.d.ts.map +1 -0
- package/dist/core/router/errors/index.js +5 -0
- package/dist/core/router/errors/index.js.map +1 -0
- package/dist/core/router/index.cjs +38 -0
- package/dist/core/router/index.cjs.map +1 -0
- package/dist/core/router/index.d.ts +17 -0
- package/dist/core/router/index.d.ts.map +1 -0
- package/dist/core/router/index.js +32 -0
- package/dist/core/router/index.js.map +1 -0
- package/dist/core/router/lifecycle/RouterLifecycleManager.cjs +146 -0
- package/dist/core/router/lifecycle/RouterLifecycleManager.cjs.map +1 -0
- package/dist/core/router/lifecycle/RouterLifecycleManager.d.ts +57 -0
- package/dist/core/router/lifecycle/RouterLifecycleManager.d.ts.map +1 -0
- package/dist/core/router/lifecycle/RouterLifecycleManager.js +130 -0
- package/dist/core/router/lifecycle/RouterLifecycleManager.js.map +1 -0
- package/dist/core/router/lifecycle/index.cjs +22 -0
- package/dist/core/router/lifecycle/index.cjs.map +1 -0
- package/dist/core/router/lifecycle/index.d.ts +5 -0
- package/dist/core/router/lifecycle/index.d.ts.map +1 -0
- package/dist/core/router/lifecycle/index.js +5 -0
- package/dist/core/router/lifecycle/index.js.map +1 -0
- package/dist/core/router/middleware/RouterMiddlewareManager.cjs +175 -0
- package/dist/core/router/middleware/RouterMiddlewareManager.cjs.map +1 -0
- package/dist/core/router/middleware/RouterMiddlewareManager.d.ts +61 -0
- package/dist/core/router/middleware/RouterMiddlewareManager.d.ts.map +1 -0
- package/dist/core/router/middleware/RouterMiddlewareManager.js +159 -0
- package/dist/core/router/middleware/RouterMiddlewareManager.js.map +1 -0
- package/dist/core/router/middleware/auth.cjs +68 -0
- package/dist/core/router/middleware/auth.cjs.map +1 -0
- package/dist/core/router/middleware/auth.d.ts +55 -0
- package/dist/core/router/middleware/auth.d.ts.map +1 -0
- package/dist/core/router/middleware/auth.js +63 -0
- package/dist/core/router/middleware/auth.js.map +1 -0
- package/dist/core/router/middleware/index.cjs +24 -0
- package/dist/core/router/middleware/index.cjs.map +1 -0
- package/dist/core/router/middleware/index.d.ts +7 -0
- package/dist/core/router/middleware/index.d.ts.map +1 -0
- package/dist/core/router/middleware/index.js +7 -0
- package/dist/core/router/middleware/index.js.map +1 -0
- package/dist/core/router/middleware/types.cjs +8 -0
- package/dist/core/router/middleware/types.cjs.map +1 -0
- package/dist/core/router/middleware/types.d.ts +83 -0
- package/dist/core/router/middleware/types.d.ts.map +1 -0
- package/dist/core/router/middleware/types.js +7 -0
- package/dist/core/router/middleware/types.js.map +1 -0
- package/dist/core/router/monitoring/RouterMonitoring.cjs +229 -0
- package/dist/core/router/monitoring/RouterMonitoring.cjs.map +1 -0
- package/dist/core/router/monitoring/RouterMonitoring.d.ts +135 -0
- package/dist/core/router/monitoring/RouterMonitoring.d.ts.map +1 -0
- package/dist/core/router/monitoring/RouterMonitoring.js +213 -0
- package/dist/core/router/monitoring/RouterMonitoring.js.map +1 -0
- package/dist/core/router/monitoring/index.cjs +22 -0
- package/dist/core/router/monitoring/index.cjs.map +1 -0
- package/dist/core/router/monitoring/index.d.ts +5 -0
- package/dist/core/router/monitoring/index.d.ts.map +1 -0
- package/dist/core/router/monitoring/index.js +5 -0
- package/dist/core/router/monitoring/index.js.map +1 -0
- package/dist/core/router/navigation/RouterNavigation.cjs +186 -0
- package/dist/core/router/navigation/RouterNavigation.cjs.map +1 -0
- package/dist/core/router/navigation/RouterNavigation.d.ts +41 -0
- package/dist/core/router/navigation/RouterNavigation.d.ts.map +1 -0
- package/dist/core/router/navigation/RouterNavigation.js +137 -0
- package/dist/core/router/navigation/RouterNavigation.js.map +1 -0
- package/dist/core/router/navigation/index.cjs +22 -0
- package/dist/core/router/navigation/index.cjs.map +1 -0
- package/dist/core/router/navigation/index.d.ts +5 -0
- package/dist/core/router/navigation/index.d.ts.map +1 -0
- package/dist/core/router/navigation/index.js +5 -0
- package/dist/core/router/navigation/index.js.map +1 -0
- package/dist/core/router/performance/RouteCache.cjs +286 -0
- package/dist/core/router/performance/RouteCache.cjs.map +1 -0
- package/dist/core/router/performance/RouteCache.d.ts +108 -0
- package/dist/core/router/performance/RouteCache.d.ts.map +1 -0
- package/dist/core/router/performance/RouteCache.js +270 -0
- package/dist/core/router/performance/RouteCache.js.map +1 -0
- package/dist/core/router/performance/RoutePreloader.cjs +227 -0
- package/dist/core/router/performance/RoutePreloader.cjs.map +1 -0
- package/dist/core/router/performance/RoutePreloader.d.ts +104 -0
- package/dist/core/router/performance/RoutePreloader.d.ts.map +1 -0
- package/dist/core/router/performance/RoutePreloader.js +210 -0
- package/dist/core/router/performance/RoutePreloader.js.map +1 -0
- package/dist/core/router/performance/index.cjs +23 -0
- package/dist/core/router/performance/index.cjs.map +1 -0
- package/dist/core/router/performance/index.d.ts +6 -0
- package/dist/core/router/performance/index.d.ts.map +1 -0
- package/dist/core/router/performance/index.js +6 -0
- package/dist/core/router/performance/index.js.map +1 -0
- package/dist/core/router/plugin/RouterPluginManager.cjs +264 -0
- package/dist/core/router/plugin/RouterPluginManager.cjs.map +1 -0
- package/dist/core/router/plugin/RouterPluginManager.d.ts +75 -0
- package/dist/core/router/plugin/RouterPluginManager.d.ts.map +1 -0
- package/dist/core/router/plugin/RouterPluginManager.js +248 -0
- package/dist/core/router/plugin/RouterPluginManager.js.map +1 -0
- package/dist/core/router/plugin/index.cjs +23 -0
- package/dist/core/router/plugin/index.cjs.map +1 -0
- package/dist/core/router/plugin/index.d.ts +6 -0
- package/dist/core/router/plugin/index.d.ts.map +1 -0
- package/dist/core/router/plugin/index.js +6 -0
- package/dist/core/router/plugin/index.js.map +1 -0
- package/dist/core/router/plugin/types.cjs +41 -0
- package/dist/core/router/plugin/types.cjs.map +1 -0
- package/dist/core/router/plugin/types.d.ts +154 -0
- package/dist/core/router/plugin/types.d.ts.map +1 -0
- package/dist/core/router/plugin/types.js +33 -0
- package/dist/core/router/plugin/types.js.map +1 -0
- package/dist/core/router/types.cjs +6 -0
- package/dist/core/router/types.cjs.map +1 -0
- package/dist/core/router/types.d.ts +439 -0
- package/dist/core/router/types.d.ts.map +1 -0
- package/dist/core/router/types.js +5 -0
- package/dist/core/router/types.js.map +1 -0
- package/dist/core/router/utils/adapters/react-router/RouteErrorBoundary.cjs +139 -0
- package/dist/core/router/utils/adapters/react-router/RouteErrorBoundary.cjs.map +1 -0
- package/dist/core/router/utils/adapters/react-router/RouteErrorBoundary.d.ts +3 -0
- package/dist/core/router/utils/adapters/react-router/RouteErrorBoundary.d.ts.map +1 -0
- package/dist/core/router/utils/adapters/react-router/RouteErrorBoundary.js +129 -0
- package/dist/core/router/utils/adapters/react-router/RouteErrorBoundary.js.map +1 -0
- package/dist/core/router/utils/adapters/react-router/transform.cjs +261 -0
- package/dist/core/router/utils/adapters/react-router/transform.cjs.map +1 -0
- package/dist/core/router/utils/adapters/react-router/transform.d.ts +6 -0
- package/dist/core/router/utils/adapters/react-router/transform.d.ts.map +1 -0
- package/dist/core/router/utils/adapters/react-router/transform.js +246 -0
- package/dist/core/router/utils/adapters/react-router/transform.js.map +1 -0
- package/dist/core/router/utils/transform.cjs +772 -0
- package/dist/core/router/utils/transform.cjs.map +1 -0
- package/dist/core/router/utils/transform.d.ts +349 -0
- package/dist/core/router/utils/transform.d.ts.map +1 -0
- package/dist/core/router/utils/transform.js +781 -0
- package/dist/core/router/utils/transform.js.map +1 -0
- package/dist/core/router/validation/RouterConfigValidator.cjs +85 -0
- package/dist/core/router/validation/RouterConfigValidator.cjs.map +1 -0
- package/dist/core/router/validation/RouterConfigValidator.d.ts +58 -0
- package/dist/core/router/validation/RouterConfigValidator.d.ts.map +1 -0
- package/dist/core/router/validation/RouterConfigValidator.js +77 -0
- package/dist/core/router/validation/RouterConfigValidator.js.map +1 -0
- package/dist/core/router/validation/index.cjs +23 -0
- package/dist/core/router/validation/index.cjs.map +1 -0
- package/dist/core/router/validation/index.d.ts +6 -0
- package/dist/core/router/validation/index.d.ts.map +1 -0
- package/dist/core/router/validation/index.js +6 -0
- package/dist/core/router/validation/index.js.map +1 -0
- package/dist/core/router/validation/schema.cjs +91 -0
- package/dist/core/router/validation/schema.cjs.map +1 -0
- package/dist/core/router/validation/schema.d.ts +82 -0
- package/dist/core/router/validation/schema.d.ts.map +1 -0
- package/dist/core/router/validation/schema.js +81 -0
- package/dist/core/router/validation/schema.js.map +1 -0
- package/dist/core/router/version/RouteVersionManager.cjs +207 -0
- package/dist/core/router/version/RouteVersionManager.cjs.map +1 -0
- package/dist/core/router/version/RouteVersionManager.d.ts +125 -0
- package/dist/core/router/version/RouteVersionManager.d.ts.map +1 -0
- package/dist/core/router/version/RouteVersionManager.js +191 -0
- package/dist/core/router/version/RouteVersionManager.js.map +1 -0
- package/dist/core/router/version/index.cjs +22 -0
- package/dist/core/router/version/index.cjs.map +1 -0
- package/dist/core/router/version/index.d.ts +5 -0
- package/dist/core/router/version/index.d.ts.map +1 -0
- package/dist/core/router/version/index.js +5 -0
- package/dist/core/router/version/index.js.map +1 -0
- package/dist/core/splash/SplashScreen.cjs +257 -0
- package/dist/core/splash/SplashScreen.cjs.map +1 -0
- package/dist/core/splash/SplashScreen.d.ts +15 -0
- package/dist/core/splash/SplashScreen.d.ts.map +1 -0
- package/dist/core/splash/SplashScreen.js +207 -0
- package/dist/core/splash/SplashScreen.js.map +1 -0
- package/dist/core/splash/index.cjs +24 -0
- package/dist/core/splash/index.cjs.map +1 -0
- package/dist/core/splash/index.d.ts +6 -0
- package/dist/core/splash/index.d.ts.map +1 -0
- package/dist/core/splash/index.js +6 -0
- package/dist/core/splash/index.js.map +1 -0
- package/dist/core/splash/splashScreenUtils.cjs +40 -0
- package/dist/core/splash/splashScreenUtils.cjs.map +1 -0
- package/dist/core/splash/splashScreenUtils.d.ts +8 -0
- package/dist/core/splash/splashScreenUtils.d.ts.map +1 -0
- package/dist/core/splash/splashScreenUtils.js +30 -0
- package/dist/core/splash/splashScreenUtils.js.map +1 -0
- package/dist/core/startup/AppInstance.cjs +233 -0
- package/dist/core/startup/AppInstance.cjs.map +1 -0
- package/dist/core/startup/AppInstance.d.ts +135 -0
- package/dist/core/startup/AppInstance.d.ts.map +1 -0
- package/dist/core/startup/AppInstance.js +218 -0
- package/dist/core/startup/AppInstance.js.map +1 -0
- package/dist/core/startup/environment.cjs +171 -0
- package/dist/core/startup/environment.cjs.map +1 -0
- package/dist/core/startup/environment.d.ts +88 -0
- package/dist/core/startup/environment.d.ts.map +1 -0
- package/dist/core/startup/environment.js +154 -0
- package/dist/core/startup/environment.js.map +1 -0
- package/dist/core/startup/index.cjs +25 -0
- package/dist/core/startup/index.cjs.map +1 -0
- package/dist/core/startup/index.d.ts +8 -0
- package/dist/core/startup/index.d.ts.map +1 -0
- package/dist/core/startup/index.js +8 -0
- package/dist/core/startup/index.js.map +1 -0
- package/dist/core/startup/initializeServices.cjs +166 -0
- package/dist/core/startup/initializeServices.cjs.map +1 -0
- package/dist/core/startup/initializeServices.d.ts +57 -0
- package/dist/core/startup/initializeServices.d.ts.map +1 -0
- package/dist/core/startup/initializeServices.js +124 -0
- package/dist/core/startup/initializeServices.js.map +1 -0
- package/dist/core/startup/performanceTracker.cjs +181 -0
- package/dist/core/startup/performanceTracker.cjs.map +1 -0
- package/dist/core/startup/performanceTracker.d.ts +105 -0
- package/dist/core/startup/performanceTracker.d.ts.map +1 -0
- package/dist/core/startup/performanceTracker.js +167 -0
- package/dist/core/startup/performanceTracker.js.map +1 -0
- package/dist/core/startup/renderApp.cjs +275 -0
- package/dist/core/startup/renderApp.cjs.map +1 -0
- package/dist/core/startup/renderApp.d.ts +71 -0
- package/dist/core/startup/renderApp.d.ts.map +1 -0
- package/dist/core/startup/renderApp.js +226 -0
- package/dist/core/startup/renderApp.js.map +1 -0
- package/dist/core/startup/startApp.cjs +151 -0
- package/dist/core/startup/startApp.cjs.map +1 -0
- package/dist/core/startup/startApp.d.ts +15 -0
- package/dist/core/startup/startApp.d.ts.map +1 -0
- package/dist/core/startup/startApp.js +147 -0
- package/dist/core/startup/startApp.js.map +1 -0
- package/dist/core/types.cjs +6 -0
- package/dist/core/types.cjs.map +1 -0
- package/dist/core/types.d.ts +461 -0
- package/dist/core/types.d.ts.map +1 -0
- package/dist/core/types.js +5 -0
- package/dist/core/types.js.map +1 -0
- package/dist/index.cjs +152 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +17 -0
- package/dist/index.js.map +1 -0
- package/dist/library/index.cjs +21 -0
- package/dist/library/index.cjs.map +1 -0
- package/dist/library/index.d.ts +3 -0
- package/dist/library/index.d.ts.map +1 -0
- package/dist/library/index.js +4 -0
- package/dist/library/index.js.map +1 -0
- package/dist/library/locale/index.cjs +56 -0
- package/dist/library/locale/index.cjs.map +1 -0
- package/dist/library/locale/index.d.ts +6 -0
- package/dist/library/locale/index.d.ts.map +1 -0
- package/dist/library/locale/index.js +30 -0
- package/dist/library/locale/index.js.map +1 -0
- package/dist/library/locale/langs/en-us/index.cjs +34 -0
- package/dist/library/locale/langs/en-us/index.cjs.map +1 -0
- package/dist/library/locale/langs/en-us/index.d.ts +4 -0
- package/dist/library/locale/langs/en-us/index.d.ts.map +1 -0
- package/dist/library/locale/langs/en-us/index.js +24 -0
- package/dist/library/locale/langs/en-us/index.js.map +1 -0
- package/dist/library/locale/langs/zh-cn/index.cjs +34 -0
- package/dist/library/locale/langs/zh-cn/index.cjs.map +1 -0
- package/dist/library/locale/langs/zh-cn/index.d.ts +4 -0
- package/dist/library/locale/langs/zh-cn/index.d.ts.map +1 -0
- package/dist/library/locale/langs/zh-cn/index.js +24 -0
- package/dist/library/locale/langs/zh-cn/index.js.map +1 -0
- package/dist/library/locale/types.cjs +6 -0
- package/dist/library/locale/types.cjs.map +1 -0
- package/dist/library/locale/types.d.ts +39 -0
- package/dist/library/locale/types.d.ts.map +1 -0
- package/dist/library/locale/types.js +3 -0
- package/dist/library/locale/types.js.map +1 -0
- package/dist/library/storage/cache.cjs +245 -0
- package/dist/library/storage/cache.cjs.map +1 -0
- package/dist/library/storage/cache.d.ts +58 -0
- package/dist/library/storage/cache.d.ts.map +1 -0
- package/dist/library/storage/cache.js +237 -0
- package/dist/library/storage/cache.js.map +1 -0
- package/dist/library/storage/encryption.cjs +150 -0
- package/dist/library/storage/encryption.cjs.map +1 -0
- package/dist/library/storage/encryption.d.ts +46 -0
- package/dist/library/storage/encryption.d.ts.map +1 -0
- package/dist/library/storage/encryption.js +142 -0
- package/dist/library/storage/encryption.js.map +1 -0
- package/dist/library/storage/index.cjs +126 -0
- package/dist/library/storage/index.cjs.map +1 -0
- package/dist/library/storage/index.d.ts +62 -0
- package/dist/library/storage/index.d.ts.map +1 -0
- package/dist/library/storage/index.js +106 -0
- package/dist/library/storage/index.js.map +1 -0
- package/dist/request/adapter/RequestAdapter.cjs +78 -0
- package/dist/request/adapter/RequestAdapter.cjs.map +1 -0
- package/dist/request/adapter/RequestAdapter.d.ts +86 -0
- package/dist/request/adapter/RequestAdapter.d.ts.map +1 -0
- package/dist/request/adapter/RequestAdapter.js +70 -0
- package/dist/request/adapter/RequestAdapter.js.map +1 -0
- package/dist/request/adapter/axiosAdapter.cjs +164 -0
- package/dist/request/adapter/axiosAdapter.cjs.map +1 -0
- package/dist/request/adapter/axiosAdapter.d.ts +11 -0
- package/dist/request/adapter/axiosAdapter.d.ts.map +1 -0
- package/dist/request/adapter/axiosAdapter.js +115 -0
- package/dist/request/adapter/axiosAdapter.js.map +1 -0
- package/dist/request/adapter/fetchAdapter.cjs +134 -0
- package/dist/request/adapter/fetchAdapter.cjs.map +1 -0
- package/dist/request/adapter/fetchAdapter.d.ts +11 -0
- package/dist/request/adapter/fetchAdapter.d.ts.map +1 -0
- package/dist/request/adapter/fetchAdapter.js +126 -0
- package/dist/request/adapter/fetchAdapter.js.map +1 -0
- package/dist/request/adapter/index.cjs +80 -0
- package/dist/request/adapter/index.cjs.map +1 -0
- package/dist/request/adapter/index.d.ts +10 -0
- package/dist/request/adapter/index.d.ts.map +1 -0
- package/dist/request/adapter/index.js +14 -0
- package/dist/request/adapter/index.js.map +1 -0
- package/dist/request/adapter/kyAdapter.cjs +191 -0
- package/dist/request/adapter/kyAdapter.cjs.map +1 -0
- package/dist/request/adapter/kyAdapter.d.ts +11 -0
- package/dist/request/adapter/kyAdapter.d.ts.map +1 -0
- package/dist/request/adapter/kyAdapter.js +142 -0
- package/dist/request/adapter/kyAdapter.js.map +1 -0
- package/dist/request/adapter/undiciAdapter.cjs +213 -0
- package/dist/request/adapter/undiciAdapter.cjs.map +1 -0
- package/dist/request/adapter/undiciAdapter.d.ts +11 -0
- package/dist/request/adapter/undiciAdapter.d.ts.map +1 -0
- package/dist/request/adapter/undiciAdapter.js +164 -0
- package/dist/request/adapter/undiciAdapter.js.map +1 -0
- package/dist/request/core/RequestClient.cjs +539 -0
- package/dist/request/core/RequestClient.cjs.map +1 -0
- package/dist/request/core/RequestClient.d.ts +127 -0
- package/dist/request/core/RequestClient.d.ts.map +1 -0
- package/dist/request/core/RequestClient.js +490 -0
- package/dist/request/core/RequestClient.js.map +1 -0
- package/dist/request/core/index.cjs +15 -0
- package/dist/request/core/index.cjs.map +1 -0
- package/dist/request/core/index.d.ts +6 -0
- package/dist/request/core/index.d.ts.map +1 -0
- package/dist/request/core/index.js +5 -0
- package/dist/request/core/index.js.map +1 -0
- package/dist/request/index.cjs +146 -0
- package/dist/request/index.cjs.map +1 -0
- package/dist/request/index.d.ts +43 -0
- package/dist/request/index.d.ts.map +1 -0
- package/dist/request/index.js +50 -0
- package/dist/request/index.js.map +1 -0
- package/dist/request/plugin/RequestPlugin.cjs +218 -0
- package/dist/request/plugin/RequestPlugin.cjs.map +1 -0
- package/dist/request/plugin/RequestPlugin.d.ts +171 -0
- package/dist/request/plugin/RequestPlugin.d.ts.map +1 -0
- package/dist/request/plugin/RequestPlugin.js +203 -0
- package/dist/request/plugin/RequestPlugin.js.map +1 -0
- package/dist/request/plugin/cache.cjs +269 -0
- package/dist/request/plugin/cache.cjs.map +1 -0
- package/dist/request/plugin/cache.d.ts +34 -0
- package/dist/request/plugin/cache.d.ts.map +1 -0
- package/dist/request/plugin/cache.js +264 -0
- package/dist/request/plugin/cache.js.map +1 -0
- package/dist/request/plugin/csrfPlugin.cjs +40 -0
- package/dist/request/plugin/csrfPlugin.cjs.map +1 -0
- package/dist/request/plugin/csrfPlugin.d.ts +22 -0
- package/dist/request/plugin/csrfPlugin.d.ts.map +1 -0
- package/dist/request/plugin/csrfPlugin.js +44 -0
- package/dist/request/plugin/csrfPlugin.js.map +1 -0
- package/dist/request/plugin/index.cjs +49 -0
- package/dist/request/plugin/index.cjs.map +1 -0
- package/dist/request/plugin/index.d.ts +11 -0
- package/dist/request/plugin/index.d.ts.map +1 -0
- package/dist/request/plugin/index.js +11 -0
- package/dist/request/plugin/index.js.map +1 -0
- package/dist/request/plugin/monitoring.cjs +216 -0
- package/dist/request/plugin/monitoring.cjs.map +1 -0
- package/dist/request/plugin/monitoring.d.ts +113 -0
- package/dist/request/plugin/monitoring.d.ts.map +1 -0
- package/dist/request/plugin/monitoring.js +205 -0
- package/dist/request/plugin/monitoring.js.map +1 -0
- package/dist/request/plugin/retry.cjs +98 -0
- package/dist/request/plugin/retry.cjs.map +1 -0
- package/dist/request/plugin/retry.d.ts +35 -0
- package/dist/request/plugin/retry.d.ts.map +1 -0
- package/dist/request/plugin/retry.js +93 -0
- package/dist/request/plugin/retry.js.map +1 -0
- package/dist/request/plugin/validation.cjs +121 -0
- package/dist/request/plugin/validation.cjs.map +1 -0
- package/dist/request/plugin/validation.d.ts +27 -0
- package/dist/request/plugin/validation.d.ts.map +1 -0
- package/dist/request/plugin/validation.js +116 -0
- package/dist/request/plugin/validation.js.map +1 -0
- package/dist/request/runtime/RequestContext.cjs +77 -0
- package/dist/request/runtime/RequestContext.cjs.map +1 -0
- package/dist/request/runtime/RequestContext.d.ts +51 -0
- package/dist/request/runtime/RequestContext.d.ts.map +1 -0
- package/dist/request/runtime/RequestContext.js +86 -0
- package/dist/request/runtime/RequestContext.js.map +1 -0
- package/dist/request/runtime/index.cjs +32 -0
- package/dist/request/runtime/index.cjs.map +1 -0
- package/dist/request/runtime/index.d.ts +5 -0
- package/dist/request/runtime/index.d.ts.map +1 -0
- package/dist/request/runtime/index.js +5 -0
- package/dist/request/runtime/index.js.map +1 -0
- package/dist/request/types.cjs +112 -0
- package/dist/request/types.cjs.map +1 -0
- package/dist/request/types.d.ts +395 -0
- package/dist/request/types.d.ts.map +1 -0
- package/dist/request/types.js +97 -0
- package/dist/request/types.js.map +1 -0
- package/dist/request/utils/dependencyCheck.cjs +237 -0
- package/dist/request/utils/dependencyCheck.cjs.map +1 -0
- package/dist/request/utils/dependencyCheck.d.ts +64 -0
- package/dist/request/utils/dependencyCheck.d.ts.map +1 -0
- package/dist/request/utils/dependencyCheck.js +192 -0
- package/dist/request/utils/dependencyCheck.js.map +1 -0
- package/dist/request/utils/index.cjs +26 -0
- package/dist/request/utils/index.cjs.map +1 -0
- package/dist/request/utils/index.d.ts +5 -0
- package/dist/request/utils/index.d.ts.map +1 -0
- package/dist/request/utils/index.js +5 -0
- package/dist/request/utils/index.js.map +1 -0
- package/dist/state/StateManager.cjs +168 -0
- package/dist/state/StateManager.cjs.map +1 -0
- package/dist/state/StateManager.d.ts +121 -0
- package/dist/state/StateManager.d.ts.map +1 -0
- package/dist/state/StateManager.js +160 -0
- package/dist/state/StateManager.js.map +1 -0
- package/dist/state/adapters/AdapterFactory.cjs +91 -0
- package/dist/state/adapters/AdapterFactory.cjs.map +1 -0
- package/dist/state/adapters/AdapterFactory.d.ts +52 -0
- package/dist/state/adapters/AdapterFactory.d.ts.map +1 -0
- package/dist/state/adapters/AdapterFactory.js +85 -0
- package/dist/state/adapters/AdapterFactory.js.map +1 -0
- package/dist/state/adapters/DefaultAdapter.cjs +77 -0
- package/dist/state/adapters/DefaultAdapter.cjs.map +1 -0
- package/dist/state/adapters/DefaultAdapter.d.ts +39 -0
- package/dist/state/adapters/DefaultAdapter.d.ts.map +1 -0
- package/dist/state/adapters/DefaultAdapter.js +71 -0
- package/dist/state/adapters/DefaultAdapter.js.map +1 -0
- package/dist/state/adapters/ReduxAdapter.cjs +445 -0
- package/dist/state/adapters/ReduxAdapter.cjs.map +1 -0
- package/dist/state/adapters/ReduxAdapter.d.ts +130 -0
- package/dist/state/adapters/ReduxAdapter.d.ts.map +1 -0
- package/dist/state/adapters/ReduxAdapter.js +439 -0
- package/dist/state/adapters/ReduxAdapter.js.map +1 -0
- package/dist/state/adapters/ZustandAdapter.cjs +71 -0
- package/dist/state/adapters/ZustandAdapter.cjs.map +1 -0
- package/dist/state/adapters/ZustandAdapter.d.ts +47 -0
- package/dist/state/adapters/ZustandAdapter.d.ts.map +1 -0
- package/dist/state/adapters/ZustandAdapter.js +70 -0
- package/dist/state/adapters/ZustandAdapter.js.map +1 -0
- package/dist/state/adapters/index.cjs +46 -0
- package/dist/state/adapters/index.cjs.map +1 -0
- package/dist/state/adapters/index.d.ts +9 -0
- package/dist/state/adapters/index.d.ts.map +1 -0
- package/dist/state/adapters/index.js +9 -0
- package/dist/state/adapters/index.js.map +1 -0
- package/dist/state/adapters/types.cjs +22 -0
- package/dist/state/adapters/types.cjs.map +1 -0
- package/dist/state/adapters/types.d.ts +5 -0
- package/dist/state/adapters/types.d.ts.map +1 -0
- package/dist/state/adapters/types.js +5 -0
- package/dist/state/adapters/types.js.map +1 -0
- package/dist/state/core/DerivedStateInstance.cjs +176 -0
- package/dist/state/core/DerivedStateInstance.cjs.map +1 -0
- package/dist/state/core/DerivedStateInstance.d.ts +101 -0
- package/dist/state/core/DerivedStateInstance.d.ts.map +1 -0
- package/dist/state/core/DerivedStateInstance.js +173 -0
- package/dist/state/core/DerivedStateInstance.js.map +1 -0
- package/dist/state/core/StateInstance.cjs +172 -0
- package/dist/state/core/StateInstance.cjs.map +1 -0
- package/dist/state/core/StateInstance.d.ts +86 -0
- package/dist/state/core/StateInstance.d.ts.map +1 -0
- package/dist/state/core/StateInstance.js +168 -0
- package/dist/state/core/StateInstance.js.map +1 -0
- package/dist/state/core/StateRegistry.cjs +112 -0
- package/dist/state/core/StateRegistry.cjs.map +1 -0
- package/dist/state/core/StateRegistry.d.ts +56 -0
- package/dist/state/core/StateRegistry.d.ts.map +1 -0
- package/dist/state/core/StateRegistry.js +106 -0
- package/dist/state/core/StateRegistry.js.map +1 -0
- package/dist/state/core/StateScope.cjs +139 -0
- package/dist/state/core/StateScope.cjs.map +1 -0
- package/dist/state/core/StateScope.d.ts +72 -0
- package/dist/state/core/StateScope.d.ts.map +1 -0
- package/dist/state/core/StateScope.js +133 -0
- package/dist/state/core/StateScope.js.map +1 -0
- package/dist/state/core/index.cjs +32 -0
- package/dist/state/core/index.cjs.map +1 -0
- package/dist/state/core/index.d.ts +8 -0
- package/dist/state/core/index.d.ts.map +1 -0
- package/dist/state/core/index.js +8 -0
- package/dist/state/core/index.js.map +1 -0
- package/dist/state/index.cjs +32 -0
- package/dist/state/index.cjs.map +1 -0
- package/dist/state/index.d.ts +9 -0
- package/dist/state/index.d.ts.map +1 -0
- package/dist/state/index.js +12 -0
- package/dist/state/index.js.map +1 -0
- package/dist/state/types.cjs +14 -0
- package/dist/state/types.cjs.map +1 -0
- package/dist/state/types.d.ts +231 -0
- package/dist/state/types.d.ts.map +1 -0
- package/dist/state/types.js +13 -0
- package/dist/state/types.js.map +1 -0
- package/dist/types.cjs +6 -0
- package/dist/types.cjs.map +1 -0
- package/dist/types.d.ts +6 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -0
- package/dist/utils/analytics.cjs +219 -0
- package/dist/utils/analytics.cjs.map +1 -0
- package/dist/utils/analytics.d.ts +128 -0
- package/dist/utils/analytics.d.ts.map +1 -0
- package/dist/utils/analytics.js +204 -0
- package/dist/utils/analytics.js.map +1 -0
- package/dist/utils/configSecurity.cjs +184 -0
- package/dist/utils/configSecurity.cjs.map +1 -0
- package/dist/utils/configSecurity.d.ts +101 -0
- package/dist/utils/configSecurity.d.ts.map +1 -0
- package/dist/utils/configSecurity.js +176 -0
- package/dist/utils/configSecurity.js.map +1 -0
- package/dist/utils/csrf.cjs +159 -0
- package/dist/utils/csrf.cjs.map +1 -0
- package/dist/utils/csrf.d.ts +73 -0
- package/dist/utils/csrf.d.ts.map +1 -0
- package/dist/utils/csrf.js +144 -0
- package/dist/utils/csrf.js.map +1 -0
- package/dist/utils/errors/ErrorCodes.cjs +97 -0
- package/dist/utils/errors/ErrorCodes.cjs.map +1 -0
- package/dist/utils/errors/ErrorCodes.d.ts +46 -0
- package/dist/utils/errors/ErrorCodes.d.ts.map +1 -0
- package/dist/utils/errors/ErrorCodes.js +86 -0
- package/dist/utils/errors/ErrorCodes.js.map +1 -0
- package/dist/utils/errors.cjs +343 -0
- package/dist/utils/errors.cjs.map +1 -0
- package/dist/utils/errors.d.ts +179 -0
- package/dist/utils/errors.d.ts.map +1 -0
- package/dist/utils/errors.js +311 -0
- package/dist/utils/errors.js.map +1 -0
- package/dist/utils/index.cjs +137 -0
- package/dist/utils/index.cjs.map +1 -0
- package/dist/utils/index.d.ts +40 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +48 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/logger.cjs +396 -0
- package/dist/utils/logger.cjs.map +1 -0
- package/dist/utils/logger.d.ts +190 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +381 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/logger.types.cjs +22 -0
- package/dist/utils/logger.types.cjs.map +1 -0
- package/dist/utils/logger.types.d.ts +58 -0
- package/dist/utils/logger.types.d.ts.map +1 -0
- package/dist/utils/logger.types.js +12 -0
- package/dist/utils/logger.types.js.map +1 -0
- package/dist/utils/monitoring.cjs +311 -0
- package/dist/utils/monitoring.cjs.map +1 -0
- package/dist/utils/monitoring.d.ts +164 -0
- package/dist/utils/monitoring.d.ts.map +1 -0
- package/dist/utils/monitoring.js +296 -0
- package/dist/utils/monitoring.js.map +1 -0
- package/dist/utils/performance.cjs +371 -0
- package/dist/utils/performance.cjs.map +1 -0
- package/dist/utils/performance.d.ts +247 -0
- package/dist/utils/performance.d.ts.map +1 -0
- package/dist/utils/performance.js +356 -0
- package/dist/utils/performance.js.map +1 -0
- package/dist/utils/resourceLoader.cjs +322 -0
- package/dist/utils/resourceLoader.cjs.map +1 -0
- package/dist/utils/resourceLoader.d.ts +131 -0
- package/dist/utils/resourceLoader.d.ts.map +1 -0
- package/dist/utils/resourceLoader.js +307 -0
- package/dist/utils/resourceLoader.js.map +1 -0
- package/dist/utils/runtimeSecurity.cjs +151 -0
- package/dist/utils/runtimeSecurity.cjs.map +1 -0
- package/dist/utils/runtimeSecurity.d.ts +105 -0
- package/dist/utils/runtimeSecurity.d.ts.map +1 -0
- package/dist/utils/runtimeSecurity.js +143 -0
- package/dist/utils/runtimeSecurity.js.map +1 -0
- package/dist/utils/security.cjs +332 -0
- package/dist/utils/security.cjs.map +1 -0
- package/dist/utils/security.d.ts +81 -0
- package/dist/utils/security.d.ts.map +1 -0
- package/dist/utils/security.js +313 -0
- package/dist/utils/security.js.map +1 -0
- package/dist/utils/traceId.cjs +140 -0
- package/dist/utils/traceId.cjs.map +1 -0
- package/dist/utils/traceId.d.ts +64 -0
- package/dist/utils/traceId.d.ts.map +1 -0
- package/dist/utils/traceId.js +118 -0
- package/dist/utils/traceId.js.map +1 -0
- package/dist/utils/validation.cjs +191 -0
- package/dist/utils/validation.cjs.map +1 -0
- package/dist/utils/validation.d.ts +111 -0
- package/dist/utils/validation.d.ts.map +1 -0
- package/dist/utils/validation.js +177 -0
- package/dist/utils/validation.js.map +1 -0
- package/package.json +98 -0
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 插件沙箱
|
|
3
|
+
* 用于插件隔离和权限控制
|
|
4
|
+
*/ function _define_property(obj, key, value) {
|
|
5
|
+
if (key in obj) {
|
|
6
|
+
Object.defineProperty(obj, key, {
|
|
7
|
+
value: value,
|
|
8
|
+
enumerable: true,
|
|
9
|
+
configurable: true,
|
|
10
|
+
writable: true
|
|
11
|
+
});
|
|
12
|
+
} else {
|
|
13
|
+
obj[key] = value;
|
|
14
|
+
}
|
|
15
|
+
return obj;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* 插件权限
|
|
19
|
+
*/ export var PluginPermission = /*#__PURE__*/ function(PluginPermission) {
|
|
20
|
+
/**
|
|
21
|
+
* 访问配置
|
|
22
|
+
*/ PluginPermission["ACCESS_CONFIG"] = "access_config";
|
|
23
|
+
/**
|
|
24
|
+
* 访问状态管理器
|
|
25
|
+
*/ PluginPermission["ACCESS_STATE_MANAGER"] = "access_state_manager";
|
|
26
|
+
/**
|
|
27
|
+
* 访问存储
|
|
28
|
+
*/ PluginPermission["ACCESS_STORAGE"] = "access_storage";
|
|
29
|
+
/**
|
|
30
|
+
* 发布事件
|
|
31
|
+
*/ PluginPermission["EMIT_EVENTS"] = "emit_events";
|
|
32
|
+
/**
|
|
33
|
+
* 订阅事件
|
|
34
|
+
*/ PluginPermission["SUBSCRIBE_EVENTS"] = "subscribe_events";
|
|
35
|
+
return PluginPermission;
|
|
36
|
+
}({});
|
|
37
|
+
/**
|
|
38
|
+
* 插件沙箱
|
|
39
|
+
*/ export class PluginSandbox {
|
|
40
|
+
/**
|
|
41
|
+
* 检查权限
|
|
42
|
+
*
|
|
43
|
+
* @param permission - 权限
|
|
44
|
+
* @returns 是否有权限
|
|
45
|
+
*/ hasPermission(permission) {
|
|
46
|
+
if (!this.config.strictMode) {
|
|
47
|
+
return true; // 非严格模式,允许所有权限
|
|
48
|
+
}
|
|
49
|
+
return this.permissions.has(permission);
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* 检查是否可以访问配置键
|
|
53
|
+
*
|
|
54
|
+
* @param key - 配置键
|
|
55
|
+
* @returns 是否可以访问
|
|
56
|
+
*/ canAccessConfig(key) {
|
|
57
|
+
if (!this.hasPermission("access_config")) {
|
|
58
|
+
return false;
|
|
59
|
+
}
|
|
60
|
+
if (this.config.configWhitelist && this.config.configWhitelist.length > 0) {
|
|
61
|
+
return this.config.configWhitelist.includes(key);
|
|
62
|
+
}
|
|
63
|
+
return true;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* 检查是否可以访问状态作用域
|
|
67
|
+
*
|
|
68
|
+
* @param scope - 状态作用域
|
|
69
|
+
* @returns 是否可以访问
|
|
70
|
+
*/ canAccessStateScope(scope) {
|
|
71
|
+
if (!this.hasPermission("access_state_manager")) {
|
|
72
|
+
return false;
|
|
73
|
+
}
|
|
74
|
+
if (this.config.stateScopeWhitelist && this.config.stateScopeWhitelist.length > 0) {
|
|
75
|
+
return this.config.stateScopeWhitelist.includes(scope);
|
|
76
|
+
}
|
|
77
|
+
return true;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* 过滤配置(根据白名单)
|
|
81
|
+
*
|
|
82
|
+
* @param config - 完整配置
|
|
83
|
+
* @returns 过滤后的配置
|
|
84
|
+
*/ filterConfig(config) {
|
|
85
|
+
if (!this.hasPermission("access_config")) {
|
|
86
|
+
return {};
|
|
87
|
+
}
|
|
88
|
+
if (!this.config.configWhitelist || this.config.configWhitelist.length === 0) {
|
|
89
|
+
return config;
|
|
90
|
+
}
|
|
91
|
+
const filtered = {};
|
|
92
|
+
for (const key of this.config.configWhitelist){
|
|
93
|
+
if (key in config) {
|
|
94
|
+
filtered[key] = config[key];
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
return filtered;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* 获取沙箱配置
|
|
101
|
+
*/ getConfig() {
|
|
102
|
+
return {
|
|
103
|
+
...this.config
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* 更新权限
|
|
108
|
+
*
|
|
109
|
+
* @param permissions - 权限列表
|
|
110
|
+
*/ updatePermissions(permissions) {
|
|
111
|
+
this.permissions = new Set(permissions);
|
|
112
|
+
this.config.permissions = permissions;
|
|
113
|
+
}
|
|
114
|
+
constructor(config){
|
|
115
|
+
_define_property(this, "config", void 0);
|
|
116
|
+
_define_property(this, "permissions", void 0);
|
|
117
|
+
this.config = {
|
|
118
|
+
strictMode: true,
|
|
119
|
+
...config
|
|
120
|
+
};
|
|
121
|
+
this.permissions = new Set(config.permissions || []);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
//# sourceMappingURL=PluginSandbox.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/core/plugin/PluginSandbox.ts"],"sourcesContent":["/**\n * 插件沙箱\n * 用于插件隔离和权限控制\n */\n\nimport type { StartOptions } from '../types';\n\n/**\n * 插件权限\n */\nexport enum PluginPermission {\n /**\n * 访问配置\n */\n ACCESS_CONFIG = 'access_config',\n\n /**\n * 访问状态管理器\n */\n ACCESS_STATE_MANAGER = 'access_state_manager',\n\n /**\n * 访问存储\n */\n ACCESS_STORAGE = 'access_storage',\n\n /**\n * 发布事件\n */\n EMIT_EVENTS = 'emit_events',\n\n /**\n * 订阅事件\n */\n SUBSCRIBE_EVENTS = 'subscribe_events',\n}\n\n/**\n * 插件沙箱配置\n */\nexport interface PluginSandboxConfig {\n /**\n * 插件名称\n */\n name: string;\n\n /**\n * 允许的权限列表\n */\n permissions?: PluginPermission[];\n\n /**\n * 允许访问的配置键(白名单)\n */\n configWhitelist?: string[];\n\n /**\n * 允许访问的状态作用域(白名单)\n */\n stateScopeWhitelist?: (string | symbol)[];\n\n /**\n * 是否启用严格模式(默认true)\n */\n strictMode?: boolean;\n}\n\n/**\n * 插件沙箱\n */\nexport class PluginSandbox {\n private config: PluginSandboxConfig;\n private permissions: Set<PluginPermission>;\n\n constructor(config: PluginSandboxConfig) {\n this.config = {\n strictMode: true,\n ...config,\n };\n this.permissions = new Set(config.permissions || []);\n }\n\n /**\n * 检查权限\n * \n * @param permission - 权限\n * @returns 是否有权限\n */\n hasPermission(permission: PluginPermission): boolean {\n if (!this.config.strictMode) {\n return true; // 非严格模式,允许所有权限\n }\n\n return this.permissions.has(permission);\n }\n\n /**\n * 检查是否可以访问配置键\n * \n * @param key - 配置键\n * @returns 是否可以访问\n */\n canAccessConfig(key: string): boolean {\n if (!this.hasPermission(PluginPermission.ACCESS_CONFIG)) {\n return false;\n }\n\n if (this.config.configWhitelist && this.config.configWhitelist.length > 0) {\n return this.config.configWhitelist.includes(key);\n }\n\n return true;\n }\n\n /**\n * 检查是否可以访问状态作用域\n * \n * @param scope - 状态作用域\n * @returns 是否可以访问\n */\n canAccessStateScope(scope: string | symbol): boolean {\n if (!this.hasPermission(PluginPermission.ACCESS_STATE_MANAGER)) {\n return false;\n }\n\n if (this.config.stateScopeWhitelist && this.config.stateScopeWhitelist.length > 0) {\n return this.config.stateScopeWhitelist.includes(scope);\n }\n\n return true;\n }\n\n /**\n * 过滤配置(根据白名单)\n * \n * @param config - 完整配置\n * @returns 过滤后的配置\n */\n filterConfig(config: StartOptions): Partial<StartOptions> {\n if (!this.hasPermission(PluginPermission.ACCESS_CONFIG)) {\n return {};\n }\n\n if (!this.config.configWhitelist || this.config.configWhitelist.length === 0) {\n return config;\n }\n\n const filtered: Partial<StartOptions> = {};\n for (const key of this.config.configWhitelist) {\n if (key in config) {\n (filtered as any)[key] = (config as any)[key];\n }\n }\n\n return filtered;\n }\n\n /**\n * 获取沙箱配置\n */\n getConfig(): PluginSandboxConfig {\n return { ...this.config };\n }\n\n /**\n * 更新权限\n * \n * @param permissions - 权限列表\n */\n updatePermissions(permissions: PluginPermission[]): void {\n this.permissions = new Set(permissions);\n this.config.permissions = permissions;\n }\n}\n"],"names":["PluginPermission","PluginSandbox","hasPermission","permission","config","strictMode","permissions","has","canAccessConfig","key","configWhitelist","length","includes","canAccessStateScope","scope","stateScopeWhitelist","filterConfig","filtered","getConfig","updatePermissions","Set"],"mappings":"AAAA;;;CAGC;;;;;;;;;;;;;AAID;;CAEC,GACD,OAAO,IAAA,AAAKA,0CAAAA;IACV;;GAEC;IAGD;;GAEC;IAGD;;GAEC;IAGD;;GAEC;IAGD;;GAEC;WAvBSA;MAyBX;AAgCD;;CAEC,GACD,OAAO,MAAMC;IAYX;;;;;GAKC,GACDC,cAAcC,UAA4B,EAAW;QACnD,IAAI,CAAC,IAAI,CAACC,MAAM,CAACC,UAAU,EAAE;YAC3B,OAAO,MAAM,eAAe;QAC9B;QAEA,OAAO,IAAI,CAACC,WAAW,CAACC,GAAG,CAACJ;IAC9B;IAEA;;;;;GAKC,GACDK,gBAAgBC,GAAW,EAAW;QACpC,IAAI,CAAC,IAAI,CAACP,aAAa,mBAAkC;YACvD,OAAO;QACT;QAEA,IAAI,IAAI,CAACE,MAAM,CAACM,eAAe,IAAI,IAAI,CAACN,MAAM,CAACM,eAAe,CAACC,MAAM,GAAG,GAAG;YACzE,OAAO,IAAI,CAACP,MAAM,CAACM,eAAe,CAACE,QAAQ,CAACH;QAC9C;QAEA,OAAO;IACT;IAEA;;;;;GAKC,GACDI,oBAAoBC,KAAsB,EAAW;QACnD,IAAI,CAAC,IAAI,CAACZ,aAAa,0BAAyC;YAC9D,OAAO;QACT;QAEA,IAAI,IAAI,CAACE,MAAM,CAACW,mBAAmB,IAAI,IAAI,CAACX,MAAM,CAACW,mBAAmB,CAACJ,MAAM,GAAG,GAAG;YACjF,OAAO,IAAI,CAACP,MAAM,CAACW,mBAAmB,CAACH,QAAQ,CAACE;QAClD;QAEA,OAAO;IACT;IAEA;;;;;GAKC,GACDE,aAAaZ,MAAoB,EAAyB;QACxD,IAAI,CAAC,IAAI,CAACF,aAAa,mBAAkC;YACvD,OAAO,CAAC;QACV;QAEA,IAAI,CAAC,IAAI,CAACE,MAAM,CAACM,eAAe,IAAI,IAAI,CAACN,MAAM,CAACM,eAAe,CAACC,MAAM,KAAK,GAAG;YAC5E,OAAOP;QACT;QAEA,MAAMa,WAAkC,CAAC;QACzC,KAAK,MAAMR,OAAO,IAAI,CAACL,MAAM,CAACM,eAAe,CAAE;YAC7C,IAAID,OAAOL,QAAQ;gBAChBa,QAAgB,CAACR,IAAI,GAAG,AAACL,MAAc,CAACK,IAAI;YAC/C;QACF;QAEA,OAAOQ;IACT;IAEA;;GAEC,GACDC,YAAiC;QAC/B,OAAO;YAAE,GAAG,IAAI,CAACd,MAAM;QAAC;IAC1B;IAEA;;;;GAIC,GACDe,kBAAkBb,WAA+B,EAAQ;QACvD,IAAI,CAACA,WAAW,GAAG,IAAIc,IAAId;QAC3B,IAAI,CAACF,MAAM,CAACE,WAAW,GAAGA;IAC5B;IAlGA,YAAYF,MAA2B,CAAE;QAHzC,uBAAQA,UAAR,KAAA;QACA,uBAAQE,eAAR,KAAA;QAGE,IAAI,CAACF,MAAM,GAAG;YACZC,YAAY;YACZ,GAAGD,MAAM;QACX;QACA,IAAI,CAACE,WAAW,GAAG,IAAIc,IAAIhB,OAAOE,WAAW,IAAI,EAAE;IACrD;AA6FF"}
|
|
@@ -0,0 +1,496 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
get PluginEventBus () {
|
|
13
|
+
return _PluginEventBus.PluginEventBus;
|
|
14
|
+
},
|
|
15
|
+
get PluginManager () {
|
|
16
|
+
return PluginManager;
|
|
17
|
+
},
|
|
18
|
+
get PluginPermission () {
|
|
19
|
+
return _PluginSandbox.PluginPermission;
|
|
20
|
+
},
|
|
21
|
+
get PluginSandbox () {
|
|
22
|
+
return _PluginSandbox.PluginSandbox;
|
|
23
|
+
},
|
|
24
|
+
get pluginEventBus () {
|
|
25
|
+
return _PluginEventBus.pluginEventBus;
|
|
26
|
+
},
|
|
27
|
+
get pluginManager () {
|
|
28
|
+
return pluginManager;
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
const _PluginSandbox = require("./plugin/PluginSandbox");
|
|
32
|
+
const _PluginEventBus = require("./plugin/PluginEventBus");
|
|
33
|
+
function _define_property(obj, key, value) {
|
|
34
|
+
if (key in obj) {
|
|
35
|
+
Object.defineProperty(obj, key, {
|
|
36
|
+
value: value,
|
|
37
|
+
enumerable: true,
|
|
38
|
+
configurable: true,
|
|
39
|
+
writable: true
|
|
40
|
+
});
|
|
41
|
+
} else {
|
|
42
|
+
obj[key] = value;
|
|
43
|
+
}
|
|
44
|
+
return obj;
|
|
45
|
+
}
|
|
46
|
+
function _getRequireWildcardCache(nodeInterop) {
|
|
47
|
+
if (typeof WeakMap !== "function") return null;
|
|
48
|
+
var cacheBabelInterop = new WeakMap();
|
|
49
|
+
var cacheNodeInterop = new WeakMap();
|
|
50
|
+
return (_getRequireWildcardCache = function(nodeInterop) {
|
|
51
|
+
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
|
52
|
+
})(nodeInterop);
|
|
53
|
+
}
|
|
54
|
+
function _interop_require_wildcard(obj, nodeInterop) {
|
|
55
|
+
if (!nodeInterop && obj && obj.__esModule) {
|
|
56
|
+
return obj;
|
|
57
|
+
}
|
|
58
|
+
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
59
|
+
return {
|
|
60
|
+
default: obj
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
var cache = _getRequireWildcardCache(nodeInterop);
|
|
64
|
+
if (cache && cache.has(obj)) {
|
|
65
|
+
return cache.get(obj);
|
|
66
|
+
}
|
|
67
|
+
var newObj = {
|
|
68
|
+
__proto__: null
|
|
69
|
+
};
|
|
70
|
+
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
71
|
+
for(var key in obj){
|
|
72
|
+
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
73
|
+
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
74
|
+
if (desc && (desc.get || desc.set)) {
|
|
75
|
+
Object.defineProperty(newObj, key, desc);
|
|
76
|
+
} else {
|
|
77
|
+
newObj[key] = obj[key];
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
newObj.default = obj;
|
|
82
|
+
if (cache) {
|
|
83
|
+
cache.set(obj, newObj);
|
|
84
|
+
}
|
|
85
|
+
return newObj;
|
|
86
|
+
}
|
|
87
|
+
let PluginManager = class PluginManager {
|
|
88
|
+
/**
|
|
89
|
+
* 注册插件
|
|
90
|
+
*
|
|
91
|
+
* 优化:检查插件依赖是否已注册
|
|
92
|
+
*/ register(plugin) {
|
|
93
|
+
if (this.plugins.has(plugin.name)) {
|
|
94
|
+
console.warn(`插件 ${plugin.name} 已存在,将被覆盖`);
|
|
95
|
+
}
|
|
96
|
+
// 检查依赖是否已注册
|
|
97
|
+
if (plugin.dependencies && plugin.dependencies.length > 0) {
|
|
98
|
+
const missingDeps = plugin.dependencies.filter((dep)=>!this.plugins.has(dep));
|
|
99
|
+
if (missingDeps.length > 0) {
|
|
100
|
+
console.warn(`插件 ${plugin.name} 的依赖未注册: ${missingDeps.join(', ')}`);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
this.plugins.set(plugin.name, plugin);
|
|
104
|
+
this.pluginStatus.set(plugin.name, 'registered');
|
|
105
|
+
// 创建插件沙箱
|
|
106
|
+
if (plugin.sandbox) {
|
|
107
|
+
const sandbox = new _PluginSandbox.PluginSandbox({
|
|
108
|
+
...plugin.sandbox,
|
|
109
|
+
name: plugin.name
|
|
110
|
+
});
|
|
111
|
+
this.sandboxes.set(plugin.name, sandbox);
|
|
112
|
+
} else {
|
|
113
|
+
// 如果没有配置沙箱,创建默认沙箱(非严格模式)
|
|
114
|
+
const sandbox = new _PluginSandbox.PluginSandbox({
|
|
115
|
+
strictMode: false,
|
|
116
|
+
name: plugin.name
|
|
117
|
+
});
|
|
118
|
+
this.sandboxes.set(plugin.name, sandbox);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* 获取插件加载顺序(考虑依赖和优先级)
|
|
123
|
+
*
|
|
124
|
+
* @returns 插件名称数组,按加载顺序排列
|
|
125
|
+
*/ getLoadOrder() {
|
|
126
|
+
const plugins = Array.from(this.plugins.values());
|
|
127
|
+
// 按优先级排序
|
|
128
|
+
const sortedPlugins = plugins.sort((a, b)=>{
|
|
129
|
+
const priorityA = a.priority ?? 100;
|
|
130
|
+
const priorityB = b.priority ?? 100;
|
|
131
|
+
return priorityA - priorityB;
|
|
132
|
+
});
|
|
133
|
+
// 构建依赖图并拓扑排序
|
|
134
|
+
const visited = new Set();
|
|
135
|
+
const visiting = new Set();
|
|
136
|
+
const result = [];
|
|
137
|
+
const visit = (pluginName)=>{
|
|
138
|
+
if (visiting.has(pluginName)) {
|
|
139
|
+
console.warn(`检测到循环依赖,涉及插件: ${pluginName}`);
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
if (visited.has(pluginName)) {
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
visiting.add(pluginName);
|
|
146
|
+
const plugin = this.plugins.get(pluginName);
|
|
147
|
+
if (plugin?.dependencies) {
|
|
148
|
+
for (const dep of plugin.dependencies){
|
|
149
|
+
visit(dep);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
visiting.delete(pluginName);
|
|
153
|
+
visited.add(pluginName);
|
|
154
|
+
result.push(pluginName);
|
|
155
|
+
};
|
|
156
|
+
for (const plugin of sortedPlugins){
|
|
157
|
+
visit(plugin.name);
|
|
158
|
+
}
|
|
159
|
+
return result;
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* 注销插件
|
|
163
|
+
*/ unregister(name) {
|
|
164
|
+
const plugin = this.plugins.get(name);
|
|
165
|
+
if (plugin && plugin.destroy) {
|
|
166
|
+
plugin.destroy();
|
|
167
|
+
}
|
|
168
|
+
this.plugins.delete(name);
|
|
169
|
+
this.sandboxes.delete(name);
|
|
170
|
+
this.pluginStatus.delete(name);
|
|
171
|
+
this.pluginLoaders.delete(name);
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* 动态加载插件(热插拔)
|
|
175
|
+
*
|
|
176
|
+
* @param options - 插件加载选项
|
|
177
|
+
* @returns 加载的插件
|
|
178
|
+
*/ async loadPlugin(options) {
|
|
179
|
+
let plugin;
|
|
180
|
+
if (options.url) {
|
|
181
|
+
// 从URL加载插件
|
|
182
|
+
const response = await fetch(options.url);
|
|
183
|
+
if (!response.ok) {
|
|
184
|
+
throw new Error(`无法加载插件: ${options.url} (${response.status})`);
|
|
185
|
+
}
|
|
186
|
+
const pluginModule = await response.json();
|
|
187
|
+
plugin = pluginModule.default || pluginModule;
|
|
188
|
+
} else if (options.modulePath) {
|
|
189
|
+
// 从模块路径动态导入
|
|
190
|
+
const pluginModule = await Promise.resolve(options.modulePath).then((p)=>/*#__PURE__*/ _interop_require_wildcard(require(p)));
|
|
191
|
+
plugin = pluginModule.default || pluginModule;
|
|
192
|
+
} else {
|
|
193
|
+
throw new Error('必须提供 url 或 modulePath');
|
|
194
|
+
}
|
|
195
|
+
if (!plugin || !plugin.name) {
|
|
196
|
+
throw new Error('插件格式无效:必须包含 name 属性');
|
|
197
|
+
}
|
|
198
|
+
// 检查插件是否已加载
|
|
199
|
+
if (this.plugins.has(plugin.name)) {
|
|
200
|
+
throw new Error(`插件 ${plugin.name} 已加载`);
|
|
201
|
+
}
|
|
202
|
+
// 设置加载状态
|
|
203
|
+
this.pluginStatus.set(plugin.name, 'loading');
|
|
204
|
+
try {
|
|
205
|
+
// 注册插件
|
|
206
|
+
this.register(plugin);
|
|
207
|
+
// 如果要求立即初始化
|
|
208
|
+
if (options.initialize && options.initContext && options.startOptions) {
|
|
209
|
+
await this.initializePlugin(plugin.name, options.startOptions, options.initContext);
|
|
210
|
+
}
|
|
211
|
+
return plugin;
|
|
212
|
+
} catch (error) {
|
|
213
|
+
this.pluginStatus.delete(plugin.name);
|
|
214
|
+
throw error;
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* 初始化单个插件
|
|
219
|
+
*
|
|
220
|
+
* @param name - 插件名称
|
|
221
|
+
* @param options - 启动选项
|
|
222
|
+
* @param context - 初始化上下文
|
|
223
|
+
*/ async initializePlugin(name, options, context) {
|
|
224
|
+
const plugin = this.plugins.get(name);
|
|
225
|
+
if (!plugin) {
|
|
226
|
+
throw new Error(`插件 ${name} 未注册`);
|
|
227
|
+
}
|
|
228
|
+
const status = this.pluginStatus.get(name);
|
|
229
|
+
if (status === 'initialized') {
|
|
230
|
+
return; // 已经初始化
|
|
231
|
+
}
|
|
232
|
+
try {
|
|
233
|
+
const sandbox = this.sandboxes.get(name);
|
|
234
|
+
if (!sandbox) {
|
|
235
|
+
throw new Error(`插件 ${name} 的沙箱未找到`);
|
|
236
|
+
}
|
|
237
|
+
// 执行初始化钩子
|
|
238
|
+
if (plugin.init) {
|
|
239
|
+
const filteredOptions = sandbox.filterConfig(options);
|
|
240
|
+
await plugin.init(filteredOptions, context, sandbox, _PluginEventBus.pluginEventBus);
|
|
241
|
+
}
|
|
242
|
+
this.pluginStatus.set(name, 'initialized');
|
|
243
|
+
} catch (error) {
|
|
244
|
+
console.error(`插件 ${name} 初始化失败:`, error);
|
|
245
|
+
throw error;
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
/**
|
|
249
|
+
* 卸载插件(热插拔)
|
|
250
|
+
*
|
|
251
|
+
* @param name - 插件名称
|
|
252
|
+
* @param force - 是否强制卸载(即使有依赖)
|
|
253
|
+
*/ async unloadPlugin(name, force = false) {
|
|
254
|
+
const plugin = this.plugins.get(name);
|
|
255
|
+
if (!plugin) {
|
|
256
|
+
throw new Error(`插件 ${name} 未加载`);
|
|
257
|
+
}
|
|
258
|
+
// 检查是否有其他插件依赖此插件
|
|
259
|
+
if (!force) {
|
|
260
|
+
const dependents = Array.from(this.plugins.values()).filter((p)=>p.dependencies && p.dependencies.includes(name));
|
|
261
|
+
if (dependents.length > 0) {
|
|
262
|
+
throw new Error(`无法卸载插件 ${name},以下插件依赖它: ${dependents.map((p)=>p.name).join(', ')}`);
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
// 执行销毁钩子
|
|
266
|
+
if (plugin.destroy) {
|
|
267
|
+
try {
|
|
268
|
+
await plugin.destroy();
|
|
269
|
+
} catch (error) {
|
|
270
|
+
console.error(`插件 ${name} 的 destroy 钩子执行失败:`, error);
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
// 从事件总线移除相关监听器(如果有)
|
|
274
|
+
// 注意:事件总线是全局的,这里只移除插件相关的事件
|
|
275
|
+
// 实际实现可能需要更细粒度的控制
|
|
276
|
+
// 清理插件
|
|
277
|
+
this.unregister(name);
|
|
278
|
+
this.pluginStatus.set(name, 'destroyed');
|
|
279
|
+
}
|
|
280
|
+
/**
|
|
281
|
+
* 检查插件是否可以热加载
|
|
282
|
+
*
|
|
283
|
+
* @param plugin - 插件
|
|
284
|
+
* @returns 是否可以热加载
|
|
285
|
+
*/ canHotLoad(plugin) {
|
|
286
|
+
// 检查依赖是否都已加载
|
|
287
|
+
if (plugin.dependencies && plugin.dependencies.length > 0) {
|
|
288
|
+
const missingDeps = plugin.dependencies.filter((dep)=>!this.plugins.has(dep));
|
|
289
|
+
if (missingDeps.length > 0) {
|
|
290
|
+
return false;
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
return true;
|
|
294
|
+
}
|
|
295
|
+
/**
|
|
296
|
+
* 注册插件加载器(用于延迟加载)
|
|
297
|
+
*
|
|
298
|
+
* @param name - 插件名称
|
|
299
|
+
* @param loader - 加载器函数
|
|
300
|
+
*/ registerLoader(name, loader) {
|
|
301
|
+
this.pluginLoaders.set(name, loader);
|
|
302
|
+
}
|
|
303
|
+
/**
|
|
304
|
+
* 使用加载器加载插件
|
|
305
|
+
*
|
|
306
|
+
* @param name - 插件名称
|
|
307
|
+
* @param options - 加载选项
|
|
308
|
+
* @returns 加载的插件
|
|
309
|
+
*/ async loadPluginByLoader(name, options) {
|
|
310
|
+
const loader = this.pluginLoaders.get(name);
|
|
311
|
+
if (!loader) {
|
|
312
|
+
throw new Error(`插件 ${name} 的加载器未注册`);
|
|
313
|
+
}
|
|
314
|
+
const plugin = await loader();
|
|
315
|
+
if (!plugin || !plugin.name) {
|
|
316
|
+
throw new Error('插件格式无效:必须包含 name 属性');
|
|
317
|
+
}
|
|
318
|
+
if (plugin.name !== name) {
|
|
319
|
+
throw new Error(`插件名称不匹配: 期望 ${name},实际 ${plugin.name}`);
|
|
320
|
+
}
|
|
321
|
+
// 检查插件是否已加载
|
|
322
|
+
if (this.plugins.has(plugin.name)) {
|
|
323
|
+
return this.plugins.get(plugin.name);
|
|
324
|
+
}
|
|
325
|
+
// 设置加载状态
|
|
326
|
+
this.pluginStatus.set(plugin.name, 'loading');
|
|
327
|
+
try {
|
|
328
|
+
// 注册插件
|
|
329
|
+
this.register(plugin);
|
|
330
|
+
// 如果要求立即初始化
|
|
331
|
+
if (options?.initialize && options.initContext && options.startOptions) {
|
|
332
|
+
await this.initializePlugin(plugin.name, options.startOptions, options.initContext);
|
|
333
|
+
}
|
|
334
|
+
return plugin;
|
|
335
|
+
} catch (error) {
|
|
336
|
+
this.pluginStatus.delete(plugin.name);
|
|
337
|
+
throw error;
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
/**
|
|
341
|
+
* 获取插件
|
|
342
|
+
*/ get(name) {
|
|
343
|
+
return this.plugins.get(name);
|
|
344
|
+
}
|
|
345
|
+
/**
|
|
346
|
+
* 获取所有插件
|
|
347
|
+
*/ getAll() {
|
|
348
|
+
return Array.from(this.plugins.values());
|
|
349
|
+
}
|
|
350
|
+
/**
|
|
351
|
+
* 执行初始化前钩子
|
|
352
|
+
*
|
|
353
|
+
* 优化:按依赖顺序执行
|
|
354
|
+
*/ async executeBeforeInit(options) {
|
|
355
|
+
const loadOrder = this.getLoadOrder();
|
|
356
|
+
for (const pluginName of loadOrder){
|
|
357
|
+
const plugin = this.plugins.get(pluginName);
|
|
358
|
+
if (!plugin || !plugin.beforeInit) {
|
|
359
|
+
continue;
|
|
360
|
+
}
|
|
361
|
+
try {
|
|
362
|
+
const sandbox = this.sandboxes.get(plugin.name);
|
|
363
|
+
if (!sandbox) {
|
|
364
|
+
console.warn(`插件 ${plugin.name} 的沙箱未找到`);
|
|
365
|
+
continue;
|
|
366
|
+
}
|
|
367
|
+
// 根据沙箱配置过滤选项
|
|
368
|
+
const filteredOptions = sandbox.filterConfig(options);
|
|
369
|
+
await plugin.beforeInit(filteredOptions, sandbox, _PluginEventBus.pluginEventBus);
|
|
370
|
+
} catch (error) {
|
|
371
|
+
console.error(`插件 ${plugin.name} 的 beforeInit 钩子执行失败:`, error);
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
/**
|
|
376
|
+
* 执行初始化钩子
|
|
377
|
+
*
|
|
378
|
+
* 优化:按依赖顺序执行,并更新插件状态
|
|
379
|
+
*/ async executeInit(options, context) {
|
|
380
|
+
const loadOrder = this.getLoadOrder();
|
|
381
|
+
for (const pluginName of loadOrder){
|
|
382
|
+
const plugin = this.plugins.get(pluginName);
|
|
383
|
+
if (!plugin || !plugin.init) {
|
|
384
|
+
continue;
|
|
385
|
+
}
|
|
386
|
+
try {
|
|
387
|
+
const sandbox = this.sandboxes.get(plugin.name);
|
|
388
|
+
if (!sandbox) {
|
|
389
|
+
console.warn(`插件 ${plugin.name} 的沙箱未找到`);
|
|
390
|
+
continue;
|
|
391
|
+
}
|
|
392
|
+
// 根据沙箱配置过滤选项
|
|
393
|
+
const filteredOptions = sandbox.filterConfig(options);
|
|
394
|
+
await plugin.init(filteredOptions, context, sandbox, _PluginEventBus.pluginEventBus);
|
|
395
|
+
this.pluginStatus.set(plugin.name, 'initialized');
|
|
396
|
+
} catch (error) {
|
|
397
|
+
console.error(`插件 ${plugin.name} 的 init 钩子执行失败:`, error);
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
/**
|
|
402
|
+
* 执行初始化后钩子
|
|
403
|
+
*
|
|
404
|
+
* 优化:按依赖顺序执行(逆序,确保依赖插件先执行)
|
|
405
|
+
*/ async executeAfterInit(options, context) {
|
|
406
|
+
const loadOrder = this.getLoadOrder();
|
|
407
|
+
// 逆序执行,确保依赖插件先执行
|
|
408
|
+
const reverseOrder = [
|
|
409
|
+
...loadOrder
|
|
410
|
+
].reverse();
|
|
411
|
+
for (const pluginName of reverseOrder){
|
|
412
|
+
const plugin = this.plugins.get(pluginName);
|
|
413
|
+
if (!plugin || !plugin.afterInit) {
|
|
414
|
+
continue;
|
|
415
|
+
}
|
|
416
|
+
try {
|
|
417
|
+
const sandbox = this.sandboxes.get(plugin.name);
|
|
418
|
+
if (!sandbox) {
|
|
419
|
+
console.warn(`插件 ${plugin.name} 的沙箱未找到`);
|
|
420
|
+
continue;
|
|
421
|
+
}
|
|
422
|
+
// 根据沙箱配置过滤选项
|
|
423
|
+
const filteredOptions = sandbox.filterConfig(options);
|
|
424
|
+
await plugin.afterInit(filteredOptions, context, sandbox, _PluginEventBus.pluginEventBus);
|
|
425
|
+
} catch (error) {
|
|
426
|
+
console.error(`插件 ${plugin.name} 的 afterInit 钩子执行失败:`, error);
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
/**
|
|
431
|
+
* 获取插件状态
|
|
432
|
+
*
|
|
433
|
+
* @param name - 插件名称
|
|
434
|
+
* @returns 插件状态
|
|
435
|
+
*/ getPluginStatus(name) {
|
|
436
|
+
return this.pluginStatus.get(name);
|
|
437
|
+
}
|
|
438
|
+
/**
|
|
439
|
+
* 检查插件是否已加载
|
|
440
|
+
*
|
|
441
|
+
* @param name - 插件名称
|
|
442
|
+
* @returns 是否已加载
|
|
443
|
+
*/ isLoaded(name) {
|
|
444
|
+
return this.plugins.has(name);
|
|
445
|
+
}
|
|
446
|
+
/**
|
|
447
|
+
* 获取已加载的插件列表
|
|
448
|
+
*
|
|
449
|
+
* @returns 插件名称数组
|
|
450
|
+
*/ getLoadedPlugins() {
|
|
451
|
+
return Array.from(this.plugins.keys());
|
|
452
|
+
}
|
|
453
|
+
/**
|
|
454
|
+
* 获取所有插件状态
|
|
455
|
+
*
|
|
456
|
+
* @returns 插件状态映射
|
|
457
|
+
*/ getAllPluginStatus() {
|
|
458
|
+
return new Map(this.pluginStatus);
|
|
459
|
+
}
|
|
460
|
+
/**
|
|
461
|
+
* 获取插件沙箱
|
|
462
|
+
*
|
|
463
|
+
* @param name - 插件名称
|
|
464
|
+
* @returns 插件沙箱或undefined
|
|
465
|
+
*/ getSandbox(name) {
|
|
466
|
+
return this.sandboxes.get(name);
|
|
467
|
+
}
|
|
468
|
+
/**
|
|
469
|
+
* 获取事件总线
|
|
470
|
+
*/ getEventBus() {
|
|
471
|
+
return _PluginEventBus.pluginEventBus;
|
|
472
|
+
}
|
|
473
|
+
/**
|
|
474
|
+
* 销毁所有插件
|
|
475
|
+
*/ async destroyAll() {
|
|
476
|
+
for (const plugin of this.plugins.values()){
|
|
477
|
+
if (plugin.destroy) {
|
|
478
|
+
try {
|
|
479
|
+
await plugin.destroy();
|
|
480
|
+
} catch (error) {
|
|
481
|
+
console.error(`插件 ${plugin.name} 的 destroy 钩子执行失败:`, error);
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
this.plugins.clear();
|
|
486
|
+
}
|
|
487
|
+
constructor(){
|
|
488
|
+
_define_property(this, "plugins", new Map());
|
|
489
|
+
_define_property(this, "sandboxes", new Map());
|
|
490
|
+
_define_property(this, "pluginStatus", new Map());
|
|
491
|
+
_define_property(this, "pluginLoaders", new Map());
|
|
492
|
+
}
|
|
493
|
+
};
|
|
494
|
+
const pluginManager = new PluginManager();
|
|
495
|
+
|
|
496
|
+
//# sourceMappingURL=plugin.js.map
|