@univerjs-pro/collaboration-comment-endpoint 1.0.3 → 1.1.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/README.md CHANGED
@@ -47,18 +47,18 @@ Registration order is authentication → Comment Endpoint → main Collaboration
47
47
 
48
48
  The table uses the default `protocolBasePath=/universer-api`:
49
49
 
50
- | Method | Path | Service action | Session requirement |
51
- | --- | --- | --- | --- |
52
- | `GET/POST` | `/universer-api/comment/unit/:unitID/list` | `listComments` | No online Session required |
53
- | `POST` | `/universer-api/comment/unit/:unitID/add` | `addComment` | User and `memberId` must match a joined Session |
54
- | `POST` | `/universer-api/comment/unit/:unitID/reply` | `replyComment` | Same as above |
55
- | `POST` | `/universer-api/comment/unit/:unitID/edit` | `editComment` | Same as above |
56
- | `POST` | `/universer-api/comment/unit/:unitID/solved` | `setThreadSolved` | Must associate the current user with a joined Session |
57
- | `POST` | `/universer-api/comment/unit/:unitID/delete` | `deleteComment` | User and `memberId` must match a joined Session |
58
-
59
- Every route calls Comment Service with `ctx.userID/customData` set by Transport middleware for the current HTTP request. List is a regular HTTP read. Writes additionally associate an online Session so the submitter can be excluded from realtime broadcasts. Comment ACL remains controlled by Comment Service middleware.
60
-
61
- After Comment Service commits successfully, Endpoint sends `comment_update` to other online members of the Unit. If the application calls Comment Service directly and its `memberID` resolves to an online Session, that Session is treated as the initiator and does not receive its own broadcast. If it cannot be resolved, the update is broadcast to all currently online members. The HTTP response does not depend on realtime delivery succeeding.
50
+ | Method | Path | Service action |
51
+ | --- | --- | --- |
52
+ | `GET/POST` | `/universer-api/comment/unit/:unitID/list` | `listComments` |
53
+ | `POST` | `/universer-api/comment/unit/:unitID/add` | `addComment` |
54
+ | `POST` | `/universer-api/comment/unit/:unitID/reply` | `replyComment` |
55
+ | `POST` | `/universer-api/comment/unit/:unitID/edit` | `editComment` |
56
+ | `POST` | `/universer-api/comment/unit/:unitID/solved` | `setThreadSolved` |
57
+ | `POST` | `/universer-api/comment/unit/:unitID/delete` | `deleteComment` |
58
+
59
+ Every route calls Comment Service with `ctx.userID/customData` set by Transport middleware for the current HTTP request. List is a regular HTTP read. Writes pass through `memberId` without requiring an online Session or JOIN. Comment ACL remains controlled by Comment Service middleware.
60
+
61
+ After Comment Service commits successfully, Endpoint sends `comment_update` to other online members of the Unit. If the application calls Comment Service directly and its `memberID/userID` match a joined Session, that Session is treated as the initiator and does not receive its own broadcast. If it cannot be resolved, the update is broadcast to all currently online members. The HTTP response does not depend on realtime delivery succeeding.
62
62
 
63
63
  Endpoint handles protocol errors and realtime updates but does not define Comment ACL. Install permissions in Comment Service. Realtime broadcasts currently cover only one main Endpoint process. Send failure does not roll back committed Comments; clients recover by listing again.
64
64
 
package/README.zh-CN.md CHANGED
@@ -50,21 +50,20 @@ transport.register(collabEndpoint);
50
50
 
51
51
  下表使用默认 `protocolBasePath=/universer-api`:
52
52
 
