@n1k1t/mock-server 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +61 -0
- package/lib/package.json +77 -0
- package/lib/src/cli.d.ts +2 -0
- package/lib/src/cli.d.ts.map +1 -0
- package/lib/src/cli.js +33 -0
- package/lib/src/cli.js.map +1 -0
- package/lib/src/client/errors/connection.error.d.ts +6 -0
- package/lib/src/client/errors/connection.error.d.ts.map +1 -0
- package/lib/src/client/errors/connection.error.js +11 -0
- package/lib/src/client/errors/connection.error.js.map +1 -0
- package/lib/src/client/errors/index.d.ts +4 -0
- package/lib/src/client/errors/index.d.ts.map +1 -0
- package/lib/src/client/errors/index.js +20 -0
- package/lib/src/client/errors/index.js.map +1 -0
- package/lib/src/client/errors/internal-server.error.d.ts +6 -0
- package/lib/src/client/errors/internal-server.error.d.ts.map +1 -0
- package/lib/src/client/errors/internal-server.error.js +11 -0
- package/lib/src/client/errors/internal-server.error.js.map +1 -0
- package/lib/src/client/errors/types.d.ts +4 -0
- package/lib/src/client/errors/types.d.ts.map +1 -0
- package/lib/src/client/errors/types.js +3 -0
- package/lib/src/client/errors/types.js.map +1 -0
- package/lib/src/client/errors/validation.error.d.ts +7 -0
- package/lib/src/client/errors/validation.error.d.ts.map +1 -0
- package/lib/src/client/errors/validation.error.js +12 -0
- package/lib/src/client/errors/validation.error.js.map +1 -0
- package/lib/src/client/index.d.ts +9 -0
- package/lib/src/client/index.d.ts.map +1 -0
- package/lib/src/client/index.js +59 -0
- package/lib/src/client/index.js.map +1 -0
- package/lib/src/client/methods/expectations/create.method.d.ts +6 -0
- package/lib/src/client/methods/expectations/create.method.d.ts.map +1 -0
- package/lib/src/client/methods/expectations/create.method.js +13 -0
- package/lib/src/client/methods/expectations/create.method.js.map +1 -0
- package/lib/src/client/methods/expectations/delete-all.method.d.ts +3 -0
- package/lib/src/client/methods/expectations/delete-all.method.d.ts.map +1 -0
- package/lib/src/client/methods/expectations/delete-all.method.js +11 -0
- package/lib/src/client/methods/expectations/delete-all.method.js.map +1 -0
- package/lib/src/client/methods/expectations/delete.method.d.ts +4 -0
- package/lib/src/client/methods/expectations/delete.method.d.ts.map +1 -0
- package/lib/src/client/methods/expectations/delete.method.js +12 -0
- package/lib/src/client/methods/expectations/delete.method.js.map +1 -0
- package/lib/src/client/methods/expectations/index.d.ts +5 -0
- package/lib/src/client/methods/expectations/index.d.ts.map +1 -0
- package/lib/src/client/methods/expectations/index.js +15 -0
- package/lib/src/client/methods/expectations/index.js.map +1 -0
- package/lib/src/client/methods/expectations/types.d.ts +18 -0
- package/lib/src/client/methods/expectations/types.d.ts.map +1 -0
- package/lib/src/client/methods/expectations/types.js +3 -0
- package/lib/src/client/methods/expectations/types.js.map +1 -0
- package/lib/src/client/methods/expectations/update.method.d.ts +8 -0
- package/lib/src/client/methods/expectations/update.method.d.ts.map +1 -0
- package/lib/src/client/methods/expectations/update.method.js +16 -0
- package/lib/src/client/methods/expectations/update.method.js.map +1 -0
- package/lib/src/client/methods/expectations/utils.d.ts +3 -0
- package/lib/src/client/methods/expectations/utils.d.ts.map +1 -0
- package/lib/src/client/methods/expectations/utils.js +26 -0
- package/lib/src/client/methods/expectations/utils.js.map +1 -0
- package/lib/src/client/methods/index.d.ts +2 -0
- package/lib/src/client/methods/index.d.ts.map +1 -0
- package/lib/src/client/methods/index.js +18 -0
- package/lib/src/client/methods/index.js.map +1 -0
- package/lib/src/client/types.d.ts +6 -0
- package/lib/src/client/types.d.ts.map +1 -0
- package/lib/src/client/types.js +3 -0
- package/lib/src/client/types.js.map +1 -0
- package/lib/src/client/utils.d.ts +5 -0
- package/lib/src/client/utils.d.ts.map +1 -0
- package/lib/src/client/utils.js +27 -0
- package/lib/src/client/utils.js.map +1 -0
- package/lib/src/config/index.d.ts +8 -0
- package/lib/src/config/index.d.ts.map +1 -0
- package/lib/src/config/index.js +17 -0
- package/lib/src/config/index.js.map +1 -0
- package/lib/src/index.d.ts +5 -0
- package/lib/src/index.d.ts.map +1 -0
- package/lib/src/index.js +21 -0
- package/lib/src/index.js.map +1 -0
- package/lib/src/process.d.ts +2 -0
- package/lib/src/process.d.ts.map +1 -0
- package/lib/src/process.js +7 -0
- package/lib/src/process.js.map +1 -0
- package/lib/src/server/endpoints/config.get.endpoint.d.ts +18 -0
- package/lib/src/server/endpoints/config.get.endpoint.d.ts.map +1 -0
- package/lib/src/server/endpoints/config.get.endpoint.js +12 -0
- package/lib/src/server/endpoints/config.get.endpoint.js.map +1 -0
- package/lib/src/server/endpoints/expectations.create.endpoint.d.ts +21 -0
- package/lib/src/server/endpoints/expectations.create.endpoint.d.ts.map +1 -0
- package/lib/src/server/endpoints/expectations.create.endpoint.js +15 -0
- package/lib/src/server/endpoints/expectations.create.endpoint.js.map +1 -0
- package/lib/src/server/endpoints/expectations.delete-all.endpoint.d.ts +11 -0
- package/lib/src/server/endpoints/expectations.delete-all.endpoint.d.ts.map +1 -0
- package/lib/src/server/endpoints/expectations.delete-all.endpoint.js +11 -0
- package/lib/src/server/endpoints/expectations.delete-all.endpoint.js.map +1 -0
- package/lib/src/server/endpoints/expectations.delete.endpoint.d.ts +19 -0
- package/lib/src/server/endpoints/expectations.delete.endpoint.d.ts.map +1 -0
- package/lib/src/server/endpoints/expectations.delete.endpoint.js +14 -0
- package/lib/src/server/endpoints/expectations.delete.endpoint.js.map +1 -0
- package/lib/src/server/endpoints/expectations.get-list.endpoint.d.ts +16 -0
- package/lib/src/server/endpoints/expectations.get-list.endpoint.d.ts.map +1 -0
- package/lib/src/server/endpoints/expectations.get-list.endpoint.js +9 -0
- package/lib/src/server/endpoints/expectations.get-list.endpoint.js.map +1 -0
- package/lib/src/server/endpoints/expectations.update.endpoint.d.ts +27 -0
- package/lib/src/server/endpoints/expectations.update.endpoint.d.ts.map +1 -0
- package/lib/src/server/endpoints/expectations.update.endpoint.js +27 -0
- package/lib/src/server/endpoints/expectations.update.endpoint.js.map +1 -0
- package/lib/src/server/endpoints/history-records.get-list.endpoint.d.ts +16 -0
- package/lib/src/server/endpoints/history-records.get-list.endpoint.d.ts.map +1 -0
- package/lib/src/server/endpoints/history-records.get-list.endpoint.js +11 -0
- package/lib/src/server/endpoints/history-records.get-list.endpoint.js.map +1 -0
- package/lib/src/server/endpoints/index.d.ts +9 -0
- package/lib/src/server/endpoints/index.d.ts.map +1 -0
- package/lib/src/server/endpoints/index.js +23 -0
- package/lib/src/server/endpoints/index.js.map +1 -0
- package/lib/src/server/endpoints/model.d.ts +26 -0
- package/lib/src/server/endpoints/model.d.ts.map +1 -0
- package/lib/src/server/endpoints/model.js +19 -0
- package/lib/src/server/endpoints/model.js.map +1 -0
- package/lib/src/server/endpoints/ping.endpoint.d.ts +15 -0
- package/lib/src/server/endpoints/ping.endpoint.d.ts.map +1 -0
- package/lib/src/server/endpoints/ping.endpoint.js +9 -0
- package/lib/src/server/endpoints/ping.endpoint.js.map +1 -0
- package/lib/src/server/expectations/__utils__/index.d.ts +3 -0
- package/lib/src/server/expectations/__utils__/index.d.ts.map +1 -0
- package/lib/src/server/expectations/__utils__/index.js +36 -0
- package/lib/src/server/expectations/__utils__/index.js.map +1 -0
- package/lib/src/server/expectations/errors/index.d.ts +6 -0
- package/lib/src/server/expectations/errors/index.d.ts.map +1 -0
- package/lib/src/server/expectations/errors/index.js +11 -0
- package/lib/src/server/expectations/errors/index.js.map +1 -0
- package/lib/src/server/expectations/index.d.ts +5 -0
- package/lib/src/server/expectations/index.d.ts.map +1 -0
- package/lib/src/server/expectations/index.js +21 -0
- package/lib/src/server/expectations/index.js.map +1 -0
- package/lib/src/server/expectations/model.d.ts +37 -0
- package/lib/src/server/expectations/model.d.ts.map +1 -0
- package/lib/src/server/expectations/model.js +90 -0
- package/lib/src/server/expectations/model.js.map +1 -0
- package/lib/src/server/expectations/operators/and.operator.d.ts +3 -0
- package/lib/src/server/expectations/operators/and.operator.d.ts.map +1 -0
- package/lib/src/server/expectations/operators/and.operator.js +5 -0
- package/lib/src/server/expectations/operators/and.operator.js.map +1 -0
- package/lib/src/server/expectations/operators/and.operator.spec.d.ts +2 -0
- package/lib/src/server/expectations/operators/and.operator.spec.d.ts.map +1 -0
- package/lib/src/server/expectations/operators/and.operator.spec.js +55 -0
- package/lib/src/server/expectations/operators/and.operator.spec.js.map +1 -0
- package/lib/src/server/expectations/operators/exec.operator.d.ts +9 -0
- package/lib/src/server/expectations/operators/exec.operator.d.ts.map +1 -0
- package/lib/src/server/expectations/operators/exec.operator.js +15 -0
- package/lib/src/server/expectations/operators/exec.operator.js.map +1 -0
- package/lib/src/server/expectations/operators/exec.operator.spec.d.ts +2 -0
- package/lib/src/server/expectations/operators/exec.operator.spec.d.ts.map +1 -0
- package/lib/src/server/expectations/operators/exec.operator.spec.js +27 -0
- package/lib/src/server/expectations/operators/exec.operator.spec.js.map +1 -0
- package/lib/src/server/expectations/operators/has.operator.d.ts +3 -0
- package/lib/src/server/expectations/operators/has.operator.d.ts.map +1 -0
- package/lib/src/server/expectations/operators/has.operator.js +83 -0
- package/lib/src/server/expectations/operators/has.operator.js.map +1 -0
- package/lib/src/server/expectations/operators/has.operator.spec.d.ts +2 -0
- package/lib/src/server/expectations/operators/has.operator.spec.d.ts.map +1 -0
- package/lib/src/server/expectations/operators/has.operator.spec.js +173 -0
- package/lib/src/server/expectations/operators/has.operator.spec.js.map +1 -0
- package/lib/src/server/expectations/operators/if.operator.d.ts +3 -0
- package/lib/src/server/expectations/operators/if.operator.d.ts.map +1 -0
- package/lib/src/server/expectations/operators/if.operator.js +15 -0
- package/lib/src/server/expectations/operators/if.operator.js.map +1 -0
- package/lib/src/server/expectations/operators/if.operator.spec.d.ts +2 -0
- package/lib/src/server/expectations/operators/if.operator.spec.d.ts.map +1 -0
- package/lib/src/server/expectations/operators/if.operator.spec.js +98 -0
- package/lib/src/server/expectations/operators/if.operator.spec.js.map +1 -0
- package/lib/src/server/expectations/operators/index.d.ts +10 -0
- package/lib/src/server/expectations/operators/index.d.ts.map +1 -0
- package/lib/src/server/expectations/operators/index.js +25 -0
- package/lib/src/server/expectations/operators/index.js.map +1 -0
- package/lib/src/server/expectations/operators/merge.operator.d.ts +3 -0
- package/lib/src/server/expectations/operators/merge.operator.d.ts.map +1 -0
- package/lib/src/server/expectations/operators/merge.operator.js +30 -0
- package/lib/src/server/expectations/operators/merge.operator.js.map +1 -0
- package/lib/src/server/expectations/operators/merge.operator.spec.d.ts +2 -0
- package/lib/src/server/expectations/operators/merge.operator.spec.d.ts.map +1 -0
- package/lib/src/server/expectations/operators/merge.operator.spec.js +55 -0
- package/lib/src/server/expectations/operators/merge.operator.spec.js.map +1 -0
- package/lib/src/server/expectations/operators/not.operator.d.ts +3 -0
- package/lib/src/server/expectations/operators/not.operator.d.ts.map +1 -0
- package/lib/src/server/expectations/operators/not.operator.js +5 -0
- package/lib/src/server/expectations/operators/not.operator.js.map +1 -0
- package/lib/src/server/expectations/operators/not.operator.spec.d.ts +2 -0
- package/lib/src/server/expectations/operators/not.operator.spec.d.ts.map +1 -0
- package/lib/src/server/expectations/operators/not.operator.spec.js +17 -0
- package/lib/src/server/expectations/operators/not.operator.spec.js.map +1 -0
- package/lib/src/server/expectations/operators/or.operator.d.ts +3 -0
- package/lib/src/server/expectations/operators/or.operator.d.ts.map +1 -0
- package/lib/src/server/expectations/operators/or.operator.js +9 -0
- package/lib/src/server/expectations/operators/or.operator.js.map +1 -0
- package/lib/src/server/expectations/operators/or.operator.spec.d.ts +2 -0
- package/lib/src/server/expectations/operators/or.operator.spec.d.ts.map +1 -0
- package/lib/src/server/expectations/operators/or.operator.spec.js +55 -0
- package/lib/src/server/expectations/operators/or.operator.spec.js.map +1 -0
- package/lib/src/server/expectations/operators/remove.operator.d.ts +3 -0
- package/lib/src/server/expectations/operators/remove.operator.d.ts.map +1 -0
- package/lib/src/server/expectations/operators/remove.operator.js +28 -0
- package/lib/src/server/expectations/operators/remove.operator.js.map +1 -0
- package/lib/src/server/expectations/operators/remove.operator.spec.d.ts +2 -0
- package/lib/src/server/expectations/operators/remove.operator.spec.d.ts.map +1 -0
- package/lib/src/server/expectations/operators/remove.operator.spec.js +45 -0
- package/lib/src/server/expectations/operators/remove.operator.spec.js.map +1 -0
- package/lib/src/server/expectations/operators/set.operator.d.ts +3 -0
- package/lib/src/server/expectations/operators/set.operator.d.ts.map +1 -0
- package/lib/src/server/expectations/operators/set.operator.js +39 -0
- package/lib/src/server/expectations/operators/set.operator.js.map +1 -0
- package/lib/src/server/expectations/operators/set.operator.spec.d.ts +2 -0
- package/lib/src/server/expectations/operators/set.operator.spec.d.ts.map +1 -0
- package/lib/src/server/expectations/operators/set.operator.spec.js +57 -0
- package/lib/src/server/expectations/operators/set.operator.spec.js.map +1 -0
- package/lib/src/server/expectations/operators/utils.d.ts +20 -0
- package/lib/src/server/expectations/operators/utils.d.ts.map +1 -0
- package/lib/src/server/expectations/operators/utils.js +67 -0
- package/lib/src/server/expectations/operators/utils.js.map +1 -0
- package/lib/src/server/expectations/storage.d.ts +19 -0
- package/lib/src/server/expectations/storage.d.ts.map +1 -0
- package/lib/src/server/expectations/storage.js +35 -0
- package/lib/src/server/expectations/storage.js.map +1 -0
- package/lib/src/server/expectations/types.d.ts +83 -0
- package/lib/src/server/expectations/types.d.ts.map +1 -0
- package/lib/src/server/expectations/types.js +16 -0
- package/lib/src/server/expectations/types.js.map +1 -0
- package/lib/src/server/expectations/utils.d.ts +12 -0
- package/lib/src/server/expectations/utils.d.ts.map +1 -0
- package/lib/src/server/expectations/utils.js +92 -0
- package/lib/src/server/expectations/utils.js.map +1 -0
- package/lib/src/server/expectations/utils.spec.d.ts +2 -0
- package/lib/src/server/expectations/utils.spec.d.ts.map +1 -0
- package/lib/src/server/expectations/utils.spec.js +59 -0
- package/lib/src/server/expectations/utils.spec.js.map +1 -0
- package/lib/src/server/expectations/validation-schemas.d.ts +24 -0
- package/lib/src/server/expectations/validation-schemas.d.ts.map +1 -0
- package/lib/src/server/expectations/validation-schemas.js +36 -0
- package/lib/src/server/expectations/validation-schemas.js.map +1 -0
- package/lib/src/server/history/index.d.ts +4 -0
- package/lib/src/server/history/index.d.ts.map +1 -0
- package/lib/src/server/history/index.js +20 -0
- package/lib/src/server/history/index.js.map +1 -0
- package/lib/src/server/history/model.d.ts +26 -0
- package/lib/src/server/history/model.d.ts.map +1 -0
- package/lib/src/server/history/model.js +33 -0
- package/lib/src/server/history/model.js.map +1 -0
- package/lib/src/server/history/storage.d.ts +7 -0
- package/lib/src/server/history/storage.d.ts.map +1 -0
- package/lib/src/server/history/storage.js +21 -0
- package/lib/src/server/history/storage.js.map +1 -0
- package/lib/src/server/history/types.d.ts +6 -0
- package/lib/src/server/history/types.d.ts.map +1 -0
- package/lib/src/server/history/types.js +3 -0
- package/lib/src/server/history/types.js.map +1 -0
- package/lib/src/server/index.d.ts +5 -0
- package/lib/src/server/index.d.ts.map +1 -0
- package/lib/src/server/index.js +80 -0
- package/lib/src/server/index.js.map +1 -0
- package/lib/src/server/middlewares/add-history.middleware.d.ts +8 -0
- package/lib/src/server/middlewares/add-history.middleware.d.ts.map +1 -0
- package/lib/src/server/middlewares/add-history.middleware.js +14 -0
- package/lib/src/server/middlewares/add-history.middleware.js.map +1 -0
- package/lib/src/server/middlewares/destroy-request.midleware.d.ts +8 -0
- package/lib/src/server/middlewares/destroy-request.midleware.d.ts.map +1 -0
- package/lib/src/server/middlewares/destroy-request.midleware.js +17 -0
- package/lib/src/server/middlewares/destroy-request.midleware.js.map +1 -0
- package/lib/src/server/middlewares/handle-expectation-delay.middleware.d.ts +8 -0
- package/lib/src/server/middlewares/handle-expectation-delay.middleware.d.ts.map +1 -0
- package/lib/src/server/middlewares/handle-expectation-delay.middleware.js +18 -0
- package/lib/src/server/middlewares/handle-expectation-delay.middleware.js.map +1 -0
- package/lib/src/server/middlewares/handle-expectation-forward.middleware.d.ts +8 -0
- package/lib/src/server/middlewares/handle-expectation-forward.middleware.d.ts.map +1 -0
- package/lib/src/server/middlewares/handle-expectation-forward.middleware.js +86 -0
- package/lib/src/server/middlewares/handle-expectation-forward.middleware.js.map +1 -0
- package/lib/src/server/middlewares/index.d.ts +9 -0
- package/lib/src/server/middlewares/index.d.ts.map +1 -0
- package/lib/src/server/middlewares/index.js +23 -0
- package/lib/src/server/middlewares/index.js.map +1 -0
- package/lib/src/server/middlewares/internal-route.middleware.d.ts +6 -0
- package/lib/src/server/middlewares/internal-route.middleware.d.ts.map +1 -0
- package/lib/src/server/middlewares/internal-route.middleware.js +11 -0
- package/lib/src/server/middlewares/internal-route.middleware.js.map +1 -0
- package/lib/src/server/middlewares/model.d.ts +25 -0
- package/lib/src/server/middlewares/model.d.ts.map +1 -0
- package/lib/src/server/middlewares/model.js +36 -0
- package/lib/src/server/middlewares/model.js.map +1 -0
- package/lib/src/server/middlewares/reply.middleware.d.ts +8 -0
- package/lib/src/server/middlewares/reply.middleware.d.ts.map +1 -0
- package/lib/src/server/middlewares/reply.middleware.js +35 -0
- package/lib/src/server/middlewares/reply.middleware.js.map +1 -0
- package/lib/src/server/middlewares/resolve-public.middleware.d.ts +6 -0
- package/lib/src/server/middlewares/resolve-public.middleware.d.ts.map +1 -0
- package/lib/src/server/middlewares/resolve-public.middleware.js +38 -0
- package/lib/src/server/middlewares/resolve-public.middleware.js.map +1 -0
- package/lib/src/server/middlewares/validate-expectation-request.middleware.d.ts +6 -0
- package/lib/src/server/middlewares/validate-expectation-request.middleware.d.ts.map +1 -0
- package/lib/src/server/middlewares/validate-expectation-request.middleware.js +20 -0
- package/lib/src/server/middlewares/validate-expectation-request.middleware.js.map +1 -0
- package/lib/src/server/models/index.d.ts +4 -0
- package/lib/src/server/models/index.d.ts.map +1 -0
- package/lib/src/server/models/index.js +20 -0
- package/lib/src/server/models/index.js.map +1 -0
- package/lib/src/server/models/reply-service/index.d.ts +12 -0
- package/lib/src/server/models/reply-service/index.d.ts.map +1 -0
- package/lib/src/server/models/reply-service/index.js +76 -0
- package/lib/src/server/models/reply-service/index.js.map +1 -0
- package/lib/src/server/models/reply-service/types.d.ts +5 -0
- package/lib/src/server/models/reply-service/types.d.ts.map +1 -0
- package/lib/src/server/models/reply-service/types.js +3 -0
- package/lib/src/server/models/reply-service/types.js.map +1 -0
- package/lib/src/server/models/request-context/index.d.ts +60 -0
- package/lib/src/server/models/request-context/index.d.ts.map +1 -0
- package/lib/src/server/models/request-context/index.js +75 -0
- package/lib/src/server/models/request-context/index.js.map +1 -0
- package/lib/src/server/models/request-context/types.d.ts +23 -0
- package/lib/src/server/models/request-context/types.d.ts.map +1 -0
- package/lib/src/server/models/request-context/types.js +3 -0
- package/lib/src/server/models/request-context/types.js.map +1 -0
- package/lib/src/server/models/request-context/utils.d.ts +6 -0
- package/lib/src/server/models/request-context/utils.d.ts.map +1 -0
- package/lib/src/server/models/request-context/utils.js +56 -0
- package/lib/src/server/models/request-context/utils.js.map +1 -0
- package/lib/src/server/models/server-context/index.d.ts +14 -0
- package/lib/src/server/models/server-context/index.d.ts.map +1 -0
- package/lib/src/server/models/server-context/index.js +20 -0
- package/lib/src/server/models/server-context/index.js.map +1 -0
- package/lib/src/server/proxy.d.ts +10 -0
- package/lib/src/server/proxy.d.ts.map +1 -0
- package/lib/src/server/proxy.js +16 -0
- package/lib/src/server/proxy.js.map +1 -0
- package/lib/src/server/router.d.ts +12 -0
- package/lib/src/server/router.d.ts.map +1 -0
- package/lib/src/server/router.js +49 -0
- package/lib/src/server/router.js.map +1 -0
- package/lib/src/server/types.d.ts +6 -0
- package/lib/src/server/types.d.ts.map +1 -0
- package/lib/src/server/types.js +3 -0
- package/lib/src/server/types.js.map +1 -0
- package/lib/src/server/utils/index.d.ts +11 -0
- package/lib/src/server/utils/index.d.ts.map +1 -0
- package/lib/src/server/utils/index.js +26 -0
- package/lib/src/server/utils/index.js.map +1 -0
- package/lib/src/server/web-socket-exchange/index.d.ts +5 -0
- package/lib/src/server/web-socket-exchange/index.d.ts.map +1 -0
- package/lib/src/server/web-socket-exchange/index.js +23 -0
- package/lib/src/server/web-socket-exchange/index.js.map +1 -0
- package/lib/src/server/web-socket-exchange/types.d.ts +12 -0
- package/lib/src/server/web-socket-exchange/types.d.ts.map +1 -0
- package/lib/src/server/web-socket-exchange/types.js +3 -0
- package/lib/src/server/web-socket-exchange/types.js.map +1 -0
- package/lib/src/types.d.ts +6 -0
- package/lib/src/types.d.ts.map +1 -0
- package/lib/src/types.js +3 -0
- package/lib/src/types.js.map +1 -0
- package/lib/src/utils/index.d.ts +29 -0
- package/lib/src/utils/index.d.ts.map +1 -0
- package/lib/src/utils/index.js +50 -0
- package/lib/src/utils/index.js.map +1 -0
- package/lib/task-processor.d.ts +2 -0
- package/lib/task-processor.d.ts.map +1 -0
- package/lib/task-processor.js +75 -0
- package/lib/task-processor.js.map +1 -0
- package/lib/test/index.d.ts +2 -0
- package/lib/test/index.d.ts.map +1 -0
- package/lib/test/index.js +121 -0
- package/lib/test/index.js.map +1 -0
- package/lib/tsconfig.tsbuildinfo +1 -0
- package/lib/types/common.global.d.ts +69 -0
- package/lib/types/common.global.d.ts.map +1 -0
- package/lib/types/common.global.js +3 -0
- package/lib/types/common.global.js.map +1 -0
- package/lib/types/lib.d.ts +3 -0
- package/lib/types/lib.d.ts.map +1 -0
- package/lib/types/lib.js +19 -0
- package/lib/types/lib.js.map +1 -0
- package/package.json +77 -0
- package/public/fonts/fa-regular-400.eot +0 -0
- package/public/fonts/fa-regular-400.svg +801 -0
- package/public/fonts/fa-regular-400.ttf +0 -0
- package/public/fonts/fa-regular-400.woff +0 -0
- package/public/fonts/fa-regular-400.woff2 +0 -0
- package/public/fonts/fa-solid-900.eot +0 -0
- package/public/fonts/fa-solid-900.svg +5028 -0
- package/public/fonts/fa-solid-900.ttf +0 -0
- package/public/fonts/fa-solid-900.woff +0 -0
- package/public/fonts/fa-solid-900.woff2 +0 -0
- package/public/images/favicon.png +0 -0
- package/public/index.html +25 -0
- package/public/scripts/main.js +19950 -0
- package/public/styles/fa-all.css +5 -0
- package/public/styles/json-highlighter.css +259 -0
- package/public/styles/main.css +245 -0
- package/tsconfig.tsbuildinfo +1 -0
- package/types/common.global.ts +112 -0
- package/types/lib.ts +2 -0
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const __utils__1 = require("../__utils__");
|
|
7
|
+
const utils_1 = require("../utils");
|
|
8
|
+
const has_operator_1 = __importDefault(require("./has.operator"));
|
|
9
|
+
describe('Expectations.Operators.Has', () => {
|
|
10
|
+
it('should handle invalid payload', () => {
|
|
11
|
+
const schema = { $location: 'query' };
|
|
12
|
+
expect((0, has_operator_1.default)('validation', schema, {}, { exploreNestedSchema: utils_1.exploreNestedExpectationSchema })).toBeFalsy();
|
|
13
|
+
});
|
|
14
|
+
it('should handle schema without location', () => {
|
|
15
|
+
expect((0, has_operator_1.default)('validation', {}, {}, { exploreNestedSchema: utils_1.exploreNestedExpectationSchema })).toBeFalsy();
|
|
16
|
+
});
|
|
17
|
+
it('should validate by schema in query using path', () => {
|
|
18
|
+
const schema = {
|
|
19
|
+
$location: 'query',
|
|
20
|
+
$path: 'foo',
|
|
21
|
+
};
|
|
22
|
+
expect((0, has_operator_1.default)('validation', schema, (0, __utils__1.buildExpectationContext)(), { exploreNestedSchema: utils_1.exploreNestedExpectationSchema })).toBeTruthy();
|
|
23
|
+
});
|
|
24
|
+
it('should validate by schema in query using path and value', () => {
|
|
25
|
+
const schema = {
|
|
26
|
+
$location: 'query',
|
|
27
|
+
$path: 'foo',
|
|
28
|
+
$value: 1,
|
|
29
|
+
};
|
|
30
|
+
expect((0, has_operator_1.default)('validation', schema, (0, __utils__1.buildExpectationContext)(), { exploreNestedSchema: utils_1.exploreNestedExpectationSchema })).toBeTruthy();
|
|
31
|
+
});
|
|
32
|
+
it('should validate by schema in query using jsonPath and valueAnyOf', () => {
|
|
33
|
+
const schema = {
|
|
34
|
+
$location: 'query',
|
|
35
|
+
$jsonPath: '$.bar.baz',
|
|
36
|
+
$valueAnyOf: [1, 2, null],
|
|
37
|
+
};
|
|
38
|
+
expect((0, has_operator_1.default)('validation', schema, (0, __utils__1.buildExpectationContext)(), { exploreNestedSchema: utils_1.exploreNestedExpectationSchema })).toBeTruthy();
|
|
39
|
+
});
|
|
40
|
+
it('should validate by schema in query using path and regExp', () => {
|
|
41
|
+
const schema = {
|
|
42
|
+
$location: 'query',
|
|
43
|
+
$path: 'foo',
|
|
44
|
+
$regExp: /\d/,
|
|
45
|
+
};
|
|
46
|
+
expect((0, has_operator_1.default)('validation', schema, (0, __utils__1.buildExpectationContext)(), { exploreNestedSchema: utils_1.exploreNestedExpectationSchema })).toBeTruthy();
|
|
47
|
+
});
|
|
48
|
+
it('should validate by schema in query using path and regExpAnyOf', () => {
|
|
49
|
+
const schema = {
|
|
50
|
+
$location: 'query',
|
|
51
|
+
$path: 'foo',
|
|
52
|
+
$regExpAnyOf: [/\./, /\d/],
|
|
53
|
+
};
|
|
54
|
+
expect((0, has_operator_1.default)('validation', schema, (0, __utils__1.buildExpectationContext)(), { exploreNestedSchema: utils_1.exploreNestedExpectationSchema })).toBeTruthy();
|
|
55
|
+
});
|
|
56
|
+
it('should validate by schema in query using path and minimatch', () => {
|
|
57
|
+
const schema = {
|
|
58
|
+
$location: 'query',
|
|
59
|
+
$path: 'foo',
|
|
60
|
+
$minimatch: '*',
|
|
61
|
+
};
|
|
62
|
+
expect((0, has_operator_1.default)('validation', schema, (0, __utils__1.buildExpectationContext)(), { exploreNestedSchema: utils_1.exploreNestedExpectationSchema })).toBeTruthy();
|
|
63
|
+
});
|
|
64
|
+
it('should validate by schema in query using path and minimatchAnyOf', () => {
|
|
65
|
+
const schema = {
|
|
66
|
+
$location: 'query',
|
|
67
|
+
$path: 'foo',
|
|
68
|
+
$minimatchAnyOf: ['2', '3', '1'],
|
|
69
|
+
};
|
|
70
|
+
expect((0, has_operator_1.default)('validation', schema, (0, __utils__1.buildExpectationContext)(), { exploreNestedSchema: utils_1.exploreNestedExpectationSchema })).toBeTruthy();
|
|
71
|
+
});
|
|
72
|
+
it('should validate by schema in query using jsonPath', () => {
|
|
73
|
+
const schema = {
|
|
74
|
+
$location: 'query',
|
|
75
|
+
$jsonPath: '$.bar.baz',
|
|
76
|
+
};
|
|
77
|
+
expect((0, has_operator_1.default)('validation', schema, (0, __utils__1.buildExpectationContext)(), { exploreNestedSchema: utils_1.exploreNestedExpectationSchema })).toBeTruthy();
|
|
78
|
+
});
|
|
79
|
+
it('should validate by schema in query using jsonPath and value', () => {
|
|
80
|
+
const schema = {
|
|
81
|
+
$location: 'query',
|
|
82
|
+
$jsonPath: '$.bar.baz',
|
|
83
|
+
$value: null,
|
|
84
|
+
};
|
|
85
|
+
expect((0, has_operator_1.default)('validation', schema, (0, __utils__1.buildExpectationContext)(), { exploreNestedSchema: utils_1.exploreNestedExpectationSchema })).toBeTruthy();
|
|
86
|
+
});
|
|
87
|
+
it('should validate by schema with invalid condition in query using jsonPath and value', () => {
|
|
88
|
+
const schema = {
|
|
89
|
+
$location: 'query',
|
|
90
|
+
$jsonPath: '$.bar.baz',
|
|
91
|
+
$value: 1,
|
|
92
|
+
};
|
|
93
|
+
expect((0, has_operator_1.default)('validation', schema, (0, __utils__1.buildExpectationContext)(), { exploreNestedSchema: utils_1.exploreNestedExpectationSchema })).toBeFalsy();
|
|
94
|
+
});
|
|
95
|
+
it('should validate by schema in path using value', () => {
|
|
96
|
+
const schema = {
|
|
97
|
+
$location: 'path',
|
|
98
|
+
$value: '/foo/bar/baz',
|
|
99
|
+
};
|
|
100
|
+
expect((0, has_operator_1.default)('validation', schema, (0, __utils__1.buildExpectationContext)(), { exploreNestedSchema: utils_1.exploreNestedExpectationSchema })).toBeTruthy();
|
|
101
|
+
});
|
|
102
|
+
it('should validate by schema in path using valueAnyOf', () => {
|
|
103
|
+
const schema = {
|
|
104
|
+
$location: 'path',
|
|
105
|
+
$valueAnyOf: ['/foo', '/bar', '/foo/bar/baz'],
|
|
106
|
+
};
|
|
107
|
+
expect((0, has_operator_1.default)('validation', schema, (0, __utils__1.buildExpectationContext)(), { exploreNestedSchema: utils_1.exploreNestedExpectationSchema })).toBeTruthy();
|
|
108
|
+
});
|
|
109
|
+
it('should validate by schema in path using regExp', () => {
|
|
110
|
+
const schema = {
|
|
111
|
+
$location: 'path',
|
|
112
|
+
$regExp: /^\/foo\/\w+\/baz$/,
|
|
113
|
+
};
|
|
114
|
+
expect((0, has_operator_1.default)('validation', schema, (0, __utils__1.buildExpectationContext)(), { exploreNestedSchema: utils_1.exploreNestedExpectationSchema })).toBeTruthy();
|
|
115
|
+
});
|
|
116
|
+
it('should validate by schema in path using regExpAnyOf', () => {
|
|
117
|
+
const schema = {
|
|
118
|
+
$location: 'path',
|
|
119
|
+
$regExpAnyOf: [/\./, /^\/foo\/\w+\/baz$/, /^foo$/],
|
|
120
|
+
};
|
|
121
|
+
expect((0, has_operator_1.default)('validation', schema, (0, __utils__1.buildExpectationContext)(), { exploreNestedSchema: utils_1.exploreNestedExpectationSchema })).toBeTruthy();
|
|
122
|
+
});
|
|
123
|
+
it('should validate by schema in path using minimatch', () => {
|
|
124
|
+
const schema = {
|
|
125
|
+
$location: 'path',
|
|
126
|
+
$minimatch: '/foo/*/baz',
|
|
127
|
+
};
|
|
128
|
+
expect((0, has_operator_1.default)('validation', schema, (0, __utils__1.buildExpectationContext)(), { exploreNestedSchema: utils_1.exploreNestedExpectationSchema })).toBeTruthy();
|
|
129
|
+
});
|
|
130
|
+
it('should validate by schema in path using minimatchAnyOf', () => {
|
|
131
|
+
const schema = {
|
|
132
|
+
$location: 'path',
|
|
133
|
+
$minimatchAnyOf: ['/foo/baz', '/bar/baz', '/foo/bar/*'],
|
|
134
|
+
};
|
|
135
|
+
expect((0, has_operator_1.default)('validation', schema, (0, __utils__1.buildExpectationContext)(), { exploreNestedSchema: utils_1.exploreNestedExpectationSchema })).toBeTruthy();
|
|
136
|
+
});
|
|
137
|
+
it('should validate by schema in method using value', () => {
|
|
138
|
+
const schema = {
|
|
139
|
+
$location: 'method',
|
|
140
|
+
$value: 'POST',
|
|
141
|
+
};
|
|
142
|
+
expect((0, has_operator_1.default)('validation', schema, (0, __utils__1.buildExpectationContext)(), { exploreNestedSchema: utils_1.exploreNestedExpectationSchema })).toBeTruthy();
|
|
143
|
+
});
|
|
144
|
+
it('should validate by schema in statusCode using value', () => {
|
|
145
|
+
const schema = {
|
|
146
|
+
$location: 'statusCode',
|
|
147
|
+
$value: 200,
|
|
148
|
+
};
|
|
149
|
+
expect((0, has_operator_1.default)('validation', schema, (0, __utils__1.buildExpectationContext)(), { exploreNestedSchema: utils_1.exploreNestedExpectationSchema })).toBeTruthy();
|
|
150
|
+
});
|
|
151
|
+
it('should validate by schema in statusCode using valueAnyOf', () => {
|
|
152
|
+
const schema = {
|
|
153
|
+
$location: 'statusCode',
|
|
154
|
+
$valueAnyOf: [404, 200],
|
|
155
|
+
};
|
|
156
|
+
expect((0, has_operator_1.default)('validation', schema, (0, __utils__1.buildExpectationContext)(), { exploreNestedSchema: utils_1.exploreNestedExpectationSchema })).toBeTruthy();
|
|
157
|
+
});
|
|
158
|
+
it('should validate by schema in statusCode using minimatch', () => {
|
|
159
|
+
const schema = {
|
|
160
|
+
$location: 'statusCode',
|
|
161
|
+
$minimatch: '2**',
|
|
162
|
+
};
|
|
163
|
+
expect((0, has_operator_1.default)('validation', schema, (0, __utils__1.buildExpectationContext)(), { exploreNestedSchema: utils_1.exploreNestedExpectationSchema })).toBeTruthy();
|
|
164
|
+
});
|
|
165
|
+
it('should validate by schema in statusCode using minimatchAnyOf', () => {
|
|
166
|
+
const schema = {
|
|
167
|
+
$location: 'statusCode',
|
|
168
|
+
$minimatchAnyOf: ['2*1', '200'],
|
|
169
|
+
};
|
|
170
|
+
expect((0, has_operator_1.default)('validation', schema, (0, __utils__1.buildExpectationContext)(), { exploreNestedSchema: utils_1.exploreNestedExpectationSchema })).toBeTruthy();
|
|
171
|
+
});
|
|
172
|
+
});
|
|
173
|
+
//# sourceMappingURL=has.operator.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"has.operator.spec.js","sourceRoot":"","sources":["../../../../../src/server/expectations/operators/has.operator.spec.ts"],"names":[],"mappings":";;;;;AAAA,2CAAuD;AACvD,oCAA0D;AAE1D,kEAAsC;AAEtC,QAAQ,CAAC,4BAA4B,EAAE,GAAG,EAAE;IAC1C,EAAE,CAAC,+BAA+B,EAAE,GAAG,EAAE;QACvC,MAAM,MAAM,GAAmC,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC;QACtE,MAAM,CAAC,IAAA,sBAAQ,EAAC,YAAY,EAAE,MAAM,EAAO,EAAE,EAAE,EAAE,mBAAmB,EAAE,sCAA8B,EAAE,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC;IACvH,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,uCAAuC,EAAE,GAAG,EAAE;QAC/C,MAAM,CAAC,IAAA,sBAAQ,EAAC,YAAY,EAAE,EAAE,EAAO,EAAE,EAAE,EAAE,mBAAmB,EAAE,sCAA8B,EAAE,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC;IACnH,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,+CAA+C,EAAE,GAAG,EAAE;QACvD,MAAM,MAAM,GAAmC;YAC7C,SAAS,EAAE,OAAO;YAClB,KAAK,EAAE,KAAK;SACb,CAAC;QAEF,MAAM,CACJ,IAAA,sBAAQ,EAAC,YAAY,EAAE,MAAM,EAAE,IAAA,kCAAuB,GAAE,EAAE,EAAE,mBAAmB,EAAE,sCAA8B,EAAE,CAAC,CACnH,CAAC,UAAU,EAAE,CAAC;IACjB,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,yDAAyD,EAAE,GAAG,EAAE;QACjE,MAAM,MAAM,GAAmC;YAC7C,SAAS,EAAE,OAAO;YAClB,KAAK,EAAE,KAAK;YACZ,MAAM,EAAE,CAAC;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IAAA,kCAAuB,GAAE,EAAE,EAAE,mBAAmB,EAAE,sCAA8B,EAAE,CAAC,CACnH,CAAC,UAAU,EAAE,CAAC;IACjB,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,8DAA8D,EAAE,GAAG,EAAE;QACtE,MAAM,MAAM,GAAmC;YAC7C,SAAS,EAAE,YAAY;YACvB,eAAe,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC;SAChC,CAAC;QAEF,MAAM,CACJ,IAAA,sBAAQ,EAAC,YAAY,EAAE,MAAM,EAAE,IAAA,kCAAuB,GAAE,EAAE,EAAE,mBAAmB,EAAE,sCAA8B,EAAE,CAAC,CACnH,CAAC,UAAU,EAAE,CAAC;IACjB,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"if.operator.d.ts","sourceRoot":"","sources":["../../../../../src/server/expectations/operators/if.operator.ts"],"names":[],"mappings":";AAEA,wBAYG"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const utils_1 = require("./utils");
|
|
4
|
+
exports.default = (0, utils_1.buildExpectationOperatorHandler)((mode, schema, context, { exploreNestedSchema }) => {
|
|
5
|
+
const { $then, $else, ...schemaPart } = schema;
|
|
6
|
+
const result = exploreNestedSchema(mode, schemaPart, context);
|
|
7
|
+
if ($then && result) {
|
|
8
|
+
return exploreNestedSchema(mode, $then, context);
|
|
9
|
+
}
|
|
10
|
+
if ($else && !result) {
|
|
11
|
+
return exploreNestedSchema(mode, $else, context);
|
|
12
|
+
}
|
|
13
|
+
return false;
|
|
14
|
+
});
|
|
15
|
+
//# sourceMappingURL=if.operator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"if.operator.js","sourceRoot":"","sources":["../../../../../src/server/expectations/operators/if.operator.ts"],"names":[],"mappings":";;AAAA,mCAA0D;AAE1D,kBAAe,IAAA,uCAA+B,EAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,mBAAmB,EAAE,EAAE,EAAE;IACvG,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,UAAU,EAAE,GAAG,MAAM,CAAC;IAC/C,MAAM,MAAM,GAAG,mBAAmB,CAAC,IAAI,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC;IAE9D,IAAI,KAAK,IAAI,MAAM,EAAE;QACnB,OAAO,mBAAmB,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;KAClD;IACD,IAAI,KAAK,IAAI,CAAC,MAAM,EAAE;QACpB,OAAO,mBAAmB,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;KAClD;IAED,OAAO,KAAK,CAAC;AACf,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"if.operator.spec.d.ts","sourceRoot":"","sources":["../../../../../src/server/expectations/operators/if.operator.spec.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const __utils__1 = require("../__utils__");
|
|
7
|
+
const utils_1 = require("../utils");
|
|
8
|
+
const if_operator_1 = __importDefault(require("./if.operator"));
|
|
9
|
+
describe('Expectations.Operators.If', () => {
|
|
10
|
+
describe('validation mode', () => {
|
|
11
|
+
it('should validate by schema with simple valid condition and valid [then] target branch', () => {
|
|
12
|
+
const schema = {
|
|
13
|
+
$has: { $location: 'path', $regExp: /^\/foo/ },
|
|
14
|
+
$then: { $has: { $location: 'method', $value: 'POST' } },
|
|
15
|
+
};
|
|
16
|
+
expect((0, if_operator_1.default)('validation', schema, (0, __utils__1.buildExpectationContext)(), { exploreNestedSchema: utils_1.exploreNestedExpectationSchema })).toBeTruthy();
|
|
17
|
+
});
|
|
18
|
+
it('should validate by schema with simple invalid condition and valid [then] target branch', () => {
|
|
19
|
+
const schema = {
|
|
20
|
+
$has: { $location: 'path', $regExp: /^\/bar/ },
|
|
21
|
+
$then: { $has: { $location: 'method', $value: 'POST' } },
|
|
22
|
+
};
|
|
23
|
+
expect((0, if_operator_1.default)('validation', schema, (0, __utils__1.buildExpectationContext)(), { exploreNestedSchema: utils_1.exploreNestedExpectationSchema })).toBeFalsy();
|
|
24
|
+
});
|
|
25
|
+
it('should validate by schema with simple valid condition and invalid [then] target branch', () => {
|
|
26
|
+
const schema = {
|
|
27
|
+
$has: { $location: 'path', $regExp: /^\/foo/ },
|
|
28
|
+
$then: { $has: { $location: 'method', $value: 'GET' } },
|
|
29
|
+
};
|
|
30
|
+
expect((0, if_operator_1.default)('validation', schema, (0, __utils__1.buildExpectationContext)(), { exploreNestedSchema: utils_1.exploreNestedExpectationSchema })).toBeFalsy();
|
|
31
|
+
});
|
|
32
|
+
it('should validate by schema with simple invalid condition and valid [else] target branch', () => {
|
|
33
|
+
const schema = {
|
|
34
|
+
$has: { $location: 'path', $regExp: /^\/bar/ },
|
|
35
|
+
$else: { $has: { $location: 'method', $value: 'POST' } },
|
|
36
|
+
};
|
|
37
|
+
expect((0, if_operator_1.default)('validation', schema, (0, __utils__1.buildExpectationContext)(), { exploreNestedSchema: utils_1.exploreNestedExpectationSchema })).toBeTruthy();
|
|
38
|
+
});
|
|
39
|
+
it('should validate by schema with simple invalid condition and invalid [else] target branch', () => {
|
|
40
|
+
const schema = {
|
|
41
|
+
$has: { $location: 'path', $regExp: /^\/bar/ },
|
|
42
|
+
$else: { $has: { $location: 'method', $value: 'GET' } },
|
|
43
|
+
};
|
|
44
|
+
expect((0, if_operator_1.default)('validation', schema, (0, __utils__1.buildExpectationContext)(), { exploreNestedSchema: utils_1.exploreNestedExpectationSchema })).toBeFalsy();
|
|
45
|
+
});
|
|
46
|
+
it('should validate by schema with complex valid condition', () => {
|
|
47
|
+
const schema = {
|
|
48
|
+
$or: [
|
|
49
|
+
{ $if: {} },
|
|
50
|
+
{ $has: { $location: 'path', $regExp: /^\/bar/ } },
|
|
51
|
+
{ $has: { $location: 'method', $value: 'POST' } },
|
|
52
|
+
],
|
|
53
|
+
$then: {
|
|
54
|
+
$or: [
|
|
55
|
+
{ $has: { $location: 'body', $path: 'foo.1.test.0', $regExp: /^2/ } },
|
|
56
|
+
{ $has: { $location: 'body', $path: 'foo.1.baz.0', $regExp: /^2/ } },
|
|
57
|
+
],
|
|
58
|
+
},
|
|
59
|
+
};
|
|
60
|
+
expect((0, if_operator_1.default)('validation', schema, (0, __utils__1.buildExpectationContext)(), { exploreNestedSchema: utils_1.exploreNestedExpectationSchema })).toBeTruthy();
|
|
61
|
+
});
|
|
62
|
+
it('should validate by schema with complex invalid condition', () => {
|
|
63
|
+
const schema = {
|
|
64
|
+
$or: [
|
|
65
|
+
{ $if: {} },
|
|
66
|
+
{ $has: { $location: 'path', $regExp: /^\/bar/ } },
|
|
67
|
+
{ $has: { $location: 'method', $value: 'GET' } },
|
|
68
|
+
],
|
|
69
|
+
$else: {
|
|
70
|
+
$has: { $location: 'body', $path: 'foo.1.test.0', $regExp: /^2/ },
|
|
71
|
+
},
|
|
72
|
+
};
|
|
73
|
+
expect((0, if_operator_1.default)('validation', schema, (0, __utils__1.buildExpectationContext)(), { exploreNestedSchema: utils_1.exploreNestedExpectationSchema })).toBeFalsy();
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
describe('manipulation mode', () => {
|
|
77
|
+
it('should manipulate by schema with conplex condition', () => {
|
|
78
|
+
const context = (0, __utils__1.buildExpectationContext)();
|
|
79
|
+
const schema = {
|
|
80
|
+
$or: [
|
|
81
|
+
{ $if: {} },
|
|
82
|
+
{ $has: { $location: 'path', $regExp: /^\/bar/ } },
|
|
83
|
+
{ $has: { $location: 'method', $value: 'POST' } },
|
|
84
|
+
],
|
|
85
|
+
$then: {
|
|
86
|
+
$and: [
|
|
87
|
+
{ $set: { $location: 'headers', $path: 'content-length', $value: 100 } },
|
|
88
|
+
{ $set: { $location: 'query', $path: 'bar.baz', $value: { test: true } } },
|
|
89
|
+
],
|
|
90
|
+
},
|
|
91
|
+
};
|
|
92
|
+
expect((0, if_operator_1.default)('manipulation', schema, context, { exploreNestedSchema: utils_1.exploreNestedExpectationSchema })).toBeTruthy();
|
|
93
|
+
expect(context.headers?.['content-length']).toEqual(100);
|
|
94
|
+
expect(context.query?.bar?.baz?.test).toBeTruthy();
|
|
95
|
+
});
|
|
96
|
+
});
|
|
97
|
+
});
|
|
98
|
+
//# sourceMappingURL=if.operator.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"if.operator.spec.js","sourceRoot":"","sources":["../../../../../src/server/expectations/operators/if.operator.spec.ts"],"names":[],"mappings":";;;;;AAAA,2CAAuD;AACvD,oCAA0D;AAE1D,gEAAqC;AAErC,QAAQ,CAAC,2BAA2B,EAAE,GAAG,EAAE;IACzC,QAAQ,CAAC,iBAAiB,EAAE,GAAG,EAAE;QAC/B,EAAE,CAAC,sFAAsF,EAAE,GAAG,EAAE;YAC9F,MAAM,MAAM,GAAmC;gBAC7C,IAAI,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE;gBAC9C,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE;aACzD,CAAC;YAEF,MAAM,CACJ,IAAA,qBAAQ,EAAC,YAAY,EAAE,MAAM,EAAE,IAAA,kCAAuB,GAAE,EAAE,EAAE,mBAAmB,EAAE,sCAA8B,EAAE,CAAC,CACnH,CAAC,UAAU,EAAE,CAAC;QACjB,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,wFAAwF,EAAE,GAAG,EAAE;YAChG,MAA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EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,EAAE;qBAC3E;iBACF;aACF,CAAC;YAEF,MAAM,CAAC,IAAA,qBAAQ,EAAC,cAAc,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,mBAAmB,EAAE,sCAA8B,EAAE,CAAC,CAAC,CAAC,UAAU,EAAE,CAAC;YACxH,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,gBAAgB,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;YACzD,MAAM,CAAO,OAAO,CAAC,KAAM,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC,UAAU,EAAE,CAAC;QAC5D,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { default as $and } from './and.operator';
|
|
2
|
+
export { default as $or } from './or.operator';
|
|
3
|
+
export { default as $not } from './not.operator';
|
|
4
|
+
export { default as $if } from './if.operator';
|
|
5
|
+
export { default as $has } from './has.operator';
|
|
6
|
+
export { default as $set } from './set.operator';
|
|
7
|
+
export { default as $merge } from './merge.operator';
|
|
8
|
+
export { default as $remove } from './remove.operator';
|
|
9
|
+
export { default as $exec } from './exec.operator';
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/server/expectations/operators/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,OAAO,IAAI,GAAG,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,OAAO,IAAI,GAAG,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.$exec = exports.$remove = exports.$merge = exports.$set = exports.$has = exports.$if = exports.$not = exports.$or = exports.$and = void 0;
|
|
7
|
+
var and_operator_1 = require("./and.operator");
|
|
8
|
+
Object.defineProperty(exports, "$and", { enumerable: true, get: function () { return __importDefault(and_operator_1).default; } });
|
|
9
|
+
var or_operator_1 = require("./or.operator");
|
|
10
|
+
Object.defineProperty(exports, "$or", { enumerable: true, get: function () { return __importDefault(or_operator_1).default; } });
|
|
11
|
+
var not_operator_1 = require("./not.operator");
|
|
12
|
+
Object.defineProperty(exports, "$not", { enumerable: true, get: function () { return __importDefault(not_operator_1).default; } });
|
|
13
|
+
var if_operator_1 = require("./if.operator");
|
|
14
|
+
Object.defineProperty(exports, "$if", { enumerable: true, get: function () { return __importDefault(if_operator_1).default; } });
|
|
15
|
+
var has_operator_1 = require("./has.operator");
|
|
16
|
+
Object.defineProperty(exports, "$has", { enumerable: true, get: function () { return __importDefault(has_operator_1).default; } });
|
|
17
|
+
var set_operator_1 = require("./set.operator");
|
|
18
|
+
Object.defineProperty(exports, "$set", { enumerable: true, get: function () { return __importDefault(set_operator_1).default; } });
|
|
19
|
+
var merge_operator_1 = require("./merge.operator");
|
|
20
|
+
Object.defineProperty(exports, "$merge", { enumerable: true, get: function () { return __importDefault(merge_operator_1).default; } });
|
|
21
|
+
var remove_operator_1 = require("./remove.operator");
|
|
22
|
+
Object.defineProperty(exports, "$remove", { enumerable: true, get: function () { return __importDefault(remove_operator_1).default; } });
|
|
23
|
+
var exec_operator_1 = require("./exec.operator");
|
|
24
|
+
Object.defineProperty(exports, "$exec", { enumerable: true, get: function () { return __importDefault(exec_operator_1).default; } });
|
|
25
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/server/expectations/operators/index.ts"],"names":[],"mappings":";;;;;;AAAA,+CAAiD;AAAxC,qHAAA,OAAO,OAAQ;AACxB,6CAA+C;AAAtC,mHAAA,OAAO,OAAO;AACvB,+CAAiD;AAAxC,qHAAA,OAAO,OAAQ;AACxB,6CAA+C;AAAtC,mHAAA,OAAO,OAAO;AACvB,+CAAiD;AAAxC,qHAAA,OAAO,OAAQ;AACxB,+CAAiD;AAAxC,qHAAA,OAAO,OAAQ;AACxB,mDAAqD;AAA5C,yHAAA,OAAO,OAAU;AAC1B,qDAAuD;AAA9C,2HAAA,OAAO,OAAW;AAC3B,iDAAmD;AAA1C,uHAAA,OAAO,OAAS"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"merge.operator.d.ts","sourceRoot":"","sources":["../../../../../src/server/expectations/operators/merge.operator.ts"],"names":[],"mappings":";AAMA,wBA6BG"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const lodash_1 = __importDefault(require("lodash"));
|
|
7
|
+
const deepmerge_1 = __importDefault(require("deepmerge"));
|
|
8
|
+
const utils_1 = require("./utils");
|
|
9
|
+
const utils_2 = require("../../../utils");
|
|
10
|
+
exports.default = (0, utils_1.buildExpectationOperatorHandler)((mode, schema, context) => {
|
|
11
|
+
if (mode !== 'manipulation' || !schema.$location || schema.$value === undefined) {
|
|
12
|
+
return true;
|
|
13
|
+
}
|
|
14
|
+
const payload = (0, utils_1.extractContextPayloadSegment)(schema.$location, context);
|
|
15
|
+
if (payload?.type !== 'object') {
|
|
16
|
+
return true;
|
|
17
|
+
}
|
|
18
|
+
if (schema.$path) {
|
|
19
|
+
lodash_1.default.set(payload.value, schema.$path, (0, deepmerge_1.default)(lodash_1.default.get(payload.value, schema.$path), schema.$value ?? {}));
|
|
20
|
+
return true;
|
|
21
|
+
}
|
|
22
|
+
if (schema.$jsonPath) {
|
|
23
|
+
(0, utils_2.extractByJsonPathSafe)({ path: schema.$jsonPath, json: payload.value })
|
|
24
|
+
.results?.forEach((segment) => lodash_1.default.set(payload.value, segment.pointer.substring(1).replace(/\//g, '.'), (0, deepmerge_1.default)(lodash_1.default.get(segment.parent, segment.parentProperty), schema.$value ?? {})));
|
|
25
|
+
return true;
|
|
26
|
+
}
|
|
27
|
+
lodash_1.default.set(payload.parent, payload.key, (0, deepmerge_1.default)(payload.value, schema.$value ?? {}));
|
|
28
|
+
return true;
|
|
29
|
+
});
|
|
30
|
+
//# sourceMappingURL=merge.operator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"merge.operator.js","sourceRoot":"","sources":["../../../../../src/server/expectations/operators/merge.operator.ts"],"names":[],"mappings":";;;;;AAAA,oDAAuB;AACvB,0DAA8B;AAE9B,mCAAwF;AACxF,0CAAuD;AAEvD,kBAAe,IAAA,uCAA+B,EAAW,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE;IACjF,IAAI,IAAI,KAAK,cAAc,IAAI,CAAC,MAAM,CAAC,SAAS,IAA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OAAO,IAAI,CAAC;AACd,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"merge.operator.spec.d.ts","sourceRoot":"","sources":["../../../../../src/server/expectations/operators/merge.operator.spec.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const __utils__1 = require("../__utils__");
|
|
7
|
+
const utils_1 = require("../utils");
|
|
8
|
+
const merge_operator_1 = __importDefault(require("./merge.operator"));
|
|
9
|
+
describe('Expectations.Operators.Merge', () => {
|
|
10
|
+
it('should handle invalid payload', () => {
|
|
11
|
+
const schema = { $location: 'query' };
|
|
12
|
+
expect((0, merge_operator_1.default)('manipulation', schema, {}, { exploreNestedSchema: utils_1.exploreNestedExpectationSchema })).toBeTruthy();
|
|
13
|
+
});
|
|
14
|
+
it('should handle schema without location', () => {
|
|
15
|
+
expect((0, merge_operator_1.default)('manipulation', {}, {}, { exploreNestedSchema: utils_1.exploreNestedExpectationSchema })).toBeTruthy();
|
|
16
|
+
});
|
|
17
|
+
it('should handle schema with non object payload', () => {
|
|
18
|
+
const schema = {
|
|
19
|
+
$location: 'path',
|
|
20
|
+
$value: true,
|
|
21
|
+
};
|
|
22
|
+
expect((0, merge_operator_1.default)('manipulation', schema, {}, { exploreNestedSchema: utils_1.exploreNestedExpectationSchema })).toBeTruthy();
|
|
23
|
+
});
|
|
24
|
+
it('should manipulate by schema', () => {
|
|
25
|
+
const context = (0, __utils__1.buildExpectationContext)();
|
|
26
|
+
const schema = {
|
|
27
|
+
$location: 'query',
|
|
28
|
+
$value: { test: true },
|
|
29
|
+
};
|
|
30
|
+
expect((0, merge_operator_1.default)('manipulation', schema, context, { exploreNestedSchema: utils_1.exploreNestedExpectationSchema })).toBeTruthy();
|
|
31
|
+
expect(context.query.test).toBeTruthy();
|
|
32
|
+
});
|
|
33
|
+
it('should manipulate by schema using path', () => {
|
|
34
|
+
const context = (0, __utils__1.buildExpectationContext)();
|
|
35
|
+
const schema = {
|
|
36
|
+
$location: 'query',
|
|
37
|
+
$path: 'bar',
|
|
38
|
+
$value: { test: true },
|
|
39
|
+
};
|
|
40
|
+
expect((0, merge_operator_1.default)('manipulation', schema, context, { exploreNestedSchema: utils_1.exploreNestedExpectationSchema })).toBeTruthy();
|
|
41
|
+
expect(context.query.bar.test).toBeTruthy();
|
|
42
|
+
});
|
|
43
|
+
it('should manipulate by schema using jsonPath', () => {
|
|
44
|
+
const context = (0, __utils__1.buildExpectationContext)();
|
|
45
|
+
const schema = {
|
|
46
|
+
$location: 'body',
|
|
47
|
+
$jsonPath: '$.foo[*]',
|
|
48
|
+
$value: { test: true },
|
|
49
|
+
};
|
|
50
|
+
expect((0, merge_operator_1.default)('manipulation', schema, context, { exploreNestedSchema: utils_1.exploreNestedExpectationSchema })).toBeTruthy();
|
|
51
|
+
expect(context.body.foo[0].test).toBeTruthy();
|
|
52
|
+
expect(context.body.foo[1].test).toBeTruthy();
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
//# sourceMappingURL=merge.operator.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"merge.operator.spec.js","sourceRoot":"","sources":["../../../../../src/server/expectations/operators/merge.operator.spec.ts"],"names":[],"mappings":";;;;;AAAA,2CAAuD;AACvD,oCAA0D;AAE1D,sEAAwC;AAExC,QAAQ,CAAC,8BAA8B,EAAE,GAAG,EAAE;IAC5C,EAAE,CAAC,+BAA+B,EAAE,GAAG,EAAE;QACvC,MAAM,MAAM,GAAmC,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC;QACtE,MAAM,CAAC,IAAA,wBAAQ,EAAC,cAAc,EAAE,MAAM,EAAO,EAAE,EAAE,EAAE,mBA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MAAM,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE;SACvB,CAAC;QAEF,MAAM,CAAC,IAAA,wBAAQ,EAAC,cAAc,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,mBAAmB,EAAE,sCAA8B,EAAE,CAAC,CAAC,CAAC,UAAU,EAAE,CAAC;QACxH,MAAM,CAAO,OAAO,CAAC,KAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,CAAC;IACrD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,4CAA4C,EAAE,GAAG,EAAE;QACpD,MAAM,OAAO,GAAG,IAAA,kCAAuB,GAAE,CAAA;QACzC,MAAM,MAAM,GAAmC;YAC7C,SAAS,EAAE,MAAM;YACjB,SAAS,EAAE,UAAU;YACrB,MAAM,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE;SACvB,CAAC;QAEF,MAAM,CAAC,IAAA,wBAAQ,EAAC,cAAc,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,mBAAmB,EAAE,sCAA8B,EAAE,CAAC,CAAC,CAAC,UAAU,EAAE,CAAC;QACxH,MAAM,CAAO,OAAO,CAAC,IAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,CAAC;QACrD,MAAM,CAAO,OAAO,CAAC,IAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,CAAC;IACvD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"not.operator.d.ts","sourceRoot":"","sources":["../../../../../src/server/expectations/operators/not.operator.ts"],"names":[],"mappings":";AAEA,wBAEE"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const utils_1 = require("./utils");
|
|
4
|
+
exports.default = (0, utils_1.buildExpectationOperatorHandler)((mode, schema, context, { exploreNestedSchema }) => !exploreNestedSchema(mode, schema, context));
|
|
5
|
+
//# sourceMappingURL=not.operator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"not.operator.js","sourceRoot":"","sources":["../../../../../src/server/expectations/operators/not.operator.ts"],"names":[],"mappings":";;AAAA,mCAA0D;AAE1D,kBAAe,IAAA,uCAA+B,EAC5C,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,mBAAmB,EAAE,EAAE,EAAE,CAAC,CAAC,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,CAChG,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"not.operator.spec.d.ts","sourceRoot":"","sources":["../../../../../src/server/expectations/operators/not.operator.spec.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const __utils__1 = require("../__utils__");
|
|
7
|
+
const utils_1 = require("../utils");
|
|
8
|
+
const not_operator_1 = __importDefault(require("./not.operator"));
|
|
9
|
+
describe('Expectations.Operators.Not', () => {
|
|
10
|
+
it('should validate by schema', () => {
|
|
11
|
+
const schema = {
|
|
12
|
+
$has: { $location: 'query', $path: 'foo', $value: 1 },
|
|
13
|
+
};
|
|
14
|
+
expect((0, not_operator_1.default)('validation', schema, (0, __utils__1.buildExpectationContext)(), { exploreNestedSchema: utils_1.exploreNestedExpectationSchema })).toBeFalsy();
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
//# sourceMappingURL=not.operator.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"not.operator.spec.js","sourceRoot":"","sources":["../../../../../src/server/expectations/operators/not.operator.spec.ts"],"names":[],"mappings":";;;;;AAAA,2CAAuD;AACvD,oCAA0D;AAE1D,kEAAsC;AAEtC,QAAQ,CAAC,4BAA4B,EAAE,GAAG,EAAE;IAC1C,EAAE,CAAC,2BAA2B,EAAE,GAAG,EAAE;QACnC,MAAM,MAAM,GAAmC;YAC7C,IAAI,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,EAAE;SACtD,CAAC;QAEF,MAAM,CACJ,IAAA,sBAAQ,EAAC,YAAY,EAAE,MAAM,EAAE,IAAA,kCAAuB,GAAE,EAAE,EAAE,mBAAmB,EAAE,sCAA8B,EAAE,CAAC,CACnH,CAAC,SAAS,EAAE,CAAC;IAChB,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"or.operator.d.ts","sourceRoot":"","sources":["../../../../../src/server/expectations/operators/or.operator.ts"],"names":[],"mappings":";AAEA,wBAOE"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const utils_1 = require("./utils");
|
|
4
|
+
exports.default = (0, utils_1.buildExpectationOperatorHandler)((mode, schema, context, { exploreNestedSchema }) => schema.length && mode === 'validation'
|
|
5
|
+
? schema.some((segment) => exploreNestedSchema(mode, segment, context))
|
|
6
|
+
: mode === 'manipulation'
|
|
7
|
+
? schema.every((segment) => exploreNestedSchema(mode, segment, context))
|
|
8
|
+
: true);
|
|
9
|
+
//# sourceMappingURL=or.operator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"or.operator.js","sourceRoot":"","sources":["../../../../../src/server/expectations/operators/or.operator.ts"],"names":[],"mappings":";;AAAA,mCAA0D;AAE1D,kBAAe,IAAA,uCAA+B,EAC5C,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,mBAAmB,EAAE,EAAE,EAAE,CACjD,MAAM,CAAC,MAAM,IAAI,IAAI,KAAK,YAAY;IACpC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,mBAAmB,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;IACvE,CAAC,CAAC,IAAI,KAAK,cAAc;QACzB,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,mBAAmB,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;QACxE,CAAC,CAAC,IAAI,CACX,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"or.operator.spec.d.ts","sourceRoot":"","sources":["../../../../../src/server/expectations/operators/or.operator.spec.ts"],"names":[],"mappings":""}
|