@dxos/protocols 0.8.4-main.dedc0f3 → 0.8.4-main.e098934

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": "@dxos/protocols",
3
- "version": "0.8.4-main.dedc0f3",
3
+ "version": "0.8.4-main.e098934",
4
4
  "description": "Protobuf definitions for DXOS protocols.",
5
5
  "homepage": "https://dxos.org",
6
6
  "bugs": "https://github.com/dxos/dxos/issues",
@@ -60,19 +60,19 @@
60
60
  ],
61
61
  "dependencies": {
62
62
  "@bufbuild/protobuf": "^2.1.0",
63
- "@dxos/effect": "0.8.4-main.dedc0f3",
64
- "@dxos/codec-protobuf": "0.8.4-main.dedc0f3",
65
- "@dxos/errors": "0.8.4-main.dedc0f3",
66
- "@dxos/keys": "0.8.4-main.dedc0f3",
67
- "@dxos/timeframe": "0.8.4-main.dedc0f3",
68
- "@dxos/util": "0.8.4-main.dedc0f3",
69
- "@dxos/invariant": "0.8.4-main.dedc0f3"
63
+ "@dxos/codec-protobuf": "0.8.4-main.e098934",
64
+ "@dxos/effect": "0.8.4-main.e098934",
65
+ "@dxos/errors": "0.8.4-main.e098934",
66
+ "@dxos/invariant": "0.8.4-main.e098934",
67
+ "@dxos/keys": "0.8.4-main.e098934",
68
+ "@dxos/timeframe": "0.8.4-main.e098934",
69
+ "@dxos/util": "0.8.4-main.e098934"
70
70
  },
71
71
  "devDependencies": {
72
72
  "@bufbuild/buf": "^1.43.0",
73
73
  "@bufbuild/protoc-gen-es": "^2.1.0",
74
74
  "effect": "3.17.7",
75
- "@dxos/protobuf-compiler": "0.8.4-main.dedc0f3"
75
+ "@dxos/protobuf-compiler": "0.8.4-main.e098934"
76
76
  },
77
77
  "peerDependencies": {
78
78
  "effect": "^3.13.3"
package/src/edge-error.ts CHANGED
@@ -6,6 +6,7 @@ import { BaseError } from '@dxos/errors';
6
6
 
7
7
  import { type EdgeErrorData, type EdgeHttpFailure } from './edge';
8
8
 
9
+ // TODO(burdon): Reconcile with @dxos/errors.
9
10
  export class EdgeCallFailedError extends Error {
10
11
  public static fromProcessingFailureCause(cause: Error): EdgeCallFailedError {
11
12
  return new EdgeCallFailedError({
@@ -106,10 +107,12 @@ type SerializedError = {
106
107
  const parseSerializedError = (serializedError: SerializedError): Error => {
107
108
  let err: Error;
108
109
  if (typeof serializedError.code === 'string') {
109
- err = new BaseError(serializedError.code, serializedError.message ?? 'Unknown error', {
110
+ err = new BaseError(serializedError.code, {
111
+ message: serializedError.message ?? 'Unknown error',
110
112
  cause: serializedError.cause ? parseSerializedError(serializedError.cause) : undefined,
111
113
  context: serializedError.context,
112
114
  });
115
+
113
116
  if (serializedError.stack) {
114
117
  Object.defineProperty(err, 'stack', {
115
118
  value: serializedError.stack,
@@ -119,6 +122,7 @@ const parseSerializedError = (serializedError: SerializedError): Error => {
119
122
  err = new Error(serializedError.message ?? 'Unknown error', {
120
123
  cause: serializedError.cause ? parseSerializedError(serializedError.cause) : undefined,
121
124
  });
125
+
122
126
  if (serializedError.stack) {
123
127
  Object.defineProperty(err, 'stack', {
124
128
  value: serializedError.stack,
@@ -2,11 +2,12 @@
2
2
  // Copyright 2021 DXOS.org
3
3
  //
4
4
 
5
+ // TODO(dmaretskyi): Reconcile with @dxos/errors
6
+
5
7
  /**
6
8
  * NOTE: Messages should be sentences (Start with a capital letter and end with a period).
7
9
  * Errors can optionally include a JSON context object.
8
10
  */
9
- // TODO(dmaretskyi): Duplicate of @dxos/errors
10
11
  export class BaseError extends Error {
11
12
  constructor(
12
13
  readonly code: string,
@@ -67,14 +67,6 @@ import * as example_testing_data from "../example/testing/data.js";
67
67
  import * as example_testing_rpc from "../example/testing/rpc.js";
68
68
  export interface Empty {
69
69
  }
70
- export interface Timestamp {
71
- seconds: string;
72
- nanos: number;
73
- }
74
- export interface Any {
75
- type_url: string;
76
- value: Uint8Array;
77
- }
78
70
  export interface Struct {
79
71
  fields?: Partial<Record<string, Value>>;
80
72
  }
@@ -92,6 +84,14 @@ export enum NullValue {
92
84
  export interface ListValue {
93
85
  values?: Value[];
94
86
  }
87
+ export interface Timestamp {
88
+ seconds: string;
89
+ nanos: number;
90
+ }
91
+ export interface Any {
92
+ type_url: string;
93
+ value: Uint8Array;
94
+ }
95
95
  export interface FileDescriptorSet {
96
96
  file?: FileDescriptorProto[];
97
97
  }