@univerjs-pro/collaboration-history-endpoint 1.1.0 → 1.2.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(_0x2c4766){if(this['_service']=_0x2c4766,!_0x2c4766)throw TypeError('UniverHistoryEndpoint\x20requires\x20a\x20service');}['register'](_0x38916f){if(this['_disposed'])throw new e['CollabError']('INTERNAL_ERROR','History\x20Endpoint\x20is\x20disposed');for(let [_0x1155a5,_0x5a7897]of[['list','list'],['creators','creators'],['cs','changesets']])_0x38916f['get']('/universer-api/history/:unitID/'+_0x1155a5,_0x3f6910=>this['_handleHttp'](_0x3f6910,{'name':_0x5a7897,'unitID':_0x3f6910['params']['unitID']}));}async['_handleHttp'](_0x30bc84,_0x99c375){try{if(this['_disposed'])throw new e['CollabError']('INTERNAL_ERROR','History\x20Endpoint\x20is\x20disposed');let _0x4fe5b2=new URL(_0x30bc84['incomingMessage']['url']??'/','http://localhost');if(!_0x30bc84['userID'])throw new e['CollabError']('UNAUTHENTICATED','HTTP\x20user\x20is\x20not\x20authenticated');let _0x5529f5={'userID':_0x30bc84['userID'],'customData':_0x30bc84['customData']};switch(_0x99c375['name']){case'list':{let _0x190add=await this['_service']['getHistoryList']({'unitID':_0x99c375['unitID'],'length':o(_0x4fe5b2['searchParams']['get']('length')),..._0x4fe5b2['searchParams']['get']('lastLabel')?{'lastLabel':_0x4fe5b2['searchParams']['get']('lastLabel')}:{},...c(_0x4fe5b2['searchParams']['get']('origin')),'userIDs':_0x4fe5b2['searchParams']['getAll']('userIds')['filter'](Boolean)},_0x5529f5);d(_0x30bc84['response'],0xc8,{'error':r,...a(_0x190add)});return;}case'creators':{let _0x2852b1=await this['_service']['listHistoryCreators']({'unitID':_0x99c375['unitID']},_0x5529f5);d(_0x30bc84['response'],0xc8,{'error':r,'creators':_0x2852b1['creators']['map'](({userID:_0x3a8474,..._0xa410b1})=>({..._0xa410b1,'userId':_0x3a8474}))});return;}case'changesets':{let _0x3b2f91=s(_0x4fe5b2['searchParams']['get']('startRevision'),'startRevision'),_0x199595=s(_0x4fe5b2['searchParams']['get']('endRevision'),'endRevision'),_0x2b0eaa=await this['_service']['getHistoryChangesets']({'unitID':_0x99c375['unitID'],'startRevision':_0x3b2f91,'endRevision':_0x199595},_0x5529f5);d(_0x30bc84['response'],0xc8,{'error':r,..._0x2b0eaa});return;}}}catch(_0xd5601d){l(_0x30bc84['response'],_0xd5601d);}}['dispose'](){this['_disposed']=!0x0;}};function a(_0x10ccc1){let _0x129067=Object['fromEntries'](Object['entries'](_0x10ccc1['entities']['datas'])['map'](([_0x20a6e0,{userID:_0x4b862e,unitID:_0x1650f4,userIDs:_0x13cb5a,..._0x48321e}])=>[_0x20a6e0,{..._0x48321e,'userId':_0x4b862e,'unitId':_0x1650f4,'userIds':_0x13cb5a}]));return{..._0x10ccc1,'entities':{..._0x10ccc1['entities'],'datas':_0x129067}};}function o(_0x3a645d){return _0x3a645d===null||_0x3a645d===''?0x14:s(_0x3a645d,'length');}function s(_0x134830,_0x4411df){if(!_0x134830||!/^\d+$/['test'](_0x134830))throw new e['CollabError']('INVALID_REQUEST',_0x4411df+'\x20must\x20be\x20a\x20positive\x20integer');let _0x9a828d=Number(_0x134830);if(!Number['isSafeInteger'](_0x9a828d)||_0x9a828d<0x1)throw new e['CollabError']('INVALID_REQUEST',_0x4411df+'\x20must\x20be\x20a\x20positive\x20integer');return _0x9a828d;}function c(_0xbe17ba){if(_0xbe17ba===null||_0xbe17ba===''||_0xbe17ba==='0')return{};if(_0xbe17ba==='1'||_0xbe17ba==='2')return{'origin':Number(_0xbe17ba)};throw new e['CollabError']('INVALID_REQUEST','origin\x20must\x20be\x200,\x201\x20or\x202');}function l(_0x1169e6,_0x337b75){let _0xb85d97=u(_0x337b75);d(_0x1169e6,_0xb85d97['status'],{'error':_0xb85d97['error']});}function u(_0x4d5ed7){if(_0x4d5ed7 instanceof t['NodeTransportError'])return{'status':_0x4d5ed7['code']==='REQUEST_BODY_TOO_LARGE'?0x19d:_0x4d5ed7['code']==='TRANSPORT_DISPOSED'?0x1f7:0x190,'error':{'code':_0x4d5ed7['code']==='TRANSPORT_DISPOSED'?n['ErrorCode']['INTERNAL_ERROR']:n['ErrorCode']['INVALID_ARGUMENT'],'message':_0x4d5ed7['message']}};if(!(_0x4d5ed7 instanceof e['CollabError']))return{'status':0x1f4,'error':{'code':n['ErrorCode']['INTERNAL_ERROR'],'message':'Internal\x20server\x20error'}};let _0x53a650={'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']}}[_0x4d5ed7['code']];return{'status':_0x53a650['status'],'error':{'code':_0x53a650['code'],'message':_0x4d5ed7['message']}};}function d(_0x42b4ef,_0x297886,_0x10a34a){_0x42b4ef['writableEnded']||_0x42b4ef['destroyed']||(_0x42b4ef['statusCode']=_0x297886,_0x42b4ef['setHeader']('content-type','application/json;\x20charset=utf-8'),_0x42b4ef['end'](JSON['stringify'](_0x10a34a)));}exports['UniverHistoryEndpoint']=i;
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function _0x1f2f(_0x3e7642,_0x4b94b2){_0x3e7642=_0x3e7642-0x1a0;const _0x4645e7=_0x4645();let _0x1f2f52=_0x4645e7[_0x3e7642];return _0x1f2f52;}const _0x5eb92e=_0x1f2f;(function(_0x1931c7,_0x4c02df){const _0x257dee=_0x1f2f,_0x6ae502=_0x1931c7();while(!![]){try{const _0x5620ff=-parseInt(_0x257dee(0x1a2))/0x1+parseInt(_0x257dee(0x1a0))/0x2+parseInt(_0x257dee(0x1a1))/0x3+parseInt(_0x257dee(0x1a5))/0x4+-parseInt(_0x257dee(0x1a3))/0x5+parseInt(_0x257dee(0x1a8))/0x6*(-parseInt(_0x257dee(0x1a7))/0x7)+parseInt(_0x257dee(0x1a4))/0x8;if(_0x5620ff===_0x4c02df)break;else _0x6ae502['push'](_0x6ae502['shift']());}catch(_0x547ae3){_0x6ae502['push'](_0x6ae502['shift']());}}}(_0x4645,0x1be2e));import _0x57e3ce from'./index.cjs';function _0x4645(){const _0x547e59=['486603etQugV','64618GKGKFy','1068135SihNUA','953328jbCXjk','279884OWZQOB','UniverHistoryEndpoint','14LKZeDY','71844WljtCz','130154XQILhi'];_0x4645=function(){return _0x547e59;};return _0x4645();}const facadeExport0=_0x57e3ce[_0x5eb92e(0x1a6)];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.2.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.2.0",
|
|
20
|
+
"@univerjs-pro/collaboration-service": "1.2.0",
|
|
21
|
+
"@univerjs-pro/collaboration-transport-node": "1.2.0",
|
|
22
|
+
"@univerjs/protocol": "1.2.0"
|
|
23
23
|
}
|
|
24
24
|
}
|