@headless-lms/adapter-db 0.3.0 → 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.d.ts +8 -2
- package/dist/client.js +10 -2
- package/dist/client.js.map +1 -1
- package/dist/index.d.ts +10 -4
- package/dist/index.js +9 -3
- package/dist/repositories/admin.d.ts +12 -4
- package/dist/repositories/admin.js +165 -23
- package/dist/repositories/admin.js.map +1 -1
- package/dist/repositories/assets.d.ts +2 -2
- package/dist/repositories/assets.js +11 -5
- package/dist/repositories/assets.js.map +1 -1
- package/dist/repositories/automations.d.ts +0 -1
- package/dist/repositories/automations.js +2 -18
- package/dist/repositories/automations.js.map +1 -1
- package/dist/repositories/chats.d.ts +14 -5
- package/dist/repositories/chats.js +194 -85
- package/dist/repositories/chats.js.map +1 -1
- package/dist/repositories/content.d.ts +24 -7
- package/dist/repositories/content.js +229 -48
- package/dist/repositories/content.js.map +1 -1
- package/dist/repositories/credentials.js +1 -1
- package/dist/repositories/devices.d.ts +17 -0
- package/dist/repositories/devices.js +75 -0
- package/dist/repositories/devices.js.map +1 -0
- package/dist/repositories/digest-runs.d.ts +14 -0
- package/dist/repositories/digest-runs.js +39 -0
- package/dist/repositories/digest-runs.js.map +1 -0
- package/dist/repositories/discussion.d.ts +7 -2
- package/dist/repositories/discussion.js +18 -7
- package/dist/repositories/discussion.js.map +1 -1
- package/dist/repositories/entitlements.d.ts +11 -9
- package/dist/repositories/entitlements.js +56 -59
- package/dist/repositories/entitlements.js.map +1 -1
- package/dist/repositories/event-reports.d.ts +16 -0
- package/dist/repositories/event-reports.js +199 -0
- package/dist/repositories/event-reports.js.map +1 -0
- package/dist/repositories/grant-covers.d.ts +4 -3
- package/dist/repositories/grant-covers.js +7 -4
- package/dist/repositories/grant-covers.js.map +1 -1
- package/dist/repositories/identity.js +1 -1
- package/dist/repositories/inserted-row.d.ts +5 -0
- package/dist/repositories/inserted-row.js +7 -0
- package/dist/repositories/inserted-row.js.map +1 -0
- package/dist/repositories/integrations.js +1 -1
- package/dist/repositories/member.d.ts +12 -4
- package/dist/repositories/member.js +19 -7
- package/dist/repositories/member.js.map +1 -1
- package/dist/repositories/members.d.ts +2 -5
- package/dist/repositories/members.js +39 -94
- package/dist/repositories/members.js.map +1 -1
- package/dist/repositories/mentions.d.ts +17 -0
- package/dist/repositories/mentions.js +55 -0
- package/dist/repositories/mentions.js.map +1 -0
- package/dist/repositories/notification-settings.d.ts +19 -0
- package/dist/repositories/notification-settings.js +67 -0
- package/dist/repositories/notification-settings.js.map +1 -0
- package/dist/repositories/notifications.d.ts +23 -16
- package/dist/repositories/notifications.js +152 -44
- package/dist/repositories/notifications.js.map +1 -1
- package/dist/repositories/org-user-profile.d.ts +0 -17
- package/dist/repositories/org-user-profile.js +0 -1
- package/dist/repositories/org-user-profile.js.map +1 -1
- package/dist/repositories/organizations.d.ts +4 -4
- package/dist/repositories/organizations.js +25 -47
- package/dist/repositories/organizations.js.map +1 -1
- package/dist/repositories/outbox.d.ts +5 -1
- package/dist/repositories/outbox.js +12 -3
- package/dist/repositories/outbox.js.map +1 -1
- package/dist/repositories/posts.d.ts +4 -8
- package/dist/repositories/posts.js +26 -29
- package/dist/repositories/posts.js.map +1 -1
- package/dist/repositories/progress.js +1 -1
- package/dist/repositories/roles.d.ts +35 -0
- package/dist/repositories/roles.js +244 -0
- package/dist/repositories/roles.js.map +1 -0
- package/dist/repositories/settings.js +1 -1
- package/dist/repositories/subscriptions.d.ts +18 -0
- package/dist/repositories/subscriptions.js +72 -0
- package/dist/repositories/subscriptions.js.map +1 -0
- package/dist/schema/assets.d.ts +17 -0
- package/dist/schema/assets.js +1 -0
- package/dist/schema/assets.js.map +1 -1
- package/dist/schema/automations.d.ts +524 -19
- package/dist/schema/automations.js +73 -7
- package/dist/schema/automations.js.map +1 -1
- package/dist/schema/content.d.ts +437 -3
- package/dist/schema/content.js +70 -3
- package/dist/schema/content.js.map +1 -1
- package/dist/schema/discussion.d.ts +295 -128
- package/dist/schema/discussion.js +63 -26
- package/dist/schema/discussion.js.map +1 -1
- package/dist/schema/identity.d.ts +109 -109
- package/dist/schema/identity.js +28 -70
- package/dist/schema/identity.js.map +1 -1
- package/dist/schema/index.d.ts +7 -6
- package/dist/schema/index.js +16 -7
- package/dist/schema/index.js.map +1 -1
- package/dist/schema/organizations.d.ts +5 -22
- package/dist/schema/organizations.js +1 -13
- package/dist/schema/organizations.js.map +1 -1
- package/dist/schema/roles.d.ts +369 -0
- package/dist/schema/roles.js +71 -0
- package/dist/schema/roles.js.map +1 -0
- package/drizzle/0011_digest_runs.sql +8 -0
- package/drizzle/0012_subscriptions.sql +16 -0
- package/drizzle/0013_mentions.sql +10 -0
- package/drizzle/0014_notification_settings_devices.sql +36 -0
- package/drizzle/0015_automations_drop_source.sql +2 -0
- package/drizzle/0016_notifications_automations.sql +48 -0
- package/drizzle/0017_configurable_roles.sql +38 -0
- package/drizzle/0018_messages_client_id.sql +2 -0
- package/drizzle/0019_events.sql +44 -0
- package/drizzle/meta/0011_snapshot.json +8868 -0
- package/drizzle/meta/0012_snapshot.json +8873 -0
- package/drizzle/meta/0013_snapshot.json +8943 -0
- package/drizzle/meta/0014_snapshot.json +9305 -0
- package/drizzle/meta/0015_snapshot.json +9270 -0
- package/drizzle/meta/0016_snapshot.json +9230 -0
- package/drizzle/meta/0017_snapshot.json +9518 -0
- package/drizzle/meta/0018_snapshot.json +9557 -0
- package/drizzle/meta/0019_snapshot.json +9919 -0
- package/drizzle/meta/_journal.json +63 -0
- package/package.json +2 -2
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { communities, spaces } from "./content.js";
|
|
2
|
+
import { orgUsers, organizations } from "./organizations.js";
|
|
3
|
+
import { desc, sql } from "drizzle-orm";
|
|
4
|
+
import { boolean, foreignKey, index, jsonb, pgTable, primaryKey, text, timestamp, uniqueIndex } from "drizzle-orm/pg-core";
|
|
4
5
|
import { genId } from "@headless-lms/core/shared/id";
|
|
5
6
|
//#region src/schema/automations.ts
|
|
6
7
|
const automations = pgTable("automations", {
|
|
@@ -13,13 +14,11 @@ const automations = pgTable("automations", {
|
|
|
13
14
|
actions: jsonb("actions").$type().notNull(),
|
|
14
15
|
enabled: boolean("enabled").notNull().default(true),
|
|
15
16
|
filter: jsonb("filter").$type(),
|
|
16
|
-
source: text("source", { enum: ["system", "user"] }).notNull().default("user"),
|
|
17
17
|
createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
|
|
18
18
|
updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow().$onUpdate(() => /* @__PURE__ */ new Date())
|
|
19
19
|
}, (t) => ({
|
|
20
20
|
pk: primaryKey({ columns: [t.orgId, t.id] }),
|
|
21
|
-
triggersIdx: index("automations_triggers_idx").using("gin", t.triggers)
|
|
22
|
-
systemSeedIdx: uniqueIndex("automations_system_seed_idx").on(t.orgId, t.name, sql`coalesce(${t.filter}->>'communityId', '')`).where(sql`${t.source} = 'system'`)
|
|
21
|
+
triggersIdx: index("automations_triggers_idx").using("gin", t.triggers)
|
|
23
22
|
}));
|
|
24
23
|
const automationRuns = pgTable("automation_runs", {
|
|
25
24
|
orgId: text("org_id").notNull().references(() => organizations.id),
|
|
@@ -43,7 +42,74 @@ const automationRuns = pgTable("automation_runs", {
|
|
|
43
42
|
automationIdx: index("automation_runs_org_automation_idx").on(t.orgId, t.automationId),
|
|
44
43
|
eventDedupeIdx: uniqueIndex("automation_runs_org_automation_event_idx").on(t.orgId, t.automationId, t.eventId)
|
|
45
44
|
}));
|
|
45
|
+
const notifications = pgTable("notifications", {
|
|
46
|
+
orgId: text("org_id").notNull(),
|
|
47
|
+
id: text("id").notNull().$defaultFn(() => genId("notification")),
|
|
48
|
+
userId: text("user_id").notNull(),
|
|
49
|
+
sourceEventId: text("source_event_id"),
|
|
50
|
+
type: text("type").notNull(),
|
|
51
|
+
scope: text("scope", { enum: [
|
|
52
|
+
"org",
|
|
53
|
+
"community",
|
|
54
|
+
"space",
|
|
55
|
+
"chat"
|
|
56
|
+
] }).notNull(),
|
|
57
|
+
reasons: text("reasons").array().$type().notNull(),
|
|
58
|
+
matchedReason: text("matched_reason").$type().notNull(),
|
|
59
|
+
category: text("category").notNull(),
|
|
60
|
+
communityId: text("community_id"),
|
|
61
|
+
spaceId: text("space_id"),
|
|
62
|
+
actorId: text("actor_id"),
|
|
63
|
+
subjectType: text("subject_type"),
|
|
64
|
+
subjectId: text("subject_id"),
|
|
65
|
+
parentType: text("parent_type"),
|
|
66
|
+
parentId: text("parent_id"),
|
|
67
|
+
display: jsonb("display").$type().notNull(),
|
|
68
|
+
inApp: boolean("in_app").notNull(),
|
|
69
|
+
createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
|
|
70
|
+
readAt: timestamp("read_at", { withTimezone: true })
|
|
71
|
+
}, (t) => ({
|
|
72
|
+
pk: primaryKey({ columns: [t.orgId, t.id] }),
|
|
73
|
+
userFk: foreignKey({
|
|
74
|
+
columns: [t.orgId, t.userId],
|
|
75
|
+
foreignColumns: [orgUsers.orgId, orgUsers.userId]
|
|
76
|
+
}).onDelete("cascade"),
|
|
77
|
+
communityFk: foreignKey({
|
|
78
|
+
columns: [t.orgId, t.communityId],
|
|
79
|
+
foreignColumns: [communities.orgId, communities.id]
|
|
80
|
+
}).onDelete("cascade"),
|
|
81
|
+
spaceFk: foreignKey({
|
|
82
|
+
columns: [t.orgId, t.spaceId],
|
|
83
|
+
foreignColumns: [spaces.orgId, spaces.id]
|
|
84
|
+
}).onDelete("cascade"),
|
|
85
|
+
sourceIdx: uniqueIndex("notifications_source_event_idx").on(t.orgId, t.sourceEventId, t.userId, sql`coalesce(${t.communityId}, '')`).where(sql`${t.sourceEventId} is not null`),
|
|
86
|
+
listIdx: index("notifications_list_idx").on(t.orgId, t.userId, desc(t.createdAt), desc(t.id)).where(sql`${t.inApp}`),
|
|
87
|
+
communityIdx: index("notifications_community_idx").on(t.orgId, t.userId, t.communityId),
|
|
88
|
+
categoryIdx: index("notifications_category_idx").on(t.orgId, t.userId, t.category),
|
|
89
|
+
reasonsIdx: index("notifications_reasons_idx").using("gin", t.reasons)
|
|
90
|
+
}));
|
|
91
|
+
const notificationDeliveries = pgTable("notification_deliveries", {
|
|
92
|
+
orgId: text("org_id").notNull(),
|
|
93
|
+
id: text("id").notNull().$defaultFn(() => genId("notificationDelivery")),
|
|
94
|
+
notificationId: text("notification_id").notNull(),
|
|
95
|
+
channel: text("channel").notNull(),
|
|
96
|
+
status: text("status", { enum: [
|
|
97
|
+
"pending",
|
|
98
|
+
"sent",
|
|
99
|
+
"failed"
|
|
100
|
+
] }).notNull().default("pending"),
|
|
101
|
+
lastError: text("last_error"),
|
|
102
|
+
createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
|
|
103
|
+
sentAt: timestamp("sent_at", { withTimezone: true })
|
|
104
|
+
}, (t) => ({
|
|
105
|
+
pk: primaryKey({ columns: [t.orgId, t.id] }),
|
|
106
|
+
notificationFk: foreignKey({
|
|
107
|
+
columns: [t.orgId, t.notificationId],
|
|
108
|
+
foreignColumns: [notifications.orgId, notifications.id]
|
|
109
|
+
}).onDelete("cascade"),
|
|
110
|
+
channelIdx: uniqueIndex("notification_deliveries_channel_idx").on(t.orgId, t.notificationId, t.channel)
|
|
111
|
+
}));
|
|
46
112
|
//#endregion
|
|
47
|
-
export { automationRuns, automations };
|
|
113
|
+
export { automationRuns, automations, notificationDeliveries, notifications };
|
|
48
114
|
|
|
49
115
|
//# sourceMappingURL=automations.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"automations.js","names":[],"sources":["../../src/schema/automations.ts"],"sourcesContent":["// automations tables — org-scoped automation definitions and their run\n// history. `automations.actions` and `automation_runs.action_results` are\n// ordered jsonb blobs (contract types owned by @headless-lms/core/types); a run's\n// `event` is the triggering DomainEvent snapshot, stored verbatim.\nimport {\n pgTable,\n text,\n boolean,\n jsonb,\n timestamp,\n primaryKey,\n index,\n uniqueIndex,\n} from \"drizzle-orm/pg-core\";\nimport { sql } from \"drizzle-orm\";\nimport { genId } from \"@headless-lms/core/shared/id\";\nimport { organizations } from \"./organizations.js\";\nimport type {\n Automation,\n AutomationAction,\n AutomationActionResult,\n AutomationRun,\n} from \"@headless-lms/core/schemas\";\nimport type { DomainEvent } from \"@headless-lms/core/shared/ports\";\nimport type { Expect, NoDrift } from \"./drift.js\";\n\nexport const automations = pgTable(\n \"automations\",\n {\n orgId: text(\"org_id\")\n .notNull()\n .references(() => organizations.id),\n id: text(\"id\")\n .notNull()\n .$defaultFn(() => genId(\"automation\")),\n name: text(\"name\").notNull(),\n kind: text(\"kind\", { enum: [\"workflow\", \"webhook\"] })\n .notNull()\n .default(\"workflow\"),\n description: text(\"description\"),\n triggers: text(\"triggers\").array().notNull(),\n actions: jsonb(\"actions\").$type<AutomationAction[]>().notNull(),\n enabled: boolean(\"enabled\").notNull().default(true),\n filter: jsonb(\"filter\").$type<Automation[\"filter\"]>(),\n source: text(\"source\", { enum: [\"system\", \"user\"] })\n .notNull()\n .default(\"user\"),\n createdAt: timestamp(\"created_at\", { withTimezone: true }).notNull().defaultNow(),\n updatedAt: timestamp(\"updated_at\", { withTimezone: true })\n .notNull()\n .defaultNow()\n .$onUpdate(() => new Date()),\n },\n (t) => ({\n pk: primaryKey({ columns: [t.orgId, t.id] }),\n triggersIdx: index(\"automations_triggers_idx\").using(\"gin\", t.triggers),\n systemSeedIdx: uniqueIndex(\"automations_system_seed_idx\")\n .on(t.orgId, t.name, sql`coalesce(${t.filter}->>'communityId', '')`)\n .where(sql`${t.source} = 'system'`),\n }),\n);\n\nexport const automationRuns = pgTable(\n \"automation_runs\",\n {\n orgId: text(\"org_id\")\n .notNull()\n .references(() => organizations.id),\n id: text(\"id\")\n .notNull()\n .$defaultFn(() => genId(\"automationRun\")),\n automationId: text(\"automation_id\").notNull(),\n trigger: text(\"trigger\").notNull(),\n // At-least-once dedupe key for the triggering event; DB-internal, not part of the domain `AutomationRun` type.\n eventId: text(\"event_id\").notNull(),\n event: jsonb(\"event\").$type<DomainEvent>().notNull(),\n status: text(\"status\", { enum: [\"running\", \"completed\", \"failed\"] }).notNull(),\n actionResults: jsonb(\"action_results\").$type<AutomationActionResult[]>().notNull().default([]),\n startedAt: timestamp(\"started_at\", { withTimezone: true }).notNull(),\n finishedAt: timestamp(\"finished_at\", { withTimezone: true }),\n createdAt: timestamp(\"created_at\", { withTimezone: true }).notNull().defaultNow(),\n updatedAt: timestamp(\"updated_at\", { withTimezone: true })\n .notNull()\n .defaultNow()\n .$onUpdate(() => new Date()),\n },\n (t) => ({\n pk: primaryKey({ columns: [t.orgId, t.id] }),\n automationIdx: index(\"automation_runs_org_automation_idx\").on(t.orgId, t.automationId),\n eventDedupeIdx: uniqueIndex(\"automation_runs_org_automation_event_idx\").on(\n t.orgId,\n t.automationId,\n t.eventId,\n ),\n }),\n);\n\ntype _AutomationsDrift = Expect<NoDrift<typeof automations.$inferSelect, Automation>>;\ntype _AutomationRunsDrift = Expect<NoDrift<typeof automationRuns.$inferSelect, AutomationRun>>;\n"],"mappings":";;;;;AA0BA,MAAa,cAAc,QACzB,eACA;CACE,OAAO,KAAK,QAAQ,CAAC,CAClB,QAAQ,CAAC,CACT,iBAAiB,cAAc,EAAE;CACpC,IAAI,KAAK,IAAI,CAAC,CACX,QAAQ,CAAC,CACT,iBAAiB,MAAM,YAAY,CAAC;CACvC,MAAM,KAAK,MAAM,CAAC,CAAC,QAAQ;CAC3B,MAAM,KAAK,QAAQ,EAAE,MAAM,CAAC,YAAY,SAAS,EAAE,CAAC,CAAC,CAClD,QAAQ,CAAC,CACT,QAAQ,UAAU;CACrB,aAAa,KAAK,aAAa;CAC/B,UAAU,KAAK,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC,QAAQ;CAC3C,SAAS,MAAM,SAAS,CAAC,CAAC,MAA0B,CAAC,CAAC,QAAQ;CAC9D,SAAS,QAAQ,S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,CAAC,CAAC,MAAgC,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,CAAC;CAC7F,WAAW,UAAU,cAAc,EAAE,cAAc,KAAK,CAAC,CAAC,CAAC,QAAQ;CACnE,YAAY,UAAU,eAAe,EAAE,cAAc,KAAK,CAAC;CAC3D,WAAW,UAAU,cAAc,EAAE,cAAc,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,WAAW;CAChF,WAAW,UAAU,cAAc,EAAE,cAAc,KAAK,CAAC,CAAC,CACvD,QAAQ,CAAC,CACT,WAAW,CAAC,CACZ,gCAAgB,IAAI,KAAK,CAAC;AAC/B,IACC,OAAO;CACN,IAAI,WAAW,EAAE,SAAS,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;CAC3C,eAAe,MAAM,oCAAoC,CAAC,CAAC,GAAG,EAAE,OAAO,EAAE,YAAY;CACrF,gBAAgB,YAAY,0CAA0C,CAAC,CAAC,GACtE,EAAE,OACF,EAAE,cACF,EAAE,OACJ;AACF,EACF"}
|
|
1
|
+
{"version":3,"file":"automations.js","names":[],"sources":["../../src/schema/automations.ts"],"sourcesContent":["// automations tables — org-scoped automation definitions and their run\n// history. `automations.actions` and `automation_runs.action_results` are\n// ordered jsonb blobs (contract types owned by @headless-lms/core/types); a run's\n// `event` is the triggering DomainEvent snapshot, stored verbatim.\nimport {\n pgTable,\n text,\n boolean,\n jsonb,\n timestamp,\n primaryKey,\n foreignKey,\n index,\n uniqueIndex,\n} from \"drizzle-orm/pg-core\";\nimport { desc, sql } from \"drizzle-orm\";\nimport { genId } from \"@headless-lms/core/shared/id\";\nimport { organizations, orgUsers } from \"./organizations.js\";\nimport { communities, spaces } from \"./content.js\";\nimport type {\n Automation,\n AutomationAction,\n AutomationActionResult,\n AutomationRun,\n} from \"@headless-lms/core/schemas\";\nimport type { DomainEvent, JsonValue } from \"@headless-lms/core/shared/ports\";\nimport type { Reason } from \"@headless-lms/core/types\";\nimport type { Expect, NoDrift } from \"./drift.js\";\n\nexport const automations = pgTable(\n \"automations\",\n {\n orgId: text(\"org_id\")\n .notNull()\n .references(() => organizations.id),\n id: text(\"id\")\n .notNull()\n .$defaultFn(() => genId(\"automation\")),\n name: text(\"name\").notNull(),\n kind: text(\"kind\", { enum: [\"workflow\", \"webhook\"] })\n .notNull()\n .default(\"workflow\"),\n description: text(\"description\"),\n triggers: text(\"triggers\").array().notNull(),\n actions: jsonb(\"actions\").$type<AutomationAction[]>().notNull(),\n enabled: boolean(\"enabled\").notNull().default(true),\n filter: jsonb(\"filter\").$type<Automation[\"filter\"]>(),\n createdAt: timestamp(\"created_at\", { withTimezone: true }).notNull().defaultNow(),\n updatedAt: timestamp(\"updated_at\", { withTimezone: true })\n .notNull()\n .defaultNow()\n .$onUpdate(() => new Date()),\n },\n (t) => ({\n pk: primaryKey({ columns: [t.orgId, t.id] }),\n triggersIdx: index(\"automations_triggers_idx\").using(\"gin\", t.triggers),\n }),\n);\n\nexport const automationRuns = pgTable(\n \"automation_runs\",\n {\n orgId: text(\"org_id\")\n .notNull()\n .references(() => organizations.id),\n id: text(\"id\")\n .notNull()\n .$defaultFn(() => genId(\"automationRun\")),\n automationId: text(\"automation_id\").notNull(),\n trigger: text(\"trigger\").notNull(),\n // At-least-once dedupe key for the triggering event; DB-internal, not part of the domain `AutomationRun` type.\n eventId: text(\"event_id\").notNull(),\n event: jsonb(\"event\").$type<DomainEvent>().notNull(),\n status: text(\"status\", { enum: [\"running\", \"completed\", \"failed\"] }).notNull(),\n actionResults: jsonb(\"action_results\").$type<AutomationActionResult[]>().notNull().default([]),\n startedAt: timestamp(\"started_at\", { withTimezone: true }).notNull(),\n finishedAt: timestamp(\"finished_at\", { withTimezone: true }),\n createdAt: timestamp(\"created_at\", { withTimezone: true }).notNull().defaultNow(),\n updatedAt: timestamp(\"updated_at\", { withTimezone: true })\n .notNull()\n .defaultNow()\n .$onUpdate(() => new Date()),\n },\n (t) => ({\n pk: primaryKey({ columns: [t.orgId, t.id] }),\n automationIdx: index(\"automation_runs_org_automation_idx\").on(t.orgId, t.automationId),\n eventDedupeIdx: uniqueIndex(\"automation_runs_org_automation_event_idx\").on(\n t.orgId,\n t.automationId,\n t.eventId,\n ),\n }),\n);\n\nexport const notifications = pgTable(\n \"notifications\",\n {\n orgId: text(\"org_id\").notNull(),\n id: text(\"id\")\n .notNull()\n .$defaultFn(() => genId(\"notification\")),\n userId: text(\"user_id\").notNull(),\n sourceEventId: text(\"source_event_id\"),\n type: text(\"type\").notNull(),\n scope: text(\"scope\", { enum: [\"org\", \"community\", \"space\", \"chat\"] }).notNull(),\n reasons: text(\"reasons\").array().$type<Reason[]>().notNull(),\n matchedReason: text(\"matched_reason\").$type<Reason>().notNull(),\n category: text(\"category\").notNull(),\n communityId: text(\"community_id\"),\n spaceId: text(\"space_id\"),\n actorId: text(\"actor_id\"),\n subjectType: text(\"subject_type\"),\n subjectId: text(\"subject_id\"),\n parentType: text(\"parent_type\"),\n parentId: text(\"parent_id\"),\n display: jsonb(\"display\").$type<Record<string, JsonValue>>().notNull(),\n inApp: boolean(\"in_app\").notNull(),\n createdAt: timestamp(\"created_at\", { withTimezone: true }).notNull().defaultNow(),\n readAt: timestamp(\"read_at\", { withTimezone: true }),\n },\n (t) => ({\n pk: primaryKey({ columns: [t.orgId, t.id] }),\n userFk: foreignKey({\n columns: [t.orgId, t.userId],\n foreignColumns: [orgUsers.orgId, orgUsers.userId],\n }).onDelete(\"cascade\"),\n communityFk: foreignKey({\n columns: [t.orgId, t.communityId],\n foreignColumns: [communities.orgId, communities.id],\n }).onDelete(\"cascade\"),\n spaceFk: foreignKey({\n columns: [t.orgId, t.spaceId],\n foreignColumns: [spaces.orgId, spaces.id],\n }).onDelete(\"cascade\"),\n sourceIdx: uniqueIndex(\"notifications_source_event_idx\")\n .on(t.orgId, t.sourceEventId, t.userId, sql`coalesce(${t.communityId}, '')`)\n .where(sql`${t.sourceEventId} is not null`),\n listIdx: index(\"notifications_list_idx\")\n .on(t.orgId, t.userId, desc(t.createdAt), desc(t.id))\n .where(sql`${t.inApp}`),\n communityIdx: index(\"notifications_community_idx\").on(t.orgId, t.userId, t.communityId),\n categoryIdx: index(\"notifications_category_idx\").on(t.orgId, t.userId, t.category),\n reasonsIdx: index(\"notifications_reasons_idx\").using(\"gin\", t.reasons),\n }),\n);\n\nexport const notificationDeliveries = pgTable(\n \"notification_deliveries\",\n {\n orgId: text(\"org_id\").notNull(),\n id: text(\"id\")\n .notNull()\n .$defaultFn(() => genId(\"notificationDelivery\")),\n notificationId: text(\"notification_id\").notNull(),\n channel: text(\"channel\").notNull(),\n status: text(\"status\", { enum: [\"pending\", \"sent\", \"failed\"] })\n .notNull()\n .default(\"pending\"),\n lastError: text(\"last_error\"),\n createdAt: timestamp(\"created_at\", { withTimezone: true }).notNull().defaultNow(),\n sentAt: timestamp(\"sent_at\", { withTimezone: true }),\n },\n (t) => ({\n pk: primaryKey({ columns: [t.orgId, t.id] }),\n notificationFk: foreignKey({\n columns: [t.orgId, t.notificationId],\n foreignColumns: [notifications.orgId, notifications.id],\n }).onDelete(\"cascade\"),\n channelIdx: uniqueIndex(\"notification_deliveries_channel_idx\").on(\n t.orgId,\n t.notificationId,\n t.channel,\n ),\n }),\n);\n\ntype _AutomationsDrift = Expect<NoDrift<typeof automations.$inferSelect, Automation>>;\ntype _AutomationRunsDrift = Expect<NoDrift<typeof automationRuns.$inferSelect, AutomationRun>>;\n"],"mappings":";;;;;;AA6BA,MAAa,cAAc,QACzB,eACA;CACE,OAAO,KAAK,QAAQ,CAAC,CAClB,QAAQ,CAAC,CACT,iBAAiB,cAAc,EAAE;CACpC,IAAI,KAAK,IAAI,CAAC,CACX,QAAQ,CAAC,CACT,iBAAiB,MAAM,YAAY,CAAC;CACvC,MAAM,KAAK,MAAM,CAAC,CAAC,QAAQ;CAC3B,MAAM,KAAK,QAAQ,EAAE,MAAM,CAAC,YAAY,SAAS,EAAE,CAAC,CAAC,CAClD,QAAQ,CAAC,CACT,QAAQ,UA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,aAAa,MAAM,4BAA4B,CAAC,CAAC,GAAG,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ;CACjF,YAAY,MAAM,2BAA2B,CAAC,CAAC,MAAM,OAAO,EAAE,OAAO;AACvE,EACF;AAEA,MAAa,yBAAyB,QACpC,2BACA;CACE,OAAO,KAAK,QAAQ,CAAC,CAAC,QAAQ;CAC9B,IAAI,KAAK,IAAI,CAAC,CACX,QAAQ,CAAC,CACT,iBAAiB,MAAM,sBAAsB,CAAC;CACjD,gBAAgB,KAAK,iBAAiB,CAAC,CAAC,QAAQ;CAChD,SAAS,KAAK,SAAS,CAAC,CAAC,QAAQ;CACjC,QAAQ,KAAK,UAAU,EAAE,MAAM;EAAC;EAAW;EAAQ;CAAQ,EAAE,CAAC,CAAC,CAC5D,QAAQ,CAAC,CACT,QAAQ,SAAS;CACpB,WAAW,KAAK,YAAY;CAC5B,WAAW,UAAU,cAAc,EAAE,cAAc,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,WAAW;CAChF,QAAQ,UAAU,WAAW,EAAE,cAAc,KAAK,CAAC;AACrD,IACC,OAAO;CACN,IAAI,WAAW,EAAE,SAAS,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;CAC3C,gBAAgB,WAAW;EACzB,SAAS,CAAC,EAAE,OAAO,EAAE,cAAc;EACnC,gBAAgB,CAAC,cAAc,OAAO,cAAc,EAAE;CACxD,CAAC,CAAC,CAAC,SAAS,SAAS;CACrB,YAAY,YAAY,qCAAqC,CAAC,CAAC,GAC7D,EAAE,OACF,EAAE,gBACF,EAAE,OACJ;AACF,EACF"}
|
package/dist/schema/content.d.ts
CHANGED
|
@@ -134,14 +134,14 @@ declare const contentItems: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
|
134
134
|
tableName: "content_items";
|
|
135
135
|
dataType: "string";
|
|
136
136
|
columnType: "PgText";
|
|
137
|
-
data: "course" | "download" | "community";
|
|
137
|
+
data: "course" | "download" | "event" | "community";
|
|
138
138
|
driverParam: string;
|
|
139
139
|
notNull: true;
|
|
140
140
|
hasDefault: false;
|
|
141
141
|
isPrimaryKey: false;
|
|
142
142
|
isAutoincrement: false;
|
|
143
143
|
hasRuntimeDefault: false;
|
|
144
|
-
enumValues: ["course", "download", "community"];
|
|
144
|
+
enumValues: ["course", "download", "community", "event"];
|
|
145
145
|
baseColumn: never;
|
|
146
146
|
identity: undefined;
|
|
147
147
|
generated: undefined;
|
|
@@ -1211,6 +1211,440 @@ declare const downloadAssets: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
|
1211
1211
|
};
|
|
1212
1212
|
dialect: "pg";
|
|
1213
1213
|
}>;
|
|
1214
|
+
declare const events: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
1215
|
+
name: "events";
|
|
1216
|
+
schema: undefined;
|
|
1217
|
+
columns: {
|
|
1218
|
+
orgId: import("drizzle-orm/pg-core").PgColumn<{
|
|
1219
|
+
name: "org_id";
|
|
1220
|
+
tableName: "events";
|
|
1221
|
+
dataType: "string";
|
|
1222
|
+
columnType: "PgText";
|
|
1223
|
+
data: string;
|
|
1224
|
+
driverParam: string;
|
|
1225
|
+
notNull: true;
|
|
1226
|
+
hasDefault: false;
|
|
1227
|
+
isPrimaryKey: false;
|
|
1228
|
+
isAutoincrement: false;
|
|
1229
|
+
hasRuntimeDefault: false;
|
|
1230
|
+
enumValues: [string, ...string[]];
|
|
1231
|
+
baseColumn: never;
|
|
1232
|
+
identity: undefined;
|
|
1233
|
+
generated: undefined;
|
|
1234
|
+
}, {}, {}>;
|
|
1235
|
+
id: import("drizzle-orm/pg-core").PgColumn<{
|
|
1236
|
+
name: "id";
|
|
1237
|
+
tableName: "events";
|
|
1238
|
+
dataType: "string";
|
|
1239
|
+
columnType: "PgText";
|
|
1240
|
+
data: string;
|
|
1241
|
+
driverParam: string;
|
|
1242
|
+
notNull: true;
|
|
1243
|
+
hasDefault: true;
|
|
1244
|
+
isPrimaryKey: false;
|
|
1245
|
+
isAutoincrement: false;
|
|
1246
|
+
hasRuntimeDefault: true;
|
|
1247
|
+
enumValues: [string, ...string[]];
|
|
1248
|
+
baseColumn: never;
|
|
1249
|
+
identity: undefined;
|
|
1250
|
+
generated: undefined;
|
|
1251
|
+
}, {}, {}>;
|
|
1252
|
+
type: import("drizzle-orm/pg-core").PgColumn<{
|
|
1253
|
+
name: "type";
|
|
1254
|
+
tableName: "events";
|
|
1255
|
+
dataType: "string";
|
|
1256
|
+
columnType: "PgText";
|
|
1257
|
+
data: "event";
|
|
1258
|
+
driverParam: string;
|
|
1259
|
+
notNull: true;
|
|
1260
|
+
hasDefault: true;
|
|
1261
|
+
isPrimaryKey: false;
|
|
1262
|
+
isAutoincrement: false;
|
|
1263
|
+
hasRuntimeDefault: false;
|
|
1264
|
+
enumValues: [string, ...string[]];
|
|
1265
|
+
baseColumn: never;
|
|
1266
|
+
identity: undefined;
|
|
1267
|
+
generated: {
|
|
1268
|
+
type: "always";
|
|
1269
|
+
};
|
|
1270
|
+
}, {}, {
|
|
1271
|
+
$type: "event";
|
|
1272
|
+
}>;
|
|
1273
|
+
title: import("drizzle-orm/pg-core").PgColumn<{
|
|
1274
|
+
name: "title";
|
|
1275
|
+
tableName: "events";
|
|
1276
|
+
dataType: "string";
|
|
1277
|
+
columnType: "PgText";
|
|
1278
|
+
data: string;
|
|
1279
|
+
driverParam: string;
|
|
1280
|
+
notNull: true;
|
|
1281
|
+
hasDefault: false;
|
|
1282
|
+
isPrimaryKey: false;
|
|
1283
|
+
isAutoincrement: false;
|
|
1284
|
+
hasRuntimeDefault: false;
|
|
1285
|
+
enumValues: [string, ...string[]];
|
|
1286
|
+
baseColumn: never;
|
|
1287
|
+
identity: undefined;
|
|
1288
|
+
generated: undefined;
|
|
1289
|
+
}, {}, {}>;
|
|
1290
|
+
description: import("drizzle-orm/pg-core").PgColumn<{
|
|
1291
|
+
name: "description";
|
|
1292
|
+
tableName: "events";
|
|
1293
|
+
dataType: "string";
|
|
1294
|
+
columnType: "PgText";
|
|
1295
|
+
data: string;
|
|
1296
|
+
driverParam: string;
|
|
1297
|
+
notNull: true;
|
|
1298
|
+
hasDefault: true;
|
|
1299
|
+
isPrimaryKey: false;
|
|
1300
|
+
isAutoincrement: false;
|
|
1301
|
+
hasRuntimeDefault: false;
|
|
1302
|
+
enumValues: [string, ...string[]];
|
|
1303
|
+
baseColumn: never;
|
|
1304
|
+
identity: undefined;
|
|
1305
|
+
generated: undefined;
|
|
1306
|
+
}, {}, {}>;
|
|
1307
|
+
thumbnailAssetId: import("drizzle-orm/pg-core").PgColumn<{
|
|
1308
|
+
name: "thumbnail_asset_id";
|
|
1309
|
+
tableName: "events";
|
|
1310
|
+
dataType: "string";
|
|
1311
|
+
columnType: "PgText";
|
|
1312
|
+
data: string;
|
|
1313
|
+
driverParam: string;
|
|
1314
|
+
notNull: false;
|
|
1315
|
+
hasDefault: false;
|
|
1316
|
+
isPrimaryKey: false;
|
|
1317
|
+
isAutoincrement: false;
|
|
1318
|
+
hasRuntimeDefault: false;
|
|
1319
|
+
enumValues: [string, ...string[]];
|
|
1320
|
+
baseColumn: never;
|
|
1321
|
+
identity: undefined;
|
|
1322
|
+
generated: undefined;
|
|
1323
|
+
}, {}, {}>;
|
|
1324
|
+
status: import("drizzle-orm/pg-core").PgColumn<{
|
|
1325
|
+
name: "status";
|
|
1326
|
+
tableName: "events";
|
|
1327
|
+
dataType: "string";
|
|
1328
|
+
columnType: "PgText";
|
|
1329
|
+
data: "draft" | "published" | "canceled";
|
|
1330
|
+
driverParam: string;
|
|
1331
|
+
notNull: true;
|
|
1332
|
+
hasDefault: true;
|
|
1333
|
+
isPrimaryKey: false;
|
|
1334
|
+
isAutoincrement: false;
|
|
1335
|
+
hasRuntimeDefault: false;
|
|
1336
|
+
enumValues: ["draft", "published", "canceled"];
|
|
1337
|
+
baseColumn: never;
|
|
1338
|
+
identity: undefined;
|
|
1339
|
+
generated: undefined;
|
|
1340
|
+
}, {}, {}>;
|
|
1341
|
+
startsAt: import("drizzle-orm/pg-core").PgColumn<{
|
|
1342
|
+
name: "starts_at";
|
|
1343
|
+
tableName: "events";
|
|
1344
|
+
dataType: "date";
|
|
1345
|
+
columnType: "PgTimestamp";
|
|
1346
|
+
data: Date;
|
|
1347
|
+
driverParam: string;
|
|
1348
|
+
notNull: true;
|
|
1349
|
+
hasDefault: false;
|
|
1350
|
+
isPrimaryKey: false;
|
|
1351
|
+
isAutoincrement: false;
|
|
1352
|
+
hasRuntimeDefault: false;
|
|
1353
|
+
enumValues: undefined;
|
|
1354
|
+
baseColumn: never;
|
|
1355
|
+
identity: undefined;
|
|
1356
|
+
generated: undefined;
|
|
1357
|
+
}, {}, {}>;
|
|
1358
|
+
endsAt: import("drizzle-orm/pg-core").PgColumn<{
|
|
1359
|
+
name: "ends_at";
|
|
1360
|
+
tableName: "events";
|
|
1361
|
+
dataType: "date";
|
|
1362
|
+
columnType: "PgTimestamp";
|
|
1363
|
+
data: Date;
|
|
1364
|
+
driverParam: string;
|
|
1365
|
+
notNull: true;
|
|
1366
|
+
hasDefault: false;
|
|
1367
|
+
isPrimaryKey: false;
|
|
1368
|
+
isAutoincrement: false;
|
|
1369
|
+
hasRuntimeDefault: false;
|
|
1370
|
+
enumValues: undefined;
|
|
1371
|
+
baseColumn: never;
|
|
1372
|
+
identity: undefined;
|
|
1373
|
+
generated: undefined;
|
|
1374
|
+
}, {}, {}>;
|
|
1375
|
+
timeZone: import("drizzle-orm/pg-core").PgColumn<{
|
|
1376
|
+
name: "time_zone";
|
|
1377
|
+
tableName: "events";
|
|
1378
|
+
dataType: "string";
|
|
1379
|
+
columnType: "PgText";
|
|
1380
|
+
data: string;
|
|
1381
|
+
driverParam: string;
|
|
1382
|
+
notNull: true;
|
|
1383
|
+
hasDefault: false;
|
|
1384
|
+
isPrimaryKey: false;
|
|
1385
|
+
isAutoincrement: false;
|
|
1386
|
+
hasRuntimeDefault: false;
|
|
1387
|
+
enumValues: [string, ...string[]];
|
|
1388
|
+
baseColumn: never;
|
|
1389
|
+
identity: undefined;
|
|
1390
|
+
generated: undefined;
|
|
1391
|
+
}, {}, {}>;
|
|
1392
|
+
location: import("drizzle-orm/pg-core").PgColumn<{
|
|
1393
|
+
name: "location";
|
|
1394
|
+
tableName: "events";
|
|
1395
|
+
dataType: "json";
|
|
1396
|
+
columnType: "PgJsonb";
|
|
1397
|
+
data: {
|
|
1398
|
+
venue: {
|
|
1399
|
+
name: string;
|
|
1400
|
+
address: {
|
|
1401
|
+
line1: string | null;
|
|
1402
|
+
line2: string | null;
|
|
1403
|
+
city: string | null;
|
|
1404
|
+
region: string | null;
|
|
1405
|
+
postalCode: string | null;
|
|
1406
|
+
country: string | null;
|
|
1407
|
+
} | null;
|
|
1408
|
+
} | null;
|
|
1409
|
+
online: {
|
|
1410
|
+
url: string;
|
|
1411
|
+
details: string | null;
|
|
1412
|
+
} | null;
|
|
1413
|
+
};
|
|
1414
|
+
driverParam: unknown;
|
|
1415
|
+
notNull: true;
|
|
1416
|
+
hasDefault: true;
|
|
1417
|
+
isPrimaryKey: false;
|
|
1418
|
+
isAutoincrement: false;
|
|
1419
|
+
hasRuntimeDefault: false;
|
|
1420
|
+
enumValues: undefined;
|
|
1421
|
+
baseColumn: never;
|
|
1422
|
+
identity: undefined;
|
|
1423
|
+
generated: undefined;
|
|
1424
|
+
}, {}, {
|
|
1425
|
+
$type: {
|
|
1426
|
+
venue: {
|
|
1427
|
+
name: string;
|
|
1428
|
+
address: {
|
|
1429
|
+
line1: string | null;
|
|
1430
|
+
line2: string | null;
|
|
1431
|
+
city: string | null;
|
|
1432
|
+
region: string | null;
|
|
1433
|
+
postalCode: string | null;
|
|
1434
|
+
country: string | null;
|
|
1435
|
+
} | null;
|
|
1436
|
+
} | null;
|
|
1437
|
+
online: {
|
|
1438
|
+
url: string;
|
|
1439
|
+
details: string | null;
|
|
1440
|
+
} | null;
|
|
1441
|
+
};
|
|
1442
|
+
}>;
|
|
1443
|
+
recording: import("drizzle-orm/pg-core").PgColumn<{
|
|
1444
|
+
name: "recording";
|
|
1445
|
+
tableName: "events";
|
|
1446
|
+
dataType: "json";
|
|
1447
|
+
columnType: "PgJsonb";
|
|
1448
|
+
data: {
|
|
1449
|
+
url: string;
|
|
1450
|
+
details: string | null;
|
|
1451
|
+
} | null;
|
|
1452
|
+
driverParam: unknown;
|
|
1453
|
+
notNull: false;
|
|
1454
|
+
hasDefault: false;
|
|
1455
|
+
isPrimaryKey: false;
|
|
1456
|
+
isAutoincrement: false;
|
|
1457
|
+
hasRuntimeDefault: false;
|
|
1458
|
+
enumValues: undefined;
|
|
1459
|
+
baseColumn: never;
|
|
1460
|
+
identity: undefined;
|
|
1461
|
+
generated: undefined;
|
|
1462
|
+
}, {}, {
|
|
1463
|
+
$type: {
|
|
1464
|
+
url: string;
|
|
1465
|
+
details: string | null;
|
|
1466
|
+
} | null;
|
|
1467
|
+
}>;
|
|
1468
|
+
createdAt: import("drizzle-orm/pg-core").PgColumn<{
|
|
1469
|
+
name: "created_at";
|
|
1470
|
+
tableName: "events";
|
|
1471
|
+
dataType: "date";
|
|
1472
|
+
columnType: "PgTimestamp";
|
|
1473
|
+
data: Date;
|
|
1474
|
+
driverParam: string;
|
|
1475
|
+
notNull: true;
|
|
1476
|
+
hasDefault: true;
|
|
1477
|
+
isPrimaryKey: false;
|
|
1478
|
+
isAutoincrement: false;
|
|
1479
|
+
hasRuntimeDefault: false;
|
|
1480
|
+
enumValues: undefined;
|
|
1481
|
+
baseColumn: never;
|
|
1482
|
+
identity: undefined;
|
|
1483
|
+
generated: undefined;
|
|
1484
|
+
}, {}, {}>;
|
|
1485
|
+
updatedAt: import("drizzle-orm/pg-core").PgColumn<{
|
|
1486
|
+
name: "updated_at";
|
|
1487
|
+
tableName: "events";
|
|
1488
|
+
dataType: "date";
|
|
1489
|
+
columnType: "PgTimestamp";
|
|
1490
|
+
data: Date;
|
|
1491
|
+
driverParam: string;
|
|
1492
|
+
notNull: true;
|
|
1493
|
+
hasDefault: true;
|
|
1494
|
+
isPrimaryKey: false;
|
|
1495
|
+
isAutoincrement: false;
|
|
1496
|
+
hasRuntimeDefault: false;
|
|
1497
|
+
enumValues: undefined;
|
|
1498
|
+
baseColumn: never;
|
|
1499
|
+
identity: undefined;
|
|
1500
|
+
generated: undefined;
|
|
1501
|
+
}, {}, {}>;
|
|
1502
|
+
};
|
|
1503
|
+
dialect: "pg";
|
|
1504
|
+
}>;
|
|
1505
|
+
declare const eventAssets: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
1506
|
+
name: "event_assets";
|
|
1507
|
+
schema: undefined;
|
|
1508
|
+
columns: {
|
|
1509
|
+
orgId: import("drizzle-orm/pg-core").PgColumn<{
|
|
1510
|
+
name: "org_id";
|
|
1511
|
+
tableName: "event_assets";
|
|
1512
|
+
dataType: "string";
|
|
1513
|
+
columnType: "PgText";
|
|
1514
|
+
data: string;
|
|
1515
|
+
driverParam: string;
|
|
1516
|
+
notNull: true;
|
|
1517
|
+
hasDefault: false;
|
|
1518
|
+
isPrimaryKey: false;
|
|
1519
|
+
isAutoincrement: false;
|
|
1520
|
+
hasRuntimeDefault: false;
|
|
1521
|
+
enumValues: [string, ...string[]];
|
|
1522
|
+
baseColumn: never;
|
|
1523
|
+
identity: undefined;
|
|
1524
|
+
generated: undefined;
|
|
1525
|
+
}, {}, {}>;
|
|
1526
|
+
id: import("drizzle-orm/pg-core").PgColumn<{
|
|
1527
|
+
name: "id";
|
|
1528
|
+
tableName: "event_assets";
|
|
1529
|
+
dataType: "string";
|
|
1530
|
+
columnType: "PgText";
|
|
1531
|
+
data: string;
|
|
1532
|
+
driverParam: string;
|
|
1533
|
+
notNull: true;
|
|
1534
|
+
hasDefault: true;
|
|
1535
|
+
isPrimaryKey: false;
|
|
1536
|
+
isAutoincrement: false;
|
|
1537
|
+
hasRuntimeDefault: true;
|
|
1538
|
+
enumValues: [string, ...string[]];
|
|
1539
|
+
baseColumn: never;
|
|
1540
|
+
identity: undefined;
|
|
1541
|
+
generated: undefined;
|
|
1542
|
+
}, {}, {}>;
|
|
1543
|
+
eventId: import("drizzle-orm/pg-core").PgColumn<{
|
|
1544
|
+
name: "event_id";
|
|
1545
|
+
tableName: "event_assets";
|
|
1546
|
+
dataType: "string";
|
|
1547
|
+
columnType: "PgText";
|
|
1548
|
+
data: string;
|
|
1549
|
+
driverParam: string;
|
|
1550
|
+
notNull: true;
|
|
1551
|
+
hasDefault: false;
|
|
1552
|
+
isPrimaryKey: false;
|
|
1553
|
+
isAutoincrement: false;
|
|
1554
|
+
hasRuntimeDefault: false;
|
|
1555
|
+
enumValues: [string, ...string[]];
|
|
1556
|
+
baseColumn: never;
|
|
1557
|
+
identity: undefined;
|
|
1558
|
+
generated: undefined;
|
|
1559
|
+
}, {}, {}>;
|
|
1560
|
+
assetId: import("drizzle-orm/pg-core").PgColumn<{
|
|
1561
|
+
name: "asset_id";
|
|
1562
|
+
tableName: "event_assets";
|
|
1563
|
+
dataType: "string";
|
|
1564
|
+
columnType: "PgText";
|
|
1565
|
+
data: string;
|
|
1566
|
+
driverParam: string;
|
|
1567
|
+
notNull: true;
|
|
1568
|
+
hasDefault: false;
|
|
1569
|
+
isPrimaryKey: false;
|
|
1570
|
+
isAutoincrement: false;
|
|
1571
|
+
hasRuntimeDefault: false;
|
|
1572
|
+
enumValues: [string, ...string[]];
|
|
1573
|
+
baseColumn: never;
|
|
1574
|
+
identity: undefined;
|
|
1575
|
+
generated: undefined;
|
|
1576
|
+
}, {}, {}>;
|
|
1577
|
+
seq: import("drizzle-orm/pg-core").PgColumn<{
|
|
1578
|
+
name: "seq";
|
|
1579
|
+
tableName: "event_assets";
|
|
1580
|
+
dataType: "number";
|
|
1581
|
+
columnType: "PgInteger";
|
|
1582
|
+
data: number;
|
|
1583
|
+
driverParam: string | number;
|
|
1584
|
+
notNull: true;
|
|
1585
|
+
hasDefault: true;
|
|
1586
|
+
isPrimaryKey: false;
|
|
1587
|
+
isAutoincrement: false;
|
|
1588
|
+
hasRuntimeDefault: false;
|
|
1589
|
+
enumValues: undefined;
|
|
1590
|
+
baseColumn: never;
|
|
1591
|
+
identity: undefined;
|
|
1592
|
+
generated: undefined;
|
|
1593
|
+
}, {}, {}>;
|
|
1594
|
+
displayName: import("drizzle-orm/pg-core").PgColumn<{
|
|
1595
|
+
name: "display_name";
|
|
1596
|
+
tableName: "event_assets";
|
|
1597
|
+
dataType: "string";
|
|
1598
|
+
columnType: "PgText";
|
|
1599
|
+
data: string;
|
|
1600
|
+
driverParam: string;
|
|
1601
|
+
notNull: false;
|
|
1602
|
+
hasDefault: false;
|
|
1603
|
+
isPrimaryKey: false;
|
|
1604
|
+
isAutoincrement: false;
|
|
1605
|
+
hasRuntimeDefault: false;
|
|
1606
|
+
enumValues: [string, ...string[]];
|
|
1607
|
+
baseColumn: never;
|
|
1608
|
+
identity: undefined;
|
|
1609
|
+
generated: undefined;
|
|
1610
|
+
}, {}, {}>;
|
|
1611
|
+
createdAt: import("drizzle-orm/pg-core").PgColumn<{
|
|
1612
|
+
name: "created_at";
|
|
1613
|
+
tableName: "event_assets";
|
|
1614
|
+
dataType: "date";
|
|
1615
|
+
columnType: "PgTimestamp";
|
|
1616
|
+
data: Date;
|
|
1617
|
+
driverParam: string;
|
|
1618
|
+
notNull: true;
|
|
1619
|
+
hasDefault: true;
|
|
1620
|
+
isPrimaryKey: false;
|
|
1621
|
+
isAutoincrement: false;
|
|
1622
|
+
hasRuntimeDefault: false;
|
|
1623
|
+
enumValues: undefined;
|
|
1624
|
+
baseColumn: never;
|
|
1625
|
+
identity: undefined;
|
|
1626
|
+
generated: undefined;
|
|
1627
|
+
}, {}, {}>;
|
|
1628
|
+
updatedAt: import("drizzle-orm/pg-core").PgColumn<{
|
|
1629
|
+
name: "updated_at";
|
|
1630
|
+
tableName: "event_assets";
|
|
1631
|
+
dataType: "date";
|
|
1632
|
+
columnType: "PgTimestamp";
|
|
1633
|
+
data: Date;
|
|
1634
|
+
driverParam: string;
|
|
1635
|
+
notNull: true;
|
|
1636
|
+
hasDefault: true;
|
|
1637
|
+
isPrimaryKey: false;
|
|
1638
|
+
isAutoincrement: false;
|
|
1639
|
+
hasRuntimeDefault: false;
|
|
1640
|
+
enumValues: undefined;
|
|
1641
|
+
baseColumn: never;
|
|
1642
|
+
identity: undefined;
|
|
1643
|
+
generated: undefined;
|
|
1644
|
+
}, {}, {}>;
|
|
1645
|
+
};
|
|
1646
|
+
dialect: "pg";
|
|
1647
|
+
}>;
|
|
1214
1648
|
declare const communities: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
1215
1649
|
name: "communities";
|
|
1216
1650
|
schema: undefined;
|
|
@@ -1849,5 +2283,5 @@ declare const spaceLinks: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
|
1849
2283
|
dialect: "pg";
|
|
1850
2284
|
}>;
|
|
1851
2285
|
//#endregion
|
|
1852
|
-
export { activities, activityAssets, bundleItems, bundles, communities, contentItems, courses, downloadAssets, downloads, modules, spaceLinks, spaceTopics, spaces };
|
|
2286
|
+
export { activities, activityAssets, bundleItems, bundles, communities, contentItems, courses, downloadAssets, downloads, eventAssets, events, modules, spaceLinks, spaceTopics, spaces };
|
|
1853
2287
|
//# sourceMappingURL=content.d.ts.map
|