@syntay/fastay 0.2.3 → 0.2.5
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/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -33
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +3 -0
- package/dist/types/request.d.ts +389 -0
- package/dist/types/request.d.ts.map +1 -0
- package/dist/types/request.js +1 -0
- package/package.json +4 -1
- package/fastay.png +0 -0
- package/src/app.ts +0 -328
- package/src/banner.ts +0 -11
- package/src/error-handler.ts +0 -48
- package/src/index.ts +0 -5
- package/src/logger.ts +0 -78
- package/src/middleware.ts +0 -107
- package/src/router.ts +0 -230
- package/src/types/express.d.ts +0 -8
- package/src/types/index.ts +0 -73
- package/src/utils/cookies.ts +0 -34
- package/src/utils/formDataMiddleware.ts +0 -155
- package/src/utils/wrapMiddleware.ts +0 -95
- package/tsconfig.build.json +0 -14
- package/tsconfig.json +0 -22
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { createApp } from './app.js';
|
|
2
2
|
export { createMiddleware } from './middleware.js';
|
|
3
3
|
export type { CreateAppOptions } from './app.js';
|
|
4
|
-
export type {
|
|
4
|
+
export type { Response, Next } from './types';
|
|
5
|
+
export type { Request } from './types/request';
|
|
5
6
|
export { cookies } from './utils/cookies.js';
|
|
6
7
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrC,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,YAAY,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AACjD,YAAY,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrC,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,YAAY,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AACjD,YAAY,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAC9C,YAAY,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,34 +1,5 @@
|
|
|
1
1
|
import './express';
|
|
2
|
-
import {
|
|
3
|
-
export interface CookieItem {
|
|
4
|
-
value: string;
|
|
5
|
-
}
|
|
6
|
-
export interface RequestCookies {
|
|
7
|
-
/**
|
|
8
|
-
* Retrieves a cookie by its name.
|
|
9
|
-
* @param name - The name of the cookie to retrieve.
|
|
10
|
-
* @returns An object containing the cookie's value, or undefined if not found.
|
|
11
|
-
*/
|
|
12
|
-
get(name: string): CookieItem | undefined;
|
|
13
|
-
/**
|
|
14
|
-
* Checks if a cookie with the given name exists.
|
|
15
|
-
* @param name - The name of the cookie to check.
|
|
16
|
-
* @returns True if the cookie exists, false otherwise.
|
|
17
|
-
*/
|
|
18
|
-
has(name: string): boolean;
|
|
19
|
-
/**
|
|
20
|
-
* Returns all cookies as a key-value object.
|
|
21
|
-
* @returns An object where keys are cookie names and values are cookie values.
|
|
22
|
-
*/
|
|
23
|
-
all(): Record<string, string>;
|
|
24
|
-
}
|
|
25
|
-
export interface Request extends ExpressRequest {
|
|
26
|
-
/**
|
|
27
|
-
* Represents the cookies sent in a request.
|
|
28
|
-
*/
|
|
29
|
-
cookies: RequestCookies;
|
|
30
|
-
formData: () => Promise<FormData>;
|
|
31
|
-
}
|
|
2
|
+
import { Response as ExpressResponse, NextFunction } from 'express';
|
|
32
3
|
export type Response = ExpressResponse;
|
|
33
4
|
export type Next = NextFunction;
|
|
34
5
|
declare global {
|
|
@@ -51,7 +22,4 @@ declare global {
|
|
|
51
22
|
};
|
|
52
23
|
}
|
|
53
24
|
export type RouteHandler = (() => FastayResponse | any) | ((req: Request) => FastayResponse | any) | ((req: Request, res: Response) => FastayResponse | any);
|
|
54
|
-
export interface CookieItem {
|
|
55
|
-
value: string;
|
|
56
|
-
}
|
|
57
25
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,CAAC;AACnB,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,CAAC;AACnB,OAAO,EAEL,QAAQ,IAAI,eAAe,EAC3B,YAAY,EACb,MAAM,SAAS,CAAC;AAsCjB,MAAM,MAAM,QAAQ,GAAG,eAAe,CAAC;AACvC,MAAM,MAAM,IAAI,GAAG,YAAY,CAAC;AAEhC,OAAO,CAAC,MAAM,CAAC;IACb,KAAK,cAAc,GAAG;QACpB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,IAAI,CAAC,EAAE,GAAG,CAAC;QACX,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE;YAAE,KAAK,EAAE,MAAM,CAAC;YAAC,OAAO,CAAC,EAAE,GAAG,CAAA;SAAE,CAAC,CAAC;QAC3D,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QACjC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,IAAI,CAAC,EAAE;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;YAAC,OAAO,CAAC,EAAE,GAAG,CAAA;SAAE,CAAC;QAC1D,MAAM,CAAC,EAAE,MAAM,CAAC,cAAc,CAAC;QAC/B,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;KACvB,CAAC;CACH;AAED,MAAM,MAAM,YAAY,GACpB,CAAC,MAAM,cAAc,GAAG,GAAG,CAAC,GAC5B,CAAC,CAAC,GAAG,EAAE,OAAO,KAAK,cAAc,GAAG,GAAG,CAAC,GACxC,CAAC,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,KAAK,cAAc,GAAG,GAAG,CAAC,CAAC"}
|
package/dist/types/index.js
CHANGED
|
@@ -0,0 +1,389 @@
|
|
|
1
|
+
import * as http from 'http';
|
|
2
|
+
import * as net from 'net';
|
|
3
|
+
export interface CookieItem {
|
|
4
|
+
value: string;
|
|
5
|
+
}
|
|
6
|
+
export interface RequestCookies {
|
|
7
|
+
/**
|
|
8
|
+
* Retrieves a cookie by its name.
|
|
9
|
+
* @param name - The name of the cookie to retrieve.
|
|
10
|
+
* @returns An object containing the cookie's value, or undefined if not found.
|
|
11
|
+
*/
|
|
12
|
+
get(name: string): CookieItem | undefined;
|
|
13
|
+
/**
|
|
14
|
+
* Checks if a cookie with the given name exists.
|
|
15
|
+
* @param name - The name of the cookie to check.
|
|
16
|
+
* @returns True if the cookie exists, false otherwise.
|
|
17
|
+
*/
|
|
18
|
+
has(name: string): boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Returns all cookies as a key-value object.
|
|
21
|
+
* @returns An object where keys are cookie names and values are cookie values.
|
|
22
|
+
*/
|
|
23
|
+
all(): Record<string, string>;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Interface representing the Fastay Request object
|
|
27
|
+
* @interface Request
|
|
28
|
+
* @extends http.IncomingMessage
|
|
29
|
+
*/
|
|
30
|
+
export interface Request extends http.IncomingMessage {
|
|
31
|
+
/**
|
|
32
|
+
* Contains a reference to the instance of the Express application that is using the middleware.
|
|
33
|
+
* @type {Express}
|
|
34
|
+
*/
|
|
35
|
+
app: Express;
|
|
36
|
+
/**
|
|
37
|
+
* The URL path on which a router instance was mounted.
|
|
38
|
+
* @type {string}
|
|
39
|
+
* @example
|
|
40
|
+
* // app.use('/admin', router)
|
|
41
|
+
* // req.baseUrl would be '/admin'
|
|
42
|
+
*/
|
|
43
|
+
baseUrl: string;
|
|
44
|
+
/**
|
|
45
|
+
* Contains key-value pairs of data submitted in the request body.
|
|
46
|
+
* By default, it is undefined and is populated when you use body-parsing middleware such as express.json() or express.urlencoded().
|
|
47
|
+
* @type {any}
|
|
48
|
+
*/
|
|
49
|
+
body: any;
|
|
50
|
+
/**
|
|
51
|
+
* When using cookie-parser middleware, this property is an object that contains cookies sent by the request.
|
|
52
|
+
* If the request contains no cookies, it defaults to {}.
|
|
53
|
+
* @type {RequestCookies}
|
|
54
|
+
*/
|
|
55
|
+
cookies: RequestCookies;
|
|
56
|
+
/**
|
|
57
|
+
* A function that parses and returns the request body as a FormData object.
|
|
58
|
+
* @returns {Promise<FormData>} A promise that resolves to a FormData object representing the parsed form data.
|
|
59
|
+
*/
|
|
60
|
+
formData: () => Promise<FormData>;
|
|
61
|
+
/**
|
|
62
|
+
* Indicates whether the request is "fresh". It is the opposite of req.stale.
|
|
63
|
+
* It is true if the cache-control request header doesn't have a no-cache directive
|
|
64
|
+
* and any of the following are true:
|
|
65
|
+
* - The if-modified-since request header is specified and last-modified request header is equal to or earlier than the modified response header.
|
|
66
|
+
* - The if-none-match request header is *.
|
|
67
|
+
* - The if-none-match request header, after being parsed into its directives, does not match the etag response header.
|
|
68
|
+
* @type {boolean}
|
|
69
|
+
*/
|
|
70
|
+
fresh: boolean;
|
|
71
|
+
/**
|
|
72
|
+
* Contains the hostname derived from the Host HTTP header.
|
|
73
|
+
* @type {string}
|
|
74
|
+
*/
|
|
75
|
+
hostname: string;
|
|
76
|
+
/**
|
|
77
|
+
* Contains the remote IP address of the request.
|
|
78
|
+
* When the trust proxy setting does not evaluate to false, the value of this property
|
|
79
|
+
* is derived from the left-most entry in the X-Forwarded-For header.
|
|
80
|
+
* @type {string}
|
|
81
|
+
*/
|
|
82
|
+
ip: string;
|
|
83
|
+
/**
|
|
84
|
+
* When the trust proxy setting does not evaluate to false, this property contains an array of IP addresses
|
|
85
|
+
* specified in the X-Forwarded-For request header. Otherwise, it contains an empty array.
|
|
86
|
+
* @type {string[]}
|
|
87
|
+
*/
|
|
88
|
+
ips: string[];
|
|
89
|
+
/**
|
|
90
|
+
* Contains a string corresponding to the HTTP method of the request: GET, POST, PUT, and so on.
|
|
91
|
+
* @type { 'GET'
|
|
92
|
+
| 'POST'
|
|
93
|
+
| 'PUT'
|
|
94
|
+
| 'DELETE'
|
|
95
|
+
| 'PATCH'
|
|
96
|
+
| 'OPTIONS'
|
|
97
|
+
| 'HEAD'
|
|
98
|
+
| string}
|
|
99
|
+
*/
|
|
100
|
+
method: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH' | 'OPTIONS' | 'HEAD' | string;
|
|
101
|
+
/**
|
|
102
|
+
* This property is much like req.url; however, it retains the original request URL, allowing you to rewrite req.url freely for internal routing purposes.
|
|
103
|
+
* @type {string}
|
|
104
|
+
* @example
|
|
105
|
+
* // GET /search?q=something
|
|
106
|
+
* console.log(req.originalUrl); // '/search?q=something'
|
|
107
|
+
*/
|
|
108
|
+
originalUrl: string;
|
|
109
|
+
/**
|
|
110
|
+
* This property is an object containing properties mapped to the named route "parameters".
|
|
111
|
+
* For example, if you have the route /user/:name, then the "name" property is available as req.params.name.
|
|
112
|
+
* This object defaults to {}.
|
|
113
|
+
* @type {object}
|
|
114
|
+
*/
|
|
115
|
+
params: any;
|
|
116
|
+
/**
|
|
117
|
+
* Contains the path part of the request URL.
|
|
118
|
+
* @type {string}
|
|
119
|
+
* @example
|
|
120
|
+
* // example.com/users?sort=desc
|
|
121
|
+
* console.log(req.path); // '/users'
|
|
122
|
+
*/
|
|
123
|
+
path: string;
|
|
124
|
+
/**
|
|
125
|
+
* Contains the request protocol string: either http or (for TLS requests) https.
|
|
126
|
+
* When the trust proxy setting does not evaluate to false, this property will use the value of the X-Forwarded-Proto header field if present.
|
|
127
|
+
* @type {string}
|
|
128
|
+
*/
|
|
129
|
+
protocol: string;
|
|
130
|
+
/**
|
|
131
|
+
* This property is an object containing a property for each query string parameter in the route.
|
|
132
|
+
* When query parser is set to disabled, it is an empty object {}.
|
|
133
|
+
* @type {object}
|
|
134
|
+
*/
|
|
135
|
+
query: any;
|
|
136
|
+
/**
|
|
137
|
+
* Contains the currently-matched route, a string. For example:
|
|
138
|
+
* @type {string}
|
|
139
|
+
* @example
|
|
140
|
+
* app.get('/user/:id?', function userIdHandler(req, res) {
|
|
141
|
+
* console.log(req.route); // { path: '/user/:id?', ... }
|
|
142
|
+
* });
|
|
143
|
+
*/
|
|
144
|
+
route: any;
|
|
145
|
+
/**
|
|
146
|
+
* A Boolean property that is true if a TLS connection is established.
|
|
147
|
+
* Equivalent to: req.protocol === 'https'
|
|
148
|
+
* @type {boolean}
|
|
149
|
+
*/
|
|
150
|
+
secure: boolean;
|
|
151
|
+
/**
|
|
152
|
+
* When using cookie-parser middleware, this property contains signed cookies sent by the request, unsigned and ready for use.
|
|
153
|
+
* Signed cookies reside in a different object to show developer intent; otherwise, a malicious attack could be placed on req.cookie values.
|
|
154
|
+
* @type {object}
|
|
155
|
+
*/
|
|
156
|
+
signedCookies: any;
|
|
157
|
+
/**
|
|
158
|
+
* Indicates whether the request is "stale", and is the opposite of req.fresh.
|
|
159
|
+
* For more information, see req.fresh.
|
|
160
|
+
* @type {boolean}
|
|
161
|
+
*/
|
|
162
|
+
stale: boolean;
|
|
163
|
+
/**
|
|
164
|
+
* Contains an array of subdomains in the domain name of the request.
|
|
165
|
+
* @type {string[]}
|
|
166
|
+
* @example
|
|
167
|
+
* // Host: "tobi.ferrets.example.com"
|
|
168
|
+
* console.log(req.subdomains); // ['ferrets', 'tobi']
|
|
169
|
+
*/
|
|
170
|
+
subdomains: string[];
|
|
171
|
+
/**
|
|
172
|
+
* True if the request's X-Requested-With header field is "XMLHttpRequest", indicating that the request was issued by a client library such as jQuery.
|
|
173
|
+
* @type {boolean}
|
|
174
|
+
*/
|
|
175
|
+
xhr: boolean;
|
|
176
|
+
/**
|
|
177
|
+
* Checks if the specified content types are acceptable, based on the request's Accept HTTP header field.
|
|
178
|
+
* The method returns the best match, or if none of the specified content types is acceptable, returns false.
|
|
179
|
+
* @param {string|string[]} types - The content types to check
|
|
180
|
+
* @returns {string|false} The best matching content type, or false if none are acceptable
|
|
181
|
+
* @example
|
|
182
|
+
* // Accept: text/html
|
|
183
|
+
* req.accepts('html'); // => 'html'
|
|
184
|
+
* req.accepts('text/html'); // => 'text/html'
|
|
185
|
+
*/
|
|
186
|
+
accepts(types: string | string[]): string | false;
|
|
187
|
+
/**
|
|
188
|
+
* Returns the first accepted charset of the specified character sets, based on the request's Accept-Charset HTTP header field.
|
|
189
|
+
* @param {string|string[]} charsets - The charsets to check
|
|
190
|
+
* @returns {string|false} The best matching charset, or false if none are acceptable
|
|
191
|
+
*/
|
|
192
|
+
acceptsCharsets(charsets: string | string[]): string | false;
|
|
193
|
+
/**
|
|
194
|
+
* Returns the first accepted encoding of the specified encodings, based on the request's Accept-Encoding HTTP header field.
|
|
195
|
+
* @param {string|string[]} encodings - The encodings to check
|
|
196
|
+
* @returns {string|false} The best matching encoding, or false if none are acceptable
|
|
197
|
+
*/
|
|
198
|
+
acceptsEncodings(encodings: string | string[]): string | false;
|
|
199
|
+
/**
|
|
200
|
+
* Returns the first accepted language of the specified languages, based on the request's Accept-Language HTTP header field.
|
|
201
|
+
* @param {string|string[]} langs - The languages to check
|
|
202
|
+
* @returns {string|false} The best matching language, or false if none are acceptable
|
|
203
|
+
*/
|
|
204
|
+
acceptsLanguages(langs: string | string[]): string | false;
|
|
205
|
+
/**
|
|
206
|
+
* Returns the specified HTTP request header field (case-insensitive match).
|
|
207
|
+
* The Referrer and Referer fields are interchangeable.
|
|
208
|
+
* @param {string} field - The header field name
|
|
209
|
+
* @returns {string} The header value
|
|
210
|
+
* @example
|
|
211
|
+
* req.get('Content-Type'); // => "text/plain"
|
|
212
|
+
* req.get('content-type'); // => "text/plain"
|
|
213
|
+
*/
|
|
214
|
+
get(field: string): string;
|
|
215
|
+
/**
|
|
216
|
+
* Alias for req.get().
|
|
217
|
+
* @param {string} name - The header field name
|
|
218
|
+
* @returns {string} The header value
|
|
219
|
+
*/
|
|
220
|
+
header(name: string): string;
|
|
221
|
+
/**
|
|
222
|
+
* Checks if the incoming request contains the "Content-Type" header field and if it matches the given type string.
|
|
223
|
+
* @param {string|string[]} types - The content type(s) to check for
|
|
224
|
+
* @returns {string|false} The matching content type, or false if no match
|
|
225
|
+
* @example
|
|
226
|
+
* // With Content-Type: text/html; charset=utf-8
|
|
227
|
+
* req.is('html'); // => 'html'
|
|
228
|
+
* req.is('text/html'); // => 'text/html'
|
|
229
|
+
*/
|
|
230
|
+
is(types: string | string[]): string | false;
|
|
231
|
+
/**
|
|
232
|
+
* Parse Range header field, capping to the given size.
|
|
233
|
+
* The ranges property is an array of ranges, or undefined if there are no ranges.
|
|
234
|
+
* @param {number} size - The maximum size of the range
|
|
235
|
+
* @returns {any} An array of ranges or undefined
|
|
236
|
+
*/
|
|
237
|
+
range(size: number, options?: any): any;
|
|
238
|
+
/**
|
|
239
|
+
* @deprecated Since v13.4.0, v12.16.0 - Use request.destroyed instead
|
|
240
|
+
* Is true if the request has been aborted.
|
|
241
|
+
* @type {boolean}
|
|
242
|
+
*/
|
|
243
|
+
aborted: boolean;
|
|
244
|
+
/**
|
|
245
|
+
* The request/response headers object. Key-value pairs of header names and values.
|
|
246
|
+
* @type {http.IncomingHttpHeaders}
|
|
247
|
+
*/
|
|
248
|
+
headers: http.IncomingHttpHeaders;
|
|
249
|
+
/**
|
|
250
|
+
* The raw request/response headers list exactly as they were received.
|
|
251
|
+
* @type {string[]}
|
|
252
|
+
*/
|
|
253
|
+
rawHeaders: string[];
|
|
254
|
+
/**
|
|
255
|
+
* The raw request/response trailer keys and values exactly as they were received.
|
|
256
|
+
* Only populated at the 'end' event.
|
|
257
|
+
* @type {string[]}
|
|
258
|
+
*/
|
|
259
|
+
rawTrailers: string[];
|
|
260
|
+
/**
|
|
261
|
+
* The net.Socket object associated with the connection.
|
|
262
|
+
* @type {net.Socket}
|
|
263
|
+
*/
|
|
264
|
+
socket: net.Socket;
|
|
265
|
+
/**
|
|
266
|
+
* The request/response trailers object. Only populated at the 'end' event.
|
|
267
|
+
* @type {NodeJS.Dict<string>}
|
|
268
|
+
*/
|
|
269
|
+
trailers: NodeJS.Dict<string>;
|
|
270
|
+
/**
|
|
271
|
+
* The request method as a string. Read only. Example: 'GET', 'DELETE'.
|
|
272
|
+
* @type {string}
|
|
273
|
+
*/
|
|
274
|
+
/**
|
|
275
|
+
* Request URL string. This contains only the URL that is present in the actual HTTP request.
|
|
276
|
+
* @type {string}
|
|
277
|
+
*/
|
|
278
|
+
url: string;
|
|
279
|
+
/**
|
|
280
|
+
* In case of server request, the HTTP version sent by the client.
|
|
281
|
+
* @type {string}
|
|
282
|
+
*/
|
|
283
|
+
httpVersion: string;
|
|
284
|
+
/**
|
|
285
|
+
* The 3-digit HTTP response status code. E.G. 404.
|
|
286
|
+
* @type {number}
|
|
287
|
+
*/
|
|
288
|
+
statusCode: number;
|
|
289
|
+
/**
|
|
290
|
+
* The HTTP response status message (reason phrase). E.G. OK or Internal Server Error.
|
|
291
|
+
* @type {string}
|
|
292
|
+
*/
|
|
293
|
+
statusMessage: string;
|
|
294
|
+
/**
|
|
295
|
+
* Calls destroy() on the socket that received the IncomingMessage.
|
|
296
|
+
* @returns {this}
|
|
297
|
+
*/
|
|
298
|
+
destroy(error?: Error): this;
|
|
299
|
+
/**
|
|
300
|
+
* File object(s) uploaded via multer middleware
|
|
301
|
+
* @type {Express.Multer.File|Express.Multer.File[]}
|
|
302
|
+
*/
|
|
303
|
+
file?: Express.Multer.File;
|
|
304
|
+
files?: Express.Multer.File[] | {
|
|
305
|
+
[fieldname: string]: Express.Multer.File[];
|
|
306
|
+
};
|
|
307
|
+
/**
|
|
308
|
+
* Authenticated user object when using Passport.js
|
|
309
|
+
* @type {any}
|
|
310
|
+
*/
|
|
311
|
+
user?: any;
|
|
312
|
+
/**
|
|
313
|
+
* Session object when using express-session
|
|
314
|
+
* @type {Express.Session}
|
|
315
|
+
*/
|
|
316
|
+
session?: any;
|
|
317
|
+
/**
|
|
318
|
+
* Session ID when using express-session
|
|
319
|
+
* @type {string}
|
|
320
|
+
*/
|
|
321
|
+
sessionID?: string;
|
|
322
|
+
/**
|
|
323
|
+
* Authentication context when using multiple strategies
|
|
324
|
+
* @type {any}
|
|
325
|
+
*/
|
|
326
|
+
authInfo?: any;
|
|
327
|
+
/**
|
|
328
|
+
* Nonce for Content Security Policy when using helmet
|
|
329
|
+
* @type {string}
|
|
330
|
+
*/
|
|
331
|
+
cspNonce?: string;
|
|
332
|
+
}
|
|
333
|
+
/**
|
|
334
|
+
* Interface for Express application
|
|
335
|
+
*/
|
|
336
|
+
interface Express {
|
|
337
|
+
/**
|
|
338
|
+
* Settings for the application
|
|
339
|
+
*/
|
|
340
|
+
settings: any;
|
|
341
|
+
/**
|
|
342
|
+
* Middleware stack
|
|
343
|
+
*/
|
|
344
|
+
_router: any;
|
|
345
|
+
/**
|
|
346
|
+
* Event emitter methods
|
|
347
|
+
*/
|
|
348
|
+
on: (event: string, listener: Function) => Express;
|
|
349
|
+
emit: (event: string, ...args: any[]) => boolean;
|
|
350
|
+
}
|
|
351
|
+
/**
|
|
352
|
+
* Interface for Multer file object
|
|
353
|
+
*/
|
|
354
|
+
declare namespace Express {
|
|
355
|
+
namespace Multer {
|
|
356
|
+
interface File {
|
|
357
|
+
/** Field name specified in the form */
|
|
358
|
+
fieldname: string;
|
|
359
|
+
/** Name of the file on the user's computer */
|
|
360
|
+
originalname: string;
|
|
361
|
+
/** Encoding type of the file */
|
|
362
|
+
encoding: string;
|
|
363
|
+
/** Mime type of the file */
|
|
364
|
+
mimetype: string;
|
|
365
|
+
/** Size of the file in bytes */
|
|
366
|
+
size: number;
|
|
367
|
+
/** The folder to which the file has been saved */
|
|
368
|
+
destination: string;
|
|
369
|
+
/** The name of the file within the destination */
|
|
370
|
+
filename: string;
|
|
371
|
+
/** Location of the uploaded file */
|
|
372
|
+
path: string;
|
|
373
|
+
/** A Buffer of the entire file */
|
|
374
|
+
buffer: Buffer;
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
/**
|
|
379
|
+
* Interface for Express Session
|
|
380
|
+
*/
|
|
381
|
+
declare namespace Express {
|
|
382
|
+
interface Session {
|
|
383
|
+
id: string;
|
|
384
|
+
cookie: any;
|
|
385
|
+
[key: string]: any;
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
export type { Response } from 'express';
|
|
389
|
+
//# sourceMappingURL=request.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request.d.ts","sourceRoot":"","sources":["../../src/types/request.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,KAAK,GAAG,MAAM,KAAK,CAAC;AAE3B,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,cAAc;IAC7B;;;;OAIG;IACH,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS,CAAC;IAE1C;;;;OAIG;IACH,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;IAE3B;;;OAGG;IACH,GAAG,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC/B;AAED;;;;GAIG;AACH,MAAM,WAAW,OAAQ,SAAQ,IAAI,CAAC,eAAe;IAGnD;;;OAGG;IACH,GAAG,EAAE,OAAO,CAAC;IAEb;;;;;;OAMG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;;;OAIG;IACH,IAAI,EAAE,GAAG,CAAC;IAEV;;;;OAIG;IACH,OAAO,EAAE,cAAc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,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;KACpB;CACF;AAED,YAAY,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@syntay/fastay",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.5",
|
|
4
4
|
"description": "Framework backend moderno baseado em Express.js, para criar APIs rapidamente",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -27,6 +27,9 @@
|
|
|
27
27
|
"publishConfig": {
|
|
28
28
|
"access": "public"
|
|
29
29
|
},
|
|
30
|
+
"files": [
|
|
31
|
+
"dist"
|
|
32
|
+
],
|
|
30
33
|
"dependencies": {
|
|
31
34
|
"busboy": "^1.6.0",
|
|
32
35
|
"chokidar": "^4.0.3",
|
package/fastay.png
DELETED
|
Binary file
|