@univerjs-pro/collaboration-history-endpoint 1.6.0 → 1.6.2

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/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- Object['defineProperty'](exports,Symbol['toStringTag'],{'value':'Module'});let e=require('@univerjs-pro/collaboration-service'),t=require('@univerjs-pro/collaboration-transport-node'),n=require('@univerjs/protocol');var r={'code':n['ErrorCode']['OK'],'message':''},i=class{['_service'];['_disposed']=!0x1;constructor(_0x5e07c8){if(this['_service']=_0x5e07c8,!_0x5e07c8)throw TypeError('UniverHistoryEndpoint\x20requires\x20a\x20service');}['register'](_0x6318fb){if(this['_disposed'])throw new e['CollabError']('INTERNAL_ERROR','History\x20Endpoint\x20is\x20disposed');for(let [_0x145037,_0x367552]of[['list','list'],['creators','creators'],['cs','changesets']])_0x6318fb['get']('/universer-api/history/:unitID/'+_0x145037,_0x38919c=>this['_handleHttp'](_0x38919c,{'name':_0x367552,'unitID':_0x38919c['params']['unitID']}));}async['_handleHttp'](_0x53279c,_0x571bd0){try{if(this['_disposed'])throw new e['CollabError']('INTERNAL_ERROR','History\x20Endpoint\x20is\x20disposed');let _0x19606b=new URL(_0x53279c['incomingMessage']['url']??'/','http://localhost');if(!_0x53279c['userID'])throw new e['CollabError']('UNAUTHENTICATED','HTTP\x20user\x20is\x20not\x20authenticated');let _0x4c2ecc={'userID':_0x53279c['userID'],'customData':_0x53279c['customData']};switch(_0x571bd0['name']){case'list':{let _0x44a837=await this['_service']['getHistoryList']({'unitID':_0x571bd0['unitID'],'length':s(_0x19606b['searchParams']['get']('length')),..._0x19606b['searchParams']['get']('lastLabel')?{'lastLabel':_0x19606b['searchParams']['get']('lastLabel')}:{},...l(_0x19606b['searchParams']['get']('origin')),'userIDs':_0x19606b['searchParams']['getAll']('userIds')['filter'](Boolean)},_0x4c2ecc);f(_0x53279c['response'],0xc8,{'error':r,...o(_0x44a837)});return;}case'creators':{let _0x15f772=await this['_service']['listHistoryCreators']({'unitID':_0x571bd0['unitID']},_0x4c2ecc);f(_0x53279c['response'],0xc8,{'error':r,'creators':_0x15f772['creators']['map'](({userID:_0x28a541,..._0xc85dbb})=>({..._0xc85dbb,'userId':_0x28a541}))});return;}case'changesets':{let _0x3562dc=c(_0x19606b['searchParams']['get']('startRevision'),'startRevision'),_0x26f4b0=c(_0x19606b['searchParams']['get']('endRevision'),'endRevision'),_0x2db6e7=await this['_service']['getHistoryChangesets']({'unitID':_0x571bd0['unitID'],'startRevision':_0x3562dc,'endRevision':_0x26f4b0},_0x4c2ecc);f(_0x53279c['response'],0xc8,{'error':r,..._0x2db6e7,'changesets':_0x2db6e7['changesets']['map'](a)});return;}}}catch(_0x360fcb){u(_0x53279c['response'],_0x360fcb);}}['dispose'](){this['_disposed']=!0x0;}};function a(_0x1d6eeb){let _0x376f54={..._0x1d6eeb};return delete _0x376f54['metadata'],_0x376f54;}function o(_0x5263c0){let _0x261c95=Object['fromEntries'](Object['entries'](_0x5263c0['entities']['datas'])['map'](([_0x44d8ce,{userID:_0x393224,unitID:_0x577eba,userIDs:_0x28ab53,..._0x177000}])=>[_0x44d8ce,{..._0x177000,'userId':_0x393224,'unitId':_0x577eba,'userIds':_0x28ab53}]));return{..._0x5263c0,'entities':{..._0x5263c0['entities'],'datas':_0x261c95}};}function s(_0x832cda){return _0x832cda===null||_0x832cda===''?0x14:c(_0x832cda,'length');}function c(_0xd17ffa,_0x189e29){if(!_0xd17ffa||!/^\d+$/['test'](_0xd17ffa))throw new e['CollabError']('INVALID_REQUEST',_0x189e29+'\x20must\x20be\x20a\x20positive\x20integer');let _0x22b283=Number(_0xd17ffa);if(!Number['isSafeInteger'](_0x22b283)||_0x22b283<0x1)throw new e['CollabError']('INVALID_REQUEST',_0x189e29+'\x20must\x20be\x20a\x20positive\x20integer');return _0x22b283;}function l(_0x420f44){if(_0x420f44===null||_0x420f44===''||_0x420f44==='0')return{};if(_0x420f44==='1'||_0x420f44==='2')return{'origin':Number(_0x420f44)};throw new e['CollabError']('INVALID_REQUEST','origin\x20must\x20be\x200,\x201\x20or\x202');}function u(_0x2320a7,_0x5ba6af){let _0xfabc17=d(_0x5ba6af);f(_0x2320a7,_0xfabc17['status'],{'error':_0xfabc17['error']});}function d(_0x49d381){if(_0x49d381 instanceof t['NodeTransportError'])return{'status':_0x49d381['code']==='REQUEST_BODY_TOO_LARGE'?0x19d:_0x49d381['code']==='TRANSPORT_DISPOSED'?0x1f7:0x190,'error':{'code':_0x49d381['code']==='TRANSPORT_DISPOSED'?n['ErrorCode']['INTERNAL_ERROR']:n['ErrorCode']['INVALID_ARGUMENT'],'message':_0x49d381['message']}};if(!(_0x49d381 instanceof e['CollabError']))return{'status':0x1f4,'error':{'code':n['ErrorCode']['INTERNAL_ERROR'],'message':'Internal\x20server\x20error'}};let _0x2e2846={'UNAUTHENTICATED':{'status':0x191,'code':n['ErrorCode']['UNAUTHENTICATED']},'INVALID_REQUEST':{'status':0x190,'code':n['ErrorCode']['INVALID_ARGUMENT']},'UNIT_NOT_FOUND':{'status':0x194,'code':n['ErrorCode']['NOT_FOUND']},'PERMISSION_DENIED':{'status':0x193,'code':n['ErrorCode']['PERMISSION_DENIED']},'OT_CONFLICT':{'status':0x199,'code':n['ErrorCode']['APPLY_REJECT']},'REVISION_MISMATCH':{'status':0x199,'code':n['ErrorCode']['CHANGESET_REVISION_CONFILICT']},'ADAPTER_FAILURE':{'status':0x1f7,'code':n['ErrorCode']['INTERNAL_ERROR']},'INTERNAL_ERROR':{'status':0x1f4,'code':n['ErrorCode']['INTERNAL_ERROR']},'LICENSE_INVALID':{'status':0x1f4,'code':n['ErrorCode']['LICENSE_INVALID']},'LICENSE_POLICY_INVALID':{'status':0x1f4,'code':n['ErrorCode']['LICENSE_POLICY_INVALID']},'LICENSE_VERSION_NOT_ALLOWED':{'status':0x1f4,'code':n['ErrorCode']['LICENSE_VERSION_NOT_ALLOWED']},'LICENSE_UNIT_TYPE_REJECTED':{'status':0x193,'code':n['ErrorCode']['LICENSE_UNIT_TYPE_REJECTED']},'LICENSE_DOMAIN_REJECTED':{'status':0x193,'code':n['ErrorCode']['LICENSE_DOMAIN_REJECTED']}}[_0x49d381['code']];return{'status':_0x2e2846['status'],'error':{'code':_0x2e2846['code'],'message':_0x49d381['message']}};}function f(_0x193d0c,_0x2db17f,_0x2d52b7){_0x193d0c['writableEnded']||_0x193d0c['destroyed']||(_0x193d0c['statusCode']=_0x2db17f,_0x193d0c['setHeader']('content-type','application/json;\x20charset=utf-8'),_0x193d0c['end'](JSON['stringify'](_0x2d52b7)));}exports['UniverHistoryEndpoint']=i;
1
+ Object['defineProperty'](exports,Symbol['toStringTag'],{'value':'Module'});let e=require('@univerjs-pro/collaboration-service'),t=require('@univerjs-pro/collaboration-transport-node'),n=require('@univerjs/protocol');var r={'code':n['ErrorCode']['OK'],'message':''},i=class{['_service'];['_disposed']=!0x1;constructor(_0x2e1af){if(this['_service']=_0x2e1af,!_0x2e1af)throw TypeError('UniverHistoryEndpoint\x20requires\x20a\x20service');}['register'](_0x2e421d){if(this['_disposed'])throw new e['CollabError']('INTERNAL_ERROR','History\x20Endpoint\x20is\x20disposed');for(let [_0x2c8287,_0x332eb1]of[['list','list'],['creators','creators'],['cs','changesets']])_0x2e421d['get']('/universer-api/history/:unitID/'+_0x2c8287,_0x3614c5=>this['_handleHttp'](_0x3614c5,{'name':_0x332eb1,'unitID':_0x3614c5['params']['unitID']}));}async['_handleHttp'](_0x4da4eb,_0x3e5f98){try{if(this['_disposed'])throw new e['CollabError']('INTERNAL_ERROR','History\x20Endpoint\x20is\x20disposed');let _0x5f5d05=new URL(_0x4da4eb['incomingMessage']['url']??'/','http://localhost');if(!_0x4da4eb['userID'])throw new e['CollabError']('UNAUTHENTICATED','HTTP\x20user\x20is\x20not\x20authenticated');let _0xfbf9b6={'userID':_0x4da4eb['userID'],'customData':_0x4da4eb['customData']};switch(_0x3e5f98['name']){case'list':{let _0x329fc9=await this['_service']['getHistoryList']({'unitID':_0x3e5f98['unitID'],'length':s(_0x5f5d05['searchParams']['get']('length')),..._0x5f5d05['searchParams']['get']('lastLabel')?{'lastLabel':_0x5f5d05['searchParams']['get']('lastLabel')}:{},...l(_0x5f5d05['searchParams']['get']('origin')),'userIDs':_0x5f5d05['searchParams']['getAll']('userIds')['filter'](Boolean)},_0xfbf9b6);f(_0x4da4eb['response'],0xc8,{'error':r,...o(_0x329fc9)});return;}case'creators':{let _0x466391=await this['_service']['listHistoryCreators']({'unitID':_0x3e5f98['unitID']},_0xfbf9b6);f(_0x4da4eb['response'],0xc8,{'error':r,'creators':_0x466391['creators']['map'](({userID:_0x3b5b9a,..._0x56654f})=>({..._0x56654f,'userId':_0x3b5b9a}))});return;}case'changesets':{let _0x4550b6=c(_0x5f5d05['searchParams']['get']('startRevision'),'startRevision'),_0x33e071=c(_0x5f5d05['searchParams']['get']('endRevision'),'endRevision'),_0x1969ca=await this['_service']['getHistoryChangesets']({'unitID':_0x3e5f98['unitID'],'startRevision':_0x4550b6,'endRevision':_0x33e071},_0xfbf9b6);f(_0x4da4eb['response'],0xc8,{'error':r,..._0x1969ca,'changesets':_0x1969ca['changesets']['map'](a)});return;}}}catch(_0x130011){u(_0x4da4eb['response'],_0x130011);}}['dispose'](){this['_disposed']=!0x0;}};function a(_0x3a6231){let _0xa614ec={..._0x3a6231};return delete _0xa614ec['metadata'],_0xa614ec;}function o(_0x3e147a){let _0x13e5cf=Object['fromEntries'](Object['entries'](_0x3e147a['entities']['datas'])['map'](([_0x8b04a2,{userID:_0x3b62d1,unitID:_0x3cbf31,userIDs:_0x16188a,..._0x28e231}])=>[_0x8b04a2,{..._0x28e231,'userId':_0x3b62d1,'unitId':_0x3cbf31,'userIds':_0x16188a}]));return{..._0x3e147a,'entities':{..._0x3e147a['entities'],'datas':_0x13e5cf}};}function s(_0x10e46d){return _0x10e46d===null||_0x10e46d===''?0x14:c(_0x10e46d,'length');}function c(_0x343a49,_0x3d2441){if(!_0x343a49||!/^\d+$/['test'](_0x343a49))throw new e['CollabError']('INVALID_REQUEST',_0x3d2441+'\x20must\x20be\x20a\x20positive\x20integer');let _0x12fe00=Number(_0x343a49);if(!Number['isSafeInteger'](_0x12fe00)||_0x12fe00<0x1)throw new e['CollabError']('INVALID_REQUEST',_0x3d2441+'\x20must\x20be\x20a\x20positive\x20integer');return _0x12fe00;}function l(_0x2d63a2){if(_0x2d63a2===null||_0x2d63a2===''||_0x2d63a2==='0')return{};if(_0x2d63a2==='1'||_0x2d63a2==='2')return{'origin':Number(_0x2d63a2)};throw new e['CollabError']('INVALID_REQUEST','origin\x20must\x20be\x200,\x201\x20or\x202');}function u(_0x1d3344,_0x4aed37){let _0x3c90d3=d(_0x4aed37);f(_0x1d3344,_0x3c90d3['status'],{'error':_0x3c90d3['error']});}function d(_0x17d32e){if(_0x17d32e instanceof t['NodeTransportError'])return{'status':_0x17d32e['code']==='REQUEST_BODY_TOO_LARGE'?0x19d:_0x17d32e['code']==='TRANSPORT_DISPOSED'?0x1f7:0x190,'error':{'code':_0x17d32e['code']==='TRANSPORT_DISPOSED'?n['ErrorCode']['INTERNAL_ERROR']:n['ErrorCode']['INVALID_ARGUMENT'],'message':_0x17d32e['message']}};if(!(_0x17d32e instanceof e['CollabError']))return{'status':0x1f4,'error':{'code':n['ErrorCode']['INTERNAL_ERROR'],'message':'Internal\x20server\x20error'}};let _0x90f22={'UNAUTHENTICATED':{'status':0x191,'code':n['ErrorCode']['UNAUTHENTICATED']},'INVALID_REQUEST':{'status':0x190,'code':n['ErrorCode']['INVALID_ARGUMENT']},'UNIT_NOT_FOUND':{'status':0x194,'code':n['ErrorCode']['NOT_FOUND']},'PERMISSION_DENIED':{'status':0x193,'code':n['ErrorCode']['PERMISSION_DENIED']},'OT_CONFLICT':{'status':0x199,'code':n['ErrorCode']['APPLY_REJECT']},'REVISION_MISMATCH':{'status':0x199,'code':n['ErrorCode']['CHANGESET_REVISION_CONFILICT']},'ADAPTER_FAILURE':{'status':0x1f7,'code':n['ErrorCode']['INTERNAL_ERROR']},'INTERNAL_ERROR':{'status':0x1f4,'code':n['ErrorCode']['INTERNAL_ERROR']},'LICENSE_INVALID':{'status':0x1f4,'code':n['ErrorCode']['LICENSE_INVALID']},'LICENSE_POLICY_INVALID':{'status':0x1f4,'code':n['ErrorCode']['LICENSE_POLICY_INVALID']},'LICENSE_VERSION_NOT_ALLOWED':{'status':0x1f4,'code':n['ErrorCode']['LICENSE_VERSION_NOT_ALLOWED']},'LICENSE_UNIT_TYPE_REJECTED':{'status':0x193,'code':n['ErrorCode']['LICENSE_UNIT_TYPE_REJECTED']},'LICENSE_DOMAIN_REJECTED':{'status':0x193,'code':n['ErrorCode']['LICENSE_DOMAIN_REJECTED']}}[_0x17d32e['code']];return{'status':_0x90f22['status'],'error':{'code':_0x90f22['code'],'message':_0x17d32e['message']}};}function f(_0x4a7cf6,_0x1eb926,_0x495964){_0x4a7cf6['writableEnded']||_0x4a7cf6['destroyed']||(_0x4a7cf6['statusCode']=_0x1eb926,_0x4a7cf6['setHeader']('content-type','application/json;\x20charset=utf-8'),_0x4a7cf6['end'](JSON['stringify'](_0x495964)));}exports['UniverHistoryEndpoint']=i;
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- (function(_0x5329db,_0x51c1bf){const _0x1ea66f=_0xa63d,_0x2147b4=_0x5329db();while(!![]){try{const _0x16fdcb=parseInt(_0x1ea66f(0x1e0))/0x1*(-parseInt(_0x1ea66f(0x1e1))/0x2)+-parseInt(_0x1ea66f(0x1dd))/0x3+-parseInt(_0x1ea66f(0x1e2))/0x4*(parseInt(_0x1ea66f(0x1de))/0x5)+parseInt(_0x1ea66f(0x1dc))/0x6*(-parseInt(_0x1ea66f(0x1e3))/0x7)+-parseInt(_0x1ea66f(0x1df))/0x8+parseInt(_0x1ea66f(0x1d9))/0x9*(-parseInt(_0x1ea66f(0x1da))/0xa)+-parseInt(_0x1ea66f(0x1db))/0xb*(-parseInt(_0x1ea66f(0x1d8))/0xc);if(_0x16fdcb===_0x51c1bf)break;else _0x2147b4['push'](_0x2147b4['shift']());}catch(_0x4cfe2b){_0x2147b4['push'](_0x2147b4['shift']());}}}(_0x3f42,0x648df));function _0xa63d(_0x18393e,_0x432ce9){_0x18393e=_0x18393e-0x1d8;const _0x3f4283=_0x3f42();let _0xa63d5e=_0x3f4283[_0x18393e];return _0xa63d5e;}import _0x56cc82 from'./index.cjs';function _0x3f42(){const _0x296b57=['713602NRPvLj','2EafgHW','4pPqYLD','57799bhZIYu','36FemDLo','81qDUdXN','139760obPuje','8779639QHwOLU','246tlVMGd','531078ihVcmN','1541825GKYFCd','2554096IMeaQA'];_0x3f42=function(){return _0x296b57;};return _0x3f42();}const facadeExport0=_0x56cc82['UniverHistoryEndpoint'];export{facadeExport0 as UniverHistoryEndpoint};
1
+ (function(_0x2e30a0,_0x502f83){const _0xbd75e7=_0x39c8,_0x1b0d72=_0x2e30a0();while(!![]){try{const _0x2a17c2=parseInt(_0xbd75e7(0xff))/0x1+-parseInt(_0xbd75e7(0x104))/0x2*(parseInt(_0xbd75e7(0xfb))/0x3)+parseInt(_0xbd75e7(0xfc))/0x4*(-parseInt(_0xbd75e7(0x100))/0x5)+-parseInt(_0xbd75e7(0x103))/0x6*(-parseInt(_0xbd75e7(0x101))/0x7)+-parseInt(_0xbd75e7(0x102))/0x8*(parseInt(_0xbd75e7(0xfe))/0x9)+-parseInt(_0xbd75e7(0x105))/0xa+parseInt(_0xbd75e7(0xfd))/0xb;if(_0x2a17c2===_0x502f83)break;else _0x1b0d72['push'](_0x1b0d72['shift']());}catch(_0x23efad){_0x1b0d72['push'](_0x1b0d72['shift']());}}}(_0x539c,0xa25d6));function _0x539c(){const _0x5df4e2=['15IsJsuG','80qBQCPh','21985898yfmPyh','2375379kUXOoD','594142yITzFd','305570nLtChB','14hBLzmr','32iUZgcH','2731230kRYBCk','27662MyanNb','4910650AGktLQ'];_0x539c=function(){return _0x5df4e2;};return _0x539c();}import _0x243b3d from'./index.cjs';function _0x39c8(_0x31c3f7,_0x53f280){_0x31c3f7=_0x31c3f7-0xfb;const _0x539c0b=_0x539c();let _0x39c8ca=_0x539c0b[_0x31c3f7];return _0x39c8ca;}const facadeExport0=_0x243b3d['UniverHistoryEndpoint'];export{facadeExport0 as UniverHistoryEndpoint};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@univerjs-pro/collaboration-history-endpoint",
3
3
  "type": "module",
4
- "version": "1.6.0",
4
+ "version": "1.6.2",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.mjs",
7
7
  "types": "./dist/index.d.ts",
@@ -16,9 +16,9 @@
16
16
  "dist"
17
17
  ],
18
18
  "dependencies": {
19
- "@univerjs-pro/collaboration-history-service": "1.6.0",
20
- "@univerjs-pro/collaboration-service": "1.6.0",
21
- "@univerjs-pro/collaboration-transport-node": "1.6.0",
22
- "@univerjs/protocol": "1.6.0"
19
+ "@univerjs-pro/collaboration-history-service": "1.6.2",
20
+ "@univerjs-pro/collaboration-service": "1.6.2",
21
+ "@univerjs-pro/collaboration-transport-node": "1.6.2",
22
+ "@univerjs/protocol": "1.6.2"
23
23
  }
24
24
  }