@univerjs-pro/collaboration-comment-endpoint 1.6.0 → 1.6.2
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(_0x1fc917){if(!_0x1fc917?.['service'])throw TypeError('UniverCommentEndpoint\x20requires\x20a\x20service');if(!_0x1fc917?.['roomHost'])throw TypeError('UniverCommentEndpoint\x20requires\x20a\x20roomHost');this['_service']=_0x1fc917['service'],this['_roomHost']=_0x1fc917['roomHost'],this['_protocolBasePath']=f(_0x1fc917['protocolBasePath']??'/universer-api'),this['_subscription']=this['_service']['on']('commentCommitted',_0x484961=>this['_track'](this['_publish'](_0x484961)));}['register'](_0x129e3b){if(this['_disposed'])throw new e['CollabError']('INTERNAL_ERROR','Comment\x20Endpoint\x20is\x20disposed');let _0x398fd7=_0x88b483=>_0x36b118=>this['_track'](this['_handleHttp'](_0x36b118,{'action':_0x88b483,'unitID':_0x36b118['params']['unitID']}));for(let _0x138432 of['add','list','reply','solved','edit','delete'])_0x129e3b['post'](this['_protocolBasePath']+'/comment/unit/:unitID/'+_0x138432,_0x398fd7(_0x138432));_0x129e3b['get'](this['_protocolBasePath']+'/comment/unit/:unitID/list',_0x398fd7('list'));}['dispose'](){return this['_disposePromise']||=(this['_disposed']=!0x0,this['_subscription']['dispose'](),Promise['allSettled']([...this['_calls']])['then'](()=>void 0x0)),this['_disposePromise'];}['_track'](_0x272230){return this['_calls']['add'](_0x272230),_0x272230['finally'](()=>this['_calls']['delete'](_0x272230))['catch'](()=>void 0x0),_0x272230;}async['_handleHttp'](_0x45f174,_0x4e64ca){try{if(this['_disposed'])throw new e['CollabError']('INTERNAL_ERROR','Comment\x20Endpoint\x20is\x20disposed');let _0x2d095b=new URL(_0x45f174['incomingMessage']['url']??'/','http://localhost');if(!_0x4e64ca['unitID']||_0x4e64ca['unitID']['includes']('/'))throw d('Invalid\x20route\x20unitId');if(!_0x45f174['userID'])throw new e['CollabError']('UNAUTHENTICATED','HTTP\x20user\x20is\x20not\x20authenticated');if(_0x4e64ca['action']==='list'){let _0x8b2319=a(_0x45f174['incomingMessage']['method']==='GET'?{'unitId':_0x4e64ca['unitID'],'threadId':_0x2d095b['searchParams']['getAll']('threadId')}:await _0x45f174['readJson'](),_0x4e64ca['unitID']),_0x472587=await this['_service']['listComments']({'unitID':_0x4e64ca['unitID'],'threadIDs':_0x8b2319['threadId']},{'userID':_0x45f174['userID'],'customData':_0x45f174['customData']});h(_0x45f174['response'],0xc8,{'error':r,..._0x472587});return;}let _0x3fe36a=o(await _0x45f174['readJson']());if(s(_0x3fe36a['unitId'],'unitId')!==_0x4e64ca['unitID'])throw d('Route\x20and\x20body\x20unitId\x20must\x20match');let _0x157b98=s(_0x3fe36a['memberId'],'memberId'),_0x3c1f40={'userID':_0x45f174['userID'],'memberID':_0x157b98,'customData':_0x45f174['customData']};switch(_0x4e64ca['action']){case'add':{let _0x112d09=await this['_service']['addComment']({'unitID':_0x4e64ca['unitID'],'content':s(_0x3fe36a['content'],'content'),'mentions':l(_0x3fe36a['mention'],'mention')},_0x3c1f40);h(_0x45f174['response'],0xc8,{'error':r,'comment':_0x112d09});return;}case'reply':{let _0x1d5679=await this['_service']['replyComment']({'unitID':_0x4e64ca['unitID'],'threadID':s(_0x3fe36a['threadId'],'threadId'),'content':s(_0x3fe36a['content'],'content'),'mentions':l(_0x3fe36a['mention'],'mention')},_0x3c1f40);h(_0x45f174['response'],0xc8,{'error':r,'reply':_0x1d5679});return;}case'solved':{let _0x43525a=u(_0x3fe36a['solved']);await this['_service']['setThreadSolved']({'unitID':_0x4e64ca['unitID'],'threadID':s(_0x3fe36a['threadId'],'threadId'),'solved':_0x43525a},_0x3c1f40),h(_0x45f174['response'],0xc8,{'error':r});return;}case'edit':await this['_service']['editComment']({'unitID':_0x4e64ca['unitID'],'threadID':s(_0x3fe36a['threadId'],'threadId'),'replyID':s(_0x3fe36a['replyId'],'replyId'),'content':s(_0x3fe36a['content'],'content'),'mentions':l(_0x3fe36a['mention'],'mention')},_0x3c1f40),h(_0x45f174['response'],0xc8,{'error':r});return;case'delete':await this['_service']['deleteComment']({'unitID':_0x4e64ca['unitID'],'threadID':s(_0x3fe36a['threadId'],'threadId'),...c(_0x3fe36a['replyId'],'replyId')},_0x3c1f40),h(_0x45f174['response'],0xc8,{'error':r});return;}}catch(_0x2077cd){p(_0x45f174['response'],_0x2077cd,_0x4e64ca['action']);}}async['_publish'](_0x2dfca7){try{await this['_roomHost']['publishTrustedUnitEvent']({'unitID':_0x2dfca7['update']['unitId'],'memberID':_0x2dfca7['memberID'],'userID':_0x2dfca7['userID'],'eventID':'comment_update','data':{'commentUpdateEvent':_0x2dfca7['update']}});}catch{}}};function a(_0x42a655,_0x310f31){let _0x465d6a=o(_0x42a655),_0x418179=s(_0x465d6a['unitId'],'unitId');if(_0x418179!==_0x310f31)throw d('Route\x20and\x20body\x20unitId\x20must\x20match');return{'unitId':_0x418179,'threadId':l(_0x465d6a['threadId'],'threadId')};}function o(_0x33ef9d){if(!_0x33ef9d||typeof _0x33ef9d!='object'||Array['isArray'](_0x33ef9d))throw d('Request\x20body\x20must\x20be\x20an\x20object');return _0x33ef9d;}function s(_0x56e804,_0x3c12c0){if(typeof _0x56e804!='string'||_0x56e804['length']===0x0)throw d(_0x3c12c0+'\x20must\x20be\x20a\x20non-empty\x20string');return _0x56e804;}function c(_0x204f5d,_0x4c8f76){return _0x204f5d==null||_0x204f5d===''?{}:{'replyID':s(_0x204f5d,_0x4c8f76)};}function l(_0xe54e91,_0x37dd52){if(!Array['isArray'](_0xe54e91)||_0xe54e91['some'](_0x35d6d7=>typeof _0x35d6d7!='string'||_0x35d6d7['length']===0x0))throw d(_0x37dd52+'\x20must\x20be\x20an\x20array\x20of\x20non-empty\x20strings');return[..._0xe54e91];}function u(_0x4cd8be){if(_0x4cd8be!==n['CommentSolvedStatus']['OpenOrReOpen']&&_0x4cd8be!==n['CommentSolvedStatus']['Solved'])throw d('solved\x20must\x20be\x20OpenOrReOpen\x20or\x20Solved');return _0x4cd8be;}function d(_0x529feb){return new e['CollabError']('INVALID_REQUEST',_0x529feb);}function f(_0x544a26){if(!_0x544a26['startsWith']('/')||_0x544a26==='/'||_0x544a26['endsWith']('/')||_0x544a26['includes']('//'))throw TypeError('protocolBasePath\x20must\x20be\x20an\x20absolute\x20path\x20without\x20a\x20trailing\x20slash');return _0x544a26;}function p(_0x13d78d,_0xa939a3,_0x53e0ba){let _0x5f2c94=m(_0xa939a3),_0x141e5f=_0x53e0ba==='list'?{'comments':{},'users':{}}:_0x53e0ba==='add'?{'comment':void 0x0}:_0x53e0ba==='reply'?{'reply':void 0x0}:{};h(_0x13d78d,_0x5f2c94['status'],{'error':_0x5f2c94['error'],..._0x141e5f});}function m(_0x380bca){if(_0x380bca instanceof t['NodeTransportError'])return _0x380bca['code']==='REQUEST_BODY_TOO_LARGE'?{'status':0x19d,'error':{'code':n['ErrorCode']['INVALID_ARGUMENT'],'message':_0x380bca['message']}}:_0x380bca['code']==='INVALID_JSON'||_0x380bca['code']==='REQUEST_ABORTED'?{'status':0x190,'error':{'code':n['ErrorCode']['INVALID_ARGUMENT'],'message':_0x380bca['message']}}:{'status':0x1f7,'error':{'code':n['ErrorCode']['INTERNAL_ERROR'],'message':_0x380bca['message']}};if(!(_0x380bca instanceof e['CollabError']))return{'status':0x1f4,'error':{'code':n['ErrorCode']['INTERNAL_ERROR'],'message':'Internal\x20error'}};let [_0x537d87,_0x4045c0]=((()=>{switch(_0x380bca['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':_0x537d87,'error':{'code':_0x4045c0,'message':_0x380bca['message']}};}function h(_0x30e0e2,_0x1bc62f,_0xdf0026){_0x30e0e2['writableEnded']||(_0x30e0e2['statusCode']=_0x1bc62f,_0x30e0e2['setHeader']('content-type','application/json;\x20charset=utf-8'),_0x30e0e2['end'](JSON['stringify'](_0xdf0026)));}exports['UniverCommentEndpoint']=i;
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const _0x358d08=_0x3479;(function(_0x26751c,_0x31ee3f){const _0x49e33c=_0x3479,_0x140b24=_0x26751c();while(!![]){try{const _0x5a5107=parseInt(_0x49e33c(0x8e))/0x1+-parseInt(_0x49e33c(0x8a))/0x2+parseInt(_0x49e33c(0x8b))/0x3*(-parseInt(_0x49e33c(0x8f))/0x4)+parseInt(_0x49e33c(0x8c))/0x5+-parseInt(_0x49e33c(0x8d))/0x6+-parseInt(_0x49e33c(0x89))/0x7+-parseInt(_0x49e33c(0x90))/0x8*(-parseInt(_0x49e33c(0x88))/0x9);if(_0x5a5107===_0x31ee3f)break;else _0x140b24['push'](_0x140b24['shift']());}catch(_0x2c6e49){_0x140b24['push'](_0x140b24['shift']());}}}(_0x3ffb,0xdd869));function _0x3ffb(){const _0x9895d8=['4299246OqBvmy','2432406TOvhnT','107505TYaCtk','6475885JtYUWf','6548010rCORdL','858566XpCIwF','120tdxDZN','11001568MVJbxb','UniverCommentEndpoint','18unsRYw'];_0x3ffb=function(){return _0x9895d8;};return _0x3ffb();}function _0x3479(_0xe6bac9,_0x4e9411){_0xe6bac9=_0xe6bac9-0x87;const _0x3ffb20=_0x3ffb();let _0x3479a7=_0x3ffb20[_0xe6bac9];return _0x3479a7;}import _0x88d3e3 from'./index.cjs';const facadeExport0=_0x88d3e3[_0x358d08(0x87)];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.2",
|
|
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.2",
|
|
20
|
+
"@univerjs-pro/collaboration-endpoint": "1.6.2",
|
|
21
|
+
"@univerjs-pro/collaboration-service": "1.6.2",
|
|
22
|
+
"@univerjs-pro/collaboration-transport-node": "1.6.2",
|
|
23
|
+
"@univerjs/protocol": "1.6.2"
|
|
24
24
|
}
|
|
25
25
|
}
|