Skip to content

Commit

Permalink
Merge branch 'main' into test-cancel-then-invite-again
Browse files Browse the repository at this point in the history
  • Loading branch information
EvanHahn authored Sep 9, 2024
2 parents 669747c + 9b72be8 commit 4c18caf
Show file tree
Hide file tree
Showing 11 changed files with 45 additions and 48 deletions.
File renamed without changes.
2 changes: 1 addition & 1 deletion drizzle/client/meta/0000_snapshot.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"version": "5",
"dialect": "sqlite",
"id": "efbe54ff-5195-4127-b634-76e303657276",
"id": "41e23fc3-463e-432a-9a5f-7c20366d6294",
"prevId": "00000000-0000-0000-0000-000000000000",
"tables": {
"localDeviceInfo": {
Expand Down
4 changes: 2 additions & 2 deletions drizzle/client/meta/_journal.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
{
"idx": 0,
"version": "5",
"when": 1724972191819,
"tag": "0000_cultured_nick_fury",
"when": 1725381616476,
"tag": "0000_chemical_star_brand",
"breakpoints": true
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ CREATE TABLE `field` (
`appearance` text,
`snakeCase` integer,
`options` text,
`universal` integer DEFAULT false NOT NULL,
`universal` integer,
`placeholder` text,
`helperText` text,
`forks` text NOT NULL
Expand Down Expand Up @@ -126,7 +126,7 @@ CREATE TABLE `preset` (
`addTags` text NOT NULL,
`removeTags` text NOT NULL,
`fieldRefs` text NOT NULL,
`iconRef` text NOT NULL,
`iconRef` text,
`terms` text NOT NULL,
`color` text NOT NULL,
`forks` text NOT NULL
Expand Down
9 changes: 4 additions & 5 deletions drizzle/project/meta/0000_snapshot.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"version": "5",
"dialect": "sqlite",
"id": "2be32705-ddce-45ee-97c1-c6f2fc748568",
"id": "b06de2c5-6a4c-4578-a8f0-d15f9f20e902",
"prevId": "00000000-0000-0000-0000-000000000000",
"tables": {
"coreOwnership_backlink": {
Expand Down Expand Up @@ -373,9 +373,8 @@
"name": "universal",
"type": "integer",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": false
"notNull": false,
"autoincrement": false
},
"placeholder": {
"name": "placeholder",
Expand Down Expand Up @@ -757,7 +756,7 @@
"name": "iconRef",
"type": "text",
"primaryKey": false,
"notNull": true,
"notNull": false,
"autoincrement": false
},
"terms": {
Expand Down
4 changes: 2 additions & 2 deletions drizzle/project/meta/_journal.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
{
"idx": 0,
"version": "5",
"when": 1724972190927,
"tag": "0000_woozy_stryfe",
"when": 1725381611574,
"tag": "0000_tan_glorian",
"breakpoints": true
}
]
Expand Down
30 changes: 19 additions & 11 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mapeo/core",
"version": "9.0.0-alpha.20",
"version": "9.0.0-alpha.23",
"description": "Offline p2p mapping library",
"main": "src/index.js",
"types": "dist/index.d.ts",
Expand Down Expand Up @@ -107,10 +107,11 @@
"devDependencies": {
"@bufbuild/buf": "^1.26.1",
"@mapeo/default-config": "4.0.0-alpha.8",
"@mapeo/mock-data": "^1.0.3-alpha.4",
"@mapeo/mock-data": "^1.0.3-alpha.5",
"@sinonjs/fake-timers": "^10.0.2",
"@types/b4a": "^1.6.0",
"@types/bogon": "^1.0.2",
"@types/compact-encoding": "^2.15.0",
"@types/debug": "^4.1.8",
"@types/json-schema": "^7.0.11",
"@types/json-stable-stringify": "^1.0.36",
Expand Down Expand Up @@ -155,7 +156,7 @@
"@fastify/type-provider-typebox": "^4.0.0",
"@hyperswarm/secret-stream": "^6.1.2",
"@mapeo/crypto": "1.0.0-alpha.10",
"@mapeo/schema": "^3.0.0-next.23",
"@mapeo/schema": "^3.0.0-next.26",
"@mapeo/sqlite-indexer": "1.0.0-alpha.9",
"@sinclair/typebox": "^0.29.6",
"b4a": "^1.6.3",
Expand Down
9 changes: 8 additions & 1 deletion src/mapeo-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,14 @@ export class MapeoManager extends TypedEmitter {
}

/**
* @template {import('type-fest').Exact<import('./schema/client.js').DeviceInfoParam, T>} T
* @typedef {Exclude<
* import('./schema/client.js').DeviceInfoParam['deviceType'],
* 'selfHostedServer'>} RPCDeviceType
*/

/**
* @template {import('type-fest').Exact<
* import('./schema/client.js').DeviceInfoParam & {deviceType?: RPCDeviceType}, T>} T
* @param {T} deviceInfo
*/
async setDeviceInfo(deviceInfo) {
Expand Down
1 change: 0 additions & 1 deletion types/compact-encoding.d.ts

This file was deleted.

23 changes: 3 additions & 20 deletions types/protomux.d.ts
Original file line number Diff line number Diff line change
@@ -1,30 +1,13 @@
declare module 'protomux' {
import { Duplex } from 'streamx'
import { Duplex as NodeDuplex } from 'stream'

interface PreEncodingState {
buffer: null
start: number
end: number
}

interface EncodingState {
buffer: null | Buffer
start: number
end: number
}

interface Encoding {
preencode(state: PreEncodingState, value: any): void
encode(state: EncodingState, value: any): void
decode(state: EncodingState): any
}
import type cenc from 'compact-encoding'

interface Message {
type: number
send(msg: any): void
onmessage: (message: any) => void
encoding: Encoding
encoding: cenc.Encoder
}

type MessageOptions = Partial<Pick<Message, 'onmessage' | 'encoding'>>
Expand Down Expand Up @@ -65,7 +48,7 @@ declare module 'protomux' {
aliases?: string[]
id?: null | Buffer
unique?: boolean
handshake?: Encoding
handshake?: cenc.Encoder
messages: MessageOptions[]
onopen?(handshake?: any): Promise<void> | void
onclose?(): Promise<void> | void
Expand Down

0 comments on commit 4c18caf

Please sign in to comment.