@thisisagile/easy 15.29.2 → 15.29.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-3MOFYE2N.mjs → chunk-2ZUDYGPP.mjs} +5 -5
- package/dist/chunk-2ZUDYGPP.mjs.map +1 -0
- package/dist/{chunk-A5MC57TL.mjs → chunk-3L4RAR24.mjs} +9 -7
- package/dist/chunk-3L4RAR24.mjs.map +1 -0
- package/dist/chunk-45GNHDKA.mjs +27 -0
- package/dist/chunk-45GNHDKA.mjs.map +1 -0
- package/dist/{chunk-BAXNN36F.mjs → chunk-4DJNTF2D.mjs} +5 -3
- package/dist/chunk-4DJNTF2D.mjs.map +1 -0
- package/dist/chunk-4G6AW6D6.mjs +35 -0
- package/dist/chunk-4G6AW6D6.mjs.map +1 -0
- package/dist/{chunk-I5MPU33B.mjs → chunk-5WSP2IYF.mjs} +4 -4
- package/dist/chunk-5WSP2IYF.mjs.map +1 -0
- package/dist/{chunk-GCPVSACZ.mjs → chunk-5YM5CLOG.mjs} +2 -2
- package/dist/{chunk-GUSPHVF2.mjs → chunk-6BQEFLOS.mjs} +5 -3
- package/dist/chunk-6BQEFLOS.mjs.map +1 -0
- package/dist/{chunk-MRIELSWP.mjs → chunk-6VLC4Z4H.mjs} +2 -2
- package/dist/chunk-6VLC4Z4H.mjs.map +1 -0
- package/dist/chunk-6YVMQB26.mjs +94 -0
- package/dist/chunk-6YVMQB26.mjs.map +1 -0
- package/dist/{chunk-YHL2CUBI.mjs → chunk-73UD7JJL.mjs} +2 -2
- package/dist/chunk-73UD7JJL.mjs.map +1 -0
- package/dist/{chunk-2L3GZ6NK.mjs → chunk-7K4QMDUN.mjs} +2 -2
- package/dist/chunk-7K4QMDUN.mjs.map +1 -0
- package/dist/{chunk-S5RHU67S.mjs → chunk-7TJ4VCBE.mjs} +15 -9
- package/dist/chunk-7TJ4VCBE.mjs.map +1 -0
- package/dist/{chunk-NKHZO3ME.mjs → chunk-A2JYVEBB.mjs} +4 -4
- package/dist/chunk-A2JYVEBB.mjs.map +1 -0
- package/dist/{chunk-57QV3J5N.mjs → chunk-A62OK7XE.mjs} +10 -6
- package/dist/{chunk-57QV3J5N.mjs.map → chunk-A62OK7XE.mjs.map} +1 -1
- package/dist/{chunk-TQUDYF6E.mjs → chunk-APYISY5K.mjs} +2 -2
- package/dist/chunk-APYISY5K.mjs.map +1 -0
- package/dist/{chunk-XLFC44Y3.mjs → chunk-ARTSACXM.mjs} +17 -22
- package/dist/chunk-ARTSACXM.mjs.map +1 -0
- package/dist/chunk-ARZEQQW5.mjs +315 -0
- package/dist/chunk-ARZEQQW5.mjs.map +1 -0
- package/dist/chunk-CAHTK3AT.mjs +30 -0
- package/dist/chunk-CAHTK3AT.mjs.map +1 -0
- package/dist/{chunk-ARN4MTMY.mjs → chunk-D4K4MC24.mjs} +3 -3
- package/dist/chunk-D4K4MC24.mjs.map +1 -0
- package/dist/{chunk-624IHTEI.mjs → chunk-D5FLGKVR.mjs} +18 -12
- package/dist/chunk-D5FLGKVR.mjs.map +1 -0
- package/dist/{chunk-UWNXWKBU.mjs → chunk-DEJ7A5PY.mjs} +1 -35
- package/dist/chunk-DEJ7A5PY.mjs.map +1 -0
- package/dist/chunk-DXQSIBC7.mjs +13 -0
- package/dist/chunk-DXQSIBC7.mjs.map +1 -0
- package/dist/{chunk-SG6BDC6T.mjs → chunk-EDVJUOFU.mjs} +18 -12
- package/dist/chunk-EDVJUOFU.mjs.map +1 -0
- package/dist/{chunk-IWLJEAQZ.mjs → chunk-EIJ3GSGG.mjs} +5 -3
- package/dist/chunk-EIJ3GSGG.mjs.map +1 -0
- package/dist/chunk-FHW5K2RR.mjs +150 -0
- package/dist/chunk-FHW5K2RR.mjs.map +1 -0
- package/dist/{chunk-WYT52YAX.mjs → chunk-GSZLYZSW.mjs} +23 -11
- package/dist/chunk-GSZLYZSW.mjs.map +1 -0
- package/dist/{chunk-I3DRDMCS.mjs → chunk-HBJMCX2I.mjs} +3 -3
- package/dist/chunk-HBJMCX2I.mjs.map +1 -0
- package/dist/{chunk-2KKIXOMB.mjs → chunk-HNVAFEZP.mjs} +3 -3
- package/dist/{chunk-QRN4Y2QC.mjs → chunk-HV4CI2QX.mjs} +18 -12
- package/dist/chunk-HV4CI2QX.mjs.map +1 -0
- package/dist/chunk-IAXKOENJ.mjs +55 -0
- package/dist/chunk-IAXKOENJ.mjs.map +1 -0
- package/dist/chunk-J6KN572O.mjs +20 -0
- package/dist/chunk-J6KN572O.mjs.map +1 -0
- package/dist/chunk-J7XKOXMW.mjs +203 -0
- package/dist/chunk-J7XKOXMW.mjs.map +1 -0
- package/dist/{chunk-RFG5LNDQ.mjs → chunk-JBJ2YERG.mjs} +6 -4
- package/dist/{chunk-RFG5LNDQ.mjs.map → chunk-JBJ2YERG.mjs.map} +1 -1
- package/dist/{chunk-J64VE55O.mjs → chunk-JFJLDIJB.mjs} +10 -10
- package/dist/chunk-JFJLDIJB.mjs.map +1 -0
- package/dist/{chunk-F4CWMZCV.mjs → chunk-JFU65NZU.mjs} +11 -9
- package/dist/chunk-JFU65NZU.mjs.map +1 -0
- package/dist/{chunk-PWCGCUT7.mjs → chunk-JSON7A4X.mjs} +6 -4
- package/dist/chunk-JSON7A4X.mjs.map +1 -0
- package/dist/chunk-JTGB3TSZ.mjs +24 -0
- package/dist/chunk-JTGB3TSZ.mjs.map +1 -0
- package/dist/{chunk-NOMZAVQC.mjs → chunk-KRLEHX37.mjs} +12 -6
- package/dist/chunk-KRLEHX37.mjs.map +1 -0
- package/dist/{chunk-H7NDGISC.mjs → chunk-LAR7AT6R.mjs} +2 -2
- package/dist/chunk-LAR7AT6R.mjs.map +1 -0
- package/dist/{chunk-OXVJLJIE.mjs → chunk-LXQQ5N6S.mjs} +2 -2
- package/dist/chunk-LYAPQ4QZ.mjs +40 -0
- package/dist/chunk-LYAPQ4QZ.mjs.map +1 -0
- package/dist/{chunk-QRLGQY7M.mjs → chunk-M47EOYDK.mjs} +6 -4
- package/dist/chunk-M47EOYDK.mjs.map +1 -0
- package/dist/{chunk-CJDDGEEK.mjs → chunk-NFWIUPZU.mjs} +8 -6
- package/dist/chunk-NFWIUPZU.mjs.map +1 -0
- package/dist/{chunk-7Z3YQCXR.mjs → chunk-NYYHRFBW.mjs} +6 -4
- package/dist/chunk-NYYHRFBW.mjs.map +1 -0
- package/dist/{chunk-4ROYPQPC.mjs → chunk-OFGI5FLG.mjs} +2 -2
- package/dist/chunk-PPWHEIZW.mjs +58 -0
- package/dist/chunk-PPWHEIZW.mjs.map +1 -0
- package/dist/chunk-Q5HABVOK.mjs +20 -0
- package/dist/chunk-Q5HABVOK.mjs.map +1 -0
- package/dist/{chunk-TG5IPJOG.mjs → chunk-QQRGOHU6.mjs} +2 -2
- package/dist/chunk-QQRGOHU6.mjs.map +1 -0
- package/dist/{chunk-5J3LAY32.mjs → chunk-QTPKH4PY.mjs} +5 -5
- package/dist/chunk-QTPKH4PY.mjs.map +1 -0
- package/dist/{chunk-65W3AYRE.mjs → chunk-RNROH3VJ.mjs} +6 -4
- package/dist/chunk-RNROH3VJ.mjs.map +1 -0
- package/dist/{chunk-GARRF3U7.mjs → chunk-TMZRZLA2.mjs} +3 -3
- package/dist/chunk-TMZRZLA2.mjs.map +1 -0
- package/dist/{chunk-L7JZMM3J.mjs → chunk-U53FLD4J.mjs} +4 -4
- package/dist/chunk-U53FLD4J.mjs.map +1 -0
- package/dist/{chunk-EB26LF5Z.mjs → chunk-UJEQAXZI.mjs} +4 -4
- package/dist/chunk-UJEQAXZI.mjs.map +1 -0
- package/dist/{chunk-ELFAMVTF.mjs → chunk-UKHDSTTZ.mjs} +5 -5
- package/dist/chunk-UKHDSTTZ.mjs.map +1 -0
- package/dist/chunk-UNHWYQ54.mjs +64 -0
- package/dist/chunk-UNHWYQ54.mjs.map +1 -0
- package/dist/chunk-USGZFNWP.mjs +34 -0
- package/dist/chunk-USGZFNWP.mjs.map +1 -0
- package/dist/{chunk-Y5WPU3ZU.mjs → chunk-UW6S2PNO.mjs} +12 -6
- package/dist/chunk-UW6S2PNO.mjs.map +1 -0
- package/dist/chunk-UYDZZAEK.mjs +11 -0
- package/dist/chunk-UYDZZAEK.mjs.map +1 -0
- package/dist/{chunk-GJFFYHHX.mjs → chunk-VV534JNS.mjs} +5 -3
- package/dist/chunk-VV534JNS.mjs.map +1 -0
- package/dist/{chunk-V7FP66LM.mjs → chunk-WJZFE5NE.mjs} +2 -2
- package/dist/chunk-WJZFE5NE.mjs.map +1 -0
- package/dist/{chunk-ZELLSP3E.mjs → chunk-X7FZPY3P.mjs} +6 -4
- package/dist/{chunk-ZELLSP3E.mjs.map → chunk-X7FZPY3P.mjs.map} +1 -1
- package/dist/{chunk-Q6RSBDMM.mjs → chunk-XBYDAQGZ.mjs} +2 -2
- package/dist/chunk-XBYDAQGZ.mjs.map +1 -0
- package/dist/{chunk-ZJKVMRGU.mjs → chunk-YSBACFUR.mjs} +5 -5
- package/dist/chunk-YSBACFUR.mjs.map +1 -0
- package/dist/chunk-ZHXKBOK2.mjs +22 -0
- package/dist/chunk-ZHXKBOK2.mjs.map +1 -0
- package/dist/chunk-ZPNFXK7Y.mjs +36 -0
- package/dist/chunk-ZPNFXK7Y.mjs.map +1 -0
- package/dist/data/Condition.d.ts +3 -2
- package/dist/data/Condition.mjs +12 -8
- package/dist/data/Database.d.ts +2 -1
- package/dist/data/Database.mjs +12 -7
- package/dist/data/Field.d.ts +1 -1
- package/dist/data/Field.mjs +15 -11
- package/dist/data/Field.mjs.map +1 -1
- package/dist/data/InMemoryGateway.d.ts +5 -1
- package/dist/data/InMemoryGateway.mjs +25 -10
- package/dist/data/InMemoryGateway.mjs.map +1 -1
- package/dist/data/Query.d.ts +1 -1
- package/dist/data/QueryProvider.d.ts +2 -1
- package/dist/domain/Audit.d.ts +3 -2
- package/dist/domain/Audit.mjs +25 -10
- package/dist/domain/Child.d.ts +2 -1
- package/dist/domain/Child.mjs +25 -10
- package/dist/domain/Child.mjs.map +1 -1
- package/dist/domain/{values/DateTime.d.ts → DateTime.d.ts} +3 -1
- package/dist/domain/DateTime.mjs +35 -0
- package/dist/domain/Entity.d.ts +2 -1
- package/dist/domain/Entity.mjs +27 -12
- package/dist/domain/Entity.mjs.map +1 -1
- package/dist/domain/Repo.d.ts +7 -1
- package/dist/domain/Repo.mjs +31 -12
- package/dist/domain/Repo.mjs.map +1 -1
- package/dist/domain/Struct.d.ts +2 -1
- package/dist/domain/Struct.mjs +22 -7
- package/dist/domain/Typo.d.ts +7 -2
- package/dist/domain/Typo.mjs +23 -8
- package/dist/domain/Typo.mjs.map +1 -1
- package/dist/health/HealthResource.d.ts +2 -2
- package/dist/health/HealthResource.mjs +30 -16
- package/dist/health/HealthResource.mjs.map +1 -1
- package/dist/health/HealthUri.d.ts +2 -2
- package/dist/health/HealthUri.mjs +22 -8
- package/dist/http/CacheControl.d.ts +1 -1
- package/dist/http/CacheControl.mjs +23 -9
- package/dist/http/ContentType.d.ts +2 -1
- package/dist/http/ContentType.mjs +12 -7
- package/dist/http/HttpStatus.d.ts +3 -1
- package/dist/http/HttpStatus.mjs +12 -7
- package/dist/http/HttpVerb.d.ts +1 -1
- package/dist/http/HttpVerb.mjs +12 -7
- package/dist/http/LocalRequestStore.d.ts +2 -1
- package/dist/http/LocalRequestStore.mjs +12 -6
- package/dist/http/LocalRequestStore.mjs.map +1 -1
- package/dist/http/OriginatedError.d.ts +1 -1
- package/dist/http/OriginatedError.mjs +1 -2
- package/dist/http/OriginatedError.mjs.map +1 -1
- package/dist/http/Request.d.ts +1 -1
- package/dist/http/RequestOptions.d.ts +6 -1
- package/dist/http/RequestOptions.mjs +16 -9
- package/dist/http/Response.d.ts +2 -5
- package/dist/http/Response.mjs +7 -13
- package/dist/http/RestResult.d.ts +3 -1
- package/dist/http/RestResult.mjs +23 -8
- package/dist/http/Verb.d.ts +4 -1
- package/dist/http/Verb.mjs +27 -13
- package/dist/http/toResponse.d.ts +6 -0
- package/dist/http/toResponse.mjs +33 -0
- package/dist/index.d.ts +118 -12
- package/dist/index.js +1645 -2904
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +118 -12
- package/dist/index.mjs.map +1 -1
- package/dist/process/App.mjs +13 -7
- package/dist/process/App.mjs.map +1 -1
- package/dist/process/Manage.d.ts +3 -1
- package/dist/process/Manage.mjs +22 -8
- package/dist/process/Manage.mjs.map +1 -1
- package/dist/process/Scope.d.ts +4 -1
- package/dist/process/Scope.mjs +13 -7
- package/dist/process/Search.d.ts +7 -2
- package/dist/process/Search.mjs +22 -8
- package/dist/process/UseCase.d.ts +4 -1
- package/dist/process/UseCase.mjs +19 -10
- package/dist/process/UseCase.mjs.map +1 -1
- package/dist/resources/AppProvider.d.ts +1 -1
- package/dist/resources/Req.d.ts +6 -1
- package/dist/resources/Req.mjs +21 -7
- package/dist/resources/Req.mjs.map +1 -1
- package/dist/resources/Requires.d.ts +2 -1
- package/dist/resources/Requires.mjs +10 -6
- package/dist/resources/Requires.mjs.map +1 -1
- package/dist/resources/Route.d.ts +5 -3
- package/dist/resources/Route.mjs +21 -7
- package/dist/resources/Service.d.ts +3 -1
- package/dist/resources/Service.mjs +24 -8
- package/dist/resources/Service.mjs.map +1 -1
- package/dist/security/Jwt.d.ts +5 -1
- package/dist/security/Jwt.mjs +24 -8
- package/dist/security/Jwt.mjs.map +1 -1
- package/dist/services/Api.d.ts +8 -2
- package/dist/services/Api.mjs +32 -16
- package/dist/services/ApiGateway.d.ts +6 -2
- package/dist/services/ApiGateway.mjs +35 -19
- package/dist/services/AxiosProvider.d.ts +3 -1
- package/dist/services/AxiosProvider.mjs +30 -14
- package/dist/services/MappedRouteGateway.d.ts +7 -3
- package/dist/services/MappedRouteGateway.mjs +41 -24
- package/dist/services/MappedRouteGateway.mjs.map +1 -1
- package/dist/services/RouteGateway.d.ts +7 -1
- package/dist/services/RouteGateway.mjs +36 -20
- package/dist/services/ViewRouteGateway.d.ts +10 -6
- package/dist/services/ViewRouteGateway.mjs +39 -22
- package/dist/services/ViewRouteGateway.mjs.map +1 -1
- package/dist/sql/Clause.d.ts +3 -2
- package/dist/sql/Clause.mjs +7 -8
- package/dist/sql/Column.d.ts +3 -2
- package/dist/sql/Column.mjs +24 -10
- package/dist/sql/Count.mjs +11 -9
- package/dist/sql/Delete.mjs +10 -8
- package/dist/sql/Insert.d.ts +1 -1
- package/dist/sql/Insert.mjs +12 -10
- package/dist/sql/Select.d.ts +1 -1
- package/dist/sql/Select.mjs +10 -8
- package/dist/sql/SqlQuery.d.ts +5 -2
- package/dist/sql/SqlQuery.mjs +9 -7
- package/dist/sql/Table.d.ts +13 -12
- package/dist/sql/Table.mjs +37 -22
- package/dist/sql/Table.mjs.map +1 -1
- package/dist/sql/TableGateway.d.ts +6 -2
- package/dist/sql/TableGateway.mjs +23 -9
- package/dist/sql/TableGateway.mjs.map +1 -1
- package/dist/sql/Update.d.ts +1 -1
- package/dist/sql/Update.mjs +12 -10
- package/dist/types/Array.mjs +4 -2
- package/dist/types/Builder.mjs +2 -6
- package/dist/types/Builder.mjs.map +1 -1
- package/dist/types/Cache.mjs +10 -6
- package/dist/types/Cache.mjs.map +1 -1
- package/dist/types/CacheAge.mjs +22 -8
- package/dist/types/Case.d.ts +3 -1
- package/dist/types/Case.mjs +20 -6
- package/dist/types/Constructor.d.ts +1 -0
- package/dist/types/Constructor.mjs +5 -1
- package/dist/types/Context.mjs +12 -6
- package/dist/types/Enum.mjs +11 -6
- package/dist/{domain/enums → types}/Environment.d.ts +1 -1
- package/dist/types/Environment.mjs +28 -0
- package/dist/types/Environment.mjs.map +1 -0
- package/dist/types/ErrorOrigin.d.ts +1 -1
- package/dist/types/Exception.mjs +13 -6
- package/dist/types/Gateway.mjs +15 -7
- package/dist/types/Id.mjs +3 -4
- package/dist/types/Is.d.ts +0 -4
- package/dist/types/Is.mjs +1 -6
- package/dist/types/IsA.d.ts +2 -0
- package/dist/types/IsA.mjs +8 -4
- package/dist/types/IsEqual.mjs +21 -7
- package/dist/types/Json.mjs +10 -6
- package/dist/types/List.d.ts +3 -3
- package/dist/types/List.mjs +8 -6
- package/dist/types/Meta.d.ts +1 -2
- package/dist/types/Meta.mjs +10 -8
- package/dist/types/Number.mjs +21 -7
- package/dist/types/Object.d.ts +8 -0
- package/dist/types/Object.mjs +20 -0
- package/dist/types/PageList.mjs +21 -7
- package/dist/types/Parser.mjs +25 -10
- package/dist/types/Parser.mjs.map +1 -1
- package/dist/types/Primitive.mjs +2 -2
- package/dist/types/Repository.d.ts +5 -1
- package/dist/types/Repository.mjs +15 -7
- package/dist/types/Result.mjs +13 -6
- package/dist/types/Results.mjs +14 -6
- package/dist/types/Tag.mjs +10 -6
- package/dist/types/Tag.mjs.map +1 -1
- package/dist/types/Template.d.ts +41 -2
- package/dist/types/Template.mjs +19 -8
- package/dist/types/Text.d.ts +0 -38
- package/dist/types/Text.mjs +2 -10
- package/dist/types/Try.mjs +20 -6
- package/dist/types/Uri.mjs +21 -7
- package/dist/types/Uuid.mjs +2 -3
- package/dist/types/Validatable.mjs +5 -3
- package/dist/types/Value.d.ts +2 -1
- package/dist/types/Value.mjs +3 -6
- package/dist/utils/Base64.d.ts +1 -1
- package/dist/utils/Base64.mjs.map +1 -1
- package/dist/utils/Convert.mjs +3 -7
- package/dist/utils/If.d.ts +2 -1
- package/dist/utils/If.mjs +4 -2
- package/dist/utils/Loading.mjs +1 -2
- package/dist/utils/Loading.mjs.map +1 -1
- package/dist/utils/Log.d.ts +1 -1
- package/dist/utils/Log.mjs.map +1 -1
- package/dist/utils/Mapper.d.ts +6 -1
- package/dist/utils/Mapper.mjs +15 -10
- package/dist/utils/Promise.d.ts +2 -1
- package/dist/utils/Promise.mjs +9 -6
- package/dist/utils/Property.d.ts +2 -1
- package/dist/utils/Property.mjs +4 -8
- package/dist/utils/Sentence.d.ts +2 -1
- package/dist/utils/Sentence.mjs +11 -6
- package/dist/utils/Sentence.mjs.map +1 -1
- package/dist/utils/State.d.ts +1 -1
- package/dist/utils/State.mjs +4 -2
- package/dist/utils/View.d.ts +6 -1
- package/dist/utils/View.mjs +24 -9
- package/dist/validation/Contraints.d.ts +3 -1
- package/dist/validation/Contraints.mjs +21 -7
- package/dist/validation/Validate.d.ts +3 -1
- package/dist/validation/Validate.mjs +20 -6
- package/dist/validation/When.d.ts +4 -1
- package/dist/validation/When.mjs +20 -6
- package/package.json +57 -2
- package/src/data/Condition.ts +17 -5
- package/src/data/Database.ts +7 -2
- package/src/data/Field.ts +3 -2
- package/src/data/InMemoryGateway.ts +8 -2
- package/src/data/Query.ts +1 -1
- package/src/data/QueryProvider.ts +2 -1
- package/src/domain/Audit.ts +11 -7
- package/src/domain/Child.ts +3 -2
- package/src/domain/{values/DateTime.ts → DateTime.ts} +8 -2
- package/src/domain/Entity.ts +3 -2
- package/src/domain/Repo.ts +15 -4
- package/src/domain/Struct.ts +4 -2
- package/src/domain/Typo.ts +13 -4
- package/src/health/HealthResource.ts +5 -3
- package/src/health/HealthUri.ts +1 -1
- package/src/http/CacheControl.ts +9 -3
- package/src/http/ContentType.ts +8 -2
- package/src/http/HttpStatus.ts +4 -1
- package/src/http/HttpVerb.ts +1 -1
- package/src/http/LocalRequestStore.ts +3 -1
- package/src/http/OriginatedError.ts +6 -2
- package/src/http/Request.ts +1 -1
- package/src/http/RequestOptions.ts +16 -2
- package/src/http/Response.ts +4 -9
- package/src/http/RestResult.ts +7 -1
- package/src/http/Verb.ts +5 -2
- package/src/http/toResponse.ts +12 -0
- package/src/index.ts +129 -12
- package/src/process/Manage.ts +3 -1
- package/src/process/Scope.ts +12 -2
- package/src/process/Search.ts +9 -3
- package/src/process/UseCase.ts +12 -2
- package/src/resources/AppProvider.ts +1 -1
- package/src/resources/Req.ts +14 -3
- package/src/resources/Requires.ts +3 -2
- package/src/resources/Route.ts +8 -3
- package/src/resources/Service.ts +9 -2
- package/src/security/Jwt.ts +7 -1
- package/src/services/Api.ts +12 -3
- package/src/services/ApiGateway.ts +7 -2
- package/src/services/AxiosProvider.ts +14 -2
- package/src/services/MappedRouteGateway.ts +13 -4
- package/src/services/RouteGateway.ts +14 -3
- package/src/services/ViewRouteGateway.ts +7 -3
- package/src/sql/Clause.ts +10 -3
- package/src/sql/Column.ts +14 -4
- package/src/sql/Count.ts +1 -1
- package/src/sql/Delete.ts +1 -1
- package/src/sql/Insert.ts +5 -2
- package/src/sql/Select.ts +6 -2
- package/src/sql/SqlQuery.ts +9 -3
- package/src/sql/Table.ts +6 -3
- package/src/sql/TableGateway.ts +13 -5
- package/src/sql/Update.ts +6 -2
- package/src/types/CacheAge.ts +3 -1
- package/src/types/Case.ts +14 -4
- package/src/types/Constructor.ts +3 -1
- package/src/types/Context.ts +7 -8
- package/src/{domain/enums → types}/Environment.ts +1 -1
- package/src/types/ErrorOrigin.ts +1 -1
- package/src/types/Exception.ts +7 -2
- package/src/types/Gateway.ts +1 -1
- package/src/types/Is.ts +0 -7
- package/src/types/IsA.ts +4 -0
- package/src/types/Json.ts +2 -2
- package/src/types/List.ts +13 -12
- package/src/types/Meta.ts +12 -9
- package/src/types/Object.ts +16 -0
- package/src/types/Parser.ts +1 -1
- package/src/types/Repository.ts +7 -2
- package/src/types/Template.ts +149 -12
- package/src/types/Text.ts +3 -138
- package/src/types/Try.ts +1 -1
- package/src/types/Uri.ts +2 -1
- package/src/types/Value.ts +4 -1
- package/src/utils/Base64.ts +1 -1
- package/src/utils/Convert.ts +5 -2
- package/src/utils/If.ts +3 -1
- package/src/utils/Loading.ts +1 -1
- package/src/utils/Log.ts +1 -1
- package/src/utils/Mapper.ts +13 -2
- package/src/utils/Promise.ts +3 -1
- package/src/utils/Property.ts +6 -2
- package/src/utils/Sentence.ts +8 -2
- package/src/utils/State.ts +1 -1
- package/src/utils/View.ts +15 -22
- package/src/validation/Contraints.ts +9 -1
- package/src/validation/Validate.ts +26 -29
- package/src/validation/When.ts +13 -3
- package/dist/chunk-2L3GZ6NK.mjs.map +0 -1
- package/dist/chunk-3MOFYE2N.mjs.map +0 -1
- package/dist/chunk-5J3LAY32.mjs.map +0 -1
- package/dist/chunk-624IHTEI.mjs.map +0 -1
- package/dist/chunk-65W3AYRE.mjs.map +0 -1
- package/dist/chunk-7Z3YQCXR.mjs.map +0 -1
- package/dist/chunk-A5MC57TL.mjs.map +0 -1
- package/dist/chunk-ARN4MTMY.mjs.map +0 -1
- package/dist/chunk-BAXNN36F.mjs.map +0 -1
- package/dist/chunk-C7OPGGIF.mjs +0 -21
- package/dist/chunk-C7OPGGIF.mjs.map +0 -1
- package/dist/chunk-CJDDGEEK.mjs.map +0 -1
- package/dist/chunk-EB26LF5Z.mjs.map +0 -1
- package/dist/chunk-ELFAMVTF.mjs.map +0 -1
- package/dist/chunk-F4CWMZCV.mjs.map +0 -1
- package/dist/chunk-GARRF3U7.mjs.map +0 -1
- package/dist/chunk-GJFFYHHX.mjs.map +0 -1
- package/dist/chunk-GUSPHVF2.mjs.map +0 -1
- package/dist/chunk-H7NDGISC.mjs.map +0 -1
- package/dist/chunk-HBJUEFGA.mjs +0 -26
- package/dist/chunk-HBJUEFGA.mjs.map +0 -1
- package/dist/chunk-I2NKUYUM.mjs +0 -272
- package/dist/chunk-I2NKUYUM.mjs.map +0 -1
- package/dist/chunk-I3DRDMCS.mjs.map +0 -1
- package/dist/chunk-I5MPU33B.mjs.map +0 -1
- package/dist/chunk-IWLJEAQZ.mjs.map +0 -1
- package/dist/chunk-J64VE55O.mjs.map +0 -1
- package/dist/chunk-L7JZMM3J.mjs.map +0 -1
- package/dist/chunk-MRIELSWP.mjs.map +0 -1
- package/dist/chunk-NKHZO3ME.mjs.map +0 -1
- package/dist/chunk-NOMZAVQC.mjs.map +0 -1
- package/dist/chunk-PFAEQQXA.mjs +0 -900
- package/dist/chunk-PFAEQQXA.mjs.map +0 -1
- package/dist/chunk-PWCGCUT7.mjs.map +0 -1
- package/dist/chunk-Q5ATL34D.mjs +0 -13
- package/dist/chunk-Q5ATL34D.mjs.map +0 -1
- package/dist/chunk-Q6RSBDMM.mjs.map +0 -1
- package/dist/chunk-QRLGQY7M.mjs.map +0 -1
- package/dist/chunk-QRN4Y2QC.mjs.map +0 -1
- package/dist/chunk-S5RHU67S.mjs.map +0 -1
- package/dist/chunk-SG6BDC6T.mjs.map +0 -1
- package/dist/chunk-TG5IPJOG.mjs.map +0 -1
- package/dist/chunk-TQUDYF6E.mjs.map +0 -1
- package/dist/chunk-UWNXWKBU.mjs.map +0 -1
- package/dist/chunk-V7FP66LM.mjs.map +0 -1
- package/dist/chunk-WX6UP67J.mjs +0 -40
- package/dist/chunk-WX6UP67J.mjs.map +0 -1
- package/dist/chunk-WYT52YAX.mjs.map +0 -1
- package/dist/chunk-XLFC44Y3.mjs.map +0 -1
- package/dist/chunk-Y5WPU3ZU.mjs.map +0 -1
- package/dist/chunk-YHL2CUBI.mjs.map +0 -1
- package/dist/chunk-YUSOGMIJ.mjs +0 -183
- package/dist/chunk-YUSOGMIJ.mjs.map +0 -1
- package/dist/chunk-YXE66GAL.mjs +0 -19
- package/dist/chunk-YXE66GAL.mjs.map +0 -1
- package/dist/chunk-ZJKVMRGU.mjs.map +0 -1
- package/dist/data/index.d.ts +0 -7
- package/dist/data/index.mjs +0 -8
- package/dist/data/index.mjs.map +0 -1
- package/dist/domain/enums/Country.d.ts +0 -256
- package/dist/domain/enums/Country.mjs +0 -16
- package/dist/domain/enums/Currency.d.ts +0 -127
- package/dist/domain/enums/Currency.mjs +0 -19
- package/dist/domain/enums/Environment.mjs +0 -23
- package/dist/domain/enums/Environment.mjs.map +0 -1
- package/dist/domain/enums/Locale.d.ts +0 -571
- package/dist/domain/enums/Locale.mjs +0 -594
- package/dist/domain/enums/Locale.mjs.map +0 -1
- package/dist/domain/enums/UnitOfMeasurement.d.ts +0 -10
- package/dist/domain/enums/UnitOfMeasurement.mjs +0 -16
- package/dist/domain/enums/UnitOfMeasurement.mjs.map +0 -1
- package/dist/domain/enums/UnitOfWeight.d.ts +0 -8
- package/dist/domain/enums/UnitOfWeight.mjs +0 -16
- package/dist/domain/enums/UnitOfWeight.mjs.map +0 -1
- package/dist/domain/enums/index.d.ts +0 -6
- package/dist/domain/enums/index.mjs +0 -7
- package/dist/domain/enums/index.mjs.map +0 -1
- package/dist/domain/index.d.ts +0 -9
- package/dist/domain/index.mjs +0 -10
- package/dist/domain/index.mjs.map +0 -1
- package/dist/domain/structs/Address.d.ts +0 -12
- package/dist/domain/structs/Address.mjs +0 -65
- package/dist/domain/structs/Address.mjs.map +0 -1
- package/dist/domain/structs/Box.d.ts +0 -15
- package/dist/domain/structs/Box.mjs +0 -58
- package/dist/domain/structs/Box.mjs.map +0 -1
- package/dist/domain/structs/Dimension.d.ts +0 -10
- package/dist/domain/structs/Dimension.mjs +0 -20
- package/dist/domain/structs/Dimension.mjs.map +0 -1
- package/dist/domain/structs/Money.d.ts +0 -12
- package/dist/domain/structs/Money.mjs +0 -23
- package/dist/domain/structs/Money.mjs.map +0 -1
- package/dist/domain/structs/Name.d.ts +0 -9
- package/dist/domain/structs/Name.mjs +0 -42
- package/dist/domain/structs/Name.mjs.map +0 -1
- package/dist/domain/structs/Weight.d.ts +0 -13
- package/dist/domain/structs/Weight.mjs +0 -57
- package/dist/domain/structs/Weight.mjs.map +0 -1
- package/dist/domain/structs/index.d.ts +0 -6
- package/dist/domain/structs/index.mjs +0 -7
- package/dist/domain/structs/index.mjs.map +0 -1
- package/dist/domain/values/DateTime.mjs +0 -21
- package/dist/domain/values/EAN.d.ts +0 -5
- package/dist/domain/values/EAN.mjs +0 -30
- package/dist/domain/values/EAN.mjs.map +0 -1
- package/dist/domain/values/Email.d.ts +0 -8
- package/dist/domain/values/Email.mjs +0 -37
- package/dist/domain/values/Email.mjs.map +0 -1
- package/dist/domain/values/IBAN.d.ts +0 -5
- package/dist/domain/values/IBAN.mjs +0 -30
- package/dist/domain/values/IBAN.mjs.map +0 -1
- package/dist/domain/values/PostalCode.d.ts +0 -8
- package/dist/domain/values/PostalCode.mjs +0 -19
- package/dist/domain/values/PostalCode.mjs.map +0 -1
- package/dist/domain/values/Slug.d.ts +0 -6
- package/dist/domain/values/Slug.mjs +0 -31
- package/dist/domain/values/Slug.mjs.map +0 -1
- package/dist/domain/values/Url.d.ts +0 -22
- package/dist/domain/values/Url.mjs +0 -36
- package/dist/domain/values/Url.mjs.map +0 -1
- package/dist/domain/values/index.d.ts +0 -7
- package/dist/domain/values/index.mjs +0 -8
- package/dist/domain/values/index.mjs.map +0 -1
- package/dist/health/index.d.ts +0 -2
- package/dist/health/index.mjs +0 -3
- package/dist/health/index.mjs.map +0 -1
- package/dist/http/index.d.ts +0 -12
- package/dist/http/index.mjs +0 -13
- package/dist/http/index.mjs.map +0 -1
- package/dist/process/index.d.ts +0 -5
- package/dist/process/index.mjs +0 -6
- package/dist/process/index.mjs.map +0 -1
- package/dist/resources/index.d.ts +0 -7
- package/dist/resources/index.mjs +0 -8
- package/dist/resources/index.mjs.map +0 -1
- package/dist/security/index.d.ts +0 -1
- package/dist/security/index.mjs +0 -2
- package/dist/security/index.mjs.map +0 -1
- package/dist/services/index.d.ts +0 -6
- package/dist/services/index.mjs +0 -7
- package/dist/services/index.mjs.map +0 -1
- package/dist/sql/index.d.ts +0 -10
- package/dist/sql/index.mjs +0 -11
- package/dist/sql/index.mjs.map +0 -1
- package/dist/types/index.d.ts +0 -43
- package/dist/types/index.mjs +0 -44
- package/dist/types/index.mjs.map +0 -1
- package/dist/utils/index.d.ts +0 -13
- package/dist/utils/index.mjs +0 -14
- package/dist/utils/index.mjs.map +0 -1
- package/dist/validation/index.d.ts +0 -3
- package/dist/validation/index.mjs +0 -4
- package/dist/validation/index.mjs.map +0 -1
- package/src/data/index.ts +0 -7
- package/src/domain/enums/Country.ts +0 -265
- package/src/domain/enums/Currency.ts +0 -133
- package/src/domain/enums/Locale.ts +0 -579
- package/src/domain/enums/UnitOfMeasurement.ts +0 -13
- package/src/domain/enums/UnitOfWeight.ts +0 -11
- package/src/domain/enums/countries.json +0 -251
- package/src/domain/enums/currencies.json +0 -1073
- package/src/domain/enums/index.ts +0 -6
- package/src/domain/enums/locales.json +0 -565
- package/src/domain/index.ts +0 -9
- package/src/domain/structs/Address.ts +0 -22
- package/src/domain/structs/Box.ts +0 -29
- package/src/domain/structs/Dimension.ts +0 -25
- package/src/domain/structs/Money.ts +0 -31
- package/src/domain/structs/Name.ts +0 -15
- package/src/domain/structs/Weight.ts +0 -35
- package/src/domain/structs/index.ts +0 -6
- package/src/domain/values/EAN.ts +0 -12
- package/src/domain/values/Email.ts +0 -20
- package/src/domain/values/IBAN.ts +0 -12
- package/src/domain/values/PostalCode.ts +0 -17
- package/src/domain/values/Slug.ts +0 -14
- package/src/domain/values/Url.ts +0 -73
- package/src/domain/values/index.ts +0 -7
- package/src/health/index.ts +0 -2
- package/src/http/index.ts +0 -12
- package/src/process/index.ts +0 -5
- package/src/resources/index.ts +0 -7
- package/src/security/index.ts +0 -1
- package/src/services/index.ts +0 -6
- package/src/sql/index.ts +0 -10
- package/src/types/index.ts +0 -43
- package/src/utils/index.ts +0 -13
- package/src/validation/index.ts +0 -3
- /package/dist/{chunk-GCPVSACZ.mjs.map → chunk-5YM5CLOG.mjs.map} +0 -0
- /package/dist/{chunk-2KKIXOMB.mjs.map → chunk-HNVAFEZP.mjs.map} +0 -0
- /package/dist/{chunk-OXVJLJIE.mjs.map → chunk-LXQQ5N6S.mjs.map} +0 -0
- /package/dist/{chunk-4ROYPQPC.mjs.map → chunk-OFGI5FLG.mjs.map} +0 -0
- /package/dist/domain/{values/DateTime.mjs.map → DateTime.mjs.map} +0 -0
- /package/dist/{domain/enums/Country.mjs.map → http/toResponse.mjs.map} +0 -0
- /package/dist/{domain/enums/Currency.mjs.map → types/Object.mjs.map} +0 -0
package/src/sql/Clause.ts
CHANGED
|
@@ -1,10 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { convert, Convert } from '../utils';
|
|
1
|
+
import { isBoolean, isNumber } from '../types/Is';
|
|
2
|
+
import { convert, Convert } from '../utils/Convert';
|
|
3
|
+
import { TypeGuard } from '../types/TypeGuard';
|
|
4
|
+
import { isA } from '../types/IsA';
|
|
5
|
+
import type { Text } from '../types/Text';
|
|
3
6
|
|
|
4
7
|
export const quote = (a: unknown): string => (isNumber(a) || isBoolean(a) || isClause(a) ? a.toString() : `'${a as string}'`);
|
|
5
8
|
|
|
6
9
|
export class Clause implements Text {
|
|
7
|
-
constructor(
|
|
10
|
+
constructor(
|
|
11
|
+
readonly first: unknown,
|
|
12
|
+
readonly operator: string,
|
|
13
|
+
readonly second: unknown
|
|
14
|
+
) {}
|
|
8
15
|
|
|
9
16
|
and = (other: Clause): Clause => new ParathesizedClause(this, 'AND', other);
|
|
10
17
|
or = (other: Clause): Clause => new ParathesizedClause(this, 'OR', other);
|
package/src/sql/Column.ts
CHANGED
|
@@ -1,10 +1,17 @@
|
|
|
1
|
-
import { Property, PropertyOptions } from '../utils';
|
|
2
1
|
import { Clause, toClause } from './Clause';
|
|
3
|
-
import { Json, JsonValue, ofGet, Text, tryTo } from '../types';
|
|
4
2
|
import { Table } from './Table';
|
|
3
|
+
import { Property, PropertyOptions } from '../utils/Property';
|
|
4
|
+
import { Json, JsonValue } from '../types/Json';
|
|
5
|
+
import { tryTo } from '../types/Try';
|
|
6
|
+
import { ofGet } from '../types/Get';
|
|
7
|
+
import type { Text } from '../types/Text';
|
|
5
8
|
|
|
6
9
|
export class Column extends Property implements Text {
|
|
7
|
-
constructor(
|
|
10
|
+
constructor(
|
|
11
|
+
readonly owner: Table,
|
|
12
|
+
property: string,
|
|
13
|
+
options?: PropertyOptions
|
|
14
|
+
) {
|
|
8
15
|
super(property, options);
|
|
9
16
|
}
|
|
10
17
|
|
|
@@ -85,7 +92,10 @@ export class Column extends Property implements Text {
|
|
|
85
92
|
}
|
|
86
93
|
|
|
87
94
|
export class PatternColumn extends Column {
|
|
88
|
-
constructor(
|
|
95
|
+
constructor(
|
|
96
|
+
protected col: Column,
|
|
97
|
+
protected pattern: string
|
|
98
|
+
) {
|
|
89
99
|
super(col.owner, col.property);
|
|
90
100
|
}
|
|
91
101
|
|
package/src/sql/Count.ts
CHANGED
package/src/sql/Delete.ts
CHANGED
package/src/sql/Insert.ts
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { SqlQuery } from './SqlQuery';
|
|
2
|
-
import { Json } from '../types';
|
|
3
2
|
import { quote } from './Clause';
|
|
4
3
|
import { Table } from './Table';
|
|
4
|
+
import { Json } from '../types/Json';
|
|
5
5
|
|
|
6
6
|
export class Insert extends SqlQuery {
|
|
7
|
-
constructor(
|
|
7
|
+
constructor(
|
|
8
|
+
protected table: Table,
|
|
9
|
+
protected fields: Json
|
|
10
|
+
) {
|
|
8
11
|
super(table);
|
|
9
12
|
}
|
|
10
13
|
|
package/src/sql/Select.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { ifGet, List, toList } from '../types';
|
|
2
1
|
import { Column, OrderColumn } from './Column';
|
|
3
2
|
import { Join } from './Join';
|
|
4
3
|
import { SqlQuery } from './SqlQuery';
|
|
5
4
|
import { Table } from './Table';
|
|
5
|
+
import { List, toList } from '../types/List';
|
|
6
|
+
import { ifGet } from '../types/Get';
|
|
6
7
|
|
|
7
8
|
export class Select extends SqlQuery {
|
|
8
9
|
protected ordered: List<OrderColumn> = toList();
|
|
@@ -11,7 +12,10 @@ export class Select extends SqlQuery {
|
|
|
11
12
|
protected _limit = 0;
|
|
12
13
|
protected _offset = 0;
|
|
13
14
|
|
|
14
|
-
constructor(
|
|
15
|
+
constructor(
|
|
16
|
+
table: Table | Join,
|
|
17
|
+
readonly columns: List<Column> = toList()
|
|
18
|
+
) {
|
|
15
19
|
super(table);
|
|
16
20
|
}
|
|
17
21
|
|
package/src/sql/SqlQuery.ts
CHANGED
|
@@ -1,8 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Query } from '../data/Query';
|
|
2
|
+
import { Table } from './Table';
|
|
3
|
+
import { Join } from './Join';
|
|
4
|
+
import { List, toList } from '../types/List';
|
|
5
|
+
import { Clause } from './Clause';
|
|
3
6
|
|
|
4
7
|
export class SqlQuery implements Query {
|
|
5
|
-
constructor(
|
|
8
|
+
constructor(
|
|
9
|
+
protected table: Table | Join,
|
|
10
|
+
readonly clauses: List<Clause> = toList()
|
|
11
|
+
) {}
|
|
6
12
|
|
|
7
13
|
where = (...clauses: Clause[]): this => {
|
|
8
14
|
this.clauses.add(clauses);
|
package/src/sql/Table.ts
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import { Column } from './Column';
|
|
2
|
-
import { MapOptions, Mapper, mappings, PropertyOptions } from '../utils';
|
|
3
|
-
import { Database } from '../data';
|
|
4
|
-
import { Json, toList, toUuid } from '../types';
|
|
5
2
|
import { Select } from './Select';
|
|
6
3
|
import { Insert } from './Insert';
|
|
7
4
|
import { Update } from './Update';
|
|
8
5
|
import { Delete } from './Delete';
|
|
9
6
|
import { Join } from './Join';
|
|
10
7
|
import { Count } from './Count';
|
|
8
|
+
import { MapOptions, Mapper, mappings } from '../utils/Mapper';
|
|
9
|
+
import { PropertyOptions } from '../utils/Property';
|
|
10
|
+
import { toUuid } from '../types/Uuid';
|
|
11
|
+
import { Database } from '../data/Database';
|
|
12
|
+
import { toList } from '../types/List';
|
|
13
|
+
import { Json } from '../types/Json';
|
|
11
14
|
|
|
12
15
|
export class Table extends Mapper {
|
|
13
16
|
protected readonly map = {
|
package/src/sql/TableGateway.ts
CHANGED
|
@@ -1,13 +1,21 @@
|
|
|
1
|
-
import { Gateway, Id, isDefined, Json, Optional, PageList, PageOptions, toPageList } from '../types';
|
|
2
|
-
import { QueryProvider } from '../data';
|
|
3
|
-
import { when } from '../validation';
|
|
4
|
-
import { ifDefined } from '../utils';
|
|
5
1
|
import { Table } from './Table';
|
|
2
|
+
import { PageList, PageOptions, toPageList } from '../types/PageList';
|
|
3
|
+
import { QueryProvider } from '../data/QueryProvider';
|
|
4
|
+
import { Gateway } from '../types/Gateway';
|
|
5
|
+
import { Json } from '../types/Json';
|
|
6
|
+
import { Id } from '../types/Id';
|
|
7
|
+
import { Optional } from '../types/Types';
|
|
8
|
+
import { ifDefined } from '../utils/If';
|
|
9
|
+
import { isDefined } from '../types/Is';
|
|
10
|
+
import { when } from '../validation/When';
|
|
6
11
|
|
|
7
12
|
export type TableOptions = PageOptions & { provider?: QueryProvider };
|
|
8
13
|
|
|
9
14
|
export class TableGateway<T extends Table> extends Gateway<PageOptions> {
|
|
10
|
-
constructor(
|
|
15
|
+
constructor(
|
|
16
|
+
readonly table: T,
|
|
17
|
+
readonly provider = table.db.provide<QueryProvider>()
|
|
18
|
+
) {
|
|
11
19
|
super();
|
|
12
20
|
}
|
|
13
21
|
|
package/src/sql/Update.ts
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import { SqlQuery } from './SqlQuery';
|
|
2
|
-
import { ifGet, Json } from '../types';
|
|
3
2
|
import { toClause } from './Clause';
|
|
4
3
|
import { Table } from './Table';
|
|
4
|
+
import { Json } from '../types/Json';
|
|
5
|
+
import { ifGet } from '../types/Get';
|
|
5
6
|
|
|
6
7
|
export class Update extends SqlQuery {
|
|
7
|
-
constructor(
|
|
8
|
+
constructor(
|
|
9
|
+
protected table: Table,
|
|
10
|
+
protected fields: Json
|
|
11
|
+
) {
|
|
8
12
|
super(table);
|
|
9
13
|
}
|
|
10
14
|
|
package/src/types/CacheAge.ts
CHANGED
package/src/types/Case.ts
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Get, ofGet, Predicate } from './Get';
|
|
2
|
+
import { TypeGuard } from './TypeGuard';
|
|
3
|
+
import { Func } from './Func';
|
|
4
|
+
import { isDefined, isEmpty } from './Is';
|
|
5
|
+
import { validate } from '../validation/Validate';
|
|
6
|
+
import { tryTo } from './Try';
|
|
3
7
|
|
|
4
8
|
class CaseBuilder<V> {
|
|
5
9
|
constructor(readonly v: V) {}
|
|
@@ -31,7 +35,10 @@ class CaseBuilder<V> {
|
|
|
31
35
|
}
|
|
32
36
|
|
|
33
37
|
class Case<T, V = unknown> {
|
|
34
|
-
constructor(
|
|
38
|
+
constructor(
|
|
39
|
+
protected value: V,
|
|
40
|
+
protected outcome?: T
|
|
41
|
+
) {}
|
|
35
42
|
|
|
36
43
|
case(pred: Predicate<V>, out: Get<T, V>): Case<T, V> {
|
|
37
44
|
return tryTo(pred, this.value)
|
|
@@ -72,7 +79,10 @@ class Case<T, V = unknown> {
|
|
|
72
79
|
}
|
|
73
80
|
|
|
74
81
|
class Found<T, V> extends Case<T, V> {
|
|
75
|
-
constructor(
|
|
82
|
+
constructor(
|
|
83
|
+
protected value: V,
|
|
84
|
+
protected outcome: T
|
|
85
|
+
) {
|
|
76
86
|
super(value, outcome);
|
|
77
87
|
}
|
|
78
88
|
|
package/src/types/Constructor.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Get } from './Get';
|
|
2
2
|
import { isFunc } from './Func';
|
|
3
|
-
import { isDefined } from './Is';
|
|
3
|
+
import { isDefined, isFunction } from './Is';
|
|
4
4
|
import { isPrimitive } from './Primitive';
|
|
5
5
|
import { Optional } from './Types';
|
|
6
6
|
|
|
@@ -10,6 +10,8 @@ export type Construct<Out, In = any> = Get<Out, In> | Constructor<Out>;
|
|
|
10
10
|
|
|
11
11
|
export const isConstructor = <T>(c?: unknown): c is Constructor<T> => (isDefined(c) && isFunc<T, unknown>(c) && c.prototype && c.prototype.constructor) === c;
|
|
12
12
|
|
|
13
|
+
export const isInstance = <T>(ctor: Constructor<T>, o?: unknown): o is T => isFunction(ctor) && o instanceof ctor;
|
|
14
|
+
|
|
13
15
|
export const ofConstruct = <T>(c: Construct<T>, ...args: unknown[]): T => (isConstructor<T>(c) ? new c(...args) : isFunc<T, unknown>(c) ? c(...args) : c);
|
|
14
16
|
|
|
15
17
|
export const toName = (subject?: unknown, postfix = ''): string => (subject as any)?.constructor?.name?.replace(postfix, '').toLowerCase() ?? '';
|
package/src/types/Context.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { Uuid } from './Uuid';
|
|
2
|
-
import { text } from './Text';
|
|
3
2
|
import { Identity } from './Identity';
|
|
4
|
-
import { tryTo } from './Try';
|
|
5
3
|
import { Optional } from './Types';
|
|
4
|
+
import { text } from './Template';
|
|
6
5
|
|
|
7
6
|
export interface EnvContext {
|
|
8
7
|
readonly domain: string;
|
|
@@ -21,12 +20,12 @@ export class DotEnvContext implements EnvContext {
|
|
|
21
20
|
readonly port = Number.parseInt(process.env.PORT ?? '8080');
|
|
22
21
|
readonly app = process.env.APP ?? '';
|
|
23
22
|
|
|
24
|
-
readonly get = (key: string, alt?: string): Optional<string> =>
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
23
|
+
readonly get = (key: string, alt?: string): Optional<string> => {
|
|
24
|
+
const k = text(key)
|
|
25
|
+
.map(k => k.replace(/([a-z])([A-Z])/g, '$1 $2'))
|
|
26
|
+
.snake.toString();
|
|
27
|
+
return process.env[k] ?? alt;
|
|
28
|
+
};
|
|
30
29
|
}
|
|
31
30
|
|
|
32
31
|
export interface RequestContext {
|
package/src/types/ErrorOrigin.ts
CHANGED
package/src/types/Exception.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { asString, Text
|
|
1
|
+
import { asString, Text } from './Text';
|
|
2
2
|
import { Enum } from './Enum';
|
|
3
3
|
import { isDefined } from './Is';
|
|
4
4
|
import { Id } from './Id';
|
|
5
|
+
import { text } from './Template';
|
|
5
6
|
|
|
6
7
|
export class Exception extends Enum {
|
|
7
8
|
static readonly AlreadyExists = new Exception('Subject already exists');
|
|
@@ -11,7 +12,11 @@ export class Exception extends Enum {
|
|
|
11
12
|
static readonly IsNotValid = new Exception('Is not valid');
|
|
12
13
|
static readonly Unknown = new Exception('Unknown error');
|
|
13
14
|
|
|
14
|
-
constructor(
|
|
15
|
+
constructor(
|
|
16
|
+
readonly message: string,
|
|
17
|
+
id?: Id,
|
|
18
|
+
readonly reason?: Text
|
|
19
|
+
) {
|
|
15
20
|
super(message, id ?? text(message).pascal.toString());
|
|
16
21
|
}
|
|
17
22
|
|
package/src/types/Gateway.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Json, JsonValue } from './Json';
|
|
2
2
|
import { Id } from './Id';
|
|
3
3
|
import { Exception } from './Exception';
|
|
4
|
-
import { reject } from '../utils';
|
|
5
4
|
import { PageList, PageOptions } from './PageList';
|
|
6
5
|
import { List } from './List';
|
|
7
6
|
import { Optional } from './Types';
|
|
7
|
+
import { reject } from '../utils/Promise';
|
|
8
8
|
|
|
9
9
|
export type FetchOptions = PageOptions;
|
|
10
10
|
|
package/src/types/Is.ts
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import { Constructor, use } from './Constructor';
|
|
2
|
-
import { Identity } from './Identity';
|
|
3
|
-
|
|
4
1
|
export const isDefined = <T = unknown>(o?: T): o is NonNullable<T> => o !== undefined && o !== null;
|
|
5
2
|
|
|
6
3
|
export const isUndefined = (v?: unknown): v is never => v === undefined || v === null;
|
|
@@ -28,16 +25,12 @@ export const isFunction = (o?: unknown): o is (...params: unknown[]) => unknown
|
|
|
28
25
|
|
|
29
26
|
export const isArray = <T = any>(o?: unknown): o is Array<T> => isDefined(o) && o instanceof Array;
|
|
30
27
|
|
|
31
|
-
export const isInstance = <T>(ctor: Constructor<T>, o?: unknown): o is T => isFunction(ctor) && o instanceof ctor;
|
|
32
|
-
|
|
33
28
|
export const isIn = (o: unknown, values: unknown[]): boolean => isArray(values) && values.some(v => v === o);
|
|
34
29
|
|
|
35
30
|
export const isIntersecting = (o?: unknown[], values?: unknown[]): boolean => isArray(o) && isArray(values) && o.some(ov => isIn(ov, values));
|
|
36
31
|
|
|
37
32
|
export const isError = (e: unknown): e is Error => isDefined(e) && e instanceof Error;
|
|
38
33
|
|
|
39
|
-
export const isIdentity = (by: unknown): by is Identity => use(by as Identity, b => isObject(b) && isDefined(b.id));
|
|
40
|
-
|
|
41
34
|
export const isNotPresent = (...os: unknown[]): boolean =>
|
|
42
35
|
os.some(
|
|
43
36
|
o =>
|
package/src/types/IsA.ts
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { isPrimitive } from './Primitive';
|
|
2
|
+
import { Identity } from './Identity';
|
|
3
|
+
import { use } from './Constructor';
|
|
4
|
+
import { isDefined, isObject } from './Is';
|
|
2
5
|
|
|
3
6
|
export const isA = <T>(t?: unknown, ...properties: (keyof T)[]): t is T => !isPrimitive(t) && properties.every(p => p.toString() in (t as any));
|
|
4
7
|
export const isAn = isA;
|
|
8
|
+
export const isIdentity = (by: unknown): by is Identity => use(by as Identity, b => isObject(b) && isDefined(b.id));
|
package/src/types/Json.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { isA } from './IsA';
|
|
2
2
|
import { isEmpty, isObject } from './Is';
|
|
3
3
|
import { Get, ofGet } from './Get';
|
|
4
|
-
import { ifDefined } from '../utils';
|
|
4
|
+
import { ifDefined } from '../utils/If';
|
|
5
5
|
import { TypeGuard } from './TypeGuard';
|
|
6
|
-
import { entries } from './
|
|
6
|
+
import { entries } from './Object';
|
|
7
7
|
|
|
8
8
|
export type JsonValue = string | number | boolean | null | Json | JsonValue[];
|
|
9
9
|
export type Json = { [key: string]: JsonValue };
|
package/src/types/List.ts
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { ArrayLike, toArray } from './Array';
|
|
2
2
|
import { Constructor, on } from './Constructor';
|
|
3
|
-
import {
|
|
3
|
+
import type { Json } from './Json';
|
|
4
4
|
import { isArray, isDefined, isEmpty } from './Is';
|
|
5
5
|
import { isA } from './IsA';
|
|
6
6
|
import { Get, GetProperty, ofGet, ofProperty } from './Get';
|
|
7
|
-
import { Id } from './Id';
|
|
7
|
+
import type { Id } from './Id';
|
|
8
8
|
import { asString } from './Text';
|
|
9
|
-
import { tryTo } from './Try';
|
|
10
|
-
import { meta } from './Meta';
|
|
11
9
|
import { Optional } from './Types';
|
|
10
|
+
import { ifDefined, ifTrue } from '../utils/If';
|
|
12
11
|
|
|
13
12
|
export class List<T = unknown> extends Array<T> {
|
|
14
13
|
asc(p: GetProperty<T, any>): List<T> {
|
|
@@ -24,7 +23,11 @@ export class List<T = unknown> extends Array<T> {
|
|
|
24
23
|
}
|
|
25
24
|
|
|
26
25
|
firstValue<V>(f: (t: T) => V, alt?: Get<V, T>): Optional<V> {
|
|
27
|
-
return
|
|
26
|
+
return ifDefined(
|
|
27
|
+
this.first(t => !!f(t)),
|
|
28
|
+
f,
|
|
29
|
+
v => ofGet(alt, v)
|
|
30
|
+
);
|
|
28
31
|
}
|
|
29
32
|
|
|
30
33
|
isFirst(value: T): boolean {
|
|
@@ -76,7 +79,7 @@ export class List<T = unknown> extends Array<T> {
|
|
|
76
79
|
|
|
77
80
|
toJSON(): Json[] {
|
|
78
81
|
return this.reduce((a, i) => {
|
|
79
|
-
a.push(
|
|
82
|
+
a.push(JSON.parse(JSON.stringify(i ?? {})));
|
|
80
83
|
return a;
|
|
81
84
|
}, new Array<Json>());
|
|
82
85
|
}
|
|
@@ -102,7 +105,7 @@ export class List<T = unknown> extends Array<T> {
|
|
|
102
105
|
}
|
|
103
106
|
|
|
104
107
|
distinctByKey(key: keyof T): List<T> {
|
|
105
|
-
return
|
|
108
|
+
return toList([...Object.values<T>(this.toObject(key)), ...Object.values<T>(Object.getPrototypeOf(this.toObject(key)))]);
|
|
106
109
|
}
|
|
107
110
|
|
|
108
111
|
filter(p: (value: T, index: number, array: T[]) => unknown, params?: unknown): List<T> {
|
|
@@ -155,10 +158,8 @@ export class List<T = unknown> extends Array<T> {
|
|
|
155
158
|
}
|
|
156
159
|
|
|
157
160
|
replace(key: keyof T, item: T): List<T> {
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
.filter(i => i > -1)
|
|
161
|
-
.map(i => (this[i] = item));
|
|
161
|
+
const index = this.findIndex(i => i[key] === item?.[key]);
|
|
162
|
+
ifTrue(index != -1, () => this.splice(index, 1, item));
|
|
162
163
|
return this;
|
|
163
164
|
}
|
|
164
165
|
|
|
@@ -218,7 +219,7 @@ export const toList = <T = unknown>(...items: ArrayLike<T>): List<T> => new List
|
|
|
218
219
|
|
|
219
220
|
export const isList = <T>(l?: unknown): l is List<T> => isDefined(l) && isArray(l) && isA<List<T>>(l, 'first', 'last', 'asc', 'desc');
|
|
220
221
|
|
|
221
|
-
export const asList = <T>(c: Constructor<T>, items: unknown
|
|
222
|
+
export const asList = <T>(c: Constructor<T>, items: unknown = []): List<T> => toList<T>(toArray(items).map(i => new c(i)));
|
|
222
223
|
|
|
223
224
|
export const maxValue = <T>(l: List<T>, key: keyof T): T[keyof T] | undefined => l.desc(key).first()?.[key];
|
|
224
225
|
|
package/src/types/Meta.ts
CHANGED
|
@@ -3,13 +3,15 @@ import { List, toList } from './List';
|
|
|
3
3
|
import { isDefined } from './Is';
|
|
4
4
|
import { on, use } from './Constructor';
|
|
5
5
|
import { Optional } from './Types';
|
|
6
|
+
import { Entry, entries, values } from './Object';
|
|
6
7
|
|
|
7
8
|
type MetaParseOptions = { initial?: any; skipUndefined?: boolean };
|
|
8
9
|
|
|
9
|
-
type Entry<T = unknown> = [key: string, value: T];
|
|
10
|
-
|
|
11
10
|
class ClassMeta {
|
|
12
|
-
constructor(
|
|
11
|
+
constructor(
|
|
12
|
+
readonly subject: any,
|
|
13
|
+
private readonly data: any = (subject.prototype ?? subject).constructor
|
|
14
|
+
) {}
|
|
13
15
|
|
|
14
16
|
get = <T>(key: string): T => Reflect.getMetadata(key, this.data) as T;
|
|
15
17
|
|
|
@@ -18,8 +20,7 @@ class ClassMeta {
|
|
|
18
20
|
return value;
|
|
19
21
|
};
|
|
20
22
|
|
|
21
|
-
entries = <T = unknown>(): List<Entry<T>> =>
|
|
22
|
-
toList([...Object.entries(this.subject), ...Object.entries(Object.getPrototypeOf(this.subject))]) as List<Entry<T>>;
|
|
23
|
+
entries = <T = unknown>(): List<Entry<T>> => entries<T>(this.subject);
|
|
23
24
|
|
|
24
25
|
parse = <Out, Value>(f: (v: Value) => Out, options: MetaParseOptions = {}): Record<string, Out> => {
|
|
25
26
|
const { initial = {}, skipUndefined = false } = options;
|
|
@@ -36,13 +37,17 @@ class ClassMeta {
|
|
|
36
37
|
.map(p => p.get<T>(key))
|
|
37
38
|
.reduce((list, u) => (u ? list.add(u) : list), toList<T>());
|
|
38
39
|
|
|
39
|
-
values = <T = unknown>(): List<T> =>
|
|
40
|
+
values = <T = unknown>(): List<T> => values<T>(this.subject);
|
|
40
41
|
|
|
41
42
|
property = (property: string | symbol): PropertyMeta => new PropertyMeta(this.subject, property);
|
|
42
43
|
}
|
|
43
44
|
|
|
44
45
|
class PropertyMeta {
|
|
45
|
-
constructor(
|
|
46
|
+
constructor(
|
|
47
|
+
readonly subject: any,
|
|
48
|
+
readonly property: string | symbol,
|
|
49
|
+
private readonly data = Reflect.getMetadata(property, subject)
|
|
50
|
+
) {}
|
|
46
51
|
|
|
47
52
|
get value(): any {
|
|
48
53
|
return this.subject[this.property];
|
|
@@ -57,5 +62,3 @@ class PropertyMeta {
|
|
|
57
62
|
}
|
|
58
63
|
|
|
59
64
|
export const meta = (subject: unknown): ClassMeta => new ClassMeta(subject ?? {});
|
|
60
|
-
|
|
61
|
-
export const entries = <T = unknown>(subject: Record<string, T>): List<Entry<T>> => meta(subject).entries<T>();
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { List, toList } from './List';
|
|
2
|
+
import { ifDefined } from '../utils/If';
|
|
3
|
+
|
|
4
|
+
export type Entry<T = unknown> = [key: string, value: T];
|
|
5
|
+
|
|
6
|
+
export function entries<T = unknown>(subject: { [p: string]: T } | ArrayLike<T>): List<Entry<T>> {
|
|
7
|
+
return ifDefined(
|
|
8
|
+
subject,
|
|
9
|
+
() => toList<Entry<T>>([...Object.entries(subject), ...Object.entries(Object.getPrototypeOf(subject))] as Entry<T>[]),
|
|
10
|
+
() => toList<Entry<T>>()
|
|
11
|
+
);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export function values<T = unknown>(subject: { [p: string]: T } | ArrayLike<T>): List<T> {
|
|
15
|
+
return toList([...Object.values<T>(subject), ...Object.values<T>(Object.getPrototypeOf(subject))]);
|
|
16
|
+
}
|
package/src/types/Parser.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Get, ofGet, Predicate } from './Get';
|
|
2
2
|
import { isDefined, isEmpty, isIn, isObject, isString, isTrue } from './Is';
|
|
3
|
-
import { isValid } from '../validation';
|
|
3
|
+
import { isValid } from '../validation/Validate';
|
|
4
4
|
import { Constructor, on } from './Constructor';
|
|
5
5
|
import { toArray } from './Array';
|
|
6
6
|
|
package/src/types/Repository.ts
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { FetchOptions } from './Gateway';
|
|
2
|
+
import { PageList } from './PageList';
|
|
3
|
+
import { Exception } from './Exception';
|
|
4
|
+
import { reject } from '../utils/Promise';
|
|
5
|
+
import { Id, Key } from './Id';
|
|
6
|
+
import { List } from './List';
|
|
7
|
+
import { Json, JsonValue } from './Json';
|
|
3
8
|
|
|
4
9
|
export class Repository<T, Options = FetchOptions> {
|
|
5
10
|
all(options?: Options): Promise<PageList<T>> {
|