weave-typescript 0.11.14 → 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.
- package/dist/weaveapi/data/v1/data.pb.d.ts +54 -0
- package/dist/weaveapi/data/v1/data.pb.js +411 -0
- package/dist/weaveapi/data/v1/service.pb.d.ts +213 -0
- package/dist/weaveapi/data/v1/service.pb.js +1948 -0
- package/dist/weaveapi/input/v1/input.pb.d.ts +77 -0
- package/dist/weaveapi/input/v1/input.pb.js +632 -0
- package/dist/weaveapi/input/v1/service.pb.d.ts +311 -0
- package/dist/weaveapi/input/v1/service.pb.js +3001 -0
- package/dist/weaveapi/integration/v1/integration.pb.d.ts +67 -0
- package/dist/weaveapi/integration/v1/integration.pb.js +486 -0
- package/dist/weaveapi/integration/v1/service.pb.d.ts +236 -0
- package/dist/weaveapi/integration/v1/service.pb.js +2220 -0
- package/dist/weaveapi/report/v1/report.pb.d.ts +79 -0
- package/dist/weaveapi/report/v1/report.pb.js +638 -0
- package/dist/weaveapi/report/v1/service.pb.d.ts +194 -0
- package/dist/weaveapi/report/v1/service.pb.js +1630 -0
- package/dist/weaveapi/requirement/v1/requirement.pb.d.ts +70 -0
- package/dist/weaveapi/requirement/v1/requirement.pb.js +570 -0
- package/dist/weaveapi/requirement/v1/service.pb.d.ts +310 -0
- package/dist/weaveapi/requirement/v1/service.pb.js +2978 -0
- package/dist/weaveapi/run/v1/run.pb.d.ts +116 -0
- package/dist/weaveapi/run/v1/run.pb.js +1135 -0
- package/dist/weaveapi/run/v1/service.pb.d.ts +229 -0
- package/dist/weaveapi/run/v1/service.pb.js +2106 -0
- package/dist/weaveapi/script/v1/script.pb.d.ts +102 -0
- package/dist/weaveapi/script/v1/script.pb.js +1025 -0
- package/dist/weaveapi/script/v1/service.pb.d.ts +426 -0
- package/dist/weaveapi/script/v1/service.pb.js +4399 -0
- package/dist/weaveapi/storage/v1/service.pb.d.ts +4 -0
- package/dist/weaveapi/storage/v1/service.pb.js +50 -7
- package/dist/weaveapi/storage/v1/storage.pb.d.ts +2 -0
- package/dist/weaveapi/storage/v1/storage.pb.js +23 -0
- package/dist/weaveapi/storage/v1/vcs.pb.d.ts +75 -0
- package/dist/weaveapi/storage/v1/vcs.pb.js +864 -0
- package/dist/weaveapi/suite/v1/service.pb.d.ts +373 -0
- package/dist/weaveapi/suite/v1/service.pb.js +3629 -0
- package/dist/weaveapi/suite/v1/suite.pb.d.ts +92 -0
- package/dist/weaveapi/suite/v1/suite.pb.js +876 -0
- package/dist/weaveapi/testcase/v1/service.pb.d.ts +422 -0
- package/dist/weaveapi/testcase/v1/service.pb.js +4254 -0
- package/dist/weaveapi/testcase/v1/testcase.pb.d.ts +91 -0
- package/dist/weaveapi/testcase/v1/testcase.pb.js +794 -0
- package/dist/weavesql/weavedb/data_asset_sql.d.ts +141 -0
- package/dist/weavesql/weavedb/data_asset_sql.js +217 -0
- package/dist/weavesql/weavedb/input_sql.d.ts +230 -0
- package/dist/weavesql/weavedb/input_sql.js +384 -0
- package/dist/weavesql/weavedb/integration_sql.d.ts +170 -0
- package/dist/weavesql/weavedb/integration_sql.js +258 -0
- package/dist/weavesql/weavedb/report_sql.d.ts +138 -0
- package/dist/weavesql/weavedb/report_sql.js +232 -0
- package/dist/weavesql/weavedb/requirement_sql.d.ts +168 -0
- package/dist/weavesql/weavedb/requirement_sql.js +283 -0
- package/dist/weavesql/weavedb/run_sql.d.ts +247 -0
- package/dist/weavesql/weavedb/run_sql.js +415 -0
- package/dist/weavesql/weavedb/suite_sql.d.ts +228 -0
- package/dist/weavesql/weavedb/suite_sql.js +399 -0
- package/dist/weavesql/weavedb/test_case_sql.d.ts +261 -0
- package/dist/weavesql/weavedb/test_case_sql.js +446 -0
- package/dist/weavesql/weavedb/test_script_sql.d.ts +290 -0
- package/dist/weavesql/weavedb/test_script_sql.js +488 -0
- package/dist/weavesql/weavedb/traceability_sql.d.ts +59 -0
- package/dist/weavesql/weavedb/traceability_sql.js +155 -0
- package/package.json +1 -1
|
@@ -0,0 +1,488 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.deleteScriptBindingQuery = exports.listScriptBindingsQuery = exports.upsertScriptBindingQuery = exports.setCurrentTestScriptVersionQuery = exports.getNextTestScriptVersionNumberQuery = exports.listTestScriptVersionsQuery = exports.getTestScriptVersionQuery = exports.createTestScriptVersionQuery = exports.deleteTestScriptQuery = exports.archiveTestScriptQuery = exports.updateTestScriptQuery = exports.listTestScriptsByWorkflowQuery = exports.getTestScriptQuery = exports.createTestScriptQuery = void 0;
|
|
4
|
+
exports.createTestScript = createTestScript;
|
|
5
|
+
exports.getTestScript = getTestScript;
|
|
6
|
+
exports.listTestScriptsByWorkflow = listTestScriptsByWorkflow;
|
|
7
|
+
exports.updateTestScript = updateTestScript;
|
|
8
|
+
exports.archiveTestScript = archiveTestScript;
|
|
9
|
+
exports.deleteTestScript = deleteTestScript;
|
|
10
|
+
exports.createTestScriptVersion = createTestScriptVersion;
|
|
11
|
+
exports.getTestScriptVersion = getTestScriptVersion;
|
|
12
|
+
exports.listTestScriptVersions = listTestScriptVersions;
|
|
13
|
+
exports.getNextTestScriptVersionNumber = getNextTestScriptVersionNumber;
|
|
14
|
+
exports.setCurrentTestScriptVersion = setCurrentTestScriptVersion;
|
|
15
|
+
exports.upsertScriptBinding = upsertScriptBinding;
|
|
16
|
+
exports.listScriptBindings = listScriptBindings;
|
|
17
|
+
exports.deleteScriptBinding = deleteScriptBinding;
|
|
18
|
+
exports.createTestScriptQuery = `-- name: CreateTestScript :one
|
|
19
|
+
INSERT INTO weave_v1.test_script (
|
|
20
|
+
id,
|
|
21
|
+
workflow_id,
|
|
22
|
+
test_case_id,
|
|
23
|
+
name,
|
|
24
|
+
description,
|
|
25
|
+
language,
|
|
26
|
+
framework,
|
|
27
|
+
status,
|
|
28
|
+
metadata
|
|
29
|
+
)
|
|
30
|
+
VALUES (
|
|
31
|
+
$1,
|
|
32
|
+
$2,
|
|
33
|
+
$3,
|
|
34
|
+
$4,
|
|
35
|
+
$5,
|
|
36
|
+
$6,
|
|
37
|
+
$7,
|
|
38
|
+
$8,
|
|
39
|
+
$9
|
|
40
|
+
)
|
|
41
|
+
RETURNING id, workflow_id, test_case_id, name, description, language, framework, status, current_version_id, metadata, created_at, updated_at, archived_at`;
|
|
42
|
+
async function createTestScript(client, args) {
|
|
43
|
+
const result = await client.query({
|
|
44
|
+
text: exports.createTestScriptQuery,
|
|
45
|
+
values: [args.id, args.workflowId, args.testCaseId, args.name, args.description, args.language, args.framework, args.status, args.metadata],
|
|
46
|
+
rowMode: "array"
|
|
47
|
+
});
|
|
48
|
+
if (result.rows.length !== 1) {
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
51
|
+
const row = result.rows[0];
|
|
52
|
+
return {
|
|
53
|
+
id: row[0],
|
|
54
|
+
workflowId: row[1],
|
|
55
|
+
testCaseId: row[2],
|
|
56
|
+
name: row[3],
|
|
57
|
+
description: row[4],
|
|
58
|
+
language: row[5],
|
|
59
|
+
framework: row[6],
|
|
60
|
+
status: row[7],
|
|
61
|
+
currentVersionId: row[8],
|
|
62
|
+
metadata: row[9],
|
|
63
|
+
createdAt: row[10],
|
|
64
|
+
updatedAt: row[11],
|
|
65
|
+
archivedAt: row[12]
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
exports.getTestScriptQuery = `-- name: GetTestScript :one
|
|
69
|
+
SELECT id, workflow_id, test_case_id, name, description, language, framework, status, current_version_id, metadata, created_at, updated_at, archived_at
|
|
70
|
+
FROM weave_v1.test_script
|
|
71
|
+
WHERE id = $1
|
|
72
|
+
AND workflow_id = $2`;
|
|
73
|
+
async function getTestScript(client, args) {
|
|
74
|
+
const result = await client.query({
|
|
75
|
+
text: exports.getTestScriptQuery,
|
|
76
|
+
values: [args.id, args.workflowId],
|
|
77
|
+
rowMode: "array"
|
|
78
|
+
});
|
|
79
|
+
if (result.rows.length !== 1) {
|
|
80
|
+
return null;
|
|
81
|
+
}
|
|
82
|
+
const row = result.rows[0];
|
|
83
|
+
return {
|
|
84
|
+
id: row[0],
|
|
85
|
+
workflowId: row[1],
|
|
86
|
+
testCaseId: row[2],
|
|
87
|
+
name: row[3],
|
|
88
|
+
description: row[4],
|
|
89
|
+
language: row[5],
|
|
90
|
+
framework: row[6],
|
|
91
|
+
status: row[7],
|
|
92
|
+
currentVersionId: row[8],
|
|
93
|
+
metadata: row[9],
|
|
94
|
+
createdAt: row[10],
|
|
95
|
+
updatedAt: row[11],
|
|
96
|
+
archivedAt: row[12]
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
exports.listTestScriptsByWorkflowQuery = `-- name: ListTestScriptsByWorkflow :many
|
|
100
|
+
SELECT id, workflow_id, test_case_id, name, description, language, framework, status, current_version_id, metadata, created_at, updated_at, archived_at
|
|
101
|
+
FROM weave_v1.test_script
|
|
102
|
+
WHERE workflow_id = $1
|
|
103
|
+
AND ($2::BOOLEAN OR archived_at IS NULL)
|
|
104
|
+
ORDER BY updated_at DESC
|
|
105
|
+
LIMIT $4
|
|
106
|
+
OFFSET $3`;
|
|
107
|
+
async function listTestScriptsByWorkflow(client, args) {
|
|
108
|
+
const result = await client.query({
|
|
109
|
+
text: exports.listTestScriptsByWorkflowQuery,
|
|
110
|
+
values: [args.workflowId, args.includeArchived, args.pageOffset, args.pageSize],
|
|
111
|
+
rowMode: "array"
|
|
112
|
+
});
|
|
113
|
+
return result.rows.map(row => {
|
|
114
|
+
return {
|
|
115
|
+
id: row[0],
|
|
116
|
+
workflowId: row[1],
|
|
117
|
+
testCaseId: row[2],
|
|
118
|
+
name: row[3],
|
|
119
|
+
description: row[4],
|
|
120
|
+
language: row[5],
|
|
121
|
+
framework: row[6],
|
|
122
|
+
status: row[7],
|
|
123
|
+
currentVersionId: row[8],
|
|
124
|
+
metadata: row[9],
|
|
125
|
+
createdAt: row[10],
|
|
126
|
+
updatedAt: row[11],
|
|
127
|
+
archivedAt: row[12]
|
|
128
|
+
};
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
exports.updateTestScriptQuery = `-- name: UpdateTestScript :one
|
|
132
|
+
UPDATE weave_v1.test_script
|
|
133
|
+
SET test_case_id = $1,
|
|
134
|
+
name = $2,
|
|
135
|
+
description = $3,
|
|
136
|
+
language = $4,
|
|
137
|
+
framework = $5,
|
|
138
|
+
status = $6,
|
|
139
|
+
metadata = $7,
|
|
140
|
+
updated_at = NOW()
|
|
141
|
+
WHERE id = $8
|
|
142
|
+
AND workflow_id = $9
|
|
143
|
+
RETURNING id, workflow_id, test_case_id, name, description, language, framework, status, current_version_id, metadata, created_at, updated_at, archived_at`;
|
|
144
|
+
async function updateTestScript(client, args) {
|
|
145
|
+
const result = await client.query({
|
|
146
|
+
text: exports.updateTestScriptQuery,
|
|
147
|
+
values: [args.testCaseId, args.name, args.description, args.language, args.framework, args.status, args.metadata, args.id, args.workflowId],
|
|
148
|
+
rowMode: "array"
|
|
149
|
+
});
|
|
150
|
+
if (result.rows.length !== 1) {
|
|
151
|
+
return null;
|
|
152
|
+
}
|
|
153
|
+
const row = result.rows[0];
|
|
154
|
+
return {
|
|
155
|
+
id: row[0],
|
|
156
|
+
workflowId: row[1],
|
|
157
|
+
testCaseId: row[2],
|
|
158
|
+
name: row[3],
|
|
159
|
+
description: row[4],
|
|
160
|
+
language: row[5],
|
|
161
|
+
framework: row[6],
|
|
162
|
+
status: row[7],
|
|
163
|
+
currentVersionId: row[8],
|
|
164
|
+
metadata: row[9],
|
|
165
|
+
createdAt: row[10],
|
|
166
|
+
updatedAt: row[11],
|
|
167
|
+
archivedAt: row[12]
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
exports.archiveTestScriptQuery = `-- name: ArchiveTestScript :one
|
|
171
|
+
UPDATE weave_v1.test_script
|
|
172
|
+
SET status = 'archived',
|
|
173
|
+
archived_at = NOW(),
|
|
174
|
+
updated_at = NOW()
|
|
175
|
+
WHERE id = $1
|
|
176
|
+
AND workflow_id = $2
|
|
177
|
+
RETURNING id, workflow_id, test_case_id, name, description, language, framework, status, current_version_id, metadata, created_at, updated_at, archived_at`;
|
|
178
|
+
async function archiveTestScript(client, args) {
|
|
179
|
+
const result = await client.query({
|
|
180
|
+
text: exports.archiveTestScriptQuery,
|
|
181
|
+
values: [args.id, args.workflowId],
|
|
182
|
+
rowMode: "array"
|
|
183
|
+
});
|
|
184
|
+
if (result.rows.length !== 1) {
|
|
185
|
+
return null;
|
|
186
|
+
}
|
|
187
|
+
const row = result.rows[0];
|
|
188
|
+
return {
|
|
189
|
+
id: row[0],
|
|
190
|
+
workflowId: row[1],
|
|
191
|
+
testCaseId: row[2],
|
|
192
|
+
name: row[3],
|
|
193
|
+
description: row[4],
|
|
194
|
+
language: row[5],
|
|
195
|
+
framework: row[6],
|
|
196
|
+
status: row[7],
|
|
197
|
+
currentVersionId: row[8],
|
|
198
|
+
metadata: row[9],
|
|
199
|
+
createdAt: row[10],
|
|
200
|
+
updatedAt: row[11],
|
|
201
|
+
archivedAt: row[12]
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
exports.deleteTestScriptQuery = `-- name: DeleteTestScript :exec
|
|
205
|
+
DELETE
|
|
206
|
+
FROM weave_v1.test_script
|
|
207
|
+
WHERE id = $1
|
|
208
|
+
AND workflow_id = $2`;
|
|
209
|
+
async function deleteTestScript(client, args) {
|
|
210
|
+
await client.query({
|
|
211
|
+
text: exports.deleteTestScriptQuery,
|
|
212
|
+
values: [args.id, args.workflowId],
|
|
213
|
+
rowMode: "array"
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
exports.createTestScriptVersionQuery = `-- name: CreateTestScriptVersion :one
|
|
217
|
+
INSERT INTO weave_v1.test_script_version (
|
|
218
|
+
id,
|
|
219
|
+
test_script_id,
|
|
220
|
+
version_number,
|
|
221
|
+
source_code,
|
|
222
|
+
metadata,
|
|
223
|
+
prompt_version,
|
|
224
|
+
source_location_type,
|
|
225
|
+
storage_connection_id,
|
|
226
|
+
source_uri,
|
|
227
|
+
external_revision,
|
|
228
|
+
source_checksum,
|
|
229
|
+
source_size_bytes
|
|
230
|
+
)
|
|
231
|
+
VALUES (
|
|
232
|
+
$1,
|
|
233
|
+
$2,
|
|
234
|
+
$3,
|
|
235
|
+
$4,
|
|
236
|
+
$5,
|
|
237
|
+
$6,
|
|
238
|
+
$7,
|
|
239
|
+
$8,
|
|
240
|
+
$9,
|
|
241
|
+
$10,
|
|
242
|
+
$11,
|
|
243
|
+
$12
|
|
244
|
+
)
|
|
245
|
+
RETURNING id, test_script_id, version_number, source_code, metadata, prompt_version, source_location_type, storage_connection_id, source_uri, external_revision, source_checksum, source_size_bytes, created_at`;
|
|
246
|
+
async function createTestScriptVersion(client, args) {
|
|
247
|
+
const result = await client.query({
|
|
248
|
+
text: exports.createTestScriptVersionQuery,
|
|
249
|
+
values: [args.id, args.testScriptId, args.versionNumber, args.sourceCode, args.metadata, args.promptVersion, args.sourceLocationType, args.storageConnectionId, args.sourceUri, args.externalRevision, args.sourceChecksum, args.sourceSizeBytes],
|
|
250
|
+
rowMode: "array"
|
|
251
|
+
});
|
|
252
|
+
if (result.rows.length !== 1) {
|
|
253
|
+
return null;
|
|
254
|
+
}
|
|
255
|
+
const row = result.rows[0];
|
|
256
|
+
return {
|
|
257
|
+
id: row[0],
|
|
258
|
+
testScriptId: row[1],
|
|
259
|
+
versionNumber: row[2],
|
|
260
|
+
sourceCode: row[3],
|
|
261
|
+
metadata: row[4],
|
|
262
|
+
promptVersion: row[5],
|
|
263
|
+
sourceLocationType: row[6],
|
|
264
|
+
storageConnectionId: row[7],
|
|
265
|
+
sourceUri: row[8],
|
|
266
|
+
externalRevision: row[9],
|
|
267
|
+
sourceChecksum: row[10],
|
|
268
|
+
sourceSizeBytes: row[11],
|
|
269
|
+
createdAt: row[12]
|
|
270
|
+
};
|
|
271
|
+
}
|
|
272
|
+
exports.getTestScriptVersionQuery = `-- name: GetTestScriptVersion :one
|
|
273
|
+
SELECT sv.id, sv.test_script_id, sv.version_number, sv.source_code, sv.metadata, sv.prompt_version, sv.source_location_type, sv.storage_connection_id, sv.source_uri, sv.external_revision, sv.source_checksum, sv.source_size_bytes, sv.created_at
|
|
274
|
+
FROM weave_v1.test_script_version sv
|
|
275
|
+
INNER JOIN weave_v1.test_script s ON s.id = sv.test_script_id
|
|
276
|
+
WHERE sv.id = $1
|
|
277
|
+
AND sv.test_script_id = $2
|
|
278
|
+
AND s.workflow_id = $3`;
|
|
279
|
+
async function getTestScriptVersion(client, args) {
|
|
280
|
+
const result = await client.query({
|
|
281
|
+
text: exports.getTestScriptVersionQuery,
|
|
282
|
+
values: [args.id, args.testScriptId, args.workflowId],
|
|
283
|
+
rowMode: "array"
|
|
284
|
+
});
|
|
285
|
+
if (result.rows.length !== 1) {
|
|
286
|
+
return null;
|
|
287
|
+
}
|
|
288
|
+
const row = result.rows[0];
|
|
289
|
+
return {
|
|
290
|
+
id: row[0],
|
|
291
|
+
testScriptId: row[1],
|
|
292
|
+
versionNumber: row[2],
|
|
293
|
+
sourceCode: row[3],
|
|
294
|
+
metadata: row[4],
|
|
295
|
+
promptVersion: row[5],
|
|
296
|
+
sourceLocationType: row[6],
|
|
297
|
+
storageConnectionId: row[7],
|
|
298
|
+
sourceUri: row[8],
|
|
299
|
+
externalRevision: row[9],
|
|
300
|
+
sourceChecksum: row[10],
|
|
301
|
+
sourceSizeBytes: row[11],
|
|
302
|
+
createdAt: row[12]
|
|
303
|
+
};
|
|
304
|
+
}
|
|
305
|
+
exports.listTestScriptVersionsQuery = `-- name: ListTestScriptVersions :many
|
|
306
|
+
SELECT sv.id, sv.test_script_id, sv.version_number, sv.source_code, sv.metadata, sv.prompt_version, sv.source_location_type, sv.storage_connection_id, sv.source_uri, sv.external_revision, sv.source_checksum, sv.source_size_bytes, sv.created_at
|
|
307
|
+
FROM weave_v1.test_script_version sv
|
|
308
|
+
INNER JOIN weave_v1.test_script s ON s.id = sv.test_script_id
|
|
309
|
+
WHERE sv.test_script_id = $1
|
|
310
|
+
AND s.workflow_id = $2
|
|
311
|
+
ORDER BY sv.version_number DESC
|
|
312
|
+
LIMIT $4
|
|
313
|
+
OFFSET $3`;
|
|
314
|
+
async function listTestScriptVersions(client, args) {
|
|
315
|
+
const result = await client.query({
|
|
316
|
+
text: exports.listTestScriptVersionsQuery,
|
|
317
|
+
values: [args.testScriptId, args.workflowId, args.pageOffset, args.pageSize],
|
|
318
|
+
rowMode: "array"
|
|
319
|
+
});
|
|
320
|
+
return result.rows.map(row => {
|
|
321
|
+
return {
|
|
322
|
+
id: row[0],
|
|
323
|
+
testScriptId: row[1],
|
|
324
|
+
versionNumber: row[2],
|
|
325
|
+
sourceCode: row[3],
|
|
326
|
+
metadata: row[4],
|
|
327
|
+
promptVersion: row[5],
|
|
328
|
+
sourceLocationType: row[6],
|
|
329
|
+
storageConnectionId: row[7],
|
|
330
|
+
sourceUri: row[8],
|
|
331
|
+
externalRevision: row[9],
|
|
332
|
+
sourceChecksum: row[10],
|
|
333
|
+
sourceSizeBytes: row[11],
|
|
334
|
+
createdAt: row[12]
|
|
335
|
+
};
|
|
336
|
+
});
|
|
337
|
+
}
|
|
338
|
+
exports.getNextTestScriptVersionNumberQuery = `-- name: GetNextTestScriptVersionNumber :one
|
|
339
|
+
SELECT COALESCE(MAX(version_number), 0)::INTEGER + 1 AS version_number
|
|
340
|
+
FROM weave_v1.test_script_version
|
|
341
|
+
WHERE test_script_id = $1`;
|
|
342
|
+
async function getNextTestScriptVersionNumber(client, args) {
|
|
343
|
+
const result = await client.query({
|
|
344
|
+
text: exports.getNextTestScriptVersionNumberQuery,
|
|
345
|
+
values: [args.testScriptId],
|
|
346
|
+
rowMode: "array"
|
|
347
|
+
});
|
|
348
|
+
if (result.rows.length !== 1) {
|
|
349
|
+
return null;
|
|
350
|
+
}
|
|
351
|
+
const row = result.rows[0];
|
|
352
|
+
return {
|
|
353
|
+
versionNumber: row[0]
|
|
354
|
+
};
|
|
355
|
+
}
|
|
356
|
+
exports.setCurrentTestScriptVersionQuery = `-- name: SetCurrentTestScriptVersion :one
|
|
357
|
+
UPDATE weave_v1.test_script
|
|
358
|
+
SET current_version_id = $1,
|
|
359
|
+
updated_at = NOW()
|
|
360
|
+
WHERE id = $2
|
|
361
|
+
AND workflow_id = $3
|
|
362
|
+
RETURNING id, workflow_id, test_case_id, name, description, language, framework, status, current_version_id, metadata, created_at, updated_at, archived_at`;
|
|
363
|
+
async function setCurrentTestScriptVersion(client, args) {
|
|
364
|
+
const result = await client.query({
|
|
365
|
+
text: exports.setCurrentTestScriptVersionQuery,
|
|
366
|
+
values: [args.currentVersionId, args.id, args.workflowId],
|
|
367
|
+
rowMode: "array"
|
|
368
|
+
});
|
|
369
|
+
if (result.rows.length !== 1) {
|
|
370
|
+
return null;
|
|
371
|
+
}
|
|
372
|
+
const row = result.rows[0];
|
|
373
|
+
return {
|
|
374
|
+
id: row[0],
|
|
375
|
+
workflowId: row[1],
|
|
376
|
+
testCaseId: row[2],
|
|
377
|
+
name: row[3],
|
|
378
|
+
description: row[4],
|
|
379
|
+
language: row[5],
|
|
380
|
+
framework: row[6],
|
|
381
|
+
status: row[7],
|
|
382
|
+
currentVersionId: row[8],
|
|
383
|
+
metadata: row[9],
|
|
384
|
+
createdAt: row[10],
|
|
385
|
+
updatedAt: row[11],
|
|
386
|
+
archivedAt: row[12]
|
|
387
|
+
};
|
|
388
|
+
}
|
|
389
|
+
exports.upsertScriptBindingQuery = `-- name: UpsertScriptBinding :one
|
|
390
|
+
INSERT INTO weave_v1.script_binding (
|
|
391
|
+
id,
|
|
392
|
+
test_script_id,
|
|
393
|
+
binding_key,
|
|
394
|
+
binding_type,
|
|
395
|
+
dataset_id,
|
|
396
|
+
column_name,
|
|
397
|
+
default_value,
|
|
398
|
+
is_required,
|
|
399
|
+
metadata
|
|
400
|
+
)
|
|
401
|
+
VALUES (
|
|
402
|
+
$1,
|
|
403
|
+
$2,
|
|
404
|
+
$3,
|
|
405
|
+
$4,
|
|
406
|
+
$5,
|
|
407
|
+
$6,
|
|
408
|
+
$7,
|
|
409
|
+
$8,
|
|
410
|
+
$9
|
|
411
|
+
)
|
|
412
|
+
ON CONFLICT (test_script_id, binding_key) DO UPDATE
|
|
413
|
+
SET binding_type = EXCLUDED.binding_type,
|
|
414
|
+
dataset_id = EXCLUDED.dataset_id,
|
|
415
|
+
column_name = EXCLUDED.column_name,
|
|
416
|
+
default_value = EXCLUDED.default_value,
|
|
417
|
+
is_required = EXCLUDED.is_required,
|
|
418
|
+
metadata = EXCLUDED.metadata,
|
|
419
|
+
updated_at = NOW()
|
|
420
|
+
RETURNING id, test_script_id, binding_key, binding_type, dataset_id, column_name, default_value, is_required, metadata, created_at, updated_at`;
|
|
421
|
+
async function upsertScriptBinding(client, args) {
|
|
422
|
+
const result = await client.query({
|
|
423
|
+
text: exports.upsertScriptBindingQuery,
|
|
424
|
+
values: [args.id, args.testScriptId, args.bindingKey, args.bindingType, args.datasetId, args.columnName, args.defaultValue, args.isRequired, args.metadata],
|
|
425
|
+
rowMode: "array"
|
|
426
|
+
});
|
|
427
|
+
if (result.rows.length !== 1) {
|
|
428
|
+
return null;
|
|
429
|
+
}
|
|
430
|
+
const row = result.rows[0];
|
|
431
|
+
return {
|
|
432
|
+
id: row[0],
|
|
433
|
+
testScriptId: row[1],
|
|
434
|
+
bindingKey: row[2],
|
|
435
|
+
bindingType: row[3],
|
|
436
|
+
datasetId: row[4],
|
|
437
|
+
columnName: row[5],
|
|
438
|
+
defaultValue: row[6],
|
|
439
|
+
isRequired: row[7],
|
|
440
|
+
metadata: row[8],
|
|
441
|
+
createdAt: row[9],
|
|
442
|
+
updatedAt: row[10]
|
|
443
|
+
};
|
|
444
|
+
}
|
|
445
|
+
exports.listScriptBindingsQuery = `-- name: ListScriptBindings :many
|
|
446
|
+
SELECT b.id, b.test_script_id, b.binding_key, b.binding_type, b.dataset_id, b.column_name, b.default_value, b.is_required, b.metadata, b.created_at, b.updated_at
|
|
447
|
+
FROM weave_v1.script_binding b
|
|
448
|
+
INNER JOIN weave_v1.test_script s ON s.id = b.test_script_id
|
|
449
|
+
WHERE b.test_script_id = $1
|
|
450
|
+
AND s.workflow_id = $2
|
|
451
|
+
ORDER BY b.binding_key`;
|
|
452
|
+
async function listScriptBindings(client, args) {
|
|
453
|
+
const result = await client.query({
|
|
454
|
+
text: exports.listScriptBindingsQuery,
|
|
455
|
+
values: [args.testScriptId, args.workflowId],
|
|
456
|
+
rowMode: "array"
|
|
457
|
+
});
|
|
458
|
+
return result.rows.map(row => {
|
|
459
|
+
return {
|
|
460
|
+
id: row[0],
|
|
461
|
+
testScriptId: row[1],
|
|
462
|
+
bindingKey: row[2],
|
|
463
|
+
bindingType: row[3],
|
|
464
|
+
datasetId: row[4],
|
|
465
|
+
columnName: row[5],
|
|
466
|
+
defaultValue: row[6],
|
|
467
|
+
isRequired: row[7],
|
|
468
|
+
metadata: row[8],
|
|
469
|
+
createdAt: row[9],
|
|
470
|
+
updatedAt: row[10]
|
|
471
|
+
};
|
|
472
|
+
});
|
|
473
|
+
}
|
|
474
|
+
exports.deleteScriptBindingQuery = `-- name: DeleteScriptBinding :exec
|
|
475
|
+
DELETE
|
|
476
|
+
FROM weave_v1.script_binding b
|
|
477
|
+
USING weave_v1.test_script s
|
|
478
|
+
WHERE b.id = $1
|
|
479
|
+
AND b.test_script_id = $2
|
|
480
|
+
AND s.id = b.test_script_id
|
|
481
|
+
AND s.workflow_id = $3`;
|
|
482
|
+
async function deleteScriptBinding(client, args) {
|
|
483
|
+
await client.query({
|
|
484
|
+
text: exports.deleteScriptBindingQuery,
|
|
485
|
+
values: [args.id, args.testScriptId, args.workflowId],
|
|
486
|
+
rowMode: "array"
|
|
487
|
+
});
|
|
488
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { QueryArrayConfig, QueryArrayResult } from "pg";
|
|
2
|
+
interface Client {
|
|
3
|
+
query: (config: QueryArrayConfig) => Promise<QueryArrayResult>;
|
|
4
|
+
}
|
|
5
|
+
export declare const listRequirementCoverageMatrixQuery = "-- name: ListRequirementCoverageMatrix :many\nSELECT r.id AS requirement_id,\n r.title AS requirement_title,\n tc.id AS test_case_id,\n tc.title AS test_case_title,\n ts.id AS test_script_id,\n ts.name AS test_script_name,\n s.id AS test_suite_id,\n s.name AS test_suite_name,\n tr.id AS test_run_id,\n tr.status AS test_run_status,\n tcr.status AS test_run_case_status,\n rep.id AS test_report_id\nFROM weave_v1.requirement r\n LEFT JOIN weave_v1.test_case_requirement tcrq ON tcrq.requirement_id = r.id\n LEFT JOIN weave_v1.test_case tc ON tc.id = tcrq.test_case_id\n LEFT JOIN weave_v1.test_script ts ON ts.test_case_id = tc.id\n LEFT JOIN weave_v1.test_suite_item tsi ON tsi.test_case_id = tc.id OR tsi.test_script_id = ts.id\n LEFT JOIN weave_v1.test_suite s ON s.id = tsi.test_suite_id\n LEFT JOIN weave_v1.test_run tr ON tr.test_suite_id = s.id\n LEFT JOIN weave_v1.test_run_case_result tcr ON tcr.test_run_id = tr.id AND\n (tcr.test_case_id = tc.id OR tcr.test_script_id = ts.id)\n LEFT JOIN weave_v1.test_report rep ON rep.test_run_id = tr.id\nWHERE r.workflow_id = $1\nORDER BY r.created_at DESC, tc.created_at DESC NULLS LAST";
|
|
6
|
+
export interface ListRequirementCoverageMatrixArgs {
|
|
7
|
+
workflowId: string;
|
|
8
|
+
}
|
|
9
|
+
export interface ListRequirementCoverageMatrixRow {
|
|
10
|
+
requirementId: string;
|
|
11
|
+
requirementTitle: string;
|
|
12
|
+
testCaseId: string | null;
|
|
13
|
+
testCaseTitle: string | null;
|
|
14
|
+
testScriptId: string | null;
|
|
15
|
+
testScriptName: string | null;
|
|
16
|
+
testSuiteId: string | null;
|
|
17
|
+
testSuiteName: string | null;
|
|
18
|
+
testRunId: string | null;
|
|
19
|
+
testRunStatus: string | null;
|
|
20
|
+
testRunCaseStatus: string | null;
|
|
21
|
+
testReportId: string | null;
|
|
22
|
+
}
|
|
23
|
+
export declare function listRequirementCoverageMatrix(client: Client, args: ListRequirementCoverageMatrixArgs): Promise<ListRequirementCoverageMatrixRow[]>;
|
|
24
|
+
export declare const listTestCaseTraceabilityQuery = "-- name: ListTestCaseTraceability :many\nSELECT tc.id AS test_case_id,\n tc.title AS test_case_title,\n r.id AS requirement_id,\n r.title AS requirement_title,\n ts.id AS test_script_id,\n ts.name AS test_script_name,\n s.id AS test_suite_id,\n s.name AS test_suite_name,\n tr.id AS test_run_id,\n tr.status AS test_run_status,\n tcr.status AS test_run_case_status,\n rep.id AS test_report_id\nFROM weave_v1.test_case tc\n LEFT JOIN weave_v1.test_case_requirement tcrq ON tcrq.test_case_id = tc.id\n LEFT JOIN weave_v1.requirement r ON r.id = tcrq.requirement_id\n LEFT JOIN weave_v1.test_script ts ON ts.test_case_id = tc.id\n LEFT JOIN weave_v1.test_suite_item tsi ON tsi.test_case_id = tc.id OR tsi.test_script_id = ts.id\n LEFT JOIN weave_v1.test_suite s ON s.id = tsi.test_suite_id\n LEFT JOIN weave_v1.test_run tr ON tr.test_suite_id = s.id\n LEFT JOIN weave_v1.test_run_case_result tcr ON tcr.test_run_id = tr.id AND\n (tcr.test_case_id = tc.id OR tcr.test_script_id = ts.id)\n LEFT JOIN weave_v1.test_report rep ON rep.test_run_id = tr.id\nWHERE tc.workflow_id = $1\nORDER BY tc.created_at DESC";
|
|
25
|
+
export interface ListTestCaseTraceabilityArgs {
|
|
26
|
+
workflowId: string;
|
|
27
|
+
}
|
|
28
|
+
export interface ListTestCaseTraceabilityRow {
|
|
29
|
+
testCaseId: string;
|
|
30
|
+
testCaseTitle: string;
|
|
31
|
+
requirementId: string | null;
|
|
32
|
+
requirementTitle: string | null;
|
|
33
|
+
testScriptId: string | null;
|
|
34
|
+
testScriptName: string | null;
|
|
35
|
+
testSuiteId: string | null;
|
|
36
|
+
testSuiteName: string | null;
|
|
37
|
+
testRunId: string | null;
|
|
38
|
+
testRunStatus: string | null;
|
|
39
|
+
testRunCaseStatus: string | null;
|
|
40
|
+
testReportId: string | null;
|
|
41
|
+
}
|
|
42
|
+
export declare function listTestCaseTraceability(client: Client, args: ListTestCaseTraceabilityArgs): Promise<ListTestCaseTraceabilityRow[]>;
|
|
43
|
+
export declare const countRequirementsWithoutTestCasesQuery = "-- name: CountRequirementsWithoutTestCases :one\nSELECT COUNT(*)::INTEGER AS uncovered_requirement_count\nFROM weave_v1.requirement r\nWHERE r.workflow_id = $1\n AND r.archived_at IS NULL\n AND NOT EXISTS (\n SELECT 1\n FROM weave_v1.test_case_requirement tcrq\n INNER JOIN weave_v1.test_case tc ON tc.id = tcrq.test_case_id\n WHERE tcrq.requirement_id = r.id\n AND tc.archived_at IS NULL\n)";
|
|
44
|
+
export interface CountRequirementsWithoutTestCasesArgs {
|
|
45
|
+
workflowId: string;
|
|
46
|
+
}
|
|
47
|
+
export interface CountRequirementsWithoutTestCasesRow {
|
|
48
|
+
uncoveredRequirementCount: number;
|
|
49
|
+
}
|
|
50
|
+
export declare function countRequirementsWithoutTestCases(client: Client, args: CountRequirementsWithoutTestCasesArgs): Promise<CountRequirementsWithoutTestCasesRow | null>;
|
|
51
|
+
export declare const countApprovedTestCasesWithoutScriptsQuery = "-- name: CountApprovedTestCasesWithoutScripts :one\nSELECT COUNT(*)::INTEGER AS unlinked_test_case_count\nFROM weave_v1.test_case tc\nWHERE tc.workflow_id = $1\n AND tc.status = 'approved'\n AND tc.archived_at IS NULL\n AND NOT EXISTS (\n SELECT 1\n FROM weave_v1.test_script ts\n WHERE ts.test_case_id = tc.id\n AND ts.archived_at IS NULL\n)";
|
|
52
|
+
export interface CountApprovedTestCasesWithoutScriptsArgs {
|
|
53
|
+
workflowId: string;
|
|
54
|
+
}
|
|
55
|
+
export interface CountApprovedTestCasesWithoutScriptsRow {
|
|
56
|
+
unlinkedTestCaseCount: number;
|
|
57
|
+
}
|
|
58
|
+
export declare function countApprovedTestCasesWithoutScripts(client: Client, args: CountApprovedTestCasesWithoutScriptsArgs): Promise<CountApprovedTestCasesWithoutScriptsRow | null>;
|
|
59
|
+
export {};
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.countApprovedTestCasesWithoutScriptsQuery = exports.countRequirementsWithoutTestCasesQuery = exports.listTestCaseTraceabilityQuery = exports.listRequirementCoverageMatrixQuery = void 0;
|
|
4
|
+
exports.listRequirementCoverageMatrix = listRequirementCoverageMatrix;
|
|
5
|
+
exports.listTestCaseTraceability = listTestCaseTraceability;
|
|
6
|
+
exports.countRequirementsWithoutTestCases = countRequirementsWithoutTestCases;
|
|
7
|
+
exports.countApprovedTestCasesWithoutScripts = countApprovedTestCasesWithoutScripts;
|
|
8
|
+
exports.listRequirementCoverageMatrixQuery = `-- name: ListRequirementCoverageMatrix :many
|
|
9
|
+
SELECT r.id AS requirement_id,
|
|
10
|
+
r.title AS requirement_title,
|
|
11
|
+
tc.id AS test_case_id,
|
|
12
|
+
tc.title AS test_case_title,
|
|
13
|
+
ts.id AS test_script_id,
|
|
14
|
+
ts.name AS test_script_name,
|
|
15
|
+
s.id AS test_suite_id,
|
|
16
|
+
s.name AS test_suite_name,
|
|
17
|
+
tr.id AS test_run_id,
|
|
18
|
+
tr.status AS test_run_status,
|
|
19
|
+
tcr.status AS test_run_case_status,
|
|
20
|
+
rep.id AS test_report_id
|
|
21
|
+
FROM weave_v1.requirement r
|
|
22
|
+
LEFT JOIN weave_v1.test_case_requirement tcrq ON tcrq.requirement_id = r.id
|
|
23
|
+
LEFT JOIN weave_v1.test_case tc ON tc.id = tcrq.test_case_id
|
|
24
|
+
LEFT JOIN weave_v1.test_script ts ON ts.test_case_id = tc.id
|
|
25
|
+
LEFT JOIN weave_v1.test_suite_item tsi ON tsi.test_case_id = tc.id OR tsi.test_script_id = ts.id
|
|
26
|
+
LEFT JOIN weave_v1.test_suite s ON s.id = tsi.test_suite_id
|
|
27
|
+
LEFT JOIN weave_v1.test_run tr ON tr.test_suite_id = s.id
|
|
28
|
+
LEFT JOIN weave_v1.test_run_case_result tcr ON tcr.test_run_id = tr.id AND
|
|
29
|
+
(tcr.test_case_id = tc.id OR tcr.test_script_id = ts.id)
|
|
30
|
+
LEFT JOIN weave_v1.test_report rep ON rep.test_run_id = tr.id
|
|
31
|
+
WHERE r.workflow_id = $1
|
|
32
|
+
ORDER BY r.created_at DESC, tc.created_at DESC NULLS LAST`;
|
|
33
|
+
async function listRequirementCoverageMatrix(client, args) {
|
|
34
|
+
const result = await client.query({
|
|
35
|
+
text: exports.listRequirementCoverageMatrixQuery,
|
|
36
|
+
values: [args.workflowId],
|
|
37
|
+
rowMode: "array"
|
|
38
|
+
});
|
|
39
|
+
return result.rows.map(row => {
|
|
40
|
+
return {
|
|
41
|
+
requirementId: row[0],
|
|
42
|
+
requirementTitle: row[1],
|
|
43
|
+
testCaseId: row[2],
|
|
44
|
+
testCaseTitle: row[3],
|
|
45
|
+
testScriptId: row[4],
|
|
46
|
+
testScriptName: row[5],
|
|
47
|
+
testSuiteId: row[6],
|
|
48
|
+
testSuiteName: row[7],
|
|
49
|
+
testRunId: row[8],
|
|
50
|
+
testRunStatus: row[9],
|
|
51
|
+
testRunCaseStatus: row[10],
|
|
52
|
+
testReportId: row[11]
|
|
53
|
+
};
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
exports.listTestCaseTraceabilityQuery = `-- name: ListTestCaseTraceability :many
|
|
57
|
+
SELECT tc.id AS test_case_id,
|
|
58
|
+
tc.title AS test_case_title,
|
|
59
|
+
r.id AS requirement_id,
|
|
60
|
+
r.title AS requirement_title,
|
|
61
|
+
ts.id AS test_script_id,
|
|
62
|
+
ts.name AS test_script_name,
|
|
63
|
+
s.id AS test_suite_id,
|
|
64
|
+
s.name AS test_suite_name,
|
|
65
|
+
tr.id AS test_run_id,
|
|
66
|
+
tr.status AS test_run_status,
|
|
67
|
+
tcr.status AS test_run_case_status,
|
|
68
|
+
rep.id AS test_report_id
|
|
69
|
+
FROM weave_v1.test_case tc
|
|
70
|
+
LEFT JOIN weave_v1.test_case_requirement tcrq ON tcrq.test_case_id = tc.id
|
|
71
|
+
LEFT JOIN weave_v1.requirement r ON r.id = tcrq.requirement_id
|
|
72
|
+
LEFT JOIN weave_v1.test_script ts ON ts.test_case_id = tc.id
|
|
73
|
+
LEFT JOIN weave_v1.test_suite_item tsi ON tsi.test_case_id = tc.id OR tsi.test_script_id = ts.id
|
|
74
|
+
LEFT JOIN weave_v1.test_suite s ON s.id = tsi.test_suite_id
|
|
75
|
+
LEFT JOIN weave_v1.test_run tr ON tr.test_suite_id = s.id
|
|
76
|
+
LEFT JOIN weave_v1.test_run_case_result tcr ON tcr.test_run_id = tr.id AND
|
|
77
|
+
(tcr.test_case_id = tc.id OR tcr.test_script_id = ts.id)
|
|
78
|
+
LEFT JOIN weave_v1.test_report rep ON rep.test_run_id = tr.id
|
|
79
|
+
WHERE tc.workflow_id = $1
|
|
80
|
+
ORDER BY tc.created_at DESC`;
|
|
81
|
+
async function listTestCaseTraceability(client, args) {
|
|
82
|
+
const result = await client.query({
|
|
83
|
+
text: exports.listTestCaseTraceabilityQuery,
|
|
84
|
+
values: [args.workflowId],
|
|
85
|
+
rowMode: "array"
|
|
86
|
+
});
|
|
87
|
+
return result.rows.map(row => {
|
|
88
|
+
return {
|
|
89
|
+
testCaseId: row[0],
|
|
90
|
+
testCaseTitle: row[1],
|
|
91
|
+
requirementId: row[2],
|
|
92
|
+
requirementTitle: row[3],
|
|
93
|
+
testScriptId: row[4],
|
|
94
|
+
testScriptName: row[5],
|
|
95
|
+
testSuiteId: row[6],
|
|
96
|
+
testSuiteName: row[7],
|
|
97
|
+
testRunId: row[8],
|
|
98
|
+
testRunStatus: row[9],
|
|
99
|
+
testRunCaseStatus: row[10],
|
|
100
|
+
testReportId: row[11]
|
|
101
|
+
};
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
exports.countRequirementsWithoutTestCasesQuery = `-- name: CountRequirementsWithoutTestCases :one
|
|
105
|
+
SELECT COUNT(*)::INTEGER AS uncovered_requirement_count
|
|
106
|
+
FROM weave_v1.requirement r
|
|
107
|
+
WHERE r.workflow_id = $1
|
|
108
|
+
AND r.archived_at IS NULL
|
|
109
|
+
AND NOT EXISTS (
|
|
110
|
+
SELECT 1
|
|
111
|
+
FROM weave_v1.test_case_requirement tcrq
|
|
112
|
+
INNER JOIN weave_v1.test_case tc ON tc.id = tcrq.test_case_id
|
|
113
|
+
WHERE tcrq.requirement_id = r.id
|
|
114
|
+
AND tc.archived_at IS NULL
|
|
115
|
+
)`;
|
|
116
|
+
async function countRequirementsWithoutTestCases(client, args) {
|
|
117
|
+
const result = await client.query({
|
|
118
|
+
text: exports.countRequirementsWithoutTestCasesQuery,
|
|
119
|
+
values: [args.workflowId],
|
|
120
|
+
rowMode: "array"
|
|
121
|
+
});
|
|
122
|
+
if (result.rows.length !== 1) {
|
|
123
|
+
return null;
|
|
124
|
+
}
|
|
125
|
+
const row = result.rows[0];
|
|
126
|
+
return {
|
|
127
|
+
uncoveredRequirementCount: row[0]
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
exports.countApprovedTestCasesWithoutScriptsQuery = `-- name: CountApprovedTestCasesWithoutScripts :one
|
|
131
|
+
SELECT COUNT(*)::INTEGER AS unlinked_test_case_count
|
|
132
|
+
FROM weave_v1.test_case tc
|
|
133
|
+
WHERE tc.workflow_id = $1
|
|
134
|
+
AND tc.status = 'approved'
|
|
135
|
+
AND tc.archived_at IS NULL
|
|
136
|
+
AND NOT EXISTS (
|
|
137
|
+
SELECT 1
|
|
138
|
+
FROM weave_v1.test_script ts
|
|
139
|
+
WHERE ts.test_case_id = tc.id
|
|
140
|
+
AND ts.archived_at IS NULL
|
|
141
|
+
)`;
|
|
142
|
+
async function countApprovedTestCasesWithoutScripts(client, args) {
|
|
143
|
+
const result = await client.query({
|
|
144
|
+
text: exports.countApprovedTestCasesWithoutScriptsQuery,
|
|
145
|
+
values: [args.workflowId],
|
|
146
|
+
rowMode: "array"
|
|
147
|
+
});
|
|
148
|
+
if (result.rows.length !== 1) {
|
|
149
|
+
return null;
|
|
150
|
+
}
|
|
151
|
+
const row = result.rows[0];
|
|
152
|
+
return {
|
|
153
|
+
unlinkedTestCaseCount: row[0]
|
|
154
|
+
};
|
|
155
|
+
}
|