@univerjs-pro/collaboration-database-memory 1.0.0-insiders.20260808-70eefdd → 1.0.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/README.md ADDED
@@ -0,0 +1,35 @@
1
+ # @univerjs-pro/collaboration-database-memory
2
+
3
+ English | [简体中文](./README.zh-CN.md)
4
+
5
+ An in-process `IDatabaseAdapter` for tests, local development, and temporary collaboration services.
6
+
7
+ ## Create the Adapter
8
+
9
+ ```bash
10
+ pnpm add \
11
+ @univerjs-pro/collaboration-service \
12
+ @univerjs-pro/collaboration-database-memory
13
+ ```
14
+
15
+ ```ts
16
+ import { MemoryDatabaseAdapter } from '@univerjs-pro/collaboration-database-memory';
17
+ import { UniverCollabService } from '@univerjs-pro/collaboration-service';
18
+
19
+ const database = new MemoryDatabaseAdapter();
20
+ const service = new UniverCollabService({ dbAdapter: database });
21
+
22
+ await service.dispose();
23
+ await database.dispose();
24
+ ```
25
+
26
+ Pass the Adapter to `UniverCollabService` as `dbAdapter`.
27
+
28
+ It follows the same collaboration persistence contract as the SQLite Adapter, including revision CAS, revisioned snapshots, Sheet blocks, and atomic Unit lifecycle batches. Submission idempotency is resolved by the Service from continuous changeset history, not by the Adapter.
29
+
30
+ ## Limitations
31
+
32
+ - All data is lost when the process exits.
33
+ - State is not shared between Node.js processes.
34
+ - It is intended only for tests and temporary environments, not persistent production data.
35
+ - Hard delete removes core Unit data from the current process and retains a permanent deletion marker that prevents ID reuse.
@@ -0,0 +1,37 @@
1
+ # @univerjs-pro/collaboration-database-memory
2
+
3
+ [English](./README.md) | [简体中文](./README.zh-CN.md)
4
+
5
+ 进程内 `IDatabaseAdapter`,适合测试、本地开发和临时协同服务。
6
+
7
+ ## 创建 Adapter
8
+
9
+ ```bash
10
+ pnpm add \
11
+ @univerjs-pro/collaboration-service \
12
+ @univerjs-pro/collaboration-database-memory
13
+ ```
14
+
15
+ ```ts
16
+ import { MemoryDatabaseAdapter } from '@univerjs-pro/collaboration-database-memory';
17
+ import { UniverCollabService } from '@univerjs-pro/collaboration-service';
18
+
19
+ const database = new MemoryDatabaseAdapter();
20
+ const service = new UniverCollabService({ dbAdapter: database });
21
+
22
+ await service.dispose();
23
+ await database.dispose();
24
+ ```
25
+
26
+ 将 Adapter 作为 `dbAdapter` 传给 `UniverCollabService`。
27
+
28
+ 它与 SQLite Adapter 遵守相同的协同持久化契约,包括 revision CAS、revisioned
29
+ snapshot、Sheet blocks 和原子 Unit 生命周期批次。提交幂等由 Service 从连续
30
+ changeset history 中判断,不由 Adapter 维护 submission 索引。
31
+
32
+ ## 限制
33
+
34
+ - 进程退出后全部数据丢失。
35
+ - 多个 Node.js 进程之间不共享状态。
36
+ - 只适合测试和临时环境,不适合持久化生产数据。
37
+ - hard delete 会清理当前进程中的核心 Unit 数据,并保留永久删除标记以禁止 ID 复用。
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- Object['defineProperty'](exports,Symbol['toStringTag'],{'value':'Module'});let e=require('@univerjs-pro/collaboration-service');var t=class{['_units']=new Map();['_tombstones']=new Set();['_disposed']=!0x1;async['getUnit'](_0x358cc6,_0x31e16a){this['_assertOpen']();let _0x3be05b=this['_activeUnit'](_0x31e16a);return _0x3be05b?d(_0x3be05b['record']):null;}async['getSnapshot'](_0xc26bc,_0x372c1d,_0x55ba8e){this['_assertOpen']();let _0x68178=this['_activeUnit'](_0x372c1d);if(!_0x68178)return null;let _0x7cc6f4=_0x55ba8e?.['revision'],_0x5b1141=_0x7cc6f4===void 0x0||_0x7cc6f4===0x0?_0x68178['record']['headRevision']:Math['min'](_0x7cc6f4,_0x68178['record']['headRevision']),_0x4665ab=-0x1;for(let _0x158eb6 of _0x68178['snapshots']['keys']())_0x158eb6<=_0x5b1141&&_0x158eb6>_0x4665ab&&(_0x4665ab=_0x158eb6);let _0x2fcc8e=_0x68178['snapshots']['get'](_0x4665ab);return _0x2fcc8e?d(_0x2fcc8e):null;}async['getChangesets'](_0x20a8e0,_0x2007c1,_0x1f4e8d){if(this['_assertOpen'](),_0x1f4e8d['from']<0x0||_0x1f4e8d['to']<0x0)throw c('Changeset\x20range\x20revisions\x20cannot\x20be\x20negative');let _0x13fa03=this['_activeUnit'](_0x2007c1);if(!_0x13fa03)return{'changesets':[],'latestRevision':0x0};let _0x4934d4=_0x1f4e8d['to']===0x0?_0x13fa03['record']['headRevision']:Math['min'](_0x1f4e8d['to'],_0x13fa03['record']['headRevision']);return{'changesets':[..._0x13fa03['changesets']['entries']()]['filter'](([_0x21e106])=>_0x21e106>_0x1f4e8d['from']&&_0x21e106<=_0x4934d4)['sort'](([_0x2109df],[_0x2e6bc4])=>_0x2109df-_0x2e6bc4)['map'](([,_0xeceabd])=>d(_0xeceabd)),'latestRevision':_0x13fa03['record']['headRevision']};}async['getSubmission'](_0x2dd77b,_0x1f44ff,_0x399a94,_0x411ff8){this['_assertOpen']();let _0x199192=this['_activeUnit'](_0x1f44ff)?.['submissions']['get'](s(_0x399a94,_0x411ff8));return _0x199192?d(_0x199192):null;}async['createUnit'](_0x116dc1,_0x3ca005){this['_assertOpen'](),n(_0x3ca005);let _0x5ed5f6=this['_units']['get'](_0x3ca005['record']['unitID']);if(_0x5ed5f6){if(_0x5ed5f6['lifecycle']==='soft-deleted')throw c('A\x20soft-deleted\x20unit\x20ID\x20cannot\x20be\x20reused');return{'status':'already-exists','record':d(_0x5ed5f6['record'])};}if(this['_tombstones']['has'](_0x3ca005['record']['unitID']))throw c('A\x20purged\x20unit\x20ID\x20cannot\x20be\x20reused');let _0x3c4f67=a(_0x3ca005['sheetBlocks']),_0x709a62={'record':d(_0x3ca005['record']),'lifecycle':'active','snapshots':new Map([[0x1,d(_0x3ca005['snapshot'])]]),'changesets':new Map(),'submissions':new Map(),'sheetBlocks':_0x3c4f67};return this['_units']['set'](_0x3ca005['record']['unitID'],_0x709a62),{'status':'created','record':d(_0x709a62['record'])};}async['deleteUnits'](_0x5e5215,_0x41b3d1){this['_assertOpen']();let _0x14a7fa=u(_0x41b3d1['unitIDs'])['map'](_0x2b3326=>{let _0x3f8c2c=this['_units']['get'](_0x2b3326);if(_0x41b3d1['hardDelete']){if(_0x3f8c2c)return{'unitID':_0x2b3326,'stored':_0x3f8c2c,'status':'hard-deleted'};if(this['_tombstones']['has'](_0x2b3326))return{'unitID':_0x2b3326,'status':'already-hard-deleted'};throw l('Cannot\x20hard-delete\x20a\x20missing\x20unit');}if(!_0x3f8c2c||this['_tombstones']['has'](_0x2b3326))throw l('Cannot\x20soft-delete\x20a\x20missing\x20unit');return{'unitID':_0x2b3326,'stored':_0x3f8c2c,'status':_0x3f8c2c['lifecycle']==='active'?'soft-deleted':'already-soft-deleted'};});for(let _0x5bb1cb of _0x14a7fa)_0x41b3d1['hardDelete']&&_0x5bb1cb['status']==='hard-deleted'?(this['_units']['delete'](_0x5bb1cb['unitID']),this['_tombstones']['add'](_0x5bb1cb['unitID'])):!_0x41b3d1['hardDelete']&&_0x5bb1cb['stored']&&(_0x5bb1cb['stored']['lifecycle']='soft-deleted');return{'units':_0x14a7fa['map'](({unitID:_0x40c48a,status:_0x3155b2})=>({'unitID':_0x40c48a,'status':_0x3155b2}))};}async['recoverUnits'](_0x4e80c3,_0x1187e1){this['_assertOpen']();let _0x3fdfa0=u(_0x1187e1['unitIDs'])['map'](_0x71dbaf=>{if(this['_tombstones']['has'](_0x71dbaf))throw c('A\x20purged\x20unit\x20cannot\x20be\x20recovered');let _0x1a58b1=this['_units']['get'](_0x71dbaf);if(!_0x1a58b1)throw l('Cannot\x20recover\x20a\x20missing\x20unit');return{'unitID':_0x71dbaf,'stored':_0x1a58b1,'status':_0x1a58b1['lifecycle']==='active'?'already-active':'recovered'};});for(let _0x21660c of _0x3fdfa0)_0x21660c['stored']['lifecycle']='active';return{'units':_0x3fdfa0['map'](({unitID:_0x297ef1,status:_0x5ecd16})=>({'unitID':_0x297ef1,'status':_0x5ecd16}))};}async['commitChangeset'](_0x535643,_0x542cc6){this['_assertOpen']();let {changeset:_0x121256,expectedHeadRevision:_0x36d27c}=_0x542cc6,_0x271b85=this['_activeUnit'](_0x121256['unitID']);if(!_0x271b85)throw l('Cannot\x20commit\x20to\x20a\x20missing\x20unit');r(_0x121256);let _0x306321=s(_0x121256['sid'],_0x121256['reqId']),_0x521513=_0x271b85['submissions']['get'](_0x306321);if(_0x521513)return{'status':'already-committed','changeset':d(_0x521513)};if(_0x271b85['record']['headRevision']!==_0x36d27c)return{'status':'revision-mismatch','actualHeadRevision':_0x271b85['record']['headRevision']};i(_0x271b85['record'],_0x542cc6);let _0x4ff4e5=d(_0x121256);return _0x271b85['changesets']['set'](_0x4ff4e5['revision'],_0x4ff4e5),_0x271b85['submissions']['set'](_0x306321,_0x4ff4e5),_0x271b85['record']={..._0x271b85['record'],'headRevision':_0x4ff4e5['revision']},{'status':'committed','changeset':d(_0x4ff4e5),'headRevision':_0x271b85['record']['headRevision']};}async['saveSnapshot'](_0x27f003,_0x302731){this['_assertOpen']();let _0x196032=this['_activeUnit'](_0x302731['snapshot']['unitID']);if(!_0x196032)throw l('Cannot\x20snapshot\x20a\x20missing\x20unit');if(_0x302731['snapshot']['type']!==_0x196032['record']['type']||_0x302731['snapshot']['rev']<0x1||_0x302731['snapshot']['rev']>_0x196032['record']['headRevision'])throw c('Snapshot\x20does\x20not\x20match\x20the\x20stored\x20unit\x20head');let _0x5cad19=d(_0x302731['snapshot']);o(_0x196032,a(_0x302731['sheetBlocks'])),_0x196032['snapshots']['set'](_0x5cad19['rev'],_0x5cad19);}async['getSheetBlock'](_0x13dc4e,_0x4efec1,_0x2b1a53){this['_assertOpen']();let _0x38a564=this['_activeUnit'](_0x4efec1)?.['sheetBlocks']['get'](_0x2b1a53);return _0x38a564?d(_0x38a564):null;}async['dispose'](){this['_disposed']||(this['_disposed']=!0x0,this['_units']['clear'](),this['_tombstones']['clear']());}['_activeUnit'](_0x2cece8){let _0x159829=this['_units']['get'](_0x2cece8);return _0x159829?.['lifecycle']==='active'?_0x159829:void 0x0;}['_assertOpen'](){if(this['_disposed'])throw new e['CollabError']('INTERNAL_ERROR','Memory\x20Database\x20Adapter\x20is\x20disposed');}};function n(_0x2a7812){let {record:_0x1a950,snapshot:_0x1baeec}=_0x2a7812;if(_0x1a950['headRevision']!==0x1||_0x1baeec['rev']!==0x1||_0x1baeec['unitID']!==_0x1a950['unitID']||_0x1baeec['type']!==_0x1a950['type'])throw c('Initial\x20unit\x20record\x20and\x20snapshot\x20must\x20match\x20at\x20revision\x201');}function r(_0xc86625){if(!_0xc86625['sid']||!Number['isSafeInteger'](_0xc86625['reqId'])||_0xc86625['reqId']<0x1)throw c('Changeset\x20sid\x20and\x20positive\x20integer\x20reqId\x20are\x20required');}function i(_0x3dd65f,_0x559a3f){let {changeset:_0x21d1e0,expectedHeadRevision:_0x101d8d}=_0x559a3f;if(_0x21d1e0['type']!==_0x3dd65f['type']||_0x21d1e0['baseRev']!==_0x101d8d||_0x21d1e0['revision']!==_0x101d8d+0x1)throw c('Confirmed\x20changeset\x20must\x20match\x20the\x20unit\x20type\x20and\x20expected\x20revision');}function a(_0x52d426){let _0x4a21f2=new Map();for(let _0x528c1 of _0x52d426??[])_0x4a21f2['set'](_0x528c1['id'],d(_0x528c1));return _0x4a21f2;}function o(_0x129877,_0x46f2cd){for(let [_0x251c0e,_0x522df5]of _0x46f2cd)_0x129877['sheetBlocks']['set'](_0x251c0e,_0x522df5);}function s(_0x451326,_0xbd259d){return _0x451326['length']+':'+_0x451326+':'+_0xbd259d;}function c(_0xc8ada5){return new e['CollabError']('INVALID_REQUEST',_0xc8ada5);}function l(_0xc6a458){return new e['CollabError']('UNIT_NOT_FOUND',_0xc6a458);}function u(_0x4b099b){return[...new Set(_0x4b099b)];}function d(_0x3f96ff){return structuredClone(_0x3f96ff);}exports['MemoryDatabaseAdapter']=t;
1
+ Object['defineProperty'](exports,Symbol['toStringTag'],{'value':'Module'});let e=require('@univerjs-pro/collaboration-service');var t=class{['_units']=new Map();['_tombstones']=new Set();['_disposed']=!0x1;async['getUnit'](_0x117cf3,_0x54041c){this['_assertOpen']();let _0x4fea26=this['_activeUnit'](_0x54041c);return _0x4fea26?c(_0x4fea26['record']):null;}async['getSnapshot'](_0x309c3c,_0x13eeba,_0x4b015a){let _0x4364cd=this['_getSnapshot'](_0x13eeba,_0x4b015a);return _0x4364cd?c(_0x4364cd):null;}async['getSnapshotInfo'](_0x2d92e6,_0x11ac15,_0xc7184a){let _0xe12c5=this['_getSnapshot'](_0x11ac15,_0xc7184a);return _0xe12c5?{'unitID':_0xe12c5['unitID'],'type':_0xe12c5['type'],'rev':_0xe12c5['rev']}:null;}['_getSnapshot'](_0x2b6ec7,_0x1db9fa){this['_assertOpen']();let _0xd74d20=this['_activeUnit'](_0x2b6ec7);if(!_0xd74d20)return null;let _0x239611=_0x1db9fa?.['revision'],_0x13d9bd=_0x239611===void 0x0?_0xd74d20['record']['headRevision']:Math['min'](_0x239611,_0xd74d20['record']['headRevision']),_0x456d3b=-0x1;for(let _0x490b77 of _0xd74d20['snapshots']['keys']())_0x490b77<=_0x13d9bd&&_0x490b77>_0x456d3b&&(_0x456d3b=_0x490b77);return _0xd74d20['snapshots']['get'](_0x456d3b)??null;}async['getChangesets'](_0x1bb9bd,_0x178bdb,_0x5882d4){if(this['_assertOpen'](),_0x5882d4['from']<0x0||_0x5882d4['to']!==void 0x0&&_0x5882d4['to']<0x0)throw a('Changeset\x20range\x20revisions\x20cannot\x20be\x20negative');let _0x15abb=this['_activeUnit'](_0x178bdb);return _0x15abb?[..._0x15abb['changesets']['entries']()]['filter'](([_0x4adf40])=>_0x4adf40>_0x5882d4['from']&&(_0x5882d4['to']===void 0x0||_0x4adf40<=_0x5882d4['to']))['sort'](([_0x5b17a7],[_0x13001b])=>_0x5b17a7-_0x13001b)['map'](([,_0x12fe5e])=>c(_0x12fe5e)):null;}async['createUnit'](_0x43284d,_0x1a598f){this['_assertOpen'](),n(_0x1a598f);let _0x5620c6=this['_units']['get'](_0x1a598f['record']['unitID']);if(_0x5620c6){if(_0x5620c6['lifecycle']==='soft-deleted')throw a('A\x20soft-deleted\x20unit\x20ID\x20cannot\x20be\x20reused');return{'status':'already-exists','record':c(_0x5620c6['record'])};}if(this['_tombstones']['has'](_0x1a598f['record']['unitID']))throw a('A\x20purged\x20unit\x20ID\x20cannot\x20be\x20reused');let _0x329686=r(_0x1a598f['sheetBlocks']),_0x73be53={'record':c(_0x1a598f['record']),'lifecycle':'active','snapshots':new Map([[0x1,c(_0x1a598f['snapshot'])]]),'changesets':new Map(),'sheetBlocks':_0x329686};return this['_units']['set'](_0x1a598f['record']['unitID'],_0x73be53),{'status':'created','record':c(_0x73be53['record'])};}async['deleteUnits'](_0x3b1a18,_0x570476){this['_assertOpen']();let _0x4469ba=s(_0x570476['unitIDs'])['map'](_0x48b784=>{let _0x28e9ea=this['_units']['get'](_0x48b784);if(_0x570476['hardDelete']){if(_0x28e9ea)return{'unitID':_0x48b784,'stored':_0x28e9ea,'status':'hard-deleted'};if(this['_tombstones']['has'](_0x48b784))return{'unitID':_0x48b784,'status':'already-hard-deleted'};throw o('Cannot\x20hard-delete\x20a\x20missing\x20unit');}if(!_0x28e9ea||this['_tombstones']['has'](_0x48b784))throw o('Cannot\x20soft-delete\x20a\x20missing\x20unit');return{'unitID':_0x48b784,'stored':_0x28e9ea,'status':_0x28e9ea['lifecycle']==='active'?'soft-deleted':'already-soft-deleted'};});for(let _0x1279fd of _0x4469ba)_0x570476['hardDelete']&&_0x1279fd['status']==='hard-deleted'?(this['_units']['delete'](_0x1279fd['unitID']),this['_tombstones']['add'](_0x1279fd['unitID'])):!_0x570476['hardDelete']&&_0x1279fd['stored']&&(_0x1279fd['stored']['lifecycle']='soft-deleted');return{'units':_0x4469ba['map'](({unitID:_0x5be03b,status:_0x17a3b8})=>({'unitID':_0x5be03b,'status':_0x17a3b8}))};}async['recoverUnits'](_0x394f70,_0x3ff391){this['_assertOpen']();let _0x2d50b3=s(_0x3ff391['unitIDs'])['map'](_0xedf7e1=>{if(this['_tombstones']['has'](_0xedf7e1))throw a('A\x20purged\x20unit\x20cannot\x20be\x20recovered');let _0x568097=this['_units']['get'](_0xedf7e1);if(!_0x568097)throw o('Cannot\x20recover\x20a\x20missing\x20unit');return{'unitID':_0xedf7e1,'stored':_0x568097,'status':_0x568097['lifecycle']==='active'?'already-active':'recovered'};});for(let _0xbdec78 of _0x2d50b3)_0xbdec78['stored']['lifecycle']='active';return{'units':_0x2d50b3['map'](({unitID:_0x46d54b,status:_0x31802c})=>({'unitID':_0x46d54b,'status':_0x31802c}))};}async['commitChangeset'](_0x581099,_0x32a8fc){this['_assertOpen']();let {changeset:_0x62ab17}=_0x32a8fc,_0x1d5c5f=this['_activeUnit'](_0x62ab17['unitID']);if(!_0x1d5c5f)throw o('Cannot\x20commit\x20to\x20a\x20missing\x20unit');if(_0x1d5c5f['record']['headRevision']!==_0x62ab17['revision']-0x1)return{'status':'revision-mismatch','actualHeadRevision':_0x1d5c5f['record']['headRevision']};let _0xfe9731=c(_0x62ab17);return _0xfe9731['createTime']=Math['floor'](Date['now']()/0x3e8),_0x1d5c5f['changesets']['set'](_0xfe9731['revision'],_0xfe9731),_0x1d5c5f['record']={..._0x1d5c5f['record'],'headRevision':_0xfe9731['revision']},{'status':'committed','changeset':c(_0xfe9731),'headRevision':_0x1d5c5f['record']['headRevision']};}async['saveSnapshot'](_0x1e41c0,_0x2beaca){this['_assertOpen']();let _0x2d3f87=this['_activeUnit'](_0x2beaca['snapshot']['unitID']);if(!_0x2d3f87)throw o('Cannot\x20snapshot\x20a\x20missing\x20unit');if(_0x2beaca['snapshot']['type']!==_0x2d3f87['record']['type']||_0x2beaca['snapshot']['rev']<0x1||_0x2beaca['snapshot']['rev']>_0x2d3f87['record']['headRevision'])throw a('Snapshot\x20does\x20not\x20match\x20the\x20stored\x20unit\x20head');let _0x516d4c=c(_0x2beaca['snapshot']);i(_0x2d3f87,r(_0x2beaca['sheetBlocks'])),_0x2d3f87['snapshots']['set'](_0x516d4c['rev'],_0x516d4c);}async['getSheetBlock'](_0x43f201,_0x67b105,_0x1e22be){this['_assertOpen']();let _0x3d436a=this['_activeUnit'](_0x67b105)?.['sheetBlocks']['get'](_0x1e22be);return _0x3d436a?c(_0x3d436a):null;}async['dispose'](){this['_disposed']||(this['_disposed']=!0x0,this['_units']['clear'](),this['_tombstones']['clear']());}['_activeUnit'](_0x1c3c12){let _0x26a7a4=this['_units']['get'](_0x1c3c12);return _0x26a7a4?.['lifecycle']==='active'?_0x26a7a4:void 0x0;}['_assertOpen'](){if(this['_disposed'])throw new e['CollabError']('INTERNAL_ERROR','Memory\x20Database\x20Adapter\x20is\x20disposed');}};function n(_0x36bad8){let {record:_0x48457f,snapshot:_0x525d41}=_0x36bad8;if(_0x48457f['headRevision']!==0x1||_0x525d41['rev']!==0x1||_0x525d41['unitID']!==_0x48457f['unitID']||_0x525d41['type']!==_0x48457f['type'])throw a('Initial\x20unit\x20record\x20and\x20snapshot\x20must\x20match\x20at\x20revision\x201');if(typeof _0x48457f['creatorID']!='string'||_0x48457f['creatorID']['length']===0x0||!Number['isSafeInteger'](_0x48457f['createdAt'])||_0x48457f['createdAt']<0x0)throw a('Unit\x20creation\x20requires\x20creatorID\x20and\x20createdAt\x20in\x20Unix\x20milliseconds');}function r(_0x52b1ea){let _0x3933e8=new Map();for(let _0x3485e1 of _0x52b1ea??[])_0x3933e8['set'](_0x3485e1['id'],c(_0x3485e1));return _0x3933e8;}function i(_0x4e4f95,_0xf8c7ef){for(let [_0x15445e,_0x120e94]of _0xf8c7ef)_0x4e4f95['sheetBlocks']['set'](_0x15445e,_0x120e94);}function a(_0x25f607){return new e['CollabError']('INVALID_REQUEST',_0x25f607);}function o(_0xe7be7){return new e['CollabError']('UNIT_NOT_FOUND',_0xe7be7);}function s(_0x2f644d){return[...new Set(_0x2f644d)];}function c(_0x5402dd){return structuredClone(_0x5402dd);}exports['MemoryDatabaseAdapter']=t;
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { ChangesetRange, CommitChangesetInput, CommitChangesetResult, CreateUnitDatabaseInput, CreateUnitDatabaseResult, DatabaseContext, DeleteUnitsDatabaseInput, DeleteUnitsDatabaseResult, IDatabaseAdapter, RecoverUnitsDatabaseInput, RecoverUnitsDatabaseResult, SaveSnapshotInput, UnitRecord } from "@univerjs-pro/collaboration-service";
1
+ import { CommitChangesetInput, CommitChangesetResult, CreateUnitDatabaseInput, CreateUnitDatabaseResult, DatabaseContext, DeleteUnitsDatabaseInput, DeleteUnitsDatabaseResult, IDatabaseAdapter, RecoverUnitsDatabaseInput, RecoverUnitsDatabaseResult, SaveSnapshotInput, SnapshotInfo, UnitRecord } from "@univerjs-pro/collaboration-service";
2
2
  import { IChangeset, ISheetBlock, ISnapshot } from "@univerjs/protocol";
