@n1k1t/mock-server 0.1.16 → 0.1.17
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 +7 -4
- package/lib/src/client/errors/index.d.ts +1 -0
- package/lib/src/client/errors/index.d.ts.map +1 -1
- package/lib/src/client/errors/index.js +1 -0
- package/lib/src/client/errors/index.js.map +1 -1
- package/lib/src/client/helpers/expectations.d.ts +4 -4
- package/lib/src/client/helpers/expectations.d.ts.map +1 -1
- package/lib/src/client/helpers/expectations.js.map +1 -1
- package/lib/src/client/methods/expectations-group.update.method.d.ts +8 -0
- package/lib/src/client/methods/expectations-group.update.method.d.ts.map +1 -0
- package/lib/src/client/methods/expectations-group.update.method.js +30 -0
- package/lib/src/client/methods/expectations-group.update.method.js.map +1 -0
- package/lib/src/client/methods/expectations.create.method.d.ts +5 -1
- package/lib/src/client/methods/expectations.create.method.d.ts.map +1 -1
- package/lib/src/client/methods/expectations.create.method.js +11 -5
- package/lib/src/client/methods/expectations.create.method.js.map +1 -1
- package/lib/src/client/methods/expectations.delete.method.d.ts +4 -2
- package/lib/src/client/methods/expectations.delete.method.d.ts.map +1 -1
- package/lib/src/client/methods/expectations.delete.method.js +9 -5
- package/lib/src/client/methods/expectations.delete.method.js.map +1 -1
- package/lib/src/client/methods/expectations.update.method.d.ts +4 -4
- package/lib/src/client/methods/expectations.update.method.d.ts.map +1 -1
- package/lib/src/client/methods/expectations.update.method.js +7 -6
- package/lib/src/client/methods/expectations.update.method.js.map +1 -1
- package/lib/src/client/methods/index.d.ts +1 -0
- package/lib/src/client/methods/index.d.ts.map +1 -1
- package/lib/src/client/methods/index.js +3 -1
- package/lib/src/client/methods/index.js.map +1 -1
- package/lib/src/client/methods/ping.method.d.ts +5 -1
- package/lib/src/client/methods/ping.method.d.ts.map +1 -1
- package/lib/src/client/methods/ping.method.js +7 -5
- package/lib/src/client/methods/ping.method.js.map +1 -1
- package/lib/src/client/models/client.d.ts +25 -18
- package/lib/src/client/models/client.d.ts.map +1 -1
- package/lib/src/client/models/client.js +10 -8
- package/lib/src/client/models/client.js.map +1 -1
- package/lib/src/client/models/client.spec.js +43 -42
- package/lib/src/client/models/client.spec.js.map +1 -1
- package/lib/src/client/models/method.d.ts +17 -11
- package/lib/src/client/models/method.d.ts.map +1 -1
- package/lib/src/client/models/method.js +2 -1
- package/lib/src/client/models/method.js.map +1 -1
- package/lib/src/client/onsite.d.ts +7 -4
- package/lib/src/client/onsite.d.ts.map +1 -1
- package/lib/src/client/onsite.js +24 -11
- package/lib/src/client/onsite.js.map +1 -1
- package/lib/src/client/remote.d.ts +9 -2
- package/lib/src/client/remote.d.ts.map +1 -1
- package/lib/src/client/remote.js +20 -7
- package/lib/src/client/remote.js.map +1 -1
- package/lib/src/client/types.d.ts +9 -9
- package/lib/src/client/types.d.ts.map +1 -1
- package/lib/src/client/utils.d.ts +3 -3
- package/lib/src/client/utils.d.ts.map +1 -1
- package/lib/src/client/utils.js.map +1 -1
- package/lib/src/config/index.d.ts +1 -0
- package/lib/src/config/index.d.ts.map +1 -1
- package/lib/src/config/index.js +15 -0
- package/lib/src/config/index.js.map +1 -1
- package/lib/src/config/model.d.ts +13 -19
- package/lib/src/config/model.d.ts.map +1 -1
- package/lib/src/config/model.js +5 -10
- package/lib/src/config/model.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 +5 -2
- package/lib/src/expectations/__utils__/index.js.map +1 -1
- package/lib/src/expectations/models/expectation.d.ts +12 -28
- package/lib/src/expectations/models/expectation.d.ts.map +1 -1
- package/lib/src/expectations/models/expectation.js +28 -15
- package/lib/src/expectations/models/expectation.js.map +1 -1
- package/lib/src/expectations/models/operator.d.ts +4 -4
- package/lib/src/expectations/models/operator.d.ts.map +1 -1
- package/lib/src/expectations/models/operator.js +37 -2
- package/lib/src/expectations/models/operator.js.map +1 -1
- package/lib/src/expectations/models/storage.d.ts +5 -5
- package/lib/src/expectations/models/storage.d.ts.map +1 -1
- package/lib/src/expectations/models/storage.js +10 -3
- package/lib/src/expectations/models/storage.js.map +1 -1
- package/lib/src/expectations/models/storage.spec.js +48 -102
- package/lib/src/expectations/models/storage.spec.js.map +1 -1
- package/lib/src/expectations/operators/and.operator.d.ts +2 -2
- package/lib/src/expectations/operators/and.operator.d.ts.map +1 -1
- package/lib/src/expectations/operators/and.operator.spec.js +17 -7
- package/lib/src/expectations/operators/and.operator.spec.js.map +1 -1
- package/lib/src/expectations/operators/exec.operator.d.ts +3 -3
- package/lib/src/expectations/operators/exec.operator.d.ts.map +1 -1
- package/lib/src/expectations/operators/exec.operator.js.map +1 -1
- package/lib/src/expectations/operators/exec.operator.spec.js +21 -11
- package/lib/src/expectations/operators/exec.operator.spec.js.map +1 -1
- package/lib/src/expectations/operators/has.operator.d.ts +4 -4
- package/lib/src/expectations/operators/has.operator.d.ts.map +1 -1
- package/lib/src/expectations/operators/has.operator.js +2 -0
- package/lib/src/expectations/operators/has.operator.js.map +1 -1
- package/lib/src/expectations/operators/has.operator.spec.js +28 -18
- package/lib/src/expectations/operators/has.operator.spec.js.map +1 -1
- package/lib/src/expectations/operators/if.operator.d.ts +2 -2
- package/lib/src/expectations/operators/if.operator.d.ts.map +1 -1
- package/lib/src/expectations/operators/if.operator.spec.js +20 -10
- package/lib/src/expectations/operators/if.operator.spec.js.map +1 -1
- package/lib/src/expectations/operators/merge.operator.d.ts +4 -4
- package/lib/src/expectations/operators/merge.operator.d.ts.map +1 -1
- package/lib/src/expectations/operators/merge.operator.spec.js +20 -10
- package/lib/src/expectations/operators/merge.operator.spec.js.map +1 -1
- package/lib/src/expectations/operators/not.operator.d.ts +2 -2
- package/lib/src/expectations/operators/not.operator.d.ts.map +1 -1
- package/lib/src/expectations/operators/not.operator.spec.js +17 -7
- package/lib/src/expectations/operators/not.operator.spec.js.map +1 -1
- package/lib/src/expectations/operators/or.operator.d.ts +2 -2
- package/lib/src/expectations/operators/or.operator.d.ts.map +1 -1
- package/lib/src/expectations/operators/or.operator.spec.js +17 -7
- package/lib/src/expectations/operators/or.operator.spec.js.map +1 -1
- package/lib/src/expectations/operators/remove.operator.d.ts +2 -2
- package/lib/src/expectations/operators/remove.operator.d.ts.map +1 -1
- package/lib/src/expectations/operators/remove.operator.spec.js +20 -10
- package/lib/src/expectations/operators/remove.operator.spec.js.map +1 -1
- package/lib/src/expectations/operators/root.operator.d.ts +2 -2
- package/lib/src/expectations/operators/root.operator.d.ts.map +1 -1
- package/lib/src/expectations/operators/set.operator.d.ts +4 -4
- package/lib/src/expectations/operators/set.operator.d.ts.map +1 -1
- package/lib/src/expectations/operators/set.operator.spec.js +21 -11
- package/lib/src/expectations/operators/set.operator.spec.js.map +1 -1
- package/lib/src/expectations/operators/switch.operator.d.ts +4 -4
- package/lib/src/expectations/operators/switch.operator.d.ts.map +1 -1
- package/lib/src/expectations/operators/switch.operator.spec.js +65 -55
- package/lib/src/expectations/operators/switch.operator.spec.js.map +1 -1
- package/lib/src/expectations/types.d.ts +54 -36
- package/lib/src/expectations/types.d.ts.map +1 -1
- package/lib/src/expectations/types.js +10 -6
- package/lib/src/expectations/types.js.map +1 -1
- package/lib/src/expectations/utils.d.ts +4 -4
- package/lib/src/expectations/utils.d.ts.map +1 -1
- package/lib/src/expectations/utils.js +38 -8
- package/lib/src/expectations/utils.js.map +1 -1
- package/lib/src/server/endpoints/config.get.endpoint.d.ts +38 -57
- package/lib/src/server/endpoints/config.get.endpoint.d.ts.map +1 -1
- package/lib/src/server/endpoints/config.get.endpoint.js +5 -3
- package/lib/src/server/endpoints/config.get.endpoint.js.map +1 -1
- package/lib/src/server/endpoints/expectations-group.update.endpoint.d.ts +42 -0
- package/lib/src/server/endpoints/expectations-group.update.endpoint.d.ts.map +1 -0
- package/lib/src/server/endpoints/expectations-group.update.endpoint.js +16 -0
- package/lib/src/server/endpoints/expectations-group.update.endpoint.js.map +1 -0
- package/lib/src/server/endpoints/expectations.create.endpoint.d.ts +18 -10
- package/lib/src/server/endpoints/expectations.create.endpoint.d.ts.map +1 -1
- package/lib/src/server/endpoints/expectations.create.endpoint.js +9 -3
- package/lib/src/server/endpoints/expectations.create.endpoint.js.map +1 -1
- package/lib/src/server/endpoints/expectations.delete.endpoint.d.ts +21 -11
- package/lib/src/server/endpoints/expectations.delete.endpoint.d.ts.map +1 -1
- package/lib/src/server/endpoints/expectations.delete.endpoint.js +5 -4
- package/lib/src/server/endpoints/expectations.delete.endpoint.js.map +1 -1
- package/lib/src/server/endpoints/expectations.get-list.endpoint.d.ts +13 -9
- package/lib/src/server/endpoints/expectations.get-list.endpoint.d.ts.map +1 -1
- package/lib/src/server/endpoints/expectations.get-list.endpoint.js +7 -3
- package/lib/src/server/endpoints/expectations.get-list.endpoint.js.map +1 -1
- package/lib/src/server/endpoints/expectations.update.endpoint.d.ts +26 -15
- package/lib/src/server/endpoints/expectations.update.endpoint.d.ts.map +1 -1
- package/lib/src/server/endpoints/expectations.update.endpoint.js +12 -5
- package/lib/src/server/endpoints/expectations.update.endpoint.js.map +1 -1
- package/lib/src/server/endpoints/gui.endpoint.d.ts +32 -0
- package/lib/src/server/endpoints/gui.endpoint.d.ts.map +1 -0
- package/lib/src/server/endpoints/gui.endpoint.js +60 -0
- package/lib/src/server/endpoints/gui.endpoint.js.map +1 -0
- package/lib/src/server/endpoints/history.get-list.endpoint.d.ts +15 -15
- package/lib/src/server/endpoints/history.get-list.endpoint.d.ts.map +1 -1
- package/lib/src/server/endpoints/history.get-list.endpoint.js +7 -5
- package/lib/src/server/endpoints/history.get-list.endpoint.js.map +1 -1
- package/lib/src/server/endpoints/index.d.ts +2 -0
- package/lib/src/server/endpoints/index.d.ts.map +1 -1
- package/lib/src/server/endpoints/index.js +5 -1
- package/lib/src/server/endpoints/index.js.map +1 -1
- package/lib/src/server/endpoints/ping.endpoint.d.ts +12 -8
- package/lib/src/server/endpoints/ping.endpoint.d.ts.map +1 -1
- package/lib/src/server/endpoints/ping.endpoint.js +4 -3
- package/lib/src/server/endpoints/ping.endpoint.js.map +1 -1
- package/lib/src/server/index.d.ts +48 -13
- package/lib/src/server/index.d.ts.map +1 -1
- package/lib/src/server/index.js +60 -77
- package/lib/src/server/index.js.map +1 -1
- package/lib/src/server/models/containers/model.d.ts +1 -1
- package/lib/src/server/models/containers/model.d.ts.map +1 -1
- package/lib/src/server/models/containers/model.js +2 -2
- package/lib/src/server/models/containers/model.js.map +1 -1
- package/lib/src/server/models/containers/storage.d.ts +4 -4
- package/lib/src/server/models/containers/storage.d.ts.map +1 -1
- package/lib/src/server/models/containers/storage.js.map +1 -1
- package/lib/src/server/models/endpoint.d.ts +34 -19
- package/lib/src/server/models/endpoint.d.ts.map +1 -1
- package/lib/src/server/models/endpoint.js +5 -2
- package/lib/src/server/models/endpoint.js.map +1 -1
- package/lib/src/server/models/exchanges/index.d.ts +2 -0
- package/lib/src/server/models/exchanges/index.d.ts.map +1 -0
- package/lib/src/server/{ws-exchange → models/exchanges}/index.js +1 -6
- package/lib/src/server/models/exchanges/index.js.map +1 -0
- package/lib/src/server/models/exchanges/socket-io.d.ts +14 -0
- package/lib/src/server/models/exchanges/socket-io.d.ts.map +1 -0
- package/lib/src/server/models/exchanges/socket-io.js +8 -0
- package/lib/src/server/models/exchanges/socket-io.js.map +1 -0
- package/lib/src/server/models/executor/errors/index.d.ts +10 -0
- package/lib/src/server/models/executor/errors/index.d.ts.map +1 -0
- package/lib/src/server/models/executor/errors/index.js +17 -0
- package/lib/src/server/models/executor/errors/index.js.map +1 -0
- package/lib/src/server/models/executor/index.d.ts +27 -0
- package/lib/src/server/models/executor/index.d.ts.map +1 -0
- package/lib/src/server/models/executor/index.js +193 -0
- package/lib/src/server/models/executor/index.js.map +1 -0
- package/lib/src/server/models/history/index.d.ts.map +1 -0
- package/lib/src/server/models/history/index.js.map +1 -0
- package/lib/src/server/models/history/model.d.ts +30 -0
- package/lib/src/server/models/history/model.d.ts.map +1 -0
- package/lib/src/server/models/history/model.js +62 -0
- package/lib/src/server/models/history/model.js.map +1 -0
- package/lib/src/server/models/history/storage.d.ts +9 -0
- package/lib/src/server/models/history/storage.d.ts.map +1 -0
- package/lib/src/server/models/history/storage.js +34 -0
- package/lib/src/server/models/history/storage.js.map +1 -0
- package/lib/src/server/models/index.d.ts +6 -3
- package/lib/src/server/models/index.d.ts.map +1 -1
- package/lib/src/server/models/index.js +6 -3
- package/lib/src/server/models/index.js.map +1 -1
- package/lib/src/server/models/providers/index.d.ts +3 -0
- package/lib/src/server/models/providers/index.d.ts.map +1 -0
- package/lib/src/server/models/providers/index.js +19 -0
- package/lib/src/server/models/providers/index.js.map +1 -0
- package/lib/src/server/models/providers/model.d.ts +27 -0
- package/lib/src/server/models/providers/model.d.ts.map +1 -0
- package/lib/src/server/models/providers/model.js +35 -0
- package/lib/src/server/models/providers/model.js.map +1 -0
- package/lib/src/server/models/providers/storage.d.ts +10 -0
- package/lib/src/server/models/providers/storage.d.ts.map +1 -0
- package/lib/src/server/models/providers/storage.js +26 -0
- package/lib/src/server/models/providers/storage.js.map +1 -0
- package/lib/src/server/models/reply.d.ts +10 -0
- package/lib/src/server/models/reply.d.ts.map +1 -0
- package/lib/src/server/models/reply.js +10 -0
- package/lib/src/server/models/reply.js.map +1 -0
- package/lib/src/server/models/request-context/index.d.ts +55 -3
- package/lib/src/server/models/request-context/index.d.ts.map +1 -1
- package/lib/src/server/models/request-context/index.js +108 -3
- package/lib/src/server/models/request-context/index.js.map +1 -1
- package/lib/src/server/models/request-context/snapshot.d.ts +23 -17
- package/lib/src/server/models/request-context/snapshot.d.ts.map +1 -1
- package/lib/src/server/models/request-context/snapshot.js +31 -27
- package/lib/src/server/models/request-context/snapshot.js.map +1 -1
- package/lib/src/server/models/request-context/types.d.ts +30 -6
- package/lib/src/server/models/request-context/types.d.ts.map +1 -1
- package/lib/src/server/models/request-context/utils.d.ts +3 -9
- package/lib/src/server/models/request-context/utils.d.ts.map +1 -1
- package/lib/src/server/models/request-context/utils.js +22 -14
- package/lib/src/server/models/request-context/utils.js.map +1 -1
- package/lib/src/server/models/router.d.ts +22 -0
- package/lib/src/server/models/router.d.ts.map +1 -0
- package/lib/src/server/models/router.js +47 -0
- package/lib/src/server/models/router.js.map +1 -0
- package/lib/src/server/models/transports/index.d.ts +3 -0
- package/lib/src/server/models/transports/index.d.ts.map +1 -0
- package/lib/src/server/models/transports/index.js +19 -0
- package/lib/src/server/models/transports/index.js.map +1 -0
- package/lib/src/server/models/transports/model.d.ts +8 -0
- package/lib/src/server/models/transports/model.d.ts.map +1 -0
- package/lib/src/server/models/transports/model.js +7 -0
- package/lib/src/server/models/transports/model.js.map +1 -0
- package/lib/src/server/models/transports/storage.d.ts +6 -0
- package/lib/src/server/models/transports/storage.d.ts.map +1 -0
- package/lib/src/server/models/transports/storage.js +13 -0
- package/lib/src/server/models/transports/storage.js.map +1 -0
- package/lib/src/server/transports/http/context.d.ts +20 -0
- package/lib/src/server/transports/http/context.d.ts.map +1 -0
- package/lib/src/server/transports/http/context.js +50 -0
- package/lib/src/server/transports/http/context.js.map +1 -0
- package/lib/src/server/transports/http/executor.d.ts +26 -0
- package/lib/src/server/transports/http/executor.d.ts.map +1 -0
- package/lib/src/server/transports/http/executor.js +93 -0
- package/lib/src/server/transports/http/executor.js.map +1 -0
- package/lib/src/server/transports/http/index.d.ts +12 -0
- package/lib/src/server/transports/http/index.d.ts.map +1 -0
- package/lib/src/server/transports/http/index.js +50 -0
- package/lib/src/server/transports/http/index.js.map +1 -0
- package/lib/src/server/transports/index.d.ts +4 -0
- package/lib/src/server/transports/index.d.ts.map +1 -0
- package/lib/src/server/transports/index.js +20 -0
- package/lib/src/server/transports/index.js.map +1 -0
- package/lib/src/server/transports/internal/http/context.d.ts +24 -0
- package/lib/src/server/transports/internal/http/context.d.ts.map +1 -0
- package/lib/src/server/transports/internal/http/context.js +35 -0
- package/lib/src/server/transports/internal/http/context.js.map +1 -0
- package/lib/src/server/transports/internal/http/executor.d.ts +11 -0
- package/lib/src/server/transports/internal/http/executor.d.ts.map +1 -0
- package/lib/src/server/transports/internal/http/executor.js +82 -0
- package/lib/src/server/transports/internal/http/executor.js.map +1 -0
- package/lib/src/server/transports/internal/http/index.d.ts +15 -0
- package/lib/src/server/transports/internal/http/index.d.ts.map +1 -0
- package/lib/src/server/transports/internal/http/index.js +35 -0
- package/lib/src/server/transports/internal/http/index.js.map +1 -0
- package/lib/src/server/transports/internal/http/reply.d.ts +10 -0
- package/lib/src/server/transports/internal/http/reply.d.ts.map +1 -0
- package/lib/src/server/transports/internal/http/reply.js +39 -0
- package/lib/src/server/transports/internal/http/reply.js.map +1 -0
- package/lib/src/server/transports/internal/index.d.ts +3 -0
- package/lib/src/server/transports/internal/index.d.ts.map +1 -0
- package/lib/src/server/transports/internal/index.js +19 -0
- package/lib/src/server/transports/internal/index.js.map +1 -0
- package/lib/src/server/transports/internal/socket-io/context.d.ts +29 -0
- package/lib/src/server/transports/internal/socket-io/context.d.ts.map +1 -0
- package/lib/src/server/transports/internal/socket-io/context.js +27 -0
- package/lib/src/server/transports/internal/socket-io/context.js.map +1 -0
- package/lib/src/server/transports/internal/socket-io/executor.d.ts +11 -0
- package/lib/src/server/transports/internal/socket-io/executor.d.ts.map +1 -0
- package/lib/src/server/transports/internal/socket-io/executor.js +65 -0
- package/lib/src/server/transports/internal/socket-io/executor.js.map +1 -0
- package/lib/src/server/transports/internal/socket-io/index.d.ts +14 -0
- package/lib/src/server/transports/internal/socket-io/index.d.ts.map +1 -0
- package/lib/src/server/transports/internal/socket-io/index.js +41 -0
- package/lib/src/server/transports/internal/socket-io/index.js.map +1 -0
- package/lib/src/server/transports/internal/socket-io/reply.d.ts +10 -0
- package/lib/src/server/transports/internal/socket-io/reply.d.ts.map +1 -0
- package/lib/src/server/transports/internal/socket-io/reply.js +24 -0
- package/lib/src/server/transports/internal/socket-io/reply.js.map +1 -0
- package/lib/src/server/transports/ws/context.d.ts +30 -0
- package/lib/src/server/transports/ws/context.d.ts.map +1 -0
- package/lib/src/server/transports/ws/context.js +59 -0
- package/lib/src/server/transports/ws/context.js.map +1 -0
- package/lib/src/server/transports/ws/executor.d.ts +10 -0
- package/lib/src/server/transports/ws/executor.d.ts.map +1 -0
- package/lib/src/server/transports/ws/executor.js +49 -0
- package/lib/src/server/transports/ws/executor.js.map +1 -0
- package/lib/src/server/transports/ws/index.d.ts +11 -0
- package/lib/src/server/transports/ws/index.d.ts.map +1 -0
- package/lib/src/server/transports/ws/index.js +53 -0
- package/lib/src/server/transports/ws/index.js.map +1 -0
- package/lib/src/server/types/index.d.ts +14 -0
- package/lib/src/server/types/index.d.ts.map +1 -0
- package/lib/src/server/{ws-exchange/types.js → types/index.js} +1 -1
- package/lib/src/server/types/index.js.map +1 -0
- package/lib/src/types/common.d.ts +3 -3
- package/lib/src/types/common.d.ts.map +1 -1
- package/lib/src/types/index.d.ts +0 -2
- package/lib/src/types/index.d.ts.map +1 -1
- package/lib/src/utils/common.d.ts +12 -1
- package/lib/src/utils/common.d.ts.map +1 -1
- package/lib/src/utils/common.js +13 -1
- package/lib/src/utils/common.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/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/lib/src/server/history/index.d.ts.map +0 -1
- package/lib/src/server/history/index.js.map +0 -1
- package/lib/src/server/history/model.d.ts +0 -23
- package/lib/src/server/history/model.d.ts.map +0 -1
- package/lib/src/server/history/model.js +0 -42
- package/lib/src/server/history/model.js.map +0 -1
- package/lib/src/server/history/storage.d.ts +0 -6
- package/lib/src/server/history/storage.d.ts.map +0 -1
- package/lib/src/server/history/storage.js +0 -24
- package/lib/src/server/history/storage.js.map +0 -1
- package/lib/src/server/middlewares/delay.middleware.d.ts +0 -20
- package/lib/src/server/middlewares/delay.middleware.d.ts.map +0 -1
- package/lib/src/server/middlewares/delay.middleware.js +0 -13
- package/lib/src/server/middlewares/delay.middleware.js.map +0 -1
- package/lib/src/server/middlewares/destroy.midleware.d.ts +0 -20
- package/lib/src/server/middlewares/destroy.midleware.d.ts.map +0 -1
- package/lib/src/server/middlewares/destroy.midleware.js +0 -16
- package/lib/src/server/middlewares/destroy.midleware.js.map +0 -1
- package/lib/src/server/middlewares/forward.middleware.d.ts +0 -20
- package/lib/src/server/middlewares/forward.middleware.d.ts.map +0 -1
- package/lib/src/server/middlewares/forward.middleware.js +0 -121
- package/lib/src/server/middlewares/forward.middleware.js.map +0 -1
- package/lib/src/server/middlewares/history.middleware.d.ts +0 -20
- package/lib/src/server/middlewares/history.middleware.d.ts.map +0 -1
- package/lib/src/server/middlewares/history.middleware.js +0 -16
- package/lib/src/server/middlewares/history.middleware.js.map +0 -1
- package/lib/src/server/middlewares/index.d.ts +0 -10
- package/lib/src/server/middlewares/index.d.ts.map +0 -1
- package/lib/src/server/middlewares/index.js +0 -25
- package/lib/src/server/middlewares/index.js.map +0 -1
- package/lib/src/server/middlewares/internal.middleware.d.ts +0 -20
- package/lib/src/server/middlewares/internal.middleware.d.ts.map +0 -1
- package/lib/src/server/middlewares/internal.middleware.js +0 -15
- package/lib/src/server/middlewares/internal.middleware.js.map +0 -1
- package/lib/src/server/middlewares/manipulate-expectation.middleware.d.ts +0 -20
- package/lib/src/server/middlewares/manipulate-expectation.middleware.d.ts.map +0 -1
- package/lib/src/server/middlewares/manipulate-expectation.middleware.js +0 -7
- package/lib/src/server/middlewares/manipulate-expectation.middleware.js.map +0 -1
- package/lib/src/server/middlewares/match-expectation.middleware.d.ts +0 -20
- package/lib/src/server/middlewares/match-expectation.middleware.d.ts.map +0 -1
- package/lib/src/server/middlewares/match-expectation.middleware.js +0 -26
- package/lib/src/server/middlewares/match-expectation.middleware.js.map +0 -1
- package/lib/src/server/middlewares/public.middleware.d.ts +0 -20
- package/lib/src/server/middlewares/public.middleware.d.ts.map +0 -1
- package/lib/src/server/middlewares/public.middleware.js +0 -38
- package/lib/src/server/middlewares/public.middleware.js.map +0 -1
- package/lib/src/server/middlewares/reply.middleware.d.ts +0 -20
- package/lib/src/server/middlewares/reply.middleware.d.ts.map +0 -1
- package/lib/src/server/middlewares/reply.middleware.js +0 -57
- package/lib/src/server/middlewares/reply.middleware.js.map +0 -1
- package/lib/src/server/models/middleware.d.ts +0 -29
- package/lib/src/server/models/middleware.d.ts.map +0 -1
- package/lib/src/server/models/middleware.js +0 -26
- package/lib/src/server/models/middleware.js.map +0 -1
- package/lib/src/server/models/plugins.d.ts +0 -34
- package/lib/src/server/models/plugins.d.ts.map +0 -1
- package/lib/src/server/models/plugins.js +0 -32
- package/lib/src/server/models/plugins.js.map +0 -1
- package/lib/src/server/models/reply/index.d.ts +0 -12
- package/lib/src/server/models/reply/index.d.ts.map +0 -1
- package/lib/src/server/models/reply/index.js +0 -76
- package/lib/src/server/models/reply/index.js.map +0 -1
- package/lib/src/server/models/reply/types.d.ts +0 -5
- package/lib/src/server/models/reply/types.d.ts.map +0 -1
- package/lib/src/server/models/reply/types.js +0 -3
- package/lib/src/server/models/reply/types.js.map +0 -1
- package/lib/src/server/models/request-context/http.d.ts +0 -63
- package/lib/src/server/models/request-context/http.d.ts.map +0 -1
- package/lib/src/server/models/request-context/http.js +0 -70
- package/lib/src/server/models/request-context/http.js.map +0 -1
- package/lib/src/server/models/request-context/model.d.ts +0 -18
- package/lib/src/server/models/request-context/model.d.ts.map +0 -1
- package/lib/src/server/models/request-context/model.js +0 -19
- package/lib/src/server/models/request-context/model.js.map +0 -1
- package/lib/src/server/models/request-context/ws.d.ts +0 -22
- package/lib/src/server/models/request-context/ws.d.ts.map +0 -1
- package/lib/src/server/models/request-context/ws.js +0 -22
- package/lib/src/server/models/request-context/ws.js.map +0 -1
- package/lib/src/server/models/server-context.d.ts +0 -24
- package/lib/src/server/models/server-context.d.ts.map +0 -1
- package/lib/src/server/models/server-context.js +0 -44
- package/lib/src/server/models/server-context.js.map +0 -1
- package/lib/src/server/router.d.ts +0 -9
- package/lib/src/server/router.d.ts.map +0 -1
- package/lib/src/server/router.js +0 -42
- package/lib/src/server/router.js.map +0 -1
- package/lib/src/server/ws-exchange/index.d.ts +0 -5
- package/lib/src/server/ws-exchange/index.d.ts.map +0 -1
- package/lib/src/server/ws-exchange/index.js.map +0 -1
- package/lib/src/server/ws-exchange/types.d.ts +0 -12
- package/lib/src/server/ws-exchange/types.d.ts.map +0 -1
- package/lib/src/server/ws-exchange/types.js.map +0 -1
- /package/lib/src/server/{history → models/history}/index.d.ts +0 -0
- /package/lib/src/server/{history → models/history}/index.js +0 -0
|
@@ -15,114 +15,124 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
36
|
const operators = __importStar(require("./index"));
|
|
27
37
|
describe('Expectations.Operators.Switch', () => {
|
|
28
38
|
describe('matching', () => {
|
|
29
39
|
it('should match by schema in incoming body using path', () => {
|
|
30
40
|
const operator = new operators.$switch(operators, {
|
|
31
|
-
$location: 'incoming.
|
|
41
|
+
$location: 'incoming.data',
|
|
32
42
|
$path: 'foo.bar',
|
|
33
43
|
$cases: {
|
|
34
|
-
'a': { $has: { $location: 'incoming.
|
|
35
|
-
'b': { $has: { $location: 'incoming.
|
|
44
|
+
'a': { $has: { $location: 'incoming.data', $path: 'baz', $value: 'a' } },
|
|
45
|
+
'b': { $has: { $location: 'incoming.data', $path: 'baz', $value: 'b' } },
|
|
36
46
|
},
|
|
37
47
|
$default: { $exec: () => true },
|
|
38
48
|
});
|
|
39
|
-
expect(operator.match({ incoming: {
|
|
40
|
-
expect(operator.match({ incoming: {
|
|
41
|
-
expect(operator.match({ incoming: {
|
|
42
|
-
expect(operator.match({ incoming: {
|
|
43
|
-
expect(operator.match({ incoming: {
|
|
44
|
-
expect(operator.match({ incoming: {
|
|
49
|
+
expect(operator.match({ incoming: { data: {} } })).toBeTruthy();
|
|
50
|
+
expect(operator.match({ incoming: { data: { baz: 'a', foo: { bar: 'a' } } } })).toBeTruthy();
|
|
51
|
+
expect(operator.match({ incoming: { data: { baz: 'b', foo: { bar: 'b' } } } })).toBeTruthy();
|
|
52
|
+
expect(operator.match({ incoming: { data: { foo: { bar: 'a' } } } })).toBeFalsy();
|
|
53
|
+
expect(operator.match({ incoming: { data: { baz: 'b', foo: { bar: 'a' } } } })).toBeFalsy();
|
|
54
|
+
expect(operator.match({ incoming: { data: { baz: 'a', foo: { bar: 'b' } } } })).toBeFalsy();
|
|
45
55
|
});
|
|
46
56
|
it('should match by schema in incoming body using exec', () => {
|
|
47
57
|
const operator = new operators.$switch(operators, {
|
|
48
|
-
$location: 'incoming.
|
|
58
|
+
$location: 'incoming.data',
|
|
49
59
|
$exec: (payload) => payload?.foo?.bar,
|
|
50
60
|
$cases: {
|
|
51
|
-
'a': { $has: { $location: 'incoming.
|
|
52
|
-
'b': { $has: { $location: 'incoming.
|
|
61
|
+
'a': { $has: { $location: 'incoming.data', $path: 'baz', $value: 'a' } },
|
|
62
|
+
'b': { $has: { $location: 'incoming.data', $path: 'baz', $value: 'b' } },
|
|
53
63
|
},
|
|
54
64
|
$default: { $exec: () => true },
|
|
55
65
|
});
|
|
56
|
-
expect(operator.match({ incoming: {
|
|
57
|
-
expect(operator.match({ incoming: {
|
|
58
|
-
expect(operator.match({ incoming: {
|
|
59
|
-
expect(operator.match({ incoming: {
|
|
60
|
-
expect(operator.match({ incoming: {
|
|
61
|
-
expect(operator.match({ incoming: {
|
|
66
|
+
expect(operator.match({ incoming: { data: {} } })).toBeTruthy();
|
|
67
|
+
expect(operator.match({ incoming: { data: { baz: 'a', foo: { bar: 'a' } } } })).toBeTruthy();
|
|
68
|
+
expect(operator.match({ incoming: { data: { baz: 'b', foo: { bar: 'b' } } } })).toBeTruthy();
|
|
69
|
+
expect(operator.match({ incoming: { data: { foo: { bar: 'a' } } } })).toBeFalsy();
|
|
70
|
+
expect(operator.match({ incoming: { data: { baz: 'b', foo: { bar: 'a' } } } })).toBeFalsy();
|
|
71
|
+
expect(operator.match({ incoming: { data: { baz: 'a', foo: { bar: 'b' } } } })).toBeFalsy();
|
|
62
72
|
});
|
|
63
73
|
it('should match by schema in incoming body using exec with utils', () => {
|
|
64
74
|
const operator = new operators.$switch(operators, {
|
|
65
|
-
$location: 'incoming.
|
|
75
|
+
$location: 'incoming.data',
|
|
66
76
|
$exec: (payload, { _ }) => _.get(payload, 'foo.bar'),
|
|
67
77
|
$cases: {
|
|
68
|
-
'a': { $has: { $location: 'incoming.
|
|
69
|
-
'b': { $has: { $location: 'incoming.
|
|
78
|
+
'a': { $has: { $location: 'incoming.data', $path: 'baz', $value: 'a' } },
|
|
79
|
+
'b': { $has: { $location: 'incoming.data', $path: 'baz', $value: 'b' } },
|
|
70
80
|
},
|
|
71
81
|
$default: { $exec: () => true },
|
|
72
82
|
});
|
|
73
|
-
expect(operator.match({ incoming: {
|
|
74
|
-
expect(operator.match({ incoming: {
|
|
75
|
-
expect(operator.match({ incoming: {
|
|
76
|
-
expect(operator.match({ incoming: {
|
|
77
|
-
expect(operator.match({ incoming: {
|
|
78
|
-
expect(operator.match({ incoming: {
|
|
83
|
+
expect(operator.match({ incoming: { data: {} } })).toBeTruthy();
|
|
84
|
+
expect(operator.match({ incoming: { data: { baz: 'a', foo: { bar: 'a' } } } })).toBeTruthy();
|
|
85
|
+
expect(operator.match({ incoming: { data: { baz: 'b', foo: { bar: 'b' } } } })).toBeTruthy();
|
|
86
|
+
expect(operator.match({ incoming: { data: { foo: { bar: 'a' } } } })).toBeFalsy();
|
|
87
|
+
expect(operator.match({ incoming: { data: { baz: 'b', foo: { bar: 'a' } } } })).toBeFalsy();
|
|
88
|
+
expect(operator.match({ incoming: { data: { baz: 'a', foo: { bar: 'b' } } } })).toBeFalsy();
|
|
79
89
|
});
|
|
80
90
|
});
|
|
81
91
|
describe('manipulation', () => {
|
|
82
92
|
it('should manipulate by schema in incoming body using path', () => {
|
|
83
93
|
const operator = new operators.$switch(operators, {
|
|
84
|
-
$location: 'incoming.
|
|
94
|
+
$location: 'incoming.data',
|
|
85
95
|
$path: 'foo.bar',
|
|
86
96
|
$cases: {
|
|
87
|
-
'a': { $set: { $location: 'incoming.
|
|
88
|
-
'b': { $set: { $location: 'incoming.
|
|
97
|
+
'a': { $set: { $location: 'incoming.data', $path: 'baz', $value: 'a' } },
|
|
98
|
+
'b': { $set: { $location: 'incoming.data', $path: 'baz', $value: 'b' } },
|
|
89
99
|
},
|
|
90
100
|
$default: { $exec: ({ context }) => context.default = true },
|
|
91
101
|
});
|
|
92
|
-
expect(operator.manipulate({ incoming: {
|
|
93
|
-
expect(operator.manipulate({ incoming: {
|
|
94
|
-
expect(operator.manipulate({ incoming: {
|
|
95
|
-
expect(operator.manipulate({ incoming: {
|
|
102
|
+
expect(operator.manipulate({ incoming: { data: {} } }).default).toBeTruthy();
|
|
103
|
+
expect(operator.manipulate({ incoming: { data: { foo: { bar: 'a' } } } }).incoming.data.baz).toEqual('a');
|
|
104
|
+
expect(operator.manipulate({ incoming: { data: { foo: { bar: 'b' } } } }).incoming.data.baz).toEqual('b');
|
|
105
|
+
expect(operator.manipulate({ incoming: { data: { foo: { bar: 'c' } } } }).incoming.data.baz).toBeUndefined();
|
|
96
106
|
});
|
|
97
107
|
it('should match by schema in incoming body using exec', () => {
|
|
98
108
|
const operator = new operators.$switch(operators, {
|
|
99
|
-
$location: 'incoming.
|
|
109
|
+
$location: 'incoming.data',
|
|
100
110
|
$exec: (payload) => payload?.foo?.bar,
|
|
101
111
|
$cases: {
|
|
102
|
-
'a': { $set: { $location: 'incoming.
|
|
103
|
-
'b': { $set: { $location: 'incoming.
|
|
112
|
+
'a': { $set: { $location: 'incoming.data', $path: 'baz', $value: 'a' } },
|
|
113
|
+
'b': { $set: { $location: 'incoming.data', $path: 'baz', $value: 'b' } },
|
|
104
114
|
},
|
|
105
115
|
$default: { $exec: ({ context }) => context.default = true },
|
|
106
116
|
});
|
|
107
|
-
expect(operator.manipulate({ incoming: {
|
|
108
|
-
expect(operator.manipulate({ incoming: {
|
|
109
|
-
expect(operator.manipulate({ incoming: {
|
|
110
|
-
expect(operator.manipulate({ incoming: {
|
|
117
|
+
expect(operator.manipulate({ incoming: { data: {} } }).default).toBeTruthy();
|
|
118
|
+
expect(operator.manipulate({ incoming: { data: { foo: { bar: 'a' } } } }).incoming.data.baz).toEqual('a');
|
|
119
|
+
expect(operator.manipulate({ incoming: { data: { foo: { bar: 'b' } } } }).incoming.data.baz).toEqual('b');
|
|
120
|
+
expect(operator.manipulate({ incoming: { data: { foo: { bar: 'c' } } } }).incoming.data.baz).toBeUndefined();
|
|
111
121
|
});
|
|
112
122
|
it('should match by schema in incoming body using exec with utils', () => {
|
|
113
123
|
const operator = new operators.$switch(operators, {
|
|
114
|
-
$location: 'incoming.
|
|
124
|
+
$location: 'incoming.data',
|
|
115
125
|
$exec: (payload, { _ }) => _.get(payload, 'foo.bar'),
|
|
116
126
|
$cases: {
|
|
117
|
-
'a': { $set: { $location: 'incoming.
|
|
118
|
-
'b': { $set: { $location: 'incoming.
|
|
127
|
+
'a': { $set: { $location: 'incoming.data', $path: 'baz', $value: 'a' } },
|
|
128
|
+
'b': { $set: { $location: 'incoming.data', $path: 'baz', $value: 'b' } },
|
|
119
129
|
},
|
|
120
130
|
$default: { $exec: ({ context }) => context.default = true },
|
|
121
131
|
});
|
|
122
|
-
expect(operator.manipulate({ incoming: {
|
|
123
|
-
expect(operator.manipulate({ incoming: {
|
|
124
|
-
expect(operator.manipulate({ incoming: {
|
|
125
|
-
expect(operator.manipulate({ incoming: {
|
|
132
|
+
expect(operator.manipulate({ incoming: { data: {} } }).default).toBeTruthy();
|
|
133
|
+
expect(operator.manipulate({ incoming: { data: { foo: { bar: 'a' } } } }).incoming.data.baz).toEqual('a');
|
|
134
|
+
expect(operator.manipulate({ incoming: { data: { foo: { bar: 'b' } } } }).incoming.data.baz).toEqual('b');
|
|
135
|
+
expect(operator.manipulate({ incoming: { data: { foo: { bar: 'c' } } } }).incoming.data.baz).toBeUndefined();
|
|
126
136
|
});
|
|
127
137
|
});
|
|
128
138
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"switch.operator.spec.js","sourceRoot":"","sources":["../../../../src/expectations/operators/switch.operator.spec.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"switch.operator.spec.js","sourceRoot":"","sources":["../../../../src/expectations/operators/switch.operator.spec.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mDAAqC;AAErC,QAAQ,CAAC,+BAA+B,EAAE,GAAG,EAAE;IAC7C,QAAQ,CAAC,UAAU,EAAE,GAAG,EAAE;QACxB,EAAE,CAAC,oDAAoD,EAAE,GAAG,EAAE;YAC5D,MAAM,QAAQ,GAAG,IAAI,SAAS,CAAC,OAAO,CAAM,SAAS,EAAE;gBACrD,SAAS,EAAE,eAAe;gBAC1B,KAAK,EAAE,SAAS;gBAEhB,MAAM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EAAE,CAAC,OAAO,CAAC,OAAO,GAAG,IAAI,EAAE;aAC7D,CAAC,CAAC;YAEH,MAAM,CAAC,QAAQ,CAAC,UAAU,CAAM,EAAE,QAAQ,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,UAAU,EAAE,CAAC;YAElF,MAAM,CACJ,QAAQ,CAAC,UAAU,CAAM,EAAE,QAAQ,EAAE,EAAE,IAAI,EAAE,EAAE,GAAG,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAC1F,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;YAEf,MAAM,CACJ,QAAQ,CAAC,UAAU,CAAM,EAAE,QAAQ,EAAE,EAAE,IAAI,EAAE,EAAE,GAAG,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAC1F,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;YAEf,MAAM,CACJ,QAAQ,CAAC,UAAU,CAAM,EAAE,QAAQ,EAAE,EAAE,IAAI,EAAE,EAAE,GAAG,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAC1F,CAAC,aAAa,EAAE,CAAC;QACpB,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Observable } from 'rxjs';
|
|
2
2
|
import type { faker } from '@faker-js/faker';
|
|
3
3
|
import type dayjs from 'dayjs';
|
|
4
|
+
import type * as rxjs from 'rxjs';
|
|
4
5
|
import type _ from 'lodash';
|
|
5
|
-
import type {
|
|
6
|
-
import type {
|
|
6
|
+
import type { Container, IRequestContextIncoming, IRequestContextOutgoing, RequestContextSnapshot } from '../server/models';
|
|
7
|
+
import type { ConvertTupleToUnion, ExtractObjectValueByPath } from '../types';
|
|
7
8
|
import type { MetaContext } from '../meta';
|
|
8
9
|
import type { Logger } from '../logger';
|
|
9
10
|
import type * as operators from './operators';
|
|
@@ -17,8 +18,6 @@ import type MergeExpectationOperator from './operators/merge.operator';
|
|
|
17
18
|
import type RemoveExpectationOperator from './operators/remove.operator';
|
|
18
19
|
import type ExecExpectationOperator from './operators/exec.operator';
|
|
19
20
|
import type SwitchExpectationOperator from './operators/switch.operator';
|
|
20
|
-
export type TExpectationType = ConvertTupleToUnion<typeof LExpectationType>;
|
|
21
|
-
export declare const LExpectationType: readonly ["HTTP"];
|
|
22
21
|
export type TExpectationFlatOperator = ConvertTupleToUnion<typeof LExpectationFlatOperator>;
|
|
23
22
|
export declare const LExpectationFlatOperator: readonly ["$set", "$remove", "$merge", "$exec", "$has"];
|
|
24
23
|
export type TExpectationMetaTagLocation = ConvertTupleToUnion<typeof LExpectationMetaTagLocation>;
|
|
@@ -36,20 +35,36 @@ export interface IExpectationMeta {
|
|
|
36
35
|
}
|
|
37
36
|
export type TExpectationContextLocation = 'request' | 'response';
|
|
38
37
|
export type TExpectationOperatorLocation = ConvertTupleToUnion<typeof LExpectationOperatorLocation>;
|
|
39
|
-
export declare const LExpectationOperatorLocation: readonly ["container", "cache", "state", "seed", "error", "delay", "path", "method", "incoming.
|
|
40
|
-
export type TExpectationOperatorObjectLocation = 'cache' | 'state' | 'incoming.
|
|
38
|
+
export declare const LExpectationOperatorLocation: readonly ["transport", "event", "flags", "container", "cache", "state", "seed", "error", "delay", "path", "method", "incoming.data", "incoming.dataRaw", "incoming.query", "incoming.headers", "incoming.stream", "outgoing.data", "outgoing.dataRaw", "outgoing.status", "outgoing.headers", "outgoing.stream"];
|
|
39
|
+
export type TExpectationOperatorObjectLocation = 'cache' | 'state' | 'flags' | 'incoming.data' | 'incoming.headers' | 'incoming.query' | 'outgoing.data' | 'outgoing.headers';
|
|
41
40
|
export type TExpectationOperators = Omit<typeof operators, 'root'>;
|
|
42
|
-
export interface
|
|
41
|
+
export interface IExpectationSchemaInput {
|
|
42
|
+
state?: Record<string, any>;
|
|
43
|
+
incoming?: Pick<IRequestContextIncoming, 'query' | 'data'>;
|
|
44
|
+
outgoing?: Pick<IRequestContextOutgoing, 'data'>;
|
|
43
45
|
container?: object;
|
|
46
|
+
transport?: any;
|
|
47
|
+
event?: any;
|
|
48
|
+
flag?: any;
|
|
44
49
|
}
|
|
45
|
-
|
|
46
|
-
|
|
50
|
+
type ExtractData<T extends IExpectationSchemaInput['incoming'] | IExpectationSchemaInput['outgoing']> = 'data' extends keyof T ? T['data'] : any;
|
|
51
|
+
export interface IExpectationSchemaContext<TInput extends IExpectationSchemaInput = {}> {
|
|
52
|
+
transport: TInput['transport'];
|
|
53
|
+
event: TInput['event'];
|
|
54
|
+
flags: Partial<Record<TInput['flag'], boolean>>;
|
|
55
|
+
state: TInput['state'] extends object ? TInput['state'] : Record<string, any>;
|
|
56
|
+
storage: RequestContextSnapshot['storage'];
|
|
47
57
|
cache: TInput extends object ? RequestContextSnapshot['cache'] : any;
|
|
48
|
-
state: TInput['state'];
|
|
49
58
|
container?: Container<NonNullable<TInput['container']>>;
|
|
50
59
|
seed?: RequestContextSnapshot['seed'];
|
|
51
|
-
incoming: TInput['incoming'] extends
|
|
52
|
-
|
|
60
|
+
incoming: TInput['incoming'] extends object ? Omit<IRequestContextIncoming, 'stream'> & TInput['incoming'] & {
|
|
61
|
+
data?: ExtractData<TInput['incoming']>;
|
|
62
|
+
stream?: Observable<ExtractData<TInput['incoming']>>;
|
|
63
|
+
} : IRequestContextIncoming;
|
|
64
|
+
outgoing: TInput['outgoing'] extends object ? IRequestContextOutgoing & TInput['outgoing'] & {
|
|
65
|
+
data?: ExtractData<TInput['outgoing']>;
|
|
66
|
+
stream?: Observable<ExtractData<TInput['outgoing']>>;
|
|
67
|
+
} : IRequestContextOutgoing;
|
|
53
68
|
}
|
|
54
69
|
type ConvertExpectationLocationToContextPath<TLocation extends TExpectationOperatorLocation> = TLocation extends 'path' | 'method' | 'error' | 'delay' ? {
|
|
55
70
|
path: 'incoming.path';
|
|
@@ -57,11 +72,11 @@ type ConvertExpectationLocationToContextPath<TLocation extends TExpectationOpera
|
|
|
57
72
|
error: 'incoming.error';
|
|
58
73
|
method: 'incoming.method';
|
|
59
74
|
}[TLocation] : TLocation;
|
|
60
|
-
export type ExtractExpectationContextValueByLocation<TContext extends object, TLocation extends TExpectationOperatorLocation, T = ExtractObjectValueByPath<TContext, ConvertExpectationLocationToContextPath<TLocation>>, U = ExtractObjectValueByPath<
|
|
61
|
-
export type ExtractExpectationContextValue<TContext extends
|
|
62
|
-
export type CompileExpectationOperatorValue<TContext extends
|
|
63
|
-
export type CompileExpectationOperatorValueWithPredicate<TContext extends
|
|
64
|
-
export interface IExpectationOperatorsSchema<TContext extends
|
|
75
|
+
export type ExtractExpectationContextValueByLocation<TContext extends object, TLocation extends TExpectationOperatorLocation, T = ExtractObjectValueByPath<TContext, ConvertExpectationLocationToContextPath<TLocation>>, U = ExtractObjectValueByPath<IExpectationSchemaContext, ConvertExpectationLocationToContextPath<TLocation>>> = Exclude<T, never> extends never ? Exclude<U, never> extends never ? any : U : T;
|
|
76
|
+
export type ExtractExpectationContextValue<TContext extends IExpectationSchemaContext, 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;
|
|
77
|
+
export type CompileExpectationOperatorValue<TContext extends IExpectationSchemaContext, TLocation extends TExpectationOperatorLocation, TProvided = void, T = ExtractExpectationContextValue<TContext, TLocation>> = Exclude<TProvided, void> extends never ? T : TProvided;
|
|
78
|
+
export type CompileExpectationOperatorValueWithPredicate<TContext extends IExpectationSchemaContext, TLocation extends TExpectationOperatorLocation, TProvided = void, T = CompileExpectationOperatorValue<TContext, TLocation, TProvided>> = T extends object ? (T | object) : T;
|
|
79
|
+
export interface IExpectationOperatorsSchema<TContext extends IExpectationSchemaContext = IExpectationSchemaContext, TLocation extends TExpectationOperatorLocation = TExpectationOperatorLocation, TValue = void> {
|
|
65
80
|
$and?: AndExpectationOperator<TContext, TLocation, TValue>['TSchema'];
|
|
66
81
|
$or?: OrExpectationOperator<TContext, TLocation, TValue>['TSchema'];
|
|
67
82
|
$not?: NotExpectationOperator<TContext, TLocation, TValue>['TSchema'];
|
|
@@ -73,33 +88,36 @@ export interface IExpectationOperatorsSchema<TContext extends IExpectationOperat
|
|
|
73
88
|
$remove?: RemoveExpectationOperator<TContext, TLocation>['TSchema'];
|
|
74
89
|
$exec?: ExecExpectationOperator<TContext>['TSchema'];
|
|
75
90
|
}
|
|
76
|
-
export interface
|
|
91
|
+
export interface IExpectationSchemaForward {
|
|
92
|
+
url?: string;
|
|
93
|
+
baseUrl?: string;
|
|
94
|
+
timeout?: number;
|
|
95
|
+
cache?: Pick<RequestContextSnapshot['cache'], 'key' | 'prefix' | 'ttl'> & {
|
|
96
|
+
storage?: 'redis';
|
|
97
|
+
};
|
|
98
|
+
options?: {
|
|
99
|
+
host?: 'origin';
|
|
100
|
+
};
|
|
101
|
+
proxy?: {
|
|
102
|
+
host: string;
|
|
103
|
+
port: number;
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
export interface IExpectationSchema<TContext extends IExpectationSchemaContext = IExpectationSchemaContext> {
|
|
77
107
|
request?: IExpectationOperatorsSchema<TContext>;
|
|
78
108
|
response?: IExpectationOperatorsSchema<TContext>;
|
|
79
|
-
forward?:
|
|
80
|
-
url?: string;
|
|
81
|
-
baseUrl?: string;
|
|
82
|
-
timeout?: number;
|
|
83
|
-
cache?: Pick<RequestContextSnapshot['cache'], 'key' | 'prefix' | 'ttl'> & {
|
|
84
|
-
storage?: 'redis';
|
|
85
|
-
};
|
|
86
|
-
options?: {
|
|
87
|
-
host?: 'origin';
|
|
88
|
-
};
|
|
89
|
-
proxy?: AxiosProxyConfig & {
|
|
90
|
-
protocol: TRequestProtocol;
|
|
91
|
-
};
|
|
92
|
-
};
|
|
109
|
+
forward?: IExpectationSchemaForward;
|
|
93
110
|
}
|
|
94
|
-
export type
|
|
95
|
-
export interface
|
|
111
|
+
export type IExpectationExecMode = 'match' | 'manipulate';
|
|
112
|
+
export interface IExpectationExecUtils<T extends IExpectationSchemaContext> {
|
|
96
113
|
context: T;
|
|
97
114
|
logger: Logger;
|
|
98
|
-
mode:
|
|
115
|
+
mode: IExpectationExecMode;
|
|
99
116
|
meta: MetaContext;
|
|
100
117
|
T: <T = any>(payload: unknown) => T;
|
|
101
118
|
_: typeof _;
|
|
102
119
|
d: typeof dayjs;
|
|
120
|
+
rx: typeof rxjs;
|
|
103
121
|
faker: typeof faker;
|
|
104
122
|
}
|
|
105
123
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/expectations/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/expectations/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AACvC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,KAAK,IAAI,MAAM,MAAM,CAAC;AAClC,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAE5B,OAAO,KAAK,EAAE,SAAS,EAAE,uBAAuB,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAC5H,OAAO,KAAK,EAAE,mBAAmB,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAC;AAC9E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS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3
|
-
exports.LExpectationOperatorLocation = exports.LExpectationMetaTagLocation = exports.LExpectationFlatOperator =
|
|
4
|
-
exports.LExpectationType = ['HTTP'];
|
|
3
|
+
exports.LExpectationOperatorLocation = exports.LExpectationMetaTagLocation = exports.LExpectationFlatOperator = void 0;
|
|
5
4
|
exports.LExpectationFlatOperator = ['$set', '$remove', '$merge', '$exec', '$has'];
|
|
6
5
|
exports.LExpectationMetaTagLocation = ['path', 'method', 'outgoing.status'];
|
|
7
6
|
;
|
|
8
7
|
exports.LExpectationOperatorLocation = [
|
|
8
|
+
'transport',
|
|
9
|
+
'event',
|
|
10
|
+
'flags',
|
|
9
11
|
'container',
|
|
10
12
|
'cache',
|
|
11
13
|
'state',
|
|
@@ -14,14 +16,16 @@ exports.LExpectationOperatorLocation = [
|
|
|
14
16
|
'delay',
|
|
15
17
|
'path',
|
|
16
18
|
'method',
|
|
17
|
-
'incoming.
|
|
18
|
-
'incoming.
|
|
19
|
+
'incoming.data',
|
|
20
|
+
'incoming.dataRaw',
|
|
19
21
|
'incoming.query',
|
|
20
22
|
'incoming.headers',
|
|
21
|
-
'
|
|
22
|
-
'outgoing.headers',
|
|
23
|
+
'incoming.stream',
|
|
23
24
|
'outgoing.data',
|
|
24
25
|
'outgoing.dataRaw',
|
|
26
|
+
'outgoing.status',
|
|
27
|
+
'outgoing.headers',
|
|
28
|
+
'outgoing.stream',
|
|
25
29
|
];
|
|
26
30
|
;
|
|
27
31
|
;
|
|
@@ -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":";;;AAyBa,QAAA,wBAAwB,GAAU,CAAC,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;AAGjF,QAAA,2BAA2B,GAAU,CAAC,MAAM,EAAE,QAAQ,EAAE,iBAAiB,CAAC,CAAC;AASvF,CAAC;AAKW,QAAA,4BAA4B,GAAU;IACjD,WAAW;IACX,OAAO;IACP,OAAO;IAEP,WAAW;IACX,OAAO;IACP,OAAO;IACP,MAAM;IACN,OAAO;IACP,OAAO;IAEP,MAAM;IACN,QAAQ;IAER,eAAe;IACf,kBAAkB;IAClB,gBAAgB;IAChB,kBAAkB;IAClB,iBAAiB;IAEjB,eAAe;IACf,kBAAkB;IAClB,iBAAiB;IACjB,kBAAkB;IAClB,iBAAiB;CAClB,CAAC;AAsDD,CAAC;AA2DD,CAAC;AAyBD,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IExpectationSchema,
|
|
1
|
+
import { IExpectationSchema, IExpectationSchemaContext, TExpectationOperatorLocation } from './types';
|
|
2
2
|
type TBaseExtractedContext = {
|
|
3
3
|
parent: object;
|
|
4
4
|
key: string;
|
|
@@ -13,8 +13,8 @@ type TExtractedContext = (TBaseExtractedContext & {
|
|
|
13
13
|
value?: number;
|
|
14
14
|
type: 'number';
|
|
15
15
|
});
|
|
16
|
-
export declare const checkIsLocationInContext: (location: TExpectationOperatorLocation, context:
|
|
17
|
-
export declare const extractContextByLocation: (location: TExpectationOperatorLocation, context:
|
|
18
|
-
export declare const introspectExpectationOperatorsSchema: <T extends object = IExpectationSchema<
|
|
16
|
+
export declare const checkIsLocationInContext: (location: TExpectationOperatorLocation, context: IExpectationSchemaContext) => boolean;
|
|
17
|
+
export declare const extractContextByLocation: (location: TExpectationOperatorLocation, context: IExpectationSchemaContext) => TExtractedContext | null;
|
|
18
|
+
export declare const introspectExpectationOperatorsSchema: <T extends object = IExpectationSchema<IExpectationSchemaContext<{}>>, K extends keyof T = keyof T>(schema: T, handler: (key: K, schema: T, path: string) => unknown, location?: string) => void;
|
|
19
19
|
export {};
|
|
20
20
|
//# 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,EAGlB,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/expectations/utils.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,kBAAkB,EAGlB,yBAAyB,EACzB,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,yBAAyB,KACjC,OASF,CAAA;AAED,eAAO,MAAM,wBAAwB,aACzB,4BAA4B,WAC7B,yBAAyB,KACjC,iBAAiB,GAAG,IAuJtB,CAAA;AAED,eAAO,MAAM,oCAAoC,GAAI,CAAC,SAAS,MAAM,sDAAuB,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"}
|
|
@@ -11,8 +11,8 @@ const checkIsLocationInContext = (location, context) => {
|
|
|
11
11
|
case 'delay':
|
|
12
12
|
case 'error':
|
|
13
13
|
case 'method':
|
|
14
|
-
case 'path': return
|
|
15
|
-
default: return lodash_1.default.
|
|
14
|
+
case 'path': return context.incoming[location] !== undefined;
|
|
15
|
+
default: return lodash_1.default.get(context, location) !== undefined;
|
|
16
16
|
}
|
|
17
17
|
};
|
|
18
18
|
exports.checkIsLocationInContext = checkIsLocationInContext;
|
|
@@ -30,17 +30,17 @@ const extractContextByLocation = (location, context) => {
|
|
|
30
30
|
parent: context,
|
|
31
31
|
value: context.incoming?.method,
|
|
32
32
|
};
|
|
33
|
-
case 'incoming.
|
|
34
|
-
key: 'incoming.
|
|
33
|
+
case 'incoming.data': return {
|
|
34
|
+
key: 'incoming.data',
|
|
35
35
|
type: 'object',
|
|
36
36
|
parent: context,
|
|
37
|
-
value: context.incoming?.
|
|
37
|
+
value: context.incoming?.data,
|
|
38
38
|
};
|
|
39
|
-
case 'incoming.
|
|
40
|
-
key: 'incoming.
|
|
39
|
+
case 'incoming.dataRaw': return {
|
|
40
|
+
key: 'incoming.dataRaw',
|
|
41
41
|
type: 'string',
|
|
42
42
|
parent: context,
|
|
43
|
-
value: context.incoming?.
|
|
43
|
+
value: context.incoming?.dataRaw,
|
|
44
44
|
};
|
|
45
45
|
case 'incoming.query': return {
|
|
46
46
|
key: 'incoming.query',
|
|
@@ -54,6 +54,12 @@ const extractContextByLocation = (location, context) => {
|
|
|
54
54
|
parent: context,
|
|
55
55
|
value: context.incoming?.headers,
|
|
56
56
|
};
|
|
57
|
+
case 'incoming.stream': return {
|
|
58
|
+
key: 'incoming.stream',
|
|
59
|
+
type: 'object',
|
|
60
|
+
parent: context,
|
|
61
|
+
value: context.incoming.stream,
|
|
62
|
+
};
|
|
57
63
|
case 'outgoing.data': return {
|
|
58
64
|
key: 'outgoing.data',
|
|
59
65
|
type: 'object',
|
|
@@ -78,6 +84,12 @@ const extractContextByLocation = (location, context) => {
|
|
|
78
84
|
parent: context,
|
|
79
85
|
value: context.outgoing?.status,
|
|
80
86
|
};
|
|
87
|
+
case 'outgoing.stream': return {
|
|
88
|
+
key: 'outgoing.stream',
|
|
89
|
+
type: 'object',
|
|
90
|
+
parent: context,
|
|
91
|
+
value: context.outgoing.stream,
|
|
92
|
+
};
|
|
81
93
|
case 'delay': return {
|
|
82
94
|
key: 'incoming.delay',
|
|
83
95
|
type: 'number',
|
|
@@ -114,6 +126,24 @@ const extractContextByLocation = (location, context) => {
|
|
|
114
126
|
parent: context,
|
|
115
127
|
value: context.container,
|
|
116
128
|
};
|
|
129
|
+
case 'transport': return {
|
|
130
|
+
key: 'transport',
|
|
131
|
+
type: 'string',
|
|
132
|
+
parent: context,
|
|
133
|
+
value: context.transport,
|
|
134
|
+
};
|
|
135
|
+
case 'event': return {
|
|
136
|
+
key: 'event',
|
|
137
|
+
type: 'string',
|
|
138
|
+
parent: context,
|
|
139
|
+
value: context.event,
|
|
140
|
+
};
|
|
141
|
+
case 'flags': return {
|
|
142
|
+
key: 'flags',
|
|
143
|
+
type: 'object',
|
|
144
|
+
parent: context,
|
|
145
|
+
value: context.flags,
|
|
146
|
+
};
|
|
117
147
|
default: return null;
|
|
118
148
|
}
|
|
119
149
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/expectations/utils.ts"],"names":[],"mappings":";;;;;;AAAA,oDAAuB;AAEvB,mCAMiB;AAQV,MAAM,wBAAwB,GAAG,CACtC,QAAsC,EACtC,
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/expectations/utils.ts"],"names":[],"mappings":";;;;;;AAAA,oDAAuB;AAEvB,mCAMiB;AAQV,MAAM,wBAAwB,GAAG,CACtC,QAAsC,EACtC,OAAkC,EACzB,EAAE;IACX,QAAO,QAAQ,EAAE,CAAC;QAChB,KAAK,OAAO,CAAC;QACb,KAAK,OAAO,CAAC;QACb,KAAK,QAAQ,CAAC;QACd,KAAK,MAAM,CAAC,CAAC,OAAO,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,KAAK,SAAS,CAAC;QAE7D,OAAO,CAAC,CAAC,OAAO,gBAAC,CAAC,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