@univerjs-pro/collaboration-comment-endpoint 1.0.2 → 1.0.4

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(_0x3a1ab1){if(!_0x3a1ab1?.['service'])throw TypeError('UniverCommentEndpoint\x20requires\x20a\x20service');if(!_0x3a1ab1?.['roomHost'])throw TypeError('UniverCommentEndpoint\x20requires\x20a\x20roomHost');this['_service']=_0x3a1ab1['service'],this['_roomHost']=_0x3a1ab1['roomHost'],this['_protocolBasePath']=f(_0x3a1ab1['protocolBasePath']??'/universer-api'),this['_subscription']=this['_service']['on']('commentCommitted',_0x5c1707=>this['_track'](this['_publish'](_0x5c1707)));}['register'](_0x3013b2){if(this['_disposed'])throw new e['CollabError']('INTERNAL_ERROR','Comment\x20Endpoint\x20is\x20disposed');let _0x4166d6=_0x260c9d=>_0xd6892a=>this['_track'](this['_handleHttp'](_0xd6892a,{'action':_0x260c9d,'unitID':_0xd6892a['params']['unitID']}));for(let _0xacab68 of['add','list','reply','solved','edit','delete'])_0x3013b2['post'](this['_protocolBasePath']+'/comment/unit/:unitID/'+_0xacab68,_0x4166d6(_0xacab68));_0x3013b2['get'](this['_protocolBasePath']+'/comment/unit/:unitID/list',_0x4166d6('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'](_0x3d8907){return this['_calls']['add'](_0x3d8907),_0x3d8907['finally'](()=>this['_calls']['delete'](_0x3d8907))['catch'](()=>void 0x0),_0x3d8907;}async['_handleHttp'](_0x5ab339,_0x344a5a){try{if(this['_disposed'])throw new e['CollabError']('INTERNAL_ERROR','Comment\x20Endpoint\x20is\x20disposed');let _0x535211=new URL(_0x5ab339['incomingMessage']['url']??'/','http://localhost');if(!_0x344a5a['unitID']||_0x344a5a['unitID']['includes']('/'))throw d('Invalid\x20route\x20unitId');if(!_0x5ab339['userID'])throw new e['CollabError']('UNAUTHENTICATED','HTTP\x20user\x20is\x20not\x20authenticated');if(_0x344a5a['action']==='list'){let _0x4bae43=a(_0x5ab339['incomingMessage']['method']==='GET'?{'unitId':_0x344a5a['unitID'],'threadId':_0x535211['searchParams']['getAll']('threadId')}:await _0x5ab339['readJson'](),_0x344a5a['unitID']),_0x218825=await this['_service']['listComments']({'unitID':_0x344a5a['unitID'],'threadIDs':_0x4bae43['threadId']},{'userID':_0x5ab339['userID'],'customData':_0x5ab339['customData']});h(_0x5ab339['response'],0xc8,{'error':r,..._0x218825});return;}let _0x17f87b=o(await _0x5ab339['readJson']());if(s(_0x17f87b['unitId'],'unitId')!==_0x344a5a['unitID'])throw d('Route\x20and\x20body\x20unitId\x20must\x20match');let _0x541e22=s(_0x17f87b['memberId'],'memberId'),_0x50f7f0=this['_resolveWriteSession'](_0x344a5a['action'],_0x344a5a['unitID'],_0x541e22,_0x5ab339['userID']),_0x37b0ec={'userID':_0x5ab339['userID'],'memberID':_0x50f7f0['memberID'],'customData':_0x5ab339['customData']};switch(_0x344a5a['action']){case'add':{let _0x504af8=await this['_service']['addComment']({'unitID':_0x344a5a['unitID'],'content':s(_0x17f87b['content'],'content'),'mentions':l(_0x17f87b['mention'],'mention')},_0x37b0ec);h(_0x5ab339['response'],0xc8,{'error':r,'comment':_0x504af8});return;}case'reply':{let _0x4931da=await this['_service']['replyComment']({'unitID':_0x344a5a['unitID'],'threadID':s(_0x17f87b['threadId'],'threadId'),'content':s(_0x17f87b['content'],'content'),'mentions':l(_0x17f87b['mention'],'mention')},_0x37b0ec);h(_0x5ab339['response'],0xc8,{'error':r,'reply':_0x4931da});return;}case'solved':{let _0x52a4dd=u(_0x17f87b['solved']);await this['_service']['setThreadSolved']({'unitID':_0x344a5a['unitID'],'threadID':s(_0x17f87b['threadId'],'threadId'),'solved':_0x52a4dd},_0x37b0ec),h(_0x5ab339['response'],0xc8,{'error':r});return;}case'edit':await this['_service']['editComment']({'unitID':_0x344a5a['unitID'],'threadID':s(_0x17f87b['threadId'],'threadId'),'replyID':s(_0x17f87b['replyId'],'replyId'),'content':s(_0x17f87b['content'],'content'),'mentions':l(_0x17f87b['mention'],'mention')},_0x37b0ec),h(_0x5ab339['response'],0xc8,{'error':r});return;case'delete':await this['_service']['deleteComment']({'unitID':_0x344a5a['unitID'],'threadID':s(_0x17f87b['threadId'],'threadId'),...c(_0x17f87b['replyId'],'replyId')},_0x37b0ec),h(_0x5ab339['response'],0xc8,{'error':r});return;}}catch(_0x243394){p(_0x5ab339['response'],_0x243394,_0x344a5a['action']);}}['_resolveWriteSession'](_0x353fb1,_0x170295,_0x38e7dc,_0x272cf0){let _0xe898a8=this['_roomHost']['findJoinedSession']({'unitID':_0x170295,'memberID':_0x38e7dc,'authenticatedUserID':_0x272cf0});if(_0xe898a8)return _0xe898a8;if(_0x353fb1==='solved'&&_0x38e7dc===_0x272cf0){let _0x555d96=this['_roomHost']['findJoinedSessionByUser']({'unitID':_0x170295,'authenticatedUserID':_0x272cf0});if(_0x555d96)return _0x555d96;}throw new e['CollabError']('PERMISSION_DENIED','Comment\x20member\x20is\x20not\x20an\x20authenticated\x20joined\x20Session');}async['_publish'](_0x408b82){try{await this['_roomHost']['publishTrustedUnitEvent']({'unitID':_0x408b82['update']['unitId'],'memberID':_0x408b82['memberID'],'eventID':'comment_update','data':{'commentUpdateEvent':_0x408b82['update']}});}catch{}}};function a(_0x2fce98,_0x37490d){let _0x57aaf1=o(_0x2fce98),_0x597ac3=s(_0x57aaf1['unitId'],'unitId');if(_0x597ac3!==_0x37490d)throw d('Route\x20and\x20body\x20unitId\x20must\x20match');return{'unitId':_0x597ac3,'threadId':l(_0x57aaf1['threadId'],'threadId')};}function o(_0x37039b){if(!_0x37039b||typeof _0x37039b!='object'||Array['isArray'](_0x37039b))throw d('Request\x20body\x20must\x20be\x20an\x20object');return _0x37039b;}function s(_0x2853da,_0x10b92b){if(typeof _0x2853da!='string'||_0x2853da['length']===0x0)throw d(_0x10b92b+'\x20must\x20be\x20a\x20non-empty\x20string');return _0x2853da;}function c(_0x3d163e,_0x25d94b){return _0x3d163e==null||_0x3d163e===''?{}:{'replyID':s(_0x3d163e,_0x25d94b)};}function l(_0x3cc171,_0x362c13){if(!Array['isArray'](_0x3cc171)||_0x3cc171['some'](_0x4d10c5=>typeof _0x4d10c5!='string'||_0x4d10c5['length']===0x0))throw d(_0x362c13+'\x20must\x20be\x20an\x20array\x20of\x20non-empty\x20strings');return[..._0x3cc171];}function u(_0x4d956d){if(_0x4d956d!==n['CommentSolvedStatus']['OpenOrReOpen']&&_0x4d956d!==n['CommentSolvedStatus']['Solved'])throw d('solved\x20must\x20be\x20OpenOrReOpen\x20or\x20Solved');return _0x4d956d;}function d(_0x3f5576){return new e['CollabError']('INVALID_REQUEST',_0x3f5576);}function f(_0x2ff1e2){if(!_0x2ff1e2['startsWith']('/')||_0x2ff1e2==='/'||_0x2ff1e2['endsWith']('/')||_0x2ff1e2['includes']('//'))throw TypeError('protocolBasePath\x20must\x20be\x20an\x20absolute\x20path\x20without\x20a\x20trailing\x20slash');return _0x2ff1e2;}function p(_0x22b05b,_0x330f40,_0x475e95){let _0x17d673=m(_0x330f40),_0x17c691=_0x475e95==='list'?{'comments':{},'users':{}}:_0x475e95==='add'?{'comment':void 0x0}:_0x475e95==='reply'?{'reply':void 0x0}:{};h(_0x22b05b,_0x17d673['status'],{'error':_0x17d673['error'],..._0x17c691});}function m(_0x37bf5e){if(_0x37bf5e instanceof t['NodeTransportError'])return _0x37bf5e['code']==='REQUEST_BODY_TOO_LARGE'?{'status':0x19d,'error':{'code':n['ErrorCode']['INVALID_ARGUMENT'],'message':_0x37bf5e['message']}}:_0x37bf5e['code']==='INVALID_JSON'||_0x37bf5e['code']==='REQUEST_ABORTED'?{'status':0x190,'error':{'code':n['ErrorCode']['INVALID_ARGUMENT'],'message':_0x37bf5e['message']}}:{'status':0x1f7,'error':{'code':n['ErrorCode']['INTERNAL_ERROR'],'message':_0x37bf5e['message']}};if(!(_0x37bf5e instanceof e['CollabError']))return{'status':0x1f4,'error':{'code':n['ErrorCode']['INTERNAL_ERROR'],'message':'Internal\x20error'}};let [_0x47e4f2,_0x3f0141]=((()=>{switch(_0x37bf5e['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':_0x47e4f2,'error':{'code':_0x3f0141,'message':_0x37bf5e['message']}};}function h(_0x37ace3,_0x500d1a,_0x403283){_0x37ace3['writableEnded']||(_0x37ace3['statusCode']=_0x500d1a,_0x37ace3['setHeader']('content-type','application/json;\x20charset=utf-8'),_0x37ace3['end'](JSON['stringify'](_0x403283)));}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(_0x46adc4){if(!_0x46adc4?.['service'])throw TypeError('UniverCommentEndpoint\x20requires\x20a\x20service');if(!_0x46adc4?.['roomHost'])throw TypeError('UniverCommentEndpoint\x20requires\x20a\x20roomHost');this['_service']=_0x46adc4['service'],this['_roomHost']=_0x46adc4['roomHost'],this['_protocolBasePath']=f(_0x46adc4['protocolBasePath']??'/universer-api'),this['_subscription']=this['_service']['on']('commentCommitted',_0x1dd286=>this['_track'](this['_publish'](_0x1dd286)));}['register'](_0x282fd5){if(this['_disposed'])throw new e['CollabError']('INTERNAL_ERROR','Comment\x20Endpoint\x20is\x20disposed');let _0x5f0c12=_0x13d094=>_0x3c704d=>this['_track'](this['_handleHttp'](_0x3c704d,{'action':_0x13d094,'unitID':_0x3c704d['params']['unitID']}));for(let _0x445246 of['add','list','reply','solved','edit','delete'])_0x282fd5['post'](this['_protocolBasePath']+'/comment/unit/:unitID/'+_0x445246,_0x5f0c12(_0x445246));_0x282fd5['get'](this['_protocolBasePath']+'/comment/unit/:unitID/list',_0x5f0c12('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'](_0x27a16f){return this['_calls']['add'](_0x27a16f),_0x27a16f['finally'](()=>this['_calls']['delete'](_0x27a16f))['catch'](()=>void 0x0),_0x27a16f;}async['_handleHttp'](_0x34da0b,_0x349cbb){try{if(this['_disposed'])throw new e['CollabError']('INTERNAL_ERROR','Comment\x20Endpoint\x20is\x20disposed');let _0x2598c8=new URL(_0x34da0b['incomingMessage']['url']??'/','http://localhost');if(!_0x349cbb['unitID']||_0x349cbb['unitID']['includes']('/'))throw d('Invalid\x20route\x20unitId');if(!_0x34da0b['userID'])throw new e['CollabError']('UNAUTHENTICATED','HTTP\x20user\x20is\x20not\x20authenticated');if(_0x349cbb['action']==='list'){let _0x16fc46=a(_0x34da0b['incomingMessage']['method']==='GET'?{'unitId':_0x349cbb['unitID'],'threadId':_0x2598c8['searchParams']['getAll']('threadId')}:await _0x34da0b['readJson'](),_0x349cbb['unitID']),_0x46fcf3=await this['_service']['listComments']({'unitID':_0x349cbb['unitID'],'threadIDs':_0x16fc46['threadId']},{'userID':_0x34da0b['userID'],'customData':_0x34da0b['customData']});h(_0x34da0b['response'],0xc8,{'error':r,..._0x46fcf3});return;}let _0x4b4c26=o(await _0x34da0b['readJson']());if(s(_0x4b4c26['unitId'],'unitId')!==_0x349cbb['unitID'])throw d('Route\x20and\x20body\x20unitId\x20must\x20match');let _0x434045=s(_0x4b4c26['memberId'],'memberId'),_0x59b2e8={'userID':_0x34da0b['userID'],'memberID':_0x434045,'customData':_0x34da0b['customData']};switch(_0x349cbb['action']){case'add':{let _0x46b059=await this['_service']['addComment']({'unitID':_0x349cbb['unitID'],'content':s(_0x4b4c26['content'],'content'),'mentions':l(_0x4b4c26['mention'],'mention')},_0x59b2e8);h(_0x34da0b['response'],0xc8,{'error':r,'comment':_0x46b059});return;}case'reply':{let _0x585ea0=await this['_service']['replyComment']({'unitID':_0x349cbb['unitID'],'threadID':s(_0x4b4c26['threadId'],'threadId'),'content':s(_0x4b4c26['content'],'content'),'mentions':l(_0x4b4c26['mention'],'mention')},_0x59b2e8);h(_0x34da0b['response'],0xc8,{'error':r,'reply':_0x585ea0});return;}case'solved':{let _0x655faa=u(_0x4b4c26['solved']);await this['_service']['setThreadSolved']({'unitID':_0x349cbb['unitID'],'threadID':s(_0x4b4c26['threadId'],'threadId'),'solved':_0x655faa},_0x59b2e8),h(_0x34da0b['response'],0xc8,{'error':r});return;}case'edit':await this['_service']['editComment']({'unitID':_0x349cbb['unitID'],'threadID':s(_0x4b4c26['threadId'],'threadId'),'replyID':s(_0x4b4c26['replyId'],'replyId'),'content':s(_0x4b4c26['content'],'content'),'mentions':l(_0x4b4c26['mention'],'mention')},_0x59b2e8),h(_0x34da0b['response'],0xc8,{'error':r});return;case'delete':await this['_service']['deleteComment']({'unitID':_0x349cbb['unitID'],'threadID':s(_0x4b4c26['threadId'],'threadId'),...c(_0x4b4c26['replyId'],'replyId')},_0x59b2e8),h(_0x34da0b['response'],0xc8,{'error':r});return;}}catch(_0x52acf6){p(_0x34da0b['response'],_0x52acf6,_0x349cbb['action']);}}async['_publish'](_0x3645dd){try{await this['_roomHost']['publishTrustedUnitEvent']({'unitID':_0x3645dd['update']['unitId'],'memberID':_0x3645dd['memberID'],'userID':_0x3645dd['userID'],'eventID':'comment_update','data':{'commentUpdateEvent':_0x3645dd['update']}});}catch{}}};function a(_0x378935,_0x28a4e3){let _0x481824=o(_0x378935),_0xc08dfa=s(_0x481824['unitId'],'unitId');if(_0xc08dfa!==_0x28a4e3)throw d('Route\x20and\x20body\x20unitId\x20must\x20match');return{'unitId':_0xc08dfa,'threadId':l(_0x481824['threadId'],'threadId')};}function o(_0x5922c1){if(!_0x5922c1||typeof _0x5922c1!='object'||Array['isArray'](_0x5922c1))throw d('Request\x20body\x20must\x20be\x20an\x20object');return _0x5922c1;}function s(_0x46f504,_0x24d92f){if(typeof _0x46f504!='string'||_0x46f504['length']===0x0)throw d(_0x24d92f+'\x20must\x20be\x20a\x20non-empty\x20string');return _0x46f504;}function c(_0x5e1d3a,_0x12c427){return _0x5e1d3a==null||_0x5e1d3a===''?{}:{'replyID':s(_0x5e1d3a,_0x12c427)};}function l(_0x55d554,_0x5e98b8){if(!Array['isArray'](_0x55d554)||_0x55d554['some'](_0x230d9e=>typeof _0x230d9e!='string'||_0x230d9e['length']===0x0))throw d(_0x5e98b8+'\x20must\x20be\x20an\x20array\x20of\x20non-empty\x20strings');return[..._0x55d554];}function u(_0x38c0a9){if(_0x38c0a9!==n['CommentSolvedStatus']['OpenOrReOpen']&&_0x38c0a9!==n['CommentSolvedStatus']['Solved'])throw d('solved\x20must\x20be\x20OpenOrReOpen\x20or\x20Solved');return _0x38c0a9;}function d(_0x27c285){return new e['CollabError']('INVALID_REQUEST',_0x27c285);}function f(_0x230ed5){if(!_0x230ed5['startsWith']('/')||_0x230ed5==='/'||_0x230ed5['endsWith']('/')||_0x230ed5['includes']('//'))throw TypeError('protocolBasePath\x20must\x20be\x20an\x20absolute\x20path\x20without\x20a\x20trailing\x20slash');return _0x230ed5;}function p(_0x50892e,_0x1afc10,_0x56de66){let _0x497c5a=m(_0x1afc10),_0x5952b4=_0x56de66==='list'?{'comments':{},'users':{}}:_0x56de66==='add'?{'comment':void 0x0}:_0x56de66==='reply'?{'reply':void 0x0}:{};h(_0x50892e,_0x497c5a['status'],{'error':_0x497c5a['error'],..._0x5952b4});}function m(_0x2c4db7){if(_0x2c4db7 instanceof t['NodeTransportError'])return _0x2c4db7['code']==='REQUEST_BODY_TOO_LARGE'?{'status':0x19d,'error':{'code':n['ErrorCode']['INVALID_ARGUMENT'],'message':_0x2c4db7['message']}}:_0x2c4db7['code']==='INVALID_JSON'||_0x2c4db7['code']==='REQUEST_ABORTED'?{'status':0x190,'error':{'code':n['ErrorCode']['INVALID_ARGUMENT'],'message':_0x2c4db7['message']}}:{'status':0x1f7,'error':{'code':n['ErrorCode']['INTERNAL_ERROR'],'message':_0x2c4db7['message']}};if(!(_0x2c4db7 instanceof e['CollabError']))return{'status':0x1f4,'error':{'code':n['ErrorCode']['INTERNAL_ERROR'],'message':'Internal\x20error'}};let [_0x3f49f7,_0x395318]=((()=>{switch(_0x2c4db7['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':_0x3f49f7,'error':{'code':_0x395318,'message':_0x2c4db7['message']}};}function h(_0x25c6a1,_0x35d06f,_0x2e7bb5){_0x25c6a1['writableEnded']||(_0x25c6a1['statusCode']=_0x35d06f,_0x25c6a1['setHeader']('content-type','application/json;\x20charset=utf-8'),_0x25c6a1['end'](JSON['stringify'](_0x2e7bb5)));}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(_0x56a75d,_0x3b9aaf){const _0x322f9b=_0xf319,_0x97ecb9=_0x56a75d();while(!![]){try{const _0x28493c=parseInt(_0x322f9b(0xdb))/0x1+parseInt(_0x322f9b(0xd5))/0x2*(-parseInt(_0x322f9b(0xd7))/0x3)+-parseInt(_0x322f9b(0xd9))/0x4*(-parseInt(_0x322f9b(0xd4))/0x5)+-parseInt(_0x322f9b(0xd8))/0x6+parseInt(_0x322f9b(0xda))/0x7+parseInt(_0x322f9b(0xdc))/0x8+parseInt(_0x322f9b(0xd6))/0x9*(-parseInt(_0x322f9b(0xd3))/0xa);if(_0x28493c===_0x3b9aaf)break;else _0x97ecb9['push'](_0x97ecb9['shift']());}catch(_0x4a67f7){_0x97ecb9['push'](_0x97ecb9['shift']());}}}(_0x49f6,0xe343b));import _0xdf98a6 from'./index.cjs';function _0x49f6(){const _0x109aa0=['855423gcAQvr','2312676yxUXob','119388tDFByD','7944167cJIekO','790377eoMBtS','5698424EQgbfa','1660DStWWb','305szsMNM','6sujHTC','123966VXCDNo'];_0x49f6=function(){return _0x109aa0;};return _0x49f6();}function _0xf319(_0x3c9a1b,_0x17fc50){_0x3c9a1b=_0x3c9a1b-0xd3;const _0x49f6f9=_0x49f6();let _0xf319cd=_0x49f6f9[_0x3c9a1b];return _0xf319cd;}const facadeExport0=_0xdf98a6['UniverCommentEndpoint'];export{facadeExport0 as UniverCommentEndpoint};
1
+ function _0x1c37(){const _0x4642d9=['UniverCommentEndpoint','2426352LfgiyR','511573jDyHBU','4737366GEoGiU','1480410eItnkr','5327dlSsfY','9776990pIULdm','18EGVitb','14384wrmoTs','6801kmFqlt','454JUzhqp'];_0x1c37=function(){return _0x4642d9;};return _0x1c37();}const _0x3ce521=_0x449f;(function(_0x28ada5,_0x4d61a2){const _0x142b03=_0x449f,_0x5ecdc5=_0x28ada5();while(!![]){try{const _0x351f2b=parseInt(_0x142b03(0x150))/0x1+-parseInt(_0x142b03(0x158))/0x2*(parseInt(_0x142b03(0x157))/0x3)+parseInt(_0x142b03(0x15a))/0x4+parseInt(_0x142b03(0x152))/0x5+-parseInt(_0x142b03(0x151))/0x6+-parseInt(_0x142b03(0x153))/0x7*(parseInt(_0x142b03(0x156))/0x8)+parseInt(_0x142b03(0x155))/0x9*(parseInt(_0x142b03(0x154))/0xa);if(_0x351f2b===_0x4d61a2)break;else _0x5ecdc5['push'](_0x5ecdc5['shift']());}catch(_0x300f30){_0x5ecdc5['push'](_0x5ecdc5['shift']());}}}(_0x1c37,0xaa369));import _0x47e735 from'./index.cjs';const facadeExport0=_0x47e735[_0x3ce521(0x159)];function _0x449f(_0x2ceda2,_0x54b82a){_0x2ceda2=_0x2ceda2-0x150;const _0x1c3795=_0x1c37();let _0x449f70=_0x1c3795[_0x2ceda2];return _0x449f70;}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.0.2",
4
+ "version": "1.0.4",
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.2",
20
- "@univerjs-pro/collaboration-endpoint": "1.0.2",
21
- "@univerjs-pro/collaboration-service": "1.0.2",
22
- "@univerjs-pro/collaboration-transport-node": "1.0.2",
23
- "@univerjs/protocol": "1.0.2"
19
+ "@univerjs-pro/collaboration-comment-service": "1.0.4",
20
+ "@univerjs-pro/collaboration-endpoint": "1.0.4",
21
+ "@univerjs-pro/collaboration-service": "1.0.4",
22
+ "@univerjs-pro/collaboration-transport-node": "1.0.4",
23
+ "@univerjs/protocol": "1.0.4"
24
24
  }
25
25
  }