@voltro/protocol 0.84.0 → 0.86.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/CHANGELOG.md +1215 -0
- package/README.md +14 -0
- package/THIRD-PARTY-NOTICES.md +5 -89
- package/dist/apikey.d.ts +32 -34
- package/dist/approval.js +64 -0
- package/dist/approvalDescriptors.js +26 -0
- package/dist/auth.js +369 -0
- package/dist/boundedRing.js +27 -0
- package/dist/businessRule.js +11 -0
- package/dist/connection.js +73 -0
- package/dist/devActivity.js +4 -0
- package/dist/errorValue.js +21 -0
- package/dist/event.js +104 -0
- package/dist/idempotency.js +66 -0
- package/dist/identity.js +5 -9
- package/dist/index.d.ts +1494 -1366
- package/dist/index.js +42 -1411
- package/dist/inspect.d.ts +88 -88
- package/dist/inspect.js +14 -190
- package/dist/inspectBackfill.js +52 -0
- package/dist/inspectCommandRejection.js +21 -0
- package/dist/inspectProjection.js +133 -0
- package/dist/inspectStorageProjection.js +86 -0
- package/dist/inspectValueIdentity.js +4 -0
- package/dist/inspectWorkflowExecution.js +34 -0
- package/dist/inspectWorkflowQueuedStart.js +31 -0
- package/dist/jsonSchema.js +54 -0
- package/dist/jwt.d.ts +32 -34
- package/dist/outbox.js +10 -0
- package/dist/pairing.js +75 -0
- package/dist/plugin.js +61 -0
- package/dist/pluginNaming.js +32 -0
- package/dist/procedure.js +262 -0
- package/dist/publicApi.js +344 -0
- package/dist/reactivityChannel.js +34 -0
- package/dist/rest.d.ts +105 -57
- package/dist/rest.js +259 -437
- package/dist/restFormat.js +163 -0
- package/dist/rowEquality.js +31 -0
- package/dist/rowPatch.js +182 -0
- package/dist/schemaShape.js +67 -0
- package/dist/scopes.js +240 -0
- package/dist/serverErrorBus.js +15 -0
- package/dist/serviceCall.js +14 -0
- package/dist/session.d.ts +90 -96
- package/dist/session.js +13 -15
- package/dist/{sessionHeader-DriTZhmv.js → sessionHeader.js} +1 -1
- package/dist/storageAccess.js +14 -0
- package/dist/storeErrors.js +66 -0
- package/dist/storeScreenshots.js +90 -0
- package/dist/strictInput.js +27 -0
- package/dist/subscriptionEvent.js +37 -0
- package/dist/tenantSelection.js +40 -0
- package/dist/time.js +7 -0
- package/dist/undo.js +38 -0
- package/dist/validation.js +39 -0
- package/dist/webSocketGateway.js +10 -0
- package/dist/workflow.js +297 -0
- package/dist/workflowAccess.js +61 -0
- package/dist/workflowRestart.js +45 -0
- package/dist/workflowRetry.js +44 -0
- package/dist/workflowStartOutcome.js +30 -0
- package/package.json +4 -8
- package/dist/restFormat-EZ8k9ZcQ.js +0 -304
- package/dist/scopes-Di756ENh.js +0 -518
package/dist/inspect.d.ts
CHANGED
|
@@ -1,74 +1,74 @@
|
|
|
1
1
|
import { ParseOptions } from 'effect/SchemaAST';
|
|
2
2
|
import { Schema } from 'effect';
|
|
3
3
|
|
|
4
|
-
export declare const decodeInspectBackfillInput: (
|
|
4
|
+
export declare const decodeInspectBackfillInput: (input: unknown, options?: ParseOptions) => {
|
|
5
|
+
readonly requestId: string;
|
|
5
6
|
readonly name: string;
|
|
6
7
|
readonly from: string;
|
|
7
|
-
readonly limit: number;
|
|
8
8
|
readonly to: string;
|
|
9
|
-
readonly requestId: string;
|
|
10
9
|
readonly confirm: boolean;
|
|
10
|
+
readonly limit: number;
|
|
11
11
|
};
|
|
12
12
|
|
|
13
13
|
export declare type InspectBackfillInput = typeof InspectBackfillInputSchema.Type;
|
|
14
14
|
|
|
15
15
|
export declare const InspectBackfillInputSchema: Schema.Struct<{
|
|
16
|
-
requestId: Schema.
|
|
17
|
-
name: Schema.
|
|
18
|
-
from: Schema.
|
|
19
|
-
to: Schema.
|
|
20
|
-
confirm:
|
|
21
|
-
limit: Schema.
|
|
16
|
+
readonly requestId: Schema.String;
|
|
17
|
+
readonly name: Schema.String;
|
|
18
|
+
readonly from: Schema.String;
|
|
19
|
+
readonly to: Schema.String;
|
|
20
|
+
readonly confirm: Schema.Boolean;
|
|
21
|
+
readonly limit: Schema.Number;
|
|
22
22
|
}>;
|
|
23
23
|
|
|
24
24
|
export declare type InspectBackfillReceipt = typeof InspectBackfillReceiptSchema.Type;
|
|
25
25
|
|
|
26
26
|
export declare const InspectBackfillReceiptSchema: Schema.Struct<{
|
|
27
|
-
id: Schema.
|
|
28
|
-
name: Schema.
|
|
29
|
-
from: Schema.
|
|
30
|
-
to: Schema.
|
|
31
|
-
occurrences: Schema
|
|
32
|
-
status: Schema.
|
|
33
|
-
owner: Schema.NullOr<
|
|
34
|
-
createdAt: Schema.
|
|
35
|
-
updatedAt: Schema.
|
|
36
|
-
cursor:
|
|
37
|
-
activeIndex: Schema.NullOr<
|
|
38
|
-
results: Schema
|
|
39
|
-
runId: Schema.
|
|
40
|
-
status: Schema.
|
|
27
|
+
readonly id: Schema.String;
|
|
28
|
+
readonly name: Schema.String;
|
|
29
|
+
readonly from: Schema.String;
|
|
30
|
+
readonly to: Schema.String;
|
|
31
|
+
readonly occurrences: Schema.$Array<Schema.Number>;
|
|
32
|
+
readonly status: Schema.Literals<readonly ["queued", "running", "completed", "interrupted"]>;
|
|
33
|
+
readonly owner: Schema.NullOr<Schema.String>;
|
|
34
|
+
readonly createdAt: Schema.String;
|
|
35
|
+
readonly updatedAt: Schema.String;
|
|
36
|
+
readonly cursor: Schema.Number;
|
|
37
|
+
readonly activeIndex: Schema.NullOr<Schema.Number>;
|
|
38
|
+
readonly results: Schema.$Array<Schema.Struct<{
|
|
39
|
+
readonly runId: Schema.String;
|
|
40
|
+
readonly status: Schema.Literals<readonly ["succeeded", "failed", "skipped", "missed"]>;
|
|
41
41
|
}>>;
|
|
42
|
-
error: Schema.NullOr<
|
|
42
|
+
readonly error: Schema.NullOr<Schema.String>;
|
|
43
43
|
}>;
|
|
44
44
|
|
|
45
45
|
export declare type InspectBackfillResult = typeof InspectBackfillResultSchema.Type;
|
|
46
46
|
|
|
47
|
-
export declare const InspectBackfillResultSchema: Schema.Union<[Schema.Struct<{
|
|
48
|
-
kind: Schema.Literal<
|
|
49
|
-
request: Schema.Struct<{
|
|
50
|
-
id: Schema.
|
|
51
|
-
name: Schema.
|
|
52
|
-
from: Schema.
|
|
53
|
-
to: Schema.
|
|
54
|
-
occurrences: Schema
|
|
55
|
-
status: Schema.
|
|
56
|
-
owner: Schema.NullOr<
|
|
57
|
-
createdAt: Schema.
|
|
58
|
-
updatedAt: Schema.
|
|
59
|
-
cursor:
|
|
60
|
-
activeIndex: Schema.NullOr<
|
|
61
|
-
results: Schema
|
|
62
|
-
runId: Schema.
|
|
63
|
-
status: Schema.
|
|
47
|
+
export declare const InspectBackfillResultSchema: Schema.Union<readonly [Schema.Struct<{
|
|
48
|
+
readonly kind: Schema.Literal<"accepted">;
|
|
49
|
+
readonly request: Schema.Struct<{
|
|
50
|
+
readonly id: Schema.String;
|
|
51
|
+
readonly name: Schema.String;
|
|
52
|
+
readonly from: Schema.String;
|
|
53
|
+
readonly to: Schema.String;
|
|
54
|
+
readonly occurrences: Schema.$Array<Schema.Number>;
|
|
55
|
+
readonly status: Schema.Literals<readonly ["queued", "running", "completed", "interrupted"]>;
|
|
56
|
+
readonly owner: Schema.NullOr<Schema.String>;
|
|
57
|
+
readonly createdAt: Schema.String;
|
|
58
|
+
readonly updatedAt: Schema.String;
|
|
59
|
+
readonly cursor: Schema.Number;
|
|
60
|
+
readonly activeIndex: Schema.NullOr<Schema.Number>;
|
|
61
|
+
readonly results: Schema.$Array<Schema.Struct<{
|
|
62
|
+
readonly runId: Schema.String;
|
|
63
|
+
readonly status: Schema.Literals<readonly ["succeeded", "failed", "skipped", "missed"]>;
|
|
64
64
|
}>>;
|
|
65
|
-
error: Schema.NullOr<
|
|
65
|
+
readonly error: Schema.NullOr<Schema.String>;
|
|
66
66
|
}>;
|
|
67
67
|
}>, Schema.Struct<{
|
|
68
|
-
kind: Schema.Literal<
|
|
69
|
-
name: Schema.
|
|
70
|
-
occurrences:
|
|
71
|
-
reason:
|
|
68
|
+
readonly kind: Schema.Literal<"refused">;
|
|
69
|
+
readonly name: Schema.String;
|
|
70
|
+
readonly occurrences: Schema.Number;
|
|
71
|
+
readonly reason: Schema.String;
|
|
72
72
|
}>]>;
|
|
73
73
|
|
|
74
74
|
export declare type InspectCommandRejection = typeof InspectCommandRejectionSchema.Type;
|
|
@@ -78,9 +78,9 @@ export declare const inspectCommandRejection: (status: number, message: string)
|
|
|
78
78
|
/** Explicit non-acceptance from an Inspect command endpoint. Transport errors,
|
|
79
79
|
* conflicts with an earlier request and server failures are not this outcome. */
|
|
80
80
|
export declare const InspectCommandRejectionSchema: Schema.Struct<{
|
|
81
|
-
kind: Schema.Literal<
|
|
82
|
-
status: Schema.
|
|
83
|
-
message:
|
|
81
|
+
readonly kind: Schema.Literal<"rejected">;
|
|
82
|
+
readonly status: Schema.Literals<readonly [400, 401, 403, 404]>;
|
|
83
|
+
readonly message: Schema.String;
|
|
84
84
|
}>;
|
|
85
85
|
|
|
86
86
|
export declare type InspectReplicaSelection = {
|
|
@@ -94,75 +94,75 @@ export declare type InspectWorkflowExecutionObservation = typeof InspectWorkflow
|
|
|
94
94
|
|
|
95
95
|
/** A projection of engine evidence, not a run-row or recorder-entry claim.
|
|
96
96
|
* Deliberately excludes payloads, outputs, raw causes and journal identifiers. */
|
|
97
|
-
export declare const InspectWorkflowExecutionObservationSchema: Schema.Union<[Schema.Struct<{
|
|
98
|
-
kind: Schema.Literal<
|
|
99
|
-
workflowName: Schema.
|
|
100
|
-
executionId: Schema.
|
|
97
|
+
export declare const InspectWorkflowExecutionObservationSchema: Schema.Union<readonly [Schema.Struct<{
|
|
98
|
+
readonly kind: Schema.Literal<"not-observed">;
|
|
99
|
+
readonly workflowName: Schema.NonEmptyString;
|
|
100
|
+
readonly executionId: Schema.NonEmptyString;
|
|
101
101
|
}>, Schema.Struct<{
|
|
102
|
-
kind: Schema.Literal<
|
|
103
|
-
workflowName: Schema.
|
|
104
|
-
executionId: Schema.
|
|
102
|
+
readonly kind: Schema.Literal<"pending">;
|
|
103
|
+
readonly workflowName: Schema.NonEmptyString;
|
|
104
|
+
readonly executionId: Schema.NonEmptyString;
|
|
105
105
|
}>, Schema.Struct<{
|
|
106
|
-
kind: Schema.Literal<
|
|
107
|
-
workflowName: Schema.
|
|
108
|
-
executionId: Schema.
|
|
106
|
+
readonly kind: Schema.Literal<"delivery-failed">;
|
|
107
|
+
readonly workflowName: Schema.NonEmptyString;
|
|
108
|
+
readonly executionId: Schema.NonEmptyString;
|
|
109
109
|
}>, Schema.Struct<{
|
|
110
|
-
kind: Schema.Literal<
|
|
111
|
-
workflowName: Schema.
|
|
112
|
-
executionId: Schema.
|
|
110
|
+
readonly kind: Schema.Literal<"suspended">;
|
|
111
|
+
readonly workflowName: Schema.NonEmptyString;
|
|
112
|
+
readonly executionId: Schema.NonEmptyString;
|
|
113
113
|
}>, Schema.Struct<{
|
|
114
|
-
kind: Schema.Literal<
|
|
115
|
-
outcome: Schema.
|
|
116
|
-
workflowName: Schema.
|
|
117
|
-
executionId: Schema.
|
|
114
|
+
readonly kind: Schema.Literal<"completed">;
|
|
115
|
+
readonly outcome: Schema.Literals<readonly ["succeeded", "failed", "cancelled"]>;
|
|
116
|
+
readonly workflowName: Schema.NonEmptyString;
|
|
117
|
+
readonly executionId: Schema.NonEmptyString;
|
|
118
118
|
}>]>;
|
|
119
119
|
|
|
120
120
|
export declare type InspectWorkflowExecutionTarget = typeof InspectWorkflowExecutionTargetSchema.Type;
|
|
121
121
|
|
|
122
122
|
/** Read an existing execution identity; this is never a start command. */
|
|
123
123
|
export declare const InspectWorkflowExecutionTargetSchema: Schema.Struct<{
|
|
124
|
-
workflowName: Schema.
|
|
125
|
-
executionId: Schema.
|
|
124
|
+
readonly workflowName: Schema.NonEmptyString;
|
|
125
|
+
readonly executionId: Schema.NonEmptyString;
|
|
126
126
|
}>;
|
|
127
127
|
|
|
128
128
|
export declare type InspectWorkflowQueuedStartObservation = typeof InspectWorkflowQueuedStartObservationSchema.Type;
|
|
129
129
|
|
|
130
130
|
/** Read-only admission evidence. Accepted means an execution exists, not that it succeeded. */
|
|
131
|
-
export declare const InspectWorkflowQueuedStartObservationSchema: Schema.Union<[Schema.Struct<{
|
|
132
|
-
kind: Schema.Literal<
|
|
133
|
-
workflowName: Schema.
|
|
134
|
-
receiptId: Schema.
|
|
135
|
-
tenantId: Schema.NullOr<Schema.
|
|
131
|
+
export declare const InspectWorkflowQueuedStartObservationSchema: Schema.Union<readonly [Schema.Struct<{
|
|
132
|
+
readonly kind: Schema.Literal<"pending">;
|
|
133
|
+
readonly workflowName: Schema.NonEmptyString;
|
|
134
|
+
readonly receiptId: Schema.NonEmptyString;
|
|
135
|
+
readonly tenantId: Schema.NullOr<Schema.NonEmptyString>;
|
|
136
136
|
}>, Schema.Struct<{
|
|
137
|
-
kind: Schema.Literal<
|
|
138
|
-
executionId: Schema.
|
|
139
|
-
workflowName: Schema.
|
|
140
|
-
receiptId: Schema.
|
|
141
|
-
tenantId: Schema.NullOr<Schema.
|
|
137
|
+
readonly kind: Schema.Literal<"accepted">;
|
|
138
|
+
readonly executionId: Schema.NonEmptyString;
|
|
139
|
+
readonly workflowName: Schema.NonEmptyString;
|
|
140
|
+
readonly receiptId: Schema.NonEmptyString;
|
|
141
|
+
readonly tenantId: Schema.NullOr<Schema.NonEmptyString>;
|
|
142
142
|
}>, Schema.Struct<{
|
|
143
|
-
kind: Schema.Literal<
|
|
144
|
-
reason: Schema.
|
|
145
|
-
workflowName: Schema.
|
|
146
|
-
receiptId: Schema.
|
|
147
|
-
tenantId: Schema.NullOr<Schema.
|
|
143
|
+
readonly kind: Schema.Literal<"not-executed">;
|
|
144
|
+
readonly reason: Schema.Literals<readonly ["dropped", "skipped", "superseded", "cancelled", "abandoned", "rejected"]>;
|
|
145
|
+
readonly workflowName: Schema.NonEmptyString;
|
|
146
|
+
readonly receiptId: Schema.NonEmptyString;
|
|
147
|
+
readonly tenantId: Schema.NullOr<Schema.NonEmptyString>;
|
|
148
148
|
}>]>;
|
|
149
149
|
|
|
150
150
|
export declare type InspectWorkflowQueuedStartTarget = typeof InspectWorkflowQueuedStartTargetSchema.Type;
|
|
151
151
|
|
|
152
152
|
/** A caller receipt, never an execution or a reusable admission slot. */
|
|
153
153
|
export declare const InspectWorkflowQueuedStartTargetSchema: Schema.Struct<{
|
|
154
|
-
workflowName: Schema.
|
|
155
|
-
receiptId: Schema.
|
|
156
|
-
tenantId: Schema.NullOr<Schema.
|
|
154
|
+
readonly workflowName: Schema.NonEmptyString;
|
|
155
|
+
readonly receiptId: Schema.NonEmptyString;
|
|
156
|
+
readonly tenantId: Schema.NullOr<Schema.NonEmptyString>;
|
|
157
157
|
}>;
|
|
158
158
|
|
|
159
159
|
export declare class InvalidReplicaSelection extends Error {
|
|
160
160
|
readonly name = "InvalidReplicaSelection";
|
|
161
161
|
}
|
|
162
162
|
|
|
163
|
-
export declare const isInspectCommandRejection: (
|
|
164
|
-
readonly status: 400 | 401 | 403 | 404;
|
|
163
|
+
export declare const isInspectCommandRejection: <I>(input: I) => input is I & {
|
|
165
164
|
readonly kind: "rejected";
|
|
165
|
+
readonly status: 400 | 401 | 403 | 404;
|
|
166
166
|
readonly message: string;
|
|
167
167
|
};
|
|
168
168
|
|
package/dist/inspect.js
CHANGED
|
@@ -1,206 +1,30 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
...r,
|
|
9
|
-
kind: e.Literal("pending")
|
|
10
|
-
}), e.Struct({
|
|
11
|
-
...r,
|
|
12
|
-
kind: e.Literal("accepted"),
|
|
13
|
-
executionId: t
|
|
14
|
-
}), e.Struct({
|
|
15
|
-
...r,
|
|
16
|
-
kind: e.Literal("not-executed"),
|
|
17
|
-
reason: e.Literal("dropped", "skipped", "superseded", "cancelled", "abandoned", "rejected")
|
|
18
|
-
})), a = e.Struct({
|
|
19
|
-
kind: e.Literal("rejected"),
|
|
20
|
-
status: e.Literal(400, 401, 403, 404),
|
|
21
|
-
message: e.String
|
|
22
|
-
}), o = e.is(a), s = (e, t) => {
|
|
23
|
-
let n = {
|
|
24
|
-
kind: "rejected",
|
|
25
|
-
status: e,
|
|
26
|
-
message: t
|
|
27
|
-
};
|
|
28
|
-
return o(n) ? n : void 0;
|
|
29
|
-
}, c = e.String.pipe(e.filter((e) => Number.isFinite(Date.parse(e)))), l = e.String.pipe(e.minLength(1), e.maxLength(256)), u = e.Struct({
|
|
30
|
-
id: l,
|
|
31
|
-
name: l,
|
|
32
|
-
from: c,
|
|
33
|
-
to: c,
|
|
34
|
-
occurrences: e.Array(e.Number),
|
|
35
|
-
status: e.Literal("queued", "running", "completed", "interrupted"),
|
|
36
|
-
owner: e.NullOr(e.String),
|
|
37
|
-
createdAt: c,
|
|
38
|
-
updatedAt: c,
|
|
39
|
-
cursor: e.Number,
|
|
40
|
-
activeIndex: e.NullOr(e.Number),
|
|
41
|
-
results: e.Array(e.Struct({
|
|
42
|
-
runId: l,
|
|
43
|
-
status: e.Literal("succeeded", "failed", "skipped", "missed")
|
|
44
|
-
})),
|
|
45
|
-
error: e.NullOr(e.String)
|
|
46
|
-
}), d = e.Struct({
|
|
47
|
-
requestId: l,
|
|
48
|
-
name: l,
|
|
49
|
-
from: c,
|
|
50
|
-
to: c,
|
|
51
|
-
confirm: e.Boolean,
|
|
52
|
-
limit: e.Number.pipe(e.int(), e.between(1, 1e4))
|
|
53
|
-
}), f = e.decodeUnknownSync(d), p = e.Union(e.Struct({
|
|
54
|
-
kind: e.Literal("accepted"),
|
|
55
|
-
request: u
|
|
56
|
-
}), e.Struct({
|
|
57
|
-
kind: e.Literal("refused"),
|
|
58
|
-
name: l,
|
|
59
|
-
occurrences: e.Number,
|
|
60
|
-
reason: e.String
|
|
61
|
-
})), m = class extends Error {
|
|
62
|
-
name = "ScheduleBackfillRequestConflict";
|
|
63
|
-
}, h = e.NonEmptyString.pipe(e.maxLength(1024), e.filter((e) => e.trim().length > 0 && !/[\u0000-\u001f\u007f]/.test(e))), g = e.Struct({
|
|
64
|
-
workflowName: h,
|
|
65
|
-
executionId: h
|
|
66
|
-
}), _ = g.fields, v = e.Union(e.Struct({
|
|
67
|
-
..._,
|
|
68
|
-
kind: e.Literal("not-observed")
|
|
69
|
-
}), e.Struct({
|
|
70
|
-
..._,
|
|
71
|
-
kind: e.Literal("pending")
|
|
72
|
-
}), e.Struct({
|
|
73
|
-
..._,
|
|
74
|
-
kind: e.Literal("delivery-failed")
|
|
75
|
-
}), e.Struct({
|
|
76
|
-
..._,
|
|
77
|
-
kind: e.Literal("suspended")
|
|
78
|
-
}), e.Struct({
|
|
79
|
-
..._,
|
|
80
|
-
kind: e.Literal("completed"),
|
|
81
|
-
outcome: e.Literal("succeeded", "failed", "cancelled")
|
|
82
|
-
})), y = (e) => typeof e == "object" && e && !Array.isArray(e) ? e : void 0, b = (e) => Array.isArray(e) && e.every((e) => y(e) !== void 0) ? e : void 0, x = (e) => typeof e == "number" && Number.isFinite(e) ? e : 0, S = /* @__PURE__ */ new Set([
|
|
83
|
-
"counter",
|
|
84
|
-
"gauge",
|
|
85
|
-
"histogram",
|
|
86
|
-
"summary",
|
|
87
|
-
"frequency"
|
|
88
|
-
]), C = (e) => {
|
|
89
|
-
let t = b(e);
|
|
90
|
-
return t?.every((e) => typeof e.name == "string" && S.has(String(e.type))) ? t : void 0;
|
|
91
|
-
}, w = (e) => {
|
|
92
|
-
let t = y(e), n = y(t?.data), r = b(n?.results);
|
|
93
|
-
if (!t || !n?.selection || !r) return e;
|
|
94
|
-
let i = r.filter((e) => e.status === "answered").map((e) => ({
|
|
95
|
-
replicaId: String(e.replicaId),
|
|
96
|
-
observation: y(e.observation),
|
|
97
|
-
data: y(e.observation)?.data
|
|
98
|
-
}));
|
|
99
|
-
if (i.length === 0) throw Error("None of the selected replicas answered. Check replica availability and retry.");
|
|
100
|
-
let a = i.map((e) => ({
|
|
101
|
-
...e,
|
|
102
|
-
object: y(e.data)
|
|
103
|
-
})), o = (e) => a.reduce((t, n) => t + x(n.object?.[e]), 0), s = Math.max(...i.map((e) => x(e.observation?.capturedAt))), c = {
|
|
104
|
-
capturedAt: s,
|
|
105
|
-
bufferSize: o("bufferSize"),
|
|
106
|
-
bufferCapacity: o("bufferCapacity")
|
|
107
|
-
}, l;
|
|
108
|
-
if (a.every((e) => b(e.object?.records))) {
|
|
109
|
-
let e = a.flatMap((e) => b(e.object?.records).map((t) => ({
|
|
110
|
-
...t,
|
|
111
|
-
fields: {
|
|
112
|
-
...y(t.fields),
|
|
113
|
-
"voltro.replica": e.replicaId
|
|
114
|
-
}
|
|
115
|
-
}))).sort((e, t) => x(e.ts) - x(t.ts));
|
|
116
|
-
l = {
|
|
117
|
-
...c,
|
|
118
|
-
returned: e.length,
|
|
119
|
-
records: e
|
|
120
|
-
};
|
|
121
|
-
} else if (a.every((e) => b(e.object?.traces))) {
|
|
122
|
-
let e = /* @__PURE__ */ new Map();
|
|
123
|
-
for (let t of a) for (let n of b(t.object?.traces)) {
|
|
124
|
-
let r = String(n.traceId), i = (b(n.spans) ?? []).map((e) => ({
|
|
125
|
-
...e,
|
|
126
|
-
attributes: {
|
|
127
|
-
...y(e.attributes),
|
|
128
|
-
"voltro.replica": t.replicaId
|
|
129
|
-
}
|
|
130
|
-
})), a = e.get(r) ?? [];
|
|
131
|
-
a.push({
|
|
132
|
-
...n,
|
|
133
|
-
spans: i
|
|
134
|
-
}), e.set(r, a);
|
|
135
|
-
}
|
|
136
|
-
let t = [...e.values()].map((e) => {
|
|
137
|
-
let t = e.flatMap((e) => b(e.spans) ?? []).sort((e, t) => x(e.startMs) - x(t.startMs)), n = [...e].sort((e, t) => x(e.startMs) - x(t.startMs))[0], r = Math.min(...e.map((e) => x(e.startMs))), i = Math.max(...e.map((e) => x(e.startMs) + x(e.durationMs)));
|
|
138
|
-
return {
|
|
139
|
-
...n,
|
|
140
|
-
startMs: r,
|
|
141
|
-
durationMs: Math.max(0, i - r),
|
|
142
|
-
spanCount: t.length,
|
|
143
|
-
hasError: e.some((e) => e.hasError === !0),
|
|
144
|
-
spans: t,
|
|
145
|
-
...e.some((e) => e.deliveryCount !== void 0) ? { deliveryCount: e.reduce((e, t) => e + x(t.deliveryCount), 0) } : {},
|
|
146
|
-
...e.some((e) => e.lastDeliveryMs !== void 0) ? { lastDeliveryMs: Math.max(...e.map((e) => x(e.lastDeliveryMs))) } : {}
|
|
147
|
-
};
|
|
148
|
-
}).sort((e, t) => t.startMs - e.startMs);
|
|
149
|
-
l = {
|
|
150
|
-
...c,
|
|
151
|
-
returned: t.length,
|
|
152
|
-
traces: t
|
|
153
|
-
};
|
|
154
|
-
} else if (a.every((e) => b(e.object?.buckets) && typeof e.object?.windowMs == "number")) l = {
|
|
155
|
-
capturedAt: s,
|
|
156
|
-
windowMs: Math.max(...a.map((e) => x(e.object?.windowMs))),
|
|
157
|
-
totalSamples: o("totalSamples"),
|
|
158
|
-
buckets: a.flatMap((e) => b(e.object?.buckets).map((t) => ({
|
|
159
|
-
...t,
|
|
160
|
-
tag: `${String(t.tag)} [${e.replicaId}]`
|
|
161
|
-
})))
|
|
162
|
-
};
|
|
163
|
-
else if (i.every((e) => C(e.data))) l = i.flatMap((e) => C(e.data).map((t) => ({
|
|
164
|
-
...t,
|
|
165
|
-
labels: {
|
|
166
|
-
...y(t.labels),
|
|
167
|
-
voltro_replica: e.replicaId
|
|
168
|
-
}
|
|
169
|
-
})));
|
|
170
|
-
else if (a.every((e) => C(e.object?.samples))) l = { samples: a.flatMap((e) => C(e.object?.samples).map((t) => ({
|
|
171
|
-
...t,
|
|
172
|
-
labels: {
|
|
173
|
-
...y(t.labels),
|
|
174
|
-
voltro_replica: e.replicaId
|
|
175
|
-
}
|
|
176
|
-
}))) };
|
|
177
|
-
else if (r.length === 1 && i.length === 1) l = i[0].data;
|
|
178
|
-
else throw Error("This view must compare observations per replica; its values cannot be safely combined.");
|
|
179
|
-
return {
|
|
180
|
-
...t,
|
|
181
|
-
data: l
|
|
182
|
-
};
|
|
183
|
-
}, T = class extends Error {
|
|
1
|
+
import { InspectWorkflowQueuedStartObservationSchema as e, InspectWorkflowQueuedStartTargetSchema as t } from "./inspectWorkflowQueuedStart.js";
|
|
2
|
+
import { InspectCommandRejectionSchema as n, inspectCommandRejection as r, isInspectCommandRejection as i } from "./inspectCommandRejection.js";
|
|
3
|
+
import { InspectBackfillInputSchema as a, InspectBackfillReceiptSchema as o, InspectBackfillResultSchema as s, ScheduleBackfillRequestConflict as c, decodeInspectBackfillInput as l } from "./inspectBackfill.js";
|
|
4
|
+
import { InspectWorkflowExecutionObservationSchema as u, InspectWorkflowExecutionTargetSchema as d } from "./inspectWorkflowExecution.js";
|
|
5
|
+
import { projectReplicaObservation as f } from "./inspectProjection.js";
|
|
6
|
+
//#region src/inspectSelection.ts
|
|
7
|
+
var p = class extends Error {
|
|
184
8
|
name = "InvalidReplicaSelection";
|
|
185
|
-
},
|
|
9
|
+
}, m = (e) => {
|
|
186
10
|
let t = e.getAll("replicas"), n = e.getAll("replica");
|
|
187
11
|
if (t.length !== 0 || n.length !== 0) {
|
|
188
|
-
if (t.length > 1 || t.length === 1 && t[0] !== "all" || t.length > 0 && n.length > 0) throw new
|
|
12
|
+
if (t.length > 1 || t.length === 1 && t[0] !== "all" || t.length > 0 && n.length > 0) throw new p("Choose all replicas or explicit replica IDs, not both.");
|
|
189
13
|
if (t[0] === "all") return { mode: "all" };
|
|
190
|
-
if (n.some((e) => e.trim().length === 0 || e.length > 512 || /[\u0000-\u001f\u007f]/.test(e))) throw new
|
|
14
|
+
if (n.some((e) => e.trim().length === 0 || e.length > 512 || /[\u0000-\u001f\u007f]/.test(e))) throw new p("Replica IDs must be nonempty and contain no control characters.");
|
|
191
15
|
return {
|
|
192
16
|
mode: "selected",
|
|
193
17
|
replicaIds: [...new Set(n)].sort()
|
|
194
18
|
};
|
|
195
19
|
}
|
|
196
|
-
},
|
|
20
|
+
}, h = (e, t) => {
|
|
197
21
|
let n = e.indexOf("#"), r = n < 0 ? "" : e.slice(n), i = n < 0 ? e : e.slice(0, n), a = i.indexOf("?"), o = a < 0 ? i : i.slice(0, a), s = new URLSearchParams(a < 0 ? "" : i.slice(a + 1));
|
|
198
22
|
if (s.delete("replica"), s.delete("replicas"), t.mode === "all") s.set("replicas", "all");
|
|
199
23
|
else {
|
|
200
|
-
if (t.replicaIds.length === 0) throw new
|
|
24
|
+
if (t.replicaIds.length === 0) throw new p("Select at least one replica.");
|
|
201
25
|
for (let e of [...new Set(t.replicaIds)].sort()) s.append("replica", e);
|
|
202
26
|
}
|
|
203
|
-
return
|
|
27
|
+
return m(s), `${o}?${s}${r}`;
|
|
204
28
|
};
|
|
205
29
|
//#endregion
|
|
206
|
-
export {
|
|
30
|
+
export { a as InspectBackfillInputSchema, o as InspectBackfillReceiptSchema, s as InspectBackfillResultSchema, n as InspectCommandRejectionSchema, u as InspectWorkflowExecutionObservationSchema, d as InspectWorkflowExecutionTargetSchema, e as InspectWorkflowQueuedStartObservationSchema, t as InspectWorkflowQueuedStartTargetSchema, p as InvalidReplicaSelection, c as ScheduleBackfillRequestConflict, l as decodeInspectBackfillInput, r as inspectCommandRejection, i as isInspectCommandRejection, m as parseReplicaSelection, f as projectReplicaObservation, h as withReplicaSelection };
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { Schema as e } from "effect";
|
|
2
|
+
//#region src/inspectBackfill.ts
|
|
3
|
+
var t = e.String.pipe(e.check(e.makeFilter((e) => Number.isFinite(Date.parse(e))))), n = e.String.pipe(e.check(e.isMinLength(1)), e.check(e.isMaxLength(256))), r = e.Struct({
|
|
4
|
+
id: n,
|
|
5
|
+
name: n,
|
|
6
|
+
from: t,
|
|
7
|
+
to: t,
|
|
8
|
+
occurrences: e.Array(e.Number),
|
|
9
|
+
status: e.Literals([
|
|
10
|
+
"queued",
|
|
11
|
+
"running",
|
|
12
|
+
"completed",
|
|
13
|
+
"interrupted"
|
|
14
|
+
]),
|
|
15
|
+
owner: e.NullOr(e.String),
|
|
16
|
+
createdAt: t,
|
|
17
|
+
updatedAt: t,
|
|
18
|
+
cursor: e.Number,
|
|
19
|
+
activeIndex: e.NullOr(e.Number),
|
|
20
|
+
results: e.Array(e.Struct({
|
|
21
|
+
runId: n,
|
|
22
|
+
status: e.Literals([
|
|
23
|
+
"succeeded",
|
|
24
|
+
"failed",
|
|
25
|
+
"skipped",
|
|
26
|
+
"missed"
|
|
27
|
+
])
|
|
28
|
+
})),
|
|
29
|
+
error: e.NullOr(e.String)
|
|
30
|
+
}), i = e.Struct({
|
|
31
|
+
requestId: n,
|
|
32
|
+
name: n,
|
|
33
|
+
from: t,
|
|
34
|
+
to: t,
|
|
35
|
+
confirm: e.Boolean,
|
|
36
|
+
limit: e.Number.pipe(e.check(e.isInt()), e.check(e.isBetween({
|
|
37
|
+
minimum: 1,
|
|
38
|
+
maximum: 1e4
|
|
39
|
+
})))
|
|
40
|
+
}), a = e.decodeUnknownSync(i), o = e.Union([e.Struct({
|
|
41
|
+
kind: e.Literal("accepted"),
|
|
42
|
+
request: r
|
|
43
|
+
}), e.Struct({
|
|
44
|
+
kind: e.Literal("refused"),
|
|
45
|
+
name: n,
|
|
46
|
+
occurrences: e.Number,
|
|
47
|
+
reason: e.String
|
|
48
|
+
})]), s = class extends Error {
|
|
49
|
+
name = "ScheduleBackfillRequestConflict";
|
|
50
|
+
};
|
|
51
|
+
//#endregion
|
|
52
|
+
export { i as InspectBackfillInputSchema, r as InspectBackfillReceiptSchema, o as InspectBackfillResultSchema, s as ScheduleBackfillRequestConflict, a as decodeInspectBackfillInput };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Schema as e } from "effect";
|
|
2
|
+
//#region src/inspectCommandRejection.ts
|
|
3
|
+
var t = e.Struct({
|
|
4
|
+
kind: e.Literal("rejected"),
|
|
5
|
+
status: e.Literals([
|
|
6
|
+
400,
|
|
7
|
+
401,
|
|
8
|
+
403,
|
|
9
|
+
404
|
|
10
|
+
]),
|
|
11
|
+
message: e.String
|
|
12
|
+
}), n = e.is(t), r = (e, t) => {
|
|
13
|
+
let r = {
|
|
14
|
+
kind: "rejected",
|
|
15
|
+
status: e,
|
|
16
|
+
message: t
|
|
17
|
+
};
|
|
18
|
+
return n(r) ? r : void 0;
|
|
19
|
+
};
|
|
20
|
+
//#endregion
|
|
21
|
+
export { t as InspectCommandRejectionSchema, r as inspectCommandRejection, n as isInspectCommandRejection };
|