3
3
 
4
4
  //#region src/memory-database-adapter.d.ts
@@ -10,11 +10,14 @@ declare class MemoryDatabaseAdapter implements IDatabaseAdapter {
10
10
  getSnapshot(_context: DatabaseContext, unitID: string, options?: {
11
11
  readonly revision?: number;
12
12
  }): Promise<ISnapshot | null>;
13
+ getSnapshotInfo(_context: DatabaseContext, unitID: string, options?: {
14
+ readonly revision?: number;
15
+ }): Promise<SnapshotInfo | null>;
16
+ private _getSnapshot;
13
17
  getChangesets(_context: DatabaseContext, unitID: string, range: {
14
18
  readonly from: number;
15
- readonly to: number;
16
- }): Promise<ChangesetRange>;
17
- getSubmission(_context: DatabaseContext, unitID: string, sid: string, reqId: number): Promise<IChangeset | null>;
19
+ readonly to?: number;
20
+ }): Promise<readonly IChangeset[] | null>;
18
21
  createUnit(_context: DatabaseContext, input: CreateUnitDatabaseInput): Promise<CreateUnitDatabaseResult>;
19
22
  deleteUnits(_context: DatabaseContext, input: DeleteUnitsDatabaseInput): Promise<DeleteUnitsDatabaseResult>;
