@rodrigobeber/patoai-dtos 4.7.41 → 4.7.42
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.
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AGENT_FRIENDLY_VARIABLES = void 0;
|
|
4
|
+
exports.expandFriendlyVariables = expandFriendlyVariables;
|
|
5
|
+
exports.AGENT_FRIENDLY_VARIABLES = [
|
|
6
|
+
{ key: 'nomeAgente', label: 'Nome do agente', template: '{{crew.person}}' },
|
|
7
|
+
{
|
|
8
|
+
key: 'artigoNomeAgente',
|
|
9
|
+
label: 'Nome do agente com artigo',
|
|
10
|
+
template: '{{crew.article}} {{crew.person}}',
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
key: 'preposicaoNomeAgente',
|
|
14
|
+
label: 'Nome do agente com preposição',
|
|
15
|
+
template: '{{crew.de}} {{crew.person}}',
|
|
16
|
+
},
|
|
17
|
+
];
|
|
18
|
+
const FRIENDLY_MAP = Object.fromEntries(exports.AGENT_FRIENDLY_VARIABLES.map((v) => [v.key, v.template]));
|
|
19
|
+
// Troca @var[key] pelo template {{crew.*}}. Chave desconhecida: deixa o trecho como está (sem quebrar).
|
|
20
|
+
function expandFriendlyVariables(text) {
|
|
21
|
+
if (!text)
|
|
22
|
+
return text;
|
|
23
|
+
return text.replace(/@var\[([^\]]+)\]/g, (match, key) => { var _a; return (_a = FRIENDLY_MAP[String(key).trim()]) !== null && _a !== void 0 ? _a : match; });
|
|
24
|
+
}
|
package/dist/crew/index.d.ts
CHANGED
package/dist/crew/index.js
CHANGED
|
@@ -17,6 +17,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
__exportStar(require("./crew.dto"), exports);
|
|
18
18
|
__exportStar(require("./crew-completion.dto"), exports);
|
|
19
19
|
__exportStar(require("./gender-tokens"), exports);
|
|
20
|
+
__exportStar(require("./friendly-variables"), exports);
|
|
20
21
|
__exportStar(require("./follow-up-mode.enum"), exports);
|
|
21
22
|
__exportStar(require("./get-provider.dto"), exports);
|
|
22
23
|
__exportStar(require("./online-mode.enum"), exports);
|