53
- | Method | Path | Service action | Session 要求 |
54
- | --- | --- | --- | --- |
55
- | `GET/POST` | `/universer-api/comment/unit/:unitID/list` | `listComments` | 不要求在线 Session |
56
- | `POST` | `/universer-api/comment/unit/:unitID/add` | `addComment` | 用户和 `memberId` 必须对应已 JOIN 的 Session |
57
- | `POST` | `/universer-api/comment/unit/:unitID/reply` | `replyComment` | 同上 |
58
- | `POST` | `/universer-api/comment/unit/:unitID/edit` | `editComment` | 同上 |
59
- | `POST` | `/universer-api/comment/unit/:unitID/solved` | `setThreadSolved` | 必须能关联当前用户已 JOIN 的 Session |
60
- | `POST` | `/universer-api/comment/unit/:unitID/delete` | `deleteComment` | 用户和 `memberId` 必须对应已 JOIN 的 Session |
53
+ | Method | Path | Service action |
54
+ | --- | --- | --- |
55
+ | `GET/POST` | `/universer-api/comment/unit/:unitID/list` | `listComments` |
56
+ | `POST` | `/universer-api/comment/unit/:unitID/add` | `addComment` |
57
+ | `POST` | `/universer-api/comment/unit/:unitID/reply` | `replyComment` |
58
+ | `POST` | `/universer-api/comment/unit/:unitID/edit` | `editComment` |
59
+ | `POST` | `/universer-api/comment/unit/:unitID/solved` | `setThreadSolved` |
60
+ | `POST` | `/universer-api/comment/unit/:unitID/delete` | `deleteComment` |
61
61
 
62
62
  所有路由都使用当前 HTTP 请求由 Transport middleware 设置的 `ctx.userID/customData` 调用
63
- Comment Service。list 是普通 HTTP 读取;写操作额外关联在线 Session,以便把提交者从实时
64
- 广播中排除。Comment ACL 仍由 Comment Service middleware 控制。
63
+ Comment Service。list 是普通 HTTP 读取;写操作透传 `memberId`,不要求在线 Session 或 JOIN。Comment ACL 仍由 Comment Service middleware 控制。
65
64
 
66
65
  Comment Service 提交成功后,Endpoint 会向同一 Unit 的其他在线成员发送
67
- `comment_update`。如果应用直接调用 Comment Service,并传入的 `memberID` 能找到在线
66
+ `comment_update`。如果应用直接调用 Comment Service,且传入的 `memberID/userID` 同时匹配已 JOIN 的
68
67
  Session,该 Session 会被视为发起方而不接收自己的广播;找不到时则向当前全部在线成员
69
68
  广播。HTTP 返回结果本身不依赖实时发送成功。
