@univerjs-pro/exchange-client 0.4.2-nightly.202411071606 → 0.4.2-nightly.202411091134
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/facade.js +1 -0
- package/lib/cjs/index.js +2 -0
- package/lib/cjs/locale/en-US.js +1 -0
- package/lib/cjs/locale/fa-IR.js +1 -0
- package/lib/cjs/locale/ru-RU.js +1 -0
- package/lib/cjs/locale/vi-VN.js +1 -0
- package/lib/cjs/locale/zh-CN.js +1 -0
- package/lib/cjs/locale/zh-TW.js +1 -0
- package/lib/es/facade.js +1 -1
- package/lib/es/index.js +2 -1
- package/lib/es/locale/en-US.js +1 -0
- package/lib/es/locale/fa-IR.js +1 -0
- package/lib/es/locale/ru-RU.js +1 -0
- package/lib/es/locale/vi-VN.js +1 -0
- package/lib/es/locale/zh-CN.js +1 -0
- package/lib/es/locale/zh-TW.js +1 -0
- package/lib/types/index.d.ts +483 -10
- package/lib/umd/facade.js +1 -2
- package/lib/umd/index.js +2 -2
- package/lib/umd/locale/en-US.js +1 -1
- package/lib/umd/locale/fa-IR.js +1 -1
- package/lib/umd/locale/ru-RU.js +1 -1
- package/lib/umd/locale/vi-VN.js +1 -1
- package/lib/umd/locale/zh-CN.js +1 -1
- package/lib/umd/locale/zh-TW.js +1 -1
- package/package.json +23 -15
- package/lib/exchange.service-j28_A1tl.mjs +0 -2481
- package/lib/locale/en-US.js +0 -1
- package/lib/locale/fa-IR.js +0 -1
- package/lib/locale/ru-RU.js +0 -1
- package/lib/locale/vi-VN.js +0 -1
- package/lib/locale/zh-CN.js +0 -1
- package/lib/locale/zh-TW.js +0 -1
- package/lib/types/controllers/config.schema.d.ts +0 -16
- package/lib/types/controllers/exchange.controller.d.ts +0 -8
- package/lib/types/facade/f-univer.d.ts +0 -36
- package/lib/types/facade/index.d.ts +0 -1
- package/lib/types/locale/en-US.d.ts +0 -3
- package/lib/types/locale/fa-IR.d.ts +0 -3
- package/lib/types/locale/ru-RU.d.ts +0 -3
- package/lib/types/locale/vi-VN.d.ts +0 -3
- package/lib/types/locale/zh-CN.d.ts +0 -21
- package/lib/types/locale/zh-TW.d.ts +0 -3
- package/lib/types/plugin.d.ts +0 -11
- package/lib/types/services/__tests__/snapshot.spec.d.ts +0 -16
- package/lib/types/services/exchange.service.d.ts +0 -87
- package/lib/types/services/operate.service.d.ts +0 -121
- package/lib/types/services/request.service.d.ts +0 -107
- package/lib/types/services/upload-notification.service.d.ts +0 -52
- package/lib/types/services/utils/snapshot.d.ts +0 -76
- package/lib/types/services/utils/tool.d.ts +0 -19
- package/lib/types/views/UploadNotificationContainer.d.ts +0 -2
- package/lib/types/views/link-list/LinkList.d.ts +0 -6
- package/lib/types/views/upload-again/UploadAgain.d.ts +0 -2
- package/lib/types/views/upload-button/UploadButton.d.ts +0 -7
- package/lib/types/views/upload-error/UploadError.d.ts +0 -2
- package/lib/types/views/upload-notification/UploadNotification.d.ts +0 -2
- package/lib/types/views/upload-success/UploadSuccess.d.ts +0 -5
- package/lib/types/views/uploading/Uploading.d.ts +0 -2
- package/lib/types/views/uploading/upload-cancel/UploadCancel.d.ts +0 -2
- package/lib/types/views/uploading/upload-progress/UploadProgress.d.ts +0 -5
@@ -0,0 +1 @@
|
|
1
|
+
function _0x4316(_0x47144f,_0x8fd186){const _0x4fb04b=_0x4fb0();return _0x4316=function(_0x4316f8,_0x55f75e){_0x4316f8=_0x4316f8-0xdd;let _0x5e48d7=_0x4fb04b[_0x4316f8];return _0x5e48d7;},_0x4316(_0x47144f,_0x8fd186);}const _0xe2564b=_0x4316;(function(_0x47d5cc,_0x44f877){const _0x567dc2=_0x4316,_0x5be5e3=_0x47d5cc();while(!![]){try{const _0x44a88d=parseInt(_0x567dc2(0xed))/0x1*(parseInt(_0x567dc2(0xeb))/0x2)+-parseInt(_0x567dc2(0xdf))/0x3+-parseInt(_0x567dc2(0xee))/0x4+parseInt(_0x567dc2(0xde))/0x5+-parseInt(_0x567dc2(0xe2))/0x6+parseInt(_0x567dc2(0xea))/0x7*(-parseInt(_0x567dc2(0xe4))/0x8)+parseInt(_0x567dc2(0xec))/0x9;if(_0x44a88d===_0x44f877)break;else _0x5be5e3['push'](_0x5be5e3['shift']());}catch(_0x5b8123){_0x5be5e3['push'](_0x5be5e3['shift']());}}}(_0x4fb0,0xd9ffd));const e={'exchange':{'file':_0xe2564b(0xe7),'upload':_0xe2564b(0xef),'download':_0xe2564b(0xe1),'uploading':'Uploading','uploadSuccess':_0xe2564b(0xe9),'uploadSuccessTip':_0xe2564b(0xf2),'downloading':_0xe2564b(0xe8),'downloadSuccess':'Download\x20success','unknownMistake':'Unknown\x20mistake','networkError':_0xe2564b(0xe3),'tooLarge':_0xe2564b(0xe5),'internalError':_0xe2564b(0xdd),'interrupt':_0xe2564b(0xe6),'wait':_0xe2564b(0xf1),'cancel':_0xe2564b(0xf0),'uploadAgain':_0xe2564b(0xe0)}};function _0x4fb0(){const _0x44db91=['Network\x20error','16yuylKk','Data\x20is\x20too\x20large','The\x20network\x20connection\x20was\x20interrupted\x20and\x20the\x20file\x20upload\x20failed.','File','Downloading','File\x20uploaded\x20successfully','135107MoSpOa','35672ryprsN','20580048RMxWcP','67byDHBe','4261156YuRoDm','Open(File)','Cancel','Please\x20wait...','{0}\x20file(s)\x20uploaded\x20successfully','Internal\x20unknown\x20error','603390EFfNDJ','4485759HKvkpE','Upload\x20again','Save\x20As','661758lFPrBG'];_0x4fb0=function(){return _0x44db91;};return _0x4fb0();}export{e as default};
|
@@ -0,0 +1 @@
|
|
1
|
+
const _0x3790d1=_0x4a8a;function _0x4a8a(_0x479398,_0x157cdd){const _0x18b11c=_0x18b1();return _0x4a8a=function(_0x4a8add,_0x1fbca1){_0x4a8add=_0x4a8add-0x110;let _0x1f0e06=_0x18b11c[_0x4a8add];return _0x1f0e06;},_0x4a8a(_0x479398,_0x157cdd);}(function(_0xcad67c,_0x367cc0){const _0x2a6344=_0x4a8a,_0x38576a=_0xcad67c();while(!![]){try{const _0x3689b0=-parseInt(_0x2a6344(0x115))/0x1+-parseInt(_0x2a6344(0x11c))/0x2*(-parseInt(_0x2a6344(0x120))/0x3)+-parseInt(_0x2a6344(0x121))/0x4+parseInt(_0x2a6344(0x112))/0x5+-parseInt(_0x2a6344(0x11e))/0x6*(parseInt(_0x2a6344(0x11a))/0x7)+parseInt(_0x2a6344(0x11d))/0x8+-parseInt(_0x2a6344(0x124))/0x9*(-parseInt(_0x2a6344(0x117))/0xa);if(_0x3689b0===_0x367cc0)break;else _0x38576a['push'](_0x38576a['shift']());}catch(_0x28ca83){_0x38576a['push'](_0x38576a['shift']());}}}(_0x18b1,0xd878b));const o={'exchange':{'file':_0x3790d1(0x127),'upload':_0x3790d1(0x11b),'download':'ذخیره\x20به\x20عنوان','uploading':_0x3790d1(0x11f),'uploadSuccess':_0x3790d1(0x119),'uploadSuccessTip':_0x3790d1(0x116),'downloading':_0x3790d1(0x126),'downloadSuccess':_0x3790d1(0x110),'unknownMistake':_0x3790d1(0x123),'networkError':_0x3790d1(0x122),'tooLarge':_0x3790d1(0x125),'internalError':_0x3790d1(0x111),'interrupt':_0x3790d1(0x113),'wait':'لطفا\x20صبر\x20کنید...','cancel':_0x3790d1(0x118),'uploadAgain':_0x3790d1(0x114)}};export{o as default};function _0x18b1(){const _0x1a63e9=['دانلود\x20موفقیت\x20آمیز','خطای\x20داخلی\x20ناشناخته','917355vFEIwo','اتصال\x20شبکه\x20قطع\x20شد\x20و\x20بارگذاری\x20فایل\x20ناموفق\x20بود.','بارگذاری\x20مجدد','557458TxJAVK','{0}\x20فایل\x20با\x20موفقیت\x20بارگذاری\x20شد','18018410webKsw','لغو','فایل\x20با\x20موفقیت\x20بارگذاری\x20شد','14IwsXSa','بازکردن(فایل)','11586CrmfNL','9607280KdVzCy','4317738PYivtp','در\x20حال\x20بارگذاری','93redSyo','1929736yDxsyz','خطای\x20شبکه','خطای\x20ناشناخته','9YakntQ','داده\x20خیلی\x20بزرگ\x20است','در\x20حال\x20دانلود','فایل'];_0x18b1=function(){return _0x1a63e9;};return _0x18b1();}
|
@@ -0,0 +1 @@
|
|
1
|
+
const _0x5c3942=_0x7da4;function _0x7da4(_0x2bf20f,_0x1db97b){const _0x4b4ab0=_0x4b4a();return _0x7da4=function(_0x7da448,_0x2ed6f5){_0x7da448=_0x7da448-0xa5;let _0x3ed450=_0x4b4ab0[_0x7da448];return _0x3ed450;},_0x7da4(_0x2bf20f,_0x1db97b);}function _0x4b4a(){const _0x5ba162=['Сетевое\x20соединение\x20было\x20прервано,\x20и\x20загрузка\x20файла\x20не\x20удалась.','60nTdnGt','Файл','Файл\x20успешно\x20загружен','600026IikWlX','Отмена','7654633cyxxPC','Сохранить\x20как','Внутренняя\x20неизвестная\x20ошибка','Открыть(Файл)','Данные\x20слишком\x20большие','Скачивание','Пожалуйста,\x20подождите...','Неизвестная\x20ошибка','Сетевая\x20ошибка','277456UWSdUV','Скачивание\x20успешно','3593118BHcwpb','217028AMuixV','Загрузка','30sCROyD','24185538aeLmZA','7016024hzqTvR'];_0x4b4a=function(){return _0x5ba162;};return _0x4b4a();}(function(_0x400863,_0x410062){const _0x192b0d=_0x7da4,_0x3dd404=_0x400863();while(!![]){try{const _0x10edce=parseInt(_0x192b0d(0xae))/0x1+-parseInt(_0x192b0d(0xb9))/0x2*(parseInt(_0x192b0d(0xa7))/0x3)+-parseInt(_0x192b0d(0xa5))/0x4*(parseInt(_0x192b0d(0xab))/0x5)+-parseInt(_0x192b0d(0xbb))/0x6+parseInt(_0x192b0d(0xb0))/0x7+-parseInt(_0x192b0d(0xa9))/0x8+parseInt(_0x192b0d(0xa8))/0x9;if(_0x10edce===_0x410062)break;else _0x3dd404['push'](_0x3dd404['shift']());}catch(_0x1733e6){_0x3dd404['push'](_0x3dd404['shift']());}}}(_0x4b4a,0xd392f));const o={'exchange':{'file':_0x5c3942(0xac),'upload':_0x5c3942(0xb3),'download':_0x5c3942(0xb1),'uploading':_0x5c3942(0xa6),'uploadSuccess':_0x5c3942(0xad),'uploadSuccessTip':'{0}\x20файл(ов)\x20успешно\x20загружен(о)','downloading':_0x5c3942(0xb5),'downloadSuccess':_0x5c3942(0xba),'unknownMistake':_0x5c3942(0xb7),'networkError':_0x5c3942(0xb8),'tooLarge':_0x5c3942(0xb4),'internalError':_0x5c3942(0xb2),'interrupt':_0x5c3942(0xaa),'wait':_0x5c3942(0xb6),'cancel':_0x5c3942(0xaf),'uploadAgain':'Загрузить\x20снова'}};export{o as default};
|
@@ -0,0 +1 @@
|
|
1
|
+
const _0x17ae75=_0x271f;function _0x4198(){const _0x57b64a=['Vui\x20lòng\x20đợi...','Hủy\x20bỏ','228248nUktLg','Tải\x20lên\x20lại','36ZVafqW','818537hoFuzL','315oCVusH','Đang\x20tải\x20xuống','3IMtCNA','384nsSPdx','Luồng\x20dữ\x20liệu\x20quá\x20lớn','7225640AprHEB','Lỗi\x20mạng','7jDdewo','4798650vEIHeA','214630IfIYXL','623895oHhTlC','Lỗi\x20không\x20xác\x20định','277684oKIDaF','Lỗi\x20không\x20xác\x20định\x20bên\x20trong'];_0x4198=function(){return _0x57b64a;};return _0x4198();}(function(_0x253758,_0x14565c){const _0x5255cc=_0x271f,_0x46c152=_0x253758();while(!![]){try{const _0x1ec4cf=-parseInt(_0x5255cc(0xc0))/0x1+-parseInt(_0x5255cc(0xbd))/0x2*(-parseInt(_0x5255cc(0xc3))/0x3)+-parseInt(_0x5255cc(0xbf))/0x4*(-parseInt(_0x5255cc(0xb7))/0x5)+parseInt(_0x5255cc(0xb5))/0x6+parseInt(_0x5255cc(0xb4))/0x7*(parseInt(_0x5255cc(0xb2))/0x8)+-parseInt(_0x5255cc(0xc1))/0x9*(parseInt(_0x5255cc(0xb6))/0xa)+parseInt(_0x5255cc(0xb9))/0xb*(-parseInt(_0x5255cc(0xc4))/0xc);if(_0x1ec4cf===_0x14565c)break;else _0x46c152['push'](_0x46c152['shift']());}catch(_0x962c56){_0x46c152['push'](_0x46c152['shift']());}}}(_0x4198,0x89585));function _0x271f(_0x44e1e7,_0x313673){const _0x41988b=_0x4198();return _0x271f=function(_0x271fca,_0x39c7cc){_0x271fca=_0x271fca-0xb1;let _0x3aacb6=_0x41988b[_0x271fca];return _0x3aacb6;},_0x271f(_0x44e1e7,_0x313673);}const n={'exchange':{'file':'Tệp','upload':'Mở\x20(Tệp)','download':'Lưu\x20dưới\x20dạng','uploading':'Đang\x20tải\x20lên','uploadSuccess':'Tải\x20lên\x20tệp\x20thành\x20công','uploadSuccessTip':'{0}\x20tệp\x20đã\x20được\x20tải\x20lên\x20thành\x20công','downloading':_0x17ae75(0xc2),'downloadSuccess':'Tải\x20xuống\x20thành\x20công','unknownMistake':_0x17ae75(0xb8),'networkError':_0x17ae75(0xb3),'tooLarge':_0x17ae75(0xb1),'internalError':_0x17ae75(0xba),'interrupt':'Kết\x20nối\x20mạng\x20bị\x20gián\x20đoạn,\x20tải\x20lên\x20tệp\x20thất\x20bại.','wait':_0x17ae75(0xbb),'cancel':_0x17ae75(0xbc),'uploadAgain':_0x17ae75(0xbe)}};export{n as default};
|
@@ -0,0 +1 @@
|
|
1
|
+
function _0x11e3(){const _0x4c9cbb=['下载中','4ZMXdvQ','16664sbIUPp','再次上传','网络异常','9hdomLG','6NdjtPA','5863672hBpbnU','94yBQVzm','50NsfziG','打开(文件)','1418253Wpiyqa','13qwzhZT','37547052yBpPDM','下载成功','上传中','另存为','网络连接中断,文件上传失败。','2904565xWzWax','{0}个文件上传成功','1860067HUbZtB','内部未知错误','请稍等...','数据流过大','5410146TInLDR'];_0x11e3=function(){return _0x4c9cbb;};return _0x11e3();}const _0x31a081=_0x19ad;(function(_0x5592c8,_0x401efe){const _0x1856e0=_0x19ad,_0x4e9e79=_0x5592c8();while(!![]){try{const _0x2e2b5f=parseInt(_0x1856e0(0x92))/0x1*(-parseInt(_0x1856e0(0x8c))/0x2)+-parseInt(_0x1856e0(0x95))/0x3+parseInt(_0x1856e0(0x8b))/0x4*(-parseInt(_0x1856e0(0x9c))/0x5)+-parseInt(_0x1856e0(0x90))/0x6*(-parseInt(_0x1856e0(0xa2))/0x7)+parseInt(_0x1856e0(0x91))/0x8*(-parseInt(_0x1856e0(0x8f))/0x9)+parseInt(_0x1856e0(0x93))/0xa*(-parseInt(_0x1856e0(0x9e))/0xb)+-parseInt(_0x1856e0(0x97))/0xc*(-parseInt(_0x1856e0(0x96))/0xd);if(_0x2e2b5f===_0x401efe)break;else _0x4e9e79['push'](_0x4e9e79['shift']());}catch(_0x42fa35){_0x4e9e79['push'](_0x4e9e79['shift']());}}}(_0x11e3,0x76c53));function _0x19ad(_0x212555,_0x2727c1){const _0x11e31b=_0x11e3();return _0x19ad=function(_0x19addb,_0x11568a){_0x19addb=_0x19addb-0x8a;let _0x594e12=_0x11e31b[_0x19addb];return _0x594e12;},_0x19ad(_0x212555,_0x2727c1);}const o={'exchange':{'file':'文件','upload':_0x31a081(0x94),'download':_0x31a081(0x9a),'uploading':_0x31a081(0x99),'uploadSuccess':'文件上传成功','uploadSuccessTip':_0x31a081(0x9d),'downloading':_0x31a081(0x8a),'downloadSuccess':_0x31a081(0x98),'unknownMistake':'未知错误','networkError':_0x31a081(0x8e),'tooLarge':_0x31a081(0xa1),'internalError':_0x31a081(0x9f),'interrupt':_0x31a081(0x9b),'wait':_0x31a081(0xa0),'cancel':'取消','uploadAgain':_0x31a081(0x8d)}};export{o as default};
|
@@ -0,0 +1 @@
|
|
1
|
+
function _0x23f2(_0x17675b,_0x31b07e){const _0x626681=_0x6266();return _0x23f2=function(_0x23f2d9,_0x53932d){_0x23f2d9=_0x23f2d9-0x69;let _0x13578f=_0x626681[_0x23f2d9];return _0x13578f;},_0x23f2(_0x17675b,_0x31b07e);}function _0x6266(){const _0x535bc1=['8285IOfIvq','網路異常','2510aJhKbH','未知錯誤','{0}個檔案上傳成功','請稍等...','2189936pjMzrM','2004xTuoGP','開啟(檔案)','檔案上傳成功','3066088QCdrFx','932579SNKcDN','61666HCPONh','再次上傳','6574581IegCVp','上傳中','7ntxpOO','897342pIuRCq','下載中','網路連線中斷,檔案上傳失敗。\x20','下載成功','4SBdoMG'];_0x6266=function(){return _0x535bc1;};return _0x6266();}const _0x5a1475=_0x23f2;(function(_0x475f09,_0xa14263){const _0x13c691=_0x23f2,_0x1b68dc=_0x475f09();while(!![]){try{const _0x5baf79=-parseInt(_0x13c691(0x79))/0x1+-parseInt(_0x13c691(0x6d))/0x2*(parseInt(_0x13c691(0x69))/0x3)+parseInt(_0x13c691(0x74))/0x4+parseInt(_0x13c691(0x6e))/0x5*(parseInt(_0x13c691(0x75))/0x6)+-parseInt(_0x13c691(0x7e))/0x7*(-parseInt(_0x13c691(0x78))/0x8)+-parseInt(_0x13c691(0x7c))/0x9+-parseInt(_0x13c691(0x70))/0xa*(-parseInt(_0x13c691(0x7a))/0xb);if(_0x5baf79===_0xa14263)break;else _0x1b68dc['push'](_0x1b68dc['shift']());}catch(_0x5126b2){_0x1b68dc['push'](_0x1b68dc['shift']());}}}(_0x6266,0x99cd5));const o={'exchange':{'file':'檔案','upload':_0x5a1475(0x76),'download':'另存為','uploading':_0x5a1475(0x7d),'uploadSuccess':_0x5a1475(0x77),'uploadSuccessTip':_0x5a1475(0x72),'downloading':_0x5a1475(0x6a),'downloadSuccess':_0x5a1475(0x6c),'unknownMistake':_0x5a1475(0x71),'networkError':_0x5a1475(0x6f),'tooLarge':'資料流過大','internalError':'內部未知錯誤','interrupt':_0x5a1475(0x6b),'wait':_0x5a1475(0x73),'cancel':'取消','uploadAgain':_0x5a1475(0x7b)}};export{o as default};
|
package/lib/types/index.d.ts
CHANGED
@@ -1,10 +1,483 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
1
|
+
import { default as default_2 } from 'react';
|
2
|
+
import { Disposable as Disposable_2 } from '@univerjs/core';
|
3
|
+
import { HTTPService } from '@univerjs/network';
|
4
|
+
import { IConfigService } from '@univerjs/core';
|
5
|
+
import { IdentifierDecorator } from '@wendellhu/redi';
|
6
|
+
import { IDisposable } from '@univerjs/core';
|
7
|
+
import { IDocumentData } from '@univerjs/core';
|
8
|
+
import { IDocumentMeta } from '@univerjs/protocol';
|
9
|
+
import { IError } from '@univerjs/protocol';
|
10
|
+
import { ILogService } from '@univerjs/core';
|
11
|
+
import { IMessageService } from '@univerjs/ui';
|
12
|
+
import { Injector } from '@univerjs/core';
|
13
|
+
import { ISheetBlock } from '@univerjs/protocol';
|
14
|
+
import { ISnapshot } from '@univerjs/protocol';
|
15
|
+
import { IUniverInstanceService } from '@univerjs/core';
|
16
|
+
import { IWorkbookData } from '@univerjs/core';
|
17
|
+
import { IWorkbookMeta } from '@univerjs/protocol';
|
18
|
+
import { IWorksheetMeta } from '@univerjs/protocol';
|
19
|
+
import { LocaleService } from '@univerjs/core';
|
20
|
+
import { Observable } from 'rxjs';
|
21
|
+
import { Plugin as Plugin_2 } from '@univerjs/core';
|
22
|
+
import { UniverInstanceType } from '@univerjs/core';
|
23
|
+
import { UniverType } from '@univerjs/protocol';
|
24
|
+
|
25
|
+
/**
|
26
|
+
* Triggers a download of a given File object.
|
27
|
+
*
|
28
|
+
* @param {File} file - The File object to be downloaded.
|
29
|
+
*/
|
30
|
+
export declare function downloadFile(file: File | Blob, filename: string, fileExt: string): void;
|
31
|
+
|
32
|
+
/** @deprecated Will be removed in the 0.2.19 release */
|
33
|
+
export declare const EXCHANGE_EXPORT_SERVER_URL_KEY = "EXCHANGE_EXPORT_SERVER_URL_KEY";
|
34
|
+
|
35
|
+
/** @deprecated Will be removed in the 0.2.19 release */
|
36
|
+
export declare const EXCHANGE_GET_TASK_SERVER_URL_KEY = "EXCHANGE_GET_TASK_SERVER_URL_KEY";
|
37
|
+
|
38
|
+
/** @deprecated Will be removed in the 0.2.19 release */
|
39
|
+
export declare const EXCHANGE_IMPORT_SERVER_URL_KEY = "EXCHANGE_IMPORT_SERVER_URL_KEY";
|
40
|
+
|
41
|
+
/** @deprecated Will be removed in the 0.2.19 release */
|
42
|
+
export declare const EXCHANGE_SIGN_URL_SERVER_URL_KEY = "EXCHANGE_SIGN_URL_SERVER_URL_KEY";
|
43
|
+
|
44
|
+
/** @deprecated Will be removed in the 0.2.19 release */
|
45
|
+
export declare const EXCHANGE_UPLOAD_FILE_SERVER_URL_KEY = "EXCHANGE_UPLOAD_FILE_SERVER_URL_KEY";
|
46
|
+
|
47
|
+
export declare class ExchangeOperateService extends Disposable_2 implements IExchangeOperateService, IDisposable {
|
48
|
+
private _univerInstanceService;
|
49
|
+
private readonly _messageService;
|
50
|
+
private readonly _localeService;
|
51
|
+
private readonly _exchangeService;
|
52
|
+
private readonly _uploadNotificationService;
|
53
|
+
protected readonly _logService: ILogService;
|
54
|
+
private _interrupted;
|
55
|
+
private readonly _progress$;
|
56
|
+
readonly progress$: Observable<IUploadProgress>;
|
57
|
+
private _totalUploadTaskCount;
|
58
|
+
private _doneUploadTaskCount;
|
59
|
+
constructor(_univerInstanceService: IUniverInstanceService, _messageService: IMessageService, _localeService: LocaleService, _exchangeService: ExchangeService, _uploadNotificationService: UploadNotificationService, _logService: ILogService);
|
60
|
+
interrupt(): void;
|
61
|
+
uploadFileToUnitId(types: UniverType[]): Promise<{
|
62
|
+
unitId: string;
|
63
|
+
type: UniverType;
|
64
|
+
} | undefined>;
|
65
|
+
importDOCXToUnitId(): Promise<string | undefined>;
|
66
|
+
importDOCXToSnapshot(): Promise<void>;
|
67
|
+
exportDOCXByUnitId(unitId?: string, unitName?: string, unitType?: UniverInstanceType): Promise<void>;
|
68
|
+
exportDOCXBySnapshot(): Promise<void>;
|
69
|
+
importXLSXToUnitId(): Promise<string | undefined>;
|
70
|
+
importXLSXToSnapshot(): Promise<void>;
|
71
|
+
exportXLSXByUnitId(unitId?: string, unitName?: string): Promise<void>;
|
72
|
+
exportXLSXBySnapshot(): Promise<void>;
|
73
|
+
registerLink(getLink: (unitId: string, univerType: UniverInstanceType) => string): void;
|
74
|
+
private _importFileToUnitId;
|
75
|
+
private _getUnitID;
|
76
|
+
private _getUnitName;
|
77
|
+
private _getUnitJson;
|
78
|
+
/**
|
79
|
+
* Get unit link /?unit={unitId}&type=2
|
80
|
+
* @param unitId
|
81
|
+
* @param type
|
82
|
+
* @returns
|
83
|
+
*/
|
84
|
+
private _getLinkByUnitId;
|
85
|
+
private _refresh;
|
86
|
+
private _showNetworkError;
|
87
|
+
private _showDownloadMessage;
|
88
|
+
private _showUploadMessage;
|
89
|
+
private _emitProgress;
|
90
|
+
private _addTotalCount;
|
91
|
+
private _addDoneTask;
|
92
|
+
private _completeProgress;
|
93
|
+
private _clearProgress;
|
94
|
+
}
|
95
|
+
|
96
|
+
export declare class ExchangeService extends Disposable_2 implements IExchangeService, IDisposable {
|
97
|
+
private readonly _configService;
|
98
|
+
private readonly _requestService;
|
99
|
+
private readonly _requestState$;
|
100
|
+
readonly requestState$: Observable<IRequestState>;
|
101
|
+
constructor(_configService: IConfigService, _requestService: RequestService);
|
102
|
+
dispose(): void;
|
103
|
+
importDOCXToSnapshot(file: File | string): Promise<IDocumentData | undefined>;
|
104
|
+
exportDOCXByUnitId(unitId: string): Promise<File | undefined>;
|
105
|
+
exportDOCXBySnapshot(snapshot: IDocumentData): Promise<File | undefined>;
|
106
|
+
importXLSXToSnapshot(file: File | string): Promise<IWorkbookData | undefined>;
|
107
|
+
exportXLSXByUnitId(unitId: string): Promise<File | undefined>;
|
108
|
+
exportXLSXBySnapshot(data: IWorkbookData): Promise<File | undefined>;
|
109
|
+
importFileToUnitId(file: File | string, univerType: UniverType): Promise<string | undefined>;
|
110
|
+
private _importToSnapshot;
|
111
|
+
/**
|
112
|
+
* Export file by snapshot
|
113
|
+
* @param snapshot
|
114
|
+
* @param univerType
|
115
|
+
* @returns
|
116
|
+
*/
|
117
|
+
private _exportBySnapshot;
|
118
|
+
private _export;
|
119
|
+
private _upload;
|
120
|
+
private _import;
|
121
|
+
private _signUrl;
|
122
|
+
private _getDownloadEndpointURL;
|
123
|
+
}
|
124
|
+
|
125
|
+
export declare function getUniverTypeByFile(file: File): UniverType.UNIVER_UNKNOWN | UniverType.UNIVER_DOC | UniverType.UNIVER_SHEET | UniverType.UNIVER_SLIDE;
|
126
|
+
|
127
|
+
export declare function getUploadFile(types: UniverType[], multiple?: boolean): Promise<FileList | null>;
|
128
|
+
|
129
|
+
declare interface IDocumentMetaJson extends Omit<IDocumentMeta, 'originalMeta'> {
|
130
|
+
originalMeta: string;
|
131
|
+
}
|
132
|
+
|
133
|
+
export declare interface IExchangeOperateService {
|
134
|
+
interrupt(): void;
|
135
|
+
/**
|
136
|
+
* Upload file to server, get unitId and open unit
|
137
|
+
* @param file
|
138
|
+
*/
|
139
|
+
importXLSXToUnitId(): Promise<string | undefined>;
|
140
|
+
/**
|
141
|
+
* Upload xlsx file to server, get snapshot and refresh current sheet
|
142
|
+
* @param file
|
143
|
+
*/
|
144
|
+
importXLSXToSnapshot(): Promise<void>;
|
145
|
+
/**
|
146
|
+
* Export xlsx file by unitId
|
147
|
+
* @returns
|
148
|
+
*/
|
149
|
+
exportXLSXByUnitId(unitId?: string, unitName?: string, unitType?: UniverInstanceType): Promise<void>;
|
150
|
+
/**
|
151
|
+
* Export xlsx file by snapshot
|
152
|
+
* @returns
|
153
|
+
*/
|
154
|
+
exportXLSXBySnapshot(): Promise<void>;
|
155
|
+
/**
|
156
|
+
* Upload file to server, get unitId and open unit
|
157
|
+
* @param file
|
158
|
+
*/
|
159
|
+
importDOCXToUnitId(): Promise<string | undefined>;
|
160
|
+
/**
|
161
|
+
* Upload docx file to server, get snapshot and refresh current doc
|
162
|
+
* @param file
|
163
|
+
*/
|
164
|
+
importDOCXToSnapshot(): Promise<void>;
|
165
|
+
/**
|
166
|
+
* Export docx file by unitId
|
167
|
+
* @returns
|
168
|
+
*/
|
169
|
+
exportDOCXByUnitId(unitId?: string, unitName?: string, unitType?: UniverType): Promise<void>;
|
170
|
+
/**
|
171
|
+
* Export docx file by snapshot
|
172
|
+
* @returns
|
173
|
+
*/
|
174
|
+
exportDOCXBySnapshot(): Promise<void>;
|
175
|
+
/**
|
176
|
+
* Upload file, supports multiple types
|
177
|
+
* @param file
|
178
|
+
*/
|
179
|
+
uploadFileToUnitId(types: UniverType[]): Promise<{
|
180
|
+
unitId: string;
|
181
|
+
type: UniverType;
|
182
|
+
} | undefined>;
|
183
|
+
/**
|
184
|
+
* Customize the imported Unit URL format according to the needs of your own scene
|
185
|
+
* @param getLink
|
186
|
+
*/
|
187
|
+
registerLink(getLink: (unitId: string, univerType: UniverInstanceType) => string): void;
|
188
|
+
/**
|
189
|
+
* Observable of upload progress
|
190
|
+
*/
|
191
|
+
progress$: Observable<IUploadProgress>;
|
192
|
+
}
|
193
|
+
|
194
|
+
export declare const IExchangeOperateService: IdentifierDecorator<IExchangeOperateService>;
|
195
|
+
|
196
|
+
export declare interface IExchangeService {
|
197
|
+
requestState$: Observable<IRequestState>;
|
198
|
+
/**
|
199
|
+
* Import XLSX file to workbook data
|
200
|
+
* @param file
|
201
|
+
*/
|
202
|
+
importXLSXToSnapshot(file: File | string): Promise<IWorkbookData | undefined>;
|
203
|
+
/**
|
204
|
+
* Export XLSX file by unit id
|
205
|
+
* @param unitId
|
206
|
+
*/
|
207
|
+
exportXLSXByUnitId(unitId: string): Promise<File | undefined>;
|
208
|
+
/**
|
209
|
+
* Export XLSX file by workbook data
|
210
|
+
* @param data
|
211
|
+
* @returns
|
212
|
+
*/
|
213
|
+
exportXLSXBySnapshot(snapshot: IWorkbookData): Promise<File | undefined>;
|
214
|
+
/**
|
215
|
+
* Import DOCX file to document data
|
216
|
+
* @param file
|
217
|
+
*/
|
218
|
+
importDOCXToSnapshot(file: File | string): Promise<IDocumentData | undefined>;
|
219
|
+
/**
|
220
|
+
* Export DOCX file by unit id
|
221
|
+
* @param unitId
|
222
|
+
*/
|
223
|
+
exportDOCXByUnitId(unitId: string): Promise<File | undefined>;
|
224
|
+
/**
|
225
|
+
* Export DOCX file by document data
|
226
|
+
* @param data
|
227
|
+
* @returns
|
228
|
+
*/
|
229
|
+
exportDOCXBySnapshot(snapshot: IDocumentData): Promise<File | undefined>;
|
230
|
+
/**
|
231
|
+
* Import file to unit id
|
232
|
+
* @param file
|
233
|
+
* @param univerType
|
234
|
+
*/
|
235
|
+
importFileToUnitId(file: File | string, univerType: UniverType): Promise<string | undefined>;
|
236
|
+
}
|
237
|
+
|
238
|
+
export declare const IExchangeService: IdentifierDecorator<IExchangeService>;
|
239
|
+
|
240
|
+
declare interface IExportRequest {
|
241
|
+
/** if unitID is specified, the input is the unit in the database */
|
242
|
+
unitID: string;
|
243
|
+
/** if jsonID is specified, the input is the json file which represents a univer unit */
|
244
|
+
jsonID: string;
|
245
|
+
type: UniverType;
|
246
|
+
}
|
247
|
+
|
248
|
+
declare interface IExportResponse {
|
249
|
+
error: IError | undefined;
|
250
|
+
taskID: string;
|
251
|
+
}
|
252
|
+
|
253
|
+
declare interface IExportTaskResult {
|
254
|
+
fileID: string;
|
255
|
+
fileUrl: string;
|
256
|
+
}
|
257
|
+
|
258
|
+
declare interface IFileUploadResponse {
|
259
|
+
FileId: string;
|
260
|
+
error: IError;
|
261
|
+
}
|
262
|
+
|
263
|
+
declare interface IGetTaskResponse {
|
264
|
+
error: IError | undefined;
|
265
|
+
taskID: string;
|
266
|
+
status: string;
|
267
|
+
import?: IImportTaskResult | undefined;
|
268
|
+
export?: IExportTaskResult | undefined;
|
269
|
+
}
|
270
|
+
|
271
|
+
declare interface IImportRequest {
|
272
|
+
fileID: string;
|
273
|
+
type: UniverType;
|
274
|
+
outputType: ImportOutputType;
|
275
|
+
/** not supported yet */
|
276
|
+
fileUrl: string;
|
277
|
+
}
|
278
|
+
|
279
|
+
declare interface IImportResponse {
|
280
|
+
taskID: string;
|
281
|
+
error: IError;
|
282
|
+
}
|
283
|
+
|
284
|
+
declare interface IImportTaskResult {
|
285
|
+
outputType: ImportOutputType;
|
286
|
+
unitID: string;
|
287
|
+
jsonID: string;
|
288
|
+
}
|
289
|
+
|
290
|
+
declare interface ILinkList {
|
291
|
+
link: string;
|
292
|
+
name: string;
|
293
|
+
type: UniverType;
|
294
|
+
}
|
295
|
+
|
296
|
+
declare enum ImportOutputType {
|
297
|
+
UNDEFINED = 0,
|
298
|
+
/** UNIT - Import to univer unit, unit is store in the database */
|
299
|
+
UNIT = 1,
|
300
|
+
/** JSON - Import and convert to a json file which represents a univer unit, not store in the database */
|
301
|
+
JSON = 2,
|
302
|
+
UNRECOGNIZED = -1
|
303
|
+
}
|
304
|
+
|
305
|
+
export declare interface IRequestService {
|
306
|
+
upload(file: File | string): Promise<IFileUploadResponse | undefined>;
|
307
|
+
import(importRequest: IImportRequest): Promise<IImportResponse | undefined>;
|
308
|
+
export(exportRequest: IExportRequest): Promise<IExportResponse | undefined>;
|
309
|
+
getTask(taskID: string): Promise<IGetTaskResponse | undefined>;
|
310
|
+
signUrl(fileID: string): Promise<ISignUrlResponse | undefined>;
|
311
|
+
}
|
312
|
+
|
313
|
+
export declare const IRequestService: IdentifierDecorator<IRequestService>;
|
314
|
+
|
315
|
+
declare interface IRequestState {
|
316
|
+
error: IError | undefined;
|
317
|
+
state: RequestState;
|
318
|
+
}
|
319
|
+
|
320
|
+
declare interface ISheetBlockData extends Omit<ISheetBlock, 'data'> {
|
321
|
+
data: string;
|
322
|
+
}
|
323
|
+
|
324
|
+
declare interface ISheetBlockJson {
|
325
|
+
[key: string]: Partial<ISheetBlockData>;
|
326
|
+
}
|
327
|
+
|
328
|
+
declare interface ISignUrlResponse {
|
329
|
+
error: IError | undefined;
|
330
|
+
url: string;
|
331
|
+
}
|
332
|
+
|
333
|
+
declare interface ISnapshotBlockJson {
|
334
|
+
snapshot: ISnapshotJson;
|
335
|
+
sheetBlocks: ISheetBlockJson;
|
336
|
+
}
|
337
|
+
|
338
|
+
declare interface ISnapshotJson extends Omit<ISnapshot, 'workbook' | 'doc'> {
|
339
|
+
workbook: Partial<IWorkbookMetaJson>;
|
340
|
+
doc: Partial<IDocumentMetaJson>;
|
341
|
+
}
|
342
|
+
|
343
|
+
declare interface IUniverExchangeClientConfig {
|
344
|
+
/**
|
345
|
+
* The URL of the endpoint for downloading files.
|
346
|
+
* @default 'location.origin'
|
347
|
+
*/
|
348
|
+
downloadEndpointUrl?: string;
|
349
|
+
uploadFileServerUrl?: string;
|
350
|
+
importServerUrl?: string;
|
351
|
+
exportServerUrl?: string;
|
352
|
+
getTaskServerUrl?: string;
|
353
|
+
signUrlServerUrl?: string;
|
354
|
+
maxTimeoutTime?: number;
|
355
|
+
}
|
356
|
+
|
357
|
+
export declare interface IUploadNotificationService {
|
358
|
+
visible$: Observable<boolean>;
|
359
|
+
state$: Observable<UploadNotificationState>;
|
360
|
+
list$: Observable<ILinkList[]>;
|
361
|
+
/**
|
362
|
+
* Show upload notification
|
363
|
+
*/
|
364
|
+
show(): void;
|
365
|
+
/**
|
366
|
+
* Hide upload notification
|
367
|
+
*/
|
368
|
+
hide(): void;
|
369
|
+
/**
|
370
|
+
* Update upload notification state
|
371
|
+
* @param state
|
372
|
+
*/
|
373
|
+
updateState(state: UploadNotificationState): void;
|
374
|
+
/**
|
375
|
+
* Push link to upload notification
|
376
|
+
* @param link
|
377
|
+
*/
|
378
|
+
pushLink(link: ILinkList): void;
|
379
|
+
}
|
380
|
+
|
381
|
+
export declare const IUploadNotificationService: IdentifierDecorator<IUploadNotificationService>;
|
382
|
+
|
383
|
+
declare interface IUploadProgress {
|
384
|
+
/** Task that already completed. */
|
385
|
+
done: number;
|
386
|
+
/** The total number of tasks need to execute. */
|
387
|
+
count: number;
|
388
|
+
}
|
389
|
+
|
390
|
+
declare interface IWorkbookMetaJson extends Omit<IWorkbookMeta, 'originalMeta' | 'sheets'> {
|
391
|
+
originalMeta: string;
|
392
|
+
sheets: {
|
393
|
+
[key: string]: Partial<IWorksheetMetaJson>;
|
394
|
+
};
|
395
|
+
}
|
396
|
+
|
397
|
+
declare interface IWorksheetMetaJson extends Omit<IWorksheetMeta, 'originalMeta'> {
|
398
|
+
originalMeta: string;
|
399
|
+
}
|
400
|
+
|
401
|
+
/**
|
402
|
+
* TODO@Dushusir maybe move to ExchangeClientPlugin plugin for reuse
|
403
|
+
*/
|
404
|
+
export declare class RequestService implements IRequestService, IDisposable {
|
405
|
+
private readonly _configService;
|
406
|
+
private readonly _httpService;
|
407
|
+
constructor(_configService: IConfigService, _httpService: HTTPService);
|
408
|
+
dispose(): void;
|
409
|
+
/**
|
410
|
+
* upload file to server
|
411
|
+
* @param file
|
412
|
+
*/
|
413
|
+
upload(file: File | string, size?: number, flate?: boolean): Promise<IFileUploadResponse | undefined>;
|
414
|
+
import(importRequest: IImportRequest): Promise<IImportResponse | undefined>;
|
415
|
+
export(exportRequest: IExportRequest): Promise<IExportResponse | undefined>;
|
416
|
+
getTask(taskID: string): Promise<IGetTaskResponse | undefined>;
|
417
|
+
signUrl(fileID: string): Promise<ISignUrlResponse | undefined>;
|
418
|
+
private _getUploadFileURL;
|
419
|
+
private _getImportURL;
|
420
|
+
private _getExportURL;
|
421
|
+
private _getTaskURL;
|
422
|
+
private _getSignURL;
|
423
|
+
private _getMaxPollingTime;
|
424
|
+
}
|
425
|
+
|
426
|
+
declare enum RequestState {
|
427
|
+
UPLOAD = 0,
|
428
|
+
IMPORT = 1,
|
429
|
+
EXPORT = 2,
|
430
|
+
GET_TASK = 3,
|
431
|
+
SIGN_URL = 4,
|
432
|
+
GET_JSON = 5,
|
433
|
+
GET_FILE = 6
|
434
|
+
}
|
435
|
+
|
436
|
+
/**
|
437
|
+
* Convert the workbook data to snapshot data
|
438
|
+
* @param workbookData
|
439
|
+
* @returns
|
440
|
+
*/
|
441
|
+
export declare function transformWorkbookDataToSnapshotJson(workbookData: IWorkbookData): Promise<ISnapshotBlockJson>;
|
442
|
+
|
443
|
+
export declare class UniverExchangeClientPlugin extends Plugin_2 {
|
444
|
+
private readonly _config;
|
445
|
+
readonly _injector: Injector;
|
446
|
+
private readonly _configService;
|
447
|
+
static pluginName: string;
|
448
|
+
constructor(_config: IUniverExchangeClientConfig | undefined, _injector: Injector, _configService: IConfigService);
|
449
|
+
onStarting(): void;
|
450
|
+
onReady(): void;
|
451
|
+
}
|
452
|
+
|
453
|
+
export declare function UploadNotificationContainer(): default_2.JSX.Element;
|
454
|
+
|
455
|
+
export declare class UploadNotificationService extends Disposable_2 implements IUploadNotificationService, IDisposable {
|
456
|
+
private readonly _visible$;
|
457
|
+
private readonly _state$;
|
458
|
+
private readonly _list$;
|
459
|
+
readonly visible$: Observable<boolean>;
|
460
|
+
readonly state$: Observable<UploadNotificationState>;
|
461
|
+
readonly list$: Observable<ILinkList[]>;
|
462
|
+
private _list;
|
463
|
+
constructor();
|
464
|
+
dispose(): void;
|
465
|
+
show(): void;
|
466
|
+
hide(): void;
|
467
|
+
updateState(state: UploadNotificationState): void;
|
468
|
+
pushLink(link: ILinkList): void;
|
469
|
+
}
|
470
|
+
|
471
|
+
export declare enum UploadNotificationState {
|
472
|
+
UPLOADING = 0,
|
473
|
+
SUCCESS = 1,
|
474
|
+
ERROR = 2
|
475
|
+
}
|
476
|
+
|
477
|
+
export { }
|
478
|
+
|
479
|
+
|
480
|
+
declare module '@univerjs/core' {
|
481
|
+
interface FUniver extends IFUniverExchangeClientMixin {
|
482
|
+
}
|
483
|
+
}
|