weave-typescript 0.13.0 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +9 -16
- package/dist/index.js +13 -21
- package/dist/weaveapi/project/v1/project.pb.d.ts +69 -5
- package/dist/weaveapi/project/v1/project.pb.js +787 -62
- package/dist/weaveapi/project/v1/service.pb.d.ts +110 -69
- package/dist/weaveapi/project/v1/service.pb.js +1056 -392
- package/dist/weaveapi/task/v1/service.pb.d.ts +172 -0
- package/dist/weaveapi/task/v1/service.pb.js +1436 -0
- package/dist/weaveapi/task/v1/task.pb.d.ts +85 -0
- package/dist/weaveapi/task/v1/task.pb.js +802 -0
- package/dist/weavesql/atcdb/event_sql.d.ts +10 -0
- package/dist/weavesql/atcdb/event_sql.js +11 -1
- package/dist/weavesql/atcdb/mailbox_sql.d.ts +2 -2
- package/dist/weavesql/atcdb/mailbox_sql.js +1 -1
- package/dist/weavesql/weavedb/project_sql.d.ts +164 -41
- package/dist/weavesql/weavedb/project_sql.js +398 -103
- package/dist/weavesql/weavedb/task_sql.d.ts +210 -0
- package/dist/weavesql/weavedb/task_sql.js +430 -0
- package/package.json +2 -2
- package/dist/weaveapi/auth/v1/service.pb.d.ts +0 -709
- package/dist/weaveapi/auth/v1/service.pb.js +0 -5058
- package/dist/weaveapi/auth/v1/session.pb.d.ts +0 -43
- package/dist/weaveapi/auth/v1/session.pb.js +0 -308
- package/dist/weaveapi/auth/v1/usage.pb.d.ts +0 -76
- package/dist/weaveapi/auth/v1/usage.pb.js +0 -849
- package/dist/weaveapi/auth/v1/user.pb.d.ts +0 -141
- package/dist/weaveapi/auth/v1/user.pb.js +0 -1625
- package/dist/weaveapi/data/v1/data.pb.d.ts +0 -54
- package/dist/weaveapi/data/v1/data.pb.js +0 -411
- package/dist/weaveapi/data/v1/service.pb.d.ts +0 -296
- package/dist/weaveapi/data/v1/service.pb.js +0 -2777
- package/dist/weaveapi/generate/v1/configuration.pb.d.ts +0 -122
- package/dist/weaveapi/generate/v1/configuration.pb.js +0 -877
- package/dist/weaveapi/generate/v1/generate.pb.d.ts +0 -48
- package/dist/weaveapi/generate/v1/generate.pb.js +0 -367
- package/dist/weaveapi/generate/v1/service.pb.d.ts +0 -173
- package/dist/weaveapi/generate/v1/service.pb.js +0 -1207
- package/dist/weaveapi/input/v1/input.pb.d.ts +0 -77
- package/dist/weaveapi/input/v1/input.pb.js +0 -632
- package/dist/weaveapi/input/v1/service.pb.d.ts +0 -390
- package/dist/weaveapi/input/v1/service.pb.js +0 -3610
- package/dist/weaveapi/integration/v1/integration.pb.d.ts +0 -67
- package/dist/weaveapi/integration/v1/integration.pb.js +0 -486
- package/dist/weaveapi/integration/v1/service.pb.d.ts +0 -318
- package/dist/weaveapi/integration/v1/service.pb.js +0 -2992
- package/dist/weaveapi/llmx/v1/architecture.pb.d.ts +0 -665
- package/dist/weaveapi/llmx/v1/architecture.pb.js +0 -3028
- package/dist/weaveapi/llmx/v1/capabilities.pb.d.ts +0 -709
- package/dist/weaveapi/llmx/v1/capabilities.pb.js +0 -3458
- package/dist/weaveapi/llmx/v1/model.pb.d.ts +0 -375
- package/dist/weaveapi/llmx/v1/model.pb.js +0 -1472
- package/dist/weaveapi/llmx/v1/pricing.pb.d.ts +0 -340
- package/dist/weaveapi/llmx/v1/pricing.pb.js +0 -974
- package/dist/weaveapi/llmx/v1/provider.pb.d.ts +0 -72
- package/dist/weaveapi/llmx/v1/provider.pb.js +0 -218
- package/dist/weaveapi/llmx/v1/service.pb.d.ts +0 -683
- package/dist/weaveapi/llmx/v1/service.pb.js +0 -5311
- package/dist/weaveapi/mcpregistry/v1/server.pb.d.ts +0 -54
- package/dist/weaveapi/mcpregistry/v1/server.pb.js +0 -436
- package/dist/weaveapi/mcpregistry/v1/service.pb.d.ts +0 -171
- package/dist/weaveapi/mcpregistry/v1/service.pb.js +0 -963
- package/dist/weaveapi/payment/v1/invoice.pb.d.ts +0 -92
- package/dist/weaveapi/payment/v1/invoice.pb.js +0 -998
- package/dist/weaveapi/payment/v1/service.pb.d.ts +0 -662
- package/dist/weaveapi/payment/v1/service.pb.js +0 -5395
- package/dist/weaveapi/payment/v1/subscription.pb.d.ts +0 -165
- package/dist/weaveapi/payment/v1/subscription.pb.js +0 -1930
- package/dist/weaveapi/report/v1/report.pb.d.ts +0 -81
- package/dist/weaveapi/report/v1/report.pb.js +0 -678
- package/dist/weaveapi/report/v1/service.pb.d.ts +0 -194
- package/dist/weaveapi/report/v1/service.pb.js +0 -1923
- package/dist/weaveapi/requirement/v1/requirement.pb.d.ts +0 -70
- package/dist/weaveapi/requirement/v1/requirement.pb.js +0 -570
- package/dist/weaveapi/requirement/v1/service.pb.d.ts +0 -390
- package/dist/weaveapi/requirement/v1/service.pb.js +0 -3636
- package/dist/weaveapi/run/v1/run.pb.d.ts +0 -117
- package/dist/weaveapi/run/v1/run.pb.js +0 -1155
- package/dist/weaveapi/run/v1/service.pb.d.ts +0 -229
- package/dist/weaveapi/run/v1/service.pb.js +0 -2426
- package/dist/weaveapi/script/v1/script.pb.d.ts +0 -102
- package/dist/weaveapi/script/v1/script.pb.js +0 -1025
- package/dist/weaveapi/script/v1/service.pb.d.ts +0 -502
- package/dist/weaveapi/script/v1/service.pb.js +0 -4871
- package/dist/weaveapi/storage/v1/auth.pb.d.ts +0 -27
- package/dist/weaveapi/storage/v1/auth.pb.js +0 -110
- package/dist/weaveapi/storage/v1/nosql_database.pb.d.ts +0 -91
- package/dist/weaveapi/storage/v1/nosql_database.pb.js +0 -1056
- package/dist/weaveapi/storage/v1/object_store.pb.d.ts +0 -49
- package/dist/weaveapi/storage/v1/object_store.pb.js +0 -441
- package/dist/weaveapi/storage/v1/service.pb.d.ts +0 -245
- package/dist/weaveapi/storage/v1/service.pb.js +0 -1339
- package/dist/weaveapi/storage/v1/sql_database.pb.d.ts +0 -98
- package/dist/weaveapi/storage/v1/sql_database.pb.js +0 -1184
- package/dist/weaveapi/storage/v1/storage.pb.d.ts +0 -35
- package/dist/weaveapi/storage/v1/storage.pb.js +0 -198
- package/dist/weaveapi/storage/v1/vcs.pb.d.ts +0 -75
- package/dist/weaveapi/storage/v1/vcs.pb.js +0 -864
- package/dist/weaveapi/suite/v1/service.pb.d.ts +0 -539
- package/dist/weaveapi/suite/v1/service.pb.js +0 -5279
- package/dist/weaveapi/suite/v1/suite.pb.d.ts +0 -92
- package/dist/weaveapi/suite/v1/suite.pb.js +0 -876
- package/dist/weaveapi/synthesize/v1/dataset.pb.d.ts +0 -68
- package/dist/weaveapi/synthesize/v1/dataset.pb.js +0 -460
- package/dist/weaveapi/synthesize/v1/inline_data.pb.d.ts +0 -45
- package/dist/weaveapi/synthesize/v1/inline_data.pb.js +0 -166
- package/dist/weaveapi/synthesize/v1/relationship.pb.d.ts +0 -58
- package/dist/weaveapi/synthesize/v1/relationship.pb.js +0 -253
- package/dist/weaveapi/synthesize/v1/service.pb.d.ts +0 -144
- package/dist/weaveapi/synthesize/v1/service.pb.js +0 -937
- package/dist/weaveapi/synthesize/v1/training.pb.d.ts +0 -58
- package/dist/weaveapi/synthesize/v1/training.pb.js +0 -386
- package/dist/weaveapi/testcase/v1/service.pb.d.ts +0 -498
- package/dist/weaveapi/testcase/v1/service.pb.js +0 -4728
- package/dist/weaveapi/testcase/v1/testcase.pb.d.ts +0 -91
- package/dist/weaveapi/testcase/v1/testcase.pb.js +0 -794
- package/dist/weaveapi/workflow/v1/service.pb.d.ts +0 -261
- package/dist/weaveapi/workflow/v1/service.pb.js +0 -2120
- package/dist/weaveapi/workflow/v1/workflow.pb.d.ts +0 -77
- package/dist/weaveapi/workflow/v1/workflow.pb.js +0 -555
- package/dist/weaveapi/workflowdata/v1/service.pb.d.ts +0 -295
- package/dist/weaveapi/workflowdata/v1/service.pb.js +0 -2612
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
import { QueryArrayConfig, QueryArrayResult } from "pg";
|
|
2
|
+
interface Client {
|
|
3
|
+
query: (config: QueryArrayConfig) => Promise<QueryArrayResult>;
|
|
4
|
+
}
|
|
5
|
+
export declare const createTaskQuery = "-- name: CreateTask :one\nINSERT INTO weave.tasks (\n id,\n organization_id,\n project_id,\n slug,\n title,\n summary,\n description,\n status,\n owner_kind,\n owner_id,\n owner_slug,\n owner_display_name,\n creator_user_id,\n source_system,\n source_id,\n source_metadata\n) VALUES (\n $1,\n $2,\n $3,\n $4,\n $5,\n $6,\n $7,\n $8,\n $9,\n $10,\n $11,\n $12,\n $13,\n $14,\n $15,\n $16\n)\nRETURNING\n id,\n organization_id,\n project_id,\n slug,\n title,\n summary,\n description,\n status,\n owner_kind,\n owner_id,\n owner_slug,\n owner_display_name,\n creator_user_id,\n source_system,\n source_id,\n source_metadata,\n created_at,\n updated_at,\n completed_at,\n completion_approved";
|
|
6
|
+
export interface CreateTaskArgs {
|
|
7
|
+
id: string;
|
|
8
|
+
organizationId: string;
|
|
9
|
+
projectId: string;
|
|
10
|
+
slug: string;
|
|
11
|
+
title: string;
|
|
12
|
+
summary: string;
|
|
13
|
+
description: string;
|
|
14
|
+
status: string;
|
|
15
|
+
ownerKind: string;
|
|
16
|
+
ownerId: string | null;
|
|
17
|
+
ownerSlug: string | null;
|
|
18
|
+
ownerDisplayName: string;
|
|
19
|
+
creatorUserId: string;
|
|
20
|
+
sourceSystem: string | null;
|
|
21
|
+
sourceId: string | null;
|
|
22
|
+
sourceMetadata: any | null;
|
|
23
|
+
}
|
|
24
|
+
export interface CreateTaskRow {
|
|
25
|
+
id: string;
|
|
26
|
+
organizationId: string;
|
|
27
|
+
projectId: string;
|
|
28
|
+
slug: string;
|
|
29
|
+
title: string;
|
|
30
|
+
summary: string;
|
|
31
|
+
description: string;
|
|
32
|
+
status: string;
|
|
33
|
+
ownerKind: string;
|
|
34
|
+
ownerId: string | null;
|
|
35
|
+
ownerSlug: string | null;
|
|
36
|
+
ownerDisplayName: string;
|
|
37
|
+
creatorUserId: string;
|
|
38
|
+
sourceSystem: string | null;
|
|
39
|
+
sourceId: string | null;
|
|
40
|
+
sourceMetadata: any | null;
|
|
41
|
+
createdAt: Date;
|
|
42
|
+
updatedAt: Date;
|
|
43
|
+
completedAt: Date | null;
|
|
44
|
+
completionApproved: boolean;
|
|
45
|
+
}
|
|
46
|
+
export declare function createTask(client: Client, args: CreateTaskArgs): Promise<CreateTaskRow | null>;
|
|
47
|
+
export declare const getTaskBySlugQuery = "-- name: GetTaskBySlug :one\nSELECT\n t.id,\n t.organization_id,\n t.project_id,\n p.slug AS project_slug,\n t.slug,\n t.title,\n t.summary,\n t.description,\n t.status,\n t.owner_kind,\n t.owner_id,\n t.owner_slug,\n t.owner_display_name,\n t.creator_user_id,\n t.source_system,\n t.source_id,\n t.source_metadata,\n t.created_at,\n t.updated_at,\n t.completed_at,\n t.completion_approved\nFROM weave.tasks AS t\nJOIN weave.projects AS p\n ON p.id = t.project_id\nWHERE t.organization_id = $1\n AND p.slug = $2\n AND t.slug = $3";
|
|
48
|
+
export interface GetTaskBySlugArgs {
|
|
49
|
+
organizationId: string;
|
|
50
|
+
projectSlug: string;
|
|
51
|
+
taskSlug: string;
|
|
52
|
+
}
|
|
53
|
+
export interface GetTaskBySlugRow {
|
|
54
|
+
id: string;
|
|
55
|
+
organizationId: string;
|
|
56
|
+
projectId: string;
|
|
57
|
+
projectSlug: string;
|
|
58
|
+
slug: string;
|
|
59
|
+
title: string;
|
|
60
|
+
summary: string;
|
|
61
|
+
description: string;
|
|
62
|
+
status: string;
|
|
63
|
+
ownerKind: string;
|
|
64
|
+
ownerId: string | null;
|
|
65
|
+
ownerSlug: string | null;
|
|
66
|
+
ownerDisplayName: string;
|
|
67
|
+
creatorUserId: string;
|
|
68
|
+
sourceSystem: string | null;
|
|
69
|
+
sourceId: string | null;
|
|
70
|
+
sourceMetadata: any | null;
|
|
71
|
+
createdAt: Date;
|
|
72
|
+
updatedAt: Date;
|
|
73
|
+
completedAt: Date | null;
|
|
74
|
+
completionApproved: boolean;
|
|
75
|
+
}
|
|
76
|
+
export declare function getTaskBySlug(client: Client, args: GetTaskBySlugArgs): Promise<GetTaskBySlugRow | null>;
|
|
77
|
+
export declare const listProjectTasksQuery = "-- name: ListProjectTasks :many\nSELECT\n t.id,\n t.organization_id,\n t.project_id,\n p.slug AS project_slug,\n t.slug,\n t.title,\n t.summary,\n t.description,\n t.status,\n t.owner_kind,\n t.owner_id,\n t.owner_slug,\n t.owner_display_name,\n t.creator_user_id,\n t.source_system,\n t.source_id,\n t.source_metadata,\n t.created_at,\n t.updated_at,\n t.completed_at,\n t.completion_approved\nFROM weave.tasks AS t\nJOIN weave.projects AS p\n ON p.id = t.project_id\nWHERE t.organization_id = $1\n AND p.slug = $2\nORDER BY t.updated_at DESC, t.created_at DESC\nLIMIT $3";
|
|
78
|
+
export interface ListProjectTasksArgs {
|
|
79
|
+
organizationId: string;
|
|
80
|
+
projectSlug: string;
|
|
81
|
+
pageLimit: string;
|
|
82
|
+
}
|
|
83
|
+
export interface ListProjectTasksRow {
|
|
84
|
+
id: string;
|
|
85
|
+
organizationId: string;
|
|
86
|
+
projectId: string;
|
|
87
|
+
projectSlug: string;
|
|
88
|
+
slug: string;
|
|
89
|
+
title: string;
|
|
90
|
+
summary: string;
|
|
91
|
+
description: string;
|
|
92
|
+
status: string;
|
|
93
|
+
ownerKind: string;
|
|
94
|
+
ownerId: string | null;
|
|
95
|
+
ownerSlug: string | null;
|
|
96
|
+
ownerDisplayName: string;
|
|
97
|
+
creatorUserId: string;
|
|
98
|
+
sourceSystem: string | null;
|
|
99
|
+
sourceId: string | null;
|
|
100
|
+
sourceMetadata: any | null;
|
|
101
|
+
createdAt: Date;
|
|
102
|
+
updatedAt: Date;
|
|
103
|
+
completedAt: Date | null;
|
|
104
|
+
completionApproved: boolean;
|
|
105
|
+
}
|
|
106
|
+
export declare function listProjectTasks(client: Client, args: ListProjectTasksArgs): Promise<ListProjectTasksRow[]>;
|
|
107
|
+
export declare const updateTaskBySlugQuery = "-- name: UpdateTaskBySlug :one\nUPDATE weave.tasks AS t\nSET\n title = $1,\n summary = $2,\n description = $3,\n status = $4,\n owner_kind = $5,\n owner_id = $6,\n owner_slug = $7,\n owner_display_name = $8,\n source_system = $9,\n source_id = $10,\n source_metadata = $11,\n completed_at = $12,\n completion_approved = $13,\n updated_at = now()\nFROM weave.projects AS p\nWHERE p.id = t.project_id\n AND t.organization_id = $14\n AND p.slug = $15\n AND t.slug = $16\nRETURNING\n t.id,\n t.organization_id,\n t.project_id,\n t.slug,\n t.title,\n t.summary,\n t.description,\n t.status,\n t.owner_kind,\n t.owner_id,\n t.owner_slug,\n t.owner_display_name,\n t.creator_user_id,\n t.source_system,\n t.source_id,\n t.source_metadata,\n t.created_at,\n t.updated_at,\n t.completed_at,\n t.completion_approved";
|
|
108
|
+
export interface UpdateTaskBySlugArgs {
|
|
109
|
+
title: string;
|
|
110
|
+
summary: string;
|
|
111
|
+
description: string;
|
|
112
|
+
status: string;
|
|
113
|
+
ownerKind: string;
|
|
114
|
+
ownerId: string | null;
|
|
115
|
+
ownerSlug: string | null;
|
|
116
|
+
ownerDisplayName: string;
|
|
117
|
+
sourceSystem: string | null;
|
|
118
|
+
sourceId: string | null;
|
|
119
|
+
sourceMetadata: any | null;
|
|
120
|
+
completedAt: Date | null;
|
|
121
|
+
completionApproved: boolean;
|
|
122
|
+
organizationId: string;
|
|
123
|
+
projectSlug: string;
|
|
124
|
+
taskSlug: string;
|
|
125
|
+
}
|
|
126
|
+
export interface UpdateTaskBySlugRow {
|
|
127
|
+
id: string;
|
|
128
|
+
organizationId: string;
|
|
129
|
+
projectId: string;
|
|
130
|
+
slug: string;
|
|
131
|
+
title: string;
|
|
132
|
+
summary: string;
|
|
133
|
+
description: string;
|
|
134
|
+
status: string;
|
|
135
|
+
ownerKind: string;
|
|
136
|
+
ownerId: string | null;
|
|
137
|
+
ownerSlug: string | null;
|
|
138
|
+
ownerDisplayName: string;
|
|
139
|
+
creatorUserId: string;
|
|
140
|
+
sourceSystem: string | null;
|
|
141
|
+
sourceId: string | null;
|
|
142
|
+
sourceMetadata: any | null;
|
|
143
|
+
createdAt: Date;
|
|
144
|
+
updatedAt: Date;
|
|
145
|
+
completedAt: Date | null;
|
|
146
|
+
completionApproved: boolean;
|
|
147
|
+
}
|
|
148
|
+
export declare function updateTaskBySlug(client: Client, args: UpdateTaskBySlugArgs): Promise<UpdateTaskBySlugRow | null>;
|
|
149
|
+
export declare const holdInProgressTasksByProjectIDQuery = "-- name: HoldInProgressTasksByProjectID :many\nUPDATE weave.tasks\nSET\n status = 'TASK_STATUS_HOLD',\n updated_at = now()\nWHERE organization_id = $1\n AND project_id = $2\n AND status = 'TASK_STATUS_IN_PROGRESS'\nRETURNING\n id,\n organization_id,\n project_id,\n slug,\n title,\n summary,\n description,\n status,\n owner_kind,\n owner_id,\n owner_slug,\n owner_display_name,\n creator_user_id,\n source_system,\n source_id,\n source_metadata,\n created_at,\n updated_at,\n completed_at,\n completion_approved";
|
|
150
|
+
export interface HoldInProgressTasksByProjectIDArgs {
|
|
151
|
+
organizationId: string;
|
|
152
|
+
projectId: string;
|
|
153
|
+
}
|
|
154
|
+
export interface HoldInProgressTasksByProjectIDRow {
|
|
155
|
+
id: string;
|
|
156
|
+
organizationId: string;
|
|
157
|
+
projectId: string;
|
|
158
|
+
slug: string;
|
|
159
|
+
title: string;
|
|
160
|
+
summary: string;
|
|
161
|
+
description: string;
|
|
162
|
+
status: string;
|
|
163
|
+
ownerKind: string;
|
|
164
|
+
ownerId: string | null;
|
|
165
|
+
ownerSlug: string | null;
|
|
166
|
+
ownerDisplayName: string;
|
|
167
|
+
creatorUserId: string;
|
|
168
|
+
sourceSystem: string | null;
|
|
169
|
+
sourceId: string | null;
|
|
170
|
+
sourceMetadata: any | null;
|
|
171
|
+
createdAt: Date;
|
|
172
|
+
updatedAt: Date;
|
|
173
|
+
completedAt: Date | null;
|
|
174
|
+
completionApproved: boolean;
|
|
175
|
+
}
|
|
176
|
+
export declare function holdInProgressTasksByProjectID(client: Client, args: HoldInProgressTasksByProjectIDArgs): Promise<HoldInProgressTasksByProjectIDRow[]>;
|
|
177
|
+
export declare const listTaskActivityQuery = "-- name: ListTaskActivity :many\nSELECT\n id,\n project_id,\n task_id,\n event_type,\n actor_id,\n actor_slug,\n actor_label,\n description,\n metadata,\n created_at\nFROM weave.task_activity\nWHERE organization_id = $1\n AND task_id = $2\nORDER BY created_at DESC\nLIMIT $3";
|
|
178
|
+
export interface ListTaskActivityArgs {
|
|
179
|
+
organizationId: string;
|
|
180
|
+
taskId: string;
|
|
181
|
+
pageLimit: string;
|
|
182
|
+
}
|
|
183
|
+
export interface ListTaskActivityRow {
|
|
184
|
+
id: string;
|
|
185
|
+
projectId: string;
|
|
186
|
+
taskId: string;
|
|
187
|
+
eventType: string;
|
|
188
|
+
actorId: string | null;
|
|
189
|
+
actorSlug: string | null;
|
|
190
|
+
actorLabel: string;
|
|
191
|
+
description: string;
|
|
192
|
+
metadata: any | null;
|
|
193
|
+
createdAt: Date;
|
|
194
|
+
}
|
|
195
|
+
export declare function listTaskActivity(client: Client, args: ListTaskActivityArgs): Promise<ListTaskActivityRow[]>;
|
|
196
|
+
export declare const createTaskActivityQuery = "-- name: CreateTaskActivity :exec\nINSERT INTO weave.task_activity (\n id,\n organization_id,\n project_id,\n task_id,\n event_type,\n actor_id,\n actor_slug,\n actor_label,\n description,\n metadata\n) VALUES (\n $1,\n $2,\n $3,\n $4,\n $5,\n $6,\n $7,\n $8,\n $9,\n $10\n)";
|
|
197
|
+
export interface CreateTaskActivityArgs {
|
|
198
|
+
id: string;
|
|
199
|
+
organizationId: string;
|
|
200
|
+
projectId: string;
|
|
201
|
+
taskId: string;
|
|
202
|
+
eventType: string;
|
|
203
|
+
actorId: string | null;
|
|
204
|
+
actorSlug: string | null;
|
|
205
|
+
actorLabel: string;
|
|
206
|
+
description: string;
|
|
207
|
+
metadata: any | null;
|
|
208
|
+
}
|
|
209
|
+
export declare function createTaskActivity(client: Client, args: CreateTaskActivityArgs): Promise<void>;
|
|
210
|
+
export {};
|
|
@@ -0,0 +1,430 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createTaskActivityQuery = exports.listTaskActivityQuery = exports.holdInProgressTasksByProjectIDQuery = exports.updateTaskBySlugQuery = exports.listProjectTasksQuery = exports.getTaskBySlugQuery = exports.createTaskQuery = void 0;
|
|
4
|
+
exports.createTask = createTask;
|
|
5
|
+
exports.getTaskBySlug = getTaskBySlug;
|
|
6
|
+
exports.listProjectTasks = listProjectTasks;
|
|
7
|
+
exports.updateTaskBySlug = updateTaskBySlug;
|
|
8
|
+
exports.holdInProgressTasksByProjectID = holdInProgressTasksByProjectID;
|
|
9
|
+
exports.listTaskActivity = listTaskActivity;
|
|
10
|
+
exports.createTaskActivity = createTaskActivity;
|
|
11
|
+
exports.createTaskQuery = `-- name: CreateTask :one
|
|
12
|
+
INSERT INTO weave.tasks (
|
|
13
|
+
id,
|
|
14
|
+
organization_id,
|
|
15
|
+
project_id,
|
|
16
|
+
slug,
|
|
17
|
+
title,
|
|
18
|
+
summary,
|
|
19
|
+
description,
|
|
20
|
+
status,
|
|
21
|
+
owner_kind,
|
|
22
|
+
owner_id,
|
|
23
|
+
owner_slug,
|
|
24
|
+
owner_display_name,
|
|
25
|
+
creator_user_id,
|
|
26
|
+
source_system,
|
|
27
|
+
source_id,
|
|
28
|
+
source_metadata
|
|
29
|
+
) VALUES (
|
|
30
|
+
$1,
|
|
31
|
+
$2,
|
|
32
|
+
$3,
|
|
33
|
+
$4,
|
|
34
|
+
$5,
|
|
35
|
+
$6,
|
|
36
|
+
$7,
|
|
37
|
+
$8,
|
|
38
|
+
$9,
|
|
39
|
+
$10,
|
|
40
|
+
$11,
|
|
41
|
+
$12,
|
|
42
|
+
$13,
|
|
43
|
+
$14,
|
|
44
|
+
$15,
|
|
45
|
+
$16
|
|
46
|
+
)
|
|
47
|
+
RETURNING
|
|
48
|
+
id,
|
|
49
|
+
organization_id,
|
|
50
|
+
project_id,
|
|
51
|
+
slug,
|
|
52
|
+
title,
|
|
53
|
+
summary,
|
|
54
|
+
description,
|
|
55
|
+
status,
|
|
56
|
+
owner_kind,
|
|
57
|
+
owner_id,
|
|
58
|
+
owner_slug,
|
|
59
|
+
owner_display_name,
|
|
60
|
+
creator_user_id,
|
|
61
|
+
source_system,
|
|
62
|
+
source_id,
|
|
63
|
+
source_metadata,
|
|
64
|
+
created_at,
|
|
65
|
+
updated_at,
|
|
66
|
+
completed_at,
|
|
67
|
+
completion_approved`;
|
|
68
|
+
async function createTask(client, args) {
|
|
69
|
+
const result = await client.query({
|
|
70
|
+
text: exports.createTaskQuery,
|
|
71
|
+
values: [args.id, args.organizationId, args.projectId, args.slug, args.title, args.summary, args.description, args.status, args.ownerKind, args.ownerId, args.ownerSlug, args.ownerDisplayName, args.creatorUserId, args.sourceSystem, args.sourceId, args.sourceMetadata],
|
|
72
|
+
rowMode: "array"
|
|
73
|
+
});
|
|
74
|
+
if (result.rows.length !== 1) {
|
|
75
|
+
return null;
|
|
76
|
+
}
|
|
77
|
+
const row = result.rows[0];
|
|
78
|
+
return {
|
|
79
|
+
id: row[0],
|
|
80
|
+
organizationId: row[1],
|
|
81
|
+
projectId: row[2],
|
|
82
|
+
slug: row[3],
|
|
83
|
+
title: row[4],
|
|
84
|
+
summary: row[5],
|
|
85
|
+
description: row[6],
|
|
86
|
+
status: row[7],
|
|
87
|
+
ownerKind: row[8],
|
|
88
|
+
ownerId: row[9],
|
|
89
|
+
ownerSlug: row[10],
|
|
90
|
+
ownerDisplayName: row[11],
|
|
91
|
+
creatorUserId: row[12],
|
|
92
|
+
sourceSystem: row[13],
|
|
93
|
+
sourceId: row[14],
|
|
94
|
+
sourceMetadata: row[15],
|
|
95
|
+
createdAt: row[16],
|
|
96
|
+
updatedAt: row[17],
|
|
97
|
+
completedAt: row[18],
|
|
98
|
+
completionApproved: row[19]
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
exports.getTaskBySlugQuery = `-- name: GetTaskBySlug :one
|
|
102
|
+
SELECT
|
|
103
|
+
t.id,
|
|
104
|
+
t.organization_id,
|
|
105
|
+
t.project_id,
|
|
106
|
+
p.slug AS project_slug,
|
|
107
|
+
t.slug,
|
|
108
|
+
t.title,
|
|
109
|
+
t.summary,
|
|
110
|
+
t.description,
|
|
111
|
+
t.status,
|
|
112
|
+
t.owner_kind,
|
|
113
|
+
t.owner_id,
|
|
114
|
+
t.owner_slug,
|
|
115
|
+
t.owner_display_name,
|
|
116
|
+
t.creator_user_id,
|
|
117
|
+
t.source_system,
|
|
118
|
+
t.source_id,
|
|
119
|
+
t.source_metadata,
|
|
120
|
+
t.created_at,
|
|
121
|
+
t.updated_at,
|
|
122
|
+
t.completed_at,
|
|
123
|
+
t.completion_approved
|
|
124
|
+
FROM weave.tasks AS t
|
|
125
|
+
JOIN weave.projects AS p
|
|
126
|
+
ON p.id = t.project_id
|
|
127
|
+
WHERE t.organization_id = $1
|
|
128
|
+
AND p.slug = $2
|
|
129
|
+
AND t.slug = $3`;
|
|
130
|
+
async function getTaskBySlug(client, args) {
|
|
131
|
+
const result = await client.query({
|
|
132
|
+
text: exports.getTaskBySlugQuery,
|
|
133
|
+
values: [args.organizationId, args.projectSlug, args.taskSlug],
|
|
134
|
+
rowMode: "array"
|
|
135
|
+
});
|
|
136
|
+
if (result.rows.length !== 1) {
|
|
137
|
+
return null;
|
|
138
|
+
}
|
|
139
|
+
const row = result.rows[0];
|
|
140
|
+
return {
|
|
141
|
+
id: row[0],
|
|
142
|
+
organizationId: row[1],
|
|
143
|
+
projectId: row[2],
|
|
144
|
+
projectSlug: row[3],
|
|
145
|
+
slug: row[4],
|
|
146
|
+
title: row[5],
|
|
147
|
+
summary: row[6],
|
|
148
|
+
description: row[7],
|
|
149
|
+
status: row[8],
|
|
150
|
+
ownerKind: row[9],
|
|
151
|
+
ownerId: row[10],
|
|
152
|
+
ownerSlug: row[11],
|
|
153
|
+
ownerDisplayName: row[12],
|
|
154
|
+
creatorUserId: row[13],
|
|
155
|
+
sourceSystem: row[14],
|
|
156
|
+
sourceId: row[15],
|
|
157
|
+
sourceMetadata: row[16],
|
|
158
|
+
createdAt: row[17],
|
|
159
|
+
updatedAt: row[18],
|
|
160
|
+
completedAt: row[19],
|
|
161
|
+
completionApproved: row[20]
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
exports.listProjectTasksQuery = `-- name: ListProjectTasks :many
|
|
165
|
+
SELECT
|
|
166
|
+
t.id,
|
|
167
|
+
t.organization_id,
|
|
168
|
+
t.project_id,
|
|
169
|
+
p.slug AS project_slug,
|
|
170
|
+
t.slug,
|
|
171
|
+
t.title,
|
|
172
|
+
t.summary,
|
|
173
|
+
t.description,
|
|
174
|
+
t.status,
|
|
175
|
+
t.owner_kind,
|
|
176
|
+
t.owner_id,
|
|
177
|
+
t.owner_slug,
|
|
178
|
+
t.owner_display_name,
|
|
179
|
+
t.creator_user_id,
|
|
180
|
+
t.source_system,
|
|
181
|
+
t.source_id,
|
|
182
|
+
t.source_metadata,
|
|
183
|
+
t.created_at,
|
|
184
|
+
t.updated_at,
|
|
185
|
+
t.completed_at,
|
|
186
|
+
t.completion_approved
|
|
187
|
+
FROM weave.tasks AS t
|
|
188
|
+
JOIN weave.projects AS p
|
|
189
|
+
ON p.id = t.project_id
|
|
190
|
+
WHERE t.organization_id = $1
|
|
191
|
+
AND p.slug = $2
|
|
192
|
+
ORDER BY t.updated_at DESC, t.created_at DESC
|
|
193
|
+
LIMIT $3`;
|
|
194
|
+
async function listProjectTasks(client, args) {
|
|
195
|
+
const result = await client.query({
|
|
196
|
+
text: exports.listProjectTasksQuery,
|
|
197
|
+
values: [args.organizationId, args.projectSlug, args.pageLimit],
|
|
198
|
+
rowMode: "array"
|
|
199
|
+
});
|
|
200
|
+
return result.rows.map(row => {
|
|
201
|
+
return {
|
|
202
|
+
id: row[0],
|
|
203
|
+
organizationId: row[1],
|
|
204
|
+
projectId: row[2],
|
|
205
|
+
projectSlug: row[3],
|
|
206
|
+
slug: row[4],
|
|
207
|
+
title: row[5],
|
|
208
|
+
summary: row[6],
|
|
209
|
+
description: row[7],
|
|
210
|
+
status: row[8],
|
|
211
|
+
ownerKind: row[9],
|
|
212
|
+
ownerId: row[10],
|
|
213
|
+
ownerSlug: row[11],
|
|
214
|
+
ownerDisplayName: row[12],
|
|
215
|
+
creatorUserId: row[13],
|
|
216
|
+
sourceSystem: row[14],
|
|
217
|
+
sourceId: row[15],
|
|
218
|
+
sourceMetadata: row[16],
|
|
219
|
+
createdAt: row[17],
|
|
220
|
+
updatedAt: row[18],
|
|
221
|
+
completedAt: row[19],
|
|
222
|
+
completionApproved: row[20]
|
|
223
|
+
};
|
|
224
|
+
});
|
|
225
|
+
}
|
|
226
|
+
exports.updateTaskBySlugQuery = `-- name: UpdateTaskBySlug :one
|
|
227
|
+
UPDATE weave.tasks AS t
|
|
228
|
+
SET
|
|
229
|
+
title = $1,
|
|
230
|
+
summary = $2,
|
|
231
|
+
description = $3,
|
|
232
|
+
status = $4,
|
|
233
|
+
owner_kind = $5,
|
|
234
|
+
owner_id = $6,
|
|
235
|
+
owner_slug = $7,
|
|
236
|
+
owner_display_name = $8,
|
|
237
|
+
source_system = $9,
|
|
238
|
+
source_id = $10,
|
|
239
|
+
source_metadata = $11,
|
|
240
|
+
completed_at = $12,
|
|
241
|
+
completion_approved = $13,
|
|
242
|
+
updated_at = now()
|
|
243
|
+
FROM weave.projects AS p
|
|
244
|
+
WHERE p.id = t.project_id
|
|
245
|
+
AND t.organization_id = $14
|
|
246
|
+
AND p.slug = $15
|
|
247
|
+
AND t.slug = $16
|
|
248
|
+
RETURNING
|
|
249
|
+
t.id,
|
|
250
|
+
t.organization_id,
|
|
251
|
+
t.project_id,
|
|
252
|
+
t.slug,
|
|
253
|
+
t.title,
|
|
254
|
+
t.summary,
|
|
255
|
+
t.description,
|
|
256
|
+
t.status,
|
|
257
|
+
t.owner_kind,
|
|
258
|
+
t.owner_id,
|
|
259
|
+
t.owner_slug,
|
|
260
|
+
t.owner_display_name,
|
|
261
|
+
t.creator_user_id,
|
|
262
|
+
t.source_system,
|
|
263
|
+
t.source_id,
|
|
264
|
+
t.source_metadata,
|
|
265
|
+
t.created_at,
|
|
266
|
+
t.updated_at,
|
|
267
|
+
t.completed_at,
|
|
268
|
+
t.completion_approved`;
|
|
269
|
+
async function updateTaskBySlug(client, args) {
|
|
270
|
+
const result = await client.query({
|
|
271
|
+
text: exports.updateTaskBySlugQuery,
|
|
272
|
+
values: [args.title, args.summary, args.description, args.status, args.ownerKind, args.ownerId, args.ownerSlug, args.ownerDisplayName, args.sourceSystem, args.sourceId, args.sourceMetadata, args.completedAt, args.completionApproved, args.organizationId, args.projectSlug, args.taskSlug],
|
|
273
|
+
rowMode: "array"
|
|
274
|
+
});
|
|
275
|
+
if (result.rows.length !== 1) {
|
|
276
|
+
return null;
|
|
277
|
+
}
|
|
278
|
+
const row = result.rows[0];
|
|
279
|
+
return {
|
|
280
|
+
id: row[0],
|
|
281
|
+
organizationId: row[1],
|
|
282
|
+
projectId: row[2],
|
|
283
|
+
slug: row[3],
|
|
284
|
+
title: row[4],
|
|
285
|
+
summary: row[5],
|
|
286
|
+
description: row[6],
|
|
287
|
+
status: row[7],
|
|
288
|
+
ownerKind: row[8],
|
|
289
|
+
ownerId: row[9],
|
|
290
|
+
ownerSlug: row[10],
|
|
291
|
+
ownerDisplayName: row[11],
|
|
292
|
+
creatorUserId: row[12],
|
|
293
|
+
sourceSystem: row[13],
|
|
294
|
+
sourceId: row[14],
|
|
295
|
+
sourceMetadata: row[15],
|
|
296
|
+
createdAt: row[16],
|
|
297
|
+
updatedAt: row[17],
|
|
298
|
+
completedAt: row[18],
|
|
299
|
+
completionApproved: row[19]
|
|
300
|
+
};
|
|
301
|
+
}
|
|
302
|
+
exports.holdInProgressTasksByProjectIDQuery = `-- name: HoldInProgressTasksByProjectID :many
|
|
303
|
+
UPDATE weave.tasks
|
|
304
|
+
SET
|
|
305
|
+
status = 'TASK_STATUS_HOLD',
|
|
306
|
+
updated_at = now()
|
|
307
|
+
WHERE organization_id = $1
|
|
308
|
+
AND project_id = $2
|
|
309
|
+
AND status = 'TASK_STATUS_IN_PROGRESS'
|
|
310
|
+
RETURNING
|
|
311
|
+
id,
|
|
312
|
+
organization_id,
|
|
313
|
+
project_id,
|
|
314
|
+
slug,
|
|
315
|
+
title,
|
|
316
|
+
summary,
|
|
317
|
+
description,
|
|
318
|
+
status,
|
|
319
|
+
owner_kind,
|
|
320
|
+
owner_id,
|
|
321
|
+
owner_slug,
|
|
322
|
+
owner_display_name,
|
|
323
|
+
creator_user_id,
|
|
324
|
+
source_system,
|
|
325
|
+
source_id,
|
|
326
|
+
source_metadata,
|
|
327
|
+
created_at,
|
|
328
|
+
updated_at,
|
|
329
|
+
completed_at,
|
|
330
|
+
completion_approved`;
|
|
331
|
+
async function holdInProgressTasksByProjectID(client, args) {
|
|
332
|
+
const result = await client.query({
|
|
333
|
+
text: exports.holdInProgressTasksByProjectIDQuery,
|
|
334
|
+
values: [args.organizationId, args.projectId],
|
|
335
|
+
rowMode: "array"
|
|
336
|
+
});
|
|
337
|
+
return result.rows.map(row => {
|
|
338
|
+
return {
|
|
339
|
+
id: row[0],
|
|
340
|
+
organizationId: row[1],
|
|
341
|
+
projectId: row[2],
|
|
342
|
+
slug: row[3],
|
|
343
|
+
title: row[4],
|
|
344
|
+
summary: row[5],
|
|
345
|
+
description: row[6],
|
|
346
|
+
status: row[7],
|
|
347
|
+
ownerKind: row[8],
|
|
348
|
+
ownerId: row[9],
|
|
349
|
+
ownerSlug: row[10],
|
|
350
|
+
ownerDisplayName: row[11],
|
|
351
|
+
creatorUserId: row[12],
|
|
352
|
+
sourceSystem: row[13],
|
|
353
|
+
sourceId: row[14],
|
|
354
|
+
sourceMetadata: row[15],
|
|
355
|
+
createdAt: row[16],
|
|
356
|
+
updatedAt: row[17],
|
|
357
|
+
completedAt: row[18],
|
|
358
|
+
completionApproved: row[19]
|
|
359
|
+
};
|
|
360
|
+
});
|
|
361
|
+
}
|
|
362
|
+
exports.listTaskActivityQuery = `-- name: ListTaskActivity :many
|
|
363
|
+
SELECT
|
|
364
|
+
id,
|
|
365
|
+
project_id,
|
|
366
|
+
task_id,
|
|
367
|
+
event_type,
|
|
368
|
+
actor_id,
|
|
369
|
+
actor_slug,
|
|
370
|
+
actor_label,
|
|
371
|
+
description,
|
|
372
|
+
metadata,
|
|
373
|
+
created_at
|
|
374
|
+
FROM weave.task_activity
|
|
375
|
+
WHERE organization_id = $1
|
|
376
|
+
AND task_id = $2
|
|
377
|
+
ORDER BY created_at DESC
|
|
378
|
+
LIMIT $3`;
|
|
379
|
+
async function listTaskActivity(client, args) {
|
|
380
|
+
const result = await client.query({
|
|
381
|
+
text: exports.listTaskActivityQuery,
|
|
382
|
+
values: [args.organizationId, args.taskId, args.pageLimit],
|
|
383
|
+
rowMode: "array"
|
|
384
|
+
});
|
|
385
|
+
return result.rows.map(row => {
|
|
386
|
+
return {
|
|
387
|
+
id: row[0],
|
|
388
|
+
projectId: row[1],
|
|
389
|
+
taskId: row[2],
|
|
390
|
+
eventType: row[3],
|
|
391
|
+
actorId: row[4],
|
|
392
|
+
actorSlug: row[5],
|
|
393
|
+
actorLabel: row[6],
|
|
394
|
+
description: row[7],
|
|
395
|
+
metadata: row[8],
|
|
396
|
+
createdAt: row[9]
|
|
397
|
+
};
|
|
398
|
+
});
|
|
399
|
+
}
|
|
400
|
+
exports.createTaskActivityQuery = `-- name: CreateTaskActivity :exec
|
|
401
|
+
INSERT INTO weave.task_activity (
|
|
402
|
+
id,
|
|
403
|
+
organization_id,
|
|
404
|
+
project_id,
|
|
405
|
+
task_id,
|
|
406
|
+
event_type,
|
|
407
|
+
actor_id,
|
|
408
|
+
actor_slug,
|
|
409
|
+
actor_label,
|
|
410
|
+
description,
|
|
411
|
+
metadata
|
|
412
|
+
) VALUES (
|
|
413
|
+
$1,
|
|
414
|
+
$2,
|
|
415
|
+
$3,
|
|
416
|
+
$4,
|
|
417
|
+
$5,
|
|
418
|
+
$6,
|
|
419
|
+
$7,
|
|
420
|
+
$8,
|
|
421
|
+
$9,
|
|
422
|
+
$10
|
|
423
|
+
)`;
|
|
424
|
+
async function createTaskActivity(client, args) {
|
|
425
|
+
await client.query({
|
|
426
|
+
text: exports.createTaskActivityQuery,
|
|
427
|
+
values: [args.id, args.organizationId, args.projectId, args.taskId, args.eventType, args.actorId, args.actorSlug, args.actorLabel, args.description, args.metadata],
|
|
428
|
+
rowMode: "array"
|
|
429
|
+
});
|
|
430
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "weave-typescript",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.0",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@types/node": "^25.2.0",
|
|
33
33
|
"@types/pg": "^8.15.5",
|
|
34
|
-
"@typescript/native-preview": "7.0.0-dev.
|
|
34
|
+
"@typescript/native-preview": "7.0.0-dev.20260411.1"
|
|
35
35
|
},
|
|
36
36
|
"scripts": {
|
|
37
37
|
"test": "node tools/sqlcgen.test.js",
|