@opra/common 0.14.0 → 0.16.0
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/cjs/document/api-document.js +211 -0
- package/cjs/document/constants.js +6 -0
- package/cjs/document/data-type/api-field.js +82 -0
- package/cjs/document/data-type/builtin/any.type.js +14 -0
- package/cjs/document/data-type/builtin/base64.type.js +38 -0
- package/cjs/document/data-type/builtin/bigint.type.js +33 -0
- package/cjs/document/data-type/builtin/boolean.type.js +28 -0
- package/cjs/document/data-type/builtin/date.type.js +18 -0
- package/cjs/document/data-type/builtin/guid.type.js +35 -0
- package/cjs/document/data-type/builtin/index.js +13 -0
- package/cjs/document/data-type/builtin/integer.type.js +28 -0
- package/cjs/document/data-type/builtin/number.type.js +33 -0
- package/cjs/document/data-type/builtin/object.type.js +20 -0
- package/cjs/document/data-type/builtin/string.type.js +24 -0
- package/cjs/document/data-type/builtin/time.type.js +32 -0
- package/cjs/document/data-type/builtin/timestamp.type.js +29 -0
- package/cjs/document/data-type/complex-type.js +154 -0
- package/cjs/document/data-type/data-type.js +46 -0
- package/cjs/document/data-type/enum-type.js +62 -0
- package/cjs/document/data-type/mapped-type.js +96 -0
- package/cjs/document/data-type/simple-type.js +61 -0
- package/cjs/document/data-type/union-type.js +81 -0
- package/cjs/document/factory/add-references.js +20 -0
- package/cjs/document/factory/create-document.js +81 -0
- package/cjs/document/factory/factory.js +62 -0
- package/cjs/document/factory/import-resource-class.js +54 -0
- package/cjs/document/factory/import-type-class.js +137 -0
- package/cjs/document/factory/index.js +4 -0
- package/cjs/document/factory/process-resources.js +55 -0
- package/cjs/document/factory/process-types.js +191 -0
- package/cjs/document/index.js +17 -0
- package/cjs/document/resource/collection.js +185 -0
- package/cjs/document/resource/resource.js +38 -0
- package/cjs/document/resource/singleton.js +91 -0
- package/cjs/exception/opra-exception.js +2 -0
- package/cjs/exception/resource-errors/resource-not-found.error.js +4 -0
- package/cjs/filter/parse.js +3 -1
- package/cjs/helpers/function-utils.js +25 -0
- package/cjs/helpers/get-stack-filename.js +24 -0
- package/cjs/helpers/index.js +7 -0
- package/cjs/{utils → helpers}/is-url.js +2 -2
- package/cjs/{schema/utils/clone-object.util.js → helpers/object-utils.js} +13 -1
- package/cjs/{utils/path-to-tree.js → helpers/path-to-object-tree.js} +9 -9
- package/cjs/helpers/responsive-map.js +62 -14
- package/cjs/{utils → helpers}/type-guards.js +12 -5
- package/cjs/http/{param-codec → codecs}/boolean-codec.js +1 -2
- package/{esm/http/param-codec → cjs/http/codecs}/date-codec.js +5 -4
- package/cjs/http/{param-codec → codecs}/filter-codec.js +1 -2
- package/cjs/http/{param-codec → codecs}/number-codec.js +1 -3
- package/cjs/http/{param-codec → codecs}/string-codec.js +1 -3
- package/cjs/http/enums/http-headers-codes.enum.js +13 -4
- package/cjs/http/enums/http-status-messages.js +68 -0
- package/cjs/http/http-headers.js +138 -124
- package/cjs/http/http-message.host.js +251 -0
- package/cjs/http/http-params.js +78 -45
- package/cjs/http/http-request-message.js +152 -0
- package/cjs/http/http-response-message.js +238 -0
- package/cjs/http/index.js +8 -11
- package/cjs/http/multipart/batch-multipart.js +169 -153
- package/cjs/http/multipart/http-request-content.js +16 -11
- package/cjs/http/multipart/http-response-content.js +13 -10
- package/cjs/http/multipart/index.js +1 -3
- package/cjs/i18n/i18n.js +1 -1
- package/cjs/index.js +6 -5
- package/cjs/schema/constants.js +2 -9
- package/cjs/schema/data-type/complex-type.interface.js +7 -0
- package/cjs/schema/data-type/enum-type.interface.js +7 -0
- package/cjs/schema/data-type/mapped-type.interface.js +7 -0
- package/cjs/schema/data-type/simple-type.interface.js +7 -0
- package/cjs/schema/data-type/union-type.interface.js +7 -0
- package/cjs/schema/index.js +42 -26
- package/cjs/schema/resource/collection.interface.js +7 -0
- package/cjs/schema/resource/container.interface.js +7 -0
- package/cjs/schema/resource/resource.interface.js +2 -0
- package/cjs/schema/resource/singleton.interface.js +7 -0
- package/cjs/schema/type-guards.js +59 -0
- package/cjs/types.js +2 -0
- package/cjs/url/index.js +2 -2
- package/cjs/url/opra-url-path-component.js +2 -2
- package/cjs/url/opra-url-path.js +7 -4
- package/cjs/url/opra-url.js +86 -117
- package/cjs/url/utils/{path-utils.js → decode-path-component.js} +1 -46
- package/cjs/url/utils/encode-path-component.js +27 -0
- package/cjs/utils/path-utils.js +24 -0
- package/esm/document/api-document.js +211 -0
- package/esm/document/constants.js +6 -0
- package/esm/document/data-type/api-field.js +82 -0
- package/esm/document/data-type/builtin/any.type.js +14 -0
- package/esm/document/data-type/builtin/base64.type.js +38 -0
- package/esm/document/data-type/builtin/bigint.type.js +33 -0
- package/esm/document/data-type/builtin/boolean.type.js +28 -0
- package/esm/document/data-type/builtin/date.type.js +18 -0
- package/esm/document/data-type/builtin/guid.type.js +35 -0
- package/esm/document/data-type/builtin/index.js +13 -0
- package/esm/document/data-type/builtin/integer.type.js +28 -0
- package/esm/document/data-type/builtin/number.type.js +33 -0
- package/esm/document/data-type/builtin/object.type.js +20 -0
- package/esm/document/data-type/builtin/string.type.js +24 -0
- package/esm/document/data-type/builtin/time.type.js +32 -0
- package/esm/document/data-type/builtin/timestamp.type.js +29 -0
- package/esm/document/data-type/complex-type.js +154 -0
- package/esm/document/data-type/data-type.js +46 -0
- package/esm/document/data-type/enum-type.js +62 -0
- package/esm/document/data-type/mapped-type.js +96 -0
- package/esm/document/data-type/simple-type.js +61 -0
- package/esm/document/data-type/union-type.js +81 -0
- package/esm/document/factory/add-references.js +20 -0
- package/esm/document/factory/create-document.js +81 -0
- package/esm/document/factory/factory.js +62 -0
- package/esm/document/factory/import-resource-class.js +54 -0
- package/esm/document/factory/import-type-class.js +137 -0
- package/esm/document/factory/index.js +4 -0
- package/esm/document/factory/process-resources.js +55 -0
- package/esm/document/factory/process-types.js +191 -0
- package/esm/document/index.js +17 -0
- package/esm/document/resource/collection.js +185 -0
- package/esm/document/resource/resource.js +38 -0
- package/esm/document/resource/singleton.js +91 -0
- package/esm/document/utils/inspect.util.js +7 -0
- package/esm/document/utils/string-compare.util.js +11 -0
- package/esm/exception/enums/issue-severity.enum.js +5 -2
- package/esm/exception/error-issue.js +2 -1
- package/esm/exception/http-errors/bad-request.error.js +8 -4
- package/esm/exception/http-errors/failed-dependency.error.js +8 -4
- package/esm/exception/http-errors/forbidden.error.js +8 -4
- package/esm/exception/http-errors/internal-server.error.js +8 -4
- package/esm/exception/http-errors/method-not-allowed.error.js +8 -4
- package/esm/exception/http-errors/not-acceptable.error.js +8 -4
- package/esm/exception/http-errors/not-found.error.js +8 -4
- package/esm/exception/http-errors/unauthorized.error.js +8 -4
- package/esm/exception/http-errors/unprocessable-entity.error.js +8 -4
- package/esm/exception/index.js +18 -15
- package/esm/exception/opra-exception.js +9 -3
- package/esm/exception/resource-errors/resource-conflict.error.js +8 -4
- package/esm/exception/resource-errors/resource-not-found.error.js +12 -4
- package/esm/exception/wrap-exception.js +24 -20
- package/esm/filter/antlr/OpraFilterLexer.js +9 -6
- package/esm/filter/antlr/OpraFilterListener.js +5 -2
- package/esm/filter/antlr/OpraFilterParser.js +126 -79
- package/esm/filter/antlr/OpraFilterVisitor.js +5 -2
- package/esm/filter/ast/abstract/ast.js +5 -1
- package/esm/filter/ast/abstract/expression.js +6 -2
- package/esm/filter/ast/abstract/literal.js +6 -2
- package/esm/filter/ast/abstract/term.js +6 -2
- package/esm/filter/ast/expressions/arithmetic-expression.js +8 -3
- package/esm/filter/ast/expressions/array-expression.js +6 -2
- package/esm/filter/ast/expressions/comparison-expression.js +6 -2
- package/esm/filter/ast/expressions/logical-expression.js +6 -2
- package/esm/filter/ast/expressions/parentheses-expression.js +6 -2
- package/esm/filter/ast/index.js +19 -16
- package/esm/filter/ast/terms/boolean-literal.js +6 -2
- package/esm/filter/ast/terms/date-literal.js +12 -8
- package/esm/filter/ast/terms/external-constant.js +6 -2
- package/esm/filter/ast/terms/null-literal.js +6 -2
- package/esm/filter/ast/terms/number-literal.js +8 -4
- package/esm/filter/ast/terms/qualified-identifier.js +6 -2
- package/esm/filter/ast/terms/string-literal.js +8 -4
- package/esm/filter/ast/terms/time-literal.js +10 -6
- package/esm/filter/build.js +69 -45
- package/esm/filter/errors.js +9 -3
- package/esm/filter/filter-tree-visitor.js +31 -26
- package/esm/filter/index.js +8 -5
- package/esm/filter/opra-error-listener.js +8 -4
- package/esm/filter/parse.js +22 -15
- package/esm/filter/utils.js +7 -2
- package/esm/helpers/function-utils.js +25 -0
- package/esm/helpers/get-stack-filename.js +24 -0
- package/esm/helpers/index.js +11 -1
- package/esm/helpers/is-url.js +8 -0
- package/esm/{schema/type-helpers/mixin.utils.js → helpers/mixin-utils.js} +7 -2
- package/esm/helpers/object-utils.js +31 -0
- package/esm/helpers/path-to-object-tree.js +28 -0
- package/esm/helpers/responsive-map.js +67 -15
- package/esm/{utils → helpers}/type-guards.js +24 -8
- package/esm/http/{param-codec → codecs}/boolean-codec.js +5 -2
- package/{cjs/http/param-codec → esm/http/codecs}/date-codec.js +1 -4
- package/{cjs/url/formats/filter-format.js → esm/http/codecs/filter-codec.js} +5 -6
- package/{cjs/url/formats/integer-format.js → esm/http/codecs/integer-codec.js} +6 -6
- package/esm/http/{param-codec → codecs}/number-codec.js +5 -3
- package/esm/http/{param-codec → codecs}/string-codec.js +5 -3
- package/esm/http/enums/http-headers-codes.enum.js +18 -6
- package/esm/http/enums/http-status-codes.enum.js +5 -2
- package/esm/http/enums/http-status-messages.js +68 -0
- package/esm/http/http-headers.js +144 -126
- package/esm/http/http-message.host.js +251 -0
- package/esm/http/http-params.js +86 -49
- package/esm/http/http-request-message.js +152 -0
- package/esm/http/http-response-message.js +238 -0
- package/esm/http/index.js +17 -17
- package/esm/http/interfaces/client-http-headers.interface.js +2 -1
- package/esm/http/interfaces/cookie-options.interface.js +2 -0
- package/esm/http/interfaces/server-http-headers.interface.js +2 -1
- package/esm/http/multipart/batch-multipart.js +170 -149
- package/esm/http/multipart/http-request-content.js +17 -8
- package/esm/http/multipart/http-response-content.js +14 -7
- package/esm/http/multipart/index.js +2 -1
- package/esm/i18n/i18n.js +28 -23
- package/esm/i18n/index.js +9 -5
- package/esm/i18n/string-utils.js +7 -2
- package/esm/i18n/translate.js +7 -3
- package/esm/index.js +16 -10
- package/esm/schema/constants.js +4 -8
- package/esm/schema/data-type/complex-type.interface.js +7 -0
- package/esm/schema/data-type/data-type.interface.js +2 -0
- package/esm/schema/data-type/enum-type.interface.js +7 -0
- package/esm/schema/data-type/field.interface.js +2 -0
- package/esm/schema/data-type/mapped-type.interface.js +7 -0
- package/esm/schema/data-type/simple-type.interface.js +7 -0
- package/esm/schema/data-type/union-type.interface.js +7 -0
- package/esm/schema/document.interface.js +2 -0
- package/esm/schema/index.js +44 -25
- package/esm/schema/resource/collection.interface.js +7 -0
- package/esm/schema/resource/container.interface.js +7 -0
- package/esm/schema/resource/endpoint.interface.js +2 -0
- package/esm/schema/resource/resource.interface.js +2 -0
- package/esm/schema/resource/singleton.interface.js +7 -0
- package/esm/schema/type-guards.js +59 -0
- package/esm/types.js +2 -0
- package/esm/url/index.js +8 -5
- package/esm/url/opra-url-path-component.js +7 -3
- package/esm/url/opra-url-path.js +19 -12
- package/esm/url/opra-url.js +100 -127
- package/esm/url/utils/decode-path-component.js +41 -0
- package/esm/url/utils/encode-path-component.js +27 -0
- package/esm/utils/path-utils.js +24 -0
- package/package.json +23 -7
- package/types/document/api-document.d.ts +102 -0
- package/types/document/constants.d.ts +3 -0
- package/types/document/data-type/api-field.d.ts +41 -0
- package/types/document/data-type/builtin/any.type.d.ts +2 -0
- package/types/document/data-type/builtin/base64.type.d.ts +6 -0
- package/types/document/data-type/builtin/bigint.type.d.ts +6 -0
- package/types/document/data-type/builtin/boolean.type.d.ts +5 -0
- package/types/document/data-type/builtin/date.type.d.ts +4 -0
- package/types/document/data-type/builtin/guid.type.d.ts +7 -0
- package/types/document/data-type/builtin/index.d.ts +10 -0
- package/types/document/data-type/builtin/integer.type.d.ts +6 -0
- package/types/document/data-type/builtin/number.type.d.ts +6 -0
- package/types/document/data-type/builtin/object.type.d.ts +3 -0
- package/types/document/data-type/builtin/string.type.d.ts +5 -0
- package/types/document/data-type/builtin/time.type.d.ts +7 -0
- package/types/document/data-type/builtin/timestamp.type.d.ts +5 -0
- package/types/document/data-type/complex-type.d.ts +50 -0
- package/types/document/data-type/data-type.d.ts +33 -0
- package/types/document/data-type/enum-type.d.ts +32 -0
- package/types/document/data-type/mapped-type.d.ts +53 -0
- package/types/document/data-type/simple-type.d.ts +33 -0
- package/types/document/data-type/union-type.d.ts +42 -0
- package/types/document/factory/add-references.d.ts +4 -0
- package/types/document/factory/create-document.d.ts +12 -0
- package/types/document/factory/factory.d.ts +61 -0
- package/types/document/factory/import-resource-class.d.ts +10 -0
- package/types/document/factory/import-type-class.d.ts +17 -0
- package/types/document/factory/index.d.ts +1 -0
- package/types/document/factory/process-resources.d.ts +7 -0
- package/types/document/factory/process-types.d.ts +6 -0
- package/types/document/index.d.ts +14 -0
- package/types/document/resource/collection.d.ts +67 -0
- package/types/document/resource/resource.d.ts +29 -0
- package/types/document/resource/singleton.d.ts +49 -0
- package/{esm → types}/exception/resource-errors/resource-not-found.error.d.ts +4 -0
- package/types/helpers/function-utils.d.ts +4 -0
- package/types/helpers/get-stack-filename.d.ts +1 -0
- package/types/helpers/index.d.ts +8 -0
- package/types/helpers/is-url.d.ts +1 -0
- package/{esm/schema/utils/clone-object.util.d.ts → types/helpers/object-utils.d.ts} +1 -0
- package/types/helpers/path-to-object-tree.d.ts +4 -0
- package/types/helpers/responsive-map.d.ts +34 -0
- package/{esm/utils → types/helpers}/type-guards.d.ts +3 -1
- package/types/http/codecs/boolean-codec.d.ts +5 -0
- package/{esm/http/param-codec → types/http/codecs}/date-codec.d.ts +2 -2
- package/{esm/http/param-codec → types/http/codecs}/filter-codec.d.ts +2 -2
- package/types/http/codecs/integer-codec.d.ts +11 -0
- package/types/http/codecs/number-codec.d.ts +14 -0
- package/types/http/codecs/string-codec.d.ts +16 -0
- package/{esm → types}/http/enums/http-headers-codes.enum.d.ts +13 -4
- package/types/http/enums/http-status-messages.d.ts +65 -0
- package/types/http/http-headers.d.ts +86 -0
- package/types/http/http-message.host.d.ts +122 -0
- package/{esm → types}/http/http-params.d.ts +43 -29
- package/types/http/http-request-message.d.ts +213 -0
- package/types/http/http-response-message.d.ts +318 -0
- package/types/http/index.d.ts +14 -0
- package/types/http/interfaces/cookie-options.interface.d.ts +4 -0
- package/types/http/multipart/http-request-content.d.ts +0 -0
- package/types/http/multipart/http-response-content.d.ts +0 -0
- package/types/http/multipart/index.d.ts +0 -0
- package/{esm → types}/index.d.ts +6 -5
- package/types/schema/constants.d.ts +2 -0
- package/types/schema/data-type/complex-type.interface.d.ts +16 -0
- package/types/schema/data-type/data-type.interface.d.ts +14 -0
- package/types/schema/data-type/enum-type.interface.d.ts +15 -0
- package/types/schema/data-type/field.interface.d.ts +21 -0
- package/types/schema/data-type/mapped-type.interface.d.ts +11 -0
- package/types/schema/data-type/simple-type.interface.d.ts +18 -0
- package/types/schema/data-type/union-type.interface.d.ts +10 -0
- package/types/schema/document.interface.d.ts +34 -0
- package/types/schema/index.d.ts +51 -0
- package/types/schema/resource/collection.interface.d.ts +33 -0
- package/types/schema/resource/container.interface.d.ts +9 -0
- package/types/schema/resource/endpoint.interface.d.ts +29 -0
- package/types/schema/resource/resource.interface.d.ts +12 -0
- package/types/schema/resource/singleton.interface.d.ts +22 -0
- package/types/schema/type-guards.d.ts +20 -0
- package/{esm/schema → types}/types.d.ts +0 -3
- package/{esm → types}/url/index.d.ts +2 -2
- package/{esm → types}/url/opra-url.d.ts +10 -29
- package/types/url/utils/decode-path-component.d.ts +5 -0
- package/types/url/utils/encode-path-component.d.ts +1 -0
- package/types/utils/path-utils.d.ts +2 -0
- package/cjs/constants.js +0 -1
- package/cjs/http/http-param-codec.js +0 -6
- package/cjs/http/http-request-node.js +0 -105
- package/cjs/http/http-request.js +0 -89
- package/cjs/http/http-response.js +0 -23
- package/cjs/http/utils/encodeURIParam.js +0 -21
- package/cjs/http/utils/normalize-headers.js +0 -28
- package/cjs/schema/decorators/opr-collection-resource.decorator.js +0 -24
- package/cjs/schema/decorators/opr-complex-type.decorator.js +0 -28
- package/cjs/schema/decorators/opr-field.decorator.js +0 -29
- package/cjs/schema/decorators/opr-resolver.decorator.js +0 -81
- package/cjs/schema/decorators/opr-simple-type.decorator.js +0 -19
- package/cjs/schema/decorators/opr-singleton-resource.decorator.js +0 -24
- package/cjs/schema/implementation/data-type/builtin/any.type.js +0 -9
- package/cjs/schema/implementation/data-type/builtin/base64-binary.type.js +0 -15
- package/cjs/schema/implementation/data-type/builtin/bigint.type.js +0 -15
- package/cjs/schema/implementation/data-type/builtin/boolean.type.js +0 -15
- package/cjs/schema/implementation/data-type/builtin/date-string.type.js +0 -15
- package/cjs/schema/implementation/data-type/builtin/date.type.js +0 -15
- package/cjs/schema/implementation/data-type/builtin/guid.type.js +0 -15
- package/cjs/schema/implementation/data-type/builtin/integer.type.js +0 -15
- package/cjs/schema/implementation/data-type/builtin/number.type.js +0 -15
- package/cjs/schema/implementation/data-type/builtin/object.type.js +0 -15
- package/cjs/schema/implementation/data-type/builtin/string.type.js +0 -15
- package/cjs/schema/implementation/data-type/builtin-data-types.js +0 -37
- package/cjs/schema/implementation/data-type/complex-type.js +0 -110
- package/cjs/schema/implementation/data-type/data-type.js +0 -37
- package/cjs/schema/implementation/data-type/simple-type.js +0 -21
- package/cjs/schema/implementation/data-type/union-type.js +0 -24
- package/cjs/schema/implementation/document-builder.js +0 -140
- package/cjs/schema/implementation/opra-document.js +0 -183
- package/cjs/schema/implementation/query/collection-count-query.js +0 -17
- package/cjs/schema/implementation/query/collection-create-query.js +0 -23
- package/cjs/schema/implementation/query/collection-delete-many-query.js +0 -17
- package/cjs/schema/implementation/query/collection-delete-query.js +0 -25
- package/cjs/schema/implementation/query/collection-get-query.js +0 -32
- package/cjs/schema/implementation/query/collection-search-query.js +0 -45
- package/cjs/schema/implementation/query/collection-update-many-query.js +0 -18
- package/cjs/schema/implementation/query/collection-update-query.js +0 -33
- package/cjs/schema/implementation/query/field-get-query.js +0 -34
- package/cjs/schema/implementation/query/index.js +0 -22
- package/cjs/schema/implementation/query/singleton-get-query.js +0 -22
- package/cjs/schema/implementation/resource/collection-resource-info.js +0 -72
- package/cjs/schema/implementation/resource/container-resource-info.js +0 -30
- package/cjs/schema/implementation/resource/resource-info.js +0 -35
- package/cjs/schema/implementation/resource/singleton-resource-info.js +0 -44
- package/cjs/schema/implementation/schema-builder/extract-resource-metadata.util.js +0 -84
- package/cjs/schema/implementation/schema-builder/extract-type-metadata.util.js +0 -94
- package/cjs/schema/opra-schema.definition.js +0 -49
- package/cjs/schema/type-helpers/extend-type.helper.js +0 -65
- package/cjs/schema/type-helpers/mixin-type.helper.js +0 -46
- package/cjs/schema/utils/class.utils.js +0 -8
- package/cjs/schema/utils/normalize-field-array.util.js +0 -44
- package/cjs/schema/utils/path-to-tree.util.js +0 -26
- package/cjs/url/formats/boolean-format.js +0 -25
- package/cjs/url/formats/date-format.js +0 -44
- package/cjs/url/formats/format.js +0 -6
- package/cjs/url/formats/number-format.js +0 -26
- package/cjs/url/formats/string-format.js +0 -25
- package/cjs/url/opra-url-search-params.js +0 -28
- package/cjs/utils/index.js +0 -6
- package/esm/constants.js +0 -1
- package/esm/helpers/index.d.ts +0 -1
- package/esm/helpers/responsive-map.d.ts +0 -32
- package/esm/http/http-headers.d.ts +0 -70
- package/esm/http/http-param-codec.d.ts +0 -4
- package/esm/http/http-param-codec.js +0 -2
- package/esm/http/http-request-node.d.ts +0 -34
- package/esm/http/http-request-node.js +0 -101
- package/esm/http/http-request.d.ts +0 -76
- package/esm/http/http-request.js +0 -85
- package/esm/http/http-response.d.ts +0 -41
- package/esm/http/http-response.js +0 -19
- package/esm/http/index.d.ts +0 -17
- package/esm/http/multipart/batch-multipart.d.ts +0 -31
- package/esm/http/multipart/http-request-content.d.ts +0 -8
- package/esm/http/multipart/http-response-content.d.ts +0 -7
- package/esm/http/multipart/index.d.ts +0 -1
- package/esm/http/param-codec/boolean-codec.d.ts +0 -5
- package/esm/http/param-codec/filter-codec.js +0 -14
- package/esm/http/param-codec/integer-codec.d.ts +0 -9
- package/esm/http/param-codec/integer-codec.js +0 -15
- package/esm/http/param-codec/number-codec.d.ts +0 -12
- package/esm/http/param-codec/string-codec.d.ts +0 -14
- package/esm/http/utils/encodeURIParam.d.ts +0 -1
- package/esm/http/utils/encodeURIParam.js +0 -17
- package/esm/http/utils/normalize-headers.d.ts +0 -1
- package/esm/http/utils/normalize-headers.js +0 -24
- package/esm/schema/constants.d.ts +0 -8
- package/esm/schema/decorators/opr-collection-resource.decorator.d.ts +0 -8
- package/esm/schema/decorators/opr-collection-resource.decorator.js +0 -19
- package/esm/schema/decorators/opr-complex-type.decorator.d.ts +0 -6
- package/esm/schema/decorators/opr-complex-type.decorator.js +0 -23
- package/esm/schema/decorators/opr-field.decorator.d.ts +0 -3
- package/esm/schema/decorators/opr-field.decorator.js +0 -24
- package/esm/schema/decorators/opr-resolver.decorator.d.ts +0 -8
- package/esm/schema/decorators/opr-resolver.decorator.js +0 -71
- package/esm/schema/decorators/opr-simple-type.decorator.d.ts +0 -6
- package/esm/schema/decorators/opr-simple-type.decorator.js +0 -14
- package/esm/schema/decorators/opr-singleton-resource.decorator.d.ts +0 -8
- package/esm/schema/decorators/opr-singleton-resource.decorator.js +0 -19
- package/esm/schema/implementation/data-type/builtin/any.type.d.ts +0 -2
- package/esm/schema/implementation/data-type/builtin/any.type.js +0 -6
- package/esm/schema/implementation/data-type/builtin/base64-binary.type.d.ts +0 -2
- package/esm/schema/implementation/data-type/builtin/base64-binary.type.js +0 -12
- package/esm/schema/implementation/data-type/builtin/bigint.type.d.ts +0 -2
- package/esm/schema/implementation/data-type/builtin/bigint.type.js +0 -12
- package/esm/schema/implementation/data-type/builtin/boolean.type.d.ts +0 -2
- package/esm/schema/implementation/data-type/builtin/boolean.type.js +0 -12
- package/esm/schema/implementation/data-type/builtin/date-string.type.d.ts +0 -2
- package/esm/schema/implementation/data-type/builtin/date-string.type.js +0 -12
- package/esm/schema/implementation/data-type/builtin/date.type.d.ts +0 -2
- package/esm/schema/implementation/data-type/builtin/date.type.js +0 -12
- package/esm/schema/implementation/data-type/builtin/guid.type.d.ts +0 -2
- package/esm/schema/implementation/data-type/builtin/guid.type.js +0 -12
- package/esm/schema/implementation/data-type/builtin/integer.type.d.ts +0 -2
- package/esm/schema/implementation/data-type/builtin/integer.type.js +0 -12
- package/esm/schema/implementation/data-type/builtin/number.type.d.ts +0 -2
- package/esm/schema/implementation/data-type/builtin/number.type.js +0 -12
- package/esm/schema/implementation/data-type/builtin/object.type.d.ts +0 -2
- package/esm/schema/implementation/data-type/builtin/object.type.js +0 -12
- package/esm/schema/implementation/data-type/builtin/string.type.d.ts +0 -2
- package/esm/schema/implementation/data-type/builtin/string.type.js +0 -12
- package/esm/schema/implementation/data-type/builtin-data-types.d.ts +0 -4
- package/esm/schema/implementation/data-type/builtin-data-types.js +0 -34
- package/esm/schema/implementation/data-type/complex-type.d.ts +0 -29
- package/esm/schema/implementation/data-type/complex-type.js +0 -106
- package/esm/schema/implementation/data-type/data-type.d.ts +0 -17
- package/esm/schema/implementation/data-type/data-type.js +0 -33
- package/esm/schema/implementation/data-type/simple-type.d.ts +0 -12
- package/esm/schema/implementation/data-type/simple-type.js +0 -17
- package/esm/schema/implementation/data-type/union-type.d.ts +0 -16
- package/esm/schema/implementation/data-type/union-type.js +0 -19
- package/esm/schema/implementation/document-builder.d.ts +0 -16
- package/esm/schema/implementation/document-builder.js +0 -135
- package/esm/schema/implementation/opra-document.d.ts +0 -44
- package/esm/schema/implementation/opra-document.js +0 -178
- package/esm/schema/implementation/query/collection-count-query.d.ts +0 -14
- package/esm/schema/implementation/query/collection-count-query.js +0 -13
- package/esm/schema/implementation/query/collection-create-query.d.ts +0 -18
- package/esm/schema/implementation/query/collection-create-query.js +0 -19
- package/esm/schema/implementation/query/collection-delete-many-query.d.ts +0 -14
- package/esm/schema/implementation/query/collection-delete-many-query.js +0 -13
- package/esm/schema/implementation/query/collection-delete-query.d.ts +0 -10
- package/esm/schema/implementation/query/collection-delete-query.js +0 -21
- package/esm/schema/implementation/query/collection-get-query.d.ts +0 -21
- package/esm/schema/implementation/query/collection-get-query.js +0 -28
- package/esm/schema/implementation/query/collection-search-query.d.ts +0 -30
- package/esm/schema/implementation/query/collection-search-query.js +0 -41
- package/esm/schema/implementation/query/collection-update-many-query.d.ts +0 -15
- package/esm/schema/implementation/query/collection-update-many-query.js +0 -14
- package/esm/schema/implementation/query/collection-update-query.d.ts +0 -19
- package/esm/schema/implementation/query/collection-update-query.js +0 -29
- package/esm/schema/implementation/query/field-get-query.d.ts +0 -30
- package/esm/schema/implementation/query/field-get-query.js +0 -30
- package/esm/schema/implementation/query/index.d.ts +0 -27
- package/esm/schema/implementation/query/index.js +0 -17
- package/esm/schema/implementation/query/singleton-get-query.d.ts +0 -20
- package/esm/schema/implementation/query/singleton-get-query.js +0 -18
- package/esm/schema/implementation/resource/collection-resource-info.d.ts +0 -22
- package/esm/schema/implementation/resource/collection-resource-info.js +0 -68
- package/esm/schema/implementation/resource/container-resource-info.d.ts +0 -13
- package/esm/schema/implementation/resource/container-resource-info.js +0 -26
- package/esm/schema/implementation/resource/resource-info.d.ts +0 -17
- package/esm/schema/implementation/resource/resource-info.js +0 -31
- package/esm/schema/implementation/resource/singleton-resource-info.d.ts +0 -15
- package/esm/schema/implementation/resource/singleton-resource-info.js +0 -40
- package/esm/schema/implementation/schema-builder/extract-resource-metadata.util.d.ts +0 -3
- package/esm/schema/implementation/schema-builder/extract-resource-metadata.util.js +0 -80
- package/esm/schema/implementation/schema-builder/extract-type-metadata.util.d.ts +0 -4
- package/esm/schema/implementation/schema-builder/extract-type-metadata.util.js +0 -90
- package/esm/schema/index.d.ts +0 -25
- package/esm/schema/interfaces/child-field-query.interface.d.ts +0 -4
- package/esm/schema/interfaces/child-field-query.interface.js +0 -1
- package/esm/schema/interfaces/data-type.metadata.d.ts +0 -18
- package/esm/schema/interfaces/data-type.metadata.js +0 -1
- package/esm/schema/interfaces/resource-container.interface.d.ts +0 -8
- package/esm/schema/interfaces/resource-container.interface.js +0 -1
- package/esm/schema/interfaces/resource.metadata.d.ts +0 -18
- package/esm/schema/interfaces/resource.metadata.js +0 -1
- package/esm/schema/opra-schema.definition.d.ts +0 -178
- package/esm/schema/opra-schema.definition.js +0 -46
- package/esm/schema/type-helpers/extend-type.helper.d.ts +0 -3
- package/esm/schema/type-helpers/extend-type.helper.js +0 -60
- package/esm/schema/type-helpers/mixin-type.helper.d.ts +0 -2
- package/esm/schema/type-helpers/mixin-type.helper.js +0 -42
- package/esm/schema/types.js +0 -1
- package/esm/schema/utils/class.utils.d.ts +0 -2
- package/esm/schema/utils/class.utils.js +0 -4
- package/esm/schema/utils/clone-object.util.js +0 -14
- package/esm/schema/utils/inspect.util.js +0 -4
- package/esm/schema/utils/normalize-field-array.util.d.ts +0 -3
- package/esm/schema/utils/normalize-field-array.util.js +0 -40
- package/esm/schema/utils/path-to-tree.util.d.ts +0 -4
- package/esm/schema/utils/path-to-tree.util.js +0 -22
- package/esm/schema/utils/string-compare.util.js +0 -7
- package/esm/url/formats/boolean-format.d.ts +0 -5
- package/esm/url/formats/boolean-format.js +0 -21
- package/esm/url/formats/date-format.d.ts +0 -16
- package/esm/url/formats/date-format.js +0 -40
- package/esm/url/formats/filter-format.d.ts +0 -6
- package/esm/url/formats/filter-format.js +0 -14
- package/esm/url/formats/format.d.ts +0 -4
- package/esm/url/formats/format.js +0 -2
- package/esm/url/formats/integer-format.d.ts +0 -9
- package/esm/url/formats/integer-format.js +0 -15
- package/esm/url/formats/number-format.d.ts +0 -12
- package/esm/url/formats/number-format.js +0 -22
- package/esm/url/formats/string-format.d.ts +0 -14
- package/esm/url/formats/string-format.js +0 -21
- package/esm/url/opra-url-search-params.d.ts +0 -5
- package/esm/url/opra-url-search-params.js +0 -24
- package/esm/url/utils/path-utils.d.ts +0 -8
- package/esm/url/utils/path-utils.js +0 -78
- package/esm/utils/index.d.ts +0 -3
- package/esm/utils/index.js +0 -3
- package/esm/utils/is-url.d.ts +0 -1
- package/esm/utils/is-url.js +0 -4
- package/esm/utils/path-to-tree.d.ts +0 -4
- package/esm/utils/path-to-tree.js +0 -24
- /package/cjs/{schema → document}/utils/inspect.util.js +0 -0
- /package/cjs/{schema → document}/utils/string-compare.util.js +0 -0
- /package/cjs/{schema/type-helpers/mixin.utils.js → helpers/mixin-utils.js} +0 -0
- /package/cjs/http/{param-codec → codecs}/integer-codec.js +0 -0
- /package/cjs/{schema/interfaces/child-field-query.interface.js → http/interfaces/cookie-options.interface.js} +0 -0
- /package/cjs/schema/{interfaces/data-type.metadata.js → data-type/data-type.interface.js} +0 -0
- /package/cjs/schema/{interfaces/resource-container.interface.js → data-type/field.interface.js} +0 -0
- /package/cjs/schema/{interfaces/resource.metadata.js → document.interface.js} +0 -0
- /package/cjs/schema/{types.js → resource/endpoint.interface.js} +0 -0
- /package/{esm/schema → types/document}/utils/inspect.util.d.ts +0 -0
- /package/{esm/schema → types/document}/utils/string-compare.util.d.ts +0 -0
- /package/{esm → types}/exception/enums/issue-severity.enum.d.ts +0 -0
- /package/{esm → types}/exception/error-issue.d.ts +0 -0
- /package/{esm → types}/exception/http-errors/bad-request.error.d.ts +0 -0
- /package/{esm → types}/exception/http-errors/failed-dependency.error.d.ts +0 -0
- /package/{esm → types}/exception/http-errors/forbidden.error.d.ts +0 -0
- /package/{esm → types}/exception/http-errors/internal-server.error.d.ts +0 -0
- /package/{esm → types}/exception/http-errors/method-not-allowed.error.d.ts +0 -0
- /package/{esm → types}/exception/http-errors/not-acceptable.error.d.ts +0 -0
- /package/{esm → types}/exception/http-errors/not-found.error.d.ts +0 -0
- /package/{esm → types}/exception/http-errors/unauthorized.error.d.ts +0 -0
- /package/{esm → types}/exception/http-errors/unprocessable-entity.error.d.ts +0 -0
- /package/{esm → types}/exception/index.d.ts +0 -0
- /package/{esm → types}/exception/opra-exception.d.ts +0 -0
- /package/{esm → types}/exception/resource-errors/resource-conflict.error.d.ts +0 -0
- /package/{esm → types}/exception/wrap-exception.d.ts +0 -0
- /package/{esm → types}/filter/antlr/OpraFilterLexer.d.ts +0 -0
- /package/{esm → types}/filter/antlr/OpraFilterListener.d.ts +0 -0
- /package/{esm → types}/filter/antlr/OpraFilterParser.d.ts +0 -0
- /package/{esm → types}/filter/antlr/OpraFilterVisitor.d.ts +0 -0
- /package/{esm → types}/filter/ast/abstract/ast.d.ts +0 -0
- /package/{esm → types}/filter/ast/abstract/expression.d.ts +0 -0
- /package/{esm → types}/filter/ast/abstract/literal.d.ts +0 -0
- /package/{esm → types}/filter/ast/abstract/term.d.ts +0 -0
- /package/{esm → types}/filter/ast/expressions/arithmetic-expression.d.ts +0 -0
- /package/{esm → types}/filter/ast/expressions/array-expression.d.ts +0 -0
- /package/{esm → types}/filter/ast/expressions/comparison-expression.d.ts +0 -0
- /package/{esm → types}/filter/ast/expressions/logical-expression.d.ts +0 -0
- /package/{esm → types}/filter/ast/expressions/parentheses-expression.d.ts +0 -0
- /package/{esm → types}/filter/ast/index.d.ts +0 -0
- /package/{esm → types}/filter/ast/terms/boolean-literal.d.ts +0 -0
- /package/{esm → types}/filter/ast/terms/date-literal.d.ts +0 -0
- /package/{esm → types}/filter/ast/terms/external-constant.d.ts +0 -0
- /package/{esm → types}/filter/ast/terms/null-literal.d.ts +0 -0
- /package/{esm → types}/filter/ast/terms/number-literal.d.ts +0 -0
- /package/{esm → types}/filter/ast/terms/qualified-identifier.d.ts +0 -0
- /package/{esm → types}/filter/ast/terms/string-literal.d.ts +0 -0
- /package/{esm → types}/filter/ast/terms/time-literal.d.ts +0 -0
- /package/{esm → types}/filter/build.d.ts +0 -0
- /package/{esm → types}/filter/errors.d.ts +0 -0
- /package/{esm → types}/filter/filter-tree-visitor.d.ts +0 -0
- /package/{esm → types}/filter/index.d.ts +0 -0
- /package/{esm → types}/filter/opra-error-listener.d.ts +0 -0
- /package/{esm → types}/filter/parse.d.ts +0 -0
- /package/{esm → types}/filter/utils.d.ts +0 -0
- /package/{esm/schema/type-helpers/mixin.utils.d.ts → types/helpers/mixin-utils.d.ts} +0 -0
- /package/{esm → types}/http/enums/http-status-codes.enum.d.ts +0 -0
- /package/{esm → types}/http/interfaces/client-http-headers.interface.d.ts +0 -0
- /package/{esm → types}/http/interfaces/server-http-headers.interface.d.ts +0 -0
- /package/{esm/constants.d.ts → types/http/multipart/batch-multipart.d.ts} +0 -0
- /package/{esm → types}/i18n/i18n.d.ts +0 -0
- /package/{esm → types}/i18n/index.d.ts +0 -0
- /package/{esm → types}/i18n/string-utils.d.ts +0 -0
- /package/{esm → types}/i18n/translate.d.ts +0 -0
- /package/{esm → types}/url/opra-url-path-component.d.ts +0 -0
- /package/{esm → types}/url/opra-url-path.d.ts +0 -0
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.OprComplexType = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const lodash_omit_1 = tslib_1.__importDefault(require("lodash.omit"));
|
|
6
|
-
const constants_js_1 = require("../constants.js");
|
|
7
|
-
const NAME_PATTERN = /^(.*)Type$/;
|
|
8
|
-
function OprComplexType(options) {
|
|
9
|
-
return (target) => {
|
|
10
|
-
const name = options?.name || target.name.match(NAME_PATTERN)?.[1] || target.name;
|
|
11
|
-
const meta = {
|
|
12
|
-
kind: 'ComplexType',
|
|
13
|
-
name,
|
|
14
|
-
};
|
|
15
|
-
Object.assign(meta, (0, lodash_omit_1.default)(options, Object.keys(meta)));
|
|
16
|
-
const base = Object.getPrototypeOf(target);
|
|
17
|
-
const baseMeta = Reflect.getMetadata(constants_js_1.DATATYPE_METADATA, base);
|
|
18
|
-
if (baseMeta) {
|
|
19
|
-
if (baseMeta.additionalFields && meta.additionalFields == null)
|
|
20
|
-
meta.additionalFields = true;
|
|
21
|
-
meta.extends = [{
|
|
22
|
-
type: base
|
|
23
|
-
}];
|
|
24
|
-
}
|
|
25
|
-
Reflect.defineMetadata(constants_js_1.DATATYPE_METADATA, meta, target);
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
exports.OprComplexType = OprComplexType;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.OprField = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const lodash_omit_1 = tslib_1.__importDefault(require("lodash.omit"));
|
|
6
|
-
const constants_js_1 = require("../constants.js");
|
|
7
|
-
function OprField(args) {
|
|
8
|
-
return (target, propertyKey) => {
|
|
9
|
-
if (typeof propertyKey !== 'string')
|
|
10
|
-
throw new TypeError(`Symbol properties can't be used as field`);
|
|
11
|
-
const designType = Reflect.getMetadata('design:type', target, propertyKey);
|
|
12
|
-
const metadata = {
|
|
13
|
-
type: args?.type
|
|
14
|
-
};
|
|
15
|
-
Object.assign(metadata, (0, lodash_omit_1.default)(args, Object.keys(metadata)));
|
|
16
|
-
if (designType === Array) {
|
|
17
|
-
metadata.isArray = true;
|
|
18
|
-
metadata.type = metadata.type || 'any';
|
|
19
|
-
}
|
|
20
|
-
else {
|
|
21
|
-
delete metadata.isArray;
|
|
22
|
-
metadata.type = metadata.type || designType;
|
|
23
|
-
}
|
|
24
|
-
const fields = Reflect.getOwnMetadata(constants_js_1.COMPLEXTYPE_FIELDS, target.constructor) || {};
|
|
25
|
-
fields[propertyKey] = metadata;
|
|
26
|
-
Reflect.defineMetadata(constants_js_1.COMPLEXTYPE_FIELDS, fields, target.constructor);
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
exports.OprField = OprField;
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.OprSearchResolver = exports.OprGetResolver = exports.OprUpdateManyResolver = exports.OprUpdateResolver = exports.OprDeleteManyResolver = exports.OprDeleteResolver = exports.OprCreateResolver = void 0;
|
|
4
|
-
const constants_js_1 = require("../constants.js");
|
|
5
|
-
function OprCreateResolver(options) {
|
|
6
|
-
return (target, propertyKey) => {
|
|
7
|
-
if (propertyKey !== 'create')
|
|
8
|
-
throw new TypeError('This decorator can only be applied for the "create" property');
|
|
9
|
-
const metadata = {
|
|
10
|
-
...options
|
|
11
|
-
};
|
|
12
|
-
Reflect.defineMetadata(constants_js_1.RESOLVER_METADATA, metadata, target, propertyKey);
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
exports.OprCreateResolver = OprCreateResolver;
|
|
16
|
-
function OprDeleteResolver(options) {
|
|
17
|
-
return (target, propertyKey) => {
|
|
18
|
-
if (propertyKey !== 'delete')
|
|
19
|
-
throw new TypeError('This decorator can only be applied for the "delete" property');
|
|
20
|
-
const metadata = {
|
|
21
|
-
...options
|
|
22
|
-
};
|
|
23
|
-
Reflect.defineMetadata(constants_js_1.RESOLVER_METADATA, metadata, target, propertyKey);
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
exports.OprDeleteResolver = OprDeleteResolver;
|
|
27
|
-
function OprDeleteManyResolver(options) {
|
|
28
|
-
return (target, propertyKey) => {
|
|
29
|
-
if (propertyKey !== 'deleteMany')
|
|
30
|
-
throw new TypeError('This decorator can only be applied for the "deleteMany" property');
|
|
31
|
-
const metadata = {
|
|
32
|
-
...options
|
|
33
|
-
};
|
|
34
|
-
Reflect.defineMetadata(constants_js_1.RESOLVER_METADATA, metadata, target, propertyKey);
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
exports.OprDeleteManyResolver = OprDeleteManyResolver;
|
|
38
|
-
function OprUpdateResolver(options) {
|
|
39
|
-
return (target, propertyKey) => {
|
|
40
|
-
if (propertyKey !== 'update')
|
|
41
|
-
throw new TypeError('This decorator can only be applied for the "update" property');
|
|
42
|
-
const metadata = {
|
|
43
|
-
...options
|
|
44
|
-
};
|
|
45
|
-
Reflect.defineMetadata(constants_js_1.RESOLVER_METADATA, metadata, target, propertyKey);
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
exports.OprUpdateResolver = OprUpdateResolver;
|
|
49
|
-
function OprUpdateManyResolver(options) {
|
|
50
|
-
return (target, propertyKey) => {
|
|
51
|
-
if (propertyKey !== 'updateMany')
|
|
52
|
-
throw new TypeError('This decorator can only be applied for the "updateMany" property');
|
|
53
|
-
const metadata = {
|
|
54
|
-
...options
|
|
55
|
-
};
|
|
56
|
-
Reflect.defineMetadata(constants_js_1.RESOLVER_METADATA, metadata, target, propertyKey);
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
|
-
exports.OprUpdateManyResolver = OprUpdateManyResolver;
|
|
60
|
-
function OprGetResolver(options) {
|
|
61
|
-
return (target, propertyKey) => {
|
|
62
|
-
if (propertyKey !== 'get')
|
|
63
|
-
throw new TypeError('This decorator can only be applied for the "get" property');
|
|
64
|
-
const metadata = {
|
|
65
|
-
...options
|
|
66
|
-
};
|
|
67
|
-
Reflect.defineMetadata(constants_js_1.RESOLVER_METADATA, metadata, target, propertyKey);
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
exports.OprGetResolver = OprGetResolver;
|
|
71
|
-
function OprSearchResolver(options) {
|
|
72
|
-
return (target, propertyKey) => {
|
|
73
|
-
if (propertyKey !== 'search')
|
|
74
|
-
throw new TypeError('This decorator can only be applied for the "search" property');
|
|
75
|
-
const metadata = {
|
|
76
|
-
...options
|
|
77
|
-
};
|
|
78
|
-
Reflect.defineMetadata(constants_js_1.RESOLVER_METADATA, metadata, target, propertyKey);
|
|
79
|
-
};
|
|
80
|
-
}
|
|
81
|
-
exports.OprSearchResolver = OprSearchResolver;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.OprSimpleType = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const lodash_omit_1 = tslib_1.__importDefault(require("lodash.omit"));
|
|
6
|
-
const constants_js_1 = require("../constants.js");
|
|
7
|
-
const NAME_PATTERN = /^(.*)Type$/;
|
|
8
|
-
function OprSimpleType(options) {
|
|
9
|
-
return (target) => {
|
|
10
|
-
const name = options?.name || target.name.match(NAME_PATTERN)?.[1] || target.name;
|
|
11
|
-
const meta = {
|
|
12
|
-
kind: 'SimpleType',
|
|
13
|
-
name
|
|
14
|
-
};
|
|
15
|
-
Object.assign(meta, (0, lodash_omit_1.default)(options, Object.keys(meta)));
|
|
16
|
-
Reflect.defineMetadata(constants_js_1.DATATYPE_METADATA, meta, target);
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
exports.OprSimpleType = OprSimpleType;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.OprSingletonResource = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
require("reflect-metadata");
|
|
6
|
-
const lodash_omit_1 = tslib_1.__importDefault(require("lodash.omit"));
|
|
7
|
-
const constants_js_1 = require("../constants.js");
|
|
8
|
-
const NESTJS_INJECTABLE_WATERMARK = '__injectable__';
|
|
9
|
-
const NAME_PATTERN = /^(.*)Resource$/;
|
|
10
|
-
function OprSingletonResource(type, options) {
|
|
11
|
-
return function (target) {
|
|
12
|
-
const name = options?.name || target.name.match(NAME_PATTERN)?.[1] || target.name;
|
|
13
|
-
const meta = {
|
|
14
|
-
kind: 'SingletonResource',
|
|
15
|
-
type,
|
|
16
|
-
name
|
|
17
|
-
};
|
|
18
|
-
Object.assign(meta, (0, lodash_omit_1.default)(options, Object.keys(meta)));
|
|
19
|
-
Reflect.defineMetadata(constants_js_1.RESOURCE_METADATA, meta, target);
|
|
20
|
-
/* Define Injectable metadata for NestJS support*/
|
|
21
|
-
Reflect.defineMetadata(NESTJS_INJECTABLE_WATERMARK, true, target);
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
exports.OprSingletonResource = OprSingletonResource;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Base64BinaryType = void 0;
|
|
4
|
-
const BufferConstructor = Object.getPrototypeOf(Buffer.from('')).constructor;
|
|
5
|
-
exports.Base64BinaryType = {
|
|
6
|
-
kind: 'SimpleType',
|
|
7
|
-
description: 'A stream of bytes, base64 encoded',
|
|
8
|
-
ctor: BufferConstructor,
|
|
9
|
-
parse(v) {
|
|
10
|
-
return Buffer.from(v);
|
|
11
|
-
},
|
|
12
|
-
serialize(v) {
|
|
13
|
-
return Buffer.isBuffer(v) ? v.toString('base64') : undefined;
|
|
14
|
-
}
|
|
15
|
-
};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.BigIntType = void 0;
|
|
4
|
-
const BigIntConstructor = Object.getPrototypeOf(BigInt(0)).constructor;
|
|
5
|
-
exports.BigIntType = {
|
|
6
|
-
kind: 'SimpleType',
|
|
7
|
-
description: 'BigInt number',
|
|
8
|
-
ctor: BigIntConstructor,
|
|
9
|
-
parse(v) {
|
|
10
|
-
return BigInt(v);
|
|
11
|
-
},
|
|
12
|
-
serialize(v) {
|
|
13
|
-
return String(v);
|
|
14
|
-
}
|
|
15
|
-
};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.BooleanType = void 0;
|
|
4
|
-
const putil_varhelpers_1 = require("putil-varhelpers");
|
|
5
|
-
exports.BooleanType = {
|
|
6
|
-
kind: 'SimpleType',
|
|
7
|
-
description: 'Simple true/false value',
|
|
8
|
-
ctor: Boolean,
|
|
9
|
-
parse(v) {
|
|
10
|
-
return (0, putil_varhelpers_1.toBoolean)(v);
|
|
11
|
-
},
|
|
12
|
-
serialize(v) {
|
|
13
|
-
return (0, putil_varhelpers_1.toBoolean)(v);
|
|
14
|
-
}
|
|
15
|
-
};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DateStringType = void 0;
|
|
4
|
-
const putil_varhelpers_1 = require("putil-varhelpers");
|
|
5
|
-
exports.DateStringType = {
|
|
6
|
-
kind: 'SimpleType',
|
|
7
|
-
description: 'A date, date-time or partial date in string format',
|
|
8
|
-
ctor: String,
|
|
9
|
-
parse(v) {
|
|
10
|
-
return (0, putil_varhelpers_1.toString)(v);
|
|
11
|
-
},
|
|
12
|
-
serialize(v) {
|
|
13
|
-
return (0, putil_varhelpers_1.toString)(v);
|
|
14
|
-
}
|
|
15
|
-
};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DateType = void 0;
|
|
4
|
-
const putil_varhelpers_1 = require("putil-varhelpers");
|
|
5
|
-
exports.DateType = {
|
|
6
|
-
kind: 'SimpleType',
|
|
7
|
-
description: 'A date, date-time or partial date',
|
|
8
|
-
ctor: String,
|
|
9
|
-
parse(v) {
|
|
10
|
-
return (0, putil_varhelpers_1.toDate)(v);
|
|
11
|
-
},
|
|
12
|
-
serialize(v) {
|
|
13
|
-
return String(v);
|
|
14
|
-
}
|
|
15
|
-
};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GuidType = void 0;
|
|
4
|
-
const putil_varhelpers_1 = require("putil-varhelpers");
|
|
5
|
-
exports.GuidType = {
|
|
6
|
-
kind: 'SimpleType',
|
|
7
|
-
description: 'A guid value',
|
|
8
|
-
ctor: String,
|
|
9
|
-
parse(v) {
|
|
10
|
-
return (0, putil_varhelpers_1.toString)(v);
|
|
11
|
-
},
|
|
12
|
-
serialize(v) {
|
|
13
|
-
return (0, putil_varhelpers_1.toString)(v);
|
|
14
|
-
}
|
|
15
|
-
};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.IntegerType = void 0;
|
|
4
|
-
const putil_varhelpers_1 = require("putil-varhelpers");
|
|
5
|
-
exports.IntegerType = {
|
|
6
|
-
kind: 'SimpleType',
|
|
7
|
-
description: 'An integer number',
|
|
8
|
-
ctor: Number,
|
|
9
|
-
parse(v) {
|
|
10
|
-
return (0, putil_varhelpers_1.toInt)(v);
|
|
11
|
-
},
|
|
12
|
-
serialize(v) {
|
|
13
|
-
return (0, putil_varhelpers_1.toInt)(v);
|
|
14
|
-
}
|
|
15
|
-
};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.NumberType = void 0;
|
|
4
|
-
const putil_varhelpers_1 = require("putil-varhelpers");
|
|
5
|
-
exports.NumberType = {
|
|
6
|
-
kind: 'SimpleType',
|
|
7
|
-
description: 'Both Integer as well as Floating-Point numbers',
|
|
8
|
-
ctor: Number,
|
|
9
|
-
parse(v) {
|
|
10
|
-
return (0, putil_varhelpers_1.toNumber)(v);
|
|
11
|
-
},
|
|
12
|
-
serialize(v) {
|
|
13
|
-
return (0, putil_varhelpers_1.toNumber)(v);
|
|
14
|
-
}
|
|
15
|
-
};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ObjectType = void 0;
|
|
4
|
-
exports.ObjectType = {
|
|
5
|
-
kind: 'ComplexType',
|
|
6
|
-
description: 'A non modelled object',
|
|
7
|
-
ctor: Object,
|
|
8
|
-
additionalFields: true,
|
|
9
|
-
parse(v) {
|
|
10
|
-
return v;
|
|
11
|
-
},
|
|
12
|
-
serialize(v) {
|
|
13
|
-
return v;
|
|
14
|
-
}
|
|
15
|
-
};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.StringType = void 0;
|
|
4
|
-
const putil_varhelpers_1 = require("putil-varhelpers");
|
|
5
|
-
exports.StringType = {
|
|
6
|
-
kind: 'SimpleType',
|
|
7
|
-
description: 'A sequence of characters',
|
|
8
|
-
ctor: String,
|
|
9
|
-
parse(v) {
|
|
10
|
-
return (0, putil_varhelpers_1.toString)(v);
|
|
11
|
-
},
|
|
12
|
-
serialize(v) {
|
|
13
|
-
return (0, putil_varhelpers_1.toString)(v);
|
|
14
|
-
}
|
|
15
|
-
};
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.primitiveClasses = exports.builtInTypes = void 0;
|
|
4
|
-
const responsive_map_js_1 = require("../../../helpers/responsive-map.js");
|
|
5
|
-
const any_type_js_1 = require("./builtin/any.type.js");
|
|
6
|
-
const base64_binary_type_js_1 = require("./builtin/base64-binary.type.js");
|
|
7
|
-
const bigint_type_js_1 = require("./builtin/bigint.type.js");
|
|
8
|
-
const boolean_type_js_1 = require("./builtin/boolean.type.js");
|
|
9
|
-
const date_type_js_1 = require("./builtin/date.type.js");
|
|
10
|
-
const date_string_type_js_1 = require("./builtin/date-string.type.js");
|
|
11
|
-
const guid_type_js_1 = require("./builtin/guid.type.js");
|
|
12
|
-
const integer_type_js_1 = require("./builtin/integer.type.js");
|
|
13
|
-
const number_type_js_1 = require("./builtin/number.type.js");
|
|
14
|
-
const object_type_js_1 = require("./builtin/object.type.js");
|
|
15
|
-
const string_type_js_1 = require("./builtin/string.type.js");
|
|
16
|
-
const BigIntConstructor = Object.getPrototypeOf(BigInt(0)).constructor;
|
|
17
|
-
const BufferConstructor = Object.getPrototypeOf(Buffer.from('')).constructor;
|
|
18
|
-
exports.builtInTypes = new responsive_map_js_1.ResponsiveMap();
|
|
19
|
-
exports.builtInTypes.set('any', any_type_js_1.AnyType);
|
|
20
|
-
exports.builtInTypes.set('base64Binary', base64_binary_type_js_1.Base64BinaryType);
|
|
21
|
-
exports.builtInTypes.set('bigint', bigint_type_js_1.BigIntType);
|
|
22
|
-
exports.builtInTypes.set('boolean', boolean_type_js_1.BooleanType);
|
|
23
|
-
exports.builtInTypes.set('date', date_type_js_1.DateType);
|
|
24
|
-
exports.builtInTypes.set('dateString', date_string_type_js_1.DateStringType);
|
|
25
|
-
exports.builtInTypes.set('guid', guid_type_js_1.GuidType);
|
|
26
|
-
exports.builtInTypes.set('integer', integer_type_js_1.IntegerType);
|
|
27
|
-
exports.builtInTypes.set('number', number_type_js_1.NumberType);
|
|
28
|
-
exports.builtInTypes.set('object', object_type_js_1.ObjectType);
|
|
29
|
-
exports.builtInTypes.set('string', string_type_js_1.StringType);
|
|
30
|
-
exports.primitiveClasses = new Map();
|
|
31
|
-
exports.primitiveClasses.set(Boolean, 'boolean');
|
|
32
|
-
exports.primitiveClasses.set(String, 'string');
|
|
33
|
-
exports.primitiveClasses.set(Number, 'number');
|
|
34
|
-
exports.primitiveClasses.set(Date, 'date');
|
|
35
|
-
exports.primitiveClasses.set(BigIntConstructor, 'bigint');
|
|
36
|
-
exports.primitiveClasses.set(BufferConstructor, 'base64Binary');
|
|
37
|
-
exports.primitiveClasses.set(Object, 'object');
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ComplexType = void 0;
|
|
4
|
-
const responsive_map_js_1 = require("../../../helpers/responsive-map.js");
|
|
5
|
-
const clone_object_util_js_1 = require("../../utils/clone-object.util.js");
|
|
6
|
-
const inspect_util_js_1 = require("../../utils/inspect.util.js");
|
|
7
|
-
const data_type_js_1 = require("./data-type.js");
|
|
8
|
-
class ComplexType extends data_type_js_1.DataType {
|
|
9
|
-
constructor(owner, name, args) {
|
|
10
|
-
super(owner, name, {
|
|
11
|
-
kind: 'ComplexType',
|
|
12
|
-
...args
|
|
13
|
-
});
|
|
14
|
-
this._initialized = false;
|
|
15
|
-
this.ownFields = new responsive_map_js_1.ResponsiveMap();
|
|
16
|
-
this.fields = new responsive_map_js_1.ResponsiveMap();
|
|
17
|
-
}
|
|
18
|
-
get abstract() {
|
|
19
|
-
return !!this._metadata.abstract;
|
|
20
|
-
}
|
|
21
|
-
get additionalFields() {
|
|
22
|
-
return this._metadata.additionalFields || this._mixinAdditionalFields;
|
|
23
|
-
}
|
|
24
|
-
get extends() {
|
|
25
|
-
return this._metadata.extends;
|
|
26
|
-
}
|
|
27
|
-
getField(fieldName) {
|
|
28
|
-
if (fieldName.includes('.')) {
|
|
29
|
-
let dt = this;
|
|
30
|
-
const arr = fieldName.split('.');
|
|
31
|
-
let field;
|
|
32
|
-
for (const a of arr) {
|
|
33
|
-
field = dt.getField(a);
|
|
34
|
-
dt = dt.document.getDataType(field.type || 'string');
|
|
35
|
-
}
|
|
36
|
-
// @ts-ignore
|
|
37
|
-
return field;
|
|
38
|
-
}
|
|
39
|
-
const t = this.fields.get(fieldName);
|
|
40
|
-
if (!t)
|
|
41
|
-
throw new Error(`"${this.name}" type doesn't have a field named "${fieldName}"`);
|
|
42
|
-
return t;
|
|
43
|
-
}
|
|
44
|
-
getFieldType(fieldName) {
|
|
45
|
-
const field = this.getField(fieldName);
|
|
46
|
-
return this.document.getDataType(field.type || 'string');
|
|
47
|
-
}
|
|
48
|
-
getOwnField(name) {
|
|
49
|
-
const t = this.ownFields.get(name);
|
|
50
|
-
if (!t)
|
|
51
|
-
throw new Error(`"${this.name}" type doesn't have an own field named "${name}"`);
|
|
52
|
-
return t;
|
|
53
|
-
}
|
|
54
|
-
getSchema() {
|
|
55
|
-
const out = super.getSchema();
|
|
56
|
-
if (this.additionalFields)
|
|
57
|
-
out.additionalFields = this.additionalFields;
|
|
58
|
-
if (this.ownFields.size) {
|
|
59
|
-
out.fields = {};
|
|
60
|
-
for (const [k, prop] of this.ownFields) {
|
|
61
|
-
out.fields[k] = (0, clone_object_util_js_1.cloneObject)(prop);
|
|
62
|
-
delete out.fields[k].name;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
return out;
|
|
66
|
-
}
|
|
67
|
-
toString() {
|
|
68
|
-
return `[${Object.getPrototypeOf(this).constructor.name} ${this.name}]`;
|
|
69
|
-
}
|
|
70
|
-
[inspect_util_js_1.nodeInspectCustom]() {
|
|
71
|
-
return `[${inspect_util_js_1.colorFgYellow + Object.getPrototypeOf(this).constructor.name + inspect_util_js_1.colorReset}` +
|
|
72
|
-
` ${inspect_util_js_1.colorFgMagenta + this.name + inspect_util_js_1.colorReset}]`;
|
|
73
|
-
}
|
|
74
|
-
init() {
|
|
75
|
-
if (this._initialized)
|
|
76
|
-
return;
|
|
77
|
-
this._initialized = true;
|
|
78
|
-
const metadata = this._metadata;
|
|
79
|
-
if (metadata.extends) {
|
|
80
|
-
for (const ext of metadata.extends) {
|
|
81
|
-
const baseType = this.document.types.get(ext.type);
|
|
82
|
-
if (!baseType)
|
|
83
|
-
throw new TypeError(`Extending schema (${ext.type}) of data type "${this.name}" does not exists`);
|
|
84
|
-
if (!(baseType instanceof ComplexType))
|
|
85
|
-
throw new TypeError(`Cannot extend ${this.name} from a "${baseType.kind}"`);
|
|
86
|
-
baseType.init();
|
|
87
|
-
if (baseType.additionalFields)
|
|
88
|
-
this._mixinAdditionalFields = true;
|
|
89
|
-
for (const [k, prop] of baseType.fields) {
|
|
90
|
-
const f = (0, clone_object_util_js_1.cloneObject)(prop);
|
|
91
|
-
f.name = k;
|
|
92
|
-
f.parent = this;
|
|
93
|
-
this.fields.set(k, f);
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
if (metadata.fields) {
|
|
98
|
-
for (const [k, prop] of Object.entries(metadata.fields)) {
|
|
99
|
-
const t = this.document.types.get(prop.type);
|
|
100
|
-
if (!t)
|
|
101
|
-
throw new TypeError(`Type "${prop.type}" defined for "${this.name}.${k}" does not exists`);
|
|
102
|
-
const f = (0, clone_object_util_js_1.cloneObject)(prop);
|
|
103
|
-
f.name = k;
|
|
104
|
-
this.fields.set(k, f);
|
|
105
|
-
this.ownFields.set(k, f);
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
exports.ComplexType = ComplexType;
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DataType = void 0;
|
|
4
|
-
const clone_object_util_js_1 = require("../../utils/clone-object.util.js");
|
|
5
|
-
const builtin_data_types_js_1 = require("./builtin-data-types.js");
|
|
6
|
-
class DataType {
|
|
7
|
-
constructor(document, name, metadata) {
|
|
8
|
-
this._document = document;
|
|
9
|
-
this._name = name;
|
|
10
|
-
this._metadata = metadata;
|
|
11
|
-
}
|
|
12
|
-
get document() {
|
|
13
|
-
return this._document;
|
|
14
|
-
}
|
|
15
|
-
get kind() {
|
|
16
|
-
return this._metadata.kind;
|
|
17
|
-
}
|
|
18
|
-
get name() {
|
|
19
|
-
return this._name;
|
|
20
|
-
}
|
|
21
|
-
get description() {
|
|
22
|
-
return this._metadata.description;
|
|
23
|
-
}
|
|
24
|
-
get ctor() {
|
|
25
|
-
return this._metadata.ctor;
|
|
26
|
-
}
|
|
27
|
-
get isBuiltin() {
|
|
28
|
-
return builtin_data_types_js_1.builtInTypes.has(this._name);
|
|
29
|
-
}
|
|
30
|
-
parse(value) {
|
|
31
|
-
return this._metadata.parse ? this._metadata.parse(value) : value;
|
|
32
|
-
}
|
|
33
|
-
getSchema(jsonOnly) {
|
|
34
|
-
return (0, clone_object_util_js_1.cloneObject)(this._metadata, jsonOnly);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
exports.DataType = DataType;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SimpleType = void 0;
|
|
4
|
-
const inspect_util_js_1 = require("../../utils/inspect.util.js");
|
|
5
|
-
const data_type_js_1 = require("./data-type.js");
|
|
6
|
-
class SimpleType extends data_type_js_1.DataType {
|
|
7
|
-
constructor(owner, name, args) {
|
|
8
|
-
super(owner, name, {
|
|
9
|
-
kind: 'SimpleType',
|
|
10
|
-
...args
|
|
11
|
-
});
|
|
12
|
-
}
|
|
13
|
-
toString() {
|
|
14
|
-
return `[${Object.getPrototypeOf(this).constructor.name} ${this.name}]`;
|
|
15
|
-
}
|
|
16
|
-
[inspect_util_js_1.nodeInspectCustom]() {
|
|
17
|
-
return `[${inspect_util_js_1.colorFgYellow + Object.getPrototypeOf(this).constructor.name + inspect_util_js_1.colorReset}` +
|
|
18
|
-
` ${inspect_util_js_1.colorFgMagenta + this.name + inspect_util_js_1.colorReset}]`;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
exports.SimpleType = SimpleType;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UnionType = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const lodash_omit_1 = tslib_1.__importDefault(require("lodash.omit"));
|
|
6
|
-
const inspect_util_js_1 = require("../../utils/inspect.util.js");
|
|
7
|
-
const complex_type_js_1 = require("./complex-type.js");
|
|
8
|
-
const data_type_js_1 = require("./data-type.js");
|
|
9
|
-
class UnionType extends data_type_js_1.DataType {
|
|
10
|
-
constructor(owner, name, args) {
|
|
11
|
-
super(owner, name, (0, lodash_omit_1.default)({ kind: 'UnionType', ...args }, ['types']));
|
|
12
|
-
this.types = args.types;
|
|
13
|
-
this.hasAdditionalFields = name === 'any' ||
|
|
14
|
-
!!this.types.find(t => t instanceof complex_type_js_1.ComplexType && t.additionalFields);
|
|
15
|
-
}
|
|
16
|
-
toString() {
|
|
17
|
-
return `[${Object.getPrototypeOf(this).constructor.name} ${this.name}]`;
|
|
18
|
-
}
|
|
19
|
-
[inspect_util_js_1.nodeInspectCustom]() {
|
|
20
|
-
return `[${inspect_util_js_1.colorFgYellow + Object.getPrototypeOf(this).constructor.name + inspect_util_js_1.colorReset}` +
|
|
21
|
-
` ${inspect_util_js_1.colorFgMagenta + this.name + inspect_util_js_1.colorReset}]`;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
exports.UnionType = UnionType;
|