weave-typescript 0.11.15 → 0.11.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/dist/weaveapi/data/v1/data.pb.d.ts +1 -1
  2. package/dist/weaveapi/data/v1/data.pb.js +11 -11
  3. package/dist/weaveapi/data/v1/service.pb.d.ts +89 -6
  4. package/dist/weaveapi/data/v1/service.pb.js +1195 -364
  5. package/dist/weaveapi/input/v1/input.pb.d.ts +1 -1
  6. package/dist/weaveapi/input/v1/input.pb.js +11 -11
  7. package/dist/weaveapi/input/v1/service.pb.d.ts +89 -10
  8. package/dist/weaveapi/input/v1/service.pb.js +1253 -642
  9. package/dist/weaveapi/integration/v1/integration.pb.d.ts +1 -1
  10. package/dist/weaveapi/integration/v1/integration.pb.js +11 -11
  11. package/dist/weaveapi/integration/v1/service.pb.d.ts +89 -7
  12. package/dist/weaveapi/integration/v1/service.pb.js +1164 -390
  13. package/dist/weaveapi/project/v1/project.pb.d.ts +1 -0
  14. package/dist/weaveapi/project/v1/project.pb.js +17 -1
  15. package/dist/weaveapi/project/v1/service.pb.d.ts +25 -0
  16. package/dist/weaveapi/project/v1/service.pb.js +248 -5
  17. package/dist/weaveapi/report/v1/report.pb.d.ts +2 -0
  18. package/dist/weaveapi/report/v1/report.pb.js +42 -2
  19. package/dist/weaveapi/report/v1/service.pb.d.ts +6 -6
  20. package/dist/weaveapi/report/v1/service.pb.js +416 -121
  21. package/dist/weaveapi/requirement/v1/requirement.pb.d.ts +1 -1
  22. package/dist/weaveapi/requirement/v1/requirement.pb.js +11 -11
  23. package/dist/weaveapi/requirement/v1/service.pb.d.ts +90 -10
  24. package/dist/weaveapi/requirement/v1/service.pb.js +1261 -601
  25. package/dist/weaveapi/run/v1/run.pb.d.ts +1 -0
  26. package/dist/weaveapi/run/v1/run.pb.js +21 -1
  27. package/dist/weaveapi/run/v1/service.pb.d.ts +6 -6
  28. package/dist/weaveapi/run/v1/service.pb.js +448 -126
  29. package/dist/weaveapi/script/v1/script.pb.d.ts +1 -1
  30. package/dist/weaveapi/script/v1/script.pb.js +11 -11
  31. package/dist/weaveapi/script/v1/service.pb.d.ts +90 -14
  32. package/dist/weaveapi/script/v1/service.pb.js +1404 -930
  33. package/dist/weaveapi/suite/v1/service.pb.d.ts +178 -12
  34. package/dist/weaveapi/suite/v1/service.pb.js +2631 -979
  35. package/dist/weaveapi/suite/v1/suite.pb.d.ts +2 -2
  36. package/dist/weaveapi/suite/v1/suite.pb.js +22 -22
  37. package/dist/weaveapi/testcase/v1/service.pb.d.ts +90 -14
  38. package/dist/weaveapi/testcase/v1/service.pb.js +1332 -856
  39. package/dist/weaveapi/testcase/v1/testcase.pb.d.ts +1 -1
  40. package/dist/weaveapi/testcase/v1/testcase.pb.js +11 -11
  41. package/dist/weaveapi/workflow/v1/service.pb.d.ts +26 -0
  42. package/dist/weaveapi/workflow/v1/service.pb.js +293 -5
  43. package/dist/weaveapi/workflow/v1/workflow.pb.d.ts +1 -0
  44. package/dist/weaveapi/workflow/v1/workflow.pb.js +17 -1
  45. package/dist/weavesql/weavedb/data_asset_sql.d.ts +81 -16
  46. package/dist/weavesql/weavedb/data_asset_sql.js +142 -24
  47. package/dist/weavesql/weavedb/input_sql.d.ts +88 -25
  48. package/dist/weavesql/weavedb/input_sql.js +150 -34
  49. package/dist/weavesql/weavedb/integration_sql.d.ts +85 -19
  50. package/dist/weavesql/weavedb/integration_sql.js +147 -28
  51. package/dist/weavesql/weavedb/project_sql.d.ts +29 -5
  52. package/dist/weavesql/weavedb/project_sql.js +73 -37
  53. package/dist/weavesql/weavedb/report_sql.d.ts +61 -7
  54. package/dist/weavesql/weavedb/report_sql.js +157 -81
  55. package/dist/weavesql/weavedb/requirement_sql.d.ts +83 -20
  56. package/dist/weavesql/weavedb/requirement_sql.js +144 -28
  57. package/dist/weavesql/weavedb/run_sql.d.ts +44 -8
  58. package/dist/weavesql/weavedb/run_sql.js +140 -93
  59. package/dist/weavesql/weavedb/suite_sql.d.ts +156 -30
  60. package/dist/weavesql/weavedb/suite_sql.js +274 -42
  61. package/dist/weavesql/weavedb/test_case_sql.d.ts +91 -27
  62. package/dist/weavesql/weavedb/test_case_sql.js +153 -36
  63. package/dist/weavesql/weavedb/test_script_sql.d.ts +91 -27
  64. package/dist/weavesql/weavedb/test_script_sql.js +153 -36
  65. package/dist/weavesql/weavedb/traceability_sql.d.ts +62 -4
  66. package/dist/weavesql/weavedb/traceability_sql.js +245 -37
  67. package/dist/weavesql/weavedb/workflow_sql.d.ts +30 -5
  68. package/dist/weavesql/weavedb/workflow_sql.js +76 -38
  69. package/package.json +1 -1
