weave-typescript 0.11.14 → 0.11.16

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.
Files changed (75) hide show
  1. package/dist/weaveapi/data/v1/data.pb.d.ts +54 -0
  2. package/dist/weaveapi/data/v1/data.pb.js +411 -0
  3. package/dist/weaveapi/data/v1/service.pb.d.ts +296 -0
  4. package/dist/weaveapi/data/v1/service.pb.js +2779 -0
  5. package/dist/weaveapi/input/v1/input.pb.d.ts +77 -0
  6. package/dist/weaveapi/input/v1/input.pb.js +632 -0
  7. package/dist/weaveapi/input/v1/service.pb.d.ts +390 -0
  8. package/dist/weaveapi/input/v1/service.pb.js +3612 -0
  9. package/dist/weaveapi/integration/v1/integration.pb.d.ts +67 -0
  10. package/dist/weaveapi/integration/v1/integration.pb.js +486 -0
  11. package/dist/weaveapi/integration/v1/service.pb.d.ts +318 -0
  12. package/dist/weaveapi/integration/v1/service.pb.js +2994 -0
  13. package/dist/weaveapi/project/v1/project.pb.d.ts +1 -0
  14. package/dist/weaveapi/project/v1/project.pb.js +17 -1
  15. package/dist/weaveapi/project/v1/service.pb.d.ts +25 -0
  16. package/dist/weaveapi/project/v1/service.pb.js +248 -5
  17. package/dist/weaveapi/report/v1/report.pb.d.ts +81 -0
  18. package/dist/weaveapi/report/v1/report.pb.js +678 -0
  19. package/dist/weaveapi/report/v1/service.pb.d.ts +194 -0
  20. package/dist/weaveapi/report/v1/service.pb.js +1925 -0
  21. package/dist/weaveapi/requirement/v1/requirement.pb.d.ts +70 -0
  22. package/dist/weaveapi/requirement/v1/requirement.pb.js +570 -0
  23. package/dist/weaveapi/requirement/v1/service.pb.d.ts +390 -0
  24. package/dist/weaveapi/requirement/v1/service.pb.js +3638 -0
  25. package/dist/weaveapi/run/v1/run.pb.d.ts +117 -0
  26. package/dist/weaveapi/run/v1/run.pb.js +1155 -0
  27. package/dist/weaveapi/run/v1/service.pb.d.ts +229 -0
  28. package/dist/weaveapi/run/v1/service.pb.js +2428 -0
  29. package/dist/weaveapi/script/v1/script.pb.d.ts +102 -0
  30. package/dist/weaveapi/script/v1/script.pb.js +1025 -0
  31. package/dist/weaveapi/script/v1/service.pb.d.ts +502 -0
  32. package/dist/weaveapi/script/v1/service.pb.js +4873 -0
  33. package/dist/weaveapi/storage/v1/service.pb.d.ts +4 -0
  34. package/dist/weaveapi/storage/v1/service.pb.js +50 -7
  35. package/dist/weaveapi/storage/v1/storage.pb.d.ts +2 -0
  36. package/dist/weaveapi/storage/v1/storage.pb.js +23 -0
  37. package/dist/weaveapi/storage/v1/vcs.pb.d.ts +75 -0
  38. package/dist/weaveapi/storage/v1/vcs.pb.js +864 -0
  39. package/dist/weaveapi/suite/v1/service.pb.d.ts +539 -0
  40. package/dist/weaveapi/suite/v1/service.pb.js +5281 -0
  41. package/dist/weaveapi/suite/v1/suite.pb.d.ts +92 -0
  42. package/dist/weaveapi/suite/v1/suite.pb.js +876 -0
  43. package/dist/weaveapi/testcase/v1/service.pb.d.ts +498 -0
  44. package/dist/weaveapi/testcase/v1/service.pb.js +4730 -0
  45. package/dist/weaveapi/testcase/v1/testcase.pb.d.ts +91 -0
  46. package/dist/weaveapi/testcase/v1/testcase.pb.js +794 -0
  47. package/dist/weaveapi/workflow/v1/service.pb.d.ts +26 -0
  48. package/dist/weaveapi/workflow/v1/service.pb.js +293 -5
  49. package/dist/weaveapi/workflow/v1/workflow.pb.d.ts +1 -0
  50. package/dist/weaveapi/workflow/v1/workflow.pb.js +17 -1
  51. package/dist/weavesql/weavedb/data_asset_sql.d.ts +206 -0
  52. package/dist/weavesql/weavedb/data_asset_sql.js +335 -0
  53. package/dist/weavesql/weavedb/input_sql.d.ts +293 -0
  54. package/dist/weavesql/weavedb/input_sql.js +500 -0
  55. package/dist/weavesql/weavedb/integration_sql.d.ts +236 -0
  56. package/dist/weavesql/weavedb/integration_sql.js +377 -0
  57. package/dist/weavesql/weavedb/project_sql.d.ts +29 -5
  58. package/dist/weavesql/weavedb/project_sql.js +73 -37
  59. package/dist/weavesql/weavedb/report_sql.d.ts +192 -0
  60. package/dist/weavesql/weavedb/report_sql.js +308 -0
  61. package/dist/weavesql/weavedb/requirement_sql.d.ts +231 -0
  62. package/dist/weavesql/weavedb/requirement_sql.js +399 -0
  63. package/dist/weavesql/weavedb/run_sql.d.ts +283 -0
  64. package/dist/weavesql/weavedb/run_sql.js +462 -0
  65. package/dist/weavesql/weavedb/suite_sql.d.ts +354 -0
  66. package/dist/weavesql/weavedb/suite_sql.js +631 -0
  67. package/dist/weavesql/weavedb/test_case_sql.d.ts +325 -0
  68. package/dist/weavesql/weavedb/test_case_sql.js +563 -0
  69. package/dist/weavesql/weavedb/test_script_sql.d.ts +354 -0
  70. package/dist/weavesql/weavedb/test_script_sql.js +605 -0
  71. package/dist/weavesql/weavedb/traceability_sql.d.ts +117 -0
  72. package/dist/weavesql/weavedb/traceability_sql.js +363 -0
  73. package/dist/weavesql/weavedb/workflow_sql.d.ts +30 -5
  74. package/dist/weavesql/weavedb/workflow_sql.js +76 -38
  75. package/package.json +1 -1
