@opra/common 1.0.0-alpha.38 → 1.0.0-alpha.39

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.
Files changed (105) hide show
  1. package/browser/index.cjs +5 -5
  2. package/browser/index.mjs +5 -5
  3. package/cjs/document/data-type/complex-type-base.js +1 -1
  4. package/cjs/document/data-type/extended-types/filter.type.js +1 -1
  5. package/cjs/filter/filter-rules.js +17 -16
  6. package/cjs/helpers/index.js +1 -0
  7. package/cjs/helpers/safe-json-stringify.js +16 -0
  8. package/cjs/schema/index.js +2 -27
  9. package/cjs/schema/opra-schema.js +24 -0
  10. package/esm/document/data-type/complex-type-base.js +1 -1
  11. package/esm/document/data-type/extended-types/filter.type.js +1 -1
  12. package/esm/filter/filter-rules.js +10 -9
  13. package/esm/helpers/index.js +1 -0
  14. package/esm/helpers/safe-json-stringify.js +13 -0
  15. package/esm/schema/index.js +2 -27
  16. package/esm/schema/opra-schema.js +21 -0
  17. package/package.json +2 -2
  18. package/types/document/api-document.d.ts +1 -1
  19. package/types/document/common/data-type-map.d.ts +1 -1
  20. package/types/document/common/document-node.d.ts +1 -1
  21. package/types/document/common/value.d.ts +1 -1
  22. package/types/document/data-type/api-field.d.ts +1 -1
  23. package/types/document/data-type/complex-type-base.d.ts +3 -4
  24. package/types/document/data-type/complex-type.d.ts +1 -1
  25. package/types/document/data-type/data-type.d.ts +2 -2
  26. package/types/document/data-type/enum-type.d.ts +2 -2
  27. package/types/document/data-type/extended-types/base64.type.d.ts +1 -1
  28. package/types/document/data-type/extended-types/date-string.type.d.ts +1 -1
  29. package/types/document/data-type/extended-types/date-time-string.type.d.ts +1 -1
  30. package/types/document/data-type/extended-types/date-time.type.d.ts +1 -1
  31. package/types/document/data-type/extended-types/date.type.d.ts +1 -1
  32. package/types/document/data-type/extended-types/email.type.d.ts +1 -1
  33. package/types/document/data-type/extended-types/field-path.type.d.ts +3 -3
  34. package/types/document/data-type/extended-types/filter.type.d.ts +3 -3
  35. package/types/document/data-type/extended-types/object-id.type.d.ts +1 -1
  36. package/types/document/data-type/extended-types/operation-result.type.d.ts +2 -2
  37. package/types/document/data-type/extended-types/time.type.d.ts +1 -1
  38. package/types/document/data-type/extended-types/url.type.d.ts +1 -1
  39. package/types/document/data-type/extended-types/uuid.type.d.ts +1 -1
  40. package/types/document/data-type/mapped-type.d.ts +1 -1
  41. package/types/document/data-type/mixin-type.d.ts +1 -1
  42. package/types/document/data-type/omit-type.d.ts +1 -1
  43. package/types/document/data-type/partial-type.d.ts +1 -1
  44. package/types/document/data-type/pick-type.d.ts +1 -1
  45. package/types/document/data-type/primitive-types/any.type.d.ts +1 -1
  46. package/types/document/data-type/primitive-types/bigint.type.d.ts +1 -1
  47. package/types/document/data-type/primitive-types/boolean.type.d.ts +1 -1
  48. package/types/document/data-type/primitive-types/integer.type.d.ts +1 -1
  49. package/types/document/data-type/primitive-types/null.type.d.ts +1 -1
  50. package/types/document/data-type/primitive-types/number.type.d.ts +1 -1
  51. package/types/document/data-type/primitive-types/string.type.d.ts +1 -1
  52. package/types/document/data-type/required-type.d.ts +1 -1
  53. package/types/document/data-type/simple-type.d.ts +2 -2
  54. package/types/document/data-type/utils/create-mapped-class.d.ts +1 -1
  55. package/types/document/decorators/http-controller.decorator.d.ts +1 -1
  56. package/types/document/decorators/http-operation-entity.decorator.d.ts +2 -2
  57. package/types/document/decorators/http-operation.decorator.d.ts +1 -1
  58. package/types/document/factory/api-document.factory.d.ts +1 -1
  59. package/types/document/factory/data-type.factory.d.ts +1 -1
  60. package/types/document/factory/http-api.factory.d.ts +1 -1
  61. package/types/document/http/http-api.d.ts +1 -1
  62. package/types/document/http/http-controller.d.ts +1 -1
  63. package/types/document/http/http-media-type.d.ts +2 -2
  64. package/types/document/http/http-multipart-field.d.ts +1 -1
  65. package/types/document/http/http-operation-response.d.ts +1 -1
  66. package/types/document/http/http-operation.d.ts +2 -2
  67. package/types/document/http/http-parameter.d.ts +1 -1
  68. package/types/document/http/http-request-body.d.ts +1 -1
  69. package/types/exception/http-errors/bad-request.error.d.ts +1 -1
  70. package/types/exception/http-errors/conflict.error.d.ts +1 -1
  71. package/types/exception/http-errors/failed-dependency.error.d.ts +1 -1
  72. package/types/exception/http-errors/forbidden.error.d.ts +1 -1
  73. package/types/exception/http-errors/internal-server.error.d.ts +1 -1
  74. package/types/exception/http-errors/method-not-allowed.error.d.ts +1 -1
  75. package/types/exception/http-errors/not-acceptable.error.d.ts +1 -1
  76. package/types/exception/http-errors/not-found.error.d.ts +1 -1
  77. package/types/exception/http-errors/permission.error.d.ts +1 -1
  78. package/types/exception/http-errors/unauthorized.error.d.ts +1 -1
  79. package/types/exception/http-errors/unprocessable-entity.error.d.ts +1 -1
  80. package/types/exception/opra-exception.d.ts +1 -1
  81. package/types/exception/opra-http-error.d.ts +1 -1
  82. package/types/filter/antlr/OpraFilterParser.d.ts +1 -1
  83. package/types/filter/ast/expressions/comparison-expression.d.ts +1 -1
  84. package/types/filter/errors.d.ts +1 -1
  85. package/types/filter/filter-rules.d.ts +5 -5
  86. package/types/filter/opra-error-listener.d.ts +1 -1
  87. package/types/helpers/function-utils.d.ts +1 -1
  88. package/types/helpers/index.d.ts +1 -0
  89. package/types/helpers/mixin-utils.d.ts +1 -1
  90. package/types/helpers/object-utils.d.ts +1 -1
  91. package/types/helpers/safe-json-stringify.d.ts +1 -0
  92. package/types/helpers/type-guards.d.ts +1 -1
  93. package/types/i18n/i18n.d.ts +2 -2
  94. package/types/i18n/translate.d.ts +1 -1
  95. package/types/schema/{document.interface.d.ts → api-document.interface.d.ts} +3 -3
  96. package/types/schema/data-type/complex-type.interface.d.ts +1 -1
  97. package/types/schema/data-type/enum-type.interface.d.ts +1 -1
  98. package/types/schema/data-type/mapped-type.interface.d.ts +1 -1
  99. package/types/schema/data-type/mixin-type.interface.d.ts +1 -1
  100. package/types/schema/http/http-parameter.interface.d.ts +1 -1
  101. package/types/schema/index.d.ts +2 -62
  102. package/types/schema/opra-schema.d.ts +21 -0
  103. package/types/schema/type-guards.d.ts +1 -1
  104. /package/cjs/schema/{document.interface.js → api-document.interface.js} +0 -0
  105. /package/esm/schema/{document.interface.js → api-document.interface.js} +0 -0
