weave-typescript 0.11.13 → 0.11.15

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 (63) 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 +213 -0
  4. package/dist/weaveapi/data/v1/service.pb.js +1948 -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 +311 -0
  8. package/dist/weaveapi/input/v1/service.pb.js +3001 -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 +236 -0
  12. package/dist/weaveapi/integration/v1/service.pb.js +2220 -0
  13. package/dist/weaveapi/report/v1/report.pb.d.ts +79 -0
  14. package/dist/weaveapi/report/v1/report.pb.js +638 -0
  15. package/dist/weaveapi/report/v1/service.pb.d.ts +194 -0
  16. package/dist/weaveapi/report/v1/service.pb.js +1630 -0
  17. package/dist/weaveapi/requirement/v1/requirement.pb.d.ts +70 -0
  18. package/dist/weaveapi/requirement/v1/requirement.pb.js +570 -0
  19. package/dist/weaveapi/requirement/v1/service.pb.d.ts +310 -0
  20. package/dist/weaveapi/requirement/v1/service.pb.js +2978 -0
  21. package/dist/weaveapi/run/v1/run.pb.d.ts +116 -0
  22. package/dist/weaveapi/run/v1/run.pb.js +1135 -0
  23. package/dist/weaveapi/run/v1/service.pb.d.ts +229 -0
  24. package/dist/weaveapi/run/v1/service.pb.js +2106 -0
  25. package/dist/weaveapi/script/v1/script.pb.d.ts +102 -0
  26. package/dist/weaveapi/script/v1/script.pb.js +1025 -0
  27. package/dist/weaveapi/script/v1/service.pb.d.ts +426 -0
  28. package/dist/weaveapi/script/v1/service.pb.js +4399 -0
  29. package/dist/weaveapi/storage/v1/service.pb.d.ts +4 -0
  30. package/dist/weaveapi/storage/v1/service.pb.js +50 -7
  31. package/dist/weaveapi/storage/v1/storage.pb.d.ts +2 -0
  32. package/dist/weaveapi/storage/v1/storage.pb.js +23 -0
  33. package/dist/weaveapi/storage/v1/vcs.pb.d.ts +75 -0
  34. package/dist/weaveapi/storage/v1/vcs.pb.js +864 -0
  35. package/dist/weaveapi/suite/v1/service.pb.d.ts +373 -0
  36. package/dist/weaveapi/suite/v1/service.pb.js +3629 -0
  37. package/dist/weaveapi/suite/v1/suite.pb.d.ts +92 -0
  38. package/dist/weaveapi/suite/v1/suite.pb.js +876 -0
  39. package/dist/weaveapi/testcase/v1/service.pb.d.ts +422 -0
  40. package/dist/weaveapi/testcase/v1/service.pb.js +4254 -0
  41. package/dist/weaveapi/testcase/v1/testcase.pb.d.ts +91 -0
  42. package/dist/weaveapi/testcase/v1/testcase.pb.js +794 -0
  43. package/dist/weavesql/weavedb/data_asset_sql.d.ts +141 -0
  44. package/dist/weavesql/weavedb/data_asset_sql.js +217 -0
  45. package/dist/weavesql/weavedb/input_sql.d.ts +230 -0
  46. package/dist/weavesql/weavedb/input_sql.js +384 -0
  47. package/dist/weavesql/weavedb/integration_sql.d.ts +170 -0
  48. package/dist/weavesql/weavedb/integration_sql.js +258 -0
  49. package/dist/weavesql/weavedb/report_sql.d.ts +138 -0
  50. package/dist/weavesql/weavedb/report_sql.js +232 -0
  51. package/dist/weavesql/weavedb/requirement_sql.d.ts +168 -0
  52. package/dist/weavesql/weavedb/requirement_sql.js +283 -0
  53. package/dist/weavesql/weavedb/run_sql.d.ts +247 -0
  54. package/dist/weavesql/weavedb/run_sql.js +415 -0
  55. package/dist/weavesql/weavedb/suite_sql.d.ts +228 -0
  56. package/dist/weavesql/weavedb/suite_sql.js +399 -0
  57. package/dist/weavesql/weavedb/test_case_sql.d.ts +261 -0
  58. package/dist/weavesql/weavedb/test_case_sql.js +446 -0
  59. package/dist/weavesql/weavedb/test_script_sql.d.ts +290 -0
  60. package/dist/weavesql/weavedb/test_script_sql.js +488 -0
  61. package/dist/weavesql/weavedb/traceability_sql.d.ts +59 -0
  62. package/dist/weavesql/weavedb/traceability_sql.js +155 -0
  63. package/package.json +1 -1
