weave-typescript 0.11.14 → 0.11.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/dist/weaveapi/data/v1/data.pb.d.ts +54 -0
  2. package/dist/weaveapi/data/v1/data.pb.js +411 -0
  3. package/dist/weaveapi/data/v1/service.pb.d.ts +296 -0
  4. package/dist/weaveapi/data/v1/service.pb.js +2779 -0
  5. package/dist/weaveapi/input/v1/input.pb.d.ts +77 -0
  6. package/dist/weaveapi/input/v1/input.pb.js +632 -0
  7. package/dist/weaveapi/input/v1/service.pb.d.ts +390 -0
  8. package/dist/weaveapi/input/v1/service.pb.js +3612 -0
  9. package/dist/weaveapi/integration/v1/integration.pb.d.ts +67 -0
  10. package/dist/weaveapi/integration/v1/integration.pb.js +486 -0
  11. package/dist/weaveapi/integration/v1/service.pb.d.ts +318 -0
  12. package/dist/weaveapi/integration/v1/service.pb.js +2994 -0
  13. package/dist/weaveapi/project/v1/project.pb.d.ts +1 -0
  14. package/dist/weaveapi/project/v1/project.pb.js +17 -1
  15. package/dist/weaveapi/project/v1/service.pb.d.ts +25 -0
  16. package/dist/weaveapi/project/v1/service.pb.js +248 -5
  17. package/dist/weaveapi/report/v1/report.pb.d.ts +81 -0
  18. package/dist/weaveapi/report/v1/report.pb.js +678 -0
  19. package/dist/weaveapi/report/v1/service.pb.d.ts +194 -0
  20. package/dist/weaveapi/report/v1/service.pb.js +1925 -0
  21. package/dist/weaveapi/requirement/v1/requirement.pb.d.ts +70 -0
  22. package/dist/weaveapi/requirement/v1/requirement.pb.js +570 -0
  23. package/dist/weaveapi/requirement/v1/service.pb.d.ts +390 -0
  24. package/dist/weaveapi/requirement/v1/service.pb.js +3638 -0
  25. package/dist/weaveapi/run/v1/run.pb.d.ts +117 -0
  26. package/dist/weaveapi/run/v1/run.pb.js +1155 -0
  27. package/dist/weaveapi/run/v1/service.pb.d.ts +229 -0
  28. package/dist/weaveapi/run/v1/service.pb.js +2428 -0
  29. package/dist/weaveapi/script/v1/script.pb.d.ts +102 -0
  30. package/dist/weaveapi/script/v1/script.pb.js +1025 -0
  31. package/dist/weaveapi/script/v1/service.pb.d.ts +502 -0
  32. package/dist/weaveapi/script/v1/service.pb.js +4873 -0
  33. package/dist/weaveapi/storage/v1/service.pb.d.ts +4 -0
  34. package/dist/weaveapi/storage/v1/service.pb.js +50 -7
  35. package/dist/weaveapi/storage/v1/storage.pb.d.ts +2 -0
  36. package/dist/weaveapi/storage/v1/storage.pb.js +23 -0
  37. package/dist/weaveapi/storage/v1/vcs.pb.d.ts +75 -0
  38. package/dist/weaveapi/storage/v1/vcs.pb.js +864 -0
  39. package/dist/weaveapi/suite/v1/service.pb.d.ts +539 -0
  40. package/dist/weaveapi/suite/v1/service.pb.js +5281 -0
  41. package/dist/weaveapi/suite/v1/suite.pb.d.ts +92 -0
  42. package/dist/weaveapi/suite/v1/suite.pb.js +876 -0
  43. package/dist/weaveapi/testcase/v1/service.pb.d.ts +498 -0
  44. package/dist/weaveapi/testcase/v1/service.pb.js +4730 -0
  45. package/dist/weaveapi/testcase/v1/testcase.pb.d.ts +91 -0
  46. package/dist/weaveapi/testcase/v1/testcase.pb.js +794 -0
  47. package/dist/weaveapi/workflow/v1/service.pb.d.ts +26 -0
  48. package/dist/weaveapi/workflow/v1/service.pb.js +293 -5
  49. package/dist/weaveapi/workflow/v1/workflow.pb.d.ts +1 -0
  50. package/dist/weaveapi/workflow/v1/workflow.pb.js +17 -1
  51. package/dist/weavesql/weavedb/data_asset_sql.d.ts +206 -0
  52. package/dist/weavesql/weavedb/data_asset_sql.js +335 -0
  53. package/dist/weavesql/weavedb/input_sql.d.ts +293 -0
  54. package/dist/weavesql/weavedb/input_sql.js +500 -0
  55. package/dist/weavesql/weavedb/integration_sql.d.ts +236 -0
  56. package/dist/weavesql/weavedb/integration_sql.js +377 -0
  57. package/dist/weavesql/weavedb/project_sql.d.ts +29 -5
  58. package/dist/weavesql/weavedb/project_sql.js +73 -37
  59. package/dist/weavesql/weavedb/report_sql.d.ts +192 -0
  60. package/dist/weavesql/weavedb/report_sql.js +308 -0
  61. package/dist/weavesql/weavedb/requirement_sql.d.ts +231 -0
  62. package/dist/weavesql/weavedb/requirement_sql.js +399 -0
  63. package/dist/weavesql/weavedb/run_sql.d.ts +283 -0
  64. package/dist/weavesql/weavedb/run_sql.js +462 -0
  65. package/dist/weavesql/weavedb/suite_sql.d.ts +354 -0
  66. package/dist/weavesql/weavedb/suite_sql.js +631 -0
  67. package/dist/weavesql/weavedb/test_case_sql.d.ts +325 -0
  68. package/dist/weavesql/weavedb/test_case_sql.js +563 -0
  69. package/dist/weavesql/weavedb/test_script_sql.d.ts +354 -0
  70. package/dist/weavesql/weavedb/test_script_sql.js +605 -0
  71. package/dist/weavesql/weavedb/traceability_sql.d.ts +117 -0
  72. package/dist/weavesql/weavedb/traceability_sql.js +363 -0
  73. package/dist/weavesql/weavedb/workflow_sql.d.ts +30 -5
  74. package/dist/weavesql/weavedb/workflow_sql.js +76 -38
  75. package/package.json +1 -1
