Development Artifact Cleanup: ✅ BROTHER_NODE REORGANIZATION: Moved development test node to appropriate location - dev/test-nodes/brother_node/: Moved from root directory for better organization - Contains development configuration, test logs, and test chain data - No impact on production systems - purely development/testing artifact ✅ DEVELOPMENT ARTIFACTS IDENTIFIED: - Chain ID: aitbc-brother-chain (test/development chain) - Ports: 8010 (P2P) and 8011 (RPC) - different from production - Environment: .env file with test configuration - Logs: rpc.log and node.log from development testing session (March 15, 2026) ✅ ROOT DIRECTORY CLEANUP: Removed development clutter from production directory - brother_node/ moved to dev/test-nodes/brother_node/ - Root directory now contains only production-ready components - Development artifacts properly organized in dev/ subdirectory DIRECTORY STRUCTURE IMPROVEMENT: 📁 dev/test-nodes/: Development and testing node configurations 🏗️ Root Directory: Clean production structure with only essential components 🧪 Development Isolation: Test environments separated from production BENEFITS: ✅ Clean Production Directory: No development artifacts in root ✅ Better Organization: Development nodes grouped in dev/ subdirectory ✅ Clear Separation: Production vs development environments clearly distinguished ✅ Maintainability: Easier to identify and manage development components RESULT: Successfully moved brother_node development artifact to dev/test-nodes/ subdirectory, cleaning up the root directory while preserving development testing environment for future use.
125 lines
4.2 KiB
JavaScript
Executable File
125 lines
4.2 KiB
JavaScript
Executable File
"use strict";
|
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
};
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.isAsync = exports.isValid = exports.isDirty = exports.isAborted = exports.OK = exports.DIRTY = exports.INVALID = exports.ParseStatus = exports.EMPTY_PATH = exports.makeIssue = void 0;
|
|
exports.addIssueToContext = addIssueToContext;
|
|
const errors_js_1 = require("../errors.cjs");
|
|
const en_js_1 = __importDefault(require("../locales/en.cjs"));
|
|
const makeIssue = (params) => {
|
|
const { data, path, errorMaps, issueData } = params;
|
|
const fullPath = [...path, ...(issueData.path || [])];
|
|
const fullIssue = {
|
|
...issueData,
|
|
path: fullPath,
|
|
};
|
|
if (issueData.message !== undefined) {
|
|
return {
|
|
...issueData,
|
|
path: fullPath,
|
|
message: issueData.message,
|
|
};
|
|
}
|
|
let errorMessage = "";
|
|
const maps = errorMaps
|
|
.filter((m) => !!m)
|
|
.slice()
|
|
.reverse();
|
|
for (const map of maps) {
|
|
errorMessage = map(fullIssue, { data, defaultError: errorMessage }).message;
|
|
}
|
|
return {
|
|
...issueData,
|
|
path: fullPath,
|
|
message: errorMessage,
|
|
};
|
|
};
|
|
exports.makeIssue = makeIssue;
|
|
exports.EMPTY_PATH = [];
|
|
function addIssueToContext(ctx, issueData) {
|
|
const overrideMap = (0, errors_js_1.getErrorMap)();
|
|
const issue = (0, exports.makeIssue)({
|
|
issueData: issueData,
|
|
data: ctx.data,
|
|
path: ctx.path,
|
|
errorMaps: [
|
|
ctx.common.contextualErrorMap, // contextual error map is first priority
|
|
ctx.schemaErrorMap, // then schema-bound map if available
|
|
overrideMap, // then global override map
|
|
overrideMap === en_js_1.default ? undefined : en_js_1.default, // then global default map
|
|
].filter((x) => !!x),
|
|
});
|
|
ctx.common.issues.push(issue);
|
|
}
|
|
class ParseStatus {
|
|
constructor() {
|
|
this.value = "valid";
|
|
}
|
|
dirty() {
|
|
if (this.value === "valid")
|
|
this.value = "dirty";
|
|
}
|
|
abort() {
|
|
if (this.value !== "aborted")
|
|
this.value = "aborted";
|
|
}
|
|
static mergeArray(status, results) {
|
|
const arrayValue = [];
|
|
for (const s of results) {
|
|
if (s.status === "aborted")
|
|
return exports.INVALID;
|
|
if (s.status === "dirty")
|
|
status.dirty();
|
|
arrayValue.push(s.value);
|
|
}
|
|
return { status: status.value, value: arrayValue };
|
|
}
|
|
static async mergeObjectAsync(status, pairs) {
|
|
const syncPairs = [];
|
|
for (const pair of pairs) {
|
|
const key = await pair.key;
|
|
const value = await pair.value;
|
|
syncPairs.push({
|
|
key,
|
|
value,
|
|
});
|
|
}
|
|
return ParseStatus.mergeObjectSync(status, syncPairs);
|
|
}
|
|
static mergeObjectSync(status, pairs) {
|
|
const finalObject = {};
|
|
for (const pair of pairs) {
|
|
const { key, value } = pair;
|
|
if (key.status === "aborted")
|
|
return exports.INVALID;
|
|
if (value.status === "aborted")
|
|
return exports.INVALID;
|
|
if (key.status === "dirty")
|
|
status.dirty();
|
|
if (value.status === "dirty")
|
|
status.dirty();
|
|
if (key.value !== "__proto__" && (typeof value.value !== "undefined" || pair.alwaysSet)) {
|
|
finalObject[key.value] = value.value;
|
|
}
|
|
}
|
|
return { status: status.value, value: finalObject };
|
|
}
|
|
}
|
|
exports.ParseStatus = ParseStatus;
|
|
exports.INVALID = Object.freeze({
|
|
status: "aborted",
|
|
});
|
|
const DIRTY = (value) => ({ status: "dirty", value });
|
|
exports.DIRTY = DIRTY;
|
|
const OK = (value) => ({ status: "valid", value });
|
|
exports.OK = OK;
|
|
const isAborted = (x) => x.status === "aborted";
|
|
exports.isAborted = isAborted;
|
|
const isDirty = (x) => x.status === "dirty";
|
|
exports.isDirty = isDirty;
|
|
const isValid = (x) => x.status === "valid";
|
|
exports.isValid = isValid;
|
|
const isAsync = (x) => typeof Promise !== "undefined" && x instanceof Promise;
|
|
exports.isAsync = isAsync;
|