dcos-core-monalisav2-latam 1.0.0

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.
Files changed (129) hide show
  1. package/README.md +130 -0
  2. package/index.js +350 -0
  3. package/package.json +52 -0
  4. package/src/auth/handler.js +3 -0
  5. package/src/common/MondelezCastOrder.js +449 -0
  6. package/src/common/utils/AuthSecurity.js +46 -0
  7. package/src/common/utils/account-error-handler.js +279 -0
  8. package/src/common/utils/account-error-helper.js +231 -0
  9. package/src/common/utils/account-properties-handler.js +355 -0
  10. package/src/common/utils/api-response.js +62 -0
  11. package/src/common/utils/aws-services.js +186 -0
  12. package/src/common/utils/constants/account-error-codes.json +801 -0
  13. package/src/common/utils/constants.js +37 -0
  14. package/src/common/utils/convert/MondelezClientsItemsCast.js +52 -0
  15. package/src/common/utils/convert/MondelezInventoryItemsCast.js +15 -0
  16. package/src/common/utils/convert/MondelezOrderStatusCast.js +34 -0
  17. package/src/common/utils/convert/MondelezPricesItemsCast.js +37 -0
  18. package/src/common/utils/cron-ftp-get.js +143 -0
  19. package/src/common/utils/data-tables-helper.js +213 -0
  20. package/src/common/utils/date-range-calculator.js +113 -0
  21. package/src/common/utils/delay.js +17 -0
  22. package/src/common/utils/ftp-sftp.js +320 -0
  23. package/src/common/utils/logger.js +126 -0
  24. package/src/common/utils/nodemailerLib.js +61 -0
  25. package/src/common/utils/product-unit-converter.js +168 -0
  26. package/src/common/utils/schemas-utils.js +101 -0
  27. package/src/common/utils/seller-email-sharing-service.js +441 -0
  28. package/src/common/utils/sftp-utils.js +202 -0
  29. package/src/common/utils/status.js +15 -0
  30. package/src/common/utils/util.js +236 -0
  31. package/src/common/utils/validate-state-order.js +35 -0
  32. package/src/common/utils/validateProviders.js +67 -0
  33. package/src/common/utils/validation-data.js +45 -0
  34. package/src/common/utils/vtex/save-hooks.js +65 -0
  35. package/src/common/utils/vtex/save-schemas.js +65 -0
  36. package/src/common/utils/vtex-hook-handler.js +71 -0
  37. package/src/common/validation/AccountCoordinatesValidation.js +350 -0
  38. package/src/common/validation/GeneralErrorValidation.js +11 -0
  39. package/src/common/validation/MainErrorValidation.js +8 -0
  40. package/src/entities/account.js +639 -0
  41. package/src/entities/clients.js +104 -0
  42. package/src/entities/controlprice.js +196 -0
  43. package/src/entities/controlstock.js +206 -0
  44. package/src/entities/cron.js +77 -0
  45. package/src/entities/cronjob.js +71 -0
  46. package/src/entities/orders.js +195 -0
  47. package/src/entities/sftp-inbound.js +88 -0
  48. package/src/entities/sku.js +220 -0
  49. package/src/entities/taxpromotion.js +249 -0
  50. package/src/functions/account/account-get.js +262 -0
  51. package/src/functions/account/account-handler.js +299 -0
  52. package/src/functions/account/clients.js +10 -0
  53. package/src/functions/account/index.js +208 -0
  54. package/src/functions/actions/save-promotions-order-history.js +324 -0
  55. package/src/functions/affiliates/affiliates-hook-consumer.js +87 -0
  56. package/src/functions/affiliates/affiliates-hook-producer.js +45 -0
  57. package/src/functions/clients/clients-audience.js +62 -0
  58. package/src/functions/clients/clients-consumer.js +648 -0
  59. package/src/functions/clients/clients-producer.js +362 -0
  60. package/src/functions/clients/clients-suggested-product-consumer.js +166 -0
  61. package/src/functions/clients/helpers/suggested-product-mdlz.js +233 -0
  62. package/src/functions/clients_peru/email.html +129 -0
  63. package/src/functions/clients_peru/splitfile.js +357 -0
  64. package/src/functions/clients_peru/updateClients.js +1334 -0
  65. package/src/functions/clients_peru/utils.js +243 -0
  66. package/src/functions/cronjobs/cron-jobs-manager.js +40 -0
  67. package/src/functions/cronjobs/cron-jobs.js +171 -0
  68. package/src/functions/crons/cron.js +39 -0
  69. package/src/functions/distributors/distributor-handler.js +81 -0
  70. package/src/functions/distributors/distributor.js +535 -0
  71. package/src/functions/distributors/index.js +60 -0
  72. package/src/functions/financialpolicy/assign-financialpolicy.js +111 -0
  73. package/src/functions/financialpolicy/get-financialpolicy.js +91 -0
  74. package/src/functions/financialpolicy/index.js +28 -0
  75. package/src/functions/inventory/catalog-sync-consumer.js +17 -0
  76. package/src/functions/inventory/catalog-sync-handler.js +311 -0
  77. package/src/functions/inventory/inventory-consumer.js +119 -0
  78. package/src/functions/inventory/inventory-producer.js +197 -0
  79. package/src/functions/multiPresentation/multipre-queue.js +155 -0
  80. package/src/functions/multiPresentation/multipres.js +459 -0
  81. package/src/functions/nodeflow/index.js +83 -0
  82. package/src/functions/nodeflow/nodeflow-cron.js +200 -0
  83. package/src/functions/nodeflow/nodeflow-pub.js +203 -0
  84. package/src/functions/nodeflow/nodeflow-pvt.js +266 -0
  85. package/src/functions/notifications/download-leads-handler.js +67 -0
  86. package/src/functions/notifications/new-leads-notification-consumer.js +17 -0
  87. package/src/functions/notifications/new-leads-notification-handler.js +359 -0
  88. package/src/functions/notifications/order-status-notification-handler.js +482 -0
  89. package/src/functions/notifications/promotion-notification-handler.js +193 -0
  90. package/src/functions/orders/index.js +32 -0
  91. package/src/functions/orders/orders-cancel-handler.js +74 -0
  92. package/src/functions/orders/orders-handler.js +280 -0
  93. package/src/functions/orders/orders-hook-consumer.js +137 -0
  94. package/src/functions/orders/orders-hook-producer.js +170 -0
  95. package/src/functions/orders/orders-notifications-handler.js +137 -0
  96. package/src/functions/orders/orders-status-consumer.js +461 -0
  97. package/src/functions/orders/orders-status-producer.js +443 -0
  98. package/src/functions/prices/index.js +75 -0
  99. package/src/functions/prices/prices-consumer.js +236 -0
  100. package/src/functions/prices/prices-producer.js +323 -0
  101. package/src/functions/prices/promotion-and-tax.js +1284 -0
  102. package/src/functions/routesflow/assign-routeflow-queue.js +77 -0
  103. package/src/functions/schemas/vtex/handle-schemas.js +102 -0
  104. package/src/functions/security/process_gas.js +221 -0
  105. package/src/functions/security/security-handler.js +950 -0
  106. package/src/functions/sftp/sftp-consumer.js +453 -0
  107. package/src/functions/sftpIntegrations/processes/redirectServices.js +184 -0
  108. package/src/functions/sftpIntegrations/processes/validateFileSchema.js +226 -0
  109. package/src/functions/sftpIntegrations/schemas/credential-schema.js +123 -0
  110. package/src/functions/sftpIntegrations/schemas/record-schema.js +131 -0
  111. package/src/functions/sftpIntegrations/schemas/sftp_required_fields.json +3 -0
  112. package/src/functions/sftpIntegrations/sftp-config-producer.js +112 -0
  113. package/src/functions/sftpIntegrations/sftp-consumer.js +700 -0
  114. package/src/functions/sftpIntegrations/test/validateFile.test.js +122 -0
  115. package/src/functions/sftpIntegrations/utils/connect-dynamo.js +29 -0
  116. package/src/functions/sftpIntegrations/utils/split-data.js +25 -0
  117. package/src/functions/utils/index.js +130 -0
  118. package/src/functions/vtex/vtex-helpers.js +694 -0
  119. package/src/integrations/accountErrors/AccountErrorManager.js +437 -0
  120. package/src/integrations/audience/Audience.js +70 -0
  121. package/src/integrations/financialPolicy/FinancialPolicyApi.js +377 -0
  122. package/src/integrations/index.js +0 -0
  123. package/src/integrations/mobilvendor/MobilvendorApi.js +405 -0
  124. package/src/integrations/productmultipresentation/ProductMultiPresentation.js +200 -0
  125. package/src/mdlz/auth/SecretManagerApi.js +77 -0
  126. package/src/mdlz/client/MdlzApi.js +70 -0
  127. package/src/vtex/clients/ProvidersApi.js +51 -0
  128. package/src/vtex/clients/VtexApi.js +511 -0
  129. package/src/vtex/models/VtexOrder.js +87 -0
