@leyyo/http-mock 1.3.3 → 1.3.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.
Files changed (60) hide show
  1. package/dist/application/index.d.ts +1 -1
  2. package/dist/application/index.js +1 -18
  3. package/dist/application/index.types.js +1 -3
  4. package/dist/application/mock-application.d.ts +2 -2
  5. package/dist/application/mock-application.js +27 -13
  6. package/dist/enum/http-method.js +1 -5
  7. package/dist/enum/http-protocol.js +1 -5
  8. package/dist/enum/index.d.ts +2 -2
  9. package/dist/enum/index.js +2 -19
  10. package/dist/event/http-event.d.ts +1 -1
  11. package/dist/event/http-event.js +20 -36
  12. package/dist/event/index.d.ts +2 -2
  13. package/dist/event/index.js +2 -19
  14. package/dist/event/index.types.js +1 -3
  15. package/dist/http-mock.d.ts +1 -1
  16. package/dist/http-mock.js +18 -16
  17. package/dist/index.d.ts +8 -7
  18. package/dist/index.foretell.d.ts +1 -0
  19. package/dist/index.foretell.js +19 -0
  20. package/dist/index.js +8 -24
  21. package/dist/{loader.d.ts → index.loader.d.ts} +0 -1
  22. package/dist/index.loader.js +10 -0
  23. package/dist/index.types.d.ts +2 -2
  24. package/dist/index.types.js +1 -3
  25. package/dist/internal.d.ts +1 -1
  26. package/dist/internal.js +2 -6
  27. package/dist/request/index.d.ts +2 -2
  28. package/dist/request/index.js +2 -19
  29. package/dist/request/index.types.d.ts +3 -3
  30. package/dist/request/index.types.js +1 -3
  31. package/dist/request/mock.request.d.ts +3 -3
  32. package/dist/request/mock.request.js +137 -37
  33. package/dist/response/index-types.d.ts +1 -1
  34. package/dist/response/index-types.js +1 -3
  35. package/dist/response/index.d.ts +2 -2
  36. package/dist/response/index.js +2 -19
  37. package/dist/response/mock-response.d.ts +2 -2
  38. package/dist/response/mock-response.js +100 -46
  39. package/package.json +5 -4
  40. package/dist/application/index.js.map +0 -1
  41. package/dist/application/index.types.js.map +0 -1
  42. package/dist/application/mock-application.js.map +0 -1
  43. package/dist/enum/http-method.js.map +0 -1
  44. package/dist/enum/http-protocol.js.map +0 -1
  45. package/dist/enum/index.js.map +0 -1
  46. package/dist/event/http-event.js.map +0 -1
  47. package/dist/event/index.js.map +0 -1
  48. package/dist/event/index.types.js.map +0 -1
  49. package/dist/http-mock.js.map +0 -1
  50. package/dist/index.js.map +0 -1
  51. package/dist/index.types.js.map +0 -1
  52. package/dist/internal.js.map +0 -1
  53. package/dist/loader.js +0 -64
  54. package/dist/loader.js.map +0 -1
  55. package/dist/request/index.js.map +0 -1
  56. package/dist/request/index.types.js.map +0 -1
  57. package/dist/request/mock.request.js.map +0 -1
  58. package/dist/response/index-types.js.map +0 -1
  59. package/dist/response/index.js.map +0 -1
  60. package/dist/response/mock-response.js.map +0 -1
@@ -1 +1 @@
1
- export * from './mock-application';
1
+ export * from './mock-application.js';
@@ -1,18 +1 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./mock-application"), exports);
18
- //# sourceMappingURL=index.js.map
1
+ export * from './mock-application.js';
@@ -1,3 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=index.types.js.map
1
+ export {};
@@ -1,7 +1,7 @@
1
1
  import { Application, RequestParamHandler, Router } from "express";
2
2
  import * as http from "http";
3
- import { MockApplicationLike } from "./index.types";
4
- import { HttpEvent } from "../event";
3
+ import { MockApplicationLike } from "./index.types.js";
4
+ import { HttpEvent } from "../event/index.js";
5
5
  /**
6
6
  * Http mock application, it extends express application
7
7
  * */
