dochub-sdk 0.1.129 → 0.1.131
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/interfaces/datalake.ts +4 -16
- package/interfaces/protocols.ts +20 -1
- package/package.json +1 -1
package/interfaces/datalake.ts
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
import { AxiosResponse } from "axios";
|
2
|
+
import { IProtocolResponseOptions } from "./protocols";
|
2
3
|
|
3
4
|
export enum DataLakeChange {
|
4
5
|
update = 'update', // Обновление данных по указанному пути
|
@@ -183,28 +184,15 @@ export enum DocHubDataLakeInitializedStatus {
|
|
183
184
|
|
184
185
|
export type DocHubDataLakeRequest = string;
|
185
186
|
|
187
|
+
export interface IDataLakePullFileOptions extends IProtocolResponseOptions {
|
188
|
+
}
|
189
|
+
|
186
190
|
|
187
191
|
/**
|
188
192
|
* Обработчик событий изменения файла
|
189
193
|
*/
|
190
194
|
export type DocHubDataLakeFileFollower = () => void;
|
191
195
|
|
192
|
-
export enum DataLakePullFileOptionsResponseTypes {
|
193
|
-
arraybuffer = 'arraybuffer',
|
194
|
-
document = 'document',
|
195
|
-
json = 'json',
|
196
|
-
text = 'text',
|
197
|
-
stream = 'stream'
|
198
|
-
}
|
199
|
-
|
200
|
-
/**
|
201
|
-
* Опции получения файла из DataLake
|
202
|
-
*/
|
203
|
-
export interface IDataLakePullFileOptions {
|
204
|
-
responseType?: DataLakePullFileOptionsResponseTypes;
|
205
|
-
responseEncoding?: string;
|
206
|
-
timeout?: number;
|
207
|
-
}
|
208
196
|
|
209
197
|
// Интерфейс доступа к DataLake
|
210
198
|
export interface IDocHubDataLake {
|
package/interfaces/protocols.ts
CHANGED
@@ -1,9 +1,28 @@
|
|
1
1
|
import { AxiosResponse, AxiosRequestConfig } from 'axios';
|
2
2
|
import { IDocHubContext } from './contexts';
|
3
3
|
|
4
|
+
export enum ProtocolOptionsResponseTypes {
|
5
|
+
arraybuffer = 'arraybuffer',
|
6
|
+
document = 'document',
|
7
|
+
json = 'json',
|
8
|
+
text = 'text',
|
9
|
+
stream = 'stream'
|
10
|
+
}
|
11
|
+
|
12
|
+
/**
|
13
|
+
* Опции получения файла из DataLake
|
14
|
+
*/
|
15
|
+
export interface IProtocolResponseOptions {
|
16
|
+
responseType?: ProtocolOptionsResponseTypes;
|
17
|
+
responseEncoding?: string;
|
18
|
+
timeout?: number;
|
19
|
+
}
|
20
|
+
|
21
|
+
export type IDocHubProtocolResponseDecoder = (response: AxiosResponse, options?: IProtocolResponseOptions) => AxiosResponse;
|
22
|
+
|
4
23
|
// Прослойка интерфейсов Axios для последующей кастомизации и поддержания совместимости
|
5
24
|
export interface IDocHubProtocolRequestConfig extends AxiosRequestConfig {
|
6
|
-
decoder?:
|
25
|
+
decoder?: IDocHubProtocolResponseDecoder; // Декодировщик ответа
|
7
26
|
};
|
8
27
|
|
9
28
|
export interface IDocHubProtocolResponse extends AxiosResponse {};
|