@open-core/framework 1.0.2-beta.1 → 1.0.5-beta.1
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 +373 -373
- package/README.md +196 -268
- package/dist/adapters/cfx/cfx-capabilities.d.ts +16 -0
- package/dist/adapters/cfx/cfx-capabilities.js +70 -0
- package/dist/adapters/cfx/cfx-platform.d.ts +2 -0
- package/dist/adapters/cfx/cfx-platform.js +85 -0
- package/dist/adapters/cfx/index.d.ts +3 -0
- package/dist/adapters/cfx/index.js +3 -0
- package/dist/adapters/cfx/runtime-profile.d.ts +3 -0
- package/dist/adapters/cfx/runtime-profile.js +37 -0
- package/dist/adapters/contracts/IEngineEvents.d.ts +20 -0
- package/dist/adapters/contracts/IEngineEvents.js +2 -0
- package/dist/adapters/contracts/IExports.d.ts +4 -0
- package/dist/adapters/contracts/IExports.js +2 -0
- package/dist/adapters/contracts/IHasher.d.ts +15 -0
- package/dist/adapters/contracts/IHasher.js +8 -0
- package/dist/adapters/contracts/IPlatformCapabilities.d.ts +79 -0
- package/dist/adapters/contracts/IPlatformCapabilities.js +27 -0
- package/dist/adapters/contracts/IPlayerInfo.d.ts +5 -0
- package/dist/adapters/contracts/IPlayerInfo.js +2 -0
- package/dist/adapters/contracts/IResourceInfo.d.ts +4 -0
- package/dist/adapters/contracts/IResourceInfo.js +2 -0
- package/dist/adapters/contracts/ITick.d.ts +10 -0
- package/dist/adapters/contracts/ITick.js +5 -0
- package/dist/adapters/contracts/client/IPedAppearanceClient.d.ts +206 -0
- package/dist/adapters/contracts/client/IPedAppearanceClient.js +12 -0
- package/dist/adapters/contracts/index.d.ts +2 -0
- package/dist/adapters/contracts/index.js +3 -0
- package/dist/adapters/contracts/server/IEntityServer.d.ts +188 -0
- package/dist/adapters/contracts/server/IEntityServer.js +35 -0
- package/dist/adapters/contracts/server/IPedAppearanceServer.d.ts +45 -0
- package/dist/adapters/contracts/server/IPedAppearanceServer.js +12 -0
- package/dist/adapters/contracts/server/IPedServer.d.ts +29 -0
- package/dist/adapters/contracts/server/IPedServer.js +8 -0
- package/dist/adapters/contracts/server/IPlayerServer.d.ts +117 -0
- package/dist/adapters/contracts/server/IPlayerServer.js +35 -0
- package/dist/adapters/contracts/server/IVehicleServer.d.ts +55 -0
- package/dist/adapters/contracts/server/IVehicleServer.js +9 -0
- package/dist/adapters/contracts/transport/context.d.ts +5 -0
- package/dist/adapters/contracts/transport/events.api.d.ts +36 -0
- package/dist/adapters/contracts/transport/events.api.js +5 -0
- package/dist/adapters/contracts/transport/messaging.transport.d.ts +8 -0
- package/dist/adapters/contracts/transport/messaging.transport.js +2 -0
- package/dist/adapters/contracts/transport/rpc.api.d.ts +66 -0
- package/dist/adapters/contracts/transport/rpc.api.js +20 -0
- package/dist/adapters/contracts/types/identifier.d.ts +67 -0
- package/dist/adapters/contracts/types/identifier.js +58 -0
- package/dist/adapters/contracts/types/index.d.ts +1 -0
- package/dist/adapters/contracts/types/index.js +1 -0
- package/dist/adapters/fivem/fivem-capabilities.d.ts +18 -0
- package/dist/adapters/fivem/fivem-capabilities.js +61 -0
- package/dist/adapters/fivem/fivem-engine-events.d.ts +5 -0
- package/dist/adapters/fivem/fivem-engine-events.js +24 -0
- package/dist/adapters/fivem/fivem-entity-server.d.ts +26 -0
- package/dist/adapters/fivem/fivem-entity-server.js +87 -0
- package/dist/adapters/fivem/fivem-exports.d.ts +5 -0
- package/dist/adapters/fivem/fivem-exports.js +9 -0
- package/dist/adapters/fivem/fivem-hasher.d.ts +7 -0
- package/dist/adapters/fivem/fivem-hasher.js +20 -0
- package/dist/adapters/fivem/fivem-net-transport.d.ts +1 -0
- package/dist/adapters/fivem/fivem-net-transport.js +0 -0
- package/dist/adapters/fivem/fivem-ped-appearance-client.d.ts +34 -0
- package/dist/adapters/fivem/fivem-ped-appearance-client.js +79 -0
- package/dist/adapters/fivem/fivem-ped-appearance-server.d.ts +14 -0
- package/dist/adapters/fivem/fivem-ped-appearance-server.js +22 -0
- package/dist/adapters/fivem/fivem-ped-server.d.ts +9 -0
- package/dist/adapters/fivem/fivem-ped-server.js +30 -0
- package/dist/adapters/fivem/fivem-platform.d.ts +5 -0
- package/dist/adapters/fivem/fivem-platform.js +74 -0
- package/dist/adapters/fivem/fivem-player-server.d.ts +24 -0
- package/dist/adapters/fivem/fivem-player-server.js +83 -0
- package/dist/adapters/fivem/fivem-playerinfo.d.ts +6 -0
- package/dist/adapters/fivem/fivem-playerinfo.js +10 -0
- package/dist/adapters/fivem/fivem-resourceinfo.d.ts +5 -0
- package/dist/adapters/fivem/fivem-resourceinfo.js +24 -0
- package/dist/adapters/fivem/fivem-tick.d.ts +7 -0
- package/dist/adapters/fivem/fivem-tick.js +19 -0
- package/dist/adapters/fivem/fivem-vehicle-server.d.ts +15 -0
- package/dist/adapters/fivem/fivem-vehicle-server.js +44 -0
- package/dist/adapters/fivem/index.d.ts +14 -0
- package/dist/adapters/fivem/index.js +16 -0
- package/dist/adapters/fivem/transport/adapter.d.ts +8 -0
- package/dist/adapters/fivem/transport/adapter.js +8 -0
- package/dist/adapters/fivem/transport/fivem.events.d.ts +8 -0
- package/dist/adapters/fivem/transport/fivem.events.js +36 -0
- package/dist/adapters/fivem/transport/fivem.rpc.d.ts +28 -0
- package/dist/adapters/fivem/transport/fivem.rpc.js +183 -0
- package/dist/adapters/index.d.ts +21 -0
- package/dist/adapters/index.js +32 -0
- package/dist/adapters/node/index.d.ts +16 -0
- package/dist/adapters/node/index.js +18 -0
- package/dist/adapters/node/node-capabilities.d.ts +19 -0
- package/dist/adapters/node/node-capabilities.js +48 -0
- package/dist/adapters/node/node-engine-events.d.ts +20 -0
- package/dist/adapters/node/node-engine-events.js +40 -0
- package/dist/adapters/node/node-entity-server.d.ts +37 -0
- package/dist/adapters/node/node-entity-server.js +118 -0
- package/dist/adapters/node/node-exports.d.ts +26 -0
- package/dist/adapters/node/node-exports.js +58 -0
- package/dist/adapters/node/node-hasher.d.ts +12 -0
- package/dist/adapters/node/node-hasher.js +36 -0
- package/dist/adapters/node/node-ped-appearance-client.d.ts +34 -0
- package/dist/adapters/node/node-ped-appearance-client.js +55 -0
- package/dist/adapters/node/node-ped-appearance-server.d.ts +14 -0
- package/dist/adapters/node/node-ped-appearance-server.js +14 -0
- package/dist/adapters/node/node-ped-server.d.ts +13 -0
- package/dist/adapters/node/node-ped-server.js +45 -0
- package/dist/adapters/node/node-platform.d.ts +5 -0
- package/dist/adapters/node/node-platform.js +76 -0
- package/dist/adapters/node/node-player-server.d.ts +44 -0
- package/dist/adapters/node/node-player-server.js +105 -0
- package/dist/adapters/node/node-playerinfo.d.ts +6 -0
- package/dist/adapters/node/node-playerinfo.js +20 -0
- package/dist/adapters/node/node-resourceinfo.d.ts +13 -0
- package/dist/adapters/node/node-resourceinfo.js +27 -0
- package/dist/adapters/node/node-tick.d.ts +10 -0
- package/dist/adapters/node/node-tick.js +41 -0
- package/dist/adapters/node/node-vehicle-server.d.ts +21 -0
- package/dist/adapters/node/node-vehicle-server.js +84 -0
- package/dist/adapters/node/transport/adapter.d.ts +10 -0
- package/dist/adapters/node/transport/adapter.js +14 -0
- package/dist/adapters/node/transport/node.events.d.ts +14 -0
- package/dist/adapters/node/transport/node.events.js +38 -0
- package/dist/adapters/node/transport/node.rpc.d.ts +18 -0
- package/dist/adapters/node/transport/node.rpc.js +71 -0
- package/dist/adapters/platform/index.d.ts +1 -0
- package/dist/adapters/platform/index.js +1 -0
- package/dist/adapters/platform/platform-registry.d.ts +101 -0
- package/dist/adapters/platform/platform-registry.js +113 -0
- package/dist/adapters/register-capabilities.d.ts +61 -0
- package/dist/adapters/register-capabilities.js +78 -0
- package/dist/adapters/register-client-capabilities.d.ts +8 -0
- package/dist/adapters/register-client-capabilities.js +58 -0
- package/dist/index.d.ts +3 -6
- package/dist/index.js +4 -46
- package/dist/kernel/di/class-constructor.js +0 -0
- package/dist/kernel/di/container.d.ts +5 -0
- package/dist/kernel/di/container.js +6 -0
- package/dist/kernel/di/decorator-processor.js +0 -0
- package/dist/kernel/di/index.d.ts +4 -0
- package/dist/kernel/di/index.js +4 -0
- package/dist/kernel/di/metadata.scanner.d.ts +7 -0
- package/dist/kernel/di/metadata.scanner.js +61 -0
- package/dist/kernel/error/app.error.d.ts +9 -0
- package/dist/kernel/error/app.error.js +15 -0
- package/dist/kernel/error/common.error-codes.d.ts +1 -0
- package/dist/kernel/error/common.error-codes.js +0 -0
- package/dist/kernel/error/framework.error-codes.d.ts +12 -0
- package/dist/kernel/error/framework.error-codes.js +0 -0
- package/dist/kernel/error/index.d.ts +4 -0
- package/dist/kernel/error/index.js +2 -0
- package/dist/kernel/error/security.error.d.ts +6 -0
- package/dist/kernel/error/security.error.js +9 -0
- package/dist/kernel/error/security.types.js +0 -0
- package/dist/kernel/index.d.ts +6 -0
- package/dist/kernel/index.js +7 -0
- package/dist/kernel/logger/core-logger.d.ts +31 -0
- package/dist/kernel/logger/core-logger.js +66 -0
- package/dist/kernel/logger/index.d.ts +14 -0
- package/dist/kernel/logger/index.js +12 -0
- package/dist/kernel/logger/logger.config.d.ts +47 -0
- package/dist/kernel/logger/logger.config.js +32 -0
- package/dist/kernel/logger/logger.env.d.ts +35 -0
- package/dist/kernel/logger/logger.env.js +59 -0
- package/dist/kernel/logger/logger.service.d.ts +175 -0
- package/dist/kernel/logger/logger.service.js +301 -0
- package/dist/kernel/logger/logger.types.js +70 -0
- package/dist/kernel/logger/transports/buffered.transport.d.ts +88 -0
- package/dist/kernel/logger/transports/buffered.transport.js +154 -0
- package/dist/kernel/logger/transports/console.transport.d.ts +37 -0
- package/dist/kernel/logger/transports/console.transport.js +121 -0
- package/dist/kernel/logger/transports/dev-transport.factory.d.ts +75 -0
- package/dist/kernel/logger/transports/dev-transport.factory.js +101 -0
- package/dist/kernel/logger/transports/http.transport.d.ts +67 -0
- package/dist/kernel/logger/transports/http.transport.js +168 -0
- package/dist/kernel/logger/transports/index.d.ts +7 -0
- package/dist/kernel/logger/transports/index.js +7 -0
- package/dist/kernel/logger/transports/simple-console.transport.d.ts +38 -0
- package/dist/kernel/logger/transports/simple-console.transport.js +79 -0
- package/dist/kernel/logger/transports/transport.interface.d.ts +40 -0
- package/dist/kernel/logger/transports/transport.interface.js +0 -0
- package/dist/kernel/logger/transports/websocket.transport.d.ts +69 -0
- package/dist/kernel/logger/transports/websocket.transport.js +164 -0
- package/dist/kernel/schema/index.d.ts +32 -0
- package/dist/kernel/schema/index.js +4 -0
- package/dist/kernel/shared/index.d.ts +1 -0
- package/dist/kernel/shared/index.js +1 -0
- package/dist/kernel/shared/player-appearance.types.d.ts +276 -0
- package/dist/kernel/shared/player-appearance.types.js +74 -0
- package/dist/kernel/utils/index.d.ts +3 -0
- package/dist/kernel/utils/index.js +3 -0
- package/dist/kernel/utils/result.d.ts +12 -0
- package/dist/kernel/utils/result.js +6 -0
- package/dist/kernel/utils/rgb.d.ts +17 -0
- package/dist/kernel/utils/rgb.js +61 -0
- package/dist/kernel/utils/vector3.d.ts +14 -0
- package/dist/kernel/utils/vector3.js +24 -0
- package/dist/runtime/client/.opencore/autoload.client.controllers.d.ts +1 -0
- package/dist/runtime/client/.opencore/autoload.client.controllers.js +0 -0
- package/dist/runtime/client/api.d.ts +8 -0
- package/dist/runtime/client/api.js +8 -0
- package/dist/runtime/client/bus/library-event.bus.d.ts +5 -0
- package/dist/runtime/client/bus/library-event.bus.js +28 -0
- package/dist/runtime/client/client-api-runtime.d.ts +7 -0
- package/dist/runtime/client/client-api-runtime.js +34 -0
- package/dist/runtime/client/client-bootstrap.d.ts +7 -0
- package/dist/runtime/client/client-bootstrap.js +160 -0
- package/dist/runtime/client/client-container.js +3 -0
- package/dist/runtime/client/client-core.d.ts +19 -0
- package/dist/runtime/client/client-core.js +23 -0
- package/dist/runtime/client/client-runtime.d.ts +63 -0
- package/dist/runtime/client/client-runtime.js +21 -0
- package/dist/runtime/client/controllers/appearance.controller.d.ts +8 -0
- package/dist/runtime/client/controllers/appearance.controller.js +48 -0
- package/dist/runtime/client/controllers/player-sync.controller.d.ts +11 -0
- package/dist/runtime/client/controllers/player-sync.controller.js +51 -0
- package/dist/runtime/client/controllers/spawner.controller.d.ts +12 -0
- package/dist/runtime/client/controllers/spawner.controller.js +49 -0
- package/dist/runtime/client/decorators/controller.d.ts +20 -0
- package/dist/runtime/client/decorators/controller.js +62 -0
- package/dist/runtime/client/decorators/export.d.ts +21 -0
- package/dist/runtime/client/decorators/export.js +26 -0
- package/dist/runtime/client/decorators/gameEvent.d.ts +47 -0
- package/dist/runtime/client/decorators/gameEvent.js +50 -0
- package/dist/runtime/client/decorators/index.d.ts +13 -0
- package/dist/runtime/client/decorators/index.js +13 -0
- package/dist/runtime/client/decorators/interval.d.ts +23 -0
- package/dist/runtime/client/decorators/interval.js +28 -0
- package/dist/runtime/client/decorators/key.d.ts +23 -0
- package/dist/runtime/client/decorators/key.js +28 -0
- package/dist/runtime/client/decorators/localEvent.d.ts +21 -0
- package/dist/runtime/client/decorators/localEvent.js +26 -0
- package/dist/runtime/client/decorators/onLibraryEvent.d.ts +17 -0
- package/dist/runtime/client/decorators/onLibraryEvent.js +22 -0
- package/dist/runtime/client/decorators/onNet.d.ts +21 -0
- package/dist/runtime/client/decorators/onNet.js +26 -0
- package/dist/runtime/client/decorators/onRPC.d.ts +41 -0
- package/dist/runtime/client/decorators/onRPC.js +40 -0
- package/dist/runtime/client/decorators/onTick.d.ts +21 -0
- package/dist/runtime/client/decorators/onTick.js +26 -0
- package/dist/runtime/client/decorators/onView.d.ts +21 -0
- package/dist/runtime/client/decorators/onView.js +26 -0
- package/dist/runtime/client/decorators/resourceLifecycle.d.ts +40 -0
- package/dist/runtime/client/decorators/resourceLifecycle.js +49 -0
- package/dist/runtime/client/index.d.ts +4 -0
- package/dist/runtime/client/index.js +2 -0
- package/dist/runtime/client/library/create-client-library.d.ts +13 -0
- package/dist/runtime/client/library/create-client-library.js +45 -0
- package/dist/runtime/client/library/index.d.ts +4 -0
- package/dist/runtime/client/library/index.js +2 -0
- package/dist/runtime/client/library/plugin/client-plugin-api.d.ts +5 -0
- package/dist/runtime/client/library/plugin/client-plugin-api.js +0 -0
- package/dist/runtime/client/library/plugin/index.d.ts +4 -0
- package/dist/runtime/client/library/plugin/index.js +4 -0
- package/dist/runtime/client/library/plugin/install-client-plugins.d.ts +3 -0
- package/dist/runtime/client/library/plugin/install-client-plugins.js +35 -0
- package/dist/runtime/client/library/plugin/plugin-context.d.ts +10 -0
- package/dist/runtime/client/library/plugin/plugin-context.js +0 -0
- package/dist/runtime/client/library/plugin/plugin-registry.d.ts +6 -0
- package/dist/runtime/client/library/plugin/plugin-registry.js +12 -0
- package/dist/runtime/client/library/plugin/plugin.interface.d.ts +11 -0
- package/dist/runtime/client/library/plugin/plugin.interface.js +0 -0
- package/dist/runtime/client/player/player.d.ts +262 -0
- package/dist/runtime/client/player/player.js +474 -0
- package/dist/runtime/client/player/player.loader.js +18 -0
- package/dist/runtime/client/services/appearance.service.d.ts +132 -0
- package/dist/runtime/client/services/appearance.service.js +330 -0
- package/dist/runtime/client/services/blip.service.d.ts +112 -0
- package/dist/runtime/client/services/blip.service.js +209 -0
- package/dist/runtime/client/services/camera-effects.registry.d.ts +94 -0
- package/dist/runtime/client/services/camera-effects.registry.js +145 -0
- package/dist/runtime/client/services/camera.d.ts +129 -0
- package/dist/runtime/client/services/camera.js +158 -0
- package/dist/runtime/client/services/cinematic-builder.d.ts +107 -0
- package/dist/runtime/client/services/cinematic-builder.js +467 -0
- package/dist/runtime/client/services/cinematic.d.ts +284 -0
- package/dist/runtime/client/services/cinematic.js +783 -0
- package/dist/runtime/client/services/index.d.ts +14 -0
- package/dist/runtime/client/services/index.js +14 -0
- package/dist/runtime/client/services/marker.service.d.ts +94 -0
- package/dist/runtime/client/services/marker.service.js +148 -0
- package/dist/runtime/client/services/notification.service.js +108 -0
- package/dist/runtime/client/services/ped.service.d.ts +182 -0
- package/dist/runtime/client/services/ped.service.js +298 -0
- package/dist/runtime/client/services/progress.service.js +199 -0
- package/dist/runtime/client/services/spawn.service.d.ts +73 -0
- package/dist/runtime/client/services/spawn.service.js +255 -0
- package/dist/runtime/client/services/streaming.service.js +331 -0
- package/dist/runtime/client/services/textui.service.d.ts +82 -0
- package/dist/runtime/client/services/textui.service.js +160 -0
- package/dist/runtime/client/services/vehicle-client.service.d.ts +180 -0
- package/dist/runtime/client/services/vehicle-client.service.js +483 -0
- package/dist/runtime/client/services/vehicle.service.d.ts +168 -0
- package/dist/runtime/client/services/vehicle.service.js +293 -0
- package/dist/runtime/client/system/metadata-client.keys.d.ts +15 -0
- package/dist/runtime/client/system/metadata-client.keys.js +15 -0
- package/dist/runtime/client/system/processors/export.processor.d.ts +7 -0
- package/dist/runtime/client/system/processors/export.processor.js +34 -0
- package/dist/runtime/client/system/processors/gameEvent.processor.d.ts +10 -0
- package/dist/runtime/client/system/processors/gameEvent.processor.js +53 -0
- package/dist/runtime/client/system/processors/interval.processor.d.ts +7 -0
- package/dist/runtime/client/system/processors/interval.processor.js +38 -0
- package/dist/runtime/client/system/processors/key.processor.d.ts +8 -0
- package/dist/runtime/client/system/processors/key.processor.js +22 -0
- package/dist/runtime/client/system/processors/libraryEvent.processor.d.ts +6 -0
- package/dist/runtime/client/system/processors/libraryEvent.processor.js +36 -0
- package/dist/runtime/client/system/processors/localEvent.processor.d.ts +7 -0
- package/dist/runtime/client/system/processors/localEvent.processor.js +33 -0
- package/dist/runtime/client/system/processors/netEvent.processor.d.ts +7 -0
- package/dist/runtime/client/system/processors/netEvent.processor.js +33 -0
- package/dist/runtime/client/system/processors/onRpc.processor.d.ts +9 -0
- package/dist/runtime/client/system/processors/onRpc.processor.js +62 -0
- package/dist/runtime/client/system/processors/resourceLifecycle.processor.d.ts +9 -0
- package/dist/runtime/client/system/processors/resourceLifecycle.processor.js +62 -0
- package/dist/runtime/client/system/processors/tick.processor.d.ts +5 -0
- package/dist/runtime/client/system/processors/tick.processor.js +32 -0
- package/dist/runtime/client/system/processors/view.processor.d.ts +7 -0
- package/dist/runtime/client/system/processors/view.processor.js +36 -0
- package/dist/runtime/client/system/processors.register.js +28 -0
- package/dist/runtime/client/types/game-events.d.ts +128 -0
- package/dist/runtime/client/types/game-events.js +72 -0
- package/dist/runtime/client/types/index.js +1 -0
- package/dist/runtime/client/ui-bridge.js +196 -0
- package/dist/runtime/core/entity.d.ts +168 -0
- package/dist/runtime/core/entity.js +232 -0
- package/dist/runtime/core/index.d.ts +5 -0
- package/dist/runtime/core/index.js +5 -0
- package/dist/runtime/core/library/create-library-base.d.ts +15 -0
- package/dist/runtime/core/library/create-library-base.js +27 -0
- package/dist/runtime/core/library/index.d.ts +5 -0
- package/dist/runtime/core/library/index.js +4 -0
- package/dist/runtime/core/library/library-bus.d.ts +9 -0
- package/dist/runtime/core/library/library-bus.js +46 -0
- package/dist/runtime/core/library/library-config.d.ts +10 -0
- package/dist/runtime/core/library/library-config.js +12 -0
- package/dist/runtime/core/library/library-event-id.d.ts +8 -0
- package/dist/runtime/core/library/library-event-id.js +9 -0
- package/dist/runtime/core/library/types.d.ts +146 -0
- package/dist/runtime/core/library/types.js +0 -0
- package/dist/runtime/core/nativehandle.d.ts +3 -0
- package/dist/runtime/core/nativehandle.js +0 -0
- package/dist/runtime/core/spatial.d.ts +7 -0
- package/dist/runtime/core/spatial.js +0 -0
- package/dist/runtime/core/world.d.ts +13 -0
- package/dist/runtime/core/world.js +57 -0
- package/dist/runtime/server/.opencore/autoload.server.controllers.d.ts +1 -0
- package/dist/runtime/server/.opencore/autoload.server.controllers.js +0 -0
- package/dist/runtime/server/api.d.ts +15 -0
- package/dist/runtime/server/api.js +21 -0
- package/dist/runtime/server/apis/appearance.api.d.ts +41 -0
- package/dist/runtime/server/apis/appearance.api.js +66 -0
- package/dist/runtime/server/apis/chat.api.d.ts +69 -0
- package/dist/runtime/server/apis/chat.api.js +129 -0
- package/dist/runtime/server/apis/index.d.ts +6 -0
- package/dist/runtime/server/apis/index.js +6 -0
- package/dist/runtime/server/apis/npcs.api.d.ts +213 -0
- package/dist/runtime/server/apis/npcs.api.js +465 -0
- package/dist/runtime/server/apis/parallel-compute.api.d.ts +118 -0
- package/dist/runtime/server/apis/parallel-compute.api.js +423 -0
- package/dist/runtime/server/apis/vehicle-modification.api.d.ts +94 -0
- package/dist/runtime/server/apis/vehicle-modification.api.js +308 -0
- package/dist/runtime/server/apis/vehicles.api.d.ts +140 -0
- package/dist/runtime/server/apis/vehicles.api.js +386 -0
- package/dist/runtime/server/bootstrap.d.ts +21 -0
- package/dist/runtime/server/bootstrap.js +310 -0
- package/dist/runtime/server/bus/internal-event.bus.d.ts +6 -0
- package/dist/runtime/server/bus/internal-event.bus.js +30 -0
- package/dist/runtime/server/bus/library-event.bus.d.ts +5 -0
- package/dist/runtime/server/bus/library-event.bus.js +27 -0
- package/dist/runtime/server/concepts/channel.d.ts +29 -0
- package/dist/runtime/server/concepts/channel.js +70 -0
- package/dist/runtime/server/contracts/index.d.ts +6 -0
- package/dist/runtime/server/contracts/index.js +8 -0
- package/dist/runtime/server/contracts/player-persistence.contract.d.ts +84 -0
- package/dist/runtime/server/contracts/player-persistence.contract.js +46 -0
- package/dist/runtime/server/contracts/security/command-error-observer.contract.d.ts +73 -0
- package/dist/runtime/server/contracts/security/command-error-observer.contract.js +5 -0
- package/dist/runtime/server/contracts/security/net-event-security-observer.contract.d.ts +15 -0
- package/dist/runtime/server/contracts/security/net-event-security-observer.contract.js +2 -0
- package/dist/runtime/server/contracts/security/principal-provider.contract.d.ts +43 -0
- package/dist/runtime/server/contracts/security/principal-provider.contract.js +15 -0
- package/dist/runtime/server/contracts/security/security-handler.contract.d.ts +5 -0
- package/dist/runtime/server/contracts/security/security-handler.contract.js +2 -0
- package/dist/runtime/server/controllers/channel.controller.d.ts +115 -0
- package/dist/runtime/server/controllers/channel.controller.js +373 -0
- package/dist/runtime/server/controllers/chat.controller.d.ts +11 -0
- package/dist/runtime/server/controllers/chat.controller.js +67 -0
- package/dist/runtime/server/controllers/command-export.controller.d.ts +83 -0
- package/dist/runtime/server/controllers/command-export.controller.js +331 -0
- package/dist/runtime/server/controllers/player-export.controller.d.ts +30 -0
- package/dist/runtime/server/controllers/player-export.controller.js +172 -0
- package/dist/runtime/server/controllers/principal-export.controller.d.ts +79 -0
- package/dist/runtime/server/controllers/principal-export.controller.js +292 -0
- package/dist/runtime/server/controllers/ready.controller.d.ts +4 -0
- package/dist/runtime/server/controllers/ready.controller.js +27 -0
- package/dist/runtime/server/controllers/remote-command-execution.controller.d.ts +52 -0
- package/dist/runtime/server/controllers/remote-command-execution.controller.js +172 -0
- package/dist/runtime/server/controllers/session.controller.d.ts +11 -0
- package/dist/runtime/server/controllers/session.controller.js +83 -0
- package/dist/runtime/server/controllers/vehicle.controller.d.ts +20 -0
- package/dist/runtime/server/controllers/vehicle.controller.js +68 -0
- package/dist/runtime/server/core.d.ts +7 -0
- package/dist/runtime/server/core.js +37 -0
- package/dist/runtime/server/decorators/binaryCall.d.ts +15 -0
- package/dist/runtime/server/decorators/binaryCall.js +23 -0
- package/dist/runtime/server/decorators/binaryEvent.d.ts +21 -0
- package/dist/runtime/server/decorators/binaryEvent.js +22 -0
- package/dist/runtime/server/decorators/binaryService.d.ts +27 -0
- package/dist/runtime/server/decorators/binaryService.js +71 -0
- package/dist/runtime/server/decorators/bind.d.ts +21 -0
- package/dist/runtime/server/decorators/bind.js +28 -0
- package/dist/runtime/server/decorators/command.d.ts +87 -0
- package/dist/runtime/server/decorators/command.js +36 -0
- package/dist/runtime/server/decorators/controller.d.ts +26 -0
- package/dist/runtime/server/decorators/controller.js +56 -0
- package/dist/runtime/server/decorators/export.d.ts +24 -0
- package/dist/runtime/server/decorators/export.js +29 -0
- package/dist/runtime/server/decorators/guard.d.ts +51 -0
- package/dist/runtime/server/decorators/guard.js +80 -0
- package/dist/runtime/server/decorators/index.d.ts +18 -0
- package/dist/runtime/server/decorators/index.js +18 -0
- package/dist/runtime/server/decorators/onFrameworkEvent.d.ts +24 -0
- package/dist/runtime/server/decorators/onFrameworkEvent.js +28 -0
- package/dist/runtime/server/decorators/onLibraryEvent.d.ts +17 -0
- package/dist/runtime/server/decorators/onLibraryEvent.js +22 -0
- package/dist/runtime/server/decorators/onNet.d.ts +65 -0
- package/dist/runtime/server/decorators/onNet.js +12 -0
- package/dist/runtime/server/decorators/onRPC.d.ts +78 -0
- package/dist/runtime/server/decorators/onRPC.js +59 -0
- package/dist/runtime/server/decorators/onRuntimeEvent.d.ts +25 -0
- package/dist/runtime/server/decorators/onRuntimeEvent.js +30 -0
- package/dist/runtime/server/decorators/onTick.d.ts +21 -0
- package/dist/runtime/server/decorators/onTick.js +26 -0
- package/dist/runtime/server/decorators/public.d.ts +26 -0
- package/dist/runtime/server/decorators/public.js +32 -0
- package/dist/runtime/server/decorators/requiresState.d.ts +63 -0
- package/dist/runtime/server/decorators/requiresState.js +70 -0
- package/dist/runtime/server/decorators/throttle.d.ts +56 -0
- package/dist/runtime/server/decorators/throttle.js +73 -0
- package/dist/runtime/server/decorators/utils.d.ts +54 -0
- package/dist/runtime/server/decorators/utils.js +54 -0
- package/dist/runtime/server/default/default-command-error-observer.d.ts +14 -0
- package/dist/runtime/server/default/default-command-error-observer.js +40 -0
- package/dist/runtime/server/default/default-net-event-security-observer.d.ts +15 -0
- package/dist/runtime/server/default/default-net-event-security-observer.js +25 -0
- package/dist/runtime/server/default/default-principal.provider.d.ts +13 -0
- package/dist/runtime/server/default/default-principal.provider.js +35 -0
- package/dist/runtime/server/default/default-security.handler.d.ts +19 -0
- package/dist/runtime/server/default/default-security.handler.js +36 -0
- package/dist/runtime/server/devmode/contracts/IDevModeBridge.d.ts +36 -0
- package/dist/runtime/server/devmode/contracts/IDevModeBridge.js +8 -0
- package/dist/runtime/server/devmode/contracts/IDevModeInspector.d.ts +52 -0
- package/dist/runtime/server/devmode/contracts/IDevModeInspector.js +8 -0
- package/dist/runtime/server/devmode/contracts/IDevModeInterceptor.d.ts +41 -0
- package/dist/runtime/server/devmode/contracts/IDevModeInterceptor.js +7 -0
- package/dist/runtime/server/devmode/contracts/index.d.ts +3 -0
- package/dist/runtime/server/devmode/contracts/index.js +3 -0
- package/dist/runtime/server/devmode/dev-mode.service.d.ts +109 -0
- package/dist/runtime/server/devmode/dev-mode.service.js +290 -0
- package/dist/runtime/server/devmode/event-interceptor.service.d.ts +80 -0
- package/dist/runtime/server/devmode/event-interceptor.service.js +233 -0
- package/dist/runtime/server/devmode/index.d.ts +6 -0
- package/dist/runtime/server/devmode/index.js +7 -0
- package/dist/runtime/server/devmode/player-simulator.service.d.ts +66 -0
- package/dist/runtime/server/devmode/player-simulator.service.js +199 -0
- package/dist/runtime/server/devmode/state-inspector.service.d.ts +57 -0
- package/dist/runtime/server/devmode/state-inspector.service.js +175 -0
- package/dist/runtime/server/devmode/types.d.ts +197 -0
- package/dist/runtime/server/devmode/types.js +22 -0
- package/dist/runtime/server/entities/index.d.ts +3 -0
- package/dist/runtime/server/entities/index.js +3 -0
- package/dist/runtime/server/entities/npc.d.ts +255 -0
- package/dist/runtime/server/entities/npc.js +307 -0
- package/dist/runtime/server/entities/player.d.ts +239 -0
- package/dist/runtime/server/entities/player.js +340 -0
- package/dist/runtime/server/entities/vehicle.d.ts +113 -0
- package/dist/runtime/server/entities/vehicle.js +245 -0
- package/dist/runtime/server/error-handler.d.ts +2 -0
- package/dist/runtime/server/error-handler.js +39 -0
- package/dist/runtime/server/helpers/command-validation.helper.d.ts +3 -0
- package/dist/runtime/server/helpers/command-validation.helper.js +73 -0
- package/dist/runtime/server/helpers/function-helper.d.ts +6 -0
- package/dist/runtime/server/helpers/function-helper.js +28 -0
- package/dist/runtime/server/helpers/normalize-app-error.d.ts +9 -0
- package/dist/runtime/server/helpers/normalize-app-error.js +17 -0
- package/dist/runtime/server/helpers/process-tuple-schema.d.ts +20 -0
- package/dist/runtime/server/helpers/process-tuple-schema.js +56 -0
- package/dist/runtime/server/helpers/resolve-method.d.ts +5 -0
- package/dist/runtime/server/helpers/resolve-method.js +25 -0
- package/dist/runtime/server/implementations/local/channel.local.d.ts +32 -0
- package/dist/runtime/server/implementations/local/channel.local.js +185 -0
- package/dist/runtime/server/implementations/local/command.local.d.ts +57 -0
- package/dist/runtime/server/implementations/local/command.local.js +110 -0
- package/dist/runtime/server/implementations/local/player.local.d.ts +110 -0
- package/dist/runtime/server/implementations/local/player.local.js +204 -0
- package/dist/runtime/server/implementations/local/principal.local.d.ts +28 -0
- package/dist/runtime/server/implementations/local/principal.local.js +120 -0
- package/dist/runtime/server/implementations/remote/channel.remote.d.ts +47 -0
- package/dist/runtime/server/implementations/remote/channel.remote.js +165 -0
- package/dist/runtime/server/implementations/remote/command.remote.d.ts +64 -0
- package/dist/runtime/server/implementations/remote/command.remote.js +154 -0
- package/dist/runtime/server/implementations/remote/player.remote.d.ts +65 -0
- package/dist/runtime/server/implementations/remote/player.remote.js +204 -0
- package/dist/runtime/server/implementations/remote/principal.remote.d.ts +33 -0
- package/dist/runtime/server/implementations/remote/principal.remote.js +97 -0
- package/dist/runtime/server/index.d.ts +9 -0
- package/dist/runtime/server/index.js +4 -0
- package/dist/runtime/server/library/create-server-library.d.ts +13 -0
- package/dist/runtime/server/library/create-server-library.js +48 -0
- package/dist/runtime/server/library/index.d.ts +4 -0
- package/dist/runtime/server/library/index.js +2 -0
- package/dist/runtime/server/library/plugin/index.d.ts +4 -0
- package/dist/runtime/server/library/plugin/index.js +4 -0
- package/dist/runtime/server/library/plugin/plugin-context.d.ts +10 -0
- package/dist/runtime/server/library/plugin/plugin-context.js +0 -0
- package/dist/runtime/server/library/plugin/plugin-registry.d.ts +7 -0
- package/dist/runtime/server/library/plugin/plugin-registry.js +25 -0
- package/dist/runtime/server/library/plugin/plugin.interface.d.ts +19 -0
- package/dist/runtime/server/library/plugin/plugin.interface.js +0 -0
- package/dist/runtime/server/library/plugin/server-plugin-api.d.ts +5 -0
- package/dist/runtime/server/library/plugin/server-plugin-api.js +0 -0
- package/dist/runtime/server/ports/authorization.api-port.d.ts +149 -0
- package/dist/runtime/server/ports/authorization.api-port.js +28 -0
- package/dist/runtime/server/ports/channel.api-port.d.ts +218 -0
- package/dist/runtime/server/ports/channel.api-port.js +2 -0
- package/dist/runtime/server/ports/internal/command-execution.port.d.ts +48 -0
- package/dist/runtime/server/ports/internal/command-execution.port.js +11 -0
- package/dist/runtime/server/ports/internal/player-session-lifecycle.port.d.ts +37 -0
- package/dist/runtime/server/ports/internal/player-session-lifecycle.port.js +12 -0
- package/dist/runtime/server/ports/players.api-port.d.ts +108 -0
- package/dist/runtime/server/ports/players.api-port.js +19 -0
- package/dist/runtime/server/runtime.d.ts +192 -0
- package/dist/runtime/server/runtime.js +211 -0
- package/dist/runtime/server/server.runtime.d.ts +7 -0
- package/dist/runtime/server/server.runtime.js +34 -0
- package/dist/runtime/server/services/appearance.service.d.ts +99 -0
- package/dist/runtime/server/services/appearance.service.js +307 -0
- package/dist/runtime/server/services/index.d.ts +6 -0
- package/dist/runtime/server/services/index.js +6 -0
- package/dist/runtime/server/services/parallel/native-worker.entry.d.ts +1 -0
- package/dist/runtime/server/services/parallel/native-worker.entry.js +10 -0
- package/dist/runtime/server/services/parallel/worker-pool.d.ts +79 -0
- package/dist/runtime/server/services/parallel/worker-pool.js +428 -0
- package/dist/runtime/server/services/parallel/worker.d.ts +22 -0
- package/dist/runtime/server/services/parallel/worker.js +48 -0
- package/dist/runtime/server/services/persistence.service.d.ts +59 -0
- package/dist/runtime/server/services/persistence.service.js +161 -0
- package/dist/runtime/server/services/rate-limiter.service.d.ts +23 -0
- package/dist/runtime/server/services/rate-limiter.service.js +52 -0
- package/dist/runtime/server/services/services.register.d.ts +11 -0
- package/dist/runtime/server/services/services.register.js +108 -0
- package/dist/runtime/server/services/session-recovery.local.d.ts +39 -0
- package/dist/runtime/server/services/session-recovery.local.js +108 -0
- package/dist/runtime/server/setup.d.ts +9 -0
- package/dist/runtime/server/setup.js +25 -0
- package/dist/runtime/server/system/managers/binary-process.manager.d.ts +19 -0
- package/dist/runtime/server/system/managers/binary-process.manager.js +312 -0
- package/dist/runtime/server/system/metadata-server.keys.d.ts +18 -0
- package/dist/runtime/server/system/metadata-server.keys.js +18 -0
- package/dist/runtime/server/system/processors/command.processor.d.ts +16 -0
- package/dist/runtime/server/system/processors/command.processor.js +62 -0
- package/dist/runtime/server/system/processors/export.processor.d.ts +10 -0
- package/dist/runtime/server/system/processors/export.processor.js +38 -0
- package/dist/runtime/server/system/processors/internalEvent.processor.d.ts +7 -0
- package/dist/runtime/server/system/processors/internalEvent.processor.js +36 -0
- package/dist/runtime/server/system/processors/libraryEvent.processor.d.ts +6 -0
- package/dist/runtime/server/system/processors/libraryEvent.processor.js +38 -0
- package/dist/runtime/server/system/processors/netEvent.processor.d.ts +23 -0
- package/dist/runtime/server/system/processors/netEvent.processor.js +243 -0
- package/dist/runtime/server/system/processors/onRpc.processor.d.ts +12 -0
- package/dist/runtime/server/system/processors/onRpc.processor.js +142 -0
- package/dist/runtime/server/system/processors/runtimeEvent.processor.d.ts +10 -0
- package/dist/runtime/server/system/processors/runtimeEvent.processor.js +48 -0
- package/dist/runtime/server/system/processors/tick.processor.d.ts +8 -0
- package/dist/runtime/server/system/processors/tick.processor.js +44 -0
- package/dist/runtime/server/system/processors.register.d.ts +2 -0
- package/dist/runtime/server/system/processors.register.js +43 -0
- package/dist/runtime/server/system/schema-generator.d.ts +2 -0
- package/dist/runtime/server/system/schema-generator.js +38 -0
- package/dist/runtime/server/types/channel.types.d.ts +44 -0
- package/dist/runtime/server/types/channel.types.js +10 -0
- package/dist/runtime/server/types/core-exports.types.d.ts +286 -0
- package/dist/runtime/server/types/core-exports.types.js +0 -0
- package/dist/runtime/server/types/framework-events.types.d.ts +22 -0
- package/dist/runtime/server/types/framework-events.types.js +0 -0
- package/dist/runtime/server/types/index.d.ts +9 -0
- package/dist/runtime/server/types/index.js +9 -0
- package/dist/runtime/server/types/linked-id.d.ts +6 -0
- package/dist/runtime/server/types/linked-id.js +0 -0
- package/dist/runtime/server/types/npc.types.d.ts +36 -0
- package/dist/runtime/server/types/npc.types.js +0 -0
- package/dist/runtime/server/types/parallel.types.d.ts +191 -0
- package/dist/runtime/server/types/parallel.types.js +5 -0
- package/dist/runtime/server/types/player-session.types.d.ts +11 -0
- package/dist/runtime/server/types/player-session.types.js +0 -0
- package/dist/runtime/server/types/principal.type.d.ts +32 -0
- package/dist/runtime/server/types/principal.type.js +0 -0
- package/dist/runtime/server/types/vehicle.types.d.ts +152 -0
- package/dist/runtime/server/types/vehicle.types.js +0 -0
- package/package.json +43 -36
- package/dist/client/client-bootstrap.d.ts +0 -1
- package/dist/client/client-bootstrap.js +0 -53
- package/dist/client/client-container.js +0 -6
- package/dist/client/client-core.d.ts +0 -18
- package/dist/client/client-core.js +0 -52
- package/dist/client/decorators/controller.d.ts +0 -3
- package/dist/client/decorators/controller.js +0 -14
- package/dist/client/decorators/export.d.ts +0 -7
- package/dist/client/decorators/export.js +0 -15
- package/dist/client/decorators/gameEvent.d.ts +0 -47
- package/dist/client/decorators/gameEvent.js +0 -54
- package/dist/client/decorators/index.d.ts +0 -10
- package/dist/client/decorators/index.js +0 -26
- package/dist/client/decorators/interval.d.ts +0 -7
- package/dist/client/decorators/interval.js +0 -15
- package/dist/client/decorators/key.d.ts +0 -2
- package/dist/client/decorators/key.js +0 -10
- package/dist/client/decorators/localEvent.d.ts +0 -7
- package/dist/client/decorators/localEvent.js +0 -15
- package/dist/client/decorators/nui.d.ts +0 -1
- package/dist/client/decorators/nui.js +0 -9
- package/dist/client/decorators/onNet.d.ts +0 -1
- package/dist/client/decorators/onNet.js +0 -9
- package/dist/client/decorators/resourceLifecycle.d.ts +0 -11
- package/dist/client/decorators/resourceLifecycle.js +0 -24
- package/dist/client/decorators/tick.d.ts +0 -1
- package/dist/client/decorators/tick.js +0 -9
- package/dist/client/index.d.ts +0 -6
- package/dist/client/index.js +0 -22
- package/dist/client/loaders/exports.loader.d.ts +0 -1
- package/dist/client/loaders/exports.loader.js +0 -13
- package/dist/client/player/player.d.ts +0 -262
- package/dist/client/player/player.js +0 -480
- package/dist/client/player/player.loader.js +0 -22
- package/dist/client/services/core/index.d.ts +0 -1
- package/dist/client/services/core/index.js +0 -17
- package/dist/client/services/core/spawn.service.d.ts +0 -20
- package/dist/client/services/core/spawn.service.js +0 -143
- package/dist/client/services/index.d.ts +0 -4
- package/dist/client/services/index.js +0 -24
- package/dist/client/services/streaming/index.d.ts +0 -1
- package/dist/client/services/streaming/index.js +0 -17
- package/dist/client/services/streaming/streaming.service.js +0 -341
- package/dist/client/services/ui/index.d.ts +0 -3
- package/dist/client/services/ui/index.js +0 -19
- package/dist/client/services/ui/notification.service.js +0 -111
- package/dist/client/services/ui/progress.service.js +0 -210
- package/dist/client/services/ui/textui.service.d.ts +0 -82
- package/dist/client/services/ui/textui.service.js +0 -156
- package/dist/client/services/world/blip.service.d.ts +0 -112
- package/dist/client/services/world/blip.service.js +0 -215
- package/dist/client/services/world/index.d.ts +0 -4
- package/dist/client/services/world/index.js +0 -20
- package/dist/client/services/world/marker.service.d.ts +0 -94
- package/dist/client/services/world/marker.service.js +0 -153
- package/dist/client/services/world/ped.service.d.ts +0 -182
- package/dist/client/services/world/ped.service.js +0 -302
- package/dist/client/services/world/vehicle.service.d.ts +0 -168
- package/dist/client/services/world/vehicle.service.js +0 -296
- package/dist/client/system/metadata-client.keys.d.ts +0 -13
- package/dist/client/system/metadata-client.keys.js +0 -16
- package/dist/client/system/processors/export.processor.d.ts +0 -7
- package/dist/client/system/processors/export.processor.js +0 -39
- package/dist/client/system/processors/gameEvent.processor.d.ts +0 -10
- package/dist/client/system/processors/gameEvent.processor.js +0 -58
- package/dist/client/system/processors/interval.processor.d.ts +0 -7
- package/dist/client/system/processors/interval.processor.js +0 -43
- package/dist/client/system/processors/key.processor.d.ts +0 -8
- package/dist/client/system/processors/key.processor.js +0 -27
- package/dist/client/system/processors/localEvent.processor.d.ts +0 -7
- package/dist/client/system/processors/localEvent.processor.js +0 -38
- package/dist/client/system/processors/netEvent.processor.d.ts +0 -7
- package/dist/client/system/processors/netEvent.processor.js +0 -38
- package/dist/client/system/processors/nui.processor.d.ts +0 -7
- package/dist/client/system/processors/nui.processor.js +0 -40
- package/dist/client/system/processors/resourceLifecycle.processor.d.ts +0 -9
- package/dist/client/system/processors/resourceLifecycle.processor.js +0 -69
- package/dist/client/system/processors/tick.processor.d.ts +0 -5
- package/dist/client/system/processors/tick.processor.js +0 -37
- package/dist/client/system/processors.register.js +0 -27
- package/dist/client/types/game-events.d.ts +0 -126
- package/dist/client/types/game-events.js +0 -83
- package/dist/client/types/index.js +0 -17
- package/dist/client/ui-bridge.js +0 -201
- package/dist/server/bootstrap.d.ts +0 -16
- package/dist/server/bootstrap.js +0 -57
- package/dist/server/bus/core-event-bus.d.ts +0 -6
- package/dist/server/bus/core-event-bus.js +0 -31
- package/dist/server/configs/api.config.d.ts +0 -71
- package/dist/server/configs/api.config.js +0 -81
- package/dist/server/configs/config.base.d.ts +0 -63
- package/dist/server/configs/config.base.js +0 -64
- package/dist/server/configs/index.d.ts +0 -2
- package/dist/server/configs/index.js +0 -18
- package/dist/server/container.d.ts +0 -2
- package/dist/server/container.js +0 -6
- package/dist/server/controllers/chat.controller.d.ts +0 -10
- package/dist/server/controllers/chat.controller.js +0 -50
- package/dist/server/controllers/command.controller.d.ts +0 -7
- package/dist/server/controllers/command.controller.js +0 -47
- package/dist/server/core.d.ts +0 -1
- package/dist/server/core.js +0 -7
- package/dist/server/database/adapters/oxmysql.adapter.d.ts +0 -89
- package/dist/server/database/adapters/oxmysql.adapter.js +0 -149
- package/dist/server/database/database.contract.d.ts +0 -128
- package/dist/server/database/database.contract.js +0 -29
- package/dist/server/database/database.service.d.ts +0 -216
- package/dist/server/database/database.service.js +0 -301
- package/dist/server/database/index.d.ts +0 -53
- package/dist/server/database/index.js +0 -70
- package/dist/server/database/types.d.ts +0 -67
- package/dist/server/database/types.js +0 -7
- package/dist/server/database.d.ts +0 -7
- package/dist/server/database.js +0 -23
- package/dist/server/decorators/bind.d.ts +0 -2
- package/dist/server/decorators/bind.js +0 -15
- package/dist/server/decorators/command.d.ts +0 -49
- package/dist/server/decorators/command.js +0 -23
- package/dist/server/decorators/controller.d.ts +0 -25
- package/dist/server/decorators/controller.js +0 -36
- package/dist/server/decorators/coreEvent.d.ts +0 -22
- package/dist/server/decorators/coreEvent.js +0 -29
- package/dist/server/decorators/export.d.ts +0 -39
- package/dist/server/decorators/export.js +0 -47
- package/dist/server/decorators/guard.d.ts +0 -56
- package/dist/server/decorators/guard.js +0 -82
- package/dist/server/decorators/index.d.ts +0 -10
- package/dist/server/decorators/index.js +0 -29
- package/dist/server/decorators/onNet.d.ts +0 -58
- package/dist/server/decorators/onNet.js +0 -57
- package/dist/server/decorators/onTick.d.ts +0 -32
- package/dist/server/decorators/onTick.js +0 -40
- package/dist/server/decorators/public.d.ts +0 -27
- package/dist/server/decorators/public.js +0 -36
- package/dist/server/decorators/requiresState.d.ts +0 -56
- package/dist/server/decorators/requiresState.js +0 -63
- package/dist/server/decorators/throttle.d.ts +0 -48
- package/dist/server/decorators/throttle.js +0 -63
- package/dist/server/decorators/utils.d.ts +0 -57
- package/dist/server/decorators/utils.js +0 -63
- package/dist/server/entities/index.d.ts +0 -1
- package/dist/server/entities/index.js +0 -17
- package/dist/server/entities/player.d.ts +0 -157
- package/dist/server/entities/player.js +0 -217
- package/dist/server/error-handler.d.ts +0 -2
- package/dist/server/error-handler.js +0 -43
- package/dist/server/index.d.ts +0 -10
- package/dist/server/index.js +0 -29
- package/dist/server/loaders/exports.loader.js +0 -23
- package/dist/server/loaders/playerSession.loader.d.ts +0 -1
- package/dist/server/loaders/playerSession.loader.js +0 -42
- package/dist/server/services/access-control.service.d.ts +0 -56
- package/dist/server/services/access-control.service.js +0 -99
- package/dist/server/services/chat.service.d.ts +0 -7
- package/dist/server/services/chat.service.js +0 -31
- package/dist/server/services/command.service.d.ts +0 -15
- package/dist/server/services/command.service.js +0 -77
- package/dist/server/services/config.service.d.ts +0 -75
- package/dist/server/services/config.service.js +0 -116
- package/dist/server/services/default/default-security.handler.d.ts +0 -6
- package/dist/server/services/default/default-security.handler.js +0 -26
- package/dist/server/services/http/http.service.d.ts +0 -50
- package/dist/server/services/http/http.service.js +0 -126
- package/dist/server/services/index.d.ts +0 -10
- package/dist/server/services/index.js +0 -26
- package/dist/server/services/parallel/index.d.ts +0 -49
- package/dist/server/services/parallel/index.js +0 -67
- package/dist/server/services/parallel/parallel-compute.service.d.ts +0 -132
- package/dist/server/services/parallel/parallel-compute.service.js +0 -449
- package/dist/server/services/parallel/types.d.ts +0 -188
- package/dist/server/services/parallel/types.js +0 -7
- package/dist/server/services/parallel/worker-pool.d.ts +0 -83
- package/dist/server/services/parallel/worker-pool.js +0 -350
- package/dist/server/services/parallel/worker.d.ts +0 -19
- package/dist/server/services/parallel/worker.js +0 -49
- package/dist/server/services/persistence.service.d.ts +0 -59
- package/dist/server/services/persistence.service.js +0 -166
- package/dist/server/services/player.service.d.ts +0 -96
- package/dist/server/services/player.service.js +0 -132
- package/dist/server/services/rate-limiter.service.d.ts +0 -5
- package/dist/server/services/rate-limiter.service.js +0 -39
- package/dist/server/services/registers.d.ts +0 -1
- package/dist/server/services/registers.js +0 -18
- package/dist/server/setup.d.ts +0 -9
- package/dist/server/setup.js +0 -28
- package/dist/server/system/metadata-server.keys.d.ts +0 -9
- package/dist/server/system/metadata-server.keys.js +0 -12
- package/dist/server/system/processors/command.processor.d.ts +0 -9
- package/dist/server/system/processors/command.processor.js +0 -30
- package/dist/server/system/processors/coreEvent.processor.d.ts +0 -7
- package/dist/server/system/processors/coreEvent.processor.js +0 -38
- package/dist/server/system/processors/export.processor.d.ts +0 -7
- package/dist/server/system/processors/export.processor.js +0 -26
- package/dist/server/system/processors/netEvent.processor.d.ts +0 -11
- package/dist/server/system/processors/netEvent.processor.js +0 -101
- package/dist/server/system/processors/tick.processor.d.ts +0 -5
- package/dist/server/system/processors/tick.processor.js +0 -36
- package/dist/server/system/processors.register.d.ts +0 -1
- package/dist/server/system/processors.register.js +0 -21
- package/dist/server/system/schema-generator.d.ts +0 -2
- package/dist/server/system/schema-generator.js +0 -28
- package/dist/server/templates/admin/admin.controller-template.d.ts +0 -12
- package/dist/server/templates/admin/admin.controller-template.js +0 -2
- package/dist/server/templates/auth/auth-provider.contract.d.ts +0 -58
- package/dist/server/templates/auth/auth-provider.contract.js +0 -23
- package/dist/server/templates/index.d.ts +0 -8
- package/dist/server/templates/index.js +0 -21
- package/dist/server/templates/persistence/index.d.ts +0 -30
- package/dist/server/templates/persistence/index.js +0 -34
- package/dist/server/templates/persistence/player-persistence.contract.d.ts +0 -86
- package/dist/server/templates/persistence/player-persistence.contract.js +0 -52
- package/dist/server/templates/repository/index.d.ts +0 -57
- package/dist/server/templates/repository/index.js +0 -61
- package/dist/server/templates/repository/repository.contract.d.ts +0 -224
- package/dist/server/templates/repository/repository.contract.js +0 -342
- package/dist/server/templates/repository/repository.types.d.ts +0 -51
- package/dist/server/templates/repository/repository.types.js +0 -7
- package/dist/server/templates/security/permission.types.d.ts +0 -32
- package/dist/server/templates/security/permission.types.js +0 -2
- package/dist/server/templates/security/principal-provider.contract.d.ts +0 -43
- package/dist/server/templates/security/principal-provider.contract.js +0 -19
- package/dist/server/templates/security/security-handler.contract.d.ts +0 -5
- package/dist/server/templates/security/security-handler.contract.js +0 -6
- package/dist/server/types/core-events.d.ts +0 -17
- package/dist/server/types/core-events.js +0 -2
- package/dist/server/types/security.types.js +0 -2
- package/dist/shared/index.d.ts +0 -1
- package/dist/shared/index.js +0 -17
- package/dist/shared/logger/core-logger.d.ts +0 -35
- package/dist/shared/logger/core-logger.js +0 -52
- package/dist/shared/logger/index.d.ts +0 -11
- package/dist/shared/logger/index.js +0 -26
- package/dist/shared/logger/logger.config.d.ts +0 -47
- package/dist/shared/logger/logger.config.js +0 -33
- package/dist/shared/logger/logger.service.d.ts +0 -161
- package/dist/shared/logger/logger.service.js +0 -279
- package/dist/shared/logger/logger.types.js +0 -74
- package/dist/shared/logger/transports/buffered.transport.d.ts +0 -88
- package/dist/shared/logger/transports/buffered.transport.js +0 -174
- package/dist/shared/logger/transports/console.transport.d.ts +0 -37
- package/dist/shared/logger/transports/console.transport.js +0 -134
- package/dist/shared/logger/transports/index.d.ts +0 -3
- package/dist/shared/logger/transports/index.js +0 -19
- package/dist/shared/logger/transports/transport.interface.d.ts +0 -40
- package/dist/shared/logger/transports/transport.interface.js +0 -2
- package/dist/system/class-constructor.js +0 -2
- package/dist/system/decorator-processor.js +0 -2
- package/dist/system/metadata.scanner.d.ts +0 -7
- package/dist/system/metadata.scanner.js +0 -45
- package/dist/utils/errors.d.ts +0 -14
- package/dist/utils/errors.js +0 -25
- package/dist/utils/index.d.ts +0 -4
- package/dist/utils/index.js +0 -20
- package/dist/utils/result.d.ts +0 -12
- package/dist/utils/result.js +0 -10
- package/dist/utils/rgb.d.ts +0 -5
- package/dist/utils/rgb.js +0 -2
- package/dist/utils/vector3.d.ts +0 -13
- package/dist/utils/vector3.js +0 -27
- /package/dist/{server/loaders/exports.loader.d.ts → adapters/contracts/transport/context.js} +0 -0
- /package/dist/{system → kernel/di}/class-constructor.d.ts +0 -0
- /package/dist/{system → kernel/di}/decorator-processor.d.ts +0 -0
- /package/dist/{server/types → kernel/error}/security.types.d.ts +0 -0
- /package/dist/{shared → kernel}/logger/logger.types.d.ts +0 -0
- /package/dist/{client → runtime/client}/client-container.d.ts +0 -0
- /package/dist/{client → runtime/client}/player/player.loader.d.ts +0 -0
- /package/dist/{client/services/ui → runtime/client/services}/notification.service.d.ts +0 -0
- /package/dist/{client/services/ui → runtime/client/services}/progress.service.d.ts +0 -0
- /package/dist/{client/services/streaming → runtime/client/services}/streaming.service.d.ts +0 -0
- /package/dist/{client → runtime/client}/system/processors.register.d.ts +0 -0
- /package/dist/{client → runtime/client}/types/index.d.ts +0 -0
- /package/dist/{client → runtime/client}/ui-bridge.d.ts +0 -0
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { Vector3 } from '../../../kernel';
|
|
2
|
+
import { ParallelComputeMetrics, ParallelTask, ParallelTaskOptions, TaskResult, WorkerPoolConfig } from '../types/parallel.types';
|
|
3
|
+
/**
|
|
4
|
+
* Service for managing parallel computation
|
|
5
|
+
*/
|
|
6
|
+
export declare class ParallelCompute {
|
|
7
|
+
private pool;
|
|
8
|
+
private metrics;
|
|
9
|
+
private totalExecutionTime;
|
|
10
|
+
private isInitialized;
|
|
11
|
+
private poolConfig;
|
|
12
|
+
/**
|
|
13
|
+
* Initialize the worker pool
|
|
14
|
+
* Must be called before using parallel execution
|
|
15
|
+
*/
|
|
16
|
+
initialize(config?: Partial<WorkerPoolConfig>): void;
|
|
17
|
+
/**
|
|
18
|
+
* Check if initialized
|
|
19
|
+
*/
|
|
20
|
+
get initialized(): boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Check if using native workers
|
|
23
|
+
*/
|
|
24
|
+
get isNative(): boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Shutdown the service and worker pool
|
|
27
|
+
*/
|
|
28
|
+
shutdown(): Promise<void>;
|
|
29
|
+
/**
|
|
30
|
+
* Get current metrics
|
|
31
|
+
*/
|
|
32
|
+
getMetrics(): ParallelComputeMetrics;
|
|
33
|
+
/**
|
|
34
|
+
* Get worker pool statistics
|
|
35
|
+
*/
|
|
36
|
+
getPoolStats(): {
|
|
37
|
+
totalWorkers: number;
|
|
38
|
+
idleWorkers: number;
|
|
39
|
+
busyWorkers: number;
|
|
40
|
+
queuedTasks: number;
|
|
41
|
+
isNative: boolean;
|
|
42
|
+
} | null;
|
|
43
|
+
/**
|
|
44
|
+
* Reset metrics
|
|
45
|
+
*/
|
|
46
|
+
resetMetrics(): void;
|
|
47
|
+
/**
|
|
48
|
+
* Execute a compute function with automatic mode selection
|
|
49
|
+
*/
|
|
50
|
+
run<TInput, TOutput>(options: ParallelTaskOptions<TInput, TOutput>, input: TInput): Promise<TaskResult<TOutput>>;
|
|
51
|
+
/**
|
|
52
|
+
* Execute synchronously on main thread
|
|
53
|
+
*/
|
|
54
|
+
sync<TInput, TOutput>(options: ParallelTaskOptions<TInput, TOutput>, input: TInput): TaskResult<TOutput>;
|
|
55
|
+
/**
|
|
56
|
+
* Execute on worker (async with yielding in FiveM)
|
|
57
|
+
*/
|
|
58
|
+
parallel<TInput, TOutput>(options: ParallelTaskOptions<TInput, TOutput>, input: TInput): Promise<TaskResult<TOutput>>;
|
|
59
|
+
/**
|
|
60
|
+
* Execute distributed across multiple workers
|
|
61
|
+
*/
|
|
62
|
+
distributed<TInput, TOutput>(options: ParallelTaskOptions<TInput, TOutput>, input: TInput, workerCount?: number): Promise<TaskResult<TOutput>>;
|
|
63
|
+
/**
|
|
64
|
+
* Update internal metrics
|
|
65
|
+
*/
|
|
66
|
+
private updateMetrics;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Get or create the global ParallelCompute service instance
|
|
70
|
+
*/
|
|
71
|
+
export declare function getParallelComputeService(): ParallelCompute;
|
|
72
|
+
/**
|
|
73
|
+
* Initialize the global ParallelCompute service
|
|
74
|
+
*/
|
|
75
|
+
export declare function initParallelCompute(config?: Partial<WorkerPoolConfig>): void;
|
|
76
|
+
/**
|
|
77
|
+
* Shutdown the global ParallelCompute service
|
|
78
|
+
*/
|
|
79
|
+
export declare function shutdownParallelCompute(): Promise<void>;
|
|
80
|
+
/**
|
|
81
|
+
* Define a parallel task with the given options
|
|
82
|
+
* Returns a task object with run, sync, parallel, and distributed methods
|
|
83
|
+
*/
|
|
84
|
+
export declare function defineTask<TInput, TOutput>(options: ParallelTaskOptions<TInput, TOutput>): ParallelTask<TInput, TOutput>;
|
|
85
|
+
/**
|
|
86
|
+
* Built-in task: Filter entities by distance from a position
|
|
87
|
+
*/
|
|
88
|
+
export declare const filterByDistance: ParallelTask<{
|
|
89
|
+
entities: Vector3[];
|
|
90
|
+
position: Vector3;
|
|
91
|
+
radius: number;
|
|
92
|
+
}, Vector3[]>;
|
|
93
|
+
/**
|
|
94
|
+
* Built-in task: Sort entities by distance from a position
|
|
95
|
+
*/
|
|
96
|
+
export declare const sortByDistance: ParallelTask<{
|
|
97
|
+
entities: Vector3[];
|
|
98
|
+
position: Vector3;
|
|
99
|
+
}, Vector3[]>;
|
|
100
|
+
/**
|
|
101
|
+
* Built-in task: Find closest entity to a position
|
|
102
|
+
*/
|
|
103
|
+
export declare const findClosest: ParallelTask<{
|
|
104
|
+
entities: Vector3[];
|
|
105
|
+
position: Vector3;
|
|
106
|
+
}, Vector3 | null>;
|
|
107
|
+
/**
|
|
108
|
+
* Built-in task: Batch transform items
|
|
109
|
+
*/
|
|
110
|
+
export declare function defineBatchTransform<T, R>(name: string, transform: (item: T) => R, threshold?: number): ParallelTask<T[], R[]>;
|
|
111
|
+
/**
|
|
112
|
+
* Built-in task: Batch filter items
|
|
113
|
+
*/
|
|
114
|
+
export declare function defineBatchFilter<T>(name: string, predicate: (item: T) => boolean, threshold?: number): ParallelTask<T[], T[]>;
|
|
115
|
+
/**
|
|
116
|
+
* Built-in task: Batch reduce items
|
|
117
|
+
*/
|
|
118
|
+
export declare function defineBatchReduce<T, R>(name: string, reducer: (acc: R, item: T) => R, initial: R, merger: (results: R[]) => R, threshold?: number): ParallelTask<T[], R>;
|
|
@@ -0,0 +1,423 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { injectable } from 'tsyringe';
|
|
8
|
+
import { v4 as uuid } from 'uuid';
|
|
9
|
+
import { WorkerPool } from '../services/parallel/worker-pool';
|
|
10
|
+
const DEFAULT_WORKER_THRESHOLD = 10000;
|
|
11
|
+
/**
|
|
12
|
+
* Service for managing parallel computation
|
|
13
|
+
*/
|
|
14
|
+
let ParallelCompute = class ParallelCompute {
|
|
15
|
+
pool = null;
|
|
16
|
+
metrics = {
|
|
17
|
+
totalTasks: 0,
|
|
18
|
+
syncTasks: 0,
|
|
19
|
+
parallelTasks: 0,
|
|
20
|
+
failedTasks: 0,
|
|
21
|
+
avgExecutionTime: 0,
|
|
22
|
+
estimatedTimeSaved: 0,
|
|
23
|
+
activeWorkers: 0,
|
|
24
|
+
peakWorkers: 0,
|
|
25
|
+
};
|
|
26
|
+
totalExecutionTime = 0;
|
|
27
|
+
isInitialized = false;
|
|
28
|
+
poolConfig = {};
|
|
29
|
+
/**
|
|
30
|
+
* Initialize the worker pool
|
|
31
|
+
* Must be called before using parallel execution
|
|
32
|
+
*/
|
|
33
|
+
initialize(config = {}) {
|
|
34
|
+
if (this.isInitialized)
|
|
35
|
+
return;
|
|
36
|
+
this.poolConfig = config;
|
|
37
|
+
this.pool = new WorkerPool(config);
|
|
38
|
+
this.pool.on('taskCompleted', (data) => {
|
|
39
|
+
const { executionTime } = data;
|
|
40
|
+
this.updateMetrics(executionTime, 'parallel');
|
|
41
|
+
});
|
|
42
|
+
this.pool.on('workerSpawned', () => {
|
|
43
|
+
const stats = this.pool?.getStats();
|
|
44
|
+
if (stats) {
|
|
45
|
+
this.metrics.activeWorkers = stats.totalWorkers;
|
|
46
|
+
this.metrics.peakWorkers = Math.max(this.metrics.peakWorkers, stats.totalWorkers);
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
this.pool.on('workerExit', () => {
|
|
50
|
+
const stats = this.pool?.getStats();
|
|
51
|
+
if (stats) {
|
|
52
|
+
this.metrics.activeWorkers = stats.totalWorkers;
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
this.isInitialized = true;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Check if initialized
|
|
59
|
+
*/
|
|
60
|
+
get initialized() {
|
|
61
|
+
return this.isInitialized;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Check if using native workers
|
|
65
|
+
*/
|
|
66
|
+
get isNative() {
|
|
67
|
+
return this.pool?.isNative ?? false;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Shutdown the service and worker pool
|
|
71
|
+
*/
|
|
72
|
+
async shutdown() {
|
|
73
|
+
if (this.pool) {
|
|
74
|
+
await this.pool.shutdown();
|
|
75
|
+
this.pool = null;
|
|
76
|
+
}
|
|
77
|
+
this.isInitialized = false;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Get current metrics
|
|
81
|
+
*/
|
|
82
|
+
getMetrics() {
|
|
83
|
+
return { ...this.metrics };
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Get worker pool statistics
|
|
87
|
+
*/
|
|
88
|
+
getPoolStats() {
|
|
89
|
+
return this.pool?.getStats() ?? null;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Reset metrics
|
|
93
|
+
*/
|
|
94
|
+
resetMetrics() {
|
|
95
|
+
this.metrics = {
|
|
96
|
+
totalTasks: 0,
|
|
97
|
+
syncTasks: 0,
|
|
98
|
+
parallelTasks: 0,
|
|
99
|
+
failedTasks: 0,
|
|
100
|
+
avgExecutionTime: 0,
|
|
101
|
+
estimatedTimeSaved: 0,
|
|
102
|
+
activeWorkers: this.pool?.getStats().totalWorkers ?? 0,
|
|
103
|
+
peakWorkers: 0,
|
|
104
|
+
};
|
|
105
|
+
this.totalExecutionTime = 0;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Execute a compute function with automatic mode selection
|
|
109
|
+
*/
|
|
110
|
+
async run(options, input) {
|
|
111
|
+
const cost = options.estimateCost?.(input) ?? 0;
|
|
112
|
+
const threshold = options.workerThreshold ?? DEFAULT_WORKER_THRESHOLD;
|
|
113
|
+
if (cost > threshold && this.pool) {
|
|
114
|
+
return this.parallel(options, input);
|
|
115
|
+
}
|
|
116
|
+
return this.sync(options, input);
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Execute synchronously on main thread
|
|
120
|
+
*/
|
|
121
|
+
sync(options, input) {
|
|
122
|
+
const startTime = performance.now();
|
|
123
|
+
try {
|
|
124
|
+
const result = options.compute(input);
|
|
125
|
+
const executionTime = performance.now() - startTime;
|
|
126
|
+
this.updateMetrics(executionTime, 'sync');
|
|
127
|
+
return {
|
|
128
|
+
result,
|
|
129
|
+
executionTime,
|
|
130
|
+
mode: 'sync',
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
catch (error) {
|
|
134
|
+
this.metrics.failedTasks++;
|
|
135
|
+
throw error;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Execute on worker (async with yielding in FiveM)
|
|
140
|
+
*/
|
|
141
|
+
async parallel(options, input) {
|
|
142
|
+
if (!this.pool) {
|
|
143
|
+
// Fallback to sync if pool not initialized
|
|
144
|
+
return this.sync(options, input);
|
|
145
|
+
}
|
|
146
|
+
const startTime = performance.now();
|
|
147
|
+
try {
|
|
148
|
+
const message = {
|
|
149
|
+
id: uuid(),
|
|
150
|
+
taskName: options.name,
|
|
151
|
+
functionBody: options.compute.toString(),
|
|
152
|
+
input,
|
|
153
|
+
};
|
|
154
|
+
const result = (await this.pool.execute(message));
|
|
155
|
+
const executionTime = performance.now() - startTime;
|
|
156
|
+
return {
|
|
157
|
+
result,
|
|
158
|
+
executionTime,
|
|
159
|
+
mode: 'parallel',
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
catch (error) {
|
|
163
|
+
this.metrics.failedTasks++;
|
|
164
|
+
throw error;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Execute distributed across multiple workers
|
|
169
|
+
*/
|
|
170
|
+
async distributed(options, input, workerCount) {
|
|
171
|
+
if (!options.chunker || !options.merger) {
|
|
172
|
+
throw new Error('Distributed execution requires chunker and merger functions');
|
|
173
|
+
}
|
|
174
|
+
if (!this.pool) {
|
|
175
|
+
// Fallback to sync if pool not initialized
|
|
176
|
+
return this.sync(options, input);
|
|
177
|
+
}
|
|
178
|
+
const startTime = performance.now();
|
|
179
|
+
const actualWorkerCount = workerCount ?? this.poolConfig.maxWorkers ?? 4;
|
|
180
|
+
try {
|
|
181
|
+
const chunks = options.chunker(input, actualWorkerCount);
|
|
182
|
+
const results = await Promise.all(chunks.map(async (chunk) => {
|
|
183
|
+
const message = {
|
|
184
|
+
id: uuid(),
|
|
185
|
+
taskName: options.name,
|
|
186
|
+
functionBody: options.compute.toString(),
|
|
187
|
+
input: chunk,
|
|
188
|
+
};
|
|
189
|
+
return this.pool?.execute(message);
|
|
190
|
+
}));
|
|
191
|
+
const mergedResult = options.merger(results);
|
|
192
|
+
const executionTime = performance.now() - startTime;
|
|
193
|
+
this.updateMetrics(executionTime, 'distributed');
|
|
194
|
+
return {
|
|
195
|
+
result: mergedResult,
|
|
196
|
+
executionTime,
|
|
197
|
+
mode: 'distributed',
|
|
198
|
+
workerCount: chunks.length,
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
catch (error) {
|
|
202
|
+
this.metrics.failedTasks++;
|
|
203
|
+
throw error;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* Update internal metrics
|
|
208
|
+
*/
|
|
209
|
+
updateMetrics(executionTime, mode) {
|
|
210
|
+
this.metrics.totalTasks++;
|
|
211
|
+
this.totalExecutionTime += executionTime;
|
|
212
|
+
this.metrics.avgExecutionTime = this.totalExecutionTime / this.metrics.totalTasks;
|
|
213
|
+
if (mode === 'sync') {
|
|
214
|
+
this.metrics.syncTasks++;
|
|
215
|
+
}
|
|
216
|
+
else {
|
|
217
|
+
this.metrics.parallelTasks++;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
};
|
|
221
|
+
ParallelCompute = __decorate([
|
|
222
|
+
injectable()
|
|
223
|
+
], ParallelCompute);
|
|
224
|
+
export { ParallelCompute };
|
|
225
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
226
|
+
// Standalone Functions (no DI required)
|
|
227
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
228
|
+
let globalService = null;
|
|
229
|
+
/**
|
|
230
|
+
* Get or create the global ParallelCompute service instance
|
|
231
|
+
*/
|
|
232
|
+
export function getParallelComputeService() {
|
|
233
|
+
if (!globalService) {
|
|
234
|
+
globalService = new ParallelCompute();
|
|
235
|
+
}
|
|
236
|
+
return globalService;
|
|
237
|
+
}
|
|
238
|
+
/**
|
|
239
|
+
* Initialize the global ParallelCompute service
|
|
240
|
+
*/
|
|
241
|
+
export function initParallelCompute(config = {}) {
|
|
242
|
+
const service = getParallelComputeService();
|
|
243
|
+
service.initialize(config);
|
|
244
|
+
}
|
|
245
|
+
/**
|
|
246
|
+
* Shutdown the global ParallelCompute service
|
|
247
|
+
*/
|
|
248
|
+
export async function shutdownParallelCompute() {
|
|
249
|
+
if (globalService) {
|
|
250
|
+
await globalService.shutdown();
|
|
251
|
+
globalService = null;
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
/**
|
|
255
|
+
* Define a parallel task with the given options
|
|
256
|
+
* Returns a task object with run, sync, parallel, and distributed methods
|
|
257
|
+
*/
|
|
258
|
+
export function defineTask(options) {
|
|
259
|
+
const service = getParallelComputeService();
|
|
260
|
+
return {
|
|
261
|
+
name: options.name,
|
|
262
|
+
options,
|
|
263
|
+
async run(input) {
|
|
264
|
+
const result = await service.run(options, input);
|
|
265
|
+
return result.result;
|
|
266
|
+
},
|
|
267
|
+
sync(input) {
|
|
268
|
+
const result = service.sync(options, input);
|
|
269
|
+
return result.result;
|
|
270
|
+
},
|
|
271
|
+
async parallel(input) {
|
|
272
|
+
const result = await service.parallel(options, input);
|
|
273
|
+
return result.result;
|
|
274
|
+
},
|
|
275
|
+
async distributed(input, workerCount) {
|
|
276
|
+
const result = await service.distributed(options, input, workerCount);
|
|
277
|
+
return result.result;
|
|
278
|
+
},
|
|
279
|
+
};
|
|
280
|
+
}
|
|
281
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
282
|
+
// Built-in Tasks
|
|
283
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
284
|
+
/**
|
|
285
|
+
* Built-in task: Filter entities by distance from a position
|
|
286
|
+
*/
|
|
287
|
+
export const filterByDistance = defineTask({
|
|
288
|
+
name: 'filterByDistance',
|
|
289
|
+
estimateCost: (input) => input.entities.length,
|
|
290
|
+
workerThreshold: 1000,
|
|
291
|
+
compute: (input) => {
|
|
292
|
+
const { entities, position, radius } = input;
|
|
293
|
+
const radiusSquared = radius * radius;
|
|
294
|
+
return entities.filter((entity) => {
|
|
295
|
+
const dx = entity.x - position.x;
|
|
296
|
+
const dy = entity.y - position.y;
|
|
297
|
+
const dz = entity.z - position.z;
|
|
298
|
+
return dx * dx + dy * dy + dz * dz <= radiusSquared;
|
|
299
|
+
});
|
|
300
|
+
},
|
|
301
|
+
chunker: (input, workerCount) => {
|
|
302
|
+
const { entities, position, radius } = input;
|
|
303
|
+
const chunkSize = Math.ceil(entities.length / workerCount);
|
|
304
|
+
const chunks = [];
|
|
305
|
+
for (let i = 0; i < entities.length; i += chunkSize) {
|
|
306
|
+
chunks.push({
|
|
307
|
+
entities: entities.slice(i, i + chunkSize),
|
|
308
|
+
position,
|
|
309
|
+
radius,
|
|
310
|
+
});
|
|
311
|
+
}
|
|
312
|
+
return chunks;
|
|
313
|
+
},
|
|
314
|
+
merger: (results) => [].concat(...results),
|
|
315
|
+
});
|
|
316
|
+
/**
|
|
317
|
+
* Built-in task: Sort entities by distance from a position
|
|
318
|
+
*/
|
|
319
|
+
export const sortByDistance = defineTask({
|
|
320
|
+
name: 'sortByDistance',
|
|
321
|
+
estimateCost: (input) => input.entities.length * Math.log(input.entities.length),
|
|
322
|
+
workerThreshold: 500,
|
|
323
|
+
compute: (input) => {
|
|
324
|
+
const { entities, position } = input;
|
|
325
|
+
return [...entities].sort((a, b) => {
|
|
326
|
+
const dxA = a.x - position.x;
|
|
327
|
+
const dyA = a.y - position.y;
|
|
328
|
+
const dzA = a.z - position.z;
|
|
329
|
+
const distA = dxA * dxA + dyA * dyA + dzA * dzA;
|
|
330
|
+
const dxB = b.x - position.x;
|
|
331
|
+
const dyB = b.y - position.y;
|
|
332
|
+
const dzB = b.z - position.z;
|
|
333
|
+
const distB = dxB * dxB + dyB * dyB + dzB * dzB;
|
|
334
|
+
return distA - distB;
|
|
335
|
+
});
|
|
336
|
+
},
|
|
337
|
+
});
|
|
338
|
+
/**
|
|
339
|
+
* Built-in task: Find closest entity to a position
|
|
340
|
+
*/
|
|
341
|
+
export const findClosest = defineTask({
|
|
342
|
+
name: 'findClosest',
|
|
343
|
+
estimateCost: (input) => input.entities.length,
|
|
344
|
+
workerThreshold: 5000,
|
|
345
|
+
compute: (input) => {
|
|
346
|
+
const { entities, position } = input;
|
|
347
|
+
if (entities.length === 0)
|
|
348
|
+
return null;
|
|
349
|
+
let closest = entities[0];
|
|
350
|
+
let minDistSquared = Infinity;
|
|
351
|
+
for (const entity of entities) {
|
|
352
|
+
const dx = entity.x - position.x;
|
|
353
|
+
const dy = entity.y - position.y;
|
|
354
|
+
const dz = entity.z - position.z;
|
|
355
|
+
const distSquared = dx * dx + dy * dy + dz * dz;
|
|
356
|
+
if (distSquared < minDistSquared) {
|
|
357
|
+
minDistSquared = distSquared;
|
|
358
|
+
closest = entity;
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
return closest;
|
|
362
|
+
},
|
|
363
|
+
});
|
|
364
|
+
/**
|
|
365
|
+
* Built-in task: Batch transform items
|
|
366
|
+
*/
|
|
367
|
+
export function defineBatchTransform(name, transform, threshold = 1000) {
|
|
368
|
+
return defineTask({
|
|
369
|
+
name,
|
|
370
|
+
estimateCost: (input) => input.length,
|
|
371
|
+
workerThreshold: threshold,
|
|
372
|
+
compute: (input) => input.map(transform),
|
|
373
|
+
chunker: (input, workerCount) => {
|
|
374
|
+
const chunkSize = Math.ceil(input.length / workerCount);
|
|
375
|
+
const chunks = [];
|
|
376
|
+
for (let i = 0; i < input.length; i += chunkSize) {
|
|
377
|
+
chunks.push(input.slice(i, i + chunkSize));
|
|
378
|
+
}
|
|
379
|
+
return chunks;
|
|
380
|
+
},
|
|
381
|
+
merger: (results) => [].concat(...results),
|
|
382
|
+
});
|
|
383
|
+
}
|
|
384
|
+
/**
|
|
385
|
+
* Built-in task: Batch filter items
|
|
386
|
+
*/
|
|
387
|
+
export function defineBatchFilter(name, predicate, threshold = 1000) {
|
|
388
|
+
return defineTask({
|
|
389
|
+
name,
|
|
390
|
+
estimateCost: (input) => input.length,
|
|
391
|
+
workerThreshold: threshold,
|
|
392
|
+
compute: (input) => input.filter(predicate),
|
|
393
|
+
chunker: (input, workerCount) => {
|
|
394
|
+
const chunkSize = Math.ceil(input.length / workerCount);
|
|
395
|
+
const chunks = [];
|
|
396
|
+
for (let i = 0; i < input.length; i += chunkSize) {
|
|
397
|
+
chunks.push(input.slice(i, i + chunkSize));
|
|
398
|
+
}
|
|
399
|
+
return chunks;
|
|
400
|
+
},
|
|
401
|
+
merger: (results) => [].concat(...results),
|
|
402
|
+
});
|
|
403
|
+
}
|
|
404
|
+
/**
|
|
405
|
+
* Built-in task: Batch reduce items
|
|
406
|
+
*/
|
|
407
|
+
export function defineBatchReduce(name, reducer, initial, merger, threshold = 1000) {
|
|
408
|
+
return defineTask({
|
|
409
|
+
name,
|
|
410
|
+
estimateCost: (input) => input.length,
|
|
411
|
+
workerThreshold: threshold,
|
|
412
|
+
compute: (input) => input.reduce(reducer, initial),
|
|
413
|
+
chunker: (input, workerCount) => {
|
|
414
|
+
const chunkSize = Math.ceil(input.length / workerCount);
|
|
415
|
+
const chunks = [];
|
|
416
|
+
for (let i = 0; i < input.length; i += chunkSize) {
|
|
417
|
+
chunks.push(input.slice(i, i + chunkSize));
|
|
418
|
+
}
|
|
419
|
+
return chunks;
|
|
420
|
+
},
|
|
421
|
+
merger,
|
|
422
|
+
});
|
|
423
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { VehicleModificationOptions, VehicleMods } from '../types/vehicle.types';
|
|
2
|
+
import { Vehicles } from './vehicles.api';
|
|
3
|
+
/**
|
|
4
|
+
* Service for handling vehicle modifications with validation.
|
|
5
|
+
*
|
|
6
|
+
* This service is separated from VehicleService to maintain single responsibility.
|
|
7
|
+
* All modifications are validated server-side before being applied.
|
|
8
|
+
*
|
|
9
|
+
* Security features:
|
|
10
|
+
* - Ownership validation
|
|
11
|
+
* - Proximity checks
|
|
12
|
+
* - Modification limits
|
|
13
|
+
* - Audit logging
|
|
14
|
+
*/
|
|
15
|
+
export declare class VehicleModification {
|
|
16
|
+
private readonly vehicleService;
|
|
17
|
+
constructor(vehicleService: Vehicles);
|
|
18
|
+
/**
|
|
19
|
+
* Applies modifications to a vehicle with validation.
|
|
20
|
+
*
|
|
21
|
+
* @param options - Modification options
|
|
22
|
+
* @returns Success status
|
|
23
|
+
*/
|
|
24
|
+
applyModifications(options: VehicleModificationOptions): boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Sets vehicle colors with validation.
|
|
27
|
+
*
|
|
28
|
+
* @param networkId - Network ID of the vehicle
|
|
29
|
+
* @param primaryColor - Primary color ID
|
|
30
|
+
* @param secondaryColor - Secondary color ID
|
|
31
|
+
* @param requestedBy - Client ID requesting the change
|
|
32
|
+
* @returns Success status
|
|
33
|
+
*/
|
|
34
|
+
setColors(networkId: number, primaryColor: number, secondaryColor: number, requestedBy?: number): boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Sets vehicle livery with validation.
|
|
37
|
+
*
|
|
38
|
+
* @param networkId - Network ID of the vehicle
|
|
39
|
+
* @param livery - Livery index
|
|
40
|
+
* @param requestedBy - Client ID requesting the change
|
|
41
|
+
* @returns Success status
|
|
42
|
+
*/
|
|
43
|
+
setLivery(networkId: number, livery: number, requestedBy?: number): boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Toggles vehicle turbo with validation.
|
|
46
|
+
*
|
|
47
|
+
* @param networkId - Network ID of the vehicle
|
|
48
|
+
* @param enabled - Whether turbo should be enabled
|
|
49
|
+
* @param requestedBy - Client ID requesting the change
|
|
50
|
+
* @returns Success status
|
|
51
|
+
*/
|
|
52
|
+
setTurbo(networkId: number, enabled: boolean, requestedBy?: number): boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Sets vehicle window tint with validation.
|
|
55
|
+
*
|
|
56
|
+
* @param networkId - Network ID of the vehicle
|
|
57
|
+
* @param tint - Tint level (0-6)
|
|
58
|
+
* @param requestedBy - Client ID requesting the change
|
|
59
|
+
* @returns Success status
|
|
60
|
+
*/
|
|
61
|
+
setWindowTint(networkId: number, tint: number, requestedBy?: number): boolean;
|
|
62
|
+
/**
|
|
63
|
+
* Sets vehicle neon lights with validation.
|
|
64
|
+
*
|
|
65
|
+
* @param networkId - Network ID of the vehicle
|
|
66
|
+
* @param enabled - Array of [left, right, front, back] enabled states
|
|
67
|
+
* @param color - RGB color array
|
|
68
|
+
* @param requestedBy - Client ID requesting the change
|
|
69
|
+
* @returns Success status
|
|
70
|
+
*/
|
|
71
|
+
setNeon(networkId: number, enabled: [boolean, boolean, boolean, boolean], color?: [number, number, number], requestedBy?: number): boolean;
|
|
72
|
+
/**
|
|
73
|
+
* Resets all modifications on a vehicle.
|
|
74
|
+
*
|
|
75
|
+
* @param networkId - Network ID of the vehicle
|
|
76
|
+
* @param requestedBy - Client ID requesting the reset
|
|
77
|
+
* @returns Success status
|
|
78
|
+
*/
|
|
79
|
+
resetModifications(networkId: number, requestedBy?: number): boolean;
|
|
80
|
+
/**
|
|
81
|
+
* Gets the current modifications of a vehicle.
|
|
82
|
+
*
|
|
83
|
+
* @param networkId - Network ID of the vehicle
|
|
84
|
+
* @returns Vehicle mods or undefined
|
|
85
|
+
*/
|
|
86
|
+
getModifications(networkId: number): VehicleMods | undefined;
|
|
87
|
+
/**
|
|
88
|
+
* Validates modification values to prevent exploits.
|
|
89
|
+
*
|
|
90
|
+
* @param mods - Modifications to validate
|
|
91
|
+
* @returns Validated modifications
|
|
92
|
+
*/
|
|
93
|
+
private validateMods;
|
|
94
|
+
}
|