-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated prettier with configs and travis with coveralls
Signed-off-by: Aaryanna Simonelli <[email protected]>
- Loading branch information
Showing
13 changed files
with
80 additions
and
47 deletions.
There are no files selected for viewing
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 @@ | ||
dist/ |
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,4 @@ | ||
{ | ||
"singleQuote": true, | ||
"trailingComma": "all" | ||
} |
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 |
---|---|---|
|
@@ -12,4 +12,5 @@ before_install: | |
install: | ||
- yarn | ||
script: | ||
- yarn run test | ||
- yarn run test | ||
after_success: yarn run coveralls |
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 |
---|---|---|
@@ -1,14 +1,14 @@ | ||
import { AmqpConnectionOptions } from "../interfaces"; | ||
import * as amqp from "amqplib"; | ||
import resolveAmqpUrl from "./resolveAmqlUrl"; | ||
import { AmqpConnectionOptions } from '../interfaces'; | ||
import * as amqp from 'amqplib'; | ||
import resolveAmqpUrl from './resolveAmqlUrl'; | ||
|
||
export default function createConnectionProvider( | ||
name: number | string, | ||
options?: AmqpConnectionOptions | ||
options?: AmqpConnectionOptions, | ||
) { | ||
const url = resolveAmqpUrl(options); | ||
return { | ||
provide: `amqpConnection_${options.name ? options.name : name}`, | ||
useFactory: async () => await amqp.connect(url) | ||
useFactory: async () => await amqp.connect(url), | ||
}; | ||
} |
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,12 @@ | ||
import * as amqp from "amqplib"; | ||
import { ConfigService } from "nestjs-config"; | ||
import * as amqp from 'amqplib'; | ||
import { ConfigService } from 'nestjs-config'; | ||
|
||
const DefaultConnection = { | ||
provide: "amqpConnection_default", | ||
provide: 'amqpConnection_default', | ||
useFactory: async (config: ConfigService) => { | ||
//TODO add configservice here | ||
return await amqp.connect(); | ||
}, | ||
inject: [ConfigService] | ||
inject: [ConfigService], | ||
}; | ||
export default DefaultConnection; |
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,5 +1,5 @@ | ||
import createConnectionProvider from "./createConnectionProvider"; | ||
import DefaultConnection from "./defaultConnection"; | ||
import resolveAmqpUrl from "./resolveAmqlUrl"; | ||
import createConnectionProvider from './createConnectionProvider'; | ||
import DefaultConnection from './defaultConnection'; | ||
import resolveAmqpUrl from './resolveAmqlUrl'; | ||
|
||
export { createConnectionProvider, DefaultConnection, resolveAmqpUrl }; |
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,13 +1,13 @@ | ||
import { AmqpConnectionOptions } from "./../interfaces"; | ||
import { AmqpConnectionOptions } from './../interfaces'; | ||
|
||
export default function resolveAmqpUrl(options: AmqpConnectionOptions): string { | ||
if (Object.keys(options).length === 1) return options.host; | ||
let url = | ||
(options.hasOwnProperty("ssl") && options.ssl ? "amqps" : "amqp") + "://"; | ||
(options.hasOwnProperty('ssl') && options.ssl ? 'amqps' : 'amqp') + '://'; | ||
|
||
if (options.hasOwnProperty("username")) url += options.username; | ||
if (options.hasOwnProperty("password")) url += `:${options.password}@`; | ||
if (options.hasOwnProperty('username')) url += options.username; | ||
if (options.hasOwnProperty('password')) url += `:${options.password}@`; | ||
url += options.host; | ||
if (options.hasOwnProperty("port")) url += `:${options.port}`; | ||
if (options.hasOwnProperty('port')) url += `:${options.port}`; | ||
return url; | ||
} |
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,3 +1,3 @@ | ||
import InjectAmqpConnection from "./injectampqconnection.decorator"; | ||
import InjectAmqpConnection from './injectampqconnection.decorator'; | ||
|
||
export { InjectAmqpConnection }; |
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,7 +1,7 @@ | ||
import { Inject } from "@nestjs/common"; | ||
import { Inject } from '@nestjs/common'; | ||
|
||
const InjectAmqpConnection = ( | ||
connectionName: string = "amqpConnection_default" | ||
connectionName: string = 'amqpConnection_default', | ||
) => Inject(connectionName); | ||
|
||
export default InjectAmqpConnection; |
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,3 +1,3 @@ | ||
import AmqpConnectionOptions from "./amqpconnection-options.interface"; | ||
import AmqpConnectionOptions from './amqpconnection-options.interface'; | ||
|
||
export { AmqpConnectionOptions }; |
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 |
---|---|---|
|
@@ -772,6 +772,17 @@ [email protected]: | |
object-assign "^4" | ||
vary "^1" | ||
|
||
coveralls@^3.0.2: | ||
version "3.0.2" | ||
resolved "https://registry.yarnpkg.com/coveralls/-/coveralls-3.0.2.tgz#f5a0bcd90ca4e64e088b710fa8dda640aea4884f" | ||
dependencies: | ||
growl "~> 1.10.0" | ||
js-yaml "^3.11.0" | ||
lcov-parse "^0.0.10" | ||
log-driver "^1.2.7" | ||
minimist "^1.2.0" | ||
request "^2.85.0" | ||
|
||
cpx@^1.5.0: | ||
version "1.5.0" | ||
resolved "https://registry.yarnpkg.com/cpx/-/cpx-1.5.0.tgz#185be018511d87270dedccc293171e37655ab88f" | ||
|
@@ -1438,6 +1449,10 @@ graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.6: | |
version "4.1.11" | ||
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658" | ||
|
||
"growl@~> 1.10.0": | ||
version "1.10.5" | ||
resolved "https://registry.yarnpkg.com/growl/-/growl-1.10.5.tgz#f2735dc2283674fa67478b10181059355c369e5e" | ||
|
||
growly@^1.3.0: | ||
version "1.3.0" | ||
resolved "https://registry.yarnpkg.com/growly/-/growly-1.3.0.tgz#f10748cbe76af964b7c96c93c6bcc28af120c081" | ||
|
@@ -2187,7 +2202,7 @@ js-tokens@^3.0.0, js-tokens@^3.0.2: | |
version "4.0.0" | ||
resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" | ||
|
||
js-yaml@^3.7.0: | ||
js-yaml@^3.11.0, js-yaml@^3.7.0: | ||
version "3.12.0" | ||
resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.12.0.tgz#eaed656ec8344f10f527c6bfa1b6e2244de167d1" | ||
dependencies: | ||
|
@@ -2298,6 +2313,10 @@ lcid@^1.0.0: | |
dependencies: | ||
invert-kv "^1.0.0" | ||
|
||
lcov-parse@^0.0.10: | ||
version "0.0.10" | ||
resolved "https://registry.yarnpkg.com/lcov-parse/-/lcov-parse-0.0.10.tgz#1b0b8ff9ac9c7889250582b70b71315d9da6d9a3" | ||
|
||
left-pad@^1.2.0: | ||
version "1.3.0" | ||
resolved "https://registry.yarnpkg.com/left-pad/-/left-pad-1.3.0.tgz#5b8a3a7765dfe001261dde915589e782f8c94d1e" | ||
|
@@ -2353,6 +2372,10 @@ lodash@^4.13.1, lodash@^4.17.10, lodash@^4.17.4: | |
version "4.17.10" | ||
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.10.tgz#1b7793cf7259ea38fb3661d4d38b3260af8ae4e7" | ||
|
||
log-driver@^1.2.7: | ||
version "1.2.7" | ||
resolved "https://registry.yarnpkg.com/log-driver/-/log-driver-1.2.7.tgz#63b95021f0702fedfa2c9bb0a24e7797d71871d8" | ||
|
||
longest@^1.0.1: | ||
version "1.0.1" | ||
resolved "https://registry.yarnpkg.com/longest/-/longest-1.0.1.tgz#30a0b2da38f73770e8294a0d22e6625ed77d0097" | ||
|
@@ -3133,7 +3156,7 @@ request-promise-native@^1.0.5: | |
stealthy-require "^1.1.0" | ||
tough-cookie ">=2.3.3" | ||
|
||
request@^2.83.0: | ||
request@^2.83.0, request@^2.85.0: | ||
version "2.87.0" | ||
resolved "https://registry.yarnpkg.com/request/-/request-2.87.0.tgz#32f00235cd08d482b4d0d68db93a829c0ed5756e" | ||
dependencies: | ||
|