feat: 🎸 merge in plan editor

This commit is contained in:
amianthus
2025-10-16 16:08:19 +01:00
parent f940b73525
commit 6a1fa62fdb
402 changed files with 23838 additions and 10823 deletions

View File

@@ -0,0 +1,29 @@
import { RecaseError } from "../base/RecaseError.js";
import { FeatureErrorCode } from "../codes/featureErrCodes.js";
/**
* Product not found error
*/
export class FeatureAlreadyExistsError extends RecaseError {
constructor(opts: { productId: string; version?: string }) {
super({
message: `Product ${opts.productId} ${opts.version ? ` (version ${opts.version})` : ""} not found`,
code: FeatureErrorCode.FeatureAlreadyExists,
statusCode: 404,
});
this.name = "ProductNotFoundError";
}
}
/**
* Feature not found error
*/
export class FeatureNotFoundError extends RecaseError {
constructor(opts: { featureId: string }) {
super({
message: `Feature ${opts.featureId} not found`,
code: FeatureErrorCode.FeatureNotFound,
statusCode: 404,
});
}
}

View File

@@ -0,0 +1,7 @@
export const FeatureErrorCode = {
FeatureNotFound: "feature_not_found",
FeatureAlreadyExists: "feature_already_exists",
} as const;
export type FeatureErrorCode =
(typeof FeatureErrorCode)[keyof typeof FeatureErrorCode];