weave-typescript 0.12.0 → 0.14.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/google/api/annotations.pb.js +1 -1
- package/dist/google/api/http.pb.js +1 -1
- package/dist/google/protobuf/descriptor.pb.d.ts +8 -1
- package/dist/google/protobuf/descriptor.pb.js +8 -1
- package/dist/google/protobuf/struct.pb.js +1 -1
- package/dist/google/protobuf/timestamp.pb.d.ts +7 -6
- package/dist/google/protobuf/timestamp.pb.js +1 -1
- package/dist/index.d.ts +9 -16
- package/dist/index.js +13 -21
- package/dist/weaveapi/{storage/v1/auth.pb.d.ts → atc/v1/event.pb.d.ts} +12 -6
- package/dist/weaveapi/atc/v1/event.pb.js +263 -0
- package/dist/weaveapi/{auth/v1/session.pb.d.ts → atc/v1/message.pb.d.ts} +22 -21
- package/dist/weaveapi/atc/v1/message.pb.js +287 -0
- package/dist/weaveapi/atc/v1/process.pb.d.ts +91 -0
- package/dist/weaveapi/atc/v1/process.pb.js +658 -0
- package/dist/weaveapi/atc/v1/run.pb.d.ts +71 -0
- package/dist/weaveapi/atc/v1/run.pb.js +525 -0
- package/dist/weaveapi/atc/v1/service.pb.d.ts +339 -0
- package/dist/weaveapi/atc/v1/service.pb.js +1922 -0
- package/dist/weaveapi/project/v1/project.pb.d.ts +67 -5
- package/dist/weaveapi/project/v1/project.pb.js +765 -66
- package/dist/weaveapi/project/v1/service.pb.d.ts +117 -76
- package/dist/weaveapi/project/v1/service.pb.js +1088 -401
- package/dist/weaveapi/task/v1/service.pb.d.ts +171 -0
- package/dist/weaveapi/task/v1/service.pb.js +1416 -0
- package/dist/weaveapi/task/v1/task.pb.d.ts +84 -0
- package/dist/weaveapi/task/v1/task.pb.js +782 -0
- package/dist/weavesql/atcdb/event_sql.d.ts +101 -0
- package/dist/weavesql/atcdb/event_sql.js +191 -0
- package/dist/weavesql/atcdb/mailbox_sql.d.ts +43 -0
- package/dist/weavesql/atcdb/mailbox_sql.js +85 -0
- package/dist/weavesql/weavedb/project_sql.d.ts +121 -46
- package/dist/weavesql/weavedb/project_sql.js +304 -112
- package/dist/weavesql/weavedb/task_sql.d.ts +163 -0
- package/dist/weavesql/weavedb/task_sql.js +328 -0
- package/package.json +1 -1
- package/dist/weaveapi/auth/v1/service.pb.d.ts +0 -709
- package/dist/weaveapi/auth/v1/service.pb.js +0 -4977
- 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 -5266
- 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.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 -917
- 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,101 @@
|
|
|
1
|
+
import { QueryArrayConfig, QueryArrayResult } from "pg";
|
|
2
|
+
interface Client {
|
|
3
|
+
query: (config: QueryArrayConfig) => Promise<QueryArrayResult>;
|
|
4
|
+
}
|
|
5
|
+
export declare const insertEventQuery = "-- name: InsertEvent :one\nINSERT INTO atc.events (\n id,\n tenant_id,\n run_id,\n sequence,\n type,\n data,\n causation_id,\n correlation_id\n) VALUES (\n $1,\n $2,\n $3,\n $4,\n $5,\n $6,\n $7,\n $8\n)\nRETURNING id, tenant_id, run_id, sequence, type, data, causation_id, correlation_id, occurred_at, transaction_id";
|
|
6
|
+
export interface InsertEventArgs {
|
|
7
|
+
id: string;
|
|
8
|
+
tenantId: string;
|
|
9
|
+
runId: string;
|
|
10
|
+
sequence: string;
|
|
11
|
+
type: string;
|
|
12
|
+
data: any | null;
|
|
13
|
+
causationId: string | null;
|
|
14
|
+
correlationId: string | null;
|
|
15
|
+
}
|
|
16
|
+
export interface InsertEventRow {
|
|
17
|
+
id: string;
|
|
18
|
+
tenantId: string;
|
|
19
|
+
runId: string;
|
|
20
|
+
sequence: string;
|
|
21
|
+
type: string;
|
|
22
|
+
data: any | null;
|
|
23
|
+
causationId: string | null;
|
|
24
|
+
correlationId: string | null;
|
|
25
|
+
occurredAt: Date;
|
|
26
|
+
transactionId: string;
|
|
27
|
+
}
|
|
28
|
+
export declare function insertEvent(client: Client, args: InsertEventArgs): Promise<InsertEventRow | null>;
|
|
29
|
+
export declare const getCurrentVersionQuery = "-- name: GetCurrentVersion :one\nSELECT COALESCE(MAX(sequence), 0)::BIGINT AS version\nFROM atc.events\nWHERE tenant_id = $1\n AND run_id = $2";
|
|
30
|
+
export interface GetCurrentVersionArgs {
|
|
31
|
+
tenantId: string;
|
|
32
|
+
runId: string;
|
|
33
|
+
}
|
|
34
|
+
export interface GetCurrentVersionRow {
|
|
35
|
+
version: string;
|
|
36
|
+
}
|
|
37
|
+
export declare function getCurrentVersion(client: Client, args: GetCurrentVersionArgs): Promise<GetCurrentVersionRow | null>;
|
|
38
|
+
export declare const loadEventsQuery = "-- name: LoadEvents :many\nSELECT\n id,\n tenant_id,\n run_id,\n sequence,\n type,\n data,\n causation_id,\n correlation_id,\n occurred_at\nFROM atc.events\nWHERE tenant_id = $1\n AND run_id = $2\n AND sequence > $3\n AND transaction_id < pg_snapshot_xmin(pg_current_snapshot())\nORDER BY sequence ASC";
|
|
39
|
+
export interface LoadEventsArgs {
|
|
40
|
+
tenantId: string;
|
|
41
|
+
runId: string;
|
|
42
|
+
afterSequence: string;
|
|
43
|
+
}
|
|
44
|
+
export interface LoadEventsRow {
|
|
45
|
+
id: string;
|
|
46
|
+
tenantId: string;
|
|
47
|
+
runId: string;
|
|
48
|
+
sequence: string;
|
|
49
|
+
type: string;
|
|
50
|
+
data: any | null;
|
|
51
|
+
causationId: string | null;
|
|
52
|
+
correlationId: string | null;
|
|
53
|
+
occurredAt: Date;
|
|
54
|
+
}
|
|
55
|
+
export declare function loadEvents(client: Client, args: LoadEventsArgs): Promise<LoadEventsRow[]>;
|
|
56
|
+
export declare const loadAllEventsQuery = "-- name: LoadAllEvents :many\nSELECT\n id,\n tenant_id,\n run_id,\n sequence,\n type,\n data,\n causation_id,\n correlation_id,\n occurred_at\nFROM atc.events\nWHERE tenant_id = $1\n AND run_id = $2\n AND transaction_id < pg_snapshot_xmin(pg_current_snapshot())\nORDER BY sequence ASC";
|
|
57
|
+
export interface LoadAllEventsArgs {
|
|
58
|
+
tenantId: string;
|
|
59
|
+
runId: string;
|
|
60
|
+
}
|
|
61
|
+
export interface LoadAllEventsRow {
|
|
62
|
+
id: string;
|
|
63
|
+
tenantId: string;
|
|
64
|
+
runId: string;
|
|
65
|
+
sequence: string;
|
|
66
|
+
type: string;
|
|
67
|
+
data: any | null;
|
|
68
|
+
causationId: string | null;
|
|
69
|
+
correlationId: string | null;
|
|
70
|
+
occurredAt: Date;
|
|
71
|
+
}
|
|
72
|
+
export declare function loadAllEvents(client: Client, args: LoadAllEventsArgs): Promise<LoadAllEventsRow[]>;
|
|
73
|
+
export declare const listEventsByTypeQuery = "-- name: ListEventsByType :many\nSELECT\n id,\n tenant_id,\n run_id,\n sequence,\n type,\n data,\n causation_id,\n correlation_id,\n occurred_at\nFROM atc.events\nWHERE tenant_id = $1\n AND run_id = $2\n AND type = $3\n AND transaction_id < pg_snapshot_xmin(pg_current_snapshot())\nORDER BY sequence ASC";
|
|
74
|
+
export interface ListEventsByTypeArgs {
|
|
75
|
+
tenantId: string;
|
|
76
|
+
runId: string;
|
|
77
|
+
eventType: string;
|
|
78
|
+
}
|
|
79
|
+
export interface ListEventsByTypeRow {
|
|
80
|
+
id: string;
|
|
81
|
+
tenantId: string;
|
|
82
|
+
runId: string;
|
|
83
|
+
sequence: string;
|
|
84
|
+
type: string;
|
|
85
|
+
data: any | null;
|
|
86
|
+
causationId: string | null;
|
|
87
|
+
correlationId: string | null;
|
|
88
|
+
occurredAt: Date;
|
|
89
|
+
}
|
|
90
|
+
export declare function listEventsByType(client: Client, args: ListEventsByTypeArgs): Promise<ListEventsByTypeRow[]>;
|
|
91
|
+
export declare const lockRunQuery = "-- name: LockRun :exec\nSELECT pg_advisory_xact_lock($1::int, hashtext($2::text || ':' || $3::text))";
|
|
92
|
+
export interface LockRunArgs {
|
|
93
|
+
lockNamespace: number;
|
|
94
|
+
tenantId: string;
|
|
95
|
+
runId: string;
|
|
96
|
+
}
|
|
97
|
+
export interface LockRunRow {
|
|
98
|
+
pgAdvisoryXactLock: string;
|
|
99
|
+
}
|
|
100
|
+
export declare function lockRun(client: Client, args: LockRunArgs): Promise<void>;
|
|
101
|
+
export {};
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.lockRunQuery = exports.listEventsByTypeQuery = exports.loadAllEventsQuery = exports.loadEventsQuery = exports.getCurrentVersionQuery = exports.insertEventQuery = void 0;
|
|
4
|
+
exports.insertEvent = insertEvent;
|
|
5
|
+
exports.getCurrentVersion = getCurrentVersion;
|
|
6
|
+
exports.loadEvents = loadEvents;
|
|
7
|
+
exports.loadAllEvents = loadAllEvents;
|
|
8
|
+
exports.listEventsByType = listEventsByType;
|
|
9
|
+
exports.lockRun = lockRun;
|
|
10
|
+
exports.insertEventQuery = `-- name: InsertEvent :one
|
|
11
|
+
INSERT INTO atc.events (
|
|
12
|
+
id,
|
|
13
|
+
tenant_id,
|
|
14
|
+
run_id,
|
|
15
|
+
sequence,
|
|
16
|
+
type,
|
|
17
|
+
data,
|
|
18
|
+
causation_id,
|
|
19
|
+
correlation_id
|
|
20
|
+
) VALUES (
|
|
21
|
+
$1,
|
|
22
|
+
$2,
|
|
23
|
+
$3,
|
|
24
|
+
$4,
|
|
25
|
+
$5,
|
|
26
|
+
$6,
|
|
27
|
+
$7,
|
|
28
|
+
$8
|
|
29
|
+
)
|
|
30
|
+
RETURNING id, tenant_id, run_id, sequence, type, data, causation_id, correlation_id, occurred_at, transaction_id`;
|
|
31
|
+
async function insertEvent(client, args) {
|
|
32
|
+
const result = await client.query({
|
|
33
|
+
text: exports.insertEventQuery,
|
|
34
|
+
values: [args.id, args.tenantId, args.runId, args.sequence, args.type, args.data, args.causationId, args.correlationId],
|
|
35
|
+
rowMode: "array"
|
|
36
|
+
});
|
|
37
|
+
if (result.rows.length !== 1) {
|
|
38
|
+
return null;
|
|
39
|
+
}
|
|
40
|
+
const row = result.rows[0];
|
|
41
|
+
return {
|
|
42
|
+
id: row[0],
|
|
43
|
+
tenantId: row[1],
|
|
44
|
+
runId: row[2],
|
|
45
|
+
sequence: row[3],
|
|
46
|
+
type: row[4],
|
|
47
|
+
data: row[5],
|
|
48
|
+
causationId: row[6],
|
|
49
|
+
correlationId: row[7],
|
|
50
|
+
occurredAt: row[8],
|
|
51
|
+
transactionId: row[9]
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
exports.getCurrentVersionQuery = `-- name: GetCurrentVersion :one
|
|
55
|
+
SELECT COALESCE(MAX(sequence), 0)::BIGINT AS version
|
|
56
|
+
FROM atc.events
|
|
57
|
+
WHERE tenant_id = $1
|
|
58
|
+
AND run_id = $2`;
|
|
59
|
+
async function getCurrentVersion(client, args) {
|
|
60
|
+
const result = await client.query({
|
|
61
|
+
text: exports.getCurrentVersionQuery,
|
|
62
|
+
values: [args.tenantId, args.runId],
|
|
63
|
+
rowMode: "array"
|
|
64
|
+
});
|
|
65
|
+
if (result.rows.length !== 1) {
|
|
66
|
+
return null;
|
|
67
|
+
}
|
|
68
|
+
const row = result.rows[0];
|
|
69
|
+
return {
|
|
70
|
+
version: row[0]
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
exports.loadEventsQuery = `-- name: LoadEvents :many
|
|
74
|
+
SELECT
|
|
75
|
+
id,
|
|
76
|
+
tenant_id,
|
|
77
|
+
run_id,
|
|
78
|
+
sequence,
|
|
79
|
+
type,
|
|
80
|
+
data,
|
|
81
|
+
causation_id,
|
|
82
|
+
correlation_id,
|
|
83
|
+
occurred_at
|
|
84
|
+
FROM atc.events
|
|
85
|
+
WHERE tenant_id = $1
|
|
86
|
+
AND run_id = $2
|
|
87
|
+
AND sequence > $3
|
|
88
|
+
AND transaction_id < pg_snapshot_xmin(pg_current_snapshot())
|
|
89
|
+
ORDER BY sequence ASC`;
|
|
90
|
+
async function loadEvents(client, args) {
|
|
91
|
+
const result = await client.query({
|
|
92
|
+
text: exports.loadEventsQuery,
|
|
93
|
+
values: [args.tenantId, args.runId, args.afterSequence],
|
|
94
|
+
rowMode: "array"
|
|
95
|
+
});
|
|
96
|
+
return result.rows.map(row => {
|
|
97
|
+
return {
|
|
98
|
+
id: row[0],
|
|
99
|
+
tenantId: row[1],
|
|
100
|
+
runId: row[2],
|
|
101
|
+
sequence: row[3],
|
|
102
|
+
type: row[4],
|
|
103
|
+
data: row[5],
|
|
104
|
+
causationId: row[6],
|
|
105
|
+
correlationId: row[7],
|
|
106
|
+
occurredAt: row[8]
|
|
107
|
+
};
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
exports.loadAllEventsQuery = `-- name: LoadAllEvents :many
|
|
111
|
+
SELECT
|
|
112
|
+
id,
|
|
113
|
+
tenant_id,
|
|
114
|
+
run_id,
|
|
115
|
+
sequence,
|
|
116
|
+
type,
|
|
117
|
+
data,
|
|
118
|
+
causation_id,
|
|
119
|
+
correlation_id,
|
|
120
|
+
occurred_at
|
|
121
|
+
FROM atc.events
|
|
122
|
+
WHERE tenant_id = $1
|
|
123
|
+
AND run_id = $2
|
|
124
|
+
AND transaction_id < pg_snapshot_xmin(pg_current_snapshot())
|
|
125
|
+
ORDER BY sequence ASC`;
|
|
126
|
+
async function loadAllEvents(client, args) {
|
|
127
|
+
const result = await client.query({
|
|
128
|
+
text: exports.loadAllEventsQuery,
|
|
129
|
+
values: [args.tenantId, args.runId],
|
|
130
|
+
rowMode: "array"
|
|
131
|
+
});
|
|
132
|
+
return result.rows.map(row => {
|
|
133
|
+
return {
|
|
134
|
+
id: row[0],
|
|
135
|
+
tenantId: row[1],
|
|
136
|
+
runId: row[2],
|
|
137
|
+
sequence: row[3],
|
|
138
|
+
type: row[4],
|
|
139
|
+
data: row[5],
|
|
140
|
+
causationId: row[6],
|
|
141
|
+
correlationId: row[7],
|
|
142
|
+
occurredAt: row[8]
|
|
143
|
+
};
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
exports.listEventsByTypeQuery = `-- name: ListEventsByType :many
|
|
147
|
+
SELECT
|
|
148
|
+
id,
|
|
149
|
+
tenant_id,
|
|
150
|
+
run_id,
|
|
151
|
+
sequence,
|
|
152
|
+
type,
|
|
153
|
+
data,
|
|
154
|
+
causation_id,
|
|
155
|
+
correlation_id,
|
|
156
|
+
occurred_at
|
|
157
|
+
FROM atc.events
|
|
158
|
+
WHERE tenant_id = $1
|
|
159
|
+
AND run_id = $2
|
|
160
|
+
AND type = $3
|
|
161
|
+
AND transaction_id < pg_snapshot_xmin(pg_current_snapshot())
|
|
162
|
+
ORDER BY sequence ASC`;
|
|
163
|
+
async function listEventsByType(client, args) {
|
|
164
|
+
const result = await client.query({
|
|
165
|
+
text: exports.listEventsByTypeQuery,
|
|
166
|
+
values: [args.tenantId, args.runId, args.eventType],
|
|
167
|
+
rowMode: "array"
|
|
168
|
+
});
|
|
169
|
+
return result.rows.map(row => {
|
|
170
|
+
return {
|
|
171
|
+
id: row[0],
|
|
172
|
+
tenantId: row[1],
|
|
173
|
+
runId: row[2],
|
|
174
|
+
sequence: row[3],
|
|
175
|
+
type: row[4],
|
|
176
|
+
data: row[5],
|
|
177
|
+
causationId: row[6],
|
|
178
|
+
correlationId: row[7],
|
|
179
|
+
occurredAt: row[8]
|
|
180
|
+
};
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
exports.lockRunQuery = `-- name: LockRun :exec
|
|
184
|
+
SELECT pg_advisory_xact_lock($1::int, hashtext($2::text || ':' || $3::text))`;
|
|
185
|
+
async function lockRun(client, args) {
|
|
186
|
+
await client.query({
|
|
187
|
+
text: exports.lockRunQuery,
|
|
188
|
+
values: [args.lockNamespace, args.tenantId, args.runId],
|
|
189
|
+
rowMode: "array"
|
|
190
|
+
});
|
|
191
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { QueryArrayConfig, QueryArrayResult } from "pg";
|
|
2
|
+
interface Client {
|
|
3
|
+
query: (config: QueryArrayConfig) => Promise<QueryArrayResult>;
|
|
4
|
+
}
|
|
5
|
+
export declare const ensureMailboxCursorQuery = "-- name: EnsureMailboxCursor :exec\nINSERT INTO atc.mailbox_cursors (tenant_id, process_id)\nVALUES ($1, $2)\nON CONFLICT (tenant_id, process_id) DO NOTHING";
|
|
6
|
+
export interface EnsureMailboxCursorArgs {
|
|
7
|
+
tenantId: string;
|
|
8
|
+
processId: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function ensureMailboxCursor(client: Client, args: EnsureMailboxCursorArgs): Promise<void>;
|
|
11
|
+
export declare const lockMailboxCursorQuery = "-- name: LockMailboxCursor :one\nSELECT\n last_acked_sequence,\n last_processed_transaction_id::text AS last_processed_transaction_id\nFROM atc.mailbox_cursors\nWHERE tenant_id = $1\n AND process_id = $2\nFOR UPDATE";
|
|
12
|
+
export interface LockMailboxCursorArgs {
|
|
13
|
+
tenantId: string;
|
|
14
|
+
processId: string;
|
|
15
|
+
}
|
|
16
|
+
export interface LockMailboxCursorRow {
|
|
17
|
+
lastAckedSequence: string;
|
|
18
|
+
lastProcessedTransactionId: string;
|
|
19
|
+
}
|
|
20
|
+
export declare function lockMailboxCursor(client: Client, args: LockMailboxCursorArgs): Promise<LockMailboxCursorRow | null>;
|
|
21
|
+
export declare const readMailboxQuery = "-- name: ReadMailbox :many\nSELECT\n sequence,\n transaction_id::text AS transaction_id,\n data\nFROM atc.events\nWHERE tenant_id = $1\n AND data->>'to' = $2::text\n AND data->>'category' IN ('protocol', 'semantic')\n AND (\n sequence > $3\n OR (sequence = $3 AND transaction_id > $4::xid8)\n )\n AND transaction_id < pg_snapshot_xmin(pg_current_snapshot())\nORDER BY sequence ASC\nLIMIT $5";
|
|
22
|
+
export interface ReadMailboxArgs {
|
|
23
|
+
tenantId: string;
|
|
24
|
+
processId: string;
|
|
25
|
+
afterSequence: string;
|
|
26
|
+
afterTransactionId: string;
|
|
27
|
+
batchLimit: string;
|
|
28
|
+
}
|
|
29
|
+
export interface ReadMailboxRow {
|
|
30
|
+
sequence: string;
|
|
31
|
+
transactionId: string;
|
|
32
|
+
data: any | null;
|
|
33
|
+
}
|
|
34
|
+
export declare function readMailbox(client: Client, args: ReadMailboxArgs): Promise<ReadMailboxRow[]>;
|
|
35
|
+
export declare const acknowledgeMailboxQuery = "-- name: AcknowledgeMailbox :exec\nUPDATE atc.mailbox_cursors\nSET\n last_acked_sequence = $1,\n last_processed_transaction_id = $2::xid8\nWHERE tenant_id = $3\n AND process_id = $4";
|
|
36
|
+
export interface AcknowledgeMailboxArgs {
|
|
37
|
+
lastSequence: string;
|
|
38
|
+
lastTransactionId: string;
|
|
39
|
+
tenantId: string;
|
|
40
|
+
processId: string;
|
|
41
|
+
}
|
|
42
|
+
export declare function acknowledgeMailbox(client: Client, args: AcknowledgeMailboxArgs): Promise<void>;
|
|
43
|
+
export {};
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.acknowledgeMailboxQuery = exports.readMailboxQuery = exports.lockMailboxCursorQuery = exports.ensureMailboxCursorQuery = void 0;
|
|
4
|
+
exports.ensureMailboxCursor = ensureMailboxCursor;
|
|
5
|
+
exports.lockMailboxCursor = lockMailboxCursor;
|
|
6
|
+
exports.readMailbox = readMailbox;
|
|
7
|
+
exports.acknowledgeMailbox = acknowledgeMailbox;
|
|
8
|
+
exports.ensureMailboxCursorQuery = `-- name: EnsureMailboxCursor :exec
|
|
9
|
+
INSERT INTO atc.mailbox_cursors (tenant_id, process_id)
|
|
10
|
+
VALUES ($1, $2)
|
|
11
|
+
ON CONFLICT (tenant_id, process_id) DO NOTHING`;
|
|
12
|
+
async function ensureMailboxCursor(client, args) {
|
|
13
|
+
await client.query({
|
|
14
|
+
text: exports.ensureMailboxCursorQuery,
|
|
15
|
+
values: [args.tenantId, args.processId],
|
|
16
|
+
rowMode: "array"
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
exports.lockMailboxCursorQuery = `-- name: LockMailboxCursor :one
|
|
20
|
+
SELECT
|
|
21
|
+
last_acked_sequence,
|
|
22
|
+
last_processed_transaction_id::text AS last_processed_transaction_id
|
|
23
|
+
FROM atc.mailbox_cursors
|
|
24
|
+
WHERE tenant_id = $1
|
|
25
|
+
AND process_id = $2
|
|
26
|
+
FOR UPDATE`;
|
|
27
|
+
async function lockMailboxCursor(client, args) {
|
|
28
|
+
const result = await client.query({
|
|
29
|
+
text: exports.lockMailboxCursorQuery,
|
|
30
|
+
values: [args.tenantId, args.processId],
|
|
31
|
+
rowMode: "array"
|
|
32
|
+
});
|
|
33
|
+
if (result.rows.length !== 1) {
|
|
34
|
+
return null;
|
|
35
|
+
}
|
|
36
|
+
const row = result.rows[0];
|
|
37
|
+
return {
|
|
38
|
+
lastAckedSequence: row[0],
|
|
39
|
+
lastProcessedTransactionId: row[1]
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
exports.readMailboxQuery = `-- name: ReadMailbox :many
|
|
43
|
+
SELECT
|
|
44
|
+
sequence,
|
|
45
|
+
transaction_id::text AS transaction_id,
|
|
46
|
+
data
|
|
47
|
+
FROM atc.events
|
|
48
|
+
WHERE tenant_id = $1
|
|
49
|
+
AND data->>'to' = $2::text
|
|
50
|
+
AND data->>'category' IN ('protocol', 'semantic')
|
|
51
|
+
AND (
|
|
52
|
+
sequence > $3
|
|
53
|
+
OR (sequence = $3 AND transaction_id > $4::xid8)
|
|
54
|
+
)
|
|
55
|
+
AND transaction_id < pg_snapshot_xmin(pg_current_snapshot())
|
|
56
|
+
ORDER BY sequence ASC
|
|
57
|
+
LIMIT $5`;
|
|
58
|
+
async function readMailbox(client, args) {
|
|
59
|
+
const result = await client.query({
|
|
60
|
+
text: exports.readMailboxQuery,
|
|
61
|
+
values: [args.tenantId, args.processId, args.afterSequence, args.afterTransactionId, args.batchLimit],
|
|
62
|
+
rowMode: "array"
|
|
63
|
+
});
|
|
64
|
+
return result.rows.map(row => {
|
|
65
|
+
return {
|
|
66
|
+
sequence: row[0],
|
|
67
|
+
transactionId: row[1],
|
|
68
|
+
data: row[2]
|
|
69
|
+
};
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
exports.acknowledgeMailboxQuery = `-- name: AcknowledgeMailbox :exec
|
|
73
|
+
UPDATE atc.mailbox_cursors
|
|
74
|
+
SET
|
|
75
|
+
last_acked_sequence = $1,
|
|
76
|
+
last_processed_transaction_id = $2::xid8
|
|
77
|
+
WHERE tenant_id = $3
|
|
78
|
+
AND process_id = $4`;
|
|
79
|
+
async function acknowledgeMailbox(client, args) {
|
|
80
|
+
await client.query({
|
|
81
|
+
text: exports.acknowledgeMailboxQuery,
|
|
82
|
+
values: [args.lastSequence, args.lastTransactionId, args.tenantId, args.processId],
|
|
83
|
+
rowMode: "array"
|
|
84
|
+
});
|
|
85
|
+
}
|
|
@@ -2,118 +2,193 @@ 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
|
|
5
|
+
export declare const createProjectQuery = "-- name: CreateProject :one\nINSERT INTO weave.projects (\n id,\n organization_id,\n slug,\n name,\n summary,\n description,\n status,\n owner_user_id,\n creator_user_id,\n workspace_id,\n git_repository,\n start_date,\n target_date,\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 slug,\n name,\n summary,\n description,\n status,\n owner_user_id,\n creator_user_id,\n workspace_id,\n git_repository,\n start_date,\n target_date,\n source_system,\n source_id,\n source_metadata,\n created_at,\n updated_at";
|
|
6
6
|
export interface CreateProjectArgs {
|
|
7
7
|
id: string;
|
|
8
8
|
organizationId: string;
|
|
9
|
-
name: string;
|
|
10
9
|
slug: string;
|
|
10
|
+
name: string;
|
|
11
|
+
summary: string;
|
|
11
12
|
description: string;
|
|
12
13
|
status: string;
|
|
14
|
+
ownerUserId: string;
|
|
15
|
+
creatorUserId: string;
|
|
16
|
+
workspaceId: string;
|
|
17
|
+
gitRepository: string | null;
|
|
18
|
+
startDate: Date | null;
|
|
19
|
+
targetDate: Date | null;
|
|
20
|
+
sourceSystem: string | null;
|
|
21
|
+
sourceId: string | null;
|
|
22
|
+
sourceMetadata: any | null;
|
|
13
23
|
}
|
|
14
24
|
export interface CreateProjectRow {
|
|
15
25
|
id: string;
|
|
16
26
|
organizationId: string;
|
|
17
|
-
name: string;
|
|
18
27
|
slug: string;
|
|
28
|
+
name: string;
|
|
29
|
+
summary: string;
|
|
19
30
|
description: string;
|
|
20
31
|
status: string;
|
|
32
|
+
ownerUserId: string;
|
|
33
|
+
creatorUserId: string;
|
|
34
|
+
workspaceId: string;
|
|
35
|
+
gitRepository: string | null;
|
|
36
|
+
startDate: Date | null;
|
|
37
|
+
targetDate: Date | null;
|
|
38
|
+
sourceSystem: string | null;
|
|
39
|
+
sourceId: string | null;
|
|
40
|
+
sourceMetadata: any | null;
|
|
21
41
|
createdAt: Date;
|
|
22
42
|
updatedAt: Date;
|
|
23
|
-
archivedAt: Date | null;
|
|
24
43
|
}
|
|
25
44
|
export declare function createProject(client: Client, args: CreateProjectArgs): Promise<CreateProjectRow | null>;
|
|
26
|
-
export declare const
|
|
27
|
-
export interface
|
|
45
|
+
export declare const getProjectByIDQuery = "-- name: GetProjectByID :one\nSELECT\n id,\n organization_id,\n slug,\n name,\n summary,\n description,\n status,\n owner_user_id,\n creator_user_id,\n workspace_id,\n git_repository,\n start_date,\n target_date,\n source_system,\n source_id,\n source_metadata,\n created_at,\n updated_at\nFROM weave.projects\nWHERE organization_id = $1\n AND id = $2";
|
|
46
|
+
export interface GetProjectByIDArgs {
|
|
47
|
+
organizationId: string;
|
|
28
48
|
id: string;
|
|
29
49
|
}
|
|
30
|
-
export interface
|
|
50
|
+
export interface GetProjectByIDRow {
|
|
31
51
|
id: string;
|
|
32
52
|
organizationId: string;
|
|
33
|
-
name: string;
|
|
34
53
|
slug: string;
|
|
54
|
+
name: string;
|
|
55
|
+
summary: string;
|
|
35
56
|
description: string;
|
|
36
57
|
status: string;
|
|
58
|
+
ownerUserId: string;
|
|
59
|
+
creatorUserId: string;
|
|
60
|
+
workspaceId: string;
|
|
61
|
+
gitRepository: string | null;
|
|
62
|
+
startDate: Date | null;
|
|
63
|
+
targetDate: Date | null;
|
|
64
|
+
sourceSystem: string | null;
|
|
65
|
+
sourceId: string | null;
|
|
66
|
+
sourceMetadata: any | null;
|
|
37
67
|
createdAt: Date;
|
|
38
68
|
updatedAt: Date;
|
|
39
|
-
archivedAt: Date | null;
|
|
40
69
|
}
|
|
41
|
-
export declare function
|
|
42
|
-
export declare const getProjectBySlugQuery = "-- name: GetProjectBySlug :one\nSELECT
|
|
70
|
+
export declare function getProjectByID(client: Client, args: GetProjectByIDArgs): Promise<GetProjectByIDRow | null>;
|
|
71
|
+
export declare const getProjectBySlugQuery = "-- name: GetProjectBySlug :one\nSELECT\n id,\n organization_id,\n slug,\n name,\n summary,\n description,\n status,\n owner_user_id,\n creator_user_id,\n workspace_id,\n git_repository,\n start_date,\n target_date,\n source_system,\n source_id,\n source_metadata,\n created_at,\n updated_at\nFROM weave.projects\nWHERE organization_id = $1\n AND slug = $2";
|
|
43
72
|
export interface GetProjectBySlugArgs {
|
|
44
73
|
organizationId: string;
|
|
45
|
-
|
|
74
|
+
projectSlug: string;
|
|
46
75
|
}
|
|
47
76
|
export interface GetProjectBySlugRow {
|
|
48
77
|
id: string;
|
|
49
78
|
organizationId: string;
|
|
50
|
-
name: string;
|
|
51
79
|
slug: string;
|
|
80
|
+
name: string;
|
|
81
|
+
summary: string;
|
|
52
82
|
description: string;
|
|
53
83
|
status: string;
|
|
84
|
+
ownerUserId: string;
|
|
85
|
+
creatorUserId: string;
|
|
86
|
+
workspaceId: string;
|
|
87
|
+
gitRepository: string | null;
|
|
88
|
+
startDate: Date | null;
|
|
89
|
+
targetDate: Date | null;
|
|
90
|
+
sourceSystem: string | null;
|
|
91
|
+
sourceId: string | null;
|
|
92
|
+
sourceMetadata: any | null;
|
|
54
93
|
createdAt: Date;
|
|
55
94
|
updatedAt: Date;
|
|
56
|
-
archivedAt: Date | null;
|
|
57
95
|
}
|
|
58
96
|
export declare function getProjectBySlug(client: Client, args: GetProjectBySlugArgs): Promise<GetProjectBySlugRow | null>;
|
|
59
|
-
export declare const
|
|
60
|
-
export interface
|
|
97
|
+
export declare const listProjectsQuery = "-- name: ListProjects :many\nSELECT\n id,\n organization_id,\n slug,\n name,\n summary,\n description,\n status,\n owner_user_id,\n creator_user_id,\n workspace_id,\n git_repository,\n start_date,\n target_date,\n source_system,\n source_id,\n source_metadata,\n created_at,\n updated_at\nFROM weave.projects\nWHERE organization_id = $1\nORDER BY updated_at DESC, created_at DESC";
|
|
98
|
+
export interface ListProjectsArgs {
|
|
61
99
|
organizationId: string;
|
|
62
|
-
includeArchived: boolean;
|
|
63
|
-
pageOffset: string;
|
|
64
|
-
pageSize: string;
|
|
65
100
|
}
|
|
66
|
-
export interface
|
|
101
|
+
export interface ListProjectsRow {
|
|
67
102
|
id: string;
|
|
68
103
|
organizationId: string;
|
|
69
|
-
name: string;
|
|
70
104
|
slug: string;
|
|
105
|
+
name: string;
|
|
106
|
+
summary: string;
|
|
71
107
|
description: string;
|
|
72
108
|
status: string;
|
|
109
|
+
ownerUserId: string;
|
|
110
|
+
creatorUserId: string;
|
|
111
|
+
workspaceId: string;
|
|
112
|
+
gitRepository: string | null;
|
|
113
|
+
startDate: Date | null;
|
|
114
|
+
targetDate: Date | null;
|
|
115
|
+
sourceSystem: string | null;
|
|
116
|
+
sourceId: string | null;
|
|
117
|
+
sourceMetadata: any | null;
|
|
73
118
|
createdAt: Date;
|
|
74
119
|
updatedAt: Date;
|
|
75
|
-
archivedAt: Date | null;
|
|
76
120
|
}
|
|
77
|
-
export declare function
|
|
78
|
-
export declare const
|
|
79
|
-
export interface
|
|
121
|
+
export declare function listProjects(client: Client, args: ListProjectsArgs): Promise<ListProjectsRow[]>;
|
|
122
|
+
export declare const updateProjectBySlugQuery = "-- name: UpdateProjectBySlug :one\nUPDATE weave.projects\nSET\n name = $1,\n summary = $2,\n description = $3,\n status = $4,\n workspace_id = $5,\n git_repository = $6,\n start_date = $7,\n target_date = $8,\n source_system = $9,\n source_id = $10,\n source_metadata = $11,\n updated_at = now()\nWHERE organization_id = $12\n AND slug = $13\nRETURNING\n id,\n organization_id,\n slug,\n name,\n summary,\n description,\n status,\n owner_user_id,\n creator_user_id,\n workspace_id,\n git_repository,\n start_date,\n target_date,\n source_system,\n source_id,\n source_metadata,\n created_at,\n updated_at";
|
|
123
|
+
export interface UpdateProjectBySlugArgs {
|
|
80
124
|
name: string;
|
|
81
|
-
|
|
125
|
+
summary: string;
|
|
82
126
|
description: string;
|
|
83
127
|
status: string;
|
|
84
|
-
|
|
128
|
+
workspaceId: string;
|
|
129
|
+
gitRepository: string | null;
|
|
130
|
+
startDate: Date | null;
|
|
131
|
+
targetDate: Date | null;
|
|
132
|
+
sourceSystem: string | null;
|
|
133
|
+
sourceId: string | null;
|
|
134
|
+
sourceMetadata: any | null;
|
|
135
|
+
organizationId: string;
|
|
136
|
+
projectSlug: string;
|
|
85
137
|
}
|
|
86
|
-
export interface
|
|
138
|
+
export interface UpdateProjectBySlugRow {
|
|
87
139
|
id: string;
|
|
88
140
|
organizationId: string;
|
|
89
|
-
name: string;
|
|
90
141
|
slug: string;
|
|
142
|
+
name: string;
|
|
143
|
+
summary: string;
|
|
91
144
|
description: string;
|
|
92
145
|
status: string;
|
|
146
|
+
ownerUserId: string;
|
|
147
|
+
creatorUserId: string;
|
|
148
|
+
workspaceId: string;
|
|
149
|
+
gitRepository: string | null;
|
|
150
|
+
startDate: Date | null;
|
|
151
|
+
targetDate: Date | null;
|
|
152
|
+
sourceSystem: string | null;
|
|
153
|
+
sourceId: string | null;
|
|
154
|
+
sourceMetadata: any | null;
|
|
93
155
|
createdAt: Date;
|
|
94
156
|
updatedAt: Date;
|
|
95
|
-
archivedAt: Date | null;
|
|
96
157
|
}
|
|
97
|
-
export declare function
|
|
98
|
-
export declare const
|
|
99
|
-
export interface
|
|
100
|
-
|
|
158
|
+
export declare function updateProjectBySlug(client: Client, args: UpdateProjectBySlugArgs): Promise<UpdateProjectBySlugRow | null>;
|
|
159
|
+
export declare const listProjectPermissionsQuery = "-- name: ListProjectPermissions :many\nSELECT\n id,\n project_id,\n principal_kind,\n principal_id,\n principal_slug,\n principal_display_name,\n permission_level,\n created_at\nFROM weave.project_shares\nWHERE organization_id = $1\n AND project_id = $2\nORDER BY principal_kind ASC, principal_display_name ASC";
|
|
160
|
+
export interface ListProjectPermissionsArgs {
|
|
161
|
+
organizationId: string;
|
|
162
|
+
projectId: string;
|
|
101
163
|
}
|
|
102
|
-
export interface
|
|
164
|
+
export interface ListProjectPermissionsRow {
|
|
103
165
|
id: string;
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
166
|
+
projectId: string;
|
|
167
|
+
principalKind: string;
|
|
168
|
+
principalId: string;
|
|
169
|
+
principalSlug: string;
|
|
170
|
+
principalDisplayName: string;
|
|
171
|
+
permissionLevel: string;
|
|
109
172
|
createdAt: Date;
|
|
110
|
-
updatedAt: Date;
|
|
111
|
-
archivedAt: Date | null;
|
|
112
173
|
}
|
|
113
|
-
export declare function
|
|
114
|
-
export declare const
|
|
115
|
-
export interface
|
|
174
|
+
export declare function listProjectPermissions(client: Client, args: ListProjectPermissionsArgs): Promise<ListProjectPermissionsRow[]>;
|
|
175
|
+
export declare const listProjectActivityQuery = "-- name: ListProjectActivity :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.project_activity\nWHERE organization_id = $1\n AND project_id = $2\nORDER BY created_at DESC\nLIMIT $3";
|
|
176
|
+
export interface ListProjectActivityArgs {
|
|
177
|
+
organizationId: string;
|
|
178
|
+
projectId: string;
|
|
179
|
+
pageLimit: string;
|
|
180
|
+
}
|
|
181
|
+
export interface ListProjectActivityRow {
|
|
116
182
|
id: string;
|
|
183
|
+
projectId: string;
|
|
184
|
+
taskId: string | null;
|
|
185
|
+
eventType: string;
|
|
186
|
+
actorId: string | null;
|
|
187
|
+
actorSlug: string | null;
|
|
188
|
+
actorLabel: string;
|
|
189
|
+
description: string;
|
|
190
|
+
metadata: any | null;
|
|
191
|
+
createdAt: Date;
|
|
117
192
|
}
|
|
118
|
-
export declare function
|
|
193
|
+
export declare function listProjectActivity(client: Client, args: ListProjectActivityArgs): Promise<ListProjectActivityRow[]>;
|
|
119
194
|
export {};
|