@martinmilo/verve
Version:
TypeScript domain modeling library with field-level authorization, business rule validation, and context-aware access control
41 lines • 3.78 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.errorMessages = void 0;
const codes_1 = require("./codes");
exports.errorMessages = {
// Authorization errors
[]: 'Unauthorized to call method {{method}}',
// Model instantiation errors
[]: 'Direct instantiation not allowed. Use .make() or .from() instead.',
// Field access errors
[]: "Field '{{field}}' is not readable on model '{{model}}'",
[]: "Field '{{field}}' is not initialized on model '{{model}}'",
[]: "Field '{{field}}' type mismatch on model '{{model}}'",
[]: "Field '{{field}}' is not writable on model '{{model}}'",
[]: "Field '{{field}}' is computed and cannot be overwritten on model '{{model}}'",
[]: "Error setting field '{{field}}' on model '{{model}}'",
[]: "Error unsetting field '{{field}}' on model '{{model}}'",
[]: "Field '{{field}}' has no generator on model '{{model}}'",
[]: "Field '{{field}}' has already been generated on model '{{model}}'",
[]: "Field '{{field}}' on existing model cannot be generated on model '{{model}}'",
[]: "Field '{{field}}' has no compute on model '{{model}}'",
[]: "Field '{{field}}' is computed and cannot be mutated on model '{{model}}'",
// Field validator errors
[]: "Field '{{field}}' is not nullable on model '{{model}}'",
[]: "Field '{{field}}' validator '{{validator}}' failed on model '{{model}}'",
[]: "Field '{{field}}' validators failed on model '{{model}}' with errors:\n{{errors}}",
// Association errors
[]: 'You must call .to(...) after .associate({{from}})',
[]: 'Association is invalid for field {{field}} on model {{model}} for value {{value}}',
[]: 'Association validator for field {{field}} on model {{model}} could not be found in registry!',
// Model errors
[]: 'ID field cannot be excluded by `except` method',
[]: 'Model {{model}} validation failed with errors:\n{{errors}}',
// Context errors
[]: 'AsyncLocalStorage requires Node.js environment. Use Context.useGlobalStorage() for browser environments or non-Node.js runtimes.',
[]: 'Use Context.run() to set context in async scope',
[]: 'Context automatically resets when async scope ends',
[]: 'Failed to set up AsyncLocalStorage adapter. This usually means you\'re not in a Node.js environment. Use Context.useGlobalStorage() for browsers',
[]: 'Context adapter must be explicitly set in Node.js environments to prevent context leaking between requests. Use Context.useAsyncLocalStorage() for proper request isolation, or Context.useGlobalStorage() if you understand the risks.',
};
//# sourceMappingURL=message.js.map