weave-typescript 0.11.15 → 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 (69) hide show
  1. package/dist/weaveapi/data/v1/data.pb.d.ts +1 -1
  2. package/dist/weaveapi/data/v1/data.pb.js +11 -11
  3. package/dist/weaveapi/data/v1/service.pb.d.ts +89 -6
  4. package/dist/weaveapi/data/v1/service.pb.js +1195 -364
  5. package/dist/weaveapi/input/v1/input.pb.d.ts +1 -1
  6. package/dist/weaveapi/input/v1/input.pb.js +11 -11
  7. package/dist/weaveapi/input/v1/service.pb.d.ts +89 -10
  8. package/dist/weaveapi/input/v1/service.pb.js +1253 -642
  9. package/dist/weaveapi/integration/v1/integration.pb.d.ts +1 -1
  10. package/dist/weaveapi/integration/v1/integration.pb.js +11 -11
  11. package/dist/weaveapi/integration/v1/service.pb.d.ts +89 -7
  12. package/dist/weaveapi/integration/v1/service.pb.js +1164 -390
  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 +2 -0
  18. package/dist/weaveapi/report/v1/report.pb.js +42 -2
  19. package/dist/weaveapi/report/v1/service.pb.d.ts +6 -6
  20. package/dist/weaveapi/report/v1/service.pb.js +416 -121
  21. package/dist/weaveapi/requirement/v1/requirement.pb.d.ts +1 -1
  22. package/dist/weaveapi/requirement/v1/requirement.pb.js +11 -11
  23. package/dist/weaveapi/requirement/v1/service.pb.d.ts +90 -10
  24. package/dist/weaveapi/requirement/v1/service.pb.js +1261 -601
  25. package/dist/weaveapi/run/v1/run.pb.d.ts +1 -0
  26. package/dist/weaveapi/run/v1/run.pb.js +21 -1
  27. package/dist/weaveapi/run/v1/service.pb.d.ts +6 -6
  28. package/dist/weaveapi/run/v1/service.pb.js +448 -126
  29. package/dist/weaveapi/script/v1/script.pb.d.ts +1 -1
  30. package/dist/weaveapi/script/v1/script.pb.js +11 -11
  31. package/dist/weaveapi/script/v1/service.pb.d.ts +90 -14
  32. package/dist/weaveapi/script/v1/service.pb.js +1404 -930
  33. package/dist/weaveapi/suite/v1/service.pb.d.ts +178 -12
  34. package/dist/weaveapi/suite/v1/service.pb.js +2631 -979
  35. package/dist/weaveapi/suite/v1/suite.pb.d.ts +2 -2
  36. package/dist/weaveapi/suite/v1/suite.pb.js +22 -22
  37. package/dist/weaveapi/testcase/v1/service.pb.d.ts +90 -14
  38. package/dist/weaveapi/testcase/v1/service.pb.js +1332 -856
  39. package/dist/weaveapi/testcase/v1/testcase.pb.d.ts +1 -1
  40. package/dist/weaveapi/testcase/v1/testcase.pb.js +11 -11
  41. package/dist/weaveapi/workflow/v1/service.pb.d.ts +26 -0
  42. package/dist/weaveapi/workflow/v1/service.pb.js +293 -5
  43. package/dist/weaveapi/workflow/v1/workflow.pb.d.ts +1 -0
  44. package/dist/weaveapi/workflow/v1/workflow.pb.js +17 -1
  45. package/dist/weavesql/weavedb/data_asset_sql.d.ts +81 -16
  46. package/dist/weavesql/weavedb/data_asset_sql.js +142 -24
  47. package/dist/weavesql/weavedb/input_sql.d.ts +88 -25
  48. package/dist/weavesql/weavedb/input_sql.js +150 -34
  49. package/dist/weavesql/weavedb/integration_sql.d.ts +85 -19
  50. package/dist/weavesql/weavedb/integration_sql.js +147 -28
  51. package/dist/weavesql/weavedb/project_sql.d.ts +29 -5
  52. package/dist/weavesql/weavedb/project_sql.js +73 -37
  53. package/dist/weavesql/weavedb/report_sql.d.ts +61 -7
  54. package/dist/weavesql/weavedb/report_sql.js +157 -81
  55. package/dist/weavesql/weavedb/requirement_sql.d.ts +83 -20
  56. package/dist/weavesql/weavedb/requirement_sql.js +144 -28
  57. package/dist/weavesql/weavedb/run_sql.d.ts +44 -8
  58. package/dist/weavesql/weavedb/run_sql.js +140 -93
  59. package/dist/weavesql/weavedb/suite_sql.d.ts +156 -30
  60. package/dist/weavesql/weavedb/suite_sql.js +274 -42
  61. package/dist/weavesql/weavedb/test_case_sql.d.ts +91 -27
  62. package/dist/weavesql/weavedb/test_case_sql.js +153 -36
  63. package/dist/weavesql/weavedb/test_script_sql.d.ts +91 -27
  64. package/dist/weavesql/weavedb/test_script_sql.js +153 -36
  65. package/dist/weavesql/weavedb/traceability_sql.d.ts +62 -4
  66. package/dist/weavesql/weavedb/traceability_sql.js +245 -37
  67. package/dist/weavesql/weavedb/workflow_sql.d.ts +30 -5
  68. package/dist/weavesql/weavedb/workflow_sql.js +76 -38
  69. package/package.json +1 -1