@@ -1,4 +1,4 @@
1
- import { Validator } from 'valgen';
1
+ import { type Validator } from 'valgen';
2
2
  import { DECODER, ENCODER } from '../../constants.js';
3
3
  export declare class BooleanType {
4
4
  constructor(properties?: Partial<BooleanType>);
@@ -1,4 +1,4 @@
1
- import { Validator } from 'valgen';
1
+ import { type Validator } from 'valgen';
2
2
  import { DECODER, ENCODER } from '../../constants.js';
3
3
  import { NumberType } from './number.type.js';
4
4
  export declare class IntegerType extends NumberType {
@@ -1,4 +1,4 @@
1
- import { Validator } from 'valgen';
1
+ import { type Validator } from 'valgen';
2
2
  import { DECODER, ENCODER } from '../../constants.js';
3
3
  export declare class NullType {
4
4
  constructor(properties?: Partial<NullType>);
@@ -1,4 +1,4 @@
1
- import { Validator } from 'valgen';
1
+ import { type Validator } from 'valgen';
2
2
  import { DECODER, ENCODER } from '../../constants.js';
3
3
  export declare class NumberType {
4
4
  constructor(properties?: Partial<NumberType>);
@@ -1,4 +1,4 @@
1
- import { Validator } from 'valgen';
1
+ import { type Validator } from 'valgen';
2
2
  import { DECODER, ENCODER } from '../../constants.js';
3
3
  export declare class StringType {
4
4
  constructor(properties?: Partial<StringType>);
@@ -1,4 +1,4 @@
1
- import { Class, RequiredSome, Type } from 'ts-gems';
1
+ import type { Class, RequiredSome, Type } from 'ts-gems';
2
2
  import type { DataType } from './data-type.js';
3
3
  /**
4
4
  * Create a new MappedType that marks given fields as baseType
@@ -1,6 +1,6 @@
1
1
  import 'reflect-metadata';
2
- import { Combine, Type } from 'ts-gems';
3
- import { Validator } from 'valgen';
2
+ import type { Combine, Type } from 'ts-gems';
3
+ import { type Validator } from 'valgen';
4
4
  import { OpraSchema } from '../../schema/index.js';
5
5
  import type { DocumentElement } from '../common/document-element';
6
6
  import { DocumentInitContext } from '../common/document-init-context.js';
@@ -1,3 +1,3 @@
1
- import { Type } from 'ts-gems';
1
+ import type { Type } from 'ts-gems';
2
2
  import type { DataType } from '../data-type.js';
3
3
  export declare function createMappedClass(source: string | Type, config: any, options?: DataType.Options): any;
@@ -1,4 +1,4 @@
1
- import { StrictOmit, Type, TypeThunkAsync } from 'ts-gems';
1
+ import type { StrictOmit, Type, TypeThunkAsync } from 'ts-gems';
2
2
  import type { HttpController } from '../http/http-controller.js';
3
3
  import type { HttpParameter } from '../http/http-parameter.js';
4
4
  export interface HttpControllerDecorator<T extends HttpControllerDecorator<any> = HttpControllerDecorator<any>> extends ClassDecorator {
@@ -1,9 +1,9 @@
1
- import { StrictOmit, Type, TypeThunkAsync } from 'ts-gems';
1
+ import type { StrictOmit, Type, TypeThunkAsync } from 'ts-gems';
2
2
  import { OpraFilter } from '../../filter/index.js';
3
3
  import { OpraSchema } from '../../schema/index.js';
4
4
  import type { HttpParameter } from '../http/http-parameter.js';
5
5
  import { HttpRequestBody } from '../http/http-request-body.js';
6
- import { HttpOperationDecorator } from './http-operation.decorator.js';
6
+ import { type HttpOperationDecorator } from './http-operation.decorator.js';
7
7
  /** Augmentation **/
8
8
  declare module '../http/http-operation.js' {
9
9
  /**
@@ -1,4 +1,4 @@
1
- import { StrictOmit, Type, TypeThunkAsync } from 'ts-gems';
1
+ import type { StrictOmit, Type, TypeThunkAsync } from 'ts-gems';
2
2
  import { HttpMediaType } from '../http/http-media-type.js';
3
3
  import { HttpMultipartField } from '../http/http-multipart-field.js';
4
4
  import type { HttpOperation } from '../http/http-operation';
@@ -1,4 +1,4 @@
1
- import { PartialSome, StrictOmit, ThunkAsync } from 'ts-gems';
1
+ import type { PartialSome, StrictOmit, ThunkAsync } from 'ts-gems';
2
2
  import { OpraSchema } from '../../schema/index.js';
3
3
  import { ApiDocument } from '../api-document.js';
4
4
  import { DocumentInitContext } from '../common/document-init-context.js';
@@ -1,4 +1,4 @@
1
- import { Combine, ThunkAsync, Type } from 'ts-gems';
1
+ import type { Combine, ThunkAsync, Type } from 'ts-gems';
2
2
  import { ResponsiveMap } from '../../helpers/index.js';
3
3
  import { OpraSchema } from '../../schema/index.js';
4
4
  import { DocumentElement } from '../common/document-element.js';
@@ -1,4 +1,4 @@
1
- import { StrictOmit, Type } from 'ts-gems';
1
+ import type { StrictOmit, Type } from 'ts-gems';
2
2
  import { OpraSchema } from '../../schema/index.js';
3
3
  import { ApiDocument } from '../api-document.js';
4
4
  import { DocumentInitContext } from '../common/document-init-context.js';
@@ -1,4 +1,4 @@
1
- import { Type } from 'ts-gems';
1
+ import type { Type } from 'ts-gems';
2
2
  import { ResponsiveMap } from '../../helpers/index.js';
3
3
  import { OpraSchema } from '../../schema/index.js';
4
4
  import type { ApiDocument } from '../api-document';
@@ -1,4 +1,4 @@
1
- import { Combine, ThunkAsync, Type } from 'ts-gems';
1
+ import type { Combine, ThunkAsync, Type } from 'ts-gems';
2
2
  import { ResponsiveMap } from '../../helpers/index.js';
3
3
  import { OpraSchema } from '../../schema/index.js';
4
4
  import { DataTypeMap } from '../common/data-type-map.js';
@@ -1,5 +1,5 @@
1
- import { Combine, StrictOmit, Type } from 'ts-gems';
2
- import { Validator } from 'valgen';
1
+ import type { Combine, StrictOmit, Type } from 'ts-gems';
2
+ import { type Validator } from 'valgen';
3
3
  import { OpraSchema } from '../../schema/index.js';
4
4
  import { DocumentElement } from '../common/document-element.js';
5
5
  import { DataType } from '../data-type/data-type.js';
@@ -1,4 +1,4 @@
1
- import { Combine } from 'ts-gems';
1
+ import type { Combine } from 'ts-gems';
2
2
  import { OpraSchema } from '../../schema/index.js';
3
3
  import { HttpMediaType } from './http-media-type.js';
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { Combine, StrictOmit } from 'ts-gems';
1
+ import type { Combine, StrictOmit } from 'ts-gems';
2
2
  import { OpraSchema } from '../../schema/index.js';
3
3
  import { HttpMediaType } from './http-media-type.js';
4
4
  import { HttpOperation } from './http-operation.js';
@@ -1,10 +1,10 @@
1
- import { Combine, StrictOmit, ThunkAsync, Type } from 'ts-gems';
1
+ import type { Combine, StrictOmit, ThunkAsync, Type } from 'ts-gems';
2
2
  import { OpraSchema } from '../../schema/index.js';
3
3
  import { DataTypeMap } from '../common/data-type-map.js';
4
4
  import { DocumentElement } from '../common/document-element.js';
5
5
  import type { DataType } from '../data-type/data-type.js';
6
6
  import type { EnumType } from '../data-type/enum-type.js';
7
- import { HttpOperationDecorator } from '../decorators/http-operation.decorator.js';
7
+ import { type HttpOperationDecorator } from '../decorators/http-operation.decorator.js';
8
8
  import type { HttpController } from './http-controller.js';
9
9
  import type { HttpOperationResponse } from './http-operation-response.js';
10
10
  import type { HttpParameter } from './http-parameter.js';
@@ -1,4 +1,4 @@
1
- import { Combine, StrictOmit, TypeThunkAsync } from 'ts-gems';
1
+ import { type Combine, type StrictOmit, type TypeThunkAsync } from 'ts-gems';
2
2
  import type { OpraSchema } from '../../schema/index.js';
3
3
  import { DocumentElement } from '../common/document-element.js';
4
4
  import { Value } from '../common/value.js';
@@ -1,4 +1,4 @@
1
- import { StrictOmit } from 'ts-gems';
1
+ import type { StrictOmit } from 'ts-gems';
2
2
  import { OpraSchema } from '../../schema/index.js';
3
3
  import { DocumentElement } from '../common/document-element.js';
4
4
  import { HttpMediaType } from './http-media-type.js';
@@ -1,4 +1,4 @@
1
- import { ErrorIssue } from '../error-issue.js';
1
+ import type { ErrorIssue } from '../error-issue.js';
2
2
  import { OpraHttpError } from '../opra-http-error.js';
3
3
  /**
4
4
  * 400 Bad Request
@@ -1,4 +1,4 @@
1
- import { ErrorIssue } from '../error-issue.js';
1
+ import type { ErrorIssue } from '../error-issue.js';
2
2
  import { OpraHttpError } from '../opra-http-error.js';
3
3
  /**
4
4
  * 409 Conflict
@@ -1,4 +1,4 @@
1
- import { ErrorIssue } from '../error-issue.js';
1
+ import type { ErrorIssue } from '../error-issue.js';
2
2
  import { OpraHttpError } from '../opra-http-error.js';
3
3
  /**
4
4
  * 424 Failed Dependency
@@ -1,5 +1,5 @@
1
1
  import { HttpStatusCode } from '../../http/index.js';
2
- import { ErrorIssue } from '../error-issue.js';
2
+ import type { ErrorIssue } from '../error-issue.js';
3
3
  import { OpraHttpError } from '../opra-http-error.js';
4
4
  /**
5
5
  * 403 Forbidden
@@ -1,4 +1,4 @@
1
- import { ErrorIssue } from '../error-issue.js';
1
+ import type { ErrorIssue } from '../error-issue.js';
2
2
  import { OpraHttpError } from '../opra-http-error.js';
3
3
  /**
4
4
  * 500 Internal Server Error
@@ -1,4 +1,4 @@
1
- import { ErrorIssue } from '../error-issue.js';
1
+ import type { ErrorIssue } from '../error-issue.js';
2
2
  import { OpraHttpError } from '../opra-http-error.js';
3
3
  /**
4
4
  * 405 Method Not Allowed
@@ -1,4 +1,4 @@
1
- import { ErrorIssue } from '../error-issue.js';
1
+ import type { ErrorIssue } from '../error-issue.js';
2
2
  import { OpraHttpError } from '../opra-http-error.js';
3
3
  /**
4
4
  * 406 Not Acceptable
@@ -1,4 +1,4 @@
1
- import { ErrorIssue } from '../error-issue.js';
1
+ import type { ErrorIssue } from '../error-issue.js';
2
2
  import { OpraHttpError } from '../opra-http-error.js';
3
3
  /**
4
4
  * 404 Not Found
@@ -1,4 +1,4 @@
1
- import { ErrorIssue } from '../error-issue.js';
1
+ import type { ErrorIssue } from '../error-issue.js';
2
2
  import { ForbiddenError } from './forbidden.error.js';
3
3
  /**
4
4
  * 403 Forbidden
@@ -1,4 +1,4 @@
1
- import { ErrorIssue } from '../error-issue.js';
1
+ import type { ErrorIssue } from '../error-issue.js';
2
2
  import { OpraHttpError } from '../opra-http-error.js';
3
3
  /**
4
4
  * 401 Unauthorized
@@ -1,4 +1,4 @@
1
- import { ErrorIssue } from '../error-issue.js';
1
+ import type { ErrorIssue } from '../error-issue.js';
2
2
  import { OpraHttpError } from '../opra-http-error.js';
3
3
  /**
4
4
  * 422 Unprocessable Entity
@@ -1,4 +1,4 @@
1
- import { ErrorIssue } from './error-issue.js';
1
+ import type { ErrorIssue } from './error-issue.js';
2
2
  import { IssueSeverity } from './issue-severity.enum.js';
3
3
  /**
4
4
  * Defines the base Opra exception, which is handled by the default Exceptions Handler.
@@ -1,4 +1,4 @@
1
- import { ErrorIssue } from './error-issue.js';
1
+ import type { ErrorIssue } from './error-issue.js';
2
2
  import { OpraException } from './opra-exception.js';
3
3
  /**
4
4
  * Defines the base Opra exception, which is handled by the default Exceptions Handler.
@@ -1,4 +1,4 @@
1
- import { ATN, DFA, FailedPredicateException, Parser, ParserRuleContext, RuleContext, TerminalNode, TokenStream } from '@browsery/antlr4';
1
+ import { ATN, DFA, FailedPredicateException, Parser, ParserRuleContext, type RuleContext, type TerminalNode, type TokenStream } from '@browsery/antlr4';
2
2
  import type OpraFilterListener from './OpraFilterListener.js';
3
3
  import type OpraFilterVisitor from './OpraFilterVisitor.js';
4
4
  export default class OpraFilterParser extends Parser {
@@ -1,4 +1,4 @@
1
- import { StrictOmit } from 'ts-gems';
1
+ import type { StrictOmit } from 'ts-gems';
2
2
  import { Expression } from '../abstract/expression.js';
3
3
  export type ComparisonOperator = '<=' | '<' | '>' | '>=' | '=' | '!=' | 'in' | '!in' | 'like' | '!like' | 'ilike' | '!ilike';
4
4
  export declare class ComparisonExpression extends Expression {
@@ -1,4 +1,4 @@
1
- import { Recognizer } from '@browsery/antlr4';
1
+ import { type Recognizer } from '@browsery/antlr4';
2
2
  export declare class SyntaxError extends TypeError {
3
3
  }
4
4
  export declare class FilterValidationError extends TypeError {
@@ -1,14 +1,14 @@
1
- import { StrictOmit } from 'ts-gems';
1
+ import type { StrictOmit } from 'ts-gems';
2
2
  import type { ComplexType } from '../document/index.js';
3
- import { OpraFilter } from '../filter/index.js';
4
3
  import { ResponsiveMap } from '../helpers/index.js';
5
4
  import { OpraSchema } from '../schema/index.js';
5
+ import { type ComparisonOperator, Expression } from './ast/index.js';
6
6
  export declare namespace FilterRules {
7
7
  interface Options {
8
8
  caseSensitive?: boolean;
9
9
  }
10
10
  interface Rule {
11
- operators?: OpraFilter.ComparisonOperator[];
11
+ operators?: ComparisonOperator[];
12
12
  description?: string;
13
13
  }
14
14
  }
@@ -16,9 +16,9 @@ export declare class FilterRules {
16
16
  protected _rules: ResponsiveMap<FilterRules.Rule>;
17
17
  constructor(rules?: Record<string, FilterRules.Rule>, options?: FilterRules.Options);
18
18
  set(fieldName: string, options?: Partial<StrictOmit<FilterRules.Rule, 'operators'>> & {
19
- operators?: OpraFilter.ComparisonOperator[] | string;
19
+ operators?: ComparisonOperator[] | string;
20
20
  }): void;
21
- normalizeFilter(filter: OpraSchema.Field.QualifiedName | OpraFilter.Expression, dataType?: ComplexType): OpraFilter.Expression | undefined;
21
+ normalizeFilter(filter: OpraSchema.Field.QualifiedName | Expression, dataType?: ComplexType): Expression | undefined;
22
22
  toJSON(): Record<string, FilterRules.Rule>;
23
23
  [Symbol.iterator](): IterableIterator<[string, FilterRules.Rule]>;
24
24
  }
@@ -1,4 +1,4 @@
1
- import { ErrorListener, RecognitionException, Recognizer } from '@browsery/antlr4';
1
+ import { ErrorListener, RecognitionException, type Recognizer } from '@browsery/antlr4';
2
2
  import { FilterParseError } from './errors.js';
3
3
  export declare class OpraErrorListener extends ErrorListener<any> {
4
4
  errors: FilterParseError[];
@@ -1,2 +1,2 @@
1
- import { ThunkAsync } from 'ts-gems';
1
+ import type { ThunkAsync } from 'ts-gems';
2
2
  export declare function resolveThunk(thunk: ThunkAsync<any> | Promise<any>): Promise<any>;
@@ -5,4 +5,5 @@ export * from './mixin-utils.js';
5
5
  export * from './object-utils.js';
6
6
  export * from './parse-fields-projection.js';
7
7
  export * from './responsive-map.js';
8
+ export * from './safe-json-stringify.js';
8
9
  export * from './type-guards.js';
@@ -1,3 +1,3 @@
1
- import { Type } from 'ts-gems';
1
+ import type { Type } from 'ts-gems';
2
2
  export declare function mergePrototype(targetProto: any, baseProto: any, filter?: (k: string) => boolean): void;
3
3
  export declare function inheritPropertyInitializers(target: Record<string, any>, clazz: Type, isPropertyInherited?: (key: string) => boolean): void;
@@ -1,4 +1,4 @@
1
- import { DeeperOmitTypes } from 'ts-gems';
1
+ import type { DeeperOmitTypes } from 'ts-gems';
2
2
  export declare function cloneObject<T extends {}>(obj: T, jsonOnly?: boolean): T;
3
3
  export declare function omitUndefined<T>(obj: T, recursive?: boolean): T;
4
4
  export declare function omitNullish<T>(obj: T, recursive?: boolean): DeeperOmitTypes<T, null | undefined>;
@@ -0,0 +1 @@
1
+ export declare function safeJsonStringify(value: any, replacer?: (this: any, key: string, value: any) => any, space?: string | number): string;
@@ -1,5 +1,5 @@
1
1
  import { Readable, Stream } from 'stream';
2
- import { Type } from 'ts-gems';
2
+ import type { Type } from 'ts-gems';
3
3
  export declare function isConstructor(fn: any): fn is Type;
4
4
  export declare function isStream(x: any): x is Stream;
5
5
  export declare function isReadable(x: any): x is Readable;
@@ -1,6 +1,6 @@
1
- import { FallbackLng as I18nextFallbackLng, Formatter as I18nextFormatter, i18n, InitOptions as I18nextInitOptions, Resource as I18nextResource, TFunction as I18nextTFunction, TOptions } from '@browsery/i18next';
1
+ import type { FallbackLng as I18nextFallbackLng, Formatter as I18nextFormatter, i18n, InitOptions as I18nextInitOptions, Resource as I18nextResource, TFunction as I18nextTFunction, TOptions } from '@browsery/i18next';
2
2
  import * as I18next from '@browsery/i18next';
3
- import { Type } from 'ts-gems';
3
+ import type { Type } from 'ts-gems';
4
4
  export interface BaseI18n extends Type<I18next.i18n> {
5
5
  }
6
6
  export declare namespace I18n {
@@ -1,4 +1,4 @@
1
- import { TOptions } from '@browsery/i18next';
1
+ import type { TOptions } from '@browsery/i18next';
2
2
  export declare function translate(key: string, options?: TOptions<Record<string, any>>): string;
3
3
  export declare function translate(key: string, options: TOptions<Record<string, any>>, fallback: string): string;
4
4
  export declare function translate(key: string, fallback: string): string;
@@ -3,9 +3,9 @@ import type { DataTypeContainer } from './data-type-container.interface.js';
3
3
  import type { HttpController } from './http/http-controller.interface.js';
4
4
  export type Protocol = 'http' | 'ws' | 'rpc';
5
5
  /**
6
- * @interface Document
6
+ * @interface ApiDocument
7
7
  */
8
- export interface Document extends DataTypeContainer {
8
+ export interface ApiDocument extends DataTypeContainer {
9
9
  spec: SpecVersion;
10
10
  id: string;
11
11
  url?: string;
@@ -43,7 +43,7 @@ export interface LicenseInfo {
43
43
  /**
44
44
  * @interface DocumentReference
45
45
  */
46
- export interface DocumentReference extends Pick<Document, 'id' | 'url' | 'info'> {
46
+ export interface DocumentReference extends Pick<ApiDocument, 'id' | 'url' | 'info'> {
47
47
  }
48
48
  /**
49
49
  * @interface Api
@@ -1,4 +1,4 @@
1
- import { StrictOmit, Type } from 'ts-gems';
1
+ import type { StrictOmit, Type } from 'ts-gems';
2
2
  import type { DataType, DataTypeBase } from './data-type.interface.js';
3
3
  import type { Field } from './field.interface.js';
4
4
  import type { MappedType } from './mapped-type.interface.js';
@@ -1,4 +1,4 @@
1
- import { StrictOmit } from 'ts-gems';
1
+ import type { StrictOmit } from 'ts-gems';
2
2
  import type { DataType, DataTypeBase } from './data-type.interface.js';
3
3
  export interface EnumType extends StrictOmit<DataTypeBase, 'kind'> {
4
4
  kind: EnumType.Kind;
@@ -1,4 +1,4 @@
1
- import { StrictOmit } from 'ts-gems';
1
+ import type { StrictOmit } from 'ts-gems';
2
2
  import type { ComplexType } from './complex-type.interface.js';
3
3
  import type { DataType, DataTypeBase } from './data-type.interface.js';
4
4
  import type { Field } from './field.interface.js';
@@ -1,4 +1,4 @@
1
- import { StrictOmit } from 'ts-gems';
1
+ import type { StrictOmit } from 'ts-gems';
2
2
  import type { ComplexType } from './complex-type.interface.js';
3
3
  import type { DataType, DataTypeBase } from './data-type.interface.js';
4
4
  import type { MappedType } from './mapped-type.interface.js';
@@ -1,4 +1,4 @@
1
- import { HttpParameterLocation } from '../types.js';
1
+ import type { HttpParameterLocation } from '../types.js';
2
2
  import type { Value } from '../value.interface.js';
3
3
  /**
4
4
  *
@@ -1,62 +1,2 @@
1
- import * as constants_ from './constants.js';
2
- import * as complexType_ from './data-type/complex-type.interface.js';
3
- import * as dataType_ from './data-type/data-type.interface.js';
4
- import * as enumType_ from './data-type/enum-type.interface.js';
5
- import * as field_ from './data-type/field.interface.js';
6
- import * as mappedType_ from './data-type/mapped-type.interface.js';
7
- import * as mixinType_ from './data-type/mixin-type.interface.js';
8
- import * as simpleType_ from './data-type/simple-type.interface.js';
9
- import * as dataTypeContainer_ from './data-type-container.interface.js';
10
- import * as apiDocument_ from './document.interface.js';
11
- import * as controller_ from './http/http-controller.interface.js';
12
- import * as mediaType_ from './http/http-media-type.interface.js';
13
- import * as multipartField_ from './http/http-multipart-field.interface.js';
14
- import * as operation_ from './http/http-operation.interface.js';
15
- import * as response_ from './http/http-operation-response.interface.js';
16
- import * as parameter_ from './http/http-parameter.interface.js';
17
- import * as requestBody_ from './http/http-request-body.interface.js';
18
- import * as httpStatusRange_ from './http/http-status-range.interface.js';
19
- import * as typeGuards_ from './type-guards.js';
20
- import * as types_ from './types.js';
21
- import * as value_ from './value.interface.js';
22
- export declare namespace OpraSchema {
23
- export import SpecVersion = constants_.SpecVersion;
24
- export import Protocol = apiDocument_.Protocol;
25
- export import ApiDocument = apiDocument_.Document;
26
- export import DocumentInfo = apiDocument_.DocumentInfo;
27
- export import ContactPerson = apiDocument_.ContactPerson;
28
- export import LicenseInfo = apiDocument_.LicenseInfo;
29
- export import DocumentReference = apiDocument_.DocumentReference;
30
- export import HttpApi = apiDocument_.HttpApi;
31
- export import Api = apiDocument_.Api;
32
- export import HttpMethod = types_.HttpMethod;
33
- export import HttpParameterLocation = types_.HttpParameterLocation;
34
- export import HttpMultipartFieldType = types_.HttpMultipartFieldType;
35
- export import Value = value_.Value;
36
- export import ComplexType = complexType_.ComplexType;
37
- export import DataType = dataType_.DataType;
38
- export import DataTypeBase = dataType_.DataTypeBase;
39
- export import DataTypeExample = dataType_.DataTypeExample;
40
- export import EnumType = enumType_.EnumType;
41
- export import Field = field_.Field;
42
- export import MappedType = mappedType_.MappedType;
43
- export import MixinType = mixinType_.MixinType;
44
- export import SimpleType = simpleType_.SimpleType;
45
- export import Attribute = simpleType_.Attribute;
46
- export import DataTypeContainer = dataTypeContainer_.DataTypeContainer;
47
- export import HttpController = controller_.HttpController;
48
- export import HttpMediaType = mediaType_.HttpMediaType;
49
- export import HttpMultipartField = multipartField_.HttpMultipartField;
50
- export import HttpOperation = operation_.HttpOperation;
51
- export import HttpParameter = parameter_.HttpParameter;
52
- export import HttpRequestBody = requestBody_.HttpRequestBody;
53
- export import HttpStatusRange = httpStatusRange_.HttpStatusRange;
54
- export import HttpOperationResponse = response_.HttpOperationResponse;
55
- export import isComplexType = typeGuards_.isComplexType;
56
- export import isDataType = typeGuards_.isDataType;
57
- export import isSimpleType = typeGuards_.isSimpleType;
58
- export import isMixinType = typeGuards_.isMixinType;
59
- export import isMappedType = typeGuards_.isMappedType;
60
- export import isEnumType = typeGuards_.isEnumType;
61
- export import isHttpController = typeGuards_.isHttpController;
62
- }
1
+ import * as OpraSchema from './opra-schema.js';
2
+ export { OpraSchema };
@@ -0,0 +1,21 @@
1
+ export * from './api-document.interface';
2
+ export * from './constants.js';
3
+ export * from './data-type/complex-type.interface.js';
4
+ export * from './data-type/data-type.interface.js';
5
+ export * from './data-type/enum-type.interface.js';
6
+ export * from './data-type/field.interface.js';
7
+ export * from './data-type/mapped-type.interface.js';
8
+ export * from './data-type/mixin-type.interface.js';
9
+ export * from './data-type/simple-type.interface.js';
10
+ export * from './data-type-container.interface.js';
11
+ export * from './http/http-controller.interface.js';
12
+ export * from './http/http-media-type.interface.js';
13
+ export * from './http/http-multipart-field.interface.js';
14
+ export * from './http/http-operation.interface.js';
15
+ export * from './http/http-operation-response.interface.js';
16
+ export * from './http/http-parameter.interface.js';
17
+ export * from './http/http-request-body.interface.js';
18
+ export * from './http/http-status-range.interface.js';
19
+ export * from './type-guards.js';
20
+ export * from './types.js';
21
+ export * from './value.interface.js';
@@ -1,5 +1,5 @@
1
1
  import { ComplexType } from './data-type/complex-type.interface.js';
2
- import { DataType } from './data-type/data-type.interface.js';
2
+ import type { DataType } from './data-type/data-type.interface.js';
3
3
  import { EnumType } from './data-type/enum-type.interface.js';
4
4
  import { MappedType } from './data-type/mapped-type.interface.js';
5
5
  import { MixinType } from './data-type/mixin-type.interface.js';