@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,54 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MQApi = void 0;
|
|
4
|
-
const index_js_1 = require("../../helpers/index.js");
|
|
5
|
-
const api_base_js_1 = require("../common/api-base.js");
|
|
6
|
-
/**
|
|
7
|
-
* @class MQApi
|
|
8
|
-
*/
|
|
9
|
-
class MQApi extends api_base_js_1.ApiBase {
|
|
10
|
-
constructor(init) {
|
|
11
|
-
super(init);
|
|
12
|
-
// noinspection JSUnusedGlobalSymbols
|
|
13
|
-
this._controllerReverseMap = new WeakMap();
|
|
14
|
-
this.transport = 'mq';
|
|
15
|
-
this.controllers = new index_js_1.ResponsiveMap();
|
|
16
|
-
this.platform = init.platform;
|
|
17
|
-
}
|
|
18
|
-
findController(arg0) {
|
|
19
|
-
if (typeof arg0 === 'function') {
|
|
20
|
-
/** Check for cached mapping */
|
|
21
|
-
const controller = this._controllerReverseMap.get(arg0);
|
|
22
|
-
if (controller != null)
|
|
23
|
-
return controller;
|
|
24
|
-
/** Lookup for ctor in all controllers */
|
|
25
|
-
for (const c of this.controllers.values()) {
|
|
26
|
-
if (c.ctor === arg0) {
|
|
27
|
-
this._controllerReverseMap.set(arg0, c);
|
|
28
|
-
return c;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
this._controllerReverseMap.set(arg0, null);
|
|
32
|
-
return;
|
|
33
|
-
}
|
|
34
|
-
return this.controllers.get(arg0);
|
|
35
|
-
}
|
|
36
|
-
findOperation(arg0, operationName) {
|
|
37
|
-
const controller = this.findController(arg0);
|
|
38
|
-
return controller?.operations.get(operationName);
|
|
39
|
-
}
|
|
40
|
-
toJSON() {
|
|
41
|
-
const schema = super.toJSON();
|
|
42
|
-
const out = {
|
|
43
|
-
...schema,
|
|
44
|
-
transport: this.transport,
|
|
45
|
-
platform: this.platform,
|
|
46
|
-
controllers: {},
|
|
47
|
-
};
|
|
48
|
-
for (const v of this.controllers.values()) {
|
|
49
|
-
out.controllers[v.name] = v.toJSON();
|
|
50
|
-
}
|
|
51
|
-
return out;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
exports.MQApi = MQApi;
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MQController = void 0;
|
|
4
|
-
const objects_1 = require("@jsopen/objects");
|
|
5
|
-
const ts_gems_1 = require("ts-gems");
|
|
6
|
-
const index_js_1 = require("../../helpers/index.js");
|
|
7
|
-
const index_js_2 = require("../../schema/index.js");
|
|
8
|
-
const data_type_map_js_1 = require("../common/data-type-map.js");
|
|
9
|
-
const document_element_js_1 = require("../common/document-element.js");
|
|
10
|
-
const constants_js_1 = require("../constants.js");
|
|
11
|
-
const mq_controller_decorator_js_1 = require("../decorators/mq-controller.decorator.js");
|
|
12
|
-
const inspect_util_js_1 = require("../utils/inspect.util.js");
|
|
13
|
-
/**
|
|
14
|
-
* MQController
|
|
15
|
-
*/
|
|
16
|
-
exports.MQController = function (...args) {
|
|
17
|
-
// ClassDecorator
|
|
18
|
-
if (!this)
|
|
19
|
-
return exports.MQController[constants_js_1.DECORATOR].apply(undefined, args);
|
|
20
|
-
// Constructor
|
|
21
|
-
const [owner, initArgs] = args;
|
|
22
|
-
document_element_js_1.DocumentElement.call(this, owner);
|
|
23
|
-
if (!constants_js_1.CLASS_NAME_PATTERN.test(initArgs.name))
|
|
24
|
-
throw new TypeError(`Invalid resource name (${initArgs.name})`);
|
|
25
|
-
const _this = (0, ts_gems_1.asMutable)(this);
|
|
26
|
-
_this.kind = index_js_2.OpraSchema.MQController.Kind;
|
|
27
|
-
_this.types = _this.node[constants_js_1.kDataTypeMap] = new data_type_map_js_1.DataTypeMap();
|
|
28
|
-
_this.operations = new index_js_1.ResponsiveMap();
|
|
29
|
-
_this.headers = [];
|
|
30
|
-
_this.name = initArgs.name;
|
|
31
|
-
_this.description = initArgs.description;
|
|
32
|
-
_this.instance = initArgs.instance;
|
|
33
|
-
_this.ctor = initArgs.ctor;
|
|
34
|
-
_this._controllerReverseMap = new WeakMap();
|
|
35
|
-
_this._initialize?.(initArgs);
|
|
36
|
-
};
|
|
37
|
-
/**
|
|
38
|
-
*
|
|
39
|
-
* @class MQController
|
|
40
|
-
*/
|
|
41
|
-
class MQControllerClass extends document_element_js_1.DocumentElement {
|
|
42
|
-
findHeader(paramName, location) {
|
|
43
|
-
const paramNameLower = paramName.toLowerCase();
|
|
44
|
-
let prm;
|
|
45
|
-
for (prm of this.headers) {
|
|
46
|
-
if (typeof prm.name === 'string') {
|
|
47
|
-
prm._nameLower = prm._nameLower || prm.name.toLowerCase();
|
|
48
|
-
if (prm._nameLower === paramNameLower)
|
|
49
|
-
return prm;
|
|
50
|
-
}
|
|
51
|
-
if (prm.name instanceof RegExp && prm.name.test(paramName))
|
|
52
|
-
return prm;
|
|
53
|
-
}
|
|
54
|
-
if (this.node.parent && this.node.parent.element instanceof exports.MQController) {
|
|
55
|
-
return this.node.parent.element.findHeader(paramName, location);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
*
|
|
60
|
-
*/
|
|
61
|
-
toString() {
|
|
62
|
-
return `[MQController ${this.name}]`;
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
*
|
|
66
|
-
*/
|
|
67
|
-
toJSON() {
|
|
68
|
-
const out = (0, objects_1.omitUndefined)({
|
|
69
|
-
kind: this.kind,
|
|
70
|
-
description: this.description,
|
|
71
|
-
});
|
|
72
|
-
if (this.operations.size) {
|
|
73
|
-
out.operations = {};
|
|
74
|
-
for (const v of this.operations.values()) {
|
|
75
|
-
out.operations[v.name] = v.toJSON();
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
if (this.types.size) {
|
|
79
|
-
out.types = {};
|
|
80
|
-
for (const v of this.types.values()) {
|
|
81
|
-
out.types[v.name] = v.toJSON();
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
if (this.headers.length) {
|
|
85
|
-
out.headers = [];
|
|
86
|
-
for (const prm of this.headers) {
|
|
87
|
-
out.headers.push(prm.toJSON());
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
return out;
|
|
91
|
-
}
|
|
92
|
-
/**
|
|
93
|
-
*
|
|
94
|
-
*/
|
|
95
|
-
[inspect_util_js_1.nodeInspectCustom]() {
|
|
96
|
-
return `[${inspect_util_js_1.colorFgYellow}MQController${inspect_util_js_1.colorFgMagenta + this.name + inspect_util_js_1.colorReset}]`;
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
exports.MQController.prototype = MQControllerClass.prototype;
|
|
100
|
-
Object.assign(exports.MQController, mq_controller_decorator_js_1.MQControllerDecoratorFactory);
|
|
101
|
-
exports.MQController[constants_js_1.DECORATOR] = mq_controller_decorator_js_1.MQControllerDecoratorFactory;
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MQHeader = void 0;
|
|
4
|
-
const objects_1 = require("@jsopen/objects");
|
|
5
|
-
const ts_gems_1 = require("ts-gems");
|
|
6
|
-
const valgen_1 = require("valgen");
|
|
7
|
-
const value_js_1 = require("../common/value.js");
|
|
8
|
-
const parse_regexp_util_js_1 = require("../utils/parse-regexp.util.js");
|
|
9
|
-
exports.MQHeader = function (owner, initArgs) {
|
|
10
|
-
if (!this)
|
|
11
|
-
throw new TypeError('"this" should be passed to call class constructor');
|
|
12
|
-
value_js_1.Value.call(this, owner, initArgs);
|
|
13
|
-
const _this = (0, ts_gems_1.asMutable)(this);
|
|
14
|
-
if (initArgs.name) {
|
|
15
|
-
_this.name =
|
|
16
|
-
initArgs.name instanceof RegExp
|
|
17
|
-
? initArgs.name
|
|
18
|
-
: initArgs.name.startsWith('/')
|
|
19
|
-
? (0, parse_regexp_util_js_1.parseRegExp)(initArgs.name, {
|
|
20
|
-
includeFlags: 'i',
|
|
21
|
-
excludeFlags: 'm',
|
|
22
|
-
})
|
|
23
|
-
: initArgs.name;
|
|
24
|
-
}
|
|
25
|
-
_this.deprecated = initArgs.deprecated;
|
|
26
|
-
_this.required = initArgs.required;
|
|
27
|
-
_this.designType = initArgs.designType;
|
|
28
|
-
};
|
|
29
|
-
/**
|
|
30
|
-
* @class MQHeader
|
|
31
|
-
*/
|
|
32
|
-
class MQHeaderClass extends value_js_1.Value {
|
|
33
|
-
toJSON() {
|
|
34
|
-
return (0, objects_1.omitUndefined)({
|
|
35
|
-
...super.toJSON(),
|
|
36
|
-
name: this.name,
|
|
37
|
-
required: this.required,
|
|
38
|
-
deprecated: this.deprecated,
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
generateCodec(codec, options, properties) {
|
|
42
|
-
return (this.type?.generateCodec(codec, options, {
|
|
43
|
-
...properties,
|
|
44
|
-
designType: this.designType,
|
|
45
|
-
}) || valgen_1.vg.isAny());
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
exports.MQHeader.prototype = MQHeaderClass.prototype;
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MQOperationResponse = void 0;
|
|
4
|
-
const objects_1 = require("@jsopen/objects");
|
|
5
|
-
const document_element_js_1 = require("../common/document-element.js");
|
|
6
|
-
const data_type_js_1 = require("../data-type/data-type.js");
|
|
7
|
-
/**
|
|
8
|
-
* @class MQOperationResponse
|
|
9
|
-
*/
|
|
10
|
-
class MQOperationResponse extends document_element_js_1.DocumentElement {
|
|
11
|
-
constructor(owner, initArgs) {
|
|
12
|
-
super(owner);
|
|
13
|
-
this.headers = [];
|
|
14
|
-
this.channel = initArgs?.channel;
|
|
15
|
-
this.description = initArgs?.description;
|
|
16
|
-
if (initArgs?.type) {
|
|
17
|
-
this.type =
|
|
18
|
-
initArgs?.type instanceof data_type_js_1.DataType
|
|
19
|
-
? initArgs.type
|
|
20
|
-
: this.owner.node.getDataType(initArgs.type);
|
|
21
|
-
}
|
|
22
|
-
else
|
|
23
|
-
this.type = this.owner.node.getDataType('any');
|
|
24
|
-
if (initArgs?.keyType) {
|
|
25
|
-
this.keyType =
|
|
26
|
-
initArgs?.keyType instanceof data_type_js_1.DataType
|
|
27
|
-
? initArgs.keyType
|
|
28
|
-
: this.owner.node.getDataType(initArgs.keyType);
|
|
29
|
-
}
|
|
30
|
-
this.designType = initArgs?.designType;
|
|
31
|
-
this.keyDesignType = initArgs?.keyDesignType;
|
|
32
|
-
}
|
|
33
|
-
findHeader(paramName) {
|
|
34
|
-
const paramNameLower = paramName.toLowerCase();
|
|
35
|
-
let prm;
|
|
36
|
-
for (prm of this.headers) {
|
|
37
|
-
if (typeof prm.name === 'string') {
|
|
38
|
-
prm._nameLower = prm._nameLower || prm.name.toLowerCase();
|
|
39
|
-
if (prm._nameLower === paramNameLower)
|
|
40
|
-
return prm;
|
|
41
|
-
}
|
|
42
|
-
if (prm.name instanceof RegExp && prm.name.test(paramName))
|
|
43
|
-
return prm;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
toJSON() {
|
|
47
|
-
const out = (0, objects_1.omitUndefined)({
|
|
48
|
-
description: this.description,
|
|
49
|
-
channel: this.channel,
|
|
50
|
-
type: this.type.name ? this.type.name : this.type.toJSON(),
|
|
51
|
-
keyType: this.keyType
|
|
52
|
-
? this.keyType.name
|
|
53
|
-
? this.keyType.name
|
|
54
|
-
: this.keyType.toJSON()
|
|
55
|
-
: undefined,
|
|
56
|
-
});
|
|
57
|
-
if (this.headers.length) {
|
|
58
|
-
out.headers = [];
|
|
59
|
-
for (const prm of this.headers) {
|
|
60
|
-
out.headers.push(prm.toJSON());
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
return out;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
exports.MQOperationResponse = MQOperationResponse;
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MQOperation = void 0;
|
|
4
|
-
const objects_1 = require("@jsopen/objects");
|
|
5
|
-
const ts_gems_1 = require("ts-gems");
|
|
6
|
-
const valgen_1 = require("valgen");
|
|
7
|
-
const index_js_1 = require("../../schema/index.js");
|
|
8
|
-
const data_type_map_js_1 = require("../common/data-type-map.js");
|
|
9
|
-
const document_element_js_1 = require("../common/document-element.js");
|
|
10
|
-
const constants_js_1 = require("../constants.js");
|
|
11
|
-
const data_type_js_1 = require("../data-type/data-type.js");
|
|
12
|
-
const mq_operation_decorator_js_1 = require("../decorators/mq-operation.decorator.js");
|
|
13
|
-
/**
|
|
14
|
-
* MQOperation
|
|
15
|
-
*/
|
|
16
|
-
exports.MQOperation = function (...args) {
|
|
17
|
-
// Decorator
|
|
18
|
-
if (!this) {
|
|
19
|
-
const [type, options] = args;
|
|
20
|
-
const decoratorChain = [];
|
|
21
|
-
return exports.MQOperation[constants_js_1.DECORATOR].call(undefined, decoratorChain, type, options);
|
|
22
|
-
}
|
|
23
|
-
// Constructor
|
|
24
|
-
const [resource, initArgs] = args;
|
|
25
|
-
document_element_js_1.DocumentElement.call(this, resource);
|
|
26
|
-
if (!constants_js_1.CLASS_NAME_PATTERN.test(initArgs.name))
|
|
27
|
-
throw new TypeError(`Invalid operation name (${initArgs.name})`);
|
|
28
|
-
const _this = (0, ts_gems_1.asMutable)(this);
|
|
29
|
-
_this.headers = [];
|
|
30
|
-
_this.types = _this.node[constants_js_1.kDataTypeMap] = new data_type_map_js_1.DataTypeMap();
|
|
31
|
-
_this.name = initArgs.name;
|
|
32
|
-
_this.description = initArgs.description;
|
|
33
|
-
_this.channel = initArgs.channel;
|
|
34
|
-
if (initArgs?.type) {
|
|
35
|
-
_this.type =
|
|
36
|
-
initArgs?.type instanceof data_type_js_1.DataType
|
|
37
|
-
? initArgs.type
|
|
38
|
-
: _this.owner.node.getDataType(initArgs.type);
|
|
39
|
-
}
|
|
40
|
-
if (initArgs?.keyType) {
|
|
41
|
-
_this.keyType =
|
|
42
|
-
initArgs?.keyType instanceof data_type_js_1.DataType
|
|
43
|
-
? initArgs.keyType
|
|
44
|
-
: _this.owner.node.getDataType(initArgs.keyType);
|
|
45
|
-
}
|
|
46
|
-
_this.designType = initArgs.designType;
|
|
47
|
-
_this.keyDesignType = initArgs.keyDesignType;
|
|
48
|
-
};
|
|
49
|
-
/**
|
|
50
|
-
* @class MQOperation
|
|
51
|
-
*/
|
|
52
|
-
class MQOperationClass extends document_element_js_1.DocumentElement {
|
|
53
|
-
findHeader(paramName) {
|
|
54
|
-
const paramNameLower = paramName.toLowerCase();
|
|
55
|
-
let prm;
|
|
56
|
-
for (prm of this.headers) {
|
|
57
|
-
if (typeof prm.name === 'string') {
|
|
58
|
-
prm._nameLower = prm._nameLower || prm.name.toLowerCase();
|
|
59
|
-
if (prm._nameLower === paramNameLower)
|
|
60
|
-
return prm;
|
|
61
|
-
}
|
|
62
|
-
if (prm.name instanceof RegExp && prm.name.test(paramName))
|
|
63
|
-
return prm;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
toJSON() {
|
|
67
|
-
const out = (0, objects_1.omitUndefined)({
|
|
68
|
-
kind: index_js_1.OpraSchema.MQOperation.Kind,
|
|
69
|
-
description: this.description,
|
|
70
|
-
channel: this.channel,
|
|
71
|
-
type: this.type.name ? this.type.name : this.type.toJSON(),
|
|
72
|
-
keyType: this.keyType
|
|
73
|
-
? this.keyType.name
|
|
74
|
-
? this.keyType.name
|
|
75
|
-
: this.keyType.toJSON()
|
|
76
|
-
: undefined,
|
|
77
|
-
response: this.response?.toJSON(),
|
|
78
|
-
});
|
|
79
|
-
if (this.headers.length) {
|
|
80
|
-
out.headers = [];
|
|
81
|
-
for (const prm of this.headers) {
|
|
82
|
-
out.headers.push(prm.toJSON());
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
return out;
|
|
86
|
-
}
|
|
87
|
-
generateCodec(codec, options, properties) {
|
|
88
|
-
return (this.type?.generateCodec(codec, options, {
|
|
89
|
-
...properties,
|
|
90
|
-
designType: this.designType,
|
|
91
|
-
}) || valgen_1.vg.isAny());
|
|
92
|
-
}
|
|
93
|
-
generateKeyCodec(codec, options, properties) {
|
|
94
|
-
return (this.keyType?.generateCodec(codec, options, {
|
|
95
|
-
...properties,
|
|
96
|
-
designType: this.keyDesignType,
|
|
97
|
-
}) || valgen_1.vg.isAny());
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
exports.MQOperation.prototype = MQOperationClass.prototype;
|
|
101
|
-
exports.MQOperation[constants_js_1.DECORATOR] = mq_operation_decorator_js_1.MQOperationDecoratorFactory;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.colorFgMagenta = exports.colorFgYellow = exports.colorReset = exports.nodeInspectCustom = void 0;
|
|
4
|
-
exports.nodeInspectCustom = Symbol.for('nodejs.util.inspect.custom');
|
|
5
|
-
exports.colorReset = '\x1b[0m';
|
|
6
|
-
exports.colorFgYellow = '\x1b[33m';
|
|
7
|
-
exports.colorFgMagenta = '\x1b[35m';
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.parseRegExp = parseRegExp;
|
|
4
|
-
function parseRegExp(str, options) {
|
|
5
|
-
const i = str.lastIndexOf('/');
|
|
6
|
-
if (str.startsWith('/') && i) {
|
|
7
|
-
const s = str.substring(1, i);
|
|
8
|
-
let flags = str.substring(i + 1);
|
|
9
|
-
if (options?.includeFlags) {
|
|
10
|
-
for (const f of options.includeFlags)
|
|
11
|
-
if (!flags.includes(f))
|
|
12
|
-
flags += f;
|
|
13
|
-
}
|
|
14
|
-
if (options?.excludeFlags) {
|
|
15
|
-
for (const f of options.excludeFlags)
|
|
16
|
-
flags.replace(f, '');
|
|
17
|
-
}
|
|
18
|
-
return new RegExp(s, flags);
|
|
19
|
-
}
|
|
20
|
-
throw new TypeError(`"${str}" is not a valid RegExp string`);
|
|
21
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.testScopeMatch = testScopeMatch;
|
|
4
|
-
function testScopeMatch(scope, pattern) {
|
|
5
|
-
if (!pattern || scope === '*')
|
|
6
|
-
return true;
|
|
7
|
-
if (!scope)
|
|
8
|
-
return false;
|
|
9
|
-
if (Array.isArray(pattern)) {
|
|
10
|
-
return pattern.some(x => {
|
|
11
|
-
return typeof x === 'string' ? scope === x : x.test(scope);
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
return typeof pattern === 'string' ? scope === pattern : pattern.test(scope);
|
|
15
|
-
}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.WSApi = void 0;
|
|
4
|
-
const index_js_1 = require("../../helpers/index.js");
|
|
5
|
-
const api_base_js_1 = require("../common/api-base.js");
|
|
6
|
-
/**
|
|
7
|
-
* @class WSApi
|
|
8
|
-
*/
|
|
9
|
-
class WSApi extends api_base_js_1.ApiBase {
|
|
10
|
-
constructor(init) {
|
|
11
|
-
super(init);
|
|
12
|
-
// noinspection JSUnusedGlobalSymbols
|
|
13
|
-
this._controllerReverseMap = new WeakMap();
|
|
14
|
-
this.transport = 'ws';
|
|
15
|
-
this.controllers = new index_js_1.ResponsiveMap();
|
|
16
|
-
}
|
|
17
|
-
findController(arg0) {
|
|
18
|
-
if (typeof arg0 === 'function') {
|
|
19
|
-
/** Check for cached mapping */
|
|
20
|
-
const controller = this._controllerReverseMap.get(arg0);
|
|
21
|
-
if (controller != null)
|
|
22
|
-
return controller;
|
|
23
|
-
/** Lookup for ctor in all controllers */
|
|
24
|
-
for (const c of this.controllers.values()) {
|
|
25
|
-
if (c.ctor === arg0) {
|
|
26
|
-
this._controllerReverseMap.set(arg0, c);
|
|
27
|
-
return c;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
this._controllerReverseMap.set(arg0, null);
|
|
31
|
-
return;
|
|
32
|
-
}
|
|
33
|
-
return this.controllers.get(arg0);
|
|
34
|
-
}
|
|
35
|
-
findOperation(arg0, operationName) {
|
|
36
|
-
const controller = this.findController(arg0);
|
|
37
|
-
return controller?.operations.get(operationName);
|
|
38
|
-
}
|
|
39
|
-
toJSON() {
|
|
40
|
-
const schema = super.toJSON();
|
|
41
|
-
const out = {
|
|
42
|
-
...schema,
|
|
43
|
-
transport: this.transport,
|
|
44
|
-
controllers: {},
|
|
45
|
-
};
|
|
46
|
-
for (const v of this.controllers.values()) {
|
|
47
|
-
out.controllers[v.name] = v.toJSON();
|
|
48
|
-
}
|
|
49
|
-
return out;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
exports.WSApi = WSApi;
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.WSController = void 0;
|
|
4
|
-
const objects_1 = require("@jsopen/objects");
|
|
5
|
-
const ts_gems_1 = require("ts-gems");
|
|
6
|
-
const index_js_1 = require("../../helpers/index.js");
|
|
7
|
-
const index_js_2 = require("../../schema/index.js");
|
|
8
|
-
const data_type_map_js_1 = require("../common/data-type-map.js");
|
|
9
|
-
const document_element_js_1 = require("../common/document-element.js");
|
|
10
|
-
const constants_js_1 = require("../constants.js");
|
|
11
|
-
const ws_controller_decorator_js_1 = require("../decorators/ws-controller.decorator.js");
|
|
12
|
-
const inspect_util_js_1 = require("../utils/inspect.util.js");
|
|
13
|
-
/**
|
|
14
|
-
* WSController
|
|
15
|
-
*/
|
|
16
|
-
exports.WSController = function (...args) {
|
|
17
|
-
// ClassDecorator
|
|
18
|
-
if (!this)
|
|
19
|
-
return exports.WSController[constants_js_1.DECORATOR].apply(undefined, args);
|
|
20
|
-
// Constructor
|
|
21
|
-
const [owner, initArgs] = args;
|
|
22
|
-
document_element_js_1.DocumentElement.call(this, owner);
|
|
23
|
-
if (!constants_js_1.CLASS_NAME_PATTERN.test(initArgs.name))
|
|
24
|
-
throw new TypeError(`Invalid resource name (${initArgs.name})`);
|
|
25
|
-
const _this = (0, ts_gems_1.asMutable)(this);
|
|
26
|
-
_this.kind = index_js_2.OpraSchema.WSController.Kind;
|
|
27
|
-
_this.types = _this.node[constants_js_1.kDataTypeMap] = new data_type_map_js_1.DataTypeMap();
|
|
28
|
-
_this.operations = new index_js_1.ResponsiveMap();
|
|
29
|
-
_this.name = initArgs.name;
|
|
30
|
-
_this.description = initArgs.description;
|
|
31
|
-
_this.instance = initArgs.instance;
|
|
32
|
-
_this.ctor = initArgs.ctor;
|
|
33
|
-
_this._controllerReverseMap = new WeakMap();
|
|
34
|
-
_this._initialize?.(initArgs);
|
|
35
|
-
};
|
|
36
|
-
/**
|
|
37
|
-
*
|
|
38
|
-
* @class WSController
|
|
39
|
-
*/
|
|
40
|
-
class WSControllerClass extends document_element_js_1.DocumentElement {
|
|
41
|
-
/**
|
|
42
|
-
*
|
|
43
|
-
*/
|
|
44
|
-
toString() {
|
|
45
|
-
return `[WSController ${this.name}]`;
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
*
|
|
49
|
-
*/
|
|
50
|
-
toJSON() {
|
|
51
|
-
const out = (0, objects_1.omitUndefined)({
|
|
52
|
-
kind: this.kind,
|
|
53
|
-
description: this.description,
|
|
54
|
-
});
|
|
55
|
-
if (this.operations.size) {
|
|
56
|
-
out.operations = {};
|
|
57
|
-
for (const v of this.operations.values()) {
|
|
58
|
-
out.operations[v.name] = v.toJSON();
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
if (this.types.size) {
|
|
62
|
-
out.types = {};
|
|
63
|
-
for (const v of this.types.values()) {
|
|
64
|
-
out.types[v.name] = v.toJSON();
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
return out;
|
|
68
|
-
}
|
|
69
|
-
/**
|
|
70
|
-
*
|
|
71
|
-
*/
|
|
72
|
-
[inspect_util_js_1.nodeInspectCustom]() {
|
|
73
|
-
return `[${inspect_util_js_1.colorFgYellow}WSController${inspect_util_js_1.colorFgMagenta + this.name + inspect_util_js_1.colorReset}]`;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
exports.WSController.prototype = WSControllerClass.prototype;
|
|
77
|
-
Object.assign(exports.WSController, ws_controller_decorator_js_1.WSControllerDecoratorFactory);
|
|
78
|
-
exports.WSController[constants_js_1.DECORATOR] = ws_controller_decorator_js_1.WSControllerDecoratorFactory;
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.WSOperation = void 0;
|
|
4
|
-
const objects_1 = require("@jsopen/objects");
|
|
5
|
-
const ts_gems_1 = require("ts-gems");
|
|
6
|
-
const index_js_1 = require("../../schema/index.js");
|
|
7
|
-
const data_type_map_js_1 = require("../common/data-type-map.js");
|
|
8
|
-
const document_element_js_1 = require("../common/document-element.js");
|
|
9
|
-
const constants_js_1 = require("../constants.js");
|
|
10
|
-
const data_type_js_1 = require("../data-type/data-type.js");
|
|
11
|
-
const ws_operation_decorator_js_1 = require("../decorators/ws-operation.decorator.js");
|
|
12
|
-
const parse_regexp_util_js_1 = require("../utils/parse-regexp.util.js");
|
|
13
|
-
/**
|
|
14
|
-
* WSOperation
|
|
15
|
-
*/
|
|
16
|
-
exports.WSOperation = function (...args) {
|
|
17
|
-
// Decorator
|
|
18
|
-
if (!this) {
|
|
19
|
-
const [type, options] = args;
|
|
20
|
-
const decoratorChain = [];
|
|
21
|
-
return exports.WSOperation[constants_js_1.DECORATOR].call(undefined, decoratorChain, type, options);
|
|
22
|
-
}
|
|
23
|
-
// Constructor
|
|
24
|
-
const [resource, initArgs] = args;
|
|
25
|
-
document_element_js_1.DocumentElement.call(this, resource);
|
|
26
|
-
if (!constants_js_1.CLASS_NAME_PATTERN.test(initArgs.name))
|
|
27
|
-
throw new TypeError(`Invalid operation name (${initArgs.name})`);
|
|
28
|
-
const _this = (0, ts_gems_1.asMutable)(this);
|
|
29
|
-
_this.types = _this.node[constants_js_1.kDataTypeMap] = new data_type_map_js_1.DataTypeMap();
|
|
30
|
-
_this.name = initArgs.name;
|
|
31
|
-
_this.description = initArgs.description;
|
|
32
|
-
if (initArgs.event)
|
|
33
|
-
this.event =
|
|
34
|
-
initArgs.event instanceof RegExp
|
|
35
|
-
? initArgs.event
|
|
36
|
-
: initArgs.event.startsWith('/')
|
|
37
|
-
? (0, parse_regexp_util_js_1.parseRegExp)(initArgs.event)
|
|
38
|
-
: initArgs.event;
|
|
39
|
-
else
|
|
40
|
-
_this.event = this.name;
|
|
41
|
-
if (initArgs?.arguments) {
|
|
42
|
-
_this.arguments = initArgs.arguments.map(arg => arg instanceof data_type_js_1.DataType ? arg : _this.owner.node.getDataType(arg));
|
|
43
|
-
}
|
|
44
|
-
if (initArgs?.response)
|
|
45
|
-
_this.response =
|
|
46
|
-
initArgs.response instanceof data_type_js_1.DataType
|
|
47
|
-
? initArgs.response
|
|
48
|
-
: _this.owner.node.getDataType(initArgs.response);
|
|
49
|
-
};
|
|
50
|
-
/**
|
|
51
|
-
* @class WSOperation
|
|
52
|
-
*/
|
|
53
|
-
class WSOperationClass extends document_element_js_1.DocumentElement {
|
|
54
|
-
toJSON() {
|
|
55
|
-
return (0, objects_1.omitUndefined)({
|
|
56
|
-
kind: index_js_1.OpraSchema.WSOperation.Kind,
|
|
57
|
-
description: this.description,
|
|
58
|
-
event: this.event,
|
|
59
|
-
arguments: this.arguments?.map(arg => arg.name ? arg.name : arg.toJSON()),
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
exports.WSOperation.prototype = WSOperationClass.prototype;
|
|
64
|
-
exports.WSOperation[constants_js_1.DECORATOR] = ws_operation_decorator_js_1.WSOperationDecoratorFactory;
|