@univerjs-pro/collaboration-history-endpoint 1.5.2 → 1.6.1

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(_0x211055){if(this['_service']=_0x211055,!_0x211055)throw TypeError('UniverHistoryEndpoint\x20requires\x20a\x20service');}['register'](_0x1ebf7c){if(this['_disposed'])throw new e['CollabError']('INTERNAL_ERROR','History\x20Endpoint\x20is\x20disposed');for(let [_0x4bbd1a,_0x306837]of[['list','list'],['creators','creators'],['cs','changesets']])_0x1ebf7c['get']('/universer-api/history/:unitID/'+_0x4bbd1a,_0x4668e7=>this['_handleHttp'](_0x4668e7,{'name':_0x306837,'unitID':_0x4668e7['params']['unitID']}));}async['_handleHttp'](_0x304105,_0x5dedd0){try{if(this['_disposed'])throw new e['CollabError']('INTERNAL_ERROR','History\x20Endpoint\x20is\x20disposed');let _0x505b55=new URL(_0x304105['incomingMessage']['url']??'/','http://localhost');if(!_0x304105['userID'])throw new e['CollabError']('UNAUTHENTICATED','HTTP\x20user\x20is\x20not\x20authenticated');let _0x430571={'userID':_0x304105['userID'],'customData':_0x304105['customData']};switch(_0x5dedd0['name']){case'list':{let _0x32639b=await this['_service']['getHistoryList']({'unitID':_0x5dedd0['unitID'],'length':s(_0x505b55['searchParams']['get']('length')),..._0x505b55['searchParams']['get']('lastLabel')?{'lastLabel':_0x505b55['searchParams']['get']('lastLabel')}:{},...l(_0x505b55['searchParams']['get']('origin')),'userIDs':_0x505b55['searchParams']['getAll']('userIds')['filter'](Boolean)},_0x430571);f(_0x304105['response'],0xc8,{'error':r,...o(_0x32639b)});return;}case'creators':{let _0x53926b=await this['_service']['listHistoryCreators']({'unitID':_0x5dedd0['unitID']},_0x430571);f(_0x304105['response'],0xc8,{'error':r,'creators':_0x53926b['creators']['map'](({userID:_0xae449,..._0x43182b})=>({..._0x43182b,'userId':_0xae449}))});return;}case'changesets':{let _0x532fc9=c(_0x505b55['searchParams']['get']('startRevision'),'startRevision'),_0x545094=c(_0x505b55['searchParams']['get']('endRevision'),'endRevision'),_0x46178f=await this['_service']['getHistoryChangesets']({'unitID':_0x5dedd0['unitID'],'startRevision':_0x532fc9,'endRevision':_0x545094},_0x430571);f(_0x304105['response'],0xc8,{'error':r,..._0x46178f,'changesets':_0x46178f['changesets']['map'](a)});return;}}}catch(_0x3bcc3d){u(_0x304105['response'],_0x3bcc3d);}}['dispose'](){this['_disposed']=!0x0;}};function a(_0x2dcece){let _0x4fef88={..._0x2dcece};return delete _0x4fef88['metadata'],_0x4fef88;}function o(_0x28a4f0){let _0x276daa=Object['fromEntries'](Object['entries'](_0x28a4f0['entities']['datas'])['map'](([_0x76b594,{userID:_0x30aada,unitID:_0x5b0cf0,userIDs:_0x5dfbde,..._0x26bfc7}])=>[_0x76b594,{..._0x26bfc7,'userId':_0x30aada,'unitId':_0x5b0cf0,'userIds':_0x5dfbde}]));return{..._0x28a4f0,'entities':{..._0x28a4f0['entities'],'datas':_0x276daa}};}function s(_0x430a5b){return _0x430a5b===null||_0x430a5b===''?0x14:c(_0x430a5b,'length');}function c(_0x2da2c2,_0x55aa80){if(!_0x2da2c2||!/^\d+$/['test'](_0x2da2c2))throw new e['CollabError']('INVALID_REQUEST',_0x55aa80+'\x20must\x20be\x20a\x20positive\x20integer');let _0x4fb6fb=Number(_0x2da2c2);if(!Number['isSafeInteger'](_0x4fb6fb)||_0x4fb6fb<0x1)throw new e['CollabError']('INVALID_REQUEST',_0x55aa80+'\x20must\x20be\x20a\x20positive\x20integer');return _0x4fb6fb;}function l(_0x14c1d1){if(_0x14c1d1===null||_0x14c1d1===''||_0x14c1d1==='0')return{};if(_0x14c1d1==='1'||_0x14c1d1==='2')return{'origin':Number(_0x14c1d1)};throw new e['CollabError']('INVALID_REQUEST','origin\x20must\x20be\x200,\x201\x20or\x202');}function u(_0x2bed61,_0xea5e9b){let _0xbb7027=d(_0xea5e9b);f(_0x2bed61,_0xbb7027['status'],{'error':_0xbb7027['error']});}function d(_0x408d80){if(_0x408d80 instanceof t['NodeTransportError'])return{'status':_0x408d80['code']==='REQUEST_BODY_TOO_LARGE'?0x19d:_0x408d80['code']==='TRANSPORT_DISPOSED'?0x1f7:0x190,'error':{'code':_0x408d80['code']==='TRANSPORT_DISPOSED'?n['ErrorCode']['INTERNAL_ERROR']:n['ErrorCode']['INVALID_ARGUMENT'],'message':_0x408d80['message']}};if(!(_0x408d80 instanceof e['CollabError']))return{'status':0x1f4,'error':{'code':n['ErrorCode']['INTERNAL_ERROR'],'message':'Internal\x20server\x20error'}};let _0xe441e3={'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']}}[_0x408d80['code']];return{'status':_0xe441e3['status'],'error':{'code':_0xe441e3['code'],'message':_0x408d80['message']}};}function f(_0x43683f,_0x55a0cd,_0x3134a4){_0x43683f['writableEnded']||_0x43683f['destroyed']||(_0x43683f['statusCode']=_0x55a0cd,_0x43683f['setHeader']('content-type','application/json;\x20charset=utf-8'),_0x43683f['end'](JSON['stringify'](_0x3134a4)));}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(_0x2cc216){if(this['_service']=_0x2cc216,!_0x2cc216)throw TypeError('UniverHistoryEndpoint\x20requires\x20a\x20service');}['register'](_0x220dbf){if(this['_disposed'])throw new e['CollabError']('INTERNAL_ERROR','History\x20Endpoint\x20is\x20disposed');for(let [_0x1ca59e,_0x1136b9]of[['list','list'],['creators','creators'],['cs','changesets']])_0x220dbf['get']('/universer-api/history/:unitID/'+_0x1ca59e,_0x4940c2=>this['_handleHttp'](_0x4940c2,{'name':_0x1136b9,'unitID':_0x4940c2['params']['unitID']}));}async['_handleHttp'](_0x3e63bb,_0x58953d){try{if(this['_disposed'])throw new e['CollabError']('INTERNAL_ERROR','History\x20Endpoint\x20is\x20disposed');let _0x3d6784=new URL(_0x3e63bb['incomingMessage']['url']??'/','http://localhost');if(!_0x3e63bb['userID'])throw new e['CollabError']('UNAUTHENTICATED','HTTP\x20user\x20is\x20not\x20authenticated');let _0x2cfd2e={'userID':_0x3e63bb['userID'],'customData':_0x3e63bb['customData']};switch(_0x58953d['name']){case'list':{let _0x5086c4=await this['_service']['getHistoryList']({'unitID':_0x58953d['unitID'],'length':s(_0x3d6784['searchParams']['get']('length')),..._0x3d6784['searchParams']['get']('lastLabel')?{'lastLabel':_0x3d6784['searchParams']['get']('lastLabel')}:{},...l(_0x3d6784['searchParams']['get']('origin')),'userIDs':_0x3d6784['searchParams']['getAll']('userIds')['filter'](Boolean)},_0x2cfd2e);f(_0x3e63bb['response'],0xc8,{'error':r,...o(_0x5086c4)});return;}case'creators':{let _0x5c47e8=await this['_service']['listHistoryCreators']({'unitID':_0x58953d['unitID']},_0x2cfd2e);f(_0x3e63bb['response'],0xc8,{'error':r,'creators':_0x5c47e8['creators']['map'](({userID:_0x475561,..._0x13982d})=>({..._0x13982d,'userId':_0x475561}))});return;}case'changesets':{let _0x3dfb5d=c(_0x3d6784['searchParams']['get']('startRevision'),'startRevision'),_0xf819fc=c(_0x3d6784['searchParams']['get']('endRevision'),'endRevision'),_0x2b7595=await this['_service']['getHistoryChangesets']({'unitID':_0x58953d['unitID'],'startRevision':_0x3dfb5d,'endRevision':_0xf819fc},_0x2cfd2e);f(_0x3e63bb['response'],0xc8,{'error':r,..._0x2b7595,'changesets':_0x2b7595['changesets']['map'](a)});return;}}}catch(_0x4b98e8){u(_0x3e63bb['response'],_0x4b98e8);}}['dispose'](){this['_disposed']=!0x0;}};function a(_0x69ccba){let _0x801262={..._0x69ccba};return delete _0x801262['metadata'],_0x801262;}function o(_0xb56afd){let _0x3879e7=Object['fromEntries'](Object['entries'](_0xb56afd['entities']['datas'])['map'](([_0x1bf8ae,{userID:_0x241edf,unitID:_0x90b447,userIDs:_0x330989,..._0x4502b8}])=>[_0x1bf8ae,{..._0x4502b8,'userId':_0x241edf,'unitId':_0x90b447,'userIds':_0x330989}]));return{..._0xb56afd,'entities':{..._0xb56afd['entities'],'datas':_0x3879e7}};}function s(_0x48b92c){return _0x48b92c===null||_0x48b92c===''?0x14:c(_0x48b92c,'length');}function c(_0x58425c,_0x5a6009){if(!_0x58425c||!/^\d+$/['test'](_0x58425c))throw new e['CollabError']('INVALID_REQUEST',_0x5a6009+'\x20must\x20be\x20a\x20positive\x20integer');let _0x345786=Number(_0x58425c);if(!Number['isSafeInteger'](_0x345786)||_0x345786<0x1)throw new e['CollabError']('INVALID_REQUEST',_0x5a6009+'\x20must\x20be\x20a\x20positive\x20integer');return _0x345786;}function l(_0x78f008){if(_0x78f008===null||_0x78f008===''||_0x78f008==='0')return{};if(_0x78f008==='1'||_0x78f008==='2')return{'origin':Number(_0x78f008)};throw new e['CollabError']('INVALID_REQUEST','origin\x20must\x20be\x200,\x201\x20or\x202');}function u(_0x4fe70f,_0xee0424){let _0xf1206e=d(_0xee0424);f(_0x4fe70f,_0xf1206e['status'],{'error':_0xf1206e['error']});}function d(_0x114702){if(_0x114702 instanceof t['NodeTransportError'])return{'status':_0x114702['code']==='REQUEST_BODY_TOO_LARGE'?0x19d:_0x114702['code']==='TRANSPORT_DISPOSED'?0x1f7:0x190,'error':{'code':_0x114702['code']==='TRANSPORT_DISPOSED'?n['ErrorCode']['INTERNAL_ERROR']:n['ErrorCode']['INVALID_ARGUMENT'],'message':_0x114702['message']}};if(!(_0x114702 instanceof e['CollabError']))return{'status':0x1f4,'error':{'code':n['ErrorCode']['INTERNAL_ERROR'],'message':'Internal\x20server\x20error'}};let _0x2e6d06={'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']}}[_0x114702['code']];return{'status':_0x2e6d06['status'],'error':{'code':_0x2e6d06['code'],'message':_0x114702['message']}};}function f(_0x30ad4d,_0x525d22,_0x55aa81){_0x30ad4d['writableEnded']||_0x30ad4d['destroyed']||(_0x30ad4d['statusCode']=_0x525d22,_0x30ad4d['setHeader']('content-type','application/json;\x20charset=utf-8'),_0x30ad4d['end'](JSON['stringify'](_0x55aa81)));}exports['UniverHistoryEndpoint']=i;
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- const _0x33500d=_0x4f2d;(function(_0x81b4ef,_0xeb9f5a){const _0x339819=_0x4f2d,_0x37fa84=_0x81b4ef();while(!![]){try{const _0x2b9320=-parseInt(_0x339819(0x169))/0x1+-parseInt(_0x339819(0x16e))/0x2+parseInt(_0x339819(0x171))/0x3+parseInt(_0x339819(0x16a))/0x4+parseInt(_0x339819(0x16f))/0x5*(parseInt(_0x339819(0x168))/0x6)+parseInt(_0x339819(0x16d))/0x7+parseInt(_0x339819(0x16b))/0x8*(-parseInt(_0x339819(0x170))/0x9);if(_0x2b9320===_0xeb9f5a)break;else _0x37fa84['push'](_0x37fa84['shift']());}catch(_0x9a32eb){_0x37fa84['push'](_0x37fa84['shift']());}}}(_0x26c1,0x4448f));import _0x303216 from'./index.cjs';function _0x26c1(){const _0x17d0d8=['756GOyDMw','1563549OeHxDV','10146XDRGuT','61113jfECsP','1960864vgoRhB','75336mLIyBj','UniverHistoryEndpoint','3635464beHwfb','895908LqWvjj','145hXyPRI'];_0x26c1=function(){return _0x17d0d8;};return _0x26c1();}const facadeExport0=_0x303216[_0x33500d(0x16c)];function _0x4f2d(_0x1a877f,_0x31d131){_0x1a877f=_0x1a877f-0x168;const _0x26c1fd=_0x26c1();let _0x4f2d22=_0x26c1fd[_0x1a877f];return _0x4f2d22;}export{facadeExport0 as UniverHistoryEndpoint};
1
+ (function(_0x425f21,_0x4a2c25){const _0x5bc1a5=_0x24ff,_0x20d523=_0x425f21();while(!![]){try{const _0x3ed0df=parseInt(_0x5bc1a5(0x12f))/0x1+parseInt(_0x5bc1a5(0x128))/0x2+-parseInt(_0x5bc1a5(0x12b))/0x3+-parseInt(_0x5bc1a5(0x130))/0x4+parseInt(_0x5bc1a5(0x12c))/0x5*(-parseInt(_0x5bc1a5(0x12e))/0x6)+parseInt(_0x5bc1a5(0x129))/0x7+-parseInt(_0x5bc1a5(0x12a))/0x8*(parseInt(_0x5bc1a5(0x12d))/0x9);if(_0x3ed0df===_0x4a2c25)break;else _0x20d523['push'](_0x20d523['shift']());}catch(_0x46e78c){_0x20d523['push'](_0x20d523['shift']());}}}(_0xac97,0xcc6c4));import _0x2cc99d from'./index.cjs';const facadeExport0=_0x2cc99d['UniverHistoryEndpoint'];function _0x24ff(_0x46dac0,_0x50e722){_0x46dac0=_0x46dac0-0x128;const _0xac97b1=_0xac97();let _0x24ffa8=_0xac97b1[_0x46dac0];return _0x24ffa8;}export{facadeExport0 as UniverHistoryEndpoint};function _0xac97(){const _0x286948=['24VDQngN','1121283infbfb','431528BPmIqB','1978494lhrxGi','9619001BqRZSS','8kKTcun','3887385wTZWZD','1137655kdSQXt','3002004MgMBQK'];_0xac97=function(){return _0x286948;};return _0xac97();}
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.5.2",
4
+ "version": "1.6.1",
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.5.2",
20
- "@univerjs-pro/collaboration-service": "1.5.2",
21
- "@univerjs-pro/collaboration-transport-node": "1.5.2",
22
- "@univerjs/protocol": "1.5.2"
19
+ "@univerjs-pro/collaboration-history-service": "1.6.1",
20
+ "@univerjs-pro/collaboration-service": "1.6.1",
21
+ "@univerjs-pro/collaboration-transport-node": "1.6.1",
22
+ "@univerjs/protocol": "1.6.1"
23
23
  }
24
24
  }