@voyantjs/distribution 0.20.0 → 0.21.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/channel-push/admin-routes.d.ts +31 -0
- package/dist/channel-push/admin-routes.d.ts.map +1 -0
- package/dist/channel-push/admin-routes.js +165 -0
- package/dist/channel-push/availability-push.d.ts +76 -0
- package/dist/channel-push/availability-push.d.ts.map +1 -0
- package/dist/channel-push/availability-push.js +238 -0
- package/dist/channel-push/booking-push.d.ts +114 -0
- package/dist/channel-push/booking-push.d.ts.map +1 -0
- package/dist/channel-push/booking-push.js +503 -0
- package/dist/channel-push/content-push.d.ts +60 -0
- package/dist/channel-push/content-push.d.ts.map +1 -0
- package/dist/channel-push/content-push.js +256 -0
- package/dist/channel-push/index.d.ts +15 -0
- package/dist/channel-push/index.d.ts.map +1 -0
- package/dist/channel-push/index.js +18 -0
- package/dist/channel-push/plugin.d.ts +18 -0
- package/dist/channel-push/plugin.d.ts.map +1 -0
- package/dist/channel-push/plugin.js +21 -0
- package/dist/channel-push/reconciler.d.ts +85 -0
- package/dist/channel-push/reconciler.d.ts.map +1 -0
- package/dist/channel-push/reconciler.js +175 -0
- package/dist/channel-push/subscriber.d.ts +40 -0
- package/dist/channel-push/subscriber.d.ts.map +1 -0
- package/dist/channel-push/subscriber.js +174 -0
- package/dist/channel-push/types.d.ts +43 -0
- package/dist/channel-push/types.d.ts.map +1 -0
- package/dist/channel-push/types.js +32 -0
- package/dist/channel-push/workflows.d.ts +56 -0
- package/dist/channel-push/workflows.d.ts.map +1 -0
- package/dist/channel-push/workflows.js +100 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/rate-limit.d.ts +69 -0
- package/dist/rate-limit.d.ts.map +1 -0
- package/dist/rate-limit.js +135 -0
- package/dist/routes.d.ts +170 -10
- package/dist/routes.d.ts.map +1 -1
- package/dist/schema-core.d.ts +417 -1
- package/dist/schema-core.d.ts.map +1 -1
- package/dist/schema-core.js +98 -1
- package/dist/schema-push-intents.d.ts +387 -0
- package/dist/schema-push-intents.d.ts.map +1 -0
- package/dist/schema-push-intents.js +77 -0
- package/dist/schema.d.ts +1 -0
- package/dist/schema.d.ts.map +1 -1
- package/dist/schema.js +1 -0
- package/dist/service.d.ts +103 -7
- package/dist/service.d.ts.map +1 -1
- package/dist/validation.d.ts +5 -5
- package/dist/webhook-deliveries.d.ts +86 -0
- package/dist/webhook-deliveries.d.ts.map +1 -0
- package/dist/webhook-deliveries.js +293 -0
- package/package.json +16 -8
|
@@ -0,0 +1,387 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Durable handoff rows for the channel-push availability and content
|
|
3
|
+
* flows. Subscribers INSERT into these tables (returning immediately
|
|
4
|
+
* per the EventBus contract); the scheduled push workflows drain them.
|
|
5
|
+
*
|
|
6
|
+
* Booking push doesn't need its own intent table — `channel_booking_links`
|
|
7
|
+
* already serves both roles (push_status = 'pending' for in-flight,
|
|
8
|
+
* 'ok' on success).
|
|
9
|
+
*
|
|
10
|
+
* Per docs/architecture/channel-push-architecture.md §7.3 and §12.
|
|
11
|
+
*/
|
|
12
|
+
export declare const channelAvailabilityPushIntents: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
13
|
+
name: "channel_availability_push_intents";
|
|
14
|
+
schema: undefined;
|
|
15
|
+
columns: {
|
|
16
|
+
id: import("drizzle-orm/pg-core").PgColumn<{
|
|
17
|
+
name: string;
|
|
18
|
+
tableName: "channel_availability_push_intents";
|
|
19
|
+
dataType: "string";
|
|
20
|
+
columnType: "PgText";
|
|
21
|
+
data: string;
|
|
22
|
+
driverParam: string;
|
|
23
|
+
notNull: true;
|
|
24
|
+
hasDefault: true;
|
|
25
|
+
isPrimaryKey: true;
|
|
26
|
+
isAutoincrement: false;
|
|
27
|
+
hasRuntimeDefault: true;
|
|
28
|
+
enumValues: [string, ...string[]];
|
|
29
|
+
baseColumn: never;
|
|
30
|
+
identity: undefined;
|
|
31
|
+
generated: undefined;
|
|
32
|
+
}, {}, {}>;
|
|
33
|
+
channelId: import("drizzle-orm/pg-core").PgColumn<{
|
|
34
|
+
name: string;
|
|
35
|
+
tableName: "channel_availability_push_intents";
|
|
36
|
+
dataType: "string";
|
|
37
|
+
columnType: "PgText";
|
|
38
|
+
data: string;
|
|
39
|
+
driverParam: string;
|
|
40
|
+
notNull: true;
|
|
41
|
+
hasDefault: false;
|
|
42
|
+
isPrimaryKey: false;
|
|
43
|
+
isAutoincrement: false;
|
|
44
|
+
hasRuntimeDefault: false;
|
|
45
|
+
enumValues: [string, ...string[]];
|
|
46
|
+
baseColumn: never;
|
|
47
|
+
identity: undefined;
|
|
48
|
+
generated: undefined;
|
|
49
|
+
}, {}, {}>;
|
|
50
|
+
sourceConnectionId: import("drizzle-orm/pg-core").PgColumn<{
|
|
51
|
+
name: "source_connection_id";
|
|
52
|
+
tableName: "channel_availability_push_intents";
|
|
53
|
+
dataType: "string";
|
|
54
|
+
columnType: "PgText";
|
|
55
|
+
data: string;
|
|
56
|
+
driverParam: string;
|
|
57
|
+
notNull: true;
|
|
58
|
+
hasDefault: false;
|
|
59
|
+
isPrimaryKey: false;
|
|
60
|
+
isAutoincrement: false;
|
|
61
|
+
hasRuntimeDefault: false;
|
|
62
|
+
enumValues: [string, ...string[]];
|
|
63
|
+
baseColumn: never;
|
|
64
|
+
identity: undefined;
|
|
65
|
+
generated: undefined;
|
|
66
|
+
}, {}, {}>;
|
|
67
|
+
slotId: import("drizzle-orm/pg-core").PgColumn<{
|
|
68
|
+
name: "slot_id";
|
|
69
|
+
tableName: "channel_availability_push_intents";
|
|
70
|
+
dataType: "string";
|
|
71
|
+
columnType: "PgText";
|
|
72
|
+
data: string;
|
|
73
|
+
driverParam: string;
|
|
74
|
+
notNull: true;
|
|
75
|
+
hasDefault: false;
|
|
76
|
+
isPrimaryKey: false;
|
|
77
|
+
isAutoincrement: false;
|
|
78
|
+
hasRuntimeDefault: false;
|
|
79
|
+
enumValues: [string, ...string[]];
|
|
80
|
+
baseColumn: never;
|
|
81
|
+
identity: undefined;
|
|
82
|
+
generated: undefined;
|
|
83
|
+
}, {}, {}>;
|
|
84
|
+
productId: import("drizzle-orm/pg-core").PgColumn<{
|
|
85
|
+
name: "product_id";
|
|
86
|
+
tableName: "channel_availability_push_intents";
|
|
87
|
+
dataType: "string";
|
|
88
|
+
columnType: "PgText";
|
|
89
|
+
data: string;
|
|
90
|
+
driverParam: string;
|
|
91
|
+
notNull: true;
|
|
92
|
+
hasDefault: false;
|
|
93
|
+
isPrimaryKey: false;
|
|
94
|
+
isAutoincrement: false;
|
|
95
|
+
hasRuntimeDefault: false;
|
|
96
|
+
enumValues: [string, ...string[]];
|
|
97
|
+
baseColumn: never;
|
|
98
|
+
identity: undefined;
|
|
99
|
+
generated: undefined;
|
|
100
|
+
}, {}, {}>;
|
|
101
|
+
optionId: import("drizzle-orm/pg-core").PgColumn<{
|
|
102
|
+
name: "option_id";
|
|
103
|
+
tableName: "channel_availability_push_intents";
|
|
104
|
+
dataType: "string";
|
|
105
|
+
columnType: "PgText";
|
|
106
|
+
data: string;
|
|
107
|
+
driverParam: string;
|
|
108
|
+
notNull: false;
|
|
109
|
+
hasDefault: false;
|
|
110
|
+
isPrimaryKey: false;
|
|
111
|
+
isAutoincrement: false;
|
|
112
|
+
hasRuntimeDefault: false;
|
|
113
|
+
enumValues: [string, ...string[]];
|
|
114
|
+
baseColumn: never;
|
|
115
|
+
identity: undefined;
|
|
116
|
+
generated: undefined;
|
|
117
|
+
}, {}, {}>;
|
|
118
|
+
startsAt: import("drizzle-orm/pg-core").PgColumn<{
|
|
119
|
+
name: "starts_at";
|
|
120
|
+
tableName: "channel_availability_push_intents";
|
|
121
|
+
dataType: "date";
|
|
122
|
+
columnType: "PgTimestamp";
|
|
123
|
+
data: Date;
|
|
124
|
+
driverParam: string;
|
|
125
|
+
notNull: true;
|
|
126
|
+
hasDefault: false;
|
|
127
|
+
isPrimaryKey: false;
|
|
128
|
+
isAutoincrement: false;
|
|
129
|
+
hasRuntimeDefault: false;
|
|
130
|
+
enumValues: undefined;
|
|
131
|
+
baseColumn: never;
|
|
132
|
+
identity: undefined;
|
|
133
|
+
generated: undefined;
|
|
134
|
+
}, {}, {}>;
|
|
135
|
+
requestedAt: import("drizzle-orm/pg-core").PgColumn<{
|
|
136
|
+
name: "requested_at";
|
|
137
|
+
tableName: "channel_availability_push_intents";
|
|
138
|
+
dataType: "date";
|
|
139
|
+
columnType: "PgTimestamp";
|
|
140
|
+
data: Date;
|
|
141
|
+
driverParam: string;
|
|
142
|
+
notNull: true;
|
|
143
|
+
hasDefault: true;
|
|
144
|
+
isPrimaryKey: false;
|
|
145
|
+
isAutoincrement: false;
|
|
146
|
+
hasRuntimeDefault: false;
|
|
147
|
+
enumValues: undefined;
|
|
148
|
+
baseColumn: never;
|
|
149
|
+
identity: undefined;
|
|
150
|
+
generated: undefined;
|
|
151
|
+
}, {}, {}>;
|
|
152
|
+
attempts: import("drizzle-orm/pg-core").PgColumn<{
|
|
153
|
+
name: "attempts";
|
|
154
|
+
tableName: "channel_availability_push_intents";
|
|
155
|
+
dataType: "number";
|
|
156
|
+
columnType: "PgInteger";
|
|
157
|
+
data: number;
|
|
158
|
+
driverParam: string | number;
|
|
159
|
+
notNull: true;
|
|
160
|
+
hasDefault: true;
|
|
161
|
+
isPrimaryKey: false;
|
|
162
|
+
isAutoincrement: false;
|
|
163
|
+
hasRuntimeDefault: false;
|
|
164
|
+
enumValues: undefined;
|
|
165
|
+
baseColumn: never;
|
|
166
|
+
identity: undefined;
|
|
167
|
+
generated: undefined;
|
|
168
|
+
}, {}, {}>;
|
|
169
|
+
lastError: import("drizzle-orm/pg-core").PgColumn<{
|
|
170
|
+
name: "last_error";
|
|
171
|
+
tableName: "channel_availability_push_intents";
|
|
172
|
+
dataType: "string";
|
|
173
|
+
columnType: "PgText";
|
|
174
|
+
data: string;
|
|
175
|
+
driverParam: string;
|
|
176
|
+
notNull: false;
|
|
177
|
+
hasDefault: false;
|
|
178
|
+
isPrimaryKey: false;
|
|
179
|
+
isAutoincrement: false;
|
|
180
|
+
hasRuntimeDefault: false;
|
|
181
|
+
enumValues: [string, ...string[]];
|
|
182
|
+
baseColumn: never;
|
|
183
|
+
identity: undefined;
|
|
184
|
+
generated: undefined;
|
|
185
|
+
}, {}, {}>;
|
|
186
|
+
createdAt: import("drizzle-orm/pg-core").PgColumn<{
|
|
187
|
+
name: "created_at";
|
|
188
|
+
tableName: "channel_availability_push_intents";
|
|
189
|
+
dataType: "date";
|
|
190
|
+
columnType: "PgTimestamp";
|
|
191
|
+
data: Date;
|
|
192
|
+
driverParam: string;
|
|
193
|
+
notNull: true;
|
|
194
|
+
hasDefault: true;
|
|
195
|
+
isPrimaryKey: false;
|
|
196
|
+
isAutoincrement: false;
|
|
197
|
+
hasRuntimeDefault: false;
|
|
198
|
+
enumValues: undefined;
|
|
199
|
+
baseColumn: never;
|
|
200
|
+
identity: undefined;
|
|
201
|
+
generated: undefined;
|
|
202
|
+
}, {}, {}>;
|
|
203
|
+
updatedAt: import("drizzle-orm/pg-core").PgColumn<{
|
|
204
|
+
name: "updated_at";
|
|
205
|
+
tableName: "channel_availability_push_intents";
|
|
206
|
+
dataType: "date";
|
|
207
|
+
columnType: "PgTimestamp";
|
|
208
|
+
data: Date;
|
|
209
|
+
driverParam: string;
|
|
210
|
+
notNull: true;
|
|
211
|
+
hasDefault: true;
|
|
212
|
+
isPrimaryKey: false;
|
|
213
|
+
isAutoincrement: false;
|
|
214
|
+
hasRuntimeDefault: false;
|
|
215
|
+
enumValues: undefined;
|
|
216
|
+
baseColumn: never;
|
|
217
|
+
identity: undefined;
|
|
218
|
+
generated: undefined;
|
|
219
|
+
}, {}, {}>;
|
|
220
|
+
};
|
|
221
|
+
dialect: "pg";
|
|
222
|
+
}>;
|
|
223
|
+
export declare const channelContentPushIntents: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
224
|
+
name: "channel_content_push_intents";
|
|
225
|
+
schema: undefined;
|
|
226
|
+
columns: {
|
|
227
|
+
id: import("drizzle-orm/pg-core").PgColumn<{
|
|
228
|
+
name: string;
|
|
229
|
+
tableName: "channel_content_push_intents";
|
|
230
|
+
dataType: "string";
|
|
231
|
+
columnType: "PgText";
|
|
232
|
+
data: string;
|
|
233
|
+
driverParam: string;
|
|
234
|
+
notNull: true;
|
|
235
|
+
hasDefault: true;
|
|
236
|
+
isPrimaryKey: true;
|
|
237
|
+
isAutoincrement: false;
|
|
238
|
+
hasRuntimeDefault: true;
|
|
239
|
+
enumValues: [string, ...string[]];
|
|
240
|
+
baseColumn: never;
|
|
241
|
+
identity: undefined;
|
|
242
|
+
generated: undefined;
|
|
243
|
+
}, {}, {}>;
|
|
244
|
+
channelId: import("drizzle-orm/pg-core").PgColumn<{
|
|
245
|
+
name: string;
|
|
246
|
+
tableName: "channel_content_push_intents";
|
|
247
|
+
dataType: "string";
|
|
248
|
+
columnType: "PgText";
|
|
249
|
+
data: string;
|
|
250
|
+
driverParam: string;
|
|
251
|
+
notNull: true;
|
|
252
|
+
hasDefault: false;
|
|
253
|
+
isPrimaryKey: false;
|
|
254
|
+
isAutoincrement: false;
|
|
255
|
+
hasRuntimeDefault: false;
|
|
256
|
+
enumValues: [string, ...string[]];
|
|
257
|
+
baseColumn: never;
|
|
258
|
+
identity: undefined;
|
|
259
|
+
generated: undefined;
|
|
260
|
+
}, {}, {}>;
|
|
261
|
+
sourceConnectionId: import("drizzle-orm/pg-core").PgColumn<{
|
|
262
|
+
name: "source_connection_id";
|
|
263
|
+
tableName: "channel_content_push_intents";
|
|
264
|
+
dataType: "string";
|
|
265
|
+
columnType: "PgText";
|
|
266
|
+
data: string;
|
|
267
|
+
driverParam: string;
|
|
268
|
+
notNull: true;
|
|
269
|
+
hasDefault: false;
|
|
270
|
+
isPrimaryKey: false;
|
|
271
|
+
isAutoincrement: false;
|
|
272
|
+
hasRuntimeDefault: false;
|
|
273
|
+
enumValues: [string, ...string[]];
|
|
274
|
+
baseColumn: never;
|
|
275
|
+
identity: undefined;
|
|
276
|
+
generated: undefined;
|
|
277
|
+
}, {}, {}>;
|
|
278
|
+
productId: import("drizzle-orm/pg-core").PgColumn<{
|
|
279
|
+
name: "product_id";
|
|
280
|
+
tableName: "channel_content_push_intents";
|
|
281
|
+
dataType: "string";
|
|
282
|
+
columnType: "PgText";
|
|
283
|
+
data: string;
|
|
284
|
+
driverParam: string;
|
|
285
|
+
notNull: true;
|
|
286
|
+
hasDefault: false;
|
|
287
|
+
isPrimaryKey: false;
|
|
288
|
+
isAutoincrement: false;
|
|
289
|
+
hasRuntimeDefault: false;
|
|
290
|
+
enumValues: [string, ...string[]];
|
|
291
|
+
baseColumn: never;
|
|
292
|
+
identity: undefined;
|
|
293
|
+
generated: undefined;
|
|
294
|
+
}, {}, {}>;
|
|
295
|
+
requestedAt: import("drizzle-orm/pg-core").PgColumn<{
|
|
296
|
+
name: "requested_at";
|
|
297
|
+
tableName: "channel_content_push_intents";
|
|
298
|
+
dataType: "date";
|
|
299
|
+
columnType: "PgTimestamp";
|
|
300
|
+
data: Date;
|
|
301
|
+
driverParam: string;
|
|
302
|
+
notNull: true;
|
|
303
|
+
hasDefault: true;
|
|
304
|
+
isPrimaryKey: false;
|
|
305
|
+
isAutoincrement: false;
|
|
306
|
+
hasRuntimeDefault: false;
|
|
307
|
+
enumValues: undefined;
|
|
308
|
+
baseColumn: never;
|
|
309
|
+
identity: undefined;
|
|
310
|
+
generated: undefined;
|
|
311
|
+
}, {}, {}>;
|
|
312
|
+
attempts: import("drizzle-orm/pg-core").PgColumn<{
|
|
313
|
+
name: "attempts";
|
|
314
|
+
tableName: "channel_content_push_intents";
|
|
315
|
+
dataType: "number";
|
|
316
|
+
columnType: "PgInteger";
|
|
317
|
+
data: number;
|
|
318
|
+
driverParam: string | number;
|
|
319
|
+
notNull: true;
|
|
320
|
+
hasDefault: true;
|
|
321
|
+
isPrimaryKey: false;
|
|
322
|
+
isAutoincrement: false;
|
|
323
|
+
hasRuntimeDefault: false;
|
|
324
|
+
enumValues: undefined;
|
|
325
|
+
baseColumn: never;
|
|
326
|
+
identity: undefined;
|
|
327
|
+
generated: undefined;
|
|
328
|
+
}, {}, {}>;
|
|
329
|
+
lastError: import("drizzle-orm/pg-core").PgColumn<{
|
|
330
|
+
name: "last_error";
|
|
331
|
+
tableName: "channel_content_push_intents";
|
|
332
|
+
dataType: "string";
|
|
333
|
+
columnType: "PgText";
|
|
334
|
+
data: string;
|
|
335
|
+
driverParam: string;
|
|
336
|
+
notNull: false;
|
|
337
|
+
hasDefault: false;
|
|
338
|
+
isPrimaryKey: false;
|
|
339
|
+
isAutoincrement: false;
|
|
340
|
+
hasRuntimeDefault: false;
|
|
341
|
+
enumValues: [string, ...string[]];
|
|
342
|
+
baseColumn: never;
|
|
343
|
+
identity: undefined;
|
|
344
|
+
generated: undefined;
|
|
345
|
+
}, {}, {}>;
|
|
346
|
+
createdAt: import("drizzle-orm/pg-core").PgColumn<{
|
|
347
|
+
name: "created_at";
|
|
348
|
+
tableName: "channel_content_push_intents";
|
|
349
|
+
dataType: "date";
|
|
350
|
+
columnType: "PgTimestamp";
|
|
351
|
+
data: Date;
|
|
352
|
+
driverParam: string;
|
|
353
|
+
notNull: true;
|
|
354
|
+
hasDefault: true;
|
|
355
|
+
isPrimaryKey: false;
|
|
356
|
+
isAutoincrement: false;
|
|
357
|
+
hasRuntimeDefault: false;
|
|
358
|
+
enumValues: undefined;
|
|
359
|
+
baseColumn: never;
|
|
360
|
+
identity: undefined;
|
|
361
|
+
generated: undefined;
|
|
362
|
+
}, {}, {}>;
|
|
363
|
+
updatedAt: import("drizzle-orm/pg-core").PgColumn<{
|
|
364
|
+
name: "updated_at";
|
|
365
|
+
tableName: "channel_content_push_intents";
|
|
366
|
+
dataType: "date";
|
|
367
|
+
columnType: "PgTimestamp";
|
|
368
|
+
data: Date;
|
|
369
|
+
driverParam: string;
|
|
370
|
+
notNull: true;
|
|
371
|
+
hasDefault: true;
|
|
372
|
+
isPrimaryKey: false;
|
|
373
|
+
isAutoincrement: false;
|
|
374
|
+
hasRuntimeDefault: false;
|
|
375
|
+
enumValues: undefined;
|
|
376
|
+
baseColumn: never;
|
|
377
|
+
identity: undefined;
|
|
378
|
+
generated: undefined;
|
|
379
|
+
}, {}, {}>;
|
|
380
|
+
};
|
|
381
|
+
dialect: "pg";
|
|
382
|
+
}>;
|
|
383
|
+
export type ChannelAvailabilityPushIntent = typeof channelAvailabilityPushIntents.$inferSelect;
|
|
384
|
+
export type NewChannelAvailabilityPushIntent = typeof channelAvailabilityPushIntents.$inferInsert;
|
|
385
|
+
export type ChannelContentPushIntent = typeof channelContentPushIntents.$inferSelect;
|
|
386
|
+
export type NewChannelContentPushIntent = typeof channelContentPushIntents.$inferInsert;
|
|
387
|
+
//# sourceMappingURL=schema-push-intents.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-push-intents.d.ts","sourceRoot":"","sources":["../src/schema-push-intents.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;GAUG;AAEH,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8C1C,CAAA;AAED,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuBrC,CAAA;AAED,MAAM,MAAM,6BAA6B,GAAG,OAAO,8BAA8B,CAAC,YAAY,CAAA;AAC9F,MAAM,MAAM,gCAAgC,GAAG,OAAO,8BAA8B,CAAC,YAAY,CAAA;AACjG,MAAM,MAAM,wBAAwB,GAAG,OAAO,yBAAyB,CAAC,YAAY,CAAA;AACpF,MAAM,MAAM,2BAA2B,GAAG,OAAO,yBAAyB,CAAC,YAAY,CAAA"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { typeId, typeIdRef } from "@voyantjs/db/lib/typeid-column";
|
|
2
|
+
import { index, integer, pgTable, text, timestamp, uniqueIndex } from "drizzle-orm/pg-core";
|
|
3
|
+
import { channels } from "./schema-core";
|
|
4
|
+
/**
|
|
5
|
+
* Durable handoff rows for the channel-push availability and content
|
|
6
|
+
* flows. Subscribers INSERT into these tables (returning immediately
|
|
7
|
+
* per the EventBus contract); the scheduled push workflows drain them.
|
|
8
|
+
*
|
|
9
|
+
* Booking push doesn't need its own intent table — `channel_booking_links`
|
|
10
|
+
* already serves both roles (push_status = 'pending' for in-flight,
|
|
11
|
+
* 'ok' on success).
|
|
12
|
+
*
|
|
13
|
+
* Per docs/architecture/channel-push-architecture.md §7.3 and §12.
|
|
14
|
+
*/
|
|
15
|
+
export const channelAvailabilityPushIntents = pgTable("channel_availability_push_intents", {
|
|
16
|
+
id: typeId("channel_availability_push_intents"),
|
|
17
|
+
channelId: typeIdRef("channel_id")
|
|
18
|
+
.notNull()
|
|
19
|
+
.references(() => channels.id, { onDelete: "cascade" }),
|
|
20
|
+
/**
|
|
21
|
+
* Connection id resolving to a registered SourceAdapter. Subscriber
|
|
22
|
+
* reads it from the resolved channel mapping at insert time so the
|
|
23
|
+
* worker doesn't need to re-resolve.
|
|
24
|
+
*/
|
|
25
|
+
sourceConnectionId: text("source_connection_id").notNull(),
|
|
26
|
+
/** Slot id (typeid). Plain text to avoid cross-package FK. */
|
|
27
|
+
slotId: text("slot_id").notNull(),
|
|
28
|
+
/** Product id (typeid). Plain text to avoid cross-package FK. */
|
|
29
|
+
productId: text("product_id").notNull(),
|
|
30
|
+
/** Optional option id when the channel allotment is option-scoped. */
|
|
31
|
+
optionId: text("option_id"),
|
|
32
|
+
/** Slot start time, mirrored from the source event. Diagnostic. */
|
|
33
|
+
startsAt: timestamp("starts_at", { withTimezone: true }).notNull(),
|
|
34
|
+
/**
|
|
35
|
+
* Time the most recent supersession event landed for this
|
|
36
|
+
* (channel, slot) pair. Workers scan oldest-first; the unique
|
|
37
|
+
* constraint below collapses concurrent events to one row, so
|
|
38
|
+
* this is bumped on every UPSERT.
|
|
39
|
+
*/
|
|
40
|
+
requestedAt: timestamp("requested_at", { withTimezone: true }).notNull().defaultNow(),
|
|
41
|
+
/** Number of dispatch attempts so far. */
|
|
42
|
+
attempts: integer("attempts").notNull().default(0),
|
|
43
|
+
/** Most recent error from the last failed attempt. */
|
|
44
|
+
lastError: text("last_error"),
|
|
45
|
+
createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
|
|
46
|
+
updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow(),
|
|
47
|
+
}, (table) => [
|
|
48
|
+
index("idx_chan_avail_push_intents_requested").on(table.channelId, table.requestedAt),
|
|
49
|
+
index("idx_chan_avail_push_intents_product").on(table.productId, table.requestedAt),
|
|
50
|
+
/**
|
|
51
|
+
* Supersession key. Concurrent slot.changed events for the same
|
|
52
|
+
* (channel, slot) collapse to one row — the worker reads the
|
|
53
|
+
* *current* slot state when it processes, so stale event payloads
|
|
54
|
+
* never propagate. Per §5.2.
|
|
55
|
+
*/
|
|
56
|
+
uniqueIndex("uniq_chan_avail_push_intents_per_slot").on(table.channelId, table.slotId),
|
|
57
|
+
]);
|
|
58
|
+
export const channelContentPushIntents = pgTable("channel_content_push_intents", {
|
|
59
|
+
id: typeId("channel_content_push_intents"),
|
|
60
|
+
channelId: typeIdRef("channel_id")
|
|
61
|
+
.notNull()
|
|
62
|
+
.references(() => channels.id, { onDelete: "cascade" }),
|
|
63
|
+
sourceConnectionId: text("source_connection_id").notNull(),
|
|
64
|
+
productId: text("product_id").notNull(),
|
|
65
|
+
requestedAt: timestamp("requested_at", { withTimezone: true }).notNull().defaultNow(),
|
|
66
|
+
attempts: integer("attempts").notNull().default(0),
|
|
67
|
+
lastError: text("last_error"),
|
|
68
|
+
createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
|
|
69
|
+
updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow(),
|
|
70
|
+
}, (table) => [
|
|
71
|
+
index("idx_chan_content_push_intents_requested").on(table.channelId, table.requestedAt),
|
|
72
|
+
/**
|
|
73
|
+
* Supersession key. Concurrent product.content.changed events
|
|
74
|
+
* collapse to one row per (channel, product). Per §6.2.
|
|
75
|
+
*/
|
|
76
|
+
uniqueIndex("uniq_chan_content_push_intents_per_product").on(table.channelId, table.productId),
|
|
77
|
+
]);
|
package/dist/schema.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export * from "./schema-automation";
|
|
|
3
3
|
export * from "./schema-core";
|
|
4
4
|
export * from "./schema-finance";
|
|
5
5
|
export * from "./schema-inventory";
|
|
6
|
+
export * from "./schema-push-intents";
|
|
6
7
|
export * from "./schema-relations";
|
|
7
8
|
export * from "./schema-shared";
|
|
8
9
|
//# sourceMappingURL=schema.d.ts.map
|
package/dist/schema.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../src/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAA;AACzF,cAAc,qBAAqB,CAAA;AACnC,cAAc,eAAe,CAAA;AAC7B,cAAc,kBAAkB,CAAA;AAChC,cAAc,oBAAoB,CAAA;AAClC,cAAc,oBAAoB,CAAA;AAClC,cAAc,iBAAiB,CAAA"}
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../src/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAA;AACzF,cAAc,qBAAqB,CAAA;AACnC,cAAc,eAAe,CAAA;AAC7B,cAAc,kBAAkB,CAAA;AAChC,cAAc,oBAAoB,CAAA;AAClC,cAAc,uBAAuB,CAAA;AACrC,cAAc,oBAAoB,CAAA;AAClC,cAAc,iBAAiB,CAAA"}
|
package/dist/schema.js
CHANGED