@gonvex/protocol 0.5.2-staging.2 → 0.5.2-staging.21
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 +2 -0
- package/dist/index.d.ts +38 -1
- package/package.json +1 -1
package/README.md
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -58,6 +58,7 @@ export type FunctionManifestEntry = {
|
|
|
58
58
|
args?: ModuleSchema;
|
|
59
59
|
result?: ModuleSchema;
|
|
60
60
|
internal?: boolean;
|
|
61
|
+
public?: boolean;
|
|
61
62
|
delivery?: "oneShot" | "live" | "replica";
|
|
62
63
|
dependencies?: FunctionDependencies;
|
|
63
64
|
replica?: ReplicaCollectionDefinition;
|
|
@@ -149,13 +150,19 @@ export type LiveQueryPlan = {
|
|
|
149
150
|
};
|
|
150
151
|
export type FilterOperator = "contains" | "notContains" | "equals" | "notEquals" | "startsWith" | "endsWith" | "empty" | "notEmpty" | "oneOf" | "lessThan" | "lessThanOrEqual" | "greaterThan" | "greaterThanOrEqual" | "inRange";
|
|
151
152
|
export type LiveExpression = {
|
|
152
|
-
operator: "eq" | "neq" | "gt" | "gte" | "lt" | "lte" | "in" | "contains" | "containsInsensitive" | "range" | "and" | "or" | "not" | "server";
|
|
153
|
+
operator: "eq" | "neq" | "gt" | "gte" | "lt" | "lte" | "in" | "contains" | "containsInsensitive" | "range" | "and" | "or" | "not" | "server" | "inRelation" | "arrayContains";
|
|
153
154
|
column?: string;
|
|
154
155
|
value?: LiveValue;
|
|
155
156
|
valueTo?: LiveValue;
|
|
156
157
|
children?: LiveExpression[];
|
|
158
|
+
relation?: {
|
|
159
|
+
table: string;
|
|
160
|
+
column: string;
|
|
161
|
+
where?: LiveExpression;
|
|
162
|
+
};
|
|
157
163
|
};
|
|
158
164
|
export type LiveValue = {
|
|
165
|
+
context?: "account.id" | "member.id" | "tenant.id";
|
|
159
166
|
argument?: string;
|
|
160
167
|
literal?: JsonValue;
|
|
161
168
|
};
|
|
@@ -234,6 +241,10 @@ export type ReducerCallRequest = {
|
|
|
234
241
|
trace?: MessageTrace;
|
|
235
242
|
/** Stable key for a replayable command; see the `reducer.call` message. */
|
|
236
243
|
idempotencyKey?: string;
|
|
244
|
+
artifactHash?: string;
|
|
245
|
+
clientContract?: number;
|
|
246
|
+
receiptPath?: string;
|
|
247
|
+
intentEntropy?: string;
|
|
237
248
|
};
|
|
238
249
|
export type ReplicaOpenRequest = {
|
|
239
250
|
id: string;
|
|
@@ -285,11 +296,13 @@ export type GonvexManifest = {
|
|
|
285
296
|
};
|
|
286
297
|
export type ClientMessage = {
|
|
287
298
|
type: "auth";
|
|
299
|
+
clientContract?: number;
|
|
288
300
|
id: string;
|
|
289
301
|
token?: string;
|
|
290
302
|
project?: string;
|
|
291
303
|
tenant?: string;
|
|
292
304
|
controlOnly?: boolean;
|
|
305
|
+
public?: boolean;
|
|
293
306
|
device?: BrowserTelemetryInfo;
|
|
294
307
|
capabilities?: ClientCapabilities;
|
|
295
308
|
} | {
|
|
@@ -340,6 +353,10 @@ export type ClientMessage = {
|
|
|
340
353
|
* every duplicate delivery.
|
|
341
354
|
*/
|
|
342
355
|
idempotencyKey?: string;
|
|
356
|
+
artifactHash?: string;
|
|
357
|
+
clientContract?: number;
|
|
358
|
+
receiptPath?: string;
|
|
359
|
+
intentEntropy?: string;
|
|
343
360
|
} | {
|
|
344
361
|
type: "reducer.callMany";
|
|
345
362
|
calls: ReducerCallRequest[];
|
|
@@ -377,6 +394,18 @@ export type ClientMessage = {
|
|
|
377
394
|
trace?: MessageTrace;
|
|
378
395
|
device?: BrowserTelemetryInfo;
|
|
379
396
|
};
|
|
397
|
+
/**
|
|
398
|
+
* Machine-readable disposition of a failed Reducer call.
|
|
399
|
+
*
|
|
400
|
+
* - `rejected`: the Reducer refused the intent (application throw, validation,
|
|
401
|
+
* permission, conflict). Retrying the same call cannot succeed.
|
|
402
|
+
* - `transient`: infrastructure failed and the transaction rolled back. The
|
|
403
|
+
* same idempotency key may be retried.
|
|
404
|
+
* - `update_required`: the client's Reducer artifact or contract is stale.
|
|
405
|
+
* - `unauthenticated`: the connection has no usable tenant session. Keep the
|
|
406
|
+
* intent, re-authenticate, and retry.
|
|
407
|
+
*/
|
|
408
|
+
export type ReducerErrorClass = "rejected" | "transient" | "update_required" | "unauthenticated";
|
|
380
409
|
export type ServerMessage = {
|
|
381
410
|
type: "query.batch";
|
|
382
411
|
messages: ServerMessage[];
|
|
@@ -571,6 +600,10 @@ export type ServerMessage = {
|
|
|
571
600
|
path?: string;
|
|
572
601
|
error: string;
|
|
573
602
|
trace?: MessageTrace;
|
|
603
|
+
/** Absent from runtimes before 0.5.2-staging.15; treat absence as a legacy rejection. */
|
|
604
|
+
class?: ReducerErrorClass;
|
|
605
|
+
/** True when the same call (same idempotency key) may succeed later. */
|
|
606
|
+
retryable?: boolean;
|
|
574
607
|
} | {
|
|
575
608
|
type: "action.result";
|
|
576
609
|
id: string;
|
|
@@ -584,6 +617,10 @@ export type ServerMessage = {
|
|
|
584
617
|
path?: string;
|
|
585
618
|
error: string;
|
|
586
619
|
trace?: MessageTrace;
|
|
620
|
+
} | {
|
|
621
|
+
type: "client.updateRequired";
|
|
622
|
+
reason: string;
|
|
623
|
+
contract: number;
|
|
587
624
|
} | {
|
|
588
625
|
type: "system.reload";
|
|
589
626
|
reason: string;
|