diff --git a/index.d.ts b/index.d.ts index b3a7171a..5583b501 100644 --- a/index.d.ts +++ b/index.d.ts @@ -7,17 +7,21 @@ export const version: string; /** * Error codes */ -export const BAD_SUBJECT: string; +export const BAD_AUTHENTICATION: string; +export const BAD_JSON: string; export const BAD_MSG: string; export const BAD_REPLY: string; +export const BAD_SUBJECT: string; +export const CLIENT_CERT_REQ: string; export const CONN_CLOSED: string; -export const BAD_JSON: string; -export const BAD_AUTHENTICATION: string; +export const CONN_ERR: string; export const INVALID_ENCODING: string; -export const SECURE_CONN_REQ: string; -export const NON_SECURE_CONN_REQ: string; -export const CLIENT_CERT_REQ: string; export const NATS_PROTOCOL_ERR: string; +export const NON_SECURE_CONN_REQ: string; +export const PERMISSIONS_ERR: string; +export const REQ_TIMEOUT: string; +export const SECURE_CONN_REQ: string; +export const STALE_CONNECTION_ERR: string; /** * Create a properly formatted inbox subject. diff --git a/lib/nats.js b/lib/nats.js index 0bffaf21..9d9c0016 100644 --- a/lib/nats.js +++ b/lib/nats.js @@ -21,7 +21,7 @@ var net = require('net'), /** * Constants */ -var VERSION = '0.7.22', +var VERSION = '0.7.24', DEFAULT_PORT = 4222, DEFAULT_PRE = 'nats://localhost:', @@ -64,33 +64,33 @@ var VERSION = '0.7.22', PONG_RESPONSE = 'PONG' + CR_LF, // Errors - BAD_SUBJECT = 'BAD_SUBJECT', - BAD_SUBJECT_MSG = 'Subject must be supplied', + BAD_AUTHENTICATION = 'BAD_AUTHENTICATION', + BAD_AUTHENTICATION_MSG = 'User and Token can not both be provided', + BAD_JSON = 'BAD_JSON', + BAD_JSON_MSG = 'Message should be a JSON object', BAD_MSG = 'BAD_MSG', BAD_MSG_MSG = 'Message can\'t be a function', BAD_REPLY = 'BAD_REPLY', BAD_REPLY_MSG = 'Reply can\'t be a function', + BAD_SUBJECT = 'BAD_SUBJECT', + BAD_SUBJECT_MSG = 'Subject must be supplied', + CLIENT_CERT_REQ = 'CLIENT_CERT_REQ', + CLIENT_CERT_REQ_MSG = 'Server requires a client certificate.', CONN_CLOSED = 'CONN_CLOSED', CONN_CLOSED_MSG = 'Connection closed', - BAD_JSON = 'BAD_JSON', - BAD_JSON_MSG = 'Message should be a JSON object', - BAD_AUTHENTICATION = 'BAD_AUTHENTICATION', - BAD_AUTHENTICATION_MSG = 'User and Token can not both be provided', + CONN_ERR = 'CONN_ERR', + CONN_ERR_MSG_PREFIX = 'Could not connect to server: ', INVALID_ENCODING = 'INVALID_ENCODING', INVALID_ENCODING_MSG_PREFIX = 'Invalid Encoding:', - SECURE_CONN_REQ = 'SECURE_CONN_REQ', - SECURE_CONN_REQ_MSG = 'Server requires a secure connection.', + NATS_PROTOCOL_ERR = 'NATS_PROTOCOL_ERR', NON_SECURE_CONN_REQ = 'NON_SECURE_CONN_REQ', NON_SECURE_CONN_REQ_MSG = 'Server does not support a secure connection.', - CLIENT_CERT_REQ = 'CLIENT_CERT_REQ', - CLIENT_CERT_REQ_MSG = 'Server requires a client certificate.', - CONN_ERR = 'CONN_ERR', - CONN_ERR_MSG_PREFIX = 'Could not connect to server: ', - NATS_PROTOCOL_ERR = 'NATS_PROTOCOL_ERR', + PERMISSIONS_ERR = "permissions violation", REQ_TIMEOUT = 'REQ_TIMEOUT', REQ_TIMEOUT_MSG_PREFIX = 'The request timed out for subscription id: ', + SECURE_CONN_REQ = 'SECURE_CONN_REQ', + SECURE_CONN_REQ_MSG = 'Server requires a secure connection.', STALE_CONNECTION_ERR = "stale connection", - PERMISSIONS_ERR = "permissions violation", // Pedantic Mode support //Q_SUB = /^([^\.\*>\s]+|>$|\*)(\.([^\.\*>\s]+|>$|\*))*$/, // TODO: remove / never used diff --git a/package.json b/package.json index 4acfcfad..c9f0e6d3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "nats", - "version": "0.7.22", + "version": "0.7.24", "description": "Node.js client for NATS, a lightweight, high-performance cloud native messaging system", "keywords": [ "nats",