@qlever-llc/trellis 0.10.8 → 0.10.10
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/esm/contract_support/mod.d.ts +1 -1
- package/esm/contract_support/mod.d.ts.map +1 -1
- package/esm/contract_support/mod.js +1 -1
- package/esm/contract_support/protocol.d.ts +67 -0
- package/esm/contract_support/protocol.d.ts.map +1 -1
- package/esm/contract_support/protocol.js +90 -0
- package/esm/generated-sdk/auth/api.d.ts.map +1 -1
- package/esm/generated-sdk/auth/client.d.ts.map +1 -1
- package/esm/generated-sdk/auth/contract.d.ts.map +1 -1
- package/esm/generated-sdk/auth/contract.js +9590 -7
- package/esm/generated-sdk/auth/mod.d.ts +3 -3
- package/esm/generated-sdk/auth/mod.d.ts.map +1 -1
- package/esm/generated-sdk/auth/mod.js +1 -1
- package/esm/generated-sdk/auth/owned_api.d.ts.map +1 -1
- package/esm/generated-sdk/auth/owned_api.js +305 -62
- package/esm/generated-sdk/auth/schemas.d.ts.map +1 -1
- package/esm/generated-sdk/auth/schemas.js +6492 -139
- package/esm/generated-sdk/auth/types.d.ts +254 -254
- package/esm/generated-sdk/auth/types.d.ts.map +1 -1
- package/esm/generated-sdk/health/api.d.ts.map +1 -1
- package/esm/generated-sdk/health/client.d.ts.map +1 -1
- package/esm/generated-sdk/health/contract.d.ts.map +1 -1
- package/esm/generated-sdk/health/contract.js +117 -7
- package/esm/generated-sdk/health/mod.d.ts +2 -2
- package/esm/generated-sdk/health/mod.d.ts.map +1 -1
- package/esm/generated-sdk/health/mod.js +1 -1
- package/esm/generated-sdk/health/owned_api.d.ts.map +1 -1
- package/esm/generated-sdk/health/schemas.d.ts.map +1 -1
- package/esm/generated-sdk/health/schemas.js +79 -1
- package/esm/generated-sdk/health/types.d.ts +4 -4
- package/esm/generated-sdk/health/types.d.ts.map +1 -1
- package/esm/generated-sdk/jobs/api.d.ts.map +1 -1
- package/esm/generated-sdk/jobs/api.js +12 -4
- package/esm/generated-sdk/jobs/client.d.ts.map +1 -1
- package/esm/generated-sdk/jobs/contract.d.ts.map +1 -1
- package/esm/generated-sdk/jobs/contract.js +1080 -7
- package/esm/generated-sdk/jobs/mod.d.ts +2 -2
- package/esm/generated-sdk/jobs/mod.d.ts.map +1 -1
- package/esm/generated-sdk/jobs/mod.js +1 -1
- package/esm/generated-sdk/jobs/owned_api.d.ts.map +1 -1
- package/esm/generated-sdk/jobs/owned_api.js +26 -6
- package/esm/generated-sdk/jobs/schemas.d.ts.map +1 -1
- package/esm/generated-sdk/jobs/schemas.js +768 -18
- package/esm/generated-sdk/jobs/types.d.ts +14 -14
- package/esm/generated-sdk/jobs/types.d.ts.map +1 -1
- package/esm/generated-sdk/state/api.d.ts.map +1 -1
- package/esm/generated-sdk/state/api.js +3 -1
- package/esm/generated-sdk/state/client.d.ts.map +1 -1
- package/esm/generated-sdk/state/contract.d.ts.map +1 -1
- package/esm/generated-sdk/state/contract.js +638 -7
- package/esm/generated-sdk/state/mod.d.ts +2 -2
- package/esm/generated-sdk/state/mod.d.ts.map +1 -1
- package/esm/generated-sdk/state/mod.js +1 -1
- package/esm/generated-sdk/state/owned_api.d.ts.map +1 -1
- package/esm/generated-sdk/state/owned_api.js +36 -8
- package/esm/generated-sdk/state/schemas.d.ts.map +1 -1
- package/esm/generated-sdk/state/schemas.js +441 -14
- package/esm/generated-sdk/state/types.d.ts +15 -15
- package/esm/generated-sdk/state/types.d.ts.map +1 -1
- package/esm/generated-sdk/trellis-core/api.d.ts.map +1 -1
- package/esm/generated-sdk/trellis-core/client.d.ts.map +1 -1
- package/esm/generated-sdk/trellis-core/contract.d.ts.map +1 -1
- package/esm/generated-sdk/trellis-core/contract.js +744 -7
- package/esm/generated-sdk/trellis-core/mod.d.ts +2 -2
- package/esm/generated-sdk/trellis-core/mod.d.ts.map +1 -1
- package/esm/generated-sdk/trellis-core/mod.js +1 -1
- package/esm/generated-sdk/trellis-core/owned_api.d.ts.map +1 -1
- package/esm/generated-sdk/trellis-core/owned_api.js +1 -1
- package/esm/generated-sdk/trellis-core/schemas.d.ts.map +1 -1
- package/esm/generated-sdk/trellis-core/schemas.js +626 -8
- package/esm/generated-sdk/trellis-core/types.d.ts +14 -14
- package/esm/generated-sdk/trellis-core/types.d.ts.map +1 -1
- package/esm/index.d.ts +2 -2
- package/esm/index.d.ts.map +1 -1
- package/esm/index.js +1 -1
- package/esm/server/service.d.ts +40 -9
- package/esm/server/service.d.ts.map +1 -1
- package/esm/server/service.js +28 -4
- package/esm/service/deno.d.ts +1 -1
- package/esm/service/deno.d.ts.map +1 -1
- package/esm/service/mod.d.ts +1 -1
- package/esm/service/mod.d.ts.map +1 -1
- package/esm/service/node.d.ts +1 -1
- package/esm/service/node.d.ts.map +1 -1
- package/package.json +2 -2
- package/script/contract_support/mod.d.ts +1 -1
- package/script/contract_support/mod.d.ts.map +1 -1
- package/script/contract_support/mod.js +8 -1
- package/script/contract_support/protocol.d.ts +67 -0
- package/script/contract_support/protocol.d.ts.map +1 -1
- package/script/contract_support/protocol.js +96 -1
- package/script/generated-sdk/auth/api.d.ts.map +1 -1
- package/script/generated-sdk/auth/client.d.ts.map +1 -1
- package/script/generated-sdk/auth/contract.d.ts.map +1 -1
- package/script/generated-sdk/auth/contract.js +9590 -7
- package/script/generated-sdk/auth/mod.d.ts +3 -3
- package/script/generated-sdk/auth/mod.d.ts.map +1 -1
- package/script/generated-sdk/auth/mod.js +2 -2
- package/script/generated-sdk/auth/owned_api.d.ts.map +1 -1
- package/script/generated-sdk/auth/owned_api.js +304 -61
- package/script/generated-sdk/auth/schemas.d.ts.map +1 -1
- package/script/generated-sdk/auth/schemas.js +6492 -139
- package/script/generated-sdk/auth/types.d.ts +254 -254
- package/script/generated-sdk/auth/types.d.ts.map +1 -1
- package/script/generated-sdk/health/api.d.ts.map +1 -1
- package/script/generated-sdk/health/client.d.ts.map +1 -1
- package/script/generated-sdk/health/contract.d.ts.map +1 -1
- package/script/generated-sdk/health/contract.js +117 -7
- package/script/generated-sdk/health/mod.d.ts +2 -2
- package/script/generated-sdk/health/mod.d.ts.map +1 -1
- package/script/generated-sdk/health/mod.js +2 -2
- package/script/generated-sdk/health/owned_api.d.ts.map +1 -1
- package/script/generated-sdk/health/schemas.d.ts.map +1 -1
- package/script/generated-sdk/health/schemas.js +79 -1
- package/script/generated-sdk/health/types.d.ts +4 -4
- package/script/generated-sdk/health/types.d.ts.map +1 -1
- package/script/generated-sdk/jobs/api.d.ts.map +1 -1
- package/script/generated-sdk/jobs/api.js +12 -4
- package/script/generated-sdk/jobs/client.d.ts.map +1 -1
- package/script/generated-sdk/jobs/contract.d.ts.map +1 -1
- package/script/generated-sdk/jobs/contract.js +1080 -7
- package/script/generated-sdk/jobs/mod.d.ts +2 -2
- package/script/generated-sdk/jobs/mod.d.ts.map +1 -1
- package/script/generated-sdk/jobs/mod.js +2 -2
- package/script/generated-sdk/jobs/owned_api.d.ts.map +1 -1
- package/script/generated-sdk/jobs/owned_api.js +25 -5
- package/script/generated-sdk/jobs/schemas.d.ts.map +1 -1
- package/script/generated-sdk/jobs/schemas.js +768 -18
- package/script/generated-sdk/jobs/types.d.ts +14 -14
- package/script/generated-sdk/jobs/types.d.ts.map +1 -1
- package/script/generated-sdk/state/api.d.ts.map +1 -1
- package/script/generated-sdk/state/api.js +3 -1
- package/script/generated-sdk/state/client.d.ts.map +1 -1
- package/script/generated-sdk/state/contract.d.ts.map +1 -1
- package/script/generated-sdk/state/contract.js +638 -7
- package/script/generated-sdk/state/mod.d.ts +2 -2
- package/script/generated-sdk/state/mod.d.ts.map +1 -1
- package/script/generated-sdk/state/mod.js +2 -2
- package/script/generated-sdk/state/owned_api.d.ts.map +1 -1
- package/script/generated-sdk/state/owned_api.js +35 -7
- package/script/generated-sdk/state/schemas.d.ts.map +1 -1
- package/script/generated-sdk/state/schemas.js +441 -14
- package/script/generated-sdk/state/types.d.ts +15 -15
- package/script/generated-sdk/state/types.d.ts.map +1 -1
- package/script/generated-sdk/trellis-core/api.d.ts.map +1 -1
- package/script/generated-sdk/trellis-core/client.d.ts.map +1 -1
- package/script/generated-sdk/trellis-core/contract.d.ts.map +1 -1
- package/script/generated-sdk/trellis-core/contract.js +744 -7
- package/script/generated-sdk/trellis-core/mod.d.ts +2 -2
- package/script/generated-sdk/trellis-core/mod.d.ts.map +1 -1
- package/script/generated-sdk/trellis-core/mod.js +2 -2
- package/script/generated-sdk/trellis-core/owned_api.d.ts.map +1 -1
- package/script/generated-sdk/trellis-core/schemas.d.ts.map +1 -1
- package/script/generated-sdk/trellis-core/schemas.js +626 -8
- package/script/generated-sdk/trellis-core/types.d.ts +14 -14
- package/script/generated-sdk/trellis-core/types.d.ts.map +1 -1
- package/script/index.d.ts +2 -2
- package/script/index.d.ts.map +1 -1
- package/script/index.js +9 -2
- package/script/server/service.d.ts +40 -9
- package/script/server/service.d.ts.map +1 -1
- package/script/server/service.js +27 -3
- package/script/service/deno.d.ts +1 -1
- package/script/service/deno.d.ts.map +1 -1
- package/script/service/mod.d.ts +1 -1
- package/script/service/mod.d.ts.map +1 -1
- package/script/service/node.d.ts +1 -1
- package/script/service/node.d.ts.map +1 -1
- package/src/contract_support/mod.ts +12 -0
- package/src/contract_support/protocol.ts +137 -0
- package/src/index.ts +12 -0
- package/src/sdk/_generated/auth/api.ts +10 -21
- package/src/sdk/_generated/auth/client.ts +1178 -160
- package/src/sdk/_generated/auth/contract.ts +9637 -13
- package/src/sdk/_generated/auth/mod.ts +22 -3
- package/src/sdk/_generated/auth/owned_api.ts +897 -264
- package/src/sdk/_generated/auth/schemas.ts +6630 -278
- package/src/sdk/_generated/auth/types.ts +2950 -359
- package/src/sdk/_generated/core/api.ts +10 -21
- package/src/sdk/_generated/core/client.ts +105 -12
- package/src/sdk/_generated/core/contract.ts +774 -13
- package/src/sdk/_generated/core/mod.ts +17 -2
- package/src/sdk/_generated/core/owned_api.ts +40 -24
- package/src/sdk/_generated/core/schemas.ts +626 -9
- package/src/sdk/_generated/core/types.ts +233 -18
- package/src/sdk/_generated/health/api.ts +10 -21
- package/src/sdk/_generated/health/client.ts +104 -8
- package/src/sdk/_generated/health/contract.ts +144 -13
- package/src/sdk/_generated/health/mod.ts +17 -2
- package/src/sdk/_generated/health/owned_api.ts +4 -9
- package/src/sdk/_generated/health/schemas.ts +79 -2
- package/src/sdk/_generated/health/types.ts +31 -4
- package/src/sdk/_generated/jobs/api.ts +20 -18
- package/src/sdk/_generated/jobs/client.ts +199 -28
- package/src/sdk/_generated/jobs/contract.ts +1119 -13
- package/src/sdk/_generated/jobs/mod.ts +17 -2
- package/src/sdk/_generated/jobs/owned_api.ts +64 -27
- package/src/sdk/_generated/jobs/schemas.ts +776 -20
- package/src/sdk/_generated/jobs/types.ts +407 -34
- package/src/sdk/_generated/state/api.ts +11 -18
- package/src/sdk/_generated/state/client.ts +169 -22
- package/src/sdk/_generated/state/contract.ts +670 -13
- package/src/sdk/_generated/state/mod.ts +17 -2
- package/src/sdk/_generated/state/owned_api.ts +65 -25
- package/src/sdk/_generated/state/schemas.ts +441 -15
- package/src/sdk/_generated/state/types.ts +229 -26
- package/src/server/service.ts +133 -7
- package/src/service/deno.ts +4 -0
- package/src/service/mod.ts +4 -0
- package/src/service/node.ts +4 -0
|
@@ -2,5 +2,20 @@ export { API, OWNED_API } from "./api.js";
|
|
|
2
2
|
export type { Api, ApiViews, OwnedApi } from "./api.js";
|
|
3
3
|
export * from "./types.js";
|
|
4
4
|
export * from "./schemas.js";
|
|
5
|
-
export type {
|
|
6
|
-
|
|
5
|
+
export type {
|
|
6
|
+
Client,
|
|
7
|
+
HandlerClient,
|
|
8
|
+
Service,
|
|
9
|
+
ServiceEventSurface,
|
|
10
|
+
ServiceHandle,
|
|
11
|
+
ServiceWithDeps,
|
|
12
|
+
TrellisHealthClient,
|
|
13
|
+
TrellisHealthState,
|
|
14
|
+
} from "./client.js";
|
|
15
|
+
export {
|
|
16
|
+
CONTRACT,
|
|
17
|
+
CONTRACT_DIGEST,
|
|
18
|
+
CONTRACT_ID,
|
|
19
|
+
sdk,
|
|
20
|
+
use,
|
|
21
|
+
} from "./contract.js";
|
|
@@ -5,10 +5,8 @@ import type * as Types from "./types.js";
|
|
|
5
5
|
import { HealthHeartbeatSchema } from "./schemas.js";
|
|
6
6
|
|
|
7
7
|
export const OWNED_API = {
|
|
8
|
-
rpc: {
|
|
9
|
-
},
|
|
10
|
-
operations: {
|
|
11
|
-
},
|
|
8
|
+
rpc: {},
|
|
9
|
+
operations: {},
|
|
12
10
|
events: {
|
|
13
11
|
"Health.Heartbeat": {
|
|
14
12
|
subject: "events.v1.Health.Heartbeat",
|
|
@@ -17,9 +15,6 @@ export const OWNED_API = {
|
|
|
17
15
|
subscribeCapabilities: [],
|
|
18
16
|
},
|
|
19
17
|
},
|
|
20
|
-
feeds: {
|
|
21
|
-
},
|
|
22
|
-
subjects: {
|
|
23
|
-
},
|
|
18
|
+
feeds: {},
|
|
19
|
+
subjects: {},
|
|
24
20
|
} satisfies TrellisAPI;
|
|
25
|
-
|
|
@@ -1,3 +1,80 @@
|
|
|
1
1
|
// Generated from ./generated/contracts/manifests/trellis.health@v1.json
|
|
2
|
-
export const HealthHeartbeatSchema = {
|
|
3
|
-
|
|
2
|
+
export const HealthHeartbeatSchema = {
|
|
3
|
+
"properties": {
|
|
4
|
+
"checks": {
|
|
5
|
+
"items": {
|
|
6
|
+
"properties": {
|
|
7
|
+
"error": { "type": "string" },
|
|
8
|
+
"info": { "patternProperties": { "^.*$": {} }, "type": "object" },
|
|
9
|
+
"latencyMs": { "type": "number" },
|
|
10
|
+
"name": { "type": "string" },
|
|
11
|
+
"status": {
|
|
12
|
+
"anyOf": [{ "const": "ok", "type": "string" }, {
|
|
13
|
+
"const": "failed",
|
|
14
|
+
"type": "string",
|
|
15
|
+
}],
|
|
16
|
+
},
|
|
17
|
+
"summary": { "type": "string" },
|
|
18
|
+
},
|
|
19
|
+
"required": ["name", "status", "latencyMs"],
|
|
20
|
+
"type": "object",
|
|
21
|
+
},
|
|
22
|
+
"type": "array",
|
|
23
|
+
},
|
|
24
|
+
"header": {
|
|
25
|
+
"properties": {
|
|
26
|
+
"id": { "type": "string" },
|
|
27
|
+
"time": { "format": "date-time", "type": "string" },
|
|
28
|
+
},
|
|
29
|
+
"required": ["id", "time"],
|
|
30
|
+
"type": "object",
|
|
31
|
+
},
|
|
32
|
+
"service": {
|
|
33
|
+
"properties": {
|
|
34
|
+
"contractDigest": { "type": "string" },
|
|
35
|
+
"contractId": { "type": "string" },
|
|
36
|
+
"info": { "patternProperties": { "^.*$": {} }, "type": "object" },
|
|
37
|
+
"instanceId": { "type": "string" },
|
|
38
|
+
"kind": {
|
|
39
|
+
"anyOf": [{ "const": "service", "type": "string" }, {
|
|
40
|
+
"const": "device",
|
|
41
|
+
"type": "string",
|
|
42
|
+
}],
|
|
43
|
+
},
|
|
44
|
+
"name": { "type": "string" },
|
|
45
|
+
"publishIntervalMs": { "minimum": 1, "type": "integer" },
|
|
46
|
+
"runtime": {
|
|
47
|
+
"anyOf": [
|
|
48
|
+
{ "const": "deno", "type": "string" },
|
|
49
|
+
{ "const": "node", "type": "string" },
|
|
50
|
+
{ "const": "rust", "type": "string" },
|
|
51
|
+
{ "const": "unknown", "type": "string" },
|
|
52
|
+
],
|
|
53
|
+
},
|
|
54
|
+
"runtimeVersion": { "type": "string" },
|
|
55
|
+
"startedAt": { "format": "date-time", "type": "string" },
|
|
56
|
+
"version": { "type": "string" },
|
|
57
|
+
},
|
|
58
|
+
"required": [
|
|
59
|
+
"name",
|
|
60
|
+
"kind",
|
|
61
|
+
"instanceId",
|
|
62
|
+
"contractId",
|
|
63
|
+
"contractDigest",
|
|
64
|
+
"startedAt",
|
|
65
|
+
"publishIntervalMs",
|
|
66
|
+
"runtime",
|
|
67
|
+
],
|
|
68
|
+
"type": "object",
|
|
69
|
+
},
|
|
70
|
+
"status": {
|
|
71
|
+
"anyOf": [{ "const": "healthy", "type": "string" }, {
|
|
72
|
+
"const": "unhealthy",
|
|
73
|
+
"type": "string",
|
|
74
|
+
}, { "const": "degraded", "type": "string" }],
|
|
75
|
+
},
|
|
76
|
+
"summary": { "type": "string" },
|
|
77
|
+
},
|
|
78
|
+
"required": ["header", "service", "status", "checks"],
|
|
79
|
+
"type": "object",
|
|
80
|
+
} as const;
|
|
@@ -1,14 +1,42 @@
|
|
|
1
1
|
// Generated from ./generated/contracts/manifests/trellis.health@v1.json
|
|
2
2
|
export const CONTRACT_ID = "trellis.health@v1" as const;
|
|
3
|
-
export const CONTRACT_DIGEST =
|
|
3
|
+
export const CONTRACT_DIGEST =
|
|
4
|
+
"RHDzeH2V6Nltzk6WklCLbTIK48hF0hNuO9Qk6-BosT4" as const;
|
|
4
5
|
|
|
5
|
-
export type HealthHeartbeatEvent = {
|
|
6
|
+
export type HealthHeartbeatEvent = {
|
|
7
|
+
checks: Array<
|
|
8
|
+
{
|
|
9
|
+
error?: string;
|
|
10
|
+
info?: { [k: string]: unknown };
|
|
11
|
+
latencyMs: number;
|
|
12
|
+
name: string;
|
|
13
|
+
status: "ok" | "failed";
|
|
14
|
+
summary?: string;
|
|
15
|
+
}
|
|
16
|
+
>;
|
|
17
|
+
header: { id: string; time: string };
|
|
18
|
+
service: {
|
|
19
|
+
contractDigest: string;
|
|
20
|
+
contractId: string;
|
|
21
|
+
info?: { [k: string]: unknown };
|
|
22
|
+
instanceId: string;
|
|
23
|
+
kind: "service" | "device";
|
|
24
|
+
name: string;
|
|
25
|
+
publishIntervalMs: number;
|
|
26
|
+
runtime: "deno" | "node" | "rust" | "unknown";
|
|
27
|
+
runtimeVersion?: string;
|
|
28
|
+
startedAt: string;
|
|
29
|
+
version?: string;
|
|
30
|
+
};
|
|
31
|
+
status: "healthy" | "unhealthy" | "degraded";
|
|
32
|
+
summary?: string;
|
|
33
|
+
};
|
|
6
34
|
|
|
7
35
|
export interface RpcMap {
|
|
8
36
|
}
|
|
9
37
|
|
|
10
38
|
export interface EventMap {
|
|
11
|
-
"Health.Heartbeat": { event: HealthHeartbeatEvent
|
|
39
|
+
"Health.Heartbeat": { event: HealthHeartbeatEvent };
|
|
12
40
|
}
|
|
13
41
|
|
|
14
42
|
export interface FeedMap {
|
|
@@ -16,4 +44,3 @@ export interface FeedMap {
|
|
|
16
44
|
|
|
17
45
|
export interface SubjectMap {
|
|
18
46
|
}
|
|
19
|
-
|
|
@@ -8,36 +8,39 @@ export { OWNED_API };
|
|
|
8
8
|
|
|
9
9
|
export type UsedApi = {
|
|
10
10
|
rpc: {
|
|
11
|
-
readonly "Auth.Requests.Validate":
|
|
11
|
+
readonly "Auth.Requests.Validate":
|
|
12
|
+
typeof AuthApi.rpc["Auth.Requests.Validate"];
|
|
12
13
|
readonly "Trellis.Bindings.Get": typeof CoreApi.rpc["Trellis.Bindings.Get"];
|
|
13
14
|
readonly "Trellis.Catalog": typeof CoreApi.rpc["Trellis.Catalog"];
|
|
14
15
|
};
|
|
15
|
-
operations: {
|
|
16
|
-
};
|
|
16
|
+
operations: {};
|
|
17
17
|
events: {
|
|
18
18
|
readonly "Health.Heartbeat": typeof HealthApi.events["Health.Heartbeat"];
|
|
19
19
|
};
|
|
20
|
-
feeds: {
|
|
21
|
-
};
|
|
22
|
-
subjects: {
|
|
23
|
-
};
|
|
20
|
+
feeds: {};
|
|
21
|
+
subjects: {};
|
|
24
22
|
};
|
|
25
23
|
|
|
26
24
|
export const USED_API: UsedApi = {
|
|
27
25
|
rpc: {
|
|
28
|
-
get "Auth.Requests.Validate"() {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
26
|
+
get "Auth.Requests.Validate"() {
|
|
27
|
+
return AuthApi.rpc["Auth.Requests.Validate"];
|
|
28
|
+
},
|
|
29
|
+
get "Trellis.Bindings.Get"() {
|
|
30
|
+
return CoreApi.rpc["Trellis.Bindings.Get"];
|
|
31
|
+
},
|
|
32
|
+
get "Trellis.Catalog"() {
|
|
33
|
+
return CoreApi.rpc["Trellis.Catalog"];
|
|
34
|
+
},
|
|
33
35
|
},
|
|
36
|
+
operations: {},
|
|
34
37
|
events: {
|
|
35
|
-
get "Health.Heartbeat"() {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
},
|
|
39
|
-
subjects: {
|
|
38
|
+
get "Health.Heartbeat"() {
|
|
39
|
+
return HealthApi.events["Health.Heartbeat"];
|
|
40
|
+
},
|
|
40
41
|
},
|
|
42
|
+
feeds: {},
|
|
43
|
+
subjects: {},
|
|
41
44
|
};
|
|
42
45
|
|
|
43
46
|
export type OwnedApi = typeof OWNED_API;
|
|
@@ -55,4 +58,3 @@ export const API = {
|
|
|
55
58
|
} as const;
|
|
56
59
|
|
|
57
60
|
export type ApiViews = typeof API;
|
|
58
|
-
|
|
@@ -1,5 +1,36 @@
|
|
|
1
1
|
// Generated from ./generated/contracts/manifests/trellis.jobs@v1.json
|
|
2
|
-
import type {
|
|
2
|
+
import type {
|
|
3
|
+
AcceptedOperation,
|
|
4
|
+
AsyncResult,
|
|
5
|
+
BaseError,
|
|
6
|
+
EventListenerContext,
|
|
7
|
+
EventOpts,
|
|
8
|
+
FeedSubscribeOpts,
|
|
9
|
+
FeedSubscription,
|
|
10
|
+
HandlerTrellis,
|
|
11
|
+
MapStateStoreClient,
|
|
12
|
+
MaybeAsync,
|
|
13
|
+
OperationInputBuilder,
|
|
14
|
+
OperationObserverCallbacks,
|
|
15
|
+
OperationRef,
|
|
16
|
+
OperationRefData,
|
|
17
|
+
OperationRuntimeHandle,
|
|
18
|
+
OperationTransferHandle,
|
|
19
|
+
PreparedTrellisEvent,
|
|
20
|
+
ReceiveTransferGrant,
|
|
21
|
+
ReceiveTransferHandle,
|
|
22
|
+
RequestOpts,
|
|
23
|
+
Result,
|
|
24
|
+
RpcHandlerContext,
|
|
25
|
+
SendTransferGrant,
|
|
26
|
+
SendTransferHandle,
|
|
27
|
+
TerminalOperation,
|
|
28
|
+
TransferCapableOperationInputBuilder,
|
|
29
|
+
TrellisConnection,
|
|
30
|
+
UnexpectedError,
|
|
31
|
+
ValidationError,
|
|
32
|
+
ValueStateStoreClient,
|
|
33
|
+
} from "../../../index.js";
|
|
3
34
|
import type { API, Api } from "./api.js";
|
|
4
35
|
import type * as Types from "./types.js";
|
|
5
36
|
import type * as AuthSdk from "../auth/mod.js";
|
|
@@ -9,16 +40,51 @@ import type * as HealthSdk from "../health/mod.js";
|
|
|
9
40
|
type WithDeps<TDeps> = [TDeps] extends [undefined] ? {} : { deps: TDeps };
|
|
10
41
|
|
|
11
42
|
type EventCallback<TMessage> = {
|
|
12
|
-
bivarianceHack(
|
|
43
|
+
bivarianceHack(
|
|
44
|
+
message: TMessage,
|
|
45
|
+
context: EventListenerContext,
|
|
46
|
+
): MaybeAsync<void, BaseError>;
|
|
13
47
|
}["bivarianceHack"];
|
|
14
48
|
|
|
15
|
-
type ServiceEventHandler<TEvent, TDeps = undefined> = (
|
|
49
|
+
type ServiceEventHandler<TEvent, TDeps = undefined> = (
|
|
50
|
+
args:
|
|
51
|
+
& { event: TEvent; context: EventListenerContext; client: HandlerClient }
|
|
52
|
+
& WithDeps<TDeps>,
|
|
53
|
+
) => MaybeAsync<void, BaseError>;
|
|
16
54
|
|
|
17
|
-
type RpcHandler<TInput, TOutput, TDeps = undefined> = (
|
|
55
|
+
type RpcHandler<TInput, TOutput, TDeps = undefined> = (
|
|
56
|
+
args:
|
|
57
|
+
& { input: TInput; context: RpcHandlerContext; client: HandlerClient }
|
|
58
|
+
& WithDeps<TDeps>,
|
|
59
|
+
) => MaybeAsync<TOutput, BaseError>;
|
|
18
60
|
|
|
19
|
-
type FeedHandler<TInput, TEvent, TDeps = undefined> = (
|
|
61
|
+
type FeedHandler<TInput, TEvent, TDeps = undefined> = (
|
|
62
|
+
context: {
|
|
63
|
+
input: TInput;
|
|
64
|
+
caller: unknown;
|
|
65
|
+
signal: AbortSignal;
|
|
66
|
+
emit(event: TEvent): AsyncResult<void, ValidationError | UnexpectedError>;
|
|
67
|
+
client: HandlerClient;
|
|
68
|
+
} & WithDeps<TDeps>,
|
|
69
|
+
) => unknown | Promise<unknown>;
|
|
20
70
|
|
|
21
|
-
type OperationHandler<
|
|
71
|
+
type OperationHandler<
|
|
72
|
+
TInput,
|
|
73
|
+
TProgress,
|
|
74
|
+
TOutput,
|
|
75
|
+
TTransfer,
|
|
76
|
+
TDeps = undefined,
|
|
77
|
+
> = (
|
|
78
|
+
context:
|
|
79
|
+
& {
|
|
80
|
+
input: TInput;
|
|
81
|
+
op: OperationRuntimeHandle<TProgress, TOutput>;
|
|
82
|
+
caller: unknown;
|
|
83
|
+
client: HandlerClient;
|
|
84
|
+
}
|
|
85
|
+
& TTransfer
|
|
86
|
+
& WithDeps<TDeps>,
|
|
87
|
+
) => unknown | Promise<unknown>;
|
|
22
88
|
|
|
23
89
|
export type TrellisJobsState = {};
|
|
24
90
|
|
|
@@ -33,26 +99,74 @@ export interface TrellisJobsClient {
|
|
|
33
99
|
transfer(grant: ReceiveTransferGrant): ReceiveTransferHandle;
|
|
34
100
|
readonly rpc: {
|
|
35
101
|
readonly auth: {
|
|
36
|
-
requestsValidate(
|
|
102
|
+
requestsValidate(
|
|
103
|
+
input: AuthSdk.AuthRequestsValidateInput,
|
|
104
|
+
opts?: RequestOpts,
|
|
105
|
+
): AsyncResult<AuthSdk.AuthRequestsValidateOutput, BaseError>;
|
|
37
106
|
};
|
|
38
107
|
readonly jobs: {
|
|
39
|
-
cancel(
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
108
|
+
cancel(
|
|
109
|
+
input: Types.JobsCancelInput,
|
|
110
|
+
opts?: RequestOpts,
|
|
111
|
+
): AsyncResult<Types.JobsCancelOutput, BaseError>;
|
|
112
|
+
dismissDLQ(
|
|
113
|
+
input: Types.JobsDismissDLQInput,
|
|
114
|
+
opts?: RequestOpts,
|
|
115
|
+
): AsyncResult<Types.JobsDismissDLQOutput, BaseError>;
|
|
116
|
+
get(
|
|
117
|
+
input: Types.JobsGetInput,
|
|
118
|
+
opts?: RequestOpts,
|
|
119
|
+
): AsyncResult<Types.JobsGetOutput, BaseError>;
|
|
120
|
+
health(
|
|
121
|
+
input: Types.JobsHealthInput,
|
|
122
|
+
opts?: RequestOpts,
|
|
123
|
+
): AsyncResult<Types.JobsHealthOutput, BaseError>;
|
|
124
|
+
list(
|
|
125
|
+
input: Types.JobsListInput,
|
|
126
|
+
opts?: RequestOpts,
|
|
127
|
+
): AsyncResult<Types.JobsListOutput, BaseError>;
|
|
128
|
+
listDLQ(
|
|
129
|
+
input: Types.JobsListDLQInput,
|
|
130
|
+
opts?: RequestOpts,
|
|
131
|
+
): AsyncResult<Types.JobsListDLQOutput, BaseError>;
|
|
132
|
+
listServices(
|
|
133
|
+
input: Types.JobsListServicesInput,
|
|
134
|
+
opts?: RequestOpts,
|
|
135
|
+
): AsyncResult<Types.JobsListServicesOutput, BaseError>;
|
|
136
|
+
replayDLQ(
|
|
137
|
+
input: Types.JobsReplayDLQInput,
|
|
138
|
+
opts?: RequestOpts,
|
|
139
|
+
): AsyncResult<Types.JobsReplayDLQOutput, BaseError>;
|
|
140
|
+
retry(
|
|
141
|
+
input: Types.JobsRetryInput,
|
|
142
|
+
opts?: RequestOpts,
|
|
143
|
+
): AsyncResult<Types.JobsRetryOutput, BaseError>;
|
|
48
144
|
};
|
|
49
145
|
readonly trellis: {
|
|
50
|
-
catalog(
|
|
146
|
+
catalog(
|
|
147
|
+
input: CoreSdk.TrellisCatalogInput,
|
|
148
|
+
opts?: RequestOpts,
|
|
149
|
+
): AsyncResult<CoreSdk.TrellisCatalogOutput, BaseError>;
|
|
51
150
|
};
|
|
52
151
|
};
|
|
53
152
|
readonly event: {
|
|
54
153
|
readonly health: {
|
|
55
|
-
heartbeat: {
|
|
154
|
+
heartbeat: {
|
|
155
|
+
publish(
|
|
156
|
+
event: Omit<HealthSdk.HealthHeartbeatEvent, "header">,
|
|
157
|
+
): AsyncResult<void, ValidationError | UnexpectedError>;
|
|
158
|
+
prepare(
|
|
159
|
+
event: Omit<HealthSdk.HealthHeartbeatEvent, "header">,
|
|
160
|
+
): Result<
|
|
161
|
+
PreparedTrellisEvent<Omit<HealthSdk.HealthHeartbeatEvent, "header">>,
|
|
162
|
+
ValidationError | UnexpectedError
|
|
163
|
+
>;
|
|
164
|
+
listen(
|
|
165
|
+
handler: EventCallback<HealthSdk.HealthHeartbeatEvent>,
|
|
166
|
+
subjectData?: Record<string, unknown>,
|
|
167
|
+
opts?: EventOpts,
|
|
168
|
+
): AsyncResult<void, ValidationError | UnexpectedError>;
|
|
169
|
+
};
|
|
56
170
|
};
|
|
57
171
|
};
|
|
58
172
|
readonly feed: {};
|
|
@@ -73,22 +187,79 @@ export type ServiceWithDeps<TDeps> = Omit<TrellisJobsClient, "event"> & {
|
|
|
73
187
|
|
|
74
188
|
export interface ServiceEventSurface<TDeps> {
|
|
75
189
|
readonly health: {
|
|
76
|
-
heartbeat: {
|
|
190
|
+
heartbeat: {
|
|
191
|
+
publish(
|
|
192
|
+
event: Omit<HealthSdk.HealthHeartbeatEvent, "header">,
|
|
193
|
+
): AsyncResult<void, ValidationError | UnexpectedError>;
|
|
194
|
+
prepare(
|
|
195
|
+
event: Omit<HealthSdk.HealthHeartbeatEvent, "header">,
|
|
196
|
+
): Result<
|
|
197
|
+
PreparedTrellisEvent<Omit<HealthSdk.HealthHeartbeatEvent, "header">>,
|
|
198
|
+
ValidationError | UnexpectedError
|
|
199
|
+
>;
|
|
200
|
+
listen(
|
|
201
|
+
handler: ServiceEventHandler<HealthSdk.HealthHeartbeatEvent, TDeps>,
|
|
202
|
+
subjectData?: Record<string, unknown>,
|
|
203
|
+
opts?: EventOpts,
|
|
204
|
+
): AsyncResult<void, ValidationError | UnexpectedError>;
|
|
205
|
+
};
|
|
77
206
|
};
|
|
78
207
|
}
|
|
79
208
|
|
|
80
209
|
export interface ServiceHandle<TDeps = undefined> {
|
|
81
210
|
readonly rpc: {
|
|
82
211
|
readonly jobs: {
|
|
83
|
-
cancel(
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
212
|
+
cancel(
|
|
213
|
+
handler: RpcHandler<
|
|
214
|
+
Types.JobsCancelInput,
|
|
215
|
+
Types.JobsCancelOutput,
|
|
216
|
+
TDeps
|
|
217
|
+
>,
|
|
218
|
+
): Promise<void>;
|
|
219
|
+
dismissDLQ(
|
|
220
|
+
handler: RpcHandler<
|
|
221
|
+
Types.JobsDismissDLQInput,
|
|
222
|
+
Types.JobsDismissDLQOutput,
|
|
223
|
+
TDeps
|
|
224
|
+
>,
|
|
225
|
+
): Promise<void>;
|
|
226
|
+
get(
|
|
227
|
+
handler: RpcHandler<Types.JobsGetInput, Types.JobsGetOutput, TDeps>,
|
|
228
|
+
): Promise<void>;
|
|
229
|
+
health(
|
|
230
|
+
handler: RpcHandler<
|
|
231
|
+
Types.JobsHealthInput,
|
|
232
|
+
Types.JobsHealthOutput,
|
|
233
|
+
TDeps
|
|
234
|
+
>,
|
|
235
|
+
): Promise<void>;
|
|
236
|
+
list(
|
|
237
|
+
handler: RpcHandler<Types.JobsListInput, Types.JobsListOutput, TDeps>,
|
|
238
|
+
): Promise<void>;
|
|
239
|
+
listDLQ(
|
|
240
|
+
handler: RpcHandler<
|
|
241
|
+
Types.JobsListDLQInput,
|
|
242
|
+
Types.JobsListDLQOutput,
|
|
243
|
+
TDeps
|
|
244
|
+
>,
|
|
245
|
+
): Promise<void>;
|
|
246
|
+
listServices(
|
|
247
|
+
handler: RpcHandler<
|
|
248
|
+
Types.JobsListServicesInput,
|
|
249
|
+
Types.JobsListServicesOutput,
|
|
250
|
+
TDeps
|
|
251
|
+
>,
|
|
252
|
+
): Promise<void>;
|
|
253
|
+
replayDLQ(
|
|
254
|
+
handler: RpcHandler<
|
|
255
|
+
Types.JobsReplayDLQInput,
|
|
256
|
+
Types.JobsReplayDLQOutput,
|
|
257
|
+
TDeps
|
|
258
|
+
>,
|
|
259
|
+
): Promise<void>;
|
|
260
|
+
retry(
|
|
261
|
+
handler: RpcHandler<Types.JobsRetryInput, Types.JobsRetryOutput, TDeps>,
|
|
262
|
+
): Promise<void>;
|
|
92
263
|
};
|
|
93
264
|
};
|
|
94
265
|
readonly feed: {};
|