@cero-base/cero 1.16.0 → 1.17.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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cero-base/cero",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.17.0",
|
|
4
4
|
"description": "The ideal p2p API — everything is a handle, handles contain refs, refs contain rows.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -95,7 +95,7 @@
|
|
|
95
95
|
"test:node": "ls test/*.test.js | xargs -P1 -n1 brittle-node"
|
|
96
96
|
},
|
|
97
97
|
"dependencies": {
|
|
98
|
-
"@cero-base/core": "^1.
|
|
98
|
+
"@cero-base/core": "^1.17.0",
|
|
99
99
|
"b4a": "^1.8.1",
|
|
100
100
|
"bare-abort-controller": "^1.1.2",
|
|
101
101
|
"bare-crypto": "^1.15.3",
|
package/src/build/schemas.js
CHANGED
|
@@ -15,11 +15,11 @@ export const main = {
|
|
|
15
15
|
sig: required(bytes),
|
|
16
16
|
isIndexer: bool,
|
|
17
17
|
ts: int,
|
|
18
|
-
// Who this writer belongs to
|
|
19
|
-
//
|
|
20
|
-
//
|
|
21
|
-
//
|
|
22
|
-
//
|
|
18
|
+
// Who this writer belongs to. The paired add-member decides the rank in
|
|
19
|
+
// the same transaction, and a refused grant discards this admission with
|
|
20
|
+
// it — so `role` is unread since 77e5ed0 and stays only for older peers.
|
|
21
|
+
// Absent on a device you add for yourself (recovery), where the device
|
|
22
|
+
// binds to the master identity.
|
|
23
23
|
memberId: string,
|
|
24
24
|
role: string
|
|
25
25
|
},
|
package/src/handle/index.js
CHANGED
|
@@ -598,11 +598,9 @@ export class Handle extends ReadyResource {
|
|
|
598
598
|
sig,
|
|
599
599
|
master: this.identity.publicKey,
|
|
600
600
|
writer: writerKey,
|
|
601
|
-
//
|
|
602
|
-
//
|
|
603
|
-
// each other back
|
|
601
|
+
// the device binds to the joiner; add-member in the same transaction
|
|
602
|
+
// decides the rank, and a refusal discards both
|
|
604
603
|
memberId: member.id,
|
|
605
|
-
role,
|
|
606
604
|
ts: member.updatedAt || Date.now()
|
|
607
605
|
})
|
|
608
606
|
await tx.call('add-member', member)
|
|
@@ -684,21 +682,25 @@ export class Handle extends ReadyResource {
|
|
|
684
682
|
|
|
685
683
|
const ts = Date.now()
|
|
686
684
|
const writerKey = child.store.writerKey
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
685
|
+
// admit the core and seat the owner in one append — the same shape as
|
|
686
|
+
// accept(), so a room's first two ops land together like every later pair
|
|
687
|
+
await child.store.tx(async (tx) => {
|
|
688
|
+
await tx.call('add-writer', {
|
|
689
|
+
master: this.identity.publicKey,
|
|
690
|
+
writer: writerKey,
|
|
691
|
+
sig: this.identity.sign(
|
|
692
|
+
addWriterPayload(child.store.key, writerKey, child.store.writerKey)
|
|
693
|
+
),
|
|
694
|
+
ts
|
|
695
|
+
})
|
|
696
|
+
await tx.call('add-member', {
|
|
697
|
+
id: this.identity.id,
|
|
698
|
+
key: writerKey,
|
|
699
|
+
role: 'owner',
|
|
700
|
+
name: null,
|
|
701
|
+
createdAt: ts,
|
|
702
|
+
updatedAt: ts
|
|
703
|
+
})
|
|
702
704
|
})
|
|
703
705
|
await this.store.call('add-handle', {
|
|
704
706
|
id,
|
package/src/index.js
CHANGED
|
@@ -9,7 +9,7 @@ import { CeroError } from '@cero-base/core/errors'
|
|
|
9
9
|
|
|
10
10
|
import { Handle, Ref } from './handle/index.js'
|
|
11
11
|
import { Local } from './local/index.js'
|
|
12
|
-
import { Bluetooth } from './bluetooth.js'
|
|
12
|
+
import { Bluetooth } from './lib/bluetooth.js'
|
|
13
13
|
import {
|
|
14
14
|
put,
|
|
15
15
|
set,
|
|
File without changes
|
|
File without changes
|