Skip to content

Commit

Permalink
upgrade dev dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
BDav24 committed May 30, 2018
1 parent ccc8999 commit c2cf4c7
Show file tree
Hide file tree
Showing 8 changed files with 1,302 additions and 1,196 deletions.
2 changes: 1 addition & 1 deletion .babelrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"presets": ["es2015", "stage-2"],
"presets": ["env", "stage-2"],
"plugins": [
"transform-runtime",
"transform-flow-strip-types"
Expand Down
2 changes: 1 addition & 1 deletion __tests__/providers/webpush/notificationCatcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ test('webpush notification catcher provider should use SMTP provider (with userI
expect(mockSend).lastCalledWith({
from: '-',
headers: {
'X-payload': '{"userId":"24","title":"Hi John","body":"Hello John! How are you?","icon":"https://notifme.github.io/notifme-sdk/img/icon.png"}',
'X-payload': '{"title":"Hi John","userId":"24","body":"Hello John! How are you?","icon":"https://notifme.github.io/notifme-sdk/img/icon.png"}',
'X-to': '[webpush] 24',
'X-type': 'webpush'
},
Expand Down
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,20 @@
},
"devDependencies": {
"babel-cli": "6.26.0",
"babel-eslint": "8.0.1",
"babel-jest": "22.1.0",
"babel-eslint": "8.2.3",
"babel-jest": "23.0.1",
"babel-plugin-transform-flow-strip-types": "6.22.0",
"babel-plugin-transform-runtime": "6.23.0",
"babel-preset-es2015": "6.24.1",
"babel-preset-env": "1.7.0",
"babel-preset-stage-2": "6.24.1",
"babel-register": "6.26.0",
"cost-of-modules": "1.0.1",
"flow-bin": "0.52.0",
"jest": "22.1.4",
"nodemon": "1.14.12",
"flow-bin": "0.73.0",
"jest": "23.0.1",
"nodemon": "1.17.5",
"notification-catcher": "1.2.1",
"regenerator-runtime": "0.11.1",
"standard": "10.0.3"
"standard": "11.0.1"
},
"files": [
"lib"
Expand Down
6 changes: 3 additions & 3 deletions src/providers/push/notificationCatcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ import NotificationCatcherProvider from '../notificationCatcherProvider'
import type {PushRequestType} from '../../models/notification-request'

export default class PushNotificationCatcherProvider extends NotificationCatcherProvider {
async send ({registrationToken, ...request}: PushRequestType): Promise<string> {
async send ({registrationToken, title, ...request}: PushRequestType): Promise<string> {
return this.sendToCatcher({
to: '[email protected]',
from: '-',
subject: `${request.title.substring(0, 20)}${request.title.length > 20 ? '...' : ''}`,
subject: `${title.substring(0, 20)}${title.length > 20 ? '...' : ''}`,
headers: {
'X-type': 'push',
'X-to': `[push] ${registrationToken.substring(0, 20)}...`,
'X-payload': JSON.stringify(request)
'X-payload': JSON.stringify({title, ...request})
}
})
}
Expand Down
6 changes: 3 additions & 3 deletions src/providers/sms/ovh.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ export default class SmsOvhProvider {
charset: 'UTF-8',
class: messageClass === 0 ? 'flash'
: (messageClass === 1 ? 'phoneDisplay'
: (messageClass === 2 ? 'sim'
: (messageClass === 3 ? 'toolkit'
: null))),
: (messageClass === 2 ? 'sim'
: (messageClass === 3 ? 'toolkit'
: null))),
noStopClause: type === 'transactional',
validityPeriod: ttl
})
Expand Down
6 changes: 3 additions & 3 deletions src/providers/webpush/notificationCatcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ import NotificationCatcherProvider from '../notificationCatcherProvider'
import type {WebpushRequestType} from '../../models/notification-request'

export default class WebpushNotificationCatcherProvider extends NotificationCatcherProvider {
async send ({subscription, ...request}: WebpushRequestType): Promise<string> {
async send ({subscription, title, ...request}: WebpushRequestType): Promise<string> {
return this.sendToCatcher({
to: `${request.userId ? request.userId : 'user'}@webpush`,
from: '-',
subject: request.title,
subject: title,
headers: {
'X-type': 'webpush',
'X-to': `[webpush] ${request.userId ? request.userId : ''}`,
'X-payload': JSON.stringify(request)
'X-payload': JSON.stringify({title, ...request})
}
})
}
Expand Down
2 changes: 1 addition & 1 deletion src/strategies/providers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const providerStrategies = {
const strategies = Object.keys(providerStrategies)

export default function factory (channels: ChannelOptionsType): StrategiesType {
return Object.keys(channels).reduce((acc, key: ChannelType): StrategiesType => {
return Object.keys(channels).reduce((acc, key: any): StrategiesType => {
const optionStrategy = (channels[key]: any).multiProviderStrategy
if (typeof optionStrategy === 'function') {
acc[key] = optionStrategy
Expand Down
Loading

0 comments on commit c2cf4c7

Please sign in to comment.