weave-typescript 0.11.14 → 0.11.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 +296 -0
- package/dist/weaveapi/data/v1/service.pb.js +2779 -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 +390 -0
- package/dist/weaveapi/input/v1/service.pb.js +3612 -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 +318 -0
- package/dist/weaveapi/integration/v1/service.pb.js +2994 -0
- package/dist/weaveapi/project/v1/project.pb.d.ts +1 -0
- package/dist/weaveapi/project/v1/project.pb.js +17 -1
- package/dist/weaveapi/project/v1/service.pb.d.ts +25 -0
- package/dist/weaveapi/project/v1/service.pb.js +248 -5
- package/dist/weaveapi/report/v1/report.pb.d.ts +81 -0
- package/dist/weaveapi/report/v1/report.pb.js +678 -0
- package/dist/weaveapi/report/v1/service.pb.d.ts +194 -0
- package/dist/weaveapi/report/v1/service.pb.js +1925 -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 +390 -0
- package/dist/weaveapi/requirement/v1/service.pb.js +3638 -0
- package/dist/weaveapi/run/v1/run.pb.d.ts +117 -0
- package/dist/weaveapi/run/v1/run.pb.js +1155 -0
- package/dist/weaveapi/run/v1/service.pb.d.ts +229 -0
- package/dist/weaveapi/run/v1/service.pb.js +2428 -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 +502 -0
- package/dist/weaveapi/script/v1/service.pb.js +4873 -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 +539 -0
- package/dist/weaveapi/suite/v1/service.pb.js +5281 -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 +498 -0
- package/dist/weaveapi/testcase/v1/service.pb.js +4730 -0
- package/dist/weaveapi/testcase/v1/testcase.pb.d.ts +91 -0
- package/dist/weaveapi/testcase/v1/testcase.pb.js +794 -0
- package/dist/weaveapi/workflow/v1/service.pb.d.ts +26 -0
- package/dist/weaveapi/workflow/v1/service.pb.js +293 -5
- package/dist/weaveapi/workflow/v1/workflow.pb.d.ts +1 -0
- package/dist/weaveapi/workflow/v1/workflow.pb.js +17 -1
- package/dist/weavesql/weavedb/data_asset_sql.d.ts +206 -0
- package/dist/weavesql/weavedb/data_asset_sql.js +335 -0
- package/dist/weavesql/weavedb/input_sql.d.ts +293 -0
- package/dist/weavesql/weavedb/input_sql.js +500 -0
- package/dist/weavesql/weavedb/integration_sql.d.ts +236 -0
- package/dist/weavesql/weavedb/integration_sql.js +377 -0
- package/dist/weavesql/weavedb/project_sql.d.ts +29 -5
- package/dist/weavesql/weavedb/project_sql.js +73 -37
- package/dist/weavesql/weavedb/report_sql.d.ts +192 -0
- package/dist/weavesql/weavedb/report_sql.js +308 -0
- package/dist/weavesql/weavedb/requirement_sql.d.ts +231 -0
- package/dist/weavesql/weavedb/requirement_sql.js +399 -0
- package/dist/weavesql/weavedb/run_sql.d.ts +283 -0
- package/dist/weavesql/weavedb/run_sql.js +462 -0
- package/dist/weavesql/weavedb/suite_sql.d.ts +354 -0
- package/dist/weavesql/weavedb/suite_sql.js +631 -0
- package/dist/weavesql/weavedb/test_case_sql.d.ts +325 -0
- package/dist/weavesql/weavedb/test_case_sql.js +563 -0
- package/dist/weavesql/weavedb/test_script_sql.d.ts +354 -0
- package/dist/weavesql/weavedb/test_script_sql.js +605 -0
- package/dist/weavesql/weavedb/traceability_sql.d.ts +117 -0
- package/dist/weavesql/weavedb/traceability_sql.js +363 -0
- package/dist/weavesql/weavedb/workflow_sql.d.ts +30 -5
- package/dist/weavesql/weavedb/workflow_sql.js +76 -38
- package/package.json +1 -1
|
@@ -0,0 +1,308 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.listWorkflowEventsByWorkflowQuery = exports.listWorkflowEventsByProjectQuery = exports.createWorkflowEventQuery = exports.deleteTestReportQuery = exports.archiveTestReportQuery = exports.listTestReportsByWorkflowQuery = exports.listTestReportsByProjectQuery = exports.getTestReportQuery = exports.createTestReportQuery = void 0;
|
|
4
|
+
exports.createTestReport = createTestReport;
|
|
5
|
+
exports.getTestReport = getTestReport;
|
|
6
|
+
exports.listTestReportsByProject = listTestReportsByProject;
|
|
7
|
+
exports.listTestReportsByWorkflow = listTestReportsByWorkflow;
|
|
8
|
+
exports.archiveTestReport = archiveTestReport;
|
|
9
|
+
exports.deleteTestReport = deleteTestReport;
|
|
10
|
+
exports.createWorkflowEvent = createWorkflowEvent;
|
|
11
|
+
exports.listWorkflowEventsByProject = listWorkflowEventsByProject;
|
|
12
|
+
exports.listWorkflowEventsByWorkflow = listWorkflowEventsByWorkflow;
|
|
13
|
+
exports.createTestReportQuery = `-- name: CreateTestReport :one
|
|
14
|
+
INSERT INTO weave_v1.test_report (
|
|
15
|
+
id,
|
|
16
|
+
project_id,
|
|
17
|
+
workflow_id,
|
|
18
|
+
test_run_id,
|
|
19
|
+
status,
|
|
20
|
+
storage_connection_id,
|
|
21
|
+
allure_uri,
|
|
22
|
+
summary,
|
|
23
|
+
metadata,
|
|
24
|
+
generated_at
|
|
25
|
+
)
|
|
26
|
+
VALUES (
|
|
27
|
+
$1,
|
|
28
|
+
$2,
|
|
29
|
+
$3,
|
|
30
|
+
$4,
|
|
31
|
+
$5,
|
|
32
|
+
$6,
|
|
33
|
+
$7,
|
|
34
|
+
$8,
|
|
35
|
+
$9,
|
|
36
|
+
$10
|
|
37
|
+
)
|
|
38
|
+
RETURNING id, project_id, workflow_id, test_run_id, status, storage_connection_id, allure_uri, summary, metadata, generated_at, created_at, updated_at, archived_at`;
|
|
39
|
+
async function createTestReport(client, args) {
|
|
40
|
+
const result = await client.query({
|
|
41
|
+
text: exports.createTestReportQuery,
|
|
42
|
+
values: [args.id, args.projectId, args.workflowId, args.testRunId, args.status, args.storageConnectionId, args.allureUri, args.summary, args.metadata, args.generatedAt],
|
|
43
|
+
rowMode: "array"
|
|
44
|
+
});
|
|
45
|
+
if (result.rows.length !== 1) {
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
const row = result.rows[0];
|
|
49
|
+
return {
|
|
50
|
+
id: row[0],
|
|
51
|
+
projectId: row[1],
|
|
52
|
+
workflowId: row[2],
|
|
53
|
+
testRunId: row[3],
|
|
54
|
+
status: row[4],
|
|
55
|
+
storageConnectionId: row[5],
|
|
56
|
+
allureUri: row[6],
|
|
57
|
+
summary: row[7],
|
|
58
|
+
metadata: row[8],
|
|
59
|
+
generatedAt: row[9],
|
|
60
|
+
createdAt: row[10],
|
|
61
|
+
updatedAt: row[11],
|
|
62
|
+
archivedAt: row[12]
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
exports.getTestReportQuery = `-- name: GetTestReport :one
|
|
66
|
+
SELECT id, project_id, workflow_id, test_run_id, status, storage_connection_id, allure_uri, summary, metadata, generated_at, created_at, updated_at, archived_at
|
|
67
|
+
FROM weave_v1.test_report
|
|
68
|
+
WHERE id = $1
|
|
69
|
+
AND project_id = $2
|
|
70
|
+
AND workflow_id = $3`;
|
|
71
|
+
async function getTestReport(client, args) {
|
|
72
|
+
const result = await client.query({
|
|
73
|
+
text: exports.getTestReportQuery,
|
|
74
|
+
values: [args.id, args.projectId, args.workflowId],
|
|
75
|
+
rowMode: "array"
|
|
76
|
+
});
|
|
77
|
+
if (result.rows.length !== 1) {
|
|
78
|
+
return null;
|
|
79
|
+
}
|
|
80
|
+
const row = result.rows[0];
|
|
81
|
+
return {
|
|
82
|
+
id: row[0],
|
|
83
|
+
projectId: row[1],
|
|
84
|
+
workflowId: row[2],
|
|
85
|
+
testRunId: row[3],
|
|
86
|
+
status: row[4],
|
|
87
|
+
storageConnectionId: row[5],
|
|
88
|
+
allureUri: row[6],
|
|
89
|
+
summary: row[7],
|
|
90
|
+
metadata: row[8],
|
|
91
|
+
generatedAt: row[9],
|
|
92
|
+
createdAt: row[10],
|
|
93
|
+
updatedAt: row[11],
|
|
94
|
+
archivedAt: row[12]
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
exports.listTestReportsByProjectQuery = `-- name: ListTestReportsByProject :many
|
|
98
|
+
SELECT id, project_id, workflow_id, test_run_id, status, storage_connection_id, allure_uri, summary, metadata, generated_at, created_at, updated_at, archived_at
|
|
99
|
+
FROM weave_v1.test_report
|
|
100
|
+
WHERE project_id = $1
|
|
101
|
+
AND ($2::BOOLEAN OR archived_at IS NULL)
|
|
102
|
+
ORDER BY created_at DESC
|
|
103
|
+
LIMIT $4
|
|
104
|
+
OFFSET $3`;
|
|
105
|
+
async function listTestReportsByProject(client, args) {
|
|
106
|
+
const result = await client.query({
|
|
107
|
+
text: exports.listTestReportsByProjectQuery,
|
|
108
|
+
values: [args.projectId, args.includeArchived, args.pageOffset, args.pageSize],
|
|
109
|
+
rowMode: "array"
|
|
110
|
+
});
|
|
111
|
+
return result.rows.map(row => {
|
|
112
|
+
return {
|
|
113
|
+
id: row[0],
|
|
114
|
+
projectId: row[1],
|
|
115
|
+
workflowId: row[2],
|
|
116
|
+
testRunId: row[3],
|
|
117
|
+
status: row[4],
|
|
118
|
+
storageConnectionId: row[5],
|
|
119
|
+
allureUri: row[6],
|
|
120
|
+
summary: row[7],
|
|
121
|
+
metadata: row[8],
|
|
122
|
+
generatedAt: row[9],
|
|
123
|
+
createdAt: row[10],
|
|
124
|
+
updatedAt: row[11],
|
|
125
|
+
archivedAt: row[12]
|
|
126
|
+
};
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
exports.listTestReportsByWorkflowQuery = `-- name: ListTestReportsByWorkflow :many
|
|
130
|
+
SELECT id, project_id, workflow_id, test_run_id, status, storage_connection_id, allure_uri, summary, metadata, generated_at, created_at, updated_at, archived_at
|
|
131
|
+
FROM weave_v1.test_report
|
|
132
|
+
WHERE project_id = $1
|
|
133
|
+
AND workflow_id = $2
|
|
134
|
+
AND ($3::BOOLEAN OR archived_at IS NULL)
|
|
135
|
+
ORDER BY created_at DESC
|
|
136
|
+
LIMIT $5
|
|
137
|
+
OFFSET $4`;
|
|
138
|
+
async function listTestReportsByWorkflow(client, args) {
|
|
139
|
+
const result = await client.query({
|
|
140
|
+
text: exports.listTestReportsByWorkflowQuery,
|
|
141
|
+
values: [args.projectId, args.workflowId, args.includeArchived, args.pageOffset, args.pageSize],
|
|
142
|
+
rowMode: "array"
|
|
143
|
+
});
|
|
144
|
+
return result.rows.map(row => {
|
|
145
|
+
return {
|
|
146
|
+
id: row[0],
|
|
147
|
+
projectId: row[1],
|
|
148
|
+
workflowId: row[2],
|
|
149
|
+
testRunId: row[3],
|
|
150
|
+
status: row[4],
|
|
151
|
+
storageConnectionId: row[5],
|
|
152
|
+
allureUri: row[6],
|
|
153
|
+
summary: row[7],
|
|
154
|
+
metadata: row[8],
|
|
155
|
+
generatedAt: row[9],
|
|
156
|
+
createdAt: row[10],
|
|
157
|
+
updatedAt: row[11],
|
|
158
|
+
archivedAt: row[12]
|
|
159
|
+
};
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
exports.archiveTestReportQuery = `-- name: ArchiveTestReport :one
|
|
163
|
+
UPDATE weave_v1.test_report
|
|
164
|
+
SET status = 'archived',
|
|
165
|
+
archived_at = NOW(),
|
|
166
|
+
updated_at = NOW()
|
|
167
|
+
WHERE id = $1
|
|
168
|
+
AND project_id = $2
|
|
169
|
+
AND workflow_id = $3
|
|
170
|
+
RETURNING id, project_id, workflow_id, test_run_id, status, storage_connection_id, allure_uri, summary, metadata, generated_at, created_at, updated_at, archived_at`;
|
|
171
|
+
async function archiveTestReport(client, args) {
|
|
172
|
+
const result = await client.query({
|
|
173
|
+
text: exports.archiveTestReportQuery,
|
|
174
|
+
values: [args.id, args.projectId, args.workflowId],
|
|
175
|
+
rowMode: "array"
|
|
176
|
+
});
|
|
177
|
+
if (result.rows.length !== 1) {
|
|
178
|
+
return null;
|
|
179
|
+
}
|
|
180
|
+
const row = result.rows[0];
|
|
181
|
+
return {
|
|
182
|
+
id: row[0],
|
|
183
|
+
projectId: row[1],
|
|
184
|
+
workflowId: row[2],
|
|
185
|
+
testRunId: row[3],
|
|
186
|
+
status: row[4],
|
|
187
|
+
storageConnectionId: row[5],
|
|
188
|
+
allureUri: row[6],
|
|
189
|
+
summary: row[7],
|
|
190
|
+
metadata: row[8],
|
|
191
|
+
generatedAt: row[9],
|
|
192
|
+
createdAt: row[10],
|
|
193
|
+
updatedAt: row[11],
|
|
194
|
+
archivedAt: row[12]
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
exports.deleteTestReportQuery = `-- name: DeleteTestReport :exec
|
|
198
|
+
DELETE
|
|
199
|
+
FROM weave_v1.test_report
|
|
200
|
+
WHERE id = $1
|
|
201
|
+
AND project_id = $2
|
|
202
|
+
AND workflow_id = $3`;
|
|
203
|
+
async function deleteTestReport(client, args) {
|
|
204
|
+
await client.query({
|
|
205
|
+
text: exports.deleteTestReportQuery,
|
|
206
|
+
values: [args.id, args.projectId, args.workflowId],
|
|
207
|
+
rowMode: "array"
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
exports.createWorkflowEventQuery = `-- name: CreateWorkflowEvent :one
|
|
211
|
+
INSERT INTO weave_v1.workflow_event (
|
|
212
|
+
id,
|
|
213
|
+
project_id,
|
|
214
|
+
workflow_id,
|
|
215
|
+
event_type,
|
|
216
|
+
actor,
|
|
217
|
+
entity_type,
|
|
218
|
+
entity_id,
|
|
219
|
+
payload
|
|
220
|
+
)
|
|
221
|
+
VALUES (
|
|
222
|
+
$1,
|
|
223
|
+
$2,
|
|
224
|
+
$3,
|
|
225
|
+
$4,
|
|
226
|
+
$5,
|
|
227
|
+
$6,
|
|
228
|
+
$7,
|
|
229
|
+
$8
|
|
230
|
+
)
|
|
231
|
+
RETURNING id, project_id, workflow_id, event_type, actor, entity_type, entity_id, payload, created_at`;
|
|
232
|
+
async function createWorkflowEvent(client, args) {
|
|
233
|
+
const result = await client.query({
|
|
234
|
+
text: exports.createWorkflowEventQuery,
|
|
235
|
+
values: [args.id, args.projectId, args.workflowId, args.eventType, args.actor, args.entityType, args.entityId, args.payload],
|
|
236
|
+
rowMode: "array"
|
|
237
|
+
});
|
|
238
|
+
if (result.rows.length !== 1) {
|
|
239
|
+
return null;
|
|
240
|
+
}
|
|
241
|
+
const row = result.rows[0];
|
|
242
|
+
return {
|
|
243
|
+
id: row[0],
|
|
244
|
+
projectId: row[1],
|
|
245
|
+
workflowId: row[2],
|
|
246
|
+
eventType: row[3],
|
|
247
|
+
actor: row[4],
|
|
248
|
+
entityType: row[5],
|
|
249
|
+
entityId: row[6],
|
|
250
|
+
payload: row[7],
|
|
251
|
+
createdAt: row[8]
|
|
252
|
+
};
|
|
253
|
+
}
|
|
254
|
+
exports.listWorkflowEventsByProjectQuery = `-- name: ListWorkflowEventsByProject :many
|
|
255
|
+
SELECT id, project_id, workflow_id, event_type, actor, entity_type, entity_id, payload, created_at
|
|
256
|
+
FROM weave_v1.workflow_event
|
|
257
|
+
WHERE project_id = $1
|
|
258
|
+
ORDER BY created_at DESC
|
|
259
|
+
LIMIT $3
|
|
260
|
+
OFFSET $2`;
|
|
261
|
+
async function listWorkflowEventsByProject(client, args) {
|
|
262
|
+
const result = await client.query({
|
|
263
|
+
text: exports.listWorkflowEventsByProjectQuery,
|
|
264
|
+
values: [args.projectId, args.pageOffset, args.pageSize],
|
|
265
|
+
rowMode: "array"
|
|
266
|
+
});
|
|
267
|
+
return result.rows.map(row => {
|
|
268
|
+
return {
|
|
269
|
+
id: row[0],
|
|
270
|
+
projectId: row[1],
|
|
271
|
+
workflowId: row[2],
|
|
272
|
+
eventType: row[3],
|
|
273
|
+
actor: row[4],
|
|
274
|
+
entityType: row[5],
|
|
275
|
+
entityId: row[6],
|
|
276
|
+
payload: row[7],
|
|
277
|
+
createdAt: row[8]
|
|
278
|
+
};
|
|
279
|
+
});
|
|
280
|
+
}
|
|
281
|
+
exports.listWorkflowEventsByWorkflowQuery = `-- name: ListWorkflowEventsByWorkflow :many
|
|
282
|
+
SELECT id, project_id, workflow_id, event_type, actor, entity_type, entity_id, payload, created_at
|
|
283
|
+
FROM weave_v1.workflow_event
|
|
284
|
+
WHERE project_id = $1
|
|
285
|
+
AND workflow_id = $2
|
|
286
|
+
ORDER BY created_at DESC
|
|
287
|
+
LIMIT $4
|
|
288
|
+
OFFSET $3`;
|
|
289
|
+
async function listWorkflowEventsByWorkflow(client, args) {
|
|
290
|
+
const result = await client.query({
|
|
291
|
+
text: exports.listWorkflowEventsByWorkflowQuery,
|
|
292
|
+
values: [args.projectId, args.workflowId, args.pageOffset, args.pageSize],
|
|
293
|
+
rowMode: "array"
|
|
294
|
+
});
|
|
295
|
+
return result.rows.map(row => {
|
|
296
|
+
return {
|
|
297
|
+
id: row[0],
|
|
298
|
+
projectId: row[1],
|
|
299
|
+
workflowId: row[2],
|
|
300
|
+
eventType: row[3],
|
|
301
|
+
actor: row[4],
|
|
302
|
+
entityType: row[5],
|
|
303
|
+
entityId: row[6],
|
|
304
|
+
payload: row[7],
|
|
305
|
+
createdAt: row[8]
|
|
306
|
+
};
|
|
307
|
+
});
|
|
308
|
+
}
|
|
@@ -0,0 +1,231 @@
|
|
|
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 project_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, project_id, key, title, description, status, priority, confidence, metadata, created_at, updated_at, archived_at";
|
|
6
|
+
export interface CreateRequirementArgs {
|
|
7
|
+
id: string;
|
|
8
|
+
projectId: 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
|
+
projectId: 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, project_id, key, title, description, status, priority, confidence, metadata, created_at, updated_at, archived_at\nFROM weave_v1.requirement\nWHERE id = $1\n AND project_id = $2";
|
|
33
|
+
export interface GetRequirementArgs {
|
|
34
|
+
id: string;
|
|
35
|
+
projectId: string;
|
|
36
|
+
}
|
|
37
|
+
export interface GetRequirementRow {
|
|
38
|
+
id: string;
|
|
39
|
+
projectId: 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 listRequirementsByProjectQuery = "-- name: ListRequirementsByProject :many\nSELECT id, project_id, key, title, description, status, priority, confidence, metadata, created_at, updated_at, archived_at\nFROM weave_v1.requirement\nWHERE project_id = $1\n AND ($2::BOOLEAN OR archived_at IS NULL)\nORDER BY updated_at DESC\nLIMIT $4\nOFFSET $3";
|
|
53
|
+
export interface ListRequirementsByProjectArgs {
|
|
54
|
+
projectId: string;
|
|
55
|
+
includeArchived: boolean;
|
|
56
|
+
pageOffset: string;
|
|
57
|
+
pageSize: string;
|
|
58
|
+
}
|
|
59
|
+
export interface ListRequirementsByProjectRow {
|
|
60
|
+
id: string;
|
|
61
|
+
projectId: 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 listRequirementsByProject(client: Client, args: ListRequirementsByProjectArgs): Promise<ListRequirementsByProjectRow[]>;
|
|
74
|
+
export declare const listRequirementsByWorkflowQuery = "-- name: ListRequirementsByWorkflow :many\nSELECT 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\nFROM weave_v1.requirement r\n INNER JOIN weave_v1.workflow_requirement b\n ON b.requirement_id = r.id\n AND b.project_id = r.project_id\nWHERE b.project_id = $1\n AND b.workflow_id = $2\n AND ($3::BOOLEAN OR r.archived_at IS NULL)\nORDER BY r.updated_at DESC\nLIMIT $5\nOFFSET $4";
|
|
75
|
+
export interface ListRequirementsByWorkflowArgs {
|
|
76
|
+
projectId: string;
|
|
77
|
+
workflowId: string;
|
|
78
|
+
includeArchived: boolean;
|
|
79
|
+
pageOffset: string;
|
|
80
|
+
pageSize: string;
|
|
81
|
+
}
|
|
82
|
+
export interface ListRequirementsByWorkflowRow {
|
|
83
|
+
id: string;
|
|
84
|
+
projectId: string;
|
|
85
|
+
key: string;
|
|
86
|
+
title: string;
|
|
87
|
+
description: string;
|
|
88
|
+
status: string;
|
|
89
|
+
priority: string;
|
|
90
|
+
confidence: string;
|
|
91
|
+
metadata: any;
|
|
92
|
+
createdAt: Date;
|
|
93
|
+
updatedAt: Date;
|
|
94
|
+
archivedAt: Date | null;
|
|
95
|
+
}
|
|
96
|
+
export declare function listRequirementsByWorkflow(client: Client, args: ListRequirementsByWorkflowArgs): Promise<ListRequirementsByWorkflowRow[]>;
|
|
97
|
+
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 project_id = $9\nRETURNING id, project_id, key, title, description, status, priority, confidence, metadata, created_at, updated_at, archived_at";
|
|
98
|
+
export interface UpdateRequirementArgs {
|
|
99
|
+
key: string;
|
|
100
|
+
title: string;
|
|
101
|
+
description: string;
|
|
102
|
+
status: string;
|
|
103
|
+
priority: string;
|
|
104
|
+
confidence: string;
|
|
105
|
+
metadata: any;
|
|
106
|
+
id: string;
|
|
107
|
+
projectId: string;
|
|
108
|
+
}
|
|
109
|
+
export interface UpdateRequirementRow {
|
|
110
|
+
id: string;
|
|
111
|
+
projectId: string;
|
|
112
|
+
key: string;
|
|
113
|
+
title: string;
|
|
114
|
+
description: string;
|
|
115
|
+
status: string;
|
|
116
|
+
priority: string;
|
|
117
|
+
confidence: string;
|
|
118
|
+
metadata: any;
|
|
119
|
+
createdAt: Date;
|
|
120
|
+
updatedAt: Date;
|
|
121
|
+
archivedAt: Date | null;
|
|
122
|
+
}
|
|
123
|
+
export declare function updateRequirement(client: Client, args: UpdateRequirementArgs): Promise<UpdateRequirementRow | null>;
|
|
124
|
+
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 project_id = $2\nRETURNING id, project_id, key, title, description, status, priority, confidence, metadata, created_at, updated_at, archived_at";
|
|
125
|
+
export interface ArchiveRequirementArgs {
|
|
126
|
+
id: string;
|
|
127
|
+
projectId: string;
|
|
128
|
+
}
|
|
129
|
+
export interface ArchiveRequirementRow {
|
|
130
|
+
id: string;
|
|
131
|
+
projectId: string;
|
|
132
|
+
key: string;
|
|
133
|
+
title: string;
|
|
134
|
+
description: string;
|
|
135
|
+
status: string;
|
|
136
|
+
priority: string;
|
|
137
|
+
confidence: string;
|
|
138
|
+
metadata: any;
|
|
139
|
+
createdAt: Date;
|
|
140
|
+
updatedAt: Date;
|
|
141
|
+
archivedAt: Date | null;
|
|
142
|
+
}
|
|
143
|
+
export declare function archiveRequirement(client: Client, args: ArchiveRequirementArgs): Promise<ArchiveRequirementRow | null>;
|
|
144
|
+
export declare const deleteRequirementQuery = "-- name: DeleteRequirement :exec\nDELETE\nFROM weave_v1.requirement\nWHERE id = $1\n AND project_id = $2";
|
|
145
|
+
export interface DeleteRequirementArgs {
|
|
146
|
+
id: string;
|
|
147
|
+
projectId: string;
|
|
148
|
+
}
|
|
149
|
+
export declare function deleteRequirement(client: Client, args: DeleteRequirementArgs): Promise<void>;
|
|
150
|
+
export declare const attachRequirementToWorkflowQuery = "-- name: AttachRequirementToWorkflow :one\nINSERT INTO weave_v1.workflow_requirement (\n project_id,\n workflow_id,\n requirement_id,\n attached_by,\n metadata\n)\nVALUES (\n $1,\n $2,\n $3,\n $4,\n $5\n)\nON CONFLICT (workflow_id, requirement_id) DO UPDATE\nSET attached_by = EXCLUDED.attached_by,\n metadata = EXCLUDED.metadata,\n attached_at = NOW()\nRETURNING project_id, workflow_id, requirement_id, attached_by, metadata, attached_at";
|
|
151
|
+
export interface AttachRequirementToWorkflowArgs {
|
|
152
|
+
projectId: string;
|
|
153
|
+
workflowId: string;
|
|
154
|
+
requirementId: string;
|
|
155
|
+
attachedBy: string;
|
|
156
|
+
metadata: any;
|
|
157
|
+
}
|
|
158
|
+
export interface AttachRequirementToWorkflowRow {
|
|
159
|
+
projectId: string;
|
|
160
|
+
workflowId: string;
|
|
161
|
+
requirementId: string;
|
|
162
|
+
attachedBy: string;
|
|
163
|
+
metadata: any;
|
|
164
|
+
attachedAt: Date;
|
|
165
|
+
}
|
|
166
|
+
export declare function attachRequirementToWorkflow(client: Client, args: AttachRequirementToWorkflowArgs): Promise<AttachRequirementToWorkflowRow | null>;
|
|
167
|
+
export declare const detachRequirementFromWorkflowQuery = "-- name: DetachRequirementFromWorkflow :exec\nDELETE\nFROM weave_v1.workflow_requirement\nWHERE project_id = $1\n AND workflow_id = $2\n AND requirement_id = $3";
|
|
168
|
+
export interface DetachRequirementFromWorkflowArgs {
|
|
169
|
+
projectId: string;
|
|
170
|
+
workflowId: string;
|
|
171
|
+
requirementId: string;
|
|
172
|
+
}
|
|
173
|
+
export declare function detachRequirementFromWorkflow(client: Client, args: DetachRequirementFromWorkflowArgs): Promise<void>;
|
|
174
|
+
export declare const listWorkflowRequirementBindingsQuery = "-- name: ListWorkflowRequirementBindings :many\nSELECT project_id, workflow_id, requirement_id, attached_by, metadata, attached_at\nFROM weave_v1.workflow_requirement\nWHERE project_id = $1\n AND workflow_id = $2\nORDER BY attached_at DESC\nLIMIT $4\nOFFSET $3";
|
|
175
|
+
export interface ListWorkflowRequirementBindingsArgs {
|
|
176
|
+
projectId: string;
|
|
177
|
+
workflowId: string;
|
|
178
|
+
pageOffset: string;
|
|
179
|
+
pageSize: string;
|
|
180
|
+
}
|
|
181
|
+
export interface ListWorkflowRequirementBindingsRow {
|
|
182
|
+
projectId: string;
|
|
183
|
+
workflowId: string;
|
|
184
|
+
requirementId: string;
|
|
185
|
+
attachedBy: string;
|
|
186
|
+
metadata: any;
|
|
187
|
+
attachedAt: Date;
|
|
188
|
+
}
|
|
189
|
+
export declare function listWorkflowRequirementBindings(client: Client, args: ListWorkflowRequirementBindingsArgs): Promise<ListWorkflowRequirementBindingsRow[]>;
|
|
190
|
+
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";
|
|
191
|
+
export interface AddRequirementSourceRefArgs {
|
|
192
|
+
id: string;
|
|
193
|
+
requirementId: string;
|
|
194
|
+
inputSourceId: string | null;
|
|
195
|
+
inputVersionId: string | null;
|
|
196
|
+
excerpt: string;
|
|
197
|
+
locator: any;
|
|
198
|
+
}
|
|
199
|
+
export interface AddRequirementSourceRefRow {
|
|
200
|
+
id: string;
|
|
201
|
+
requirementId: string;
|
|
202
|
+
inputSourceId: string | null;
|
|
203
|
+
inputVersionId: string | null;
|
|
204
|
+
excerpt: string;
|
|
205
|
+
locator: any;
|
|
206
|
+
createdAt: Date;
|
|
207
|
+
}
|
|
208
|
+
export declare function addRequirementSourceRef(client: Client, args: AddRequirementSourceRefArgs): Promise<AddRequirementSourceRefRow | null>;
|
|
209
|
+
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.project_id = $2\nORDER BY rsr.created_at DESC";
|
|
210
|
+
export interface ListRequirementSourceRefsArgs {
|
|
211
|
+
requirementId: string;
|
|
212
|
+
projectId: string;
|
|
213
|
+
}
|
|
214
|
+
export interface ListRequirementSourceRefsRow {
|
|
215
|
+
id: string;
|
|
216
|
+
requirementId: string;
|
|
217
|
+
inputSourceId: string | null;
|
|
218
|
+
inputVersionId: string | null;
|
|
219
|
+
excerpt: string;
|
|
220
|
+
locator: any;
|
|
221
|
+
createdAt: Date;
|
|
222
|
+
}
|
|
223
|
+
export declare function listRequirementSourceRefs(client: Client, args: ListRequirementSourceRefsArgs): Promise<ListRequirementSourceRefsRow[]>;
|
|
224
|
+
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.project_id = $3";
|
|
225
|
+
export interface DeleteRequirementSourceRefArgs {
|
|
226
|
+
id: string;
|
|
227
|
+
requirementId: string;
|
|
228
|
+
projectId: string;
|
|
229
|
+
}
|
|
230
|
+
export declare function deleteRequirementSourceRef(client: Client, args: DeleteRequirementSourceRefArgs): Promise<void>;
|
|
231
|
+
export {};
|