@@ -1,19 +1,23 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.deleteRequirementSourceRefQuery = exports.listRequirementSourceRefsQuery = exports.addRequirementSourceRefQuery = exports.deleteRequirementQuery = exports.archiveRequirementQuery = exports.updateRequirementQuery = exports.listRequirementsByWorkflowQuery = exports.getRequirementQuery = exports.createRequirementQuery = void 0;
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
4
  exports.createRequirement = createRequirement;
5
5
  exports.getRequirement = getRequirement;
6
+ exports.listRequirementsByProject = listRequirementsByProject;
6
7
  exports.listRequirementsByWorkflow = listRequirementsByWorkflow;
7
8
  exports.updateRequirement = updateRequirement;
8
9
  exports.archiveRequirement = archiveRequirement;
9
10
  exports.deleteRequirement = deleteRequirement;
11
+ exports.attachRequirementToWorkflow = attachRequirementToWorkflow;
12
+ exports.detachRequirementFromWorkflow = detachRequirementFromWorkflow;
13
+ exports.listWorkflowRequirementBindings = listWorkflowRequirementBindings;
10
14
  exports.addRequirementSourceRef = addRequirementSourceRef;
11
15
  exports.listRequirementSourceRefs = listRequirementSourceRefs;
12
16
  exports.deleteRequirementSourceRef = deleteRequirementSourceRef;
13
17
  exports.createRequirementQuery = `-- name: CreateRequirement :one
14
18
  INSERT INTO weave_v1.requirement (
15
19
  id,
16
- workflow_id,
20
+ project_id,
17
21
  key,
18
22
  title,
19
23
  description,
@@ -33,11 +37,11 @@ VALUES (
33
37
  $8,
34
38
  $9
35
39
  )
36
- RETURNING id, workflow_id, key, title, description, status, priority, confidence, metadata, created_at, updated_at, archived_at`;
40
+ RETURNING id, project_id, key, title, description, status, priority, confidence, metadata, created_at, updated_at, archived_at`;
37
41
  async function createRequirement(client, args) {
38
42
  const result = await client.query({
39
43
  text: exports.createRequirementQuery,
40
- values: [args.id, args.workflowId, args.key, args.title, args.description, args.status, args.priority, args.confidence, args.metadata],
44
+ values: [args.id, args.projectId, args.key, args.title, args.description, args.status, args.priority, args.confidence, args.metadata],
41
45
  rowMode: "array"
42
46
  });
43
47
  if (result.rows.length !== 1) {
@@ -46,7 +50,7 @@ async function createRequirement(client, args) {
46
50
  const row = result.rows[0];
47
51
  return {
48
52
  id: row[0],
49
- workflowId: row[1],
53
+ projectId: row[1],
50
54
  key: row[2],
51
55
  title: row[3],
52
56
  description: row[4],
@@ -60,14 +64,14 @@ async function createRequirement(client, args) {
60
64
  };
61
65
  }
62
66
  exports.getRequirementQuery = `-- name: GetRequirement :one
63
- SELECT id, workflow_id, key, title, description, status, priority, confidence, metadata, created_at, updated_at, archived_at
67
+ SELECT id, project_id, key, title, description, status, priority, confidence, metadata, created_at, updated_at, archived_at
64
68
  FROM weave_v1.requirement
65
69
  WHERE id = $1
