feat: custom widgets (#5889)

This commit is contained in:
Thomas authored and GitHub committed 2026-06-10 18:58:14 +02:00
1 parent 48e1844b5b
commit aecbca2b81
69 files changed
+14620 -142

No files matched your search

@@ -0,0 +1,28 @@
CREATE TABLE "custom_widget_definition" (
"id" varchar(64) PRIMARY KEY NOT NULL,
"name" varchar(256) NOT NULL,
"description" text,
"icon_url" text,
"base_url" text NOT NULL,
"auth_type" varchar(32) DEFAULT 'none' NOT NULL,
"header_name" varchar(256),
"endpoint" text NOT NULL,
"method" varchar(16) DEFAULT 'GET' NOT NULL,
"request_body" text,
"display_type" varchar(32) DEFAULT 'singleValue' NOT NULL,
"display_config" text DEFAULT '{"json": {}}' NOT NULL,
"created_at" timestamp DEFAULT now() NOT NULL,
"updated_at" timestamp DEFAULT now() NOT NULL,
"creator_id" varchar(64)
);
--> statement-breakpoint
CREATE TABLE "custom_widget_secret" (
"kind" varchar(64) NOT NULL,
"value" text NOT NULL,
"updated_at" timestamp NOT NULL,
"definition_id" varchar(64) NOT NULL,
CONSTRAINT "custom_widget_secret_definition_id_kind_pk" PRIMARY KEY("definition_id","kind")
);
--> statement-breakpoint
ALTER TABLE "custom_widget_definition" ADD CONSTRAINT "custom_widget_definition_creator_id_user_id_fk" FOREIGN KEY ("creator_id") REFERENCES "public"."user"("id") ON DELETE set null ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "custom_widget_secret" ADD CONSTRAINT "custom_widget_secret_definition_id_custom_widget_definition_id_fk" FOREIGN KEY ("definition_id") REFERENCES "public"."custom_widget_definition"("id") ON DELETE cascade ON UPDATE no action;
@@ -0,0 +1,6 @@
ALTER TABLE "custom_widget_definition" ADD COLUMN "url" text;--> statement-breakpoint
UPDATE "custom_widget_definition" SET "url" = "base_url" || "endpoint";--> statement-breakpoint
ALTER TABLE "custom_widget_definition" ALTER COLUMN "url" SET NOT NULL;--> statement-breakpoint
ALTER TABLE "custom_widget_definition" DROP COLUMN "base_url";--> statement-breakpoint
ALTER TABLE "custom_widget_definition" DROP COLUMN "endpoint";--> statement-breakpoint
ALTER TABLE "custom_widget_definition" ADD COLUMN "enabled" boolean DEFAULT true NOT NULL;
File diff suppressed because it is too large. Load diff
@@ -43,6 +43,20 @@
"when": 1779199097716,
"tag": "0005_add_user_onboarding_tour_status",
"breakpoints": true
},
{
"idx": 6,
"version": "7",
"when": 1780764416094,
"tag": "0006_last_callisto",
"breakpoints": true
},
{
"idx": 7,
"version": "7",
"when": 1780764500000,
"tag": "0007_merge_custom_widget_url",
"breakpoints": true
}
]
}
}