@dxos/protocols 0.8.4-main.c4373fc → 0.8.4-main.c85a9c8dae
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/README.md +1 -1
- package/dist/src/FeedProtocol.d.ts +528 -0
- package/dist/src/FeedProtocol.d.ts.map +1 -0
- package/dist/src/FeedProtocol.js +237 -0
- package/dist/src/FeedProtocol.js.map +1 -0
- package/dist/src/FunctionProtocol.d.ts +82 -0
- package/dist/src/FunctionProtocol.d.ts.map +1 -0
- package/dist/src/FunctionProtocol.js +4 -0
- package/dist/src/FunctionProtocol.js.map +1 -0
- package/dist/src/automerge.d.ts +8 -0
- package/dist/src/automerge.d.ts.map +1 -1
- package/dist/src/automerge.js.map +1 -1
- package/dist/src/buf/proto/gen/dxos/client/queue_pb.d.ts +231 -0
- package/dist/src/buf/proto/gen/dxos/client/queue_pb.d.ts.map +1 -0
- package/dist/src/buf/proto/gen/dxos/client/queue_pb.js +44 -0
- package/dist/src/buf/proto/gen/dxos/client/queue_pb.js.map +1 -0
- package/dist/src/buf/proto/gen/dxos/client/services_pb.d.ts +69 -19
- package/dist/src/buf/proto/gen/dxos/client/services_pb.d.ts.map +1 -1
- package/dist/src/buf/proto/gen/dxos/client/services_pb.js +31 -22
- package/dist/src/buf/proto/gen/dxos/client/services_pb.js.map +1 -1
- package/dist/src/buf/proto/gen/dxos/echo/query_pb.d.ts +12 -2
- package/dist/src/buf/proto/gen/dxos/echo/query_pb.d.ts.map +1 -1
- package/dist/src/buf/proto/gen/dxos/echo/query_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/echo/query_pb.js.map +1 -1
- package/dist/src/buf/proto/gen/dxos/echo/service_pb.d.ts +55 -9
- package/dist/src/buf/proto/gen/dxos/echo/service_pb.d.ts.map +1 -1
- package/dist/src/buf/proto/gen/dxos/echo/service_pb.js +15 -5
- package/dist/src/buf/proto/gen/dxos/echo/service_pb.js.map +1 -1
- package/dist/src/buf/proto/gen/dxos/google_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/google_pb.js.map +1 -1
- package/dist/src/buf/proto/gen/dxos/iframe_pb.d.ts +1 -0
- package/dist/src/buf/proto/gen/dxos/iframe_pb.d.ts.map +1 -1
- package/dist/src/buf/proto/gen/dxos/iframe_pb.js.map +1 -1
- package/dist/src/buf/proto/gen/dxos/tracing_pb.js +1 -1
- package/dist/src/buf/proto/gen/dxos/tracing_pb.js.map +1 -1
- package/dist/src/codec.test.js +1 -1
- package/dist/src/edge/EdgeFunctionEnv.d.ts +121 -0
- package/dist/src/edge/EdgeFunctionEnv.d.ts.map +1 -0
- package/dist/src/edge/EdgeFunctionEnv.js +4 -0
- package/dist/src/edge/EdgeFunctionEnv.js.map +1 -0
- package/dist/src/{edge.d.ts → edge/edge.d.ts} +117 -10
- package/dist/src/edge/edge.d.ts.map +1 -0
- package/dist/src/edge/edge.js +169 -0
- package/dist/src/edge/edge.js.map +1 -0
- package/dist/src/edge/errors.d.ts +29 -0
- package/dist/src/edge/errors.d.ts.map +1 -0
- package/dist/src/edge/errors.js +69 -0
- package/dist/src/edge/errors.js.map +1 -0
- package/dist/src/edge/index.d.ts +4 -0
- package/dist/src/edge/index.d.ts.map +1 -0
- package/dist/src/edge/index.js +7 -0
- package/dist/src/edge/index.js.map +1 -0
- package/dist/src/errors/base-errors.d.ts +86 -8
- package/dist/src/errors/base-errors.d.ts.map +1 -1
- package/dist/src/errors/base-errors.js +4 -20
- package/dist/src/errors/base-errors.js.map +1 -1
- package/dist/src/errors/encoding.d.ts +2 -2
- package/dist/src/errors/encoding.d.ts.map +1 -1
- package/dist/src/errors/encoding.js +1 -1
- package/dist/src/errors/errors.d.ts +619 -42
- package/dist/src/errors/errors.d.ts.map +1 -1
- package/dist/src/errors/errors.js +50 -104
- package/dist/src/errors/errors.js.map +1 -1
- package/dist/src/errors/errors.test.js +2 -2
- package/dist/src/errors/errors.test.js.map +1 -1
- package/dist/src/errors/helpers.d.ts +9 -5
- package/dist/src/errors/helpers.d.ts.map +1 -1
- package/dist/src/errors/helpers.js +3 -3
- package/dist/src/errors/helpers.js.map +1 -1
- package/dist/src/errors/index.d.ts +5 -5
- package/dist/src/errors/index.js +5 -5
- package/dist/src/feed-replication.d.ts.map +1 -1
- package/dist/src/index.d.ts +12 -12
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +11 -11
- package/dist/src/index.js.map +1 -1
- package/dist/src/indexing.test.js +1 -1
- package/dist/src/messenger.d.ts +16 -0
- package/dist/src/messenger.d.ts.map +1 -0
- package/dist/src/messenger.js +4 -0
- package/dist/src/messenger.js.map +1 -0
- package/dist/src/proto/gen/dxos/client/services.d.ts +300 -145
- package/dist/src/proto/gen/dxos/client/services.d.ts.map +1 -1
- package/dist/src/proto/gen/dxos/client/services.js +37 -33
- package/dist/src/proto/gen/dxos/client/services.js.map +1 -1
- package/dist/src/proto/gen/dxos/devtools/host.d.ts +31 -31
- package/dist/src/proto/gen/dxos/devtools/host.d.ts.map +1 -1
- package/dist/src/proto/gen/dxos/echo/query.d.ts +17 -1
- package/dist/src/proto/gen/dxos/echo/query.d.ts.map +1 -1
- package/dist/src/proto/gen/dxos/echo/query.js.map +1 -1
- package/dist/src/proto/gen/dxos/echo/service.d.ts +34 -8
- package/dist/src/proto/gen/dxos/echo/service.d.ts.map +1 -1
- package/dist/src/proto/gen/google/protobuf.d.ts +31 -31
- package/dist/src/proto/gen/google/protobuf.d.ts.map +1 -1
- package/dist/src/proto/gen/google/protobuf.js.map +1 -1
- package/dist/src/proto/gen/index.d.ts +10 -0
- package/dist/src/proto/gen/index.d.ts.map +1 -1
- package/dist/src/proto/gen/index.js +1 -1
- package/dist/src/proto/gen/index.js.map +1 -1
- package/dist/src/proto/index.d.ts +2 -2
- package/dist/src/proto/index.js +1 -1
- package/dist/src/proto/types.d.ts +1 -1
- package/dist/src/types.d.ts +2 -2
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +19 -15
- package/src/FeedProtocol.ts +320 -0
- package/src/FunctionProtocol.ts +102 -0
- package/src/automerge.ts +8 -0
- package/src/buf/proto/gen/dxos/agent/dashboard_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/agent/echo-proxy_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/agent/epoch_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/agent/functions_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/bot_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/client/invitation_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/client/logging_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/client/queue_pb.ts +280 -0
- package/src/buf/proto/gen/dxos/client/services_pb.ts +87 -27
- package/src/buf/proto/gen/dxos/config_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/devtools/diagnostics_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/devtools/host_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/devtools/swarm_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/echo/blob_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/echo/feed_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/echo/filter_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/echo/indexing_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/echo/metadata_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/echo/model/document_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/echo/model/messenger_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/echo/model/text_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/echo/object_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/echo/query_pb.ts +16 -4
- package/src/buf/proto/gen/dxos/echo/service_pb.ts +68 -16
- package/src/buf/proto/gen/dxos/echo/snapshot_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/echo/timeframe_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/edge/calls_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/edge/messenger_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/edge/signal_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/error_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/field_options_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/google_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/gravity_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/halo/credentials/auth_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/halo/credentials/greet_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/halo/credentials/identity_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/halo/credentials_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/halo/invitations_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/halo/keyring_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/halo/keys_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/halo/signed_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/iframe_pb.ts +2 -1
- package/src/buf/proto/gen/dxos/keys_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/mesh/bridge_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/mesh/broadcast_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/mesh/messaging_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/mesh/muxer_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/mesh/presence_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/mesh/protocol_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/mesh/replicator_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/mesh/signal_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/mesh/swarm_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/mesh/teleport/admission-discovery_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/mesh/teleport/auth_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/mesh/teleport/automerge_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/mesh/teleport/blobsync_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/mesh/teleport/control_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/mesh/teleport/gossip_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/mesh/teleport/notarization_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/mesh/teleport/replicator_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/registry_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/rpc_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/service/agentmanager_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/service/publisher_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/service/supervisor_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/service/tunnel_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/tracing_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/type_pb.ts +1 -1
- package/src/buf/proto/gen/dxos/value_pb.ts +1 -1
- package/src/buf/proto/gen/example/testing/data_pb.ts +1 -1
- package/src/buf/proto/gen/example/testing/rpc_pb.ts +1 -1
- package/src/codec.test.ts +1 -1
- package/src/edge/EdgeFunctionEnv.ts +203 -0
- package/src/edge/edge.ts +493 -0
- package/src/edge/errors.ts +85 -0
- package/src/edge/index.ts +7 -0
- package/src/errors/base-errors.ts +4 -22
- package/src/errors/encoding.ts +2 -2
- package/src/errors/errors.test.ts +2 -2
- package/src/errors/errors.ts +57 -123
- package/src/errors/helpers.ts +6 -7
- package/src/errors/index.ts +5 -5
- package/src/feed-replication.ts +1 -0
- package/src/index.ts +12 -12
- package/src/indexing.test.ts +1 -1
- package/src/messenger.ts +22 -0
- package/src/proto/dxos/client/queue.proto +78 -0
- package/src/proto/dxos/client/services.proto +21 -3
- package/src/proto/dxos/echo/query.proto +4 -1
- package/src/proto/dxos/echo/service.proto +27 -6
- package/src/proto/dxos/iframe.proto +1 -0
- package/src/proto/gen/dxos/client/services.ts +300 -145
- package/src/proto/gen/dxos/devtools/host.ts +31 -31
- package/src/proto/gen/dxos/echo/query.ts +17 -1
- package/src/proto/gen/dxos/echo/service.ts +33 -8
- package/src/proto/gen/google/protobuf.ts +31 -31
- package/src/proto/gen/index.ts +11 -1
- package/src/proto/index.ts +2 -2
- package/src/proto/types.ts +1 -1
- package/src/types.ts +2 -2
- package/dist/src/edge-error.d.ts +0 -26
- package/dist/src/edge-error.d.ts.map +0 -1
- package/dist/src/edge-error.js +0 -102
- package/dist/src/edge-error.js.map +0 -1
- package/dist/src/edge.d.ts.map +0 -1
- package/dist/src/edge.js +0 -49
- package/dist/src/edge.js.map +0 -1
- package/dist/src/query.d.ts +0 -5
- package/dist/src/query.d.ts.map +0 -1
- package/dist/src/query.js +0 -8
- package/dist/src/query.js.map +0 -1
- package/dist/src/queue.d.ts +0 -28
- package/dist/src/queue.d.ts.map +0 -1
- package/dist/src/queue.js +0 -8
- package/dist/src/queue.js.map +0 -1
- package/src/edge-error.ts +0 -134
- package/src/edge.ts +0 -279
- package/src/query.ts +0 -8
- package/src/queue.ts +0 -38
package/src/edge.ts
DELETED
|
@@ -1,279 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2024 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import * as Schema from 'effect/Schema';
|
|
6
|
-
|
|
7
|
-
import { SpaceId } from '@dxos/keys';
|
|
8
|
-
|
|
9
|
-
// TODO(burdon): Rename EdgerRouterEndpoint.
|
|
10
|
-
// If we would rename it, we need to be careful to not break composer production.
|
|
11
|
-
export enum EdgeService {
|
|
12
|
-
AUTOMERGE_REPLICATOR = 'automerge-replicator',
|
|
13
|
-
FEED_REPLICATOR = 'feed-replicator',
|
|
14
|
-
SWARM = 'swarm',
|
|
15
|
-
SIGNAL = 'signal',
|
|
16
|
-
STATUS = 'status',
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export type EdgeHttpSuccess<T> = {
|
|
20
|
-
success: true;
|
|
21
|
-
data: T;
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
export type EdgeErrorData = { type: string } & Record<string, any>;
|
|
25
|
-
|
|
26
|
-
export type EdgeHttpFailure = {
|
|
27
|
-
// TODO(burdon): Why is this required?
|
|
28
|
-
success: false;
|
|
29
|
-
/**
|
|
30
|
-
* An explanation of why the call failed. Used mostly for logging and monitoring.
|
|
31
|
-
*/
|
|
32
|
-
reason: string;
|
|
33
|
-
/**
|
|
34
|
-
* Information that can be used to retry the request such that it will succeed, for example:
|
|
35
|
-
* 1. { type: 'auth_required', challenge: string }
|
|
36
|
-
* Requires retrying the request with challenge signature included.
|
|
37
|
-
* 2. { type: 'user_confirmation_required', dialog: { title: string, message: string, confirmation_payload: string } }
|
|
38
|
-
* Requires showing a confirmation dialog to a user and retrying the request with confirmation_payload included
|
|
39
|
-
* if the user confirms.
|
|
40
|
-
* When errorData is returned simply retrying the request won't have any effect.
|
|
41
|
-
* EdgeHttpClient should parse well-known errorData into Error types and throw.
|
|
42
|
-
*/
|
|
43
|
-
errorData?: EdgeErrorData;
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
export type EdgeHttpResponse<T> = EdgeHttpSuccess<T> | EdgeHttpFailure;
|
|
47
|
-
|
|
48
|
-
export type GetNotarizationResponseBody = {
|
|
49
|
-
awaitingNotarization: { credentials: string[] };
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
export type ExecuteWorkflowResponseBody = {
|
|
53
|
-
success: boolean;
|
|
54
|
-
reason?: string;
|
|
55
|
-
output?: any;
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
export type PostNotarizationRequestBody = {
|
|
59
|
-
credentials: string[];
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
export type JoinSpaceRequest = {
|
|
63
|
-
invitationId: string;
|
|
64
|
-
identityKey: string;
|
|
65
|
-
/**
|
|
66
|
-
* Base64 encoded signed challenge.
|
|
67
|
-
* Used to verify the IdentityKey in case of `invitation.authMethod === Invitation.AuthMethod.KNOWN_PUBLIC_KEY`
|
|
68
|
-
*/
|
|
69
|
-
signature?: string;
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
export type JoinSpaceResponseBody = {
|
|
73
|
-
spaceMemberCredential: string;
|
|
74
|
-
spaceGenesisFeedKey: string;
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
export type RecoverIdentitySignature =
|
|
78
|
-
| string
|
|
79
|
-
// This is the format of the signature from the WebAuthn authenticator.
|
|
80
|
-
| {
|
|
81
|
-
signature: string;
|
|
82
|
-
clientDataJson: string;
|
|
83
|
-
authenticatorData: string;
|
|
84
|
-
};
|
|
85
|
-
|
|
86
|
-
export type RecoverIdentityRequest = {
|
|
87
|
-
deviceKey: string;
|
|
88
|
-
controlFeedKey: string;
|
|
89
|
-
lookupKey?: string;
|
|
90
|
-
signature?: RecoverIdentitySignature;
|
|
91
|
-
token?: string;
|
|
92
|
-
};
|
|
93
|
-
|
|
94
|
-
export type RecoverIdentityResponseBody = {
|
|
95
|
-
identityKey: string;
|
|
96
|
-
haloSpaceKey: string;
|
|
97
|
-
genesisFeedKey: string;
|
|
98
|
-
deviceAuthCredential: string;
|
|
99
|
-
};
|
|
100
|
-
|
|
101
|
-
export type CreateAgentRequestBody = {
|
|
102
|
-
identityKey: string;
|
|
103
|
-
haloSpaceId: SpaceId;
|
|
104
|
-
haloSpaceKey: string;
|
|
105
|
-
};
|
|
106
|
-
|
|
107
|
-
export type CreateAgentResponseBody = {
|
|
108
|
-
deviceKey: string;
|
|
109
|
-
feedKey: string;
|
|
110
|
-
};
|
|
111
|
-
|
|
112
|
-
export type GetAgentStatusResponseBody = {
|
|
113
|
-
agent: {
|
|
114
|
-
deviceKey?: string;
|
|
115
|
-
status: EdgeAgentStatus;
|
|
116
|
-
};
|
|
117
|
-
};
|
|
118
|
-
|
|
119
|
-
export type UploadFunctionRequest = {
|
|
120
|
-
name?: string;
|
|
121
|
-
version: string;
|
|
122
|
-
ownerPublicKey: string;
|
|
123
|
-
entryPoint: string;
|
|
124
|
-
assets: Record<string, Uint8Array>;
|
|
125
|
-
};
|
|
126
|
-
|
|
127
|
-
export type UploadFunctionResponseBody = {
|
|
128
|
-
functionId: string;
|
|
129
|
-
version: string;
|
|
130
|
-
meta: {
|
|
131
|
-
key?: string;
|
|
132
|
-
name?: string;
|
|
133
|
-
description?: string;
|
|
134
|
-
/**
|
|
135
|
-
* JSON Schema for the input of the function.
|
|
136
|
-
*/
|
|
137
|
-
inputSchema?: object;
|
|
138
|
-
/**
|
|
139
|
-
* JSON Schema for the output of the function.
|
|
140
|
-
*/
|
|
141
|
-
outputSchema?: object;
|
|
142
|
-
};
|
|
143
|
-
};
|
|
144
|
-
|
|
145
|
-
export type CreateSpaceRequest = {
|
|
146
|
-
/**
|
|
147
|
-
* HEX encoded public key of the agent.
|
|
148
|
-
*/
|
|
149
|
-
agentKey: string;
|
|
150
|
-
};
|
|
151
|
-
|
|
152
|
-
export type CreateSpaceResponseBody = {
|
|
153
|
-
/**
|
|
154
|
-
* HEX encoded public key of the space.
|
|
155
|
-
*/
|
|
156
|
-
spaceKey: string;
|
|
157
|
-
spaceId: SpaceId;
|
|
158
|
-
automergeRoot: string;
|
|
159
|
-
};
|
|
160
|
-
|
|
161
|
-
export enum EdgeAgentStatus {
|
|
162
|
-
ACTIVE = 'active',
|
|
163
|
-
INACTIVE = 'inactive',
|
|
164
|
-
NOT_FOUND = 'not_found',
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
export type EdgeAuthChallenge = {
|
|
168
|
-
type: 'auth_challenge';
|
|
169
|
-
challenge: string;
|
|
170
|
-
};
|
|
171
|
-
|
|
172
|
-
export enum OAuthProvider {
|
|
173
|
-
GOOGLE = 'google',
|
|
174
|
-
BLUESKY = 'bluesky',
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
export const InitiateOAuthFlowRequestSchema = Schema.Struct({
|
|
178
|
-
provider: Schema.Enums(OAuthProvider),
|
|
179
|
-
spaceId: Schema.String.pipe(Schema.filter(SpaceId.isValid)), // TODO(burdon): Use SpaceId.
|
|
180
|
-
accessTokenId: Schema.String,
|
|
181
|
-
scopes: Schema.mutable(Schema.Array(Schema.String)),
|
|
182
|
-
// Set to true if we don't want periodic token refreshes in background, for cases like account connect
|
|
183
|
-
noRefresh: Schema.optional(Schema.Boolean),
|
|
184
|
-
// Provider-specific (user handle or did for bluesky) hint for auth server resolution
|
|
185
|
-
loginHint: Schema.optional(Schema.String),
|
|
186
|
-
});
|
|
187
|
-
export type InitiateOAuthFlowRequest = Schema.Schema.Type<typeof InitiateOAuthFlowRequestSchema>;
|
|
188
|
-
|
|
189
|
-
export type InitiateOAuthFlowResponse = {
|
|
190
|
-
authUrl: string;
|
|
191
|
-
};
|
|
192
|
-
|
|
193
|
-
export type OAuthFlowResult =
|
|
194
|
-
| { success: true; accessToken: string; accessTokenId: string }
|
|
195
|
-
| { success: false; reason: string };
|
|
196
|
-
|
|
197
|
-
export enum EdgeWebsocketProtocol {
|
|
198
|
-
V0 = 'edge-ws-v0',
|
|
199
|
-
/**
|
|
200
|
-
* Enables message framing and muxing by service-id.
|
|
201
|
-
*/
|
|
202
|
-
V1 = 'edge-ws-v1',
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
// TODO(mykola): Reconcile with type in EDGE repo.
|
|
206
|
-
export type EdgeStatus = {
|
|
207
|
-
problems: string[];
|
|
208
|
-
agent: {
|
|
209
|
-
agentStatus?: string;
|
|
210
|
-
agentKey?: string;
|
|
211
|
-
haloSpaceId?: SpaceId;
|
|
212
|
-
fetchError?: string;
|
|
213
|
-
};
|
|
214
|
-
router: {
|
|
215
|
-
connectedDevices?: {
|
|
216
|
-
peerKey: string;
|
|
217
|
-
topics: string[];
|
|
218
|
-
}[];
|
|
219
|
-
metrics?: {
|
|
220
|
-
sentMessages: number;
|
|
221
|
-
receivedMessages: number;
|
|
222
|
-
sentBytes: number;
|
|
223
|
-
receivedBytes: number;
|
|
224
|
-
failedMessages: number;
|
|
225
|
-
failedBytes: number;
|
|
226
|
-
};
|
|
227
|
-
fetchError?: string;
|
|
228
|
-
};
|
|
229
|
-
spaces: {
|
|
230
|
-
data: Record<SpaceId, { diagnostics?: any & { redFlags: string[] }; fetchError?: string }>;
|
|
231
|
-
fetchError?: string;
|
|
232
|
-
};
|
|
233
|
-
};
|
|
234
|
-
|
|
235
|
-
//
|
|
236
|
-
// Space import/export.
|
|
237
|
-
//
|
|
238
|
-
|
|
239
|
-
export type ImportBundleRequest = {
|
|
240
|
-
bundle: {
|
|
241
|
-
/**
|
|
242
|
-
* DocumentId.
|
|
243
|
-
*/
|
|
244
|
-
documentId: string;
|
|
245
|
-
/**
|
|
246
|
-
* Encoded mutation.
|
|
247
|
-
*/
|
|
248
|
-
mutation: string;
|
|
249
|
-
/**
|
|
250
|
-
* Heads of the document.
|
|
251
|
-
*/
|
|
252
|
-
heads: string[];
|
|
253
|
-
}[];
|
|
254
|
-
};
|
|
255
|
-
|
|
256
|
-
export type ExportBundleRequest = {
|
|
257
|
-
/**
|
|
258
|
-
* DocumentId -> Heads (decoded heads since which we want to export).
|
|
259
|
-
*/
|
|
260
|
-
docHeads: Record<string, string[]>;
|
|
261
|
-
};
|
|
262
|
-
|
|
263
|
-
export type ExportBundleResponse = {
|
|
264
|
-
bundle: {
|
|
265
|
-
/**
|
|
266
|
-
* DocumentId.
|
|
267
|
-
*/
|
|
268
|
-
documentId: string;
|
|
269
|
-
/**
|
|
270
|
-
* Encoded mutation.
|
|
271
|
-
*/
|
|
272
|
-
mutation: string;
|
|
273
|
-
}[];
|
|
274
|
-
};
|
|
275
|
-
|
|
276
|
-
export const DocumentCodec = {
|
|
277
|
-
encode: (doc: Uint8Array) => Buffer.from(doc).toString('base64'),
|
|
278
|
-
decode: (doc: string) => new Uint8Array(Buffer.from(doc, 'base64')),
|
|
279
|
-
};
|
package/src/query.ts
DELETED
package/src/queue.ts
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import type { ObjectId } from './types.js';
|
|
6
|
-
|
|
7
|
-
export type QueueCursor = string & { __QueueCursor: never };
|
|
8
|
-
|
|
9
|
-
export type QueueQuery = {
|
|
10
|
-
queueId: ObjectId;
|
|
11
|
-
|
|
12
|
-
after?: QueueCursor;
|
|
13
|
-
before?: QueueCursor;
|
|
14
|
-
limit?: number;
|
|
15
|
-
reverse?: boolean;
|
|
16
|
-
objectIds?: ObjectId[];
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
// TODO(dmaretskyi): Rename QueueQueryResult.
|
|
20
|
-
export type QueryResult = {
|
|
21
|
-
// TODO(dmaretskyi): HasId & HasTypename.
|
|
22
|
-
|
|
23
|
-
objects: unknown[];
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Cursor at the end of the range.
|
|
27
|
-
*/
|
|
28
|
-
nextCursor: QueueCursor | null;
|
|
29
|
-
/**
|
|
30
|
-
* Cursor at the start of the range.
|
|
31
|
-
*/
|
|
32
|
-
prevCursor: QueueCursor | null;
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* Position of an object in the queue that it is in.
|
|
37
|
-
*/
|
|
38
|
-
export const KEY_QUEUE_POSITION = 'dxos.org/key/queue-position';
|