@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
package/dist/index.d.ts
CHANGED
|
@@ -1,12 +1,2821 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import { DateTimeUnit as DateTimeUnit$1, DateTime as DateTime$1 } from 'luxon';
|
|
2
|
+
import { RequestHandler } from 'express';
|
|
3
|
+
import { AxiosInstance } from 'axios';
|
|
4
|
+
|
|
5
|
+
type OneOrMore<T> = T | Array<T>;
|
|
6
|
+
type ArrayLike<T> = OneOrMore<T>[];
|
|
7
|
+
declare const toArray: <T>(...items: ArrayLike<T>) => T[];
|
|
8
|
+
declare const toObject: <T>(key: keyof T, ...items: ArrayLike<T>) => Record<string | number | symbol, T>;
|
|
9
|
+
declare const array: {
|
|
10
|
+
merge: (first?: any[], second?: any[], firstKey?: string, secondKey?: string) => any[];
|
|
11
|
+
switch: <T>(items: T[] | undefined, item: T) => T[];
|
|
12
|
+
splitIn: <T_1>(items?: T_1[], length?: number) => T_1[][];
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
type Func$1<T, Args = unknown> = (...args: Args[]) => T;
|
|
16
|
+
declare const isFunc: <T, Args>(o?: unknown) => o is (...params: Args[]) => T;
|
|
17
|
+
|
|
18
|
+
type Get<T = any, Args = any> = Func$1<T, Args> | T;
|
|
19
|
+
type Predicate<Args = unknown> = Get<boolean, Args>;
|
|
20
|
+
declare const ofGet: <T, Args = any>(g: Get<T, Args>, ...args: Args[]) => T;
|
|
21
|
+
declare const ifGet: <T>(pred: Get, valid: Get<T, any>, invalid: Get<T, any>) => T;
|
|
22
|
+
type GetProperty<T, Prop> = keyof T | Func$1<Prop, T>;
|
|
23
|
+
declare const ofProperty: <T, Prop>(t: T, p: GetProperty<T, Prop>) => Prop;
|
|
24
|
+
|
|
25
|
+
type DontInfer<T> = [T][T extends any ? 0 : never];
|
|
26
|
+
type Optional<T> = T | undefined;
|
|
27
|
+
type PartialRecord<K extends keyof any, T> = {
|
|
28
|
+
[P in K]?: T;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
type Constructor<T = unknown> = {
|
|
32
|
+
new (...args: any[]): T;
|
|
33
|
+
};
|
|
34
|
+
type Construct<Out, In = any> = Get<Out, In> | Constructor<Out>;
|
|
35
|
+
declare const isConstructor: <T>(c?: unknown) => c is Constructor<T>;
|
|
36
|
+
declare const ofConstruct: <T>(c: Construct<T, any>, ...args: unknown[]) => T;
|
|
37
|
+
declare const toName: (subject?: unknown, postfix?: string) => string;
|
|
38
|
+
declare const on: <T>(t: T, f: (t: T) => unknown) => T;
|
|
39
|
+
declare const use: <T, Out>(t: T, f: (t: T) => Out) => Out;
|
|
40
|
+
declare const ifA: <T>(c: Constructor<T>, t?: unknown, alt?: unknown) => Optional<T>;
|
|
41
|
+
type RequireAtLeastOne<T, Keys extends keyof T = keyof T> = Pick<T, Exclude<keyof T, Keys>> & {
|
|
42
|
+
[K in Keys]-?: Required<Pick<T, K>> & Partial<Pick<T, Exclude<Keys, K>>>;
|
|
43
|
+
}[Keys];
|
|
44
|
+
|
|
45
|
+
declare const build: {
|
|
46
|
+
singleton: <T>(ctr: Constructor<T>, ...args: any[]) => T;
|
|
47
|
+
reset: () => void;
|
|
48
|
+
};
|
|
49
|
+
declare const singleton: <T>(ctr: Constructor<T>, ...args: any[]) => T;
|
|
50
|
+
|
|
51
|
+
type CacheAge = `${number}${'ms' | 's' | 'm' | 'h' | 'd'}` | number;
|
|
52
|
+
declare const cacheAge: {
|
|
53
|
+
toMilliseconds: (ca: CacheAge) => number;
|
|
54
|
+
toSeconds: (ca: CacheAge) => number;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
interface Store<To = any, From = any> {
|
|
58
|
+
execute: (fetch: From, f: Func$1<Promise<To>, From>) => Promise<To>;
|
|
59
|
+
}
|
|
60
|
+
type CacheOptions = {
|
|
61
|
+
expiresIn?: CacheAge;
|
|
62
|
+
store?: Construct<Store>;
|
|
63
|
+
};
|
|
64
|
+
declare const toCacheOptions: (co: Partial<CacheOptions>) => CacheOptions;
|
|
65
|
+
declare const cache: (options: Partial<CacheOptions>) => ClassDecorator;
|
|
66
|
+
|
|
67
|
+
declare class CaseBuilder<V> {
|
|
68
|
+
readonly v: V;
|
|
69
|
+
constructor(v: V);
|
|
70
|
+
case<T>(pred: Predicate<V>, out: Get<T, V>): Case<T, V>;
|
|
71
|
+
type<T, U = unknown>(guard: TypeGuard<U>, out: Func$1<T, U>): Case<T, V>;
|
|
72
|
+
equals<T>(value: V, out: Get<T, V>): Case<T, V>;
|
|
73
|
+
is: {
|
|
74
|
+
defined: <T>(prop: Func$1<unknown, V>, out: Get<T, V>) => Case<T, V>;
|
|
75
|
+
empty: <T_1>(prop: Func$1<unknown, V>, out: Get<T_1, V>) => Case<T_1, V>;
|
|
76
|
+
valid: <T_2>(prop: Func$1<unknown, V>, out: Get<T_2, V>) => Case<T_2, V>;
|
|
77
|
+
not: {
|
|
78
|
+
defined: <T_3>(prop: Func$1<unknown, V>, out: Get<T_3, V>) => Case<T_3, V>;
|
|
79
|
+
empty: <T_4>(prop: Func$1<unknown, V>, out: Get<T_4, V>) => Case<T_4, V>;
|
|
80
|
+
valid: <T_5>(prop: Func$1<unknown, V>, out: Get<T_5, V>) => Case<T_5, V>;
|
|
81
|
+
};
|
|
82
|
+
};
|
|
83
|
+
if: {
|
|
84
|
+
defined: <T>(prop: Func$1<unknown, V>, out: Get<T, V>) => Case<T, V>;
|
|
85
|
+
empty: <T_1>(prop: Func$1<unknown, V>, out: Get<T_1, V>) => Case<T_1, V>;
|
|
86
|
+
valid: <T_2>(prop: Func$1<unknown, V>, out: Get<T_2, V>) => Case<T_2, V>;
|
|
87
|
+
not: {
|
|
88
|
+
defined: <T_3>(prop: Func$1<unknown, V>, out: Get<T_3, V>) => Case<T_3, V>;
|
|
89
|
+
empty: <T_4>(prop: Func$1<unknown, V>, out: Get<T_4, V>) => Case<T_4, V>;
|
|
90
|
+
valid: <T_5>(prop: Func$1<unknown, V>, out: Get<T_5, V>) => Case<T_5, V>;
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
declare class Case<T, V = unknown> {
|
|
95
|
+
protected value: V;
|
|
96
|
+
protected outcome?: T | undefined;
|
|
97
|
+
constructor(value: V, outcome?: T | undefined);
|
|
98
|
+
case(pred: Predicate<V>, out: Get<T, V>): Case<T, V>;
|
|
99
|
+
type<U>(guard: TypeGuard<U>, out: Func$1<T, U>): Case<T, V>;
|
|
100
|
+
equals(value: V, out: Get<T, V>): Case<T, V>;
|
|
101
|
+
is: {
|
|
102
|
+
defined: (prop: Func$1<unknown, V>, out: Get<T, V>) => Case<T, V>;
|
|
103
|
+
empty: (prop: Func$1<unknown, V>, out: Get<T, V>) => Case<T, V>;
|
|
104
|
+
valid: (prop: Func$1<unknown, V>, out: Get<T, V>) => Case<T, V>;
|
|
105
|
+
not: {
|
|
106
|
+
defined: (prop: Func$1<unknown, V>, out: Get<T, V>) => Case<T, V>;
|
|
107
|
+
empty: (prop: Func$1<unknown, V>, out: Get<T, V>) => Case<T, V>;
|
|
108
|
+
valid: (prop: Func$1<unknown, V>, out: Get<T, V>) => Case<T, V>;
|
|
109
|
+
};
|
|
110
|
+
};
|
|
111
|
+
if: {
|
|
112
|
+
defined: (prop: Func$1<unknown, V>, out: Get<T, V>) => Case<T, V>;
|
|
113
|
+
empty: (prop: Func$1<unknown, V>, out: Get<T, V>) => Case<T, V>;
|
|
114
|
+
valid: (prop: Func$1<unknown, V>, out: Get<T, V>) => Case<T, V>;
|
|
115
|
+
not: {
|
|
116
|
+
defined: (prop: Func$1<unknown, V>, out: Get<T, V>) => Case<T, V>;
|
|
117
|
+
empty: (prop: Func$1<unknown, V>, out: Get<T, V>) => Case<T, V>;
|
|
118
|
+
valid: (prop: Func$1<unknown, V>, out: Get<T, V>) => Case<T, V>;
|
|
119
|
+
};
|
|
120
|
+
};
|
|
121
|
+
else(alt: Get<T, V>): T;
|
|
122
|
+
}
|
|
123
|
+
declare const choose: <V>(value: V) => CaseBuilder<V>;
|
|
124
|
+
|
|
125
|
+
type Uuid = string;
|
|
126
|
+
declare const isUuid: (id?: unknown) => id is string;
|
|
127
|
+
declare const toUuid: () => Uuid;
|
|
128
|
+
|
|
129
|
+
type Id = string | number;
|
|
130
|
+
type Key = Id;
|
|
131
|
+
type Code = Id;
|
|
132
|
+
type HasId = {
|
|
133
|
+
id: Id;
|
|
134
|
+
};
|
|
135
|
+
declare const toId: () => Id;
|
|
136
|
+
|
|
137
|
+
type Identity = {
|
|
138
|
+
id: Id;
|
|
139
|
+
user?: string;
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
interface EnvContext {
|
|
143
|
+
readonly domain: string;
|
|
144
|
+
readonly name: string;
|
|
145
|
+
readonly host: string;
|
|
146
|
+
readonly port: number;
|
|
147
|
+
readonly app: string;
|
|
148
|
+
get(key: string, alt?: string): Optional<string>;
|
|
149
|
+
}
|
|
150
|
+
declare class DotEnvContext implements EnvContext {
|
|
151
|
+
readonly domain: string;
|
|
152
|
+
readonly name: string;
|
|
153
|
+
readonly host: string;
|
|
154
|
+
readonly port: number;
|
|
155
|
+
readonly app: string;
|
|
156
|
+
readonly get: (key: string, alt?: string) => Optional<string>;
|
|
157
|
+
}
|
|
158
|
+
interface RequestContext {
|
|
159
|
+
token?: any;
|
|
160
|
+
identity?: Identity;
|
|
161
|
+
jwt: string;
|
|
162
|
+
correlationId?: Uuid;
|
|
163
|
+
lastError?: string;
|
|
164
|
+
get<T>(key: string): T;
|
|
165
|
+
set<T>(key: string, value: T): T;
|
|
166
|
+
create: (f: () => void) => void;
|
|
167
|
+
wrap<T>(f: () => Promise<T>): Promise<T>;
|
|
168
|
+
}
|
|
169
|
+
declare class BaseRequestContext implements RequestContext {
|
|
170
|
+
private state;
|
|
171
|
+
get token(): any;
|
|
172
|
+
set token(token: any);
|
|
173
|
+
get identity(): Identity;
|
|
174
|
+
get jwt(): string;
|
|
175
|
+
set jwt(jwt: string);
|
|
176
|
+
get correlationId(): Uuid;
|
|
177
|
+
set correlationId(id: Uuid);
|
|
178
|
+
get lastError(): Optional<string>;
|
|
179
|
+
set lastError(error: Optional<string>);
|
|
180
|
+
get<T>(key: string): T;
|
|
181
|
+
set<T>(key: string, value: T): T;
|
|
182
|
+
readonly create: (f: () => void) => void;
|
|
183
|
+
readonly wrap: <T>(f: () => Promise<T>) => Promise<T>;
|
|
184
|
+
}
|
|
185
|
+
declare class BaseContext extends BaseRequestContext {
|
|
186
|
+
}
|
|
187
|
+
interface Contexts {
|
|
188
|
+
env?: EnvContext;
|
|
189
|
+
request?: RequestContext;
|
|
190
|
+
other?: any;
|
|
191
|
+
}
|
|
192
|
+
declare class Context {
|
|
193
|
+
protected state: Contexts;
|
|
194
|
+
constructor(state?: Contexts);
|
|
195
|
+
get env(): EnvContext;
|
|
196
|
+
set env(env: EnvContext);
|
|
197
|
+
get request(): RequestContext;
|
|
198
|
+
set request(request: RequestContext);
|
|
199
|
+
get other(): any;
|
|
200
|
+
}
|
|
201
|
+
declare const ctx: Context;
|
|
202
|
+
|
|
203
|
+
type TypeGuard<T extends From, From = unknown> = (value?: From) => value is T;
|
|
204
|
+
|
|
205
|
+
type JsonValue = string | number | boolean | null | Json | JsonValue[];
|
|
206
|
+
type Json = {
|
|
207
|
+
[key: string]: JsonValue;
|
|
208
|
+
};
|
|
209
|
+
declare const isJson: TypeGuard<{
|
|
210
|
+
toJSON: () => Json;
|
|
211
|
+
}>;
|
|
212
|
+
declare const json: {
|
|
213
|
+
parse: <T extends Json = Json>(subject: unknown) => T;
|
|
214
|
+
merge: (...subjects: unknown[]) => Json;
|
|
215
|
+
delete: <T_1 extends Json = Json>(subject: T_1, key: string) => T_1;
|
|
216
|
+
set: <T_2 extends Json = Json>(subject: T_2, key?: string, value?: unknown) => T_2;
|
|
217
|
+
omit: <T_3 extends Json = Json>(subject: T_3, ...keys: string[]) => T_3;
|
|
218
|
+
defaults: <T_4 extends Json = Json>(options?: Partial<T_4>, defaults?: Partial<T_4>) => T_4;
|
|
219
|
+
};
|
|
220
|
+
declare const toJson: (...subjects: unknown[]) => Json;
|
|
221
|
+
declare const asJson: (j?: unknown, alt?: Get<Json>) => Json;
|
|
222
|
+
declare class Any<T extends Json> {
|
|
223
|
+
readonly value: T;
|
|
224
|
+
constructor(value: T);
|
|
225
|
+
merge: (...subjects: T[]) => Any<T>;
|
|
226
|
+
delete: (key: keyof T) => Any<T>;
|
|
227
|
+
omit: (...keys: (keyof T)[]) => Any<T>;
|
|
228
|
+
set: (key: keyof T, value?: unknown) => Any<T>;
|
|
229
|
+
toJSON(): Json;
|
|
230
|
+
}
|
|
231
|
+
declare const any: <T extends Json = Json>(value: T) => Any<T>;
|
|
232
|
+
|
|
233
|
+
declare class List<T = unknown> extends Array<T> {
|
|
234
|
+
asc(p: GetProperty<T, any>): List<T>;
|
|
235
|
+
desc(p: GetProperty<T, any>): List<T>;
|
|
236
|
+
first(p?: (value: T, index: number, array: T[]) => unknown, params?: unknown): T;
|
|
237
|
+
firstValue<V>(f: (t: T) => V, alt?: Get<V, T>): Optional<V>;
|
|
238
|
+
isFirst(value: T): boolean;
|
|
239
|
+
next(p?: (value: T, index: number, array: T[]) => unknown, params?: unknown): T;
|
|
240
|
+
prev(p?: (value: T, index: number, array: T[]) => unknown, params?: unknown): T;
|
|
241
|
+
last(p?: (value: T, index: number, array: T[]) => unknown, params?: unknown): T;
|
|
242
|
+
isLast(value: T): boolean;
|
|
243
|
+
overlaps(...items: ArrayLike<T>): boolean;
|
|
244
|
+
diff(others: ArrayLike<T>): List<T>;
|
|
245
|
+
diffByKey(others: ArrayLike<T>, key: keyof T): List<T>;
|
|
246
|
+
intersect(others: ArrayLike<T>): List<T>;
|
|
247
|
+
intersectByKey(others: ArrayLike<T>, key: keyof T): List<T>;
|
|
248
|
+
toJSON(): Json[];
|
|
249
|
+
map<U>(f: (value: T, index: number, array: T[]) => U, params?: unknown): List<U>;
|
|
250
|
+
flatMap<U, This = unknown>(f: (this: This, value: T, index: number, array: T[]) => ReadonlyArray<U> | U, params?: This): List<U>;
|
|
251
|
+
mapDefined<U>(f: (value: T, index: number, array: T[]) => U, params?: unknown): List<NonNullable<U>>;
|
|
252
|
+
mapAsync(f: (i: T) => Promise<T>): Promise<List<T>>;
|
|
253
|
+
distinct(): List<T>;
|
|
254
|
+
distinctByKey(key: keyof T): List<T>;
|
|
255
|
+
filter(p: (value: T, index: number, array: T[]) => unknown, params?: unknown): List<T>;
|
|
256
|
+
sum(p: (t: T) => number): number;
|
|
257
|
+
byId(id: Id): T;
|
|
258
|
+
add(...items: ArrayLike<T>): this;
|
|
259
|
+
concat(...items: ConcatArray<T>[]): List<T>;
|
|
260
|
+
concat(...items: (T | ConcatArray<T>)[]): List<T>;
|
|
261
|
+
reverse(): List<T>;
|
|
262
|
+
splice(start: number, deleteCount?: number): List<T>;
|
|
263
|
+
splice(start: number, deleteCount: number, ...items: T[]): List<T>;
|
|
264
|
+
remove(item: T): List<T>;
|
|
265
|
+
replace(key: keyof T, item: T): List<T>;
|
|
266
|
+
switch(item: T): List<T>;
|
|
267
|
+
defined(): List<NonNullable<T>>;
|
|
268
|
+
toObject(key: keyof T, options?: {
|
|
269
|
+
deleteKey?: boolean;
|
|
270
|
+
}): Record<string | number | symbol, T>;
|
|
271
|
+
toObjectList(key: keyof T): Record<string | number | symbol, List<T>>;
|
|
272
|
+
orElse(...alt: ArrayLike<T>): Optional<List<T>>;
|
|
273
|
+
weave(insertFrom: T[], interval: number): this;
|
|
274
|
+
slice(start?: number, end?: number): List<T>;
|
|
275
|
+
}
|
|
276
|
+
declare const toList: <T = unknown>(...items: ArrayLike<T>) => List<T>;
|
|
277
|
+
declare const isList: <T>(l?: unknown) => l is List<T>;
|
|
278
|
+
declare const asList: <T>(c: Constructor<T>, items?: unknown | unknown[]) => List<T>;
|
|
279
|
+
|
|
280
|
+
interface Validatable {
|
|
281
|
+
isValid: boolean;
|
|
282
|
+
}
|
|
283
|
+
declare const isValidatable: TypeGuard<Validatable>;
|
|
284
|
+
|
|
285
|
+
declare abstract class Enum implements Validatable {
|
|
286
|
+
readonly name: string;
|
|
287
|
+
readonly id: Id;
|
|
288
|
+
readonly code: string;
|
|
289
|
+
protected constructor(name: string, id?: Id, code?: string);
|
|
290
|
+
get isValid(): boolean;
|
|
291
|
+
static all<E extends Enum>(): List<E>;
|
|
292
|
+
protected static allTuple<E extends Enum>(): Record<Id, E>;
|
|
293
|
+
static filter<E extends Enum>(p: (value: E, index: number, array: E[]) => unknown, params?: unknown): List<E>;
|
|
294
|
+
static first<E extends Enum>(p?: (value: E, index: number, array: E[]) => unknown, params?: unknown): E;
|
|
295
|
+
static byIds<E extends Enum>(ids?: Id[]): List<E>;
|
|
296
|
+
static byId<E extends Enum>(id: Id, alt?: Get<E, unknown>): E;
|
|
297
|
+
equals<E extends Enum>(other: E | Id): other is E;
|
|
298
|
+
isIn<E extends Enum>(...items: E[] | Id[]): boolean;
|
|
299
|
+
toJSON(): JsonValue;
|
|
300
|
+
toString(): string;
|
|
301
|
+
}
|
|
302
|
+
declare const isEnum: TypeGuard<Enum>;
|
|
303
|
+
|
|
304
|
+
type Text = {
|
|
305
|
+
toString(): string;
|
|
306
|
+
};
|
|
307
|
+
declare const isText: (t?: unknown) => t is Text;
|
|
308
|
+
declare const asString: (t?: unknown, alt?: Get<Text>) => string;
|
|
309
|
+
declare const replaceAll: (origin: Text, search: Text, replace?: Text) => string;
|
|
310
|
+
declare const kebab: (s?: string) => string;
|
|
311
|
+
declare class ToText implements Text {
|
|
312
|
+
readonly subject: string;
|
|
313
|
+
constructor(subject: string);
|
|
314
|
+
get cap(): ToText;
|
|
315
|
+
get title(): ToText;
|
|
316
|
+
get pascal(): ToText;
|
|
317
|
+
get lower(): ToText;
|
|
318
|
+
get upper(): ToText;
|
|
319
|
+
get camel(): ToText;
|
|
320
|
+
get kebab(): ToText;
|
|
321
|
+
get strictKebab(): ToText;
|
|
322
|
+
get snake(): ToText;
|
|
323
|
+
get plural(): ToText;
|
|
324
|
+
get space(): ToText;
|
|
325
|
+
get sentence(): ToText;
|
|
326
|
+
get initials(): ToText;
|
|
327
|
+
get trim(): ToText;
|
|
328
|
+
get isEmpty(): boolean;
|
|
329
|
+
parse: (subject: unknown, options?: {}) => ToText;
|
|
330
|
+
is: (...others: unknown[]) => boolean;
|
|
331
|
+
equals: (...others: unknown[]) => boolean;
|
|
332
|
+
isLike: (...others: unknown[]) => boolean;
|
|
333
|
+
ifLike: (...others: unknown[]) => Optional<this>;
|
|
334
|
+
endsWith: (end?: unknown) => boolean;
|
|
335
|
+
startsWith: (end?: unknown) => boolean;
|
|
336
|
+
first: (n: number) => ToText;
|
|
337
|
+
last: (n: number) => ToText;
|
|
338
|
+
map: (func: Get<string, string>) => ToText;
|
|
339
|
+
replace: (search: Text, replace: Text) => ToText;
|
|
340
|
+
add: (add?: unknown, separator?: string) => ToText;
|
|
341
|
+
with: (separator: string, ...other: unknown[]) => ToText;
|
|
342
|
+
toString(): string;
|
|
343
|
+
toJSON(): JsonValue;
|
|
344
|
+
}
|
|
345
|
+
declare const text: (subject?: unknown, alt?: string) => ToText;
|
|
346
|
+
|
|
347
|
+
declare class Exception extends Enum {
|
|
348
|
+
readonly message: string;
|
|
349
|
+
readonly reason?: Text | undefined;
|
|
350
|
+
static readonly AlreadyExists: Exception;
|
|
351
|
+
static readonly DoesNotExist: Exception;
|
|
352
|
+
static readonly IsMissingId: Exception;
|
|
353
|
+
static readonly IsNotImplemented: Exception;
|
|
354
|
+
static readonly IsNotValid: Exception;
|
|
355
|
+
static readonly Unknown: Exception;
|
|
356
|
+
constructor(message: string, id?: Id, reason?: Text | undefined);
|
|
357
|
+
static readonly CouldNotExecute: (target: Text) => Exception;
|
|
358
|
+
static readonly CouldNotValidate: (target: Text) => Exception;
|
|
359
|
+
static readonly EnvironmentVariableNotFound: (variable: Text) => Exception;
|
|
360
|
+
because: (reason: Text) => Exception;
|
|
361
|
+
}
|
|
362
|
+
declare const isException: (e?: unknown, t?: Text) => e is Exception;
|
|
363
|
+
declare const isDoesNotExist: (e?: unknown) => e is Exception;
|
|
364
|
+
|
|
365
|
+
declare class CacheControl {
|
|
366
|
+
readonly enabled: boolean;
|
|
367
|
+
private directives;
|
|
368
|
+
name: string;
|
|
369
|
+
protected constructor(enabled?: boolean, directives?: Record<string, boolean | CacheAge | undefined>);
|
|
370
|
+
static disabled: () => CacheControl;
|
|
371
|
+
static OneSecond: () => CacheControl;
|
|
372
|
+
static fiveSeconds: () => CacheControl;
|
|
373
|
+
static tenSeconds: () => CacheControl;
|
|
374
|
+
static thirtySeconds: () => CacheControl;
|
|
375
|
+
static sixtySeconds: () => CacheControl;
|
|
376
|
+
static custom: (maxAge?: CacheAge, staleWhileRevalidate?: CacheAge) => CacheControl;
|
|
377
|
+
readonly maxAge: (ca?: CacheAge) => this;
|
|
378
|
+
readonly sharedMaxAge: (ca?: CacheAge) => this;
|
|
379
|
+
readonly noCache: (a?: boolean) => this;
|
|
380
|
+
readonly mustRevalidate: (a?: boolean) => this;
|
|
381
|
+
readonly private: (a?: boolean) => this;
|
|
382
|
+
readonly public: (a?: boolean) => this;
|
|
383
|
+
readonly immutable: (a?: boolean) => this;
|
|
384
|
+
readonly staleWhileRevalidate: (ca?: CacheAge) => this;
|
|
385
|
+
value: () => string;
|
|
386
|
+
toString(): string;
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
declare class ContentType extends Enum {
|
|
390
|
+
readonly type: string;
|
|
391
|
+
protected readonly encoder: Get<string>;
|
|
392
|
+
static Form: ContentType;
|
|
393
|
+
static Json: ContentType;
|
|
394
|
+
static Stream: ContentType;
|
|
395
|
+
static Text: ContentType;
|
|
396
|
+
static Xml: ContentType;
|
|
397
|
+
private constructor();
|
|
398
|
+
encode: (body?: unknown) => string;
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
declare const HttpHeader: {
|
|
402
|
+
ContentType: string;
|
|
403
|
+
Correlation: string;
|
|
404
|
+
};
|
|
405
|
+
|
|
406
|
+
declare class HttpStatus extends Enum {
|
|
407
|
+
static Continue: HttpStatus;
|
|
408
|
+
static SwitchingProtocols: HttpStatus;
|
|
409
|
+
static Processing: HttpStatus;
|
|
410
|
+
static EarlyHints: HttpStatus;
|
|
411
|
+
static Ok: HttpStatus;
|
|
412
|
+
static Created: HttpStatus;
|
|
413
|
+
static Accepted: HttpStatus;
|
|
414
|
+
static NonAuthoritativeInformation: HttpStatus;
|
|
415
|
+
static NoContent: HttpStatus;
|
|
416
|
+
static ResetContent: HttpStatus;
|
|
417
|
+
static PartialContent: HttpStatus;
|
|
418
|
+
static MultiStatus: HttpStatus;
|
|
419
|
+
static AlreadyReported: HttpStatus;
|
|
420
|
+
static ImUsed: HttpStatus;
|
|
421
|
+
static MultipleChoices: HttpStatus;
|
|
422
|
+
static MovedPermanently: HttpStatus;
|
|
423
|
+
static Found: HttpStatus;
|
|
424
|
+
static SeeOther: HttpStatus;
|
|
425
|
+
static NotModified: HttpStatus;
|
|
426
|
+
static UseProxy: HttpStatus;
|
|
427
|
+
static SwitchProxy: HttpStatus;
|
|
428
|
+
static TemporaryRedirect: HttpStatus;
|
|
429
|
+
static PermanentRedirect: HttpStatus;
|
|
430
|
+
static BadRequest: HttpStatus;
|
|
431
|
+
static NotAuthorized: HttpStatus;
|
|
432
|
+
static PaymentRequired: HttpStatus;
|
|
433
|
+
static Forbidden: HttpStatus;
|
|
434
|
+
static NotFound: HttpStatus;
|
|
435
|
+
static MethodNotAllowed: HttpStatus;
|
|
436
|
+
static NotAcceptable: HttpStatus;
|
|
437
|
+
static ProxyAuthenticationRequired: HttpStatus;
|
|
438
|
+
static RequestTimeout: HttpStatus;
|
|
439
|
+
static Conflict: HttpStatus;
|
|
440
|
+
static Gone: HttpStatus;
|
|
441
|
+
static LengthRequired: HttpStatus;
|
|
442
|
+
static PreconditionFailed: HttpStatus;
|
|
443
|
+
static PayloadTooLarge: HttpStatus;
|
|
444
|
+
static UriTooLong: HttpStatus;
|
|
445
|
+
static UnsupportedMediaType: HttpStatus;
|
|
446
|
+
static RangeNotSatisfiable: HttpStatus;
|
|
447
|
+
static ExpectationFailed: HttpStatus;
|
|
448
|
+
static ImATeapot: HttpStatus;
|
|
449
|
+
static MisdirectedRequest: HttpStatus;
|
|
450
|
+
static UnprocessableEntity: HttpStatus;
|
|
451
|
+
static Locked: HttpStatus;
|
|
452
|
+
static FailedDependency: HttpStatus;
|
|
453
|
+
static TooEarly: HttpStatus;
|
|
454
|
+
static UpgradeRequired: HttpStatus;
|
|
455
|
+
static PreconditionRequired: HttpStatus;
|
|
456
|
+
static TooManyRequests: HttpStatus;
|
|
457
|
+
static RequestHeaderFieldsTooLarge: HttpStatus;
|
|
458
|
+
static UnavailableForLegalReasons: HttpStatus;
|
|
459
|
+
static InternalServerError: HttpStatus;
|
|
460
|
+
static NotImplemented: HttpStatus;
|
|
461
|
+
static BadGateway: HttpStatus;
|
|
462
|
+
static ServiceUnavailable: HttpStatus;
|
|
463
|
+
static GatewayTimeout: HttpStatus;
|
|
464
|
+
static HTTPVersionNotSupported: HttpStatus;
|
|
465
|
+
static VariantAlsoNegotiates: HttpStatus;
|
|
466
|
+
static InsufficientStorage: HttpStatus;
|
|
467
|
+
static LoopDetected: HttpStatus;
|
|
468
|
+
static NotExtended: HttpStatus;
|
|
469
|
+
static NetworkAuthenticationRequired: HttpStatus;
|
|
470
|
+
get isError(): boolean;
|
|
471
|
+
get isClientError(): boolean;
|
|
472
|
+
get isServerError(): boolean;
|
|
473
|
+
get status(): number;
|
|
474
|
+
}
|
|
475
|
+
declare const isHttpStatus: TypeGuard<HttpStatus>;
|
|
476
|
+
declare const toHttpStatus: (s: HttpStatus | Code) => HttpStatus;
|
|
477
|
+
|
|
478
|
+
declare class HttpVerb extends Enum {
|
|
479
|
+
static Get: HttpVerb;
|
|
480
|
+
static Put: HttpVerb;
|
|
481
|
+
static Patch: HttpVerb;
|
|
482
|
+
static Post: HttpVerb;
|
|
483
|
+
static Delete: HttpVerb;
|
|
484
|
+
constructor(name: string);
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
type VerbOptions = {
|
|
488
|
+
onOk?: HttpStatus;
|
|
489
|
+
onNotFound?: HttpStatus;
|
|
490
|
+
onError?: HttpStatus;
|
|
491
|
+
type?: ContentType;
|
|
492
|
+
cache?: CacheControl;
|
|
493
|
+
};
|
|
494
|
+
type Verb$1 = {
|
|
495
|
+
verb: HttpVerb;
|
|
496
|
+
options: VerbOptions;
|
|
497
|
+
};
|
|
498
|
+
declare const toVerbOptions: (options?: VerbOptions) => Required<VerbOptions>;
|
|
499
|
+
declare const get: (options?: VerbOptions) => PropertyDecorator;
|
|
500
|
+
declare const search: (options?: VerbOptions) => PropertyDecorator;
|
|
501
|
+
declare const put: (options?: VerbOptions) => PropertyDecorator;
|
|
502
|
+
declare const patch: (options?: VerbOptions) => PropertyDecorator;
|
|
503
|
+
declare const post: (options?: VerbOptions) => PropertyDecorator;
|
|
504
|
+
declare const del: (options?: VerbOptions) => PropertyDecorator;
|
|
505
|
+
declare const stream: (options?: VerbOptions) => PropertyDecorator;
|
|
506
|
+
|
|
507
|
+
declare class OriginatedError extends Error {
|
|
508
|
+
readonly origin: ErrorOrigin;
|
|
509
|
+
readonly options?: VerbOptions | undefined;
|
|
510
|
+
constructor(origin: ErrorOrigin, options?: VerbOptions | undefined);
|
|
511
|
+
}
|
|
512
|
+
declare const isOriginatedError: (e?: unknown) => e is OriginatedError;
|
|
513
|
+
declare const toOriginatedError: (e: unknown, options?: VerbOptions) => OriginatedError;
|
|
514
|
+
|
|
515
|
+
declare const toPageOptions: (options?: RequestOptions | PageOptions) => Optional<PageOptions>;
|
|
516
|
+
declare class RequestOptions extends Enum {
|
|
517
|
+
readonly type: ContentType;
|
|
518
|
+
readonly headers: {
|
|
519
|
+
[key: string]: any;
|
|
520
|
+
};
|
|
521
|
+
pageOptions?: PageOptions | undefined;
|
|
522
|
+
requestOptions: {
|
|
523
|
+
maxRedirects?: number;
|
|
524
|
+
validateStatus?: (status: number) => boolean;
|
|
525
|
+
timeout?: CacheAge;
|
|
526
|
+
};
|
|
527
|
+
constructor(type?: ContentType, headers?: {
|
|
528
|
+
[key: string]: any;
|
|
529
|
+
}, pageOptions?: PageOptions | undefined);
|
|
530
|
+
static get Form(): RequestOptions;
|
|
531
|
+
static get Json(): RequestOptions;
|
|
532
|
+
static get Stream(): RequestOptions;
|
|
533
|
+
static get Text(): RequestOptions;
|
|
534
|
+
static get Xml(): RequestOptions;
|
|
535
|
+
page: (options: PageOptions) => this;
|
|
536
|
+
authorization: (auth: string) => this;
|
|
537
|
+
apiKey: (apiKey: string) => this;
|
|
538
|
+
setHeader: (key: Text, value: Id | boolean) => this;
|
|
539
|
+
setHeaderUnlessPresent: (key: string, value?: Id | boolean) => this;
|
|
540
|
+
accept: (type: ContentType) => this;
|
|
541
|
+
bearer: (jwt: Text) => this;
|
|
542
|
+
basic: (username: Text, password: Text) => this;
|
|
543
|
+
maxRedirects: (max?: number) => this;
|
|
544
|
+
validateStatus: (validate?: ((status: number) => boolean) | undefined) => this;
|
|
545
|
+
timeout: (t?: CacheAge) => this;
|
|
546
|
+
}
|
|
547
|
+
declare const isRequestOptions: (o?: unknown) => o is RequestOptions;
|
|
548
|
+
|
|
549
|
+
type Request = {
|
|
550
|
+
uri: Uri;
|
|
551
|
+
verb: HttpVerb;
|
|
552
|
+
body?: unknown;
|
|
553
|
+
transform?: (r: any) => any;
|
|
554
|
+
transformError?: (r: any) => any;
|
|
555
|
+
options?: RequestOptions;
|
|
556
|
+
};
|
|
557
|
+
|
|
558
|
+
type RestResult = {
|
|
559
|
+
data?: {
|
|
560
|
+
code: number;
|
|
561
|
+
items: List<Json>;
|
|
562
|
+
itemCount: number;
|
|
563
|
+
totalItems?: number;
|
|
564
|
+
meta?: Json;
|
|
565
|
+
};
|
|
566
|
+
error?: {
|
|
567
|
+
code: number;
|
|
568
|
+
message: string;
|
|
569
|
+
errorCount: number;
|
|
570
|
+
errors: List<Result>;
|
|
571
|
+
};
|
|
572
|
+
};
|
|
573
|
+
declare const rest: {
|
|
574
|
+
toData: (status: HttpStatus, items?: Json[], totalItems?: number, meta?: Json) => RestResult;
|
|
575
|
+
toError: (status: HttpStatus, errors?: Result[]) => RestResult;
|
|
576
|
+
to: (payload?: any | any[], status?: HttpStatus) => RestResult;
|
|
577
|
+
};
|
|
578
|
+
declare const isRestResult: (r: unknown) => r is RestResult;
|
|
579
|
+
|
|
580
|
+
type Response = {
|
|
581
|
+
status: HttpStatus;
|
|
582
|
+
headers?: {
|
|
583
|
+
[key: string]: any;
|
|
584
|
+
};
|
|
585
|
+
body: RestResult;
|
|
586
|
+
};
|
|
587
|
+
declare const isResponse: TypeGuard<Response>;
|
|
588
|
+
declare const toResponse: (status: HttpStatus | Code, body?: unknown, headers?: {
|
|
589
|
+
[key: string]: any;
|
|
590
|
+
} | undefined) => Response;
|
|
591
|
+
|
|
592
|
+
interface RequestProvider {
|
|
593
|
+
execute: (request: Request) => Promise<Response>;
|
|
594
|
+
}
|
|
595
|
+
|
|
596
|
+
type Result = {
|
|
597
|
+
message: string;
|
|
598
|
+
location?: string;
|
|
599
|
+
domain?: string;
|
|
600
|
+
};
|
|
601
|
+
declare const toResult: (message: Text, location?: Text, domain?: Text) => Result;
|
|
602
|
+
declare const isResult: TypeGuard<Result>;
|
|
603
|
+
|
|
604
|
+
declare class Results implements Validatable {
|
|
605
|
+
readonly results: Result[];
|
|
606
|
+
constructor(...rs: (Text | Result)[]);
|
|
607
|
+
get length(): number;
|
|
608
|
+
get isValid(): boolean;
|
|
609
|
+
add: (...rs: (Text | Result)[]) => Results;
|
|
610
|
+
}
|
|
611
|
+
declare const toResults: (...r: (Text | Result)[]) => Results;
|
|
612
|
+
declare const isResults: (r?: unknown) => r is Results;
|
|
613
|
+
|
|
614
|
+
type ErrorOrigin = Text | Error | Exception | Response | Results | Result;
|
|
615
|
+
|
|
616
|
+
type Falsy = false | 0 | -0 | 0n | '' | null | undefined;
|
|
617
|
+
declare const isFalsy: (v?: unknown) => v is Falsy;
|
|
618
|
+
declare const isTruthy: (v?: unknown) => v is unknown;
|
|
619
|
+
|
|
620
|
+
declare const asc = 1;
|
|
621
|
+
declare const desc = -1;
|
|
622
|
+
type SortDirection = typeof asc | typeof desc;
|
|
623
|
+
type Sort = {
|
|
624
|
+
key: string;
|
|
625
|
+
value: SortDirection;
|
|
626
|
+
};
|
|
627
|
+
type PlainSort = Record<string, SortDirection> | string[];
|
|
628
|
+
|
|
629
|
+
type FilterValue = {
|
|
630
|
+
label?: string;
|
|
631
|
+
value: any;
|
|
632
|
+
};
|
|
633
|
+
type Filter = {
|
|
634
|
+
label?: string;
|
|
635
|
+
field: string;
|
|
636
|
+
shortField?: string;
|
|
637
|
+
values: FilterValue[];
|
|
638
|
+
};
|
|
639
|
+
declare const toFilter: (field: string, value: any) => Filter;
|
|
640
|
+
declare const toShortFilter: (field: string, shortField: string, value: any) => Filter;
|
|
641
|
+
type PageOptions = {
|
|
642
|
+
take?: number;
|
|
643
|
+
skip?: number;
|
|
644
|
+
sort?: Sort[];
|
|
645
|
+
sorts?: PlainSort;
|
|
646
|
+
filters?: Filter[];
|
|
647
|
+
};
|
|
648
|
+
type PageListOptions = Exclude<PageOptions, 'sort'> & {
|
|
649
|
+
total?: number;
|
|
650
|
+
};
|
|
651
|
+
declare class PageList<T> extends List<T> {
|
|
652
|
+
private _options?;
|
|
653
|
+
private setPageOptions;
|
|
654
|
+
get take(): number;
|
|
655
|
+
get skip(): number;
|
|
656
|
+
get total(): Optional<number>;
|
|
657
|
+
get sorts(): Optional<PlainSort>;
|
|
658
|
+
get filters(): Optional<Filter[]>;
|
|
659
|
+
get meta(): PageListOptions;
|
|
660
|
+
get options(): Optional<PageListOptions>;
|
|
661
|
+
asc(p: GetProperty<T, any>): PageList<T>;
|
|
662
|
+
desc(p: GetProperty<T, any>): PageList<T>;
|
|
663
|
+
diff(others: ArrayLike<T>): PageList<T>;
|
|
664
|
+
diffByKey(others: ArrayLike<T>, key: keyof T): PageList<T>;
|
|
665
|
+
intersect(others: ArrayLike<T>): PageList<T>;
|
|
666
|
+
intersectByKey(others: ArrayLike<T>, key: keyof T): PageList<T>;
|
|
667
|
+
map<U>(f: (value: T, index: number, array: T[]) => U, params?: unknown): PageList<U>;
|
|
668
|
+
flatMap<U, This = unknown>(f: (this: This, value: T, index: number, array: T[]) => ReadonlyArray<U> | U, params?: This): PageList<U>;
|
|
669
|
+
mapDefined<U>(f: (value: T, index: number, array: T[]) => U, params?: unknown): PageList<NonNullable<U>>;
|
|
670
|
+
mapAsync(f: (i: T) => Promise<T>): Promise<PageList<T>>;
|
|
671
|
+
distinct(): PageList<T>;
|
|
672
|
+
distinctByKey(key: keyof T): PageList<T>;
|
|
673
|
+
filter(p: (value: T, index: number, array: T[]) => unknown, params?: unknown): PageList<T>;
|
|
674
|
+
concat(...items: ConcatArray<T>[]): PageList<T>;
|
|
675
|
+
concat(...items: (T | ConcatArray<T>)[]): PageList<T>;
|
|
676
|
+
reverse(): PageList<T>;
|
|
677
|
+
splice(start: number, deleteCount?: number): PageList<T>;
|
|
678
|
+
splice(start: number, deleteCount: number, ...items: T[]): PageList<T>;
|
|
679
|
+
remove(item: T): PageList<T>;
|
|
680
|
+
replace(key: keyof T, item: T): PageList<T>;
|
|
681
|
+
switch(item: T): PageList<T>;
|
|
682
|
+
defined(): PageList<NonNullable<T>>;
|
|
683
|
+
orElse(...alt: ArrayLike<T>): Optional<PageList<T>>;
|
|
684
|
+
slice(start?: number, end?: number): PageList<T>;
|
|
685
|
+
}
|
|
686
|
+
declare const isPageList: <T>(l?: unknown) => l is PageList<T>;
|
|
687
|
+
declare const toPageList: <T>(items?: T[], options?: Omit<PageOptions, 'sort'> & {
|
|
688
|
+
total?: number;
|
|
689
|
+
}) => PageList<T>;
|
|
690
|
+
declare const asPageList: <T, U>(c: Construct<T>, items?: PageList<U>) => PageList<T>;
|
|
691
|
+
|
|
692
|
+
type FetchOptions = PageOptions;
|
|
693
|
+
declare abstract class Gateway<Options = FetchOptions> {
|
|
694
|
+
all(options?: Options): Promise<PageList<Json>>;
|
|
695
|
+
byId(id: Id, options?: Options): Promise<Optional<Json>>;
|
|
696
|
+
by(_key: string, _value: JsonValue, _options?: Options): Promise<PageList<Json>>;
|
|
697
|
+
byIds(..._ids: Id[]): Promise<List<Json>>;
|
|
698
|
+
search(q: JsonValue, options?: Options): Promise<PageList<Json>>;
|
|
699
|
+
filter(options?: Options): Promise<PageList<Json>>;
|
|
700
|
+
exists(id: Id, options?: Options): Promise<boolean>;
|
|
701
|
+
add(item: Json, options?: Options): Promise<Json>;
|
|
702
|
+
update(item: Json, options?: Options): Promise<Json>;
|
|
703
|
+
remove(id: Id, options?: Options): Promise<boolean>;
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
declare const isDefined: <T = unknown>(o?: T | undefined) => o is NonNullable<T>;
|
|
707
|
+
declare const isUndefined: (v?: unknown) => v is never;
|
|
708
|
+
declare const isEmpty: (o?: unknown) => boolean;
|
|
709
|
+
declare const isNotEmpty: <T = unknown>(o?: unknown) => o is NonNullable<T>;
|
|
710
|
+
declare const isString: (o?: unknown) => o is string;
|
|
711
|
+
declare const isIsoDateString: (o?: unknown) => o is string;
|
|
712
|
+
declare const isBoolean: (o?: unknown) => o is boolean;
|
|
713
|
+
declare const isTrue: (o?: unknown) => o is true;
|
|
714
|
+
declare const isNumber: (o?: unknown) => o is number;
|
|
715
|
+
declare const isObject: (o?: unknown) => o is Record<string, unknown>;
|
|
716
|
+
declare const isEmptyObject: (o?: unknown) => boolean;
|
|
717
|
+
declare const isFunction: (o?: unknown) => o is (...params: unknown[]) => unknown;
|
|
718
|
+
declare const isArray: <T = any>(o?: unknown) => o is T[];
|
|
719
|
+
declare const isInstance: <T>(ctor: Constructor<T>, o?: unknown) => o is T;
|
|
720
|
+
declare const isIn: (o: unknown, values: unknown[]) => boolean;
|
|
721
|
+
declare const isIntersecting: (o?: unknown[], values?: unknown[]) => boolean;
|
|
722
|
+
declare const isError: (e: unknown) => e is Error;
|
|
723
|
+
declare const isNotPresent: (...os: unknown[]) => boolean;
|
|
724
|
+
declare const isPresent: (...os: unknown[]) => boolean;
|
|
725
|
+
|
|
726
|
+
declare const isA: <T>(t?: unknown, ...properties: (keyof T)[]) => t is T;
|
|
727
|
+
declare const isAn: <T>(t?: unknown, ...properties: (keyof T)[]) => t is T;
|
|
728
|
+
|
|
729
|
+
declare const isDate: (o?: unknown) => o is Date;
|
|
730
|
+
declare const days: {
|
|
731
|
+
add: (date: Date, days: number) => Date;
|
|
732
|
+
today: () => Date;
|
|
733
|
+
yesterday: () => Date;
|
|
734
|
+
tomorrow: () => Date;
|
|
735
|
+
};
|
|
736
|
+
declare const inPast: (o?: unknown) => boolean;
|
|
737
|
+
declare const inFuture: (o?: unknown) => boolean;
|
|
738
|
+
|
|
739
|
+
declare const isEqual: (one?: unknown, another?: unknown) => boolean;
|
|
740
|
+
|
|
741
|
+
type Message<Args> = string | Func$1<string, Args>;
|
|
742
|
+
declare const ofMessage: <Args>(g: Message<Args>, ...params: Args[]) => string;
|
|
743
|
+
|
|
744
|
+
type MetaParseOptions = {
|
|
745
|
+
initial?: any;
|
|
746
|
+
skipUndefined?: boolean;
|
|
747
|
+
};
|
|
748
|
+
type Entry<T = unknown> = [key: string, value: T];
|
|
749
|
+
declare class ClassMeta {
|
|
750
|
+
readonly subject: any;
|
|
751
|
+
private readonly data;
|
|
752
|
+
constructor(subject: any, data?: any);
|
|
753
|
+
get: <T>(key: string) => T;
|
|
754
|
+
set: <T>(key: string, value: T) => T;
|
|
755
|
+
entries: <T = unknown>() => List<Entry<T>>;
|
|
756
|
+
parse: <Out, Value>(f: (v: Value) => Out, options?: MetaParseOptions) => Record<string, Out>;
|
|
757
|
+
properties: (key?: string) => List<PropertyMeta>;
|
|
758
|
+
keys: <T = any>(key: string) => List<T>;
|
|
759
|
+
values: <T = unknown>() => List<T>;
|
|
760
|
+
property: (property: string | symbol) => PropertyMeta;
|
|
761
|
+
}
|
|
762
|
+
declare class PropertyMeta {
|
|
763
|
+
readonly subject: any;
|
|
764
|
+
readonly property: string | symbol;
|
|
765
|
+
private readonly data;
|
|
766
|
+
constructor(subject: any, property: string | symbol, data?: any);
|
|
767
|
+
get value(): any;
|
|
768
|
+
get: <T>(key: string) => Optional<T>;
|
|
769
|
+
set: <T>(key: string, value: T) => T;
|
|
770
|
+
}
|
|
771
|
+
declare const meta: (subject: unknown) => ClassMeta;
|
|
772
|
+
declare const entries: <T = unknown>(subject: Record<string, T>) => List<Entry<T>>;
|
|
773
|
+
|
|
774
|
+
type Nullish = null | undefined;
|
|
775
|
+
declare const isNullish: (v?: unknown) => v is Nullish;
|
|
776
|
+
|
|
777
|
+
declare const asNumber: (n: unknown, alt?: Get<number>) => number;
|
|
778
|
+
|
|
779
|
+
type Primitive = string | number | bigint | boolean | symbol | null | undefined;
|
|
780
|
+
declare const isPrimitive: (v?: unknown) => v is Primitive;
|
|
781
|
+
|
|
782
|
+
declare class Repository<T, Options = FetchOptions> {
|
|
783
|
+
all(options?: Options): Promise<PageList<T>>;
|
|
784
|
+
byId(id: Id): Promise<T>;
|
|
785
|
+
byIds(...ids: Id[]): Promise<List<T>>;
|
|
786
|
+
byKey(key: Key, options?: Options): Promise<PageList<T>>;
|
|
787
|
+
by(key: keyof T, value: JsonValue, options?: Options): Promise<PageList<T>>;
|
|
788
|
+
search(q: JsonValue, options?: Options): Promise<PageList<T>>;
|
|
789
|
+
filter(options?: Options): Promise<PageList<T>>;
|
|
790
|
+
exists(id: Id): Promise<boolean>;
|
|
791
|
+
add(t: T | Json): Promise<T>;
|
|
792
|
+
update(id: Id, json: Json): Promise<T>;
|
|
793
|
+
remove(id: Id): Promise<boolean>;
|
|
794
|
+
upsert(id: Id, item: Json): Promise<T>;
|
|
795
|
+
}
|
|
796
|
+
|
|
797
|
+
declare const tag: (name: string) => PropertyDecorator;
|
|
798
|
+
declare const searchable: () => PropertyDecorator;
|
|
799
|
+
|
|
800
|
+
type TemplateOptions = {
|
|
801
|
+
type?: Text;
|
|
802
|
+
property?: Text;
|
|
803
|
+
actual?: Text;
|
|
804
|
+
};
|
|
805
|
+
declare const template: (tmpl: Text, subject: unknown, options?: TemplateOptions) => Text;
|
|
806
|
+
|
|
807
|
+
declare abstract class Try<T = unknown> implements Validatable {
|
|
808
|
+
is: {
|
|
809
|
+
defined: (prop?: Func$1<unknown, T>) => Try<T>;
|
|
810
|
+
empty: (prop?: Func$1<unknown, T>) => Try<T>;
|
|
811
|
+
valid: (prop?: Func$1<unknown, T>) => Try<T>;
|
|
812
|
+
true: (prop?: Func$1<unknown, T>) => Try<T>;
|
|
813
|
+
false: (prop?: Func$1<unknown, T>) => Try<T>;
|
|
814
|
+
not: {
|
|
815
|
+
defined: (prop?: Func$1<unknown, T>) => Try<T>;
|
|
816
|
+
empty: (prop?: Func$1<unknown, T>) => Try<T>;
|
|
817
|
+
valid: (prop?: Func$1<unknown, T>) => Try<T>;
|
|
818
|
+
};
|
|
819
|
+
};
|
|
820
|
+
if: {
|
|
821
|
+
defined: (prop?: Func$1<unknown, T>) => Try<T>;
|
|
822
|
+
empty: (prop?: Func$1<unknown, T>) => Try<T>;
|
|
823
|
+
valid: (prop?: Func$1<unknown, T>) => Try<T>;
|
|
824
|
+
true: (prop?: Func$1<unknown, T>) => Try<T>;
|
|
825
|
+
false: (prop?: Func$1<unknown, T>) => Try<T>;
|
|
826
|
+
not: {
|
|
827
|
+
defined: (prop?: Func$1<unknown, T>) => Try<T>;
|
|
828
|
+
empty: (prop?: Func$1<unknown, T>) => Try<T>;
|
|
829
|
+
valid: (prop?: Func$1<unknown, T>) => Try<T>;
|
|
830
|
+
};
|
|
831
|
+
};
|
|
832
|
+
abstract get value(): T;
|
|
833
|
+
abstract get error(): Error;
|
|
834
|
+
abstract get isValid(): boolean;
|
|
835
|
+
static of: <T_1>(c: Get<T_1 | Try<T_1>>, ...args: unknown[]) => Try<T_1>;
|
|
836
|
+
abstract map<U>(f: Func$1<U | Try<U>, T>): Try<U>;
|
|
837
|
+
abstract recover(f: Func$1<T | Try<T>, Error>): Try<T>;
|
|
838
|
+
abstract recoverFrom(type: Constructor<Error>, f: Func$1<T | Try<T>, Error>): Try<T>;
|
|
839
|
+
abstract accept(f: Func$1<void, T>): Try<T>;
|
|
840
|
+
abstract filter(predicate: Func$1<boolean, T>): Try<T>;
|
|
841
|
+
abstract or(value: Get<T>): T;
|
|
842
|
+
abstract orElse(value?: Get<T>): Optional<T>;
|
|
843
|
+
abstract orThrow(error: Construct<Error>): T;
|
|
844
|
+
}
|
|
845
|
+
declare const tryTo: <T>(c: Get<T | Try<T>>, ...args: unknown[]) => Try<T>;
|
|
846
|
+
|
|
847
|
+
type Segment = Text & {
|
|
848
|
+
key?: string;
|
|
849
|
+
segment?: string;
|
|
850
|
+
query?: (value: unknown) => string;
|
|
851
|
+
};
|
|
852
|
+
declare const toSegment: (key?: Text, { segment, query, }?: {
|
|
853
|
+
segment?: string | undefined;
|
|
854
|
+
query?: ((value: unknown) => string) | undefined;
|
|
855
|
+
}) => Segment;
|
|
856
|
+
declare const uri: {
|
|
857
|
+
host: (key?: string) => Segment;
|
|
858
|
+
resource: (resource: Uri) => Segment;
|
|
859
|
+
segment: (key?: Text) => Segment;
|
|
860
|
+
path: (key: Text) => Segment;
|
|
861
|
+
query: (key: Text) => Segment;
|
|
862
|
+
boolean: (key: Text) => Segment;
|
|
863
|
+
};
|
|
864
|
+
type Prop = {
|
|
865
|
+
segment: Segment;
|
|
866
|
+
value: any;
|
|
867
|
+
};
|
|
868
|
+
type Uri = {
|
|
869
|
+
id: (id?: unknown) => Uri;
|
|
870
|
+
ids: (ids: OneOrMore<unknown>) => Uri;
|
|
871
|
+
query: (q?: unknown) => Uri;
|
|
872
|
+
sort: (q?: any) => Uri;
|
|
873
|
+
skip: (n?: number) => Uri;
|
|
874
|
+
take: (n?: number) => Uri;
|
|
875
|
+
path: string;
|
|
876
|
+
route: (resource: string) => string;
|
|
877
|
+
isInternal: boolean;
|
|
878
|
+
toString: () => string;
|
|
879
|
+
};
|
|
880
|
+
type UriExpandProps = {
|
|
881
|
+
q: string;
|
|
882
|
+
s: string;
|
|
883
|
+
};
|
|
884
|
+
declare class EasyUri<Props = UriExpandProps> implements Uri {
|
|
885
|
+
readonly segments: Segment[];
|
|
886
|
+
static readonly id: Segment;
|
|
887
|
+
static readonly ids: Segment;
|
|
888
|
+
static readonly query: Segment;
|
|
889
|
+
static readonly sort: Segment;
|
|
890
|
+
static readonly skip: Segment;
|
|
891
|
+
static readonly take: Segment;
|
|
892
|
+
readonly host: Segment;
|
|
893
|
+
readonly resource: Segment;
|
|
894
|
+
protected state: any;
|
|
895
|
+
constructor(segments?: Segment[]);
|
|
896
|
+
get path(): string;
|
|
897
|
+
get complete(): string;
|
|
898
|
+
get isInternal(): boolean;
|
|
899
|
+
protected get props(): List<Prop>;
|
|
900
|
+
route: (resource?: Optional<string>) => string;
|
|
901
|
+
set: (segment: Segment, value?: unknown) => this;
|
|
902
|
+
toString(): string;
|
|
903
|
+
id: (id?: unknown) => this;
|
|
904
|
+
ids: (ids: OneOrMore<unknown>) => this;
|
|
905
|
+
query: (q?: unknown) => this;
|
|
906
|
+
sort: (s?: any) => this;
|
|
907
|
+
skip: (index?: number) => this;
|
|
908
|
+
take: (items?: number) => this;
|
|
909
|
+
expand(props: Partial<Props>): this;
|
|
910
|
+
}
|
|
911
|
+
|
|
912
|
+
declare class Value<V = string> implements Validatable {
|
|
913
|
+
readonly value: V;
|
|
914
|
+
constructor(value: V);
|
|
915
|
+
get isValid(): boolean;
|
|
916
|
+
toJSON(): JsonValue;
|
|
917
|
+
toString(): string;
|
|
918
|
+
}
|
|
919
|
+
declare const isValue: (v?: unknown) => v is Value<string>;
|
|
920
|
+
|
|
921
|
+
declare class Convert<From = unknown, To = unknown> {
|
|
922
|
+
readonly from: (f: From) => To;
|
|
923
|
+
readonly to: (t: To) => From;
|
|
924
|
+
constructor(from: (f: From) => To, to: (t: To) => From);
|
|
925
|
+
}
|
|
926
|
+
declare const convert: {
|
|
927
|
+
default: Convert<any, any>;
|
|
928
|
+
ignore: Convert<any, any>;
|
|
929
|
+
toBool: {
|
|
930
|
+
fromNumber: Convert<boolean, number>;
|
|
931
|
+
fromString: Convert<boolean, string>;
|
|
932
|
+
};
|
|
933
|
+
toDate: {
|
|
934
|
+
fromString: Convert<string, string>;
|
|
935
|
+
};
|
|
936
|
+
toNumber: {
|
|
937
|
+
fromString: Convert<number, string>;
|
|
938
|
+
};
|
|
939
|
+
};
|
|
940
|
+
|
|
941
|
+
declare function ifTrue<Out, In = unknown>(o: unknown, f: Construct<Out, NonNullable<In>>, alt: Construct<Out>): Out;
|
|
942
|
+
declare function ifTrue<Out, In = unknown>(o: unknown, f: Construct<Out, NonNullable<In>>, alt?: Construct<Out>): Optional<Out>;
|
|
943
|
+
declare function ifFalse<Out, In = unknown>(o: unknown, f: Construct<Out, NonNullable<In>>, alt: Construct<Out>): Out;
|
|
944
|
+
declare function ifFalse<Out, In = unknown>(o: unknown, f: Construct<Out, NonNullable<In>>, alt?: Construct<Out>): Optional<Out>;
|
|
945
|
+
declare function ifDefined<Out, In = unknown>(o: Optional<In>, f: Construct<Out, NonNullable<In>>, alt: Construct<Out>): Out;
|
|
946
|
+
declare function ifDefined<Out, In = unknown>(o: Optional<In>, f: Construct<Out, NonNullable<In>>, alt?: Construct<Out>): Optional<Out>;
|
|
947
|
+
declare function ifNotEmpty<Out, In = unknown>(o: In, f: Construct<Out, NonNullable<In>>, alt: Construct<Out>): Out;
|
|
948
|
+
declare function ifNotEmpty<Out, In = unknown>(o: In, f?: Construct<Out, NonNullable<In>>, alt?: Construct<Out>): Optional<Out>;
|
|
949
|
+
declare function ifNotEmpty<Out, In = unknown>(o: In, f: Construct<Out, NonNullable<In>>, alt?: Construct<Out>): Optional<Out>;
|
|
950
|
+
|
|
951
|
+
declare const isLoading: (...targets: unknown[]) => boolean;
|
|
952
|
+
|
|
953
|
+
declare function log<T>(t: T): T;
|
|
954
|
+
declare function log<T>(label: string, t: T): T;
|
|
955
|
+
|
|
956
|
+
type PropertyOptions<T = unknown> = {
|
|
957
|
+
convert?: Convert<any, any>;
|
|
958
|
+
dflt?: Get<T>;
|
|
959
|
+
format?: string;
|
|
960
|
+
};
|
|
961
|
+
declare class Property<T = unknown> implements Mapping {
|
|
962
|
+
readonly property: string;
|
|
963
|
+
readonly options?: PropertyOptions<unknown> | undefined;
|
|
964
|
+
constructor(property: string, options?: PropertyOptions<unknown> | undefined);
|
|
965
|
+
in: (source?: Json) => JsonValue;
|
|
966
|
+
out: (source?: Json, key?: string) => JsonValue;
|
|
967
|
+
toString(): string;
|
|
968
|
+
}
|
|
969
|
+
|
|
970
|
+
declare class State {
|
|
971
|
+
protected readonly state: any;
|
|
972
|
+
constructor(state?: any);
|
|
973
|
+
protected get: <T>(key: string, alt?: Construct<T> | undefined) => T;
|
|
974
|
+
protected set: <T>(key: string, value: Construct<T>) => T;
|
|
975
|
+
}
|
|
976
|
+
|
|
977
|
+
type Mapping = {
|
|
978
|
+
property: string;
|
|
979
|
+
in: (source?: Json, key?: string) => Optional<JsonValue>;
|
|
980
|
+
out: (source?: Json, key?: string) => Optional<JsonValue>;
|
|
981
|
+
};
|
|
982
|
+
declare const isMapping: TypeGuard<Mapping>;
|
|
983
|
+
type MapStartFrom = 'scratch' | 'source';
|
|
984
|
+
type MapOptions = {
|
|
985
|
+
startFrom: MapStartFrom;
|
|
986
|
+
};
|
|
987
|
+
declare class Mapper extends State implements Mapping {
|
|
988
|
+
readonly options: MapOptions;
|
|
989
|
+
readonly property: string;
|
|
990
|
+
protected readonly map: {
|
|
991
|
+
item: (property: string, options?: PropertyOptions | undefined) => Property<unknown>;
|
|
992
|
+
ignore: (property?: string) => Mapping;
|
|
993
|
+
skipIn: (property: string) => Mapping;
|
|
994
|
+
skipOut: (property: string) => Mapping;
|
|
995
|
+
func: (property: string, funcIn: Get<Optional<JsonValue>, Json>, funcOut: Get<Optional<JsonValue>, Json>) => Mapping;
|
|
996
|
+
add: (funcIn: Get<JsonValue, Json>) => Mapping;
|
|
997
|
+
map: (mapper: Construct<Mapper>, property?: string) => Mapping;
|
|
998
|
+
propsToList: (...maps: Mapping[]) => Mapping;
|
|
999
|
+
list: (mapper: Mapping, property: string) => Mapping;
|
|
1000
|
+
};
|
|
1001
|
+
constructor(options?: MapOptions, property?: string);
|
|
1002
|
+
get properties(): List<[string, Mapping]>;
|
|
1003
|
+
get keys(): List<string>;
|
|
1004
|
+
get columns(): List<string>;
|
|
1005
|
+
private get droppedIn();
|
|
1006
|
+
private get droppedOut();
|
|
1007
|
+
in(from?: Json): Json;
|
|
1008
|
+
out(to?: Json): Json;
|
|
1009
|
+
toString(): string;
|
|
1010
|
+
}
|
|
1011
|
+
declare const mappings: {
|
|
1012
|
+
item: (property: string, options?: PropertyOptions) => Property;
|
|
1013
|
+
ignore: (property?: string) => Mapping;
|
|
1014
|
+
skipIn: (property: string) => Mapping;
|
|
1015
|
+
skipOut: (property: string) => Mapping;
|
|
1016
|
+
func: (property: string, funcIn: Get<Optional<JsonValue>, Json>, funcOut: Get<Optional<JsonValue>, Json>) => Mapping;
|
|
1017
|
+
add: (funcIn: Get<JsonValue, Json>) => Mapping;
|
|
1018
|
+
map: (mapper: Construct<Mapper>, property?: string) => Mapping;
|
|
1019
|
+
propsToList: (...maps: Mapping[]) => Mapping;
|
|
1020
|
+
list: (mapper: Mapping, property: string) => Mapping;
|
|
1021
|
+
};
|
|
1022
|
+
|
|
1023
|
+
type Pro<A> = A | PromiseLike<A>;
|
|
1024
|
+
declare const resolve: <S = unknown>(subject: S | PromiseLike<S>) => Promise<S>;
|
|
1025
|
+
declare const reject: <S = never>(e: ErrorOrigin) => Promise<S>;
|
|
1026
|
+
declare const tuple: {
|
|
1027
|
+
2: <F, S>(first: Pro<F>, second: Pro<S>) => Promise<[Awaited<F>, Awaited<S>]>;
|
|
1028
|
+
3: <F_1, S_1, T>(first: Pro<F_1>, second: Pro<S_1>, third: Pro<T>) => Promise<[Awaited<F_1>, Awaited<S_1>, Awaited<T>]>;
|
|
1029
|
+
4: <F_2, S_2, T_1, Fo>(first: Pro<F_2>, second: Pro<S_2>, third: Pro<T_1>, forth: Pro<Fo>) => Promise<[Awaited<F_2>, Awaited<S_2>, Awaited<T_1>, Awaited<Fo>]>;
|
|
1030
|
+
5: <F_3, S_3, T_2, Fo_1, Fi>(first: Pro<F_3>, second: Pro<S_3>, third: Pro<T_2>, forth: Pro<Fo_1>, fifth: Pro<Fi>) => Promise<[Awaited<F_3>, Awaited<S_3>, Awaited<T_2>, Awaited<Fo_1>, Awaited<Fi>]>;
|
|
1031
|
+
all: <F_4, S_4>(first: Pro<F_4>, second: Pro<S_4>[]) => Promise<[Awaited<F_4>, S_4[]]>;
|
|
1032
|
+
spread: <F_5, S_5>(first: Pro<F_5>, ...second: Pro<S_5>[]) => Promise<[Awaited<F_5>, S_5[]]>;
|
|
1033
|
+
};
|
|
1034
|
+
declare const tuple2: <F, S>(first: Pro<F>, second: Pro<S>) => Promise<[Awaited<F>, Awaited<S>]>;
|
|
1035
|
+
declare const tuple3: <F, S, T>(first: Pro<F>, second: Pro<S>, third: Pro<T>) => Promise<[Awaited<F>, Awaited<S>, Awaited<T>]>;
|
|
1036
|
+
declare const tuple4: <F, S, T, Fo>(first: Pro<F>, second: Pro<S>, third: Pro<T>, forth: Pro<Fo>) => Promise<[Awaited<F>, Awaited<S>, Awaited<T>, Awaited<Fo>]>;
|
|
1037
|
+
declare const tuple5: <F, S, T, Fo, Fi>(first: Pro<F>, second: Pro<S>, third: Pro<T>, forth: Pro<Fo>, fifth: Pro<Fi>) => Promise<[Awaited<F>, Awaited<S>, Awaited<T>, Awaited<Fo>, Awaited<Fi>]>;
|
|
1038
|
+
|
|
1039
|
+
declare class Sentence implements Text {
|
|
1040
|
+
private sentence;
|
|
1041
|
+
constructor(word: Text, pre?: Sentence, sentence?: Text[]);
|
|
1042
|
+
toString(): string;
|
|
1043
|
+
}
|
|
1044
|
+
declare class Topic extends Sentence {
|
|
1045
|
+
it: Sentence;
|
|
1046
|
+
anything: Sentence;
|
|
1047
|
+
id: (id: Id) => Sentence;
|
|
1048
|
+
your: (subject?: unknown) => Sentence;
|
|
1049
|
+
a: (subject?: unknown) => Sentence;
|
|
1050
|
+
an: (subject?: unknown) => Sentence;
|
|
1051
|
+
any: (subjects?: unknown) => Sentence;
|
|
1052
|
+
}
|
|
1053
|
+
declare class Verb extends Sentence {
|
|
1054
|
+
add: Topic;
|
|
1055
|
+
check: Topic;
|
|
1056
|
+
fetch: Topic;
|
|
1057
|
+
find: Topic;
|
|
1058
|
+
like: Topic;
|
|
1059
|
+
process: Topic;
|
|
1060
|
+
remove: Topic;
|
|
1061
|
+
translate: Topic;
|
|
1062
|
+
update: Topic;
|
|
1063
|
+
validate: Topic;
|
|
1064
|
+
}
|
|
1065
|
+
declare class Not extends Verb {
|
|
1066
|
+
}
|
|
1067
|
+
declare class SupportVerb extends Verb {
|
|
1068
|
+
not: Not;
|
|
1069
|
+
}
|
|
1070
|
+
declare class We extends Sentence {
|
|
1071
|
+
could: SupportVerb;
|
|
1072
|
+
did: SupportVerb;
|
|
1073
|
+
added: Topic;
|
|
1074
|
+
checked: Topic;
|
|
1075
|
+
fetched: Topic;
|
|
1076
|
+
found: Topic;
|
|
1077
|
+
liked: Topic;
|
|
1078
|
+
processed: Topic;
|
|
1079
|
+
removed: Topic;
|
|
1080
|
+
translated: Topic;
|
|
1081
|
+
updated: Topic;
|
|
1082
|
+
validated: Topic;
|
|
1083
|
+
}
|
|
1084
|
+
declare const we: We;
|
|
1085
|
+
|
|
1086
|
+
declare const traverse: (subject?: unknown, property?: string) => unknown;
|
|
1087
|
+
|
|
1088
|
+
type Func<T = unknown> = (a: any, key?: string) => T;
|
|
1089
|
+
type Viewer = {
|
|
1090
|
+
key: string;
|
|
1091
|
+
f: Func;
|
|
1092
|
+
};
|
|
1093
|
+
type ViewType = Primitive | Constructor | Func | View | undefined;
|
|
1094
|
+
declare const toViewer: (key: string, value: ViewType) => Viewer;
|
|
1095
|
+
declare class View<V = Json> {
|
|
1096
|
+
private views;
|
|
1097
|
+
readonly startsFrom: 'scratch' | 'source';
|
|
1098
|
+
readonly viewers: Viewer[];
|
|
1099
|
+
constructor(views?: Partial<Record<keyof V, ViewType>>, startsFrom?: 'scratch' | 'source', viewers?: Viewer[]);
|
|
1100
|
+
get fromSource(): View<V>;
|
|
1101
|
+
from<T = unknown>(source: PageList<T>): PageList<V>;
|
|
1102
|
+
from<T = unknown>(source: List<T>): List<V>;
|
|
1103
|
+
from<T = unknown>(source: T[]): V[];
|
|
1104
|
+
from<T = unknown>(source: T): V;
|
|
1105
|
+
same: (one?: unknown, another?: unknown) => boolean;
|
|
1106
|
+
private reduce;
|
|
1107
|
+
}
|
|
1108
|
+
declare const isSimpleView: (a: unknown) => a is View<Json>;
|
|
1109
|
+
declare const view: <V = Json>(views: Partial<Record<keyof DontInfer<V>, ViewType>>) => View<V>;
|
|
1110
|
+
declare const views: {
|
|
1111
|
+
ignore: symbol;
|
|
1112
|
+
keep: symbol;
|
|
1113
|
+
skip: symbol;
|
|
1114
|
+
value: (value: unknown) => () => unknown;
|
|
1115
|
+
or: {
|
|
1116
|
+
key: (altKey: string) => (a: unknown, key?: string) => unknown;
|
|
1117
|
+
value: (altValue: unknown) => (a: unknown, key?: string) => unknown;
|
|
1118
|
+
func: (altFunc: Func) => (a: unknown, key?: string) => unknown;
|
|
1119
|
+
};
|
|
1120
|
+
};
|
|
1121
|
+
|
|
1122
|
+
declare class Wait {
|
|
1123
|
+
static wait(ms?: number): Promise<void>;
|
|
1124
|
+
static seconds(s?: number): Promise<void>;
|
|
1125
|
+
}
|
|
1126
|
+
declare const wait: (millis: number) => Promise<void>;
|
|
1127
|
+
|
|
1128
|
+
declare class Condition {
|
|
1129
|
+
readonly key: string;
|
|
1130
|
+
readonly operator: string;
|
|
1131
|
+
readonly value: unknown;
|
|
1132
|
+
constructor(key: string, operator: string, value: unknown);
|
|
1133
|
+
and: (...others: Condition[]) => LogicalCondition;
|
|
1134
|
+
or: (...others: Condition[]) => LogicalCondition;
|
|
1135
|
+
toJSON(): Json;
|
|
1136
|
+
}
|
|
1137
|
+
declare class LogicalCondition {
|
|
1138
|
+
readonly operator: string;
|
|
1139
|
+
readonly conditions: Condition[];
|
|
1140
|
+
constructor(operator: string, conditions: Condition[]);
|
|
1141
|
+
toJSON(): Json;
|
|
1142
|
+
}
|
|
1143
|
+
declare class SortCondition extends Condition implements Sort {
|
|
1144
|
+
readonly key: string;
|
|
1145
|
+
readonly value: -1 | 1;
|
|
1146
|
+
constructor(key: string, value: -1 | 1);
|
|
1147
|
+
toJSON(): Json;
|
|
1148
|
+
}
|
|
1149
|
+
declare const toCondition: (field: string, operator: string, value: unknown, conv?: Convert) => Condition;
|
|
1150
|
+
declare const isSortCondition: (s?: unknown) => s is SortCondition;
|
|
1151
|
+
|
|
1152
|
+
declare class InMemoryGateway extends Gateway {
|
|
1153
|
+
private readonly data;
|
|
1154
|
+
constructor(data: Promise<PageList<Json>>);
|
|
1155
|
+
all(options?: FetchOptions): Promise<PageList<Json>>;
|
|
1156
|
+
byId(id: Id): Promise<Optional<Json>>;
|
|
1157
|
+
by: (key: string, value: JsonValue) => Promise<PageList<Json>>;
|
|
1158
|
+
exists(id: Id): Promise<boolean>;
|
|
1159
|
+
add(item: Json): Promise<Json>;
|
|
1160
|
+
remove(id: Id): Promise<true>;
|
|
1161
|
+
update(item: Json): Promise<Json>;
|
|
1162
|
+
}
|
|
1163
|
+
|
|
1164
|
+
type DataProvider = any;
|
|
1165
|
+
|
|
1166
|
+
type DatabaseOptions = {
|
|
1167
|
+
user?: string;
|
|
1168
|
+
password?: string;
|
|
1169
|
+
host?: string;
|
|
1170
|
+
port?: number;
|
|
1171
|
+
cluster?: string;
|
|
1172
|
+
connectionString?: string;
|
|
1173
|
+
maxPoolSize?: number;
|
|
1174
|
+
minPoolSize?: number;
|
|
1175
|
+
maxIdleTimeMS?: number;
|
|
1176
|
+
};
|
|
1177
|
+
declare class DefaultProvider implements DataProvider {
|
|
1178
|
+
}
|
|
1179
|
+
declare class Database extends Enum {
|
|
1180
|
+
readonly provider: Constructor<DataProvider> | DataProvider;
|
|
1181
|
+
readonly options?: DatabaseOptions | undefined;
|
|
1182
|
+
static readonly Default: Database;
|
|
1183
|
+
constructor(name: string, provider: Constructor<DataProvider> | DataProvider, options?: DatabaseOptions | undefined);
|
|
1184
|
+
provide: <P>() => P;
|
|
1185
|
+
}
|
|
1186
|
+
|
|
1187
|
+
declare class Field extends Property {
|
|
1188
|
+
is: (value: unknown) => Condition;
|
|
1189
|
+
isNot: (value: unknown) => Condition;
|
|
1190
|
+
isIn: (...value: unknown[]) => Condition;
|
|
1191
|
+
notIn: (...value: unknown[]) => Condition;
|
|
1192
|
+
exists: (does: boolean) => Condition;
|
|
1193
|
+
greater: (value: unknown) => Condition;
|
|
1194
|
+
greaterEqual: (value: unknown) => Condition;
|
|
1195
|
+
less: (value: unknown) => Condition;
|
|
1196
|
+
lessEqual: (value: unknown) => Condition;
|
|
1197
|
+
asc: () => SortCondition;
|
|
1198
|
+
desc: () => SortCondition;
|
|
1199
|
+
protected condition: (operator: string, value: unknown) => Condition;
|
|
1200
|
+
}
|
|
1201
|
+
declare const isField: (f?: unknown) => f is Field;
|
|
1202
|
+
|
|
1203
|
+
type Query = Text;
|
|
1204
|
+
|
|
1205
|
+
interface QueryProvider extends DataProvider {
|
|
1206
|
+
query: (q: Query) => Promise<List<Json>>;
|
|
1207
|
+
command: (q: Query) => Promise<number>;
|
|
1208
|
+
}
|
|
1209
|
+
|
|
1210
|
+
declare class Country extends Enum {
|
|
1211
|
+
private readonly lower;
|
|
1212
|
+
static readonly AF: Country;
|
|
1213
|
+
static readonly AX: Country;
|
|
1214
|
+
static readonly AL: Country;
|
|
1215
|
+
static readonly DZ: Country;
|
|
1216
|
+
static readonly AS: Country;
|
|
1217
|
+
static readonly AD: Country;
|
|
1218
|
+
static readonly AO: Country;
|
|
1219
|
+
static readonly AI: Country;
|
|
1220
|
+
static readonly AQ: Country;
|
|
1221
|
+
static readonly AG: Country;
|
|
1222
|
+
static readonly AR: Country;
|
|
1223
|
+
static readonly AM: Country;
|
|
1224
|
+
static readonly AW: Country;
|
|
1225
|
+
static readonly AU: Country;
|
|
1226
|
+
static readonly AT: Country;
|
|
1227
|
+
static readonly AZ: Country;
|
|
1228
|
+
static readonly BS: Country;
|
|
1229
|
+
static readonly BH: Country;
|
|
1230
|
+
static readonly BD: Country;
|
|
1231
|
+
static readonly BB: Country;
|
|
1232
|
+
static readonly BY: Country;
|
|
1233
|
+
static readonly BE: Country;
|
|
1234
|
+
static readonly BZ: Country;
|
|
1235
|
+
static readonly BJ: Country;
|
|
1236
|
+
static readonly BM: Country;
|
|
1237
|
+
static readonly BT: Country;
|
|
1238
|
+
static readonly BO: Country;
|
|
1239
|
+
static readonly BA: Country;
|
|
1240
|
+
static readonly BW: Country;
|
|
1241
|
+
static readonly BV: Country;
|
|
1242
|
+
static readonly BR: Country;
|
|
1243
|
+
static readonly IO: Country;
|
|
1244
|
+
static readonly VG: Country;
|
|
1245
|
+
static readonly BN: Country;
|
|
1246
|
+
static readonly BG: Country;
|
|
1247
|
+
static readonly BF: Country;
|
|
1248
|
+
static readonly BI: Country;
|
|
1249
|
+
static readonly KH: Country;
|
|
1250
|
+
static readonly CM: Country;
|
|
1251
|
+
static readonly CA: Country;
|
|
1252
|
+
static readonly CV: Country;
|
|
1253
|
+
static readonly BQ: Country;
|
|
1254
|
+
static readonly KY: Country;
|
|
1255
|
+
static readonly CF: Country;
|
|
1256
|
+
static readonly TD: Country;
|
|
1257
|
+
static readonly CL: Country;
|
|
1258
|
+
static readonly CN: Country;
|
|
1259
|
+
static readonly CX: Country;
|
|
1260
|
+
static readonly CC: Country;
|
|
1261
|
+
static readonly CO: Country;
|
|
1262
|
+
static readonly KM: Country;
|
|
1263
|
+
static readonly CG: Country;
|
|
1264
|
+
static readonly CD: Country;
|
|
1265
|
+
static readonly CK: Country;
|
|
1266
|
+
static readonly CR: Country;
|
|
1267
|
+
static readonly CI: Country;
|
|
1268
|
+
static readonly HR: Country;
|
|
1269
|
+
static readonly CU: Country;
|
|
1270
|
+
static readonly CW: Country;
|
|
1271
|
+
static readonly CY: Country;
|
|
1272
|
+
static readonly CZ: Country;
|
|
1273
|
+
static readonly DK: Country;
|
|
1274
|
+
static readonly DJ: Country;
|
|
1275
|
+
static readonly DM: Country;
|
|
1276
|
+
static readonly DO: Country;
|
|
1277
|
+
static readonly EC: Country;
|
|
1278
|
+
static readonly EG: Country;
|
|
1279
|
+
static readonly SV: Country;
|
|
1280
|
+
static readonly GQ: Country;
|
|
1281
|
+
static readonly ER: Country;
|
|
1282
|
+
static readonly EE: Country;
|
|
1283
|
+
static readonly SZ: Country;
|
|
1284
|
+
static readonly ET: Country;
|
|
1285
|
+
static readonly FK: Country;
|
|
1286
|
+
static readonly FO: Country;
|
|
1287
|
+
static readonly FJ: Country;
|
|
1288
|
+
static readonly FI: Country;
|
|
1289
|
+
static readonly FR: Country;
|
|
1290
|
+
static readonly GF: Country;
|
|
1291
|
+
static readonly PF: Country;
|
|
1292
|
+
static readonly TF: Country;
|
|
1293
|
+
static readonly GA: Country;
|
|
1294
|
+
static readonly GM: Country;
|
|
1295
|
+
static readonly GE: Country;
|
|
1296
|
+
static readonly DE: Country;
|
|
1297
|
+
static readonly GH: Country;
|
|
1298
|
+
static readonly GI: Country;
|
|
1299
|
+
static readonly GR: Country;
|
|
1300
|
+
static readonly GL: Country;
|
|
1301
|
+
static readonly GD: Country;
|
|
1302
|
+
static readonly GP: Country;
|
|
1303
|
+
static readonly GU: Country;
|
|
1304
|
+
static readonly GT: Country;
|
|
1305
|
+
static readonly GG: Country;
|
|
1306
|
+
static readonly GN: Country;
|
|
1307
|
+
static readonly GW: Country;
|
|
1308
|
+
static readonly GY: Country;
|
|
1309
|
+
static readonly HT: Country;
|
|
1310
|
+
static readonly HM: Country;
|
|
1311
|
+
static readonly HN: Country;
|
|
1312
|
+
static readonly HK: Country;
|
|
1313
|
+
static readonly HU: Country;
|
|
1314
|
+
static readonly IS: Country;
|
|
1315
|
+
static readonly IN: Country;
|
|
1316
|
+
static readonly ID: Country;
|
|
1317
|
+
static readonly IR: Country;
|
|
1318
|
+
static readonly IQ: Country;
|
|
1319
|
+
static readonly IE: Country;
|
|
1320
|
+
static readonly IM: Country;
|
|
1321
|
+
static readonly IL: Country;
|
|
1322
|
+
static readonly IT: Country;
|
|
1323
|
+
static readonly JM: Country;
|
|
1324
|
+
static readonly JP: Country;
|
|
1325
|
+
static readonly JE: Country;
|
|
1326
|
+
static readonly JO: Country;
|
|
1327
|
+
static readonly KZ: Country;
|
|
1328
|
+
static readonly KE: Country;
|
|
1329
|
+
static readonly KI: Country;
|
|
1330
|
+
static readonly KW: Country;
|
|
1331
|
+
static readonly KG: Country;
|
|
1332
|
+
static readonly LA: Country;
|
|
1333
|
+
static readonly LV: Country;
|
|
1334
|
+
static readonly LB: Country;
|
|
1335
|
+
static readonly LS: Country;
|
|
1336
|
+
static readonly LR: Country;
|
|
1337
|
+
static readonly LY: Country;
|
|
1338
|
+
static readonly LI: Country;
|
|
1339
|
+
static readonly LT: Country;
|
|
1340
|
+
static readonly LU: Country;
|
|
1341
|
+
static readonly MO: Country;
|
|
1342
|
+
static readonly MG: Country;
|
|
1343
|
+
static readonly MW: Country;
|
|
1344
|
+
static readonly MY: Country;
|
|
1345
|
+
static readonly MV: Country;
|
|
1346
|
+
static readonly ML: Country;
|
|
1347
|
+
static readonly MT: Country;
|
|
1348
|
+
static readonly MH: Country;
|
|
1349
|
+
static readonly MQ: Country;
|
|
1350
|
+
static readonly MR: Country;
|
|
1351
|
+
static readonly MU: Country;
|
|
1352
|
+
static readonly YT: Country;
|
|
1353
|
+
static readonly MX: Country;
|
|
1354
|
+
static readonly FM: Country;
|
|
1355
|
+
static readonly MD: Country;
|
|
1356
|
+
static readonly MC: Country;
|
|
1357
|
+
static readonly MN: Country;
|
|
1358
|
+
static readonly ME: Country;
|
|
1359
|
+
static readonly MS: Country;
|
|
1360
|
+
static readonly MA: Country;
|
|
1361
|
+
static readonly MZ: Country;
|
|
1362
|
+
static readonly MM: Country;
|
|
1363
|
+
static readonly NA: Country;
|
|
1364
|
+
static readonly NR: Country;
|
|
1365
|
+
static readonly NP: Country;
|
|
1366
|
+
static readonly NL: Country;
|
|
1367
|
+
static readonly NC: Country;
|
|
1368
|
+
static readonly NZ: Country;
|
|
1369
|
+
static readonly NI: Country;
|
|
1370
|
+
static readonly NE: Country;
|
|
1371
|
+
static readonly NG: Country;
|
|
1372
|
+
static readonly NU: Country;
|
|
1373
|
+
static readonly NF: Country;
|
|
1374
|
+
static readonly KP: Country;
|
|
1375
|
+
static readonly MK: Country;
|
|
1376
|
+
static readonly MP: Country;
|
|
1377
|
+
static readonly NO: Country;
|
|
1378
|
+
static readonly OM: Country;
|
|
1379
|
+
static readonly PK: Country;
|
|
1380
|
+
static readonly PW: Country;
|
|
1381
|
+
static readonly PS: Country;
|
|
1382
|
+
static readonly PA: Country;
|
|
1383
|
+
static readonly PG: Country;
|
|
1384
|
+
static readonly PY: Country;
|
|
1385
|
+
static readonly PE: Country;
|
|
1386
|
+
static readonly PH: Country;
|
|
1387
|
+
static readonly PN: Country;
|
|
1388
|
+
static readonly PL: Country;
|
|
1389
|
+
static readonly PT: Country;
|
|
1390
|
+
static readonly PR: Country;
|
|
1391
|
+
static readonly QA: Country;
|
|
1392
|
+
static readonly RE: Country;
|
|
1393
|
+
static readonly RO: Country;
|
|
1394
|
+
static readonly RU: Country;
|
|
1395
|
+
static readonly RW: Country;
|
|
1396
|
+
static readonly WS: Country;
|
|
1397
|
+
static readonly SM: Country;
|
|
1398
|
+
static readonly ST: Country;
|
|
1399
|
+
static readonly SA: Country;
|
|
1400
|
+
static readonly SN: Country;
|
|
1401
|
+
static readonly RS: Country;
|
|
1402
|
+
static readonly SC: Country;
|
|
1403
|
+
static readonly SL: Country;
|
|
1404
|
+
static readonly SG: Country;
|
|
1405
|
+
static readonly SX: Country;
|
|
1406
|
+
static readonly SK: Country;
|
|
1407
|
+
static readonly SI: Country;
|
|
1408
|
+
static readonly SB: Country;
|
|
1409
|
+
static readonly SO: Country;
|
|
1410
|
+
static readonly ZA: Country;
|
|
1411
|
+
static readonly GS: Country;
|
|
1412
|
+
static readonly KR: Country;
|
|
1413
|
+
static readonly SS: Country;
|
|
1414
|
+
static readonly ES: Country;
|
|
1415
|
+
static readonly LK: Country;
|
|
1416
|
+
static readonly BL: Country;
|
|
1417
|
+
static readonly SH: Country;
|
|
1418
|
+
static readonly KN: Country;
|
|
1419
|
+
static readonly LC: Country;
|
|
1420
|
+
static readonly MF: Country;
|
|
1421
|
+
static readonly PM: Country;
|
|
1422
|
+
static readonly VC: Country;
|
|
1423
|
+
static readonly SD: Country;
|
|
1424
|
+
static readonly SR: Country;
|
|
1425
|
+
static readonly SJ: Country;
|
|
1426
|
+
static readonly SE: Country;
|
|
1427
|
+
static readonly CH: Country;
|
|
1428
|
+
static readonly SY: Country;
|
|
1429
|
+
static readonly TW: Country;
|
|
1430
|
+
static readonly TJ: Country;
|
|
1431
|
+
static readonly TZ: Country;
|
|
1432
|
+
static readonly TH: Country;
|
|
1433
|
+
static readonly TL: Country;
|
|
1434
|
+
static readonly TG: Country;
|
|
1435
|
+
static readonly TK: Country;
|
|
1436
|
+
static readonly TO: Country;
|
|
1437
|
+
static readonly TT: Country;
|
|
1438
|
+
static readonly TN: Country;
|
|
1439
|
+
static readonly TR: Country;
|
|
1440
|
+
static readonly TM: Country;
|
|
1441
|
+
static readonly TC: Country;
|
|
1442
|
+
static readonly TV: Country;
|
|
1443
|
+
static readonly UM: Country;
|
|
1444
|
+
static readonly VI: Country;
|
|
1445
|
+
static readonly UG: Country;
|
|
1446
|
+
static readonly UA: Country;
|
|
1447
|
+
static readonly AE: Country;
|
|
1448
|
+
static readonly GB: Country;
|
|
1449
|
+
static readonly US: Country;
|
|
1450
|
+
static readonly UY: Country;
|
|
1451
|
+
static readonly UZ: Country;
|
|
1452
|
+
static readonly VU: Country;
|
|
1453
|
+
static readonly VA: Country;
|
|
1454
|
+
static readonly VE: Country;
|
|
1455
|
+
static readonly VN: Country;
|
|
1456
|
+
static readonly WF: Country;
|
|
1457
|
+
static readonly EH: Country;
|
|
1458
|
+
static readonly YE: Country;
|
|
1459
|
+
static readonly ZM: Country;
|
|
1460
|
+
static readonly ZW: Country;
|
|
1461
|
+
constructor(name: string, id: string, lower?: string);
|
|
1462
|
+
static lookup(other: string): Optional<Country>;
|
|
1463
|
+
equals<E extends Enum>(other: E | Id): other is E;
|
|
1464
|
+
}
|
|
1465
|
+
|
|
1466
|
+
type DateTimeUnit = DateTimeUnit$1;
|
|
1467
|
+
type DiffOptions = {
|
|
1468
|
+
rounding: 'floor' | 'ceil' | 'round';
|
|
1469
|
+
};
|
|
1470
|
+
declare class DateTime extends Value<Optional<string>> {
|
|
1471
|
+
constructor(value?: string | number | Date, format?: string);
|
|
1472
|
+
static get now(): DateTime;
|
|
1473
|
+
get isValid(): boolean;
|
|
1474
|
+
get fromNow(): string;
|
|
1475
|
+
protected get utc(): DateTime$1;
|
|
1476
|
+
protected get luxon(): DateTime$1;
|
|
1477
|
+
from(date?: DateTime): string;
|
|
1478
|
+
from(locale?: string): string;
|
|
1479
|
+
from(date?: DateTime, locale?: string): string;
|
|
1480
|
+
isAfter(dt: DateTime): boolean;
|
|
1481
|
+
isBefore(dt: DateTime): boolean;
|
|
1482
|
+
equals(dt: DateTime): boolean;
|
|
1483
|
+
add(n: number, unit?: DateTimeUnit): DateTime;
|
|
1484
|
+
subtract(n: number, unit?: DateTimeUnit): DateTime;
|
|
1485
|
+
diff(other: DateTime, unit?: DateTimeUnit, opts?: DiffOptions): number;
|
|
1486
|
+
startOf(unit?: DateTimeUnit): DateTime;
|
|
1487
|
+
endOf(unit?: DateTimeUnit): DateTime;
|
|
1488
|
+
withZone(zone: string): DateTime;
|
|
1489
|
+
toString(): string;
|
|
1490
|
+
toJSON(): JsonValue;
|
|
1491
|
+
toFormat(format: string): string;
|
|
1492
|
+
toLocale(locale?: string, format?: string): string;
|
|
1493
|
+
toFull(locale?: string): string;
|
|
1494
|
+
toDate(): Optional<Date>;
|
|
1495
|
+
}
|
|
1496
|
+
declare const isDateTime: (dt?: unknown) => dt is DateTime;
|
|
1497
|
+
declare const dt: (dt?: unknown) => DateTime;
|
|
1498
|
+
|
|
1499
|
+
declare class EAN extends Value {
|
|
1500
|
+
get isValid(): boolean;
|
|
1501
|
+
}
|
|
1502
|
+
declare const isEAN: (ean?: unknown) => boolean;
|
|
1503
|
+
|
|
1504
|
+
declare class Email extends Value {
|
|
1505
|
+
constructor(email?: unknown);
|
|
1506
|
+
get isValid(): boolean;
|
|
1507
|
+
get name(): string;
|
|
1508
|
+
}
|
|
1509
|
+
declare const email: (email?: unknown) => Email;
|
|
1510
|
+
declare const isEmail: (e?: unknown) => boolean;
|
|
1511
|
+
|
|
1512
|
+
declare class IBAN extends Value {
|
|
1513
|
+
get isValid(): boolean;
|
|
1514
|
+
}
|
|
1515
|
+
declare const isIBAN: (iban?: unknown) => boolean;
|
|
1516
|
+
|
|
1517
|
+
declare class PostalCode extends Value {
|
|
1518
|
+
readonly country: Country | Id;
|
|
1519
|
+
constructor(postalCode?: unknown, country?: Country | Id);
|
|
1520
|
+
get isValid(): boolean;
|
|
1521
|
+
}
|
|
1522
|
+
declare const postalCode: (postalCode?: unknown, country?: Country | Id) => PostalCode;
|
|
1523
|
+
|
|
1524
|
+
interface UrlOptions {
|
|
1525
|
+
protocols?: string[];
|
|
1526
|
+
require_tld?: boolean;
|
|
1527
|
+
require_protocol?: boolean;
|
|
1528
|
+
require_host?: boolean;
|
|
1529
|
+
require_port?: boolean;
|
|
1530
|
+
require_valid_protocol?: boolean;
|
|
1531
|
+
allow_underscores?: boolean;
|
|
1532
|
+
host_whitelist?: Array<string | RegExp>;
|
|
1533
|
+
host_blacklist?: Array<string | RegExp>;
|
|
1534
|
+
allow_trailing_dot?: boolean;
|
|
1535
|
+
allow_protocol_relative_urls?: boolean;
|
|
1536
|
+
disallow_auth?: boolean;
|
|
1537
|
+
}
|
|
1538
|
+
declare class Url extends Value {
|
|
1539
|
+
readonly options?: UrlOptions | undefined;
|
|
1540
|
+
constructor(value: unknown, options?: UrlOptions | undefined);
|
|
1541
|
+
get isValid(): boolean;
|
|
1542
|
+
}
|
|
1543
|
+
declare const url: (url: unknown, options?: UrlOptions) => Url;
|
|
1544
|
+
declare const isUrl: (url?: unknown, options?: UrlOptions) => boolean;
|
|
1545
|
+
|
|
1546
|
+
declare abstract class Struct implements Validatable {
|
|
1547
|
+
protected readonly state: any;
|
|
1548
|
+
constructor(state?: any);
|
|
1549
|
+
get isValid(): boolean;
|
|
1550
|
+
toJSON(): Json;
|
|
1551
|
+
toString(): string;
|
|
1552
|
+
update(_add: Json): Struct;
|
|
1553
|
+
protected merge(a: unknown): Json;
|
|
1554
|
+
}
|
|
1555
|
+
declare function isStruct(s?: unknown): s is Struct;
|
|
1556
|
+
|
|
1557
|
+
declare class Address extends Struct {
|
|
1558
|
+
readonly street: string;
|
|
1559
|
+
readonly houseNumber: string;
|
|
1560
|
+
readonly extension: string;
|
|
1561
|
+
readonly postalCode: PostalCode;
|
|
1562
|
+
readonly city: string;
|
|
1563
|
+
readonly country: Country;
|
|
1564
|
+
toString(): string;
|
|
1565
|
+
}
|
|
1566
|
+
declare const isAddress: (a?: unknown) => a is Address;
|
|
1567
|
+
|
|
1568
|
+
declare class Dimension extends Struct {
|
|
1569
|
+
readonly value: number;
|
|
1570
|
+
readonly uom: UnitOfMeasurement;
|
|
1571
|
+
static with: (value: number, uom?: UnitOfMeasurement) => Dimension;
|
|
1572
|
+
sizeInMM(): number;
|
|
1573
|
+
get inMilliMeters(): number;
|
|
1574
|
+
gte(dim: Dimension): boolean;
|
|
1575
|
+
}
|
|
1576
|
+
|
|
1577
|
+
declare class Box extends Struct {
|
|
1578
|
+
readonly l: Dimension;
|
|
1579
|
+
readonly w: Dimension;
|
|
1580
|
+
readonly h: Dimension;
|
|
1581
|
+
private readonly sorted;
|
|
1582
|
+
lowestDim: Dimension;
|
|
1583
|
+
medianDim: Dimension;
|
|
1584
|
+
maxDim: Dimension;
|
|
1585
|
+
get isValid(): boolean;
|
|
1586
|
+
static with: (l: Dimension, w: Dimension, h: Dimension) => Box;
|
|
1587
|
+
stack(qty: number): Box;
|
|
1588
|
+
fits(contents: Box, qty?: number): boolean;
|
|
1589
|
+
}
|
|
1590
|
+
|
|
1591
|
+
declare class Money extends Struct {
|
|
1592
|
+
readonly currency: Currency;
|
|
1593
|
+
readonly value: number;
|
|
1594
|
+
add(amount: number): Money;
|
|
1595
|
+
subtract(amount: number): Money;
|
|
1596
|
+
times(n: number): Money;
|
|
1597
|
+
toString(): string;
|
|
1598
|
+
}
|
|
1599
|
+
declare const money: (currency: Currency, value: number) => Money;
|
|
1600
|
+
declare const isMoney: (m?: unknown) => m is Money;
|
|
1601
|
+
|
|
1602
|
+
declare class Name extends Struct {
|
|
1603
|
+
readonly first: string;
|
|
1604
|
+
readonly middle: string;
|
|
1605
|
+
readonly last: string;
|
|
1606
|
+
toString(): string;
|
|
1607
|
+
}
|
|
1608
|
+
declare const name: (n?: Json) => Name;
|
|
1609
|
+
|
|
1610
|
+
declare class Weight extends Struct {
|
|
1611
|
+
readonly value: number;
|
|
1612
|
+
readonly uow: UnitOfWeight;
|
|
1613
|
+
sizeInG(): number;
|
|
1614
|
+
get inGrams(): number;
|
|
1615
|
+
gte(w: Weight): boolean;
|
|
1616
|
+
lte(w: Weight): boolean;
|
|
1617
|
+
between(lower: Weight, upper?: Weight): boolean;
|
|
1618
|
+
sum(add: Weight): Weight;
|
|
1619
|
+
}
|
|
1620
|
+
declare const weight: (value: number, uow?: UnitOfWeight) => Weight;
|
|
1621
|
+
|
|
1622
|
+
declare class Currency extends Enum {
|
|
1623
|
+
readonly digits: number;
|
|
1624
|
+
constructor(id: string, name: string, digits: number, code: string);
|
|
1625
|
+
static readonly EUR: Currency;
|
|
1626
|
+
static readonly USD: Currency;
|
|
1627
|
+
static readonly AED: Currency;
|
|
1628
|
+
static readonly AFN: Currency;
|
|
1629
|
+
static readonly ALL: Currency;
|
|
1630
|
+
static readonly AMD: Currency;
|
|
1631
|
+
static readonly ARS: Currency;
|
|
1632
|
+
static readonly AUD: Currency;
|
|
1633
|
+
static readonly AZN: Currency;
|
|
1634
|
+
static readonly BAM: Currency;
|
|
1635
|
+
static readonly BDT: Currency;
|
|
1636
|
+
static readonly BGN: Currency;
|
|
1637
|
+
static readonly BHD: Currency;
|
|
1638
|
+
static readonly BIF: Currency;
|
|
1639
|
+
static readonly BND: Currency;
|
|
1640
|
+
static readonly BOB: Currency;
|
|
1641
|
+
static readonly BRL: Currency;
|
|
1642
|
+
static readonly BWP: Currency;
|
|
1643
|
+
static readonly BYN: Currency;
|
|
1644
|
+
static readonly BZD: Currency;
|
|
1645
|
+
static readonly CAD: Currency;
|
|
1646
|
+
static readonly CDF: Currency;
|
|
1647
|
+
static readonly CHF: Currency;
|
|
1648
|
+
static readonly CLP: Currency;
|
|
1649
|
+
static readonly CNY: Currency;
|
|
1650
|
+
static readonly COP: Currency;
|
|
1651
|
+
static readonly CRC: Currency;
|
|
1652
|
+
static readonly CVE: Currency;
|
|
1653
|
+
static readonly CZK: Currency;
|
|
1654
|
+
static readonly DJF: Currency;
|
|
1655
|
+
static readonly DKK: Currency;
|
|
1656
|
+
static readonly DOP: Currency;
|
|
1657
|
+
static readonly DZD: Currency;
|
|
1658
|
+
static readonly EEK: Currency;
|
|
1659
|
+
static readonly EGP: Currency;
|
|
1660
|
+
static readonly ERN: Currency;
|
|
1661
|
+
static readonly ETB: Currency;
|
|
1662
|
+
static readonly GBP: Currency;
|
|
1663
|
+
static readonly GEL: Currency;
|
|
1664
|
+
static readonly GHS: Currency;
|
|
1665
|
+
static readonly GNF: Currency;
|
|
1666
|
+
static readonly GTQ: Currency;
|
|
1667
|
+
static readonly HKD: Currency;
|
|
1668
|
+
static readonly HNL: Currency;
|
|
1669
|
+
static readonly HRK: Currency;
|
|
1670
|
+
static readonly HUF: Currency;
|
|
1671
|
+
static readonly IDR: Currency;
|
|
1672
|
+
static readonly ILS: Currency;
|
|
1673
|
+
static readonly INR: Currency;
|
|
1674
|
+
static readonly IQD: Currency;
|
|
1675
|
+
static readonly IRR: Currency;
|
|
1676
|
+
static readonly ISK: Currency;
|
|
1677
|
+
static readonly JMD: Currency;
|
|
1678
|
+
static readonly JOD: Currency;
|
|
1679
|
+
static readonly JPY: Currency;
|
|
1680
|
+
static readonly KES: Currency;
|
|
1681
|
+
static readonly KHR: Currency;
|
|
1682
|
+
static readonly KMF: Currency;
|
|
1683
|
+
static readonly KRW: Currency;
|
|
1684
|
+
static readonly KWD: Currency;
|
|
1685
|
+
static readonly KZT: Currency;
|
|
1686
|
+
static readonly LBP: Currency;
|
|
1687
|
+
static readonly LKR: Currency;
|
|
1688
|
+
static readonly LTL: Currency;
|
|
1689
|
+
static readonly LVL: Currency;
|
|
1690
|
+
static readonly LYD: Currency;
|
|
1691
|
+
static readonly MAD: Currency;
|
|
1692
|
+
static readonly MDL: Currency;
|
|
1693
|
+
static readonly MGA: Currency;
|
|
1694
|
+
static readonly MKD: Currency;
|
|
1695
|
+
static readonly MMK: Currency;
|
|
1696
|
+
static readonly MOP: Currency;
|
|
1697
|
+
static readonly MUR: Currency;
|
|
1698
|
+
static readonly MXN: Currency;
|
|
1699
|
+
static readonly MYR: Currency;
|
|
1700
|
+
static readonly MZN: Currency;
|
|
1701
|
+
static readonly NAD: Currency;
|
|
1702
|
+
static readonly NGN: Currency;
|
|
1703
|
+
static readonly NIO: Currency;
|
|
1704
|
+
static readonly NOK: Currency;
|
|
1705
|
+
static readonly NPR: Currency;
|
|
1706
|
+
static readonly NZD: Currency;
|
|
1707
|
+
static readonly OMR: Currency;
|
|
1708
|
+
static readonly PAB: Currency;
|
|
1709
|
+
static readonly PEN: Currency;
|
|
1710
|
+
static readonly PHP: Currency;
|
|
1711
|
+
static readonly PKR: Currency;
|
|
1712
|
+
static readonly PLN: Currency;
|
|
1713
|
+
static readonly PYG: Currency;
|
|
1714
|
+
static readonly QAR: Currency;
|
|
1715
|
+
static readonly RON: Currency;
|
|
1716
|
+
static readonly RSD: Currency;
|
|
1717
|
+
static readonly RUB: Currency;
|
|
1718
|
+
static readonly RWF: Currency;
|
|
1719
|
+
static readonly SAR: Currency;
|
|
1720
|
+
static readonly SDG: Currency;
|
|
1721
|
+
static readonly SEK: Currency;
|
|
1722
|
+
static readonly SGD: Currency;
|
|
1723
|
+
static readonly SOS: Currency;
|
|
1724
|
+
static readonly SYP: Currency;
|
|
1725
|
+
static readonly THB: Currency;
|
|
1726
|
+
static readonly TND: Currency;
|
|
1727
|
+
static readonly TOP: Currency;
|
|
1728
|
+
static readonly TRY: Currency;
|
|
1729
|
+
static readonly TTD: Currency;
|
|
1730
|
+
static readonly TWD: Currency;
|
|
1731
|
+
static readonly TZS: Currency;
|
|
1732
|
+
static readonly UAH: Currency;
|
|
1733
|
+
static readonly UGX: Currency;
|
|
1734
|
+
static readonly UYU: Currency;
|
|
1735
|
+
static readonly UZS: Currency;
|
|
1736
|
+
static readonly VEF: Currency;
|
|
1737
|
+
static readonly VND: Currency;
|
|
1738
|
+
static readonly XAF: Currency;
|
|
1739
|
+
static readonly XOF: Currency;
|
|
1740
|
+
static readonly YER: Currency;
|
|
1741
|
+
static readonly ZAR: Currency;
|
|
1742
|
+
static readonly ZMK: Currency;
|
|
1743
|
+
static readonly ZWL: Currency;
|
|
1744
|
+
amount: (amount?: number) => Money;
|
|
1745
|
+
get zero(): Money;
|
|
1746
|
+
}
|
|
1747
|
+
|
|
1748
|
+
declare class Environment extends Enum {
|
|
1749
|
+
static readonly Dev: Environment;
|
|
1750
|
+
static readonly Tst: Environment;
|
|
1751
|
+
static readonly Acc: Environment;
|
|
1752
|
+
static readonly Prd: Environment;
|
|
1753
|
+
}
|
|
1754
|
+
|
|
1755
|
+
declare class Locale extends Enum {
|
|
1756
|
+
readonly country: string;
|
|
1757
|
+
private readonly lower;
|
|
1758
|
+
static readonly AF: Locale;
|
|
1759
|
+
static readonly AF_NA: Locale;
|
|
1760
|
+
static readonly AF_ZA: Locale;
|
|
1761
|
+
static readonly AK: Locale;
|
|
1762
|
+
static readonly AK_GH: Locale;
|
|
1763
|
+
static readonly SQ: Locale;
|
|
1764
|
+
static readonly SQ_AL: Locale;
|
|
1765
|
+
static readonly SQ_XK: Locale;
|
|
1766
|
+
static readonly SQ_MK: Locale;
|
|
1767
|
+
static readonly AM: Locale;
|
|
1768
|
+
static readonly AM_ET: Locale;
|
|
1769
|
+
static readonly AR: Locale;
|
|
1770
|
+
static readonly AR_DZ: Locale;
|
|
1771
|
+
static readonly AR_BH: Locale;
|
|
1772
|
+
static readonly AR_TD: Locale;
|
|
1773
|
+
static readonly AR_KM: Locale;
|
|
1774
|
+
static readonly AR_DJ: Locale;
|
|
1775
|
+
static readonly AR_EG: Locale;
|
|
1776
|
+
static readonly AR_ER: Locale;
|
|
1777
|
+
static readonly AR_IQ: Locale;
|
|
1778
|
+
static readonly AR_IL: Locale;
|
|
1779
|
+
static readonly AR_JO: Locale;
|
|
1780
|
+
static readonly AR_KW: Locale;
|
|
1781
|
+
static readonly AR_LB: Locale;
|
|
1782
|
+
static readonly AR_LY: Locale;
|
|
1783
|
+
static readonly AR_MR: Locale;
|
|
1784
|
+
static readonly AR_MA: Locale;
|
|
1785
|
+
static readonly AR_OM: Locale;
|
|
1786
|
+
static readonly AR_PS: Locale;
|
|
1787
|
+
static readonly AR_QA: Locale;
|
|
1788
|
+
static readonly AR_SA: Locale;
|
|
1789
|
+
static readonly AR_SO: Locale;
|
|
1790
|
+
static readonly AR_SS: Locale;
|
|
1791
|
+
static readonly AR_SD: Locale;
|
|
1792
|
+
static readonly AR_SY: Locale;
|
|
1793
|
+
static readonly AR_TN: Locale;
|
|
1794
|
+
static readonly AR_AE: Locale;
|
|
1795
|
+
static readonly AR_EH: Locale;
|
|
1796
|
+
static readonly AR_YE: Locale;
|
|
1797
|
+
static readonly HY: Locale;
|
|
1798
|
+
static readonly HY_AM: Locale;
|
|
1799
|
+
static readonly AS: Locale;
|
|
1800
|
+
static readonly AS_IN: Locale;
|
|
1801
|
+
static readonly AZ: Locale;
|
|
1802
|
+
static readonly AZ_AZ: Locale;
|
|
1803
|
+
static readonly AZ_CYRL_AZ: Locale;
|
|
1804
|
+
static readonly AZ_CYRL: Locale;
|
|
1805
|
+
static readonly AZ_LATN_AZ: Locale;
|
|
1806
|
+
static readonly AZ_LATN: Locale;
|
|
1807
|
+
static readonly BM: Locale;
|
|
1808
|
+
static readonly BM_LATN_ML: Locale;
|
|
1809
|
+
static readonly BM_LATN: Locale;
|
|
1810
|
+
static readonly EU: Locale;
|
|
1811
|
+
static readonly EU_ES: Locale;
|
|
1812
|
+
static readonly BE: Locale;
|
|
1813
|
+
static readonly BE_BY: Locale;
|
|
1814
|
+
static readonly BN: Locale;
|
|
1815
|
+
static readonly BN_BD: Locale;
|
|
1816
|
+
static readonly BN_IN: Locale;
|
|
1817
|
+
static readonly BS: Locale;
|
|
1818
|
+
static readonly BS_BA: Locale;
|
|
1819
|
+
static readonly BS_CYRL_BA: Locale;
|
|
1820
|
+
static readonly BS_CYRL: Locale;
|
|
1821
|
+
static readonly BS_LATN_BA: Locale;
|
|
1822
|
+
static readonly BS_LATN: Locale;
|
|
1823
|
+
static readonly BR: Locale;
|
|
1824
|
+
static readonly BR_FR: Locale;
|
|
1825
|
+
static readonly BG: Locale;
|
|
1826
|
+
static readonly BG_BG: Locale;
|
|
1827
|
+
static readonly MY: Locale;
|
|
1828
|
+
static readonly MY_MM: Locale;
|
|
1829
|
+
static readonly CA: Locale;
|
|
1830
|
+
static readonly CA_AD: Locale;
|
|
1831
|
+
static readonly CA_FR: Locale;
|
|
1832
|
+
static readonly CA_IT: Locale;
|
|
1833
|
+
static readonly CA_ES: Locale;
|
|
1834
|
+
static readonly ZH: Locale;
|
|
1835
|
+
static readonly ZH_CN: Locale;
|
|
1836
|
+
static readonly ZH_HK: Locale;
|
|
1837
|
+
static readonly ZH_MO: Locale;
|
|
1838
|
+
static readonly ZH_HANS_CN: Locale;
|
|
1839
|
+
static readonly ZH_HANS_HK: Locale;
|
|
1840
|
+
static readonly ZH_HANS_MO: Locale;
|
|
1841
|
+
static readonly ZH_HANS_SG: Locale;
|
|
1842
|
+
static readonly ZH_HANS: Locale;
|
|
1843
|
+
static readonly ZH_SG: Locale;
|
|
1844
|
+
static readonly ZH_TW: Locale;
|
|
1845
|
+
static readonly ZH_HANT_HK: Locale;
|
|
1846
|
+
static readonly ZH_HANT_MO: Locale;
|
|
1847
|
+
static readonly ZH_HANT_TW: Locale;
|
|
1848
|
+
static readonly ZH_HANT: Locale;
|
|
1849
|
+
static readonly KW: Locale;
|
|
1850
|
+
static readonly KW_GB: Locale;
|
|
1851
|
+
static readonly HR: Locale;
|
|
1852
|
+
static readonly HR_BA: Locale;
|
|
1853
|
+
static readonly HR_HR: Locale;
|
|
1854
|
+
static readonly CS: Locale;
|
|
1855
|
+
static readonly CS_CZ: Locale;
|
|
1856
|
+
static readonly DA: Locale;
|
|
1857
|
+
static readonly DA_DK: Locale;
|
|
1858
|
+
static readonly DA_GL: Locale;
|
|
1859
|
+
static readonly NL: Locale;
|
|
1860
|
+
static readonly NL_AW: Locale;
|
|
1861
|
+
static readonly NL_BE: Locale;
|
|
1862
|
+
static readonly NL_BQ: Locale;
|
|
1863
|
+
static readonly NL_CW: Locale;
|
|
1864
|
+
static readonly NL_NL: Locale;
|
|
1865
|
+
static readonly NL_SX: Locale;
|
|
1866
|
+
static readonly NL_SR: Locale;
|
|
1867
|
+
static readonly DZ: Locale;
|
|
1868
|
+
static readonly DZ_BT: Locale;
|
|
1869
|
+
static readonly EN: Locale;
|
|
1870
|
+
static readonly EN_AS: Locale;
|
|
1871
|
+
static readonly EN_AI: Locale;
|
|
1872
|
+
static readonly EN_AG: Locale;
|
|
1873
|
+
static readonly EN_AU: Locale;
|
|
1874
|
+
static readonly EN_BS: Locale;
|
|
1875
|
+
static readonly EN_BB: Locale;
|
|
1876
|
+
static readonly EN_BE: Locale;
|
|
1877
|
+
static readonly EN_BZ: Locale;
|
|
1878
|
+
static readonly EN_BM: Locale;
|
|
1879
|
+
static readonly EN_BW: Locale;
|
|
1880
|
+
static readonly EN_IO: Locale;
|
|
1881
|
+
static readonly EN_VG: Locale;
|
|
1882
|
+
static readonly EN_CM: Locale;
|
|
1883
|
+
static readonly EN_CA: Locale;
|
|
1884
|
+
static readonly EN_KY: Locale;
|
|
1885
|
+
static readonly EN_CX: Locale;
|
|
1886
|
+
static readonly EN_CC: Locale;
|
|
1887
|
+
static readonly EN_CK: Locale;
|
|
1888
|
+
static readonly EN_DG: Locale;
|
|
1889
|
+
static readonly EN_DM: Locale;
|
|
1890
|
+
static readonly EN_ER: Locale;
|
|
1891
|
+
static readonly EN_FK: Locale;
|
|
1892
|
+
static readonly EN_FJ: Locale;
|
|
1893
|
+
static readonly EN_GM: Locale;
|
|
1894
|
+
static readonly EN_GH: Locale;
|
|
1895
|
+
static readonly EN_GI: Locale;
|
|
1896
|
+
static readonly EN_GD: Locale;
|
|
1897
|
+
static readonly EN_GU: Locale;
|
|
1898
|
+
static readonly EN_GG: Locale;
|
|
1899
|
+
static readonly EN_GY: Locale;
|
|
1900
|
+
static readonly EN_HK: Locale;
|
|
1901
|
+
static readonly EN_IN: Locale;
|
|
1902
|
+
static readonly EN_IE: Locale;
|
|
1903
|
+
static readonly EN_IM: Locale;
|
|
1904
|
+
static readonly EN_JM: Locale;
|
|
1905
|
+
static readonly EN_JE: Locale;
|
|
1906
|
+
static readonly EN_KE: Locale;
|
|
1907
|
+
static readonly EN_KI: Locale;
|
|
1908
|
+
static readonly EN_LS: Locale;
|
|
1909
|
+
static readonly EN_LR: Locale;
|
|
1910
|
+
static readonly EN_MO: Locale;
|
|
1911
|
+
static readonly EN_MG: Locale;
|
|
1912
|
+
static readonly EN_MW: Locale;
|
|
1913
|
+
static readonly EN_MY: Locale;
|
|
1914
|
+
static readonly EN_MT: Locale;
|
|
1915
|
+
static readonly EN_MH: Locale;
|
|
1916
|
+
static readonly EN_MU: Locale;
|
|
1917
|
+
static readonly EN_FM: Locale;
|
|
1918
|
+
static readonly EN_MS: Locale;
|
|
1919
|
+
static readonly EN_NA: Locale;
|
|
1920
|
+
static readonly EN_NR: Locale;
|
|
1921
|
+
static readonly EN_NZ: Locale;
|
|
1922
|
+
static readonly EN_NG: Locale;
|
|
1923
|
+
static readonly EN_NU: Locale;
|
|
1924
|
+
static readonly EN_NF: Locale;
|
|
1925
|
+
static readonly EN_MP: Locale;
|
|
1926
|
+
static readonly EN_PK: Locale;
|
|
1927
|
+
static readonly EN_PW: Locale;
|
|
1928
|
+
static readonly EN_PG: Locale;
|
|
1929
|
+
static readonly EN_PH: Locale;
|
|
1930
|
+
static readonly EN_PN: Locale;
|
|
1931
|
+
static readonly EN_PR: Locale;
|
|
1932
|
+
static readonly EN_RW: Locale;
|
|
1933
|
+
static readonly EN_WS: Locale;
|
|
1934
|
+
static readonly EN_SC: Locale;
|
|
1935
|
+
static readonly EN_SL: Locale;
|
|
1936
|
+
static readonly EN_SG: Locale;
|
|
1937
|
+
static readonly EN_SX: Locale;
|
|
1938
|
+
static readonly EN_SB: Locale;
|
|
1939
|
+
static readonly EN_ZA: Locale;
|
|
1940
|
+
static readonly EN_SS: Locale;
|
|
1941
|
+
static readonly EN_SH: Locale;
|
|
1942
|
+
static readonly EN_KN: Locale;
|
|
1943
|
+
static readonly EN_LC: Locale;
|
|
1944
|
+
static readonly EN_VC: Locale;
|
|
1945
|
+
static readonly EN_SD: Locale;
|
|
1946
|
+
static readonly EN_SZ: Locale;
|
|
1947
|
+
static readonly EN_TZ: Locale;
|
|
1948
|
+
static readonly EN_TK: Locale;
|
|
1949
|
+
static readonly EN_TO: Locale;
|
|
1950
|
+
static readonly EN_TT: Locale;
|
|
1951
|
+
static readonly EN_TC: Locale;
|
|
1952
|
+
static readonly EN_TV: Locale;
|
|
1953
|
+
static readonly EN_UM: Locale;
|
|
1954
|
+
static readonly EN_VI: Locale;
|
|
1955
|
+
static readonly EN_UG: Locale;
|
|
1956
|
+
static readonly EN_GB: Locale;
|
|
1957
|
+
static readonly EN_US: Locale;
|
|
1958
|
+
static readonly EN_VU: Locale;
|
|
1959
|
+
static readonly EN_ZM: Locale;
|
|
1960
|
+
static readonly EN_ZW: Locale;
|
|
1961
|
+
static readonly EO: Locale;
|
|
1962
|
+
static readonly ET: Locale;
|
|
1963
|
+
static readonly ET_EE: Locale;
|
|
1964
|
+
static readonly EE: Locale;
|
|
1965
|
+
static readonly EE_GH: Locale;
|
|
1966
|
+
static readonly EE_TG: Locale;
|
|
1967
|
+
static readonly FO: Locale;
|
|
1968
|
+
static readonly FO_FO: Locale;
|
|
1969
|
+
static readonly FI: Locale;
|
|
1970
|
+
static readonly FI_FI: Locale;
|
|
1971
|
+
static readonly FR: Locale;
|
|
1972
|
+
static readonly FR_DZ: Locale;
|
|
1973
|
+
static readonly FR_BE: Locale;
|
|
1974
|
+
static readonly FR_BJ: Locale;
|
|
1975
|
+
static readonly FR_BF: Locale;
|
|
1976
|
+
static readonly FR_BI: Locale;
|
|
1977
|
+
static readonly FR_CM: Locale;
|
|
1978
|
+
static readonly FR_CA: Locale;
|
|
1979
|
+
static readonly FR_CF: Locale;
|
|
1980
|
+
static readonly FR_TD: Locale;
|
|
1981
|
+
static readonly FR_KM: Locale;
|
|
1982
|
+
static readonly FR_CG: Locale;
|
|
1983
|
+
static readonly FR_CD: Locale;
|
|
1984
|
+
static readonly FR_CI: Locale;
|
|
1985
|
+
static readonly FR_DJ: Locale;
|
|
1986
|
+
static readonly FR_GQ: Locale;
|
|
1987
|
+
static readonly FR_FR: Locale;
|
|
1988
|
+
static readonly FR_GF: Locale;
|
|
1989
|
+
static readonly FR_PF: Locale;
|
|
1990
|
+
static readonly FR_GA: Locale;
|
|
1991
|
+
static readonly FR_GP: Locale;
|
|
1992
|
+
static readonly FR_GN: Locale;
|
|
1993
|
+
static readonly FR_HT: Locale;
|
|
1994
|
+
static readonly FR_LU: Locale;
|
|
1995
|
+
static readonly FR_MG: Locale;
|
|
1996
|
+
static readonly FR_ML: Locale;
|
|
1997
|
+
static readonly FR_MQ: Locale;
|
|
1998
|
+
static readonly FR_MR: Locale;
|
|
1999
|
+
static readonly FR_MU: Locale;
|
|
2000
|
+
static readonly FR_YT: Locale;
|
|
2001
|
+
static readonly FR_MC: Locale;
|
|
2002
|
+
static readonly FR_MA: Locale;
|
|
2003
|
+
static readonly FR_NC: Locale;
|
|
2004
|
+
static readonly FR_NE: Locale;
|
|
2005
|
+
static readonly FR_RE: Locale;
|
|
2006
|
+
static readonly FR_RW: Locale;
|
|
2007
|
+
static readonly FR_SN: Locale;
|
|
2008
|
+
static readonly FR_SC: Locale;
|
|
2009
|
+
static readonly FR_BL: Locale;
|
|
2010
|
+
static readonly FR_MF: Locale;
|
|
2011
|
+
static readonly FR_PM: Locale;
|
|
2012
|
+
static readonly FR_CH: Locale;
|
|
2013
|
+
static readonly FR_SY: Locale;
|
|
2014
|
+
static readonly FR_TG: Locale;
|
|
2015
|
+
static readonly FR_TN: Locale;
|
|
2016
|
+
static readonly FR_VU: Locale;
|
|
2017
|
+
static readonly FR_WF: Locale;
|
|
2018
|
+
static readonly FF: Locale;
|
|
2019
|
+
static readonly FF_CM: Locale;
|
|
2020
|
+
static readonly FF_GN: Locale;
|
|
2021
|
+
static readonly FF_MR: Locale;
|
|
2022
|
+
static readonly FF_SN: Locale;
|
|
2023
|
+
static readonly GL: Locale;
|
|
2024
|
+
static readonly GL_ES: Locale;
|
|
2025
|
+
static readonly LG: Locale;
|
|
2026
|
+
static readonly LG_UG: Locale;
|
|
2027
|
+
static readonly KA: Locale;
|
|
2028
|
+
static readonly KA_GE: Locale;
|
|
2029
|
+
static readonly DE: Locale;
|
|
2030
|
+
static readonly DE_AT: Locale;
|
|
2031
|
+
static readonly DE_BE: Locale;
|
|
2032
|
+
static readonly DE_DE: Locale;
|
|
2033
|
+
static readonly DE_LI: Locale;
|
|
2034
|
+
static readonly DE_LU: Locale;
|
|
2035
|
+
static readonly DE_CH: Locale;
|
|
2036
|
+
static readonly EL: Locale;
|
|
2037
|
+
static readonly EL_CY: Locale;
|
|
2038
|
+
static readonly EL_GR: Locale;
|
|
2039
|
+
static readonly GU: Locale;
|
|
2040
|
+
static readonly GU_IN: Locale;
|
|
2041
|
+
static readonly HA: Locale;
|
|
2042
|
+
static readonly HA_GH: Locale;
|
|
2043
|
+
static readonly HA_LATN_GH: Locale;
|
|
2044
|
+
static readonly HA_LATN_NE: Locale;
|
|
2045
|
+
static readonly HA_LATN_NG: Locale;
|
|
2046
|
+
static readonly HA_LATN: Locale;
|
|
2047
|
+
static readonly HA_NE: Locale;
|
|
2048
|
+
static readonly HA_NG: Locale;
|
|
2049
|
+
static readonly HE: Locale;
|
|
2050
|
+
static readonly HE_IL: Locale;
|
|
2051
|
+
static readonly HI: Locale;
|
|
2052
|
+
static readonly HI_IN: Locale;
|
|
2053
|
+
static readonly HU: Locale;
|
|
2054
|
+
static readonly HU_HU: Locale;
|
|
2055
|
+
static readonly IS: Locale;
|
|
2056
|
+
static readonly IS_IS: Locale;
|
|
2057
|
+
static readonly IG: Locale;
|
|
2058
|
+
static readonly IG_NG: Locale;
|
|
2059
|
+
static readonly ID: Locale;
|
|
2060
|
+
static readonly ID_ID: Locale;
|
|
2061
|
+
static readonly GA: Locale;
|
|
2062
|
+
static readonly GA_IE: Locale;
|
|
2063
|
+
static readonly IT: Locale;
|
|
2064
|
+
static readonly IT_IT: Locale;
|
|
2065
|
+
static readonly IT_SM: Locale;
|
|
2066
|
+
static readonly IT_CH: Locale;
|
|
2067
|
+
static readonly JA: Locale;
|
|
2068
|
+
static readonly JA_JP: Locale;
|
|
2069
|
+
static readonly KL: Locale;
|
|
2070
|
+
static readonly KL_GL: Locale;
|
|
2071
|
+
static readonly KN: Locale;
|
|
2072
|
+
static readonly KN_IN: Locale;
|
|
2073
|
+
static readonly KS: Locale;
|
|
2074
|
+
static readonly KS_ARAB_IN: Locale;
|
|
2075
|
+
static readonly KS_ARAB: Locale;
|
|
2076
|
+
static readonly KS_IN: Locale;
|
|
2077
|
+
static readonly KK: Locale;
|
|
2078
|
+
static readonly KK_CYRL_KZ: Locale;
|
|
2079
|
+
static readonly KK_CYRL: Locale;
|
|
2080
|
+
static readonly KK_KZ: Locale;
|
|
2081
|
+
static readonly KM: Locale;
|
|
2082
|
+
static readonly KM_KH: Locale;
|
|
2083
|
+
static readonly KI: Locale;
|
|
2084
|
+
static readonly KI_KE: Locale;
|
|
2085
|
+
static readonly RW: Locale;
|
|
2086
|
+
static readonly RW_RW: Locale;
|
|
2087
|
+
static readonly KO: Locale;
|
|
2088
|
+
static readonly KO_KP: Locale;
|
|
2089
|
+
static readonly KO_KR: Locale;
|
|
2090
|
+
static readonly KY: Locale;
|
|
2091
|
+
static readonly KY_CYRL_KG: Locale;
|
|
2092
|
+
static readonly KY_CYRL: Locale;
|
|
2093
|
+
static readonly KY_KG: Locale;
|
|
2094
|
+
static readonly LO: Locale;
|
|
2095
|
+
static readonly LO_LA: Locale;
|
|
2096
|
+
static readonly LV: Locale;
|
|
2097
|
+
static readonly LV_LV: Locale;
|
|
2098
|
+
static readonly LN: Locale;
|
|
2099
|
+
static readonly LN_AO: Locale;
|
|
2100
|
+
static readonly LN_CF: Locale;
|
|
2101
|
+
static readonly LN_CG: Locale;
|
|
2102
|
+
static readonly LN_CD: Locale;
|
|
2103
|
+
static readonly LT: Locale;
|
|
2104
|
+
static readonly LT_LT: Locale;
|
|
2105
|
+
static readonly LU: Locale;
|
|
2106
|
+
static readonly LU_CD: Locale;
|
|
2107
|
+
static readonly LB: Locale;
|
|
2108
|
+
static readonly LB_LU: Locale;
|
|
2109
|
+
static readonly MK: Locale;
|
|
2110
|
+
static readonly MK_MK: Locale;
|
|
2111
|
+
static readonly MG: Locale;
|
|
2112
|
+
static readonly MG_MG: Locale;
|
|
2113
|
+
static readonly MS: Locale;
|
|
2114
|
+
static readonly MS_BN: Locale;
|
|
2115
|
+
static readonly MS_LATN_BN: Locale;
|
|
2116
|
+
static readonly MS_LATN_MY: Locale;
|
|
2117
|
+
static readonly MS_LATN_SG: Locale;
|
|
2118
|
+
static readonly MS_LATN: Locale;
|
|
2119
|
+
static readonly MS_MY: Locale;
|
|
2120
|
+
static readonly MS_SG: Locale;
|
|
2121
|
+
static readonly ML: Locale;
|
|
2122
|
+
static readonly ML_IN: Locale;
|
|
2123
|
+
static readonly MT: Locale;
|
|
2124
|
+
static readonly MT_MT: Locale;
|
|
2125
|
+
static readonly GV: Locale;
|
|
2126
|
+
static readonly GV_IM: Locale;
|
|
2127
|
+
static readonly MR: Locale;
|
|
2128
|
+
static readonly MR_IN: Locale;
|
|
2129
|
+
static readonly MN: Locale;
|
|
2130
|
+
static readonly MN_CYRL_MN: Locale;
|
|
2131
|
+
static readonly MN_CYRL: Locale;
|
|
2132
|
+
static readonly MN_MN: Locale;
|
|
2133
|
+
static readonly NE: Locale;
|
|
2134
|
+
static readonly NE_IN: Locale;
|
|
2135
|
+
static readonly NE_NP: Locale;
|
|
2136
|
+
static readonly ND: Locale;
|
|
2137
|
+
static readonly ND_ZW: Locale;
|
|
2138
|
+
static readonly SE: Locale;
|
|
2139
|
+
static readonly SE_FI: Locale;
|
|
2140
|
+
static readonly SE_NO: Locale;
|
|
2141
|
+
static readonly SE_SE: Locale;
|
|
2142
|
+
static readonly NO: Locale;
|
|
2143
|
+
static readonly NO_NO: Locale;
|
|
2144
|
+
static readonly NB: Locale;
|
|
2145
|
+
static readonly NB_NO: Locale;
|
|
2146
|
+
static readonly NB_SJ: Locale;
|
|
2147
|
+
static readonly NN: Locale;
|
|
2148
|
+
static readonly NN_NO: Locale;
|
|
2149
|
+
static readonly OR: Locale;
|
|
2150
|
+
static readonly OR_IN: Locale;
|
|
2151
|
+
static readonly OM: Locale;
|
|
2152
|
+
static readonly OM_ET: Locale;
|
|
2153
|
+
static readonly OM_KE: Locale;
|
|
2154
|
+
static readonly OS: Locale;
|
|
2155
|
+
static readonly OS_GE: Locale;
|
|
2156
|
+
static readonly OS_RU: Locale;
|
|
2157
|
+
static readonly PS: Locale;
|
|
2158
|
+
static readonly PS_AF: Locale;
|
|
2159
|
+
static readonly FA: Locale;
|
|
2160
|
+
static readonly FA_AF: Locale;
|
|
2161
|
+
static readonly FA_IR: Locale;
|
|
2162
|
+
static readonly PL: Locale;
|
|
2163
|
+
static readonly PL_PL: Locale;
|
|
2164
|
+
static readonly PT: Locale;
|
|
2165
|
+
static readonly PT_AO: Locale;
|
|
2166
|
+
static readonly PT_BR: Locale;
|
|
2167
|
+
static readonly PT_CV: Locale;
|
|
2168
|
+
static readonly PT_GW: Locale;
|
|
2169
|
+
static readonly PT_MO: Locale;
|
|
2170
|
+
static readonly PT_MZ: Locale;
|
|
2171
|
+
static readonly PT_PT: Locale;
|
|
2172
|
+
static readonly PT_ST: Locale;
|
|
2173
|
+
static readonly PT_TL: Locale;
|
|
2174
|
+
static readonly PA: Locale;
|
|
2175
|
+
static readonly PA_ARAB_PK: Locale;
|
|
2176
|
+
static readonly PA_ARAB: Locale;
|
|
2177
|
+
static readonly PA_GURU_IN: Locale;
|
|
2178
|
+
static readonly PA_GURU: Locale;
|
|
2179
|
+
static readonly PA_IN: Locale;
|
|
2180
|
+
static readonly PA_PK: Locale;
|
|
2181
|
+
static readonly QU: Locale;
|
|
2182
|
+
static readonly QU_BO: Locale;
|
|
2183
|
+
static readonly QU_EC: Locale;
|
|
2184
|
+
static readonly QU_PE: Locale;
|
|
2185
|
+
static readonly RO: Locale;
|
|
2186
|
+
static readonly RO_MD: Locale;
|
|
2187
|
+
static readonly RO_RO: Locale;
|
|
2188
|
+
static readonly RM: Locale;
|
|
2189
|
+
static readonly RM_CH: Locale;
|
|
2190
|
+
static readonly RN: Locale;
|
|
2191
|
+
static readonly RN_BI: Locale;
|
|
2192
|
+
static readonly RU: Locale;
|
|
2193
|
+
static readonly RU_BY: Locale;
|
|
2194
|
+
static readonly RU_KZ: Locale;
|
|
2195
|
+
static readonly RU_KG: Locale;
|
|
2196
|
+
static readonly RU_MD: Locale;
|
|
2197
|
+
static readonly RU_RU: Locale;
|
|
2198
|
+
static readonly RU_UA: Locale;
|
|
2199
|
+
static readonly SG: Locale;
|
|
2200
|
+
static readonly SG_CF: Locale;
|
|
2201
|
+
static readonly GD: Locale;
|
|
2202
|
+
static readonly GD_GB: Locale;
|
|
2203
|
+
static readonly SR: Locale;
|
|
2204
|
+
static readonly SR_BA: Locale;
|
|
2205
|
+
static readonly SR_CYRL_BA: Locale;
|
|
2206
|
+
static readonly SR_CYRL_XK: Locale;
|
|
2207
|
+
static readonly SR_CYRL_ME: Locale;
|
|
2208
|
+
static readonly SR_CYRL_RS: Locale;
|
|
2209
|
+
static readonly SR_CYRL: Locale;
|
|
2210
|
+
static readonly SR_XK: Locale;
|
|
2211
|
+
static readonly SR_LATN_BA: Locale;
|
|
2212
|
+
static readonly SR_LATN_XK: Locale;
|
|
2213
|
+
static readonly SR_LATN_ME: Locale;
|
|
2214
|
+
static readonly SR_LATN_RS: Locale;
|
|
2215
|
+
static readonly SR_LATN: Locale;
|
|
2216
|
+
static readonly SR_ME: Locale;
|
|
2217
|
+
static readonly SR_RS: Locale;
|
|
2218
|
+
static readonly SH: Locale;
|
|
2219
|
+
static readonly SH_BA: Locale;
|
|
2220
|
+
static readonly SN: Locale;
|
|
2221
|
+
static readonly SN_ZW: Locale;
|
|
2222
|
+
static readonly II: Locale;
|
|
2223
|
+
static readonly II_CN: Locale;
|
|
2224
|
+
static readonly SI: Locale;
|
|
2225
|
+
static readonly SI_LK: Locale;
|
|
2226
|
+
static readonly SK: Locale;
|
|
2227
|
+
static readonly SK_SK: Locale;
|
|
2228
|
+
static readonly SL: Locale;
|
|
2229
|
+
static readonly SL_SI: Locale;
|
|
2230
|
+
static readonly SO: Locale;
|
|
2231
|
+
static readonly SO_DJ: Locale;
|
|
2232
|
+
static readonly SO_ET: Locale;
|
|
2233
|
+
static readonly SO_KE: Locale;
|
|
2234
|
+
static readonly SO_SO: Locale;
|
|
2235
|
+
static readonly ES: Locale;
|
|
2236
|
+
static readonly ES_AR: Locale;
|
|
2237
|
+
static readonly ES_BO: Locale;
|
|
2238
|
+
static readonly ES_IC: Locale;
|
|
2239
|
+
static readonly ES_EA: Locale;
|
|
2240
|
+
static readonly ES_CL: Locale;
|
|
2241
|
+
static readonly ES_CO: Locale;
|
|
2242
|
+
static readonly ES_CR: Locale;
|
|
2243
|
+
static readonly ES_CU: Locale;
|
|
2244
|
+
static readonly ES_DO: Locale;
|
|
2245
|
+
static readonly ES_EC: Locale;
|
|
2246
|
+
static readonly ES_SV: Locale;
|
|
2247
|
+
static readonly ES_GQ: Locale;
|
|
2248
|
+
static readonly ES_GT: Locale;
|
|
2249
|
+
static readonly ES_HN: Locale;
|
|
2250
|
+
static readonly ES_MX: Locale;
|
|
2251
|
+
static readonly ES_NI: Locale;
|
|
2252
|
+
static readonly ES_PA: Locale;
|
|
2253
|
+
static readonly ES_PY: Locale;
|
|
2254
|
+
static readonly ES_PE: Locale;
|
|
2255
|
+
static readonly ES_PH: Locale;
|
|
2256
|
+
static readonly ES_PR: Locale;
|
|
2257
|
+
static readonly ES_ES: Locale;
|
|
2258
|
+
static readonly ES_US: Locale;
|
|
2259
|
+
static readonly ES_UY: Locale;
|
|
2260
|
+
static readonly ES_VE: Locale;
|
|
2261
|
+
static readonly SW: Locale;
|
|
2262
|
+
static readonly SW_KE: Locale;
|
|
2263
|
+
static readonly SW_TZ: Locale;
|
|
2264
|
+
static readonly SW_UG: Locale;
|
|
2265
|
+
static readonly SV: Locale;
|
|
2266
|
+
static readonly SV_AX: Locale;
|
|
2267
|
+
static readonly SV_FI: Locale;
|
|
2268
|
+
static readonly SV_SE: Locale;
|
|
2269
|
+
static readonly TL: Locale;
|
|
2270
|
+
static readonly TL_PH: Locale;
|
|
2271
|
+
static readonly TA: Locale;
|
|
2272
|
+
static readonly TA_IN: Locale;
|
|
2273
|
+
static readonly TA_MY: Locale;
|
|
2274
|
+
static readonly TA_SG: Locale;
|
|
2275
|
+
static readonly TA_LK: Locale;
|
|
2276
|
+
static readonly TE: Locale;
|
|
2277
|
+
static readonly TE_IN: Locale;
|
|
2278
|
+
static readonly TH: Locale;
|
|
2279
|
+
static readonly TH_TH: Locale;
|
|
2280
|
+
static readonly BO: Locale;
|
|
2281
|
+
static readonly BO_CN: Locale;
|
|
2282
|
+
static readonly BO_IN: Locale;
|
|
2283
|
+
static readonly TI: Locale;
|
|
2284
|
+
static readonly TI_ER: Locale;
|
|
2285
|
+
static readonly TI_ET: Locale;
|
|
2286
|
+
static readonly TO: Locale;
|
|
2287
|
+
static readonly TO_TO: Locale;
|
|
2288
|
+
static readonly TR: Locale;
|
|
2289
|
+
static readonly TR_CY: Locale;
|
|
2290
|
+
static readonly TR_TR: Locale;
|
|
2291
|
+
static readonly UK: Locale;
|
|
2292
|
+
static readonly UK_UA: Locale;
|
|
2293
|
+
static readonly UR: Locale;
|
|
2294
|
+
static readonly UR_IN: Locale;
|
|
2295
|
+
static readonly UR_PK: Locale;
|
|
2296
|
+
static readonly UG: Locale;
|
|
2297
|
+
static readonly UG_ARAB_CN: Locale;
|
|
2298
|
+
static readonly UG_ARAB: Locale;
|
|
2299
|
+
static readonly UG_CN: Locale;
|
|
2300
|
+
static readonly UZ: Locale;
|
|
2301
|
+
static readonly UZ_AF: Locale;
|
|
2302
|
+
static readonly UZ_ARAB_AF: Locale;
|
|
2303
|
+
static readonly UZ_ARAB: Locale;
|
|
2304
|
+
static readonly UZ_CYRL_UZ: Locale;
|
|
2305
|
+
static readonly UZ_CYRL: Locale;
|
|
2306
|
+
static readonly UZ_LATN_UZ: Locale;
|
|
2307
|
+
static readonly UZ_LATN: Locale;
|
|
2308
|
+
static readonly UZ_UZ: Locale;
|
|
2309
|
+
static readonly VI: Locale;
|
|
2310
|
+
static readonly VI_VN: Locale;
|
|
2311
|
+
static readonly CY: Locale;
|
|
2312
|
+
static readonly CY_GB: Locale;
|
|
2313
|
+
static readonly FY: Locale;
|
|
2314
|
+
static readonly FY_NL: Locale;
|
|
2315
|
+
static readonly YI: Locale;
|
|
2316
|
+
static readonly YO: Locale;
|
|
2317
|
+
static readonly YO_BJ: Locale;
|
|
2318
|
+
static readonly YO_NG: Locale;
|
|
2319
|
+
static readonly ZU: Locale;
|
|
2320
|
+
static readonly ZU_ZA: Locale;
|
|
2321
|
+
constructor(id: Id, name: string, country?: string, lower?: string);
|
|
2322
|
+
static lookup(other: string): Optional<Locale>;
|
|
2323
|
+
equals<E extends Enum>(other: E | Id): other is E;
|
|
2324
|
+
}
|
|
2325
|
+
|
|
2326
|
+
declare class UnitOfMeasurement extends Enum {
|
|
2327
|
+
readonly mmMultiplier: number;
|
|
2328
|
+
static readonly MM: UnitOfMeasurement;
|
|
2329
|
+
static readonly CM: UnitOfMeasurement;
|
|
2330
|
+
static readonly DM: UnitOfMeasurement;
|
|
2331
|
+
static readonly M: UnitOfMeasurement;
|
|
2332
|
+
static readonly KM: UnitOfMeasurement;
|
|
2333
|
+
constructor(name: string, id: string, mmMultiplier: number);
|
|
2334
|
+
}
|
|
2335
|
+
|
|
2336
|
+
declare class UnitOfWeight extends Enum {
|
|
2337
|
+
readonly gMultiplier: number;
|
|
2338
|
+
static readonly MG: UnitOfWeight;
|
|
2339
|
+
static readonly G: UnitOfWeight;
|
|
2340
|
+
static readonly KG: UnitOfWeight;
|
|
2341
|
+
constructor(name: string, id: string, gMultiplier: number);
|
|
2342
|
+
}
|
|
2343
|
+
|
|
2344
|
+
declare class Audit extends Struct {
|
|
2345
|
+
readonly by: {
|
|
2346
|
+
id: Id;
|
|
2347
|
+
user: string;
|
|
2348
|
+
};
|
|
2349
|
+
readonly when: DateTime;
|
|
2350
|
+
constructor(json?: Json);
|
|
2351
|
+
}
|
|
2352
|
+
|
|
2353
|
+
declare abstract class Child extends Struct {
|
|
2354
|
+
readonly id: Id;
|
|
2355
|
+
protected merge(a: unknown): Json;
|
|
2356
|
+
}
|
|
2357
|
+
|
|
2358
|
+
declare abstract class Entity extends Struct {
|
|
2359
|
+
readonly id: Id;
|
|
2360
|
+
readonly created: Audit;
|
|
2361
|
+
readonly lastModified: Audit;
|
|
2362
|
+
protected merge(a: unknown): Json;
|
|
2363
|
+
}
|
|
2364
|
+
|
|
2365
|
+
type RepoAction = 'add' | 'update' | 'remove';
|
|
2366
|
+
declare class Repo<T extends Struct, Options = FetchOptions> extends Repository<T, Options> {
|
|
2367
|
+
protected ctor: Constructor<T>;
|
|
2368
|
+
private readonly gateway;
|
|
2369
|
+
constructor(ctor: Constructor<T>, gateway: Gateway<Options>);
|
|
2370
|
+
create: (item: T | Json) => T;
|
|
2371
|
+
all(options?: Options): Promise<PageList<T>>;
|
|
2372
|
+
byId(id: Id): Promise<T>;
|
|
2373
|
+
byIds(...ids: Id[]): Promise<List<T>>;
|
|
2374
|
+
byKey(key: Key, options?: Options): Promise<PageList<T>>;
|
|
2375
|
+
by(key: keyof T, value: JsonValue, options?: Options): Promise<PageList<T>>;
|
|
2376
|
+
search(q: JsonValue, options?: Options): Promise<PageList<T>>;
|
|
2377
|
+
filter(options?: Options): Promise<PageList<T>>;
|
|
2378
|
+
exists(id: Id): Promise<boolean>;
|
|
2379
|
+
add(t: T | Json): Promise<T>;
|
|
2380
|
+
update(id: Id, json: Json): Promise<T>;
|
|
2381
|
+
remove(id: Id): Promise<boolean>;
|
|
2382
|
+
extend(item: T, _action?: RepoAction): Promise<T>;
|
|
2383
|
+
validate(item: T, _action?: RepoAction): Promise<T>;
|
|
2384
|
+
upsert(id: Id, item: Json): Promise<T>;
|
|
2385
|
+
}
|
|
2386
|
+
|
|
2387
|
+
declare class Typo<T, Options = FetchOptions> extends Repository<T, Options> {
|
|
2388
|
+
protected view: View<T>;
|
|
2389
|
+
private readonly gateway;
|
|
2390
|
+
constructor(view: View<T>, gateway: Gateway<Options>);
|
|
2391
|
+
create: (j: Json) => T;
|
|
2392
|
+
all(options?: Options): Promise<PageList<T>>;
|
|
2393
|
+
byId(id: Id): Promise<T>;
|
|
2394
|
+
byIds(...ids: Id[]): Promise<List<T>>;
|
|
2395
|
+
byKey(key: Key, options?: Options): Promise<PageList<T>>;
|
|
2396
|
+
by(key: keyof T, value: JsonValue, options?: Options): Promise<PageList<T>>;
|
|
2397
|
+
search(q: JsonValue, options?: Options): Promise<PageList<T>>;
|
|
2398
|
+
filter(options?: Options): Promise<PageList<T>>;
|
|
2399
|
+
exists(id: Id): Promise<boolean>;
|
|
2400
|
+
}
|
|
2401
|
+
|
|
2402
|
+
type Resource = any;
|
|
2403
|
+
|
|
2404
|
+
declare class Service extends Enum {
|
|
2405
|
+
readonly name: string;
|
|
2406
|
+
protected app: AppProvider;
|
|
2407
|
+
protected resources: List<Resource>;
|
|
2408
|
+
protected port: number;
|
|
2409
|
+
constructor(name: string, app: AppProvider, resources?: List<Resource>);
|
|
2410
|
+
pre: () => Handler[];
|
|
2411
|
+
post: () => Handler[];
|
|
2412
|
+
with(...resources: Constructor<Resource>[]): this;
|
|
2413
|
+
atPort(port: number): this;
|
|
2414
|
+
start(message?: string): void;
|
|
2415
|
+
}
|
|
2416
|
+
|
|
2417
|
+
type Handler = Func$1<void, any>;
|
|
2418
|
+
interface AppProvider {
|
|
2419
|
+
use: (h: Handler) => void;
|
|
2420
|
+
route: (s: Service, r: Resource) => void;
|
|
2421
|
+
listen: (port: number, message?: string) => void;
|
|
2422
|
+
}
|
|
2423
|
+
|
|
2424
|
+
declare class Req implements Omit<PageOptions, 'sort'> {
|
|
2425
|
+
readonly path: Json;
|
|
2426
|
+
readonly query: Json;
|
|
2427
|
+
readonly body: unknown;
|
|
2428
|
+
readonly headers: Record<string, OneOrMore<string>>;
|
|
2429
|
+
constructor(path: Json, query: Json, body: unknown, headers: Record<string, OneOrMore<string>>);
|
|
2430
|
+
get id(): Id;
|
|
2431
|
+
get skip(): number | undefined;
|
|
2432
|
+
get take(): number | undefined;
|
|
2433
|
+
get q(): JsonValue;
|
|
2434
|
+
get: (key: Text) => any;
|
|
2435
|
+
}
|
|
2436
|
+
declare const toReq: (req: {
|
|
2437
|
+
params?: {
|
|
2438
|
+
id?: unknown;
|
|
2439
|
+
};
|
|
2440
|
+
query?: {
|
|
2441
|
+
q?: unknown;
|
|
2442
|
+
};
|
|
2443
|
+
body?: unknown;
|
|
2444
|
+
headers?: unknown;
|
|
2445
|
+
}) => Req;
|
|
2446
|
+
|
|
2447
|
+
declare class Scope extends Enum {
|
|
2448
|
+
readonly name: string;
|
|
2449
|
+
protected constructor(name: string, id?: Text);
|
|
2450
|
+
}
|
|
2451
|
+
|
|
2452
|
+
declare class App extends Scope {
|
|
2453
|
+
constructor(name: string);
|
|
2454
|
+
static readonly Main: App;
|
|
2455
|
+
}
|
|
2456
|
+
|
|
2457
|
+
declare class Search<T, Options = FetchOptions> {
|
|
2458
|
+
protected repo: Repository<T, Options>;
|
|
2459
|
+
constructor(repo: Repository<T, Options>);
|
|
2460
|
+
all(options?: Options): Promise<PageList<T>>;
|
|
2461
|
+
byId(id: Id): Promise<T>;
|
|
2462
|
+
byIds(...ids: Id[]): Promise<List<T>>;
|
|
2463
|
+
byKey(key: Key, options?: Options): Promise<PageList<T>>;
|
|
2464
|
+
query({ query, skip, take }: Req): Promise<PageList<T>>;
|
|
2465
|
+
search(query: JsonValue, options?: Options): Promise<PageList<T>>;
|
|
2466
|
+
filter(options?: Options): Promise<PageList<T>>;
|
|
2467
|
+
exists(id: Id): Promise<boolean>;
|
|
2468
|
+
}
|
|
2469
|
+
|
|
2470
|
+
declare class Manage<T, Options = FetchOptions> extends Search<T, Options> {
|
|
2471
|
+
add(json: Json): Promise<T>;
|
|
2472
|
+
update(id: Id, json: Json): Promise<T>;
|
|
2473
|
+
upsert(id: Id, json: Json): Promise<T>;
|
|
2474
|
+
remove(id: Id): Promise<boolean>;
|
|
2475
|
+
}
|
|
2476
|
+
|
|
2477
|
+
declare class UseCase extends Enum {
|
|
2478
|
+
readonly app: App;
|
|
2479
|
+
readonly scopes: List<Scope>;
|
|
2480
|
+
constructor(app: App, name: string, id?: Text, scopes?: List<Scope>);
|
|
2481
|
+
with(...s: Scope[]): this;
|
|
2482
|
+
static byScopes<U extends UseCase>(...s: Scope[]): List<U>;
|
|
2483
|
+
}
|
|
2484
|
+
|
|
2485
|
+
declare class Requires {
|
|
2486
|
+
readonly labCoat: () => PropertyDecorator;
|
|
2487
|
+
readonly token: () => PropertyDecorator;
|
|
2488
|
+
readonly scope: (scope: Scope) => PropertyDecorator;
|
|
2489
|
+
readonly useCase: (uc: UseCase) => PropertyDecorator;
|
|
2490
|
+
}
|
|
2491
|
+
declare const requires: Requires;
|
|
2492
|
+
|
|
2493
|
+
declare const route: (uri: Uri) => ClassDecorator;
|
|
2494
|
+
type Endpoint<T = unknown> = (re: Req) => Promise<T | List<T>>;
|
|
2495
|
+
type RouteRequires = {
|
|
2496
|
+
token: boolean;
|
|
2497
|
+
labCoat: boolean;
|
|
2498
|
+
scope?: Scope;
|
|
2499
|
+
uc?: UseCase;
|
|
2500
|
+
};
|
|
2501
|
+
type Route = {
|
|
2502
|
+
verb: Verb$1;
|
|
2503
|
+
endpoint: Endpoint;
|
|
2504
|
+
requires: RouteRequires;
|
|
2505
|
+
middleware: RequestHandler[];
|
|
2506
|
+
};
|
|
2507
|
+
type Routes = {
|
|
2508
|
+
route: Uri;
|
|
2509
|
+
middleware: RequestHandler[];
|
|
2510
|
+
endpoints: List<Route>;
|
|
2511
|
+
};
|
|
2512
|
+
declare const routes: (resource: Resource) => Routes;
|
|
2513
|
+
|
|
2514
|
+
declare class HealthResource implements Resource {
|
|
2515
|
+
ok: () => Promise<Json>;
|
|
2516
|
+
}
|
|
2517
|
+
|
|
2518
|
+
declare class HealthUri extends EasyUri {
|
|
2519
|
+
static readonly health: Segment;
|
|
2520
|
+
static readonly Health: HealthUri;
|
|
2521
|
+
}
|
|
2522
|
+
|
|
2523
|
+
type RouteOptions = RequestOptions | FetchOptions;
|
|
2524
|
+
declare class Api {
|
|
2525
|
+
readonly provider: RequestProvider;
|
|
2526
|
+
protected store?: Store<Response, Request> | undefined;
|
|
2527
|
+
constructor(provider?: RequestProvider, store?: Store<Response, Request> | undefined);
|
|
2528
|
+
get(uri: Uri, options?: RouteOptions, transform?: (r: any) => any, transformError?: (r: any) => any): Promise<Response>;
|
|
2529
|
+
post(uri: Uri, body?: unknown, options?: RouteOptions, transform?: (r: any) => any, transformError?: (r: any) => any): Promise<Response>;
|
|
2530
|
+
put(uri: Uri, body?: unknown, options?: RouteOptions, transform?: (r: any) => any, transformError?: (r: any) => any): Promise<Response>;
|
|
2531
|
+
patch(uri: Uri, body?: unknown, options?: RouteOptions, transform?: (r: any) => any, transformError?: (r: any) => any): Promise<Response>;
|
|
2532
|
+
delete(uri: Uri, options?: RouteOptions, transform?: (b: any) => any, transformError?: (r: any) => any): Promise<Response>;
|
|
2533
|
+
options(verb: HttpVerb, options?: RouteOptions): RequestOptions;
|
|
2534
|
+
execute(req: Request): Promise<Response>;
|
|
2535
|
+
}
|
|
2536
|
+
declare const api: Api;
|
|
2537
|
+
|
|
2538
|
+
declare class ApiGateway extends Gateway<RouteOptions> {
|
|
2539
|
+
readonly api: Api;
|
|
2540
|
+
constructor(api?: Api);
|
|
2541
|
+
get(uri: Uri, options?: RouteOptions): Promise<PageList<Json>>;
|
|
2542
|
+
getOne(uri: Uri, options?: RouteOptions): Promise<Optional<Json>>;
|
|
2543
|
+
post(uri: Uri, item?: Json, options?: RouteOptions): Promise<Json>;
|
|
2544
|
+
postSearch(uri: Uri, options?: RequestOptions | FetchOptions): Promise<PageList<Json>>;
|
|
2545
|
+
patch(uri: Uri, item?: Json, options?: RouteOptions): Promise<Json>;
|
|
2546
|
+
put(uri: Uri, item?: Json, options?: RouteOptions): Promise<Json>;
|
|
2547
|
+
delete(uri: Uri, options?: RouteOptions): Promise<boolean>;
|
|
2548
|
+
}
|
|
2549
|
+
|
|
2550
|
+
declare class AxiosProvider implements RequestProvider {
|
|
2551
|
+
readonly ai: AxiosInstance;
|
|
2552
|
+
constructor(ai?: AxiosInstance);
|
|
2553
|
+
execute: ({ uri, verb, body, transform, transformError, options }: Request) => Promise<Response>;
|
|
2554
|
+
}
|
|
2555
|
+
|
|
2556
|
+
declare class RouteGateway extends ApiGateway {
|
|
2557
|
+
readonly route: Func$1<Uri>;
|
|
2558
|
+
readonly routeId: Func$1<Uri>;
|
|
2559
|
+
readonly api: Api;
|
|
2560
|
+
constructor(route: Func$1<Uri>, routeId: Func$1<Uri>, api?: Api);
|
|
2561
|
+
all(options?: RouteOptions): Promise<PageList<Json>>;
|
|
2562
|
+
byId(id: Id, options?: RouteOptions): Promise<Optional<Json>>;
|
|
2563
|
+
byIds(...ids: Id[]): Promise<List<Json>>;
|
|
2564
|
+
search(q: JsonValue, options?: RouteOptions): Promise<PageList<Json>>;
|
|
2565
|
+
exists(id: Id, options?: RouteOptions): Promise<boolean>;
|
|
2566
|
+
add(item: Json, options?: RouteOptions): Promise<Json>;
|
|
2567
|
+
filter(options?: RouteOptions): Promise<PageList<Json>>;
|
|
2568
|
+
update(item: Json, options?: RouteOptions): Promise<Json>;
|
|
2569
|
+
upsert(item: Json, options?: RouteOptions): Promise<Json>;
|
|
2570
|
+
remove(id: Id, options?: RouteOptions): Promise<boolean>;
|
|
2571
|
+
}
|
|
2572
|
+
|
|
2573
|
+
declare class MappedRouteGateway extends RouteGateway {
|
|
2574
|
+
readonly route: Func$1<Uri>;
|
|
2575
|
+
readonly routeId: Func$1<Uri>;
|
|
2576
|
+
readonly map: Mapper;
|
|
2577
|
+
readonly api: Api;
|
|
2578
|
+
constructor(route: Func$1<Uri>, routeId: Func$1<Uri>, map?: Mapper, api?: Api);
|
|
2579
|
+
get(uri: Uri, options?: RequestOptions): Promise<PageList<Json>>;
|
|
2580
|
+
getOne(uri: Uri, options?: RequestOptions): Promise<Optional<Json>>;
|
|
2581
|
+
add(item: Json): Promise<Json>;
|
|
2582
|
+
update(item: Json): Promise<Json>;
|
|
2583
|
+
}
|
|
2584
|
+
|
|
2585
|
+
declare class ViewRouteGateway extends RouteGateway {
|
|
2586
|
+
readonly route: Func$1<Uri>;
|
|
2587
|
+
readonly routeId: Func$1<Uri>;
|
|
2588
|
+
readonly views: {
|
|
2589
|
+
in: View<Json>;
|
|
2590
|
+
out: View<Json>;
|
|
2591
|
+
};
|
|
2592
|
+
readonly api: Api;
|
|
2593
|
+
constructor(route: Func$1<Uri>, routeId: Func$1<Uri>, views?: {
|
|
2594
|
+
in: View<Json>;
|
|
2595
|
+
out: View<Json>;
|
|
2596
|
+
}, api?: Api);
|
|
2597
|
+
get(uri: Uri, options?: RequestOptions): Promise<PageList<Json>>;
|
|
2598
|
+
getOne(uri: Uri, options?: RequestOptions): Promise<Optional<Json>>;
|
|
2599
|
+
add(item: Json): Promise<Json>;
|
|
2600
|
+
update(item: Json): Promise<Json>;
|
|
2601
|
+
}
|
|
2602
|
+
|
|
2603
|
+
interface SignOptions {
|
|
2604
|
+
audience?: Optional<OneOrMore<string>>;
|
|
2605
|
+
issuer?: Optional<string>;
|
|
2606
|
+
}
|
|
2607
|
+
declare class Jwt extends Value implements Validatable {
|
|
2608
|
+
get isValid(): boolean;
|
|
2609
|
+
static sign: (token: Json, options?: SignOptions) => Jwt;
|
|
2610
|
+
static of: (a: {
|
|
2611
|
+
jwt: string;
|
|
2612
|
+
}) => Jwt;
|
|
2613
|
+
decode: () => Json;
|
|
2614
|
+
toJSON(): Json;
|
|
2615
|
+
}
|
|
2616
|
+
|
|
2617
|
+
declare const quote: (a: unknown) => string;
|
|
2618
|
+
declare class Clause implements Text {
|
|
2619
|
+
readonly first: unknown;
|
|
2620
|
+
readonly operator: string;
|
|
2621
|
+
readonly second: unknown;
|
|
2622
|
+
constructor(first: unknown, operator: string, second: unknown);
|
|
2623
|
+
and: (other: Clause) => Clause;
|
|
2624
|
+
or: (other: Clause) => Clause;
|
|
2625
|
+
toString(): string;
|
|
2626
|
+
}
|
|
2627
|
+
declare class ParathesizedClause extends Clause {
|
|
2628
|
+
toString(): string;
|
|
2629
|
+
}
|
|
2630
|
+
declare const toClause: (first: unknown, operator: string, second: unknown, conv?: Convert) => Clause;
|
|
2631
|
+
declare const isClause: TypeGuard<Clause>;
|
|
2632
|
+
|
|
2633
|
+
declare class Join {
|
|
2634
|
+
private first;
|
|
2635
|
+
private second;
|
|
2636
|
+
private c?;
|
|
2637
|
+
private c2?;
|
|
2638
|
+
readonly db: Database;
|
|
2639
|
+
constructor(first: Table, second: Table, c?: Column | undefined, c2?: Column | undefined);
|
|
2640
|
+
on(c: Column, c2: Column): this;
|
|
2641
|
+
toString(): string;
|
|
2642
|
+
}
|
|
2643
|
+
|
|
2644
|
+
declare class SqlQuery implements Query {
|
|
2645
|
+
protected table: Table | Join;
|
|
2646
|
+
readonly clauses: List<Clause>;
|
|
2647
|
+
constructor(table: Table | Join, clauses?: List<Clause>);
|
|
2648
|
+
where: (...clauses: Clause[]) => this;
|
|
2649
|
+
}
|
|
2650
|
+
|
|
2651
|
+
declare class Select extends SqlQuery {
|
|
2652
|
+
readonly columns: List<Column>;
|
|
2653
|
+
protected ordered: List<OrderColumn>;
|
|
2654
|
+
protected grouped: List<Column>;
|
|
2655
|
+
protected _top: number;
|
|
2656
|
+
protected _limit: number;
|
|
2657
|
+
protected _offset: number;
|
|
2658
|
+
constructor(table: Table | Join, columns?: List<Column>);
|
|
2659
|
+
from(t?: Table | Join): this;
|
|
2660
|
+
orderBy: (...ordered: OrderColumn[]) => this;
|
|
2661
|
+
groupBy(...grouped: Column[]): this;
|
|
2662
|
+
top(t: number): this;
|
|
2663
|
+
limit(l: number): this;
|
|
2664
|
+
offset(o: number): this;
|
|
2665
|
+
toString(): string;
|
|
2666
|
+
}
|
|
2667
|
+
|
|
2668
|
+
declare class Insert extends SqlQuery {
|
|
2669
|
+
protected table: Table;
|
|
2670
|
+
protected fields: Json;
|
|
2671
|
+
constructor(table: Table, fields: Json);
|
|
2672
|
+
toString(): string;
|
|
2673
|
+
}
|
|
2674
|
+
|
|
2675
|
+
declare class Update extends SqlQuery {
|
|
2676
|
+
protected table: Table;
|
|
2677
|
+
protected fields: Json;
|
|
2678
|
+
constructor(table: Table, fields: Json);
|
|
2679
|
+
toString(): string;
|
|
2680
|
+
}
|
|
2681
|
+
|
|
2682
|
+
declare class Delete extends SqlQuery {
|
|
2683
|
+
toString(): string;
|
|
2684
|
+
}
|
|
2685
|
+
|
|
2686
|
+
declare class Count extends Select {
|
|
2687
|
+
constructor(table: Table | Join);
|
|
2688
|
+
toString(): string;
|
|
2689
|
+
}
|
|
2690
|
+
|
|
2691
|
+
declare class Table extends Mapper {
|
|
2692
|
+
protected readonly map: {
|
|
2693
|
+
column: <T = unknown>(name: string, options?: PropertyOptions<T> | undefined) => Column;
|
|
2694
|
+
item: (property: string, options?: PropertyOptions | undefined) => Property<unknown>;
|
|
2695
|
+
ignore: (property?: string) => Mapping;
|
|
2696
|
+
skipIn: (property: string) => Mapping;
|
|
2697
|
+
skipOut: (property: string) => Mapping;
|
|
2698
|
+
func: (property: string, funcIn: Get<Optional<JsonValue>, Json>, funcOut: Get<Optional<JsonValue>, Json>) => Mapping;
|
|
2699
|
+
add: (funcIn: Get<JsonValue, Json>) => Mapping;
|
|
2700
|
+
map: (mapper: Construct<Mapper>, property?: string) => Mapping;
|
|
2701
|
+
propsToList: (...maps: Mapping[]) => Mapping;
|
|
2702
|
+
list: (mapper: Mapping, property: string) => Mapping;
|
|
2703
|
+
};
|
|
2704
|
+
readonly id: Column;
|
|
2705
|
+
constructor(options?: MapOptions);
|
|
2706
|
+
get db(): Database;
|
|
2707
|
+
get count(): Count;
|
|
2708
|
+
prop: <T = unknown>(name: string, options?: PropertyOptions<T> | undefined) => Column;
|
|
2709
|
+
select: (...columns: Column[]) => Select;
|
|
2710
|
+
insert: (fields: Json) => Insert;
|
|
2711
|
+
update: (fields: Json) => Update;
|
|
2712
|
+
delete: () => Delete;
|
|
2713
|
+
readonly join: (t: Table) => Join;
|
|
2714
|
+
}
|
|
2715
|
+
|
|
2716
|
+
declare class Column extends Property implements Text {
|
|
2717
|
+
readonly owner: Table;
|
|
2718
|
+
constructor(owner: Table, property: string, options?: PropertyOptions);
|
|
2719
|
+
get count(): Column;
|
|
2720
|
+
get max(): Column;
|
|
2721
|
+
get min(): Column;
|
|
2722
|
+
get sum(): Column;
|
|
2723
|
+
get average(): Column;
|
|
2724
|
+
get length(): Column;
|
|
2725
|
+
get asc(): OrderColumn;
|
|
2726
|
+
get desc(): OrderColumn;
|
|
2727
|
+
in: (source?: Json) => JsonValue;
|
|
2728
|
+
out: (source?: Json, key?: string) => JsonValue;
|
|
2729
|
+
function: (func: string) => Column;
|
|
2730
|
+
format: (pattern: string) => Column;
|
|
2731
|
+
is: (value: unknown) => Clause;
|
|
2732
|
+
not: (value: unknown) => Clause;
|
|
2733
|
+
like: (value: unknown) => Clause;
|
|
2734
|
+
startsLike: (value: unknown) => Clause;
|
|
2735
|
+
endsLike: (value: unknown) => Clause;
|
|
2736
|
+
unlike: (value: unknown) => Clause;
|
|
2737
|
+
less: (value: unknown) => Clause;
|
|
2738
|
+
lessEqual: (value: unknown) => Clause;
|
|
2739
|
+
greater: (value: unknown) => Clause;
|
|
2740
|
+
greaterEqual: (value: unknown) => Clause;
|
|
2741
|
+
as: (as: string) => Column;
|
|
2742
|
+
toString(): string;
|
|
2743
|
+
protected clause: (operator: string, value: unknown) => Clause;
|
|
2744
|
+
}
|
|
2745
|
+
declare class PatternColumn extends Column {
|
|
2746
|
+
protected col: Column;
|
|
2747
|
+
protected pattern: string;
|
|
2748
|
+
constructor(col: Column, pattern: string);
|
|
2749
|
+
toString(): string;
|
|
2750
|
+
}
|
|
2751
|
+
declare class OrderColumn extends PatternColumn {
|
|
2752
|
+
}
|
|
2753
|
+
|
|
2754
|
+
type TableOptions = PageOptions & {
|
|
2755
|
+
provider?: QueryProvider;
|
|
2756
|
+
};
|
|
2757
|
+
declare class TableGateway<T extends Table> extends Gateway<PageOptions> {
|
|
2758
|
+
readonly table: T;
|
|
2759
|
+
readonly provider: QueryProvider;
|
|
2760
|
+
constructor(table: T, provider?: QueryProvider);
|
|
2761
|
+
protected provide: ({ provider }?: TableOptions) => QueryProvider;
|
|
2762
|
+
all(options?: TableOptions): Promise<PageList<Json>>;
|
|
2763
|
+
byId(id: Id, options?: TableOptions): Promise<Optional<Json>>;
|
|
2764
|
+
exists(id: Id, options?: TableOptions): Promise<boolean>;
|
|
2765
|
+
add(item: Json, options?: TableOptions): Promise<Json>;
|
|
2766
|
+
remove(id: Id, options?: TableOptions): Promise<boolean>;
|
|
2767
|
+
update(item: Json, options?: TableOptions): Promise<Json>;
|
|
2768
|
+
}
|
|
2769
|
+
|
|
2770
|
+
type Constraint = Func$1<boolean | Results, any>;
|
|
2771
|
+
declare const constraint: <T>(c: Constraint, message: Text) => PropertyDecorator;
|
|
2772
|
+
declare const defined: (message?: Text) => PropertyDecorator;
|
|
2773
|
+
declare const required: (message?: Text) => PropertyDecorator;
|
|
2774
|
+
declare const notEmpty: (message?: Text) => PropertyDecorator;
|
|
2775
|
+
declare const valid: () => PropertyDecorator;
|
|
2776
|
+
declare const optional: () => PropertyDecorator;
|
|
2777
|
+
declare const includes: (sub: string, message?: string) => PropertyDecorator;
|
|
2778
|
+
declare const inList: (values: unknown[], message?: Text) => PropertyDecorator;
|
|
2779
|
+
declare const gt: (limit: number, message?: Text) => PropertyDecorator;
|
|
2780
|
+
declare const gte: (limit: number, message?: Text) => PropertyDecorator;
|
|
2781
|
+
declare const lt: (limit: number, message?: Text) => PropertyDecorator;
|
|
2782
|
+
declare const lte: (limit: number, message?: Text) => PropertyDecorator;
|
|
2783
|
+
declare const past: (message?: Text) => PropertyDecorator;
|
|
2784
|
+
declare const future: (message?: Text) => PropertyDecorator;
|
|
2785
|
+
declare const minLength: (length: number, message?: Text) => PropertyDecorator;
|
|
2786
|
+
declare const maxLength: (length: number, message?: Text) => PropertyDecorator;
|
|
2787
|
+
declare const rule: (message?: Text) => PropertyDecorator;
|
|
2788
|
+
|
|
2789
|
+
type Validator = {
|
|
2790
|
+
property: string | symbol;
|
|
2791
|
+
constraint: Constraint;
|
|
2792
|
+
text: Text;
|
|
2793
|
+
actual?: Text;
|
|
2794
|
+
};
|
|
2795
|
+
declare const asResults: (subject: unknown, template: Text, options?: TemplateOptions) => Results;
|
|
2796
|
+
declare const validate: (subject?: unknown) => Results;
|
|
2797
|
+
declare const validateReject: <T>(subject: T) => Promise<T>;
|
|
2798
|
+
|
|
2799
|
+
declare class When<W> {
|
|
2800
|
+
readonly subject: W;
|
|
2801
|
+
readonly valid: boolean;
|
|
2802
|
+
private results?;
|
|
2803
|
+
constructor(subject: W, valid?: boolean, results?: Results | undefined);
|
|
2804
|
+
get not(): When<W>;
|
|
2805
|
+
get and(): When<W>;
|
|
2806
|
+
get isDefined(): When<W>;
|
|
2807
|
+
get isEmpty(): When<W>;
|
|
2808
|
+
get isTrue(): When<W>;
|
|
2809
|
+
get isValid(): When<W>;
|
|
2810
|
+
isInstance: <U>(c: Constructor<U>) => When<W>;
|
|
2811
|
+
with: (pred: Predicate<W>) => When<W>;
|
|
2812
|
+
contains: (property: (w: W) => unknown) => When<W>;
|
|
2813
|
+
in: (...items: W[]) => When<W>;
|
|
2814
|
+
is: (item: W) => When<W>;
|
|
2815
|
+
reject: (error?: Get<ErrorOrigin, W>) => Promise<NonNullable<W>>;
|
|
2816
|
+
recover: (f: (item: W) => W | Promise<W>) => Promise<W>;
|
|
2817
|
+
protected clone: (result?: boolean) => When<W>;
|
|
2818
|
+
}
|
|
2819
|
+
declare const when: <T>(subject: T) => When<T>;
|
|
2820
|
+
|
|
2821
|
+
export { Address, Api, ApiGateway, App, AppProvider, ArrayLike, Audit, AxiosProvider, BaseContext, BaseRequestContext, Box, CacheAge, CacheControl, CacheOptions, Child, Clause, Code, Column, Condition, Constraint, Construct, Constructor, ContentType, Context, Contexts, Convert, Country, Currency, DataProvider, Database, DatabaseOptions, DateTime, DateTimeUnit, DefaultProvider, Delete, DiffOptions, Dimension, DontInfer, DotEnvContext, EAN, EasyUri, Email, Endpoint, Entity, Enum, EnvContext, Environment, ErrorOrigin, Exception, FetchOptions, Field, Filter, FilterValue, Func$1 as Func, Gateway, Get, GetProperty, Handler, HasId, HealthResource, HealthUri, HttpHeader, HttpStatus, HttpVerb, IBAN, Id, Identity, InMemoryGateway, Insert, Join, Json, JsonValue, Jwt, Key, List, Locale, LogicalCondition, Manage, MapOptions, MapStartFrom, MappedRouteGateway, Mapper, Mapping, Message, Money, Name, Nullish, OneOrMore, Optional, OrderColumn, OriginatedError, PageList, PageListOptions, PageOptions, ParathesizedClause, PartialRecord, PatternColumn, PlainSort, PostalCode, Predicate, Primitive, Property, PropertyOptions, Query, QueryProvider, Repo, RepoAction, Repository, Req, Request, RequestContext, RequestOptions, RequestProvider, RequireAtLeastOne, Requires, Resource, Response, RestResult, Result, Results, Route, RouteGateway, RouteOptions, RouteRequires, Routes, Scope, Search, Segment, Select, Sentence, Service, Sort, SortCondition, SortDirection, SqlQuery, State, Store, Struct, Table, TableGateway, TableOptions, TemplateOptions, Text, ToText, Try, TypeGuard, Typo, UnitOfMeasurement, UnitOfWeight, Update, Uri, UriExpandProps, Url, UrlOptions, UseCase, Uuid, Validatable, Validator, Value, Verb$1 as Verb, VerbOptions, View, ViewRouteGateway, Wait, Weight, When, any, api, array, asJson, asList, asNumber, asPageList, asResults, asString, asc, build, cache, cacheAge, choose, constraint, convert, ctx, days, defined, del, desc, dt, email, entries, future, get, gt, gte, ifA, ifDefined, ifFalse, ifGet, ifNotEmpty, ifTrue, inFuture, inList, inPast, includes, isA, isAddress, isAn, isArray, isBoolean, isClause, isConstructor, isDate, isDateTime, isDefined, isDoesNotExist, isEAN, isEmail, isEmpty, isEmptyObject, isEnum, isEqual, isError, isException, isFalsy, isField, isFunc, isFunction, isHttpStatus, isIBAN, isIn, isInstance, isIntersecting, isIsoDateString, isJson, isList, isLoading, isMapping, isMoney, isNotEmpty, isNotPresent, isNullish, isNumber, isObject, isOriginatedError, isPageList, isPresent, isPrimitive, isRequestOptions, isResponse, isRestResult, isResult, isResults, isSimpleView, isSortCondition, isString, isStruct, isText, isTrue, isTruthy, isUndefined, isUrl, isUuid, isValidatable, isValue, json, kebab, log, lt, lte, mappings, maxLength, meta, minLength, money, name, notEmpty, ofConstruct, ofGet, ofMessage, ofProperty, on, optional, past, patch, post, postalCode, put, quote, reject, replaceAll, required, requires, resolve, rest, route, routes, rule, search, searchable, singleton, stream, tag, template, text, toArray, toCacheOptions, toClause, toCondition, toFilter, toHttpStatus, toId, toJson, toList, toName, toObject, toOriginatedError, toPageList, toPageOptions, toReq, toResponse, toResult, toResults, toSegment, toShortFilter, toUuid, toVerbOptions, toViewer, traverse, tryTo, tuple, tuple2, tuple3, tuple4, tuple5, uri, url, use, valid, validate, validateReject, view, views, wait, we, weight, when };
|