@opra/client 0.14.0 → 0.15.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.
Files changed (199) hide show
  1. package/cjs/content-disposition-d575fee5.js +473 -0
  2. package/cjs/cookie-signature-3e974173.js +64 -0
  3. package/cjs/index.min.mjs +7946 -7135
  4. package/cjs/mime-db-49f150d0.js +10719 -0
  5. package/cjs/mime-types-6e2bdb57.js +201 -0
  6. package/cjs/safe-buffer-8acd60c7.js +78 -0
  7. package/esm/content-disposition-65f281a9.js +470 -0
  8. package/esm/cookie-signature-bf274b6b.js +62 -0
  9. package/esm/index.min.mjs +7546 -6703
  10. package/esm/mime-db-d0f15d8f.js +10717 -0
  11. package/esm/mime-types-79c091fd.js +199 -0
  12. package/esm/safe-buffer-63383356.js +76 -0
  13. package/package.json +9 -3
  14. package/typings/common/document/api-document.d.ts +102 -0
  15. package/typings/common/document/constants.d.ts +3 -0
  16. package/typings/common/document/data-type/api-field.d.ts +41 -0
  17. package/typings/common/document/data-type/builtin/any.type.d.ts +2 -0
  18. package/typings/common/document/data-type/builtin/base64.type.d.ts +6 -0
  19. package/typings/common/document/data-type/builtin/bigint.type.d.ts +6 -0
  20. package/typings/common/document/data-type/builtin/boolean.type.d.ts +5 -0
  21. package/typings/common/document/data-type/builtin/date.type.d.ts +4 -0
  22. package/typings/common/document/data-type/builtin/guid.type.d.ts +7 -0
  23. package/typings/common/document/data-type/builtin/index.d.ts +10 -0
  24. package/typings/common/document/data-type/builtin/integer.type.d.ts +6 -0
  25. package/typings/common/document/data-type/builtin/number.type.d.ts +6 -0
  26. package/typings/common/document/data-type/builtin/object.type.d.ts +3 -0
  27. package/typings/common/document/data-type/builtin/string.type.d.ts +5 -0
  28. package/typings/common/document/data-type/builtin/time.type.d.ts +7 -0
  29. package/typings/common/document/data-type/builtin/timestamp.type.d.ts +5 -0
  30. package/typings/common/document/data-type/complex-type.d.ts +50 -0
  31. package/typings/common/document/data-type/data-type.d.ts +33 -0
  32. package/typings/common/document/data-type/enum-type.d.ts +32 -0
  33. package/typings/common/document/data-type/mapped-type.d.ts +53 -0
  34. package/typings/common/document/data-type/simple-type.d.ts +33 -0
  35. package/typings/common/document/data-type/union-type.d.ts +42 -0
  36. package/typings/common/document/factory/add-references.d.ts +4 -0
  37. package/typings/common/document/factory/create-document.d.ts +12 -0
  38. package/typings/common/document/factory/factory.d.ts +61 -0
  39. package/typings/common/document/factory/import-resource-class.d.ts +9 -0
  40. package/typings/common/document/factory/import-type-class.d.ts +17 -0
  41. package/typings/common/document/factory/index.d.ts +1 -0
  42. package/typings/common/document/factory/process-resources.d.ts +7 -0
  43. package/typings/common/document/factory/process-types.d.ts +6 -0
  44. package/typings/common/document/index.d.ts +14 -0
  45. package/typings/common/document/resource/collection.d.ts +67 -0
  46. package/typings/common/document/resource/resource.d.ts +29 -0
  47. package/typings/common/document/resource/singleton.d.ts +49 -0
  48. package/typings/common/exception/resource-errors/resource-not-found.error.d.ts +4 -0
  49. package/typings/common/helpers/function-utils.d.ts +4 -0
  50. package/typings/common/helpers/get-stack-filename.d.ts +1 -0
  51. package/typings/common/helpers/index.d.ts +7 -0
  52. package/typings/common/helpers/is-url.d.ts +1 -0
  53. package/typings/common/{schema/utils/clone-object.util.d.ts → helpers/object-utils.d.ts} +1 -0
  54. package/typings/common/helpers/path-to-object-tree.d.ts +4 -0
  55. package/typings/common/helpers/responsive-map.d.ts +15 -13
  56. package/typings/common/{utils → helpers}/type-guards.d.ts +3 -1
  57. package/typings/common/http/codecs/boolean-codec.d.ts +5 -0
  58. package/typings/common/http/{param-codec → codecs}/date-codec.d.ts +2 -2
  59. package/typings/common/http/{param-codec → codecs}/filter-codec.d.ts +2 -2
  60. package/typings/common/http/codecs/integer-codec.d.ts +11 -0
  61. package/typings/common/http/codecs/number-codec.d.ts +14 -0
  62. package/typings/common/http/codecs/string-codec.d.ts +16 -0
  63. package/typings/common/http/enums/http-headers-codes.enum.d.ts +13 -4
  64. package/typings/common/http/enums/http-status-messages.d.ts +65 -0
  65. package/typings/common/http/http-headers.d.ts +50 -34
  66. package/typings/common/http/http-message.host.d.ts +122 -0
  67. package/typings/common/http/http-params.d.ts +43 -29
  68. package/typings/common/http/http-request-message.d.ts +213 -0
  69. package/typings/common/http/http-response-message.d.ts +318 -0
  70. package/typings/common/http/index.d.ts +8 -11
  71. package/typings/common/http/interfaces/cookie-options.interface.d.ts +4 -0
  72. package/typings/common/http/multipart/batch-multipart.d.ts +0 -31
  73. package/typings/common/http/multipart/http-request-content.d.ts +0 -8
  74. package/typings/common/http/multipart/http-response-content.d.ts +0 -7
  75. package/typings/common/http/multipart/index.d.ts +0 -1
  76. package/typings/common/index.d.ts +6 -5
  77. package/typings/common/schema/constants.d.ts +2 -8
  78. package/typings/common/schema/data-type/complex-type.interface.d.ts +16 -0
  79. package/typings/common/schema/data-type/data-type.interface.d.ts +14 -0
  80. package/typings/common/schema/data-type/enum-type.interface.d.ts +15 -0
  81. package/typings/common/schema/data-type/field.interface.d.ts +21 -0
  82. package/typings/common/schema/data-type/mapped-type.interface.d.ts +11 -0
  83. package/typings/common/schema/data-type/simple-type.interface.d.ts +18 -0
  84. package/typings/common/schema/data-type/union-type.interface.d.ts +10 -0
  85. package/typings/common/schema/document.interface.d.ts +34 -0
  86. package/typings/common/schema/index.d.ts +51 -25
  87. package/typings/common/schema/resource/collection.interface.d.ts +33 -0
  88. package/typings/common/schema/resource/container.interface.d.ts +9 -0
  89. package/typings/common/schema/resource/endpoint.interface.d.ts +29 -0
  90. package/typings/common/schema/resource/resource.interface.d.ts +12 -0
  91. package/typings/common/schema/resource/singleton.interface.d.ts +22 -0
  92. package/typings/common/schema/type-guards.d.ts +20 -0
  93. package/typings/common/{schema/types.d.ts → types.d.ts} +0 -3
  94. package/typings/common/url/index.d.ts +2 -2
  95. package/typings/common/url/opra-url.d.ts +8 -27
  96. package/typings/common/url/utils/decode-path-component.d.ts +5 -0
  97. package/typings/common/url/utils/encode-path-component.d.ts +1 -0
  98. package/typings/common/utils/path-utils.d.ts +2 -0
  99. package/typings/constants.d.ts +1 -0
  100. package/typings/http/http-client.d.ts +27 -25
  101. package/typings/http/http-collection-node.d.ts +116 -0
  102. package/typings/http/http-request-observable.d.ts +28 -0
  103. package/typings/{common/http → http}/http-request.d.ts +4 -6
  104. package/typings/{common/http → http}/http-response.d.ts +12 -10
  105. package/typings/http/http-service-base.d.ts +5 -0
  106. package/typings/http/http-singleton-node.d.ts +65 -0
  107. package/typings/http/http-types.d.ts +17 -9
  108. package/typings/index.d.ts +7 -13
  109. package/typings/common/constants.d.ts +0 -0
  110. package/typings/common/http/http-param-codec.d.ts +0 -4
  111. package/typings/common/http/http-request-node.d.ts +0 -34
  112. package/typings/common/http/param-codec/boolean-codec.d.ts +0 -5
  113. package/typings/common/http/param-codec/integer-codec.d.ts +0 -9
  114. package/typings/common/http/param-codec/number-codec.d.ts +0 -12
  115. package/typings/common/http/param-codec/string-codec.d.ts +0 -14
  116. package/typings/common/http/utils/encodeURIParam.d.ts +0 -1
  117. package/typings/common/http/utils/normalize-headers.d.ts +0 -1
  118. package/typings/common/schema/decorators/opr-collection-resource.decorator.d.ts +0 -8
  119. package/typings/common/schema/decorators/opr-complex-type.decorator.d.ts +0 -6
  120. package/typings/common/schema/decorators/opr-field.decorator.d.ts +0 -3
  121. package/typings/common/schema/decorators/opr-resolver.decorator.d.ts +0 -8
  122. package/typings/common/schema/decorators/opr-simple-type.decorator.d.ts +0 -6
  123. package/typings/common/schema/decorators/opr-singleton-resource.decorator.d.ts +0 -8
  124. package/typings/common/schema/implementation/data-type/builtin/any.type.d.ts +0 -2
  125. package/typings/common/schema/implementation/data-type/builtin/base64-binary.type.d.ts +0 -2
  126. package/typings/common/schema/implementation/data-type/builtin/bigint.type.d.ts +0 -2
  127. package/typings/common/schema/implementation/data-type/builtin/boolean.type.d.ts +0 -2
  128. package/typings/common/schema/implementation/data-type/builtin/date-string.type.d.ts +0 -2
  129. package/typings/common/schema/implementation/data-type/builtin/date.type.d.ts +0 -2
  130. package/typings/common/schema/implementation/data-type/builtin/guid.type.d.ts +0 -2
  131. package/typings/common/schema/implementation/data-type/builtin/integer.type.d.ts +0 -2
  132. package/typings/common/schema/implementation/data-type/builtin/number.type.d.ts +0 -2
  133. package/typings/common/schema/implementation/data-type/builtin/object.type.d.ts +0 -2
  134. package/typings/common/schema/implementation/data-type/builtin/string.type.d.ts +0 -2
  135. package/typings/common/schema/implementation/data-type/builtin-data-types.d.ts +0 -4
  136. package/typings/common/schema/implementation/data-type/complex-type.d.ts +0 -29
  137. package/typings/common/schema/implementation/data-type/data-type.d.ts +0 -17
  138. package/typings/common/schema/implementation/data-type/simple-type.d.ts +0 -12
  139. package/typings/common/schema/implementation/data-type/union-type.d.ts +0 -16
  140. package/typings/common/schema/implementation/document-builder.d.ts +0 -16
  141. package/typings/common/schema/implementation/opra-document.d.ts +0 -44
  142. package/typings/common/schema/implementation/query/collection-count-query.d.ts +0 -14
  143. package/typings/common/schema/implementation/query/collection-create-query.d.ts +0 -18
  144. package/typings/common/schema/implementation/query/collection-delete-many-query.d.ts +0 -14
  145. package/typings/common/schema/implementation/query/collection-delete-query.d.ts +0 -10
  146. package/typings/common/schema/implementation/query/collection-get-query.d.ts +0 -21
  147. package/typings/common/schema/implementation/query/collection-search-query.d.ts +0 -30
  148. package/typings/common/schema/implementation/query/collection-update-many-query.d.ts +0 -15
  149. package/typings/common/schema/implementation/query/collection-update-query.d.ts +0 -19
  150. package/typings/common/schema/implementation/query/field-get-query.d.ts +0 -30
  151. package/typings/common/schema/implementation/query/index.d.ts +0 -27
  152. package/typings/common/schema/implementation/query/singleton-get-query.d.ts +0 -20
  153. package/typings/common/schema/implementation/resource/collection-resource-info.d.ts +0 -22
  154. package/typings/common/schema/implementation/resource/container-resource-info.d.ts +0 -13
  155. package/typings/common/schema/implementation/resource/resource-info.d.ts +0 -17
  156. package/typings/common/schema/implementation/resource/singleton-resource-info.d.ts +0 -15
  157. package/typings/common/schema/implementation/schema-builder/extract-resource-metadata.util.d.ts +0 -3
  158. package/typings/common/schema/implementation/schema-builder/extract-type-metadata.util.d.ts +0 -4
  159. package/typings/common/schema/interfaces/child-field-query.interface.d.ts +0 -4
  160. package/typings/common/schema/interfaces/data-type.metadata.d.ts +0 -18
  161. package/typings/common/schema/interfaces/resource-container.interface.d.ts +0 -8
  162. package/typings/common/schema/interfaces/resource.metadata.d.ts +0 -18
  163. package/typings/common/schema/opra-schema.definition.d.ts +0 -178
  164. package/typings/common/schema/type-helpers/extend-type.helper.d.ts +0 -3
  165. package/typings/common/schema/type-helpers/mixin-type.helper.d.ts +0 -2
  166. package/typings/common/schema/utils/class.utils.d.ts +0 -2
  167. package/typings/common/schema/utils/normalize-field-array.util.d.ts +0 -3
  168. package/typings/common/schema/utils/path-to-tree.util.d.ts +0 -4
  169. package/typings/common/url/formats/boolean-format.d.ts +0 -5
  170. package/typings/common/url/formats/date-format.d.ts +0 -16
  171. package/typings/common/url/formats/filter-format.d.ts +0 -6
  172. package/typings/common/url/formats/format.d.ts +0 -4
  173. package/typings/common/url/formats/integer-format.d.ts +0 -9
  174. package/typings/common/url/formats/number-format.d.ts +0 -12
  175. package/typings/common/url/formats/string-format.d.ts +0 -14
  176. package/typings/common/url/opra-url-search-params.d.ts +0 -5
  177. package/typings/common/url/utils/path-utils.d.ts +0 -8
  178. package/typings/common/utils/index.d.ts +0 -3
  179. package/typings/common/utils/is-url.d.ts +0 -1
  180. package/typings/common/utils/path-to-tree.d.ts +0 -4
  181. package/typings/http/http-collection-service.d.ts +0 -76
  182. package/typings/http/http-request-host.d.ts +0 -18
  183. package/typings/http/http-singleton-service.d.ts +0 -28
  184. package/typings/http/requests/collection-create-request.d.ts +0 -7
  185. package/typings/http/requests/collection-delete-many-request.d.ts +0 -7
  186. package/typings/http/requests/collection-delete-request.d.ts +0 -7
  187. package/typings/http/requests/collection-get-request.d.ts +0 -7
  188. package/typings/http/requests/collection-search-request.d.ts +0 -7
  189. package/typings/http/requests/collection-update-many-request.d.ts +0 -7
  190. package/typings/http/requests/collection-update-request.d.ts +0 -7
  191. package/typings/http/requests/singleton-create-request.d.ts +0 -7
  192. package/typings/http/requests/singleton-delete-request.d.ts +0 -7
  193. package/typings/http/requests/singleton-get-request.d.ts +0 -7
  194. package/typings/interfaces/http-options.interface.d.ts +0 -17
  195. package/typings/interfaces/http-request-config.interface.d.ts +0 -23
  196. /package/typings/common/{schema → document}/utils/inspect.util.d.ts +0 -0
  197. /package/typings/common/{schema → document}/utils/string-compare.util.d.ts +0 -0
  198. /package/typings/common/{schema/type-helpers/mixin.utils.d.ts → helpers/mixin-utils.d.ts} +0 -0
  199. /package/typings/http/{requests/batch-request.d.ts → batch-request.d.ts} +0 -0
