-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c66d7c4
commit 189d3c0
Showing
21 changed files
with
120 additions
and
98 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { createDecorator, CoreDecorator, Type } from '@hapiness/core'; | ||
import { Options } from 'amqplib'; | ||
import { ExchangeType, ChannelOptions } from '../interfaces'; | ||
|
||
export interface ExchangeDecoratorInterface { | ||
name: string; | ||
type: ExchangeType; | ||
options?: Options.AssertExchange; | ||
channel?: ChannelOptions; | ||
providers?: Array<Type<any> | any>; | ||
} | ||
export const Exchange: CoreDecorator<ExchangeDecoratorInterface> = createDecorator<ExchangeDecoratorInterface>('Exchange', { | ||
name: undefined, | ||
type: undefined, | ||
options: undefined, | ||
channel: undefined, | ||
providers: [], | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export * from './exchange.decorator'; | ||
export * from './message.decorator'; | ||
export * from './queue.decorator'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { Type } from '@hapiness/core'; | ||
import { createDecorator, CoreDecorator } from '@hapiness/core'; | ||
|
||
export interface MessageDecoratorInterface { | ||
queue: Type<any>; | ||
exchange?: Type<any>; | ||
routingKey?: string | RegExp; | ||
filter?: { | ||
[key: string]: string | RegExp; | ||
}; | ||
is_fallback?: boolean; | ||
providers?: Array<Type<any> | any>; | ||
} | ||
export const Message: CoreDecorator<MessageDecoratorInterface> = createDecorator<MessageDecoratorInterface>('Message', { | ||
queue: undefined, | ||
exchange: undefined, | ||
routingKey: undefined, | ||
filter: undefined, | ||
is_fallback: false, | ||
providers: [], | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { Type } from '@hapiness/core'; | ||
import { createDecorator, CoreDecorator } from '@hapiness/core'; | ||
import { Options } from 'amqplib'; | ||
import { Bind, ChannelOptions } from '../interfaces'; | ||
|
||
export interface QueueDecoratorInterface { | ||
name: string; | ||
binds?: Array<Bind>; | ||
options?: Options.AssertQueue; | ||
channel?: ChannelOptions; | ||
force_json_decode?: boolean; | ||
providers?: Array<Type<any> | any>; | ||
} | ||
export const Queue: CoreDecorator<QueueDecoratorInterface> = createDecorator<QueueDecoratorInterface>('Queue', { | ||
name: undefined, | ||
binds: undefined, | ||
options: undefined, | ||
channel: undefined, | ||
force_json_decode: false, | ||
providers: [], | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export * from './build-exchange'; | ||
export * from './build-queues'; | ||
export * from './consume-queue'; | ||
export * from './get-channel'; | ||
export * from './register-annotations'; | ||
export * from './register-messages'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
export * from './interfaces'; | ||
export * from './managers'; | ||
export * from './services'; | ||
export * from './decorators'; | ||
export * from './events'; | ||
export * from './message-router'; | ||
export * from './message'; | ||
export * from './rabbitmq.extension'; | ||
export * from './rabbitmq.module'; | ||
export * from './extension/register-annotations'; | ||
export * from './utils'; | ||
export * from './interfaces'; | ||
export * from './extension'; | ||
export * from './managers'; | ||
export * from './decorators'; | ||
export * from './events'; | ||
export * from './services'; | ||
export * from './message-router'; | ||
export * from './message'; | ||
export * from './rabbitmq.extension'; | ||
export * from './rabbitmq.module'; | ||
export * from './utils'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { Type } from '@hapiness/core'; | ||
|
||
export interface Bind { | ||
exchange: Type<any>; | ||
pattern?: string | string[]; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export interface ChannelOptions { | ||
key: string; | ||
prefetch?: number; | ||
global?: boolean; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,4 @@ export enum ExchangeType { | |
Direct = 'direct', | ||
Topic = 'topic', | ||
Fanout = 'fanout' | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,15 @@ | ||
export * from './config'; | ||
export * from './consume-options'; | ||
export * from './create-channel.options'; | ||
export * from './exchange-type'; | ||
export * from './exchange'; | ||
export * from './message-options'; | ||
export * from './message-result'; | ||
export * from './message'; | ||
export * from './on-asserted'; | ||
export * from './queue-options'; | ||
export * from './queue'; | ||
export * from './rabbit-message'; | ||
export * from './bind'; | ||
export * from './channel-options'; | ||
export * from './config'; | ||
export * from './consume-options'; | ||
export * from './create-channel.options'; | ||
export * from './exchange-type'; | ||
export * from './exchange'; | ||
export * from './message-options'; | ||
export * from './message-result'; | ||
export * from './message-router'; | ||
export * from './message'; | ||
export * from './on-asserted'; | ||
export * from './queue-options'; | ||
export * from './queue'; | ||
export * from './rabbit-message'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,4 @@ | |
{ "name":"README.md" }, | ||
{ "name":"LICENSE.md" }, | ||
{ "name":"package.json" } | ||
] | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters