@opra/common 1.19.4 → 1.19.7
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 +5 -5
- package/browser/index.mjs +5 -5
- package/cjs/document/api-document.js +11 -4
- package/cjs/document/constants.js +3 -1
- package/cjs/document/data-type/enum-type.js +4 -0
- package/cjs/document/decorators/{rpc-controller.decorator.js → mq-controller.decorator.js} +8 -8
- package/cjs/document/decorators/{rpc-operation.decorator.js → mq-operation.decorator.js} +6 -6
- package/cjs/document/decorators/ws-controller.decorator.js +51 -0
- package/cjs/document/decorators/ws-operation.decorator.js +43 -0
- package/cjs/document/factory/api-document.factory.js +3 -3
- package/cjs/document/factory/{rpc-api.factory.js → mq-api.factory.js} +28 -28
- package/cjs/document/factory/ws-api.factory.js +123 -0
- package/cjs/document/index.js +15 -8
- package/cjs/document/{rpc/rpc-api.js → mq/mq-api.js} +5 -5
- package/cjs/document/{rpc/rpc-controller.js → mq/mq-controller.js} +14 -14
- package/cjs/document/{rpc/rpc-header.js → mq/mq-header.js} +5 -5
- package/cjs/document/{rpc/rpc-operation-response.js → mq/mq-operation-response.js} +4 -4
- package/cjs/document/{rpc/rpc-operation.js → mq/mq-operation.js} +10 -10
- package/cjs/document/ws/ws-api.js +52 -0
- package/cjs/document/ws/ws-controller.js +78 -0
- package/cjs/document/ws/ws-operation.js +62 -0
- package/cjs/filter/antlr/OpraFilterLexer.js +361 -211
- package/cjs/filter/antlr/OpraFilterParser.js +174 -92
- package/cjs/schema/http/http-api.interface.js +2 -0
- package/cjs/schema/mq/mq-api.interface.js +2 -0
- package/cjs/schema/mq/mq-controller.interface.js +11 -0
- package/cjs/schema/mq/mq-header.interface.js +2 -0
- package/cjs/schema/mq/mq-operation.interface.js +7 -0
- package/cjs/schema/opra-schema.js +9 -3
- package/cjs/schema/ws/ws-api.interface.js +2 -0
- package/cjs/schema/ws/ws-controller.interface.js +11 -0
- package/cjs/schema/ws/ws-operation.interface.js +7 -0
- package/esm/document/api-document.js +11 -4
- package/esm/document/constants.js +2 -0
- package/esm/document/data-type/enum-type.js +4 -0
- package/esm/document/decorators/{rpc-controller.decorator.js → mq-controller.decorator.js} +8 -8
- package/esm/document/decorators/{rpc-operation.decorator.js → mq-operation.decorator.js} +6 -6
- package/esm/document/decorators/ws-controller.decorator.js +48 -0
- package/esm/document/decorators/ws-operation.decorator.js +40 -0
- package/esm/document/factory/api-document.factory.js +3 -3
- package/esm/document/factory/{rpc-api.factory.js → mq-api.factory.js} +27 -27
- package/esm/document/factory/ws-api.factory.js +119 -0
- package/esm/document/index.js +15 -8
- package/esm/document/{rpc/rpc-api.js → mq/mq-api.js} +3 -3
- package/esm/document/{rpc/rpc-controller.js → mq/mq-controller.js} +13 -13
- package/esm/document/{rpc/rpc-header.js → mq/mq-header.js} +4 -4
- package/esm/document/{rpc/rpc-operation-response.js → mq/mq-operation-response.js} +2 -2
- package/esm/document/{rpc/rpc-operation.js → mq/mq-operation.js} +9 -9
- package/esm/document/ws/ws-api.js +48 -0
- package/esm/document/ws/ws-controller.js +75 -0
- package/esm/document/ws/ws-operation.js +59 -0
- package/esm/filter/antlr/OpraFilterLexer.js +362 -212
- package/esm/filter/antlr/OpraFilterListener.js +1 -1
- package/esm/filter/antlr/OpraFilterParser.js +174 -92
- package/esm/schema/http/http-api.interface.js +1 -0
- package/esm/schema/mq/mq-api.interface.js +1 -0
- package/esm/schema/mq/mq-controller.interface.js +8 -0
- package/esm/schema/mq/mq-header.interface.js +1 -0
- package/esm/schema/mq/mq-operation.interface.js +4 -0
- package/esm/schema/opra-schema.js +9 -3
- package/esm/schema/ws/ws-api.interface.js +1 -0
- package/esm/schema/ws/ws-controller.interface.js +8 -0
- package/esm/schema/ws/ws-operation.interface.js +4 -0
- package/package.json +6 -6
- package/types/document/api-document.d.ts +5 -3
- package/types/document/constants.d.ts +2 -0
- package/types/document/decorators/mq-controller.decorator.d.ts +20 -0
- package/types/document/decorators/mq-operation.decorator.d.ts +32 -0
- package/types/document/decorators/ws-controller.decorator.d.ts +20 -0
- package/types/document/decorators/ws-operation.decorator.d.ts +24 -0
- package/types/document/factory/api-document.factory.d.ts +3 -2
- package/types/document/factory/mq-api.factory.d.ts +40 -0
- package/types/document/factory/ws-api.factory.d.ts +31 -0
- package/types/document/index.d.ts +20 -11
- package/types/document/mq/mq-api.d.ts +27 -0
- package/types/document/mq/mq-controller.d.ts +83 -0
- package/types/document/{rpc/rpc-header.d.ts → mq/mq-header.d.ts} +15 -15
- package/types/document/{rpc/rpc-operation-response.d.ts → mq/mq-operation-response.d.ts} +13 -13
- package/types/document/{rpc/rpc-operation.d.ts → mq/mq-operation.d.ts} +27 -27
- package/types/document/ws/ws-api.d.ts +26 -0
- package/types/document/ws/ws-controller.d.ts +79 -0
- package/types/document/ws/ws-operation.d.ts +70 -0
- package/types/filter/antlr/OpraFilterLexer.d.ts +1 -1
- package/types/filter/antlr/OpraFilterListener.d.ts +28 -28
- package/types/filter/antlr/OpraFilterVisitor.d.ts +27 -27
- package/types/schema/api-document.interface.d.ts +4 -46
- package/types/schema/api.interface.d.ts +13 -0
- package/types/schema/http/http-api.interface.d.ts +12 -0
- package/types/schema/mq/mq-api.interface.d.ts +15 -0
- package/types/schema/mq/mq-controller.interface.d.ts +22 -0
- package/types/schema/{rpc/rpc-header.interface.d.ts → mq/mq-header.interface.d.ts} +2 -2
- package/types/schema/{rpc/rpc-operation.interface.d.ts → mq/mq-operation.interface.d.ts} +11 -11
- package/types/schema/opra-schema.d.ts +9 -3
- package/types/schema/types.d.ts +11 -0
- package/types/schema/ws/ws-api.interface.d.ts +11 -0
- package/types/schema/ws/ws-controller.interface.d.ts +20 -0
- package/types/schema/ws/ws-operation.interface.d.ts +15 -0
- package/cjs/schema/rpc/rpc-controller.interface.js +0 -11
- package/cjs/schema/rpc/rpc-operation.interface.js +0 -7
- package/esm/schema/rpc/rpc-controller.interface.js +0 -8
- package/esm/schema/rpc/rpc-operation.interface.js +0 -4
- package/types/document/decorators/rpc-controller.decorator.d.ts +0 -20
- package/types/document/decorators/rpc-operation.decorator.d.ts +0 -32
- package/types/document/factory/rpc-api.factory.d.ts +0 -40
- package/types/document/rpc/rpc-api.d.ts +0 -27
- package/types/document/rpc/rpc-controller.d.ts +0 -83
- package/types/schema/rpc/rpc-controller.interface.d.ts +0 -22
- /package/cjs/schema/{rpc/rpc-header.interface.js → api.interface.js} +0 -0
- /package/esm/schema/{rpc/rpc-header.interface.js → api.interface.js} +0 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { Type } from 'ts-gems';
|
|
2
|
+
import { OpraSchema } from '../../schema/index.js';
|
|
3
|
+
import { DocumentInitContext } from '../common/document-init-context.js';
|
|
4
|
+
import { WSApi } from '../ws/ws-api.js';
|
|
5
|
+
import { WSController } from '../ws/ws-controller.js';
|
|
6
|
+
import { WSOperation } from '../ws/ws-operation.js';
|
|
7
|
+
export declare namespace WSApiFactory {
|
|
8
|
+
interface InitArguments extends WSApi.InitArguments {
|
|
9
|
+
controllers: Type[] | any[] | ((parent: any) => any) | OpraSchema.WSApi['controllers'];
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* @class WSApiFactory
|
|
14
|
+
*/
|
|
15
|
+
export declare class WSApiFactory {
|
|
16
|
+
/**
|
|
17
|
+
* Generates MQApi
|
|
18
|
+
* @param context
|
|
19
|
+
* @param init
|
|
20
|
+
*/
|
|
21
|
+
static createApi(context: DocumentInitContext, init: WSApiFactory.InitArguments): Promise<WSApi>;
|
|
22
|
+
protected static _createController(context: DocumentInitContext, parent: WSApi, thunk: Type | object | Function | OpraSchema.WSController, name?: string): Promise<WSController | undefined | void>;
|
|
23
|
+
/**
|
|
24
|
+
* Initializes WSOperation
|
|
25
|
+
* @param context
|
|
26
|
+
* @param operation
|
|
27
|
+
* @param metadata
|
|
28
|
+
* @protected
|
|
29
|
+
*/
|
|
30
|
+
protected static _initWSOperation(context: DocumentInitContext, operation: WSOperation, metadata: WSOperation.Metadata | OpraSchema.WSOperation): Promise<void>;
|
|
31
|
+
}
|
|
@@ -8,8 +8,10 @@ import './decorators/http-operation-entity-get.decorator.js';
|
|
|
8
8
|
import './decorators/http-operation-entity-replace.decorator.js';
|
|
9
9
|
import './decorators/http-operation-entity-update.decorator.js';
|
|
10
10
|
import './decorators/http-operation-entity-update-many.decorator.js';
|
|
11
|
-
import * as
|
|
12
|
-
import * as
|
|
11
|
+
import * as MQControllerDecorator_ from './decorators/mq-controller.decorator.js';
|
|
12
|
+
import * as MQOperationDecorator_ from './decorators/mq-operation.decorator.js';
|
|
13
|
+
import * as WSControllerDecorator_ from './decorators/ws-controller.decorator.js';
|
|
14
|
+
import * as WSOperationDecorator_ from './decorators/ws-operation.decorator.js';
|
|
13
15
|
import * as DataTypeFactory_ from './factory/data-type.factory.js';
|
|
14
16
|
import * as HttpApiFactory_ from './factory/http-api.factory.js';
|
|
15
17
|
export * from './api-document.js';
|
|
@@ -34,8 +36,10 @@ export * from './data-type/primitive-types/index.js';
|
|
|
34
36
|
export * from './data-type/required-type.js';
|
|
35
37
|
export * from './data-type/simple-type.js';
|
|
36
38
|
export * from './data-type/union-type.js';
|
|
37
|
-
export type {
|
|
38
|
-
export type {
|
|
39
|
+
export type { MQControllerDecorator } from './decorators/mq-controller.decorator.js';
|
|
40
|
+
export type { MQOperationDecorator } from './decorators/mq-operation.decorator.js';
|
|
41
|
+
export type { WSControllerDecorator } from './decorators/ws-controller.decorator.js';
|
|
42
|
+
export type { WSOperationDecorator } from './decorators/ws-operation.decorator.js';
|
|
39
43
|
export * from './factory/api-document.factory.js';
|
|
40
44
|
export * from './http/http-api.js';
|
|
41
45
|
export * from './http/http-controller.js';
|
|
@@ -46,14 +50,19 @@ export * from './http/http-operation-response.js';
|
|
|
46
50
|
export * from './http/http-parameter.js';
|
|
47
51
|
export * from './http/http-request-body.js';
|
|
48
52
|
export * from './http/http-status-range.js';
|
|
49
|
-
export * from './
|
|
50
|
-
export * from './
|
|
51
|
-
export * from './
|
|
52
|
-
export * from './
|
|
53
|
-
export type {
|
|
53
|
+
export * from './mq/mq-api.js';
|
|
54
|
+
export * from './mq/mq-controller.js';
|
|
55
|
+
export * from './mq/mq-header.js';
|
|
56
|
+
export * from './mq/mq-operation.js';
|
|
57
|
+
export type { MQOperationResponse } from './mq/mq-operation-response.js';
|
|
58
|
+
export * from './ws/ws-api.js';
|
|
59
|
+
export * from './ws/ws-controller.js';
|
|
60
|
+
export * from './ws/ws-operation.js';
|
|
54
61
|
export declare namespace classes {
|
|
55
62
|
export import HttpApiFactory = HttpApiFactory_.HttpApiFactory;
|
|
56
63
|
export import DataTypeFactory = DataTypeFactory_.DataTypeFactory;
|
|
57
|
-
export import
|
|
58
|
-
export import
|
|
64
|
+
export import MQOperationDecoratorFactory = MQOperationDecorator_.MQOperationDecoratorFactory;
|
|
65
|
+
export import MQControllerDecoratorFactory = MQControllerDecorator_.MQControllerDecoratorFactory;
|
|
66
|
+
export import WSOperationDecoratorFactory = WSOperationDecorator_.WSOperationDecoratorFactory;
|
|
67
|
+
export import WSControllerDecoratorFactory = WSControllerDecorator_.WSControllerDecoratorFactory;
|
|
59
68
|
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { StrictOmit, Type } from 'ts-gems';
|
|
2
|
+
import { ResponsiveMap } from '../../helpers/index.js';
|
|
3
|
+
import { OpraSchema } from '../../schema/index.js';
|
|
4
|
+
import type { ApiDocument } from '../api-document';
|
|
5
|
+
import { ApiBase } from '../common/api-base.js';
|
|
6
|
+
import { MQController } from './mq-controller.js';
|
|
7
|
+
import { MQOperation } from './mq-operation.js';
|
|
8
|
+
export declare namespace MQApi {
|
|
9
|
+
interface InitArguments extends ApiBase.InitArguments, StrictOmit<OpraSchema.MQApi, 'controllers'> {
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* @class MQApi
|
|
14
|
+
*/
|
|
15
|
+
export declare class MQApi extends ApiBase {
|
|
16
|
+
protected _controllerReverseMap: WeakMap<Type, MQController | null>;
|
|
17
|
+
readonly owner: ApiDocument;
|
|
18
|
+
readonly transport = "mq";
|
|
19
|
+
platform: string;
|
|
20
|
+
controllers: ResponsiveMap<MQController>;
|
|
21
|
+
constructor(init: MQApi.InitArguments);
|
|
22
|
+
findController(controller: Type): MQController | undefined;
|
|
23
|
+
findController(name: string): MQController | undefined;
|
|
24
|
+
findOperation(controller: Type, operationName: string): MQOperation | undefined;
|
|
25
|
+
findOperation(controllerName: string, operationName: string): MQOperation | undefined;
|
|
26
|
+
toJSON(): OpraSchema.MQApi;
|
|
27
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import type { Combine, ThunkAsync, Type } from 'ts-gems';
|
|
2
|
+
import { ResponsiveMap } from '../../helpers/index.js';
|
|
3
|
+
import { OpraSchema } from '../../schema/index.js';
|
|
4
|
+
import { DataTypeMap } from '../common/data-type-map.js';
|
|
5
|
+
import { DocumentElement } from '../common/document-element.js';
|
|
6
|
+
import type { EnumType } from '../data-type/enum-type.js';
|
|
7
|
+
import { MQControllerDecoratorFactory } from '../decorators/mq-controller.decorator.js';
|
|
8
|
+
import { nodeInspectCustom } from '../utils/inspect.util.js';
|
|
9
|
+
import type { MQApi } from './mq-api.js';
|
|
10
|
+
import type { MQHeader } from './mq-header';
|
|
11
|
+
import type { MQOperation } from './mq-operation.js';
|
|
12
|
+
/**
|
|
13
|
+
* @namespace MQController
|
|
14
|
+
*/
|
|
15
|
+
export declare namespace MQController {
|
|
16
|
+
interface Metadata extends Pick<OpraSchema.MQController, 'description'> {
|
|
17
|
+
name: string;
|
|
18
|
+
types?: ThunkAsync<Type | EnumType.EnumObject | EnumType.EnumArray>[];
|
|
19
|
+
operations?: Record<string, MQOperation.Metadata>;
|
|
20
|
+
headers?: MQHeader.Metadata[];
|
|
21
|
+
}
|
|
22
|
+
interface Options extends Partial<Pick<OpraSchema.MQController, 'description'>> {
|
|
23
|
+
name?: string;
|
|
24
|
+
}
|
|
25
|
+
interface InitArguments extends Combine<{
|
|
26
|
+
instance?: object;
|
|
27
|
+
ctor?: Type;
|
|
28
|
+
}, Pick<Metadata, 'name' | 'description'>> {
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Type definition for MQController
|
|
33
|
+
* @class MQController
|
|
34
|
+
*/
|
|
35
|
+
export interface MQControllerStatic extends MQControllerDecoratorFactory {
|
|
36
|
+
/**
|
|
37
|
+
* Class constructor of MQController
|
|
38
|
+
* @param owner
|
|
39
|
+
* @param args
|
|
40
|
+
*/
|
|
41
|
+
new (owner: MQApi | MQController, args: MQController.InitArguments): MQController;
|
|
42
|
+
prototype: MQController;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Type definition of MQController prototype
|
|
46
|
+
* @interface MQController
|
|
47
|
+
*/
|
|
48
|
+
export interface MQController extends MQControllerClass {
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* MQController
|
|
52
|
+
*/
|
|
53
|
+
export declare const MQController: MQControllerStatic;
|
|
54
|
+
/**
|
|
55
|
+
*
|
|
56
|
+
* @class MQController
|
|
57
|
+
*/
|
|
58
|
+
declare class MQControllerClass extends DocumentElement {
|
|
59
|
+
protected _controllerReverseMap: WeakMap<Type, MQController | null>;
|
|
60
|
+
readonly kind: OpraSchema.MQController.Kind;
|
|
61
|
+
readonly name: string;
|
|
62
|
+
description?: string;
|
|
63
|
+
path: string;
|
|
64
|
+
instance?: any;
|
|
65
|
+
ctor?: Type;
|
|
66
|
+
headers: MQHeader[];
|
|
67
|
+
operations: ResponsiveMap<MQOperation>;
|
|
68
|
+
types: DataTypeMap;
|
|
69
|
+
findHeader(paramName: string, location?: OpraSchema.HttpParameterLocation): MQHeader | undefined;
|
|
70
|
+
/**
|
|
71
|
+
*
|
|
72
|
+
*/
|
|
73
|
+
toString(): string;
|
|
74
|
+
/**
|
|
75
|
+
*
|
|
76
|
+
*/
|
|
77
|
+
toJSON(): OpraSchema.MQController;
|
|
78
|
+
/**
|
|
79
|
+
*
|
|
80
|
+
*/
|
|
81
|
+
protected [nodeInspectCustom](): string;
|
|
82
|
+
}
|
|
83
|
+
export {};
|
|
@@ -5,10 +5,10 @@ import { Value } from '../common/value.js';
|
|
|
5
5
|
import { DataType } from '../data-type/data-type.js';
|
|
6
6
|
import type { EnumType } from '../data-type/enum-type.js';
|
|
7
7
|
/**
|
|
8
|
-
* @namespace
|
|
8
|
+
* @namespace MQHeader
|
|
9
9
|
*/
|
|
10
|
-
export declare namespace
|
|
11
|
-
interface Metadata extends StrictOmit<OpraSchema.
|
|
10
|
+
export declare namespace MQHeader {
|
|
11
|
+
interface Metadata extends StrictOmit<OpraSchema.MQHeader, 'type'> {
|
|
12
12
|
name: string | RegExp;
|
|
13
13
|
type?: string | TypeThunkAsync | EnumType.EnumObject | EnumType.EnumArray | object;
|
|
14
14
|
}
|
|
@@ -21,27 +21,27 @@ export declare namespace RpcHeader {
|
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
23
|
/**
|
|
24
|
-
* Type definition for
|
|
25
|
-
* @class
|
|
24
|
+
* Type definition for MQHeader
|
|
25
|
+
* @class MQHeader
|
|
26
26
|
*/
|
|
27
|
-
interface
|
|
28
|
-
new (owner: DocumentElement, args:
|
|
29
|
-
prototype:
|
|
27
|
+
interface MQHeaderStatic {
|
|
28
|
+
new (owner: DocumentElement, args: MQHeader.InitArguments): MQHeader;
|
|
29
|
+
prototype: MQHeader;
|
|
30
30
|
}
|
|
31
31
|
/**
|
|
32
|
-
* Type definition of
|
|
33
|
-
* @interface
|
|
32
|
+
* Type definition of MQHeader prototype
|
|
33
|
+
* @interface MQHeader
|
|
34
34
|
*/
|
|
35
|
-
export interface
|
|
35
|
+
export interface MQHeader extends MQHeaderClass {
|
|
36
36
|
}
|
|
37
|
-
export declare const
|
|
37
|
+
export declare const MQHeader: MQHeaderStatic;
|
|
38
38
|
/**
|
|
39
|
-
* @class
|
|
39
|
+
* @class MQHeader
|
|
40
40
|
*/
|
|
41
|
-
declare class
|
|
41
|
+
declare class MQHeaderClass extends Value {
|
|
42
42
|
readonly owner: DocumentElement;
|
|
43
43
|
deprecated?: boolean | string;
|
|
44
44
|
required?: boolean;
|
|
45
|
-
toJSON(): OpraSchema.
|
|
45
|
+
toJSON(): OpraSchema.MQHeader;
|
|
46
46
|
}
|
|
47
47
|
export {};
|
|
@@ -3,17 +3,17 @@ import { TypeThunkAsync } from 'ts-gems/lib/types';
|
|
|
3
3
|
import { OpraSchema } from '../../schema/index.js';
|
|
4
4
|
import { DocumentElement } from '../common/document-element.js';
|
|
5
5
|
import { DataType } from '../data-type/data-type.js';
|
|
6
|
-
import type {
|
|
7
|
-
import type {
|
|
6
|
+
import type { MQHeader } from './mq-header';
|
|
7
|
+
import type { MQOperation } from './mq-operation.js';
|
|
8
8
|
/**
|
|
9
|
-
* @namespace
|
|
9
|
+
* @namespace MQOperationResponse
|
|
10
10
|
*/
|
|
11
|
-
export declare namespace
|
|
11
|
+
export declare namespace MQOperationResponse {
|
|
12
12
|
interface Metadata extends Combine<{
|
|
13
13
|
payloadType?: TypeThunkAsync | string;
|
|
14
14
|
keyType?: TypeThunkAsync | string;
|
|
15
|
-
headers?:
|
|
16
|
-
}, OpraSchema.
|
|
15
|
+
headers?: MQHeader.Metadata[];
|
|
16
|
+
}, OpraSchema.MQOperationResponse> {
|
|
17
17
|
}
|
|
18
18
|
interface Options extends Combine<{
|
|
19
19
|
keyType?: Type | string;
|
|
@@ -26,16 +26,16 @@ export declare namespace RpcOperationResponse {
|
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
/**
|
|
29
|
-
* @class
|
|
29
|
+
* @class MQOperationResponse
|
|
30
30
|
*/
|
|
31
|
-
export declare class
|
|
32
|
-
readonly owner:
|
|
31
|
+
export declare class MQOperationResponse extends DocumentElement {
|
|
32
|
+
readonly owner: MQOperation;
|
|
33
33
|
channel?: string | RegExp | (string | RegExp)[];
|
|
34
34
|
description?: string;
|
|
35
35
|
payloadType: DataType;
|
|
36
36
|
keyType?: DataType;
|
|
37
|
-
headers:
|
|
38
|
-
constructor(owner:
|
|
39
|
-
findHeader(paramName: string):
|
|
40
|
-
toJSON(): OpraSchema.
|
|
37
|
+
headers: MQHeader[];
|
|
38
|
+
constructor(owner: MQOperation, initArgs?: MQOperationResponse.InitArguments);
|
|
39
|
+
findHeader(paramName: string): MQHeader | undefined;
|
|
40
|
+
toJSON(): OpraSchema.MQOperationResponse;
|
|
41
41
|
}
|
|
@@ -5,20 +5,20 @@ import { DataTypeMap } from '../common/data-type-map.js';
|
|
|
5
5
|
import { DocumentElement } from '../common/document-element.js';
|
|
6
6
|
import { DataType } from '../data-type/data-type.js';
|
|
7
7
|
import type { EnumType } from '../data-type/enum-type.js';
|
|
8
|
-
import {
|
|
9
|
-
import type {
|
|
10
|
-
import type {
|
|
11
|
-
import type {
|
|
8
|
+
import { MQOperationDecorator } from '../decorators/mq-operation.decorator.js';
|
|
9
|
+
import type { MQController } from './mq-controller.js';
|
|
10
|
+
import type { MQHeader } from './mq-header';
|
|
11
|
+
import type { MQOperationResponse } from './mq-operation-response.js';
|
|
12
12
|
/**
|
|
13
|
-
* @namespace
|
|
13
|
+
* @namespace MQOperation
|
|
14
14
|
*/
|
|
15
|
-
export declare namespace
|
|
16
|
-
interface Metadata extends Pick<OpraSchema.
|
|
15
|
+
export declare namespace MQOperation {
|
|
16
|
+
interface Metadata extends Pick<OpraSchema.MQOperation, 'description' | 'channel'> {
|
|
17
17
|
payloadType: TypeThunkAsync | string;
|
|
18
18
|
keyType?: TypeThunkAsync | string;
|
|
19
19
|
types?: ThunkAsync<Type | EnumType.EnumObject | EnumType.EnumArray>[];
|
|
20
|
-
headers?:
|
|
21
|
-
response?:
|
|
20
|
+
headers?: MQHeader.Metadata[];
|
|
21
|
+
response?: MQOperationResponse.Metadata;
|
|
22
22
|
}
|
|
23
23
|
interface Options extends Partial<Pick<Metadata, 'description' | 'keyType'>> {
|
|
24
24
|
channel?: (string | RegExp) | (string | RegExp)[];
|
|
@@ -32,46 +32,46 @@ export declare namespace RpcOperation {
|
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
/**
|
|
35
|
-
* Type definition for
|
|
36
|
-
* @class
|
|
35
|
+
* Type definition for MQOperation
|
|
36
|
+
* @class MQOperation
|
|
37
37
|
*/
|
|
38
|
-
export interface
|
|
38
|
+
export interface MQOperationStatic {
|
|
39
39
|
/**
|
|
40
|
-
* Class constructor of
|
|
40
|
+
* Class constructor of MQOperation
|
|
41
41
|
* @param controller
|
|
42
42
|
* @param args
|
|
43
43
|
*/
|
|
44
|
-
new (controller:
|
|
44
|
+
new (controller: MQController, args: MQOperation.InitArguments): MQOperation;
|
|
45
45
|
/**
|
|
46
46
|
* Property decorator
|
|
47
47
|
* @param payloadType
|
|
48
48
|
* @param options
|
|
49
|
-
*/ <T extends
|
|
50
|
-
prototype:
|
|
49
|
+
*/ <T extends MQOperation.Options>(payloadType: ThunkAsync<Type> | string, options?: T): MQOperationDecorator;
|
|
50
|
+
prototype: MQOperation;
|
|
51
51
|
}
|
|
52
52
|
/**
|
|
53
|
-
* @class
|
|
53
|
+
* @class MQOperation
|
|
54
54
|
*/
|
|
55
|
-
export interface
|
|
55
|
+
export interface MQOperation extends MQOperationClass {
|
|
56
56
|
}
|
|
57
57
|
/**
|
|
58
|
-
*
|
|
58
|
+
* MQOperation
|
|
59
59
|
*/
|
|
60
|
-
export declare const
|
|
60
|
+
export declare const MQOperation: MQOperationStatic;
|
|
61
61
|
/**
|
|
62
|
-
* @class
|
|
62
|
+
* @class MQOperation
|
|
63
63
|
*/
|
|
64
|
-
declare class
|
|
65
|
-
readonly owner:
|
|
64
|
+
declare class MQOperationClass extends DocumentElement {
|
|
65
|
+
readonly owner: MQController;
|
|
66
66
|
readonly name: string;
|
|
67
67
|
channel: string | RegExp | (string | RegExp)[];
|
|
68
68
|
description?: string;
|
|
69
69
|
payloadType: DataType;
|
|
70
70
|
keyType?: DataType;
|
|
71
71
|
types: DataTypeMap;
|
|
72
|
-
headers:
|
|
73
|
-
response:
|
|
74
|
-
findHeader(paramName: string):
|
|
75
|
-
toJSON(): OpraSchema.
|
|
72
|
+
headers: MQHeader[];
|
|
73
|
+
response: MQOperationResponse;
|
|
74
|
+
findHeader(paramName: string): MQHeader | undefined;
|
|
75
|
+
toJSON(): OpraSchema.MQOperation;
|
|
76
76
|
}
|
|
77
77
|
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { StrictOmit, Type } from 'ts-gems';
|
|
2
|
+
import { ResponsiveMap } from '../../helpers/index.js';
|
|
3
|
+
import { OpraSchema } from '../../schema/index.js';
|
|
4
|
+
import type { ApiDocument } from '../api-document';
|
|
5
|
+
import { ApiBase } from '../common/api-base.js';
|
|
6
|
+
import { WSController } from './ws-controller.js';
|
|
7
|
+
import { WSOperation } from './ws-operation.js';
|
|
8
|
+
export declare namespace WSApi {
|
|
9
|
+
interface InitArguments extends ApiBase.InitArguments, StrictOmit<OpraSchema.WSApi, 'controllers'> {
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* @class WSApi
|
|
14
|
+
*/
|
|
15
|
+
export declare class WSApi extends ApiBase {
|
|
16
|
+
protected _controllerReverseMap: WeakMap<Type, WSController | null>;
|
|
17
|
+
readonly owner: ApiDocument;
|
|
18
|
+
readonly transport = "ws";
|
|
19
|
+
controllers: ResponsiveMap<WSController>;
|
|
20
|
+
constructor(init: WSApi.InitArguments);
|
|
21
|
+
findController(controller: Type): WSController | undefined;
|
|
22
|
+
findController(name: string): WSController | undefined;
|
|
23
|
+
findOperation(controller: Type, operationName: string): WSOperation | undefined;
|
|
24
|
+
findOperation(controllerName: string, operationName: string): WSOperation | undefined;
|
|
25
|
+
toJSON(): OpraSchema.WSApi;
|
|
26
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import type { Combine, ThunkAsync, Type } from 'ts-gems';
|
|
2
|
+
import { ResponsiveMap } from '../../helpers/index.js';
|
|
3
|
+
import { OpraSchema } from '../../schema/index.js';
|
|
4
|
+
import { DataTypeMap } from '../common/data-type-map.js';
|
|
5
|
+
import { DocumentElement } from '../common/document-element.js';
|
|
6
|
+
import type { EnumType } from '../data-type/enum-type.js';
|
|
7
|
+
import { WSControllerDecoratorFactory } from '../decorators/ws-controller.decorator.js';
|
|
8
|
+
import { nodeInspectCustom } from '../utils/inspect.util.js';
|
|
9
|
+
import type { WSApi } from './ws-api.js';
|
|
10
|
+
import type { WSOperation } from './ws-operation.js';
|
|
11
|
+
/**
|
|
12
|
+
* @namespace WSController
|
|
13
|
+
*/
|
|
14
|
+
export declare namespace WSController {
|
|
15
|
+
interface Metadata extends Pick<OpraSchema.WSController, 'description'> {
|
|
16
|
+
name: string;
|
|
17
|
+
types?: ThunkAsync<Type | EnumType.EnumObject | EnumType.EnumArray>[];
|
|
18
|
+
operations?: Record<string, WSOperation.Metadata>;
|
|
19
|
+
}
|
|
20
|
+
interface Options extends Partial<Pick<OpraSchema.WSController, 'description'>> {
|
|
21
|
+
name?: string;
|
|
22
|
+
}
|
|
23
|
+
interface InitArguments extends Combine<{
|
|
24
|
+
instance?: object;
|
|
25
|
+
ctor?: Type;
|
|
26
|
+
}, Pick<Metadata, 'name' | 'description'>> {
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Type definition for WSController
|
|
31
|
+
* @class WSController
|
|
32
|
+
*/
|
|
33
|
+
export interface WSControllerStatic extends WSControllerDecoratorFactory {
|
|
34
|
+
/**
|
|
35
|
+
* Class constructor of WSController
|
|
36
|
+
* @param owner
|
|
37
|
+
* @param args
|
|
38
|
+
*/
|
|
39
|
+
new (owner: WSApi | WSController, args: WSController.InitArguments): WSController;
|
|
40
|
+
prototype: WSController;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Type definition of WSController prototype
|
|
44
|
+
* @interface WSController
|
|
45
|
+
*/
|
|
46
|
+
export interface WSController extends WSControllerClass {
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* WSController
|
|
50
|
+
*/
|
|
51
|
+
export declare const WSController: WSControllerStatic;
|
|
52
|
+
/**
|
|
53
|
+
*
|
|
54
|
+
* @class WSController
|
|
55
|
+
*/
|
|
56
|
+
declare class WSControllerClass extends DocumentElement {
|
|
57
|
+
protected _controllerReverseMap: WeakMap<Type, WSController | null>;
|
|
58
|
+
readonly kind: OpraSchema.WSController.Kind;
|
|
59
|
+
readonly name: string;
|
|
60
|
+
description?: string;
|
|
61
|
+
path: string;
|
|
62
|
+
instance?: any;
|
|
63
|
+
ctor?: Type;
|
|
64
|
+
operations: ResponsiveMap<WSOperation>;
|
|
65
|
+
types: DataTypeMap;
|
|
66
|
+
/**
|
|
67
|
+
*
|
|
68
|
+
*/
|
|
69
|
+
toString(): string;
|
|
70
|
+
/**
|
|
71
|
+
*
|
|
72
|
+
*/
|
|
73
|
+
toJSON(): OpraSchema.WSController;
|
|
74
|
+
/**
|
|
75
|
+
*
|
|
76
|
+
*/
|
|
77
|
+
protected [nodeInspectCustom](): string;
|
|
78
|
+
}
|
|
79
|
+
export {};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type { Combine, ThunkAsync, Type } from 'ts-gems';
|
|
2
|
+
import { TypeThunkAsync } from 'ts-gems/lib/types';
|
|
3
|
+
import { OpraSchema } from '../../schema/index.js';
|
|
4
|
+
import { DataTypeMap } from '../common/data-type-map.js';
|
|
5
|
+
import { DocumentElement } from '../common/document-element.js';
|
|
6
|
+
import { DataType } from '../data-type/data-type.js';
|
|
7
|
+
import type { EnumType } from '../data-type/enum-type.js';
|
|
8
|
+
import { WSOperationDecorator } from '../decorators/ws-operation.decorator.js';
|
|
9
|
+
import { WSController } from './ws-controller.js';
|
|
10
|
+
/**
|
|
11
|
+
* @namespace WSOperation
|
|
12
|
+
*/
|
|
13
|
+
export declare namespace WSOperation {
|
|
14
|
+
interface Metadata extends Pick<OpraSchema.WSOperation, 'description' | 'channel'> {
|
|
15
|
+
payloadType: TypeThunkAsync | string;
|
|
16
|
+
keyType?: TypeThunkAsync | string;
|
|
17
|
+
types?: ThunkAsync<Type | EnumType.EnumObject | EnumType.EnumArray>[];
|
|
18
|
+
}
|
|
19
|
+
interface Options extends Partial<Pick<Metadata, 'description' | 'keyType'>> {
|
|
20
|
+
channel?: (string | RegExp) | (string | RegExp)[];
|
|
21
|
+
}
|
|
22
|
+
interface InitArguments extends Combine<{
|
|
23
|
+
name: string;
|
|
24
|
+
types?: DataType[];
|
|
25
|
+
payloadType?: DataType | string | Type;
|
|
26
|
+
keyType?: DataType | string | Type;
|
|
27
|
+
}, Pick<Metadata, 'description' | 'channel'>> {
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Type definition for WSOperation
|
|
32
|
+
* @class WSOperation
|
|
33
|
+
*/
|
|
34
|
+
export interface WSOperationStatic {
|
|
35
|
+
/**
|
|
36
|
+
* Class constructor of WSOperation
|
|
37
|
+
* @param controller
|
|
38
|
+
* @param args
|
|
39
|
+
*/
|
|
40
|
+
new (controller: WSController, args: WSOperation.InitArguments): WSOperation;
|
|
41
|
+
/**
|
|
42
|
+
* Property decorator
|
|
43
|
+
* @param payloadType
|
|
44
|
+
* @param options
|
|
45
|
+
*/ <T extends WSOperation.Options>(payloadType: ThunkAsync<Type> | string, options?: T): WSOperationDecorator;
|
|
46
|
+
prototype: WSOperation;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* @class WSOperation
|
|
50
|
+
*/
|
|
51
|
+
export interface WSOperation extends WSOperationClass {
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* WSOperation
|
|
55
|
+
*/
|
|
56
|
+
export declare const WSOperation: WSOperationStatic;
|
|
57
|
+
/**
|
|
58
|
+
* @class WSOperation
|
|
59
|
+
*/
|
|
60
|
+
declare class WSOperationClass extends DocumentElement {
|
|
61
|
+
readonly owner: WSController;
|
|
62
|
+
readonly name: string;
|
|
63
|
+
channel: string | RegExp | (string | RegExp)[];
|
|
64
|
+
description?: string;
|
|
65
|
+
payloadType: DataType;
|
|
66
|
+
keyType?: DataType;
|
|
67
|
+
types: DataTypeMap;
|
|
68
|
+
toJSON(): OpraSchema.WSOperation;
|
|
69
|
+
}
|
|
70
|
+
export {};
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import { ParseTreeListener } from
|
|
2
|
-
import type { RootContext } from
|
|
3
|
-
import type { ParenthesizedExpressionContext } from
|
|
4
|
-
import type { NegativeExpressionContext } from
|
|
5
|
-
import type { ComparisonExpressionContext } from
|
|
6
|
-
import type { LogicalExpressionContext } from
|
|
7
|
-
import type { ComparisonLeftContext } from
|
|
8
|
-
import type { ComparisonRightContext } from
|
|
9
|
-
import type { ParenthesizedItemContext } from
|
|
10
|
-
import type { NumberLiteralContext } from
|
|
11
|
-
import type { InfinityLiteralContext } from
|
|
12
|
-
import type { BooleanLiteralContext } from
|
|
13
|
-
import type { NullLiteralContext } from
|
|
14
|
-
import type { DateTimeLiteralContext } from
|
|
15
|
-
import type { DateLiteralContext } from
|
|
16
|
-
import type { TimeLiteralContext } from
|
|
17
|
-
import { type StringLiteralContext } from
|
|
18
|
-
import type { QualifiedIdentifierContext } from
|
|
19
|
-
import type { ExternalConstantContext } from
|
|
20
|
-
import type { IdentifierContext } from
|
|
21
|
-
import type { ArrayValueContext } from
|
|
22
|
-
import type { BooleanContext } from
|
|
23
|
-
import type { NullContext } from
|
|
24
|
-
import type { InfinityContext } from
|
|
25
|
-
import type { ArithmeticOperatorContext } from
|
|
26
|
-
import type { ComparisonOperatorContext } from
|
|
27
|
-
import type { LogicalOperatorContext } from
|
|
28
|
-
import type { PolarityOperatorContext } from
|
|
1
|
+
import { ParseTreeListener } from '@browsery/antlr4';
|
|
2
|
+
import type { RootContext } from './OpraFilterParser.js';
|
|
3
|
+
import type { ParenthesizedExpressionContext } from './OpraFilterParser.js';
|
|
4
|
+
import type { NegativeExpressionContext } from './OpraFilterParser.js';
|
|
5
|
+
import type { ComparisonExpressionContext } from './OpraFilterParser.js';
|
|
6
|
+
import type { LogicalExpressionContext } from './OpraFilterParser.js';
|
|
7
|
+
import type { ComparisonLeftContext } from './OpraFilterParser.js';
|
|
8
|
+
import type { ComparisonRightContext } from './OpraFilterParser.js';
|
|
9
|
+
import type { ParenthesizedItemContext } from './OpraFilterParser.js';
|
|
10
|
+
import type { NumberLiteralContext } from './OpraFilterParser.js';
|
|
11
|
+
import type { InfinityLiteralContext } from './OpraFilterParser.js';
|
|
12
|
+
import type { BooleanLiteralContext } from './OpraFilterParser.js';
|
|
13
|
+
import type { NullLiteralContext } from './OpraFilterParser.js';
|
|
14
|
+
import type { DateTimeLiteralContext } from './OpraFilterParser.js';
|
|
15
|
+
import type { DateLiteralContext } from './OpraFilterParser.js';
|
|
16
|
+
import type { TimeLiteralContext } from './OpraFilterParser.js';
|
|
17
|
+
import { type StringLiteralContext } from './OpraFilterParser.js';
|
|
18
|
+
import type { QualifiedIdentifierContext } from './OpraFilterParser.js';
|
|
19
|
+
import type { ExternalConstantContext } from './OpraFilterParser.js';
|
|
20
|
+
import type { IdentifierContext } from './OpraFilterParser.js';
|
|
21
|
+
import type { ArrayValueContext } from './OpraFilterParser.js';
|
|
22
|
+
import type { BooleanContext } from './OpraFilterParser.js';
|
|
23
|
+
import type { NullContext } from './OpraFilterParser.js';
|
|
24
|
+
import type { InfinityContext } from './OpraFilterParser.js';
|
|
25
|
+
import type { ArithmeticOperatorContext } from './OpraFilterParser.js';
|
|
26
|
+
import type { ComparisonOperatorContext } from './OpraFilterParser.js';
|
|
27
|
+
import type { LogicalOperatorContext } from './OpraFilterParser.js';
|
|
28
|
+
import type { PolarityOperatorContext } from './OpraFilterParser.js';
|
|
29
29
|
/**
|
|
30
30
|
* This interface defines a complete listener for a parse tree produced by
|
|
31
31
|
* `OpraFilterParser`.
|