mcp-harbor
Version:
A Node.js application for connecting to Harbor and providing operations capabilities.
44 lines • 1.29 kB
JavaScript
// Custom Error Types
export class HarborError extends Error {
code;
data;
name;
constructor(message, code = -32603) {
// InternalError
super(message);
this.code = code;
this.name = "HarborError";
Object.setPrototypeOf(this, HarborError.prototype);
}
}
export class ValidationError extends HarborError {
name;
constructor(message) {
super(message, -32602); // InvalidParams
this.name = "ValidationError";
Object.setPrototypeOf(this, ValidationError.prototype);
}
}
export class ResourceError extends HarborError {
name;
constructor(message) {
super(message, -32601); // MethodNotFound
this.name = "ResourceError";
Object.setPrototypeOf(this, ResourceError.prototype);
}
}
// Tool Constants
export const TOOL_NAMES = {
LIST_PROJECTS: "list_projects",
GET_PROJECT: "get_project",
CREATE_PROJECT: "create_project",
DELETE_PROJECT: "delete_project",
LIST_REPOSITORIES: "list_repositories",
DELETE_REPOSITORY: "delete_repository",
LIST_TAGS: "list_tags",
DELETE_TAG: "delete_tag",
LIST_CHARTS: "list_charts",
LIST_CHART_VERSIONS: "list_chart_versions",
DELETE_CHART: "delete_chart",
};
//# sourceMappingURL=index.js.map