@univerjs-pro/exchange-client 0.4.2 → 0.5.0-nightly.202411091605

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.
Files changed (58) hide show
  1. package/lib/cjs/facade.js +1 -0
  2. package/lib/cjs/index.js +2 -2
  3. package/lib/cjs/locale/en-US.js +1 -0
  4. package/lib/cjs/locale/fa-IR.js +1 -0
  5. package/lib/cjs/locale/ru-RU.js +1 -0
  6. package/lib/cjs/locale/vi-VN.js +1 -0
  7. package/lib/cjs/locale/zh-CN.js +1 -0
  8. package/lib/cjs/locale/zh-TW.js +1 -0
  9. package/lib/es/facade.js +1 -0
  10. package/lib/es/index.js +2 -2
  11. package/lib/es/locale/en-US.js +1 -0
  12. package/lib/es/locale/fa-IR.js +1 -0
  13. package/lib/es/locale/ru-RU.js +1 -0
  14. package/lib/es/locale/vi-VN.js +1 -0
  15. package/lib/es/locale/zh-CN.js +1 -0
  16. package/lib/es/locale/zh-TW.js +1 -0
  17. package/lib/types/index.d.ts +483 -10
  18. package/lib/umd/facade.js +1 -0
  19. package/lib/umd/index.js +2 -2
  20. package/lib/umd/locale/en-US.js +1 -0
  21. package/lib/umd/locale/fa-IR.js +1 -0
  22. package/lib/umd/locale/ru-RU.js +1 -0
  23. package/lib/umd/locale/vi-VN.js +1 -0
  24. package/lib/umd/locale/zh-CN.js +1 -0
  25. package/lib/umd/locale/zh-TW.js +1 -0
  26. package/package.json +38 -20
  27. package/lib/locale/en-US.json +0 -20
  28. package/lib/locale/fa-IR.json +0 -20
  29. package/lib/locale/ru-RU.json +0 -20
  30. package/lib/locale/vi-VN.json +0 -20
  31. package/lib/locale/zh-CN.json +0 -20
  32. package/lib/locale/zh-TW.json +0 -20
  33. package/lib/types/controllers/config.schema.d.ts +0 -16
  34. package/lib/types/controllers/exchange.controller.d.ts +0 -8
  35. package/lib/types/locale/en-US.d.ts +0 -3
  36. package/lib/types/locale/fa-IR.d.ts +0 -3
  37. package/lib/types/locale/ru-RU.d.ts +0 -3
  38. package/lib/types/locale/vi-VN.d.ts +0 -3
  39. package/lib/types/locale/zh-CN.d.ts +0 -21
  40. package/lib/types/locale/zh-TW.d.ts +0 -3
  41. package/lib/types/plugin.d.ts +0 -11
  42. package/lib/types/services/__tests__/snapshot.spec.d.ts +0 -16
  43. package/lib/types/services/exchange.service.d.ts +0 -87
  44. package/lib/types/services/operate.service.d.ts +0 -121
  45. package/lib/types/services/request.service.d.ts +0 -107
  46. package/lib/types/services/upload-notification.service.d.ts +0 -52
  47. package/lib/types/services/utils/snapshot.d.ts +0 -76
  48. package/lib/types/services/utils/tool.d.ts +0 -19
  49. package/lib/types/views/UploadNotificationContainer.d.ts +0 -2
  50. package/lib/types/views/link-list/LinkList.d.ts +0 -6
  51. package/lib/types/views/upload-again/UploadAgain.d.ts +0 -2
  52. package/lib/types/views/upload-button/UploadButton.d.ts +0 -7
  53. package/lib/types/views/upload-error/UploadError.d.ts +0 -2
  54. package/lib/types/views/upload-notification/UploadNotification.d.ts +0 -2
  55. package/lib/types/views/upload-success/UploadSuccess.d.ts +0 -5
  56. package/lib/types/views/uploading/Uploading.d.ts +0 -2
  57. package/lib/types/views/uploading/upload-cancel/UploadCancel.d.ts +0 -2
  58. package/lib/types/views/uploading/upload-progress/UploadProgress.d.ts +0 -5
