UNPKG

axiodb

Version:

The Pure JavaScript Alternative to SQLite. Embedded NoSQL database for Node.js with MongoDB-style queries, zero native dependencies, built-in InMemoryCache, and web GUI. Perfect for desktop apps, CLI tools, and embedded systems. No compilation, no platfor

74 lines 3.17 kB
"use strict"; /** * TCP Server Configuration Constants */ Object.defineProperty(exports, "__esModule", { value: true }); exports.SuccessMessage = exports.ErrorMessage = exports.StatusCode = exports.MAX_BUFFER_SIZE = exports.INITIAL_BUFFER_SIZE = exports.ENCODING = exports.MESSAGE_LENGTH_BYTES = exports.MAX_RECONNECT_DELAY = exports.INITIAL_RECONNECT_DELAY = exports.MAX_RECONNECT_ATTEMPTS = exports.HEARTBEAT_TIMEOUT = exports.HEARTBEAT_INTERVAL = exports.DEFAULT_REQUEST_TIMEOUT = exports.CONNECTION_TIMEOUT = exports.MAX_CONNECTIONS = exports.MAX_MESSAGE_SIZE = exports.DEFAULT_TCP_PORT = void 0; // Server Configuration exports.DEFAULT_TCP_PORT = 27019; exports.MAX_MESSAGE_SIZE = 50 * 1024 * 1024; // 50MB exports.MAX_CONNECTIONS = 1000; // Maximum concurrent connections exports.CONNECTION_TIMEOUT = 60000; // 60 seconds // Request/Response Configuration exports.DEFAULT_REQUEST_TIMEOUT = 30000; // 30 seconds exports.HEARTBEAT_INTERVAL = 30000; // 30 seconds exports.HEARTBEAT_TIMEOUT = 5000; // 5 seconds // Reconnection Configuration exports.MAX_RECONNECT_ATTEMPTS = 10; exports.INITIAL_RECONNECT_DELAY = 1000; // 1 second exports.MAX_RECONNECT_DELAY = 30000; // 30 seconds // Protocol Configuration exports.MESSAGE_LENGTH_BYTES = 4; // 4-byte uint32 for message length exports.ENCODING = 'utf8'; // Buffer Configuration exports.INITIAL_BUFFER_SIZE = 4096; // 4KB exports.MAX_BUFFER_SIZE = exports.MAX_MESSAGE_SIZE + exports.MESSAGE_LENGTH_BYTES; // Status Codes (HTTP-style) exports.StatusCode = { // Success OK: 200, CREATED: 201, NO_CONTENT: 204, // Client Errors BAD_REQUEST: 400, UNAUTHORIZED: 401, FORBIDDEN: 403, NOT_FOUND: 404, CONFLICT: 409, PAYLOAD_TOO_LARGE: 413, UNPROCESSABLE_ENTITY: 422, // Server Errors INTERNAL_SERVER_ERROR: 500, NOT_IMPLEMENTED: 501, SERVICE_UNAVAILABLE: 503, }; // Error Messages exports.ErrorMessage = { INVALID_MESSAGE_FORMAT: 'Invalid message format', MESSAGE_TOO_LARGE: 'Message exceeds maximum size', UNKNOWN_COMMAND: 'Unknown command', MISSING_REQUIRED_PARAMS: 'Missing required parameters', INVALID_CORRELATION_ID: 'Invalid correlation ID', CONNECTION_TIMEOUT: 'Connection timeout', REQUEST_TIMEOUT: 'Request timeout', SERVER_OVERLOAD: 'Server is overloaded', INTERNAL_ERROR: 'Internal server error', }; // Success Messages exports.SuccessMessage = { PING_PONG: 'PONG', DISCONNECTED: 'Successfully disconnected', DB_CREATED: 'Database created successfully', DB_DELETED: 'Database deleted successfully', COLLECTION_CREATED: 'Collection created successfully', COLLECTION_DELETED: 'Collection deleted successfully', DOCUMENT_INSERTED: 'Document inserted successfully', DOCUMENTS_INSERTED: 'Documents inserted successfully', DOCUMENT_UPDATED: 'Document updated successfully', DOCUMENTS_UPDATED: 'Documents updated successfully', DOCUMENT_DELETED: 'Document deleted successfully', DOCUMENTS_DELETED: 'Documents deleted successfully', INDEX_CREATED: 'Index created successfully', INDEX_DROPPED: 'Index dropped successfully', }; //# sourceMappingURL=keys.js.map