@rudderhq/db 0.4.6-canary.9 → 0.5.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/client.test.js +629 -0
- package/dist/client.test.js.map +1 -1
- package/dist/embedded-postgres-recovery.d.ts +1 -0
- package/dist/embedded-postgres-recovery.d.ts.map +1 -1
- package/dist/embedded-postgres-recovery.js +33 -0
- package/dist/embedded-postgres-recovery.js.map +1 -1
- package/dist/embedded-postgres-recovery.test.js +19 -1
- package/dist/embedded-postgres-recovery.test.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/migration-runtime.d.ts.map +1 -1
- package/dist/migration-runtime.js +3 -20
- package/dist/migration-runtime.js.map +1 -1
- package/dist/migrations/0102_complex_retro_girl.sql +38 -0
- package/dist/migrations/0103_cute_colonel_america.sql +4 -0
- package/dist/migrations/0104_unusual_mister_fear.sql +173 -0
- package/dist/migrations/0105_chat_queue_actor_reconciliation.sql +54 -0
- package/dist/migrations/0106_damp_amphibian.sql +9 -0
- package/dist/migrations/meta/0102_snapshot.json +19090 -0
- package/dist/migrations/meta/0103_snapshot.json +19114 -0
- package/dist/migrations/meta/0104_snapshot.json +20338 -0
- package/dist/migrations/meta/0105_snapshot.json +20338 -0
- package/dist/migrations/meta/0106_snapshot.json +20442 -0
- package/dist/migrations/meta/_journal.json +35 -0
- package/dist/schema/activity_log.d.ts +17 -0
- package/dist/schema/activity_log.d.ts.map +1 -1
- package/dist/schema/activity_log.js +6 -1
- package/dist/schema/activity_log.js.map +1 -1
- package/dist/schema/agent_wakeup_requests.d.ts.map +1 -1
- package/dist/schema/agent_wakeup_requests.js +5 -1
- package/dist/schema/agent_wakeup_requests.js.map +1 -1
- package/dist/schema/chat_control_actions.d.ts +442 -0
- package/dist/schema/chat_control_actions.d.ts.map +1 -0
- package/dist/schema/chat_control_actions.js +35 -0
- package/dist/schema/chat_control_actions.js.map +1 -0
- package/dist/schema/chat_conversations.d.ts +119 -0
- package/dist/schema/chat_conversations.d.ts.map +1 -1
- package/dist/schema/chat_conversations.js +10 -1
- package/dist/schema/chat_conversations.js.map +1 -1
- package/dist/schema/chat_generation_events.d.ts +268 -0
- package/dist/schema/chat_generation_events.d.ts.map +1 -0
- package/dist/schema/chat_generation_events.js +32 -0
- package/dist/schema/chat_generation_events.js.map +1 -0
- package/dist/schema/chat_generation_terminal_outbox.d.ts +370 -0
- package/dist/schema/chat_generation_terminal_outbox.d.ts.map +1 -0
- package/dist/schema/chat_generation_terminal_outbox.js +33 -0
- package/dist/schema/chat_generation_terminal_outbox.js.map +1 -0
- package/dist/schema/chat_generations.d.ts +279 -2
- package/dist/schema/chat_generations.d.ts.map +1 -1
- package/dist/schema/chat_generations.js +23 -2
- package/dist/schema/chat_generations.js.map +1 -1
- package/dist/schema/chat_queued_messages.d.ts +285 -2
- package/dist/schema/chat_queued_messages.d.ts.map +1 -1
- package/dist/schema/chat_queued_messages.js +23 -1
- package/dist/schema/chat_queued_messages.js.map +1 -1
- package/dist/schema/cost_events.d.ts +34 -0
- package/dist/schema/cost_events.d.ts.map +1 -1
- package/dist/schema/cost_events.js +5 -1
- package/dist/schema/cost_events.js.map +1 -1
- package/dist/schema/heartbeat_run_events.d.ts +17 -0
- package/dist/schema/heartbeat_run_events.d.ts.map +1 -1
- package/dist/schema/heartbeat_run_events.js +6 -1
- package/dist/schema/heartbeat_run_events.js.map +1 -1
- package/dist/schema/heartbeat_runs.d.ts +303 -0
- package/dist/schema/heartbeat_runs.d.ts.map +1 -1
- package/dist/schema/heartbeat_runs.js +24 -2
- package/dist/schema/heartbeat_runs.js.map +1 -1
- package/dist/schema/index.d.ts +3 -0
- package/dist/schema/index.d.ts.map +1 -1
- package/dist/schema/index.js +3 -0
- package/dist/schema/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,370 @@
|
|
|
1
|
+
import type { ChatTerminalOutboxStatus } from "@rudderhq/shared";
|
|
2
|
+
export declare const chatGenerationTerminalOutbox: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
3
|
+
name: "chat_generation_terminal_outbox";
|
|
4
|
+
schema: undefined;
|
|
5
|
+
columns: {
|
|
6
|
+
id: import("drizzle-orm/pg-core").PgColumn<{
|
|
7
|
+
name: "id";
|
|
8
|
+
tableName: "chat_generation_terminal_outbox";
|
|
9
|
+
dataType: "string";
|
|
10
|
+
columnType: "PgUUID";
|
|
11
|
+
data: string;
|
|
12
|
+
driverParam: string;
|
|
13
|
+
notNull: true;
|
|
14
|
+
hasDefault: true;
|
|
15
|
+
isPrimaryKey: true;
|
|
16
|
+
isAutoincrement: false;
|
|
17
|
+
hasRuntimeDefault: false;
|
|
18
|
+
enumValues: undefined;
|
|
19
|
+
baseColumn: never;
|
|
20
|
+
identity: undefined;
|
|
21
|
+
generated: undefined;
|
|
22
|
+
}, {}, {}>;
|
|
23
|
+
orgId: import("drizzle-orm/pg-core").PgColumn<{
|
|
24
|
+
name: "org_id";
|
|
25
|
+
tableName: "chat_generation_terminal_outbox";
|
|
26
|
+
dataType: "string";
|
|
27
|
+
columnType: "PgUUID";
|
|
28
|
+
data: string;
|
|
29
|
+
driverParam: string;
|
|
30
|
+
notNull: true;
|
|
31
|
+
hasDefault: false;
|
|
32
|
+
isPrimaryKey: false;
|
|
33
|
+
isAutoincrement: false;
|
|
34
|
+
hasRuntimeDefault: false;
|
|
35
|
+
enumValues: undefined;
|
|
36
|
+
baseColumn: never;
|
|
37
|
+
identity: undefined;
|
|
38
|
+
generated: undefined;
|
|
39
|
+
}, {}, {}>;
|
|
40
|
+
generationId: import("drizzle-orm/pg-core").PgColumn<{
|
|
41
|
+
name: "generation_id";
|
|
42
|
+
tableName: "chat_generation_terminal_outbox";
|
|
43
|
+
dataType: "string";
|
|
44
|
+
columnType: "PgUUID";
|
|
45
|
+
data: string;
|
|
46
|
+
driverParam: string;
|
|
47
|
+
notNull: true;
|
|
48
|
+
hasDefault: false;
|
|
49
|
+
isPrimaryKey: false;
|
|
50
|
+
isAutoincrement: false;
|
|
51
|
+
hasRuntimeDefault: false;
|
|
52
|
+
enumValues: undefined;
|
|
53
|
+
baseColumn: never;
|
|
54
|
+
identity: undefined;
|
|
55
|
+
generated: undefined;
|
|
56
|
+
}, {}, {}>;
|
|
57
|
+
sourceEventId: import("drizzle-orm/pg-core").PgColumn<{
|
|
58
|
+
name: "source_event_id";
|
|
59
|
+
tableName: "chat_generation_terminal_outbox";
|
|
60
|
+
dataType: "string";
|
|
61
|
+
columnType: "PgUUID";
|
|
62
|
+
data: string;
|
|
63
|
+
driverParam: string;
|
|
64
|
+
notNull: true;
|
|
65
|
+
hasDefault: false;
|
|
66
|
+
isPrimaryKey: false;
|
|
67
|
+
isAutoincrement: false;
|
|
68
|
+
hasRuntimeDefault: false;
|
|
69
|
+
enumValues: undefined;
|
|
70
|
+
baseColumn: never;
|
|
71
|
+
identity: undefined;
|
|
72
|
+
generated: undefined;
|
|
73
|
+
}, {}, {}>;
|
|
74
|
+
projectionVersion: import("drizzle-orm/pg-core").PgColumn<{
|
|
75
|
+
name: "projection_version";
|
|
76
|
+
tableName: "chat_generation_terminal_outbox";
|
|
77
|
+
dataType: "number";
|
|
78
|
+
columnType: "PgInteger";
|
|
79
|
+
data: number;
|
|
80
|
+
driverParam: string | number;
|
|
81
|
+
notNull: true;
|
|
82
|
+
hasDefault: false;
|
|
83
|
+
isPrimaryKey: false;
|
|
84
|
+
isAutoincrement: false;
|
|
85
|
+
hasRuntimeDefault: false;
|
|
86
|
+
enumValues: undefined;
|
|
87
|
+
baseColumn: never;
|
|
88
|
+
identity: undefined;
|
|
89
|
+
generated: undefined;
|
|
90
|
+
}, {}, {}>;
|
|
91
|
+
projectorVersion: import("drizzle-orm/pg-core").PgColumn<{
|
|
92
|
+
name: "projector_version";
|
|
93
|
+
tableName: "chat_generation_terminal_outbox";
|
|
94
|
+
dataType: "number";
|
|
95
|
+
columnType: "PgInteger";
|
|
96
|
+
data: number;
|
|
97
|
+
driverParam: string | number;
|
|
98
|
+
notNull: true;
|
|
99
|
+
hasDefault: true;
|
|
100
|
+
isPrimaryKey: false;
|
|
101
|
+
isAutoincrement: false;
|
|
102
|
+
hasRuntimeDefault: false;
|
|
103
|
+
enumValues: undefined;
|
|
104
|
+
baseColumn: never;
|
|
105
|
+
identity: undefined;
|
|
106
|
+
generated: undefined;
|
|
107
|
+
}, {}, {}>;
|
|
108
|
+
expectedControlVersion: import("drizzle-orm/pg-core").PgColumn<{
|
|
109
|
+
name: "expected_control_version";
|
|
110
|
+
tableName: "chat_generation_terminal_outbox";
|
|
111
|
+
dataType: "number";
|
|
112
|
+
columnType: "PgInteger";
|
|
113
|
+
data: number;
|
|
114
|
+
driverParam: string | number;
|
|
115
|
+
notNull: true;
|
|
116
|
+
hasDefault: false;
|
|
117
|
+
isPrimaryKey: false;
|
|
118
|
+
isAutoincrement: false;
|
|
119
|
+
hasRuntimeDefault: false;
|
|
120
|
+
enumValues: undefined;
|
|
121
|
+
baseColumn: never;
|
|
122
|
+
identity: undefined;
|
|
123
|
+
generated: undefined;
|
|
124
|
+
}, {}, {}>;
|
|
125
|
+
status: import("drizzle-orm/pg-core").PgColumn<{
|
|
126
|
+
name: "status";
|
|
127
|
+
tableName: "chat_generation_terminal_outbox";
|
|
128
|
+
dataType: "string";
|
|
129
|
+
columnType: "PgText";
|
|
130
|
+
data: ChatTerminalOutboxStatus;
|
|
131
|
+
driverParam: string;
|
|
132
|
+
notNull: true;
|
|
133
|
+
hasDefault: true;
|
|
134
|
+
isPrimaryKey: false;
|
|
135
|
+
isAutoincrement: false;
|
|
136
|
+
hasRuntimeDefault: false;
|
|
137
|
+
enumValues: [string, ...string[]];
|
|
138
|
+
baseColumn: never;
|
|
139
|
+
identity: undefined;
|
|
140
|
+
generated: undefined;
|
|
141
|
+
}, {}, {
|
|
142
|
+
$type: ChatTerminalOutboxStatus;
|
|
143
|
+
}>;
|
|
144
|
+
payload: import("drizzle-orm/pg-core").PgColumn<{
|
|
145
|
+
name: "payload";
|
|
146
|
+
tableName: "chat_generation_terminal_outbox";
|
|
147
|
+
dataType: "json";
|
|
148
|
+
columnType: "PgJsonb";
|
|
149
|
+
data: Record<string, unknown>;
|
|
150
|
+
driverParam: unknown;
|
|
151
|
+
notNull: true;
|
|
152
|
+
hasDefault: true;
|
|
153
|
+
isPrimaryKey: false;
|
|
154
|
+
isAutoincrement: false;
|
|
155
|
+
hasRuntimeDefault: false;
|
|
156
|
+
enumValues: undefined;
|
|
157
|
+
baseColumn: never;
|
|
158
|
+
identity: undefined;
|
|
159
|
+
generated: undefined;
|
|
160
|
+
}, {}, {
|
|
161
|
+
$type: Record<string, unknown>;
|
|
162
|
+
}>;
|
|
163
|
+
claimToken: import("drizzle-orm/pg-core").PgColumn<{
|
|
164
|
+
name: "claim_token";
|
|
165
|
+
tableName: "chat_generation_terminal_outbox";
|
|
166
|
+
dataType: "string";
|
|
167
|
+
columnType: "PgText";
|
|
168
|
+
data: string;
|
|
169
|
+
driverParam: string;
|
|
170
|
+
notNull: false;
|
|
171
|
+
hasDefault: false;
|
|
172
|
+
isPrimaryKey: false;
|
|
173
|
+
isAutoincrement: false;
|
|
174
|
+
hasRuntimeDefault: false;
|
|
175
|
+
enumValues: [string, ...string[]];
|
|
176
|
+
baseColumn: never;
|
|
177
|
+
identity: undefined;
|
|
178
|
+
generated: undefined;
|
|
179
|
+
}, {}, {}>;
|
|
180
|
+
claimEpoch: import("drizzle-orm/pg-core").PgColumn<{
|
|
181
|
+
name: "claim_epoch";
|
|
182
|
+
tableName: "chat_generation_terminal_outbox";
|
|
183
|
+
dataType: "number";
|
|
184
|
+
columnType: "PgInteger";
|
|
185
|
+
data: number;
|
|
186
|
+
driverParam: string | number;
|
|
187
|
+
notNull: true;
|
|
188
|
+
hasDefault: true;
|
|
189
|
+
isPrimaryKey: false;
|
|
190
|
+
isAutoincrement: false;
|
|
191
|
+
hasRuntimeDefault: false;
|
|
192
|
+
enumValues: undefined;
|
|
193
|
+
baseColumn: never;
|
|
194
|
+
identity: undefined;
|
|
195
|
+
generated: undefined;
|
|
196
|
+
}, {}, {}>;
|
|
197
|
+
claimOwner: import("drizzle-orm/pg-core").PgColumn<{
|
|
198
|
+
name: "claim_owner";
|
|
199
|
+
tableName: "chat_generation_terminal_outbox";
|
|
200
|
+
dataType: "string";
|
|
201
|
+
columnType: "PgText";
|
|
202
|
+
data: string;
|
|
203
|
+
driverParam: string;
|
|
204
|
+
notNull: false;
|
|
205
|
+
hasDefault: false;
|
|
206
|
+
isPrimaryKey: false;
|
|
207
|
+
isAutoincrement: false;
|
|
208
|
+
hasRuntimeDefault: false;
|
|
209
|
+
enumValues: [string, ...string[]];
|
|
210
|
+
baseColumn: never;
|
|
211
|
+
identity: undefined;
|
|
212
|
+
generated: undefined;
|
|
213
|
+
}, {}, {}>;
|
|
214
|
+
leaseExpiresAt: import("drizzle-orm/pg-core").PgColumn<{
|
|
215
|
+
name: "lease_expires_at";
|
|
216
|
+
tableName: "chat_generation_terminal_outbox";
|
|
217
|
+
dataType: "date";
|
|
218
|
+
columnType: "PgTimestamp";
|
|
219
|
+
data: Date;
|
|
220
|
+
driverParam: string;
|
|
221
|
+
notNull: false;
|
|
222
|
+
hasDefault: false;
|
|
223
|
+
isPrimaryKey: false;
|
|
224
|
+
isAutoincrement: false;
|
|
225
|
+
hasRuntimeDefault: false;
|
|
226
|
+
enumValues: undefined;
|
|
227
|
+
baseColumn: never;
|
|
228
|
+
identity: undefined;
|
|
229
|
+
generated: undefined;
|
|
230
|
+
}, {}, {}>;
|
|
231
|
+
attemptCount: import("drizzle-orm/pg-core").PgColumn<{
|
|
232
|
+
name: "attempt_count";
|
|
233
|
+
tableName: "chat_generation_terminal_outbox";
|
|
234
|
+
dataType: "number";
|
|
235
|
+
columnType: "PgInteger";
|
|
236
|
+
data: number;
|
|
237
|
+
driverParam: string | number;
|
|
238
|
+
notNull: true;
|
|
239
|
+
hasDefault: true;
|
|
240
|
+
isPrimaryKey: false;
|
|
241
|
+
isAutoincrement: false;
|
|
242
|
+
hasRuntimeDefault: false;
|
|
243
|
+
enumValues: undefined;
|
|
244
|
+
baseColumn: never;
|
|
245
|
+
identity: undefined;
|
|
246
|
+
generated: undefined;
|
|
247
|
+
}, {}, {}>;
|
|
248
|
+
replayCount: import("drizzle-orm/pg-core").PgColumn<{
|
|
249
|
+
name: "replay_count";
|
|
250
|
+
tableName: "chat_generation_terminal_outbox";
|
|
251
|
+
dataType: "number";
|
|
252
|
+
columnType: "PgInteger";
|
|
253
|
+
data: number;
|
|
254
|
+
driverParam: string | number;
|
|
255
|
+
notNull: true;
|
|
256
|
+
hasDefault: true;
|
|
257
|
+
isPrimaryKey: false;
|
|
258
|
+
isAutoincrement: false;
|
|
259
|
+
hasRuntimeDefault: false;
|
|
260
|
+
enumValues: undefined;
|
|
261
|
+
baseColumn: never;
|
|
262
|
+
identity: undefined;
|
|
263
|
+
generated: undefined;
|
|
264
|
+
}, {}, {}>;
|
|
265
|
+
availableAt: import("drizzle-orm/pg-core").PgColumn<{
|
|
266
|
+
name: "available_at";
|
|
267
|
+
tableName: "chat_generation_terminal_outbox";
|
|
268
|
+
dataType: "date";
|
|
269
|
+
columnType: "PgTimestamp";
|
|
270
|
+
data: Date;
|
|
271
|
+
driverParam: string;
|
|
272
|
+
notNull: true;
|
|
273
|
+
hasDefault: true;
|
|
274
|
+
isPrimaryKey: false;
|
|
275
|
+
isAutoincrement: false;
|
|
276
|
+
hasRuntimeDefault: false;
|
|
277
|
+
enumValues: undefined;
|
|
278
|
+
baseColumn: never;
|
|
279
|
+
identity: undefined;
|
|
280
|
+
generated: undefined;
|
|
281
|
+
}, {}, {}>;
|
|
282
|
+
lastAttemptAt: import("drizzle-orm/pg-core").PgColumn<{
|
|
283
|
+
name: "last_attempt_at";
|
|
284
|
+
tableName: "chat_generation_terminal_outbox";
|
|
285
|
+
dataType: "date";
|
|
286
|
+
columnType: "PgTimestamp";
|
|
287
|
+
data: Date;
|
|
288
|
+
driverParam: string;
|
|
289
|
+
notNull: false;
|
|
290
|
+
hasDefault: false;
|
|
291
|
+
isPrimaryKey: false;
|
|
292
|
+
isAutoincrement: false;
|
|
293
|
+
hasRuntimeDefault: false;
|
|
294
|
+
enumValues: undefined;
|
|
295
|
+
baseColumn: never;
|
|
296
|
+
identity: undefined;
|
|
297
|
+
generated: undefined;
|
|
298
|
+
}, {}, {}>;
|
|
299
|
+
lastError: import("drizzle-orm/pg-core").PgColumn<{
|
|
300
|
+
name: "last_error";
|
|
301
|
+
tableName: "chat_generation_terminal_outbox";
|
|
302
|
+
dataType: "string";
|
|
303
|
+
columnType: "PgText";
|
|
304
|
+
data: string;
|
|
305
|
+
driverParam: string;
|
|
306
|
+
notNull: false;
|
|
307
|
+
hasDefault: false;
|
|
308
|
+
isPrimaryKey: false;
|
|
309
|
+
isAutoincrement: false;
|
|
310
|
+
hasRuntimeDefault: false;
|
|
311
|
+
enumValues: [string, ...string[]];
|
|
312
|
+
baseColumn: never;
|
|
313
|
+
identity: undefined;
|
|
314
|
+
generated: undefined;
|
|
315
|
+
}, {}, {}>;
|
|
316
|
+
projectedAt: import("drizzle-orm/pg-core").PgColumn<{
|
|
317
|
+
name: "projected_at";
|
|
318
|
+
tableName: "chat_generation_terminal_outbox";
|
|
319
|
+
dataType: "date";
|
|
320
|
+
columnType: "PgTimestamp";
|
|
321
|
+
data: Date;
|
|
322
|
+
driverParam: string;
|
|
323
|
+
notNull: false;
|
|
324
|
+
hasDefault: false;
|
|
325
|
+
isPrimaryKey: false;
|
|
326
|
+
isAutoincrement: false;
|
|
327
|
+
hasRuntimeDefault: false;
|
|
328
|
+
enumValues: undefined;
|
|
329
|
+
baseColumn: never;
|
|
330
|
+
identity: undefined;
|
|
331
|
+
generated: undefined;
|
|
332
|
+
}, {}, {}>;
|
|
333
|
+
createdAt: import("drizzle-orm/pg-core").PgColumn<{
|
|
334
|
+
name: "created_at";
|
|
335
|
+
tableName: "chat_generation_terminal_outbox";
|
|
336
|
+
dataType: "date";
|
|
337
|
+
columnType: "PgTimestamp";
|
|
338
|
+
data: Date;
|
|
339
|
+
driverParam: string;
|
|
340
|
+
notNull: true;
|
|
341
|
+
hasDefault: true;
|
|
342
|
+
isPrimaryKey: false;
|
|
343
|
+
isAutoincrement: false;
|
|
344
|
+
hasRuntimeDefault: false;
|
|
345
|
+
enumValues: undefined;
|
|
346
|
+
baseColumn: never;
|
|
347
|
+
identity: undefined;
|
|
348
|
+
generated: undefined;
|
|
349
|
+
}, {}, {}>;
|
|
350
|
+
updatedAt: import("drizzle-orm/pg-core").PgColumn<{
|
|
351
|
+
name: "updated_at";
|
|
352
|
+
tableName: "chat_generation_terminal_outbox";
|
|
353
|
+
dataType: "date";
|
|
354
|
+
columnType: "PgTimestamp";
|
|
355
|
+
data: Date;
|
|
356
|
+
driverParam: string;
|
|
357
|
+
notNull: true;
|
|
358
|
+
hasDefault: true;
|
|
359
|
+
isPrimaryKey: false;
|
|
360
|
+
isAutoincrement: false;
|
|
361
|
+
hasRuntimeDefault: false;
|
|
362
|
+
enumValues: undefined;
|
|
363
|
+
baseColumn: never;
|
|
364
|
+
identity: undefined;
|
|
365
|
+
generated: undefined;
|
|
366
|
+
}, {}, {}>;
|
|
367
|
+
};
|
|
368
|
+
dialect: "pg";
|
|
369
|
+
}>;
|
|
370
|
+
//# sourceMappingURL=chat_generation_terminal_outbox.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat_generation_terminal_outbox.d.ts","sourceRoot":"","sources":["../../src/schema/chat_generation_terminal_outbox.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AAMjE,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAyCxC,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { index, integer, jsonb, pgTable, text, timestamp, uniqueIndex, uuid } from "drizzle-orm/pg-core";
|
|
2
|
+
import { chatGenerationEvents } from "./chat_generation_events.js";
|
|
3
|
+
import { chatGenerations } from "./chat_generations.js";
|
|
4
|
+
import { organizations } from "./organizations.js";
|
|
5
|
+
export const chatGenerationTerminalOutbox = pgTable("chat_generation_terminal_outbox", {
|
|
6
|
+
id: uuid("id").primaryKey().defaultRandom(),
|
|
7
|
+
orgId: uuid("org_id").notNull().references(() => organizations.id, { onDelete: "cascade" }),
|
|
8
|
+
generationId: uuid("generation_id").notNull().references(() => chatGenerations.id, { onDelete: "cascade" }),
|
|
9
|
+
sourceEventId: uuid("source_event_id").notNull().references(() => chatGenerationEvents.id, { onDelete: "cascade" }),
|
|
10
|
+
projectionVersion: integer("projection_version").notNull(),
|
|
11
|
+
projectorVersion: integer("projector_version").notNull().default(1),
|
|
12
|
+
expectedControlVersion: integer("expected_control_version").notNull(),
|
|
13
|
+
status: text("status").$type().notNull().default("pending"),
|
|
14
|
+
payload: jsonb("payload").$type().notNull().default({}),
|
|
15
|
+
claimToken: text("claim_token"),
|
|
16
|
+
claimEpoch: integer("claim_epoch").notNull().default(0),
|
|
17
|
+
claimOwner: text("claim_owner"),
|
|
18
|
+
leaseExpiresAt: timestamp("lease_expires_at", { withTimezone: true }),
|
|
19
|
+
attemptCount: integer("attempt_count").notNull().default(0),
|
|
20
|
+
replayCount: integer("replay_count").notNull().default(0),
|
|
21
|
+
availableAt: timestamp("available_at", { withTimezone: true }).notNull().defaultNow(),
|
|
22
|
+
lastAttemptAt: timestamp("last_attempt_at", { withTimezone: true }),
|
|
23
|
+
lastError: text("last_error"),
|
|
24
|
+
projectedAt: timestamp("projected_at", { withTimezone: true }),
|
|
25
|
+
createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
|
|
26
|
+
updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow(),
|
|
27
|
+
}, (table) => ({
|
|
28
|
+
generationProjectionUq: uniqueIndex("chat_generation_terminal_outbox_generation_projection_uq").on(table.generationId, table.projectionVersion),
|
|
29
|
+
sourceEventUq: uniqueIndex("chat_generation_terminal_outbox_source_event_uq").on(table.sourceEventId),
|
|
30
|
+
claimIdx: index("chat_generation_terminal_outbox_claim_idx").on(table.status, table.availableAt, table.leaseExpiresAt),
|
|
31
|
+
orgGenerationIdx: index("chat_generation_terminal_outbox_org_generation_idx").on(table.orgId, table.generationId),
|
|
32
|
+
}));
|
|
33
|
+
//# sourceMappingURL=chat_generation_terminal_outbox.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat_generation_terminal_outbox.js","sourceRoot":"","sources":["../../src/schema/chat_generation_terminal_outbox.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AACzG,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,MAAM,CAAC,MAAM,4BAA4B,GAAG,OAAO,CACjD,iCAAiC,EACjC;IACE,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC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