@@ -1,18 +1,12 @@
1
+ export * from './client-error.js';
1
2
  export * from './http/http-client.js';
2
- export * from './http/http-request-host.js';
3
- export * from './http/http-collection-service.js';
4
- export * from './http/http-singleton-service.js';
3
+ export * from './http/http-collection-node.js';
4
+ export * from './http/http-request.js';
5
+ export * from './http/http-request-observable.js';
6
+ export * from './http/http-response.js';
7
+ export * from './http/http-service-base.js';
8
+ export * from './http/http-singleton-node.js';
5
9
  export * from './http/http-types.js';
6
- export * from './client-error.js';
7
- export * from './http/requests/collection-create-request.js';
8
- export * from './http/requests/collection-delete-request.js';
9
- export * from './http/requests/collection-delete-many-request.js';
10
- export * from './http/requests/collection-get-request.js';
11
- export * from './http/requests/collection-search-request.js';
12
- export * from './http/requests/collection-update-request.js';
13
- export * from './http/requests/collection-update-many-request.js';
14
- export * from './http/requests/singleton-get-request.js';
15
- export * from './http/requests/singleton-delete-request.js';
16
10
 
17
11
  export * from './common/filter/index.js';
18
12
  export * from './common/url/index.js';
File without changes
@@ -1,4 +0,0 @@
1
- export declare abstract class HttpParamCodec {
2
- abstract decode(value: string): any;
3
- abstract encode(value: any): string;
4
- }
@@ -1,34 +0,0 @@
1
- /// <reference types="node" />
2
- /// <reference types="node" />
3
- import { Readable } from 'stream';
4
- declare const kHeaders: unique symbol;
5
- declare const kHeadersCount: unique symbol;
6
- declare const kTrailers: unique symbol;
7
- declare const kTrailersCount: unique symbol;
8
- export declare class HttpRequestNode extends Readable {
9
- httpVersionMajor: number;
10
- httpVersionMinor: number;
11
- httpVersion: string;
12
- complete: boolean;
13
- rawHeaders: string[];
14
- rawTrailers: string[];
15
- aborted: boolean;
16
- upgrade: boolean;
17
- url: string;
18
- originalUrl: string;
19
- method: string;
20
- shouldKeepAlive: boolean;
21
- data?: Buffer;
22
- body?: any;
23
- [kHeaders]: Record<string, string | string[]>;
24
- [kHeadersCount]: number;
25
- [kTrailers]: Record<string, string | string[]>;
26
- [kTrailersCount]: number;
27
- get headers(): Record<string, string | string[]>;
28
- get headersCount(): number;
29
- get trailers(): Record<string, string | string[]>;
30
- get trailersCount(): number;
31
- _read(): void;
32
- static parse(input: Buffer): HttpRequestNode;
33
- }
34
- export {};
@@ -1,5 +0,0 @@
1
- import { HttpParamCodec } from '../http-param-codec.js';
2
- export declare class BooleanCodec extends HttpParamCodec {
3
- decode(value: string): boolean;
4
- encode(value: any): string;
5
- }
@@ -1,9 +0,0 @@
1
- import { NumberCodec, NumberFormatOptions } from './number-codec.js';
2
- export interface IntegerFormatOptions extends NumberFormatOptions {
3
- enum?: number[];
4
- }
5
- export declare class IntegerCodec extends NumberCodec {
6
- enum?: number[];
7
- constructor(options?: IntegerFormatOptions);
8
- decode(value: string): number;
9
- }
@@ -1,12 +0,0 @@
1
- import { HttpParamCodec } from '../http-param-codec.js';
2
- export interface NumberFormatOptions {
3
- max?: number;
4
- min?: number;
5
- }
6
- export declare class NumberCodec extends HttpParamCodec {
7
- max?: number;
8
- min?: number;
9
- constructor(options?: NumberFormatOptions);
10
- decode(value: string): number;
11
- encode(value: any): string;
12
- }
@@ -1,14 +0,0 @@
1
- import { HttpParamCodec } from '../http-param-codec.js';
2
- export interface StringFormatOptions {
3
- maxLength?: number;
4
- minLength?: number;
5
- enum?: string[];
6
- }
7
- export declare class StringCodec extends HttpParamCodec {
8
- maxLength?: number;
9
- minLength?: number;
10
- enum?: string[];
11
- constructor(options?: StringFormatOptions);
12
- decode(value: string): string;
13
- encode(value: any): string;
14
- }
@@ -1 +0,0 @@
1
- export declare function encodeURIParam(v: string): string;
@@ -1 +0,0 @@
1
- export declare function normalizeHeaders(headers: any, normalCase?: boolean): Record<string, string | string[]>;
@@ -1,8 +0,0 @@
1
- import "reflect-metadata";
2
- import { PartialSome, StrictOmit } from 'ts-gems';
3
- import { CollectionResourceMetadata } from '../interfaces/resource.metadata.js';
4
- import { TypeThunkAsync } from '../types.js';
5
- export type CollectionResourceOptions = PartialSome<StrictOmit<CollectionResourceMetadata, 'name' | 'kind' | 'type' | 'instance' | 'create' | 'count' | 'get' | 'update' | 'updateMany' | 'delete' | 'deleteMany' | 'search'>, 'keyFields'> & {
6
- name?: string;
7
- };
8
- export declare function OprCollectionResource(entityFunc: TypeThunkAsync, options?: CollectionResourceOptions): (target: Function) => void;
@@ -1,6 +0,0 @@
1
- import { StrictOmit } from 'ts-gems';
2
- import { ComplexTypeMetadata } from '../interfaces/data-type.metadata.js';
3
- export type ComplexTypeDecoratorOptions = Partial<StrictOmit<ComplexTypeMetadata, 'name' | 'kind' | 'ctor' | 'fields' | 'extends'>> & {
4
- name?: string;
5
- };
6
- export declare function OprComplexType(options?: ComplexTypeDecoratorOptions): ClassDecorator;
@@ -1,3 +0,0 @@
1
- import { StrictOmit } from 'ts-gems';
2
- import { FieldMetadata } from '../interfaces/data-type.metadata.js';
3
- export declare function OprField(args?: Partial<StrictOmit<FieldMetadata, 'isArray'>>): PropertyDecorator;
@@ -1,8 +0,0 @@
1
- import { ICreateResolverMetadata, IDeleteManyResolverMetadata, IDeleteResolverMetadata, IGetResolverMetadata, ISearchResolverMetadata, IUpdateManyResolverMetadata, IUpdateResolverMetadata } from '../interfaces/resource.metadata.js';
2
- export declare function OprCreateResolver(options?: ICreateResolverMetadata): (target: Object, propertyKey: 'create') => void;
3
- export declare function OprDeleteResolver(options?: IDeleteResolverMetadata): (target: Object, propertyKey: 'delete') => void;
4
- export declare function OprDeleteManyResolver(options?: IDeleteManyResolverMetadata): (target: Object, propertyKey: 'deleteMany') => void;
5
- export declare function OprUpdateResolver(options?: IUpdateResolverMetadata): (target: Object, propertyKey: 'update') => void;
6
- export declare function OprUpdateManyResolver(options?: IUpdateManyResolverMetadata): (target: Object, propertyKey: 'updateMany') => void;
7
- export declare function OprGetResolver(options?: IGetResolverMetadata): (target: Object, propertyKey: 'get') => void;
8
- export declare function OprSearchResolver(options?: ISearchResolverMetadata): (target: Object, propertyKey: 'search') => void;
@@ -1,6 +0,0 @@
1
- import { StrictOmit } from 'ts-gems';
2
- import { SimpleTypeMetadata } from '../interfaces/data-type.metadata.js';
3
- export type SimpleTypeDecoratorOptions = Partial<StrictOmit<SimpleTypeMetadata, 'name' | 'kind'>> & {
4
- name?: string;
5
- };
6
- export declare function OprSimpleType(options?: SimpleTypeDecoratorOptions): ClassDecorator;
@@ -1,8 +0,0 @@
1
- import "reflect-metadata";
2
- import { StrictOmit } from 'ts-gems';
3
- import { SingletonResourceMetadata } from '../interfaces/resource.metadata.js';
4
- import { TypeThunkAsync } from '../types.js';
5
- export type SingletonResourceOptions = StrictOmit<SingletonResourceMetadata, 'name' | 'kind' | 'type' | 'instance' | 'create' | 'get' | 'update' | 'delete'> & {
6
- name?: string;
7
- };
8
- export declare function OprSingletonResource(type: TypeThunkAsync | string, options?: SingletonResourceOptions): (target: Function) => void;
@@ -1,2 +0,0 @@
1
- import { OpraSchema } from '../../../opra-schema.definition.js';
2
- export declare const AnyType: OpraSchema.UnionType;
@@ -1,2 +0,0 @@
1
- import { OpraSchema } from '../../../opra-schema.definition.js';
2
- export declare const Base64BinaryType: OpraSchema.SimpleType;
@@ -1,2 +0,0 @@
1
- import { OpraSchema } from '../../../opra-schema.definition.js';
2
- export declare const BigIntType: OpraSchema.SimpleType;
@@ -1,2 +0,0 @@
1
- import { OpraSchema } from '../../../opra-schema.definition.js';
2
- export declare const BooleanType: OpraSchema.SimpleType;
@@ -1,2 +0,0 @@
1
- import { OpraSchema } from '../../../opra-schema.definition.js';
2
- export declare const DateStringType: OpraSchema.SimpleType;
@@ -1,2 +0,0 @@
1
- import { OpraSchema } from '../../../opra-schema.definition.js';
2
- export declare const DateType: OpraSchema.SimpleType;
@@ -1,2 +0,0 @@
1
- import { OpraSchema } from '../../../opra-schema.definition.js';
2
- export declare const GuidType: OpraSchema.SimpleType;
@@ -1,2 +0,0 @@
1
- import { OpraSchema } from '../../../opra-schema.definition.js';
2
- export declare const IntegerType: OpraSchema.SimpleType;
@@ -1,2 +0,0 @@
1
- import { OpraSchema } from '../../../opra-schema.definition.js';
2
- export declare const NumberType: OpraSchema.SimpleType;
@@ -1,2 +0,0 @@
1
- import { OpraSchema } from '../../../opra-schema.definition.js';
2
- export declare const ObjectType: OpraSchema.ComplexType;
@@ -1,2 +0,0 @@
1
- import { OpraSchema } from '../../../opra-schema.definition.js';
2
- export declare const StringType: OpraSchema.SimpleType;
@@ -1,4 +0,0 @@
1
- import { ResponsiveMap } from '../../../helpers/responsive-map.js';
2
- import { OpraSchema } from '../../opra-schema.definition.js';
3
- export declare const builtInTypes: ResponsiveMap<string, OpraSchema.DataType>;
4
- export declare const primitiveClasses: Map<Function, string>;
@@ -1,29 +0,0 @@
1
- import { StrictOmit } from 'ts-gems';
2
- import { ResponsiveMap } from '../../../helpers/responsive-map.js';
3
- import { OpraSchema } from '../../opra-schema.definition.js';
4
- import { nodeInspectCustom } from '../../utils/inspect.util.js';
5
- import type { OpraDocument } from '../opra-document';
6
- import { DataType } from './data-type.js';
7
- export type ComplexTypeArgs = StrictOmit<OpraSchema.ComplexType, 'kind'>;
8
- export declare class ComplexType extends DataType {
9
- protected _initialized: boolean;
10
- protected _metadata: OpraSchema.ComplexType;
11
- private _mixinAdditionalFields;
12
- readonly ownFields: ResponsiveMap<string, Field>;
13
- readonly fields: ResponsiveMap<string, Field>;
14
- constructor(owner: OpraDocument, name: any, args: ComplexTypeArgs);
15
- get abstract(): boolean;
16
- get additionalFields(): string | boolean | Pick<OpraSchema.Field, "type" | "format" | "isArray" | "enum">;
17
- get extends(): OpraSchema.ComplexTypeExtendingInfo[] | undefined;
18
- getField(fieldName: string): Field;
19
- getFieldType(fieldName: string): DataType;
20
- getOwnField(name: string): Field;
21
- getSchema(): OpraSchema.ComplexType;
22
- toString(): string;
23
- [nodeInspectCustom](): string;
24
- init(): void;
25
- }
26
- export interface Field extends OpraSchema.Field {
27
- name: string;
28
- parent: ComplexType;
29
- }
@@ -1,17 +0,0 @@
1
- import { Type } from 'ts-gems';
2
- import { OpraSchema } from '../../opra-schema.definition.js';
3
- import type { OpraDocument } from '../opra-document';
4
- export declare abstract class DataType {
5
- protected _document: OpraDocument;
6
- protected _metadata: OpraSchema.BaseDataType;
7
- protected _name: string;
8
- protected constructor(document: OpraDocument, name: any, metadata: OpraSchema.DataType);
9
- get document(): OpraDocument;
10
- get kind(): OpraSchema.DataTypeKind;
11
- get name(): string;
12
- get description(): string | undefined;
13
- get ctor(): Type | undefined;
14
- get isBuiltin(): boolean;
15
- parse<T>(value: any): T;
16
- getSchema(jsonOnly?: boolean): any;
17
- }
@@ -1,12 +0,0 @@
1
- import { StrictOmit } from 'ts-gems';
2
- import { OpraSchema } from '../../opra-schema.definition.js';
3
- import { nodeInspectCustom } from '../../utils/inspect.util.js';
4
- import type { OpraDocument } from '../opra-document';
5
- import { DataType } from './data-type.js';
6
- export declare class SimpleType extends DataType {
7
- protected readonly _metadata: OpraSchema.SimpleType;
8
- readonly base?: SimpleType;
9
- constructor(owner: OpraDocument, name: string, args: StrictOmit<OpraSchema.SimpleType, 'kind'>);
10
- toString(): string;
11
- [nodeInspectCustom](): string;
12
- }
@@ -1,16 +0,0 @@
1
- import { StrictOmit } from 'ts-gems';
2
- import { OpraSchema } from '../../opra-schema.definition.js';
3
- import { nodeInspectCustom } from '../../utils/inspect.util.js';
4
- import type { OpraDocument } from '../opra-document';
5
- import { DataType } from './data-type.js';
6
- export type UnionTypeArgs = StrictOmit<OpraSchema.UnionType, 'kind'> & {
7
- types: DataType[];
8
- };
9
- export declare class UnionType extends DataType {
10
- protected readonly _metadata: StrictOmit<OpraSchema.UnionType, 'types'>;
11
- readonly types: DataType[];
12
- readonly hasAdditionalFields: boolean;
13
- constructor(owner: OpraDocument, name: string, args: UnionTypeArgs);
14
- toString(): string;
15
- [nodeInspectCustom](): string;
16
- }
@@ -1,16 +0,0 @@
1
- import { Type } from 'ts-gems';
2
- import { ResponsiveMap } from '../../helpers/responsive-map.js';
3
- import { OpraSchema } from '../opra-schema.definition.js';
4
- import { ThunkAsync } from '../types.js';
5
- export type DocumentBuilderArgs = Pick<OpraSchema.Document, 'info' | 'servers'>;
6
- export declare class DocumentBuilder {
7
- protected _args: DocumentBuilderArgs;
8
- protected _dataTypes: ResponsiveMap<string, OpraSchema.DataType>;
9
- protected _resources: ResponsiveMap<string, OpraSchema.Resource>;
10
- constructor(args: DocumentBuilderArgs);
11
- buildSchema(): OpraSchema.Document;
12
- addDataTypeSchema(name: string, schema: OpraSchema.DataType): Promise<void>;
13
- addDataTypeClass(thunk: ThunkAsync<Type | Function>): Promise<string>;
14
- addResourceSchema(name: string, schema: OpraSchema.Resource): Promise<void>;
15
- addResourceInstance(thunk: ThunkAsync<any>): Promise<string>;
16
- }
@@ -1,44 +0,0 @@
1
- import { Type } from 'ts-gems';
2
- import { ResponsiveMap } from '../../helpers/responsive-map.js';
3
- import { IResourceContainer } from '../interfaces/resource-container.interface.js';
4
- import { OpraSchema } from '../opra-schema.definition.js';
5
- import { ThunkAsync } from '../types.js';
6
- import { ComplexType } from './data-type/complex-type.js';
7
- import { DataType } from './data-type/data-type.js';
8
- import { SimpleType } from './data-type/simple-type.js';
9
- import { UnionType } from './data-type/union-type.js';
10
- import { DocumentBuilderArgs } from './document-builder.js';
11
- import { CollectionResourceInfo } from './resource/collection-resource-info.js';
12
- import { ResourceInfo } from './resource/resource-info.js';
13
- import { SingletonResourceInfo } from './resource/singleton-resource-info.js';
14
- export type OpraDocumentArgs = DocumentBuilderArgs & {
15
- types?: ThunkAsync<Type>[] | Record<string, OpraSchema.DataType>;
16
- resources?: ThunkAsync<any>[] | Record<string, OpraSchema.Resource>;
17
- };
18
- type OpraDocumentMeta = Pick<OpraSchema.Document, 'info' | 'servers'>;
19
- export declare namespace OpraDocument {
20
- }
21
- export declare class OpraDocument implements IResourceContainer {
22
- protected readonly _meta: OpraDocumentMeta;
23
- protected _ownTypes: ResponsiveMap<string, DataType>;
24
- protected _types: ResponsiveMap<string, DataType>;
25
- protected _resources: ResponsiveMap<string, ResourceInfo>;
26
- constructor(schema: OpraSchema.Document);
27
- get info(): OpraSchema.DocumentInfo;
28
- get types(): Map<string, DataType>;
29
- getDataType(name: string): DataType;
30
- getComplexDataType(name: string): ComplexType;
31
- getSimpleDataType(name: string): SimpleType;
32
- getUnionDataType(name: string): UnionType;
33
- get resources(): Map<string, ResourceInfo>;
34
- get servers(): OpraSchema.ServerInfo[] | undefined;
35
- getResource<T extends ResourceInfo>(name: string): T;
36
- getCollectionResource(name: string): CollectionResourceInfo;
37
- getSingletonResource(name: string): SingletonResourceInfo;
38
- getMetadata(jsonOnly?: boolean): OpraSchema.Document;
39
- protected _addDataType(name: string, schema: OpraSchema.DataType, isOwn: boolean): DataType;
40
- protected _addResource(name: string, schema: OpraSchema.Resource): void;
41
- protected _initTypes(): void;
42
- static create(args: OpraDocumentArgs): Promise<OpraDocument>;
43
- }
44
- export {};
@@ -1,14 +0,0 @@
1
- import { Expression } from '../../../filter/index.js';
2
- import { CollectionResourceInfo } from '../resource/collection-resource-info.js';
3
- export type CollectionCountQueryOptions = {
4
- filter?: string | Expression;
5
- };
6
- export declare class CollectionCountQuery {
7
- readonly resource: CollectionResourceInfo;
8
- readonly kind = "CollectionCountQuery";
9
- readonly method = "count";
10
- readonly operation = "read";
11
- filter?: Expression;
12
- constructor(resource: CollectionResourceInfo, options?: CollectionCountQueryOptions);
13
- get dataType(): import("../data-type/complex-type.js").ComplexType;
14
- }
@@ -1,18 +0,0 @@
1
- import { CollectionResourceInfo } from '../resource/collection-resource-info.js';
2
- export type CollectionCreateQueryOptions = {
3
- pick?: string[];
4
- omit?: string[];
5
- include?: string[];
6
- };
7
- export declare class CollectionCreateQuery {
8
- readonly resource: CollectionResourceInfo;
9
- data: {};
10
- readonly kind = "CollectionCreateQuery";
11
- readonly method = "create";
12
- readonly operation = "create";
13
- pick?: string[];
14
- omit?: string[];
15
- include?: string[];
16
- constructor(resource: CollectionResourceInfo, data: {}, options?: CollectionCreateQueryOptions);
17
- get dataType(): import("../data-type/complex-type.js").ComplexType;
18
- }
@@ -1,14 +0,0 @@
1
- import { Expression } from '../../../filter/index.js';
2
- import { CollectionResourceInfo } from '../resource/collection-resource-info.js';
3
- export type CollectionDeleteManyQueryOptions = {
4
- filter?: string | Expression;
5
- };
6
- export declare class CollectionDeleteManyQuery {
7
- readonly resource: CollectionResourceInfo;
8
- readonly kind = "CollectionDeleteManyQuery";
9
- readonly method = "deleteMany";
10
- readonly operation = "delete";
11
- filter?: Expression;
12
- constructor(resource: CollectionResourceInfo, options?: CollectionDeleteManyQueryOptions);
13
- get dataType(): import("../data-type/complex-type.js").ComplexType;
14
- }
@@ -1,10 +0,0 @@
1
- import { CollectionResourceInfo } from '../resource/collection-resource-info.js';
2
- export declare class CollectionDeleteQuery {
3
- readonly resource: CollectionResourceInfo;
4
- readonly kind = "CollectionDeleteQuery";
5
- readonly method = "delete";
6
- readonly operation = "delete";
7
- keyValue: any;
8
- constructor(resource: CollectionResourceInfo, keyValue: any);
9
- get dataType(): import("../data-type/complex-type.js").ComplexType;
10
- }
@@ -1,21 +0,0 @@
1
- import type { IChildFieldQuery } from '../../interfaces/child-field-query.interface.js';
2
- import type { CollectionResourceInfo } from '../resource/collection-resource-info.js';
3
- import type { FieldGetQuery } from './field-get-query.js';
4
- export type CollectionGetQueryOptions = {
5
- pick?: string[];
6
- omit?: string[];
7
- include?: string[];
8
- };
9
- export declare class CollectionGetQuery implements IChildFieldQuery {
10
- readonly resource: CollectionResourceInfo;
11
- readonly kind = "CollectionGetQuery";
12
- readonly method = "get";
13
- readonly operation = "read";
14
- keyValue: any;
15
- pick?: string[];
16
- omit?: string[];
17
- include?: string[];
18
- child?: FieldGetQuery;
19
- constructor(resource: CollectionResourceInfo, keyValue: any, options?: CollectionGetQueryOptions);
20
- get dataType(): import("../data-type/complex-type.js").ComplexType;
21
- }
@@ -1,30 +0,0 @@
1
- import { Expression } from '../../../filter/index.js';
2
- import { CollectionResourceInfo } from '../resource/collection-resource-info.js';
3
- export type CollectionSearchQueryOptions = {
4
- pick?: string[];
5
- omit?: string[];
6
- include?: string[];
7
- filter?: string | Expression;
8
- limit?: number;
9
- skip?: number;
10
- distinct?: boolean;
11
- count?: boolean;
12
- sort?: string[];
13
- };
14
- export declare class CollectionSearchQuery {
15
- readonly resource: CollectionResourceInfo;
16
- readonly kind = "CollectionSearchQuery";
17
- readonly method = "search";
18
- readonly operation = "read";
19
- pick?: string[];
20
- omit?: string[];
21
- include?: string[];
22
- filter?: Expression;
23
- limit?: number;
24
- skip?: number;
25
- distinct?: boolean;
26
- count?: boolean;
27
- sort?: string[];
28
- constructor(resource: CollectionResourceInfo, options?: CollectionSearchQueryOptions);
29
- get dataType(): import("../data-type/complex-type.js").ComplexType;
30
- }
@@ -1,15 +0,0 @@
1
- import { Expression } from '../../../filter/index.js';
2
- import { CollectionResourceInfo } from '../resource/collection-resource-info.js';
3
- export type CollectionUpdateManyQueryOptions = {
4
- filter?: string | Expression;
5
- };
6
- export declare class CollectionUpdateManyQuery {
7
- readonly resource: CollectionResourceInfo;
8
- data: {};
9
- readonly kind = "CollectionUpdateManyQuery";
10
- readonly method = "updateMany";
11
- readonly operation = "update";
12
- filter?: Expression;
13
- constructor(resource: CollectionResourceInfo, data: {}, options?: CollectionUpdateManyQueryOptions);
14
- get dataType(): import("../data-type/complex-type.js").ComplexType;
15
- }
@@ -1,19 +0,0 @@
1
- import { CollectionResourceInfo } from '../resource/collection-resource-info.js';
2
- export type CollectionUpdateQueryOptions = {
3
- pick?: string[];
4
- omit?: string[];
5
- include?: string[];
6
- };
7
- export declare class CollectionUpdateQuery {
8
- readonly resource: CollectionResourceInfo;
9
- data: any;
10
- readonly kind = "CollectionUpdateQuery";
11
- readonly method = "update";
12
- readonly operation = "update";
13
- keyValue: any;
14
- pick?: string[];
15
- omit?: string[];
16
- include?: string[];
17
- constructor(resource: CollectionResourceInfo, keyValue: any, data: any, options?: CollectionUpdateQueryOptions);
18
- get dataType(): import("../data-type/complex-type.js").ComplexType;
19
- }
@@ -1,30 +0,0 @@
1
- import type { IChildFieldQuery } from '../../interfaces/child-field-query.interface.js';
2
- import { ComplexType, Field } from '../data-type/complex-type.js';
3
- import type { DataType } from '../data-type/data-type.js';
4
- import type { CollectionResourceInfo } from '../resource/collection-resource-info.js';
5
- import type { SingletonResourceInfo } from '../resource/singleton-resource-info.js';
6
- import type { CollectionGetQuery } from './collection-get-query.js';
7
- import type { SingletonGetQuery } from './singleton-get-query.js';
8
- export type FieldGetQueryOptions = {
9
- pick?: string[];
10
- omit?: string[];
11
- include?: string[];
12
- castingType?: ComplexType;
13
- };
14
- export declare class FieldGetQuery implements IChildFieldQuery {
15
- readonly parent: CollectionGetQuery | SingletonGetQuery | FieldGetQuery;
16
- readonly resource: CollectionResourceInfo | SingletonResourceInfo;
17
- readonly kind = "FieldGetQuery";
18
- readonly method = "get";
19
- readonly operation = "read";
20
- readonly fieldName: string;
21
- readonly field?: Field;
22
- readonly path: string;
23
- readonly dataType: DataType;
24
- readonly parentType: ComplexType;
25
- pick?: string[];
26
- omit?: string[];
27
- include?: string[];
28
- child?: FieldGetQuery;
29
- constructor(parent: CollectionGetQuery | SingletonGetQuery | FieldGetQuery, fieldName: string, options?: FieldGetQueryOptions);
30
- }
@@ -1,27 +0,0 @@
1
- import { IChildFieldQuery } from '../../interfaces/child-field-query.interface.js';
2
- import { CollectionCountQuery } from './collection-count-query.js';
3
- import { CollectionCreateQuery } from './collection-create-query.js';
4
- import { CollectionDeleteManyQuery } from './collection-delete-many-query.js';
5
- import { CollectionDeleteQuery } from './collection-delete-query.js';
6
- import { CollectionGetQuery } from './collection-get-query.js';
7
- import { CollectionSearchQuery } from './collection-search-query.js';
8
- import { CollectionUpdateManyQuery } from './collection-update-many-query.js';
9
- import { CollectionUpdateQuery } from './collection-update-query.js';
10
- import { FieldGetQuery } from './field-get-query.js';
11
- import { SingletonGetQuery } from './singleton-get-query.js';
12
- export * from './collection-create-query.js';
13
- export * from './collection-count-query.js';
14
- export * from './collection-delete-many-query.js';
15
- export * from './collection-delete-query.js';
16
- export * from './collection-delete-many-query.js';
17
- export * from './collection-get-query.js';
18
- export * from './field-get-query.js';
19
- export * from './singleton-get-query.js';
20
- export * from './collection-search-query.js';
21
- export * from './collection-update-many-query.js';
22
- export * from './collection-update-query.js';
23
- export type CollectionQuery = CollectionCountQuery | CollectionCreateQuery | CollectionDeleteManyQuery | CollectionDeleteQuery | CollectionGetQuery | CollectionSearchQuery | CollectionUpdateManyQuery | CollectionUpdateQuery;
24
- export type FieldQuery = FieldGetQuery;
25
- export type SingletonQuery = SingletonGetQuery;
26
- export type OpraQuery = CollectionQuery | SingletonQuery | FieldQuery;
27
- export declare function isChildFieldQuery(query: any): query is IChildFieldQuery;
@@ -1,20 +0,0 @@
1
- import type { IChildFieldQuery } from '../../interfaces/child-field-query.interface.js';
2
- import type { SingletonResourceInfo } from '../resource/singleton-resource-info.js';
3
- import type { FieldGetQuery } from './field-get-query.js';
4
- export type SingletonGetQueryOptions = {
5
- pick?: string[];
6
- omit?: string[];
7
- include?: string[];
8
- };
9
- export declare class SingletonGetQuery implements IChildFieldQuery {
10
- readonly resource: SingletonResourceInfo;
11
- readonly kind = "SingletonGetQuery";
12
- readonly method = "get";
13
- readonly operation = "read";
14
- pick?: string[];
15
- omit?: string[];
16
- include?: string[];
17
- child?: FieldGetQuery;
18
- constructor(resource: SingletonResourceInfo, options?: SingletonGetQueryOptions);
19
- get dataType(): import("../data-type/complex-type.js").ComplexType;
20
- }
@@ -1,22 +0,0 @@
1
- import { OpraSchema } from '../../opra-schema.definition.js';
2
- import { ComplexType } from '../data-type/complex-type.js';
3
- import type { OpraDocument } from '../opra-document';
4
- import { ResourceInfo } from './resource-info.js';
5
- export declare class CollectionResourceInfo extends ResourceInfo {
6
- readonly metadata: OpraSchema.CollectionResource;
7
- readonly dataType: ComplexType;
8
- constructor(document: OpraDocument, name: string, dataType: ComplexType, metadata: OpraSchema.CollectionResource);
9
- get instance(): {} | undefined;
10
- get keyFields(): string[];
11
- get create(): OpraSchema.CreateMethodResolver | undefined;
12
- get count(): OpraSchema.MethodResolver | undefined;
13
- get delete(): OpraSchema.MethodResolver | undefined;
14
- get deleteMany(): OpraSchema.DeleteManyMethodResolver | undefined;
15
- get get(): OpraSchema.GetMethodResolver | undefined;
16
- get update(): OpraSchema.UpdateMethodResolver | undefined;
17
- get updateMany(): OpraSchema.UpdateManyMethodResolver | undefined;
18
- get search(): OpraSchema.SearchMethodResolver | undefined;
19
- getHandlerNames(): string[];
20
- getHandler(method: string): Function;
21
- getSchema(jsonOnly?: boolean): OpraSchema.CollectionResource;
22
- }