@dawans/promptshield
Version:
Secure your LLM stack with enterprise-grade RulePacks for AI safety scanning
66 lines (65 loc) • 1.54 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ValidateCommandBuilder = exports.ValidateCommand = void 0;
/**
* Validate command
*/
class ValidateCommand {
constructor(target, options) {
this.target = target;
this.options = options;
}
}
exports.ValidateCommand = ValidateCommand;
class ValidateCommandBuilder {
constructor() {
this.target = '';
this.options = {};
}
setTarget(target) {
this.target = target;
return this;
}
setOptions(options) {
this.options = options;
return this;
}
strict(value = true) {
this.options.strict = value;
return this;
}
verbose(value = true) {
this.options.verbose = value;
return this;
}
skipWarnings(value = true) {
this.options.skipWarnings = value;
return this;
}
maxErrors(value) {
this.options.maxErrors = value;
return this;
}
format(value) {
this.options.format = value;
return this;
}
batch(value = true) {
this.options.batch = value;
return this;
}
output(value) {
this.options.output = value;
return this;
}
build() {
if (!this.target) {
throw new Error('Target is required for validate command');
}
return {
target: this.target,
options: this.options,
};
}
}
exports.ValidateCommandBuilder = ValidateCommandBuilder;