@n1k1t/mock-server 0.1.1 → 0.1.2
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 +3 -2
- package/lib/src/client/helpers/expectations.d.ts +91 -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 +2 -2
- 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 +5 -5
- 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 +219 -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 +35 -0
- package/lib/src/expectations/models/expectation.d.ts.map +1 -0
- package/lib/src/expectations/models/expectation.js +113 -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 +41 -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 +13 -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 +106 -70
- 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 +40 -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 +55 -56
- package/lib/src/expectations/types.d.ts.map +1 -1
- package/lib/src/expectations/types.js +13 -2
- package/lib/src/expectations/types.js.map +1 -1
- package/lib/src/expectations/utils.d.ts +19 -7
- package/lib/src/expectations/utils.d.ts.map +1 -1
- package/lib/src/expectations/utils.js +77 -50
- 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 +9 -18
- package/lib/src/server/index.js.map +1 -1
- package/lib/src/server/middlewares/add-history.middleware.d.ts +14 -4
- package/lib/src/server/middlewares/add-history.middleware.d.ts.map +1 -1
- package/lib/src/server/middlewares/add-history.middleware.js +5 -6
- package/lib/src/server/middlewares/add-history.middleware.js.map +1 -1
- package/lib/src/server/middlewares/destroy-request.midleware.d.ts +14 -4
- package/lib/src/server/middlewares/destroy-request.midleware.d.ts.map +1 -1
- package/lib/src/server/middlewares/destroy-request.midleware.js +4 -5
- package/lib/src/server/middlewares/destroy-request.midleware.js.map +1 -1
- package/lib/src/server/middlewares/handle-expectation-delay.middleware.d.ts +14 -4
- package/lib/src/server/middlewares/handle-expectation-delay.middleware.d.ts.map +1 -1
- package/lib/src/server/middlewares/handle-expectation-delay.middleware.js +1 -2
- package/lib/src/server/middlewares/handle-expectation-delay.middleware.js.map +1 -1
- package/lib/src/server/middlewares/handle-expectation-forward.middleware.d.ts +14 -4
- package/lib/src/server/middlewares/handle-expectation-forward.middleware.d.ts.map +1 -1
- package/lib/src/server/middlewares/handle-expectation-forward.middleware.js +31 -45
- package/lib/src/server/middlewares/handle-expectation-forward.middleware.js.map +1 -1
- package/lib/src/server/middlewares/index.d.ts +4 -4
- package/lib/src/server/middlewares/index.d.ts.map +1 -1
- package/lib/src/server/middlewares/index.js +9 -9
- package/lib/src/server/middlewares/index.js.map +1 -1
- package/lib/src/server/middlewares/internal-route.middleware.d.ts +14 -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/match-expectation.middleware.d.ts +18 -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/reply.middleware.d.ts +15 -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/middlewares/resolve-public.middleware.d.ts +14 -2
- package/lib/src/server/middlewares/resolve-public.middleware.d.ts.map +1 -1
- package/lib/src/server/middlewares/resolve-public.middleware.js +11 -11
- package/lib/src/server/middlewares/resolve-public.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 +18 -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 +42 -0
- package/lib/src/server/models/request-context/http.d.ts.map +1 -0
- package/lib/src/server/models/request-context/http.js +51 -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 +14 -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 +105 -137
- 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 +3 -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/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,24 @@
|
|
|
1
|
+
import type { AxiosProxyConfig } from 'axios';
|
|
1
2
|
import type _ from 'lodash';
|
|
2
|
-
import type {
|
|
3
|
+
import type { HttpRequestContext } from '../server/models';
|
|
4
|
+
import type { TRequestProtocol } from '../types';
|
|
5
|
+
import type * as operators from './operators';
|
|
6
|
+
import type AndExpectationOperator from './operators/and.operator';
|
|
7
|
+
import type SetExpectationOperator from './operators/set.operator';
|
|
8
|
+
import type HasExpectationOperator from './operators/has.operator';
|
|
9
|
+
import type OrExpectationOperator from './operators/or.operator';
|
|
10
|
+
import type NotExpectationOperator from './operators/not.operator';
|
|
11
|
+
import type IfExpectationOperator from './operators/if.operator';
|
|
12
|
+
import type MergeExpectationOperator from './operators/merge.operator';
|
|
13
|
+
import type RemoveExpectationOperator from './operators/remove.operator';
|
|
14
|
+
import type ExecExpectationOperator from './operators/exec.operator';
|
|
15
|
+
import type SwitchExpectationOperator from './operators/switch.operator';
|
|
3
16
|
export type TExpectationType = ConvertTupleToUnion<typeof LExpectationType>;
|
|
4
17
|
export declare const LExpectationType: readonly ["HTTP"];
|
|
5
18
|
export type TExpectationForwardProtocol = ConvertTupleToUnion<typeof LExpectationForwardProtocol>;
|
|
6
19
|
export declare const LExpectationForwardProtocol: readonly ["HTTP", "HTTPS"];
|
|
7
20
|
export type TExpectationDestroyType = ConvertTupleToUnion<typeof LExpectationDestroyType>;
|
|
8
21
|
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
22
|
export type TExpectationConditionalOperator = ConvertTupleToUnion<typeof LExpectationConditionalOperator>;
|
|
12
23
|
export declare const LExpectationConditionalOperator: readonly ["$if", "$not", "$and", "$or", "$has"];
|
|
13
24
|
export type TExpectationActionalOperator = ConvertTupleToUnion<typeof LExpectationActionalOperator>;
|
|
@@ -27,61 +38,49 @@ export interface IExpectationDelay {
|
|
|
27
38
|
times?: number;
|
|
28
39
|
}
|
|
29
40
|
export type TExpectationContextLocation = 'request' | 'response';
|
|
30
|
-
export type
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
export type TExpectationOperatorMode = 'validation' | 'manipulation';
|
|
35
|
-
export type TExpectationOperatorHandlerParameters<K extends TExpectationOperator = TExpectationOperator> = [
|
|
36
|
-
TExpectationOperatorMode,
|
|
37
|
-
NonNullable<IExpectationSchema[K]>,
|
|
38
|
-
TExpectationContext
|
|
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[];
|
|
41
|
+
export type TExpectationOperatorLocation = ConvertTupleToUnion<typeof LExpectationOperatorLocation>;
|
|
42
|
+
export declare const LExpectationOperatorLocation: readonly ["path", "method", "incoming.body", "incoming.bodyRaw", "incoming.query", "incoming.headers", "outgoing.status", "outgoing.headers", "outgoing.data", "outgoing.dataRaw"];
|
|
43
|
+
export type TExpectationOperators = Omit<typeof operators, 'root'>;
|
|
44
|
+
export interface IExpectationOperatorContext extends Pick<HttpRequestContext, 'incoming' | 'outgoing'> {
|
|
60
45
|
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
46
|
+
type ConvertExpectationLocationToContextPath<TLocation extends TExpectationOperatorLocation> = TLocation extends 'path' | 'method' ? {
|
|
47
|
+
path: 'incoming.path';
|
|
48
|
+
method: 'incoming.method';
|
|
49
|
+
}[TLocation] : TLocation;
|
|
50
|
+
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;
|
|
51
|
+
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;
|
|
52
|
+
export type CompileExpectationOperatorValue<TContext extends PartialDeep<IExpectationOperatorContext>, TLocation extends TExpectationOperatorLocation, TProvided = void, T = ExtractExpectationContextValue<TContext, TLocation>> = Exclude<TProvided, void> extends never ? T : TProvided;
|
|
53
|
+
export type CompileExpectationOperatorValueWithPredicate<TContext extends PartialDeep<IExpectationOperatorContext>, TLocation extends TExpectationOperatorLocation, TProvided = void, T = CompileExpectationOperatorValue<TContext, TLocation, TProvided>> = T extends object ? (T | object) : T;
|
|
54
|
+
export interface IExpectationOperatorsSchema<TContext extends PartialDeep<IExpectationOperatorContext> = IExpectationOperatorContext, TLocation extends TExpectationOperatorLocation = TExpectationOperatorLocation, TValue = void> {
|
|
55
|
+
$and?: AndExpectationOperator<TContext, TLocation, TValue>['TSchema'];
|
|
56
|
+
$or?: OrExpectationOperator<TContext, TLocation, TValue>['TSchema'];
|
|
57
|
+
$not?: NotExpectationOperator<TContext, TLocation, TValue>['TSchema'];
|
|
58
|
+
$if?: IfExpectationOperator<TContext, TLocation, TValue>['TSchema'];
|
|
59
|
+
$switch?: SwitchExpectationOperator<TContext, TLocation, TValue, TLocation, TValue>['TSchema'];
|
|
60
|
+
$set?: SetExpectationOperator<TContext, TLocation, TValue>['TSchema'];
|
|
61
|
+
$has?: HasExpectationOperator<TContext, TLocation, TValue>['TSchema'];
|
|
62
|
+
$merge?: MergeExpectationOperator<TContext, TLocation, TValue>['TSchema'];
|
|
63
|
+
$remove?: RemoveExpectationOperator<TContext, TLocation>['TSchema'];
|
|
64
|
+
$exec?: ExecExpectationOperator<TContext>['TSchema'];
|
|
68
65
|
}
|
|
69
|
-
export interface IExpectationSchema<
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
66
|
+
export interface IExpectationSchema<TContext extends PartialDeep<IExpectationOperatorContext> = {}> {
|
|
67
|
+
delay?: IExpectationDelay | IExpectationDelay[];
|
|
68
|
+
destroy?: 'ECONNABORTED';
|
|
69
|
+
request?: IExpectationOperatorsSchema<TContext, 'path' | 'method' | 'incoming.body' | 'incoming.bodyRaw' | 'incoming.query' | 'incoming.headers'>;
|
|
70
|
+
response?: IExpectationOperatorsSchema<TContext>;
|
|
71
|
+
forward?: {
|
|
72
|
+
url?: string;
|
|
73
|
+
baseUrl?: string;
|
|
74
|
+
timeout?: number;
|
|
75
|
+
proxy?: AxiosProxyConfig & {
|
|
76
|
+
protocol: TRequestProtocol;
|
|
77
|
+
};
|
|
77
78
|
};
|
|
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
79
|
}
|
|
86
|
-
export
|
|
80
|
+
export interface IExpectationOperatorExecUtils<T extends PartialDeep<IExpectationOperatorContext>> {
|
|
81
|
+
context: IExpectationOperatorContext & T;
|
|
82
|
+
T: <T = any>(payload: unknown) => T;
|
|
83
|
+
_: typeof _;
|
|
84
|
+
}
|
|
85
|
+
export {};
|
|
87
86
|
//# 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,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,OAAO,KAAK,wBAAwB,MAAM,4BAA4B,CAAC;AACvE,OAAO,KAAK,yBAAyB,MAAM,6BAA6B,CAAC;AACzE,OAAO,KAAK,uBAAuB,MAAM,2BAA2B,CAAC;AACrE,OAAO,KAAK,yBAAyB,MAAM,6BAA6B,CAAC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 @@
|
|
|
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
|
;
|
|
12
|
+
exports.LExpectationOperatorLocation = [
|
|
13
|
+
'path',
|
|
14
|
+
'method',
|
|
15
|
+
'incoming.body',
|
|
16
|
+
'incoming.bodyRaw',
|
|
17
|
+
'incoming.query',
|
|
18
|
+
'incoming.headers',
|
|
19
|
+
'outgoing.status',
|
|
20
|
+
'outgoing.headers',
|
|
21
|
+
'outgoing.data',
|
|
22
|
+
'outgoing.dataRaw',
|
|
23
|
+
];
|
|
13
24
|
;
|
|
14
25
|
;
|
|
15
26
|
;
|
|
@@ -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":";;;AAoBa,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;AAKD,CAAC;AAKW,QAAA,4BAA4B,GAAU;IACjD,MAAM;IACN,QAAQ;IACR,eAAe;IACf,kBAAkB;IAClB,gBAAgB;IAChB,kBAAkB;IAClB,iBAAiB;IACjB,kBAAkB;IAClB,eAAe;IACf,kBAAkB;CACnB,CAAA;AAGwG,CAAC;AAoDzG,CAAC;AAsBD,CAAC"}
|
|
@@ -1,12 +1,24 @@
|
|
|
1
|
-
import { IExpectationSchema,
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { IExpectationSchema, IExpectationOperatorContext, IExpectationOperatorsSchema, TExpectationOperatorLocation } from './types';
|
|
2
|
+
type TBaseExtractedContext = {
|
|
3
|
+
parent: object;
|
|
4
|
+
key: string;
|
|
5
|
+
};
|
|
6
|
+
type TExtractedContext = (TBaseExtractedContext & {
|
|
7
|
+
value: object;
|
|
8
|
+
type: 'object';
|
|
9
|
+
}) | (TBaseExtractedContext & {
|
|
10
|
+
value: string;
|
|
11
|
+
type: 'string';
|
|
12
|
+
}) | (TBaseExtractedContext & {
|
|
13
|
+
value: number;
|
|
14
|
+
type: 'number';
|
|
15
|
+
});
|
|
16
|
+
export declare const extractContextByLocation: (location: TExpectationOperatorLocation, context: PartialDeep<IExpectationOperatorContext>) => TExtractedContext | null;
|
|
17
|
+
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;
|
|
18
|
+
export declare const extractMetaAdditionalFromExpectationSchema: (schema: IExpectationOperatorsSchema) => {
|
|
8
19
|
requestPaths?: string[];
|
|
9
20
|
requestMethods?: string[];
|
|
10
21
|
responseStatuses?: number[];
|
|
11
22
|
};
|
|
23
|
+
export {};
|
|
12
24
|
//# 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,EAE7B,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,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,QAAQ,CAAA;CAAE,CAAC,GAC3D,CAAC,qBAAqB,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,QAAQ,CAAA;CAAE,CAAC,GAC3D,CAAC,qBAAqB,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,QAAQ,CAAA;CAAE,CAAC,CAAC;AAEhE,eAAO,MAAM,wBAAwB,aACzB,4BAA4B,WAC7B,WAAW,CAAC,2BAA2B,CAAC,KAChD,iBAAiB,GAAG,IA8EtB,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,74 +1,101 @@
|
|
|
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 = void 0;
|
|
30
7
|
const lodash_1 = __importDefault(require("lodash"));
|
|
31
8
|
const types_1 = require("./types");
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
}
|
|
43
|
-
case '
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}
|
|
9
|
+
const extractContextByLocation = (location, context) => {
|
|
10
|
+
if (!lodash_1.default.has(context, location) && location !== 'method' && location !== 'path') {
|
|
11
|
+
return null;
|
|
12
|
+
}
|
|
13
|
+
switch (location) {
|
|
14
|
+
case 'path': return {
|
|
15
|
+
key: 'path',
|
|
16
|
+
type: 'string',
|
|
17
|
+
parent: context.incoming,
|
|
18
|
+
value: context.incoming.path,
|
|
19
|
+
};
|
|
20
|
+
case 'method': return {
|
|
21
|
+
key: 'method',
|
|
22
|
+
type: 'string',
|
|
23
|
+
parent: context.incoming,
|
|
24
|
+
value: context.incoming.method,
|
|
25
|
+
};
|
|
26
|
+
case 'incoming.body': return {
|
|
27
|
+
key: 'body',
|
|
28
|
+
type: 'object',
|
|
29
|
+
parent: context.incoming,
|
|
30
|
+
value: context.incoming.body,
|
|
31
|
+
};
|
|
32
|
+
case 'incoming.bodyRaw': return {
|
|
33
|
+
key: 'bodyRaw',
|
|
34
|
+
type: 'string',
|
|
35
|
+
parent: context.incoming,
|
|
36
|
+
value: context.incoming.bodyRaw,
|
|
37
|
+
};
|
|
38
|
+
case 'incoming.query': return {
|
|
39
|
+
key: 'query',
|
|
40
|
+
type: 'object',
|
|
41
|
+
parent: context.incoming,
|
|
42
|
+
value: context.incoming.query,
|
|
43
|
+
};
|
|
44
|
+
case 'incoming.headers': return {
|
|
45
|
+
key: 'headers',
|
|
46
|
+
type: 'object',
|
|
47
|
+
parent: context.incoming,
|
|
48
|
+
value: context.incoming.headers,
|
|
49
|
+
};
|
|
50
|
+
case 'outgoing.data': return {
|
|
51
|
+
key: 'data',
|
|
52
|
+
type: 'object',
|
|
53
|
+
parent: context.outgoing,
|
|
54
|
+
value: context.outgoing.data,
|
|
55
|
+
};
|
|
56
|
+
case 'outgoing.dataRaw': return {
|
|
57
|
+
key: 'dataRaw',
|
|
58
|
+
type: 'string',
|
|
59
|
+
parent: context.outgoing,
|
|
60
|
+
value: context.outgoing.dataRaw,
|
|
61
|
+
};
|
|
62
|
+
case 'outgoing.headers': return {
|
|
63
|
+
key: 'headers',
|
|
64
|
+
type: 'object',
|
|
65
|
+
parent: context.outgoing,
|
|
66
|
+
value: context.outgoing.headers,
|
|
67
|
+
};
|
|
68
|
+
case 'outgoing.status': return {
|
|
69
|
+
key: 'status',
|
|
70
|
+
type: 'number',
|
|
71
|
+
parent: context.outgoing,
|
|
72
|
+
value: context.outgoing.status,
|
|
73
|
+
};
|
|
74
|
+
default: return null;
|
|
49
75
|
}
|
|
50
76
|
};
|
|
51
|
-
exports.
|
|
52
|
-
const
|
|
77
|
+
exports.extractContextByLocation = extractContextByLocation;
|
|
78
|
+
const introspectExpectationOperatorsSchema = (schema, handler, location = '') => {
|
|
53
79
|
Object.keys(schema).forEach((key) => {
|
|
54
|
-
|
|
80
|
+
const path = location ? `${location}.${String(key)}` : String(key);
|
|
81
|
+
handler(key, schema, path);
|
|
55
82
|
if (lodash_1.default.isObject(schema[key]) && !types_1.LExpectationAttachlessOperator.includes(key)) {
|
|
56
|
-
(0, exports.
|
|
83
|
+
(0, exports.introspectExpectationOperatorsSchema)(schema[key], handler, path);
|
|
57
84
|
}
|
|
58
85
|
});
|
|
59
86
|
};
|
|
60
|
-
exports.
|
|
87
|
+
exports.introspectExpectationOperatorsSchema = introspectExpectationOperatorsSchema;
|
|
61
88
|
const extractMetaAdditionalFromExpectationSchema = (schema) => {
|
|
62
89
|
const acc = {};
|
|
63
|
-
(0, exports.
|
|
64
|
-
if (key === '$set' && segment[key]?.$location === '
|
|
90
|
+
(0, exports.introspectExpectationOperatorsSchema)(schema, (key, segment) => {
|
|
91
|
+
if (key === '$set' && segment[key]?.$location === 'outgoing.status') {
|
|
65
92
|
acc.responseStatuses = (acc.responseStatuses ?? []).concat([segment[key]?.$value].filter(Boolean));
|
|
66
93
|
}
|
|
67
94
|
if (key === '$has' && ['method', 'path'].includes(segment[key]?.$location ?? '')) {
|
|
68
95
|
const valuePredicate = segment[key]?.$value
|
|
69
96
|
?? segment[key]?.$valueAnyOf
|
|
70
|
-
?? segment[key]?.$
|
|
71
|
-
?? segment[key]?.$
|
|
97
|
+
?? segment[key]?.$match
|
|
98
|
+
?? segment[key]?.$matchAnyOf
|
|
72
99
|
?? segment[key]?.$regExp
|
|
73
100
|
?? segment[key]?.$regExpAnyOf
|
|
74
101
|
?? [];
|
|
@@ -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,mCASiB;AAQV,MAAM,wBAAwB,GAAG,CACtC,QAAsC,EACtC,OAAiD,EACvB,EAAE;IAC5B,IAAI,CAAC,gBAAC,CAAC,GAAG,CAAC,OAAO,EAAE,QAAQ,CAAC,IAAI,QAAQ,KAAK,QAAQ,IAAI,QAAQ,KAAK,MAAM,EAAE,CAAC;QAC9E,OAAO,IAAI,CAAC;IACd,CAAC;IAED,QAAO,QAAQ,EAAE,CAAC;QAChB,KAAK,MAAM,CAAC,CAAC,OAAO;YAClB,GAAG,EAAE,MAAM;YACX,IAAI,EAAE,QAAQ;YACd,MAAM,EAAE,OAAO,CAAC,QAAS;YACzB,KAAK,EAAE,OAAO,CAAC,QAAS,CAAC,IAAK;SAC/B,CAAC;QAEF,KAAK,QAAQ,CAAC,CAAC,OAAO;YACpB,GAAG,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AI,EAAE,CAAC,CAAC,MAAM,CAAC,gBAAC,CAAC,OAAO,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC;oBAC5F,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"}
|
|
@@ -9,11 +9,14 @@ declare const _default: Endpoint<null, {
|
|
|
9
9
|
readonly path: "/_mock/expectations";
|
|
10
10
|
};
|
|
11
11
|
} & {
|
|
12
|
-
handler: ({ reply,
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
handler: ({ reply, incoming, server }: (import("../models").HttpRequestContext<null> | import("../models").WsRequestContext<null>) & {
|
|
13
|
+
incoming: OmitPartial<{
|
|
14
|
+
body: void | {
|
|
15
|
+
ids?: string[];
|
|
16
|
+
};
|
|
17
|
+
query: void | undefined;
|
|
18
|
+
}>;
|
|
19
|
+
}) => Promise<void>;
|
|
17
20
|
};
|
|
18
21
|
export default _default;
|
|
19
22
|
//# sourceMappingURL=expectations.delete.endpoint.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expectations.delete.endpoint.d.ts","sourceRoot":"","sources":["../../../../src/server/endpoints/expectations.delete.endpoint.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;;UAGd,IAAI,GAAG;QAAE,GAAG,CAAC,EAAE,MAAM,EAAE,CAAA;KAAE
|
|
1
|
+
{"version":3,"file":"expectations.delete.endpoint.d.ts","sourceRoot":"","sources":["../../../../src/server/endpoints/expectations.delete.endpoint.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;;UAGd,IAAI,GAAG;QAAE,GAAG,CAAC,EAAE,MAAM,EAAE,CAAA;KAAE;;;;;;;;;;sBAAV,MAAM,EAAE;;;;;;AAD9C,wBAMK"}
|
|
@@ -4,8 +4,8 @@ const models_1 = require("../models");
|
|
|
4
4
|
exports.default = models_1.Endpoint
|
|
5
5
|
.build()
|
|
6
6
|
.bindToHttp({ method: 'DELETE', path: '/_mock/expectations' })
|
|
7
|
-
.assignHandler(async ({ reply,
|
|
8
|
-
await client.deleteExpectations(body);
|
|
7
|
+
.assignHandler(async ({ reply, incoming, server }) => {
|
|
8
|
+
await server.client.deleteExpectations(incoming.body);
|
|
9
9
|
reply.ok(null);
|
|
10
10
|
});
|
|
11
11
|
//# sourceMappingURL=expectations.delete.endpoint.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expectations.delete.endpoint.js","sourceRoot":"","sources":["../../../../src/server/endpoints/expectations.delete.endpoint.ts"],"names":[],"mappings":";;AAAA,sCAAqC;AAErC,kBAAe,iBAAQ;KACpB,KAAK,EAA6C;KAClD,UAAU,CAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,qBAAqB,EAAE,CAAC;KACpE,aAAa,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"expectations.delete.endpoint.js","sourceRoot":"","sources":["../../../../src/server/endpoints/expectations.delete.endpoint.ts"],"names":[],"mappings":";;AAAA,sCAAqC;AAErC,kBAAe,iBAAQ;KACpB,KAAK,EAA6C;KAClD,UAAU,CAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,qBAAqB,EAAE,CAAC;KACpE,aAAa,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE;IACnD,MAAM,MAAM,CAAC,MAAM,CAAC,kBAAkB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IACtD,KAAK,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC;AACjB,CAAC,CAAC,CAAC"}
|
|
@@ -1,16 +1,21 @@
|
|
|
1
1
|
import { Expectation } from '../../expectations';
|
|
2
2
|
import { Endpoint } from '../models';
|
|
3
|
-
declare const _default: Endpoint<Expectation[],
|
|
3
|
+
declare const _default: Endpoint<Pick<Expectation<{}>, "name" | "type" | "schema" | "id" | "isEnabled" | "meta">[], {}> & {
|
|
4
4
|
http: {
|
|
5
5
|
readonly method: "GET";
|
|
6
6
|
readonly path: "/_mock/expectations";
|
|
7
7
|
};
|
|
8
8
|
} & {
|
|
9
|
-
|
|
9
|
+
ws: {
|
|
10
10
|
readonly path: "expectations:get";
|
|
11
11
|
};
|
|
12
12
|
} & {
|
|
13
|
-
handler: ({ reply,
|
|
13
|
+
handler: ({ reply, server }: (import("../models").HttpRequestContext<Pick<Expectation<{}>, "name" | "type" | "schema" | "id" | "isEnabled" | "meta">[]> | import("../models").WsRequestContext<Pick<Expectation<{}>, "name" | "type" | "schema" | "id" | "isEnabled" | "meta">[]>) & {
|
|
14
|
+
incoming: OmitPartial<{
|
|
15
|
+
body: void | undefined;
|
|
16
|
+
query: void | undefined;
|
|
17
|
+
}>;
|
|
18
|
+
}) => void;
|
|
14
19
|
};
|
|
15
20
|
export default _default;
|
|
16
21
|
//# sourceMappingURL=expectations.get-list.endpoint.d.ts.map
|