@dxos/protocols 0.1.58-main.f5feb2a → 0.1.58-main.f69fa2f
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/cjs/src/errors/encoding.d.ts.map +1 -1
- package/dist/cjs/src/errors/encoding.js.map +1 -1
- package/dist/cjs/src/errors/errors.js +2 -2
- package/dist/cjs/src/errors/errors.js.map +1 -1
- package/dist/cjs/src/errors/helpers.d.ts +1 -1
- package/dist/cjs/src/errors/helpers.d.ts.map +1 -1
- package/dist/cjs/src/errors/helpers.js.map +1 -1
- package/dist/cjs/src/index.d.ts +2 -2
- package/dist/cjs/src/index.d.ts.map +1 -1
- package/dist/cjs/src/index.js +2 -2
- package/dist/cjs/src/index.js.map +1 -1
- package/dist/cjs/src/proto/gen/dxos/config.d.ts +51 -5
- package/dist/cjs/src/proto/gen/dxos/config.d.ts.map +1 -1
- package/dist/cjs/src/proto/gen/dxos/config.js.map +1 -1
- package/dist/cjs/src/proto/gen/index.d.ts +1 -0
- package/dist/cjs/src/proto/gen/index.d.ts.map +1 -1
- package/dist/cjs/src/proto/gen/index.js +1 -1
- package/dist/cjs/src/proto/gen/index.js.map +1 -1
- package/dist/cjs/src/storage.d.ts +2 -3
- package/dist/cjs/src/storage.d.ts.map +1 -1
- package/dist/cjs/src/storage.js +2 -3
- package/dist/cjs/src/storage.js.map +1 -1
- package/dist/cjs/tsconfig.tsbuildinfo +1 -1
- package/dist/esm/src/errors/encoding.d.ts.map +1 -1
- package/dist/esm/src/errors/encoding.js.map +1 -1
- package/dist/esm/src/errors/errors.js +2 -2
- package/dist/esm/src/errors/errors.js.map +1 -1
- package/dist/esm/src/errors/helpers.d.ts +1 -1
- package/dist/esm/src/errors/helpers.d.ts.map +1 -1
- package/dist/esm/src/errors/helpers.js.map +1 -1
- package/dist/esm/src/index.d.ts +2 -2
- package/dist/esm/src/index.d.ts.map +1 -1
- package/dist/esm/src/index.js +2 -2
- package/dist/esm/src/index.js.map +1 -1
- package/dist/esm/src/proto/gen/dxos/config.d.ts +51 -5
- package/dist/esm/src/proto/gen/dxos/config.d.ts.map +1 -1
- package/dist/esm/src/proto/gen/dxos/config.js.map +1 -1
- package/dist/esm/src/proto/gen/index.d.ts +1 -0
- package/dist/esm/src/proto/gen/index.d.ts.map +1 -1
- package/dist/esm/src/proto/gen/index.js +1 -1
- package/dist/esm/src/proto/gen/index.js.map +1 -1
- package/dist/esm/src/storage.d.ts +2 -3
- package/dist/esm/src/storage.d.ts.map +1 -1
- package/dist/esm/src/storage.js +2 -3
- package/dist/esm/src/storage.js.map +1 -1
- package/package.json +5 -5
- package/src/errors/encoding.ts +1 -1
- package/src/errors/errors.ts +2 -2
- package/src/errors/helpers.ts +1 -1
- package/src/index.ts +2 -2
- package/src/proto/dxos/config.proto +31 -9
- package/src/proto/gen/dxos/config.ts +51 -5
- package/src/proto/gen/index.ts +2 -1
- package/src/storage.ts +2 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/proto/gen/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAuDhE,OAAO,aAAa,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/proto/gen/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAuDhE,OAAO,aAAa,MAAM,kBAAkB,CAAC;AAgf7C,MAAM,CAAC,MAAM,UAAU,GAAG,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC,6s2FAA6s2F,CAAC,CAAC,CAAC;AACtw2F,MAAM,CAAC,MAAM,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAkB,UAAU,EAAE,aAAa,CAAC,CAAC"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Version for the schema of the stored data as defined in dxos.echo.metadata.EchoMetadata.
|
|
3
|
-
*
|
|
4
|
-
* Should be incremented every time there's a breaking change to the stored data.
|
|
3
|
+
* update when making breaking changes to the protocols or other stored data.
|
|
5
4
|
*/
|
|
6
|
-
export declare const STORAGE_VERSION =
|
|
5
|
+
export declare const STORAGE_VERSION = 2;
|
|
7
6
|
//# sourceMappingURL=storage.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["../../../src/storage.ts"],"names":[],"mappings":"AAIA
|
|
1
|
+
{"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["../../../src/storage.ts"],"names":[],"mappings":"AAIA;;;GAGG;AACH,eAAO,MAAM,eAAe,IAAI,CAAC"}
|
package/dist/esm/src/storage.js
CHANGED
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
//
|
|
4
4
|
/**
|
|
5
5
|
* Version for the schema of the stored data as defined in dxos.echo.metadata.EchoMetadata.
|
|
6
|
-
*
|
|
7
|
-
* Should be incremented every time there's a breaking change to the stored data.
|
|
6
|
+
* update when making breaking changes to the protocols or other stored data.
|
|
8
7
|
*/
|
|
9
|
-
export const STORAGE_VERSION =
|
|
8
|
+
export const STORAGE_VERSION = 2;
|
|
10
9
|
//# sourceMappingURL=storage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storage.js","sourceRoot":"","sources":["../../../src/storage.ts"],"names":[],"mappings":"AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;AAEF
|
|
1
|
+
{"version":3,"file":"storage.js","sourceRoot":"","sources":["../../../src/storage.ts"],"names":[],"mappings":"AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/protocols",
|
|
3
|
-
"version": "0.1.58-main.
|
|
3
|
+
"version": "0.1.58-main.f69fa2f",
|
|
4
4
|
"description": "Protobuf definitions for DXOS protocols.",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -33,10 +33,10 @@
|
|
|
33
33
|
"src"
|
|
34
34
|
],
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@dxos/codec-protobuf": "0.1.58-main.
|
|
37
|
-
"@dxos/invariant": "0.1.58-main.
|
|
38
|
-
"@dxos/keys": "0.1.58-main.
|
|
39
|
-
"@dxos/timeframe": "0.1.58-main.
|
|
36
|
+
"@dxos/codec-protobuf": "0.1.58-main.f69fa2f",
|
|
37
|
+
"@dxos/invariant": "0.1.58-main.f69fa2f",
|
|
38
|
+
"@dxos/keys": "0.1.58-main.f69fa2f",
|
|
39
|
+
"@dxos/timeframe": "0.1.58-main.f69fa2f"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"glob": "~7.1.6"
|
package/src/errors/encoding.ts
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { Error as SerializedErrorProto } from '../proto/gen/dxos/error';
|
|
6
5
|
import { reconstructError } from './helpers';
|
|
6
|
+
import { Error as SerializedErrorProto } from '../proto/gen/dxos/error';
|
|
7
7
|
|
|
8
8
|
export const encodeError = (err: any): SerializedErrorProto => {
|
|
9
9
|
if (typeof err === 'object' && err?.message) {
|
package/src/errors/errors.ts
CHANGED
|
@@ -121,14 +121,14 @@ export class TimeoutError extends BaseError {
|
|
|
121
121
|
}
|
|
122
122
|
}
|
|
123
123
|
|
|
124
|
-
// General protocol error
|
|
124
|
+
// General protocol error.
|
|
125
125
|
export class ProtocolError extends BaseError {
|
|
126
126
|
constructor(message?: string, context?: any) {
|
|
127
127
|
super('PROTOCOL_ERROR', message, context);
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
130
|
|
|
131
|
-
// General connectivity errors
|
|
131
|
+
// General connectivity errors.
|
|
132
132
|
export class ConnectivityError extends BaseError {
|
|
133
133
|
constructor(message?: string, context?: any) {
|
|
134
134
|
super('CONNECTIVITY_ERROR', message, context);
|
package/src/errors/helpers.ts
CHANGED
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
import { invariant } from '@dxos/invariant';
|
|
6
6
|
import { PublicKey } from '@dxos/keys';
|
|
7
7
|
|
|
8
|
-
import { Error as SerializedErrorProto } from '../proto/gen/dxos/error';
|
|
9
8
|
import {
|
|
10
9
|
CancelledError,
|
|
11
10
|
ConnectionResetError,
|
|
@@ -28,6 +27,7 @@ import {
|
|
|
28
27
|
UnknownModelError,
|
|
29
28
|
UnknownProtocolError,
|
|
30
29
|
} from './errors';
|
|
30
|
+
import { Error as SerializedErrorProto } from '../proto/gen/dxos/error';
|
|
31
31
|
|
|
32
32
|
export const reconstructError = (error: SerializedErrorProto) => {
|
|
33
33
|
const { name, message, context } = error;
|
package/src/index.ts
CHANGED
|
@@ -45,6 +45,9 @@ message Repo {
|
|
|
45
45
|
optional string version = 3;
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
+
//
|
|
49
|
+
// Unit of deployment.
|
|
50
|
+
//
|
|
48
51
|
message Module {
|
|
49
52
|
message Build {
|
|
50
53
|
optional string command = 1;
|
|
@@ -55,22 +58,23 @@ message Module {
|
|
|
55
58
|
optional google.protobuf.Struct env = 10;
|
|
56
59
|
}
|
|
57
60
|
|
|
58
|
-
optional string name = 1; // TODO(burdon): Replace with id (or key?)
|
|
59
61
|
optional string id = 8; // TODO(burdon): Ensured FQ (e.g., 'dxos.app.xxx')
|
|
60
|
-
optional string
|
|
62
|
+
optional string name = 1; // TODO(burdon): Replace with id (or key?)
|
|
63
|
+
optional string type = 2; // TODO(burdon): Define namespace (e.g., 'dxos.org/type/frame' vs. 'dxos.type.frame')
|
|
61
64
|
|
|
62
65
|
// TODO(burdon): Developer info message.
|
|
63
66
|
|
|
67
|
+
// TODO(burdon): Start at 10.
|
|
64
68
|
optional string display_name = 3;
|
|
65
69
|
optional string description = 4;
|
|
66
70
|
repeated string tags = 5;
|
|
67
|
-
optional bytes bundle = 6;
|
|
71
|
+
optional bytes bundle = 6; // TODO(burdon): ???
|
|
68
72
|
|
|
69
73
|
// TODO(burdon): Remove.
|
|
70
74
|
optional bool tunnel = 7;
|
|
71
75
|
|
|
76
|
+
// TODO(burdon): Start at 100.
|
|
72
77
|
repeated Module deps = 10; // TODO(burdon): E.g., types.
|
|
73
|
-
|
|
74
78
|
optional Build build = 100;
|
|
75
79
|
repeated Repo repos = 101;
|
|
76
80
|
|
|
@@ -90,15 +94,15 @@ message Runtime {
|
|
|
90
94
|
NODE = 4;
|
|
91
95
|
WEBFS = 5;
|
|
92
96
|
|
|
93
|
-
// Key storage only
|
|
97
|
+
// Key storage only.
|
|
94
98
|
LEVELJS = 11;
|
|
95
99
|
JSONDOWN = 12;
|
|
96
100
|
}
|
|
97
101
|
|
|
98
|
-
optional bool persistent = 1;
|
|
99
|
-
optional StorageDriver
|
|
100
|
-
optional StorageDriver
|
|
101
|
-
optional string
|
|
102
|
+
optional bool persistent = 1;
|
|
103
|
+
optional StorageDriver key_store = 2;
|
|
104
|
+
optional StorageDriver data_store = 3;
|
|
105
|
+
optional string data_root = 4;
|
|
102
106
|
}
|
|
103
107
|
|
|
104
108
|
message Log {
|
|
@@ -152,7 +156,25 @@ message Runtime {
|
|
|
152
156
|
int32 port = 1;
|
|
153
157
|
}
|
|
154
158
|
|
|
159
|
+
/// Automatic epoch creation.
|
|
160
|
+
message EpochMontior {
|
|
161
|
+
optional bool enabled = 5;
|
|
162
|
+
|
|
163
|
+
/// Number of mutations required since last epoch to trigger a new epoch.
|
|
164
|
+
optional int32 minMessagesBetweenEpochs = 1;
|
|
165
|
+
|
|
166
|
+
/// Amount of time (in milliseconds) required to pass since last epoch to trigger a new epoch.
|
|
167
|
+
optional int32 minTimeBetweenEpochs = 2;
|
|
168
|
+
|
|
169
|
+
/// Amount of time (in milliseconds) required to pass since last mutation to trigger a new epoch.
|
|
170
|
+
optional int32 minInactivityBeforeEpoch = 3;
|
|
171
|
+
|
|
172
|
+
/// Maximum amount of time (in milliseconds) to wait for an inactivity period before triggering a new epoch.
|
|
173
|
+
optional int32 maxInactivityDelay = 4;
|
|
174
|
+
}
|
|
175
|
+
|
|
155
176
|
optional Functions functions = 1;
|
|
177
|
+
optional EpochMontior epoch_monitor = 2;
|
|
156
178
|
}
|
|
157
179
|
|
|
158
180
|
optional Plugins plugins = 1;
|
|
@@ -117,12 +117,12 @@ export interface Module {
|
|
|
117
117
|
* Options:
|
|
118
118
|
* - proto3_optional = true
|
|
119
119
|
*/
|
|
120
|
-
|
|
120
|
+
id?: string;
|
|
121
121
|
/**
|
|
122
122
|
* Options:
|
|
123
123
|
* - proto3_optional = true
|
|
124
124
|
*/
|
|
125
|
-
|
|
125
|
+
name?: string;
|
|
126
126
|
/**
|
|
127
127
|
* Options:
|
|
128
128
|
* - proto3_optional = true
|
|
@@ -307,17 +307,17 @@ export namespace Runtime {
|
|
|
307
307
|
* Options:
|
|
308
308
|
* - proto3_optional = true
|
|
309
309
|
*/
|
|
310
|
-
|
|
310
|
+
keyStore?: Runtime.Client.Storage.StorageDriver;
|
|
311
311
|
/**
|
|
312
312
|
* Options:
|
|
313
313
|
* - proto3_optional = true
|
|
314
314
|
*/
|
|
315
|
-
|
|
315
|
+
dataStore?: Runtime.Client.Storage.StorageDriver;
|
|
316
316
|
/**
|
|
317
317
|
* Options:
|
|
318
318
|
* - proto3_optional = true
|
|
319
319
|
*/
|
|
320
|
-
|
|
320
|
+
dataRoot?: string;
|
|
321
321
|
}
|
|
322
322
|
export namespace Storage {
|
|
323
323
|
/**
|
|
@@ -445,6 +445,11 @@ export namespace Runtime {
|
|
|
445
445
|
* - proto3_optional = true
|
|
446
446
|
*/
|
|
447
447
|
functions?: Runtime.Agent.Plugins.Functions;
|
|
448
|
+
/**
|
|
449
|
+
* Options:
|
|
450
|
+
* - proto3_optional = true
|
|
451
|
+
*/
|
|
452
|
+
epochMonitor?: Runtime.Agent.Plugins.EpochMontior;
|
|
448
453
|
}
|
|
449
454
|
export namespace Plugins {
|
|
450
455
|
/**
|
|
@@ -454,6 +459,47 @@ export namespace Runtime {
|
|
|
454
459
|
export interface Functions {
|
|
455
460
|
port: number;
|
|
456
461
|
}
|
|
462
|
+
/**
|
|
463
|
+
* Automatic epoch creation.
|
|
464
|
+
*
|
|
465
|
+
* Defined in:
|
|
466
|
+
* {@link file://./../../dxos/config.proto}
|
|
467
|
+
*/
|
|
468
|
+
export interface EpochMontior {
|
|
469
|
+
/**
|
|
470
|
+
* Options:
|
|
471
|
+
* - proto3_optional = true
|
|
472
|
+
*/
|
|
473
|
+
enabled?: boolean;
|
|
474
|
+
/**
|
|
475
|
+
* Number of mutations required since last epoch to trigger a new epoch.
|
|
476
|
+
*
|
|
477
|
+
* Options:
|
|
478
|
+
* - proto3_optional = true
|
|
479
|
+
*/
|
|
480
|
+
minMessagesBetweenEpochs?: number;
|
|
481
|
+
/**
|
|
482
|
+
* Amount of time (in milliseconds) required to pass since last epoch to trigger a new epoch.
|
|
483
|
+
*
|
|
484
|
+
* Options:
|
|
485
|
+
* - proto3_optional = true
|
|
486
|
+
*/
|
|
487
|
+
minTimeBetweenEpochs?: number;
|
|
488
|
+
/**
|
|
489
|
+
* Amount of time (in milliseconds) required to pass since last mutation to trigger a new epoch.
|
|
490
|
+
*
|
|
491
|
+
* Options:
|
|
492
|
+
* - proto3_optional = true
|
|
493
|
+
*/
|
|
494
|
+
minInactivityBeforeEpoch?: number;
|
|
495
|
+
/**
|
|
496
|
+
* Maximum amount of time (in milliseconds) to wait for an inactivity period before triggering a new epoch.
|
|
497
|
+
*
|
|
498
|
+
* Options:
|
|
499
|
+
* - proto3_optional = true
|
|
500
|
+
*/
|
|
501
|
+
maxInactivityDelay?: number;
|
|
502
|
+
}
|
|
457
503
|
}
|
|
458
504
|
}
|
|
459
505
|
/**
|