@@ -0,0 +1,357 @@
1
+ const csv = require('csvtojson');
2
+ const converter = require('json-2-csv');
3
+ const path = require('node:path');
4
+ const { sendSqsMessage } = require('./utils');
5
+ const { connectToFtp } = require('../../common/utils/sftp-utils');
6
+ const { FileSystem } = require('../../common/utils/ftp-sftp');
7
+ const Logger = require('../../common/utils/logger');
8
+
9
+ /**
10
+ *
11
+ * @param {Object} ftpCredentials Credenciales de conexión al servidor FTP o SFTP
12
+ * @param {Object} fileParams
13
+ * @param {string} sqsQueue URL de la cola SQS a donde se enviará el message del archivo a procesar.
14
+ */
15
+ module.exports.splitFile = async (ftpCredentials, fileParams, sqsQueue, timestamp, additionalQueueData = {}) => {
16
+ let filesData = {};
17
+
18
+ let clientFTP, {
19
+ patternFile,
20
+ maxRows,
21
+ filesFolderPath,
22
+ processedFilesFolderPath,
23
+ splitFilesFolderPath,
24
+ splitProcessedFilesFolderPath,
25
+ logFilesFolderPath
26
+ } = fileParams;
27
+
28
+ try {
29
+ // Conexión al servidor FTP
30
+ clientFTP = await connectToFtp(ftpCredentials);
31
+
32
+ // Consulta de archivos en la carpeta
33
+ Logger.info(`Finding files in folder: ${filesFolderPath}`);
34
+ let files = await this.getFilesInFolder(clientFTP, filesFolderPath, file => {
35
+ return file.original.type == '-' && file.original.name.match(new RegExp(patternFile)) !== null;
36
+ });
37
+ Logger.info(`Files found: ${files?.length}`);
38
+ if (files?.length) {
39
+ for (let file of files) {
40
+ // Información del archivo a procesar
41
+ const fileData = path.parse(file.original.name);
42
+ // Ruta del archivo a procesar
43
+ const filePath = filesFolderPath + '/' + fileData.base;
44
+
45
+ try {
46
+ // Se generan los archivos segmentado del archivo 'grande'
47
+ const { rows, data } = await this.generateFiles(
48
+ clientFTP,
49
+ filePath,
50
+ { maxRows, splitFilesFolderPath, splitProcessedFilesFolderPath, logFilesFolderPath },
51
+ fileData,
52
+ timestamp,
53
+ sqsQueue,
54
+ additionalQueueData
55
+ );
56
+
57
+ // Se mueve el archivo original a la carpeta determinada
58
+ Logger.info(`Moving file: ${filePath}`);
59
+ const newFileName = await this.moveProcessedFile(
60
+ clientFTP,
61
+ filePath,
62
+ processedFilesFolderPath,
63
+ fileData.name + '_' + timestamp + fileData.ext
64
+ );
65
+ Logger.info(`File ${filePath} moved at ${newFileName}`);
66
+
67
+ // Se adiciona en el objeto de retorno la siguiente información
68
+ filesData[fileData.name] = {
69
+ // timestamp del momento en que se ejecuta el proceso
70
+ timestamp,
71
+ // N° de filas del archivo original
72
+ rows,
73
+ // Lista de archivos divididos
74
+ data,
75
+ };
76
+ } catch (ex) {
77
+ filesData[fileData.name] = {
78
+ timestamp,
79
+ error: ex.message
80
+ };
81
+ }
82
+ }
83
+ }
84
+
85
+ return filesData;
86
+ } catch (ex) {
87
+ throw (ex);
88
+ } finally {
89
+ // Se cierra la conexión al servidor FTP (si esta existe)
90
+ if (clientFTP?.client) {
91
+ clientFTP.client.end();
92
+ }
93
+ }
94
+ };
95
+
96
+ module.exports.handleProcessFile = async (clientFTP, splitData, csvOptions, callbackJsonData) => {
97
+ let { filePath, baseName, timestamp, splitProcessedFilesFolderPath, logFilesFolderPath, addToQueue = true } = splitData;
98
+
99
+ Logger.info('Input data: ' + JSON.stringify({ filePath, baseName, timestamp, addToQueue }));
100
+ // Se obtiene la información del archivo a procesar
101
+ const fileData = path.parse(filePath);
102
+
103
+ // Obtener los registros del archivo definido en 'filePath'
104
+ let { rows, errors, data, promises } = await this.processFileContent(clientFTP, filePath, csvOptions, callbackJsonData);
105
+ if (addToQueue && promises.length) {
106
+ let result = await Promise.allSettled(promises.map(queueRow => {
107
+ const { queueUrl, queueData } = queueRow;
108
+ return new Promise((resolve, reject) => {
109
+ sendSqsMessage(queueUrl, queueData).then(() => resolve(queueData)).catch(reject);
110
+ });
111
+ })).catch(Logger.error);
112
+ if (result) {
113
+ Logger.info(`Records to send: ${result.length ?? 0}`);
114
+ for (let item of result) {
115
+ if (item.status == 'rejected') {
116
+ Logger.error(item);
117
+ }
118
+ }
119
+ }
120
+ }
121
+
122
+ // Se crea la respuesta de la petición
123
+ let response = { rows, errors };
124
+ if (data?.length) {
125
+ // Se genera el archivo de log
126
+ response.logFile = await this.generateLogFile(
127
+ clientFTP,
128
+ logFilesFolderPath + '/' + baseName,
129
+ fileData.name + '_logs.csv',
130
+ data
131
+ );
132
+ }
133
+
134
+ // Se mueve el archivo procesado previamente
135
+ await this.moveProcessedFile(
136
+ clientFTP,
137
+ filePath,
138
+ splitProcessedFilesFolderPath + '/' + baseName,
139
+ fileData.base
140
+ );
141
+
142
+ return response;
143
+ };
144
+
145
+ /**
146
+ * Genera el archivo de log con la información de los errores de validación al momento de procesar el archivo csv.
147
+ * @param {FileSystem} clientFTP Instancia de conexión al servidor FTP.
148
+ * @param {string} logsFolder Directorio donde se almacenará los archivos de log.
149
+ * @param {string} logFileName Nombre del archivo log.
150
+ * @param {array} errors Lista de errores.
151
+ * @returns
152
+ */
153
+ module.exports.generateLogFile = (clientFTP, logsFolder, logFileName, errors) => {
154
+ return new Promise((resolve, reject) => {
155
+ // Creación de la carpeta donde se almacenarán los archivos divididos
156
+ Logger.info(`Creating folder: ${logsFolder}`);
157
+ clientFTP.mkdir(logsFolder, true).then(() => {
158
+ let fileName = logsFolder + '/' + logFileName;
159
+ Logger.info(`Creating log file: ${fileName}`);
160
+ // Se convierte el listado de datos a un archivo CSV
161
+ const content = converter.json2csv(errors, { delimiter: ',' });
162
+ clientFTP.put(content, fileName).then(() => {
163
+ resolve(fileName);
164
+ }).catch(reject);
165
+ }).catch(reject);
166
+ });
167
+ };
168
+
169
+ /**
170
+ * Mueve el archivo procesado a una determinada carpeta
171
+ * @param {FileSystem} clientFTP Instancia de conexión al servidor FTP.
172
+ * @param {string} filePath Directorio del archivo que se va a mover
173
+ * @param {string} targetFolder Carpeta donde se moverán los archivos procesados
174
+ * @param {string} newFileName Nombre a asignar del archivo movido a 'targetFolder'.
175
+ * @returns
176
+ */
177
+ module.exports.moveProcessedFile = (clientFTP, filePath, targetFolder, newFileName) => {
178
+ return new Promise((resolve, reject) => {
179
+ // Creación de la carpeta donde se almacenarán los archivos divididos
180
+ Logger.info(`Creating processed files folder: ${targetFolder}`);
181
+ clientFTP.mkdir(targetFolder, true).then(() => {
182
+ newFileName = targetFolder + '/' + newFileName;
183
+ clientFTP.rename(filePath, newFileName).then(() => {
184
+ resolve(newFileName);
185
+ }).catch(reject)
186
+ }).catch(reject);
187
+ });
188
+ };
189
+
190
+ /**
191
+ * Obtiene la lista de archivos existentes en la carpeta.
192
+ * @param {FileSystem} clientFTP Instancia de conexión al servidor FTP.
193
+ * @param {string} filesFolderPath Carpeta donde se buscan los archivos.
194
+ * @param {function} callbackFilter Expresión regular del archivo a obtener.
195
+ * @returns Lista de archivos asociados a la consulta.
196
+ */
197
+ module.exports.getFilesInFolder = async (clientFTP, filesFolderPath, callbackFilter = null) => {
198
+ return new Promise((resolve, reject) => {
199
+ clientFTP.list(filesFolderPath).then(list => {
200
+ if (callbackFilter) {
201
+ resolve(list.filter(callbackFilter));
202
+ } else {
203
+ resolve(list);
204
+ }
205
+ }).catch(reject);
206
+ });
207
+ };
208
+
209
+ module.exports.getFileStream = async (clientFTP, filePath) => {
210
+ return new Promise((resolve, reject) => {
211
+ // Obtener el contenido del archivo indicado
212
+ Logger.info(`Reading file: ${filePath}`);
213
+ clientFTP.get(filePath).then(resolve).catch(reject);
214
+ });
215
+ };
216
+
217
+ module.exports.getFileContent = async (clientFTP, filePath) => {
218
+ return new Promise((resolve, reject) => {
219
+ this.getFileStream(clientFTP, filePath).then(stream => {
220
+ // Se extrae el contenido del archivo
221
+ let content = '';
222
+ stream.on('data', function (chunk) {
223
+ content += chunk.toString();
224
+ });
225
+ stream.on('end', function () {
226
+ resolve(content);
227
+ });
228
+ }).catch(reject);
229
+ });
230
+ };
231
+
232
+ /**
233
+ * Extrae las filas de un archivo de teto plano
234
+ * @param {*} clientFTP Instancia de conexión al servidor FTP.
235
+ * @param {string} filePath Ruta del archivo a leer.
236
+ * @param {boolean} includeHeader Valor de verdad para indicar si existe una fila de encabezado.
237
+ * @returns Filas existentes en el archivo.
238
+ */
239
+ module.exports.getRowsFromFile = async (clientFTP, filePath, includeHeader = true) => {
240
+ return new Promise((resolve, reject) => {
241
+ this.getFileContent(clientFTP, filePath).then(content => {
242
+ // Se obtiene cada una de las filas del archivo
243
+ let rows = content.trim().split(/\r?\n/);
244
+ // Se obtiene la fila de los títulos del archivo (si aplica)
245
+ let headerRow = includeHeader ? rows.shift() : '';
246
+ resolve({ rows, headerRow });
247
+ }).catch(reject);
248
+ });
249
+ };
250
+
251
+ /**
252
+ * Genera los archivos separados a partir de un archivo base.
253
+ * @param {*} clientFTP Instancia de conexión al servidor FTP.
254
+ * @param {string} filePath Ruta del archivo a dividir.
255
+ * @param {string} fileData Información extraida del archivo 'filePath'.
256
+ * @param {string} folderPath Ruta del directorio donde se insertarán los archivos generados.
257
+ * @param {string} timestamp Timestamp del inicio de ejecución del proceso.
258
+ * @param {*} seller
259
+ * @param {boolean} addToQueue Valor que indica si se inserta el message a la cola.
260
+ * @returns
261
+ */
262
+ module.exports.generateFiles = async (clientFTP, filePath, fileParams, fileData, timestamp, sqsQueue, additionalQueueData = {}) => {
263
+ return new Promise((resolve, reject) => {
264
+ this.getRowsFromFile(clientFTP, filePath).then(rowsData => {
265
+ let { rows, headerRow } = rowsData;
266
+ // Respuesta de la promise
267
+ let response = { rows: rows.length, data: [] };
268
+ if (rows.length) {
269
+ let { maxRows, splitFilesFolderPath, splitProcessedFilesFolderPath, logFilesFolderPath } = fileParams;
270
+
271
+ // Se calcula el número estimado de archivos a generar, dividiendo el total de filas entre el número máximo configurado
272
+ let estimatedFiles = Math.trunc(rows.length / maxRows);
273
+ if (rows.length % maxRows != 0) {
274
+ estimatedFiles += 1;
275
+ }
276
+ Logger.info(`Estimated files count: ${estimatedFiles}`);
277
+ // Se obtiene el número de dígitos de la cantidad estimada de archivos, para formatear el consecutivo llenando con ceros a la izquierda.
278
+ let digits = String(estimatedFiles).length;
279
+
280
+ // Nombre base de la carpeta y archivos generados a partir de la archivo original
281
+ let baseName = fileData.name + '_' + timestamp;
282
+
283
+ // Se crea la carpeta donde se almacenaran los archivos divididos
284
+ let targetFolder = splitFilesFolderPath + '/' + baseName;
285
+ Logger.info(`Creating target folder: ${targetFolder}`);
286
+ clientFTP.mkdir(targetFolder, true).then(() => {
287
+ let filesPromises = [], count = 1;
288
+ do {
289
+ // Se extrae las primeras 'maxRows' filas de la lista
290
+ let rowsData = rows.splice(0, maxRows);
291
+ if (rowsData.length) {
292
+ // Se define la rula del archivo generado, concatenando la carpeta destino y el nombre a establecer
293
+ // Ejemplo: client_semifull_01.csv
294
+ let filePath = targetFolder + '/' + (baseName + '_' + String(count).padStart(digits, '0') + fileData.ext);
295
+ // Se concatena los datos de la Promise encargada de generar el archivo respectivo
296
+ filesPromises.push({ filePath, rowsData });
297
+ count++;
298
+ }
299
+ } while (rows.length);
300
+
301
+ // Se ejecuta las promises
302
+ Logger.info(`Promises count: ${filesPromises.length}`);
303
+ if (filesPromises.length) {
304
+ Promise.allSettled(filesPromises.map(fileData => {
305
+ const { filePath, rowsData } = fileData;
306
+ return new Promise((resolve, reject) => {
307
+ Logger.info(`Creating file: ${filePath}`);
308
+ clientFTP.put(
309
+ (headerRow ? [...[headerRow], ...rowsData] : rowsData).join('\n'),
310
+ filePath
311
+ ).then(() => {
312
+ let queueData = { filePath, baseName, timestamp, splitProcessedFilesFolderPath, logFilesFolderPath, ...additionalQueueData };
313
+ if (sqsQueue) {
314
+ // Se inserta los datos en la cola definida
315
+ sendSqsMessage(sqsQueue, queueData).then(() => resolve(queueData)).catch(reject);
316
+ } else {
317
+ resolve(queueData);
318
+ }
319
+ }).catch(reject);
320
+ });
321
+ })).then(result => {
322
+ response.data = result;
323
+ resolve(response);
324
+ }).catch(reject);
325
+ } else {
326
+ resolve(response);
327
+ }
328
+ }).catch(reject);
329
+ } else {
330
+ resolve(response);
331
+ }
332
+ }).catch(reject);
333
+ });
334
+ }
335
+
336
+ /**
337
+ * Extrae el contenido del archivo .csv como valores JSON
338
+ * @param {*} clientFTP Instancia de conexión al servidor FTP.
339
+ * @param {*} filePath Ruta del archivo a leer.
340
+ * @returns Información de la ejecución del proceso.
341
+ */
342
+ module.exports.processFileContent = async (clientFTP, filePath, csvOptions, callbackJsonData) => {
343
+ return new Promise((resolve, reject) => {
344
+ // Obtener el contenido del archivo 'filePath'
345
+ Logger.info(`Reading file: ${filePath}`);
346
+ clientFTP.get(filePath).then(stream => {
347
+ let result = { rows: 0, errors: 0, data: [], promises: [] };
348
+ // Extraer el contenido de cada fila del archivo csv como objeto JSON
349
+ csv(csvOptions).fromStream(stream).subscribe(jsonData => {
350
+ // Se incrementa el contador de filas
351
+ result.rows++;
352
+ // Se ejecuta una validación de los datos extraidos del JSON
353
+ callbackJsonData(result, jsonData);
354
+ }, reject, () => { resolve(result) });
355
+ }).catch(reject);
356
+ });
357
+ }