@dxos/protocols 0.1.58-main.73a8891 → 0.1.58-main.7858df5
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 +7 -0
- package/dist/cjs/src/errors/encoding.d.ts.map +1 -0
- package/dist/cjs/src/errors/encoding.js +41 -0
- package/dist/cjs/src/errors/encoding.js.map +1 -0
- package/dist/cjs/src/errors/errors.d.ts +99 -0
- package/dist/cjs/src/errors/errors.d.ts.map +1 -0
- package/dist/cjs/src/errors/errors.js +171 -0
- package/dist/cjs/src/errors/errors.js.map +1 -0
- package/dist/cjs/src/errors/errors.test.d.ts +2 -0
- package/dist/cjs/src/errors/errors.test.d.ts.map +1 -0
- package/dist/cjs/src/errors/errors.test.js +45 -0
- package/dist/cjs/src/errors/errors.test.js.map +1 -0
- package/dist/cjs/src/errors/helpers.d.ts +5 -0
- package/dist/cjs/src/errors/helpers.d.ts.map +1 -0
- package/dist/cjs/src/errors/helpers.js +74 -0
- package/dist/cjs/src/errors/helpers.js.map +1 -0
- package/dist/cjs/src/errors/index.d.ts +4 -0
- package/dist/cjs/src/errors/index.d.ts.map +1 -0
- package/dist/cjs/src/errors/index.js +23 -0
- package/dist/cjs/src/errors/index.js.map +1 -0
- package/dist/cjs/src/proto/gen/dxos/client/services.d.ts +182 -176
- package/dist/cjs/src/proto/gen/dxos/client/services.d.ts.map +1 -1
- package/dist/cjs/src/proto/gen/dxos/client/services.js +26 -25
- package/dist/cjs/src/proto/gen/dxos/client/services.js.map +1 -1
- package/dist/cjs/src/proto/gen/dxos/error.d.ts +6 -0
- package/dist/cjs/src/proto/gen/dxos/error.d.ts.map +1 -1
- package/dist/cjs/src/proto/gen/dxos/halo/credentials.d.ts +14 -1
- package/dist/cjs/src/proto/gen/dxos/halo/credentials.d.ts.map +1 -1
- package/dist/cjs/src/proto/gen/dxos/halo/credentials.js.map +1 -1
- package/dist/cjs/src/proto/gen/dxos/iframe.d.ts +5 -10
- package/dist/cjs/src/proto/gen/dxos/iframe.d.ts.map +1 -1
- package/dist/cjs/src/proto/gen/dxos/iframe.js +5 -3
- package/dist/cjs/src/proto/gen/dxos/iframe.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/tsconfig.tsbuildinfo +1 -1
- package/dist/esm/src/errors/encoding.d.ts +7 -0
- package/dist/esm/src/errors/encoding.d.ts.map +1 -0
- package/dist/esm/src/errors/encoding.js +35 -0
- package/dist/esm/src/errors/encoding.js.map +1 -0
- package/dist/esm/src/errors/errors.d.ts +99 -0
- package/dist/esm/src/errors/errors.d.ts.map +1 -0
- package/dist/esm/src/errors/errors.js +148 -0
- package/dist/esm/src/errors/errors.js.map +1 -0
- package/dist/esm/src/errors/errors.test.d.ts +2 -0
- package/dist/esm/src/errors/errors.test.d.ts.map +1 -0
- package/dist/esm/src/errors/errors.test.js +17 -0
- package/dist/esm/src/errors/errors.test.js.map +1 -0
- package/dist/esm/src/errors/helpers.d.ts +5 -0
- package/dist/esm/src/errors/helpers.d.ts.map +1 -0
- package/dist/esm/src/errors/helpers.js +69 -0
- package/dist/esm/src/errors/helpers.js.map +1 -0
- package/dist/esm/src/errors/index.d.ts +4 -0
- package/dist/esm/src/errors/index.d.ts.map +1 -0
- package/dist/esm/src/errors/index.js +7 -0
- package/dist/esm/src/errors/index.js.map +1 -0
- package/dist/esm/src/proto/gen/dxos/client/services.d.ts +182 -176
- package/dist/esm/src/proto/gen/dxos/client/services.d.ts.map +1 -1
- package/dist/esm/src/proto/gen/dxos/client/services.js +25 -24
- package/dist/esm/src/proto/gen/dxos/client/services.js.map +1 -1
- package/dist/esm/src/proto/gen/dxos/error.d.ts +6 -0
- package/dist/esm/src/proto/gen/dxos/error.d.ts.map +1 -1
- package/dist/esm/src/proto/gen/dxos/halo/credentials.d.ts +14 -1
- package/dist/esm/src/proto/gen/dxos/halo/credentials.d.ts.map +1 -1
- package/dist/esm/src/proto/gen/dxos/halo/credentials.js.map +1 -1
- package/dist/esm/src/proto/gen/dxos/iframe.d.ts +5 -10
- package/dist/esm/src/proto/gen/dxos/iframe.d.ts.map +1 -1
- package/dist/esm/src/proto/gen/dxos/iframe.js +5 -3
- package/dist/esm/src/proto/gen/dxos/iframe.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/package.json +5 -4
- package/src/errors/encoding.ts +40 -0
- package/src/errors/errors.test.ts +22 -0
- package/src/errors/errors.ts +170 -0
- package/src/errors/helpers.ts +113 -0
- package/src/errors/index.ts +7 -0
- package/src/proto/dxos/client/services.proto +2 -0
- package/src/proto/dxos/error.proto +1 -0
- package/src/proto/dxos/halo/credentials.proto +8 -1
- package/src/proto/dxos/iframe.proto +6 -5
- package/src/proto/gen/dxos/client/services.ts +182 -176
- package/src/proto/gen/dxos/error.ts +5 -0
- package/src/proto/gen/dxos/halo/credentials.ts +14 -1
- package/src/proto/gen/dxos/iframe.ts +5 -10
- package/src/proto/gen/index.ts +2 -1
- package/dist/cjs/src/errors.d.ts +0 -25
- package/dist/cjs/src/errors.d.ts.map +0 -1
- package/dist/cjs/src/errors.js +0 -78
- package/dist/cjs/src/errors.js.map +0 -1
- package/dist/esm/src/errors.d.ts +0 -25
- package/dist/esm/src/errors.d.ts.map +0 -1
- package/dist/esm/src/errors.js +0 -69
- package/dist/esm/src/errors.js.map +0 -1
- package/src/errors.ts +0 -80
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../../src/errors/errors.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAA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
//
|
|
2
|
+
// Copyright 2021 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
/**
|
|
5
|
+
* NOTE: Messages should be sentences (Start with a capital letter and end with a period).
|
|
6
|
+
* Errors can optionally include a JSON context object.
|
|
7
|
+
*/
|
|
8
|
+
class BaseError extends Error {
|
|
9
|
+
code;
|
|
10
|
+
context;
|
|
11
|
+
constructor(code, message, context) {
|
|
12
|
+
super(message ?? code);
|
|
13
|
+
this.code = code;
|
|
14
|
+
this.context = context;
|
|
15
|
+
this.name = code;
|
|
16
|
+
// NOTE: Restores prototype chain (https://stackoverflow.com/a/48342359).
|
|
17
|
+
Object.setPrototypeOf(this, new.target.prototype);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* User facing API Errors.
|
|
22
|
+
* E.g., something was misconfigured.
|
|
23
|
+
*/
|
|
24
|
+
export class ApiError extends BaseError {
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Internal system errors.
|
|
28
|
+
* E.g., unexpected/unrecoverable runtime error.
|
|
29
|
+
*/
|
|
30
|
+
export class SystemError extends BaseError {
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Database errors.
|
|
34
|
+
*/
|
|
35
|
+
// TODO(wittjosiah): Same as ApiError?
|
|
36
|
+
export class DatabaseError extends BaseError {
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Thrown when request was terminated because the RPC endpoint has been closed.
|
|
40
|
+
*/
|
|
41
|
+
export class RpcClosedError extends SystemError {
|
|
42
|
+
constructor() {
|
|
43
|
+
super('RPC_CLOSED', 'Request was terminated because the RPC endpoint is closed.');
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Thrown when `request` is called when RPC has not been opened.
|
|
48
|
+
*/
|
|
49
|
+
export class RpcNotOpenError extends SystemError {
|
|
50
|
+
constructor() {
|
|
51
|
+
super('RPC_NOT_OPEN', 'RPC has not been opened.');
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
export class CancelledError extends SystemError {
|
|
55
|
+
constructor(message, context) {
|
|
56
|
+
super('CANCELLED', message, context);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
export class InvalidConfigError extends ApiError {
|
|
60
|
+
constructor(message, context) {
|
|
61
|
+
super('INVALID_CONFIG', message, context);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Explicit failure to connect with remote client services.
|
|
66
|
+
*/
|
|
67
|
+
export class RemoteServiceConnectionError extends ApiError {
|
|
68
|
+
constructor(message, context) {
|
|
69
|
+
super('REMOTE_SERVICE_CONNECTION_ERROR', message, context);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Failed to open a connection to remote client services.
|
|
74
|
+
*/
|
|
75
|
+
export class RemoteServiceConnectionTimeout extends ApiError {
|
|
76
|
+
constructor(message, context) {
|
|
77
|
+
super('REMOTE_SERVICE_CONNECTION_TIMEOUT', message, context);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
export class DataCorruptionError extends SystemError {
|
|
81
|
+
constructor(message, context) {
|
|
82
|
+
super('DATA_CORRUPTION', message, context);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
export class InvalidInvitationExtensionRoleError extends SystemError {
|
|
86
|
+
constructor(message, context) {
|
|
87
|
+
super('INVALID_INVITATION_EXTENSION_ROLE', message, context);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
export class IdentityNotInitializedError extends DatabaseError {
|
|
91
|
+
constructor(message, context) {
|
|
92
|
+
super('IDENTITY_NOT_INITIALIZED', message, context);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
export class InvalidInvitationError extends DatabaseError {
|
|
96
|
+
constructor(message, context) {
|
|
97
|
+
super('INVALID_INVITATION', message, context);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
export class ConnectionResetError extends BaseError {
|
|
101
|
+
constructor(message, context) {
|
|
102
|
+
super('CONNECTION_RESET', message, context);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
export class TimeoutError extends BaseError {
|
|
106
|
+
constructor(message, context) {
|
|
107
|
+
super('TIMEOUT', message, context);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
// General protocol error
|
|
111
|
+
export class ProtocolError extends BaseError {
|
|
112
|
+
constructor(message, context) {
|
|
113
|
+
super('PROTOCOL_ERROR', message, context);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
// General connectivity errors
|
|
117
|
+
export class ConnectivityError extends BaseError {
|
|
118
|
+
constructor(message, context) {
|
|
119
|
+
super('CONNECTIVITY_ERROR', message, context);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
// TODO(nf): Rename? the protocol isn't what's unknown...
|
|
123
|
+
export class UnknownProtocolError extends BaseError {
|
|
124
|
+
constructor(message, innerError) {
|
|
125
|
+
super('UNKNOWN_PROTOCOL_ERROR', message, innerError);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
export class InvalidStorageVersionError extends DatabaseError {
|
|
129
|
+
constructor(expected, actual) {
|
|
130
|
+
super('INVALID_STORAGE_VERSION', 'Invalid storage version.', { expected, actual });
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
export class SpaceNotFoundError extends DatabaseError {
|
|
134
|
+
constructor(spaceKey) {
|
|
135
|
+
super('SPACE_NOT_FOUND', 'Space not found.', { spaceKey });
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
export class EntityNotFoundError extends DatabaseError {
|
|
139
|
+
constructor(entityId) {
|
|
140
|
+
super('ITEM_NOT_FOUND', 'Item not found.', { entityId });
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
export class UnknownModelError extends DatabaseError {
|
|
144
|
+
constructor(model) {
|
|
145
|
+
super('UNKNOWN_MODEL', 'Unknown model.', { model });
|
|
146
|
+
}
|
|
147
|
+
}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ors.test.d.ts","sourceRoot":"","sources":["../../../../src/errors/errors.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2022 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
import chai, { expect } from 'chai';
|
|
5
|
+
import chaiAsPromised from 'chai-as-promised';
|
|
6
|
+
import { describe, test } from '@dxos/test';
|
|
7
|
+
import { ApiError } from './errors';
|
|
8
|
+
chai.use(chaiAsPromised);
|
|
9
|
+
describe('Errors', () => {
|
|
10
|
+
test('test', async () => {
|
|
11
|
+
const runTest = async () => {
|
|
12
|
+
throw new ApiError('Test error');
|
|
13
|
+
};
|
|
14
|
+
await expect(runTest()).to.be.rejectedWith('Test error');
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
//# sourceMappingURL=errors.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.test.js","sourceRoot":"","sources":["../../../../src/errors/errors.test.ts"],"names":[],"mappings":"AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;AAEF,OAAO,IAAI,EAAE,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AACpC,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAE9C,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAE5C,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEpC,IAAI,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;AAEzB,QAAQ,CAAC,QAAQ,EAAE,GAAG,EAAE;IACtB,IAAI,CAAC,MAAM,EAAE,KAAK,IAAI,EAAE;QACtB,MAAM,OAAO,GAAG,KAAK,IAAI,EAAE;YACzB,MAAM,IAAI,QAAQ,CAAC,YAAY,CAAC,CAAC;QACnC,CAAC,CAAC;QAEF,MAAM,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC;IAC3D,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ConnectionResetError, ConnectivityError, EntityNotFoundError, IdentityNotInitializedError, InvalidConfigError, InvalidInvitationError, InvalidStorageVersionError, ProtocolError, RemoteServiceConnectionError, RemoteServiceConnectionTimeout, SpaceNotFoundError, SystemError, TimeoutError, UnknownModelError, UnknownProtocolError } from './errors';
|
|
2
|
+
import { Error as SerializedErrorProto } from '../proto/gen/dxos/error';
|
|
3
|
+
export declare const reconstructError: (error: SerializedErrorProto) => SystemError | InvalidConfigError | RemoteServiceConnectionError | RemoteServiceConnectionTimeout | IdentityNotInitializedError | InvalidInvitationError | ConnectionResetError | TimeoutError | ProtocolError | ConnectivityError | UnknownProtocolError | InvalidStorageVersionError | SpaceNotFoundError | EntityNotFoundError | UnknownModelError;
|
|
4
|
+
export declare const errorFromCode: (code?: string, message?: string, context?: any) => SystemError | InvalidConfigError | RemoteServiceConnectionError | RemoteServiceConnectionTimeout | IdentityNotInitializedError | InvalidInvitationError | ConnectionResetError | TimeoutError | ProtocolError | ConnectivityError | UnknownProtocolError | InvalidStorageVersionError | SpaceNotFoundError | EntityNotFoundError | UnknownModelError;
|
|
5
|
+
//# sourceMappingURL=helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../src/errors/helpers.ts"],"names":[],"mappings":"AAOA,OAAO,EAEL,oBAAoB,EACpB,iBAAiB,EAEjB,mBAAmB,EACnB,2BAA2B,EAC3B,kBAAkB,EAClB,sBAAsB,EAEtB,0BAA0B,EAC1B,aAAa,EACb,4BAA4B,EAC5B,8BAA8B,EAG9B,kBAAkB,EAClB,WAAW,EACX,YAAY,EACZ,iBAAiB,EACjB,oBAAoB,EACrB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,KAAK,IAAI,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAExE,eAAO,MAAM,gBAAgB,UAAW,oBAAoB,yVAG3D,CAAC;AAEF,eAAO,MAAM,aAAa,UAAW,MAAM,YAAY,MAAM,YAAY,GAAG,yVA4E3E,CAAC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
import { invariant } from '@dxos/invariant';
|
|
5
|
+
import { PublicKey } from '@dxos/keys';
|
|
6
|
+
import { CancelledError, ConnectionResetError, ConnectivityError, DataCorruptionError, EntityNotFoundError, IdentityNotInitializedError, InvalidConfigError, InvalidInvitationError, InvalidInvitationExtensionRoleError, InvalidStorageVersionError, ProtocolError, RemoteServiceConnectionError, RemoteServiceConnectionTimeout, RpcClosedError, RpcNotOpenError, SpaceNotFoundError, SystemError, TimeoutError, UnknownModelError, UnknownProtocolError, } from './errors';
|
|
7
|
+
export const reconstructError = (error) => {
|
|
8
|
+
const { name, message, context } = error;
|
|
9
|
+
return errorFromCode(name, message, context);
|
|
10
|
+
};
|
|
11
|
+
export const errorFromCode = (code, message, context) => {
|
|
12
|
+
switch (code) {
|
|
13
|
+
case 'RPC_CLOSED':
|
|
14
|
+
return new RpcClosedError();
|
|
15
|
+
case 'RPC_NOT_OPEN':
|
|
16
|
+
return new RpcNotOpenError();
|
|
17
|
+
case 'CANCELLED':
|
|
18
|
+
return new CancelledError(message, context);
|
|
19
|
+
case 'INVALID_CONFIG':
|
|
20
|
+
return new InvalidConfigError(message, context);
|
|
21
|
+
case 'REMOTE_SERVICE_CONNECTION_ERROR':
|
|
22
|
+
return new RemoteServiceConnectionError(message, context);
|
|
23
|
+
case 'REMOTE_SERVICE_CONNECTION_TIMEOUT':
|
|
24
|
+
return new RemoteServiceConnectionTimeout(message, context);
|
|
25
|
+
case 'DATA_CORRUPTION':
|
|
26
|
+
return new DataCorruptionError(message, context);
|
|
27
|
+
case 'INVALID_INVITATION_EXTENSION_ROLE':
|
|
28
|
+
return new InvalidInvitationExtensionRoleError(message, context);
|
|
29
|
+
case 'CONNECTION_RESET':
|
|
30
|
+
return new ConnectionResetError(message, context);
|
|
31
|
+
case 'TIMEOUT':
|
|
32
|
+
return new TimeoutError(message, context);
|
|
33
|
+
case 'PROTOCOL_ERROR':
|
|
34
|
+
return new ProtocolError(message, context);
|
|
35
|
+
case 'CONNECTIVITY_ERROR':
|
|
36
|
+
return new ConnectivityError(message, context);
|
|
37
|
+
case 'UNKNOWN_PROTOCOL_ERROR':
|
|
38
|
+
return new UnknownProtocolError(message, context);
|
|
39
|
+
case 'IDENTITY_NOT_INITIALIZED':
|
|
40
|
+
return new IdentityNotInitializedError(message, context);
|
|
41
|
+
case 'INVALID_INVITATION':
|
|
42
|
+
return new InvalidInvitationError(message, context);
|
|
43
|
+
case 'INVALID_STORAGE_VERSION': {
|
|
44
|
+
const { expected, actual } = context;
|
|
45
|
+
invariant(expected);
|
|
46
|
+
invariant(actual);
|
|
47
|
+
return new InvalidStorageVersionError(expected, actual);
|
|
48
|
+
}
|
|
49
|
+
case 'SPACE_NOT_FOUND': {
|
|
50
|
+
const { spaceKey: key } = context;
|
|
51
|
+
const spaceKey = PublicKey.safeFrom(key);
|
|
52
|
+
invariant(spaceKey);
|
|
53
|
+
return new SpaceNotFoundError(spaceKey);
|
|
54
|
+
}
|
|
55
|
+
case 'ITEM_NOT_FOUND': {
|
|
56
|
+
const { entityId } = context;
|
|
57
|
+
invariant(typeof entityId === 'string');
|
|
58
|
+
return new EntityNotFoundError(entityId);
|
|
59
|
+
}
|
|
60
|
+
case 'UNKNOWN_MODEL': {
|
|
61
|
+
const { model } = context;
|
|
62
|
+
invariant(typeof model === 'string');
|
|
63
|
+
return new UnknownModelError(model);
|
|
64
|
+
}
|
|
65
|
+
default:
|
|
66
|
+
return new SystemError(code ?? 'Error', message, context);
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
//# sourceMappingURL=helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
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QAAQ,CAAC,CAAC;YACpB,OAAO,IAAI,kBAAkB,CAAC,QAAQ,CAAC,CAAC;SACzC;QAED,KAAK,gBAAgB,CAAC,CAAC;YACrB,MAAM,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC;YAC7B,SAAS,CAAC,OAAO,QAAQ,KAAK,QAAQ,CAAC,CAAC;YACxC,OAAO,IAAI,mBAAmB,CAAC,QAAQ,CAAC,CAAC;SAC1C;QAED,KAAK,eAAe,CAAC,CAAC;YACpB,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC;YAC1B,SAAS,CAAC,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC;YACrC,OAAO,IAAI,iBAAiB,CAAC,KAAK,CAAC,CAAC;SACrC;QAED;YACE,OAAO,IAAI,WAAW,CAAC,IAAI,IAAI,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;KAC7D;AACH,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/errors/index.ts"],"names":[],"mappings":"AAIA,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/errors/index.ts"],"names":[],"mappings":"AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;AAEF,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC"}
|
|
@@ -8,6 +8,181 @@ import * as dxos_mesh_presence from "../mesh/presence";
|
|
|
8
8
|
import * as dxos_mesh_signal from "../mesh/signal";
|
|
9
9
|
import * as dxos_mesh_teleport_gossip from "../mesh/teleport/gossip";
|
|
10
10
|
import * as dxos_value from "../value";
|
|
11
|
+
/**
|
|
12
|
+
* Defined in:
|
|
13
|
+
* {@link file://./../../../dxos/client/logging.proto}
|
|
14
|
+
*/
|
|
15
|
+
export interface Metrics {
|
|
16
|
+
timestamp: ReturnType<(typeof substitutions)["google.protobuf.Timestamp"]["decode"]>;
|
|
17
|
+
values?: Metrics.KeyPair[];
|
|
18
|
+
}
|
|
19
|
+
export declare namespace Metrics {
|
|
20
|
+
/**
|
|
21
|
+
* Defined in:
|
|
22
|
+
* {@link file://./../../../dxos/client/logging.proto}
|
|
23
|
+
*/
|
|
24
|
+
interface KeyPair {
|
|
25
|
+
/**
|
|
26
|
+
* Options:
|
|
27
|
+
* - proto3_optional = true
|
|
28
|
+
*/
|
|
29
|
+
key?: string;
|
|
30
|
+
/**
|
|
31
|
+
* Options:
|
|
32
|
+
* - proto3_optional = true
|
|
33
|
+
*/
|
|
34
|
+
value?: dxos_value.Value;
|
|
35
|
+
/**
|
|
36
|
+
* Options:
|
|
37
|
+
* - proto3_optional = true
|
|
38
|
+
*/
|
|
39
|
+
stats?: dxos_value.Stats;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Defined in:
|
|
44
|
+
* {@link file://./../../../dxos/client/logging.proto}
|
|
45
|
+
*/
|
|
46
|
+
export interface ControlMetricsRequest {
|
|
47
|
+
/**
|
|
48
|
+
* Options:
|
|
49
|
+
* - proto3_optional = true
|
|
50
|
+
*/
|
|
51
|
+
reset?: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* Options:
|
|
54
|
+
* - proto3_optional = true
|
|
55
|
+
*/
|
|
56
|
+
record?: boolean;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Defined in:
|
|
60
|
+
* {@link file://./../../../dxos/client/logging.proto}
|
|
61
|
+
*/
|
|
62
|
+
export interface ControlMetricsResponse {
|
|
63
|
+
/**
|
|
64
|
+
* Options:
|
|
65
|
+
* - proto3_optional = true
|
|
66
|
+
*/
|
|
67
|
+
recording?: boolean;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Defined in:
|
|
71
|
+
* {@link file://./../../../dxos/client/logging.proto}
|
|
72
|
+
*/
|
|
73
|
+
export interface QueryMetricsRequest {
|
|
74
|
+
/**
|
|
75
|
+
* Options:
|
|
76
|
+
* - proto3_optional = true
|
|
77
|
+
*/
|
|
78
|
+
interval?: number;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Defined in:
|
|
82
|
+
* {@link file://./../../../dxos/client/logging.proto}
|
|
83
|
+
*/
|
|
84
|
+
export interface QueryMetricsResponse {
|
|
85
|
+
timestamp: ReturnType<(typeof substitutions)["google.protobuf.Timestamp"]["decode"]>;
|
|
86
|
+
metrics: Metrics;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Defined in:
|
|
90
|
+
* {@link file://./../../../dxos/client/logging.proto}
|
|
91
|
+
*/
|
|
92
|
+
export declare enum LogLevel {
|
|
93
|
+
TRACE = 5,
|
|
94
|
+
DEBUG = 10,
|
|
95
|
+
INFO = 11,
|
|
96
|
+
WARN = 12,
|
|
97
|
+
ERROR = 13
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Defined in:
|
|
101
|
+
* {@link file://./../../../dxos/client/logging.proto}
|
|
102
|
+
*/
|
|
103
|
+
export interface QueryLogsRequest {
|
|
104
|
+
filters?: QueryLogsRequest.Filter[];
|
|
105
|
+
/**
|
|
106
|
+
* Options:
|
|
107
|
+
* - proto3_optional = true
|
|
108
|
+
*/
|
|
109
|
+
options?: QueryLogsRequest.MatchingOptions;
|
|
110
|
+
}
|
|
111
|
+
export declare namespace QueryLogsRequest {
|
|
112
|
+
/**
|
|
113
|
+
* Defined in:
|
|
114
|
+
* {@link file://./../../../dxos/client/logging.proto}
|
|
115
|
+
*/
|
|
116
|
+
enum MatchingOptions {
|
|
117
|
+
INCLUSIVE = 1,
|
|
118
|
+
EXPLICIT = 2
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Defined in:
|
|
122
|
+
* {@link file://./../../../dxos/client/logging.proto}
|
|
123
|
+
*/
|
|
124
|
+
interface Filter {
|
|
125
|
+
level: LogLevel;
|
|
126
|
+
/**
|
|
127
|
+
* Options:
|
|
128
|
+
* - proto3_optional = true
|
|
129
|
+
*/
|
|
130
|
+
pattern?: string;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Defined in:
|
|
135
|
+
* {@link file://./../../../dxos/client/logging.proto}
|
|
136
|
+
*/
|
|
137
|
+
export interface LogEntry {
|
|
138
|
+
level: LogLevel;
|
|
139
|
+
message: string;
|
|
140
|
+
/**
|
|
141
|
+
* Options:
|
|
142
|
+
* - proto3_optional = true
|
|
143
|
+
*/
|
|
144
|
+
context?: ReturnType<(typeof substitutions)["google.protobuf.Struct"]["decode"]>;
|
|
145
|
+
/**
|
|
146
|
+
* Options:
|
|
147
|
+
* - proto3_optional = true
|
|
148
|
+
*/
|
|
149
|
+
meta?: LogEntry.Meta;
|
|
150
|
+
/**
|
|
151
|
+
* Options:
|
|
152
|
+
* - proto3_optional = true
|
|
153
|
+
*/
|
|
154
|
+
error?: dxos_error.Error;
|
|
155
|
+
timestamp: ReturnType<(typeof substitutions)["google.protobuf.Timestamp"]["decode"]>;
|
|
156
|
+
}
|
|
157
|
+
export declare namespace LogEntry {
|
|
158
|
+
/**
|
|
159
|
+
* Defined in:
|
|
160
|
+
* {@link file://./../../../dxos/client/logging.proto}
|
|
161
|
+
*/
|
|
162
|
+
interface Meta {
|
|
163
|
+
file: string;
|
|
164
|
+
line: number;
|
|
165
|
+
/**
|
|
166
|
+
* Options:
|
|
167
|
+
* - proto3_optional = true
|
|
168
|
+
*/
|
|
169
|
+
scope?: ReturnType<(typeof substitutions)["google.protobuf.Struct"]["decode"]>;
|
|
170
|
+
/**
|
|
171
|
+
* Options:
|
|
172
|
+
* - proto3_optional = true
|
|
173
|
+
*/
|
|
174
|
+
resourceId?: number;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Defined in:
|
|
179
|
+
* {@link file://./../../../dxos/client/logging.proto}
|
|
180
|
+
*/
|
|
181
|
+
export interface LoggingService {
|
|
182
|
+
controlMetrics: (request: ControlMetricsRequest) => Promise<ControlMetricsResponse>;
|
|
183
|
+
queryMetrics: (request: QueryMetricsRequest) => Stream<QueryMetricsResponse>;
|
|
184
|
+
queryLogs: (request: QueryLogsRequest) => Stream<LogEntry>;
|
|
185
|
+
}
|
|
11
186
|
/**
|
|
12
187
|
* Defined in:
|
|
13
188
|
* {@link file://./../../../dxos/client/services.proto}
|
|
@@ -222,7 +397,8 @@ export declare namespace SpaceMember {
|
|
|
222
397
|
*/
|
|
223
398
|
enum PresenceState {
|
|
224
399
|
OFFLINE = 0,
|
|
225
|
-
ONLINE = 1
|
|
400
|
+
ONLINE = 1,
|
|
401
|
+
REMOVED = 2
|
|
226
402
|
}
|
|
227
403
|
}
|
|
228
404
|
/**
|
|
@@ -458,6 +634,11 @@ export interface WriteCredentialsRequest {
|
|
|
458
634
|
*/
|
|
459
635
|
export interface QueryCredentialsRequest {
|
|
460
636
|
spaceKey: ReturnType<(typeof substitutions)["dxos.keys.PublicKey"]["decode"]>;
|
|
637
|
+
/**
|
|
638
|
+
* Options:
|
|
639
|
+
* - proto3_optional = true
|
|
640
|
+
*/
|
|
641
|
+
noTail?: boolean;
|
|
461
642
|
}
|
|
462
643
|
/**
|
|
463
644
|
* Defined in:
|
|
@@ -696,179 +877,4 @@ export interface NetworkService {
|
|
|
696
877
|
updateConfig: (request: UpdateConfigRequest) => Promise<void>;
|
|
697
878
|
queryStatus: (request: void) => Stream<NetworkStatus>;
|
|
698
879
|
}
|
|
699
|
-
/**
|
|
700
|
-
* Defined in:
|
|
701
|
-
* {@link file://./../../../dxos/client/logging.proto}
|
|
702
|
-
*/
|
|
703
|
-
export interface Metrics {
|
|
704
|
-
timestamp: ReturnType<(typeof substitutions)["google.protobuf.Timestamp"]["decode"]>;
|
|
705
|
-
values?: Metrics.KeyPair[];
|
|
706
|
-
}
|
|
707
|
-
export declare namespace Metrics {
|
|
708
|
-
/**
|
|
709
|
-
* Defined in:
|
|
710
|
-
* {@link file://./../../../dxos/client/logging.proto}
|
|
711
|
-
*/
|
|
712
|
-
interface KeyPair {
|
|
713
|
-
/**
|
|
714
|
-
* Options:
|
|
715
|
-
* - proto3_optional = true
|
|
716
|
-
*/
|
|
717
|
-
key?: string;
|
|
718
|
-
/**
|
|
719
|
-
* Options:
|
|
720
|
-
* - proto3_optional = true
|
|
721
|
-
*/
|
|
722
|
-
value?: dxos_value.Value;
|
|
723
|
-
/**
|
|
724
|
-
* Options:
|
|
725
|
-
* - proto3_optional = true
|
|
726
|
-
*/
|
|
727
|
-
stats?: dxos_value.Stats;
|
|
728
|
-
}
|
|
729
|
-
}
|
|
730
|
-
/**
|
|
731
|
-
* Defined in:
|
|
732
|
-
* {@link file://./../../../dxos/client/logging.proto}
|
|
733
|
-
*/
|
|
734
|
-
export interface ControlMetricsRequest {
|
|
735
|
-
/**
|
|
736
|
-
* Options:
|
|
737
|
-
* - proto3_optional = true
|
|
738
|
-
*/
|
|
739
|
-
reset?: boolean;
|
|
740
|
-
/**
|
|
741
|
-
* Options:
|
|
742
|
-
* - proto3_optional = true
|
|
743
|
-
*/
|
|
744
|
-
record?: boolean;
|
|
745
|
-
}
|
|
746
|
-
/**
|
|
747
|
-
* Defined in:
|
|
748
|
-
* {@link file://./../../../dxos/client/logging.proto}
|
|
749
|
-
*/
|
|
750
|
-
export interface ControlMetricsResponse {
|
|
751
|
-
/**
|
|
752
|
-
* Options:
|
|
753
|
-
* - proto3_optional = true
|
|
754
|
-
*/
|
|
755
|
-
recording?: boolean;
|
|
756
|
-
}
|
|
757
|
-
/**
|
|
758
|
-
* Defined in:
|
|
759
|
-
* {@link file://./../../../dxos/client/logging.proto}
|
|
760
|
-
*/
|
|
761
|
-
export interface QueryMetricsRequest {
|
|
762
|
-
/**
|
|
763
|
-
* Options:
|
|
764
|
-
* - proto3_optional = true
|
|
765
|
-
*/
|
|
766
|
-
interval?: number;
|
|
767
|
-
}
|
|
768
|
-
/**
|
|
769
|
-
* Defined in:
|
|
770
|
-
* {@link file://./../../../dxos/client/logging.proto}
|
|
771
|
-
*/
|
|
772
|
-
export interface QueryMetricsResponse {
|
|
773
|
-
timestamp: ReturnType<(typeof substitutions)["google.protobuf.Timestamp"]["decode"]>;
|
|
774
|
-
metrics: Metrics;
|
|
775
|
-
}
|
|
776
|
-
/**
|
|
777
|
-
* Defined in:
|
|
778
|
-
* {@link file://./../../../dxos/client/logging.proto}
|
|
779
|
-
*/
|
|
780
|
-
export declare enum LogLevel {
|
|
781
|
-
TRACE = 5,
|
|
782
|
-
DEBUG = 10,
|
|
783
|
-
INFO = 11,
|
|
784
|
-
WARN = 12,
|
|
785
|
-
ERROR = 13
|
|
786
|
-
}
|
|
787
|
-
/**
|
|
788
|
-
* Defined in:
|
|
789
|
-
* {@link file://./../../../dxos/client/logging.proto}
|
|
790
|
-
*/
|
|
791
|
-
export interface QueryLogsRequest {
|
|
792
|
-
filters?: QueryLogsRequest.Filter[];
|
|
793
|
-
/**
|
|
794
|
-
* Options:
|
|
795
|
-
* - proto3_optional = true
|
|
796
|
-
*/
|
|
797
|
-
options?: QueryLogsRequest.MatchingOptions;
|
|
798
|
-
}
|
|
799
|
-
export declare namespace QueryLogsRequest {
|
|
800
|
-
/**
|
|
801
|
-
* Defined in:
|
|
802
|
-
* {@link file://./../../../dxos/client/logging.proto}
|
|
803
|
-
*/
|
|
804
|
-
enum MatchingOptions {
|
|
805
|
-
INCLUSIVE = 1,
|
|
806
|
-
EXPLICIT = 2
|
|
807
|
-
}
|
|
808
|
-
/**
|
|
809
|
-
* Defined in:
|
|
810
|
-
* {@link file://./../../../dxos/client/logging.proto}
|
|
811
|
-
*/
|
|
812
|
-
interface Filter {
|
|
813
|
-
level: LogLevel;
|
|
814
|
-
/**
|
|
815
|
-
* Options:
|
|
816
|
-
* - proto3_optional = true
|
|
817
|
-
*/
|
|
818
|
-
pattern?: string;
|
|
819
|
-
}
|
|
820
|
-
}
|
|
821
|
-
/**
|
|
822
|
-
* Defined in:
|
|
823
|
-
* {@link file://./../../../dxos/client/logging.proto}
|
|
824
|
-
*/
|
|
825
|
-
export interface LogEntry {
|
|
826
|
-
level: LogLevel;
|
|
827
|
-
message: string;
|
|
828
|
-
/**
|
|
829
|
-
* Options:
|
|
830
|
-
* - proto3_optional = true
|
|
831
|
-
*/
|
|
832
|
-
context?: ReturnType<(typeof substitutions)["google.protobuf.Struct"]["decode"]>;
|
|
833
|
-
/**
|
|
834
|
-
* Options:
|
|
835
|
-
* - proto3_optional = true
|
|
836
|
-
*/
|
|
837
|
-
meta?: LogEntry.Meta;
|
|
838
|
-
/**
|
|
839
|
-
* Options:
|
|
840
|
-
* - proto3_optional = true
|
|
841
|
-
*/
|
|
842
|
-
error?: dxos_error.Error;
|
|
843
|
-
timestamp: ReturnType<(typeof substitutions)["google.protobuf.Timestamp"]["decode"]>;
|
|
844
|
-
}
|
|
845
|
-
export declare namespace LogEntry {
|
|
846
|
-
/**
|
|
847
|
-
* Defined in:
|
|
848
|
-
* {@link file://./../../../dxos/client/logging.proto}
|
|
849
|
-
*/
|
|
850
|
-
interface Meta {
|
|
851
|
-
file: string;
|
|
852
|
-
line: number;
|
|
853
|
-
/**
|
|
854
|
-
* Options:
|
|
855
|
-
* - proto3_optional = true
|
|
856
|
-
*/
|
|
857
|
-
scope?: ReturnType<(typeof substitutions)["google.protobuf.Struct"]["decode"]>;
|
|
858
|
-
/**
|
|
859
|
-
* Options:
|
|
860
|
-
* - proto3_optional = true
|
|
861
|
-
*/
|
|
862
|
-
resourceId?: number;
|
|
863
|
-
}
|
|
864
|
-
}
|
|
865
|
-
/**
|
|
866
|
-
* Defined in:
|
|
867
|
-
* {@link file://./../../../dxos/client/logging.proto}
|
|
868
|
-
*/
|
|
869
|
-
export interface LoggingService {
|
|
870
|
-
controlMetrics: (request: ControlMetricsRequest) => Promise<ControlMetricsResponse>;
|
|
871
|
-
queryMetrics: (request: QueryMetricsRequest) => Stream<QueryMetricsResponse>;
|
|
872
|
-
queryLogs: (request: QueryLogsRequest) => Stream<LogEntry>;
|
|
873
|
-
}
|
|
874
880
|
//# sourceMappingURL=services.d.ts.map
|