@n1k1t/mock-server 0.1.1 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/package.json +5 -2
- package/lib/src/client/helpers/expectations.d.ts +89 -0
- package/lib/src/client/helpers/expectations.d.ts.map +1 -0
- package/lib/src/client/helpers/expectations.js +66 -0
- package/lib/src/client/helpers/expectations.js.map +1 -0
- package/lib/src/client/helpers/index.d.ts +2 -0
- package/lib/src/client/helpers/index.d.ts.map +1 -0
- package/lib/src/client/helpers/index.js +18 -0
- package/lib/src/client/helpers/index.js.map +1 -0
- package/lib/src/client/index.d.ts +1 -0
- package/lib/src/client/index.d.ts.map +1 -1
- package/lib/src/client/index.js +1 -0
- package/lib/src/client/index.js.map +1 -1
- package/lib/src/client/methods/expectations.create.method.d.ts +1 -3
- package/lib/src/client/methods/expectations.create.method.d.ts.map +1 -1
- package/lib/src/client/methods/expectations.create.method.js +3 -3
- package/lib/src/client/methods/expectations.create.method.js.map +1 -1
- package/lib/src/client/methods/expectations.update.method.d.ts +2 -2
- package/lib/src/client/methods/expectations.update.method.js +6 -6
- package/lib/src/client/methods/expectations.update.method.js.map +1 -1
- package/lib/src/client/methods/ping.method.d.ts +1 -1
- package/lib/src/client/methods/ping.method.js.map +1 -1
- package/lib/src/client/models/client.d.ts +40 -0
- package/lib/src/client/models/client.d.ts.map +1 -0
- package/lib/src/client/models/client.js +33 -0
- package/lib/src/client/models/client.js.map +1 -0
- package/lib/src/client/models/client.spec.d.ts +2 -0
- package/lib/src/client/models/client.spec.d.ts.map +1 -0
- package/lib/src/client/models/client.spec.js +224 -0
- package/lib/src/client/models/client.spec.js.map +1 -0
- package/lib/src/client/models/index.d.ts +1 -0
- package/lib/src/client/models/index.d.ts.map +1 -1
- package/lib/src/client/models/index.js +1 -0
- package/lib/src/client/models/index.js.map +1 -1
- package/lib/src/client/models/method.d.ts +4 -4
- package/lib/src/client/models/method.d.ts.map +1 -1
- package/lib/src/client/models/method.js.map +1 -1
- package/lib/src/client/onsite.d.ts +4 -3
- package/lib/src/client/onsite.d.ts.map +1 -1
- package/lib/src/client/onsite.js +8 -6
- package/lib/src/client/onsite.js.map +1 -1
- package/lib/src/client/remote.d.ts +4 -4
- package/lib/src/client/remote.d.ts.map +1 -1
- package/lib/src/client/remote.js +11 -10
- package/lib/src/client/remote.js.map +1 -1
- package/lib/src/client/types.d.ts +2 -0
- package/lib/src/client/types.d.ts.map +1 -1
- package/lib/src/client/utils.d.ts +2 -2
- package/lib/src/client/utils.d.ts.map +1 -1
- package/lib/src/client/utils.js +25 -12
- package/lib/src/client/utils.js.map +1 -1
- package/lib/src/expectations/__utils__/index.d.ts +2 -2
- package/lib/src/expectations/__utils__/index.d.ts.map +1 -1
- package/lib/src/expectations/__utils__/index.js +31 -23
- package/lib/src/expectations/__utils__/index.js.map +1 -1
- package/lib/src/expectations/index.d.ts +1 -2
- package/lib/src/expectations/index.d.ts.map +1 -1
- package/lib/src/expectations/index.js +1 -2
- package/lib/src/expectations/index.js.map +1 -1
- package/lib/src/expectations/models/expectation.d.ts +33 -0
- package/lib/src/expectations/models/expectation.d.ts.map +1 -0
- package/lib/src/expectations/models/expectation.js +81 -0
- package/lib/src/expectations/models/expectation.js.map +1 -0
- package/lib/src/expectations/models/index.d.ts +4 -0
- package/lib/src/expectations/models/index.d.ts.map +1 -0
- package/lib/src/expectations/models/index.js +20 -0
- package/lib/src/expectations/models/index.js.map +1 -0
- package/lib/src/expectations/models/operator.d.ts +20 -0
- package/lib/src/expectations/models/operator.d.ts.map +1 -0
- package/lib/src/expectations/models/operator.js +49 -0
- package/lib/src/expectations/models/operator.js.map +1 -0
- package/lib/src/expectations/models/storage.d.ts +15 -0
- package/lib/src/expectations/models/storage.d.ts.map +1 -0
- package/lib/src/expectations/{storage.js → models/storage.js} +4 -14
- package/lib/src/expectations/models/storage.js.map +1 -0
- package/lib/src/expectations/models/storage.spec.d.ts +2 -0
- package/lib/src/expectations/models/storage.spec.d.ts.map +1 -0
- package/lib/src/expectations/models/storage.spec.js +111 -0
- package/lib/src/expectations/models/storage.spec.js.map +1 -0
- package/lib/src/expectations/operators/and.operator.d.ts +7 -2
- package/lib/src/expectations/operators/and.operator.d.ts.map +1 -1
- package/lib/src/expectations/operators/and.operator.js +21 -2
- package/lib/src/expectations/operators/and.operator.js.map +1 -1
- package/lib/src/expectations/operators/and.operator.spec.js +57 -39
- package/lib/src/expectations/operators/and.operator.spec.js.map +1 -1
- package/lib/src/expectations/operators/exec.operator.d.ts +7 -2
- package/lib/src/expectations/operators/exec.operator.d.ts.map +1 -1
- package/lib/src/expectations/operators/exec.operator.js +14 -18
- package/lib/src/expectations/operators/exec.operator.js.map +1 -1
- package/lib/src/expectations/operators/exec.operator.spec.js +49 -18
- package/lib/src/expectations/operators/exec.operator.spec.js.map +1 -1
- package/lib/src/expectations/operators/has.operator.d.ts +27 -2
- package/lib/src/expectations/operators/has.operator.d.ts.map +1 -1
- package/lib/src/expectations/operators/has.operator.js +108 -69
- package/lib/src/expectations/operators/has.operator.js.map +1 -1
- package/lib/src/expectations/operators/has.operator.spec.js +422 -161
- package/lib/src/expectations/operators/has.operator.spec.js.map +1 -1
- package/lib/src/expectations/operators/if.operator.d.ts +15 -2
- package/lib/src/expectations/operators/if.operator.d.ts.map +1 -1
- package/lib/src/expectations/operators/if.operator.js +44 -10
- package/lib/src/expectations/operators/if.operator.js.map +1 -1
- package/lib/src/expectations/operators/if.operator.spec.js +89 -65
- package/lib/src/expectations/operators/if.operator.spec.js.map +1 -1
- package/lib/src/expectations/operators/index.d.ts +2 -0
- package/lib/src/expectations/operators/index.d.ts.map +1 -1
- package/lib/src/expectations/operators/index.js +5 -1
- package/lib/src/expectations/operators/index.js.map +1 -1
- package/lib/src/expectations/operators/merge.operator.d.ts +13 -2
- package/lib/src/expectations/operators/merge.operator.d.ts.map +1 -1
- package/lib/src/expectations/operators/merge.operator.js +23 -19
- package/lib/src/expectations/operators/merge.operator.js.map +1 -1
- package/lib/src/expectations/operators/merge.operator.spec.js +43 -33
- package/lib/src/expectations/operators/merge.operator.spec.js.map +1 -1
- package/lib/src/expectations/operators/not.operator.d.ts +7 -2
- package/lib/src/expectations/operators/not.operator.d.ts.map +1 -1
- package/lib/src/expectations/operators/not.operator.js +21 -2
- package/lib/src/expectations/operators/not.operator.js.map +1 -1
- package/lib/src/expectations/operators/not.operator.spec.js +28 -9
- package/lib/src/expectations/operators/not.operator.spec.js.map +1 -1
- package/lib/src/expectations/operators/or.operator.d.ts +7 -2
- package/lib/src/expectations/operators/or.operator.d.ts.map +1 -1
- package/lib/src/expectations/operators/or.operator.js +21 -6
- package/lib/src/expectations/operators/or.operator.js.map +1 -1
- package/lib/src/expectations/operators/or.operator.spec.js +58 -39
- package/lib/src/expectations/operators/or.operator.spec.js.map +1 -1
- package/lib/src/expectations/operators/remove.operator.d.ts +12 -2
- package/lib/src/expectations/operators/remove.operator.d.ts.map +1 -1
- package/lib/src/expectations/operators/remove.operator.js +22 -17
- package/lib/src/expectations/operators/remove.operator.js.map +1 -1
- package/lib/src/expectations/operators/remove.operator.spec.js +40 -28
- package/lib/src/expectations/operators/remove.operator.spec.js.map +1 -1
- package/lib/src/expectations/operators/root.operator.d.ts +8 -0
- package/lib/src/expectations/operators/root.operator.d.ts.map +1 -0
- package/lib/src/expectations/operators/root.operator.js +36 -0
- package/lib/src/expectations/operators/root.operator.js.map +1 -0
- package/lib/src/expectations/operators/set.operator.d.ts +20 -2
- package/lib/src/expectations/operators/set.operator.d.ts.map +1 -1
- package/lib/src/expectations/operators/set.operator.js +38 -23
- package/lib/src/expectations/operators/set.operator.js.map +1 -1
- package/lib/src/expectations/operators/set.operator.spec.js +87 -43
- package/lib/src/expectations/operators/set.operator.spec.js.map +1 -1
- package/lib/src/expectations/operators/switch.operator.d.ts +25 -0
- package/lib/src/expectations/operators/switch.operator.d.ts.map +1 -0
- package/lib/src/expectations/operators/switch.operator.js +68 -0
- package/lib/src/expectations/operators/switch.operator.js.map +1 -0
- package/lib/src/expectations/operators/switch.operator.spec.d.ts +2 -0
- package/lib/src/expectations/operators/switch.operator.spec.d.ts.map +1 -0
- package/lib/src/expectations/operators/switch.operator.spec.js +129 -0
- package/lib/src/expectations/operators/switch.operator.spec.js.map +1 -0
- package/lib/src/expectations/types.d.ts +67 -63
- package/lib/src/expectations/types.d.ts.map +1 -1
- package/lib/src/expectations/types.js +17 -3
- package/lib/src/expectations/types.js.map +1 -1
- package/lib/src/expectations/utils.d.ts +23 -10
- package/lib/src/expectations/utils.d.ts.map +1 -1
- package/lib/src/expectations/utils.js +111 -53
- package/lib/src/expectations/utils.js.map +1 -1
- package/lib/src/server/endpoints/config.get.endpoint.d.ts +8 -3
- package/lib/src/server/endpoints/config.get.endpoint.d.ts.map +1 -1
- package/lib/src/server/endpoints/config.get.endpoint.js +2 -4
- package/lib/src/server/endpoints/config.get.endpoint.js.map +1 -1
- package/lib/src/server/endpoints/expectations.create.endpoint.d.ts +9 -11
- package/lib/src/server/endpoints/expectations.create.endpoint.d.ts.map +1 -1
- package/lib/src/server/endpoints/expectations.create.endpoint.js +2 -3
- package/lib/src/server/endpoints/expectations.create.endpoint.js.map +1 -1
- package/lib/src/server/endpoints/expectations.delete.endpoint.d.ts +8 -5
- package/lib/src/server/endpoints/expectations.delete.endpoint.d.ts.map +1 -1
- package/lib/src/server/endpoints/expectations.delete.endpoint.js +2 -2
- package/lib/src/server/endpoints/expectations.delete.endpoint.js.map +1 -1
- package/lib/src/server/endpoints/expectations.get-list.endpoint.d.ts +8 -3
- package/lib/src/server/endpoints/expectations.get-list.endpoint.d.ts.map +1 -1
- package/lib/src/server/endpoints/expectations.get-list.endpoint.js +2 -2
- package/lib/src/server/endpoints/expectations.get-list.endpoint.js.map +1 -1
- package/lib/src/server/endpoints/expectations.update.endpoint.d.ts +13 -11
- package/lib/src/server/endpoints/expectations.update.endpoint.d.ts.map +1 -1
- package/lib/src/server/endpoints/expectations.update.endpoint.js +4 -6
- package/lib/src/server/endpoints/expectations.update.endpoint.js.map +1 -1
- package/lib/src/server/endpoints/history.get-list.endpoint.d.ts +27 -0
- package/lib/src/server/endpoints/history.get-list.endpoint.d.ts.map +1 -0
- package/lib/src/server/endpoints/history.get-list.endpoint.js +11 -0
- package/lib/src/server/endpoints/history.get-list.endpoint.js.map +1 -0
- package/lib/src/server/endpoints/index.d.ts +1 -1
- package/lib/src/server/endpoints/index.d.ts.map +1 -1
- package/lib/src/server/endpoints/index.js +3 -3
- package/lib/src/server/endpoints/index.js.map +1 -1
- package/lib/src/server/endpoints/ping.endpoint.d.ts +8 -3
- package/lib/src/server/endpoints/ping.endpoint.d.ts.map +1 -1
- package/lib/src/server/endpoints/ping.endpoint.js +1 -1
- package/lib/src/server/endpoints/ping.endpoint.js.map +1 -1
- package/lib/src/server/history/model.d.ts +16 -16
- package/lib/src/server/history/model.d.ts.map +1 -1
- package/lib/src/server/history/model.js +21 -6
- package/lib/src/server/history/model.js.map +1 -1
- package/lib/src/server/history/storage.d.ts +3 -4
- package/lib/src/server/history/storage.d.ts.map +1 -1
- package/lib/src/server/history/storage.js +2 -2
- package/lib/src/server/history/storage.js.map +1 -1
- package/lib/src/server/index.d.ts +10 -6
- package/lib/src/server/index.d.ts.map +1 -1
- package/lib/src/server/index.js +21 -22
- package/lib/src/server/index.js.map +1 -1
- package/lib/src/server/middlewares/delay.middleware.d.ts +24 -0
- package/lib/src/server/middlewares/delay.middleware.d.ts.map +1 -0
- package/lib/src/server/middlewares/delay.middleware.js +13 -0
- package/lib/src/server/middlewares/delay.middleware.js.map +1 -0
- package/lib/src/server/middlewares/destroy.midleware.d.ts +24 -0
- package/lib/src/server/middlewares/destroy.midleware.d.ts.map +1 -0
- package/lib/src/server/middlewares/destroy.midleware.js +16 -0
- package/lib/src/server/middlewares/destroy.midleware.js.map +1 -0
- package/lib/src/server/middlewares/forward.middleware.d.ts +24 -0
- package/lib/src/server/middlewares/forward.middleware.d.ts.map +1 -0
- package/lib/src/server/middlewares/forward.middleware.js +71 -0
- package/lib/src/server/middlewares/forward.middleware.js.map +1 -0
- package/lib/src/server/middlewares/history.middleware.d.ts +24 -0
- package/lib/src/server/middlewares/history.middleware.d.ts.map +1 -0
- package/lib/src/server/middlewares/history.middleware.js +13 -0
- package/lib/src/server/middlewares/history.middleware.js.map +1 -0
- package/lib/src/server/middlewares/index.d.ts +7 -6
- package/lib/src/server/middlewares/index.d.ts.map +1 -1
- package/lib/src/server/middlewares/index.js +15 -13
- package/lib/src/server/middlewares/index.js.map +1 -1
- package/lib/src/server/middlewares/internal-route.middleware.d.ts +20 -2
- package/lib/src/server/middlewares/internal-route.middleware.d.ts.map +1 -1
- package/lib/src/server/middlewares/internal-route.middleware.js +4 -3
- package/lib/src/server/middlewares/internal-route.middleware.js.map +1 -1
- package/lib/src/server/middlewares/manipulate-expectation.middleware.d.ts +24 -0
- package/lib/src/server/middlewares/manipulate-expectation.middleware.d.ts.map +1 -0
- package/lib/src/server/middlewares/manipulate-expectation.middleware.js +13 -0
- package/lib/src/server/middlewares/manipulate-expectation.middleware.js.map +1 -0
- package/lib/src/server/middlewares/match-expectation.middleware.d.ts +24 -0
- package/lib/src/server/middlewares/match-expectation.middleware.d.ts.map +1 -0
- package/lib/src/server/middlewares/match-expectation.middleware.js +20 -0
- package/lib/src/server/middlewares/match-expectation.middleware.js.map +1 -0
- package/lib/src/server/middlewares/public.middleware.d.ts +24 -0
- package/lib/src/server/middlewares/public.middleware.d.ts.map +1 -0
- package/lib/src/server/middlewares/{resolve-public.middleware.js → public.middleware.js} +13 -13
- package/lib/src/server/middlewares/public.middleware.js.map +1 -0
- package/lib/src/server/middlewares/reply.middleware.d.ts +21 -5
- package/lib/src/server/middlewares/reply.middleware.d.ts.map +1 -1
- package/lib/src/server/middlewares/reply.middleware.js +34 -25
- package/lib/src/server/middlewares/reply.middleware.js.map +1 -1
- package/lib/src/server/models/endpoint.d.ts +19 -13
- package/lib/src/server/models/endpoint.d.ts.map +1 -1
- package/lib/src/server/models/endpoint.js +2 -2
- package/lib/src/server/models/endpoint.js.map +1 -1
- package/lib/src/server/models/middleware.d.ts +21 -20
- package/lib/src/server/models/middleware.d.ts.map +1 -1
- package/lib/src/server/models/middleware.js +6 -10
- package/lib/src/server/models/middleware.js.map +1 -1
- package/lib/src/server/models/reply-service/index.d.ts +6 -6
- package/lib/src/server/models/reply-service/index.d.ts.map +1 -1
- package/lib/src/server/models/reply-service/index.js +24 -24
- package/lib/src/server/models/reply-service/index.js.map +1 -1
- package/lib/src/server/models/request-context/http.d.ts +45 -0
- package/lib/src/server/models/request-context/http.d.ts.map +1 -0
- package/lib/src/server/models/request-context/http.js +71 -0
- package/lib/src/server/models/request-context/http.js.map +1 -0
- package/lib/src/server/models/request-context/index.d.ts +4 -57
- package/lib/src/server/models/request-context/index.d.ts.map +1 -1
- package/lib/src/server/models/request-context/index.js +4 -57
- package/lib/src/server/models/request-context/index.js.map +1 -1
- package/lib/src/server/models/request-context/model.d.ts +13 -0
- package/lib/src/server/models/request-context/model.d.ts.map +1 -0
- package/lib/src/server/models/request-context/model.js +14 -0
- package/lib/src/server/models/request-context/model.js.map +1 -0
- package/lib/src/server/models/request-context/types.d.ts +16 -18
- package/lib/src/server/models/request-context/types.d.ts.map +1 -1
- package/lib/src/server/models/request-context/utils.d.ts +7 -3
- package/lib/src/server/models/request-context/utils.d.ts.map +1 -1
- package/lib/src/server/models/request-context/utils.js +48 -25
- package/lib/src/server/models/request-context/utils.js.map +1 -1
- package/lib/src/server/models/request-context/ws.d.ts +21 -0
- package/lib/src/server/models/request-context/ws.d.ts.map +1 -0
- package/lib/src/server/models/request-context/ws.js +22 -0
- package/lib/src/server/models/request-context/ws.js.map +1 -0
- package/lib/src/server/models/server-context.d.ts +4 -4
- package/lib/src/server/models/server-context.d.ts.map +1 -1
- package/lib/src/server/models/server-context.js +5 -5
- package/lib/src/server/models/server-context.js.map +1 -1
- package/lib/src/server/router.d.ts +4 -7
- package/lib/src/server/router.d.ts.map +1 -1
- package/lib/src/server/router.js +5 -12
- package/lib/src/server/router.js.map +1 -1
- package/lib/src/server/ws-exchange/index.d.ts +5 -0
- package/lib/src/server/ws-exchange/index.d.ts.map +1 -0
- package/lib/src/server/{web-socket-exchange → ws-exchange}/index.js +3 -3
- package/lib/src/server/ws-exchange/index.js.map +1 -0
- package/lib/src/server/ws-exchange/types.d.ts +12 -0
- package/lib/src/server/ws-exchange/types.d.ts.map +1 -0
- package/lib/src/server/ws-exchange/types.js.map +1 -0
- package/lib/src/types.d.ts +0 -1
- package/lib/src/types.d.ts.map +1 -1
- package/lib/src/utils/index.d.ts +1 -0
- package/lib/src/utils/index.d.ts.map +1 -1
- package/lib/src/utils/index.js +1 -0
- package/lib/src/utils/index.js.map +1 -1
- package/lib/src/utils/json.d.ts +1 -1
- package/lib/src/utils/json.d.ts.map +1 -1
- package/lib/src/utils/json.js +3 -3
- package/lib/src/utils/json.js.map +1 -1
- package/lib/src/utils/regexp.d.ts +2 -0
- package/lib/src/utils/regexp.d.ts.map +1 -0
- package/lib/src/utils/regexp.js +9 -0
- package/lib/src/utils/regexp.js.map +1 -0
- package/lib/test/index.js +140 -136
- package/lib/test/index.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/types/common.global.d.ts +13 -6
- package/lib/types/common.global.d.ts.map +1 -1
- package/lib/types/lib.d.ts +1 -0
- package/lib/types/lib.d.ts.map +1 -1
- package/lib/types/lib.js +1 -0
- package/lib/types/lib.js.map +1 -1
- package/package.json +5 -2
- package/types/common.global.ts +21 -2
- package/types/lib.ts +1 -0
- package/lib/src/expectations/model.d.ts +0 -39
- package/lib/src/expectations/model.d.ts.map +0 -1
- package/lib/src/expectations/model.js +0 -90
- package/lib/src/expectations/model.js.map +0 -1
- package/lib/src/expectations/operators/utils.d.ts +0 -20
- package/lib/src/expectations/operators/utils.d.ts.map +0 -1
- package/lib/src/expectations/operators/utils.js +0 -67
- package/lib/src/expectations/operators/utils.js.map +0 -1
- package/lib/src/expectations/storage.d.ts +0 -19
- package/lib/src/expectations/storage.d.ts.map +0 -1
- package/lib/src/expectations/storage.js.map +0 -1
- package/lib/src/expectations/utils.spec.d.ts +0 -2
- package/lib/src/expectations/utils.spec.d.ts.map +0 -1
- package/lib/src/expectations/utils.spec.js +0 -59
- package/lib/src/expectations/utils.spec.js.map +0 -1
- package/lib/src/expectations/validation-schemas.d.ts +0 -14
- package/lib/src/expectations/validation-schemas.d.ts.map +0 -1
- package/lib/src/expectations/validation-schemas.js +0 -36
- package/lib/src/expectations/validation-schemas.js.map +0 -1
- package/lib/src/server/endpoints/history-records.get-list.endpoint.d.ts +0 -16
- package/lib/src/server/endpoints/history-records.get-list.endpoint.d.ts.map +0 -1
- package/lib/src/server/endpoints/history-records.get-list.endpoint.js +0 -9
- package/lib/src/server/endpoints/history-records.get-list.endpoint.js.map +0 -1
- package/lib/src/server/middlewares/add-history.middleware.d.ts +0 -8
- package/lib/src/server/middlewares/add-history.middleware.d.ts.map +0 -1
- package/lib/src/server/middlewares/add-history.middleware.js +0 -14
- package/lib/src/server/middlewares/add-history.middleware.js.map +0 -1
- package/lib/src/server/middlewares/destroy-request.midleware.d.ts +0 -8
- package/lib/src/server/middlewares/destroy-request.midleware.d.ts.map +0 -1
- package/lib/src/server/middlewares/destroy-request.midleware.js +0 -17
- package/lib/src/server/middlewares/destroy-request.midleware.js.map +0 -1
- package/lib/src/server/middlewares/handle-expectation-delay.middleware.d.ts +0 -8
- package/lib/src/server/middlewares/handle-expectation-delay.middleware.d.ts.map +0 -1
- package/lib/src/server/middlewares/handle-expectation-delay.middleware.js +0 -18
- package/lib/src/server/middlewares/handle-expectation-delay.middleware.js.map +0 -1
- package/lib/src/server/middlewares/handle-expectation-forward.middleware.d.ts +0 -8
- package/lib/src/server/middlewares/handle-expectation-forward.middleware.d.ts.map +0 -1
- package/lib/src/server/middlewares/handle-expectation-forward.middleware.js +0 -86
- package/lib/src/server/middlewares/handle-expectation-forward.middleware.js.map +0 -1
- package/lib/src/server/middlewares/resolve-public.middleware.d.ts +0 -6
- package/lib/src/server/middlewares/resolve-public.middleware.d.ts.map +0 -1
- package/lib/src/server/middlewares/resolve-public.middleware.js.map +0 -1
- package/lib/src/server/middlewares/validate-expectation-request.middleware.d.ts +0 -6
- package/lib/src/server/middlewares/validate-expectation-request.middleware.d.ts.map +0 -1
- package/lib/src/server/middlewares/validate-expectation-request.middleware.js +0 -20
- package/lib/src/server/middlewares/validate-expectation-request.middleware.js.map +0 -1
- package/lib/src/server/types.d.ts +0 -6
- package/lib/src/server/types.d.ts.map +0 -1
- package/lib/src/server/types.js.map +0 -1
- package/lib/src/server/web-socket-exchange/index.d.ts +0 -5
- package/lib/src/server/web-socket-exchange/index.d.ts.map +0 -1
- package/lib/src/server/web-socket-exchange/index.js.map +0 -1
- package/lib/src/server/web-socket-exchange/types.d.ts +0 -12
- package/lib/src/server/web-socket-exchange/types.d.ts.map +0 -1
- package/lib/src/server/web-socket-exchange/types.js +0 -3
- package/lib/src/server/web-socket-exchange/types.js.map +0 -1
- /package/lib/src/server/{types.js → ws-exchange/types.js} +0 -0
|
@@ -1,13 +1,26 @@
|
|
|
1
|
+
import type { AxiosProxyConfig } from 'axios';
|
|
2
|
+
import type { faker } from '@faker-js/faker';
|
|
3
|
+
import type dayjs from 'dayjs';
|
|
1
4
|
import type _ from 'lodash';
|
|
2
|
-
import type {
|
|
5
|
+
import type { HttpRequestContext } from '../server/models';
|
|
6
|
+
import type { TRequestProtocol } from '../types';
|
|
7
|
+
import type * as operators from './operators';
|
|
8
|
+
import type AndExpectationOperator from './operators/and.operator';
|
|
9
|
+
import type SetExpectationOperator from './operators/set.operator';
|
|
10
|
+
import type HasExpectationOperator from './operators/has.operator';
|
|
11
|
+
import type OrExpectationOperator from './operators/or.operator';
|
|
12
|
+
import type NotExpectationOperator from './operators/not.operator';
|
|
13
|
+
import type IfExpectationOperator from './operators/if.operator';
|
|
14
|
+
import type MergeExpectationOperator from './operators/merge.operator';
|
|
15
|
+
import type RemoveExpectationOperator from './operators/remove.operator';
|
|
16
|
+
import type ExecExpectationOperator from './operators/exec.operator';
|
|
17
|
+
import type SwitchExpectationOperator from './operators/switch.operator';
|
|
3
18
|
export type TExpectationType = ConvertTupleToUnion<typeof LExpectationType>;
|
|
4
19
|
export declare const LExpectationType: readonly ["HTTP"];
|
|
5
20
|
export type TExpectationForwardProtocol = ConvertTupleToUnion<typeof LExpectationForwardProtocol>;
|
|
6
21
|
export declare const LExpectationForwardProtocol: readonly ["HTTP", "HTTPS"];
|
|
7
22
|
export type TExpectationDestroyType = ConvertTupleToUnion<typeof LExpectationDestroyType>;
|
|
8
23
|
export declare const LExpectationDestroyType: readonly ["ECONNABORTED"];
|
|
9
|
-
export type TExpectationOperatorLocation = ConvertTupleToUnion<typeof LExpectationOperatorLocation>;
|
|
10
|
-
export declare const LExpectationOperatorLocation: readonly ["path", "method", "headers", "body", "query", "data", "statusCode"];
|
|
11
24
|
export type TExpectationConditionalOperator = ConvertTupleToUnion<typeof LExpectationConditionalOperator>;
|
|
12
25
|
export declare const LExpectationConditionalOperator: readonly ["$if", "$not", "$and", "$or", "$has"];
|
|
13
26
|
export type TExpectationActionalOperator = ConvertTupleToUnion<typeof LExpectationActionalOperator>;
|
|
@@ -17,71 +30,62 @@ export declare const LExpectationAttachlessOperator: readonly ["$set", "$remove"
|
|
|
17
30
|
export interface IExpectationMeta {
|
|
18
31
|
executionsCount: number;
|
|
19
32
|
additional: {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
33
|
+
paths?: string[];
|
|
34
|
+
methods?: string[];
|
|
35
|
+
statuses?: number[];
|
|
23
36
|
};
|
|
24
37
|
}
|
|
25
|
-
export interface IExpectationDelay {
|
|
26
|
-
ms: number;
|
|
27
|
-
times?: number;
|
|
28
|
-
}
|
|
29
38
|
export type TExpectationContextLocation = 'request' | 'response';
|
|
30
|
-
export type
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
export
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
];
|
|
40
|
-
export type TExpectationOperatorHandler<K extends TExpectationOperator = TExpectationOperator> = TFunction<boolean, [
|
|
41
|
-
...TExpectationOperatorHandlerParameters<K>,
|
|
42
|
-
{
|
|
43
|
-
exploreNestedSchema: TFunction<boolean, TExpectationOperatorHandlerParameters>;
|
|
44
|
-
}
|
|
45
|
-
]>;
|
|
46
|
-
export type TExpectationOperator = TExpectationConditionalOperator | TExpectationActionalOperator;
|
|
47
|
-
export type TExpectationTargetionalValidationOperator = keyof IExpectationTargetionalSchema;
|
|
48
|
-
export type TExpectationTargetionalManipulationOperator = '$location' | '$path' | '$jsonPath' | '$value';
|
|
49
|
-
export type TExpectationTargetionalOperator = TExpectationTargetionalValidationOperator | TExpectationTargetionalManipulationOperator;
|
|
50
|
-
export interface IExpectationTargetionalSchema<TLocation extends TExpectationOperatorLocation = TExpectationOperatorLocation> {
|
|
51
|
-
$location?: TLocation;
|
|
52
|
-
$path?: string;
|
|
53
|
-
$jsonPath?: string;
|
|
54
|
-
$regExp?: RegExp;
|
|
55
|
-
$regExpAnyOf?: RegExp[];
|
|
56
|
-
$value?: unknown;
|
|
57
|
-
$valueAnyOf?: unknown[];
|
|
58
|
-
$minimatch?: string;
|
|
59
|
-
$minimatchAnyOf?: string[];
|
|
39
|
+
export type TExpectationOperatorLocation = ConvertTupleToUnion<typeof LExpectationOperatorLocation>;
|
|
40
|
+
export declare const LExpectationOperatorLocation: readonly ["error", "delay", "state", "seed", "path", "method", "incoming.body", "incoming.bodyRaw", "incoming.query", "incoming.headers", "outgoing.status", "outgoing.headers", "outgoing.data", "outgoing.dataRaw"];
|
|
41
|
+
export type TExpectationOperatorObjectLocation = 'state' | 'incoming.body' | 'incoming.headers' | 'incoming.query' | 'outgoing.data' | 'outgoing.headers';
|
|
42
|
+
export type TExpectationOperators = Omit<typeof operators, 'root'>;
|
|
43
|
+
export interface IExpectationOperatorContext extends Pick<HttpRequestContext['TPlain'], 'incoming' | 'outgoing'> {
|
|
44
|
+
state: Record<string, unknown>;
|
|
45
|
+
window?: Record<string, unknown>;
|
|
46
|
+
seed?: number;
|
|
47
|
+
delay?: number;
|
|
60
48
|
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
49
|
+
type ConvertExpectationLocationToContextPath<TLocation extends TExpectationOperatorLocation> = TLocation extends 'path' | 'method' | 'error' | 'delay' ? {
|
|
50
|
+
path: 'incoming.path';
|
|
51
|
+
delay: 'incoming.delay';
|
|
52
|
+
error: 'incoming.error';
|
|
53
|
+
method: 'incoming.method';
|
|
54
|
+
}[TLocation] : TLocation;
|
|
55
|
+
export type ExtractExpectationContextValueByLocation<TContext extends object, TLocation extends TExpectationOperatorLocation, T = ExtractObjectValueByPath<TContext, ConvertExpectationLocationToContextPath<TLocation>>, U = ExtractObjectValueByPath<IExpectationOperatorContext, ConvertExpectationLocationToContextPath<TLocation>>> = Exclude<T, never> extends never ? Exclude<U, never> extends never ? any : U : T;
|
|
56
|
+
export type ExtractExpectationContextValue<TContext extends PartialDeep<IExpectationOperatorContext>, TLocation extends TExpectationOperatorLocation, TPath extends string | void = void, T = ExtractExpectationContextValueByLocation<TContext, TLocation>, U = TPath extends string ? T extends object ? ExtractObjectValueByPath<T, TPath> : any : T> = Exclude<U, never> extends never ? any : U;
|
|
57
|
+
export type CompileExpectationOperatorValue<TContext extends PartialDeep<IExpectationOperatorContext>, TLocation extends TExpectationOperatorLocation, TProvided = void, T = ExtractExpectationContextValue<TContext, TLocation>> = Exclude<TProvided, void> extends never ? T : TProvided;
|
|
58
|
+
export type CompileExpectationOperatorValueWithPredicate<TContext extends PartialDeep<IExpectationOperatorContext>, TLocation extends TExpectationOperatorLocation, TProvided = void, T = CompileExpectationOperatorValue<TContext, TLocation, TProvided>> = T extends object ? (T | object) : T;
|
|
59
|
+
export interface IExpectationOperatorsSchema<TContext extends PartialDeep<IExpectationOperatorContext> = IExpectationOperatorContext, TLocation extends TExpectationOperatorLocation = TExpectationOperatorLocation, TValue = void> {
|
|
60
|
+
$and?: AndExpectationOperator<TContext, TLocation, TValue>['TSchema'];
|
|
61
|
+
$or?: OrExpectationOperator<TContext, TLocation, TValue>['TSchema'];
|
|
62
|
+
$not?: NotExpectationOperator<TContext, TLocation, TValue>['TSchema'];
|
|
63
|
+
$if?: IfExpectationOperator<TContext, TLocation, TValue>['TSchema'];
|
|
64
|
+
$switch?: SwitchExpectationOperator<TContext, TLocation, TValue, TLocation, TValue>['TSchema'];
|
|
65
|
+
$set?: SetExpectationOperator<TContext, TLocation, TValue>['TSchema'];
|
|
66
|
+
$has?: HasExpectationOperator<TContext, TLocation, TValue>['TSchema'];
|
|
67
|
+
$merge?: MergeExpectationOperator<TContext, TLocation, TValue>['TSchema'];
|
|
68
|
+
$remove?: RemoveExpectationOperator<TContext, TLocation>['TSchema'];
|
|
69
|
+
$exec?: ExecExpectationOperator<TContext>['TSchema'];
|
|
68
70
|
}
|
|
69
|
-
export interface IExpectationSchema<
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
71
|
+
export interface IExpectationSchema<TContext extends PartialDeep<IExpectationOperatorContext> = {}> {
|
|
72
|
+
request?: IExpectationOperatorsSchema<TContext>;
|
|
73
|
+
response?: IExpectationOperatorsSchema<TContext>;
|
|
74
|
+
forward?: {
|
|
75
|
+
url?: string;
|
|
76
|
+
baseUrl?: string;
|
|
77
|
+
timeout?: number;
|
|
78
|
+
proxy?: AxiosProxyConfig & {
|
|
79
|
+
protocol: TRequestProtocol;
|
|
80
|
+
};
|
|
77
81
|
};
|
|
78
|
-
$not?: Pick<IExpectationSchema<T>, T['operator']>;
|
|
79
|
-
$and?: Pick<IExpectationSchema<T>, T['operator']>[];
|
|
80
|
-
$or?: Pick<IExpectationSchema<T>, T['operator']>[];
|
|
81
|
-
$exec?: string | TFunction<unknown, [{
|
|
82
|
-
_: typeof _;
|
|
83
|
-
context: T['context'];
|
|
84
|
-
}]>;
|
|
85
82
|
}
|
|
86
|
-
export
|
|
83
|
+
export interface IExpectationOperatorExecUtils<T extends PartialDeep<IExpectationOperatorContext>> {
|
|
84
|
+
context: IExpectationOperatorContext & T;
|
|
85
|
+
T: <T = any>(payload: unknown) => T;
|
|
86
|
+
_: typeof _;
|
|
87
|
+
d: typeof dayjs;
|
|
88
|
+
faker: typeof faker;
|
|
89
|
+
}
|
|
90
|
+
export {};
|
|
87
91
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/expectations/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/expectations/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,OAAO,CAAC;AAC9C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAE5B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAEjD,OAAO,KAAK,KAAK,SAAS,MAAM,aAAa,CAAC;AAE9C,OAAO,KAAK,sBAAsB,MAAM,0BAA0B,CAAC;AACnE,OAAO,KAAK,sBAAsB,MAAM,0BAA0B,CAAC;AACnE,OAAO,KAAK,sBAAsB,MAAM,0BAA0B,CAAC;AACnE,OAAO,KAAK,qBAAqB,MAAM,yBAAyB,CAAC;AACjE,OAAO,KAAK,sBAAsB,MAAM,0BAA0B,CAAC;AACnE,OAAO,KAAK,qBAAqB,MAAM,yBAAyB,CAAC;AACjE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;YACzB,QAAQ,EAAE,gBAAgB,CAAC;SAC5B,CAAC;KACH,CAAC;CACH;AAED,MAAM,WAAW,6BAA6B,CAAC,CAAC,SAAS,WAAW,CAAC,2BAA2B,CAAC;IAC/F,OAAO,EAAE,2BAA2B,GAAG,CAAC,CAAC;IACzC,CAAC,EAAE,CAAC,CAAC,GAAG,GAAG,EAAE,OAAO,EAAE,OAAO,KAAK,CAAC,CAAC;IAEpC,CAAC,EAAE,OAAO,CAAC,CAAC;IACZ,CAAC,EAAE,OAAO,KAAK,CAAC;IAChB,KAAK,EAAE,OAAO,KAAK,CAAC;CACrB"}
|
|
@@ -1,15 +1,29 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.LExpectationOperatorLocation = exports.LExpectationAttachlessOperator = exports.LExpectationActionalOperator = exports.LExpectationConditionalOperator = exports.LExpectationDestroyType = exports.LExpectationForwardProtocol = exports.LExpectationType = void 0;
|
|
4
4
|
exports.LExpectationType = ['HTTP'];
|
|
5
5
|
exports.LExpectationForwardProtocol = ['HTTP', 'HTTPS'];
|
|
6
6
|
exports.LExpectationDestroyType = ['ECONNABORTED'];
|
|
7
|
-
exports.LExpectationOperatorLocation = ['path', 'method', 'headers', 'body', 'query', 'data', 'statusCode'];
|
|
8
7
|
exports.LExpectationConditionalOperator = ['$if', '$not', '$and', '$or', '$has'];
|
|
9
8
|
exports.LExpectationActionalOperator = ['$set', '$remove', '$merge', '$exec'];
|
|
10
9
|
exports.LExpectationAttachlessOperator = [...exports.LExpectationActionalOperator, '$has'];
|
|
11
10
|
;
|
|
12
|
-
|
|
11
|
+
exports.LExpectationOperatorLocation = [
|
|
12
|
+
'error',
|
|
13
|
+
'delay',
|
|
14
|
+
'state',
|
|
15
|
+
'seed',
|
|
16
|
+
'path',
|
|
17
|
+
'method',
|
|
18
|
+
'incoming.body',
|
|
19
|
+
'incoming.bodyRaw',
|
|
20
|
+
'incoming.query',
|
|
21
|
+
'incoming.headers',
|
|
22
|
+
'outgoing.status',
|
|
23
|
+
'outgoing.headers',
|
|
24
|
+
'outgoing.data',
|
|
25
|
+
'outgoing.dataRaw',
|
|
26
|
+
];
|
|
13
27
|
;
|
|
14
28
|
;
|
|
15
29
|
;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/expectations/types.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/expectations/types.ts"],"names":[],"mappings":";;;AAsBa,QAAA,gBAAgB,GAAU,CAAC,MAAM,CAAC,CAAC;AAGnC,QAAA,2BAA2B,GAAU,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAGvD,QAAA,uBAAuB,GAAU,CAAC,cAAc,CAAC,CAAC;AAGlD,QAAA,+BAA+B,GAAU,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;AAGhF,QAAA,4BAA4B,GAAU,CAAC,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;AAG7E,QAAA,8BAA8B,GAAU,CAAC,GAAG,oCAA4B,EAAE,MAAM,CAAC,CAAC;AAU9F,CAAC;AAKW,QAAA,4BAA4B,GAAU;IACjD,OAAO;IACP,OAAO;IACP,OAAO;IACP,MAAM;IAEN,MAAM;IACN,QAAQ;IACR,eAAe;IACf,kBAAkB;IAClB,gBAAgB;IAChB,kBAAkB;IAClB,iBAAiB;IACjB,kBAAkB;IAClB,eAAe;IACf,kBAAkB;CACnB,CAAC;AAkBD,CAAC;AA2DD,CAAC;AAeD,CAAC"}
|
|
@@ -1,12 +1,25 @@
|
|
|
1
|
-
import { IExpectationSchema,
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
$else?: Pick<IExpectationSchema<import("./types").IExpectationSchemaConfiguration>, TExpectationOperator> | undefined;
|
|
6
|
-
}, K extends keyof T = keyof T>(schema: T, handler: (key: K, schema: T) => unknown) => void;
|
|
7
|
-
export declare const extractMetaAdditionalFromExpectationSchema: (schema: IExpectationSchema) => {
|
|
8
|
-
requestPaths?: string[];
|
|
9
|
-
requestMethods?: string[];
|
|
10
|
-
responseStatuses?: number[];
|
|
1
|
+
import { IExpectationSchema, IExpectationOperatorContext, IExpectationOperatorsSchema, TExpectationOperatorLocation } from './types';
|
|
2
|
+
type TBaseExtractedContext = {
|
|
3
|
+
parent: object;
|
|
4
|
+
key: string;
|
|
11
5
|
};
|
|
6
|
+
type TExtractedContext = (TBaseExtractedContext & {
|
|
7
|
+
value?: unknown;
|
|
8
|
+
type: 'object';
|
|
9
|
+
}) | (TBaseExtractedContext & {
|
|
10
|
+
value?: string;
|
|
11
|
+
type: 'string';
|
|
12
|
+
}) | (TBaseExtractedContext & {
|
|
13
|
+
value?: number;
|
|
14
|
+
type: 'number';
|
|
15
|
+
});
|
|
16
|
+
export declare const checkIsLocationInContext: (location: TExpectationOperatorLocation, context: PartialDeep<IExpectationOperatorContext>) => boolean;
|
|
17
|
+
export declare const extractContextByLocation: (location: TExpectationOperatorLocation, context: PartialDeep<IExpectationOperatorContext>) => TExtractedContext | null;
|
|
18
|
+
export declare const introspectExpectationOperatorsSchema: <T extends object = IExpectationSchema<{}>, K extends keyof T = keyof T>(schema: T, handler: (key: K, schema: T, path: string) => unknown, location?: string) => void;
|
|
19
|
+
export declare const extractMetaAdditionalFromExpectationSchema: (schema: IExpectationOperatorsSchema) => {
|
|
20
|
+
paths?: string[];
|
|
21
|
+
methods?: string[];
|
|
22
|
+
statuses?: number[];
|
|
23
|
+
};
|
|
24
|
+
export {};
|
|
12
25
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/expectations/utils.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,kBAAkB,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/expectations/utils.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,kBAAkB,EAIlB,2BAA2B,EAC3B,2BAA2B,EAC3B,4BAA4B,EAC7B,MAAM,SAAS,CAAC;AAEjB,KAAK,qBAAqB,GAAG;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC;AAC7D,KAAK,iBAAiB,GAClB,CAAC,qBAAqB,GAAG;IAAE,KAAK,CAAC,EAAE,OAAO,CAAC;IAAC,IAAI,EAAE,QAAQ,CAAA;CAAE,CAAC,GAC7D,CAAC,qBAAqB,GAAG;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,QAAQ,CAAA;CAAE,CAAC,GAC5D,CAAC,qBAAqB,GAAG;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,QAAQ,CAAA;CAAE,CAAC,CAAC;AAEjE,eAAO,MAAM,wBAAwB,aACzB,4BAA4B,WAC7B,WAAW,CAAC,2BAA2B,CAAC,KAChD,OASF,CAAA;AAED,eAAO,MAAM,wBAAwB,aACzB,4BAA4B,WAC7B,WAAW,CAAC,2BAA2B,CAAC,KAChD,iBAAiB,GAAG,IAsGtB,CAAA;AAED,eAAO,MAAM,oCAAoC,GAAI,CAAC,SAAS,MAAM,2BAAuB,CAAC,SAAS,MAAM,CAAC,oBACnG,CAAC,WACA,CAAC,GAAG,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,KAAK,OAAO,aAC3C,MAAM,KACf,IAUF,CAAA;AAED,eAAO,MAAM,0CAA0C,WAAY,2BAA2B;;;;CA+B7F,CAAA"}
|
|
@@ -1,86 +1,144 @@
|
|
|
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
4
|
};
|
|
28
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.extractMetaAdditionalFromExpectationSchema = exports.
|
|
6
|
+
exports.extractMetaAdditionalFromExpectationSchema = exports.introspectExpectationOperatorsSchema = exports.extractContextByLocation = exports.checkIsLocationInContext = void 0;
|
|
30
7
|
const lodash_1 = __importDefault(require("lodash"));
|
|
31
8
|
const types_1 = require("./types");
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
case '
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
9
|
+
const checkIsLocationInContext = (location, context) => {
|
|
10
|
+
switch (location) {
|
|
11
|
+
case 'delay':
|
|
12
|
+
case 'error':
|
|
13
|
+
case 'method':
|
|
14
|
+
case 'path': return lodash_1.default.has(context.incoming, location);
|
|
15
|
+
default: return lodash_1.default.has(context, location);
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
exports.checkIsLocationInContext = checkIsLocationInContext;
|
|
19
|
+
const extractContextByLocation = (location, context) => {
|
|
20
|
+
switch (location) {
|
|
21
|
+
case 'path': return {
|
|
22
|
+
key: 'incoming.path',
|
|
23
|
+
type: 'string',
|
|
24
|
+
parent: context,
|
|
25
|
+
value: context.incoming?.path,
|
|
26
|
+
};
|
|
27
|
+
case 'method': return {
|
|
28
|
+
key: 'incoming.method',
|
|
29
|
+
type: 'string',
|
|
30
|
+
parent: context,
|
|
31
|
+
value: context.incoming?.method,
|
|
32
|
+
};
|
|
33
|
+
case 'incoming.body': return {
|
|
34
|
+
key: 'incoming.body',
|
|
35
|
+
type: 'object',
|
|
36
|
+
parent: context,
|
|
37
|
+
value: context.incoming?.body,
|
|
38
|
+
};
|
|
39
|
+
case 'incoming.bodyRaw': return {
|
|
40
|
+
key: 'incoming.bodyRaw',
|
|
41
|
+
type: 'string',
|
|
42
|
+
parent: context,
|
|
43
|
+
value: context.incoming?.bodyRaw,
|
|
44
|
+
};
|
|
45
|
+
case 'incoming.query': return {
|
|
46
|
+
key: 'incoming.query',
|
|
47
|
+
type: 'object',
|
|
48
|
+
parent: context,
|
|
49
|
+
value: context.incoming?.query,
|
|
50
|
+
};
|
|
51
|
+
case 'incoming.headers': return {
|
|
52
|
+
key: 'incoming.headers',
|
|
53
|
+
type: 'object',
|
|
54
|
+
parent: context,
|
|
55
|
+
value: context.incoming?.headers,
|
|
56
|
+
};
|
|
57
|
+
case 'outgoing.data': return {
|
|
58
|
+
key: 'outgoing.data',
|
|
59
|
+
type: 'object',
|
|
60
|
+
parent: context,
|
|
61
|
+
value: context.outgoing?.data,
|
|
62
|
+
};
|
|
63
|
+
case 'outgoing.dataRaw': return {
|
|
64
|
+
key: 'outgoing.dataRaw',
|
|
65
|
+
type: 'string',
|
|
66
|
+
parent: context,
|
|
67
|
+
value: context.outgoing?.dataRaw,
|
|
68
|
+
};
|
|
69
|
+
case 'outgoing.headers': return {
|
|
70
|
+
key: 'outgoing.headers',
|
|
71
|
+
type: 'object',
|
|
72
|
+
parent: context,
|
|
73
|
+
value: context.outgoing?.headers,
|
|
74
|
+
};
|
|
75
|
+
case 'outgoing.status': return {
|
|
76
|
+
key: 'outgoing.status',
|
|
77
|
+
type: 'number',
|
|
78
|
+
parent: context,
|
|
79
|
+
value: context.outgoing?.status,
|
|
80
|
+
};
|
|
81
|
+
case 'delay': return {
|
|
82
|
+
key: 'incoming.delay',
|
|
83
|
+
type: 'number',
|
|
84
|
+
parent: context,
|
|
85
|
+
value: context.incoming?.delay,
|
|
86
|
+
};
|
|
87
|
+
case 'error': return {
|
|
88
|
+
key: 'incoming.error',
|
|
89
|
+
type: 'string',
|
|
90
|
+
parent: context,
|
|
91
|
+
value: context.incoming?.error,
|
|
92
|
+
};
|
|
93
|
+
case 'seed': return {
|
|
94
|
+
key: 'seed',
|
|
95
|
+
type: 'number',
|
|
96
|
+
parent: context,
|
|
97
|
+
value: context.seed,
|
|
98
|
+
};
|
|
99
|
+
case 'state': return {
|
|
100
|
+
key: 'state',
|
|
101
|
+
type: 'object',
|
|
102
|
+
parent: context,
|
|
103
|
+
value: context.state,
|
|
104
|
+
};
|
|
105
|
+
default: return null;
|
|
49
106
|
}
|
|
50
107
|
};
|
|
51
|
-
exports.
|
|
52
|
-
const
|
|
108
|
+
exports.extractContextByLocation = extractContextByLocation;
|
|
109
|
+
const introspectExpectationOperatorsSchema = (schema, handler, location = '') => {
|
|
53
110
|
Object.keys(schema).forEach((key) => {
|
|
54
|
-
|
|
111
|
+
const path = location ? `${location}.${String(key)}` : String(key);
|
|
112
|
+
handler(key, schema, path);
|
|
55
113
|
if (lodash_1.default.isObject(schema[key]) && !types_1.LExpectationAttachlessOperator.includes(key)) {
|
|
56
|
-
(0, exports.
|
|
114
|
+
(0, exports.introspectExpectationOperatorsSchema)(schema[key], handler, path);
|
|
57
115
|
}
|
|
58
116
|
});
|
|
59
117
|
};
|
|
60
|
-
exports.
|
|
118
|
+
exports.introspectExpectationOperatorsSchema = introspectExpectationOperatorsSchema;
|
|
61
119
|
const extractMetaAdditionalFromExpectationSchema = (schema) => {
|
|
62
120
|
const acc = {};
|
|
63
|
-
(0, exports.
|
|
64
|
-
if (key === '$set' && segment[key]?.$location === '
|
|
65
|
-
acc.
|
|
121
|
+
(0, exports.introspectExpectationOperatorsSchema)(schema, (key, segment) => {
|
|
122
|
+
if (key === '$set' && segment[key]?.$location === 'outgoing.status') {
|
|
123
|
+
acc.statuses = (acc.statuses ?? []).concat([segment[key]?.$value].filter(Boolean));
|
|
66
124
|
}
|
|
67
125
|
if (key === '$has' && ['method', 'path'].includes(segment[key]?.$location ?? '')) {
|
|
68
126
|
const valuePredicate = segment[key]?.$value
|
|
69
127
|
?? segment[key]?.$valueAnyOf
|
|
70
|
-
?? segment[key]?.$
|
|
71
|
-
?? segment[key]?.$
|
|
128
|
+
?? segment[key]?.$match
|
|
129
|
+
?? segment[key]?.$matchAnyOf
|
|
72
130
|
?? segment[key]?.$regExp
|
|
73
131
|
?? segment[key]?.$regExpAnyOf
|
|
74
132
|
?? [];
|
|
75
133
|
switch (segment[key]?.$location) {
|
|
76
134
|
case 'method':
|
|
77
135
|
{
|
|
78
|
-
acc.
|
|
136
|
+
acc.methods = (acc.methods ?? []).concat(lodash_1.default.flatten([valuePredicate]).map(String));
|
|
79
137
|
break;
|
|
80
138
|
}
|
|
81
139
|
;
|
|
82
140
|
case 'path': {
|
|
83
|
-
acc.
|
|
141
|
+
acc.paths = (acc.paths ?? []).concat(lodash_1.default.flatten([valuePredicate]).map(String));
|
|
84
142
|
break;
|
|
85
143
|
}
|
|
86
144
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/expectations/utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/expectations/utils.ts"],"names":[],"mappings":";;;;;;AAAA,oDAAuB;AAEvB,mCAQiB;AAQV,MAAM,wBAAwB,GAAG,CACtC,QAAsC,EACtC,OAAiD,EACxC,EAAE;IACX,QAAO,QAAQ,EAAE,CAAC;QAChB,KAAK,OAAO,CAAC;QACb,KAAK,OAAO,CAAC;QACb,KAAK,QAAQ,CAAC;QACd,KAAK,MAAM,CAAC,CAAC,OAAO,gBAAC,CAAC,GAAG,CAAC,OAAO,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;QAEtD,OAAO,CAAC,CAAC,OAAO,gBAAC,CAAC,GAAG,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;IAC3C,CAAC;AACH,CAAC,CAAA;AAZY,QAAA,wBAAwB,4BAYpC;AAEM,MAAM,wBAAwB,GAAG,CACtC,QAAsC,EACtC,OAAiD,EACvB,EAAE;IAC5B,QAAO,QAAQ,EAAE,CAAC;QAChB,KAAK,MAAM,CAAC,CAAC,OAAO;YAClB,GAAG,EAAE,eAAe;YACpB,IAAI,EAAE,QAAQ;YACd,MAAM,EAAE,OAAO;YACf,KAAK,EAAE,OAAO,CAAC,QAAQ,EAAE,IAAI;SAC9B,CAAC;QAEF,KAAK,QAAQ,CAAC,CAAC,OAAO;YACpB,GAAG,EAAE,iBAAiB;YACtB,IAAI,EAAE,QAAQ;YACd,MAAM,EAAE,OAAO;YACf,KAAK,EAAE,OAAO,CAAC,QAAQ,EAAE,MAAM;SAChC,CAAC;QAEF,KAAK,eAAe,CAAC,CAAC,OAAO;YAC3B,GAAG,EAAE,eAAe;YACpB,IAAI,EAAE,QAAQ;YACd,MAAM,EAAE,OAAO;YACf,KAAK,EAAE,OA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ACd,GAAG,CAAC,OAAO,GAAG,CAAC,GAAG,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,gBAAC,CAAC,OAAO,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC;wBAClF,MAAM;oBACR,CAAC;oBAAA,CAAC;gBACF,KAAK,MAAM,CAAC,CAAC,CAAC;oBACZ,GAAG,CAAC,KAAK,GAAG,CAAC,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,gBAAC,CAAC,OAAO,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC;oBAC9E,MAAM;gBACR,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,GAAG,CAAC;AACb,CAAC,CAAA;AA/BY,QAAA,0CAA0C,8CA+BtD"}
|
|
@@ -2,17 +2,22 @@ import { Endpoint } from '../models';
|
|
|
2
2
|
export interface IGetConfigResponsePayload {
|
|
3
3
|
historyRecordsLimit: number;
|
|
4
4
|
}
|
|
5
|
-
declare const _default: Endpoint<IGetConfigResponsePayload,
|
|
5
|
+
declare const _default: Endpoint<IGetConfigResponsePayload, {}> & {
|
|
6
6
|
http: {
|
|
7
7
|
readonly method: "GET";
|
|
8
8
|
readonly path: "/_mock/config";
|
|
9
9
|
};
|
|
10
10
|
} & {
|
|
11
|
-
|
|
11
|
+
ws: {
|
|
12
12
|
readonly path: "config:get";
|
|
13
13
|
};
|
|
14
14
|
} & {
|
|
15
|
-
handler: ({ reply,
|
|
15
|
+
handler: ({ reply, server }: (import("../models").HttpRequestContext<IGetConfigResponsePayload> | import("../models").WsRequestContext<IGetConfigResponsePayload>) & {
|
|
16
|
+
incoming: OmitPartial<{
|
|
17
|
+
body: void | undefined;
|
|
18
|
+
query: void | undefined;
|
|
19
|
+
}>;
|
|
20
|
+
}) => Promise<void>;
|
|
16
21
|
};
|
|
17
22
|
export default _default;
|
|
18
23
|
//# sourceMappingURL=config.get.endpoint.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.get.endpoint.d.ts","sourceRoot":"","sources":["../../../../src/server/endpoints/config.get.endpoint.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAErC,MAAM,WAAW,yBAAyB;IACxC,mBAAmB,EAAE,MAAM,CAAC;CAC7B
|
|
1
|
+
{"version":3,"file":"config.get.endpoint.d.ts","sourceRoot":"","sources":["../../../../src/server/endpoints/config.get.endpoint.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAErC,MAAM,WAAW,yBAAyB;IACxC,mBAAmB,EAAE,MAAM,CAAC;CAC7B;;;;;;;;;;;;;;;;;;AAED,wBAMI"}
|
|
@@ -4,8 +4,6 @@ const models_1 = require("../models");
|
|
|
4
4
|
exports.default = models_1.Endpoint
|
|
5
5
|
.build()
|
|
6
6
|
.bindToHttp({ method: 'GET', path: '/_mock/config' })
|
|
7
|
-
.
|
|
8
|
-
.assignHandler(async ({ reply,
|
|
9
|
-
historyRecordsLimit: config.server.historyRecordsLimit,
|
|
10
|
-
}));
|
|
7
|
+
.bindToWs({ path: 'config:get' })
|
|
8
|
+
.assignHandler(async ({ reply, server }) => reply.ok({ historyRecordsLimit: server.config.server.historyRecordsLimit }));
|
|
11
9
|
//# sourceMappingURL=config.get.endpoint.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.get.endpoint.js","sourceRoot":"","sources":["../../../../src/server/endpoints/config.get.endpoint.ts"],"names":[],"mappings":";;AACA,sCAAqC;AAMrC,kBAAe,iBAAQ;KACpB,KAAK,EAA6B;KAClC,UAAU,CAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,eAAe,EAAE,CAAC;KAC3D,
|
|
1
|
+
{"version":3,"file":"config.get.endpoint.js","sourceRoot":"","sources":["../../../../src/server/endpoints/config.get.endpoint.ts"],"names":[],"mappings":";;AACA,sCAAqC;AAMrC,kBAAe,iBAAQ;KACpB,KAAK,EAA6B;KAClC,UAAU,CAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,eAAe,EAAE,CAAC;KAC3D,QAAQ,CAAQ,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC;KACvC,aAAa,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,CACzC,KAAK,CAAC,EAAE,CAAC,EAAE,mBAAmB,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,mBAAmB,EAAE,CAAC,CAC5E,CAAC"}
|
|
@@ -1,21 +1,19 @@
|
|
|
1
|
-
import { Expectation } from '../../expectations';
|
|
1
|
+
import { Expectation, TBuildExpectationConfiguration } from '../../expectations';
|
|
2
2
|
import { Endpoint } from '../models';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
id: string;
|
|
6
|
-
}, {
|
|
7
|
-
body: TBody;
|
|
3
|
+
declare const _default: Endpoint<Pick<Expectation<{}>, "name" | "type" | "schema" | "id" | "isEnabled" | "meta">, {
|
|
4
|
+
body: TBuildExpectationConfiguration<any>;
|
|
8
5
|
}> & {
|
|
9
6
|
http: {
|
|
10
7
|
readonly method: "POST";
|
|
11
8
|
readonly path: "/_mock/expectations";
|
|
12
9
|
};
|
|
13
10
|
} & {
|
|
14
|
-
handler: ({ reply,
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
11
|
+
handler: ({ reply, incoming, server }: (import("../models").HttpRequestContext<Pick<Expectation<{}>, "name" | "type" | "schema" | "id" | "isEnabled" | "meta">> | import("../models").WsRequestContext<Pick<Expectation<{}>, "name" | "type" | "schema" | "id" | "isEnabled" | "meta">>) & {
|
|
12
|
+
incoming: OmitPartial<{
|
|
13
|
+
body: TBuildExpectationConfiguration<any>;
|
|
14
|
+
query: void | undefined;
|
|
15
|
+
}>;
|
|
16
|
+
}) => Promise<void>;
|
|
19
17
|
};
|
|
20
18
|
export default _default;
|
|
21
19
|
//# sourceMappingURL=expectations.create.endpoint.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expectations.create.endpoint.d.ts","sourceRoot":"","sources":["../../../../src/server/endpoints/expectations.create.endpoint.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"expectations.create.endpoint.d.ts","sourceRoot":"","sources":["../../../../src/server/endpoints/expectations.create.endpoint.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,8BAA8B,EAAE,MAAM,oBAAoB,CAAC;AACjF,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;;UAGG,8BAA8B,CAAC,GAAG,CAAC;;;;;;;;;;;;;;AAD3E,wBAKK"}
|
|
@@ -4,8 +4,7 @@ const models_1 = require("../models");
|
|
|
4
4
|
exports.default = models_1.Endpoint
|
|
5
5
|
.build()
|
|
6
6
|
.bindToHttp({ method: 'POST', path: '/_mock/expectations' })
|
|
7
|
-
.assignHandler(async ({ reply,
|
|
8
|
-
|
|
9
|
-
reply.ok({ id: result.id });
|
|
7
|
+
.assignHandler(async ({ reply, incoming, server }) => {
|
|
8
|
+
reply.ok(await server.client.createExpectation(incoming.body));
|
|
10
9
|
});
|
|
11
10
|
//# sourceMappingURL=expectations.create.endpoint.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expectations.create.endpoint.js","sourceRoot":"","sources":["../../../../src/server/endpoints/expectations.create.endpoint.ts"],"names":[],"mappings":";;AACA,sCAAqC;
|
|
1
|
+
{"version":3,"file":"expectations.create.endpoint.js","sourceRoot":"","sources":["../../../../src/server/endpoints/expectations.create.endpoint.ts"],"names":[],"mappings":";;AACA,sCAAqC;AAErC,kBAAe,iBAAQ;KACpB,KAAK,EAAwE;KAC7E,UAAU,CAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,qBAAqB,EAAE,CAAC;KAClE,aAAa,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE;IACnD,KAAK,CAAC,EAAE,CAAC,MAAM,MAAM,CAAC,MAAM,CAAC,iBAAiB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;AACjE,CAAC,CAAC,CAAC"}
|