@thisisagile/easy 15.8.6 → 15.8.7
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-4N72FQFX.mjs +16 -0
- package/dist/chunk-4N72FQFX.mjs.map +1 -0
- package/dist/data/Condition.d.ts +25 -0
- package/dist/data/Condition.js +71 -0
- package/dist/data/Condition.js.map +1 -0
- package/dist/data/Condition.mjs +44 -0
- package/dist/data/Condition.mjs.map +1 -0
- package/dist/data/DataProvider.d.ts +1 -0
- package/dist/data/DataProvider.js +17 -0
- package/dist/data/DataProvider.js.map +1 -0
- package/dist/data/DataProvider.mjs +1 -0
- package/dist/data/DataProvider.mjs.map +1 -0
- package/dist/data/Database.d.ts +22 -0
- package/dist/data/Database.js +42 -0
- package/dist/data/Database.js.map +1 -0
- package/dist/data/Database.mjs +18 -0
- package/dist/data/Database.mjs.map +1 -0
- package/dist/data/Field.d.ts +17 -0
- package/dist/data/Field.js +48 -0
- package/dist/data/Field.js.map +1 -0
- package/dist/data/Field.mjs +24 -0
- package/dist/data/Field.mjs.map +1 -0
- package/dist/data/InMemoryGateway.d.ts +12 -0
- package/dist/data/InMemoryGateway.js +59 -0
- package/dist/data/InMemoryGateway.js.map +1 -0
- package/dist/data/InMemoryGateway.mjs +36 -0
- package/dist/data/InMemoryGateway.mjs.map +1 -0
- package/dist/data/Query.d.ts +2 -0
- package/dist/data/Query.js +17 -0
- package/dist/data/Query.js.map +1 -0
- package/dist/data/Query.mjs +1 -0
- package/dist/data/Query.mjs.map +1 -0
- package/dist/data/QueryProvider.d.ts +7 -0
- package/dist/data/QueryProvider.js +17 -0
- package/dist/data/QueryProvider.js.map +1 -0
- package/dist/data/QueryProvider.mjs +1 -0
- package/dist/data/QueryProvider.mjs.map +1 -0
- package/dist/data/index.d.ts +7 -0
- package/dist/data/index.js +35 -0
- package/dist/data/index.js.map +1 -0
- package/dist/data/index.mjs +8 -0
- package/dist/data/index.mjs.map +1 -0
- package/dist/domain/Audit.d.ts +11 -0
- package/dist/domain/Audit.js +59 -0
- package/dist/domain/Audit.js.map +1 -0
- package/dist/domain/Audit.mjs +29 -0
- package/dist/domain/Audit.mjs.map +1 -0
- package/dist/domain/Child.d.ts +6 -0
- package/dist/domain/Child.js +49 -0
- package/dist/domain/Child.js.map +1 -0
- package/dist/domain/Child.mjs +19 -0
- package/dist/domain/Child.mjs.map +1 -0
- package/dist/domain/Entity.d.ts +9 -0
- package/dist/domain/Entity.js +62 -0
- package/dist/domain/Entity.js.map +1 -0
- package/dist/domain/Entity.mjs +32 -0
- package/dist/domain/Entity.mjs.map +1 -0
- package/dist/domain/Repo.d.ts +23 -0
- package/dist/domain/Repo.js +81 -0
- package/dist/domain/Repo.js.map +1 -0
- package/dist/domain/Repo.mjs +58 -0
- package/dist/domain/Repo.mjs.map +1 -0
- package/dist/domain/Struct.d.ts +11 -0
- package/dist/domain/Struct.js +55 -0
- package/dist/domain/Struct.js.map +1 -0
- package/dist/domain/Struct.mjs +31 -0
- package/dist/domain/Struct.mjs.map +1 -0
- package/dist/domain/Typo.d.ts +16 -0
- package/dist/domain/Typo.js +62 -0
- package/dist/domain/Typo.js.map +1 -0
- package/dist/domain/Typo.mjs +39 -0
- package/dist/domain/Typo.mjs.map +1 -0
- package/dist/domain/enums/Country.d.ts +256 -0
- package/dist/domain/enums/Country.js +290 -0
- package/dist/domain/enums/Country.js.map +1 -0
- package/dist/domain/enums/Country.mjs +267 -0
- package/dist/domain/enums/Country.mjs.map +1 -0
- package/dist/domain/enums/Currency.d.ts +127 -0
- package/dist/domain/enums/Currency.js +159 -0
- package/dist/domain/enums/Currency.js.map +1 -0
- package/dist/domain/enums/Currency.mjs +136 -0
- package/dist/domain/enums/Currency.mjs.map +1 -0
- package/dist/domain/enums/Environment.d.ts +7 -0
- package/dist/domain/enums/Environment.js +35 -0
- package/dist/domain/enums/Environment.js.map +1 -0
- package/dist/domain/enums/Environment.mjs +12 -0
- package/dist/domain/enums/Environment.mjs.map +1 -0
- package/dist/domain/enums/Locale.d.ts +571 -0
- package/dist/domain/enums/Locale.js +605 -0
- package/dist/domain/enums/Locale.js.map +1 -0
- package/dist/domain/enums/Locale.mjs +582 -0
- package/dist/domain/enums/Locale.mjs.map +1 -0
- package/dist/domain/enums/UnitOfMeasurement.d.ts +10 -0
- package/dist/domain/enums/UnitOfMeasurement.js +40 -0
- package/dist/domain/enums/UnitOfMeasurement.js.map +1 -0
- package/dist/domain/enums/UnitOfMeasurement.mjs +17 -0
- package/dist/domain/enums/UnitOfMeasurement.mjs.map +1 -0
- package/dist/domain/enums/UnitOfWeight.d.ts +8 -0
- package/dist/domain/enums/UnitOfWeight.js +38 -0
- package/dist/domain/enums/UnitOfWeight.js.map +1 -0
- package/dist/domain/enums/UnitOfWeight.mjs +15 -0
- package/dist/domain/enums/UnitOfWeight.mjs.map +1 -0
- package/dist/domain/enums/index.d.ts +6 -0
- package/dist/domain/enums/index.js +33 -0
- package/dist/domain/enums/index.js.map +1 -0
- package/dist/domain/enums/index.mjs +7 -0
- package/dist/domain/enums/index.mjs.map +1 -0
- package/dist/domain/index.d.ts +9 -0
- package/dist/domain/index.js +39 -0
- package/dist/domain/index.js.map +1 -0
- package/dist/domain/index.mjs +10 -0
- package/dist/domain/index.mjs.map +1 -0
- package/dist/domain/structs/Address.d.ts +12 -0
- package/dist/domain/structs/Address.js +73 -0
- package/dist/domain/structs/Address.js.map +1 -0
- package/dist/domain/structs/Address.mjs +42 -0
- package/dist/domain/structs/Address.mjs.map +1 -0
- package/dist/domain/structs/Box.d.ts +15 -0
- package/dist/domain/structs/Box.js +70 -0
- package/dist/domain/structs/Box.js.map +1 -0
- package/dist/domain/structs/Box.mjs +40 -0
- package/dist/domain/structs/Box.mjs.map +1 -0
- package/dist/domain/structs/Dimension.d.ts +10 -0
- package/dist/domain/structs/Dimension.js +61 -0
- package/dist/domain/structs/Dimension.js.map +1 -0
- package/dist/domain/structs/Dimension.mjs +31 -0
- package/dist/domain/structs/Dimension.mjs.map +1 -0
- package/dist/domain/structs/Money.d.ts +12 -0
- package/dist/domain/structs/Money.js +71 -0
- package/dist/domain/structs/Money.js.map +1 -0
- package/dist/domain/structs/Money.mjs +39 -0
- package/dist/domain/structs/Money.mjs.map +1 -0
- package/dist/domain/structs/Name.d.ts +9 -0
- package/dist/domain/structs/Name.js +57 -0
- package/dist/domain/structs/Name.js.map +1 -0
- package/dist/domain/structs/Name.mjs +26 -0
- package/dist/domain/structs/Name.mjs.map +1 -0
- package/dist/domain/structs/Weight.d.ts +13 -0
- package/dist/domain/structs/Weight.js +71 -0
- package/dist/domain/structs/Weight.js.map +1 -0
- package/dist/domain/structs/Weight.mjs +40 -0
- package/dist/domain/structs/Weight.mjs.map +1 -0
- package/dist/domain/structs/index.d.ts +6 -0
- package/dist/domain/structs/index.js +33 -0
- package/dist/domain/structs/index.js.map +1 -0
- package/dist/domain/structs/index.mjs +7 -0
- package/dist/domain/structs/index.mjs.map +1 -0
- package/dist/domain/values/DateTime.d.ts +34 -0
- package/dist/domain/values/DateTime.js +117 -0
- package/dist/domain/values/DateTime.js.map +1 -0
- package/dist/domain/values/DateTime.mjs +92 -0
- package/dist/domain/values/DateTime.mjs.map +1 -0
- package/dist/domain/values/EAN.d.ts +5 -0
- package/dist/domain/values/EAN.js +50 -0
- package/dist/domain/values/EAN.js.map +1 -0
- package/dist/domain/values/EAN.mjs +16 -0
- package/dist/domain/values/EAN.mjs.map +1 -0
- package/dist/domain/values/Email.d.ts +8 -0
- package/dist/domain/values/Email.js +57 -0
- package/dist/domain/values/Email.js.map +1 -0
- package/dist/domain/values/Email.mjs +22 -0
- package/dist/domain/values/Email.mjs.map +1 -0
- package/dist/domain/values/IBAN.d.ts +5 -0
- package/dist/domain/values/IBAN.js +50 -0
- package/dist/domain/values/IBAN.js.map +1 -0
- package/dist/domain/values/IBAN.mjs +16 -0
- package/dist/domain/values/IBAN.mjs.map +1 -0
- package/dist/domain/values/PostalCode.d.ts +8 -0
- package/dist/domain/values/PostalCode.js +53 -0
- package/dist/domain/values/PostalCode.js.map +1 -0
- package/dist/domain/values/PostalCode.mjs +19 -0
- package/dist/domain/values/PostalCode.mjs.map +1 -0
- package/dist/domain/values/Url.d.ts +22 -0
- package/dist/domain/values/Url.js +57 -0
- package/dist/domain/values/Url.js.map +1 -0
- package/dist/domain/values/Url.mjs +22 -0
- package/dist/domain/values/Url.mjs.map +1 -0
- package/dist/domain/values/index.d.ts +6 -0
- package/dist/domain/values/index.js +33 -0
- package/dist/domain/values/index.js.map +1 -0
- package/dist/domain/values/index.mjs +7 -0
- package/dist/domain/values/index.mjs.map +1 -0
- package/dist/health/HealthResource.d.ts +5 -0
- package/dist/health/HealthResource.js +49 -0
- package/dist/health/HealthResource.js.map +1 -0
- package/dist/health/HealthResource.mjs +19 -0
- package/dist/health/HealthResource.mjs.map +1 -0
- package/dist/health/HealthUri.d.ts +5 -0
- package/dist/health/HealthUri.js +33 -0
- package/dist/health/HealthUri.js.map +1 -0
- package/dist/health/HealthUri.mjs +10 -0
- package/dist/health/HealthUri.mjs.map +1 -0
- package/dist/health/index.d.ts +2 -0
- package/dist/health/index.js +25 -0
- package/dist/health/index.js.map +1 -0
- package/dist/health/index.mjs +3 -0
- package/dist/health/index.mjs.map +1 -0
- package/dist/http/CacheControl.d.ts +24 -0
- package/dist/http/CacheControl.js +56 -0
- package/dist/http/CacheControl.js.map +1 -0
- package/dist/http/CacheControl.mjs +33 -0
- package/dist/http/CacheControl.mjs.map +1 -0
- package/dist/http/ContentType.d.ts +12 -0
- package/dist/http/ContentType.js +53 -0
- package/dist/http/ContentType.js.map +1 -0
- package/dist/http/ContentType.mjs +20 -0
- package/dist/http/ContentType.mjs.map +1 -0
- package/dist/http/HttpHeader.d.ts +4 -0
- package/dist/http/HttpHeader.js +32 -0
- package/dist/http/HttpHeader.js.map +1 -0
- package/dist/http/HttpHeader.mjs +9 -0
- package/dist/http/HttpHeader.mjs.map +1 -0
- package/dist/http/HttpStatus.d.ts +72 -0
- package/dist/http/HttpStatus.js +112 -0
- package/dist/http/HttpStatus.js.map +1 -0
- package/dist/http/HttpStatus.mjs +87 -0
- package/dist/http/HttpStatus.mjs.map +1 -0
- package/dist/http/HttpVerb.d.ts +9 -0
- package/dist/http/HttpVerb.js +39 -0
- package/dist/http/HttpVerb.js.map +1 -0
- package/dist/http/HttpVerb.mjs +16 -0
- package/dist/http/HttpVerb.mjs.map +1 -0
- package/dist/http/LocalRequestStore.d.ts +7 -0
- package/dist/http/LocalRequestStore.js +36 -0
- package/dist/http/LocalRequestStore.js.map +1 -0
- package/dist/http/LocalRequestStore.mjs +13 -0
- package/dist/http/LocalRequestStore.mjs.map +1 -0
- package/dist/http/OriginatedError.d.ts +9 -0
- package/dist/http/OriginatedError.js +42 -0
- package/dist/http/OriginatedError.js.map +1 -0
- package/dist/http/OriginatedError.mjs +17 -0
- package/dist/http/OriginatedError.mjs.map +1 -0
- package/dist/http/Request.d.ts +11 -0
- package/dist/http/Request.js +17 -0
- package/dist/http/Request.js.map +1 -0
- package/dist/http/Request.mjs +1 -0
- package/dist/http/Request.mjs.map +1 -0
- package/dist/http/RequestOptions.d.ts +35 -0
- package/dist/http/RequestOptions.js +91 -0
- package/dist/http/RequestOptions.js.map +1 -0
- package/dist/http/RequestOptions.mjs +66 -0
- package/dist/http/RequestOptions.mjs.map +1 -0
- package/dist/http/RequestProvider.d.ts +5 -0
- package/dist/http/RequestProvider.js +17 -0
- package/dist/http/RequestProvider.js.map +1 -0
- package/dist/http/RequestProvider.mjs +1 -0
- package/dist/http/RequestProvider.mjs.map +1 -0
- package/dist/http/Response.d.ts +14 -0
- package/dist/http/Response.js +39 -0
- package/dist/http/Response.js.map +1 -0
- package/dist/http/Response.mjs +15 -0
- package/dist/http/Response.mjs.map +1 -0
- package/dist/http/RestResult.d.ts +23 -0
- package/dist/http/RestResult.js +56 -0
- package/dist/http/RestResult.js.map +1 -0
- package/dist/http/RestResult.mjs +32 -0
- package/dist/http/RestResult.mjs.map +1 -0
- package/dist/http/Verb.d.ts +20 -0
- package/dist/http/Verb.js +61 -0
- package/dist/http/Verb.js.map +1 -0
- package/dist/http/Verb.mjs +31 -0
- package/dist/http/Verb.mjs.map +1 -0
- package/dist/http/index.d.ts +12 -0
- package/dist/http/index.js +45 -0
- package/dist/http/index.js.map +1 -0
- package/dist/http/index.mjs +13 -0
- package/dist/http/index.mjs.map +1 -0
- package/dist/index.d.ts +12 -2821
- package/dist/index.js +45 -1
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +13 -1
- package/dist/index.mjs.map +1 -0
- package/dist/process/App.d.ts +5 -0
- package/dist/process/App.js +35 -0
- package/dist/process/App.js.map +1 -0
- package/dist/process/App.mjs +12 -0
- package/dist/process/App.mjs.map +1 -0
- package/dist/process/Manage.d.ts +8 -0
- package/dist/process/Manage.js +43 -0
- package/dist/process/Manage.js.map +1 -0
- package/dist/process/Manage.mjs +20 -0
- package/dist/process/Manage.mjs.map +1 -0
- package/dist/process/Scope.d.ts +5 -0
- package/dist/process/Scope.js +38 -0
- package/dist/process/Scope.js.map +1 -0
- package/dist/process/Scope.mjs +15 -0
- package/dist/process/Scope.mjs.map +1 -0
- package/dist/process/Search.d.ts +14 -0
- package/dist/process/Search.js +62 -0
- package/dist/process/Search.js.map +1 -0
- package/dist/process/Search.mjs +39 -0
- package/dist/process/Search.mjs.map +1 -0
- package/dist/process/UseCase.d.ts +10 -0
- package/dist/process/UseCase.js +48 -0
- package/dist/process/UseCase.js.map +1 -0
- package/dist/process/UseCase.mjs +25 -0
- package/dist/process/UseCase.mjs.map +1 -0
- package/dist/process/index.d.ts +5 -0
- package/dist/process/index.js +31 -0
- package/dist/process/index.js.map +1 -0
- package/dist/process/index.mjs +6 -0
- package/dist/process/index.mjs.map +1 -0
- package/dist/resources/AppProvider.d.ts +9 -0
- package/dist/resources/AppProvider.js +17 -0
- package/dist/resources/AppProvider.js.map +1 -0
- package/dist/resources/AppProvider.mjs +1 -0
- package/dist/resources/AppProvider.mjs.map +1 -0
- package/dist/resources/Req.d.ts +23 -0
- package/dist/resources/Req.js +54 -0
- package/dist/resources/Req.js.map +1 -0
- package/dist/resources/Req.mjs +30 -0
- package/dist/resources/Req.mjs.map +1 -0
- package/dist/resources/Requires.d.ts +8 -0
- package/dist/resources/Requires.js +48 -0
- package/dist/resources/Requires.js.map +1 -0
- package/dist/resources/Requires.mjs +24 -0
- package/dist/resources/Requires.mjs.map +1 -0
- package/dist/resources/Resource.d.ts +1 -0
- package/dist/resources/Resource.js +17 -0
- package/dist/resources/Resource.js.map +1 -0
- package/dist/resources/Resource.mjs +1 -0
- package/dist/resources/Resource.mjs.map +1 -0
- package/dist/resources/Route.d.ts +26 -0
- package/dist/resources/Route.js +62 -0
- package/dist/resources/Route.js.map +1 -0
- package/dist/resources/Route.mjs +38 -0
- package/dist/resources/Route.mjs.map +1 -0
- package/dist/resources/Service.d.ts +15 -0
- package/dist/resources/Service.js +49 -0
- package/dist/resources/Service.js.map +1 -0
- package/dist/resources/Service.mjs +26 -0
- package/dist/resources/Service.mjs.map +1 -0
- package/dist/resources/index.d.ts +7 -0
- package/dist/resources/index.js +35 -0
- package/dist/resources/index.js.map +1 -0
- package/dist/resources/index.mjs +8 -0
- package/dist/resources/index.mjs.map +1 -0
- package/dist/security/Jwt.d.ts +15 -0
- package/dist/security/Jwt.js +48 -0
- package/dist/security/Jwt.js.map +1 -0
- package/dist/security/Jwt.mjs +25 -0
- package/dist/security/Jwt.mjs.map +1 -0
- package/dist/security/index.d.ts +1 -0
- package/dist/security/index.js +23 -0
- package/dist/security/index.js.map +1 -0
- package/dist/security/index.mjs +2 -0
- package/dist/security/index.mjs.map +1 -0
- package/dist/services/Api.d.ts +16 -0
- package/dist/services/Api.js +93 -0
- package/dist/services/Api.js.map +1 -0
- package/dist/services/Api.mjs +69 -0
- package/dist/services/Api.mjs.map +1 -0
- package/dist/services/ApiGateway.d.ts +14 -0
- package/dist/services/ApiGateway.js +57 -0
- package/dist/services/ApiGateway.js.map +1 -0
- package/dist/services/ApiGateway.mjs +34 -0
- package/dist/services/ApiGateway.mjs.map +1 -0
- package/dist/services/AxiosProvider.d.ts +7 -0
- package/dist/services/AxiosProvider.js +61 -0
- package/dist/services/AxiosProvider.js.map +1 -0
- package/dist/services/AxiosProvider.mjs +28 -0
- package/dist/services/AxiosProvider.mjs.map +1 -0
- package/dist/services/MappedRouteGateway.d.ts +16 -0
- package/dist/services/MappedRouteGateway.js +52 -0
- package/dist/services/MappedRouteGateway.js.map +1 -0
- package/dist/services/MappedRouteGateway.mjs +29 -0
- package/dist/services/MappedRouteGateway.mjs.map +1 -0
- package/dist/services/RouteGateway.d.ts +19 -0
- package/dist/services/RouteGateway.js +70 -0
- package/dist/services/RouteGateway.js.map +1 -0
- package/dist/services/RouteGateway.mjs +47 -0
- package/dist/services/RouteGateway.mjs.map +1 -0
- package/dist/services/ViewRouteGateway.d.ts +21 -0
- package/dist/services/ViewRouteGateway.js +55 -0
- package/dist/services/ViewRouteGateway.js.map +1 -0
- package/dist/services/ViewRouteGateway.mjs +32 -0
- package/dist/services/ViewRouteGateway.mjs.map +1 -0
- package/dist/services/index.d.ts +6 -0
- package/dist/services/index.js +33 -0
- package/dist/services/index.js.map +1 -0
- package/dist/services/index.mjs +7 -0
- package/dist/services/index.mjs.map +1 -0
- package/dist/sql/Clause.d.ts +17 -0
- package/dist/sql/Clause.js +58 -0
- package/dist/sql/Clause.js.map +1 -0
- package/dist/sql/Clause.mjs +31 -0
- package/dist/sql/Clause.mjs.map +1 -0
- package/dist/sql/Column.d.ts +41 -0
- package/dist/sql/Column.js +96 -0
- package/dist/sql/Column.js.map +1 -0
- package/dist/sql/Column.mjs +71 -0
- package/dist/sql/Column.mjs.map +1 -0
- package/dist/sql/Count.d.ts +7 -0
- package/dist/sql/Count.js +38 -0
- package/dist/sql/Count.js.map +1 -0
- package/dist/sql/Count.mjs +15 -0
- package/dist/sql/Count.mjs.map +1 -0
- package/dist/sql/Delete.d.ts +4 -0
- package/dist/sql/Delete.js +35 -0
- package/dist/sql/Delete.js.map +1 -0
- package/dist/sql/Delete.mjs +12 -0
- package/dist/sql/Delete.mjs.map +1 -0
- package/dist/sql/Insert.d.ts +9 -0
- package/dist/sql/Insert.js +40 -0
- package/dist/sql/Insert.js.map +1 -0
- package/dist/sql/Insert.mjs +17 -0
- package/dist/sql/Insert.mjs.map +1 -0
- package/dist/sql/Join.d.ts +12 -0
- package/dist/sql/Join.js +46 -0
- package/dist/sql/Join.js.map +1 -0
- package/dist/sql/Join.mjs +23 -0
- package/dist/sql/Join.mjs.map +1 -0
- package/dist/sql/Select.d.ts +21 -0
- package/dist/sql/Select.js +68 -0
- package/dist/sql/Select.js.map +1 -0
- package/dist/sql/Select.mjs +45 -0
- package/dist/sql/Select.mjs.map +1 -0
- package/dist/sql/SqlQuery.d.ts +8 -0
- package/dist/sql/SqlQuery.js +39 -0
- package/dist/sql/SqlQuery.js.map +1 -0
- package/dist/sql/SqlQuery.mjs +16 -0
- package/dist/sql/SqlQuery.mjs.map +1 -0
- package/dist/sql/Table.d.ts +34 -0
- package/dist/sql/Table.js +63 -0
- package/dist/sql/Table.js.map +1 -0
- package/dist/sql/Table.mjs +40 -0
- package/dist/sql/Table.mjs.map +1 -0
- package/dist/sql/TableGateway.d.ts +18 -0
- package/dist/sql/TableGateway.js +62 -0
- package/dist/sql/TableGateway.js.map +1 -0
- package/dist/sql/TableGateway.mjs +39 -0
- package/dist/sql/TableGateway.mjs.map +1 -0
- package/dist/sql/Update.d.ts +9 -0
- package/dist/sql/Update.js +41 -0
- package/dist/sql/Update.js.map +1 -0
- package/dist/sql/Update.mjs +18 -0
- package/dist/sql/Update.mjs.map +1 -0
- package/dist/sql/index.d.ts +10 -0
- package/dist/sql/index.js +41 -0
- package/dist/sql/index.js.map +1 -0
- package/dist/sql/index.mjs +11 -0
- package/dist/sql/index.mjs.map +1 -0
- package/dist/types/Array.d.ts +9 -0
- package/dist/types/Array.js +54 -0
- package/dist/types/Array.js.map +1 -0
- package/dist/types/Array.mjs +29 -0
- package/dist/types/Array.mjs.map +1 -0
- package/dist/types/Builder.d.ts +6 -0
- package/dist/types/Builder.js +43 -0
- package/dist/types/Builder.js.map +1 -0
- package/dist/types/Builder.mjs +19 -0
- package/dist/types/Builder.mjs.map +1 -0
- package/dist/types/Cache.d.ts +12 -0
- package/dist/types/Cache.js +38 -0
- package/dist/types/Cache.js.map +1 -0
- package/dist/types/Cache.mjs +14 -0
- package/dist/types/Cache.mjs.map +1 -0
- package/dist/types/CacheAge.d.ts +5 -0
- package/dist/types/CacheAge.js +64 -0
- package/dist/types/CacheAge.js.map +1 -0
- package/dist/types/CacheAge.mjs +41 -0
- package/dist/types/CacheAge.mjs.map +1 -0
- package/dist/types/Case.d.ts +59 -0
- package/dist/types/Case.js +115 -0
- package/dist/types/Case.js.map +1 -0
- package/dist/types/Case.mjs +92 -0
- package/dist/types/Case.mjs.map +1 -0
- package/dist/types/Constructor.d.ts +15 -0
- package/dist/types/Constructor.js +50 -0
- package/dist/types/Constructor.js.map +1 -0
- package/dist/types/Constructor.mjs +22 -0
- package/dist/types/Constructor.mjs.map +1 -0
- package/dist/types/Context.d.ts +63 -0
- package/dist/types/Context.js +117 -0
- package/dist/types/Context.js.map +1 -0
- package/dist/types/Context.mjs +90 -0
- package/dist/types/Context.mjs.map +1 -0
- package/dist/types/Enum.d.ts +24 -0
- package/dist/types/Enum.js +76 -0
- package/dist/types/Enum.js.map +1 -0
- package/dist/types/Enum.mjs +52 -0
- package/dist/types/Enum.mjs.map +1 -0
- package/dist/types/ErrorOrigin.d.ts +6 -0
- package/dist/types/ErrorOrigin.js +17 -0
- package/dist/types/ErrorOrigin.js.map +1 -0
- package/dist/types/ErrorOrigin.mjs +1 -0
- package/dist/types/ErrorOrigin.mjs.map +1 -0
- package/dist/types/Exception.d.ts +20 -0
- package/dist/types/Exception.js +54 -0
- package/dist/types/Exception.js.map +1 -0
- package/dist/types/Exception.mjs +29 -0
- package/dist/types/Exception.mjs.map +1 -0
- package/dist/types/Falsy.d.ts +4 -0
- package/dist/types/Falsy.js +32 -0
- package/dist/types/Falsy.js.map +1 -0
- package/dist/types/Falsy.mjs +8 -0
- package/dist/types/Falsy.mjs.map +1 -0
- package/dist/types/Func.d.ts +2 -0
- package/dist/types/Func.js +29 -0
- package/dist/types/Func.js.map +1 -0
- package/dist/types/Func.mjs +6 -0
- package/dist/types/Func.mjs.map +1 -0
- package/dist/types/Gateway.d.ts +18 -0
- package/dist/types/Gateway.js +62 -0
- package/dist/types/Gateway.js.map +1 -0
- package/dist/types/Gateway.mjs +39 -0
- package/dist/types/Gateway.mjs.map +1 -0
- package/dist/types/Get.d.ts +7 -0
- package/dist/types/Get.js +36 -0
- package/dist/types/Get.js.map +1 -0
- package/dist/types/Get.mjs +11 -0
- package/dist/types/Get.mjs.map +1 -0
- package/dist/types/Id.d.ts +7 -0
- package/dist/types/Id.js +30 -0
- package/dist/types/Id.js.map +1 -0
- package/dist/types/Id.mjs +7 -0
- package/dist/types/Id.mjs.map +1 -0
- package/dist/types/Identity.d.ts +5 -0
- package/dist/types/Identity.js +17 -0
- package/dist/types/Identity.js.map +1 -0
- package/dist/types/Identity.mjs +1 -0
- package/dist/types/Identity.mjs.map +1 -0
- package/dist/types/Is.d.ts +20 -0
- package/dist/types/Is.js +85 -0
- package/dist/types/Is.js.map +1 -0
- package/dist/types/Is.mjs +44 -0
- package/dist/types/Is.mjs.map +1 -0
- package/dist/types/IsA.d.ts +2 -0
- package/dist/types/IsA.js +33 -0
- package/dist/types/IsA.js.map +1 -0
- package/dist/types/IsA.mjs +9 -0
- package/dist/types/IsA.mjs.map +1 -0
- package/dist/types/IsDate.d.ts +9 -0
- package/dist/types/IsDate.js +46 -0
- package/dist/types/IsDate.js.map +1 -0
- package/dist/types/IsDate.mjs +20 -0
- package/dist/types/IsDate.mjs.map +1 -0
- package/dist/types/IsEqual.d.ts +1 -0
- package/dist/types/IsEqual.js +39 -0
- package/dist/types/IsEqual.js.map +1 -0
- package/dist/types/IsEqual.mjs +16 -0
- package/dist/types/IsEqual.mjs.map +1 -0
- package/dist/types/Json.d.ts +30 -0
- package/dist/types/Json.js +67 -0
- package/dist/types/Json.js.map +1 -0
- package/dist/types/Json.mjs +40 -0
- package/dist/types/Json.mjs.map +1 -0
- package/dist/types/List.d.ts +52 -0
- package/dist/types/List.js +180 -0
- package/dist/types/List.js.map +1 -0
- package/dist/types/List.mjs +154 -0
- package/dist/types/List.mjs.map +1 -0
- package/dist/types/Message.d.ts +3 -0
- package/dist/types/Message.js +30 -0
- package/dist/types/Message.js.map +1 -0
- package/dist/types/Message.mjs +7 -0
- package/dist/types/Message.mjs.map +1 -0
- package/dist/types/Meta.d.ts +33 -0
- package/dist/types/Meta.js +71 -0
- package/dist/types/Meta.js.map +1 -0
- package/dist/types/Meta.mjs +47 -0
- package/dist/types/Meta.mjs.map +1 -0
- package/dist/types/Nullish.d.ts +2 -0
- package/dist/types/Nullish.js +29 -0
- package/dist/types/Nullish.js.map +1 -0
- package/dist/types/Nullish.mjs +6 -0
- package/dist/types/Nullish.mjs.map +1 -0
- package/dist/types/Number.d.ts +2 -0
- package/dist/types/Number.js +33 -0
- package/dist/types/Number.js.map +1 -0
- package/dist/types/Number.mjs +10 -0
- package/dist/types/Number.mjs.map +1 -0
- package/dist/types/PageList.d.ts +68 -0
- package/dist/types/PageList.js +156 -0
- package/dist/types/PageList.js.map +1 -0
- package/dist/types/PageList.mjs +128 -0
- package/dist/types/PageList.mjs.map +1 -0
- package/dist/types/Primitive.d.ts +2 -0
- package/dist/types/Primitive.js +32 -0
- package/dist/types/Primitive.js.map +1 -0
- package/dist/types/Primitive.mjs +9 -0
- package/dist/types/Primitive.mjs.map +1 -0
- package/dist/types/Repository.d.ts +15 -0
- package/dist/types/Repository.js +68 -0
- package/dist/types/Repository.js.map +1 -0
- package/dist/types/Repository.mjs +45 -0
- package/dist/types/Repository.mjs.map +1 -0
- package/dist/types/Result.d.ts +9 -0
- package/dist/types/Result.js +38 -0
- package/dist/types/Result.js.map +1 -0
- package/dist/types/Result.mjs +14 -0
- package/dist/types/Result.mjs.map +1 -0
- package/dist/types/Results.d.ts +12 -0
- package/dist/types/Results.js +51 -0
- package/dist/types/Results.js.map +1 -0
- package/dist/types/Results.mjs +26 -0
- package/dist/types/Results.mjs.map +1 -0
- package/dist/types/Sort.d.ts +8 -0
- package/dist/types/Sort.js +32 -0
- package/dist/types/Sort.js.map +1 -0
- package/dist/types/Sort.mjs +8 -0
- package/dist/types/Sort.mjs.map +1 -0
- package/dist/types/Tag.d.ts +2 -0
- package/dist/types/Tag.js +35 -0
- package/dist/types/Tag.js.map +1 -0
- package/dist/types/Tag.mjs +11 -0
- package/dist/types/Tag.mjs.map +1 -0
- package/dist/types/Template.d.ts +7 -0
- package/dist/types/Template.js +62 -0
- package/dist/types/Template.js.map +1 -0
- package/dist/types/Template.mjs +39 -0
- package/dist/types/Template.mjs.map +1 -0
- package/dist/types/Text.d.ts +45 -0
- package/dist/types/Text.js +127 -0
- package/dist/types/Text.js.map +1 -0
- package/dist/types/Text.mjs +99 -0
- package/dist/types/Text.mjs.map +1 -0
- package/dist/types/Try.d.ts +44 -0
- package/dist/types/Try.js +137 -0
- package/dist/types/Try.js.map +1 -0
- package/dist/types/Try.mjs +113 -0
- package/dist/types/Try.mjs.map +1 -0
- package/dist/types/TypeGuard.d.ts +1 -0
- package/dist/types/TypeGuard.js +17 -0
- package/dist/types/TypeGuard.js.map +1 -0
- package/dist/types/TypeGuard.mjs +1 -0
- package/dist/types/TypeGuard.mjs.map +1 -0
- package/dist/types/Types.d.ts +5 -0
- package/dist/types/Types.js +17 -0
- package/dist/types/Types.js.map +1 -0
- package/dist/types/Types.mjs +1 -0
- package/dist/types/Types.mjs.map +1 -0
- package/dist/types/Uri.d.ts +69 -0
- package/dist/types/Uri.js +104 -0
- package/dist/types/Uri.js.map +1 -0
- package/dist/types/Uri.mjs +79 -0
- package/dist/types/Uri.mjs.map +1 -0
- package/dist/types/Uuid.d.ts +3 -0
- package/dist/types/Uuid.js +35 -0
- package/dist/types/Uuid.js.map +1 -0
- package/dist/types/Uuid.mjs +11 -0
- package/dist/types/Uuid.mjs.map +1 -0
- package/dist/types/Validatable.d.ts +5 -0
- package/dist/types/Validatable.js +30 -0
- package/dist/types/Validatable.js.map +1 -0
- package/dist/types/Validatable.mjs +7 -0
- package/dist/types/Validatable.mjs.map +1 -0
- package/dist/types/Value.d.ts +9 -0
- package/dist/types/Value.js +47 -0
- package/dist/types/Value.js.map +1 -0
- package/dist/types/Value.mjs +23 -0
- package/dist/types/Value.mjs.map +1 -0
- package/dist/types/index.d.ts +42 -0
- package/dist/types/index.js +105 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/index.mjs +43 -0
- package/dist/types/index.mjs.map +1 -0
- package/dist/utils/Convert.d.ts +19 -0
- package/dist/utils/Convert.js +69 -0
- package/dist/utils/Convert.js.map +1 -0
- package/dist/utils/Convert.mjs +45 -0
- package/dist/utils/Convert.mjs.map +1 -0
- package/dist/utils/If.d.ts +10 -0
- package/dist/utils/If.js +47 -0
- package/dist/utils/If.js.map +1 -0
- package/dist/utils/If.mjs +21 -0
- package/dist/utils/If.mjs.map +1 -0
- package/dist/utils/Loading.d.ts +1 -0
- package/dist/utils/Loading.js +30 -0
- package/dist/utils/Loading.js.map +1 -0
- package/dist/utils/Loading.mjs +7 -0
- package/dist/utils/Loading.mjs.map +1 -0
- package/dist/utils/Log.d.ts +2 -0
- package/dist/utils/Log.js +37 -0
- package/dist/utils/Log.js.map +1 -0
- package/dist/utils/Log.mjs +14 -0
- package/dist/utils/Log.mjs.map +1 -0
- package/dist/utils/Mapper.d.ts +48 -0
- package/dist/utils/Mapper.js +133 -0
- package/dist/utils/Mapper.js.map +1 -0
- package/dist/utils/Mapper.mjs +108 -0
- package/dist/utils/Mapper.mjs.map +1 -0
- package/dist/utils/Promise.d.ts +18 -0
- package/dist/utils/Promise.js +55 -0
- package/dist/utils/Promise.js.map +1 -0
- package/dist/utils/Promise.mjs +26 -0
- package/dist/utils/Promise.mjs.map +1 -0
- package/dist/utils/Property.d.ts +16 -0
- package/dist/utils/Property.js +42 -0
- package/dist/utils/Property.js.map +1 -0
- package/dist/utils/Property.mjs +19 -0
- package/dist/utils/Property.mjs.map +1 -0
- package/dist/utils/Sentence.d.ts +48 -0
- package/dist/utils/Sentence.js +80 -0
- package/dist/utils/Sentence.js.map +1 -0
- package/dist/utils/Sentence.mjs +56 -0
- package/dist/utils/Sentence.mjs.map +1 -0
- package/dist/utils/State.d.ts +7 -0
- package/dist/utils/State.js +36 -0
- package/dist/utils/State.js.map +1 -0
- package/dist/utils/State.mjs +13 -0
- package/dist/utils/State.mjs.map +1 -0
- package/dist/utils/Traverse.d.ts +1 -0
- package/dist/utils/Traverse.js +33 -0
- package/dist/utils/Traverse.js.map +1 -0
- package/dist/utils/Traverse.mjs +10 -0
- package/dist/utils/Traverse.mjs.map +1 -0
- package/dist/utils/View.d.ts +36 -0
- package/dist/utils/View.js +86 -0
- package/dist/utils/View.js.map +1 -0
- package/dist/utils/View.mjs +73 -0
- package/dist/utils/View.mjs.map +1 -0
- package/dist/utils/Wait.d.ts +5 -0
- package/dist/utils/Wait.js +39 -0
- package/dist/utils/Wait.js.map +1 -0
- package/dist/utils/Wait.mjs +15 -0
- package/dist/utils/Wait.mjs.map +1 -0
- package/dist/utils/index.d.ts +12 -0
- package/dist/utils/index.js +45 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/index.mjs +13 -0
- package/dist/utils/index.mjs.map +1 -0
- package/dist/validation/Contraints.d.ts +19 -0
- package/dist/validation/Contraints.js +88 -0
- package/dist/validation/Contraints.js.map +1 -0
- package/dist/validation/Contraints.mjs +49 -0
- package/dist/validation/Contraints.mjs.map +1 -0
- package/dist/validation/Validate.d.ts +11 -0
- package/dist/validation/Validate.js +43 -0
- package/dist/validation/Validate.js.map +1 -0
- package/dist/validation/Validate.mjs +34 -0
- package/dist/validation/Validate.mjs.map +1 -0
- package/dist/validation/When.d.ts +22 -0
- package/dist/validation/When.js +68 -0
- package/dist/validation/When.js.map +1 -0
- package/dist/validation/When.mjs +44 -0
- package/dist/validation/When.mjs.map +1 -0
- package/dist/validation/index.d.ts +3 -0
- package/dist/validation/index.js +27 -0
- package/dist/validation/index.js.map +1 -0
- package/dist/validation/index.mjs +4 -0
- package/dist/validation/index.mjs.map +1 -0
- package/package.json +4 -4
- package/dist/index.d.mts +0 -2821
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Id } from './Id';
|
|
2
|
+
import { List } from './List';
|
|
3
|
+
import { Validatable } from './Validatable';
|
|
4
|
+
import { JsonValue } from './Json';
|
|
5
|
+
import { Get } from './Get';
|
|
6
|
+
import { TypeGuard } from './TypeGuard';
|
|
7
|
+
export declare abstract class Enum implements Validatable {
|
|
8
|
+
readonly name: string;
|
|
9
|
+
readonly id: Id;
|
|
10
|
+
readonly code: string;
|
|
11
|
+
protected constructor(name: string, id?: Id, code?: string);
|
|
12
|
+
get isValid(): boolean;
|
|
13
|
+
static all<E extends Enum>(): List<E>;
|
|
14
|
+
protected static allTuple<E extends Enum>(): Record<Id, E>;
|
|
15
|
+
static filter<E extends Enum>(p: (value: E, index: number, array: E[]) => unknown, params?: unknown): List<E>;
|
|
16
|
+
static first<E extends Enum>(p?: (value: E, index: number, array: E[]) => unknown, params?: unknown): E;
|
|
17
|
+
static byIds<E extends Enum>(ids?: Id[]): List<E>;
|
|
18
|
+
static byId<E extends Enum>(id: Id, alt?: Get<E, unknown>): E;
|
|
19
|
+
equals<E extends Enum>(other: E | Id): other is E;
|
|
20
|
+
isIn<E extends Enum>(...items: E[] | Id[]): boolean;
|
|
21
|
+
toJSON(): JsonValue;
|
|
22
|
+
toString(): string;
|
|
23
|
+
}
|
|
24
|
+
export declare const isEnum: TypeGuard<Enum>;
|
|
@@ -0,0 +1,76 @@
|
|
|
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 Enum_exports = {};
|
|
20
|
+
__export(Enum_exports, {
|
|
21
|
+
Enum: () => Enum,
|
|
22
|
+
isEnum: () => isEnum
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(Enum_exports);
|
|
25
|
+
var import_List = require("./List");
|
|
26
|
+
var import_IsA = require("./IsA");
|
|
27
|
+
var import_Meta = require("./Meta");
|
|
28
|
+
var import_Is = require("./Is");
|
|
29
|
+
var import_Get = require("./Get");
|
|
30
|
+
class Enum {
|
|
31
|
+
constructor(name, id = name.toLowerCase(), code = id.toString()) {
|
|
32
|
+
this.name = name;
|
|
33
|
+
this.id = id;
|
|
34
|
+
this.code = code;
|
|
35
|
+
}
|
|
36
|
+
get isValid() {
|
|
37
|
+
return (0, import_Is.isDefined)(this.id);
|
|
38
|
+
}
|
|
39
|
+
static all() {
|
|
40
|
+
return (0, import_Meta.meta)(this.allTuple()).values();
|
|
41
|
+
}
|
|
42
|
+
static allTuple() {
|
|
43
|
+
return (0, import_Meta.meta)(this).get(`all-${this.name}`) ?? (0, import_Meta.meta)(this).set(`all-${this.name}`, (0, import_Meta.meta)(this).values().filter(isEnum).toObject("id"));
|
|
44
|
+
}
|
|
45
|
+
static filter(p, params) {
|
|
46
|
+
return this.all().filter(p, params);
|
|
47
|
+
}
|
|
48
|
+
static first(p, params) {
|
|
49
|
+
return this.all().first(p, params);
|
|
50
|
+
}
|
|
51
|
+
static byIds(ids = []) {
|
|
52
|
+
return (0, import_List.toList)(ids).mapDefined((id) => this.byId(id)).distinct();
|
|
53
|
+
}
|
|
54
|
+
static byId(id, alt) {
|
|
55
|
+
return this.allTuple()[id] ?? (0, import_Get.ofGet)(alt);
|
|
56
|
+
}
|
|
57
|
+
equals(other) {
|
|
58
|
+
return this.id === (isEnum(other) ? other.id : other);
|
|
59
|
+
}
|
|
60
|
+
isIn(...items) {
|
|
61
|
+
return items.some((i) => this.equals(i));
|
|
62
|
+
}
|
|
63
|
+
toJSON() {
|
|
64
|
+
return this.id;
|
|
65
|
+
}
|
|
66
|
+
toString() {
|
|
67
|
+
return this.id.toString();
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
const isEnum = (e) => (0, import_Is.isDefined)(e) && e instanceof Enum && (0, import_IsA.isAn)(e, "name", "id", "code");
|
|
71
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
72
|
+
0 && (module.exports = {
|
|
73
|
+
Enum,
|
|
74
|
+
isEnum
|
|
75
|
+
});
|
|
76
|
+
//# sourceMappingURL=Enum.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/types/Enum.ts"],"sourcesContent":["import { Id } from './Id';\nimport { List, toList } from './List';\nimport { isAn } from './IsA';\nimport { meta } from './Meta';\nimport { isDefined } from './Is';\nimport { Validatable } from './Validatable';\nimport { JsonValue } from './Json';\nimport { Get, ofGet } from './Get';\nimport { TypeGuard } from './TypeGuard';\n\nexport abstract class Enum implements Validatable {\n protected constructor(readonly name: string, readonly id: Id = name.toLowerCase(), readonly code: string = id.toString()) {}\n\n get isValid(): boolean {\n return isDefined(this.id);\n }\n\n static all<E extends Enum>(): List<E> {\n return meta(this.allTuple<E>()).values<E>();\n }\n\n protected static allTuple<E extends Enum>(): Record<Id, E> {\n return meta(this).get(`all-${this.name}`) ?? meta(this).set(`all-${this.name}`, meta(this).values<E>().filter(isEnum).toObject('id'));\n }\n\n static filter<E extends Enum>(p: (value: E, index: number, array: E[]) => unknown, params?: unknown): List<E> {\n return this.all<E>().filter(p, params);\n }\n\n static first<E extends Enum>(p?: (value: E, index: number, array: E[]) => unknown, params?: unknown): E {\n return this.all<E>().first(p, params);\n }\n\n static byIds<E extends Enum>(ids: Id[] = []): List<E> {\n return toList(ids)\n .mapDefined(id => this.byId<E>(id))\n .distinct();\n }\n\n static byId<E extends Enum>(id: Id, alt?: Get<E, unknown>): E {\n return this.allTuple<E>()[id] ?? ofGet(alt);\n }\n\n equals<E extends Enum>(other: E | Id): other is E {\n return this.id === (isEnum(other) ? other.id : other);\n }\n\n isIn<E extends Enum>(...items: E[] | Id[]): boolean {\n return items.some(i => this.equals(i));\n }\n\n toJSON(): JsonValue {\n return this.id;\n }\n\n toString(): string {\n return this.id.toString();\n }\n}\n\nexport const isEnum: TypeGuard<Enum> = (e?: unknown): e is Enum => isDefined(e) && e instanceof Enum && isAn<Enum>(e, 'name', 'id', 'code');\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,kBAA6B;AAC7B,iBAAqB;AACrB,kBAAqB;AACrB,gBAA0B;AAG1B,iBAA2B;AAGpB,MAAe,KAA4B;AAAA,EACtC,YAAqB,MAAuB,KAAS,KAAK,YAAY,GAAY,OAAe,GAAG,SAAS,GAAG;AAA3F;AAAuB;AAAsC;AAAA,EAA+B;AAAA,EAE3H,IAAI,UAAmB;AACrB,eAAO,qBAAU,KAAK,EAAE;AAAA,EAC1B;AAAA,EAEA,OAAO,MAA+B;AACpC,eAAO,kBAAK,KAAK,SAAY,CAAC,EAAE,OAAU;AAAA,EAC5C;AAAA,EAEA,OAAiB,WAA0C;AACzD,eAAO,kBAAK,IAAI,EAAE,IAAI,OAAO,KAAK,IAAI,EAAE,SAAK,kBAAK,IAAI,EAAE,IAAI,OAAO,KAAK,IAAI,QAAI,kBAAK,IAAI,EAAE,OAAU,EAAE,OAAO,MAAM,EAAE,SAAS,IAAI,CAAC;AAAA,EACtI;AAAA,EAEA,OAAO,OAAuB,GAAqD,QAA2B;AAC5G,WAAO,KAAK,IAAO,EAAE,OAAO,GAAG,MAAM;AAAA,EACvC;AAAA,EAEA,OAAO,MAAsB,GAAsD,QAAqB;AACtG,WAAO,KAAK,IAAO,EAAE,MAAM,GAAG,MAAM;AAAA,EACtC;AAAA,EAEA,OAAO,MAAsB,MAAY,CAAC,GAAY;AACpD,eAAO,oBAAO,GAAG,EACd,WAAW,QAAM,KAAK,KAAQ,EAAE,CAAC,EACjC,SAAS;AAAA,EACd;AAAA,EAEA,OAAO,KAAqB,IAAQ,KAA0B;AAC5D,WAAO,KAAK,SAAY,EAAE,EAAE,SAAK,kBAAM,GAAG;AAAA,EAC5C;AAAA,EAEA,OAAuB,OAA2B;AAChD,WAAO,KAAK,QAAQ,OAAO,KAAK,IAAI,MAAM,KAAK;AAAA,EACjD;AAAA,EAEA,QAAwB,OAA4B;AAClD,WAAO,MAAM,KAAK,OAAK,KAAK,OAAO,CAAC,CAAC;AAAA,EACvC;AAAA,EAEA,SAAoB;AAClB,WAAO,KAAK;AAAA,EACd;AAAA,EAEA,WAAmB;AACjB,WAAO,KAAK,GAAG,SAAS;AAAA,EAC1B;AACF;AAEO,MAAM,SAA0B,CAAC,UAA2B,qBAAU,CAAC,KAAK,aAAa,YAAQ,iBAAW,GAAG,QAAQ,MAAM,MAAM;","names":[]}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import "../chunk-4N72FQFX.mjs";
|
|
2
|
+
import { toList } from "./List";
|
|
3
|
+
import { isAn } from "./IsA";
|
|
4
|
+
import { meta } from "./Meta";
|
|
5
|
+
import { isDefined } from "./Is";
|
|
6
|
+
import { ofGet } from "./Get";
|
|
7
|
+
class Enum {
|
|
8
|
+
constructor(name, id = name.toLowerCase(), code = id.toString()) {
|
|
9
|
+
this.name = name;
|
|
10
|
+
this.id = id;
|
|
11
|
+
this.code = code;
|
|
12
|
+
}
|
|
13
|
+
get isValid() {
|
|
14
|
+
return isDefined(this.id);
|
|
15
|
+
}
|
|
16
|
+
static all() {
|
|
17
|
+
return meta(this.allTuple()).values();
|
|
18
|
+
}
|
|
19
|
+
static allTuple() {
|
|
20
|
+
return meta(this).get(`all-${this.name}`) ?? meta(this).set(`all-${this.name}`, meta(this).values().filter(isEnum).toObject("id"));
|
|
21
|
+
}
|
|
22
|
+
static filter(p, params) {
|
|
23
|
+
return this.all().filter(p, params);
|
|
24
|
+
}
|
|
25
|
+
static first(p, params) {
|
|
26
|
+
return this.all().first(p, params);
|
|
27
|
+
}
|
|
28
|
+
static byIds(ids = []) {
|
|
29
|
+
return toList(ids).mapDefined((id) => this.byId(id)).distinct();
|
|
30
|
+
}
|
|
31
|
+
static byId(id, alt) {
|
|
32
|
+
return this.allTuple()[id] ?? ofGet(alt);
|
|
33
|
+
}
|
|
34
|
+
equals(other) {
|
|
35
|
+
return this.id === (isEnum(other) ? other.id : other);
|
|
36
|
+
}
|
|
37
|
+
isIn(...items) {
|
|
38
|
+
return items.some((i) => this.equals(i));
|
|
39
|
+
}
|
|
40
|
+
toJSON() {
|
|
41
|
+
return this.id;
|
|
42
|
+
}
|
|
43
|
+
toString() {
|
|
44
|
+
return this.id.toString();
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
const isEnum = (e) => isDefined(e) && e instanceof Enum && isAn(e, "name", "id", "code");
|
|
48
|
+
export {
|
|
49
|
+
Enum,
|
|
50
|
+
isEnum
|
|
51
|
+
};
|
|
52
|
+
//# sourceMappingURL=Enum.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/types/Enum.ts"],"sourcesContent":["import { Id } from './Id';\nimport { List, toList } from './List';\nimport { isAn } from './IsA';\nimport { meta } from './Meta';\nimport { isDefined } from './Is';\nimport { Validatable } from './Validatable';\nimport { JsonValue } from './Json';\nimport { Get, ofGet } from './Get';\nimport { TypeGuard } from './TypeGuard';\n\nexport abstract class Enum implements Validatable {\n protected constructor(readonly name: string, readonly id: Id = name.toLowerCase(), readonly code: string = id.toString()) {}\n\n get isValid(): boolean {\n return isDefined(this.id);\n }\n\n static all<E extends Enum>(): List<E> {\n return meta(this.allTuple<E>()).values<E>();\n }\n\n protected static allTuple<E extends Enum>(): Record<Id, E> {\n return meta(this).get(`all-${this.name}`) ?? meta(this).set(`all-${this.name}`, meta(this).values<E>().filter(isEnum).toObject('id'));\n }\n\n static filter<E extends Enum>(p: (value: E, index: number, array: E[]) => unknown, params?: unknown): List<E> {\n return this.all<E>().filter(p, params);\n }\n\n static first<E extends Enum>(p?: (value: E, index: number, array: E[]) => unknown, params?: unknown): E {\n return this.all<E>().first(p, params);\n }\n\n static byIds<E extends Enum>(ids: Id[] = []): List<E> {\n return toList(ids)\n .mapDefined(id => this.byId<E>(id))\n .distinct();\n }\n\n static byId<E extends Enum>(id: Id, alt?: Get<E, unknown>): E {\n return this.allTuple<E>()[id] ?? ofGet(alt);\n }\n\n equals<E extends Enum>(other: E | Id): other is E {\n return this.id === (isEnum(other) ? other.id : other);\n }\n\n isIn<E extends Enum>(...items: E[] | Id[]): boolean {\n return items.some(i => this.equals(i));\n }\n\n toJSON(): JsonValue {\n return this.id;\n }\n\n toString(): string {\n return this.id.toString();\n }\n}\n\nexport const isEnum: TypeGuard<Enum> = (e?: unknown): e is Enum => isDefined(e) && e instanceof Enum && isAn<Enum>(e, 'name', 'id', 'code');\n"],"mappings":";AACA,SAAe,cAAc;AAC7B,SAAS,YAAY;AACrB,SAAS,YAAY;AACrB,SAAS,iBAAiB;AAG1B,SAAc,aAAa;AAGpB,MAAe,KAA4B;AAAA,EACtC,YAAqB,MAAuB,KAAS,KAAK,YAAY,GAAY,OAAe,GAAG,SAAS,GAAG;AAA3F;AAAuB;AAAsC;AAAA,EAA+B;AAAA,EAE3H,IAAI,UAAmB;AACrB,WAAO,UAAU,KAAK,EAAE;AAAA,EAC1B;AAAA,EAEA,OAAO,MAA+B;AACpC,WAAO,KAAK,KAAK,SAAY,CAAC,EAAE,OAAU;AAAA,EAC5C;AAAA,EAEA,OAAiB,WAA0C;AACzD,WAAO,KAAK,IAAI,EAAE,IAAI,OAAO,KAAK,IAAI,EAAE,KAAK,KAAK,IAAI,EAAE,IAAI,OAAO,KAAK,IAAI,IAAI,KAAK,IAAI,EAAE,OAAU,EAAE,OAAO,MAAM,EAAE,SAAS,IAAI,CAAC;AAAA,EACtI;AAAA,EAEA,OAAO,OAAuB,GAAqD,QAA2B;AAC5G,WAAO,KAAK,IAAO,EAAE,OAAO,GAAG,MAAM;AAAA,EACvC;AAAA,EAEA,OAAO,MAAsB,GAAsD,QAAqB;AACtG,WAAO,KAAK,IAAO,EAAE,MAAM,GAAG,MAAM;AAAA,EACtC;AAAA,EAEA,OAAO,MAAsB,MAAY,CAAC,GAAY;AACpD,WAAO,OAAO,GAAG,EACd,WAAW,QAAM,KAAK,KAAQ,EAAE,CAAC,EACjC,SAAS;AAAA,EACd;AAAA,EAEA,OAAO,KAAqB,IAAQ,KAA0B;AAC5D,WAAO,KAAK,SAAY,EAAE,EAAE,KAAK,MAAM,GAAG;AAAA,EAC5C;AAAA,EAEA,OAAuB,OAA2B;AAChD,WAAO,KAAK,QAAQ,OAAO,KAAK,IAAI,MAAM,KAAK;AAAA,EACjD;AAAA,EAEA,QAAwB,OAA4B;AAClD,WAAO,MAAM,KAAK,OAAK,KAAK,OAAO,CAAC,CAAC;AAAA,EACvC;AAAA,EAEA,SAAoB;AAClB,WAAO,KAAK;AAAA,EACd;AAAA,EAEA,WAAmB;AACjB,WAAO,KAAK,GAAG,SAAS;AAAA,EAC1B;AACF;AAEO,MAAM,SAA0B,CAAC,MAA2B,UAAU,CAAC,KAAK,aAAa,QAAQ,KAAW,GAAG,QAAQ,MAAM,MAAM;","names":[]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Text } from './Text';
|
|
2
|
+
import { Exception } from './Exception';
|
|
3
|
+
import { Response } from '../http';
|
|
4
|
+
import { Results } from './Results';
|
|
5
|
+
import { Result } from './Result';
|
|
6
|
+
export type ErrorOrigin = Text | Error | Exception | Response | Results | Result;
|
|
@@ -0,0 +1,17 @@
|
|
|
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 ErrorOrigin_exports = {};
|
|
16
|
+
module.exports = __toCommonJS(ErrorOrigin_exports);
|
|
17
|
+
//# sourceMappingURL=ErrorOrigin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/types/ErrorOrigin.ts"],"sourcesContent":["import { Text } from './Text';\nimport { Exception } from './Exception';\nimport { Response } from '../http';\nimport { Results } from './Results';\nimport { Result } from './Result';\n\nexport type ErrorOrigin = Text | Error | Exception | Response | Results | Result;\n"],"mappings":";;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=ErrorOrigin.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Text } from './Text';
|
|
2
|
+
import { Enum } from './Enum';
|
|
3
|
+
import { Id } from './Id';
|
|
4
|
+
export declare class Exception extends Enum {
|
|
5
|
+
readonly message: string;
|
|
6
|
+
readonly reason?: Text | undefined;
|
|
7
|
+
static readonly AlreadyExists: Exception;
|
|
8
|
+
static readonly DoesNotExist: Exception;
|
|
9
|
+
static readonly IsMissingId: Exception;
|
|
10
|
+
static readonly IsNotImplemented: Exception;
|
|
11
|
+
static readonly IsNotValid: Exception;
|
|
12
|
+
static readonly Unknown: Exception;
|
|
13
|
+
constructor(message: string, id?: Id, reason?: Text | undefined);
|
|
14
|
+
static readonly CouldNotExecute: (target: Text) => Exception;
|
|
15
|
+
static readonly CouldNotValidate: (target: Text) => Exception;
|
|
16
|
+
static readonly EnvironmentVariableNotFound: (variable: Text) => Exception;
|
|
17
|
+
because: (reason: Text) => Exception;
|
|
18
|
+
}
|
|
19
|
+
export declare const isException: (e?: unknown, t?: Text) => e is Exception;
|
|
20
|
+
export declare const isDoesNotExist: (e?: unknown) => e is Exception;
|
|
@@ -0,0 +1,54 @@
|
|
|
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 Exception_exports = {};
|
|
20
|
+
__export(Exception_exports, {
|
|
21
|
+
Exception: () => Exception,
|
|
22
|
+
isDoesNotExist: () => isDoesNotExist,
|
|
23
|
+
isException: () => isException
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(Exception_exports);
|
|
26
|
+
var import_Text = require("./Text");
|
|
27
|
+
var import_Enum = require("./Enum");
|
|
28
|
+
var import_Is = require("./Is");
|
|
29
|
+
class Exception extends import_Enum.Enum {
|
|
30
|
+
constructor(message, id, reason) {
|
|
31
|
+
super(message, id ?? (0, import_Text.text)(message).pascal.toString());
|
|
32
|
+
this.message = message;
|
|
33
|
+
this.reason = reason;
|
|
34
|
+
}
|
|
35
|
+
static AlreadyExists = new Exception("Subject already exists");
|
|
36
|
+
static DoesNotExist = new Exception("Does not exist");
|
|
37
|
+
static IsMissingId = new Exception("Subject is missing an id");
|
|
38
|
+
static IsNotImplemented = new Exception("Is not implemented");
|
|
39
|
+
static IsNotValid = new Exception("Is not valid");
|
|
40
|
+
static Unknown = new Exception("Unknown error");
|
|
41
|
+
static CouldNotExecute = (target) => new Exception(`Could not execute ${target}.`, "CouldNotExecute");
|
|
42
|
+
static CouldNotValidate = (target) => new Exception(`Could not validate ${target}.`, "CouldNotValidate");
|
|
43
|
+
static EnvironmentVariableNotFound = (variable) => new Exception(`Environment variable ${(0, import_Text.text)(variable).upper} could not be found.`, "EnvironmentVariableNotFound");
|
|
44
|
+
because = (reason) => new Exception(this.message, this.id, reason);
|
|
45
|
+
}
|
|
46
|
+
const isException = (e, t) => e instanceof Exception && ((0, import_Is.isDefined)(t) ? e.equals((0, import_Text.asString)(t)) : true);
|
|
47
|
+
const isDoesNotExist = (e) => e instanceof Exception && Exception.DoesNotExist.equals(e);
|
|
48
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
49
|
+
0 && (module.exports = {
|
|
50
|
+
Exception,
|
|
51
|
+
isDoesNotExist,
|
|
52
|
+
isException
|
|
53
|
+
});
|
|
54
|
+
//# sourceMappingURL=Exception.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/types/Exception.ts"],"sourcesContent":["import { asString, Text, text } from './Text';\nimport { Enum } from './Enum';\nimport { isDefined } from './Is';\nimport { Id } from './Id';\n\nexport class Exception extends Enum {\n static readonly AlreadyExists = new Exception('Subject already exists');\n static readonly DoesNotExist = new Exception('Does not exist');\n static readonly IsMissingId = new Exception('Subject is missing an id');\n static readonly IsNotImplemented = new Exception('Is not implemented');\n static readonly IsNotValid = new Exception('Is not valid');\n static readonly Unknown = new Exception('Unknown error');\n\n constructor(readonly message: string, id?: Id, readonly reason?: Text) {\n super(message, id ?? text(message).pascal.toString());\n }\n\n static readonly CouldNotExecute = (target: Text): Exception => new Exception(`Could not execute ${target}.`, 'CouldNotExecute');\n\n static readonly CouldNotValidate = (target: Text): Exception => new Exception(`Could not validate ${target}.`, 'CouldNotValidate');\n\n static readonly EnvironmentVariableNotFound = (variable: Text): Exception =>\n new Exception(`Environment variable ${text(variable).upper} could not be found.`, 'EnvironmentVariableNotFound');\n\n because = (reason: Text): Exception => new Exception(this.message, this.id, reason);\n}\n\nexport const isException = (e?: unknown, t?: Text): e is Exception => e instanceof Exception && (isDefined(t) ? e.equals(asString(t)) : true);\nexport const isDoesNotExist = (e?: unknown): e is Exception => e instanceof Exception && Exception.DoesNotExist.equals(e);\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAqC;AACrC,kBAAqB;AACrB,gBAA0B;AAGnB,MAAM,kBAAkB,iBAAK;AAAA,EAQlC,YAAqB,SAAiB,IAAkB,QAAe;AACrE,UAAM,SAAS,UAAM,kBAAK,OAAO,EAAE,OAAO,SAAS,CAAC;AADjC;AAAmC;AAAA,EAExD;AAAA,EATA,OAAgB,gBAAgB,IAAI,UAAU,wBAAwB;AAAA,EACtE,OAAgB,eAAe,IAAI,UAAU,gBAAgB;AAAA,EAC7D,OAAgB,cAAc,IAAI,UAAU,0BAA0B;AAAA,EACtE,OAAgB,mBAAmB,IAAI,UAAU,oBAAoB;AAAA,EACrE,OAAgB,aAAa,IAAI,UAAU,cAAc;AAAA,EACzD,OAAgB,UAAU,IAAI,UAAU,eAAe;AAAA,EAMvD,OAAgB,kBAAkB,CAAC,WAA4B,IAAI,UAAU,qBAAqB,MAAM,KAAK,iBAAiB;AAAA,EAE9H,OAAgB,mBAAmB,CAAC,WAA4B,IAAI,UAAU,sBAAsB,MAAM,KAAK,kBAAkB;AAAA,EAEjI,OAAgB,8BAA8B,CAAC,aAC7C,IAAI,UAAU,4BAAwB,kBAAK,QAAQ,EAAE,KAAK,wBAAwB,6BAA6B;AAAA,EAEjH,UAAU,CAAC,WAA4B,IAAI,UAAU,KAAK,SAAS,KAAK,IAAI,MAAM;AACpF;AAEO,MAAM,cAAc,CAAC,GAAa,MAA6B,aAAa,kBAAc,qBAAU,CAAC,IAAI,EAAE,WAAO,sBAAS,CAAC,CAAC,IAAI;AACjI,MAAM,iBAAiB,CAAC,MAAgC,aAAa,aAAa,UAAU,aAAa,OAAO,CAAC;","names":[]}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import "../chunk-4N72FQFX.mjs";
|
|
2
|
+
import { asString, text } from "./Text";
|
|
3
|
+
import { Enum } from "./Enum";
|
|
4
|
+
import { isDefined } from "./Is";
|
|
5
|
+
class Exception extends Enum {
|
|
6
|
+
constructor(message, id, reason) {
|
|
7
|
+
super(message, id ?? text(message).pascal.toString());
|
|
8
|
+
this.message = message;
|
|
9
|
+
this.reason = reason;
|
|
10
|
+
}
|
|
11
|
+
static AlreadyExists = new Exception("Subject already exists");
|
|
12
|
+
static DoesNotExist = new Exception("Does not exist");
|
|
13
|
+
static IsMissingId = new Exception("Subject is missing an id");
|
|
14
|
+
static IsNotImplemented = new Exception("Is not implemented");
|
|
15
|
+
static IsNotValid = new Exception("Is not valid");
|
|
16
|
+
static Unknown = new Exception("Unknown error");
|
|
17
|
+
static CouldNotExecute = (target) => new Exception(`Could not execute ${target}.`, "CouldNotExecute");
|
|
18
|
+
static CouldNotValidate = (target) => new Exception(`Could not validate ${target}.`, "CouldNotValidate");
|
|
19
|
+
static EnvironmentVariableNotFound = (variable) => new Exception(`Environment variable ${text(variable).upper} could not be found.`, "EnvironmentVariableNotFound");
|
|
20
|
+
because = (reason) => new Exception(this.message, this.id, reason);
|
|
21
|
+
}
|
|
22
|
+
const isException = (e, t) => e instanceof Exception && (isDefined(t) ? e.equals(asString(t)) : true);
|
|
23
|
+
const isDoesNotExist = (e) => e instanceof Exception && Exception.DoesNotExist.equals(e);
|
|
24
|
+
export {
|
|
25
|
+
Exception,
|
|
26
|
+
isDoesNotExist,
|
|
27
|
+
isException
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=Exception.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/types/Exception.ts"],"sourcesContent":["import { asString, Text, text } from './Text';\nimport { Enum } from './Enum';\nimport { isDefined } from './Is';\nimport { Id } from './Id';\n\nexport class Exception extends Enum {\n static readonly AlreadyExists = new Exception('Subject already exists');\n static readonly DoesNotExist = new Exception('Does not exist');\n static readonly IsMissingId = new Exception('Subject is missing an id');\n static readonly IsNotImplemented = new Exception('Is not implemented');\n static readonly IsNotValid = new Exception('Is not valid');\n static readonly Unknown = new Exception('Unknown error');\n\n constructor(readonly message: string, id?: Id, readonly reason?: Text) {\n super(message, id ?? text(message).pascal.toString());\n }\n\n static readonly CouldNotExecute = (target: Text): Exception => new Exception(`Could not execute ${target}.`, 'CouldNotExecute');\n\n static readonly CouldNotValidate = (target: Text): Exception => new Exception(`Could not validate ${target}.`, 'CouldNotValidate');\n\n static readonly EnvironmentVariableNotFound = (variable: Text): Exception =>\n new Exception(`Environment variable ${text(variable).upper} could not be found.`, 'EnvironmentVariableNotFound');\n\n because = (reason: Text): Exception => new Exception(this.message, this.id, reason);\n}\n\nexport const isException = (e?: unknown, t?: Text): e is Exception => e instanceof Exception && (isDefined(t) ? e.equals(asString(t)) : true);\nexport const isDoesNotExist = (e?: unknown): e is Exception => e instanceof Exception && Exception.DoesNotExist.equals(e);\n"],"mappings":";AAAA,SAAS,UAAgB,YAAY;AACrC,SAAS,YAAY;AACrB,SAAS,iBAAiB;AAGnB,MAAM,kBAAkB,KAAK;AAAA,EAQlC,YAAqB,SAAiB,IAAkB,QAAe;AACrE,UAAM,SAAS,MAAM,KAAK,OAAO,EAAE,OAAO,SAAS,CAAC;AADjC;AAAmC;AAAA,EAExD;AAAA,EATA,OAAgB,gBAAgB,IAAI,UAAU,wBAAwB;AAAA,EACtE,OAAgB,eAAe,IAAI,UAAU,gBAAgB;AAAA,EAC7D,OAAgB,cAAc,IAAI,UAAU,0BAA0B;AAAA,EACtE,OAAgB,mBAAmB,IAAI,UAAU,oBAAoB;AAAA,EACrE,OAAgB,aAAa,IAAI,UAAU,cAAc;AAAA,EACzD,OAAgB,UAAU,IAAI,UAAU,eAAe;AAAA,EAMvD,OAAgB,kBAAkB,CAAC,WAA4B,IAAI,UAAU,qBAAqB,MAAM,KAAK,iBAAiB;AAAA,EAE9H,OAAgB,mBAAmB,CAAC,WAA4B,IAAI,UAAU,sBAAsB,MAAM,KAAK,kBAAkB;AAAA,EAEjI,OAAgB,8BAA8B,CAAC,aAC7C,IAAI,UAAU,wBAAwB,KAAK,QAAQ,EAAE,KAAK,wBAAwB,6BAA6B;AAAA,EAEjH,UAAU,CAAC,WAA4B,IAAI,UAAU,KAAK,SAAS,KAAK,IAAI,MAAM;AACpF;AAEO,MAAM,cAAc,CAAC,GAAa,MAA6B,aAAa,cAAc,UAAU,CAAC,IAAI,EAAE,OAAO,SAAS,CAAC,CAAC,IAAI;AACjI,MAAM,iBAAiB,CAAC,MAAgC,aAAa,aAAa,UAAU,aAAa,OAAO,CAAC;","names":[]}
|
|
@@ -0,0 +1,32 @@
|
|
|
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 Falsy_exports = {};
|
|
20
|
+
__export(Falsy_exports, {
|
|
21
|
+
isFalsy: () => isFalsy,
|
|
22
|
+
isTruthy: () => isTruthy
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(Falsy_exports);
|
|
25
|
+
const isFalsy = (v) => !v;
|
|
26
|
+
const isTruthy = (v) => !isFalsy(v);
|
|
27
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
28
|
+
0 && (module.exports = {
|
|
29
|
+
isFalsy,
|
|
30
|
+
isTruthy
|
|
31
|
+
});
|
|
32
|
+
//# sourceMappingURL=Falsy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/types/Falsy.ts"],"sourcesContent":["type Falsy = false | 0 | -0 | 0n | '' | null | undefined;\ntype Truthy<T = unknown> = Exclude<T, Falsy>;\n\nexport const isFalsy = (v?: unknown): v is Falsy => !v;\nexport const isTruthy = (v?: unknown): v is Truthy => !isFalsy(v);\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGO,MAAM,UAAU,CAAC,MAA4B,CAAC;AAC9C,MAAM,WAAW,CAAC,MAA6B,CAAC,QAAQ,CAAC;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/types/Falsy.ts"],"sourcesContent":["type Falsy = false | 0 | -0 | 0n | '' | null | undefined;\ntype Truthy<T = unknown> = Exclude<T, Falsy>;\n\nexport const isFalsy = (v?: unknown): v is Falsy => !v;\nexport const isTruthy = (v?: unknown): v is Truthy => !isFalsy(v);\n"],"mappings":";AAGO,MAAM,UAAU,CAAC,MAA4B,CAAC;AAC9C,MAAM,WAAW,CAAC,MAA6B,CAAC,QAAQ,CAAC;","names":[]}
|
|
@@ -0,0 +1,29 @@
|
|
|
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 Func_exports = {};
|
|
20
|
+
__export(Func_exports, {
|
|
21
|
+
isFunc: () => isFunc
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(Func_exports);
|
|
24
|
+
const isFunc = (o) => !!o && typeof o === "function";
|
|
25
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
26
|
+
0 && (module.exports = {
|
|
27
|
+
isFunc
|
|
28
|
+
});
|
|
29
|
+
//# sourceMappingURL=Func.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/types/Func.ts"],"sourcesContent":["export type Func<T, Args = unknown> = (...args: Args[]) => T;\n\nexport const isFunc = <T, Args>(o?: unknown): o is (...params: Args[]) => T => !!o && typeof o === 'function';\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEO,MAAM,SAAS,CAAU,MAA+C,CAAC,CAAC,KAAK,OAAO,MAAM;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/types/Func.ts"],"sourcesContent":["export type Func<T, Args = unknown> = (...args: Args[]) => T;\n\nexport const isFunc = <T, Args>(o?: unknown): o is (...params: Args[]) => T => !!o && typeof o === 'function';\n"],"mappings":";AAEO,MAAM,SAAS,CAAU,MAA+C,CAAC,CAAC,KAAK,OAAO,MAAM;","names":[]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Json, JsonValue } from './Json';
|
|
2
|
+
import { Id } from './Id';
|
|
3
|
+
import { PageList, PageOptions } from './PageList';
|
|
4
|
+
import { List } from './List';
|
|
5
|
+
import { Optional } from './Types';
|
|
6
|
+
export type FetchOptions = PageOptions;
|
|
7
|
+
export declare abstract class Gateway<Options = FetchOptions> {
|
|
8
|
+
all(options?: Options): Promise<PageList<Json>>;
|
|
9
|
+
byId(id: Id, options?: Options): Promise<Optional<Json>>;
|
|
10
|
+
by(_key: string, _value: JsonValue, _options?: Options): Promise<PageList<Json>>;
|
|
11
|
+
byIds(..._ids: Id[]): Promise<List<Json>>;
|
|
12
|
+
search(q: JsonValue, options?: Options): Promise<PageList<Json>>;
|
|
13
|
+
filter(options?: Options): Promise<PageList<Json>>;
|
|
14
|
+
exists(id: Id, options?: Options): Promise<boolean>;
|
|
15
|
+
add(item: Json, options?: Options): Promise<Json>;
|
|
16
|
+
update(item: Json, options?: Options): Promise<Json>;
|
|
17
|
+
remove(id: Id, options?: Options): Promise<boolean>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
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 Gateway_exports = {};
|
|
20
|
+
__export(Gateway_exports, {
|
|
21
|
+
Gateway: () => Gateway
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(Gateway_exports);
|
|
24
|
+
var import_Exception = require("./Exception");
|
|
25
|
+
var import_utils = require("../utils");
|
|
26
|
+
class Gateway {
|
|
27
|
+
all(options) {
|
|
28
|
+
return (0, import_utils.reject)(import_Exception.Exception.IsNotImplemented);
|
|
29
|
+
}
|
|
30
|
+
byId(id, options) {
|
|
31
|
+
return (0, import_utils.reject)(import_Exception.Exception.IsNotImplemented);
|
|
32
|
+
}
|
|
33
|
+
by(_key, _value, _options) {
|
|
34
|
+
return (0, import_utils.reject)(import_Exception.Exception.IsNotImplemented);
|
|
35
|
+
}
|
|
36
|
+
byIds(..._ids) {
|
|
37
|
+
return (0, import_utils.reject)(import_Exception.Exception.IsNotImplemented);
|
|
38
|
+
}
|
|
39
|
+
search(q, options) {
|
|
40
|
+
return (0, import_utils.reject)(import_Exception.Exception.IsNotImplemented);
|
|
41
|
+
}
|
|
42
|
+
filter(options) {
|
|
43
|
+
return (0, import_utils.reject)(import_Exception.Exception.IsNotImplemented);
|
|
44
|
+
}
|
|
45
|
+
exists(id, options) {
|
|
46
|
+
return (0, import_utils.reject)(import_Exception.Exception.IsNotImplemented);
|
|
47
|
+
}
|
|
48
|
+
add(item, options) {
|
|
49
|
+
return (0, import_utils.reject)(import_Exception.Exception.IsNotImplemented);
|
|
50
|
+
}
|
|
51
|
+
update(item, options) {
|
|
52
|
+
return (0, import_utils.reject)(import_Exception.Exception.IsNotImplemented);
|
|
53
|
+
}
|
|
54
|
+
remove(id, options) {
|
|
55
|
+
return (0, import_utils.reject)(import_Exception.Exception.IsNotImplemented);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
59
|
+
0 && (module.exports = {
|
|
60
|
+
Gateway
|
|
61
|
+
});
|
|
62
|
+
//# sourceMappingURL=Gateway.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/types/Gateway.ts"],"sourcesContent":["import { Json, JsonValue } from './Json';\nimport { Id } from './Id';\nimport { Exception } from './Exception';\nimport { reject } from '../utils';\nimport { PageList, PageOptions } from './PageList';\nimport { List } from './List';\nimport { Optional } from './Types';\n\nexport type FetchOptions = PageOptions;\n\nexport abstract class Gateway<Options = FetchOptions> {\n all(options?: Options): Promise<PageList<Json>> {\n return reject(Exception.IsNotImplemented);\n }\n\n byId(id: Id, options?: Options): Promise<Optional<Json>> {\n return reject(Exception.IsNotImplemented);\n }\n\n by(_key: string, _value: JsonValue, _options?: Options): Promise<PageList<Json>> {\n return reject(Exception.IsNotImplemented);\n }\n\n byIds(..._ids: Id[]): Promise<List<Json>> {\n return reject(Exception.IsNotImplemented);\n }\n\n search(q: JsonValue, options?: Options): Promise<PageList<Json>> {\n return reject(Exception.IsNotImplemented);\n }\n\n filter(options?: Options): Promise<PageList<Json>> {\n return reject(Exception.IsNotImplemented);\n }\n\n exists(id: Id, options?: Options): Promise<boolean> {\n return reject(Exception.IsNotImplemented);\n }\n\n add(item: Json, options?: Options): Promise<Json> {\n return reject(Exception.IsNotImplemented);\n }\n\n update(item: Json, options?: Options): Promise<Json> {\n return reject(Exception.IsNotImplemented);\n }\n\n remove(id: Id, options?: Options): Promise<boolean> {\n return reject(Exception.IsNotImplemented);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,uBAA0B;AAC1B,mBAAuB;AAOhB,MAAe,QAAgC;AAAA,EACpD,IAAI,SAA4C;AAC9C,eAAO,qBAAO,2BAAU,gBAAgB;AAAA,EAC1C;AAAA,EAEA,KAAK,IAAQ,SAA4C;AACvD,eAAO,qBAAO,2BAAU,gBAAgB;AAAA,EAC1C;AAAA,EAEA,GAAG,MAAc,QAAmB,UAA6C;AAC/E,eAAO,qBAAO,2BAAU,gBAAgB;AAAA,EAC1C;AAAA,EAEA,SAAS,MAAiC;AACxC,eAAO,qBAAO,2BAAU,gBAAgB;AAAA,EAC1C;AAAA,EAEA,OAAO,GAAc,SAA4C;AAC/D,eAAO,qBAAO,2BAAU,gBAAgB;AAAA,EAC1C;AAAA,EAEA,OAAO,SAA4C;AACjD,eAAO,qBAAO,2BAAU,gBAAgB;AAAA,EAC1C;AAAA,EAEA,OAAO,IAAQ,SAAqC;AAClD,eAAO,qBAAO,2BAAU,gBAAgB;AAAA,EAC1C;AAAA,EAEA,IAAI,MAAY,SAAkC;AAChD,eAAO,qBAAO,2BAAU,gBAAgB;AAAA,EAC1C;AAAA,EAEA,OAAO,MAAY,SAAkC;AACnD,eAAO,qBAAO,2BAAU,gBAAgB;AAAA,EAC1C;AAAA,EAEA,OAAO,IAAQ,SAAqC;AAClD,eAAO,qBAAO,2BAAU,gBAAgB;AAAA,EAC1C;AACF;","names":[]}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import "../chunk-4N72FQFX.mjs";
|
|
2
|
+
import { Exception } from "./Exception";
|
|
3
|
+
import { reject } from "../utils";
|
|
4
|
+
class Gateway {
|
|
5
|
+
all(options) {
|
|
6
|
+
return reject(Exception.IsNotImplemented);
|
|
7
|
+
}
|
|
8
|
+
byId(id, options) {
|
|
9
|
+
return reject(Exception.IsNotImplemented);
|
|
10
|
+
}
|
|
11
|
+
by(_key, _value, _options) {
|
|
12
|
+
return reject(Exception.IsNotImplemented);
|
|
13
|
+
}
|
|
14
|
+
byIds(..._ids) {
|
|
15
|
+
return reject(Exception.IsNotImplemented);
|
|
16
|
+
}
|
|
17
|
+
search(q, options) {
|
|
18
|
+
return reject(Exception.IsNotImplemented);
|
|
19
|
+
}
|
|
20
|
+
filter(options) {
|
|
21
|
+
return reject(Exception.IsNotImplemented);
|
|
22
|
+
}
|
|
23
|
+
exists(id, options) {
|
|
24
|
+
return reject(Exception.IsNotImplemented);
|
|
25
|
+
}
|
|
26
|
+
add(item, options) {
|
|
27
|
+
return reject(Exception.IsNotImplemented);
|
|
28
|
+
}
|
|
29
|
+
update(item, options) {
|
|
30
|
+
return reject(Exception.IsNotImplemented);
|
|
31
|
+
}
|
|
32
|
+
remove(id, options) {
|
|
33
|
+
return reject(Exception.IsNotImplemented);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
export {
|
|
37
|
+
Gateway
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=Gateway.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/types/Gateway.ts"],"sourcesContent":["import { Json, JsonValue } from './Json';\nimport { Id } from './Id';\nimport { Exception } from './Exception';\nimport { reject } from '../utils';\nimport { PageList, PageOptions } from './PageList';\nimport { List } from './List';\nimport { Optional } from './Types';\n\nexport type FetchOptions = PageOptions;\n\nexport abstract class Gateway<Options = FetchOptions> {\n all(options?: Options): Promise<PageList<Json>> {\n return reject(Exception.IsNotImplemented);\n }\n\n byId(id: Id, options?: Options): Promise<Optional<Json>> {\n return reject(Exception.IsNotImplemented);\n }\n\n by(_key: string, _value: JsonValue, _options?: Options): Promise<PageList<Json>> {\n return reject(Exception.IsNotImplemented);\n }\n\n byIds(..._ids: Id[]): Promise<List<Json>> {\n return reject(Exception.IsNotImplemented);\n }\n\n search(q: JsonValue, options?: Options): Promise<PageList<Json>> {\n return reject(Exception.IsNotImplemented);\n }\n\n filter(options?: Options): Promise<PageList<Json>> {\n return reject(Exception.IsNotImplemented);\n }\n\n exists(id: Id, options?: Options): Promise<boolean> {\n return reject(Exception.IsNotImplemented);\n }\n\n add(item: Json, options?: Options): Promise<Json> {\n return reject(Exception.IsNotImplemented);\n }\n\n update(item: Json, options?: Options): Promise<Json> {\n return reject(Exception.IsNotImplemented);\n }\n\n remove(id: Id, options?: Options): Promise<boolean> {\n return reject(Exception.IsNotImplemented);\n }\n}\n"],"mappings":";AAEA,SAAS,iBAAiB;AAC1B,SAAS,cAAc;AAOhB,MAAe,QAAgC;AAAA,EACpD,IAAI,SAA4C;AAC9C,WAAO,OAAO,UAAU,gBAAgB;AAAA,EAC1C;AAAA,EAEA,KAAK,IAAQ,SAA4C;AACvD,WAAO,OAAO,UAAU,gBAAgB;AAAA,EAC1C;AAAA,EAEA,GAAG,MAAc,QAAmB,UAA6C;AAC/E,WAAO,OAAO,UAAU,gBAAgB;AAAA,EAC1C;AAAA,EAEA,SAAS,MAAiC;AACxC,WAAO,OAAO,UAAU,gBAAgB;AAAA,EAC1C;AAAA,EAEA,OAAO,GAAc,SAA4C;AAC/D,WAAO,OAAO,UAAU,gBAAgB;AAAA,EAC1C;AAAA,EAEA,OAAO,SAA4C;AACjD,WAAO,OAAO,UAAU,gBAAgB;AAAA,EAC1C;AAAA,EAEA,OAAO,IAAQ,SAAqC;AAClD,WAAO,OAAO,UAAU,gBAAgB;AAAA,EAC1C;AAAA,EAEA,IAAI,MAAY,SAAkC;AAChD,WAAO,OAAO,UAAU,gBAAgB;AAAA,EAC1C;AAAA,EAEA,OAAO,MAAY,SAAkC;AACnD,WAAO,OAAO,UAAU,gBAAgB;AAAA,EAC1C;AAAA,EAEA,OAAO,IAAQ,SAAqC;AAClD,WAAO,OAAO,UAAU,gBAAgB;AAAA,EAC1C;AACF;","names":[]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Func } from './Func';
|
|
2
|
+
export type Get<T = any, Args = any> = Func<T, Args> | T;
|
|
3
|
+
export type Predicate<Args = unknown> = Get<boolean, Args>;
|
|
4
|
+
export declare const ofGet: <T, Args = any>(g: Get<T, Args>, ...args: Args[]) => T;
|
|
5
|
+
export declare const ifGet: <T>(pred: Get, valid: Get<T, any>, invalid: Get<T, any>) => T;
|
|
6
|
+
export type GetProperty<T, Prop> = keyof T | Func<Prop, T>;
|
|
7
|
+
export declare const ofProperty: <T, Prop>(t: T, p: GetProperty<T, Prop>) => Prop;
|
|
@@ -0,0 +1,36 @@
|
|
|
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 Get_exports = {};
|
|
20
|
+
__export(Get_exports, {
|
|
21
|
+
ifGet: () => ifGet,
|
|
22
|
+
ofGet: () => ofGet,
|
|
23
|
+
ofProperty: () => ofProperty
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(Get_exports);
|
|
26
|
+
var import_Func = require("./Func");
|
|
27
|
+
const ofGet = (g, ...args) => (0, import_Func.isFunc)(g) ? g(...args) : g;
|
|
28
|
+
const ifGet = (pred, valid, invalid) => ofGet(pred) ? ofGet(valid) : ofGet(invalid);
|
|
29
|
+
const ofProperty = (t, p) => (0, import_Func.isFunc)(p) ? p(t) : t[p];
|
|
30
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
31
|
+
0 && (module.exports = {
|
|
32
|
+
ifGet,
|
|
33
|
+
ofGet,
|
|
34
|
+
ofProperty
|
|
35
|
+
});
|
|
36
|
+
//# sourceMappingURL=Get.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/types/Get.ts"],"sourcesContent":["import { Func, isFunc } from './Func';\n\nexport type Get<T = any, Args = any> = Func<T, Args> | T;\nexport type Predicate<Args = unknown> = Get<boolean, Args>;\nexport const ofGet = <T, Args = any>(g: Get<T, Args>, ...args: Args[]): T => (isFunc<T, Args>(g) ? g(...args) : g);\nexport const ifGet = <T>(pred: Get, valid: Get<T>, invalid: Get<T>): T => (ofGet(pred) ? ofGet(valid) : ofGet(invalid));\nexport type GetProperty<T, Prop> = keyof T | Func<Prop, T>;\nexport const ofProperty = <T, Prop>(t: T, p: GetProperty<T, Prop>): Prop => (isFunc<Prop, T>(p) ? p(t) : ((t as any)[p] as Prop));\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAA6B;AAItB,MAAM,QAAQ,CAAgB,MAAoB,aAAqB,oBAAgB,CAAC,IAAI,EAAE,GAAG,IAAI,IAAI;AACzG,MAAM,QAAQ,CAAI,MAAW,OAAe,YAAwB,MAAM,IAAI,IAAI,MAAM,KAAK,IAAI,MAAM,OAAO;AAE9G,MAAM,aAAa,CAAU,GAAM,UAAmC,oBAAgB,CAAC,IAAI,EAAE,CAAC,IAAM,EAAU,CAAC;","names":[]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import "../chunk-4N72FQFX.mjs";
|
|
2
|
+
import { isFunc } from "./Func";
|
|
3
|
+
const ofGet = (g, ...args) => isFunc(g) ? g(...args) : g;
|
|
4
|
+
const ifGet = (pred, valid, invalid) => ofGet(pred) ? ofGet(valid) : ofGet(invalid);
|
|
5
|
+
const ofProperty = (t, p) => isFunc(p) ? p(t) : t[p];
|
|
6
|
+
export {
|
|
7
|
+
ifGet,
|
|
8
|
+
ofGet,
|
|
9
|
+
ofProperty
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=Get.mjs.map
|