@univerjs-pro/collaboration-comment-database-memory 1.0.0-rc.0 → 1.0.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'](_0x5be4b8,_0x4e930a){return this['_call'](()=>this['_enqueue'](_0x5be4b8['unitID'],()=>{let _0x455210=this['_unit'](_0x5be4b8['unitID']);if(_0x455210['has'](_0x5be4b8['threadID']))return{'status':'duplicate'};let _0x40be39=Date['now'](),_0x1f3e2f={..._0x5be4b8,'replyID':_0x5be4b8['threadID'],'mentions':[..._0x5be4b8['mentions']],'solved':t['CommentSolvedStatus']['OpenOrReOpen'],'createdAt':_0x40be39,'updatedAt':_0x40be39,'generation':(0x0,e['randomUUID'])()};return _0x455210['set'](_0x1f3e2f['replyID'],_0x1f3e2f),{'status':'created','record':r(_0x1f3e2f)};}));}['createReply'](_0x121c7f,_0x58344e){return this['_call'](()=>this['_enqueue'](_0x121c7f['unitID'],()=>{let _0x5e17ff=this['_unit'](_0x121c7f['unitID']);if(_0x5e17ff['has'](_0x121c7f['replyID']))return{'status':'duplicate'};let _0x46990e=_0x5e17ff['get'](_0x121c7f['threadID']);if(!_0x46990e||_0x46990e['replyID']!==_0x46990e['threadID'])return{'status':'not-found'};if(_0x46990e['solved']!==t['CommentSolvedStatus']['OpenOrReOpen'])return{'status':'closed'};let _0x5b826c=Date['now'](),_0x16f521={..._0x121c7f,'mentions':[..._0x121c7f['mentions']],'solved':_0x46990e['solved'],'createdAt':_0x5b826c,'updatedAt':_0x5b826c,'generation':(0x0,e['randomUUID'])()};return _0x5e17ff['set'](_0x16f521['replyID'],_0x16f521),{'status':'created','record':r(_0x16f521)};}));}['getComment'](_0x2c4e34,_0x43f220){return this['_call'](()=>this['_enqueue'](_0x2c4e34['unitID'],()=>{let _0xf41f73=this['_units']['get'](_0x2c4e34['unitID'])?.['get'](_0x2c4e34['replyID']);return _0xf41f73?.['threadID']===_0x2c4e34['threadID']?r(_0xf41f73):null;}));}['listThreads'](_0x2ff58d,_0x25660a){return this['_call'](()=>this['_enqueue'](_0x2ff58d['unitID'],()=>{let _0x4901d4=new Set(_0x2ff58d['threadIDs']);return[...this['_units']['get'](_0x2ff58d['unitID'])?.['values']()??[]]['filter'](_0x50501d=>_0x4901d4['size']===0x0||_0x4901d4['has'](_0x50501d['threadID']))['sort'](i)['map'](r);}));}['editComment'](_0x2189df,_0x45c591){return this['_call'](()=>this['_enqueue'](_0x2189df['unitID'],()=>{let _0x3b6bf3=this['_units']['get'](_0x2189df['unitID']),_0x5cec17=_0x3b6bf3?.['get'](_0x2189df['replyID']),_0x240295=_0x3b6bf3?.['get'](_0x2189df['threadID']);if(!_0x5cec17||_0x5cec17['threadID']!==_0x2189df['threadID']||!_0x240295)return{'status':'not-found'};if(_0x240295['solved']!==t['CommentSolvedStatus']['OpenOrReOpen'])return{'status':'closed'};if(_0x5cec17['authorUserID']!==_0x2189df['expectedAuthorUserID'])return{'status':'author-mismatch'};if(_0x5cec17['content']===_0x2189df['content']&&a(_0x5cec17['mentions'],_0x2189df['mentions']))return{'status':'unchanged','record':r(_0x5cec17)};let _0x204e94={..._0x5cec17,'content':_0x2189df['content'],'mentions':[..._0x2189df['mentions']],'updatedAt':Math['max'](Date['now'](),_0x5cec17['updatedAt']+0x1)};return _0x3b6bf3['set'](_0x2189df['replyID'],_0x204e94),{'status':'edited','record':r(_0x204e94)};}));}['setThreadSolved'](_0x39844b,_0x215603){return this['_call'](()=>this['_enqueue'](_0x39844b['unitID'],()=>{let _0x1046a6=this['_units']['get'](_0x39844b['unitID']),_0x444df1=_0x1046a6?.['get'](_0x39844b['threadID']);return!_0x444df1||_0x444df1['replyID']!==_0x444df1['threadID']?{'status':'not-found'}:_0x444df1['solved']===_0x39844b['solved']?{'status':'unchanged'}:(_0x1046a6['set'](_0x39844b['threadID'],{..._0x444df1,'solved':_0x39844b['solved'],'updatedAt':Math['max'](Date['now'](),_0x444df1['updatedAt']+0x1)}),{'status':'updated'});}));}['deleteComment'](_0x276570,_0x41bad9){return this['_call'](()=>this['_enqueue'](_0x276570['unitID'],()=>{let _0x3d0617=this['_units']['get'](_0x276570['unitID']),_0x1225ce=_0x276570['replyID']??_0x276570['threadID'],_0x565221=_0x3d0617?.['get'](_0x1225ce);if(!_0x565221||_0x565221['threadID']!==_0x276570['threadID'])return{'status':'not-found'};if(_0x565221['generation']!==_0x276570['expectedGeneration'])return{'status':'generation-mismatch'};if(_0x276570['replyID']===void 0x0){for(let [_0x3c4892,_0x4c1c1f]of _0x3d0617)_0x4c1c1f['threadID']===_0x276570['threadID']&&_0x3d0617['delete'](_0x3c4892);}else _0x3d0617['delete'](_0x276570['replyID']);return _0x3d0617['size']===0x0&&this['_units']['delete'](_0x276570['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'](_0x2d7088){let _0x3d1ae6=this['_units']['get'](_0x2d7088);if(_0x3d1ae6)return _0x3d1ae6;let _0x15a541=new Map();return this['_units']['set'](_0x2d7088,_0x15a541),_0x15a541;}['_enqueue'](_0x5607ab,_0x5a284b){let _0x7b0e44=(this['_queues']['get'](_0x5607ab)??Promise['resolve']())['catch'](()=>void 0x0)['then'](_0x5a284b),_0x186f61=_0x7b0e44['then'](()=>void 0x0,()=>void 0x0);return this['_queues']['set'](_0x5607ab,_0x186f61),_0x186f61['finally'](()=>{this['_queues']['get'](_0x5607ab)===_0x186f61&&this['_queues']['delete'](_0x5607ab);}),_0x7b0e44;}['_call'](_0x428204){if(this['_state']!=='running')return Promise['reject'](Error('Memory\x20Comment\x20Database\x20Adapter\x20is\x20'+this['_state']));let _0x30eeab=_0x428204();return this['_calls']['add'](_0x30eeab),_0x30eeab['finally'](()=>this['_calls']['delete'](_0x30eeab))['catch'](()=>void 0x0),_0x30eeab;}};function r(_0xb5fdd){return{..._0xb5fdd,'mentions':[..._0xb5fdd['mentions']]};}function i(_0x590fbc,_0x44c578){let _0x110e60=_0x590fbc['threadID']['localeCompare'](_0x44c578['threadID']);return _0x110e60===0x0?_0x590fbc['replyID']===_0x590fbc['threadID']?-0x1:_0x44c578['replyID']===_0x44c578['threadID']?0x1:_0x590fbc['createdAt']-_0x44c578['createdAt']||_0x590fbc['replyID']['localeCompare'](_0x44c578['replyID']):_0x110e60;}function a(_0x539616,_0x12a8c4){return _0x539616['length']===_0x12a8c4['length']&&_0x539616['every']((_0x31fc30,_0x4f7068)=>_0x31fc30===_0x12a8c4[_0x4f7068]);}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'](_0x5e07de,_0x4cb9f2){return this['_call'](()=>this['_enqueue'](_0x5e07de['unitID'],()=>{let _0x475855=this['_unit'](_0x5e07de['unitID']);if(_0x475855['has'](_0x5e07de['threadID']))return{'status':'duplicate'};let _0x4f87a5=Date['now'](),_0x1aa7ad={..._0x5e07de,'replyID':_0x5e07de['threadID'],'mentions':[..._0x5e07de['mentions']],'solved':t['CommentSolvedStatus']['OpenOrReOpen'],'createdAt':_0x4f87a5,'updatedAt':_0x4f87a5,'generation':(0x0,e['randomUUID'])()};return _0x475855['set'](_0x1aa7ad['replyID'],_0x1aa7ad),{'status':'created','record':r(_0x1aa7ad)};}));}['createReply'](_0x450323,_0x5b2ad9){return this['_call'](()=>this['_enqueue'](_0x450323['unitID'],()=>{let _0x52e34a=this['_unit'](_0x450323['unitID']);if(_0x52e34a['has'](_0x450323['replyID']))return{'status':'duplicate'};let _0x2c3de7=_0x52e34a['get'](_0x450323['threadID']);if(!_0x2c3de7||_0x2c3de7['replyID']!==_0x2c3de7['threadID'])return{'status':'not-found'};if(_0x2c3de7['solved']!==t['CommentSolvedStatus']['OpenOrReOpen'])return{'status':'closed'};let _0x2454a6=Date['now'](),_0x45cbde={..._0x450323,'mentions':[..._0x450323['mentions']],'solved':_0x2c3de7['solved'],'createdAt':_0x2454a6,'updatedAt':_0x2454a6,'generation':(0x0,e['randomUUID'])()};return _0x52e34a['set'](_0x45cbde['replyID'],_0x45cbde),{'status':'created','record':r(_0x45cbde)};}));}['getComment'](_0x168544,_0x403062){return this['_call'](()=>this['_enqueue'](_0x168544['unitID'],()=>{let _0xfb031d=this['_units']['get'](_0x168544['unitID'])?.['get'](_0x168544['replyID']);return _0xfb031d?.['threadID']===_0x168544['threadID']?r(_0xfb031d):null;}));}['listThreads'](_0x592cd3,_0x502235){return this['_call'](()=>this['_enqueue'](_0x592cd3['unitID'],()=>{let _0x43e30a=new Set(_0x592cd3['threadIDs']);return[...this['_units']['get'](_0x592cd3['unitID'])?.['values']()??[]]['filter'](_0x48a50e=>_0x43e30a['size']===0x0||_0x43e30a['has'](_0x48a50e['threadID']))['sort'](i)['map'](r);}));}['editComment'](_0x4844aa,_0x3603e8){return this['_call'](()=>this['_enqueue'](_0x4844aa['unitID'],()=>{let _0x6d4020=this['_units']['get'](_0x4844aa['unitID']),_0x3ca49a=_0x6d4020?.['get'](_0x4844aa['replyID']),_0x5022d9=_0x6d4020?.['get'](_0x4844aa['threadID']);if(!_0x3ca49a||_0x3ca49a['threadID']!==_0x4844aa['threadID']||!_0x5022d9)return{'status':'not-found'};if(_0x5022d9['solved']!==t['CommentSolvedStatus']['OpenOrReOpen'])return{'status':'closed'};if(_0x3ca49a['authorUserID']!==_0x4844aa['expectedAuthorUserID'])return{'status':'author-mismatch'};if(_0x3ca49a['content']===_0x4844aa['content']&&a(_0x3ca49a['mentions'],_0x4844aa['mentions']))return{'status':'unchanged','record':r(_0x3ca49a)};let _0x21e5e8={..._0x3ca49a,'content':_0x4844aa['content'],'mentions':[..._0x4844aa['mentions']],'updatedAt':Math['max'](Date['now'](),_0x3ca49a['updatedAt']+0x1)};return _0x6d4020['set'](_0x4844aa['replyID'],_0x21e5e8),{'status':'edited','record':r(_0x21e5e8)};}));}['setThreadSolved'](_0x1b7a84,_0x409182){return this['_call'](()=>this['_enqueue'](_0x1b7a84['unitID'],()=>{let _0x51d92a=this['_units']['get'](_0x1b7a84['unitID']),_0x2b05e3=_0x51d92a?.['get'](_0x1b7a84['threadID']);return!_0x2b05e3||_0x2b05e3['replyID']!==_0x2b05e3['threadID']?{'status':'not-found'}:_0x2b05e3['solved']===_0x1b7a84['solved']?{'status':'unchanged'}:(_0x51d92a['set'](_0x1b7a84['threadID'],{..._0x2b05e3,'solved':_0x1b7a84['solved'],'updatedAt':Math['max'](Date['now'](),_0x2b05e3['updatedAt']+0x1)}),{'status':'updated'});}));}['deleteComment'](_0x3a535a,_0x547c04){return this['_call'](()=>this['_enqueue'](_0x3a535a['unitID'],()=>{let _0x42ed6f=this['_units']['get'](_0x3a535a['unitID']),_0x45b91c=_0x3a535a['replyID']??_0x3a535a['threadID'],_0x26fc91=_0x42ed6f?.['get'](_0x45b91c);if(!_0x26fc91||_0x26fc91['threadID']!==_0x3a535a['threadID'])return{'status':'not-found'};if(_0x26fc91['generation']!==_0x3a535a['expectedGeneration'])return{'status':'generation-mismatch'};if(_0x3a535a['replyID']===void 0x0){for(let [_0x13e51c,_0x3ed884]of _0x42ed6f)_0x3ed884['threadID']===_0x3a535a['threadID']&&_0x42ed6f['delete'](_0x13e51c);}else _0x42ed6f['delete'](_0x3a535a['replyID']);return _0x42ed6f['size']===0x0&&this['_units']['delete'](_0x3a535a['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'](_0x1dadd6){let _0x119b6b=this['_units']['get'](_0x1dadd6);if(_0x119b6b)return _0x119b6b;let _0x2dc0e2=new Map();return this['_units']['set'](_0x1dadd6,_0x2dc0e2),_0x2dc0e2;}['_enqueue'](_0x3b39d7,_0xedf996){let _0x446b7e=(this['_queues']['get'](_0x3b39d7)??Promise['resolve']())['catch'](()=>void 0x0)['then'](_0xedf996),_0x4f9f95=_0x446b7e['then'](()=>void 0x0,()=>void 0x0);return this['_queues']['set'](_0x3b39d7,_0x4f9f95),_0x4f9f95['finally'](()=>{this['_queues']['get'](_0x3b39d7)===_0x4f9f95&&this['_queues']['delete'](_0x3b39d7);}),_0x446b7e;}['_call'](_0x5e3059){if(this['_state']!=='running')return Promise['reject'](Error('Memory\x20Comment\x20Database\x20Adapter\x20is\x20'+this['_state']));let _0x1311e8=_0x5e3059();return this['_calls']['add'](_0x1311e8),_0x1311e8['finally'](()=>this['_calls']['delete'](_0x1311e8))['catch'](()=>void 0x0),_0x1311e8;}};function r(_0x243606){return{..._0x243606,'mentions':[..._0x243606['mentions']]};}function i(_0x4f2742,_0x39258c){let _0x5a613d=_0x4f2742['threadID']['localeCompare'](_0x39258c['threadID']);return _0x5a613d===0x0?_0x4f2742['replyID']===_0x4f2742['threadID']?-0x1:_0x39258c['replyID']===_0x39258c['threadID']?0x1:_0x4f2742['createdAt']-_0x39258c['createdAt']||_0x4f2742['replyID']['localeCompare'](_0x39258c['replyID']):_0x5a613d;}function a(_0x27fb42,_0x178429){return _0x27fb42['length']===_0x178429['length']&&_0x27fb42['every']((_0x2fb2a6,_0x67b5b5)=>_0x2fb2a6===_0x178429[_0x67b5b5]);}exports['MemoryCommentDatabaseAdapter']=n;
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- (function(_0x3b7196,_0x38ea0f){const _0x43757f=_0x7e60,_0x92411=_0x3b7196();while(!![]){try{const _0x277aaf=parseInt(_0x43757f(0xb5))/0x1+-parseInt(_0x43757f(0xb9))/0x2+-parseInt(_0x43757f(0xb8))/0x3+parseInt(_0x43757f(0xba))/0x4*(parseInt(_0x43757f(0xbd))/0x5)+parseInt(_0x43757f(0xbc))/0x6*(-parseInt(_0x43757f(0xbb))/0x7)+parseInt(_0x43757f(0xb7))/0x8+parseInt(_0x43757f(0xb6))/0x9;if(_0x277aaf===_0x38ea0f)break;else _0x92411['push'](_0x92411['shift']());}catch(_0xb681f5){_0x92411['push'](_0x92411['shift']());}}}(_0x2d32,0x766a5));function _0x2d32(){const _0x5567c4=['235998eMIxqY','150kfYPIG','3018485Kbcbgp','674898xaNECG','9804996tAdXDA','2149688mJnFse','1511349zLidws','1610176hsxqQr','4YjRrwO'];_0x2d32=function(){return _0x5567c4;};return _0x2d32();}import _0x50741a from'./index.cjs';function _0x7e60(_0x27e8d6,_0x4b0bc0){_0x27e8d6=_0x27e8d6-0xb5;const _0x2d32eb=_0x2d32();let _0x7e604c=_0x2d32eb[_0x27e8d6];return _0x7e604c;}const facadeExport0=_0x50741a['MemoryCommentDatabaseAdapter'];export{facadeExport0 as MemoryCommentDatabaseAdapter};
1
+ const _0x449055=_0x2b89;function _0x20d9(){const _0x4c01aa=['47QgvyvO','458936ZJqwRJ','MemoryCommentDatabaseAdapter','6hJwuIJ','4sWYgoc','60AlxPeM','9kHHnqj','13462blDECY','797255FOpevB','2420431bofWAX','992981qiOOzM','2518446EusxOA','20riQdLO','74157VzSKEN'];_0x20d9=function(){return _0x4c01aa;};return _0x20d9();}(function(_0x2ff949,_0x51890b){const _0xe6c427=_0x2b89,_0x93c53a=_0x2ff949();while(!![]){try{const _0x20b032=parseInt(_0xe6c427(0x1e2))/0x1*(-parseInt(_0xe6c427(0x1e9))/0x2)+-parseInt(_0xe6c427(0x1e1))/0x3*(-parseInt(_0xe6c427(0x1e6))/0x4)+parseInt(_0xe6c427(0x1ea))/0x5+-parseInt(_0xe6c427(0x1e5))/0x6*(parseInt(_0xe6c427(0x1df))/0x7)+parseInt(_0xe6c427(0x1e3))/0x8*(-parseInt(_0xe6c427(0x1e8))/0x9)+parseInt(_0xe6c427(0x1e0))/0xa*(-parseInt(_0xe6c427(0x1de))/0xb)+parseInt(_0xe6c427(0x1e7))/0xc*(parseInt(_0xe6c427(0x1eb))/0xd);if(_0x20b032===_0x51890b)break;else _0x93c53a['push'](_0x93c53a['shift']());}catch(_0x94915e){_0x93c53a['push'](_0x93c53a['shift']());}}}(_0x20d9,0x31165));import _0x2e9e8c from'./index.cjs';const facadeExport0=_0x2e9e8c[_0x449055(0x1e4)];function _0x2b89(_0xa86072,_0x481a1b){_0xa86072=_0xa86072-0x1de;const _0x20d96a=_0x20d9();let _0x2b894d=_0x20d96a[_0xa86072];return _0x2b894d;}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.0-rc.0",
4
+ "version": "1.0.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.0.0-rc.0",
20
- "@univerjs/protocol": "1.0.0-rc.0"
19
+ "@univerjs-pro/collaboration-comment-service": "1.0.1",
20
+ "@univerjs/protocol": "1.0.1"
21
21
  }
22
22
  }