@@ -1,17 +1,34 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MockApplication = void 0;
4
- const event_1 = require("../event");
5
- const common_1 = require("@leyyo/common");
1
+ import { HttpEvent } from "../event/index.js";
2
+ import { logCommon, setFqn } from "@leyyo/common";
3
+ import { FQN } from "../internal.js";
6
4
  let _firstOrigin;
7
5
  // noinspection JSUnusedGlobalSymbols
8
6
  /**
9
7
  * Http mock application, it extends express application
10
8
  * */
11
- class MockApplication extends event_1.HttpEvent {
9
+ export class MockApplication extends HttpEvent {
10
+ // region properties
11
+ /** @inheritDoc */
12
+ _router;
13
+ /** @inheritDoc */
14
+ locals;
15
+ /** @inheritDoc */
16
+ map;
17
+ /** @inheritDoc */
18
+ mountpath;
12
19
  constructor(origin) {
13
20
  super(origin);
14
21
  }
22
+ /** @inheritDoc */
23
+ resource;
24
+ /** @inheritDoc */
25
+ router;
26
+ /** @inheritDoc */
27
+ routes;
28
+ /** @inheritDoc */
29
+ settings;
30
+ /** @inheritDoc */
31
+ stack;
15
32
  // endregion properties
16
33
  // region http-methods
17
34
  /** @inheritDoc */
@@ -206,13 +223,11 @@ class MockApplication extends event_1.HttpEvent {
206
223
  }
207
224
  /** @inheritDoc */
208
225
  param(name, handler) {
209
- var _d;
210
- return (_d = this._origin) === null || _d === void 0 ? void 0 : _d.param(name, handler);
226
+ return this._origin?.param(name, handler);
211
227
  }
212
228
  /** @inheritDoc */
213
229
  path() {
214
- var _d;
215
- return (_d = this._origin) === null || _d === void 0 ? void 0 : _d.path();
230
+ return this._origin?.path();
216
231
  }
217
232
  /** @inheritDoc */
218
233
  render(_n, _o, _c) {
@@ -249,6 +264,5 @@ class MockApplication extends event_1.HttpEvent {
249
264
  return _firstOrigin;
250
265
  }
251
266
  }
252
- exports.MockApplication = MockApplication;
253
- const logger = common_1.logCommon.of(MockApplication);
254
- //# sourceMappingURL=mock-application.js.map
267
+ setFqn(MockApplication, FQN);
268
+ const logger = logCommon.of(MockApplication);
@@ -1,6 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.HttpMethodItems = void 0;
4
1
  const literals = [
5
2
  'delete',
6
3
  'get',
@@ -17,5 +14,4 @@ const literals = [
17
14
  /**
18
15
  * @type {ReadonlyArray<HttpMethod>}
19
16
  * */
20
- exports.HttpMethodItems = literals;
21
- //# sourceMappingURL=http-method.js.map
17
+ export const HttpMethodItems = literals;
@@ -1,6 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.HttpProtocolItems = void 0;
4
1
  const literals = [
5
2
  'http',
6
3
  'https',
@@ -9,5 +6,4 @@ const literals = [
9
6
  /**
10
7
  * @type {ReadonlyArray<HttpProtocol>}
11
8
  * */
12
- exports.HttpProtocolItems = literals;
13
- //# sourceMappingURL=http-protocol.js.map
9
+ export const HttpProtocolItems = literals;
@@ -1,2 +1,2 @@
1
- export * from './http-method';
2
- export * from './http-protocol';
1
+ export * from './http-method.js';
2
+ export * from './http-protocol.js';
@@ -1,19 +1,2 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./http-method"), exports);
18
- __exportStar(require("./http-protocol"), exports);
19
- //# sourceMappingURL=index.js.map
1
+ export * from './http-method.js';
2
+ export * from './http-protocol.js';
@@ -1,4 +1,4 @@
1
- import type { Fnc } from "@leyyo/common";
1
+ import { Fnc } from "@leyyo/common";
2
2
  import type { EventEmitter } from "node:events";
3
3
  /**
4
4
  * Abstract class for Request and Response
@@ -1,97 +1,81 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.HttpEvent = void 0;
1
+ import { setFqn } from "@leyyo/common";
2
+ import { FQN } from "../internal.js";
4
3
  /**
5
4
  * Abstract class for Request and Response
6
5
  * */
7
- class HttpEvent {
6
+ export class HttpEvent {
7
+ _origin;
8
8
  constructor(_origin) {
9
9
  this._origin = _origin;
10
10
  }
11
11
  /** @inheritDoc */
12
12
  addListener(e, l) {
13
- var _a;
14
- (_a = this._origin) === null || _a === void 0 ? void 0 : _a.addListener(e, l);
13
+ this._origin?.addListener(e, l);
15
14
  return this;
16
15
  }
17
16
  /** @inheritDoc */
18
17
  emit(e, ...a) {
19
- var _a, _b;
20
- return (_b = (_a = this._origin) === null || _a === void 0 ? void 0 : _a.emit(e, a)) !== null && _b !== void 0 ? _b : false;
18
+ return this._origin?.emit(e, a) ?? false;
21
19
  }
22
20
  /** @inheritDoc */
23
21
  eventNames() {
24
- var _a, _b;
25
- return (_b = (_a = this._origin) === null || _a === void 0 ? void 0 : _a.eventNames()) !== null && _b !== void 0 ? _b : [];
22
+ return this._origin?.eventNames() ?? [];
26
23
  }
27
24
  /** @inheritDoc */
28
25
  getMaxListeners() {
29
- var _a, _b;
30
- return (_b = (_a = this._origin) === null || _a === void 0 ? void 0 : _a.getMaxListeners()) !== null && _b !== void 0 ? _b : 10;
26
+ return this._origin?.getMaxListeners() ?? 10;
31
27
  }
32
28
  /** @inheritDoc */
33
29
  listenerCount(e) {
34
- var _a, _b;
35
- return (_b = (_a = this._origin) === null || _a === void 0 ? void 0 : _a.listenerCount(e)) !== null && _b !== void 0 ? _b : 0;
30
+ return this._origin?.listenerCount(e) ?? 0;
36
31
  }
37
32
  /** @inheritDoc */
38
33
  listeners(e) {
39
- var _a, _b;
40
- return (_b = (_a = this._origin) === null || _a === void 0 ? void 0 : _a.listeners(e)) !== null && _b !== void 0 ? _b : [];
34
+ return this._origin?.listeners(e) ?? [];
41
35
  }
42
36
  /** @inheritDoc */
43
37
  off(e, l) {
44
- var _a;
45
- (_a = this._origin) === null || _a === void 0 ? void 0 : _a.off(e, l);
38
+ this._origin?.off(e, l);
46
39
  return this;
47
40
  }
48
41
  /** @inheritDoc */
49
42
  on(e, l) {
50
- var _a;
51
- (_a = this._origin) === null || _a === void 0 ? void 0 : _a.on(e, l);
43
+ this._origin?.on(e, l);
52
44
  return this;
53
45
  }
54
46
  /** @inheritDoc */
55
47
  once(e, l) {
56
- var _a;
57
- (_a = this._origin) === null || _a === void 0 ? void 0 : _a.once(e, l);
48
+ this._origin?.once(e, l);
58
49
  return this;
59
50
  }
60
51
  /** @inheritDoc */
61
52
  prependListener(e, l) {
62
- var _a;
63
- (_a = this._origin) === null || _a === void 0 ? void 0 : _a.prependListener(e, l);
53
+ this._origin?.prependListener(e, l);
64
54
  return this;
65
55
  }
66
56
  /** @inheritDoc */
67
57
  prependOnceListener(e, l) {
68
- var _a;
69
- (_a = this._origin) === null || _a === void 0 ? void 0 : _a.prependOnceListener(e, l);
58
+ this._origin?.prependOnceListener(e, l);
70
59
  return this;
71
60
  }
72
61
  /** @inheritDoc */
73
62
  rawListeners(e) {
74
- var _a, _b;
75
- return (_b = (_a = this._origin) === null || _a === void 0 ? void 0 : _a.rawListeners(e)) !== null && _b !== void 0 ? _b : [];
63
+ return this._origin?.rawListeners(e) ?? [];
76
64
  }
77
65
  /** @inheritDoc */
78
66
  removeAllListeners(e) {
79
- var _a;
80
- (_a = this._origin) === null || _a === void 0 ? void 0 : _a.removeAllListeners(e);
67
+ this._origin?.removeAllListeners(e);
81
68
  return this;
82
69
  }
83
70
  /** @inheritDoc */
84
71
  removeListener(e, l) {
85
- var _a;
86
- (_a = this._origin) === null || _a === void 0 ? void 0 : _a.removeListener(e, l);
72
+ this._origin?.removeListener(e, l);
87
73
  return this;
88
74
  }
89
75
  /** @inheritDoc */
90
76
  setMaxListeners(m) {
91
- var _a;
92
- (_a = this._origin) === null || _a === void 0 ? void 0 : _a.setMaxListeners(m);
77
+ this._origin?.setMaxListeners(m);
93
78
  return this;
94
79
  }
95
80
  }
96
- exports.HttpEvent = HttpEvent;
97
- //# sourceMappingURL=http-event.js.map
81
+ setFqn(HttpEvent, FQN);
@@ -1,2 +1,2 @@
1
- export * from './index.types';
2
- export * from './http-event';
1
+ export * from './index.types.js';
2
+ export * from './http-event.js';
@@ -1,19 +1,2 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./index.types"), exports);
18
- __exportStar(require("./http-event"), exports);
19
- //# sourceMappingURL=index.js.map
1
+ export * from './index.types.js';
2
+ export * from './http-event.js';
@@ -1,3 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=index.types.js.map
1
+ export {};
@@ -1,4 +1,4 @@
1
- import { HttpMockLike } from "./index.types";
1
+ import { HttpMockLike } from "./index.types.js";
2
2
  /**
3
3
  * Http mock instance
4
4
  *
package/dist/http-mock.js CHANGED
@@ -1,41 +1,43 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.httpMock = void 0;
4
- const response_1 = require("./response");
5
- const request_1 = require("./request");
6
- const application_1 = require("./application");
1
+ import { MockResponse } from "./response/index.js";
2
+ import { MockRequest } from "./request/index.js";
3
+ import { MockApplication } from "./application/index.js";
4
+ import { setFqn } from "@leyyo/common";
5
+ import { FQN } from "./internal.js";
7
6
  /**
8
7
  * Http mock class
9
8
  * */
10
9
  class HttpMock {
10
+ /**
11
+ * Is it initialized?
12
+ * */
13
+ _initialized;
11
14
  /** @inheritDoc */
12
15
  init(req) {
13
16
  if (this._initialized) {
14
17
  return;
15
18
  }
16
19
  this._initialized = true;
17
- request_1.MockRequest.setFirstOrigin(req);
18
- response_1.MockResponse.setFirstOrigin(req.res);
19
- application_1.MockApplication.setFirstOrigin(req.app);
20
+ MockRequest.setFirstOrigin(req);
21
+ MockResponse.setFirstOrigin(req.res);
22
+ MockApplication.setFirstOrigin(req.app);
20
23
  }
21
24
  /** @inheritDoc */
22
25
  fork() {
23
- return [request_1.MockRequest.firstOrigin, response_1.MockResponse.firstOrigin, application_1.MockApplication.firstOrigin];
26
+ return [MockRequest.firstOrigin, MockResponse.firstOrigin, MockApplication.firstOrigin];
24
27
  }
25
28
  /** @inheritDoc */
26
29
  forBulk(req, service, resolver, custom) {
27
- var _a;
28
- const newReq = new request_1.MockRequest(service, req, custom);
29
- const newRes = new response_1.MockResponse(resolver, req.res);
30
- const newApp = (_a = application_1.MockApplication.firstOrigin) !== null && _a !== void 0 ? _a : new application_1.MockApplication(req.app);
30
+ const newReq = new MockRequest(service, req, custom);
31
+ const newRes = new MockResponse(resolver, req.res);
32
+ const newApp = MockApplication.firstOrigin ?? new MockApplication(req.app);
31
33
  return [newReq, newRes, newApp];
32
34
  }
33
35
  }
36
+ setFqn(HttpMock, FQN);
34
37
  // noinspection JSUnusedGlobalSymbols
35
38
  /**
36
39
  * Http mock instance
37
40
  *
38
41
  * @type {HttpMockLike}
39
42
  * */
40
- exports.httpMock = new HttpMock();
41
- //# sourceMappingURL=http-mock.js.map
43
+ export const httpMock = new HttpMock();
package/dist/index.d.ts CHANGED
@@ -1,7 +1,8 @@
1
- export * from './enum';
2
- export * from './application';
3
- export * from './request';
4
- export * from './response';
5
- export * from './http-mock';
6
- export * from './index.types';
7
- export * from './loader';
1
+ export * from './enum/index.js';
2
+ export * from './application/index.js';
3
+ export * from './request/index.js';
4
+ export * from './response/index.js';
5
+ export * from './http-mock.js';
6
+ export * from './index.types.js';
7
+ export * from './index.loader.js';
8
+ export * from './index.foretell.js';
@@ -0,0 +1 @@
1
+ export declare const foretell_leyyoHttpMock: (() => void)[];
@@ -0,0 +1,19 @@
1
+ // noinspection JSUnusedGlobalSymbols
2
+ import { foretell_leyyoCommon, literalPool } from "@leyyo/common";
3
+ import { FQN } from "./internal.js";
4
+ export const foretell_leyyoHttpMock = [
5
+ // dependencies
6
+ ...foretell_leyyoCommon,
7
+ () => literalPool.register({
8
+ name: 'HttpMethod',
9
+ fqn: FQN,
10
+ i18n: true,
11
+ lazyTarget: import('./enum/http-method.js').then(m => m.HttpMethodItems)
12
+ }),
13
+ () => literalPool.register({
14
+ name: 'HttpProtocol',
15
+ fqn: FQN,
16
+ i18n: true,
17
+ lazyTarget: import('./enum/http-protocol.js').then(m => m.HttpProtocolItems)
18
+ })
19
+ ];
package/dist/index.js CHANGED
@@ -1,24 +1,8 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./enum"), exports);
18
- __exportStar(require("./application"), exports);
19
- __exportStar(require("./request"), exports);
20
- __exportStar(require("./response"), exports);
21
- __exportStar(require("./http-mock"), exports);
22
- __exportStar(require("./index.types"), exports);
23
- __exportStar(require("./loader"), exports);
24
- //# sourceMappingURL=index.js.map
1
+ export * from './enum/index.js';
2
+ export * from './application/index.js';
3
+ export * from './request/index.js';
4
+ export * from './response/index.js';
5
+ export * from './http-mock.js';
6
+ export * from './index.types.js';
7
+ export * from './index.loader.js';
8
+ export * from './index.foretell.js';
@@ -1,2 +1 @@
1
1
  export declare const loader_leyyoHttpMock: import("@leyyo/common").LoaderLike;
2
- export declare const foretell_leyyoHttpMock: (() => void)[];
@@ -0,0 +1,10 @@
1
+ // noinspection JSUnusedGlobalSymbols
2
+ import { defineLoader, loader_leyyoCommon } from "@leyyo/common";
3
+ import { FQN } from "./internal.js";
4
+ export const loader_leyyoHttpMock = defineLoader(FQN,
5
+ // dependencies
6
+ ...loader_leyyoCommon,
7
+ // enums
8
+ () => import('./enum/http-method.js').then(m => m.HttpMethodItems), () => import('./enum/http-protocol.js').then(m => m.HttpProtocolItems),
9
+ // classes
10
+ () => import('./application/mock-application.js').then(m => m.MockApplication), () => import('./request/mock.request.js').then(m => m.MockRequest), () => import('./response/mock-response.js').then(m => m.MockResponse), () => import('./http-mock.js').then(m => m.httpMock));
@@ -1,6 +1,6 @@
1
1
  import { Application, Request, Response } from "express";
2
- import { MockResponseResolve, ResponseData } from "./response";
3
- import { MockServiceRequest } from "./request";
2
+ import { MockResponseResolve, ResponseData } from "./response/index.js";
3
+ import { MockServiceRequest } from "./request/index.js";
4
4
  import { Dict } from "@leyyo/common";
5
5
  export type HttpMockTuple = [Request, Response, Application];
6
6
  /**
@@ -1,3 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=index.types.js.map
1
+ export {};
@@ -1 +1 @@
1
- export declare const FQN = "leyyo.http-mock";
1
+ export declare const NME: string, FQN: string, VER: string, CNF: import("@leyyo/common").LeyyoConfig;
package/dist/internal.js CHANGED
@@ -1,6 +1,2 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.FQN = void 0;
4
- // noinspection JSUnusedGlobalSymbols
5
- exports.FQN = 'leyyo.http-mock';
6
- //# sourceMappingURL=internal.js.map
1
+ import { sysAll } from '@leyyo/common';
2
+ export const { pck: { name: NME, fqn: FQN, version: VER }, config: CNF } = sysAll(import.meta.url);
@@ -1,2 +1,2 @@
1
- export * from './index.types';
2
- export * from './mock.request';
1
+ export * from './index.types.js';
2
+ export * from './mock.request.js';
@@ -1,19 +1,2 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./index.types"), exports);
18
- __exportStar(require("./mock.request"), exports);
19
- //# sourceMappingURL=index.js.map
1
+ export * from './index.types.js';
2
+ export * from './mock.request.js';
@@ -1,8 +1,8 @@
1
1
  import { Request } from "express";
2
- import { ResponseData } from "../response";
2
+ import { ResponseData } from "../response/index.js";
3
3
  import { Arr } from "@leyyo/common";
4
- import { HttpCookies, HttpData, HttpHeaders, HttpParams, HttpQuery } from "../event";
5
- import { HttpMethod } from "../enum";
4
+ import { HttpCookies, HttpData, HttpHeaders, HttpParams, HttpQuery } from "../event/index.js";
5
+ import { HttpMethod } from "../enum/index.js";
6
6
  export interface RequestLocal {
7
7
  }
8
8
  export type RequestBody = Arr | HttpData | string | unknown;
@@ -1,3 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=index.types.js.map
1
+ export {};
@@ -2,11 +2,11 @@ import { Application, MediaType, NextFunction, Request, Response } from "express
2
2
  import { Socket } from "net";
3
3
  import { IncomingHttpHeaders } from "http";
4
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, HttpParams, HttpQuery } from "../event";
5
+ import { MockRequestLike, MockServiceRequest, PipeOption, RequestBody, RequestErrorCallback, RequestLocal } from "./index.types.js";
6
+ import { _StreamAbort, _StreamBool, _StreamCompose, _StreamGeneric, _StreamIterator, _StreamReduce, _StreamVoid, HttpCookies, HttpEvent, HttpParams, HttpQuery } from "../event/index.js";
7
7
  import { Dict, Fnc, HttpStatus, OneOrMore } from "@leyyo/common";
8
8
  import { ArrayOptions, Readable } from "node:stream";
9
- import { HttpMethod, HttpProtocol } from "../enum";
9
+ import { HttpMethod, HttpProtocol } from "../enum/index.js";
10
10
  export declare class MockRequest<B extends RequestBody = RequestBody, L extends RequestLocal = RequestLocal> extends HttpEvent<Request> implements MockRequestLike<B, L> {
11
11
  /** @inheritDoc */
12
12
  readonly isFake: boolean;