Skip to content

Commit

Permalink
tscript exports (#167)
Browse files Browse the repository at this point in the history
  • Loading branch information
Alberto Ricart authored Oct 20, 2017
1 parent 09418f6 commit c008bd4
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 22 deletions.
16 changes: 10 additions & 6 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
30 changes: 15 additions & 15 deletions lib/nats.js
Original file line number Diff line number Diff line change
Expand Up @@ -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:',
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down

0 comments on commit c008bd4

Please sign in to comment.