dochub-sdk 0.1.180 → 0.1.181
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.
@@ -93,7 +93,7 @@ export class DocHubDocumentProto extends DocHubComponentProto implements IDocHub
|
|
93
93
|
* Обработка полученных данных документа.
|
94
94
|
* Можно перехватывать.
|
95
95
|
*/
|
96
|
-
processingData(data: any): any {
|
96
|
+
async processingData(data: any): Promise<any> {
|
97
97
|
return data;
|
98
98
|
}
|
99
99
|
|
@@ -101,7 +101,7 @@ export class DocHubDocumentProto extends DocHubComponentProto implements IDocHub
|
|
101
101
|
* Обработка полученных данных документа.
|
102
102
|
* Нужно переопределить для типа документа DocHubDocumentType.content
|
103
103
|
*/
|
104
|
-
processingContent(content: AxiosResponse) {
|
104
|
+
async processingContent(content: AxiosResponse): Promise<void> {
|
105
105
|
throw new DocHubError(`The document has ${this.getType()} type. It must have processingContent method. But, the method is not implemented.`);
|
106
106
|
}
|
107
107
|
|
@@ -157,7 +157,7 @@ export class DocHubDocumentProto extends DocHubComponentProto implements IDocHub
|
|
157
157
|
return;
|
158
158
|
}
|
159
159
|
// Если все в порядке, вызываем процессинг данных
|
160
|
-
result.data = this.processingData(result.data);
|
160
|
+
result.data = await this.processingData(result.data);
|
161
161
|
}
|
162
162
|
// Транслируем по шаблону
|
163
163
|
if (template) {
|
@@ -166,9 +166,10 @@ export class DocHubDocumentProto extends DocHubComponentProto implements IDocHub
|
|
166
166
|
data: DocHub.tools.mustache.render(template.data.toString(), result.data)
|
167
167
|
}
|
168
168
|
}
|
169
|
+
// Очищаем информацию об ошибке
|
170
|
+
this.error = null;
|
169
171
|
// Вызываем метод обработки полученного контента, если это требуется
|
170
172
|
(template || (this.getType() === DocHubDocumentType.content)) && this.processingContent(result);
|
171
|
-
this.error = null;
|
172
173
|
} catch (error) {
|
173
174
|
// eslint-disable-next-line no-console
|
174
175
|
console.error(error);
|