@@ -0,0 +1,168 @@
1
+ import { QueryArrayConfig, QueryArrayResult } from "pg";
2
+ interface Client {
3
+ query: (config: QueryArrayConfig) => Promise<QueryArrayResult>;
4
+ }
5
+ export declare const createRequirementQuery = "-- name: CreateRequirement :one\nINSERT INTO weave_v1.requirement (\n id,\n workflow_id,\n key,\n title,\n description,\n status,\n priority,\n confidence,\n metadata\n)\nVALUES (\n $1,\n $2,\n $3,\n $4,\n $5,\n $6,\n $7,\n $8,\n $9\n)\nRETURNING id, workflow_id, key, title, description, status, priority, confidence, metadata, created_at, updated_at, archived_at";
6
+ export interface CreateRequirementArgs {
7
+ id: string;
8
+ workflowId: string;
9
+ key: string;
10
+ title: string;
11
+ description: string;
12
+ status: string;
13
+ priority: string;
14
+ confidence: string;
15
+ metadata: any;
16
+ }
17
+ export interface CreateRequirementRow {
18
+ id: string;
19
+ workflowId: string;
20
+ key: string;
21
+ title: string;
22
+ description: string;
23
+ status: string;
24
+ priority: string;
25
+ confidence: string;
26
+ metadata: any;
27
+ createdAt: Date;
28
+ updatedAt: Date;
29
+ archivedAt: Date | null;
30
+ }
31
+ export declare function createRequirement(client: Client, args: CreateRequirementArgs): Promise<CreateRequirementRow | null>;
32
+ export declare const getRequirementQuery = "-- name: GetRequirement :one\nSELECT id, workflow_id, key, title, description, status, priority, confidence, metadata, created_at, updated_at, archived_at\nFROM weave_v1.requirement\nWHERE id = $1\n AND workflow_id = $2";
33
+ export interface GetRequirementArgs {
34
+ id: string;
35
+ workflowId: string;
36
+ }
37
+ export interface GetRequirementRow {
38
+ id: string;
39
+ workflowId: string;
40
+ key: string;
41
+ title: string;
42
+ description: string;
43
+ status: string;
44
+ priority: string;
45
+ confidence: string;
46
+ metadata: any;
47
+ createdAt: Date;
48
+ updatedAt: Date;
49
+ archivedAt: Date | null;
50
+ }
51
+ export declare function getRequirement(client: Client, args: GetRequirementArgs): Promise<GetRequirementRow | null>;
52
+ export declare const listRequirementsByWorkflowQuery = "-- name: ListRequirementsByWorkflow :many\nSELECT id, workflow_id, key, title, description, status, priority, confidence, metadata, created_at, updated_at, archived_at\nFROM weave_v1.requirement\nWHERE workflow_id = $1\n AND ($2::BOOLEAN OR archived_at IS NULL)\nORDER BY updated_at DESC\nLIMIT $4\nOFFSET $3";
53
+ export interface ListRequirementsByWorkflowArgs {
54
+ workflowId: string;
55
+ includeArchived: boolean;
56
+ pageOffset: string;
57
+ pageSize: string;
58
+ }
59
+ export interface ListRequirementsByWorkflowRow {
60
+ id: string;
61
+ workflowId: string;
62
+ key: string;
63
+ title: string;
64
+ description: string;
65
+ status: string;
66
+ priority: string;
67
+ confidence: string;
68
+ metadata: any;
69
+ createdAt: Date;
70
+ updatedAt: Date;
71
+ archivedAt: Date | null;
72
+ }
73
+ export declare function listRequirementsByWorkflow(client: Client, args: ListRequirementsByWorkflowArgs): Promise<ListRequirementsByWorkflowRow[]>;
74
+ export declare const updateRequirementQuery = "-- name: UpdateRequirement :one\nUPDATE weave_v1.requirement\nSET key = $1,\n title = $2,\n description = $3,\n status = $4,\n priority = $5,\n confidence = $6,\n metadata = $7,\n updated_at = NOW()\nWHERE id = $8\n AND workflow_id = $9\nRETURNING id, workflow_id, key, title, description, status, priority, confidence, metadata, created_at, updated_at, archived_at";
75
+ export interface UpdateRequirementArgs {
76
+ key: string;
77
+ title: string;
78
+ description: string;
79
+ status: string;
80
+ priority: string;
81
+ confidence: string;
82
+ metadata: any;
83
+ id: string;
84
+ workflowId: string;
85
+ }
86
+ export interface UpdateRequirementRow {
87
+ id: string;
88
+ workflowId: string;
89
+ key: string;
90
+ title: string;
91
+ description: string;
92
+ status: string;
93
+ priority: string;
94
+ confidence: string;
95
+ metadata: any;
96
+ createdAt: Date;
97
+ updatedAt: Date;
98
+ archivedAt: Date | null;
99
+ }
100
+ export declare function updateRequirement(client: Client, args: UpdateRequirementArgs): Promise<UpdateRequirementRow | null>;
101
+ export declare const archiveRequirementQuery = "-- name: ArchiveRequirement :one\nUPDATE weave_v1.requirement\nSET status = 'archived',\n archived_at = NOW(),\n updated_at = NOW()\nWHERE id = $1\n AND workflow_id = $2\nRETURNING id, workflow_id, key, title, description, status, priority, confidence, metadata, created_at, updated_at, archived_at";
102
+ export interface ArchiveRequirementArgs {
103
+ id: string;
104
+ workflowId: string;
105
+ }
106
+ export interface ArchiveRequirementRow {
107
+ id: string;
108
+ workflowId: string;
109
+ key: string;
110
+ title: string;
111
+ description: string;
112
+ status: string;
113
+ priority: string;
114
+ confidence: string;
115
+ metadata: any;
116
+ createdAt: Date;
117
+ updatedAt: Date;
118
+ archivedAt: Date | null;
119
+ }
120
+ export declare function archiveRequirement(client: Client, args: ArchiveRequirementArgs): Promise<ArchiveRequirementRow | null>;
121
+ export declare const deleteRequirementQuery = "-- name: DeleteRequirement :exec\nDELETE\nFROM weave_v1.requirement\nWHERE id = $1\n AND workflow_id = $2";
122
+ export interface DeleteRequirementArgs {
123
+ id: string;
124
+ workflowId: string;
125
+ }
126
+ export declare function deleteRequirement(client: Client, args: DeleteRequirementArgs): Promise<void>;
127
+ export declare const addRequirementSourceRefQuery = "-- name: AddRequirementSourceRef :one\nINSERT INTO weave_v1.requirement_source_ref (\n id,\n requirement_id,\n input_source_id,\n input_version_id,\n excerpt,\n locator\n)\nVALUES (\n $1,\n $2,\n $3,\n $4,\n $5,\n $6\n)\nRETURNING id, requirement_id, input_source_id, input_version_id, excerpt, locator, created_at";
128
+ export interface AddRequirementSourceRefArgs {
129
+ id: string;
130
+ requirementId: string;
131
+ inputSourceId: string | null;
132
+ inputVersionId: string | null;
133
+ excerpt: string;
134
+ locator: any;
135
+ }
136
+ export interface AddRequirementSourceRefRow {
137
+ id: string;
138
+ requirementId: string;
139
+ inputSourceId: string | null;
140
+ inputVersionId: string | null;
141
+ excerpt: string;
142
+ locator: any;
143
+ createdAt: Date;
144
+ }
145
+ export declare function addRequirementSourceRef(client: Client, args: AddRequirementSourceRefArgs): Promise<AddRequirementSourceRefRow | null>;
146
+ export declare const listRequirementSourceRefsQuery = "-- name: ListRequirementSourceRefs :many\nSELECT rsr.id, rsr.requirement_id, rsr.input_source_id, rsr.input_version_id, rsr.excerpt, rsr.locator, rsr.created_at\nFROM weave_v1.requirement_source_ref rsr\n INNER JOIN weave_v1.requirement r ON r.id = rsr.requirement_id\nWHERE rsr.requirement_id = $1\n AND r.workflow_id = $2\nORDER BY rsr.created_at DESC";
147
+ export interface ListRequirementSourceRefsArgs {
148
+ requirementId: string;
149
+ workflowId: string;
150
+ }
151
+ export interface ListRequirementSourceRefsRow {
152
+ id: string;
153
+ requirementId: string;
154
+ inputSourceId: string | null;
155
+ inputVersionId: string | null;
156
+ excerpt: string;
157
+ locator: any;
158
+ createdAt: Date;
159
+ }
160
+ export declare function listRequirementSourceRefs(client: Client, args: ListRequirementSourceRefsArgs): Promise<ListRequirementSourceRefsRow[]>;
161
+ export declare const deleteRequirementSourceRefQuery = "-- name: DeleteRequirementSourceRef :exec\nDELETE\nFROM weave_v1.requirement_source_ref rsr\nUSING weave_v1.requirement r\nWHERE rsr.id = $1\n AND rsr.requirement_id = $2\n AND rsr.requirement_id = r.id\n AND r.workflow_id = $3";
162
+ export interface DeleteRequirementSourceRefArgs {
163
+ id: string;
164
+ requirementId: string;
165
+ workflowId: string;
166
+ }
167
+ export declare function deleteRequirementSourceRef(client: Client, args: DeleteRequirementSourceRefArgs): Promise<void>;
168
+ export {};
@@ -0,0 +1,283 @@
1
+ "use strict";
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;
4
+ exports.createRequirement = createRequirement;
5
+ exports.getRequirement = getRequirement;
6
+ exports.listRequirementsByWorkflow = listRequirementsByWorkflow;
7
+ exports.updateRequirement = updateRequirement;
8
+ exports.archiveRequirement = archiveRequirement;
9
+ exports.deleteRequirement = deleteRequirement;
10
+ exports.addRequirementSourceRef = addRequirementSourceRef;
11
+ exports.listRequirementSourceRefs = listRequirementSourceRefs;
12
+ exports.deleteRequirementSourceRef = deleteRequirementSourceRef;
13
+ exports.createRequirementQuery = `-- name: CreateRequirement :one
14
+ INSERT INTO weave_v1.requirement (
15
+ id,
16
+ workflow_id,
17
+ key,
18
+ title,
19
+ description,
20
+ status,
21
+ priority,
22
+ confidence,
23
+ metadata
24
+ )
25
+ VALUES (
26
+ $1,
27
+ $2,
28
+ $3,
29
+ $4,
30
+ $5,
31
+ $6,
32
+ $7,
33
+ $8,
34
+ $9
35
+ )
36
+ RETURNING id, workflow_id, key, title, description, status, priority, confidence, metadata, created_at, updated_at, archived_at`;
37
+ async function createRequirement(client, args) {
38
+ const result = await client.query({
39
+ text: exports.createRequirementQuery,
40
+ values: [args.id, args.workflowId, args.key, args.title, args.description, args.status, args.priority, args.confidence, args.metadata],
41
+ rowMode: "array"
42
+ });
43
+ if (result.rows.length !== 1) {
44
+ return null;
45
+ }
46
+ const row = result.rows[0];
47
+ return {
48
+ id: row[0],
49
+ workflowId: row[1],
50
+ key: row[2],
51
+ title: row[3],
52
+ description: row[4],
53
+ status: row[5],
54
+ priority: row[6],
55
+ confidence: row[7],
56
+ metadata: row[8],
57
+ createdAt: row[9],
58
+ updatedAt: row[10],
59
+ archivedAt: row[11]
60
+ };
61
+ }
62
+ exports.getRequirementQuery = `-- name: GetRequirement :one
63
+ SELECT id, workflow_id, key, title, description, status, priority, confidence, metadata, created_at, updated_at, archived_at
64
+ FROM weave_v1.requirement
65
+ WHERE id = $1
66
+ AND workflow_id = $2`;
67
+ async function getRequirement(client, args) {
68
+ const result = await client.query({
69
+ text: exports.getRequirementQuery,
70
+ values: [args.id, args.workflowId],
71
+ rowMode: "array"
72
+ });
73
+ if (result.rows.length !== 1) {
74
+ return null;
75
+ }
76
+ const row = result.rows[0];
77
+ return {
78
+ id: row[0],
79
+ workflowId: row[1],
80
+ key: row[2],
81
+ title: row[3],
82
+ description: row[4],
83
+ status: row[5],
84
+ priority: row[6],
85
+ confidence: row[7],
86
+ metadata: row[8],
87
+ createdAt: row[9],
88
+ updatedAt: row[10],
89
+ archivedAt: row[11]
90
+ };
91
+ }
92
+ exports.listRequirementsByWorkflowQuery = `-- name: ListRequirementsByWorkflow :many
93
+ SELECT id, workflow_id, key, title, description, status, priority, confidence, metadata, created_at, updated_at, archived_at
94
+ FROM weave_v1.requirement
95
+ WHERE workflow_id = $1
96
+ AND ($2::BOOLEAN OR archived_at IS NULL)
97
+ ORDER BY updated_at DESC
98
+ LIMIT $4
99
+ OFFSET $3`;
100
+ async function listRequirementsByWorkflow(client, args) {
101
+ const result = await client.query({
102
+ text: exports.listRequirementsByWorkflowQuery,
103
+ values: [args.workflowId, args.includeArchived, args.pageOffset, args.pageSize],
104
+ rowMode: "array"
105
+ });
106
+ return result.rows.map(row => {
107
+ return {
108
+ id: row[0],
109
+ workflowId: row[1],
110
+ key: row[2],
111
+ title: row[3],
112
+ description: row[4],
113
+ status: row[5],
114
+ priority: row[6],
115
+ confidence: row[7],
116
+ metadata: row[8],
117
+ createdAt: row[9],
118
+ updatedAt: row[10],
119
+ archivedAt: row[11]
120
+ };
121
+ });
122
+ }
123
+ exports.updateRequirementQuery = `-- name: UpdateRequirement :one
124
+ UPDATE weave_v1.requirement
125
+ SET key = $1,
126
+ title = $2,
127
+ description = $3,
128
+ status = $4,
129
+ priority = $5,
130
+ confidence = $6,
131
+ metadata = $7,
132
+ updated_at = NOW()
133
+ 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`;
136
+ async function updateRequirement(client, args) {
137
+ const result = await client.query({
138
+ text: exports.updateRequirementQuery,
139
+ values: [args.key, args.title, args.description, args.status, args.priority, args.confidence, args.metadata, args.id, args.workflowId],
140
+ rowMode: "array"
141
+ });
142
+ if (result.rows.length !== 1) {
143
+ return null;
144
+ }
145
+ const row = result.rows[0];
146
+ return {
147
+ id: row[0],
148
+ workflowId: 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
+ exports.archiveRequirementQuery = `-- name: ArchiveRequirement :one
162
+ UPDATE weave_v1.requirement
163
+ SET status = 'archived',
164
+ archived_at = NOW(),
165
+ updated_at = NOW()
166
+ 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`;
169
+ async function archiveRequirement(client, args) {
170
+ const result = await client.query({
171
+ text: exports.archiveRequirementQuery,
172
+ values: [args.id, args.workflowId],
173
+ rowMode: "array"
174
+ });
175
+ if (result.rows.length !== 1) {
176
+ return null;
177
+ }
178
+ const row = result.rows[0];
179
+ return {
180
+ id: row[0],
181
+ workflowId: row[1],
182
+ key: row[2],
183
+ title: row[3],
184
+ description: row[4],
185
+ status: row[5],
186
+ priority: row[6],
187
+ confidence: row[7],
188
+ metadata: row[8],
189
+ createdAt: row[9],
190
+ updatedAt: row[10],
191
+ archivedAt: row[11]
192
+ };
193
+ }
194
+ exports.deleteRequirementQuery = `-- name: DeleteRequirement :exec
195
+ DELETE
196
+ FROM weave_v1.requirement
197
+ WHERE id = $1
198
+ AND workflow_id = $2`;
199
+ async function deleteRequirement(client, args) {
200
+ await client.query({
201
+ text: exports.deleteRequirementQuery,
202
+ values: [args.id, args.workflowId],
203
+ rowMode: "array"
204
+ });
205
+ }
206
+ exports.addRequirementSourceRefQuery = `-- name: AddRequirementSourceRef :one
207
+ INSERT INTO weave_v1.requirement_source_ref (
208
+ id,
209
+ requirement_id,
210
+ input_source_id,
211
+ input_version_id,
212
+ excerpt,
213
+ locator
214
+ )
215
+ VALUES (
216
+ $1,
217
+ $2,
218
+ $3,
219
+ $4,
220
+ $5,
221
+ $6
222
+ )
223
+ RETURNING id, requirement_id, input_source_id, input_version_id, excerpt, locator, created_at`;
224
+ async function addRequirementSourceRef(client, args) {
225
+ const result = await client.query({
226
+ text: exports.addRequirementSourceRefQuery,
227
+ values: [args.id, args.requirementId, args.inputSourceId, args.inputVersionId, args.excerpt, args.locator],
228
+ rowMode: "array"
229
+ });
230
+ if (result.rows.length !== 1) {
231
+ return null;
232
+ }
233
+ const row = result.rows[0];
234
+ return {
235
+ id: row[0],
236
+ requirementId: row[1],
237
+ inputSourceId: row[2],
238
+ inputVersionId: row[3],
239
+ excerpt: row[4],
240
+ locator: row[5],
241
+ createdAt: row[6]
242
+ };
243
+ }
244
+ exports.listRequirementSourceRefsQuery = `-- name: ListRequirementSourceRefs :many
245
+ SELECT rsr.id, rsr.requirement_id, rsr.input_source_id, rsr.input_version_id, rsr.excerpt, rsr.locator, rsr.created_at
246
+ FROM weave_v1.requirement_source_ref rsr
247
+ INNER JOIN weave_v1.requirement r ON r.id = rsr.requirement_id
248
+ WHERE rsr.requirement_id = $1
249
+ AND r.workflow_id = $2
250
+ ORDER BY rsr.created_at DESC`;
251
+ async function listRequirementSourceRefs(client, args) {
252
+ const result = await client.query({
253
+ text: exports.listRequirementSourceRefsQuery,
254
+ values: [args.requirementId, args.workflowId],
255
+ rowMode: "array"
256
+ });
257
+ return result.rows.map(row => {
258
+ return {
259
+ id: row[0],
260
+ requirementId: row[1],
261
+ inputSourceId: row[2],
262
+ inputVersionId: row[3],
263
+ excerpt: row[4],
264
+ locator: row[5],
265
+ createdAt: row[6]
266
+ };
267
+ });
268
+ }
269
+ exports.deleteRequirementSourceRefQuery = `-- name: DeleteRequirementSourceRef :exec
270
+ DELETE
271
+ FROM weave_v1.requirement_source_ref rsr
272
+ USING weave_v1.requirement r
273
+ WHERE rsr.id = $1
274
+ AND rsr.requirement_id = $2
275
+ AND rsr.requirement_id = r.id
276
+ AND r.workflow_id = $3`;
277
+ async function deleteRequirementSourceRef(client, args) {
278
+ await client.query({
279
+ text: exports.deleteRequirementSourceRefQuery,
280
+ values: [args.id, args.requirementId, args.workflowId],
281
+ rowMode: "array"
282
+ });
283
+ }
@@ -0,0 +1,247 @@
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 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";
6
+ export interface CreateTestRunArgs {
7
+ id: string;
8
+ workflowId: string;
9
+ testSuiteId: string | null;
10
+ status: string;
11
+ environment: string;
12
+ triggeredBy: string;
13
+ runtimeConfig: any;
14
+ summary: any;
15
+ traceId: string;
16
+ }
17
+ export interface CreateTestRunRow {
18
+ id: string;
19
+ workflowId: string;
20
+ testSuiteId: string | null;
21
+ status: string;
22
+ environment: string;
23
+ triggeredBy: string;
24
+ runtimeConfig: any;
25
+ summary: any;
26
+ traceId: string;
27
+ queuedAt: Date;
28
+ startedAt: Date | null;
29
+ finishedAt: Date | null;
30
+ createdAt: Date;
31
+ updatedAt: Date;
32
+ }
33
+ 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";
35
+ export interface GetTestRunArgs {
36
+ id: string;
37
+ workflowId: string;
38
+ }
39
+ export interface GetTestRunRow {
40
+ id: string;
41
+ workflowId: string;
42
+ testSuiteId: string | null;
43
+ status: string;
44
+ environment: string;
45
+ triggeredBy: string;
46
+ runtimeConfig: any;
47
+ summary: any;
48
+ traceId: string;
49
+ queuedAt: Date;
50
+ startedAt: Date | null;
51
+ finishedAt: Date | null;
52
+ createdAt: Date;
53
+ updatedAt: Date;
54
+ }
55
+ 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";
57
+ export interface ListTestRunsByWorkflowArgs {
58
+ workflowId: string;
59
+ pageOffset: string;
60
+ pageSize: string;
61
+ }
62
+ export interface ListTestRunsByWorkflowRow {
63
+ id: string;
64
+ workflowId: string;
65
+ testSuiteId: string | null;
66
+ status: string;
67
+ environment: string;
68
+ triggeredBy: string;
69
+ runtimeConfig: any;
70
+ summary: any;
71
+ traceId: string;
72
+ queuedAt: Date;
73
+ startedAt: Date | null;
74
+ finishedAt: Date | null;
75
+ createdAt: Date;
76
+ updatedAt: Date;
77
+ }
78
+ 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";
80
+ export interface UpdateTestRunStatusArgs {
81
+ status: string;
82
+ startedAt: Date | null;
83
+ finishedAt: Date | null;
84
+ summary: any;
85
+ id: string;
86
+ workflowId: string;
87
+ }
88
+ export interface UpdateTestRunStatusRow {
89
+ id: string;
90
+ workflowId: string;
91
+ testSuiteId: string | null;
92
+ status: string;
93
+ environment: string;
94
+ triggeredBy: string;
95
+ runtimeConfig: any;
96
+ summary: any;
97
+ traceId: string;
98
+ queuedAt: Date;
99
+ startedAt: Date | null;
100
+ finishedAt: Date | null;
101
+ createdAt: Date;
102
+ updatedAt: Date;
103
+ }
104
+ 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";
106
+ export interface CancelTestRunArgs {
107
+ id: string;
108
+ workflowId: string;
109
+ }
110
+ export interface CancelTestRunRow {
111
+ id: string;
112
+ workflowId: string;
113
+ testSuiteId: string | null;
114
+ status: string;
115
+ environment: string;
116
+ triggeredBy: string;
117
+ runtimeConfig: any;
118
+ summary: any;
119
+ traceId: string;
120
+ queuedAt: Date;
121
+ startedAt: Date | null;
122
+ finishedAt: Date | null;
123
+ createdAt: Date;
124
+ updatedAt: Date;
125
+ }
126
+ export declare function cancelTestRun(client: Client, args: CancelTestRunArgs): Promise<CancelTestRunRow | null>;
127
+ 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";
128
+ export interface UpsertTestRunCaseResultArgs {
129
+ id: string;
130
+ testRunId: string;
131
+ testCaseId: string | null;
132
+ testScriptId: string | null;
133
+ status: string;
134
+ durationMs: string;
135
+ errorSummary: string;
136
+ assertionCount: number;
137
+ failedAssertionCount: number;
138
+ details: any;
139
+ startedAt: Date | null;
140
+ finishedAt: Date | null;
141
+ }
142
+ export interface UpsertTestRunCaseResultRow {
143
+ id: string;
144
+ testRunId: string;
145
+ testCaseId: string | null;
146
+ testScriptId: string | null;
147
+ status: string;
148
+ durationMs: string;
149
+ errorSummary: string;
150
+ assertionCount: number;
151
+ failedAssertionCount: number;
152
+ details: any;
153
+ startedAt: Date | null;
154
+ finishedAt: Date | null;
155
+ createdAt: Date;
156
+ updatedAt: Date;
157
+ }
158
+ 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";
160
+ export interface ListTestRunCaseResultsArgs {
161
+ testRunId: string;
162
+ workflowId: string;
163
+ pageOffset: string;
164
+ pageSize: string;
165
+ }
166
+ export interface ListTestRunCaseResultsRow {
167
+ id: string;
168
+ testRunId: string;
169
+ testCaseId: string | null;
170
+ testScriptId: string | null;
171
+ status: string;
172
+ durationMs: string;
173
+ errorSummary: string;
174
+ assertionCount: number;
175
+ failedAssertionCount: number;
176
+ details: any;
177
+ startedAt: Date | null;
178
+ finishedAt: Date | null;
179
+ createdAt: Date;
180
+ updatedAt: Date;
181
+ }
182
+ export declare function listTestRunCaseResults(client: Client, args: ListTestRunCaseResultsArgs): Promise<ListTestRunCaseResultsRow[]>;
183
+ 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";
184
+ export interface CreateTestRunArtifactArgs {
185
+ id: string;
186
+ testRunId: string;
187
+ testRunCaseResultId: string | null;
188
+ artifactType: string;
189
+ name: string;
190
+ storageConnectionId: string | null;
191
+ uri: string;
192
+ contentType: string;
193
+ sizeBytes: string;
194
+ checksum: string;
195
+ metadata: any;
196
+ }
197
+ export interface CreateTestRunArtifactRow {
198
+ id: string;
199
+ testRunId: string;
200
+ testRunCaseResultId: string | null;
201
+ artifactType: string;
202
+ name: string;
203
+ storageConnectionId: string | null;
204
+ uri: string;
205
+ contentType: string;
206
+ sizeBytes: string;
207
+ checksum: string;
208
+ metadata: any;
209
+ createdAt: Date;
210
+ }
211
+ 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";
213
+ export interface ListTestRunArtifactsArgs {
214
+ testRunId: string;
215
+ workflowId: string;
216
+ testRunCaseResultId: string;
217
+ pageOffset: string;
218
+ pageSize: string;
219
+ }
220
+ export interface ListTestRunArtifactsRow {
221
+ id: string;
222
+ testRunId: string;
223
+ testRunCaseResultId: string | null;
224
+ artifactType: string;
225
+ name: string;
226
+ storageConnectionId: string | null;
227
+ uri: string;
228
+ contentType: string;
229
+ sizeBytes: string;
230
+ checksum: string;
231
+ metadata: any;
232
+ createdAt: Date;
233
+ }
234
+ 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";
236
+ export interface GetTestRunLiveCountsArgs {
237
+ testRunId: string;
238
+ }
239
+ export interface GetTestRunLiveCountsRow {
240
+ pendingCount: number;
241
+ runningCount: number;
242
+ passedCount: number;
243
+ failedCount: number;
244
+ totalCount: number;
245
+ }
246
+ export declare function getTestRunLiveCounts(client: Client, args: GetTestRunLiveCountsArgs): Promise<GetTestRunLiveCountsRow | null>;
247
+ export {};