@@ -2,8 +2,28 @@ import { QueryArrayConfig, QueryArrayResult } from "pg";
2
2
  interface Client {
3
3
  query: (config: QueryArrayConfig) => Promise<QueryArrayResult>;
4
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";
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";
6
25
  export interface ListRequirementCoverageMatrixArgs {
26
+ projectId: string;
7
27
  workflowId: string;
8
28
  }
9
29
  export interface ListRequirementCoverageMatrixRow {
@@ -21,8 +41,28 @@ export interface ListRequirementCoverageMatrixRow {
21
41
  testReportId: string | null;
22
42
  }
23
43
  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";
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";
25
64
  export interface ListTestCaseTraceabilityArgs {
65
+ projectId: string;
26
66
  workflowId: string;
27
67
  }
28
68
  export interface ListTestCaseTraceabilityRow {
@@ -40,16 +80,34 @@ export interface ListTestCaseTraceabilityRow {
40
80
  testReportId: string | null;
41
81
  }
42
82
  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)";
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)";
44
92
  export interface CountRequirementsWithoutTestCasesArgs {
93
+ projectId: string;
45
94
  workflowId: string;
46
95
  }
47
96
  export interface CountRequirementsWithoutTestCasesRow {
48
97
  uncoveredRequirementCount: number;
49
98
  }
50
99
  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)";
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)";
52
109
  export interface CountApprovedTestCasesWithoutScriptsArgs {
110
+ projectId: string;
53
111
  workflowId: string;
54
112
  }
