@ragemp-mango/core 2.0.6-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +20 -0
  3. package/dist/app/constants/index.d.ts +26 -0
  4. package/dist/app/constants/index.js +49 -0
  5. package/dist/app/controller/index.d.ts +70 -0
  6. package/dist/app/controller/index.js +24 -0
  7. package/dist/app/enums/index.d.ts +27 -0
  8. package/dist/app/enums/index.js +16 -0
  9. package/dist/app/index.d.ts +138 -0
  10. package/dist/app/index.js +132 -0
  11. package/dist/app/interfaces/index.d.ts +157 -0
  12. package/dist/app/interfaces/index.js +2 -0
  13. package/dist/app/module/index.d.ts +27 -0
  14. package/dist/app/module/index.js +16 -0
  15. package/dist/app/module-tree/index.d.ts +56 -0
  16. package/dist/app/module-tree/index.js +25 -0
  17. package/dist/app/pipeline/index.d.ts +5 -0
  18. package/dist/app/pipeline/index.js +14 -0
  19. package/dist/app/services/index.d.ts +37 -0
  20. package/dist/app/services/index.js +14 -0
  21. package/dist/app/utils/index.d.ts +16 -0
  22. package/dist/app/utils/index.js +10 -0
  23. package/dist/call-handler.interface-DVdaknsB.d.ts +52 -0
  24. package/dist/chunk-2ADQZWQE.js +170 -0
  25. package/dist/chunk-6YEWPMZJ.js +69 -0
  26. package/dist/chunk-73LIJA6X.js +176 -0
  27. package/dist/chunk-7QVYU63E.js +7 -0
  28. package/dist/chunk-AO6BXG54.js +139 -0
  29. package/dist/chunk-CFHBJ5MV.js +1906 -0
  30. package/dist/chunk-CW7WAA3P.js +1906 -0
  31. package/dist/chunk-DEPJRTVT.js +1 -0
  32. package/dist/chunk-DJZCOYB3.js +17 -0
  33. package/dist/chunk-DXPVUDXD.js +81 -0
  34. package/dist/chunk-E6IQL4S6.js +40 -0
  35. package/dist/chunk-HK7QTFPA.js +81 -0
  36. package/dist/chunk-ITEHLEIP.js +29 -0
  37. package/dist/chunk-M55YEQ7J.js +1 -0
  38. package/dist/chunk-PGWRESZG.js +790 -0
  39. package/dist/chunk-PQK4E654.js +1 -0
  40. package/dist/chunk-RYOUF322.js +68 -0
  41. package/dist/chunk-SKPH3K2M.js +570 -0
  42. package/dist/chunk-TBWHLT75.js +61 -0
  43. package/dist/constants/index.d.ts +8 -0
  44. package/dist/constants/index.js +18 -0
  45. package/dist/controller-Ss0TVrxQ.d.ts +30 -0
  46. package/dist/custom-decorator.type-BHRvXIGz.d.ts +5 -0
  47. package/dist/decorators/index.d.ts +90 -0
  48. package/dist/decorators/index.js +91 -0
  49. package/dist/enums/index.d.ts +66 -0
  50. package/dist/enums/index.js +12 -0
  51. package/dist/errors/index.d.ts +23 -0
  52. package/dist/errors/index.js +17 -0
  53. package/dist/event-destination.enum-DT8jJFwR.d.ts +7 -0
  54. package/dist/event-emmiter.interface-7Ne9W8SM.d.ts +10 -0
  55. package/dist/event-metadata.interface-CREizDNq.d.ts +89 -0
  56. package/dist/execution-context-type.enum-fwYPtPvp.d.ts +6 -0
  57. package/dist/execution-context.interface-DpRN4oVj.d.ts +56 -0
  58. package/dist/index.d.ts +33 -0
  59. package/dist/index.js +190 -0
  60. package/dist/injectable-options.interface-8Gp9oRY6.d.ts +10 -0
  61. package/dist/injectable-scope.enum-CjyQMpW2.d.ts +7 -0
  62. package/dist/injection-token.type-dQTkkP6p.d.ts +5 -0
  63. package/dist/interfaces/index.d.ts +38 -0
  64. package/dist/interfaces/index.js +2 -0
  65. package/dist/logger-service.interface-BGV-o_Fx.d.ts +8 -0
  66. package/dist/method-param-type.enum-BfrJ8zqa.d.ts +11 -0
  67. package/dist/module-metadata.interface-B3bn1vqq.d.ts +59 -0
  68. package/dist/multiplayer-timers.interface-CFDTWwAT.d.ts +22 -0
  69. package/dist/newable.type-BdhG3MZC.d.ts +5 -0
  70. package/dist/nullable.type-C-lE7JU4.d.ts +3 -0
  71. package/dist/pipe-transform.interface-BlzOrUy3.d.ts +14 -0
  72. package/dist/pipes/index.d.ts +12 -0
  73. package/dist/pipes/index.js +9 -0
  74. package/dist/reflectable-decorator.interface-CLOGdtEQ.d.ts +14 -0
  75. package/dist/rpc-call-options.interface-BJ5mHrvT.d.ts +5 -0
  76. package/dist/rpc-error.interface-CeaZLqzE.d.ts +6 -0
  77. package/dist/rpc-metadata.interface-DS-GqgqA.d.ts +11 -0
  78. package/dist/rpc-result.interface-C758heM0.d.ts +10 -0
  79. package/dist/schemas/index.d.ts +189 -0
  80. package/dist/schemas/index.js +39 -0
  81. package/dist/script-event-handler.interface-B-Th4Ssg.d.ts +24 -0
  82. package/dist/script-event-handler.interface-vUr_v6tV.d.ts +5 -0
  83. package/dist/script-rpc-handler.interface-DBpD9-yk.d.ts +8 -0
  84. package/dist/services/index.d.ts +45 -0
  85. package/dist/services/index.js +23 -0
  86. package/dist/types/index.d.ts +9 -0
  87. package/dist/types/index.js +2 -0
  88. package/dist/utils/index.d.ts +16 -0
  89. package/dist/utils/index.js +32 -0
  90. package/package.json +133 -0
