@univerjs-pro/collaboration-history-endpoint 1.2.0 → 1.3.0
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 +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +5 -5
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(
|
|
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(_0x420f8c){if(this['_service']=_0x420f8c,!_0x420f8c)throw TypeError('UniverHistoryEndpoint\x20requires\x20a\x20service');}['register'](_0x2de0cc){if(this['_disposed'])throw new e['CollabError']('INTERNAL_ERROR','History\x20Endpoint\x20is\x20disposed');for(let [_0x5ed590,_0x441a12]of[['list','list'],['creators','creators'],['cs','changesets']])_0x2de0cc['get']('/universer-api/history/:unitID/'+_0x5ed590,_0x161cd0=>this['_handleHttp'](_0x161cd0,{'name':_0x441a12,'unitID':_0x161cd0['params']['unitID']}));}async['_handleHttp'](_0x250c72,_0xc95b50){try{if(this['_disposed'])throw new e['CollabError']('INTERNAL_ERROR','History\x20Endpoint\x20is\x20disposed');let _0x371e81=new URL(_0x250c72['incomingMessage']['url']??'/','http://localhost');if(!_0x250c72['userID'])throw new e['CollabError']('UNAUTHENTICATED','HTTP\x20user\x20is\x20not\x20authenticated');let _0x427bef={'userID':_0x250c72['userID'],'customData':_0x250c72['customData']};switch(_0xc95b50['name']){case'list':{let _0x28f238=await this['_service']['getHistoryList']({'unitID':_0xc95b50['unitID'],'length':o(_0x371e81['searchParams']['get']('length')),..._0x371e81['searchParams']['get']('lastLabel')?{'lastLabel':_0x371e81['searchParams']['get']('lastLabel')}:{},...c(_0x371e81['searchParams']['get']('origin')),'userIDs':_0x371e81['searchParams']['getAll']('userIds')['filter'](Boolean)},_0x427bef);d(_0x250c72['response'],0xc8,{'error':r,...a(_0x28f238)});return;}case'creators':{let _0x3e5450=await this['_service']['listHistoryCreators']({'unitID':_0xc95b50['unitID']},_0x427bef);d(_0x250c72['response'],0xc8,{'error':r,'creators':_0x3e5450['creators']['map'](({userID:_0x2d8918,..._0x3fd37a})=>({..._0x3fd37a,'userId':_0x2d8918}))});return;}case'changesets':{let _0x209ab9=s(_0x371e81['searchParams']['get']('startRevision'),'startRevision'),_0x428fcb=s(_0x371e81['searchParams']['get']('endRevision'),'endRevision'),_0xad893c=await this['_service']['getHistoryChangesets']({'unitID':_0xc95b50['unitID'],'startRevision':_0x209ab9,'endRevision':_0x428fcb},_0x427bef);d(_0x250c72['response'],0xc8,{'error':r,..._0xad893c});return;}}}catch(_0x2833c7){l(_0x250c72['response'],_0x2833c7);}}['dispose'](){this['_disposed']=!0x0;}};function a(_0x2e9bc7){let _0x2cc998=Object['fromEntries'](Object['entries'](_0x2e9bc7['entities']['datas'])['map'](([_0xb4c310,{userID:_0x75717,unitID:_0x41ac85,userIDs:_0x4f6c44,..._0x21505b}])=>[_0xb4c310,{..._0x21505b,'userId':_0x75717,'unitId':_0x41ac85,'userIds':_0x4f6c44}]));return{..._0x2e9bc7,'entities':{..._0x2e9bc7['entities'],'datas':_0x2cc998}};}function o(_0x55feaf){return _0x55feaf===null||_0x55feaf===''?0x14:s(_0x55feaf,'length');}function s(_0x8b15e0,_0x5a6041){if(!_0x8b15e0||!/^\d+$/['test'](_0x8b15e0))throw new e['CollabError']('INVALID_REQUEST',_0x5a6041+'\x20must\x20be\x20a\x20positive\x20integer');let _0x335977=Number(_0x8b15e0);if(!Number['isSafeInteger'](_0x335977)||_0x335977<0x1)throw new e['CollabError']('INVALID_REQUEST',_0x5a6041+'\x20must\x20be\x20a\x20positive\x20integer');return _0x335977;}function c(_0xd49747){if(_0xd49747===null||_0xd49747===''||_0xd49747==='0')return{};if(_0xd49747==='1'||_0xd49747==='2')return{'origin':Number(_0xd49747)};throw new e['CollabError']('INVALID_REQUEST','origin\x20must\x20be\x200,\x201\x20or\x202');}function l(_0x37eec7,_0x2119d7){let _0x35f1b1=u(_0x2119d7);d(_0x37eec7,_0x35f1b1['status'],{'error':_0x35f1b1['error']});}function u(_0xe92f48){if(_0xe92f48 instanceof t['NodeTransportError'])return{'status':_0xe92f48['code']==='REQUEST_BODY_TOO_LARGE'?0x19d:_0xe92f48['code']==='TRANSPORT_DISPOSED'?0x1f7:0x190,'error':{'code':_0xe92f48['code']==='TRANSPORT_DISPOSED'?n['ErrorCode']['INTERNAL_ERROR']:n['ErrorCode']['INVALID_ARGUMENT'],'message':_0xe92f48['message']}};if(!(_0xe92f48 instanceof e['CollabError']))return{'status':0x1f4,'error':{'code':n['ErrorCode']['INTERNAL_ERROR'],'message':'Internal\x20server\x20error'}};let _0x9f7943={'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':0x2337},'LICENSE_POLICY_INVALID':{'status':0x1f4,'code':0x232f},'LICENSE_VERSION_NOT_ALLOWED':{'status':0x1f4,'code':0x2334},'LICENSE_UNIT_TYPE_REJECTED':{'status':0x193,'code':0x2336},'LICENSE_DOMAIN_REJECTED':{'status':0x193,'code':0x233a}}[_0xe92f48['code']];return{'status':_0x9f7943['status'],'error':{'code':_0x9f7943['code'],'message':_0xe92f48['message']}};}function d(_0x597571,_0x2e7720,_0x514eef){_0x597571['writableEnded']||_0x597571['destroyed']||(_0x597571['statusCode']=_0x2e7720,_0x597571['setHeader']('content-type','application/json;\x20charset=utf-8'),_0x597571['end'](JSON['stringify'](_0x514eef)));}exports['UniverHistoryEndpoint']=i;
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x593f8c,_0x309d68){const _0x1b3ec4=_0x2f9f,_0x40d19e=_0x593f8c();while(!![]){try{const _0x5b7cf7=parseInt(_0x1b3ec4(0x11a))/0x1+parseInt(_0x1b3ec4(0x11d))/0x2+parseInt(_0x1b3ec4(0x119))/0x3+-parseInt(_0x1b3ec4(0x116))/0x4*(-parseInt(_0x1b3ec4(0x11b))/0x5)+parseInt(_0x1b3ec4(0x117))/0x6+parseInt(_0x1b3ec4(0x11c))/0x7+-parseInt(_0x1b3ec4(0x118))/0x8;if(_0x5b7cf7===_0x309d68)break;else _0x40d19e['push'](_0x40d19e['shift']());}catch(_0x1e49f8){_0x40d19e['push'](_0x40d19e['shift']());}}}(_0x3efd,0x62788));function _0x2f9f(_0x5d0803,_0x29365d){_0x5d0803=_0x5d0803-0x116;const _0x3efdb2=_0x3efd();let _0x2f9fa3=_0x3efdb2[_0x5d0803];return _0x2f9fa3;}import _0x1569d9 from'./index.cjs';const facadeExport0=_0x1569d9['UniverHistoryEndpoint'];function _0x3efd(){const _0x292d53=['4558638fwRkjN','931730rruCFS','1132adgQNx','2198772UVilPF','20626352VODjLC','1090713zJGfYf','375209GDNZFJ','13415vnkEto'];_0x3efd=function(){return _0x292d53;};return _0x3efd();}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.
|
|
4
|
+
"version": "1.3.0",
|
|
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.
|
|
20
|
-
"@univerjs-pro/collaboration-service": "1.
|
|
21
|
-
"@univerjs-pro/collaboration-transport-node": "1.
|
|
22
|
-
"@univerjs/protocol": "1.
|
|
19
|
+
"@univerjs-pro/collaboration-history-service": "1.3.0",
|
|
20
|
+
"@univerjs-pro/collaboration-service": "1.3.0",
|
|
21
|
+
"@univerjs-pro/collaboration-transport-node": "1.3.0",
|
|
22
|
+
"@univerjs/protocol": "1.3.0"
|
|
23
23
|
}
|
|
24
24
|
}
|