@univerjs-pro/collaboration-comment-database-memory 1.2.0 → 1.3.1

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'](_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;
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'](_0x3baf5a,_0x8d9156){return this['_call'](()=>this['_enqueue'](_0x3baf5a['unitID'],()=>{let _0x12d707=this['_unit'](_0x3baf5a['unitID']);if(_0x12d707['has'](_0x3baf5a['threadID']))return{'status':'duplicate'};let _0x276f50=Date['now'](),_0xad1061={..._0x3baf5a,'replyID':_0x3baf5a['threadID'],'mentions':[..._0x3baf5a['mentions']],'solved':t['CommentSolvedStatus']['OpenOrReOpen'],'createdAt':_0x276f50,'updatedAt':_0x276f50,'generation':(0x0,e['randomUUID'])()};return _0x12d707['set'](_0xad1061['replyID'],_0xad1061),{'status':'created','record':r(_0xad1061)};}));}['createReply'](_0x4508ca,_0x4c0b2e){return this['_call'](()=>this['_enqueue'](_0x4508ca['unitID'],()=>{let _0x4fec7f=this['_unit'](_0x4508ca['unitID']);if(_0x4fec7f['has'](_0x4508ca['replyID']))return{'status':'duplicate'};let _0x4b3cf4=_0x4fec7f['get'](_0x4508ca['threadID']);if(!_0x4b3cf4||_0x4b3cf4['replyID']!==_0x4b3cf4['threadID'])return{'status':'not-found'};if(_0x4b3cf4['solved']!==t['CommentSolvedStatus']['OpenOrReOpen'])return{'status':'closed'};let _0x2aa3ad=Date['now'](),_0x38d06b={..._0x4508ca,'mentions':[..._0x4508ca['mentions']],'solved':_0x4b3cf4['solved'],'createdAt':_0x2aa3ad,'updatedAt':_0x2aa3ad,'generation':(0x0,e['randomUUID'])()};return _0x4fec7f['set'](_0x38d06b['replyID'],_0x38d06b),{'status':'created','record':r(_0x38d06b)};}));}['getComment'](_0x53f1cc,_0x205606){return this['_call'](()=>this['_enqueue'](_0x53f1cc['unitID'],()=>{let _0x55f10b=this['_units']['get'](_0x53f1cc['unitID'])?.['get'](_0x53f1cc['replyID']);return _0x55f10b?.['threadID']===_0x53f1cc['threadID']?r(_0x55f10b):null;}));}['listThreads'](_0x4f02b7,_0x7ba688){return this['_call'](()=>this['_enqueue'](_0x4f02b7['unitID'],()=>{let _0x11d8bb=new Set(_0x4f02b7['threadIDs']);return[...this['_units']['get'](_0x4f02b7['unitID'])?.['values']()??[]]['filter'](_0x3cd93b=>_0x11d8bb['size']===0x0||_0x11d8bb['has'](_0x3cd93b['threadID']))['sort'](i)['map'](r);}));}['editComment'](_0x3f7ae5,_0x56d896){return this['_call'](()=>this['_enqueue'](_0x3f7ae5['unitID'],()=>{let _0x45271c=this['_units']['get'](_0x3f7ae5['unitID']),_0x4dc4f8=_0x45271c?.['get'](_0x3f7ae5['replyID']),_0x32c833=_0x45271c?.['get'](_0x3f7ae5['threadID']);if(!_0x4dc4f8||_0x4dc4f8['threadID']!==_0x3f7ae5['threadID']||!_0x32c833)return{'status':'not-found'};if(_0x32c833['solved']!==t['CommentSolvedStatus']['OpenOrReOpen'])return{'status':'closed'};if(_0x4dc4f8['authorUserID']!==_0x3f7ae5['expectedAuthorUserID'])return{'status':'author-mismatch'};if(_0x4dc4f8['content']===_0x3f7ae5['content']&&a(_0x4dc4f8['mentions'],_0x3f7ae5['mentions']))return{'status':'unchanged','record':r(_0x4dc4f8)};let _0x411d03={..._0x4dc4f8,'content':_0x3f7ae5['content'],'mentions':[..._0x3f7ae5['mentions']],'updatedAt':Math['max'](Date['now'](),_0x4dc4f8['updatedAt']+0x1)};return _0x45271c['set'](_0x3f7ae5['replyID'],_0x411d03),{'status':'edited','record':r(_0x411d03)};}));}['setThreadSolved'](_0x1f077d,_0x26ecf9){return this['_call'](()=>this['_enqueue'](_0x1f077d['unitID'],()=>{let _0x2e281a=this['_units']['get'](_0x1f077d['unitID']),_0x26d267=_0x2e281a?.['get'](_0x1f077d['threadID']);return!_0x26d267||_0x26d267['replyID']!==_0x26d267['threadID']?{'status':'not-found'}:_0x26d267['solved']===_0x1f077d['solved']?{'status':'unchanged'}:(_0x2e281a['set'](_0x1f077d['threadID'],{..._0x26d267,'solved':_0x1f077d['solved'],'updatedAt':Math['max'](Date['now'](),_0x26d267['updatedAt']+0x1)}),{'status':'updated'});}));}['deleteComment'](_0x492754,_0x591657){return this['_call'](()=>this['_enqueue'](_0x492754['unitID'],()=>{let _0x1dd132=this['_units']['get'](_0x492754['unitID']),_0x4e4fd0=_0x492754['replyID']??_0x492754['threadID'],_0x5308ae=_0x1dd132?.['get'](_0x4e4fd0);if(!_0x5308ae||_0x5308ae['threadID']!==_0x492754['threadID'])return{'status':'not-found'};if(_0x5308ae['generation']!==_0x492754['expectedGeneration'])return{'status':'generation-mismatch'};if(_0x492754['replyID']===void 0x0){for(let [_0x483797,_0xbc0aa1]of _0x1dd132)_0xbc0aa1['threadID']===_0x492754['threadID']&&_0x1dd132['delete'](_0x483797);}else _0x1dd132['delete'](_0x492754['replyID']);return _0x1dd132['size']===0x0&&this['_units']['delete'](_0x492754['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'](_0x1f033f){let _0x533dee=this['_units']['get'](_0x1f033f);if(_0x533dee)return _0x533dee;let _0x4154d=new Map();return this['_units']['set'](_0x1f033f,_0x4154d),_0x4154d;}['_enqueue'](_0x2f043a,_0x5b3dd7){let _0x3ec101=(this['_queues']['get'](_0x2f043a)??Promise['resolve']())['catch'](()=>void 0x0)['then'](_0x5b3dd7),_0x173025=_0x3ec101['then'](()=>void 0x0,()=>void 0x0);return this['_queues']['set'](_0x2f043a,_0x173025),_0x173025['finally'](()=>{this['_queues']['get'](_0x2f043a)===_0x173025&&this['_queues']['delete'](_0x2f043a);}),_0x3ec101;}['_call'](_0x5ba7ae){if(this['_state']!=='running')return Promise['reject'](Error('Memory\x20Comment\x20Database\x20Adapter\x20is\x20'+this['_state']));let _0x593b27=_0x5ba7ae();return this['_calls']['add'](_0x593b27),_0x593b27['finally'](()=>this['_calls']['delete'](_0x593b27))['catch'](()=>void 0x0),_0x593b27;}};function r(_0x1fd697){return{..._0x1fd697,'mentions':[..._0x1fd697['mentions']]};}function i(_0x212349,_0x472bb9){let _0x4d50ba=_0x212349['threadID']['localeCompare'](_0x472bb9['threadID']);return _0x4d50ba===0x0?_0x212349['replyID']===_0x212349['threadID']?-0x1:_0x472bb9['replyID']===_0x472bb9['threadID']?0x1:_0x212349['createdAt']-_0x472bb9['createdAt']||_0x212349['replyID']['localeCompare'](_0x472bb9['replyID']):_0x4d50ba;}function a(_0x1ea1e5,_0x410570){return _0x1ea1e5['length']===_0x410570['length']&&_0x1ea1e5['every']((_0x3dc860,_0x2baa32)=>_0x3dc860===_0x410570[_0x2baa32]);}exports['MemoryCommentDatabaseAdapter']=n;
package/dist/index.mjs CHANGED
@@ -1 +1 @@
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};
1
+ const _0x354093=_0x532b;(function(_0x43ca1d,_0x5f4a25){const _0x3934aa=_0x532b,_0x4f619e=_0x43ca1d();while(!![]){try{const _0x65da35=parseInt(_0x3934aa(0x7d))/0x1+parseInt(_0x3934aa(0x86))/0x2*(-parseInt(_0x3934aa(0x85))/0x3)+-parseInt(_0x3934aa(0x82))/0x4*(parseInt(_0x3934aa(0x7c))/0x5)+parseInt(_0x3934aa(0x83))/0x6+parseInt(_0x3934aa(0x84))/0x7+parseInt(_0x3934aa(0x7f))/0x8*(parseInt(_0x3934aa(0x87))/0x9)+parseInt(_0x3934aa(0x7e))/0xa*(-parseInt(_0x3934aa(0x81))/0xb);if(_0x65da35===_0x5f4a25)break;else _0x4f619e['push'](_0x4f619e['shift']());}catch(_0x2b423c){_0x4f619e['push'](_0x4f619e['shift']());}}}(_0x20c8,0x69205));import _0x458002 from'./index.cjs';function _0x532b(_0x236101,_0x1db9df){_0x236101=_0x236101-0x7c;const _0x20c858=_0x20c8();let _0x532b14=_0x20c858[_0x236101];return _0x532b14;}const facadeExport0=_0x458002[_0x354093(0x80)];export{facadeExport0 as MemoryCommentDatabaseAdapter};function _0x20c8(){const _0x29dbfd=['4194904MzJImf','30uvosBm','26904UbXPSo','20583HHtttY','5wQtyDJ','316636LUnObM','170jHTSwj','1968gVsMOl','MemoryCommentDatabaseAdapter','91619mlyjvC','3287260mnBKTy','300090gYYaoW'];_0x20c8=function(){return _0x29dbfd;};return _0x20c8();}
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.2.0",
4
+ "version": "1.3.1",
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.2.0",
20
- "@univerjs/protocol": "1.2.0"
19
+ "@univerjs-pro/collaboration-comment-service": "1.3.1",
20
+ "@univerjs/protocol": "1.3.1"
21
21
  }
22
22
  }