@forklaunch/express 1.2.31 → 1.2.33
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/lib/index.d.ts +48 -2062
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +9 -2
- package/lib/index.mjs +9 -2
- package/lib/src/cluster/bun.cluster.d.ts +4 -0
- package/lib/src/cluster/bun.cluster.d.ts.map +1 -0
- package/lib/src/cluster/bun.serve.shim.d.ts +55 -0
- package/lib/src/cluster/bun.serve.shim.d.ts.map +1 -0
- package/lib/src/cluster/bun.socket.shim.d.ts +81 -0
- package/lib/src/cluster/bun.socket.shim.d.ts.map +1 -0
- package/lib/src/cluster/node.cluster.d.ts +4 -0
- package/lib/src/cluster/node.cluster.d.ts.map +1 -0
- package/lib/src/expressApplication.d.ts +59 -0
- package/lib/src/expressApplication.d.ts.map +1 -0
- package/lib/src/expressRouter.d.ts +51 -0
- package/lib/src/expressRouter.d.ts.map +1 -0
- package/lib/src/handlers/checkout.d.ts +40 -0
- package/lib/src/handlers/checkout.d.ts.map +1 -0
- package/lib/src/handlers/copy.d.ts +89 -0
- package/lib/src/handlers/copy.d.ts.map +1 -0
- package/lib/src/handlers/delete.d.ts +59 -0
- package/lib/src/handlers/delete.d.ts.map +1 -0
- package/lib/src/handlers/get.d.ts +46 -0
- package/lib/src/handlers/get.d.ts.map +1 -0
- package/lib/src/handlers/head.d.ts +69 -0
- package/lib/src/handlers/head.d.ts.map +1 -0
- package/lib/src/handlers/link.d.ts +91 -0
- package/lib/src/handlers/link.d.ts.map +1 -0
- package/lib/src/handlers/lock.d.ts +90 -0
- package/lib/src/handlers/lock.d.ts.map +1 -0
- package/lib/src/handlers/m-search.d.ts +85 -0
- package/lib/src/handlers/m-search.d.ts.map +1 -0
- package/lib/src/handlers/merge.d.ts +101 -0
- package/lib/src/handlers/merge.d.ts.map +1 -0
- package/lib/src/handlers/middleware.d.ts +67 -0
- package/lib/src/handlers/middleware.d.ts.map +1 -0
- package/lib/src/handlers/mkcactivity.d.ts +76 -0
- package/lib/src/handlers/mkcactivity.d.ts.map +1 -0
- package/lib/src/handlers/mkcol.d.ts +76 -0
- package/lib/src/handlers/mkcol.d.ts.map +1 -0
- package/lib/src/handlers/move.d.ts +78 -0
- package/lib/src/handlers/move.d.ts.map +1 -0
- package/lib/src/handlers/notify.d.ts +75 -0
- package/lib/src/handlers/notify.d.ts.map +1 -0
- package/lib/src/handlers/options.d.ts +67 -0
- package/lib/src/handlers/options.d.ts.map +1 -0
- package/lib/src/handlers/patch.d.ts +86 -0
- package/lib/src/handlers/patch.d.ts.map +1 -0
- package/lib/src/handlers/post.d.ts +50 -0
- package/lib/src/handlers/post.d.ts.map +1 -0
- package/lib/src/handlers/propfind.d.ts +84 -0
- package/lib/src/handlers/propfind.d.ts.map +1 -0
- package/lib/src/handlers/proppatch.d.ts +84 -0
- package/lib/src/handlers/proppatch.d.ts.map +1 -0
- package/lib/src/handlers/purge.d.ts +63 -0
- package/lib/src/handlers/purge.d.ts.map +1 -0
- package/lib/src/handlers/put.d.ts +73 -0
- package/lib/src/handlers/put.d.ts.map +1 -0
- package/lib/src/handlers/report.d.ts +70 -0
- package/lib/src/handlers/report.d.ts.map +1 -0
- package/lib/src/handlers/search.d.ts +83 -0
- package/lib/src/handlers/search.d.ts.map +1 -0
- package/lib/src/handlers/subscribe.d.ts +75 -0
- package/lib/src/handlers/subscribe.d.ts.map +1 -0
- package/lib/src/handlers/trace.d.ts +59 -0
- package/lib/src/handlers/trace.d.ts.map +1 -0
- package/lib/src/handlers/unlink.d.ts +70 -0
- package/lib/src/handlers/unlink.d.ts.map +1 -0
- package/lib/src/handlers/unlock.d.ts +70 -0
- package/lib/src/handlers/unlock.d.ts.map +1 -0
- package/lib/src/handlers/unsubscribe.d.ts +71 -0
- package/lib/src/handlers/unsubscribe.d.ts.map +1 -0
- package/lib/src/middleware/async.middleware.d.ts +16 -0
- package/lib/src/middleware/async.middleware.d.ts.map +1 -0
- package/lib/src/middleware/content.parse.middleware.d.ts +13 -0
- package/lib/src/middleware/content.parse.middleware.d.ts.map +1 -0
- package/lib/src/middleware/enrichResponseTransmission.middleware.d.ts +27 -0
- package/lib/src/middleware/enrichResponseTransmission.middleware.d.ts.map +1 -0
- package/lib/src/types/export.types.d.ts +9 -0
- package/lib/src/types/export.types.d.ts.map +1 -0
- package/lib/src/types/express.types.d.ts +84 -0
- package/lib/src/types/express.types.d.ts.map +1 -0
- package/lib/src/types/expressOptions.types.d.ts +17 -0
- package/lib/src/types/expressOptions.types.d.ts.map +1 -0
- package/package.json +35 -34
- package/LICENSE +0 -21
- package/lib/index.d.mts +0 -2112
package/lib/index.d.ts
CHANGED
|
@@ -1,2058 +1,37 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
import
|
|
13
|
-
|
|
14
|
-
import {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
* @example
|
|
36
|
-
* ```typescript
|
|
37
|
-
* const app = new Application(schemaValidator, openTelemetryCollector);
|
|
38
|
-
* app.listen(3000, () => console.log('Server running on port 3000'));
|
|
39
|
-
* ```
|
|
40
|
-
*/
|
|
41
|
-
declare class Application<SV extends AnySchemaValidator, SessionSchema extends SessionObject<SV>> extends ForklaunchExpressLikeApplication<SV, Express, RequestHandler, Request, Response, NextFunction, SessionSchema> {
|
|
42
|
-
private docsConfiguration;
|
|
43
|
-
private mcpConfiguration;
|
|
44
|
-
private openapiConfiguration;
|
|
45
|
-
private hostingConfiguration;
|
|
46
|
-
/**
|
|
47
|
-
* Creates an instance of Application.
|
|
48
|
-
*
|
|
49
|
-
* @param {SV} schemaValidator - The schema validator for request/response validation.
|
|
50
|
-
* @param {OpenTelemetryCollector<MetricsDefinition>} openTelemetryCollector - Collector for OpenTelemetry metrics.
|
|
51
|
-
* @param {DocsConfiguration} [docsConfiguration] - Optional configuration for API documentation (Swagger/Scalar).
|
|
52
|
-
*/
|
|
53
|
-
constructor(schemaValidator: SV, openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>, options?: ExpressApplicationOptions<SV, SessionSchema>);
|
|
54
|
-
/**
|
|
55
|
-
* Starts the Express server and sets up API documentation (Swagger/Scalar).
|
|
56
|
-
* This method is overloaded to support various ways of starting the server.
|
|
57
|
-
*
|
|
58
|
-
* @param {number} [port] - The port number to listen on. Defaults to process.env.PORT.
|
|
59
|
-
* @param {string} [hostname] - The hostname to bind to.
|
|
60
|
-
* @param {number} [backlog] - The maximum length of the queue of pending connections.
|
|
61
|
-
* @param {() => void} [callback] - Optional callback to execute when the server starts listening.
|
|
62
|
-
* @returns {Server} - The HTTP server instance.
|
|
63
|
-
*
|
|
64
|
-
* @example
|
|
65
|
-
* ```typescript
|
|
66
|
-
* // Start server on port 3000
|
|
67
|
-
* app.listen(3000);
|
|
68
|
-
*
|
|
69
|
-
* // Start server with callback
|
|
70
|
-
* app.listen(3000, () => console.log('Server started'));
|
|
71
|
-
*
|
|
72
|
-
* // Start server with hostname and port
|
|
73
|
-
* app.listen(3000, 'localhost');
|
|
74
|
-
* ```
|
|
75
|
-
*/
|
|
76
|
-
listen(port: number, hostname: string, backlog: number, callback?: () => void): Server;
|
|
77
|
-
listen(port: number, hostname: string, callback?: () => void): Server;
|
|
78
|
-
listen(port: number, callback?: () => void): Server;
|
|
79
|
-
listen(callback?: () => void): Server;
|
|
80
|
-
listen(path: string, callback?: () => void): Server;
|
|
81
|
-
listen(handle: unknown, listeningListener?: () => void): Server;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
* Express-compatible request handler type for Forklaunch.
|
|
86
|
-
*
|
|
87
|
-
* @param req - The incoming request object, with `query` and `headers` properties normalized to either `ParsedQs` or a generic record.
|
|
88
|
-
* @param res - The response object for sending data back to the client.
|
|
89
|
-
* @param next - The next middleware function in the Express stack.
|
|
90
|
-
*
|
|
91
|
-
* @example
|
|
92
|
-
* const handler: ExpressRequestHandler = (req, res, next) => {
|
|
93
|
-
* // Access normalized query and headers
|
|
94
|
-
* const userId = req.query.userId;
|
|
95
|
-
* const customHeader = req.headers['x-custom-header'];
|
|
96
|
-
* res.json({ userId, customHeader });
|
|
97
|
-
* };
|
|
98
|
-
*/
|
|
99
|
-
type ExpressRequestHandler = (req: Omit<Request, 'query' | 'headers'> & {
|
|
100
|
-
query: ParsedQs | Record<string, unknown>;
|
|
101
|
-
headers: IncomingHttpHeaders | Record<string, unknown>;
|
|
102
|
-
}, res: Response, next: NextFunction$1) => void;
|
|
103
|
-
|
|
104
|
-
/**
|
|
105
|
-
* Router class that sets up routes and middleware for an Express router.
|
|
106
|
-
*
|
|
107
|
-
* @template SV - A type that extends AnySchemaValidator.
|
|
108
|
-
* @implements {ForklaunchRouter<SV>}
|
|
109
|
-
*/
|
|
110
|
-
declare class Router<SV extends AnySchemaValidator, BasePath extends `/${string}`, RouterSession extends SessionObject<SV>> extends ForklaunchExpressLikeRouter<SV, BasePath, RequestHandler$1, Router$1, Request, Response, NextFunction, RouterSession> {
|
|
111
|
-
basePath: BasePath;
|
|
112
|
-
private configOptions;
|
|
113
|
-
/**
|
|
114
|
-
* Creates an instance of Router.
|
|
115
|
-
*
|
|
116
|
-
* @param {string} basePath - The base path for the router.
|
|
117
|
-
* @param {SV} schemaValidator - The schema validator.
|
|
118
|
-
*/
|
|
119
|
-
constructor(basePath: BasePath, schemaValidator: SV, openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>, options?: ExpressRouterOptions<SV, RouterSession>);
|
|
120
|
-
route(path: string): this;
|
|
121
|
-
param<ParamName extends string, Types extends {
|
|
122
|
-
req?: LiteralSchema | SV['_SchemaCatchall'];
|
|
123
|
-
res?: IdiomaticSchema<SV>;
|
|
124
|
-
} & {
|
|
125
|
-
[K in ParamName]: IdiomaticSchema<SV>;
|
|
126
|
-
}>(name: ParamName, _types: Types, handler: (req: SchemaResolve<Types['req']>, res: SchemaResolve<Types['res']>, next: NextFunction, value: SchemaResolve<Types[ParamName]>, name: ParamName) => void): this;
|
|
127
|
-
checkout: TypedMiddlewareDefinition<this, SV, RouterSession, Request, Response, NextFunction, ExpressRequestHandler>;
|
|
128
|
-
copy: TypedMiddlewareDefinition<this, SV, RouterSession, Request, Response, NextFunction, ExpressRequestHandler>;
|
|
129
|
-
lock: TypedMiddlewareDefinition<this, SV, RouterSession, Request, Response, NextFunction, ExpressRequestHandler>;
|
|
130
|
-
merge: TypedMiddlewareDefinition<this, SV, RouterSession, Request, Response, NextFunction, ExpressRequestHandler>;
|
|
131
|
-
mkcactivity: TypedMiddlewareDefinition<this, SV, RouterSession, Request, Response, NextFunction, ExpressRequestHandler>;
|
|
132
|
-
mkcol: TypedMiddlewareDefinition<this, SV, RouterSession, Request, Response, NextFunction, ExpressRequestHandler>;
|
|
133
|
-
move: TypedMiddlewareDefinition<this, SV, RouterSession, Request, Response, NextFunction, ExpressRequestHandler>;
|
|
134
|
-
'm-search': TypedMiddlewareDefinition<this, SV, RouterSession, Request, Response, NextFunction, ExpressRequestHandler>;
|
|
135
|
-
notify: TypedMiddlewareDefinition<this, SV, RouterSession, Request, Response, NextFunction, ExpressRequestHandler>;
|
|
136
|
-
propfind: TypedMiddlewareDefinition<this, SV, RouterSession, Request, Response, NextFunction, ExpressRequestHandler>;
|
|
137
|
-
proppatch: TypedMiddlewareDefinition<this, SV, RouterSession, Request, Response, NextFunction, ExpressRequestHandler>;
|
|
138
|
-
purge: TypedMiddlewareDefinition<this, SV, RouterSession, Request, Response, NextFunction, ExpressRequestHandler>;
|
|
139
|
-
report: TypedMiddlewareDefinition<this, SV, RouterSession, Request, Response, NextFunction, ExpressRequestHandler>;
|
|
140
|
-
search: TypedMiddlewareDefinition<this, SV, RouterSession, Request, Response, NextFunction, ExpressRequestHandler>;
|
|
141
|
-
subscribe: TypedMiddlewareDefinition<this, SV, RouterSession, Request, Response, NextFunction, ExpressRequestHandler>;
|
|
142
|
-
unlock: TypedMiddlewareDefinition<this, SV, RouterSession, Request, Response, NextFunction, ExpressRequestHandler>;
|
|
143
|
-
unsubscribe: TypedMiddlewareDefinition<this, SV, RouterSession, Request, Response, NextFunction, ExpressRequestHandler>;
|
|
144
|
-
link: TypedMiddlewareDefinition<this, SV, RouterSession, Request, Response, NextFunction, ExpressRequestHandler>;
|
|
145
|
-
unlink: TypedMiddlewareDefinition<this, SV, RouterSession, Request, Response, NextFunction, ExpressRequestHandler>;
|
|
146
|
-
clone(): this;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
/**
|
|
150
|
-
* Creates a checkout route handler with schema validation and type safety.
|
|
151
|
-
*
|
|
152
|
-
* @template SV - The schema validator type
|
|
153
|
-
* @template Name - The name of the route
|
|
154
|
-
* @template Path - The path type
|
|
155
|
-
* @template P - The path parameters type
|
|
156
|
-
* @template ResBodyMap - The response body map type
|
|
157
|
-
* @template ReqBody - The request body type
|
|
158
|
-
* @template ReqQuery - The request query type
|
|
159
|
-
* @template ReqHeaders - The request headers type
|
|
160
|
-
* @template ResHeaders - The response headers type
|
|
161
|
-
* @template LocalsObj - The locals object type
|
|
162
|
-
*
|
|
163
|
-
* @param {SV} schemaValidator - The schema validator instance
|
|
164
|
-
* @param {Path} path - The path of the route
|
|
165
|
-
* @param {ContractDetails<SV, 'middleware', Name, Path, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, Request>} contractDetails - The contract details for the route
|
|
166
|
-
* @param {...ExpressLikeSchemaHandler<SV, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, LocalsObj, Request, Response, NextFunction>[]} handlers - The handlers for the route
|
|
167
|
-
*
|
|
168
|
-
* @example
|
|
169
|
-
* ```typescript
|
|
170
|
-
* const checkout = checkout(
|
|
171
|
-
* schemaValidator,
|
|
172
|
-
* '/checkout',
|
|
173
|
-
* contractDetails,
|
|
174
|
-
* handler);
|
|
175
|
-
* ```
|
|
176
|
-
*/
|
|
177
|
-
declare const checkout: <SV extends AnySchemaValidator, Name extends string, Path extends `/${string}`, P extends ParamsObject<SV>, ResBodyMap extends ResponsesObject<SV>, ReqBody extends Body<SV>, ReqQuery extends QueryObject<SV>, ReqHeaders extends HeadersObject<SV>, ResHeaders extends HeadersObject<SV>, LocalsObj extends Record<string, unknown>, const VersionedApi extends VersionSchema<SV, "middleware">, const Auth extends SchemaAuthMethods<SV, P, ReqBody, ReqQuery, ReqHeaders, VersionedApi, Request>>(schemaValidator: SV, path: Path, contractDetails: ContractDetails<SV, Name, "middleware", Path, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, VersionedApi, Request, Auth>, ...handlers: ExpressLikeSchemaHandler<SV, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, LocalsObj, VersionedApi, ResolvedSessionObject<SV, Auth, SessionObject<SV>>, Request, Response, NextFunction>[]) => {
|
|
178
|
-
_typedHandler: true;
|
|
179
|
-
_path: Path;
|
|
180
|
-
contractDetails: _forklaunch_core_http.MiddlewareContractDetails<SV, Name, Path, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, VersionedApi, Request<express__default.ParamsDictionary, any, any, ParsedQs$1, Record<string, any>>, Auth>;
|
|
181
|
-
handlers: ExpressLikeSchemaHandler<SV, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, LocalsObj, VersionedApi, ResolvedSessionObject<SV, Auth, SessionObject<SV>>, Request<express__default.ParamsDictionary, any, any, ParsedQs$1, Record<string, any>>, Response<any, Record<string, any>>, NextFunction>[];
|
|
182
|
-
};
|
|
183
|
-
|
|
184
|
-
/**
|
|
185
|
-
* Creates a COPY route handler with schema validation and type safety.
|
|
186
|
-
*
|
|
187
|
-
* @template SV - The schema validator type
|
|
188
|
-
* @template Name - The name of the route
|
|
189
|
-
* @template Path - The route path type
|
|
190
|
-
* @template P - The path parameters type
|
|
191
|
-
* @template ResBodyMap - The response body map type
|
|
192
|
-
* @template ReqBody - The request body type
|
|
193
|
-
* @template ReqQuery - The request query parameters type
|
|
194
|
-
* @template ReqHeaders - The request headers type
|
|
195
|
-
* @template ResHeaders - The response headers type
|
|
196
|
-
* @template LocalsObj - The locals object type
|
|
197
|
-
* @template Auth - The authentication method type
|
|
198
|
-
*
|
|
199
|
-
* @param {SV} schemaValidator - The schema validator instance
|
|
200
|
-
* @param {Path} path - The route path
|
|
201
|
-
* @param {ContractDetails<SV, 'middleware', Name, Path, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, Request, Auth>} contractDetails - The contract details for the route
|
|
202
|
-
* @param {...ExpressLikeSchemaHandler<SV, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, LocalsObj, Request, Auth>} handlers - The route handlers
|
|
203
|
-
*
|
|
204
|
-
* @returns {void} - Returns nothing, registers the route with Express
|
|
205
|
-
*
|
|
206
|
-
* @example
|
|
207
|
-
* ```typescript
|
|
208
|
-
* copy(
|
|
209
|
-
* schemaValidator,
|
|
210
|
-
* '/files/:id',
|
|
211
|
-
* {
|
|
212
|
-
* summary: 'Copy file',
|
|
213
|
-
* description: 'Creates a copy of a file at a new location',
|
|
214
|
-
* tags: ['files'],
|
|
215
|
-
* parameters: [
|
|
216
|
-
* {
|
|
217
|
-
* name: 'id',
|
|
218
|
-
* in: 'path',
|
|
219
|
-
* required: true,
|
|
220
|
-
* schema: { type: 'string' }
|
|
221
|
-
* }
|
|
222
|
-
* ],
|
|
223
|
-
* requestBody: {
|
|
224
|
-
* content: {
|
|
225
|
-
* 'application/json': {
|
|
226
|
-
* schema: {
|
|
227
|
-
* type: 'object',
|
|
228
|
-
* properties: {
|
|
229
|
-
* destination: { type: 'string' }
|
|
230
|
-
* }
|
|
231
|
-
* }
|
|
232
|
-
* }
|
|
233
|
-
* }
|
|
234
|
-
* },
|
|
235
|
-
* responses: {
|
|
236
|
-
* 201: {
|
|
237
|
-
* description: 'File copied successfully',
|
|
238
|
-
* content: {
|
|
239
|
-
* 'application/json': {
|
|
240
|
-
* schema: {
|
|
241
|
-
* type: 'object',
|
|
242
|
-
* properties: {
|
|
243
|
-
* id: { type: 'string' },
|
|
244
|
-
* location: { type: 'string' }
|
|
245
|
-
* }
|
|
246
|
-
* }
|
|
247
|
-
* }
|
|
248
|
-
* }
|
|
249
|
-
* }
|
|
250
|
-
* }
|
|
251
|
-
* },
|
|
252
|
-
* async (req, res) => {
|
|
253
|
-
* const { id } = req.params;
|
|
254
|
-
* const { destination } = req.body;
|
|
255
|
-
* const result = await copyFile(id, destination);
|
|
256
|
-
* res.status(201).json(result);
|
|
257
|
-
* }
|
|
258
|
-
* );
|
|
259
|
-
* ```
|
|
260
|
-
*/
|
|
261
|
-
declare const copy: <SV extends AnySchemaValidator, Name extends string, Path extends `/${string}`, P extends ParamsObject<SV>, ResBodyMap extends ResponsesObject<SV>, ReqBody extends Body<SV>, ReqQuery extends QueryObject<SV>, ReqHeaders extends HeadersObject<SV>, ResHeaders extends HeadersObject<SV>, LocalsObj extends Record<string, unknown>, const VersionedApi extends VersionSchema<SV, "middleware">, const Auth extends SchemaAuthMethods<SV, P, ReqBody, ReqQuery, ReqHeaders, VersionedApi, Request>>(schemaValidator: SV, path: Path, contractDetails: ContractDetails<SV, Name, "middleware", Path, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, VersionedApi, Request, Auth>, ...handlers: ExpressLikeSchemaHandler<SV, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, LocalsObj, VersionedApi, ResolvedSessionObject<SV, Auth, SessionObject<SV>>, Request, Response, NextFunction>[]) => {
|
|
262
|
-
_typedHandler: true;
|
|
263
|
-
_path: Path;
|
|
264
|
-
contractDetails: _forklaunch_core_http.MiddlewareContractDetails<SV, Name, Path, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, VersionedApi, Request<express__default.ParamsDictionary, any, any, ParsedQs$1, Record<string, any>>, Auth>;
|
|
265
|
-
handlers: ExpressLikeSchemaHandler<SV, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, LocalsObj, VersionedApi, ResolvedSessionObject<SV, Auth, SessionObject<SV>>, Request<express__default.ParamsDictionary, any, any, ParsedQs$1, Record<string, any>>, Response<any, Record<string, any>>, NextFunction>[];
|
|
266
|
-
};
|
|
267
|
-
|
|
268
|
-
/**
|
|
269
|
-
* Creates a DELETE route handler with schema validation and type safety.
|
|
270
|
-
*
|
|
271
|
-
* @template SV - The schema validator type
|
|
272
|
-
* @template Name - The name of the route
|
|
273
|
-
* @template Path - The route path type
|
|
274
|
-
* @template P - The path parameters type
|
|
275
|
-
* @template ResBodyMap - The response body map type
|
|
276
|
-
* @template ReqQuery - The request query parameters type
|
|
277
|
-
* @template ReqHeaders - The request headers type
|
|
278
|
-
* @template ResHeaders - The response headers type
|
|
279
|
-
* @template LocalsObj - The locals object type
|
|
280
|
-
* @template Auth - The authentication methods type
|
|
281
|
-
*
|
|
282
|
-
* @param {SV} schemaValidator - The schema validator instance
|
|
283
|
-
* @param {Path} path - The route path
|
|
284
|
-
* @param {ContractDetails<SV, 'delete', Name, Path, P, ResBodyMap, never, ReqQuery, ReqHeaders, ResHeaders, Request, Auth>} contractDetails - The contract details for the route
|
|
285
|
-
* @param {...ExpressLikeSchemaHandler<SV, P, ResBodyMap, never, ReqQuery, ReqHeaders, ResHeaders, LocalsObj, Request, Response, NextFunction>[]} handlers - The route handlers
|
|
286
|
-
*
|
|
287
|
-
* @returns {void} - Returns nothing, registers the route with Express
|
|
288
|
-
*
|
|
289
|
-
* @example
|
|
290
|
-
* ```typescript
|
|
291
|
-
* del(
|
|
292
|
-
* schemaValidator,
|
|
293
|
-
* '/users/:id',
|
|
294
|
-
* {
|
|
295
|
-
* summary: 'Delete user',
|
|
296
|
-
* description: 'Deletes a user by ID',
|
|
297
|
-
* tags: ['users'],
|
|
298
|
-
* parameters: [
|
|
299
|
-
* {
|
|
300
|
-
* name: 'id',
|
|
301
|
-
* in: 'path',
|
|
302
|
-
* required: true,
|
|
303
|
-
* schema: { type: 'string' }
|
|
304
|
-
* }
|
|
305
|
-
* ],
|
|
306
|
-
* responses: {
|
|
307
|
-
* 204: {
|
|
308
|
-
* description: 'User deleted successfully'
|
|
309
|
-
* }
|
|
310
|
-
* }
|
|
311
|
-
* },
|
|
312
|
-
* async (req, res) => {
|
|
313
|
-
* const { id } = req.params;
|
|
314
|
-
* await deleteUser(id);
|
|
315
|
-
* res.status(204).send();
|
|
316
|
-
* }
|
|
317
|
-
* );
|
|
318
|
-
* ```
|
|
319
|
-
*/
|
|
320
|
-
declare const delete_: <SV extends AnySchemaValidator, Name extends string, Path extends `/${string}`, P extends ParamsObject<SV>, ResBodyMap extends ResponsesObject<SV>, ReqBody extends Body<SV>, ReqQuery extends QueryObject<SV>, ReqHeaders extends HeadersObject<SV>, ResHeaders extends HeadersObject<SV>, LocalsObj extends Record<string, unknown>, const VersionedApi extends VersionSchema<SV, "delete">, const Auth extends SchemaAuthMethods<SV, P, ReqBody, ReqQuery, ReqHeaders, VersionedApi, Request>>(schemaValidator: SV, path: Path, contractDetails: ContractDetails<SV, Name, "delete", Path, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, VersionedApi, Request, Auth>, ...handlers: ExpressLikeSchemaHandler<SV, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, LocalsObj, VersionedApi, ResolvedSessionObject<SV, Auth, SessionObject<SV>>, Request, Response, NextFunction>[]) => _forklaunch_core_http.ExpressLikeTypedHandler<SV, Name, "delete", Path, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, LocalsObj, VersionedApi, Request<express__default.ParamsDictionary, any, any, ParsedQs$1, Record<string, any>>, Response<any, Record<string, any>>, NextFunction, Auth>;
|
|
321
|
-
|
|
322
|
-
/**
|
|
323
|
-
* Creates a GET route handler with schema validation and type safety.
|
|
324
|
-
*
|
|
325
|
-
* @template SV - Schema validator type extending AnySchemaValidator
|
|
326
|
-
* @template Name - The name of the route
|
|
327
|
-
* @template Path - Route path type extending string with leading slash
|
|
328
|
-
* @template P - Parameters object type extending ParamsObject
|
|
329
|
-
* @template ResBodyMap - Response body map type extending ResponsesObject
|
|
330
|
-
* @template ReqBody - Request body type extending Body
|
|
331
|
-
* @template ReqQuery - Request query type extending QueryObject
|
|
332
|
-
* @template ReqHeaders - Request headers type extending HeadersObject
|
|
333
|
-
* @template ResHeaders - Response headers type extending HeadersObject
|
|
334
|
-
* @template LocalsObj - Local variables type extending Record<string, unknown>
|
|
335
|
-
* @template Auth - Auth methods type extending AuthMethodsBase
|
|
336
|
-
*
|
|
337
|
-
* @param {SV} schemaValidator - Schema validator instance
|
|
338
|
-
* @param {Path} path - Route path starting with '/'
|
|
339
|
-
* @param {ContractDetails<SV, 'get', Name, Path, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, Request, Auth>} contractDetails - Contract details for route validation
|
|
340
|
-
* @param {...ExpressLikeSchemaHandler[]} handlers - Route handler middleware functions
|
|
341
|
-
* @returns {Function} Express route handler with schema validation
|
|
342
|
-
*
|
|
343
|
-
* @example
|
|
344
|
-
* ```typescript
|
|
345
|
-
* const getUser = get(
|
|
346
|
-
* schemaValidator,
|
|
347
|
-
* '/users/:id',
|
|
348
|
-
* {
|
|
349
|
-
* params: { id: 'string' },
|
|
350
|
-
* responses: {
|
|
351
|
-
* 200: { type: 'object', properties: { name: { type: 'string' } } }
|
|
352
|
-
* }
|
|
353
|
-
* },
|
|
354
|
-
* async (req, res) => {
|
|
355
|
-
* const user = await getUserById(req.params.id);
|
|
356
|
-
* res.json(user);
|
|
357
|
-
* }
|
|
358
|
-
* );
|
|
359
|
-
* ```
|
|
360
|
-
*/
|
|
361
|
-
declare const get: <SV extends AnySchemaValidator, Name extends string, Path extends `/${string}`, P extends ParamsObject<SV>, ResBodyMap extends ResponsesObject<SV>, ReqBody extends Body<SV>, ReqQuery extends QueryObject<SV>, ReqHeaders extends HeadersObject<SV>, ResHeaders extends HeadersObject<SV>, LocalsObj extends Record<string, unknown>, const VersionedApi extends VersionSchema<SV, "get">, const Auth extends SchemaAuthMethods<SV, P, ReqBody, ReqQuery, ReqHeaders, VersionedApi, Request>>(schemaValidator: SV, path: Path, contractDetails: ContractDetails<SV, Name, "get", Path, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, VersionedApi, Request, Auth>, ...handlers: ExpressLikeSchemaHandler<SV, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, LocalsObj, VersionedApi, ResolvedSessionObject<SV, Auth, SessionObject<SV>>, Request, Response, NextFunction>[]) => _forklaunch_core_http.ExpressLikeTypedHandler<SV, Name, "get", Path, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, LocalsObj, VersionedApi, Request<express__default.ParamsDictionary, any, any, ParsedQs$1, Record<string, any>>, Response<any, Record<string, any>>, NextFunction, Auth>;
|
|
362
|
-
|
|
363
|
-
/**
|
|
364
|
-
* Creates a HEAD route handler with schema validation and type safety.
|
|
365
|
-
*
|
|
366
|
-
* @template SV - The schema validator type
|
|
367
|
-
* @template Name - The name of the route
|
|
368
|
-
* @template Path - The route path type
|
|
369
|
-
* @template P - The path parameters type
|
|
370
|
-
* @template ResBodyMap - The response body map type
|
|
371
|
-
* @template ReqQuery - The request query parameters type
|
|
372
|
-
* @template ReqHeaders - The request headers type
|
|
373
|
-
* @template ResHeaders - The response headers type
|
|
374
|
-
* @template LocalsObj - The locals object type
|
|
375
|
-
* @template Auth - The authentication method type
|
|
376
|
-
*
|
|
377
|
-
* @param {SV} schemaValidator - The schema validator instance
|
|
378
|
-
* @param {Path} path - The route path
|
|
379
|
-
* @param {ContractDetails<SV, 'head', Name, Path, P, ResBodyMap, never, ReqQuery, ReqHeaders, ResHeaders, Request, Auth>} contractDetails - The contract details for the route
|
|
380
|
-
* @param {...ExpressLikeSchemaHandler<SV, P, ResBodyMap, never, ReqQuery, ReqHeaders, ResHeaders, LocalsObj, Request, Response, NextFunction>[]} handlers - The route handlers
|
|
381
|
-
*
|
|
382
|
-
* @returns {void} - Returns nothing, registers the route with Express
|
|
383
|
-
*
|
|
384
|
-
* @example
|
|
385
|
-
* ```typescript
|
|
386
|
-
* head(
|
|
387
|
-
* schemaValidator,
|
|
388
|
-
* '/files/:id',
|
|
389
|
-
* {
|
|
390
|
-
* summary: 'Get file metadata',
|
|
391
|
-
* description: 'Returns metadata about a file without the file content',
|
|
392
|
-
* tags: ['files'],
|
|
393
|
-
* parameters: [
|
|
394
|
-
* {
|
|
395
|
-
* name: 'id',
|
|
396
|
-
* in: 'path',
|
|
397
|
-
* required: true,
|
|
398
|
-
* schema: { type: 'string' }
|
|
399
|
-
* }
|
|
400
|
-
* ],
|
|
401
|
-
* responses: {
|
|
402
|
-
* 200: {
|
|
403
|
-
* description: 'File metadata',
|
|
404
|
-
* headers: {
|
|
405
|
-
* 'Content-Length': {
|
|
406
|
-
* schema: { type: 'integer' }
|
|
407
|
-
* },
|
|
408
|
-
* 'Content-Type': {
|
|
409
|
-
* schema: { type: 'string' }
|
|
410
|
-
* }
|
|
411
|
-
* }
|
|
412
|
-
* }
|
|
413
|
-
* }
|
|
414
|
-
* },
|
|
415
|
-
* async (req, res) => {
|
|
416
|
-
* const { id } = req.params;
|
|
417
|
-
* const metadata = await getFileMetadata(id);
|
|
418
|
-
* res.set('Content-Length', metadata.size);
|
|
419
|
-
* res.set('Content-Type', metadata.type);
|
|
420
|
-
* res.status(200).end();
|
|
421
|
-
* }
|
|
422
|
-
* );
|
|
423
|
-
* ```
|
|
424
|
-
*/
|
|
425
|
-
declare const head: <SV extends AnySchemaValidator, Name extends string, Path extends `/${string}`, P extends ParamsObject<SV>, ResBodyMap extends ResponsesObject<SV>, ReqBody extends Body<SV>, ReqQuery extends QueryObject<SV>, ReqHeaders extends HeadersObject<SV>, ResHeaders extends HeadersObject<SV>, LocalsObj extends Record<string, unknown>, const VersionedApi extends VersionSchema<SV, "head">, const Auth extends SchemaAuthMethods<SV, P, ReqBody, ReqQuery, ReqHeaders, VersionedApi, Request>>(schemaValidator: SV, path: Path, contractDetails: ContractDetails<SV, Name, "head", Path, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, VersionedApi, Request, Auth>, ...handlers: ExpressLikeSchemaHandler<SV, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, LocalsObj, VersionedApi, ResolvedSessionObject<SV, Auth, SessionObject<SV>>, Request, Response, NextFunction>[]) => _forklaunch_core_http.ExpressLikeTypedHandler<SV, Name, "head", Path, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, LocalsObj, VersionedApi, Request<express__default.ParamsDictionary, any, any, ParsedQs$1, Record<string, any>>, Response<any, Record<string, any>>, NextFunction, Auth>;
|
|
426
|
-
|
|
427
|
-
/**
|
|
428
|
-
* Creates a LINK route handler with schema validation and type safety.
|
|
429
|
-
*
|
|
430
|
-
* @template SV - The schema validator type
|
|
431
|
-
* @template Name - The name of the route
|
|
432
|
-
* @template Path - The route path type
|
|
433
|
-
* @template P - The path parameters type
|
|
434
|
-
* @template ResBodyMap - The response body map type
|
|
435
|
-
* @template ReqBody - The request body type
|
|
436
|
-
* @template ReqQuery - The request query parameters type
|
|
437
|
-
* @template ReqHeaders - The request headers type
|
|
438
|
-
* @template ResHeaders - The response headers type
|
|
439
|
-
* @template LocalsObj - The locals object type
|
|
440
|
-
* @template Auth - The authentication methods base type
|
|
441
|
-
*
|
|
442
|
-
* @param {SV} schemaValidator - The schema validator instance
|
|
443
|
-
* @param {Path} path - The route path
|
|
444
|
-
* @param {ContractDetails<SV, 'middleware', Name, Path, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, Request, Auth>} contractDetails - The contract details for the route
|
|
445
|
-
* @param {...ExpressLikeSchemaHandler<SV, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, LocalsObj, Request, Response, NextFunction>[]} handlers - The route handlers
|
|
446
|
-
*
|
|
447
|
-
* @returns {void} - Returns nothing, registers the route with Express
|
|
448
|
-
*
|
|
449
|
-
* @example
|
|
450
|
-
* ```typescript
|
|
451
|
-
* link(
|
|
452
|
-
* schemaValidator,
|
|
453
|
-
* '/resources/:id',
|
|
454
|
-
* {
|
|
455
|
-
* summary: 'Link resources',
|
|
456
|
-
* description: 'Establishes a relationship between two resources',
|
|
457
|
-
* tags: ['resources'],
|
|
458
|
-
* parameters: [
|
|
459
|
-
* {
|
|
460
|
-
* name: 'id',
|
|
461
|
-
* in: 'path',
|
|
462
|
-
* required: true,
|
|
463
|
-
* schema: { type: 'string' }
|
|
464
|
-
* }
|
|
465
|
-
* ],
|
|
466
|
-
* requestBody: {
|
|
467
|
-
* content: {
|
|
468
|
-
* 'application/json': {
|
|
469
|
-
* schema: {
|
|
470
|
-
* type: 'object',
|
|
471
|
-
* properties: {
|
|
472
|
-
* targetId: { type: 'string' },
|
|
473
|
-
* relationshipType: { type: 'string' }
|
|
474
|
-
* }
|
|
475
|
-
* }
|
|
476
|
-
* }
|
|
477
|
-
* }
|
|
478
|
-
* },
|
|
479
|
-
* responses: {
|
|
480
|
-
* 201: {
|
|
481
|
-
* description: 'Resources linked successfully',
|
|
482
|
-
* content: {
|
|
483
|
-
* 'application/json': {
|
|
484
|
-
* schema: {
|
|
485
|
-
* type: 'object',
|
|
486
|
-
* properties: {
|
|
487
|
-
* sourceId: { type: 'string' },
|
|
488
|
-
* targetId: { type: 'string' },
|
|
489
|
-
* relationshipType: { type: 'string' }
|
|
490
|
-
* }
|
|
491
|
-
* }
|
|
492
|
-
* }
|
|
493
|
-
* }
|
|
494
|
-
* }
|
|
495
|
-
* }
|
|
496
|
-
* },
|
|
497
|
-
* async (req, res) => {
|
|
498
|
-
* const { id } = req.params;
|
|
499
|
-
* const { targetId, relationshipType } = req.body;
|
|
500
|
-
* const result = await linkResources(id, targetId, relationshipType);
|
|
501
|
-
* res.status(201).json(result);
|
|
502
|
-
* }
|
|
503
|
-
* );
|
|
504
|
-
* ```
|
|
505
|
-
*/
|
|
506
|
-
declare const link: <SV extends AnySchemaValidator, Name extends string, Path extends `/${string}`, P extends ParamsObject<SV>, ResBodyMap extends ResponsesObject<SV>, ReqBody extends Body<SV>, ReqQuery extends QueryObject<SV>, ReqHeaders extends HeadersObject<SV>, ResHeaders extends HeadersObject<SV>, LocalsObj extends Record<string, unknown>, const VersionedApi extends VersionSchema<SV, "middleware">, const Auth extends SchemaAuthMethods<SV, P, ReqBody, ReqQuery, ReqHeaders, VersionedApi, Request>>(schemaValidator: SV, path: Path, contractDetails: ContractDetails<SV, Name, "middleware", Path, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, VersionedApi, Request, Auth>, ...handlers: ExpressLikeSchemaHandler<SV, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, LocalsObj, VersionedApi, ResolvedSessionObject<SV, Auth, SessionObject<SV>>, Request, Response, NextFunction>[]) => {
|
|
507
|
-
_typedHandler: true;
|
|
508
|
-
_path: Path;
|
|
509
|
-
contractDetails: _forklaunch_core_http.MiddlewareContractDetails<SV, Name, Path, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, VersionedApi, Request<express__default.ParamsDictionary, any, any, ParsedQs$1, Record<string, any>>, Auth>;
|
|
510
|
-
handlers: ExpressLikeSchemaHandler<SV, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, LocalsObj, VersionedApi, ResolvedSessionObject<SV, Auth, SessionObject<SV>>, Request<express__default.ParamsDictionary, any, any, ParsedQs$1, Record<string, any>>, Response<any, Record<string, any>>, NextFunction>[];
|
|
511
|
-
};
|
|
512
|
-
|
|
513
|
-
/**
|
|
514
|
-
* Creates a LOCK route handler with schema validation and type safety.
|
|
515
|
-
*
|
|
516
|
-
* @template SV - The schema validator type
|
|
517
|
-
* @template Name - The name of the route
|
|
518
|
-
* @template Path - The route path type
|
|
519
|
-
* @template P - The path parameters type
|
|
520
|
-
* @template ResBodyMap - The response body map type
|
|
521
|
-
* @template ReqBody - The request body type
|
|
522
|
-
* @template ReqQuery - The request query parameters type
|
|
523
|
-
* @template ReqHeaders - The request headers type
|
|
524
|
-
* @template ResHeaders - The response headers type
|
|
525
|
-
* @template LocalsObj - The locals object type
|
|
526
|
-
* @template Auth - The authentication method type
|
|
527
|
-
*
|
|
528
|
-
* @param {SV} schemaValidator - The schema validator instance
|
|
529
|
-
* @param {Path} path - The route path
|
|
530
|
-
* @param {ContractDetails<SV, 'middleware', Name, Path, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, Request, Auth>} contractDetails - The contract details for the route
|
|
531
|
-
* @param {...ExpressLikeSchemaHandler<SV, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, LocalsObj, Request, Auth>} handlers - The route handlers
|
|
532
|
-
*
|
|
533
|
-
* @returns {void} - Returns nothing, registers the route with Express
|
|
534
|
-
*
|
|
535
|
-
* @example
|
|
536
|
-
* ```typescript
|
|
537
|
-
* lock(
|
|
538
|
-
* schemaValidator,
|
|
539
|
-
* '/resources/:id',
|
|
540
|
-
* {
|
|
541
|
-
* summary: 'Lock resource',
|
|
542
|
-
* description: 'Locks a resource to prevent concurrent modifications',
|
|
543
|
-
* tags: ['resources'],
|
|
544
|
-
* parameters: [
|
|
545
|
-
* {
|
|
546
|
-
* name: 'id',
|
|
547
|
-
* in: 'path',
|
|
548
|
-
* required: true,
|
|
549
|
-
* schema: { type: 'string' }
|
|
550
|
-
* }
|
|
551
|
-
* ],
|
|
552
|
-
* requestBody: {
|
|
553
|
-
* content: {
|
|
554
|
-
* 'application/json': {
|
|
555
|
-
* schema: {
|
|
556
|
-
* type: 'object',
|
|
557
|
-
* properties: {
|
|
558
|
-
* timeout: { type: 'integer' },
|
|
559
|
-
* owner: { type: 'string' }
|
|
560
|
-
* }
|
|
561
|
-
* }
|
|
562
|
-
* }
|
|
563
|
-
* }
|
|
564
|
-
* },
|
|
565
|
-
* responses: {
|
|
566
|
-
* 200: {
|
|
567
|
-
* description: 'Resource locked successfully',
|
|
568
|
-
* content: {
|
|
569
|
-
* 'application/json': {
|
|
570
|
-
* schema: {
|
|
571
|
-
* type: 'object',
|
|
572
|
-
* properties: {
|
|
573
|
-
* lockToken: { type: 'string' },
|
|
574
|
-
* expiresAt: { type: 'string', format: 'date-time' }
|
|
575
|
-
* }
|
|
576
|
-
* }
|
|
577
|
-
* }
|
|
578
|
-
* }
|
|
579
|
-
* }
|
|
580
|
-
* }
|
|
581
|
-
* },
|
|
582
|
-
* async (req, res) => {
|
|
583
|
-
* const { id } = req.params;
|
|
584
|
-
* const { timeout, owner } = req.body;
|
|
585
|
-
* const result = await lockResource(id, timeout, owner);
|
|
586
|
-
* res.json(result);
|
|
587
|
-
* }
|
|
588
|
-
* );
|
|
589
|
-
* ```
|
|
590
|
-
*/
|
|
591
|
-
declare const lock: <SV extends AnySchemaValidator, Name extends string, Path extends `/${string}`, P extends ParamsObject<SV>, ResBodyMap extends ResponsesObject<SV>, ReqBody extends Body<SV>, ReqQuery extends QueryObject<SV>, ReqHeaders extends HeadersObject<SV>, ResHeaders extends HeadersObject<SV>, LocalsObj extends Record<string, unknown>, const VersionedApi extends VersionSchema<SV, "middleware">, const Auth extends SchemaAuthMethods<SV, P, ReqBody, ReqQuery, ReqHeaders, VersionedApi, Request>>(schemaValidator: SV, path: Path, contractDetails: ContractDetails<SV, Name, "middleware", Path, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, VersionedApi, Request, Auth>, ...handlers: ExpressLikeSchemaHandler<SV, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, LocalsObj, VersionedApi, ResolvedSessionObject<SV, Auth, SessionObject<SV>>, Request, Response, NextFunction>[]) => {
|
|
592
|
-
_typedHandler: true;
|
|
593
|
-
_path: Path;
|
|
594
|
-
contractDetails: _forklaunch_core_http.MiddlewareContractDetails<SV, Name, Path, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, VersionedApi, Request<express__default.ParamsDictionary, any, any, ParsedQs$1, Record<string, any>>, Auth>;
|
|
595
|
-
handlers: ExpressLikeSchemaHandler<SV, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, LocalsObj, VersionedApi, ResolvedSessionObject<SV, Auth, SessionObject<SV>>, Request<express__default.ParamsDictionary, any, any, ParsedQs$1, Record<string, any>>, Response<any, Record<string, any>>, NextFunction>[];
|
|
596
|
-
};
|
|
597
|
-
|
|
598
|
-
/**
|
|
599
|
-
* Creates a M-SEARCH route handler with schema validation and type safety.
|
|
600
|
-
*
|
|
601
|
-
* @template SV - The schema validator type
|
|
602
|
-
* @template Name - The name of the route
|
|
603
|
-
* @template Path - The route path type
|
|
604
|
-
* @template P - The path parameters type
|
|
605
|
-
* @template ResBodyMap - The response body map type
|
|
606
|
-
* @template ReqBody - The request body type
|
|
607
|
-
* @template ReqQuery - The request query parameters type
|
|
608
|
-
* @template ReqHeaders - The request headers type
|
|
609
|
-
* @template ResHeaders - The response headers type
|
|
610
|
-
* @template LocalsObj - The locals object type
|
|
611
|
-
* @template Auth - The authentication methods base type
|
|
612
|
-
*
|
|
613
|
-
* @param {SV} schemaValidator - The schema validator instance
|
|
614
|
-
* @param {Path} path - The route path
|
|
615
|
-
* @param {ContractDetails<SV, 'middleware', Name, Path, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, Request, Auth>} contractDetails - The contract details for the route
|
|
616
|
-
* @param {...ExpressLikeSchemaHandler<SV, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, LocalsObj, Request, Auth>} handlers - The route handlers
|
|
617
|
-
*
|
|
618
|
-
* @returns {void} - Returns nothing, registers the route with Express
|
|
619
|
-
*
|
|
620
|
-
* @example
|
|
621
|
-
* ```typescript
|
|
622
|
-
* mSearch(
|
|
623
|
-
* schemaValidator,
|
|
624
|
-
* '/devices',
|
|
625
|
-
* {
|
|
626
|
-
* summary: 'Search for devices',
|
|
627
|
-
* description: 'Multicast search for devices on the network',
|
|
628
|
-
* tags: ['devices'],
|
|
629
|
-
* requestBody: {
|
|
630
|
-
* content: {
|
|
631
|
-
* 'application/json': {
|
|
632
|
-
* schema: {
|
|
633
|
-
* type: 'object',
|
|
634
|
-
* properties: {
|
|
635
|
-
* searchType: { type: 'string' },
|
|
636
|
-
* maxWait: { type: 'integer' }
|
|
637
|
-
* }
|
|
638
|
-
* }
|
|
639
|
-
* }
|
|
640
|
-
* }
|
|
641
|
-
* },
|
|
642
|
-
* responses: {
|
|
643
|
-
* 200: {
|
|
644
|
-
* description: 'Devices found',
|
|
645
|
-
* content: {
|
|
646
|
-
* 'application/json': {
|
|
647
|
-
* schema: {
|
|
648
|
-
* type: 'array',
|
|
649
|
-
* items: {
|
|
650
|
-
* type: 'object',
|
|
651
|
-
* properties: {
|
|
652
|
-
* id: { type: 'string' },
|
|
653
|
-
* type: { type: 'string' },
|
|
654
|
-
* location: { type: 'string' }
|
|
655
|
-
* }
|
|
656
|
-
* }
|
|
657
|
-
* }
|
|
658
|
-
* }
|
|
659
|
-
* }
|
|
660
|
-
* }
|
|
661
|
-
* }
|
|
662
|
-
* },
|
|
663
|
-
* async (req, res) => {
|
|
664
|
-
* const { searchType, maxWait } = req.body;
|
|
665
|
-
* const devices = await searchDevices(searchType, maxWait);
|
|
666
|
-
* res.json(devices);
|
|
667
|
-
* }
|
|
668
|
-
* );
|
|
669
|
-
* ```
|
|
670
|
-
*/
|
|
671
|
-
declare const mSearch: <SV extends AnySchemaValidator, Name extends string, Path extends `/${string}`, P extends ParamsObject<SV>, ResBodyMap extends ResponsesObject<SV>, ReqBody extends Body<SV>, ReqQuery extends QueryObject<SV>, ReqHeaders extends HeadersObject<SV>, ResHeaders extends HeadersObject<SV>, LocalsObj extends Record<string, unknown>, const VersionedApi extends VersionSchema<SV, "middleware">, const Auth extends SchemaAuthMethods<SV, P, ReqBody, ReqQuery, ReqHeaders, VersionedApi, Request>>(schemaValidator: SV, path: Path, contractDetails: ContractDetails<SV, Name, "middleware", Path, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, VersionedApi, Request, Auth>, ...handlers: ExpressLikeSchemaHandler<SV, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, LocalsObj, VersionedApi, ResolvedSessionObject<SV, Auth, SessionObject<SV>>, Request, Response, NextFunction>[]) => {
|
|
672
|
-
_typedHandler: true;
|
|
673
|
-
_path: Path;
|
|
674
|
-
contractDetails: _forklaunch_core_http.MiddlewareContractDetails<SV, Name, Path, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, VersionedApi, Request<express__default.ParamsDictionary, any, any, ParsedQs$1, Record<string, any>>, Auth>;
|
|
675
|
-
handlers: ExpressLikeSchemaHandler<SV, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, LocalsObj, VersionedApi, ResolvedSessionObject<SV, Auth, SessionObject<SV>>, Request<express__default.ParamsDictionary, any, any, ParsedQs$1, Record<string, any>>, Response<any, Record<string, any>>, NextFunction>[];
|
|
676
|
-
};
|
|
677
|
-
|
|
678
|
-
/**
|
|
679
|
-
* Creates a MERGE route handler with schema validation and type safety.
|
|
680
|
-
*
|
|
681
|
-
* @template SV - The schema validator type
|
|
682
|
-
* @template Name - The name of the route
|
|
683
|
-
* @template Path - The route path type
|
|
684
|
-
* @template P - The path parameters type
|
|
685
|
-
* @template ResBodyMap - The response body map type
|
|
686
|
-
* @template ReqBody - The request body type
|
|
687
|
-
* @template ReqQuery - The request query parameters type
|
|
688
|
-
* @template ReqHeaders - The request headers type
|
|
689
|
-
* @template ResHeaders - The response headers type
|
|
690
|
-
* @template LocalsObj - The locals object type
|
|
691
|
-
* @template Auth - The authentication methods base type
|
|
692
|
-
*
|
|
693
|
-
* @param {SV} schemaValidator - The schema validator instance
|
|
694
|
-
* @param {Path} path - The route path
|
|
695
|
-
* @param {ContractDetails<SV, 'middleware', Name, Path, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, Request, Auth>} contractDetails - The contract details for the route
|
|
696
|
-
* @param {...ExpressLikeSchemaHandler<SV, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, LocalsObj, Request, Auth>} handlers - The route handlers
|
|
697
|
-
*
|
|
698
|
-
* @returns {void} - Returns nothing, registers the route with Express
|
|
699
|
-
*
|
|
700
|
-
* @example
|
|
701
|
-
* ```typescript
|
|
702
|
-
* merge(
|
|
703
|
-
* schemaValidator,
|
|
704
|
-
* '/documents/:id',
|
|
705
|
-
* {
|
|
706
|
-
* summary: 'Merge document',
|
|
707
|
-
* description: 'Merges changes from multiple sources into a document',
|
|
708
|
-
* tags: ['documents'],
|
|
709
|
-
* parameters: [
|
|
710
|
-
* {
|
|
711
|
-
* name: 'id',
|
|
712
|
-
* in: 'path',
|
|
713
|
-
* required: true,
|
|
714
|
-
* schema: { type: 'string' }
|
|
715
|
-
* }
|
|
716
|
-
* ],
|
|
717
|
-
* requestBody: {
|
|
718
|
-
* content: {
|
|
719
|
-
* 'application/json': {
|
|
720
|
-
* schema: {
|
|
721
|
-
* type: 'object',
|
|
722
|
-
* properties: {
|
|
723
|
-
* changes: {
|
|
724
|
-
* type: 'array',
|
|
725
|
-
* items: {
|
|
726
|
-
* type: 'object',
|
|
727
|
-
* properties: {
|
|
728
|
-
* source: { type: 'string' },
|
|
729
|
-
* content: { type: 'string' }
|
|
730
|
-
* }
|
|
731
|
-
* }
|
|
732
|
-
* }
|
|
733
|
-
* }
|
|
734
|
-
* }
|
|
735
|
-
* }
|
|
736
|
-
* }
|
|
737
|
-
* },
|
|
738
|
-
* responses: {
|
|
739
|
-
* 200: {
|
|
740
|
-
* description: 'Document merged successfully',
|
|
741
|
-
* content: {
|
|
742
|
-
* 'application/json': {
|
|
743
|
-
* schema: {
|
|
744
|
-
* type: 'object',
|
|
745
|
-
* properties: {
|
|
746
|
-
* id: { type: 'string' },
|
|
747
|
-
* mergedContent: { type: 'string' },
|
|
748
|
-
* conflicts: {
|
|
749
|
-
* type: 'array',
|
|
750
|
-
* items: { type: 'string' }
|
|
751
|
-
* }
|
|
752
|
-
* }
|
|
753
|
-
* }
|
|
754
|
-
* }
|
|
755
|
-
* }
|
|
756
|
-
* }
|
|
757
|
-
* }
|
|
758
|
-
* },
|
|
759
|
-
* async (req, res) => {
|
|
760
|
-
* const { id } = req.params;
|
|
761
|
-
* const { changes } = req.body;
|
|
762
|
-
* const result = await mergeDocument(id, changes);
|
|
763
|
-
* res.json(result);
|
|
764
|
-
* }
|
|
765
|
-
* );
|
|
766
|
-
*/
|
|
767
|
-
declare const merge: <SV extends AnySchemaValidator, Name extends string, Path extends `/${string}`, P extends ParamsObject<SV>, ResBodyMap extends ResponsesObject<SV>, ReqBody extends Body<SV>, ReqQuery extends QueryObject<SV>, ReqHeaders extends HeadersObject<SV>, ResHeaders extends HeadersObject<SV>, LocalsObj extends Record<string, unknown>, const VersionedApi extends VersionSchema<SV, "middleware">, const Auth extends SchemaAuthMethods<SV, P, ReqBody, ReqQuery, ReqHeaders, VersionedApi, Request>>(schemaValidator: SV, path: Path, contractDetails: ContractDetails<SV, Name, "middleware", Path, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, VersionedApi, Request, Auth>, ...handlers: ExpressLikeSchemaHandler<SV, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, LocalsObj, VersionedApi, ResolvedSessionObject<SV, Auth, SessionObject<SV>>, Request, Response, NextFunction>[]) => {
|
|
768
|
-
_typedHandler: true;
|
|
769
|
-
_path: Path;
|
|
770
|
-
contractDetails: _forklaunch_core_http.MiddlewareContractDetails<SV, Name, Path, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, VersionedApi, Request<express__default.ParamsDictionary, any, any, ParsedQs$1, Record<string, any>>, Auth>;
|
|
771
|
-
handlers: ExpressLikeSchemaHandler<SV, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, LocalsObj, VersionedApi, ResolvedSessionObject<SV, Auth, SessionObject<SV>>, Request<express__default.ParamsDictionary, any, any, ParsedQs$1, Record<string, any>>, Response<any, Record<string, any>>, NextFunction>[];
|
|
772
|
-
};
|
|
773
|
-
|
|
774
|
-
/**
|
|
775
|
-
* Creates a middleware route handler with schema validation and type safety.
|
|
776
|
-
*
|
|
777
|
-
* @template SV - The schema validator type
|
|
778
|
-
* @template Name - The name of the route
|
|
779
|
-
* @template Path - The route path type
|
|
780
|
-
* @template P - The path parameters type
|
|
781
|
-
* @template ResBodyMap - The response body map type
|
|
782
|
-
* @template ReqBody - The request body type
|
|
783
|
-
* @template ReqQuery - The request query parameters type
|
|
784
|
-
* @template ReqHeaders - The request headers type
|
|
785
|
-
* @template ResHeaders - The response headers type
|
|
786
|
-
* @template LocalsObj - The locals object type
|
|
787
|
-
* @template Auth - The authentication methods type
|
|
788
|
-
*
|
|
789
|
-
* @param {SV} schemaValidator - The schema validator instance
|
|
790
|
-
* @param {Name} name - The name of the route
|
|
791
|
-
* @param {Path} path - The route path
|
|
792
|
-
* @param {ContractDetails<SV, 'middleware', Name, Path, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, Request, Auth>} contractDetails - The contract details for the route
|
|
793
|
-
* @param {...ExpressLikeSchemaHandler<SV, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, LocalsObj, Request, Response, NextFunction>[]} handlers - The route handlers
|
|
794
|
-
*
|
|
795
|
-
* @returns {void} - Returns nothing, registers the route with Express
|
|
796
|
-
*
|
|
797
|
-
* @example
|
|
798
|
-
* ```typescript
|
|
799
|
-
* middleware(
|
|
800
|
-
* schemaValidator,
|
|
801
|
-
* '/middleware',
|
|
802
|
-
* {
|
|
803
|
-
* summary: 'Middleware example',
|
|
804
|
-
* description: 'Example middleware route',
|
|
805
|
-
* tags: ['middleware'],
|
|
806
|
-
* responses: {
|
|
807
|
-
* 200: {
|
|
808
|
-
* description: 'Middleware executed successfully',
|
|
809
|
-
* content: {
|
|
810
|
-
* 'application/json': {
|
|
811
|
-
* schema: {
|
|
812
|
-
* type: 'object',
|
|
813
|
-
* properties: {
|
|
814
|
-
* message: { type: 'string' }
|
|
815
|
-
* }
|
|
816
|
-
* }
|
|
817
|
-
* }
|
|
818
|
-
* }
|
|
819
|
-
* }
|
|
820
|
-
* }
|
|
821
|
-
* },
|
|
822
|
-
* async (req, res, next) => {
|
|
823
|
-
* // Middleware logic
|
|
824
|
-
* next();
|
|
825
|
-
* }
|
|
826
|
-
* );
|
|
827
|
-
* ```
|
|
828
|
-
*/
|
|
829
|
-
declare const middleware: <SV extends AnySchemaValidator, Name extends string, Path extends `/${string}`, P extends ParamsObject<SV>, ResBodyMap extends ResponsesObject<SV>, ReqBody extends Body<SV>, ReqQuery extends QueryObject<SV>, ReqHeaders extends HeadersObject<SV>, ResHeaders extends HeadersObject<SV>, LocalsObj extends Record<string, unknown>, const VersionedApi extends VersionSchema<SV, "middleware">, const Auth extends SchemaAuthMethods<SV, P, ReqBody, ReqQuery, ReqHeaders, VersionedApi, Request>>(schemaValidator: SV, path: Path, contractDetails: ContractDetails<SV, Name, "middleware", Path, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, VersionedApi, Request, Auth>, ...handlers: ExpressLikeSchemaHandler<SV, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, LocalsObj, VersionedApi, ResolvedSessionObject<SV, Auth, SessionObject<SV>>, Request, Response, NextFunction>[]) => {
|
|
830
|
-
_typedHandler: true;
|
|
831
|
-
_path: Path;
|
|
832
|
-
contractDetails: _forklaunch_core_http.MiddlewareContractDetails<SV, Name, Path, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, VersionedApi, Request<express__default.ParamsDictionary, any, any, ParsedQs$1, Record<string, any>>, Auth>;
|
|
833
|
-
handlers: ExpressLikeSchemaHandler<SV, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, LocalsObj, VersionedApi, ResolvedSessionObject<SV, Auth, SessionObject<SV>>, Request<express__default.ParamsDictionary, any, any, ParsedQs$1, Record<string, any>>, Response<any, Record<string, any>>, NextFunction>[];
|
|
834
|
-
};
|
|
835
|
-
|
|
836
|
-
/**
|
|
837
|
-
* Creates an MKCACTIVITY route handler with schema validation and type safety.
|
|
838
|
-
*
|
|
839
|
-
* @template SV - The schema validator type
|
|
840
|
-
* @template Name - The name of the route
|
|
841
|
-
* @template Path - The route path type
|
|
842
|
-
* @template P - The path parameters type
|
|
843
|
-
* @template ResBodyMap - The response body map type
|
|
844
|
-
* @template ReqBody - The request body type
|
|
845
|
-
* @template ReqQuery - The request query parameters type
|
|
846
|
-
* @template ReqHeaders - The request headers type
|
|
847
|
-
* @template ResHeaders - The response headers type
|
|
848
|
-
* @template LocalsObj - The locals object type
|
|
849
|
-
* @template Auth - The authentication methods base type
|
|
850
|
-
*
|
|
851
|
-
* @param {SV} schemaValidator - The schema validator instance
|
|
852
|
-
* @param {Path} path - The route path
|
|
853
|
-
* @param {ContractDetails<SV, 'middleware', Name, Path, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, Request, Auth>} contractDetails - The contract details for the route
|
|
854
|
-
* @param {...ExpressLikeSchemaHandler<SV, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, LocalsObj, Request, Auth>} handlers - The route handlers
|
|
855
|
-
*
|
|
856
|
-
* @returns {void} - Returns nothing, registers the route with Express
|
|
857
|
-
*
|
|
858
|
-
* @example
|
|
859
|
-
* ```typescript
|
|
860
|
-
* mkcActivity(
|
|
861
|
-
* schemaValidator,
|
|
862
|
-
* '/activities',
|
|
863
|
-
* {
|
|
864
|
-
* summary: 'Create activity',
|
|
865
|
-
* description: 'Creates a new activity',
|
|
866
|
-
* tags: ['activities'],
|
|
867
|
-
* body: {
|
|
868
|
-
* type: 'object',
|
|
869
|
-
* properties: {
|
|
870
|
-
* name: { type: 'string' },
|
|
871
|
-
* type: { type: 'string' }
|
|
872
|
-
* }
|
|
873
|
-
* },
|
|
874
|
-
* responses: {
|
|
875
|
-
* 201: {
|
|
876
|
-
* description: 'Activity created successfully',
|
|
877
|
-
* content: {
|
|
878
|
-
* 'application/json': {
|
|
879
|
-
* schema: {
|
|
880
|
-
* type: 'object',
|
|
881
|
-
* properties: {
|
|
882
|
-
* id: { type: 'string' },
|
|
883
|
-
* name: { type: 'string' },
|
|
884
|
-
* type: { type: 'string' }
|
|
885
|
-
* }
|
|
886
|
-
* }
|
|
887
|
-
* }
|
|
888
|
-
* }
|
|
889
|
-
* }
|
|
890
|
-
* }
|
|
891
|
-
* },
|
|
892
|
-
* async (req, res) => {
|
|
893
|
-
* const { name, type } = req.body;
|
|
894
|
-
* // Create activity logic
|
|
895
|
-
* res.status(201).json({ id: 'act_123', name, type });
|
|
896
|
-
* }
|
|
897
|
-
* );
|
|
898
|
-
* ```
|
|
899
|
-
*/
|
|
900
|
-
declare const mkcActivity: <SV extends AnySchemaValidator, Name extends string, Path extends `/${string}`, P extends ParamsObject<SV>, ResBodyMap extends ResponsesObject<SV>, ReqBody extends Body<SV>, ReqQuery extends QueryObject<SV>, ReqHeaders extends HeadersObject<SV>, ResHeaders extends HeadersObject<SV>, LocalsObj extends Record<string, unknown>, const VersionedApi extends VersionSchema<SV, "middleware">, const Auth extends SchemaAuthMethods<SV, P, ReqBody, ReqQuery, ReqHeaders, VersionedApi, Request>>(schemaValidator: SV, path: Path, contractDetails: ContractDetails<SV, Name, "middleware", Path, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, VersionedApi, Request, Auth>, ...handlers: ExpressLikeSchemaHandler<SV, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, LocalsObj, VersionedApi, ResolvedSessionObject<SV, Auth, SessionObject<SV>>, Request, Response, NextFunction>[]) => {
|
|
901
|
-
_typedHandler: true;
|
|
902
|
-
_path: Path;
|
|
903
|
-
contractDetails: _forklaunch_core_http.MiddlewareContractDetails<SV, Name, Path, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, VersionedApi, Request<express__default.ParamsDictionary, any, any, ParsedQs$1, Record<string, any>>, Auth>;
|
|
904
|
-
handlers: ExpressLikeSchemaHandler<SV, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, LocalsObj, VersionedApi, ResolvedSessionObject<SV, Auth, SessionObject<SV>>, Request<express__default.ParamsDictionary, any, any, ParsedQs$1, Record<string, any>>, Response<any, Record<string, any>>, NextFunction>[];
|
|
905
|
-
};
|
|
906
|
-
|
|
907
|
-
/**
|
|
908
|
-
* Creates an MKCOL route handler with schema validation and type safety.
|
|
909
|
-
*
|
|
910
|
-
* @template SV - The schema validator type
|
|
911
|
-
* @template Name - The name of the route
|
|
912
|
-
* @template Path - The route path type
|
|
913
|
-
* @template P - The path parameters type
|
|
914
|
-
* @template ResBodyMap - The response body map type
|
|
915
|
-
* @template ReqBody - The request body type
|
|
916
|
-
* @template ReqQuery - The request query parameters type
|
|
917
|
-
* @template ReqHeaders - The request headers type
|
|
918
|
-
* @template ResHeaders - The response headers type
|
|
919
|
-
* @template LocalsObj - The locals object type
|
|
920
|
-
* @template Auth - The authentication methods base type
|
|
921
|
-
*
|
|
922
|
-
* @param {SV} schemaValidator - The schema validator instance
|
|
923
|
-
* @param {Path} path - The route path
|
|
924
|
-
* @param {ContractDetails<SV, 'middleware', Name, Path, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, Request, Auth>} contractDetails - The contract details for the route
|
|
925
|
-
* @param {...ExpressLikeSchemaHandler<SV, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, LocalsObj, Request, Auth>} handlers - The route handlers
|
|
926
|
-
*
|
|
927
|
-
* @returns {void} - Returns nothing, registers the route with Express
|
|
928
|
-
*
|
|
929
|
-
* @example
|
|
930
|
-
* ```typescript
|
|
931
|
-
* mkcol(
|
|
932
|
-
* schemaValidator,
|
|
933
|
-
* '/collections',
|
|
934
|
-
* {
|
|
935
|
-
* summary: 'Create collection',
|
|
936
|
-
* description: 'Creates a new collection',
|
|
937
|
-
* tags: ['collections'],
|
|
938
|
-
* body: {
|
|
939
|
-
* type: 'object',
|
|
940
|
-
* properties: {
|
|
941
|
-
* name: { type: 'string' },
|
|
942
|
-
* description: { type: 'string' }
|
|
943
|
-
* }
|
|
944
|
-
* },
|
|
945
|
-
* responses: {
|
|
946
|
-
* 201: {
|
|
947
|
-
* description: 'Collection created successfully',
|
|
948
|
-
* content: {
|
|
949
|
-
* 'application/json': {
|
|
950
|
-
* schema: {
|
|
951
|
-
* type: 'object',
|
|
952
|
-
* properties: {
|
|
953
|
-
* id: { type: 'string' },
|
|
954
|
-
* name: { type: 'string' },
|
|
955
|
-
* description: { type: 'string' }
|
|
956
|
-
* }
|
|
957
|
-
* }
|
|
958
|
-
* }
|
|
959
|
-
* }
|
|
960
|
-
* }
|
|
961
|
-
* }
|
|
962
|
-
* },
|
|
963
|
-
* async (req, res) => {
|
|
964
|
-
* const { name, description } = req.body;
|
|
965
|
-
* // Create collection logic
|
|
966
|
-
* res.status(201).json({ id: 'col_123', name, description });
|
|
967
|
-
* }
|
|
968
|
-
* );
|
|
969
|
-
* ```
|
|
970
|
-
*/
|
|
971
|
-
declare const mkcol: <SV extends AnySchemaValidator, Name extends string, Path extends `/${string}`, P extends ParamsObject<SV>, ResBodyMap extends ResponsesObject<SV>, ReqBody extends Body<SV>, ReqQuery extends QueryObject<SV>, ReqHeaders extends HeadersObject<SV>, ResHeaders extends HeadersObject<SV>, LocalsObj extends Record<string, unknown>, const VersionedApi extends VersionSchema<SV, "middleware">, const Auth extends SchemaAuthMethods<SV, P, ReqBody, ReqQuery, ReqHeaders, VersionedApi, Request>>(schemaValidator: SV, path: Path, contractDetails: ContractDetails<SV, Name, "middleware", Path, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, VersionedApi, Request, Auth>, ...handlers: ExpressLikeSchemaHandler<SV, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, LocalsObj, VersionedApi, ResolvedSessionObject<SV, Auth, SessionObject<SV>>, Request, Response, NextFunction>[]) => {
|
|
972
|
-
_typedHandler: true;
|
|
973
|
-
_path: Path;
|
|
974
|
-
contractDetails: _forklaunch_core_http.MiddlewareContractDetails<SV, Name, Path, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, VersionedApi, Request<express__default.ParamsDictionary, any, any, ParsedQs$1, Record<string, any>>, Auth>;
|
|
975
|
-
handlers: ExpressLikeSchemaHandler<SV, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, LocalsObj, VersionedApi, ResolvedSessionObject<SV, Auth, SessionObject<SV>>, Request<express__default.ParamsDictionary, any, any, ParsedQs$1, Record<string, any>>, Response<any, Record<string, any>>, NextFunction>[];
|
|
976
|
-
};
|
|
977
|
-
|
|
978
|
-
/**
|
|
979
|
-
* Creates a MOVE route handler with schema validation and type safety.
|
|
980
|
-
*
|
|
981
|
-
* @template SV - The schema validator type
|
|
982
|
-
* @template Name - The name of the route
|
|
983
|
-
* @template Path - The route path type
|
|
984
|
-
* @template P - The path parameters type
|
|
985
|
-
* @template ResBodyMap - The response body map type
|
|
986
|
-
* @template ReqBody - The request body type
|
|
987
|
-
* @template ReqQuery - The request query parameters type
|
|
988
|
-
* @template ReqHeaders - The request headers type
|
|
989
|
-
* @template ResHeaders - The response headers type
|
|
990
|
-
* @template LocalsObj - The locals object type
|
|
991
|
-
* @template Auth - The authentication methods base type
|
|
992
|
-
*
|
|
993
|
-
* @param {SV} schemaValidator - The schema validator instance
|
|
994
|
-
* @param {Path} path - The route path
|
|
995
|
-
* @param {ContractDetails<SV, 'middleware', Name, Path, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, Request, Auth>} contractDetails - The contract details for the route
|
|
996
|
-
* @param {...ExpressLikeSchemaHandler<SV, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, LocalsObj, Request, Auth>} handlers - The route handlers
|
|
997
|
-
*
|
|
998
|
-
* @returns {void} - Returns nothing, registers the route with Express
|
|
999
|
-
*
|
|
1000
|
-
* @example
|
|
1001
|
-
* ```typescript
|
|
1002
|
-
* move(
|
|
1003
|
-
* schemaValidator,
|
|
1004
|
-
* '/resources/:id/move',
|
|
1005
|
-
* {
|
|
1006
|
-
* summary: 'Move resource',
|
|
1007
|
-
* description: 'Moves a resource to a new location',
|
|
1008
|
-
* tags: ['resources'],
|
|
1009
|
-
* pathParams: {
|
|
1010
|
-
* id: { type: 'string' }
|
|
1011
|
-
* },
|
|
1012
|
-
* body: {
|
|
1013
|
-
* type: 'object',
|
|
1014
|
-
* properties: {
|
|
1015
|
-
* destination: { type: 'string' }
|
|
1016
|
-
* }
|
|
1017
|
-
* },
|
|
1018
|
-
* responses: {
|
|
1019
|
-
* 200: {
|
|
1020
|
-
* description: 'Resource moved successfully',
|
|
1021
|
-
* content: {
|
|
1022
|
-
* 'application/json': {
|
|
1023
|
-
* schema: {
|
|
1024
|
-
* type: 'object',
|
|
1025
|
-
* properties: {
|
|
1026
|
-
* id: { type: 'string' },
|
|
1027
|
-
* location: { type: 'string' }
|
|
1028
|
-
* }
|
|
1029
|
-
* }
|
|
1030
|
-
* }
|
|
1031
|
-
* }
|
|
1032
|
-
* }
|
|
1033
|
-
* }
|
|
1034
|
-
* },
|
|
1035
|
-
* async (req, res) => {
|
|
1036
|
-
* const { id } = req.params;
|
|
1037
|
-
* const { destination } = req.body;
|
|
1038
|
-
* // Move logic
|
|
1039
|
-
* res.json({ id, location: destination });
|
|
1040
|
-
* }
|
|
1041
|
-
* );
|
|
1042
|
-
* ```
|
|
1043
|
-
*/
|
|
1044
|
-
declare const move: <SV extends AnySchemaValidator, Name extends string, Path extends `/${string}`, P extends ParamsObject<SV>, ResBodyMap extends ResponsesObject<SV>, ReqBody extends Body<SV>, ReqQuery extends QueryObject<SV>, ReqHeaders extends HeadersObject<SV>, ResHeaders extends HeadersObject<SV>, LocalsObj extends Record<string, unknown>, const VersionedApi extends VersionSchema<SV, "middleware">, const Auth extends SchemaAuthMethods<SV, P, ReqBody, ReqQuery, ReqHeaders, VersionedApi, Request>>(schemaValidator: SV, path: Path, contractDetails: ContractDetails<SV, Name, "middleware", Path, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, VersionedApi, Request, Auth>, ...handlers: ExpressLikeSchemaHandler<SV, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, LocalsObj, VersionedApi, ResolvedSessionObject<SV, Auth, SessionObject<SV>>, Request, Response, NextFunction>[]) => {
|
|
1045
|
-
_typedHandler: true;
|
|
1046
|
-
_path: Path;
|
|
1047
|
-
contractDetails: _forklaunch_core_http.MiddlewareContractDetails<SV, Name, Path, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, VersionedApi, Request<express__default.ParamsDictionary, any, any, ParsedQs$1, Record<string, any>>, Auth>;
|
|
1048
|
-
handlers: ExpressLikeSchemaHandler<SV, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, LocalsObj, VersionedApi, ResolvedSessionObject<SV, Auth, SessionObject<SV>>, Request<express__default.ParamsDictionary, any, any, ParsedQs$1, Record<string, any>>, Response<any, Record<string, any>>, NextFunction>[];
|
|
1049
|
-
};
|
|
1050
|
-
|
|
1051
|
-
/**
|
|
1052
|
-
* Creates a NOTIFY route handler with schema validation and type safety.
|
|
1053
|
-
*
|
|
1054
|
-
* @template SV - The schema validator type
|
|
1055
|
-
* @template Name - The name of the route
|
|
1056
|
-
* @template Path - The route path type
|
|
1057
|
-
* @template P - The path parameters type
|
|
1058
|
-
* @template ResBodyMap - The response body map type
|
|
1059
|
-
* @template ReqBody - The request body type
|
|
1060
|
-
* @template ReqQuery - The request query parameters type
|
|
1061
|
-
* @template ReqHeaders - The request headers type
|
|
1062
|
-
* @template ResHeaders - The response headers type
|
|
1063
|
-
* @template LocalsObj - The locals object type
|
|
1064
|
-
* @template Auth - The authentication method type
|
|
1065
|
-
*
|
|
1066
|
-
* @param {SV} schemaValidator - The schema validator instance
|
|
1067
|
-
* @param {Path} path - The route path
|
|
1068
|
-
* @param {ContractDetails<SV, 'middleware', Name, Path, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, Request, Auth>} contractDetails - The contract details for the route
|
|
1069
|
-
* @param {...ExpressLikeSchemaHandler<SV, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, LocalsObj, Request, Auth>} handlers - The route handlers
|
|
1070
|
-
*
|
|
1071
|
-
* @returns {void} - Returns nothing, registers the route with Express
|
|
1072
|
-
*
|
|
1073
|
-
* @example
|
|
1074
|
-
* ```typescript
|
|
1075
|
-
* notify(
|
|
1076
|
-
* schemaValidator,
|
|
1077
|
-
* '/notifications',
|
|
1078
|
-
* {
|
|
1079
|
-
* summary: 'Send notification',
|
|
1080
|
-
* description: 'Sends a notification to subscribers',
|
|
1081
|
-
* tags: ['notifications'],
|
|
1082
|
-
* body: {
|
|
1083
|
-
* type: 'object',
|
|
1084
|
-
* properties: {
|
|
1085
|
-
* message: { type: 'string' },
|
|
1086
|
-
* type: { type: 'string' }
|
|
1087
|
-
* }
|
|
1088
|
-
* },
|
|
1089
|
-
* responses: {
|
|
1090
|
-
* 200: {
|
|
1091
|
-
* description: 'Notification sent successfully',
|
|
1092
|
-
* content: {
|
|
1093
|
-
* 'application/json': {
|
|
1094
|
-
* schema: {
|
|
1095
|
-
* type: 'object',
|
|
1096
|
-
* properties: {
|
|
1097
|
-
* id: { type: 'string' },
|
|
1098
|
-
* status: { type: 'string' }
|
|
1099
|
-
* }
|
|
1100
|
-
* }
|
|
1101
|
-
* }
|
|
1102
|
-
* }
|
|
1103
|
-
* }
|
|
1104
|
-
* }
|
|
1105
|
-
* },
|
|
1106
|
-
* async (req, res) => {
|
|
1107
|
-
* const { message, type } = req.body;
|
|
1108
|
-
* // Notification logic
|
|
1109
|
-
* res.json({ id: 'not_123', status: 'sent' });
|
|
1110
|
-
* }
|
|
1111
|
-
* );
|
|
1112
|
-
* ```
|
|
1113
|
-
*/
|
|
1114
|
-
declare const notify: <SV extends AnySchemaValidator, Name extends string, Path extends `/${string}`, P extends ParamsObject<SV>, ResBodyMap extends ResponsesObject<SV>, ReqBody extends Body<SV>, ReqQuery extends QueryObject<SV>, ReqHeaders extends HeadersObject<SV>, ResHeaders extends HeadersObject<SV>, LocalsObj extends Record<string, unknown>, const VersionedApi extends VersionSchema<SV, "middleware">, const Auth extends SchemaAuthMethods<SV, P, ReqBody, ReqQuery, ReqHeaders, VersionedApi, Request>>(schemaValidator: SV, path: Path, contractDetails: ContractDetails<SV, Name, "middleware", Path, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, VersionedApi, Request, Auth>, ...handlers: ExpressLikeSchemaHandler<SV, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, LocalsObj, VersionedApi, ResolvedSessionObject<SV, Auth, SessionObject<SV>>, Request, Response, NextFunction>[]) => {
|
|
1115
|
-
_typedHandler: true;
|
|
1116
|
-
_path: Path;
|
|
1117
|
-
contractDetails: _forklaunch_core_http.MiddlewareContractDetails<SV, Name, Path, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, VersionedApi, Request<express__default.ParamsDictionary, any, any, ParsedQs$1, Record<string, any>>, Auth>;
|
|
1118
|
-
handlers: ExpressLikeSchemaHandler<SV, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, LocalsObj, VersionedApi, ResolvedSessionObject<SV, Auth, SessionObject<SV>>, Request<express__default.ParamsDictionary, any, any, ParsedQs$1, Record<string, any>>, Response<any, Record<string, any>>, NextFunction>[];
|
|
1119
|
-
};
|
|
1120
|
-
|
|
1121
|
-
/**
|
|
1122
|
-
* Creates an OPTIONS route handler with schema validation and type safety.
|
|
1123
|
-
*
|
|
1124
|
-
* @template SV - The schema validator type
|
|
1125
|
-
* @template Name - The name of the route
|
|
1126
|
-
* @template Path - The route path type
|
|
1127
|
-
* @template P - The path parameters type
|
|
1128
|
-
* @template ResBodyMap - The response body map type
|
|
1129
|
-
* @template ReqBody - The request body type
|
|
1130
|
-
* @template ReqQuery - The request query parameters type
|
|
1131
|
-
* @template ReqHeaders - The request headers type
|
|
1132
|
-
* @template ResHeaders - The response headers type
|
|
1133
|
-
* @template LocalsObj - The locals object type
|
|
1134
|
-
* @template Auth - The authentication methods base type
|
|
1135
|
-
*
|
|
1136
|
-
* @param {SV} schemaValidator - The schema validator instance
|
|
1137
|
-
* @param {Path} path - The route path
|
|
1138
|
-
* @param {ContractDetails<SV, 'options', Name, Path, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, Request, Auth>} contractDetails - The contract details for the route
|
|
1139
|
-
* @param {...ExpressLikeSchemaHandler<SV, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, LocalsObj, Request, Auth>} handlers - The route handlers
|
|
1140
|
-
*
|
|
1141
|
-
* @returns {void} - Returns nothing, registers the route with Express
|
|
1142
|
-
*
|
|
1143
|
-
* @example
|
|
1144
|
-
* ```typescript
|
|
1145
|
-
* options(
|
|
1146
|
-
* schemaValidator,
|
|
1147
|
-
* '/api',
|
|
1148
|
-
* {
|
|
1149
|
-
* summary: 'Get API options',
|
|
1150
|
-
* description: 'Returns the available HTTP methods and other options for the API',
|
|
1151
|
-
* tags: ['api'],
|
|
1152
|
-
* responses: {
|
|
1153
|
-
* 200: {
|
|
1154
|
-
* description: 'Available options',
|
|
1155
|
-
* content: {
|
|
1156
|
-
* 'application/json': {
|
|
1157
|
-
* schema: {
|
|
1158
|
-
* type: 'object',
|
|
1159
|
-
* properties: {
|
|
1160
|
-
* methods: {
|
|
1161
|
-
* type: 'array',
|
|
1162
|
-
* items: { type: 'string' }
|
|
1163
|
-
* },
|
|
1164
|
-
* cors: { type: 'boolean' }
|
|
1165
|
-
* }
|
|
1166
|
-
* }
|
|
1167
|
-
* }
|
|
1168
|
-
* }
|
|
1169
|
-
* }
|
|
1170
|
-
* }
|
|
1171
|
-
* },
|
|
1172
|
-
* async (req, res) => {
|
|
1173
|
-
* res.json({
|
|
1174
|
-
* methods: ['GET', 'POST', 'PUT', 'DELETE'],
|
|
1175
|
-
* cors: true
|
|
1176
|
-
* });
|
|
1177
|
-
* }
|
|
1178
|
-
* );
|
|
1179
|
-
* ```
|
|
1180
|
-
*/
|
|
1181
|
-
declare const options: <SV extends AnySchemaValidator, Name extends string, Path extends `/${string}`, P extends ParamsObject<SV>, ResBodyMap extends ResponsesObject<SV>, ReqBody extends Body<SV>, ReqQuery extends QueryObject<SV>, ReqHeaders extends HeadersObject<SV>, ResHeaders extends HeadersObject<SV>, LocalsObj extends Record<string, unknown>, const VersionedApi extends VersionSchema<SV, "options">, const Auth extends SchemaAuthMethods<SV, P, ReqBody, ReqQuery, ReqHeaders, VersionedApi, Request>>(schemaValidator: SV, path: Path, contractDetails: ContractDetails<SV, Name, "options", Path, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, VersionedApi, Request, Auth>, ...handlers: ExpressLikeSchemaHandler<SV, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, LocalsObj, VersionedApi, ResolvedSessionObject<SV, Auth, SessionObject<SV>>, Request, Response, NextFunction>[]) => _forklaunch_core_http.ExpressLikeTypedHandler<SV, Name, "options", Path, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, LocalsObj, VersionedApi, Request<express__default.ParamsDictionary, any, any, ParsedQs$1, Record<string, any>>, Response<any, Record<string, any>>, NextFunction, Auth>;
|
|
1182
|
-
|
|
1183
|
-
/**
|
|
1184
|
-
* Creates a PATCH route handler with schema validation and type safety.
|
|
1185
|
-
*
|
|
1186
|
-
* @template SV - The schema validator type
|
|
1187
|
-
* @template Name - The name of the route
|
|
1188
|
-
* @template Path - The route path type (must start with '/')
|
|
1189
|
-
* @template P - The path parameters type
|
|
1190
|
-
* @template ResBodyMap - The response body map type
|
|
1191
|
-
* @template ReqBody - The request body type
|
|
1192
|
-
* @template ReqQuery - The request query parameters type
|
|
1193
|
-
* @template ReqHeaders - The request headers type
|
|
1194
|
-
* @template ResHeaders - The response headers type
|
|
1195
|
-
* @template LocalsObj - The locals object type
|
|
1196
|
-
* @template Auth - The authentication methods base type
|
|
1197
|
-
*
|
|
1198
|
-
* @param {SV} schemaValidator - The schema validator instance
|
|
1199
|
-
* @param {Path} path - The route path
|
|
1200
|
-
* @param {ContractDetails<SV, 'patch', Name, Path, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, Request, Auth>} contractDetails - The contract details for the route
|
|
1201
|
-
* @param {...ExpressLikeSchemaHandler<SV, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, LocalsObj, Request, Response, NextFunction>[]} handlers - The route handlers
|
|
1202
|
-
*
|
|
1203
|
-
* @returns {void} - Returns nothing, registers the route with Express
|
|
1204
|
-
*
|
|
1205
|
-
* @example
|
|
1206
|
-
* ```typescript
|
|
1207
|
-
* patch(
|
|
1208
|
-
* schemaValidator,
|
|
1209
|
-
* '/users/:id',
|
|
1210
|
-
* {
|
|
1211
|
-
* summary: 'Update user partially',
|
|
1212
|
-
* description: 'Updates specific fields of a user by ID',
|
|
1213
|
-
* tags: ['users'],
|
|
1214
|
-
* parameters: [
|
|
1215
|
-
* {
|
|
1216
|
-
* name: 'id',
|
|
1217
|
-
* in: 'path',
|
|
1218
|
-
* required: true,
|
|
1219
|
-
* schema: { type: 'string' }
|
|
1220
|
-
* }
|
|
1221
|
-
* ],
|
|
1222
|
-
* requestBody: {
|
|
1223
|
-
* content: {
|
|
1224
|
-
* 'application/json': {
|
|
1225
|
-
* schema: {
|
|
1226
|
-
* type: 'object',
|
|
1227
|
-
* properties: {
|
|
1228
|
-
* name: { type: 'string' },
|
|
1229
|
-
* email: { type: 'string' }
|
|
1230
|
-
* }
|
|
1231
|
-
* }
|
|
1232
|
-
* }
|
|
1233
|
-
* }
|
|
1234
|
-
* },
|
|
1235
|
-
* responses: {
|
|
1236
|
-
* 200: {
|
|
1237
|
-
* description: 'User updated successfully',
|
|
1238
|
-
* content: {
|
|
1239
|
-
* 'application/json': {
|
|
1240
|
-
* schema: {
|
|
1241
|
-
* type: 'object',
|
|
1242
|
-
* properties: {
|
|
1243
|
-
* id: { type: 'string' },
|
|
1244
|
-
* name: { type: 'string' },
|
|
1245
|
-
* email: { type: 'string' }
|
|
1246
|
-
* }
|
|
1247
|
-
* }
|
|
1248
|
-
* }
|
|
1249
|
-
* }
|
|
1250
|
-
* }
|
|
1251
|
-
* }
|
|
1252
|
-
* },
|
|
1253
|
-
* async (req, res) => {
|
|
1254
|
-
* const { id } = req.params;
|
|
1255
|
-
* const updates = req.body;
|
|
1256
|
-
* const user = await updateUser(id, updates);
|
|
1257
|
-
* res.json(user);
|
|
1258
|
-
* }
|
|
1259
|
-
* );
|
|
1260
|
-
* ```
|
|
1261
|
-
*/
|
|
1262
|
-
declare const patch: <SV extends AnySchemaValidator, Name extends string, Path extends `/${string}`, P extends ParamsObject<SV>, ResBodyMap extends ResponsesObject<SV>, ReqBody extends Body<SV>, ReqQuery extends QueryObject<SV>, ReqHeaders extends HeadersObject<SV>, ResHeaders extends HeadersObject<SV>, LocalsObj extends Record<string, unknown>, const VersionedApi extends VersionSchema<SV, "patch">, const Auth extends SchemaAuthMethods<SV, P, ReqBody, ReqQuery, ReqHeaders, VersionedApi, Request>>(schemaValidator: SV, path: Path, contractDetails: ContractDetails<SV, Name, "patch", Path, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, VersionedApi, Request, Auth>, ...handlers: ExpressLikeSchemaHandler<SV, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, LocalsObj, VersionedApi, ResolvedSessionObject<SV, Auth, SessionObject<SV>>, Request, Response, NextFunction>[]) => _forklaunch_core_http.ExpressLikeTypedHandler<SV, Name, "patch", Path, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, LocalsObj, VersionedApi, Request<express__default.ParamsDictionary, any, any, ParsedQs$1, Record<string, any>>, Response<any, Record<string, any>>, NextFunction, Auth>;
|
|
1263
|
-
|
|
1264
|
-
/**
|
|
1265
|
-
* Creates a POST route handler with schema validation and type safety.
|
|
1266
|
-
*
|
|
1267
|
-
* @template SV - Schema validator type extending AnySchemaValidator
|
|
1268
|
-
* @template Name - The name of the route
|
|
1269
|
-
* @template Path - Route path type extending string with leading slash
|
|
1270
|
-
* @template P - Parameters object type extending ParamsObject
|
|
1271
|
-
* @template ResBodyMap - Response body map type extending ResponsesObject
|
|
1272
|
-
* @template ReqBody - Request body type extending Body
|
|
1273
|
-
* @template ReqQuery - Request query type extending QueryObject
|
|
1274
|
-
* @template ReqHeaders - Request headers type extending HeadersObject
|
|
1275
|
-
* @template ResHeaders - Response headers type extending HeadersObject
|
|
1276
|
-
* @template LocalsObj - Local variables type extending Record<string, unknown>
|
|
1277
|
-
* @template Auth - Auth methods type extending AuthMethodsBase
|
|
1278
|
-
*
|
|
1279
|
-
* @param {SV} schemaValidator - Schema validator instance
|
|
1280
|
-
* @param {Path} path - Route path starting with '/'
|
|
1281
|
-
* @param {ContractDetails<SV, 'post', Name, Path, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, Request, Auth>} contractDetails - Contract details for route validation
|
|
1282
|
-
* @param {...ExpressLikeSchemaHandler[]} handlers - Route handler middleware functions
|
|
1283
|
-
* @returns {Function} Express route handler with schema validation
|
|
1284
|
-
*
|
|
1285
|
-
* @example
|
|
1286
|
-
* ```typescript
|
|
1287
|
-
* const createUser = post(
|
|
1288
|
-
* schemaValidator,
|
|
1289
|
-
* '/users',
|
|
1290
|
-
* {
|
|
1291
|
-
* body: {
|
|
1292
|
-
* type: 'object',
|
|
1293
|
-
* properties: { name: { type: 'string' } },
|
|
1294
|
-
* required: ['name']
|
|
1295
|
-
* },
|
|
1296
|
-
* responses: {
|
|
1297
|
-
* 201: { type: 'object', properties: { id: { type: 'string' } } }
|
|
1298
|
-
* }
|
|
1299
|
-
* },
|
|
1300
|
-
* async (req, res) => {
|
|
1301
|
-
* const user = await createNewUser(req.body);
|
|
1302
|
-
* res.status(201).json(user);
|
|
1303
|
-
* }
|
|
1304
|
-
* );
|
|
1305
|
-
* ```
|
|
1306
|
-
*/
|
|
1307
|
-
declare const post: <SV extends AnySchemaValidator, Name extends string, Path extends `/${string}`, P extends ParamsObject<SV>, ResBodyMap extends ResponsesObject<SV>, ReqBody extends Body<SV>, ReqQuery extends QueryObject<SV>, ReqHeaders extends HeadersObject<SV>, ResHeaders extends HeadersObject<SV>, LocalsObj extends Record<string, unknown>, const VersionedApi extends VersionSchema<SV, "post">, const Auth extends SchemaAuthMethods<SV, P, ReqBody, ReqQuery, ReqHeaders, VersionedApi, Request>>(schemaValidator: SV, path: Path, contractDetails: ContractDetails<SV, Name, "post", Path, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, VersionedApi, Request, Auth>, ...handlers: ExpressLikeSchemaHandler<SV, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, LocalsObj, VersionedApi, ResolvedSessionObject<SV, Auth, SessionObject<SV>>, Request, Response, NextFunction>[]) => _forklaunch_core_http.ExpressLikeTypedHandler<SV, Name, "post", Path, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, LocalsObj, VersionedApi, Request<express__default.ParamsDictionary, any, any, ParsedQs$1, Record<string, any>>, Response<any, Record<string, any>>, NextFunction, Auth>;
|
|
1308
|
-
|
|
1309
|
-
/**
|
|
1310
|
-
* Creates a PROPFIND route handler with schema validation and type safety.
|
|
1311
|
-
*
|
|
1312
|
-
* @template SV - The schema validator type
|
|
1313
|
-
* @template Name - The name of the route
|
|
1314
|
-
* @template Path - The route path type
|
|
1315
|
-
* @template P - The path parameters type
|
|
1316
|
-
* @template ResBodyMap - The response body map type
|
|
1317
|
-
* @template ReqBody - The request body type
|
|
1318
|
-
* @template ReqQuery - The request query parameters type
|
|
1319
|
-
* @template ReqHeaders - The request headers type
|
|
1320
|
-
* @template ResHeaders - The response headers type
|
|
1321
|
-
* @template LocalsObj - The locals object type
|
|
1322
|
-
* @template Auth - The authentication methods base type
|
|
1323
|
-
*
|
|
1324
|
-
* @param {SV} schemaValidator - The schema validator instance
|
|
1325
|
-
* @param {Path} path - The route path
|
|
1326
|
-
* @param {ContractDetails<SV, 'propfind', Name, Path, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, Request, Auth>} contractDetails - The contract details for the route
|
|
1327
|
-
* @param {...ExpressLikeSchemaHandler<SV, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, LocalsObj, Request, Response, NextFunction>[]} handlers - The route handlers
|
|
1328
|
-
*
|
|
1329
|
-
* @returns {void} - Returns nothing, registers the route with Express
|
|
1330
|
-
*
|
|
1331
|
-
* @example
|
|
1332
|
-
* ```typescript
|
|
1333
|
-
* propfind(
|
|
1334
|
-
* schemaValidator,
|
|
1335
|
-
* '/resources/:id',
|
|
1336
|
-
* {
|
|
1337
|
-
* summary: 'Get resource properties',
|
|
1338
|
-
* description: 'Retrieves properties of a resource',
|
|
1339
|
-
* tags: ['resources'],
|
|
1340
|
-
* parameters: [
|
|
1341
|
-
* {
|
|
1342
|
-
* name: 'id',
|
|
1343
|
-
* in: 'path',
|
|
1344
|
-
* required: true,
|
|
1345
|
-
* schema: { type: 'string' }
|
|
1346
|
-
* }
|
|
1347
|
-
* ],
|
|
1348
|
-
* requestBody: {
|
|
1349
|
-
* content: {
|
|
1350
|
-
* 'application/xml': {
|
|
1351
|
-
* schema: {
|
|
1352
|
-
* type: 'string',
|
|
1353
|
-
* description: 'XML request body with property names to retrieve'
|
|
1354
|
-
* }
|
|
1355
|
-
* }
|
|
1356
|
-
* }
|
|
1357
|
-
* },
|
|
1358
|
-
* responses: {
|
|
1359
|
-
* 207: {
|
|
1360
|
-
* description: 'Multi-status response with property values',
|
|
1361
|
-
* content: {
|
|
1362
|
-
* 'application/xml': {
|
|
1363
|
-
* schema: {
|
|
1364
|
-
* type: 'string',
|
|
1365
|
-
* description: 'XML response with property values'
|
|
1366
|
-
* }
|
|
1367
|
-
* }
|
|
1368
|
-
* }
|
|
1369
|
-
* }
|
|
1370
|
-
* }
|
|
1371
|
-
* },
|
|
1372
|
-
* async (req, res) => {
|
|
1373
|
-
* const { id } = req.params;
|
|
1374
|
-
* const xmlRequest = req.body;
|
|
1375
|
-
* const properties = await getResourceProperties(id, xmlRequest);
|
|
1376
|
-
* res.status(207).type('application/xml').send(properties);
|
|
1377
|
-
* }
|
|
1378
|
-
* );
|
|
1379
|
-
* ```
|
|
1380
|
-
*/
|
|
1381
|
-
declare const propfind: <SV extends AnySchemaValidator, Name extends string, Path extends `/${string}`, P extends ParamsObject<SV>, ResBodyMap extends ResponsesObject<SV>, ReqBody extends Body<SV>, ReqQuery extends QueryObject<SV>, ReqHeaders extends HeadersObject<SV>, ResHeaders extends HeadersObject<SV>, LocalsObj extends Record<string, unknown>, const VersionedApi extends VersionSchema<SV, "middleware">, const Auth extends SchemaAuthMethods<SV, P, ReqBody, ReqQuery, ReqHeaders, VersionedApi, Request>>(schemaValidator: SV, path: Path, contractDetails: ContractDetails<SV, Name, "middleware", Path, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, VersionedApi, Request, Auth>, ...handlers: ExpressLikeSchemaHandler<SV, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, LocalsObj, VersionedApi, ResolvedSessionObject<SV, Auth, SessionObject<SV>>, Request, Response, NextFunction>[]) => {
|
|
1382
|
-
_typedHandler: true;
|
|
1383
|
-
_path: Path;
|
|
1384
|
-
contractDetails: _forklaunch_core_http.MiddlewareContractDetails<SV, Name, Path, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, VersionedApi, Request<express__default.ParamsDictionary, any, any, ParsedQs$1, Record<string, any>>, Auth>;
|
|
1385
|
-
handlers: ExpressLikeSchemaHandler<SV, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, LocalsObj, VersionedApi, ResolvedSessionObject<SV, Auth, SessionObject<SV>>, Request<express__default.ParamsDictionary, any, any, ParsedQs$1, Record<string, any>>, Response<any, Record<string, any>>, NextFunction>[];
|
|
1386
|
-
};
|
|
1387
|
-
|
|
1388
|
-
/**
|
|
1389
|
-
* Creates a PROPPATCH route handler with schema validation and type safety.
|
|
1390
|
-
*
|
|
1391
|
-
* @template SV - The schema validator type
|
|
1392
|
-
* @template Name - The name of the route
|
|
1393
|
-
* @template Path - The route path type
|
|
1394
|
-
* @template P - The path parameters type
|
|
1395
|
-
* @template ResBodyMap - The response body map type
|
|
1396
|
-
* @template ReqBody - The request body type
|
|
1397
|
-
* @template ReqQuery - The request query parameters type
|
|
1398
|
-
* @template ReqHeaders - The request headers type
|
|
1399
|
-
* @template ResHeaders - The response headers type
|
|
1400
|
-
* @template LocalsObj - The locals object type
|
|
1401
|
-
* @template Auth - The authentication methods base type
|
|
1402
|
-
*
|
|
1403
|
-
* @param {SV} schemaValidator - The schema validator instance
|
|
1404
|
-
* @param {Path} path - The route path
|
|
1405
|
-
* @param {ContractDetails<SV, 'middleware', Name, Path, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, Request, Auth>} contractDetails - The contract details for the route
|
|
1406
|
-
* @param {...ExpressLikeSchemaHandler<SV, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, LocalsObj, Request, Auth>} handlers - The route handlers
|
|
1407
|
-
*
|
|
1408
|
-
* @returns {void} - Returns nothing, registers the route with Express
|
|
1409
|
-
*
|
|
1410
|
-
* @example
|
|
1411
|
-
* ```typescript
|
|
1412
|
-
* proppatch(
|
|
1413
|
-
* schemaValidator,
|
|
1414
|
-
* '/resources/:id',
|
|
1415
|
-
* {
|
|
1416
|
-
* summary: 'Update resource properties',
|
|
1417
|
-
* description: 'Updates properties of a resource',
|
|
1418
|
-
* tags: ['resources'],
|
|
1419
|
-
* parameters: [
|
|
1420
|
-
* {
|
|
1421
|
-
* name: 'id',
|
|
1422
|
-
* in: 'path',
|
|
1423
|
-
* required: true,
|
|
1424
|
-
* schema: { type: 'string' }
|
|
1425
|
-
* }
|
|
1426
|
-
* ],
|
|
1427
|
-
* requestBody: {
|
|
1428
|
-
* content: {
|
|
1429
|
-
* 'application/xml': {
|
|
1430
|
-
* schema: {
|
|
1431
|
-
* type: 'string',
|
|
1432
|
-
* description: 'XML request body with property updates'
|
|
1433
|
-
* }
|
|
1434
|
-
* }
|
|
1435
|
-
* }
|
|
1436
|
-
* },
|
|
1437
|
-
* responses: {
|
|
1438
|
-
* 207: {
|
|
1439
|
-
* description: 'Multi-status response with property update results',
|
|
1440
|
-
* content: {
|
|
1441
|
-
* 'application/xml': {
|
|
1442
|
-
* schema: {
|
|
1443
|
-
* type: 'string',
|
|
1444
|
-
* description: 'XML response with property update status'
|
|
1445
|
-
* }
|
|
1446
|
-
* }
|
|
1447
|
-
* }
|
|
1448
|
-
* }
|
|
1449
|
-
* }
|
|
1450
|
-
* },
|
|
1451
|
-
* async (req, res) => {
|
|
1452
|
-
* const { id } = req.params;
|
|
1453
|
-
* const xmlRequest = req.body;
|
|
1454
|
-
* const result = await updateResourceProperties(id, xmlRequest);
|
|
1455
|
-
* res.status(207).type('application/xml').send(result);
|
|
1456
|
-
* }
|
|
1457
|
-
* );
|
|
1458
|
-
* ```
|
|
1459
|
-
*/
|
|
1460
|
-
declare const proppatch: <SV extends AnySchemaValidator, Name extends string, Path extends `/${string}`, P extends ParamsObject<SV>, ResBodyMap extends ResponsesObject<SV>, ReqBody extends Body<SV>, ReqQuery extends QueryObject<SV>, ReqHeaders extends HeadersObject<SV>, ResHeaders extends HeadersObject<SV>, LocalsObj extends Record<string, unknown>, const VersionedApi extends VersionSchema<SV, "middleware">, const Auth extends SchemaAuthMethods<SV, P, ReqBody, ReqQuery, ReqHeaders, VersionedApi, Request>>(schemaValidator: SV, path: Path, contractDetails: ContractDetails<SV, Name, "middleware", Path, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, VersionedApi, Request, Auth>, ...handlers: ExpressLikeSchemaHandler<SV, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, LocalsObj, VersionedApi, ResolvedSessionObject<SV, Auth, SessionObject<SV>>, Request, Response, NextFunction>[]) => {
|
|
1461
|
-
_typedHandler: true;
|
|
1462
|
-
_path: Path;
|
|
1463
|
-
contractDetails: _forklaunch_core_http.MiddlewareContractDetails<SV, Name, Path, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, VersionedApi, Request<express__default.ParamsDictionary, any, any, ParsedQs$1, Record<string, any>>, Auth>;
|
|
1464
|
-
handlers: ExpressLikeSchemaHandler<SV, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, LocalsObj, VersionedApi, ResolvedSessionObject<SV, Auth, SessionObject<SV>>, Request<express__default.ParamsDictionary, any, any, ParsedQs$1, Record<string, any>>, Response<any, Record<string, any>>, NextFunction>[];
|
|
1465
|
-
};
|
|
1466
|
-
|
|
1467
|
-
/**
|
|
1468
|
-
* Creates a PURGE route handler with schema validation and type safety.
|
|
1469
|
-
*
|
|
1470
|
-
* @template SV - The schema validator type
|
|
1471
|
-
* @template Name - The name of the route
|
|
1472
|
-
* @template Path - The route path type
|
|
1473
|
-
* @template P - The path parameters type
|
|
1474
|
-
* @template ResBodyMap - The response body map type
|
|
1475
|
-
* @template ReqQuery - The request query parameters type
|
|
1476
|
-
* @template ReqHeaders - The request headers type
|
|
1477
|
-
* @template ResHeaders - The response headers type
|
|
1478
|
-
* @template LocalsObj - The locals object type
|
|
1479
|
-
*
|
|
1480
|
-
* @param {SV} schemaValidator - The schema validator instance
|
|
1481
|
-
* @param {Path} path - The route path
|
|
1482
|
-
* @param {ContractDetails<SV, 'purge', Name, Path, P, ResBodyMap, never, ReqQuery, ReqHeaders, ResHeaders, Request>} contractDetails - The contract details for the route
|
|
1483
|
-
* @param {...ExpressLikeSchemaHandler<SV, P, ResBodyMap, never, ReqQuery, ReqHeaders, ResHeaders, LocalsObj, Request, Response, NextFunction>[]} handlers - The route handlers
|
|
1484
|
-
*
|
|
1485
|
-
* @returns {void} - Returns nothing, registers the route with Express
|
|
1486
|
-
*
|
|
1487
|
-
* @example
|
|
1488
|
-
* ```typescript
|
|
1489
|
-
* purge(
|
|
1490
|
-
* schemaValidator,
|
|
1491
|
-
* '/cache/:id',
|
|
1492
|
-
* {
|
|
1493
|
-
* summary: 'Purge cache',
|
|
1494
|
-
* description: 'Removes an item from the cache',
|
|
1495
|
-
* tags: ['cache'],
|
|
1496
|
-
* parameters: [
|
|
1497
|
-
* {
|
|
1498
|
-
* name: 'id',
|
|
1499
|
-
* in: 'path',
|
|
1500
|
-
* required: true,
|
|
1501
|
-
* schema: { type: 'string' }
|
|
1502
|
-
* }
|
|
1503
|
-
* ],
|
|
1504
|
-
* responses: {
|
|
1505
|
-
* 204: {
|
|
1506
|
-
* description: 'Cache item purged successfully'
|
|
1507
|
-
* }
|
|
1508
|
-
* }
|
|
1509
|
-
* },
|
|
1510
|
-
* async (req, res) => {
|
|
1511
|
-
* const { id } = req.params;
|
|
1512
|
-
* await purgeCacheItem(id);
|
|
1513
|
-
* res.status(204).send();
|
|
1514
|
-
* }
|
|
1515
|
-
* );
|
|
1516
|
-
* ```
|
|
1517
|
-
*/
|
|
1518
|
-
declare const purge: <SV extends AnySchemaValidator, Name extends string, Path extends `/${string}`, P extends ParamsObject<SV>, ResBodyMap extends ResponsesObject<SV>, ReqBody extends Body<SV>, ReqQuery extends QueryObject<SV>, ReqHeaders extends HeadersObject<SV>, ResHeaders extends HeadersObject<SV>, LocalsObj extends Record<string, unknown>, const VersionedApi extends VersionSchema<SV, "middleware">, const Auth extends SchemaAuthMethods<SV, P, ReqBody, ReqQuery, ReqHeaders, VersionedApi, Request>>(schemaValidator: SV, path: Path, contractDetails: ContractDetails<SV, Name, "middleware", Path, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, VersionedApi, Request, Auth>, ...handlers: ExpressLikeSchemaHandler<SV, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, LocalsObj, VersionedApi, ResolvedSessionObject<SV, Auth, SessionObject<SV>>, Request, Response, NextFunction>[]) => {
|
|
1519
|
-
_typedHandler: true;
|
|
1520
|
-
_path: Path;
|
|
1521
|
-
contractDetails: _forklaunch_core_http.MiddlewareContractDetails<SV, Name, Path, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, VersionedApi, Request<express__default.ParamsDictionary, any, any, ParsedQs$1, Record<string, any>>, Auth>;
|
|
1522
|
-
handlers: ExpressLikeSchemaHandler<SV, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, LocalsObj, VersionedApi, ResolvedSessionObject<SV, Auth, SessionObject<SV>>, Request<express__default.ParamsDictionary, any, any, ParsedQs$1, Record<string, any>>, Response<any, Record<string, any>>, NextFunction>[];
|
|
1523
|
-
};
|
|
1524
|
-
|
|
1525
|
-
/**
|
|
1526
|
-
* Creates a PUT route handler with schema validation and type safety.
|
|
1527
|
-
*
|
|
1528
|
-
* @template SV - The schema validator type
|
|
1529
|
-
* @template Name - The name of the route
|
|
1530
|
-
* @template Path - The route path type
|
|
1531
|
-
* @template P - The path parameters type
|
|
1532
|
-
* @template ResBodyMap - The response body map type
|
|
1533
|
-
* @template ReqBody - The request body type
|
|
1534
|
-
* @template ReqQuery - The request query parameters type
|
|
1535
|
-
* @template ReqHeaders - The request headers type
|
|
1536
|
-
* @template ResHeaders - The response headers type
|
|
1537
|
-
* @template LocalsObj - The locals object type
|
|
1538
|
-
* @template Auth - The authentication method type
|
|
1539
|
-
*
|
|
1540
|
-
* @param {SV} schemaValidator - The schema validator instance
|
|
1541
|
-
* @param {Path} path - The route path
|
|
1542
|
-
* @param {ContractDetails<SV, 'put', Name, Path, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, Request, Auth>} contractDetails - The contract details for the route
|
|
1543
|
-
* @param {...ExpressLikeSchemaHandler<SV, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, LocalsObj, Request, Response, NextFunction>[]} handlers - The route handlers
|
|
1544
|
-
*
|
|
1545
|
-
* @returns {void} - Returns nothing, registers the route with Express
|
|
1546
|
-
*
|
|
1547
|
-
* @example
|
|
1548
|
-
* ```typescript
|
|
1549
|
-
* put(
|
|
1550
|
-
* schemaValidator,
|
|
1551
|
-
* '/users/:id',
|
|
1552
|
-
* {
|
|
1553
|
-
* summary: 'Update user',
|
|
1554
|
-
* description: 'Updates a user by ID',
|
|
1555
|
-
* tags: ['users'],
|
|
1556
|
-
* pathParams: {
|
|
1557
|
-
* id: { type: 'string' }
|
|
1558
|
-
* },
|
|
1559
|
-
* body: {
|
|
1560
|
-
* type: 'object',
|
|
1561
|
-
* properties: {
|
|
1562
|
-
* name: { type: 'string' }
|
|
1563
|
-
* }
|
|
1564
|
-
* },
|
|
1565
|
-
* responses: {
|
|
1566
|
-
* 200: {
|
|
1567
|
-
* description: 'User updated successfully',
|
|
1568
|
-
* content: {
|
|
1569
|
-
* 'application/json': {
|
|
1570
|
-
* schema: {
|
|
1571
|
-
* type: 'object',
|
|
1572
|
-
* properties: {
|
|
1573
|
-
* id: { type: 'string' },
|
|
1574
|
-
* name: { type: 'string' }
|
|
1575
|
-
* }
|
|
1576
|
-
* }
|
|
1577
|
-
* }
|
|
1578
|
-
* }
|
|
1579
|
-
* }
|
|
1580
|
-
* }
|
|
1581
|
-
* },
|
|
1582
|
-
* async (req, res) => {
|
|
1583
|
-
* const { id } = req.params;
|
|
1584
|
-
* const { name } = req.body;
|
|
1585
|
-
* // Update user logic
|
|
1586
|
-
* res.json({ id, name });
|
|
1587
|
-
* }
|
|
1588
|
-
* );
|
|
1589
|
-
* ```
|
|
1590
|
-
*/
|
|
1591
|
-
declare const put: <SV extends AnySchemaValidator, Name extends string, Path extends `/${string}`, P extends ParamsObject<SV>, ResBodyMap extends ResponsesObject<SV>, ReqBody extends Body<SV>, ReqQuery extends QueryObject<SV>, ReqHeaders extends HeadersObject<SV>, ResHeaders extends HeadersObject<SV>, LocalsObj extends Record<string, unknown>, const VersionedApi extends VersionSchema<SV, "put">, const Auth extends SchemaAuthMethods<SV, P, ReqBody, ReqQuery, ReqHeaders, VersionedApi, Request>>(schemaValidator: SV, path: Path, contractDetails: ContractDetails<SV, Name, "put", Path, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, VersionedApi, Request, Auth>, ...handlers: ExpressLikeSchemaHandler<SV, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, LocalsObj, VersionedApi, ResolvedSessionObject<SV, Auth, SessionObject<SV>>, Request, Response, NextFunction>[]) => _forklaunch_core_http.ExpressLikeTypedHandler<SV, Name, "put", Path, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, LocalsObj, VersionedApi, Request<express__default.ParamsDictionary, any, any, ParsedQs$1, Record<string, any>>, Response<any, Record<string, any>>, NextFunction, Auth>;
|
|
1592
|
-
|
|
1593
|
-
/**
|
|
1594
|
-
* Creates a REPORT route handler with schema validation and type safety.
|
|
1595
|
-
*
|
|
1596
|
-
* @template SV - The schema validator type
|
|
1597
|
-
* @template Name - The name of the route
|
|
1598
|
-
* @template Path - The route path type
|
|
1599
|
-
* @template P - The path parameters type
|
|
1600
|
-
* @template ResBodyMap - The response body map type
|
|
1601
|
-
* @template ReqBody - The request body type
|
|
1602
|
-
* @template ReqQuery - The request query parameters type
|
|
1603
|
-
* @template ReqHeaders - The request headers type
|
|
1604
|
-
* @template ResHeaders - The response headers type
|
|
1605
|
-
* @template LocalsObj - The locals object type
|
|
1606
|
-
*
|
|
1607
|
-
* @param {SV} schemaValidator - The schema validator instance
|
|
1608
|
-
* @param {Path} path - The route path
|
|
1609
|
-
* @param {ContractDetails<SV, 'report', Name, Path, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, Request>} contractDetails - The contract details for the route
|
|
1610
|
-
* @param {...ExpressLikeSchemaHandler<SV, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, LocalsObj, Request, Response, NextFunction>[]} handlers - The route handlers
|
|
1611
|
-
*
|
|
1612
|
-
* @returns {void} - Returns nothing, registers the route with Express
|
|
1613
|
-
*
|
|
1614
|
-
* @example
|
|
1615
|
-
* ```typescript
|
|
1616
|
-
* report(
|
|
1617
|
-
* schemaValidator,
|
|
1618
|
-
* '/reports/:id',
|
|
1619
|
-
* {
|
|
1620
|
-
* summary: 'Generate report',
|
|
1621
|
-
* description: 'Generates a report for the specified resource',
|
|
1622
|
-
* tags: ['reports'],
|
|
1623
|
-
* pathParams: {
|
|
1624
|
-
* id: { type: 'string' }
|
|
1625
|
-
* },
|
|
1626
|
-
* responses: {
|
|
1627
|
-
* 200: {
|
|
1628
|
-
* description: 'Report generated successfully',
|
|
1629
|
-
* content: {
|
|
1630
|
-
* 'application/json': {
|
|
1631
|
-
* schema: {
|
|
1632
|
-
* type: 'object',
|
|
1633
|
-
* properties: {
|
|
1634
|
-
* id: { type: 'string' },
|
|
1635
|
-
* status: { type: 'string' }
|
|
1636
|
-
* }
|
|
1637
|
-
* }
|
|
1638
|
-
* }
|
|
1639
|
-
* }
|
|
1640
|
-
* }
|
|
1641
|
-
* }
|
|
1642
|
-
* },
|
|
1643
|
-
* async (req, res) => {
|
|
1644
|
-
* const { id } = req.params;
|
|
1645
|
-
* // Generate report logic
|
|
1646
|
-
* res.json({ id, status: 'completed' });
|
|
1647
|
-
* }
|
|
1648
|
-
* );
|
|
1649
|
-
* ```
|
|
1650
|
-
*/
|
|
1651
|
-
declare const report: <SV extends AnySchemaValidator, Name extends string, Path extends `/${string}`, P extends ParamsObject<SV>, ResBodyMap extends ResponsesObject<SV>, ReqBody extends Body<SV>, ReqQuery extends QueryObject<SV>, ReqHeaders extends HeadersObject<SV>, ResHeaders extends HeadersObject<SV>, LocalsObj extends Record<string, unknown>, const VersionedApi extends VersionSchema<SV, "middleware">, const Auth extends SchemaAuthMethods<SV, P, ReqBody, ReqQuery, ReqHeaders, VersionedApi, Request>>(schemaValidator: SV, path: Path, contractDetails: ContractDetails<SV, Name, "middleware", Path, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, VersionedApi, Request, Auth>, ...handlers: ExpressLikeSchemaHandler<SV, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, LocalsObj, VersionedApi, ResolvedSessionObject<SV, Auth, SessionObject<SV>>, Request, Response, NextFunction>[]) => {
|
|
1652
|
-
_typedHandler: true;
|
|
1653
|
-
_path: Path;
|
|
1654
|
-
contractDetails: _forklaunch_core_http.MiddlewareContractDetails<SV, Name, Path, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, VersionedApi, Request<express__default.ParamsDictionary, any, any, ParsedQs$1, Record<string, any>>, Auth>;
|
|
1655
|
-
handlers: ExpressLikeSchemaHandler<SV, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, LocalsObj, VersionedApi, ResolvedSessionObject<SV, Auth, SessionObject<SV>>, Request<express__default.ParamsDictionary, any, any, ParsedQs$1, Record<string, any>>, Response<any, Record<string, any>>, NextFunction>[];
|
|
1656
|
-
};
|
|
1657
|
-
|
|
1658
|
-
/**
|
|
1659
|
-
* Creates a SEARCH route handler with schema validation and type safety.
|
|
1660
|
-
*
|
|
1661
|
-
* @template SV - The schema validator type
|
|
1662
|
-
* @template Name - The name of the route
|
|
1663
|
-
* @template Path - The route path type (must start with '/')
|
|
1664
|
-
* @template P - The path parameters type
|
|
1665
|
-
* @template ResBodyMap - The response body map type
|
|
1666
|
-
* @template ReqBody - The request body type
|
|
1667
|
-
* @template ReqQuery - The request query parameters type
|
|
1668
|
-
* @template ReqHeaders - The request headers type
|
|
1669
|
-
* @template ResHeaders - The response headers type
|
|
1670
|
-
* @template LocalsObj - The locals object type
|
|
1671
|
-
* @template Auth - The authentication methods type
|
|
1672
|
-
*
|
|
1673
|
-
* @param {SV} schemaValidator - The schema validator instance
|
|
1674
|
-
* @param {Path} path - The route path
|
|
1675
|
-
* @param {ContractDetails<SV, Name, 'middleware', Path, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, Request, Auth>} contractDetails - The contract details for the route
|
|
1676
|
-
* @param {...ExpressLikeSchemaHandler<SV, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, LocalsObj, Request, Auth>} handlers - The route handlers
|
|
1677
|
-
*
|
|
1678
|
-
* @returns {void} - Returns nothing, registers the route with Express
|
|
1679
|
-
*
|
|
1680
|
-
* @example
|
|
1681
|
-
* ```typescript
|
|
1682
|
-
* search(
|
|
1683
|
-
* schemaValidator,
|
|
1684
|
-
* '/search',
|
|
1685
|
-
* {
|
|
1686
|
-
* summary: 'Search resources',
|
|
1687
|
-
* description: 'Searches for resources based on query parameters',
|
|
1688
|
-
* tags: ['search'],
|
|
1689
|
-
* query: {
|
|
1690
|
-
* type: 'object',
|
|
1691
|
-
* properties: {
|
|
1692
|
-
* q: { type: 'string' },
|
|
1693
|
-
* limit: { type: 'number' }
|
|
1694
|
-
* }
|
|
1695
|
-
* },
|
|
1696
|
-
* responses: {
|
|
1697
|
-
* 200: {
|
|
1698
|
-
* description: 'Search results',
|
|
1699
|
-
* content: {
|
|
1700
|
-
* 'application/json': {
|
|
1701
|
-
* schema: {
|
|
1702
|
-
* type: 'object',
|
|
1703
|
-
* properties: {
|
|
1704
|
-
* results: {
|
|
1705
|
-
* type: 'array',
|
|
1706
|
-
* items: {
|
|
1707
|
-
* type: 'object',
|
|
1708
|
-
* properties: {
|
|
1709
|
-
* id: { type: 'string' },
|
|
1710
|
-
* title: { type: 'string' }
|
|
1711
|
-
* }
|
|
1712
|
-
* }
|
|
1713
|
-
* }
|
|
1714
|
-
* }
|
|
1715
|
-
* }
|
|
1716
|
-
* }
|
|
1717
|
-
* }
|
|
1718
|
-
* }
|
|
1719
|
-
* }
|
|
1720
|
-
* },
|
|
1721
|
-
* async (req, res) => {
|
|
1722
|
-
* const { q, limit } = req.query;
|
|
1723
|
-
* // Search logic
|
|
1724
|
-
* res.json({ results: [] });
|
|
1725
|
-
* }
|
|
1726
|
-
* );
|
|
1727
|
-
* ```
|
|
1728
|
-
*/
|
|
1729
|
-
declare const search: <SV extends AnySchemaValidator, Name extends string, Path extends `/${string}`, P extends ParamsObject<SV>, ResBodyMap extends ResponsesObject<SV>, ReqBody extends Body<SV>, ReqQuery extends QueryObject<SV>, ReqHeaders extends HeadersObject<SV>, ResHeaders extends HeadersObject<SV>, LocalsObj extends Record<string, unknown>, const VersionedApi extends VersionSchema<SV, "middleware">, const Auth extends SchemaAuthMethods<SV, P, ReqBody, ReqQuery, ReqHeaders, VersionedApi, Request>>(schemaValidator: SV, path: Path, contractDetails: ContractDetails<SV, Name, "middleware", Path, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, VersionedApi, Request, Auth>, ...handlers: ExpressLikeSchemaHandler<SV, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, LocalsObj, VersionedApi, ResolvedSessionObject<SV, Auth, SessionObject<SV>>, Request, Response, NextFunction>[]) => {
|
|
1730
|
-
_typedHandler: true;
|
|
1731
|
-
_path: Path;
|
|
1732
|
-
contractDetails: _forklaunch_core_http.MiddlewareContractDetails<SV, Name, Path, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, VersionedApi, Request<express__default.ParamsDictionary, any, any, ParsedQs$1, Record<string, any>>, Auth>;
|
|
1733
|
-
handlers: ExpressLikeSchemaHandler<SV, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, LocalsObj, VersionedApi, ResolvedSessionObject<SV, Auth, SessionObject<SV>>, Request<express__default.ParamsDictionary, any, any, ParsedQs$1, Record<string, any>>, Response<any, Record<string, any>>, NextFunction>[];
|
|
1734
|
-
};
|
|
1735
|
-
|
|
1736
|
-
/**
|
|
1737
|
-
* Creates a SUBSCRIBE route handler with schema validation and type safety.
|
|
1738
|
-
*
|
|
1739
|
-
* @template SV - The schema validator type
|
|
1740
|
-
* @template Name - The name of the route
|
|
1741
|
-
* @template Path - The route path type
|
|
1742
|
-
* @template P - The path parameters type
|
|
1743
|
-
* @template ResBodyMap - The response body map type
|
|
1744
|
-
* @template ReqBody - The request body type
|
|
1745
|
-
* @template ReqQuery - The request query parameters type
|
|
1746
|
-
* @template ReqHeaders - The request headers type
|
|
1747
|
-
* @template ResHeaders - The response headers type
|
|
1748
|
-
* @template LocalsObj - The locals object type
|
|
1749
|
-
* @template Auth - The authentication method type
|
|
1750
|
-
*
|
|
1751
|
-
* @param {SV} schemaValidator - The schema validator instance
|
|
1752
|
-
* @param {Path} path - The route path
|
|
1753
|
-
* @param {ContractDetails<SV, 'middleware', Path, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, Request, Auth>} contractDetails - The contract details for the route
|
|
1754
|
-
* @param {...ExpressLikeSchemaHandler<SV, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, LocalsObj, Request, Auth>} handlers - The route handlers
|
|
1755
|
-
*
|
|
1756
|
-
* @returns {void} - Returns nothing, registers the route with Express
|
|
1757
|
-
*
|
|
1758
|
-
* @example
|
|
1759
|
-
* ```typescript
|
|
1760
|
-
* subscribe(
|
|
1761
|
-
* schemaValidator,
|
|
1762
|
-
* '/subscribe',
|
|
1763
|
-
* {
|
|
1764
|
-
* summary: 'Subscribe to updates',
|
|
1765
|
-
* description: 'Subscribes to receive updates for a resource',
|
|
1766
|
-
* tags: ['subscriptions'],
|
|
1767
|
-
* body: {
|
|
1768
|
-
* type: 'object',
|
|
1769
|
-
* properties: {
|
|
1770
|
-
* email: { type: 'string' },
|
|
1771
|
-
* resourceId: { type: 'string' }
|
|
1772
|
-
* }
|
|
1773
|
-
* },
|
|
1774
|
-
* responses: {
|
|
1775
|
-
* 200: {
|
|
1776
|
-
* description: 'Subscription created successfully',
|
|
1777
|
-
* content: {
|
|
1778
|
-
* 'application/json': {
|
|
1779
|
-
* schema: {
|
|
1780
|
-
* type: 'object',
|
|
1781
|
-
* properties: {
|
|
1782
|
-
* id: { type: 'string' },
|
|
1783
|
-
* status: { type: 'string' }
|
|
1784
|
-
* }
|
|
1785
|
-
* }
|
|
1786
|
-
* }
|
|
1787
|
-
* }
|
|
1788
|
-
* }
|
|
1789
|
-
* }
|
|
1790
|
-
* },
|
|
1791
|
-
* async (req, res) => {
|
|
1792
|
-
* const { email, resourceId } = req.body;
|
|
1793
|
-
* // Subscription logic
|
|
1794
|
-
* res.json({ id: 'sub_123', status: 'active' });
|
|
1795
|
-
* }
|
|
1796
|
-
* );
|
|
1797
|
-
* ```
|
|
1798
|
-
*/
|
|
1799
|
-
declare const subscribe: <SV extends AnySchemaValidator, Name extends string, Path extends `/${string}`, P extends ParamsObject<SV>, ResBodyMap extends ResponsesObject<SV>, ReqBody extends Body<SV>, ReqQuery extends QueryObject<SV>, ReqHeaders extends HeadersObject<SV>, ResHeaders extends HeadersObject<SV>, LocalsObj extends Record<string, unknown>, const VersionedApi extends VersionSchema<SV, "middleware">, const Auth extends SchemaAuthMethods<SV, P, ReqBody, ReqQuery, ReqHeaders, VersionedApi, Request>>(schemaValidator: SV, path: Path, contractDetails: ContractDetails<SV, Name, "middleware", Path, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, VersionedApi, Request, Auth>, ...handlers: ExpressLikeSchemaHandler<SV, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, LocalsObj, VersionedApi, ResolvedSessionObject<SV, Auth, SessionObject<SV>>, Request, Response, NextFunction>[]) => {
|
|
1800
|
-
_typedHandler: true;
|
|
1801
|
-
_path: Path;
|
|
1802
|
-
contractDetails: _forklaunch_core_http.MiddlewareContractDetails<SV, Name, Path, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, VersionedApi, Request<express__default.ParamsDictionary, any, any, ParsedQs$1, Record<string, any>>, Auth>;
|
|
1803
|
-
handlers: ExpressLikeSchemaHandler<SV, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, LocalsObj, VersionedApi, ResolvedSessionObject<SV, Auth, SessionObject<SV>>, Request<express__default.ParamsDictionary, any, any, ParsedQs$1, Record<string, any>>, Response<any, Record<string, any>>, NextFunction>[];
|
|
1804
|
-
};
|
|
1805
|
-
|
|
1806
|
-
/**
|
|
1807
|
-
* Creates a TRACE route handler with schema validation and type safety.
|
|
1808
|
-
*
|
|
1809
|
-
* @template SV - The schema validator type
|
|
1810
|
-
* @template Name - The name of the route
|
|
1811
|
-
* @template Path - The route path type
|
|
1812
|
-
* @template P - The path parameters type
|
|
1813
|
-
* @template ResBodyMap - The response body map type
|
|
1814
|
-
* @template ReqBody - The request body type
|
|
1815
|
-
* @template ReqQuery - The request query parameters type
|
|
1816
|
-
* @template ReqHeaders - The request headers type
|
|
1817
|
-
* @template ResHeaders - The response headers type
|
|
1818
|
-
* @template LocalsObj - The locals object type
|
|
1819
|
-
* @template Auth - The authentication method type
|
|
1820
|
-
*
|
|
1821
|
-
* @param {SV} schemaValidator - The schema validator instance
|
|
1822
|
-
* @param {Path} path - The route path
|
|
1823
|
-
* @param {ContractDetails<SV, 'trace', Name, Path, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, Request, Auth>} contractDetails - The contract details for the route
|
|
1824
|
-
* @param {...ExpressLikeSchemaHandler<SV, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, LocalsObj, Request, Response, NextFunction>[]} handlers - The route handlers
|
|
1825
|
-
*
|
|
1826
|
-
* @returns {void} - Returns nothing, registers the route with Express
|
|
1827
|
-
*
|
|
1828
|
-
* @example
|
|
1829
|
-
* ```typescript
|
|
1830
|
-
* trace(
|
|
1831
|
-
* schemaValidator,
|
|
1832
|
-
* '/trace',
|
|
1833
|
-
* {
|
|
1834
|
-
* summary: 'Trace request',
|
|
1835
|
-
* description: 'Traces the request path and returns diagnostic information',
|
|
1836
|
-
* tags: ['diagnostics'],
|
|
1837
|
-
* responses: {
|
|
1838
|
-
* 200: {
|
|
1839
|
-
* description: 'Trace information',
|
|
1840
|
-
* content: {
|
|
1841
|
-
* 'message/http': {
|
|
1842
|
-
* schema: {
|
|
1843
|
-
* type: 'string'
|
|
1844
|
-
* }
|
|
1845
|
-
* }
|
|
1846
|
-
* }
|
|
1847
|
-
* }
|
|
1848
|
-
* }
|
|
1849
|
-
* },
|
|
1850
|
-
* async (req, res) => {
|
|
1851
|
-
* // Trace logic
|
|
1852
|
-
* res.set('Content-Type', 'message/http');
|
|
1853
|
-
* res.send('TRACE /trace HTTP/1.1');
|
|
1854
|
-
* }
|
|
1855
|
-
* );
|
|
1856
|
-
* ```
|
|
1857
|
-
*/
|
|
1858
|
-
declare const trace: <SV extends AnySchemaValidator, Name extends string, Path extends `/${string}`, P extends ParamsObject<SV>, ResBodyMap extends ResponsesObject<SV>, ReqBody extends Body<SV>, ReqQuery extends QueryObject<SV>, ReqHeaders extends HeadersObject<SV>, ResHeaders extends HeadersObject<SV>, LocalsObj extends Record<string, unknown>, const VersionedApi extends VersionSchema<SV, "trace">, const Auth extends SchemaAuthMethods<SV, P, ReqBody, ReqQuery, ReqHeaders, VersionedApi, Request>>(schemaValidator: SV, path: Path, contractDetails: ContractDetails<SV, Name, "trace", Path, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, VersionedApi, Request, Auth>, ...handlers: ExpressLikeSchemaHandler<SV, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, LocalsObj, VersionedApi, ResolvedSessionObject<SV, Auth, SessionObject<SV>>, Request, Response, NextFunction>[]) => _forklaunch_core_http.ExpressLikeTypedHandler<SV, Name, "trace", Path, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, LocalsObj, VersionedApi, Request<express__default.ParamsDictionary, any, any, ParsedQs$1, Record<string, any>>, Response<any, Record<string, any>>, NextFunction, Auth>;
|
|
1859
|
-
|
|
1860
|
-
/**
|
|
1861
|
-
* Creates an UNLINK route handler with schema validation and type safety.
|
|
1862
|
-
*
|
|
1863
|
-
* @template SV - The schema validator type
|
|
1864
|
-
* @template Path - The route path type (must start with '/')
|
|
1865
|
-
* @template P - The path parameters type
|
|
1866
|
-
* @template ResBodyMap - The response body map type
|
|
1867
|
-
* @template ReqBody - The request body type
|
|
1868
|
-
* @template ReqQuery - The request query parameters type
|
|
1869
|
-
* @template ReqHeaders - The request headers type
|
|
1870
|
-
* @template ResHeaders - The response headers type
|
|
1871
|
-
* @template LocalsObj - The locals object type
|
|
1872
|
-
* @template Auth - The authentication method type
|
|
1873
|
-
*
|
|
1874
|
-
* @param {SV} schemaValidator - The schema validator instance
|
|
1875
|
-
* @param {Path} path - The route path
|
|
1876
|
-
* @param {ContractDetails<SV, 'middleware', Path, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, Request, Auth>} contractDetails - The contract details for the route
|
|
1877
|
-
* @param {...ExpressLikeSchemaHandler<SV, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, LocalsObj, Request, Auth>} handlers - The route handlers
|
|
1878
|
-
*
|
|
1879
|
-
* @returns {void} - Returns nothing, registers the route with Express
|
|
1880
|
-
*
|
|
1881
|
-
* @example
|
|
1882
|
-
* ```typescript
|
|
1883
|
-
* unlink(
|
|
1884
|
-
* schemaValidator,
|
|
1885
|
-
* '/resources/:id/link',
|
|
1886
|
-
* {
|
|
1887
|
-
* summary: 'Unlink resource',
|
|
1888
|
-
* description: 'Removes a link between two resources',
|
|
1889
|
-
* tags: ['resources'],
|
|
1890
|
-
* pathParams: {
|
|
1891
|
-
* id: { type: 'string' }
|
|
1892
|
-
* },
|
|
1893
|
-
* responses: {
|
|
1894
|
-
* 200: {
|
|
1895
|
-
* description: 'Resource unlinked successfully',
|
|
1896
|
-
* content: {
|
|
1897
|
-
* 'application/json': {
|
|
1898
|
-
* schema: {
|
|
1899
|
-
* type: 'object',
|
|
1900
|
-
* properties: {
|
|
1901
|
-
* id: { type: 'string' },
|
|
1902
|
-
* status: { type: 'string' }
|
|
1903
|
-
* }
|
|
1904
|
-
* }
|
|
1905
|
-
* }
|
|
1906
|
-
* }
|
|
1907
|
-
* }
|
|
1908
|
-
* }
|
|
1909
|
-
* },
|
|
1910
|
-
* async (req, res) => {
|
|
1911
|
-
* const { id } = req.params;
|
|
1912
|
-
* // Unlink logic
|
|
1913
|
-
* res.json({ id, status: 'unlinked' });
|
|
1914
|
-
* }
|
|
1915
|
-
* );
|
|
1916
|
-
* ```
|
|
1917
|
-
*/
|
|
1918
|
-
declare const unlink: <SV extends AnySchemaValidator, Name extends string, Path extends `/${string}`, P extends ParamsObject<SV>, ResBodyMap extends ResponsesObject<SV>, ReqBody extends Body<SV>, ReqQuery extends QueryObject<SV>, ReqHeaders extends HeadersObject<SV>, ResHeaders extends HeadersObject<SV>, LocalsObj extends Record<string, unknown>, const VersionedApi extends VersionSchema<SV, "middleware">, const Auth extends SchemaAuthMethods<SV, P, ReqBody, ReqQuery, ReqHeaders, VersionedApi, Request>>(schemaValidator: SV, path: Path, contractDetails: ContractDetails<SV, Name, "middleware", Path, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, VersionedApi, Request, Auth>, ...handlers: ExpressLikeSchemaHandler<SV, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, LocalsObj, VersionedApi, ResolvedSessionObject<SV, Auth, SessionObject<SV>>, Request, Response, NextFunction>[]) => {
|
|
1919
|
-
_typedHandler: true;
|
|
1920
|
-
_path: Path;
|
|
1921
|
-
contractDetails: _forklaunch_core_http.MiddlewareContractDetails<SV, Name, Path, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, VersionedApi, Request<express__default.ParamsDictionary, any, any, ParsedQs$1, Record<string, any>>, Auth>;
|
|
1922
|
-
handlers: ExpressLikeSchemaHandler<SV, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, LocalsObj, VersionedApi, ResolvedSessionObject<SV, Auth, SessionObject<SV>>, Request<express__default.ParamsDictionary, any, any, ParsedQs$1, Record<string, any>>, Response<any, Record<string, any>>, NextFunction>[];
|
|
1923
|
-
};
|
|
1924
|
-
|
|
1925
|
-
/**
|
|
1926
|
-
* Creates an UNLOCK route handler with schema validation and type safety.
|
|
1927
|
-
*
|
|
1928
|
-
* @template SV - The schema validator type
|
|
1929
|
-
* @template Path - The route path type (must start with '/')
|
|
1930
|
-
* @template P - The path parameters type
|
|
1931
|
-
* @template ResBodyMap - The response body map type
|
|
1932
|
-
* @template ReqBody - The request body type
|
|
1933
|
-
* @template ReqQuery - The request query parameters type
|
|
1934
|
-
* @template ReqHeaders - The request headers type
|
|
1935
|
-
* @template ResHeaders - The response headers type
|
|
1936
|
-
* @template LocalsObj - The locals object type
|
|
1937
|
-
* @template Auth - The authentication method type
|
|
1938
|
-
*
|
|
1939
|
-
* @param {SV} schemaValidator - The schema validator instance
|
|
1940
|
-
* @param {Path} path - The route path
|
|
1941
|
-
* @param {ContractDetails<SV, 'middleware', Path, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, Request, Auth>} contractDetails - The contract details for the route
|
|
1942
|
-
* @param {...ExpressLikeSchemaHandler<SV, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, LocalsObj, Request, Auth>} handlers - The route handlers
|
|
1943
|
-
*
|
|
1944
|
-
* @returns {void} - Returns nothing, registers the route with Express
|
|
1945
|
-
*
|
|
1946
|
-
* @example
|
|
1947
|
-
* ```typescript
|
|
1948
|
-
* unlock(
|
|
1949
|
-
* schemaValidator,
|
|
1950
|
-
* '/resources/:id/lock',
|
|
1951
|
-
* {
|
|
1952
|
-
* summary: 'Unlock resource',
|
|
1953
|
-
* description: 'Removes a lock from a resource',
|
|
1954
|
-
* tags: ['resources'],
|
|
1955
|
-
* pathParams: {
|
|
1956
|
-
* id: { type: 'string' }
|
|
1957
|
-
* },
|
|
1958
|
-
* responses: {
|
|
1959
|
-
* 200: {
|
|
1960
|
-
* description: 'Resource unlocked successfully',
|
|
1961
|
-
* content: {
|
|
1962
|
-
* 'application/json': {
|
|
1963
|
-
* schema: {
|
|
1964
|
-
* type: 'object',
|
|
1965
|
-
* properties: {
|
|
1966
|
-
* id: { type: 'string' },
|
|
1967
|
-
* status: { type: 'string' }
|
|
1968
|
-
* }
|
|
1969
|
-
* }
|
|
1970
|
-
* }
|
|
1971
|
-
* }
|
|
1972
|
-
* }
|
|
1973
|
-
* }
|
|
1974
|
-
* },
|
|
1975
|
-
* async (req, res) => {
|
|
1976
|
-
* const { id } = req.params;
|
|
1977
|
-
* // Unlock logic
|
|
1978
|
-
* res.json({ id, status: 'unlocked' });
|
|
1979
|
-
* }
|
|
1980
|
-
* );
|
|
1981
|
-
* ```
|
|
1982
|
-
*/
|
|
1983
|
-
declare const unlock: <SV extends AnySchemaValidator, Name extends string, Path extends `/${string}`, P extends ParamsObject<SV>, ResBodyMap extends ResponsesObject<SV>, ReqBody extends Body<SV>, ReqQuery extends QueryObject<SV>, ReqHeaders extends HeadersObject<SV>, ResHeaders extends HeadersObject<SV>, LocalsObj extends Record<string, unknown>, const VersionedApi extends VersionSchema<SV, "middleware">, const Auth extends SchemaAuthMethods<SV, P, ReqBody, ReqQuery, ReqHeaders, VersionedApi, Request>>(schemaValidator: SV, path: Path, contractDetails: ContractDetails<SV, Name, "middleware", Path, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, VersionedApi, Request, Auth>, ...handlers: ExpressLikeSchemaHandler<SV, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, LocalsObj, VersionedApi, ResolvedSessionObject<SV, Auth, SessionObject<SV>>, Request, Response, NextFunction>[]) => {
|
|
1984
|
-
_typedHandler: true;
|
|
1985
|
-
_path: Path;
|
|
1986
|
-
contractDetails: _forklaunch_core_http.MiddlewareContractDetails<SV, Name, Path, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, VersionedApi, Request<express__default.ParamsDictionary, any, any, ParsedQs$1, Record<string, any>>, Auth>;
|
|
1987
|
-
handlers: ExpressLikeSchemaHandler<SV, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, LocalsObj, VersionedApi, ResolvedSessionObject<SV, Auth, SessionObject<SV>>, Request<express__default.ParamsDictionary, any, any, ParsedQs$1, Record<string, any>>, Response<any, Record<string, any>>, NextFunction>[];
|
|
1988
|
-
};
|
|
1989
|
-
|
|
1990
|
-
/**
|
|
1991
|
-
* Creates an UNSUBSCRIBE route handler with schema validation and type safety.
|
|
1992
|
-
*
|
|
1993
|
-
* @template SV - The schema validator type
|
|
1994
|
-
* @template Name - The name of the route
|
|
1995
|
-
* @template Path - The route path type
|
|
1996
|
-
* @template P - The path parameters type
|
|
1997
|
-
* @template ResBodyMap - The response body map type
|
|
1998
|
-
* @template ReqBody - The request body type
|
|
1999
|
-
* @template ReqQuery - The request query parameters type
|
|
2000
|
-
* @template ReqHeaders - The request headers type
|
|
2001
|
-
* @template ResHeaders - The response headers type
|
|
2002
|
-
* @template LocalsObj - The locals object type
|
|
2003
|
-
* @template Auth - The authentication methods base type
|
|
2004
|
-
*
|
|
2005
|
-
* @param {SV} schemaValidator - The schema validator instance
|
|
2006
|
-
* @param {Path} path - The route path
|
|
2007
|
-
* @param {ContractDetails<SV, 'middleware', Name, Path, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, Request, Auth>} contractDetails - The contract details for the route
|
|
2008
|
-
* @param {...ExpressLikeSchemaHandler<SV, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, LocalsObj, Request, Auth>} handlers - The route handlers
|
|
2009
|
-
*
|
|
2010
|
-
* @returns {void} - Returns nothing, registers the route with Express
|
|
2011
|
-
*
|
|
2012
|
-
* @example
|
|
2013
|
-
* ```typescript
|
|
2014
|
-
* unsubscribe(
|
|
2015
|
-
* schemaValidator,
|
|
2016
|
-
* '/subscriptions/:id',
|
|
2017
|
-
* {
|
|
2018
|
-
* summary: 'Unsubscribe from updates',
|
|
2019
|
-
* description: 'Removes a subscription to resource updates',
|
|
2020
|
-
* tags: ['subscriptions'],
|
|
2021
|
-
* pathParams: {
|
|
2022
|
-
* id: { type: 'string' }
|
|
2023
|
-
* },
|
|
2024
|
-
* responses: {
|
|
2025
|
-
* 200: {
|
|
2026
|
-
* description: 'Subscription removed successfully',
|
|
2027
|
-
* content: {
|
|
2028
|
-
* 'application/json': {
|
|
2029
|
-
* schema: {
|
|
2030
|
-
* type: 'object',
|
|
2031
|
-
* properties: {
|
|
2032
|
-
* id: { type: 'string' },
|
|
2033
|
-
* status: { type: 'string' }
|
|
2034
|
-
* }
|
|
2035
|
-
* }
|
|
2036
|
-
* }
|
|
2037
|
-
* }
|
|
2038
|
-
* }
|
|
2039
|
-
* }
|
|
2040
|
-
* },
|
|
2041
|
-
* async (req, res) => {
|
|
2042
|
-
* const { id } = req.params;
|
|
2043
|
-
* // Unsubscribe logic
|
|
2044
|
-
* res.json({ id, status: 'unsubscribed' });
|
|
2045
|
-
* }
|
|
2046
|
-
* );
|
|
2047
|
-
* ```
|
|
2048
|
-
*/
|
|
2049
|
-
declare const unsubscribe: <SV extends AnySchemaValidator, Name extends string, Path extends `/${string}`, P extends ParamsObject<SV>, ResBodyMap extends ResponsesObject<SV>, ReqBody extends Body<SV>, ReqQuery extends QueryObject<SV>, ReqHeaders extends HeadersObject<SV>, ResHeaders extends HeadersObject<SV>, LocalsObj extends Record<string, unknown>, const VersionedApi extends VersionSchema<SV, "middleware">, const Auth extends SchemaAuthMethods<SV, P, ReqBody, ReqQuery, ReqHeaders, VersionedApi, Request>>(schemaValidator: SV, path: Path, contractDetails: ContractDetails<SV, Name, "middleware", Path, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, VersionedApi, Request, Auth>, ...handlers: ExpressLikeSchemaHandler<SV, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, LocalsObj, VersionedApi, ResolvedSessionObject<SV, Auth, SessionObject<SV>>, Request, Response, NextFunction>[]) => {
|
|
2050
|
-
_typedHandler: true;
|
|
2051
|
-
_path: Path;
|
|
2052
|
-
contractDetails: _forklaunch_core_http.MiddlewareContractDetails<SV, Name, Path, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, VersionedApi, Request<express__default.ParamsDictionary, any, any, ParsedQs$1, Record<string, any>>, Auth>;
|
|
2053
|
-
handlers: ExpressLikeSchemaHandler<SV, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, LocalsObj, VersionedApi, ResolvedSessionObject<SV, Auth, SessionObject<SV>>, Request<express__default.ParamsDictionary, any, any, ParsedQs$1, Record<string, any>>, Response<any, Record<string, any>>, NextFunction>[];
|
|
2054
|
-
};
|
|
2055
|
-
|
|
1
|
+
import { ContractDetailsOrMiddlewareOrTypedHandler, HeadersObject, Body as HttpBody, Method, MetricsDefinition, MiddlewareOrMiddlewareWithTypedHandler, OpenTelemetryCollector, ParamsObject, QueryObject, ResponsesObject, SchemaAuthMethods, SessionObject, VersionSchema } from '@forklaunch/core/http';
|
|
2
|
+
import { AnySchemaValidator } from '@forklaunch/validator';
|
|
3
|
+
import { RequestHandler } from 'express';
|
|
4
|
+
import { Application } from './src/expressApplication';
|
|
5
|
+
import { Router } from './src/expressRouter';
|
|
6
|
+
import { checkout } from './src/handlers/checkout';
|
|
7
|
+
import { copy } from './src/handlers/copy';
|
|
8
|
+
import { delete_ } from './src/handlers/delete';
|
|
9
|
+
import { get } from './src/handlers/get';
|
|
10
|
+
import { head } from './src/handlers/head';
|
|
11
|
+
import { link } from './src/handlers/link';
|
|
12
|
+
import { lock } from './src/handlers/lock';
|
|
13
|
+
import { mSearch } from './src/handlers/m-search';
|
|
14
|
+
import { merge } from './src/handlers/merge';
|
|
15
|
+
import { middleware } from './src/handlers/middleware';
|
|
16
|
+
import { mkcActivity } from './src/handlers/mkcactivity';
|
|
17
|
+
import { mkcol } from './src/handlers/mkcol';
|
|
18
|
+
import { move } from './src/handlers/move';
|
|
19
|
+
import { notify } from './src/handlers/notify';
|
|
20
|
+
import { options } from './src/handlers/options';
|
|
21
|
+
import { patch } from './src/handlers/patch';
|
|
22
|
+
import { post } from './src/handlers/post';
|
|
23
|
+
import { propfind } from './src/handlers/propfind';
|
|
24
|
+
import { proppatch } from './src/handlers/proppatch';
|
|
25
|
+
import { purge } from './src/handlers/purge';
|
|
26
|
+
import { put } from './src/handlers/put';
|
|
27
|
+
import { report } from './src/handlers/report';
|
|
28
|
+
import { search } from './src/handlers/search';
|
|
29
|
+
import { subscribe } from './src/handlers/subscribe';
|
|
30
|
+
import { trace } from './src/handlers/trace';
|
|
31
|
+
import { unlink } from './src/handlers/unlink';
|
|
32
|
+
import { unlock } from './src/handlers/unlock';
|
|
33
|
+
import { unsubscribe } from './src/handlers/unsubscribe';
|
|
34
|
+
import { ExpressApplicationOptions, ExpressRouterOptions } from './src/types/expressOptions.types';
|
|
2056
35
|
/**
|
|
2057
36
|
* Creates a new instance of Application with the given schema validator.
|
|
2058
37
|
*
|
|
@@ -2060,7 +39,7 @@ declare const unsubscribe: <SV extends AnySchemaValidator, Name extends string,
|
|
|
2060
39
|
* @param {SV} schemaValidator - The schema validator.
|
|
2061
40
|
* @returns {Application<SV>} - The new application instance.
|
|
2062
41
|
*/
|
|
2063
|
-
declare function forklaunchExpress<SV extends AnySchemaValidator, SessionSchema extends SessionObject<SV>>(schemaValidator: SV, openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>, options?: ExpressApplicationOptions<SV, SessionSchema>): Application<SV, SessionSchema>;
|
|
42
|
+
export declare function forklaunchExpress<SV extends AnySchemaValidator, SessionSchema extends SessionObject<SV>>(schemaValidator: SV, openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>, options?: ExpressApplicationOptions<SV, SessionSchema>): Application<SV, SessionSchema>;
|
|
2064
43
|
/**
|
|
2065
44
|
* Creates a new instance of Router with the given base path and schema validator.
|
|
2066
45
|
*
|
|
@@ -2069,9 +48,17 @@ declare function forklaunchExpress<SV extends AnySchemaValidator, SessionSchema
|
|
|
2069
48
|
* @param {SV} schemaValidator - The schema validator.
|
|
2070
49
|
* @returns {Router<SV>} - The new router instance.
|
|
2071
50
|
*/
|
|
2072
|
-
declare function forklaunchRouter<SV extends AnySchemaValidator, BasePath extends `/${string}`, SessionSchema extends SessionObject<SV>>(basePath: BasePath, schemaValidator: SV, openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>, options?: ExpressRouterOptions<SV, SessionSchema>): Router<SV, BasePath, SessionSchema>;
|
|
2073
|
-
|
|
2074
|
-
|
|
51
|
+
export declare function forklaunchRouter<SV extends AnySchemaValidator, BasePath extends `/${string}`, SessionSchema extends SessionObject<SV>>(basePath: BasePath, schemaValidator: SV, openTelemetryCollector: OpenTelemetryCollector<MetricsDefinition>, options?: ExpressRouterOptions<SV, SessionSchema>): Router<SV, BasePath, SessionSchema>;
|
|
52
|
+
export type { DocsConfiguration, ParsedQs } from '@forklaunch/core/http';
|
|
53
|
+
export type { OptionsJson, OptionsText, OptionsUrlencoded } from 'body-parser';
|
|
54
|
+
export type { BusboyConfig } from 'busboy';
|
|
55
|
+
export type { CorsOptions } from 'cors';
|
|
56
|
+
export type { NextFunction, Request, Response } from 'express';
|
|
57
|
+
export type * from 'express-serve-static-core';
|
|
58
|
+
export type { Application } from './src/expressApplication';
|
|
59
|
+
export type { Router } from './src/expressRouter';
|
|
60
|
+
export type { ExpressApplicationOptions, ExpressRouterOptions } from './src/types/expressOptions.types';
|
|
61
|
+
export declare const handlers: {
|
|
2075
62
|
checkout: typeof checkout;
|
|
2076
63
|
copy: typeof copy;
|
|
2077
64
|
delete: typeof delete_;
|
|
@@ -2101,12 +88,11 @@ declare const handlers: {
|
|
|
2101
88
|
unlock: typeof unlock;
|
|
2102
89
|
unsubscribe: typeof unsubscribe;
|
|
2103
90
|
};
|
|
2104
|
-
declare const port: <SV extends AnySchemaValidator, Name extends string, ContractMethod extends Method, Path extends `/${string}`, P extends ParamsObject<SV>, ResBodyMap extends ResponsesObject<SV>, ReqBody extends
|
|
91
|
+
export declare const port: <SV extends AnySchemaValidator, Name extends string, ContractMethod extends Method, Path extends `/${string}`, P extends ParamsObject<SV>, ResBodyMap extends ResponsesObject<SV>, ReqBody extends HttpBody<SV>, ReqQuery extends QueryObject<SV>, ReqHeaders extends HeadersObject<SV>, ResHeaders extends HeadersObject<SV>, LocalsObj extends Record<string, unknown>, VersionedApi extends VersionSchema<SV, ContractMethod>, RouterSession extends SessionObject<SV>, BaseRequest, BaseResponse, NextFunction, Auth extends SchemaAuthMethods<SV, P, ReqBody, ReqQuery, ReqHeaders, VersionedApi, BaseRequest>, RouterHandler>(options: {
|
|
2105
92
|
method: ContractMethod;
|
|
2106
93
|
path: Path;
|
|
2107
94
|
basePath: string;
|
|
2108
95
|
schemaValidator: SV;
|
|
2109
96
|
openTelemetryCollector?: OpenTelemetryCollector<MetricsDefinition>;
|
|
2110
97
|
}, contractDetailsOrMiddlewareOrTypedHandler: ContractDetailsOrMiddlewareOrTypedHandler<SV, Name, ContractMethod, Path, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, LocalsObj, VersionedApi, BaseRequest, BaseResponse, NextFunction, RouterSession, Auth>, ...middlewareOrMiddlewareAndTypedHandler: MiddlewareOrMiddlewareWithTypedHandler<SV, Name, ContractMethod, Path, P, ResBodyMap, ReqBody, ReqQuery, ReqHeaders, ResHeaders, LocalsObj, VersionedApi, BaseRequest, BaseResponse, NextFunction, RouterSession, Auth>[]) => RequestHandler[];
|
|
2111
|
-
|
|
2112
|
-
export { Application, type ExpressApplicationOptions, type ExpressRouterOptions, Router, forklaunchExpress, forklaunchRouter, handlers, port };
|
|
98
|
+
//# sourceMappingURL=index.d.ts.map
|