@thisisagile/easy 15.26.1 → 15.27.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/dist/chunk-35PSIDGU.mjs +17 -0
- package/dist/chunk-35PSIDGU.mjs.map +1 -0
- package/dist/chunk-3HTSHJPL.mjs +26 -0
- package/dist/chunk-3HTSHJPL.mjs.map +1 -0
- package/dist/chunk-3WOYFN2Q.mjs +18 -0
- package/dist/chunk-3WOYFN2Q.mjs.map +1 -0
- package/dist/chunk-4AP5H3OQ.mjs +46 -0
- package/dist/chunk-4AP5H3OQ.mjs.map +1 -0
- package/dist/chunk-4EVQZKMK.mjs +15 -0
- package/dist/chunk-4EVQZKMK.mjs.map +1 -0
- package/dist/chunk-4QX4EMLL.mjs +13 -0
- package/dist/chunk-4QX4EMLL.mjs.map +1 -0
- package/dist/chunk-5AF55QCJ.mjs +51 -0
- package/dist/chunk-5AF55QCJ.mjs.map +1 -0
- package/dist/chunk-6NOTDYUE.mjs +272 -0
- package/dist/chunk-6NOTDYUE.mjs.map +1 -0
- package/dist/chunk-6OW7KEN5.mjs +94 -0
- package/dist/chunk-6OW7KEN5.mjs.map +1 -0
- package/dist/chunk-74AOBBOZ.mjs +113 -0
- package/dist/chunk-74AOBBOZ.mjs.map +1 -0
- package/dist/chunk-7EP6VCI3.mjs +60 -0
- package/dist/chunk-7EP6VCI3.mjs.map +1 -0
- package/dist/{types/PageList.js → chunk-7NYZAGM3.mjs} +31 -48
- package/dist/chunk-7NYZAGM3.mjs.map +1 -0
- package/dist/chunk-7RIXMU5L.mjs +50 -0
- package/dist/chunk-7RIXMU5L.mjs.map +1 -0
- package/dist/chunk-A7OYYR2S.mjs +48 -0
- package/dist/chunk-A7OYYR2S.mjs.map +1 -0
- package/dist/chunk-ADJAEGCT.mjs +21 -0
- package/dist/chunk-ADJAEGCT.mjs.map +1 -0
- package/dist/chunk-AKYA7FHU.mjs +15 -0
- package/dist/chunk-AKYA7FHU.mjs.map +1 -0
- package/dist/chunk-CLKUH5JA.mjs +42 -0
- package/dist/chunk-CLKUH5JA.mjs.map +1 -0
- package/dist/chunk-CMRS457E.mjs +11 -0
- package/dist/chunk-CMRS457E.mjs.map +1 -0
- package/dist/chunk-D54TPU6G.mjs +43 -0
- package/dist/chunk-D54TPU6G.mjs.map +1 -0
- package/dist/chunk-DICMUQFL.mjs +11 -0
- package/dist/chunk-DICMUQFL.mjs.map +1 -0
- package/dist/chunk-EZC3HAYN.mjs +70 -0
- package/dist/chunk-EZC3HAYN.mjs.map +1 -0
- package/dist/chunk-FAAERRP2.mjs +37 -0
- package/dist/chunk-FAAERRP2.mjs.map +1 -0
- package/dist/chunk-FSK4W6I2.mjs +33 -0
- package/dist/chunk-FSK4W6I2.mjs.map +1 -0
- package/dist/chunk-G7QSW2EB.mjs +23 -0
- package/dist/chunk-G7QSW2EB.mjs.map +1 -0
- package/dist/chunk-GDD652NR.mjs +94 -0
- package/dist/chunk-GDD652NR.mjs.map +1 -0
- package/dist/chunk-GGC4TWMF.mjs +40 -0
- package/dist/chunk-GGC4TWMF.mjs.map +1 -0
- package/dist/chunk-GI5TZOAG.mjs +30 -0
- package/dist/chunk-GI5TZOAG.mjs.map +1 -0
- package/dist/chunk-GVX6S54O.mjs +54 -0
- package/dist/chunk-GVX6S54O.mjs.map +1 -0
- package/dist/chunk-H22IHXDC.mjs +23 -0
- package/dist/chunk-H22IHXDC.mjs.map +1 -0
- package/dist/chunk-H6GKGVYF.mjs +18 -0
- package/dist/chunk-H6GKGVYF.mjs.map +1 -0
- package/dist/chunk-HNB4RM5S.mjs +89 -0
- package/dist/chunk-HNB4RM5S.mjs.map +1 -0
- package/dist/chunk-I3VZW3XF.mjs +46 -0
- package/dist/chunk-I3VZW3XF.mjs.map +1 -0
- package/dist/chunk-IJFQ7PRU.mjs +19 -0
- package/dist/chunk-IJFQ7PRU.mjs.map +1 -0
- package/dist/chunk-JER7KLEK.mjs +82 -0
- package/dist/chunk-JER7KLEK.mjs.map +1 -0
- package/dist/chunk-JXJ5LRH3.mjs +30 -0
- package/dist/chunk-JXJ5LRH3.mjs.map +1 -0
- package/dist/chunk-L2BMMXCX.mjs +79 -0
- package/dist/chunk-L2BMMXCX.mjs.map +1 -0
- package/dist/chunk-LB7OMB5S.mjs +57 -0
- package/dist/chunk-LB7OMB5S.mjs.map +1 -0
- package/dist/chunk-LCDQWW2Y.mjs +18 -0
- package/dist/chunk-LCDQWW2Y.mjs.map +1 -0
- package/dist/chunk-LD64IICE.mjs +28 -0
- package/dist/chunk-LD64IICE.mjs.map +1 -0
- package/dist/chunk-LV7HNQ3N.mjs +183 -0
- package/dist/chunk-LV7HNQ3N.mjs.map +1 -0
- package/dist/chunk-M4UUIOW6.mjs +86 -0
- package/dist/chunk-M4UUIOW6.mjs.map +1 -0
- package/dist/chunk-MDLVDMKY.mjs +11 -0
- package/dist/chunk-MDLVDMKY.mjs.map +1 -0
- package/dist/chunk-NF7FTEE7.mjs +26 -0
- package/dist/chunk-NF7FTEE7.mjs.map +1 -0
- package/dist/chunk-NYTGMBLK.mjs +49 -0
- package/dist/chunk-NYTGMBLK.mjs.map +1 -0
- package/dist/chunk-O62PGEQ7.mjs +20 -0
- package/dist/chunk-O62PGEQ7.mjs.map +1 -0
- package/dist/chunk-OQNZEKWO.mjs +24 -0
- package/dist/chunk-OQNZEKWO.mjs.map +1 -0
- package/dist/chunk-OXBQSJDF.mjs +45 -0
- package/dist/chunk-OXBQSJDF.mjs.map +1 -0
- package/dist/chunk-PIRWVOO2.mjs +7 -0
- package/dist/chunk-PIRWVOO2.mjs.map +1 -0
- package/dist/chunk-PLIJ2CRV.mjs +25 -0
- package/dist/chunk-PLIJ2CRV.mjs.map +1 -0
- package/dist/chunk-PSIJUWZT.mjs +13 -0
- package/dist/chunk-PSIJUWZT.mjs.map +1 -0
- package/dist/chunk-QOGUHAMC.mjs +40 -0
- package/dist/chunk-QOGUHAMC.mjs.map +1 -0
- package/dist/chunk-SGSU4KYT.mjs +49 -0
- package/dist/chunk-SGSU4KYT.mjs.map +1 -0
- package/dist/chunk-SJGDB24D.mjs +41 -0
- package/dist/chunk-SJGDB24D.mjs.map +1 -0
- package/dist/chunk-SJGQU3OG.mjs +15 -0
- package/dist/chunk-SJGQU3OG.mjs.map +1 -0
- package/dist/chunk-SP4KAT3N.mjs +25 -0
- package/dist/chunk-SP4KAT3N.mjs.map +1 -0
- package/dist/chunk-SS3C77DP.mjs +134 -0
- package/dist/chunk-SS3C77DP.mjs.map +1 -0
- package/dist/chunk-SW2OCUH3.mjs +10 -0
- package/dist/chunk-SW2OCUH3.mjs.map +1 -0
- package/dist/chunk-UDLMLGTS.mjs +43 -0
- package/dist/chunk-UDLMLGTS.mjs.map +1 -0
- package/dist/chunk-V62IOKST.mjs +21 -0
- package/dist/chunk-V62IOKST.mjs.map +1 -0
- package/dist/chunk-WEXSGVXZ.mjs +53 -0
- package/dist/chunk-WEXSGVXZ.mjs.map +1 -0
- package/dist/chunk-WUFQM7VZ.mjs +20 -0
- package/dist/chunk-WUFQM7VZ.mjs.map +1 -0
- package/dist/chunk-YTWFWQNB.mjs +866 -0
- package/dist/chunk-YTWFWQNB.mjs.map +1 -0
- package/dist/chunk-ZHAJLP7P.mjs +49 -0
- package/dist/chunk-ZHAJLP7P.mjs.map +1 -0
- package/dist/chunk-ZNWOAXMK.mjs +46 -0
- package/dist/chunk-ZNWOAXMK.mjs.map +1 -0
- package/dist/data/Condition.mjs +19 -35
- package/dist/data/Condition.mjs.map +1 -1
- package/dist/data/Database.mjs +15 -12
- package/dist/data/Database.mjs.map +1 -1
- package/dist/data/Field.mjs +28 -6
- package/dist/data/Field.mjs.map +1 -1
- package/dist/data/InMemoryGateway.mjs +26 -4
- package/dist/data/InMemoryGateway.mjs.map +1 -1
- package/dist/domain/Audit.mjs +18 -24
- package/dist/domain/Audit.mjs.map +1 -1
- package/dist/domain/Child.mjs +28 -5
- package/dist/domain/Child.mjs.map +1 -1
- package/dist/domain/Entity.mjs +32 -6
- package/dist/domain/Entity.mjs.map +1 -1
- package/dist/domain/Repo.mjs +28 -5
- package/dist/domain/Repo.mjs.map +1 -1
- package/dist/domain/Struct.mjs +15 -25
- package/dist/domain/Struct.mjs.map +1 -1
- package/dist/domain/Typo.mjs +21 -4
- package/dist/domain/Typo.mjs.map +1 -1
- package/dist/domain/enums/Country.mjs +14 -262
- package/dist/domain/enums/Country.mjs.map +1 -1
- package/dist/domain/enums/Currency.mjs +17 -131
- package/dist/domain/enums/Currency.mjs.map +1 -1
- package/dist/domain/enums/Environment.mjs +21 -7
- package/dist/domain/enums/Environment.mjs.map +1 -1
- package/dist/domain/enums/Locale.mjs +581 -566
- package/dist/domain/enums/Locale.mjs.map +1 -1
- package/dist/domain/enums/UnitOfMeasurement.mjs +14 -12
- package/dist/domain/enums/UnitOfMeasurement.mjs.map +1 -1
- package/dist/domain/enums/UnitOfWeight.mjs +14 -10
- package/dist/domain/enums/UnitOfWeight.mjs.map +1 -1
- package/dist/domain/structs/Address.mjs +34 -8
- package/dist/domain/structs/Address.mjs.map +1 -1
- package/dist/domain/structs/Box.mjs +26 -5
- package/dist/domain/structs/Box.mjs.map +1 -1
- package/dist/domain/structs/Dimension.mjs +18 -26
- package/dist/domain/structs/Dimension.mjs.map +1 -1
- package/dist/domain/structs/Money.mjs +19 -32
- package/dist/domain/structs/Money.mjs.map +1 -1
- package/dist/domain/structs/Name.mjs +25 -6
- package/dist/domain/structs/Name.mjs.map +1 -1
- package/dist/domain/structs/Weight.mjs +26 -6
- package/dist/domain/structs/Weight.mjs.map +1 -1
- package/dist/domain/values/DateTime.mjs +17 -88
- package/dist/domain/values/DateTime.mjs.map +1 -1
- package/dist/domain/values/EAN.mjs +21 -4
- package/dist/domain/values/EAN.mjs.map +1 -1
- package/dist/domain/values/Email.mjs +23 -5
- package/dist/domain/values/Email.mjs.map +1 -1
- package/dist/domain/values/IBAN.mjs +21 -4
- package/dist/domain/values/IBAN.mjs.map +1 -1
- package/dist/domain/values/PostalCode.mjs +16 -13
- package/dist/domain/values/PostalCode.mjs.map +1 -1
- package/dist/domain/values/Slug.mjs +21 -4
- package/dist/domain/values/Slug.mjs.map +1 -1
- package/dist/domain/values/Url.mjs +22 -5
- package/dist/domain/values/Url.mjs.map +1 -1
- package/dist/health/HealthResource.mjs +32 -4
- package/dist/health/HealthResource.mjs.map +1 -1
- package/dist/health/HealthUri.mjs +15 -5
- package/dist/health/HealthUri.mjs.map +1 -1
- package/dist/http/CacheControl.mjs +16 -28
- package/dist/http/CacheControl.mjs.map +1 -1
- package/dist/http/ContentType.mjs +14 -15
- package/dist/http/ContentType.mjs.map +1 -1
- package/dist/http/HttpHeader.mjs +3 -4
- package/dist/http/HttpHeader.mjs.map +1 -1
- package/dist/http/HttpStatus.mjs +16 -80
- package/dist/http/HttpStatus.mjs.map +1 -1
- package/dist/http/HttpVerb.mjs +14 -11
- package/dist/http/HttpVerb.mjs.map +1 -1
- package/dist/http/LocalRequestStore.mjs +17 -3
- package/dist/http/LocalRequestStore.mjs.map +1 -1
- package/dist/http/OriginatedError.mjs +9 -5
- package/dist/http/OriginatedError.mjs.map +1 -1
- package/dist/http/RequestOptions.mjs +19 -59
- package/dist/http/RequestOptions.mjs.map +1 -1
- package/dist/http/Response.mjs +16 -9
- package/dist/http/Response.mjs.map +1 -1
- package/dist/http/RestResult.mjs +16 -26
- package/dist/http/RestResult.mjs.map +1 -1
- package/dist/http/Verb.mjs +27 -19
- package/dist/http/Verb.mjs.map +1 -1
- package/dist/index.js +4790 -27
- package/dist/index.js.map +1 -1
- package/dist/process/App.mjs +19 -4
- package/dist/process/App.mjs.map +1 -1
- package/dist/process/Manage.mjs +19 -3
- package/dist/process/Manage.mjs.map +1 -1
- package/dist/process/Scope.mjs +14 -18
- package/dist/process/Scope.mjs.map +1 -1
- package/dist/process/Search.mjs +15 -34
- package/dist/process/Search.mjs.map +1 -1
- package/dist/process/UseCase.mjs +24 -4
- package/dist/process/UseCase.mjs.map +1 -1
- package/dist/resources/Req.mjs +20 -4
- package/dist/resources/Req.mjs.map +1 -1
- package/dist/resources/Requires.mjs +18 -4
- package/dist/resources/Requires.mjs.map +1 -1
- package/dist/resources/Route.mjs +15 -32
- package/dist/resources/Route.mjs.map +1 -1
- package/dist/resources/Service.mjs +19 -3
- package/dist/resources/Service.mjs.map +1 -1
- package/dist/security/Jwt.mjs +21 -5
- package/dist/security/Jwt.mjs.map +1 -1
- package/dist/services/Api.mjs +25 -63
- package/dist/services/Api.mjs.map +1 -1
- package/dist/services/ApiGateway.mjs +27 -29
- package/dist/services/ApiGateway.mjs.map +1 -1
- package/dist/services/AxiosProvider.mjs +22 -23
- package/dist/services/AxiosProvider.mjs.map +1 -1
- package/dist/services/MappedRouteGateway.mjs +40 -5
- package/dist/services/MappedRouteGateway.mjs.map +1 -1
- package/dist/services/RouteGateway.mjs +28 -42
- package/dist/services/RouteGateway.mjs.map +1 -1
- package/dist/services/ViewRouteGateway.mjs +39 -5
- package/dist/services/ViewRouteGateway.mjs.map +1 -1
- package/dist/sql/Clause.mjs +19 -22
- package/dist/sql/Clause.mjs.map +1 -1
- package/dist/sql/Column.mjs +19 -64
- package/dist/sql/Column.mjs.map +1 -1
- package/dist/sql/Count.mjs +16 -7
- package/dist/sql/Count.mjs.map +1 -1
- package/dist/sql/Delete.mjs +15 -7
- package/dist/sql/Delete.mjs.map +1 -1
- package/dist/sql/Insert.mjs +17 -12
- package/dist/sql/Insert.mjs.map +1 -1
- package/dist/sql/Join.mjs +3 -18
- package/dist/sql/Join.mjs.map +1 -1
- package/dist/sql/Select.mjs +15 -40
- package/dist/sql/Select.mjs.map +1 -1
- package/dist/sql/SqlQuery.mjs +14 -11
- package/dist/sql/SqlQuery.mjs.map +1 -1
- package/dist/sql/Table.mjs +53 -12
- package/dist/sql/Table.mjs.map +1 -1
- package/dist/sql/TableGateway.mjs +27 -5
- package/dist/sql/TableGateway.mjs.map +1 -1
- package/dist/sql/Update.mjs +17 -13
- package/dist/sql/Update.mjs.map +1 -1
- package/dist/types/Array.mjs +9 -22
- package/dist/types/Array.mjs.map +1 -1
- package/dist/types/Builder.mjs +21 -7
- package/dist/types/Builder.mjs.map +1 -1
- package/dist/types/Cache.mjs +17 -3
- package/dist/types/Cache.mjs.map +1 -1
- package/dist/types/CacheAge.mjs +15 -36
- package/dist/types/CacheAge.mjs.map +1 -1
- package/dist/types/Case.mjs +13 -87
- package/dist/types/Case.mjs.map +1 -1
- package/dist/types/Constructor.mjs +11 -12
- package/dist/types/Constructor.mjs.map +1 -1
- package/dist/types/Context.mjs +17 -81
- package/dist/types/Context.mjs.map +1 -1
- package/dist/types/Enum.mjs +14 -46
- package/dist/types/Enum.mjs.map +1 -1
- package/dist/types/Exception.mjs +15 -22
- package/dist/types/Exception.mjs.map +1 -1
- package/dist/types/Falsy.mjs +4 -2
- package/dist/types/Falsy.mjs.map +1 -1
- package/dist/types/Func.mjs +3 -1
- package/dist/types/Func.mjs.map +1 -1
- package/dist/types/Gateway.mjs +14 -34
- package/dist/types/Gateway.mjs.map +1 -1
- package/dist/types/Get.mjs +6 -4
- package/dist/types/Get.mjs.map +1 -1
- package/dist/types/Id.mjs +5 -2
- package/dist/types/Id.mjs.map +1 -1
- package/dist/types/Is.mjs +21 -21
- package/dist/types/Is.mjs.map +1 -1
- package/dist/types/IsA.mjs +6 -3
- package/dist/types/IsA.mjs.map +1 -1
- package/dist/types/IsDate.mjs +6 -12
- package/dist/types/IsDate.mjs.map +1 -1
- package/dist/types/IsEqual.mjs +14 -11
- package/dist/types/IsEqual.mjs.map +1 -1
- package/dist/types/Json.mjs +14 -31
- package/dist/types/Json.mjs.map +1 -1
- package/dist/types/List.mjs +18 -170
- package/dist/types/List.mjs.map +1 -1
- package/dist/types/Message.mjs +6 -2
- package/dist/types/Message.mjs.map +1 -1
- package/dist/types/Meta.mjs +14 -41
- package/dist/types/Meta.mjs.map +1 -1
- package/dist/types/Nullish.mjs +3 -1
- package/dist/types/Nullish.mjs.map +1 -1
- package/dist/types/Number.mjs +14 -5
- package/dist/types/Number.mjs.map +1 -1
- package/dist/types/PageList.mjs +19 -118
- package/dist/types/PageList.mjs.map +1 -1
- package/dist/types/Parser.mjs +30 -7
- package/dist/types/Parser.mjs.map +1 -1
- package/dist/types/Primitive.mjs +4 -4
- package/dist/types/Primitive.mjs.map +1 -1
- package/dist/types/Repository.mjs +14 -40
- package/dist/types/Repository.mjs.map +1 -1
- package/dist/types/Result.mjs +14 -8
- package/dist/types/Result.mjs.map +1 -1
- package/dist/types/Results.mjs +15 -19
- package/dist/types/Results.mjs.map +1 -1
- package/dist/types/Sort.mjs +4 -2
- package/dist/types/Sort.mjs.map +1 -1
- package/dist/types/Tag.mjs +17 -3
- package/dist/types/Tag.mjs.map +1 -1
- package/dist/types/Template.mjs +14 -35
- package/dist/types/Template.mjs.map +1 -1
- package/dist/types/Text.mjs +19 -97
- package/dist/types/Text.mjs.map +1 -1
- package/dist/types/Try.mjs +14 -107
- package/dist/types/Try.mjs.map +1 -1
- package/dist/types/Uri.mjs +16 -74
- package/dist/types/Uri.mjs.map +1 -1
- package/dist/types/Uuid.mjs +5 -5
- package/dist/types/Uuid.mjs.map +1 -1
- package/dist/types/Validatable.mjs +6 -2
- package/dist/types/Validatable.mjs.map +1 -1
- package/dist/types/Value.mjs +14 -17
- package/dist/types/Value.mjs.map +1 -1
- package/dist/utils/Base64.mjs +3 -1
- package/dist/utils/Base64.mjs.map +1 -1
- package/dist/utils/Convert.mjs +15 -39
- package/dist/utils/Convert.mjs.map +1 -1
- package/dist/utils/If.mjs +10 -13
- package/dist/utils/If.mjs.map +1 -1
- package/dist/utils/Loading.mjs +6 -2
- package/dist/utils/Loading.mjs.map +1 -1
- package/dist/utils/Log.mjs +2 -0
- package/dist/utils/Log.mjs.map +1 -1
- package/dist/utils/Mapper.mjs +19 -101
- package/dist/utils/Mapper.mjs.map +1 -1
- package/dist/utils/Promise.mjs +19 -16
- package/dist/utils/Promise.mjs.map +1 -1
- package/dist/utils/Property.mjs +15 -14
- package/dist/utils/Property.mjs.map +1 -1
- package/dist/utils/Sentence.mjs +28 -14
- package/dist/utils/Sentence.mjs.map +1 -1
- package/dist/utils/State.mjs +7 -8
- package/dist/utils/State.mjs.map +1 -1
- package/dist/utils/Traverse.mjs +3 -5
- package/dist/utils/Traverse.mjs.map +1 -1
- package/dist/utils/View.mjs +21 -64
- package/dist/utils/View.mjs.map +1 -1
- package/dist/utils/Wait.mjs +5 -3
- package/dist/utils/Wait.mjs.map +1 -1
- package/dist/validation/Contraints.mjs +32 -29
- package/dist/validation/Contraints.mjs.map +1 -1
- package/dist/validation/Validate.mjs +16 -28
- package/dist/validation/Validate.mjs.map +1 -1
- package/dist/validation/When.mjs +14 -38
- package/dist/validation/When.mjs.map +1 -1
- package/package.json +4 -3
- package/dist/data/Condition.js +0 -71
- package/dist/data/Condition.js.map +0 -1
- package/dist/data/DataProvider.js +0 -17
- package/dist/data/DataProvider.js.map +0 -1
- package/dist/data/Database.js +0 -42
- package/dist/data/Database.js.map +0 -1
- package/dist/data/Field.js +0 -48
- package/dist/data/Field.js.map +0 -1
- package/dist/data/InMemoryGateway.js +0 -59
- package/dist/data/InMemoryGateway.js.map +0 -1
- package/dist/data/Query.js +0 -17
- package/dist/data/Query.js.map +0 -1
- package/dist/data/QueryProvider.js +0 -17
- package/dist/data/QueryProvider.js.map +0 -1
- package/dist/data/index.js +0 -35
- package/dist/data/index.js.map +0 -1
- package/dist/domain/Audit.js +0 -59
- package/dist/domain/Audit.js.map +0 -1
- package/dist/domain/Child.js +0 -49
- package/dist/domain/Child.js.map +0 -1
- package/dist/domain/Entity.js +0 -62
- package/dist/domain/Entity.js.map +0 -1
- package/dist/domain/Repo.js +0 -81
- package/dist/domain/Repo.js.map +0 -1
- package/dist/domain/Struct.js +0 -55
- package/dist/domain/Struct.js.map +0 -1
- package/dist/domain/Typo.js +0 -62
- package/dist/domain/Typo.js.map +0 -1
- package/dist/domain/enums/Country.js +0 -290
- package/dist/domain/enums/Country.js.map +0 -1
- package/dist/domain/enums/Currency.js +0 -159
- package/dist/domain/enums/Currency.js.map +0 -1
- package/dist/domain/enums/Environment.js +0 -35
- package/dist/domain/enums/Environment.js.map +0 -1
- package/dist/domain/enums/Locale.js +0 -605
- package/dist/domain/enums/Locale.js.map +0 -1
- package/dist/domain/enums/UnitOfMeasurement.js +0 -40
- package/dist/domain/enums/UnitOfMeasurement.js.map +0 -1
- package/dist/domain/enums/UnitOfWeight.js +0 -38
- package/dist/domain/enums/UnitOfWeight.js.map +0 -1
- package/dist/domain/enums/index.js +0 -33
- package/dist/domain/enums/index.js.map +0 -1
- package/dist/domain/index.js +0 -39
- package/dist/domain/index.js.map +0 -1
- package/dist/domain/structs/Address.js +0 -73
- package/dist/domain/structs/Address.js.map +0 -1
- package/dist/domain/structs/Box.js +0 -70
- package/dist/domain/structs/Box.js.map +0 -1
- package/dist/domain/structs/Dimension.js +0 -61
- package/dist/domain/structs/Dimension.js.map +0 -1
- package/dist/domain/structs/Money.js +0 -71
- package/dist/domain/structs/Money.js.map +0 -1
- package/dist/domain/structs/Name.js +0 -57
- package/dist/domain/structs/Name.js.map +0 -1
- package/dist/domain/structs/Weight.js +0 -71
- package/dist/domain/structs/Weight.js.map +0 -1
- package/dist/domain/structs/index.js +0 -33
- package/dist/domain/structs/index.js.map +0 -1
- package/dist/domain/values/DateTime.js +0 -120
- package/dist/domain/values/DateTime.js.map +0 -1
- package/dist/domain/values/EAN.js +0 -50
- package/dist/domain/values/EAN.js.map +0 -1
- package/dist/domain/values/Email.js +0 -57
- package/dist/domain/values/Email.js.map +0 -1
- package/dist/domain/values/IBAN.js +0 -50
- package/dist/domain/values/IBAN.js.map +0 -1
- package/dist/domain/values/PostalCode.js +0 -53
- package/dist/domain/values/PostalCode.js.map +0 -1
- package/dist/domain/values/Slug.js +0 -41
- package/dist/domain/values/Slug.js.map +0 -1
- package/dist/domain/values/Url.js +0 -57
- package/dist/domain/values/Url.js.map +0 -1
- package/dist/domain/values/index.js +0 -35
- package/dist/domain/values/index.js.map +0 -1
- package/dist/health/HealthResource.js +0 -49
- package/dist/health/HealthResource.js.map +0 -1
- package/dist/health/HealthUri.js +0 -33
- package/dist/health/HealthUri.js.map +0 -1
- package/dist/health/index.js +0 -25
- package/dist/health/index.js.map +0 -1
- package/dist/http/CacheControl.js +0 -56
- package/dist/http/CacheControl.js.map +0 -1
- package/dist/http/ContentType.js +0 -53
- package/dist/http/ContentType.js.map +0 -1
- package/dist/http/HttpHeader.js +0 -32
- package/dist/http/HttpHeader.js.map +0 -1
- package/dist/http/HttpStatus.js +0 -112
- package/dist/http/HttpStatus.js.map +0 -1
- package/dist/http/HttpVerb.js +0 -39
- package/dist/http/HttpVerb.js.map +0 -1
- package/dist/http/LocalRequestStore.js +0 -36
- package/dist/http/LocalRequestStore.js.map +0 -1
- package/dist/http/OriginatedError.js +0 -44
- package/dist/http/OriginatedError.js.map +0 -1
- package/dist/http/Request.js +0 -17
- package/dist/http/Request.js.map +0 -1
- package/dist/http/RequestOptions.js +0 -91
- package/dist/http/RequestOptions.js.map +0 -1
- package/dist/http/RequestProvider.js +0 -17
- package/dist/http/RequestProvider.js.map +0 -1
- package/dist/http/Response.js +0 -39
- package/dist/http/Response.js.map +0 -1
- package/dist/http/RestResult.js +0 -56
- package/dist/http/RestResult.js.map +0 -1
- package/dist/http/Verb.js +0 -61
- package/dist/http/Verb.js.map +0 -1
- package/dist/http/index.js +0 -45
- package/dist/http/index.js.map +0 -1
- package/dist/process/App.js +0 -35
- package/dist/process/App.js.map +0 -1
- package/dist/process/Manage.js +0 -43
- package/dist/process/Manage.js.map +0 -1
- package/dist/process/Scope.js +0 -46
- package/dist/process/Scope.js.map +0 -1
- package/dist/process/Search.js +0 -62
- package/dist/process/Search.js.map +0 -1
- package/dist/process/UseCase.js +0 -50
- package/dist/process/UseCase.js.map +0 -1
- package/dist/process/index.js +0 -31
- package/dist/process/index.js.map +0 -1
- package/dist/resources/AppProvider.js +0 -17
- package/dist/resources/AppProvider.js.map +0 -1
- package/dist/resources/Req.js +0 -54
- package/dist/resources/Req.js.map +0 -1
- package/dist/resources/Requires.js +0 -48
- package/dist/resources/Requires.js.map +0 -1
- package/dist/resources/Resource.js +0 -17
- package/dist/resources/Resource.js.map +0 -1
- package/dist/resources/Route.js +0 -62
- package/dist/resources/Route.js.map +0 -1
- package/dist/resources/Service.js +0 -49
- package/dist/resources/Service.js.map +0 -1
- package/dist/resources/index.js +0 -35
- package/dist/resources/index.js.map +0 -1
- package/dist/security/Jwt.js +0 -48
- package/dist/security/Jwt.js.map +0 -1
- package/dist/security/index.js +0 -23
- package/dist/security/index.js.map +0 -1
- package/dist/services/Api.js +0 -93
- package/dist/services/Api.js.map +0 -1
- package/dist/services/ApiGateway.js +0 -57
- package/dist/services/ApiGateway.js.map +0 -1
- package/dist/services/AxiosProvider.js +0 -61
- package/dist/services/AxiosProvider.js.map +0 -1
- package/dist/services/MappedRouteGateway.js +0 -52
- package/dist/services/MappedRouteGateway.js.map +0 -1
- package/dist/services/RouteGateway.js +0 -70
- package/dist/services/RouteGateway.js.map +0 -1
- package/dist/services/ViewRouteGateway.js +0 -55
- package/dist/services/ViewRouteGateway.js.map +0 -1
- package/dist/services/index.js +0 -33
- package/dist/services/index.js.map +0 -1
- package/dist/sql/Clause.js +0 -58
- package/dist/sql/Clause.js.map +0 -1
- package/dist/sql/Column.js +0 -96
- package/dist/sql/Column.js.map +0 -1
- package/dist/sql/Count.js +0 -35
- package/dist/sql/Count.js.map +0 -1
- package/dist/sql/Delete.js +0 -35
- package/dist/sql/Delete.js.map +0 -1
- package/dist/sql/Insert.js +0 -40
- package/dist/sql/Insert.js.map +0 -1
- package/dist/sql/Join.js +0 -46
- package/dist/sql/Join.js.map +0 -1
- package/dist/sql/Select.js +0 -68
- package/dist/sql/Select.js.map +0 -1
- package/dist/sql/SqlQuery.js +0 -39
- package/dist/sql/SqlQuery.js.map +0 -1
- package/dist/sql/Table.js +0 -63
- package/dist/sql/Table.js.map +0 -1
- package/dist/sql/TableGateway.js +0 -62
- package/dist/sql/TableGateway.js.map +0 -1
- package/dist/sql/Update.js +0 -41
- package/dist/sql/Update.js.map +0 -1
- package/dist/sql/index.js +0 -41
- package/dist/sql/index.js.map +0 -1
- package/dist/types/Array.js +0 -54
- package/dist/types/Array.js.map +0 -1
- package/dist/types/Builder.js +0 -43
- package/dist/types/Builder.js.map +0 -1
- package/dist/types/Cache.js +0 -38
- package/dist/types/Cache.js.map +0 -1
- package/dist/types/CacheAge.js +0 -64
- package/dist/types/CacheAge.js.map +0 -1
- package/dist/types/Case.js +0 -115
- package/dist/types/Case.js.map +0 -1
- package/dist/types/Constructor.js +0 -50
- package/dist/types/Constructor.js.map +0 -1
- package/dist/types/Context.js +0 -117
- package/dist/types/Context.js.map +0 -1
- package/dist/types/Enum.js +0 -76
- package/dist/types/Enum.js.map +0 -1
- package/dist/types/ErrorOrigin.js +0 -17
- package/dist/types/ErrorOrigin.js.map +0 -1
- package/dist/types/Exception.js +0 -54
- package/dist/types/Exception.js.map +0 -1
- package/dist/types/Falsy.js +0 -32
- package/dist/types/Falsy.js.map +0 -1
- package/dist/types/Func.js +0 -29
- package/dist/types/Func.js.map +0 -1
- package/dist/types/Gateway.js +0 -62
- package/dist/types/Gateway.js.map +0 -1
- package/dist/types/Get.js +0 -36
- package/dist/types/Get.js.map +0 -1
- package/dist/types/Id.js +0 -30
- package/dist/types/Id.js.map +0 -1
- package/dist/types/Identity.js +0 -17
- package/dist/types/Identity.js.map +0 -1
- package/dist/types/Is.js +0 -85
- package/dist/types/Is.js.map +0 -1
- package/dist/types/IsA.js +0 -33
- package/dist/types/IsA.js.map +0 -1
- package/dist/types/IsDate.js +0 -46
- package/dist/types/IsDate.js.map +0 -1
- package/dist/types/IsEqual.js +0 -39
- package/dist/types/IsEqual.js.map +0 -1
- package/dist/types/Json.js +0 -67
- package/dist/types/Json.js.map +0 -1
- package/dist/types/List.js +0 -208
- package/dist/types/List.js.map +0 -1
- package/dist/types/Message.js +0 -30
- package/dist/types/Message.js.map +0 -1
- package/dist/types/Meta.js +0 -71
- package/dist/types/Meta.js.map +0 -1
- package/dist/types/Nullish.js +0 -29
- package/dist/types/Nullish.js.map +0 -1
- package/dist/types/Number.js +0 -33
- package/dist/types/Number.js.map +0 -1
- package/dist/types/PageList.js.map +0 -1
- package/dist/types/Parser.js +0 -69
- package/dist/types/Parser.js.map +0 -1
- package/dist/types/Primitive.js +0 -32
- package/dist/types/Primitive.js.map +0 -1
- package/dist/types/Repository.js +0 -68
- package/dist/types/Repository.js.map +0 -1
- package/dist/types/Result.js +0 -38
- package/dist/types/Result.js.map +0 -1
- package/dist/types/Results.js +0 -51
- package/dist/types/Results.js.map +0 -1
- package/dist/types/Sort.js +0 -32
- package/dist/types/Sort.js.map +0 -1
- package/dist/types/Tag.js +0 -35
- package/dist/types/Tag.js.map +0 -1
- package/dist/types/Template.js +0 -65
- package/dist/types/Template.js.map +0 -1
- package/dist/types/Text.js +0 -137
- package/dist/types/Text.js.map +0 -1
- package/dist/types/Try.js +0 -137
- package/dist/types/Try.js.map +0 -1
- package/dist/types/TypeGuard.js +0 -17
- package/dist/types/TypeGuard.js.map +0 -1
- package/dist/types/Types.js +0 -17
- package/dist/types/Types.js.map +0 -1
- package/dist/types/Uri.js +0 -106
- package/dist/types/Uri.js.map +0 -1
- package/dist/types/Uuid.js +0 -35
- package/dist/types/Uuid.js.map +0 -1
- package/dist/types/Validatable.js +0 -30
- package/dist/types/Validatable.js.map +0 -1
- package/dist/types/Value.js +0 -47
- package/dist/types/Value.js.map +0 -1
- package/dist/types/index.js +0 -107
- package/dist/types/index.js.map +0 -1
- package/dist/utils/Base64.js +0 -33
- package/dist/utils/Base64.js.map +0 -1
- package/dist/utils/Convert.js +0 -69
- package/dist/utils/Convert.js.map +0 -1
- package/dist/utils/If.js +0 -47
- package/dist/utils/If.js.map +0 -1
- package/dist/utils/Loading.js +0 -30
- package/dist/utils/Loading.js.map +0 -1
- package/dist/utils/Log.js +0 -43
- package/dist/utils/Log.js.map +0 -1
- package/dist/utils/Mapper.js +0 -133
- package/dist/utils/Mapper.js.map +0 -1
- package/dist/utils/Promise.js +0 -56
- package/dist/utils/Promise.js.map +0 -1
- package/dist/utils/Property.js +0 -42
- package/dist/utils/Property.js.map +0 -1
- package/dist/utils/Sentence.js +0 -80
- package/dist/utils/Sentence.js.map +0 -1
- package/dist/utils/State.js +0 -36
- package/dist/utils/State.js.map +0 -1
- package/dist/utils/Traverse.js +0 -33
- package/dist/utils/Traverse.js.map +0 -1
- package/dist/utils/View.js +0 -86
- package/dist/utils/View.js.map +0 -1
- package/dist/utils/Wait.js +0 -39
- package/dist/utils/Wait.js.map +0 -1
- package/dist/utils/index.js +0 -47
- package/dist/utils/index.js.map +0 -1
- package/dist/validation/Contraints.js +0 -91
- package/dist/validation/Contraints.js.map +0 -1
- package/dist/validation/Validate.js +0 -46
- package/dist/validation/Validate.js.map +0 -1
- package/dist/validation/When.js +0 -68
- package/dist/validation/When.js.map +0 -1
- package/dist/validation/index.js +0 -27
- package/dist/validation/index.js.map +0 -1
package/dist/utils/View.mjs
CHANGED
|
@@ -1,68 +1,25 @@
|
|
|
1
|
-
import "../chunk-4N72FQFX.mjs";
|
|
2
1
|
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
})).type(isSimpleView, (f) => ({ key, f: (a) => f.from(traverse(a, key)) })).type(isFunction, (f) => ({ key, f })).else((v) => ({ key, f: () => v }));
|
|
25
|
-
const optional = (c, v) => ifDefined(
|
|
26
|
-
v,
|
|
27
|
-
(i) => new c(i),
|
|
28
|
-
() => v
|
|
29
|
-
);
|
|
30
|
-
const toViewers = (views2) => meta(views2).entries().map(([k, v]) => toViewer(k, v));
|
|
31
|
-
class View {
|
|
32
|
-
constructor(views2 = {}, startsFrom = "scratch", viewers = toViewers(views2)) {
|
|
33
|
-
this.views = views2;
|
|
34
|
-
this.startsFrom = startsFrom;
|
|
35
|
-
this.viewers = viewers;
|
|
36
|
-
}
|
|
37
|
-
get fromSource() {
|
|
38
|
-
return new View(this.views, "source", this.viewers);
|
|
39
|
-
}
|
|
40
|
-
from(source) {
|
|
41
|
-
if (isPageList(source))
|
|
42
|
-
return toPageList(
|
|
43
|
-
source.map((s) => this.reduce(s)),
|
|
44
|
-
source
|
|
45
|
-
);
|
|
46
|
-
if (isArray(source))
|
|
47
|
-
return source.map((s) => this.reduce(s));
|
|
48
|
-
return this.reduce(source);
|
|
49
|
-
}
|
|
50
|
-
same = (one, another) => isEqual(this.from(one), this.from(another));
|
|
51
|
-
reduce = (source) => use(asJson(source), (src) => this.viewers.reduce((acc, v) => json.set(acc, v.key, v.f(src, v.key)), this.startsFrom === "scratch" ? {} : src));
|
|
52
|
-
}
|
|
53
|
-
const isSimpleView = (a) => a instanceof View;
|
|
54
|
-
const view = (views2) => new View(views2);
|
|
55
|
-
const views = {
|
|
56
|
-
ignore,
|
|
57
|
-
keep,
|
|
58
|
-
skip: ignore,
|
|
59
|
-
value: (value) => () => value,
|
|
60
|
-
or: {
|
|
61
|
-
key: (altKey) => (a, key) => traverse(a, key) ?? traverse(a, altKey),
|
|
62
|
-
value: (altValue) => (a, key) => traverse(a, key) ?? altValue,
|
|
63
|
-
func: (altFunc) => (a, key) => traverse(a, key) ?? altFunc(a, key)
|
|
64
|
-
}
|
|
65
|
-
};
|
|
2
|
+
View,
|
|
3
|
+
isSimpleView,
|
|
4
|
+
toViewer,
|
|
5
|
+
view,
|
|
6
|
+
views
|
|
7
|
+
} from "../chunk-HNB4RM5S.mjs";
|
|
8
|
+
import "../chunk-DICMUQFL.mjs";
|
|
9
|
+
import "../chunk-H22IHXDC.mjs";
|
|
10
|
+
import "../chunk-7NYZAGM3.mjs";
|
|
11
|
+
import "../chunk-YTWFWQNB.mjs";
|
|
12
|
+
import "../chunk-CMRS457E.mjs";
|
|
13
|
+
import "../chunk-5AF55QCJ.mjs";
|
|
14
|
+
import "../chunk-JXJ5LRH3.mjs";
|
|
15
|
+
import "../chunk-4QX4EMLL.mjs";
|
|
16
|
+
import "../chunk-SJGQU3OG.mjs";
|
|
17
|
+
import "../chunk-FAAERRP2.mjs";
|
|
18
|
+
import "../chunk-GI5TZOAG.mjs";
|
|
19
|
+
import "../chunk-PSIJUWZT.mjs";
|
|
20
|
+
import "../chunk-PIRWVOO2.mjs";
|
|
21
|
+
import "../chunk-OXBQSJDF.mjs";
|
|
22
|
+
import "../chunk-4N72FQFX.mjs";
|
|
66
23
|
export {
|
|
67
24
|
View,
|
|
68
25
|
isSimpleView,
|
package/dist/utils/View.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/dist/utils/Wait.mjs
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import "../chunk-4N72FQFX.mjs";
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
// src/utils/Wait.ts
|
|
4
|
+
var Wait = class {
|
|
3
5
|
static wait(ms = 0) {
|
|
4
6
|
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
5
7
|
}
|
|
6
8
|
static seconds(s = 0) {
|
|
7
9
|
return this.wait(s * 1e3);
|
|
8
10
|
}
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
+
};
|
|
12
|
+
var wait = (millis) => Wait.wait(millis);
|
|
11
13
|
export {
|
|
12
14
|
Wait,
|
|
13
15
|
wait
|
package/dist/utils/Wait.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/Wait.ts"],"sourcesContent":["export class Wait {\n static wait(ms = 0): Promise<void> {\n return new Promise(resolve => setTimeout(resolve, ms));\n }\n\n static seconds(s = 0) {\n return this.wait(s * 1000);\n }\n}\n\nexport const wait = (millis: number) => Wait.wait(millis);\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/utils/Wait.ts"],"sourcesContent":["export class Wait {\n static wait(ms = 0): Promise<void> {\n return new Promise(resolve => setTimeout(resolve, ms));\n }\n\n static seconds(s = 0) {\n return this.wait(s * 1000);\n }\n}\n\nexport const wait = (millis: number) => Wait.wait(millis);\n"],"mappings":";;;AAAO,IAAM,OAAN,MAAW;AAAA,EAChB,OAAO,KAAK,KAAK,GAAkB;AACjC,WAAO,IAAI,QAAQ,aAAW,WAAW,SAAS,EAAE,CAAC;AAAA,EACvD;AAAA,EAEA,OAAO,QAAQ,IAAI,GAAG;AACpB,WAAO,KAAK,KAAK,IAAI,GAAI;AAAA,EAC3B;AACF;AAEO,IAAM,OAAO,CAAC,WAAmB,KAAK,KAAK,MAAM;","names":[]}
|
|
@@ -1,33 +1,36 @@
|
|
|
1
|
+
import {
|
|
2
|
+
constraint,
|
|
3
|
+
defined,
|
|
4
|
+
future,
|
|
5
|
+
gt,
|
|
6
|
+
gte,
|
|
7
|
+
inList,
|
|
8
|
+
inOptionalList,
|
|
9
|
+
includes,
|
|
10
|
+
lt,
|
|
11
|
+
lte,
|
|
12
|
+
maxLength,
|
|
13
|
+
minLength,
|
|
14
|
+
notEmpty,
|
|
15
|
+
optional,
|
|
16
|
+
past,
|
|
17
|
+
required,
|
|
18
|
+
rule,
|
|
19
|
+
valid
|
|
20
|
+
} from "../chunk-EZC3HAYN.mjs";
|
|
21
|
+
import "../chunk-ADJAEGCT.mjs";
|
|
22
|
+
import "../chunk-YTWFWQNB.mjs";
|
|
23
|
+
import "../chunk-CMRS457E.mjs";
|
|
24
|
+
import "../chunk-5AF55QCJ.mjs";
|
|
25
|
+
import "../chunk-JXJ5LRH3.mjs";
|
|
26
|
+
import "../chunk-4QX4EMLL.mjs";
|
|
27
|
+
import "../chunk-SJGQU3OG.mjs";
|
|
28
|
+
import "../chunk-FAAERRP2.mjs";
|
|
29
|
+
import "../chunk-GI5TZOAG.mjs";
|
|
30
|
+
import "../chunk-PSIJUWZT.mjs";
|
|
31
|
+
import "../chunk-PIRWVOO2.mjs";
|
|
32
|
+
import "../chunk-OXBQSJDF.mjs";
|
|
1
33
|
import "../chunk-4N72FQFX.mjs";
|
|
2
|
-
import { inFuture, inPast, isBoolean, isDefined, isFunction, isIn, isNotEmpty, isString, meta, text, toList, tryTo } from "../types";
|
|
3
|
-
import { validate } from "./Validate";
|
|
4
|
-
const constraint = (c, message) => (subject, property) => {
|
|
5
|
-
const cs = meta(subject).property(property).get("constraint") ?? toList();
|
|
6
|
-
meta(subject).property(property).set("constraint", cs.add({ property, constraint: c, text: message }));
|
|
7
|
-
};
|
|
8
|
-
const defined = (message) => constraint((v) => isDefined(v), message ?? "Property {property} must be defined.");
|
|
9
|
-
const required = (message) => constraint((v) => isNotEmpty(v), message ?? "Property {property} is required, and may not be empty.");
|
|
10
|
-
const notEmpty = (message) => constraint((v) => isNotEmpty(v), message ?? "Property {property} may not be empty.");
|
|
11
|
-
const valid = () => constraint((v) => validate(v), "");
|
|
12
|
-
const optional = () => constraint((v) => !isDefined(v) || validate(v), "");
|
|
13
|
-
const includes = (sub, message) => constraint((s) => isDefined(s) && isString(s) && s.includes(sub), message ?? `Value {actual} must include '${sub}'.`);
|
|
14
|
-
const inList = (values, message) => constraint((v) => isDefined(v) && isIn(v, values), message ?? "Value {actual} must appear in list.");
|
|
15
|
-
const inOptionalList = (values, message) => constraint((v) => !isDefined(v) || isIn(v, values), message ?? "Value {actual} must appear in list.");
|
|
16
|
-
const gt = (limit, message) => constraint((v) => v > limit, message ?? `Value {actual} must be larger than '${limit}'.`);
|
|
17
|
-
const gte = (limit, message) => constraint((v) => v >= limit, message ?? `Value {actual} must be larger than or equal to ${limit}.`);
|
|
18
|
-
const lt = (limit, message) => constraint((v) => v < limit, message ?? `Value {actual} must be smaller than ${limit}.`);
|
|
19
|
-
const lte = (limit, message) => constraint((v) => v <= limit, message ?? `Value {actual} must be smaller than or equal to ${limit}.`);
|
|
20
|
-
const past = (message) => constraint((v) => inPast(v), message ?? "Value {actual} must lay in the past.");
|
|
21
|
-
const future = (message) => constraint((v) => inFuture(v), message ?? "Value {actual} must lay in the future.");
|
|
22
|
-
const minLength = (length, message) => constraint(
|
|
23
|
-
(v) => tryTo(() => v).is.defined().map((v2) => text(v2).toString().length >= length).orElse(true),
|
|
24
|
-
message ?? `Value {actual} must be at least '${length}' characters long.`
|
|
25
|
-
);
|
|
26
|
-
const maxLength = (length, message) => constraint(
|
|
27
|
-
(v) => tryTo(() => v).is.defined().map((v2) => text(v2).toString().length <= length).orElse(true),
|
|
28
|
-
message ?? `Value {actual} cannot be longer than '${length}' characters.`
|
|
29
|
-
);
|
|
30
|
-
const rule = (message) => constraint((v) => isFunction(v) ? v() : isBoolean(v) ? v : false, message ?? `Value {actual} must be true`);
|
|
31
34
|
export {
|
|
32
35
|
constraint,
|
|
33
36
|
defined,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -1,32 +1,20 @@
|
|
|
1
|
-
import "../chunk-4N72FQFX.mjs";
|
|
2
1
|
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
import { when } from "./When";
|
|
20
|
-
const asResults = (subject, template, options = {}) => toResults(toResult(text(template).parse(subject, options), toName(subject)));
|
|
21
|
-
const validators = (subject) => meta(subject).keys("constraint").reduce((list, vs) => list.add(vs), toList());
|
|
22
|
-
const runValidator = (v, subject) => tryTo(() => isFunction(subject[v.property]) ? subject[v.property]() : subject[v.property]).map((actual) => [actual, v.constraint(actual)]).map(([actual, res]) => isResults(res) ? res : !res ? asResults(subject, v.text, { ...v, actual }) : toResults()).recover((e) => asResults(subject, asString(e))).value;
|
|
23
|
-
const constraints = (subject) => tryTo(() => validators(subject)).map((vs) => vs.mapDefined((v) => runValidator(v, subject))).map((res) => res.reduce((rs, r) => rs.add(...r.results), toResults())).value;
|
|
24
|
-
const validate = (subject) => choose(subject).is.not.defined(
|
|
25
|
-
(s) => s,
|
|
26
|
-
() => toResults("Subject is not defined.")
|
|
27
|
-
).type(isEnum, (e) => e.isValid ? toResults() : asResults(e, "This is not a valid {type}.")).type(isValue, (v) => v.isValid ? toResults() : asResults(v, "This is not a valid {type}.")).type(isArray, (a) => a.map((i) => validate(i)).reduce((rs, r) => rs.add(...r.results), toResults())).type(isValidatable, (v) => constraints(v)).else(toResults());
|
|
28
|
-
const validateReject = (subject) => when(subject).not.isValid.reject();
|
|
29
|
-
const isValid = (t) => validate(t).isValid;
|
|
2
|
+
asResults,
|
|
3
|
+
isValid,
|
|
4
|
+
validate,
|
|
5
|
+
validateReject
|
|
6
|
+
} from "../chunk-YTWFWQNB.mjs";
|
|
7
|
+
import "../chunk-CMRS457E.mjs";
|
|
8
|
+
import "../chunk-5AF55QCJ.mjs";
|
|
9
|
+
import "../chunk-JXJ5LRH3.mjs";
|
|
10
|
+
import "../chunk-4QX4EMLL.mjs";
|
|
11
|
+
import "../chunk-SJGQU3OG.mjs";
|
|
12
|
+
import "../chunk-FAAERRP2.mjs";
|
|
13
|
+
import "../chunk-GI5TZOAG.mjs";
|
|
14
|
+
import "../chunk-PSIJUWZT.mjs";
|
|
15
|
+
import "../chunk-PIRWVOO2.mjs";
|
|
16
|
+
import "../chunk-OXBQSJDF.mjs";
|
|
17
|
+
import "../chunk-4N72FQFX.mjs";
|
|
30
18
|
export {
|
|
31
19
|
asResults,
|
|
32
20
|
isValid,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/dist/validation/When.mjs
CHANGED
|
@@ -1,42 +1,18 @@
|
|
|
1
|
+
import {
|
|
2
|
+
When,
|
|
3
|
+
when
|
|
4
|
+
} from "../chunk-YTWFWQNB.mjs";
|
|
5
|
+
import "../chunk-CMRS457E.mjs";
|
|
6
|
+
import "../chunk-5AF55QCJ.mjs";
|
|
7
|
+
import "../chunk-JXJ5LRH3.mjs";
|
|
8
|
+
import "../chunk-4QX4EMLL.mjs";
|
|
9
|
+
import "../chunk-SJGQU3OG.mjs";
|
|
10
|
+
import "../chunk-FAAERRP2.mjs";
|
|
11
|
+
import "../chunk-GI5TZOAG.mjs";
|
|
12
|
+
import "../chunk-PSIJUWZT.mjs";
|
|
13
|
+
import "../chunk-PIRWVOO2.mjs";
|
|
14
|
+
import "../chunk-OXBQSJDF.mjs";
|
|
1
15
|
import "../chunk-4N72FQFX.mjs";
|
|
2
|
-
import { Exception, isDefined, isEmpty, isIn, ofGet, toArray } from "../types";
|
|
3
|
-
import { validate } from "./Validate";
|
|
4
|
-
import { reject, resolve } from "../utils";
|
|
5
|
-
class When {
|
|
6
|
-
constructor(subject, valid = true, results) {
|
|
7
|
-
this.subject = subject;
|
|
8
|
-
this.valid = valid;
|
|
9
|
-
this.results = results;
|
|
10
|
-
}
|
|
11
|
-
get not() {
|
|
12
|
-
return this.clone(!this.valid);
|
|
13
|
-
}
|
|
14
|
-
get and() {
|
|
15
|
-
return this.clone(this.valid);
|
|
16
|
-
}
|
|
17
|
-
get isDefined() {
|
|
18
|
-
return this.clone(this.valid === isDefined(this.subject));
|
|
19
|
-
}
|
|
20
|
-
get isEmpty() {
|
|
21
|
-
return this.clone(this.valid === isEmpty(this.subject));
|
|
22
|
-
}
|
|
23
|
-
get isTrue() {
|
|
24
|
-
return this.clone(this.valid === !!this.subject);
|
|
25
|
-
}
|
|
26
|
-
get isValid() {
|
|
27
|
-
this.results = validate(this.subject);
|
|
28
|
-
return this.clone(this.valid === this.results.isValid);
|
|
29
|
-
}
|
|
30
|
-
isInstance = (c) => this.clone(this.valid === this.subject instanceof c);
|
|
31
|
-
with = (pred) => this.clone(this.valid === ofGet(pred, this.subject));
|
|
32
|
-
contains = (property) => this.clone(this.valid === isDefined(ofGet(property, this.subject)));
|
|
33
|
-
in = (...items) => this.clone(this.valid === isIn(this.subject, toArray(...items)));
|
|
34
|
-
is = (item) => this.clone(this.valid === (this.subject === item));
|
|
35
|
-
reject = (error) => !this.valid ? resolve(this.subject) : reject(ofGet(error, this.subject) ?? this.results ?? Exception.Unknown);
|
|
36
|
-
recover = (f) => resolve(!this.valid ? this.subject : f(this.subject));
|
|
37
|
-
clone = (result = true) => new When(this.subject, result, this.results);
|
|
38
|
-
}
|
|
39
|
-
const when = (subject) => new When(subject);
|
|
40
16
|
export {
|
|
41
17
|
When,
|
|
42
18
|
when
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thisisagile/easy",
|
|
3
|
-
"version": "15.
|
|
3
|
+
"version": "15.27.0",
|
|
4
4
|
"description": "Straightforward library for building domain-driven microservice architectures",
|
|
5
5
|
"author": "Sander Hoogendoorn",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"main": "dist/index.js",
|
|
8
8
|
"module": "dist/index.mjs",
|
|
9
|
-
"types": "dist/index",
|
|
9
|
+
"types": "dist/index.d.ts",
|
|
10
10
|
"repository": {
|
|
11
11
|
"type": "git",
|
|
12
12
|
"url": "git@github.com:thisisagile/easy.git"
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
"test": "yarn g:jest --coverage",
|
|
26
26
|
"prepack": "yarn g:copy-readme"
|
|
27
27
|
},
|
|
28
|
+
"sideEffects": false,
|
|
28
29
|
"files": [
|
|
29
30
|
"dist",
|
|
30
31
|
"src"
|
|
@@ -33,7 +34,7 @@
|
|
|
33
34
|
"access": "public"
|
|
34
35
|
},
|
|
35
36
|
"devDependencies": {
|
|
36
|
-
"@thisisagile/easy-test": "15.
|
|
37
|
+
"@thisisagile/easy-test": "15.27.0",
|
|
37
38
|
"@types/form-urlencoded": "^4.4.0",
|
|
38
39
|
"@types/jsonwebtoken": "^9.0.6",
|
|
39
40
|
"@types/luxon": "3.4.2",
|
package/dist/data/Condition.js
DELETED
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var Condition_exports = {};
|
|
20
|
-
__export(Condition_exports, {
|
|
21
|
-
Condition: () => Condition,
|
|
22
|
-
LogicalCondition: () => LogicalCondition,
|
|
23
|
-
SortCondition: () => SortCondition,
|
|
24
|
-
isSortCondition: () => isSortCondition,
|
|
25
|
-
toCondition: () => toCondition
|
|
26
|
-
});
|
|
27
|
-
module.exports = __toCommonJS(Condition_exports);
|
|
28
|
-
var import_types = require("../types");
|
|
29
|
-
var import_utils = require("../utils");
|
|
30
|
-
class Condition {
|
|
31
|
-
constructor(key, operator, value) {
|
|
32
|
-
this.key = key;
|
|
33
|
-
this.operator = operator;
|
|
34
|
-
this.value = value;
|
|
35
|
-
}
|
|
36
|
-
and = (...others) => new LogicalCondition("and", [this, ...others]);
|
|
37
|
-
or = (...others) => new LogicalCondition("or", [this, ...others]);
|
|
38
|
-
toJSON() {
|
|
39
|
-
return { [this.key]: { [`$${this.operator}`]: import_types.json.parse(this.value) } };
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
class LogicalCondition {
|
|
43
|
-
constructor(operator, conditions) {
|
|
44
|
-
this.operator = operator;
|
|
45
|
-
this.conditions = conditions;
|
|
46
|
-
}
|
|
47
|
-
toJSON() {
|
|
48
|
-
return { [`$${this.operator}`]: this.conditions.map((c) => c.toJSON()) };
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
class SortCondition extends Condition {
|
|
52
|
-
constructor(key, value) {
|
|
53
|
-
super(key, "", value);
|
|
54
|
-
this.key = key;
|
|
55
|
-
this.value = value;
|
|
56
|
-
}
|
|
57
|
-
toJSON() {
|
|
58
|
-
return { [this.key]: this.value };
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
const toCondition = (field, operator, value, conv = import_utils.convert.default) => new Condition(field, operator, conv.from(value));
|
|
62
|
-
const isSortCondition = (s) => (0, import_types.isDefined)(s) && s instanceof SortCondition;
|
|
63
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
64
|
-
0 && (module.exports = {
|
|
65
|
-
Condition,
|
|
66
|
-
LogicalCondition,
|
|
67
|
-
SortCondition,
|
|
68
|
-
isSortCondition,
|
|
69
|
-
toCondition
|
|
70
|
-
});
|
|
71
|
-
//# sourceMappingURL=Condition.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/data/Condition.ts"],"sourcesContent":["import { isDefined, json, Json, JsonValue, Sort } from '../types';\nimport { convert, Convert } from '../utils';\n\nexport class Condition {\n constructor(readonly key: string, readonly operator: string, readonly value: unknown) {}\n\n and = (...others: Condition[]): LogicalCondition => new LogicalCondition('and', [this, ...others]);\n or = (...others: Condition[]): LogicalCondition => new LogicalCondition('or', [this, ...others]);\n\n toJSON(): Json {\n return { [this.key]: { [`$${this.operator}`]: json.parse(this.value) } };\n }\n}\n\nexport class LogicalCondition {\n constructor(readonly operator: string, readonly conditions: Condition[]) {}\n\n toJSON(): Json {\n return { [`$${this.operator}`]: this.conditions.map(c => c.toJSON()) };\n }\n}\n\nexport class SortCondition extends Condition implements Sort {\n constructor(readonly key: string, readonly value: -1 | 1) {\n super(key, '', value);\n }\n\n toJSON(): Json {\n return { [this.key]: this.value };\n }\n}\n\nexport const toCondition = (field: string, operator: string, value: unknown, conv: Convert = convert.default): Condition =>\n new Condition(field, operator, conv.from(value) as JsonValue);\n\nexport const isSortCondition = (s?: unknown): s is SortCondition => isDefined(s) && s instanceof SortCondition;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAuD;AACvD,mBAAiC;AAE1B,MAAM,UAAU;AAAA,EACrB,YAAqB,KAAsB,UAA2B,OAAgB;AAAjE;AAAsB;AAA2B;AAAA,EAAiB;AAAA,EAEvF,MAAM,IAAI,WAA0C,IAAI,iBAAiB,OAAO,CAAC,MAAM,GAAG,MAAM,CAAC;AAAA,EACjG,KAAK,IAAI,WAA0C,IAAI,iBAAiB,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC;AAAA,EAE/F,SAAe;AACb,WAAO,EAAE,CAAC,KAAK,GAAG,GAAG,EAAE,CAAC,IAAI,KAAK,QAAQ,EAAE,GAAG,kBAAK,MAAM,KAAK,KAAK,EAAE,EAAE;AAAA,EACzE;AACF;AAEO,MAAM,iBAAiB;AAAA,EAC5B,YAAqB,UAA2B,YAAyB;AAApD;AAA2B;AAAA,EAA0B;AAAA,EAE1E,SAAe;AACb,WAAO,EAAE,CAAC,IAAI,KAAK,QAAQ,EAAE,GAAG,KAAK,WAAW,IAAI,OAAK,EAAE,OAAO,CAAC,EAAE;AAAA,EACvE;AACF;AAEO,MAAM,sBAAsB,UAA0B;AAAA,EAC3D,YAAqB,KAAsB,OAAe;AACxD,UAAM,KAAK,IAAI,KAAK;AADD;AAAsB;AAAA,EAE3C;AAAA,EAEA,SAAe;AACb,WAAO,EAAE,CAAC,KAAK,GAAG,GAAG,KAAK,MAAM;AAAA,EAClC;AACF;AAEO,MAAM,cAAc,CAAC,OAAe,UAAkB,OAAgB,OAAgB,qBAAQ,YACnG,IAAI,UAAU,OAAO,UAAU,KAAK,KAAK,KAAK,CAAc;AAEvD,MAAM,kBAAkB,CAAC,UAAoC,wBAAU,CAAC,KAAK,aAAa;","names":[]}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __copyProps = (to, from, except, desc) => {
|
|
7
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
-
for (let key of __getOwnPropNames(from))
|
|
9
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
-
}
|
|
12
|
-
return to;
|
|
13
|
-
};
|
|
14
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
-
var DataProvider_exports = {};
|
|
16
|
-
module.exports = __toCommonJS(DataProvider_exports);
|
|
17
|
-
//# sourceMappingURL=DataProvider.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/data/DataProvider.ts"],"sourcesContent":["export type DataProvider = any;\n"],"mappings":";;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
|
package/dist/data/Database.js
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var Database_exports = {};
|
|
20
|
-
__export(Database_exports, {
|
|
21
|
-
Database: () => Database,
|
|
22
|
-
DefaultProvider: () => DefaultProvider
|
|
23
|
-
});
|
|
24
|
-
module.exports = __toCommonJS(Database_exports);
|
|
25
|
-
var import_types = require("../types");
|
|
26
|
-
class DefaultProvider {
|
|
27
|
-
}
|
|
28
|
-
class Database extends import_types.Enum {
|
|
29
|
-
constructor(name, provider, options) {
|
|
30
|
-
super(name);
|
|
31
|
-
this.provider = provider;
|
|
32
|
-
this.options = options;
|
|
33
|
-
}
|
|
34
|
-
static Default = new Database("Default", DefaultProvider);
|
|
35
|
-
provide = () => (0, import_types.ofConstruct)(this.provider, this);
|
|
36
|
-
}
|
|
37
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
38
|
-
0 && (module.exports = {
|
|
39
|
-
Database,
|
|
40
|
-
DefaultProvider
|
|
41
|
-
});
|
|
42
|
-
//# sourceMappingURL=Database.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/data/Database.ts"],"sourcesContent":["import { Constructor, Enum, ofConstruct } from '../types';\nimport { DataProvider } from './DataProvider';\n\nexport type DatabaseOptions = {\n user?: string;\n password?: string;\n host?: string;\n port?: number;\n cluster?: string;\n connectionString?: string;\n maxPoolSize?: number;\n minPoolSize?: number;\n maxIdleTimeMS?: number;\n};\n\nexport class DefaultProvider implements DataProvider {}\n\nexport class Database extends Enum {\n static readonly Default = new Database('Default', DefaultProvider);\n\n constructor(name: string, readonly provider: Constructor<DataProvider> | DataProvider, readonly options?: DatabaseOptions) {\n super(name);\n }\n\n provide = <P>(): P => ofConstruct(this.provider, this);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAA+C;AAexC,MAAM,gBAAwC;AAAC;AAE/C,MAAM,iBAAiB,kBAAK;AAAA,EAGjC,YAAY,MAAuB,UAA6D,SAA2B;AACzH,UAAM,IAAI;AADuB;AAA6D;AAAA,EAEhG;AAAA,EAJA,OAAgB,UAAU,IAAI,SAAS,WAAW,eAAe;AAAA,EAMjE,UAAU,UAAY,0BAAY,KAAK,UAAU,IAAI;AACvD;","names":[]}
|
package/dist/data/Field.js
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var Field_exports = {};
|
|
20
|
-
__export(Field_exports, {
|
|
21
|
-
Field: () => Field,
|
|
22
|
-
isField: () => isField
|
|
23
|
-
});
|
|
24
|
-
module.exports = __toCommonJS(Field_exports);
|
|
25
|
-
var import_utils = require("../utils");
|
|
26
|
-
var import_Condition = require("./Condition");
|
|
27
|
-
var import_types = require("../types");
|
|
28
|
-
class Field extends import_utils.Property {
|
|
29
|
-
is = (value) => this.condition("eq", value);
|
|
30
|
-
isNot = (value) => this.condition("ne", value);
|
|
31
|
-
isIn = (...value) => this.condition("in", (0, import_types.toArray)(value));
|
|
32
|
-
notIn = (...value) => this.condition("nin", (0, import_types.toArray)(value));
|
|
33
|
-
exists = (does) => this.condition("exists", does);
|
|
34
|
-
greater = (value) => this.condition("gt", value);
|
|
35
|
-
greaterEqual = (value) => this.condition("gte", value);
|
|
36
|
-
less = (value) => this.condition("lt", value);
|
|
37
|
-
lessEqual = (value) => this.condition("lte", value);
|
|
38
|
-
asc = () => new import_Condition.SortCondition(this.property, 1);
|
|
39
|
-
desc = () => new import_Condition.SortCondition(this.property, -1);
|
|
40
|
-
condition = (operator, value) => (0, import_Condition.toCondition)(this.property, operator, value, this.options?.convert);
|
|
41
|
-
}
|
|
42
|
-
const isField = (f) => (0, import_types.isDefined)(f) && f instanceof Field;
|
|
43
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
44
|
-
0 && (module.exports = {
|
|
45
|
-
Field,
|
|
46
|
-
isField
|
|
47
|
-
});
|
|
48
|
-
//# sourceMappingURL=Field.js.map
|
package/dist/data/Field.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/data/Field.ts"],"sourcesContent":["import { Property } from '../utils';\nimport { Condition, SortCondition, toCondition } from './Condition';\nimport { isDefined, toArray } from '../types';\n\nexport class Field extends Property {\n is = (value: unknown): Condition => this.condition('eq', value);\n\n isNot = (value: unknown): Condition => this.condition('ne', value);\n\n isIn = (...value: unknown[]): Condition => this.condition('in', toArray(value));\n\n notIn = (...value: unknown[]): Condition => this.condition('nin', toArray(value));\n\n exists = (does: boolean): Condition => this.condition('exists', does);\n\n greater = (value: unknown): Condition => this.condition('gt', value);\n\n greaterEqual = (value: unknown): Condition => this.condition('gte', value);\n\n less = (value: unknown): Condition => this.condition('lt', value);\n\n lessEqual = (value: unknown): Condition => this.condition('lte', value);\n\n asc = (): SortCondition => new SortCondition(this.property, 1);\n\n desc = (): SortCondition => new SortCondition(this.property, -1);\n\n protected condition = (operator: string, value: unknown): Condition => toCondition(this.property, operator, value, this.options?.convert);\n}\n\nexport const isField = (f?: unknown): f is Field => isDefined(f) && f instanceof Field;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAyB;AACzB,uBAAsD;AACtD,mBAAmC;AAE5B,MAAM,cAAc,sBAAS;AAAA,EAClC,KAAK,CAAC,UAA8B,KAAK,UAAU,MAAM,KAAK;AAAA,EAE9D,QAAQ,CAAC,UAA8B,KAAK,UAAU,MAAM,KAAK;AAAA,EAEjE,OAAO,IAAI,UAAgC,KAAK,UAAU,UAAM,sBAAQ,KAAK,CAAC;AAAA,EAE9E,QAAQ,IAAI,UAAgC,KAAK,UAAU,WAAO,sBAAQ,KAAK,CAAC;AAAA,EAEhF,SAAS,CAAC,SAA6B,KAAK,UAAU,UAAU,IAAI;AAAA,EAEpE,UAAU,CAAC,UAA8B,KAAK,UAAU,MAAM,KAAK;AAAA,EAEnE,eAAe,CAAC,UAA8B,KAAK,UAAU,OAAO,KAAK;AAAA,EAEzE,OAAO,CAAC,UAA8B,KAAK,UAAU,MAAM,KAAK;AAAA,EAEhE,YAAY,CAAC,UAA8B,KAAK,UAAU,OAAO,KAAK;AAAA,EAEtE,MAAM,MAAqB,IAAI,+BAAc,KAAK,UAAU,CAAC;AAAA,EAE7D,OAAO,MAAqB,IAAI,+BAAc,KAAK,UAAU,EAAE;AAAA,EAErD,YAAY,CAAC,UAAkB,cAA8B,8BAAY,KAAK,UAAU,UAAU,OAAO,KAAK,SAAS,OAAO;AAC1I;AAEO,MAAM,UAAU,CAAC,UAA4B,wBAAU,CAAC,KAAK,aAAa;","names":[]}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var InMemoryGateway_exports = {};
|
|
20
|
-
__export(InMemoryGateway_exports, {
|
|
21
|
-
InMemoryGateway: () => InMemoryGateway
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(InMemoryGateway_exports);
|
|
24
|
-
var import_types = require("../types");
|
|
25
|
-
var import_validation = require("../validation");
|
|
26
|
-
class InMemoryGateway extends import_types.Gateway {
|
|
27
|
-
constructor(data) {
|
|
28
|
-
super();
|
|
29
|
-
this.data = data;
|
|
30
|
-
}
|
|
31
|
-
all(options) {
|
|
32
|
-
return this.data.then((d) => (0, import_types.toPageList)(d, d));
|
|
33
|
-
}
|
|
34
|
-
byId(id) {
|
|
35
|
-
return this.data.then((d) => d.byId(id)).then((d) => d ? { ...d } : void 0);
|
|
36
|
-
}
|
|
37
|
-
by = (key, value) => {
|
|
38
|
-
return this.data.then((d) => d.filter((i) => i[key] === value));
|
|
39
|
-
};
|
|
40
|
-
exists(id) {
|
|
41
|
-
return this.byId(id).then((d) => (0, import_types.isDefined)(d));
|
|
42
|
-
}
|
|
43
|
-
add(item) {
|
|
44
|
-
return (0, import_validation.when)(item).not.contains((i) => i.id).reject(import_types.Exception.IsMissingId).then((i) => this.exists(i.id)).then((ex) => (0, import_validation.when)(ex).isTrue.reject(import_types.Exception.AlreadyExists)).then(() => this.data.then((d) => d.add(item))).then(() => ({ ...item }));
|
|
45
|
-
}
|
|
46
|
-
remove(id) {
|
|
47
|
-
return this.data.then(
|
|
48
|
-
(d) => (0, import_validation.when)(d.findIndex((i) => i.id === id)).with((i) => i < 0).reject(import_types.Exception.DoesNotExist).then((i) => d.splice(i, 1))
|
|
49
|
-
).then(() => true);
|
|
50
|
-
}
|
|
51
|
-
update(item) {
|
|
52
|
-
return (0, import_validation.when)(item).not.contains((i) => i.id).reject(import_types.Exception.IsMissingId).then((i) => this.remove(i.id).then(() => this.add(i)));
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
56
|
-
0 && (module.exports = {
|
|
57
|
-
InMemoryGateway
|
|
58
|
-
});
|
|
59
|
-
//# sourceMappingURL=InMemoryGateway.js.map
|