@dxos/protocols 0.8.4-main.406dc2a → 0.8.4-main.59c2e9b

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.
Files changed (198) hide show
  1. package/dist/src/FunctionProtocol.d.ts +82 -0
  2. package/dist/src/FunctionProtocol.d.ts.map +1 -0
  3. package/dist/src/FunctionProtocol.js +4 -0
  4. package/dist/src/FunctionProtocol.js.map +1 -0
  5. package/dist/src/buf/proto/gen/dxos/client/queue_pb.d.ts +189 -0
  6. package/dist/src/buf/proto/gen/dxos/client/queue_pb.d.ts.map +1 -0
  7. package/dist/src/buf/proto/gen/dxos/client/queue_pb.js +39 -0
  8. package/dist/src/buf/proto/gen/dxos/client/queue_pb.js.map +1 -0
  9. package/dist/src/buf/proto/gen/dxos/config_pb.d.ts +4 -0
  10. package/dist/src/buf/proto/gen/dxos/config_pb.d.ts.map +1 -1
  11. package/dist/src/buf/proto/gen/dxos/config_pb.js +1 -1
  12. package/dist/src/buf/proto/gen/dxos/config_pb.js.map +1 -1
  13. package/dist/src/buf/proto/gen/dxos/echo/query_pb.d.ts +12 -2
  14. package/dist/src/buf/proto/gen/dxos/echo/query_pb.d.ts.map +1 -1
  15. package/dist/src/buf/proto/gen/dxos/echo/query_pb.js +1 -1
  16. package/dist/src/buf/proto/gen/dxos/echo/query_pb.js.map +1 -1
  17. package/dist/src/buf/proto/gen/dxos/echo/service_pb.d.ts +55 -9
  18. package/dist/src/buf/proto/gen/dxos/echo/service_pb.d.ts.map +1 -1
  19. package/dist/src/buf/proto/gen/dxos/echo/service_pb.js +15 -5
  20. package/dist/src/buf/proto/gen/dxos/echo/service_pb.js.map +1 -1
  21. package/dist/src/buf/proto/gen/dxos/google_pb.js +1 -1
  22. package/dist/src/buf/proto/gen/dxos/google_pb.js.map +1 -1
  23. package/dist/src/buf/proto/gen/dxos/iframe_pb.d.ts +1 -0
  24. package/dist/src/buf/proto/gen/dxos/iframe_pb.d.ts.map +1 -1
  25. package/dist/src/buf/proto/gen/dxos/iframe_pb.js.map +1 -1
  26. package/dist/src/buf/proto/gen/dxos/tracing_pb.js +1 -1
  27. package/dist/src/buf/proto/gen/dxos/tracing_pb.js.map +1 -1
  28. package/dist/src/edge/EdgeFunctionEnv.d.ts +120 -0
  29. package/dist/src/edge/EdgeFunctionEnv.d.ts.map +1 -0
  30. package/dist/src/edge/EdgeFunctionEnv.js +4 -0
  31. package/dist/src/edge/EdgeFunctionEnv.js.map +1 -0
  32. package/dist/src/{edge.d.ts → edge/edge.d.ts} +110 -10
  33. package/dist/src/edge/edge.d.ts.map +1 -0
  34. package/dist/src/edge/edge.js +160 -0
  35. package/dist/src/edge/edge.js.map +1 -0
  36. package/dist/src/edge/errors.d.ts +29 -0
  37. package/dist/src/edge/errors.d.ts.map +1 -0
  38. package/dist/src/edge/errors.js +69 -0
  39. package/dist/src/edge/errors.js.map +1 -0
  40. package/dist/src/edge/index.d.ts +4 -0
  41. package/dist/src/edge/index.d.ts.map +1 -0
  42. package/dist/src/edge/index.js +7 -0
  43. package/dist/src/edge/index.js.map +1 -0
  44. package/dist/src/errors/base-errors.d.ts +86 -8
  45. package/dist/src/errors/base-errors.d.ts.map +1 -1
  46. package/dist/src/errors/base-errors.js +4 -20
  47. package/dist/src/errors/base-errors.js.map +1 -1
  48. package/dist/src/errors/encoding.d.ts +1 -1
  49. package/dist/src/errors/encoding.d.ts.map +1 -1
  50. package/dist/src/errors/errors.d.ts +618 -41
  51. package/dist/src/errors/errors.d.ts.map +1 -1
  52. package/dist/src/errors/errors.js +49 -103
  53. package/dist/src/errors/errors.js.map +1 -1
  54. package/dist/src/errors/errors.test.js +1 -1
  55. package/dist/src/errors/errors.test.js.map +1 -1
  56. package/dist/src/errors/helpers.d.ts +8 -4
  57. package/dist/src/errors/helpers.d.ts.map +1 -1
  58. package/dist/src/errors/helpers.js +3 -3
  59. package/dist/src/errors/helpers.js.map +1 -1
  60. package/dist/src/feed-replication.d.ts.map +1 -1
  61. package/dist/src/index.d.ts +3 -3
  62. package/dist/src/index.d.ts.map +1 -1
  63. package/dist/src/index.js +4 -3
  64. package/dist/src/index.js.map +1 -1
  65. package/dist/src/messenger.d.ts +16 -0
  66. package/dist/src/messenger.d.ts.map +1 -0
  67. package/dist/src/messenger.js +4 -0
  68. package/dist/src/messenger.js.map +1 -0
  69. package/dist/src/proto/gen/dxos/client/services.d.ts +254 -151
  70. package/dist/src/proto/gen/dxos/client/services.d.ts.map +1 -1
  71. package/dist/src/proto/gen/dxos/client/services.js +27 -27
  72. package/dist/src/proto/gen/dxos/client/services.js.map +1 -1
  73. package/dist/src/proto/gen/dxos/config.d.ts +5 -0
  74. package/dist/src/proto/gen/dxos/config.d.ts.map +1 -1
  75. package/dist/src/proto/gen/dxos/config.js.map +1 -1
  76. package/dist/src/proto/gen/dxos/echo/query.d.ts +17 -1
  77. package/dist/src/proto/gen/dxos/echo/query.d.ts.map +1 -1
  78. package/dist/src/proto/gen/dxos/echo/query.js.map +1 -1
  79. package/dist/src/proto/gen/dxos/echo/service.d.ts +34 -8
  80. package/dist/src/proto/gen/dxos/echo/service.d.ts.map +1 -1
  81. package/dist/src/proto/gen/index.d.ts +8 -0
  82. package/dist/src/proto/gen/index.d.ts.map +1 -1
  83. package/dist/src/proto/gen/index.js +1 -1
  84. package/dist/src/proto/gen/index.js.map +1 -1
  85. package/dist/src/queue.d.ts +1 -26
  86. package/dist/src/queue.d.ts.map +1 -1
  87. package/dist/src/queue.js +1 -4
  88. package/dist/src/queue.js.map +1 -1
  89. package/dist/tsconfig.tsbuildinfo +1 -1
  90. package/package.json +19 -15
  91. package/src/FunctionProtocol.ts +104 -0
  92. package/src/buf/proto/gen/dxos/agent/dashboard_pb.ts +1 -1
  93. package/src/buf/proto/gen/dxos/agent/echo-proxy_pb.ts +1 -1
  94. package/src/buf/proto/gen/dxos/agent/epoch_pb.ts +1 -1
  95. package/src/buf/proto/gen/dxos/agent/functions_pb.ts +1 -1
  96. package/src/buf/proto/gen/dxos/bot_pb.ts +1 -1
  97. package/src/buf/proto/gen/dxos/client/invitation_pb.ts +1 -1
  98. package/src/buf/proto/gen/dxos/client/logging_pb.ts +1 -1
  99. package/src/buf/proto/gen/dxos/client/queue_pb.ts +231 -0
  100. package/src/buf/proto/gen/dxos/client/services_pb.ts +1 -1
  101. package/src/buf/proto/gen/dxos/config_pb.ts +7 -2
  102. package/src/buf/proto/gen/dxos/devtools/diagnostics_pb.ts +1 -1
  103. package/src/buf/proto/gen/dxos/devtools/host_pb.ts +1 -1
  104. package/src/buf/proto/gen/dxos/devtools/swarm_pb.ts +1 -1
  105. package/src/buf/proto/gen/dxos/echo/blob_pb.ts +1 -1
  106. package/src/buf/proto/gen/dxos/echo/feed_pb.ts +1 -1
  107. package/src/buf/proto/gen/dxos/echo/filter_pb.ts +1 -1
  108. package/src/buf/proto/gen/dxos/echo/indexing_pb.ts +1 -1
  109. package/src/buf/proto/gen/dxos/echo/metadata_pb.ts +1 -1
  110. package/src/buf/proto/gen/dxos/echo/model/document_pb.ts +1 -1
  111. package/src/buf/proto/gen/dxos/echo/model/messenger_pb.ts +1 -1
  112. package/src/buf/proto/gen/dxos/echo/model/text_pb.ts +1 -1
  113. package/src/buf/proto/gen/dxos/echo/object_pb.ts +1 -1
  114. package/src/buf/proto/gen/dxos/echo/query_pb.ts +16 -4
  115. package/src/buf/proto/gen/dxos/echo/service_pb.ts +68 -16
  116. package/src/buf/proto/gen/dxos/echo/snapshot_pb.ts +1 -1
  117. package/src/buf/proto/gen/dxos/echo/timeframe_pb.ts +1 -1
  118. package/src/buf/proto/gen/dxos/edge/calls_pb.ts +1 -1
  119. package/src/buf/proto/gen/dxos/edge/messenger_pb.ts +1 -1
  120. package/src/buf/proto/gen/dxos/edge/signal_pb.ts +1 -1
  121. package/src/buf/proto/gen/dxos/error_pb.ts +1 -1
  122. package/src/buf/proto/gen/dxos/field_options_pb.ts +1 -1
  123. package/src/buf/proto/gen/dxos/google_pb.ts +1 -1
  124. package/src/buf/proto/gen/dxos/gravity_pb.ts +1 -1
  125. package/src/buf/proto/gen/dxos/halo/credentials/auth_pb.ts +1 -1
  126. package/src/buf/proto/gen/dxos/halo/credentials/greet_pb.ts +1 -1
  127. package/src/buf/proto/gen/dxos/halo/credentials/identity_pb.ts +1 -1
  128. package/src/buf/proto/gen/dxos/halo/credentials_pb.ts +1 -1
  129. package/src/buf/proto/gen/dxos/halo/invitations_pb.ts +1 -1
  130. package/src/buf/proto/gen/dxos/halo/keyring_pb.ts +1 -1
  131. package/src/buf/proto/gen/dxos/halo/keys_pb.ts +1 -1
  132. package/src/buf/proto/gen/dxos/halo/signed_pb.ts +1 -1
  133. package/src/buf/proto/gen/dxos/iframe_pb.ts +2 -1
  134. package/src/buf/proto/gen/dxos/keys_pb.ts +1 -1
  135. package/src/buf/proto/gen/dxos/mesh/bridge_pb.ts +1 -1
  136. package/src/buf/proto/gen/dxos/mesh/broadcast_pb.ts +1 -1
  137. package/src/buf/proto/gen/dxos/mesh/messaging_pb.ts +1 -1
  138. package/src/buf/proto/gen/dxos/mesh/muxer_pb.ts +1 -1
  139. package/src/buf/proto/gen/dxos/mesh/presence_pb.ts +1 -1
  140. package/src/buf/proto/gen/dxos/mesh/protocol_pb.ts +1 -1
  141. package/src/buf/proto/gen/dxos/mesh/replicator_pb.ts +1 -1
  142. package/src/buf/proto/gen/dxos/mesh/signal_pb.ts +1 -1
  143. package/src/buf/proto/gen/dxos/mesh/swarm_pb.ts +1 -1
  144. package/src/buf/proto/gen/dxos/mesh/teleport/admission-discovery_pb.ts +1 -1
  145. package/src/buf/proto/gen/dxos/mesh/teleport/auth_pb.ts +1 -1
  146. package/src/buf/proto/gen/dxos/mesh/teleport/automerge_pb.ts +1 -1
  147. package/src/buf/proto/gen/dxos/mesh/teleport/blobsync_pb.ts +1 -1
  148. package/src/buf/proto/gen/dxos/mesh/teleport/control_pb.ts +1 -1
  149. package/src/buf/proto/gen/dxos/mesh/teleport/gossip_pb.ts +1 -1
  150. package/src/buf/proto/gen/dxos/mesh/teleport/notarization_pb.ts +1 -1
  151. package/src/buf/proto/gen/dxos/mesh/teleport/replicator_pb.ts +1 -1
  152. package/src/buf/proto/gen/dxos/registry_pb.ts +1 -1
  153. package/src/buf/proto/gen/dxos/rpc_pb.ts +1 -1
  154. package/src/buf/proto/gen/dxos/service/agentmanager_pb.ts +1 -1
  155. package/src/buf/proto/gen/dxos/service/publisher_pb.ts +1 -1
  156. package/src/buf/proto/gen/dxos/service/supervisor_pb.ts +1 -1
  157. package/src/buf/proto/gen/dxos/service/tunnel_pb.ts +1 -1
  158. package/src/buf/proto/gen/dxos/tracing_pb.ts +1 -1
  159. package/src/buf/proto/gen/dxos/type_pb.ts +1 -1
  160. package/src/buf/proto/gen/dxos/value_pb.ts +1 -1
  161. package/src/buf/proto/gen/example/testing/data_pb.ts +1 -1
  162. package/src/buf/proto/gen/example/testing/rpc_pb.ts +1 -1
  163. package/src/edge/EdgeFunctionEnv.ts +193 -0
  164. package/src/edge/edge.ts +484 -0
  165. package/src/edge/errors.ts +85 -0
  166. package/src/edge/index.ts +7 -0
  167. package/src/errors/base-errors.ts +4 -22
  168. package/src/errors/errors.test.ts +1 -1
  169. package/src/errors/errors.ts +55 -121
  170. package/src/errors/helpers.ts +5 -6
  171. package/src/feed-replication.ts +1 -0
  172. package/src/index.ts +5 -3
  173. package/src/messenger.ts +22 -0
  174. package/src/proto/dxos/client/queue.proto +67 -0
  175. package/src/proto/dxos/config.proto +2 -0
  176. package/src/proto/dxos/echo/query.proto +4 -1
  177. package/src/proto/dxos/echo/service.proto +27 -6
  178. package/src/proto/dxos/iframe.proto +1 -0
  179. package/src/proto/gen/dxos/client/services.ts +254 -151
  180. package/src/proto/gen/dxos/config.ts +5 -0
  181. package/src/proto/gen/dxos/echo/query.ts +17 -1
  182. package/src/proto/gen/dxos/echo/service.ts +33 -8
  183. package/src/proto/gen/index.ts +9 -1
  184. package/src/queue.ts +9 -33
  185. package/dist/src/edge-error.d.ts +0 -26
  186. package/dist/src/edge-error.d.ts.map +0 -1
  187. package/dist/src/edge-error.js +0 -102
  188. package/dist/src/edge-error.js.map +0 -1
  189. package/dist/src/edge.d.ts.map +0 -1
  190. package/dist/src/edge.js +0 -49
  191. package/dist/src/edge.js.map +0 -1
  192. package/dist/src/query.d.ts +0 -5
  193. package/dist/src/query.d.ts.map +0 -1
  194. package/dist/src/query.js +0 -8
  195. package/dist/src/query.js.map +0 -1
  196. package/src/edge-error.ts +0 -134
  197. package/src/edge.ts +0 -279
  198. package/src/query.ts +0 -8
