dochub-sdk 0.1.128 → 0.1.130

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.
@@ -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,12 +184,16 @@ 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
 
196
+
192
197
  // Интерфейс доступа к DataLake
193
198
  export interface IDocHubDataLake {
194
199
  /**
@@ -304,7 +309,7 @@ export interface IDocHubDataLake {
304
309
  * @param uri - URI файла во внутреннем формате DocHub
305
310
  * @returns - Результат выполнения запроса
306
311
  */
307
- pullFile(uri: string): Promise<AxiosResponse>;
312
+ pullFile(uri: string, options?: IDataLakePullFileOptions): Promise<AxiosResponse>;
308
313
 
309
314
  /**
310
315
  * Возвращает конечный URI на основании массива относительных и прямых URI
@@ -1,9 +1,29 @@
1
1
  import { AxiosResponse, AxiosRequestConfig } from 'axios';
2
2
  import { IDocHubContext } from './contexts';
3
+ import { IDataLakePullFileOptions } from './datalake';
4
+
5
+ export enum DataLakePullFileOptionsResponseTypes {
6
+ arraybuffer = 'arraybuffer',
7
+ document = 'document',
8
+ json = 'json',
9
+ text = 'text',
10
+ stream = 'stream'
11
+ }
12
+
13
+ /**
14
+ * Опции получения файла из DataLake
15
+ */
16
+ export interface IProtocolResponseOptions {
17
+ responseType?: DataLakePullFileOptionsResponseTypes;
18
+ responseEncoding?: string;
19
+ timeout?: number;
20
+ }
21
+
22
+ export type IDocHubProtocolResponseDecoder = (response: AxiosResponse, options?: IProtocolResponseOptions) => AxiosResponse;
3
23
 
4
24
  // Прослойка интерфейсов Axios для последующей кастомизации и поддержания совместимости
5
25
  export interface IDocHubProtocolRequestConfig extends AxiosRequestConfig {
6
- decoder?: Function; // Декодировщик ответа
26
+ decoder?: IDocHubProtocolResponseDecoder; // Декодировщик ответа
7
27
  };
8
28
 
9
29
  export interface IDocHubProtocolResponse extends AxiosResponse {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dochub-sdk",
3
- "version": "0.1.128",
3
+ "version": "0.1.130",
4
4
  "description": "The DocHub System Development Kit.",
5
5
  "private": false,
6
6
  "main": "index.ts",