weave-typescript 0.17.0 → 0.19.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.
|
@@ -132,6 +132,20 @@ export interface WatchInspectionEventsRequest {
|
|
|
132
132
|
export interface WatchInspectionEventsResponse {
|
|
133
133
|
event: InspectionEvent | undefined;
|
|
134
134
|
}
|
|
135
|
+
export interface WatchProcessOutputRequest {
|
|
136
|
+
runId: string;
|
|
137
|
+
processId: string;
|
|
138
|
+
/** Only return output chunks with sequence greater than this value. */
|
|
139
|
+
afterSequence: number;
|
|
140
|
+
}
|
|
141
|
+
export interface ProcessOutputChunk {
|
|
142
|
+
sequence: number;
|
|
143
|
+
data: Uint8Array;
|
|
144
|
+
replay: boolean;
|
|
145
|
+
}
|
|
146
|
+
export interface WatchProcessOutputResponse {
|
|
147
|
+
chunk: ProcessOutputChunk | undefined;
|
|
148
|
+
}
|
|
135
149
|
export interface ListProcessTypesRequest {
|
|
136
150
|
pageSize: number;
|
|
137
151
|
pageToken: string;
|
|
@@ -162,6 +176,9 @@ export declare const ListInspectionEventsRequest: MessageFns<ListInspectionEvent
|
|
|
162
176
|
export declare const ListInspectionEventsResponse: MessageFns<ListInspectionEventsResponse>;
|
|
163
177
|
export declare const WatchInspectionEventsRequest: MessageFns<WatchInspectionEventsRequest>;
|
|
164
178
|
export declare const WatchInspectionEventsResponse: MessageFns<WatchInspectionEventsResponse>;
|
|
179
|
+
export declare const WatchProcessOutputRequest: MessageFns<WatchProcessOutputRequest>;
|
|
180
|
+
export declare const ProcessOutputChunk: MessageFns<ProcessOutputChunk>;
|
|
181
|
+
export declare const WatchProcessOutputResponse: MessageFns<WatchProcessOutputResponse>;
|
|
165
182
|
export declare const ListProcessTypesRequest: MessageFns<ListProcessTypesRequest>;
|
|
166
183
|
export declare const ListProcessTypesResponse: MessageFns<ListProcessTypesResponse>;
|
|
167
184
|
/**
|
|
@@ -292,6 +309,11 @@ export interface InspectionService {
|
|
|
292
309
|
* optional sequence cursor.
|
|
293
310
|
*/
|
|
294
311
|
WatchInspectionEvents(request: WatchInspectionEventsRequest): Observable<WatchInspectionEventsResponse>;
|
|
312
|
+
/**
|
|
313
|
+
* WatchProcessOutput streams live subprocess output for one process after an
|
|
314
|
+
* optional output chunk cursor.
|
|
315
|
+
*/
|
|
316
|
+
WatchProcessOutput(request: WatchProcessOutputRequest): Observable<WatchProcessOutputResponse>;
|
|
295
317
|
/** ListProcessTypes discovers registered process types. */
|
|
296
318
|
ListProcessTypes(request: ListProcessTypesRequest): Promise<ListProcessTypesResponse>;
|
|
297
319
|
}
|
|
@@ -308,6 +330,7 @@ export declare class InspectionServiceClientImpl implements InspectionService {
|
|
|
308
330
|
WatchEvents(request: WatchEventsRequest): Observable<WatchEventsResponse>;
|
|
309
331
|
ListInspectionEvents(request: ListInspectionEventsRequest): Promise<ListInspectionEventsResponse>;
|
|
310
332
|
WatchInspectionEvents(request: WatchInspectionEventsRequest): Observable<WatchInspectionEventsResponse>;
|
|
333
|
+
WatchProcessOutput(request: WatchProcessOutputRequest): Observable<WatchProcessOutputResponse>;
|
|
311
334
|
ListProcessTypes(request: ListProcessTypesRequest): Promise<ListProcessTypesResponse>;
|
|
312
335
|
}
|
|
313
336
|
/**
|
|
@@ -395,6 +418,18 @@ export declare const InspectionServiceDefinition: {
|
|
|
395
418
|
readonly responseStream: true;
|
|
396
419
|
readonly options: {};
|
|
397
420
|
};
|
|
421
|
+
/**
|
|
422
|
+
* WatchProcessOutput streams live subprocess output for one process after an
|
|
423
|
+
* optional output chunk cursor.
|
|
424
|
+
*/
|
|
425
|
+
readonly watchProcessOutput: {
|
|
426
|
+
readonly name: "WatchProcessOutput";
|
|
427
|
+
readonly requestType: typeof WatchProcessOutputRequest;
|
|
428
|
+
readonly requestStream: false;
|
|
429
|
+
readonly responseType: typeof WatchProcessOutputResponse;
|
|
430
|
+
readonly responseStream: true;
|
|
431
|
+
readonly options: {};
|
|
432
|
+
};
|
|
398
433
|
/** ListProcessTypes discovers registered process types. */
|
|
399
434
|
readonly listProcessTypes: {
|
|
400
435
|
readonly name: "ListProcessTypes";
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
// protoc unknown
|
|
6
6
|
// source: weaveapi/atc/v1/service.proto
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.InspectionServiceDefinition = exports.InspectionServiceClientImpl = exports.InspectionServiceServiceName = exports.ATCServiceDefinition = exports.ATCServiceClientImpl = exports.ATCServiceServiceName = exports.ListProcessTypesResponse = exports.ListProcessTypesRequest = exports.WatchInspectionEventsResponse = exports.WatchInspectionEventsRequest = exports.ListInspectionEventsResponse = exports.ListInspectionEventsRequest = exports.WatchEventsResponse = exports.WatchEventsRequest = exports.ListEventsResponse = exports.ListEventsRequest = exports.GetRunResponse = exports.GetRunRequest = exports.ListRunsResponse = exports.ListRunsRequest = exports.GetRunStatusResponse = exports.GetRunStatusRequest = exports.WaitRunResponse = exports.WaitRunRequest = exports.CancelRunResponse = exports.CancelRunRequest = exports.SendMessageResponse = exports.SendMessageRequest = exports.CreateRunResponse = exports.CreateRunRequest = exports.protobufPackage = void 0;
|
|
8
|
+
exports.InspectionServiceDefinition = exports.InspectionServiceClientImpl = exports.InspectionServiceServiceName = exports.ATCServiceDefinition = exports.ATCServiceClientImpl = exports.ATCServiceServiceName = exports.ListProcessTypesResponse = exports.ListProcessTypesRequest = exports.WatchProcessOutputResponse = exports.ProcessOutputChunk = exports.WatchProcessOutputRequest = exports.WatchInspectionEventsResponse = exports.WatchInspectionEventsRequest = exports.ListInspectionEventsResponse = exports.ListInspectionEventsRequest = exports.WatchEventsResponse = exports.WatchEventsRequest = exports.ListEventsResponse = exports.ListEventsRequest = exports.GetRunResponse = exports.GetRunRequest = exports.ListRunsResponse = exports.ListRunsRequest = exports.GetRunStatusResponse = exports.GetRunStatusRequest = exports.WaitRunResponse = exports.WaitRunRequest = exports.CancelRunResponse = exports.CancelRunRequest = exports.SendMessageResponse = exports.SendMessageRequest = exports.CreateRunResponse = exports.CreateRunRequest = exports.protobufPackage = void 0;
|
|
9
9
|
/* eslint-disable */
|
|
10
10
|
const wire_1 = require("@bufbuild/protobuf/wire");
|
|
11
11
|
const operators_1 = require("rxjs/operators");
|
|
@@ -2144,6 +2144,239 @@ exports.WatchInspectionEventsResponse = {
|
|
|
2144
2144
|
return message;
|
|
2145
2145
|
},
|
|
2146
2146
|
};
|
|
2147
|
+
function createBaseWatchProcessOutputRequest() {
|
|
2148
|
+
return { runId: "", processId: "", afterSequence: 0 };
|
|
2149
|
+
}
|
|
2150
|
+
exports.WatchProcessOutputRequest = {
|
|
2151
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
2152
|
+
if (message.runId !== "") {
|
|
2153
|
+
writer.uint32(10).string(message.runId);
|
|
2154
|
+
}
|
|
2155
|
+
if (message.processId !== "") {
|
|
2156
|
+
writer.uint32(18).string(message.processId);
|
|
2157
|
+
}
|
|
2158
|
+
if (message.afterSequence !== 0) {
|
|
2159
|
+
writer.uint32(24).uint64(message.afterSequence);
|
|
2160
|
+
}
|
|
2161
|
+
return writer;
|
|
2162
|
+
},
|
|
2163
|
+
decode(input, length) {
|
|
2164
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
2165
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
2166
|
+
const message = createBaseWatchProcessOutputRequest();
|
|
2167
|
+
while (reader.pos < end) {
|
|
2168
|
+
const tag = reader.uint32();
|
|
2169
|
+
switch (tag >>> 3) {
|
|
2170
|
+
case 1: {
|
|
2171
|
+
if (tag !== 10) {
|
|
2172
|
+
break;
|
|
2173
|
+
}
|
|
2174
|
+
message.runId = reader.string();
|
|
2175
|
+
continue;
|
|
2176
|
+
}
|
|
2177
|
+
case 2: {
|
|
2178
|
+
if (tag !== 18) {
|
|
2179
|
+
break;
|
|
2180
|
+
}
|
|
2181
|
+
message.processId = reader.string();
|
|
2182
|
+
continue;
|
|
2183
|
+
}
|
|
2184
|
+
case 3: {
|
|
2185
|
+
if (tag !== 24) {
|
|
2186
|
+
break;
|
|
2187
|
+
}
|
|
2188
|
+
message.afterSequence = longToNumber(reader.uint64());
|
|
2189
|
+
continue;
|
|
2190
|
+
}
|
|
2191
|
+
}
|
|
2192
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
2193
|
+
break;
|
|
2194
|
+
}
|
|
2195
|
+
reader.skip(tag & 7);
|
|
2196
|
+
}
|
|
2197
|
+
return message;
|
|
2198
|
+
},
|
|
2199
|
+
fromJSON(object) {
|
|
2200
|
+
return {
|
|
2201
|
+
runId: isSet(object.runId)
|
|
2202
|
+
? globalThis.String(object.runId)
|
|
2203
|
+
: isSet(object.run_id)
|
|
2204
|
+
? globalThis.String(object.run_id)
|
|
2205
|
+
: "",
|
|
2206
|
+
processId: isSet(object.processId)
|
|
2207
|
+
? globalThis.String(object.processId)
|
|
2208
|
+
: isSet(object.process_id)
|
|
2209
|
+
? globalThis.String(object.process_id)
|
|
2210
|
+
: "",
|
|
2211
|
+
afterSequence: isSet(object.afterSequence)
|
|
2212
|
+
? globalThis.Number(object.afterSequence)
|
|
2213
|
+
: isSet(object.after_sequence)
|
|
2214
|
+
? globalThis.Number(object.after_sequence)
|
|
2215
|
+
: 0,
|
|
2216
|
+
};
|
|
2217
|
+
},
|
|
2218
|
+
toJSON(message) {
|
|
2219
|
+
const obj = {};
|
|
2220
|
+
if (message.runId !== "") {
|
|
2221
|
+
obj.runId = message.runId;
|
|
2222
|
+
}
|
|
2223
|
+
if (message.processId !== "") {
|
|
2224
|
+
obj.processId = message.processId;
|
|
2225
|
+
}
|
|
2226
|
+
if (message.afterSequence !== 0) {
|
|
2227
|
+
obj.afterSequence = Math.round(message.afterSequence);
|
|
2228
|
+
}
|
|
2229
|
+
return obj;
|
|
2230
|
+
},
|
|
2231
|
+
create(base) {
|
|
2232
|
+
return exports.WatchProcessOutputRequest.fromPartial(base !== null && base !== void 0 ? base : {});
|
|
2233
|
+
},
|
|
2234
|
+
fromPartial(object) {
|
|
2235
|
+
var _a, _b, _c;
|
|
2236
|
+
const message = createBaseWatchProcessOutputRequest();
|
|
2237
|
+
message.runId = (_a = object.runId) !== null && _a !== void 0 ? _a : "";
|
|
2238
|
+
message.processId = (_b = object.processId) !== null && _b !== void 0 ? _b : "";
|
|
2239
|
+
message.afterSequence = (_c = object.afterSequence) !== null && _c !== void 0 ? _c : 0;
|
|
2240
|
+
return message;
|
|
2241
|
+
},
|
|
2242
|
+
};
|
|
2243
|
+
function createBaseProcessOutputChunk() {
|
|
2244
|
+
return { sequence: 0, data: new Uint8Array(0), replay: false };
|
|
2245
|
+
}
|
|
2246
|
+
exports.ProcessOutputChunk = {
|
|
2247
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
2248
|
+
if (message.sequence !== 0) {
|
|
2249
|
+
writer.uint32(8).uint64(message.sequence);
|
|
2250
|
+
}
|
|
2251
|
+
if (message.data.length !== 0) {
|
|
2252
|
+
writer.uint32(18).bytes(message.data);
|
|
2253
|
+
}
|
|
2254
|
+
if (message.replay !== false) {
|
|
2255
|
+
writer.uint32(24).bool(message.replay);
|
|
2256
|
+
}
|
|
2257
|
+
return writer;
|
|
2258
|
+
},
|
|
2259
|
+
decode(input, length) {
|
|
2260
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
2261
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
2262
|
+
const message = createBaseProcessOutputChunk();
|
|
2263
|
+
while (reader.pos < end) {
|
|
2264
|
+
const tag = reader.uint32();
|
|
2265
|
+
switch (tag >>> 3) {
|
|
2266
|
+
case 1: {
|
|
2267
|
+
if (tag !== 8) {
|
|
2268
|
+
break;
|
|
2269
|
+
}
|
|
2270
|
+
message.sequence = longToNumber(reader.uint64());
|
|
2271
|
+
continue;
|
|
2272
|
+
}
|
|
2273
|
+
case 2: {
|
|
2274
|
+
if (tag !== 18) {
|
|
2275
|
+
break;
|
|
2276
|
+
}
|
|
2277
|
+
message.data = reader.bytes();
|
|
2278
|
+
continue;
|
|
2279
|
+
}
|
|
2280
|
+
case 3: {
|
|
2281
|
+
if (tag !== 24) {
|
|
2282
|
+
break;
|
|
2283
|
+
}
|
|
2284
|
+
message.replay = reader.bool();
|
|
2285
|
+
continue;
|
|
2286
|
+
}
|
|
2287
|
+
}
|
|
2288
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
2289
|
+
break;
|
|
2290
|
+
}
|
|
2291
|
+
reader.skip(tag & 7);
|
|
2292
|
+
}
|
|
2293
|
+
return message;
|
|
2294
|
+
},
|
|
2295
|
+
fromJSON(object) {
|
|
2296
|
+
return {
|
|
2297
|
+
sequence: isSet(object.sequence) ? globalThis.Number(object.sequence) : 0,
|
|
2298
|
+
data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array(0),
|
|
2299
|
+
replay: isSet(object.replay) ? globalThis.Boolean(object.replay) : false,
|
|
2300
|
+
};
|
|
2301
|
+
},
|
|
2302
|
+
toJSON(message) {
|
|
2303
|
+
const obj = {};
|
|
2304
|
+
if (message.sequence !== 0) {
|
|
2305
|
+
obj.sequence = Math.round(message.sequence);
|
|
2306
|
+
}
|
|
2307
|
+
if (message.data.length !== 0) {
|
|
2308
|
+
obj.data = base64FromBytes(message.data);
|
|
2309
|
+
}
|
|
2310
|
+
if (message.replay !== false) {
|
|
2311
|
+
obj.replay = message.replay;
|
|
2312
|
+
}
|
|
2313
|
+
return obj;
|
|
2314
|
+
},
|
|
2315
|
+
create(base) {
|
|
2316
|
+
return exports.ProcessOutputChunk.fromPartial(base !== null && base !== void 0 ? base : {});
|
|
2317
|
+
},
|
|
2318
|
+
fromPartial(object) {
|
|
2319
|
+
var _a, _b, _c;
|
|
2320
|
+
const message = createBaseProcessOutputChunk();
|
|
2321
|
+
message.sequence = (_a = object.sequence) !== null && _a !== void 0 ? _a : 0;
|
|
2322
|
+
message.data = (_b = object.data) !== null && _b !== void 0 ? _b : new Uint8Array(0);
|
|
2323
|
+
message.replay = (_c = object.replay) !== null && _c !== void 0 ? _c : false;
|
|
2324
|
+
return message;
|
|
2325
|
+
},
|
|
2326
|
+
};
|
|
2327
|
+
function createBaseWatchProcessOutputResponse() {
|
|
2328
|
+
return { chunk: undefined };
|
|
2329
|
+
}
|
|
2330
|
+
exports.WatchProcessOutputResponse = {
|
|
2331
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
2332
|
+
if (message.chunk !== undefined) {
|
|
2333
|
+
exports.ProcessOutputChunk.encode(message.chunk, writer.uint32(10).fork()).join();
|
|
2334
|
+
}
|
|
2335
|
+
return writer;
|
|
2336
|
+
},
|
|
2337
|
+
decode(input, length) {
|
|
2338
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
2339
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
2340
|
+
const message = createBaseWatchProcessOutputResponse();
|
|
2341
|
+
while (reader.pos < end) {
|
|
2342
|
+
const tag = reader.uint32();
|
|
2343
|
+
switch (tag >>> 3) {
|
|
2344
|
+
case 1: {
|
|
2345
|
+
if (tag !== 10) {
|
|
2346
|
+
break;
|
|
2347
|
+
}
|
|
2348
|
+
message.chunk = exports.ProcessOutputChunk.decode(reader, reader.uint32());
|
|
2349
|
+
continue;
|
|
2350
|
+
}
|
|
2351
|
+
}
|
|
2352
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
2353
|
+
break;
|
|
2354
|
+
}
|
|
2355
|
+
reader.skip(tag & 7);
|
|
2356
|
+
}
|
|
2357
|
+
return message;
|
|
2358
|
+
},
|
|
2359
|
+
fromJSON(object) {
|
|
2360
|
+
return { chunk: isSet(object.chunk) ? exports.ProcessOutputChunk.fromJSON(object.chunk) : undefined };
|
|
2361
|
+
},
|
|
2362
|
+
toJSON(message) {
|
|
2363
|
+
const obj = {};
|
|
2364
|
+
if (message.chunk !== undefined) {
|
|
2365
|
+
obj.chunk = exports.ProcessOutputChunk.toJSON(message.chunk);
|
|
2366
|
+
}
|
|
2367
|
+
return obj;
|
|
2368
|
+
},
|
|
2369
|
+
create(base) {
|
|
2370
|
+
return exports.WatchProcessOutputResponse.fromPartial(base !== null && base !== void 0 ? base : {});
|
|
2371
|
+
},
|
|
2372
|
+
fromPartial(object) {
|
|
2373
|
+
const message = createBaseWatchProcessOutputResponse();
|
|
2374
|
+
message.chunk = (object.chunk !== undefined && object.chunk !== null)
|
|
2375
|
+
? exports.ProcessOutputChunk.fromPartial(object.chunk)
|
|
2376
|
+
: undefined;
|
|
2377
|
+
return message;
|
|
2378
|
+
},
|
|
2379
|
+
};
|
|
2147
2380
|
function createBaseListProcessTypesRequest() {
|
|
2148
2381
|
return { pageSize: 0, pageToken: "" };
|
|
2149
2382
|
}
|
|
@@ -2546,6 +2779,7 @@ class InspectionServiceClientImpl {
|
|
|
2546
2779
|
this.WatchEvents = this.WatchEvents.bind(this);
|
|
2547
2780
|
this.ListInspectionEvents = this.ListInspectionEvents.bind(this);
|
|
2548
2781
|
this.WatchInspectionEvents = this.WatchInspectionEvents.bind(this);
|
|
2782
|
+
this.WatchProcessOutput = this.WatchProcessOutput.bind(this);
|
|
2549
2783
|
this.ListProcessTypes = this.ListProcessTypes.bind(this);
|
|
2550
2784
|
}
|
|
2551
2785
|
ListRuns(request) {
|
|
@@ -2578,6 +2812,11 @@ class InspectionServiceClientImpl {
|
|
|
2578
2812
|
const result = this.rpc.serverStreamingRequest(this.service, "WatchInspectionEvents", data);
|
|
2579
2813
|
return result.pipe((0, operators_1.map)((data) => exports.WatchInspectionEventsResponse.decode(new wire_1.BinaryReader(data))));
|
|
2580
2814
|
}
|
|
2815
|
+
WatchProcessOutput(request) {
|
|
2816
|
+
const data = exports.WatchProcessOutputRequest.encode(request).finish();
|
|
2817
|
+
const result = this.rpc.serverStreamingRequest(this.service, "WatchProcessOutput", data);
|
|
2818
|
+
return result.pipe((0, operators_1.map)((data) => exports.WatchProcessOutputResponse.decode(new wire_1.BinaryReader(data))));
|
|
2819
|
+
}
|
|
2581
2820
|
ListProcessTypes(request) {
|
|
2582
2821
|
const data = exports.ListProcessTypesRequest.encode(request).finish();
|
|
2583
2822
|
const promise = this.rpc.request(this.service, "ListProcessTypes", data);
|
|
@@ -2743,6 +2982,18 @@ exports.InspectionServiceDefinition = {
|
|
|
2743
2982
|
responseStream: true,
|
|
2744
2983
|
options: {},
|
|
2745
2984
|
},
|
|
2985
|
+
/**
|
|
2986
|
+
* WatchProcessOutput streams live subprocess output for one process after an
|
|
2987
|
+
* optional output chunk cursor.
|
|
2988
|
+
*/
|
|
2989
|
+
watchProcessOutput: {
|
|
2990
|
+
name: "WatchProcessOutput",
|
|
2991
|
+
requestType: exports.WatchProcessOutputRequest,
|
|
2992
|
+
requestStream: false,
|
|
2993
|
+
responseType: exports.WatchProcessOutputResponse,
|
|
2994
|
+
responseStream: true,
|
|
2995
|
+
options: {},
|
|
2996
|
+
},
|
|
2746
2997
|
/** ListProcessTypes discovers registered process types. */
|
|
2747
2998
|
listProcessTypes: {
|
|
2748
2999
|
name: "ListProcessTypes",
|
|
@@ -166,4 +166,12 @@ export interface CountEventsByTypeRow {
|
|
|
166
166
|
total: string;
|
|
167
167
|
}
|
|
168
168
|
export declare function countEventsByType(client: Client, args: CountEventsByTypeArgs): Promise<CountEventsByTypeRow | null>;
|
|
169
|
+
export declare const listRunIDsQuery = "-- name: ListRunIDs :many\nSELECT DISTINCT run_id\nFROM atc.events\nWHERE tenant_id = $1\n AND transaction_id < pg_snapshot_xmin(pg_current_snapshot())\nORDER BY run_id";
|
|
170
|
+
export interface ListRunIDsArgs {
|
|
171
|
+
tenantId: string;
|
|
172
|
+
}
|
|
173
|
+
export interface ListRunIDsRow {
|
|
174
|
+
runId: string;
|
|
175
|
+
}
|
|
176
|
+
export declare function listRunIDs(client: Client, args: ListRunIDsArgs): Promise<ListRunIDsRow[]>;
|
|
169
177
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.countEventsByTypeQuery = exports.queryEventsByRunAndTypesQuery = exports.queryEventsByTimeRangeQuery = exports.queryEventsByTypeQuery = exports.lockRunQuery = exports.listEventsByTypeQuery = exports.loadAllEventsQuery = exports.loadEventsQuery = exports.getCurrentVersionQuery = exports.insertEventQuery = void 0;
|
|
3
|
+
exports.listRunIDsQuery = exports.countEventsByTypeQuery = exports.queryEventsByRunAndTypesQuery = exports.queryEventsByTimeRangeQuery = exports.queryEventsByTypeQuery = exports.lockRunQuery = exports.listEventsByTypeQuery = exports.loadAllEventsQuery = exports.loadEventsQuery = exports.getCurrentVersionQuery = exports.insertEventQuery = void 0;
|
|
4
4
|
exports.insertEvent = insertEvent;
|
|
5
5
|
exports.getCurrentVersion = getCurrentVersion;
|
|
6
6
|
exports.loadEvents = loadEvents;
|
|
@@ -11,6 +11,7 @@ exports.queryEventsByType = queryEventsByType;
|
|
|
11
11
|
exports.queryEventsByTimeRange = queryEventsByTimeRange;
|
|
12
12
|
exports.queryEventsByRunAndTypes = queryEventsByRunAndTypes;
|
|
13
13
|
exports.countEventsByType = countEventsByType;
|
|
14
|
+
exports.listRunIDs = listRunIDs;
|
|
14
15
|
exports.insertEventQuery = `-- name: InsertEvent :one
|
|
15
16
|
INSERT INTO atc.events (
|
|
16
17
|
id,
|
|
@@ -331,3 +332,21 @@ async function countEventsByType(client, args) {
|
|
|
331
332
|
total: row[0]
|
|
332
333
|
};
|
|
333
334
|
}
|
|
335
|
+
exports.listRunIDsQuery = `-- name: ListRunIDs :many
|
|
336
|
+
SELECT DISTINCT run_id
|
|
337
|
+
FROM atc.events
|
|
338
|
+
WHERE tenant_id = $1
|
|
339
|
+
AND transaction_id < pg_snapshot_xmin(pg_current_snapshot())
|
|
340
|
+
ORDER BY run_id`;
|
|
341
|
+
async function listRunIDs(client, args) {
|
|
342
|
+
const result = await client.query({
|
|
343
|
+
text: exports.listRunIDsQuery,
|
|
344
|
+
values: [args.tenantId],
|
|
345
|
+
rowMode: "array"
|
|
346
|
+
});
|
|
347
|
+
return result.rows.map(row => {
|
|
348
|
+
return {
|
|
349
|
+
runId: row[0]
|
|
350
|
+
};
|
|
351
|
+
});
|
|
352
|
+
}
|