twilio-notifications
Advanced tools
Comparing version 0.5.0 to 0.5.1
@@ -20,3 +20,3 @@ "use strict"; | ||
function prepareLine(prefix, args) { | ||
return [prefix].concat((0, _from2.default)(args)); | ||
return [new Date().toISOString() + " Notifications " + prefix + ":"].concat((0, _from2.default)(args)); | ||
} | ||
@@ -43,3 +43,3 @@ | ||
logger.debug.apply(null, prepareLine('Notifications T:' + this.prefix, args)); | ||
logger.debug.apply(null, prepareLine('T' + this.prefix, args)); | ||
} | ||
@@ -53,3 +53,3 @@ }, { | ||
logger.debug.apply(null, prepareLine('Notifications D:' + this.prefix, args)); | ||
logger.debug.apply(null, prepareLine('D' + this.prefix, args)); | ||
} | ||
@@ -63,3 +63,3 @@ }, { | ||
logger.info.apply(null, prepareLine('Notifications I:' + this.prefix, args)); | ||
logger.info.apply(null, prepareLine('I' + this.prefix, args)); | ||
} | ||
@@ -73,3 +73,3 @@ }, { | ||
logger.warn.apply(null, prepareLine('Notifications W:' + this.prefix, args)); | ||
logger.warn.apply(null, prepareLine('W' + this.prefix, args)); | ||
} | ||
@@ -83,3 +83,3 @@ }, { | ||
logger.error.apply(null, prepareLine('Notifications E:' + this.prefix, args)); | ||
logger.error.apply(null, prepareLine('E' + this.prefix, args)); | ||
} | ||
@@ -86,0 +86,0 @@ }], [{ |
@@ -30,7 +30,7 @@ /// <reference types="node" /> | ||
*/ | ||
private _routeMessage(type, message); | ||
private _onNeedReliableTransport(isNeeded); | ||
private _onRegistrationStateChange(state); | ||
private _onTransportStateChange(connected); | ||
private _updateTransportState(); | ||
private _routeMessage; | ||
private _onNeedReliableTransport; | ||
private _onRegistrationStateChange; | ||
private _onTransportStateChange; | ||
private _updateTransportState; | ||
/** | ||
@@ -67,1 +67,22 @@ * Adds the subscription for the given message type | ||
export { ChannelType, ConnectionState, PushNotification, Client }; | ||
/** | ||
* Fired when new message arrived. | ||
* @param {Object} message` | ||
* @event Client#message | ||
*/ | ||
/** | ||
* Fired when transport state has changed | ||
* @param {boolean} transport state | ||
* @event Client#transportReady | ||
*/ | ||
/** | ||
* Fired when transport state has been changed | ||
* @param {string} transport state | ||
* @event Client#connectionStateChanged | ||
*/ | ||
/** | ||
* These options can be passed to Client constructor | ||
* @typedef {Object} Notifications#ClientOptions | ||
* @property {String} [logLevel='error'] - The level of logging to enable. Valid options | ||
* (from strictest to broadest): ['silent', 'error', 'warn', 'info', 'debug', 'trace'] | ||
*/ |
@@ -22,3 +22,3 @@ /// <reference types="node" /> | ||
updateToken(token: string): void; | ||
private persistRegistration(); | ||
private persistRegistration; | ||
setNotificationId(notificationId: string): void; | ||
@@ -25,0 +25,0 @@ protected abstract updateRegistration(registration: RegistrationState, reasons: Set<UpdateReason>): Promise<RegistrationState>; |
@@ -5,3 +5,3 @@ declare class Logger { | ||
static scope(prefix?: string): Logger; | ||
setLevel(level: string): void; | ||
setLevel(level: any): void; | ||
trace(...args: any[]): void; | ||
@@ -8,0 +8,0 @@ debug(...args: any[]): void; |
@@ -5,3 +5,3 @@ "use strict"; | ||
function prepareLine(prefix, args) { | ||
return [prefix].concat(Array.from(args)); | ||
return [`${new Date().toISOString()} Notifications ${prefix}:`].concat(Array.from(args)); | ||
} | ||
@@ -19,7 +19,7 @@ class Logger { | ||
} | ||
trace(...args) { logger.debug.apply(null, prepareLine('Notifications T:' + this.prefix, args)); } | ||
debug(...args) { logger.debug.apply(null, prepareLine('Notifications D:' + this.prefix, args)); } | ||
info(...args) { logger.info.apply(null, prepareLine('Notifications I:' + this.prefix, args)); } | ||
warn(...args) { logger.warn.apply(null, prepareLine('Notifications W:' + this.prefix, args)); } | ||
error(...args) { logger.error.apply(null, prepareLine('Notifications E:' + this.prefix, args)); } | ||
trace(...args) { logger.debug.apply(null, prepareLine('T' + this.prefix, args)); } | ||
debug(...args) { logger.debug.apply(null, prepareLine('D' + this.prefix, args)); } | ||
info(...args) { logger.info.apply(null, prepareLine('I' + this.prefix, args)); } | ||
warn(...args) { logger.warn.apply(null, prepareLine('W' + this.prefix, args)); } | ||
error(...args) { logger.error.apply(null, prepareLine('E' + this.prefix, args)); } | ||
} | ||
@@ -26,0 +26,0 @@ exports.Logger = Logger; |
@@ -24,4 +24,4 @@ import { UpdateReason, RegistrationState, Connector } from './connector'; | ||
protected removeRegistration(): Promise<void>; | ||
private register(registration); | ||
private register; | ||
} | ||
export { Connector, RegistrarConnector }; |
@@ -45,4 +45,4 @@ /// <reference types="node" /> | ||
*/ | ||
private detectPlatform(); | ||
private detectPlatform; | ||
} | ||
export { ChannelType, Registrar }; |
@@ -12,3 +12,3 @@ import { Configuration } from './configuration'; | ||
updateToken(token: string): void; | ||
private updateContextRequest(messageTypes); | ||
private updateContextRequest; | ||
protected updateRegistration(registration: RegistrationState, reasons: Set<UpdateReason>): Promise<RegistrationState>; | ||
@@ -15,0 +15,0 @@ protected removeRegistration(): Promise<void>; |
{ | ||
"name": "twilio-notifications", | ||
"version": "0.5.0", | ||
"version": "0.5.1", | ||
"description": "Client library for Twilio Notifications service", | ||
@@ -18,3 +18,3 @@ "main": "lib/index.js", | ||
"dependencies": { | ||
"twilsock": "^0.5.1", | ||
"twilsock": "^0.5.5", | ||
"loglevel": "^1.6.1", | ||
@@ -21,0 +21,0 @@ "operation-retrier": "^2.0.0", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
9
674698
12176
Updatedtwilsock@^0.5.5