@univerjs-pro/exchange-client 0.2.14 → 0.2.15
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/lib/cjs/index.js +2 -2
- package/lib/es/index.js +2 -2
- package/lib/types/controllers/config.schema.d.ts +5 -0
- package/lib/types/index.d.ts +6 -6
- package/lib/types/plugin.d.ts +1 -1
- package/lib/types/services/exchange.service.d.ts +5 -3
- package/lib/types/services/request.service.d.ts +4 -2
- package/lib/umd/index.js +2 -2
- package/package.json +11 -11
@@ -1,5 +1,10 @@
|
|
1
1
|
export declare const PLUGIN_CONFIG_KEY = "exchange-client.config";
|
2
2
|
export declare const configSymbol: unique symbol;
|
3
3
|
export interface IUniverExchangeClientConfig {
|
4
|
+
/**
|
5
|
+
* The URL of the endpoint for downloading files.
|
6
|
+
* @default 'location.origin'
|
7
|
+
*/
|
8
|
+
downloadEndpointUrl?: string;
|
4
9
|
}
|
5
10
|
export declare const defaultPluginConfig: IUniverExchangeClientConfig;
|
package/lib/types/index.d.ts
CHANGED
@@ -1,9 +1,9 @@
|
|
1
|
-
export {
|
2
|
-
export {
|
1
|
+
export { UniverExchangeClientPlugin } from './plugin';
|
2
|
+
export { ExchangeService, IExchangeService } from './services/exchange.service';
|
3
|
+
export { ExchangeOperateService, IExchangeOperateService } from './services/operate.service';
|
4
|
+
export { IRequestService, RequestService } from './services/request.service';
|
5
|
+
export { EXCHANGE_EXPORT_SERVER_URL_KEY, EXCHANGE_GET_TASK_SERVER_URL_KEY, EXCHANGE_IMPORT_SERVER_URL_KEY, EXCHANGE_MAX_TIMEOUT_TIME_KEY, EXCHANGE_SIGN_URL_SERVER_URL_KEY, EXCHANGE_UPLOAD_FILE_SERVER_URL_KEY } from './services/request.service';
|
3
6
|
export { IUploadNotificationService, UploadNotificationService, UploadNotificationState } from './services/upload-notification.service';
|
4
7
|
export { IUploadProgressService, UploadProgressService } from './services/upload-progress.service';
|
8
|
+
export { downloadFile, getUniverTypeByFile, getUploadFile } from './services/utils/tool';
|
5
9
|
export { UploadNotificationContainer } from './views/UploadNotificationContainer';
|
6
|
-
export { RequestService, IRequestService } from './services/request.service';
|
7
|
-
export { EXCHANGE_UPLOAD_FILE_SERVER_URL_KEY, EXCHANGE_IMPORT_SERVER_URL_KEY, EXCHANGE_EXPORT_SERVER_URL_KEY, EXCHANGE_GET_TASK_SERVER_URL_KEY, EXCHANGE_SIGN_URL_SERVER_URL_KEY } from './services/request.service';
|
8
|
-
export { IExchangeOperateService, ExchangeOperateService } from './services/operate.service';
|
9
|
-
export { UniverExchangeClientPlugin } from './plugin';
|
package/lib/types/plugin.d.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
import { IConfigService, Injector, Plugin } from '@univerjs/core';
|
2
1
|
import { IUniverExchangeClientConfig } from './controllers/config.schema';
|
2
|
+
import { IConfigService, Injector, Plugin } from '@univerjs/core';
|
3
3
|
export declare class UniverExchangeClientPlugin extends Plugin {
|
4
4
|
private readonly _config;
|
5
5
|
readonly _injector: Injector;
|
@@ -1,7 +1,7 @@
|
|
1
|
-
import { IDisposable, IDocumentData, IWorkbookData, Disposable } from '@univerjs/core';
|
1
|
+
import { IDisposable, IDocumentData, IWorkbookData, Disposable, IConfigService } from '@univerjs/core';
|
2
2
|
import { IError, UniverType } from '@univerjs/protocol';
|
3
|
-
import { Observable } from 'rxjs';
|
4
3
|
import { RequestService } from './request.service';
|
4
|
+
import { Observable } from 'rxjs';
|
5
5
|
export declare enum RequestState {
|
6
6
|
UPLOAD = 0,
|
7
7
|
IMPORT = 1,
|
@@ -58,10 +58,11 @@ export interface IExchangeService {
|
|
58
58
|
}
|
59
59
|
export declare const IExchangeService: import('@wendellhu/redi').IdentifierDecorator<IExchangeService>;
|
60
60
|
export declare class ExchangeService extends Disposable implements IExchangeService, IDisposable {
|
61
|
+
private readonly _configService;
|
61
62
|
private readonly _requestService;
|
62
63
|
private readonly _requestState$;
|
63
64
|
readonly requestState$: Observable<IRequestState>;
|
64
|
-
constructor(_requestService: RequestService);
|
65
|
+
constructor(_configService: IConfigService, _requestService: RequestService);
|
65
66
|
dispose(): void;
|
66
67
|
importDOCXToSnapshot(file: File | string): Promise<IDocumentData | undefined>;
|
67
68
|
exportDOCXByUnitId(unitId: string): Promise<File | undefined>;
|
@@ -82,4 +83,5 @@ export declare class ExchangeService extends Disposable implements IExchangeServ
|
|
82
83
|
private _upload;
|
83
84
|
private _import;
|
84
85
|
private _signUrl;
|
86
|
+
private _getDownloadEndpointURL;
|
85
87
|
}
|
@@ -1,12 +1,13 @@
|
|
1
|
-
import {
|
2
|
-
import { HTTPService } from '@univerjs/network';
|
1
|
+
import { IDisposable, IConfigService } from '@univerjs/core';
|
3
2
|
import { IError, UniverType } from '@univerjs/protocol';
|
4
3
|
import { ISheetBlockJson, ISnapshotJson } from './utils/snapshot';
|
4
|
+
import { HTTPService } from '@univerjs/network';
|
5
5
|
export declare const EXCHANGE_UPLOAD_FILE_SERVER_URL_KEY = "EXCHANGE_UPLOAD_FILE_SERVER_URL_KEY";
|
6
6
|
export declare const EXCHANGE_IMPORT_SERVER_URL_KEY = "EXCHANGE_IMPORT_SERVER_URL_KEY";
|
7
7
|
export declare const EXCHANGE_EXPORT_SERVER_URL_KEY = "EXCHANGE_EXPORT_SERVER_URL_KEY";
|
8
8
|
export declare const EXCHANGE_GET_TASK_SERVER_URL_KEY = "EXCHANGE_GET_TASK_SERVER_URL_KEY";
|
9
9
|
export declare const EXCHANGE_SIGN_URL_SERVER_URL_KEY = "EXCHANGE_SIGN_URL_SERVER_URL_KEY";
|
10
|
+
export declare const EXCHANGE_MAX_TIMEOUT_TIME_KEY = "EXCHANGE_MAX_TIMEOUT_TIME_KEY";
|
10
11
|
export interface IFileUploadResponse {
|
11
12
|
FileId: string;
|
12
13
|
error: IError;
|
@@ -98,4 +99,5 @@ export declare class RequestService implements IRequestService, IDisposable {
|
|
98
99
|
private _getExportURL;
|
99
100
|
private _getTaskURL;
|
100
101
|
private _getSignURL;
|
102
|
+
private _getMaxPollingTime;
|
101
103
|
}
|