@@ -67,195 +67,106 @@ import * as example_testing_rpc from "../../example/testing/rpc.js";
67
67
  import * as google_protobuf from "../../google/protobuf.js";
68
68
  /**
69
69
  * Defined in:
70
- * {@link file://./../../../dxos/client/invitation.proto}
71
- */
72
- export interface AdmissionKeypair {
73
- publicKey: ReturnType<(typeof substitutions)["dxos.keys.PublicKey"]["decode"]>;
74
- /**
75
- * Options:
76
- * - proto3_optional = true
77
- */
78
- privateKey?: ReturnType<(typeof substitutions)["dxos.keys.PrivateKey"]["decode"]>;
79
- }
80
- /**
81
- * Runtime state of the space object.
82
- *
83
- * Defined in:
84
- * {@link file://./../../../dxos/client/invitation.proto}
85
- */
86
- export enum SpaceState {
87
- INVALID = 0,
88
- SPACE_INACTIVE = 2,
89
- SPACE_ACTIVE = 6,
90
- SPACE_CLOSED = 1,
91
- SPACE_CONTROL_ONLY = 7,
92
- SPACE_INITIALIZING = 4,
93
- SPACE_READY = 3,
94
- SPACE_ERROR = 5,
95
- SPACE_REQUIRES_MIGRATION = 8
96
- }
97
- /**
98
- * Represents the invitation state passed between client and service.
99
- *
100
- * Defined in:
101
- * {@link file://./../../../dxos/client/invitation.proto}
70
+ * {@link file://./../../../dxos/client/queue.proto}
102
71
  */