70
69
 
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(_0x31adb2){if(!_0x31adb2?.['service'])throw TypeError('UniverCommentEndpoint\x20requires\x20a\x20service');if(!_0x31adb2?.['roomHost'])throw TypeError('UniverCommentEndpoint\x20requires\x20a\x20roomHost');this['_service']=_0x31adb2['service'],this['_roomHost']=_0x31adb2['roomHost'],this['_protocolBasePath']=f(_0x31adb2['protocolBasePath']??'/universer-api'),this['_subscription']=this['_service']['on']('commentCommitted',_0x379a27=>this['_track'](this['_publish'](_0x379a27)));}['register'](_0x4fa22a){if(this['_disposed'])throw new e['CollabError']('INTERNAL_ERROR','Comment\x20Endpoint\x20is\x20disposed');let _0x51a2f6=_0x573cf6=>_0x36e730=>this['_track'](this['_handleHttp'](_0x36e730,{'action':_0x573cf6,'unitID':_0x36e730['params']['unitID']}));for(let _0x41681f of['add','list','reply','solved','edit','delete'])_0x4fa22a['post'](this['_protocolBasePath']+'/comment/unit/:unitID/'+_0x41681f,_0x51a2f6(_0x41681f));_0x4fa22a['get'](this['_protocolBasePath']+'/comment/unit/:unitID/list',_0x51a2f6('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'](_0x5151ca){return this['_calls']['add'](_0x5151ca),_0x5151ca['finally'](()=>this['_calls']['delete'](_0x5151ca))['catch'](()=>void 0x0),_0x5151ca;}async['_handleHttp'](_0x512a9a,_0x531c39){try{if(this['_disposed'])throw new e['CollabError']('INTERNAL_ERROR','Comment\x20Endpoint\x20is\x20disposed');let _0x3445d8=new URL(_0x512a9a['incomingMessage']['url']??'/','http://localhost');if(!_0x531c39['unitID']||_0x531c39['unitID']['includes']('/'))throw d('Invalid\x20route\x20unitId');if(!_0x512a9a['userID'])throw new e['CollabError']('UNAUTHENTICATED','HTTP\x20user\x20is\x20not\x20authenticated');if(_0x531c39['action']==='list'){let _0x4a546a=a(_0x512a9a['incomingMessage']['method']==='GET'?{'unitId':_0x531c39['unitID'],'threadId':_0x3445d8['searchParams']['getAll']('threadId')}:await _0x512a9a['readJson'](),_0x531c39['unitID']),_0x4ecf98=await this['_service']['listComments']({'unitID':_0x531c39['unitID'],'threadIDs':_0x4a546a['threadId']},{'userID':_0x512a9a['userID'],'customData':_0x512a9a['customData']});h(_0x512a9a['response'],0xc8,{'error':r,..._0x4ecf98});return;}let _0x4fdd22=o(await _0x512a9a['readJson']());if(s(_0x4fdd22['unitId'],'unitId')!==_0x531c39['unitID'])throw d('Route\x20and\x20body\x20unitId\x20must\x20match');let _0x210d00=s(_0x4fdd22['memberId'],'memberId'),_0x3a5110=this['_resolveWriteSession'](_0x531c39['action'],_0x531c39['unitID'],_0x210d00,_0x512a9a['userID']),_0xda5565={'userID':_0x512a9a['userID'],'memberID':_0x3a5110['memberID'],'customData':_0x512a9a['customData']};switch(_0x531c39['action']){case'add':{let _0x2045ee=await this['_service']['addComment']({'unitID':_0x531c39['unitID'],'content':s(_0x4fdd22['content'],'content'),'mentions':l(_0x4fdd22['mention'],'mention')},_0xda5565);h(_0x512a9a['response'],0xc8,{'error':r,'comment':_0x2045ee});return;}case'reply':{let _0x5b8d07=await this['_service']['replyComment']({'unitID':_0x531c39['unitID'],'threadID':s(_0x4fdd22['threadId'],'threadId'),'content':s(_0x4fdd22['content'],'content'),'mentions':l(_0x4fdd22['mention'],'mention')},_0xda5565);h(_0x512a9a['response'],0xc8,{'error':r,'reply':_0x5b8d07});return;}case'solved':{let _0x556142=u(_0x4fdd22['solved']);await this['_service']['setThreadSolved']({'unitID':_0x531c39['unitID'],'threadID':s(_0x4fdd22['threadId'],'threadId'),'solved':_0x556142},_0xda5565),h(_0x512a9a['response'],0xc8,{'error':r});return;}case'edit':await this['_service']['editComment']({'unitID':_0x531c39['unitID'],'threadID':s(_0x4fdd22['threadId'],'threadId'),'replyID':s(_0x4fdd22['replyId'],'replyId'),'content':s(_0x4fdd22['content'],'content'),'mentions':l(_0x4fdd22['mention'],'mention')},_0xda5565),h(_0x512a9a['response'],0xc8,{'error':r});return;case'delete':await this['_service']['deleteComment']({'unitID':_0x531c39['unitID'],'threadID':s(_0x4fdd22['threadId'],'threadId'),...c(_0x4fdd22['replyId'],'replyId')},_0xda5565),h(_0x512a9a['response'],0xc8,{'error':r});return;}}catch(_0xe4bf08){p(_0x512a9a['response'],_0xe4bf08,_0x531c39['action']);}}['_resolveWriteSession'](_0x470a86,_0x45aefb,_0x59737a,_0x49ca8d){let _0x398e99=this['_roomHost']['findJoinedSession']({'unitID':_0x45aefb,'memberID':_0x59737a,'authenticatedUserID':_0x49ca8d});if(_0x398e99)return _0x398e99;if(_0x470a86==='solved'&&_0x59737a===_0x49ca8d){let _0x1da6c3=this['_roomHost']['findJoinedSessionByUser']({'unitID':_0x45aefb,'authenticatedUserID':_0x49ca8d});if(_0x1da6c3)return _0x1da6c3;}throw new e['CollabError']('PERMISSION_DENIED','Comment\x20member\x20is\x20not\x20an\x20authenticated\x20joined\x20Session');}async['_publish'](_0x2b8892){try{await this['_roomHost']['publishTrustedUnitEvent']({'unitID':_0x2b8892['update']['unitId'],'memberID':_0x2b8892['memberID'],'eventID':'comment_update','data':{'commentUpdateEvent':_0x2b8892['update']}});}catch{}}};function a(_0x578336,_0x56c072){let _0x11377b=o(_0x578336),_0x113334=s(_0x11377b['unitId'],'unitId');if(_0x113334!==_0x56c072)throw d('Route\x20and\x20body\x20unitId\x20must\x20match');return{'unitId':_0x113334,'threadId':l(_0x11377b['threadId'],'threadId')};}function o(_0x50b0fb){if(!_0x50b0fb||typeof _0x50b0fb!='object'||Array['isArray'](_0x50b0fb))throw d('Request\x20body\x20must\x20be\x20an\x20object');return _0x50b0fb;}function s(_0x17c0c8,_0x49c67b){if(typeof _0x17c0c8!='string'||_0x17c0c8['length']===0x0)throw d(_0x49c67b+'\x20must\x20be\x20a\x20non-empty\x20string');return _0x17c0c8;}function c(_0x345e64,_0x223864){return _0x345e64==null||_0x345e64===''?{}:{'replyID':s(_0x345e64,_0x223864)};}function l(_0x3eafd1,_0x352f5c){if(!Array['isArray'](_0x3eafd1)||_0x3eafd1['some'](_0x143b53=>typeof _0x143b53!='string'||_0x143b53['length']===0x0))throw d(_0x352f5c+'\x20must\x20be\x20an\x20array\x20of\x20non-empty\x20strings');return[..._0x3eafd1];}function u(_0x2c4e02){if(_0x2c4e02!==n['CommentSolvedStatus']['OpenOrReOpen']&&_0x2c4e02!==n['CommentSolvedStatus']['Solved'])throw d('solved\x20must\x20be\x20OpenOrReOpen\x20or\x20Solved');return _0x2c4e02;}function d(_0x2b2825){return new e['CollabError']('INVALID_REQUEST',_0x2b2825);}function f(_0x8e246b){if(!_0x8e246b['startsWith']('/')||_0x8e246b==='/'||_0x8e246b['endsWith']('/')||_0x8e246b['includes']('//'))throw TypeError('protocolBasePath\x20must\x20be\x20an\x20absolute\x20path\x20without\x20a\x20trailing\x20slash');return _0x8e246b;}function p(_0x3007b7,_0x59ad80,_0x5165f2){let _0x5e72c4=m(_0x59ad80),_0x47053a=_0x5165f2==='list'?{'comments':{},'users':{}}:_0x5165f2==='add'?{'comment':void 0x0}:_0x5165f2==='reply'?{'reply':void 0x0}:{};h(_0x3007b7,_0x5e72c4['status'],{'error':_0x5e72c4['error'],..._0x47053a});}function m(_0x48ae9e){if(_0x48ae9e instanceof t['NodeTransportError'])return _0x48ae9e['code']==='REQUEST_BODY_TOO_LARGE'?{'status':0x19d,'error':{'code':n['ErrorCode']['INVALID_ARGUMENT'],'message':_0x48ae9e['message']}}:_0x48ae9e['code']==='INVALID_JSON'||_0x48ae9e['code']==='REQUEST_ABORTED'?{'status':0x190,'error':{'code':n['ErrorCode']['INVALID_ARGUMENT'],'message':_0x48ae9e['message']}}:{'status':0x1f7,'error':{'code':n['ErrorCode']['INTERNAL_ERROR'],'message':_0x48ae9e['message']}};if(!(_0x48ae9e instanceof e['CollabError']))return{'status':0x1f4,'error':{'code':n['ErrorCode']['INTERNAL_ERROR'],'message':'Internal\x20error'}};let [_0x112de8,_0x81f7c2]=((()=>{switch(_0x48ae9e['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':_0x112de8,'error':{'code':_0x81f7c2,'message':_0x48ae9e['message']}};}function h(_0x32df56,_0x51d11e,_0x5d88bc){_0x32df56['writableEnded']||(_0x32df56['statusCode']=_0x51d11e,_0x32df56['setHeader']('content-type','application/json;\x20charset=utf-8'),_0x32df56['end'](JSON['stringify'](_0x5d88bc)));}exports['UniverCommentEndpoint']=i;
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(_0x2329e0){if(!_0x2329e0?.['service'])throw TypeError('UniverCommentEndpoint\x20requires\x20a\x20service');if(!_0x2329e0?.['roomHost'])throw TypeError('UniverCommentEndpoint\x20requires\x20a\x20roomHost');this['_service']=_0x2329e0['service'],this['_roomHost']=_0x2329e0['roomHost'],this['_protocolBasePath']=f(_0x2329e0['protocolBasePath']??'/universer-api'),this['_subscription']=this['_service']['on']('commentCommitted',_0x422eb1=>this['_track'](this['_publish'](_0x422eb1)));}['register'](_0x180868){if(this['_disposed'])throw new e['CollabError']('INTERNAL_ERROR','Comment\x20Endpoint\x20is\x20disposed');let _0x4e80f7=_0x26c43e=>_0x4ed5dd=>this['_track'](this['_handleHttp'](_0x4ed5dd,{'action':_0x26c43e,'unitID':_0x4ed5dd['params']['unitID']}));for(let _0x314bc1 of['add','list','reply','solved','edit','delete'])_0x180868['post'](this['_protocolBasePath']+'/comment/unit/:unitID/'+_0x314bc1,_0x4e80f7(_0x314bc1));_0x180868['get'](this['_protocolBasePath']+'/comment/unit/:unitID/list',_0x4e80f7('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'](_0x361c30){return this['_calls']['add'](_0x361c30),_0x361c30['finally'](()=>this['_calls']['delete'](_0x361c30))['catch'](()=>void 0x0),_0x361c30;}async['_handleHttp'](_0x42e13f,_0x20c86f){try{if(this['_disposed'])throw new e['CollabError']('INTERNAL_ERROR','Comment\x20Endpoint\x20is\x20disposed');let _0x4ad793=new URL(_0x42e13f['incomingMessage']['url']??'/','http://localhost');if(!_0x20c86f['unitID']||_0x20c86f['unitID']['includes']('/'))throw d('Invalid\x20route\x20unitId');if(!_0x42e13f['userID'])throw new e['CollabError']('UNAUTHENTICATED','HTTP\x20user\x20is\x20not\x20authenticated');if(_0x20c86f['action']==='list'){let _0x3e6748=a(_0x42e13f['incomingMessage']['method']==='GET'?{'unitId':_0x20c86f['unitID'],'threadId':_0x4ad793['searchParams']['getAll']('threadId')}:await _0x42e13f['readJson'](),_0x20c86f['unitID']),_0x1b9fae=await this['_service']['listComments']({'unitID':_0x20c86f['unitID'],'threadIDs':_0x3e6748['threadId']},{'userID':_0x42e13f['userID'],'customData':_0x42e13f['customData']});h(_0x42e13f['response'],0xc8,{'error':r,..._0x1b9fae});return;}let _0x252b78=o(await _0x42e13f['readJson']());if(s(_0x252b78['unitId'],'unitId')!==_0x20c86f['unitID'])throw d('Route\x20and\x20body\x20unitId\x20must\x20match');let _0x139b2c=s(_0x252b78['memberId'],'memberId'),_0x1b65a3={'userID':_0x42e13f['userID'],'memberID':_0x139b2c,'customData':_0x42e13f['customData']};switch(_0x20c86f['action']){case'add':{let _0x1029de=await this['_service']['addComment']({'unitID':_0x20c86f['unitID'],'content':s(_0x252b78['content'],'content'),'mentions':l(_0x252b78['mention'],'mention')},_0x1b65a3);h(_0x42e13f['response'],0xc8,{'error':r,'comment':_0x1029de});return;}case'reply':{let _0x2de435=await this['_service']['replyComment']({'unitID':_0x20c86f['unitID'],'threadID':s(_0x252b78['threadId'],'threadId'),'content':s(_0x252b78['content'],'content'),'mentions':l(_0x252b78['mention'],'mention')},_0x1b65a3);h(_0x42e13f['response'],0xc8,{'error':r,'reply':_0x2de435});return;}case'solved':{let _0x514a03=u(_0x252b78['solved']);await this['_service']['setThreadSolved']({'unitID':_0x20c86f['unitID'],'threadID':s(_0x252b78['threadId'],'threadId'),'solved':_0x514a03},_0x1b65a3),h(_0x42e13f['response'],0xc8,{'error':r});return;}case'edit':await this['_service']['editComment']({'unitID':_0x20c86f['unitID'],'threadID':s(_0x252b78['threadId'],'threadId'),'replyID':s(_0x252b78['replyId'],'replyId'),'content':s(_0x252b78['content'],'content'),'mentions':l(_0x252b78['mention'],'mention')},_0x1b65a3),h(_0x42e13f['response'],0xc8,{'error':r});return;case'delete':await this['_service']['deleteComment']({'unitID':_0x20c86f['unitID'],'threadID':s(_0x252b78['threadId'],'threadId'),...c(_0x252b78['replyId'],'replyId')},_0x1b65a3),h(_0x42e13f['response'],0xc8,{'error':r});return;}}catch(_0x4ca1fa){p(_0x42e13f['response'],_0x4ca1fa,_0x20c86f['action']);}}async['_publish'](_0x5c8b13){try{await this['_roomHost']['publishTrustedUnitEvent']({'unitID':_0x5c8b13['update']['unitId'],'memberID':_0x5c8b13['memberID'],'userID':_0x5c8b13['userID'],'eventID':'comment_update','data':{'commentUpdateEvent':_0x5c8b13['update']}});}catch{}}};function a(_0x5e3b2c,_0x5785b3){let _0x11499c=o(_0x5e3b2c),_0x1b735a=s(_0x11499c['unitId'],'unitId');if(_0x1b735a!==_0x5785b3)throw d('Route\x20and\x20body\x20unitId\x20must\x20match');return{'unitId':_0x1b735a,'threadId':l(_0x11499c['threadId'],'threadId')};}function o(_0x1f38ae){if(!_0x1f38ae||typeof _0x1f38ae!='object'||Array['isArray'](_0x1f38ae))throw d('Request\x20body\x20must\x20be\x20an\x20object');return _0x1f38ae;}function s(_0x534b15,_0x3b7055){if(typeof _0x534b15!='string'||_0x534b15['length']===0x0)throw d(_0x3b7055+'\x20must\x20be\x20a\x20non-empty\x20string');return _0x534b15;}function c(_0x46ba99,_0x5f0f58){return _0x46ba99==null||_0x46ba99===''?{}:{'replyID':s(_0x46ba99,_0x5f0f58)};}function l(_0xa6b4b4,_0x1ad404){if(!Array['isArray'](_0xa6b4b4)||_0xa6b4b4['some'](_0x361ed7=>typeof _0x361ed7!='string'||_0x361ed7['length']===0x0))throw d(_0x1ad404+'\x20must\x20be\x20an\x20array\x20of\x20non-empty\x20strings');return[..._0xa6b4b4];}function u(_0x3aaa7e){if(_0x3aaa7e!==n['CommentSolvedStatus']['OpenOrReOpen']&&_0x3aaa7e!==n['CommentSolvedStatus']['Solved'])throw d('solved\x20must\x20be\x20OpenOrReOpen\x20or\x20Solved');return _0x3aaa7e;}function d(_0x114012){return new e['CollabError']('INVALID_REQUEST',_0x114012);}function f(_0xf04a54){if(!_0xf04a54['startsWith']('/')||_0xf04a54==='/'||_0xf04a54['endsWith']('/')||_0xf04a54['includes']('//'))throw TypeError('protocolBasePath\x20must\x20be\x20an\x20absolute\x20path\x20without\x20a\x20trailing\x20slash');return _0xf04a54;}function p(_0x5c49b1,_0x3f143d,_0x34d3a4){let _0xb582b2=m(_0x3f143d),_0x2a8aad=_0x34d3a4==='list'?{'comments':{},'users':{}}:_0x34d3a4==='add'?{'comment':void 0x0}:_0x34d3a4==='reply'?{'reply':void 0x0}:{};h(_0x5c49b1,_0xb582b2['status'],{'error':_0xb582b2['error'],..._0x2a8aad});}function m(_0x2da93d){if(_0x2da93d instanceof t['NodeTransportError'])return _0x2da93d['code']==='REQUEST_BODY_TOO_LARGE'?{'status':0x19d,'error':{'code':n['ErrorCode']['INVALID_ARGUMENT'],'message':_0x2da93d['message']}}:_0x2da93d['code']==='INVALID_JSON'||_0x2da93d['code']==='REQUEST_ABORTED'?{'status':0x190,'error':{'code':n['ErrorCode']['INVALID_ARGUMENT'],'message':_0x2da93d['message']}}:{'status':0x1f7,'error':{'code':n['ErrorCode']['INTERNAL_ERROR'],'message':_0x2da93d['message']}};if(!(_0x2da93d instanceof e['CollabError']))return{'status':0x1f4,'error':{'code':n['ErrorCode']['INTERNAL_ERROR'],'message':'Internal\x20error'}};let [_0x271fce,_0x53b11e]=((()=>{switch(_0x2da93d['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':_0x271fce,'error':{'code':_0x53b11e,'message':_0x2da93d['message']}};}function h(_0x5c0bc8,_0x48a821,_0x208974){_0x5c0bc8['writableEnded']||(_0x5c0bc8['statusCode']=_0x48a821,_0x5c0bc8['setHeader']('content-type','application/json;\x20charset=utf-8'),_0x5c0bc8['end'](JSON['stringify'](_0x208974)));}exports['UniverCommentEndpoint']=i;
package/dist/index.d.ts CHANGED
@@ -21,7 +21,6 @@ declare class UniverCommentEndpoint implements NodeTransportEndpoint {
21
21
  dispose(): Promise<void>;
22
22
  private _track;
23
23
  private _handleHttp;
24
- private _resolveWriteSession;
25
24
  private _publish;
26
25
  }
27
26
  //#endregion
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- function _0x69b5(_0x15557d,_0x4d8cba){_0x15557d=_0x15557d-0x75;const _0x568ceb=_0x568c();let _0x69b560=_0x568ceb[_0x15557d];return _0x69b560;}(function(_0x111229,_0x278be8){const _0x509098=_0x69b5,_0x370966=_0x111229();while(!![]){try{const _0x353995=parseInt(_0x509098(0x7a))/0x1*(parseInt(_0x509098(0x7d))/0x2)+parseInt(_0x509098(0x7b))/0x3*(-parseInt(_0x509098(0x82))/0x4)+-parseInt(_0x509098(0x7e))/0x5*(parseInt(_0x509098(0x76))/0x6)+-parseInt(_0x509098(0x80))/0x7*(parseInt(_0x509098(0x81))/0x8)+-parseInt(_0x509098(0x79))/0x9*(parseInt(_0x509098(0x78))/0xa)+parseInt(_0x509098(0x7c))/0xb*(parseInt(_0x509098(0x77))/0xc)+parseInt(_0x509098(0x7f))/0xd*(parseInt(_0x509098(0x75))/0xe);if(_0x353995===_0x278be8)break;else _0x370966['push'](_0x370966['shift']());}catch(_0x343654){_0x370966['push'](_0x370966['shift']());}}}(_0x568c,0x8ee58));import _0x1486a6 from'./index.cjs';const facadeExport0=_0x1486a6['UniverCommentEndpoint'];function _0x568c(){const _0x3c18d1=['270304asIDXv','14527870nsvtrK','1302LCDqQy','84OqLCsS','378340dBbZTI','180AnourE','1hVmpzN','18sRLBSq','584353spZzTK','2115130ElvhqL','6980qBTPvL','13cGZUOX','2917313LEtJuX','8LlgdqD'];_0x568c=function(){return _0x3c18d1;};return _0x568c();}export{facadeExport0 as UniverCommentEndpoint};
1
+ (function(_0x240304,_0x1429ea){const _0x5c41a0=_0x2835,_0x25441f=_0x240304();while(!![]){try{const _0x5eb0c2=-parseInt(_0x5c41a0(0xcd))/0x1+parseInt(_0x5c41a0(0xcb))/0x2*(-parseInt(_0x5c41a0(0xcf))/0x3)+parseInt(_0x5c41a0(0xd2))/0x4+-parseInt(_0x5c41a0(0xd5))/0x5*(parseInt(_0x5c41a0(0xd1))/0x6)+-parseInt(_0x5c41a0(0xd3))/0x7*(parseInt(_0x5c41a0(0xcc))/0x8)+-parseInt(_0x5c41a0(0xd0))/0x9*(parseInt(_0x5c41a0(0xd4))/0xa)+parseInt(_0x5c41a0(0xce))/0xb;if(_0x5eb0c2===_0x1429ea)break;else _0x25441f['push'](_0x25441f['shift']());}catch(_0x4bb2e6){_0x25441f['push'](_0x25441f['shift']());}}}(_0x4771,0xf1acc));import _0x2bf92d from'./index.cjs';const facadeExport0=_0x2bf92d['UniverCommentEndpoint'];function _0x2835(_0x455ba6,_0xdc5543){_0x455ba6=_0x455ba6-0xcb;const _0x477120=_0x4771();let _0x283519=_0x477120[_0x455ba6];return _0x283519;}export{facadeExport0 as UniverCommentEndpoint};function _0x4771(){const _0xba5f4a=['716965pDRrkU','51509381uMmIwL','1248807pmsvmc','279954vFInha','78cONEyV','2135128XQPoBb','249291KjOlvz','30EKQfWJ','322575aIrqgK','4OYlIsf','392WnvPnR'];_0x4771=function(){return _0xba5f4a;};return _0x4771();}
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.0.3",
4
+ "version": "1.1.0",
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.0.3",
20
- "@univerjs-pro/collaboration-endpoint": "1.0.3",
21
- "@univerjs-pro/collaboration-service": "1.0.3",
22
- "@univerjs-pro/collaboration-transport-node": "1.0.3",
23
- "@univerjs/protocol": "1.0.3"
19
+ "@univerjs-pro/collaboration-comment-service": "1.1.0",
20
+ "@univerjs-pro/collaboration-endpoint": "1.1.0",
21
+ "@univerjs-pro/collaboration-service": "1.1.0",
22
+ "@univerjs-pro/collaboration-transport-node": "1.1.0",
23
+ "@univerjs/protocol": "1.1.0"
24
24
  }
25
25
  }