@univerjs-pro/collaboration-comment-endpoint 1.3.0 → 1.3.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(_0x33c5c9){if(!_0x33c5c9?.['service'])throw TypeError('UniverCommentEndpoint\x20requires\x20a\x20service');if(!_0x33c5c9?.['roomHost'])throw TypeError('UniverCommentEndpoint\x20requires\x20a\x20roomHost');this['_service']=_0x33c5c9['service'],this['_roomHost']=_0x33c5c9['roomHost'],this['_protocolBasePath']=f(_0x33c5c9['protocolBasePath']??'/universer-api'),this['_subscription']=this['_service']['on']('commentCommitted',_0x105018=>this['_track'](this['_publish'](_0x105018)));}['register'](_0x478121){if(this['_disposed'])throw new e['CollabError']('INTERNAL_ERROR','Comment\x20Endpoint\x20is\x20disposed');let _0x4b4c97=_0x4dbab8=>_0xda49d=>this['_track'](this['_handleHttp'](_0xda49d,{'action':_0x4dbab8,'unitID':_0xda49d['params']['unitID']}));for(let _0x1c508 of['add','list','reply','solved','edit','delete'])_0x478121['post'](this['_protocolBasePath']+'/comment/unit/:unitID/'+_0x1c508,_0x4b4c97(_0x1c508));_0x478121['get'](this['_protocolBasePath']+'/comment/unit/:unitID/list',_0x4b4c97('list'));}['dispose'](){return this['_disposePromise']?this['_disposePromise']:(this['_disposed']=!0x0,this['_subscription']['dispose'](),this['_disposePromise']=Promise['allSettled']([...this['_calls']])['then'](()=>void 0x0),this['_disposePromise']);}['_track'](_0x17be77){return this['_calls']['add'](_0x17be77),_0x17be77['finally'](()=>this['_calls']['delete'](_0x17be77))['catch'](()=>void 0x0),_0x17be77;}async['_handleHttp'](_0x36d583,_0x7b78d6){try{if(this['_disposed'])throw new e['CollabError']('INTERNAL_ERROR','Comment\x20Endpoint\x20is\x20disposed');let _0x2751df=new URL(_0x36d583['incomingMessage']['url']??'/','http://localhost');if(!_0x7b78d6['unitID']||_0x7b78d6['unitID']['includes']('/'))throw d('Invalid\x20route\x20unitId');if(!_0x36d583['userID'])throw new e['CollabError']('UNAUTHENTICATED','HTTP\x20user\x20is\x20not\x20authenticated');if(_0x7b78d6['action']==='list'){let _0x459419=a(_0x36d583['incomingMessage']['method']==='GET'?{'unitId':_0x7b78d6['unitID'],'threadId':_0x2751df['searchParams']['getAll']('threadId')}:await _0x36d583['readJson'](),_0x7b78d6['unitID']),_0x1f003b=await this['_service']['listComments']({'unitID':_0x7b78d6['unitID'],'threadIDs':_0x459419['threadId']},{'userID':_0x36d583['userID'],'customData':_0x36d583['customData']});h(_0x36d583['response'],0xc8,{'error':r,..._0x1f003b});return;}let _0x4f1e39=o(await _0x36d583['readJson']());if(s(_0x4f1e39['unitId'],'unitId')!==_0x7b78d6['unitID'])throw d('Route\x20and\x20body\x20unitId\x20must\x20match');let _0x37d017=s(_0x4f1e39['memberId'],'memberId'),_0x23a25b={'userID':_0x36d583['userID'],'memberID':_0x37d017,'customData':_0x36d583['customData']};switch(_0x7b78d6['action']){case'add':{let _0x528eb8=await this['_service']['addComment']({'unitID':_0x7b78d6['unitID'],'content':s(_0x4f1e39['content'],'content'),'mentions':l(_0x4f1e39['mention'],'mention')},_0x23a25b);h(_0x36d583['response'],0xc8,{'error':r,'comment':_0x528eb8});return;}case'reply':{let _0x28ce2c=await this['_service']['replyComment']({'unitID':_0x7b78d6['unitID'],'threadID':s(_0x4f1e39['threadId'],'threadId'),'content':s(_0x4f1e39['content'],'content'),'mentions':l(_0x4f1e39['mention'],'mention')},_0x23a25b);h(_0x36d583['response'],0xc8,{'error':r,'reply':_0x28ce2c});return;}case'solved':{let _0x33ae69=u(_0x4f1e39['solved']);await this['_service']['setThreadSolved']({'unitID':_0x7b78d6['unitID'],'threadID':s(_0x4f1e39['threadId'],'threadId'),'solved':_0x33ae69},_0x23a25b),h(_0x36d583['response'],0xc8,{'error':r});return;}case'edit':await this['_service']['editComment']({'unitID':_0x7b78d6['unitID'],'threadID':s(_0x4f1e39['threadId'],'threadId'),'replyID':s(_0x4f1e39['replyId'],'replyId'),'content':s(_0x4f1e39['content'],'content'),'mentions':l(_0x4f1e39['mention'],'mention')},_0x23a25b),h(_0x36d583['response'],0xc8,{'error':r});return;case'delete':await this['_service']['deleteComment']({'unitID':_0x7b78d6['unitID'],'threadID':s(_0x4f1e39['threadId'],'threadId'),...c(_0x4f1e39['replyId'],'replyId')},_0x23a25b),h(_0x36d583['response'],0xc8,{'error':r});return;}}catch(_0xb660a7){p(_0x36d583['response'],_0xb660a7,_0x7b78d6['action']);}}async['_publish'](_0x426232){try{await this['_roomHost']['publishTrustedUnitEvent']({'unitID':_0x426232['update']['unitId'],'memberID':_0x426232['memberID'],'userID':_0x426232['userID'],'eventID':'comment_update','data':{'commentUpdateEvent':_0x426232['update']}});}catch{}}};function a(_0x30f40c,_0x20b537){let _0x266054=o(_0x30f40c),_0x404c57=s(_0x266054['unitId'],'unitId');if(_0x404c57!==_0x20b537)throw d('Route\x20and\x20body\x20unitId\x20must\x20match');return{'unitId':_0x404c57,'threadId':l(_0x266054['threadId'],'threadId')};}function o(_0x5bd67a){if(!_0x5bd67a||typeof _0x5bd67a!='object'||Array['isArray'](_0x5bd67a))throw d('Request\x20body\x20must\x20be\x20an\x20object');return _0x5bd67a;}function s(_0xd79c8e,_0x3f4e2a){if(typeof _0xd79c8e!='string'||_0xd79c8e['length']===0x0)throw d(_0x3f4e2a+'\x20must\x20be\x20a\x20non-empty\x20string');return _0xd79c8e;}function c(_0x3387d0,_0x283c7b){return _0x3387d0==null||_0x3387d0===''?{}:{'replyID':s(_0x3387d0,_0x283c7b)};}function l(_0x3debc7,_0x4538bd){if(!Array['isArray'](_0x3debc7)||_0x3debc7['some'](_0x806b3a=>typeof _0x806b3a!='string'||_0x806b3a['length']===0x0))throw d(_0x4538bd+'\x20must\x20be\x20an\x20array\x20of\x20non-empty\x20strings');return[..._0x3debc7];}function u(_0x2d9c82){if(_0x2d9c82!==n['CommentSolvedStatus']['OpenOrReOpen']&&_0x2d9c82!==n['CommentSolvedStatus']['Solved'])throw d('solved\x20must\x20be\x20OpenOrReOpen\x20or\x20Solved');return _0x2d9c82;}function d(_0x34ca15){return new e['CollabError']('INVALID_REQUEST',_0x34ca15);}function f(_0x1e452d){if(!_0x1e452d['startsWith']('/')||_0x1e452d==='/'||_0x1e452d['endsWith']('/')||_0x1e452d['includes']('//'))throw TypeError('protocolBasePath\x20must\x20be\x20an\x20absolute\x20path\x20without\x20a\x20trailing\x20slash');return _0x1e452d;}function p(_0x53d25a,_0x34adda,_0x56678b){let _0x5c6519=m(_0x34adda),_0x2974fd=_0x56678b==='list'?{'comments':{},'users':{}}:_0x56678b==='add'?{'comment':void 0x0}:_0x56678b==='reply'?{'reply':void 0x0}:{};h(_0x53d25a,_0x5c6519['status'],{'error':_0x5c6519['error'],..._0x2974fd});}function m(_0x1760e4){if(_0x1760e4 instanceof t['NodeTransportError'])return _0x1760e4['code']==='REQUEST_BODY_TOO_LARGE'?{'status':0x19d,'error':{'code':n['ErrorCode']['INVALID_ARGUMENT'],'message':_0x1760e4['message']}}:_0x1760e4['code']==='INVALID_JSON'||_0x1760e4['code']==='REQUEST_ABORTED'?{'status':0x190,'error':{'code':n['ErrorCode']['INVALID_ARGUMENT'],'message':_0x1760e4['message']}}:{'status':0x1f7,'error':{'code':n['ErrorCode']['INTERNAL_ERROR'],'message':_0x1760e4['message']}};if(!(_0x1760e4 instanceof e['CollabError']))return{'status':0x1f4,'error':{'code':n['ErrorCode']['INTERNAL_ERROR'],'message':'Internal\x20error'}};let [_0x1d54b4,_0x141623]=((()=>{switch(_0x1760e4['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':_0x1d54b4,'error':{'code':_0x141623,'message':_0x1760e4['message']}};}function h(_0x437e37,_0x25bfb2,_0x4e6f74){_0x437e37['writableEnded']||(_0x437e37['statusCode']=_0x25bfb2,_0x437e37['setHeader']('content-type','application/json;\x20charset=utf-8'),_0x437e37['end'](JSON['stringify'](_0x4e6f74)));}exports['UniverCommentEndpoint']=i;
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const _0x8fac10=_0x50ed;(function(_0x41c7b7,_0x230e00){const _0x4e9695=_0x50ed,_0x5ae8e0=_0x41c7b7();while(!![]){try{const _0x49167d=-parseInt(_0x4e9695(0x1b7))/0x1+parseInt(_0x4e9695(0x1bd))/0x2+-parseInt(_0x4e9695(0x1bb))/0x3*(-parseInt(_0x4e9695(0x1bf))/0x4)+-parseInt(_0x4e9695(0x1bc))/0x5+parseInt(_0x4e9695(0x1b9))/0x6+parseInt(_0x4e9695(0x1ba))/0x7+-parseInt(_0x4e9695(0x1b8))/0x8*(parseInt(_0x4e9695(0x1c0))/0x9);if(_0x49167d===_0x230e00)break;else _0x5ae8e0['push'](_0x5ae8e0['shift']());}catch(_0xe1694d){_0x5ae8e0['push'](_0x5ae8e0['shift']());}}}(_0x1520,0xdb21b));import _0x159f43 from'./index.cjs';const facadeExport0=_0x159f43[_0x8fac10(0x1be)];function _0x50ed(_0x39dfc7,_0x5b32ba){_0x39dfc7=_0x39dfc7-0x1b7;const _0x15209e=_0x1520();let _0x50ed82=_0x15209e[_0x39dfc7];return _0x50ed82;}export{facadeExport0 as UniverCommentEndpoint};function _0x1520(){const _0x297255=['12417manrYE','583785ToPbvC','1929296ZVqjtd','UniverCommentEndpoint','324nnDzPe','54297KKoxtq','573971ONKdba','3416BTJpSo','9034956GMJKGu','9510543AQjGRs'];_0x1520=function(){return _0x297255;};return _0x1520();}
|
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.3.
|
|
4
|
+
"version": "1.3.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.3.
|
|
20
|
-
"@univerjs-pro/collaboration-endpoint": "1.3.
|
|
21
|
-
"@univerjs-pro/collaboration-service": "1.3.
|
|
22
|
-
"@univerjs-pro/collaboration-transport-node": "1.3.
|
|
23
|
-
"@univerjs/protocol": "1.3.
|
|
19
|
+
"@univerjs-pro/collaboration-comment-service": "1.3.1",
|
|
20
|
+
"@univerjs-pro/collaboration-endpoint": "1.3.1",
|
|
21
|
+
"@univerjs-pro/collaboration-service": "1.3.1",
|
|
22
|
+
"@univerjs-pro/collaboration-transport-node": "1.3.1",
|
|
23
|
+
"@univerjs/protocol": "1.3.1"
|
|
24
24
|
}
|
|
25
25
|
}
|