103
- export interface Invitation {
104
- /**
105
- * Local identifier (random).
106
- */
107
- invitationId: string;
108
- /**
109
- * Determines the behavior of the invitation.
110
- */
111
- type: Invitation.Type;
112
- /**
113
- * Kind of access the invitation will grant.
114
- */
115
- kind: Invitation.Kind;
116
- /**
117
- * How the invitation is authenticated.
118
- */
119
- authMethod: Invitation.AuthMethod;
120
- /**
121
- * Swarm rendezvous (random).
122
- */
123
- swarmKey: ReturnType<(typeof substitutions)["dxos.keys.PublicKey"]["decode"]>;
124
- /**
125
- * Local state.
126
- */
127
- state: Invitation.State;
72
+ export interface QueueQuery {
73
+ spaceId: string;
128
74
  /**
129
- * Timeout for guest to complete invitation once connected (ms).
130
- *
131
75
  * Options:
132
76
  * - proto3_optional = true
133
77
  */
134
- timeout?: number;
78
+ queuesNamespace?: string;
135
79
  /**
136
- * Guest's identity.
137
- *
138
- * Options:
139
- * - proto3_optional = true
80
+ * Queries the whole space if missing.
140
81
  */
141
- identityKey?: ReturnType<(typeof substitutions)["dxos.keys.PublicKey"]["decode"]>;
82
+ queueIds?: string[];
142
83
  /**
143
- * Space to join (only present if kind is SPACE).
84
+ * Filter items after this cursor. Exclusive.
144
85
  *
145
86
  * Options:
146
87
  * - proto3_optional = true
147
88
  */
148
- spaceKey?: ReturnType<(typeof substitutions)["dxos.keys.PublicKey"]["decode"]>;
89
+ after?: string;
149
90
  /**
150
- * Authentication code created by host (only present if auth_method is SHARED_SECRET).
91
+ * Filter items before this cursor. Exclusive.
151
92
  *
152
93
  * Options:
153
94
  * - proto3_optional = true
154
95
  */
155
- authCode?: string;
96
+ before?: string;
156
97
  /**
157
- * Path or identifier to navigate to after successful authentication.
98
+ * Filter items after this position. Inclusive.
158
99
  *
159
100
  * Options:
160
101
  * - proto3_optional = true
161
102
  */
162
- target?: string;
103
+ beginPosition?: string;
163
104
  /**
164
- * Host should resume invitation on startup until timeout.
105
+ * Filter items before this position. Exclusive.
165
106
  *
166
107
  * Options:
167
108
  * - proto3_optional = true
168
109
  */
169
- persistent?: boolean;
110
+ endPosition?: string;
170
111
  /**
171
112
  * Options:
172
113
  * - proto3_optional = true
173
114
  */
174
- created?: ReturnType<(typeof substitutions)["google.protobuf.Timestamp"]["decode"]>;
115
+ limit?: number;
175
116
  /**
176
117
  * Options:
177
118
  * - proto3_optional = true
178
119
  */
179
- lifetime?: number;
180
- /**
181
- * Whether an invitation can be used multiple times.
182
- *
183
- * Options:
184
- * - proto3_optional = true
185
- */
186
- multiUse?: boolean;
187
- /**
188
- * Guest's keypair required for AuthMethod.KNOWN_PUBLIC_KEY.
189
- *
190
- * Options:
191
- * - proto3_optional = true
192
- */
193
- guestKeypair?: AdmissionKeypair;
194
- /**
195
- * Present on Type.DELEGATED invitations.
196
- *
197
- * Options:
198
- * - proto3_optional = true
199
- */
200
- delegationCredentialId?: ReturnType<(typeof substitutions)["dxos.keys.PublicKey"]["decode"]>;
201
- /**
202
- * Role of the admitted member, defaults to ADMIN.
203
- *
204
- * Options:
205
- * - proto3_optional = true
206
- */
207
- role?: dxos_halo_credentials.SpaceMember.Role;
208
- /**
209
- * Id of a the space to join (only present if kind is SPACE).
210
- *
211
- * Options:
212
- * - proto3_optional = true
213
- */
214
- spaceId?: string;
120
+ reverse?: boolean;
121
+ objectIds?: string[];
215
122
  }
216
- export namespace Invitation {
217
- /**
218
- * Defined in:
219
- * {@link file://./../../../dxos/client/invitation.proto}
220
- */
221
- export enum Type {
222
- INTERACTIVE = 0,
223
- DELEGATED = 1,
224
- MULTIUSE = 2
225
- }
226
- /**
227
- * Defined in:
228
- * {@link file://./../../../dxos/client/invitation.proto}
229
- */
230
- export enum Kind {
231
- DEVICE = 0,
232
- SPACE = 1
233
- }
234
- /**
235
- * Defined in:
236
- * {@link file://./../../../dxos/client/invitation.proto}
237
- */
238
- export enum AuthMethod {
239
- NONE = 0,
240
- SHARED_SECRET = 1,
241
- KNOWN_PUBLIC_KEY = 2
242
- }
123
+ /**
124
+ * Defined in:
125
+ * {@link file://./../../../dxos/client/queue.proto}
126
+ */
127
+ export interface QueueQueryResult {
128
+ objects?: ReturnType<(typeof substitutions)["google.protobuf.Struct"]["decode"]>[];
243
129
  /**
244
- * Defined in:
245
- * {@link file://./../../../dxos/client/invitation.proto}
130
+ * Cursor to query the next items. Can be passed to `after` in query to keep querying.
246
131
  */
247
- export enum State {
248
- INIT = 0,
249
- CONNECTING = 1,
250
- CONNECTED = 2,
251
- READY_FOR_AUTHENTICATION = 3,
252
- AUTHENTICATING = 4,
253
- SUCCESS = 5,
254
- CANCELLED = 6,
255
- TIMEOUT = 7,
256
- ERROR = 8,
257
- EXPIRED = 9
258
- }
132
+ nextCursor: string;
133
+ prevCursor: string;
134
+ }
135
+ /**
136
+ * Defined in:
137
+ * {@link file://./../../../dxos/client/queue.proto}
138
+ */
139
+ export interface QueryQueueRequest {
140
+ query: QueueQuery;
141
+ }
142
+ /**
143
+ * Defined in:
144
+ * {@link file://./../../../dxos/client/queue.proto}
145
+ */
146
+ export interface InsertIntoQueueRequest {
147
+ subspaceTag: string;
148
+ spaceId: string;
149
+ queueId: string;
150
+ objects?: ReturnType<(typeof substitutions)["google.protobuf.Struct"]["decode"]>[];
151
+ }
152
+ /**
153
+ * Defined in:
154
+ * {@link file://./../../../dxos/client/queue.proto}
155
+ */
156
+ export interface DeleteFromQueueRequest {
157
+ subspaceTag: string;
158
+ spaceId: string;
159
+ queueId: string;
160
+ objectIds?: string[];
161
+ }
162
+ /**
163
+ * Defined in:
164
+ * {@link file://./../../../dxos/client/queue.proto}
165
+ */
166
+ export interface QueueService {
167
+ queryQueue: (request: QueryQueueRequest, options?: RequestOptions) => Promise<QueueQueryResult>;
168
+ insertIntoQueue: (request: InsertIntoQueueRequest, options?: RequestOptions) => Promise<void>;
169
+ deleteFromQueue: (request: DeleteFromQueueRequest, options?: RequestOptions) => Promise<void>;
259
170
  }
260
171
  /**
261
172
  * Defined in:
@@ -435,6 +346,198 @@ export interface LoggingService {
435
346
  queryMetrics: (request: QueryMetricsRequest, options?: RequestOptions) => Stream<QueryMetricsResponse>;
436
347
  queryLogs: (request: QueryLogsRequest, options?: RequestOptions) => Stream<LogEntry>;
437
348
  }
349
+ /**
350
+ * Defined in:
351
+ * {@link file://./../../../dxos/client/invitation.proto}
352
+ */
353
+ export interface AdmissionKeypair {
354
+ publicKey: ReturnType<(typeof substitutions)["dxos.keys.PublicKey"]["decode"]>;
355
+ /**
356
+ * Options:
357
+ * - proto3_optional = true
358
+ */
359
+ privateKey?: ReturnType<(typeof substitutions)["dxos.keys.PrivateKey"]["decode"]>;
360
+ }
361
+ /**
362
+ * Runtime state of the space object.
363
+ *
364
+ * Defined in:
365
+ * {@link file://./../../../dxos/client/invitation.proto}
366
+ */
367
+ export enum SpaceState {
368
+ INVALID = 0,
369
+ SPACE_INACTIVE = 2,
370
+ SPACE_ACTIVE = 6,
371
+ SPACE_CLOSED = 1,
372
+ SPACE_CONTROL_ONLY = 7,
373
+ SPACE_INITIALIZING = 4,
374
+ SPACE_READY = 3,
375
+ SPACE_ERROR = 5,
376
+ SPACE_REQUIRES_MIGRATION = 8
377
+ }
378
+ /**
379
+ * Represents the invitation state passed between client and service.
380
+ *
381
+ * Defined in:
382
+ * {@link file://./../../../dxos/client/invitation.proto}
383
+ */
384
+ export interface Invitation {
385
+ /**
386
+ * Local identifier (random).
387
+ */
388
+ invitationId: string;
389
+ /**
390
+ * Determines the behavior of the invitation.
391
+ */
392
+ type: Invitation.Type;
393
+ /**
394
+ * Kind of access the invitation will grant.
395
+ */
396
+ kind: Invitation.Kind;
397
+ /**
398
+ * How the invitation is authenticated.
399
+ */
400
+ authMethod: Invitation.AuthMethod;
401
+ /**
402
+ * Swarm rendezvous (random).
403
+ */
404
+ swarmKey: ReturnType<(typeof substitutions)["dxos.keys.PublicKey"]["decode"]>;
405
+ /**
406
+ * Local state.
407
+ */
408
+ state: Invitation.State;
409
+ /**
410
+ * Timeout for guest to complete invitation once connected (ms).
411
+ *
412
+ * Options:
413
+ * - proto3_optional = true
414
+ */
415
+ timeout?: number;
416
+ /**
417
+ * Guest's identity.
418
+ *
419
+ * Options:
420
+ * - proto3_optional = true
421
+ */
422
+ identityKey?: ReturnType<(typeof substitutions)["dxos.keys.PublicKey"]["decode"]>;
423
+ /**
424
+ * Space to join (only present if kind is SPACE).
425
+ *
426
+ * Options:
427
+ * - proto3_optional = true
428
+ */
429
+ spaceKey?: ReturnType<(typeof substitutions)["dxos.keys.PublicKey"]["decode"]>;
430
+ /**
431
+ * Authentication code created by host (only present if auth_method is SHARED_SECRET).
432
+ *
433
+ * Options:
434
+ * - proto3_optional = true
435
+ */
436
+ authCode?: string;
437
+ /**
438
+ * Path or identifier to navigate to after successful authentication.
439
+ *
440
+ * Options:
441
+ * - proto3_optional = true
442
+ */
443
+ target?: string;
444
+ /**
445
+ * Host should resume invitation on startup until timeout.
446
+ *
447
+ * Options:
448
+ * - proto3_optional = true
449
+ */
450
+ persistent?: boolean;
451
+ /**
452
+ * Options:
453
+ * - proto3_optional = true
454
+ */
455
+ created?: ReturnType<(typeof substitutions)["google.protobuf.Timestamp"]["decode"]>;
456
+ /**
457
+ * Options:
458
+ * - proto3_optional = true
459
+ */
460
+ lifetime?: number;
461
+ /**
462
+ * Whether an invitation can be used multiple times.
463
+ *
464
+ * Options:
465
+ * - proto3_optional = true
466
+ */
467
+ multiUse?: boolean;
468
+ /**
469
+ * Guest's keypair required for AuthMethod.KNOWN_PUBLIC_KEY.
470
+ *
471
+ * Options:
472
+ * - proto3_optional = true
473
+ */
474
+ guestKeypair?: AdmissionKeypair;
475
+ /**
476
+ * Present on Type.DELEGATED invitations.
477
+ *
478
+ * Options:
479
+ * - proto3_optional = true
480
+ */
481
+ delegationCredentialId?: ReturnType<(typeof substitutions)["dxos.keys.PublicKey"]["decode"]>;
482
+ /**
483
+ * Role of the admitted member, defaults to ADMIN.
484
+ *
485
+ * Options:
486
+ * - proto3_optional = true
487
+ */
488
+ role?: dxos_halo_credentials.SpaceMember.Role;
489
+ /**
490
+ * Id of a the space to join (only present if kind is SPACE).
491
+ *
492
+ * Options:
493
+ * - proto3_optional = true
494
+ */
495
+ spaceId?: string;
496
+ }
497
+ export namespace Invitation {
498
+ /**
499
+ * Defined in:
500
+ * {@link file://./../../../dxos/client/invitation.proto}
501
+ */
502
+ export enum Type {
503
+ INTERACTIVE = 0,
504
+ DELEGATED = 1,
505
+ MULTIUSE = 2
506
+ }
507
+ /**
508
+ * Defined in:
509
+ * {@link file://./../../../dxos/client/invitation.proto}
510
+ */
511
+ export enum Kind {
512
+ DEVICE = 0,
513
+ SPACE = 1
514
+ }
515
+ /**
516
+ * Defined in:
517
+ * {@link file://./../../../dxos/client/invitation.proto}
518
+ */
519
+ export enum AuthMethod {
520
+ NONE = 0,
521
+ SHARED_SECRET = 1,
522
+ KNOWN_PUBLIC_KEY = 2
523
+ }
524
+ /**
525
+ * Defined in:
526
+ * {@link file://./../../../dxos/client/invitation.proto}
527
+ */
528
+ export enum State {
529
+ INIT = 0,
530
+ CONNECTING = 1,
531
+ CONNECTED = 2,
532
+ READY_FOR_AUTHENTICATION = 3,
533
+ AUTHENTICATING = 4,
534
+ SUCCESS = 5,
535
+ CANCELLED = 6,
536
+ TIMEOUT = 7,
537
+ ERROR = 8,
538
+ EXPIRED = 9
539
+ }
540
+ }
438
541
  /**
439
542
  * Defined in:
440
543
  * {@link file://./../../../dxos/client/services.proto}
@@ -332,6 +332,11 @@ export namespace Runtime {
332
332
  * - proto3_optional = true
333
333
  */
334
334
  edgeFeatures?: Runtime.Client.EdgeFeatures;
335
+ /**
336
+ * Options:
337
+ * - proto3_optional = true
338
+ */
339
+ enableLocalQueues?: boolean;
335
340
  }
336
341
  export namespace Client {
337
342
  /**
@@ -106,9 +106,25 @@ export interface Heads {
106
106
  export interface QueryResult {
107
107
  id: string;
108
108
  spaceId: string;
109
- documentId: string;
109
+ /**
110
+ * Options:
111
+ * - proto3_optional = true
112
+ */
113
+ documentId?: string;
114
+ /**
115
+ * Options:
116
+ * - proto3_optional = true
117
+ */
118
+ queueId?: string;
119
+ /**
120
+ * Options:
121
+ * - proto3_optional = true
122
+ */
123
+ queueNamespace?: string;
110
124
  rank: number;
111
125
  /**
126
+ * In the ECHO Json object format.
127
+ *
112
128
  * Options:
113
129
  * - proto3_optional = true
114
130
  */
@@ -133,14 +133,6 @@ export interface DocumentUpdate {
133
133
  * Value returned by `Automerge.saveSince()`.
134
134
  */
135
135
  mutation: Uint8Array;
136
- /**
137
- * Set to true for init mutation of document.
138
- * default: undefined.
139
- *
140
- * Options:
141
- * - proto3_optional = true
142
- */
143
- isNew?: boolean;
144
136
  }
145
137
  /**
146
138
  * Defined in:
@@ -187,6 +179,34 @@ export interface WaitUntilHeadsReplicatedRequest {
187
179
  export interface ReIndexHeadsRequest {
188
180
  documentIds?: string[];
189
181
  }
182
+ /**
183
+ * Defined in:
184
+ * {@link file://./../../../dxos/echo/service.proto}
185
+ */
186
+ export interface CreateDocumentRequest {
187
+ /**
188
+ * Space id where the document will be created.
189
+ */
190
+ spaceId: string;
191
+ /**
192
+ * Automerge encoded initial document value.
193
+ * Optional - if not provided, an empty document will be created.
194
+ *
195
+ * Options:
196
+ * - proto3_optional = true
197
+ */
198
+ initialValue?: ReturnType<(typeof substitutions)["google.protobuf.Struct"]["decode"]>;
199
+ }
200
+ /**
201
+ * Defined in:
202
+ * {@link file://./../../../dxos/echo/service.proto}
203
+ */
204
+ export interface CreateDocumentResponse {
205
+ /**
206
+ * The generated document id.
207
+ */
208
+ documentId: string;
209
+ }
190
210
  /**
191
211
  * Defined in:
192
212
  * {@link file://./../../../dxos/echo/service.proto}
@@ -254,6 +274,11 @@ export interface DataService {
254
274
  * Change which documents are subscribed to for specific subscription.
255
275
  */
256
276
  updateSubscription: (request: UpdateSubscriptionRequest, options?: RequestOptions) => Promise<void>;
277
+ /**
278
+ * Create a new automerge document.
279
+ * Returns the generated document id which is controlled by the host.
280
+ */
281
+ createDocument: (request: CreateDocumentRequest, options?: RequestOptions) => Promise<CreateDocumentResponse>;
257
282
  /**
258
283
  * Write incremental updates to multiple automerge documents.
259
284
  * Used to propagate changes from client to services.