@univerjs-pro/collaboration-comment-endpoint 1.6.0 → 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 +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +6 -6
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'];['_roomHost'];['_protocolBasePath'];['_subscription'];['_calls']=new Set();['_disposed']=!0x1;['_disposePromise'];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'];['_roomHost'];['_protocolBasePath'];['_subscription'];['_calls']=new Set();['_disposed']=!0x1;['_disposePromise'];constructor(_0x454fb6){if(!_0x454fb6?.['service'])throw TypeError('UniverCommentEndpoint\x20requires\x20a\x20service');if(!_0x454fb6?.['roomHost'])throw TypeError('UniverCommentEndpoint\x20requires\x20a\x20roomHost');this['_service']=_0x454fb6['service'],this['_roomHost']=_0x454fb6['roomHost'],this['_protocolBasePath']=f(_0x454fb6['protocolBasePath']??'/universer-api'),this['_subscription']=this['_service']['on']('commentCommitted',_0x3ecb46=>this['_track'](this['_publish'](_0x3ecb46)));}['register'](_0x966e23){if(this['_disposed'])throw new e['CollabError']('INTERNAL_ERROR','Comment\x20Endpoint\x20is\x20disposed');let _0x41c351=_0x2b1169=>_0x41c955=>this['_track'](this['_handleHttp'](_0x41c955,{'action':_0x2b1169,'unitID':_0x41c955['params']['unitID']}));for(let _0x5500ba of['add','list','reply','solved','edit','delete'])_0x966e23['post'](this['_protocolBasePath']+'/comment/unit/:unitID/'+_0x5500ba,_0x41c351(_0x5500ba));_0x966e23['get'](this['_protocolBasePath']+'/comment/unit/:unitID/list',_0x41c351('list'));}['dispose'](){return this['_disposePromise']||=(this['_disposed']=!0x0,this['_subscription']['dispose'](),Promise['allSettled']([...this['_calls']])['then'](()=>void 0x0)),this['_disposePromise'];}['_track'](_0x27d4a7){return this['_calls']['add'](_0x27d4a7),_0x27d4a7['finally'](()=>this['_calls']['delete'](_0x27d4a7))['catch'](()=>void 0x0),_0x27d4a7;}async['_handleHttp'](_0x985b48,_0x503fa2){try{if(this['_disposed'])throw new e['CollabError']('INTERNAL_ERROR','Comment\x20Endpoint\x20is\x20disposed');let _0x592d1d=new URL(_0x985b48['incomingMessage']['url']??'/','http://localhost');if(!_0x503fa2['unitID']||_0x503fa2['unitID']['includes']('/'))throw d('Invalid\x20route\x20unitId');if(!_0x985b48['userID'])throw new e['CollabError']('UNAUTHENTICATED','HTTP\x20user\x20is\x20not\x20authenticated');if(_0x503fa2['action']==='list'){let _0x2c475d=a(_0x985b48['incomingMessage']['method']==='GET'?{'unitId':_0x503fa2['unitID'],'threadId':_0x592d1d['searchParams']['getAll']('threadId')}:await _0x985b48['readJson'](),_0x503fa2['unitID']),_0x8e4b=await this['_service']['listComments']({'unitID':_0x503fa2['unitID'],'threadIDs':_0x2c475d['threadId']},{'userID':_0x985b48['userID'],'customData':_0x985b48['customData']});h(_0x985b48['response'],0xc8,{'error':r,..._0x8e4b});return;}let _0x31bac8=o(await _0x985b48['readJson']());if(s(_0x31bac8['unitId'],'unitId')!==_0x503fa2['unitID'])throw d('Route\x20and\x20body\x20unitId\x20must\x20match');let _0x8cf9fb=s(_0x31bac8['memberId'],'memberId'),_0x3fba4c={'userID':_0x985b48['userID'],'memberID':_0x8cf9fb,'customData':_0x985b48['customData']};switch(_0x503fa2['action']){case'add':{let _0x154778=await this['_service']['addComment']({'unitID':_0x503fa2['unitID'],'content':s(_0x31bac8['content'],'content'),'mentions':l(_0x31bac8['mention'],'mention')},_0x3fba4c);h(_0x985b48['response'],0xc8,{'error':r,'comment':_0x154778});return;}case'reply':{let _0x550c2b=await this['_service']['replyComment']({'unitID':_0x503fa2['unitID'],'threadID':s(_0x31bac8['threadId'],'threadId'),'content':s(_0x31bac8['content'],'content'),'mentions':l(_0x31bac8['mention'],'mention')},_0x3fba4c);h(_0x985b48['response'],0xc8,{'error':r,'reply':_0x550c2b});return;}case'solved':{let _0xad5ecf=u(_0x31bac8['solved']);await this['_service']['setThreadSolved']({'unitID':_0x503fa2['unitID'],'threadID':s(_0x31bac8['threadId'],'threadId'),'solved':_0xad5ecf},_0x3fba4c),h(_0x985b48['response'],0xc8,{'error':r});return;}case'edit':await this['_service']['editComment']({'unitID':_0x503fa2['unitID'],'threadID':s(_0x31bac8['threadId'],'threadId'),'replyID':s(_0x31bac8['replyId'],'replyId'),'content':s(_0x31bac8['content'],'content'),'mentions':l(_0x31bac8['mention'],'mention')},_0x3fba4c),h(_0x985b48['response'],0xc8,{'error':r});return;case'delete':await this['_service']['deleteComment']({'unitID':_0x503fa2['unitID'],'threadID':s(_0x31bac8['threadId'],'threadId'),...c(_0x31bac8['replyId'],'replyId')},_0x3fba4c),h(_0x985b48['response'],0xc8,{'error':r});return;}}catch(_0x3ed990){p(_0x985b48['response'],_0x3ed990,_0x503fa2['action']);}}async['_publish'](_0x47b96d){try{await this['_roomHost']['publishTrustedUnitEvent']({'unitID':_0x47b96d['update']['unitId'],'memberID':_0x47b96d['memberID'],'userID':_0x47b96d['userID'],'eventID':'comment_update','data':{'commentUpdateEvent':_0x47b96d['update']}});}catch{}}};function a(_0x57f9d1,_0x5d5c98){let _0x31a898=o(_0x57f9d1),_0x3c77dd=s(_0x31a898['unitId'],'unitId');if(_0x3c77dd!==_0x5d5c98)throw d('Route\x20and\x20body\x20unitId\x20must\x20match');return{'unitId':_0x3c77dd,'threadId':l(_0x31a898['threadId'],'threadId')};}function o(_0x3bd74f){if(!_0x3bd74f||typeof _0x3bd74f!='object'||Array['isArray'](_0x3bd74f))throw d('Request\x20body\x20must\x20be\x20an\x20object');return _0x3bd74f;}function s(_0x1ee4e1,_0x147307){if(typeof _0x1ee4e1!='string'||_0x1ee4e1['length']===0x0)throw d(_0x147307+'\x20must\x20be\x20a\x20non-empty\x20string');return _0x1ee4e1;}function c(_0x5aedea,_0x13d79a){return _0x5aedea==null||_0x5aedea===''?{}:{'replyID':s(_0x5aedea,_0x13d79a)};}function l(_0x101d47,_0x5de7a0){if(!Array['isArray'](_0x101d47)||_0x101d47['some'](_0x2e16a3=>typeof _0x2e16a3!='string'||_0x2e16a3['length']===0x0))throw d(_0x5de7a0+'\x20must\x20be\x20an\x20array\x20of\x20non-empty\x20strings');return[..._0x101d47];}function u(_0x181d23){if(_0x181d23!==n['CommentSolvedStatus']['OpenOrReOpen']&&_0x181d23!==n['CommentSolvedStatus']['Solved'])throw d('solved\x20must\x20be\x20OpenOrReOpen\x20or\x20Solved');return _0x181d23;}function d(_0xd1fe7f){return new e['CollabError']('INVALID_REQUEST',_0xd1fe7f);}function f(_0x3db15a){if(!_0x3db15a['startsWith']('/')||_0x3db15a==='/'||_0x3db15a['endsWith']('/')||_0x3db15a['includes']('//'))throw TypeError('protocolBasePath\x20must\x20be\x20an\x20absolute\x20path\x20without\x20a\x20trailing\x20slash');return _0x3db15a;}function p(_0x548e00,_0xefd4b1,_0x436558){let _0x7814ac=m(_0xefd4b1),_0x51c3ad=_0x436558==='list'?{'comments':{},'users':{}}:_0x436558==='add'?{'comment':void 0x0}:_0x436558==='reply'?{'reply':void 0x0}:{};h(_0x548e00,_0x7814ac['status'],{'error':_0x7814ac['error'],..._0x51c3ad});}function m(_0x5455c3){if(_0x5455c3 instanceof t['NodeTransportError'])return _0x5455c3['code']==='REQUEST_BODY_TOO_LARGE'?{'status':0x19d,'error':{'code':n['ErrorCode']['INVALID_ARGUMENT'],'message':_0x5455c3['message']}}:_0x5455c3['code']==='INVALID_JSON'||_0x5455c3['code']==='REQUEST_ABORTED'?{'status':0x190,'error':{'code':n['ErrorCode']['INVALID_ARGUMENT'],'message':_0x5455c3['message']}}:{'status':0x1f7,'error':{'code':n['ErrorCode']['INTERNAL_ERROR'],'message':_0x5455c3['message']}};if(!(_0x5455c3 instanceof e['CollabError']))return{'status':0x1f4,'error':{'code':n['ErrorCode']['INTERNAL_ERROR'],'message':'Internal\x20error'}};let [_0xc135ee,_0x11201b]=((()=>{switch(_0x5455c3['code']){case'INVALID_REQUEST':return[0x190,n['ErrorCode']['INVALID_ARGUMENT']];case'UNAUTHENTICATED':return[0x191,n['ErrorCode']['UNAUTHENTICATED']];case'PERMISSION_DENIED':return[0x193,n['ErrorCode']['PERMISSION_DENIED']];case'UNIT_NOT_FOUND':return[0x194,n['ErrorCode']['NOT_FOUND']];case'ADAPTER_FAILURE':return[0x1f7,n['ErrorCode']['INTERNAL_ERROR']];default:return[0x1f4,n['ErrorCode']['INTERNAL_ERROR']];}})());return{'status':_0xc135ee,'error':{'code':_0x11201b,'message':_0x5455c3['message']}};}function h(_0x2adc78,_0x54d7e0,_0x8b77e1){_0x2adc78['writableEnded']||(_0x2adc78['statusCode']=_0x54d7e0,_0x2adc78['setHeader']('content-type','application/json;\x20charset=utf-8'),_0x2adc78['end'](JSON['stringify'](_0x8b77e1)));}exports['UniverCommentEndpoint']=i;
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const _0x4391ae=_0x2745;function _0x1099(){const _0x11e501=['3302799OnmaBM','37218WfhaVq','7241960dHZnZO','3879617oJIwcj','495KZTrPZ','24666JcIsmn','16iLHyfm','10IIytYc','3098844hJzazq','UniverCommentEndpoint','5390100cukeAH','47NMTdOX'];_0x1099=function(){return _0x11e501;};return _0x1099();}(function(_0x13ba21,_0x13557a){const _0x401349=_0x2745,_0x3013db=_0x13ba21();while(!![]){try{const _0x4937e0=parseInt(_0x401349(0x149))/0x1*(-parseInt(_0x401349(0x143))/0x2)+parseInt(_0x401349(0x14a))/0x3+parseInt(_0x401349(0x146))/0x4+parseInt(_0x401349(0x142))/0x5*(-parseInt(_0x401349(0x14b))/0x6)+-parseInt(_0x401349(0x141))/0x7+-parseInt(_0x401349(0x144))/0x8*(-parseInt(_0x401349(0x148))/0x9)+-parseInt(_0x401349(0x145))/0xa*(parseInt(_0x401349(0x14c))/0xb);if(_0x4937e0===_0x13557a)break;else _0x3013db['push'](_0x3013db['shift']());}catch(_0x436587){_0x3013db['push'](_0x3013db['shift']());}}}(_0x1099,0xa2de1));import _0x20fa15 from'./index.cjs';const facadeExport0=_0x20fa15[_0x4391ae(0x147)];function _0x2745(_0x53bc7d,_0x22633c){_0x53bc7d=_0x53bc7d-0x141;const _0x1099bf=_0x1099();let _0x274578=_0x1099bf[_0x53bc7d];return _0x274578;}export{facadeExport0 as UniverCommentEndpoint};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@univerjs-pro/collaboration-comment-endpoint",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.6.
|
|
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,10 +16,10 @@
|
|
|
16
16
|
"dist"
|
|
17
17
|
],
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@univerjs-pro/collaboration-comment-service": "1.6.
|
|
20
|
-
"@univerjs-pro/collaboration-endpoint": "1.6.
|
|
21
|
-
"@univerjs-pro/collaboration-service": "1.6.
|
|
22
|
-
"@univerjs-pro/collaboration-transport-node": "1.6.
|
|
23
|
-
"@univerjs/protocol": "1.6.
|
|
19
|
+
"@univerjs-pro/collaboration-comment-service": "1.6.1",
|
|
20
|
+
"@univerjs-pro/collaboration-endpoint": "1.6.1",
|
|
21
|
+
"@univerjs-pro/collaboration-service": "1.6.1",
|
|
22
|
+
"@univerjs-pro/collaboration-transport-node": "1.6.1",
|
|
23
|
+
"@univerjs/protocol": "1.6.1"
|
|
24
24
|
}
|
|
25
25
|
}
|