@collective-intelligence/extensions-sdk-frontend-react 0.10.0 → 0.12.0
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/AGENTS.md +29 -10
- package/README.md +20 -21
- package/dist/effect/effect-runtime/query-cache.d.ts +3 -146
- package/dist/effect.d.ts +1 -1
- package/dist/effect.js +1 -1
- package/dist/record-layer/collection-ids.d.ts +8 -0
- package/dist/record-layer/collections/id-reads.d.ts +26 -0
- package/dist/record-layer/collections/query.d.ts +55 -0
- package/dist/record-layer/collections/realtime.d.ts +124 -0
- package/dist/record-layer/errors.d.ts +64 -0
- package/dist/record-layer/identity.d.ts +57 -0
- package/dist/record-layer/index.d.ts +23 -0
- package/dist/record-layer/layer.d.ts +11 -0
- package/dist/record-layer/machines.d.ts +45 -0
- package/dist/record-layer/outbox.d.ts +141 -0
- package/dist/record-layer/outbox.test-support.d.ts +182 -0
- package/dist/record-layer/ports.d.ts +141 -0
- package/dist/record-layer/position.d.ts +12 -0
- package/dist/record-layer/seed/client.d.ts +38 -0
- package/dist/record-layer/seed/freshness.d.ts +19 -0
- package/dist/record-layer/seed/server.d.ts +77 -0
- package/dist/record-layer/server.d.ts +6 -0
- package/dist/record-layer/service.d.ts +48 -0
- package/dist/record-layer/targets.d.ts +50 -0
- package/dist/record-layer/write-lock.d.ts +23 -0
- package/dist/record-layer/writes.d.ts +85 -0
- package/dist/records/adapters.d.ts +37 -0
- package/dist/records/runtime-provider.d.ts +22 -0
- package/dist/records.d.ts +12 -0
- package/dist/records.js +2 -0
- package/dist/records.server.d.ts +4 -0
- package/dist/records.server.js +1 -0
- package/dist/studio-api/@tanstack/react-query.gen.d.ts +14 -14
- package/dist/workflow.js +2 -1
- package/dist/workflows/default-template-ui/inputs/default-input-details.d.ts +9 -0
- package/dist/workflows/default-template-ui/inputs/translations.d.ts +5 -0
- package/dist/workflows/field-editor/authored-value.d.ts +4 -0
- package/dist/workflows/workflow-runtime/read-only-saved-value-field.d.ts +10 -0
- package/dist/workflows/workflow-runtime/translations.d.ts +1 -0
- package/docs/effect.md +8 -90
- package/docs/guide/ai/index.md +1 -1
- package/docs/guide/develop/sdks.md +10 -9
- package/docs/record-collections.md +147 -0
- package/docs/tanstack-skills.md +74 -0
- package/package.json +29 -7
- package/skills/extensions-sdk-frontend-react-move-to-record-collections/SKILL.md +54 -0
- package/skills/extensions-sdk-frontend-react-record-collections/SKILL.md +48 -0
- package/skills/extensions-sdk-frontend-react-tanstack-db-ssr/SKILL.md +34 -0
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import * as Cause from "effect/Cause";
|
|
2
|
+
import * as Exit from "effect/Exit";
|
|
3
|
+
import * as Schema from "effect/Schema";
|
|
4
|
+
declare const RecordWriteRefused_base: Schema.Class<RecordWriteRefused, Schema.TaggedStruct<"RecordWriteRefused", {
|
|
5
|
+
readonly message: Schema.String;
|
|
6
|
+
}>, Cause.YieldableError>;
|
|
7
|
+
/**
|
|
8
|
+
* CI refused the write, for example an invalid value or a missing
|
|
9
|
+
* permission. Sending it again with the same key gets the same answer.
|
|
10
|
+
*/
|
|
11
|
+
export declare class RecordWriteRefused extends RecordWriteRefused_base {
|
|
12
|
+
}
|
|
13
|
+
declare const RecordWriteConflict_base: Schema.Class<RecordWriteConflict, Schema.TaggedStruct<"RecordWriteConflict", {
|
|
14
|
+
readonly message: Schema.String;
|
|
15
|
+
}>, Cause.YieldableError>;
|
|
16
|
+
/**
|
|
17
|
+
* The write conflicts with the record that CI holds: a stale revision, a
|
|
18
|
+
* taken client id, or an idempotency key reused for another write.
|
|
19
|
+
*/
|
|
20
|
+
export declare class RecordWriteConflict extends RecordWriteConflict_base {
|
|
21
|
+
}
|
|
22
|
+
declare const RecordWriteOutcomeUnknown_base: Schema.Class<RecordWriteOutcomeUnknown, Schema.TaggedStruct<"RecordWriteOutcomeUnknown", {
|
|
23
|
+
readonly cause: Schema.optional<Schema.Defect>;
|
|
24
|
+
readonly message: Schema.String;
|
|
25
|
+
}>, Cause.YieldableError>;
|
|
26
|
+
/**
|
|
27
|
+
* The answer to the write was lost: CI may or may not have applied it. Only
|
|
28
|
+
* this failure is sent again with the same idempotency key.
|
|
29
|
+
*/
|
|
30
|
+
export declare class RecordWriteOutcomeUnknown extends RecordWriteOutcomeUnknown_base {
|
|
31
|
+
}
|
|
32
|
+
declare const RecordSyncFailed_base: Schema.Class<RecordSyncFailed, Schema.TaggedStruct<"RecordSyncFailed", {
|
|
33
|
+
readonly cause: Schema.optional<Schema.Defect>;
|
|
34
|
+
readonly message: Schema.String;
|
|
35
|
+
readonly retrying: Schema.Boolean;
|
|
36
|
+
}>, Cause.YieldableError>;
|
|
37
|
+
/**
|
|
38
|
+
* A Record Collection could not load or follow its records. `retrying` tells
|
|
39
|
+
* that its sync keeps trying, so the rows and the status stay.
|
|
40
|
+
*/
|
|
41
|
+
export declare class RecordSyncFailed extends RecordSyncFailed_base {
|
|
42
|
+
}
|
|
43
|
+
/** The typed failures of one record write. */
|
|
44
|
+
export type RecordWriteError = RecordWriteConflict | RecordWriteOutcomeUnknown | RecordWriteRefused;
|
|
45
|
+
/** The two calls of a TanStack DB sync run that take a sync failure. */
|
|
46
|
+
export type SyncFailureSink = Readonly<{
|
|
47
|
+
fail: (error: RecordSyncFailed) => void;
|
|
48
|
+
reportError: (error: RecordSyncFailed) => void;
|
|
49
|
+
}>;
|
|
50
|
+
/**
|
|
51
|
+
* Gives a sync failure to TanStack DB: `reportError` while the sync keeps
|
|
52
|
+
* trying after the first ready, so the rows and the status stay; `fail`
|
|
53
|
+
* otherwise, which stops the sync run (before the first ready the status
|
|
54
|
+
* becomes `error`). TanStack DB refuses `reportError` before the first ready.
|
|
55
|
+
*/
|
|
56
|
+
export declare const reportSyncFailure: (sync: SyncFailureSink, ready: boolean, error: RecordSyncFailed) => void;
|
|
57
|
+
/**
|
|
58
|
+
* The exit of a write as TanStack DB settles it. An interrupted write may
|
|
59
|
+
* have reached CI, so its outcome is unknown. A `mutationFn` throws
|
|
60
|
+
* `Cause.squash` of a failure, so the transaction fails with the typed error
|
|
61
|
+
* itself.
|
|
62
|
+
*/
|
|
63
|
+
export declare const settledWrite: <A>(exit: Exit.Exit<A, RecordWriteError>) => Exit.Exit<A, RecordWriteError>;
|
|
64
|
+
export {};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type { QueryClient } from "@tanstack/react-query";
|
|
2
|
+
import type * as Layer from "effect/Layer";
|
|
3
|
+
import { DbClient } from "@tanstack/db";
|
|
4
|
+
import * as ManagedRuntime from "effect/ManagedRuntime";
|
|
5
|
+
import * as Schema from "effect/Schema";
|
|
6
|
+
import type { RecordCollections, RecordCollectionsOptions } from "./service.js";
|
|
7
|
+
import type { RecordWrites } from "./writes.js";
|
|
8
|
+
/** The CI identity that owns a set of Record Collections: one user of one Organization in one application. */
|
|
9
|
+
export type RecordIdentity = Readonly<{
|
|
10
|
+
applicationId: string;
|
|
11
|
+
organizationId: string;
|
|
12
|
+
userId: string;
|
|
13
|
+
}>;
|
|
14
|
+
/** Names one CI identity in Record Collection keys; equal for equal identities. */
|
|
15
|
+
export declare const RecordIdentityKey: Schema.brand<Schema.String, "RecordIdentityKey">;
|
|
16
|
+
export type RecordIdentityKey = typeof RecordIdentityKey.Type;
|
|
17
|
+
export declare const recordIdentityKey: (identity: RecordIdentity) => string & import("effect/Brand").Brand<"RecordIdentityKey">;
|
|
18
|
+
/** The start of the Query keys of every Query Record Collection of one identity. */
|
|
19
|
+
export declare const recordQueryScope: (key: RecordIdentityKey) => readonly ["ci-records", string & import("effect/Brand").Brand<"RecordIdentityKey">];
|
|
20
|
+
/** Runs Effects with the Record Collections and record writes of one identity. */
|
|
21
|
+
export type RecordRuntime = Pick<ManagedRuntime.ManagedRuntime<RecordCollections | RecordWrites, never>, "runFork" | "runPromise" | "runSync">;
|
|
22
|
+
/** The record layer of one CI identity: its own DbClient and the runtime of its services. */
|
|
23
|
+
export type IdentityRecords = Readonly<{
|
|
24
|
+
identity: RecordIdentity;
|
|
25
|
+
key: RecordIdentityKey;
|
|
26
|
+
dbClient: DbClient;
|
|
27
|
+
runtime: RecordRuntime;
|
|
28
|
+
}>;
|
|
29
|
+
export type RecordIdentitiesOptions = Readonly<{
|
|
30
|
+
/** The app's shared QueryClient. */
|
|
31
|
+
queryClient: QueryClient;
|
|
32
|
+
/**
|
|
33
|
+
* The record layer of one identity over its DbClient, with the SDK's ports
|
|
34
|
+
* for that identity.
|
|
35
|
+
*/
|
|
36
|
+
layer: (identity: RecordIdentity, options: RecordCollectionsOptions) => Layer.Layer<RecordCollections | RecordWrites>;
|
|
37
|
+
}>;
|
|
38
|
+
/**
|
|
39
|
+
* The identity scopes of one app's record layer. Each CI identity gets its own
|
|
40
|
+
* scope: a DbClient, a runtime and a Query key prefix. Closing an identity's
|
|
41
|
+
* scope is the only cleanup path. It interrupts the writes and sync fibers
|
|
42
|
+
* that the runtime runs, so a pending write rolls back and a read in flight
|
|
43
|
+
* writes no row; it then cleans up every collection and live query of the
|
|
44
|
+
* DbClient, which also removes the identity's Query Record Collection data
|
|
45
|
+
* from the QueryClient. A new identity starts with new collections, so it never sees a
|
|
46
|
+
* row or a pending value of another.
|
|
47
|
+
*
|
|
48
|
+
* The SDK provider only signals: it asks for the records of the session
|
|
49
|
+
* identity while it renders (`records`), holds them while it is mounted
|
|
50
|
+
* (`retain`), and releases them when the identity changes or it unmounts.
|
|
51
|
+
*/
|
|
52
|
+
export declare const makeRecordIdentities: (options: RecordIdentitiesOptions) => {
|
|
53
|
+
idle: () => Promise<void>;
|
|
54
|
+
records: (identity: RecordIdentity) => IdentityRecords;
|
|
55
|
+
retain: (identity: RecordIdentity) => () => void;
|
|
56
|
+
};
|
|
57
|
+
export type RecordIdentities = ReturnType<typeof makeRecordIdentities>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export type { QueryRecordCollection } from "./collections/query.js";
|
|
2
|
+
export type { RealtimeRecordCollection } from "./collections/realtime.js";
|
|
3
|
+
export type { RecordWriteError, SyncFailureSink } from "./errors.js";
|
|
4
|
+
export { RecordSyncFailed, RecordWriteConflict, RecordWriteOutcomeUnknown, RecordWriteRefused, reportSyncFailure } from "./errors.js";
|
|
5
|
+
export type { IdentityRecords, RecordIdentities, RecordIdentitiesOptions, RecordIdentity, RecordRuntime } from "./identity.js";
|
|
6
|
+
export { makeRecordIdentities, RecordIdentityKey, recordIdentityKey } from "./identity.js";
|
|
7
|
+
export { layer } from "./layer.js";
|
|
8
|
+
export { fromLiveQuery, fromTransaction } from "./machines.js";
|
|
9
|
+
export type { OutboxPage, RecordOutboxOptions } from "./outbox.js";
|
|
10
|
+
export { browserOutboxStorage, dropOutbox, OrganizationId, layer as outboxLayer, makeOutboxPage, OutboxStorageKey, outboxStorageKey, RecordOutbox, UserId } from "./outbox.js";
|
|
11
|
+
export type { RealtimeChangeItem, RecordCreateRequest, RecordDeleteRequest, RecordRow, RecordTopic, RecordUpdateRequest, RecordWriteAnswer, RecordWriteTarget, UndecodedRecord } from "./ports.js";
|
|
12
|
+
export { IdempotencyKey, RealtimeChangeSource, RecordId, RecordRevision, RecordWriteTransport } from "./ports.js";
|
|
13
|
+
export { RecordPosition } from "./position.js";
|
|
14
|
+
export type { RecordSeedBoundaryProps } from "./seed/client.js";
|
|
15
|
+
export { RecordScopeProvider, RecordSeedBoundary } from "./seed/client.js";
|
|
16
|
+
export type { RecordSeed } from "./seed/server.js";
|
|
17
|
+
export type { QueryRecordCollectionOptions, RecordCollectionsOptions, RecordCollectionsValue, RecordValueSchema } from "./service.js";
|
|
18
|
+
export { RecordCollections } from "./service.js";
|
|
19
|
+
export type { TargetCollection } from "./targets.js";
|
|
20
|
+
export { targetCollections } from "./targets.js";
|
|
21
|
+
export { writeLockRegistryKey } from "./write-lock.js";
|
|
22
|
+
export type { RecordCollection, RecordCreateInput, RecordDeleteInput, RecordUpdateInput, RecordWritesValue } from "./writes.js";
|
|
23
|
+
export { RecordWrites } from "./writes.js";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as Layer from "effect/Layer";
|
|
2
|
+
import type { RecordCollectionsOptions } from "./service.js";
|
|
3
|
+
import * as RecordCollections from "./service.js";
|
|
4
|
+
import * as RecordWrites from "./writes.js";
|
|
5
|
+
/**
|
|
6
|
+
* `RecordCollections` and `RecordWrites` of one CI identity, over its
|
|
7
|
+
* DbClient and the app's shared QueryClient. The SDK's `./records` entry
|
|
8
|
+
* provides the two ports, `RealtimeChangeSource` and `RecordWriteTransport`.
|
|
9
|
+
* Closing the Layer's scope cleans up every Record Collection it opened.
|
|
10
|
+
*/
|
|
11
|
+
export declare const layer: (options: RecordCollectionsOptions) => Layer.Layer<RecordCollections.RecordCollections | RecordWrites.RecordWrites, never, import("./ports").RealtimeChangeSource | import("./ports").RecordWriteTransport>;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { EffectRunner } from "@collective-intelligence/effect-xstate/actors";
|
|
2
|
+
import type { CallbackActorLogic, PromiseActorLogic } from "xstate";
|
|
3
|
+
import * as Effect from "effect/Effect";
|
|
4
|
+
import type { RecordWritesValue } from "./writes.js";
|
|
5
|
+
import { RecordWrites } from "./writes.js";
|
|
6
|
+
/**
|
|
7
|
+
* XState actor logic that runs one `RecordWrites` action on the runtime of
|
|
8
|
+
* the actor input. The actor's output is the action's value, such as the
|
|
9
|
+
* confirmed row of an update; a typed write error fails the actor. A stop of
|
|
10
|
+
* the actor interrupts the write, so its send stops and TanStack DB rolls
|
|
11
|
+
* back its optimistic change. The machine keeps what it needs of the output,
|
|
12
|
+
* such as the record's id: the rows stay in their Record Collection.
|
|
13
|
+
*/
|
|
14
|
+
export declare const fromTransaction: <A, E, R, I extends Readonly<{
|
|
15
|
+
runtime: EffectRunner<R | RecordWrites>;
|
|
16
|
+
}>>(write: (writes: RecordWritesValue, input: I) => Effect.Effect<A, E, R>) => PromiseActorLogic<A, I>;
|
|
17
|
+
/** The event that a `fromLiveQuery` actor sends its parent with each result of its query. */
|
|
18
|
+
export type LiveQueryRows<T> = Readonly<{
|
|
19
|
+
type: "records.rows";
|
|
20
|
+
rows: readonly T[];
|
|
21
|
+
}>;
|
|
22
|
+
/** The event that a `fromLiveQuery` actor sends its parent when its query fails. */
|
|
23
|
+
export type LiveQueryFailed = Readonly<{
|
|
24
|
+
type: "records.failed";
|
|
25
|
+
error: unknown;
|
|
26
|
+
}>;
|
|
27
|
+
/** What `fromLiveQuery` reads: a Record Collection or a live query collection over them. */
|
|
28
|
+
export type LiveRows<T> = Readonly<{
|
|
29
|
+
readonly toArray: readonly T[];
|
|
30
|
+
toArrayWhenReady: () => Promise<readonly T[]>;
|
|
31
|
+
subscribeChanges: (onChange: () => void) => Readonly<{
|
|
32
|
+
unsubscribe: () => void;
|
|
33
|
+
}>;
|
|
34
|
+
}>;
|
|
35
|
+
/**
|
|
36
|
+
* XState actor logic that sends its parent each result of a live query: the
|
|
37
|
+
* rows once the collection is ready, then the rows after each change. `query`
|
|
38
|
+
* runs on the runtime of the actor input, in a `fromEffect` actor, and gives
|
|
39
|
+
* the collection, such as a Record Collection from `RecordCollections` or a
|
|
40
|
+
* live query collection over them. A failure of `query` or of the first load
|
|
41
|
+
* sends `records.failed`. A stop of the actor ends the subscription.
|
|
42
|
+
*/
|
|
43
|
+
export declare const fromLiveQuery: <T, E, R, I extends Readonly<{
|
|
44
|
+
runtime: EffectRunner<R>;
|
|
45
|
+
}>>(query: (input: I) => Effect.Effect<LiveRows<T>, E, R>) => CallbackActorLogic<LiveQueryRows<T> | LiveQueryFailed, I>;
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import type { LeaderElection, OnlineDetector, StorageAdapter } from "@tanstack/offline-transactions";
|
|
2
|
+
import type * as Scope from "effect/Scope";
|
|
3
|
+
import * as Context from "effect/Context";
|
|
4
|
+
import * as Effect from "effect/Effect";
|
|
5
|
+
import * as Layer from "effect/Layer";
|
|
6
|
+
import * as Schema from "effect/Schema";
|
|
7
|
+
import type { RecordWriteError } from "./errors.js";
|
|
8
|
+
import type { RecordCreateRequest, RecordDeleteRequest, RecordUpdateRequest, RecordWriteAnswer, RecordWriteTarget } from "./ports.js";
|
|
9
|
+
import { IdempotencyKey, RecordWriteTransport } from "./ports.js";
|
|
10
|
+
/** The id of a CI Organization. */
|
|
11
|
+
export declare const OrganizationId: Schema.brand<Schema.String, "OrganizationId">;
|
|
12
|
+
export type OrganizationId = typeof OrganizationId.Type;
|
|
13
|
+
/** The id of a CI user. */
|
|
14
|
+
export declare const UserId: Schema.brand<Schema.String, "UserId">;
|
|
15
|
+
export type UserId = typeof UserId.Type;
|
|
16
|
+
/** The browser storage key of one user's outbox in one Organization. */
|
|
17
|
+
export declare const OutboxStorageKey: Schema.brand<Schema.String, "OutboxStorageKey">;
|
|
18
|
+
export type OutboxStorageKey = typeof OutboxStorageKey.Type;
|
|
19
|
+
/** `ci-records:<organization>:<user>`: one outbox per CI user and Organization. */
|
|
20
|
+
export declare const outboxStorageKey: (organizationId: OrganizationId, userId: UserId) => OutboxStorageKey;
|
|
21
|
+
/** A write as the outbox stores it: the exact request, so a resend carries the same key, id and revision. */
|
|
22
|
+
export type OutboxWrite = Readonly<{
|
|
23
|
+
kind: "create";
|
|
24
|
+
request: RecordCreateRequest;
|
|
25
|
+
}> | Readonly<{
|
|
26
|
+
kind: "update";
|
|
27
|
+
request: RecordUpdateRequest;
|
|
28
|
+
}> | Readonly<{
|
|
29
|
+
kind: "delete";
|
|
30
|
+
request: RecordDeleteRequest;
|
|
31
|
+
}>;
|
|
32
|
+
/**
|
|
33
|
+
* Sends a stored write again, in order with the other writes to its record,
|
|
34
|
+
* until CI answers or a final error. `RecordWrites` gives the outbox this
|
|
35
|
+
* function, so every send goes through `RecordWrites`.
|
|
36
|
+
*/
|
|
37
|
+
export type OutboxResend = (write: OutboxWrite) => Effect.Effect<RecordWriteAnswer, RecordWriteError>;
|
|
38
|
+
type Transport = RecordWriteTransport["Service"];
|
|
39
|
+
/** A write that a page holds, as it stored it. */
|
|
40
|
+
interface PageWrite {
|
|
41
|
+
readonly storedAt: number;
|
|
42
|
+
readonly write: OutboxWrite;
|
|
43
|
+
/** The write it was made behind, until that write settled. */
|
|
44
|
+
readonly after: IdempotencyKey | undefined;
|
|
45
|
+
/** Whether it still waits: its first send stores its exact request. */
|
|
46
|
+
readonly waiting: boolean;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* One page and the writes it holds, by outbox key and idempotency key. A page
|
|
50
|
+
* holds each write it stores until CI answers
|
|
51
|
+
* or refuses it: `RecordWrites` and the app's explicit resubmit send it, and
|
|
52
|
+
* no outbox does. Once no outbox of the page runs (the page reloaded or
|
|
53
|
+
* closed, or its app client was replaced), the leader tab's outbox takes the
|
|
54
|
+
* writes it still holds and sends them.
|
|
55
|
+
*/
|
|
56
|
+
export interface OutboxPage {
|
|
57
|
+
readonly id: string;
|
|
58
|
+
readonly writes: Map<string, PageWrite>;
|
|
59
|
+
}
|
|
60
|
+
export declare const makeOutboxPage: () => OutboxPage;
|
|
61
|
+
/**
|
|
62
|
+
* The tabs of one outbox: which pages still hold their writes, and the
|
|
63
|
+
* channel on which a page tells the leader tab that it stored a write.
|
|
64
|
+
*/
|
|
65
|
+
export interface OutboxTabs {
|
|
66
|
+
/** Keeps `page` holding its writes until every returned release ran. */
|
|
67
|
+
readonly hold: (page: string) => () => void;
|
|
68
|
+
/** Resolves once `page` holds its writes no more, or `signal` aborts. */
|
|
69
|
+
readonly gone: (page: string, signal: AbortSignal) => Promise<void>;
|
|
70
|
+
/** Tells the other tabs of this outbox that this page stored a write. */
|
|
71
|
+
readonly announce: () => void;
|
|
72
|
+
readonly onAnnounce: (listener: () => void) => () => void;
|
|
73
|
+
}
|
|
74
|
+
export type RecordOutboxOptions = Readonly<{
|
|
75
|
+
key: OutboxStorageKey;
|
|
76
|
+
/** The storage of the outbox; `undefined` when the browser keeps none, and writes are then sent without an outbox. */
|
|
77
|
+
storage: () => Promise<StorageAdapter | undefined>;
|
|
78
|
+
/**
|
|
79
|
+
* The write target of a stored target key, as the SDK's transport knows it;
|
|
80
|
+
* `undefined` while the SDK has not seen it yet. A stored write waits for
|
|
81
|
+
* its target, and the writes after it wait too.
|
|
82
|
+
*/
|
|
83
|
+
target: (key: string) => RecordWriteTarget | undefined;
|
|
84
|
+
/**
|
|
85
|
+
* Which tab sends the outbox. Defaults to a Web Lock named by the storage
|
|
86
|
+
* key, which passes to the next tab in line when its tab closes, or this
|
|
87
|
+
* tab without Web Locks.
|
|
88
|
+
*/
|
|
89
|
+
leaderElection?: LeaderElection;
|
|
90
|
+
/** Which pages still live. Defaults to a Web Lock per page and a BroadcastChannel per storage key. */
|
|
91
|
+
tabs?: OutboxTabs;
|
|
92
|
+
/** When the outbox may send. Defaults to the browser's online and visibility events. */
|
|
93
|
+
onlineDetector?: OnlineDetector;
|
|
94
|
+
/** The page that holds the writes this outbox stores. Defaults to this JavaScript context. */
|
|
95
|
+
page?: OutboxPage;
|
|
96
|
+
}>;
|
|
97
|
+
declare const RecordOutbox_base: Context.ServiceClass<RecordOutbox, "@collective-intelligence/records/RecordOutbox", Readonly<{
|
|
98
|
+
attach: (options: Readonly<{
|
|
99
|
+
transport: Transport;
|
|
100
|
+
resend: OutboxResend;
|
|
101
|
+
}>) => Effect.Effect<OutboxSends, never, Scope.Scope>;
|
|
102
|
+
}>>;
|
|
103
|
+
/**
|
|
104
|
+
* The outbox of one CI user and Organization over
|
|
105
|
+
* `@tanstack/offline-transactions`. `RecordWrites` attaches it to its write
|
|
106
|
+
* transport when the identity's record layer starts. Every tab stores each
|
|
107
|
+
* write before its first send, held by its page, and the write leaves the
|
|
108
|
+
* store when CI answers or refuses it. Only the leader tab sends: once a page
|
|
109
|
+
* reloads or closes, the leader takes the writes that page still holds and
|
|
110
|
+
* sends them, oldest first, once. Closing the scope stops it and keeps the
|
|
111
|
+
* stored writes for their user.
|
|
112
|
+
*/
|
|
113
|
+
export declare class RecordOutbox extends RecordOutbox_base {
|
|
114
|
+
}
|
|
115
|
+
/** How `RecordWrites` sends through an attached outbox. */
|
|
116
|
+
export type OutboxSends = Readonly<{
|
|
117
|
+
/** Stores each write before its first send, until CI answers or refuses it. */
|
|
118
|
+
transport: Transport;
|
|
119
|
+
/**
|
|
120
|
+
* Stores a write made while the write `after` to its record is pending,
|
|
121
|
+
* before it waits for the record's write lock. Its first send stores its
|
|
122
|
+
* exact request; until then it takes the id and revision that `after`
|
|
123
|
+
* settles with.
|
|
124
|
+
*/
|
|
125
|
+
queue: (write: OutboxWrite, after: IdempotencyKey) => Effect.Effect<void>;
|
|
126
|
+
/** A queued write that ended before its first send leaves the storage. */
|
|
127
|
+
unqueue: (key: IdempotencyKey) => Effect.Effect<void>;
|
|
128
|
+
}>;
|
|
129
|
+
/** Sends without an outbox. */
|
|
130
|
+
export declare const withoutOutbox: (transport: Transport) => OutboxSends;
|
|
131
|
+
/** The outbox of one CI user and Organization, for `RecordWrites` of that identity. */
|
|
132
|
+
export declare const layer: (options: RecordOutboxOptions) => Layer.Layer<RecordOutbox, never, never>;
|
|
133
|
+
/**
|
|
134
|
+
* The browser storage of one outbox: an IndexedDB database named by the
|
|
135
|
+
* storage key, or localStorage keys that start with it; `undefined` when the
|
|
136
|
+
* browser keeps neither (for example in some private windows).
|
|
137
|
+
*/
|
|
138
|
+
export declare const browserOutboxStorage: (key: OutboxStorageKey) => Promise<StorageAdapter | undefined>;
|
|
139
|
+
/** Drops every stored write of one user's outbox, as a sign-out does. */
|
|
140
|
+
export declare const dropOutbox: (key: OutboxStorageKey) => Promise<void>;
|
|
141
|
+
export {};
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
import type { LeaderElection, OnlineDetector, StorageAdapter } from "@tanstack/offline-transactions";
|
|
2
|
+
import * as Deferred from "effect/Deferred";
|
|
3
|
+
import * as Fiber from "effect/Fiber";
|
|
4
|
+
import * as Layer from "effect/Layer";
|
|
5
|
+
import * as ManagedRuntime from "effect/ManagedRuntime";
|
|
6
|
+
import * as Schema from "effect/Schema";
|
|
7
|
+
import type { RecordWriteError } from "./errors.js";
|
|
8
|
+
import type { RecordWriteAnswer, RecordWriteTarget } from "./ports.js";
|
|
9
|
+
import * as Outbox from "./outbox.js";
|
|
10
|
+
import { RecordId, RecordRevision, RecordWriteTransport } from "./ports.js";
|
|
11
|
+
import * as RecordCollections from "./service.js";
|
|
12
|
+
import * as RecordWrites from "./writes.js";
|
|
13
|
+
export declare const Todo: Schema.Struct<{
|
|
14
|
+
readonly title: Schema.String;
|
|
15
|
+
}>;
|
|
16
|
+
export type Todo = typeof Todo.Type;
|
|
17
|
+
export type User = "u1" | "u2";
|
|
18
|
+
/** What CI does with the first send of a key; later sends of the key are answered. */
|
|
19
|
+
export type Plan =
|
|
20
|
+
/** CI applies the write and answers it. */
|
|
21
|
+
"answer"
|
|
22
|
+
/** The request is lost before CI reads it, and no answer comes. */
|
|
23
|
+
| "drop"
|
|
24
|
+
/** CI applies the write and the answer is lost on the way. */
|
|
25
|
+
| "lose"
|
|
26
|
+
/** CI applies the write and the answer never comes. */
|
|
27
|
+
| "hang"
|
|
28
|
+
/** CI refuses the write. */
|
|
29
|
+
| "refuse"
|
|
30
|
+
/** CI waits for `release(key)`, then applies the write and answers it. */
|
|
31
|
+
| "hold"
|
|
32
|
+
/** CI waits for `release(key)`, then refuses the write. */
|
|
33
|
+
| "hold_refuse"
|
|
34
|
+
/** CI applies a create under its own id `server-<key>`: a store that refused the client id and took the create without it. */
|
|
35
|
+
| "assign";
|
|
36
|
+
export type Sent = Readonly<{
|
|
37
|
+
key: string;
|
|
38
|
+
actor: User | null;
|
|
39
|
+
id: RecordId;
|
|
40
|
+
/** The revision an update or a delete expects; absent for a create. */
|
|
41
|
+
expectedRevision?: RecordRevision | null;
|
|
42
|
+
}>;
|
|
43
|
+
/**
|
|
44
|
+
* CI with Write Receipts: a key applies once and a resend gets the stored
|
|
45
|
+
* answer. The actor of each request is the session user at send time. Each
|
|
46
|
+
* applied write gives its record the next revision, and an update or a
|
|
47
|
+
* delete that expects another revision than the record holds conflicts.
|
|
48
|
+
*/
|
|
49
|
+
/** What CI holds, and the session whose credentials a request carries. */
|
|
50
|
+
interface CiState {
|
|
51
|
+
/** The keys CI applied, in apply order. */
|
|
52
|
+
readonly applied: string[];
|
|
53
|
+
/** The revision of each record CI holds: the number of writes it applied to it. */
|
|
54
|
+
readonly revisions: Map<RecordId, number>;
|
|
55
|
+
/** The records CI holds, as a read of them answers: a delete takes its record out. */
|
|
56
|
+
readonly records: Map<RecordId, RecordWriteAnswer>;
|
|
57
|
+
readonly plans: Map<string, Plan>;
|
|
58
|
+
readonly receipts: Map<string, RecordWriteAnswer | "refused">;
|
|
59
|
+
readonly released: Map<string, Deferred.Deferred<boolean>>;
|
|
60
|
+
readonly sent: Sent[];
|
|
61
|
+
session: User | null;
|
|
62
|
+
}
|
|
63
|
+
export declare const makeCi: () => {
|
|
64
|
+
ci: CiState;
|
|
65
|
+
release: (key: string) => void;
|
|
66
|
+
sentOf: (key: string) => Readonly<{
|
|
67
|
+
key: string;
|
|
68
|
+
actor: User | null;
|
|
69
|
+
id: RecordId;
|
|
70
|
+
/** The revision an update or a delete expects; absent for a create. */
|
|
71
|
+
expectedRevision?: RecordRevision | null;
|
|
72
|
+
}>[];
|
|
73
|
+
transport: Layer.Layer<RecordWriteTransport, never, never>;
|
|
74
|
+
};
|
|
75
|
+
export type Ci = ReturnType<typeof makeCi>;
|
|
76
|
+
/**
|
|
77
|
+
* `storage` as a page that dies right before the write or delete that `dies`
|
|
78
|
+
* picks, given the key and the value it holds now: from then on it writes
|
|
79
|
+
* and deletes nothing more.
|
|
80
|
+
*/
|
|
81
|
+
export declare const dyingBefore: (storage: MemoryStorage, dies: (key: string, value: string | null) => boolean) => StorageAdapter;
|
|
82
|
+
/**
|
|
83
|
+
* `storage` as a page that dies right after the delete that `dies` picks:
|
|
84
|
+
* from then on it writes and deletes nothing more.
|
|
85
|
+
*/
|
|
86
|
+
export declare const dyingAt: (storage: MemoryStorage, dies: (key: string, value: string | null) => boolean) => StorageAdapter;
|
|
87
|
+
/** Browser storage in memory. `reverse` lists keys newest first, which an adapter may do. */
|
|
88
|
+
export declare const memoryStorage: (order?: "insertion" | "reverse") => {
|
|
89
|
+
adapter: StorageAdapter;
|
|
90
|
+
data: Map<string, string>;
|
|
91
|
+
slowWrites: (millis: number) => StorageAdapter;
|
|
92
|
+
stored: () => string[];
|
|
93
|
+
};
|
|
94
|
+
export type MemoryStorage = ReturnType<typeof memoryStorage>;
|
|
95
|
+
/** The network: each outbox gets its own detector; `up` tells every live one. */
|
|
96
|
+
export declare const makeNetwork: (online?: boolean) => {
|
|
97
|
+
detector: () => OnlineDetector;
|
|
98
|
+
setOnline: (next: boolean) => void;
|
|
99
|
+
};
|
|
100
|
+
/**
|
|
101
|
+
* One Web Lock that the tabs of one outbox ask for: the first tab gets it,
|
|
102
|
+
* the others wait in line, and a release passes it to the next tab in line.
|
|
103
|
+
*/
|
|
104
|
+
export declare const makeLock: () => {
|
|
105
|
+
election: () => LeaderElection;
|
|
106
|
+
};
|
|
107
|
+
/**
|
|
108
|
+
* The pages of the browser, which the outbox asks whether a page still holds
|
|
109
|
+
* its writes, and the channel on which its tabs announce stored writes. A
|
|
110
|
+
* page holds its writes while one of its outboxes runs, as from its load
|
|
111
|
+
* until its reload or close.
|
|
112
|
+
*/
|
|
113
|
+
export declare const makeTabs: () => Outbox.OutboxTabs;
|
|
114
|
+
/** The browser of every test that does not open its own. */
|
|
115
|
+
export declare const browser: Outbox.OutboxTabs;
|
|
116
|
+
/** One tab, which sends its own outbox. */
|
|
117
|
+
export declare const thisTab: LeaderElection;
|
|
118
|
+
/** A write target of its own: the write lock registry outlives each test. */
|
|
119
|
+
export declare const freshTarget: () => RecordWriteTarget;
|
|
120
|
+
export type IdentityOptions = Readonly<{
|
|
121
|
+
ci: Ci;
|
|
122
|
+
user: User;
|
|
123
|
+
storage: StorageAdapter;
|
|
124
|
+
network?: ReturnType<typeof makeNetwork>;
|
|
125
|
+
/** Without an outbox: the baseline that the outbox cost compares with. */
|
|
126
|
+
outbox?: boolean;
|
|
127
|
+
/** The page the identity runs in; a new page by default, as after a reload. */
|
|
128
|
+
page?: Outbox.OutboxPage;
|
|
129
|
+
/** Whether this tab sends the outbox; this tab alone by default. */
|
|
130
|
+
leader?: LeaderElection;
|
|
131
|
+
/** The browser the page lives in. */
|
|
132
|
+
tabs?: Outbox.OutboxTabs;
|
|
133
|
+
/** Uses the outbox's own Web Locks and BroadcastChannel in place of `leader` and `tabs`. */
|
|
134
|
+
webLocks?: boolean;
|
|
135
|
+
}>;
|
|
136
|
+
/**
|
|
137
|
+
* The record writes of one CI identity, as the SDK provider starts them for
|
|
138
|
+
* the session user: building `RecordWrites` starts the outbox, and
|
|
139
|
+
* `stop` closes the identity's scope, as a user switch, a sign-out or a page
|
|
140
|
+
* reload does.
|
|
141
|
+
*/
|
|
142
|
+
export declare const startIdentity: (options: IdentityOptions) => Promise<{
|
|
143
|
+
collection: import("@tanstack/db").Collection<Readonly<{
|
|
144
|
+
id: RecordId;
|
|
145
|
+
revision: RecordRevision | null;
|
|
146
|
+
value: {
|
|
147
|
+
readonly title: string;
|
|
148
|
+
};
|
|
149
|
+
}>, string, import("@tanstack/db").UtilsRecord, never, Readonly<{
|
|
150
|
+
id: RecordId;
|
|
151
|
+
revision: RecordRevision | null;
|
|
152
|
+
value: {
|
|
153
|
+
readonly title: string;
|
|
154
|
+
};
|
|
155
|
+
}>> & import("@tanstack/db").NonSingleResult;
|
|
156
|
+
create: (target: RecordWriteTarget, n: number) => Fiber.Fiber<Readonly<{
|
|
157
|
+
id: RecordId;
|
|
158
|
+
revision: RecordRevision | null;
|
|
159
|
+
value: {
|
|
160
|
+
readonly title: string;
|
|
161
|
+
};
|
|
162
|
+
}>, RecordWriteError>;
|
|
163
|
+
query: (target: RecordWriteTarget) => Promise<import(".").QueryRecordCollection<Readonly<{
|
|
164
|
+
id: RecordId;
|
|
165
|
+
revision: RecordRevision | null;
|
|
166
|
+
value: {
|
|
167
|
+
readonly title: string;
|
|
168
|
+
};
|
|
169
|
+
}>>>;
|
|
170
|
+
remove: (target: RecordWriteTarget, id: RecordId, n: number) => Fiber.Fiber<void, RecordWriteError>;
|
|
171
|
+
runtime: ManagedRuntime.ManagedRuntime<RecordCollections.RecordCollections | RecordWrites.RecordWrites, never>;
|
|
172
|
+
stop: () => Promise<void>;
|
|
173
|
+
update: (target: RecordWriteTarget, id: RecordId, n: number) => Fiber.Fiber<Readonly<{
|
|
174
|
+
id: RecordId;
|
|
175
|
+
revision: RecordRevision | null;
|
|
176
|
+
value: {
|
|
177
|
+
readonly title: string;
|
|
178
|
+
};
|
|
179
|
+
}>, RecordWriteError>;
|
|
180
|
+
}>;
|
|
181
|
+
export type Identity = Awaited<ReturnType<typeof startIdentity>>;
|
|
182
|
+
export {};
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import type * as Effect from "effect/Effect";
|
|
2
|
+
import type * as Option from "effect/Option";
|
|
3
|
+
import type * as Stream from "effect/Stream";
|
|
4
|
+
import * as Context from "effect/Context";
|
|
5
|
+
import * as Schema from "effect/Schema";
|
|
6
|
+
import type { RecordSyncFailed, RecordWriteError } from "./errors.js";
|
|
7
|
+
import type { RecordPosition } from "./position.js";
|
|
8
|
+
/** The id of a CI record. */
|
|
9
|
+
export declare const RecordId: Schema.brand<Schema.String, "RecordId">;
|
|
10
|
+
export type RecordId = typeof RecordId.Type;
|
|
11
|
+
/** The opaque revision that CI gives a record at each write. */
|
|
12
|
+
export declare const RecordRevision: Schema.brand<Schema.String, "RecordRevision">;
|
|
13
|
+
export type RecordRevision = typeof RecordRevision.Type;
|
|
14
|
+
/** The key that makes a resent write apply once (Write Receipt). */
|
|
15
|
+
export declare const IdempotencyKey: Schema.brand<Schema.String, "IdempotencyKey">;
|
|
16
|
+
export type IdempotencyKey = typeof IdempotencyKey.Type;
|
|
17
|
+
/**
|
|
18
|
+
* One row of a Record Collection: a CI record with its revision and value.
|
|
19
|
+
* `revision` is `null` while a create waits for CI's answer.
|
|
20
|
+
*/
|
|
21
|
+
export type RecordRow<Value> = Readonly<{
|
|
22
|
+
id: RecordId;
|
|
23
|
+
revision: RecordRevision | null;
|
|
24
|
+
value: Value;
|
|
25
|
+
}>;
|
|
26
|
+
/** The schema of a record value; it decodes with no service. */
|
|
27
|
+
export type RecordValueSchema<Value extends object> = Schema.Codec<Value, unknown>;
|
|
28
|
+
/** Decodes one record as CI sends it into a `RecordRow` of `value`. */
|
|
29
|
+
export declare const recordRowSchema: <Value extends object>(value: RecordValueSchema<Value>) => Schema.Struct<{
|
|
30
|
+
readonly id: Schema.brand<Schema.String, "RecordId">;
|
|
31
|
+
readonly revision: Schema.NullOr<Schema.brand<Schema.String, "RecordRevision">>;
|
|
32
|
+
readonly value: RecordValueSchema<Value>;
|
|
33
|
+
}>;
|
|
34
|
+
/** One record as CI sends it, before decoding. */
|
|
35
|
+
export type UndecodedRecord = Readonly<{
|
|
36
|
+
id: string;
|
|
37
|
+
revision: string | null;
|
|
38
|
+
value: unknown;
|
|
39
|
+
}>;
|
|
40
|
+
/** The records of one entity schema, named by FQN or id, optionally filtered. */
|
|
41
|
+
export type RecordTopic = Readonly<{
|
|
42
|
+
schema: string;
|
|
43
|
+
filter?: Readonly<{
|
|
44
|
+
field: string;
|
|
45
|
+
eq: string | number | boolean | null;
|
|
46
|
+
}>;
|
|
47
|
+
}>;
|
|
48
|
+
/**
|
|
49
|
+
* A Change Hint or a Resync of one Realtime Topic. A Change Hint names a
|
|
50
|
+
* record without its data. `leave` tells that a record left the topic or the
|
|
51
|
+
* user's reach; `delete` that CI deleted it.
|
|
52
|
+
*/
|
|
53
|
+
export type RealtimeChangeItem = Readonly<{
|
|
54
|
+
_tag: "change";
|
|
55
|
+
id: RecordId;
|
|
56
|
+
revision: RecordRevision;
|
|
57
|
+
}> | Readonly<{
|
|
58
|
+
_tag: "delete";
|
|
59
|
+
id: RecordId;
|
|
60
|
+
revision: RecordRevision;
|
|
61
|
+
}> | Readonly<{
|
|
62
|
+
_tag: "leave";
|
|
63
|
+
id: RecordId;
|
|
64
|
+
}> | Readonly<{
|
|
65
|
+
_tag: "resync";
|
|
66
|
+
reason: "access" | "first-open" | "gap" | "server";
|
|
67
|
+
/** Undefined for a Resync that the realtime client starts itself. */
|
|
68
|
+
generation: number | undefined;
|
|
69
|
+
}>;
|
|
70
|
+
/**
|
|
71
|
+
* Every record of a topic that the user can read, as CI holds it now, and
|
|
72
|
+
* the `position` of that read; undefined when CI gave none (server
|
|
73
|
+
* credentials).
|
|
74
|
+
*/
|
|
75
|
+
export type RecordTopicRead = Readonly<{
|
|
76
|
+
records: readonly UndecodedRecord[];
|
|
77
|
+
position: RecordPosition | undefined;
|
|
78
|
+
}>;
|
|
79
|
+
declare const RealtimeChangeSource_base: Context.ServiceClass<RealtimeChangeSource, "@collective-intelligence/records/RealtimeChangeSource", Readonly<{
|
|
80
|
+
/**
|
|
81
|
+
* `from` gives the position of the read that the collection's rows came
|
|
82
|
+
* from, if any; the stream reads it at each open and starts the topic
|
|
83
|
+
* there, so it neither misses nor repeats a change after that read.
|
|
84
|
+
*/
|
|
85
|
+
changes: (topic: RecordTopic, from: Effect.Effect<RecordPosition | undefined>) => Stream.Stream<RealtimeChangeItem, RecordSyncFailed>;
|
|
86
|
+
/**
|
|
87
|
+
* Reads one record of the topic's schema as CI holds it now; `None` when
|
|
88
|
+
* CI holds no record of that id that the user can read.
|
|
89
|
+
*/
|
|
90
|
+
read: (topic: RecordTopic, id: RecordId) => Effect.Effect<Option.Option<UndecodedRecord>, RecordSyncFailed>;
|
|
91
|
+
/** Reads every record of the topic that the user can read, as CI holds it now. */
|
|
92
|
+
load: (topic: RecordTopic) => Effect.Effect<RecordTopicRead, RecordSyncFailed>;
|
|
93
|
+
}>>;
|
|
94
|
+
/**
|
|
95
|
+
* The Change Hints and Resyncs of each Realtime Topic, in delivery order, the
|
|
96
|
+
* reads by id that turn a Change Hint into its record, and the read of a
|
|
97
|
+
* whole topic that a Resync reloads.
|
|
98
|
+
*/
|
|
99
|
+
export declare class RealtimeChangeSource extends RealtimeChangeSource_base {
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Where a write goes. The SDK adapter that makes the target knows what
|
|
103
|
+
* `key` names; the record layer only reads `key`, which is stable for one
|
|
104
|
+
* target.
|
|
105
|
+
*/
|
|
106
|
+
export type RecordWriteTarget = Readonly<{
|
|
107
|
+
key: string;
|
|
108
|
+
}>;
|
|
109
|
+
/** CI's answer to a write: the record as CI now holds it, before decoding. */
|
|
110
|
+
export type RecordWriteAnswer = Readonly<{
|
|
111
|
+
id: RecordId;
|
|
112
|
+
revision: RecordRevision | null;
|
|
113
|
+
value: unknown;
|
|
114
|
+
}>;
|
|
115
|
+
type RecordWriteBase = Readonly<{
|
|
116
|
+
target: RecordWriteTarget;
|
|
117
|
+
idempotencyKey: IdempotencyKey;
|
|
118
|
+
}>;
|
|
119
|
+
export type RecordCreateRequest = RecordWriteBase & Readonly<{
|
|
120
|
+
/** The client's id for the new record, so its optimistic row keeps its key. */
|
|
121
|
+
id?: RecordId;
|
|
122
|
+
value: unknown;
|
|
123
|
+
}>;
|
|
124
|
+
export type RecordUpdateRequest = RecordWriteBase & Readonly<{
|
|
125
|
+
id: RecordId;
|
|
126
|
+
expectedRevision: RecordRevision | null;
|
|
127
|
+
change: unknown;
|
|
128
|
+
}>;
|
|
129
|
+
export type RecordDeleteRequest = RecordWriteBase & Readonly<{
|
|
130
|
+
id: RecordId;
|
|
131
|
+
expectedRevision: RecordRevision | null;
|
|
132
|
+
}>;
|
|
133
|
+
declare const RecordWriteTransport_base: Context.ServiceClass<RecordWriteTransport, "@collective-intelligence/records/RecordWriteTransport", Readonly<{
|
|
134
|
+
create: (request: RecordCreateRequest) => Effect.Effect<RecordWriteAnswer, RecordWriteError>;
|
|
135
|
+
update: (request: RecordUpdateRequest) => Effect.Effect<RecordWriteAnswer, RecordWriteError>;
|
|
136
|
+
delete: (request: RecordDeleteRequest) => Effect.Effect<RecordWriteAnswer, RecordWriteError>;
|
|
137
|
+
}>>;
|
|
138
|
+
/** Sends record writes with their idempotency key and optional client id. */
|
|
139
|
+
export declare class RecordWriteTransport extends RecordWriteTransport_base {
|
|
140
|
+
}
|
|
141
|
+
export {};
|