@opra/common 1.0.0-alpha.9 → 1.0.0-beta.2

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 (199) hide show
  1. package/browser/index.cjs +12 -0
  2. package/browser/index.mjs +12 -0
  3. package/cjs/document/api-document.js +11 -0
  4. package/cjs/document/common/api-base.js +1 -1
  5. package/cjs/document/common/document-element.js +2 -0
  6. package/cjs/document/data-type/api-field.js +8 -7
  7. package/cjs/document/data-type/complex-type-base.js +5 -3
  8. package/cjs/document/data-type/extended-types/date-string.type.js +2 -2
  9. package/cjs/document/data-type/extended-types/date-time-string.type.js +2 -2
  10. package/cjs/document/data-type/extended-types/date-time.type.js +2 -2
  11. package/cjs/document/data-type/extended-types/date.type.js +2 -2
  12. package/cjs/document/data-type/extended-types/email.type.js +2 -2
  13. package/cjs/document/data-type/extended-types/filter.type.js +1 -1
  14. package/cjs/document/data-type/extended-types/time.type.js +2 -2
  15. package/cjs/document/data-type/extended-types/url.type.js +2 -2
  16. package/cjs/document/data-type/omit-type.js +7 -2
  17. package/cjs/document/data-type/partial-type.js +7 -2
  18. package/cjs/document/data-type/pick-type.js +1 -2
  19. package/cjs/document/data-type/primitive-types/object.type.js +0 -3
  20. package/cjs/document/data-type/required-type.js +1 -2
  21. package/cjs/document/data-type/simple-type.js +1 -6
  22. package/cjs/document/data-type/utils/create-mapped-class.js +1 -2
  23. package/cjs/document/data-type/utils/get-is-inherited-predicate-fn.js +1 -2
  24. package/cjs/document/decorators/api-field-decorator.js +4 -6
  25. package/cjs/document/decorators/complex-type.decorator.js +1 -2
  26. package/cjs/document/decorators/http-controller.decorator.js +2 -3
  27. package/cjs/document/decorators/http-operation-entity.decorator.js +68 -74
  28. package/cjs/document/decorators/http-operation.decorator.js +4 -2
  29. package/cjs/document/decorators/simple-type.decorator.js +2 -3
  30. package/cjs/document/factory/api-document.factory.js +17 -8
  31. package/cjs/document/http/http-api.js +0 -1
  32. package/cjs/document/http/http-controller.js +4 -2
  33. package/cjs/document/http/http-media-type.js +17 -2
  34. package/cjs/document/http/http-multipart-field.js +0 -1
  35. package/cjs/document/http/http-operation-response.js +0 -1
  36. package/cjs/document/http/http-operation.js +12 -1
  37. package/cjs/document/http/http-parameter.js +2 -0
  38. package/cjs/document/http/http-request-body.js +0 -1
  39. package/cjs/document/http/http-status-range.js +5 -2
  40. package/cjs/document/utils/parse-regexp.util.js +1 -2
  41. package/cjs/document/utils/string-compare.util.js +1 -2
  42. package/cjs/exception/opra-exception.js +1 -0
  43. package/cjs/filter/build.js +21 -22
  44. package/cjs/filter/filter-rules.js +17 -16
  45. package/cjs/filter/parse.js +1 -2
  46. package/cjs/filter/utils.js +2 -3
  47. package/cjs/helpers/function-utils.js +1 -2
  48. package/cjs/helpers/get-stack-filename.js +2 -3
  49. package/cjs/helpers/index.js +1 -0
  50. package/cjs/helpers/mixin-utils.js +2 -3
  51. package/cjs/helpers/object-utils.js +5 -6
  52. package/cjs/helpers/parse-fields-projection.js +3 -3
  53. package/cjs/helpers/safe-json-stringify.js +16 -0
  54. package/cjs/helpers/type-guards.js +10 -11
  55. package/cjs/i18n/string-utils.js +2 -3
  56. package/cjs/i18n/translate.js +1 -2
  57. package/cjs/schema/index.js +2 -27
  58. package/cjs/schema/opra-schema.js +24 -0
  59. package/cjs/schema/type-guards.js +7 -8
  60. package/esm/document/api-document.js +11 -0
  61. package/esm/document/common/api-base.js +1 -1
  62. package/esm/document/common/document-element.js +2 -0
  63. package/esm/document/data-type/api-field.js +8 -7
  64. package/esm/document/data-type/complex-type-base.js +5 -3
  65. package/esm/document/data-type/extended-types/date-string.type.js +2 -2
  66. package/esm/document/data-type/extended-types/date-time-string.type.js +2 -2
  67. package/esm/document/data-type/extended-types/date-time.type.js +2 -2
  68. package/esm/document/data-type/extended-types/date.type.js +2 -2
  69. package/esm/document/data-type/extended-types/email.type.js +2 -2
  70. package/esm/document/data-type/extended-types/filter.type.js +1 -1
  71. package/esm/document/data-type/extended-types/time.type.js +2 -2
  72. package/esm/document/data-type/extended-types/url.type.js +2 -2
  73. package/esm/document/data-type/omit-type.js +6 -0
  74. package/esm/document/data-type/partial-type.js +6 -0
  75. package/esm/document/data-type/primitive-types/object.type.js +0 -3
  76. package/esm/document/data-type/simple-type.js +1 -6
  77. package/esm/document/decorators/api-field-decorator.js +1 -2
  78. package/esm/document/decorators/http-controller.decorator.js +1 -1
  79. package/esm/document/decorators/http-operation-entity.decorator.js +25 -31
  80. package/esm/document/decorators/http-operation.decorator.js +3 -0
  81. package/esm/document/factory/api-document.factory.js +17 -7
  82. package/esm/document/http/http-api.js +0 -1
  83. package/esm/document/http/http-controller.js +3 -2
  84. package/esm/document/http/http-media-type.js +16 -2
  85. package/esm/document/http/http-multipart-field.js +0 -1
  86. package/esm/document/http/http-operation-response.js +0 -1
  87. package/esm/document/http/http-operation.js +12 -1
  88. package/esm/document/http/http-parameter.js +2 -0
  89. package/esm/document/http/http-request-body.js +0 -1
  90. package/esm/document/http/http-status-range.js +5 -2
  91. package/esm/exception/opra-exception.js +1 -0
  92. package/esm/filter/filter-rules.js +10 -9
  93. package/esm/helpers/index.js +1 -0
  94. package/esm/helpers/object-utils.js +2 -2
  95. package/esm/helpers/safe-json-stringify.js +13 -0
  96. package/esm/package.json +3 -0
  97. package/esm/schema/index.js +2 -27
  98. package/esm/schema/opra-schema.js +21 -0
  99. package/package.json +47 -53
  100. package/types/document/api-document.d.ts +2 -1
  101. package/types/document/common/api-base.d.ts +2 -2
  102. package/types/document/common/data-type-map.d.ts +1 -1
  103. package/types/document/common/document-element.d.ts +1 -0
  104. package/types/document/common/document-node.d.ts +8 -8
  105. package/types/document/common/value.d.ts +1 -1
  106. package/types/document/data-type/api-field.d.ts +11 -1
  107. package/types/document/data-type/complex-type-base.d.ts +6 -7
  108. package/types/document/data-type/complex-type.d.ts +1 -1
  109. package/types/document/data-type/data-type.d.ts +3 -2
  110. package/types/document/data-type/enum-type.d.ts +2 -2
  111. package/types/document/data-type/extended-types/base64.type.d.ts +1 -1
  112. package/types/document/data-type/extended-types/date-string.type.d.ts +1 -1
  113. package/types/document/data-type/extended-types/date-time-string.type.d.ts +1 -1
  114. package/types/document/data-type/extended-types/date-time.type.d.ts +1 -1
  115. package/types/document/data-type/extended-types/date.type.d.ts +1 -1
  116. package/types/document/data-type/extended-types/email.type.d.ts +1 -1
  117. package/types/document/data-type/extended-types/field-path.type.d.ts +3 -3
  118. package/types/document/data-type/extended-types/filter.type.d.ts +3 -3
  119. package/types/document/data-type/extended-types/object-id.type.d.ts +1 -1
  120. package/types/document/data-type/extended-types/operation-result.type.d.ts +2 -2
  121. package/types/document/data-type/extended-types/time.type.d.ts +1 -1
  122. package/types/document/data-type/extended-types/url.type.d.ts +1 -1
  123. package/types/document/data-type/extended-types/uuid.type.d.ts +1 -1
  124. package/types/document/data-type/mapped-type.d.ts +3 -3
  125. package/types/document/data-type/mixin-type.d.ts +1 -1
  126. package/types/document/data-type/omit-type.d.ts +1 -7
  127. package/types/document/data-type/partial-type.d.ts +1 -7
  128. package/types/document/data-type/pick-type.d.ts +3 -3
  129. package/types/document/data-type/primitive-types/any.type.d.ts +1 -1
  130. package/types/document/data-type/primitive-types/bigint.type.d.ts +1 -1
  131. package/types/document/data-type/primitive-types/boolean.type.d.ts +1 -1
  132. package/types/document/data-type/primitive-types/integer.type.d.ts +1 -1
  133. package/types/document/data-type/primitive-types/null.type.d.ts +1 -1
  134. package/types/document/data-type/primitive-types/number.type.d.ts +1 -1
  135. package/types/document/data-type/primitive-types/string.type.d.ts +1 -1
  136. package/types/document/data-type/required-type.d.ts +8 -8
  137. package/types/document/data-type/simple-type.d.ts +2 -2
  138. package/types/document/data-type/utils/create-mapped-class.d.ts +2 -2
  139. package/types/document/decorators/api-field-decorator.d.ts +1 -1
  140. package/types/document/decorators/http-controller.decorator.d.ts +3 -3
  141. package/types/document/decorators/http-operation-entity.decorator.d.ts +5 -4
  142. package/types/document/decorators/http-operation.decorator.d.ts +1 -1
  143. package/types/document/factory/api-document.factory.d.ts +2 -1
  144. package/types/document/factory/data-type.factory.d.ts +1 -1
  145. package/types/document/factory/http-api.factory.d.ts +1 -1
  146. package/types/document/http/http-api.d.ts +2 -2
  147. package/types/document/http/http-controller.d.ts +1 -1
  148. package/types/document/http/http-media-type.d.ts +3 -2
  149. package/types/document/http/http-multipart-field.d.ts +1 -2
  150. package/types/document/http/http-operation-response.d.ts +1 -1
  151. package/types/document/http/http-operation.d.ts +6 -5
  152. package/types/document/http/http-parameter.d.ts +2 -2
  153. package/types/document/http/http-request-body.d.ts +1 -1
  154. package/types/document/http/http-status-range.d.ts +2 -1
  155. package/types/exception/http-errors/bad-request.error.d.ts +1 -1
  156. package/types/exception/http-errors/conflict.error.d.ts +1 -1
  157. package/types/exception/http-errors/failed-dependency.error.d.ts +1 -1
  158. package/types/exception/http-errors/forbidden.error.d.ts +1 -1
  159. package/types/exception/http-errors/internal-server.error.d.ts +1 -1
  160. package/types/exception/http-errors/method-not-allowed.error.d.ts +1 -1
  161. package/types/exception/http-errors/not-acceptable.error.d.ts +1 -1
  162. package/types/exception/http-errors/not-found.error.d.ts +1 -1
  163. package/types/exception/http-errors/permission.error.d.ts +1 -1
  164. package/types/exception/http-errors/unauthorized.error.d.ts +1 -1
  165. package/types/exception/http-errors/unprocessable-entity.error.d.ts +1 -1
  166. package/types/exception/opra-exception.d.ts +1 -1
  167. package/types/exception/opra-http-error.d.ts +1 -1
  168. package/types/filter/antlr/OpraFilterParser.d.ts +1 -1
  169. package/types/filter/ast/expressions/comparison-expression.d.ts +1 -1
  170. package/types/filter/errors.d.ts +3 -4
  171. package/types/filter/filter-rules.d.ts +5 -5
  172. package/types/filter/opra-error-listener.d.ts +1 -2
  173. package/types/helpers/function-utils.d.ts +1 -1
  174. package/types/helpers/index.d.ts +1 -0
  175. package/types/helpers/mixin-utils.d.ts +1 -1
  176. package/types/helpers/object-utils.d.ts +1 -1
  177. package/types/helpers/safe-json-stringify.d.ts +1 -0
  178. package/types/helpers/type-guards.d.ts +1 -3
  179. package/types/i18n/i18n.d.ts +2 -2
  180. package/types/i18n/translate.d.ts +1 -1
  181. package/types/index.d.cts +9 -0
  182. package/types/schema/{document.interface.d.ts → api-document.interface.d.ts} +4 -4
  183. package/types/schema/data-type/complex-type.interface.d.ts +1 -1
  184. package/types/schema/data-type/data-type.interface.d.ts +1 -1
  185. package/types/schema/data-type/enum-type.interface.d.ts +1 -1
  186. package/types/schema/data-type/mapped-type.interface.d.ts +3 -3
  187. package/types/schema/data-type/mixin-type.interface.d.ts +1 -1
  188. package/types/schema/data-type-container.interface.d.ts +1 -1
  189. package/types/schema/http/http-controller.interface.d.ts +2 -2
  190. package/types/schema/http/http-media-type.interface.d.ts +1 -1
  191. package/types/schema/http/http-operation-response.interface.d.ts +2 -2
  192. package/types/schema/http/http-operation.interface.d.ts +8 -4
  193. package/types/schema/http/http-parameter.interface.d.ts +2 -2
  194. package/types/schema/index.d.ts +2 -62
  195. package/types/schema/opra-schema.d.ts +21 -0
  196. package/types/schema/type-guards.d.ts +1 -1
  197. package/browser.js +0 -13393
  198. /package/cjs/schema/{document.interface.js → api-document.interface.js} +0 -0
  199. /package/esm/schema/{document.interface.js → api-document.interface.js} +0 -0
