@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,159 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.HttpController = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const node_path_1 = tslib_1.__importDefault(require("node:path"));
|
|
6
|
-
const objects_1 = require("@jsopen/objects");
|
|
7
|
-
const ts_gems_1 = require("ts-gems");
|
|
8
|
-
const index_js_1 = require("../../helpers/index.js");
|
|
9
|
-
const index_js_2 = require("../../schema/index.js");
|
|
10
|
-
const data_type_map_js_1 = require("../common/data-type-map.js");
|
|
11
|
-
const document_element_js_1 = require("../common/document-element.js");
|
|
12
|
-
const constants_js_1 = require("../constants.js");
|
|
13
|
-
const http_controller_decorator_js_1 = require("../decorators/http-controller.decorator.js");
|
|
14
|
-
const inspect_util_js_1 = require("../utils/inspect.util.js");
|
|
15
|
-
/**
|
|
16
|
-
* HttpController
|
|
17
|
-
*/
|
|
18
|
-
exports.HttpController = function (...args) {
|
|
19
|
-
// ClassDecorator
|
|
20
|
-
if (!this)
|
|
21
|
-
return exports.HttpController[constants_js_1.DECORATOR].apply(undefined, args);
|
|
22
|
-
// Constructor
|
|
23
|
-
const [owner, initArgs] = args;
|
|
24
|
-
document_element_js_1.DocumentElement.call(this, owner);
|
|
25
|
-
if (!constants_js_1.CLASS_NAME_PATTERN.test(initArgs.name))
|
|
26
|
-
throw new TypeError(`Invalid resource name (${initArgs.name})`);
|
|
27
|
-
const _this = (0, ts_gems_1.asMutable)(this);
|
|
28
|
-
_this.kind = index_js_2.OpraSchema.HttpController.Kind;
|
|
29
|
-
_this.types = _this.node[constants_js_1.kDataTypeMap] = new data_type_map_js_1.DataTypeMap();
|
|
30
|
-
_this.operations = new index_js_1.ResponsiveMap();
|
|
31
|
-
_this.controllers = new index_js_1.ResponsiveMap();
|
|
32
|
-
_this.parameters = [];
|
|
33
|
-
_this.name = initArgs.name;
|
|
34
|
-
_this.description = initArgs.description;
|
|
35
|
-
_this.path = initArgs.path ?? initArgs.name;
|
|
36
|
-
_this.instance = initArgs.instance;
|
|
37
|
-
_this.ctor = initArgs.ctor;
|
|
38
|
-
_this._controllerReverseMap = new WeakMap();
|
|
39
|
-
_this._initialize?.(initArgs);
|
|
40
|
-
};
|
|
41
|
-
/**
|
|
42
|
-
*
|
|
43
|
-
* @class HttpController
|
|
44
|
-
*/
|
|
45
|
-
class HttpControllerClass extends document_element_js_1.DocumentElement {
|
|
46
|
-
/**
|
|
47
|
-
* @property isRoot
|
|
48
|
-
*/
|
|
49
|
-
get isRoot() {
|
|
50
|
-
return !(this.owner instanceof exports.HttpController);
|
|
51
|
-
}
|
|
52
|
-
findController(arg0) {
|
|
53
|
-
if (typeof arg0 === 'function') {
|
|
54
|
-
/** Check for cached mapping */
|
|
55
|
-
let controller = this._controllerReverseMap.get(arg0);
|
|
56
|
-
if (controller != null)
|
|
57
|
-
return controller;
|
|
58
|
-
/** Lookup for ctor in all controllers */
|
|
59
|
-
for (const c of this.controllers.values()) {
|
|
60
|
-
if (c.ctor === arg0) {
|
|
61
|
-
this._controllerReverseMap.set(arg0, c);
|
|
62
|
-
return c;
|
|
63
|
-
}
|
|
64
|
-
if (c.controllers.size) {
|
|
65
|
-
controller = c.findController(arg0);
|
|
66
|
-
if (controller) {
|
|
67
|
-
this._controllerReverseMap.set(arg0, controller);
|
|
68
|
-
return controller;
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
this._controllerReverseMap.set(arg0, null);
|
|
73
|
-
return;
|
|
74
|
-
}
|
|
75
|
-
if (arg0.startsWith('/'))
|
|
76
|
-
arg0 = arg0.substring(1);
|
|
77
|
-
if (arg0.includes('/')) {
|
|
78
|
-
const a = arg0.split('/');
|
|
79
|
-
let r = this;
|
|
80
|
-
while (r && a.length > 0) {
|
|
81
|
-
r = r.controllers.get(a.shift());
|
|
82
|
-
}
|
|
83
|
-
return r;
|
|
84
|
-
}
|
|
85
|
-
return this.controllers.get(arg0);
|
|
86
|
-
}
|
|
87
|
-
findParameter(paramName, location) {
|
|
88
|
-
const paramNameLower = paramName.toLowerCase();
|
|
89
|
-
let prm;
|
|
90
|
-
for (prm of this.parameters) {
|
|
91
|
-
if (location && location !== prm.location)
|
|
92
|
-
continue;
|
|
93
|
-
if (typeof prm.name === 'string') {
|
|
94
|
-
prm._nameLower = prm._nameLower || prm.name.toLowerCase();
|
|
95
|
-
if (prm._nameLower === paramNameLower)
|
|
96
|
-
return prm;
|
|
97
|
-
}
|
|
98
|
-
if (prm.name instanceof RegExp && prm.name.test(paramName))
|
|
99
|
-
return prm;
|
|
100
|
-
}
|
|
101
|
-
if (this.node.parent &&
|
|
102
|
-
this.node.parent.element instanceof exports.HttpController) {
|
|
103
|
-
return this.node.parent.element.findParameter(paramName, location);
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
getFullUrl() {
|
|
107
|
-
return node_path_1.default.posix.join(this.owner instanceof exports.HttpController ? this.owner.getFullUrl() : '/', this.path);
|
|
108
|
-
}
|
|
109
|
-
/**
|
|
110
|
-
*
|
|
111
|
-
*/
|
|
112
|
-
toString() {
|
|
113
|
-
return `[HttpController ${this.name}]`;
|
|
114
|
-
}
|
|
115
|
-
/**
|
|
116
|
-
*
|
|
117
|
-
*/
|
|
118
|
-
toJSON(options) {
|
|
119
|
-
const out = (0, objects_1.omitUndefined)({
|
|
120
|
-
kind: this.kind,
|
|
121
|
-
description: this.description,
|
|
122
|
-
path: this.path,
|
|
123
|
-
});
|
|
124
|
-
if (this.operations.size) {
|
|
125
|
-
out.operations = {};
|
|
126
|
-
for (const v of this.operations.values()) {
|
|
127
|
-
out.operations[v.name] = v.toJSON(options);
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
if (this.controllers.size) {
|
|
131
|
-
out.controllers = {};
|
|
132
|
-
for (const v of this.controllers.values()) {
|
|
133
|
-
out.controllers[v.name] = v.toJSON(options);
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
if (this.types.size) {
|
|
137
|
-
out.types = {};
|
|
138
|
-
for (const v of this.types.values()) {
|
|
139
|
-
out.types[v.name] = v.toJSON(options);
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
if (this.parameters.length) {
|
|
143
|
-
out.parameters = [];
|
|
144
|
-
for (const prm of this.parameters) {
|
|
145
|
-
out.parameters.push(prm.toJSON(options));
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
return out;
|
|
149
|
-
}
|
|
150
|
-
/**
|
|
151
|
-
*
|
|
152
|
-
*/
|
|
153
|
-
[inspect_util_js_1.nodeInspectCustom]() {
|
|
154
|
-
return `[${inspect_util_js_1.colorFgYellow}HttpController${inspect_util_js_1.colorFgMagenta + this.name + inspect_util_js_1.colorReset}]`;
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
exports.HttpController.prototype = HttpControllerClass.prototype;
|
|
158
|
-
Object.assign(exports.HttpController, http_controller_decorator_js_1.HttpControllerDecoratorFactory);
|
|
159
|
-
exports.HttpController[constants_js_1.DECORATOR] = http_controller_decorator_js_1.HttpControllerDecoratorFactory;
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.HttpMediaType = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const type_is_1 = tslib_1.__importDefault(require("@browsery/type-is"));
|
|
6
|
-
const objects_1 = require("@jsopen/objects");
|
|
7
|
-
const ts_gems_1 = require("ts-gems");
|
|
8
|
-
const valgen_1 = require("valgen");
|
|
9
|
-
const document_element_js_1 = require("../common/document-element.js");
|
|
10
|
-
const array_type_js_1 = require("../data-type/array-type.js");
|
|
11
|
-
const data_type_js_1 = require("../data-type/data-type.js");
|
|
12
|
-
exports.HttpMediaType = function (owner, initArgs) {
|
|
13
|
-
if (!this)
|
|
14
|
-
throw new TypeError('"this" should be passed to call class constructor');
|
|
15
|
-
document_element_js_1.DocumentElement.call(this, owner);
|
|
16
|
-
const _this = (0, ts_gems_1.asMutable)(this);
|
|
17
|
-
if (initArgs.contentType) {
|
|
18
|
-
let arr = Array.isArray(initArgs.contentType)
|
|
19
|
-
? initArgs.contentType
|
|
20
|
-
: [initArgs.contentType];
|
|
21
|
-
arr = arr.map(x => x.split(/\s*,\s*/)).flat();
|
|
22
|
-
_this.contentType = arr.length > 1 ? arr : arr[0];
|
|
23
|
-
}
|
|
24
|
-
_this.description = initArgs.description;
|
|
25
|
-
_this.contentEncoding = initArgs.contentEncoding;
|
|
26
|
-
_this.examples = initArgs.examples;
|
|
27
|
-
_this.multipartFields = [];
|
|
28
|
-
_this.maxFieldsSize = initArgs.maxFieldsSize;
|
|
29
|
-
_this.maxFields = initArgs.maxFields;
|
|
30
|
-
_this.maxFiles = initArgs.maxFiles;
|
|
31
|
-
_this.maxFileSize = initArgs.maxFileSize;
|
|
32
|
-
_this.maxTotalFileSize = initArgs.maxTotalFileSize;
|
|
33
|
-
if (initArgs?.type) {
|
|
34
|
-
_this.type =
|
|
35
|
-
initArgs?.type instanceof data_type_js_1.DataType
|
|
36
|
-
? initArgs.type
|
|
37
|
-
: _this.owner.node.getDataType(initArgs.type);
|
|
38
|
-
}
|
|
39
|
-
_this.isArray = initArgs.isArray;
|
|
40
|
-
_this.designType = initArgs.designType;
|
|
41
|
-
};
|
|
42
|
-
/**
|
|
43
|
-
* @class HttpMediaType
|
|
44
|
-
*/
|
|
45
|
-
class HttpMediaTypeClass extends document_element_js_1.DocumentElement {
|
|
46
|
-
findMultipartField(fieldName, fieldType) {
|
|
47
|
-
if (!this.multipartFields)
|
|
48
|
-
return;
|
|
49
|
-
for (const f of this.multipartFields) {
|
|
50
|
-
if ((!fieldType || fieldType === f.fieldType) &&
|
|
51
|
-
((f.fieldName instanceof RegExp && f.fieldName.test(fieldName)) ||
|
|
52
|
-
f.fieldName === fieldName)) {
|
|
53
|
-
return f;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
toJSON(options) {
|
|
58
|
-
const typeName = this.type
|
|
59
|
-
? this.node.getDataTypeNameWithNs(this.type)
|
|
60
|
-
: undefined;
|
|
61
|
-
const out = (0, objects_1.omitUndefined)({
|
|
62
|
-
description: this.description,
|
|
63
|
-
contentType: this.contentType,
|
|
64
|
-
contentEncoding: this.contentEncoding,
|
|
65
|
-
type: typeName ? typeName : this.type?.toJSON(options),
|
|
66
|
-
isArray: this.isArray,
|
|
67
|
-
example: this.example,
|
|
68
|
-
examples: this.examples,
|
|
69
|
-
maxFields: this.maxFields,
|
|
70
|
-
maxFieldsSize: this.maxFieldsSize,
|
|
71
|
-
maxFiles: this.maxFiles,
|
|
72
|
-
maxFileSize: this.maxFileSize,
|
|
73
|
-
maxTotalFileSize: this.maxTotalFileSize,
|
|
74
|
-
});
|
|
75
|
-
if (this.multipartFields?.length) {
|
|
76
|
-
out.multipartFields = this.multipartFields.map(x => x.toJSON(options));
|
|
77
|
-
}
|
|
78
|
-
return out;
|
|
79
|
-
}
|
|
80
|
-
generateCodec(codec, options, properties) {
|
|
81
|
-
let fn;
|
|
82
|
-
if (this.type) {
|
|
83
|
-
fn = this.type.generateCodec(codec, options, {
|
|
84
|
-
designType: this.designType,
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
else if (this.contentType) {
|
|
88
|
-
const arr = Array.isArray(this.contentType)
|
|
89
|
-
? this.contentType
|
|
90
|
-
: [this.contentType];
|
|
91
|
-
if (arr.find(ct => type_is_1.default.is(ct, ['json']))) {
|
|
92
|
-
fn = this.node.findDataType('object').generateCodec(codec, options, {
|
|
93
|
-
...properties,
|
|
94
|
-
designType: this.designType,
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
fn = fn || valgen_1.isAny;
|
|
99
|
-
return this.isArray && !(this.type instanceof array_type_js_1.ArrayType)
|
|
100
|
-
? valgen_1.vg.isArray(fn)
|
|
101
|
-
: fn;
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
exports.HttpMediaType.prototype = HttpMediaTypeClass.prototype;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.HttpMultipartField = void 0;
|
|
4
|
-
const objects_1 = require("@jsopen/objects");
|
|
5
|
-
const parse_regexp_util_js_1 = require("../utils/parse-regexp.util.js");
|
|
6
|
-
const http_media_type_js_1 = require("./http-media-type.js");
|
|
7
|
-
/**
|
|
8
|
-
*
|
|
9
|
-
* @class HttpMultipartField
|
|
10
|
-
*/
|
|
11
|
-
class HttpMultipartField extends http_media_type_js_1.HttpMediaType {
|
|
12
|
-
constructor(owner, initArgs) {
|
|
13
|
-
super(owner, initArgs);
|
|
14
|
-
this.fieldName =
|
|
15
|
-
initArgs.fieldName instanceof RegExp
|
|
16
|
-
? initArgs.fieldName
|
|
17
|
-
: initArgs.fieldName.startsWith('/')
|
|
18
|
-
? (0, parse_regexp_util_js_1.parseRegExp)(initArgs.fieldName)
|
|
19
|
-
: initArgs.fieldName;
|
|
20
|
-
this.fieldType = initArgs.fieldType;
|
|
21
|
-
this.required = initArgs.required;
|
|
22
|
-
}
|
|
23
|
-
toJSON(options) {
|
|
24
|
-
return (0, objects_1.omitUndefined)({
|
|
25
|
-
fieldName: this.fieldName,
|
|
26
|
-
fieldType: this.fieldType,
|
|
27
|
-
required: this.required,
|
|
28
|
-
...super.toJSON(options),
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
exports.HttpMultipartField = HttpMultipartField;
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.HttpOperationResponse = void 0;
|
|
4
|
-
const objects_1 = require("@jsopen/objects");
|
|
5
|
-
const http_media_type_js_1 = require("./http-media-type.js");
|
|
6
|
-
const http_status_range_js_1 = require("./http-status-range.js");
|
|
7
|
-
/**
|
|
8
|
-
* @class HttpOperationResponse
|
|
9
|
-
*/
|
|
10
|
-
class HttpOperationResponse extends http_media_type_js_1.HttpMediaType {
|
|
11
|
-
constructor(owner, init) {
|
|
12
|
-
super(owner, init);
|
|
13
|
-
this.parameters = [];
|
|
14
|
-
this.statusCode = (Array.isArray(init.statusCode) ? init.statusCode : [init.statusCode]).map(x => typeof x === 'object'
|
|
15
|
-
? new http_status_range_js_1.HttpStatusRange(x.start, x.end)
|
|
16
|
-
: new http_status_range_js_1.HttpStatusRange(x));
|
|
17
|
-
this.partial = init.partial;
|
|
18
|
-
}
|
|
19
|
-
findParameter(paramName, location) {
|
|
20
|
-
paramName = paramName.toLowerCase();
|
|
21
|
-
for (const prm of this.parameters) {
|
|
22
|
-
if ((!location || location === prm.location) &&
|
|
23
|
-
((prm.name instanceof RegExp && prm.name.test(paramName)) ||
|
|
24
|
-
prm.name === paramName)) {
|
|
25
|
-
return prm;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
toJSON(options) {
|
|
30
|
-
const statusCode = this.statusCode.map(x => x.toJSON());
|
|
31
|
-
const out = (0, objects_1.omitUndefined)({
|
|
32
|
-
...super.toJSON(options),
|
|
33
|
-
statusCode: statusCode.length === 1 && typeof statusCode[0] === 'number'
|
|
34
|
-
? statusCode[0]
|
|
35
|
-
: statusCode,
|
|
36
|
-
partial: this.partial,
|
|
37
|
-
});
|
|
38
|
-
if (this.parameters.length) {
|
|
39
|
-
out.parameters = [];
|
|
40
|
-
for (const prm of this.parameters) {
|
|
41
|
-
out.parameters.push(prm.toJSON(options));
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
return out;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
exports.HttpOperationResponse = HttpOperationResponse;
|
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.HttpOperation = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const node_path_1 = tslib_1.__importDefault(require("node:path"));
|
|
6
|
-
const objects_1 = require("@jsopen/objects");
|
|
7
|
-
const ts_gems_1 = require("ts-gems");
|
|
8
|
-
const index_js_1 = require("../../helpers/index.js");
|
|
9
|
-
const index_js_2 = require("../../schema/index.js");
|
|
10
|
-
const data_type_map_js_1 = require("../common/data-type-map.js");
|
|
11
|
-
const document_element_js_1 = require("../common/document-element.js");
|
|
12
|
-
const constants_js_1 = require("../constants.js");
|
|
13
|
-
const http_operation_decorator_js_1 = require("../decorators/http-operation.decorator.js");
|
|
14
|
-
/**
|
|
15
|
-
* HttpOperation
|
|
16
|
-
*/
|
|
17
|
-
exports.HttpOperation = function (...args) {
|
|
18
|
-
// Decorator
|
|
19
|
-
if (!this) {
|
|
20
|
-
const [options] = args;
|
|
21
|
-
const decoratorChain = [];
|
|
22
|
-
return exports.HttpOperation[constants_js_1.DECORATOR].call(undefined, decoratorChain, options);
|
|
23
|
-
}
|
|
24
|
-
// Constructor
|
|
25
|
-
const [resource, initArgs] = args;
|
|
26
|
-
document_element_js_1.DocumentElement.call(this, resource);
|
|
27
|
-
if (!constants_js_1.CLASS_NAME_PATTERN.test(initArgs.name))
|
|
28
|
-
throw new TypeError(`Invalid operation name (${initArgs.name})`);
|
|
29
|
-
const _this = (0, ts_gems_1.asMutable)(this);
|
|
30
|
-
_this.parameters = [];
|
|
31
|
-
_this.responses = [];
|
|
32
|
-
_this.types = _this.node[constants_js_1.kDataTypeMap] = new data_type_map_js_1.DataTypeMap();
|
|
33
|
-
_this.name = initArgs.name;
|
|
34
|
-
_this.path = initArgs.path;
|
|
35
|
-
_this.mergePath = initArgs.mergePath;
|
|
36
|
-
_this.method = initArgs.method || 'GET';
|
|
37
|
-
_this.description = initArgs.description;
|
|
38
|
-
_this.composition = initArgs.composition;
|
|
39
|
-
_this.compositionOptions = initArgs.compositionOptions
|
|
40
|
-
? (0, index_js_1.cloneObject)(initArgs.compositionOptions)
|
|
41
|
-
: undefined;
|
|
42
|
-
};
|
|
43
|
-
/**
|
|
44
|
-
* @class HttpOperation
|
|
45
|
-
*/
|
|
46
|
-
class HttpOperationClass extends document_element_js_1.DocumentElement {
|
|
47
|
-
findParameter(paramName, location) {
|
|
48
|
-
const paramNameLower = paramName.toLowerCase();
|
|
49
|
-
let prm;
|
|
50
|
-
for (prm of this.parameters) {
|
|
51
|
-
if (location && location !== prm.location)
|
|
52
|
-
continue;
|
|
53
|
-
if (typeof prm.name === 'string') {
|
|
54
|
-
prm._nameLower = prm._nameLower || prm.name.toLowerCase();
|
|
55
|
-
if (prm._nameLower === paramNameLower)
|
|
56
|
-
return prm;
|
|
57
|
-
}
|
|
58
|
-
if (prm.name instanceof RegExp && prm.name.test(paramName))
|
|
59
|
-
return prm;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
getFullUrl() {
|
|
63
|
-
const out = this.owner.getFullUrl();
|
|
64
|
-
if (out) {
|
|
65
|
-
if (this.path) {
|
|
66
|
-
if (this.mergePath)
|
|
67
|
-
return out + this.path;
|
|
68
|
-
return node_path_1.default.posix.join(out, this.path);
|
|
69
|
-
}
|
|
70
|
-
return out;
|
|
71
|
-
}
|
|
72
|
-
return this.path || '/';
|
|
73
|
-
}
|
|
74
|
-
toJSON(options) {
|
|
75
|
-
const out = (0, objects_1.omitUndefined)({
|
|
76
|
-
kind: index_js_2.OpraSchema.HttpOperation.Kind,
|
|
77
|
-
description: this.description,
|
|
78
|
-
method: this.method,
|
|
79
|
-
path: this.path,
|
|
80
|
-
mergePath: this.mergePath,
|
|
81
|
-
composition: this.composition,
|
|
82
|
-
requestBody: this.requestBody?.toJSON(options),
|
|
83
|
-
});
|
|
84
|
-
if (this.types.size) {
|
|
85
|
-
out.types = {};
|
|
86
|
-
for (const v of this.types.values()) {
|
|
87
|
-
out.types[v.name] = v.toJSON(options);
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
if (this.parameters.length) {
|
|
91
|
-
out.parameters = [];
|
|
92
|
-
for (const prm of this.parameters) {
|
|
93
|
-
out.parameters.push(prm.toJSON(options));
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
if (this.responses.length)
|
|
97
|
-
out.responses = this.responses.map(r => r.toJSON(options));
|
|
98
|
-
return out;
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
exports.HttpOperation.prototype = HttpOperationClass.prototype;
|
|
102
|
-
exports.HttpOperation[constants_js_1.DECORATOR] = http_operation_decorator_js_1.HttpOperationDecoratorFactory;
|
|
103
|
-
exports.HttpOperation.GET = function (options) {
|
|
104
|
-
return (0, http_operation_decorator_js_1.HttpOperationDecoratorFactory)([], { ...options, method: 'GET' });
|
|
105
|
-
};
|
|
106
|
-
exports.HttpOperation.DELETE = function (options) {
|
|
107
|
-
return (0, http_operation_decorator_js_1.HttpOperationDecoratorFactory)([], { ...options, method: 'DELETE' });
|
|
108
|
-
};
|
|
109
|
-
exports.HttpOperation.HEAD = function (options) {
|
|
110
|
-
return (0, http_operation_decorator_js_1.HttpOperationDecoratorFactory)([], { ...options, method: 'HEAD' });
|
|
111
|
-
};
|
|
112
|
-
exports.HttpOperation.OPTIONS = function (options) {
|
|
113
|
-
return (0, http_operation_decorator_js_1.HttpOperationDecoratorFactory)([], { ...options, method: 'OPTIONS' });
|
|
114
|
-
};
|
|
115
|
-
exports.HttpOperation.PATCH = function (options) {
|
|
116
|
-
return (0, http_operation_decorator_js_1.HttpOperationDecoratorFactory)([], { ...options, method: 'PATCH' });
|
|
117
|
-
};
|
|
118
|
-
exports.HttpOperation.POST = function (options) {
|
|
119
|
-
return (0, http_operation_decorator_js_1.HttpOperationDecoratorFactory)([], { ...options, method: 'POST' });
|
|
120
|
-
};
|
|
121
|
-
exports.HttpOperation.PUT = function (options) {
|
|
122
|
-
return (0, http_operation_decorator_js_1.HttpOperationDecoratorFactory)([], { ...options, method: 'PUT' });
|
|
123
|
-
};
|
|
124
|
-
exports.HttpOperation.SEARCH = function (options) {
|
|
125
|
-
return (0, http_operation_decorator_js_1.HttpOperationDecoratorFactory)([], { ...options, method: 'SEARCH' });
|
|
126
|
-
};
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.HttpParameter = 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.HttpParameter = 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.location = initArgs.location;
|
|
26
|
-
_this.deprecated = initArgs.deprecated;
|
|
27
|
-
_this.required = initArgs.required;
|
|
28
|
-
if (_this.required == null && initArgs.location === 'path')
|
|
29
|
-
_this.required = true;
|
|
30
|
-
_this.arraySeparator = initArgs.arraySeparator;
|
|
31
|
-
_this.keyParam = initArgs.keyParam;
|
|
32
|
-
_this.parser = initArgs.parser;
|
|
33
|
-
_this.designType = initArgs.designType;
|
|
34
|
-
};
|
|
35
|
-
/**
|
|
36
|
-
* @class HttpParameter
|
|
37
|
-
*/
|
|
38
|
-
class HttpParameterClass extends value_js_1.Value {
|
|
39
|
-
toJSON(options) {
|
|
40
|
-
return (0, objects_1.omitUndefined)({
|
|
41
|
-
...super.toJSON(options),
|
|
42
|
-
name: this.name,
|
|
43
|
-
location: this.location,
|
|
44
|
-
arraySeparator: this.arraySeparator,
|
|
45
|
-
keyParam: this.keyParam,
|
|
46
|
-
required: this.required,
|
|
47
|
-
deprecated: this.deprecated,
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
generateCodec(codec, options, properties) {
|
|
51
|
-
return (this.type?.generateCodec(codec, options, {
|
|
52
|
-
...properties,
|
|
53
|
-
designType: this.designType,
|
|
54
|
-
}) || valgen_1.vg.isAny());
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
exports.HttpParameter.prototype = HttpParameterClass.prototype;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.HttpRequestBody = void 0;
|
|
4
|
-
const objects_1 = require("@jsopen/objects");
|
|
5
|
-
const document_element_js_1 = require("../common/document-element.js");
|
|
6
|
-
/**
|
|
7
|
-
* @class HttpRequestBody
|
|
8
|
-
*/
|
|
9
|
-
class HttpRequestBody extends document_element_js_1.DocumentElement {
|
|
10
|
-
constructor(owner) {
|
|
11
|
-
super(owner);
|
|
12
|
-
this.content = [];
|
|
13
|
-
}
|
|
14
|
-
toJSON(options) {
|
|
15
|
-
return (0, objects_1.omitUndefined)({
|
|
16
|
-
description: this.description,
|
|
17
|
-
required: this.required,
|
|
18
|
-
maxContentSize: this.maxContentSize,
|
|
19
|
-
content: this.content.length
|
|
20
|
-
? this.content.map(x => x.toJSON(options))
|
|
21
|
-
: [],
|
|
22
|
-
partial: this.partial,
|
|
23
|
-
allowPatchOperators: this.allowPatchOperators,
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
exports.HttpRequestBody = HttpRequestBody;
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.HttpStatusRange = void 0;
|
|
4
|
-
const STATUS_RANGE_PATTERN = /^([1-6]\d{2})(?:-([1-6]\d{2}))?$/;
|
|
5
|
-
/**
|
|
6
|
-
* @class HttpStatusRange
|
|
7
|
-
*/
|
|
8
|
-
class HttpStatusRange {
|
|
9
|
-
constructor(arg0, arg1) {
|
|
10
|
-
this.start = 0;
|
|
11
|
-
this.end = 0;
|
|
12
|
-
if (arg0 && typeof arg0 === 'object') {
|
|
13
|
-
this.start = arg0.start || 0;
|
|
14
|
-
this.end = arg0.end || 0;
|
|
15
|
-
}
|
|
16
|
-
if (typeof arg0 === 'number') {
|
|
17
|
-
this.start = arg0;
|
|
18
|
-
this.end = arg1 || this.start;
|
|
19
|
-
}
|
|
20
|
-
if (typeof arg0 === 'string') {
|
|
21
|
-
const m = STATUS_RANGE_PATTERN.exec(arg0);
|
|
22
|
-
if (!m)
|
|
23
|
-
throw new TypeError(`"${arg0}" is not a valid Status Code range`);
|
|
24
|
-
this.start = parseInt(m[1], 10);
|
|
25
|
-
this.end = m[2] ? parseInt(m[2], 10) : this.start;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
includes(statusCode) {
|
|
29
|
-
return statusCode >= this.start && statusCode <= this.end;
|
|
30
|
-
}
|
|
31
|
-
intersects(start, end) {
|
|
32
|
-
return end >= this.start && start <= this.end;
|
|
33
|
-
}
|
|
34
|
-
toString() {
|
|
35
|
-
if (this.start === this.end)
|
|
36
|
-
return String(this.start);
|
|
37
|
-
return String(this.start) + '-' + String(this.end);
|
|
38
|
-
}
|
|
39
|
-
toJSON() {
|
|
40
|
-
return !this.end || this.start === this.end
|
|
41
|
-
? this.start
|
|
42
|
-
: { start: this.start, end: this.end };
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
exports.HttpStatusRange = HttpStatusRange;
|
package/cjs/document/index.js
DELETED
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.classes = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
require("reflect-metadata");
|
|
6
|
-
require("./decorators/http-operation-entity.decorator.js");
|
|
7
|
-
require("./decorators/http-operation-entity-create.decorator.js");
|
|
8
|
-
require("./decorators/http-operation-entity-delete.decorator.js");
|
|
9
|
-
require("./decorators/http-operation-entity-delete-many.decorator.js");
|
|
10
|
-
require("./decorators/http-operation-entity-find-many.decorator.js");
|
|
11
|
-
require("./decorators/http-operation-entity-get.decorator.js");
|
|
12
|
-
require("./decorators/http-operation-entity-replace.decorator.js");
|
|
13
|
-
require("./decorators/http-operation-entity-update.decorator.js");
|
|
14
|
-
require("./decorators/http-operation-entity-update-many.decorator.js");
|
|
15
|
-
const MQControllerDecorator_ = tslib_1.__importStar(require("./decorators/mq-controller.decorator.js"));
|
|
16
|
-
const MQOperationDecorator_ = tslib_1.__importStar(require("./decorators/mq-operation.decorator.js"));
|
|
17
|
-
const WSControllerDecorator_ = tslib_1.__importStar(require("./decorators/ws-controller.decorator.js"));
|
|
18
|
-
const WSOperationDecorator_ = tslib_1.__importStar(require("./decorators/ws-operation.decorator.js"));
|
|
19
|
-
const DataTypeFactory_ = tslib_1.__importStar(require("./factory/data-type.factory.js"));
|
|
20
|
-
const HttpApiFactory_ = tslib_1.__importStar(require("./factory/http-api.factory.js"));
|
|
21
|
-
tslib_1.__exportStar(require("./api-document.js"), exports);
|
|
22
|
-
tslib_1.__exportStar(require("./common/api-base.js"), exports);
|
|
23
|
-
tslib_1.__exportStar(require("./common/data-type-map.js"), exports);
|
|
24
|
-
tslib_1.__exportStar(require("./common/document-element.js"), exports);
|
|
25
|
-
tslib_1.__exportStar(require("./common/document-init-context.js"), exports);
|
|
26
|
-
tslib_1.__exportStar(require("./common/document-node.js"), exports);
|
|
27
|
-
tslib_1.__exportStar(require("./common/opra-document-error.js"), exports);
|
|
28
|
-
tslib_1.__exportStar(require("./constants.js"), exports);
|
|
29
|
-
tslib_1.__exportStar(require("./data-type/api-field.js"), exports);
|
|
30
|
-
tslib_1.__exportStar(require("./data-type/array-type.js"), exports);
|
|
31
|
-
tslib_1.__exportStar(require("./data-type/complex-type.js"), exports);
|
|
32
|
-
tslib_1.__exportStar(require("./data-type/data-type.js"), exports);
|
|
33
|
-
tslib_1.__exportStar(require("./data-type/enum-type.js"), exports);
|
|
34
|
-
tslib_1.__exportStar(require("./data-type/extended-types/index.js"), exports);
|
|
35
|
-
tslib_1.__exportStar(require("./data-type/mapped-type.js"), exports);
|
|
36
|
-
tslib_1.__exportStar(require("./data-type/mixin-type.js"), exports);
|
|
37
|
-
tslib_1.__exportStar(require("./data-type/omit-type.js"), exports);
|
|
38
|
-
tslib_1.__exportStar(require("./data-type/partial-type.js"), exports);
|
|
39
|
-
tslib_1.__exportStar(require("./data-type/pick-type.js"), exports);
|
|
40
|
-
tslib_1.__exportStar(require("./data-type/primitive-types/index.js"), exports);
|
|
41
|
-
tslib_1.__exportStar(require("./data-type/required-type.js"), exports);
|
|
42
|
-
tslib_1.__exportStar(require("./data-type/simple-type.js"), exports);
|
|
43
|
-
tslib_1.__exportStar(require("./data-type/union-type.js"), exports);
|
|
44
|
-
tslib_1.__exportStar(require("./decorators/ws-param.decorator.js"), exports);
|
|
45
|
-
tslib_1.__exportStar(require("./factory/api-document.factory.js"), exports);
|
|
46
|
-
tslib_1.__exportStar(require("./http/http-api.js"), exports);
|
|
47
|
-
tslib_1.__exportStar(require("./http/http-controller.js"), exports);
|
|
48
|
-
tslib_1.__exportStar(require("./http/http-media-type.js"), exports);
|
|
49
|
-
tslib_1.__exportStar(require("./http/http-multipart-field.js"), exports);
|
|
50
|
-
tslib_1.__exportStar(require("./http/http-operation.js"), exports);
|
|
51
|
-
tslib_1.__exportStar(require("./http/http-operation-response.js"), exports);
|
|
52
|
-
tslib_1.__exportStar(require("./http/http-parameter.js"), exports);
|
|
53
|
-
tslib_1.__exportStar(require("./http/http-request-body.js"), exports);
|
|
54
|
-
tslib_1.__exportStar(require("./http/http-status-range.js"), exports);
|
|
55
|
-
tslib_1.__exportStar(require("./mq/mq-api.js"), exports);
|
|
56
|
-
tslib_1.__exportStar(require("./mq/mq-controller.js"), exports);
|
|
57
|
-
tslib_1.__exportStar(require("./mq/mq-header.js"), exports);
|
|
58
|
-
tslib_1.__exportStar(require("./mq/mq-operation.js"), exports);
|
|
59
|
-
tslib_1.__exportStar(require("./ws/ws-api.js"), exports);
|
|
60
|
-
tslib_1.__exportStar(require("./ws/ws-controller.js"), exports);
|
|
61
|
-
tslib_1.__exportStar(require("./ws/ws-operation.js"), exports);
|
|
62
|
-
var classes;
|
|
63
|
-
(function (classes) {
|
|
64
|
-
classes.HttpApiFactory = HttpApiFactory_.HttpApiFactory;
|
|
65
|
-
classes.DataTypeFactory = DataTypeFactory_.DataTypeFactory;
|
|
66
|
-
classes.MQOperationDecoratorFactory = MQOperationDecorator_.MQOperationDecoratorFactory;
|
|
67
|
-
classes.MQControllerDecoratorFactory = MQControllerDecorator_.MQControllerDecoratorFactory;
|
|
68
|
-
classes.WSOperationDecoratorFactory = WSOperationDecorator_.WSOperationDecoratorFactory;
|
|
69
|
-
classes.WSControllerDecoratorFactory = WSControllerDecorator_.WSControllerDecoratorFactory;
|
|
70
|
-
})(classes || (exports.classes = classes = {}));
|