@@ -0,0 +1,399 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.deleteRequirementSourceRefQuery = exports.listRequirementSourceRefsQuery = exports.addRequirementSourceRefQuery = exports.listWorkflowRequirementBindingsQuery = exports.detachRequirementFromWorkflowQuery = exports.attachRequirementToWorkflowQuery = exports.deleteRequirementQuery = exports.archiveRequirementQuery = exports.updateRequirementQuery = exports.listRequirementsByWorkflowQuery = exports.listRequirementsByProjectQuery = exports.getRequirementQuery = exports.createRequirementQuery = void 0;
4
+ exports.createRequirement = createRequirement;
5
+ exports.getRequirement = getRequirement;
6
+ exports.listRequirementsByProject = listRequirementsByProject;
7
+ exports.listRequirementsByWorkflow = listRequirementsByWorkflow;
8
+ exports.updateRequirement = updateRequirement;
9
+ exports.archiveRequirement = archiveRequirement;
10
+ exports.deleteRequirement = deleteRequirement;
11
+ exports.attachRequirementToWorkflow = attachRequirementToWorkflow;
12
+ exports.detachRequirementFromWorkflow = detachRequirementFromWorkflow;
13
+ exports.listWorkflowRequirementBindings = listWorkflowRequirementBindings;
14
+ exports.addRequirementSourceRef = addRequirementSourceRef;
15
+ exports.listRequirementSourceRefs = listRequirementSourceRefs;
16
+ exports.deleteRequirementSourceRef = deleteRequirementSourceRef;
17
+ exports.createRequirementQuery = `-- name: CreateRequirement :one
18
+ INSERT INTO weave_v1.requirement (
19
+ id,
20
+ project_id,
21
+ key,
22
+ title,
23
+ description,
24
+ status,
25
+ priority,
26
+ confidence,
27
+ metadata
28
+ )
29
+ VALUES (
30
+ $1,
31
+ $2,
32
+ $3,
33
+ $4,
34
+ $5,
35
+ $6,
36
+ $7,
37
+ $8,
38
+ $9
39
+ )
40
+ RETURNING id, project_id, key, title, description, status, priority, confidence, metadata, created_at, updated_at, archived_at`;
41
+ async function createRequirement(client, args) {
42
+ const result = await client.query({
43
+ text: exports.createRequirementQuery,
44
+ values: [args.id, args.projectId, args.key, args.title, args.description, args.status, args.priority, args.confidence, args.metadata],
45
+ rowMode: "array"
46
+ });
47
+ if (result.rows.length !== 1) {
48
+ return null;
49
+ }
50
+ const row = result.rows[0];
51
+ return {
52
+ id: row[0],
53
+ projectId: row[1],
54
+ key: row[2],
55
+ title: row[3],
56
+ description: row[4],
57
+ status: row[5],
58
+ priority: row[6],
59
+ confidence: row[7],
60
+ metadata: row[8],
61
+ createdAt: row[9],
62
+ updatedAt: row[10],
63
+ archivedAt: row[11]
64
+ };
65
+ }
66
+ exports.getRequirementQuery = `-- name: GetRequirement :one
67
+ SELECT id, project_id, key, title, description, status, priority, confidence, metadata, created_at, updated_at, archived_at
68
+ FROM weave_v1.requirement
69
+ WHERE id = $1
70
+ AND project_id = $2`;
71
+ async function getRequirement(client, args) {
72
+ const result = await client.query({
73
+ text: exports.getRequirementQuery,
74
+ values: [args.id, args.projectId],
75
+ rowMode: "array"
76
+ });
77
+ if (result.rows.length !== 1) {
78
+ return null;
79
+ }
80
+ const row = result.rows[0];
81
+ return {
82
+ id: row[0],
83
+ projectId: row[1],
84
+ key: row[2],
85
+ title: row[3],
86
+ description: row[4],
87
+ status: row[5],
88
+ priority: row[6],
89
+ confidence: row[7],
90
+ metadata: row[8],
91
+ createdAt: row[9],
92
+ updatedAt: row[10],
93
+ archivedAt: row[11]
94
+ };
95
+ }
96
+ exports.listRequirementsByProjectQuery = `-- name: ListRequirementsByProject :many
97
+ SELECT id, project_id, key, title, description, status, priority, confidence, metadata, created_at, updated_at, archived_at
98
+ FROM weave_v1.requirement
99
+ WHERE project_id = $1
100
+ AND ($2::BOOLEAN OR archived_at IS NULL)
101
+ ORDER BY updated_at DESC
102
+ LIMIT $4
103
+ OFFSET $3`;
104
+ async function listRequirementsByProject(client, args) {
105
+ const result = await client.query({
106
+ text: exports.listRequirementsByProjectQuery,
107
+ values: [args.projectId, args.includeArchived, args.pageOffset, args.pageSize],
108
+ rowMode: "array"
109
+ });
110
+ return result.rows.map(row => {
111
+ return {
112
+ id: row[0],
113
+ projectId: row[1],
114
+ key: row[2],
115
+ title: row[3],
116
+ description: row[4],
117
+ status: row[5],
118
+ priority: row[6],
119
+ confidence: row[7],
120
+ metadata: row[8],
121
+ createdAt: row[9],
122
+ updatedAt: row[10],
123
+ archivedAt: row[11]
124
+ };
125
+ });
126
+ }
127
+ exports.listRequirementsByWorkflowQuery = `-- name: ListRequirementsByWorkflow :many
128
+ SELECT r.id, r.project_id, r.key, r.title, r.description, r.status, r.priority, r.confidence, r.metadata, r.created_at, r.updated_at, r.archived_at
129
+ FROM weave_v1.requirement r
130
+ INNER JOIN weave_v1.workflow_requirement b
131
+ ON b.requirement_id = r.id
132
+ AND b.project_id = r.project_id
133
+ WHERE b.project_id = $1
134
+ AND b.workflow_id = $2
135
+ AND ($3::BOOLEAN OR r.archived_at IS NULL)
136
+ ORDER BY r.updated_at DESC
137
+ LIMIT $5
138
+ OFFSET $4`;
139
+ async function listRequirementsByWorkflow(client, args) {
140
+ const result = await client.query({
141
+ text: exports.listRequirementsByWorkflowQuery,
142
+ values: [args.projectId, args.workflowId, args.includeArchived, args.pageOffset, args.pageSize],
143
+ rowMode: "array"
144
+ });
145
+ return result.rows.map(row => {
146
+ return {
147
+ id: row[0],
148
+ projectId: row[1],
149
+ key: row[2],
150
+ title: row[3],
151
+ description: row[4],
152
+ status: row[5],
153
+ priority: row[6],
154
+ confidence: row[7],
155
+ metadata: row[8],
156
+ createdAt: row[9],
157
+ updatedAt: row[10],
158
+ archivedAt: row[11]
159
+ };
160
+ });
161
+ }
162
+ exports.updateRequirementQuery = `-- name: UpdateRequirement :one
163
+ UPDATE weave_v1.requirement
164
+ SET key = $1,
165
+ title = $2,
166
+ description = $3,
167
+ status = $4,
168
+ priority = $5,
169
+ confidence = $6,
170
+ metadata = $7,
171
+ updated_at = NOW()
172
+ WHERE id = $8
173
+ AND project_id = $9
174
+ RETURNING id, project_id, key, title, description, status, priority, confidence, metadata, created_at, updated_at, archived_at`;
175
+ async function updateRequirement(client, args) {
176
+ const result = await client.query({
177
+ text: exports.updateRequirementQuery,
178
+ values: [args.key, args.title, args.description, args.status, args.priority, args.confidence, args.metadata, args.id, args.projectId],
179
+ rowMode: "array"
180
+ });
181
+ if (result.rows.length !== 1) {
182
+ return null;
183
+ }
184
+ const row = result.rows[0];
185
+ return {
186
+ id: row[0],
187
+ projectId: row[1],
188
+ key: row[2],
189
+ title: row[3],
190
+ description: row[4],
191
+ status: row[5],
192
+ priority: row[6],
193
+ confidence: row[7],
194
+ metadata: row[8],
195
+ createdAt: row[9],
196
+ updatedAt: row[10],
197
+ archivedAt: row[11]
198
+ };
199
+ }
200
+ exports.archiveRequirementQuery = `-- name: ArchiveRequirement :one
201
+ UPDATE weave_v1.requirement
202
+ SET status = 'archived',
203
+ archived_at = NOW(),
204
+ updated_at = NOW()
205
+ WHERE id = $1
206
+ AND project_id = $2
207
+ RETURNING id, project_id, key, title, description, status, priority, confidence, metadata, created_at, updated_at, archived_at`;
208
+ async function archiveRequirement(client, args) {
209
+ const result = await client.query({
210
+ text: exports.archiveRequirementQuery,
211
+ values: [args.id, args.projectId],
212
+ rowMode: "array"
213
+ });
214
+ if (result.rows.length !== 1) {
215
+ return null;
216
+ }
217
+ const row = result.rows[0];
218
+ return {
219
+ id: row[0],
220
+ projectId: row[1],
221
+ key: row[2],
222
+ title: row[3],
223
+ description: row[4],
224
+ status: row[5],
225
+ priority: row[6],
226
+ confidence: row[7],
227
+ metadata: row[8],
228
+ createdAt: row[9],
229
+ updatedAt: row[10],
230
+ archivedAt: row[11]
231
+ };
232
+ }
233
+ exports.deleteRequirementQuery = `-- name: DeleteRequirement :exec
234
+ DELETE
235
+ FROM weave_v1.requirement
236
+ WHERE id = $1
237
+ AND project_id = $2`;
238
+ async function deleteRequirement(client, args) {
239
+ await client.query({
240
+ text: exports.deleteRequirementQuery,
241
+ values: [args.id, args.projectId],
242
+ rowMode: "array"
243
+ });
244
+ }
245
+ exports.attachRequirementToWorkflowQuery = `-- name: AttachRequirementToWorkflow :one
246
+ INSERT INTO weave_v1.workflow_requirement (
247
+ project_id,
248
+ workflow_id,
249
+ requirement_id,
250
+ attached_by,
251
+ metadata
252
+ )
253
+ VALUES (
254
+ $1,
255
+ $2,
256
+ $3,
257
+ $4,
258
+ $5
259
+ )
260
+ ON CONFLICT (workflow_id, requirement_id) DO UPDATE
261
+ SET attached_by = EXCLUDED.attached_by,
262
+ metadata = EXCLUDED.metadata,
263
+ attached_at = NOW()
264
+ RETURNING project_id, workflow_id, requirement_id, attached_by, metadata, attached_at`;
265
+ async function attachRequirementToWorkflow(client, args) {
266
+ const result = await client.query({
267
+ text: exports.attachRequirementToWorkflowQuery,
268
+ values: [args.projectId, args.workflowId, args.requirementId, args.attachedBy, args.metadata],
269
+ rowMode: "array"
270
+ });
271
+ if (result.rows.length !== 1) {
272
+ return null;
273
+ }
274
+ const row = result.rows[0];
275
+ return {
276
+ projectId: row[0],
277
+ workflowId: row[1],
278
+ requirementId: row[2],
279
+ attachedBy: row[3],
280
+ metadata: row[4],
281
+ attachedAt: row[5]
282
+ };
283
+ }
284
+ exports.detachRequirementFromWorkflowQuery = `-- name: DetachRequirementFromWorkflow :exec
285
+ DELETE
286
+ FROM weave_v1.workflow_requirement
287
+ WHERE project_id = $1
288
+ AND workflow_id = $2
289
+ AND requirement_id = $3`;
290
+ async function detachRequirementFromWorkflow(client, args) {
291
+ await client.query({
292
+ text: exports.detachRequirementFromWorkflowQuery,
293
+ values: [args.projectId, args.workflowId, args.requirementId],
294
+ rowMode: "array"
295
+ });
296
+ }
297
+ exports.listWorkflowRequirementBindingsQuery = `-- name: ListWorkflowRequirementBindings :many
298
+ SELECT project_id, workflow_id, requirement_id, attached_by, metadata, attached_at
299
+ FROM weave_v1.workflow_requirement
300
+ WHERE project_id = $1
301
+ AND workflow_id = $2
302
+ ORDER BY attached_at DESC
303
+ LIMIT $4
304
+ OFFSET $3`;
305
+ async function listWorkflowRequirementBindings(client, args) {
306
+ const result = await client.query({
307
+ text: exports.listWorkflowRequirementBindingsQuery,
308
+ values: [args.projectId, args.workflowId, args.pageOffset, args.pageSize],
309
+ rowMode: "array"
310
+ });
311
+ return result.rows.map(row => {
312
+ return {
313
+ projectId: row[0],
314
+ workflowId: row[1],
315
+ requirementId: row[2],
316
+ attachedBy: row[3],
317
+ metadata: row[4],
318
+ attachedAt: row[5]
319
+ };
320
+ });
321
+ }
322
+ exports.addRequirementSourceRefQuery = `-- name: AddRequirementSourceRef :one
323
+ INSERT INTO weave_v1.requirement_source_ref (
324
+ id,
325
+ requirement_id,
326
+ input_source_id,
327
+ input_version_id,
328
+ excerpt,
329
+ locator
330
+ )
331
+ VALUES (
332
+ $1,
333
+ $2,
334
+ $3,
335
+ $4,
336
+ $5,
337
+ $6
338
+ )
339
+ RETURNING id, requirement_id, input_source_id, input_version_id, excerpt, locator, created_at`;
340
+ async function addRequirementSourceRef(client, args) {
341
+ const result = await client.query({
342
+ text: exports.addRequirementSourceRefQuery,
343
+ values: [args.id, args.requirementId, args.inputSourceId, args.inputVersionId, args.excerpt, args.locator],
344
+ rowMode: "array"
345
+ });
346
+ if (result.rows.length !== 1) {
347
+ return null;
348
+ }
349
+ const row = result.rows[0];
350
+ return {
351
+ id: row[0],
352
+ requirementId: row[1],
353
+ inputSourceId: row[2],
354
+ inputVersionId: row[3],
355
+ excerpt: row[4],
356
+ locator: row[5],
357
+ createdAt: row[6]
358
+ };
359
+ }
360
+ exports.listRequirementSourceRefsQuery = `-- name: ListRequirementSourceRefs :many
361
+ SELECT rsr.id, rsr.requirement_id, rsr.input_source_id, rsr.input_version_id, rsr.excerpt, rsr.locator, rsr.created_at
362
+ FROM weave_v1.requirement_source_ref rsr
363
+ INNER JOIN weave_v1.requirement r ON r.id = rsr.requirement_id
364
+ WHERE rsr.requirement_id = $1
365
+ AND r.project_id = $2
366
+ ORDER BY rsr.created_at DESC`;
367
+ async function listRequirementSourceRefs(client, args) {
368
+ const result = await client.query({
369
+ text: exports.listRequirementSourceRefsQuery,
370
+ values: [args.requirementId, args.projectId],
371
+ rowMode: "array"
372
+ });
373
+ return result.rows.map(row => {
374
+ return {
375
+ id: row[0],
376
+ requirementId: row[1],
377
+ inputSourceId: row[2],
378
+ inputVersionId: row[3],
379
+ excerpt: row[4],
380
+ locator: row[5],
381
+ createdAt: row[6]
382
+ };
383
+ });
384
+ }
385
+ exports.deleteRequirementSourceRefQuery = `-- name: DeleteRequirementSourceRef :exec
386
+ DELETE
387
+ FROM weave_v1.requirement_source_ref rsr
388
+ USING weave_v1.requirement r
389
+ WHERE rsr.id = $1
390
+ AND rsr.requirement_id = $2
391
+ AND rsr.requirement_id = r.id
392
+ AND r.project_id = $3`;
393
+ async function deleteRequirementSourceRef(client, args) {
394
+ await client.query({
395
+ text: exports.deleteRequirementSourceRefQuery,
396
+ values: [args.id, args.requirementId, args.projectId],
397
+ rowMode: "array"
398
+ });
399
+ }
@@ -0,0 +1,283 @@
1
+ import { QueryArrayConfig, QueryArrayResult } from "pg";
2
+ interface Client {
3
+ query: (config: QueryArrayConfig) => Promise<QueryArrayResult>;
4
+ }
5
+ export declare const createTestRunQuery = "-- name: CreateTestRun :one\nINSERT INTO weave_v1.test_run (\n id,\n project_id,\n workflow_id,\n test_suite_id,\n status,\n environment,\n triggered_by,\n runtime_config,\n summary,\n trace_id,\n queued_at\n)\nVALUES (\n $1,\n $2,\n $3,\n $4,\n $5,\n $6,\n $7,\n $8,\n $9,\n $10,\n NOW()\n)\nRETURNING id, project_id, workflow_id, test_suite_id, status, environment, triggered_by, runtime_config, summary, trace_id, queued_at, started_at, finished_at, created_at, updated_at";
6
+ export interface CreateTestRunArgs {
7
+ id: string;
8
+ projectId: string;
9
+ workflowId: string;
10
+ testSuiteId: string | null;
11
+ status: string;
12
+ environment: string;
13
+ triggeredBy: string;
14
+ runtimeConfig: any;
15
+ summary: any;
16
+ traceId: string;
17
+ }
18
+ export interface CreateTestRunRow {
19
+ id: string;
20
+ projectId: string;
21
+ workflowId: string;
22
+ testSuiteId: string | null;
23
+ status: string;
24
+ environment: string;
25
+ triggeredBy: string;
26
+ runtimeConfig: any;
27
+ summary: any;
28
+ traceId: string;
29
+ queuedAt: Date;
30
+ startedAt: Date | null;
31
+ finishedAt: Date | null;
32
+ createdAt: Date;
33
+ updatedAt: Date;
34
+ }
35
+ export declare function createTestRun(client: Client, args: CreateTestRunArgs): Promise<CreateTestRunRow | null>;
36
+ export declare const getTestRunQuery = "-- name: GetTestRun :one\nSELECT id, project_id, workflow_id, test_suite_id, status, environment, triggered_by, runtime_config, summary, trace_id, queued_at, started_at, finished_at, created_at, updated_at\nFROM weave_v1.test_run\nWHERE id = $1\n AND project_id = $2\n AND workflow_id = $3";
37
+ export interface GetTestRunArgs {
38
+ id: string;
39
+ projectId: string;
40
+ workflowId: string;
41
+ }
42
+ export interface GetTestRunRow {
43
+ id: string;
44
+ projectId: string;
45
+ workflowId: string;
46
+ testSuiteId: string | null;
47
+ status: string;
48
+ environment: string;
49
+ triggeredBy: string;
50
+ runtimeConfig: any;
51
+ summary: any;
52
+ traceId: string;
53
+ queuedAt: Date;
54
+ startedAt: Date | null;
55
+ finishedAt: Date | null;
56
+ createdAt: Date;
57
+ updatedAt: Date;
58
+ }
59
+ export declare function getTestRun(client: Client, args: GetTestRunArgs): Promise<GetTestRunRow | null>;
60
+ export declare const listTestRunsByProjectQuery = "-- name: ListTestRunsByProject :many\nSELECT id, project_id, workflow_id, test_suite_id, status, environment, triggered_by, runtime_config, summary, trace_id, queued_at, started_at, finished_at, created_at, updated_at\nFROM weave_v1.test_run\nWHERE project_id = $1\nORDER BY created_at DESC\nLIMIT $3\nOFFSET $2";
61
+ export interface ListTestRunsByProjectArgs {
62
+ projectId: string;
63
+ pageOffset: string;
64
+ pageSize: string;
65
+ }
66
+ export interface ListTestRunsByProjectRow {
67
+ id: string;
68
+ projectId: string;
69
+ workflowId: string;
70
+ testSuiteId: string | null;
71
+ status: string;
72
+ environment: string;
73
+ triggeredBy: string;
74
+ runtimeConfig: any;
75
+ summary: any;
76
+ traceId: string;
77
+ queuedAt: Date;
78
+ startedAt: Date | null;
79
+ finishedAt: Date | null;
80
+ createdAt: Date;
81
+ updatedAt: Date;
82
+ }
83
+ export declare function listTestRunsByProject(client: Client, args: ListTestRunsByProjectArgs): Promise<ListTestRunsByProjectRow[]>;
84
+ export declare const listTestRunsByWorkflowQuery = "-- name: ListTestRunsByWorkflow :many\nSELECT id, project_id, workflow_id, test_suite_id, status, environment, triggered_by, runtime_config, summary, trace_id, queued_at, started_at, finished_at, created_at, updated_at\nFROM weave_v1.test_run\nWHERE project_id = $1\n AND workflow_id = $2\nORDER BY created_at DESC\nLIMIT $4\nOFFSET $3";
85
+ export interface ListTestRunsByWorkflowArgs {
86
+ projectId: string;
87
+ workflowId: string;
88
+ pageOffset: string;
89
+ pageSize: string;
90
+ }
91
+ export interface ListTestRunsByWorkflowRow {
92
+ id: string;
93
+ projectId: string;
94
+ workflowId: string;
95
+ testSuiteId: string | null;
96
+ status: string;
97
+ environment: string;
98
+ triggeredBy: string;
99
+ runtimeConfig: any;
100
+ summary: any;
101
+ traceId: string;
102
+ queuedAt: Date;
103
+ startedAt: Date | null;
104
+ finishedAt: Date | null;
105
+ createdAt: Date;
106
+ updatedAt: Date;
107
+ }
108
+ export declare function listTestRunsByWorkflow(client: Client, args: ListTestRunsByWorkflowArgs): Promise<ListTestRunsByWorkflowRow[]>;
109
+ export declare const updateTestRunStatusQuery = "-- name: UpdateTestRunStatus :one\nUPDATE weave_v1.test_run\nSET status = $1,\n started_at = $2,\n finished_at = $3,\n summary = $4,\n updated_at = NOW()\nWHERE id = $5\n AND project_id = $6\n AND workflow_id = $7\nRETURNING id, project_id, workflow_id, test_suite_id, status, environment, triggered_by, runtime_config, summary, trace_id, queued_at, started_at, finished_at, created_at, updated_at";
110
+ export interface UpdateTestRunStatusArgs {
111
+ status: string;
112
+ startedAt: Date | null;
113
+ finishedAt: Date | null;
114
+ summary: any;
115
+ id: string;
116
+ projectId: string;
117
+ workflowId: string;
118
+ }
119
+ export interface UpdateTestRunStatusRow {
120
+ id: string;
121
+ projectId: string;
122
+ workflowId: string;
123
+ testSuiteId: string | null;
124
+ status: string;
125
+ environment: string;
126
+ triggeredBy: string;
127
+ runtimeConfig: any;
128
+ summary: any;
129
+ traceId: string;
130
+ queuedAt: Date;
131
+ startedAt: Date | null;
132
+ finishedAt: Date | null;
133
+ createdAt: Date;
134
+ updatedAt: Date;
135
+ }
136
+ export declare function updateTestRunStatus(client: Client, args: UpdateTestRunStatusArgs): Promise<UpdateTestRunStatusRow | null>;
137
+ export declare const cancelTestRunQuery = "-- name: CancelTestRun :one\nUPDATE weave_v1.test_run\nSET status = 'canceled',\n finished_at = NOW(),\n updated_at = NOW()\nWHERE id = $1\n AND project_id = $2\n AND workflow_id = $3\nRETURNING id, project_id, workflow_id, test_suite_id, status, environment, triggered_by, runtime_config, summary, trace_id, queued_at, started_at, finished_at, created_at, updated_at";
138
+ export interface CancelTestRunArgs {
139
+ id: string;
140
+ projectId: string;
141
+ workflowId: string;
142
+ }
143
+ export interface CancelTestRunRow {
144
+ id: string;
145
+ projectId: string;
146
+ workflowId: string;
147
+ testSuiteId: string | null;
148
+ status: string;
149
+ environment: string;
150
+ triggeredBy: string;
151
+ runtimeConfig: any;
152
+ summary: any;
153
+ traceId: string;
154
+ queuedAt: Date;
155
+ startedAt: Date | null;
156
+ finishedAt: Date | null;
157
+ createdAt: Date;
158
+ updatedAt: Date;
159
+ }
160
+ export declare function cancelTestRun(client: Client, args: CancelTestRunArgs): Promise<CancelTestRunRow | null>;
161
+ export declare const upsertTestRunCaseResultQuery = "-- name: UpsertTestRunCaseResult :one\nINSERT INTO weave_v1.test_run_case_result (\n id,\n test_run_id,\n test_case_id,\n test_script_id,\n status,\n duration_ms,\n error_summary,\n assertion_count,\n failed_assertion_count,\n details,\n started_at,\n finished_at\n)\nVALUES (\n $1,\n $2,\n $3,\n $4,\n $5,\n $6,\n $7,\n $8,\n $9,\n $10,\n $11,\n $12\n)\nON CONFLICT (id) DO UPDATE\nSET status = EXCLUDED.status,\n duration_ms = EXCLUDED.duration_ms,\n error_summary = EXCLUDED.error_summary,\n assertion_count = EXCLUDED.assertion_count,\n failed_assertion_count = EXCLUDED.failed_assertion_count,\n details = EXCLUDED.details,\n started_at = EXCLUDED.started_at,\n finished_at = EXCLUDED.finished_at,\n updated_at = NOW()\nRETURNING id, test_run_id, test_case_id, test_script_id, status, duration_ms, error_summary, assertion_count, failed_assertion_count, details, started_at, finished_at, created_at, updated_at";
162
+ export interface UpsertTestRunCaseResultArgs {
163
+ id: string;
164
+ testRunId: string;
165
+ testCaseId: string | null;
166
+ testScriptId: string | null;
167
+ status: string;
168
+ durationMs: string;
169
+ errorSummary: string;
170
+ assertionCount: number;
171
+ failedAssertionCount: number;
172
+ details: any;
173
+ startedAt: Date | null;
174
+ finishedAt: Date | null;
175
+ }
176
+ export interface UpsertTestRunCaseResultRow {
177
+ id: string;
178
+ testRunId: string;
179
+ testCaseId: string | null;
180
+ testScriptId: string | null;
181
+ status: string;
182
+ durationMs: string;
183
+ errorSummary: string;
184
+ assertionCount: number;
185
+ failedAssertionCount: number;
186
+ details: any;
187
+ startedAt: Date | null;
188
+ finishedAt: Date | null;
189
+ createdAt: Date;
190
+ updatedAt: Date;
191
+ }
192
+ export declare function upsertTestRunCaseResult(client: Client, args: UpsertTestRunCaseResultArgs): Promise<UpsertTestRunCaseResultRow | null>;
193
+ export declare const listTestRunCaseResultsQuery = "-- name: ListTestRunCaseResults :many\nSELECT cr.id, cr.test_run_id, cr.test_case_id, cr.test_script_id, cr.status, cr.duration_ms, cr.error_summary, cr.assertion_count, cr.failed_assertion_count, cr.details, cr.started_at, cr.finished_at, cr.created_at, cr.updated_at\nFROM weave_v1.test_run_case_result cr\n INNER JOIN weave_v1.test_run r ON r.id = cr.test_run_id\nWHERE cr.test_run_id = $1\n AND r.project_id = $2\n AND r.workflow_id = $3\nORDER BY cr.created_at ASC\nLIMIT $5\nOFFSET $4";
194
+ export interface ListTestRunCaseResultsArgs {
195
+ testRunId: string;
196
+ projectId: string;
197
+ workflowId: string;
198
+ pageOffset: string;
199
+ pageSize: string;
200
+ }
201
+ export interface ListTestRunCaseResultsRow {
202
+ id: string;
203
+ testRunId: string;
204
+ testCaseId: string | null;
205
+ testScriptId: string | null;
206
+ status: string;
207
+ durationMs: string;
208
+ errorSummary: string;
209
+ assertionCount: number;
210
+ failedAssertionCount: number;
211
+ details: any;
212
+ startedAt: Date | null;
213
+ finishedAt: Date | null;
214
+ createdAt: Date;
215
+ updatedAt: Date;
216
+ }
217
+ export declare function listTestRunCaseResults(client: Client, args: ListTestRunCaseResultsArgs): Promise<ListTestRunCaseResultsRow[]>;
218
+ export declare const createTestRunArtifactQuery = "-- name: CreateTestRunArtifact :one\nINSERT INTO weave_v1.test_run_artifact (\n id,\n test_run_id,\n test_run_case_result_id,\n artifact_type,\n name,\n storage_connection_id,\n uri,\n content_type,\n size_bytes,\n checksum,\n metadata\n)\nVALUES (\n $1,\n $2,\n $3,\n $4,\n $5,\n $6,\n $7,\n $8,\n $9,\n $10,\n $11\n)\nRETURNING id, test_run_id, test_run_case_result_id, artifact_type, name, storage_connection_id, uri, content_type, size_bytes, checksum, metadata, created_at";
219
+ export interface CreateTestRunArtifactArgs {
220
+ id: string;
221
+ testRunId: string;
222
+ testRunCaseResultId: string | null;
223
+ artifactType: string;
224
+ name: string;
225
+ storageConnectionId: string | null;
226
+ uri: string;
227
+ contentType: string;
228
+ sizeBytes: string;
229
+ checksum: string;
230
+ metadata: any;
231
+ }
232
+ export interface CreateTestRunArtifactRow {
233
+ id: string;
234
+ testRunId: string;
235
+ testRunCaseResultId: string | null;
236
+ artifactType: string;
237
+ name: string;
238
+ storageConnectionId: string | null;
239
+ uri: string;
240
+ contentType: string;
241
+ sizeBytes: string;
242
+ checksum: string;
243
+ metadata: any;
244
+ createdAt: Date;
245
+ }
246
+ export declare function createTestRunArtifact(client: Client, args: CreateTestRunArtifactArgs): Promise<CreateTestRunArtifactRow | null>;
247
+ export declare const listTestRunArtifactsQuery = "-- name: ListTestRunArtifacts :many\nSELECT a.id, a.test_run_id, a.test_run_case_result_id, a.artifact_type, a.name, a.storage_connection_id, a.uri, a.content_type, a.size_bytes, a.checksum, a.metadata, a.created_at\nFROM weave_v1.test_run_artifact a\n INNER JOIN weave_v1.test_run r ON r.id = a.test_run_id\nWHERE a.test_run_id = $1\n AND r.project_id = $2\n AND r.workflow_id = $3\n AND ($4::UUID IS NULL OR a.test_run_case_result_id = $4)\nORDER BY a.created_at ASC\nLIMIT $6\nOFFSET $5";
248
+ export interface ListTestRunArtifactsArgs {
249
+ testRunId: string;
250
+ projectId: string;
251
+ workflowId: string;
252
+ testRunCaseResultId: string;
253
+ pageOffset: string;
254
+ pageSize: string;
255
+ }
256
+ export interface ListTestRunArtifactsRow {
257
+ id: string;
258
+ testRunId: string;
259
+ testRunCaseResultId: string | null;
260
+ artifactType: string;
261
+ name: string;
262
+ storageConnectionId: string | null;
263
+ uri: string;
264
+ contentType: string;
265
+ sizeBytes: string;
266
+ checksum: string;
267
+ metadata: any;
268
+ createdAt: Date;
269
+ }
270
+ export declare function listTestRunArtifacts(client: Client, args: ListTestRunArtifactsArgs): Promise<ListTestRunArtifactsRow[]>;
271
+ export declare const getTestRunLiveCountsQuery = "-- name: GetTestRunLiveCounts :one\nSELECT COUNT(*) FILTER ( WHERE status = 'pending')::INTEGER AS pending_count,\n COUNT(*) FILTER ( WHERE status = 'running')::INTEGER AS running_count,\n COUNT(*) FILTER ( WHERE status = 'passed')::INTEGER AS passed_count,\n COUNT(*) FILTER ( WHERE status = 'failed')::INTEGER AS failed_count,\n COUNT(*)::INTEGER AS total_count\nFROM weave_v1.test_run_case_result\nWHERE test_run_id = $1";
272
+ export interface GetTestRunLiveCountsArgs {
273
+ testRunId: string;
274
+ }
275
+ export interface GetTestRunLiveCountsRow {
276
+ pendingCount: number;
277
+ runningCount: number;
278
+ passedCount: number;
279
+ failedCount: number;
280
+ totalCount: number;
281
+ }
282
+ export declare function getTestRunLiveCounts(client: Client, args: GetTestRunLiveCountsArgs): Promise<GetTestRunLiveCountsRow | null>;
283
+ export {};