@gravito/stream 1.0.0-alpha.6 → 1.0.0-beta.2
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/README.md +94 -5
- package/dist/index.cjs +2265 -31639
- package/dist/index.d.cts +1814 -0
- package/dist/index.d.ts +1805 -36
- package/dist/index.js +2700 -0
- package/package.json +11 -7
- package/dist/Consumer.d.ts +0 -67
- package/dist/Consumer.d.ts.map +0 -1
- package/dist/Job.d.ts +0 -76
- package/dist/Job.d.ts.map +0 -1
- package/dist/OrbitQueue.d.ts +0 -74
- package/dist/OrbitQueue.d.ts.map +0 -1
- package/dist/QueueManager.d.ts +0 -86
- package/dist/QueueManager.d.ts.map +0 -1
- package/dist/Queueable.d.ts +0 -63
- package/dist/Queueable.d.ts.map +0 -1
- package/dist/Worker.d.ts +0 -48
- package/dist/Worker.d.ts.map +0 -1
- package/dist/core/src/ConfigManager.d.ts +0 -26
- package/dist/core/src/ConfigManager.d.ts.map +0 -1
- package/dist/core/src/Container.d.ts +0 -39
- package/dist/core/src/Container.d.ts.map +0 -1
- package/dist/core/src/Event.d.ts +0 -6
- package/dist/core/src/Event.d.ts.map +0 -1
- package/dist/core/src/EventManager.d.ts +0 -124
- package/dist/core/src/EventManager.d.ts.map +0 -1
- package/dist/core/src/GlobalErrorHandlers.d.ts +0 -32
- package/dist/core/src/GlobalErrorHandlers.d.ts.map +0 -1
- package/dist/core/src/HookManager.d.ts +0 -29
- package/dist/core/src/HookManager.d.ts.map +0 -1
- package/dist/core/src/Listener.d.ts +0 -5
- package/dist/core/src/Listener.d.ts.map +0 -1
- package/dist/core/src/Logger.d.ts +0 -21
- package/dist/core/src/Logger.d.ts.map +0 -1
- package/dist/core/src/PlanetCore.d.ts +0 -116
- package/dist/core/src/PlanetCore.d.ts.map +0 -1
- package/dist/core/src/Route.d.ts +0 -13
- package/dist/core/src/Route.d.ts.map +0 -1
- package/dist/core/src/Router.d.ts +0 -168
- package/dist/core/src/Router.d.ts.map +0 -1
- package/dist/core/src/ServiceProvider.d.ts +0 -17
- package/dist/core/src/ServiceProvider.d.ts.map +0 -1
- package/dist/core/src/exceptions/AuthenticationException.d.ts +0 -5
- package/dist/core/src/exceptions/AuthenticationException.d.ts.map +0 -1
- package/dist/core/src/exceptions/AuthorizationException.d.ts +0 -5
- package/dist/core/src/exceptions/AuthorizationException.d.ts.map +0 -1
- package/dist/core/src/exceptions/GravitoException.d.ts +0 -15
- package/dist/core/src/exceptions/GravitoException.d.ts.map +0 -1
- package/dist/core/src/exceptions/ModelNotFoundException.d.ts +0 -7
- package/dist/core/src/exceptions/ModelNotFoundException.d.ts.map +0 -1
- package/dist/core/src/exceptions/ValidationException.d.ts +0 -15
- package/dist/core/src/exceptions/ValidationException.d.ts.map +0 -1
- package/dist/core/src/exceptions/index.d.ts +0 -6
- package/dist/core/src/exceptions/index.d.ts.map +0 -1
- package/dist/core/src/helpers/Arr.d.ts +0 -15
- package/dist/core/src/helpers/Arr.d.ts.map +0 -1
- package/dist/core/src/helpers/Str.d.ts +0 -19
- package/dist/core/src/helpers/Str.d.ts.map +0 -1
- package/dist/core/src/helpers/data.d.ts +0 -6
- package/dist/core/src/helpers/data.d.ts.map +0 -1
- package/dist/core/src/helpers/errors.d.ts +0 -13
- package/dist/core/src/helpers/errors.d.ts.map +0 -1
- package/dist/core/src/helpers/response.d.ts +0 -19
- package/dist/core/src/helpers/response.d.ts.map +0 -1
- package/dist/core/src/helpers.d.ts +0 -39
- package/dist/core/src/helpers.d.ts.map +0 -1
- package/dist/core/src/http/CookieJar.d.ts +0 -34
- package/dist/core/src/http/CookieJar.d.ts.map +0 -1
- package/dist/core/src/http/middleware/ThrottleRequests.d.ts +0 -13
- package/dist/core/src/http/middleware/ThrottleRequests.d.ts.map +0 -1
- package/dist/core/src/index.d.ts +0 -32
- package/dist/core/src/index.d.ts.map +0 -1
- package/dist/core/src/security/Encrypter.d.ts +0 -25
- package/dist/core/src/security/Encrypter.d.ts.map +0 -1
- package/dist/core/src/security/Hasher.d.ts +0 -30
- package/dist/core/src/security/Hasher.d.ts.map +0 -1
- package/dist/core/src/types/events.d.ts +0 -95
- package/dist/core/src/types/events.d.ts.map +0 -1
- package/dist/drivers/DatabaseDriver.d.ts +0 -60
- package/dist/drivers/DatabaseDriver.d.ts.map +0 -1
- package/dist/drivers/KafkaDriver.d.ts +0 -134
- package/dist/drivers/KafkaDriver.d.ts.map +0 -1
- package/dist/drivers/MemoryDriver.d.ts +0 -45
- package/dist/drivers/MemoryDriver.d.ts.map +0 -1
- package/dist/drivers/QueueDriver.d.ts +0 -89
- package/dist/drivers/QueueDriver.d.ts.map +0 -1
- package/dist/drivers/RedisDriver.d.ts +0 -79
- package/dist/drivers/RedisDriver.d.ts.map +0 -1
- package/dist/drivers/SQSDriver.d.ts +0 -100
- package/dist/drivers/SQSDriver.d.ts.map +0 -1
- package/dist/index.cjs.map +0 -422
- package/dist/index.d.ts.map +0 -1
- package/dist/index.mjs +0 -32096
- package/dist/index.mjs.map +0 -422
- package/dist/orbit-db/src/DBService.d.ts +0 -270
- package/dist/orbit-db/src/DBService.d.ts.map +0 -1
- package/dist/orbit-db/src/EventBus.d.ts +0 -53
- package/dist/orbit-db/src/EventBus.d.ts.map +0 -1
- package/dist/orbit-db/src/MigrationDriver.d.ts +0 -55
- package/dist/orbit-db/src/MigrationDriver.d.ts.map +0 -1
- package/dist/orbit-db/src/Model.d.ts +0 -564
- package/dist/orbit-db/src/Model.d.ts.map +0 -1
- package/dist/orbit-db/src/ModelCollection.d.ts +0 -35
- package/dist/orbit-db/src/ModelCollection.d.ts.map +0 -1
- package/dist/orbit-db/src/index.d.ts +0 -34
- package/dist/orbit-db/src/index.d.ts.map +0 -1
- package/dist/orbit-db/src/types.d.ts +0 -146
- package/dist/orbit-db/src/types.d.ts.map +0 -1
- package/dist/orbit-queue/src/Consumer.d.ts +0 -67
- package/dist/orbit-queue/src/Consumer.d.ts.map +0 -1
- package/dist/orbit-queue/src/Job.d.ts +0 -76
- package/dist/orbit-queue/src/Job.d.ts.map +0 -1
- package/dist/orbit-queue/src/OrbitQueue.d.ts +0 -74
- package/dist/orbit-queue/src/OrbitQueue.d.ts.map +0 -1
- package/dist/orbit-queue/src/QueueManager.d.ts +0 -86
- package/dist/orbit-queue/src/QueueManager.d.ts.map +0 -1
- package/dist/orbit-queue/src/Queueable.d.ts +0 -63
- package/dist/orbit-queue/src/Queueable.d.ts.map +0 -1
- package/dist/orbit-queue/src/Worker.d.ts +0 -48
- package/dist/orbit-queue/src/Worker.d.ts.map +0 -1
- package/dist/orbit-queue/src/drivers/DatabaseDriver.d.ts +0 -60
- package/dist/orbit-queue/src/drivers/DatabaseDriver.d.ts.map +0 -1
- package/dist/orbit-queue/src/drivers/KafkaDriver.d.ts +0 -134
- package/dist/orbit-queue/src/drivers/KafkaDriver.d.ts.map +0 -1
- package/dist/orbit-queue/src/drivers/MemoryDriver.d.ts +0 -45
- package/dist/orbit-queue/src/drivers/MemoryDriver.d.ts.map +0 -1
- package/dist/orbit-queue/src/drivers/QueueDriver.d.ts +0 -89
- package/dist/orbit-queue/src/drivers/QueueDriver.d.ts.map +0 -1
- package/dist/orbit-queue/src/drivers/RedisDriver.d.ts +0 -79
- package/dist/orbit-queue/src/drivers/RedisDriver.d.ts.map +0 -1
- package/dist/orbit-queue/src/drivers/SQSDriver.d.ts +0 -100
- package/dist/orbit-queue/src/drivers/SQSDriver.d.ts.map +0 -1
- package/dist/orbit-queue/src/index.d.ts +0 -45
- package/dist/orbit-queue/src/index.d.ts.map +0 -1
- package/dist/orbit-queue/src/serializers/ClassNameSerializer.d.ts +0 -46
- package/dist/orbit-queue/src/serializers/ClassNameSerializer.d.ts.map +0 -1
- package/dist/orbit-queue/src/serializers/JobSerializer.d.ts +0 -36
- package/dist/orbit-queue/src/serializers/JobSerializer.d.ts.map +0 -1
- package/dist/orbit-queue/src/serializers/JsonSerializer.d.ts +0 -32
- package/dist/orbit-queue/src/serializers/JsonSerializer.d.ts.map +0 -1
- package/dist/orbit-queue/src/types.d.ts +0 -85
- package/dist/orbit-queue/src/types.d.ts.map +0 -1
- package/dist/serializers/ClassNameSerializer.d.ts +0 -46
- package/dist/serializers/ClassNameSerializer.d.ts.map +0 -1
- package/dist/serializers/JobSerializer.d.ts +0 -36
- package/dist/serializers/JobSerializer.d.ts.map +0 -1
- package/dist/serializers/JsonSerializer.d.ts +0 -32
- package/dist/serializers/JsonSerializer.d.ts.map +0 -1
- package/dist/types.d.ts +0 -85
- package/dist/types.d.ts.map +0 -1
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
import { Event } from './Event';
|
|
2
|
-
import type { Listener } from './Listener';
|
|
3
|
-
import type { PlanetCore } from './PlanetCore';
|
|
4
|
-
/**
|
|
5
|
-
* Listener registration metadata.
|
|
6
|
-
*/
|
|
7
|
-
interface ListenerRegistration<TEvent extends Event = Event> {
|
|
8
|
-
listener: Listener<TEvent> | (new () => Listener<TEvent>);
|
|
9
|
-
queue?: string;
|
|
10
|
-
connection?: string;
|
|
11
|
-
delay?: number;
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Event manager.
|
|
15
|
-
*
|
|
16
|
-
* Provides type-safe event dispatching and listener registration.
|
|
17
|
-
* Supports both synchronous listeners and asynchronous (queued) listeners.
|
|
18
|
-
*
|
|
19
|
-
* @example
|
|
20
|
-
* ```typescript
|
|
21
|
-
* class UserRegistered extends Event {
|
|
22
|
-
* constructor(public user: User) {
|
|
23
|
-
* super()
|
|
24
|
-
* }
|
|
25
|
-
* }
|
|
26
|
-
*
|
|
27
|
-
* class SendWelcomeEmail implements Listener<UserRegistered> {
|
|
28
|
-
* async handle(event: UserRegistered): Promise<void> {
|
|
29
|
-
* // send welcome email
|
|
30
|
-
* }
|
|
31
|
-
* }
|
|
32
|
-
*
|
|
33
|
-
* // Register listener
|
|
34
|
-
* core.events.listen(UserRegistered, SendWelcomeEmail)
|
|
35
|
-
*
|
|
36
|
-
* // Dispatch event
|
|
37
|
-
* await core.events.dispatch(new UserRegistered(user))
|
|
38
|
-
* ```
|
|
39
|
-
*/
|
|
40
|
-
export declare class EventManager {
|
|
41
|
-
private core;
|
|
42
|
-
/**
|
|
43
|
-
* Listener registry.
|
|
44
|
-
* Key: event class or event name
|
|
45
|
-
* Value: listener registrations
|
|
46
|
-
*/
|
|
47
|
-
private listeners;
|
|
48
|
-
/**
|
|
49
|
-
* Broadcast manager (optional, injected by `orbit-broadcasting`).
|
|
50
|
-
*/
|
|
51
|
-
private broadcastManager;
|
|
52
|
-
/**
|
|
53
|
-
* Queue manager (optional, injected by `orbit-queue`).
|
|
54
|
-
*/
|
|
55
|
-
private queueManager;
|
|
56
|
-
constructor(core: PlanetCore);
|
|
57
|
-
/**
|
|
58
|
-
* Register the broadcast manager (called by `orbit-broadcasting`).
|
|
59
|
-
*/
|
|
60
|
-
setBroadcastManager(manager: EventManager['broadcastManager']): void;
|
|
61
|
-
/**
|
|
62
|
-
* Register the queue manager (called by `orbit-queue`).
|
|
63
|
-
*/
|
|
64
|
-
setQueueManager(manager: EventManager['queueManager']): void;
|
|
65
|
-
/**
|
|
66
|
-
* Register an event listener.
|
|
67
|
-
*
|
|
68
|
-
* @param event - Event class or event name
|
|
69
|
-
* @param listener - Listener instance or listener class
|
|
70
|
-
* @param options - Optional queue options
|
|
71
|
-
*
|
|
72
|
-
* @example
|
|
73
|
-
* ```typescript
|
|
74
|
-
* // Synchronous listener
|
|
75
|
-
* core.events.listen(UserRegistered, SendWelcomeEmail)
|
|
76
|
-
*
|
|
77
|
-
* // Queued listener (async)
|
|
78
|
-
* core.events.listen(UserRegistered, SendWelcomeEmail, {
|
|
79
|
-
* queue: 'emails',
|
|
80
|
-
* delay: 60
|
|
81
|
-
* })
|
|
82
|
-
* ```
|
|
83
|
-
*/
|
|
84
|
-
listen<TEvent extends Event>(event: string | (new (...args: unknown[]) => TEvent), listener: Listener<TEvent> | (new () => Listener<TEvent>), options?: {
|
|
85
|
-
queue?: string;
|
|
86
|
-
connection?: string;
|
|
87
|
-
delay?: number;
|
|
88
|
-
}): void;
|
|
89
|
-
/**
|
|
90
|
-
* Remove an event listener.
|
|
91
|
-
*
|
|
92
|
-
* @param event - Event class or event name
|
|
93
|
-
* @param listener - Listener to remove
|
|
94
|
-
*/
|
|
95
|
-
unlisten<TEvent extends Event>(event: string | (new (...args: unknown[]) => TEvent), listener: Listener<TEvent> | (new () => Listener<TEvent>)): void;
|
|
96
|
-
/**
|
|
97
|
-
* Dispatch an event.
|
|
98
|
-
*
|
|
99
|
-
* Runs all registered listeners. If a listener implements `ShouldQueue` or
|
|
100
|
-
* has queue options, the listener will be pushed to the queue for async execution.
|
|
101
|
-
*
|
|
102
|
-
* @param event - Event instance
|
|
103
|
-
*
|
|
104
|
-
* @example
|
|
105
|
-
* ```typescript
|
|
106
|
-
* await core.events.dispatch(new UserRegistered(user))
|
|
107
|
-
* ```
|
|
108
|
-
*/
|
|
109
|
-
dispatch<TEvent extends Event>(event: TEvent): Promise<void>;
|
|
110
|
-
/**
|
|
111
|
-
* Serialize an event (for queueing).
|
|
112
|
-
*/
|
|
113
|
-
private serializeEvent;
|
|
114
|
-
/**
|
|
115
|
-
* Get all registered listeners.
|
|
116
|
-
*/
|
|
117
|
-
getListeners(event?: string | (new () => Event)): ListenerRegistration[];
|
|
118
|
-
/**
|
|
119
|
-
* Clear all listeners.
|
|
120
|
-
*/
|
|
121
|
-
clear(): void;
|
|
122
|
-
}
|
|
123
|
-
export {};
|
|
124
|
-
//# sourceMappingURL=EventManager.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"EventManager.d.ts","sourceRoot":"","sources":["../../../../core/src/EventManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAC/B,OAAO,KAAK,EAAE,QAAQ,EAAe,MAAM,YAAY,CAAA;AACvD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAE9C;;GAEG;AACH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AE,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,UAAU,QAAQ,CAAC,MAAM,CAAC,CAAC,GACxD,IAAI;IAeP;;;;;;;;;;;;OAYG;IACG,QAAQ,CAAC,MAAM,SAAS,KAAK,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAgFlE;;OAEG;IACH,OAAO,CAAC,cAAc;IAUtB;;OAEG;IACH,YAAY,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,CAAC,UAAU,KAAK,CAAC,GAAG,oBAAoB,EAAE;IAYxE;;OAEG;IACH,KAAK,IAAI,IAAI;CAGd"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import type { Logger } from './Logger';
|
|
2
|
-
import type { PlanetCore } from './PlanetCore';
|
|
3
|
-
export type GlobalProcessErrorKind = 'unhandledRejection' | 'uncaughtException';
|
|
4
|
-
export type GlobalProcessErrorHandlerContext = {
|
|
5
|
-
core?: PlanetCore;
|
|
6
|
-
kind: GlobalProcessErrorKind;
|
|
7
|
-
error: unknown;
|
|
8
|
-
isProduction: boolean;
|
|
9
|
-
timestamp: number;
|
|
10
|
-
logLevel?: 'error' | 'warn' | 'info' | 'none';
|
|
11
|
-
logMessage?: string;
|
|
12
|
-
exit?: boolean;
|
|
13
|
-
exitCode?: number;
|
|
14
|
-
gracePeriodMs?: number;
|
|
15
|
-
};
|
|
16
|
-
export type GlobalErrorHandlersMode = 'log' | 'exit' | 'exitInProduction';
|
|
17
|
-
export type RegisterGlobalErrorHandlersOptions = {
|
|
18
|
-
core?: PlanetCore;
|
|
19
|
-
logger?: Logger;
|
|
20
|
-
mode?: GlobalErrorHandlersMode;
|
|
21
|
-
exitCode?: number;
|
|
22
|
-
gracePeriodMs?: number;
|
|
23
|
-
};
|
|
24
|
-
/**
|
|
25
|
-
* Register process-level error handlers (`unhandledRejection` / `uncaughtException`).
|
|
26
|
-
*
|
|
27
|
-
* - `mode: "log"`: only log/report
|
|
28
|
-
* - `mode: "exit"`: report then `process.exit(exitCode)`
|
|
29
|
-
* - `mode: "exitInProduction"`: exit only when `NODE_ENV=production` (default)
|
|
30
|
-
*/
|
|
31
|
-
export declare function registerGlobalErrorHandlers(options?: RegisterGlobalErrorHandlersOptions): () => void;
|
|
32
|
-
//# sourceMappingURL=GlobalErrorHandlers.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"GlobalErrorHandlers.d.ts","sourceRoot":"","sources":["../../../../core/src/GlobalErrorHandlers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACtC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAE9C,MAAM,MAAM,sBAAsB,GAAG,oBAAoB,GAAG,mBAAmB,CAAA;AAE/E,MAAM,MAAM,gCAAgC,GAAG;IAC7C,IAAI,CAAC,EAAE,UAAU,CAAA;IACjB,IAAI,EAAE,sBAAsB,CAAA;IAC5B,KAAK,EAAE,OAAO,CAAA;IACd,YAAY,EAAE,OAAO,CAAA;IACrB,SAAS,EAAE,MAAM,CAAA;IACjB,QAAQ,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAA;IAC7C,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB,CAAA;AAED,MAAM,MAAM,uBAAuB,GAAG,KAAK,GAAG,MAAM,GAAG,kBAAkB,CAAA;AAEzE,MAAM,MAAM,kCAAkC,GAAG;IAC/C,IAAI,CAAC,EAAE,UAAU,CAAA;IACjB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,IAAI,CAAC,EAAE,uBAAuB,CAAA;IAC9B,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB,CAAA;AA6LD;;;;;;GAMG;AACH,wBAAgB,2BAA2B,CACzC,OAAO,GAAE,kCAAuC,GAC/C,MAAM,IAAI,CAcZ"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
export type FilterCallback<T = unknown> = (value: T, ...args: unknown[]) => Promise<T> | T;
|
|
2
|
-
export type ActionCallback<TArgs = unknown> = (args: TArgs) => Promise<void> | void;
|
|
3
|
-
export declare class HookManager {
|
|
4
|
-
private filters;
|
|
5
|
-
private actions;
|
|
6
|
-
/**
|
|
7
|
-
* Register a filter hook.
|
|
8
|
-
*
|
|
9
|
-
* Filters are used to transform a value (input/output).
|
|
10
|
-
*/
|
|
11
|
-
addFilter<T = unknown>(hook: string, callback: FilterCallback<T>): void;
|
|
12
|
-
/**
|
|
13
|
-
* Apply all registered filters sequentially.
|
|
14
|
-
*
|
|
15
|
-
* Each callback receives the previous callback's return value.
|
|
16
|
-
*/
|
|
17
|
-
applyFilters<T = unknown>(hook: string, initialValue: T, ...args: unknown[]): Promise<T>;
|
|
18
|
-
/**
|
|
19
|
-
* Register an action hook.
|
|
20
|
-
*
|
|
21
|
-
* Actions are for side effects (no return value).
|
|
22
|
-
*/
|
|
23
|
-
addAction<TArgs = unknown>(hook: string, callback: ActionCallback<TArgs>): void;
|
|
24
|
-
/**
|
|
25
|
-
* Run all registered actions sequentially.
|
|
26
|
-
*/
|
|
27
|
-
doAction<TArgs = unknown>(hook: string, args: TArgs): Promise<void>;
|
|
28
|
-
}
|
|
29
|
-
//# sourceMappingURL=HookManager.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"HookManager.d.ts","sourceRoot":"","sources":["../../../../core/src/HookManager.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,cAAc,CAAC,CAAC,GAAG,OAAO,IAAI,CAAC,KAAK,EAAE,CAAC,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAA;AAC1F,MAAM,MAAM,cAAc,CAAC,KAAK,GAAG,OAAO,IAAI,CAAC,IAAI,EAAE,KAAK,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAA;AAEnF,qBAAa,WAAW;IACtB,OAAO,CAAC,OAAO,CAA2C;IAC1D,OAAO,CAAC,OAAO,CAA2C;IAE1D;;;;OAIG;IACH,SAAS,CAAC,CAAC,GAAG,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,cAAc,CAAC,CAAC,CAAC,GAAG,IAAI;IAQvE;;;;OAIG;IACG,YAAY,CAAC,CAAC,GAAG,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,CAAC,CAAC;IAgB9F;;;;OAIG;IACH,SAAS,CAAC,KAAK,GAAG,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,cAAc,CAAC,KAAK,CAAC,GAAG,IAAI;IAQ/E;;OAEG;IACG,QAAQ,CAAC,KAAK,GAAG,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC;CAW1E"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Listener.d.ts","sourceRoot":"","sources":["../../../../core/src/Listener.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,YAAY,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Standard logger interface.
|
|
3
|
-
*
|
|
4
|
-
* PSR-3 inspired API for easy swapping (e.g., Winston, Pino).
|
|
5
|
-
*/
|
|
6
|
-
export interface Logger {
|
|
7
|
-
debug(message: string, ...args: unknown[]): void;
|
|
8
|
-
info(message: string, ...args: unknown[]): void;
|
|
9
|
-
warn(message: string, ...args: unknown[]): void;
|
|
10
|
-
error(message: string, ...args: unknown[]): void;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Default console logger implementation.
|
|
14
|
-
*/
|
|
15
|
-
export declare class ConsoleLogger implements Logger {
|
|
16
|
-
debug(message: string, ...args: unknown[]): void;
|
|
17
|
-
info(message: string, ...args: unknown[]): void;
|
|
18
|
-
warn(message: string, ...args: unknown[]): void;
|
|
19
|
-
error(message: string, ...args: unknown[]): void;
|
|
20
|
-
}
|
|
21
|
-
//# sourceMappingURL=Logger.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Logger.d.ts","sourceRoot":"","sources":["../../../../core/src/Logger.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,WAAW,MAAM;IACrB,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAA;IAChD,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAA;IAC/C,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAA;IAC/C,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAA;CACjD;AAED;;GAEG;AACH,qBAAa,aAAc,YAAW,MAAM;IAC1C,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI;IAIhD,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI;IAI/C,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI;IAI/C,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI;CAGjD"}
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
import type { Context } from 'hono';
|
|
2
|
-
import { Hono } from 'hono';
|
|
3
|
-
import type { ContentfulStatusCode } from 'hono/utils/http-status';
|
|
4
|
-
import { ConfigManager } from './ConfigManager';
|
|
5
|
-
import { Container } from './Container';
|
|
6
|
-
import { EventManager } from './EventManager';
|
|
7
|
-
import { type RegisterGlobalErrorHandlersOptions } from './GlobalErrorHandlers';
|
|
8
|
-
import { HookManager } from './HookManager';
|
|
9
|
-
import { fail } from './helpers/response';
|
|
10
|
-
import { type Logger } from './Logger';
|
|
11
|
-
import type { ServiceProvider } from './ServiceProvider';
|
|
12
|
-
/**
|
|
13
|
-
* CacheService interface for orbit-injected cache
|
|
14
|
-
* Orbits implementing cache should conform to this interface
|
|
15
|
-
*/
|
|
16
|
-
export interface CacheService {
|
|
17
|
-
get<T = unknown>(key: string): Promise<T | null>;
|
|
18
|
-
set(key: string, value: unknown, ttl?: number): Promise<void>;
|
|
19
|
-
delete(key: string): Promise<void>;
|
|
20
|
-
clear(): Promise<void>;
|
|
21
|
-
remember<T>(key: string, ttl: number, callback: () => Promise<T>): Promise<T>;
|
|
22
|
-
}
|
|
23
|
-
export interface ViewService {
|
|
24
|
-
render(view: string, data?: Record<string, unknown>, options?: Record<string, unknown>): string;
|
|
25
|
-
}
|
|
26
|
-
export type ErrorHandlerContext = {
|
|
27
|
-
core: PlanetCore;
|
|
28
|
-
c: Context;
|
|
29
|
-
error: unknown;
|
|
30
|
-
isProduction: boolean;
|
|
31
|
-
accept: string;
|
|
32
|
-
wantsHtml: boolean;
|
|
33
|
-
status: ContentfulStatusCode;
|
|
34
|
-
payload: ReturnType<typeof fail>;
|
|
35
|
-
logLevel?: 'error' | 'warn' | 'info' | 'none';
|
|
36
|
-
logMessage?: string;
|
|
37
|
-
html?: {
|
|
38
|
-
templates: string[];
|
|
39
|
-
data: Record<string, unknown>;
|
|
40
|
-
};
|
|
41
|
-
};
|
|
42
|
-
type RouteParams = Record<string, string | number>;
|
|
43
|
-
type RouteQuery = Record<string, string | number | boolean | null | undefined>;
|
|
44
|
-
type Variables = {
|
|
45
|
-
core: PlanetCore;
|
|
46
|
-
logger: Logger;
|
|
47
|
-
config: ConfigManager;
|
|
48
|
-
cookieJar: CookieJar;
|
|
49
|
-
route: (name: string, params?: RouteParams, query?: RouteQuery) => string;
|
|
50
|
-
cache?: CacheService;
|
|
51
|
-
view?: ViewService;
|
|
52
|
-
i18n?: unknown;
|
|
53
|
-
session?: unknown;
|
|
54
|
-
routeModels?: Record<string, unknown>;
|
|
55
|
-
};
|
|
56
|
-
export interface GravitoOrbit {
|
|
57
|
-
install(core: PlanetCore): void | Promise<void>;
|
|
58
|
-
}
|
|
59
|
-
export type GravitoConfig = {
|
|
60
|
-
logger?: Logger;
|
|
61
|
-
config?: Record<string, unknown>;
|
|
62
|
-
orbits?: (new () => GravitoOrbit)[] | GravitoOrbit[];
|
|
63
|
-
};
|
|
64
|
-
import { CookieJar } from './http/CookieJar';
|
|
65
|
-
import { Router } from './Router';
|
|
66
|
-
import { Encrypter } from './security/Encrypter';
|
|
67
|
-
import { BunHasher } from './security/Hasher';
|
|
68
|
-
export declare class PlanetCore {
|
|
69
|
-
app: Hono<{
|
|
70
|
-
Variables: Variables;
|
|
71
|
-
}>;
|
|
72
|
-
logger: Logger;
|
|
73
|
-
config: ConfigManager;
|
|
74
|
-
hooks: HookManager;
|
|
75
|
-
events: EventManager;
|
|
76
|
-
router: Router;
|
|
77
|
-
container: Container;
|
|
78
|
-
/** @deprecated Use core.container instead */
|
|
79
|
-
services: Map<string, unknown>;
|
|
80
|
-
encrypter?: Encrypter;
|
|
81
|
-
hasher: BunHasher;
|
|
82
|
-
private providers;
|
|
83
|
-
/**
|
|
84
|
-
* Register a service provider
|
|
85
|
-
*/
|
|
86
|
-
register(provider: ServiceProvider): this;
|
|
87
|
-
/**
|
|
88
|
-
* Bootstrap the application by registering and booting providers
|
|
89
|
-
*/
|
|
90
|
-
bootstrap(): Promise<void>;
|
|
91
|
-
constructor(options?: {
|
|
92
|
-
logger?: Logger;
|
|
93
|
-
config?: Record<string, unknown>;
|
|
94
|
-
});
|
|
95
|
-
registerGlobalErrorHandlers(options?: Omit<RegisterGlobalErrorHandlersOptions, 'core'>): () => void;
|
|
96
|
-
/**
|
|
97
|
-
* Boot the application with a configuration object (IoC style default entry)
|
|
98
|
-
*/
|
|
99
|
-
static boot(config: GravitoConfig): Promise<PlanetCore>;
|
|
100
|
-
/**
|
|
101
|
-
* Mount an Orbit (a Hono app) to a path.
|
|
102
|
-
*/
|
|
103
|
-
mountOrbit(path: string, orbitApp: Hono): void;
|
|
104
|
-
/**
|
|
105
|
-
* Start the core (Liftoff).
|
|
106
|
-
*
|
|
107
|
-
* Returns a config object for `Bun.serve`.
|
|
108
|
-
*/
|
|
109
|
-
liftoff(port?: number): {
|
|
110
|
-
port: number;
|
|
111
|
-
fetch: (request: Request, server?: unknown) => Response | Promise<Response>;
|
|
112
|
-
core: PlanetCore;
|
|
113
|
-
};
|
|
114
|
-
}
|
|
115
|
-
export {};
|
|
116
|
-
//# sourceMappingURL=PlanetCore.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PlanetCore.d.ts","sourceRoot":"","sources":["../../../../core/src/PlanetCore.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AACnC,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAE3B,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAG7C,OAAO,EACL,KAAK,kCAAkC,EAExC,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,WA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H,OAAO,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG;QACtB,IAAI,EAAE,MAAM,CAAA;QACZ,KAAK,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,OAAO,KAAK,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAA;QAC3E,IAAI,EAAE,UAAU,CAAA;KACjB;CAeF"}
|
package/dist/core/src/Route.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { RouteOptions, Router } from './Router';
|
|
2
|
-
export declare class Route {
|
|
3
|
-
private router;
|
|
4
|
-
private method;
|
|
5
|
-
private path;
|
|
6
|
-
private options;
|
|
7
|
-
constructor(router: Router, method: string, path: string, options: RouteOptions);
|
|
8
|
-
/**
|
|
9
|
-
* Name the route
|
|
10
|
-
*/
|
|
11
|
-
name(name: string): this;
|
|
12
|
-
}
|
|
13
|
-
//# sourceMappingURL=Route.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Route.d.ts","sourceRoot":"","sources":["../../../../core/src/Route.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAEpD,qBAAa,KAAK;IAEd,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,IAAI;IACZ,OAAO,CAAC,OAAO;gBAHP,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,YAAY;IAG/B;;OAEG;IACH,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;CAIzB"}
|
|
@@ -1,168 +0,0 @@
|
|
|
1
|
-
import type { Handler, MiddlewareHandler } from 'hono';
|
|
2
|
-
import type { PlanetCore } from './PlanetCore';
|
|
3
|
-
import { Route } from './Route';
|
|
4
|
-
export type ControllerClass = new (core: PlanetCore) => Record<string, unknown>;
|
|
5
|
-
export type RouteHandler = Handler | [ControllerClass, string];
|
|
6
|
-
/**
|
|
7
|
-
* Interface for FormRequest classes (from @gravito/orbit-request).
|
|
8
|
-
* Used for duck-typing detection without hard dependency.
|
|
9
|
-
*/
|
|
10
|
-
export interface FormRequestLike {
|
|
11
|
-
schema: unknown;
|
|
12
|
-
source?: string;
|
|
13
|
-
validate?(ctx: unknown): Promise<{
|
|
14
|
-
success: boolean;
|
|
15
|
-
data?: unknown;
|
|
16
|
-
error?: unknown;
|
|
17
|
-
}>;
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Type for FormRequest class constructor
|
|
21
|
-
*/
|
|
22
|
-
export type FormRequestClass = new () => FormRequestLike;
|
|
23
|
-
export interface RouteOptions {
|
|
24
|
-
prefix?: string;
|
|
25
|
-
domain?: string;
|
|
26
|
-
middleware?: MiddlewareHandler[];
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* RouteGroup
|
|
30
|
-
* Helper class for chained route configuration (prefix, domain, etc.)
|
|
31
|
-
*/
|
|
32
|
-
export declare class RouteGroup {
|
|
33
|
-
private router;
|
|
34
|
-
private options;
|
|
35
|
-
constructor(router: Router, options: RouteOptions);
|
|
36
|
-
/**
|
|
37
|
-
* Add a prefix to the current group
|
|
38
|
-
*/
|
|
39
|
-
prefix(path: string): RouteGroup;
|
|
40
|
-
/**
|
|
41
|
-
* Add middleware to the current group.
|
|
42
|
-
* Accepts individual handlers or arrays of handlers.
|
|
43
|
-
*/
|
|
44
|
-
middleware(...handlers: (MiddlewareHandler | MiddlewareHandler[])[]): RouteGroup;
|
|
45
|
-
/**
|
|
46
|
-
* Define routes within this group
|
|
47
|
-
*/
|
|
48
|
-
group(callback: (router: Router | RouteGroup) => void): void;
|
|
49
|
-
get(path: string, handler: RouteHandler): Route;
|
|
50
|
-
get(path: string, request: FormRequestClass, handler: RouteHandler): Route;
|
|
51
|
-
post(path: string, handler: RouteHandler): Route;
|
|
52
|
-
post(path: string, request: FormRequestClass, handler: RouteHandler): Route;
|
|
53
|
-
put(path: string, handler: RouteHandler): Route;
|
|
54
|
-
put(path: string, request: FormRequestClass, handler: RouteHandler): Route;
|
|
55
|
-
delete(path: string, handler: RouteHandler): Route;
|
|
56
|
-
delete(path: string, request: FormRequestClass, handler: RouteHandler): Route;
|
|
57
|
-
patch(path: string, handler: RouteHandler): Route;
|
|
58
|
-
patch(path: string, request: FormRequestClass, handler: RouteHandler): Route;
|
|
59
|
-
resource(name: string, controller: ControllerClass, options?: ResourceOptions): void;
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* Gravito Router
|
|
63
|
-
*
|
|
64
|
-
* Provides a Laravel-like fluent API for defining routes.
|
|
65
|
-
* Supports:
|
|
66
|
-
* - Controller-based routing: router.get('/', [HomeController, 'index'])
|
|
67
|
-
* - Route groups with prefixes: router.prefix('/api').group(...)
|
|
68
|
-
* - Domain-based routing: router.domain('api.app').group(...)
|
|
69
|
-
* - Middleware chaining: router.middleware(auth).group(...)
|
|
70
|
-
* - FormRequest validation: router.post('/users', StoreUserRequest, [UserController, 'store'])
|
|
71
|
-
*/
|
|
72
|
-
export declare class Router {
|
|
73
|
-
private core;
|
|
74
|
-
private controllers;
|
|
75
|
-
private namedRoutes;
|
|
76
|
-
private bindings;
|
|
77
|
-
/**
|
|
78
|
-
* Compile all registered routes into a flat array for caching or manifest generation.
|
|
79
|
-
*/
|
|
80
|
-
compile(): {
|
|
81
|
-
method: string;
|
|
82
|
-
path: string;
|
|
83
|
-
name?: string;
|
|
84
|
-
domain?: string | undefined;
|
|
85
|
-
}[];
|
|
86
|
-
/**
|
|
87
|
-
* Register a named route
|
|
88
|
-
*/
|
|
89
|
-
registerName(name: string, method: string, path: string, options?: RouteOptions): void;
|
|
90
|
-
/**
|
|
91
|
-
* Generate a URL from a named route.
|
|
92
|
-
*
|
|
93
|
-
* @example
|
|
94
|
-
* router.url('users.show', { id: 1 })
|
|
95
|
-
* router.url('users.show', { id: 1 }, { tab: 'profile' })
|
|
96
|
-
*/
|
|
97
|
-
url(name: string, params?: Record<string, string | number>, query?: Record<string, string | number | boolean | null | undefined>): string;
|
|
98
|
-
/**
|
|
99
|
-
* Export named routes as a serializable manifest (for caching).
|
|
100
|
-
*/
|
|
101
|
-
exportNamedRoutes(): Record<string, {
|
|
102
|
-
method: string;
|
|
103
|
-
path: string;
|
|
104
|
-
domain?: string;
|
|
105
|
-
}>;
|
|
106
|
-
/**
|
|
107
|
-
* Load named routes from a manifest (for caching).
|
|
108
|
-
*
|
|
109
|
-
* This is intentionally scoped to URL generation and introspection only.
|
|
110
|
-
* It does not affect the HTTP router matcher (Hono still needs route registrations).
|
|
111
|
-
*/
|
|
112
|
-
loadNamedRoutes(manifest: Record<string, {
|
|
113
|
-
method: string;
|
|
114
|
-
path: string;
|
|
115
|
-
domain?: string;
|
|
116
|
-
}>): void;
|
|
117
|
-
/**
|
|
118
|
-
* Register a route model binding.
|
|
119
|
-
*/
|
|
120
|
-
bind(param: string, resolver: (id: string) => Promise<unknown>): void;
|
|
121
|
-
/**
|
|
122
|
-
* Register a route model binding for a Model class.
|
|
123
|
-
*/
|
|
124
|
-
model(param: string, modelClass: unknown): void;
|
|
125
|
-
constructor(core: PlanetCore);
|
|
126
|
-
/**
|
|
127
|
-
* Start a route group with a prefix
|
|
128
|
-
*/
|
|
129
|
-
prefix(path: string): RouteGroup;
|
|
130
|
-
/**
|
|
131
|
-
* Start a route group with a domain constraint
|
|
132
|
-
*/
|
|
133
|
-
domain(host: string): RouteGroup;
|
|
134
|
-
/**
|
|
135
|
-
* Start a route group with middleware.
|
|
136
|
-
* Accepts individual handlers or arrays of handlers.
|
|
137
|
-
*/
|
|
138
|
-
middleware(...handlers: (MiddlewareHandler | MiddlewareHandler[])[]): RouteGroup;
|
|
139
|
-
get(path: string, handler: RouteHandler): Route;
|
|
140
|
-
get(path: string, request: FormRequestClass, handler: RouteHandler): Route;
|
|
141
|
-
post(path: string, handler: RouteHandler): Route;
|
|
142
|
-
post(path: string, request: FormRequestClass, handler: RouteHandler): Route;
|
|
143
|
-
put(path: string, handler: RouteHandler): Route;
|
|
144
|
-
put(path: string, request: FormRequestClass, handler: RouteHandler): Route;
|
|
145
|
-
delete(path: string, handler: RouteHandler): Route;
|
|
146
|
-
delete(path: string, request: FormRequestClass, handler: RouteHandler): Route;
|
|
147
|
-
patch(path: string, handler: RouteHandler): Route;
|
|
148
|
-
patch(path: string, request: FormRequestClass, handler: RouteHandler): Route;
|
|
149
|
-
/**
|
|
150
|
-
* Register a resource route (Laravel-style).
|
|
151
|
-
* Creates index, create, store, show, edit, update, destroy routes.
|
|
152
|
-
*/
|
|
153
|
-
resource(name: string, controller: ControllerClass, options?: ResourceOptions): void;
|
|
154
|
-
/**
|
|
155
|
-
* Internal Request Registration
|
|
156
|
-
*/
|
|
157
|
-
req(method: string, path: string, requestOrHandler: FormRequestClass | RouteHandler, handler?: RouteHandler, options?: RouteOptions): Route;
|
|
158
|
-
/**
|
|
159
|
-
* Resolve Controller Instance and Method
|
|
160
|
-
*/
|
|
161
|
-
private resolveControllerHandler;
|
|
162
|
-
}
|
|
163
|
-
export type ResourceAction = 'index' | 'create' | 'store' | 'show' | 'edit' | 'update' | 'destroy';
|
|
164
|
-
export interface ResourceOptions {
|
|
165
|
-
only?: ResourceAction[];
|
|
166
|
-
except?: ResourceAction[];
|
|
167
|
-
}
|
|
168
|
-
//# sourceMappingURL=Router.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Router.d.ts","sourceRoot":"","sources":["../../../../core/src/Router.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAA;AAEtD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAC9C,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAG/B,MAAM,MAAM,eAAe,GAAG,KAAK,IAAI,EAAE,UAAU,KAAK,MAAM,CAAC,MAA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from './PlanetCore';
|
|
3
|
-
export declare abstract class ServiceProvider {
|
|
4
|
-
/**
|
|
5
|
-
* Register bindings in the container.
|
|
6
|
-
* This method is called during the registration phase.
|
|
7
|
-
* Do not use 'make' here if relying on other providers.
|
|
8
|
-
*/
|
|
9
|
-
abstract register(container: Container): void;
|
|
10
|
-
/**
|
|
11
|
-
* Bootstrap any application services.
|
|
12
|
-
* This method is called after all providers have registered.
|
|
13
|
-
* You can safely use 'make' to resolve services here.
|
|
14
|
-
*/
|
|
15
|
-
boot?(core: PlanetCore): void | Promise<void>;
|
|
16
|
-
}
|
|
17
|
-
//# sourceMappingURL=ServiceProvider.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ServiceProvider.d.ts","sourceRoot":"","sources":["../../../../core/src/ServiceProvider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAC5C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAE9C,8BAAsB,eAAe;IACnC;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,CAAC,SAAS,EAAE,SAAS,GAAG,IAAI;IAE7C;;;;OAIG;IACH,IAAI,CAAC,CAAC,IAAI,EAAE,UAAU,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;CAC9C"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AuthenticationException.d.ts","sourceRoot":"","sources":["../../../../../core/src/exceptions/AuthenticationException.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAErD,qBAAa,uBAAwB,SAAQ,gBAAgB;gBAC/C,OAAO,SAAqB;CAMzC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AuthorizationException.d.ts","sourceRoot":"","sources":["../../../../../core/src/exceptions/AuthorizationException.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAErD,qBAAa,sBAAuB,SAAQ,gBAAgB;gBAC9C,OAAO,SAAiC;CAMrD"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { HTTPException } from 'hono/http-exception';
|
|
2
|
-
export interface ExceptionOptions {
|
|
3
|
-
message?: string;
|
|
4
|
-
cause?: unknown;
|
|
5
|
-
i18nKey?: string;
|
|
6
|
-
i18nParams?: Record<string, string | number>;
|
|
7
|
-
}
|
|
8
|
-
export declare abstract class GravitoException extends HTTPException {
|
|
9
|
-
readonly code: string;
|
|
10
|
-
readonly i18nKey?: string;
|
|
11
|
-
readonly i18nParams?: Record<string, string | number>;
|
|
12
|
-
constructor(status: number, code: string, options?: ExceptionOptions);
|
|
13
|
-
getLocalizedMessage(t: (key: string, params?: Record<string, string | number>) => string): string;
|
|
14
|
-
}
|
|
15
|
-
//# sourceMappingURL=GravitoException.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"GravitoException.d.ts","sourceRoot":"","sources":["../../../../../core/src/exceptions/GravitoException.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAGnD,MAAM,WAAW,gBAAgB;IAC/B,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAA;CAC7C;AAED,8BAAsB,gBAAiB,SAAQ,aAAa;IAC1D,SAAgB,IAAI,EAAE,MAAM,CAAA;IAC5B,SAAgB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChC,SAAgB,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAA;gBAEhD,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,GAAE,gBAAqB;IAexE,mBAAmB,CACjB,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,KAAK,MAAM,GACnE,MAAM;CAMV"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { GravitoException } from './GravitoException';
|
|
2
|
-
export declare class ModelNotFoundException extends GravitoException {
|
|
3
|
-
readonly model: string;
|
|
4
|
-
readonly id?: string | number;
|
|
5
|
-
constructor(model: string, id?: string | number);
|
|
6
|
-
}
|
|
7
|
-
//# sourceMappingURL=ModelNotFoundException.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ModelNotFoundException.d.ts","sourceRoot":"","sources":["../../../../../core/src/exceptions/ModelNotFoundException.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAErD,qBAAa,sBAAuB,SAAQ,gBAAgB;IAC1D,SAAgB,KAAK,EAAE,MAAM,CAAA;IAC7B,SAAgB,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;gBAExB,KAAK,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM;CAWhD"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { GravitoException } from './GravitoException';
|
|
2
|
-
export interface ValidationError {
|
|
3
|
-
field: string;
|
|
4
|
-
message: string;
|
|
5
|
-
code?: string;
|
|
6
|
-
}
|
|
7
|
-
export declare class ValidationException extends GravitoException {
|
|
8
|
-
readonly errors: ValidationError[];
|
|
9
|
-
redirectTo?: string;
|
|
10
|
-
input?: unknown;
|
|
11
|
-
constructor(errors: ValidationError[], message?: string);
|
|
12
|
-
withRedirect(url: string): this;
|
|
13
|
-
withInput(input: unknown): this;
|
|
14
|
-
}
|
|
15
|
-
//# sourceMappingURL=ValidationException.d.ts.map
|