@flowrensic/node 0.0.0-stage → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +25 -2
- package/dist/client.d.ts +9 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +12 -0
- package/dist/client.js.map +1 -0
- package/dist/gen/flowrensic/v1/activity_metrics_pb.d.ts +442 -0
- package/dist/gen/flowrensic/v1/activity_metrics_pb.d.ts.map +1 -0
- package/dist/gen/flowrensic/v1/activity_metrics_pb.js +104 -0
- package/dist/gen/flowrensic/v1/activity_metrics_pb.js.map +1 -0
- package/dist/gen/flowrensic/v1/catalog_pb.d.ts +254 -0
- package/dist/gen/flowrensic/v1/catalog_pb.d.ts.map +1 -0
- package/dist/gen/flowrensic/v1/catalog_pb.js +88 -0
- package/dist/gen/flowrensic/v1/catalog_pb.js.map +1 -0
- package/dist/gen/flowrensic/v1/finding_pb.d.ts +180 -0
- package/dist/gen/flowrensic/v1/finding_pb.d.ts.map +1 -0
- package/dist/gen/flowrensic/v1/finding_pb.js +109 -0
- package/dist/gen/flowrensic/v1/finding_pb.js.map +1 -0
- package/dist/gen/flowrensic/v1/replay_pb.d.ts +273 -0
- package/dist/gen/flowrensic/v1/replay_pb.d.ts.map +1 -0
- package/dist/gen/flowrensic/v1/replay_pb.js +100 -0
- package/dist/gen/flowrensic/v1/replay_pb.js.map +1 -0
- package/dist/gen/flowrensic/v1/services_pb.d.ts +145 -0
- package/dist/gen/flowrensic/v1/services_pb.d.ts.map +1 -0
- package/dist/gen/flowrensic/v1/services_pb.js +31 -0
- package/dist/gen/flowrensic/v1/services_pb.js.map +1 -0
- package/dist/gen/flowrensic/v1/workflow_history_pb.d.ts +204 -0
- package/dist/gen/flowrensic/v1/workflow_history_pb.d.ts.map +1 -0
- package/dist/gen/flowrensic/v1/workflow_history_pb.js +132 -0
- package/dist/gen/flowrensic/v1/workflow_history_pb.js.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -0
- package/dist/interceptor.d.ts +25 -0
- package/dist/interceptor.d.ts.map +1 -0
- package/dist/interceptor.js +77 -0
- package/dist/interceptor.js.map +1 -0
- package/dist/replay.d.ts +63 -0
- package/dist/replay.d.ts.map +1 -0
- package/dist/replay.js +93 -0
- package/dist/replay.js.map +1 -0
- package/dist/sink.d.ts +18 -0
- package/dist/sink.d.ts.map +1 -0
- package/dist/sink.js +44 -0
- package/dist/sink.js.map +1 -0
- package/package.json +42 -4
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
import type { GenEnum, GenFile, GenMessage } from "@bufbuild/protobuf/codegenv2";
|
|
2
|
+
import type { Timestamp } from "@bufbuild/protobuf/wkt";
|
|
3
|
+
import type { Engine } from "./catalog_pb.js";
|
|
4
|
+
import type { JsonObject, Message } from "@bufbuild/protobuf";
|
|
5
|
+
/**
|
|
6
|
+
* Describes the file flowrensic/v1/workflow_history.proto.
|
|
7
|
+
*/
|
|
8
|
+
export declare const file_flowrensic_v1_workflow_history: GenFile;
|
|
9
|
+
/**
|
|
10
|
+
* @generated from message flowrensic.v1.Event
|
|
11
|
+
*/
|
|
12
|
+
export type Event = Message<"flowrensic.v1.Event"> & {
|
|
13
|
+
/**
|
|
14
|
+
* @generated from field: int64 seq = 1;
|
|
15
|
+
*/
|
|
16
|
+
seq: bigint;
|
|
17
|
+
/**
|
|
18
|
+
* @generated from field: flowrensic.v1.EventKind kind = 2;
|
|
19
|
+
*/
|
|
20
|
+
kind: EventKind;
|
|
21
|
+
/**
|
|
22
|
+
* @generated from field: google.protobuf.Timestamp time = 3;
|
|
23
|
+
*/
|
|
24
|
+
time?: Timestamp | undefined;
|
|
25
|
+
/**
|
|
26
|
+
* The engine's own event type name, kept verbatim so a finding traces back to
|
|
27
|
+
* the source vocabulary.
|
|
28
|
+
*
|
|
29
|
+
* @generated from field: string engine_type = 4;
|
|
30
|
+
*/
|
|
31
|
+
engineType: string;
|
|
32
|
+
/**
|
|
33
|
+
* @generated from field: google.protobuf.Struct attrs = 5;
|
|
34
|
+
*/
|
|
35
|
+
attrs?: JsonObject | undefined;
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* Describes the message flowrensic.v1.Event.
|
|
39
|
+
* Use `create(EventSchema)` to create a new message.
|
|
40
|
+
*/
|
|
41
|
+
export declare const EventSchema: GenMessage<Event>;
|
|
42
|
+
/**
|
|
43
|
+
* @generated from message flowrensic.v1.History
|
|
44
|
+
*/
|
|
45
|
+
export type History = Message<"flowrensic.v1.History"> & {
|
|
46
|
+
/**
|
|
47
|
+
* @generated from field: string run_id = 1;
|
|
48
|
+
*/
|
|
49
|
+
runId: string;
|
|
50
|
+
/**
|
|
51
|
+
* @generated from field: flowrensic.v1.Engine engine = 2;
|
|
52
|
+
*/
|
|
53
|
+
engine: Engine;
|
|
54
|
+
/**
|
|
55
|
+
* @generated from field: bool truncated = 3;
|
|
56
|
+
*/
|
|
57
|
+
truncated: boolean;
|
|
58
|
+
/**
|
|
59
|
+
* @generated from field: repeated flowrensic.v1.Event events = 4;
|
|
60
|
+
*/
|
|
61
|
+
events: Event[];
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* Describes the message flowrensic.v1.History.
|
|
65
|
+
* Use `create(HistorySchema)` to create a new message.
|
|
66
|
+
*/
|
|
67
|
+
export declare const HistorySchema: GenMessage<History>;
|
|
68
|
+
/**
|
|
69
|
+
* @generated from message flowrensic.v1.IngestHistoryRequest
|
|
70
|
+
*/
|
|
71
|
+
export type IngestHistoryRequest = Message<"flowrensic.v1.IngestHistoryRequest"> & {
|
|
72
|
+
/**
|
|
73
|
+
* @generated from field: flowrensic.v1.History history = 1;
|
|
74
|
+
*/
|
|
75
|
+
history?: History | undefined;
|
|
76
|
+
};
|
|
77
|
+
/**
|
|
78
|
+
* Describes the message flowrensic.v1.IngestHistoryRequest.
|
|
79
|
+
* Use `create(IngestHistoryRequestSchema)` to create a new message.
|
|
80
|
+
*/
|
|
81
|
+
export declare const IngestHistoryRequestSchema: GenMessage<IngestHistoryRequest>;
|
|
82
|
+
/**
|
|
83
|
+
* @generated from message flowrensic.v1.IngestHistoryResponse
|
|
84
|
+
*/
|
|
85
|
+
export type IngestHistoryResponse = Message<"flowrensic.v1.IngestHistoryResponse"> & {
|
|
86
|
+
/**
|
|
87
|
+
* @generated from field: string run_id = 1;
|
|
88
|
+
*/
|
|
89
|
+
runId: string;
|
|
90
|
+
/**
|
|
91
|
+
* @generated from field: int32 events = 2;
|
|
92
|
+
*/
|
|
93
|
+
events: number;
|
|
94
|
+
/**
|
|
95
|
+
* @generated from field: int32 findings = 3;
|
|
96
|
+
*/
|
|
97
|
+
findings: number;
|
|
98
|
+
};
|
|
99
|
+
/**
|
|
100
|
+
* Describes the message flowrensic.v1.IngestHistoryResponse.
|
|
101
|
+
* Use `create(IngestHistoryResponseSchema)` to create a new message.
|
|
102
|
+
*/
|
|
103
|
+
export declare const IngestHistoryResponseSchema: GenMessage<IngestHistoryResponse>;
|
|
104
|
+
/**
|
|
105
|
+
* EventKind is the engine-neutral vocabulary every engine's own event types map
|
|
106
|
+
* into. Unmapped engine types are an error, never a silent skip.
|
|
107
|
+
*
|
|
108
|
+
* @generated from enum flowrensic.v1.EventKind
|
|
109
|
+
*/
|
|
110
|
+
export declare enum EventKind {
|
|
111
|
+
/**
|
|
112
|
+
* @generated from enum value: EVENT_KIND_UNSPECIFIED = 0;
|
|
113
|
+
*/
|
|
114
|
+
UNSPECIFIED = 0,
|
|
115
|
+
/**
|
|
116
|
+
* @generated from enum value: EVENT_KIND_WORKFLOW_STARTED = 1;
|
|
117
|
+
*/
|
|
118
|
+
WORKFLOW_STARTED = 1,
|
|
119
|
+
/**
|
|
120
|
+
* @generated from enum value: EVENT_KIND_WORKFLOW_TASK_SCHEDULED = 2;
|
|
121
|
+
*/
|
|
122
|
+
WORKFLOW_TASK_SCHEDULED = 2,
|
|
123
|
+
/**
|
|
124
|
+
* @generated from enum value: EVENT_KIND_WORKFLOW_TASK_STARTED = 3;
|
|
125
|
+
*/
|
|
126
|
+
WORKFLOW_TASK_STARTED = 3,
|
|
127
|
+
/**
|
|
128
|
+
* @generated from enum value: EVENT_KIND_WORKFLOW_TASK_COMPLETED = 4;
|
|
129
|
+
*/
|
|
130
|
+
WORKFLOW_TASK_COMPLETED = 4,
|
|
131
|
+
/**
|
|
132
|
+
* @generated from enum value: EVENT_KIND_WORKFLOW_TASK_FAILED = 5;
|
|
133
|
+
*/
|
|
134
|
+
WORKFLOW_TASK_FAILED = 5,
|
|
135
|
+
/**
|
|
136
|
+
* @generated from enum value: EVENT_KIND_WORKFLOW_TASK_TIMED_OUT = 6;
|
|
137
|
+
*/
|
|
138
|
+
WORKFLOW_TASK_TIMED_OUT = 6,
|
|
139
|
+
/**
|
|
140
|
+
* @generated from enum value: EVENT_KIND_ACTIVITY_SCHEDULED = 7;
|
|
141
|
+
*/
|
|
142
|
+
ACTIVITY_SCHEDULED = 7,
|
|
143
|
+
/**
|
|
144
|
+
* @generated from enum value: EVENT_KIND_ACTIVITY_STARTED = 8;
|
|
145
|
+
*/
|
|
146
|
+
ACTIVITY_STARTED = 8,
|
|
147
|
+
/**
|
|
148
|
+
* @generated from enum value: EVENT_KIND_ACTIVITY_COMPLETED = 9;
|
|
149
|
+
*/
|
|
150
|
+
ACTIVITY_COMPLETED = 9,
|
|
151
|
+
/**
|
|
152
|
+
* @generated from enum value: EVENT_KIND_ACTIVITY_FAILED = 10;
|
|
153
|
+
*/
|
|
154
|
+
ACTIVITY_FAILED = 10,
|
|
155
|
+
/**
|
|
156
|
+
* @generated from enum value: EVENT_KIND_ACTIVITY_TIMED_OUT = 11;
|
|
157
|
+
*/
|
|
158
|
+
ACTIVITY_TIMED_OUT = 11,
|
|
159
|
+
/**
|
|
160
|
+
* @generated from enum value: EVENT_KIND_ACTIVITY_CANCELED = 12;
|
|
161
|
+
*/
|
|
162
|
+
ACTIVITY_CANCELED = 12,
|
|
163
|
+
/**
|
|
164
|
+
* @generated from enum value: EVENT_KIND_TIMER_STARTED = 13;
|
|
165
|
+
*/
|
|
166
|
+
TIMER_STARTED = 13,
|
|
167
|
+
/**
|
|
168
|
+
* @generated from enum value: EVENT_KIND_TIMER_FIRED = 14;
|
|
169
|
+
*/
|
|
170
|
+
TIMER_FIRED = 14,
|
|
171
|
+
/**
|
|
172
|
+
* @generated from enum value: EVENT_KIND_TIMER_CANCELED = 15;
|
|
173
|
+
*/
|
|
174
|
+
TIMER_CANCELED = 15,
|
|
175
|
+
/**
|
|
176
|
+
* @generated from enum value: EVENT_KIND_SIGNAL_RECEIVED = 16;
|
|
177
|
+
*/
|
|
178
|
+
SIGNAL_RECEIVED = 16,
|
|
179
|
+
/**
|
|
180
|
+
* @generated from enum value: EVENT_KIND_UPDATE_ACCEPTED = 17;
|
|
181
|
+
*/
|
|
182
|
+
UPDATE_ACCEPTED = 17,
|
|
183
|
+
/**
|
|
184
|
+
* @generated from enum value: EVENT_KIND_UPDATE_COMPLETED = 18;
|
|
185
|
+
*/
|
|
186
|
+
UPDATE_COMPLETED = 18,
|
|
187
|
+
/**
|
|
188
|
+
* @generated from enum value: EVENT_KIND_CHILD_WORKFLOW_STARTED = 19;
|
|
189
|
+
*/
|
|
190
|
+
CHILD_WORKFLOW_STARTED = 19,
|
|
191
|
+
/**
|
|
192
|
+
* @generated from enum value: EVENT_KIND_MARKER_RECORDED = 20;
|
|
193
|
+
*/
|
|
194
|
+
MARKER_RECORDED = 20,
|
|
195
|
+
/**
|
|
196
|
+
* @generated from enum value: EVENT_KIND_WORKFLOW_CLOSED = 21;
|
|
197
|
+
*/
|
|
198
|
+
WORKFLOW_CLOSED = 21
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* Describes the enum flowrensic.v1.EventKind.
|
|
202
|
+
*/
|
|
203
|
+
export declare const EventKindSchema: GenEnum<EventKind>;
|
|
204
|
+
//# sourceMappingURL=workflow_history_pb.d.ts.map
|
|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H,eAAe,KAAK;CACrB;AAED;;GAEG;AACH,eAAO,MAAM,eAAe,EAAE,OAAO,CAAC,SAAS,CACG,CAAC"}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
// @generated by protoc-gen-es v2.16.0 with parameter "target=ts,import_extension=js"
|
|
2
|
+
// @generated from file flowrensic/v1/workflow_history.proto (package flowrensic.v1, syntax proto3)
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
import { enumDesc, fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv2";
|
|
5
|
+
import { file_google_protobuf_struct, file_google_protobuf_timestamp } from "@bufbuild/protobuf/wkt";
|
|
6
|
+
import { file_flowrensic_v1_catalog } from "./catalog_pb.js";
|
|
7
|
+
/**
|
|
8
|
+
* Describes the file flowrensic/v1/workflow_history.proto.
|
|
9
|
+
*/
|
|
10
|
+
export const file_flowrensic_v1_workflow_history = /*@__PURE__*/ fileDesc("CiRmbG93cmVuc2ljL3YxL3dvcmtmbG93X2hpc3RvcnkucHJvdG8SDWZsb3dyZW5zaWMudjEiowEKBUV2ZW50EgsKA3NlcRgBIAEoAxImCgRraW5kGAIgASgOMhguZmxvd3JlbnNpYy52MS5FdmVudEtpbmQSKAoEdGltZRgDIAEoCzIaLmdvb2dsZS5wcm90b2J1Zi5UaW1lc3RhbXASEwoLZW5naW5lX3R5cGUYBCABKAkSJgoFYXR0cnMYBSABKAsyFy5nb29nbGUucHJvdG9idWYuU3RydWN0InkKB0hpc3RvcnkSDgoGcnVuX2lkGAEgASgJEiUKBmVuZ2luZRgCIAEoDjIVLmZsb3dyZW5zaWMudjEuRW5naW5lEhEKCXRydW5jYXRlZBgDIAEoCBIkCgZldmVudHMYBCADKAsyFC5mbG93cmVuc2ljLnYxLkV2ZW50Ij8KFEluZ2VzdEhpc3RvcnlSZXF1ZXN0EicKB2hpc3RvcnkYASABKAsyFi5mbG93cmVuc2ljLnYxLkhpc3RvcnkiSQoVSW5nZXN0SGlzdG9yeVJlc3BvbnNlEg4KB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NFRBAVQsgBChFjb20uZmxvd3JlbnNpYy52MUIUV29ya2Zsb3dIaXN0b3J5UHJvdG9QAVpIZ2l0aHViLmNvbS9mbG93cmVuc2ljL2Zsb3dyZW5zaWMvaW50ZXJuYWwvZ2VuL2Zsb3dyZW5zaWMvdjE7Zmxvd3JlbnNpY3YxogIDRlhYqgINRmxvd3JlbnNpYy5WMcoCDUZsb3dyZW5zaWNcVjHiAhlGbG93cmVuc2ljXFYxXEdQQk1ldGFkYXRh6gIORmxvd3JlbnNpYzo6VjFiBnByb3RvMw", [file_google_protobuf_struct, file_google_protobuf_timestamp, file_flowrensic_v1_catalog]);
|
|
11
|
+
/**
|
|
12
|
+
* Describes the message flowrensic.v1.Event.
|
|
13
|
+
* Use `create(EventSchema)` to create a new message.
|
|
14
|
+
*/
|
|
15
|
+
export const EventSchema = /*@__PURE__*/ messageDesc(file_flowrensic_v1_workflow_history, 0);
|
|
16
|
+
/**
|
|
17
|
+
* Describes the message flowrensic.v1.History.
|
|
18
|
+
* Use `create(HistorySchema)` to create a new message.
|
|
19
|
+
*/
|
|
20
|
+
export const HistorySchema = /*@__PURE__*/ messageDesc(file_flowrensic_v1_workflow_history, 1);
|
|
21
|
+
/**
|
|
22
|
+
* Describes the message flowrensic.v1.IngestHistoryRequest.
|
|
23
|
+
* Use `create(IngestHistoryRequestSchema)` to create a new message.
|
|
24
|
+
*/
|
|
25
|
+
export const IngestHistoryRequestSchema = /*@__PURE__*/ messageDesc(file_flowrensic_v1_workflow_history, 2);
|
|
26
|
+
/**
|
|
27
|
+
* Describes the message flowrensic.v1.IngestHistoryResponse.
|
|
28
|
+
* Use `create(IngestHistoryResponseSchema)` to create a new message.
|
|
29
|
+
*/
|
|
30
|
+
export const IngestHistoryResponseSchema = /*@__PURE__*/ messageDesc(file_flowrensic_v1_workflow_history, 3);
|
|
31
|
+
/**
|
|
32
|
+
* EventKind is the engine-neutral vocabulary every engine's own event types map
|
|
33
|
+
* into. Unmapped engine types are an error, never a silent skip.
|
|
34
|
+
*
|
|
35
|
+
* @generated from enum flowrensic.v1.EventKind
|
|
36
|
+
*/
|
|
37
|
+
export var EventKind;
|
|
38
|
+
(function (EventKind) {
|
|
39
|
+
/**
|
|
40
|
+
* @generated from enum value: EVENT_KIND_UNSPECIFIED = 0;
|
|
41
|
+
*/
|
|
42
|
+
EventKind[EventKind["UNSPECIFIED"] = 0] = "UNSPECIFIED";
|
|
43
|
+
/**
|
|
44
|
+
* @generated from enum value: EVENT_KIND_WORKFLOW_STARTED = 1;
|
|
45
|
+
*/
|
|
46
|
+
EventKind[EventKind["WORKFLOW_STARTED"] = 1] = "WORKFLOW_STARTED";
|
|
47
|
+
/**
|
|
48
|
+
* @generated from enum value: EVENT_KIND_WORKFLOW_TASK_SCHEDULED = 2;
|
|
49
|
+
*/
|
|
50
|
+
EventKind[EventKind["WORKFLOW_TASK_SCHEDULED"] = 2] = "WORKFLOW_TASK_SCHEDULED";
|
|
51
|
+
/**
|
|
52
|
+
* @generated from enum value: EVENT_KIND_WORKFLOW_TASK_STARTED = 3;
|
|
53
|
+
*/
|
|
54
|
+
EventKind[EventKind["WORKFLOW_TASK_STARTED"] = 3] = "WORKFLOW_TASK_STARTED";
|
|
55
|
+
/**
|
|
56
|
+
* @generated from enum value: EVENT_KIND_WORKFLOW_TASK_COMPLETED = 4;
|
|
57
|
+
*/
|
|
58
|
+
EventKind[EventKind["WORKFLOW_TASK_COMPLETED"] = 4] = "WORKFLOW_TASK_COMPLETED";
|
|
59
|
+
/**
|
|
60
|
+
* @generated from enum value: EVENT_KIND_WORKFLOW_TASK_FAILED = 5;
|
|
61
|
+
*/
|
|
62
|
+
EventKind[EventKind["WORKFLOW_TASK_FAILED"] = 5] = "WORKFLOW_TASK_FAILED";
|
|
63
|
+
/**
|
|
64
|
+
* @generated from enum value: EVENT_KIND_WORKFLOW_TASK_TIMED_OUT = 6;
|
|
65
|
+
*/
|
|
66
|
+
EventKind[EventKind["WORKFLOW_TASK_TIMED_OUT"] = 6] = "WORKFLOW_TASK_TIMED_OUT";
|
|
67
|
+
/**
|
|
68
|
+
* @generated from enum value: EVENT_KIND_ACTIVITY_SCHEDULED = 7;
|
|
69
|
+
*/
|
|
70
|
+
EventKind[EventKind["ACTIVITY_SCHEDULED"] = 7] = "ACTIVITY_SCHEDULED";
|
|
71
|
+
/**
|
|
72
|
+
* @generated from enum value: EVENT_KIND_ACTIVITY_STARTED = 8;
|
|
73
|
+
*/
|
|
74
|
+
EventKind[EventKind["ACTIVITY_STARTED"] = 8] = "ACTIVITY_STARTED";
|
|
75
|
+
/**
|
|
76
|
+
* @generated from enum value: EVENT_KIND_ACTIVITY_COMPLETED = 9;
|
|
77
|
+
*/
|
|
78
|
+
EventKind[EventKind["ACTIVITY_COMPLETED"] = 9] = "ACTIVITY_COMPLETED";
|
|
79
|
+
/**
|
|
80
|
+
* @generated from enum value: EVENT_KIND_ACTIVITY_FAILED = 10;
|
|
81
|
+
*/
|
|
82
|
+
EventKind[EventKind["ACTIVITY_FAILED"] = 10] = "ACTIVITY_FAILED";
|
|
83
|
+
/**
|
|
84
|
+
* @generated from enum value: EVENT_KIND_ACTIVITY_TIMED_OUT = 11;
|
|
85
|
+
*/
|
|
86
|
+
EventKind[EventKind["ACTIVITY_TIMED_OUT"] = 11] = "ACTIVITY_TIMED_OUT";
|
|
87
|
+
/**
|
|
88
|
+
* @generated from enum value: EVENT_KIND_ACTIVITY_CANCELED = 12;
|
|
89
|
+
*/
|
|
90
|
+
EventKind[EventKind["ACTIVITY_CANCELED"] = 12] = "ACTIVITY_CANCELED";
|
|
91
|
+
/**
|
|
92
|
+
* @generated from enum value: EVENT_KIND_TIMER_STARTED = 13;
|
|
93
|
+
*/
|
|
94
|
+
EventKind[EventKind["TIMER_STARTED"] = 13] = "TIMER_STARTED";
|
|
95
|
+
/**
|
|
96
|
+
* @generated from enum value: EVENT_KIND_TIMER_FIRED = 14;
|
|
97
|
+
*/
|
|
98
|
+
EventKind[EventKind["TIMER_FIRED"] = 14] = "TIMER_FIRED";
|
|
99
|
+
/**
|
|
100
|
+
* @generated from enum value: EVENT_KIND_TIMER_CANCELED = 15;
|
|
101
|
+
*/
|
|
102
|
+
EventKind[EventKind["TIMER_CANCELED"] = 15] = "TIMER_CANCELED";
|
|
103
|
+
/**
|
|
104
|
+
* @generated from enum value: EVENT_KIND_SIGNAL_RECEIVED = 16;
|
|
105
|
+
*/
|
|
106
|
+
EventKind[EventKind["SIGNAL_RECEIVED"] = 16] = "SIGNAL_RECEIVED";
|
|
107
|
+
/**
|
|
108
|
+
* @generated from enum value: EVENT_KIND_UPDATE_ACCEPTED = 17;
|
|
109
|
+
*/
|
|
110
|
+
EventKind[EventKind["UPDATE_ACCEPTED"] = 17] = "UPDATE_ACCEPTED";
|
|
111
|
+
/**
|
|
112
|
+
* @generated from enum value: EVENT_KIND_UPDATE_COMPLETED = 18;
|
|
113
|
+
*/
|
|
114
|
+
EventKind[EventKind["UPDATE_COMPLETED"] = 18] = "UPDATE_COMPLETED";
|
|
115
|
+
/**
|
|
116
|
+
* @generated from enum value: EVENT_KIND_CHILD_WORKFLOW_STARTED = 19;
|
|
117
|
+
*/
|
|
118
|
+
EventKind[EventKind["CHILD_WORKFLOW_STARTED"] = 19] = "CHILD_WORKFLOW_STARTED";
|
|
119
|
+
/**
|
|
120
|
+
* @generated from enum value: EVENT_KIND_MARKER_RECORDED = 20;
|
|
121
|
+
*/
|
|
122
|
+
EventKind[EventKind["MARKER_RECORDED"] = 20] = "MARKER_RECORDED";
|
|
123
|
+
/**
|
|
124
|
+
* @generated from enum value: EVENT_KIND_WORKFLOW_CLOSED = 21;
|
|
125
|
+
*/
|
|
126
|
+
EventKind[EventKind["WORKFLOW_CLOSED"] = 21] = "WORKFLOW_CLOSED";
|
|
127
|
+
})(EventKind || (EventKind = {}));
|
|
128
|
+
/**
|
|
129
|
+
* Describes the enum flowrensic.v1.EventKind.
|
|
130
|
+
*/
|
|
131
|
+
export const EventKindSchema = /*@__PURE__*/ enumDesc(file_flowrensic_v1_workflow_history, 0);
|
|
132
|
+
//# sourceMappingURL=workflow_history_pb.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow_history_pb.js","sourceRoot":"","sources":["../../../../src/gen/flowrensic/v1/workflow_history_pb.ts"],"names":[],"mappings":"AAAA,qFAAqF;AACrF,mGAAmG;AACnG,oBAAoB;AAGpB,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAE/E,OAAO,EAAE,2BAA2B,EAAE,8BAA8B,EAAE,MAAM,wBAAwB,CAAC;AAErG,OAAO,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAC;AAG7D;;GAEG;AACH,MAAM,CAAC,MAAM,mCAAmC,GAAY,aAAa,CACvE,QAAQ,CAAC,w5DAAw5D,EAAE,CAAC,2BAA2B,EAAE,8BAA8B,EAAE,0BAA0B,CAAC,CAAC,CAAC;AAmChgE;;;GAGG;AACH,MAAM,CAAC,MAAM,WAAW,GAAsB,aAAa,CACzD,WAAW,CAAC,mCAAmC,EAAE,CAAC,CAAC,CAAC;AA2BtD;;;GAGG;AACH,MAAM,CAAC,MAAM,aAAa,GAAwB,aAAa,CAC7D,WAAW,CAAC,mCAAmC,EAAE,CAAC,CAAC,CAAC;AAYtD;;;GAGG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAqC,aAAa,CACvF,WAAW,CAAC,mCAAmC,EAAE,CAAC,CAAC,CAAC;AAsBtD;;;GAGG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAsC,aAAa,CACzF,WAAW,CAAC,mCAAmC,EAAE,CAAC,CAAC,CAAC;AAEtD;;;;;GAKG;AACH,MAAM,CAAN,IAAY,SA8GX;AA9GD,WAAY,SAAS;IACnB;;OAEG;IACH,uDAAe,CAAA;IAEf;;OAEG;IACH,iEAAoB,CAAA;IAEpB;;OAEG;IACH,+EAA2B,CAAA;IAE3B;;OAEG;IACH,2EAAyB,CAAA;IAEzB;;OAEG;IACH,+EAA2B,CAAA;IAE3B;;OAEG;IACH,yEAAwB,CAAA;IAExB;;OAEG;IACH,+EAA2B,CAAA;IAE3B;;OAEG;IACH,qEAAsB,CAAA;IAEtB;;OAEG;IACH,iEAAoB,CAAA;IAEpB;;OAEG;IACH,qEAAsB,CAAA;IAEtB;;OAEG;IACH,gEAAoB,CAAA;IAEpB;;OAEG;IACH,sEAAuB,CAAA;IAEvB;;OAEG;IACH,oEAAsB,CAAA;IAEtB;;OAEG;IACH,4DAAkB,CAAA;IAElB;;OAEG;IACH,wDAAgB,CAAA;IAEhB;;OAEG;IACH,8DAAmB,CAAA;IAEnB;;OAEG;IACH,gEAAoB,CAAA;IAEpB;;OAEG;IACH,gEAAoB,CAAA;IAEpB;;OAEG;IACH,kEAAqB,CAAA;IAErB;;OAEG;IACH,8EAA2B,CAAA;IAE3B;;OAEG;IACH,gEAAoB,CAAA;IAEpB;;OAEG;IACH,gEAAoB,CAAA;AACtB,CAAC,EA9GW,SAAS,KAAT,SAAS,QA8GpB;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAuB,aAAa,CAC9D,QAAQ,CAAC,mCAAmC,EAAE,CAAC,CAAC,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { createAttemptSink, type AttemptSink, type SinkOptions } from './sink.js';
|
|
2
|
+
export { FlowrensicActivityInterceptor, flowrensicInterceptor } from './interceptor.js';
|
|
3
|
+
export { createFlowrensicClient, type FlowrensicClient } from './client.js';
|
|
4
|
+
export { replayFetchedSet, readReplaySet, listHistoryFiles, INDEX_NAME, type ReplayOptions, type ReplayReport, type ReplayVerdict, type ReplaySet, type ReplaySetEntry, } from './replay.js';
|
|
5
|
+
export type { ActivityAttempt, ActivityStats, } from './gen/flowrensic/v1/activity_metrics_pb.js';
|
|
6
|
+
export { Outcome } from './gen/flowrensic/v1/activity_metrics_pb.js';
|
|
7
|
+
export type { EngineMetric } from './gen/flowrensic/v1/activity_metrics_pb.js';
|
|
8
|
+
export type { DeployEnv, Server, Namespace } from './gen/flowrensic/v1/catalog_pb.js';
|
|
9
|
+
export type { History } from './gen/flowrensic/v1/workflow_history_pb.js';
|
|
10
|
+
export type { Finding } from './gen/flowrensic/v1/finding_pb.js';
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,KAAK,WAAW,EAAE,KAAK,WAAW,EAAE,MAAM,WAAW,CAAC;AAClF,OAAO,EAAE,6BAA6B,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AACxF,OAAO,EAAE,sBAAsB,EAAE,KAAK,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC5E,OAAO,EACL,gBAAgB,EAChB,aAAa,EACb,gBAAgB,EAChB,UAAU,EACV,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,SAAS,EACd,KAAK,cAAc,GACpB,MAAM,aAAa,CAAC;AAErB,YAAY,EACV,eAAe,EACf,aAAa,GACd,MAAM,4CAA4C,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,4CAA4C,CAAC;AACrE,YAAY,EAAE,YAAY,EAAE,MAAM,4CAA4C,CAAC;AAC/E,YAAY,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAC;AACtF,YAAY,EAAE,OAAO,EAAE,MAAM,4CAA4C,CAAC;AAC1E,YAAY,EAAE,OAAO,EAAE,MAAM,mCAAmC,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { createAttemptSink } from './sink.js';
|
|
2
|
+
export { FlowrensicActivityInterceptor, flowrensicInterceptor } from './interceptor.js';
|
|
3
|
+
export { createFlowrensicClient } from './client.js';
|
|
4
|
+
export { replayFetchedSet, readReplaySet, listHistoryFiles, INDEX_NAME, } from './replay.js';
|
|
5
|
+
export { Outcome } from './gen/flowrensic/v1/activity_metrics_pb.js';
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAsC,MAAM,WAAW,CAAC;AAClF,OAAO,EAAE,6BAA6B,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AACxF,OAAO,EAAE,sBAAsB,EAAyB,MAAM,aAAa,CAAC;AAC5E,OAAO,EACL,gBAAgB,EAChB,aAAa,EACb,gBAAgB,EAChB,UAAU,GAMX,MAAM,aAAa,CAAC;AAMrB,OAAO,EAAE,OAAO,EAAE,MAAM,4CAA4C,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { Context } from '@temporalio/activity';
|
|
2
|
+
import type { ActivityExecuteInput, ActivityInboundCallsInterceptor, ActivityInterceptorsFactory, Next } from '@temporalio/worker';
|
|
3
|
+
import type { AttemptSink } from './sink.js';
|
|
4
|
+
/**
|
|
5
|
+
* Records one event per activity attempt, which is everything Temporal's own
|
|
6
|
+
* OpenTelemetry spans throw away: the attempt number, the workflow type, the
|
|
7
|
+
* task queue and the failure classification.
|
|
8
|
+
*
|
|
9
|
+
* Activity inbound, never workflow inbound. This runs in the activity worker
|
|
10
|
+
* where I/O is ordinary. Emitting from a workflow interceptor would be
|
|
11
|
+
* non-determinism in the product that sells determinism analysis.
|
|
12
|
+
*/
|
|
13
|
+
export declare class FlowrensicActivityInterceptor implements ActivityInboundCallsInterceptor {
|
|
14
|
+
private readonly ctx;
|
|
15
|
+
private readonly sink;
|
|
16
|
+
private readonly namespaceId;
|
|
17
|
+
constructor(ctx: Context, sink: AttemptSink, namespaceId: string);
|
|
18
|
+
execute(input: ActivityExecuteInput, next: Next<ActivityInboundCallsInterceptor, 'execute'>): Promise<unknown>;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Pass to `Worker.create({ interceptors: { activity: [flowrensicInterceptor(sink, namespaceId)] } })`.
|
|
22
|
+
* `namespaceId` identifies the namespace this worker is pointed at.
|
|
23
|
+
*/
|
|
24
|
+
export declare function flowrensicInterceptor(sink: AttemptSink, namespaceId: string): ActivityInterceptorsFactory;
|
|
25
|
+
//# sourceMappingURL=interceptor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interceptor.d.ts","sourceRoot":"","sources":["../src/interceptor.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAEpD,OAAO,KAAK,EACV,oBAAoB,EACpB,+BAA+B,EAC/B,2BAA2B,EAC3B,IAAI,EACL,MAAM,oBAAoB,CAAC;AAG5B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAe7C;;;;;;;;GAQG;AACH,qBAAa,6BAA8B,YAAW,+BAA+B;IAEjF,OAAO,CAAC,QAAQ,CAAC,GAAG;IACpB,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,OAAO,CAAC,QAAQ,CAAC,WAAW;IAH9B,YACmB,GAAG,EAAE,OAAO,EACZ,IAAI,EAAE,WAAW,EACjB,WAAW,EAAE,MAAM,EAClC;IAEE,OAAO,CACX,KAAK,EAAE,oBAAoB,EAC3B,IAAI,EAAE,IAAI,CAAC,+BAA+B,EAAE,SAAS,CAAC,GACrD,OAAO,CAAC,OAAO,CAAC,CAiClB;CACF;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,WAAW,EACjB,WAAW,EAAE,MAAM,GAClB,2BAA2B,CAI7B"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { timestampFromDate } from '@bufbuild/protobuf/wkt';
|
|
2
|
+
import { ApplicationFailure, CancelledFailure } from '@temporalio/common';
|
|
3
|
+
import { Outcome } from './gen/flowrensic/v1/activity_metrics_pb.js';
|
|
4
|
+
function classify(err) {
|
|
5
|
+
if (err instanceof CancelledFailure) {
|
|
6
|
+
return { outcome: Outcome.CANCELED, errorType: 'CancelledFailure' };
|
|
7
|
+
}
|
|
8
|
+
if (err instanceof ApplicationFailure) {
|
|
9
|
+
return { outcome: Outcome.FAILED, errorType: err.type ?? 'ApplicationFailure' };
|
|
10
|
+
}
|
|
11
|
+
if (err instanceof Error) {
|
|
12
|
+
return { outcome: Outcome.FAILED, errorType: err.constructor.name };
|
|
13
|
+
}
|
|
14
|
+
return { outcome: Outcome.FAILED, errorType: 'Unknown' };
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Records one event per activity attempt, which is everything Temporal's own
|
|
18
|
+
* OpenTelemetry spans throw away: the attempt number, the workflow type, the
|
|
19
|
+
* task queue and the failure classification.
|
|
20
|
+
*
|
|
21
|
+
* Activity inbound, never workflow inbound. This runs in the activity worker
|
|
22
|
+
* where I/O is ordinary. Emitting from a workflow interceptor would be
|
|
23
|
+
* non-determinism in the product that sells determinism analysis.
|
|
24
|
+
*/
|
|
25
|
+
export class FlowrensicActivityInterceptor {
|
|
26
|
+
ctx;
|
|
27
|
+
sink;
|
|
28
|
+
namespaceId;
|
|
29
|
+
constructor(ctx, sink, namespaceId) {
|
|
30
|
+
this.ctx = ctx;
|
|
31
|
+
this.sink = sink;
|
|
32
|
+
this.namespaceId = namespaceId;
|
|
33
|
+
}
|
|
34
|
+
async execute(input, next) {
|
|
35
|
+
const info = this.ctx.info;
|
|
36
|
+
const startedAt = new Date();
|
|
37
|
+
const emit = (outcome, errorType) => {
|
|
38
|
+
const endedAt = new Date();
|
|
39
|
+
this.sink.record({
|
|
40
|
+
$typeName: 'flowrensic.v1.ActivityAttempt',
|
|
41
|
+
namespaceId: this.namespaceId,
|
|
42
|
+
workflowType: info.workflowType ?? '',
|
|
43
|
+
workflowExecutionId: info.workflowExecution?.workflowId ?? '',
|
|
44
|
+
runKey: info.workflowExecution?.runId ?? '',
|
|
45
|
+
activityType: info.activityType,
|
|
46
|
+
activityId: info.activityId,
|
|
47
|
+
attempt: info.attempt,
|
|
48
|
+
taskQueue: info.taskQueue,
|
|
49
|
+
outcome,
|
|
50
|
+
errorType,
|
|
51
|
+
startedAt: timestampFromDate(startedAt),
|
|
52
|
+
endedAt: timestampFromDate(endedAt),
|
|
53
|
+
durationMs: BigInt(endedAt.getTime() - startedAt.getTime()),
|
|
54
|
+
});
|
|
55
|
+
};
|
|
56
|
+
try {
|
|
57
|
+
const result = await next(input);
|
|
58
|
+
emit(Outcome.COMPLETED, '');
|
|
59
|
+
return result;
|
|
60
|
+
}
|
|
61
|
+
catch (err) {
|
|
62
|
+
const { outcome, errorType } = classify(err);
|
|
63
|
+
emit(outcome, errorType);
|
|
64
|
+
throw err;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Pass to `Worker.create({ interceptors: { activity: [flowrensicInterceptor(sink, namespaceId)] } })`.
|
|
70
|
+
* `namespaceId` identifies the namespace this worker is pointed at.
|
|
71
|
+
*/
|
|
72
|
+
export function flowrensicInterceptor(sink, namespaceId) {
|
|
73
|
+
return (ctx) => ({
|
|
74
|
+
inbound: new FlowrensicActivityInterceptor(ctx, sink, namespaceId),
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=interceptor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interceptor.js","sourceRoot":"","sources":["../src/interceptor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE3D,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAQ1E,OAAO,EAAE,OAAO,EAAE,MAAM,4CAA4C,CAAC;AAGrE,SAAS,QAAQ,CAAC,GAAY;IAC5B,IAAI,GA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gBAC7D,MAAM,EAAE,IAAI,CAAC,iBAAiB,EAAE,KAAK,IAAI,EAAE;gBAC3C,YAAY,EAAE,IAAI,CAAC,YAAY;gBAC/B,UAAU,EAAE,IAAI,CAAC,UAAU;gBAC3B,OAAO,EAAE,IAAI,CAAC,OAAO;gBACrB,SAAS,EAAE,IAAI,CAAC,SAAS;gBACzB,OAAO;gBACP,SAAS;gBACT,SAAS,EAAE,iBAAiB,CAAC,SAAS,CAAC;gBACvC,OAAO,EAAE,iBAAiB,CAAC,OAAO,CAAC;gBACnC,UAAU,EAAE,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,GAAG,SAAS,CAAC,OAAO,EAAE,CAAC;aAC5D,CAAC,CAAC;QACL,CAAC,CAAC;QAEF,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,CAAC;YACjC,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC;YAC5B,OAAO,MAAM,CAAC;QAChB,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC;YAC7C,IAAI,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;YACzB,MAAM,GAAG,CAAC;QACZ,CAAC;IACH,CAAC;CACF;AAED;;;GAGG;AACH,MAAM,UAAU,qBAAqB,CACnC,IAAiB,EACjB,WAAmB;IAEnB,OAAO,CAAC,GAAY,EAAE,EAAE,CAAC,CAAC;QACxB,OAAO,EAAE,IAAI,6BAA6B,CAAC,GAAG,EAAE,IAAI,EAAE,WAAW,CAAC;KACnE,CAAC,CAAC;AACL,CAAC"}
|
package/dist/replay.d.ts
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/** Manifest the CLI writes beside the histories it fetched. */
|
|
2
|
+
export declare const INDEX_NAME = "replay-set.json";
|
|
3
|
+
/** One history on disk, as `flowrensic replay fetch` recorded it. */
|
|
4
|
+
export interface ReplaySetEntry {
|
|
5
|
+
readonly run_id: string;
|
|
6
|
+
readonly file: string;
|
|
7
|
+
readonly status: string;
|
|
8
|
+
readonly deploy_env?: string;
|
|
9
|
+
readonly events: number;
|
|
10
|
+
readonly started_at: string;
|
|
11
|
+
readonly closed_at?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface ReplaySet {
|
|
14
|
+
readonly workflow_type: string;
|
|
15
|
+
readonly deploy_env?: string;
|
|
16
|
+
readonly fetched_at: string;
|
|
17
|
+
readonly server: string;
|
|
18
|
+
readonly histories: readonly ReplaySetEntry[];
|
|
19
|
+
}
|
|
20
|
+
/** What one history did when replayed against the checkout under test. */
|
|
21
|
+
export interface ReplayVerdict {
|
|
22
|
+
readonly runId: string;
|
|
23
|
+
readonly workflowType: string;
|
|
24
|
+
readonly passed: boolean;
|
|
25
|
+
/** The replayer's own message, kept verbatim: it names what diverged. */
|
|
26
|
+
readonly error?: string;
|
|
27
|
+
}
|
|
28
|
+
export interface ReplayReport {
|
|
29
|
+
readonly total: number;
|
|
30
|
+
readonly failed: number;
|
|
31
|
+
readonly verdicts: readonly ReplayVerdict[];
|
|
32
|
+
}
|
|
33
|
+
export interface ReplayOptions {
|
|
34
|
+
/** Directory `flowrensic replay fetch --out` wrote. */
|
|
35
|
+
dir: string;
|
|
36
|
+
/** The checkout's workflows, the same path a worker would be given. */
|
|
37
|
+
workflowsPath: string;
|
|
38
|
+
/**
|
|
39
|
+
* The commit, tag or build under test. Only the pipeline knows it, and a
|
|
40
|
+
* verdict without one cannot be attributed to a change.
|
|
41
|
+
*/
|
|
42
|
+
codeVersion: string;
|
|
43
|
+
/**
|
|
44
|
+
* Flowrensic server to report to. Left out, the replay still runs and the
|
|
45
|
+
* report is returned but published nowhere.
|
|
46
|
+
*/
|
|
47
|
+
baseUrl?: string;
|
|
48
|
+
/** Extra worker options, for a project that needs its own data converter. */
|
|
49
|
+
bundlerOptions?: Record<string, unknown>;
|
|
50
|
+
}
|
|
51
|
+
export declare function readReplaySet(dir: string): Promise<ReplaySet>;
|
|
52
|
+
/**
|
|
53
|
+
* Replays every history in a fetched set against the workflows in this
|
|
54
|
+
* checkout, and reports the verdicts.
|
|
55
|
+
*
|
|
56
|
+
* The replay happens here, in the customer's own SDK, because that is the only
|
|
57
|
+
* place the workflow code and its bundler exist. Flowrensic supplies the
|
|
58
|
+
* histories and takes back what happened.
|
|
59
|
+
*/
|
|
60
|
+
export declare function replayFetchedSet(options: ReplayOptions): Promise<ReplayReport>;
|
|
61
|
+
/** Histories in a directory, for a caller that wants them without the index. */
|
|
62
|
+
export declare function listHistoryFiles(dir: string): Promise<string[]>;
|
|
63
|
+
//# sourceMappingURL=replay.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"replay.d.ts","sourceRoot":"","sources":["../src/replay.ts"],"names":[],"mappings":"AAUA,+DAA+D;AAC/D,eAAO,MAAM,UAAU,oBAAoB,CAAC;AAE5C,qEAAqE;AACrE,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,SAAS,EAAE,SAAS,cAAc,EAAE,CAAC;CAC/C;AAED,0EAA0E;AAC1E,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,yEAAyE;IACzE,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,QAAQ,EAAE,SAAS,aAAa,EAAE,CAAC;CAC7C;AAED,MAAM,WAAW,aAAa;IAC5B,uDAAuD;IACvD,GAAG,EAAE,MAAM,CAAC;IACZ,uEAAuE;IACvE,aAAa,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,6EAA6E;IAC7E,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC1C;AAQD,wBAAsB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC,CAOnE;AA+BD;;;;;;;GAOG;AACH,wBAAsB,gBAAgB,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,YAAY,CAAC,CAoCpF;AAED,gFAAgF;AAChF,wBAAsB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAGrE"}
|
package/dist/replay.js
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { readFile, readdir } from 'node:fs/promises';
|
|
2
|
+
import { join } from 'node:path';
|
|
3
|
+
// Node ESM needs the extension on a subpath of a package that declares no
|
|
4
|
+
// `exports`, and `historyFromJSON` is not on the package's own entry point.
|
|
5
|
+
import { historyFromJSON } from '@temporalio/common/lib/proto-utils.js';
|
|
6
|
+
import { Worker } from '@temporalio/worker';
|
|
7
|
+
import { createFlowrensicClient } from './client.js';
|
|
8
|
+
/** Manifest the CLI writes beside the histories it fetched. */
|
|
9
|
+
export const INDEX_NAME = 'replay-set.json';
|
|
10
|
+
function isReplaySet(value) {
|
|
11
|
+
if (typeof value !== 'object' || value === null)
|
|
12
|
+
return false;
|
|
13
|
+
if (!('workflow_type' in value) || typeof value.workflow_type !== 'string')
|
|
14
|
+
return false;
|
|
15
|
+
return 'histories' in value && Array.isArray(value.histories);
|
|
16
|
+
}
|
|
17
|
+
export async function readReplaySet(dir) {
|
|
18
|
+
const path = join(dir, INDEX_NAME);
|
|
19
|
+
const parsed = JSON.parse(await readFile(path, 'utf8'));
|
|
20
|
+
if (!isReplaySet(parsed)) {
|
|
21
|
+
throw new Error(`${path} is not a replay set manifest`);
|
|
22
|
+
}
|
|
23
|
+
return parsed;
|
|
24
|
+
}
|
|
25
|
+
/** protobuf Timestamp, which connect-es takes as seconds plus nanos. */
|
|
26
|
+
function timestampFrom(at) {
|
|
27
|
+
const ms = at.getTime();
|
|
28
|
+
return {
|
|
29
|
+
seconds: BigInt(Math.floor(ms / 1000)),
|
|
30
|
+
nanos: (ms % 1000) * 1_000_000,
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
async function publishVerdicts(baseUrl, codeVersion, verdicts) {
|
|
34
|
+
const client = createFlowrensicClient(baseUrl);
|
|
35
|
+
const replayedAt = new Date();
|
|
36
|
+
await client.ingest.ingestReplayResults({
|
|
37
|
+
results: verdicts.map((v) => ({
|
|
38
|
+
runId: v.runId,
|
|
39
|
+
codeVersion,
|
|
40
|
+
workflowType: v.workflowType,
|
|
41
|
+
passed: v.passed,
|
|
42
|
+
error: v.error ?? '',
|
|
43
|
+
replayedAt: timestampFrom(replayedAt),
|
|
44
|
+
})),
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Replays every history in a fetched set against the workflows in this
|
|
49
|
+
* checkout, and reports the verdicts.
|
|
50
|
+
*
|
|
51
|
+
* The replay happens here, in the customer's own SDK, because that is the only
|
|
52
|
+
* place the workflow code and its bundler exist. Flowrensic supplies the
|
|
53
|
+
* histories and takes back what happened.
|
|
54
|
+
*/
|
|
55
|
+
export async function replayFetchedSet(options) {
|
|
56
|
+
const { dir, workflowsPath, codeVersion, baseUrl, bundlerOptions } = options;
|
|
57
|
+
const set = await readReplaySet(dir);
|
|
58
|
+
const verdicts = [];
|
|
59
|
+
for (const entry of set.histories) {
|
|
60
|
+
const parsed = JSON.parse(await readFile(join(dir, entry.file), 'utf8'));
|
|
61
|
+
const history = historyFromJSON(parsed);
|
|
62
|
+
try {
|
|
63
|
+
await Worker.runReplayHistory({ workflowsPath, ...bundlerOptions }, history, entry.run_id);
|
|
64
|
+
verdicts.push({ runId: entry.run_id, workflowType: set.workflow_type, passed: true });
|
|
65
|
+
}
|
|
66
|
+
catch (err) {
|
|
67
|
+
// Any throw is a failed replay. The replayer distinguishes determinism
|
|
68
|
+
// violations from other errors, but both mean this history no longer
|
|
69
|
+
// runs on this code, which is the thing CI needs told.
|
|
70
|
+
verdicts.push({
|
|
71
|
+
runId: entry.run_id,
|
|
72
|
+
workflowType: set.workflow_type,
|
|
73
|
+
passed: false,
|
|
74
|
+
error: err instanceof Error ? err.message : String(err),
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
const report = {
|
|
79
|
+
total: verdicts.length,
|
|
80
|
+
failed: verdicts.filter((v) => !v.passed).length,
|
|
81
|
+
verdicts,
|
|
82
|
+
};
|
|
83
|
+
if (baseUrl !== undefined && verdicts.length > 0) {
|
|
84
|
+
await publishVerdicts(baseUrl, codeVersion, verdicts);
|
|
85
|
+
}
|
|
86
|
+
return report;
|
|
87
|
+
}
|
|
88
|
+
/** Histories in a directory, for a caller that wants them without the index. */
|
|
89
|
+
export async function listHistoryFiles(dir) {
|
|
90
|
+
const names = await readdir(dir);
|
|
91
|
+
return names.filter((n) => n.endsWith('.json') && n !== INDEX_NAME).sort();
|
|
92
|
+
}
|
|
93
|
+
//# sourceMappingURL=replay.js.map
|