From 4c2ce03351974f0188716f1f145e01b53b2369a4 Mon Sep 17 00:00:00 2001 From: reeshika-h Date: Tue, 28 Oct 2025 13:47:26 +0530 Subject: [PATCH] update error messages --- src/fs.ts | 3 ++- src/util/messages.ts | 24 ++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 src/util/messages.ts diff --git a/src/fs.ts b/src/fs.ts index 1ad1ad2..dfd5537 100644 --- a/src/fs.ts +++ b/src/fs.ts @@ -10,6 +10,7 @@ import { join, sep } from 'path' import { readFile, writeFile } from './util/fs' import { getFileFieldPaths } from './util/get-file-fields' import { buildLocalePath, filter, getPathKeys, removeUnwantedKeys } from './util/index' +import { LOG_MESSAGES } from './util/messages' import { validateContentTypeDeletedObject, validateEntryAssetDeletedObject, @@ -65,7 +66,7 @@ export class FilesystemStore { public publish(input) { return new Promise(async (resolve, reject) => { try { - debug(`Publishing ${JSON.stringify(input)}`) + debug(LOG_MESSAGES.PUBLISHING_ENTRY(input)) validatePublishedObject(input) if (existsSync(this.localePath)) { // if its a new locale, keep track! diff --git a/src/util/messages.ts b/src/util/messages.ts new file mode 100644 index 0000000..fb71e1b --- /dev/null +++ b/src/util/messages.ts @@ -0,0 +1,24 @@ +/*! + * DataSync Content Store Filesystem - Messages + * Copyright (c) Contentstack LLC + * MIT Licensed + */ + +/** + * Centralized message store for all log messages, error messages, and user-facing strings. + * This provides a single source of truth for all messages in the application, + * making it easier to maintain consistency and support future localization. + */ + +export const LOG_MESSAGES = { + PUBLISHING_ENTRY: (input: any) => `Publishing entry: ${JSON.stringify(input)}`, +} as const; + +export const ERROR_MESSAGES = { + // Add error messages here as needed +} as const; + +export const INFO_MESSAGES = { + // Add info messages here as needed +} as const; +