@intlayer/backend 5.1.3 → 5.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/controllers/dictionary.controller.cjs +7 -11
- package/dist/cjs/controllers/dictionary.controller.cjs.map +1 -1
- package/dist/cjs/emails/InviteUserEmail.cjs +3 -3
- package/dist/cjs/emails/InviteUserEmail.cjs.map +1 -1
- package/dist/cjs/emails/PasswordChangeConfirmation.cjs +3 -3
- package/dist/cjs/emails/PasswordChangeConfirmation.cjs.map +1 -1
- package/dist/cjs/emails/ResetUserPassword.cjs +3 -3
- package/dist/cjs/emails/ResetUserPassword.cjs.map +1 -1
- package/dist/cjs/emails/SubscriptionPaymentCancellation.cjs +3 -3
- package/dist/cjs/emails/SubscriptionPaymentCancellation.cjs.map +1 -1
- package/dist/cjs/emails/SubscriptionPaymentError.cjs +3 -3
- package/dist/cjs/emails/SubscriptionPaymentError.cjs.map +1 -1
- package/dist/cjs/emails/SubscriptionPaymentSuccess.cjs +3 -3
- package/dist/cjs/emails/SubscriptionPaymentSuccess.cjs.map +1 -1
- package/dist/cjs/emails/ValidateUserEmail.cjs +3 -3
- package/dist/cjs/emails/ValidateUserEmail.cjs.map +1 -1
- package/dist/cjs/emails/Welcome.cjs +3 -3
- package/dist/cjs/emails/Welcome.cjs.map +1 -1
- package/dist/cjs/schemas/dictionary.schema.cjs +0 -4
- package/dist/cjs/schemas/dictionary.schema.cjs.map +1 -1
- package/dist/cjs/services/dictionary.service.cjs +6 -0
- package/dist/cjs/services/dictionary.service.cjs.map +1 -1
- package/dist/cjs/types/dictionary.types.cjs.map +1 -1
- package/dist/cjs/utils/auditDictionary/index.cjs +1 -1
- package/dist/cjs/utils/auditDictionary/index.cjs.map +1 -1
- package/dist/cjs/utils/auditDictionaryField/PROMPT.md +17 -7
- package/dist/cjs/utils/auditDictionaryField/index.cjs +1 -1
- package/dist/cjs/utils/auditDictionaryField/index.cjs.map +1 -1
- package/dist/cjs/utils/auditDictionaryMetadata/index.cjs +1 -1
- package/dist/cjs/utils/auditDictionaryMetadata/index.cjs.map +1 -1
- package/dist/cjs/utils/auditTag/index.cjs +1 -1
- package/dist/cjs/utils/auditTag/index.cjs.map +1 -1
- package/dist/esm/controllers/dictionary.controller.mjs +7 -11
- package/dist/esm/controllers/dictionary.controller.mjs.map +1 -1
- package/dist/esm/emails/InviteUserEmail.mjs +3 -3
- package/dist/esm/emails/InviteUserEmail.mjs.map +1 -1
- package/dist/esm/emails/PasswordChangeConfirmation.mjs +3 -3
- package/dist/esm/emails/PasswordChangeConfirmation.mjs.map +1 -1
- package/dist/esm/emails/ResetUserPassword.mjs +3 -3
- package/dist/esm/emails/ResetUserPassword.mjs.map +1 -1
- package/dist/esm/emails/SubscriptionPaymentCancellation.mjs +3 -3
- package/dist/esm/emails/SubscriptionPaymentCancellation.mjs.map +1 -1
- package/dist/esm/emails/SubscriptionPaymentError.mjs +3 -3
- package/dist/esm/emails/SubscriptionPaymentError.mjs.map +1 -1
- package/dist/esm/emails/SubscriptionPaymentSuccess.mjs +3 -3
- package/dist/esm/emails/SubscriptionPaymentSuccess.mjs.map +1 -1
- package/dist/esm/emails/ValidateUserEmail.mjs +3 -3
- package/dist/esm/emails/ValidateUserEmail.mjs.map +1 -1
- package/dist/esm/emails/Welcome.mjs +3 -3
- package/dist/esm/emails/Welcome.mjs.map +1 -1
- package/dist/esm/schemas/dictionary.schema.mjs +0 -4
- package/dist/esm/schemas/dictionary.schema.mjs.map +1 -1
- package/dist/esm/services/dictionary.service.mjs +6 -0
- package/dist/esm/services/dictionary.service.mjs.map +1 -1
- package/dist/esm/utils/auditDictionary/index.mjs +1 -1
- package/dist/esm/utils/auditDictionary/index.mjs.map +1 -1
- package/dist/esm/utils/auditDictionaryField/PROMPT.md +17 -7
- package/dist/esm/utils/auditDictionaryField/index.mjs +1 -1
- package/dist/esm/utils/auditDictionaryField/index.mjs.map +1 -1
- package/dist/esm/utils/auditDictionaryMetadata/index.mjs +1 -1
- package/dist/esm/utils/auditDictionaryMetadata/index.mjs.map +1 -1
- package/dist/esm/utils/auditTag/index.mjs +1 -1
- package/dist/esm/utils/auditTag/index.mjs.map +1 -1
- package/dist/types/controllers/dictionary.controller.d.ts.map +1 -1
- package/dist/types/schemas/dictionary.schema.d.ts.map +1 -1
- package/dist/types/services/dictionary.service.d.ts.map +1 -1
- package/dist/types/types/dictionary.types.d.ts +0 -1
- package/dist/types/types/dictionary.types.d.ts.map +1 -1
- package/package.json +9 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/utils/auditDictionaryField/index.ts"],"sourcesContent":["import { readFileSync } from 'fs';\nimport { dirname, join } from 'path';\nimport { fileURLToPath } from 'url';\nimport { getLocaleName, type KeyPath } from '@intlayer/core';\nimport { logger } from '@logger';\nimport type { Locales } from 'intlayer';\nimport { OpenAI } from 'openai';\nimport type { Tag } from '@/types/tag.types';\n\nconst __dirname = dirname(fileURLToPath(import.meta.url));\n\nexport type AuditDictionaryFieldOptions = {\n locales: Locales[];\n fileContent: string;\n model?: string;\n openAiApiKey: string;\n customPrompt?: string;\n keyPath: KeyPath[];\n tags?: Tag[];\n};\nexport type AuditDictionaryFieldResultData = {\n fileContent: string;\n tokenUsed: number;\n};\n\n/**\n * Reads the content of a file synchronously.\n *\n * @function\n * @param relativeFilePath - The relative or absolute path to the target file.\n * @returns The entire contents of the specified file as a UTF-8 encoded string.\n */\nconst getFileContent = (relativeFilePath: string): string => {\n const absolutePath = join(__dirname, relativeFilePath);\n const fileContent = readFileSync(absolutePath, 'utf-8');\n return fileContent;\n};\n\n// The prompt template to send to ChatGPT, requesting an audit of content declaration files.\nconst CHAT_GPT_PROMPT = getFileContent('./PROMPT.md');\n\n/**\n * Formats a locale with its full name and returns a string representation.\n *\n * @function\n * @param locale - A locale from the project's configuration (e.g., 'en-US', 'fr-FR').\n * @returns A formatted string combining the locale's name and code. Example: \"English (US): en-US\".\n */\nconst formatLocaleWithName = (locale: Locales): string => {\n // getLocaleName returns a human-readable name for the locale.\n const localeName = getLocaleName(locale);\n\n // Concatenate both the readable name and the locale code.\n return `${locale}: ${localeName}`;\n};\n\n/**\n * Formats an array of tags with their keys and instructions.\n *\n * @function\n * @param tags - An array of tags from the project's configuration.\n * @returns A string representation of the tags, with their keys and instructions.\n */\nconst formatTagInstructions = (tags: Tag[] = []) =>\n tags.map((tag) => `- ${tag.key}: ${tag.instructions}`).join('\\n\\n');\n\n/**\n * Audits a content declaration file by constructing a prompt for ChatGPT.\n * The prompt includes details about the project's locales, file paths of content declarations,\n * and requests for identifying issues or inconsistencies. It prints the prompt for each file,\n * and could be adapted to send requests to the ChatGPT model.\n */\nexport const auditDictionaryField = async ({\n fileContent,\n model,\n openAiApiKey,\n customPrompt,\n locales,\n keyPath,\n tags,\n}: AuditDictionaryFieldOptions): Promise<\n AuditDictionaryFieldResultData | undefined\n> => {\n try {\n // Optionally, you could initialize and configure the OpenAI client here, if you intend to make API calls.\n // Uncomment and configure the following lines if you have `openai` installed and want to call the API:\n\n const openai = new OpenAI({\n apiKey: openAiApiKey,\n });\n\n // Prepare the prompt for ChatGPT by replacing placeholders with actual values.\n const prompt =\n customPrompt ??\n CHAT_GPT_PROMPT.replace(\n '{{otherLocales}}',\n `{${locales.map(formatLocaleWithName).join(', ')}}`\n )\n .replace('{{keyPath}}', JSON.stringify(keyPath))\n .replace('{{fileContent}}', fileContent)\n .replace('{{tagsInstructions}}', formatTagInstructions(tags));\n\n // Example of how you might request a completion from ChatGPT:\n const chatCompletion = await openai.chat.completions.create({\n model: model ?? 'gpt-4o-
|
|
1
|
+
{"version":3,"sources":["../../../../src/utils/auditDictionaryField/index.ts"],"sourcesContent":["import { readFileSync } from 'fs';\nimport { dirname, join } from 'path';\nimport { fileURLToPath } from 'url';\nimport { getLocaleName, type KeyPath } from '@intlayer/core';\nimport { logger } from '@logger';\nimport type { Locales } from 'intlayer';\nimport { OpenAI } from 'openai';\nimport type { Tag } from '@/types/tag.types';\n\nconst __dirname = dirname(fileURLToPath(import.meta.url));\n\nexport type AuditDictionaryFieldOptions = {\n locales: Locales[];\n fileContent: string;\n model?: string;\n openAiApiKey: string;\n customPrompt?: string;\n keyPath: KeyPath[];\n tags?: Tag[];\n};\nexport type AuditDictionaryFieldResultData = {\n fileContent: string;\n tokenUsed: number;\n};\n\n/**\n * Reads the content of a file synchronously.\n *\n * @function\n * @param relativeFilePath - The relative or absolute path to the target file.\n * @returns The entire contents of the specified file as a UTF-8 encoded string.\n */\nconst getFileContent = (relativeFilePath: string): string => {\n const absolutePath = join(__dirname, relativeFilePath);\n const fileContent = readFileSync(absolutePath, 'utf-8');\n return fileContent;\n};\n\n// The prompt template to send to ChatGPT, requesting an audit of content declaration files.\nconst CHAT_GPT_PROMPT = getFileContent('./PROMPT.md');\n\n/**\n * Formats a locale with its full name and returns a string representation.\n *\n * @function\n * @param locale - A locale from the project's configuration (e.g., 'en-US', 'fr-FR').\n * @returns A formatted string combining the locale's name and code. Example: \"English (US): en-US\".\n */\nconst formatLocaleWithName = (locale: Locales): string => {\n // getLocaleName returns a human-readable name for the locale.\n const localeName = getLocaleName(locale);\n\n // Concatenate both the readable name and the locale code.\n return `${locale}: ${localeName}`;\n};\n\n/**\n * Formats an array of tags with their keys and instructions.\n *\n * @function\n * @param tags - An array of tags from the project's configuration.\n * @returns A string representation of the tags, with their keys and instructions.\n */\nconst formatTagInstructions = (tags: Tag[] = []) =>\n tags.map((tag) => `- ${tag.key}: ${tag.instructions}`).join('\\n\\n');\n\n/**\n * Audits a content declaration file by constructing a prompt for ChatGPT.\n * The prompt includes details about the project's locales, file paths of content declarations,\n * and requests for identifying issues or inconsistencies. It prints the prompt for each file,\n * and could be adapted to send requests to the ChatGPT model.\n */\nexport const auditDictionaryField = async ({\n fileContent,\n model,\n openAiApiKey,\n customPrompt,\n locales,\n keyPath,\n tags,\n}: AuditDictionaryFieldOptions): Promise<\n AuditDictionaryFieldResultData | undefined\n> => {\n try {\n // Optionally, you could initialize and configure the OpenAI client here, if you intend to make API calls.\n // Uncomment and configure the following lines if you have `openai` installed and want to call the API:\n\n const openai = new OpenAI({\n apiKey: openAiApiKey,\n });\n\n // Prepare the prompt for ChatGPT by replacing placeholders with actual values.\n const prompt =\n customPrompt ??\n CHAT_GPT_PROMPT.replace(\n '{{otherLocales}}',\n `{${locales.map(formatLocaleWithName).join(', ')}}`\n )\n .replace('{{keyPath}}', JSON.stringify(keyPath))\n .replace('{{fileContent}}', fileContent)\n .replace('{{tagsInstructions}}', formatTagInstructions(tags));\n\n // Example of how you might request a completion from ChatGPT:\n const chatCompletion = await openai.chat.completions.create({\n model: model ?? 'gpt-4o-2024-11-20',\n messages: [{ role: 'system', content: prompt }],\n });\n\n const newContent = chatCompletion.choices[0].message?.content;\n\n logger.info(\n `${chatCompletion.usage?.total_tokens} tokens used in the request`\n );\n\n return {\n fileContent: newContent ?? '',\n tokenUsed: chatCompletion.usage?.total_tokens ?? 0,\n };\n } catch (error) {\n console.error(error);\n }\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBAA6B;AAC7B,kBAA8B;AAC9B,iBAA8B;AAC9B,kBAA4C;AAC5C,oBAAuB;AAEvB,oBAAuB;AANvB;AASA,MAAM,gBAAY,yBAAQ,0BAAc,YAAY,GAAG,CAAC;AAuBxD,MAAM,iBAAiB,CAAC,qBAAqC;AAC3D,QAAM,mBAAe,kBAAK,WAAW,gBAAgB;AACrD,QAAM,kBAAc,wBAAa,cAAc,OAAO;AACtD,SAAO;AACT;AAGA,MAAM,kBAAkB,eAAe,aAAa;AASpD,MAAM,uBAAuB,CAAC,WAA4B;AAExD,QAAM,iBAAa,2BAAc,MAAM;AAGvC,SAAO,GAAG,MAAM,KAAK,UAAU;AACjC;AASA,MAAM,wBAAwB,CAAC,OAAc,CAAC,MAC5C,KAAK,IAAI,CAAC,QAAQ,KAAK,IAAI,GAAG,KAAK,IAAI,YAAY,EAAE,EAAE,KAAK,MAAM;AAQ7D,MAAM,uBAAuB,OAAO;AAAA,EACzC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAEK;AACH,MAAI;AAIF,UAAM,SAAS,IAAI,qBAAO;AAAA,MACxB,QAAQ;AAAA,IACV,CAAC;AAGD,UAAM,SACJ,gBACA,gBAAgB;AAAA,MACd;AAAA,MACA,IAAI,QAAQ,IAAI,oBAAoB,EAAE,KAAK,IAAI,CAAC;AAAA,IAClD,EACG,QAAQ,eAAe,KAAK,UAAU,OAAO,CAAC,EAC9C,QAAQ,mBAAmB,WAAW,EACtC,QAAQ,wBAAwB,sBAAsB,IAAI,CAAC;AAGhE,UAAM,iBAAiB,MAAM,OAAO,KAAK,YAAY,OAAO;AAAA,MAC1D,OAAO,SAAS;AAAA,MAChB,UAAU,CAAC,EAAE,MAAM,UAAU,SAAS,OAAO,CAAC;AAAA,IAChD,CAAC;AAED,UAAM,aAAa,eAAe,QAAQ,CAAC,EAAE,SAAS;AAEtD,yBAAO;AAAA,MACL,GAAG,eAAe,OAAO,YAAY;AAAA,IACvC;AAEA,WAAO;AAAA,MACL,aAAa,cAAc;AAAA,MAC3B,WAAW,eAAe,OAAO,gBAAgB;AAAA,IACnD;AAAA,EACF,SAAS,OAAO;AACd,YAAQ,MAAM,KAAK;AAAA,EACrB;AACF;","names":[]}
|
|
@@ -54,7 +54,7 @@ const auditDictionaryMetadata = async ({
|
|
|
54
54
|
)}`
|
|
55
55
|
).replace("{{contentDeclaration}}", fileContent);
|
|
56
56
|
const chatCompletion = await openai.chat.completions.create({
|
|
57
|
-
model: model ?? "gpt-4o-
|
|
57
|
+
model: model ?? "gpt-4o-2024-11-20",
|
|
58
58
|
messages: [{ role: "system", content: prompt }]
|
|
59
59
|
});
|
|
60
60
|
const newContent = chatCompletion.choices[0].message?.content;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/utils/auditDictionaryMetadata/index.ts"],"sourcesContent":["import { readFileSync } from 'fs';\nimport { dirname, join } from 'path';\nimport { fileURLToPath } from 'url';\nimport { logger } from '@logger';\nimport { OpenAI } from 'openai';\nimport type { Tag } from '@/types/tag.types';\n\nconst __dirname = dirname(fileURLToPath(import.meta.url));\n\nexport type AuditOptions = {\n tags: Tag[];\n fileContent: string;\n model?: string;\n openAiApiKey: string;\n customPrompt?: string;\n};\nexport type AuditFileResultData = { fileContent: string; tokenUsed: number };\n\n/**\n * Reads the content of a file synchronously.\n *\n * @function\n * @param relativeFilePath - The relative or absolute path to the target file.\n * @returns The entire contents of the specified file as a UTF-8 encoded string.\n */\nconst getFileContent = (relativeFilePath: string): string => {\n const absolutePath = join(__dirname, relativeFilePath);\n const fileContent = readFileSync(absolutePath, 'utf-8');\n return fileContent;\n};\n\n// The prompt template to send to ChatGPT, requesting an audit of content declaration files.\nconst CHAT_GPT_PROMPT = getFileContent('./PROMPT.md');\n\n/**\n * Audits a content declaration file by constructing a prompt for ChatGPT.\n * The prompt includes details about the project's locales, file paths of content declarations,\n * and requests for identifying issues or inconsistencies. It prints the prompt for each file,\n * and could be adapted to send requests to the ChatGPT model.\n *\n */\nexport const auditDictionaryMetadata = async ({\n model,\n openAiApiKey,\n customPrompt,\n tags,\n fileContent,\n}: AuditOptions): Promise<AuditFileResultData | undefined> => {\n try {\n // Optionally, you could initialize and configure the OpenAI client here, if you intend to make API calls.\n // Uncomment and configure the following lines if you have `openai` installed and want to call the API:\n\n const openai = new OpenAI({\n apiKey: openAiApiKey,\n });\n\n // Prepare the prompt for ChatGPT by replacing placeholders with actual values.\n const prompt =\n customPrompt ??\n CHAT_GPT_PROMPT.replace(\n '{{tags}}',\n `${JSON.stringify(\n tags\n .map(({ key, description }) => `- ${key}: ${description}`)\n .join('\\n\\n'),\n null,\n 2\n )}`\n ).replace('{{contentDeclaration}}', fileContent);\n\n // Example of how you might request a completion from ChatGPT:\n const chatCompletion = await openai.chat.completions.create({\n model: model ?? 'gpt-4o-
|
|
1
|
+
{"version":3,"sources":["../../../../src/utils/auditDictionaryMetadata/index.ts"],"sourcesContent":["import { readFileSync } from 'fs';\nimport { dirname, join } from 'path';\nimport { fileURLToPath } from 'url';\nimport { logger } from '@logger';\nimport { OpenAI } from 'openai';\nimport type { Tag } from '@/types/tag.types';\n\nconst __dirname = dirname(fileURLToPath(import.meta.url));\n\nexport type AuditOptions = {\n tags: Tag[];\n fileContent: string;\n model?: string;\n openAiApiKey: string;\n customPrompt?: string;\n};\nexport type AuditFileResultData = { fileContent: string; tokenUsed: number };\n\n/**\n * Reads the content of a file synchronously.\n *\n * @function\n * @param relativeFilePath - The relative or absolute path to the target file.\n * @returns The entire contents of the specified file as a UTF-8 encoded string.\n */\nconst getFileContent = (relativeFilePath: string): string => {\n const absolutePath = join(__dirname, relativeFilePath);\n const fileContent = readFileSync(absolutePath, 'utf-8');\n return fileContent;\n};\n\n// The prompt template to send to ChatGPT, requesting an audit of content declaration files.\nconst CHAT_GPT_PROMPT = getFileContent('./PROMPT.md');\n\n/**\n * Audits a content declaration file by constructing a prompt for ChatGPT.\n * The prompt includes details about the project's locales, file paths of content declarations,\n * and requests for identifying issues or inconsistencies. It prints the prompt for each file,\n * and could be adapted to send requests to the ChatGPT model.\n *\n */\nexport const auditDictionaryMetadata = async ({\n model,\n openAiApiKey,\n customPrompt,\n tags,\n fileContent,\n}: AuditOptions): Promise<AuditFileResultData | undefined> => {\n try {\n // Optionally, you could initialize and configure the OpenAI client here, if you intend to make API calls.\n // Uncomment and configure the following lines if you have `openai` installed and want to call the API:\n\n const openai = new OpenAI({\n apiKey: openAiApiKey,\n });\n\n // Prepare the prompt for ChatGPT by replacing placeholders with actual values.\n const prompt =\n customPrompt ??\n CHAT_GPT_PROMPT.replace(\n '{{tags}}',\n `${JSON.stringify(\n tags\n .map(({ key, description }) => `- ${key}: ${description}`)\n .join('\\n\\n'),\n null,\n 2\n )}`\n ).replace('{{contentDeclaration}}', fileContent);\n\n // Example of how you might request a completion from ChatGPT:\n const chatCompletion = await openai.chat.completions.create({\n model: model ?? 'gpt-4o-2024-11-20',\n messages: [{ role: 'system', content: prompt }],\n });\n\n const newContent = chatCompletion.choices[0].message?.content;\n\n logger.info(\n `${chatCompletion.usage?.total_tokens} tokens used in the request`\n );\n\n return {\n fileContent: newContent ?? '',\n tokenUsed: chatCompletion.usage?.total_tokens ?? 0,\n };\n } catch (error) {\n console.error(error);\n }\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBAA6B;AAC7B,kBAA8B;AAC9B,iBAA8B;AAC9B,oBAAuB;AACvB,oBAAuB;AAJvB;AAOA,MAAM,gBAAY,yBAAQ,0BAAc,YAAY,GAAG,CAAC;AAkBxD,MAAM,iBAAiB,CAAC,qBAAqC;AAC3D,QAAM,mBAAe,kBAAK,WAAW,gBAAgB;AACrD,QAAM,kBAAc,wBAAa,cAAc,OAAO;AACtD,SAAO;AACT;AAGA,MAAM,kBAAkB,eAAe,aAAa;AAS7C,MAAM,0BAA0B,OAAO;AAAA,EAC5C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAA8D;AAC5D,MAAI;AAIF,UAAM,SAAS,IAAI,qBAAO;AAAA,MACxB,QAAQ;AAAA,IACV,CAAC;AAGD,UAAM,SACJ,gBACA,gBAAgB;AAAA,MACd;AAAA,MACA,GAAG,KAAK;AAAA,QACN,KACG,IAAI,CAAC,EAAE,KAAK,YAAY,MAAM,KAAK,GAAG,KAAK,WAAW,EAAE,EACxD,KAAK,MAAM;AAAA,QACd;AAAA,QACA;AAAA,MACF,CAAC;AAAA,IACH,EAAE,QAAQ,0BAA0B,WAAW;AAGjD,UAAM,iBAAiB,MAAM,OAAO,KAAK,YAAY,OAAO;AAAA,MAC1D,OAAO,SAAS;AAAA,MAChB,UAAU,CAAC,EAAE,MAAM,UAAU,SAAS,OAAO,CAAC;AAAA,IAChD,CAAC;AAED,UAAM,aAAa,eAAe,QAAQ,CAAC,EAAE,SAAS;AAEtD,yBAAO;AAAA,MACL,GAAG,eAAe,OAAO,YAAY;AAAA,IACvC;AAEA,WAAO;AAAA,MACL,aAAa,cAAc;AAAA,MAC3B,WAAW,eAAe,OAAO,gBAAgB;AAAA,IACnD;AAAA,EACF,SAAS,OAAO;AACd,YAAQ,MAAM,KAAK;AAAA,EACrB;AACF;","names":[]}
|
|
@@ -50,7 +50,7 @@ const auditTag = async ({
|
|
|
50
50
|
dictionaries.map((dictionary) => `- ${JSON.stringify(dictionary)}`).join("\n\n")
|
|
51
51
|
);
|
|
52
52
|
const chatCompletion = await openai.chat.completions.create({
|
|
53
|
-
model: model ?? "gpt-4o-
|
|
53
|
+
model: model ?? "gpt-4o-2024-11-20",
|
|
54
54
|
messages: [{ role: "system", content: prompt }]
|
|
55
55
|
});
|
|
56
56
|
const newContent = chatCompletion.choices[0].message?.content;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/utils/auditTag/index.ts"],"sourcesContent":["import { readFileSync } from 'fs';\nimport { dirname, join } from 'path';\nimport { fileURLToPath } from 'url';\nimport { logger } from '@logger';\nimport { OpenAI } from 'openai';\nimport type { Dictionary } from '@/types/dictionary.types';\nimport type { Tag } from '@/types/tag.types';\n\nconst __dirname = dirname(fileURLToPath(import.meta.url));\n\nexport type AuditOptions = {\n tag: Tag;\n dictionaries: Dictionary[];\n model?: string;\n openAiApiKey: string;\n customPrompt?: string;\n};\nexport type AuditFileResultData = { fileContent: string; tokenUsed: number };\n\n/**\n * Reads the content of a file synchronously.\n *\n * @function\n * @param relativeFilePath - The relative or absolute path to the target file.\n * @returns The entire contents of the specified file as a UTF-8 encoded string.\n */\nconst getFileContent = (relativeFilePath: string): string => {\n const absolutePath = join(__dirname, relativeFilePath);\n const fileContent = readFileSync(absolutePath, 'utf-8');\n return fileContent;\n};\n\n// The prompt template to send to ChatGPT, requesting an audit of content declaration files.\nconst CHAT_GPT_PROMPT = getFileContent('./PROMPT.md');\n\n/**\n * Audits a content declaration file by constructing a prompt for ChatGPT.\n * The prompt includes details about the project's locales, file paths of content declarations,\n * and requests for identifying issues or inconsistencies. It prints the prompt for each file,\n * and could be adapted to send requests to the ChatGPT model.\n *\n * @async\n * @function\n * @param filePath - The relative or absolute path to the target file.\n * @param options - Optional configuration for the audit process.\n * @returns This function returns a Promise that resolves once the audit is complete.\n */\nexport const auditTag = async ({\n model,\n openAiApiKey,\n customPrompt,\n tag,\n dictionaries,\n}: AuditOptions): Promise<AuditFileResultData | undefined> => {\n try {\n // Optionally, you could initialize and configure the OpenAI client here, if you intend to make API calls.\n // Uncomment and configure the following lines if you have `openai` installed and want to call the API:\n\n const openai = new OpenAI({\n apiKey: openAiApiKey,\n });\n\n // Prepare the prompt for ChatGPT by replacing placeholders with actual values.\n const prompt =\n customPrompt ??\n CHAT_GPT_PROMPT.replace('{{tag}}', `${JSON.stringify(tag)}`).replace(\n '{{contentDeclarations}}',\n dictionaries\n .map((dictionary) => `- ${JSON.stringify(dictionary)}`)\n .join('\\n\\n')\n );\n\n // Example of how you might request a completion from ChatGPT:\n const chatCompletion = await openai.chat.completions.create({\n model: model ?? 'gpt-4o-
|
|
1
|
+
{"version":3,"sources":["../../../../src/utils/auditTag/index.ts"],"sourcesContent":["import { readFileSync } from 'fs';\nimport { dirname, join } from 'path';\nimport { fileURLToPath } from 'url';\nimport { logger } from '@logger';\nimport { OpenAI } from 'openai';\nimport type { Dictionary } from '@/types/dictionary.types';\nimport type { Tag } from '@/types/tag.types';\n\nconst __dirname = dirname(fileURLToPath(import.meta.url));\n\nexport type AuditOptions = {\n tag: Tag;\n dictionaries: Dictionary[];\n model?: string;\n openAiApiKey: string;\n customPrompt?: string;\n};\nexport type AuditFileResultData = { fileContent: string; tokenUsed: number };\n\n/**\n * Reads the content of a file synchronously.\n *\n * @function\n * @param relativeFilePath - The relative or absolute path to the target file.\n * @returns The entire contents of the specified file as a UTF-8 encoded string.\n */\nconst getFileContent = (relativeFilePath: string): string => {\n const absolutePath = join(__dirname, relativeFilePath);\n const fileContent = readFileSync(absolutePath, 'utf-8');\n return fileContent;\n};\n\n// The prompt template to send to ChatGPT, requesting an audit of content declaration files.\nconst CHAT_GPT_PROMPT = getFileContent('./PROMPT.md');\n\n/**\n * Audits a content declaration file by constructing a prompt for ChatGPT.\n * The prompt includes details about the project's locales, file paths of content declarations,\n * and requests for identifying issues or inconsistencies. It prints the prompt for each file,\n * and could be adapted to send requests to the ChatGPT model.\n *\n * @async\n * @function\n * @param filePath - The relative or absolute path to the target file.\n * @param options - Optional configuration for the audit process.\n * @returns This function returns a Promise that resolves once the audit is complete.\n */\nexport const auditTag = async ({\n model,\n openAiApiKey,\n customPrompt,\n tag,\n dictionaries,\n}: AuditOptions): Promise<AuditFileResultData | undefined> => {\n try {\n // Optionally, you could initialize and configure the OpenAI client here, if you intend to make API calls.\n // Uncomment and configure the following lines if you have `openai` installed and want to call the API:\n\n const openai = new OpenAI({\n apiKey: openAiApiKey,\n });\n\n // Prepare the prompt for ChatGPT by replacing placeholders with actual values.\n const prompt =\n customPrompt ??\n CHAT_GPT_PROMPT.replace('{{tag}}', `${JSON.stringify(tag)}`).replace(\n '{{contentDeclarations}}',\n dictionaries\n .map((dictionary) => `- ${JSON.stringify(dictionary)}`)\n .join('\\n\\n')\n );\n\n // Example of how you might request a completion from ChatGPT:\n const chatCompletion = await openai.chat.completions.create({\n model: model ?? 'gpt-4o-2024-11-20',\n messages: [{ role: 'system', content: prompt }],\n });\n\n const newContent = chatCompletion.choices[0].message?.content;\n\n logger.info(\n `${chatCompletion.usage?.total_tokens} tokens used in the request`\n );\n\n return {\n fileContent: newContent ?? '',\n tokenUsed: chatCompletion.usage?.total_tokens ?? 0,\n };\n } catch (error) {\n console.error(error);\n }\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBAA6B;AAC7B,kBAA8B;AAC9B,iBAA8B;AAC9B,oBAAuB;AACvB,oBAAuB;AAJvB;AAQA,MAAM,gBAAY,yBAAQ,0BAAc,YAAY,GAAG,CAAC;AAkBxD,MAAM,iBAAiB,CAAC,qBAAqC;AAC3D,QAAM,mBAAe,kBAAK,WAAW,gBAAgB;AACrD,QAAM,kBAAc,wBAAa,cAAc,OAAO;AACtD,SAAO;AACT;AAGA,MAAM,kBAAkB,eAAe,aAAa;AAc7C,MAAM,WAAW,OAAO;AAAA,EAC7B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAA8D;AAC5D,MAAI;AAIF,UAAM,SAAS,IAAI,qBAAO;AAAA,MACxB,QAAQ;AAAA,IACV,CAAC;AAGD,UAAM,SACJ,gBACA,gBAAgB,QAAQ,WAAW,GAAG,KAAK,UAAU,GAAG,CAAC,EAAE,EAAE;AAAA,MAC3D;AAAA,MACA,aACG,IAAI,CAAC,eAAe,KAAK,KAAK,UAAU,UAAU,CAAC,EAAE,EACrD,KAAK,MAAM;AAAA,IAChB;AAGF,UAAM,iBAAiB,MAAM,OAAO,KAAK,YAAY,OAAO;AAAA,MAC1D,OAAO,SAAS;AAAA,MAChB,UAAU,CAAC,EAAE,MAAM,UAAU,SAAS,OAAO,CAAC;AAAA,IAChD,CAAC;AAED,UAAM,aAAa,eAAe,QAAQ,CAAC,EAAE,SAAS;AAEtD,yBAAO;AAAA,MACL,GAAG,eAAe,OAAO,YAAY;AAAA,IACvC;AAEA,WAAO;AAAA,MACL,aAAa,cAAc;AAAA,MAC3B,WAAW,eAAe,OAAO,gBAAgB;AAAA,IACnD;AAAA,EACF,SAAS,OAAO;AACd,YAAQ,MAAM,KAAK;AAAA,EACrB;AACF;","names":[]}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { logger } from "./../logger/index.mjs";
|
|
2
2
|
import * as dictionaryService from "./../services/dictionary.service.mjs";
|
|
3
|
+
import { ensureMongoDocumentToObject } from "./../utils/ensureMongoDocumentToObject.mjs";
|
|
3
4
|
import { ErrorHandler } from "./../utils/errors/index.mjs";
|
|
4
5
|
import {
|
|
5
6
|
getDictionaryFiltersAndPagination
|
|
@@ -34,7 +35,7 @@ const getDictionaries = async (req, res, _next) => {
|
|
|
34
35
|
);
|
|
35
36
|
const totalItems = await dictionaryService.countDictionaries(filters);
|
|
36
37
|
const dictionariesAPI = dictionaries.map(
|
|
37
|
-
(el) => mapDictionaryToAPI(el, project._id
|
|
38
|
+
(el) => mapDictionaryToAPI(el, project._id)
|
|
38
39
|
);
|
|
39
40
|
const responseData = formatPaginatedResponse({
|
|
40
41
|
data: dictionariesAPI,
|
|
@@ -220,7 +221,6 @@ const pushDictionaries = async (req, res, _next) => {
|
|
|
220
221
|
const updatedDictionariesResult = [];
|
|
221
222
|
const errorResult = [];
|
|
222
223
|
for (const dictionaryDataEl of newDictionaries) {
|
|
223
|
-
const publishedVersion = dictionaryDataEl.version ? dictionaryDataEl.version === "-1" ? null : dictionaryDataEl.version : null;
|
|
224
224
|
const dictionary = {
|
|
225
225
|
title: dictionaryDataEl.title,
|
|
226
226
|
description: dictionaryDataEl.description,
|
|
@@ -232,8 +232,7 @@ const pushDictionaries = async (req, res, _next) => {
|
|
|
232
232
|
filePath: {
|
|
233
233
|
[String(project._id)]: dictionaryDataEl.filePath ?? ""
|
|
234
234
|
},
|
|
235
|
-
key: dictionaryDataEl.key
|
|
236
|
-
publishedVersion
|
|
235
|
+
key: dictionaryDataEl.key
|
|
237
236
|
};
|
|
238
237
|
try {
|
|
239
238
|
const newDictionary = await dictionaryService.createDictionary(dictionary);
|
|
@@ -254,10 +253,9 @@ const pushDictionaries = async (req, res, _next) => {
|
|
|
254
253
|
const existingDictionaryDB = existingDictionariesDB.find(
|
|
255
254
|
(dictionaryDB) => dictionaryDB.key === dictionaryDataEl.key
|
|
256
255
|
);
|
|
257
|
-
const
|
|
258
|
-
|
|
259
|
-
);
|
|
260
|
-
const lastContent = existingContentArray[existingContentArray.length - 1].content;
|
|
256
|
+
const versionList = [...existingDictionaryDB.content.keys() ?? []];
|
|
257
|
+
const lastVersion = versionList[versionList.length - 1];
|
|
258
|
+
const lastContent = existingDictionaryDB.content.get(lastVersion)?.content ?? null;
|
|
261
259
|
const isSameContent = JSON.stringify(lastContent) === JSON.stringify(dictionaryDataEl.content);
|
|
262
260
|
let newContent = existingDictionaryDB.content;
|
|
263
261
|
if (!isSameContent) {
|
|
@@ -269,9 +267,8 @@ const pushDictionaries = async (req, res, _next) => {
|
|
|
269
267
|
}
|
|
270
268
|
};
|
|
271
269
|
}
|
|
272
|
-
const publishedVersion = dictionaryDataEl.version ? dictionaryDataEl.version === "-1" ? null : dictionaryDataEl.version : null;
|
|
273
270
|
const dictionary = {
|
|
274
|
-
...existingDictionaryDB,
|
|
271
|
+
...ensureMongoDocumentToObject(existingDictionaryDB),
|
|
275
272
|
...dictionaryDataEl,
|
|
276
273
|
content: newContent,
|
|
277
274
|
projectIds: [String(project._id)],
|
|
@@ -279,7 +276,6 @@ const pushDictionaries = async (req, res, _next) => {
|
|
|
279
276
|
filePath: {
|
|
280
277
|
[String(project._id)]: dictionaryDataEl.filePath ?? ""
|
|
281
278
|
},
|
|
282
|
-
publishedVersion,
|
|
283
279
|
key: dictionaryDataEl.key
|
|
284
280
|
};
|
|
285
281
|
try {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/controllers/dictionary.controller.ts"],"sourcesContent":["import type {\n ContentNode,\n Dictionary as LocalDictionary,\n} from '@intlayer/core';\nimport { logger } from '@logger';\nimport type { ResponseWithInformation } from '@middlewares/sessionAuth.middleware';\nimport * as dictionaryService from '@services/dictionary.service';\nimport { type AppError, ErrorHandler } from '@utils/errors';\nimport {\n type DictionaryFiltersParams,\n getDictionaryFiltersAndPagination,\n} from '@utils/filtersAndPagination/getDictionaryFiltersAndPagination';\nimport type { FiltersAndPagination } from '@utils/filtersAndPagination/getFiltersAndPaginationFromBody';\nimport { mapDictionaryToAPI } from '@utils/mapper/dictionary';\nimport {\n formatPaginatedResponse,\n type ResponseData,\n type PaginatedResponse,\n formatResponse,\n} from '@utils/responseData';\nimport type { NextFunction, Request } from 'express';\nimport { t } from 'express-intlayer';\nimport * as eventListener from '@/controllers/event-listener';\nimport type {\n Dictionary,\n DictionaryAPI,\n DictionaryCreationData,\n DictionaryData,\n VersionedContent,\n} from '@/types/dictionary.types';\n\nexport type GetDictionariesParams =\n FiltersAndPagination<DictionaryFiltersParams>;\nexport type GetDictionariesResult = PaginatedResponse<DictionaryAPI>;\n\n/**\n * Retrieves a list of dictionaries based on filters and pagination.\n */\nexport const getDictionaries = async (\n req: Request<GetDictionariesParams>,\n res: ResponseWithInformation<GetDictionariesResult>,\n _next: NextFunction\n): Promise<void> => {\n const { user, project, dictionaryRights } = res.locals;\n const { filters, pageSize, skip, page, getNumberOfPages } =\n getDictionaryFiltersAndPagination(req);\n\n if (!project) {\n ErrorHandler.handleGenericErrorResponse(res, 'PROJECT_NOT_DEFINED');\n return;\n }\n if (!user) {\n ErrorHandler.handleGenericErrorResponse(res, 'USER_NOT_DEFINED');\n return;\n }\n if (!dictionaryRights?.read) {\n ErrorHandler.handleGenericErrorResponse(res, 'DICTIONARY_RIGHTS_NOT_READ');\n return;\n }\n\n try {\n const dictionaries = await dictionaryService.findDictionaries(\n filters,\n skip,\n pageSize\n );\n const totalItems = await dictionaryService.countDictionaries(filters);\n\n const dictionariesAPI = dictionaries.map((el) =>\n mapDictionaryToAPI(el, project._id, el.publishedVersion ?? undefined)\n );\n\n const responseData = formatPaginatedResponse<DictionaryAPI>({\n data: dictionariesAPI,\n page,\n pageSize,\n totalPages: getNumberOfPages(totalItems),\n totalItems,\n });\n\n res.json(responseData);\n return;\n } catch (error) {\n ErrorHandler.handleAppErrorResponse(res, error as AppError);\n return;\n }\n};\n\nexport type GetDictionariesKeysResult = ResponseData<string[]>;\n\n/**\n * Retrieves a list of dictionaries keys based on filters and pagination.\n */\nexport const getDictionariesKeys = async (\n _req: Request,\n res: ResponseWithInformation<GetDictionariesKeysResult>,\n _next: NextFunction\n) => {\n const { project, dictionaryRights } = res.locals;\n\n if (!project) {\n ErrorHandler.handleGenericErrorResponse(res, 'PROJECT_NOT_DEFINED');\n return;\n }\n if (!dictionaryRights?.read) {\n ErrorHandler.handleGenericErrorResponse(res, 'DICTIONARY_RIGHTS_NOT_READ');\n return;\n }\n\n try {\n const dictionariesKeys = await dictionaryService.getDictionariesKeys(\n project._id\n );\n\n const responseData = formatResponse<string[]>({\n data: dictionariesKeys,\n });\n\n res.json(responseData);\n return;\n } catch (error) {\n ErrorHandler.handleAppErrorResponse(res, error as AppError);\n return;\n }\n};\n\nexport type GetDictionaryParams = { dictionaryKey: string };\nexport type GetDictionaryQuery = { version?: string };\nexport type GetDictionaryResult = ResponseData<DictionaryAPI>;\n\n/**\n * Retrieves a list of dictionaries based on filters and pagination.\n */\nexport const getDictionaryByKey = async (\n req: Request<GetDictionaryParams, any, any, GetDictionaryQuery>,\n res: ResponseWithInformation<GetDictionaryResult>,\n _next: NextFunction\n): Promise<void> => {\n const { project, user, dictionaryRights } = res.locals;\n const { dictionaryKey } = req.params;\n const version = req.query.version;\n\n if (!project) {\n ErrorHandler.handleGenericErrorResponse(res, 'PROJECT_NOT_DEFINED');\n return;\n }\n if (!user) {\n ErrorHandler.handleGenericErrorResponse(res, 'USER_NOT_DEFINED');\n return;\n }\n if (!dictionaryRights?.read) {\n ErrorHandler.handleGenericErrorResponse(res, 'DICTIONARY_RIGHTS_NOT_READ');\n return;\n }\n\n try {\n const dictionary = await dictionaryService.getDictionaryByKey(\n dictionaryKey,\n project._id\n );\n\n if (!dictionary.projectIds.map(String).includes(String(project._id))) {\n ErrorHandler.handleGenericErrorResponse(\n res,\n 'DICTIONARY_PROJECT_MISMATCH'\n );\n return;\n }\n\n const apiResult = mapDictionaryToAPI(dictionary, project._id, version);\n\n const responseData = formatResponse<DictionaryAPI>({\n data: apiResult,\n });\n\n res.json(responseData);\n return;\n } catch (error) {\n ErrorHandler.handleAppErrorResponse(res, error as AppError);\n return;\n }\n};\n\nexport type AddDictionaryBody = { dictionary: DictionaryCreationData };\nexport type AddDictionaryResult = ResponseData<DictionaryAPI>;\n\n/**\n * Adds a new dictionary to the database.\n */\nexport const addDictionary = async (\n req: Request<any, any, AddDictionaryBody>,\n res: ResponseWithInformation<AddDictionaryResult>,\n _next: NextFunction\n): Promise<void> => {\n const { project, user, dictionaryRights } = res.locals;\n const dictionaryData = req.body.dictionary;\n\n if (!dictionaryData) {\n ErrorHandler.handleGenericErrorResponse(res, 'DICTIONARY_DATA_NOT_FOUND');\n return;\n }\n\n if (!project) {\n ErrorHandler.handleGenericErrorResponse(res, 'PROJECT_NOT_DEFINED');\n return;\n }\n\n if (!user) {\n ErrorHandler.handleGenericErrorResponse(res, 'USER_NOT_DEFINED');\n return;\n }\n\n if (!dictionaryData.projectIds.includes(String(project._id))) {\n ErrorHandler.handleGenericErrorResponse(res, 'DICTIONARY_PROJECT_MISMATCH');\n return;\n }\n\n if (!dictionaryRights?.admin) {\n ErrorHandler.handleGenericErrorResponse(res, 'DICTIONARY_RIGHTS_NOT_ADMIN');\n return;\n }\n\n const dictionary: DictionaryData = {\n key: dictionaryData.key,\n title: dictionaryData.title,\n description: dictionaryData.description,\n content: new Map([\n ['v1', { content: dictionaryData.content ?? ({} as ContentNode) }],\n ]),\n creatorId: user._id,\n filePath: {\n [String(project._id)]: dictionaryData.filePath ?? '',\n },\n projectIds: dictionaryData.projectIds ?? [String(project._id)],\n };\n\n try {\n const newDictionary = await dictionaryService.createDictionary(dictionary);\n\n const apiResult = mapDictionaryToAPI(newDictionary, project._id);\n\n const responseData = formatResponse<DictionaryAPI>({\n message: t({\n en: 'Dictionary created successfully',\n fr: 'Dictionnaire créé avec succès',\n es: 'Diccionario creado con éxito',\n }),\n description: t({\n en: 'Your dictionary has been created successfully',\n fr: 'Votre dictionnaire a été créé avec succès',\n es: 'Su diccionario ha sido creado con éxito',\n }),\n data: apiResult,\n });\n\n res.json(responseData);\n\n eventListener.sendDictionaryUpdate([\n {\n dictionary: mapDictionaryToAPI(newDictionary, project._id),\n status: 'ADDED',\n },\n ]);\n return;\n } catch (error) {\n ErrorHandler.handleAppErrorResponse(res, error as AppError);\n return;\n }\n};\n\nexport type PushDictionariesBody = {\n dictionaries: LocalDictionary[];\n};\ntype PushDictionariesResultData = {\n newDictionaries: string[];\n updatedDictionaries: string[];\n error: { dictionaryId: string; message: string }[];\n};\nexport type PushDictionariesResult = ResponseData<PushDictionariesResultData>;\n\n/**\n * Check each dictionaries, add the new ones and update the existing ones.\n * @param req - Express request object.\n * @param res - Express response object.\n * @returns Response containing the created dictionary.\n */\nexport const pushDictionaries = async (\n req: Request<any, any, PushDictionariesBody>,\n res: ResponseWithInformation<PushDictionariesResult>,\n _next: NextFunction\n): Promise<void> => {\n const { project, user, dictionaryRights } = res.locals;\n const dictionaryData = req.body.dictionaries;\n const dictionariesKeys = dictionaryData.map((dictionary) => dictionary.key);\n\n if (\n typeof dictionaryData === 'object' &&\n Array.isArray(dictionaryData) &&\n dictionaryData.length === 0\n ) {\n ErrorHandler.handleGenericErrorResponse(res, 'DICTIONARIES_NOT_PROVIDED');\n return;\n } else if (!dictionaryData) {\n ErrorHandler.handleGenericErrorResponse(res, 'DICTIONARY_DATA_NOT_FOUND');\n return;\n }\n\n if (!project) {\n ErrorHandler.handleGenericErrorResponse(res, 'PROJECT_NOT_DEFINED');\n return;\n }\n\n if (!user) {\n ErrorHandler.handleGenericErrorResponse(res, 'USER_NOT_DEFINED');\n return;\n }\n\n if (!dictionaryRights?.write) {\n ErrorHandler.handleGenericErrorResponse(res, 'DICTIONARY_RIGHTS_NOT_WRITE');\n return;\n }\n\n if (!dictionaryRights?.admin) {\n ErrorHandler.handleGenericErrorResponse(res, 'DICTIONARY_RIGHTS_NOT_ADMIN');\n return;\n }\n\n try {\n const { existingDictionariesKey, newDictionariesKey } =\n await dictionaryService.getExistingDictionaryKey(\n dictionariesKeys,\n project._id\n );\n\n const existingDictionaries = dictionaryData.filter((dictionary) =>\n existingDictionariesKey.includes(dictionary.key)\n );\n const newDictionaries = dictionaryData.filter((dictionary) =>\n newDictionariesKey.includes(dictionary.key)\n );\n\n const newDictionariesResult: DictionaryAPI[] = [];\n const updatedDictionariesResult: DictionaryAPI[] = [];\n const errorResult: PushDictionariesResultData['error'] = [];\n\n for (const dictionaryDataEl of newDictionaries) {\n const publishedVersion = dictionaryDataEl.version\n ? dictionaryDataEl.version === '-1'\n ? null\n : dictionaryDataEl.version\n : null;\n\n const dictionary: DictionaryData = {\n title: dictionaryDataEl.title,\n description: dictionaryDataEl.description,\n projectIds: [String(project._id)],\n creatorId: user._id,\n content: new Map([\n ['v1', { content: dictionaryDataEl.content ?? ({} as ContentNode) }],\n ]),\n filePath: {\n [String(project._id)]: dictionaryDataEl.filePath ?? '',\n },\n key: dictionaryDataEl.key,\n publishedVersion,\n };\n\n try {\n const newDictionary =\n await dictionaryService.createDictionary(dictionary);\n newDictionariesResult.push(\n mapDictionaryToAPI(newDictionary, project._id)\n );\n } catch (error) {\n ErrorHandler.handleAppErrorResponse(res, error as AppError);\n return;\n }\n }\n\n if (existingDictionariesKey.length >= 0) {\n const existingDictionariesDB =\n await dictionaryService.getDictionariesByKeys(\n existingDictionariesKey,\n project._id\n );\n\n for (const dictionaryDataEl of existingDictionaries) {\n const existingDictionaryDB = existingDictionariesDB.find(\n (dictionaryDB) => dictionaryDB.key === dictionaryDataEl.key\n )!;\n\n const existingContentArray = Object.values(\n existingDictionaryDB.content\n );\n\n const lastContent =\n existingContentArray[existingContentArray.length - 1].content;\n\n const isSameContent =\n JSON.stringify(lastContent) ===\n JSON.stringify(dictionaryDataEl.content);\n\n let newContent: VersionedContent = existingDictionaryDB.content;\n\n if (!isSameContent) {\n const newContentVersion =\n dictionaryService.incrementVersion(existingDictionaryDB);\n\n newContent = {\n ...newContent,\n [newContentVersion]: {\n content: dictionaryDataEl.content,\n },\n };\n }\n\n const publishedVersion = dictionaryDataEl.version\n ? dictionaryDataEl.version === '-1'\n ? null\n : dictionaryDataEl.version\n : null;\n\n const dictionary: DictionaryData = {\n ...existingDictionaryDB,\n ...dictionaryDataEl,\n content: newContent,\n projectIds: [String(project._id)],\n creatorId: user._id,\n filePath: {\n [String(project._id)]: dictionaryDataEl.filePath ?? '',\n },\n publishedVersion,\n key: dictionaryDataEl.key,\n };\n\n try {\n const updatedDictionary =\n await dictionaryService.updateDictionaryByKey(\n dictionaryDataEl.key,\n dictionary,\n project._id\n );\n updatedDictionariesResult.push(\n mapDictionaryToAPI(updatedDictionary, project._id)\n );\n } catch (error) {\n ErrorHandler.handleAppErrorResponse(res, error as AppError);\n return;\n }\n }\n }\n\n const result: PushDictionariesResultData = {\n newDictionaries: newDictionariesResult.map(\n (dictionary) => dictionary.key\n ),\n updatedDictionaries: updatedDictionariesResult.map(\n (dictionary) => dictionary.key\n ),\n error: errorResult,\n };\n\n const responseData = formatResponse<PushDictionariesResultData>({\n message: t({\n en: 'Dictionaries updated successfully',\n fr: 'Dictionnaires mis à jour avec succès',\n es: 'Diccionarios actualizados con éxito',\n }),\n description: t({\n en: 'Your dictionaries have been updated successfully',\n fr: 'Vos dictionnaires ont été mis à jour avec succès',\n es: 'Sus diccionarios han sido actualizados con éxito',\n }),\n data: result,\n });\n\n eventListener.sendDictionaryUpdate([\n ...newDictionariesResult.map(\n (dictionary) =>\n ({\n dictionary,\n status: 'ADDED',\n }) as eventListener.SendDictionaryUpdateArg\n ),\n ...updatedDictionariesResult.map(\n (dictionary) =>\n ({\n dictionary,\n status: 'UPDATED',\n }) as eventListener.SendDictionaryUpdateArg\n ),\n ]);\n\n res.json(responseData);\n return;\n } catch (error) {\n ErrorHandler.handleAppErrorResponse(res, error as AppError);\n return;\n }\n};\n\nexport type UpdateDictionaryParam = { dictionaryId: string };\nexport type UpdateDictionaryBody = Partial<Dictionary>;\nexport type UpdateDictionaryResult = ResponseData<DictionaryAPI>;\n\n/**\n * Updates an existing dictionary in the database.\n */\nexport const updateDictionary = async (\n req: Request<UpdateDictionaryParam, any, UpdateDictionaryBody>,\n res: ResponseWithInformation<UpdateDictionaryResult>,\n _next: NextFunction\n): Promise<void> => {\n const { dictionaryId } = req.params;\n const { project, dictionaryRights } = res.locals;\n const dictionaryData = req.body;\n\n if (!dictionaryData) {\n ErrorHandler.handleGenericErrorResponse(res, 'DICTIONARY_DATA_NOT_FOUND');\n return;\n }\n\n if (!project) {\n ErrorHandler.handleGenericErrorResponse(res, 'PROJECT_NOT_DEFINED');\n return;\n }\n\n if (!dictionaryData.projectIds?.includes(String(project._id))) {\n ErrorHandler.handleGenericErrorResponse(res, 'DICTIONARY_PROJECT_MISMATCH');\n return;\n }\n\n if (typeof dictionaryId === 'undefined') {\n ErrorHandler.handleGenericErrorResponse(res, 'DICTIONARY_ID_NOT_FOUND');\n return;\n }\n\n if (!dictionaryRights?.write) {\n ErrorHandler.handleGenericErrorResponse(res, 'DICTIONARY_RIGHTS_NOT_WRITE');\n return;\n }\n\n try {\n const updatedDictionary = await dictionaryService.updateDictionaryById(\n dictionaryId,\n dictionaryData\n );\n\n const apiResult = mapDictionaryToAPI(updatedDictionary, project._id);\n\n const responseData = formatResponse<DictionaryAPI>({\n message: t({\n en: 'Dictionary updated successfully',\n fr: 'Dictionnaire mis à jour avec succès',\n es: 'Diccionario actualizado con éxito',\n }),\n description: t({\n en: 'Your dictionary has been updated successfully',\n fr: 'Votre dictionnaire a été mis à jour avec succès',\n es: 'Su diccionario ha sido actualizado con éxito',\n }),\n data: apiResult,\n });\n\n eventListener.sendDictionaryUpdate([\n {\n dictionary: apiResult,\n status: 'UPDATED',\n },\n ]);\n\n res.json(responseData);\n return;\n } catch (error) {\n ErrorHandler.handleAppErrorResponse(res, error as AppError);\n return;\n }\n};\n\nexport type DeleteDictionaryParam = { dictionaryId: string };\nexport type DeleteDictionaryResult = ResponseData<DictionaryAPI>;\n\n/**\n * Deletes a dictionary from the database by its ID.\n */\nexport const deleteDictionary = async (\n req: Request<DeleteDictionaryParam>,\n res: ResponseWithInformation<DeleteDictionaryResult>,\n _next: NextFunction\n): Promise<void> => {\n const { project, dictionaryRights } = res.locals;\n const { dictionaryId } = req.params as Partial<DeleteDictionaryParam>;\n\n if (!dictionaryId) {\n ErrorHandler.handleGenericErrorResponse(res, 'DICTIONARY_ID_NOT_FOUND');\n return;\n }\n\n if (!project) {\n ErrorHandler.handleGenericErrorResponse(res, 'PROJECT_NOT_DEFINED');\n return;\n }\n\n if (!dictionaryRights?.admin) {\n ErrorHandler.handleGenericErrorResponse(res, 'DICTIONARY_RIGHTS_NOT_ADMIN');\n return;\n }\n\n try {\n const dictionaryToDelete =\n await dictionaryService.getDictionaryById(dictionaryId);\n\n if (!dictionaryToDelete.projectIds.includes(project._id)) {\n ErrorHandler.handleGenericErrorResponse(\n res,\n 'DICTIONARY_PROJECT_MISMATCH'\n );\n return;\n }\n\n const deletedDictionary =\n await dictionaryService.deleteDictionaryById(dictionaryId);\n\n if (!deletedDictionary) {\n ErrorHandler.handleGenericErrorResponse(res, 'DICTIONARY_NOT_FOUND', {\n dictionaryId,\n });\n return;\n }\n\n logger.info(`Dictionary deleted: ${String(deletedDictionary._id)}`);\n\n const apiResult = mapDictionaryToAPI(deletedDictionary, project._id);\n\n const responseData = formatResponse<DictionaryAPI>({\n message: t({\n en: 'Dictionary deleted successfully',\n fr: 'Dictionnaire supprimé avec succès',\n es: 'Diccionario eliminado con éxito',\n }),\n description: t({\n en: 'Your dictionary has been deleted successfully',\n fr: 'Votre dictionnaire a été supprimé avec succès',\n es: 'Su diccionario ha sido eliminado con éxito',\n }),\n data: apiResult,\n });\n\n res.json(responseData);\n\n eventListener.sendDictionaryUpdate([\n {\n dictionary: apiResult,\n status: 'DELETED',\n },\n ]);\n\n return;\n } catch (error) {\n ErrorHandler.handleAppErrorResponse(res, error as AppError);\n return;\n }\n};\n"],"mappings":"AAIA,SAAS,cAAc;AAEvB,YAAY,uBAAuB;AACnC,SAAwB,oBAAoB;AAC5C;AAAA,EAEE;AAAA,OACK;AAEP,SAAS,0BAA0B;AACnC;AAAA,EACE;AAA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;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MACN,CAAC;AAAA,MACD,MAAM;AAAA,IACR,CAAC;AAED,QAAI,KAAK,YAAY;AAErB,kBAAc,qBAAqB;AAAA,MACjC;AAAA,QACE,YAAY;AAAA,QACZ,QAAQ;AAAA,MACV;AAAA,IACF,CAAC;AAED;AAAA,EACF,SAAS,OAAO;AACd,iBAAa,uBAAuB,KAAK,KAAiB;AAC1D;AAAA,EACF;AACF;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../src/controllers/dictionary.controller.ts"],"sourcesContent":["import type {\n ContentNode,\n Dictionary as LocalDictionary,\n} from '@intlayer/core';\nimport { logger } from '@logger';\nimport type { ResponseWithInformation } from '@middlewares/sessionAuth.middleware';\nimport * as dictionaryService from '@services/dictionary.service';\nimport { ensureMongoDocumentToObject } from '@utils/ensureMongoDocumentToObject';\nimport { type AppError, ErrorHandler } from '@utils/errors';\nimport {\n type DictionaryFiltersParams,\n getDictionaryFiltersAndPagination,\n} from '@utils/filtersAndPagination/getDictionaryFiltersAndPagination';\nimport type { FiltersAndPagination } from '@utils/filtersAndPagination/getFiltersAndPaginationFromBody';\nimport { mapDictionaryToAPI } from '@utils/mapper/dictionary';\nimport {\n formatPaginatedResponse,\n type ResponseData,\n type PaginatedResponse,\n formatResponse,\n} from '@utils/responseData';\nimport type { NextFunction, Request } from 'express';\nimport { t } from 'express-intlayer';\nimport * as eventListener from '@/controllers/event-listener';\nimport type {\n Dictionary,\n DictionaryAPI,\n DictionaryCreationData,\n DictionaryData,\n VersionedContent,\n} from '@/types/dictionary.types';\n\nexport type GetDictionariesParams =\n FiltersAndPagination<DictionaryFiltersParams>;\nexport type GetDictionariesResult = PaginatedResponse<DictionaryAPI>;\n\n/**\n * Retrieves a list of dictionaries based on filters and pagination.\n */\nexport const getDictionaries = async (\n req: Request<GetDictionariesParams>,\n res: ResponseWithInformation<GetDictionariesResult>,\n _next: NextFunction\n): Promise<void> => {\n const { user, project, dictionaryRights } = res.locals;\n const { filters, pageSize, skip, page, getNumberOfPages } =\n getDictionaryFiltersAndPagination(req);\n\n if (!project) {\n ErrorHandler.handleGenericErrorResponse(res, 'PROJECT_NOT_DEFINED');\n return;\n }\n if (!user) {\n ErrorHandler.handleGenericErrorResponse(res, 'USER_NOT_DEFINED');\n return;\n }\n if (!dictionaryRights?.read) {\n ErrorHandler.handleGenericErrorResponse(res, 'DICTIONARY_RIGHTS_NOT_READ');\n return;\n }\n\n try {\n const dictionaries = await dictionaryService.findDictionaries(\n filters,\n skip,\n pageSize\n );\n const totalItems = await dictionaryService.countDictionaries(filters);\n\n const dictionariesAPI = dictionaries.map((el) =>\n mapDictionaryToAPI(el, project._id)\n );\n\n const responseData = formatPaginatedResponse<DictionaryAPI>({\n data: dictionariesAPI,\n page,\n pageSize,\n totalPages: getNumberOfPages(totalItems),\n totalItems,\n });\n\n res.json(responseData);\n return;\n } catch (error) {\n ErrorHandler.handleAppErrorResponse(res, error as AppError);\n return;\n }\n};\n\nexport type GetDictionariesKeysResult = ResponseData<string[]>;\n\n/**\n * Retrieves a list of dictionaries keys based on filters and pagination.\n */\nexport const getDictionariesKeys = async (\n _req: Request,\n res: ResponseWithInformation<GetDictionariesKeysResult>,\n _next: NextFunction\n) => {\n const { project, dictionaryRights } = res.locals;\n\n if (!project) {\n ErrorHandler.handleGenericErrorResponse(res, 'PROJECT_NOT_DEFINED');\n return;\n }\n if (!dictionaryRights?.read) {\n ErrorHandler.handleGenericErrorResponse(res, 'DICTIONARY_RIGHTS_NOT_READ');\n return;\n }\n\n try {\n const dictionariesKeys = await dictionaryService.getDictionariesKeys(\n project._id\n );\n\n const responseData = formatResponse<string[]>({\n data: dictionariesKeys,\n });\n\n res.json(responseData);\n return;\n } catch (error) {\n ErrorHandler.handleAppErrorResponse(res, error as AppError);\n return;\n }\n};\n\nexport type GetDictionaryParams = { dictionaryKey: string };\nexport type GetDictionaryQuery = { version?: string };\nexport type GetDictionaryResult = ResponseData<DictionaryAPI>;\n\n/**\n * Retrieves a list of dictionaries based on filters and pagination.\n */\nexport const getDictionaryByKey = async (\n req: Request<GetDictionaryParams, any, any, GetDictionaryQuery>,\n res: ResponseWithInformation<GetDictionaryResult>,\n _next: NextFunction\n): Promise<void> => {\n const { project, user, dictionaryRights } = res.locals;\n const { dictionaryKey } = req.params;\n const version = req.query.version;\n\n if (!project) {\n ErrorHandler.handleGenericErrorResponse(res, 'PROJECT_NOT_DEFINED');\n return;\n }\n if (!user) {\n ErrorHandler.handleGenericErrorResponse(res, 'USER_NOT_DEFINED');\n return;\n }\n if (!dictionaryRights?.read) {\n ErrorHandler.handleGenericErrorResponse(res, 'DICTIONARY_RIGHTS_NOT_READ');\n return;\n }\n\n try {\n const dictionary = await dictionaryService.getDictionaryByKey(\n dictionaryKey,\n project._id\n );\n\n if (!dictionary.projectIds.map(String).includes(String(project._id))) {\n ErrorHandler.handleGenericErrorResponse(\n res,\n 'DICTIONARY_PROJECT_MISMATCH'\n );\n return;\n }\n\n const apiResult = mapDictionaryToAPI(dictionary, project._id, version);\n\n const responseData = formatResponse<DictionaryAPI>({\n data: apiResult,\n });\n\n res.json(responseData);\n return;\n } catch (error) {\n ErrorHandler.handleAppErrorResponse(res, error as AppError);\n return;\n }\n};\n\nexport type AddDictionaryBody = { dictionary: DictionaryCreationData };\nexport type AddDictionaryResult = ResponseData<DictionaryAPI>;\n\n/**\n * Adds a new dictionary to the database.\n */\nexport const addDictionary = async (\n req: Request<any, any, AddDictionaryBody>,\n res: ResponseWithInformation<AddDictionaryResult>,\n _next: NextFunction\n): Promise<void> => {\n const { project, user, dictionaryRights } = res.locals;\n const dictionaryData = req.body.dictionary;\n\n if (!dictionaryData) {\n ErrorHandler.handleGenericErrorResponse(res, 'DICTIONARY_DATA_NOT_FOUND');\n return;\n }\n\n if (!project) {\n ErrorHandler.handleGenericErrorResponse(res, 'PROJECT_NOT_DEFINED');\n return;\n }\n\n if (!user) {\n ErrorHandler.handleGenericErrorResponse(res, 'USER_NOT_DEFINED');\n return;\n }\n\n if (!dictionaryData.projectIds.includes(String(project._id))) {\n ErrorHandler.handleGenericErrorResponse(res, 'DICTIONARY_PROJECT_MISMATCH');\n return;\n }\n\n if (!dictionaryRights?.admin) {\n ErrorHandler.handleGenericErrorResponse(res, 'DICTIONARY_RIGHTS_NOT_ADMIN');\n return;\n }\n\n const dictionary: DictionaryData = {\n key: dictionaryData.key,\n title: dictionaryData.title,\n description: dictionaryData.description,\n content: new Map([\n ['v1', { content: dictionaryData.content ?? ({} as ContentNode) }],\n ]),\n creatorId: user._id,\n filePath: {\n [String(project._id)]: dictionaryData.filePath ?? '',\n },\n projectIds: dictionaryData.projectIds ?? [String(project._id)],\n };\n\n try {\n const newDictionary = await dictionaryService.createDictionary(dictionary);\n\n const apiResult = mapDictionaryToAPI(newDictionary, project._id);\n\n const responseData = formatResponse<DictionaryAPI>({\n message: t({\n en: 'Dictionary created successfully',\n fr: 'Dictionnaire créé avec succès',\n es: 'Diccionario creado con éxito',\n }),\n description: t({\n en: 'Your dictionary has been created successfully',\n fr: 'Votre dictionnaire a été créé avec succès',\n es: 'Su diccionario ha sido creado con éxito',\n }),\n data: apiResult,\n });\n\n res.json(responseData);\n\n eventListener.sendDictionaryUpdate([\n {\n dictionary: mapDictionaryToAPI(newDictionary, project._id),\n status: 'ADDED',\n },\n ]);\n return;\n } catch (error) {\n ErrorHandler.handleAppErrorResponse(res, error as AppError);\n return;\n }\n};\n\nexport type PushDictionariesBody = {\n dictionaries: LocalDictionary[];\n};\ntype PushDictionariesResultData = {\n newDictionaries: string[];\n updatedDictionaries: string[];\n error: { dictionaryId: string; message: string }[];\n};\nexport type PushDictionariesResult = ResponseData<PushDictionariesResultData>;\n\n/**\n * Check each dictionaries, add the new ones and update the existing ones.\n * @param req - Express request object.\n * @param res - Express response object.\n * @returns Response containing the created dictionary.\n */\nexport const pushDictionaries = async (\n req: Request<any, any, PushDictionariesBody>,\n res: ResponseWithInformation<PushDictionariesResult>,\n _next: NextFunction\n): Promise<void> => {\n const { project, user, dictionaryRights } = res.locals;\n const dictionaryData = req.body.dictionaries;\n const dictionariesKeys = dictionaryData.map((dictionary) => dictionary.key);\n\n if (\n typeof dictionaryData === 'object' &&\n Array.isArray(dictionaryData) &&\n dictionaryData.length === 0\n ) {\n ErrorHandler.handleGenericErrorResponse(res, 'DICTIONARIES_NOT_PROVIDED');\n return;\n } else if (!dictionaryData) {\n ErrorHandler.handleGenericErrorResponse(res, 'DICTIONARY_DATA_NOT_FOUND');\n return;\n }\n\n if (!project) {\n ErrorHandler.handleGenericErrorResponse(res, 'PROJECT_NOT_DEFINED');\n return;\n }\n\n if (!user) {\n ErrorHandler.handleGenericErrorResponse(res, 'USER_NOT_DEFINED');\n return;\n }\n\n if (!dictionaryRights?.write) {\n ErrorHandler.handleGenericErrorResponse(res, 'DICTIONARY_RIGHTS_NOT_WRITE');\n return;\n }\n\n if (!dictionaryRights?.admin) {\n ErrorHandler.handleGenericErrorResponse(res, 'DICTIONARY_RIGHTS_NOT_ADMIN');\n return;\n }\n\n try {\n const { existingDictionariesKey, newDictionariesKey } =\n await dictionaryService.getExistingDictionaryKey(\n dictionariesKeys,\n project._id\n );\n\n const existingDictionaries = dictionaryData.filter((dictionary) =>\n existingDictionariesKey.includes(dictionary.key)\n );\n const newDictionaries = dictionaryData.filter((dictionary) =>\n newDictionariesKey.includes(dictionary.key)\n );\n\n const newDictionariesResult: DictionaryAPI[] = [];\n const updatedDictionariesResult: DictionaryAPI[] = [];\n const errorResult: PushDictionariesResultData['error'] = [];\n\n for (const dictionaryDataEl of newDictionaries) {\n const dictionary: DictionaryData = {\n title: dictionaryDataEl.title,\n description: dictionaryDataEl.description,\n projectIds: [String(project._id)],\n creatorId: user._id,\n content: new Map([\n ['v1', { content: dictionaryDataEl.content ?? ({} as ContentNode) }],\n ]),\n filePath: {\n [String(project._id)]: dictionaryDataEl.filePath ?? '',\n },\n key: dictionaryDataEl.key,\n };\n\n try {\n const newDictionary =\n await dictionaryService.createDictionary(dictionary);\n newDictionariesResult.push(\n mapDictionaryToAPI(newDictionary, project._id)\n );\n } catch (error) {\n ErrorHandler.handleAppErrorResponse(res, error as AppError);\n return;\n }\n }\n\n if (existingDictionariesKey.length >= 0) {\n const existingDictionariesDB =\n await dictionaryService.getDictionariesByKeys(\n existingDictionariesKey,\n project._id\n );\n\n for (const dictionaryDataEl of existingDictionaries) {\n const existingDictionaryDB = existingDictionariesDB.find(\n (dictionaryDB) => dictionaryDB.key === dictionaryDataEl.key\n )!;\n\n const versionList = [...(existingDictionaryDB.content.keys() ?? [])];\n const lastVersion = versionList[versionList.length - 1];\n\n const lastContent =\n (existingDictionaryDB.content.get(lastVersion)\n ?.content as DictionaryAPI['content']) ?? null;\n\n const isSameContent =\n JSON.stringify(lastContent) ===\n JSON.stringify(dictionaryDataEl.content);\n\n let newContent: VersionedContent = existingDictionaryDB.content;\n\n if (!isSameContent) {\n const newContentVersion =\n dictionaryService.incrementVersion(existingDictionaryDB);\n\n newContent = {\n ...newContent,\n [newContentVersion]: {\n content: dictionaryDataEl.content,\n },\n };\n }\n\n const dictionary: DictionaryData = {\n ...ensureMongoDocumentToObject(existingDictionaryDB),\n ...dictionaryDataEl,\n content: newContent,\n projectIds: [String(project._id)],\n creatorId: user._id,\n filePath: {\n [String(project._id)]: dictionaryDataEl.filePath ?? '',\n },\n key: dictionaryDataEl.key,\n };\n\n try {\n const updatedDictionary =\n await dictionaryService.updateDictionaryByKey(\n dictionaryDataEl.key,\n dictionary,\n project._id\n );\n updatedDictionariesResult.push(\n mapDictionaryToAPI(updatedDictionary, project._id)\n );\n } catch (error) {\n ErrorHandler.handleAppErrorResponse(res, error as AppError);\n return;\n }\n }\n }\n\n const result: PushDictionariesResultData = {\n newDictionaries: newDictionariesResult.map(\n (dictionary) => dictionary.key\n ),\n updatedDictionaries: updatedDictionariesResult.map(\n (dictionary) => dictionary.key\n ),\n error: errorResult,\n };\n\n const responseData = formatResponse<PushDictionariesResultData>({\n message: t({\n en: 'Dictionaries updated successfully',\n fr: 'Dictionnaires mis à jour avec succès',\n es: 'Diccionarios actualizados con éxito',\n }),\n description: t({\n en: 'Your dictionaries have been updated successfully',\n fr: 'Vos dictionnaires ont été mis à jour avec succès',\n es: 'Sus diccionarios han sido actualizados con éxito',\n }),\n data: result,\n });\n\n eventListener.sendDictionaryUpdate([\n ...newDictionariesResult.map(\n (dictionary) =>\n ({\n dictionary,\n status: 'ADDED',\n }) as eventListener.SendDictionaryUpdateArg\n ),\n ...updatedDictionariesResult.map(\n (dictionary) =>\n ({\n dictionary,\n status: 'UPDATED',\n }) as eventListener.SendDictionaryUpdateArg\n ),\n ]);\n\n res.json(responseData);\n return;\n } catch (error) {\n ErrorHandler.handleAppErrorResponse(res, error as AppError);\n return;\n }\n};\n\nexport type UpdateDictionaryParam = { dictionaryId: string };\nexport type UpdateDictionaryBody = Partial<Dictionary>;\nexport type UpdateDictionaryResult = ResponseData<DictionaryAPI>;\n\n/**\n * Updates an existing dictionary in the database.\n */\nexport const updateDictionary = async (\n req: Request<UpdateDictionaryParam, any, UpdateDictionaryBody>,\n res: ResponseWithInformation<UpdateDictionaryResult>,\n _next: NextFunction\n): Promise<void> => {\n const { dictionaryId } = req.params;\n const { project, dictionaryRights } = res.locals;\n const dictionaryData = req.body;\n\n if (!dictionaryData) {\n ErrorHandler.handleGenericErrorResponse(res, 'DICTIONARY_DATA_NOT_FOUND');\n return;\n }\n\n if (!project) {\n ErrorHandler.handleGenericErrorResponse(res, 'PROJECT_NOT_DEFINED');\n return;\n }\n\n if (!dictionaryData.projectIds?.includes(String(project._id))) {\n ErrorHandler.handleGenericErrorResponse(res, 'DICTIONARY_PROJECT_MISMATCH');\n return;\n }\n\n if (typeof dictionaryId === 'undefined') {\n ErrorHandler.handleGenericErrorResponse(res, 'DICTIONARY_ID_NOT_FOUND');\n return;\n }\n\n if (!dictionaryRights?.write) {\n ErrorHandler.handleGenericErrorResponse(res, 'DICTIONARY_RIGHTS_NOT_WRITE');\n return;\n }\n\n try {\n const updatedDictionary = await dictionaryService.updateDictionaryById(\n dictionaryId,\n dictionaryData\n );\n\n const apiResult = mapDictionaryToAPI(updatedDictionary, project._id);\n\n const responseData = formatResponse<DictionaryAPI>({\n message: t({\n en: 'Dictionary updated successfully',\n fr: 'Dictionnaire mis à jour avec succès',\n es: 'Diccionario actualizado con éxito',\n }),\n description: t({\n en: 'Your dictionary has been updated successfully',\n fr: 'Votre dictionnaire a été mis à jour avec succès',\n es: 'Su diccionario ha sido actualizado con éxito',\n }),\n data: apiResult,\n });\n\n eventListener.sendDictionaryUpdate([\n {\n dictionary: apiResult,\n status: 'UPDATED',\n },\n ]);\n\n res.json(responseData);\n return;\n } catch (error) {\n ErrorHandler.handleAppErrorResponse(res, error as AppError);\n return;\n }\n};\n\nexport type DeleteDictionaryParam = { dictionaryId: string };\nexport type DeleteDictionaryResult = ResponseData<DictionaryAPI>;\n\n/**\n * Deletes a dictionary from the database by its ID.\n */\nexport const deleteDictionary = async (\n req: Request<DeleteDictionaryParam>,\n res: ResponseWithInformation<DeleteDictionaryResult>,\n _next: NextFunction\n): Promise<void> => {\n const { project, dictionaryRights } = res.locals;\n const { dictionaryId } = req.params as Partial<DeleteDictionaryParam>;\n\n if (!dictionaryId) {\n ErrorHandler.handleGenericErrorResponse(res, 'DICTIONARY_ID_NOT_FOUND');\n return;\n }\n\n if (!project) {\n ErrorHandler.handleGenericErrorResponse(res, 'PROJECT_NOT_DEFINED');\n return;\n }\n\n if (!dictionaryRights?.admin) {\n ErrorHandler.handleGenericErrorResponse(res, 'DICTIONARY_RIGHTS_NOT_ADMIN');\n return;\n }\n\n try {\n const dictionaryToDelete =\n await dictionaryService.getDictionaryById(dictionaryId);\n\n if (!dictionaryToDelete.projectIds.includes(project._id)) {\n ErrorHandler.handleGenericErrorResponse(\n res,\n 'DICTIONARY_PROJECT_MISMATCH'\n );\n return;\n }\n\n const deletedDictionary =\n await dictionaryService.deleteDictionaryById(dictionaryId);\n\n if (!deletedDictionary) {\n ErrorHandler.handleGenericErrorResponse(res, 'DICTIONARY_NOT_FOUND', {\n dictionaryId,\n });\n return;\n }\n\n logger.info(`Dictionary deleted: ${String(deletedDictionary._id)}`);\n\n const apiResult = mapDictionaryToAPI(deletedDictionary, project._id);\n\n const responseData = formatResponse<DictionaryAPI>({\n message: t({\n en: 'Dictionary deleted successfully',\n fr: 'Dictionnaire supprimé avec succès',\n es: 'Diccionario eliminado con éxito',\n }),\n description: t({\n en: 'Your dictionary has been deleted successfully',\n fr: 'Votre dictionnaire a été supprimé avec succès',\n es: 'Su diccionario ha sido eliminado con éxito',\n }),\n data: apiResult,\n });\n\n res.json(responseData);\n\n eventListener.sendDictionaryUpdate([\n {\n dictionary: apiResult,\n status: 'DELETED',\n },\n ]);\n\n return;\n } catch (error) {\n ErrorHandler.handleAppErrorResponse(res, error as AppError);\n return;\n }\n};\n"],"mappings":"AAIA,SAAS,cAAc;AAEvB,YAAY,uBAAuB;AACnC,SAAS,mCAAmC;AAC5C,SAAwB,oBAAoB;AAC5C;AAAA,EAEE;AAAA,OACK;AAEP,SAAS,0BAA0B;AACnC;AAAA,EACE;AAAA,EAGA;AAAA,OACK;AAEP,SAAS,SAAS;AAClB,YAAY,mBAAmB;AAgBxB,MAAM,kBAAkB,OAC7B,KACA,KACA,UACkB;AAClB,QAAM,EAAE,MAAM,SAAS,iBAAiB,IAAI,IAAI;AAChD,QAAM,EAAE,SAAS,UAAU,MAAM,MAAM,iBAAiB,IACtD,kCAAkC,GAAG;AAEvC,MAAI,CAAC,SAAS;AACZ,iBAAa,2BAA2B,KAAK,qBAAqB;AAClE;AAAA,EACF;AACA,MAAI,CAAC,MAAM;AACT,iBAAa,2BAA2B,KAAK,kBAAkB;AAC/D;AAAA,EACF;AACA,MAAI,CAAC,kBAAkB,MAAM;AAC3B,iBAAa,2BAA2B,KAAK,4BAA4B;AACzE;AAAA,EACF;AAEA,MAAI;AACF,UAAM,eAAe,MAAM,kBAAkB;AAAA,MAC3C;AAAA,MACA;AAAA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qBACJ,MAAM,kBAAkB,kBAAkB,YAAY;AAExD,QAAI,CAAC,mBAAmB,WAAW,SAAS,QAAQ,GAAG,GAAG;AACxD,mBAAa;AAAA,QACX;AAAA,QACA;AAAA,MACF;AACA;AAAA,IACF;AAEA,UAAM,oBACJ,MAAM,kBAAkB,qBAAqB,YAAY;AAE3D,QAAI,CAAC,mBAAmB;AACtB,mBAAa,2BAA2B,KAAK,wBAAwB;AAAA,QACnE;AAAA,MACF,CAAC;AACD;AAAA,IACF;AAEA,WAAO,KAAK,uBAAuB,OAAO,kBAAkB,GAAG,CAAC,EAAE;AAElE,UAAM,YAAY,mBAAmB,mBAAmB,QAAQ,GAAG;AAEnE,UAAM,eAAe,eAA8B;AAAA,MACjD,SAAS,EAAE;AAAA,QACT,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MACN,CAAC;AAAA,MACD,aAAa,EAAE;AAAA,QACb,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MACN,CAAC;AAAA,MACD,MAAM;AAAA,IACR,CAAC;AAED,QAAI,KAAK,YAAY;AAErB,kBAAc,qBAAqB;AAAA,MACjC;AAAA,QACE,YAAY;AAAA,QACZ,QAAQ;AAAA,MACV;AAAA,IACF,CAAC;AAED;AAAA,EACF,SAAS,OAAO;AACd,iBAAa,uBAAuB,KAAK,KAAiB;AAC1D;AAAA,EACF;AACF;","names":[]}
|
|
@@ -31,7 +31,7 @@ const InviteUserEmailEN = ({
|
|
|
31
31
|
/* @__PURE__ */ jsx(Section, { className: "mt-[32px]", children: /* @__PURE__ */ jsx(
|
|
32
32
|
Img,
|
|
33
33
|
{
|
|
34
|
-
src: `https://intlayer.org/
|
|
34
|
+
src: `https://intlayer.org/favicon-32x32.png`,
|
|
35
35
|
width: "40",
|
|
36
36
|
height: "37",
|
|
37
37
|
alt: "Intlayer",
|
|
@@ -114,7 +114,7 @@ const InviteUserEmailFR = ({
|
|
|
114
114
|
/* @__PURE__ */ jsx(Section, { className: "mt-[32px]", children: /* @__PURE__ */ jsx(
|
|
115
115
|
Img,
|
|
116
116
|
{
|
|
117
|
-
src: `https://intlayer.org/
|
|
117
|
+
src: `https://intlayer.org/favicon-32x32.png`,
|
|
118
118
|
width: "40",
|
|
119
119
|
height: "37",
|
|
120
120
|
alt: "Intlayer",
|
|
@@ -198,7 +198,7 @@ const InviteUserEmailES = ({
|
|
|
198
198
|
/* @__PURE__ */ jsx(Section, { className: "mt-[32px]", children: /* @__PURE__ */ jsx(
|
|
199
199
|
Img,
|
|
200
200
|
{
|
|
201
|
-
src: `https://intlayer.org/
|
|
201
|
+
src: `https://intlayer.org/favicon-32x32.png`,
|
|
202
202
|
width: "40",
|
|
203
203
|
height: "37",
|
|
204
204
|
alt: "Intlayer",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/emails/InviteUserEmail.tsx"],"sourcesContent":["import {\n Body,\n Button,\n Container,\n Head,\n Heading,\n Hr,\n Html,\n Img,\n Link,\n Preview,\n Section,\n Text,\n Tailwind,\n} from '@react-email/components';\n\nexport type InviteUserEmailProps = {\n username: string;\n invitedByUsername: string;\n invitedByEmail: string;\n organizationName: string;\n inviteLink: string;\n inviteFromIp: string;\n inviteFromLocation: string;\n};\n\nexport const InviteUserEmailEN = ({\n username,\n invitedByUsername,\n invitedByEmail,\n organizationName,\n inviteLink,\n inviteFromIp,\n inviteFromLocation,\n}: InviteUserEmailProps) => {\n const previewText = `Join ${invitedByUsername} on Intlayer`;\n\n return (\n <Html>\n <Head />\n <Preview>{previewText}</Preview>\n <Tailwind>\n <Body className=\"m-auto px-2 font-sans\">\n <Container className=\"mx-auto my-[40px] max-w-[465px] rounded-xl border border-solid border-[#eaeaea] bg-white p-[20px]\">\n <Section className=\"mt-[32px]\">\n <Img\n src={`https://intlayer.org/assets/favicon-32x32.png`}\n width=\"40\"\n height=\"37\"\n alt=\"Intlayer\"\n className=\"mx-auto my-0\"\n />\n </Section>\n <Heading className=\"mx-0 my-[30px] p-0 text-center text-[24px] font-normal text-black\">\n Join <strong>{organizationName}</strong> on{' '}\n <strong>Intlayer</strong>\n </Heading>\n <Text className=\"text-[14px] leading-[24px] text-black\">\n Hello {username},\n </Text>\n <Text className=\"text-[14px] leading-[24px] text-black\">\n <strong>{invitedByUsername}</strong> (\n <Link\n href={`mailto:${invitedByEmail}`}\n className=\"text-[#E879BA] no-underline\"\n >\n {invitedByEmail}\n </Link>\n ) has invited you to the <strong>{organizationName}</strong> team\n on <strong>Intlayer</strong>.\n </Text>\n\n <Section className=\"my-[32px] text-center\">\n <Button\n className=\"rounded-md bg-[#000000] px-5 py-3 text-center text-[12px] font-semibold text-white no-underline\"\n href={inviteLink}\n >\n Join the team\n </Button>\n </Section>\n <Text className=\"text-[14px] leading-[24px] text-black\">\n or copy and paste this URL into your browser:{' '}\n <Link href={inviteLink} className=\"text-[#E879BA] no-underline\">\n {inviteLink}\n </Link>\n </Text>\n <Hr className=\"mx-0 my-[26px] w-full border border-solid border-[#eaeaea]\" />\n <Text className=\"text-[12px] leading-[24px] text-[#666666]\">\n This invitation was intended for{' '}\n <span className=\"text-black\">{username}</span>. This invite was\n sent from <span className=\"text-black\">{inviteFromIp}</span>{' '}\n {inviteFromLocation && (\n <>\n {' located in '}\n <span className=\"text-black\">{inviteFromLocation}</span>\n </>\n )}\n . If you were not expecting this invitation, you can ignore this\n email. If you are concerned about your account's safety, please\n reply to this email to get in touch with us.\n </Text>\n </Container>\n </Body>\n </Tailwind>\n </Html>\n );\n};\n\nexport const InviteUserEmailFR = ({\n username,\n invitedByUsername,\n invitedByEmail,\n organizationName,\n inviteLink,\n inviteFromIp,\n inviteFromLocation,\n}: InviteUserEmailProps) => {\n const previewText = `Rejoignez ${invitedByUsername} sur Intlayer`;\n\n return (\n <Html>\n <Head />\n <Preview>{previewText}</Preview>\n <Tailwind>\n <Body className=\"m-auto px-2 font-sans\">\n <Container className=\"mx-auto my-[40px] max-w-[465px] rounded-xl border border-solid border-[#eaeaea] bg-white p-[20px]\">\n <Section className=\"mt-[32px]\">\n <Img\n src={`https://intlayer.org/assets/favicon-32x32.png`}\n width=\"40\"\n height=\"37\"\n alt=\"Intlayer\"\n className=\"mx-auto my-0\"\n />\n </Section>\n <Heading className=\"mx-0 my-[30px] p-0 text-center text-[24px] font-normal text-black\">\n Rejoignez <strong>{organizationName}</strong> sur{' '}\n <strong>Intlayer</strong>\n </Heading>\n <Text className=\"text-[14px] leading-[24px] text-black\">\n Bonjour {username},\n </Text>\n <Text className=\"text-[14px] leading-[24px] text-black\">\n <strong>{invitedByUsername}</strong> (\n <Link\n href={`mailto:${invitedByEmail}`}\n className=\"text-[#E879BA] no-underline\"\n >\n {invitedByEmail}\n </Link>\n ) vous a invité à rejoindre l'équipe de{' '}\n <strong>{organizationName}</strong> sur <strong>Intlayer</strong>.\n </Text>\n <Section className=\"my-[32px] text-center\">\n <Button\n className=\"rounded-md bg-[#000000] px-5 py-3 text-center text-[12px] font-semibold text-white no-underline\"\n href={inviteLink}\n >\n Rejoindre l'équipe\n </Button>\n </Section>\n <Text className=\"text-[14px] leading-[24px] text-black\">\n ou copiez et collez cette URL dans votre navigateur :{' '}\n <Link href={inviteLink} className=\"text-[#E879BA] no-underline\">\n {inviteLink}\n </Link>\n </Text>\n <Hr className=\"mx-0 my-[26px] w-full border border-solid border-[#eaeaea]\" />\n <Text className=\"text-[12px] leading-[24px] text-[#666666]\">\n Cette invitation était destinée à{' '}\n <span className=\"text-black\">{username}</span>. Cette invitation a\n été envoyée depuis{' '}\n <span className=\"text-black\">{inviteFromIp}</span>\n {inviteFromLocation && (\n <>\n {', située à '}\n <span className=\"text-black\">{inviteFromLocation}</span>\n </>\n )}\n . Si vous n'attendiez pas cette invitation, vous pouvez ignorer\n cet email. Si vous êtes préoccupé par la sécurité de votre compte,\n veuillez répondre à cet email pour nous contacter.\n </Text>\n </Container>\n </Body>\n </Tailwind>\n </Html>\n );\n};\n\nexport const InviteUserEmailES = ({\n username,\n invitedByUsername,\n invitedByEmail,\n organizationName,\n inviteLink,\n inviteFromIp,\n inviteFromLocation,\n}: InviteUserEmailProps) => {\n const previewText = `Únete a ${invitedByUsername} en Intlayer`;\n\n return (\n <Html>\n <Head />\n <Preview>{previewText}</Preview>\n <Tailwind>\n <Body className=\"m-auto px-2 font-sans\">\n <Container className=\"mx-auto my-[40px] max-w-[465px] rounded-xl border border-solid border-[#eaeaea] bg-white p-[20px]\">\n <Section className=\"mt-[32px]\">\n <Img\n src={`https://intlayer.org/assets/favicon-32x32.png`}\n width=\"40\"\n height=\"37\"\n alt=\"Intlayer\"\n className=\"mx-auto my-0\"\n />\n </Section>\n <Heading className=\"mx-0 my-[30px] p-0 text-center text-[24px] font-normal text-black\">\n Únete a <strong>{organizationName}</strong> en{' '}\n <strong>Intlayer</strong>\n </Heading>\n <Text className=\"text-[14px] leading-[24px] text-black\">\n Hola {username},\n </Text>\n <Text className=\"text-[14px] leading-[24px] text-black\">\n <strong>{invitedByUsername}</strong> (\n <Link\n href={`mailto:${invitedByEmail}`}\n className=\"text-[#E879BA] no-underline\"\n >\n {invitedByEmail}\n </Link>\n ) te ha invitado a unirte al equipo de{' '}\n <strong>{organizationName}</strong> en <strong>Intlayer</strong>.\n </Text>\n <Section className=\"my-[32px] text-center\">\n <Button\n className=\"rounded-md bg-[#000000] px-5 py-3 text-center text-[12px] font-semibold text-white no-underline\"\n href={inviteLink}\n >\n Unirse al equipo\n </Button>\n </Section>\n <Text className=\"text-[14px] leading-[24px] text-black\">\n o copia y pega esta URL en tu navegador:{' '}\n <Link href={inviteLink} className=\"text-[#E879BA] no-underline\">\n {inviteLink}\n </Link>\n </Text>\n <Hr className=\"mx-0 my-[26px] w-full border border-solid border-[#eaeaea]\" />\n <Text className=\"text-[12px] leading-[24px] text-[#666666]\">\n Esta invitación estaba destinada para{' '}\n <span className=\"text-black\">{username}</span>. Esta invitación\n fue enviada desde{' '}\n <span className=\"text-black\">{inviteFromIp}</span>\n {inviteFromLocation && (\n <>\n {', ubicada en '}\n <span className=\"text-black\">{inviteFromLocation}</span>\n </>\n )}\n . Si no esperabas esta invitación, puedes ignorar este correo. Si\n estás preocupado por la seguridad de tu cuenta, por favor responde\n a este correo para contactarte con nosotros.\n </Text>\n </Container>\n </Body>\n </Tailwind>\n </Html>\n );\n};\n\nconst PreviewProps: InviteUserEmailProps = {\n username: 'alanturing',\n invitedByUsername: 'Alan',\n invitedByEmail: 'alan.turing@example.com',\n organizationName: 'Enigma',\n inviteLink: 'https://intlayer.org/teams/invite/foo',\n inviteFromIp: '204.13.x.x',\n inviteFromLocation: 'São Paulo, Brazil',\n};\n\nInviteUserEmailEN.PreviewProps = PreviewProps;\nInviteUserEmailFR.PreviewProps = PreviewProps;\nInviteUserEmailES.PreviewProps = PreviewProps;\n"],"mappings":"AAuCM,SAqDU,UArDV,KAcM,YAdN;AAvCN;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAYA,MAAM,oBAAoB,CAAC;AAAA,EAChC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAA4B;AAC1B,QAAM,cAAc,QAAQ,iBAAiB;AAE7C,SACE,qBAAC,QACC;AAAA,wBAAC,QAAK;AAAA,IACN,oBAAC,WAAS,uBAAY;AAAA,IACtB,oBAAC,YACC,8BAAC,QAAK,WAAU,yBACd,+BAAC,aAAU,WAAU,qGACnB;AAAA,0BAAC,WAAQ,WAAU,aACjB;AAAA,QAAC;AAAA;AAAA,UACC,KAAK;AAAA,UACL,OAAM;AAAA,UACN,QAAO;AAAA,UACP,KAAI;AAAA,UACJ,WAAU;AAAA;AAAA,MACZ,GACF;AAAA,MACA,qBAAC,WAAQ,WAAU,qEAAoE;AAAA;AAAA,QAChF,oBAAC,YAAQ,4BAAiB;AAAA,QAAS;AA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yBACjB;AAAA,QAAC;AAAA;AAAA,UACC,WAAU;AAAA,UACV,MAAM;AAAA,UACP;AAAA;AAAA,MAED,GACF;AAAA,MACA,qBAAC,QAAK,WAAU,yCAAwC;AAAA;AAAA,QACb;AAAA,QACzC,oBAAC,QAAK,MAAM,YAAY,WAAU,+BAC/B,sBACH;AAAA,SACF;AAAA,MACA,oBAAC,MAAG,WAAU,8DAA6D;AAAA,MAC3E,qBAAC,QAAK,WAAU,6CAA4C;AAAA;AAAA,QACpB;AAAA,QACtC,oBAAC,UAAK,WAAU,cAAc,oBAAS;AAAA,QAAO;AAAA,QAC5B;AAAA,QAClB,oBAAC,UAAK,WAAU,cAAc,wBAAa;AAAA,QAC1C,sBACC,iCACG;AAAA;AAAA,UACD,oBAAC,UAAK,WAAU,cAAc,8BAAmB;AAAA,WACnD;AAAA,QACA;AAAA,SAIJ;AAAA,OACF,GACF,GACF;AAAA,KACF;AAEJ;AAEA,MAAM,eAAqC;AAAA,EACzC,UAAU;AAAA,EACV,mBAAmB;AAAA,EACnB,gBAAgB;AAAA,EAChB,kBAAkB;AAAA,EAClB,YAAY;AAAA,EACZ,cAAc;AAAA,EACd,oBAAoB;AACtB;AAEA,kBAAkB,eAAe;AACjC,kBAAkB,eAAe;AACjC,kBAAkB,eAAe;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../src/emails/InviteUserEmail.tsx"],"sourcesContent":["import {\n Body,\n Button,\n Container,\n Head,\n Heading,\n Hr,\n Html,\n Img,\n Link,\n Preview,\n Section,\n Text,\n Tailwind,\n} from '@react-email/components';\n\nexport type InviteUserEmailProps = {\n username: string;\n invitedByUsername: string;\n invitedByEmail: string;\n organizationName: string;\n inviteLink: string;\n inviteFromIp: string;\n inviteFromLocation: string;\n};\n\nexport const InviteUserEmailEN = ({\n username,\n invitedByUsername,\n invitedByEmail,\n organizationName,\n inviteLink,\n inviteFromIp,\n inviteFromLocation,\n}: InviteUserEmailProps) => {\n const previewText = `Join ${invitedByUsername} on Intlayer`;\n\n return (\n <Html>\n <Head />\n <Preview>{previewText}</Preview>\n <Tailwind>\n <Body className=\"m-auto px-2 font-sans\">\n <Container className=\"mx-auto my-[40px] max-w-[465px] rounded-xl border border-solid border-[#eaeaea] bg-white p-[20px]\">\n <Section className=\"mt-[32px]\">\n <Img\n src={`https://intlayer.org/favicon-32x32.png`}\n width=\"40\"\n height=\"37\"\n alt=\"Intlayer\"\n className=\"mx-auto my-0\"\n />\n </Section>\n <Heading className=\"mx-0 my-[30px] p-0 text-center text-[24px] font-normal text-black\">\n Join <strong>{organizationName}</strong> on{' '}\n <strong>Intlayer</strong>\n </Heading>\n <Text className=\"text-[14px] leading-[24px] text-black\">\n Hello {username},\n </Text>\n <Text className=\"text-[14px] leading-[24px] text-black\">\n <strong>{invitedByUsername}</strong> (\n <Link\n href={`mailto:${invitedByEmail}`}\n className=\"text-[#E879BA] no-underline\"\n >\n {invitedByEmail}\n </Link>\n ) has invited you to the <strong>{organizationName}</strong> team\n on <strong>Intlayer</strong>.\n </Text>\n\n <Section className=\"my-[32px] text-center\">\n <Button\n className=\"rounded-md bg-[#000000] px-5 py-3 text-center text-[12px] font-semibold text-white no-underline\"\n href={inviteLink}\n >\n Join the team\n </Button>\n </Section>\n <Text className=\"text-[14px] leading-[24px] text-black\">\n or copy and paste this URL into your browser:{' '}\n <Link href={inviteLink} className=\"text-[#E879BA] no-underline\">\n {inviteLink}\n </Link>\n </Text>\n <Hr className=\"mx-0 my-[26px] w-full border border-solid border-[#eaeaea]\" />\n <Text className=\"text-[12px] leading-[24px] text-[#666666]\">\n This invitation was intended for{' '}\n <span className=\"text-black\">{username}</span>. This invite was\n sent from <span className=\"text-black\">{inviteFromIp}</span>{' '}\n {inviteFromLocation && (\n <>\n {' located in '}\n <span className=\"text-black\">{inviteFromLocation}</span>\n </>\n )}\n . If you were not expecting this invitation, you can ignore this\n email. If you are concerned about your account's safety, please\n reply to this email to get in touch with us.\n </Text>\n </Container>\n </Body>\n </Tailwind>\n </Html>\n );\n};\n\nexport const InviteUserEmailFR = ({\n username,\n invitedByUsername,\n invitedByEmail,\n organizationName,\n inviteLink,\n inviteFromIp,\n inviteFromLocation,\n}: InviteUserEmailProps) => {\n const previewText = `Rejoignez ${invitedByUsername} sur Intlayer`;\n\n return (\n <Html>\n <Head />\n <Preview>{previewText}</Preview>\n <Tailwind>\n <Body className=\"m-auto px-2 font-sans\">\n <Container className=\"mx-auto my-[40px] max-w-[465px] rounded-xl border border-solid border-[#eaeaea] bg-white p-[20px]\">\n <Section className=\"mt-[32px]\">\n <Img\n src={`https://intlayer.org/favicon-32x32.png`}\n width=\"40\"\n height=\"37\"\n alt=\"Intlayer\"\n className=\"mx-auto my-0\"\n />\n </Section>\n <Heading className=\"mx-0 my-[30px] p-0 text-center text-[24px] font-normal text-black\">\n Rejoignez <strong>{organizationName}</strong> sur{' '}\n <strong>Intlayer</strong>\n </Heading>\n <Text className=\"text-[14px] leading-[24px] text-black\">\n Bonjour {username},\n </Text>\n <Text className=\"text-[14px] leading-[24px] text-black\">\n <strong>{invitedByUsername}</strong> (\n <Link\n href={`mailto:${invitedByEmail}`}\n className=\"text-[#E879BA] no-underline\"\n >\n {invitedByEmail}\n </Link>\n ) vous a invité à rejoindre l'équipe de{' '}\n <strong>{organizationName}</strong> sur <strong>Intlayer</strong>.\n </Text>\n <Section className=\"my-[32px] text-center\">\n <Button\n className=\"rounded-md bg-[#000000] px-5 py-3 text-center text-[12px] font-semibold text-white no-underline\"\n href={inviteLink}\n >\n Rejoindre l'équipe\n </Button>\n </Section>\n <Text className=\"text-[14px] leading-[24px] text-black\">\n ou copiez et collez cette URL dans votre navigateur :{' '}\n <Link href={inviteLink} className=\"text-[#E879BA] no-underline\">\n {inviteLink}\n </Link>\n </Text>\n <Hr className=\"mx-0 my-[26px] w-full border border-solid border-[#eaeaea]\" />\n <Text className=\"text-[12px] leading-[24px] text-[#666666]\">\n Cette invitation était destinée à{' '}\n <span className=\"text-black\">{username}</span>. Cette invitation a\n été envoyée depuis{' '}\n <span className=\"text-black\">{inviteFromIp}</span>\n {inviteFromLocation && (\n <>\n {', située à '}\n <span className=\"text-black\">{inviteFromLocation}</span>\n </>\n )}\n . Si vous n'attendiez pas cette invitation, vous pouvez ignorer\n cet email. Si vous êtes préoccupé par la sécurité de votre compte,\n veuillez répondre à cet email pour nous contacter.\n </Text>\n </Container>\n </Body>\n </Tailwind>\n </Html>\n );\n};\n\nexport const InviteUserEmailES = ({\n username,\n invitedByUsername,\n invitedByEmail,\n organizationName,\n inviteLink,\n inviteFromIp,\n inviteFromLocation,\n}: InviteUserEmailProps) => {\n const previewText = `Únete a ${invitedByUsername} en Intlayer`;\n\n return (\n <Html>\n <Head />\n <Preview>{previewText}</Preview>\n <Tailwind>\n <Body className=\"m-auto px-2 font-sans\">\n <Container className=\"mx-auto my-[40px] max-w-[465px] rounded-xl border border-solid border-[#eaeaea] bg-white p-[20px]\">\n <Section className=\"mt-[32px]\">\n <Img\n src={`https://intlayer.org/favicon-32x32.png`}\n width=\"40\"\n height=\"37\"\n alt=\"Intlayer\"\n className=\"mx-auto my-0\"\n />\n </Section>\n <Heading className=\"mx-0 my-[30px] p-0 text-center text-[24px] font-normal text-black\">\n Únete a <strong>{organizationName}</strong> en{' '}\n <strong>Intlayer</strong>\n </Heading>\n <Text className=\"text-[14px] leading-[24px] text-black\">\n Hola {username},\n </Text>\n <Text className=\"text-[14px] leading-[24px] text-black\">\n <strong>{invitedByUsername}</strong> (\n <Link\n href={`mailto:${invitedByEmail}`}\n className=\"text-[#E879BA] no-underline\"\n >\n {invitedByEmail}\n </Link>\n ) te ha invitado a unirte al equipo de{' '}\n <strong>{organizationName}</strong> en <strong>Intlayer</strong>.\n </Text>\n <Section className=\"my-[32px] text-center\">\n <Button\n className=\"rounded-md bg-[#000000] px-5 py-3 text-center text-[12px] font-semibold text-white no-underline\"\n href={inviteLink}\n >\n Unirse al equipo\n </Button>\n </Section>\n <Text className=\"text-[14px] leading-[24px] text-black\">\n o copia y pega esta URL en tu navegador:{' '}\n <Link href={inviteLink} className=\"text-[#E879BA] no-underline\">\n {inviteLink}\n </Link>\n </Text>\n <Hr className=\"mx-0 my-[26px] w-full border border-solid border-[#eaeaea]\" />\n <Text className=\"text-[12px] leading-[24px] text-[#666666]\">\n Esta invitación estaba destinada para{' '}\n <span className=\"text-black\">{username}</span>. Esta invitación\n fue enviada desde{' '}\n <span className=\"text-black\">{inviteFromIp}</span>\n {inviteFromLocation && (\n <>\n {', ubicada en '}\n <span className=\"text-black\">{inviteFromLocation}</span>\n </>\n )}\n . Si no esperabas esta invitación, puedes ignorar este correo. Si\n estás preocupado por la seguridad de tu cuenta, por favor responde\n a este correo para contactarte con nosotros.\n </Text>\n </Container>\n </Body>\n </Tailwind>\n </Html>\n );\n};\n\nconst PreviewProps: InviteUserEmailProps = {\n username: 'alanturing',\n invitedByUsername: 'Alan',\n invitedByEmail: 'alan.turing@example.com',\n organizationName: 'Enigma',\n inviteLink: 'https://intlayer.org/teams/invite/foo',\n inviteFromIp: '204.13.x.x',\n inviteFromLocation: 'São Paulo, Brazil',\n};\n\nInviteUserEmailEN.PreviewProps = PreviewProps;\nInviteUserEmailFR.PreviewProps = PreviewProps;\nInviteUserEmailES.PreviewProps = PreviewProps;\n"],"mappings":"AAuCM,SAqDU,UArDV,KAcM,YAdN;AAvCN;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAYA,MAAM,oBAAoB,CAAC;AAAA,EAChC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAA4B;AAC1B,QAAM,cAAc,QAAQ,iBAAiB;AAE7C,SACE,qBAAC,QACC;AAAA,wBAAC,QAAK;AAAA,IACN,oBAAC,WAAS,uBAAY;AAAA,IACtB,oBAAC,YACC,8BAAC,QAA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,YAAQ,6BAAkB;AAAA,QAAS;AAAA,QACpC;AAAA,UAAC;AAAA;AAAA,YACC,MAAM,UAAU,cAAc;AAAA,YAC9B,WAAU;AAAA,YAET;AAAA;AAAA,QACH;AAAA,QAAO;AAAA,QACgC;AAAA,QACvC,oBAAC,YAAQ,4BAAiB;AAAA,QAAS;AAAA,QAAI,oBAAC,YAAO,sBAAQ;AAAA,QAAS;AAAA,SAClE;AAAA,MACA,oBAAC,WAAQ,WAAU,yBACjB;AAAA,QAAC;AAAA;AAAA,UACC,WAAU;AAAA,UACV,MAAM;AAAA,UACP;AAAA;AAAA,MAED,GACF;AAAA,MACA,qBAAC,QAAK,WAAU,yCAAwC;AAAA;AAAA,QACb;AAAA,QACzC,oBAAC,QAAK,MAAM,YAAY,WAAU,+BAC/B,sBACH;AAAA,SACF;AAAA,MACA,oBAAC,MAAG,WAAU,8DAA6D;AAAA,MAC3E,qBAAC,QAAK,WAAU,6CAA4C;AAAA;AAAA,QACpB;AAAA,QACtC,oBAAC,UAAK,WAAU,cAAc,oBAAS;AAAA,QAAO;AAAA,QAC5B;AAAA,QAClB,oBAAC,UAAK,WAAU,cAAc,wBAAa;AAAA,QAC1C,sBACC,iCACG;AAAA;AAAA,UACD,oBAAC,UAAK,WAAU,cAAc,8BAAmB;AAAA,WACnD;AAAA,QACA;AAAA,SAIJ;AAAA,OACF,GACF,GACF;AAAA,KACF;AAEJ;AAEA,MAAM,eAAqC;AAAA,EACzC,UAAU;AAAA,EACV,mBAAmB;AAAA,EACnB,gBAAgB;AAAA,EAChB,kBAAkB;AAAA,EAClB,YAAY;AAAA,EACZ,cAAc;AAAA,EACd,oBAAoB;AACtB;AAEA,kBAAkB,eAAe;AACjC,kBAAkB,eAAe;AACjC,kBAAkB,eAAe;","names":[]}
|
|
@@ -23,7 +23,7 @@ const PasswordChangeConfirmationEmailEN = ({
|
|
|
23
23
|
/* @__PURE__ */ jsx(Section, { className: "mt-[32px]", children: /* @__PURE__ */ jsx(
|
|
24
24
|
Img,
|
|
25
25
|
{
|
|
26
|
-
src: `https://intlayer.org/
|
|
26
|
+
src: `https://intlayer.org/favicon-32x32.png`,
|
|
27
27
|
width: "40",
|
|
28
28
|
height: "37",
|
|
29
29
|
alt: "Intlayer",
|
|
@@ -59,7 +59,7 @@ const PasswordChangeConfirmationEmailFR = ({
|
|
|
59
59
|
/* @__PURE__ */ jsx(Section, { className: "mt-[32px]", children: /* @__PURE__ */ jsx(
|
|
60
60
|
Img,
|
|
61
61
|
{
|
|
62
|
-
src: `https://intlayer.org/
|
|
62
|
+
src: `https://intlayer.org/favicon-32x32.png`,
|
|
63
63
|
width: "40",
|
|
64
64
|
height: "37",
|
|
65
65
|
alt: "Intlayer",
|
|
@@ -95,7 +95,7 @@ const PasswordChangeConfirmationEmailES = ({
|
|
|
95
95
|
/* @__PURE__ */ jsx(Section, { className: "mt-[32px]", children: /* @__PURE__ */ jsx(
|
|
96
96
|
Img,
|
|
97
97
|
{
|
|
98
|
-
src: `https://intlayer.org/
|
|
98
|
+
src: `https://intlayer.org/favicon-32x32.png`,
|
|
99
99
|
width: "40",
|
|
100
100
|
height: "37",
|
|
101
101
|
alt: "Intlayer",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/emails/PasswordChangeConfirmation.tsx"],"sourcesContent":["import {\n Body,\n Container,\n Head,\n Heading,\n Hr,\n Html,\n Img,\n Preview,\n Section,\n Text,\n Tailwind,\n} from '@react-email/components';\n\nexport type PasswordChangeConfirmationEmailProps = {\n username: string;\n};\n\nexport const PasswordChangeConfirmationEmailEN = ({\n username,\n}: PasswordChangeConfirmationEmailProps) => {\n const previewText = `Your Intlayer password has been changed`;\n\n return (\n <Html>\n <Head />\n <Preview>{previewText}</Preview>\n <Tailwind>\n <Body className=\"m-auto px-2 font-sans\">\n <Container className=\"mx-auto my-[40px] max-w-[465px] rounded-xl border border-solid border-[#eaeaea] bg-white p-[20px]\">\n <Section className=\"mt-[32px]\">\n <Img\n src={`https://intlayer.org/
|
|
1
|
+
{"version":3,"sources":["../../../src/emails/PasswordChangeConfirmation.tsx"],"sourcesContent":["import {\n Body,\n Container,\n Head,\n Heading,\n Hr,\n Html,\n Img,\n Preview,\n Section,\n Text,\n Tailwind,\n} from '@react-email/components';\n\nexport type PasswordChangeConfirmationEmailProps = {\n username: string;\n};\n\nexport const PasswordChangeConfirmationEmailEN = ({\n username,\n}: PasswordChangeConfirmationEmailProps) => {\n const previewText = `Your Intlayer password has been changed`;\n\n return (\n <Html>\n <Head />\n <Preview>{previewText}</Preview>\n <Tailwind>\n <Body className=\"m-auto px-2 font-sans\">\n <Container className=\"mx-auto my-[40px] max-w-[465px] rounded-xl border border-solid border-[#eaeaea] bg-white p-[20px]\">\n <Section className=\"mt-[32px]\">\n <Img\n src={`https://intlayer.org/favicon-32x32.png`}\n width=\"40\"\n height=\"37\"\n alt=\"Intlayer\"\n className=\"mx-auto my-0\"\n />\n </Section>\n <Heading className=\"mx-0 my-[30px] p-0 text-center text-[24px] font-normal text-black\">\n Your password has been changed\n </Heading>\n <Text className=\"text-[14px] leading-[24px] text-black\">\n Hello {username},\n </Text>\n <Text className=\"text-[14px] leading-[24px] text-black\">\n This email is to confirm that your password for your{' '}\n <strong>Intlayer</strong> account has been successfully changed.\n </Text>\n <Text className=\"text-[14px] leading-[24px] text-black\">\n If you did not make this change or believe an unauthorized person\n has accessed your account, please contact us immediately by\n replying to this email.\n </Text>\n <Hr className=\"mx-0 my-[26px] w-full border border-solid border-[#eaeaea]\" />\n <Text className=\"text-[12px] leading-[24px] text-[#666666]\">\n If you have any questions or need further assistance, feel free to\n reach out to us. We're here to help!\n </Text>\n </Container>\n </Body>\n </Tailwind>\n </Html>\n );\n};\n\nexport const PasswordChangeConfirmationEmailFR = ({\n username,\n}: PasswordChangeConfirmationEmailProps) => {\n const previewText = `Votre mot de passe Intlayer a été modifié`;\n\n return (\n <Html>\n <Head />\n <Preview>{previewText}</Preview>\n <Tailwind>\n <Body className=\"m-auto px-2 font-sans\">\n <Container className=\"mx-auto my-[40px] max-w-[465px] rounded-xl border border-solid border-[#eaeaea] bg-white p-[20px]\">\n <Section className=\"mt-[32px]\">\n <Img\n src={`https://intlayer.org/favicon-32x32.png`}\n width=\"40\"\n height=\"37\"\n alt=\"Intlayer\"\n className=\"mx-auto my-0\"\n />\n </Section>\n <Heading className=\"mx-0 my-[30px] p-0 text-center text-[24px] font-normal text-black\">\n Votre mot de passe a été modifié\n </Heading>\n <Text className=\"text-[14px] leading-[24px] text-black\">\n Bonjour {username},\n </Text>\n <Text className=\"text-[14px] leading-[24px] text-black\">\n Cet email confirme que votre mot de passe pour votre compte{' '}\n <strong>Intlayer</strong> a été changé avec succès.\n </Text>\n <Text className=\"text-[14px] leading-[24px] text-black\">\n Si vous n'avez pas effectué ce changement ou si vous pensez qu'une\n personne non autorisée a accédé à votre compte, veuillez nous\n contacter immédiatement en répondant à cet email.\n </Text>\n <Hr className=\"mx-0 my-[26px] w-full border border-solid border-[#eaeaea]\" />\n <Text className=\"text-[12px] leading-[24px] text-[#666666]\">\n Si vous avez des questions ou avez besoin d'assistance\n supplémentaire, n'hésitez pas à nous contacter. Nous sommes là\n pour vous aider !\n </Text>\n </Container>\n </Body>\n </Tailwind>\n </Html>\n );\n};\n\nexport const PasswordChangeConfirmationEmailES = ({\n username,\n}: PasswordChangeConfirmationEmailProps) => {\n const previewText = `Tu contraseña de Intlayer ha sido cambiada`;\n\n return (\n <Html>\n <Head />\n <Preview>{previewText}</Preview>\n <Tailwind>\n <Body className=\"m-auto px-2 font-sans\">\n <Container className=\"mx-auto my-[40px] max-w-[465px] rounded-xl border border-solid border-[#eaeaea] bg-white p-[20px]\">\n <Section className=\"mt-[32px]\">\n <Img\n src={`https://intlayer.org/favicon-32x32.png`}\n width=\"40\"\n height=\"37\"\n alt=\"Intlayer\"\n className=\"mx-auto my-0\"\n />\n </Section>\n <Heading className=\"mx-0 my-[30px] p-0 text-center text-[24px] font-normal text-black\">\n Tu contraseña ha sido cambiada\n </Heading>\n <Text className=\"text-[14px] leading-[24px] text-black\">\n Hola {username},\n </Text>\n <Text className=\"text-[14px] leading-[24px] text-black\">\n Este correo es para confirmar que la contraseña de tu cuenta en{' '}\n <strong>Intlayer</strong> ha sido cambiada exitosamente.\n </Text>\n <Text className=\"text-[14px] leading-[24px] text-black\">\n Si no realizaste este cambio o crees que una persona no autorizada\n ha accedido a tu cuenta, por favor contáctanos inmediatamente\n respondiendo a este correo electrónico.\n </Text>\n <Hr className=\"mx-0 my-[26px] w-full border border-solid border-[#eaeaea]\" />\n <Text className=\"text-[12px] leading-[24px] text-[#666666]\">\n Si tienes alguna pregunta o necesitas asistencia adicional, no\n dudes en ponerte en contacto con nosotros. ¡Estamos aquí para\n ayudarte!\n </Text>\n </Container>\n </Body>\n </Tailwind>\n </Html>\n );\n};\n\nconst PreviewProps: PasswordChangeConfirmationEmailProps = {\n username: 'alanturing',\n};\n\nPasswordChangeConfirmationEmailEN.PreviewProps = PreviewProps;\nPasswordChangeConfirmationEmailFR.PreviewProps = PreviewProps;\nPasswordChangeConfirmationEmailES.PreviewProps = PreviewProps;\n"],"mappings":"AAyBM,cAiBM,YAjBN;AAzBN;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAMA,MAAM,oCAAoC,CAAC;AAAA,EAChD;AACF,MAA4C;AAC1C,QAAM,cAAc;AAEpB,SACE,qBAAC,QACC;AAAA,wBAAC,QAAK;AAAA,IACN,oBAAC,WAAS,uBAAY;AAAA,IACtB,oBAAC,YACC,8BAAC,QAAK,WAAU,yBACd,+BAAC,aAAU,WAAU,qGACnB;AAAA,0BAAC,WAAQ,WAAU,aACjB;AAAA,QAAC;AAAA;AAAA,UACC,KAAK;AAAA,UACL,OAAM;AAAA,UACN,QAAO;AAAA,UACP,KAAI;AAAA,UACJ,WAAU;AAAA;AAAA,MACZ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,oCAAoC,CAAC;AAAA,EAChD;AACF,MAA4C;AAC1C,QAAM,cAAc;AAEpB,SACE,qBAAC,QACC;AAAA,wBAAC,QAAK;AAAA,IACN,oBAAC,WAAS,uBAAY;AAAA,IACtB,oBAAC,YACC,8BAAC,QAAK,WAAU,yBACd,+BAAC,aAAU,WAAU,qGACnB;AAAA,0BAAC,WAAQ,WAAU,aACjB;AAAA,QAAC;AAAA;AAAA,UACC,KAAK;AAAA,UACL,OAAM;AAAA,UACN,QAAO;AAAA,UACP,KAAI;AAAA,UACJ,WAAU;AAAA;AAAA,MACZ,GACF;AAAA,MACA,oBAAC,WAAQ,WAAU,qEAAoE,+CAEvF;AAAA,MACA,qBAAC,QAAK,WAAU,yCAAwC;AAAA;AAAA,QAChD;AAAA,QAAS;AAAA,SACjB;AAAA,MACA,qBAAC,QAAK,WAAU,yCAAwC;AAAA;AAAA,QACU;AAAA,QAChE,oBAAC,YAAO,sBAAQ;AAAA,QAAS;AAAA,SAC3B;AAAA,MACA,oBAAC,QAAK,WAAU,yCAAwC,4LAIxD;AAAA,MACA,oBAAC,MAAG,WAAU,8DAA6D;AAAA,MAC3E,oBAAC,QAAK,WAAU,6CAA4C,0JAI5D;AAAA,OACF,GACF,GACF;AAAA,KACF;AAEJ;AAEA,MAAM,eAAqD;AAAA,EACzD,UAAU;AACZ;AAEA,kCAAkC,eAAe;AACjD,kCAAkC,eAAe;AACjD,kCAAkC,eAAe;","names":[]}
|
|
@@ -26,7 +26,7 @@ const ResetPasswordEmailEN = ({
|
|
|
26
26
|
/* @__PURE__ */ jsx(Section, { className: "mt-[32px]", children: /* @__PURE__ */ jsx(
|
|
27
27
|
Img,
|
|
28
28
|
{
|
|
29
|
-
src: `https://intlayer.org/
|
|
29
|
+
src: `https://intlayer.org/favicon-32x32.png`,
|
|
30
30
|
width: "40",
|
|
31
31
|
height: "37",
|
|
32
32
|
alt: "Intlayer",
|
|
@@ -83,7 +83,7 @@ const ResetPasswordEmailFR = ({
|
|
|
83
83
|
/* @__PURE__ */ jsx(Section, { className: "mt-[32px]", children: /* @__PURE__ */ jsx(
|
|
84
84
|
Img,
|
|
85
85
|
{
|
|
86
|
-
src: `https://intlayer.org/
|
|
86
|
+
src: `https://intlayer.org/favicon-32x32.png`,
|
|
87
87
|
width: "40",
|
|
88
88
|
height: "37",
|
|
89
89
|
alt: "Intlayer",
|
|
@@ -139,7 +139,7 @@ const ResetPasswordEmailES = ({
|
|
|
139
139
|
/* @__PURE__ */ jsx(Section, { className: "mt-[32px]", children: /* @__PURE__ */ jsx(
|
|
140
140
|
Img,
|
|
141
141
|
{
|
|
142
|
-
src: `https://intlayer.org/
|
|
142
|
+
src: `https://intlayer.org/favicon-32x32.png`,
|
|
143
143
|
width: "40",
|
|
144
144
|
height: "37",
|
|
145
145
|
alt: "Intlayer",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/emails/ResetUserPassword.tsx"],"sourcesContent":["import {\n Body,\n Button,\n Container,\n Head,\n Heading,\n Hr,\n Html,\n Img,\n Link,\n Preview,\n Section,\n Text,\n Tailwind,\n} from '@react-email/components';\n\nexport type ResetPasswordEmailProps = {\n username: string;\n resetLink: string;\n};\n\nexport const ResetPasswordEmailEN = ({\n username,\n resetLink,\n}: ResetPasswordEmailProps) => {\n const previewText = `Reset your password for Intlayer`;\n\n return (\n <Html>\n <Head />\n <Preview>{previewText}</Preview>\n <Tailwind>\n <Body className=\"m-auto px-2 font-sans\">\n <Container className=\"mx-auto my-[40px] max-w-[465px] rounded-xl border border-solid border-[#eaeaea] bg-white p-[20px]\">\n <Section className=\"mt-[32px]\">\n <Img\n src={`https://intlayer.org/assets/favicon-32x32.png`}\n width=\"40\"\n height=\"37\"\n alt=\"Intlayer\"\n className=\"mx-auto my-0\"\n />\n </Section>\n <Heading className=\"mx-0 my-[30px] p-0 text-center text-[24px] font-normal text-black\">\n Reset your password for <strong>Intlayer</strong>\n </Heading>\n <Text className=\"text-[14px] leading-[24px] text-black\">\n Hello {username},\n </Text>\n <Text className=\"text-[14px] leading-[24px] text-black\">\n We received a request to reset your password for your{' '}\n <strong>Intlayer</strong> account.\n </Text>\n\n <Section className=\"my-[32px] text-center\">\n <Button\n className=\"rounded-md bg-[#000000] px-5 py-3 text-center text-[12px] font-semibold text-white no-underline\"\n href={resetLink}\n >\n Reset Password\n </Button>\n </Section>\n <Text className=\"text-[14px] leading-[24px] text-black\">\n or copy and paste this URL into your browser:{' '}\n <Link href={resetLink} className=\"text-[#E879BA] no-underline\">\n {resetLink}\n </Link>\n </Text>\n <Hr className=\"mx-0 my-[26px] w-full border border-solid border-[#eaeaea]\" />\n <Text className=\"text-[12px] leading-[24px] text-[#666666]\">\n This password reset request was intended for{' '}\n <span className=\"text-black\">{username}</span>. If you did not\n request a password reset, you can ignore this email. If you are\n concerned about your account's safety, please reply to this email\n to get in touch with us.\n </Text>\n </Container>\n </Body>\n </Tailwind>\n </Html>\n );\n};\n\nexport const ResetPasswordEmailFR = ({\n username,\n resetLink,\n}: ResetPasswordEmailProps) => {\n const previewText = `Réinitialisez votre mot de passe pour Intlayer`;\n\n return (\n <Html>\n <Head />\n <Preview>{previewText}</Preview>\n <Tailwind>\n <Body className=\"m-auto px-2 font-sans\">\n <Container className=\"mx-auto my-[40px] max-w-[465px] rounded-xl border border-solid border-[#eaeaea] bg-white p-[20px]\">\n <Section className=\"mt-[32px]\">\n <Img\n src={`https://intlayer.org/assets/favicon-32x32.png`}\n width=\"40\"\n height=\"37\"\n alt=\"Intlayer\"\n className=\"mx-auto my-0\"\n />\n </Section>\n <Heading className=\"mx-0 my-[30px] p-0 text-center text-[24px] font-normal text-black\">\n Réinitialisez votre mot de passe pour <strong>Intlayer</strong>\n </Heading>\n <Text className=\"text-[14px] leading-[24px] text-black\">\n Bonjour {username},\n </Text>\n <Text className=\"text-[14px] leading-[24px] text-black\">\n Nous avons reçu une demande de réinitialisation de votre mot de\n passe pour votre compte <strong>Intlayer</strong>.\n </Text>\n <Section className=\"my-[32px] text-center\">\n <Button\n className=\"rounded-md bg-[#000000] px-5 py-3 text-center text-[12px] font-semibold text-white no-underline\"\n href={resetLink}\n >\n Réinitialiser le mot de passe\n </Button>\n </Section>\n <Text className=\"text-[14px] leading-[24px] text-black\">\n ou copiez et collez cette URL dans votre navigateur :{' '}\n <Link href={resetLink} className=\"text-[#E879BA] no-underline\">\n {resetLink}\n </Link>\n </Text>\n <Hr className=\"mx-0 my-[26px] w-full border border-solid border-[#eaeaea]\" />\n <Text className=\"text-[12px] leading-[24px] text-[#666666]\">\n Cette demande de réinitialisation de mot de passe était destinée à{' '}\n <span className=\"text-black\">{username}</span>. Si vous n'avez pas\n demandé une réinitialisation de mot de passe, vous pouvez ignorer\n cet email. Si vous êtes préoccupé par la sécurité de votre compte,\n veuillez répondre à cet email pour nous contacter.\n </Text>\n </Container>\n </Body>\n </Tailwind>\n </Html>\n );\n};\n\nexport const ResetPasswordEmailES = ({\n username,\n resetLink,\n}: ResetPasswordEmailProps) => {\n const previewText = `Restablece tu contraseña para Intlayer`;\n\n return (\n <Html>\n <Head />\n <Preview>{previewText}</Preview>\n <Tailwind>\n <Body className=\"m-auto px-2 font-sans\">\n <Container className=\"mx-auto my-[40px] max-w-[465px] rounded-xl border border-solid border-[#eaeaea] bg-white p-[20px]\">\n <Section className=\"mt-[32px]\">\n <Img\n src={`https://intlayer.org/assets/favicon-32x32.png`}\n width=\"40\"\n height=\"37\"\n alt=\"Intlayer\"\n className=\"mx-auto my-0\"\n />\n </Section>\n <Heading className=\"mx-0 my-[30px] p-0 text-center text-[24px] font-normal text-black\">\n Restablece tu contraseña para <strong>Intlayer</strong>\n </Heading>\n <Text className=\"text-[14px] leading-[24px] text-black\">\n Hola {username},\n </Text>\n <Text className=\"text-[14px] leading-[24px] text-black\">\n Hemos recibido una solicitud para restablecer tu contraseña de tu\n cuenta en <strong>Intlayer</strong>.\n </Text>\n <Section className=\"my-[32px] text-center\">\n <Button\n className=\"rounded-md bg-[#000000] px-5 py-3 text-center text-[12px] font-semibold text-white no-underline\"\n href={resetLink}\n >\n Restablecer Contraseña\n </Button>\n </Section>\n <Text className=\"text-[14px] leading-[24px] text-black\">\n o copia y pega esta URL en tu navegador:{' '}\n <Link href={resetLink} className=\"text-[#E879BA] no-underline\">\n {resetLink}\n </Link>\n </Text>\n <Hr className=\"mx-0 my-[26px] w-full border border-solid border-[#eaeaea]\" />\n <Text className=\"text-[12px] leading-[24px] text-[#666666]\">\n Esta solicitud de restablecimiento de contraseña estaba destinada\n a <span className=\"text-black\">{username}</span>. Si no\n solicitaste un restablecimiento de contraseña, puedes ignorar este\n correo. Si estás preocupado por la seguridad de tu cuenta, por\n favor responde a este correo para ponerte en contacto con\n nosotros.\n </Text>\n </Container>\n </Body>\n </Tailwind>\n </Html>\n );\n};\n\nconst PreviewProps: ResetPasswordEmailProps = {\n username: 'alanturing',\n resetLink: 'https://intlayer.org/reset/foo',\n};\n\nResetPasswordEmailEN.PreviewProps = PreviewProps;\nResetPasswordEmailFR.PreviewProps = PreviewProps;\nResetPasswordEmailES.PreviewProps = PreviewProps;\n"],"mappings":"AA6BM,cAcM,YAdN;AA7BN;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAOA,MAAM,uBAAuB,CAAC;AAAA,EACnC;AAAA,EACA;AACF,MAA+B;AAC7B,QAAM,cAAc;AAEpB,SACE,qBAAC,QACC;AAAA,wBAAC,QAAK;AAAA,IACN,oBAAC,WAAS,uBAAY;AAAA,IACtB,oBAAC,YACC,8BAAC,QAAK,WAAU,yBACd,+BAAC,aAAU,WAAU,qGACnB;AAAA,0BAAC,WAAQ,WAAU,aACjB;AAAA,QAAC;AAAA;AAAA,UACC,KAAK;AAAA,UACL,OAAM;AAAA,UACN,QAAO;AAAA,UACP,KAAI;AAAA,UACJ,WAAU;AAAA;AAAA,M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,yCAAwC;AAAA;AAAA,QAE5C,oBAAC,YAAO,sBAAQ;AAAA,QAAS;AAAA,SACrC;AAAA,MACA,oBAAC,WAAQ,WAAU,yBACjB;AAAA,QAAC;AAAA;AAAA,UACC,WAAU;AAAA,UACV,MAAM;AAAA,UACP;AAAA;AAAA,MAED,GACF;AAAA,MACA,qBAAC,QAAK,WAAU,yCAAwC;AAAA;AAAA,QACb;AAAA,QACzC,oBAAC,QAAK,MAAM,WAAW,WAAU,+BAC9B,qBACH;AAAA,SACF;AAAA,MACA,oBAAC,MAAG,WAAU,8DAA6D;AAAA,MAC3E,qBAAC,QAAK,WAAU,6CAA4C;AAAA;AAAA,QAExD,oBAAC,UAAK,WAAU,cAAc,oBAAS;AAAA,QAAO;AAAA,SAKlD;AAAA,OACF,GACF,GACF;AAAA,KACF;AAEJ;AAEA,MAAM,eAAwC;AAAA,EAC5C,UAAU;AAAA,EACV,WAAW;AACb;AAEA,qBAAqB,eAAe;AACpC,qBAAqB,eAAe;AACpC,qBAAqB,eAAe;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../src/emails/ResetUserPassword.tsx"],"sourcesContent":["import {\n Body,\n Button,\n Container,\n Head,\n Heading,\n Hr,\n Html,\n Img,\n Link,\n Preview,\n Section,\n Text,\n Tailwind,\n} from '@react-email/components';\n\nexport type ResetPasswordEmailProps = {\n username: string;\n resetLink: string;\n};\n\nexport const ResetPasswordEmailEN = ({\n username,\n resetLink,\n}: ResetPasswordEmailProps) => {\n const previewText = `Reset your password for Intlayer`;\n\n return (\n <Html>\n <Head />\n <Preview>{previewText}</Preview>\n <Tailwind>\n <Body className=\"m-auto px-2 font-sans\">\n <Container className=\"mx-auto my-[40px] max-w-[465px] rounded-xl border border-solid border-[#eaeaea] bg-white p-[20px]\">\n <Section className=\"mt-[32px]\">\n <Img\n src={`https://intlayer.org/favicon-32x32.png`}\n width=\"40\"\n height=\"37\"\n alt=\"Intlayer\"\n className=\"mx-auto my-0\"\n />\n </Section>\n <Heading className=\"mx-0 my-[30px] p-0 text-center text-[24px] font-normal text-black\">\n Reset your password for <strong>Intlayer</strong>\n </Heading>\n <Text className=\"text-[14px] leading-[24px] text-black\">\n Hello {username},\n </Text>\n <Text className=\"text-[14px] leading-[24px] text-black\">\n We received a request to reset your password for your{' '}\n <strong>Intlayer</strong> account.\n </Text>\n\n <Section className=\"my-[32px] text-center\">\n <Button\n className=\"rounded-md bg-[#000000] px-5 py-3 text-center text-[12px] font-semibold text-white no-underline\"\n href={resetLink}\n >\n Reset Password\n </Button>\n </Section>\n <Text className=\"text-[14px] leading-[24px] text-black\">\n or copy and paste this URL into your browser:{' '}\n <Link href={resetLink} className=\"text-[#E879BA] no-underline\">\n {resetLink}\n </Link>\n </Text>\n <Hr className=\"mx-0 my-[26px] w-full border border-solid border-[#eaeaea]\" />\n <Text className=\"text-[12px] leading-[24px] text-[#666666]\">\n This password reset request was intended for{' '}\n <span className=\"text-black\">{username}</span>. If you did not\n request a password reset, you can ignore this email. If you are\n concerned about your account's safety, please reply to this email\n to get in touch with us.\n </Text>\n </Container>\n </Body>\n </Tailwind>\n </Html>\n );\n};\n\nexport const ResetPasswordEmailFR = ({\n username,\n resetLink,\n}: ResetPasswordEmailProps) => {\n const previewText = `Réinitialisez votre mot de passe pour Intlayer`;\n\n return (\n <Html>\n <Head />\n <Preview>{previewText}</Preview>\n <Tailwind>\n <Body className=\"m-auto px-2 font-sans\">\n <Container className=\"mx-auto my-[40px] max-w-[465px] rounded-xl border border-solid border-[#eaeaea] bg-white p-[20px]\">\n <Section className=\"mt-[32px]\">\n <Img\n src={`https://intlayer.org/favicon-32x32.png`}\n width=\"40\"\n height=\"37\"\n alt=\"Intlayer\"\n className=\"mx-auto my-0\"\n />\n </Section>\n <Heading className=\"mx-0 my-[30px] p-0 text-center text-[24px] font-normal text-black\">\n Réinitialisez votre mot de passe pour <strong>Intlayer</strong>\n </Heading>\n <Text className=\"text-[14px] leading-[24px] text-black\">\n Bonjour {username},\n </Text>\n <Text className=\"text-[14px] leading-[24px] text-black\">\n Nous avons reçu une demande de réinitialisation de votre mot de\n passe pour votre compte <strong>Intlayer</strong>.\n </Text>\n <Section className=\"my-[32px] text-center\">\n <Button\n className=\"rounded-md bg-[#000000] px-5 py-3 text-center text-[12px] font-semibold text-white no-underline\"\n href={resetLink}\n >\n Réinitialiser le mot de passe\n </Button>\n </Section>\n <Text className=\"text-[14px] leading-[24px] text-black\">\n ou copiez et collez cette URL dans votre navigateur :{' '}\n <Link href={resetLink} className=\"text-[#E879BA] no-underline\">\n {resetLink}\n </Link>\n </Text>\n <Hr className=\"mx-0 my-[26px] w-full border border-solid border-[#eaeaea]\" />\n <Text className=\"text-[12px] leading-[24px] text-[#666666]\">\n Cette demande de réinitialisation de mot de passe était destinée à{' '}\n <span className=\"text-black\">{username}</span>. Si vous n'avez pas\n demandé une réinitialisation de mot de passe, vous pouvez ignorer\n cet email. Si vous êtes préoccupé par la sécurité de votre compte,\n veuillez répondre à cet email pour nous contacter.\n </Text>\n </Container>\n </Body>\n </Tailwind>\n </Html>\n );\n};\n\nexport const ResetPasswordEmailES = ({\n username,\n resetLink,\n}: ResetPasswordEmailProps) => {\n const previewText = `Restablece tu contraseña para Intlayer`;\n\n return (\n <Html>\n <Head />\n <Preview>{previewText}</Preview>\n <Tailwind>\n <Body className=\"m-auto px-2 font-sans\">\n <Container className=\"mx-auto my-[40px] max-w-[465px] rounded-xl border border-solid border-[#eaeaea] bg-white p-[20px]\">\n <Section className=\"mt-[32px]\">\n <Img\n src={`https://intlayer.org/favicon-32x32.png`}\n width=\"40\"\n height=\"37\"\n alt=\"Intlayer\"\n className=\"mx-auto my-0\"\n />\n </Section>\n <Heading className=\"mx-0 my-[30px] p-0 text-center text-[24px] font-normal text-black\">\n Restablece tu contraseña para <strong>Intlayer</strong>\n </Heading>\n <Text className=\"text-[14px] leading-[24px] text-black\">\n Hola {username},\n </Text>\n <Text className=\"text-[14px] leading-[24px] text-black\">\n Hemos recibido una solicitud para restablecer tu contraseña de tu\n cuenta en <strong>Intlayer</strong>.\n </Text>\n <Section className=\"my-[32px] text-center\">\n <Button\n className=\"rounded-md bg-[#000000] px-5 py-3 text-center text-[12px] font-semibold text-white no-underline\"\n href={resetLink}\n >\n Restablecer Contraseña\n </Button>\n </Section>\n <Text className=\"text-[14px] leading-[24px] text-black\">\n o copia y pega esta URL en tu navegador:{' '}\n <Link href={resetLink} className=\"text-[#E879BA] no-underline\">\n {resetLink}\n </Link>\n </Text>\n <Hr className=\"mx-0 my-[26px] w-full border border-solid border-[#eaeaea]\" />\n <Text className=\"text-[12px] leading-[24px] text-[#666666]\">\n Esta solicitud de restablecimiento de contraseña estaba destinada\n a <span className=\"text-black\">{username}</span>. Si no\n solicitaste un restablecimiento de contraseña, puedes ignorar este\n correo. Si estás preocupado por la seguridad de tu cuenta, por\n favor responde a este correo para ponerte en contacto con\n nosotros.\n </Text>\n </Container>\n </Body>\n </Tailwind>\n </Html>\n );\n};\n\nconst PreviewProps: ResetPasswordEmailProps = {\n username: 'alanturing',\n resetLink: 'https://intlayer.org/reset/foo',\n};\n\nResetPasswordEmailEN.PreviewProps = PreviewProps;\nResetPasswordEmailFR.PreviewProps = PreviewProps;\nResetPasswordEmailES.PreviewProps = PreviewProps;\n"],"mappings":"AA6BM,cAcM,YAdN;AA7BN;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAOA,MAAM,uBAAuB,CAAC;AAAA,EACnC;AAAA,EACA;AACF,MAA+B;AAC7B,QAAM,cAAc;AAEpB,SACE,qBAAC,QACC;AAAA,wBAAC,QAAK;AAAA,IACN,oBAAC,WAAS,uBAAY;AAAA,IACtB,oBAAC,YACC,8BAAC,QAAK,WAAU,yBACd,+BAAC,aAAU,WAAU,qGACnB;AAAA,0BAAC,WAAQ,WAAU,aACjB;AAAA,QAA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