@univerjs-pro/collaboration-comment-endpoint 1.6.2 → 1.6.3
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(_0x3f748a){if(!_0x3f748a?.['service'])throw TypeError('UniverCommentEndpoint\x20requires\x20a\x20service');if(!_0x3f748a?.['roomHost'])throw TypeError('UniverCommentEndpoint\x20requires\x20a\x20roomHost');this['_service']=_0x3f748a['service'],this['_roomHost']=_0x3f748a['roomHost'],this['_protocolBasePath']=f(_0x3f748a['protocolBasePath']??'/universer-api'),this['_subscription']=this['_service']['on']('commentCommitted',_0x23bd0f=>this['_track'](this['_publish'](_0x23bd0f)));}['register'](_0x1ded77){if(this['_disposed'])throw new e['CollabError']('INTERNAL_ERROR','Comment\x20Endpoint\x20is\x20disposed');let _0x2461b9=_0xaafc90=>_0x42f060=>this['_track'](this['_handleHttp'](_0x42f060,{'action':_0xaafc90,'unitID':_0x42f060['params']['unitID']}));for(let _0x42b3b2 of['add','list','reply','solved','edit','delete'])_0x1ded77['post'](this['_protocolBasePath']+'/comment/unit/:unitID/'+_0x42b3b2,_0x2461b9(_0x42b3b2));_0x1ded77['get'](this['_protocolBasePath']+'/comment/unit/:unitID/list',_0x2461b9('list'));}['dispose'](){return this['_disposePromise']||=(this['_disposed']=!0x0,this['_subscription']['dispose'](),Promise['allSettled']([...this['_calls']])['then'](()=>void 0x0)),this['_disposePromise'];}['_track'](_0x125165){return this['_calls']['add'](_0x125165),_0x125165['finally'](()=>this['_calls']['delete'](_0x125165))['catch'](()=>void 0x0),_0x125165;}async['_handleHttp'](_0x108d5a,_0x3067c5){try{if(this['_disposed'])throw new e['CollabError']('INTERNAL_ERROR','Comment\x20Endpoint\x20is\x20disposed');let _0x38596f=new URL(_0x108d5a['incomingMessage']['url']??'/','http://localhost');if(!_0x3067c5['unitID']||_0x3067c5['unitID']['includes']('/'))throw d('Invalid\x20route\x20unitId');if(!_0x108d5a['userID'])throw new e['CollabError']('UNAUTHENTICATED','HTTP\x20user\x20is\x20not\x20authenticated');if(_0x3067c5['action']==='list'){let _0x344ec2=a(_0x108d5a['incomingMessage']['method']==='GET'?{'unitId':_0x3067c5['unitID'],'threadId':_0x38596f['searchParams']['getAll']('threadId')}:await _0x108d5a['readJson'](),_0x3067c5['unitID']),_0x3cf4d6=await this['_service']['listComments']({'unitID':_0x3067c5['unitID'],'threadIDs':_0x344ec2['threadId']},{'userID':_0x108d5a['userID'],'customData':_0x108d5a['customData']});h(_0x108d5a['response'],0xc8,{'error':r,..._0x3cf4d6});return;}let _0x4dc00d=o(await _0x108d5a['readJson']());if(s(_0x4dc00d['unitId'],'unitId')!==_0x3067c5['unitID'])throw d('Route\x20and\x20body\x20unitId\x20must\x20match');let _0x4b0d85=s(_0x4dc00d['memberId'],'memberId'),_0x44c5e2={'userID':_0x108d5a['userID'],'memberID':_0x4b0d85,'customData':_0x108d5a['customData']};switch(_0x3067c5['action']){case'add':{let _0x11d315=await this['_service']['addComment']({'unitID':_0x3067c5['unitID'],'content':s(_0x4dc00d['content'],'content'),'mentions':l(_0x4dc00d['mention'],'mention')},_0x44c5e2);h(_0x108d5a['response'],0xc8,{'error':r,'comment':_0x11d315});return;}case'reply':{let _0x8550b4=await this['_service']['replyComment']({'unitID':_0x3067c5['unitID'],'threadID':s(_0x4dc00d['threadId'],'threadId'),'content':s(_0x4dc00d['content'],'content'),'mentions':l(_0x4dc00d['mention'],'mention')},_0x44c5e2);h(_0x108d5a['response'],0xc8,{'error':r,'reply':_0x8550b4});return;}case'solved':{let _0x1a97ec=u(_0x4dc00d['solved']);await this['_service']['setThreadSolved']({'unitID':_0x3067c5['unitID'],'threadID':s(_0x4dc00d['threadId'],'threadId'),'solved':_0x1a97ec},_0x44c5e2),h(_0x108d5a['response'],0xc8,{'error':r});return;}case'edit':await this['_service']['editComment']({'unitID':_0x3067c5['unitID'],'threadID':s(_0x4dc00d['threadId'],'threadId'),'replyID':s(_0x4dc00d['replyId'],'replyId'),'content':s(_0x4dc00d['content'],'content'),'mentions':l(_0x4dc00d['mention'],'mention')},_0x44c5e2),h(_0x108d5a['response'],0xc8,{'error':r});return;case'delete':await this['_service']['deleteComment']({'unitID':_0x3067c5['unitID'],'threadID':s(_0x4dc00d['threadId'],'threadId'),...c(_0x4dc00d['replyId'],'replyId')},_0x44c5e2),h(_0x108d5a['response'],0xc8,{'error':r});return;}}catch(_0x345c1b){p(_0x108d5a['response'],_0x345c1b,_0x3067c5['action']);}}async['_publish'](_0x589f38){try{await this['_roomHost']['publishTrustedUnitEvent']({'unitID':_0x589f38['update']['unitId'],'memberID':_0x589f38['memberID'],'userID':_0x589f38['userID'],'eventID':'comment_update','data':{'commentUpdateEvent':_0x589f38['update']}});}catch{}}};function a(_0x3d3935,_0x3ab5cb){let _0x1d1e77=o(_0x3d3935),_0x1c8df5=s(_0x1d1e77['unitId'],'unitId');if(_0x1c8df5!==_0x3ab5cb)throw d('Route\x20and\x20body\x20unitId\x20must\x20match');return{'unitId':_0x1c8df5,'threadId':l(_0x1d1e77['threadId'],'threadId')};}function o(_0x4caa16){if(!_0x4caa16||typeof _0x4caa16!='object'||Array['isArray'](_0x4caa16))throw d('Request\x20body\x20must\x20be\x20an\x20object');return _0x4caa16;}function s(_0x246e6f,_0x31e2f6){if(typeof _0x246e6f!='string'||_0x246e6f['length']===0x0)throw d(_0x31e2f6+'\x20must\x20be\x20a\x20non-empty\x20string');return _0x246e6f;}function c(_0x10cf47,_0x39450d){return _0x10cf47==null||_0x10cf47===''?{}:{'replyID':s(_0x10cf47,_0x39450d)};}function l(_0x3d7c62,_0x482f86){if(!Array['isArray'](_0x3d7c62)||_0x3d7c62['some'](_0x3c25d2=>typeof _0x3c25d2!='string'||_0x3c25d2['length']===0x0))throw d(_0x482f86+'\x20must\x20be\x20an\x20array\x20of\x20non-empty\x20strings');return[..._0x3d7c62];}function u(_0x57d3be){if(_0x57d3be!==n['CommentSolvedStatus']['OpenOrReOpen']&&_0x57d3be!==n['CommentSolvedStatus']['Solved'])throw d('solved\x20must\x20be\x20OpenOrReOpen\x20or\x20Solved');return _0x57d3be;}function d(_0x551a1d){return new e['CollabError']('INVALID_REQUEST',_0x551a1d);}function f(_0x2272f7){if(!_0x2272f7['startsWith']('/')||_0x2272f7==='/'||_0x2272f7['endsWith']('/')||_0x2272f7['includes']('//'))throw TypeError('protocolBasePath\x20must\x20be\x20an\x20absolute\x20path\x20without\x20a\x20trailing\x20slash');return _0x2272f7;}function p(_0x208638,_0x48ec14,_0x48385a){let _0x112d44=m(_0x48ec14),_0x189257=_0x48385a==='list'?{'comments':{},'users':{}}:_0x48385a==='add'?{'comment':void 0x0}:_0x48385a==='reply'?{'reply':void 0x0}:{};h(_0x208638,_0x112d44['status'],{'error':_0x112d44['error'],..._0x189257});}function m(_0x5e91d4){if(_0x5e91d4 instanceof t['NodeTransportError'])return _0x5e91d4['code']==='REQUEST_BODY_TOO_LARGE'?{'status':0x19d,'error':{'code':n['ErrorCode']['INVALID_ARGUMENT'],'message':_0x5e91d4['message']}}:_0x5e91d4['code']==='INVALID_JSON'||_0x5e91d4['code']==='REQUEST_ABORTED'?{'status':0x190,'error':{'code':n['ErrorCode']['INVALID_ARGUMENT'],'message':_0x5e91d4['message']}}:{'status':0x1f7,'error':{'code':n['ErrorCode']['INTERNAL_ERROR'],'message':_0x5e91d4['message']}};if(!(_0x5e91d4 instanceof e['CollabError']))return{'status':0x1f4,'error':{'code':n['ErrorCode']['INTERNAL_ERROR'],'message':'Internal\x20error'}};let [_0x4e8f83,_0x32f889]=((()=>{switch(_0x5e91d4['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':_0x4e8f83,'error':{'code':_0x32f889,'message':_0x5e91d4['message']}};}function h(_0x5d1d93,_0x50768f,_0x33a0b4){_0x5d1d93['writableEnded']||(_0x5d1d93['statusCode']=_0x50768f,_0x5d1d93['setHeader']('content-type','application/json;\x20charset=utf-8'),_0x5d1d93['end'](JSON['stringify'](_0x33a0b4)));}exports['UniverCommentEndpoint']=i;
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function _0x121d(_0x3bb562,_0x182078){_0x3bb562=_0x3bb562-0x131;const _0x2c0e02=_0x2c0e();let _0x121d4a=_0x2c0e02[_0x3bb562];return _0x121d4a;}const _0x264037=_0x121d;(function(_0x178d53,_0x24fe66){const _0x301f53=_0x121d,_0x1582ae=_0x178d53();while(!![]){try{const _0x31f98c=-parseInt(_0x301f53(0x13b))/0x1*(-parseInt(_0x301f53(0x13d))/0x2)+parseInt(_0x301f53(0x137))/0x3*(-parseInt(_0x301f53(0x132))/0x4)+parseInt(_0x301f53(0x134))/0x5*(parseInt(_0x301f53(0x136))/0x6)+-parseInt(_0x301f53(0x13c))/0x7*(parseInt(_0x301f53(0x131))/0x8)+parseInt(_0x301f53(0x133))/0x9*(parseInt(_0x301f53(0x138))/0xa)+-parseInt(_0x301f53(0x13e))/0xb*(-parseInt(_0x301f53(0x135))/0xc)+parseInt(_0x301f53(0x13a))/0xd;if(_0x31f98c===_0x24fe66)break;else _0x1582ae['push'](_0x1582ae['shift']());}catch(_0x32d186){_0x1582ae['push'](_0x1582ae['shift']());}}}(_0x2c0e,0x331c0));import _0xbc9391 from'./index.cjs';function _0x2c0e(){const _0x2e5cd7=['1055593blXNpI','569512BrpmFY','1732fEtdmN','639UBQInp','743085DNdUnV','12LRivxH','6kPFdMB','2772QbGMmh','190DvTKLB','UniverCommentEndpoint','4986033ljrpgU','97TkiRYe','35oZuAqL','6926pRSlLr'];_0x2c0e=function(){return _0x2e5cd7;};return _0x2c0e();}const facadeExport0=_0xbc9391[_0x264037(0x139)];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.3",
|
|
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.3",
|
|
20
|
+
"@univerjs-pro/collaboration-endpoint": "1.6.3",
|
|
21
|
+
"@univerjs-pro/collaboration-service": "1.6.3",
|
|
22
|
+
"@univerjs-pro/collaboration-transport-node": "1.6.3",
|
|
23
|
+
"@univerjs/protocol": "1.6.3"
|
|
24
24
|
}
|
|
25
25
|
}
|