@foundrynorth/compass-schema 1.0.11 → 1.0.13
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/README.md +43 -0
- package/dist/schema.d.ts +286 -0
- package/dist/schema.d.ts.map +1 -1
- package/dist/schema.js +34 -0
- package/dist/schema.js.map +1 -1
- package/package.json +1 -1
- package/src/schema.ts +47 -0
package/package.json
CHANGED
package/src/schema.ts
CHANGED
|
@@ -4643,6 +4643,7 @@ export const mediaOrders = pgTable(
|
|
|
4643
4643
|
index("media_orders_plan_id_idx").on(table.planId),
|
|
4644
4644
|
index("media_orders_engagement_id_idx").on(table.engagementId),
|
|
4645
4645
|
index("media_orders_partner_id_idx").on(table.partnerId),
|
|
4646
|
+
index("media_orders_hubspot_company_id_idx").on(table.hubspotCompanyId),
|
|
4646
4647
|
index("media_orders_status_idx").on(table.status),
|
|
4647
4648
|
index("media_orders_vendor_id_idx").on(table.vendorId),
|
|
4648
4649
|
index("media_orders_vendor_fulfillment_status_idx").on(table.vendorFulfillmentStatus),
|
|
@@ -5638,6 +5639,8 @@ export const presentationDecks = pgTable(
|
|
|
5638
5639
|
acceptedAt: timestamp("accepted_at"),
|
|
5639
5640
|
htmlContent: text("html_content"),
|
|
5640
5641
|
engagementId: text("engagement_id"),
|
|
5642
|
+
// AI deck planner blueprint — stores the DeckBlueprint that shaped slide selection/ordering
|
|
5643
|
+
blueprintJson: jsonb("blueprint_json").$type<Record<string, any>>(),
|
|
5641
5644
|
},
|
|
5642
5645
|
(table) => [
|
|
5643
5646
|
index("presentation_decks_plan_id_idx").on(table.planId),
|
|
@@ -7956,3 +7959,47 @@ export const semCampaigns = pgTable(
|
|
|
7956
7959
|
|
|
7957
7960
|
export type SemCampaignRecord = typeof semCampaigns.$inferSelect;
|
|
7958
7961
|
export type InsertSemCampaign = typeof semCampaigns.$inferInsert;
|
|
7962
|
+
|
|
7963
|
+
// =============================================================================
|
|
7964
|
+
// COMPASS EVENT OUTBOX (dead-letter queue for fn-flux webhook events)
|
|
7965
|
+
// =============================================================================
|
|
7966
|
+
|
|
7967
|
+
export const compassEventOutboxStatusEnum = pgEnum("compass_event_outbox_status", [
|
|
7968
|
+
"pending",
|
|
7969
|
+
"failed",
|
|
7970
|
+
"delivered",
|
|
7971
|
+
"dead_letter",
|
|
7972
|
+
]);
|
|
7973
|
+
|
|
7974
|
+
export const compassEventOutbox = pgTable(
|
|
7975
|
+
"compass_event_outbox",
|
|
7976
|
+
{
|
|
7977
|
+
id: text("id").primaryKey(), // UUID
|
|
7978
|
+
eventId: text("event_id").notNull(),
|
|
7979
|
+
eventType: text("event_type").notNull(),
|
|
7980
|
+
idempotencyKey: text("idempotency_key").notNull().unique(),
|
|
7981
|
+
emittedAt: timestamp("emitted_at").notNull(),
|
|
7982
|
+
actorUserId: text("actor_user_id"),
|
|
7983
|
+
actorUsername: text("actor_username"),
|
|
7984
|
+
payload: jsonb("payload").notNull().$type<Record<string, unknown>>(),
|
|
7985
|
+
deliveryStatus: compassEventOutboxStatusEnum("delivery_status")
|
|
7986
|
+
.notNull()
|
|
7987
|
+
.default("pending"),
|
|
7988
|
+
attemptCount: integer("attempt_count").notNull().default(0),
|
|
7989
|
+
nextAttemptAt: timestamp("next_attempt_at").notNull().defaultNow(),
|
|
7990
|
+
deliveredAt: timestamp("delivered_at"),
|
|
7991
|
+
lastError: text("last_error"),
|
|
7992
|
+
createdAt: timestamp("created_at").notNull().defaultNow(),
|
|
7993
|
+
updatedAt: timestamp("updated_at").notNull().defaultNow(),
|
|
7994
|
+
},
|
|
7995
|
+
(table) => [
|
|
7996
|
+
index("compass_event_outbox_pending_idx").on(
|
|
7997
|
+
table.deliveryStatus,
|
|
7998
|
+
table.nextAttemptAt
|
|
7999
|
+
),
|
|
8000
|
+
index("compass_event_outbox_event_type_idx").on(table.eventType),
|
|
8001
|
+
]
|
|
8002
|
+
);
|
|
8003
|
+
|
|
8004
|
+
export type CompassEventOutboxRecord = typeof compassEventOutbox.$inferSelect;
|
|
8005
|
+
export type InsertCompassEventOutbox = typeof compassEventOutbox.$inferInsert;
|