55
113
  export interface CountApprovedTestCasesWithoutScriptsRow {
@@ -1,39 +1,111 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.countApprovedTestCasesWithoutScriptsQuery = exports.countRequirementsWithoutTestCasesQuery = exports.listTestCaseTraceabilityQuery = exports.listRequirementCoverageMatrixQuery = void 0;
3
+ exports.countApprovedTestCasesWithoutScriptsQuery = exports.countApprovedTestCasesWithoutScriptsByProjectQuery = exports.countRequirementsWithoutTestCasesQuery = exports.countRequirementsWithoutTestCasesByProjectQuery = exports.listTestCaseTraceabilityQuery = exports.listTestCaseTraceabilityByProjectQuery = exports.listRequirementCoverageMatrixQuery = exports.listRequirementCoverageMatrixByProjectQuery = void 0;
4
+ exports.listRequirementCoverageMatrixByProject = listRequirementCoverageMatrixByProject;
4
5
  exports.listRequirementCoverageMatrix = listRequirementCoverageMatrix;
6
+ exports.listTestCaseTraceabilityByProject = listTestCaseTraceabilityByProject;
5
7
  exports.listTestCaseTraceability = listTestCaseTraceability;
8
+ exports.countRequirementsWithoutTestCasesByProject = countRequirementsWithoutTestCasesByProject;
6
9
  exports.countRequirementsWithoutTestCases = countRequirementsWithoutTestCases;
10
+ exports.countApprovedTestCasesWithoutScriptsByProject = countApprovedTestCasesWithoutScriptsByProject;
7
11
  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
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
21
25
  FROM weave_v1.requirement r
22
26
  LEFT JOIN weave_v1.test_case_requirement tcrq ON tcrq.requirement_id = r.id
23
27
  LEFT JOIN weave_v1.test_case tc ON tc.id = tcrq.test_case_id
24
28
  LEFT JOIN weave_v1.test_script ts ON ts.test_case_id = tc.id
25
29
  LEFT JOIN weave_v1.test_suite_item tsi ON tsi.test_case_id = tc.id OR tsi.test_script_id = ts.id
26
30
  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
31
+ LEFT JOIN weave_v1.test_run tr ON tr.test_suite_id = s.id AND tr.project_id = r.project_id
28
32
  LEFT JOIN weave_v1.test_run_case_result tcr ON tcr.test_run_id = tr.id AND
29
33
  (tcr.test_case_id = tc.id OR tcr.test_script_id = ts.id)
30
34
  LEFT JOIN weave_v1.test_report rep ON rep.test_run_id = tr.id
31
- WHERE r.workflow_id = $1
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
32
104
  ORDER BY r.created_at DESC, tc.created_at DESC NULLS LAST`;
33
105
  async function listRequirementCoverageMatrix(client, args) {
34
106
  const result = await client.query({
35
107
  text: exports.listRequirementCoverageMatrixQuery,
36
- values: [args.workflowId],
108
+ values: [args.projectId, args.workflowId],
37
109
  rowMode: "array"
38
110
  });
39
111
  return result.rows.map(row => {
@@ -53,35 +125,103 @@ async function listRequirementCoverageMatrix(client, args) {
53
125
  };
54
126
  });
55
127
  }
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
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
69
141
  FROM weave_v1.test_case tc
70
142
  LEFT JOIN weave_v1.test_case_requirement tcrq ON tcrq.test_case_id = tc.id
71
143
  LEFT JOIN weave_v1.requirement r ON r.id = tcrq.requirement_id
72
144
  LEFT JOIN weave_v1.test_script ts ON ts.test_case_id = tc.id
73
145
  LEFT JOIN weave_v1.test_suite_item tsi ON tsi.test_case_id = tc.id OR tsi.test_script_id = ts.id
74
146
  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
147
+ LEFT JOIN weave_v1.test_run tr ON tr.test_suite_id = s.id AND tr.project_id = tc.project_id
76
148
  LEFT JOIN weave_v1.test_run_case_result tcr ON tcr.test_run_id = tr.id AND
77
149
  (tcr.test_case_id = tc.id OR tcr.test_script_id = ts.id)
78
150
  LEFT JOIN weave_v1.test_report rep ON rep.test_run_id = tr.id
79
- WHERE tc.workflow_id = $1
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
80
220
  ORDER BY tc.created_at DESC`;
81
221
  async function listTestCaseTraceability(client, args) {
82
222
  const result = await client.query({
83
223
  text: exports.listTestCaseTraceabilityQuery,
84
- values: [args.workflowId],
224
+ values: [args.projectId, args.workflowId],
85
225
  rowMode: "array"
86
226
  });
87
227
  return result.rows.map(row => {
@@ -101,22 +241,56 @@ async function listTestCaseTraceability(client, args) {
101
241
  };
102
242
  });
103
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
+ }
104
270
  exports.countRequirementsWithoutTestCasesQuery = `-- name: CountRequirementsWithoutTestCases :one
105
271
  SELECT COUNT(*)::INTEGER AS uncovered_requirement_count
106
272
  FROM weave_v1.requirement r
107
- WHERE r.workflow_id = $1
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
108
278
  AND r.archived_at IS NULL
109
279
  AND NOT EXISTS (
110
280
  SELECT 1
111
281
  FROM weave_v1.test_case_requirement tcrq
112
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
113
287
  WHERE tcrq.requirement_id = r.id
114
288
  AND tc.archived_at IS NULL
115
289
  )`;
116
290
  async function countRequirementsWithoutTestCases(client, args) {
117
291
  const result = await client.query({
118
292
  text: exports.countRequirementsWithoutTestCasesQuery,
119
- values: [args.workflowId],
293
+ values: [args.projectId, args.workflowId],
120
294
  rowMode: "array"
121
295
  });
122
296
  if (result.rows.length !== 1) {
@@ -127,22 +301,56 @@ async function countRequirementsWithoutTestCases(client, args) {
127
301
  uncoveredRequirementCount: row[0]
128
302
  };
129
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
+ }
130
330
  exports.countApprovedTestCasesWithoutScriptsQuery = `-- name: CountApprovedTestCasesWithoutScripts :one
131
331
  SELECT COUNT(*)::INTEGER AS unlinked_test_case_count
132
332
  FROM weave_v1.test_case tc
133
- WHERE tc.workflow_id = $1
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
134
338
  AND tc.status = 'approved'
135
339
  AND tc.archived_at IS NULL
136
340
  AND NOT EXISTS (
137
341
  SELECT 1
138
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
139
347
  WHERE ts.test_case_id = tc.id
140
348
  AND ts.archived_at IS NULL
141
349
  )`;
142
350
  async function countApprovedTestCasesWithoutScripts(client, args) {
143
351
  const result = await client.query({
144
352
  text: exports.countApprovedTestCasesWithoutScriptsQuery,
145
- values: [args.workflowId],
353
+ values: [args.projectId, args.workflowId],
146
354
  rowMode: "array"
147
355
  });
148
356
  if (result.rows.length !== 1) {
@@ -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;