@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,78 @@
|
|
|
1
|
+
import z from 'zod';
|
|
2
|
+
import { Player } from '../entities';
|
|
3
|
+
/**
|
|
4
|
+
* Metadata stored by {@link OnRPC}.
|
|
5
|
+
*
|
|
6
|
+
* @remarks
|
|
7
|
+
* The framework reads this metadata through {@link OnRpcProcessor} and registers
|
|
8
|
+
* the handler into the active {@link RpcAPI} transport.
|
|
9
|
+
*/
|
|
10
|
+
export type RpcHandlerOptions = {
|
|
11
|
+
/** RPC event name */
|
|
12
|
+
eventName: string;
|
|
13
|
+
/** Optional Zod schema used to validate incoming args */
|
|
14
|
+
schema?: z.ZodType;
|
|
15
|
+
/** Runtime reflection metadata from TypeScript (design:paramtypes) */
|
|
16
|
+
paramTypes?: unknown[];
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Server-side RPC handler signature.
|
|
20
|
+
*
|
|
21
|
+
* @remarks
|
|
22
|
+
* You may declare the first parameter as {@link Player} if you need session
|
|
23
|
+
* context in the handler. You can also declare no parameters at all.
|
|
24
|
+
*/
|
|
25
|
+
type ServerNetHandlerRPC<TArgs extends any[] = any[]> = ((player: Player, ...args: TArgs) => Promise<any>) | (() => Promise<any>);
|
|
26
|
+
type RpcHandlerSignatureError = '❌ @OnRPC handlers must be async and return a Promise';
|
|
27
|
+
type EnsureValidRpcHandler<T> = T extends (...args: any[]) => Promise<any> ? T : RpcHandlerSignatureError;
|
|
28
|
+
/**
|
|
29
|
+
* Register an RPC handler.
|
|
30
|
+
*
|
|
31
|
+
* @remarks
|
|
32
|
+
* Server-only decorator.
|
|
33
|
+
*
|
|
34
|
+
* - Server: the handler can be called by clients.
|
|
35
|
+
* - Client: use `Client.OnRPC()` (client runtime) instead.
|
|
36
|
+
*
|
|
37
|
+
* This decorator only registers metadata. The actual wiring happens inside
|
|
38
|
+
* {@link OnRpcProcessor} (server runtime).
|
|
39
|
+
*
|
|
40
|
+
* ## Signature options
|
|
41
|
+
* - Empty handler: `()`
|
|
42
|
+
* - With player context: `(player: Player, ...args)`
|
|
43
|
+
*
|
|
44
|
+
* If arguments are declared, the first must be {@link Player}. Remaining args
|
|
45
|
+
* come from the RPC payload.
|
|
46
|
+
*
|
|
47
|
+
* ## Validation
|
|
48
|
+
* You should provide a Zod schema whenever args are not trivially serializable.
|
|
49
|
+
* If schema is omitted, the framework may attempt to auto-generate one from
|
|
50
|
+
* reflected types.
|
|
51
|
+
*
|
|
52
|
+
* - Tuple schema: use when the RPC sends multiple positional arguments.
|
|
53
|
+
* - Object schema: use when the RPC sends a single DTO.
|
|
54
|
+
*
|
|
55
|
+
* ## Security
|
|
56
|
+
* Unless the method is marked with `@Public()`, the framework will block the
|
|
57
|
+
* request if the player is not authenticated (no `accountID`).
|
|
58
|
+
*
|
|
59
|
+
* @example Tuple args
|
|
60
|
+
* ```ts
|
|
61
|
+
* @OnRPC('inventory:get', z.tuple([z.string(), z.number().int()]))
|
|
62
|
+
* async getInventory(player: Player, itemType: string, page: number) {
|
|
63
|
+
* ...
|
|
64
|
+
* }
|
|
65
|
+
* ```
|
|
66
|
+
*
|
|
67
|
+
* @example Single DTO arg
|
|
68
|
+
* ```ts
|
|
69
|
+
* const CreateVehicleDto = z.object({ model: z.string(), color: z.string() })
|
|
70
|
+
*
|
|
71
|
+
* @OnRPC('vehicles:create', CreateVehicleDto)
|
|
72
|
+
* async createVehicle(player: Player, dto: z.infer<typeof CreateVehicleDto>) {
|
|
73
|
+
* ...
|
|
74
|
+
* }
|
|
75
|
+
* ```
|
|
76
|
+
*/
|
|
77
|
+
export declare function OnRPC<TArgs extends any[]>(eventName: string, schemaOrOptions?: z.ZodType | Pick<RpcHandlerOptions, 'schema'>): <H extends EnsureValidRpcHandler<ServerNetHandlerRPC<TArgs>>>(target: any, propertyKey: string, _descriptor: TypedPropertyDescriptor<H>) => void;
|
|
78
|
+
export {};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import z from 'zod';
|
|
2
|
+
import { METADATA_KEYS } from '../system/metadata-server.keys';
|
|
3
|
+
/**
|
|
4
|
+
* Register an RPC handler.
|
|
5
|
+
*
|
|
6
|
+
* @remarks
|
|
7
|
+
* Server-only decorator.
|
|
8
|
+
*
|
|
9
|
+
* - Server: the handler can be called by clients.
|
|
10
|
+
* - Client: use `Client.OnRPC()` (client runtime) instead.
|
|
11
|
+
*
|
|
12
|
+
* This decorator only registers metadata. The actual wiring happens inside
|
|
13
|
+
* {@link OnRpcProcessor} (server runtime).
|
|
14
|
+
*
|
|
15
|
+
* ## Signature options
|
|
16
|
+
* - Empty handler: `()`
|
|
17
|
+
* - With player context: `(player: Player, ...args)`
|
|
18
|
+
*
|
|
19
|
+
* If arguments are declared, the first must be {@link Player}. Remaining args
|
|
20
|
+
* come from the RPC payload.
|
|
21
|
+
*
|
|
22
|
+
* ## Validation
|
|
23
|
+
* You should provide a Zod schema whenever args are not trivially serializable.
|
|
24
|
+
* If schema is omitted, the framework may attempt to auto-generate one from
|
|
25
|
+
* reflected types.
|
|
26
|
+
*
|
|
27
|
+
* - Tuple schema: use when the RPC sends multiple positional arguments.
|
|
28
|
+
* - Object schema: use when the RPC sends a single DTO.
|
|
29
|
+
*
|
|
30
|
+
* ## Security
|
|
31
|
+
* Unless the method is marked with `@Public()`, the framework will block the
|
|
32
|
+
* request if the player is not authenticated (no `accountID`).
|
|
33
|
+
*
|
|
34
|
+
* @example Tuple args
|
|
35
|
+
* ```ts
|
|
36
|
+
* @OnRPC('inventory:get', z.tuple([z.string(), z.number().int()]))
|
|
37
|
+
* async getInventory(player: Player, itemType: string, page: number) {
|
|
38
|
+
* ...
|
|
39
|
+
* }
|
|
40
|
+
* ```
|
|
41
|
+
*
|
|
42
|
+
* @example Single DTO arg
|
|
43
|
+
* ```ts
|
|
44
|
+
* const CreateVehicleDto = z.object({ model: z.string(), color: z.string() })
|
|
45
|
+
*
|
|
46
|
+
* @OnRPC('vehicles:create', CreateVehicleDto)
|
|
47
|
+
* async createVehicle(player: Player, dto: z.infer<typeof CreateVehicleDto>) {
|
|
48
|
+
* ...
|
|
49
|
+
* }
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
52
|
+
export function OnRPC(eventName, schemaOrOptions) {
|
|
53
|
+
return (target, propertyKey, _descriptor) => {
|
|
54
|
+
const paramTypes = Reflect.getMetadata('design:paramtypes', target, propertyKey);
|
|
55
|
+
const schema = schemaOrOptions instanceof z.ZodType ? schemaOrOptions : schemaOrOptions?.schema;
|
|
56
|
+
const metadata = { eventName, schema, paramTypes };
|
|
57
|
+
Reflect.defineMetadata(METADATA_KEYS.NET_RPC, metadata, target, propertyKey);
|
|
58
|
+
};
|
|
59
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Registers a method as a server-side listener for a native Runtime event.
|
|
3
|
+
* Runtime === CitizenFX (Cfx)
|
|
4
|
+
*
|
|
5
|
+
* @remarks
|
|
6
|
+
* This decorator only stores metadata. During bootstrap, the framework scans controller
|
|
7
|
+
* methods and binds handlers to runtime events.
|
|
8
|
+
*
|
|
9
|
+
* CitizenFX server event reference:
|
|
10
|
+
* https://docs.fivem.net/docs/scripting-reference/events/server-events/
|
|
11
|
+
*
|
|
12
|
+
* @param event - event name (e.g. `"playerJoining"`). Runtime events
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```ts
|
|
16
|
+
* @Server.Controller()
|
|
17
|
+
* export class SessionController {
|
|
18
|
+
* @Server.OnRuntimeEvent('playerJoining')
|
|
19
|
+
* onPlayerJoining() {
|
|
20
|
+
* // ...
|
|
21
|
+
* }
|
|
22
|
+
* }
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
export declare function OnRuntimeEvent(event: string): (target: any, propertyKey: string) => void;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { METADATA_KEYS } from '../system/metadata-server.keys';
|
|
2
|
+
/**
|
|
3
|
+
* Registers a method as a server-side listener for a native Runtime event.
|
|
4
|
+
* Runtime === CitizenFX (Cfx)
|
|
5
|
+
*
|
|
6
|
+
* @remarks
|
|
7
|
+
* This decorator only stores metadata. During bootstrap, the framework scans controller
|
|
8
|
+
* methods and binds handlers to runtime events.
|
|
9
|
+
*
|
|
10
|
+
* CitizenFX server event reference:
|
|
11
|
+
* https://docs.fivem.net/docs/scripting-reference/events/server-events/
|
|
12
|
+
*
|
|
13
|
+
* @param event - event name (e.g. `"playerJoining"`). Runtime events
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```ts
|
|
17
|
+
* @Server.Controller()
|
|
18
|
+
* export class SessionController {
|
|
19
|
+
* @Server.OnRuntimeEvent('playerJoining')
|
|
20
|
+
* onPlayerJoining() {
|
|
21
|
+
* // ...
|
|
22
|
+
* }
|
|
23
|
+
* }
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
export function OnRuntimeEvent(event) {
|
|
27
|
+
return (target, propertyKey) => {
|
|
28
|
+
Reflect.defineMetadata(METADATA_KEYS.RUNTIME_EVENT, { event }, target, propertyKey);
|
|
29
|
+
};
|
|
30
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Registers a method to be executed on every server tick.
|
|
3
|
+
*
|
|
4
|
+
* @remarks
|
|
5
|
+
* This decorator only stores metadata. During bootstrap, the framework binds tick handlers to the
|
|
6
|
+
* FiveM tick cycle.
|
|
7
|
+
*
|
|
8
|
+
* Tick handlers should be lightweight and non-blocking.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```ts
|
|
12
|
+
* @Server.Controller()
|
|
13
|
+
* export class SyncController {
|
|
14
|
+
* @Server.OnTick()
|
|
15
|
+
* updatePlayers() {
|
|
16
|
+
* this.service.syncPositions()
|
|
17
|
+
* }
|
|
18
|
+
* }
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export declare function OnTick(): (target: any, propertyKey: string) => void;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { METADATA_KEYS } from '../system/metadata-server.keys';
|
|
2
|
+
/**
|
|
3
|
+
* Registers a method to be executed on every server tick.
|
|
4
|
+
*
|
|
5
|
+
* @remarks
|
|
6
|
+
* This decorator only stores metadata. During bootstrap, the framework binds tick handlers to the
|
|
7
|
+
* FiveM tick cycle.
|
|
8
|
+
*
|
|
9
|
+
* Tick handlers should be lightweight and non-blocking.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* @Server.Controller()
|
|
14
|
+
* export class SyncController {
|
|
15
|
+
* @Server.OnTick()
|
|
16
|
+
* updatePlayers() {
|
|
17
|
+
* this.service.syncPositions()
|
|
18
|
+
* }
|
|
19
|
+
* }
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
export function OnTick() {
|
|
23
|
+
return (target, propertyKey) => {
|
|
24
|
+
Reflect.defineMetadata(METADATA_KEYS.TICK, {}, target, propertyKey);
|
|
25
|
+
};
|
|
26
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Marks a server-side net-event handler as publicly accessible.
|
|
3
|
+
*
|
|
4
|
+
* @remarks
|
|
5
|
+
* This decorator disables authentication requirements for the decorated method.
|
|
6
|
+
* It is intended to be used together with {@link OnNet}.
|
|
7
|
+
*
|
|
8
|
+
* Security warning:
|
|
9
|
+
* - Use with caution.
|
|
10
|
+
* - Public endpoints should not mutate sensitive game state unless strictly necessary.
|
|
11
|
+
*
|
|
12
|
+
* @returns Method decorator that marks a handler as unauthenticated.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```ts
|
|
16
|
+
* @Server.Controller()
|
|
17
|
+
* export class AuthController {
|
|
18
|
+
* @Server.Public()
|
|
19
|
+
* @Server.OnNet('auth:login')
|
|
20
|
+
* async login(player: Server.Player, credentials: AuthCredentials) {
|
|
21
|
+
* // no authentication required for this event
|
|
22
|
+
* }
|
|
23
|
+
* }
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
export declare function Public(): (target: any, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { METADATA_KEYS } from '../system/metadata-server.keys';
|
|
2
|
+
/**
|
|
3
|
+
* Marks a server-side net-event handler as publicly accessible.
|
|
4
|
+
*
|
|
5
|
+
* @remarks
|
|
6
|
+
* This decorator disables authentication requirements for the decorated method.
|
|
7
|
+
* It is intended to be used together with {@link OnNet}.
|
|
8
|
+
*
|
|
9
|
+
* Security warning:
|
|
10
|
+
* - Use with caution.
|
|
11
|
+
* - Public endpoints should not mutate sensitive game state unless strictly necessary.
|
|
12
|
+
*
|
|
13
|
+
* @returns Method decorator that marks a handler as unauthenticated.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```ts
|
|
17
|
+
* @Server.Controller()
|
|
18
|
+
* export class AuthController {
|
|
19
|
+
* @Server.Public()
|
|
20
|
+
* @Server.OnNet('auth:login')
|
|
21
|
+
* async login(player: Server.Player, credentials: AuthCredentials) {
|
|
22
|
+
* // no authentication required for this event
|
|
23
|
+
* }
|
|
24
|
+
* }
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
export function Public() {
|
|
28
|
+
return (target, propertyKey, descriptor) => {
|
|
29
|
+
Reflect.defineMetadata(METADATA_KEYS.PUBLIC, true, target, propertyKey);
|
|
30
|
+
return descriptor;
|
|
31
|
+
};
|
|
32
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configuration options for state validation requirements.
|
|
3
|
+
* Defines the logical constraints (whitelist/blacklist) applied to the player's current state flags.
|
|
4
|
+
*/
|
|
5
|
+
export interface StateRequirement {
|
|
6
|
+
/**
|
|
7
|
+
* **Whitelist:** The player **MUST** possess ALL of these states to proceed.
|
|
8
|
+
* If the player is missing any one of these, the execution is blocked.
|
|
9
|
+
* @example ['on_duty', 'in_vehicle']
|
|
10
|
+
*/
|
|
11
|
+
has?: string[];
|
|
12
|
+
/**
|
|
13
|
+
* **Blacklist:** The player **MUST NOT** possess ANY of these states to proceed.
|
|
14
|
+
* If the player has any one of these, the execution is blocked.
|
|
15
|
+
* @example ['dead', 'cuffed', 'unconscious']
|
|
16
|
+
*/
|
|
17
|
+
missing?: string[];
|
|
18
|
+
/**
|
|
19
|
+
* A custom message to display to the client if validation fails.
|
|
20
|
+
* If omitted, a default generic message will be generated based on the missing/conflicting state.
|
|
21
|
+
*/
|
|
22
|
+
errorMessage?: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Enforces gameplay state requirements before executing a method.
|
|
26
|
+
*
|
|
27
|
+
* @remarks
|
|
28
|
+
* The decorator wraps the original method and verifies whether the player satisfies required
|
|
29
|
+
* state flags (e.g. `dead`, `cuffed`, `on_duty_police`).
|
|
30
|
+
*
|
|
31
|
+
* Rules:
|
|
32
|
+
* - The decorated method must receive a `Player` instance as its first argument.
|
|
33
|
+
*
|
|
34
|
+
* Validation:
|
|
35
|
+
* - `req.has`: the player must have *all* of these states.
|
|
36
|
+
* - `req.missing`: the player must have *none* of these states.
|
|
37
|
+
*
|
|
38
|
+
* @param req - State validation configuration.
|
|
39
|
+
*
|
|
40
|
+
* @throws Error - If the method is invoked without a `Player` as the first argument.
|
|
41
|
+
* @throws AppError - If the player does not satisfy the configured requirements.
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* ```ts
|
|
45
|
+
* @Server.Controller()
|
|
46
|
+
* export class InventoryController {
|
|
47
|
+
* @Server.RequiresState({ missing: ['dead', 'cuffed'] })
|
|
48
|
+
* openInventory(player: Player) {
|
|
49
|
+
* // ...
|
|
50
|
+
* }
|
|
51
|
+
*
|
|
52
|
+
* @Server.RequiresState({
|
|
53
|
+
* has: ['police_duty'],
|
|
54
|
+
* missing: ['dead'],
|
|
55
|
+
* errorMessage: 'You must be on duty to access the armory.',
|
|
56
|
+
* })
|
|
57
|
+
* openArmory(player: Player) {
|
|
58
|
+
* // ...
|
|
59
|
+
* }
|
|
60
|
+
* }
|
|
61
|
+
* ```
|
|
62
|
+
*/
|
|
63
|
+
export declare function RequiresState(req: StateRequirement): (target: any, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { AppError } from '../../../kernel/error/app.error';
|
|
2
|
+
import { METADATA_KEYS } from '../system/metadata-server.keys';
|
|
3
|
+
/**
|
|
4
|
+
* Enforces gameplay state requirements before executing a method.
|
|
5
|
+
*
|
|
6
|
+
* @remarks
|
|
7
|
+
* The decorator wraps the original method and verifies whether the player satisfies required
|
|
8
|
+
* state flags (e.g. `dead`, `cuffed`, `on_duty_police`).
|
|
9
|
+
*
|
|
10
|
+
* Rules:
|
|
11
|
+
* - The decorated method must receive a `Player` instance as its first argument.
|
|
12
|
+
*
|
|
13
|
+
* Validation:
|
|
14
|
+
* - `req.has`: the player must have *all* of these states.
|
|
15
|
+
* - `req.missing`: the player must have *none* of these states.
|
|
16
|
+
*
|
|
17
|
+
* @param req - State validation configuration.
|
|
18
|
+
*
|
|
19
|
+
* @throws Error - If the method is invoked without a `Player` as the first argument.
|
|
20
|
+
* @throws AppError - If the player does not satisfy the configured requirements.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```ts
|
|
24
|
+
* @Server.Controller()
|
|
25
|
+
* export class InventoryController {
|
|
26
|
+
* @Server.RequiresState({ missing: ['dead', 'cuffed'] })
|
|
27
|
+
* openInventory(player: Player) {
|
|
28
|
+
* // ...
|
|
29
|
+
* }
|
|
30
|
+
*
|
|
31
|
+
* @Server.RequiresState({
|
|
32
|
+
* has: ['police_duty'],
|
|
33
|
+
* missing: ['dead'],
|
|
34
|
+
* errorMessage: 'You must be on duty to access the armory.',
|
|
35
|
+
* })
|
|
36
|
+
* openArmory(player: Player) {
|
|
37
|
+
* // ...
|
|
38
|
+
* }
|
|
39
|
+
* }
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
export function RequiresState(req) {
|
|
43
|
+
return (target, propertyKey, descriptor) => {
|
|
44
|
+
const originalMethod = descriptor.value;
|
|
45
|
+
// Store metadata for remote transmission
|
|
46
|
+
Reflect.defineMetadata(METADATA_KEYS.REQUIRES_STATE, req, target, propertyKey);
|
|
47
|
+
descriptor.value = async function (...args) {
|
|
48
|
+
const player = args[0];
|
|
49
|
+
if (!player) {
|
|
50
|
+
throw new Error(`@RequiresState used on ${propertyKey} without Player context`);
|
|
51
|
+
}
|
|
52
|
+
if (req.has) {
|
|
53
|
+
for (const state of req.has) {
|
|
54
|
+
if (!player.hasState(state)) {
|
|
55
|
+
throw new AppError('GAME:INVALID_STATE', req.errorMessage || `You must be [${state}] to do this.`, 'client');
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
if (req.missing) {
|
|
60
|
+
for (const state of req.missing) {
|
|
61
|
+
if (player.hasState(state)) {
|
|
62
|
+
throw new AppError('GAME:INVALID_STATE', req.errorMessage || `You can't do this while you're [${state}].`, 'client');
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
return originalMethod.apply(this, args);
|
|
67
|
+
};
|
|
68
|
+
return descriptor;
|
|
69
|
+
};
|
|
70
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { SecurityAction } from '../../../kernel/error/security.types';
|
|
2
|
+
export interface ThrottleOptions {
|
|
3
|
+
/**
|
|
4
|
+
* limit of calls per windowMs
|
|
5
|
+
*/
|
|
6
|
+
limit: number;
|
|
7
|
+
/**
|
|
8
|
+
* time window for numeric overload
|
|
9
|
+
*/
|
|
10
|
+
windowMs: number;
|
|
11
|
+
/**
|
|
12
|
+
* action to perform on exceed limit
|
|
13
|
+
*/
|
|
14
|
+
onExceed?: SecurityAction;
|
|
15
|
+
/**
|
|
16
|
+
* custom message to display on exceed limit (ERROR MESSAGE)
|
|
17
|
+
*/
|
|
18
|
+
message?: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Rate-limits how frequently a method can be called by a specific player.
|
|
22
|
+
*
|
|
23
|
+
* @remarks
|
|
24
|
+
* Uses {@link RateLimiterService} with a key composed of:
|
|
25
|
+
* `clientId:ClassName:MethodName`.
|
|
26
|
+
*
|
|
27
|
+
* Overloads:
|
|
28
|
+
* - `@Throttle(5, 1000)` → 5 calls per 1000 ms
|
|
29
|
+
* - `@Throttle({ limit, windowMs, onExceed, message })`
|
|
30
|
+
*
|
|
31
|
+
* Behavior:
|
|
32
|
+
* - If the rate limit is exceeded, a {@link SecurityError} is thrown.
|
|
33
|
+
* - If the method is called without a valid `Player` context (first argument), the limiter is skipped.
|
|
34
|
+
*
|
|
35
|
+
* @param optionsOrLimit - Number (simple overload) or full config object.
|
|
36
|
+
* @param windowMs - Time window for the numeric overload.
|
|
37
|
+
*
|
|
38
|
+
* @throws SecurityError - When the rate limit is exceeded.
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* ```ts
|
|
42
|
+
* @Server.Controller()
|
|
43
|
+
* export class MarketController {
|
|
44
|
+
* @Server.Throttle(5, 2000)
|
|
45
|
+
* async search(player: Player, query: string) {
|
|
46
|
+
* // ...
|
|
47
|
+
* }
|
|
48
|
+
*
|
|
49
|
+
* @Server.Throttle({ limit: 1, windowMs: 5000, message: 'Too fast!' })
|
|
50
|
+
* async placeOrder(player: Player) {
|
|
51
|
+
* // ...
|
|
52
|
+
* }
|
|
53
|
+
* }
|
|
54
|
+
* ```
|
|
55
|
+
*/
|
|
56
|
+
export declare function Throttle(optionsOrLimit: number | ThrottleOptions, windowMs?: number): (target: any, propertyKey: string, descriptor?: PropertyDescriptor) => PropertyDescriptor | undefined;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { container } from 'tsyringe';
|
|
2
|
+
import { SecurityError } from '../../../kernel/error/security.error';
|
|
3
|
+
import { RateLimiterService } from '../services/rate-limiter.service';
|
|
4
|
+
import { METADATA_KEYS } from '../system/metadata-server.keys';
|
|
5
|
+
/**
|
|
6
|
+
* Rate-limits how frequently a method can be called by a specific player.
|
|
7
|
+
*
|
|
8
|
+
* @remarks
|
|
9
|
+
* Uses {@link RateLimiterService} with a key composed of:
|
|
10
|
+
* `clientId:ClassName:MethodName`.
|
|
11
|
+
*
|
|
12
|
+
* Overloads:
|
|
13
|
+
* - `@Throttle(5, 1000)` → 5 calls per 1000 ms
|
|
14
|
+
* - `@Throttle({ limit, windowMs, onExceed, message })`
|
|
15
|
+
*
|
|
16
|
+
* Behavior:
|
|
17
|
+
* - If the rate limit is exceeded, a {@link SecurityError} is thrown.
|
|
18
|
+
* - If the method is called without a valid `Player` context (first argument), the limiter is skipped.
|
|
19
|
+
*
|
|
20
|
+
* @param optionsOrLimit - Number (simple overload) or full config object.
|
|
21
|
+
* @param windowMs - Time window for the numeric overload.
|
|
22
|
+
*
|
|
23
|
+
* @throws SecurityError - When the rate limit is exceeded.
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```ts
|
|
27
|
+
* @Server.Controller()
|
|
28
|
+
* export class MarketController {
|
|
29
|
+
* @Server.Throttle(5, 2000)
|
|
30
|
+
* async search(player: Player, query: string) {
|
|
31
|
+
* // ...
|
|
32
|
+
* }
|
|
33
|
+
*
|
|
34
|
+
* @Server.Throttle({ limit: 1, windowMs: 5000, message: 'Too fast!' })
|
|
35
|
+
* async placeOrder(player: Player) {
|
|
36
|
+
* // ...
|
|
37
|
+
* }
|
|
38
|
+
* }
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
export function Throttle(optionsOrLimit, windowMs) {
|
|
42
|
+
return (target, propertyKey, descriptor) => {
|
|
43
|
+
if (!descriptor) {
|
|
44
|
+
// In benchmarks or edge cases, skip method wrapping
|
|
45
|
+
// This should NOT happen in production code with proper TypeScript compilation
|
|
46
|
+
// Note: Throttle cannot work without descriptor, so we just skip it
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
const originalMethod = descriptor.value;
|
|
50
|
+
let opts;
|
|
51
|
+
if (typeof optionsOrLimit === 'number') {
|
|
52
|
+
opts = { limit: optionsOrLimit, windowMs: windowMs || 1000, onExceed: 'LOG' };
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
opts = { onExceed: 'LOG', ...optionsOrLimit };
|
|
56
|
+
}
|
|
57
|
+
const onExceed = opts.onExceed ?? 'LOG';
|
|
58
|
+
// Store metadata for remote transmission
|
|
59
|
+
Reflect.defineMetadata(METADATA_KEYS.THROTTLE, opts, target, propertyKey);
|
|
60
|
+
descriptor.value = async function (...args) {
|
|
61
|
+
const player = args[0];
|
|
62
|
+
if (player?.clientID) {
|
|
63
|
+
const service = container.resolve(RateLimiterService);
|
|
64
|
+
const key = `${player.clientID}:${target.constructor.name}:${propertyKey}`;
|
|
65
|
+
if (!service.checkLimit(key, opts.limit, opts.windowMs)) {
|
|
66
|
+
throw new SecurityError(onExceed, opts.message || `Rate limit exceeded on ${propertyKey}`, { limit: opts.limit, key });
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
return originalMethod.apply(this, args);
|
|
70
|
+
};
|
|
71
|
+
return descriptor;
|
|
72
|
+
};
|
|
73
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { BindingScope } from './bind';
|
|
2
|
+
/**
|
|
3
|
+
* Marks a class as a framework-managed Service.
|
|
4
|
+
*
|
|
5
|
+
*
|
|
6
|
+
* @remarks
|
|
7
|
+
* This decorator binds the class into the dependency injection container using the provided scope
|
|
8
|
+
* (default: `singleton`).
|
|
9
|
+
*
|
|
10
|
+
* `@Service()` is a convenience wrapper over {@link Bind}. It exists so service-specific behavior
|
|
11
|
+
* can be added in the future without changing user code.
|
|
12
|
+
*
|
|
13
|
+
* @param options.scope - Optional binding scope (`singleton` | `transient`).
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```ts
|
|
17
|
+
* @Server.Service()
|
|
18
|
+
* export class InventoryService {
|
|
19
|
+
* addItem() {
|
|
20
|
+
* // ...
|
|
21
|
+
* }
|
|
22
|
+
* }
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
export declare function Service(options?: {
|
|
26
|
+
scope?: BindingScope;
|
|
27
|
+
}): (target: any) => void;
|
|
28
|
+
/**
|
|
29
|
+
* Marks a class as a Repository within the framework.
|
|
30
|
+
*
|
|
31
|
+
*
|
|
32
|
+
* @remarks
|
|
33
|
+
* A repository abstracts persistence operations (API, in-memory, or hybrid storage).
|
|
34
|
+
* It is registered in the dependency injection container using the provided scope
|
|
35
|
+
* (default: `singleton`).
|
|
36
|
+
*
|
|
37
|
+
* `@Repo()` is intentionally separate from {@link Service} to distinguish persistence-oriented
|
|
38
|
+
* classes from business logic.
|
|
39
|
+
*
|
|
40
|
+
* @param options.scope - Optional binding scope (`singleton` | `transient`).
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```ts
|
|
44
|
+
* @Server.Repo()
|
|
45
|
+
* export class AccountRepository {
|
|
46
|
+
* async findById(id: string) {
|
|
47
|
+
* // ...
|
|
48
|
+
* }
|
|
49
|
+
* }
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
52
|
+
export declare function Repo(options?: {
|
|
53
|
+
scope?: BindingScope;
|
|
54
|
+
}): (target: any) => void;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { Bind } from './bind';
|
|
2
|
+
/**
|
|
3
|
+
* Marks a class as a framework-managed Service.
|
|
4
|
+
*
|
|
5
|
+
*
|
|
6
|
+
* @remarks
|
|
7
|
+
* This decorator binds the class into the dependency injection container using the provided scope
|
|
8
|
+
* (default: `singleton`).
|
|
9
|
+
*
|
|
10
|
+
* `@Service()` is a convenience wrapper over {@link Bind}. It exists so service-specific behavior
|
|
11
|
+
* can be added in the future without changing user code.
|
|
12
|
+
*
|
|
13
|
+
* @param options.scope - Optional binding scope (`singleton` | `transient`).
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```ts
|
|
17
|
+
* @Server.Service()
|
|
18
|
+
* export class InventoryService {
|
|
19
|
+
* addItem() {
|
|
20
|
+
* // ...
|
|
21
|
+
* }
|
|
22
|
+
* }
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
export function Service(options) {
|
|
26
|
+
return Bind(options?.scope ?? 'singleton');
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Marks a class as a Repository within the framework.
|
|
30
|
+
*
|
|
31
|
+
*
|
|
32
|
+
* @remarks
|
|
33
|
+
* A repository abstracts persistence operations (API, in-memory, or hybrid storage).
|
|
34
|
+
* It is registered in the dependency injection container using the provided scope
|
|
35
|
+
* (default: `singleton`).
|
|
36
|
+
*
|
|
37
|
+
* `@Repo()` is intentionally separate from {@link Service} to distinguish persistence-oriented
|
|
38
|
+
* classes from business logic.
|
|
39
|
+
*
|
|
40
|
+
* @param options.scope - Optional binding scope (`singleton` | `transient`).
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```ts
|
|
44
|
+
* @Server.Repo()
|
|
45
|
+
* export class AccountRepository {
|
|
46
|
+
* async findById(id: string) {
|
|
47
|
+
* // ...
|
|
48
|
+
* }
|
|
49
|
+
* }
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
52
|
+
export function Repo(options) {
|
|
53
|
+
return Bind(options?.scope ?? 'singleton');
|
|
54
|
+
}
|