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,10 +2,10 @@ import { QueryArrayConfig, QueryArrayResult } from "pg";
2
2
  interface Client {
3
3
  query: (config: QueryArrayConfig) => Promise<QueryArrayResult>;
4
4
  }
5
- export declare const createIntegrationEndpointQuery = "-- name: CreateIntegrationEndpoint :one\nINSERT INTO weave_v1.integration_endpoint (\n id,\n workflow_id,\n name,\n description,\n type,\n status,\n target_uri,\n auth_reference,\n config,\n metadata\n)\nVALUES (\n $1,\n $2,\n $3,\n $4,\n $5,\n $6,\n $7,\n $8,\n $9,\n $10\n)\nRETURNING id, workflow_id, name, description, type, status, target_uri, auth_reference, config, metadata, last_checked_at, last_error, created_at, updated_at, archived_at";
5
+ export declare const createIntegrationEndpointQuery = "-- name: CreateIntegrationEndpoint :one\nINSERT INTO weave_v1.integration_endpoint (\n id,\n project_id,\n name,\n description,\n type,\n status,\n target_uri,\n auth_reference,\n config,\n metadata\n)\nVALUES (\n $1,\n $2,\n $3,\n $4,\n $5,\n $6,\n $7,\n $8,\n $9,\n $10\n)\nRETURNING id, project_id, name, description, type, status, target_uri, auth_reference, config, metadata, last_checked_at, last_error, created_at, updated_at, archived_at";
6
6
  export interface CreateIntegrationEndpointArgs {
7
7
  id: string;
8
- workflowId: string;
8
+ projectId: string;
9
9
  name: string;
10
10
  description: string;
11
11
  type: string;
@@ -17,7 +17,7 @@ export interface CreateIntegrationEndpointArgs {
17
17
  }
18
18
  export interface CreateIntegrationEndpointRow {
19
19
  id: string;
20
- workflowId: string;
20
+ projectId: string;
21
21
  name: string;
22
22
  description: string;
23
23
  type: string;
@@ -33,14 +33,14 @@ export interface CreateIntegrationEndpointRow {
33
33
  archivedAt: Date | null;
34
34
  }
35
35
  export declare function createIntegrationEndpoint(client: Client, args: CreateIntegrationEndpointArgs): Promise<CreateIntegrationEndpointRow | null>;
36
- export declare const getIntegrationEndpointQuery = "-- name: GetIntegrationEndpoint :one\nSELECT id, workflow_id, name, description, type, status, target_uri, auth_reference, config, metadata, last_checked_at, last_error, created_at, updated_at, archived_at\nFROM weave_v1.integration_endpoint\nWHERE id = $1\n AND workflow_id = $2";
36
+ export declare const getIntegrationEndpointQuery = "-- name: GetIntegrationEndpoint :one\nSELECT id, project_id, name, description, type, status, target_uri, auth_reference, config, metadata, last_checked_at, last_error, created_at, updated_at, archived_at\nFROM weave_v1.integration_endpoint\nWHERE id = $1\n AND project_id = $2";
37
37
  export interface GetIntegrationEndpointArgs {
38
38
  id: string;
39
- workflowId: string;
39
+ projectId: string;
40
40
  }
41
41
  export interface GetIntegrationEndpointRow {
42
42
  id: string;
43
- workflowId: string;
43
+ projectId: string;
44
44
  name: string;
45
45
  description: string;
46
46
  type: string;
@@ -56,8 +56,34 @@ export interface GetIntegrationEndpointRow {
56
56
  archivedAt: Date | null;
57
57
  }
58
58
  export declare function getIntegrationEndpoint(client: Client, args: GetIntegrationEndpointArgs): Promise<GetIntegrationEndpointRow | null>;
59
- export declare const listIntegrationEndpointsByWorkflowQuery = "-- name: ListIntegrationEndpointsByWorkflow :many\nSELECT id, workflow_id, name, description, type, status, target_uri, auth_reference, config, metadata, last_checked_at, last_error, created_at, updated_at, archived_at\nFROM weave_v1.integration_endpoint\nWHERE workflow_id = $1\n AND ($2::BOOLEAN OR archived_at IS NULL)\nORDER BY updated_at DESC\nLIMIT $4\nOFFSET $3";
59
+ export declare const listIntegrationEndpointsByProjectQuery = "-- name: ListIntegrationEndpointsByProject :many\nSELECT id, project_id, name, description, type, status, target_uri, auth_reference, config, metadata, last_checked_at, last_error, created_at, updated_at, archived_at\nFROM weave_v1.integration_endpoint\nWHERE project_id = $1\n AND ($2::BOOLEAN OR archived_at IS NULL)\nORDER BY updated_at DESC\nLIMIT $4\nOFFSET $3";
60
+ export interface ListIntegrationEndpointsByProjectArgs {
61
+ projectId: string;
62
+ includeArchived: boolean;
63
+ pageOffset: string;
64
+ pageSize: string;
65
+ }
66
+ export interface ListIntegrationEndpointsByProjectRow {
67
+ id: string;
68
+ projectId: string;
69
+ name: string;
70
+ description: string;
71
+ type: string;
72
+ status: string;
73
+ targetUri: string;
74
+ authReference: string;
75
+ config: any;
76
+ metadata: any;
77
+ lastCheckedAt: Date | null;
78
+ lastError: string;
79
+ createdAt: Date;
80
+ updatedAt: Date;
81
+ archivedAt: Date | null;
82
+ }
83
+ export declare function listIntegrationEndpointsByProject(client: Client, args: ListIntegrationEndpointsByProjectArgs): Promise<ListIntegrationEndpointsByProjectRow[]>;
84
+ export declare const listIntegrationEndpointsByWorkflowQuery = "-- name: ListIntegrationEndpointsByWorkflow :many\nSELECT e.id, e.project_id, e.name, e.description, e.type, e.status, e.target_uri, e.auth_reference, e.config, e.metadata, e.last_checked_at, e.last_error, e.created_at, e.updated_at, e.archived_at\nFROM weave_v1.integration_endpoint e\n INNER JOIN weave_v1.workflow_integration_endpoint b\n ON b.integration_endpoint_id = e.id\n AND b.project_id = e.project_id\nWHERE b.project_id = $1\n AND b.workflow_id = $2\n AND ($3::BOOLEAN OR e.archived_at IS NULL)\nORDER BY e.updated_at DESC\nLIMIT $5\nOFFSET $4";
60
85
  export interface ListIntegrationEndpointsByWorkflowArgs {
86
+ projectId: string;
61
87
  workflowId: string;
62
88
  includeArchived: boolean;
63
89
  pageOffset: string;
@@ -65,7 +91,7 @@ export interface ListIntegrationEndpointsByWorkflowArgs {
65
91
  }
66
92
  export interface ListIntegrationEndpointsByWorkflowRow {
67
93
  id: string;
68
- workflowId: string;
94
+ projectId: string;
69
95
  name: string;
70
96
  description: string;
71
97
  type: string;
@@ -81,7 +107,7 @@ export interface ListIntegrationEndpointsByWorkflowRow {
81
107
  archivedAt: Date | null;
82
108
  }
83
109
  export declare function listIntegrationEndpointsByWorkflow(client: Client, args: ListIntegrationEndpointsByWorkflowArgs): Promise<ListIntegrationEndpointsByWorkflowRow[]>;
84
- export declare const updateIntegrationEndpointQuery = "-- name: UpdateIntegrationEndpoint :one\nUPDATE weave_v1.integration_endpoint\nSET name = $1,\n description = $2,\n type = $3,\n status = $4,\n target_uri = $5,\n auth_reference = $6,\n config = $7,\n metadata = $8,\n updated_at = NOW()\nWHERE id = $9\n AND workflow_id = $10\nRETURNING id, workflow_id, name, description, type, status, target_uri, auth_reference, config, metadata, last_checked_at, last_error, created_at, updated_at, archived_at";
110
+ export declare const updateIntegrationEndpointQuery = "-- name: UpdateIntegrationEndpoint :one\nUPDATE weave_v1.integration_endpoint\nSET name = $1,\n description = $2,\n type = $3,\n status = $4,\n target_uri = $5,\n auth_reference = $6,\n config = $7,\n metadata = $8,\n updated_at = NOW()\nWHERE id = $9\n AND project_id = $10\nRETURNING id, project_id, name, description, type, status, target_uri, auth_reference, config, metadata, last_checked_at, last_error, created_at, updated_at, archived_at";
85
111
  export interface UpdateIntegrationEndpointArgs {
86
112
  name: string;
87
113
  description: string;
@@ -92,11 +118,11 @@ export interface UpdateIntegrationEndpointArgs {
92
118
  config: any;
93
119
  metadata: any;
94
120
  id: string;
95
- workflowId: string;
121
+ projectId: string;
96
122
  }
97
123
  export interface UpdateIntegrationEndpointRow {
98
124
  id: string;
99
- workflowId: string;
125
+ projectId: string;
100
126
  name: string;
101
127
  description: string;
102
128
  type: string;
@@ -112,17 +138,17 @@ export interface UpdateIntegrationEndpointRow {
112
138
  archivedAt: Date | null;
113
139
  }
114
140
  export declare function updateIntegrationEndpoint(client: Client, args: UpdateIntegrationEndpointArgs): Promise<UpdateIntegrationEndpointRow | null>;
115
- export declare const setIntegrationEndpointValidationResultQuery = "-- name: SetIntegrationEndpointValidationResult :one\nUPDATE weave_v1.integration_endpoint\nSET status = $1,\n last_checked_at = $2,\n last_error = $3,\n updated_at = NOW()\nWHERE id = $4\n AND workflow_id = $5\nRETURNING id, workflow_id, name, description, type, status, target_uri, auth_reference, config, metadata, last_checked_at, last_error, created_at, updated_at, archived_at";
141
+ export declare const setIntegrationEndpointValidationResultQuery = "-- name: SetIntegrationEndpointValidationResult :one\nUPDATE weave_v1.integration_endpoint\nSET status = $1,\n last_checked_at = $2,\n last_error = $3,\n updated_at = NOW()\nWHERE id = $4\n AND project_id = $5\nRETURNING id, project_id, name, description, type, status, target_uri, auth_reference, config, metadata, last_checked_at, last_error, created_at, updated_at, archived_at";
116
142
  export interface SetIntegrationEndpointValidationResultArgs {
117
143
  status: string;
118
144
  lastCheckedAt: Date | null;
119
145
  lastError: string;
120
146
  id: string;
121
- workflowId: string;
147
+ projectId: string;
122
148
  }
123
149
  export interface SetIntegrationEndpointValidationResultRow {
124
150
  id: string;
125
- workflowId: string;
151
+ projectId: string;
126
152
  name: string;
127
153
  description: string;
128
154
  type: string;
@@ -138,14 +164,14 @@ export interface SetIntegrationEndpointValidationResultRow {
138
164
  archivedAt: Date | null;
139
165
  }
140
166
  export declare function setIntegrationEndpointValidationResult(client: Client, args: SetIntegrationEndpointValidationResultArgs): Promise<SetIntegrationEndpointValidationResultRow | null>;
141
- export declare const archiveIntegrationEndpointQuery = "-- name: ArchiveIntegrationEndpoint :one\nUPDATE weave_v1.integration_endpoint\nSET status = 'archived',\n archived_at = NOW(),\n updated_at = NOW()\nWHERE id = $1\n AND workflow_id = $2\nRETURNING id, workflow_id, name, description, type, status, target_uri, auth_reference, config, metadata, last_checked_at, last_error, created_at, updated_at, archived_at";
167
+ export declare const archiveIntegrationEndpointQuery = "-- name: ArchiveIntegrationEndpoint :one\nUPDATE weave_v1.integration_endpoint\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, type, status, target_uri, auth_reference, config, metadata, last_checked_at, last_error, created_at, updated_at, archived_at";
142
168
  export interface ArchiveIntegrationEndpointArgs {
143
169
  id: string;
144
- workflowId: string;
170
+ projectId: string;
145
171
  }
146
172
  export interface ArchiveIntegrationEndpointRow {
147
173
  id: string;
148
- workflowId: string;
174
+ projectId: string;
149
175
  name: string;
150
176
  description: string;
151
177
  type: string;
@@ -161,10 +187,50 @@ export interface ArchiveIntegrationEndpointRow {
161
187
  archivedAt: Date | null;
162
188
  }
163
189
  export declare function archiveIntegrationEndpoint(client: Client, args: ArchiveIntegrationEndpointArgs): Promise<ArchiveIntegrationEndpointRow | null>;
164
- export declare const deleteIntegrationEndpointQuery = "-- name: DeleteIntegrationEndpoint :exec\nDELETE\nFROM weave_v1.integration_endpoint\nWHERE id = $1\n AND workflow_id = $2";
190
+ export declare const deleteIntegrationEndpointQuery = "-- name: DeleteIntegrationEndpoint :exec\nDELETE\nFROM weave_v1.integration_endpoint\nWHERE id = $1\n AND project_id = $2";
165
191
  export interface DeleteIntegrationEndpointArgs {
166
192
  id: string;
167
- workflowId: string;
193
+ projectId: string;
168
194
  }
169
195
  export declare function deleteIntegrationEndpoint(client: Client, args: DeleteIntegrationEndpointArgs): Promise<void>;
196
+ export declare const attachIntegrationEndpointToWorkflowQuery = "-- name: AttachIntegrationEndpointToWorkflow :one\nINSERT INTO weave_v1.workflow_integration_endpoint (\n project_id,\n workflow_id,\n integration_endpoint_id,\n attached_by,\n metadata\n)\nVALUES (\n $1,\n $2,\n $3,\n $4,\n $5\n)\nON CONFLICT (workflow_id, integration_endpoint_id) DO UPDATE\nSET attached_by = EXCLUDED.attached_by,\n metadata = EXCLUDED.metadata,\n attached_at = NOW()\nRETURNING project_id, workflow_id, integration_endpoint_id, attached_by, metadata, attached_at";
197
+ export interface AttachIntegrationEndpointToWorkflowArgs {
198
+ projectId: string;
199
+ workflowId: string;
200
+ integrationEndpointId: string;
201
+ attachedBy: string;
202
+ metadata: any;
203
+ }
204
+ export interface AttachIntegrationEndpointToWorkflowRow {
205
+ projectId: string;
206
+ workflowId: string;
207
+ integrationEndpointId: string;
208
+ attachedBy: string;
209
+ metadata: any;
210
+ attachedAt: Date;
211
+ }
212
+ export declare function attachIntegrationEndpointToWorkflow(client: Client, args: AttachIntegrationEndpointToWorkflowArgs): Promise<AttachIntegrationEndpointToWorkflowRow | null>;
213
+ export declare const detachIntegrationEndpointFromWorkflowQuery = "-- name: DetachIntegrationEndpointFromWorkflow :exec\nDELETE\nFROM weave_v1.workflow_integration_endpoint\nWHERE project_id = $1\n AND workflow_id = $2\n AND integration_endpoint_id = $3";
214
+ export interface DetachIntegrationEndpointFromWorkflowArgs {
215
+ projectId: string;
216
+ workflowId: string;
217
+ integrationEndpointId: string;
218
+ }
219
+ export declare function detachIntegrationEndpointFromWorkflow(client: Client, args: DetachIntegrationEndpointFromWorkflowArgs): Promise<void>;
220
+ export declare const listWorkflowIntegrationEndpointBindingsQuery = "-- name: ListWorkflowIntegrationEndpointBindings :many\nSELECT project_id, workflow_id, integration_endpoint_id, attached_by, metadata, attached_at\nFROM weave_v1.workflow_integration_endpoint\nWHERE project_id = $1\n AND workflow_id = $2\nORDER BY attached_at DESC\nLIMIT $4\nOFFSET $3";
221
+ export interface ListWorkflowIntegrationEndpointBindingsArgs {
222
+ projectId: string;
223
+ workflowId: string;
224
+ pageOffset: string;
225
+ pageSize: string;
226
+ }
227
+ export interface ListWorkflowIntegrationEndpointBindingsRow {
228
+ projectId: string;
229
+ workflowId: string;
230
+ integrationEndpointId: string;
231
+ attachedBy: string;
232
+ metadata: any;
233
+ attachedAt: Date;
234
+ }
235
+ export declare function listWorkflowIntegrationEndpointBindings(client: Client, args: ListWorkflowIntegrationEndpointBindingsArgs): Promise<ListWorkflowIntegrationEndpointBindingsRow[]>;
170
236
  export {};
@@ -1,17 +1,21 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.deleteIntegrationEndpointQuery = exports.archiveIntegrationEndpointQuery = exports.setIntegrationEndpointValidationResultQuery = exports.updateIntegrationEndpointQuery = exports.listIntegrationEndpointsByWorkflowQuery = exports.getIntegrationEndpointQuery = exports.createIntegrationEndpointQuery = void 0;
3
+ exports.listWorkflowIntegrationEndpointBindingsQuery = exports.detachIntegrationEndpointFromWorkflowQuery = exports.attachIntegrationEndpointToWorkflowQuery = exports.deleteIntegrationEndpointQuery = exports.archiveIntegrationEndpointQuery = exports.setIntegrationEndpointValidationResultQuery = exports.updateIntegrationEndpointQuery = exports.listIntegrationEndpointsByWorkflowQuery = exports.listIntegrationEndpointsByProjectQuery = exports.getIntegrationEndpointQuery = exports.createIntegrationEndpointQuery = void 0;
4
4
  exports.createIntegrationEndpoint = createIntegrationEndpoint;
5
5
  exports.getIntegrationEndpoint = getIntegrationEndpoint;
6
+ exports.listIntegrationEndpointsByProject = listIntegrationEndpointsByProject;
6
7
  exports.listIntegrationEndpointsByWorkflow = listIntegrationEndpointsByWorkflow;
7
8
  exports.updateIntegrationEndpoint = updateIntegrationEndpoint;
8
9
  exports.setIntegrationEndpointValidationResult = setIntegrationEndpointValidationResult;
9
10
  exports.archiveIntegrationEndpoint = archiveIntegrationEndpoint;
10
11
  exports.deleteIntegrationEndpoint = deleteIntegrationEndpoint;
12
+ exports.attachIntegrationEndpointToWorkflow = attachIntegrationEndpointToWorkflow;
13
+ exports.detachIntegrationEndpointFromWorkflow = detachIntegrationEndpointFromWorkflow;
14
+ exports.listWorkflowIntegrationEndpointBindings = listWorkflowIntegrationEndpointBindings;
11
15
  exports.createIntegrationEndpointQuery = `-- name: CreateIntegrationEndpoint :one
12
16
  INSERT INTO weave_v1.integration_endpoint (
13
17
  id,
14
- workflow_id,
18
+ project_id,
15
19
  name,
16
20
  description,
17
21
  type,
@@ -33,11 +37,11 @@ VALUES (
33
37
  $9,
34
38
  $10
35
39
  )
36
- RETURNING id, workflow_id, name, description, type, status, target_uri, auth_reference, config, metadata, last_checked_at, last_error, created_at, updated_at, archived_at`;
40
+ RETURNING id, project_id, name, description, type, status, target_uri, auth_reference, config, metadata, last_checked_at, last_error, created_at, updated_at, archived_at`;
37
41
  async function createIntegrationEndpoint(client, args) {
38
42
  const result = await client.query({
39
43
  text: exports.createIntegrationEndpointQuery,
40
- values: [args.id, args.workflowId, args.name, args.description, args.type, args.status, args.targetUri, args.authReference, args.config, args.metadata],
44
+ values: [args.id, args.projectId, args.name, args.description, args.type, args.status, args.targetUri, args.authReference, args.config, args.metadata],
41
45
  rowMode: "array"
42
46
  });
43
47
  if (result.rows.length !== 1) {
@@ -46,7 +50,7 @@ async function createIntegrationEndpoint(client, args) {
46
50
  const row = result.rows[0];
47
51
  return {
48
52
  id: row[0],
49
- workflowId: row[1],
53
+ projectId: row[1],
50
54
  name: row[2],
51
55
  description: row[3],
52
56
  type: row[4],
@@ -63,14 +67,14 @@ async function createIntegrationEndpoint(client, args) {
63
67
  };
64
68
  }
65
69
  exports.getIntegrationEndpointQuery = `-- name: GetIntegrationEndpoint :one
66
- SELECT id, workflow_id, name, description, type, status, target_uri, auth_reference, config, metadata, last_checked_at, last_error, created_at, updated_at, archived_at
70
+ SELECT id, project_id, name, description, type, status, target_uri, auth_reference, config, metadata, last_checked_at, last_error, created_at, updated_at, archived_at
67
71
  FROM weave_v1.integration_endpoint
68
72
  WHERE id = $1
69
- AND workflow_id = $2`;
73
+ AND project_id = $2`;
70
74
  async function getIntegrationEndpoint(client, args) {
71
75
  const result = await client.query({
72
76
  text: exports.getIntegrationEndpointQuery,
73
- values: [args.id, args.workflowId],
77
+ values: [args.id, args.projectId],
74
78
  rowMode: "array"
75
79
  });
76
80
  if (result.rows.length !== 1) {
@@ -79,7 +83,7 @@ async function getIntegrationEndpoint(client, args) {
79
83
  const row = result.rows[0];
80
84
  return {
81
85
  id: row[0],
82
- workflowId: row[1],
86
+ projectId: row[1],
83
87
  name: row[2],
84
88
  description: row[3],
85
89
  type: row[4],
@@ -95,24 +99,62 @@ async function getIntegrationEndpoint(client, args) {
95
99
  archivedAt: row[14]
96
100
  };
97
101
  }
98
- exports.listIntegrationEndpointsByWorkflowQuery = `-- name: ListIntegrationEndpointsByWorkflow :many
99
- SELECT id, workflow_id, name, description, type, status, target_uri, auth_reference, config, metadata, last_checked_at, last_error, created_at, updated_at, archived_at
102
+ exports.listIntegrationEndpointsByProjectQuery = `-- name: ListIntegrationEndpointsByProject :many
103
+ SELECT id, project_id, name, description, type, status, target_uri, auth_reference, config, metadata, last_checked_at, last_error, created_at, updated_at, archived_at
100
104
  FROM weave_v1.integration_endpoint
101
- WHERE workflow_id = $1
105
+ WHERE project_id = $1
102
106
  AND ($2::BOOLEAN OR archived_at IS NULL)
103
107
  ORDER BY updated_at DESC
104
108
  LIMIT $4
105
109
  OFFSET $3`;
110
+ async function listIntegrationEndpointsByProject(client, args) {
111
+ const result = await client.query({
112
+ text: exports.listIntegrationEndpointsByProjectQuery,
113
+ values: [args.projectId, args.includeArchived, args.pageOffset, args.pageSize],
114
+ rowMode: "array"
115
+ });
116
+ return result.rows.map(row => {
117
+ return {
118
+ id: row[0],
119
+ projectId: row[1],
120
+ name: row[2],
121
+ description: row[3],
122
+ type: row[4],
123
+ status: row[5],
124
+ targetUri: row[6],
125
+ authReference: row[7],
126
+ config: row[8],
127
+ metadata: row[9],
128
+ lastCheckedAt: row[10],
129
+ lastError: row[11],
130
+ createdAt: row[12],
131
+ updatedAt: row[13],
132
+ archivedAt: row[14]
133
+ };
134
+ });
135
+ }
136
+ exports.listIntegrationEndpointsByWorkflowQuery = `-- name: ListIntegrationEndpointsByWorkflow :many
137
+ SELECT e.id, e.project_id, e.name, e.description, e.type, e.status, e.target_uri, e.auth_reference, e.config, e.metadata, e.last_checked_at, e.last_error, e.created_at, e.updated_at, e.archived_at
138
+ FROM weave_v1.integration_endpoint e
139
+ INNER JOIN weave_v1.workflow_integration_endpoint b
140
+ ON b.integration_endpoint_id = e.id
141
+ AND b.project_id = e.project_id
142
+ WHERE b.project_id = $1
143
+ AND b.workflow_id = $2
144
+ AND ($3::BOOLEAN OR e.archived_at IS NULL)
145
+ ORDER BY e.updated_at DESC
146
+ LIMIT $5
147
+ OFFSET $4`;
106
148
  async function listIntegrationEndpointsByWorkflow(client, args) {
107
149
  const result = await client.query({
108
150
  text: exports.listIntegrationEndpointsByWorkflowQuery,
109
- values: [args.workflowId, args.includeArchived, args.pageOffset, args.pageSize],
151
+ values: [args.projectId, args.workflowId, args.includeArchived, args.pageOffset, args.pageSize],
110
152
  rowMode: "array"
111
153
  });
112
154
  return result.rows.map(row => {
113
155
  return {
114
156
  id: row[0],
115
- workflowId: row[1],
157
+ projectId: row[1],
116
158
  name: row[2],
117
159
  description: row[3],
118
160
  type: row[4],
@@ -141,12 +183,12 @@ SET name = $1,
141
183
  metadata = $8,
142
184
  updated_at = NOW()
143
185
  WHERE id = $9
144
- AND workflow_id = $10
145
- RETURNING id, workflow_id, name, description, type, status, target_uri, auth_reference, config, metadata, last_checked_at, last_error, created_at, updated_at, archived_at`;
186
+ AND project_id = $10
187
+ RETURNING id, project_id, name, description, type, status, target_uri, auth_reference, config, metadata, last_checked_at, last_error, created_at, updated_at, archived_at`;
146
188
  async function updateIntegrationEndpoint(client, args) {
147
189
  const result = await client.query({
148
190
  text: exports.updateIntegrationEndpointQuery,
149
- values: [args.name, args.description, args.type, args.status, args.targetUri, args.authReference, args.config, args.metadata, args.id, args.workflowId],
191
+ values: [args.name, args.description, args.type, args.status, args.targetUri, args.authReference, args.config, args.metadata, args.id, args.projectId],
150
192
  rowMode: "array"
151
193
  });
152
194
  if (result.rows.length !== 1) {
@@ -155,7 +197,7 @@ async function updateIntegrationEndpoint(client, args) {
155
197
  const row = result.rows[0];
156
198
  return {
157
199
  id: row[0],
158
- workflowId: row[1],
200
+ projectId: row[1],
159
201
  name: row[2],
160
202
  description: row[3],
161
203
  type: row[4],
@@ -178,12 +220,12 @@ SET status = $1,
178
220
  last_error = $3,
179
221
  updated_at = NOW()
180
222
  WHERE id = $4
181
- AND workflow_id = $5
182
- RETURNING id, workflow_id, name, description, type, status, target_uri, auth_reference, config, metadata, last_checked_at, last_error, created_at, updated_at, archived_at`;
223
+ AND project_id = $5
224
+ RETURNING id, project_id, name, description, type, status, target_uri, auth_reference, config, metadata, last_checked_at, last_error, created_at, updated_at, archived_at`;
183
225
  async function setIntegrationEndpointValidationResult(client, args) {
184
226
  const result = await client.query({
185
227
  text: exports.setIntegrationEndpointValidationResultQuery,
186
- values: [args.status, args.lastCheckedAt, args.lastError, args.id, args.workflowId],
228
+ values: [args.status, args.lastCheckedAt, args.lastError, args.id, args.projectId],
187
229
  rowMode: "array"
188
230
  });
189
231
  if (result.rows.length !== 1) {
@@ -192,7 +234,7 @@ async function setIntegrationEndpointValidationResult(client, args) {
192
234
  const row = result.rows[0];
193
235
  return {
194
236
  id: row[0],
195
- workflowId: row[1],
237
+ projectId: row[1],
196
238
  name: row[2],
197
239
  description: row[3],
198
240
  type: row[4],
@@ -214,12 +256,12 @@ SET status = 'archived',
214
256
  archived_at = NOW(),
215
257
  updated_at = NOW()
216
258
  WHERE id = $1
217
- AND workflow_id = $2
218
- RETURNING id, workflow_id, name, description, type, status, target_uri, auth_reference, config, metadata, last_checked_at, last_error, created_at, updated_at, archived_at`;
259
+ AND project_id = $2
260
+ RETURNING id, project_id, name, description, type, status, target_uri, auth_reference, config, metadata, last_checked_at, last_error, created_at, updated_at, archived_at`;
219
261
  async function archiveIntegrationEndpoint(client, args) {
220
262
  const result = await client.query({
221
263
  text: exports.archiveIntegrationEndpointQuery,
222
- values: [args.id, args.workflowId],
264
+ values: [args.id, args.projectId],
223
265
  rowMode: "array"
224
266
  });
225
267
  if (result.rows.length !== 1) {
@@ -228,7 +270,7 @@ async function archiveIntegrationEndpoint(client, args) {
228
270
  const row = result.rows[0];
229
271
  return {
230
272
  id: row[0],
231
- workflowId: row[1],
273
+ projectId: row[1],
232
274
  name: row[2],
233
275
  description: row[3],
234
276
  type: row[4],
@@ -248,11 +290,88 @@ exports.deleteIntegrationEndpointQuery = `-- name: DeleteIntegrationEndpoint :ex
248
290
  DELETE
249
291
  FROM weave_v1.integration_endpoint
250
292
  WHERE id = $1
251
- AND workflow_id = $2`;
293
+ AND project_id = $2`;
252
294
  async function deleteIntegrationEndpoint(client, args) {
253
295
  await client.query({
254
296
  text: exports.deleteIntegrationEndpointQuery,
255
- values: [args.id, args.workflowId],
297
+ values: [args.id, args.projectId],
298
+ rowMode: "array"
299
+ });
300
+ }
301
+ exports.attachIntegrationEndpointToWorkflowQuery = `-- name: AttachIntegrationEndpointToWorkflow :one
302
+ INSERT INTO weave_v1.workflow_integration_endpoint (
303
+ project_id,
304
+ workflow_id,
305
+ integration_endpoint_id,
306
+ attached_by,
307
+ metadata
308
+ )
309
+ VALUES (
310
+ $1,
311
+ $2,
312
+ $3,
313
+ $4,
314
+ $5
315
+ )
316
+ ON CONFLICT (workflow_id, integration_endpoint_id) DO UPDATE
317
+ SET attached_by = EXCLUDED.attached_by,
318
+ metadata = EXCLUDED.metadata,
319
+ attached_at = NOW()
320
+ RETURNING project_id, workflow_id, integration_endpoint_id, attached_by, metadata, attached_at`;
321
+ async function attachIntegrationEndpointToWorkflow(client, args) {
322
+ const result = await client.query({
323
+ text: exports.attachIntegrationEndpointToWorkflowQuery,
324
+ values: [args.projectId, args.workflowId, args.integrationEndpointId, args.attachedBy, args.metadata],
256
325
  rowMode: "array"
257
326
  });
327
+ if (result.rows.length !== 1) {
328
+ return null;
329
+ }
330
+ const row = result.rows[0];
331
+ return {
332
+ projectId: row[0],
333
+ workflowId: row[1],
334
+ integrationEndpointId: row[2],
335
+ attachedBy: row[3],
336
+ metadata: row[4],
337
+ attachedAt: row[5]
338
+ };
339
+ }
340
+ exports.detachIntegrationEndpointFromWorkflowQuery = `-- name: DetachIntegrationEndpointFromWorkflow :exec
341
+ DELETE
342
+ FROM weave_v1.workflow_integration_endpoint
343
+ WHERE project_id = $1
344
+ AND workflow_id = $2
345
+ AND integration_endpoint_id = $3`;
346
+ async function detachIntegrationEndpointFromWorkflow(client, args) {
347
+ await client.query({
348
+ text: exports.detachIntegrationEndpointFromWorkflowQuery,
349
+ values: [args.projectId, args.workflowId, args.integrationEndpointId],
350
+ rowMode: "array"
351
+ });
352
+ }
353
+ exports.listWorkflowIntegrationEndpointBindingsQuery = `-- name: ListWorkflowIntegrationEndpointBindings :many
354
+ SELECT project_id, workflow_id, integration_endpoint_id, attached_by, metadata, attached_at
355
+ FROM weave_v1.workflow_integration_endpoint
356
+ WHERE project_id = $1
357
+ AND workflow_id = $2
358
+ ORDER BY attached_at DESC
359
+ LIMIT $4
360
+ OFFSET $3`;
361
+ async function listWorkflowIntegrationEndpointBindings(client, args) {
362
+ const result = await client.query({
363
+ text: exports.listWorkflowIntegrationEndpointBindingsQuery,
364
+ values: [args.projectId, args.workflowId, args.pageOffset, args.pageSize],
365
+ rowMode: "array"
366
+ });
367
+ return result.rows.map(row => {
368
+ return {
369
+ projectId: row[0],
370
+ workflowId: row[1],
371
+ integrationEndpointId: row[2],
372
+ attachedBy: row[3],
373
+ metadata: row[4],
374
+ attachedAt: row[5]
375
+ };
376
+ });
258
377
  }
@@ -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 createProjectQuery = "-- name: CreateProject :one\nINSERT INTO weave_v1.project (\n id,\n organization_id,\n name,\n description,\n status\n)\nVALUES (\n $1,\n $2,\n $3,\n $4,\n $5\n)\nRETURNING id, organization_id, name, description, status, created_at, updated_at, archived_at";
5
+ export declare const createProjectQuery = "-- name: CreateProject :one\nINSERT INTO weave_v1.project (\n id,\n organization_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, organization_id, name, slug, description, status, created_at, updated_at, archived_at";
6
6
  export interface CreateProjectArgs {
7
7
  id: string;
8
8
  organizationId: string;
9
9
  name: string;
10
+ slug: string;
10
11
  description: string;
11
12
  status: string;
12
13
  }
@@ -14,6 +15,7 @@ export interface CreateProjectRow {
14
15
  id: string;
15
16
  organizationId: 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 CreateProjectRow {
21
23
  archivedAt: Date | null;
22
24
  }
23
25
  export declare function createProject(client: Client, args: CreateProjectArgs): Promise<CreateProjectRow | null>;
24
- export declare const getProjectQuery = "-- name: GetProject :one\nSELECT id, organization_id, name, description, status, created_at, updated_at, archived_at\nFROM weave_v1.project\nWHERE id = $1";
26
+ export declare const getProjectQuery = "-- name: GetProject :one\nSELECT id, organization_id, name, slug, description, status, created_at, updated_at, archived_at\nFROM weave_v1.project\nWHERE id = $1";
25
27
  export interface GetProjectArgs {
26
28
  id: string;
27
29
  }
@@ -29,6 +31,7 @@ export interface GetProjectRow {
29
31
  id: string;
30
32
  organizationId: string;
31
33
  name: string;
34
+ slug: string;
32
35
  description: string;
33
36
  status: string;
34
37
  createdAt: Date;
@@ -36,7 +39,24 @@ export interface GetProjectRow {
36
39
  archivedAt: Date | null;
37
40
  }
38
41
  export declare function getProject(client: Client, args: GetProjectArgs): Promise<GetProjectRow | null>;
39
- export declare const listProjectsByOrganizationQuery = "-- name: ListProjectsByOrganization :many\nSELECT id, organization_id, name, description, status, created_at, updated_at, archived_at\nFROM weave_v1.project\nWHERE organization_id = $1\n AND ($2::BOOLEAN OR archived_at IS NULL)\nORDER BY created_at DESC\nLIMIT $4\nOFFSET $3";
42
+ export declare const getProjectBySlugQuery = "-- name: GetProjectBySlug :one\nSELECT id, organization_id, name, slug, description, status, created_at, updated_at, archived_at\nFROM weave_v1.project\nWHERE organization_id = $1\n AND slug = $2";
43
+ export interface GetProjectBySlugArgs {
44
+ organizationId: string;
45
+ slug: string;
46
+ }
47
+ export interface GetProjectBySlugRow {
48
+ id: string;
49
+ organizationId: string;
50
+ name: string;
51
+ slug: string;
52
+ description: string;
53
+ status: string;
54
+ createdAt: Date;
55
+ updatedAt: Date;
56
+ archivedAt: Date | null;
57
+ }
58
+ export declare function getProjectBySlug(client: Client, args: GetProjectBySlugArgs): Promise<GetProjectBySlugRow | null>;
59
+ export declare const listProjectsByOrganizationQuery = "-- name: ListProjectsByOrganization :many\nSELECT id, organization_id, name, slug, description, status, created_at, updated_at, archived_at\nFROM weave_v1.project\nWHERE organization_id = $1\n AND ($2::BOOLEAN OR archived_at IS NULL)\nORDER BY created_at DESC\nLIMIT $4\nOFFSET $3";
40
60
  export interface ListProjectsByOrganizationArgs {
41
61
  organizationId: string;
42
62
  includeArchived: boolean;
@@ -47,6 +67,7 @@ export interface ListProjectsByOrganizationRow {
47
67
  id: string;
48
68
  organizationId: string;
49
69
  name: string;
70
+ slug: string;
50
71
  description: string;
51
72
  status: string;
52
73
  createdAt: Date;
@@ -54,9 +75,10 @@ export interface ListProjectsByOrganizationRow {
54
75
  archivedAt: Date | null;
55
76
  }
56
77
  export declare function listProjectsByOrganization(client: Client, args: ListProjectsByOrganizationArgs): Promise<ListProjectsByOrganizationRow[]>;
57
- export declare const updateProjectQuery = "-- name: UpdateProject :one\nUPDATE weave_v1.project\nSET name = $1,\n description = $2,\n status = $3,\n updated_at = NOW()\nWHERE id = $4\nRETURNING id, organization_id, name, description, status, created_at, updated_at, archived_at";
78
+ export declare const updateProjectQuery = "-- name: UpdateProject :one\nUPDATE weave_v1.project\nSET name = $1,\n slug = $2,\n description = $3,\n status = $4,\n updated_at = NOW()\nWHERE id = $5\nRETURNING id, organization_id, name, slug, description, status, created_at, updated_at, archived_at";
58
79
  export interface UpdateProjectArgs {
59
80
  name: string;
81
+ slug: string;
60
82
  description: string;
61
83
  status: string;
62
84
  id: string;
@@ -65,6 +87,7 @@ export interface UpdateProjectRow {
65
87
  id: string;
66
88
  organizationId: string;
67
89
  name: string;
90
+ slug: string;
68
91
  description: string;
69
92
  status: string;
70
93
  createdAt: Date;
@@ -72,7 +95,7 @@ export interface UpdateProjectRow {
72
95
  archivedAt: Date | null;
73
96
  }
74
97
  export declare function updateProject(client: Client, args: UpdateProjectArgs): Promise<UpdateProjectRow | null>;
75
- export declare const archiveProjectQuery = "-- name: ArchiveProject :one\nUPDATE weave_v1.project\nSET status = 'archived',\n archived_at = NOW(),\n updated_at = NOW()\nWHERE id = $1\nRETURNING id, organization_id, name, description, status, created_at, updated_at, archived_at";
98
+ export declare const archiveProjectQuery = "-- name: ArchiveProject :one\nUPDATE weave_v1.project\nSET status = 'archived',\n archived_at = NOW(),\n updated_at = NOW()\nWHERE id = $1\nRETURNING id, organization_id, name, slug, description, status, created_at, updated_at, archived_at";
76
99
  export interface ArchiveProjectArgs {
77
100
  id: string;
78
101
  }
@@ -80,6 +103,7 @@ export interface ArchiveProjectRow {
80
103
  id: string;
81
104
  organizationId: string;
82
105
  name: string;
106
+ slug: string;
83
107
  description: string;
84
108
  status: string;
85
109
  createdAt: Date;