intlayer-editor
Version:
Integrate the Intlayer visual editor into your Intlayer projects, enabling CMS-like content management with multilingual support.
1 lines • 1.85 kB
Source Map (JSON)
{"version":3,"sources":["../../src/controllers/configuration.controller.ts"],"sourcesContent":["import {\n type IntlayerConfig,\n getConfiguration as getApplicationConfiguration,\n} from '@intlayer/config';\nimport { type ResponseData, formatResponse } from '@utils/responseData';\nimport type { NextFunction, Request, Response } from 'express';\n\nexport type GetConfigurationResult = ResponseData<IntlayerConfig>;\n\n/**\n * Get the Intlayer configuration\n */\nexport const getConfiguration = async (\n _req: Request,\n res: Response<GetConfigurationResult>,\n _next: NextFunction\n): Promise<void> => {\n try {\n const config = getApplicationConfiguration();\n\n const formattedResponse = formatResponse<IntlayerConfig>({\n data: config,\n });\n\n res.json(formattedResponse);\n return;\n } catch (err) {\n const errorMessage = (err as { message?: string; status?: number }) ?? {\n message: 'Internal Server Error',\n status: 500,\n };\n\n const formattedErrorResponse = formatResponse<IntlayerConfig>({\n error: {\n message: errorMessage.message ?? 'Internal Server Error',\n code: 'INTERNAL_SERVER_ERROR',\n title: 'Internal Server Error',\n },\n status: errorMessage.status ?? 500,\n });\n\n res.json(formattedErrorResponse);\n return;\n }\n};\n"],"mappings":"AAAA;AAAA,EAEE,oBAAoB;AAAA,OACf;AACP,SAA4B,sBAAsB;AAQ3C,MAAM,mBAAmB,OAC9B,MACA,KACA,UACkB;AAClB,MAAI;AACF,UAAM,SAAS,4BAA4B;AAE3C,UAAM,oBAAoB,eAA+B;AAAA,MACvD,MAAM;AAAA,IACR,CAAC;AAED,QAAI,KAAK,iBAAiB;AAC1B;AAAA,EACF,SAAS,KAAK;AACZ,UAAM,eAAgB,OAAiD;AAAA,MACrE,SAAS;AAAA,MACT,QAAQ;AAAA,IACV;AAEA,UAAM,yBAAyB,eAA+B;AAAA,MAC5D,OAAO;AAAA,QACL,SAAS,aAAa,WAAW;AAAA,QACjC,MAAM;AAAA,QACN,OAAO;AAAA,MACT;AAAA,MACA,QAAQ,aAAa,UAAU;AAAA,IACjC,CAAC;AAED,QAAI,KAAK,sBAAsB;AAC/B;AAAA,EACF;AACF;","names":[]}