@univerjs-pro/collaboration-comment-database-memory 1.0.4 → 1.2.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/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'](_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;
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'](_0x4aedae,_0xc20685){return this['_call'](()=>this['_enqueue'](_0x4aedae['unitID'],()=>{let _0x1ca384=this['_unit'](_0x4aedae['unitID']);if(_0x1ca384['has'](_0x4aedae['threadID']))return{'status':'duplicate'};let _0x365d07=Date['now'](),_0x44da22={..._0x4aedae,'replyID':_0x4aedae['threadID'],'mentions':[..._0x4aedae['mentions']],'solved':t['CommentSolvedStatus']['OpenOrReOpen'],'createdAt':_0x365d07,'updatedAt':_0x365d07,'generation':(0x0,e['randomUUID'])()};return _0x1ca384['set'](_0x44da22['replyID'],_0x44da22),{'status':'created','record':r(_0x44da22)};}));}['createReply'](_0x26929e,_0xd588a8){return this['_call'](()=>this['_enqueue'](_0x26929e['unitID'],()=>{let _0x36e2f9=this['_unit'](_0x26929e['unitID']);if(_0x36e2f9['has'](_0x26929e['replyID']))return{'status':'duplicate'};let _0x14d414=_0x36e2f9['get'](_0x26929e['threadID']);if(!_0x14d414||_0x14d414['replyID']!==_0x14d414['threadID'])return{'status':'not-found'};if(_0x14d414['solved']!==t['CommentSolvedStatus']['OpenOrReOpen'])return{'status':'closed'};let _0x133d2b=Date['now'](),_0x2fb69d={..._0x26929e,'mentions':[..._0x26929e['mentions']],'solved':_0x14d414['solved'],'createdAt':_0x133d2b,'updatedAt':_0x133d2b,'generation':(0x0,e['randomUUID'])()};return _0x36e2f9['set'](_0x2fb69d['replyID'],_0x2fb69d),{'status':'created','record':r(_0x2fb69d)};}));}['getComment'](_0x1799b2,_0x207186){return this['_call'](()=>this['_enqueue'](_0x1799b2['unitID'],()=>{let _0x32c833=this['_units']['get'](_0x1799b2['unitID'])?.['get'](_0x1799b2['replyID']);return _0x32c833?.['threadID']===_0x1799b2['threadID']?r(_0x32c833):null;}));}['listThreads'](_0x29b82f,_0x33ee75){return this['_call'](()=>this['_enqueue'](_0x29b82f['unitID'],()=>{let _0x562df9=new Set(_0x29b82f['threadIDs']);return[...this['_units']['get'](_0x29b82f['unitID'])?.['values']()??[]]['filter'](_0x84c4e6=>_0x562df9['size']===0x0||_0x562df9['has'](_0x84c4e6['threadID']))['sort'](i)['map'](r);}));}['editComment'](_0x4d8854,_0x4ba54b){return this['_call'](()=>this['_enqueue'](_0x4d8854['unitID'],()=>{let _0x218943=this['_units']['get'](_0x4d8854['unitID']),_0x509eaf=_0x218943?.['get'](_0x4d8854['replyID']),_0x4b7251=_0x218943?.['get'](_0x4d8854['threadID']);if(!_0x509eaf||_0x509eaf['threadID']!==_0x4d8854['threadID']||!_0x4b7251)return{'status':'not-found'};if(_0x4b7251['solved']!==t['CommentSolvedStatus']['OpenOrReOpen'])return{'status':'closed'};if(_0x509eaf['authorUserID']!==_0x4d8854['expectedAuthorUserID'])return{'status':'author-mismatch'};if(_0x509eaf['content']===_0x4d8854['content']&&a(_0x509eaf['mentions'],_0x4d8854['mentions']))return{'status':'unchanged','record':r(_0x509eaf)};let _0x19f6cb={..._0x509eaf,'content':_0x4d8854['content'],'mentions':[..._0x4d8854['mentions']],'updatedAt':Math['max'](Date['now'](),_0x509eaf['updatedAt']+0x1)};return _0x218943['set'](_0x4d8854['replyID'],_0x19f6cb),{'status':'edited','record':r(_0x19f6cb)};}));}['setThreadSolved'](_0x345d81,_0x350d4b){return this['_call'](()=>this['_enqueue'](_0x345d81['unitID'],()=>{let _0xd56c48=this['_units']['get'](_0x345d81['unitID']),_0x580c76=_0xd56c48?.['get'](_0x345d81['threadID']);return!_0x580c76||_0x580c76['replyID']!==_0x580c76['threadID']?{'status':'not-found'}:_0x580c76['solved']===_0x345d81['solved']?{'status':'unchanged'}:(_0xd56c48['set'](_0x345d81['threadID'],{..._0x580c76,'solved':_0x345d81['solved'],'updatedAt':Math['max'](Date['now'](),_0x580c76['updatedAt']+0x1)}),{'status':'updated'});}));}['deleteComment'](_0x2e258e,_0x49b8b4){return this['_call'](()=>this['_enqueue'](_0x2e258e['unitID'],()=>{let _0x73f192=this['_units']['get'](_0x2e258e['unitID']),_0x3c2448=_0x2e258e['replyID']??_0x2e258e['threadID'],_0x1085fd=_0x73f192?.['get'](_0x3c2448);if(!_0x1085fd||_0x1085fd['threadID']!==_0x2e258e['threadID'])return{'status':'not-found'};if(_0x1085fd['generation']!==_0x2e258e['expectedGeneration'])return{'status':'generation-mismatch'};if(_0x2e258e['replyID']===void 0x0){for(let [_0x2ca505,_0x5b32c2]of _0x73f192)_0x5b32c2['threadID']===_0x2e258e['threadID']&&_0x73f192['delete'](_0x2ca505);}else _0x73f192['delete'](_0x2e258e['replyID']);return _0x73f192['size']===0x0&&this['_units']['delete'](_0x2e258e['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'](_0x132338){let _0x49d2bb=this['_units']['get'](_0x132338);if(_0x49d2bb)return _0x49d2bb;let _0x403837=new Map();return this['_units']['set'](_0x132338,_0x403837),_0x403837;}['_enqueue'](_0x2d6ca1,_0x15c55f){let _0x5edcd9=(this['_queues']['get'](_0x2d6ca1)??Promise['resolve']())['catch'](()=>void 0x0)['then'](_0x15c55f),_0x33578e=_0x5edcd9['then'](()=>void 0x0,()=>void 0x0);return this['_queues']['set'](_0x2d6ca1,_0x33578e),_0x33578e['finally'](()=>{this['_queues']['get'](_0x2d6ca1)===_0x33578e&&this['_queues']['delete'](_0x2d6ca1);}),_0x5edcd9;}['_call'](_0x4ef41c){if(this['_state']!=='running')return Promise['reject'](Error('Memory\x20Comment\x20Database\x20Adapter\x20is\x20'+this['_state']));let _0x4ab8e4=_0x4ef41c();return this['_calls']['add'](_0x4ab8e4),_0x4ab8e4['finally'](()=>this['_calls']['delete'](_0x4ab8e4))['catch'](()=>void 0x0),_0x4ab8e4;}};function r(_0x53eac3){return{..._0x53eac3,'mentions':[..._0x53eac3['mentions']]};}function i(_0xe249d0,_0x3a1a47){let _0xf7276b=_0xe249d0['threadID']['localeCompare'](_0x3a1a47['threadID']);return _0xf7276b===0x0?_0xe249d0['replyID']===_0xe249d0['threadID']?-0x1:_0x3a1a47['replyID']===_0x3a1a47['threadID']?0x1:_0xe249d0['createdAt']-_0x3a1a47['createdAt']||_0xe249d0['replyID']['localeCompare'](_0x3a1a47['replyID']):_0xf7276b;}function a(_0x15cdc6,_0x4fbd49){return _0x15cdc6['length']===_0x4fbd49['length']&&_0x15cdc6['every']((_0xfe954c,_0x527513)=>_0xfe954c===_0x4fbd49[_0x527513]);}exports['MemoryCommentDatabaseAdapter']=n;
package/dist/index.mjs CHANGED
@@ -1 +1 @@
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};
1
+ const _0x4c87bb=_0x56a4;(function(_0x178552,_0x35dc71){const _0x5cd1b7=_0x56a4,_0x5c3cdf=_0x178552();while(!![]){try{const _0x2dd6e7=-parseInt(_0x5cd1b7(0x180))/0x1*(parseInt(_0x5cd1b7(0x182))/0x2)+-parseInt(_0x5cd1b7(0x181))/0x3*(-parseInt(_0x5cd1b7(0x17e))/0x4)+parseInt(_0x5cd1b7(0x17f))/0x5+parseInt(_0x5cd1b7(0x17a))/0x6*(parseInt(_0x5cd1b7(0x185))/0x7)+parseInt(_0x5cd1b7(0x17b))/0x8*(-parseInt(_0x5cd1b7(0x186))/0x9)+parseInt(_0x5cd1b7(0x17c))/0xa*(parseInt(_0x5cd1b7(0x17d))/0xb)+parseInt(_0x5cd1b7(0x184))/0xc;if(_0x2dd6e7===_0x35dc71)break;else _0x5c3cdf['push'](_0x5c3cdf['shift']());}catch(_0x34e61a){_0x5c3cdf['push'](_0x5c3cdf['shift']());}}}(_0x2453,0x8a0c0));function _0x2453(){const _0x2f27c9=['91827ZMJJDL','206394QzTmAx','192BMNPCG','664880VbofqF','44jzlInv','32VYQDCD','2210485taLebJ','624883urFWcP','60567hhZTLn','2wsbECG','MemoryCommentDatabaseAdapter','3072516RnGjSc','63cyIjne'];_0x2453=function(){return _0x2f27c9;};return _0x2453();}function _0x56a4(_0x20c589,_0x2bc377){_0x20c589=_0x20c589-0x17a;const _0x245311=_0x2453();let _0x56a4a4=_0x245311[_0x20c589];return _0x56a4a4;}import _0x1eedde from'./index.cjs';const facadeExport0=_0x1eedde[_0x4c87bb(0x183)];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.4",
4
+ "version": "1.2.0",
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.4",
20
- "@univerjs/protocol": "1.0.4"
19
+ "@univerjs-pro/collaboration-comment-service": "1.2.0",
20
+ "@univerjs/protocol": "1.2.0"
21
21
  }
22
22
  }