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.
@@ -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 {
@@ -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?: Function; // Декодировщик ответа
25
+ decoder?: IDocHubProtocolResponseDecoder; // Декодировщик ответа
7
26
  };
8
27
 
9
28
  export interface IDocHubProtocolResponse extends AxiosResponse {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dochub-sdk",
3
- "version": "0.1.129",
3
+ "version": "0.1.131",
4
4
  "description": "The DocHub System Development Kit.",
5
5
  "private": false,
6
6
  "main": "index.ts",