@opra/common 1.0.0-alpha.8 → 1.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/browser/index.cjs +12 -0
- package/browser/index.mjs +12 -0
- package/cjs/document/api-document.js +11 -0
- package/cjs/document/common/api-base.js +1 -1
- package/cjs/document/common/document-element.js +2 -0
- package/cjs/document/data-type/api-field.js +8 -7
- package/cjs/document/data-type/complex-type-base.js +5 -3
- package/cjs/document/data-type/extended-types/date-string.type.js +2 -2
- package/cjs/document/data-type/extended-types/date-time-string.type.js +2 -2
- package/cjs/document/data-type/extended-types/date-time.type.js +2 -2
- package/cjs/document/data-type/extended-types/date.type.js +2 -2
- package/cjs/document/data-type/extended-types/email.type.js +2 -2
- package/cjs/document/data-type/extended-types/filter.type.js +1 -1
- package/cjs/document/data-type/extended-types/time.type.js +2 -2
- package/cjs/document/data-type/extended-types/url.type.js +2 -2
- package/cjs/document/data-type/omit-type.js +7 -2
- package/cjs/document/data-type/partial-type.js +7 -2
- package/cjs/document/data-type/pick-type.js +1 -2
- package/cjs/document/data-type/primitive-types/object.type.js +0 -3
- package/cjs/document/data-type/required-type.js +1 -2
- package/cjs/document/data-type/simple-type.js +1 -6
- package/cjs/document/data-type/utils/create-mapped-class.js +1 -2
- package/cjs/document/data-type/utils/get-is-inherited-predicate-fn.js +1 -2
- package/cjs/document/decorators/api-field-decorator.js +4 -6
- package/cjs/document/decorators/complex-type.decorator.js +1 -2
- package/cjs/document/decorators/http-controller.decorator.js +2 -3
- package/cjs/document/decorators/http-operation-entity.decorator.js +68 -74
- package/cjs/document/decorators/http-operation.decorator.js +4 -2
- package/cjs/document/decorators/simple-type.decorator.js +2 -3
- package/cjs/document/factory/api-document.factory.js +17 -8
- package/cjs/document/http/http-api.js +0 -1
- package/cjs/document/http/http-controller.js +4 -2
- package/cjs/document/http/http-media-type.js +17 -2
- package/cjs/document/http/http-multipart-field.js +0 -1
- package/cjs/document/http/http-operation-response.js +0 -1
- package/cjs/document/http/http-operation.js +12 -1
- package/cjs/document/http/http-parameter.js +2 -0
- package/cjs/document/http/http-request-body.js +0 -1
- package/cjs/document/http/http-status-range.js +5 -2
- package/cjs/document/utils/parse-regexp.util.js +1 -2
- package/cjs/document/utils/string-compare.util.js +1 -2
- package/cjs/exception/opra-exception.js +1 -0
- package/cjs/filter/build.js +21 -22
- package/cjs/filter/filter-rules.js +17 -16
- package/cjs/filter/parse.js +1 -2
- package/cjs/filter/utils.js +2 -3
- package/cjs/helpers/function-utils.js +1 -2
- package/cjs/helpers/get-stack-filename.js +2 -3
- package/cjs/helpers/index.js +1 -0
- package/cjs/helpers/mixin-utils.js +2 -3
- package/cjs/helpers/object-utils.js +5 -6
- package/cjs/helpers/parse-fields-projection.js +3 -3
- package/cjs/helpers/safe-json-stringify.js +16 -0
- package/cjs/helpers/type-guards.js +10 -11
- package/cjs/i18n/string-utils.js +2 -3
- package/cjs/i18n/translate.js +1 -2
- package/cjs/schema/index.js +2 -27
- package/cjs/schema/opra-schema.js +24 -0
- package/cjs/schema/type-guards.js +7 -8
- package/esm/document/api-document.js +11 -0
- package/esm/document/common/api-base.js +1 -1
- package/esm/document/common/document-element.js +2 -0
- package/esm/document/data-type/api-field.js +8 -7
- package/esm/document/data-type/complex-type-base.js +5 -3
- package/esm/document/data-type/extended-types/date-string.type.js +2 -2
- package/esm/document/data-type/extended-types/date-time-string.type.js +2 -2
- package/esm/document/data-type/extended-types/date-time.type.js +2 -2
- package/esm/document/data-type/extended-types/date.type.js +2 -2
- package/esm/document/data-type/extended-types/email.type.js +2 -2
- package/esm/document/data-type/extended-types/filter.type.js +1 -1
- package/esm/document/data-type/extended-types/time.type.js +2 -2
- package/esm/document/data-type/extended-types/url.type.js +2 -2
- package/esm/document/data-type/omit-type.js +6 -0
- package/esm/document/data-type/partial-type.js +6 -0
- package/esm/document/data-type/primitive-types/object.type.js +0 -3
- package/esm/document/data-type/simple-type.js +1 -6
- package/esm/document/decorators/api-field-decorator.js +1 -2
- package/esm/document/decorators/http-controller.decorator.js +1 -1
- package/esm/document/decorators/http-operation-entity.decorator.js +25 -31
- package/esm/document/decorators/http-operation.decorator.js +3 -0
- package/esm/document/factory/api-document.factory.js +17 -7
- package/esm/document/http/http-api.js +0 -1
- package/esm/document/http/http-controller.js +3 -2
- package/esm/document/http/http-media-type.js +16 -2
- package/esm/document/http/http-multipart-field.js +0 -1
- package/esm/document/http/http-operation-response.js +0 -1
- package/esm/document/http/http-operation.js +12 -1
- package/esm/document/http/http-parameter.js +2 -0
- package/esm/document/http/http-request-body.js +0 -1
- package/esm/document/http/http-status-range.js +5 -2
- package/esm/exception/opra-exception.js +1 -0
- package/esm/filter/filter-rules.js +10 -9
- package/esm/helpers/index.js +1 -0
- package/esm/helpers/object-utils.js +2 -2
- package/esm/helpers/safe-json-stringify.js +13 -0
- package/esm/package.json +3 -0
- package/esm/schema/index.js +2 -27
- package/esm/schema/opra-schema.js +21 -0
- package/package.json +47 -53
- package/types/document/api-document.d.ts +2 -1
- package/types/document/common/api-base.d.ts +2 -2
- package/types/document/common/data-type-map.d.ts +1 -1
- package/types/document/common/document-element.d.ts +1 -0
- package/types/document/common/document-node.d.ts +8 -8
- package/types/document/common/value.d.ts +1 -1
- package/types/document/data-type/api-field.d.ts +11 -1
- package/types/document/data-type/complex-type-base.d.ts +6 -7
- package/types/document/data-type/complex-type.d.ts +1 -1
- package/types/document/data-type/data-type.d.ts +3 -2
- package/types/document/data-type/enum-type.d.ts +2 -2
- package/types/document/data-type/extended-types/base64.type.d.ts +1 -1
- package/types/document/data-type/extended-types/date-string.type.d.ts +1 -1
- package/types/document/data-type/extended-types/date-time-string.type.d.ts +1 -1
- package/types/document/data-type/extended-types/date-time.type.d.ts +1 -1
- package/types/document/data-type/extended-types/date.type.d.ts +1 -1
- package/types/document/data-type/extended-types/email.type.d.ts +1 -1
- package/types/document/data-type/extended-types/field-path.type.d.ts +3 -3
- package/types/document/data-type/extended-types/filter.type.d.ts +3 -3
- package/types/document/data-type/extended-types/object-id.type.d.ts +1 -1
- package/types/document/data-type/extended-types/operation-result.type.d.ts +2 -2
- package/types/document/data-type/extended-types/time.type.d.ts +1 -1
- package/types/document/data-type/extended-types/url.type.d.ts +1 -1
- package/types/document/data-type/extended-types/uuid.type.d.ts +1 -1
- package/types/document/data-type/mapped-type.d.ts +3 -3
- package/types/document/data-type/mixin-type.d.ts +1 -1
- package/types/document/data-type/omit-type.d.ts +1 -7
- package/types/document/data-type/partial-type.d.ts +1 -7
- package/types/document/data-type/pick-type.d.ts +3 -3
- package/types/document/data-type/primitive-types/any.type.d.ts +1 -1
- package/types/document/data-type/primitive-types/bigint.type.d.ts +1 -1
- package/types/document/data-type/primitive-types/boolean.type.d.ts +1 -1
- package/types/document/data-type/primitive-types/integer.type.d.ts +1 -1
- package/types/document/data-type/primitive-types/null.type.d.ts +1 -1
- package/types/document/data-type/primitive-types/number.type.d.ts +1 -1
- package/types/document/data-type/primitive-types/string.type.d.ts +1 -1
- package/types/document/data-type/required-type.d.ts +8 -8
- package/types/document/data-type/simple-type.d.ts +2 -2
- package/types/document/data-type/utils/create-mapped-class.d.ts +2 -2
- package/types/document/decorators/api-field-decorator.d.ts +1 -1
- package/types/document/decorators/http-controller.decorator.d.ts +3 -3
- package/types/document/decorators/http-operation-entity.decorator.d.ts +5 -4
- package/types/document/decorators/http-operation.decorator.d.ts +1 -1
- package/types/document/factory/api-document.factory.d.ts +2 -1
- package/types/document/factory/data-type.factory.d.ts +1 -1
- package/types/document/factory/http-api.factory.d.ts +1 -1
- package/types/document/http/http-api.d.ts +2 -2
- package/types/document/http/http-controller.d.ts +1 -1
- package/types/document/http/http-media-type.d.ts +3 -2
- package/types/document/http/http-multipart-field.d.ts +1 -2
- package/types/document/http/http-operation-response.d.ts +1 -1
- package/types/document/http/http-operation.d.ts +6 -5
- package/types/document/http/http-parameter.d.ts +2 -2
- package/types/document/http/http-request-body.d.ts +1 -1
- package/types/document/http/http-status-range.d.ts +2 -1
- package/types/exception/http-errors/bad-request.error.d.ts +1 -1
- package/types/exception/http-errors/conflict.error.d.ts +1 -1
- package/types/exception/http-errors/failed-dependency.error.d.ts +1 -1
- package/types/exception/http-errors/forbidden.error.d.ts +1 -1
- package/types/exception/http-errors/internal-server.error.d.ts +1 -1
- package/types/exception/http-errors/method-not-allowed.error.d.ts +1 -1
- package/types/exception/http-errors/not-acceptable.error.d.ts +1 -1
- package/types/exception/http-errors/not-found.error.d.ts +1 -1
- package/types/exception/http-errors/permission.error.d.ts +1 -1
- package/types/exception/http-errors/unauthorized.error.d.ts +1 -1
- package/types/exception/http-errors/unprocessable-entity.error.d.ts +1 -1
- package/types/exception/opra-exception.d.ts +1 -1
- package/types/exception/opra-http-error.d.ts +1 -1
- package/types/filter/antlr/OpraFilterParser.d.ts +1 -1
- package/types/filter/ast/expressions/comparison-expression.d.ts +1 -1
- package/types/filter/errors.d.ts +3 -4
- package/types/filter/filter-rules.d.ts +5 -5
- package/types/filter/opra-error-listener.d.ts +1 -2
- package/types/helpers/function-utils.d.ts +1 -1
- package/types/helpers/index.d.ts +1 -0
- package/types/helpers/mixin-utils.d.ts +1 -1
- package/types/helpers/object-utils.d.ts +1 -1
- package/types/helpers/safe-json-stringify.d.ts +1 -0
- package/types/helpers/type-guards.d.ts +1 -3
- package/types/i18n/i18n.d.ts +2 -2
- package/types/i18n/translate.d.ts +1 -1
- package/types/index.d.cts +9 -0
- package/types/schema/{document.interface.d.ts → api-document.interface.d.ts} +4 -4
- package/types/schema/data-type/complex-type.interface.d.ts +1 -1
- package/types/schema/data-type/data-type.interface.d.ts +1 -1
- package/types/schema/data-type/enum-type.interface.d.ts +1 -1
- package/types/schema/data-type/mapped-type.interface.d.ts +3 -3
- package/types/schema/data-type/mixin-type.interface.d.ts +1 -1
- package/types/schema/data-type-container.interface.d.ts +1 -1
- package/types/schema/http/http-controller.interface.d.ts +2 -2
- package/types/schema/http/http-media-type.interface.d.ts +1 -1
- package/types/schema/http/http-operation-response.interface.d.ts +2 -2
- package/types/schema/http/http-operation.interface.d.ts +8 -4
- package/types/schema/http/http-parameter.interface.d.ts +2 -2
- package/types/schema/index.d.ts +2 -62
- package/types/schema/opra-schema.d.ts +21 -0
- package/types/schema/type-guards.d.ts +1 -1
- package/browser.js +0 -13393
- /package/cjs/schema/{document.interface.js → api-document.interface.js} +0 -0
- /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
|
-
*
|
|
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,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' | '
|
|
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' | '
|
|
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 {};
|
|
@@ -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
|
-
|
|
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 { 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 {
|
package/types/filter/errors.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
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:
|
|
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:
|
|
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?:
|
|
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?:
|
|
19
|
+
operators?: ComparisonOperator[] | string;
|
|
20
20
|
}): void;
|
|
21
|
-
normalizeFilter(filter: OpraSchema.Field.QualifiedName |
|
|
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>;
|
package/types/helpers/index.d.ts
CHANGED
|
@@ -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;
|
package/types/i18n/i18n.d.ts
CHANGED
|
@@ -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
|
|
6
|
+
* @interface ApiDocument
|
|
7
7
|
*/
|
|
8
|
-
export interface
|
|
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<
|
|
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,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,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,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;
|