@thisisagile/easy 15.8.5 → 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/src/process/Manage.ts +15 -4
- package/src/process/Search.ts +24 -9
- package/src/utils/If.ts +1 -0
- package/dist/index.d.mts +0 -2821
|
@@ -0,0 +1,42 @@
|
|
|
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 OriginatedError_exports = {};
|
|
20
|
+
__export(OriginatedError_exports, {
|
|
21
|
+
OriginatedError: () => OriginatedError,
|
|
22
|
+
isOriginatedError: () => isOriginatedError,
|
|
23
|
+
toOriginatedError: () => toOriginatedError
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(OriginatedError_exports);
|
|
26
|
+
var import_types = require("../types");
|
|
27
|
+
class OriginatedError extends Error {
|
|
28
|
+
constructor(origin, options) {
|
|
29
|
+
super();
|
|
30
|
+
this.origin = origin;
|
|
31
|
+
this.options = options;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
const isOriginatedError = (e) => (0, import_types.isError)(e) && e instanceof OriginatedError;
|
|
35
|
+
const toOriginatedError = (e, options) => isOriginatedError(e) ? e : new OriginatedError(e, options);
|
|
36
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
37
|
+
0 && (module.exports = {
|
|
38
|
+
OriginatedError,
|
|
39
|
+
isOriginatedError,
|
|
40
|
+
toOriginatedError
|
|
41
|
+
});
|
|
42
|
+
//# sourceMappingURL=OriginatedError.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/http/OriginatedError.ts"],"sourcesContent":["import { ErrorOrigin, isError } from '../types';\nimport { VerbOptions } from './Verb';\n\nexport class OriginatedError extends Error {\n constructor(readonly origin: ErrorOrigin, readonly options?: VerbOptions) {\n super();\n }\n}\n\nexport const isOriginatedError = (e?: unknown): e is OriginatedError => isError(e) && e instanceof OriginatedError;\n\nexport const toOriginatedError = (e: unknown, options?: VerbOptions): OriginatedError =>\n isOriginatedError(e) ? e : new OriginatedError(e as ErrorOrigin, options);\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAqC;AAG9B,MAAM,wBAAwB,MAAM;AAAA,EACzC,YAAqB,QAA8B,SAAuB;AACxE,UAAM;AADa;AAA8B;AAAA,EAEnD;AACF;AAEO,MAAM,oBAAoB,CAAC,UAAsC,sBAAQ,CAAC,KAAK,aAAa;AAE5F,MAAM,oBAAoB,CAAC,GAAY,YAC5C,kBAAkB,CAAC,IAAI,IAAI,IAAI,gBAAgB,GAAkB,OAAO;","names":[]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import "../chunk-4N72FQFX.mjs";
|
|
2
|
+
import { isError } from "../types";
|
|
3
|
+
class OriginatedError extends Error {
|
|
4
|
+
constructor(origin, options) {
|
|
5
|
+
super();
|
|
6
|
+
this.origin = origin;
|
|
7
|
+
this.options = options;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
const isOriginatedError = (e) => isError(e) && e instanceof OriginatedError;
|
|
11
|
+
const toOriginatedError = (e, options) => isOriginatedError(e) ? e : new OriginatedError(e, options);
|
|
12
|
+
export {
|
|
13
|
+
OriginatedError,
|
|
14
|
+
isOriginatedError,
|
|
15
|
+
toOriginatedError
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=OriginatedError.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/http/OriginatedError.ts"],"sourcesContent":["import { ErrorOrigin, isError } from '../types';\nimport { VerbOptions } from './Verb';\n\nexport class OriginatedError extends Error {\n constructor(readonly origin: ErrorOrigin, readonly options?: VerbOptions) {\n super();\n }\n}\n\nexport const isOriginatedError = (e?: unknown): e is OriginatedError => isError(e) && e instanceof OriginatedError;\n\nexport const toOriginatedError = (e: unknown, options?: VerbOptions): OriginatedError =>\n isOriginatedError(e) ? e : new OriginatedError(e as ErrorOrigin, options);\n"],"mappings":";AAAA,SAAsB,eAAe;AAG9B,MAAM,wBAAwB,MAAM;AAAA,EACzC,YAAqB,QAA8B,SAAuB;AACxE,UAAM;AADa;AAA8B;AAAA,EAEnD;AACF;AAEO,MAAM,oBAAoB,CAAC,MAAsC,QAAQ,CAAC,KAAK,aAAa;AAE5F,MAAM,oBAAoB,CAAC,GAAY,YAC5C,kBAAkB,CAAC,IAAI,IAAI,IAAI,gBAAgB,GAAkB,OAAO;","names":[]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Uri } from '../types';
|
|
2
|
+
import { HttpVerb } from './HttpVerb';
|
|
3
|
+
import { RequestOptions } from './RequestOptions';
|
|
4
|
+
export type Request = {
|
|
5
|
+
uri: Uri;
|
|
6
|
+
verb: HttpVerb;
|
|
7
|
+
body?: unknown;
|
|
8
|
+
transform?: (r: any) => any;
|
|
9
|
+
transformError?: (r: any) => any;
|
|
10
|
+
options?: RequestOptions;
|
|
11
|
+
};
|
|
@@ -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 Request_exports = {};
|
|
16
|
+
module.exports = __toCommonJS(Request_exports);
|
|
17
|
+
//# sourceMappingURL=Request.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/http/Request.ts"],"sourcesContent":["import { Uri } from '../types';\nimport { HttpVerb } from './HttpVerb';\nimport { RequestOptions } from './RequestOptions';\n\nexport type Request = {\n uri: Uri;\n verb: HttpVerb;\n body?: unknown;\n transform?: (r: any) => any;\n transformError?: (r: any) => any;\n options?: RequestOptions;\n};\n"],"mappings":";;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=Request.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { CacheAge, Enum, Id, Optional, PageOptions, Text } from '../types';
|
|
2
|
+
import { ContentType } from './ContentType';
|
|
3
|
+
export declare const toPageOptions: (options?: RequestOptions | PageOptions) => Optional<PageOptions>;
|
|
4
|
+
export declare class RequestOptions extends Enum {
|
|
5
|
+
readonly type: ContentType;
|
|
6
|
+
readonly headers: {
|
|
7
|
+
[key: string]: any;
|
|
8
|
+
};
|
|
9
|
+
pageOptions?: PageOptions | undefined;
|
|
10
|
+
requestOptions: {
|
|
11
|
+
maxRedirects?: number;
|
|
12
|
+
validateStatus?: (status: number) => boolean;
|
|
13
|
+
timeout?: CacheAge;
|
|
14
|
+
};
|
|
15
|
+
constructor(type?: ContentType, headers?: {
|
|
16
|
+
[key: string]: any;
|
|
17
|
+
}, pageOptions?: PageOptions | undefined);
|
|
18
|
+
static get Form(): RequestOptions;
|
|
19
|
+
static get Json(): RequestOptions;
|
|
20
|
+
static get Stream(): RequestOptions;
|
|
21
|
+
static get Text(): RequestOptions;
|
|
22
|
+
static get Xml(): RequestOptions;
|
|
23
|
+
page: (options: PageOptions) => this;
|
|
24
|
+
authorization: (auth: string) => this;
|
|
25
|
+
apiKey: (apiKey: string) => this;
|
|
26
|
+
setHeader: (key: Text, value: Id | boolean) => this;
|
|
27
|
+
setHeaderUnlessPresent: (key: string, value?: Id | boolean) => this;
|
|
28
|
+
accept: (type: ContentType) => this;
|
|
29
|
+
bearer: (jwt: Text) => this;
|
|
30
|
+
basic: (username: Text, password: Text) => this;
|
|
31
|
+
maxRedirects: (max?: number) => this;
|
|
32
|
+
validateStatus: (validate?: ((status: number) => boolean) | undefined) => this;
|
|
33
|
+
timeout: (t?: CacheAge) => this;
|
|
34
|
+
}
|
|
35
|
+
export declare const isRequestOptions: (o?: unknown) => o is RequestOptions;
|
|
@@ -0,0 +1,91 @@
|
|
|
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 RequestOptions_exports = {};
|
|
20
|
+
__export(RequestOptions_exports, {
|
|
21
|
+
RequestOptions: () => RequestOptions,
|
|
22
|
+
isRequestOptions: () => isRequestOptions,
|
|
23
|
+
toPageOptions: () => toPageOptions
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(RequestOptions_exports);
|
|
26
|
+
var import_types = require("../types");
|
|
27
|
+
var import_HttpHeader = require("./HttpHeader");
|
|
28
|
+
var import_ContentType = require("./ContentType");
|
|
29
|
+
const toPageOptions = (options) => options instanceof RequestOptions ? options.pageOptions : options;
|
|
30
|
+
class RequestOptions extends import_types.Enum {
|
|
31
|
+
constructor(type = import_ContentType.ContentType.Json, headers = {}, pageOptions) {
|
|
32
|
+
super(type.name);
|
|
33
|
+
this.type = type;
|
|
34
|
+
this.headers = headers;
|
|
35
|
+
this.pageOptions = pageOptions;
|
|
36
|
+
this.headers["Content-Type"] = type.id;
|
|
37
|
+
this.headers[import_HttpHeader.HttpHeader.Correlation] = import_types.ctx.request.correlationId ?? (0, import_types.toUuid)();
|
|
38
|
+
}
|
|
39
|
+
requestOptions = {};
|
|
40
|
+
static get Form() {
|
|
41
|
+
return new RequestOptions(import_ContentType.ContentType.Form);
|
|
42
|
+
}
|
|
43
|
+
static get Json() {
|
|
44
|
+
return new RequestOptions(import_ContentType.ContentType.Json);
|
|
45
|
+
}
|
|
46
|
+
static get Stream() {
|
|
47
|
+
return new RequestOptions(import_ContentType.ContentType.Stream);
|
|
48
|
+
}
|
|
49
|
+
static get Text() {
|
|
50
|
+
return new RequestOptions(import_ContentType.ContentType.Text);
|
|
51
|
+
}
|
|
52
|
+
static get Xml() {
|
|
53
|
+
return new RequestOptions(import_ContentType.ContentType.Xml);
|
|
54
|
+
}
|
|
55
|
+
page = (options) => {
|
|
56
|
+
this.pageOptions = options;
|
|
57
|
+
return this;
|
|
58
|
+
};
|
|
59
|
+
authorization = (auth) => this.setHeader("Authorization", auth);
|
|
60
|
+
apiKey = (apiKey) => this.setHeader("apiKey", apiKey);
|
|
61
|
+
setHeader = (key, value) => (0, import_types.on)(this, (t) => t.headers[(0, import_types.asString)(key)] = value);
|
|
62
|
+
setHeaderUnlessPresent = (key, value) => value ? this.setHeader(key, this.headers[key] ?? value) : this;
|
|
63
|
+
accept = (type) => this.setHeader("Accept", type.id);
|
|
64
|
+
bearer = (jwt) => {
|
|
65
|
+
return (0, import_types.isNotEmpty)(jwt) ? this.authorization(`Bearer ${jwt}`) : this;
|
|
66
|
+
};
|
|
67
|
+
basic = (username, password) => {
|
|
68
|
+
const basicAuth = Buffer.from(`${username}:${password}`, "utf8").toString("base64");
|
|
69
|
+
return this.authorization(`Basic ${basicAuth}`);
|
|
70
|
+
};
|
|
71
|
+
maxRedirects = (max) => {
|
|
72
|
+
this.requestOptions.maxRedirects = max;
|
|
73
|
+
return this;
|
|
74
|
+
};
|
|
75
|
+
validateStatus = (validate) => {
|
|
76
|
+
this.requestOptions.validateStatus = validate;
|
|
77
|
+
return this;
|
|
78
|
+
};
|
|
79
|
+
timeout = (t) => {
|
|
80
|
+
this.requestOptions.timeout = t;
|
|
81
|
+
return this;
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
const isRequestOptions = (o) => (0, import_types.isDefined)(o) && o instanceof RequestOptions;
|
|
85
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
86
|
+
0 && (module.exports = {
|
|
87
|
+
RequestOptions,
|
|
88
|
+
isRequestOptions,
|
|
89
|
+
toPageOptions
|
|
90
|
+
});
|
|
91
|
+
//# sourceMappingURL=RequestOptions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/http/RequestOptions.ts"],"sourcesContent":["import { asString, CacheAge, ctx, Enum, Id, isDefined, isNotEmpty, on, Optional, PageOptions, Text, toUuid } from '../types';\nimport { HttpHeader } from './HttpHeader';\nimport { ContentType } from './ContentType';\n\nexport const toPageOptions = (options?: RequestOptions | PageOptions): Optional<PageOptions> =>\n options instanceof RequestOptions ? options.pageOptions : options;\n\nexport class RequestOptions extends Enum {\n public requestOptions: { maxRedirects?: number; validateStatus?: (status: number) => boolean; timeout?: CacheAge } = {};\n\n constructor(readonly type: ContentType = ContentType.Json, readonly headers: { [key: string]: any } = {}, public pageOptions?: PageOptions) {\n super(type.name);\n this.headers['Content-Type'] = type.id;\n this.headers[HttpHeader.Correlation] = ctx.request.correlationId ?? toUuid();\n }\n\n static get Form(): RequestOptions {\n return new RequestOptions(ContentType.Form);\n }\n\n static get Json(): RequestOptions {\n return new RequestOptions(ContentType.Json);\n }\n\n static get Stream(): RequestOptions {\n return new RequestOptions(ContentType.Stream);\n }\n\n static get Text(): RequestOptions {\n return new RequestOptions(ContentType.Text);\n }\n\n static get Xml(): RequestOptions {\n return new RequestOptions(ContentType.Xml);\n }\n\n page = (options: PageOptions): this => {\n this.pageOptions = options;\n return this;\n };\n\n authorization = (auth: string): this => this.setHeader('Authorization', auth);\n\n apiKey = (apiKey: string): this => this.setHeader('apiKey', apiKey);\n\n setHeader = (key: Text, value: Id | boolean): this => on(this, t => (t.headers[asString(key)] = value));\n\n setHeaderUnlessPresent = (key: string, value?: Id | boolean): this => (value ? this.setHeader(key, this.headers[key] ?? value) : this);\n\n accept = (type: ContentType): this => this.setHeader('Accept', type.id);\n\n bearer = (jwt: Text): this => {\n return isNotEmpty(jwt) ? this.authorization(`Bearer ${jwt}`) : this;\n };\n\n basic = (username: Text, password: Text): this => {\n const basicAuth = Buffer.from(`${username}:${password}`, 'utf8').toString('base64');\n return this.authorization(`Basic ${basicAuth}`);\n };\n\n maxRedirects = (max?: number): this => {\n this.requestOptions.maxRedirects = max;\n return this;\n };\n\n validateStatus = (validate?: (status: number) => boolean): this => {\n this.requestOptions.validateStatus = validate;\n return this;\n };\n\n timeout = (t?: CacheAge): this => {\n this.requestOptions.timeout = t;\n return this;\n };\n}\n\nexport const isRequestOptions = (o?: unknown): o is RequestOptions => isDefined(o) && o instanceof RequestOptions;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkH;AAClH,wBAA2B;AAC3B,yBAA4B;AAErB,MAAM,gBAAgB,CAAC,YAC5B,mBAAmB,iBAAiB,QAAQ,cAAc;AAErD,MAAM,uBAAuB,kBAAK;AAAA,EAGvC,YAAqB,OAAoB,+BAAY,MAAe,UAAkC,CAAC,GAAU,aAA2B;AAC1I,UAAM,KAAK,IAAI;AADI;AAA+C;AAA6C;AAE/G,SAAK,QAAQ,cAAc,IAAI,KAAK;AACpC,SAAK,QAAQ,6BAAW,WAAW,IAAI,iBAAI,QAAQ,qBAAiB,qBAAO;AAAA,EAC7E;AAAA,EANO,iBAA8G,CAAC;AAAA,EAQtH,WAAW,OAAuB;AAChC,WAAO,IAAI,eAAe,+BAAY,IAAI;AAAA,EAC5C;AAAA,EAEA,WAAW,OAAuB;AAChC,WAAO,IAAI,eAAe,+BAAY,IAAI;AAAA,EAC5C;AAAA,EAEA,WAAW,SAAyB;AAClC,WAAO,IAAI,eAAe,+BAAY,MAAM;AAAA,EAC9C;AAAA,EAEA,WAAW,OAAuB;AAChC,WAAO,IAAI,eAAe,+BAAY,IAAI;AAAA,EAC5C;AAAA,EAEA,WAAW,MAAsB;AAC/B,WAAO,IAAI,eAAe,+BAAY,GAAG;AAAA,EAC3C;AAAA,EAEA,OAAO,CAAC,YAA+B;AACrC,SAAK,cAAc;AACnB,WAAO;AAAA,EACT;AAAA,EAEA,gBAAgB,CAAC,SAAuB,KAAK,UAAU,iBAAiB,IAAI;AAAA,EAE5E,SAAS,CAAC,WAAyB,KAAK,UAAU,UAAU,MAAM;AAAA,EAElE,YAAY,CAAC,KAAW,cAA8B,iBAAG,MAAM,OAAM,EAAE,YAAQ,uBAAS,GAAG,CAAC,IAAI,KAAM;AAAA,EAEtG,yBAAyB,CAAC,KAAa,UAAgC,QAAQ,KAAK,UAAU,KAAK,KAAK,QAAQ,GAAG,KAAK,KAAK,IAAI;AAAA,EAEjI,SAAS,CAAC,SAA4B,KAAK,UAAU,UAAU,KAAK,EAAE;AAAA,EAEtE,SAAS,CAAC,QAAoB;AAC5B,eAAO,yBAAW,GAAG,IAAI,KAAK,cAAc,UAAU,GAAG,EAAE,IAAI;AAAA,EACjE;AAAA,EAEA,QAAQ,CAAC,UAAgB,aAAyB;AAChD,UAAM,YAAY,OAAO,KAAK,GAAG,QAAQ,IAAI,QAAQ,IAAI,MAAM,EAAE,SAAS,QAAQ;AAClF,WAAO,KAAK,cAAc,SAAS,SAAS,EAAE;AAAA,EAChD;AAAA,EAEA,eAAe,CAAC,QAAuB;AACrC,SAAK,eAAe,eAAe;AACnC,WAAO;AAAA,EACT;AAAA,EAEA,iBAAiB,CAAC,aAAiD;AACjE,SAAK,eAAe,iBAAiB;AACrC,WAAO;AAAA,EACT;AAAA,EAEA,UAAU,CAAC,MAAuB;AAChC,SAAK,eAAe,UAAU;AAC9B,WAAO;AAAA,EACT;AACF;AAEO,MAAM,mBAAmB,CAAC,UAAqC,wBAAU,CAAC,KAAK,aAAa;","names":[]}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import "../chunk-4N72FQFX.mjs";
|
|
2
|
+
import { asString, ctx, Enum, isDefined, isNotEmpty, on, toUuid } from "../types";
|
|
3
|
+
import { HttpHeader } from "./HttpHeader";
|
|
4
|
+
import { ContentType } from "./ContentType";
|
|
5
|
+
const toPageOptions = (options) => options instanceof RequestOptions ? options.pageOptions : options;
|
|
6
|
+
class RequestOptions extends Enum {
|
|
7
|
+
constructor(type = ContentType.Json, headers = {}, pageOptions) {
|
|
8
|
+
super(type.name);
|
|
9
|
+
this.type = type;
|
|
10
|
+
this.headers = headers;
|
|
11
|
+
this.pageOptions = pageOptions;
|
|
12
|
+
this.headers["Content-Type"] = type.id;
|
|
13
|
+
this.headers[HttpHeader.Correlation] = ctx.request.correlationId ?? toUuid();
|
|
14
|
+
}
|
|
15
|
+
requestOptions = {};
|
|
16
|
+
static get Form() {
|
|
17
|
+
return new RequestOptions(ContentType.Form);
|
|
18
|
+
}
|
|
19
|
+
static get Json() {
|
|
20
|
+
return new RequestOptions(ContentType.Json);
|
|
21
|
+
}
|
|
22
|
+
static get Stream() {
|
|
23
|
+
return new RequestOptions(ContentType.Stream);
|
|
24
|
+
}
|
|
25
|
+
static get Text() {
|
|
26
|
+
return new RequestOptions(ContentType.Text);
|
|
27
|
+
}
|
|
28
|
+
static get Xml() {
|
|
29
|
+
return new RequestOptions(ContentType.Xml);
|
|
30
|
+
}
|
|
31
|
+
page = (options) => {
|
|
32
|
+
this.pageOptions = options;
|
|
33
|
+
return this;
|
|
34
|
+
};
|
|
35
|
+
authorization = (auth) => this.setHeader("Authorization", auth);
|
|
36
|
+
apiKey = (apiKey) => this.setHeader("apiKey", apiKey);
|
|
37
|
+
setHeader = (key, value) => on(this, (t) => t.headers[asString(key)] = value);
|
|
38
|
+
setHeaderUnlessPresent = (key, value) => value ? this.setHeader(key, this.headers[key] ?? value) : this;
|
|
39
|
+
accept = (type) => this.setHeader("Accept", type.id);
|
|
40
|
+
bearer = (jwt) => {
|
|
41
|
+
return isNotEmpty(jwt) ? this.authorization(`Bearer ${jwt}`) : this;
|
|
42
|
+
};
|
|
43
|
+
basic = (username, password) => {
|
|
44
|
+
const basicAuth = Buffer.from(`${username}:${password}`, "utf8").toString("base64");
|
|
45
|
+
return this.authorization(`Basic ${basicAuth}`);
|
|
46
|
+
};
|
|
47
|
+
maxRedirects = (max) => {
|
|
48
|
+
this.requestOptions.maxRedirects = max;
|
|
49
|
+
return this;
|
|
50
|
+
};
|
|
51
|
+
validateStatus = (validate) => {
|
|
52
|
+
this.requestOptions.validateStatus = validate;
|
|
53
|
+
return this;
|
|
54
|
+
};
|
|
55
|
+
timeout = (t) => {
|
|
56
|
+
this.requestOptions.timeout = t;
|
|
57
|
+
return this;
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
const isRequestOptions = (o) => isDefined(o) && o instanceof RequestOptions;
|
|
61
|
+
export {
|
|
62
|
+
RequestOptions,
|
|
63
|
+
isRequestOptions,
|
|
64
|
+
toPageOptions
|
|
65
|
+
};
|
|
66
|
+
//# sourceMappingURL=RequestOptions.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/http/RequestOptions.ts"],"sourcesContent":["import { asString, CacheAge, ctx, Enum, Id, isDefined, isNotEmpty, on, Optional, PageOptions, Text, toUuid } from '../types';\nimport { HttpHeader } from './HttpHeader';\nimport { ContentType } from './ContentType';\n\nexport const toPageOptions = (options?: RequestOptions | PageOptions): Optional<PageOptions> =>\n options instanceof RequestOptions ? options.pageOptions : options;\n\nexport class RequestOptions extends Enum {\n public requestOptions: { maxRedirects?: number; validateStatus?: (status: number) => boolean; timeout?: CacheAge } = {};\n\n constructor(readonly type: ContentType = ContentType.Json, readonly headers: { [key: string]: any } = {}, public pageOptions?: PageOptions) {\n super(type.name);\n this.headers['Content-Type'] = type.id;\n this.headers[HttpHeader.Correlation] = ctx.request.correlationId ?? toUuid();\n }\n\n static get Form(): RequestOptions {\n return new RequestOptions(ContentType.Form);\n }\n\n static get Json(): RequestOptions {\n return new RequestOptions(ContentType.Json);\n }\n\n static get Stream(): RequestOptions {\n return new RequestOptions(ContentType.Stream);\n }\n\n static get Text(): RequestOptions {\n return new RequestOptions(ContentType.Text);\n }\n\n static get Xml(): RequestOptions {\n return new RequestOptions(ContentType.Xml);\n }\n\n page = (options: PageOptions): this => {\n this.pageOptions = options;\n return this;\n };\n\n authorization = (auth: string): this => this.setHeader('Authorization', auth);\n\n apiKey = (apiKey: string): this => this.setHeader('apiKey', apiKey);\n\n setHeader = (key: Text, value: Id | boolean): this => on(this, t => (t.headers[asString(key)] = value));\n\n setHeaderUnlessPresent = (key: string, value?: Id | boolean): this => (value ? this.setHeader(key, this.headers[key] ?? value) : this);\n\n accept = (type: ContentType): this => this.setHeader('Accept', type.id);\n\n bearer = (jwt: Text): this => {\n return isNotEmpty(jwt) ? this.authorization(`Bearer ${jwt}`) : this;\n };\n\n basic = (username: Text, password: Text): this => {\n const basicAuth = Buffer.from(`${username}:${password}`, 'utf8').toString('base64');\n return this.authorization(`Basic ${basicAuth}`);\n };\n\n maxRedirects = (max?: number): this => {\n this.requestOptions.maxRedirects = max;\n return this;\n };\n\n validateStatus = (validate?: (status: number) => boolean): this => {\n this.requestOptions.validateStatus = validate;\n return this;\n };\n\n timeout = (t?: CacheAge): this => {\n this.requestOptions.timeout = t;\n return this;\n };\n}\n\nexport const isRequestOptions = (o?: unknown): o is RequestOptions => isDefined(o) && o instanceof RequestOptions;\n"],"mappings":";AAAA,SAAS,UAAoB,KAAK,MAAU,WAAW,YAAY,IAAiC,cAAc;AAClH,SAAS,kBAAkB;AAC3B,SAAS,mBAAmB;AAErB,MAAM,gBAAgB,CAAC,YAC5B,mBAAmB,iBAAiB,QAAQ,cAAc;AAErD,MAAM,uBAAuB,KAAK;AAAA,EAGvC,YAAqB,OAAoB,YAAY,MAAe,UAAkC,CAAC,GAAU,aAA2B;AAC1I,UAAM,KAAK,IAAI;AADI;AAA+C;AAA6C;AAE/G,SAAK,QAAQ,cAAc,IAAI,KAAK;AACpC,SAAK,QAAQ,WAAW,WAAW,IAAI,IAAI,QAAQ,iBAAiB,OAAO;AAAA,EAC7E;AAAA,EANO,iBAA8G,CAAC;AAAA,EAQtH,WAAW,OAAuB;AAChC,WAAO,IAAI,eAAe,YAAY,IAAI;AAAA,EAC5C;AAAA,EAEA,WAAW,OAAuB;AAChC,WAAO,IAAI,eAAe,YAAY,IAAI;AAAA,EAC5C;AAAA,EAEA,WAAW,SAAyB;AAClC,WAAO,IAAI,eAAe,YAAY,MAAM;AAAA,EAC9C;AAAA,EAEA,WAAW,OAAuB;AAChC,WAAO,IAAI,eAAe,YAAY,IAAI;AAAA,EAC5C;AAAA,EAEA,WAAW,MAAsB;AAC/B,WAAO,IAAI,eAAe,YAAY,GAAG;AAAA,EAC3C;AAAA,EAEA,OAAO,CAAC,YAA+B;AACrC,SAAK,cAAc;AACnB,WAAO;AAAA,EACT;AAAA,EAEA,gBAAgB,CAAC,SAAuB,KAAK,UAAU,iBAAiB,IAAI;AAAA,EAE5E,SAAS,CAAC,WAAyB,KAAK,UAAU,UAAU,MAAM;AAAA,EAElE,YAAY,CAAC,KAAW,UAA8B,GAAG,MAAM,OAAM,EAAE,QAAQ,SAAS,GAAG,CAAC,IAAI,KAAM;AAAA,EAEtG,yBAAyB,CAAC,KAAa,UAAgC,QAAQ,KAAK,UAAU,KAAK,KAAK,QAAQ,GAAG,KAAK,KAAK,IAAI;AAAA,EAEjI,SAAS,CAAC,SAA4B,KAAK,UAAU,UAAU,KAAK,EAAE;AAAA,EAEtE,SAAS,CAAC,QAAoB;AAC5B,WAAO,WAAW,GAAG,IAAI,KAAK,cAAc,UAAU,GAAG,EAAE,IAAI;AAAA,EACjE;AAAA,EAEA,QAAQ,CAAC,UAAgB,aAAyB;AAChD,UAAM,YAAY,OAAO,KAAK,GAAG,QAAQ,IAAI,QAAQ,IAAI,MAAM,EAAE,SAAS,QAAQ;AAClF,WAAO,KAAK,cAAc,SAAS,SAAS,EAAE;AAAA,EAChD;AAAA,EAEA,eAAe,CAAC,QAAuB;AACrC,SAAK,eAAe,eAAe;AACnC,WAAO;AAAA,EACT;AAAA,EAEA,iBAAiB,CAAC,aAAiD;AACjE,SAAK,eAAe,iBAAiB;AACrC,WAAO;AAAA,EACT;AAAA,EAEA,UAAU,CAAC,MAAuB;AAChC,SAAK,eAAe,UAAU;AAC9B,WAAO;AAAA,EACT;AACF;AAEO,MAAM,mBAAmB,CAAC,MAAqC,UAAU,CAAC,KAAK,aAAa;","names":[]}
|
|
@@ -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 RequestProvider_exports = {};
|
|
16
|
+
module.exports = __toCommonJS(RequestProvider_exports);
|
|
17
|
+
//# sourceMappingURL=RequestProvider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/http/RequestProvider.ts"],"sourcesContent":["import { Response } from './Response';\nimport { Request } from './Request';\n\nexport interface RequestProvider {\n execute: (request: Request) => Promise<Response>;\n}\n"],"mappings":";;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=RequestProvider.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { HttpStatus } from './HttpStatus';
|
|
2
|
+
import { RestResult } from './RestResult';
|
|
3
|
+
import { Code, TypeGuard } from '../types';
|
|
4
|
+
export type Response = {
|
|
5
|
+
status: HttpStatus;
|
|
6
|
+
headers?: {
|
|
7
|
+
[key: string]: any;
|
|
8
|
+
};
|
|
9
|
+
body: RestResult;
|
|
10
|
+
};
|
|
11
|
+
export declare const isResponse: TypeGuard<Response>;
|
|
12
|
+
export declare const toResponse: (status: HttpStatus | Code, body?: unknown, headers?: {
|
|
13
|
+
[key: string]: any;
|
|
14
|
+
} | undefined) => Response;
|
|
@@ -0,0 +1,39 @@
|
|
|
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 Response_exports = {};
|
|
20
|
+
__export(Response_exports, {
|
|
21
|
+
isResponse: () => isResponse,
|
|
22
|
+
toResponse: () => toResponse
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(Response_exports);
|
|
25
|
+
var import_HttpStatus = require("./HttpStatus");
|
|
26
|
+
var import_RestResult = require("./RestResult");
|
|
27
|
+
var import_types = require("../types");
|
|
28
|
+
const isResponse = (r) => (0, import_types.isA)(r, "status", "body");
|
|
29
|
+
const toResponse = (status, body, headers) => ({
|
|
30
|
+
status: (0, import_HttpStatus.toHttpStatus)(status),
|
|
31
|
+
headers,
|
|
32
|
+
body: import_RestResult.rest.to(body)
|
|
33
|
+
});
|
|
34
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
35
|
+
0 && (module.exports = {
|
|
36
|
+
isResponse,
|
|
37
|
+
toResponse
|
|
38
|
+
});
|
|
39
|
+
//# sourceMappingURL=Response.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/http/Response.ts"],"sourcesContent":["import { HttpStatus, toHttpStatus } from './HttpStatus';\nimport { rest, RestResult } from './RestResult';\nimport { Code, isA, TypeGuard } from '../types';\n\nexport type Response = {\n status: HttpStatus;\n headers?: { [key: string]: any };\n body: RestResult;\n};\n\nexport const isResponse: TypeGuard<Response> = (r?: unknown): r is Response => isA<Response>(r, 'status', 'body');\n\nexport const toResponse = (status: HttpStatus | Code, body?: unknown, headers?: { [key: string]: any }): Response => ({\n status: toHttpStatus(status),\n headers,\n body: rest.to(body),\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAAyC;AACzC,wBAAiC;AACjC,mBAAqC;AAQ9B,MAAM,aAAkC,CAAC,UAA+B,kBAAc,GAAG,UAAU,MAAM;AAEzG,MAAM,aAAa,CAAC,QAA2B,MAAgB,aAAgD;AAAA,EACpH,YAAQ,gCAAa,MAAM;AAAA,EAC3B;AAAA,EACA,MAAM,uBAAK,GAAG,IAAI;AACpB;","names":[]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import "../chunk-4N72FQFX.mjs";
|
|
2
|
+
import { toHttpStatus } from "./HttpStatus";
|
|
3
|
+
import { rest } from "./RestResult";
|
|
4
|
+
import { isA } from "../types";
|
|
5
|
+
const isResponse = (r) => isA(r, "status", "body");
|
|
6
|
+
const toResponse = (status, body, headers) => ({
|
|
7
|
+
status: toHttpStatus(status),
|
|
8
|
+
headers,
|
|
9
|
+
body: rest.to(body)
|
|
10
|
+
});
|
|
11
|
+
export {
|
|
12
|
+
isResponse,
|
|
13
|
+
toResponse
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=Response.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/http/Response.ts"],"sourcesContent":["import { HttpStatus, toHttpStatus } from './HttpStatus';\nimport { rest, RestResult } from './RestResult';\nimport { Code, isA, TypeGuard } from '../types';\n\nexport type Response = {\n status: HttpStatus;\n headers?: { [key: string]: any };\n body: RestResult;\n};\n\nexport const isResponse: TypeGuard<Response> = (r?: unknown): r is Response => isA<Response>(r, 'status', 'body');\n\nexport const toResponse = (status: HttpStatus | Code, body?: unknown, headers?: { [key: string]: any }): Response => ({\n status: toHttpStatus(status),\n headers,\n body: rest.to(body),\n});\n"],"mappings":";AAAA,SAAqB,oBAAoB;AACzC,SAAS,YAAwB;AACjC,SAAe,WAAsB;AAQ9B,MAAM,aAAkC,CAAC,MAA+B,IAAc,GAAG,UAAU,MAAM;AAEzG,MAAM,aAAa,CAAC,QAA2B,MAAgB,aAAgD;AAAA,EACpH,QAAQ,aAAa,MAAM;AAAA,EAC3B;AAAA,EACA,MAAM,KAAK,GAAG,IAAI;AACpB;","names":[]}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Json, List, Result } from '../types';
|
|
2
|
+
import { HttpStatus } from './HttpStatus';
|
|
3
|
+
export type RestResult = {
|
|
4
|
+
data?: {
|
|
5
|
+
code: number;
|
|
6
|
+
items: List<Json>;
|
|
7
|
+
itemCount: number;
|
|
8
|
+
totalItems?: number;
|
|
9
|
+
meta?: Json;
|
|
10
|
+
};
|
|
11
|
+
error?: {
|
|
12
|
+
code: number;
|
|
13
|
+
message: string;
|
|
14
|
+
errorCount: number;
|
|
15
|
+
errors: List<Result>;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
export declare const rest: {
|
|
19
|
+
toData: (status: HttpStatus, items?: Json[], totalItems?: number, meta?: Json) => RestResult;
|
|
20
|
+
toError: (status: HttpStatus, errors?: Result[]) => RestResult;
|
|
21
|
+
to: (payload?: any | any[], status?: HttpStatus) => RestResult;
|
|
22
|
+
};
|
|
23
|
+
export declare const isRestResult: (r: unknown) => r is RestResult;
|
|
@@ -0,0 +1,56 @@
|
|
|
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 RestResult_exports = {};
|
|
20
|
+
__export(RestResult_exports, {
|
|
21
|
+
isRestResult: () => isRestResult,
|
|
22
|
+
rest: () => rest
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(RestResult_exports);
|
|
25
|
+
var import_types = require("../types");
|
|
26
|
+
var import_HttpStatus = require("./HttpStatus");
|
|
27
|
+
var import_Response = require("./Response");
|
|
28
|
+
const hasErrors = (a) => (0, import_types.isDefined)(a?.error?.errors);
|
|
29
|
+
const hasItems = (a) => (0, import_types.isDefined)(a?.data.items);
|
|
30
|
+
const rest = {
|
|
31
|
+
toData: (status, items = [], totalItems, meta) => ({
|
|
32
|
+
data: {
|
|
33
|
+
code: status.status,
|
|
34
|
+
items: (0, import_types.toList)(items),
|
|
35
|
+
itemCount: items.length,
|
|
36
|
+
totalItems,
|
|
37
|
+
meta
|
|
38
|
+
}
|
|
39
|
+
}),
|
|
40
|
+
toError: (status, errors = [(0, import_types.toResult)(status.name)]) => ({
|
|
41
|
+
error: {
|
|
42
|
+
code: status.status,
|
|
43
|
+
message: status.name ?? errors[0].message ?? "Unknown",
|
|
44
|
+
errors: (0, import_types.toList)(errors),
|
|
45
|
+
errorCount: errors.length
|
|
46
|
+
}
|
|
47
|
+
}),
|
|
48
|
+
to: (payload, status) => (0, import_types.choose)(payload).is.not.defined((p) => p, void 0).type(import_HttpStatus.isHttpStatus, (h) => rest.toError(h ?? status ?? import_HttpStatus.HttpStatus.InternalServerError, [(0, import_types.toResult)(h.name)])).type(import_types.isResult, (r) => rest.toError(status ?? import_HttpStatus.HttpStatus.BadRequest, [r])).type(import_types.isError, (e) => rest.toError(status ?? import_HttpStatus.HttpStatus.BadRequest, [e])).type(import_types.isResults, (r) => rest.toError(status ?? import_HttpStatus.HttpStatus.BadRequest, r.results)).type(import_Response.isResponse, (r) => rest.toError(status ?? import_HttpStatus.HttpStatus.byId(r.body.error?.code), r.body.error?.errors)).type(hasErrors, (e) => rest.toError(status ?? import_HttpStatus.HttpStatus.byId(e.error.code, import_HttpStatus.HttpStatus.BadRequest), e.error.errors)).type(hasItems, (d) => rest.toData(status ?? import_HttpStatus.HttpStatus.byId(d.data.code, import_HttpStatus.HttpStatus.Ok), d.data.items, d.data.totalItems, d.data.meta)).else((p) => rest.toData(status ?? import_HttpStatus.HttpStatus.Ok, (0, import_types.toList)(p)))
|
|
49
|
+
};
|
|
50
|
+
const isRestResult = (r) => (0, import_types.isDefined)(r) && ((0, import_types.isDefined)(r.data) || (0, import_types.isDefined)(r.error));
|
|
51
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
52
|
+
0 && (module.exports = {
|
|
53
|
+
isRestResult,
|
|
54
|
+
rest
|
|
55
|
+
});
|
|
56
|
+
//# sourceMappingURL=RestResult.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/http/RestResult.ts"],"sourcesContent":["import { choose, Id, isDefined, isError, isResult, isResults, Json, List, Result, toList, toResult } from '../types';\nimport { HttpStatus, isHttpStatus } from './HttpStatus';\nimport { isResponse } from './Response';\n\nexport type RestResult = {\n data?: { code: number; items: List<Json>; itemCount: number; totalItems?: number; meta?: Json };\n error?: { code: number; message: string; errorCount: number; errors: List<Result> };\n};\n\nconst hasErrors = (a: any): a is { error: { code: number; errors: List<Result> } } => isDefined(a?.error?.errors);\nconst hasItems = (a: any): a is { data: { code: number; items: List<Json>; totalItems?: number; meta?: Json } } => isDefined(a?.data.items);\n\nexport const rest = {\n toData: (status: HttpStatus, items: Json[] = [], totalItems?: number, meta?: Json): RestResult => ({\n data: {\n code: status.status,\n items: toList(items),\n itemCount: items.length,\n totalItems,\n meta,\n },\n }),\n toError: (status: HttpStatus, errors: Result[] = [toResult(status.name)]): RestResult => ({\n error: {\n code: status.status,\n message: status.name ?? errors[0].message ?? 'Unknown',\n errors: toList(errors),\n errorCount: errors.length,\n },\n }),\n to: (payload?: any | any[], status?: HttpStatus): RestResult =>\n choose(payload)\n .is.not.defined(p => p, undefined as unknown as RestResult)\n .type(isHttpStatus, h => rest.toError(h ?? status ?? HttpStatus.InternalServerError, [toResult(h.name)]))\n .type(isResult, r => rest.toError(status ?? HttpStatus.BadRequest, [r]))\n .type(isError, e => rest.toError(status ?? HttpStatus.BadRequest, [e]))\n .type(isResults, r => rest.toError(status ?? HttpStatus.BadRequest, r.results))\n .type(isResponse, r => rest.toError(status ?? HttpStatus.byId(r.body.error?.code as Id), r.body.error?.errors))\n .type(hasErrors, e => rest.toError(status ?? HttpStatus.byId(e.error.code, HttpStatus.BadRequest), e.error.errors))\n .type(hasItems, d => rest.toData(status ?? HttpStatus.byId(d.data.code, HttpStatus.Ok), d.data.items, d.data.totalItems, d.data.meta))\n .else(p => rest.toData(status ?? HttpStatus.Ok, toList(p))),\n};\n\nexport const isRestResult = (r: unknown): r is RestResult => isDefined(r) && (isDefined((r as RestResult).data) || isDefined((r as RestResult).error));\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAA0G;AAC1G,wBAAyC;AACzC,sBAA2B;AAO3B,MAAM,YAAY,CAAC,UAAmE,wBAAU,GAAG,OAAO,MAAM;AAChH,MAAM,WAAW,CAAC,UAAiG,wBAAU,GAAG,KAAK,KAAK;AAEnI,MAAM,OAAO;AAAA,EAClB,QAAQ,CAAC,QAAoB,QAAgB,CAAC,GAAG,YAAqB,UAA6B;AAAA,IACjG,MAAM;AAAA,MACJ,MAAM,OAAO;AAAA,MACb,WAAO,qBAAO,KAAK;AAAA,MACnB,WAAW,MAAM;AAAA,MACjB;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAAA,EACA,SAAS,CAAC,QAAoB,SAAmB,KAAC,uBAAS,OAAO,IAAI,CAAC,OAAmB;AAAA,IACxF,OAAO;AAAA,MACL,MAAM,OAAO;AAAA,MACb,SAAS,OAAO,QAAQ,OAAO,CAAC,EAAE,WAAW;AAAA,MAC7C,YAAQ,qBAAO,MAAM;AAAA,MACrB,YAAY,OAAO;AAAA,IACrB;AAAA,EACF;AAAA,EACA,IAAI,CAAC,SAAuB,eAC1B,qBAAO,OAAO,EACX,GAAG,IAAI,QAAQ,OAAK,GAAG,MAAkC,EACzD,KAAK,gCAAc,OAAK,KAAK,QAAQ,KAAK,UAAU,6BAAW,qBAAqB,KAAC,uBAAS,EAAE,IAAI,CAAC,CAAC,CAAC,EACvG,KAAK,uBAAU,OAAK,KAAK,QAAQ,UAAU,6BAAW,YAAY,CAAC,CAAC,CAAC,CAAC,EACtE,KAAK,sBAAS,OAAK,KAAK,QAAQ,UAAU,6BAAW,YAAY,CAAC,CAAC,CAAC,CAAC,EACrE,KAAK,wBAAW,OAAK,KAAK,QAAQ,UAAU,6BAAW,YAAY,EAAE,OAAO,CAAC,EAC7E,KAAK,4BAAY,OAAK,KAAK,QAAQ,UAAU,6BAAW,KAAK,EAAE,KAAK,OAAO,IAAU,GAAG,EAAE,KAAK,OAAO,MAAM,CAAC,EAC7G,KAAK,WAAW,OAAK,KAAK,QAAQ,UAAU,6BAAW,KAAK,EAAE,MAAM,MAAM,6BAAW,UAAU,GAAG,EAAE,MAAM,MAAM,CAAC,EACjH,KAAK,UAAU,OAAK,KAAK,OAAO,UAAU,6BAAW,KAAK,EAAE,KAAK,MAAM,6BAAW,EAAE,GAAG,EAAE,KAAK,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,IAAI,CAAC,EACpI,KAAK,OAAK,KAAK,OAAO,UAAU,6BAAW,QAAI,qBAAO,CAAC,CAAC,CAAC;AAChE;AAEO,MAAM,eAAe,CAAC,UAAgC,wBAAU,CAAC,UAAM,wBAAW,EAAiB,IAAI,SAAK,wBAAW,EAAiB,KAAK;","names":[]}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import "../chunk-4N72FQFX.mjs";
|
|
2
|
+
import { choose, isDefined, isError, isResult, isResults, toList, toResult } from "../types";
|
|
3
|
+
import { HttpStatus, isHttpStatus } from "./HttpStatus";
|
|
4
|
+
import { isResponse } from "./Response";
|
|
5
|
+
const hasErrors = (a) => isDefined(a?.error?.errors);
|
|
6
|
+
const hasItems = (a) => isDefined(a?.data.items);
|
|
7
|
+
const rest = {
|
|
8
|
+
toData: (status, items = [], totalItems, meta) => ({
|
|
9
|
+
data: {
|
|
10
|
+
code: status.status,
|
|
11
|
+
items: toList(items),
|
|
12
|
+
itemCount: items.length,
|
|
13
|
+
totalItems,
|
|
14
|
+
meta
|
|
15
|
+
}
|
|
16
|
+
}),
|
|
17
|
+
toError: (status, errors = [toResult(status.name)]) => ({
|
|
18
|
+
error: {
|
|
19
|
+
code: status.status,
|
|
20
|
+
message: status.name ?? errors[0].message ?? "Unknown",
|
|
21
|
+
errors: toList(errors),
|
|
22
|
+
errorCount: errors.length
|
|
23
|
+
}
|
|
24
|
+
}),
|
|
25
|
+
to: (payload, status) => choose(payload).is.not.defined((p) => p, void 0).type(isHttpStatus, (h) => rest.toError(h ?? status ?? HttpStatus.InternalServerError, [toResult(h.name)])).type(isResult, (r) => rest.toError(status ?? HttpStatus.BadRequest, [r])).type(isError, (e) => rest.toError(status ?? HttpStatus.BadRequest, [e])).type(isResults, (r) => rest.toError(status ?? HttpStatus.BadRequest, r.results)).type(isResponse, (r) => rest.toError(status ?? HttpStatus.byId(r.body.error?.code), r.body.error?.errors)).type(hasErrors, (e) => rest.toError(status ?? HttpStatus.byId(e.error.code, HttpStatus.BadRequest), e.error.errors)).type(hasItems, (d) => rest.toData(status ?? HttpStatus.byId(d.data.code, HttpStatus.Ok), d.data.items, d.data.totalItems, d.data.meta)).else((p) => rest.toData(status ?? HttpStatus.Ok, toList(p)))
|
|
26
|
+
};
|
|
27
|
+
const isRestResult = (r) => isDefined(r) && (isDefined(r.data) || isDefined(r.error));
|
|
28
|
+
export {
|
|
29
|
+
isRestResult,
|
|
30
|
+
rest
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=RestResult.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/http/RestResult.ts"],"sourcesContent":["import { choose, Id, isDefined, isError, isResult, isResults, Json, List, Result, toList, toResult } from '../types';\nimport { HttpStatus, isHttpStatus } from './HttpStatus';\nimport { isResponse } from './Response';\n\nexport type RestResult = {\n data?: { code: number; items: List<Json>; itemCount: number; totalItems?: number; meta?: Json };\n error?: { code: number; message: string; errorCount: number; errors: List<Result> };\n};\n\nconst hasErrors = (a: any): a is { error: { code: number; errors: List<Result> } } => isDefined(a?.error?.errors);\nconst hasItems = (a: any): a is { data: { code: number; items: List<Json>; totalItems?: number; meta?: Json } } => isDefined(a?.data.items);\n\nexport const rest = {\n toData: (status: HttpStatus, items: Json[] = [], totalItems?: number, meta?: Json): RestResult => ({\n data: {\n code: status.status,\n items: toList(items),\n itemCount: items.length,\n totalItems,\n meta,\n },\n }),\n toError: (status: HttpStatus, errors: Result[] = [toResult(status.name)]): RestResult => ({\n error: {\n code: status.status,\n message: status.name ?? errors[0].message ?? 'Unknown',\n errors: toList(errors),\n errorCount: errors.length,\n },\n }),\n to: (payload?: any | any[], status?: HttpStatus): RestResult =>\n choose(payload)\n .is.not.defined(p => p, undefined as unknown as RestResult)\n .type(isHttpStatus, h => rest.toError(h ?? status ?? HttpStatus.InternalServerError, [toResult(h.name)]))\n .type(isResult, r => rest.toError(status ?? HttpStatus.BadRequest, [r]))\n .type(isError, e => rest.toError(status ?? HttpStatus.BadRequest, [e]))\n .type(isResults, r => rest.toError(status ?? HttpStatus.BadRequest, r.results))\n .type(isResponse, r => rest.toError(status ?? HttpStatus.byId(r.body.error?.code as Id), r.body.error?.errors))\n .type(hasErrors, e => rest.toError(status ?? HttpStatus.byId(e.error.code, HttpStatus.BadRequest), e.error.errors))\n .type(hasItems, d => rest.toData(status ?? HttpStatus.byId(d.data.code, HttpStatus.Ok), d.data.items, d.data.totalItems, d.data.meta))\n .else(p => rest.toData(status ?? HttpStatus.Ok, toList(p))),\n};\n\nexport const isRestResult = (r: unknown): r is RestResult => isDefined(r) && (isDefined((r as RestResult).data) || isDefined((r as RestResult).error));\n"],"mappings":";AAAA,SAAS,QAAY,WAAW,SAAS,UAAU,WAA+B,QAAQ,gBAAgB;AAC1G,SAAS,YAAY,oBAAoB;AACzC,SAAS,kBAAkB;AAO3B,MAAM,YAAY,CAAC,MAAmE,UAAU,GAAG,OAAO,MAAM;AAChH,MAAM,WAAW,CAAC,MAAiG,UAAU,GAAG,KAAK,KAAK;AAEnI,MAAM,OAAO;AAAA,EAClB,QAAQ,CAAC,QAAoB,QAAgB,CAAC,GAAG,YAAqB,UAA6B;AAAA,IACjG,MAAM;AAAA,MACJ,MAAM,OAAO;AAAA,MACb,OAAO,OAAO,KAAK;AAAA,MACnB,WAAW,MAAM;AAAA,MACjB;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAAA,EACA,SAAS,CAAC,QAAoB,SAAmB,CAAC,SAAS,OAAO,IAAI,CAAC,OAAmB;AAAA,IACxF,OAAO;AAAA,MACL,MAAM,OAAO;AAAA,MACb,SAAS,OAAO,QAAQ,OAAO,CAAC,EAAE,WAAW;AAAA,MAC7C,QAAQ,OAAO,MAAM;AAAA,MACrB,YAAY,OAAO;AAAA,IACrB;AAAA,EACF;AAAA,EACA,IAAI,CAAC,SAAuB,WAC1B,OAAO,OAAO,EACX,GAAG,IAAI,QAAQ,OAAK,GAAG,MAAkC,EACzD,KAAK,cAAc,OAAK,KAAK,QAAQ,KAAK,UAAU,WAAW,qBAAqB,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC,CAAC,EACvG,KAAK,UAAU,OAAK,KAAK,QAAQ,UAAU,WAAW,YAAY,CAAC,CAAC,CAAC,CAAC,EACtE,KAAK,SAAS,OAAK,KAAK,QAAQ,UAAU,WAAW,YAAY,CAAC,CAAC,CAAC,CAAC,EACrE,KAAK,WAAW,OAAK,KAAK,QAAQ,UAAU,WAAW,YAAY,EAAE,OAAO,CAAC,EAC7E,KAAK,YAAY,OAAK,KAAK,QAAQ,UAAU,WAAW,KAAK,EAAE,KAAK,OAAO,IAAU,GAAG,EAAE,KAAK,OAAO,MAAM,CAAC,EAC7G,KAAK,WAAW,OAAK,KAAK,QAAQ,UAAU,WAAW,KAAK,EAAE,MAAM,MAAM,WAAW,UAAU,GAAG,EAAE,MAAM,MAAM,CAAC,EACjH,KAAK,UAAU,OAAK,KAAK,OAAO,UAAU,WAAW,KAAK,EAAE,KAAK,MAAM,WAAW,EAAE,GAAG,EAAE,KAAK,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,IAAI,CAAC,EACpI,KAAK,OAAK,KAAK,OAAO,UAAU,WAAW,IAAI,OAAO,CAAC,CAAC,CAAC;AAChE;AAEO,MAAM,eAAe,CAAC,MAAgC,UAAU,CAAC,MAAM,UAAW,EAAiB,IAAI,KAAK,UAAW,EAAiB,KAAK;","names":[]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { CacheControl, ContentType, HttpStatus, HttpVerb } from './index';
|
|
2
|
+
export type VerbOptions = {
|
|
3
|
+
onOk?: HttpStatus;
|
|
4
|
+
onNotFound?: HttpStatus;
|
|
5
|
+
onError?: HttpStatus;
|
|
6
|
+
type?: ContentType;
|
|
7
|
+
cache?: CacheControl;
|
|
8
|
+
};
|
|
9
|
+
export type Verb = {
|
|
10
|
+
verb: HttpVerb;
|
|
11
|
+
options: VerbOptions;
|
|
12
|
+
};
|
|
13
|
+
export declare const toVerbOptions: (options?: VerbOptions) => Required<VerbOptions>;
|
|
14
|
+
export declare const get: (options?: VerbOptions) => PropertyDecorator;
|
|
15
|
+
export declare const search: (options?: VerbOptions) => PropertyDecorator;
|
|
16
|
+
export declare const put: (options?: VerbOptions) => PropertyDecorator;
|
|
17
|
+
export declare const patch: (options?: VerbOptions) => PropertyDecorator;
|
|
18
|
+
export declare const post: (options?: VerbOptions) => PropertyDecorator;
|
|
19
|
+
export declare const del: (options?: VerbOptions) => PropertyDecorator;
|
|
20
|
+
export declare const stream: (options?: VerbOptions) => PropertyDecorator;
|