20
23
  recoverUnits(_context: DatabaseContext, input: RecoverUnitsDatabaseInput): Promise<RecoverUnitsDatabaseResult>;
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- function _0x3db5(){const _0x2dc2b2=['1554728JhBCCG','4595927mZxwbG','12146AWZcvD','8761300ygdHeo','113478yzbIBi','1077329IvsbnI','1585WSbSZe','72nGAqcz','MemoryDatabaseAdapter','47lbFDlN','16386diIAOI','52NCVdBR','36PyWFrs'];_0x3db5=function(){return _0x2dc2b2;};return _0x3db5();}function _0x6ee9(_0x44792b,_0x418419){_0x44792b=_0x44792b-0xb6;const _0x3db529=_0x3db5();let _0x6ee9ee=_0x3db529[_0x44792b];return _0x6ee9ee;}const _0x35ef31=_0x6ee9;(function(_0x1c2f12,_0x477723){const _0x4c1b2b=_0x6ee9,_0x46492e=_0x1c2f12();while(!![]){try{const _0x3c6a31=parseInt(_0x4c1b2b(0xb7))/0x1*(parseInt(_0x4c1b2b(0xbd))/0x2)+-parseInt(_0x4c1b2b(0xbf))/0x3*(-parseInt(_0x4c1b2b(0xb9))/0x4)+parseInt(_0x4c1b2b(0xc1))/0x5*(parseInt(_0x4c1b2b(0xb8))/0x6)+-parseInt(_0x4c1b2b(0xbc))/0x7+-parseInt(_0x4c1b2b(0xbb))/0x8*(parseInt(_0x4c1b2b(0xba))/0x9)+parseInt(_0x4c1b2b(0xbe))/0xa+parseInt(_0x4c1b2b(0xc0))/0xb*(-parseInt(_0x4c1b2b(0xc2))/0xc);if(_0x3c6a31===_0x477723)break;else _0x46492e['push'](_0x46492e['shift']());}catch(_0x26aeb7){_0x46492e['push'](_0x46492e['shift']());}}}(_0x3db5,0x7973b));import _0x318dd2 from'./index.cjs';const facadeExport0=_0x318dd2[_0x35ef31(0xb6)];export{facadeExport0 as MemoryDatabaseAdapter};
1
+ const _0x5e3972=_0x416d;function _0x725f(){const _0x37f49b=['4ynImGm','6036130xvjWyO','6QAAxQK','MemoryDatabaseAdapter','3168285wKZRHP','9158138oMTnQI','544735CfPqrI','4jaSbXb','20RgVxvK','9931817qluxUg','3695272LZLYAM','26FDigkL','27uhPbkl','29048640pzOfRN'];_0x725f=function(){return _0x37f49b;};return _0x725f();}(function(_0x5d16fc,_0x138eb0){const _0x26a857=_0x416d,_0x20a3e6=_0x5d16fc();while(!![]){try{const _0x51c935=-parseInt(_0x26a857(0x130))/0x1*(-parseInt(_0x26a857(0x12a))/0x2)+-parseInt(_0x26a857(0x12e))/0x3+-parseInt(_0x26a857(0x131))/0x4*(-parseInt(_0x26a857(0x12b))/0x5)+-parseInt(_0x26a857(0x12c))/0x6*(-parseInt(_0x26a857(0x133))/0x7)+parseInt(_0x26a857(0x134))/0x8*(parseInt(_0x26a857(0x136))/0x9)+-parseInt(_0x26a857(0x132))/0xa*(-parseInt(_0x26a857(0x12f))/0xb)+-parseInt(_0x26a857(0x129))/0xc*(parseInt(_0x26a857(0x135))/0xd);if(_0x51c935===_0x138eb0)break;else _0x20a3e6['push'](_0x20a3e6['shift']());}catch(_0x5333c0){_0x20a3e6['push'](_0x20a3e6['shift']());}}}(_0x725f,0xd41e3));import _0x312458 from'./index.cjs';function _0x416d(_0x5e2904,_0x125010){_0x5e2904=_0x5e2904-0x129;const _0x725f9e=_0x725f();let _0x416deb=_0x725f9e[_0x5e2904];return _0x416deb;}const facadeExport0=_0x312458[_0x5e3972(0x12d)];export{facadeExport0 as MemoryDatabaseAdapter};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@univerjs-pro/collaboration-database-memory",
3
3
  "type": "module",
4
- "version": "1.0.0-insiders.20260808-70eefdd",
4
+ "version": "1.0.0",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.mjs",
7
7
  "types": "./dist/index.d.ts",
@@ -16,10 +16,7 @@
16
16
  "dist"
17
17
  ],
18
18
  "dependencies": {
19
- "@univerjs-pro/collaboration-service": "1.0.0-insiders.20260808-70eefdd",
20
- "@univerjs/protocol": "1.0.0-insiders.20260808-70eefdd"
21
- },
22
- "publishConfig": {
23
- "access": "public"
19
+ "@univerjs-pro/collaboration-service": "1.0.0",
20
+ "@univerjs/protocol": "1.0.0"
24
21
  }
25
- }
22
+ }