@@ -0,0 +1,61 @@
1
+ // src/app/enums/app-enviroment.enum.ts
2
+ var AppEnviroment = /* @__PURE__ */ (function(AppEnviroment2) {
3
+ AppEnviroment2[AppEnviroment2["Client"] = 0] = "Client";
4
+ AppEnviroment2[AppEnviroment2["Server"] = 1] = "Server";
5
+ return AppEnviroment2;
6
+ })({});
7
+
8
+ // src/app/enums/core-metadata-key.enum.ts
9
+ var CoreMetadataKey = /* @__PURE__ */ (function(CoreMetadataKey2) {
10
+ CoreMetadataKey2["Injectable"] = "mango:injectable";
11
+ CoreMetadataKey2["Inject"] = "mango:inject";
12
+ CoreMetadataKey2["Module"] = "mango:module";
13
+ CoreMetadataKey2["GlobalModule"] = "mango:global-module";
14
+ CoreMetadataKey2["Controller"] = "mango:controller-options";
15
+ CoreMetadataKey2["ControllerEvents"] = "mango:controller-events";
16
+ CoreMetadataKey2["ControllerRPCs"] = "mango:controller-rpcs";
17
+ CoreMetadataKey2["ControllerParams"] = "mango:controller-rpc-params";
18
+ CoreMetadataKey2["Guards"] = "mango:guards";
19
+ CoreMetadataKey2["Interceptors"] = "mango:interceptors";
20
+ CoreMetadataKey2["Pipes"] = "mango:pipes";
21
+ CoreMetadataKey2["Catch"] = "mango:catch";
22
+ CoreMetadataKey2["ErrorFilters"] = "mango:error-filters";
23
+ CoreMetadataKey2["Timers"] = "mango:timers";
24
+ return CoreMetadataKey2;
25
+ })({});
26
+
27
+ // src/app/enums/event-destination.enum.ts
28
+ var EventDestination = /* @__PURE__ */ (function(EventDestination2) {
29
+ EventDestination2["Server"] = "server";
30
+ EventDestination2["Client"] = "client";
31
+ EventDestination2["WebView"] = "webview";
32
+ return EventDestination2;
33
+ })({});
34
+
35
+ // src/app/enums/execution-context-type.enum.ts
36
+ var ExecutionContextType = /* @__PURE__ */ (function(ExecutionContextType2) {
37
+ ExecutionContextType2["Event"] = "event";
38
+ ExecutionContextType2["RPC"] = "rpc";
39
+ return ExecutionContextType2;
40
+ })({});
41
+
42
+ // src/app/enums/method-param-type.enum.ts
43
+ var MethodParamType = /* @__PURE__ */ (function(MethodParamType2) {
44
+ MethodParamType2["Body"] = "body";
45
+ MethodParamType2["Custom"] = "custom";
46
+ MethodParamType2["Param"] = "param";
47
+ MethodParamType2["Player"] = "player";
48
+ MethodParamType2["Request"] = "request";
49
+ MethodParamType2["Response"] = "response";
50
+ MethodParamType2["Index"] = "index";
51
+ return MethodParamType2;
52
+ })({});
53
+
54
+ export {
55
+ AppEnviroment,
56
+ CoreMetadataKey,
57
+ EventDestination,
58
+ ExecutionContextType,
59
+ MethodParamType
60
+ };
61
+ //# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vc3JjL2FwcC9lbnVtcy9hcHAtZW52aXJvbWVudC5lbnVtLnRzIiwgIi4uL3NyYy9hcHAvZW51bXMvY29yZS1tZXRhZGF0YS1rZXkuZW51bS50cyIsICIuLi9zcmMvYXBwL2VudW1zL2V2ZW50LWRlc3RpbmF0aW9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
1
+ declare const LOGGER_SERVICE = "LOGGER_SERVICE";
2
+ declare const EVENT_SERVICE = "EVENT_SERVICE";
3
+ declare const RPC_SERVICE = "RPC_SERVICE";
4
+ declare const MODULE_CONTAINER = "MODULE_CONTAINER";
5
+ declare const REFLECTOR_SERVICE = "REFLECTOR_SERVICE";
6
+ declare const TIMER_SERVICE = "TIMER_SERVICE";
7
+
8
+ export { EVENT_SERVICE, LOGGER_SERVICE, MODULE_CONTAINER, REFLECTOR_SERVICE, RPC_SERVICE, TIMER_SERVICE };
@@ -0,0 +1,18 @@
1
+ import {
2
+ EVENT_SERVICE,
3
+ LOGGER_SERVICE,
4
+ MODULE_CONTAINER,
5
+ REFLECTOR_SERVICE,
6
+ RPC_SERVICE,
7
+ TIMER_SERVICE
8
+ } from "../chunk-DJZCOYB3.js";
9
+ import "../chunk-7QVYU63E.js";
10
+ export {
11
+ EVENT_SERVICE,
12
+ LOGGER_SERVICE,
13
+ MODULE_CONTAINER,
14
+ REFLECTOR_SERVICE,
15
+ RPC_SERVICE,
16
+ TIMER_SERVICE
17
+ };
18
+ //# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFtdLAogICJzb3VyY2VzQ29udGVudCI6IFtdLAogICJtYXBwaW5ncyI6ICIiLAogICJuYW1lcyI6IFtdCn0K
@@ -0,0 +1,30 @@
1
+ import { M as ModuleMetadata, C as ControllerMetadata } from './module-metadata.interface-B3bn1vqq.js';
2
+ import { S as ScriptRPCHandler } from './script-rpc-handler.interface-DBpD9-yk.js';
3
+ import { S as ScriptEventHandler } from './script-event-handler.interface-vUr_v6tV.js';
4
+ import { Container } from 'inversify';
5
+
6
+ declare class ModuleContainer extends Container {
7
+ }
8
+
9
+ declare class Module {
10
+ readonly controllers: Controller[];
11
+ container: ModuleContainer;
12
+ parent: Module | undefined;
13
+ metadata: ModuleMetadata;
14
+ instance: {
15
+ [key: string]: Function;
16
+ };
17
+ repetitiveImports: Set<Module>;
18
+ }
19
+
20
+ declare class Controller {
21
+ metadata: ControllerMetadata;
22
+ instance: {
23
+ [key: string]: Function;
24
+ };
25
+ owner: Module;
26
+ eventHandlers: ScriptEventHandler[];
27
+ rpcHandlers: ScriptRPCHandler[];
28
+ }
29
+
30
+ export { Controller as C, ModuleContainer as M, Module as a };
@@ -0,0 +1,5 @@
1
+ type CustomDecorator<TKey = string> = MethodDecorator & ClassDecorator & {
2
+ KEY: TKey;
3
+ };
4
+
5
+ export type { CustomDecorator as C };
@@ -0,0 +1,90 @@
1
+ import { C as ControllerOptions, I as InjectableOptions } from '../injectable-options.interface-8Gp9oRY6.js';
2
+ import { N as Newable } from '../newable.type-BdhG3MZC.js';
3
+ import { I as InjectionToken } from '../injection-token.type-dQTkkP6p.js';
4
+ import { M as ModuleOptions } from '../call-handler.interface-DVdaknsB.js';
5
+ import { C as CustomDecorator } from '../custom-decorator.type-BHRvXIGz.js';
6
+ import { a as ErrorFilter, G as Guard, I as Interceptor, E as EventMetadata } from '../event-metadata.interface-CREizDNq.js';
7
+ import { P as Pipe } from '../pipe-transform.interface-BlzOrUy3.js';
8
+ import { CronOptions } from 'croner';
9
+ import { E as ExecutionContext } from '../execution-context.interface-DpRN4oVj.js';
10
+ import { R as RPCMetadata } from '../rpc-metadata.interface-DS-GqgqA.js';
11
+ import * as inversify from 'inversify';
12
+ import { interfaces } from 'inversify';
13
+ import '../injectable-scope.enum-CjyQMpW2.js';
14
+ import '../method-param-type.enum-BfrJ8zqa.js';
15
+ import '../execution-context-type.enum-fwYPtPvp.js';
16
+ import '../rpc-error.interface-CeaZLqzE.js';
17
+
18
+ declare function Controller<T extends Newable>(options?: ControllerOptions): (target: T) => T;
19
+
20
+ declare function Global<T extends Newable>(): (target: T) => T;
21
+
22
+ declare function Inject<T = unknown>(key?: InjectionToken<T>): PropertyDecorator & ParameterDecorator;
23
+
24
+ declare function Injectable<T extends Newable>(options?: InjectableOptions): (target: T) => T;
25
+
26
+ declare function Module<T extends Newable>(options?: ModuleOptions): (target: T) => T;
27
+
28
+ declare function Optional(): PropertyDecorator & ParameterDecorator;
29
+
30
+ declare function SetMetadata<K extends string = string, V = unknown>(key: K, value: V): CustomDecorator;
31
+
32
+ declare function Catch<T extends Newable>(...exceptions: unknown[]): (target: T) => T;
33
+
34
+ declare function UseFilters(...filters: (Newable<ErrorFilter> | ErrorFilter)[]): ClassDecorator & MethodDecorator;
35
+
36
+ declare function OnInternal(eventName: string): MethodDecorator;
37
+
38
+ declare function OnWebView(id: string | number, eventName?: string): MethodDecorator;
39
+
40
+ declare function On(eventName?: string): MethodDecorator;
41
+
42
+ declare function OnceInternal(eventName: string): MethodDecorator;
43
+
44
+ declare function Once(eventName?: string): MethodDecorator;
45
+
46
+ declare function OnceWebView(id: string | number, eventName?: string): MethodDecorator;
47
+
48
+ declare function Body(...pipes: (Newable<Pipe> | Pipe)[]): ParameterDecorator;
49
+
50
+ declare function Index(key: number, ...pipes: (Newable<Pipe> | Pipe)[]): ParameterDecorator;
51
+
52
+ declare function Request(): ParameterDecorator;
53
+ declare function Req(): ParameterDecorator;
54
+
55
+ declare function Param(key: string, ...pipes: (Newable<Pipe> | Pipe)[]): ParameterDecorator;
56
+
57
+ declare function Response(): ParameterDecorator;
58
+ declare function Res(): ParameterDecorator;
59
+
60
+ declare function UseGuards(...guards: (Newable<Guard> | Guard)[]): ClassDecorator & MethodDecorator;
61
+
62
+ declare function UseInterceptors(...interceptors: (Newable<Interceptor> | Interceptor)[]): ClassDecorator & MethodDecorator;
63
+
64
+ declare function UsePipes(...pipes: (Newable<Pipe> | Pipe)[]): ClassDecorator & MethodDecorator;
65
+
66
+ declare function OnRequest(rpcName?: string): MethodDecorator;
67
+
68
+ declare function OnWebViewRequest(id: string | number, rpcName?: string): MethodDecorator;
69
+
70
+ declare function Cron(pattern: string | Date, options?: CronOptions): MethodDecorator;
71
+
72
+ declare function EveryTick(name?: string): MethodDecorator;
73
+
74
+ declare function Interval(timeout: number): MethodDecorator;
75
+ declare function Interval(name: string, timeout: number): MethodDecorator;
76
+
77
+ declare function Timeout(timeout: number): MethodDecorator;
78
+ declare function Timeout(name: string, value: number): MethodDecorator;
79
+
80
+ declare function applyDecorators(...decorators: (ClassDecorator | MethodDecorator | PropertyDecorator)[]): <TFunction extends Function, Y>(target: TFunction | Object, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor<Y>) => void;
81
+
82
+ declare function createEventDecorator(type: EventMetadata['type'], name?: string, webViewId?: string | number): MethodDecorator;
83
+
84
+ declare function createParamDecorator<TInput = unknown, TOutput = unknown>(factory: (data: TInput, ctx: ExecutionContext) => TOutput): <TInput_1 = unknown>(data?: TInput_1, ...pipes: (Newable<Pipe> | Pipe)[]) => ParameterDecorator;
85
+
86
+ declare function createRPCDecorator(type: RPCMetadata['type'], name?: string, webViewId?: string | number): MethodDecorator;
87
+
88
+ declare function forwardRef<T = unknown>(fn: () => interfaces.ServiceIdentifier<T>): inversify.LazyServiceIdentifier<T>;
89
+
90
+ export { Body, Catch, Controller, Cron, EveryTick, Global, Index, Inject, Injectable, Interval, Module, On, OnInternal, OnRequest, OnWebView, OnWebViewRequest, Once, OnceInternal, OnceWebView, Optional, Param, Req, Request, Res, Response, SetMetadata, Timeout, UseFilters, UseGuards, UseInterceptors, UsePipes, applyDecorators, createEventDecorator, createParamDecorator, createRPCDecorator, forwardRef };
@@ -0,0 +1,91 @@
1
+ import {
2
+ Body,
3
+ Catch,
4
+ Controller,
5
+ Cron,
6
+ EveryTick,
7
+ Global,
8
+ Index,
9
+ Inject,
10
+ Injectable,
11
+ Interval,
12
+ Module,
13
+ On,
14
+ OnInternal,
15
+ OnRequest,
16
+ OnWebView,
17
+ OnWebViewRequest,
18
+ Once,
19
+ OnceInternal,
20
+ OnceWebView,
21
+ Optional,
22
+ Param,
23
+ Req,
24
+ Request,
25
+ Res,
26
+ Response,
27
+ SetMetadata,
28
+ Timeout,
29
+ UseFilters,
30
+ UseGuards,
31
+ UseInterceptors,
32
+ UsePipes,
33
+ applyDecorators,
34
+ createEventDecorator,
35
+ createParamDecorator,
36
+ createRPCDecorator,
37
+ forwardRef
38
+ } from "../chunk-CW7WAA3P.js";
39
+ import "../chunk-73LIJA6X.js";
40
+ import "../chunk-AO6BXG54.js";
41
+ import "../chunk-2ADQZWQE.js";
42
+ import "../chunk-RYOUF322.js";
43
+ import "../chunk-PGWRESZG.js";
44
+ import "../chunk-SKPH3K2M.js";
45
+ import "../chunk-HK7QTFPA.js";
46
+ import "../chunk-TBWHLT75.js";
47
+ import "../chunk-M55YEQ7J.js";
48
+ import "../chunk-DJZCOYB3.js";
49
+ import "../chunk-6YEWPMZJ.js";
50
+ import "../chunk-DXPVUDXD.js";
51
+ import "../chunk-E6IQL4S6.js";
52
+ import "../chunk-7QVYU63E.js";
53
+ export {
54
+ Body,
55
+ Catch,
56
+ Controller,
57
+ Cron,
58
+ EveryTick,
59
+ Global,
60
+ Index,
61
+ Inject,
62
+ Injectable,
63
+ Interval,
64
+ Module,
65
+ On,
66
+ OnInternal,
67
+ OnRequest,
68
+ OnWebView,
69
+ OnWebViewRequest,
70
+ Once,
71
+ OnceInternal,
72
+ OnceWebView,
73
+ Optional,
74
+ Param,
75
+ Req,
76
+ Request,
77
+ Res,
78
+ Response,
79
+ SetMetadata,
80
+ Timeout,
81
+ UseFilters,
82
+ UseGuards,
83
+ UseInterceptors,
84
+ UsePipes,
85
+ applyDecorators,
86
+ createEventDecorator,
87
+ createParamDecorator,
88
+ createRPCDecorator,
89
+ forwardRef
90
+ };
91
+ //# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFtdLAogICJzb3VyY2VzQ29udGVudCI6IFtdLAogICJtYXBwaW5ncyI6ICIiLAogICJuYW1lcyI6IFtdCn0K
@@ -0,0 +1,66 @@
1
+ export { I as InjectableScope } from '../injectable-scope.enum-CjyQMpW2.js';
2
+
3
+ declare enum ErrorMessage {
4
+ TooManyRequests = "Too many requests.",
5
+ EventNameMustBeString = "The event name must be a string.",
6
+ EventNameMustBeUnique = "The event name must be unique.",
7
+ EventNotAllowedInClient = "The event is not allowed in the client environment.",
8
+ EventNotAllowedInServer = "The event is not allowed in the server environment.",
9
+ InvalidEventType = "Invalid event type.",
10
+ InvalidInternalEventName = "The name of the internal event is invalid.",
11
+ InvalidReturnInEvent = "Cannot return a value from an event.",
12
+ RPCNameMustBeString = "The RPC name must be a string.",
13
+ RPCNameMustBeUnique = "The RPC name must be unique.",
14
+ RPCNotAllowedInClient = "The RPC is not allowed in the client environment.",
15
+ RPCNotAllowedInServer = "The RPC is not allowed in the server environment.",
16
+ InvalidRPCType = "Invalid RPC type.",
17
+ RPCHandlerAlreadyExists = "The RPC handler already exists. Please provide a unique name for the RPC.",
18
+ RPCResponseAlreadySent = "The RPC response has already been sent.",
19
+ InvalidErrorFilterDefinition = "Invalid error filter. Error filters must be a class reference or an object with a catch method.",
20
+ ErrorAlreadyHandledByFilter = "The error already points to a filter.",
21
+ ExceptionHandlingConflict = "The same exception can only be caught once.",
22
+ AtLeastOneFilterRequired = "At least one error filter must be provided.",
23
+ DuplicateErrorFilterDetected = "Duplicate error filter found. Ensure that the same filter is not applied more than once.",
24
+ WebViewNotFound = "The WebView with the specified id does not exist.",
25
+ WebViewIdMustBeStringOrNumber = "The WebView id must be a string or number.",
26
+ InvalidGuardDefinition = "Invalid guard. Guards must be a class reference or an object with a canActivate method.",
27
+ AtLeastOneGuardRequired = "At least one guard must be provided.",
28
+ InvalidInterceptorDefinition = "Invalid interceptor. Interceptors must be a class reference or an object with an intercept method.",
29
+ AtLeastOneInterceptorRequired = "At least one interceptor must be provided.",
30
+ InvalidInterceptorReturnValue = "The interceptor must return a function.",
31
+ InvalidPipeDefinition = "Invalid pipe. Pipes must be a class reference or an object with a transform method.",
32
+ AtLeastOnePipeRequired = "At least one pipe must be provided.",
33
+ AppAlreadyLoaded = "App is already loaded. Please call the stop method before calling the start method.",
34
+ AppNotLoaded = "App is not loaded. Please call the start method before calling the stop method.",
35
+ InvalidInjectionTokenSpecified = "The specified injection token is invalid.",
36
+ InjectionTokenNotFound = "The injection token could not be found.",
37
+ ParamKeyMustBeString = "The param key must be a string.",
38
+ IndexKeyMustBeNumber = "The index key must be a number.",
39
+ DuplicateDecoratorUsage = "The same decorator can only be used once in the same class.",
40
+ InvalidControllerOptions = "Invalid controller options found.",
41
+ InvalidInjectableOptions = "Invalid injectable options found.",
42
+ InvalidModuleOptions = "Invalid module options found.",
43
+ MultipleDecoratorsOnSingleParameterNotAllowed = "Cannot apply multiple decorators to the same parameter.",
44
+ CircularDependencyDetected = "Circular dependency detected.",
45
+ InvalidModuleDefinition = "The module is invalid.",
46
+ InvalidExportDefinition = "The export is invalid.",
47
+ InvalidProviderDefinition = "The provider is invalid.",
48
+ InvalidParameterDecoratorUsage = "Each parameter must have their its own decorator.",
49
+ ResponseDecoratorNotAllowedOnEvents = "The @Response() decorator is not allowed on events.",
50
+ PlayerDecoratorNotAllowedOnClientEvents = "The @Player() decorator is not allowed on client events.",
51
+ TimerNameMustBeString = "The timer name must be a string."
52
+ }
53
+
54
+ declare enum RPCResultStatus {
55
+ Success = 1,
56
+ Timeout = 2,
57
+ HandlerNotFound = 3,
58
+ Unknown = 4,
59
+ CancelledByGuard = 5,
60
+ InvalidGuardReturn = 6,
61
+ TooManyRequests = 7,
62
+ PlayerDisconnected = 8,
63
+ PlayerNotFound = 9
64
+ }
65
+
66
+ export { ErrorMessage, RPCResultStatus };
@@ -0,0 +1,12 @@
1
+ import {
2
+ ErrorMessage,
3
+ InjectableScope,
4
+ RPCResultStatus
5
+ } from "../chunk-DXPVUDXD.js";
6
+ import "../chunk-7QVYU63E.js";
7
+ export {
8
+ ErrorMessage,
9
+ InjectableScope,
10
+ RPCResultStatus
11
+ };
12
+ //# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFtdLAogICJzb3VyY2VzQ29udGVudCI6IFtdLAogICJtYXBwaW5ncyI6ICIiLAogICJuYW1lcyI6IFtdCn0K
@@ -0,0 +1,23 @@
1
+ declare class MangoError<TDetails = unknown> extends Error {
2
+ status: number;
3
+ details: TDetails | undefined;
4
+ constructor(message: string, status?: number, details?: TDetails);
5
+ }
6
+
7
+ declare class GuardCancelError extends MangoError {
8
+ constructor();
9
+ }
10
+
11
+ declare class GuardInvalidReturnError extends MangoError {
12
+ constructor();
13
+ }
14
+
15
+ declare class TooManyRequests extends MangoError {
16
+ constructor(message?: string);
17
+ }
18
+
19
+ declare class UnknownError extends MangoError {
20
+ constructor();
21
+ }
22
+
23
+ export { GuardCancelError, GuardInvalidReturnError, MangoError, TooManyRequests, UnknownError };
@@ -0,0 +1,17 @@
1
+ import {
2
+ GuardCancelError,
3
+ GuardInvalidReturnError,
4
+ MangoError,
5
+ TooManyRequests,
6
+ UnknownError
7
+ } from "../chunk-6YEWPMZJ.js";
8
+ import "../chunk-DXPVUDXD.js";
9
+ import "../chunk-7QVYU63E.js";
10
+ export {
11
+ GuardCancelError,
12
+ GuardInvalidReturnError,
13
+ MangoError,
14
+ TooManyRequests,
15
+ UnknownError
16
+ };
17
+ //# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFtdLAogICJzb3VyY2VzQ29udGVudCI6IFtdLAogICJtYXBwaW5ncyI6ICIiLAogICJuYW1lcyI6IFtdCn0K
@@ -0,0 +1,7 @@
1
+ declare enum EventDestination {
2
+ Server = "server",
3
+ Client = "client",
4
+ WebView = "webview"
5
+ }
6
+
7
+ export { EventDestination as E };
@@ -0,0 +1,10 @@
1
+ import { S as ScriptEventHandler } from './script-event-handler.interface-vUr_v6tV.js';
2
+
3
+ interface EventEmmiter {
4
+ emit(eventName: string, ...args: any[]): void;
5
+ on(eventName: string, listener: (...args: any[]) => void): ScriptEventHandler;
6
+ once(eventName: string, listener: (...args: any[]) => void): ScriptEventHandler;
7
+ off(eventName: string, listener: (...args: any[]) => void): void;
8
+ }
9
+
10
+ export type { EventEmmiter as E };
@@ -0,0 +1,89 @@
1
+ import { N as Newable } from './newable.type-BdhG3MZC.js';
2
+ import { A as ArgumentMetadata, P as Pipe } from './pipe-transform.interface-BlzOrUy3.js';
3
+ import { b as ExecutionContextBase, M as MangoRequest, a as MangoResponse, E as ExecutionContext } from './execution-context.interface-DpRN4oVj.js';
4
+ import { a as CallHandler } from './call-handler.interface-DVdaknsB.js';
5
+ import { M as MethodParamType } from './method-param-type.enum-BfrJ8zqa.js';
6
+
7
+ interface BodyParameter extends ArgumentMetadata {
8
+ type: MethodParamType.Body;
9
+ method: string;
10
+ index: number;
11
+ pipes?: (Newable<Pipe> | Pipe)[];
12
+ data?: string | undefined;
13
+ }
14
+
15
+ interface CustomParameter extends ArgumentMetadata {
16
+ type: MethodParamType.Custom;
17
+ method: string;
18
+ index: number;
19
+ pipes?: (Newable<Pipe> | Pipe)[];
20
+ factory: (data: unknown, context: ExecutionContextBase) => unknown;
21
+ data?: unknown;
22
+ }
23
+
24
+ interface IndexParameter extends ArgumentMetadata {
25
+ type: MethodParamType.Index;
26
+ method: string;
27
+ index: number;
28
+ pipes?: (Newable<Pipe> | Pipe)[];
29
+ data: number;
30
+ }
31
+
32
+ interface ParamParameter extends ArgumentMetadata {
33
+ type: MethodParamType.Param;
34
+ method: string;
35
+ index: number;
36
+ pipes?: (Newable<Pipe> | Pipe)[];
37
+ data: string;
38
+ }
39
+
40
+ interface PlayerParameter extends ArgumentMetadata {
41
+ type: MethodParamType.Player;
42
+ method: string;
43
+ index: number;
44
+ pipes?: (Newable<Pipe> | Pipe)[];
45
+ data?: string | undefined;
46
+ }
47
+
48
+ interface RequestParameter extends ArgumentMetadata {
49
+ type: MethodParamType.Request;
50
+ method: string;
51
+ index: number;
52
+ }
53
+
54
+ interface ResponseParameter extends ArgumentMetadata {
55
+ type: MethodParamType.Response;
56
+ method: string;
57
+ index: number;
58
+ }
59
+
60
+ type MethodParameter = BodyParameter | CustomParameter | ParamParameter | PlayerParameter | RequestParameter | ResponseParameter | IndexParameter;
61
+
62
+ interface ErrorFilter<T = unknown, TRequest extends MangoRequest = MangoRequest, TResponse extends MangoResponse = MangoResponse> {
63
+ catch(error: T, context: ExecutionContext<TRequest, TResponse>): unknown;
64
+ }
65
+
66
+ interface Guard<TRequest extends MangoRequest = MangoRequest, TResponse extends MangoResponse = MangoResponse> {
67
+ canActivate(context: ExecutionContext<TRequest, TResponse>): boolean | Promise<boolean>;
68
+ }
69
+
70
+ interface Interceptor<THandlerResult = unknown, TRequest extends MangoRequest = MangoRequest, TResponse extends MangoResponse = MangoResponse> {
71
+ intercept(context: ExecutionContext<TRequest, TResponse>, callHandler: CallHandler<THandlerResult>): void | Promise<void>;
72
+ }
73
+
74
+ interface PipelineMetadata {
75
+ guards: (Newable<Guard> | Guard)[];
76
+ interceptors: (Newable<Interceptor> | Interceptor)[];
77
+ pipes: (Newable<Pipe> | Pipe)[];
78
+ errorFilters: (Newable<ErrorFilter> | ErrorFilter)[];
79
+ }
80
+
81
+ interface EventMetadata extends PipelineMetadata {
82
+ type: 'on' | 'once' | 'onPlayer' | 'oncePlayer' | 'onServer' | 'onceServer' | 'onWebView' | 'onceWebView' | 'onInternal' | 'onceInternal';
83
+ name: string;
84
+ method: string;
85
+ params: MethodParameter[];
86
+ webViewId?: string | number | undefined;
87
+ }
88
+
89
+ export type { BodyParameter as B, CustomParameter as C, EventMetadata as E, Guard as G, Interceptor as I, MethodParameter as M, PipelineMetadata as P, RequestParameter as R, ErrorFilter as a, ParamParameter as b, PlayerParameter as c, ResponseParameter as d, IndexParameter as e };
@@ -0,0 +1,6 @@
1
+ declare enum ExecutionContextType {
2
+ Event = "event",
3
+ RPC = "rpc"
4
+ }
5
+
6
+ export { ExecutionContextType as E };
@@ -0,0 +1,56 @@
1
+ import { N as Newable } from './newable.type-BdhG3MZC.js';
2
+ import { E as ExecutionContextType } from './execution-context-type.enum-fwYPtPvp.js';
3
+ import { R as RPCError } from './rpc-error.interface-CeaZLqzE.js';
4
+
5
+ declare class MangoRequestBase<TData = unknown> implements MangoRequest {
6
+ $body: TData;
7
+ $player?: PlayerMp;
8
+ get body(): TData;
9
+ get player(): PlayerMp | undefined;
10
+ }
11
+
12
+ declare class MangoResponseBase implements MangoResponse {
13
+ private readonly $loggerService;
14
+ $sendListeners: Set<(data: unknown) => void>;
15
+ $errorListeners: Set<(error: RPCError) => void>;
16
+ $isSent: boolean;
17
+ send<TData = unknown>(data?: TData): void;
18
+ error<TDetails = unknown>(message: string, details?: TDetails): void;
19
+ $onSend(listener: (data: unknown) => void): void;
20
+ $onError(listener: (error: RPCError) => void): void;
21
+ }
22
+
23
+ declare class ExecutionContextBase<TRequest extends MangoRequestBase = MangoRequestBase, TResponse extends MangoResponseBase = MangoResponseBase> implements ExecutionContext<TRequest, TResponse> {
24
+ $type: ExecutionContextType;
25
+ $classRef: Newable;
26
+ $handler: Function;
27
+ $request: TRequest;
28
+ $response?: TResponse;
29
+ $name: string;
30
+ get type(): ExecutionContextType;
31
+ get classRef(): Newable;
32
+ get handler(): Function;
33
+ get request(): TRequest;
34
+ get response(): TResponse;
35
+ get name(): string;
36
+ }
37
+
38
+ interface MangoRequest<TData = unknown> {
39
+ readonly body: TData;
40
+ }
41
+
42
+ interface MangoResponse {
43
+ send<TData = unknown>(data: TData): void;
44
+ error<TDetails = unknown>(message: string, details?: TDetails): void;
45
+ }
46
+
47
+ interface ExecutionContext<TRequest extends MangoRequest = MangoRequest, TResponse extends MangoResponse = MangoResponse> {
48
+ readonly type: `${ExecutionContextType}`;
49
+ readonly classRef: Newable;
50
+ readonly handler: Function;
51
+ readonly request: TRequest;
52
+ readonly response?: TResponse;
53
+ readonly name: string;
54
+ }
55
+
56
+ export { type ExecutionContext as E, type MangoRequest as M, type MangoResponse as a, ExecutionContextBase as b, MangoRequestBase as c, MangoResponseBase as d };
@@ -0,0 +1,33 @@
1
+ export { EVENT_SERVICE, LOGGER_SERVICE, MODULE_CONTAINER, REFLECTOR_SERVICE, RPC_SERVICE, TIMER_SERVICE } from './constants/index.js';
2
+ export { Body, Catch, Controller, Cron, EveryTick, Global, Index, Inject, Injectable, Interval, Module, On, OnInternal, OnRequest, OnWebView, OnWebViewRequest, Once, OnceInternal, OnceWebView, Optional, Param, Req, Request, Res, Response, SetMetadata, Timeout, UseFilters, UseGuards, UseInterceptors, UsePipes, applyDecorators, createEventDecorator, createParamDecorator, createRPCDecorator, forwardRef } from './decorators/index.js';
3
+ export { ErrorMessage, RPCResultStatus } from './enums/index.js';
4
+ export { I as InjectableScope } from './injectable-scope.enum-CjyQMpW2.js';
5
+ export { GuardCancelError, GuardInvalidReturnError, MangoError, TooManyRequests, UnknownError } from './errors/index.js';
6
+ export { C as ControllerOptions, I as InjectableOptions } from './injectable-options.interface-8Gp9oRY6.js';
7
+ export { a as CallHandler, C as ClassProvider, D as DynamicModule, E as ExistingProvider, F as FactoryProvider, M as ModuleOptions, O as OptionalFactoryDependency, P as Provider, V as ValueProvider } from './call-handler.interface-DVdaknsB.js';
8
+ export { BeforeAppShutdown, OnAppBootstrap, OnAppShutdown, OnModuleDestroy, OnModuleInit } from './interfaces/index.js';
9
+ export { A as ArgumentMetadata, P as Pipe } from './pipe-transform.interface-BlzOrUy3.js';
10
+ export { C as CreateDecoratorOptions, a as CreateDecoratorWithTransformOptions, R as ReflectableDecorator } from './reflectable-decorator.interface-CLOGdtEQ.js';
11
+ export { R as RPCCallOptions } from './rpc-call-options.interface-BJ5mHrvT.js';
12
+ export { R as RPCError } from './rpc-error.interface-CeaZLqzE.js';
13
+ export { R as RPCResult } from './rpc-result.interface-C758heM0.js';
14
+ export { S as ScriptRPCHandler } from './script-rpc-handler.interface-DBpD9-yk.js';
15
+ export { L as LoggerService } from './logger-service.interface-BGV-o_Fx.js';
16
+ export { E as EventHandler, S as ScriptEventHandler } from './script-event-handler.interface-B-Th4Ssg.js';
17
+ export { DefaultValuePipe } from './pipes/index.js';
18
+ export { validateClassProvider, validateControllerOptions, validateErrorFilter, validateEventMetadata, validateEventParameter, validateExistingProvider, validateFactoryProvider, validateGuard, validateInjectableMetadata, validateInjectionToken, validateInterceptor, validateModuleOptions, validatePipe, validateProvider, validateValueProvider } from './schemas/index.js';
19
+ export { ReflectorService, TimerService } from './services/index.js';
20
+ export { Abstract } from './types/index.js';
21
+ export { C as CustomDecorator } from './custom-decorator.type-BHRvXIGz.js';
22
+ export { I as InjectionToken } from './injection-token.type-dQTkkP6p.js';
23
+ export { N as Newable } from './newable.type-BdhG3MZC.js';
24
+ export { N as Nullable } from './nullable.type-C-lE7JU4.js';
25
+ export { generateRandomId, isAsyncFunction, isBoolean, isConstructor, isEmpty, isFunction, isNil, isNumber, isObject, isPromise, isString, isSymbol, isUndefined } from './utils/index.js';
26
+ import './event-metadata.interface-CREizDNq.js';
27
+ import './execution-context.interface-DpRN4oVj.js';
28
+ import './execution-context-type.enum-fwYPtPvp.js';
29
+ import './method-param-type.enum-BfrJ8zqa.js';
30
+ import 'croner';
31
+ import './rpc-metadata.interface-DS-GqgqA.js';
32
+ import 'inversify';
33
+ import './multiplayer-timers.interface-CFDTWwAT.js';