66
- AND workflow_id = $2`;
70
+ AND project_id = $2`;
67
71
  async function getRequirement(client, args) {
68
72
  const result = await client.query({
69
73
  text: exports.getRequirementQuery,
70
- values: [args.id, args.workflowId],
74
+ values: [args.id, args.projectId],
71
75
  rowMode: "array"
72
76
  });
73
77
  if (result.rows.length !== 1) {
@@ -76,7 +80,7 @@ async function getRequirement(client, args) {
76
80
  const row = result.rows[0];
77
81
  return {
78
82
  id: row[0],
79
- workflowId: row[1],
83
+ projectId: row[1],
80
84
  key: row[2],
81
85
  title: row[3],
82
86
  description: row[4],
@@ -89,24 +93,59 @@ async function getRequirement(client, args) {
89
93
  archivedAt: row[11]
90
94
  };
91
95
  }
92
- exports.listRequirementsByWorkflowQuery = `-- name: ListRequirementsByWorkflow :many
93
- SELECT id, workflow_id, key, title, description, status, priority, confidence, metadata, created_at, updated_at, archived_at
96
+ exports.listRequirementsByProjectQuery = `-- name: ListRequirementsByProject :many
97
+ SELECT id, project_id, key, title, description, status, priority, confidence, metadata, created_at, updated_at, archived_at
94
98
  FROM weave_v1.requirement
95
- WHERE workflow_id = $1
99
+ WHERE project_id = $1
96
100
  AND ($2::BOOLEAN OR archived_at IS NULL)
97
101
  ORDER BY updated_at DESC
98
102
  LIMIT $4
99
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`;
100
139
  async function listRequirementsByWorkflow(client, args) {
101
140
  const result = await client.query({
102
141
  text: exports.listRequirementsByWorkflowQuery,
103
- values: [args.workflowId, args.includeArchived, args.pageOffset, args.pageSize],
142
+ values: [args.projectId, args.workflowId, args.includeArchived, args.pageOffset, args.pageSize],
104
143
  rowMode: "array"
105
144
  });
106
145
  return result.rows.map(row => {
107
146
  return {
108
147
  id: row[0],
109
- workflowId: row[1],
148
+ projectId: row[1],
110
149
  key: row[2],
111
150
  title: row[3],
112
151
  description: row[4],
@@ -131,12 +170,12 @@ SET key = $1,
131
170
  metadata = $7,
132
171
  updated_at = NOW()
133
172
  WHERE id = $8
134
- AND workflow_id = $9
135
- RETURNING id, workflow_id, key, title, description, status, priority, confidence, metadata, created_at, updated_at, archived_at`;
173
+ AND project_id = $9
174
+ RETURNING id, project_id, key, title, description, status, priority, confidence, metadata, created_at, updated_at, archived_at`;
136
175
  async function updateRequirement(client, args) {
137
176
  const result = await client.query({
138
177
  text: exports.updateRequirementQuery,
139
- values: [args.key, args.title, args.description, args.status, args.priority, args.confidence, args.metadata, args.id, args.workflowId],
178
+ values: [args.key, args.title, args.description, args.status, args.priority, args.confidence, args.metadata, args.id, args.projectId],
140
179
  rowMode: "array"
141
180
  });
142
181
  if (result.rows.length !== 1) {
@@ -145,7 +184,7 @@ async function updateRequirement(client, args) {
145
184
  const row = result.rows[0];
146
185
  return {
147
186
  id: row[0],
148
- workflowId: row[1],
187
+ projectId: row[1],
149
188
  key: row[2],
150
189
  title: row[3],
151
190
  description: row[4],
@@ -164,12 +203,12 @@ SET status = 'archived',
164
203
  archived_at = NOW(),
165
204
  updated_at = NOW()
166
205
  WHERE id = $1
167
- AND workflow_id = $2
168
- RETURNING id, workflow_id, key, title, description, status, priority, confidence, metadata, created_at, updated_at, archived_at`;
206
+ AND project_id = $2
207
+ RETURNING id, project_id, key, title, description, status, priority, confidence, metadata, created_at, updated_at, archived_at`;
169
208
  async function archiveRequirement(client, args) {
170
209
  const result = await client.query({
171
210
  text: exports.archiveRequirementQuery,
172
- values: [args.id, args.workflowId],
211
+ values: [args.id, args.projectId],
173
212
  rowMode: "array"
174
213
  });
175
214
  if (result.rows.length !== 1) {
@@ -178,7 +217,7 @@ async function archiveRequirement(client, args) {
178
217
  const row = result.rows[0];
179
218
  return {
180
219
  id: row[0],
181
- workflowId: row[1],
220
+ projectId: row[1],
182
221
  key: row[2],
183
222
  title: row[3],
184
223
  description: row[4],
@@ -195,14 +234,91 @@ exports.deleteRequirementQuery = `-- name: DeleteRequirement :exec
195
234
  DELETE
196
235
  FROM weave_v1.requirement
197
236
  WHERE id = $1
198
- AND workflow_id = $2`;
237
+ AND project_id = $2`;
199
238
  async function deleteRequirement(client, args) {
200
239
  await client.query({
201
240
  text: exports.deleteRequirementQuery,
202
- values: [args.id, args.workflowId],
241
+ values: [args.id, args.projectId],
203
242
  rowMode: "array"
204
243
  });
205
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
+ }
206
322
  exports.addRequirementSourceRefQuery = `-- name: AddRequirementSourceRef :one
207
323
  INSERT INTO weave_v1.requirement_source_ref (
208
324
  id,
@@ -246,12 +362,12 @@ SELECT rsr.id, rsr.requirement_id, rsr.input_source_id, rsr.input_version_id, rs
246
362
  FROM weave_v1.requirement_source_ref rsr
247
363
  INNER JOIN weave_v1.requirement r ON r.id = rsr.requirement_id
248
364
  WHERE rsr.requirement_id = $1
249
- AND r.workflow_id = $2
365
+ AND r.project_id = $2
250
366
  ORDER BY rsr.created_at DESC`;
251
367
  async function listRequirementSourceRefs(client, args) {
252
368
  const result = await client.query({
253
369
  text: exports.listRequirementSourceRefsQuery,
254
- values: [args.requirementId, args.workflowId],
370
+ values: [args.requirementId, args.projectId],
255
371
  rowMode: "array"
256
372
  });
257
373
  return result.rows.map(row => {
@@ -273,11 +389,11 @@ USING weave_v1.requirement r
273
389
  WHERE rsr.id = $1
274
390
  AND rsr.requirement_id = $2
275
391
  AND rsr.requirement_id = r.id
276
- AND r.workflow_id = $3`;
392
+ AND r.project_id = $3`;
277
393
  async function deleteRequirementSourceRef(client, args) {
278
394
  await client.query({
279
395
  text: exports.deleteRequirementSourceRefQuery,
280
- values: [args.id, args.requirementId, args.workflowId],
396
+ values: [args.id, args.requirementId, args.projectId],
281
397
  rowMode: "array"
282
398
  });
283
399
  }
@@ -2,9 +2,10 @@ import { QueryArrayConfig, QueryArrayResult } from "pg";
2
2
  interface Client {
3
3
  query: (config: QueryArrayConfig) => Promise<QueryArrayResult>;
4
4
  }
5
- export declare const createTestRunQuery = "-- name: CreateTestRun :one\nINSERT INTO weave_v1.test_run (\n 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 NOW()\n)\nRETURNING 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";
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
6
  export interface CreateTestRunArgs {
7
7
  id: string;
8
+ projectId: string;
8
9
  workflowId: string;
9
10
  testSuiteId: string | null;
10
11
  status: string;
@@ -16,6 +17,7 @@ export interface CreateTestRunArgs {
16
17
  }
17
18
  export interface CreateTestRunRow {
18
19
  id: string;
20
+ projectId: string;
19
21
  workflowId: string;
20
22
  testSuiteId: string | null;
21
23
  status: string;
@@ -31,13 +33,15 @@ export interface CreateTestRunRow {
31
33
  updatedAt: Date;
32
34
  }
33
35
  export declare function createTestRun(client: Client, args: CreateTestRunArgs): Promise<CreateTestRunRow | null>;
34
- export declare const getTestRunQuery = "-- name: GetTestRun :one\nSELECT 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 workflow_id = $2";
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";
35
37
  export interface GetTestRunArgs {
36
38
  id: string;
39
+ projectId: string;
37
40
  workflowId: string;
38
41
  }
39
42
  export interface GetTestRunRow {
40
43
  id: string;
44
+ projectId: string;
41
45
  workflowId: string;
42
46
  testSuiteId: string | null;
43
47
  status: string;
@@ -53,14 +57,40 @@ export interface GetTestRunRow {
53
57
  updatedAt: Date;
54
58
  }
55
59
  export declare function getTestRun(client: Client, args: GetTestRunArgs): Promise<GetTestRunRow | null>;
56
- export declare const listTestRunsByWorkflowQuery = "-- name: ListTestRunsByWorkflow :many\nSELECT 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 workflow_id = $1\nORDER BY created_at DESC\nLIMIT $3\nOFFSET $2";
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";
57
85
  export interface ListTestRunsByWorkflowArgs {
86
+ projectId: string;
58
87
  workflowId: string;
59
88
  pageOffset: string;
60
89
  pageSize: string;
61
90
  }
62
91
  export interface ListTestRunsByWorkflowRow {
63
92
  id: string;
93
+ projectId: string;
64
94
  workflowId: string;
65
95
  testSuiteId: string | null;
66
96
  status: string;
@@ -76,17 +106,19 @@ export interface ListTestRunsByWorkflowRow {
76
106
  updatedAt: Date;
77
107
  }
78
108
  export declare function listTestRunsByWorkflow(client: Client, args: ListTestRunsByWorkflowArgs): Promise<ListTestRunsByWorkflowRow[]>;
79
- 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 workflow_id = $6\nRETURNING 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";
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";
80
110
  export interface UpdateTestRunStatusArgs {
81
111
  status: string;
82
112
  startedAt: Date | null;
83
113
  finishedAt: Date | null;
84
114
  summary: any;
85
115
  id: string;
116
+ projectId: string;
86
117
  workflowId: string;
87
118
  }
88
119
  export interface UpdateTestRunStatusRow {
89
120
  id: string;
121
+ projectId: string;
90
122
  workflowId: string;
91
123
  testSuiteId: string | null;
92
124
  status: string;
@@ -102,13 +134,15 @@ export interface UpdateTestRunStatusRow {
102
134
  updatedAt: Date;
103
135
  }
104
136
  export declare function updateTestRunStatus(client: Client, args: UpdateTestRunStatusArgs): Promise<UpdateTestRunStatusRow | null>;
105
- 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 workflow_id = $2\nRETURNING 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";
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";
106
138
  export interface CancelTestRunArgs {
107
139
  id: string;
140
+ projectId: string;
108
141
  workflowId: string;
109
142
  }
110
143
  export interface CancelTestRunRow {
111
144
  id: string;
145
+ projectId: string;
112
146
  workflowId: string;
113
147
  testSuiteId: string | null;
114
148
  status: string;
@@ -156,9 +190,10 @@ export interface UpsertTestRunCaseResultRow {
156
190
  updatedAt: Date;
157
191
  }
158
192
  export declare function upsertTestRunCaseResult(client: Client, args: UpsertTestRunCaseResultArgs): Promise<UpsertTestRunCaseResultRow | null>;
159
- 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.workflow_id = $2\nORDER BY cr.created_at ASC\nLIMIT $4\nOFFSET $3";
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";
160
194
  export interface ListTestRunCaseResultsArgs {
161
195
  testRunId: string;
196
+ projectId: string;
162
197
  workflowId: string;
163
198
  pageOffset: string;
164
199
  pageSize: string;
@@ -209,9 +244,10 @@ export interface CreateTestRunArtifactRow {
209
244
  createdAt: Date;
210
245
  }
211
246
  export declare function createTestRunArtifact(client: Client, args: CreateTestRunArtifactArgs): Promise<CreateTestRunArtifactRow | null>;
212
- 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.workflow_id = $2\n AND ($3::UUID IS NULL OR a.test_run_case_result_id = $3)\nORDER BY a.created_at ASC\nLIMIT $5\nOFFSET $4";
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";
213
248
  export interface ListTestRunArtifactsArgs {
214
249
  testRunId: string;
250
+ projectId: string;
215
251
  workflowId: string;
216
252
  testRunCaseResultId: string;
217
253
  pageOffset: string;
@@ -232,7 +268,7 @@ export interface ListTestRunArtifactsRow {
232
268
  createdAt: Date;
233
269
  }
234
270
  export declare function listTestRunArtifacts(client: Client, args: ListTestRunArtifactsArgs): Promise<ListTestRunArtifactsRow[]>;
235
- 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";
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";
236
272
  export interface GetTestRunLiveCountsArgs {
237
273
  testRunId: string;
238
274
  }