@univerjs-pro/collaboration-database-sqlite 1.0.0-insiders.20260728-e98f416 → 1.0.0-insiders.20260803-82dc67d
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 +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.mjs +1 -1
- package/package.json +5 -4
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object['defineProperty'](exports,Symbol['toStringTag'],{'value':'Module'});let e=require('node:sqlite'),t=require('@univerjs-pro/collaboration-service');var n=0x1388,r='__univerCollaborationBinary',i=class{['_database'];['_disposed']=!0x1;constructor(_0x1fee8f){a(_0x1fee8f),this['_database']=new e['DatabaseSync'](_0x1fee8f['filename']);try{this['_database']['exec']('PRAGMA\x20foreign_keys\x20=\x20ON;'),this['_database']['exec']('PRAGMA\x20busy_timeout\x20=\x20'+(_0x1fee8f['busyTimeoutMs']??n)+';'),_0x1fee8f['filename']!==':memory:'&&this['_database']['exec']('PRAGMA\x20journal_mode\x20=\x20WAL;'),this['_initializeSchema']();}catch(_0x9962d2){throw this['_database']['close'](),_0x9962d2;}}async['getUnit'](_0xfd1ab,_0x47c0bd){this['_assertOpen']();let _0x5f50cf=this['_database']['prepare']('SELECT\x20unit_id,\x20type,\x20head_revision,\x20lifecycle\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20FROM\x20units\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20WHERE\x20unit_id\x20=\x20?\x20AND\x20lifecycle\x20=\x20\x27active\x27')['get'](_0x47c0bd);return _0x5f50cf?l(_0x5f50cf):null;}async['getSnapshot'](_0x27495f,_0xdd8a23,_0x176026){this['_assertOpen']();let _0x23b1bc=_0x176026?.['revision'];if(_0x23b1bc!==void 0x0&&_0x23b1bc<0x0)throw u('Snapshot\x20revision\x20cannot\x20be\x20negative');let _0x80198c=this['_getActiveUnitRow'](_0xdd8a23);if(!_0x80198c)return null;let _0x4945eb=_0x23b1bc===void 0x0||_0x23b1bc===0x0?_0x80198c['head_revision']:Math['min'](_0x23b1bc,_0x80198c['head_revision']),_0x32825a=this['_database']['prepare']('SELECT\x20snapshots.payload_json\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20FROM\x20snapshots\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20JOIN\x20units\x20ON\x20units.unit_id\x20=\x20snapshots.unit_id\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20WHERE\x20snapshots.unit_id\x20=\x20?\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20AND\x20snapshots.revision\x20<=\x20?\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20AND\x20units.lifecycle\x20=\x20\x27active\x27\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20ORDER\x20BY\x20snapshots.revision\x20DESC\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20LIMIT\x201')['get'](_0xdd8a23,_0x4945eb);return _0x32825a?p(_0x32825a['payload_json']):null;}async['getChangesets'](_0x12fdc9,_0x22476a,_0x16f78d){if(this['_assertOpen'](),_0x16f78d['from']<0x0||_0x16f78d['to']<0x0)throw u('Changeset\x20range\x20revisions\x20cannot\x20be\x20negative');let _0x4920d0=this['_database']['prepare']('SELECT\x20units.head_revision,\x20changesets.payload_json\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20FROM\x20units\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20LEFT\x20JOIN\x20changesets\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20ON\x20changesets.unit_id\x20=\x20units.unit_id\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20AND\x20changesets.revision\x20>\x20?\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20AND\x20changesets.revision\x20<=\x20CASE\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20WHEN\x20?\x20=\x200\x20THEN\x20units.head_revision\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20ELSE\x20MIN(?,\x20units.head_revision)\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20END\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20WHERE\x20units.unit_id\x20=\x20?\x20AND\x20units.lifecycle\x20=\x20\x27active\x27\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20ORDER\x20BY\x20changesets.revision\x20ASC')['all'](_0x16f78d['from'],_0x16f78d['to'],_0x16f78d['to'],_0x22476a),_0x1af68c=_0x4920d0[0x0];return _0x1af68c?{'changesets':_0x4920d0['flatMap'](_0x2ed06b=>_0x2ed06b['payload_json']?[p(_0x2ed06b['payload_json'])]:[]),'latestRevision':_0x1af68c['head_revision']}:{'changesets':[],'latestRevision':0x0};}async['getSubmission'](_0x2a2698,_0x361f73,_0x5e726c,_0x5cf012){this['_assertOpen']();let _0xbe5c3a=this['_database']['prepare']('SELECT\x20changesets.payload_json\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20FROM\x20changesets\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20JOIN\x20units\x20ON\x20units.unit_id\x20=\x20changesets.unit_id\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20WHERE\x20changesets.unit_id\x20=\x20?\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20AND\x20changesets.sid\x20=\x20?\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20AND\x20changesets.req_id\x20=\x20?\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20AND\x20units.lifecycle\x20=\x20\x27active\x27')['get'](_0x361f73,_0x5e726c,_0x5cf012);return _0xbe5c3a?p(_0xbe5c3a['payload_json']):null;}async['createUnit'](_0x28403c,_0x4339da){this['_assertOpen'](),o(_0x4339da);let _0x54e48b=f(_0x4339da['snapshot']),_0x3903c2=(_0x4339da['sheetBlocks']??[])['map'](_0x2079b2=>({'id':_0x2079b2['id'],'payload':f(_0x2079b2)})),_0x155760=Object['entries'](_0x4339da['resources']??{})['map'](([_0x5d3553,_0x3ec0d2])=>({'resourceID':_0x5d3553,'payload':f(_0x3ec0d2)}));return this['_transaction'](()=>{if(this['_hasTombstone'](_0x4339da['record']['unitID']))throw u('Cannot\x20reuse\x20a\x20hard-deleted\x20unit\x20ID');let _0x157fed=this['_getStoredUnitRow'](_0x4339da['record']['unitID']);if(_0x157fed){if(_0x157fed['lifecycle']==='soft-deleted')throw u('Cannot\x20reuse\x20a\x20soft-deleted\x20unit\x20ID');return{'status':'already-exists','record':l(_0x157fed)};}return this['_database']['prepare']('INSERT\x20INTO\x20units\x20(unit_id,\x20type,\x20head_revision,\x20lifecycle)\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20VALUES\x20(?,\x20?,\x201,\x20\x27active\x27)')['run'](_0x4339da['record']['unitID'],_0x4339da['record']['type']),this['_writeDependencies'](_0x4339da['record']['unitID'],_0x3903c2,_0x155760),this['_database']['prepare']('INSERT\x20INTO\x20snapshots\x20(unit_id,\x20revision,\x20type,\x20payload_json)\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20VALUES\x20(?,\x201,\x20?,\x20?)')['run'](_0x4339da['record']['unitID'],_0x4339da['record']['type'],_0x54e48b),{'status':'created','record':{..._0x4339da['record']}};});}async['deleteUnits'](_0x14324f,_0xd69b95){return this['_assertOpen'](),this['_transaction'](()=>{let _0x29845a=d(_0xd69b95['unitIDs'])['map'](_0x14bbfd=>{let _0xd6c428=this['_getStoredUnitRow'](_0x14bbfd);if(!_0xd6c428){if(_0xd69b95['hardDelete']&&this['_hasTombstone'](_0x14bbfd))return{'unitID':_0x14bbfd,'status':'already-hard-deleted'};throw new t['CollabError']('UNIT_NOT_FOUND','Cannot\x20delete\x20a\x20missing\x20unit');}return _0xd69b95['hardDelete']?{'unitID':_0x14bbfd,'status':'hard-deleted'}:{'unitID':_0x14bbfd,'status':_0xd6c428['lifecycle']==='active'?'soft-deleted':'already-soft-deleted'};}),_0x49e776=this['_database']['prepare']('UPDATE\x20units\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20SET\x20lifecycle\x20=\x20\x27soft-deleted\x27\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20WHERE\x20unit_id\x20=\x20?\x20AND\x20lifecycle\x20=\x20\x27active\x27'),_0x42cd02=this['_database']['prepare']('INSERT\x20INTO\x20unit_tombstones\x20(unit_id,\x20purged_at)\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20VALUES\x20(?,\x20?)'),_0x4d0f0e=this['_database']['prepare']('DELETE\x20FROM\x20units\x20WHERE\x20unit_id\x20=\x20?'),_0x29df4d=Date['now']();for(let _0xc26664 of _0x29845a)_0xc26664['status']==='soft-deleted'?_0x49e776['run'](_0xc26664['unitID']):_0xc26664['status']==='hard-deleted'&&(_0x42cd02['run'](_0xc26664['unitID'],_0x29df4d),_0x4d0f0e['run'](_0xc26664['unitID']));return{'units':_0x29845a};});}async['recoverUnits'](_0x117e14,_0x3a9eee){return this['_assertOpen'](),this['_transaction'](()=>{let _0x5c443a=d(_0x3a9eee['unitIDs'])['map'](_0x8dccc4=>{let _0x52decf=this['_getStoredUnitRow'](_0x8dccc4);if(!_0x52decf)throw this['_hasTombstone'](_0x8dccc4)?u('Cannot\x20recover\x20a\x20hard-deleted\x20unit'):new t['CollabError']('UNIT_NOT_FOUND','Cannot\x20recover\x20a\x20missing\x20unit');return{'unitID':_0x8dccc4,'status':_0x52decf['lifecycle']==='active'?'already-active':'recovered'};}),_0x3c6162=this['_database']['prepare']('UPDATE\x20units\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20SET\x20lifecycle\x20=\x20\x27active\x27\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20WHERE\x20unit_id\x20=\x20?\x20AND\x20lifecycle\x20=\x20\x27soft-deleted\x27');for(let _0x59ba01 of _0x5c443a)_0x59ba01['status']==='recovered'&&_0x3c6162['run'](_0x59ba01['unitID']);return{'units':_0x5c443a};});}async['commitChangeset'](_0xeae85f,_0x435cbf){this['_assertOpen'](),s(_0x435cbf['changeset']);let _0x36e0e9=f(_0x435cbf['changeset']);return this['_transaction'](()=>{let {changeset:_0x21ee77,expectedHeadRevision:_0x30de55}=_0x435cbf,_0x3571f8=this['_getActiveUnitRow'](_0x21ee77['unitID']);if(!_0x3571f8)throw new t['CollabError']('UNIT_NOT_FOUND','Cannot\x20commit\x20to\x20a\x20missing\x20unit');let _0x57367a=this['_database']['prepare']('SELECT\x20payload_json\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20FROM\x20changesets\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20WHERE\x20unit_id\x20=\x20?\x20AND\x20sid\x20=\x20?\x20AND\x20req_id\x20=\x20?')['get'](_0x21ee77['unitID'],_0x21ee77['sid'],_0x21ee77['reqId']);if(_0x57367a)return{'status':'already-committed','changeset':p(_0x57367a['payload_json'])};if(_0x3571f8['head_revision']!==_0x30de55)return{'status':'revision-mismatch','actualHeadRevision':_0x3571f8['head_revision']};if(c(l(_0x3571f8),_0x435cbf),this['_database']['prepare']('INSERT\x20INTO\x20changesets\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20(unit_id,\x20revision,\x20base_revision,\x20sid,\x20req_id,\x20payload_json)\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20VALUES\x20(?,\x20?,\x20?,\x20?,\x20?,\x20?)')['run'](_0x21ee77['unitID'],_0x21ee77['revision'],_0x21ee77['baseRev'],_0x21ee77['sid'],_0x21ee77['reqId'],_0x36e0e9),this['_database']['prepare']('UPDATE\x20units\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20SET\x20head_revision\x20=\x20?\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20WHERE\x20unit_id\x20=\x20?\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20AND\x20head_revision\x20=\x20?\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20AND\x20lifecycle\x20=\x20\x27active\x27')['run'](_0x21ee77['revision'],_0x21ee77['unitID'],_0x30de55)['changes']!==0x1)throw new t['CollabError']('INTERNAL_ERROR','SQLite\x20head\x20changed\x20inside\x20an\x20exclusive\x20write\x20transaction');return{'status':'committed','changeset':p(_0x36e0e9),'headRevision':_0x21ee77['revision']};});}async['saveSnapshot'](_0x69c4bb,_0x312911){this['_assertOpen']();let _0x47f697=f(_0x312911['snapshot']),_0x1ea19f=(_0x312911['sheetBlocks']??[])['map'](_0x56ef03=>({'id':_0x56ef03['id'],'payload':f(_0x56ef03)})),_0x380045=Object['entries'](_0x312911['resources']??{})['map'](([_0x27cba3,_0xe0ec9e])=>({'resourceID':_0x27cba3,'payload':f(_0xe0ec9e)}));this['_transaction'](()=>{let _0x2639dc=this['_getActiveUnitRow'](_0x312911['snapshot']['unitID']);if(!_0x2639dc)throw new t['CollabError']('UNIT_NOT_FOUND','Cannot\x20snapshot\x20a\x20missing\x20unit');if(_0x312911['snapshot']['type']!==_0x2639dc['type']||_0x312911['snapshot']['rev']<0x1||_0x312911['snapshot']['rev']>_0x2639dc['head_revision'])throw u('Snapshot\x20does\x20not\x20match\x20the\x20stored\x20unit\x20head');this['_writeDependencies'](_0x312911['snapshot']['unitID'],_0x1ea19f,_0x380045),this['_database']['prepare']('INSERT\x20INTO\x20snapshots\x20(unit_id,\x20revision,\x20type,\x20payload_json)\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20VALUES\x20(?,\x20?,\x20?,\x20?)\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20ON\x20CONFLICT(unit_id,\x20revision)\x20DO\x20UPDATE\x20SET\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20type\x20=\x20excluded.type,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20payload_json\x20=\x20excluded.payload_json')['run'](_0x312911['snapshot']['unitID'],_0x312911['snapshot']['rev'],_0x312911['snapshot']['type'],_0x47f697);});}async['getSheetBlock'](_0x19f968,_0x1f7d89,_0x149679){this['_assertOpen']();let _0x2e4163=this['_database']['prepare']('SELECT\x20sheet_blocks.payload_json\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20FROM\x20sheet_blocks\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20JOIN\x20units\x20ON\x20units.unit_id\x20=\x20sheet_blocks.unit_id\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20WHERE\x20sheet_blocks.unit_id\x20=\x20?\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20AND\x20sheet_blocks.block_id\x20=\x20?\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20AND\x20units.lifecycle\x20=\x20\x27active\x27')['get'](_0x1f7d89,_0x149679);return _0x2e4163?p(_0x2e4163['payload_json']):null;}async['getResources'](_0x23d5d4,_0x5869d3,_0x4d979c){this['_assertOpen']();let _0x5404d0=this['_database']['prepare']('SELECT\x20resources.payload_json\x0a\x20\x20\x20\x20\x20\x20\x20FROM\x20resources\x0a\x20\x20\x20\x20\x20\x20\x20JOIN\x20units\x20ON\x20units.unit_id\x20=\x20resources.unit_id\x0a\x20\x20\x20\x20\x20\x20\x20WHERE\x20resources.unit_id\x20=\x20?\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20AND\x20resources.resource_id\x20=\x20?\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20AND\x20units.lifecycle\x20=\x20\x27active\x27'),_0x6026a9={};for(let _0x172b15 of _0x4d979c){let _0x3cd345=_0x5404d0['get'](_0x5869d3,_0x172b15);_0x3cd345&&(_0x6026a9[_0x172b15]=p(_0x3cd345['payload_json']));}return _0x6026a9;}async['dispose'](){this['_disposed']||(this['_disposed']=!0x0,this['_database']['close']());}['_initializeSchema'](){this['_transaction'](()=>{this['_database']['exec']('\x0a\x20\x20\x20\x20\x20\x20\x20\x20CREATE\x20TABLE\x20IF\x20NOT\x20EXISTS\x20units\x20(\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20unit_id\x20TEXT\x20PRIMARY\x20KEY,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20type\x20INTEGER\x20NOT\x20NULL,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20head_revision\x20INTEGER\x20NOT\x20NULL\x20CHECK\x20(head_revision\x20>=\x201),\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20lifecycle\x20TEXT\x20NOT\x20NULL\x20CHECK\x20(lifecycle\x20IN\x20(\x27active\x27,\x20\x27soft-deleted\x27))\x0a\x20\x20\x20\x20\x20\x20\x20\x20);\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20CREATE\x20TABLE\x20IF\x20NOT\x20EXISTS\x20unit_tombstones\x20(\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20unit_id\x20TEXT\x20PRIMARY\x20KEY,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20purged_at\x20INTEGER\x20NOT\x20NULL\x0a\x20\x20\x20\x20\x20\x20\x20\x20);\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20CREATE\x20TABLE\x20IF\x20NOT\x20EXISTS\x20snapshots\x20(\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20unit_id\x20TEXT\x20NOT\x20NULL,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20revision\x20INTEGER\x20NOT\x20NULL\x20CHECK\x20(revision\x20>=\x201),\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20type\x20INTEGER\x20NOT\x20NULL,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20payload_json\x20TEXT\x20NOT\x20NULL,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20PRIMARY\x20KEY\x20(unit_id,\x20revision),\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20FOREIGN\x20KEY\x20(unit_id)\x20REFERENCES\x20units(unit_id)\x20ON\x20DELETE\x20CASCADE\x0a\x20\x20\x20\x20\x20\x20\x20\x20);\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20CREATE\x20TABLE\x20IF\x20NOT\x20EXISTS\x20changesets\x20(\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20unit_id\x20TEXT\x20NOT\x20NULL,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20revision\x20INTEGER\x20NOT\x20NULL\x20CHECK\x20(revision\x20>=\x202),\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20base_revision\x20INTEGER\x20NOT\x20NULL\x20CHECK\x20(base_revision\x20>=\x201),\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20sid\x20TEXT\x20NOT\x20NULL,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20req_id\x20INTEGER\x20NOT\x20NULL\x20CHECK\x20(req_id\x20>=\x201),\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20payload_json\x20TEXT\x20NOT\x20NULL,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20PRIMARY\x20KEY\x20(unit_id,\x20revision),\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20UNIQUE\x20(unit_id,\x20sid,\x20req_id),\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20FOREIGN\x20KEY\x20(unit_id)\x20REFERENCES\x20units(unit_id)\x20ON\x20DELETE\x20CASCADE\x0a\x20\x20\x20\x20\x20\x20\x20\x20);\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20CREATE\x20TABLE\x20IF\x20NOT\x20EXISTS\x20sheet_blocks\x20(\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20unit_id\x20TEXT\x20NOT\x20NULL,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20block_id\x20TEXT\x20NOT\x20NULL,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20payload_json\x20TEXT\x20NOT\x20NULL,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20PRIMARY\x20KEY\x20(unit_id,\x20block_id),\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20FOREIGN\x20KEY\x20(unit_id)\x20REFERENCES\x20units(unit_id)\x20ON\x20DELETE\x20CASCADE\x0a\x20\x20\x20\x20\x20\x20\x20\x20);\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20CREATE\x20TABLE\x20IF\x20NOT\x20EXISTS\x20resources\x20(\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20unit_id\x20TEXT\x20NOT\x20NULL,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20resource_id\x20TEXT\x20NOT\x20NULL,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20payload_json\x20TEXT\x20NOT\x20NULL,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20PRIMARY\x20KEY\x20(unit_id,\x20resource_id),\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20FOREIGN\x20KEY\x20(unit_id)\x20REFERENCES\x20units(unit_id)\x20ON\x20DELETE\x20CASCADE\x0a\x20\x20\x20\x20\x20\x20\x20\x20);\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20CREATE\x20INDEX\x20IF\x20NOT\x20EXISTS\x20snapshots_nearest_revision\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20ON\x20snapshots(unit_id,\x20revision\x20DESC);\x0a\x20\x20\x20\x20\x20\x20\x20\x20CREATE\x20INDEX\x20IF\x20NOT\x20EXISTS\x20changesets_revision_range\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20ON\x20changesets(unit_id,\x20revision\x20ASC);\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20PRAGMA\x20user_version\x20=\x201;\x0a\x20\x20\x20\x20\x20\x20');});}['_getActiveUnitRow'](_0x13d2e6){return this['_database']['prepare']('SELECT\x20unit_id,\x20type,\x20head_revision,\x20lifecycle\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20FROM\x20units\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20WHERE\x20unit_id\x20=\x20?\x20AND\x20lifecycle\x20=\x20\x27active\x27')['get'](_0x13d2e6)??null;}['_getStoredUnitRow'](_0x4eda24){return this['_database']['prepare']('SELECT\x20unit_id,\x20type,\x20head_revision,\x20lifecycle\x20FROM\x20units\x20WHERE\x20unit_id\x20=\x20?')['get'](_0x4eda24)??null;}['_hasTombstone'](_0x5b1889){return!!this['_database']['prepare']('SELECT\x201\x20FROM\x20unit_tombstones\x20WHERE\x20unit_id\x20=\x20?')['get'](_0x5b1889);}['_writeDependencies'](_0x449365,_0x27ab2b,_0x674235){let _0x3e0753=this['_database']['prepare']('INSERT\x20INTO\x20sheet_blocks\x20(unit_id,\x20block_id,\x20payload_json)\x0a\x20\x20\x20\x20\x20\x20\x20VALUES\x20(?,\x20?,\x20?)\x0a\x20\x20\x20\x20\x20\x20\x20ON\x20CONFLICT(unit_id,\x20block_id)\x20DO\x20UPDATE\x20SET\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20payload_json\x20=\x20excluded.payload_json');for(let _0x77b9e of _0x27ab2b)_0x3e0753['run'](_0x449365,_0x77b9e['id'],_0x77b9e['payload']);let _0x586f0c=this['_database']['prepare']('INSERT\x20INTO\x20resources\x20(unit_id,\x20resource_id,\x20payload_json)\x0a\x20\x20\x20\x20\x20\x20\x20VALUES\x20(?,\x20?,\x20?)\x0a\x20\x20\x20\x20\x20\x20\x20ON\x20CONFLICT(unit_id,\x20resource_id)\x20DO\x20UPDATE\x20SET\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20payload_json\x20=\x20excluded.payload_json');for(let _0x3c12e6 of _0x674235)_0x586f0c['run'](_0x449365,_0x3c12e6['resourceID'],_0x3c12e6['payload']);}['_transaction'](_0x270b31){this['_database']['exec']('BEGIN\x20IMMEDIATE;');try{let _0xc8fd9d=_0x270b31();return this['_database']['exec']('COMMIT;'),_0xc8fd9d;}catch(_0x199b9b){throw this['_database']['isTransaction']&&this['_database']['exec']('ROLLBACK;'),_0x199b9b;}}['_assertOpen'](){if(this['_disposed'])throw new t['CollabError']('INTERNAL_ERROR','SQLite\x20Database\x20Adapter\x20is\x20disposed');}};function a(_0x3831a9){if(!_0x3831a9['filename'])throw u('SQLite\x20filename\x20is\x20required');if(_0x3831a9['busyTimeoutMs']!==void 0x0&&(!Number['isSafeInteger'](_0x3831a9['busyTimeoutMs'])||_0x3831a9['busyTimeoutMs']<0x0))throw u('SQLite\x20busyTimeoutMs\x20must\x20be\x20a\x20non-negative\x20integer');}function o(_0x182d17){let {record:_0x29cfe4,snapshot:_0x5bfcfa}=_0x182d17;if(_0x29cfe4['headRevision']!==0x1||_0x5bfcfa['rev']!==0x1||_0x5bfcfa['unitID']!==_0x29cfe4['unitID']||_0x5bfcfa['type']!==_0x29cfe4['type'])throw u('Initial\x20unit\x20record\x20and\x20snapshot\x20must\x20match\x20at\x20revision\x201');}function s(_0x1c548f){if(!_0x1c548f['sid']||!Number['isSafeInteger'](_0x1c548f['reqId'])||_0x1c548f['reqId']<0x1)throw u('Changeset\x20sid\x20and\x20positive\x20integer\x20reqId\x20are\x20required');}function c(_0x22f5a6,_0x517527){let {changeset:_0x2bfa0b,expectedHeadRevision:_0x4374c9}=_0x517527;if(_0x2bfa0b['type']!==_0x22f5a6['type']||_0x2bfa0b['baseRev']!==_0x4374c9||_0x2bfa0b['revision']!==_0x4374c9+0x1)throw u('Confirmed\x20changeset\x20must\x20match\x20the\x20unit\x20type\x20and\x20expected\x20revision');}function l(_0x1c530b){return{'unitID':_0x1c530b['unit_id'],'type':_0x1c530b['type'],'headRevision':_0x1c530b['head_revision']};}function u(_0x350f4c){return new t['CollabError']('INVALID_REQUEST',_0x350f4c);}function d(_0x4adcbf){return[...new Set(_0x4adcbf)];}function f(_0x559e88){return JSON['stringify'](_0x559e88,(_0x5cb493,_0x321a9d)=>_0x321a9d instanceof Uint8Array?{[r]:Buffer['from'](_0x321a9d)['toString']('base64')}:_0x321a9d);}function p(_0x31c71a){return JSON['parse'](_0x31c71a,(_0x49dd1a,_0x4de3b0)=>m(_0x4de3b0)?Uint8Array['from'](Buffer['from'](_0x4de3b0[r],'base64')):_0x4de3b0);}function m(_0x2b6b27){return typeof _0x2b6b27=='object'&&!!_0x2b6b27&&Object['keys'](_0x2b6b27)['length']===0x1&&typeof _0x2b6b27[r]=='string';}exports['SQLiteDatabaseAdapter']=i;
|
|
1
|
+
Object['defineProperty'](exports,Symbol['toStringTag'],{'value':'Module'});var e=Object['create'],t=Object['defineProperty'],n=Object['getOwnPropertyDescriptor'],r=Object['getOwnPropertyNames'],i=Object['getPrototypeOf'],a=Object['prototype']['hasOwnProperty'],o=(_0x520ac8,_0x4dd040,_0x44c661,_0x4e9e28)=>{if(_0x4dd040&&typeof _0x4dd040=='object'||typeof _0x4dd040=='function'){for(var _0x131aa1=r(_0x4dd040),_0x44045b=0x0,_0x2deb49=_0x131aa1['length'],_0x3cab22;_0x44045b<_0x2deb49;_0x44045b++)_0x3cab22=_0x131aa1[_0x44045b],!a['call'](_0x520ac8,_0x3cab22)&&_0x3cab22!==_0x44c661&&t(_0x520ac8,_0x3cab22,{'get':(_0x34cad8=>_0x4dd040[_0x34cad8])['bind'](null,_0x3cab22),'enumerable':!(_0x4e9e28=n(_0x4dd040,_0x3cab22))||_0x4e9e28['enumerable']});}return _0x520ac8;},s=(_0x1f6185,_0x19e89a,_0x1b3055)=>(_0x1b3055=_0x1f6185==null?{}:e(i(_0x1f6185)),o(_0x19e89a||!_0x1f6185||!_0x1f6185['__esModule']?t(_0x1b3055,'default',{'value':_0x1f6185,'enumerable':!0x0}):_0x1b3055,_0x1f6185));let c=require('libsql');c=s(c,0x1);let l=require('@univerjs-pro/collaboration-service');var u=0x1388,d='__univerCollaborationBinary',f='core',p=0x1,m=['collaboration_units','collaboration_unit_tombstones','collaboration_snapshots','collaboration_changesets','collaboration_sheet_blocks','collaboration_resources'],h=class{['_database'];['_disposed']=!0x1;constructor(_0x1b873a){g(_0x1b873a),this['_database']=new c['default'](_0x1b873a['filename'],{'timeout':_0x1b873a['busyTimeoutMs']??u});try{this['_database']['exec']('PRAGMA\x20foreign_keys\x20=\x20ON;'),this['_database']['exec']('PRAGMA\x20busy_timeout\x20=\x20'+(_0x1b873a['busyTimeoutMs']??u)+';'),this['_initializeSchema']();}catch(_0x48b5c8){throw this['_database']['close'](),_0x48b5c8;}}async['getUnit'](_0x1ce092,_0x54d010){this['_assertOpen']();let _0x1c7308=this['_database']['prepare']('SELECT\x20unit_id,\x20type,\x20head_revision,\x20soft_deleted_at_ms\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20FROM\x20collaboration_units\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20WHERE\x20unit_id\x20=\x20?\x20AND\x20soft_deleted_at_ms\x20IS\x20NULL')['get'](_0x54d010);return _0x1c7308?b(_0x1c7308):null;}async['getSnapshot'](_0x3be8b1,_0x1073d1,_0x3b8c54){this['_assertOpen']();let _0xf7146=_0x3b8c54?.['revision'];if(_0xf7146!==void 0x0&&_0xf7146<0x0)throw x('Snapshot\x20revision\x20cannot\x20be\x20negative');let _0x555dca=this['_getActiveUnitRow'](_0x1073d1);if(!_0x555dca)return null;let _0x6ab53e=_0xf7146===void 0x0||_0xf7146===0x0?_0x555dca['head_revision']:Math['min'](_0xf7146,_0x555dca['head_revision']),_0x155682=this['_database']['prepare']('SELECT\x20collaboration_snapshots.payload_json\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20FROM\x20collaboration_snapshots\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20JOIN\x20collaboration_units\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20ON\x20collaboration_units.unit_id\x20=\x20collaboration_snapshots.unit_id\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20WHERE\x20collaboration_snapshots.unit_id\x20=\x20?\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20AND\x20collaboration_snapshots.revision\x20<=\x20?\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20AND\x20collaboration_units.soft_deleted_at_ms\x20IS\x20NULL\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20ORDER\x20BY\x20collaboration_snapshots.revision\x20DESC\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20LIMIT\x201')['get'](_0x1073d1,_0x6ab53e);return _0x155682?T(_0x155682['payload_json']):null;}async['getChangesets'](_0x348fa5,_0x3a85f3,_0x1e9733){if(this['_assertOpen'](),_0x1e9733['from']<0x0||_0x1e9733['to']<0x0)throw x('Changeset\x20range\x20revisions\x20cannot\x20be\x20negative');let _0x3af445=this['_database']['prepare']('SELECT\x20collaboration_units.head_revision,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20collaboration_changesets.payload_json\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20FROM\x20collaboration_units\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20LEFT\x20JOIN\x20collaboration_changesets\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20ON\x20collaboration_changesets.unit_id\x20=\x20collaboration_units.unit_id\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20AND\x20collaboration_changesets.revision\x20>\x20?\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20AND\x20collaboration_changesets.revision\x20<=\x20CASE\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20WHEN\x20?\x20=\x200\x20THEN\x20collaboration_units.head_revision\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20ELSE\x20MIN(?,\x20collaboration_units.head_revision)\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20END\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20WHERE\x20collaboration_units.unit_id\x20=\x20?\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20AND\x20collaboration_units.soft_deleted_at_ms\x20IS\x20NULL\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20ORDER\x20BY\x20collaboration_changesets.revision\x20ASC')['all'](_0x1e9733['from'],_0x1e9733['to'],_0x1e9733['to'],_0x3a85f3),_0x38e832=_0x3af445[0x0];return _0x38e832?{'changesets':_0x3af445['flatMap'](_0x18932=>_0x18932['payload_json']?[T(_0x18932['payload_json'])]:[]),'latestRevision':_0x38e832['head_revision']}:{'changesets':[],'latestRevision':0x0};}async['getSubmission'](_0x5b43b0,_0x3ff52c,_0x24ded3,_0x5c5fcf){this['_assertOpen']();let _0x592f01=this['_database']['prepare']('SELECT\x20collaboration_changesets.payload_json\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20FROM\x20collaboration_changesets\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20JOIN\x20collaboration_units\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20ON\x20collaboration_units.unit_id\x20=\x20collaboration_changesets.unit_id\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20WHERE\x20collaboration_changesets.unit_id\x20=\x20?\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20AND\x20collaboration_changesets.sid\x20=\x20?\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20AND\x20collaboration_changesets.req_id\x20=\x20?\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20AND\x20collaboration_units.soft_deleted_at_ms\x20IS\x20NULL')['get'](_0x3ff52c,_0x24ded3,_0x5c5fcf);return _0x592f01?T(_0x592f01['payload_json']):null;}async['createUnit'](_0x38ec59,_0x175a82){this['_assertOpen'](),_(_0x175a82);let _0x32f05e=w(_0x175a82['snapshot']),_0x57ed7e=(_0x175a82['sheetBlocks']??[])['map'](_0x34a055=>({'id':_0x34a055['id'],'payload':w(_0x34a055)})),_0x4076ba=Object['entries'](_0x175a82['resources']??{})['map'](([_0x610a99,_0x93b6c1])=>({'resourceID':_0x610a99,'payload':w(_0x93b6c1)}));return this['_transaction'](()=>{if(this['_hasTombstone'](_0x175a82['record']['unitID']))throw x('Cannot\x20reuse\x20a\x20hard-deleted\x20unit\x20ID');let _0x12219b=this['_getStoredUnitRow'](_0x175a82['record']['unitID']);if(_0x12219b){if(_0x12219b['soft_deleted_at_ms']!==null)throw x('Cannot\x20reuse\x20a\x20soft-deleted\x20unit\x20ID');return{'status':'already-exists','record':b(_0x12219b)};}return this['_database']['prepare']('INSERT\x20INTO\x20collaboration_units\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20(unit_id,\x20type,\x20head_revision,\x20soft_deleted_at_ms)\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20VALUES\x20(?,\x20?,\x201,\x20NULL)')['run'](_0x175a82['record']['unitID'],_0x175a82['record']['type']),this['_writeDependencies'](_0x175a82['record']['unitID'],_0x57ed7e,_0x4076ba),this['_database']['prepare']('INSERT\x20INTO\x20collaboration_snapshots\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20(unit_id,\x20revision,\x20type,\x20payload_json)\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20VALUES\x20(?,\x201,\x20?,\x20?)')['run'](_0x175a82['record']['unitID'],_0x175a82['record']['type'],_0x32f05e),{'status':'created','record':{..._0x175a82['record']}};});}async['deleteUnits'](_0x25dc64,_0x752b8d){return this['_assertOpen'](),this['_transaction'](()=>{let _0x51775c=C(_0x752b8d['unitIDs'])['map'](_0x2e8ac6=>{let _0x3aed8e=this['_getStoredUnitRow'](_0x2e8ac6);if(!_0x3aed8e){if(_0x752b8d['hardDelete']&&this['_hasTombstone'](_0x2e8ac6))return{'unitID':_0x2e8ac6,'status':'already-hard-deleted'};throw new l['CollabError']('UNIT_NOT_FOUND','Cannot\x20delete\x20a\x20missing\x20unit');}return _0x752b8d['hardDelete']?{'unitID':_0x2e8ac6,'status':'hard-deleted'}:{'unitID':_0x2e8ac6,'status':_0x3aed8e['soft_deleted_at_ms']===null?'soft-deleted':'already-soft-deleted'};}),_0x19a919=this['_database']['prepare']('UPDATE\x20collaboration_units\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20SET\x20soft_deleted_at_ms\x20=\x20?\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20WHERE\x20unit_id\x20=\x20?\x20AND\x20soft_deleted_at_ms\x20IS\x20NULL'),_0x17d3d9=this['_database']['prepare']('INSERT\x20INTO\x20collaboration_unit_tombstones\x20(unit_id,\x20purged_at)\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20VALUES\x20(?,\x20?)'),_0x21820e=this['_database']['prepare']('DELETE\x20FROM\x20collaboration_units\x20WHERE\x20unit_id\x20=\x20?'),_0x2bf42a=Date['now']();for(let _0x14ce7e of _0x51775c)_0x14ce7e['status']==='soft-deleted'?_0x19a919['run'](_0x2bf42a,_0x14ce7e['unitID']):_0x14ce7e['status']==='hard-deleted'&&(_0x17d3d9['run'](_0x14ce7e['unitID'],_0x2bf42a),_0x21820e['run'](_0x14ce7e['unitID']));return{'units':_0x51775c};});}async['recoverUnits'](_0x122338,_0x3326ff){return this['_assertOpen'](),this['_transaction'](()=>{let _0x285314=C(_0x3326ff['unitIDs'])['map'](_0x5620af=>{let _0x85fa4f=this['_getStoredUnitRow'](_0x5620af);if(!_0x85fa4f)throw this['_hasTombstone'](_0x5620af)?x('Cannot\x20recover\x20a\x20hard-deleted\x20unit'):new l['CollabError']('UNIT_NOT_FOUND','Cannot\x20recover\x20a\x20missing\x20unit');return{'unitID':_0x5620af,'status':_0x85fa4f['soft_deleted_at_ms']===null?'already-active':'recovered'};}),_0x5b6d54=this['_database']['prepare']('UPDATE\x20collaboration_units\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20SET\x20soft_deleted_at_ms\x20=\x20NULL\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20WHERE\x20unit_id\x20=\x20?\x20AND\x20soft_deleted_at_ms\x20IS\x20NOT\x20NULL');for(let _0x339848 of _0x285314)_0x339848['status']==='recovered'&&_0x5b6d54['run'](_0x339848['unitID']);return{'units':_0x285314};});}async['commitChangeset'](_0x17f7aa,_0x5c9f21){this['_assertOpen'](),v(_0x5c9f21['changeset']);let _0xb51c12=w(_0x5c9f21['changeset']);return this['_transaction'](()=>{let {changeset:_0xffd51c,expectedHeadRevision:_0x50792b}=_0x5c9f21,_0x540f29=this['_getActiveUnitRow'](_0xffd51c['unitID']);if(!_0x540f29)throw new l['CollabError']('UNIT_NOT_FOUND','Cannot\x20commit\x20to\x20a\x20missing\x20unit');let _0x2ba4a3=this['_database']['prepare']('SELECT\x20payload_json\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20FROM\x20collaboration_changesets\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20WHERE\x20unit_id\x20=\x20?\x20AND\x20sid\x20=\x20?\x20AND\x20req_id\x20=\x20?')['get'](_0xffd51c['unitID'],_0xffd51c['sid'],_0xffd51c['reqId']);if(_0x2ba4a3)return{'status':'already-committed','changeset':T(_0x2ba4a3['payload_json'])};if(_0x540f29['head_revision']!==_0x50792b)return{'status':'revision-mismatch','actualHeadRevision':_0x540f29['head_revision']};if(y(b(_0x540f29),_0x5c9f21),this['_database']['prepare']('INSERT\x20INTO\x20collaboration_changesets\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20(unit_id,\x20revision,\x20base_revision,\x20sid,\x20req_id,\x20payload_json)\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20VALUES\x20(?,\x20?,\x20?,\x20?,\x20?,\x20?)')['run'](_0xffd51c['unitID'],_0xffd51c['revision'],_0xffd51c['baseRev'],_0xffd51c['sid'],_0xffd51c['reqId'],_0xb51c12),this['_database']['prepare']('UPDATE\x20collaboration_units\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20SET\x20head_revision\x20=\x20?\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20WHERE\x20unit_id\x20=\x20?\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20AND\x20head_revision\x20=\x20?\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20AND\x20soft_deleted_at_ms\x20IS\x20NULL')['run'](_0xffd51c['revision'],_0xffd51c['unitID'],_0x50792b)['changes']!==0x1)throw new l['CollabError']('INTERNAL_ERROR','SQLite\x20head\x20changed\x20inside\x20an\x20exclusive\x20write\x20transaction');return{'status':'committed','changeset':T(_0xb51c12),'headRevision':_0xffd51c['revision']};});}async['saveSnapshot'](_0x49ce70,_0x358b10){this['_assertOpen']();let _0x23110e=w(_0x358b10['snapshot']),_0x256c02=(_0x358b10['sheetBlocks']??[])['map'](_0x1dca9a=>({'id':_0x1dca9a['id'],'payload':w(_0x1dca9a)})),_0x1bad2a=Object['entries'](_0x358b10['resources']??{})['map'](([_0x1071c6,_0x15412e])=>({'resourceID':_0x1071c6,'payload':w(_0x15412e)}));this['_transaction'](()=>{let _0x8d3000=this['_getActiveUnitRow'](_0x358b10['snapshot']['unitID']);if(!_0x8d3000)throw new l['CollabError']('UNIT_NOT_FOUND','Cannot\x20snapshot\x20a\x20missing\x20unit');if(_0x358b10['snapshot']['type']!==_0x8d3000['type']||_0x358b10['snapshot']['rev']<0x1||_0x358b10['snapshot']['rev']>_0x8d3000['head_revision'])throw x('Snapshot\x20does\x20not\x20match\x20the\x20stored\x20unit\x20head');this['_writeDependencies'](_0x358b10['snapshot']['unitID'],_0x256c02,_0x1bad2a),this['_database']['prepare']('INSERT\x20INTO\x20collaboration_snapshots\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20(unit_id,\x20revision,\x20type,\x20payload_json)\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20VALUES\x20(?,\x20?,\x20?,\x20?)\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20ON\x20CONFLICT(unit_id,\x20revision)\x20DO\x20UPDATE\x20SET\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20type\x20=\x20excluded.type,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20payload_json\x20=\x20excluded.payload_json')['run'](_0x358b10['snapshot']['unitID'],_0x358b10['snapshot']['rev'],_0x358b10['snapshot']['type'],_0x23110e);});}async['getSheetBlock'](_0x21bc07,_0x21518d,_0x150511){this['_assertOpen']();let _0x572120=this['_database']['prepare']('SELECT\x20collaboration_sheet_blocks.payload_json\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20FROM\x20collaboration_sheet_blocks\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20JOIN\x20collaboration_units\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20ON\x20collaboration_units.unit_id\x20=\x20collaboration_sheet_blocks.unit_id\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20WHERE\x20collaboration_sheet_blocks.unit_id\x20=\x20?\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20AND\x20collaboration_sheet_blocks.block_id\x20=\x20?\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20AND\x20collaboration_units.soft_deleted_at_ms\x20IS\x20NULL')['get'](_0x21518d,_0x150511);return _0x572120?T(_0x572120['payload_json']):null;}async['getResources'](_0x1165cf,_0x6624ac,_0x45041f){this['_assertOpen']();let _0x4abc39=this['_database']['prepare']('SELECT\x20collaboration_resources.payload_json\x0a\x20\x20\x20\x20\x20\x20\x20FROM\x20collaboration_resources\x0a\x20\x20\x20\x20\x20\x20\x20JOIN\x20collaboration_units\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20ON\x20collaboration_units.unit_id\x20=\x20collaboration_resources.unit_id\x0a\x20\x20\x20\x20\x20\x20\x20WHERE\x20collaboration_resources.unit_id\x20=\x20?\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20AND\x20collaboration_resources.resource_id\x20=\x20?\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20AND\x20collaboration_units.soft_deleted_at_ms\x20IS\x20NULL'),_0x35fcdf={};for(let _0x380d10 of _0x45041f){let _0x2fab2d=_0x4abc39['get'](_0x6624ac,_0x380d10);_0x2fab2d&&(_0x35fcdf[_0x380d10]=T(_0x2fab2d['payload_json']));}return _0x35fcdf;}async['dispose'](){this['_disposed']||(this['_disposed']=!0x0,this['_database']['close']());}['_initializeSchema'](){this['_transaction'](()=>{if(!this['_hasTable']('collaboration_schema_versions')){if(this['_hasAnyCoreTable']())throw S('SQLite\x20collaboration\x20core\x20tables\x20exist\x20without\x20a\x20schema\x20version');this['_database']['exec']('\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20CREATE\x20TABLE\x20collaboration_schema_versions\x20(\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20component\x20TEXT\x20PRIMARY\x20KEY,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20version\x20INTEGER\x20NOT\x20NULL\x20CHECK\x20(version\x20>=\x201)\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20);\x0a\x20\x20\x20\x20\x20\x20\x20\x20');}let _0x27c1bf=this['_database']['prepare']('SELECT\x20version\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20FROM\x20collaboration_schema_versions\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20WHERE\x20component\x20=\x20?')['get'](f);if(_0x27c1bf){if(_0x27c1bf['version']!==p)throw S('SQLite\x20collaboration\x20core\x20schema\x20version\x20'+_0x27c1bf['version']+'\x20is\x20not\x20supported');let _0x13e82a=m['filter'](_0x57436a=>!this['_hasTable'](_0x57436a));if(_0x13e82a['length']>0x0)throw S('SQLite\x20collaboration\x20core\x20schema\x20v1\x20is\x20incomplete:\x20missing\x20'+_0x13e82a['join'](',\x20'));return;}if(this['_hasAnyCoreTable']())throw S('SQLite\x20collaboration\x20core\x20tables\x20exist\x20without\x20a\x20schema\x20version');this['_database']['exec']('\x0a\x20\x20\x20\x20\x20\x20\x20\x20CREATE\x20TABLE\x20collaboration_units\x20(\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20unit_id\x20TEXT\x20PRIMARY\x20KEY,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20type\x20INTEGER\x20NOT\x20NULL,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20head_revision\x20INTEGER\x20NOT\x20NULL\x20CHECK\x20(head_revision\x20>=\x201),\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20soft_deleted_at_ms\x20INTEGER\x0a\x20\x20\x20\x20\x20\x20\x20\x20);\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20CREATE\x20TABLE\x20collaboration_unit_tombstones\x20(\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20unit_id\x20TEXT\x20PRIMARY\x20KEY,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20purged_at\x20INTEGER\x20NOT\x20NULL\x0a\x20\x20\x20\x20\x20\x20\x20\x20);\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20CREATE\x20TABLE\x20collaboration_snapshots\x20(\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20unit_id\x20TEXT\x20NOT\x20NULL,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20revision\x20INTEGER\x20NOT\x20NULL\x20CHECK\x20(revision\x20>=\x201),\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20type\x20INTEGER\x20NOT\x20NULL,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20payload_json\x20TEXT\x20NOT\x20NULL,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20PRIMARY\x20KEY\x20(unit_id,\x20revision),\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20FOREIGN\x20KEY\x20(unit_id)\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20REFERENCES\x20collaboration_units(unit_id)\x20ON\x20DELETE\x20CASCADE\x0a\x20\x20\x20\x20\x20\x20\x20\x20);\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20CREATE\x20TABLE\x20collaboration_changesets\x20(\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20unit_id\x20TEXT\x20NOT\x20NULL,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20revision\x20INTEGER\x20NOT\x20NULL\x20CHECK\x20(revision\x20>=\x202),\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20base_revision\x20INTEGER\x20NOT\x20NULL\x20CHECK\x20(base_revision\x20>=\x201),\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20sid\x20TEXT\x20NOT\x20NULL,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20req_id\x20INTEGER\x20NOT\x20NULL\x20CHECK\x20(req_id\x20>=\x201),\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20payload_json\x20TEXT\x20NOT\x20NULL,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20PRIMARY\x20KEY\x20(unit_id,\x20revision),\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20UNIQUE\x20(unit_id,\x20sid,\x20req_id),\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20FOREIGN\x20KEY\x20(unit_id)\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20REFERENCES\x20collaboration_units(unit_id)\x20ON\x20DELETE\x20CASCADE\x0a\x20\x20\x20\x20\x20\x20\x20\x20);\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20CREATE\x20TABLE\x20collaboration_sheet_blocks\x20(\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20unit_id\x20TEXT\x20NOT\x20NULL,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20block_id\x20TEXT\x20NOT\x20NULL,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20payload_json\x20TEXT\x20NOT\x20NULL,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20PRIMARY\x20KEY\x20(unit_id,\x20block_id),\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20FOREIGN\x20KEY\x20(unit_id)\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20REFERENCES\x20collaboration_units(unit_id)\x20ON\x20DELETE\x20CASCADE\x0a\x20\x20\x20\x20\x20\x20\x20\x20);\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20CREATE\x20TABLE\x20collaboration_resources\x20(\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20unit_id\x20TEXT\x20NOT\x20NULL,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20resource_id\x20TEXT\x20NOT\x20NULL,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20payload_json\x20TEXT\x20NOT\x20NULL,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20PRIMARY\x20KEY\x20(unit_id,\x20resource_id),\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20FOREIGN\x20KEY\x20(unit_id)\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20REFERENCES\x20collaboration_units(unit_id)\x20ON\x20DELETE\x20CASCADE\x0a\x20\x20\x20\x20\x20\x20\x20\x20);\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20CREATE\x20INDEX\x20collaboration_snapshots_nearest_revision\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20ON\x20collaboration_snapshots(unit_id,\x20revision\x20DESC);\x0a\x20\x20\x20\x20\x20\x20\x20\x20CREATE\x20INDEX\x20collaboration_changesets_revision_range\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20ON\x20collaboration_changesets(unit_id,\x20revision\x20ASC);\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20INSERT\x20INTO\x20collaboration_schema_versions\x20(component,\x20version)\x0a\x20\x20\x20\x20\x20\x20\x20\x20VALUES\x20(\x27core\x27,\x201);\x0a\x20\x20\x20\x20\x20\x20');});}['_getActiveUnitRow'](_0x4be0be){return this['_database']['prepare']('SELECT\x20unit_id,\x20type,\x20head_revision,\x20soft_deleted_at_ms\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20FROM\x20collaboration_units\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20WHERE\x20unit_id\x20=\x20?\x20AND\x20soft_deleted_at_ms\x20IS\x20NULL')['get'](_0x4be0be)??null;}['_getStoredUnitRow'](_0x43834d){return this['_database']['prepare']('SELECT\x20unit_id,\x20type,\x20head_revision,\x20soft_deleted_at_ms\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20FROM\x20collaboration_units\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20WHERE\x20unit_id\x20=\x20?')['get'](_0x43834d)??null;}['_hasTombstone'](_0x227069){return!!this['_database']['prepare']('SELECT\x201\x20FROM\x20collaboration_unit_tombstones\x20WHERE\x20unit_id\x20=\x20?')['get'](_0x227069);}['_hasTable'](_0x8595f0){return!!this['_database']['prepare']('SELECT\x201\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20FROM\x20sqlite_schema\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20WHERE\x20type\x20=\x20\x27table\x27\x20AND\x20name\x20=\x20?')['get'](_0x8595f0);}['_hasAnyCoreTable'](){return m['some'](_0x370e24=>this['_hasTable'](_0x370e24));}['_writeDependencies'](_0x2f6d79,_0x231805,_0x559e5b){let _0x3ae1c4=this['_database']['prepare']('INSERT\x20INTO\x20collaboration_sheet_blocks\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20(unit_id,\x20block_id,\x20payload_json)\x0a\x20\x20\x20\x20\x20\x20\x20VALUES\x20(?,\x20?,\x20?)\x0a\x20\x20\x20\x20\x20\x20\x20ON\x20CONFLICT(unit_id,\x20block_id)\x20DO\x20UPDATE\x20SET\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20payload_json\x20=\x20excluded.payload_json');for(let _0xb91522 of _0x231805)_0x3ae1c4['run'](_0x2f6d79,_0xb91522['id'],_0xb91522['payload']);let _0x275408=this['_database']['prepare']('INSERT\x20INTO\x20collaboration_resources\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20(unit_id,\x20resource_id,\x20payload_json)\x0a\x20\x20\x20\x20\x20\x20\x20VALUES\x20(?,\x20?,\x20?)\x0a\x20\x20\x20\x20\x20\x20\x20ON\x20CONFLICT(unit_id,\x20resource_id)\x20DO\x20UPDATE\x20SET\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20payload_json\x20=\x20excluded.payload_json');for(let _0x2c35a2 of _0x559e5b)_0x275408['run'](_0x2f6d79,_0x2c35a2['resourceID'],_0x2c35a2['payload']);}['_transaction'](_0x2b2a70){this['_database']['exec']('BEGIN\x20IMMEDIATE;');try{let _0x5b9041=_0x2b2a70();return this['_database']['exec']('COMMIT;'),_0x5b9041;}catch(_0x413f9f){throw this['_database']['inTransaction']&&this['_database']['exec']('ROLLBACK;'),_0x413f9f;}}['_assertOpen'](){if(this['_disposed'])throw new l['CollabError']('INTERNAL_ERROR','SQLite\x20Database\x20Adapter\x20is\x20disposed');}};function g(_0x2414c8){if(!_0x2414c8['filename'])throw x('SQLite\x20filename\x20is\x20required');if(_0x2414c8['busyTimeoutMs']!==void 0x0&&(!Number['isSafeInteger'](_0x2414c8['busyTimeoutMs'])||_0x2414c8['busyTimeoutMs']<0x0))throw x('SQLite\x20busyTimeoutMs\x20must\x20be\x20a\x20non-negative\x20integer');}function _(_0x1ae95b){let {record:_0x12b9c5,snapshot:_0x2525b6}=_0x1ae95b;if(_0x12b9c5['headRevision']!==0x1||_0x2525b6['rev']!==0x1||_0x2525b6['unitID']!==_0x12b9c5['unitID']||_0x2525b6['type']!==_0x12b9c5['type'])throw x('Initial\x20unit\x20record\x20and\x20snapshot\x20must\x20match\x20at\x20revision\x201');}function v(_0x30d48a){if(!_0x30d48a['sid']||!Number['isSafeInteger'](_0x30d48a['reqId'])||_0x30d48a['reqId']<0x1)throw x('Changeset\x20sid\x20and\x20positive\x20integer\x20reqId\x20are\x20required');}function y(_0xdd74a8,_0x3a5e5a){let {changeset:_0x481bb5,expectedHeadRevision:_0x977ddd}=_0x3a5e5a;if(_0x481bb5['type']!==_0xdd74a8['type']||_0x481bb5['baseRev']!==_0x977ddd||_0x481bb5['revision']!==_0x977ddd+0x1)throw x('Confirmed\x20changeset\x20must\x20match\x20the\x20unit\x20type\x20and\x20expected\x20revision');}function b(_0x33f6ee){return{'unitID':_0x33f6ee['unit_id'],'type':_0x33f6ee['type'],'headRevision':_0x33f6ee['head_revision']};}function x(_0x2f5ff8){return new l['CollabError']('INVALID_REQUEST',_0x2f5ff8);}function S(_0x68e62b){return new l['CollabError']('INTERNAL_ERROR',_0x68e62b);}function C(_0x6fbef0){return[...new Set(_0x6fbef0)];}function w(_0x569cc3){return JSON['stringify'](_0x569cc3,(_0x4f4018,_0x308330)=>_0x308330 instanceof Uint8Array?{[d]:Buffer['from'](_0x308330)['toString']('base64')}:_0x308330);}function T(_0x18979b){return JSON['parse'](_0x18979b,(_0x225eda,_0x110a0e)=>E(_0x110a0e)?Uint8Array['from'](Buffer['from'](_0x110a0e[d],'base64')):_0x110a0e);}function E(_0xa8d191){return typeof _0xa8d191=='object'&&!!_0xa8d191&&Object['keys'](_0xa8d191)['length']===0x1&&typeof _0xa8d191[d]=='string';}exports['SQLiteDatabaseAdapter']=h;
|
package/dist/index.d.ts
CHANGED
|
@@ -31,6 +31,8 @@ declare class SQLiteDatabaseAdapter implements IDatabaseAdapter {
|
|
|
31
31
|
private _getActiveUnitRow;
|
|
32
32
|
private _getStoredUnitRow;
|
|
33
33
|
private _hasTombstone;
|
|
34
|
+
private _hasTable;
|
|
35
|
+
private _hasAnyCoreTable;
|
|
34
36
|
private _writeDependencies;
|
|
35
37
|
private _transaction;
|
|
36
38
|
private _assertOpen;
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const _0x1d1a58=_0x1bfe;(function(_0x22b2fb,_0x333ca5){const _0x362f6b=_0x1bfe,_0xbb2ebf=_0x22b2fb();while(!![]){try{const _0x36dd31=-parseInt(_0x362f6b(0x14d))/0x1*(parseInt(_0x362f6b(0x14e))/0x2)+-parseInt(_0x362f6b(0x155))/0x3+-parseInt(_0x362f6b(0x156))/0x4+parseInt(_0x362f6b(0x153))/0x5*(-parseInt(_0x362f6b(0x150))/0x6)+parseInt(_0x362f6b(0x152))/0x7+-parseInt(_0x362f6b(0x158))/0x8*(-parseInt(_0x362f6b(0x151))/0x9)+parseInt(_0x362f6b(0x154))/0xa*(parseInt(_0x362f6b(0x157))/0xb);if(_0x36dd31===_0x333ca5)break;else _0xbb2ebf['push'](_0xbb2ebf['shift']());}catch(_0x5bd839){_0xbb2ebf['push'](_0xbb2ebf['shift']());}}}(_0x2db5,0xb84c2));import _0x4e8b0b from'./index.cjs';function _0x1bfe(_0x1a3191,_0x25e9c6){_0x1a3191=_0x1a3191-0x14d;const _0x2db50d=_0x2db5();let _0x1bfe6b=_0x2db50d[_0x1a3191];return _0x1bfe6b;}const facadeExport0=_0x4e8b0b[_0x1d1a58(0x14f)];function _0x2db5(){const _0x39fe1a=['401764VCzHPZ','18073FwBzXj','530744ivjBBN','38651jbwKxk','58qoaFRI','SQLiteDatabaseAdapter','2874Nhjcau','189NpkaWg','5447029rGpQqz','8815aAhdgU','5290jVrpZd','659454ZAmick'];_0x2db5=function(){return _0x39fe1a;};return _0x2db5();}export{facadeExport0 as SQLiteDatabaseAdapter};
|
package/package.json
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
"name": "@univerjs-pro/collaboration-database-sqlite",
|
|
3
3
|
"type": "module",
|
|
4
4
|
"engines": {
|
|
5
|
-
"node": ">=
|
|
5
|
+
"node": ">=22"
|
|
6
6
|
},
|
|
7
|
-
"version": "1.0.0-insiders.
|
|
7
|
+
"version": "1.0.0-insiders.20260803-82dc67d",
|
|
8
8
|
"main": "./dist/index.cjs",
|
|
9
9
|
"module": "./dist/index.mjs",
|
|
10
10
|
"types": "./dist/index.d.ts",
|
|
@@ -19,8 +19,9 @@
|
|
|
19
19
|
"dist"
|
|
20
20
|
],
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@univerjs-pro/collaboration-service": "1.0.0-insiders.
|
|
23
|
-
"@univerjs/protocol": "1.0.0-insiders.
|
|
22
|
+
"@univerjs-pro/collaboration-service": "1.0.0-insiders.20260803-82dc67d",
|
|
23
|
+
"@univerjs/protocol": "1.0.0-insiders.20260803-82dc67d",
|
|
24
|
+
"libsql": "^0.5.29"
|
|
24
25
|
},
|
|
25
26
|
"publishConfig": {
|
|
26
27
|
"access": "public"
|