@gravito/stream 1.0.0-alpha.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.
Files changed (148) hide show
  1. package/README.md +319 -0
  2. package/dist/Consumer.d.ts +67 -0
  3. package/dist/Consumer.d.ts.map +1 -0
  4. package/dist/Job.d.ts +76 -0
  5. package/dist/Job.d.ts.map +1 -0
  6. package/dist/OrbitQueue.d.ts +74 -0
  7. package/dist/OrbitQueue.d.ts.map +1 -0
  8. package/dist/QueueManager.d.ts +86 -0
  9. package/dist/QueueManager.d.ts.map +1 -0
  10. package/dist/Queueable.d.ts +63 -0
  11. package/dist/Queueable.d.ts.map +1 -0
  12. package/dist/Worker.d.ts +48 -0
  13. package/dist/Worker.d.ts.map +1 -0
  14. package/dist/core/src/ConfigManager.d.ts +26 -0
  15. package/dist/core/src/ConfigManager.d.ts.map +1 -0
  16. package/dist/core/src/Container.d.ts +39 -0
  17. package/dist/core/src/Container.d.ts.map +1 -0
  18. package/dist/core/src/Event.d.ts +6 -0
  19. package/dist/core/src/Event.d.ts.map +1 -0
  20. package/dist/core/src/EventManager.d.ts +124 -0
  21. package/dist/core/src/EventManager.d.ts.map +1 -0
  22. package/dist/core/src/GlobalErrorHandlers.d.ts +32 -0
  23. package/dist/core/src/GlobalErrorHandlers.d.ts.map +1 -0
  24. package/dist/core/src/HookManager.d.ts +29 -0
  25. package/dist/core/src/HookManager.d.ts.map +1 -0
  26. package/dist/core/src/Listener.d.ts +5 -0
  27. package/dist/core/src/Listener.d.ts.map +1 -0
  28. package/dist/core/src/Logger.d.ts +21 -0
  29. package/dist/core/src/Logger.d.ts.map +1 -0
  30. package/dist/core/src/PlanetCore.d.ts +116 -0
  31. package/dist/core/src/PlanetCore.d.ts.map +1 -0
  32. package/dist/core/src/Route.d.ts +13 -0
  33. package/dist/core/src/Route.d.ts.map +1 -0
  34. package/dist/core/src/Router.d.ts +168 -0
  35. package/dist/core/src/Router.d.ts.map +1 -0
  36. package/dist/core/src/ServiceProvider.d.ts +17 -0
  37. package/dist/core/src/ServiceProvider.d.ts.map +1 -0
  38. package/dist/core/src/exceptions/AuthenticationException.d.ts +5 -0
  39. package/dist/core/src/exceptions/AuthenticationException.d.ts.map +1 -0
  40. package/dist/core/src/exceptions/AuthorizationException.d.ts +5 -0
  41. package/dist/core/src/exceptions/AuthorizationException.d.ts.map +1 -0
  42. package/dist/core/src/exceptions/GravitoException.d.ts +15 -0
  43. package/dist/core/src/exceptions/GravitoException.d.ts.map +1 -0
  44. package/dist/core/src/exceptions/ModelNotFoundException.d.ts +7 -0
  45. package/dist/core/src/exceptions/ModelNotFoundException.d.ts.map +1 -0
  46. package/dist/core/src/exceptions/ValidationException.d.ts +15 -0
  47. package/dist/core/src/exceptions/ValidationException.d.ts.map +1 -0
  48. package/dist/core/src/exceptions/index.d.ts +6 -0
  49. package/dist/core/src/exceptions/index.d.ts.map +1 -0
  50. package/dist/core/src/helpers/Arr.d.ts +15 -0
  51. package/dist/core/src/helpers/Arr.d.ts.map +1 -0
  52. package/dist/core/src/helpers/Str.d.ts +19 -0
  53. package/dist/core/src/helpers/Str.d.ts.map +1 -0
  54. package/dist/core/src/helpers/data.d.ts +6 -0
  55. package/dist/core/src/helpers/data.d.ts.map +1 -0
  56. package/dist/core/src/helpers/errors.d.ts +13 -0
  57. package/dist/core/src/helpers/errors.d.ts.map +1 -0
  58. package/dist/core/src/helpers/response.d.ts +19 -0
  59. package/dist/core/src/helpers/response.d.ts.map +1 -0
  60. package/dist/core/src/helpers.d.ts +39 -0
  61. package/dist/core/src/helpers.d.ts.map +1 -0
  62. package/dist/core/src/http/CookieJar.d.ts +34 -0
  63. package/dist/core/src/http/CookieJar.d.ts.map +1 -0
  64. package/dist/core/src/http/middleware/ThrottleRequests.d.ts +13 -0
  65. package/dist/core/src/http/middleware/ThrottleRequests.d.ts.map +1 -0
  66. package/dist/core/src/index.d.ts +32 -0
  67. package/dist/core/src/index.d.ts.map +1 -0
  68. package/dist/core/src/security/Encrypter.d.ts +25 -0
  69. package/dist/core/src/security/Encrypter.d.ts.map +1 -0
  70. package/dist/core/src/security/Hasher.d.ts +30 -0
  71. package/dist/core/src/security/Hasher.d.ts.map +1 -0
  72. package/dist/core/src/types/events.d.ts +95 -0
  73. package/dist/core/src/types/events.d.ts.map +1 -0
  74. package/dist/drivers/DatabaseDriver.d.ts +60 -0
  75. package/dist/drivers/DatabaseDriver.d.ts.map +1 -0
  76. package/dist/drivers/KafkaDriver.d.ts +134 -0
  77. package/dist/drivers/KafkaDriver.d.ts.map +1 -0
  78. package/dist/drivers/MemoryDriver.d.ts +45 -0
  79. package/dist/drivers/MemoryDriver.d.ts.map +1 -0
  80. package/dist/drivers/QueueDriver.d.ts +89 -0
  81. package/dist/drivers/QueueDriver.d.ts.map +1 -0
  82. package/dist/drivers/RedisDriver.d.ts +79 -0
  83. package/dist/drivers/RedisDriver.d.ts.map +1 -0
  84. package/dist/drivers/SQSDriver.d.ts +100 -0
  85. package/dist/drivers/SQSDriver.d.ts.map +1 -0
  86. package/dist/index.cjs +32101 -0
  87. package/dist/index.cjs.map +422 -0
  88. package/dist/index.d.ts +45 -0
  89. package/dist/index.d.ts.map +1 -0
  90. package/dist/index.mjs +32095 -0
  91. package/dist/index.mjs.map +422 -0
  92. package/dist/orbit-db/src/DBService.d.ts +270 -0
  93. package/dist/orbit-db/src/DBService.d.ts.map +1 -0
  94. package/dist/orbit-db/src/EventBus.d.ts +53 -0
  95. package/dist/orbit-db/src/EventBus.d.ts.map +1 -0
  96. package/dist/orbit-db/src/MigrationDriver.d.ts +55 -0
  97. package/dist/orbit-db/src/MigrationDriver.d.ts.map +1 -0
  98. package/dist/orbit-db/src/Model.d.ts +564 -0
  99. package/dist/orbit-db/src/Model.d.ts.map +1 -0
  100. package/dist/orbit-db/src/ModelCollection.d.ts +35 -0
  101. package/dist/orbit-db/src/ModelCollection.d.ts.map +1 -0
  102. package/dist/orbit-db/src/index.d.ts +34 -0
  103. package/dist/orbit-db/src/index.d.ts.map +1 -0
  104. package/dist/orbit-db/src/types.d.ts +146 -0
  105. package/dist/orbit-db/src/types.d.ts.map +1 -0
  106. package/dist/orbit-queue/src/Consumer.d.ts +67 -0
  107. package/dist/orbit-queue/src/Consumer.d.ts.map +1 -0
  108. package/dist/orbit-queue/src/Job.d.ts +76 -0
  109. package/dist/orbit-queue/src/Job.d.ts.map +1 -0
  110. package/dist/orbit-queue/src/OrbitQueue.d.ts +74 -0
  111. package/dist/orbit-queue/src/OrbitQueue.d.ts.map +1 -0
  112. package/dist/orbit-queue/src/QueueManager.d.ts +86 -0
  113. package/dist/orbit-queue/src/QueueManager.d.ts.map +1 -0
  114. package/dist/orbit-queue/src/Queueable.d.ts +63 -0
  115. package/dist/orbit-queue/src/Queueable.d.ts.map +1 -0
  116. package/dist/orbit-queue/src/Worker.d.ts +48 -0
  117. package/dist/orbit-queue/src/Worker.d.ts.map +1 -0
  118. package/dist/orbit-queue/src/drivers/DatabaseDriver.d.ts +60 -0
  119. package/dist/orbit-queue/src/drivers/DatabaseDriver.d.ts.map +1 -0
  120. package/dist/orbit-queue/src/drivers/KafkaDriver.d.ts +134 -0
  121. package/dist/orbit-queue/src/drivers/KafkaDriver.d.ts.map +1 -0
  122. package/dist/orbit-queue/src/drivers/MemoryDriver.d.ts +45 -0
  123. package/dist/orbit-queue/src/drivers/MemoryDriver.d.ts.map +1 -0
  124. package/dist/orbit-queue/src/drivers/QueueDriver.d.ts +89 -0
  125. package/dist/orbit-queue/src/drivers/QueueDriver.d.ts.map +1 -0
  126. package/dist/orbit-queue/src/drivers/RedisDriver.d.ts +79 -0
  127. package/dist/orbit-queue/src/drivers/RedisDriver.d.ts.map +1 -0
  128. package/dist/orbit-queue/src/drivers/SQSDriver.d.ts +100 -0
  129. package/dist/orbit-queue/src/drivers/SQSDriver.d.ts.map +1 -0
  130. package/dist/orbit-queue/src/index.d.ts +45 -0
  131. package/dist/orbit-queue/src/index.d.ts.map +1 -0
  132. package/dist/orbit-queue/src/serializers/ClassNameSerializer.d.ts +46 -0
  133. package/dist/orbit-queue/src/serializers/ClassNameSerializer.d.ts.map +1 -0
  134. package/dist/orbit-queue/src/serializers/JobSerializer.d.ts +36 -0
  135. package/dist/orbit-queue/src/serializers/JobSerializer.d.ts.map +1 -0
  136. package/dist/orbit-queue/src/serializers/JsonSerializer.d.ts +32 -0
  137. package/dist/orbit-queue/src/serializers/JsonSerializer.d.ts.map +1 -0
  138. package/dist/orbit-queue/src/types.d.ts +85 -0
  139. package/dist/orbit-queue/src/types.d.ts.map +1 -0
  140. package/dist/serializers/ClassNameSerializer.d.ts +46 -0
  141. package/dist/serializers/ClassNameSerializer.d.ts.map +1 -0
  142. package/dist/serializers/JobSerializer.d.ts +36 -0
  143. package/dist/serializers/JobSerializer.d.ts.map +1 -0
  144. package/dist/serializers/JsonSerializer.d.ts +32 -0
  145. package/dist/serializers/JsonSerializer.d.ts.map +1 -0
  146. package/dist/types.d.ts +85 -0
  147. package/dist/types.d.ts.map +1 -0
  148. package/package.json +57 -0