@@ -0,0 +1,117 @@
1
+ import { QueryArrayConfig, QueryArrayResult } from "pg";
2
+ interface Client {
3
+ query: (config: QueryArrayConfig) => Promise<QueryArrayResult>;
4
+ }
5
+ export declare const listRequirementCoverageMatrixByProjectQuery = "-- name: ListRequirementCoverageMatrixByProject :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 AND tr.project_id = r.project_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.project_id = $1\nORDER BY r.created_at DESC, tc.created_at DESC NULLS LAST";
6
+ export interface ListRequirementCoverageMatrixByProjectArgs {
7
+ projectId: string;
8
+ }
9
+ export interface ListRequirementCoverageMatrixByProjectRow {
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 listRequirementCoverageMatrixByProject(client: Client, args: ListRequirementCoverageMatrixByProjectArgs): Promise<ListRequirementCoverageMatrixByProjectRow[]>;
24
+ 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 INNER JOIN weave_v1.workflow_requirement wr\n ON wr.requirement_id = r.id\n AND wr.project_id = $1\n AND wr.workflow_id = $2\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.workflow_test_case wtc\n ON wtc.test_case_id = tc.id\n AND wtc.project_id = $1\n AND wtc.workflow_id = $2\n LEFT JOIN weave_v1.test_script ts ON ts.test_case_id = tc.id\n LEFT JOIN weave_v1.workflow_test_script wts\n ON wts.test_script_id = ts.id\n AND wts.project_id = $1\n AND wts.workflow_id = $2\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.workflow_test_suite ws\n ON ws.test_suite_id = s.id\n AND ws.project_id = $1\n AND ws.workflow_id = $2\n LEFT JOIN weave_v1.test_run tr\n ON tr.test_suite_id = s.id\n AND tr.project_id = $1\n AND tr.workflow_id = $2\n LEFT JOIN weave_v1.test_run_case_result tcr\n ON tcr.test_run_id = tr.id\n AND (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.project_id = $1\nORDER BY r.created_at DESC, tc.created_at DESC NULLS LAST";
25
+ export interface ListRequirementCoverageMatrixArgs {
26
+ projectId: string;
27
+ workflowId: string;
28
+ }
29
+ export interface ListRequirementCoverageMatrixRow {
30
+ requirementId: string;
31
+ requirementTitle: string;
32
+ testCaseId: string | null;
33
+ testCaseTitle: string | null;
34
+ testScriptId: string | null;
35
+ testScriptName: string | null;
36
+ testSuiteId: string | null;
37
+ testSuiteName: string | null;
38
+ testRunId: string | null;
39
+ testRunStatus: string | null;
40
+ testRunCaseStatus: string | null;
41
+ testReportId: string | null;
42
+ }
43
+ export declare function listRequirementCoverageMatrix(client: Client, args: ListRequirementCoverageMatrixArgs): Promise<ListRequirementCoverageMatrixRow[]>;
44
+ export declare const listTestCaseTraceabilityByProjectQuery = "-- name: ListTestCaseTraceabilityByProject :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 AND tr.project_id = tc.project_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.project_id = $1\nORDER BY tc.created_at DESC";
45
+ export interface ListTestCaseTraceabilityByProjectArgs {
46
+ projectId: string;
47
+ }
48
+ export interface ListTestCaseTraceabilityByProjectRow {
49
+ testCaseId: string;
50
+ testCaseTitle: string;
51
+ requirementId: string | null;
52
+ requirementTitle: string | null;
53
+ testScriptId: string | null;
54
+ testScriptName: string | null;
55
+ testSuiteId: string | null;
56
+ testSuiteName: string | null;
57
+ testRunId: string | null;
58
+ testRunStatus: string | null;
59
+ testRunCaseStatus: string | null;
60
+ testReportId: string | null;
61
+ }
62
+ export declare function listTestCaseTraceabilityByProject(client: Client, args: ListTestCaseTraceabilityByProjectArgs): Promise<ListTestCaseTraceabilityByProjectRow[]>;
63
+ 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 INNER JOIN weave_v1.workflow_test_case wtc\n ON wtc.test_case_id = tc.id\n AND wtc.project_id = $1\n AND wtc.workflow_id = $2\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.workflow_requirement wr\n ON wr.requirement_id = r.id\n AND wr.project_id = $1\n AND wr.workflow_id = $2\n LEFT JOIN weave_v1.test_script ts ON ts.test_case_id = tc.id\n LEFT JOIN weave_v1.workflow_test_script wts\n ON wts.test_script_id = ts.id\n AND wts.project_id = $1\n AND wts.workflow_id = $2\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.workflow_test_suite ws\n ON ws.test_suite_id = s.id\n AND ws.project_id = $1\n AND ws.workflow_id = $2\n LEFT JOIN weave_v1.test_run tr\n ON tr.test_suite_id = s.id\n AND tr.project_id = $1\n AND tr.workflow_id = $2\n LEFT JOIN weave_v1.test_run_case_result tcr\n ON tcr.test_run_id = tr.id\n AND (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.project_id = $1\nORDER BY tc.created_at DESC";
64
+ export interface ListTestCaseTraceabilityArgs {
65
+ projectId: string;
66
+ workflowId: string;
67
+ }
68
+ export interface ListTestCaseTraceabilityRow {
69
+ testCaseId: string;
70
+ testCaseTitle: string;
71
+ requirementId: string | null;
72
+ requirementTitle: string | null;
73
+ testScriptId: string | null;
74
+ testScriptName: string | null;
75
+ testSuiteId: string | null;
76
+ testSuiteName: string | null;
77
+ testRunId: string | null;
78
+ testRunStatus: string | null;
79
+ testRunCaseStatus: string | null;
80
+ testReportId: string | null;
81
+ }
82
+ export declare function listTestCaseTraceability(client: Client, args: ListTestCaseTraceabilityArgs): Promise<ListTestCaseTraceabilityRow[]>;
83
+ export declare const countRequirementsWithoutTestCasesByProjectQuery = "-- name: CountRequirementsWithoutTestCasesByProject :one\nSELECT COUNT(*)::INTEGER AS uncovered_requirement_count\nFROM weave_v1.requirement r\nWHERE r.project_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)";
84
+ export interface CountRequirementsWithoutTestCasesByProjectArgs {
85
+ projectId: string;
86
+ }
87
+ export interface CountRequirementsWithoutTestCasesByProjectRow {
88
+ uncoveredRequirementCount: number;
89
+ }
90
+ export declare function countRequirementsWithoutTestCasesByProject(client: Client, args: CountRequirementsWithoutTestCasesByProjectArgs): Promise<CountRequirementsWithoutTestCasesByProjectRow | null>;
91
+ export declare const countRequirementsWithoutTestCasesQuery = "-- name: CountRequirementsWithoutTestCases :one\nSELECT COUNT(*)::INTEGER AS uncovered_requirement_count\nFROM weave_v1.requirement r\n INNER JOIN weave_v1.workflow_requirement wr\n ON wr.requirement_id = r.id\n AND wr.project_id = $1\n AND wr.workflow_id = $2\nWHERE r.project_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 INNER JOIN weave_v1.workflow_test_case wtc\n ON wtc.test_case_id = tc.id\n AND wtc.project_id = $1\n AND wtc.workflow_id = $2\n WHERE tcrq.requirement_id = r.id\n AND tc.archived_at IS NULL\n)";
92
+ export interface CountRequirementsWithoutTestCasesArgs {
93
+ projectId: string;
94
+ workflowId: string;
95
+ }
96
+ export interface CountRequirementsWithoutTestCasesRow {
97
+ uncoveredRequirementCount: number;
98
+ }
99
+ export declare function countRequirementsWithoutTestCases(client: Client, args: CountRequirementsWithoutTestCasesArgs): Promise<CountRequirementsWithoutTestCasesRow | null>;
100
+ export declare const countApprovedTestCasesWithoutScriptsByProjectQuery = "-- name: CountApprovedTestCasesWithoutScriptsByProject :one\nSELECT COUNT(*)::INTEGER AS unlinked_test_case_count\nFROM weave_v1.test_case tc\nWHERE tc.project_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)";
101
+ export interface CountApprovedTestCasesWithoutScriptsByProjectArgs {
102
+ projectId: string;
103
+ }
104
+ export interface CountApprovedTestCasesWithoutScriptsByProjectRow {
105
+ unlinkedTestCaseCount: number;
106
+ }
107
+ export declare function countApprovedTestCasesWithoutScriptsByProject(client: Client, args: CountApprovedTestCasesWithoutScriptsByProjectArgs): Promise<CountApprovedTestCasesWithoutScriptsByProjectRow | null>;
108
+ export declare const countApprovedTestCasesWithoutScriptsQuery = "-- name: CountApprovedTestCasesWithoutScripts :one\nSELECT COUNT(*)::INTEGER AS unlinked_test_case_count\nFROM weave_v1.test_case tc\n INNER JOIN weave_v1.workflow_test_case wtc\n ON wtc.test_case_id = tc.id\n AND wtc.project_id = $1\n AND wtc.workflow_id = $2\nWHERE tc.project_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 INNER JOIN weave_v1.workflow_test_script wts\n ON wts.test_script_id = ts.id\n AND wts.project_id = $1\n AND wts.workflow_id = $2\n WHERE ts.test_case_id = tc.id\n AND ts.archived_at IS NULL\n)";
109
+ export interface CountApprovedTestCasesWithoutScriptsArgs {
110
+ projectId: string;
111
+ workflowId: string;
112
+ }
113
+ export interface CountApprovedTestCasesWithoutScriptsRow {
114
+ unlinkedTestCaseCount: number;
115
+ }
116
+ export declare function countApprovedTestCasesWithoutScripts(client: Client, args: CountApprovedTestCasesWithoutScriptsArgs): Promise<CountApprovedTestCasesWithoutScriptsRow | null>;
117
+ export {};
@@ -0,0 +1,363 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.countApprovedTestCasesWithoutScriptsQuery = exports.countApprovedTestCasesWithoutScriptsByProjectQuery = exports.countRequirementsWithoutTestCasesQuery = exports.countRequirementsWithoutTestCasesByProjectQuery = exports.listTestCaseTraceabilityQuery = exports.listTestCaseTraceabilityByProjectQuery = exports.listRequirementCoverageMatrixQuery = exports.listRequirementCoverageMatrixByProjectQuery = void 0;
4
+ exports.listRequirementCoverageMatrixByProject = listRequirementCoverageMatrixByProject;
5
+ exports.listRequirementCoverageMatrix = listRequirementCoverageMatrix;
6
+ exports.listTestCaseTraceabilityByProject = listTestCaseTraceabilityByProject;
7
+ exports.listTestCaseTraceability = listTestCaseTraceability;
8
+ exports.countRequirementsWithoutTestCasesByProject = countRequirementsWithoutTestCasesByProject;
9
+ exports.countRequirementsWithoutTestCases = countRequirementsWithoutTestCases;
10
+ exports.countApprovedTestCasesWithoutScriptsByProject = countApprovedTestCasesWithoutScriptsByProject;
11
+ exports.countApprovedTestCasesWithoutScripts = countApprovedTestCasesWithoutScripts;
12
+ exports.listRequirementCoverageMatrixByProjectQuery = `-- name: ListRequirementCoverageMatrixByProject :many
13
+ SELECT r.id AS requirement_id,
14
+ r.title AS requirement_title,
15
+ tc.id AS test_case_id,
16
+ tc.title AS test_case_title,
17
+ ts.id AS test_script_id,
18
+ ts.name AS test_script_name,
19
+ s.id AS test_suite_id,
20
+ s.name AS test_suite_name,
21
+ tr.id AS test_run_id,
22
+ tr.status AS test_run_status,
23
+ tcr.status AS test_run_case_status,
24
+ rep.id AS test_report_id
25
+ FROM weave_v1.requirement r
26
+ LEFT JOIN weave_v1.test_case_requirement tcrq ON tcrq.requirement_id = r.id
27
+ LEFT JOIN weave_v1.test_case tc ON tc.id = tcrq.test_case_id
28
+ LEFT JOIN weave_v1.test_script ts ON ts.test_case_id = tc.id
29
+ LEFT JOIN weave_v1.test_suite_item tsi ON tsi.test_case_id = tc.id OR tsi.test_script_id = ts.id
30
+ LEFT JOIN weave_v1.test_suite s ON s.id = tsi.test_suite_id
31
+ LEFT JOIN weave_v1.test_run tr ON tr.test_suite_id = s.id AND tr.project_id = r.project_id
32
+ LEFT JOIN weave_v1.test_run_case_result tcr ON tcr.test_run_id = tr.id AND
33
+ (tcr.test_case_id = tc.id OR tcr.test_script_id = ts.id)
34
+ LEFT JOIN weave_v1.test_report rep ON rep.test_run_id = tr.id
35
+ WHERE r.project_id = $1
36
+ ORDER BY r.created_at DESC, tc.created_at DESC NULLS LAST`;
37
+ async function listRequirementCoverageMatrixByProject(client, args) {
38
+ const result = await client.query({
39
+ text: exports.listRequirementCoverageMatrixByProjectQuery,
40
+ values: [args.projectId],
41
+ rowMode: "array"
42
+ });
43
+ return result.rows.map(row => {
44
+ return {
45
+ requirementId: row[0],
46
+ requirementTitle: row[1],
47
+ testCaseId: row[2],
48
+ testCaseTitle: row[3],
49
+ testScriptId: row[4],
50
+ testScriptName: row[5],
51
+ testSuiteId: row[6],
52
+ testSuiteName: row[7],
53
+ testRunId: row[8],
54
+ testRunStatus: row[9],
55
+ testRunCaseStatus: row[10],
56
+ testReportId: row[11]
57
+ };
58
+ });
59
+ }
60
+ exports.listRequirementCoverageMatrixQuery = `-- name: ListRequirementCoverageMatrix :many
61
+ SELECT r.id AS requirement_id,
62
+ r.title AS requirement_title,
63
+ tc.id AS test_case_id,
64
+ tc.title AS test_case_title,
65
+ ts.id AS test_script_id,
66
+ ts.name AS test_script_name,
67
+ s.id AS test_suite_id,
68
+ s.name AS test_suite_name,
69
+ tr.id AS test_run_id,
70
+ tr.status AS test_run_status,
71
+ tcr.status AS test_run_case_status,
72
+ rep.id AS test_report_id
73
+ FROM weave_v1.requirement r
74
+ INNER JOIN weave_v1.workflow_requirement wr
75
+ ON wr.requirement_id = r.id
76
+ AND wr.project_id = $1
77
+ AND wr.workflow_id = $2
78
+ LEFT JOIN weave_v1.test_case_requirement tcrq ON tcrq.requirement_id = r.id
79
+ LEFT JOIN weave_v1.test_case tc ON tc.id = tcrq.test_case_id
80
+ LEFT JOIN weave_v1.workflow_test_case wtc
81
+ ON wtc.test_case_id = tc.id
82
+ AND wtc.project_id = $1
83
+ AND wtc.workflow_id = $2
84
+ LEFT JOIN weave_v1.test_script ts ON ts.test_case_id = tc.id
85
+ LEFT JOIN weave_v1.workflow_test_script wts
86
+ ON wts.test_script_id = ts.id
87
+ AND wts.project_id = $1
88
+ AND wts.workflow_id = $2
89
+ LEFT JOIN weave_v1.test_suite_item tsi ON tsi.test_case_id = tc.id OR tsi.test_script_id = ts.id
90
+ LEFT JOIN weave_v1.test_suite s ON s.id = tsi.test_suite_id
91
+ LEFT JOIN weave_v1.workflow_test_suite ws
92
+ ON ws.test_suite_id = s.id
93
+ AND ws.project_id = $1
94
+ AND ws.workflow_id = $2
95
+ LEFT JOIN weave_v1.test_run tr
96
+ ON tr.test_suite_id = s.id
97
+ AND tr.project_id = $1
98
+ AND tr.workflow_id = $2
99
+ LEFT JOIN weave_v1.test_run_case_result tcr
100
+ ON tcr.test_run_id = tr.id
101
+ AND (tcr.test_case_id = tc.id OR tcr.test_script_id = ts.id)
102
+ LEFT JOIN weave_v1.test_report rep ON rep.test_run_id = tr.id
103
+ WHERE r.project_id = $1
104
+ ORDER BY r.created_at DESC, tc.created_at DESC NULLS LAST`;
105
+ async function listRequirementCoverageMatrix(client, args) {
106
+ const result = await client.query({
107
+ text: exports.listRequirementCoverageMatrixQuery,
108
+ values: [args.projectId, args.workflowId],
109
+ rowMode: "array"
110
+ });
111
+ return result.rows.map(row => {
112
+ return {
113
+ requirementId: row[0],
114
+ requirementTitle: row[1],
115
+ testCaseId: row[2],
116
+ testCaseTitle: row[3],
117
+ testScriptId: row[4],
118
+ testScriptName: row[5],
119
+ testSuiteId: row[6],
120
+ testSuiteName: row[7],
121
+ testRunId: row[8],
122
+ testRunStatus: row[9],
123
+ testRunCaseStatus: row[10],
124
+ testReportId: row[11]
125
+ };
126
+ });
127
+ }
128
+ exports.listTestCaseTraceabilityByProjectQuery = `-- name: ListTestCaseTraceabilityByProject :many
129
+ SELECT tc.id AS test_case_id,
130
+ tc.title AS test_case_title,
131
+ r.id AS requirement_id,
132
+ r.title AS requirement_title,
133
+ ts.id AS test_script_id,
134
+ ts.name AS test_script_name,
135
+ s.id AS test_suite_id,
136
+ s.name AS test_suite_name,
137
+ tr.id AS test_run_id,
138
+ tr.status AS test_run_status,
139
+ tcr.status AS test_run_case_status,
140
+ rep.id AS test_report_id
141
+ FROM weave_v1.test_case tc
142
+ LEFT JOIN weave_v1.test_case_requirement tcrq ON tcrq.test_case_id = tc.id
143
+ LEFT JOIN weave_v1.requirement r ON r.id = tcrq.requirement_id
144
+ LEFT JOIN weave_v1.test_script ts ON ts.test_case_id = tc.id
145
+ LEFT JOIN weave_v1.test_suite_item tsi ON tsi.test_case_id = tc.id OR tsi.test_script_id = ts.id
146
+ LEFT JOIN weave_v1.test_suite s ON s.id = tsi.test_suite_id
147
+ LEFT JOIN weave_v1.test_run tr ON tr.test_suite_id = s.id AND tr.project_id = tc.project_id
148
+ LEFT JOIN weave_v1.test_run_case_result tcr ON tcr.test_run_id = tr.id AND
149
+ (tcr.test_case_id = tc.id OR tcr.test_script_id = ts.id)
150
+ LEFT JOIN weave_v1.test_report rep ON rep.test_run_id = tr.id
151
+ WHERE tc.project_id = $1
152
+ ORDER BY tc.created_at DESC`;
153
+ async function listTestCaseTraceabilityByProject(client, args) {
154
+ const result = await client.query({
155
+ text: exports.listTestCaseTraceabilityByProjectQuery,
156
+ values: [args.projectId],
157
+ rowMode: "array"
158
+ });
159
+ return result.rows.map(row => {
160
+ return {
161
+ testCaseId: row[0],
162
+ testCaseTitle: row[1],
163
+ requirementId: row[2],
164
+ requirementTitle: row[3],
165
+ testScriptId: row[4],
166
+ testScriptName: row[5],
167
+ testSuiteId: row[6],
168
+ testSuiteName: row[7],
169
+ testRunId: row[8],
170
+ testRunStatus: row[9],
171
+ testRunCaseStatus: row[10],
172
+ testReportId: row[11]
173
+ };
174
+ });
175
+ }
176
+ exports.listTestCaseTraceabilityQuery = `-- name: ListTestCaseTraceability :many
177
+ SELECT tc.id AS test_case_id,
178
+ tc.title AS test_case_title,
179
+ r.id AS requirement_id,
180
+ r.title AS requirement_title,
181
+ ts.id AS test_script_id,
182
+ ts.name AS test_script_name,
183
+ s.id AS test_suite_id,
184
+ s.name AS test_suite_name,
185
+ tr.id AS test_run_id,
186
+ tr.status AS test_run_status,
187
+ tcr.status AS test_run_case_status,
188
+ rep.id AS test_report_id
189
+ FROM weave_v1.test_case tc
190
+ INNER JOIN weave_v1.workflow_test_case wtc
191
+ ON wtc.test_case_id = tc.id
192
+ AND wtc.project_id = $1
193
+ AND wtc.workflow_id = $2
194
+ LEFT JOIN weave_v1.test_case_requirement tcrq ON tcrq.test_case_id = tc.id
195
+ LEFT JOIN weave_v1.requirement r ON r.id = tcrq.requirement_id
196
+ LEFT JOIN weave_v1.workflow_requirement wr
197
+ ON wr.requirement_id = r.id
198
+ AND wr.project_id = $1
199
+ AND wr.workflow_id = $2
200
+ LEFT JOIN weave_v1.test_script ts ON ts.test_case_id = tc.id
201
+ LEFT JOIN weave_v1.workflow_test_script wts
202
+ ON wts.test_script_id = ts.id
203
+ AND wts.project_id = $1
204
+ AND wts.workflow_id = $2
205
+ LEFT JOIN weave_v1.test_suite_item tsi ON tsi.test_case_id = tc.id OR tsi.test_script_id = ts.id
206
+ LEFT JOIN weave_v1.test_suite s ON s.id = tsi.test_suite_id
207
+ LEFT JOIN weave_v1.workflow_test_suite ws
208
+ ON ws.test_suite_id = s.id
209
+ AND ws.project_id = $1
210
+ AND ws.workflow_id = $2
211
+ LEFT JOIN weave_v1.test_run tr
212
+ ON tr.test_suite_id = s.id
213
+ AND tr.project_id = $1
214
+ AND tr.workflow_id = $2
215
+ LEFT JOIN weave_v1.test_run_case_result tcr
216
+ ON tcr.test_run_id = tr.id
217
+ AND (tcr.test_case_id = tc.id OR tcr.test_script_id = ts.id)
218
+ LEFT JOIN weave_v1.test_report rep ON rep.test_run_id = tr.id
219
+ WHERE tc.project_id = $1
220
+ ORDER BY tc.created_at DESC`;
221
+ async function listTestCaseTraceability(client, args) {
222
+ const result = await client.query({
223
+ text: exports.listTestCaseTraceabilityQuery,
224
+ values: [args.projectId, args.workflowId],
225
+ rowMode: "array"
226
+ });
227
+ return result.rows.map(row => {
228
+ return {
229
+ testCaseId: row[0],
230
+ testCaseTitle: row[1],
231
+ requirementId: row[2],
232
+ requirementTitle: row[3],
233
+ testScriptId: row[4],
234
+ testScriptName: row[5],
235
+ testSuiteId: row[6],
236
+ testSuiteName: row[7],
237
+ testRunId: row[8],
238
+ testRunStatus: row[9],
239
+ testRunCaseStatus: row[10],
240
+ testReportId: row[11]
241
+ };
242
+ });
243
+ }
244
+ exports.countRequirementsWithoutTestCasesByProjectQuery = `-- name: CountRequirementsWithoutTestCasesByProject :one
245
+ SELECT COUNT(*)::INTEGER AS uncovered_requirement_count
246
+ FROM weave_v1.requirement r
247
+ WHERE r.project_id = $1
248
+ AND r.archived_at IS NULL
249
+ AND NOT EXISTS (
250
+ SELECT 1
251
+ FROM weave_v1.test_case_requirement tcrq
252
+ INNER JOIN weave_v1.test_case tc ON tc.id = tcrq.test_case_id
253
+ WHERE tcrq.requirement_id = r.id
254
+ AND tc.archived_at IS NULL
255
+ )`;
256
+ async function countRequirementsWithoutTestCasesByProject(client, args) {
257
+ const result = await client.query({
258
+ text: exports.countRequirementsWithoutTestCasesByProjectQuery,
259
+ values: [args.projectId],
260
+ rowMode: "array"
261
+ });
262
+ if (result.rows.length !== 1) {
263
+ return null;
264
+ }
265
+ const row = result.rows[0];
266
+ return {
267
+ uncoveredRequirementCount: row[0]
268
+ };
269
+ }
270
+ exports.countRequirementsWithoutTestCasesQuery = `-- name: CountRequirementsWithoutTestCases :one
271
+ SELECT COUNT(*)::INTEGER AS uncovered_requirement_count
272
+ FROM weave_v1.requirement r
273
+ INNER JOIN weave_v1.workflow_requirement wr
274
+ ON wr.requirement_id = r.id
275
+ AND wr.project_id = $1
276
+ AND wr.workflow_id = $2
277
+ WHERE r.project_id = $1
278
+ AND r.archived_at IS NULL
279
+ AND NOT EXISTS (
280
+ SELECT 1
281
+ FROM weave_v1.test_case_requirement tcrq
282
+ INNER JOIN weave_v1.test_case tc ON tc.id = tcrq.test_case_id
283
+ INNER JOIN weave_v1.workflow_test_case wtc
284
+ ON wtc.test_case_id = tc.id
285
+ AND wtc.project_id = $1
286
+ AND wtc.workflow_id = $2
287
+ WHERE tcrq.requirement_id = r.id
288
+ AND tc.archived_at IS NULL
289
+ )`;
290
+ async function countRequirementsWithoutTestCases(client, args) {
291
+ const result = await client.query({
292
+ text: exports.countRequirementsWithoutTestCasesQuery,
293
+ values: [args.projectId, args.workflowId],
294
+ rowMode: "array"
295
+ });
296
+ if (result.rows.length !== 1) {
297
+ return null;
298
+ }
299
+ const row = result.rows[0];
300
+ return {
301
+ uncoveredRequirementCount: row[0]
302
+ };
303
+ }
304
+ exports.countApprovedTestCasesWithoutScriptsByProjectQuery = `-- name: CountApprovedTestCasesWithoutScriptsByProject :one
305
+ SELECT COUNT(*)::INTEGER AS unlinked_test_case_count
306
+ FROM weave_v1.test_case tc
307
+ WHERE tc.project_id = $1
308
+ AND tc.status = 'approved'
309
+ AND tc.archived_at IS NULL
310
+ AND NOT EXISTS (
311
+ SELECT 1
312
+ FROM weave_v1.test_script ts
313
+ WHERE ts.test_case_id = tc.id
314
+ AND ts.archived_at IS NULL
315
+ )`;
316
+ async function countApprovedTestCasesWithoutScriptsByProject(client, args) {
317
+ const result = await client.query({
318
+ text: exports.countApprovedTestCasesWithoutScriptsByProjectQuery,
319
+ values: [args.projectId],
320
+ rowMode: "array"
321
+ });
322
+ if (result.rows.length !== 1) {
323
+ return null;
324
+ }
325
+ const row = result.rows[0];
326
+ return {
327
+ unlinkedTestCaseCount: row[0]
328
+ };
329
+ }
330
+ exports.countApprovedTestCasesWithoutScriptsQuery = `-- name: CountApprovedTestCasesWithoutScripts :one
331
+ SELECT COUNT(*)::INTEGER AS unlinked_test_case_count
332
+ FROM weave_v1.test_case tc
333
+ INNER JOIN weave_v1.workflow_test_case wtc
334
+ ON wtc.test_case_id = tc.id
335
+ AND wtc.project_id = $1
336
+ AND wtc.workflow_id = $2
337
+ WHERE tc.project_id = $1
338
+ AND tc.status = 'approved'
339
+ AND tc.archived_at IS NULL
340
+ AND NOT EXISTS (
341
+ SELECT 1
342
+ FROM weave_v1.test_script ts
343
+ INNER JOIN weave_v1.workflow_test_script wts
344
+ ON wts.test_script_id = ts.id
345
+ AND wts.project_id = $1
346
+ AND wts.workflow_id = $2
347
+ WHERE ts.test_case_id = tc.id
348
+ AND ts.archived_at IS NULL
349
+ )`;
350
+ async function countApprovedTestCasesWithoutScripts(client, args) {
351
+ const result = await client.query({
352
+ text: exports.countApprovedTestCasesWithoutScriptsQuery,
353
+ values: [args.projectId, args.workflowId],
354
+ rowMode: "array"
355
+ });
356
+ if (result.rows.length !== 1) {
357
+ return null;
358
+ }
359
+ const row = result.rows[0];
360
+ return {
361
+ unlinkedTestCaseCount: row[0]
362
+ };
363
+ }
@@ -2,11 +2,12 @@ import { QueryArrayConfig, QueryArrayResult } from "pg";
2
2
  interface Client {
3
3
  query: (config: QueryArrayConfig) => Promise<QueryArrayResult>;
4
4
  }
5
- export declare const createWorkflowQuery = "-- name: CreateWorkflow :one\nINSERT INTO weave_v1.workflow (\n id,\n project_id,\n name,\n description,\n status\n)\nVALUES (\n $1,\n $2,\n $3,\n $4,\n $5\n)\nRETURNING id, project_id, name, description, status, created_at, updated_at, archived_at";
5
+ export declare const createWorkflowQuery = "-- name: CreateWorkflow :one\nINSERT INTO weave_v1.workflow (\n id,\n project_id,\n name,\n slug,\n description,\n status\n)\nVALUES (\n $1,\n $2,\n $3,\n $4,\n $5,\n $6\n)\nRETURNING id, project_id, name, slug, description, status, created_at, updated_at, archived_at";
6
6
  export interface CreateWorkflowArgs {
7
7
  id: string;
8
8
  projectId: string;
9
9
  name: string;
10
+ slug: string;
10
11
  description: string;
11
12
  status: string;
12
13
  }
@@ -14,6 +15,7 @@ export interface CreateWorkflowRow {
14
15
  id: string;
15
16
  projectId: string;
16
17
  name: string;
18
+ slug: string;
17
19
  description: string;
18
20
  status: string;
19
21
  createdAt: Date;
@@ -21,7 +23,7 @@ export interface CreateWorkflowRow {
21
23
  archivedAt: Date | null;
22
24
  }
23
25
  export declare function createWorkflow(client: Client, args: CreateWorkflowArgs): Promise<CreateWorkflowRow | null>;
24
- export declare const getWorkflowQuery = "-- name: GetWorkflow :one\nSELECT id, project_id, name, description, status, created_at, updated_at, archived_at\nFROM weave_v1.workflow\nWHERE id = $1\n AND project_id = $2";
26
+ export declare const getWorkflowQuery = "-- name: GetWorkflow :one\nSELECT id, project_id, name, slug, description, status, created_at, updated_at, archived_at\nFROM weave_v1.workflow\nWHERE id = $1\n AND project_id = $2";
25
27
  export interface GetWorkflowArgs {
26
28
  id: string;
27
29
  projectId: string;
@@ -30,6 +32,7 @@ export interface GetWorkflowRow {
30
32
  id: string;
31
33
  projectId: string;
32
34
  name: string;
35
+ slug: string;
33
36
  description: string;
34
37
  status: string;
35
38
  createdAt: Date;
@@ -37,7 +40,25 @@ export interface GetWorkflowRow {
37
40
  archivedAt: Date | null;
38
41
  }
39
42
  export declare function getWorkflow(client: Client, args: GetWorkflowArgs): Promise<GetWorkflowRow | null>;
40
- export declare const listWorkflowsByProjectQuery = "-- name: ListWorkflowsByProject :many\nSELECT id, project_id, name, description, status, created_at, updated_at, archived_at\nFROM weave_v1.workflow\nWHERE project_id = $1\n AND ($2::BOOLEAN OR archived_at IS NULL)\nORDER BY updated_at DESC\nLIMIT $4\nOFFSET $3";
43
+ export declare const getWorkflowBySlugQuery = "-- name: GetWorkflowBySlug :one\nSELECT w.id, w.project_id, w.name, w.slug, w.description, w.status, w.created_at, w.updated_at, w.archived_at\nFROM weave_v1.workflow w\n INNER JOIN weave_v1.project p ON p.id = w.project_id\nWHERE p.organization_id = $1\n AND p.slug = $2\n AND w.slug = $3";
44
+ export interface GetWorkflowBySlugArgs {
45
+ organizationId: string;
46
+ projectSlug: string;
47
+ slug: string;
48
+ }
49
+ export interface GetWorkflowBySlugRow {
50
+ id: string;
51
+ projectId: string;
52
+ name: string;
53
+ slug: string;
54
+ description: string;
55
+ status: string;
56
+ createdAt: Date;
57
+ updatedAt: Date;
58
+ archivedAt: Date | null;
59
+ }
60
+ export declare function getWorkflowBySlug(client: Client, args: GetWorkflowBySlugArgs): Promise<GetWorkflowBySlugRow | null>;
61
+ export declare const listWorkflowsByProjectQuery = "-- name: ListWorkflowsByProject :many\nSELECT id, project_id, name, slug, description, status, created_at, updated_at, archived_at\nFROM weave_v1.workflow\nWHERE project_id = $1\n AND ($2::BOOLEAN OR archived_at IS NULL)\nORDER BY updated_at DESC\nLIMIT $4\nOFFSET $3";
41
62
  export interface ListWorkflowsByProjectArgs {
42
63
  projectId: string;
43
64
  includeArchived: boolean;
@@ -48,6 +69,7 @@ export interface ListWorkflowsByProjectRow {
48
69
  id: string;
49
70
  projectId: string;
50
71
  name: string;
72
+ slug: string;
51
73
  description: string;
52
74
  status: string;
53
75
  createdAt: Date;
@@ -55,9 +77,10 @@ export interface ListWorkflowsByProjectRow {
55
77
  archivedAt: Date | null;
56
78
  }
57
79
  export declare function listWorkflowsByProject(client: Client, args: ListWorkflowsByProjectArgs): Promise<ListWorkflowsByProjectRow[]>;
58
- export declare const updateWorkflowQuery = "-- name: UpdateWorkflow :one\nUPDATE weave_v1.workflow\nSET name = $1,\n description = $2,\n status = $3,\n updated_at = NOW()\nWHERE id = $4\n AND project_id = $5\nRETURNING id, project_id, name, description, status, created_at, updated_at, archived_at";
80
+ export declare const updateWorkflowQuery = "-- name: UpdateWorkflow :one\nUPDATE weave_v1.workflow\nSET name = $1,\n slug = $2,\n description = $3,\n status = $4,\n updated_at = NOW()\nWHERE id = $5\n AND project_id = $6\nRETURNING id, project_id, name, slug, description, status, created_at, updated_at, archived_at";
59
81
  export interface UpdateWorkflowArgs {
60
82
  name: string;
83
+ slug: string;
61
84
  description: string;
62
85
  status: string;
63
86
  id: string;
@@ -67,6 +90,7 @@ export interface UpdateWorkflowRow {
67
90
  id: string;
68
91
  projectId: string;
69
92
  name: string;
93
+ slug: string;
70
94
  description: string;
71
95
  status: string;
72
96
  createdAt: Date;
@@ -74,7 +98,7 @@ export interface UpdateWorkflowRow {
74
98
  archivedAt: Date | null;
75
99
  }
76
100
  export declare function updateWorkflow(client: Client, args: UpdateWorkflowArgs): Promise<UpdateWorkflowRow | null>;
77
- export declare const archiveWorkflowQuery = "-- name: ArchiveWorkflow :one\nUPDATE weave_v1.workflow\nSET status = 'archived',\n archived_at = NOW(),\n updated_at = NOW()\nWHERE id = $1\n AND project_id = $2\nRETURNING id, project_id, name, description, status, created_at, updated_at, archived_at";
101
+ export declare const archiveWorkflowQuery = "-- name: ArchiveWorkflow :one\nUPDATE weave_v1.workflow\nSET status = 'archived',\n archived_at = NOW(),\n updated_at = NOW()\nWHERE id = $1\n AND project_id = $2\nRETURNING id, project_id, name, slug, description, status, created_at, updated_at, archived_at";
78
102
  export interface ArchiveWorkflowArgs {
79
103
  id: string;
80
104
  projectId: string;
@@ -83,6 +107,7 @@ export interface ArchiveWorkflowRow {
83
107
  id: string;
84
108
  projectId: string;
85
109
  name: string;
110
+ slug: string;
86
111
  description: string;
87
112
  status: string;
88
113
  createdAt: Date;