ankka 0.9.1 → 0.11.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/dist/_proto/ankka/protocol/v1/agent_pb.d.ts +35 -0
- package/dist/_proto/ankka/protocol/v1/agent_pb.js +8 -1
- package/dist/_proto/ankka/protocol/v1/client_pb.d.ts +542 -2
- package/dist/_proto/ankka/protocol/v1/client_pb.js +107 -6
- package/dist/_proto/ankka/protocol/v1/consumer_pb.d.ts +52 -1
- package/dist/_proto/ankka/protocol/v1/consumer_pb.js +11 -1
- package/dist/_proto/ankka/protocol/v1/discovery_pb.d.ts +330 -0
- package/dist/_proto/ankka/protocol/v1/discovery_pb.js +81 -16
- package/dist/_proto/ankka/protocol/v1/endpoint_pb.d.ts +184 -0
- package/dist/_proto/ankka/protocol/v1/endpoint_pb.js +26 -1
- package/dist/_proto/ankka/protocol/v1/view_pb.d.ts +63 -0
- package/dist/_proto/ankka/protocol/v1/view_pb.js +11 -1
- package/dist/_proto/ankka/protocol/v1/workflow_pb.d.ts +7 -0
- package/dist/_proto/ankka/protocol/v1/workflow_pb.js +1 -1
- package/dist/agent.d.ts +15 -1
- package/dist/agent.js +20 -0
- package/dist/approvals.d.ts +47 -0
- package/dist/approvals.js +57 -0
- package/dist/autonomous.d.ts +23 -1
- package/dist/autonomous.js +30 -1
- package/dist/client.d.ts +92 -4
- package/dist/client.js +262 -15
- package/dist/consumer.d.ts +40 -2
- package/dist/consumer.js +50 -0
- package/dist/context.d.ts +4 -0
- package/dist/contract.d.ts +36 -0
- package/dist/contract.js +58 -0
- package/dist/effects/keyed.d.ts +33 -0
- package/dist/effects/keyed.js +41 -0
- package/dist/effects/stateless.d.ts +21 -0
- package/dist/effects/stateless.js +19 -0
- package/dist/endpoint.d.ts +10 -1
- package/dist/endpoint.js +20 -0
- package/dist/graph.d.ts +171 -0
- package/dist/graph.js +446 -0
- package/dist/handlers.d.ts +10 -2
- package/dist/handlers.js +6 -2
- package/dist/index.d.ts +15 -6
- package/dist/index.js +13 -4
- package/dist/keyedView.d.ts +56 -0
- package/dist/keyedView.js +67 -0
- package/dist/mcp.d.ts +57 -0
- package/dist/mcp.js +64 -0
- package/dist/routes.d.ts +23 -3
- package/dist/routes.js +16 -3
- package/dist/server/agent.js +12 -4
- package/dist/server/discovery.d.ts +12 -1
- package/dist/server/discovery.js +95 -1
- package/dist/server/http.d.ts +2 -1
- package/dist/server/http.js +78 -4
- package/dist/server/stateless.js +104 -16
- package/dist/server/workflow.js +5 -1
- package/dist/service.d.ts +45 -3
- package/dist/service.js +234 -12
- package/dist/services.d.ts +137 -0
- package/dist/services.js +259 -0
- package/dist/socket.d.ts +15 -0
- package/dist/socket.js +25 -0
- package/dist/spec.d.ts +1 -1
- package/dist/spec.js +87 -14
- package/dist/startFrom.d.ts +32 -0
- package/dist/startFrom.js +44 -0
- package/dist/testkit/index.d.ts +2 -2
- package/dist/testkit/index.js +1 -1
- package/dist/testkit/integration.js +5 -0
- package/dist/testkit/kinds.d.ts +75 -5
- package/dist/testkit/kinds.js +264 -34
- package/dist/testkit/unit.d.ts +14 -1
- package/dist/testkit/unit.js +40 -3
- package/dist/timedAction.d.ts +17 -2
- package/dist/timedAction.js +33 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/view.d.ts +32 -0
- package/dist/view.js +8 -0
- package/dist/workflow.d.ts +18 -1
- package/dist/workflow.js +39 -0
- package/package.json +3 -2
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
// Effects for a keyed view: the rows one change writes and deletes, each named by its key.
|
|
2
|
+
function rows(changes) {
|
|
3
|
+
return Object.freeze({ kind: "rows", changes: Object.freeze([...changes]) });
|
|
4
|
+
}
|
|
5
|
+
function checkedKey(key) {
|
|
6
|
+
if (typeof key !== "string" || key === "")
|
|
7
|
+
throw new TypeError("a row key is a string of one character or more");
|
|
8
|
+
return key;
|
|
9
|
+
}
|
|
10
|
+
export class KeyedViewEffects {
|
|
11
|
+
updateRow(key, row) {
|
|
12
|
+
return rows([{ key: checkedKey(key), row }]);
|
|
13
|
+
}
|
|
14
|
+
deleteRow(key) {
|
|
15
|
+
return rows([{ key: checkedKey(key), deleted: true }]);
|
|
16
|
+
}
|
|
17
|
+
/** Several rows written, each under its key. */
|
|
18
|
+
updateRows(entries) {
|
|
19
|
+
return rows([...entries].map(([key, row]) => ({ key: checkedKey(key), row })));
|
|
20
|
+
}
|
|
21
|
+
deleteRows(keys) {
|
|
22
|
+
return rows([...keys].map((key) => ({ key: checkedKey(key), deleted: true })));
|
|
23
|
+
}
|
|
24
|
+
ignore() {
|
|
25
|
+
return rows([]);
|
|
26
|
+
}
|
|
27
|
+
/** Several effects as one, in the order given. */
|
|
28
|
+
all(...effects) {
|
|
29
|
+
return rows(effects.flatMap((e) => e.changes));
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* The final change for each key, a later change to a key winning, keys in the order they first
|
|
34
|
+
* appear; `undefined` is a deletion. How the test kit applies an effect, as the runtime does.
|
|
35
|
+
*/
|
|
36
|
+
export function reduceRowChanges(changes) {
|
|
37
|
+
const last = new Map();
|
|
38
|
+
for (const change of changes)
|
|
39
|
+
last.set(change.key, "deleted" in change ? undefined : change.row);
|
|
40
|
+
return [...last.entries()];
|
|
41
|
+
}
|
|
@@ -12,10 +12,25 @@ export declare class ViewEffects<Row> {
|
|
|
12
12
|
deleteRow(): ViewEffect<Row>;
|
|
13
13
|
ignore(): ViewEffect<Row>;
|
|
14
14
|
}
|
|
15
|
+
/**
|
|
16
|
+
* One message of several: what to publish, optionally the record key it is published under, and its
|
|
17
|
+
* headers. A message with no key is keyed by its subject — the source instance's id unless the
|
|
18
|
+
* metadata sets `ce-subject` — which keeps everything about one instance on one partition, in order.
|
|
19
|
+
* A key is for a message about something else: a line item, an element of a graph. Naming one does
|
|
20
|
+
* not change the subject.
|
|
21
|
+
*/
|
|
22
|
+
export interface OutgoingMessage<Out> {
|
|
23
|
+
readonly payload: Out;
|
|
24
|
+
readonly key?: string;
|
|
25
|
+
readonly metadata?: Metadata;
|
|
26
|
+
}
|
|
15
27
|
export type ConsumerEffect<Out> = ({
|
|
16
28
|
readonly kind: "produce";
|
|
17
29
|
readonly payload: Out;
|
|
18
30
|
readonly metadata: Metadata;
|
|
31
|
+
} & EffectLike<never>) | ({
|
|
32
|
+
readonly kind: "produceAll";
|
|
33
|
+
readonly messages: readonly OutgoingMessage<Out>[];
|
|
19
34
|
} & EffectLike<never>) | ({
|
|
20
35
|
readonly kind: "done";
|
|
21
36
|
} & EffectLike<never>) | ({
|
|
@@ -24,6 +39,12 @@ export type ConsumerEffect<Out> = ({
|
|
|
24
39
|
export declare class ConsumerEffects<Out> {
|
|
25
40
|
/** Produce onward to the topic the consumer declares in `producesTo`. */
|
|
26
41
|
produce(payload: Out, metadata?: Metadata): ConsumerEffect<Out>;
|
|
42
|
+
/**
|
|
43
|
+
* Produce several messages for this change, in the order given. The change is handled when the
|
|
44
|
+
* broker has accepted every one; if one is refused the change comes again and all are published
|
|
45
|
+
* again. An empty list publishes nothing and is handled at once.
|
|
46
|
+
*/
|
|
47
|
+
produceAll(messages: readonly OutgoingMessage<Out>[]): ConsumerEffect<Out>;
|
|
27
48
|
done(): ConsumerEffect<Out>;
|
|
28
49
|
ignore(): ConsumerEffect<Out>;
|
|
29
50
|
}
|
|
@@ -17,6 +17,25 @@ export class ConsumerEffects {
|
|
|
17
17
|
produce(payload, metadata = {}) {
|
|
18
18
|
return Object.freeze({ kind: "produce", payload, metadata });
|
|
19
19
|
}
|
|
20
|
+
/**
|
|
21
|
+
* Produce several messages for this change, in the order given. The change is handled when the
|
|
22
|
+
* broker has accepted every one; if one is refused the change comes again and all are published
|
|
23
|
+
* again. An empty list publishes nothing and is handled at once.
|
|
24
|
+
*/
|
|
25
|
+
produceAll(messages) {
|
|
26
|
+
if (!Array.isArray(messages))
|
|
27
|
+
throw new TypeError("produceAll takes a list of messages");
|
|
28
|
+
const checked = messages.map((m, i) => {
|
|
29
|
+
if (typeof m !== "object" || m === null || !("payload" in m))
|
|
30
|
+
throw new TypeError(`produceAll: message ${i} is not a message: { payload, key?, metadata? }`);
|
|
31
|
+
if (m.key !== undefined && typeof m.key !== "string")
|
|
32
|
+
throw new TypeError(`produceAll: message ${i} has a record key that is not a string`);
|
|
33
|
+
if (m.key === "")
|
|
34
|
+
throw new TypeError(`produceAll: message ${i} has an empty record key; leave the key out to key the message by its subject`);
|
|
35
|
+
return Object.freeze({ ...m });
|
|
36
|
+
});
|
|
37
|
+
return Object.freeze({ kind: "produceAll", messages: Object.freeze(checked) });
|
|
38
|
+
}
|
|
20
39
|
done() {
|
|
21
40
|
return Object.freeze({ kind: "done" });
|
|
22
41
|
}
|
package/dist/endpoint.d.ts
CHANGED
|
@@ -1,12 +1,21 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type ComponentClient, type Secrets } from "./client.ts";
|
|
2
2
|
import { type RequestContext } from "./context.ts";
|
|
3
3
|
import type { Acl, RouteTable } from "./routes.ts";
|
|
4
|
+
import { type Services } from "./services.ts";
|
|
4
5
|
export declare abstract class Endpoint {
|
|
5
6
|
#private;
|
|
6
7
|
/** The request being handled: path parameters, query, headers, principal. Request-scoped. */
|
|
7
8
|
get request(): RequestContext;
|
|
8
9
|
/** The component client, scoped to the current request's trace so the sidecar records child spans. */
|
|
9
10
|
get client(): ComponentClient;
|
|
11
|
+
/** The service's secret store: values kept encrypted in the service's own database, never in a journal or a view. */
|
|
12
|
+
get secrets(): Secrets;
|
|
13
|
+
/** A unit test's store in place of the runtime's: `component.secrets = new InMemorySecrets()`. */
|
|
14
|
+
set secrets(store: Secrets);
|
|
15
|
+
/** Other services, called as this one, through the runtime: `this.services.service("orders")`. */
|
|
16
|
+
get services(): Services;
|
|
17
|
+
/** A unit test's in place of the runtime's: `component.services = new ScriptedServices()`. */
|
|
18
|
+
set services(services: Services);
|
|
10
19
|
/** @internal */
|
|
11
20
|
_bindClient(client: ComponentClient | undefined): void;
|
|
12
21
|
}
|
package/dist/endpoint.js
CHANGED
|
@@ -8,7 +8,9 @@
|
|
|
8
8
|
// static readonly routes = { getCart: get("/{cartId}", ShoppingCart, (ep: ShoppingCartEndpoint, req) => ep.getCart(req.params.cartId)) }
|
|
9
9
|
// getCart(cartId: string) { return this.client.of(ShoppingCartEntity, cartId).call(ShoppingCartEntity.handlers.getCart).invoke() }
|
|
10
10
|
// }
|
|
11
|
+
import { secretsFor } from "./client.js";
|
|
11
12
|
import { currentRequest, requestIfAny } from "./context.js";
|
|
13
|
+
import { servicesFor } from "./services.js";
|
|
12
14
|
export class Endpoint {
|
|
13
15
|
#client;
|
|
14
16
|
/** The request being handled: path parameters, query, headers, principal. Request-scoped. */
|
|
@@ -22,6 +24,24 @@ export class Endpoint {
|
|
|
22
24
|
const request = requestIfAny();
|
|
23
25
|
return request ? this.#client.withMetadata(request.metadata) : this.#client;
|
|
24
26
|
}
|
|
27
|
+
#secrets;
|
|
28
|
+
/** The service's secret store: values kept encrypted in the service's own database, never in a journal or a view. */
|
|
29
|
+
get secrets() {
|
|
30
|
+
return this.#secrets ?? secretsFor(this.client);
|
|
31
|
+
}
|
|
32
|
+
/** A unit test's store in place of the runtime's: `component.secrets = new InMemorySecrets()`. */
|
|
33
|
+
set secrets(store) {
|
|
34
|
+
this.#secrets = store;
|
|
35
|
+
}
|
|
36
|
+
#services;
|
|
37
|
+
/** Other services, called as this one, through the runtime: `this.services.service("orders")`. */
|
|
38
|
+
get services() {
|
|
39
|
+
return this.#services ?? servicesFor(this.client);
|
|
40
|
+
}
|
|
41
|
+
/** A unit test's in place of the runtime's: `component.services = new ScriptedServices()`. */
|
|
42
|
+
set services(services) {
|
|
43
|
+
this.#services = services;
|
|
44
|
+
}
|
|
25
45
|
/** @internal */
|
|
26
46
|
_bindClient(client) {
|
|
27
47
|
this.#client = client;
|
package/dist/graph.d.ts
ADDED
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import type { StartFrom } from "./startFrom.ts";
|
|
2
|
+
import { type Codec, type Shape } from "./codec.ts";
|
|
3
|
+
import type { EffectLike, Metadata } from "./effects/common.ts";
|
|
4
|
+
import { type ComponentClient, type ComponentRef, type Secrets } from "./client.ts";
|
|
5
|
+
import { type Services } from "./services.ts";
|
|
6
|
+
type MaybePromise<T> = T | Promise<T>;
|
|
7
|
+
/** The contract's name: the manifest and the `ce-type` of every delta. */
|
|
8
|
+
export declare const GRAPH_DELTA_SCHEMA = "ankka.graph-delta.v1";
|
|
9
|
+
/** The record key of every delta for the node `id`. */
|
|
10
|
+
export declare function nodeKey(id: string): string;
|
|
11
|
+
/** The record key of every delta for the edge `id`. Nodes and edges are separate id spaces. */
|
|
12
|
+
export declare function edgeKey(id: string): string;
|
|
13
|
+
/** A property's scalar: an integral `number` must be a safe integer; a larger integer is a `bigint`. */
|
|
14
|
+
export type Scalar = string | boolean | number | bigint;
|
|
15
|
+
/** A scalar, or a non-empty list of scalars of one kind. */
|
|
16
|
+
export type PropertyValue = Scalar | readonly Scalar[];
|
|
17
|
+
export type Properties = Readonly<Record<string, PropertyValue>>;
|
|
18
|
+
/** A version: a whole number of at least 1, as a safe-integer `number` or a `bigint` within 64 bits. */
|
|
19
|
+
export type Version = number | bigint;
|
|
20
|
+
/** An element as the author describes it. Without a `version` it takes its change's sequence number. */
|
|
21
|
+
export type Element = {
|
|
22
|
+
readonly kind: "node";
|
|
23
|
+
readonly id: string;
|
|
24
|
+
readonly version?: Version;
|
|
25
|
+
readonly labels: readonly string[];
|
|
26
|
+
readonly properties: Properties;
|
|
27
|
+
} | {
|
|
28
|
+
readonly kind: "edge";
|
|
29
|
+
readonly id: string;
|
|
30
|
+
readonly version?: Version;
|
|
31
|
+
readonly type: string;
|
|
32
|
+
readonly from: string;
|
|
33
|
+
readonly to: string;
|
|
34
|
+
readonly properties: Properties;
|
|
35
|
+
} | {
|
|
36
|
+
readonly kind: "tombstone";
|
|
37
|
+
readonly element: "node";
|
|
38
|
+
readonly id: string;
|
|
39
|
+
readonly version?: Version;
|
|
40
|
+
} | {
|
|
41
|
+
readonly kind: "tombstone";
|
|
42
|
+
readonly element: "edge";
|
|
43
|
+
readonly id: string;
|
|
44
|
+
readonly version?: Version;
|
|
45
|
+
readonly type: string;
|
|
46
|
+
readonly from: string;
|
|
47
|
+
readonly to: string;
|
|
48
|
+
};
|
|
49
|
+
/** An element at a version: what is written and read. */
|
|
50
|
+
export type Delta = Element & {
|
|
51
|
+
readonly version: Version;
|
|
52
|
+
};
|
|
53
|
+
/** Why an element or a result was refused; the names the shared fixture `refused.json` uses. */
|
|
54
|
+
export type GraphFault = "id" | "endpoints" | "identifier" | "reserved" | "property-value" | "integer-range" | "version" | "duplicate" | "no-sequence";
|
|
55
|
+
/** Thrown where an element is built, or when a result is returned, for something the merge sink would refuse. */
|
|
56
|
+
export declare class GraphError extends Error {
|
|
57
|
+
readonly why: GraphFault;
|
|
58
|
+
constructor(why: GraphFault, message: string);
|
|
59
|
+
}
|
|
60
|
+
/** The element key: `node:<id>` or `edge:<id>`; a tombstone has the key of the element it marks. */
|
|
61
|
+
export declare function elementKey(element: Element): string;
|
|
62
|
+
/** `this.graph` in a graph consumer: builds elements, refusing where they are built what the sink would refuse. */
|
|
63
|
+
export declare class Graph {
|
|
64
|
+
node(id: string, options?: {
|
|
65
|
+
readonly labels?: readonly string[];
|
|
66
|
+
readonly properties?: Properties;
|
|
67
|
+
readonly version?: Version;
|
|
68
|
+
}): Element;
|
|
69
|
+
edge(id: string, options: {
|
|
70
|
+
readonly type: string;
|
|
71
|
+
readonly from: string;
|
|
72
|
+
readonly to: string;
|
|
73
|
+
readonly properties?: Properties;
|
|
74
|
+
readonly version?: Version;
|
|
75
|
+
}): Element;
|
|
76
|
+
/** Marks a node deleted. The node stays in the graph, marked, so a straggling older delta cannot bring it back. */
|
|
77
|
+
tombstoneNode(id: string, options?: {
|
|
78
|
+
readonly version?: Version;
|
|
79
|
+
}): Element;
|
|
80
|
+
/** Marks an edge deleted; it names the edge's type and endpoints so the edge is found without a scan. */
|
|
81
|
+
tombstoneEdge(id: string, options: {
|
|
82
|
+
readonly type: string;
|
|
83
|
+
readonly from: string;
|
|
84
|
+
readonly to: string;
|
|
85
|
+
readonly version?: Version;
|
|
86
|
+
}): Element;
|
|
87
|
+
}
|
|
88
|
+
export type GraphEffect = ({
|
|
89
|
+
readonly kind: "publish";
|
|
90
|
+
readonly elements: readonly Element[];
|
|
91
|
+
} & EffectLike<never>) | ({
|
|
92
|
+
readonly kind: "done";
|
|
93
|
+
} & EffectLike<never>) | ({
|
|
94
|
+
readonly kind: "ignore";
|
|
95
|
+
} & EffectLike<never>);
|
|
96
|
+
/** `this.effects` in a graph consumer: there is nothing here that publishes anything but elements. */
|
|
97
|
+
export declare class GraphEffects {
|
|
98
|
+
/** Publish these elements, each as a delta under its own key. An empty list publishes nothing. */
|
|
99
|
+
publish(elements: readonly Element[]): GraphEffect;
|
|
100
|
+
done(): GraphEffect;
|
|
101
|
+
ignore(): GraphEffect;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Reads a delta's value back into an element, for tests and for a consumer of a delta topic. Given a
|
|
105
|
+
* `key` it also holds the contract's rule that the key is the delta's element key. It accepts a
|
|
106
|
+
* version of 0, which the contract allows and the builder does not write. An integer past 2⁵³ comes
|
|
107
|
+
* back as a `bigint`.
|
|
108
|
+
*/
|
|
109
|
+
export declare function readDelta(value: Uint8Array, key?: string): Delta;
|
|
110
|
+
/** The codec of a delta: JSON under the manifest `ankka.graph-delta.v1`. Hand-written, since a delta's properties have no fixed shape. */
|
|
111
|
+
export declare const graphDeltaCodec: Codec<Delta>;
|
|
112
|
+
/** One record a graph consumer's result comes to: the element key, the delta's bytes, and the delta. */
|
|
113
|
+
export interface DeltaRecord {
|
|
114
|
+
readonly key: string;
|
|
115
|
+
readonly value: Uint8Array;
|
|
116
|
+
readonly delta: Delta;
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* What a graph consumer's effect publishes for the change `metadata` describes: every element at its
|
|
120
|
+
* stated version, else the change's sequence number, refusing a result that names an element twice or
|
|
121
|
+
* leaves a version to a change that has no sequence number. The server and the test kit both read an
|
|
122
|
+
* effect through this, so they cannot disagree about what a handler published.
|
|
123
|
+
*
|
|
124
|
+
* @internal
|
|
125
|
+
*/
|
|
126
|
+
export declare function deltaRecords(effect: GraphEffect, metadata: Metadata): readonly DeltaRecord[];
|
|
127
|
+
/**
|
|
128
|
+
* A consumer that publishes a graph. Its handlers return elements; each is published to `producesTo`
|
|
129
|
+
* as a delta under its element key. It has no `produce` and no way to set a key, and it is discovered
|
|
130
|
+
* and hosted as an ordinary consumer.
|
|
131
|
+
*/
|
|
132
|
+
export declare abstract class GraphConsumer<M> {
|
|
133
|
+
#private;
|
|
134
|
+
readonly graph: Graph;
|
|
135
|
+
readonly effects: GraphEffects;
|
|
136
|
+
/** The change's metadata: `ce-subject` is the source instance's id, `ankka.sequence` its sequence number. */
|
|
137
|
+
get metadata(): Metadata;
|
|
138
|
+
get subject(): string;
|
|
139
|
+
/** The change's sequence number, which is the version of every element that states none. */
|
|
140
|
+
get sequenceNumber(): bigint | undefined;
|
|
141
|
+
get client(): ComponentClient;
|
|
142
|
+
/** The service's secret store: values kept encrypted in the service's own database, never in a journal or a view. */
|
|
143
|
+
get secrets(): Secrets;
|
|
144
|
+
/** A unit test's store in place of the runtime's: `component.secrets = new InMemorySecrets()`. */
|
|
145
|
+
set secrets(store: Secrets);
|
|
146
|
+
/** Other services, called as this one, through the runtime: `this.services.service("orders")`. */
|
|
147
|
+
get services(): Services;
|
|
148
|
+
/** A unit test's in place of the runtime's: `component.services = new ScriptedServices()`. */
|
|
149
|
+
set services(services: Services);
|
|
150
|
+
/** @internal */
|
|
151
|
+
get _kind(): "consumer";
|
|
152
|
+
abstract onMessage(message: M): MaybePromise<GraphEffect>;
|
|
153
|
+
/** The source was deleted. Ignored unless this says otherwise; publish tombstones here. */
|
|
154
|
+
onDelete(): MaybePromise<GraphEffect>;
|
|
155
|
+
/** @internal */
|
|
156
|
+
_bind(metadata: Metadata, client: ComponentClient): void;
|
|
157
|
+
}
|
|
158
|
+
export interface GraphConsumerClass<M = unknown, C extends GraphConsumer<M> = GraphConsumer<M>> {
|
|
159
|
+
new (): C;
|
|
160
|
+
readonly componentId: string;
|
|
161
|
+
readonly source?: ComponentRef;
|
|
162
|
+
readonly topic?: string;
|
|
163
|
+
/** Where a topic source starts the first time its group reads the topic. */
|
|
164
|
+
readonly startFrom?: StartFrom;
|
|
165
|
+
/** Raised to read the topic again from the start position, under a group of its own. Absent is 1. */
|
|
166
|
+
readonly version?: number;
|
|
167
|
+
readonly message: Shape<M>;
|
|
168
|
+
/** The delta topic. It must be compacted to hold the graph; the pipeline that reads it creates it so. */
|
|
169
|
+
readonly producesTo: string;
|
|
170
|
+
}
|
|
171
|
+
export {};
|