@n1k1t/mock-server 0.1.6 → 0.1.9
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 +229 -35
- package/lib/package.json +4 -1
- package/lib/src/client/helpers/expectations.d.ts +18 -18
- package/lib/src/client/helpers/expectations.d.ts.map +1 -1
- package/lib/src/client/helpers/expectations.js.map +1 -1
- package/lib/src/client/methods/expectations.create.method.d.ts +1 -1
- package/lib/src/client/methods/expectations.create.method.js +2 -2
- package/lib/src/client/methods/expectations.create.method.js.map +1 -1
- package/lib/src/client/methods/expectations.delete.method.js +2 -2
- package/lib/src/client/methods/expectations.delete.method.js.map +1 -1
- package/lib/src/client/methods/expectations.update.method.d.ts +1 -1
- package/lib/src/client/methods/expectations.update.method.js +4 -4
- package/lib/src/client/methods/expectations.update.method.js.map +1 -1
- package/lib/src/client/models/client.d.ts +13 -13
- package/lib/src/client/models/client.d.ts.map +1 -1
- package/lib/src/client/models/client.js.map +1 -1
- package/lib/src/client/utils.d.ts.map +1 -1
- package/lib/src/client/utils.js +3 -0
- package/lib/src/client/utils.js.map +1 -1
- package/lib/src/config/model.d.ts +4 -1
- package/lib/src/config/model.d.ts.map +1 -1
- package/lib/src/config/model.js +5 -1
- package/lib/src/config/model.js.map +1 -1
- package/lib/src/expectations/__utils__/index.d.ts +1 -2
- package/lib/src/expectations/__utils__/index.d.ts.map +1 -1
- package/lib/src/expectations/__utils__/index.js +8 -0
- package/lib/src/expectations/__utils__/index.js.map +1 -1
- package/lib/src/expectations/models/expectation.d.ts +15 -9
- package/lib/src/expectations/models/expectation.d.ts.map +1 -1
- package/lib/src/expectations/models/expectation.js +1 -1
- package/lib/src/expectations/models/expectation.js.map +1 -1
- package/lib/src/expectations/models/operator.d.ts +3 -3
- package/lib/src/expectations/models/operator.d.ts.map +1 -1
- package/lib/src/expectations/models/storage.d.ts +1 -2
- package/lib/src/expectations/models/storage.d.ts.map +1 -1
- package/lib/src/expectations/models/storage.js.map +1 -1
- package/lib/src/expectations/operators/and.operator.d.ts +1 -2
- package/lib/src/expectations/operators/and.operator.d.ts.map +1 -1
- package/lib/src/expectations/operators/and.operator.js.map +1 -1
- package/lib/src/expectations/operators/exec.operator.d.ts +2 -2
- package/lib/src/expectations/operators/exec.operator.d.ts.map +1 -1
- package/lib/src/expectations/operators/exec.operator.js.map +1 -1
- package/lib/src/expectations/operators/exec.operator.spec.js.map +1 -1
- package/lib/src/expectations/operators/has.operator.d.ts +1 -1
- package/lib/src/expectations/operators/has.operator.d.ts.map +1 -1
- package/lib/src/expectations/operators/has.operator.spec.js.map +1 -1
- package/lib/src/expectations/operators/if.operator.d.ts +1 -2
- package/lib/src/expectations/operators/if.operator.d.ts.map +1 -1
- package/lib/src/expectations/operators/if.operator.js.map +1 -1
- package/lib/src/expectations/operators/merge.operator.d.ts +11 -4
- package/lib/src/expectations/operators/merge.operator.d.ts.map +1 -1
- package/lib/src/expectations/operators/merge.operator.js +21 -4
- package/lib/src/expectations/operators/merge.operator.js.map +1 -1
- package/lib/src/expectations/operators/merge.operator.spec.js.map +1 -1
- package/lib/src/expectations/operators/not.operator.d.ts +1 -2
- package/lib/src/expectations/operators/not.operator.d.ts.map +1 -1
- package/lib/src/expectations/operators/not.operator.js.map +1 -1
- package/lib/src/expectations/operators/or.operator.d.ts +1 -2
- package/lib/src/expectations/operators/or.operator.d.ts.map +1 -1
- package/lib/src/expectations/operators/or.operator.js.map +1 -1
- package/lib/src/expectations/operators/remove.operator.d.ts +1 -2
- package/lib/src/expectations/operators/remove.operator.d.ts.map +1 -1
- package/lib/src/expectations/operators/remove.operator.js.map +1 -1
- package/lib/src/expectations/operators/remove.operator.spec.js.map +1 -1
- package/lib/src/expectations/operators/root.operator.d.ts +1 -2
- package/lib/src/expectations/operators/root.operator.d.ts.map +1 -1
- package/lib/src/expectations/operators/root.operator.js.map +1 -1
- package/lib/src/expectations/operators/set.operator.d.ts +2 -2
- package/lib/src/expectations/operators/set.operator.d.ts.map +1 -1
- package/lib/src/expectations/operators/set.operator.js.map +1 -1
- package/lib/src/expectations/operators/switch.operator.d.ts +2 -2
- package/lib/src/expectations/operators/switch.operator.d.ts.map +1 -1
- package/lib/src/expectations/types.d.ts +28 -14
- package/lib/src/expectations/types.d.ts.map +1 -1
- package/lib/src/expectations/types.js +2 -0
- package/lib/src/expectations/types.js.map +1 -1
- package/lib/src/expectations/utils.d.ts +3 -4
- package/lib/src/expectations/utils.d.ts.map +1 -1
- package/lib/src/expectations/utils.js +12 -0
- package/lib/src/expectations/utils.js.map +1 -1
- package/lib/src/server/endpoints/config.get.endpoint.d.ts +3 -0
- package/lib/src/server/endpoints/config.get.endpoint.d.ts.map +1 -1
- package/lib/src/server/endpoints/expectations.create.endpoint.d.ts +2 -2
- package/lib/src/server/endpoints/expectations.get-list.endpoint.d.ts +2 -2
- package/lib/src/server/endpoints/expectations.get-list.endpoint.js +1 -1
- package/lib/src/server/endpoints/expectations.get-list.endpoint.js.map +1 -1
- package/lib/src/server/endpoints/expectations.update.endpoint.d.ts +2 -2
- package/lib/src/server/endpoints/history.get-list.endpoint.d.ts +6 -3
- package/lib/src/server/endpoints/history.get-list.endpoint.d.ts.map +1 -1
- package/lib/src/server/endpoints/history.get-list.endpoint.js +1 -1
- package/lib/src/server/endpoints/history.get-list.endpoint.js.map +1 -1
- package/lib/src/server/history/index.d.ts +0 -1
- package/lib/src/server/history/index.d.ts.map +1 -1
- package/lib/src/server/history/index.js +0 -1
- package/lib/src/server/history/index.js.map +1 -1
- package/lib/src/server/history/model.d.ts +12 -12
- package/lib/src/server/history/model.d.ts.map +1 -1
- package/lib/src/server/history/model.js +8 -23
- package/lib/src/server/history/model.js.map +1 -1
- package/lib/src/server/history/storage.d.ts +1 -1
- package/lib/src/server/history/storage.d.ts.map +1 -1
- package/lib/src/server/history/storage.js.map +1 -1
- package/lib/src/server/index.d.ts +1 -0
- package/lib/src/server/index.d.ts.map +1 -1
- package/lib/src/server/index.js +10 -1
- package/lib/src/server/index.js.map +1 -1
- package/lib/src/server/middlewares/delay.middleware.d.ts +7 -13
- package/lib/src/server/middlewares/delay.middleware.d.ts.map +1 -1
- package/lib/src/server/middlewares/delay.middleware.js +4 -4
- package/lib/src/server/middlewares/delay.middleware.js.map +1 -1
- package/lib/src/server/middlewares/destroy.midleware.d.ts +7 -13
- package/lib/src/server/middlewares/destroy.midleware.d.ts.map +1 -1
- package/lib/src/server/middlewares/destroy.midleware.js +7 -8
- package/lib/src/server/middlewares/destroy.midleware.js.map +1 -1
- package/lib/src/server/middlewares/forward.middleware.d.ts +7 -13
- package/lib/src/server/middlewares/forward.middleware.d.ts.map +1 -1
- package/lib/src/server/middlewares/forward.middleware.js +81 -27
- package/lib/src/server/middlewares/forward.middleware.js.map +1 -1
- package/lib/src/server/middlewares/history.middleware.d.ts +4 -10
- package/lib/src/server/middlewares/history.middleware.d.ts.map +1 -1
- package/lib/src/server/middlewares/history.middleware.js +7 -3
- package/lib/src/server/middlewares/history.middleware.js.map +1 -1
- package/lib/src/server/middlewares/internal.middleware.d.ts +4 -10
- package/lib/src/server/middlewares/internal.middleware.d.ts.map +1 -1
- package/lib/src/server/middlewares/manipulate-expectation.middleware.d.ts +4 -10
- package/lib/src/server/middlewares/manipulate-expectation.middleware.d.ts.map +1 -1
- package/lib/src/server/middlewares/manipulate-expectation.middleware.js +1 -7
- package/lib/src/server/middlewares/manipulate-expectation.middleware.js.map +1 -1
- package/lib/src/server/middlewares/match-expectation.middleware.d.ts +4 -10
- package/lib/src/server/middlewares/match-expectation.middleware.d.ts.map +1 -1
- package/lib/src/server/middlewares/match-expectation.middleware.js +7 -8
- package/lib/src/server/middlewares/match-expectation.middleware.js.map +1 -1
- package/lib/src/server/middlewares/public.middleware.d.ts +4 -10
- package/lib/src/server/middlewares/public.middleware.d.ts.map +1 -1
- package/lib/src/server/middlewares/reply.middleware.d.ts +9 -15
- package/lib/src/server/middlewares/reply.middleware.d.ts.map +1 -1
- package/lib/src/server/middlewares/reply.middleware.js +23 -28
- package/lib/src/server/middlewares/reply.middleware.js.map +1 -1
- package/lib/src/server/models/containers/index.d.ts +3 -0
- package/lib/src/server/models/containers/index.d.ts.map +1 -0
- package/lib/src/server/models/containers/index.js +19 -0
- package/lib/src/server/models/containers/index.js.map +1 -0
- package/lib/src/server/models/containers/model.d.ts +44 -0
- package/lib/src/server/models/containers/model.d.ts.map +1 -0
- package/lib/src/server/models/containers/model.js +43 -0
- package/lib/src/server/models/containers/model.js.map +1 -0
- package/lib/src/server/models/containers/storage.d.ts +19 -0
- package/lib/src/server/models/containers/storage.d.ts.map +1 -0
- package/lib/src/server/models/containers/storage.js +42 -0
- package/lib/src/server/models/containers/storage.js.map +1 -0
- package/lib/src/server/models/containers/utils.d.ts +2 -0
- package/lib/src/server/models/containers/utils.d.ts.map +1 -0
- package/lib/src/server/models/containers/utils.js +7 -0
- package/lib/src/server/models/containers/utils.js.map +1 -0
- package/lib/src/server/models/index.d.ts +1 -0
- package/lib/src/server/models/index.d.ts.map +1 -1
- package/lib/src/server/models/index.js +1 -0
- package/lib/src/server/models/index.js.map +1 -1
- package/lib/src/server/models/middleware.d.ts +2 -5
- package/lib/src/server/models/middleware.d.ts.map +1 -1
- package/lib/src/server/models/plugins.d.ts +7 -2
- package/lib/src/server/models/plugins.d.ts.map +1 -1
- package/lib/src/server/models/plugins.js.map +1 -1
- package/lib/src/server/models/request-context/http.d.ts +20 -15
- package/lib/src/server/models/request-context/http.d.ts.map +1 -1
- package/lib/src/server/models/request-context/http.js +25 -31
- package/lib/src/server/models/request-context/http.js.map +1 -1
- package/lib/src/server/models/request-context/index.d.ts +1 -0
- package/lib/src/server/models/request-context/index.d.ts.map +1 -1
- package/lib/src/server/models/request-context/index.js +1 -0
- package/lib/src/server/models/request-context/index.js.map +1 -1
- package/lib/src/server/models/request-context/snapshot.d.ts +28 -0
- package/lib/src/server/models/request-context/snapshot.d.ts.map +1 -0
- package/lib/src/server/models/request-context/snapshot.js +49 -0
- package/lib/src/server/models/request-context/snapshot.js.map +1 -0
- package/lib/src/server/models/request-context/types.d.ts +12 -0
- package/lib/src/server/models/request-context/types.d.ts.map +1 -1
- package/lib/src/server/models/request-context/utils.d.ts +1 -0
- package/lib/src/server/models/request-context/utils.d.ts.map +1 -1
- package/lib/src/server/models/request-context/utils.js +1 -1
- package/lib/src/server/models/request-context/utils.js.map +1 -1
- package/lib/src/server/models/server-context.d.ts +7 -2
- package/lib/src/server/models/server-context.d.ts.map +1 -1
- package/lib/src/server/models/server-context.js +17 -3
- package/lib/src/server/models/server-context.js.map +1 -1
- package/lib/src/server/ws-exchange/types.d.ts +2 -2
- package/lib/src/server/ws-exchange/types.d.ts.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -1
- package/public/scripts/main.js +18 -17
- package/public/styles/main.css +4 -0
- package/lib/src/server/history/types.d.ts +0 -14
- package/lib/src/server/history/types.d.ts.map +0 -1
- package/lib/src/server/history/types.js +0 -3
- package/lib/src/server/history/types.js.map +0 -1
|
@@ -102,6 +102,18 @@ const extractContextByLocation = (location, context) => {
|
|
|
102
102
|
parent: context,
|
|
103
103
|
value: context.state,
|
|
104
104
|
};
|
|
105
|
+
case 'options': return {
|
|
106
|
+
key: 'options',
|
|
107
|
+
type: 'object',
|
|
108
|
+
parent: context,
|
|
109
|
+
value: context.options,
|
|
110
|
+
};
|
|
111
|
+
case 'container': return {
|
|
112
|
+
key: 'container',
|
|
113
|
+
type: 'object',
|
|
114
|
+
parent: context,
|
|
115
|
+
value: context.container,
|
|
116
|
+
};
|
|
105
117
|
default: return null;
|
|
106
118
|
}
|
|
107
119
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/expectations/utils.ts"],"names":[],"mappings":";;;;;;AAAA,oDAAuB;
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/expectations/utils.ts"],"names":[],"mappings":";;;;;;AAAA,oDAAuB;AAEvB,mCAMiB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BAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,gCAAwB,CAAC,QAAQ,CAA2B,GAAG,CAAC,EAAE,CAAC;YACjG,IAAA,4CAAoC,EAAI,MAAM,CAAC,GAAG,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;QACtE,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC,CAAA;AAdY,QAAA,oCAAoC,wCAchD"}
|
|
@@ -15,6 +15,7 @@ declare const _default: Endpoint<{
|
|
|
15
15
|
logger: {
|
|
16
16
|
level: import("../..").TLoggerLevel;
|
|
17
17
|
};
|
|
18
|
+
redis: import("ioredis").RedisOptions;
|
|
18
19
|
}, {}> & {
|
|
19
20
|
http: {
|
|
20
21
|
readonly method: "GET";
|
|
@@ -41,6 +42,7 @@ declare const _default: Endpoint<{
|
|
|
41
42
|
logger: {
|
|
42
43
|
level: import("../..").TLoggerLevel;
|
|
43
44
|
};
|
|
45
|
+
redis: import("ioredis").RedisOptions;
|
|
44
46
|
}> | import("../models").WsRequestContext<{
|
|
45
47
|
statics: {
|
|
46
48
|
public: {
|
|
@@ -57,6 +59,7 @@ declare const _default: Endpoint<{
|
|
|
57
59
|
logger: {
|
|
58
60
|
level: import("../..").TLoggerLevel;
|
|
59
61
|
};
|
|
62
|
+
redis: import("ioredis").RedisOptions;
|
|
60
63
|
}>) & {
|
|
61
64
|
incoming: import("../..").OmitPartial<{
|
|
62
65
|
body: void | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.get.endpoint.d.ts","sourceRoot":"","sources":["../../../../src/server/endpoints/config.get.endpoint.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC
|
|
1
|
+
{"version":3,"file":"config.get.endpoint.d.ts","sourceRoot":"","sources":["../../../../src/server/endpoints/config.get.endpoint.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAErC,wBAIgE"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Expectation, TBuildExpectationConfiguration } from '../../expectations';
|
|
2
2
|
import { Endpoint } from '../models';
|
|
3
|
-
declare const _default: Endpoint<Pick<Expectation<{}
|
|
3
|
+
declare const _default: Endpoint<Pick<Expectation<{}, import("../../expectations").IExpectationOperatorContext<{}>>, "name" | "type" | "schema" | "isEnabled" | "id" | "meta">, {
|
|
4
4
|
body: TBuildExpectationConfiguration<any>;
|
|
5
5
|
}> & {
|
|
6
6
|
http: {
|
|
@@ -8,7 +8,7 @@ declare const _default: Endpoint<Pick<Expectation<{}>, "name" | "type" | "schema
|
|
|
8
8
|
readonly path: "/_mock/expectations";
|
|
9
9
|
};
|
|
10
10
|
} & {
|
|
11
|
-
handler: ({ reply, incoming, server }: (import("../models").HttpRequestContext<Pick<Expectation<{}
|
|
11
|
+
handler: ({ reply, incoming, server }: (import("../models").HttpRequestContext<Pick<Expectation<{}, import("../../expectations").IExpectationOperatorContext<{}>>, "name" | "type" | "schema" | "isEnabled" | "id" | "meta">> | import("../models").WsRequestContext<Pick<Expectation<{}, import("../../expectations").IExpectationOperatorContext<{}>>, "name" | "type" | "schema" | "isEnabled" | "id" | "meta">>) & {
|
|
12
12
|
incoming: import("../..").OmitPartial<{
|
|
13
13
|
body: TBuildExpectationConfiguration<any>;
|
|
14
14
|
query: void | undefined;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Expectation } from '../../expectations';
|
|
2
2
|
import { Endpoint } from '../models';
|
|
3
|
-
declare const _default: Endpoint<Pick<Expectation<{}
|
|
3
|
+
declare const _default: Endpoint<Pick<Expectation<{}, import("../../expectations").IExpectationOperatorContext<{}>>, "name" | "type" | "schema" | "isEnabled" | "id" | "meta">[], {}> & {
|
|
4
4
|
http: {
|
|
5
5
|
readonly method: "GET";
|
|
6
6
|
readonly path: "/_mock/expectations";
|
|
@@ -10,7 +10,7 @@ declare const _default: Endpoint<Pick<Expectation<{}>, "name" | "type" | "schema
|
|
|
10
10
|
readonly path: "expectations:get";
|
|
11
11
|
};
|
|
12
12
|
} & {
|
|
13
|
-
handler: ({ reply, server }: (import("../models").HttpRequestContext<Pick<Expectation<{}
|
|
13
|
+
handler: ({ reply, server }: (import("../models").HttpRequestContext<Pick<Expectation<{}, import("../../expectations").IExpectationOperatorContext<{}>>, "name" | "type" | "schema" | "isEnabled" | "id" | "meta">[]> | import("../models").WsRequestContext<Pick<Expectation<{}, import("../../expectations").IExpectationOperatorContext<{}>>, "name" | "type" | "schema" | "isEnabled" | "id" | "meta">[]>) & {
|
|
14
14
|
incoming: import("../..").OmitPartial<{
|
|
15
15
|
body: void | undefined;
|
|
16
16
|
query: void | undefined;
|
|
@@ -5,5 +5,5 @@ exports.default = models_1.Endpoint
|
|
|
5
5
|
.build()
|
|
6
6
|
.bindToHttp({ method: 'GET', path: '/_mock/expectations' })
|
|
7
7
|
.bindToWs({ path: 'expectations:get' })
|
|
8
|
-
.assignHandler(({ reply, server }) => reply.ok([...server.
|
|
8
|
+
.assignHandler(({ reply, server }) => reply.ok([...server.storages.expectations.values()].map((expectation) => expectation.toPlain())));
|
|
9
9
|
//# sourceMappingURL=expectations.get-list.endpoint.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expectations.get-list.endpoint.js","sourceRoot":"","sources":["../../../../src/server/endpoints/expectations.get-list.endpoint.ts"],"names":[],"mappings":";;AACA,sCAAqC;AAErC,kBAAe,iBAAQ;KACpB,KAAK,EAA2B;KAChC,UAAU,CAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,qBAAqB,EAAE,CAAC;KACjE,QAAQ,CAAQ,EAAE,IAAI,EAAE,kBAAkB,EAAE,CAAC;KAC7C,aAAa,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,CACnC,KAAK,CAAC,EAAE,CACN,CAAC,GAAG,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"expectations.get-list.endpoint.js","sourceRoot":"","sources":["../../../../src/server/endpoints/expectations.get-list.endpoint.ts"],"names":[],"mappings":";;AACA,sCAAqC;AAErC,kBAAe,iBAAQ;KACpB,KAAK,EAA2B;KAChC,UAAU,CAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,qBAAqB,EAAE,CAAC;KACjE,QAAQ,CAAQ,EAAE,IAAI,EAAE,kBAAkB,EAAE,CAAC;KAC7C,aAAa,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,CACnC,KAAK,CAAC,EAAE,CACN,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC,YAAY,CAAC,MAAM,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,WAAW,CAAC,OAAO,EAAE,CAAC,CACvF,CACF,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Expectation, TBuildExpectationConfiguration } from '../../expectations';
|
|
2
2
|
import { Endpoint } from '../models';
|
|
3
|
-
declare const _default: Endpoint<Pick<Expectation<{}
|
|
3
|
+
declare const _default: Endpoint<Pick<Expectation<{}, import("../../expectations").IExpectationOperatorContext<{}>>, "name" | "type" | "schema" | "isEnabled" | "id" | "meta">, {
|
|
4
4
|
body: {
|
|
5
5
|
id: string;
|
|
6
6
|
set: Partial<Omit<TBuildExpectationConfiguration<any>, "type">>;
|
|
@@ -15,7 +15,7 @@ declare const _default: Endpoint<Pick<Expectation<{}>, "name" | "type" | "schema
|
|
|
15
15
|
readonly path: "expectations:update";
|
|
16
16
|
};
|
|
17
17
|
} & {
|
|
18
|
-
handler: ({ reply, incoming, server }: (import("../models").HttpRequestContext<Pick<Expectation<{}
|
|
18
|
+
handler: ({ reply, incoming, server }: (import("../models").HttpRequestContext<Pick<Expectation<{}, import("../../expectations").IExpectationOperatorContext<{}>>, "name" | "type" | "schema" | "isEnabled" | "id" | "meta">> | import("../models").WsRequestContext<Pick<Expectation<{}, import("../../expectations").IExpectationOperatorContext<{}>>, "name" | "type" | "schema" | "isEnabled" | "id" | "meta">>) & {
|
|
19
19
|
incoming: import("../..").OmitPartial<{
|
|
20
20
|
body: {
|
|
21
21
|
id: string;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { History } from '../history';
|
|
2
2
|
import { Endpoint } from '../models';
|
|
3
|
-
declare const _default: Endpoint<(Pick<History, "
|
|
3
|
+
declare const _default: Endpoint<(Pick<History, "status" | "id" | "meta"> & {
|
|
4
|
+
snapshot: import("../models").RequestContextSnapshot["TPlain"];
|
|
4
5
|
expectation?: import("../../expectations").Expectation<any>["TPlain"];
|
|
5
6
|
})[], {}> & {
|
|
6
7
|
http: {
|
|
@@ -12,9 +13,11 @@ declare const _default: Endpoint<(Pick<History, "request" | "id" | "meta" | "for
|
|
|
12
13
|
readonly path: "history:get";
|
|
13
14
|
};
|
|
14
15
|
} & {
|
|
15
|
-
handler: ({ reply, server }: (import("../models").HttpRequestContext<(Pick<History, "
|
|
16
|
+
handler: ({ reply, server }: (import("../models").HttpRequestContext<(Pick<History, "status" | "id" | "meta"> & {
|
|
17
|
+
snapshot: import("../models").RequestContextSnapshot["TPlain"];
|
|
16
18
|
expectation?: import("../../expectations").Expectation<any>["TPlain"];
|
|
17
|
-
})[]> | import("../models").WsRequestContext<(Pick<History, "
|
|
19
|
+
})[]> | import("../models").WsRequestContext<(Pick<History, "status" | "id" | "meta"> & {
|
|
20
|
+
snapshot: import("../models").RequestContextSnapshot["TPlain"];
|
|
18
21
|
expectation?: import("../../expectations").Expectation<any>["TPlain"];
|
|
19
22
|
})[]>) & {
|
|
20
23
|
incoming: import("../..").OmitPartial<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"history.get-list.endpoint.d.ts","sourceRoot":"","sources":["../../../../src/server/endpoints/history.get-list.endpoint.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC
|
|
1
|
+
{"version":3,"file":"history.get-list.endpoint.d.ts","sourceRoot":"","sources":["../../../../src/server/endpoints/history.get-list.endpoint.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;AAErC,wBAUI"}
|
|
@@ -5,7 +5,7 @@ exports.default = models_1.Endpoint
|
|
|
5
5
|
.build()
|
|
6
6
|
.bindToHttp({ method: 'GET', path: '/_mock/history' })
|
|
7
7
|
.bindToWs({ path: 'history:get' })
|
|
8
|
-
.assignHandler(({ reply, server }) => reply.ok([...server.
|
|
8
|
+
.assignHandler(({ reply, server }) => reply.ok([...server.storages.history.values()]
|
|
9
9
|
.sort((a, b) => b.meta.requestedAt - a.meta.requestedAt)
|
|
10
10
|
.map((history) => history.toPlain())));
|
|
11
11
|
//# sourceMappingURL=history.get-list.endpoint.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"history.get-list.endpoint.js","sourceRoot":"","sources":["../../../../src/server/endpoints/history.get-list.endpoint.ts"],"names":[],"mappings":";;AACA,sCAAqC;AAErC,kBAAe,iBAAQ;KACpB,KAAK,EAAuB;KAC5B,UAAU,CAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,gBAAgB,EAAE,CAAC;KAC5D,QAAQ,CAAQ,EAAE,IAAI,EAAE,aAAa,EAAE,CAAC;KACxC,aAAa,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,CACnC,KAAK,CAAC,EAAE,CACN,CAAC,GAAG,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"history.get-list.endpoint.js","sourceRoot":"","sources":["../../../../src/server/endpoints/history.get-list.endpoint.ts"],"names":[],"mappings":";;AACA,sCAAqC;AAErC,kBAAe,iBAAQ;KACpB,KAAK,EAAuB;KAC5B,UAAU,CAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,gBAAgB,EAAE,CAAC;KAC5D,QAAQ,CAAQ,EAAE,IAAI,EAAE,aAAa,EAAE,CAAC;KACxC,aAAa,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,CACnC,KAAK,CAAC,EAAE,CACN,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC;KAClC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,GAAG,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC;KACvD,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,CACvC,CACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/server/history/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/server/history/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC"}
|
|
@@ -14,7 +14,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./types"), exports);
|
|
18
17
|
__exportStar(require("./storage"), exports);
|
|
19
18
|
__exportStar(require("./model"), exports);
|
|
20
19
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/server/history/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/server/history/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAA0B;AAC1B,0CAAwB"}
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { HttpRequestContext } from '../models';
|
|
1
|
+
import type { RequestContextSnapshot } from '../models';
|
|
3
2
|
import type { Expectation } from '../../expectations';
|
|
4
3
|
export declare class History {
|
|
5
|
-
|
|
6
|
-
TPlain: Pick<History, 'id' | '
|
|
4
|
+
snapshot: RequestContextSnapshot;
|
|
5
|
+
TPlain: Pick<History, 'id' | 'status' | 'meta'> & {
|
|
6
|
+
snapshot: RequestContextSnapshot['TPlain'];
|
|
7
7
|
expectation?: Expectation<any>['TPlain'];
|
|
8
8
|
};
|
|
9
9
|
id: string;
|
|
10
|
+
status: "pending" | "finished";
|
|
10
11
|
expectation?: Expectation<any>;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
meta: {
|
|
13
|
+
requestedAt: number;
|
|
14
|
+
updatedAt: number;
|
|
15
|
+
};
|
|
16
|
+
constructor(snapshot: RequestContextSnapshot);
|
|
17
|
+
switchStatus(status: History['status']): this;
|
|
15
18
|
assignExpectation(expectation: NonNullable<History['expectation']>): this;
|
|
16
|
-
assignError(error: NonNullable<IHistoryRequest['error']>): this;
|
|
17
|
-
assignOutgoing(outgoing: NonNullable<HttpRequestContext['outgoing']>): this;
|
|
18
|
-
extendForwarded(forwarded: Partial<NonNullable<History['forwaded']>>): this;
|
|
19
19
|
toPlain(): History['TPlain'];
|
|
20
|
-
static build(request: History['
|
|
20
|
+
static build(request: History['snapshot']): History;
|
|
21
21
|
}
|
|
22
22
|
//# sourceMappingURL=model.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../../../src/server/history/model.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../../../src/server/history/model.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAC;AACxD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAItD,qBAAa,OAAO;IAgBC,QAAQ,EAAE,sBAAsB;IAf5C,MAAM,EAAG,IAAI,CAAC,OAAO,EAAE,IAAI,GAAG,QAAQ,GAAG,MAAM,CAAC,GAAG;QACxD,QAAQ,EAAE,sBAAsB,CAAC,QAAQ,CAAC,CAAC;QAC3C,WAAW,CAAC,EAAE,WAAW,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,CAAC;KAC1C,CAAC;IAEK,EAAE,EAAE,MAAM,CAAY;IAEtB,MAAM,yBAA2C;IACjD,WAAW,CAAC,EAAE,WAAW,CAAC,GAAG,CAAC,CAAC;IAE/B,IAAI;;;MAGT;gBAEiB,QAAQ,EAAE,sBAAsB;IAE5C,YAAY,CAAC,MAAM,EAAE,OAAO,CAAC,QAAQ,CAAC,GAAG,IAAI;IAO7C,iBAAiB,CAAC,WAAW,EAAE,WAAW,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,GAAG,IAAI;IAKzE,OAAO,IAAI,OAAO,CAAC,QAAQ,CAAC;IAWnC,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,UAAU,CAAC;CAG1C"}
|
|
@@ -2,47 +2,32 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.History = void 0;
|
|
4
4
|
const uuid_1 = require("uuid");
|
|
5
|
+
const utils_1 = require("../../utils");
|
|
5
6
|
class History {
|
|
6
|
-
constructor(
|
|
7
|
-
this.
|
|
7
|
+
constructor(snapshot) {
|
|
8
|
+
this.snapshot = snapshot;
|
|
8
9
|
this.id = (0, uuid_1.v4)();
|
|
10
|
+
this.status = (0, utils_1.cast)('pending');
|
|
9
11
|
this.meta = {
|
|
10
|
-
state: 'pending',
|
|
11
12
|
requestedAt: Date.now(),
|
|
12
13
|
updatedAt: Date.now(),
|
|
13
14
|
};
|
|
14
15
|
}
|
|
15
|
-
|
|
16
|
+
switchStatus(status) {
|
|
16
17
|
this.meta.updatedAt = Date.now();
|
|
17
|
-
this.
|
|
18
|
+
this.status = status;
|
|
18
19
|
return this;
|
|
19
20
|
}
|
|
20
21
|
assignExpectation(expectation) {
|
|
21
22
|
this.meta.updatedAt = Date.now();
|
|
22
23
|
return Object.assign(this, { expectation });
|
|
23
24
|
}
|
|
24
|
-
assignError(error) {
|
|
25
|
-
this.meta.updatedAt = Date.now();
|
|
26
|
-
this.request.error = error;
|
|
27
|
-
return this;
|
|
28
|
-
}
|
|
29
|
-
assignOutgoing(outgoing) {
|
|
30
|
-
this.meta.updatedAt = Date.now();
|
|
31
|
-
this.request.outgoing = outgoing;
|
|
32
|
-
return this;
|
|
33
|
-
}
|
|
34
|
-
extendForwarded(forwarded) {
|
|
35
|
-
this.meta.updatedAt = Date.now();
|
|
36
|
-
return Object.assign(this, {
|
|
37
|
-
forwarded: Object.assign((this.forwaded ?? {}), forwarded)
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
25
|
toPlain() {
|
|
41
26
|
return {
|
|
42
27
|
id: this.id,
|
|
43
28
|
meta: this.meta,
|
|
44
|
-
|
|
45
|
-
|
|
29
|
+
status: this.status,
|
|
30
|
+
snapshot: this.snapshot.toPlain(),
|
|
46
31
|
expectation: this.expectation?.toPlain(),
|
|
47
32
|
};
|
|
48
33
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model.js","sourceRoot":"","sources":["../../../../src/server/history/model.ts"],"names":[],"mappings":";;;AAAA,+BAAoC;
|
|
1
|
+
{"version":3,"file":"model.js","sourceRoot":"","sources":["../../../../src/server/history/model.ts"],"names":[],"mappings":";;;AAAA,+BAAoC;AAKpC,uCAAmC;AAEnC,MAAa,OAAO;IAgBlB,YAAmB,QAAgC;QAAhC,aAAQ,GAAR,QAAQ,CAAwB;QAV5C,OAAE,GAAW,IAAA,SAAM,GAAE,CAAC;QAEtB,WAAM,GAAG,IAAA,YAAI,EAAyB,SAAS,CAAC,CAAC;QAGjD,SAAI,GAAG;YACZ,WAAW,EAAE,IAAI,CAAC,GAAG,EAAE;YACvB,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;SACtB,CAAC;IAEoD,CAAC;IAEhD,YAAY,CAAC,MAAyB;QAC3C,IAAI,CAAC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QACjC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QAErB,OAAO,IAAI,CAAC;IACd,CAAC;IAEM,iBAAiB,CAAC,WAAgD;QACvE,IAAI,CAAC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QACjC,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,WAAW,EAAE,CAAC,CAAC;IAC9C,CAAC;IAEM,OAAO;QACZ,OAAO;YACL,EAAE,EAAE,IAAI,CAAC,EAAE;YACX,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,MAAM,EAAE,IAAI,CAAC,MAAM;YAEnB,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE;YACjC,WAAW,EAAE,IAAI,CAAC,WAAW,EAAE,OAAO,EAAE;SACzC,CAAC;IACJ,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,OAA4B;QACvC,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;IAC9B,CAAC;CACF;AA5CD,0BA4CC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["../../../../src/server/history/storage.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAElC,qBAAa,cAAe,SAAQ,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC;IACtD,OAAO,CAAC,GAAG,CAAgB;IAEpB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["../../../../src/server/history/storage.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAElC,qBAAa,cAAe,SAAQ,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC;IACtD,OAAO,CAAC,GAAG,CAAgB;IAEpB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC,UAAU,CAAC,GAAG,OAAO;CAUvD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storage.js","sourceRoot":"","sources":["../../../../src/server/history/storage.ts"],"names":[],"mappings":";;;;;;AAAA,0DAAkC;AAClC,mCAAkC;AAElC,MAAa,cAAe,SAAQ,GAAoB;IAAxD;;QACU,QAAG,GAAa,EAAE,CAAC;IAY7B,CAAC;IAVQ,QAAQ,CAAC,
|
|
1
|
+
{"version":3,"file":"storage.js","sourceRoot":"","sources":["../../../../src/server/history/storage.ts"],"names":[],"mappings":";;;;;;AAAA,0DAAkC;AAClC,mCAAkC;AAElC,MAAa,cAAe,SAAQ,GAAoB;IAAxD;;QACU,QAAG,GAAa,EAAE,CAAC;IAY7B,CAAC;IAVQ,QAAQ,CAAC,OAA4B;QAC1C,MAAM,OAAO,GAAG,eAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACvC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;QAE9B,IAAI,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,GAAG,gBAAM,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,KAAK,EAAE,CAAC;YAC5D,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,EAAG,CAAC,CAAC;QACjC,CAAC;QAED,OAAO,OAAO,CAAC;IACjB,CAAC;CACF;AAbD,wCAaC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/server/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAkC,aAAa,EAAoB,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/server/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAkC,aAAa,EAAoB,MAAM,UAAU,CAAC;AAO3F,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AA+C1D,qBAAa,UAAU;IAIF,OAAO,EAAE;QAC1B,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;KACd;IANM,SAAS,SAAsD;IAC/D,OAAO,gBAAyB;gBAEpB,OAAO,EAAE;QAC1B,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;KACd;IAED,IAAI,MAAM,8BAET;WAEY,KAAK,CAAC,OAAO,EAAE,UAAU,CAAC,SAAS,CAAC;CAsClD"}
|
package/lib/src/server/index.js
CHANGED
|
@@ -26,7 +26,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
26
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.MockServer = void 0;
|
|
29
|
+
exports.MockServer = exports.parsePayload = exports.serializePayload = void 0;
|
|
30
30
|
const http_1 = require("http");
|
|
31
31
|
const socket_io_1 = require("socket.io");
|
|
32
32
|
const lodash_1 = __importDefault(require("lodash"));
|
|
@@ -35,6 +35,9 @@ const meta_1 = require("../meta");
|
|
|
35
35
|
const logger_1 = require("../logger");
|
|
36
36
|
const router_1 = require("./router");
|
|
37
37
|
const middlewares = __importStar(require("./middlewares"));
|
|
38
|
+
var models_2 = require("./models");
|
|
39
|
+
Object.defineProperty(exports, "serializePayload", { enumerable: true, get: function () { return models_2.serializePayload; } });
|
|
40
|
+
Object.defineProperty(exports, "parsePayload", { enumerable: true, get: function () { return models_2.parsePayload; } });
|
|
38
41
|
const logger = logger_1.Logger.build('Server');
|
|
39
42
|
const middlewaresToUse = [
|
|
40
43
|
middlewares.publicMiddleware,
|
|
@@ -95,6 +98,12 @@ class MockServer {
|
|
|
95
98
|
logger.info(`GUI is available on [${server.authority}/_mock/gui]`);
|
|
96
99
|
resolve();
|
|
97
100
|
}));
|
|
101
|
+
setInterval(() => {
|
|
102
|
+
server.context.storages.containers.getExpired().forEach((container) => {
|
|
103
|
+
container.unbind();
|
|
104
|
+
logger.info(`Container [${container.link}] has unbinded by expiration of [${container.configuration.ttl}] seconds`);
|
|
105
|
+
});
|
|
106
|
+
}, 60 * 60 * 1000);
|
|
98
107
|
return server;
|
|
99
108
|
}
|
|
100
109
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/server/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAAqE;AACrE,yCAAmC;AACnC,oDAAuB;AAEvB,qCAA2F;AAC3F,kCAAsC;AACtC,sCAAmC;AACnC,qCAAkC;AAElC,2DAA6C;AAE7C,MAAM,MAAM,GAAG,eAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;AAEtC,MAAM,gBAAgB,GAAwC;IAC5D,WAAW,CAAC,gBAAgB;IAC5B,WAAW,CAAC,kBAAkB;IAC9B,WAAW,CAAC,0BAA0B;IACtC,WAAW,CAAC,+BAA+B;IAC3C,WAAW,CAAC,iBAAiB;IAC7B,WAAW,CAAC,eAAe;IAC3B,WAAW,CAAC,iBAAiB;IAC7B,WAAW,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C;QAEpC,MAAM,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,EAAE,CAClC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,GAAG,EAAE;YAC3C,MAAM,CAAC,IAAI,CAAC,0BAA0B,MAAM,CAAC,SAAS,GAAG,CAAC,CAAC;YAC3D,MAAM,CAAC,IAAI,CAAC,wBAAwB,MAAM,CAAC,SAAS,aAAa,CAAC,CAAC;YAEnE,OAAO,EAAE,CAAC;QACZ,CAAC,CAAC,CACH,CAAC;QAEF,WAAW,CAAC,GAAG,EAAE;YACf,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,UAAU,EAAE,CAAC,OAAO,CAAC,CAAC,SAAS,EAAE,EAAE;gBACpE,SAAS,CAAC,MAAM,EAAE,CAAC;gBACnB,MAAM,CAAC,IAAI,CAAC,cAAc,SAAS,CAAC,IAAI,oCAAoC,SAAS,CAAC,aAAa,CAAC,GAAG,WAAW,CAAC,CAAC;YACtH,CAAC,CAAC,CAAC;QACL,CAAC,EAAE,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC;QAEnB,OAAO,MAAM,CAAC;IAChB,CAAC;CACF;AAnDD,gCAmDC"}
|
|
@@ -1,23 +1,17 @@
|
|
|
1
1
|
import { Middleware } from '../models';
|
|
2
|
-
declare const _default: Middleware<
|
|
2
|
+
declare const _default: Middleware<never, import("../models").HttpRequestContext<unknown> & {
|
|
3
3
|
shared: import("../..").SetRequiredKeys<{
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
expectation?: import("../../expectations").Expectation<Pick<import("../models").HttpRequestContext, "incoming" | "outgoing">>;
|
|
7
|
-
manipulated?: import("../../expectations").IExpectationOperatorContext;
|
|
8
|
-
forwarded?: Pick<import("../models").HttpRequestContext, "incoming" | "outgoing">;
|
|
4
|
+
snapshot: import("../models").RequestContextSnapshot;
|
|
5
|
+
expectation?: import("../../expectations").Expectation<any>;
|
|
9
6
|
history?: import("../history").History;
|
|
10
|
-
},
|
|
7
|
+
}, never>;
|
|
11
8
|
}> & {
|
|
12
9
|
handler: import("../..").TFunction<unknown, [import("../models").HttpRequestContext<unknown> & {
|
|
13
10
|
shared: import("../..").SetRequiredKeys<{
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
expectation?: import("../../expectations").Expectation<Pick<import("../models").HttpRequestContext, "incoming" | "outgoing">>;
|
|
17
|
-
manipulated?: import("../../expectations").IExpectationOperatorContext;
|
|
18
|
-
forwarded?: Pick<import("../models").HttpRequestContext, "incoming" | "outgoing">;
|
|
11
|
+
snapshot: import("../models").RequestContextSnapshot;
|
|
12
|
+
expectation?: import("../../expectations").Expectation<any>;
|
|
19
13
|
history?: import("../history").History;
|
|
20
|
-
},
|
|
14
|
+
}, never>;
|
|
21
15
|
}, {
|
|
22
16
|
logger: import("../..").Logger;
|
|
23
17
|
}]>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delay.middleware.d.ts","sourceRoot":"","sources":["../../../../src/server/middlewares/delay.middleware.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC
|
|
1
|
+
{"version":3,"file":"delay.middleware.d.ts","sourceRoot":"","sources":["../../../../src/server/middlewares/delay.middleware.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;;;;;;;;;;;;;;;;;;AAGvC,wBAOK"}
|
|
@@ -3,11 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const models_1 = require("../models");
|
|
4
4
|
const utils_1 = require("../../utils");
|
|
5
5
|
exports.default = models_1.Middleware
|
|
6
|
-
.build(__filename
|
|
6
|
+
.build(__filename)
|
|
7
7
|
.assignHandler(async (context, { logger }) => {
|
|
8
|
-
if (context.shared.
|
|
9
|
-
logger.info(`Has delayed over [${context.shared.
|
|
10
|
-
await (0, utils_1.wait)(context.shared.
|
|
8
|
+
if (context.shared.snapshot.incoming.delay) {
|
|
9
|
+
logger.info(`Has delayed over [${context.shared.snapshot.incoming.delay}ms]`);
|
|
10
|
+
await (0, utils_1.wait)(context.shared.snapshot.incoming.delay);
|
|
11
11
|
}
|
|
12
12
|
});
|
|
13
13
|
//# sourceMappingURL=delay.middleware.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delay.middleware.js","sourceRoot":"","sources":["../../../../src/server/middlewares/delay.middleware.ts"],"names":[],"mappings":";;AAEA,sCAAuC;AACvC,uCAAmC;AAEnC,kBAAe,mBAAU;KACtB,KAAK,CAAC,UAAU,
|
|
1
|
+
{"version":3,"file":"delay.middleware.js","sourceRoot":"","sources":["../../../../src/server/middlewares/delay.middleware.ts"],"names":[],"mappings":";;AAEA,sCAAuC;AACvC,uCAAmC;AAEnC,kBAAe,mBAAU;KACtB,KAAK,CAAC,UAAU,CAAC;KACjB,aAAa,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE;IAC3C,IAAI,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC;QAC3C,MAAM,CAAC,IAAI,CAAC,qBAAqB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,KAAK,KAAK,CAAC,CAAC;QAC9E,MAAM,IAAA,YAAI,EAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IACrD,CAAC;AACH,CAAC,CAAC,CAAC"}
|
|
@@ -1,23 +1,17 @@
|
|
|
1
1
|
import { Middleware } from '../models';
|
|
2
|
-
declare const _default: Middleware<"history"
|
|
2
|
+
declare const _default: Middleware<"history", import("../models").HttpRequestContext<unknown> & {
|
|
3
3
|
shared: import("../..").SetRequiredKeys<{
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
expectation?: import("../../expectations").Expectation<Pick<import("../models").HttpRequestContext, "incoming" | "outgoing">>;
|
|
7
|
-
manipulated?: import("../../expectations").IExpectationOperatorContext;
|
|
8
|
-
forwarded?: Pick<import("../models").HttpRequestContext, "incoming" | "outgoing">;
|
|
4
|
+
snapshot: import("../models").RequestContextSnapshot;
|
|
5
|
+
expectation?: import("../../expectations").Expectation<any>;
|
|
9
6
|
history?: import("../history").History;
|
|
10
|
-
}, "history"
|
|
7
|
+
}, "history">;
|
|
11
8
|
}> & {
|
|
12
9
|
handler: import("../..").TFunction<unknown, [import("../models").HttpRequestContext<unknown> & {
|
|
13
10
|
shared: import("../..").SetRequiredKeys<{
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
expectation?: import("../../expectations").Expectation<Pick<import("../models").HttpRequestContext, "incoming" | "outgoing">>;
|
|
17
|
-
manipulated?: import("../../expectations").IExpectationOperatorContext;
|
|
18
|
-
forwarded?: Pick<import("../models").HttpRequestContext, "incoming" | "outgoing">;
|
|
11
|
+
snapshot: import("../models").RequestContextSnapshot;
|
|
12
|
+
expectation?: import("../../expectations").Expectation<any>;
|
|
19
13
|
history?: import("../history").History;
|
|
20
|
-
}, "history"
|
|
14
|
+
}, "history">;
|
|
21
15
|
}, {
|
|
22
16
|
logger: import("../..").Logger;
|
|
23
17
|
}]>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"destroy.midleware.d.ts","sourceRoot":"","sources":["../../../../src/server/middlewares/destroy.midleware.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC
|
|
1
|
+
{"version":3,"file":"destroy.midleware.d.ts","sourceRoot":"","sources":["../../../../src/server/middlewares/destroy.midleware.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;;;;;;;;;;;;;;;;;;AAEvC,wBAaK"}
|
|
@@ -2,15 +2,14 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const models_1 = require("../models");
|
|
4
4
|
exports.default = models_1.Middleware
|
|
5
|
-
.build(__filename, ['
|
|
5
|
+
.build(__filename, ['history'])
|
|
6
6
|
.assignHandler((context, { logger }) => {
|
|
7
|
-
if (context.shared.
|
|
8
|
-
context.shared.history
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
context.response.destroy(new Error(context.shared.manipulated.incoming.error));
|
|
7
|
+
if (context.shared.snapshot.incoming.error) {
|
|
8
|
+
context.shared.history.snapshot.assign({ error: { code: context.shared.snapshot.incoming.error, isManual: true } });
|
|
9
|
+
context.shared.history.switchStatus('finished');
|
|
10
|
+
context.server.exchanges.ws.publish('history:updated', context.shared.history.toPlain());
|
|
11
|
+
logger.info(`Has destroyed using [${context.shared.snapshot.incoming.error}]`);
|
|
12
|
+
context.response.destroy(new Error(context.shared.snapshot.incoming.error));
|
|
14
13
|
context.complete();
|
|
15
14
|
}
|
|
16
15
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"destroy.midleware.js","sourceRoot":"","sources":["../../../../src/server/middlewares/destroy.midleware.ts"],"names":[],"mappings":";;AACA,sCAAuC;AAEvC,kBAAe,mBAAU;KACtB,KAAK,CAAC,UAAU,EAAE,CAAC,
|
|
1
|
+
{"version":3,"file":"destroy.midleware.js","sourceRoot":"","sources":["../../../../src/server/middlewares/destroy.midleware.ts"],"names":[],"mappings":";;AACA,sCAAuC;AAEvC,kBAAe,mBAAU;KACtB,KAAK,CAAC,UAAU,EAAE,CAAC,SAAS,CAAC,CAAC;KAC9B,aAAa,CAAC,CAAC,OAAO,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE;IACrC,IAAI,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC;QAC3C,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;QACpH,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;QAEhD,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,CAAC,OAAO,CAAC,iBAAiB,EAAE,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC;QACzF,MAAM,CAAC,IAAI,CAAC,wBAAwB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,KAAK,GAAG,CAAC,CAAC;QAE/E,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;QAC5E,OAAO,CAAC,QAAQ,EAAE,CAAC;IACrB,CAAC;AACH,CAAC,CAAC,CAAC"}
|
|
@@ -1,23 +1,17 @@
|
|
|
1
1
|
import { Middleware } from '../models';
|
|
2
|
-
declare const _default: Middleware<"history" | "expectation"
|
|
2
|
+
declare const _default: Middleware<"history" | "expectation", import("../models").HttpRequestContext<unknown> & {
|
|
3
3
|
shared: import("../..").SetRequiredKeys<{
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
expectation?: import("../../expectations").Expectation<Pick<import("../models").HttpRequestContext, "incoming" | "outgoing">>;
|
|
7
|
-
manipulated?: import("../../expectations").IExpectationOperatorContext;
|
|
8
|
-
forwarded?: Pick<import("../models").HttpRequestContext, "incoming" | "outgoing">;
|
|
4
|
+
snapshot: import("../models").RequestContextSnapshot;
|
|
5
|
+
expectation?: import("../../expectations").Expectation<any>;
|
|
9
6
|
history?: import("../history").History;
|
|
10
|
-
}, "history" | "expectation"
|
|
7
|
+
}, "history" | "expectation">;
|
|
11
8
|
}> & {
|
|
12
9
|
handler: import("../..").TFunction<unknown, [import("../models").HttpRequestContext<unknown> & {
|
|
13
10
|
shared: import("../..").SetRequiredKeys<{
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
expectation?: import("../../expectations").Expectation<Pick<import("../models").HttpRequestContext, "incoming" | "outgoing">>;
|
|
17
|
-
manipulated?: import("../../expectations").IExpectationOperatorContext;
|
|
18
|
-
forwarded?: Pick<import("../models").HttpRequestContext, "incoming" | "outgoing">;
|
|
11
|
+
snapshot: import("../models").RequestContextSnapshot;
|
|
12
|
+
expectation?: import("../../expectations").Expectation<any>;
|
|
19
13
|
history?: import("../history").History;
|
|
20
|
-
}, "history" | "expectation"
|
|
14
|
+
}, "history" | "expectation">;
|
|
21
15
|
}, {
|
|
22
16
|
logger: import("../..").Logger;
|
|
23
17
|
}]>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"forward.middleware.d.ts","sourceRoot":"","sources":["../../../../src/server/middlewares/forward.middleware.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"forward.middleware.d.ts","sourceRoot":"","sources":["../../../../src/server/middlewares/forward.middleware.ts"],"names":[],"mappings":"AAQA,OAAO,EAGL,UAAU,EAIX,MAAM,WAAW,CAAC;;;;;;;;;;;;;;;;;;AAgBnB,wBA4JK"}
|