@@ -0,0 +1,168 @@
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
@@ -0,0 +1 @@
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,MAAM,EAAE,OAAO,CAAC,CAAA;AAG/E,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,CAAC,eAAe,EAAE,MAAM,CAAC,CAAA;AAE9D;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,OAAO,CAAA;IACf,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,QAAQ,CAAC,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,IAAI,CAAC,EAAE,OAAO,CAAC;QAAC,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC,CAAA;CACxF;AAED;;GAEG;AACH,MAAM,MAAM,g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IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY,GAAG,KAAK;IACjD,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAE,YAAY,GAAG,KAAK;IAS5E;;;OAGG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,eAAe,EAAE,OAAO,GAAE,eAAoB,GAAG,IAAI;IA8CxF;;OAEG;IACH,GAAG,CACD,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,gBAAgB,EAAE,gBAAgB,GAAG,YAAY,EACjD,OAAO,CAAC,EAAE,YAAY,EACtB,OAAO,GAAE,YAAiB,GACzB,KAAK;IAoFR;;OAEG;IACH,OAAO,CAAC,wBAAwB;CAcjC;AAED,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,QAAQ,GAAG,SAAS,CAAA;AAElG,MAAM,WAAW,eAAe;IAC9B,IAAI,CAAC,EAAE,cAAc,EAAE,CAAA;IACvB,MAAM,CAAC,EAAE,cAAc,EAAE,CAAA;CAC1B"}
@@ -0,0 +1,17 @@
1
+ import type { Container } from './Container';
2
+ import type { PlanetCore } 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
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,5 @@
1
+ import { GravitoException } from './GravitoException';
2
+ export declare class AuthenticationException extends GravitoException {
3
+ constructor(message?: string);
4
+ }
5
+ //# sourceMappingURL=AuthenticationException.d.ts.map
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,5 @@
1
+ import { GravitoException } from './GravitoException';
2
+ export declare class AuthorizationException extends GravitoException {
3
+ constructor(message?: string);
4
+ }
5
+ //# sourceMappingURL=AuthorizationException.d.ts.map
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,15 @@
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
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,7 @@
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
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,15 @@
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
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ValidationException.d.ts","sourceRoot":"","sources":["../../../../../core/src/exceptions/ValidationException.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAErD,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAED,qBAAa,mBAAoB,SAAQ,gBAAgB;IACvD,SAAgB,MAAM,EAAE,eAAe,EAAE,CAAA;IAClC,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,KAAK,CAAC,EAAE,OAAO,CAAA;gBAEV,MAAM,EAAE,eAAe,EAAE,EAAE,OAAO,SAAsB;IAQpE,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAK/B,SAAS,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI;CAIhC"}
@@ -0,0 +1,6 @@
1
+ export * from './AuthenticationException';
2
+ export * from './AuthorizationException';
3
+ export * from './GravitoException';
4
+ export * from './ModelNotFoundException';
5
+ export * from './ValidationException';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../core/src/exceptions/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAA;AACzC,cAAc,0BAA0B,CAAA;AACxC,cAAc,oBAAoB,CAAA;AAClC,cAAc,0BAA0B,CAAA;AACxC,cAAc,uBAAuB,CAAA"}
@@ -0,0 +1,15 @@
1
+ import { type DataPath } from './data';
2
+ export declare const Arr: {
3
+ readonly get: <TDefault = undefined>(target: unknown, path: DataPath | null | undefined, defaultValue?: TDefault) => unknown | TDefault;
4
+ readonly has: (target: unknown, path: DataPath | null | undefined) => boolean;
5
+ readonly set: (target: unknown, path: DataPath, value: unknown, overwrite?: boolean) => unknown;
6
+ readonly wrap: <T>(value: T | T[] | null | undefined) => T[];
7
+ readonly first: <T>(items: readonly T[], callback?: (value: T, index: number) => boolean) => T | undefined;
8
+ readonly last: <T>(items: readonly T[], callback?: (value: T, index: number) => boolean) => T | undefined;
9
+ readonly only: <T extends Record<string, unknown>>(target: T, keys: readonly string[]) => Partial<T>;
10
+ readonly except: <T extends Record<string, unknown>>(target: T, keys: readonly string[]) => Partial<T>;
11
+ readonly flatten: (items: unknown[], depth?: number) => unknown[];
12
+ readonly pluck: <TItem extends Record<string, unknown>>(items: readonly TItem[], valuePath: DataPath, keyPath?: DataPath) => unknown[] | Record<string, unknown>;
13
+ readonly where: <T>(items: readonly T[], callback: (value: T, index: number) => boolean) => T[];
14
+ };
15
+ //# sourceMappingURL=Arr.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Arr.d.ts","sourceRoot":"","sources":["../../../../../core/src/helpers/Arr.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAA6B,MAAM,QAAQ,CAAA;AAEjE,eAAO,MAAM,GAAG;mBACV,QAAQ,sBACF,OAAO,QACT,QA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per: (value: string) => string;
5
+ readonly startsWith: (haystack: string, needles: StartsEndsNeedle) => boolean;
6
+ readonly endsWith: (haystack: string, needles: StartsEndsNeedle) => boolean;
7
+ readonly contains: (haystack: string, needles: StartsEndsNeedle) => boolean;
8
+ readonly snake: (value: string) => string;
9
+ readonly kebab: (value: string) => string;
10
+ readonly studly: (value: string) => string;
11
+ readonly camel: (value: string) => string;
12
+ readonly title: (value: string) => string;
13
+ readonly limit: (value: string, limit: number, end?: string) => string;
14
+ readonly slug: (value: string, separator?: string) => string;
15
+ readonly uuid: () => string;
16
+ readonly random: (length?: number) => string;
17
+ };
18
+ export {};
19
+ //# sourceMappingURL=Str.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Str.d.ts","sourceRoot":"","sources":["../../../../../core/src/helpers/Str.ts"],"names":[],"mappings":"AAEA,KAAK,gBAAgB,GAAG,MAAM,GAAG,SAAS,MAAM,EAAE,CAAA;AAkBlD,eAAO,MAAM,GAAG;4BACD,MAAM,KAAG,MAAM;4BAIf,MAAM,KAAG,MAAM;oCAIP,MAAM,WAAW,gBAAgB,KAAG,OAAO;kCAU7C,MAAM,WAAW,gBAAgB,KAAG,OAAO;kCAU3C,MAAM,WAAW,gBAAgB,KAAG,OAAO;4BAUjD,MAAM,KAAG,MAAM;4BAKf,MAAM,KAAG,MAAM;6BAKd,MAAM,KAAG,MAAM;4BAMhB,MAAM,KAAG,MAAM;4BAYf,MAAM,KAAG,MAAM;4BAMf,MAAM,SAAS,MAAM,mBAAgB,MAAM;2BAU5C,MAAM,yBAAoB,MAAM;yBAYpC,MAAM;0CAOO,MAAM;CASnB,CAAA"}
@@ -0,0 +1,6 @@
1
+ export type PathSegment = string | number;
2
+ export type DataPath = string | readonly PathSegment[];
3
+ export declare function dataGet<TDefault = undefined>(target: unknown, path: DataPath | null | undefined, defaultValue?: TDefault): unknown | TDefault;
4
+ export declare function dataHas(target: unknown, path: DataPath | null | undefined): boolean;
5
+ export declare function dataSet(target: unknown, path: DataPath, setValue: unknown, overwrite?: boolean): unknown;
6
+ //# sourceMappingURL=data.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../../../core/src/helpers/data.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,MAAM,CAAA;AACzC,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,SAAS,WAAW,EAAE,CAAA;AA4EtD,wBAAgB,OAAO,CAAC,QAAQ,GAAG,SAAS,EAC1C,MAAM,EAAE,OAAO,EACf,IAAI,EAAE,QAAQ,GAAG,IAAI,GAAG,SAAS,EACjC,YAAY,CAAC,EAAE,QAAQ,GACtB,OAAO,GAAG,QAAQ,CAepB;AAED,wBAAgB,OAAO,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAenF;AAED,wBAAgB,OAAO,CACrB,MAAM,EAAE,OAAO,EACf,IAAI,EAAE,QAAQ,EACd,QAAQ,EAAE,OAAO,EACjB,SAAS,UAAO,GACf,OAAO,CAgCT"}
@@ -0,0 +1,13 @@
1
+ import type { Context } from 'hono';
2
+ export interface ErrorBag {
3
+ has(field: string): boolean;
4
+ first(field?: string): string | undefined;
5
+ get(field: string): string[];
6
+ all(): Record<string, string[]>;
7
+ any(): boolean;
8
+ count(): number;
9
+ }
10
+ export declare function createErrorBag(errors: Record<string, string[]>): ErrorBag;
11
+ export declare function errors(c: Context): ErrorBag;
12
+ export declare function old(c: Context, field: string, defaultValue?: unknown): unknown;
13
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../../../core/src/helpers/errors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AAEnC,MAAM,WAAW,QAAQ;IACvB,GAAG,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAA;IAC3B,KAAK,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAA;IACzC,GAAG,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;IAC5B,GAAG,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAA;IAC/B,GAAG,IAAI,OAAO,CAAA;IACd,KAAK,IAAI,MAAM,CAAA;CAChB;AAED,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,GAAG,QAAQ,CAmBzE;AAGD,wBAAgB,MAAM,CAAC,CAAC,EAAE,OAAO,GAAG,QAAQ,CAI3C;AAGD,wBAAgB,GAAG,CAAC,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,OAAO,GAAG,OAAO,CAI9E"}
@@ -0,0 +1,19 @@
1
+ import type { Context } from 'hono';
2
+ import type { ContentfulStatusCode } from 'hono/utils/http-status';
3
+ export type ApiSuccess<T> = {
4
+ success: true;
5
+ data: T;
6
+ };
7
+ export type ApiFailure = {
8
+ success: false;
9
+ error: {
10
+ message: string;
11
+ code?: string;
12
+ details?: unknown;
13
+ };
14
+ };
15
+ export declare function ok<T>(data: T): ApiSuccess<T>;
16
+ export declare function fail(message: string, code?: string, details?: unknown): ApiFailure;
17
+ export declare function jsonSuccess<T>(c: Context, data: T, status?: ContentfulStatusCode): Response;
18
+ export declare function jsonFail(c: Context, message: string, status?: ContentfulStatusCode, code?: string, details?: unknown): Response;
19
+ //# sourceMappingURL=response.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"response.d.ts","sourceRoot":"","sources":["../../../../../core/src/helpers/response.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AACnC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAElE,MAAM,MAAM,UAAU,CAAC,CAAC,IAAI;IAC1B,OAAO,EAAE,IAAI,CAAA;IACb,IAAI,EAAE,CAAC,CAAA;CACR,CAAA;AAED,MAAM,MAAM,UAAU,GAAG;IACvB,OAAO,EAAE,KAAK,CAAA;IACd,KAAK,EAAE;QACL,OAAO,EAAE,MAAM,CAAA;QACf,IAAI,CAAC,EAAE,MAAM,CAAA;QACb,OAAO,CAAC,EAAE,OAAO,CAAA;KAClB,CAAA;CACF,CAAA;AAED,wBAAgB,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,CAE5C;AAED,wBAAgB,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,UAAU,CASlF;AAED,wBAAgB,WAAW,CAAC,CAAC,EAAE,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,GAAE,oBAA0B,GAAG,QAAQ,CAEhG;AAED,wBAAgB,QAAQ,CACtB,CAAC,EAAE,OAAO,EACV,OAAO,EAAE,MAAM,EACf,MAAM,GAAE,oBAA0B,EAClC,IAAI,CAAC,EAAE,MAAM,EACb,OAAO,CAAC,EAAE,OAAO,GAChB,QAAQ,CAEV"}
@@ -0,0 +1,39 @@
1
+ import type { ContentfulStatusCode } from 'hono/utils/http-status';
2
+ import type { PlanetCore } from './PlanetCore';
3
+ import type { Router } from './Router';
4
+ export { Arr } from './helpers/Arr';
5
+ export * from './helpers/data';
6
+ export * from './helpers/errors';
7
+ export * from './helpers/response';
8
+ export { Str } from './helpers/Str';
9
+ export declare class DumpDieError extends Error {
10
+ readonly values: unknown[];
11
+ name: string;
12
+ constructor(values: unknown[]);
13
+ }
14
+ export type DumpOptions = {
15
+ depth?: number | null;
16
+ colors?: boolean;
17
+ };
18
+ export declare function dump(...values: unknown[]): void;
19
+ export declare function dd(...values: unknown[]): never;
20
+ export declare function tap<T>(value: T, callback: (value: T) => unknown): T;
21
+ export declare function value<TArgs extends readonly unknown[], TResult>(value: (...args: TArgs) => TResult, ...args: TArgs): TResult;
22
+ export declare function value<TResult>(value: TResult): TResult;
23
+ export declare function value<TArgs extends readonly unknown[], TResult>(valueOrFactory: TResult | ((...args: TArgs) => TResult), ...args: TArgs): TResult;
24
+ export declare function blank(value: unknown): boolean;
25
+ export declare function filled(value: unknown): boolean;
26
+ export declare function throwIf(condition: unknown, error?: Error | string | (() => Error)): void;
27
+ export declare function throwUnless(condition: unknown, error?: Error | string | (() => Error)): void;
28
+ export declare function env<TDefault = string | undefined>(key: string, defaultValue?: TDefault): string | TDefault;
29
+ export declare function setApp(core: PlanetCore | null): void;
30
+ export declare function hasApp(): boolean;
31
+ export declare function app(): PlanetCore;
32
+ export declare function config<T = unknown>(key: string): T;
33
+ export declare function config<T>(key: string, defaultValue: T): T;
34
+ export declare function logger(): import("./Logger").Logger;
35
+ export declare function router(): Router;
36
+ export declare function abort(status: ContentfulStatusCode, message?: string): never;
37
+ export declare function abortIf(condition: unknown, status: ContentfulStatusCode, message?: string): void;
38
+ export declare function abortUnless(condition: unknown, status: ContentfulStatusCode, message?: string): void;
39
+ //# sourceMappingURL=helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../core/src/helpers.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAClE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAC9C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAEtC,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAA;AACnC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,kBAAkB,CAAA;AAChC,cAAc,oBAAoB,CAAA;AAClC,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAA;AAEnC,qBAAa,YAAa,SAAQ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zB,SAAS,EAAE,OAAO,EAClB,KAAK,GAAE,KAAK,GAAG,MAAM,GAAG,CAAC,MAAM,KAAK,CAAY,GAC/C,IAAI,CAIN;AAQD,wBAAgB,GAAG,CAAC,QAAQ,GAAG,MAAM,GAAG,SAAS,EAAE,GAAG,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,QAAQ,GAGnD,MAAM,GAAG,QAAQ,CACpD;AAID,wBAAgB,MAAM,CAAC,IAAI,EAAE,UAAU,GAAG,IAAI,GAAG,IAAI,CAEpD;AAED,wBAAgB,MAAM,IAAI,OAAO,CAEhC;AAED,wBAAgB,GAAG,IAAI,UAAU,CAKhC;AAED,wBAAgB,MAAM,CAAC,CAAC,GAAG,OAAO,EAAE,GAAG,EAAE,MAAM,GAAG,CAAC,CAAA;AACnD,wBAAgB,MAAM,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC,GAAG,CAAC,CAAA;AAQ1D,wBAAgB,MAAM,8BAErB;AAED,wBAAgB,MAAM,IAAI,MAAM,CAE/B;AAED,wBAAgB,KAAK,CAAC,MAAM,EAAE,oBAAoB,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,KAAK,CAK3E;AAED,wBAAgB,OAAO,CAAC,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,oBAAoB,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAIhG;AAED,wBAAgB,WAAW,CACzB,SAAS,EAAE,OAAO,EAClB,MAAM,EAAE,oBAAoB,EAC5B,OAAO,CAAC,EAAE,MAAM,GACf,IAAI,CAIN"}
@@ -0,0 +1,34 @@
1
+ import type { Context } from 'hono';
2
+ import type { Encrypter } from '../security/Encrypter';
3
+ export interface CookieOptions {
4
+ path?: string;
5
+ domain?: string;
6
+ secure?: boolean;
7
+ httpOnly?: boolean;
8
+ sameSite?: 'Strict' | 'Lax' | 'None';
9
+ maxAge?: number;
10
+ expires?: Date;
11
+ encrypt?: boolean;
12
+ }
13
+ export declare class CookieJar {
14
+ private encrypter?;
15
+ private queued;
16
+ constructor(encrypter?: Encrypter | undefined);
17
+ /**
18
+ * Queue a cookie to be sent with the response
19
+ */
20
+ queue(name: string, value: string, minutes?: number, options?: CookieOptions): void;
21
+ /**
22
+ * Make a cookie that lasts "forever" (5 years)
23
+ */
24
+ forever(name: string, value: string, options?: CookieOptions): void;
25
+ /**
26
+ * Expire a cookie
27
+ */
28
+ forget(name: string, options?: CookieOptions): void;
29
+ /**
30
+ * Attach queued cookies to the context
31
+ */
32
+ attach(c: Context): void;
33
+ }
34
+ //# sourceMappingURL=CookieJar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CookieJar.d.ts","sourceRoot":"","sources":["../../../../../core/src/http/CookieJar.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AAEnC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AAEtD,MAAM,WAAW,aAAa;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,CAAC,EAAE,QAAQ,GAAG,KAAK,GAAG,MAAM,CAAA;IACpC,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,OAAO,CAAC,EAAE,IAAI,CAAA;IACd,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,qBAAa,SAAS;IAGR,OAAO,CAAC,SAAS,CAAC;IAF9B,OAAO,CAAC,MAAM,CAAoE;gBAE9D,SAAS,CAAC,EAAE,SAAS,YAAA;IAEzC;;OAEG;IACH,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,SAAK,EAAE,OAAO,GAAE,aAAkB;IAkB5E;;OAEG;IACH,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,GAAE,aAAkB;IAIhE;;OAEG;IACH,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,GAAE,aAAkB;IAIhD;;OAEG;IACH,MAAM,CAAC,CAAC,EAAE,OAAO;CAKlB"}
@@ -0,0 +1,13 @@
1
+ import type { MiddlewareHandler } from 'hono';
2
+ import type { PlanetCore } from '../../PlanetCore';
3
+ export declare class ThrottleRequests {
4
+ private core;
5
+ constructor(core: PlanetCore);
6
+ /**
7
+ * Create the middleware
8
+ * @param maxAttempts - Max requests allowed
9
+ * @param decaySeconds - Time window in seconds
10
+ */
11
+ handle(maxAttempts?: number, decaySeconds?: number): MiddlewareHandler;
12
+ }
13
+ //# sourceMappingURL=ThrottleRequests.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ThrottleRequests.d.ts","sourceRoot":"","sources":["../../../../../../core/src/http/middleware/ThrottleRequests.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAW,iBAAiB,EAAQ,MAAM,MAAM,CAAA;AAC5D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAclD,qBAAa,gBAAgB;IACf,OAAO,CAAC,IAAI;gBAAJ,IAAI,EAAE,UAAU;IAEpC;;;;OAIG;IACH,MAAM,CAAC,WAAW,SAAK,EAAE,YAAY,SAAK,GAAG,iBAAiB;CAiC/D"}
@@ -0,0 +1,32 @@
1
+ /**
2
+ * gravito-core
3
+ *
4
+ * The core micro-kernel for the Galaxy Architecture.
5
+ */
6
+ import type { GravitoConfig } from './PlanetCore';
7
+ export declare const VERSION: string;
8
+ export { ConfigManager } from './ConfigManager';
9
+ export { Container, type Factory } from './Container';
10
+ export { EventManager } from './EventManager';
11
+ export * from './exceptions';
12
+ export { type GlobalErrorHandlersMode, type GlobalProcessErrorHandlerContext, type GlobalProcessErrorKind, type RegisterGlobalErrorHandlersOptions, registerGlobalErrorHandlers, } from './GlobalErrorHandlers';
13
+ export type { ActionCallback, FilterCallback } from './HookManager';
14
+ export { HookManager } from './HookManager';
15
+ export * from './helpers';
16
+ export { CookieJar, type CookieOptions } from './http/CookieJar';
17
+ export { ThrottleRequests } from './http/middleware/ThrottleRequests';
18
+ export type { Listener, ShouldQueue } from './Listener';
19
+ export type { Logger } from './Logger';
20
+ export { ConsoleLogger } from './Logger';
21
+ export { type CacheService, type ErrorHandlerContext, type GravitoConfig, type GravitoOrbit, PlanetCore, type ViewService, } from './PlanetCore';
22
+ export { Route } from './Route';
23
+ export { type ControllerClass, type FormRequestClass, type FormRequestLike, type RouteHandler, type RouteOptions, Router, } from './Router';
24
+ export { ServiceProvider } from './ServiceProvider';
25
+ export { Encrypter, type EncrypterOptions } from './security/Encrypter';
26
+ export type { Channel, ShouldBroadcast } from './types/events';
27
+ export { Event } from './types/events';
28
+ /**
29
+ * Configure your Gravito application
30
+ */
31
+ export declare function defineConfig(config: GravitoConfig): GravitoConfig;
32
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../core/src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAEjD,eAAO,MAAM,OAAO,QAAsB,CAAA;AAG1C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,EAAE,SAAS,EAAE,KAAK,OAAO,EAAE,MAAM,aAAa,CAAA;AAErD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,cAAc,cAAc,CAAA;AAC5B,OAAO,EACL,KAAK,uBAAuB,EAC5B,KAAK,gCAAgC,EACrC,KAAK,sBAAsB,EAC3B,KAAK,kCAAkC,EACvC,2BAA2B,GAC5B,MAAM,uBAAuB,CAAA;AAC9B,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AACnE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,cAAc,WAAW,CAAA;AAEzB,OAAO,EAAE,SAAS,EAAE,KAAK,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAA;AACrE,YAAY,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AACvD,YAAY,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAExC,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,mBAAmB,EACxB,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,UAAU,EACV,KAAK,WAAW,GACjB,MAAM,cAAc,CAAA;AACrB,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAC/B,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB,MAAM,GACP,MAAM,UAAU,CAAA;AACjB,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,SAAS,EAAE,KAAK,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AACvE,YAAY,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAC9D,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAEtC;;GAEG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,aAAa,GAAG,aAAa,CAEjE"}
@@ -0,0 +1,25 @@
1
+ export interface EncrypterOptions {
2
+ key: string;
3
+ cipher?: string;
4
+ }
5
+ export declare class Encrypter {
6
+ private algorithm;
7
+ private key;
8
+ constructor(options: EncrypterOptions);
9
+ /**
10
+ * Encrypt a value
11
+ */
12
+ encrypt(value: unknown, serialize?: boolean): string;
13
+ /**
14
+ * Decrypt a value
15
+ */
16
+ decrypt(payload: string, deserialize?: boolean): unknown;
17
+ private hash;
18
+ private validPayload;
19
+ private validMac;
20
+ /**
21
+ * Generate a new key
22
+ */
23
+ static generateKey(cipher?: string): string;
24
+ }
25
+ //# sourceMappingURL=Encrypter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Encrypter.d.ts","sourceRoot":"","sources":["../../../../../core/src/security/Encrypter.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,gBAAgB;IAC/B,GAAG,EAAE,MAAM,CAAA;IACX,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED,qBAAa,SAAS;IACpB,OAAO,CAAC,SAAS,CAAQ;IACzB,OAAO,CAAC,GAAG,CAAQ;gBAEP,OAAO,EAAE,gBAAgB;IAkBrC;;OAEG;IACH,OAAO,CAAC,KAAK,EAAE,OAAO,EAAE,SAAS,UAAO,GAAG,MAAM;IAqBjD;;OAEG;IACH,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,WAAW,UAAO,GAAG,OAAO;IAoBrD,OAAO,CAAC,IAAI;IAMZ,OAAO,CAAC,YAAY;IAUpB,OAAO,CAAC,QAAQ;IAKhB;;OAEG;IACH,MAAM,CAAC,WAAW,CAAC,MAAM,SAAgB,GAAG,MAAM;CAInD"}
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Hashing interface
3
+ */
4
+ export interface Hasher {
5
+ /**
6
+ * Hash the given value
7
+ */
8
+ make(value: string, options?: Record<string, unknown>): Promise<string>;
9
+ /**
10
+ * Check the given plain value against a hash
11
+ */
12
+ check(value: string, hashedValue: string): Promise<boolean>;
13
+ /**
14
+ * Check if the given hash has been hashed using the given options
15
+ */
16
+ needsRehash(hashedValue: string, options?: Record<string, unknown>): boolean;
17
+ }
18
+ /**
19
+ * Bun Hasher
20
+ * Uses Bun's native password hashing (bcrypt by default)
21
+ */
22
+ export declare class BunHasher implements Hasher {
23
+ make(value: string, options?: {
24
+ algorithm?: 'bcrypt' | 'argon2id';
25
+ cost?: number;
26
+ }): Promise<string>;
27
+ check(value: string, hashedValue: string): Promise<boolean>;
28
+ needsRehash(_hashedValue: string, _options?: Record<string, unknown>): boolean;
29
+ }
30
+ //# sourceMappingURL=Hasher.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Hasher.d.ts","sourceRoot":"","sources":["../../../../../core/src/security/Hasher.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,MAAM;IACrB;;OAEG;IACH,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;IAEvE;;OAEG;IACH,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;IAE3D;;OAEG;IACH,WAAW,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAA;CAC7E;AAED;;;GAGG;AACH,qBAAa,SAAU,YAAW,MAAM;IAChC,IAAI,CACR,KAAK,EAAE,MAAM,EACb,OAAO,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,QAAQ,GAAG,UAAU,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,GAC7D,OAAO,CAAC,MAAM,CAAC;IAMZ,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAIjE,WAAW,CAAC,YAAY,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO;CAG/E"}