@@ -1,13 +1,13 @@
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
- declare module '../http/http-operation' {
8
+ declare module '../http/http-operation.js' {
9
9
  /**
10
- * HttpOperationConstructor
10
+ * HttpOperationStatic
11
11
  */
12
12
  interface HttpOperationStatic {
13
13
  Entity: HttpOperationEntity;
@@ -63,6 +63,7 @@ declare module '../http/http-operation' {
63
63
  interface FindManyArgs extends StrictOmit<HttpOperation.Options, 'method' | 'requestBody'> {
64
64
  type: Type | string;
65
65
  defaultLimit?: number;
66
+ defaultProjection?: string[];
66
67
  maxLimit?: number;
67
68
  }
68
69
  /** Get */
@@ -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';
@@ -18,6 +18,7 @@ export declare namespace ApiDocumentFactory {
18
18
  * @class ApiDocumentFactory
19
19
  */
20
20
  export declare class ApiDocumentFactory {
21
+ private _allDocuments;
21
22
  /**
22
23
  * Creates ApiDocument instance from given schema object
23
24
  */
@@ -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';
@@ -9,8 +9,8 @@ import type { HttpOperation } from './http-operation.js';
9
9
  * @class HttpApi
10
10
  */
11
11
  export declare class HttpApi extends ApiBase {
12
- readonly owner: ApiDocument;
13
12
  protected _controllerReverseMap: WeakMap<Type, HttpController | null>;
13
+ readonly owner: ApiDocument;
14
14
  readonly protocol = "http";
15
15
  controllers: ResponsiveMap<HttpController>;
16
16
  url?: string;
@@ -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,4 +1,5 @@
1
- import { Combine, StrictOmit, Type } from 'ts-gems';
1
+ import type { Combine, StrictOmit, Type } from 'ts-gems';
2
+ import { type Validator } from 'valgen';
2
3
  import { OpraSchema } from '../../schema/index.js';
3
4
  import { DocumentElement } from '../common/document-element.js';
4
5
  import { DataType } from '../data-type/data-type.js';
@@ -52,8 +53,8 @@ declare class HttpMediaTypeClass extends DocumentElement {
52
53
  maxFiles?: number;
53
54
  maxFileSize?: number;
54
55
  maxTotalFileSize?: number;
55
- minFileSize?: number;
56
56
  findMultipartField(fieldName: string, fieldType?: OpraSchema.HttpMultipartFieldType): HttpMultipartField | undefined;
57
57
  toJSON(): OpraSchema.HttpMediaType;
58
+ generateCodec(codec: 'encode' | 'decode', options?: DataType.GenerateCodecOptions): Validator;
58
59
  }
59
60
  export {};
@@ -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
  /**
@@ -17,7 +17,6 @@ export declare namespace HttpMultipartField {
17
17
  * @class HttpMultipartField
18
18
  */
19
19
  export declare class HttpMultipartField extends HttpMediaType {
20
- readonly owner: HttpMediaType | HttpMultipartField;
21
20
  fieldName: string | RegExp;
22
21
  fieldType: OpraSchema.HttpMultipartFieldType;
23
22
  required?: boolean;
@@ -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';
@@ -13,20 +13,20 @@ import type { HttpRequestBody } from './http-request-body.js';
13
13
  * @namespace HttpOperation
14
14
  */
15
15
  export declare namespace HttpOperation {
16
- interface Metadata extends Pick<OpraSchema.HttpOperation, 'description' | 'path' | 'method' | 'composition' | 'compositionOptions'> {
16
+ interface Metadata extends Pick<OpraSchema.HttpOperation, 'description' | 'method' | 'path' | 'mergePath' | 'composition' | 'compositionOptions'> {
17
17
  types?: ThunkAsync<Type | EnumType.EnumObject | EnumType.EnumArray>[];
18
18
  parameters?: HttpParameter.Metadata[];
19
19
  responses?: HttpOperationResponse.Metadata[];
20
20
  requestBody?: HttpRequestBody.Metadata;
21
21
  immediateFetch?: boolean;
22
22
  }
23
- interface Options extends Partial<Pick<Metadata, 'path' | 'description' | 'method' | 'immediateFetch'>> {
23
+ interface Options extends Partial<Pick<Metadata, 'path' | 'mergePath' | 'description' | 'method' | 'immediateFetch'>> {
24
24
  requestBody?: HttpRequestBody.Options;
25
25
  }
26
26
  interface InitArguments extends Combine<{
27
27
  name: string;
28
28
  types?: DataType[];
29
- }, Pick<Metadata, 'description' | 'path' | 'method' | 'composition' | 'compositionOptions' | 'immediateFetch'>> {
29
+ }, Pick<Metadata, 'description' | 'method' | 'path' | 'mergePath' | 'composition' | 'compositionOptions' | 'immediateFetch'>> {
30
30
  }
31
31
  }
32
32
  /**
@@ -72,6 +72,7 @@ declare class HttpOperationClass extends DocumentElement {
72
72
  method: OpraSchema.HttpMethod;
73
73
  description?: string;
74
74
  path?: string;
75
+ mergePath?: boolean;
75
76
  types: DataTypeMap;
76
77
  parameters: HttpParameter[];
77
78
  responses: HttpOperationResponse[];
@@ -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';
@@ -41,11 +41,11 @@ export declare const HttpParameter: HttpParameterStatic;
41
41
  */
42
42
  declare class HttpParameterClass extends Value {
43
43
  readonly owner: DocumentElement;
44
+ location: OpraSchema.HttpParameterLocation;
44
45
  keyParam?: boolean;
45
46
  deprecated?: boolean | string;
46
47
  required?: boolean;
47
48
  arraySeparator?: string;
48
- location: OpraSchema.HttpParameterLocation;
49
49
  toJSON(): OpraSchema.HttpParameter;
50
50
  }
51
51
  export {};
@@ -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';
@@ -8,7 +8,8 @@ export declare class HttpStatusRange {
8
8
  constructor(value: string);
9
9
  constructor(start: number, end?: number);
10
10
  constructor(init: Pick<HttpStatusRange, 'start' | 'end'>);
11
- get distance(): number;
11
+ includes(statusCode: number): boolean;
12
+ intersects(start: number, end: number): boolean;
12
13
  toString(): string;
13
14
  toJSON(): OpraSchema.HttpStatusRange | number;
14
15
  }
@@ -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,5 +1,4 @@
1
- import { RecognitionException } from '@browsery/antlr4';
2
- import { Recognizer } from '@browsery/antlr4/typings/Recognizer';
1
+ import { type Recognizer } from '@browsery/antlr4';
3
2
  export declare class SyntaxError extends TypeError {
4
3
  }
5
4
  export declare class FilterValidationError extends TypeError {
@@ -12,12 +11,12 @@ export declare class FilterParseError extends Error {
12
11
  offendingSymbol?: any;
13
12
  line: number;
14
13
  column: number;
15
- e: RecognitionException | undefined;
14
+ e: Error | undefined;
16
15
  constructor(message: string, args: {
17
16
  recognizer: Recognizer<any>;
18
17
  offendingSymbol?: any;
19
18
  line: number;
20
19
  column: number;
21
- e: RecognitionException | undefined;
20
+ e: Error | undefined;
22
21
  });
23
22
  }
@@ -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,5 +1,4 @@
1
- import { ErrorListener, RecognitionException } from '@browsery/antlr4';
2
- import { Recognizer } from '@browsery/antlr4/typings/Recognizer';
1
+ import { ErrorListener, RecognitionException, type Recognizer } from '@browsery/antlr4';
3
2
  import { FilterParseError } from './errors.js';
4
3
  export declare class OpraErrorListener extends ErrorListener<any> {
5
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,7 +1,5 @@
1
- /// <reference types="node" />
2
- /// <reference lib="dom" />
3
1
  import { Readable, Stream } from 'stream';
4
- import { Type } from 'ts-gems';
2
+ import type { Type } from 'ts-gems';
5
3
  export declare function isConstructor(fn: any): fn is Type;
6
4
  export declare function isStream(x: any): x is Stream;
7
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;
@@ -0,0 +1,9 @@
1
+ export * from './document/index.js';
2
+ export * from './exception/index.js';
3
+ export * from './filter/index.js';
4
+ export * from './helpers/index.js';
5
+ export * from './http/index.js';
6
+ export * from './i18n/index.js';
7
+ export * from './schema/index.js';
8
+ export * from './types.js';
9
+ export { uid } from 'uid';
@@ -1,11 +1,11 @@
1
1
  import type { SpecVersion } from './constants.js';
2
2
  import type { DataTypeContainer } from './data-type-container.interface.js';
3
- import type { HttpController } from './http/http-controller.interface';
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,7 +1,7 @@
1
1
  import type { ComplexType } from './complex-type.interface.js';
2
2
  import type { EnumType } from './enum-type.interface.js';
3
3
  import type { MappedType } from './mapped-type.interface.js';
4
- import type { MixinType } from './mixin-type.interface';
4
+ import type { MixinType } from './mixin-type.interface.js';
5
5
  import type { SimpleType } from './simple-type.interface.js';
6
6
  export type DataType = SimpleType | EnumType | ComplexType | MappedType | MixinType;
7
7
  export declare namespace DataType {
@@ -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,6 +1,6 @@
1
- import { StrictOmit } from 'ts-gems';
2
- import type { ComplexType } from './complex-type.interface';
3
- import type { DataType, DataTypeBase } from './data-type.interface';
1
+ import type { StrictOmit } from 'ts-gems';
2
+ import type { ComplexType } from './complex-type.interface.js';
3
+ import type { DataType, DataTypeBase } from './data-type.interface.js';
4
4
  import type { Field } from './field.interface.js';
5
5
  import type { MixinType } from './mixin-type.interface.js';
6
6
  export interface MappedType extends StrictOmit<DataTypeBase, '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 { MappedType } from './mapped-type.interface.js';
@@ -1,4 +1,4 @@
1
- import type { DataType } from './data-type/data-type.interface';
1
+ import type { DataType } from './data-type/data-type.interface.js';
2
2
  /**
3
3
  * @interface DataTypeContainer
4
4
  */
@@ -1,6 +1,6 @@
1
1
  import type { DataTypeContainer } from '../data-type-container.interface.js';
2
- import type { HttpOperation } from './http-operation.interface';
3
- import type { HttpParameter } from './http-parameter.interface';
2
+ import type { HttpOperation } from './http-operation.interface.js';
3
+ import type { HttpParameter } from './http-parameter.interface.js';
4
4
  /**
5
5
  *
6
6
  * @interface HttpController
@@ -1,4 +1,4 @@
1
- import type { DataType } from '../data-type/data-type.interface';
1
+ import type { DataType } from '../data-type/data-type.interface.js';
2
2
  import type { HttpMultipartField } from './http-multipart-field.interface.js';
3
3
  /**
4
4
  *
@@ -1,6 +1,6 @@
1
1
  import type { HttpMediaType } from './http-media-type.interface.js';
2
- import type { HttpParameter } from './http-parameter.interface';
3
- import type { HttpStatusRange } from './http-status-range.interface';
2
+ import type { HttpParameter } from './http-parameter.interface.js';
3
+ import type { HttpStatusRange } from './http-status-range.interface.js';
4
4
  /**
5
5
  *
6
6
  * @interface HttpOperationResponse
@@ -1,8 +1,8 @@
1
- import type { DataTypeContainer } from '../data-type-container.interface';
1
+ import type { DataTypeContainer } from '../data-type-container.interface.js';
2
2
  import type { HttpMethod } from '../types.js';
3
- import type { HttpOperationResponse } from './http-operation-response.interface';
4
- import type { HttpParameter } from './http-parameter.interface';
5
- import type { HttpRequestBody } from './http-request-body.interface';
3
+ import type { HttpOperationResponse } from './http-operation-response.interface.js';
4
+ import type { HttpParameter } from './http-parameter.interface.js';
5
+ import type { HttpRequestBody } from './http-request-body.interface.js';
6
6
  /**
7
7
  * @interface HttpOperation
8
8
  */
@@ -11,6 +11,10 @@ export interface HttpOperation extends DataTypeContainer {
11
11
  method: HttpMethod;
12
12
  description?: string;
13
13
  path?: string;
14
+ /**
15
+ * Determines if the `path` will be joined or merged to parent path.
16
+ */
17
+ mergePath?: boolean;
14
18
  parameters?: HttpParameter[];
15
19
  responses?: HttpOperationResponse[];
16
20
  requestBody?: HttpRequestBody;
@@ -1,5 +1,5 @@
1
- import { HttpParameterLocation } from '../types.js';
2
- import type { Value } from '../value.interface';
1
+ import type { HttpParameterLocation } from '../types.js';
2
+ import type { Value } from '../value.interface.js';
3
3
  /**
4
4
  *
5
5
  * @interface HttpParameter