@univerjs-pro/collaboration-comment-database-memory 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/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- Object['defineProperty'](exports,Symbol['toStringTag'],{'value':'Module'});let e=require('node:crypto'),t=require('@univerjs/protocol');var n=class{['_units']=new Map();['_queues']=new Map();['_calls']=new Set();['_state']='running';['_disposePromise'];['createRoot'](_0x91c1b0,_0x2fc4af){return this['_call'](()=>this['_enqueue'](_0x91c1b0['unitID'],()=>{let _0xdda762=this['_unit'](_0x91c1b0['unitID']);if(_0xdda762['has'](_0x91c1b0['threadID']))return{'status':'duplicate'};let _0x274c6e=Date['now'](),_0x2b3b32={..._0x91c1b0,'replyID':_0x91c1b0['threadID'],'mentions':[..._0x91c1b0['mentions']],'solved':t['CommentSolvedStatus']['OpenOrReOpen'],'createdAt':_0x274c6e,'updatedAt':_0x274c6e,'generation':(0x0,e['randomUUID'])()};return _0xdda762['set'](_0x2b3b32['replyID'],_0x2b3b32),{'status':'created','record':r(_0x2b3b32)};}));}['createReply'](_0x10b774,_0x40e3f8){return this['_call'](()=>this['_enqueue'](_0x10b774['unitID'],()=>{let _0x45da5f=this['_unit'](_0x10b774['unitID']);if(_0x45da5f['has'](_0x10b774['replyID']))return{'status':'duplicate'};let _0x3bea58=_0x45da5f['get'](_0x10b774['threadID']);if(!_0x3bea58||_0x3bea58['replyID']!==_0x3bea58['threadID'])return{'status':'not-found'};if(_0x3bea58['solved']!==t['CommentSolvedStatus']['OpenOrReOpen'])return{'status':'closed'};let _0x3aad45=Date['now'](),_0x41311e={..._0x10b774,'mentions':[..._0x10b774['mentions']],'solved':_0x3bea58['solved'],'createdAt':_0x3aad45,'updatedAt':_0x3aad45,'generation':(0x0,e['randomUUID'])()};return _0x45da5f['set'](_0x41311e['replyID'],_0x41311e),{'status':'created','record':r(_0x41311e)};}));}['getComment'](_0x2f63fb,_0x33d92d){return this['_call'](()=>this['_enqueue'](_0x2f63fb['unitID'],()=>{let _0x14b2c7=this['_units']['get'](_0x2f63fb['unitID'])?.['get'](_0x2f63fb['replyID']);return _0x14b2c7?.['threadID']===_0x2f63fb['threadID']?r(_0x14b2c7):null;}));}['listThreads'](_0x208e60,_0xb4a733){return this['_call'](()=>this['_enqueue'](_0x208e60['unitID'],()=>{let _0x43b36a=new Set(_0x208e60['threadIDs']);return[...this['_units']['get'](_0x208e60['unitID'])?.['values']()??[]]['filter'](_0xd6a7ee=>_0x43b36a['size']===0x0||_0x43b36a['has'](_0xd6a7ee['threadID']))['sort'](i)['map'](r);}));}['editComment'](_0x7617b,_0x4b9a5f){return this['_call'](()=>this['_enqueue'](_0x7617b['unitID'],()=>{let _0x516734=this['_units']['get'](_0x7617b['unitID']),_0x54ffef=_0x516734?.['get'](_0x7617b['replyID']),_0x47c666=_0x516734?.['get'](_0x7617b['threadID']);if(!_0x54ffef||_0x54ffef['threadID']!==_0x7617b['threadID']||!_0x47c666)return{'status':'not-found'};if(_0x47c666['solved']!==t['CommentSolvedStatus']['OpenOrReOpen'])return{'status':'closed'};if(_0x54ffef['authorUserID']!==_0x7617b['expectedAuthorUserID'])return{'status':'author-mismatch'};if(_0x54ffef['content']===_0x7617b['content']&&a(_0x54ffef['mentions'],_0x7617b['mentions']))return{'status':'unchanged','record':r(_0x54ffef)};let _0x126739={..._0x54ffef,'content':_0x7617b['content'],'mentions':[..._0x7617b['mentions']],'updatedAt':Math['max'](Date['now'](),_0x54ffef['updatedAt']+0x1)};return _0x516734['set'](_0x7617b['replyID'],_0x126739),{'status':'edited','record':r(_0x126739)};}));}['setThreadSolved'](_0x132cf4,_0x272f7f){return this['_call'](()=>this['_enqueue'](_0x132cf4['unitID'],()=>{let _0x454810=this['_units']['get'](_0x132cf4['unitID']),_0x31f5ed=_0x454810?.['get'](_0x132cf4['threadID']);return!_0x31f5ed||_0x31f5ed['replyID']!==_0x31f5ed['threadID']?{'status':'not-found'}:_0x31f5ed['solved']===_0x132cf4['solved']?{'status':'unchanged'}:(_0x454810['set'](_0x132cf4['threadID'],{..._0x31f5ed,'solved':_0x132cf4['solved'],'updatedAt':Math['max'](Date['now'](),_0x31f5ed['updatedAt']+0x1)}),{'status':'updated'});}));}['deleteComment'](_0x166e04,_0x251d1a){return this['_call'](()=>this['_enqueue'](_0x166e04['unitID'],()=>{let _0x2b636a=this['_units']['get'](_0x166e04['unitID']),_0x16cde9=_0x166e04['replyID']??_0x166e04['threadID'],_0x1e8851=_0x2b636a?.['get'](_0x16cde9);if(!_0x1e8851||_0x1e8851['threadID']!==_0x166e04['threadID'])return{'status':'not-found'};if(_0x1e8851['generation']!==_0x166e04['expectedGeneration'])return{'status':'generation-mismatch'};if(_0x166e04['replyID']===void 0x0){for(let [_0x26ebe8,_0x551878]of _0x2b636a)_0x551878['threadID']===_0x166e04['threadID']&&_0x2b636a['delete'](_0x26ebe8);}else _0x2b636a['delete'](_0x166e04['replyID']);return _0x2b636a['size']===0x0&&this['_units']['delete'](_0x166e04['unitID']),{'status':'deleted'};}));}['dispose'](){return this['_disposePromise']?this['_disposePromise']:(this['_state']='disposing',this['_disposePromise']=((async()=>{await Promise['allSettled']([...this['_calls']]),this['_queues']['clear'](),this['_state']='disposed';})()),this['_disposePromise']);}['_unit'](_0x497413){let _0x2af0cd=this['_units']['get'](_0x497413);if(_0x2af0cd)return _0x2af0cd;let _0x21055f=new Map();return this['_units']['set'](_0x497413,_0x21055f),_0x21055f;}['_enqueue'](_0x520c82,_0x53eb0c){let _0x37ab1b=(this['_queues']['get'](_0x520c82)??Promise['resolve']())['catch'](()=>void 0x0)['then'](_0x53eb0c),_0x254d6c=_0x37ab1b['then'](()=>void 0x0,()=>void 0x0);return this['_queues']['set'](_0x520c82,_0x254d6c),_0x254d6c['finally'](()=>{this['_queues']['get'](_0x520c82)===_0x254d6c&&this['_queues']['delete'](_0x520c82);}),_0x37ab1b;}['_call'](_0x3a890f){if(this['_state']!=='running')return Promise['reject'](Error('Memory\x20Comment\x20Database\x20Adapter\x20is\x20'+this['_state']));let _0x1bd0dd=_0x3a890f();return this['_calls']['add'](_0x1bd0dd),_0x1bd0dd['finally'](()=>this['_calls']['delete'](_0x1bd0dd))['catch'](()=>void 0x0),_0x1bd0dd;}};function r(_0x199813){return{..._0x199813,'mentions':[..._0x199813['mentions']]};}function i(_0x554732,_0x3897af){let _0x425394=_0x554732['threadID']['localeCompare'](_0x3897af['threadID']);return _0x425394===0x0?_0x554732['replyID']===_0x554732['threadID']?-0x1:_0x3897af['replyID']===_0x3897af['threadID']?0x1:_0x554732['createdAt']-_0x3897af['createdAt']||_0x554732['replyID']['localeCompare'](_0x3897af['replyID']):_0x425394;}function a(_0x3c9081,_0x2a11b9){return _0x3c9081['length']===_0x2a11b9['length']&&_0x3c9081['every']((_0x4d5ae5,_0xb4171d)=>_0x4d5ae5===_0x2a11b9[_0xb4171d]);}exports['MemoryCommentDatabaseAdapter']=n;
1
+ Object['defineProperty'](exports,Symbol['toStringTag'],{'value':'Module'});let e=require('node:crypto'),t=require('@univerjs/protocol');var n=class{['_units']=new Map();['_queues']=new Map();['_calls']=new Set();['_state']='running';['_disposePromise'];['createRoot'](_0x21ff44,_0x4eed0f){return this['_call'](()=>this['_enqueue'](_0x21ff44['unitID'],()=>{let _0xd4aebd=this['_unit'](_0x21ff44['unitID']);if(_0xd4aebd['has'](_0x21ff44['threadID']))return{'status':'duplicate'};let _0x5d3c34=Date['now'](),_0xd3b0f3={..._0x21ff44,'replyID':_0x21ff44['threadID'],'mentions':[..._0x21ff44['mentions']],'solved':t['CommentSolvedStatus']['OpenOrReOpen'],'createdAt':_0x5d3c34,'updatedAt':_0x5d3c34,'generation':(0x0,e['randomUUID'])()};return _0xd4aebd['set'](_0xd3b0f3['replyID'],_0xd3b0f3),{'status':'created','record':r(_0xd3b0f3)};}));}['createReply'](_0x3be404,_0x5a0ed1){return this['_call'](()=>this['_enqueue'](_0x3be404['unitID'],()=>{let _0x59963a=this['_unit'](_0x3be404['unitID']);if(_0x59963a['has'](_0x3be404['replyID']))return{'status':'duplicate'};let _0x5dab37=_0x59963a['get'](_0x3be404['threadID']);if(!_0x5dab37||_0x5dab37['replyID']!==_0x5dab37['threadID'])return{'status':'not-found'};if(_0x5dab37['solved']!==t['CommentSolvedStatus']['OpenOrReOpen'])return{'status':'closed'};let _0x3ee396=Date['now'](),_0x1e1abf={..._0x3be404,'mentions':[..._0x3be404['mentions']],'solved':_0x5dab37['solved'],'createdAt':_0x3ee396,'updatedAt':_0x3ee396,'generation':(0x0,e['randomUUID'])()};return _0x59963a['set'](_0x1e1abf['replyID'],_0x1e1abf),{'status':'created','record':r(_0x1e1abf)};}));}['getComment'](_0x6e6313,_0xb3711){return this['_call'](()=>this['_enqueue'](_0x6e6313['unitID'],()=>{let _0x513232=this['_units']['get'](_0x6e6313['unitID'])?.['get'](_0x6e6313['replyID']);return _0x513232?.['threadID']===_0x6e6313['threadID']?r(_0x513232):null;}));}['listThreads'](_0xf99197,_0x4942dd){return this['_call'](()=>this['_enqueue'](_0xf99197['unitID'],()=>{let _0x681378=new Set(_0xf99197['threadIDs']);return[...this['_units']['get'](_0xf99197['unitID'])?.['values']()??[]]['filter'](_0x1ab790=>_0x681378['size']===0x0||_0x681378['has'](_0x1ab790['threadID']))['sort'](i)['map'](r);}));}['editComment'](_0x452c06,_0xb23535){return this['_call'](()=>this['_enqueue'](_0x452c06['unitID'],()=>{let _0x7ef2e6=this['_units']['get'](_0x452c06['unitID']),_0x3b5b19=_0x7ef2e6?.['get'](_0x452c06['replyID']),_0x380690=_0x7ef2e6?.['get'](_0x452c06['threadID']);if(!_0x3b5b19||_0x3b5b19['threadID']!==_0x452c06['threadID']||!_0x380690)return{'status':'not-found'};if(_0x380690['solved']!==t['CommentSolvedStatus']['OpenOrReOpen'])return{'status':'closed'};if(_0x3b5b19['authorUserID']!==_0x452c06['expectedAuthorUserID'])return{'status':'author-mismatch'};if(_0x3b5b19['content']===_0x452c06['content']&&a(_0x3b5b19['mentions'],_0x452c06['mentions']))return{'status':'unchanged','record':r(_0x3b5b19)};let _0x545176={..._0x3b5b19,'content':_0x452c06['content'],'mentions':[..._0x452c06['mentions']],'updatedAt':Math['max'](Date['now'](),_0x3b5b19['updatedAt']+0x1)};return _0x7ef2e6['set'](_0x452c06['replyID'],_0x545176),{'status':'edited','record':r(_0x545176)};}));}['setThreadSolved'](_0x8c1dc8,_0x490c66){return this['_call'](()=>this['_enqueue'](_0x8c1dc8['unitID'],()=>{let _0xc0cd7d=this['_units']['get'](_0x8c1dc8['unitID']),_0x56e069=_0xc0cd7d?.['get'](_0x8c1dc8['threadID']);return!_0x56e069||_0x56e069['replyID']!==_0x56e069['threadID']?{'status':'not-found'}:_0x56e069['solved']===_0x8c1dc8['solved']?{'status':'unchanged'}:(_0xc0cd7d['set'](_0x8c1dc8['threadID'],{..._0x56e069,'solved':_0x8c1dc8['solved'],'updatedAt':Math['max'](Date['now'](),_0x56e069['updatedAt']+0x1)}),{'status':'updated'});}));}['deleteComment'](_0xc264c1,_0x2b6954){return this['_call'](()=>this['_enqueue'](_0xc264c1['unitID'],()=>{let _0x40e5ef=this['_units']['get'](_0xc264c1['unitID']),_0x384419=_0xc264c1['replyID']??_0xc264c1['threadID'],_0x40314b=_0x40e5ef?.['get'](_0x384419);if(!_0x40314b||_0x40314b['threadID']!==_0xc264c1['threadID'])return{'status':'not-found'};if(_0x40314b['generation']!==_0xc264c1['expectedGeneration'])return{'status':'generation-mismatch'};if(_0xc264c1['replyID']===void 0x0){for(let [_0x486740,_0x2677d4]of _0x40e5ef)_0x2677d4['threadID']===_0xc264c1['threadID']&&_0x40e5ef['delete'](_0x486740);}else _0x40e5ef['delete'](_0xc264c1['replyID']);return _0x40e5ef['size']===0x0&&this['_units']['delete'](_0xc264c1['unitID']),{'status':'deleted'};}));}['dispose'](){return this['_disposePromise']?this['_disposePromise']:(this['_state']='disposing',this['_disposePromise']=((async()=>{await Promise['allSettled']([...this['_calls']]),this['_queues']['clear'](),this['_state']='disposed';})()),this['_disposePromise']);}['_unit'](_0x41d122){let _0x335e1e=this['_units']['get'](_0x41d122);if(_0x335e1e)return _0x335e1e;let _0x51fa70=new Map();return this['_units']['set'](_0x41d122,_0x51fa70),_0x51fa70;}['_enqueue'](_0x425b58,_0x86db75){let _0x288e34=(this['_queues']['get'](_0x425b58)??Promise['resolve']())['catch'](()=>void 0x0)['then'](_0x86db75),_0x22d0c3=_0x288e34['then'](()=>void 0x0,()=>void 0x0);return this['_queues']['set'](_0x425b58,_0x22d0c3),_0x22d0c3['finally'](()=>{this['_queues']['get'](_0x425b58)===_0x22d0c3&&this['_queues']['delete'](_0x425b58);}),_0x288e34;}['_call'](_0x860f65){if(this['_state']!=='running')return Promise['reject'](Error('Memory\x20Comment\x20Database\x20Adapter\x20is\x20'+this['_state']));let _0x31fa10=_0x860f65();return this['_calls']['add'](_0x31fa10),_0x31fa10['finally'](()=>this['_calls']['delete'](_0x31fa10))['catch'](()=>void 0x0),_0x31fa10;}};function r(_0x2e343c){return{..._0x2e343c,'mentions':[..._0x2e343c['mentions']]};}function i(_0x541bb5,_0x209b09){let _0x30c746=_0x541bb5['threadID']['localeCompare'](_0x209b09['threadID']);return _0x30c746===0x0?_0x541bb5['replyID']===_0x541bb5['threadID']?-0x1:_0x209b09['replyID']===_0x209b09['threadID']?0x1:_0x541bb5['createdAt']-_0x209b09['createdAt']||_0x541bb5['replyID']['localeCompare'](_0x209b09['replyID']):_0x30c746;}function a(_0x44cad2,_0x2c9aca){return _0x44cad2['length']===_0x2c9aca['length']&&_0x44cad2['every']((_0xa05340,_0x4f0e62)=>_0xa05340===_0x2c9aca[_0x4f0e62]);}exports['MemoryCommentDatabaseAdapter']=n;
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- const _0xffbf3f=_0x2592;(function(_0x483da2,_0x3e939e){const _0x38fd3a=_0x2592,_0x180113=_0x483da2();while(!![]){try{const _0x4eef84=parseInt(_0x38fd3a(0x17b))/0x1*(-parseInt(_0x38fd3a(0x175))/0x2)+parseInt(_0x38fd3a(0x178))/0x3+parseInt(_0x38fd3a(0x173))/0x4*(parseInt(_0x38fd3a(0x174))/0x5)+-parseInt(_0x38fd3a(0x176))/0x6*(-parseInt(_0x38fd3a(0x17a))/0x7)+-parseInt(_0x38fd3a(0x171))/0x8*(parseInt(_0x38fd3a(0x170))/0x9)+parseInt(_0x38fd3a(0x177))/0xa*(parseInt(_0x38fd3a(0x179))/0xb)+parseInt(_0x38fd3a(0x17d))/0xc*(parseInt(_0x38fd3a(0x172))/0xd);if(_0x4eef84===_0x3e939e)break;else _0x180113['push'](_0x180113['shift']());}catch(_0x4966aa){_0x180113['push'](_0x180113['shift']());}}}(_0x52a8,0xbabbc));function _0x52a8(){const _0x2dd77e=['5VFxnsl','316658KrdVJA','569514CfsaoB','10JhcQpe','936600AtJdpn','14927473NRHQAA','14wSJSCe','3sbukjD','MemoryCommentDatabaseAdapter','5892euAlpu','38871VsqnwF','1672vblHUH','5759veLIit','263696oYMLmU'];_0x52a8=function(){return _0x2dd77e;};return _0x52a8();}function _0x2592(_0x150807,_0x5cc5c2){_0x150807=_0x150807-0x170;const _0x52a8d5=_0x52a8();let _0x259260=_0x52a8d5[_0x150807];return _0x259260;}import _0x2a2a37 from'./index.cjs';const facadeExport0=_0x2a2a37[_0xffbf3f(0x17c)];export{facadeExport0 as MemoryCommentDatabaseAdapter};
1
+ const _0x58dd9e=_0xe80b;(function(_0xac2c6a,_0xa2db55){const _0x5cd077=_0xe80b,_0x264d3a=_0xac2c6a();while(!![]){try{const _0x3d5d22=-parseInt(_0x5cd077(0xf8))/0x1*(parseInt(_0x5cd077(0xfc))/0x2)+parseInt(_0x5cd077(0xfe))/0x3*(-parseInt(_0x5cd077(0xfa))/0x4)+parseInt(_0x5cd077(0xff))/0x5*(-parseInt(_0x5cd077(0xfd))/0x6)+-parseInt(_0x5cd077(0x100))/0x7+-parseInt(_0x5cd077(0xf9))/0x8+-parseInt(_0x5cd077(0xfb))/0x9+parseInt(_0x5cd077(0xf6))/0xa;if(_0x3d5d22===_0xa2db55)break;else _0x264d3a['push'](_0x264d3a['shift']());}catch(_0x37d421){_0x264d3a['push'](_0x264d3a['shift']());}}}(_0x43ad,0xbe320));function _0x43ad(){const _0x2dfd7b=['4uPksHR','12748995kMiDbI','224036VNjLSk','6UkCtmN','1833441YFBlDF','4200535nzRgqc','9254042mqFOun','61550770nGlbqQ','MemoryCommentDatabaseAdapter','1iyUfhx','8593632GMRanO'];_0x43ad=function(){return _0x2dfd7b;};return _0x43ad();}import _0x12c324 from'./index.cjs';const facadeExport0=_0x12c324[_0x58dd9e(0xf7)];function _0xe80b(_0x496338,_0x23edee){_0x496338=_0x496338-0xf6;const _0x43ad62=_0x43ad();let _0xe80bcb=_0x43ad62[_0x496338];return _0xe80bcb;}export{facadeExport0 as MemoryCommentDatabaseAdapter};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@univerjs-pro/collaboration-comment-database-memory",
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,7 +16,7 @@
16
16
  "dist"
17
17
  ],
18
18
  "dependencies": {
19
- "@univerjs-pro/collaboration-comment-service": "1.0.2",
20
- "@univerjs/protocol": "1.0.2"
19
+ "@univerjs-pro/collaboration-comment-service": "1.0.4",
20
+ "@univerjs/protocol": "1.0.4"
21
21
  }
22
22
  }