trade360-nodejs-sdk
Version:
LSports Trade360 SDK for Node.js
48 lines • 1.84 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.MQSettingsSchema = void 0;
const zod_1 = require("zod");
const types_1 = require("../types");
/**
* Schema for the MQ settings object. This schema is
* used to parse and validate the MQ settings object.
* The MQ settings object is used to configure the
* connection to the RabbitMQ server.
*/
exports.MQSettingsSchema = zod_1.z.object({
hostname: zod_1.z.string(),
port: zod_1.z.number().int().positive(),
vhost: zod_1.z.string(),
username: zod_1.z.string(),
password: zod_1.z.string(),
packageId: zod_1.z.number().int().positive(),
prefetchCount: zod_1.z
.number()
.int()
.positive()
.min(types_1.MIN_PREFETCH_COUNT)
.default(types_1.DEFUALT_PREFETCH_COUNT),
autoAck: zod_1.z.boolean().default(types_1.DEFUALT_AUTO_ACK),
networkRecoveryIntervalInMs: zod_1.z
.number()
.int()
.positive()
.min(types_1.MIN_NETWORK_RECOVERY_INTERVAL_IN_MS)
.default(types_1.DEFUALT_NETWORK_RECOVERY_INTERVAL_IN_MS),
maxRetryAttempts: zod_1.z.number().int().positive(),
consumptionLatencyThreshold: zod_1.z
.number()
.int()
.nonnegative()
.default(types_1.DEFUALT_CONSUMPTION_LATENCY_THRESHOLD),
requestedHeartbeatSeconds: zod_1.z
.number()
.int()
.nonnegative()
.min(types_1.MIN_REQUESTED_HEARTBEAT_SECONDS)
.default(types_1.DEFUALT_REQUESTED_HEARTBEAT_SECONDS),
dispatchConsumersAsync: zod_1.z.boolean().default(types_1.DEFUALT_DISPATCH_CONSUMERS),
automaticRecoveryEnabled: zod_1.z.boolean().default(types_1.DEFUALT_AUTOMATIC_RECOVERY_ENABLED),
customersApiBaseUrl: zod_1.z.string().url().optional(),
});
//# sourceMappingURL=mq-settings.schema.js.map