feat: add custom widget flow workbench

This commit is contained in:
ajnart committed 2026-09-12 22:51:46 +02:00
1 parent c32a5317ca
commit a6bdbbb4ea
259 files changed
+23875 -1293

No files matched your search

+1
View File
@@ -54,6 +54,7 @@ export const {
cronJobConfigurations,
customWidgetDefinitions,
customWidgetSecrets,
customWidgetContent,
legacyCustomWidgetDefinitions,
legacyCustomWidgetSecrets,
widgetSecrets,
+28
View File
@@ -10,6 +10,7 @@ import {
index,
int,
mediumtext,
longtext,
mysqlTable,
primaryKey,
smallint,
@@ -637,6 +638,10 @@ export const customWidgetDefinitions = mysqlTable("custom_widget_v2_definition",
requests: text().notNull(),
options: text().notNull(),
template: text().notNull(),
extensions: longtext(),
editorLayout: longtext(),
workshopOrigin: longtext(),
previousPackage: longtext(),
enabled: boolean().notNull().default(true),
createdAt: timestamp({ mode: "date" }).notNull().defaultNow(),
updatedAt: timestamp({ mode: "date" }).notNull().defaultNow(),
@@ -666,6 +671,29 @@ export const customWidgetSecrets = mysqlTable(
}),
);
export const customWidgetContent = mysqlTable(
"custom_widget_content",
{
itemId: varchar({ length: 64 })
.notNull()
.references(() => items.id, { onDelete: "cascade" }),
definitionId: varchar({ length: 64 }).notNull(),
key: varchar({ length: 64 }).notNull(),
name: varchar({ length: 64 }).notNull(),
value: longtext().notNull(),
revision: int().notNull(),
updatedAt: timestamp({ mode: "date" }).notNull().defaultNow(),
},
(table) => ({
compoundKey: primaryKey({ columns: [table.itemId, table.definitionId, table.key] }),
definitionFk: foreignKey({
columns: [table.definitionId],
foreignColumns: [customWidgetDefinitions.id],
name: "custom_widget_content_definition_id_fk",
}).onDelete("cascade"),
}),
);
export const widgetSecrets = mysqlTable(
"widget_secret",
{
+22
View File
@@ -633,6 +633,10 @@ export const customWidgetDefinitions = pgTable("custom_widget_v2_definition", {
requests: text().notNull(),
options: text().notNull(),
template: text().notNull(),
extensions: text(),
editorLayout: text(),
workshopOrigin: text(),
previousPackage: text(),
enabled: boolean().notNull().default(true),
createdAt: timestamp({ mode: "date" }).notNull().defaultNow(),
updatedAt: timestamp({ mode: "date" }).notNull().defaultNow(),
@@ -662,6 +666,24 @@ export const customWidgetSecrets = pgTable(
}),
);
export const customWidgetContent = pgTable(
"custom_widget_content",
{
itemId: varchar({ length: 64 })
.notNull()
.references(() => items.id, { onDelete: "cascade" }),
definitionId: varchar({ length: 64 })
.notNull()
.references(() => customWidgetDefinitions.id, { onDelete: "cascade" }),
key: varchar({ length: 64 }).notNull(),
name: varchar({ length: 64 }).notNull(),
value: text().notNull(),
revision: integer().notNull(),
updatedAt: timestamp({ mode: "date" }).notNull().defaultNow(),
},
(table) => ({ compoundKey: primaryKey({ columns: [table.itemId, table.definitionId, table.key] }) }),
);
export const widgetSecrets = pgTable(
"widget_secret",
{
+24
View File
@@ -630,6 +630,10 @@ export const customWidgetDefinitions = sqliteTable("custom_widget_v2_definition"
requests: text().notNull(),
options: text().notNull(),
template: text().notNull(),
extensions: text(),
editorLayout: text(),
workshopOrigin: text(),
previousPackage: text(),
enabled: int({ mode: "boolean" }).notNull().default(true),
createdAt: int({ mode: "timestamp" })
.notNull()
@@ -663,6 +667,26 @@ export const customWidgetSecrets = sqliteTable(
}),
);
export const customWidgetContent = sqliteTable(
"custom_widget_content",
{
itemId: text()
.notNull()
.references(() => items.id, { onDelete: "cascade" }),
definitionId: text()
.notNull()
.references(() => customWidgetDefinitions.id, { onDelete: "cascade" }),
key: text().notNull(),
name: text().notNull(),
value: text().notNull(),
revision: int().notNull(),
updatedAt: int({ mode: "timestamp" })
.notNull()
.default(sql`(unixepoch())`),
},
(table) => ({ compoundKey: primaryKey({ columns: [table.itemId, table.definitionId, table.key] }) }),
);
export const widgetSecrets = sqliteTable(
"widget_secret",
{