18 lines
690 B
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.whmcsErrorResponseSchema = exports.whmcsResponseSchema = void 0;
const zod_1 = require("zod");
const whmcsResponseBaseSchema = zod_1.z.object({
result: zod_1.z.enum(["success", "error"]),
message: zod_1.z.string().optional(),
});
const whmcsResponseSchema = (dataSchema) => whmcsResponseBaseSchema.extend({
data: dataSchema.optional(),
});
exports.whmcsResponseSchema = whmcsResponseSchema;
exports.whmcsErrorResponseSchema = zod_1.z.object({
result: zod_1.z.literal("error"),
message: zod_1.z.string(),
errorcode: zod_1.z.string().optional(),
});
//# sourceMappingURL=whmcs.js.map