@achinet/nestjs-async 0.2.0 → 0.3.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.
- package/dist/asyncapi-document.builder.d.ts +1 -1
- package/dist/asyncapi-document.builder.js.map +1 -1
- package/dist/asyncapi.module.js +8 -5
- package/dist/asyncapi.module.js.map +1 -1
- package/dist/binding/asyncapi.kafka.interfaces.d.ts +1 -1
- package/dist/decorators/asyncapi-operation-for-meta-key.decorator.js +3 -3
- package/dist/decorators/asyncapi-operation-for-meta-key.decorator.js.map +1 -1
- package/dist/decorators/asyncapi-operation.decorator.js.map +1 -1
- package/dist/decorators/asyncapi-pub.decorator.js.map +1 -1
- package/dist/decorators/asyncapi-service.decorator.d.ts +1 -1
- package/dist/decorators/asyncapi-service.decorator.js +2 -2
- package/dist/decorators/asyncapi-service.decorator.js.map +1 -1
- package/dist/decorators/asyncapi-sub.decorator.js.map +1 -1
- package/dist/explorers/asyncapi-class.explorer.js +1 -5
- package/dist/explorers/asyncapi-class.explorer.js.map +1 -1
- package/dist/explorers/asyncapi-operation.explorer.d.ts +1 -2
- package/dist/explorers/asyncapi-operation.explorer.js +2 -2
- package/dist/explorers/asyncapi-operation.explorer.js.map +1 -1
- package/dist/interface/asyncapi-common.interfaces.d.ts +1 -1
- package/dist/interface/asyncapi-server.interface.d.ts +1 -1
- package/dist/interface/asyncapi-template-options.interface.d.ts +2 -3
- package/dist/interface/index.d.ts +0 -1
- package/dist/interface/index.js +0 -1
- package/dist/interface/index.js.map +1 -1
- package/dist/services/asyncapi.explorer.d.ts +2 -4
- package/dist/services/asyncapi.explorer.js +8 -13
- package/dist/services/asyncapi.explorer.js.map +1 -1
- package/dist/services/asyncapi.generator.d.ts +4 -3
- package/dist/services/asyncapi.generator.js +72 -17
- package/dist/services/asyncapi.generator.js.map +1 -1
- package/dist/services/asyncapi.scanner.d.ts +1 -4
- package/dist/services/asyncapi.scanner.js +10 -31
- package/dist/services/asyncapi.scanner.js.map +1 -1
- package/dist/services/asyncapi.transformer.js.map +1 -1
- package/dist/services/index.d.ts +1 -1
- package/dist/services/index.js +1 -1
- package/dist/services/index.js.map +1 -1
- package/dist/services/operation-object.factory.d.ts +2 -6
- package/dist/services/operation-object.factory.js +7 -14
- package/dist/services/operation-object.factory.js.map +1 -1
- package/dist/services/swagger-schema.factory.d.ts +6 -0
- package/dist/services/swagger-schema.factory.js +27 -0
- package/dist/services/swagger-schema.factory.js.map +1 -0
- package/dist/utils/decorator.utils.d.ts +2 -0
- package/dist/utils/decorator.utils.js +26 -0
- package/dist/utils/decorator.utils.js.map +1 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/{sample/felines/rto → utils}/index.js +2 -1
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/path.utils.d.ts +2 -0
- package/dist/utils/path.utils.js +8 -0
- package/dist/utils/path.utils.js.map +1 -0
- package/package.json +54 -34
- package/.prettierrc +0 -5
- package/CHANGELOG.md +0 -26
- package/dist/interface/generator-options.interface.d.ts +0 -22
- package/dist/interface/generator-options.interface.js +0 -3
- package/dist/interface/generator-options.interface.js.map +0 -1
- package/dist/sample/app.module.d.ts +0 -2
- package/dist/sample/app.module.js +0 -20
- package/dist/sample/app.module.js.map +0 -1
- package/dist/sample/common.d.ts +0 -3
- package/dist/sample/common.js +0 -40
- package/dist/sample/common.js.map +0 -1
- package/dist/sample/constants.d.ts +0 -12
- package/dist/sample/constants.js +0 -16
- package/dist/sample/constants.js.map +0 -1
- package/dist/sample/felines/class/cat.class.d.ts +0 -4
- package/dist/sample/felines/class/cat.class.js +0 -24
- package/dist/sample/felines/class/cat.class.js.map +0 -1
- package/dist/sample/felines/class/feline.class.d.ts +0 -19
- package/dist/sample/felines/class/feline.class.js +0 -20
- package/dist/sample/felines/class/feline.class.js.map +0 -1
- package/dist/sample/felines/class/index.d.ts +0 -5
- package/dist/sample/felines/class/index.js +0 -22
- package/dist/sample/felines/class/index.js.map +0 -1
- package/dist/sample/felines/class/lion.class.d.ts +0 -4
- package/dist/sample/felines/class/lion.class.js +0 -8
- package/dist/sample/felines/class/lion.class.js.map +0 -1
- package/dist/sample/felines/class/message.class.d.ts +0 -7
- package/dist/sample/felines/class/message.class.js +0 -28
- package/dist/sample/felines/class/message.class.js.map +0 -1
- package/dist/sample/felines/class/tiger.class.d.ts +0 -4
- package/dist/sample/felines/class/tiger.class.js +0 -8
- package/dist/sample/felines/class/tiger.class.js.map +0 -1
- package/dist/sample/felines/dto/create-feline.dto.d.ts +0 -4
- package/dist/sample/felines/dto/create-feline.dto.js +0 -28
- package/dist/sample/felines/dto/create-feline.dto.js.map +0 -1
- package/dist/sample/felines/dto/index.d.ts +0 -2
- package/dist/sample/felines/dto/index.js +0 -19
- package/dist/sample/felines/dto/index.js.map +0 -1
- package/dist/sample/felines/dto/journaling-data.dto.d.ts +0 -4
- package/dist/sample/felines/dto/journaling-data.dto.js +0 -8
- package/dist/sample/felines/dto/journaling-data.dto.js.map +0 -1
- package/dist/sample/felines/felines.constants.d.ts +0 -1
- package/dist/sample/felines/felines.constants.js +0 -5
- package/dist/sample/felines/felines.constants.js.map +0 -1
- package/dist/sample/felines/felines.controller.d.ts +0 -15
- package/dist/sample/felines/felines.controller.js +0 -101
- package/dist/sample/felines/felines.controller.js.map +0 -1
- package/dist/sample/felines/felines.gateway.d.ts +0 -16
- package/dist/sample/felines/felines.gateway.js +0 -90
- package/dist/sample/felines/felines.gateway.js.map +0 -1
- package/dist/sample/felines/felines.module.d.ts +0 -2
- package/dist/sample/felines/felines.module.js +0 -28
- package/dist/sample/felines/felines.module.js.map +0 -1
- package/dist/sample/felines/felines.service.d.ts +0 -8
- package/dist/sample/felines/felines.service.js +0 -33
- package/dist/sample/felines/felines.service.js.map +0 -1
- package/dist/sample/felines/rto/feline.rto.d.ts +0 -7
- package/dist/sample/felines/rto/feline.rto.js +0 -31
- package/dist/sample/felines/rto/feline.rto.js.map +0 -1
- package/dist/sample/felines/rto/index.d.ts +0 -1
- package/dist/sample/felines/rto/index.js.map +0 -1
- package/dist/sample/index.d.ts +0 -3
- package/dist/sample/index.js +0 -20
- package/dist/sample/index.js.map +0 -1
- package/dist/sample/main.d.ts +0 -1
- package/dist/sample/main.js +0 -30
- package/dist/sample/main.js.map +0 -1
- package/dist/src/asyncapi-document.builder.d.ts +0 -27
- package/dist/src/asyncapi-document.builder.js +0 -110
- package/dist/src/asyncapi-document.builder.js.map +0 -1
- package/dist/src/asyncapi.constants.d.ts +0 -6
- package/dist/src/asyncapi.constants.js +0 -11
- package/dist/src/asyncapi.constants.js.map +0 -1
- package/dist/src/asyncapi.module.d.ts +0 -8
- package/dist/src/asyncapi.module.js +0 -47
- package/dist/src/asyncapi.module.js.map +0 -1
- package/dist/src/binding/asyncapi.amqp.interfaces.d.ts +0 -38
- package/dist/src/binding/asyncapi.amqp.interfaces.js +0 -3
- package/dist/src/binding/asyncapi.amqp.interfaces.js.map +0 -1
- package/dist/src/binding/asyncapi.kafka.interfaces.d.ts +0 -21
- package/dist/src/binding/asyncapi.kafka.interfaces.js +0 -3
- package/dist/src/binding/asyncapi.kafka.interfaces.js.map +0 -1
- package/dist/src/binding/index.d.ts +0 -2
- package/dist/src/binding/index.js +0 -19
- package/dist/src/binding/index.js.map +0 -1
- package/dist/src/decorators/asyncapi-operation-for-meta-key.decorator.d.ts +0 -2
- package/dist/src/decorators/asyncapi-operation-for-meta-key.decorator.js +0 -37
- package/dist/src/decorators/asyncapi-operation-for-meta-key.decorator.js.map +0 -1
- package/dist/src/decorators/asyncapi-operation.decorator.d.ts +0 -2
- package/dist/src/decorators/asyncapi-operation.decorator.js +0 -9
- package/dist/src/decorators/asyncapi-operation.decorator.js.map +0 -1
- package/dist/src/decorators/asyncapi-pub.decorator.d.ts +0 -2
- package/dist/src/decorators/asyncapi-pub.decorator.js +0 -10
- package/dist/src/decorators/asyncapi-pub.decorator.js.map +0 -1
- package/dist/src/decorators/asyncapi-service.decorator.d.ts +0 -1
- package/dist/src/decorators/asyncapi-service.decorator.js +0 -9
- package/dist/src/decorators/asyncapi-service.decorator.js.map +0 -1
- package/dist/src/decorators/asyncapi-sub.decorator.d.ts +0 -2
- package/dist/src/decorators/asyncapi-sub.decorator.js +0 -10
- package/dist/src/decorators/asyncapi-sub.decorator.js.map +0 -1
- package/dist/src/decorators/index.d.ts +0 -4
- package/dist/src/decorators/index.js +0 -21
- package/dist/src/decorators/index.js.map +0 -1
- package/dist/src/explorers/asyncapi-class.explorer.d.ts +0 -5
- package/dist/src/explorers/asyncapi-class.explorer.js +0 -27
- package/dist/src/explorers/asyncapi-class.explorer.js.map +0 -1
- package/dist/src/explorers/asyncapi-operation.explorer.d.ts +0 -17
- package/dist/src/explorers/asyncapi-operation.explorer.js +0 -26
- package/dist/src/explorers/asyncapi-operation.explorer.js.map +0 -1
- package/dist/src/explorers/index.d.ts +0 -2
- package/dist/src/explorers/index.js +0 -19
- package/dist/src/explorers/index.js.map +0 -1
- package/dist/src/index.d.ts +0 -4
- package/dist/src/index.js +0 -21
- package/dist/src/index.js.map +0 -1
- package/dist/src/interface/asyncapi-common.interfaces.d.ts +0 -126
- package/dist/src/interface/asyncapi-common.interfaces.js +0 -3
- package/dist/src/interface/asyncapi-common.interfaces.js.map +0 -1
- package/dist/src/interface/asyncapi-document-options.interface.d.ts +0 -3
- package/dist/src/interface/asyncapi-document-options.interface.js +0 -3
- package/dist/src/interface/asyncapi-document-options.interface.js.map +0 -1
- package/dist/src/interface/asyncapi-message.interface.d.ts +0 -8
- package/dist/src/interface/asyncapi-message.interface.js +0 -3
- package/dist/src/interface/asyncapi-message.interface.js.map +0 -1
- package/dist/src/interface/asyncapi-operation-headers.interface.d.ts +0 -6
- package/dist/src/interface/asyncapi-operation-headers.interface.js +0 -3
- package/dist/src/interface/asyncapi-operation-headers.interface.js.map +0 -1
- package/dist/src/interface/asyncapi-operation-options-raw.interface.d.ts +0 -21
- package/dist/src/interface/asyncapi-operation-options-raw.interface.js +0 -3
- package/dist/src/interface/asyncapi-operation-options-raw.interface.js.map +0 -1
- package/dist/src/interface/asyncapi-operation-options.interface.d.ts +0 -8
- package/dist/src/interface/asyncapi-operation-options.interface.js +0 -3
- package/dist/src/interface/asyncapi-operation-options.interface.js.map +0 -1
- package/dist/src/interface/asyncapi-operation-payload.interface.d.ts +0 -2
- package/dist/src/interface/asyncapi-operation-payload.interface.js +0 -3
- package/dist/src/interface/asyncapi-operation-payload.interface.js.map +0 -1
- package/dist/src/interface/asyncapi-server.interface.d.ts +0 -10
- package/dist/src/interface/asyncapi-server.interface.js +0 -3
- package/dist/src/interface/asyncapi-server.interface.js.map +0 -1
- package/dist/src/interface/asyncapi-template-options.interface.d.ts +0 -7
- package/dist/src/interface/asyncapi-template-options.interface.js +0 -3
- package/dist/src/interface/asyncapi-template-options.interface.js.map +0 -1
- package/dist/src/interface/denormalized-doc-resolvers.interface.d.ts +0 -6
- package/dist/src/interface/denormalized-doc-resolvers.interface.js +0 -3
- package/dist/src/interface/denormalized-doc-resolvers.interface.js.map +0 -1
- package/dist/src/interface/denormalized-doc.interface.d.ts +0 -10
- package/dist/src/interface/denormalized-doc.interface.js +0 -3
- package/dist/src/interface/denormalized-doc.interface.js.map +0 -1
- package/dist/src/interface/generator-options.interface.d.ts +0 -22
- package/dist/src/interface/generator-options.interface.js +0 -3
- package/dist/src/interface/generator-options.interface.js.map +0 -1
- package/dist/src/interface/index.d.ts +0 -11
- package/dist/src/interface/index.js +0 -28
- package/dist/src/interface/index.js.map +0 -1
- package/dist/src/services/asyncapi.explorer.d.ts +0 -12
- package/dist/src/services/asyncapi.explorer.js +0 -69
- package/dist/src/services/asyncapi.explorer.js.map +0 -1
- package/dist/src/services/asyncapi.generator.d.ts +0 -6
- package/dist/src/services/asyncapi.generator.js +0 -68
- package/dist/src/services/asyncapi.generator.js.map +0 -1
- package/dist/src/services/asyncapi.scanner.d.ts +0 -14
- package/dist/src/services/asyncapi.scanner.js +0 -71
- package/dist/src/services/asyncapi.scanner.js.map +0 -1
- package/dist/src/services/asyncapi.transformer.d.ts +0 -4
- package/dist/src/services/asyncapi.transformer.js +0 -33
- package/dist/src/services/asyncapi.transformer.js.map +0 -1
- package/dist/src/services/index.d.ts +0 -4
- package/dist/src/services/index.js +0 -21
- package/dist/src/services/index.js.map +0 -1
- package/dist/src/services/operation-object.factory.d.ts +0 -9
- package/dist/src/services/operation-object.factory.js +0 -37
- package/dist/src/services/operation-object.factory.js.map +0 -1
- package/dist/test/configs/jest-base.config.d.ts +0 -3
- package/dist/test/configs/jest-base.config.js +0 -20
- package/dist/test/configs/jest-base.config.js.map +0 -1
- package/dist/test/configs/jest-e2e.config.d.ts +0 -3
- package/dist/test/configs/jest-e2e.config.js +0 -16
- package/dist/test/configs/jest-e2e.config.js.map +0 -1
- package/dist/test/express.e2e-spec.d.ts +0 -1
- package/dist/test/express.e2e-spec.js +0 -89
- package/dist/test/express.e2e-spec.js.map +0 -1
- package/dist/test/fastify.e2e-spec.d.ts +0 -1
- package/dist/test/fastify.e2e-spec.js +0 -57
- package/dist/test/fastify.e2e-spec.js.map +0 -1
- package/dist/tsconfig.tsbuildinfo +0 -1
- package/eslint.config.mjs +0 -21
- package/misc/references/ref.html +0 -303
- package/misc/references/ref.json +0 -1
- package/misc/references/ref.yaml +0 -292
- package/misc/take-snaphots.sh +0 -8
- package/sample/app.module.ts +0 -7
- package/sample/common.ts +0 -49
- package/sample/constants.ts +0 -12
- package/sample/felines/class/cat.class.ts +0 -9
- package/sample/felines/class/feline.class.ts +0 -29
- package/sample/felines/class/index.ts +0 -5
- package/sample/felines/class/lion.class.ts +0 -5
- package/sample/felines/class/message.class.ts +0 -17
- package/sample/felines/class/tiger.class.ts +0 -5
- package/sample/felines/dto/create-feline.dto.ts +0 -13
- package/sample/felines/dto/index.ts +0 -2
- package/sample/felines/dto/journaling-data.dto.ts +0 -5
- package/sample/felines/felines.constants.ts +0 -1
- package/sample/felines/felines.controller.ts +0 -76
- package/sample/felines/felines.gateway.ts +0 -76
- package/sample/felines/felines.module.ts +0 -15
- package/sample/felines/felines.service.ts +0 -24
- package/sample/felines/rto/feline.rto.ts +0 -17
- package/sample/felines/rto/index.ts +0 -1
- package/sample/index.ts +0 -3
- package/sample/main.ts +0 -34
- package/src/asyncapi-document.builder.ts +0 -172
- package/src/asyncapi.constants.ts +0 -8
- package/src/asyncapi.module.ts +0 -65
- package/src/binding/asyncapi.amqp.interfaces.ts +0 -48
- package/src/binding/asyncapi.kafka.interfaces.ts +0 -35
- package/src/binding/index.ts +0 -2
- package/src/decorators/asyncapi-operation-for-meta-key.decorator.ts +0 -58
- package/src/decorators/asyncapi-operation.decorator.ts +0 -7
- package/src/decorators/asyncapi-pub.decorator.ts +0 -11
- package/src/decorators/asyncapi-service.decorator.ts +0 -9
- package/src/decorators/asyncapi-sub.decorator.ts +0 -11
- package/src/decorators/index.ts +0 -4
- package/src/explorers/asyncapi-class.explorer.ts +0 -26
- package/src/explorers/asyncapi-operation.explorer.ts +0 -40
- package/src/explorers/index.ts +0 -2
- package/src/index.ts +0 -4
- package/src/interface/asyncapi-common.interfaces.ts +0 -169
- package/src/interface/asyncapi-document-options.interface.ts +0 -3
- package/src/interface/asyncapi-message.interface.ts +0 -10
- package/src/interface/asyncapi-operation-headers.interface.ts +0 -6
- package/src/interface/asyncapi-operation-options-raw.interface.ts +0 -23
- package/src/interface/asyncapi-operation-options.interface.ts +0 -10
- package/src/interface/asyncapi-operation-payload.interface.ts +0 -3
- package/src/interface/asyncapi-server.interface.ts +0 -11
- package/src/interface/asyncapi-template-options.interface.ts +0 -20
- package/src/interface/denormalized-doc-resolvers.interface.ts +0 -6
- package/src/interface/denormalized-doc.interface.ts +0 -6
- package/src/interface/generator-options.interface.ts +0 -21
- package/src/interface/index.ts +0 -12
- package/src/services/asyncapi.explorer.ts +0 -112
- package/src/services/asyncapi.generator.ts +0 -45
- package/src/services/asyncapi.scanner.ts +0 -105
- package/src/services/asyncapi.transformer.ts +0 -33
- package/src/services/index.ts +0 -4
- package/src/services/operation-object.factory.ts +0 -55
- package/test/__mocks__/@asyncapi/generator.js +0 -41
- package/test/configs/jest-base.config.ts +0 -19
- package/test/configs/jest-e2e.config.js +0 -7
- package/test/configs/jest-e2e.config.ts +0 -19
- package/test/configs/jest-swagger-plugin.js +0 -16
- package/test/express.e2e-spec.ts +0 -64
- package/test/fastify.e2e-spec.ts +0 -65
- package/tsconfig.build.json +0 -4
- package/tsconfig.json +0 -8
package/sample/constants.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export const DOC_RELATIVE_PATH = '/async-api';
|
|
2
|
-
export const BOOTSTRAP = 'Bootstrap';
|
|
3
|
-
export const PORT = 4001;
|
|
4
|
-
export const HOST = '0.0.0.0';
|
|
5
|
-
export const SERVER = {
|
|
6
|
-
europe: 'europe',
|
|
7
|
-
asia: 'asia',
|
|
8
|
-
northAmerica: 'north-america',
|
|
9
|
-
southAmerica: 'south-america',
|
|
10
|
-
africa: 'africa',
|
|
11
|
-
australia: 'australia',
|
|
12
|
-
};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
enum PawsEnum {
|
|
2
|
-
left = 'left',
|
|
3
|
-
right = 'right',
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
enum GendersEnum {
|
|
7
|
-
male = 'male',
|
|
8
|
-
female = 'female',
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export abstract class Feline {
|
|
12
|
-
id: number;
|
|
13
|
-
|
|
14
|
-
name: string;
|
|
15
|
-
|
|
16
|
-
age: number;
|
|
17
|
-
|
|
18
|
-
gender: GendersEnum;
|
|
19
|
-
|
|
20
|
-
dominantPaw: PawsEnum;
|
|
21
|
-
|
|
22
|
-
tags: string[];
|
|
23
|
-
|
|
24
|
-
birthDatetime: Date;
|
|
25
|
-
|
|
26
|
-
constructor(initializer: Record<string, unknown>) {
|
|
27
|
-
Object.assign(this, initializer);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { ApiProperty } from '@nestjs/swagger';
|
|
2
|
-
|
|
3
|
-
export abstract class Message<T extends Record<string, any>> {
|
|
4
|
-
@ApiProperty({ format: 'uuid' })
|
|
5
|
-
correlationId: string;
|
|
6
|
-
|
|
7
|
-
@ApiProperty({ format: 'x.y.z', example: '1.0.1' })
|
|
8
|
-
version: string;
|
|
9
|
-
|
|
10
|
-
timestamp: Date;
|
|
11
|
-
|
|
12
|
-
abstract payload: T;
|
|
13
|
-
|
|
14
|
-
constructor(partialData: Partial<Message<T>>) {
|
|
15
|
-
Object.assign(this, partialData);
|
|
16
|
-
}
|
|
17
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { ApiProperty, getSchemaPath } from '@nestjs/swagger';
|
|
2
|
-
import { Cat, Feline, Lion, Message, Tiger } from '../class';
|
|
3
|
-
|
|
4
|
-
export class CreateFelineDto extends Message<Feline> {
|
|
5
|
-
@ApiProperty({
|
|
6
|
-
oneOf: [
|
|
7
|
-
{ $ref: getSchemaPath(Cat) },
|
|
8
|
-
{ $ref: getSchemaPath(Lion) },
|
|
9
|
-
{ $ref: getSchemaPath(Tiger) },
|
|
10
|
-
],
|
|
11
|
-
})
|
|
12
|
-
payload: Feline;
|
|
13
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export const FELINES_MS = 'FELINES_MS';
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import { Controller, Get, Inject, Logger } from '@nestjs/common';
|
|
2
|
-
import { ClientProxy, EventPattern } from '@nestjs/microservices';
|
|
3
|
-
import { CreateFelineDto } from './dto';
|
|
4
|
-
import { AsyncApiPub, AsyncApiSub } from '../../src';
|
|
5
|
-
import { Cat, Feline } from '../../sample/felines/class';
|
|
6
|
-
import { JournalingDataDto } from '../../sample/felines/dto/journaling-data.dto';
|
|
7
|
-
import { FELINES_MS } from '../../sample/felines/felines.constants';
|
|
8
|
-
import { FelinesService } from '../../sample/felines/felines.service';
|
|
9
|
-
import { FelineRto } from '../../sample/felines/rto';
|
|
10
|
-
|
|
11
|
-
const EventPatternsMS = {
|
|
12
|
-
createFeline: 'ms/create/feline',
|
|
13
|
-
journal: 'ms/journal',
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* How to use AsyncApi in a microservices
|
|
18
|
-
*/
|
|
19
|
-
@Controller()
|
|
20
|
-
export class FelinesController {
|
|
21
|
-
private logger: Logger = new Logger(FelinesController.name);
|
|
22
|
-
|
|
23
|
-
constructor(
|
|
24
|
-
@Inject(FELINES_MS)
|
|
25
|
-
private readonly client: ClientProxy,
|
|
26
|
-
private readonly felinesService: FelinesService,
|
|
27
|
-
) {}
|
|
28
|
-
|
|
29
|
-
@AsyncApiSub({
|
|
30
|
-
channel: EventPatternsMS.journal,
|
|
31
|
-
message: {
|
|
32
|
-
payload: JournalingDataDto,
|
|
33
|
-
},
|
|
34
|
-
})
|
|
35
|
-
@EventPattern(EventPatternsMS.journal)
|
|
36
|
-
async journal(dataForJournaling: JournalingDataDto) {
|
|
37
|
-
const dataForJournalingString = JSON.stringify(dataForJournaling, null, 4);
|
|
38
|
-
this.logger.log(`journaling:\n${dataForJournalingString}`);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
@AsyncApiPub({
|
|
42
|
-
channel: EventPatternsMS.createFeline,
|
|
43
|
-
message: {
|
|
44
|
-
payload: CreateFelineDto,
|
|
45
|
-
},
|
|
46
|
-
})
|
|
47
|
-
@AsyncApiSub({
|
|
48
|
-
channel: EventPatternsMS.createFeline,
|
|
49
|
-
message: {
|
|
50
|
-
payload: FelineRto,
|
|
51
|
-
},
|
|
52
|
-
})
|
|
53
|
-
@EventPattern(EventPatternsMS.createFeline)
|
|
54
|
-
async createFeline(createFelineDto: CreateFelineDto) {
|
|
55
|
-
const feline = await this.felinesService.create(createFelineDto);
|
|
56
|
-
this.logger.debug(`feline created:\n${JSON.stringify(feline)}`);
|
|
57
|
-
this.publishCreatedFeline(feline);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
publishCreatedFeline(feline: Feline) {
|
|
61
|
-
const felineRto = new FelineRto({ payload: feline });
|
|
62
|
-
return this.client.emit(EventPatternsMS.journal, felineRto);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
@Get()
|
|
66
|
-
async do() {
|
|
67
|
-
const cat = new Cat({
|
|
68
|
-
id: 123,
|
|
69
|
-
name: 'demo',
|
|
70
|
-
});
|
|
71
|
-
|
|
72
|
-
const felineRto = new CreateFelineDto({ payload: cat });
|
|
73
|
-
|
|
74
|
-
await this.createFeline(felineRto);
|
|
75
|
-
}
|
|
76
|
-
}
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import { Logger } from '@nestjs/common';
|
|
2
|
-
import {
|
|
3
|
-
ConnectedSocket,
|
|
4
|
-
MessageBody,
|
|
5
|
-
OnGatewayDisconnect,
|
|
6
|
-
OnGatewayInit,
|
|
7
|
-
SubscribeMessage,
|
|
8
|
-
WebSocketGateway,
|
|
9
|
-
WebSocketServer,
|
|
10
|
-
} from '@nestjs/websockets';
|
|
11
|
-
import { Namespace, Server } from 'socket.io';
|
|
12
|
-
import { Socket } from 'socket.io-client';
|
|
13
|
-
import { FelinesService } from './/felines.service';
|
|
14
|
-
import { CreateFelineDto } from './dto';
|
|
15
|
-
import { FelineExtendedRto, FelineRto } from './rto';
|
|
16
|
-
import { AsyncApiPub, AsyncApiSub } from '../../src';
|
|
17
|
-
|
|
18
|
-
const EventPatternsWS = {
|
|
19
|
-
createFeline: 'ws/create/feline',
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* How to use AsyncApi in a websockets
|
|
24
|
-
*/
|
|
25
|
-
@WebSocketGateway({ transports: ['websocket'], namespace: 'ws' })
|
|
26
|
-
export class FelinesGateway implements OnGatewayInit, OnGatewayDisconnect {
|
|
27
|
-
@WebSocketServer()
|
|
28
|
-
private readonly server: Server;
|
|
29
|
-
private readonly logger: Logger = new Logger(FelinesGateway.name);
|
|
30
|
-
|
|
31
|
-
constructor(private readonly felinesService: FelinesService) {}
|
|
32
|
-
|
|
33
|
-
afterInit(nsp: Namespace) {
|
|
34
|
-
this.logger.log(`Gateway server init: ${nsp?.name}`);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
handleDisconnect(client: Socket) {
|
|
38
|
-
this.logger.log(`Client disconnected: ${client.id}`);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
@SubscribeMessage(EventPatternsWS.createFeline)
|
|
42
|
-
@AsyncApiPub({
|
|
43
|
-
channel: EventPatternsWS.createFeline,
|
|
44
|
-
message: {
|
|
45
|
-
payload: CreateFelineDto,
|
|
46
|
-
},
|
|
47
|
-
})
|
|
48
|
-
async createFeline(
|
|
49
|
-
@ConnectedSocket() client: Socket,
|
|
50
|
-
@MessageBody() createFelineDto: CreateFelineDto,
|
|
51
|
-
) {
|
|
52
|
-
this.logger.log(
|
|
53
|
-
`data from client ${client.id} : ${JSON.stringify(createFelineDto)}`,
|
|
54
|
-
);
|
|
55
|
-
|
|
56
|
-
const feline = await this.felinesService.create(createFelineDto);
|
|
57
|
-
await this.emitCreatedFeline(new FelineRto({ payload: feline }));
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
@AsyncApiSub({
|
|
61
|
-
channel: EventPatternsWS.createFeline,
|
|
62
|
-
message: [
|
|
63
|
-
{
|
|
64
|
-
name: 'oneOf demo #1',
|
|
65
|
-
payload: FelineRto,
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
name: 'oneOf demo #2',
|
|
69
|
-
payload: FelineExtendedRto,
|
|
70
|
-
},
|
|
71
|
-
],
|
|
72
|
-
})
|
|
73
|
-
async emitCreatedFeline(felineRto: FelineRto) {
|
|
74
|
-
this.server.emit(EventPatternsWS.createFeline, felineRto);
|
|
75
|
-
}
|
|
76
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { Module } from '@nestjs/common';
|
|
2
|
-
import { ClientsModule, Transport } from '@nestjs/microservices';
|
|
3
|
-
import { FELINES_MS } from './felines.constants';
|
|
4
|
-
import { FelinesController } from './felines.controller';
|
|
5
|
-
import { FelinesGateway } from './felines.gateway';
|
|
6
|
-
import { FelinesService } from './felines.service';
|
|
7
|
-
|
|
8
|
-
@Module({
|
|
9
|
-
imports: [
|
|
10
|
-
ClientsModule.register([{ name: FELINES_MS, transport: Transport.TCP }]),
|
|
11
|
-
],
|
|
12
|
-
providers: [FelinesService, FelinesGateway],
|
|
13
|
-
controllers: [FelinesController],
|
|
14
|
-
})
|
|
15
|
-
export class FelinesModule {}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { Injectable } from '@nestjs/common';
|
|
2
|
-
import { Feline } from './class';
|
|
3
|
-
import { CreateFelineDto } from './dto';
|
|
4
|
-
|
|
5
|
-
@Injectable()
|
|
6
|
-
export class FelinesService {
|
|
7
|
-
private readonly felines: Feline[] = [];
|
|
8
|
-
|
|
9
|
-
async get(id: number): Promise<Feline> {
|
|
10
|
-
return this.felines[id];
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
async delete(id: number): Promise<boolean> {
|
|
14
|
-
const felineToDelete = this.get(id);
|
|
15
|
-
delete this.felines[id];
|
|
16
|
-
return !!felineToDelete;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
async create(createFelineDto: CreateFelineDto): Promise<Feline> {
|
|
20
|
-
const feline = createFelineDto.payload;
|
|
21
|
-
this.felines.push(feline);
|
|
22
|
-
return feline;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { ApiProperty, getSchemaPath } from '@nestjs/swagger';
|
|
2
|
-
import { Cat, Feline, Lion, Message, Tiger } from '../class';
|
|
3
|
-
|
|
4
|
-
export class FelineRto extends Message<Feline> {
|
|
5
|
-
@ApiProperty({
|
|
6
|
-
oneOf: [
|
|
7
|
-
{ $ref: getSchemaPath(Cat) },
|
|
8
|
-
{ $ref: getSchemaPath(Lion) },
|
|
9
|
-
{ $ref: getSchemaPath(Tiger) },
|
|
10
|
-
],
|
|
11
|
-
})
|
|
12
|
-
payload: Feline;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export class FelineExtendedRto extends FelineRto {
|
|
16
|
-
extra: string;
|
|
17
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './feline.rto';
|
package/sample/index.ts
DELETED
package/sample/main.ts
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { INestApplication, Logger } from '@nestjs/common';
|
|
2
|
-
import { NestFactory } from '@nestjs/core';
|
|
3
|
-
import { MicroserviceOptions, Transport } from '@nestjs/microservices';
|
|
4
|
-
import { ExpressAdapter } from '@nestjs/platform-express';
|
|
5
|
-
import { FastifyAdapter } from '@nestjs/platform-fastify';
|
|
6
|
-
import { AppModule } from './app.module';
|
|
7
|
-
import { makeAsyncapiDocument } from './common';
|
|
8
|
-
import { BOOTSTRAP, DOC_RELATIVE_PATH, HOST, PORT } from './constants';
|
|
9
|
-
import { AsyncApiModule } from '../src';
|
|
10
|
-
|
|
11
|
-
const USE_FASTIFY = false;
|
|
12
|
-
|
|
13
|
-
const adapter = USE_FASTIFY
|
|
14
|
-
? new FastifyAdapter({
|
|
15
|
-
ignoreTrailingSlash: false,
|
|
16
|
-
})
|
|
17
|
-
: new ExpressAdapter();
|
|
18
|
-
|
|
19
|
-
async function bootstrap(): Promise<void> {
|
|
20
|
-
const app = await NestFactory.create<INestApplication>(AppModule, adapter, {});
|
|
21
|
-
const asyncapiDocument = await makeAsyncapiDocument(app);
|
|
22
|
-
await AsyncApiModule.setup(DOC_RELATIVE_PATH, app, asyncapiDocument);
|
|
23
|
-
|
|
24
|
-
app.connectMicroservice<MicroserviceOptions>({ transport: Transport.TCP });
|
|
25
|
-
|
|
26
|
-
await app.startAllMicroservices();
|
|
27
|
-
await app.listen(PORT, HOST);
|
|
28
|
-
|
|
29
|
-
const baseUrl = `http://${HOST}:${PORT}`;
|
|
30
|
-
const docUrl = baseUrl + DOC_RELATIVE_PATH;
|
|
31
|
-
Logger.log(`Server started at ${baseUrl}; AsyncApi at ${docUrl};`, BOOTSTRAP);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
bootstrap();
|
|
@@ -1,172 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ExternalDocumentationObject,
|
|
3
|
-
SecuritySchemeObject,
|
|
4
|
-
TagObject,
|
|
5
|
-
} from '@nestjs/swagger/dist/interfaces/open-api-spec.interface';
|
|
6
|
-
import { isUndefined, negate, pickBy } from 'lodash';
|
|
7
|
-
import { AsyncApiDocument, AsyncSecuritySchemeObject, AsyncServerObject } from './interface';
|
|
8
|
-
|
|
9
|
-
export class AsyncApiDocumentBuilder {
|
|
10
|
-
private readonly buildDocumentBase = (): Omit<AsyncApiDocument, 'channels'> => ({
|
|
11
|
-
asyncapi: '2.5.0',
|
|
12
|
-
info: {
|
|
13
|
-
title: '',
|
|
14
|
-
description: '',
|
|
15
|
-
version: '1.0.0',
|
|
16
|
-
contact: {},
|
|
17
|
-
},
|
|
18
|
-
tags: [],
|
|
19
|
-
servers: {},
|
|
20
|
-
components: {},
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
private readonly document: Omit<AsyncApiDocument, 'channels'> = this.buildDocumentBase();
|
|
24
|
-
|
|
25
|
-
public setTitle(title: string): this {
|
|
26
|
-
this.document.info.title = title;
|
|
27
|
-
return this;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
public setDescription(description: string): this {
|
|
31
|
-
this.document.info.description = description;
|
|
32
|
-
return this;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
public setVersion(version: string): this {
|
|
36
|
-
this.document.info.version = version;
|
|
37
|
-
return this;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
public setTermsOfService(termsOfService: string): this {
|
|
41
|
-
this.document.info.termsOfService = termsOfService;
|
|
42
|
-
return this;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
public setContact(name: string, url: string, email: string): this {
|
|
46
|
-
this.document.info.contact = { name, url, email };
|
|
47
|
-
return this;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
public setLicense(name: string, url: string): this {
|
|
51
|
-
this.document.info.license = { name, url };
|
|
52
|
-
return this;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
public addServer(name: string, server: AsyncServerObject): this {
|
|
56
|
-
this.document.servers![name] = server;
|
|
57
|
-
return this;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
public addServers(servers: { name: string; server: AsyncServerObject }[]): this {
|
|
61
|
-
for (const { name, server } of servers) {
|
|
62
|
-
this.addServer(name, server);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
return this;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
public setExternalDoc(description: string, url: string): this {
|
|
69
|
-
this.document.externalDocs = { description, url };
|
|
70
|
-
return this;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
public setDefaultContentType(contentType: string) {
|
|
74
|
-
this.document.defaultContentType = contentType;
|
|
75
|
-
return this;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
public addTag(name: string, description = '', externalDocs?: ExternalDocumentationObject): this {
|
|
79
|
-
this.document.tags = this.document.tags!.concat(
|
|
80
|
-
pickBy(
|
|
81
|
-
{
|
|
82
|
-
name,
|
|
83
|
-
description,
|
|
84
|
-
externalDocs,
|
|
85
|
-
},
|
|
86
|
-
negate(isUndefined),
|
|
87
|
-
) as TagObject,
|
|
88
|
-
);
|
|
89
|
-
return this;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
public addSecurity(name: string, options: AsyncSecuritySchemeObject): this {
|
|
93
|
-
this.document.components!.securitySchemes = {
|
|
94
|
-
...(this.document.components!.securitySchemes || {}),
|
|
95
|
-
[name]: options,
|
|
96
|
-
};
|
|
97
|
-
return this;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
public addBearerAuth(
|
|
101
|
-
options: SecuritySchemeObject = {
|
|
102
|
-
type: 'http',
|
|
103
|
-
},
|
|
104
|
-
name = 'bearer',
|
|
105
|
-
): this {
|
|
106
|
-
this.addSecurity(name, {
|
|
107
|
-
scheme: 'bearer',
|
|
108
|
-
bearerFormat: 'JWT',
|
|
109
|
-
...options,
|
|
110
|
-
});
|
|
111
|
-
return this;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
public addOAuth2(
|
|
115
|
-
options: SecuritySchemeObject = {
|
|
116
|
-
type: 'oauth2',
|
|
117
|
-
},
|
|
118
|
-
name = 'oauth2',
|
|
119
|
-
): this {
|
|
120
|
-
this.addSecurity(name, {
|
|
121
|
-
flows: {},
|
|
122
|
-
...options,
|
|
123
|
-
});
|
|
124
|
-
return this;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
public addApiKey(
|
|
128
|
-
options: SecuritySchemeObject = {
|
|
129
|
-
type: 'apiKey',
|
|
130
|
-
},
|
|
131
|
-
name = 'api_key',
|
|
132
|
-
): this {
|
|
133
|
-
this.addSecurity(name, {
|
|
134
|
-
in: 'header',
|
|
135
|
-
name,
|
|
136
|
-
...options,
|
|
137
|
-
});
|
|
138
|
-
return this;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
public addBasicAuth(
|
|
142
|
-
options: SecuritySchemeObject = {
|
|
143
|
-
type: 'http',
|
|
144
|
-
},
|
|
145
|
-
name = 'basic',
|
|
146
|
-
): this {
|
|
147
|
-
this.addSecurity(name, {
|
|
148
|
-
scheme: 'basic',
|
|
149
|
-
...options,
|
|
150
|
-
});
|
|
151
|
-
return this;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
public addCookieAuth(
|
|
155
|
-
cookieName = 'connect.sid',
|
|
156
|
-
options: SecuritySchemeObject = {
|
|
157
|
-
type: 'apiKey',
|
|
158
|
-
},
|
|
159
|
-
securityName = 'cookie',
|
|
160
|
-
): this {
|
|
161
|
-
this.addSecurity(securityName, {
|
|
162
|
-
in: 'cookie',
|
|
163
|
-
name: cookieName,
|
|
164
|
-
...options,
|
|
165
|
-
});
|
|
166
|
-
return this;
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
public build(): Omit<AsyncApiDocument, 'components' | 'channels'> {
|
|
170
|
-
return this.document;
|
|
171
|
-
}
|
|
172
|
-
}
|
package/src/asyncapi.module.ts
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { INestApplication, INestApplicationContext, Logger } from '@nestjs/common';
|
|
2
|
-
import { validatePath } from '@nestjs/swagger/dist/utils/validate-path.util';
|
|
3
|
-
import jsyaml from 'js-yaml';
|
|
4
|
-
import { AsyncApiDocument, AsyncApiDocumentOptions, AsyncApiTemplateOptions } from './interface';
|
|
5
|
-
import { AsyncapiGenerator, AsyncapiScanner } from './services';
|
|
6
|
-
|
|
7
|
-
export class AsyncApiModule {
|
|
8
|
-
private static readonly logger = new Logger(AsyncApiModule.name);
|
|
9
|
-
|
|
10
|
-
public static createDocument(
|
|
11
|
-
app: INestApplicationContext,
|
|
12
|
-
config: Omit<AsyncApiDocument, 'channels'>,
|
|
13
|
-
options: AsyncApiDocumentOptions = {},
|
|
14
|
-
): AsyncApiDocument {
|
|
15
|
-
const asyncapiScanner = new AsyncapiScanner();
|
|
16
|
-
const document = asyncapiScanner.scanApplication(app, options);
|
|
17
|
-
|
|
18
|
-
document.components = {
|
|
19
|
-
...(config.components || {}),
|
|
20
|
-
...document.components,
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
return {
|
|
24
|
-
...config,
|
|
25
|
-
...document,
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
static async composeHtml(contract: AsyncApiDocument, templateOptions?: AsyncApiTemplateOptions) {
|
|
30
|
-
const generator = new AsyncapiGenerator(templateOptions);
|
|
31
|
-
return generator.generate(contract).catch((err) => {
|
|
32
|
-
this.logger.error(err);
|
|
33
|
-
throw err;
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
public static async setup(
|
|
38
|
-
path: string,
|
|
39
|
-
app: INestApplication,
|
|
40
|
-
document: AsyncApiDocument,
|
|
41
|
-
templateOptions?: AsyncApiTemplateOptions,
|
|
42
|
-
) {
|
|
43
|
-
const httpAdapter = app.getHttpAdapter();
|
|
44
|
-
const finalPath = validatePath(path);
|
|
45
|
-
|
|
46
|
-
const html = await this.composeHtml(document, templateOptions);
|
|
47
|
-
const yamlDocument = jsyaml.dump(document);
|
|
48
|
-
const jsonDocument = JSON.stringify(document);
|
|
49
|
-
|
|
50
|
-
httpAdapter.get(finalPath, (req, res) => {
|
|
51
|
-
res.type('text/html');
|
|
52
|
-
res.send(html);
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
httpAdapter.get(`${finalPath}-json`, (req, res) => {
|
|
56
|
-
res.type('application/json');
|
|
57
|
-
res.send(jsonDocument);
|
|
58
|
-
});
|
|
59
|
-
|
|
60
|
-
httpAdapter.get(`${finalPath}-yaml`, (req, res) => {
|
|
61
|
-
res.type('text/yaml');
|
|
62
|
-
res.send(yamlDocument);
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* AMPQ binding
|
|
3
|
-
* @see https://github.com/asyncapi/bindings/tree/master/amqp
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* This object MUST NOT contain any properties. Its name is reserved for future use.
|
|
8
|
-
*/
|
|
9
|
-
export interface AmqpServerBinding {}
|
|
10
|
-
|
|
11
|
-
export interface AmqpChannelBinding {
|
|
12
|
-
is: string;
|
|
13
|
-
exchange?: {
|
|
14
|
-
name: string;
|
|
15
|
-
type: string;
|
|
16
|
-
durable?: boolean;
|
|
17
|
-
autoDelete?: boolean;
|
|
18
|
-
vhost?: string;
|
|
19
|
-
};
|
|
20
|
-
queue?: {
|
|
21
|
-
name: string;
|
|
22
|
-
durable?: boolean;
|
|
23
|
-
exclusive?: boolean;
|
|
24
|
-
autoDelete?: boolean;
|
|
25
|
-
vhost?: string;
|
|
26
|
-
};
|
|
27
|
-
bindingVersion?: string;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export interface AmqpOperationBinding {
|
|
31
|
-
expiration?: number;
|
|
32
|
-
userId?: string;
|
|
33
|
-
cc?: string[];
|
|
34
|
-
priority?: number;
|
|
35
|
-
deliveryMode?: number;
|
|
36
|
-
mandatory?: boolean;
|
|
37
|
-
bcc?: string[];
|
|
38
|
-
replyTo?: string;
|
|
39
|
-
timestamp?: boolean;
|
|
40
|
-
ack?: boolean;
|
|
41
|
-
bindingVersion?: string;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export interface AmqpMessageBinding {
|
|
45
|
-
contentEncoding?: string;
|
|
46
|
-
messageType?: string;
|
|
47
|
-
bindingVersion?: string;
|
|
48
|
-
}
|