dochub-sdk 0.1.166 → 0.1.167

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.
@@ -6,22 +6,12 @@ import type { IDocHubEditableComponent, IDocHubPresentationProfile, IDocHubPrese
6
6
  import ajv from 'ajv';
7
7
  import ajv_localize from 'ajv-i18n/localize/ru';
8
8
 
9
- /**
10
- * Тип в источнике данных
11
- */
12
- export enum DocumentSourceType {
13
- data = 'data', // Объект данных не требующий обработки
14
- jsonata = 'jsonata', // JSONata запрос
15
- dataFile = 'data-file', // Ссылка на файл с данными
16
- jsonataFile = 'jsonata-file' // Ссылка на файл с запросом jsonata
17
- };
18
-
19
9
  @Component
20
10
  export class DocHubDocumentProto extends Vue implements IDocHubEditableComponent {
21
- onRefresher: any = null; // Таймер отложенного выполнения обновления
22
- followURI: string | null = null; // URI файла за которым установлено слежение
23
- error: string | null = null; // Ошибка
24
- isPending = true; // Признак внутренней работы. Например загрузка данных.
11
+ onRefresher: any = null; // Таймер отложенного выполнения обновления
12
+ followURI: string | undefined; // URI файла за которым установлено слежение
13
+ error: string | null = null; // Ошибка
14
+ isPending = true; // Признак внутренней работы. Например загрузка данных.
25
15
 
26
16
  /**
27
17
  * Профиль документа
@@ -107,7 +97,10 @@ export class DocHubDocumentProto extends Vue implements IDocHubEditableComponent
107
97
  this.isPending = true;
108
98
  await this.refreshFileFollow();
109
99
  if (this.profile?.source) {
110
- const result = await DocHub.dataLake.pullData(this.profile.source, this.params);
100
+ const result = await DocHub.dataLake.resolveDataSetProfile(this.profile, {
101
+ params: this.params,
102
+ baseURI: this.followURI
103
+ });
111
104
  // Валидируем данные по структуре
112
105
  const rules = new ajv({ allErrors: true });
113
106
  const validator = rules.compile(this.getSchemaData());
@@ -135,7 +128,7 @@ export class DocHubDocumentProto extends Vue implements IDocHubEditableComponent
135
128
  // Устанавливаем слежение за файлом для оперативного обновления
136
129
  this.followURI && DocHub.dataLake.unfollowFile(this.followURI, this.onRefresh);
137
130
  if (!disable) {
138
- this.followURI = (await DocHub.dataLake.getURIForPath(this.profile.$base) || []).pop() || null;
131
+ this.followURI = (await DocHub.dataLake.getURIForPath(this.profile.$base) || []).pop();
139
132
  this.followURI && DocHub.dataLake.followFile(this.followURI, this.onRefresh);
140
133
  }
141
134
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dochub-sdk",
3
- "version": "0.1.166",
3
+ "version": "0.1.167",
4
4
  "description": "The DocHub System Development Kit.",
5
5
  "private": false,
6
6
  "main": "index.ts",