@opra/common 1.20.0 → 1.22.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/README.md +3 -0
- package/browser.js +12 -0
- package/{esm/document → document}/api-document.js +7 -7
- package/{esm/document → document}/common/api-base.js +2 -1
- package/{esm/document → document}/common/data-type-map.js +3 -6
- package/{esm/document → document}/common/document-init-context.js +4 -3
- package/{esm/document → document}/common/document-node.js +4 -0
- package/{esm/document → document}/common/opra-document-error.js +1 -1
- package/{esm/document → document}/common/value.js +4 -0
- package/{esm/document → document}/data-type/api-field.js +1 -0
- package/{types/document → document}/data-type/array-type.d.ts +1 -1
- package/{esm/document → document}/data-type/complex-type-base.js +3 -0
- package/{esm/document → document}/data-type/complex-type.js +1 -0
- package/{esm/document → document}/data-type/extended-types/base64.type.js +1 -0
- package/{esm/document → document}/data-type/extended-types/date-time-tz.type.js +2 -0
- package/{esm/document → document}/data-type/extended-types/date-time.type.js +3 -0
- package/{esm/document → document}/data-type/extended-types/date.type.js +3 -0
- package/{esm/document → document}/data-type/extended-types/email.type.js +9 -0
- package/{esm/document → document}/data-type/extended-types/field-path.type.js +2 -0
- package/{esm/document → document}/data-type/extended-types/filter.type.js +2 -0
- package/{esm/document → document}/data-type/extended-types/partial-date.type.js +2 -0
- package/{esm/document → document}/data-type/extended-types/time.type.js +2 -0
- package/{esm/document → document}/data-type/extended-types/uuid.type.js +1 -0
- package/{esm/document → document}/data-type/mapped-type.js +4 -0
- package/{esm/document → document}/data-type/primitive-types/number.type.js +2 -0
- package/{esm/document → document}/data-type/primitive-types/string.type.js +4 -0
- package/{esm/document → document}/data-type/simple-type.js +3 -0
- package/document/decorators/ws-param.decorator.d.ts +7 -0
- package/{esm/document → document}/decorators/ws-param.decorator.js +2 -2
- package/{esm/document → document}/factory/api-document.factory.js +1 -3
- package/{esm/document → document}/factory/ws-api.factory.js +14 -3
- package/{esm/document → document}/http/http-api.js +5 -4
- package/{esm/document → document}/http/http-multipart-field.js +3 -0
- package/{esm/document → document}/http/http-operation-response.js +3 -0
- package/{esm/document → document}/http/http-request-body.js +8 -1
- package/{esm/document → document}/http/http-status-range.js +2 -2
- package/{esm/document → document}/mq/mq-api.js +5 -4
- package/{esm/document → document}/mq/mq-operation-response.js +7 -1
- package/{esm/document → document}/ws/ws-api.js +4 -4
- package/{types/document → document}/ws/ws-operation.d.ts +15 -3
- package/{esm/document → document}/ws/ws-operation.js +10 -2
- package/{esm/exception → exception}/http-errors/bad-request.error.js +1 -4
- package/{esm/exception → exception}/http-errors/conflict.error.js +1 -4
- package/{esm/exception → exception}/http-errors/failed-dependency.error.js +1 -4
- package/{esm/exception → exception}/http-errors/forbidden.error.js +1 -4
- package/{esm/exception → exception}/http-errors/internal-server.error.js +1 -4
- package/{esm/exception → exception}/http-errors/method-not-allowed.error.js +1 -4
- package/{esm/exception → exception}/http-errors/not-acceptable.error.js +1 -4
- package/{esm/exception → exception}/http-errors/not-found.error.js +1 -4
- package/{esm/exception → exception}/http-errors/resource-conflict.error.js +1 -1
- package/{esm/exception → exception}/http-errors/unauthorized.error.js +1 -4
- package/{esm/exception → exception}/http-errors/unprocessable-entity.error.js +1 -4
- package/{esm/exception → exception}/opra-exception.js +5 -1
- package/{esm/exception → exception}/opra-http-error.js +1 -0
- package/filter/antlr/OpraFilterLexer.js +425 -0
- package/filter/antlr/OpraFilterListener.js +302 -0
- package/{esm/filter → filter}/antlr/OpraFilterParser.js +218 -214
- package/filter/antlr/OpraFilterVisitor.js +185 -0
- package/{esm/filter → filter}/ast/abstract/ast.js +1 -0
- package/{esm/filter → filter}/ast/expressions/arithmetic-expression.js +3 -1
- package/{esm/filter → filter}/ast/expressions/array-expression.js +1 -0
- package/{esm/filter → filter}/ast/expressions/comparison-expression.js +4 -0
- package/{esm/filter → filter}/ast/expressions/logical-expression.js +2 -0
- package/{esm/filter → filter}/ast/expressions/negative-expression.js +1 -0
- package/{esm/filter → filter}/ast/expressions/parenthesized-expression.js +1 -0
- package/{esm/filter → filter}/ast/terms/date-literal.js +1 -0
- package/{esm/filter → filter}/ast/terms/date-time-literal.js +1 -0
- package/{esm/filter → filter}/ast/terms/null-literal.js +1 -1
- package/{esm/filter → filter}/ast/terms/number-literal.js +1 -0
- package/{esm/filter → filter}/ast/terms/time-literal.js +1 -0
- package/{esm/filter → filter}/filter-rules.js +2 -2
- package/{esm/filter → filter}/filter-tree-visitor.js +1 -0
- package/{esm/filter → filter}/opra-error-listener.js +1 -0
- package/{esm/helpers → helpers}/parse-fields-projection.js +2 -0
- package/package.json +15 -35
- package/{types/schema → schema}/ws/ws-api.interface.d.ts +4 -0
- package/browser/index.cjs +0 -12
- package/browser/index.mjs +0 -12
- package/cjs/document/api-document.js +0 -182
- package/cjs/document/common/api-base.js +0 -31
- package/cjs/document/common/data-type-map.js +0 -77
- package/cjs/document/common/document-element.js +0 -34
- package/cjs/document/common/document-init-context.js +0 -69
- package/cjs/document/common/document-node.js +0 -145
- package/cjs/document/common/opra-document-error.js +0 -15
- package/cjs/document/common/value.js +0 -39
- package/cjs/document/constants.js +0 -18
- package/cjs/document/data-type/api-field.js +0 -124
- package/cjs/document/data-type/array-type.js +0 -78
- package/cjs/document/data-type/complex-type-base.js +0 -346
- package/cjs/document/data-type/complex-type.js +0 -127
- package/cjs/document/data-type/data-type.js +0 -67
- package/cjs/document/data-type/enum-type.js +0 -128
- package/cjs/document/data-type/extended-types/base64.type.js +0 -49
- package/cjs/document/data-type/extended-types/date-time-tz.type.js +0 -63
- package/cjs/document/data-type/extended-types/date-time.type.js +0 -76
- package/cjs/document/data-type/extended-types/date.type.js +0 -74
- package/cjs/document/data-type/extended-types/email.type.js +0 -95
- package/cjs/document/data-type/extended-types/field-path.type.js +0 -65
- package/cjs/document/data-type/extended-types/filter.type.js +0 -88
- package/cjs/document/data-type/extended-types/index.js +0 -16
- package/cjs/document/data-type/extended-types/object-id.type.js +0 -31
- package/cjs/document/data-type/extended-types/operation-result.type.js +0 -67
- package/cjs/document/data-type/extended-types/partial-date.type.js +0 -85
- package/cjs/document/data-type/extended-types/time.type.js +0 -55
- package/cjs/document/data-type/extended-types/url.type.js +0 -31
- package/cjs/document/data-type/extended-types/uuid.type.js +0 -37
- package/cjs/document/data-type/mapped-type.js +0 -120
- package/cjs/document/data-type/mixin-type.js +0 -123
- package/cjs/document/data-type/omit-type.js +0 -10
- package/cjs/document/data-type/partial-type.js +0 -12
- package/cjs/document/data-type/pick-type.js +0 -10
- package/cjs/document/data-type/primitive-types/any.type.js +0 -27
- package/cjs/document/data-type/primitive-types/bigint.type.js +0 -38
- package/cjs/document/data-type/primitive-types/boolean.type.js +0 -31
- package/cjs/document/data-type/primitive-types/index.js +0 -11
- package/cjs/document/data-type/primitive-types/integer.type.js +0 -38
- package/cjs/document/data-type/primitive-types/null.type.js +0 -31
- package/cjs/document/data-type/primitive-types/number.type.js +0 -50
- package/cjs/document/data-type/primitive-types/object.type.js +0 -20
- package/cjs/document/data-type/primitive-types/string.type.js +0 -70
- package/cjs/document/data-type/required-type.js +0 -12
- package/cjs/document/data-type/simple-type.js +0 -133
- package/cjs/document/data-type/union-type.js +0 -84
- package/cjs/document/data-type/utils/create-mapped-class.js +0 -56
- package/cjs/document/data-type/utils/get-is-inherited-predicate-fn.js +0 -14
- package/cjs/document/decorators/api-field-decorator.js +0 -50
- package/cjs/document/decorators/complex-type.decorator.js +0 -31
- package/cjs/document/decorators/http-controller.decorator.js +0 -145
- package/cjs/document/decorators/http-operation-entity-create.decorator.js +0 -58
- package/cjs/document/decorators/http-operation-entity-delete-many.decorator.js +0 -41
- package/cjs/document/decorators/http-operation-entity-delete.decorator.js +0 -41
- package/cjs/document/decorators/http-operation-entity-find-many.decorator.js +0 -85
- package/cjs/document/decorators/http-operation-entity-get.decorator.js +0 -56
- package/cjs/document/decorators/http-operation-entity-replace.decorator.js +0 -56
- package/cjs/document/decorators/http-operation-entity-update-many.decorator.js +0 -50
- package/cjs/document/decorators/http-operation-entity-update.decorator.js +0 -66
- package/cjs/document/decorators/http-operation-entity.decorator.js +0 -143
- package/cjs/document/decorators/http-operation.decorator.js +0 -213
- package/cjs/document/decorators/mq-controller.decorator.js +0 -67
- package/cjs/document/decorators/mq-operation.decorator.js +0 -82
- package/cjs/document/decorators/simple-type.decorator.js +0 -67
- package/cjs/document/decorators/ws-controller.decorator.js +0 -51
- package/cjs/document/decorators/ws-operation.decorator.js +0 -42
- package/cjs/document/decorators/ws-param.decorator.js +0 -22
- package/cjs/document/factory/api-document.factory.js +0 -192
- package/cjs/document/factory/data-type.factory.js +0 -647
- package/cjs/document/factory/http-api.factory.js +0 -302
- package/cjs/document/factory/mq-api.factory.js +0 -203
- package/cjs/document/factory/ws-api.factory.js +0 -145
- package/cjs/document/http/http-api.js +0 -40
- package/cjs/document/http/http-controller.js +0 -159
- package/cjs/document/http/http-media-type.js +0 -104
- package/cjs/document/http/http-multipart-field.js +0 -32
- package/cjs/document/http/http-operation-response.js +0 -47
- package/cjs/document/http/http-operation.js +0 -126
- package/cjs/document/http/http-parameter.js +0 -57
- package/cjs/document/http/http-request-body.js +0 -27
- package/cjs/document/http/http-status-range.js +0 -45
- package/cjs/document/index.js +0 -70
- package/cjs/document/mq/mq-api.js +0 -54
- package/cjs/document/mq/mq-controller.js +0 -101
- package/cjs/document/mq/mq-header.js +0 -48
- package/cjs/document/mq/mq-operation-response.js +0 -66
- package/cjs/document/mq/mq-operation.js +0 -101
- package/cjs/document/utils/inspect.util.js +0 -7
- package/cjs/document/utils/parse-regexp.util.js +0 -21
- package/cjs/document/utils/string-compare.util.js +0 -10
- package/cjs/document/utils/test-scope-match.js +0 -15
- package/cjs/document/ws/ws-api.js +0 -52
- package/cjs/document/ws/ws-controller.js +0 -78
- package/cjs/document/ws/ws-operation.js +0 -64
- package/cjs/enums/http-headers-codes.enum.js +0 -411
- package/cjs/enums/http-status-codes.enum.js +0 -300
- package/cjs/enums/http-status-messages.js +0 -68
- package/cjs/enums/index.js +0 -7
- package/cjs/enums/mime-types.enum.js +0 -17
- package/cjs/exception/error-issue.js +0 -2
- package/cjs/exception/http-errors/bad-request.error.js +0 -23
- package/cjs/exception/http-errors/conflict.error.js +0 -22
- package/cjs/exception/http-errors/failed-dependency.error.js +0 -22
- package/cjs/exception/http-errors/forbidden.error.js +0 -25
- package/cjs/exception/http-errors/internal-server.error.js +0 -23
- package/cjs/exception/http-errors/method-not-allowed.error.js +0 -23
- package/cjs/exception/http-errors/not-acceptable.error.js +0 -23
- package/cjs/exception/http-errors/not-found.error.js +0 -26
- package/cjs/exception/http-errors/permission.error.js +0 -20
- package/cjs/exception/http-errors/resource-conflict.error.js +0 -19
- package/cjs/exception/http-errors/resource-not.available.error.js +0 -23
- package/cjs/exception/http-errors/unauthorized.error.js +0 -23
- package/cjs/exception/http-errors/unprocessable-entity.error.js +0 -23
- package/cjs/exception/index.js +0 -20
- package/cjs/exception/issue-severity.enum.js +0 -23
- package/cjs/exception/opra-exception.js +0 -70
- package/cjs/exception/opra-http-error.js +0 -25
- package/cjs/filter/antlr/OpraFilterLexer.js +0 -427
- package/cjs/filter/antlr/OpraFilterListener.js +0 -11
- package/cjs/filter/antlr/OpraFilterParser.js +0 -1851
- package/cjs/filter/antlr/OpraFilterVisitor.js +0 -14
- package/cjs/filter/ast/abstract/ast.js +0 -9
- package/cjs/filter/ast/abstract/expression.js +0 -7
- package/cjs/filter/ast/abstract/literal.js +0 -14
- package/cjs/filter/ast/abstract/term.js +0 -7
- package/cjs/filter/ast/expressions/arithmetic-expression.js +0 -29
- package/cjs/filter/ast/expressions/array-expression.js +0 -14
- package/cjs/filter/ast/expressions/comparison-expression.js +0 -15
- package/cjs/filter/ast/expressions/logical-expression.js +0 -18
- package/cjs/filter/ast/expressions/negative-expression.js +0 -14
- package/cjs/filter/ast/expressions/parenthesized-expression.js +0 -14
- package/cjs/filter/ast/index.js +0 -21
- package/cjs/filter/ast/terms/boolean-literal.js +0 -10
- package/cjs/filter/ast/terms/date-literal.js +0 -28
- package/cjs/filter/ast/terms/date-time-literal.js +0 -27
- package/cjs/filter/ast/terms/external-constant.js +0 -13
- package/cjs/filter/ast/terms/null-literal.js +0 -11
- package/cjs/filter/ast/terms/number-literal.js +0 -39
- package/cjs/filter/ast/terms/qualified-identifier.js +0 -10
- package/cjs/filter/ast/terms/string-literal.js +0 -14
- package/cjs/filter/ast/terms/time-literal.js +0 -34
- package/cjs/filter/build.js +0 -126
- package/cjs/filter/errors.js +0 -21
- package/cjs/filter/filter-rules.js +0 -150
- package/cjs/filter/filter-tree-visitor.js +0 -97
- package/cjs/filter/index.js +0 -5
- package/cjs/filter/opra-error-listener.js +0 -21
- package/cjs/filter/opra-filter.ns.js +0 -8
- package/cjs/filter/parse.js +0 -38
- package/cjs/filter/utils.js +0 -25
- package/cjs/helpers/function-utils.js +0 -15
- package/cjs/helpers/get-stack-filename.js +0 -51
- package/cjs/helpers/index.js +0 -12
- package/cjs/helpers/mixin-utils.js +0 -35
- package/cjs/helpers/object-utils.js +0 -19
- package/cjs/helpers/parse-fields-projection.js +0 -67
- package/cjs/helpers/responsive-map.js +0 -155
- package/cjs/helpers/safe-json-stringify.js +0 -16
- package/cjs/helpers/type-guards.js +0 -46
- package/cjs/i18n/i18n.js +0 -139
- package/cjs/i18n/index.js +0 -10
- package/cjs/i18n/string-utils.js +0 -12
- package/cjs/i18n/translate.js +0 -16
- package/cjs/index.js +0 -14
- package/cjs/package.json +0 -3
- package/cjs/polifils/array-find-last.js +0 -22
- package/cjs/schema/api-document.interface.js +0 -2
- package/cjs/schema/api.interface.js +0 -2
- package/cjs/schema/constants.js +0 -4
- package/cjs/schema/data-type/array-type.interface.js +0 -7
- package/cjs/schema/data-type/complex-type.interface.js +0 -7
- package/cjs/schema/data-type/data-type.interface.js +0 -2
- package/cjs/schema/data-type/enum-type.interface.js +0 -7
- package/cjs/schema/data-type/field.interface.js +0 -2
- package/cjs/schema/data-type/mapped-type.interface.js +0 -7
- package/cjs/schema/data-type/mixin-type.interface.js +0 -7
- package/cjs/schema/data-type/simple-type.interface.js +0 -7
- package/cjs/schema/data-type/union-type.interface.js +0 -7
- package/cjs/schema/data-type-container.interface.js +0 -2
- package/cjs/schema/http/http-api.interface.js +0 -2
- package/cjs/schema/http/http-controller.interface.js +0 -11
- package/cjs/schema/http/http-media-type.interface.js +0 -2
- package/cjs/schema/http/http-multipart-field.interface.js +0 -2
- package/cjs/schema/http/http-operation-response.interface.js +0 -2
- package/cjs/schema/http/http-operation.interface.js +0 -7
- package/cjs/schema/http/http-parameter.interface.js +0 -2
- package/cjs/schema/http/http-request-body.interface.js +0 -2
- package/cjs/schema/http/http-status-range.interface.js +0 -2
- package/cjs/schema/index.js +0 -6
- package/cjs/schema/mq/mq-api.interface.js +0 -2
- package/cjs/schema/mq/mq-controller.interface.js +0 -11
- package/cjs/schema/mq/mq-header.interface.js +0 -2
- package/cjs/schema/mq/mq-operation.interface.js +0 -7
- package/cjs/schema/opra-schema.js +0 -35
- package/cjs/schema/type-guards.js +0 -54
- package/cjs/schema/types.js +0 -2
- package/cjs/schema/value.interface.js +0 -2
- package/cjs/schema/ws/ws-api.interface.js +0 -2
- package/cjs/schema/ws/ws-controller.interface.js +0 -11
- package/cjs/schema/ws/ws-operation.interface.js +0 -7
- package/cjs/types.js +0 -2
- package/esm/filter/antlr/OpraFilterLexer.js +0 -425
- package/esm/filter/antlr/OpraFilterListener.js +0 -8
- package/esm/filter/antlr/OpraFilterVisitor.js +0 -11
- package/esm/helpers/monkey-patches.js +0 -14
- package/esm/package.json +0 -3
- package/types/document/decorators/ws-param.decorator.d.ts +0 -2
- package/types/index.d.cts +0 -9
- /package/{types/document → document}/api-document.d.ts +0 -0
- /package/{types/document → document}/common/api-base.d.ts +0 -0
- /package/{types/document → document}/common/data-type-map.d.ts +0 -0
- /package/{types/document → document}/common/document-element.d.ts +0 -0
- /package/{esm/document → document}/common/document-element.js +0 -0
- /package/{types/document → document}/common/document-init-context.d.ts +0 -0
- /package/{types/document → document}/common/document-node.d.ts +0 -0
- /package/{types/document → document}/common/opra-document-error.d.ts +0 -0
- /package/{types/document → document}/common/value.d.ts +0 -0
- /package/{types/document → document}/constants.d.ts +0 -0
- /package/{esm/document → document}/constants.js +0 -0
- /package/{types/document → document}/data-type/api-field.d.ts +0 -0
- /package/{esm/document → document}/data-type/array-type.js +0 -0
- /package/{types/document → document}/data-type/complex-type-base.d.ts +0 -0
- /package/{types/document → document}/data-type/complex-type.d.ts +0 -0
- /package/{types/document → document}/data-type/data-type.d.ts +0 -0
- /package/{esm/document → document}/data-type/data-type.js +0 -0
- /package/{types/document → document}/data-type/enum-type.d.ts +0 -0
- /package/{esm/document → document}/data-type/enum-type.js +0 -0
- /package/{types/document → document}/data-type/extended-types/base64.type.d.ts +0 -0
- /package/{types/document → document}/data-type/extended-types/date-time-tz.type.d.ts +0 -0
- /package/{types/document → document}/data-type/extended-types/date-time.type.d.ts +0 -0
- /package/{types/document → document}/data-type/extended-types/date.type.d.ts +0 -0
- /package/{types/document → document}/data-type/extended-types/email.type.d.ts +0 -0
- /package/{types/document → document}/data-type/extended-types/field-path.type.d.ts +0 -0
- /package/{types/document → document}/data-type/extended-types/filter.type.d.ts +0 -0
- /package/{types/document → document}/data-type/extended-types/index.d.ts +0 -0
- /package/{esm/document → document}/data-type/extended-types/index.js +0 -0
- /package/{types/document → document}/data-type/extended-types/object-id.type.d.ts +0 -0
- /package/{esm/document → document}/data-type/extended-types/object-id.type.js +0 -0
- /package/{types/document → document}/data-type/extended-types/operation-result.type.d.ts +0 -0
- /package/{esm/document → document}/data-type/extended-types/operation-result.type.js +0 -0
- /package/{types/document → document}/data-type/extended-types/partial-date.type.d.ts +0 -0
- /package/{types/document → document}/data-type/extended-types/time.type.d.ts +0 -0
- /package/{types/document → document}/data-type/extended-types/url.type.d.ts +0 -0
- /package/{esm/document → document}/data-type/extended-types/url.type.js +0 -0
- /package/{types/document → document}/data-type/extended-types/uuid.type.d.ts +0 -0
- /package/{types/document → document}/data-type/mapped-type.d.ts +0 -0
- /package/{types/document → document}/data-type/mixin-type.d.ts +0 -0
- /package/{esm/document → document}/data-type/mixin-type.js +0 -0
- /package/{types/document → document}/data-type/omit-type.d.ts +0 -0
- /package/{esm/document → document}/data-type/omit-type.js +0 -0
- /package/{types/document → document}/data-type/partial-type.d.ts +0 -0
- /package/{esm/document → document}/data-type/partial-type.js +0 -0
- /package/{types/document → document}/data-type/pick-type.d.ts +0 -0
- /package/{esm/document → document}/data-type/pick-type.js +0 -0
- /package/{types/document → document}/data-type/primitive-types/any.type.d.ts +0 -0
- /package/{esm/document → document}/data-type/primitive-types/any.type.js +0 -0
- /package/{types/document → document}/data-type/primitive-types/bigint.type.d.ts +0 -0
- /package/{esm/document → document}/data-type/primitive-types/bigint.type.js +0 -0
- /package/{types/document → document}/data-type/primitive-types/boolean.type.d.ts +0 -0
- /package/{esm/document → document}/data-type/primitive-types/boolean.type.js +0 -0
- /package/{types/document → document}/data-type/primitive-types/index.d.ts +0 -0
- /package/{esm/document → document}/data-type/primitive-types/index.js +0 -0
- /package/{types/document → document}/data-type/primitive-types/integer.type.d.ts +0 -0
- /package/{esm/document → document}/data-type/primitive-types/integer.type.js +0 -0
- /package/{types/document → document}/data-type/primitive-types/null.type.d.ts +0 -0
- /package/{esm/document → document}/data-type/primitive-types/null.type.js +0 -0
- /package/{types/document → document}/data-type/primitive-types/number.type.d.ts +0 -0
- /package/{types/document → document}/data-type/primitive-types/object.type.d.ts +0 -0
- /package/{esm/document → document}/data-type/primitive-types/object.type.js +0 -0
- /package/{types/document → document}/data-type/primitive-types/string.type.d.ts +0 -0
- /package/{types/document → document}/data-type/required-type.d.ts +0 -0
- /package/{esm/document → document}/data-type/required-type.js +0 -0
- /package/{types/document → document}/data-type/simple-type.d.ts +0 -0
- /package/{types/document → document}/data-type/union-type.d.ts +0 -0
- /package/{esm/document → document}/data-type/union-type.js +0 -0
- /package/{types/document → document}/data-type/utils/create-mapped-class.d.ts +0 -0
- /package/{esm/document → document}/data-type/utils/create-mapped-class.js +0 -0
- /package/{types/document → document}/data-type/utils/get-is-inherited-predicate-fn.d.ts +0 -0
- /package/{esm/document → document}/data-type/utils/get-is-inherited-predicate-fn.js +0 -0
- /package/{types/document → document}/decorators/api-field-decorator.d.ts +0 -0
- /package/{esm/document → document}/decorators/api-field-decorator.js +0 -0
- /package/{types/document → document}/decorators/complex-type.decorator.d.ts +0 -0
- /package/{esm/document → document}/decorators/complex-type.decorator.js +0 -0
- /package/{types/document → document}/decorators/http-controller.decorator.d.ts +0 -0
- /package/{esm/document → document}/decorators/http-controller.decorator.js +0 -0
- /package/{types/document → document}/decorators/http-operation-entity-create.decorator.d.ts +0 -0
- /package/{esm/document → document}/decorators/http-operation-entity-create.decorator.js +0 -0
- /package/{types/document → document}/decorators/http-operation-entity-delete-many.decorator.d.ts +0 -0
- /package/{esm/document → document}/decorators/http-operation-entity-delete-many.decorator.js +0 -0
- /package/{types/document → document}/decorators/http-operation-entity-delete.decorator.d.ts +0 -0
- /package/{esm/document → document}/decorators/http-operation-entity-delete.decorator.js +0 -0
- /package/{types/document → document}/decorators/http-operation-entity-find-many.decorator.d.ts +0 -0
- /package/{esm/document → document}/decorators/http-operation-entity-find-many.decorator.js +0 -0
- /package/{types/document → document}/decorators/http-operation-entity-get.decorator.d.ts +0 -0
- /package/{esm/document → document}/decorators/http-operation-entity-get.decorator.js +0 -0
- /package/{types/document → document}/decorators/http-operation-entity-replace.decorator.d.ts +0 -0
- /package/{esm/document → document}/decorators/http-operation-entity-replace.decorator.js +0 -0
- /package/{types/document → document}/decorators/http-operation-entity-update-many.decorator.d.ts +0 -0
- /package/{esm/document → document}/decorators/http-operation-entity-update-many.decorator.js +0 -0
- /package/{types/document → document}/decorators/http-operation-entity-update.decorator.d.ts +0 -0
- /package/{esm/document → document}/decorators/http-operation-entity-update.decorator.js +0 -0
- /package/{types/document → document}/decorators/http-operation-entity.decorator.d.ts +0 -0
- /package/{esm/document → document}/decorators/http-operation-entity.decorator.js +0 -0
- /package/{types/document → document}/decorators/http-operation.decorator.d.ts +0 -0
- /package/{esm/document → document}/decorators/http-operation.decorator.js +0 -0
- /package/{types/document → document}/decorators/mq-controller.decorator.d.ts +0 -0
- /package/{esm/document → document}/decorators/mq-controller.decorator.js +0 -0
- /package/{types/document → document}/decorators/mq-operation.decorator.d.ts +0 -0
- /package/{esm/document → document}/decorators/mq-operation.decorator.js +0 -0
- /package/{types/document → document}/decorators/simple-type.decorator.d.ts +0 -0
- /package/{esm/document → document}/decorators/simple-type.decorator.js +0 -0
- /package/{types/document → document}/decorators/ws-controller.decorator.d.ts +0 -0
- /package/{esm/document → document}/decorators/ws-controller.decorator.js +0 -0
- /package/{types/document → document}/decorators/ws-operation.decorator.d.ts +0 -0
- /package/{esm/document → document}/decorators/ws-operation.decorator.js +0 -0
- /package/{types/document → document}/factory/api-document.factory.d.ts +0 -0
- /package/{types/document → document}/factory/data-type.factory.d.ts +0 -0
- /package/{esm/document → document}/factory/data-type.factory.js +0 -0
- /package/{types/document → document}/factory/http-api.factory.d.ts +0 -0
- /package/{esm/document → document}/factory/http-api.factory.js +0 -0
- /package/{types/document → document}/factory/mq-api.factory.d.ts +0 -0
- /package/{esm/document → document}/factory/mq-api.factory.js +0 -0
- /package/{types/document → document}/factory/ws-api.factory.d.ts +0 -0
- /package/{types/document → document}/http/http-api.d.ts +0 -0
- /package/{types/document → document}/http/http-controller.d.ts +0 -0
- /package/{esm/document → document}/http/http-controller.js +0 -0
- /package/{types/document → document}/http/http-media-type.d.ts +0 -0
- /package/{esm/document → document}/http/http-media-type.js +0 -0
- /package/{types/document → document}/http/http-multipart-field.d.ts +0 -0
- /package/{types/document → document}/http/http-operation-response.d.ts +0 -0
- /package/{types/document → document}/http/http-operation.d.ts +0 -0
- /package/{esm/document → document}/http/http-operation.js +0 -0
- /package/{types/document → document}/http/http-parameter.d.ts +0 -0
- /package/{esm/document → document}/http/http-parameter.js +0 -0
- /package/{types/document → document}/http/http-request-body.d.ts +0 -0
- /package/{types/document → document}/http/http-status-range.d.ts +0 -0
- /package/{types/document → document}/index.d.ts +0 -0
- /package/{esm/document → document}/index.js +0 -0
- /package/{types/document → document}/mq/mq-api.d.ts +0 -0
- /package/{types/document → document}/mq/mq-controller.d.ts +0 -0
- /package/{esm/document → document}/mq/mq-controller.js +0 -0
- /package/{types/document → document}/mq/mq-header.d.ts +0 -0
- /package/{esm/document → document}/mq/mq-header.js +0 -0
- /package/{types/document → document}/mq/mq-operation-response.d.ts +0 -0
- /package/{types/document → document}/mq/mq-operation.d.ts +0 -0
- /package/{esm/document → document}/mq/mq-operation.js +0 -0
- /package/{types/document → document}/utils/inspect.util.d.ts +0 -0
- /package/{esm/document → document}/utils/inspect.util.js +0 -0
- /package/{types/document → document}/utils/parse-regexp.util.d.ts +0 -0
- /package/{esm/document → document}/utils/parse-regexp.util.js +0 -0
- /package/{types/document → document}/utils/string-compare.util.d.ts +0 -0
- /package/{esm/document → document}/utils/string-compare.util.js +0 -0
- /package/{types/document → document}/utils/test-scope-match.d.ts +0 -0
- /package/{esm/document → document}/utils/test-scope-match.js +0 -0
- /package/{types/document → document}/ws/ws-api.d.ts +0 -0
- /package/{types/document → document}/ws/ws-controller.d.ts +0 -0
- /package/{esm/document → document}/ws/ws-controller.js +0 -0
- /package/{types/enums → enums}/http-headers-codes.enum.d.ts +0 -0
- /package/{esm/enums → enums}/http-headers-codes.enum.js +0 -0
- /package/{types/enums → enums}/http-status-codes.enum.d.ts +0 -0
- /package/{esm/enums → enums}/http-status-codes.enum.js +0 -0
- /package/{types/enums → enums}/http-status-messages.d.ts +0 -0
- /package/{esm/enums → enums}/http-status-messages.js +0 -0
- /package/{types/enums → enums}/index.d.ts +0 -0
- /package/{esm/enums → enums}/index.js +0 -0
- /package/{types/enums → enums}/mime-types.enum.d.ts +0 -0
- /package/{esm/enums → enums}/mime-types.enum.js +0 -0
- /package/{types/exception → exception}/error-issue.d.ts +0 -0
- /package/{esm/exception → exception}/error-issue.js +0 -0
- /package/{types/exception → exception}/http-errors/bad-request.error.d.ts +0 -0
- /package/{types/exception → exception}/http-errors/conflict.error.d.ts +0 -0
- /package/{types/exception → exception}/http-errors/failed-dependency.error.d.ts +0 -0
- /package/{types/exception → exception}/http-errors/forbidden.error.d.ts +0 -0
- /package/{types/exception → exception}/http-errors/internal-server.error.d.ts +0 -0
- /package/{types/exception → exception}/http-errors/method-not-allowed.error.d.ts +0 -0
- /package/{types/exception → exception}/http-errors/not-acceptable.error.d.ts +0 -0
- /package/{types/exception → exception}/http-errors/not-found.error.d.ts +0 -0
- /package/{types/exception → exception}/http-errors/permission.error.d.ts +0 -0
- /package/{esm/exception → exception}/http-errors/permission.error.js +0 -0
- /package/{types/exception → exception}/http-errors/resource-conflict.error.d.ts +0 -0
- /package/{types/exception → exception}/http-errors/resource-not.available.error.d.ts +0 -0
- /package/{esm/exception → exception}/http-errors/resource-not.available.error.js +0 -0
- /package/{types/exception → exception}/http-errors/unauthorized.error.d.ts +0 -0
- /package/{types/exception → exception}/http-errors/unprocessable-entity.error.d.ts +0 -0
- /package/{types/exception → exception}/index.d.ts +0 -0
- /package/{esm/exception → exception}/index.js +0 -0
- /package/{types/exception → exception}/issue-severity.enum.d.ts +0 -0
- /package/{esm/exception → exception}/issue-severity.enum.js +0 -0
- /package/{types/exception → exception}/opra-exception.d.ts +0 -0
- /package/{types/exception → exception}/opra-http-error.d.ts +0 -0
- /package/{types/filter → filter}/antlr/OpraFilterLexer.d.ts +0 -0
- /package/{types/filter → filter}/antlr/OpraFilterListener.d.ts +0 -0
- /package/{types/filter → filter}/antlr/OpraFilterParser.d.ts +0 -0
- /package/{types/filter → filter}/antlr/OpraFilterVisitor.d.ts +0 -0
- /package/{types/filter → filter}/ast/abstract/ast.d.ts +0 -0
- /package/{types/filter → filter}/ast/abstract/expression.d.ts +0 -0
- /package/{esm/filter → filter}/ast/abstract/expression.js +0 -0
- /package/{types/filter → filter}/ast/abstract/literal.d.ts +0 -0
- /package/{esm/filter → filter}/ast/abstract/literal.js +0 -0
- /package/{types/filter → filter}/ast/abstract/term.d.ts +0 -0
- /package/{esm/filter → filter}/ast/abstract/term.js +0 -0
- /package/{types/filter → filter}/ast/expressions/arithmetic-expression.d.ts +0 -0
- /package/{types/filter → filter}/ast/expressions/array-expression.d.ts +0 -0
- /package/{types/filter → filter}/ast/expressions/comparison-expression.d.ts +0 -0
- /package/{types/filter → filter}/ast/expressions/logical-expression.d.ts +0 -0
- /package/{types/filter → filter}/ast/expressions/negative-expression.d.ts +0 -0
- /package/{types/filter → filter}/ast/expressions/parenthesized-expression.d.ts +0 -0
- /package/{types/filter → filter}/ast/index.d.ts +0 -0
- /package/{esm/filter → filter}/ast/index.js +0 -0
- /package/{types/filter → filter}/ast/terms/boolean-literal.d.ts +0 -0
- /package/{esm/filter → filter}/ast/terms/boolean-literal.js +0 -0
- /package/{types/filter → filter}/ast/terms/date-literal.d.ts +0 -0
- /package/{types/filter → filter}/ast/terms/date-time-literal.d.ts +0 -0
- /package/{types/filter → filter}/ast/terms/external-constant.d.ts +0 -0
- /package/{esm/filter → filter}/ast/terms/external-constant.js +0 -0
- /package/{types/filter → filter}/ast/terms/null-literal.d.ts +0 -0
- /package/{types/filter → filter}/ast/terms/number-literal.d.ts +0 -0
- /package/{types/filter → filter}/ast/terms/qualified-identifier.d.ts +0 -0
- /package/{esm/filter → filter}/ast/terms/qualified-identifier.js +0 -0
- /package/{types/filter → filter}/ast/terms/string-literal.d.ts +0 -0
- /package/{esm/filter → filter}/ast/terms/string-literal.js +0 -0
- /package/{types/filter → filter}/ast/terms/time-literal.d.ts +0 -0
- /package/{types/filter → filter}/build.d.ts +0 -0
- /package/{esm/filter → filter}/build.js +0 -0
- /package/{types/filter → filter}/errors.d.ts +0 -0
- /package/{esm/filter → filter}/errors.js +0 -0
- /package/{types/filter → filter}/filter-rules.d.ts +0 -0
- /package/{types/filter → filter}/filter-tree-visitor.d.ts +0 -0
- /package/{types/filter → filter}/index.d.ts +0 -0
- /package/{esm/filter → filter}/index.js +0 -0
- /package/{types/filter → filter}/opra-error-listener.d.ts +0 -0
- /package/{types/filter → filter}/opra-filter.ns.d.ts +0 -0
- /package/{esm/filter → filter}/opra-filter.ns.js +0 -0
- /package/{types/filter → filter}/parse.d.ts +0 -0
- /package/{esm/filter → filter}/parse.js +0 -0
- /package/{types/filter → filter}/utils.d.ts +0 -0
- /package/{esm/filter → filter}/utils.js +0 -0
- /package/{types/helpers → helpers}/function-utils.d.ts +0 -0
- /package/{esm/helpers → helpers}/function-utils.js +0 -0
- /package/{types/helpers → helpers}/get-stack-filename.d.ts +0 -0
- /package/{esm/helpers → helpers}/get-stack-filename.js +0 -0
- /package/{types/helpers → helpers}/index.d.ts +0 -0
- /package/{esm/helpers → helpers}/index.js +0 -0
- /package/{types/helpers → helpers}/mixin-utils.d.ts +0 -0
- /package/{esm/helpers → helpers}/mixin-utils.js +0 -0
- /package/{types/helpers → helpers}/monkey-patches.d.ts +0 -0
- /package/{cjs/helpers → helpers}/monkey-patches.js +0 -0
- /package/{types/helpers → helpers}/object-utils.d.ts +0 -0
- /package/{esm/helpers → helpers}/object-utils.js +0 -0
- /package/{types/helpers → helpers}/parse-fields-projection.d.ts +0 -0
- /package/{types/helpers → helpers}/responsive-map.d.ts +0 -0
- /package/{esm/helpers → helpers}/responsive-map.js +0 -0
- /package/{types/helpers → helpers}/safe-json-stringify.d.ts +0 -0
- /package/{esm/helpers → helpers}/safe-json-stringify.js +0 -0
- /package/{types/helpers → helpers}/type-guards.d.ts +0 -0
- /package/{esm/helpers → helpers}/type-guards.js +0 -0
- /package/{types/i18n → i18n}/i18n.d.ts +0 -0
- /package/{esm/i18n → i18n}/i18n.js +0 -0
- /package/{types/i18n → i18n}/index.d.ts +0 -0
- /package/{esm/i18n → i18n}/index.js +0 -0
- /package/{types/i18n → i18n}/string-utils.d.ts +0 -0
- /package/{esm/i18n → i18n}/string-utils.js +0 -0
- /package/{types/i18n → i18n}/translate.d.ts +0 -0
- /package/{esm/i18n → i18n}/translate.js +0 -0
- /package/{types/index.d.ts → index.d.ts} +0 -0
- /package/{esm/index.js → index.js} +0 -0
- /package/{types/polifils → polifils}/array-find-last.d.ts +0 -0
- /package/{esm/polifils → polifils}/array-find-last.js +0 -0
- /package/{types/schema → schema}/api-document.interface.d.ts +0 -0
- /package/{esm/schema → schema}/api-document.interface.js +0 -0
- /package/{types/schema → schema}/api.interface.d.ts +0 -0
- /package/{esm/schema → schema}/api.interface.js +0 -0
- /package/{types/schema → schema}/constants.d.ts +0 -0
- /package/{esm/schema → schema}/constants.js +0 -0
- /package/{types/schema → schema}/data-type/array-type.interface.d.ts +0 -0
- /package/{esm/schema → schema}/data-type/array-type.interface.js +0 -0
- /package/{types/schema → schema}/data-type/complex-type.interface.d.ts +0 -0
- /package/{esm/schema → schema}/data-type/complex-type.interface.js +0 -0
- /package/{types/schema → schema}/data-type/data-type.interface.d.ts +0 -0
- /package/{esm/schema → schema}/data-type/data-type.interface.js +0 -0
- /package/{types/schema → schema}/data-type/enum-type.interface.d.ts +0 -0
- /package/{esm/schema → schema}/data-type/enum-type.interface.js +0 -0
- /package/{types/schema → schema}/data-type/field.interface.d.ts +0 -0
- /package/{esm/schema → schema}/data-type/field.interface.js +0 -0
- /package/{types/schema → schema}/data-type/mapped-type.interface.d.ts +0 -0
- /package/{esm/schema → schema}/data-type/mapped-type.interface.js +0 -0
- /package/{types/schema → schema}/data-type/mixin-type.interface.d.ts +0 -0
- /package/{esm/schema → schema}/data-type/mixin-type.interface.js +0 -0
- /package/{types/schema → schema}/data-type/simple-type.interface.d.ts +0 -0
- /package/{esm/schema → schema}/data-type/simple-type.interface.js +0 -0
- /package/{types/schema → schema}/data-type/union-type.interface.d.ts +0 -0
- /package/{esm/schema → schema}/data-type/union-type.interface.js +0 -0
- /package/{types/schema → schema}/data-type-container.interface.d.ts +0 -0
- /package/{esm/schema → schema}/data-type-container.interface.js +0 -0
- /package/{types/schema → schema}/http/http-api.interface.d.ts +0 -0
- /package/{esm/schema → schema}/http/http-api.interface.js +0 -0
- /package/{types/schema → schema}/http/http-controller.interface.d.ts +0 -0
- /package/{esm/schema → schema}/http/http-controller.interface.js +0 -0
- /package/{types/schema → schema}/http/http-media-type.interface.d.ts +0 -0
- /package/{esm/schema → schema}/http/http-media-type.interface.js +0 -0
- /package/{types/schema → schema}/http/http-multipart-field.interface.d.ts +0 -0
- /package/{esm/schema → schema}/http/http-multipart-field.interface.js +0 -0
- /package/{types/schema → schema}/http/http-operation-response.interface.d.ts +0 -0
- /package/{esm/schema → schema}/http/http-operation-response.interface.js +0 -0
- /package/{types/schema → schema}/http/http-operation.interface.d.ts +0 -0
- /package/{esm/schema → schema}/http/http-operation.interface.js +0 -0
- /package/{types/schema → schema}/http/http-parameter.interface.d.ts +0 -0
- /package/{esm/schema → schema}/http/http-parameter.interface.js +0 -0
- /package/{types/schema → schema}/http/http-request-body.interface.d.ts +0 -0
- /package/{esm/schema → schema}/http/http-request-body.interface.js +0 -0
- /package/{types/schema → schema}/http/http-status-range.interface.d.ts +0 -0
- /package/{esm/schema → schema}/http/http-status-range.interface.js +0 -0
- /package/{types/schema → schema}/index.d.ts +0 -0
- /package/{esm/schema → schema}/index.js +0 -0
- /package/{types/schema → schema}/mq/mq-api.interface.d.ts +0 -0
- /package/{esm/schema → schema}/mq/mq-api.interface.js +0 -0
- /package/{types/schema → schema}/mq/mq-controller.interface.d.ts +0 -0
- /package/{esm/schema → schema}/mq/mq-controller.interface.js +0 -0
- /package/{types/schema → schema}/mq/mq-header.interface.d.ts +0 -0
- /package/{esm/schema → schema}/mq/mq-header.interface.js +0 -0
- /package/{types/schema → schema}/mq/mq-operation.interface.d.ts +0 -0
- /package/{esm/schema → schema}/mq/mq-operation.interface.js +0 -0
- /package/{types/schema → schema}/opra-schema.d.ts +0 -0
- /package/{esm/schema → schema}/opra-schema.js +0 -0
- /package/{types/schema → schema}/type-guards.d.ts +0 -0
- /package/{esm/schema → schema}/type-guards.js +0 -0
- /package/{types/schema → schema}/types.d.ts +0 -0
- /package/{esm/schema → schema}/types.js +0 -0
- /package/{types/schema → schema}/value.interface.d.ts +0 -0
- /package/{esm/schema → schema}/value.interface.js +0 -0
- /package/{esm/schema → schema}/ws/ws-api.interface.js +0 -0
- /package/{types/schema → schema}/ws/ws-controller.interface.d.ts +0 -0
- /package/{esm/schema → schema}/ws/ws-controller.interface.js +0 -0
- /package/{types/schema → schema}/ws/ws-operation.interface.d.ts +0 -0
- /package/{esm/schema → schema}/ws/ws-operation.interface.js +0 -0
- /package/{types/types.d.ts → types.d.ts} +0 -0
- /package/{esm/types.js → types.js} +0 -0
|
@@ -1,182 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var _a;
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.ApiDocument = void 0;
|
|
5
|
-
const objects_1 = require("@jsopen/objects");
|
|
6
|
-
const super_fast_md5_1 = require("super-fast-md5");
|
|
7
|
-
const index_js_1 = require("../helpers/index.js");
|
|
8
|
-
const index_js_2 = require("../schema/index.js");
|
|
9
|
-
const data_type_map_js_1 = require("./common/data-type-map.js");
|
|
10
|
-
const document_element_js_1 = require("./common/document-element.js");
|
|
11
|
-
const constants_js_1 = require("./constants.js");
|
|
12
|
-
const data_type_js_1 = require("./data-type/data-type.js");
|
|
13
|
-
const http_api_js_1 = require("./http/http-api.js");
|
|
14
|
-
const mq_api_js_1 = require("./mq/mq-api.js");
|
|
15
|
-
const ws_api_js_1 = require("./ws/ws-api.js");
|
|
16
|
-
/**
|
|
17
|
-
*
|
|
18
|
-
* @class ApiDocument
|
|
19
|
-
*/
|
|
20
|
-
class ApiDocument extends document_element_js_1.DocumentElement {
|
|
21
|
-
constructor() {
|
|
22
|
-
super(null);
|
|
23
|
-
this[_a] = new WeakMap();
|
|
24
|
-
this.id = '';
|
|
25
|
-
this.info = {};
|
|
26
|
-
this.references = new index_js_1.ResponsiveMap();
|
|
27
|
-
this.types = new data_type_map_js_1.DataTypeMap();
|
|
28
|
-
this.node[constants_js_1.kDataTypeMap] = this.types;
|
|
29
|
-
this.node.findDataType = this._findDataType.bind(this);
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Returns NS of datatype. Returns undefined if not found
|
|
33
|
-
* @param nameOrCtor
|
|
34
|
-
*/
|
|
35
|
-
getDataTypeNs(nameOrCtor) {
|
|
36
|
-
const dt = nameOrCtor instanceof data_type_js_1.DataType
|
|
37
|
-
? this._findDataType(nameOrCtor.name || '')
|
|
38
|
-
: this._findDataType(nameOrCtor);
|
|
39
|
-
if (dt)
|
|
40
|
-
return this[constants_js_1.kTypeNSMap].get(dt);
|
|
41
|
-
}
|
|
42
|
-
findDocument(id) {
|
|
43
|
-
if (this.id === id)
|
|
44
|
-
return this;
|
|
45
|
-
for (const doc of this.references.values()) {
|
|
46
|
-
if (doc.id === id)
|
|
47
|
-
return doc;
|
|
48
|
-
const d = doc.findDocument(id);
|
|
49
|
-
if (d)
|
|
50
|
-
return d;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
get httpApi() {
|
|
54
|
-
if (this.api && this.api instanceof http_api_js_1.HttpApi)
|
|
55
|
-
return this.api;
|
|
56
|
-
}
|
|
57
|
-
get mqApi() {
|
|
58
|
-
if (this.api && this.api instanceof mq_api_js_1.MQApi)
|
|
59
|
-
return this.api;
|
|
60
|
-
}
|
|
61
|
-
get wsApi() {
|
|
62
|
-
if (this.api && this.api instanceof ws_api_js_1.WSApi)
|
|
63
|
-
return this.api;
|
|
64
|
-
}
|
|
65
|
-
getHttpApi() {
|
|
66
|
-
if (!(this.api && this.api instanceof http_api_js_1.HttpApi)) {
|
|
67
|
-
throw new TypeError('The document do not contains HttpApi instance');
|
|
68
|
-
}
|
|
69
|
-
return this.api;
|
|
70
|
-
}
|
|
71
|
-
getMqApi() {
|
|
72
|
-
if (!(this.api && this.api instanceof mq_api_js_1.MQApi)) {
|
|
73
|
-
throw new TypeError('The document do not contains MQApi instance');
|
|
74
|
-
}
|
|
75
|
-
return this.api;
|
|
76
|
-
}
|
|
77
|
-
getWsApi() {
|
|
78
|
-
if (!(this.api && this.api instanceof ws_api_js_1.WSApi)) {
|
|
79
|
-
throw new TypeError('The document do not contains WSApi instance');
|
|
80
|
-
}
|
|
81
|
-
return this.api;
|
|
82
|
-
}
|
|
83
|
-
toJSON() {
|
|
84
|
-
return this.export();
|
|
85
|
-
}
|
|
86
|
-
/**
|
|
87
|
-
* Export as Opra schema definition object
|
|
88
|
-
*/
|
|
89
|
-
export(options) {
|
|
90
|
-
const out = (0, objects_1.omitUndefined)({
|
|
91
|
-
spec: index_js_2.OpraSchema.SpecVersion,
|
|
92
|
-
id: this.id,
|
|
93
|
-
url: this.url,
|
|
94
|
-
info: (0, index_js_1.cloneObject)(this.info, true),
|
|
95
|
-
});
|
|
96
|
-
if (this.references.size) {
|
|
97
|
-
let i = 0;
|
|
98
|
-
const references = {};
|
|
99
|
-
for (const [ns, doc] of this.references.entries()) {
|
|
100
|
-
if (doc[constants_js_1.BUILTIN])
|
|
101
|
-
continue;
|
|
102
|
-
references[ns] = {
|
|
103
|
-
id: doc.id,
|
|
104
|
-
url: doc.url,
|
|
105
|
-
info: (0, index_js_1.cloneObject)(doc.info, true),
|
|
106
|
-
};
|
|
107
|
-
i++;
|
|
108
|
-
}
|
|
109
|
-
if (i)
|
|
110
|
-
out.references = references;
|
|
111
|
-
}
|
|
112
|
-
if (this.types.size) {
|
|
113
|
-
out.types = {};
|
|
114
|
-
for (const v of this.types.values()) {
|
|
115
|
-
if (!v.inScope(options?.scope))
|
|
116
|
-
continue;
|
|
117
|
-
out.types[v.name] = v.toJSON(options);
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
if (this.api)
|
|
121
|
-
out.api = this.api.toJSON(options);
|
|
122
|
-
return out;
|
|
123
|
-
}
|
|
124
|
-
invalidate() {
|
|
125
|
-
/** Generate id */
|
|
126
|
-
const x = this.export({});
|
|
127
|
-
delete x.id;
|
|
128
|
-
this.id = (0, super_fast_md5_1.md5)(JSON.stringify(x));
|
|
129
|
-
/** Clear [kTypeNSMap] */
|
|
130
|
-
this[constants_js_1.kTypeNSMap] = new WeakMap();
|
|
131
|
-
}
|
|
132
|
-
_findDataType(nameOrCtor, scope, visitedRefs) {
|
|
133
|
-
let result = this.types.get(nameOrCtor);
|
|
134
|
-
if (result && result.inScope(scope))
|
|
135
|
-
return result;
|
|
136
|
-
if (!this.references.size)
|
|
137
|
-
return;
|
|
138
|
-
// Lookup for references
|
|
139
|
-
if (typeof nameOrCtor === 'string') {
|
|
140
|
-
// If given string has namespace pattern (ns:type_name)
|
|
141
|
-
const m = constants_js_1.NAMESPACE_PATTERN.exec(nameOrCtor);
|
|
142
|
-
if (m) {
|
|
143
|
-
const ns = m[1];
|
|
144
|
-
if (ns) {
|
|
145
|
-
const ref = this.references.get(ns);
|
|
146
|
-
if (!ref)
|
|
147
|
-
return;
|
|
148
|
-
visitedRefs = visitedRefs || new WeakMap();
|
|
149
|
-
visitedRefs.set(this, true);
|
|
150
|
-
visitedRefs.set(ref, true);
|
|
151
|
-
return ref._findDataType(m[2], scope, visitedRefs);
|
|
152
|
-
}
|
|
153
|
-
nameOrCtor = m[2];
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
// if not found, search in references (from last to first)
|
|
157
|
-
visitedRefs = visitedRefs || new WeakMap();
|
|
158
|
-
visitedRefs.set(this, true);
|
|
159
|
-
const references = Array.from(this.references.keys()).reverse();
|
|
160
|
-
/** First step, lookup for own types */
|
|
161
|
-
for (const refNs of references) {
|
|
162
|
-
const ref = this.references.get(refNs);
|
|
163
|
-
result = ref?.types.get(nameOrCtor);
|
|
164
|
-
if (result) {
|
|
165
|
-
this[constants_js_1.kTypeNSMap].set(result, ref?.[constants_js_1.BUILTIN] ? '' : refNs);
|
|
166
|
-
return result;
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
/** If not found lookup for child references */
|
|
170
|
-
for (const refNs of references) {
|
|
171
|
-
const ref = this.references.get(refNs);
|
|
172
|
-
visitedRefs.set(ref, true);
|
|
173
|
-
result = ref._findDataType(nameOrCtor, scope, visitedRefs);
|
|
174
|
-
if (result) {
|
|
175
|
-
this[constants_js_1.kTypeNSMap].set(result, ref?.[constants_js_1.BUILTIN] ? '' : refNs);
|
|
176
|
-
return result;
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
exports.ApiDocument = ApiDocument;
|
|
182
|
-
_a = constants_js_1.kTypeNSMap;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ApiBase = void 0;
|
|
4
|
-
const objects_1 = require("@jsopen/objects");
|
|
5
|
-
const constants_js_1 = require("../constants.js");
|
|
6
|
-
const document_element_js_1 = require("./document-element.js");
|
|
7
|
-
class ApiBase extends document_element_js_1.DocumentElement {
|
|
8
|
-
constructor(init) {
|
|
9
|
-
super(init.owner);
|
|
10
|
-
this.name = 'OpraApi';
|
|
11
|
-
this.name = init.name;
|
|
12
|
-
this.description = init.description;
|
|
13
|
-
}
|
|
14
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
15
|
-
toJSON(options) {
|
|
16
|
-
return (0, objects_1.omitUndefined)({
|
|
17
|
-
transport: this.transport,
|
|
18
|
-
name: this.name,
|
|
19
|
-
description: this.description,
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
async _initialize(init,
|
|
23
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
24
|
-
context) {
|
|
25
|
-
if (!constants_js_1.CLASS_NAME_PATTERN.test(init.name))
|
|
26
|
-
throw new TypeError(`Invalid api name (${init.name})`);
|
|
27
|
-
this.name = init.name;
|
|
28
|
-
this.description = init?.description;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
exports.ApiBase = ApiBase;
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var _a, _b;
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.DataTypeMap = void 0;
|
|
5
|
-
const index_js_1 = require("../../helpers/index.js");
|
|
6
|
-
const constants_js_1 = require("../constants.js");
|
|
7
|
-
const data_type_js_1 = require("../data-type/data-type.js");
|
|
8
|
-
const kMap = Symbol.for('kMap');
|
|
9
|
-
const kCtorMap = Symbol.for('kCtorMap');
|
|
10
|
-
/**
|
|
11
|
-
* @class DataTypeMap
|
|
12
|
-
*/
|
|
13
|
-
class DataTypeMap {
|
|
14
|
-
constructor() {
|
|
15
|
-
this[_a] = new index_js_1.ResponsiveMap();
|
|
16
|
-
this[_b] = new WeakMap();
|
|
17
|
-
}
|
|
18
|
-
get size() {
|
|
19
|
-
return this[kMap].size;
|
|
20
|
-
}
|
|
21
|
-
forEach(callbackFn, thisArg) {
|
|
22
|
-
this[kMap].forEach(callbackFn, thisArg);
|
|
23
|
-
}
|
|
24
|
-
get(nameOrCtor) {
|
|
25
|
-
let name = typeof nameOrCtor === 'string'
|
|
26
|
-
? nameOrCtor
|
|
27
|
-
: this[kCtorMap].get(nameOrCtor);
|
|
28
|
-
if (!name && typeof nameOrCtor === 'function') {
|
|
29
|
-
const metadata = Reflect.getMetadata(constants_js_1.DATATYPE_METADATA, nameOrCtor);
|
|
30
|
-
name = metadata?.name;
|
|
31
|
-
}
|
|
32
|
-
if (!name && typeof nameOrCtor === 'object') {
|
|
33
|
-
const metadata = nameOrCtor[constants_js_1.DATATYPE_METADATA];
|
|
34
|
-
name = metadata?.name;
|
|
35
|
-
}
|
|
36
|
-
if (!name)
|
|
37
|
-
return;
|
|
38
|
-
const out = this[kMap].get(name);
|
|
39
|
-
if (!out)
|
|
40
|
-
return;
|
|
41
|
-
if (typeof nameOrCtor === 'function' && out.kind === 'ComplexType')
|
|
42
|
-
return out.ctor === nameOrCtor ? out : undefined;
|
|
43
|
-
return out;
|
|
44
|
-
}
|
|
45
|
-
set(name, dataType) {
|
|
46
|
-
this[kMap].set(name, dataType);
|
|
47
|
-
if (dataType.ctor)
|
|
48
|
-
this[kCtorMap].set(dataType.ctor, name);
|
|
49
|
-
else if (dataType.instance)
|
|
50
|
-
this[kCtorMap].set(dataType.instance, name);
|
|
51
|
-
}
|
|
52
|
-
has(nameOrCtor) {
|
|
53
|
-
if (nameOrCtor instanceof data_type_js_1.DataType)
|
|
54
|
-
return !!nameOrCtor.name && this[kMap].has(nameOrCtor.name);
|
|
55
|
-
const name = typeof nameOrCtor === 'string'
|
|
56
|
-
? nameOrCtor
|
|
57
|
-
: this[kCtorMap].get(nameOrCtor);
|
|
58
|
-
return name ? this[kMap].has(name) : false;
|
|
59
|
-
}
|
|
60
|
-
keys() {
|
|
61
|
-
return this[kMap].keys();
|
|
62
|
-
}
|
|
63
|
-
values() {
|
|
64
|
-
return this[kMap].values();
|
|
65
|
-
}
|
|
66
|
-
entries() {
|
|
67
|
-
return this[kMap].entries();
|
|
68
|
-
}
|
|
69
|
-
sort(compareFn) {
|
|
70
|
-
this[kMap].sort(compareFn);
|
|
71
|
-
return this;
|
|
72
|
-
}
|
|
73
|
-
[(_a = kMap, _b = kCtorMap, Symbol.iterator)]() {
|
|
74
|
-
return this[kMap][Symbol.iterator]();
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
exports.DataTypeMap = DataTypeMap;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DocumentElement = void 0;
|
|
4
|
-
const ts_gems_1 = require("ts-gems");
|
|
5
|
-
const uid_1 = require("uid");
|
|
6
|
-
const document_node_js_1 = require("./document-node.js");
|
|
7
|
-
/**
|
|
8
|
-
*
|
|
9
|
-
* @constructor DocumentElement
|
|
10
|
-
*/
|
|
11
|
-
exports.DocumentElement = function (owner) {
|
|
12
|
-
if (!this)
|
|
13
|
-
throw new TypeError('"this" should be passed to call class constructor');
|
|
14
|
-
const _this = (0, ts_gems_1.asMutable)(this);
|
|
15
|
-
_this.id = (0, uid_1.uid)(16);
|
|
16
|
-
Object.defineProperty(_this, 'node', {
|
|
17
|
-
value: new document_node_js_1.DocumentNode(this, owner?.node),
|
|
18
|
-
enumerable: false,
|
|
19
|
-
writable: true,
|
|
20
|
-
});
|
|
21
|
-
if (owner) {
|
|
22
|
-
Object.defineProperty(_this, 'owner', {
|
|
23
|
-
value: owner,
|
|
24
|
-
enumerable: false,
|
|
25
|
-
writable: true,
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
/**
|
|
30
|
-
* @class DocumentElement
|
|
31
|
-
*/
|
|
32
|
-
class DocumentElementClass {
|
|
33
|
-
}
|
|
34
|
-
exports.DocumentElement.prototype = DocumentElementClass.prototype;
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DocumentInitContext = void 0;
|
|
4
|
-
const opra_document_error_js_1 = require("./opra-document-error.js");
|
|
5
|
-
class DocumentInitContext {
|
|
6
|
-
constructor(options) {
|
|
7
|
-
this.path = '';
|
|
8
|
-
this.error = new opra_document_error_js_1.OpraDocumentError();
|
|
9
|
-
this.showErrorDetails = true;
|
|
10
|
-
this.maxErrors = options?.maxErrors || 0;
|
|
11
|
-
this.error.message = '';
|
|
12
|
-
}
|
|
13
|
-
addError(error) {
|
|
14
|
-
if (!this.error.details.length) {
|
|
15
|
-
if (error instanceof Error)
|
|
16
|
-
this.error.stack = error.stack;
|
|
17
|
-
else {
|
|
18
|
-
const e = new Error();
|
|
19
|
-
Error.captureStackTrace(e, this.addError);
|
|
20
|
-
this.error.stack = e.stack;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
// @ts-ignore
|
|
24
|
-
this.error.add({
|
|
25
|
-
message: typeof error === 'string' ? error : error.message,
|
|
26
|
-
path: this.path,
|
|
27
|
-
...(typeof error === 'object' ? error : undefined),
|
|
28
|
-
});
|
|
29
|
-
if (this.error.details.length >= this.maxErrors)
|
|
30
|
-
throw this.error;
|
|
31
|
-
}
|
|
32
|
-
enter(path, fn) {
|
|
33
|
-
const oldPath = this.path;
|
|
34
|
-
this.path = this.path + path;
|
|
35
|
-
try {
|
|
36
|
-
return fn();
|
|
37
|
-
}
|
|
38
|
-
catch (e) {
|
|
39
|
-
if (e !== this.error) {
|
|
40
|
-
this.addError(e);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
finally {
|
|
44
|
-
this.path = oldPath;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
async enterAsync(path, fn) {
|
|
48
|
-
const oldPath = this.path;
|
|
49
|
-
this.path = this.path + path;
|
|
50
|
-
try {
|
|
51
|
-
return await fn();
|
|
52
|
-
}
|
|
53
|
-
catch (e) {
|
|
54
|
-
if (e !== this.error)
|
|
55
|
-
this.addError(e);
|
|
56
|
-
}
|
|
57
|
-
finally {
|
|
58
|
-
this.path = oldPath;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
extend(args) {
|
|
62
|
-
const out = {
|
|
63
|
-
...args,
|
|
64
|
-
};
|
|
65
|
-
Object.setPrototypeOf(out, this);
|
|
66
|
-
return out;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
exports.DocumentInitContext = DocumentInitContext;
|
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DocumentNode = void 0;
|
|
4
|
-
const index_js_1 = require("../../schema/index.js");
|
|
5
|
-
const constants_js_1 = require("../constants.js");
|
|
6
|
-
/**
|
|
7
|
-
* @class DocumentNode
|
|
8
|
-
*/
|
|
9
|
-
class DocumentNode {
|
|
10
|
-
constructor(element, parent) {
|
|
11
|
-
this.element = element;
|
|
12
|
-
this.parent = parent;
|
|
13
|
-
}
|
|
14
|
-
getDocument() {
|
|
15
|
-
if (this._document)
|
|
16
|
-
return this._document;
|
|
17
|
-
if (this.element[constants_js_1.kTypeNSMap])
|
|
18
|
-
return this.element;
|
|
19
|
-
if (this.parent)
|
|
20
|
-
return (this._document = this.parent.getDocument());
|
|
21
|
-
// istanbul ignore next
|
|
22
|
-
throw new Error('ApiDocument not found in document tree');
|
|
23
|
-
}
|
|
24
|
-
hasDataType(nameOrCtor, scope) {
|
|
25
|
-
return !!this.findDataType(nameOrCtor, scope);
|
|
26
|
-
}
|
|
27
|
-
findDataType(nameOrCtor, scope) {
|
|
28
|
-
const dt = this[constants_js_1.kDataTypeMap]?.get(nameOrCtor);
|
|
29
|
-
if (dt && dt.inScope(scope))
|
|
30
|
-
return dt;
|
|
31
|
-
return this.parent
|
|
32
|
-
? this.parent.findDataType(nameOrCtor, scope)
|
|
33
|
-
: undefined;
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Returns DataType instance by name or Constructor. Returns undefined if not found
|
|
37
|
-
*/
|
|
38
|
-
getDataType(nameOrCtor, scope) {
|
|
39
|
-
const dt = this.findDataType(nameOrCtor, scope);
|
|
40
|
-
if (dt)
|
|
41
|
-
return dt;
|
|
42
|
-
let name = '';
|
|
43
|
-
if (typeof nameOrCtor === 'function') {
|
|
44
|
-
const metadata = Reflect.getMetadata(constants_js_1.DATATYPE_METADATA, nameOrCtor);
|
|
45
|
-
name = metadata.name;
|
|
46
|
-
}
|
|
47
|
-
else if (typeof nameOrCtor === 'object') {
|
|
48
|
-
const metadata = nameOrCtor[constants_js_1.DATATYPE_METADATA];
|
|
49
|
-
name = metadata?.name;
|
|
50
|
-
}
|
|
51
|
-
if (!name) {
|
|
52
|
-
if (nameOrCtor && typeof nameOrCtor === 'string')
|
|
53
|
-
name = nameOrCtor;
|
|
54
|
-
else if (typeof nameOrCtor === 'function')
|
|
55
|
-
name = nameOrCtor.name;
|
|
56
|
-
}
|
|
57
|
-
if (dt)
|
|
58
|
-
throw new TypeError(`Data type${name ? ' (' + name + ')' : ''} is not in requested scope (${scope})`);
|
|
59
|
-
throw new TypeError(`Unknown data type${name ? ' (' + name + ')' : ''}`);
|
|
60
|
-
}
|
|
61
|
-
getDataTypeNameWithNs(dataType) {
|
|
62
|
-
if (!dataType.name)
|
|
63
|
-
return;
|
|
64
|
-
const ns = this.getDocument().getDataTypeNs(dataType);
|
|
65
|
-
return ns ? ns + ':' + dataType.name : dataType.name;
|
|
66
|
-
}
|
|
67
|
-
/**
|
|
68
|
-
* Returns EnumType instance by name or Constructor.
|
|
69
|
-
* Returns undefined if not found
|
|
70
|
-
* Throws error if data type is not a UnionType
|
|
71
|
-
*/
|
|
72
|
-
getArrayType(nameOrCtor, scope) {
|
|
73
|
-
const t = this.getDataType(nameOrCtor, scope);
|
|
74
|
-
if (t.kind === index_js_1.OpraSchema.ArrayType.Kind)
|
|
75
|
-
return t;
|
|
76
|
-
throw new TypeError(`Data type "${t.name || t}" is not a MixinType`);
|
|
77
|
-
}
|
|
78
|
-
/**
|
|
79
|
-
* Returns ComplexType instance by name or Constructor.
|
|
80
|
-
* Returns undefined if not found
|
|
81
|
-
* Throws error if data type is not a ComplexType
|
|
82
|
-
*/
|
|
83
|
-
getComplexType(nameOrCtor, scope) {
|
|
84
|
-
const t = this.getDataType(nameOrCtor, scope);
|
|
85
|
-
if (t.kind === index_js_1.OpraSchema.ComplexType.Kind)
|
|
86
|
-
return t;
|
|
87
|
-
throw new TypeError(`Data type "${t.name}" is not a ComplexType`);
|
|
88
|
-
}
|
|
89
|
-
/**
|
|
90
|
-
* Returns SimpleType instance by name or Constructor.
|
|
91
|
-
* Returns undefined if not found
|
|
92
|
-
* Throws error if data type is not a SimpleType
|
|
93
|
-
*/
|
|
94
|
-
getSimpleType(nameOrCtor, scope) {
|
|
95
|
-
const t = this.getDataType(nameOrCtor, scope);
|
|
96
|
-
if (t.kind === index_js_1.OpraSchema.SimpleType.Kind)
|
|
97
|
-
return t;
|
|
98
|
-
throw new TypeError(`Data type "${t.name || t}" is not a SimpleType`);
|
|
99
|
-
}
|
|
100
|
-
/**
|
|
101
|
-
* Returns EnumType instance by name or Constructor.
|
|
102
|
-
* Returns undefined if not found
|
|
103
|
-
* Throws error if data type is not a EnumType
|
|
104
|
-
*/
|
|
105
|
-
getEnumType(nameOrCtor, scope) {
|
|
106
|
-
const t = this.getDataType(nameOrCtor, scope);
|
|
107
|
-
if (t.kind === index_js_1.OpraSchema.EnumType.Kind)
|
|
108
|
-
return t;
|
|
109
|
-
throw new TypeError(`Data type "${t.name || t}" is not a EnumType`);
|
|
110
|
-
}
|
|
111
|
-
/**
|
|
112
|
-
* Returns EnumType instance by name or Constructor.
|
|
113
|
-
* Returns undefined if not found
|
|
114
|
-
* Throws error if data type is not a MappedType
|
|
115
|
-
*/
|
|
116
|
-
getMappedType(nameOrCtor, scope) {
|
|
117
|
-
const t = this.getDataType(nameOrCtor, scope);
|
|
118
|
-
if (t.kind === index_js_1.OpraSchema.MappedType.Kind)
|
|
119
|
-
return t;
|
|
120
|
-
throw new TypeError(`Data type "${t.name || t}" is not a MappedType`);
|
|
121
|
-
}
|
|
122
|
-
/**
|
|
123
|
-
* Returns EnumType instance by name or Constructor.
|
|
124
|
-
* Returns undefined if not found
|
|
125
|
-
* Throws error if data type is not a MixinType
|
|
126
|
-
*/
|
|
127
|
-
getMixinType(nameOrCtor, scope) {
|
|
128
|
-
const t = this.getDataType(nameOrCtor, scope);
|
|
129
|
-
if (t.kind === index_js_1.OpraSchema.MixinType.Kind)
|
|
130
|
-
return t;
|
|
131
|
-
throw new TypeError(`Data type "${t.name || t}" is not a MixinType`);
|
|
132
|
-
}
|
|
133
|
-
/**
|
|
134
|
-
* Returns EnumType instance by name or Constructor.
|
|
135
|
-
* Returns undefined if not found
|
|
136
|
-
* Throws error if data type is not a UnionType
|
|
137
|
-
*/
|
|
138
|
-
getUnionType(nameOrCtor, scope) {
|
|
139
|
-
const t = this.getDataType(nameOrCtor, scope);
|
|
140
|
-
if (t.kind === index_js_1.OpraSchema.UnionType.Kind)
|
|
141
|
-
return t;
|
|
142
|
-
throw new TypeError(`Data type "${t.name || t}" is not a UnionType`);
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
exports.DocumentNode = DocumentNode;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.OpraDocumentError = void 0;
|
|
4
|
-
const opra_exception_js_1 = require("../../exception/opra-exception.js");
|
|
5
|
-
class OpraDocumentError extends opra_exception_js_1.OpraException {
|
|
6
|
-
constructor() {
|
|
7
|
-
super('');
|
|
8
|
-
this.details = [];
|
|
9
|
-
}
|
|
10
|
-
add(detail) {
|
|
11
|
-
this.details.push(detail);
|
|
12
|
-
return this;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
exports.OpraDocumentError = OpraDocumentError;
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Value = void 0;
|
|
4
|
-
const objects_1 = require("@jsopen/objects");
|
|
5
|
-
const ts_gems_1 = require("ts-gems");
|
|
6
|
-
const document_element_js_1 = require("./document-element.js");
|
|
7
|
-
exports.Value = function (owner, initArgs) {
|
|
8
|
-
if (!this)
|
|
9
|
-
throw new TypeError('"this" should be passed to call class constructor');
|
|
10
|
-
document_element_js_1.DocumentElement.call(this, owner);
|
|
11
|
-
// if (args.name && !PARAMETER_NAME_PATTERN.test(args.name))
|
|
12
|
-
// throw new TypeError(`"${args.name}" is not a valid parameter name`);
|
|
13
|
-
const _this = (0, ts_gems_1.asMutable)(this);
|
|
14
|
-
_this.description = initArgs.description;
|
|
15
|
-
_this.type = initArgs.type;
|
|
16
|
-
_this.examples = initArgs.examples;
|
|
17
|
-
_this.isArray = initArgs.isArray;
|
|
18
|
-
};
|
|
19
|
-
/**
|
|
20
|
-
* @class Value
|
|
21
|
-
*/
|
|
22
|
-
class ValueClass extends document_element_js_1.DocumentElement {
|
|
23
|
-
toJSON(options) {
|
|
24
|
-
const typeName = this.type
|
|
25
|
-
? this.node.getDataTypeNameWithNs(this.type)
|
|
26
|
-
: undefined;
|
|
27
|
-
return (0, objects_1.omitUndefined)({
|
|
28
|
-
type: this.type
|
|
29
|
-
? typeName
|
|
30
|
-
? typeName
|
|
31
|
-
: this.type.toJSON(options)
|
|
32
|
-
: 'any',
|
|
33
|
-
description: this.description,
|
|
34
|
-
isArray: this.isArray,
|
|
35
|
-
examples: this.examples,
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
exports.Value.prototype = ValueClass.prototype;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.kTypeNSMap = exports.kCtorMap = exports.kDataTypeMap = exports.CLASS_NAME_PATTERN = exports.NAMESPACE_PATTERN = exports.BUILTIN = exports.DECORATOR = exports.ENCODER = exports.DECODER = exports.RPC_CONTROLLER_METADATA = exports.WS_PARAM_METADATA = exports.WS_CONTROLLER_METADATA = exports.MQ_CONTROLLER_METADATA = exports.HTTP_CONTROLLER_METADATA = exports.DATATYPE_METADATA = void 0;
|
|
4
|
-
exports.DATATYPE_METADATA = Symbol.for('opra.type.metadata');
|
|
5
|
-
exports.HTTP_CONTROLLER_METADATA = Symbol('opra.http-controller.metadata');
|
|
6
|
-
exports.MQ_CONTROLLER_METADATA = Symbol('opra.mq-controller.metadata');
|
|
7
|
-
exports.WS_CONTROLLER_METADATA = Symbol('opra.ws-controller.metadata');
|
|
8
|
-
exports.WS_PARAM_METADATA = Symbol('opra.ws-param.metadata');
|
|
9
|
-
exports.RPC_CONTROLLER_METADATA = Symbol('opra.rpc-controller.metadata');
|
|
10
|
-
exports.DECODER = Symbol.for('opra.type.decoder');
|
|
11
|
-
exports.ENCODER = Symbol('opra.type.encoder');
|
|
12
|
-
exports.DECORATOR = Symbol.for('DECORATOR');
|
|
13
|
-
exports.BUILTIN = Symbol.for('BUILTIN');
|
|
14
|
-
exports.NAMESPACE_PATTERN = /([a-z$_]\w+):(.+)/i;
|
|
15
|
-
exports.CLASS_NAME_PATTERN = /^[a-z][\w_]*$/i;
|
|
16
|
-
exports.kDataTypeMap = Symbol.for('kDataTypeMap');
|
|
17
|
-
exports.kCtorMap = Symbol.for('kCtorMap');
|
|
18
|
-
exports.kTypeNSMap = Symbol.for('kTypeNSMap');
|