@thisisagile/easy 15.8.4 → 15.8.6
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/index.d.mts +2821 -0
- package/dist/index.d.ts +2821 -12
- package/dist/index.js +1 -29
- package/dist/index.mjs +1 -0
- package/package.json +4 -2
- package/src/process/Manage.ts +15 -4
- package/src/process/Search.ts +24 -9
- package/src/resources/Req.ts +8 -3
- package/src/sql/Join.ts +4 -3
- package/src/utils/If.ts +1 -0
- package/dist/data/Condition.d.ts +0 -25
- package/dist/data/Condition.js +0 -44
- package/dist/data/Condition.js.map +0 -1
- package/dist/data/DataProvider.d.ts +0 -1
- package/dist/data/DataProvider.js +0 -3
- package/dist/data/DataProvider.js.map +0 -1
- package/dist/data/Database.d.ts +0 -22
- package/dist/data/Database.js +0 -18
- package/dist/data/Database.js.map +0 -1
- package/dist/data/Field.d.ts +0 -17
- package/dist/data/Field.js +0 -27
- package/dist/data/Field.js.map +0 -1
- package/dist/data/InMemoryGateway.d.ts +0 -12
- package/dist/data/InMemoryGateway.js +0 -48
- package/dist/data/InMemoryGateway.js.map +0 -1
- package/dist/data/Query.d.ts +0 -2
- package/dist/data/Query.js +0 -3
- package/dist/data/Query.js.map +0 -1
- package/dist/data/QueryProvider.d.ts +0 -7
- package/dist/data/QueryProvider.js +0 -3
- package/dist/data/QueryProvider.js.map +0 -1
- package/dist/data/index.d.ts +0 -7
- package/dist/data/index.js +0 -24
- package/dist/data/index.js.map +0 -1
- package/dist/domain/Audit.d.ts +0 -11
- package/dist/domain/Audit.js +0 -35
- package/dist/domain/Audit.js.map +0 -1
- package/dist/domain/Child.d.ts +0 -6
- package/dist/domain/Child.js +0 -30
- package/dist/domain/Child.js.map +0 -1
- package/dist/domain/Entity.d.ts +0 -9
- package/dist/domain/Entity.js +0 -45
- package/dist/domain/Entity.js.map +0 -1
- package/dist/domain/Repo.d.ts +0 -23
- package/dist/domain/Repo.js +0 -73
- package/dist/domain/Repo.js.map +0 -1
- package/dist/domain/Struct.d.ts +0 -11
- package/dist/domain/Struct.js +0 -31
- package/dist/domain/Struct.js.map +0 -1
- package/dist/domain/Typo.d.ts +0 -16
- package/dist/domain/Typo.js +0 -42
- package/dist/domain/Typo.js.map +0 -1
- package/dist/domain/enums/Country.d.ts +0 -256
- package/dist/domain/enums/Country.js +0 -267
- package/dist/domain/enums/Country.js.map +0 -1
- package/dist/domain/enums/Currency.d.ts +0 -127
- package/dist/domain/enums/Currency.js +0 -136
- package/dist/domain/enums/Currency.js.map +0 -1
- package/dist/domain/enums/Environment.d.ts +0 -7
- package/dist/domain/enums/Environment.js +0 -12
- package/dist/domain/enums/Environment.js.map +0 -1
- package/dist/domain/enums/Locale.d.ts +0 -571
- package/dist/domain/enums/Locale.js +0 -582
- package/dist/domain/enums/Locale.js.map +0 -1
- package/dist/domain/enums/UnitOfMeasurement.d.ts +0 -10
- package/dist/domain/enums/UnitOfMeasurement.js +0 -17
- package/dist/domain/enums/UnitOfMeasurement.js.map +0 -1
- package/dist/domain/enums/UnitOfWeight.d.ts +0 -8
- package/dist/domain/enums/UnitOfWeight.js +0 -15
- package/dist/domain/enums/UnitOfWeight.js.map +0 -1
- package/dist/domain/enums/index.d.ts +0 -6
- package/dist/domain/enums/index.js +0 -23
- package/dist/domain/enums/index.js.map +0 -1
- package/dist/domain/index.d.ts +0 -9
- package/dist/domain/index.js +0 -26
- package/dist/domain/index.js.map +0 -1
- package/dist/domain/structs/Address.d.ts +0 -12
- package/dist/domain/structs/Address.js +0 -57
- package/dist/domain/structs/Address.js.map +0 -1
- package/dist/domain/structs/Box.d.ts +0 -15
- package/dist/domain/structs/Box.js +0 -52
- package/dist/domain/structs/Box.js.map +0 -1
- package/dist/domain/structs/Dimension.d.ts +0 -10
- package/dist/domain/structs/Dimension.js +0 -38
- package/dist/domain/structs/Dimension.js.map +0 -1
- package/dist/domain/structs/Money.d.ts +0 -12
- package/dist/domain/structs/Money.js +0 -53
- package/dist/domain/structs/Money.js.map +0 -1
- package/dist/domain/structs/Name.d.ts +0 -9
- package/dist/domain/structs/Name.js +0 -38
- package/dist/domain/structs/Name.js.map +0 -1
- package/dist/domain/structs/Weight.d.ts +0 -13
- package/dist/domain/structs/Weight.js +0 -48
- package/dist/domain/structs/Weight.js.map +0 -1
- package/dist/domain/structs/index.d.ts +0 -6
- package/dist/domain/structs/index.js +0 -23
- package/dist/domain/structs/index.js.map +0 -1
- package/dist/domain/values/DateTime.d.ts +0 -34
- package/dist/domain/values/DateTime.js +0 -87
- package/dist/domain/values/DateTime.js.map +0 -1
- package/dist/domain/values/EAN.d.ts +0 -5
- package/dist/domain/values/EAN.js +0 -19
- package/dist/domain/values/EAN.js.map +0 -1
- package/dist/domain/values/Email.d.ts +0 -8
- package/dist/domain/values/Email.js +0 -25
- package/dist/domain/values/Email.js.map +0 -1
- package/dist/domain/values/IBAN.d.ts +0 -5
- package/dist/domain/values/IBAN.js +0 -19
- package/dist/domain/values/IBAN.js.map +0 -1
- package/dist/domain/values/PostalCode.d.ts +0 -8
- package/dist/domain/values/PostalCode.js +0 -22
- package/dist/domain/values/PostalCode.js.map +0 -1
- package/dist/domain/values/Url.d.ts +0 -22
- package/dist/domain/values/Url.js +0 -25
- package/dist/domain/values/Url.js.map +0 -1
- package/dist/domain/values/index.d.ts +0 -6
- package/dist/domain/values/index.js +0 -23
- package/dist/domain/values/index.js.map +0 -1
- package/dist/health/HealthResource.d.ts +0 -5
- package/dist/health/HealthResource.js +0 -28
- package/dist/health/HealthResource.js.map +0 -1
- package/dist/health/HealthUri.d.ts +0 -5
- package/dist/health/HealthUri.js +0 -10
- package/dist/health/HealthUri.js.map +0 -1
- package/dist/health/index.d.ts +0 -2
- package/dist/health/index.js +0 -19
- package/dist/health/index.js.map +0 -1
- package/dist/http/CacheControl.d.ts +0 -24
- package/dist/http/CacheControl.js +0 -35
- package/dist/http/CacheControl.js.map +0 -1
- package/dist/http/ContentType.d.ts +0 -12
- package/dist/http/ContentType.js +0 -23
- package/dist/http/ContentType.js.map +0 -1
- package/dist/http/HttpHeader.d.ts +0 -4
- package/dist/http/HttpHeader.js +0 -8
- package/dist/http/HttpHeader.js.map +0 -1
- package/dist/http/HttpStatus.d.ts +0 -72
- package/dist/http/HttpStatus.js +0 -87
- package/dist/http/HttpStatus.js.map +0 -1
- package/dist/http/HttpVerb.d.ts +0 -9
- package/dist/http/HttpVerb.js +0 -16
- package/dist/http/HttpVerb.js.map +0 -1
- package/dist/http/LocalRequestStore.d.ts +0 -7
- package/dist/http/LocalRequestStore.js +0 -15
- package/dist/http/LocalRequestStore.js.map +0 -1
- package/dist/http/OriginatedError.d.ts +0 -9
- package/dist/http/OriginatedError.js +0 -17
- package/dist/http/OriginatedError.js.map +0 -1
- package/dist/http/Request.d.ts +0 -11
- package/dist/http/Request.js +0 -3
- package/dist/http/Request.js.map +0 -1
- package/dist/http/RequestOptions.d.ts +0 -35
- package/dist/http/RequestOptions.js +0 -66
- package/dist/http/RequestOptions.js.map +0 -1
- package/dist/http/RequestProvider.d.ts +0 -5
- package/dist/http/RequestProvider.js +0 -3
- package/dist/http/RequestProvider.js.map +0 -1
- package/dist/http/Response.d.ts +0 -14
- package/dist/http/Response.js +0 -15
- package/dist/http/Response.js.map +0 -1
- package/dist/http/RestResult.d.ts +0 -23
- package/dist/http/RestResult.js +0 -40
- package/dist/http/RestResult.js.map +0 -1
- package/dist/http/Verb.d.ts +0 -20
- package/dist/http/Verb.js +0 -31
- package/dist/http/Verb.js.map +0 -1
- package/dist/http/index.d.ts +0 -12
- package/dist/http/index.js +0 -29
- package/dist/http/index.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/process/App.d.ts +0 -5
- package/dist/process/App.js +0 -12
- package/dist/process/App.js.map +0 -1
- package/dist/process/Manage.d.ts +0 -8
- package/dist/process/Manage.js +0 -15
- package/dist/process/Manage.js.map +0 -1
- package/dist/process/Scope.d.ts +0 -5
- package/dist/process/Scope.js +0 -12
- package/dist/process/Scope.js.map +0 -1
- package/dist/process/Search.d.ts +0 -14
- package/dist/process/Search.js +0 -22
- package/dist/process/Search.js.map +0 -1
- package/dist/process/UseCase.d.ts +0 -10
- package/dist/process/UseCase.js +0 -20
- package/dist/process/UseCase.js.map +0 -1
- package/dist/process/index.d.ts +0 -5
- package/dist/process/index.js +0 -22
- package/dist/process/index.js.map +0 -1
- package/dist/resources/AppProvider.d.ts +0 -9
- package/dist/resources/AppProvider.js +0 -3
- package/dist/resources/AppProvider.js.map +0 -1
- package/dist/resources/Req.d.ts +0 -23
- package/dist/resources/Req.js +0 -26
- package/dist/resources/Req.js.map +0 -1
- package/dist/resources/Requires.d.ts +0 -8
- package/dist/resources/Requires.js +0 -25
- package/dist/resources/Requires.js.map +0 -1
- package/dist/resources/Resource.d.ts +0 -1
- package/dist/resources/Resource.js +0 -3
- package/dist/resources/Resource.js.map +0 -1
- package/dist/resources/Route.d.ts +0 -26
- package/dist/resources/Route.js +0 -36
- package/dist/resources/Route.js.map +0 -1
- package/dist/resources/Service.d.ts +0 -15
- package/dist/resources/Service.js +0 -30
- package/dist/resources/Service.js.map +0 -1
- package/dist/resources/index.d.ts +0 -7
- package/dist/resources/index.js +0 -24
- package/dist/resources/index.js.map +0 -1
- package/dist/security/Jwt.d.ts +0 -15
- package/dist/security/Jwt.js +0 -32
- package/dist/security/Jwt.js.map +0 -1
- package/dist/security/index.d.ts +0 -1
- package/dist/security/index.js +0 -18
- package/dist/security/index.js.map +0 -1
- package/dist/services/Api.d.ts +0 -16
- package/dist/services/Api.js +0 -68
- package/dist/services/Api.js.map +0 -1
- package/dist/services/ApiGateway.d.ts +0 -14
- package/dist/services/ApiGateway.js +0 -34
- package/dist/services/ApiGateway.js.map +0 -1
- package/dist/services/AxiosProvider.d.ts +0 -7
- package/dist/services/AxiosProvider.js +0 -34
- package/dist/services/AxiosProvider.js.map +0 -1
- package/dist/services/MappedRouteGateway.d.ts +0 -16
- package/dist/services/MappedRouteGateway.js +0 -32
- package/dist/services/MappedRouteGateway.js.map +0 -1
- package/dist/services/RouteGateway.d.ts +0 -19
- package/dist/services/RouteGateway.js +0 -49
- package/dist/services/RouteGateway.js.map +0 -1
- package/dist/services/ViewRouteGateway.d.ts +0 -21
- package/dist/services/ViewRouteGateway.js +0 -35
- package/dist/services/ViewRouteGateway.js.map +0 -1
- package/dist/services/index.d.ts +0 -6
- package/dist/services/index.js +0 -23
- package/dist/services/index.js.map +0 -1
- package/dist/sql/Clause.d.ts +0 -17
- package/dist/sql/Clause.js +0 -31
- package/dist/sql/Clause.js.map +0 -1
- package/dist/sql/Column.d.ts +0 -41
- package/dist/sql/Column.js +0 -76
- package/dist/sql/Column.js.map +0 -1
- package/dist/sql/Count.d.ts +0 -7
- package/dist/sql/Count.js +0 -20
- package/dist/sql/Count.js.map +0 -1
- package/dist/sql/Delete.d.ts +0 -4
- package/dist/sql/Delete.js +0 -12
- package/dist/sql/Delete.js.map +0 -1
- package/dist/sql/Insert.d.ts +0 -9
- package/dist/sql/Insert.js +0 -21
- package/dist/sql/Insert.js.map +0 -1
- package/dist/sql/Join.d.ts +0 -12
- package/dist/sql/Join.js +0 -22
- package/dist/sql/Join.js.map +0 -1
- package/dist/sql/Select.d.ts +0 -21
- package/dist/sql/Select.js +0 -53
- package/dist/sql/Select.js.map +0 -1
- package/dist/sql/SqlQuery.d.ts +0 -8
- package/dist/sql/SqlQuery.js +0 -16
- package/dist/sql/SqlQuery.js.map +0 -1
- package/dist/sql/Table.d.ts +0 -34
- package/dist/sql/Table.js +0 -37
- package/dist/sql/Table.js.map +0 -1
- package/dist/sql/TableGateway.d.ts +0 -18
- package/dist/sql/TableGateway.js +0 -47
- package/dist/sql/TableGateway.js.map +0 -1
- package/dist/sql/Update.d.ts +0 -9
- package/dist/sql/Update.js +0 -23
- package/dist/sql/Update.js.map +0 -1
- package/dist/sql/index.d.ts +0 -10
- package/dist/sql/index.js +0 -27
- package/dist/sql/index.js.map +0 -1
- package/dist/types/Array.d.ts +0 -9
- package/dist/types/Array.js +0 -28
- package/dist/types/Array.js.map +0 -1
- package/dist/types/Builder.d.ts +0 -6
- package/dist/types/Builder.js +0 -18
- package/dist/types/Builder.js.map +0 -1
- package/dist/types/Cache.d.ts +0 -12
- package/dist/types/Cache.js +0 -14
- package/dist/types/Cache.js.map +0 -1
- package/dist/types/CacheAge.d.ts +0 -5
- package/dist/types/CacheAge.js +0 -22
- package/dist/types/CacheAge.js.map +0 -1
- package/dist/types/Case.d.ts +0 -59
- package/dist/types/Case.js +0 -100
- package/dist/types/Case.js.map +0 -1
- package/dist/types/Constructor.d.ts +0 -15
- package/dist/types/Constructor.js +0 -22
- package/dist/types/Constructor.js.map +0 -1
- package/dist/types/Context.d.ts +0 -63
- package/dist/types/Context.js +0 -93
- package/dist/types/Context.js.map +0 -1
- package/dist/types/Enum.d.ts +0 -24
- package/dist/types/Enum.js +0 -54
- package/dist/types/Enum.js.map +0 -1
- package/dist/types/ErrorOrigin.d.ts +0 -6
- package/dist/types/ErrorOrigin.js +0 -3
- package/dist/types/ErrorOrigin.js.map +0 -1
- package/dist/types/Exception.d.ts +0 -20
- package/dist/types/Exception.js +0 -29
- package/dist/types/Exception.js.map +0 -1
- package/dist/types/Falsy.d.ts +0 -4
- package/dist/types/Falsy.js +0 -8
- package/dist/types/Falsy.js.map +0 -1
- package/dist/types/Func.d.ts +0 -2
- package/dist/types/Func.js +0 -6
- package/dist/types/Func.js.map +0 -1
- package/dist/types/Gateway.d.ts +0 -18
- package/dist/types/Gateway.js +0 -39
- package/dist/types/Gateway.js.map +0 -1
- package/dist/types/Get.d.ts +0 -7
- package/dist/types/Get.js +0 -11
- package/dist/types/Get.js.map +0 -1
- package/dist/types/Id.d.ts +0 -7
- package/dist/types/Id.js +0 -7
- package/dist/types/Id.js.map +0 -1
- package/dist/types/Identity.d.ts +0 -5
- package/dist/types/Identity.js +0 -3
- package/dist/types/Identity.js.map +0 -1
- package/dist/types/Is.d.ts +0 -20
- package/dist/types/Is.js +0 -46
- package/dist/types/Is.js.map +0 -1
- package/dist/types/IsA.d.ts +0 -2
- package/dist/types/IsA.js +0 -8
- package/dist/types/IsA.js.map +0 -1
- package/dist/types/IsDate.d.ts +0 -9
- package/dist/types/IsDate.js +0 -19
- package/dist/types/IsDate.js.map +0 -1
- package/dist/types/IsEqual.d.ts +0 -1
- package/dist/types/IsEqual.js +0 -21
- package/dist/types/IsEqual.js.map +0 -1
- package/dist/types/Json.d.ts +0 -30
- package/dist/types/Json.js +0 -38
- package/dist/types/Json.js.map +0 -1
- package/dist/types/List.d.ts +0 -52
- package/dist/types/List.js +0 -157
- package/dist/types/List.js.map +0 -1
- package/dist/types/Message.d.ts +0 -3
- package/dist/types/Message.js +0 -7
- package/dist/types/Message.js.map +0 -1
- package/dist/types/Meta.d.ts +0 -33
- package/dist/types/Meta.js +0 -51
- package/dist/types/Meta.js.map +0 -1
- package/dist/types/Nullish.d.ts +0 -2
- package/dist/types/Nullish.js +0 -6
- package/dist/types/Nullish.js.map +0 -1
- package/dist/types/Number.d.ts +0 -2
- package/dist/types/Number.js +0 -13
- package/dist/types/Number.js.map +0 -1
- package/dist/types/PageList.d.ts +0 -68
- package/dist/types/PageList.js +0 -126
- package/dist/types/PageList.js.map +0 -1
- package/dist/types/Primitive.d.ts +0 -2
- package/dist/types/Primitive.js +0 -9
- package/dist/types/Primitive.js.map +0 -1
- package/dist/types/Repository.d.ts +0 -15
- package/dist/types/Repository.js +0 -45
- package/dist/types/Repository.js.map +0 -1
- package/dist/types/Result.d.ts +0 -9
- package/dist/types/Result.js +0 -14
- package/dist/types/Result.js.map +0 -1
- package/dist/types/Results.d.ts +0 -12
- package/dist/types/Results.js +0 -25
- package/dist/types/Results.js.map +0 -1
- package/dist/types/Sort.d.ts +0 -8
- package/dist/types/Sort.js +0 -6
- package/dist/types/Sort.js.map +0 -1
- package/dist/types/Tag.d.ts +0 -2
- package/dist/types/Tag.js +0 -11
- package/dist/types/Tag.js.map +0 -1
- package/dist/types/Template.d.ts +0 -7
- package/dist/types/Template.js +0 -45
- package/dist/types/Template.js.map +0 -1
- package/dist/types/Text.d.ts +0 -45
- package/dist/types/Text.js +0 -106
- package/dist/types/Text.js.map +0 -1
- package/dist/types/Try.d.ts +0 -44
- package/dist/types/Try.js +0 -116
- package/dist/types/Try.js.map +0 -1
- package/dist/types/TypeGuard.d.ts +0 -1
- package/dist/types/TypeGuard.js +0 -3
- package/dist/types/TypeGuard.js.map +0 -1
- package/dist/types/Types.d.ts +0 -5
- package/dist/types/Types.js +0 -3
- package/dist/types/Types.js.map +0 -1
- package/dist/types/Uri.d.ts +0 -69
- package/dist/types/Uri.js +0 -85
- package/dist/types/Uri.js.map +0 -1
- package/dist/types/Uuid.d.ts +0 -3
- package/dist/types/Uuid.js +0 -11
- package/dist/types/Uuid.js.map +0 -1
- package/dist/types/Validatable.d.ts +0 -5
- package/dist/types/Validatable.js +0 -7
- package/dist/types/Validatable.js.map +0 -1
- package/dist/types/Value.d.ts +0 -9
- package/dist/types/Value.js +0 -23
- package/dist/types/Value.js.map +0 -1
- package/dist/types/index.d.ts +0 -42
- package/dist/types/index.js +0 -59
- package/dist/types/index.js.map +0 -1
- package/dist/utils/Convert.d.ts +0 -19
- package/dist/utils/Convert.js +0 -26
- package/dist/utils/Convert.js.map +0 -1
- package/dist/utils/If.d.ts +0 -10
- package/dist/utils/If.js +0 -21
- package/dist/utils/If.js.map +0 -1
- package/dist/utils/Loading.d.ts +0 -1
- package/dist/utils/Loading.js +0 -7
- package/dist/utils/Loading.js.map +0 -1
- package/dist/utils/Log.d.ts +0 -2
- package/dist/utils/Log.js +0 -15
- package/dist/utils/Log.js.map +0 -1
- package/dist/utils/Mapper.d.ts +0 -48
- package/dist/utils/Mapper.js +0 -96
- package/dist/utils/Mapper.js.map +0 -1
- package/dist/utils/Promise.d.ts +0 -18
- package/dist/utils/Promise.js +0 -21
- package/dist/utils/Promise.js.map +0 -1
- package/dist/utils/Property.d.ts +0 -16
- package/dist/utils/Property.js +0 -19
- package/dist/utils/Property.js.map +0 -1
- package/dist/utils/Sentence.d.ts +0 -48
- package/dist/utils/Sentence.js +0 -67
- package/dist/utils/Sentence.js.map +0 -1
- package/dist/utils/State.d.ts +0 -7
- package/dist/utils/State.js +0 -13
- package/dist/utils/State.js.map +0 -1
- package/dist/utils/Traverse.d.ts +0 -1
- package/dist/utils/Traverse.js +0 -10
- package/dist/utils/Traverse.js.map +0 -1
- package/dist/utils/View.d.ts +0 -36
- package/dist/utils/View.js +0 -62
- package/dist/utils/View.js.map +0 -1
- package/dist/utils/Wait.d.ts +0 -5
- package/dist/utils/Wait.js +0 -15
- package/dist/utils/Wait.js.map +0 -1
- package/dist/utils/index.d.ts +0 -12
- package/dist/utils/index.js +0 -29
- package/dist/utils/index.js.map +0 -1
- package/dist/validation/Contraints.d.ts +0 -19
- package/dist/validation/Contraints.js +0 -51
- package/dist/validation/Contraints.js.map +0 -1
- package/dist/validation/Validate.d.ts +0 -11
- package/dist/validation/Validate.js +0 -28
- package/dist/validation/Validate.js.map +0 -1
- package/dist/validation/When.d.ts +0 -22
- package/dist/validation/When.js +0 -44
- package/dist/validation/When.js.map +0 -1
- package/dist/validation/index.d.ts +0 -3
- package/dist/validation/index.js +0 -20
- package/dist/validation/index.js.map +0 -1
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import { Code, Enum, TypeGuard } from '../types';
|
|
2
|
-
export declare class HttpStatus extends Enum {
|
|
3
|
-
static Continue: HttpStatus;
|
|
4
|
-
static SwitchingProtocols: HttpStatus;
|
|
5
|
-
static Processing: HttpStatus;
|
|
6
|
-
static EarlyHints: HttpStatus;
|
|
7
|
-
static Ok: HttpStatus;
|
|
8
|
-
static Created: HttpStatus;
|
|
9
|
-
static Accepted: HttpStatus;
|
|
10
|
-
static NonAuthoritativeInformation: HttpStatus;
|
|
11
|
-
static NoContent: HttpStatus;
|
|
12
|
-
static ResetContent: HttpStatus;
|
|
13
|
-
static PartialContent: HttpStatus;
|
|
14
|
-
static MultiStatus: HttpStatus;
|
|
15
|
-
static AlreadyReported: HttpStatus;
|
|
16
|
-
static ImUsed: HttpStatus;
|
|
17
|
-
static MultipleChoices: HttpStatus;
|
|
18
|
-
static MovedPermanently: HttpStatus;
|
|
19
|
-
static Found: HttpStatus;
|
|
20
|
-
static SeeOther: HttpStatus;
|
|
21
|
-
static NotModified: HttpStatus;
|
|
22
|
-
static UseProxy: HttpStatus;
|
|
23
|
-
static SwitchProxy: HttpStatus;
|
|
24
|
-
static TemporaryRedirect: HttpStatus;
|
|
25
|
-
static PermanentRedirect: HttpStatus;
|
|
26
|
-
static BadRequest: HttpStatus;
|
|
27
|
-
static NotAuthorized: HttpStatus;
|
|
28
|
-
static PaymentRequired: HttpStatus;
|
|
29
|
-
static Forbidden: HttpStatus;
|
|
30
|
-
static NotFound: HttpStatus;
|
|
31
|
-
static MethodNotAllowed: HttpStatus;
|
|
32
|
-
static NotAcceptable: HttpStatus;
|
|
33
|
-
static ProxyAuthenticationRequired: HttpStatus;
|
|
34
|
-
static RequestTimeout: HttpStatus;
|
|
35
|
-
static Conflict: HttpStatus;
|
|
36
|
-
static Gone: HttpStatus;
|
|
37
|
-
static LengthRequired: HttpStatus;
|
|
38
|
-
static PreconditionFailed: HttpStatus;
|
|
39
|
-
static PayloadTooLarge: HttpStatus;
|
|
40
|
-
static UriTooLong: HttpStatus;
|
|
41
|
-
static UnsupportedMediaType: HttpStatus;
|
|
42
|
-
static RangeNotSatisfiable: HttpStatus;
|
|
43
|
-
static ExpectationFailed: HttpStatus;
|
|
44
|
-
static ImATeapot: HttpStatus;
|
|
45
|
-
static MisdirectedRequest: HttpStatus;
|
|
46
|
-
static UnprocessableEntity: HttpStatus;
|
|
47
|
-
static Locked: HttpStatus;
|
|
48
|
-
static FailedDependency: HttpStatus;
|
|
49
|
-
static TooEarly: HttpStatus;
|
|
50
|
-
static UpgradeRequired: HttpStatus;
|
|
51
|
-
static PreconditionRequired: HttpStatus;
|
|
52
|
-
static TooManyRequests: HttpStatus;
|
|
53
|
-
static RequestHeaderFieldsTooLarge: HttpStatus;
|
|
54
|
-
static UnavailableForLegalReasons: HttpStatus;
|
|
55
|
-
static InternalServerError: HttpStatus;
|
|
56
|
-
static NotImplemented: HttpStatus;
|
|
57
|
-
static BadGateway: HttpStatus;
|
|
58
|
-
static ServiceUnavailable: HttpStatus;
|
|
59
|
-
static GatewayTimeout: HttpStatus;
|
|
60
|
-
static HTTPVersionNotSupported: HttpStatus;
|
|
61
|
-
static VariantAlsoNegotiates: HttpStatus;
|
|
62
|
-
static InsufficientStorage: HttpStatus;
|
|
63
|
-
static LoopDetected: HttpStatus;
|
|
64
|
-
static NotExtended: HttpStatus;
|
|
65
|
-
static NetworkAuthenticationRequired: HttpStatus;
|
|
66
|
-
get isError(): boolean;
|
|
67
|
-
get isClientError(): boolean;
|
|
68
|
-
get isServerError(): boolean;
|
|
69
|
-
get status(): number;
|
|
70
|
-
}
|
|
71
|
-
export declare const isHttpStatus: TypeGuard<HttpStatus>;
|
|
72
|
-
export declare const toHttpStatus: (s: HttpStatus | Code) => HttpStatus;
|
package/dist/http/HttpStatus.js
DELETED
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.toHttpStatus = exports.isHttpStatus = exports.HttpStatus = void 0;
|
|
4
|
-
const types_1 = require("../types");
|
|
5
|
-
class HttpStatus extends types_1.Enum {
|
|
6
|
-
get isError() {
|
|
7
|
-
return this.isClientError || this.isServerError;
|
|
8
|
-
}
|
|
9
|
-
get isClientError() {
|
|
10
|
-
return this.id >= 400 && this.id < 500;
|
|
11
|
-
}
|
|
12
|
-
get isServerError() {
|
|
13
|
-
return this.id >= 500 && this.id < 600;
|
|
14
|
-
}
|
|
15
|
-
get status() {
|
|
16
|
-
return this.id;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
exports.HttpStatus = HttpStatus;
|
|
20
|
-
HttpStatus.Continue = new HttpStatus('Continue', 100);
|
|
21
|
-
HttpStatus.SwitchingProtocols = new HttpStatus('Switching protocols', 101);
|
|
22
|
-
HttpStatus.Processing = new HttpStatus('Processing', 102);
|
|
23
|
-
HttpStatus.EarlyHints = new HttpStatus('Early hints', 103);
|
|
24
|
-
HttpStatus.Ok = new HttpStatus('Ok', 200);
|
|
25
|
-
HttpStatus.Created = new HttpStatus('Created', 201);
|
|
26
|
-
HttpStatus.Accepted = new HttpStatus('Accepted', 202);
|
|
27
|
-
HttpStatus.NonAuthoritativeInformation = new HttpStatus('Non-authoritative information', 203);
|
|
28
|
-
HttpStatus.NoContent = new HttpStatus('No content', 204);
|
|
29
|
-
HttpStatus.ResetContent = new HttpStatus('Reset content', 205);
|
|
30
|
-
HttpStatus.PartialContent = new HttpStatus('Partial content', 206);
|
|
31
|
-
HttpStatus.MultiStatus = new HttpStatus('Multi-status', 207);
|
|
32
|
-
HttpStatus.AlreadyReported = new HttpStatus('Already reported', 208);
|
|
33
|
-
HttpStatus.ImUsed = new HttpStatus('IM used', 226);
|
|
34
|
-
HttpStatus.MultipleChoices = new HttpStatus('Multiple Choices', 300);
|
|
35
|
-
HttpStatus.MovedPermanently = new HttpStatus('Moved Permanently', 301);
|
|
36
|
-
HttpStatus.Found = new HttpStatus('Found', 302);
|
|
37
|
-
HttpStatus.SeeOther = new HttpStatus('See other', 303);
|
|
38
|
-
HttpStatus.NotModified = new HttpStatus('Not modified', 304);
|
|
39
|
-
HttpStatus.UseProxy = new HttpStatus('Use proxy', 305);
|
|
40
|
-
HttpStatus.SwitchProxy = new HttpStatus('Switch proxy', 306);
|
|
41
|
-
HttpStatus.TemporaryRedirect = new HttpStatus('Temporary redirect', 307);
|
|
42
|
-
HttpStatus.PermanentRedirect = new HttpStatus('Permanent redirect', 308);
|
|
43
|
-
HttpStatus.BadRequest = new HttpStatus('Bad request', 400);
|
|
44
|
-
HttpStatus.NotAuthorized = new HttpStatus('Not authorized', 401);
|
|
45
|
-
HttpStatus.PaymentRequired = new HttpStatus('Payment required', 402);
|
|
46
|
-
HttpStatus.Forbidden = new HttpStatus('Forbidden', 403);
|
|
47
|
-
HttpStatus.NotFound = new HttpStatus('Not found', 404);
|
|
48
|
-
HttpStatus.MethodNotAllowed = new HttpStatus('Method not allowed', 405);
|
|
49
|
-
HttpStatus.NotAcceptable = new HttpStatus('Not acceptable', 406);
|
|
50
|
-
HttpStatus.ProxyAuthenticationRequired = new HttpStatus('Proxy authentication required', 407);
|
|
51
|
-
HttpStatus.RequestTimeout = new HttpStatus('Request timeout', 408);
|
|
52
|
-
HttpStatus.Conflict = new HttpStatus('Conflict', 409);
|
|
53
|
-
HttpStatus.Gone = new HttpStatus('Gone', 410);
|
|
54
|
-
HttpStatus.LengthRequired = new HttpStatus('Length required', 411);
|
|
55
|
-
HttpStatus.PreconditionFailed = new HttpStatus('Precondition failed', 412);
|
|
56
|
-
HttpStatus.PayloadTooLarge = new HttpStatus('Payload too large', 413);
|
|
57
|
-
HttpStatus.UriTooLong = new HttpStatus('URI too long', 414);
|
|
58
|
-
HttpStatus.UnsupportedMediaType = new HttpStatus('Unsupported media type', 415);
|
|
59
|
-
HttpStatus.RangeNotSatisfiable = new HttpStatus('Range not satisfiable', 416);
|
|
60
|
-
HttpStatus.ExpectationFailed = new HttpStatus('Expectation failed', 417);
|
|
61
|
-
HttpStatus.ImATeapot = new HttpStatus("I'm a teapot", 418);
|
|
62
|
-
HttpStatus.MisdirectedRequest = new HttpStatus('Misdirected request', 421);
|
|
63
|
-
HttpStatus.UnprocessableEntity = new HttpStatus('Unprocessable entity', 422);
|
|
64
|
-
HttpStatus.Locked = new HttpStatus('Locked', 423);
|
|
65
|
-
HttpStatus.FailedDependency = new HttpStatus('Failed dependency', 424);
|
|
66
|
-
HttpStatus.TooEarly = new HttpStatus('Too early', 425);
|
|
67
|
-
HttpStatus.UpgradeRequired = new HttpStatus('Upgrade required', 426);
|
|
68
|
-
HttpStatus.PreconditionRequired = new HttpStatus('Precondition required', 428);
|
|
69
|
-
HttpStatus.TooManyRequests = new HttpStatus('Too many requests', 429);
|
|
70
|
-
HttpStatus.RequestHeaderFieldsTooLarge = new HttpStatus('Request header fields too large', 431);
|
|
71
|
-
HttpStatus.UnavailableForLegalReasons = new HttpStatus('Unavailable for legal reasons', 451);
|
|
72
|
-
HttpStatus.InternalServerError = new HttpStatus('Internal server error', 500);
|
|
73
|
-
HttpStatus.NotImplemented = new HttpStatus('Not implemented', 501);
|
|
74
|
-
HttpStatus.BadGateway = new HttpStatus('Bad gateway', 502);
|
|
75
|
-
HttpStatus.ServiceUnavailable = new HttpStatus('Service unavailable', 503);
|
|
76
|
-
HttpStatus.GatewayTimeout = new HttpStatus('Gateway timeout', 504);
|
|
77
|
-
HttpStatus.HTTPVersionNotSupported = new HttpStatus('Http version not supported', 505);
|
|
78
|
-
HttpStatus.VariantAlsoNegotiates = new HttpStatus('Variant also negotiates', 506);
|
|
79
|
-
HttpStatus.InsufficientStorage = new HttpStatus('Insufficient storage', 507);
|
|
80
|
-
HttpStatus.LoopDetected = new HttpStatus('Loop detected', 508);
|
|
81
|
-
HttpStatus.NotExtended = new HttpStatus('Not extended', 510);
|
|
82
|
-
HttpStatus.NetworkAuthenticationRequired = new HttpStatus('Network authentication required', 511);
|
|
83
|
-
const isHttpStatus = (s) => (0, types_1.isAn)(s, 'id', 'status');
|
|
84
|
-
exports.isHttpStatus = isHttpStatus;
|
|
85
|
-
const toHttpStatus = (s) => ((0, exports.isHttpStatus)(s) ? s : HttpStatus.byId(s));
|
|
86
|
-
exports.toHttpStatus = toHttpStatus;
|
|
87
|
-
//# sourceMappingURL=HttpStatus.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"HttpStatus.js","sourceRoot":"","sources":["../../src/http/HttpStatus.ts"],"names":[],"mappings":";;;AAAA,oCAAuD;AAEvD,MAAa,UAAW,SAAQ,YAAI;IAiElC,IAAI,OAAO;QACT,OAAO,IAAI,CAAC,aAAa,IAAI,IAAI,CAAC,aAAa,CAAC;IAClD,CAAC;IAED,IAA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AC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;AAAhG,QAAA,YAAY,gBAAoF"}
|
package/dist/http/HttpVerb.d.ts
DELETED
package/dist/http/HttpVerb.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.HttpVerb = void 0;
|
|
4
|
-
const types_1 = require("../types");
|
|
5
|
-
class HttpVerb extends types_1.Enum {
|
|
6
|
-
constructor(name) {
|
|
7
|
-
super(name, name.toLowerCase(), name.toUpperCase());
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
exports.HttpVerb = HttpVerb;
|
|
11
|
-
HttpVerb.Get = new HttpVerb('Get');
|
|
12
|
-
HttpVerb.Put = new HttpVerb('Put');
|
|
13
|
-
HttpVerb.Patch = new HttpVerb('Patch');
|
|
14
|
-
HttpVerb.Post = new HttpVerb('Post');
|
|
15
|
-
HttpVerb.Delete = new HttpVerb('Delete');
|
|
16
|
-
//# sourceMappingURL=HttpVerb.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"HttpVerb.js","sourceRoot":"","sources":["../../src/http/HttpVerb.ts"],"names":[],"mappings":";;;AAAA,oCAAgC;AAEhC,MAAa,QAAS,SAAQ,YAAI;IAOhC,YAAY,IAAY;QACtB,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,WAAW,EAAE,EAAE,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;IACtD,CAAC;;AATH,4BAUC;AATQ,YAAG,GAAG,IAAI,QAAQ,CAAC,KAAK,CAAC,CAAC;AAC1B,YAAG,GAAG,IAAI,QAAQ,CAAC,KAAK,CAAC,CAAC;AAC1B,cAAK,GAAG,IAAI,QAAQ,CAAC,OAAO,CAAC,CAAC;AAC9B,aAAI,GAAG,IAAI,QAAQ,CAAC,MAAM,CAAC,CAAC;AAC5B,eAAM,GAAG,IAAI,QAAQ,CAAC,QAAQ,CAAC,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { Func, Store } from '../types';
|
|
2
|
-
import { Response } from './Response';
|
|
3
|
-
import { Request } from './Request';
|
|
4
|
-
export declare class LocalRequestStore implements Store<Response, Request> {
|
|
5
|
-
key: (_req: Request) => string;
|
|
6
|
-
execute(req: Request, f: Func<Promise<Response>, Request>): Promise<Response>;
|
|
7
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.LocalRequestStore = void 0;
|
|
4
|
-
const types_1 = require("../types");
|
|
5
|
-
class LocalRequestStore {
|
|
6
|
-
constructor() {
|
|
7
|
-
this.key = (_req) => '';
|
|
8
|
-
}
|
|
9
|
-
execute(req, f) {
|
|
10
|
-
const key = this.key(req);
|
|
11
|
-
return types_1.ctx.request.get(key) ?? types_1.ctx.request.set(key, f(req));
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
exports.LocalRequestStore = LocalRequestStore;
|
|
15
|
-
//# sourceMappingURL=LocalRequestStore.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"LocalRequestStore.js","sourceRoot":"","sources":["../../src/http/LocalRequestStore.ts"],"names":[],"mappings":";;;AAAA,oCAA4C;AAI5C,MAAa,iBAAiB;IAA9B;QACE,QAAG,GAAG,CAAC,IAAa,EAAU,EAAE,CAAC,EAAE,CAAC;IAMtC,CAAC;IAJC,OAAO,CAAC,GAAY,EAAE,CAAmC;QACvD,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAC1B,OAAO,WAAG,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,WAAG,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IAC9D,CAAC;CACF;AAPD,8CAOC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { ErrorOrigin } from '../types';
|
|
2
|
-
import { VerbOptions } from './Verb';
|
|
3
|
-
export declare class OriginatedError extends Error {
|
|
4
|
-
readonly origin: ErrorOrigin;
|
|
5
|
-
readonly options?: VerbOptions | undefined;
|
|
6
|
-
constructor(origin: ErrorOrigin, options?: VerbOptions | undefined);
|
|
7
|
-
}
|
|
8
|
-
export declare const isOriginatedError: (e?: unknown) => e is OriginatedError;
|
|
9
|
-
export declare const toOriginatedError: (e: unknown, options?: VerbOptions) => OriginatedError;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.toOriginatedError = exports.isOriginatedError = exports.OriginatedError = void 0;
|
|
4
|
-
const types_1 = require("../types");
|
|
5
|
-
class OriginatedError extends Error {
|
|
6
|
-
constructor(origin, options) {
|
|
7
|
-
super();
|
|
8
|
-
this.origin = origin;
|
|
9
|
-
this.options = options;
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
exports.OriginatedError = OriginatedError;
|
|
13
|
-
const isOriginatedError = (e) => (0, types_1.isError)(e) && e instanceof OriginatedError;
|
|
14
|
-
exports.isOriginatedError = isOriginatedError;
|
|
15
|
-
const toOriginatedError = (e, options) => (0, exports.isOriginatedError)(e) ? e : new OriginatedError(e, options);
|
|
16
|
-
exports.toOriginatedError = toOriginatedError;
|
|
17
|
-
//# sourceMappingURL=OriginatedError.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"OriginatedError.js","sourceRoot":"","sources":["../../src/http/OriginatedError.ts"],"names":[],"mappings":";;;AAAA,oCAAgD;AAGhD,MAAa,eAAgB,SAAQ,KAAK;IACxC,YAAqB,MAAmB,EAAW,OAAqB;QACtE,KAAK,EAAE,CAAC;QADW,WAAM,GAAN,MAAM,CAAa;QAAW,YAAO,GAAP,OAAO,CAAc;IAExE,CAAC;CACF;AAJD,0CAIC;AAEM,MAAM,iBAAiB,GAAG,CAAC,CAAW,EAAwB,EAAE,CAAC,IAAA,eAAO,EAAC,CAAC,CAAC,IAAI,CAAC,YAAY,eAAe,CAAC;AAAtG,QAAA,iBAAiB,qBAAqF;AAE5G,MAAM,iBAAiB,GAAG,CAAC,CAAU,EAAE,OAAqB,EAAmB,EAAE,CACtF,IAAA,yBAAiB,EAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,eAAe,CAAC,CAAgB,EAAE,OAAO,CAAC,CAAC;AAD/D,QAAA,iBAAiB,qBAC8C"}
|
package/dist/http/Request.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
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
|
-
};
|
package/dist/http/Request.js
DELETED
package/dist/http/Request.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Request.js","sourceRoot":"","sources":["../../src/http/Request.ts"],"names":[],"mappings":""}
|
|
@@ -1,35 +0,0 @@
|
|
|
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;
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isRequestOptions = exports.RequestOptions = exports.toPageOptions = void 0;
|
|
4
|
-
const types_1 = require("../types");
|
|
5
|
-
const HttpHeader_1 = require("./HttpHeader");
|
|
6
|
-
const ContentType_1 = require("./ContentType");
|
|
7
|
-
const toPageOptions = (options) => options instanceof RequestOptions ? options.pageOptions : options;
|
|
8
|
-
exports.toPageOptions = toPageOptions;
|
|
9
|
-
class RequestOptions extends types_1.Enum {
|
|
10
|
-
constructor(type = ContentType_1.ContentType.Json, headers = {}, pageOptions) {
|
|
11
|
-
super(type.name);
|
|
12
|
-
this.type = type;
|
|
13
|
-
this.headers = headers;
|
|
14
|
-
this.pageOptions = pageOptions;
|
|
15
|
-
this.requestOptions = {};
|
|
16
|
-
this.page = (options) => {
|
|
17
|
-
this.pageOptions = options;
|
|
18
|
-
return this;
|
|
19
|
-
};
|
|
20
|
-
this.authorization = (auth) => this.setHeader('Authorization', auth);
|
|
21
|
-
this.apiKey = (apiKey) => this.setHeader('apiKey', apiKey);
|
|
22
|
-
this.setHeader = (key, value) => (0, types_1.on)(this, t => (t.headers[(0, types_1.asString)(key)] = value));
|
|
23
|
-
this.setHeaderUnlessPresent = (key, value) => (value ? this.setHeader(key, this.headers[key] ?? value) : this);
|
|
24
|
-
this.accept = (type) => this.setHeader('Accept', type.id);
|
|
25
|
-
this.bearer = (jwt) => {
|
|
26
|
-
return (0, types_1.isNotEmpty)(jwt) ? this.authorization(`Bearer ${jwt}`) : this;
|
|
27
|
-
};
|
|
28
|
-
this.basic = (username, password) => {
|
|
29
|
-
const basicAuth = Buffer.from(`${username}:${password}`, 'utf8').toString('base64');
|
|
30
|
-
return this.authorization(`Basic ${basicAuth}`);
|
|
31
|
-
};
|
|
32
|
-
this.maxRedirects = (max) => {
|
|
33
|
-
this.requestOptions.maxRedirects = max;
|
|
34
|
-
return this;
|
|
35
|
-
};
|
|
36
|
-
this.validateStatus = (validate) => {
|
|
37
|
-
this.requestOptions.validateStatus = validate;
|
|
38
|
-
return this;
|
|
39
|
-
};
|
|
40
|
-
this.timeout = (t) => {
|
|
41
|
-
this.requestOptions.timeout = t;
|
|
42
|
-
return this;
|
|
43
|
-
};
|
|
44
|
-
this.headers['Content-Type'] = type.id;
|
|
45
|
-
this.headers[HttpHeader_1.HttpHeader.Correlation] = types_1.ctx.request.correlationId ?? (0, types_1.toUuid)();
|
|
46
|
-
}
|
|
47
|
-
static get Form() {
|
|
48
|
-
return new RequestOptions(ContentType_1.ContentType.Form);
|
|
49
|
-
}
|
|
50
|
-
static get Json() {
|
|
51
|
-
return new RequestOptions(ContentType_1.ContentType.Json);
|
|
52
|
-
}
|
|
53
|
-
static get Stream() {
|
|
54
|
-
return new RequestOptions(ContentType_1.ContentType.Stream);
|
|
55
|
-
}
|
|
56
|
-
static get Text() {
|
|
57
|
-
return new RequestOptions(ContentType_1.ContentType.Text);
|
|
58
|
-
}
|
|
59
|
-
static get Xml() {
|
|
60
|
-
return new RequestOptions(ContentType_1.ContentType.Xml);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
exports.RequestOptions = RequestOptions;
|
|
64
|
-
const isRequestOptions = (o) => (0, types_1.isDefined)(o) && o instanceof RequestOptions;
|
|
65
|
-
exports.isRequestOptions = isRequestOptions;
|
|
66
|
-
//# sourceMappingURL=RequestOptions.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RequestOptions.js","sourceRoot":"","sources":["../../src/http/RequestOptions.ts"],"names":[],"mappings":";;;AAAA,oCAA6H;AAC7H,6CAA0C;AAC1C,+CAA4C;AAErC,MAAM,aAAa,GAAG,CAAC,OAAsC,EAAyB,EAAE,CAC7F,OAAO,YAAY,cAAc,CAAC,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC;AADvD,QAAA,aAAa,iBAC0C;AAEpE,MAAa,cAAe,SAAQ,YAAI;IAGtC,YAAqB,OAAoB,yBAAW,CAAC,IAAI,EAAW,UAAkC,EAAE,EAAS,WAAyB;QACxI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QADE,SAAI,GAAJ,IAAI,CAAgC;QAAW,YAAO,GAAP,OAAO,CAA6B;QAAS,gBAAW,GAAX,WAAW,CAAc;QAFnI,mBAAc,GAAgG,EAAE,CAAC;QA4BxH,SAAI,GAAG,CAAC,OAAoB,EAAQ,EAAE;YACpC,IAAI,CAAC,WAAW,GAAG,OAAO,CAAC;YAC3B,OAAO,IAAI,CAAC;QACd,CAAC,CAAC;QAE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C,IAAI,CAAC,YAAY,cAAc,CAAC;AAArG,QAAA,gBAAgB,oBAAqF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RequestProvider.js","sourceRoot":"","sources":["../../src/http/RequestProvider.ts"],"names":[],"mappings":""}
|
package/dist/http/Response.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
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;
|
package/dist/http/Response.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.toResponse = exports.isResponse = void 0;
|
|
4
|
-
const HttpStatus_1 = require("./HttpStatus");
|
|
5
|
-
const RestResult_1 = require("./RestResult");
|
|
6
|
-
const types_1 = require("../types");
|
|
7
|
-
const isResponse = (r) => (0, types_1.isA)(r, 'status', 'body');
|
|
8
|
-
exports.isResponse = isResponse;
|
|
9
|
-
const toResponse = (status, body, headers) => ({
|
|
10
|
-
status: (0, HttpStatus_1.toHttpStatus)(status),
|
|
11
|
-
headers,
|
|
12
|
-
body: RestResult_1.rest.to(body),
|
|
13
|
-
});
|
|
14
|
-
exports.toResponse = toResponse;
|
|
15
|
-
//# sourceMappingURL=Response.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Response.js","sourceRoot":"","sources":["../../src/http/Response.ts"],"names":[],"mappings":";;;AAAA,6CAAwD;AACxD,6CAAgD;AAChD,oCAAgD;AAQzC,MAAM,UAAU,GAAwB,CAAC,CAAW,EAAiB,EAAE,CAAC,IAAA,WAAG,EAAW,CAAC,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;AAArG,QAAA,UAAU,cAA2F;AAE3G,MAAM,UAAU,GAAG,CAAC,MAAyB,EAAE,IAAc,EAAE,OAAgC,EAAY,EAAE,CAAC,CAAC;IACpH,MAAM,EAAE,IAAA,yBAAY,EAAC,MAAM,CAAC;IAC5B,OAAO;IACP,IAAI,EAAE,iBAAI,CAAC,EAAE,CAAC,IAAI,CAAC;CACpB,CAAC,CAAC;AAJU,QAAA,UAAU,cAIpB"}
|
|
@@ -1,23 +0,0 @@
|
|
|
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;
|
package/dist/http/RestResult.js
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isRestResult = exports.rest = void 0;
|
|
4
|
-
const types_1 = require("../types");
|
|
5
|
-
const HttpStatus_1 = require("./HttpStatus");
|
|
6
|
-
const Response_1 = require("./Response");
|
|
7
|
-
const hasErrors = (a) => (0, types_1.isDefined)(a?.error?.errors);
|
|
8
|
-
const hasItems = (a) => (0, types_1.isDefined)(a?.data.items);
|
|
9
|
-
exports.rest = {
|
|
10
|
-
toData: (status, items = [], totalItems, meta) => ({
|
|
11
|
-
data: {
|
|
12
|
-
code: status.status,
|
|
13
|
-
items: (0, types_1.toList)(items),
|
|
14
|
-
itemCount: items.length,
|
|
15
|
-
totalItems,
|
|
16
|
-
meta,
|
|
17
|
-
},
|
|
18
|
-
}),
|
|
19
|
-
toError: (status, errors = [(0, types_1.toResult)(status.name)]) => ({
|
|
20
|
-
error: {
|
|
21
|
-
code: status.status,
|
|
22
|
-
message: status.name ?? errors[0].message ?? 'Unknown',
|
|
23
|
-
errors: (0, types_1.toList)(errors),
|
|
24
|
-
errorCount: errors.length,
|
|
25
|
-
},
|
|
26
|
-
}),
|
|
27
|
-
to: (payload, status) => (0, types_1.choose)(payload)
|
|
28
|
-
.is.not.defined(p => p, undefined)
|
|
29
|
-
.type(HttpStatus_1.isHttpStatus, h => exports.rest.toError(h ?? status ?? HttpStatus_1.HttpStatus.InternalServerError, [(0, types_1.toResult)(h.name)]))
|
|
30
|
-
.type(types_1.isResult, r => exports.rest.toError(status ?? HttpStatus_1.HttpStatus.BadRequest, [r]))
|
|
31
|
-
.type(types_1.isError, e => exports.rest.toError(status ?? HttpStatus_1.HttpStatus.BadRequest, [e]))
|
|
32
|
-
.type(types_1.isResults, r => exports.rest.toError(status ?? HttpStatus_1.HttpStatus.BadRequest, r.results))
|
|
33
|
-
.type(Response_1.isResponse, r => exports.rest.toError(status ?? HttpStatus_1.HttpStatus.byId(r.body.error?.code), r.body.error?.errors))
|
|
34
|
-
.type(hasErrors, e => exports.rest.toError(status ?? HttpStatus_1.HttpStatus.byId(e.error.code, HttpStatus_1.HttpStatus.BadRequest), e.error.errors))
|
|
35
|
-
.type(hasItems, d => exports.rest.toData(status ?? HttpStatus_1.HttpStatus.byId(d.data.code, HttpStatus_1.HttpStatus.Ok), d.data.items, d.data.totalItems, d.data.meta))
|
|
36
|
-
.else(p => exports.rest.toData(status ?? HttpStatus_1.HttpStatus.Ok, (0, types_1.toList)(p))),
|
|
37
|
-
};
|
|
38
|
-
const isRestResult = (r) => (0, types_1.isDefined)(r) && ((0, types_1.isDefined)(r.data) || (0, types_1.isDefined)(r.error));
|
|
39
|
-
exports.isRestResult = isRestResult;
|
|
40
|
-
//# sourceMappingURL=RestResult.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RestResult.js","sourceRoot":"","sources":["../../src/http/RestResult.ts"],"names":[],"mappings":";;;AAAA,oCAAqH;AACrH,6CAAwD;AACxD,yCAAwC;AAOxC,MAAM,SAAS,GAAG,CAAC,CAAM,EAA0D,EAAE,CAAC,IAAA,iBAAS,EAAC,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;AAClH,MAAM,QAAQ,GAAG,CAAC,CAAM,EAAwF,EAAE,CAAC,IAAA,iBAAS,EAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;AAE/H,QAAA,IAAI,GAAG;IAClB,MAAM,EAAE,CAAC,MAAkB,EAAE,QAAgB,EAAE,EAAE,UAAmB,EAAE,IAAW,EAAc,EAAE,CAAC,CAAC;QACjG,IAAI,EAAE;YACJ,IAAI,EAAE,MAAM,CAAC,MAAM;YACnB,KAAK,EAAE,IAAA,cAAM,EAAC,KAAK,CAAC;YACpB,SAAS,EAAE,KAAK,CAAC,MAAM;YACvB,UAAU;YACV,IAAI;SACL;KACF,CAAC;IACF,OAAO,EAAE,CAAC,MAAkB,EAAE,SAAmB,CAAC,IAAA,gBAAQ,EAAC,MAAM,CAAC,IAAI,CAAC,CAAC,EAAc,EAAE,CAAC,CAAC;QACxF,KAAK,EAAE;YACL,IAAI,EAAE,MAAM,CAAC,MAAM;YACnB,OAAO,EAAE,MA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AAI,CAAC,SAAS,EAAE,CAAC,CAAC,EAAE,CAAC,YAAI,CAAC,OAAO,CAAC,MAAM,IAAI,uBAAU,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,EAAE,uBAAU,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;SAClH,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC,EAAE,CAAC,YAAI,CAAC,MAAM,CAAC,MAAM,IAAI,uBAAU,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,uBAAU,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;SACrI,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,YAAI,CAAC,MAAM,CAAC,MAAM,IAAI,uBAAU,CAAC,EAAE,EAAE,IAAA,cAAM,EAAC,CAAC,CAAC,CAAC,CAAC;CAChE,CAAC;AAEK,MAAM,YAAY,GAAG,CAAC,CAAU,EAAmB,EAAE,CAAC,IAAA,iBAAS,EAAC,CAAC,CAAC,IAAI,CAAC,IAAA,iBAAS,EAAE,CAAgB,CAAC,IAAI,CAAC,IAAI,IAAA,iBAAS,EAAE,CAAgB,CAAC,KAAK,CAAC,CAAC,CAAC;AAA1I,QAAA,YAAY,gBAA8H"}
|
package/dist/http/Verb.d.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
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;
|
package/dist/http/Verb.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.stream = exports.del = exports.post = exports.patch = exports.put = exports.search = exports.get = exports.toVerbOptions = void 0;
|
|
4
|
-
const types_1 = require("../types");
|
|
5
|
-
const index_1 = require("./index");
|
|
6
|
-
const toVerbOptions = (options) => ({
|
|
7
|
-
onOk: options?.onOk ?? index_1.HttpStatus.Ok,
|
|
8
|
-
onNotFound: options?.onNotFound ?? index_1.HttpStatus.NotFound,
|
|
9
|
-
onError: options?.onError ?? index_1.HttpStatus.BadRequest,
|
|
10
|
-
type: options?.type ?? index_1.ContentType.Json,
|
|
11
|
-
cache: options?.cache ?? index_1.CacheControl.disabled(),
|
|
12
|
-
});
|
|
13
|
-
exports.toVerbOptions = toVerbOptions;
|
|
14
|
-
const toVerb = (verb, options) => (subject, property) => {
|
|
15
|
-
(0, types_1.meta)(subject).property(property).set('verb', { verb, options });
|
|
16
|
-
};
|
|
17
|
-
const get = (options) => toVerb(index_1.HttpVerb.Get, options);
|
|
18
|
-
exports.get = get;
|
|
19
|
-
const search = (options) => toVerb(index_1.HttpVerb.Get, { onNotFound: index_1.HttpStatus.Ok, ...options });
|
|
20
|
-
exports.search = search;
|
|
21
|
-
const put = (options) => toVerb(index_1.HttpVerb.Put, options);
|
|
22
|
-
exports.put = put;
|
|
23
|
-
const patch = (options) => toVerb(index_1.HttpVerb.Patch, options);
|
|
24
|
-
exports.patch = patch;
|
|
25
|
-
const post = (options) => toVerb(index_1.HttpVerb.Post, { onOk: index_1.HttpStatus.Created, ...options });
|
|
26
|
-
exports.post = post;
|
|
27
|
-
const del = (options) => toVerb(index_1.HttpVerb.Delete, { onOk: index_1.HttpStatus.NoContent, ...options });
|
|
28
|
-
exports.del = del;
|
|
29
|
-
const stream = (options) => toVerb(index_1.HttpVerb.Get, { type: index_1.ContentType.Stream, ...options });
|
|
30
|
-
exports.stream = stream;
|
|
31
|
-
//# sourceMappingURL=Verb.js.map
|
package/dist/http/Verb.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Verb.js","sourceRoot":"","sources":["../../src/http/Verb.ts"],"names":[],"mappings":";;;AAAA,oCAAgC;AAChC,mCAA0E;AAKnE,MAAM,aAAa,GAAG,CAAC,OAAqB,EAAyB,EAAE,CAAC,CAAC;IAC9E,IAAI,EAAE,OAAO,EAAE,IAAI,IAAI,kBAAU,CAAC,EAAE;IACpC,UAAU,EAAE,OAAO,EAAE,UAAU,IAAI,kBAAU,CAAC,QAAQ;IACtD,OAAO,EAAE,OAAO,EAAE,OAAO,IAAI,kBAAU,CAAC,UAAU;IAClD,IAAI,EAAE,OAAO,EAAE,IAAI,IAAI,mBAAW,CAAC,IAAI;IACvC,KAAK,EAAE,OAAO,EAAE,KAAK,IAAI,oBAAY,CAAC,QAAQ,EAAE;CACjD,CAAC,CAAC;AANU,QAAA,aAAa,iBAMvB;AAEH,MAAM,MAAM,GACV,CAAI,IAAc,EAAE,OAAqB,EAAqB,EAAE,CAChE,CAAC,OAAgB,EAAE,QAAyB,EAAQ,EAAE;IACpD,IAAA,YAAI,EAAC,OAAO,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,GAAG,CAA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EAAE,CAAC,CAAC;AAAtH,QAAA,MAAM,UAAgH"}
|
package/dist/http/index.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export * from './CacheControl';
|
|
2
|
-
export * from './ContentType';
|
|
3
|
-
export * from './HttpHeader';
|
|
4
|
-
export * from './HttpStatus';
|
|
5
|
-
export * from './HttpVerb';
|
|
6
|
-
export * from './OriginatedError';
|
|
7
|
-
export * from './Request';
|
|
8
|
-
export * from './RequestOptions';
|
|
9
|
-
export * from './RequestProvider';
|
|
10
|
-
export * from './Response';
|
|
11
|
-
export * from './RestResult';
|
|
12
|
-
export * from './Verb';
|
package/dist/http/index.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./CacheControl"), exports);
|
|
18
|
-
__exportStar(require("./ContentType"), exports);
|
|
19
|
-
__exportStar(require("./HttpHeader"), exports);
|
|
20
|
-
__exportStar(require("./HttpStatus"), exports);
|
|
21
|
-
__exportStar(require("./HttpVerb"), exports);
|
|
22
|
-
__exportStar(require("./OriginatedError"), exports);
|
|
23
|
-
__exportStar(require("./Request"), exports);
|
|
24
|
-
__exportStar(require("./RequestOptions"), exports);
|
|
25
|
-
__exportStar(require("./RequestProvider"), exports);
|
|
26
|
-
__exportStar(require("./Response"), exports);
|
|
27
|
-
__exportStar(require("./RestResult"), exports);
|
|
28
|
-
__exportStar(require("./Verb"), exports);
|
|
29
|
-
//# sourceMappingURL=index.js.map
|
package/dist/http/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/http/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iDAA+B;AAC/B,gDAA8B;AAC9B,+CAA6B;AAC7B,+CAA6B;AAC7B,6CAA2B;AAC3B,oDAAkC;AAClC,4CAA0B;AAC1B,mDAAiC;AACjC,oDAAkC;AAClC,6CAA2B;AAC3B,+CAA6B;AAC7B,yCAAuB"}
|
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yCAAuB;AACvB,2CAAyB;AACzB,yCAAuB;AACvB,2CAAyB;AACzB,4CAA0B;AAC1B,8CAA4B;AAC5B,6CAA2B;AAC3B,6CAA2B;AAC3B,wCAAsB;AACtB,0CAAwB;AACxB,0CAAwB;AACxB,+CAA6B"}
|