@@ -0,0 +1 @@
1
+ const _0x5c0e07=_0x9bcf;(function(_0xb734e6,_0xdc0eda){const _0xd02455=_0x9bcf,_0x1cb493=_0xb734e6();while(!![]){try{const _0xc40a4a=parseInt(_0xd02455(0xf2))/0x1*(-parseInt(_0xd02455(0xe9))/0x2)+-parseInt(_0xd02455(0xe4))/0x3*(-parseInt(_0xd02455(0xef))/0x4)+-parseInt(_0xd02455(0xf0))/0x5+parseInt(_0xd02455(0xdf))/0x6*(parseInt(_0xd02455(0xf3))/0x7)+-parseInt(_0xd02455(0xe2))/0x8+-parseInt(_0xd02455(0xee))/0x9*(-parseInt(_0xd02455(0xe6))/0xa)+-parseInt(_0xd02455(0xf1))/0xb;if(_0xc40a4a===_0xdc0eda)break;else _0x1cb493['push'](_0x1cb493['shift']());}catch(_0x5a4a3b){_0x1cb493['push'](_0x1cb493['shift']());}}}(_0x3684,0x27001));function _0x9bcf(_0x4fcfcb,_0x3239bb){const _0x368419=_0x3684();return _0x9bcf=function(_0x9bcf1f,_0x139482){_0x9bcf1f=_0x9bcf1f-0xdf;let _0x2d809d=_0x368419[_0x9bcf1f];return _0x2d809d;},_0x9bcf(_0x4fcfcb,_0x3239bb);}const e={'exchange':{'file':_0x5c0e07(0xe3),'upload':_0x5c0e07(0xe1),'download':_0x5c0e07(0xeb),'uploading':'Uploading','uploadSuccess':_0x5c0e07(0xe7),'uploadSuccessTip':'{0}\x20file(s)\x20uploaded\x20successfully','downloading':'Downloading','downloadSuccess':_0x5c0e07(0xec),'unknownMistake':_0x5c0e07(0xe8),'networkError':_0x5c0e07(0xe0),'tooLarge':_0x5c0e07(0xea),'internalError':_0x5c0e07(0xe5),'interrupt':'The\x20network\x20connection\x20was\x20interrupted\x20and\x20the\x20file\x20upload\x20failed.','wait':_0x5c0e07(0xed),'cancel':'Cancel','uploadAgain':'Upload\x20again'}};export{e as default};function _0x3684(){const _0x4849f7=['56800jnOqsA','1124420CBwTIt','2eNEtWZ','34195LkLhfJ','378epOVhl','Network\x20error','Open(File)','1140800NjVnlE','File','9GCjYnL','Internal\x20unknown\x20error','30iYLXfn','File\x20uploaded\x20successfully','Unknown\x20mistake','319426fedTXJ','Data\x20is\x20too\x20large','Save\x20As','Download\x20success','Please\x20wait...','899055hArNtg','170548hpEHIS'];_0x3684=function(){return _0x4849f7;};return _0x3684();}
@@ -0,0 +1 @@
1
+ const _0x3531ac=_0x4cdf;(function(_0x5adf6d,_0x509828){const _0x4c41e7=_0x4cdf,_0x380950=_0x5adf6d();while(!![]){try{const _0x2fe0f7=-parseInt(_0x4c41e7(0xe0))/0x1+-parseInt(_0x4c41e7(0xce))/0x2+-parseInt(_0x4c41e7(0xdc))/0x3*(-parseInt(_0x4c41e7(0xd3))/0x4)+parseInt(_0x4c41e7(0xdb))/0x5+-parseInt(_0x4c41e7(0xd4))/0x6+parseInt(_0x4c41e7(0xd0))/0x7*(parseInt(_0x4c41e7(0xd9))/0x8)+parseInt(_0x4c41e7(0xd7))/0x9*(parseInt(_0x4c41e7(0xe5))/0xa);if(_0x2fe0f7===_0x509828)break;else _0x380950['push'](_0x380950['shift']());}catch(_0x11625a){_0x380950['push'](_0x380950['shift']());}}}(_0x25e5,0x71a3d));function _0x4cdf(_0xf9e1ed,_0x8803c7){const _0x25e535=_0x25e5();return _0x4cdf=function(_0x4cdf90,_0x2cdf37){_0x4cdf90=_0x4cdf90-0xcd;let _0x2788c7=_0x25e535[_0x4cdf90];return _0x2788c7;},_0x4cdf(_0xf9e1ed,_0x8803c7);}const o={'exchange':{'file':_0x3531ac(0xd8),'upload':_0x3531ac(0xd6),'download':_0x3531ac(0xe1),'uploading':_0x3531ac(0xd1),'uploadSuccess':_0x3531ac(0xd5),'uploadSuccessTip':_0x3531ac(0xe4),'downloading':_0x3531ac(0xdf),'downloadSuccess':_0x3531ac(0xe2),'unknownMistake':_0x3531ac(0xda),'networkError':_0x3531ac(0xde),'tooLarge':_0x3531ac(0xcf),'internalError':'خطای\x20داخلی\x20ناشناخته','interrupt':_0x3531ac(0xcd),'wait':_0x3531ac(0xe3),'cancel':_0x3531ac(0xd2),'uploadAgain':_0x3531ac(0xdd)}};export{o as default};function _0x25e5(){const _0x457b87=['195632OwQaPM','خطای\x20ناشناخته','1212385akBgXU','2021925NWqRjh','بارگذاری\x20مجدد','خطای\x20شبکه','در\x20حال\x20دانلود','717567nPUmJG','ذخیره\x20به\x20عنوان','دانلود\x20موفقیت\x20آمیز','لطفا\x20صبر\x20کنید...','{0}\x20فایل\x20با\x20موفقیت\x20بارگذاری\x20شد','6849620VCIPMK','اتصال\x20شبکه\x20قطع\x20شد\x20و\x20بارگذاری\x20فایل\x20ناموفق\x20بود.','335958yejmgG','داده\x20خیلی\x20بزرگ\x20است','161YwehJL','در\x20حال\x20بارگذاری','لغو','4UsLXMy','4877046xLCHqW','فایل\x20با\x20موفقیت\x20بارگذاری\x20شد','بازکردن(فایل)','9kbhOkF','فایل'];_0x25e5=function(){return _0x457b87;};return _0x25e5();}
@@ -0,0 +1 @@
1
+ const _0x4f1b5a=_0x3723;function _0x3723(_0x2be402,_0x3c7b54){const _0x307faf=_0x307f();return _0x3723=function(_0x372329,_0x5df5e5){_0x372329=_0x372329-0x197;let _0x1a456f=_0x307faf[_0x372329];return _0x1a456f;},_0x3723(_0x2be402,_0x3c7b54);}function _0x307f(){const _0x57532f=['Отмена','710350rDZxdX','Сетевая\x20ошибка','1308260pVrUzF','Скачивание','521292TnSFML','Загрузить\x20снова','505070lpUSvQ','Пожалуйста,\x20подождите...','Открыть(Файл)','4467tIPAoL','18792422rZEnGK','Файл','9nlOaJX','Загрузка','Скачивание\x20успешно','Файл\x20успешно\x20загружен','28GGLeCQ','719328xDfFJO','{0}\x20файл(ов)\x20успешно\x20загружен(о)','10GplHHs','Сетевое\x20соединение\x20было\x20прервано,\x20и\x20загрузка\x20файла\x20не\x20удалась.','Внутренняя\x20неизвестная\x20ошибка','1812sAgZox'];_0x307f=function(){return _0x57532f;};return _0x307f();}(function(_0x1195a7,_0x44765a){const _0x17d8d6=_0x3723,_0x44799b=_0x1195a7();while(!![]){try{const _0x46ee43=parseInt(_0x17d8d6(0x1a4))/0x1+-parseInt(_0x17d8d6(0x1a0))/0x2+-parseInt(_0x17d8d6(0x1a7))/0x3*(parseInt(_0x17d8d6(0x19c))/0x4)+parseInt(_0x17d8d6(0x199))/0x5*(-parseInt(_0x17d8d6(0x1a2))/0x6)+-parseInt(_0x17d8d6(0x1ae))/0x7*(parseInt(_0x17d8d6(0x197))/0x8)+parseInt(_0x17d8d6(0x1aa))/0x9*(parseInt(_0x17d8d6(0x19e))/0xa)+parseInt(_0x17d8d6(0x1a8))/0xb;if(_0x46ee43===_0x44765a)break;else _0x44799b['push'](_0x44799b['shift']());}catch(_0x37b33d){_0x44799b['push'](_0x44799b['shift']());}}}(_0x307f,0x67220));const o={'exchange':{'file':_0x4f1b5a(0x1a9),'upload':_0x4f1b5a(0x1a6),'download':'Сохранить\x20как','uploading':_0x4f1b5a(0x1ab),'uploadSuccess':_0x4f1b5a(0x1ad),'uploadSuccessTip':_0x4f1b5a(0x198),'downloading':_0x4f1b5a(0x1a1),'downloadSuccess':_0x4f1b5a(0x1ac),'unknownMistake':'Неизвестная\x20ошибка','networkError':_0x4f1b5a(0x19f),'tooLarge':'Данные\x20слишком\x20большие','internalError':_0x4f1b5a(0x19b),'interrupt':_0x4f1b5a(0x19a),'wait':_0x4f1b5a(0x1a5),'cancel':_0x4f1b5a(0x19d),'uploadAgain':_0x4f1b5a(0x1a3)}};export{o as default};
@@ -0,0 +1 @@
1
+ const _0x166166=_0x38af;(function(_0x3c0d7f,_0x319ad0){const _0x56de63=_0x38af,_0x149e4a=_0x3c0d7f();while(!![]){try{const _0xcff47d=parseInt(_0x56de63(0xd4))/0x1*(parseInt(_0x56de63(0xd0))/0x2)+parseInt(_0x56de63(0xca))/0x3+-parseInt(_0x56de63(0xd3))/0x4+parseInt(_0x56de63(0xd8))/0x5+parseInt(_0x56de63(0xd2))/0x6+parseInt(_0x56de63(0xcb))/0x7*(parseInt(_0x56de63(0xcc))/0x8)+-parseInt(_0x56de63(0xde))/0x9*(parseInt(_0x56de63(0xd6))/0xa);if(_0xcff47d===_0x319ad0)break;else _0x149e4a['push'](_0x149e4a['shift']());}catch(_0x534aa1){_0x149e4a['push'](_0x149e4a['shift']());}}}(_0x93c8,0x94c4f));function _0x93c8(){const _0x46e72d=['2563806OlpXZG','4613256qacJLZ','907403iCKRlw','{0}\x20tệp\x20đã\x20được\x20tải\x20lên\x20thành\x20công','190yFfpDz','Vui\x20lòng\x20đợi...','4736405rtqOpG','Kết\x20nối\x20mạng\x20bị\x20gián\x20đoạn,\x20tải\x20lên\x20tệp\x20thất\x20bại.','Mở\x20(Tệp)','Tải\x20lên\x20tệp\x20thành\x20công','Lỗi\x20không\x20xác\x20định','Lỗi\x20không\x20xác\x20định\x20bên\x20trong','933507FEkLak','Tệp','Đang\x20tải\x20lên','Lỗi\x20mạng','Đang\x20tải\x20xuống','1370751mQlEiJ','3480778ynEExJ','16JgRdsA','Lưu\x20dưới\x20dạng','Tải\x20xuống\x20thành\x20công','Tải\x20lên\x20lại','2rSrFnf','Hủy\x20bỏ'];_0x93c8=function(){return _0x46e72d;};return _0x93c8();}function _0x38af(_0x32bece,_0x4305b1){const _0x93c889=_0x93c8();return _0x38af=function(_0x38af18,_0x37a387){_0x38af18=_0x38af18-0xc9;let _0x2f8bc8=_0x93c889[_0x38af18];return _0x2f8bc8;},_0x38af(_0x32bece,_0x4305b1);}const n={'exchange':{'file':_0x166166(0xdf),'upload':_0x166166(0xda),'download':_0x166166(0xcd),'uploading':_0x166166(0xe0),'uploadSuccess':_0x166166(0xdb),'uploadSuccessTip':_0x166166(0xd5),'downloading':_0x166166(0xc9),'downloadSuccess':_0x166166(0xce),'unknownMistake':_0x166166(0xdc),'networkError':_0x166166(0xe1),'tooLarge':'Luồng\x20dữ\x20liệu\x20quá\x20lớn','internalError':_0x166166(0xdd),'interrupt':_0x166166(0xd9),'wait':_0x166166(0xd7),'cancel':_0x166166(0xd1),'uploadAgain':_0x166166(0xcf)}};export{n as default};
@@ -0,0 +1 @@
1
+ const _0x43f711=_0xffb1;(function(_0x949c39,_0xc06ee5){const _0x101cae=_0xffb1,_0x3a1e69=_0x949c39();while(!![]){try{const _0x373c0f=-parseInt(_0x101cae(0xfd))/0x1+-parseInt(_0x101cae(0xfb))/0x2*(-parseInt(_0x101cae(0x104))/0x3)+-parseInt(_0x101cae(0x106))/0x4*(-parseInt(_0x101cae(0x105))/0x5)+parseInt(_0x101cae(0xfa))/0x6+-parseInt(_0x101cae(0xf7))/0x7+-parseInt(_0x101cae(0xfc))/0x8+-parseInt(_0x101cae(0xf8))/0x9;if(_0x373c0f===_0xc06ee5)break;else _0x3a1e69['push'](_0x3a1e69['shift']());}catch(_0x1be020){_0x3a1e69['push'](_0x3a1e69['shift']());}}}(_0x4b5e,0x65d03));function _0x4b5e(){const _0x10e527=['网络异常','再次上传','另存为','上传中','打开(文件)','6UrJcVK','207955sfjrPl','76BoImwy','网络连接中断,文件上传失败。','数据流过大','2149511axpDZU','2174382mkjNkt','下载中','2216094SnnrIU','768682MzqnJd','2569664aKdEsh','641354cKbSSg','文件上传成功'];_0x4b5e=function(){return _0x10e527;};return _0x4b5e();}function _0xffb1(_0x59a396,_0x348d39){const _0x4b5efe=_0x4b5e();return _0xffb1=function(_0xffb195,_0x52c254){_0xffb195=_0xffb195-0xf7;let _0x2ae255=_0x4b5efe[_0xffb195];return _0x2ae255;},_0xffb1(_0x59a396,_0x348d39);}const o={'exchange':{'file':'文件','upload':_0x43f711(0x103),'download':_0x43f711(0x101),'uploading':_0x43f711(0x102),'uploadSuccess':_0x43f711(0xfe),'uploadSuccessTip':'{0}个文件上传成功','downloading':_0x43f711(0xf9),'downloadSuccess':'下载成功','unknownMistake':'未知错误','networkError':_0x43f711(0xff),'tooLarge':_0x43f711(0x108),'internalError':'内部未知错误','interrupt':_0x43f711(0x107),'wait':'请稍等...','cancel':'取消','uploadAgain':_0x43f711(0x100)}};export{o as default};
@@ -0,0 +1 @@
1
+ const _0x542307=_0x2c12;function _0x126a(){const _0x20b4df=['24URQwxl','網路異常','2710270jBuUnU','7BPUUic','280AMYavl','{0}個檔案上傳成功','21469PqwCkM','網路連線中斷,檔案上傳失敗。\x20','下載成功','再次上傳','9028393LIXqlW','檔案上傳成功','9oupiIk','開啟(檔案)','未知錯誤','52240rDtMHD','447636ebvaag','12ZKhSBV','602490XUHIoV','資料流過大','請稍等...','52578vjFAxB','下載中'];_0x126a=function(){return _0x20b4df;};return _0x126a();}(function(_0x1893c6,_0x565b51){const _0x233cb0=_0x2c12,_0xf5366d=_0x1893c6();while(!![]){try{const _0xa8e780=parseInt(_0x233cb0(0x14e))/0x1*(-parseInt(_0x233cb0(0x149))/0x2)+-parseInt(_0x233cb0(0x14b))/0x3*(parseInt(_0x233cb0(0x143))/0x4)+-parseInt(_0x233cb0(0x146))/0x5+-parseInt(_0x233cb0(0x144))/0x6+-parseInt(_0x233cb0(0x151))/0x7*(-parseInt(_0x233cb0(0x14f))/0x8)+parseInt(_0x233cb0(0x140))/0x9*(-parseInt(_0x233cb0(0x14d))/0xa)+parseInt(_0x233cb0(0x155))/0xb*(parseInt(_0x233cb0(0x145))/0xc);if(_0xa8e780===_0x565b51)break;else _0xf5366d['push'](_0xf5366d['shift']());}catch(_0x31c581){_0xf5366d['push'](_0xf5366d['shift']());}}}(_0x126a,0x2a5a2));function _0x2c12(_0x2eb66f,_0x5c7503){const _0x126a3f=_0x126a();return _0x2c12=function(_0x2c126b,_0x471a1b){_0x2c126b=_0x2c126b-0x140;let _0x48d39d=_0x126a3f[_0x2c126b];return _0x48d39d;},_0x2c12(_0x2eb66f,_0x5c7503);}const o={'exchange':{'file':'檔案','upload':_0x542307(0x141),'download':'另存為','uploading':'上傳中','uploadSuccess':_0x542307(0x156),'uploadSuccessTip':_0x542307(0x150),'downloading':_0x542307(0x14a),'downloadSuccess':_0x542307(0x153),'unknownMistake':_0x542307(0x142),'networkError':_0x542307(0x14c),'tooLarge':_0x542307(0x147),'internalError':'內部未知錯誤','interrupt':_0x542307(0x152),'wait':_0x542307(0x148),'cancel':'取消','uploadAgain':_0x542307(0x154)}};export{o as default};
@@ -1,10 +1,483 @@
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
- /** @deprecated Will be removed in the 0.2.19 release */
6
- export { EXCHANGE_EXPORT_SERVER_URL_KEY, EXCHANGE_GET_TASK_SERVER_URL_KEY, EXCHANGE_IMPORT_SERVER_URL_KEY, EXCHANGE_SIGN_URL_SERVER_URL_KEY, EXCHANGE_UPLOAD_FILE_SERVER_URL_KEY } from './services/request.service';
7
- export { IUploadNotificationService, UploadNotificationService, UploadNotificationState } from './services/upload-notification.service';
8
- export { downloadFile, getUniverTypeByFile, getUploadFile } from './services/utils/tool';
9
- export { UploadNotificationContainer } from './views/UploadNotificationContainer';
10
- export { transformWorkbookDataToSnapshotJson } from './services/utils/snapshot';
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
+ }
@@ -0,0 +1 @@
1
+ (function(_0x1d0978,_0x2f2822){const _0x856420=_0x26e3,_0x2fb068=_0x1d0978();while(!![]){try{const _0x369e21=-parseInt(_0x856420(0x13c))/0x1*(-parseInt(_0x856420(0x133))/0x2)+parseInt(_0x856420(0x137))/0x3+-parseInt(_0x856420(0x13b))/0x4+parseInt(_0x856420(0x138))/0x5+parseInt(_0x856420(0x139))/0x6+-parseInt(_0x856420(0x13a))/0x7*(-parseInt(_0x856420(0x13e))/0x8)+-parseInt(_0x856420(0x151))/0x9;if(_0x369e21===_0x2f2822)break;else _0x2fb068['push'](_0x2fb068['shift']());}catch(_0x1f2d83){_0x2fb068['push'](_0x2fb068['shift']());}}}(_0x24cd,0x67a27),function(_0x2a396f,_0x28e6ff){const _0x4e0655=_0x26e3;typeof exports==_0x4e0655(0x144)&&typeof module<'u'?_0x28e6ff(require(_0x4e0655(0x143)),require('@univerjs-pro/exchange-client')):typeof define==_0x4e0655(0x13f)&&define[_0x4e0655(0x14f)]?define([_0x4e0655(0x143),_0x4e0655(0x14b)],_0x28e6ff):(_0x2a396f=typeof globalThis<'u'?globalThis:_0x2a396f||self,_0x28e6ff(_0x2a396f['UniverCore'],_0x2a396f[_0x4e0655(0x14a)]));}(this,function(_0x2b73f6,_0x4b6640){'use strict';const _0x4f7e90=_0x26e3;var _0x32a226=(_0x26aaee=>(_0x26aaee[_0x26aaee['UNIVER_UNKNOWN']=0x0]=_0x4f7e90(0x146),_0x26aaee[_0x26aaee[_0x4f7e90(0x134)]=0x1]=_0x4f7e90(0x134),_0x26aaee[_0x26aaee[_0x4f7e90(0x149)]=0x2]=_0x4f7e90(0x149),_0x26aaee[_0x26aaee[_0x4f7e90(0x148)]=0x3]=_0x4f7e90(0x148),_0x26aaee[_0x26aaee[_0x4f7e90(0x142)]=0x4]=_0x4f7e90(0x142),_0x26aaee[_0x26aaee['UNRECOGNIZED']=-0x1]=_0x4f7e90(0x140),_0x26aaee))(_0x32a226||{});class _0x408e98 extends _0x2b73f6[_0x4f7e90(0x14d)]{async[_0x4f7e90(0x135)](_0x5d4d5e){const _0xdb3e61=_0x4f7e90,_0x21aeff=this[_0xdb3e61(0x14e)][_0xdb3e61(0x147)](_0x4b6640[_0xdb3e61(0x145)]);if(!_0x21aeff)throw new Error(_0xdb3e61(0x132));return _0x21aeff[_0xdb3e61(0x152)](_0x5d4d5e,_0x32a226[_0xdb3e61(0x149)]);}async[_0x4f7e90(0x150)](_0x30cfdf){const _0x4420b6=_0x4f7e90,_0x24296f=this[_0x4420b6(0x14e)]['get'](_0x4b6640[_0x4420b6(0x145)]);if(!_0x24296f)throw new Error(_0x4420b6(0x132));return _0x24296f[_0x4420b6(0x150)](_0x30cfdf);}async[_0x4f7e90(0x141)](_0x417544){const _0x5e6265=_0x4f7e90,_0x26b49d=this[_0x5e6265(0x14e)][_0x5e6265(0x147)](_0x4b6640['IExchangeService']);if(!_0x26b49d)throw new Error(_0x5e6265(0x132));return _0x26b49d[_0x5e6265(0x141)](_0x417544);}async[_0x4f7e90(0x136)](_0x4b1d32){const _0x3ffa31=_0x4f7e90,_0x1b0233=this['_injector'][_0x3ffa31(0x147)](_0x4b6640[_0x3ffa31(0x145)]);if(!_0x1b0233)throw new Error(_0x3ffa31(0x132));return _0x1b0233['exportXLSXBySnapshot'](_0x4b1d32);}async['importDOCXToUnitId'](_0x30a02b){const _0x3b7b07=_0x4f7e90,_0xf037da=this[_0x3b7b07(0x14e)][_0x3b7b07(0x147)](_0x4b6640[_0x3b7b07(0x145)]);if(!_0xf037da)throw new Error(_0x3b7b07(0x132));return _0xf037da[_0x3b7b07(0x152)](_0x30a02b,_0x32a226[_0x3b7b07(0x134)]);}async[_0x4f7e90(0x13d)](_0x353508){const _0x550c88=_0x4f7e90,_0x271926=this[_0x550c88(0x14e)][_0x550c88(0x147)](_0x4b6640[_0x550c88(0x145)]);if(!_0x271926)throw new Error(_0x550c88(0x132));return _0x271926[_0x550c88(0x13d)](_0x353508);}}_0x2b73f6['FUniver'][_0x4f7e90(0x14c)](_0x408e98);}));function _0x26e3(_0x2ad215,_0xd98e91){const _0x24cd13=_0x24cd();return _0x26e3=function(_0x26e357,_0x11629c){_0x26e357=_0x26e357-0x132;let _0x3b2149=_0x24cd13[_0x26e357];return _0x3b2149;},_0x26e3(_0x2ad215,_0xd98e91);}function _0x24cd(){const _0x521fcc=['importFileToUnitId','The\x20exchange\x20service\x20is\x20not\x20available','10BjHeth','UNIVER_DOC','importXLSXToUnitId','exportXLSXBySnapshot','1128633xpkNKF','2503025NEdYvp','4701024xxdyPV','3382869TIxwVg','2564188wcHAaA','20872JHBCCi','importDOCXToSnapshot','8OLgdeM','function','UNRECOGNIZED','exportXLSXByUnitId','UNIVER_PROJECT','@univerjs/core','object','IExchangeService','UNIVER_UNKNOWN','get','UNIVER_SLIDE','UNIVER_SHEET','UniverExchangeClient','@univerjs-pro/exchange-client','extend','FUniver','_injector','amd','importXLSXToSnapshot','10641717AOSOcw'];_0x24cd=function(){return _0x521fcc;};return _0x24cd();}