deploy-webapp 1.0.17 → 1.0.20
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/0.1_migrator.js +5 -10
- package/dist/0_index.js +1 -15
- package/dist/utils/constants.js +2 -6
- package/install.js +36 -89
- package/package.json +1 -1
- package/src/utils/ids.csv +2 -1
- package/src/utils/updateWorkflow.json +2 -2
package/dist/0.1_migrator.js
CHANGED
|
@@ -54,21 +54,16 @@ const runMigration = async () => {
|
|
|
54
54
|
(0, console_1.log)(`${constants_1.cor.Yellow}Históricos limpos. Iniciando migração...${constants_1.cor.Reset}`);
|
|
55
55
|
const access_token_qa = await (0, qa_client_1.loginQA)(constants_1.client, constants_1.serviceKey, constants_1.emailLoginQA, constants_1.passwordLoginQA);
|
|
56
56
|
const access_token_prod = await (0, prod_client_1.loginPROD)(constants_1.client, constants_1.serviceKey, constants_1.emailLoginPROD, constants_1.passwordLoginPROD);
|
|
57
|
-
// Procurar arquivos na
|
|
57
|
+
// Procurar arquivos na raiz do projeto (process.cwd())
|
|
58
58
|
const projectRoot = process.cwd();
|
|
59
|
-
const
|
|
60
|
-
const
|
|
61
|
-
const csvFilePath = path.resolve(deployWebappDir, "ids.csv");
|
|
62
|
-
// Verificar se a pasta deployWebapp existe
|
|
63
|
-
if (!fs.existsSync(deployWebappDir)) {
|
|
64
|
-
throw new Error(`Pasta deployWebapp não encontrada em: ${projectRoot}\nCertifique-se de que o pacote foi instalado corretamente.`);
|
|
65
|
-
}
|
|
59
|
+
const updateWorkflow = path.resolve(projectRoot, "updateWorkflow.json");
|
|
60
|
+
const csvFilePath = path.resolve(projectRoot, "ids.csv");
|
|
66
61
|
// Verificar se os arquivos existem
|
|
67
62
|
if (!fs.existsSync(updateWorkflow)) {
|
|
68
|
-
throw new Error(`Arquivo updateWorkflow.json não encontrado em: ${
|
|
63
|
+
throw new Error(`Arquivo updateWorkflow.json não encontrado em: ${projectRoot}\nCertifique-se de que o arquivo está na raiz do projeto.`);
|
|
69
64
|
}
|
|
70
65
|
if (!fs.existsSync(csvFilePath)) {
|
|
71
|
-
throw new Error(`Arquivo ids.csv não encontrado em: ${
|
|
66
|
+
throw new Error(`Arquivo ids.csv não encontrado em: ${projectRoot}\nCertifique-se de que o arquivo está na raiz do projeto.`);
|
|
72
67
|
}
|
|
73
68
|
const getUpdateWorkflow = fs.readFileSync(updateWorkflow, "utf8");
|
|
74
69
|
const updateWorkflowData = JSON.parse(getUpdateWorkflow);
|
package/dist/0_index.js
CHANGED
|
@@ -5,24 +5,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.runMigration = void 0;
|
|
7
7
|
const dotenv_1 = __importDefault(require("dotenv"));
|
|
8
|
-
const fs_1 = __importDefault(require("fs"));
|
|
9
|
-
const path_1 = __importDefault(require("path"));
|
|
10
8
|
const _0_1_migrator_1 = require("./0.1_migrator");
|
|
11
9
|
Object.defineProperty(exports, "runMigration", { enumerable: true, get: function () { return _0_1_migrator_1.runMigration; } });
|
|
12
10
|
if (require.main === module) {
|
|
13
|
-
|
|
14
|
-
const projectRoot = process.cwd();
|
|
15
|
-
const deployWebappEnv = path_1.default.resolve(projectRoot, "deployWebapp", ".env");
|
|
16
|
-
const rootEnv = path_1.default.resolve(projectRoot, ".env");
|
|
17
|
-
if (fs_1.default.existsSync(deployWebappEnv)) {
|
|
18
|
-
dotenv_1.default.config({ path: deployWebappEnv });
|
|
19
|
-
}
|
|
20
|
-
else if (fs_1.default.existsSync(rootEnv)) {
|
|
21
|
-
dotenv_1.default.config({ path: rootEnv });
|
|
22
|
-
}
|
|
23
|
-
else {
|
|
24
|
-
dotenv_1.default.config(); // Fallback para comportamento padrão
|
|
25
|
-
}
|
|
11
|
+
dotenv_1.default.config();
|
|
26
12
|
(0, _0_1_migrator_1.runMigration)().catch(error => {
|
|
27
13
|
console.error("Migration failed:", error);
|
|
28
14
|
process.exit(1);
|
package/dist/utils/constants.js
CHANGED
|
@@ -13,14 +13,10 @@ exports.checkIdCreated = checkIdCreated;
|
|
|
13
13
|
const dotenv_1 = __importDefault(require("dotenv"));
|
|
14
14
|
const fs_1 = __importDefault(require("fs"));
|
|
15
15
|
const path_1 = __importDefault(require("path"));
|
|
16
|
-
// Carregar .env da
|
|
16
|
+
// Carregar .env da raiz do projeto
|
|
17
17
|
const projectRoot = process.cwd();
|
|
18
|
-
const deployWebappEnv = path_1.default.resolve(projectRoot, "deployWebapp", ".env");
|
|
19
18
|
const rootEnv = path_1.default.resolve(projectRoot, ".env");
|
|
20
|
-
if (fs_1.default.existsSync(
|
|
21
|
-
dotenv_1.default.config({ path: deployWebappEnv });
|
|
22
|
-
}
|
|
23
|
-
else if (fs_1.default.existsSync(rootEnv)) {
|
|
19
|
+
if (fs_1.default.existsSync(rootEnv)) {
|
|
24
20
|
dotenv_1.default.config({ path: rootEnv });
|
|
25
21
|
}
|
|
26
22
|
else {
|
package/install.js
CHANGED
|
@@ -41,71 +41,15 @@ function findProjectRoot(startPath) {
|
|
|
41
41
|
|
|
42
42
|
const projectRoot = findProjectRoot(packagePath);
|
|
43
43
|
|
|
44
|
-
//
|
|
45
|
-
const deployWebappDir = path.join(projectRoot, 'deployWebapp');
|
|
46
|
-
if (!fs.existsSync(deployWebappDir)) {
|
|
47
|
-
try {
|
|
48
|
-
fs.mkdirSync(deployWebappDir, { recursive: true });
|
|
49
|
-
console.log('✅ deploy-webapp: Pasta deployWebapp criada!');
|
|
50
|
-
} catch (error) {
|
|
51
|
-
console.error('❌ deploy-webapp: Erro ao criar pasta deployWebapp:', error.message);
|
|
52
|
-
process.exit(1);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
// Criar package.json dentro de deployWebapp com as dependências necessárias
|
|
57
|
-
const deployWebappPackageJsonPath = path.join(deployWebappDir, 'package.json');
|
|
58
|
-
const deployWebappPackageJson = {
|
|
59
|
-
name: 'deploy-webapp-config',
|
|
60
|
-
version: '1.0.0',
|
|
61
|
-
description: 'Configuração do deploy-webapp',
|
|
62
|
-
private: true,
|
|
63
|
-
dependencies: {
|
|
64
|
-
'deploy-webapp': require(path.join(packagePath, 'package.json')).version || 'latest',
|
|
65
|
-
'dotenv': '^17.2.3'
|
|
66
|
-
},
|
|
67
|
-
scripts: {
|
|
68
|
-
start: 'node migrate.js',
|
|
69
|
-
migrate: 'node migrate.js'
|
|
70
|
-
}
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
if (!fs.existsSync(deployWebappPackageJsonPath)) {
|
|
74
|
-
try {
|
|
75
|
-
fs.writeFileSync(deployWebappPackageJsonPath, JSON.stringify(deployWebappPackageJson, null, 2), 'utf8');
|
|
76
|
-
console.log('✅ deploy-webapp: package.json criado em deployWebapp/!');
|
|
77
|
-
|
|
78
|
-
// Instalar dependências dentro de deployWebapp
|
|
79
|
-
console.log('📦 deploy-webapp: Instalando dependências em deployWebapp/...');
|
|
80
|
-
const { execSync } = require('child_process');
|
|
81
|
-
try {
|
|
82
|
-
execSync('npm install', {
|
|
83
|
-
cwd: deployWebappDir,
|
|
84
|
-
stdio: 'inherit',
|
|
85
|
-
shell: true
|
|
86
|
-
});
|
|
87
|
-
console.log('✅ deploy-webapp: Dependências instaladas em deployWebapp/node_modules!');
|
|
88
|
-
} catch (error) {
|
|
89
|
-
console.error('⚠️ deploy-webapp: Erro ao instalar dependências. Execute manualmente: cd deployWebapp && npm install');
|
|
90
|
-
}
|
|
91
|
-
} catch (error) {
|
|
92
|
-
console.error('❌ deploy-webapp: Erro ao criar package.json:', error.message);
|
|
93
|
-
}
|
|
94
|
-
} else {
|
|
95
|
-
console.log('ℹ️ deploy-webapp: package.json já existe em deployWebapp/.');
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
// Arquivos a serem copiados (com seus caminhos de origem) - dentro da pasta deployWebapp
|
|
44
|
+
// Arquivos a serem copiados (com seus caminhos de origem)
|
|
99
45
|
const filesToCopy = [
|
|
100
|
-
{ source: path.join(utilsPath, 'ids.csv'), dest:
|
|
101
|
-
{ source: path.join(utilsPath, 'updateWorkflow.json'), dest:
|
|
102
|
-
{ source: path.join(packagePath, 'README.md'), dest:
|
|
46
|
+
{ source: path.join(utilsPath, 'ids.csv'), dest: 'ids.csv' },
|
|
47
|
+
{ source: path.join(utilsPath, 'updateWorkflow.json'), dest: 'updateWorkflow.json' },
|
|
48
|
+
{ source: path.join(packagePath, 'README.md'), dest: 'README.md' }
|
|
103
49
|
];
|
|
104
50
|
|
|
105
|
-
// Conteúdo do arquivo migrate.js a ser criado
|
|
106
|
-
const migrateJsContent = "
|
|
107
|
-
"require('dotenv').config({ path: path.resolve(__dirname, '.env') });\n" +
|
|
108
|
-
"// Usar deploy-webapp do node_modules local (dentro de deployWebapp)\n" +
|
|
51
|
+
// Conteúdo do arquivo migrate.js a ser criado
|
|
52
|
+
const migrateJsContent = "require('dotenv').config();\n" +
|
|
109
53
|
"const { runMigration } = require('deploy-webapp');\n\n" +
|
|
110
54
|
"console.log('🚀 Iniciando deploy...');\n\n" +
|
|
111
55
|
"runMigration()\n" +
|
|
@@ -183,32 +127,32 @@ filesToCopy.forEach(({ source, dest }) => {
|
|
|
183
127
|
}
|
|
184
128
|
});
|
|
185
129
|
|
|
186
|
-
// Criar arquivo migrate.js
|
|
187
|
-
const migrateJsPath = path.join(
|
|
130
|
+
// Criar arquivo migrate.js se não existir
|
|
131
|
+
const migrateJsPath = path.join(projectRoot, 'migrate.js');
|
|
188
132
|
if (!fs.existsSync(migrateJsPath)) {
|
|
189
133
|
try {
|
|
190
134
|
fs.writeFileSync(migrateJsPath, migrateJsContent, 'utf8');
|
|
191
|
-
console.log('✅ deploy-webapp: migrate.js criado
|
|
135
|
+
console.log('✅ deploy-webapp: migrate.js criado com sucesso!');
|
|
192
136
|
copiedCount++;
|
|
193
137
|
} catch (error) {
|
|
194
138
|
console.error('❌ deploy-webapp: Erro ao criar migrate.js:', error.message);
|
|
195
139
|
}
|
|
196
140
|
} else {
|
|
197
|
-
console.log('ℹ️ deploy-webapp: migrate.js já existe
|
|
141
|
+
console.log('ℹ️ deploy-webapp: migrate.js já existe, mantendo arquivo existente.');
|
|
198
142
|
}
|
|
199
143
|
|
|
200
|
-
// Criar arquivo .env
|
|
201
|
-
const envPath = path.join(
|
|
144
|
+
// Criar arquivo .env se não existir
|
|
145
|
+
const envPath = path.join(projectRoot, '.env');
|
|
202
146
|
if (!fs.existsSync(envPath)) {
|
|
203
147
|
try {
|
|
204
148
|
fs.writeFileSync(envPath, envTemplateContent, 'utf8');
|
|
205
|
-
console.log('✅ deploy-webapp: .env criado
|
|
149
|
+
console.log('✅ deploy-webapp: .env criado com sucesso!');
|
|
206
150
|
copiedCount++;
|
|
207
151
|
} catch (error) {
|
|
208
152
|
console.error('❌ deploy-webapp: Erro ao criar .env:', error.message);
|
|
209
153
|
}
|
|
210
154
|
} else {
|
|
211
|
-
console.log('ℹ️ deploy-webapp: .env já existe
|
|
155
|
+
console.log('ℹ️ deploy-webapp: .env já existe, mantendo arquivo existente.');
|
|
212
156
|
}
|
|
213
157
|
|
|
214
158
|
// Atualizar package.json com scripts se necessário
|
|
@@ -217,7 +161,7 @@ if (fs.existsSync(packageJsonPath)) {
|
|
|
217
161
|
try {
|
|
218
162
|
let packageJson = {};
|
|
219
163
|
const packageJsonContent = fs.readFileSync(packageJsonPath, 'utf8');
|
|
220
|
-
|
|
164
|
+
|
|
221
165
|
// Tentar parsear o JSON, se falhar criar um novo objeto
|
|
222
166
|
try {
|
|
223
167
|
packageJson = JSON.parse(packageJsonContent);
|
|
@@ -225,9 +169,9 @@ if (fs.existsSync(packageJsonPath)) {
|
|
|
225
169
|
console.log('⚠️ deploy-webapp: package.json inválido, criando novo...');
|
|
226
170
|
packageJson = {};
|
|
227
171
|
}
|
|
228
|
-
|
|
172
|
+
|
|
229
173
|
let updated = false;
|
|
230
|
-
|
|
174
|
+
|
|
231
175
|
// Garantir que name e version existam
|
|
232
176
|
if (!packageJson.name) {
|
|
233
177
|
packageJson.name = path.basename(projectRoot);
|
|
@@ -237,30 +181,30 @@ if (fs.existsSync(packageJsonPath)) {
|
|
|
237
181
|
packageJson.version = '1.0.0';
|
|
238
182
|
updated = true;
|
|
239
183
|
}
|
|
240
|
-
|
|
184
|
+
|
|
241
185
|
// Criar scripts se não existir
|
|
242
186
|
if (!packageJson.scripts) {
|
|
243
187
|
packageJson.scripts = {};
|
|
244
188
|
updated = true;
|
|
245
189
|
}
|
|
246
|
-
|
|
190
|
+
|
|
247
191
|
// Adicionar script start se não existir ou se for diferente
|
|
248
|
-
if (!packageJson.scripts.start || packageJson.scripts.start !== '
|
|
249
|
-
packageJson.scripts.start = '
|
|
192
|
+
if (!packageJson.scripts.start || packageJson.scripts.start !== 'node migrate.js') {
|
|
193
|
+
packageJson.scripts.start = 'node migrate.js';
|
|
250
194
|
updated = true;
|
|
251
195
|
}
|
|
252
|
-
|
|
196
|
+
|
|
253
197
|
// Adicionar script migrate se não existir ou se for diferente
|
|
254
|
-
if (!packageJson.scripts.migrate || packageJson.scripts.migrate !== '
|
|
255
|
-
packageJson.scripts.migrate = '
|
|
198
|
+
if (!packageJson.scripts.migrate || packageJson.scripts.migrate !== 'node migrate.js') {
|
|
199
|
+
packageJson.scripts.migrate = 'node migrate.js';
|
|
256
200
|
updated = true;
|
|
257
201
|
}
|
|
258
|
-
|
|
202
|
+
|
|
259
203
|
// Garantir que dependencies existe
|
|
260
204
|
if (!packageJson.dependencies) {
|
|
261
205
|
packageJson.dependencies = {};
|
|
262
206
|
}
|
|
263
|
-
|
|
207
|
+
|
|
264
208
|
// Salvar sempre (mesmo que não tenha atualizado, garante formatação correta)
|
|
265
209
|
fs.writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2) + '\n', 'utf8');
|
|
266
210
|
if (updated) {
|
|
@@ -280,8 +224,11 @@ if (fs.existsSync(packageJsonPath)) {
|
|
|
280
224
|
name: path.basename(projectRoot),
|
|
281
225
|
version: '1.0.0',
|
|
282
226
|
scripts: {
|
|
283
|
-
start: '
|
|
284
|
-
migrate: '
|
|
227
|
+
start: 'node migrate.js',
|
|
228
|
+
migrate: 'node migrate.js'
|
|
229
|
+
},
|
|
230
|
+
dependencies: {
|
|
231
|
+
'deploy-webapp': require(path.join(packagePath, 'package.json')).version || 'latest'
|
|
285
232
|
}
|
|
286
233
|
};
|
|
287
234
|
fs.writeFileSync(packageJsonPath, JSON.stringify(newPackageJson, null, 2) + '\n', 'utf8');
|
|
@@ -294,13 +241,13 @@ if (fs.existsSync(packageJsonPath)) {
|
|
|
294
241
|
|
|
295
242
|
if (copiedCount > 0) {
|
|
296
243
|
console.log(`\n✨ deploy-webapp: ${copiedCount} arquivo(s) criado(s) automaticamente na raiz do projeto!`);
|
|
297
|
-
console.log(`\n📝 Arquivos criados em: ${
|
|
244
|
+
console.log(`\n📝 Arquivos criados em: ${projectRoot}`);
|
|
298
245
|
console.log('\n📋 Próximos passos:');
|
|
299
|
-
console.log(' 1. 🔐 Edite
|
|
300
|
-
console.log(' 2. ✏️ Edite
|
|
301
|
-
console.log(' 3. ✏️ Edite
|
|
246
|
+
console.log(' 1. 🔐 Edite .env com suas credenciais (substitua os valores de exemplo)');
|
|
247
|
+
console.log(' 2. ✏️ Edite ids.csv com os IDs dos workflows que deseja migrar');
|
|
248
|
+
console.log(' 3. ✏️ Edite updateWorkflow.json com suas configurações específicas');
|
|
302
249
|
console.log(' 4. 🚀 Execute: yarn start ou npm start\n');
|
|
303
|
-
console.log('💡 Dica: Tudo está configurado
|
|
250
|
+
console.log('💡 Dica: Tudo está configurado! Basta preencher os valores e executar yarn start!\n');
|
|
304
251
|
} else {
|
|
305
252
|
console.log('\nℹ️ deploy-webapp: Todos os arquivos já existem na raiz do projeto.');
|
|
306
253
|
console.log(' Execute: yarn start ou npm start para iniciar a migração.\n');
|
package/package.json
CHANGED
package/src/utils/ids.csv
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
{
|
|
2
|
-
"flow_form_id": "",
|
|
3
|
-
"updateWorkflowProtocolFunction": ""
|
|
2
|
+
"flow_form_id": "6c1d5b15-c4f7-4fd8-97fa-aa8522d0a20a",
|
|
3
|
+
"updateWorkflowProtocolFunction": "const tabChatListAreaReclamante = [\r\n \"5b2c64ba-4ca6-4a42-a5de-8f3f069fd0c2\", // Pendencia com reclamante 1 PROD RC\r\n \"48b76281-fea0-434e-b3e4-047a8e38a7d6\", // Pendencia com reclamante 2 PROD RC\r\n \"ba79e84a-70d3-4d86-b18a-d0649b1d368f\", // Pendencia com reclamante 3 PROD RC\r\n];\r\n\r\nconst tabChatListArea = [\r\n \"607b907a-7eb2-4ef2-b902-9513841de41f\", // Pendencia 1 PROD RC\r\n \"1bc17b34-50c8-4f2a-8049-1c5cabda8478\", // Pendencia 2 PROD RC\r\n \"f3682a6b-1f9c-40cb-ab37-efda6953e66a\", // Pendencia 3 PROD RC\r\n \"4d004afb-0ce8-4559-b95b-a9b450f71355\", // Pendenciar Área [Complemento] PROD RC\r\n \"d1eca09d-929e-40c5-9d7f-46ee9abf37dc\", // Pendenciar Área [Resposta Pendente] PROD RC\r\n];\r\n\r\nconst tabChatListReclamante = [\r\n \"75e43640-02b2-4d3a-a1ee-e7158c8c36ca\", // Pendenciar Reclamante PROD RC\r\n];\r\n\r\nconst tabChatListFechado = [\r\n \"8acf65df-6341-4448-ac88-ebac5e7524ba\", // Captura no cartão recusada PROD RC\r\n \"e609ad49-0d58-48fb-8521-932a3b39b450\", // Consulta CPF - LGPD PROD RC\r\n \"89d1b74a-23e1-4357-bb43-cbcce413ef00\", // Erro AWP Reembolso PROD RC\r\n \"6893fa78-6988-4d42-bbe8-56115ad6dafb\", // Perda Parcial PROD RC\r\n \"994b638d-b77c-4382-93d7-8a3c4a68a335\", // Prazo curto PROD RC\r\n \"7cfd92cd-d13a-4aa2-b4bc-1572d827d30f\", // Reativação ou Não reabilitar PROD RC\r\n \"bf053a72-3cca-46c2-adce-efef7249398f\", // Prêmio devido PROD RC\r\n \"0660628b-95db-4b5a-8b61-537711d73e8e\", // Proposta recusada auto PROD RC\r\n \"36987e66-cd0b-41cd-ba09-cb1f4f62ebc0\", // Sinistro 3o sem responsabilidade PROD RC\r\n \"1137350c-dad4-457c-bbf0-1de44bfb4d1c\", // Sinistro atender PROD RC\r\n \"4c1d0f3b-9c8e-41a4-aad0-c402688835a5\", // Sinistro DNC PROD RC\r\n \"356f351e-5f3f-4902-b145-d0e2aa38f5e4\", // Sinistro Datas / Peças PROD RC\r\n \"7301d8f7-5454-4063-aefe-7a6d73dfa90c\", // Sinistro Negativa PROD RC\r\n \"e3999399-d44d-4b02-adb8-a6215a293395\", // Sinistro pagamento PROD RC\r\n \"34e901e9-834b-4c91-82ee-99dc93b44608\", // Sinistro vendaval PROD RC\r\n \"161d59a0-3ead-4f3e-b355-658be1a01759\", // Template padrão PROD RC\r\n \"47507dd8-29c0-4450-8360-c1137cab8a06\", // Vidro homologado PROD RC\r\n \"183bab26-e4a4-4015-822b-2c97ae6304c6\", // Vidro logomarca PROD RC\r\n \"73e90d69-6f4e-4373-9130-446b5e93a1df\", // Vistoria de qualidade PROD RC\r\n]\r\n\r\nconst tabChatListRejeitado = [\r\n \"11ef7acb-44a6-4a69-aa83-ebd496a454fd\", // Rejeitada PROD RC\r\n]\r\n\r\nconst lastTabulation = protocol?.journey[0];\r\n\r\nconst tabChatAreaReclamante =\r\n lastTabulation && tabChatListAreaReclamante.includes(lastTabulation.tab_id);\r\n\r\nconst tabChatArea =\r\n lastTabulation && tabChatListArea.includes(lastTabulation.tab_id);\r\n\r\nconst tabChatReclamante =\r\n lastTabulation && tabChatListReclamante.includes(lastTabulation.tab_id);\r\n\r\nconst tabChatFechado =\r\n lastTabulation && tabChatListFechado.includes(lastTabulation.tab_id);\r\n\r\nconst tabChatRejeitado =\r\n lastTabulation && tabChatListRejeitado.includes(lastTabulation.tab_id);\r\n\r\nlet updatedWorkflowProtocol;\r\n\r\nif (tabChatAreaReclamante) {\r\n return {\r\n user_requested_already_viewed_protocol: true,\r\n // workflow_protocol_solicitation_status_id: \"\",\r\n optional_config: {\r\n ...workflowProtocol.optional_config,\r\n pendency_button: {\r\n clerk: false,\r\n broker: false,\r\n broker_frotas: false,\r\n tech: false,\r\n advisor: false,\r\n seller: false,\r\n backoffice: false,\r\n provider: false,\r\n commercial: false,\r\n frotas: false,\r\n area: true,\r\n reclamante: true,\r\n company: true,\r\n person: true,\r\n },\r\n },\r\n }\r\n} else if (tabChatArea) {\r\n return {\r\n user_requested_already_viewed_protocol: true,\r\n // workflow_protocol_solicitation_status_id: \"\",\r\n optional_config: {\r\n ...workflowProtocol.optional_config,\r\n pendency_button: {\r\n clerk: false,\r\n broker: false,\r\n broker_frotas: false,\r\n tech: false,\r\n advisor: false,\r\n seller: false,\r\n backoffice: false,\r\n provider: false,\r\n commercial: false,\r\n frotas: false,\r\n area: true,\r\n reclamante: false,\r\n company: false,\r\n person: false,\r\n },\r\n },\r\n }\r\n} else if (tabChatReclamante) {\r\n return {\r\n user_requested_already_viewed_protocol: true,\r\n // workflow_protocol_solicitation_status_id: \"\",\r\n optional_config: {\r\n ...workflowProtocol.optional_config,\r\n pendency_button: {\r\n clerk: false,\r\n broker: false,\r\n broker_frotas: false,\r\n tech: false,\r\n advisor: false,\r\n seller: false,\r\n backoffice: false,\r\n provider: false,\r\n commercial: false,\r\n frotas: false,\r\n area: false,\r\n reclamante: true,\r\n company: false,\r\n person: false,\r\n },\r\n },\r\n };\r\n} else if (tabChatFechado) {\r\n return {\r\n user_requested_already_viewed_protocol: true,\r\n // workflow_protocol_solicitation_status_id: \"\",\r\n optional_config: {\r\n ...workflowProtocol.optional_config,\r\n pendency_button: {\r\n clerk: false,\r\n broker: false,\r\n broker_frotas: false,\r\n tech: false,\r\n advisor: false,\r\n seller: false,\r\n backoffice: false,\r\n provider: false,\r\n commercial: false,\r\n frotas: false,\r\n area: false,\r\n reclamante: false,\r\n company: false,\r\n person: false,\r\n },\r\n },\r\n };\r\n} else if (tabChatRejeitado) {\r\n return {\r\n user_requested_already_viewed_protocol: true,\r\n // workflow_protocol_solicitation_status_id: \"\",\r\n optional_config: {\r\n ...workflowProtocol.optional_config,\r\n pendency_button: {\r\n clerk: false,\r\n broker: false,\r\n broker_frotas: false,\r\n tech: false,\r\n advisor: false,\r\n seller: false,\r\n backoffice: false,\r\n provider: false,\r\n commercial: false,\r\n frotas: false,\r\n area: false,\r\n reclamante: false,\r\n company: false,\r\n person: false,\r\n },\r\n },\r\n };\r\n} else {\r\n return {\r\n user_requested_already_viewed_protocol: true,\r\n // workflow_protocol_solicitation_status_id: \"\",\r\n optional_config: {\r\n ...workflowProtocol.optional_config,\r\n pendency_button: {\r\n clerk: false,\r\n broker: false,\r\n broker_frotas: false,\r\n tech: false,\r\n advisor: false,\r\n seller: false,\r\n backoffice: false,\r\n provider: false,\r\n commercial: false,\r\n frotas: false,\r\n area: false,\r\n reclamante: false,\r\n company: false,\r\n person: false,\r\n },\r\n },\r\n };\r\n}\r\n"
|
|
4
4
|
}
|