@leyyo/http-mock 1.2.1 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +396 -4
- package/dist/application/index.types.d.ts +64 -8
- package/dist/application/mock-application.d.ts +72 -7
- package/dist/application/mock-application.js +72 -13
- package/dist/application/mock-application.js.map +1 -1
- package/dist/http-mock.d.ts +6 -1
- package/dist/http-mock.js +11 -0
- package/dist/http-mock.js.map +1 -1
- package/dist/index.types.d.ts +26 -4
- package/dist/request/index.types.d.ts +40 -4
- package/dist/request/mock.request.d.ts +136 -11
- package/dist/request/mock.request.js +112 -31
- package/dist/request/mock.request.js.map +1 -1
- package/dist/response/index-types.d.ts +48 -3
- package/dist/response/mock-response.d.ts +156 -8
- package/dist/response/mock-response.js +113 -13
- package/dist/response/mock-response.js.map +1 -1
- package/dist/shared/http-event.d.ts +3 -0
- package/dist/shared/http-event.js +3 -0
- package/dist/shared/http-event.js.map +1 -1
- package/dist/shared/http-method.js +1 -0
- package/dist/shared/http-method.js.map +1 -1
- package/dist/shared/http-protocol.js +1 -0
- package/dist/shared/http-protocol.js.map +1 -1
- package/dist/shared/index.types.d.ts +15 -1
- package/package.json +6 -6
|
@@ -1,123 +1,248 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
import type { ArrayOptions, Readable } from "node:stream";
|
|
1
|
+
import { Application, MediaType, NextFunction, Request, Response } from "express";
|
|
2
|
+
import { Socket } from "net";
|
|
3
|
+
import { IncomingHttpHeaders } from "http";
|
|
4
|
+
import RangeParser from "range-parser";
|
|
5
|
+
import { MockRequestLike, MockServiceRequest, PipeOption, RequestBody, RequestErrorCallback, RequestLocal } from "./index.types";
|
|
6
|
+
import { _StreamAbort, _StreamBool, _StreamCompose, _StreamGeneric, _StreamIterator, _StreamReduce, _StreamVoid, HttpCookies, HttpEvent, HttpMethod, HttpParams, HttpProtocol, HttpQuery } from "../shared";
|
|
7
|
+
import { Dict, Fnc, HttpStatus, OneOrMore } from "@leyyo/common";
|
|
8
|
+
import { ArrayOptions, Readable } from "node:stream";
|
|
10
9
|
export declare class MockRequest<B extends RequestBody = RequestBody, L extends RequestLocal = RequestLocal> extends HttpEvent<Request> implements MockRequestLike<B, L> {
|
|
10
|
+
/** @inheritDoc */
|
|
11
11
|
readonly isFake: boolean;
|
|
12
|
+
/** @inheritDoc */
|
|
12
13
|
readonly locals: L;
|
|
14
|
+
/** @inheritDoc */
|
|
13
15
|
[another: string]: unknown;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
+
/**
|
|
17
|
+
* Constructor
|
|
18
|
+
*
|
|
19
|
+
* @param {MockServiceRequest} service - for bulk request
|
|
20
|
+
* @param {Request} origin - first real request
|
|
21
|
+
* @param {object} custom - custom values
|
|
22
|
+
* */
|
|
16
23
|
constructor(service?: MockServiceRequest<B>, origin?: Request, custom?: Dict);
|
|
24
|
+
/** @inheritDoc*/
|
|
17
25
|
accepted: MediaType[];
|
|
26
|
+
/** @inheritDoc*/
|
|
18
27
|
readonly protocol: HttpProtocol;
|
|
28
|
+
/** @inheritDoc*/
|
|
19
29
|
readonly secure: boolean;
|
|
30
|
+
/** @inheritDoc*/
|
|
20
31
|
readonly ip: string;
|
|
32
|
+
/** @inheritDoc*/
|
|
21
33
|
readonly ips: string[];
|
|
34
|
+
/** @inheritDoc*/
|
|
22
35
|
readonly subdomains: string[];
|
|
36
|
+
/** @inheritDoc*/
|
|
23
37
|
readonly path: string;
|
|
38
|
+
/** @inheritDoc*/
|
|
24
39
|
readonly host: string;
|
|
40
|
+
/** @inheritDoc*/
|
|
25
41
|
readonly hostname: string;
|
|
42
|
+
/** @inheritDoc*/
|
|
26
43
|
readonly httpVersion: string;
|
|
44
|
+
/** @inheritDoc*/
|
|
27
45
|
readonly httpVersionMajor: number;
|
|
46
|
+
/** @inheritDoc*/
|
|
28
47
|
readonly httpVersionMinor: number;
|
|
48
|
+
/** @inheritDoc*/
|
|
29
49
|
readonly fresh: boolean;
|
|
50
|
+
/** @inheritDoc*/
|
|
30
51
|
readonly stale: boolean;
|
|
52
|
+
/** @inheritDoc*/
|
|
31
53
|
readonly xhr: boolean;
|
|
54
|
+
/** @inheritDoc*/
|
|
32
55
|
body: RequestBody;
|
|
56
|
+
/** @inheritDoc*/
|
|
33
57
|
cookies: any;
|
|
58
|
+
/** @inheritDoc*/
|
|
34
59
|
method: HttpMethod;
|
|
60
|
+
/** @inheritDoc*/
|
|
35
61
|
params: HttpParams;
|
|
62
|
+
/** @inheritDoc*/
|
|
36
63
|
query: HttpQuery;
|
|
64
|
+
/** @inheritDoc*/
|
|
37
65
|
route: any;
|
|
66
|
+
/** @inheritDoc*/
|
|
38
67
|
signedCookies: HttpCookies;
|
|
68
|
+
/** @inheritDoc*/
|
|
39
69
|
originalUrl: string;
|
|
70
|
+
/** @inheritDoc*/
|
|
40
71
|
url: string;
|
|
72
|
+
/** @inheritDoc*/
|
|
41
73
|
baseUrl: string;
|
|
74
|
+
/** @inheritDoc*/
|
|
42
75
|
app: Application;
|
|
76
|
+
/** @inheritDoc*/
|
|
43
77
|
res?: Response<unknown, L>;
|
|
78
|
+
/** @inheritDoc*/
|
|
44
79
|
next?: NextFunction;
|
|
80
|
+
/** @inheritDoc*/
|
|
45
81
|
headers: IncomingHttpHeaders;
|
|
82
|
+
/** @inheritDoc*/
|
|
46
83
|
is(t: OneOrMore<string>): string | false | null;
|
|
84
|
+
/** @inheritDoc*/
|
|
47
85
|
get(n: "set-cookie"): string[] | undefined;
|
|
86
|
+
/** @inheritDoc*/
|
|
48
87
|
get(n: string): string | undefined;
|
|
88
|
+
/** @inheritDoc*/
|
|
49
89
|
header(n: "set-cookie"): string[] | undefined;
|
|
90
|
+
/** @inheritDoc*/
|
|
50
91
|
header(n: string): string | undefined;
|
|
92
|
+
/** @inheritDoc*/
|
|
51
93
|
accepts(): string[];
|
|
94
|
+
/** @inheritDoc*/
|
|
52
95
|
accepts(t: string): string | false;
|
|
96
|
+
/** @inheritDoc*/
|
|
53
97
|
accepts(t: string[]): string | false;
|
|
98
|
+
/** @inheritDoc*/
|
|
54
99
|
accepts(...t: string[]): string | false;
|
|
100
|
+
/** @inheritDoc*/
|
|
55
101
|
acceptsCharsets(): string[];
|
|
102
|
+
/** @inheritDoc*/
|
|
56
103
|
acceptsCharsets(c: string): string | false;
|
|
104
|
+
/** @inheritDoc*/
|
|
57
105
|
acceptsCharsets(c: string[]): string | false;
|
|
106
|
+
/** @inheritDoc*/
|
|
58
107
|
acceptsCharsets(...c: string[]): string | false;
|
|
108
|
+
/** @inheritDoc*/
|
|
59
109
|
acceptsEncodings(): string[];
|
|
110
|
+
/** @inheritDoc*/
|
|
60
111
|
acceptsEncodings(e: string): string | false;
|
|
112
|
+
/** @inheritDoc*/
|
|
61
113
|
acceptsEncodings(e: string[]): string | false;
|
|
114
|
+
/** @inheritDoc*/
|
|
62
115
|
acceptsEncodings(...e: string[]): string | false;
|
|
116
|
+
/** @inheritDoc*/
|
|
63
117
|
acceptsLanguages(): string[];
|
|
118
|
+
/** @inheritDoc*/
|
|
64
119
|
acceptsLanguages(l: string): string | false;
|
|
120
|
+
/** @inheritDoc*/
|
|
65
121
|
acceptsLanguages(l: string[]): string | false;
|
|
122
|
+
/** @inheritDoc*/
|
|
66
123
|
acceptsLanguages(...l: string[]): string | false;
|
|
124
|
+
/** @inheritDoc*/
|
|
67
125
|
range(s: number, o?: RangeParser.Options): RangeParser.Ranges | RangeParser.Result | undefined;
|
|
126
|
+
/** @inheritDoc*/
|
|
68
127
|
aborted: boolean;
|
|
128
|
+
/** @inheritDoc*/
|
|
69
129
|
complete: boolean;
|
|
130
|
+
/** @inheritDoc*/
|
|
70
131
|
statusCode: HttpStatus | undefined;
|
|
132
|
+
/** @inheritDoc*/
|
|
71
133
|
statusMessage: string | undefined;
|
|
134
|
+
/** @inheritDoc*/
|
|
72
135
|
socket: Socket;
|
|
136
|
+
/** @inheritDoc*/
|
|
73
137
|
headersDistinct: NodeJS.Dict<string[]>;
|
|
138
|
+
/** @inheritDoc*/
|
|
74
139
|
rawHeaders: string[];
|
|
140
|
+
/** @inheritDoc*/
|
|
75
141
|
trailers: Record<string, string>;
|
|
142
|
+
/** @inheritDoc*/
|
|
76
143
|
rawTrailers: string[];
|
|
144
|
+
/** @inheritDoc*/
|
|
77
145
|
trailersDistinct: NodeJS.Dict<string[]>;
|
|
146
|
+
/** @inheritDoc*/
|
|
78
147
|
get connection(): Socket;
|
|
148
|
+
/** @inheritDoc*/
|
|
79
149
|
destroy(_e?: Error): this;
|
|
150
|
+
/** @inheritDoc*/
|
|
80
151
|
setTimeout(_m: number, _c?: Fnc): this;
|
|
152
|
+
/** @inheritDoc*/
|
|
81
153
|
[Symbol.asyncIterator](): AsyncIterableIterator<any>;
|
|
154
|
+
/** @inheritDoc*/
|
|
82
155
|
[Symbol.asyncDispose](): Promise<void>;
|
|
156
|
+
/** @inheritDoc*/
|
|
83
157
|
readonly closed: boolean;
|
|
158
|
+
/** @inheritDoc*/
|
|
84
159
|
readonly errored: Error;
|
|
160
|
+
/** @inheritDoc*/
|
|
85
161
|
destroyed: boolean;
|
|
162
|
+
/** @inheritDoc*/
|
|
86
163
|
readonly readableDidRead: boolean;
|
|
164
|
+
/** @inheritDoc*/
|
|
87
165
|
readonly readableEncoding: BufferEncoding | null;
|
|
166
|
+
/** @inheritDoc*/
|
|
88
167
|
readonly readableEnded: boolean;
|
|
168
|
+
/** @inheritDoc*/
|
|
89
169
|
readonly readableAborted: boolean;
|
|
170
|
+
/** @inheritDoc*/
|
|
90
171
|
readonly readableFlowing: boolean | null;
|
|
172
|
+
/** @inheritDoc*/
|
|
91
173
|
readonly readableHighWaterMark: number;
|
|
174
|
+
/** @inheritDoc*/
|
|
92
175
|
readonly readableLength: number;
|
|
176
|
+
/** @inheritDoc*/
|
|
93
177
|
readonly readableObjectMode: boolean;
|
|
178
|
+
/** @inheritDoc*/
|
|
94
179
|
readable: boolean;
|
|
180
|
+
/** @inheritDoc*/
|
|
95
181
|
_construct(_c: RequestErrorCallback): void;
|
|
182
|
+
/** @inheritDoc*/
|
|
96
183
|
_destroy(_e: Error | null, _c: RequestErrorCallback): void;
|
|
184
|
+
/** @inheritDoc*/
|
|
97
185
|
_read(_s: number): void;
|
|
186
|
+
/** @inheritDoc*/
|
|
98
187
|
read(_s: number | undefined): string | Buffer;
|
|
188
|
+
/** @inheritDoc*/
|
|
99
189
|
push(_c: any, _e?: BufferEncoding): boolean;
|
|
190
|
+
/** @inheritDoc*/
|
|
100
191
|
isPaused(): boolean;
|
|
192
|
+
/** @inheritDoc*/
|
|
101
193
|
resume(): this;
|
|
194
|
+
/** @inheritDoc*/
|
|
102
195
|
pause(): this;
|
|
196
|
+
/** @inheritDoc*/
|
|
103
197
|
pipe<T extends NodeJS.WritableStream>(_d: T, _o?: PipeOption): T;
|
|
198
|
+
/** @inheritDoc*/
|
|
104
199
|
setEncoding(_e: BufferEncoding): this;
|
|
200
|
+
/** @inheritDoc*/
|
|
105
201
|
unpipe(_d?: NodeJS.WritableStream): this;
|
|
202
|
+
/** @inheritDoc*/
|
|
106
203
|
unshift(_c: string | Uint8Array, _e?: BufferEncoding): void;
|
|
204
|
+
/** @inheritDoc*/
|
|
107
205
|
wrap(_s: NodeJS.ReadableStream): this;
|
|
206
|
+
/** @inheritDoc*/
|
|
108
207
|
asIndexedPairs(_o: _StreamAbort | undefined): Readable;
|
|
208
|
+
/** @inheritDoc*/
|
|
109
209
|
compose<T extends NodeJS.ReadableStream>(_s: _StreamCompose | Iterable<T> | AsyncIterable<T> | T, _o: _StreamAbort | undefined): T;
|
|
210
|
+
/** @inheritDoc*/
|
|
110
211
|
drop(_l: number, _o: _StreamAbort | undefined): Readable;
|
|
212
|
+
/** @inheritDoc*/
|
|
111
213
|
every(_f: _StreamBool, _o: ArrayOptions | undefined): Promise<boolean>;
|
|
214
|
+
/** @inheritDoc*/
|
|
112
215
|
filter(_f: _StreamBool, _o: ArrayOptions | undefined): Readable;
|
|
216
|
+
/** @inheritDoc*/
|
|
113
217
|
find<T>(_f: _StreamGeneric<T>, _o: ArrayOptions | undefined): Promise<T | undefined>;
|
|
218
|
+
/** @inheritDoc*/
|
|
114
219
|
flatMap(_f: _StreamGeneric<any>, _o: ArrayOptions | undefined): Readable;
|
|
220
|
+
/** @inheritDoc*/
|
|
115
221
|
forEach(_f: _StreamVoid, _o: ArrayOptions | undefined): Promise<void>;
|
|
222
|
+
/** @inheritDoc*/
|
|
116
223
|
iterator(_o: _StreamIterator | undefined): NodeJS.AsyncIterator<any>;
|
|
224
|
+
/** @inheritDoc*/
|
|
117
225
|
map(_f: _StreamGeneric<any>, _o: ArrayOptions | undefined): Readable;
|
|
226
|
+
/** @inheritDoc*/
|
|
118
227
|
reduce<T>(_f: _StreamReduce<T>, _i: undefined, _o: _StreamAbort | undefined): Promise<T>;
|
|
228
|
+
/** @inheritDoc*/
|
|
119
229
|
some(_f: _StreamBool, _o: ArrayOptions | undefined): Promise<boolean>;
|
|
230
|
+
/** @inheritDoc*/
|
|
120
231
|
take(_l: number, _o: _StreamAbort | undefined): Readable;
|
|
232
|
+
/** @inheritDoc*/
|
|
121
233
|
toArray(_o: _StreamAbort | undefined): Promise<any[]>;
|
|
234
|
+
/** @inheritDoc*/
|
|
122
235
|
param(name: string, defaultValue?: any): string;
|
|
236
|
+
/**
|
|
237
|
+
* Set first real request
|
|
238
|
+
*
|
|
239
|
+
* @param {Request} origin
|
|
240
|
+
* */
|
|
241
|
+
static setFirstOrigin(origin: Request): void;
|
|
242
|
+
/**
|
|
243
|
+
* Get first real request
|
|
244
|
+
*
|
|
245
|
+
* @return {Request}
|
|
246
|
+
* */
|
|
247
|
+
static get firstOrigin(): Request;
|
|
123
248
|
}
|
|
@@ -3,33 +3,18 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.MockRequest = void 0;
|
|
4
4
|
const shared_1 = require("../shared");
|
|
5
5
|
const common_1 = require("@leyyo/common");
|
|
6
|
-
const common_2 = require("@leyyo/common");
|
|
7
6
|
let _firstOrigin;
|
|
8
7
|
// noinspection JSUnusedGlobalSymbols
|
|
9
8
|
class MockRequest extends shared_1.HttpEvent {
|
|
10
9
|
// endregion property
|
|
11
|
-
// region static
|
|
12
|
-
static setFirstOrigin(origin) {
|
|
13
|
-
if (!_firstOrigin && origin) {
|
|
14
|
-
_firstOrigin = origin;
|
|
15
|
-
delete _firstOrigin.headers;
|
|
16
|
-
delete _firstOrigin.body;
|
|
17
|
-
delete _firstOrigin.cookies;
|
|
18
|
-
delete _firstOrigin.params;
|
|
19
|
-
_removePath(_firstOrigin);
|
|
20
|
-
try {
|
|
21
|
-
delete _firstOrigin.path;
|
|
22
|
-
}
|
|
23
|
-
catch (e) {
|
|
24
|
-
// nothing
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
static get firstOrigin() {
|
|
29
|
-
return _firstOrigin;
|
|
30
|
-
}
|
|
31
|
-
// endregion static
|
|
32
10
|
// region constructor
|
|
11
|
+
/**
|
|
12
|
+
* Constructor
|
|
13
|
+
*
|
|
14
|
+
* @param {MockServiceRequest} service - for bulk request
|
|
15
|
+
* @param {Request} origin - first real request
|
|
16
|
+
* @param {object} custom - custom values
|
|
17
|
+
* */
|
|
33
18
|
constructor(service, origin, custom) {
|
|
34
19
|
super(origin);
|
|
35
20
|
_attachOrigin(this, origin);
|
|
@@ -37,171 +22,243 @@ class MockRequest extends shared_1.HttpEvent {
|
|
|
37
22
|
_attachCustom(this, custom);
|
|
38
23
|
_checkRoute(this);
|
|
39
24
|
}
|
|
25
|
+
/** @inheritDoc*/
|
|
40
26
|
is(t) {
|
|
41
27
|
var _a, _b;
|
|
42
28
|
return (_b = (_a = this._origin) === null || _a === void 0 ? void 0 : _a.is(t)) !== null && _b !== void 0 ? _b : false;
|
|
43
29
|
}
|
|
30
|
+
/** @inheritDoc*/
|
|
44
31
|
get(n) {
|
|
45
32
|
return this.header(n);
|
|
46
33
|
}
|
|
34
|
+
/** @inheritDoc*/
|
|
47
35
|
header(n) {
|
|
48
36
|
return (typeof n === 'string') ? this.headers[n] : undefined;
|
|
49
37
|
}
|
|
38
|
+
/** @inheritDoc*/
|
|
50
39
|
accepts(...t) {
|
|
51
40
|
var _a;
|
|
52
41
|
return (_a = this._origin) === null || _a === void 0 ? void 0 : _a.accepts(...t);
|
|
53
42
|
}
|
|
43
|
+
/** @inheritDoc*/
|
|
54
44
|
acceptsCharsets(...c) {
|
|
55
45
|
var _a;
|
|
56
46
|
return (_a = this._origin) === null || _a === void 0 ? void 0 : _a.acceptsCharsets(...c);
|
|
57
47
|
}
|
|
48
|
+
/** @inheritDoc*/
|
|
58
49
|
acceptsEncodings(...e) {
|
|
59
50
|
var _a;
|
|
60
51
|
return (_a = this._origin) === null || _a === void 0 ? void 0 : _a.acceptsEncodings(...e);
|
|
61
52
|
}
|
|
53
|
+
/** @inheritDoc*/
|
|
62
54
|
acceptsLanguages(...l) {
|
|
63
55
|
var _a;
|
|
64
56
|
return (_a = this._origin) === null || _a === void 0 ? void 0 : _a.acceptsLanguages(...l);
|
|
65
57
|
}
|
|
58
|
+
/** @inheritDoc*/
|
|
66
59
|
range(s, o) {
|
|
67
60
|
var _a, _b;
|
|
68
61
|
return (_b = (_a = this._origin) === null || _a === void 0 ? void 0 : _a.range(s, o)) !== null && _b !== void 0 ? _b : -1;
|
|
69
62
|
}
|
|
63
|
+
/** @inheritDoc*/
|
|
70
64
|
get connection() {
|
|
71
65
|
logger.warn('Should not be called', { fn: 'connection' });
|
|
72
66
|
return this.socket;
|
|
73
67
|
}
|
|
68
|
+
/** @inheritDoc*/
|
|
74
69
|
destroy(_e) {
|
|
75
70
|
logger.warn('Should not be called', { fn: 'destroy' });
|
|
76
71
|
return this;
|
|
77
72
|
}
|
|
73
|
+
/** @inheritDoc*/
|
|
78
74
|
setTimeout(_m, _c) {
|
|
79
75
|
logger.warn('Should not be called', { fn: 'setTimeout' });
|
|
80
76
|
return this;
|
|
81
77
|
}
|
|
82
78
|
// endregion http
|
|
83
79
|
// region stream
|
|
80
|
+
/** @inheritDoc*/
|
|
84
81
|
[Symbol.asyncIterator]() {
|
|
85
82
|
logger.warn('Should not be called', { fn: 'asyncIterator' });
|
|
86
83
|
return this._origin ? this._origin[Symbol.asyncIterator]() : undefined;
|
|
87
84
|
}
|
|
85
|
+
/** @inheritDoc*/
|
|
88
86
|
[Symbol.asyncDispose]() {
|
|
89
87
|
logger.warn('Should not be called', { fn: 'asyncDispose' });
|
|
90
|
-
return this._origin ? this._origin[Symbol.asyncDispose]() : (0,
|
|
88
|
+
return this._origin ? this._origin[Symbol.asyncDispose]() : (0, common_1.delay)(100);
|
|
91
89
|
}
|
|
90
|
+
/** @inheritDoc*/
|
|
92
91
|
_construct(_c) {
|
|
93
92
|
logger.warn('Should not be called', { fn: '_construct' });
|
|
94
93
|
}
|
|
94
|
+
/** @inheritDoc*/
|
|
95
95
|
_destroy(_e, _c) {
|
|
96
96
|
logger.warn('Should not be called', { fn: '_destroy' });
|
|
97
97
|
}
|
|
98
|
+
/** @inheritDoc*/
|
|
98
99
|
_read(_s) {
|
|
99
100
|
logger.warn('Should not be called', { fn: '_read' });
|
|
100
101
|
}
|
|
102
|
+
/** @inheritDoc*/
|
|
101
103
|
read(_s) {
|
|
102
104
|
logger.warn('Should not be called', { fn: 'read' });
|
|
103
105
|
return undefined;
|
|
104
106
|
}
|
|
107
|
+
/** @inheritDoc*/
|
|
105
108
|
push(_c, _e) {
|
|
106
109
|
logger.warn('Should not be called', { fn: 'push' });
|
|
107
110
|
return false;
|
|
108
111
|
}
|
|
112
|
+
/** @inheritDoc*/
|
|
109
113
|
isPaused() {
|
|
110
114
|
logger.warn('Should not be called', { fn: 'isPaused' });
|
|
111
115
|
return false;
|
|
112
116
|
}
|
|
117
|
+
/** @inheritDoc*/
|
|
113
118
|
resume() {
|
|
114
119
|
logger.warn('Should not be called', { fn: 'resume' });
|
|
115
120
|
return this;
|
|
116
121
|
}
|
|
122
|
+
/** @inheritDoc*/
|
|
117
123
|
pause() {
|
|
118
124
|
logger.warn('Should not be called', { fn: 'pause' });
|
|
119
125
|
return this;
|
|
120
126
|
}
|
|
127
|
+
/** @inheritDoc*/
|
|
121
128
|
pipe(_d, _o) {
|
|
122
129
|
logger.warn('Should not be called', { fn: 'pipe' });
|
|
123
130
|
return undefined;
|
|
124
131
|
}
|
|
132
|
+
/** @inheritDoc*/
|
|
125
133
|
setEncoding(_e) {
|
|
126
134
|
logger.warn('Should not be called', { fn: 'setEncoding' });
|
|
127
135
|
return this;
|
|
128
136
|
}
|
|
137
|
+
/** @inheritDoc*/
|
|
129
138
|
unpipe(_d) {
|
|
130
139
|
logger.warn('Should not be called', { fn: 'unpipe' });
|
|
131
140
|
return this;
|
|
132
141
|
}
|
|
142
|
+
/** @inheritDoc*/
|
|
133
143
|
unshift(_c, _e) {
|
|
134
144
|
logger.warn('Should not be called', { fn: 'unshift' });
|
|
135
145
|
}
|
|
146
|
+
/** @inheritDoc*/
|
|
136
147
|
wrap(_s) {
|
|
137
148
|
logger.warn('Should not be called', { fn: 'wrap' });
|
|
138
149
|
return this;
|
|
139
150
|
}
|
|
151
|
+
/** @inheritDoc*/
|
|
140
152
|
asIndexedPairs(_o) {
|
|
141
153
|
logger.warn('Should not be called', { fn: 'asIndexedPairs' });
|
|
142
154
|
return undefined;
|
|
143
155
|
}
|
|
156
|
+
/** @inheritDoc*/
|
|
144
157
|
compose(_s, _o) {
|
|
145
158
|
logger.warn('Should not be called', { fn: 'compose' });
|
|
146
159
|
return undefined;
|
|
147
160
|
}
|
|
161
|
+
/** @inheritDoc*/
|
|
148
162
|
drop(_l, _o) {
|
|
149
163
|
logger.warn('Should not be called', { fn: 'drop' });
|
|
150
164
|
return undefined;
|
|
151
165
|
}
|
|
166
|
+
/** @inheritDoc*/
|
|
152
167
|
every(_f, _o) {
|
|
153
168
|
logger.warn('Should not be called', { fn: 'every' });
|
|
154
|
-
return (0,
|
|
169
|
+
return (0, common_1.delay)(10, false);
|
|
155
170
|
}
|
|
171
|
+
/** @inheritDoc*/
|
|
156
172
|
filter(_f, _o) {
|
|
157
173
|
logger.warn('Should not be called', { fn: 'filter' });
|
|
158
174
|
return undefined;
|
|
159
175
|
}
|
|
176
|
+
/** @inheritDoc*/
|
|
160
177
|
find(_f, _o) {
|
|
161
178
|
logger.warn('Should not be called', { fn: 'find' });
|
|
162
|
-
return (0,
|
|
179
|
+
return (0, common_1.delay)(10);
|
|
163
180
|
}
|
|
181
|
+
/** @inheritDoc*/
|
|
164
182
|
flatMap(_f, _o) {
|
|
165
183
|
logger.warn('Should not be called', { fn: 'flatMap' });
|
|
166
184
|
return undefined;
|
|
167
185
|
}
|
|
186
|
+
/** @inheritDoc*/
|
|
168
187
|
forEach(_f, _o) {
|
|
169
188
|
logger.warn('Should not be called', { fn: 'forEach' });
|
|
170
|
-
return (0,
|
|
189
|
+
return (0, common_1.delay)(10);
|
|
171
190
|
}
|
|
191
|
+
/** @inheritDoc*/
|
|
172
192
|
iterator(_o) {
|
|
173
193
|
logger.warn('Should not be called', { fn: 'iterator' });
|
|
174
194
|
return undefined;
|
|
175
195
|
}
|
|
196
|
+
/** @inheritDoc*/
|
|
176
197
|
map(_f, _o) {
|
|
177
198
|
logger.warn('Should not be called', { fn: 'map' });
|
|
178
199
|
return undefined;
|
|
179
200
|
}
|
|
201
|
+
/** @inheritDoc*/
|
|
180
202
|
reduce(_f, _i, _o) {
|
|
181
203
|
logger.warn('Should not be called', { fn: 'reduce' });
|
|
182
|
-
return (0,
|
|
204
|
+
return (0, common_1.delay)(10);
|
|
183
205
|
}
|
|
206
|
+
/** @inheritDoc*/
|
|
184
207
|
some(_f, _o) {
|
|
185
208
|
logger.warn('Should not be called', { fn: 'some' });
|
|
186
|
-
return (0,
|
|
209
|
+
return (0, common_1.delay)(10, false);
|
|
187
210
|
}
|
|
211
|
+
/** @inheritDoc*/
|
|
188
212
|
take(_l, _o) {
|
|
189
213
|
logger.warn('Should not be called', { fn: 'take' });
|
|
190
214
|
return undefined;
|
|
191
215
|
}
|
|
216
|
+
/** @inheritDoc*/
|
|
192
217
|
toArray(_o) {
|
|
193
218
|
logger.warn('Should not be called', { fn: 'toArray' });
|
|
194
|
-
return (0,
|
|
219
|
+
return (0, common_1.delay)(10, []);
|
|
195
220
|
}
|
|
196
221
|
// endregion stream
|
|
197
222
|
// region method
|
|
223
|
+
/** @inheritDoc*/
|
|
198
224
|
param(name, defaultValue) {
|
|
199
225
|
var _a;
|
|
200
226
|
return (_a = this.params[name]) !== null && _a !== void 0 ? _a : defaultValue;
|
|
201
227
|
}
|
|
228
|
+
// endregion method
|
|
229
|
+
// region static
|
|
230
|
+
/**
|
|
231
|
+
* Set first real request
|
|
232
|
+
*
|
|
233
|
+
* @param {Request} origin
|
|
234
|
+
* */
|
|
235
|
+
static setFirstOrigin(origin) {
|
|
236
|
+
if (!_firstOrigin && origin) {
|
|
237
|
+
_firstOrigin = origin;
|
|
238
|
+
delete _firstOrigin.headers;
|
|
239
|
+
delete _firstOrigin.body;
|
|
240
|
+
delete _firstOrigin.cookies;
|
|
241
|
+
delete _firstOrigin.params;
|
|
242
|
+
_removePath(_firstOrigin);
|
|
243
|
+
try {
|
|
244
|
+
delete _firstOrigin.path;
|
|
245
|
+
}
|
|
246
|
+
catch (e) {
|
|
247
|
+
// nothing
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
/**
|
|
252
|
+
* Get first real request
|
|
253
|
+
*
|
|
254
|
+
* @return {Request}
|
|
255
|
+
* */
|
|
256
|
+
static get firstOrigin() {
|
|
257
|
+
return _firstOrigin;
|
|
258
|
+
}
|
|
202
259
|
}
|
|
203
260
|
exports.MockRequest = MockRequest;
|
|
204
|
-
const logger = common_1
|
|
261
|
+
const logger = (0, common_1.newLogger)(MockRequest);
|
|
205
262
|
// region functions
|
|
206
263
|
function _removePath(req) {
|
|
207
264
|
try {
|
|
@@ -211,6 +268,12 @@ function _removePath(req) {
|
|
|
211
268
|
// nothing
|
|
212
269
|
}
|
|
213
270
|
}
|
|
271
|
+
/**
|
|
272
|
+
* Attach service to request
|
|
273
|
+
*
|
|
274
|
+
* @param {Request} req - request
|
|
275
|
+
* @param {MockServiceRequest} service - service request object
|
|
276
|
+
* */
|
|
214
277
|
function _attachService(req, service) {
|
|
215
278
|
var _a, _b, _g, _h, _j;
|
|
216
279
|
if (!service) {
|
|
@@ -231,14 +294,27 @@ function _attachService(req, service) {
|
|
|
231
294
|
req.cookies = (_h = service === null || service === void 0 ? void 0 : service.cookies) !== null && _h !== void 0 ? _h : {};
|
|
232
295
|
req.signedCookies = (_j = service === null || service === void 0 ? void 0 : service.signedCookies) !== null && _j !== void 0 ? _j : {};
|
|
233
296
|
}
|
|
234
|
-
|
|
297
|
+
/**
|
|
298
|
+
* Attach first real request
|
|
299
|
+
*
|
|
300
|
+
* @param {Request} _req
|
|
301
|
+
* @param {Request} origin
|
|
302
|
+
* */
|
|
303
|
+
function _attachOrigin(_req, origin) {
|
|
235
304
|
origin = origin !== null && origin !== void 0 ? origin : _firstOrigin;
|
|
236
305
|
if (origin) {
|
|
306
|
+
// Clear specific values
|
|
237
307
|
origin.body = undefined;
|
|
238
308
|
origin.params = {};
|
|
239
309
|
_removePath(origin);
|
|
240
310
|
}
|
|
241
311
|
}
|
|
312
|
+
/**
|
|
313
|
+
* Attach custom object to request
|
|
314
|
+
*
|
|
315
|
+
* @param {Request} req
|
|
316
|
+
* @param {object} custom
|
|
317
|
+
* */
|
|
242
318
|
function _attachCustom(req, custom) {
|
|
243
319
|
if (custom) {
|
|
244
320
|
for (const [key, value] of Object.entries(custom)) {
|
|
@@ -248,6 +324,11 @@ function _attachCustom(req, custom) {
|
|
|
248
324
|
}
|
|
249
325
|
}
|
|
250
326
|
}
|
|
327
|
+
/**
|
|
328
|
+
* Check route
|
|
329
|
+
*
|
|
330
|
+
* @param {Request} req
|
|
331
|
+
* */
|
|
251
332
|
function _checkRoute(req) {
|
|
252
333
|
if (!req.route) {
|
|
253
334
|
req.route = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mock.request.js","sourceRoot":"","sources":["../../src/request/mock.request.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"mock.request.js","sourceRoot":"","sources":["../../src/request/mock.request.ts"],"names":[],"mappings":";;;AAYA,sCAcmB;AACnB,0CAAkG;AAGlG,IAAI,YAAqB,CAAC;AAE1B,qCAAqC;AACrC,MAAa,WAAwF,SAAQ,kBAAkB;IAW3H,qBAAqB;IAErB,qBAAqB;IACrB;;;;;;SAMK;IACL,YAAY,OAA+B,EAAE,MAAgB,EAAE,MAAa;QACxE,KAAK,CAAC,MAAM,CAAC,CAAC;QACd,aAAa,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QAC5B,cAAc,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAC9B,aAAa,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QAC5B,WAAW,CAAC,IAAI,CAAC,CAAC;IACtB,CAAC;IA6FD,iBAAiB;IACjB,EAAE,CAAC,CAAoB;;QACnB,OAAO,MAAA,MAAA,IAAI,CAAC,OAAO,0CAAE,EAAE,CAAC,CAAC,CAAC,mCAAI,KAAK,CAAC;IACxC,CAAC;IAQD,iBAAiB;IACjB,GAAG,CAAC,CAAwB;QACxB,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IAC1B,CAAC;IAQD,iBAAiB;IACjB,MAAM,CAAC,CAAwB;QAC3B,OAAO,CAAC,OAAO,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAW,CAAC,CAAC,CAAC,SAAS,CAAC;IAC3E,CAAC;IAcD,iBAAiB;IACjB,OAAO,CAAC,GAAG,CAAsB;;QAC7B,OAAO,MAAA,IAAI,CAAC,OAAO,0CAAE,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