Skip to content

armgit / kaneo

Public Imported from GitHub
0

⚡ Project management that doesn't become the project. Boards, Gantt charts, and GitHub integration. Self-host it or use Kaneo Cloud.

feat(billing): add Kaneo Cloud subscriptions via Creem

Andrej093995d09f51
diff --git a/.env.sample b/.env.sample
index fe1586b03..edaf46a40 100644
--- a/.env.sample
+++ b/.env.sample
@@ -77,3 +77,15 @@ SMTP_REQUIRE_TLS=
# Sentry error tracking (Optional) — errors are only reported when a DSN is set
# SENTRY_DSN=
# SENTRY_ENVIRONMENT=production
+
+# Kaneo Cloud billing via Creem (Optional) — only active when KANEO_CLOUD=true
+# and both keys are set. Self-hosted installs leave these empty; billing stays off.
+# CREEM_API_KEY=
+# CREEM_WEBHOOK_SECRET=
+# CREEM_TEST_MODE=true # use Creem's sandbox API
+# CREEM_PRODUCT_PERSONAL_MONTHLY=
+# CREEM_PRODUCT_PERSONAL_ANNUAL=
+# CREEM_PRODUCT_TEAM_MONTHLY=
+# CREEM_PRODUCT_TEAM_ANNUAL=
+# BILLING_TRIAL_DAYS=14
+# BILLING_FOUNDING_CUTOFF= # ISO date; workspaces created on/before keep free access
diff --git a/.gitignore b/.gitignore
index 256b387f3..c8c646dc7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -51,3 +51,6 @@ compose.override.yml
# IntelliJ IDE
.idea
+
+# TanStack Router generated cache
+apps/web/.tanstack/
diff --git a/apps/api/drizzle/0035_swift_captain_cross.sql b/apps/api/drizzle/0035_swift_captain_cross.sql
new file mode 100644
index 000000000..aa0fb93f6
--- /dev/null
+++ b/apps/api/drizzle/0035_swift_captain_cross.sql
@@ -0,0 +1,28 @@
+CREATE TABLE "billing_event" (
+ "id" text PRIMARY KEY NOT NULL,
+ "event_type" text NOT NULL,
+ "processed_at" timestamp DEFAULT now() NOT NULL
+);
+--> statement-breakpoint
+CREATE TABLE "workspace_billing" (
+ "id" text PRIMARY KEY NOT NULL,
+ "workspace_id" text NOT NULL,
+ "founding_free" boolean DEFAULT false NOT NULL,
+ "trial_ends_at" timestamp,
+ "creem_customer_id" text,
+ "creem_subscription_id" text,
+ "creem_product_id" text,
+ "plan" text,
+ "billing_interval" text,
+ "status" text,
+ "seats" integer DEFAULT 1 NOT NULL,
+ "current_period_end" timestamp,
+ "canceled_at" timestamp,
+ "created_at" timestamp DEFAULT now() NOT NULL,
+ "updated_at" timestamp DEFAULT now() NOT NULL,
+ CONSTRAINT "workspace_billing_workspace_id_unique" UNIQUE("workspace_id"),
+ CONSTRAINT "workspace_billing_creem_subscription_id_unique" UNIQUE("creem_subscription_id")
+);
+--> statement-breakpoint
+ALTER TABLE "workspace_billing" ADD CONSTRAINT "workspace_billing_workspace_id_workspace_id_fk" FOREIGN KEY ("workspace_id") REFERENCES "public"."workspace"("id") ON DELETE cascade ON UPDATE cascade;--> statement-breakpoint
+CREATE INDEX "workspace_billing_workspaceId_idx" ON "workspace_billing" USING btree ("workspace_id");
\ No newline at end of file
diff --git a/apps/api/drizzle/meta/0035_snapshot.json b/apps/api/drizzle/meta/0035_snapshot.json
new file mode 100644
index 000000000..e939d9cb5
--- /dev/null
+++ b/apps/api/drizzle/meta/0035_snapshot.json
@@ -0,0 +1,3818 @@
+{
+ "id": "9fd8cbb4-bd49-4e02-a636-616041f7af9a",
+ "prevId": "3d4e18de-831a-4ed8-9d0b-41dfa0d4757e",
+ "version": "7",
+ "dialect": "postgresql",
+ "tables": {
+ "public.account": {
+ "name": "account",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "account_id": {
+ "name": "account_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "provider_id": {
+ "name": "provider_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "access_token": {
+ "name": "access_token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "refresh_token": {
+ "name": "refresh_token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "id_token": {
+ "name": "id_token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "access_token_expires_at": {
+ "name": "access_token_expires_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "refresh_token_expires_at": {
+ "name": "refresh_token_expires_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "scope": {
+ "name": "scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "password": {
+ "name": "password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "account_userId_idx": {
+ "name": "account_userId_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "account_user_id_user_id_fk": {
+ "name": "account_user_id_user_id_fk",
+ "tableFrom": "account",
+ "tableTo": "user",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.activity": {
+ "name": "activity",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "task_id": {
+ "name": "task_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "type": {
+ "name": "type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "event_data": {
+ "name": "event_data",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "external_user_name": {
+ "name": "external_user_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "external_user_avatar": {
+ "name": "external_user_avatar",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "external_source": {
+ "name": "external_source",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "external_url": {
+ "name": "external_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "activity_task_id_idx": {
+ "name": "activity_task_id_idx",
+ "columns": [
+ {
+ "expression": "task_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "activity_userId_idx": {
+ "name": "activity_userId_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "activity_task_id_task_id_fk": {
+ "name": "activity_task_id_task_id_fk",
+ "tableFrom": "activity",
+ "tableTo": "task",
+ "columnsFrom": ["task_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "cascade"
+ },
+ "activity_user_id_user_id_fk": {
+ "name": "activity_user_id_user_id_fk",
+ "tableFrom": "activity",
+ "tableTo": "user",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "cascade"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "activity_task_external_source_external_url_unique": {
+ "name": "activity_task_external_source_external_url_unique",
+ "nullsNotDistinct": false,
+ "columns": ["task_id", "external_source", "external_url"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.apikey": {
+ "name": "apikey",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "config_id": {
+ "name": "config_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'default'"
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "start": {
+ "name": "start",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "reference_id": {
+ "name": "reference_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "prefix": {
+ "name": "prefix",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "key": {
+ "name": "key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "refill_interval": {
+ "name": "refill_interval",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "refill_amount": {
+ "name": "refill_amount",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_refill_at": {
+ "name": "last_refill_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": true
+ },
+ "rate_limit_enabled": {
+ "name": "rate_limit_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": true
+ },
+ "rate_limit_time_window": {
+ "name": "rate_limit_time_window",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "default": 86400000
+ },
+ "rate_limit_max": {
+ "name": "rate_limit_max",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "default": 10
+ },
+ "request_count": {
+ "name": "request_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "default": 0
+ },
+ "remaining": {
+ "name": "remaining",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_request": {
+ "name": "last_request",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "permissions": {
+ "name": "permissions",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "metadata": {
+ "name": "metadata",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "apikey_configId_idx": {
+ "name": "apikey_configId_idx",
+ "columns": [
+ {
+ "expression": "config_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "apikey_key_idx": {
+ "name": "apikey_key_idx",
+ "columns": [
+ {
+ "expression": "key",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "apikey_referenceId_idx": {
+ "name": "apikey_referenceId_idx",
+ "columns": [
+ {
+ "expression": "reference_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "apikey_userId_idx": {
+ "name": "apikey_userId_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "apikey_reference_id_user_id_fk": {
+ "name": "apikey_reference_id_user_id_fk",
+ "tableFrom": "apikey",
+ "tableTo": "user",
+ "columnsFrom": ["reference_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "apikey_user_id_user_id_fk": {
+ "name": "apikey_user_id_user_id_fk",
+ "tableFrom": "apikey",
+ "tableTo": "user",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.asset": {
+ "name": "asset",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "task_id": {
+ "name": "task_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "activity_id": {
+ "name": "activity_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "object_key": {
+ "name": "object_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "filename": {
+ "name": "filename",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "mime_type": {
+ "name": "mime_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "size": {
+ "name": "size",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "kind": {
+ "name": "kind",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'image'"
+ },
+ "surface": {
+ "name": "surface",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'description'"
+ },
+ "created_by": {
+ "name": "created_by",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "asset_workspaceId_idx": {
+ "name": "asset_workspaceId_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "asset_projectId_idx": {
+ "name": "asset_projectId_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "asset_taskId_idx": {
+ "name": "asset_taskId_idx",
+ "columns": [
+ {
+ "expression": "task_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "asset_activityId_idx": {
+ "name": "asset_activityId_idx",
+ "columns": [
+ {
+ "expression": "activity_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "asset_createdBy_idx": {
+ "name": "asset_createdBy_idx",
+ "columns": [
+ {
+ "expression": "created_by",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "asset_workspace_id_workspace_id_fk": {
+ "name": "asset_workspace_id_workspace_id_fk",
+ "tableFrom": "asset",
+ "tableTo": "workspace",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "cascade"
+ },
+ "asset_project_id_project_id_fk": {
+ "name": "asset_project_id_project_id_fk",
+ "tableFrom": "asset",
+ "tableTo": "project",
+ "columnsFrom": ["project_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "cascade"
+ },
+ "asset_task_id_task_id_fk": {
+ "name": "asset_task_id_task_id_fk",
+ "tableFrom": "asset",
+ "tableTo": "task",
+ "columnsFrom": ["task_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "cascade"
+ },
+ "asset_activity_id_activity_id_fk": {
+ "name": "asset_activity_id_activity_id_fk",
+ "tableFrom": "asset",
+ "tableTo": "activity",
+ "columnsFrom": ["activity_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "cascade"
+ },
+ "asset_created_by_user_id_fk": {
+ "name": "asset_created_by_user_id_fk",
+ "tableFrom": "asset",
+ "tableTo": "user",
+ "columnsFrom": ["created_by"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "cascade"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "asset_object_key_unique": {
+ "name": "asset_object_key_unique",
+ "nullsNotDistinct": false,
+ "columns": ["object_key"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.billing_event": {
+ "name": "billing_event",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "event_type": {
+ "name": "event_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "processed_at": {
+ "name": "processed_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.column": {
+ "name": "column",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "slug": {
+ "name": "slug",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "position": {
+ "name": "position",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "is_final": {
+ "name": "is_final",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "column_projectId_idx": {
+ "name": "column_projectId_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "column_project_id_project_id_fk": {
+ "name": "column_project_id_project_id_fk",
+ "tableFrom": "column",
+ "tableTo": "project",
+ "columnsFrom": ["project_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "cascade"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.comment": {
+ "name": "comment",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "task_id": {
+ "name": "task_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "comment_task_idx": {
+ "name": "comment_task_idx",
+ "columns": [
+ {
+ "expression": "task_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "comment_user_idx": {
+ "name": "comment_user_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "comment_task_id_task_id_fk": {
+ "name": "comment_task_id_task_id_fk",
+ "tableFrom": "comment",
+ "tableTo": "task",
+ "columnsFrom": ["task_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "cascade"
+ },
+ "comment_user_id_user_id_fk": {
+ "name": "comment_user_id_user_id_fk",
+ "tableFrom": "comment",
+ "tableTo": "user",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "cascade"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.device_code": {
+ "name": "device_code",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "device_code": {
+ "name": "device_code",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_code": {
+ "name": "user_code",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_polled_at": {
+ "name": "last_polled_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "polling_interval": {
+ "name": "polling_interval",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "client_id": {
+ "name": "client_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "scope": {
+ "name": "scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "device_code_device_code_uidx": {
+ "name": "device_code_device_code_uidx",
+ "columns": [
+ {
+ "expression": "device_code",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "device_code_user_code_uidx": {
+ "name": "device_code_user_code_uidx",
+ "columns": [
+ {
+ "expression": "user_code",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "device_code_user_id_idx": {
+ "name": "device_code_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "device_code_user_id_user_id_fk": {
+ "name": "device_code_user_id_user_id_fk",
+ "tableFrom": "device_code",
+ "tableTo": "user",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "cascade"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.external_link": {
+ "name": "external_link",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "task_id": {
+ "name": "task_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "integration_id": {
+ "name": "integration_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "resource_type": {
+ "name": "resource_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "external_id": {
+ "name": "external_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "url": {
+ "name": "url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "metadata": {
+ "name": "metadata",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "external_link_taskId_idx": {
+ "name": "external_link_taskId_idx",
+ "columns": [
+ {
+ "expression": "task_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "external_link_integrationId_idx": {
+ "name": "external_link_integrationId_idx",
+ "columns": [
+ {
+ "expression": "integration_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "external_link_externalId_idx": {
+ "name": "external_link_externalId_idx",
+ "columns": [
+ {
+ "expression": "external_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "external_link_resourceType_idx": {
+ "name": "external_link_resourceType_idx",
+ "columns": [
+ {
+ "expression": "resource_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "external_link_task_id_task_id_fk": {
+ "name": "external_link_task_id_task_id_fk",
+ "tableFrom": "external_link",
+ "tableTo": "task",
+ "columnsFrom": ["task_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "cascade"
+ },
+ "external_link_integration_id_integration_id_fk": {
+ "name": "external_link_integration_id_integration_id_fk",
+ "tableFrom": "external_link",
+ "tableTo": "integration",
+ "columnsFrom": ["integration_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "cascade"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.github_integration": {
+ "name": "github_integration",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "repository_owner": {
+ "name": "repository_owner",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "repository_name": {
+ "name": "repository_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "installation_id": {
+ "name": "installation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "is_active": {
+ "name": "is_active",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "github_integration_project_id_project_id_fk": {
+ "name": "github_integration_project_id_project_id_fk",
+ "tableFrom": "github_integration",
+ "tableTo": "project",
+ "columnsFrom": ["project_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "cascade"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "github_integration_project_id_unique": {
+ "name": "github_integration_project_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.integration": {
+ "name": "integration",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "type": {
+ "name": "type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "config": {
+ "name": "config",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "is_active": {
+ "name": "is_active",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "integration_projectId_idx": {
+ "name": "integration_projectId_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "integration_type_idx": {
+ "name": "integration_type_idx",
+ "columns": [
+ {
+ "expression": "type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "integration_project_id_project_id_fk": {
+ "name": "integration_project_id_project_id_fk",
+ "tableFrom": "integration",
+ "tableTo": "project",
+ "columnsFrom": ["project_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "cascade"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "integration_project_type_unique": {
+ "name": "integration_project_type_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "type"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.invitation": {
+ "name": "invitation",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "email": {
+ "name": "email",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role": {
+ "name": "role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "team_id": {
+ "name": "team_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'pending'"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "inviter_id": {
+ "name": "inviter_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "invitation_workspaceId_idx": {
+ "name": "invitation_workspaceId_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "invitation_email_idx": {
+ "name": "invitation_email_idx",
+ "columns": [
+ {
+ "expression": "email",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "invitation_inviterId_idx": {
+ "name": "invitation_inviterId_idx",
+ "columns": [
+ {
+ "expression": "inviter_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "invitation_workspace_id_workspace_id_fk": {
+ "name": "invitation_workspace_id_workspace_id_fk",
+ "tableFrom": "invitation",
+ "tableTo": "workspace",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "invitation_inviter_id_user_id_fk": {
+ "name": "invitation_inviter_id_user_id_fk",
+ "tableFrom": "invitation",
+ "tableTo": "user",
+ "columnsFrom": ["inviter_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.label": {
+ "name": "label",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "color": {
+ "name": "color",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "task_id": {
+ "name": "task_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "label_task_id_idx": {
+ "name": "label_task_id_idx",
+ "columns": [
+ {
+ "expression": "task_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "label_workspace_id_idx": {
+ "name": "label_workspace_id_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "label_workspace_name_unique": {
+ "name": "label_workspace_name_unique",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "where": "\"label\".\"task_id\" is null",
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "label_task_id_task_id_fk": {
+ "name": "label_task_id_task_id_fk",
+ "tableFrom": "label",
+ "tableTo": "task",
+ "columnsFrom": ["task_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "cascade"
+ },
+ "label_workspace_id_workspace_id_fk": {
+ "name": "label_workspace_id_workspace_id_fk",
+ "tableFrom": "label",
+ "tableTo": "workspace",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "cascade"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "label_task_name_unique": {
+ "name": "label_task_name_unique",
+ "nullsNotDistinct": false,
+ "columns": ["task_id", "name"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.notification": {
+ "name": "notification",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "type": {
+ "name": "type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'info'"
+ },
+ "event_data": {
+ "name": "event_data",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "is_read": {
+ "name": "is_read",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "resource_id": {
+ "name": "resource_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "resource_type": {
+ "name": "resource_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "notification_userId_idx": {
+ "name": "notification_userId_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "notification_user_id_user_id_fk": {
+ "name": "notification_user_id_user_id_fk",
+ "tableFrom": "notification",
+ "tableTo": "user",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "cascade"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.workspace_role": {
+ "name": "workspace_role",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role": {
+ "name": "role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "permission": {
+ "name": "permission",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "workspace_role_workspaceId_idx": {
+ "name": "workspace_role_workspaceId_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "workspace_role_role_idx": {
+ "name": "workspace_role_role_idx",
+ "columns": [
+ {
+ "expression": "role",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "workspace_role_workspace_id_workspace_id_fk": {
+ "name": "workspace_role_workspace_id_workspace_id_fk",
+ "tableFrom": "workspace_role",
+ "tableTo": "workspace",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "cascade"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.project": {
+ "name": "project",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "slug": {
+ "name": "slug",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "icon": {
+ "name": "icon",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "'Layout'"
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "is_public": {
+ "name": "is_public",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "archived_at": {
+ "name": "archived_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_task_number": {
+ "name": "last_task_number",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "project_workspace_id_workspace_id_fk": {
+ "name": "project_workspace_id_workspace_id_fk",
+ "tableFrom": "project",
+ "tableTo": "workspace",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "cascade"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "project_workspace_id_id_unique": {
+ "name": "project_workspace_id_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["workspace_id", "id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.session": {
+ "name": "session",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "token": {
+ "name": "token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "active_organization_id": {
+ "name": "active_organization_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "active_team_id": {
+ "name": "active_team_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "impersonated_by": {
+ "name": "impersonated_by",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "session_userId_idx": {
+ "name": "session_userId_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "session_user_id_user_id_fk": {
+ "name": "session_user_id_user_id_fk",
+ "tableFrom": "session",
+ "tableTo": "user",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "session_token_unique": {
+ "name": "session_token_unique",
+ "nullsNotDistinct": false,
+ "columns": ["token"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.task_relation": {
+ "name": "task_relation",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "source_task_id": {
+ "name": "source_task_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_task_id": {
+ "name": "target_task_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "relation_type": {
+ "name": "relation_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "task_relation_source_idx": {
+ "name": "task_relation_source_idx",
+ "columns": [
+ {
+ "expression": "source_task_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "task_relation_target_idx": {
+ "name": "task_relation_target_idx",
+ "columns": [
+ {
+ "expression": "target_task_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "task_relation_source_task_id_task_id_fk": {
+ "name": "task_relation_source_task_id_task_id_fk",
+ "tableFrom": "task_relation",
+ "tableTo": "task",
+ "columnsFrom": ["source_task_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "cascade"
+ },
+ "task_relation_target_task_id_task_id_fk": {
+ "name": "task_relation_target_task_id_task_id_fk",
+ "tableFrom": "task_relation",
+ "tableTo": "task",
+ "columnsFrom": ["target_task_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "cascade"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.task_reminder_sent": {
+ "name": "task_reminder_sent",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "task_id": {
+ "name": "task_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "reminder_type": {
+ "name": "reminder_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "task_reminder_sent_taskId_idx": {
+ "name": "task_reminder_sent_taskId_idx",
+ "columns": [
+ {
+ "expression": "task_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "task_reminder_sent_task_id_task_id_fk": {
+ "name": "task_reminder_sent_task_id_task_id_fk",
+ "tableFrom": "task_reminder_sent",
+ "tableTo": "task",
+ "columnsFrom": ["task_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "cascade"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "task_reminder_sent_task_type_unique": {
+ "name": "task_reminder_sent_task_type_unique",
+ "nullsNotDistinct": false,
+ "columns": ["task_id", "reminder_type"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.task": {
+ "name": "task",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "position": {
+ "name": "position",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "default": 0
+ },
+ "number": {
+ "name": "number",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "default": 1
+ },
+ "assignee_id": {
+ "name": "assignee_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'to-do'"
+ },
+ "column_id": {
+ "name": "column_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "priority": {
+ "name": "priority",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "'low'"
+ },
+ "start_date": {
+ "name": "start_date",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "due_date": {
+ "name": "due_date",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "task_projectId_idx": {
+ "name": "task_projectId_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "task_dueDate_idx": {
+ "name": "task_dueDate_idx",
+ "columns": [
+ {
+ "expression": "due_date",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "task_assigneeId_idx": {
+ "name": "task_assigneeId_idx",
+ "columns": [
+ {
+ "expression": "assignee_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "task_columnId_idx": {
+ "name": "task_columnId_idx",
+ "columns": [
+ {
+ "expression": "column_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "task_project_id_project_id_fk": {
+ "name": "task_project_id_project_id_fk",
+ "tableFrom": "task",
+ "tableTo": "project",
+ "columnsFrom": ["project_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "cascade"
+ },
+ "task_assignee_id_user_id_fk": {
+ "name": "task_assignee_id_user_id_fk",
+ "tableFrom": "task",
+ "tableTo": "user",
+ "columnsFrom": ["assignee_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "cascade"
+ },
+ "task_column_id_column_id_fk": {
+ "name": "task_column_id_column_id_fk",
+ "tableFrom": "task",
+ "tableTo": "column",
+ "columnsFrom": ["column_id"],
+ "columnsTo": ["id"],
+ "onDelete": "set null",
+ "onUpdate": "cascade"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "task_project_number_unique": {
+ "name": "task_project_number_unique",
+ "nullsNotDistinct": false,
+ "columns": ["project_id", "number"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.team": {
+ "name": "team",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "team_workspaceId_idx": {
+ "name": "team_workspaceId_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "team_workspace_id_workspace_id_fk": {
+ "name": "team_workspace_id_workspace_id_fk",
+ "tableFrom": "team",
+ "tableTo": "workspace",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.team_member": {
+ "name": "team_member",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "team_id": {
+ "name": "team_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "teamMember_teamId_idx": {
+ "name": "teamMember_teamId_idx",
+ "columns": [
+ {
+ "expression": "team_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "teamMember_userId_idx": {
+ "name": "teamMember_userId_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "team_member_team_id_team_id_fk": {
+ "name": "team_member_team_id_team_id_fk",
+ "tableFrom": "team_member",
+ "tableTo": "team",
+ "columnsFrom": ["team_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "team_member_user_id_user_id_fk": {
+ "name": "team_member_user_id_user_id_fk",
+ "tableFrom": "team_member",
+ "tableTo": "user",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.time_entry": {
+ "name": "time_entry",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "task_id": {
+ "name": "task_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "start_time": {
+ "name": "start_time",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "end_time": {
+ "name": "end_time",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "duration": {
+ "name": "duration",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "default": 0
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "time_entry_taskId_idx": {
+ "name": "time_entry_taskId_idx",
+ "columns": [
+ {
+ "expression": "task_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "time_entry_userId_idx": {
+ "name": "time_entry_userId_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "time_entry_task_id_task_id_fk": {
+ "name": "time_entry_task_id_task_id_fk",
+ "tableFrom": "time_entry",
+ "tableTo": "task",
+ "columnsFrom": ["task_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "cascade"
+ },
+ "time_entry_user_id_user_id_fk": {
+ "name": "time_entry_user_id_user_id_fk",
+ "tableFrom": "time_entry",
+ "tableTo": "user",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "cascade"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.user": {
+ "name": "user",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "email": {
+ "name": "email",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "email_verified": {
+ "name": "email_verified",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "image": {
+ "name": "image",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "locale": {
+ "name": "locale",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "is_anonymous": {
+ "name": "is_anonymous",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "role": {
+ "name": "role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "banned": {
+ "name": "banned",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "ban_reason": {
+ "name": "ban_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ban_expires": {
+ "name": "ban_expires",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "user_email_unique": {
+ "name": "user_email_unique",
+ "nullsNotDistinct": false,
+ "columns": ["email"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.user_notification_preference": {
+ "name": "user_notification_preference",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "email_enabled": {
+ "name": "email_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "ntfy_enabled": {
+ "name": "ntfy_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "ntfy_server_url": {
+ "name": "ntfy_server_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ntfy_topic": {
+ "name": "ntfy_topic",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ntfy_token": {
+ "name": "ntfy_token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "gotify_enabled": {
+ "name": "gotify_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "gotify_server_url": {
+ "name": "gotify_server_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "gotify_token": {
+ "name": "gotify_token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "webhook_enabled": {
+ "name": "webhook_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "webhook_url": {
+ "name": "webhook_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "webhook_secret": {
+ "name": "webhook_secret",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "task_assignment_enabled": {
+ "name": "task_assignment_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "task_comment_enabled": {
+ "name": "task_comment_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "task_status_change_enabled": {
+ "name": "task_status_change_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "due_date_reminder_enabled": {
+ "name": "due_date_reminder_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "due_date_reminder_lead_time_minutes": {
+ "name": "due_date_reminder_lead_time_minutes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 1440
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "user_notification_preference_user_id_user_id_fk": {
+ "name": "user_notification_preference_user_id_user_id_fk",
+ "tableFrom": "user_notification_preference",
+ "tableTo": "user",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "cascade"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "user_notification_preference_user_id_unique": {
+ "name": "user_notification_preference_user_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["user_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.user_notification_workspace_project": {
+ "name": "user_notification_workspace_project",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workspace_rule_id": {
+ "name": "workspace_rule_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "user_notification_workspace_project_ruleId_idx": {
+ "name": "user_notification_workspace_project_ruleId_idx",
+ "columns": [
+ {
+ "expression": "workspace_rule_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "user_notification_workspace_project_projectId_idx": {
+ "name": "user_notification_workspace_project_projectId_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "user_notification_workspace_project_workspaceId_projectId_idx": {
+ "name": "user_notification_workspace_project_workspaceId_projectId_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "unwp_workspaceId_workspaceRuleId_idx": {
+ "name": "unwp_workspaceId_workspaceRuleId_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "workspace_rule_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "user_notification_workspace_project_workspace_id_workspace_id_fk": {
+ "name": "user_notification_workspace_project_workspace_id_workspace_id_fk",
+ "tableFrom": "user_notification_workspace_project",
+ "tableTo": "workspace",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "cascade"
+ },
+ "user_notification_workspace_project_workspace_id_workspace_rule_id_user_notification_workspace_rule_workspace_id_id_fk": {
+ "name": "user_notification_workspace_project_workspace_id_workspace_rule_id_user_notification_workspace_rule_workspace_id_id_fk",
+ "tableFrom": "user_notification_workspace_project",
+ "tableTo": "user_notification_workspace_rule",
+ "columnsFrom": ["workspace_id", "workspace_rule_id"],
+ "columnsTo": ["workspace_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "cascade"
+ },
+ "user_notification_workspace_project_workspace_id_project_id_project_workspace_id_id_fk": {
+ "name": "user_notification_workspace_project_workspace_id_project_id_project_workspace_id_id_fk",
+ "tableFrom": "user_notification_workspace_project",
+ "tableTo": "project",
+ "columnsFrom": ["workspace_id", "project_id"],
+ "columnsTo": ["workspace_id", "id"],
+ "onDelete": "cascade",
+ "onUpdate": "cascade"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "user_notification_workspace_project_rule_project_unique": {
+ "name": "user_notification_workspace_project_rule_project_unique",
+ "nullsNotDistinct": false,
+ "columns": ["workspace_rule_id", "project_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.user_notification_workspace_rule": {
+ "name": "user_notification_workspace_rule",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "is_active": {
+ "name": "is_active",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "email_enabled": {
+ "name": "email_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "ntfy_enabled": {
+ "name": "ntfy_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "gotify_enabled": {
+ "name": "gotify_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "webhook_enabled": {
+ "name": "webhook_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "project_mode": {
+ "name": "project_mode",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'all'"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "user_notification_workspace_rule_userId_idx": {
+ "name": "user_notification_workspace_rule_userId_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "user_notification_workspace_rule_workspaceId_idx": {
+ "name": "user_notification_workspace_rule_workspaceId_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "user_notification_workspace_rule_user_id_user_id_fk": {
+ "name": "user_notification_workspace_rule_user_id_user_id_fk",
+ "tableFrom": "user_notification_workspace_rule",
+ "tableTo": "user",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "cascade"
+ },
+ "user_notification_workspace_rule_workspace_id_workspace_id_fk": {
+ "name": "user_notification_workspace_rule_workspace_id_workspace_id_fk",
+ "tableFrom": "user_notification_workspace_rule",
+ "tableTo": "workspace",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "cascade"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "user_notification_workspace_rule_user_workspace_unique": {
+ "name": "user_notification_workspace_rule_user_workspace_unique",
+ "nullsNotDistinct": false,
+ "columns": ["user_id", "workspace_id"]
+ },
+ "user_notification_workspace_rule_workspace_id_id_unique": {
+ "name": "user_notification_workspace_rule_workspace_id_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["workspace_id", "id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.verification": {
+ "name": "verification",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "identifier": {
+ "name": "identifier",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "value": {
+ "name": "value",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "verification_identifier_idx": {
+ "name": "verification_identifier_idx",
+ "columns": [
+ {
+ "expression": "identifier",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.workflow_rule": {
+ "name": "workflow_rule",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "integration_type": {
+ "name": "integration_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "event_type": {
+ "name": "event_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "column_id": {
+ "name": "column_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "workflow_rule_projectId_idx": {
+ "name": "workflow_rule_projectId_idx",
+ "columns": [
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "workflow_rule_columnId_idx": {
+ "name": "workflow_rule_columnId_idx",
+ "columns": [
+ {
+ "expression": "column_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "workflow_rule_project_id_project_id_fk": {
+ "name": "workflow_rule_project_id_project_id_fk",
+ "tableFrom": "workflow_rule",
+ "tableTo": "project",
+ "columnsFrom": ["project_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "cascade"
+ },
+ "workflow_rule_column_id_column_id_fk": {
+ "name": "workflow_rule_column_id_column_id_fk",
+ "tableFrom": "workflow_rule",
+ "tableTo": "column",
+ "columnsFrom": ["column_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "cascade"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.workspace": {
+ "name": "workspace",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "slug": {
+ "name": "slug",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "logo": {
+ "name": "logo",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "metadata": {
+ "name": "metadata",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "workspace_slug_unique": {
+ "name": "workspace_slug_unique",
+ "nullsNotDistinct": false,
+ "columns": ["slug"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.workspace_billing": {
+ "name": "workspace_billing",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "founding_free": {
+ "name": "founding_free",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "trial_ends_at": {
+ "name": "trial_ends_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "creem_customer_id": {
+ "name": "creem_customer_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "creem_subscription_id": {
+ "name": "creem_subscription_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "creem_product_id": {
+ "name": "creem_product_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "plan": {
+ "name": "plan",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "billing_interval": {
+ "name": "billing_interval",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "seats": {
+ "name": "seats",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 1
+ },
+ "current_period_end": {
+ "name": "current_period_end",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "canceled_at": {
+ "name": "canceled_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "workspace_billing_workspaceId_idx": {
+ "name": "workspace_billing_workspaceId_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "workspace_billing_workspace_id_workspace_id_fk": {
+ "name": "workspace_billing_workspace_id_workspace_id_fk",
+ "tableFrom": "workspace_billing",
+ "tableTo": "workspace",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "cascade"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "workspace_billing_workspace_id_unique": {
+ "name": "workspace_billing_workspace_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["workspace_id"]
+ },
+ "workspace_billing_creem_subscription_id_unique": {
+ "name": "workspace_billing_creem_subscription_id_unique",
+ "nullsNotDistinct": false,
+ "columns": ["creem_subscription_id"]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.workspace_member": {
+ "name": "workspace_member",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "workspace_id": {
+ "name": "workspace_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role": {
+ "name": "role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'member'"
+ },
+ "joined_at": {
+ "name": "joined_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "workspace_member_workspaceId_idx": {
+ "name": "workspace_member_workspaceId_idx",
+ "columns": [
+ {
+ "expression": "workspace_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "workspace_member_userId_idx": {
+ "name": "workspace_member_userId_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "workspace_member_workspace_id_workspace_id_fk": {
+ "name": "workspace_member_workspace_id_workspace_id_fk",
+ "tableFrom": "workspace_member",
+ "tableTo": "workspace",
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "workspace_member_user_id_user_id_fk": {
+ "name": "workspace_member_user_id_user_id_fk",
+ "tableFrom": "workspace_member",
+ "tableTo": "user",
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ }
+ },
+ "enums": {},
+ "schemas": {},
+ "sequences": {},
+ "roles": {},
+ "policies": {},
+ "views": {},
+ "_meta": {
+ "columns": {},
+ "schemas": {},
+ "tables": {}
+ }
+}
diff --git a/apps/api/drizzle/meta/_journal.json b/apps/api/drizzle/meta/_journal.json
index bf8b115b2..0d8fbf60f 100644
--- a/apps/api/drizzle/meta/_journal.json
+++ b/apps/api/drizzle/meta/_journal.json
@@ -246,6 +246,13 @@
"when": 1785240609705,
"tag": "0034_icy_cable",
"breakpoints": true
+ },
+ {
+ "idx": 35,
+ "version": "7",
+ "when": 1785258280966,
+ "tag": "0035_swift_captain_cross",
+ "breakpoints": true
}
]
}
diff --git a/apps/api/package.json b/apps/api/package.json
index d966ce788..8c8dae97e 100644
--- a/apps/api/package.json
+++ b/apps/api/package.json
@@ -46,6 +46,7 @@
"@valibot/to-json-schema": "^1.7.1",
"bcryptjs": "^3.0.2",
"better-auth": "^1.6.9",
+ "creem": "^1.6.0",
"croner": "^10.0.1",
"drizzle-kit": "^0.31.10",
"drizzle-orm": "^0.45.2",
diff --git a/apps/api/src/auth.ts b/apps/api/src/auth.ts
index ce7a9d198..df24a6912 100644
--- a/apps/api/src/auth.ts
+++ b/apps/api/src/auth.ts
@@ -34,6 +34,7 @@ import type { AccessControl } from "better-auth/plugins/access";
import type { UserWithAnonymous } from "better-auth/plugins/anonymous";
import { config } from "dotenv-mono";
import { count, eq, sql } from "drizzle-orm";
+import { syncWorkspaceSeats } from "./billing/controllers/sync-seats";
import db, { schema } from "./database";
import { publishEvent } from "./events";
import { checkRegistrationAllowed } from "./utils/check-registration-allowed";
@@ -384,6 +385,20 @@ export const auth = betterAuth({
ownerId: user.id,
});
},
+ afterAddMember: async ({ member }) => {
+ if (member?.organizationId) {
+ void syncWorkspaceSeats(member.organizationId).catch((error) => {
+ console.error("Seat sync after member add failed:", error);
+ });
+ }
+ },
+ afterRemoveMember: async ({ member }) => {
+ if (member?.organizationId) {
+ void syncWorkspaceSeats(member.organizationId).catch((error) => {
+ console.error("Seat sync after member remove failed:", error);
+ });
+ }
+ },
},
async sendInvitationEmail(data) {
const inviteLink = `${process.env.KANEO_CLIENT_URL}/invitation/accept/${data.id}`;
diff --git a/apps/api/src/billing/config.ts b/apps/api/src/billing/config.ts
new file mode 100644
index 000000000..1aaf2e234
--- /dev/null
+++ b/apps/api/src/billing/config.ts
@@ -0,0 +1,69 @@
+import { isCloud } from "../utils/is-cloud";
+
+export type Plan = "personal" | "team";
+export type BillingInterval = "monthly" | "annual";
+
+const PRODUCT_ENV_KEYS: Record<Plan, Record<BillingInterval, string>> = {
+ personal: {
+ monthly: "CREEM_PRODUCT_PERSONAL_MONTHLY",
+ annual: "CREEM_PRODUCT_PERSONAL_ANNUAL",
+ },
+ team: {
+ monthly: "CREEM_PRODUCT_TEAM_MONTHLY",
+ annual: "CREEM_PRODUCT_TEAM_ANNUAL",
+ },
+};
+
+export function isBillingEnabled() {
+ return Boolean(
+ isCloud() && process.env.CREEM_API_KEY && process.env.CREEM_WEBHOOK_SECRET,
+ );
+}
+
+export function creemApiBaseUrl() {
+ return process.env.CREEM_TEST_MODE === "true"
+ ? "https://test-api.creem.io"
+ : "https://api.creem.io";
+}
+
+export function creemApiKey() {
+ return process.env.CREEM_API_KEY ?? "";
+}
+
+export function creemWebhookSecret() {
+ return process.env.CREEM_WEBHOOK_SECRET ?? "";
+}
+
+export function trialDays() {
+ const parsed = Number.parseInt(process.env.BILLING_TRIAL_DAYS ?? "14", 10);
+ return Number.isNaN(parsed) ? 14 : parsed;
+}
+
+export function foundingCutoff(): Date | null {
+ const raw = process.env.BILLING_FOUNDING_CUTOFF;
+ if (!raw) {
+ return null;
+ }
+ const parsed = new Date(raw);
+ return Number.isNaN(parsed.getTime()) ? null : parsed;
+}
+
+export function productIdFor(
+ plan: Plan,
+ interval: BillingInterval,
+): string | null {
+ return process.env[PRODUCT_ENV_KEYS[plan][interval]] ?? null;
+}
+
+export function planForProductId(
+ productId: string,
+): { plan: Plan; interval: BillingInterval } | null {
+ for (const plan of ["personal", "team"] as const) {
+ for (const interval of ["monthly", "annual"] as const) {
+ if (process.env[PRODUCT_ENV_KEYS[plan][interval]] === productId) {
+ return { plan, interval };
+ }
+ }
+ }
+ return null;
+}
diff --git a/apps/api/src/billing/controllers/create-checkout.ts b/apps/api/src/billing/controllers/create-checkout.ts
new file mode 100644
index 000000000..18dfc4cbc
--- /dev/null
+++ b/apps/api/src/billing/controllers/create-checkout.ts
@@ -0,0 +1,64 @@
+import { createId } from "@paralleldrive/cuid2";
+import { count, eq } from "drizzle-orm";
+import { HTTPException } from "hono/http-exception";
+import db from "../../database";
+import { workspaceUserTable } from "../../database/schema";
+import {
+ type BillingInterval,
+ isBillingEnabled,
+ type Plan,
+ productIdFor,
+} from "../config";
+import { createCheckoutSession } from "../creem-client";
+import { getOrCreateWorkspaceBilling } from "./get-workspace-billing";
+
+async function createCheckout({
+ workspaceId,
+ plan,
+ interval,
+ userEmail,
+}: {
+ workspaceId: string;
+ plan: Plan;
+ interval: BillingInterval;
+ userEmail: string;
+}) {
+ if (!isBillingEnabled()) {
+ throw new HTTPException(400, { message: "Billing is not enabled" });
+ }
+
+ const productId = productIdFor(plan, interval);
+ if (!productId) {
+ throw new HTTPException(400, { message: "Unknown plan" });
+ }
+
+ const billing = await getOrCreateWorkspaceBilling(workspaceId);
+ if (billing.status === "active") {
+ throw new HTTPException(400, {
+ message: "Workspace already has an active subscription",
+ });
+ }
+
+ let units = 1;
+ if (plan === "team") {
+ const [members] = await db
+ .select({ value: count() })
+ .from(workspaceUserTable)
+ .where(eq(workspaceUserTable.workspaceId, workspaceId));
+ units = Math.max(1, members?.value ?? 1);
+ }
+
+ const clientUrl = process.env.KANEO_CLIENT_URL ?? "";
+ const { checkoutUrl } = await createCheckoutSession({
+ productId,
+ units,
+ successUrl: `${clientUrl}/dashboard/settings/workspace/billing?checkout=success`,
+ requestId: createId(),
+ customerEmail: userEmail,
+ metadata: { workspaceId, plan, interval },
+ });
+
+ return { checkoutUrl };
+}
+
+export default createCheckout;
diff --git a/apps/api/src/billing/controllers/get-workspace-billing.ts b/apps/api/src/billing/controllers/get-workspace-billing.ts
new file mode 100644
index 000000000..d340f763a
--- /dev/null
+++ b/apps/api/src/billing/controllers/get-workspace-billing.ts
@@ -0,0 +1,102 @@
+import { eq } from "drizzle-orm";
+import { HTTPException } from "hono/http-exception";
+import db from "../../database";
+import { workspaceBillingTable, workspaceTable } from "../../database/schema";
+import { foundingCutoff, isBillingEnabled, trialDays } from "../config";
+
+const ACTIVE_STATUSES = new Set([
+ "active",
+ "trialing",
+ "past_due",
+ "scheduled_cancel",
+]);
+
+export async function getOrCreateWorkspaceBilling(workspaceId: string) {
+ const [existing] = await db
+ .select()
+ .from(workspaceBillingTable)
+ .where(eq(workspaceBillingTable.workspaceId, workspaceId));
+
+ if (existing) {
+ return existing;
+ }
+
+ const workspace = await db.query.workspaceTable.findFirst({
+ where: eq(workspaceTable.id, workspaceId),
+ });
+
+ if (!workspace) {
+ throw new HTTPException(404, { message: "Workspace not found" });
+ }
+
+ const cutoff = foundingCutoff();
+ const isFounding = cutoff !== null && workspace.createdAt <= cutoff;
+ const trialEndsAt = isFounding
+ ? null
+ : new Date(Date.now() + trialDays() * 24 * 60 * 60 * 1000);
+
+ const [created] = await db
+ .insert(workspaceBillingTable)
+ .values({
+ workspaceId,
+ foundingFree: isFounding,
+ trialEndsAt,
+ })
+ .onConflictDoNothing({ target: workspaceBillingTable.workspaceId })
+ .returning();
+
+ if (created) {
+ return created;
+ }
+
+ const [raced] = await db
+ .select()
+ .from(workspaceBillingTable)
+ .where(eq(workspaceBillingTable.workspaceId, workspaceId));
+
+ if (!raced) {
+ throw new HTTPException(500, {
+ message: "Failed to initialize workspace billing",
+ });
+ }
+ return raced;
+}
+
+export function computeEntitlement(
+ billing: typeof workspaceBillingTable.$inferSelect,
+) {
+ if (!isBillingEnabled()) {
+ return { active: true, reason: "billing_disabled" as const };
+ }
+ if (billing.foundingFree) {
+ return { active: true, reason: "founding_free" as const };
+ }
+ if (billing.status && ACTIVE_STATUSES.has(billing.status)) {
+ return { active: true, reason: "subscription" as const };
+ }
+ if (billing.trialEndsAt && billing.trialEndsAt.getTime() > Date.now()) {
+ return { active: true, reason: "trial" as const };
+ }
+ return { active: false, reason: "expired" as const };
+}
+
+async function getWorkspaceBilling(workspaceId: string) {
+ const billing = await getOrCreateWorkspaceBilling(workspaceId);
+ const entitlement = computeEntitlement(billing);
+
+ return {
+ billingEnabled: isBillingEnabled(),
+ entitlement,
+ foundingFree: billing.foundingFree,
+ trialEndsAt: billing.trialEndsAt,
+ plan: billing.plan,
+ billingInterval: billing.billingInterval,
+ status: billing.status,
+ seats: billing.seats,
+ currentPeriodEnd: billing.currentPeriodEnd,
+ canceledAt: billing.canceledAt,
+ hasCustomer: Boolean(billing.creemCustomerId),
+ };
+}
+
+export default getWorkspaceBilling;
diff --git a/apps/api/src/billing/controllers/handle-webhook.ts b/apps/api/src/billing/controllers/handle-webhook.ts
new file mode 100644
index 000000000..6e56eab2e
--- /dev/null
+++ b/apps/api/src/billing/controllers/handle-webhook.ts
@@ -0,0 +1,146 @@
+import { eq } from "drizzle-orm";
+import db from "../../database";
+import {
+ billingEventTable,
+ workspaceBillingTable,
+} from "../../database/schema";
+import { planForProductId } from "../config";
+
+type WebhookObject = {
+ id?: string;
+ status?: string;
+ metadata?: Record<string, string>;
+ product?: { id?: string };
+ customer?: { id?: string };
+ subscription?: {
+ id?: string;
+ status?: string;
+ metadata?: Record<string, string>;
+ product?: { id?: string };
+ customer?: { id?: string };
+ };
+ current_period_end_date?: string;
+ currentPeriodEndDate?: string;
+ canceled_at?: string | null;
+ canceledAt?: string | null;
+ items?: Array<{ units?: number }>;
+};
+
+export type BillingWebhookEvent = {
+ id?: string;
+ type: string;
+ data: WebhookObject;
+};
+
+function parseDate(value: string | null | undefined) {
+ if (!value) {
+ return null;
+ }
+ const parsed = new Date(value);
+ return Number.isNaN(parsed.getTime()) ? null : parsed;
+}
+
+const SUBSCRIPTION_EVENT_STATUS: Record<string, string> = {
+ "subscription.active": "active",
+ "subscription.trialing": "trialing",
+ "subscription.paid": "active",
+ "subscription.scheduled_cancel": "scheduled_cancel",
+ "subscription.canceled": "canceled",
+ "subscription.past_due": "past_due",
+ "subscription.expired": "expired",
+ "subscription.paused": "paused",
+};
+
+async function handleWebhook(event: BillingWebhookEvent) {
+ if (event.id) {
+ const [claimed] = await db
+ .insert(billingEventTable)
+ .values({ id: event.id, eventType: event.type })
+ .onConflictDoNothing({ target: billingEventTable.id })
+ .returning();
+
+ if (!claimed) {
+ return { processed: false, duplicate: true };
+ }
+ }
+
+ const object = event.data;
+
+ if (event.type === "checkout.completed") {
+ const workspaceId =
+ object.metadata?.workspaceId ??
+ object.subscription?.metadata?.workspaceId;
+ if (!workspaceId) {
+ console.error("billing: checkout.completed without workspaceId");
+ return { processed: false, duplicate: false };
+ }
+
+ const productId = object.product?.id ?? object.subscription?.product?.id;
+ const mapped = productId ? planForProductId(productId) : null;
+
+ await db
+ .update(workspaceBillingTable)
+ .set({
+ creemCustomerId:
+ object.customer?.id ?? object.subscription?.customer?.id ?? null,
+ creemSubscriptionId: object.subscription?.id ?? null,
+ creemProductId: productId ?? null,
+ plan: mapped?.plan ?? null,
+ billingInterval: mapped?.interval ?? null,
+ status: object.subscription?.status ?? "active",
+ })
+ .where(eq(workspaceBillingTable.workspaceId, workspaceId));
+ return { processed: true, duplicate: false };
+ }
+
+ if (event.type.startsWith("subscription.")) {
+ const subscriptionId = object.id;
+ if (!subscriptionId) {
+ return { processed: false, duplicate: false };
+ }
+
+ const productId = object.product?.id;
+ const mapped = productId ? planForProductId(productId) : null;
+ const units = object.items?.[0]?.units;
+
+ const updates: Partial<typeof workspaceBillingTable.$inferInsert> = {
+ status:
+ object.status ?? SUBSCRIPTION_EVENT_STATUS[event.type] ?? undefined,
+ currentPeriodEnd: parseDate(
+ object.current_period_end_date ?? object.currentPeriodEndDate,
+ ),
+ canceledAt: parseDate(object.canceled_at ?? object.canceledAt),
+ };
+ if (productId) {
+ updates.creemProductId = productId;
+ updates.plan = mapped?.plan ?? null;
+ updates.billingInterval = mapped?.interval ?? null;
+ }
+ if (typeof units === "number" && units > 0) {
+ updates.seats = units;
+ }
+ if (object.customer?.id) {
+ updates.creemCustomerId = object.customer.id;
+ }
+
+ const updated = await db
+ .update(workspaceBillingTable)
+ .set(updates)
+ .where(eq(workspaceBillingTable.creemSubscriptionId, subscriptionId))
+ .returning({ id: workspaceBillingTable.id });
+
+ if (updated.length === 0 && object.metadata?.workspaceId) {
+ await db
+ .update(workspaceBillingTable)
+ .set({ ...updates, creemSubscriptionId: subscriptionId })
+ .where(
+ eq(workspaceBillingTable.workspaceId, object.metadata.workspaceId),
+ );
+ }
+ return { processed: true, duplicate: false };
+ }
+
+ return { processed: true, duplicate: false };
+}
+
+export default handleWebhook;
diff --git a/apps/api/src/billing/controllers/require-entitlement.ts b/apps/api/src/billing/controllers/require-entitlement.ts
new file mode 100644
index 000000000..e981329f7
--- /dev/null
+++ b/apps/api/src/billing/controllers/require-entitlement.ts
@@ -0,0 +1,42 @@
+import { eq } from "drizzle-orm";
+import { HTTPException } from "hono/http-exception";
+import db from "../../database";
+import { projectTable } from "../../database/schema";
+import { isBillingEnabled } from "../config";
+import {
+ computeEntitlement,
+ getOrCreateWorkspaceBilling,
+} from "./get-workspace-billing";
+
+export async function requireWorkspaceEntitlement(workspaceId: string) {
+ if (!isBillingEnabled()) {
+ return;
+ }
+
+ const billing = await getOrCreateWorkspaceBilling(workspaceId);
+ const entitlement = computeEntitlement(billing);
+
+ if (!entitlement.active) {
+ throw new HTTPException(402, {
+ message:
+ "This workspace's Kaneo Cloud plan has expired. Subscribe to continue creating and editing.",
+ });
+ }
+}
+
+export async function requireProjectEntitlement(projectId: string) {
+ if (!isBillingEnabled()) {
+ return;
+ }
+
+ const [project] = await db
+ .select({ workspaceId: projectTable.workspaceId })
+ .from(projectTable)
+ .where(eq(projectTable.id, projectId));
+
+ if (!project) {
+ return;
+ }
+
+ await requireWorkspaceEntitlement(project.workspaceId);
+}
diff --git a/apps/api/src/billing/controllers/sync-seats.ts b/apps/api/src/billing/controllers/sync-seats.ts
new file mode 100644
index 000000000..c999e067d
--- /dev/null
+++ b/apps/api/src/billing/controllers/sync-seats.ts
@@ -0,0 +1,51 @@
+import { count, eq } from "drizzle-orm";
+import db from "../../database";
+import {
+ workspaceBillingTable,
+ workspaceUserTable,
+} from "../../database/schema";
+import { isBillingEnabled } from "../config";
+import { updateSubscriptionSeats } from "../creem-client";
+
+export async function syncWorkspaceSeats(workspaceId: string) {
+ if (!isBillingEnabled()) {
+ return;
+ }
+
+ const [billing] = await db
+ .select()
+ .from(workspaceBillingTable)
+ .where(eq(workspaceBillingTable.workspaceId, workspaceId));
+
+ if (
+ !billing?.creemSubscriptionId ||
+ !billing.creemProductId ||
+ billing.plan !== "team" ||
+ (billing.status !== "active" && billing.status !== "trialing")
+ ) {
+ return;
+ }
+
+ const [members] = await db
+ .select({ value: count() })
+ .from(workspaceUserTable)
+ .where(eq(workspaceUserTable.workspaceId, workspaceId));
+
+ const seats = Math.max(1, members?.value ?? 1);
+ if (seats === billing.seats) {
+ return;
+ }
+
+ const result = await updateSubscriptionSeats({
+ subscriptionId: billing.creemSubscriptionId,
+ productId: billing.creemProductId,
+ units: seats,
+ });
+
+ if (result.ok) {
+ await db
+ .update(workspaceBillingTable)
+ .set({ seats })
+ .where(eq(workspaceBillingTable.workspaceId, workspaceId));
+ }
+}
diff --git a/apps/api/src/billing/creem-client.ts b/apps/api/src/billing/creem-client.ts
new file mode 100644
index 000000000..cb6c9a6fd
--- /dev/null
+++ b/apps/api/src/billing/creem-client.ts
@@ -0,0 +1,71 @@
+import { Creem } from "creem";
+import { HTTPException } from "hono/http-exception";
+import { creemApiKey } from "./config";
+
+function creemClient() {
+ return new Creem({
+ apiKey: creemApiKey(),
+ server: process.env.CREEM_TEST_MODE === "true" ? "test" : "prod",
+ });
+}
+
+export async function createCheckoutSession(input: {
+ productId: string;
+ units: number;
+ successUrl: string;
+ requestId: string;
+ customerEmail: string;
+ metadata: Record<string, string>;
+}) {
+ try {
+ const checkout = await creemClient().checkouts.create({
+ productId: input.productId,
+ units: input.units,
+ successUrl: input.successUrl,
+ requestId: input.requestId,
+ customer: { email: input.customerEmail },
+ metadata: input.metadata,
+ });
+
+ if (!checkout.checkoutUrl) {
+ throw new Error("Checkout session has no URL");
+ }
+ return { checkoutUrl: checkout.checkoutUrl };
+ } catch (error) {
+ console.error("Creem checkout creation failed:", error);
+ throw new HTTPException(502, {
+ message: "Billing provider request failed",
+ });
+ }
+}
+
+export async function updateSubscriptionSeats(input: {
+ subscriptionId: string;
+ productId: string;
+ units: number;
+}) {
+ try {
+ await creemClient().subscriptions.update(input.subscriptionId, {
+ items: [{ productId: input.productId, units: input.units }],
+ updateBehavior: "proration-charge",
+ });
+ return { ok: true as const };
+ } catch (error) {
+ console.error("Creem seat update failed:", error);
+ return { ok: false as const };
+ }
+}
+
+export async function createCustomerPortalLink(customerId: string) {
+ try {
+ const links = await creemClient().customers.generateBillingLinks({
+ customerId,
+ });
+ return { portalUrl: links.customerPortalLink };
+ } catch (error) {
+ console.error("Creem portal link creation failed:", error);
+ throw new HTTPException(502, {
+ message: "Billing provider request failed",
+ });
+ }
+}
diff --git a/apps/api/src/billing/creem-webhooks.d.ts b/apps/api/src/billing/creem-webhooks.d.ts
new file mode 100644
index 000000000..ce2f1c69b
--- /dev/null
+++ b/apps/api/src/billing/creem-webhooks.d.ts
@@ -0,0 +1,14 @@
+declare module "creem/webhooks.js" {
+ export class WebhookVerificationError extends Error {}
+
+ export function constructWebhookEvent<TData = unknown>(
+ payload: string | ArrayBuffer | Uint8Array,
+ headers: Record<string, string | string[] | undefined>,
+ options: string | { secret: string },
+ ): Promise<{
+ id?: string;
+ type: string;
+ data: TData;
+ createdAt?: number;
+ }>;
+}
diff --git a/apps/api/src/billing/index.ts b/apps/api/src/billing/index.ts
new file mode 100644
index 000000000..25974afc4
--- /dev/null
+++ b/apps/api/src/billing/index.ts
@@ -0,0 +1,145 @@
+import { constructWebhookEvent } from "creem/webhooks.js";
+import { and, eq, inArray } from "drizzle-orm";
+import { Hono } from "hono";
+import { HTTPException } from "hono/http-exception";
+import { describeRoute, validator } from "hono-openapi";
+import * as v from "valibot";
+import db from "../database";
+import { workspaceUserTable } from "../database/schema";
+import { validateWorkspaceAccess } from "../utils/validate-workspace-access";
+import { creemWebhookSecret, isBillingEnabled } from "./config";
+import createCheckout from "./controllers/create-checkout";
+import getWorkspaceBilling, {
+ getOrCreateWorkspaceBilling,
+} from "./controllers/get-workspace-billing";
+import handleWebhook, {
+ type BillingWebhookEvent,
+} from "./controllers/handle-webhook";
+import { createCustomerPortalLink } from "./creem-client";
+
+type Variables = {
+ userId: string;
+ userEmail: string;
+};
+
+async function requireBillingManager(userId: string, workspaceId: string) {
+ await validateWorkspaceAccess(userId, workspaceId);
+
+ const [member] = await db
+ .select({ role: workspaceUserTable.role })
+ .from(workspaceUserTable)
+ .where(
+ and(
+ eq(workspaceUserTable.workspaceId, workspaceId),
+ eq(workspaceUserTable.userId, userId),
+ inArray(workspaceUserTable.role, ["owner", "admin"]),
+ ),
+ );
+
+ if (!member) {
+ throw new HTTPException(403, {
+ message: "Only workspace owners and admins can manage billing",
+ });
+ }
+}
+
+const billing = new Hono<{ Variables: Variables }>()
+ .post("/webhook", async (c) => {
+ if (!isBillingEnabled()) {
+ throw new HTTPException(404, { message: "Not found" });
+ }
+
+ const rawBody = await c.req.text();
+ let event: BillingWebhookEvent;
+ try {
+ const parsed = await constructWebhookEvent(
+ rawBody,
+ c.req.header(),
+ creemWebhookSecret(),
+ );
+ event = {
+ id: parsed.id,
+ type: parsed.type,
+ data: parsed.data as BillingWebhookEvent["data"],
+ };
+ } catch (error) {
+ console.error("billing: webhook signature verification failed", error);
+ throw new HTTPException(400, { message: "Invalid signature" });
+ }
+
+ const result = await handleWebhook(event);
+ return c.json(result);
+ })
+ .get(
+ "/:workspaceId",
+ describeRoute({
+ operationId: "getWorkspaceBilling",
+ tags: ["Billing"],
+ description:
+ "Get the billing state and entitlement for a workspace. Returns billingEnabled: false everywhere when billing is not configured.",
+ }),
+ validator("param", v.object({ workspaceId: v.string() })),
+ async (c) => {
+ const { workspaceId } = c.req.valid("param");
+ await validateWorkspaceAccess(c.get("userId"), workspaceId);
+ return c.json(await getWorkspaceBilling(workspaceId));
+ },
+ )
+ .post(
+ "/:workspaceId/checkout",
+ describeRoute({
+ operationId: "createBillingCheckout",
+ tags: ["Billing"],
+ description:
+ "Create a Creem checkout session for a workspace plan. Owner/admin only. Returns the checkout URL to redirect the browser to.",
+ }),
+ validator("param", v.object({ workspaceId: v.string() })),
+ validator(
+ "json",
+ v.object({
+ plan: v.picklist(["personal", "team"]),
+ interval: v.picklist(["monthly", "annual"]),
+ }),
+ ),
+ async (c) => {
+ const { workspaceId } = c.req.valid("param");
+ const { plan, interval } = c.req.valid("json");
+ await requireBillingManager(c.get("userId"), workspaceId);
+
+ const result = await createCheckout({
+ workspaceId,
+ plan,
+ interval,
+ userEmail: c.get("userEmail") ?? "",
+ });
+ return c.json(result);
+ },
+ )
+ .post(
+ "/:workspaceId/portal",
+ describeRoute({
+ operationId: "createBillingPortalSession",
+ tags: ["Billing"],
+ description:
+ "Generate a Creem customer portal link for the workspace subscription. Owner/admin only.",
+ }),
+ validator("param", v.object({ workspaceId: v.string() })),
+ async (c) => {
+ const { workspaceId } = c.req.valid("param");
+ await requireBillingManager(c.get("userId"), workspaceId);
+
+ const billingRow = await getOrCreateWorkspaceBilling(workspaceId);
+ if (!billingRow.creemCustomerId) {
+ throw new HTTPException(400, {
+ message: "No billing customer exists for this workspace yet",
+ });
+ }
+
+ const { portalUrl } = await createCustomerPortalLink(
+ billingRow.creemCustomerId,
+ );
+ return c.json({ portalUrl });
+ },
+ );
+
+export default billing;
diff --git a/apps/api/src/billing/require-entitlement-middleware.ts b/apps/api/src/billing/require-entitlement-middleware.ts
new file mode 100644
index 000000000..14082a907
--- /dev/null
+++ b/apps/api/src/billing/require-entitlement-middleware.ts
@@ -0,0 +1,16 @@
+import type { Context, Next } from "hono";
+import { requireWorkspaceEntitlement } from "./controllers/require-entitlement";
+
+/**
+ * Blocks the request when the workspace has no active Kaneo Cloud entitlement
+ * (expired trial, canceled or expired subscription). Must run after a
+ * workspace-access middleware that sets `c.get("workspaceId")`. No-ops when
+ * billing is disabled, so self-hosted installs are unaffected.
+ */
+export async function requireEntitlement(c: Context, next: Next) {
+ const workspaceId = c.get("workspaceId");
+ if (workspaceId) {
+ await requireWorkspaceEntitlement(workspaceId);
+ }
+ return next();
+}
diff --git a/apps/api/src/database/schema.ts b/apps/api/src/database/schema.ts
index 79eb0f0e2..c56cab20b 100644
--- a/apps/api/src/database/schema.ts
+++ b/apps/api/src/database/schema.ts
@@ -143,6 +143,47 @@ export const workspaceUserTable = pgTable(
],
);
+export const workspaceBillingTable = pgTable(
+ "workspace_billing",
+ {
+ id: text("id")
+ .$defaultFn(() => createId())
+ .primaryKey(),
+ workspaceId: text("workspace_id")
+ .notNull()
+ .unique("workspace_billing_workspace_id_unique")
+ .references(() => workspaceTable.id, {
+ onDelete: "cascade",
+ onUpdate: "cascade",
+ }),
+ foundingFree: boolean("founding_free").notNull().default(false),
+ trialEndsAt: timestamp("trial_ends_at", { mode: "date" }),
+ creemCustomerId: text("creem_customer_id"),
+ creemSubscriptionId: text("creem_subscription_id").unique(),
+ creemProductId: text("creem_product_id"),
+ plan: text("plan"),
+ billingInterval: text("billing_interval"),
+ status: text("status"),
+ seats: integer("seats").notNull().default(1),
+ currentPeriodEnd: timestamp("current_period_end", { mode: "date" }),
+ canceledAt: timestamp("canceled_at", { mode: "date" }),
+ createdAt: timestamp("created_at", { mode: "date" }).defaultNow().notNull(),
+ updatedAt: timestamp("updated_at", { mode: "date" })
+ .defaultNow()
+ .$onUpdate(() => new Date())
+ .notNull(),
+ },
+ (table) => [index("workspace_billing_workspaceId_idx").on(table.workspaceId)],
+);
+
+export const billingEventTable = pgTable("billing_event", {
+ id: text("id").primaryKey(),
+ eventType: text("event_type").notNull(),
+ processedAt: timestamp("processed_at", { mode: "date" })
+ .defaultNow()
+ .notNull(),
+});
+
export const teamTable = pgTable(
"team",
{
diff --git a/apps/api/src/index.ts b/apps/api/src/index.ts
index f0e23f1c4..5e0588762 100644
--- a/apps/api/src/index.ts
+++ b/apps/api/src/index.ts
@@ -20,6 +20,7 @@ import {
import * as v from "valibot";
import activity from "./activity";
import { auth } from "./auth";
+import billing from "./billing";
import column from "./column";
import comment from "./comment";
import config from "./config";
@@ -523,7 +524,11 @@ export function createApp() {
api.use("*", async (c, next) => {
const path = c.req.path;
- if (path.startsWith("/api/mcp") || path.startsWith("/api/.well-known/")) {
+ if (
+ path.startsWith("/api/mcp") ||
+ path.startsWith("/api/.well-known/") ||
+ path === "/api/billing/webhook"
+ ) {
return next();
}
try {
@@ -545,6 +550,7 @@ export function createApp() {
const oauthApi = api.route("/oauth", oauth);
+ const billingApi = api.route("/billing", billing);
const projectApi = api.route("/project", project);
const taskApi = api.route("/task", task);
const columnApi = api.route("/column", column);
@@ -721,6 +727,7 @@ export function createApp() {
api,
injectWebSocket,
activityApi,
+ billingApi,
columnApi,
commentApi,
configApi,
@@ -837,6 +844,7 @@ const {
app,
injectWebSocket,
activityApi,
+ billingApi,
columnApi,
commentApi,
configApi,
@@ -872,6 +880,7 @@ if (isMainModule) {
}
export type AppType =
+ | typeof billingApi
| typeof configApi
| typeof projectApi
| typeof taskApi
diff --git a/apps/api/src/project/index.ts b/apps/api/src/project/index.ts
index 31aff229c..cde07ad78 100644
--- a/apps/api/src/project/index.ts
+++ b/apps/api/src/project/index.ts
@@ -1,6 +1,7 @@
import { Hono } from "hono";
import { describeRoute, resolver, validator } from "hono-openapi";
import * as v from "valibot";
+import { requireEntitlement } from "../billing/require-entitlement-middleware";
import { projectSchema } from "../schemas";
import { requireWorkspacePermission } from "../utils/require-workspace-permission";
import { workspaceAccess } from "../utils/workspace-access-middleware";
@@ -77,6 +78,7 @@ const project = new Hono<{
),
workspaceAccess.fromBody(),
requireWorkspacePermission({ project: ["create"] }),
+ requireEntitlement,
async (c) => {
const { name, icon, slug } = c.req.valid("json");
const workspaceId = c.get("workspaceId");
diff --git a/apps/api/src/schemas.ts b/apps/api/src/schemas.ts
index 11df5b248..68b554db6 100644
--- a/apps/api/src/schemas.ts
+++ b/apps/api/src/schemas.ts
@@ -275,4 +275,5 @@ export const configSchema = v.object({
disableLoginForm: v.nullable(v.boolean()),
customOAuthAutoLogin: v.nullable(v.boolean()),
customOAuthLogoutUrl: v.nullable(v.string()),
+ billingEnabled: v.boolean(),
});
diff --git a/apps/api/src/task/index.ts b/apps/api/src/task/index.ts
index dbeffb3db..228ca6cb4 100644
--- a/apps/api/src/task/index.ts
+++ b/apps/api/src/task/index.ts
@@ -3,6 +3,7 @@ import { Hono } from "hono";
import { HTTPException } from "hono/http-exception";
import { describeRoute, resolver, validator } from "hono-openapi";
import * as v from "valibot";
+import { requireEntitlement } from "../billing/require-entitlement-middleware";
import db from "../database";
import {
assetTable,
@@ -188,6 +189,7 @@ const task = new Hono<{
),
workspaceAccess.fromProject("projectId"),
requireWorkspacePermission({ task: ["create"] }),
+ requireEntitlement,
async (c) => {
const { projectId } = c.req.param();
const {
@@ -273,6 +275,7 @@ const task = new Hono<{
),
workspaceAccess.fromTask(),
requireWorkspacePermission({ task: ["update"] }),
+ requireEntitlement,
async (c) => {
const { id } = c.req.valid("param");
const { destinationProjectId, destinationStatus } = c.req.valid("json");
@@ -320,6 +323,7 @@ const task = new Hono<{
),
workspaceAccess.fromTask(),
requireWorkspacePermission({ task: ["update"] }),
+ requireEntitlement,
async (c) => {
const { id } = c.req.valid("param");
const {
@@ -412,6 +416,7 @@ const task = new Hono<{
),
workspaceAccess.fromProject("projectId"),
requireWorkspacePermission({ task: ["create"] }),
+ requireEntitlement,
async (c) => {
const { projectId } = c.req.valid("param");
const { tasks } = c.req.valid("json");
@@ -468,6 +473,7 @@ const task = new Hono<{
validator("json", v.object({ status: v.string() })),
workspaceAccess.fromTask(),
requireWorkspacePermission({ task: ["update"] }),
+ requireEntitlement,
async (c) => {
const { id } = c.req.valid("param");
const { status } = c.req.valid("json");
@@ -497,6 +503,7 @@ const task = new Hono<{
validator("json", v.object({ priority: v.picklist(VALID_PRIORITIES) })),
workspaceAccess.fromTask(),
requireWorkspacePermission({ task: ["update"] }),
+ requireEntitlement,
async (c) => {
const { id } = c.req.valid("param");
const { priority } = c.req.valid("json");
@@ -526,6 +533,7 @@ const task = new Hono<{
validator("json", v.object({ userId: v.nullable(v.string()) })),
workspaceAccess.fromTask(),
requireWorkspacePermission({ task: ["assign"] }),
+ requireEntitlement,
async (c) => {
const { id } = c.req.valid("param");
const { userId } = c.req.valid("json");
@@ -555,6 +563,7 @@ const task = new Hono<{
validator("json", v.object({ dueDate: v.optional(v.string()) })),
workspaceAccess.fromTask(),
requireWorkspacePermission({ task: ["update"] }),
+ requireEntitlement,
async (c) => {
const { id } = c.req.valid("param");
const { dueDate = null } = c.req.valid("json");
@@ -589,6 +598,7 @@ const task = new Hono<{
validator("json", v.object({ title: v.string() })),
workspaceAccess.fromTask(),
requireWorkspacePermission({ task: ["update"] }),
+ requireEntitlement,
async (c) => {
const { id } = c.req.valid("param");
const { title } = c.req.valid("json");
@@ -628,6 +638,7 @@ const task = new Hono<{
),
workspaceAccess.fromTask(),
requireWorkspacePermission({ task: ["update"] }),
+ requireEntitlement,
async (c) => {
const { id } = c.req.valid("param");
const { filename, contentType, size, surface } = c.req.valid("json");
@@ -712,6 +723,7 @@ const task = new Hono<{
),
workspaceAccess.fromTask(),
requireWorkspacePermission({ task: ["update"] }),
+ requireEntitlement,
async (c) => {
const { id } = c.req.valid("param");
const { key, filename, contentType, size, surface } = c.req.valid("json");
@@ -831,6 +843,7 @@ const task = new Hono<{
validator("json", v.object({ description: v.string() })),
workspaceAccess.fromTask(),
requireWorkspacePermission({ task: ["update"] }),
+ requireEntitlement,
async (c) => {
const { id } = c.req.valid("param");
const { description } = c.req.valid("json");
diff --git a/apps/api/src/utils/get-settings.ts b/apps/api/src/utils/get-settings.ts
index bf106a2f2..83be00157 100644
--- a/apps/api/src/utils/get-settings.ts
+++ b/apps/api/src/utils/get-settings.ts
@@ -1,4 +1,5 @@
import { config } from "dotenv-mono";
+import { isBillingEnabled } from "../billing/config";
import { isGithubSsoConfigured } from "./github-sso-env";
config();
@@ -30,6 +31,7 @@ function getSettings() {
disableLoginForm: process.env.DISABLE_LOGIN_FORM === "true",
customOAuthAutoLogin: process.env.CUSTOM_OAUTH_AUTO_LOGIN === "true",
customOAuthLogoutUrl: process.env.CUSTOM_OAUTH_LOGOUT_URL || null,
+ billingEnabled: isBillingEnabled(),
};
}
diff --git a/apps/web/src/fetchers/billing/create-checkout.ts b/apps/web/src/fetchers/billing/create-checkout.ts
new file mode 100644
index 000000000..e96a69a42
--- /dev/null
+++ b/apps/web/src/fetchers/billing/create-checkout.ts
@@ -0,0 +1,35 @@
+import { client } from "@kaneo/libs";
+
+export type BillingPlan = "personal" | "team";
+export type BillingInterval = "monthly" | "annual";
+
+export async function createBillingCheckout(input: {
+ workspaceId: string;
+ plan: BillingPlan;
+ interval: BillingInterval;
+}) {
+ const response = await client.billing[":workspaceId"].checkout.$post({
+ param: { workspaceId: input.workspaceId },
+ json: { plan: input.plan, interval: input.interval },
+ });
+
+ if (!response.ok) {
+ const error = await response.text();
+ throw new Error(error);
+ }
+
+ return response.json();
+}
+
+export async function createBillingPortal(workspaceId: string) {
+ const response = await client.billing[":workspaceId"].portal.$post({
+ param: { workspaceId },
+ });
+
+ if (!response.ok) {
+ const error = await response.text();
+ throw new Error(error);
+ }
+
+ return response.json();
+}
diff --git a/apps/web/src/fetchers/billing/get-billing.ts b/apps/web/src/fetchers/billing/get-billing.ts
new file mode 100644
index 000000000..b8baad36f
--- /dev/null
+++ b/apps/web/src/fetchers/billing/get-billing.ts
@@ -0,0 +1,19 @@
+import { client } from "@kaneo/libs";
+import type { InferResponseType } from "hono/client";
+
+export type GetBillingResponse = InferResponseType<
+ (typeof client)["billing"][":workspaceId"]["$get"]
+>;
+
+export async function getBilling(workspaceId: string) {
+ const response = await client.billing[":workspaceId"].$get({
+ param: { workspaceId },
+ });
+
+ if (!response.ok) {
+ const error = await response.text();
+ throw new Error(error);
+ }
+
+ return response.json();
+}
diff --git a/apps/web/src/hooks/mutations/billing/use-billing-actions.ts b/apps/web/src/hooks/mutations/billing/use-billing-actions.ts
new file mode 100644
index 000000000..ac5ef73eb
--- /dev/null
+++ b/apps/web/src/hooks/mutations/billing/use-billing-actions.ts
@@ -0,0 +1,39 @@
+import { useMutation } from "@tanstack/react-query";
+import { toast } from "sonner";
+import {
+ type BillingInterval,
+ type BillingPlan,
+ createBillingCheckout,
+ createBillingPortal,
+} from "@/fetchers/billing/create-checkout";
+
+export function useCreateCheckout(workspaceId: string | undefined) {
+ return useMutation({
+ mutationFn: (input: { plan: BillingPlan; interval: BillingInterval }) =>
+ createBillingCheckout({ workspaceId: workspaceId as string, ...input }),
+ onSuccess: ({ checkoutUrl }) => {
+ window.location.href = checkoutUrl;
+ },
+ onError: (error) => {
+ toast.error(
+ error instanceof Error ? error.message : "Could not start checkout",
+ );
+ },
+ });
+}
+
+export function useOpenBillingPortal(workspaceId: string | undefined) {
+ return useMutation({
+ mutationFn: () => createBillingPortal(workspaceId as string),
+ onSuccess: ({ portalUrl }) => {
+ window.location.href = portalUrl;
+ },
+ onError: (error) => {
+ toast.error(
+ error instanceof Error
+ ? error.message
+ : "Could not open billing portal",
+ );
+ },
+ });
+}
diff --git a/apps/web/src/hooks/queries/billing/use-get-billing.ts b/apps/web/src/hooks/queries/billing/use-get-billing.ts
new file mode 100644
index 000000000..160fcc134
--- /dev/null
+++ b/apps/web/src/hooks/queries/billing/use-get-billing.ts
@@ -0,0 +1,10 @@
+import { useQuery } from "@tanstack/react-query";
+import { getBilling } from "@/fetchers/billing/get-billing";
+
+export function useGetBilling(workspaceId: string | undefined) {
+ return useQuery({
+ queryKey: ["billing", workspaceId],
+ queryFn: () => getBilling(workspaceId as string),
+ enabled: Boolean(workspaceId),
+ });
+}
diff --git a/apps/web/src/routeTree.gen.ts b/apps/web/src/routeTree.gen.ts
index 2b4c37a57..b81d097d3 100644
--- a/apps/web/src/routeTree.gen.ts
+++ b/apps/web/src/routeTree.gen.ts
@@ -9,61 +9,61 @@
// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.
import { Route as rootRouteImport } from './routes/__root'
-import { Route as TestErrorRouteImport } from './routes/test-error'
-import { Route as DeviceRouteImport } from './routes/device'
-import { Route as AuthRouteImport } from './routes/auth'
-import { Route as LayoutRouteImport } from './routes/_layout'
import { Route as IndexRouteImport } from './routes/index'
+import { Route as LayoutRouteImport } from './routes/_layout'
+import { Route as AuthRouteImport } from './routes/auth'
+import { Route as DeviceRouteImport } from './routes/device'
+import { Route as TestErrorRouteImport } from './routes/test-error'
+import { Route as LayoutAuthenticatedRouteImport } from './routes/_layout/_authenticated'
+import { Route as AuthCheckEmailRouteImport } from './routes/auth/check-email'
+import { Route as AuthSignInRouteImport } from './routes/auth/sign-in'
+import { Route as AuthSignUpRouteImport } from './routes/auth/sign-up'
+import { Route as AuthVerifyOtpRouteImport } from './routes/auth/verify-otp'
import { Route as DeviceIndexRouteImport } from './routes/device/index'
-import { Route as PublicProjectProjectIdRouteImport } from './routes/public-project.$projectId'
-import { Route as McpAuthorizeRouteImport } from './routes/mcp.authorize'
import { Route as DeviceApproveRouteImport } from './routes/device/approve'
-import { Route as AuthVerifyOtpRouteImport } from './routes/auth/verify-otp'
-import { Route as AuthSignUpRouteImport } from './routes/auth/sign-up'
-import { Route as AuthSignInRouteImport } from './routes/auth/sign-in'
-import { Route as AuthCheckEmailRouteImport } from './routes/auth/check-email'
-import { Route as LayoutAuthenticatedRouteImport } from './routes/_layout/_authenticated'
-import { Route as InvitationAcceptInviteIdRouteImport } from './routes/invitation/accept.$inviteId'
-import { Route as LayoutAuthenticatedProfileSetupRouteImport } from './routes/_layout/_authenticated/profile-setup'
-import { Route as LayoutAuthenticatedOnboardingRouteImport } from './routes/_layout/_authenticated/onboarding'
-import { Route as LayoutAuthenticatedInvitationsRouteImport } from './routes/_layout/_authenticated/invitations'
+import { Route as McpAuthorizeRouteImport } from './routes/mcp.authorize'
+import { Route as PublicProjectProjectIdRouteImport } from './routes/public-project.$projectId'
import { Route as LayoutAuthenticatedDashboardRouteImport } from './routes/_layout/_authenticated/dashboard'
+import { Route as LayoutAuthenticatedInvitationsRouteImport } from './routes/_layout/_authenticated/invitations'
+import { Route as LayoutAuthenticatedOnboardingRouteImport } from './routes/_layout/_authenticated/onboarding'
+import { Route as LayoutAuthenticatedProfileSetupRouteImport } from './routes/_layout/_authenticated/profile-setup'
+import { Route as InvitationAcceptInviteIdRouteImport } from './routes/invitation/accept.$inviteId'
import { Route as LayoutAuthenticatedDashboardIndexRouteImport } from './routes/_layout/_authenticated/dashboard/index'
-import { Route as LayoutAuthenticatedDashboardSettingsRouteImport } from './routes/_layout/_authenticated/dashboard/settings'
import { Route as LayoutAuthenticatedDashboardInvitationsRouteImport } from './routes/_layout/_authenticated/dashboard/invitations'
-import { Route as LayoutAuthenticatedDashboardWorkspaceCreateRouteImport } from './routes/_layout/_authenticated/dashboard/workspace/create'
-import { Route as LayoutAuthenticatedDashboardWorkspaceWorkspaceIdRouteImport } from './routes/_layout/_authenticated/dashboard/workspace/$workspaceId'
-import { Route as LayoutAuthenticatedDashboardSettingsWorkspaceRouteImport } from './routes/_layout/_authenticated/dashboard/settings/workspace'
-import { Route as LayoutAuthenticatedDashboardSettingsProjectsRouteImport } from './routes/_layout/_authenticated/dashboard/settings/projects'
+import { Route as LayoutAuthenticatedDashboardSettingsRouteImport } from './routes/_layout/_authenticated/dashboard/settings'
import { Route as LayoutAuthenticatedDashboardSettingsAccountRouteImport } from './routes/_layout/_authenticated/dashboard/settings/account'
+import { Route as LayoutAuthenticatedDashboardSettingsProjectsRouteImport } from './routes/_layout/_authenticated/dashboard/settings/projects'
+import { Route as LayoutAuthenticatedDashboardSettingsWorkspaceRouteImport } from './routes/_layout/_authenticated/dashboard/settings/workspace'
+import { Route as LayoutAuthenticatedDashboardWorkspaceWorkspaceIdRouteImport } from './routes/_layout/_authenticated/dashboard/workspace/$workspaceId'
+import { Route as LayoutAuthenticatedDashboardWorkspaceCreateRouteImport } from './routes/_layout/_authenticated/dashboard/workspace/create'
+import { Route as LayoutAuthenticatedDashboardSettingsAccountDeveloperRouteImport } from './routes/_layout/_authenticated/dashboard/settings/account/developer'
+import { Route as LayoutAuthenticatedDashboardSettingsAccountInformationRouteImport } from './routes/_layout/_authenticated/dashboard/settings/account/information'
+import { Route as LayoutAuthenticatedDashboardSettingsAccountNotificationsRouteImport } from './routes/_layout/_authenticated/dashboard/settings/account/notifications'
+import { Route as LayoutAuthenticatedDashboardSettingsAccountPreferencesRouteImport } from './routes/_layout/_authenticated/dashboard/settings/account/preferences'
+import { Route as LayoutAuthenticatedDashboardSettingsWorkspaceBillingRouteImport } from './routes/_layout/_authenticated/dashboard/settings/workspace/billing'
+import { Route as LayoutAuthenticatedDashboardSettingsWorkspaceGeneralRouteImport } from './routes/_layout/_authenticated/dashboard/settings/workspace/general'
+import { Route as LayoutAuthenticatedDashboardSettingsWorkspaceLabelsRouteImport } from './routes/_layout/_authenticated/dashboard/settings/workspace/labels'
+import { Route as LayoutAuthenticatedDashboardSettingsWorkspaceRolesRouteImport } from './routes/_layout/_authenticated/dashboard/settings/workspace/roles'
import { Route as LayoutAuthenticatedDashboardWorkspaceWorkspaceIdIndexRouteImport } from './routes/_layout/_authenticated/dashboard/workspace/$workspaceId/index'
-import { Route as LayoutAuthenticatedDashboardWorkspaceWorkspaceIdSearchRouteImport } from './routes/_layout/_authenticated/dashboard/workspace/$workspaceId/search'
import { Route as LayoutAuthenticatedDashboardWorkspaceWorkspaceIdMembersRouteImport } from './routes/_layout/_authenticated/dashboard/workspace/$workspaceId/members'
-import { Route as LayoutAuthenticatedDashboardSettingsWorkspaceRolesRouteImport } from './routes/_layout/_authenticated/dashboard/settings/workspace/roles'
-import { Route as LayoutAuthenticatedDashboardSettingsWorkspaceLabelsRouteImport } from './routes/_layout/_authenticated/dashboard/settings/workspace/labels'
-import { Route as LayoutAuthenticatedDashboardSettingsWorkspaceGeneralRouteImport } from './routes/_layout/_authenticated/dashboard/settings/workspace/general'
-import { Route as LayoutAuthenticatedDashboardSettingsAccountPreferencesRouteImport } from './routes/_layout/_authenticated/dashboard/settings/account/preferences'
-import { Route as LayoutAuthenticatedDashboardSettingsAccountNotificationsRouteImport } from './routes/_layout/_authenticated/dashboard/settings/account/notifications'
-import { Route as LayoutAuthenticatedDashboardSettingsAccountInformationRouteImport } from './routes/_layout/_authenticated/dashboard/settings/account/information'
-import { Route as LayoutAuthenticatedDashboardSettingsAccountDeveloperRouteImport } from './routes/_layout/_authenticated/dashboard/settings/account/developer'
-import { Route as LayoutAuthenticatedDashboardSettingsProjectsProjectIdWorkflowRouteImport } from './routes/_layout/_authenticated/dashboard/settings/projects/$projectId/workflow'
-import { Route as LayoutAuthenticatedDashboardSettingsProjectsProjectIdVisibilityRouteImport } from './routes/_layout/_authenticated/dashboard/settings/projects/$projectId/visibility'
-import { Route as LayoutAuthenticatedDashboardSettingsProjectsProjectIdIntegrationsRouteImport } from './routes/_layout/_authenticated/dashboard/settings/projects/$projectId/integrations'
+import { Route as LayoutAuthenticatedDashboardWorkspaceWorkspaceIdSearchRouteImport } from './routes/_layout/_authenticated/dashboard/workspace/$workspaceId/search'
import { Route as LayoutAuthenticatedDashboardSettingsProjectsProjectIdGeneralRouteImport } from './routes/_layout/_authenticated/dashboard/settings/projects/$projectId/general'
+import { Route as LayoutAuthenticatedDashboardSettingsProjectsProjectIdIntegrationsRouteImport } from './routes/_layout/_authenticated/dashboard/settings/projects/$projectId/integrations'
+import { Route as LayoutAuthenticatedDashboardSettingsProjectsProjectIdVisibilityRouteImport } from './routes/_layout/_authenticated/dashboard/settings/projects/$projectId/visibility'
+import { Route as LayoutAuthenticatedDashboardSettingsProjectsProjectIdWorkflowRouteImport } from './routes/_layout/_authenticated/dashboard/settings/projects/$projectId/workflow'
import { Route as LayoutAuthenticatedDashboardWorkspaceWorkspaceIdProjectProjectIdIndexRouteImport } from './routes/_layout/_authenticated/dashboard/workspace/$workspaceId/project/$projectId/index'
-import { Route as LayoutAuthenticatedDashboardWorkspaceWorkspaceIdProjectProjectIdGanttRouteImport } from './routes/_layout/_authenticated/dashboard/workspace/$workspaceId/project/$projectId/gantt'
-import { Route as LayoutAuthenticatedDashboardWorkspaceWorkspaceIdProjectProjectIdBoardRouteImport } from './routes/_layout/_authenticated/dashboard/workspace/$workspaceId/project/$projectId/board'
import { Route as LayoutAuthenticatedDashboardWorkspaceWorkspaceIdProjectProjectIdBacklogRouteImport } from './routes/_layout/_authenticated/dashboard/workspace/$workspaceId/project/$projectId/backlog'
+import { Route as LayoutAuthenticatedDashboardWorkspaceWorkspaceIdProjectProjectIdBoardRouteImport } from './routes/_layout/_authenticated/dashboard/workspace/$workspaceId/project/$projectId/board'
+import { Route as LayoutAuthenticatedDashboardWorkspaceWorkspaceIdProjectProjectIdGanttRouteImport } from './routes/_layout/_authenticated/dashboard/workspace/$workspaceId/project/$projectId/gantt'
import { Route as LayoutAuthenticatedDashboardWorkspaceWorkspaceIdProjectProjectIdTaskTaskIdRouteImport } from './routes/_layout/_authenticated/dashboard/workspace/$workspaceId/project/$projectId/task/$taskId_'
-const TestErrorRoute = TestErrorRouteImport.update({
- id: '/test-error',
- path: '/test-error',
+const IndexRoute = IndexRouteImport.update({
+ id: '/',
+ path: '/',
getParentRoute: () => rootRouteImport,
} as any)
-const DeviceRoute = DeviceRouteImport.update({
- id: '/device',
- path: '/device',
+const LayoutRoute = LayoutRouteImport.update({
+ id: '/_layout',
getParentRoute: () => rootRouteImport,
} as any)
const AuthRoute = AuthRouteImport.update({
@@ -71,38 +71,28 @@ const AuthRoute = AuthRouteImport.update({
path: '/auth',
getParentRoute: () => rootRouteImport,
} as any)
-const LayoutRoute = LayoutRouteImport.update({
- id: '/_layout',
- getParentRoute: () => rootRouteImport,
-} as any)
-const IndexRoute = IndexRouteImport.update({
- id: '/',
- path: '/',
+const DeviceRoute = DeviceRouteImport.update({
+ id: '/device',
+ path: '/device',
getParentRoute: () => rootRouteImport,
} as any)
-const DeviceIndexRoute = DeviceIndexRouteImport.update({
- id: '/',
- path: '/',
- getParentRoute: () => DeviceRoute,
-} as any)
-const PublicProjectProjectIdRoute = PublicProjectProjectIdRouteImport.update({
- id: '/public-project/$projectId',
- path: '/public-project/$projectId',
+const TestErrorRoute = TestErrorRouteImport.update({
+ id: '/test-error',
+ path: '/test-error',
getParentRoute: () => rootRouteImport,
} as any)
-const McpAuthorizeRoute = McpAuthorizeRouteImport.update({
- id: '/mcp/authorize',
- path: '/mcp/authorize',
- getParentRoute: () => rootRouteImport,
+const LayoutAuthenticatedRoute = LayoutAuthenticatedRouteImport.update({
+ id: '/_authenticated',
+ getParentRoute: () => LayoutRoute,
} as any)
-const DeviceApproveRoute = DeviceApproveRouteImport.update({
- id: '/approve',
- path: '/approve',
- getParentRoute: () => DeviceRoute,
+const AuthCheckEmailRoute = AuthCheckEmailRouteImport.update({
+ id: '/check-email',
+ path: '/check-email',
+ getParentRoute: () => AuthRoute,
} as any)
-const AuthVerifyOtpRoute = AuthVerifyOtpRouteImport.update({
- id: '/verify-otp',
- path: '/verify-otp',
+const AuthSignInRoute = AuthSignInRouteImport.update({
+ id: '/sign-in',
+ path: '/sign-in',
getParentRoute: () => AuthRoute,
} as any)
const AuthSignUpRoute = AuthSignUpRouteImport.update({
@@ -110,30 +100,41 @@ const AuthSignUpRoute = AuthSignUpRouteImport.update({
path: '/sign-up',
getParentRoute: () => AuthRoute,
} as any)
-const AuthSignInRoute = AuthSignInRouteImport.update({
- id: '/sign-in',
- path: '/sign-in',
+const AuthVerifyOtpRoute = AuthVerifyOtpRouteImport.update({
+ id: '/verify-otp',
+ path: '/verify-otp',
getParentRoute: () => AuthRoute,
} as any)
-const AuthCheckEmailRoute = AuthCheckEmailRouteImport.update({
- id: '/check-email',
- path: '/check-email',
- getParentRoute: () => AuthRoute,
+const DeviceIndexRoute = DeviceIndexRouteImport.update({
+ id: '/',
+ path: '/',
+ getParentRoute: () => DeviceRoute,
} as any)
-const LayoutAuthenticatedRoute = LayoutAuthenticatedRouteImport.update({
- id: '/_authenticated',
- getParentRoute: () => LayoutRoute,
+const DeviceApproveRoute = DeviceApproveRouteImport.update({
+ id: '/approve',
+ path: '/approve',
+ getParentRoute: () => DeviceRoute,
} as any)
-const InvitationAcceptInviteIdRoute =
- InvitationAcceptInviteIdRouteImport.update({
- id: '/invitation/accept/$inviteId',
- path: '/invitation/accept/$inviteId',
- getParentRoute: () => rootRouteImport,
+const McpAuthorizeRoute = McpAuthorizeRouteImport.update({
+ id: '/mcp/authorize',
+ path: '/mcp/authorize',
+ getParentRoute: () => rootRouteImport,
+} as any)
+const PublicProjectProjectIdRoute = PublicProjectProjectIdRouteImport.update({
+ id: '/public-project/$projectId',
+ path: '/public-project/$projectId',
+ getParentRoute: () => rootRouteImport,
+} as any)
+const LayoutAuthenticatedDashboardRoute =
+ LayoutAuthenticatedDashboardRouteImport.update({
+ id: '/dashboard',
+ path: '/dashboard',
+ getParentRoute: () => LayoutAuthenticatedRoute,
} as any)
-const LayoutAuthenticatedProfileSetupRoute =
- LayoutAuthenticatedProfileSetupRouteImport.update({
- id: '/profile-setup',
- path: '/profile-setup',
+const LayoutAuthenticatedInvitationsRoute =
+ LayoutAuthenticatedInvitationsRouteImport.update({
+ id: '/invitations',
+ path: '/invitations',
getParentRoute: () => LayoutAuthenticatedRoute,
} as any)
const LayoutAuthenticatedOnboardingRoute =
@@ -142,17 +143,17 @@ const LayoutAuthenticatedOnboardingRoute =
path: '/onboarding',
getParentRoute: () => LayoutAuthenticatedRoute,
} as any)
-const LayoutAuthenticatedInvitationsRoute =
- LayoutAuthenticatedInvitationsRouteImport.update({
- id: '/invitations',
- path: '/invitations',
+const LayoutAuthenticatedProfileSetupRoute =
+ LayoutAuthenticatedProfileSetupRouteImport.update({
+ id: '/profile-setup',
+ path: '/profile-setup',
getParentRoute: () => LayoutAuthenticatedRoute,
} as any)
-const LayoutAuthenticatedDashboardRoute =
- LayoutAuthenticatedDashboardRouteImport.update({
- id: '/dashboard',
- path: '/dashboard',
- getParentRoute: () => LayoutAuthenticatedRoute,
+const InvitationAcceptInviteIdRoute =
+ InvitationAcceptInviteIdRouteImport.update({
+ id: '/invitation/accept/$inviteId',
+ path: '/invitation/accept/$inviteId',
+ getParentRoute: () => rootRouteImport,
} as any)
const LayoutAuthenticatedDashboardIndexRoute =
LayoutAuthenticatedDashboardIndexRouteImport.update({
@@ -160,34 +161,22 @@ const LayoutAuthenticatedDashboardIndexRoute =
path: '/',
getParentRoute: () => LayoutAuthenticatedDashboardRoute,
} as any)
-const LayoutAuthenticatedDashboardSettingsRoute =
- LayoutAuthenticatedDashboardSettingsRouteImport.update({
- id: '/settings',
- path: '/settings',
- getParentRoute: () => LayoutAuthenticatedDashboardRoute,
- } as any)
const LayoutAuthenticatedDashboardInvitationsRoute =
LayoutAuthenticatedDashboardInvitationsRouteImport.update({
id: '/invitations',
path: '/invitations',
getParentRoute: () => LayoutAuthenticatedDashboardRoute,
} as any)
-const LayoutAuthenticatedDashboardWorkspaceCreateRoute =
- LayoutAuthenticatedDashboardWorkspaceCreateRouteImport.update({
- id: '/workspace/create',
- path: '/workspace/create',
- getParentRoute: () => LayoutAuthenticatedDashboardRoute,
- } as any)
-const LayoutAuthenticatedDashboardWorkspaceWorkspaceIdRoute =
- LayoutAuthenticatedDashboardWorkspaceWorkspaceIdRouteImport.update({
- id: '/workspace/$workspaceId',
- path: '/workspace/$workspaceId',
+const LayoutAuthenticatedDashboardSettingsRoute =
+ LayoutAuthenticatedDashboardSettingsRouteImport.update({
+ id: '/settings',
+ path: '/settings',
getParentRoute: () => LayoutAuthenticatedDashboardRoute,
} as any)
-const LayoutAuthenticatedDashboardSettingsWorkspaceRoute =
- LayoutAuthenticatedDashboardSettingsWorkspaceRouteImport.update({
- id: '/workspace',
- path: '/workspace',
+const LayoutAuthenticatedDashboardSettingsAccountRoute =
+ LayoutAuthenticatedDashboardSettingsAccountRouteImport.update({
+ id: '/account',
+ path: '/account',
getParentRoute: () => LayoutAuthenticatedDashboardSettingsRoute,
} as any)
const LayoutAuthenticatedDashboardSettingsProjectsRoute =
@@ -196,40 +185,52 @@ const LayoutAuthenticatedDashboardSettingsProjectsRoute =
path: '/projects',
getParentRoute: () => LayoutAuthenticatedDashboardSettingsRoute,
} as any)
-const LayoutAuthenticatedDashboardSettingsAccountRoute =
- LayoutAuthenticatedDashboardSettingsAccountRouteImport.update({
- id: '/account',
- path: '/account',
+const LayoutAuthenticatedDashboardSettingsWorkspaceRoute =
+ LayoutAuthenticatedDashboardSettingsWorkspaceRouteImport.update({
+ id: '/workspace',
+ path: '/workspace',
getParentRoute: () => LayoutAuthenticatedDashboardSettingsRoute,
} as any)
-const LayoutAuthenticatedDashboardWorkspaceWorkspaceIdIndexRoute =
- LayoutAuthenticatedDashboardWorkspaceWorkspaceIdIndexRouteImport.update({
- id: '/',
- path: '/',
- getParentRoute: () => LayoutAuthenticatedDashboardWorkspaceWorkspaceIdRoute,
+const LayoutAuthenticatedDashboardWorkspaceWorkspaceIdRoute =
+ LayoutAuthenticatedDashboardWorkspaceWorkspaceIdRouteImport.update({
+ id: '/workspace/$workspaceId',
+ path: '/workspace/$workspaceId',
+ getParentRoute: () => LayoutAuthenticatedDashboardRoute,
} as any)
-const LayoutAuthenticatedDashboardWorkspaceWorkspaceIdSearchRoute =
- LayoutAuthenticatedDashboardWorkspaceWorkspaceIdSearchRouteImport.update({
- id: '/search',
- path: '/search',
- getParentRoute: () => LayoutAuthenticatedDashboardWorkspaceWorkspaceIdRoute,
+const LayoutAuthenticatedDashboardWorkspaceCreateRoute =
+ LayoutAuthenticatedDashboardWorkspaceCreateRouteImport.update({
+ id: '/workspace/create',
+ path: '/workspace/create',
+ getParentRoute: () => LayoutAuthenticatedDashboardRoute,
} as any)
-const LayoutAuthenticatedDashboardWorkspaceWorkspaceIdMembersRoute =
- LayoutAuthenticatedDashboardWorkspaceWorkspaceIdMembersRouteImport.update({
- id: '/members',
- path: '/members',
- getParentRoute: () => LayoutAuthenticatedDashboardWorkspaceWorkspaceIdRoute,
+const LayoutAuthenticatedDashboardSettingsAccountDeveloperRoute =
+ LayoutAuthenticatedDashboardSettingsAccountDeveloperRouteImport.update({
+ id: '/developer',
+ path: '/developer',
+ getParentRoute: () => LayoutAuthenticatedDashboardSettingsAccountRoute,
} as any)
-const LayoutAuthenticatedDashboardSettingsWorkspaceRolesRoute =
- LayoutAuthenticatedDashboardSettingsWorkspaceRolesRouteImport.update({
- id: '/roles',
- path: '/roles',
- getParentRoute: () => LayoutAuthenticatedDashboardSettingsWorkspaceRoute,
+const LayoutAuthenticatedDashboardSettingsAccountInformationRoute =
+ LayoutAuthenticatedDashboardSettingsAccountInformationRouteImport.update({
+ id: '/information',
+ path: '/information',
+ getParentRoute: () => LayoutAuthenticatedDashboardSettingsAccountRoute,
} as any)
-const LayoutAuthenticatedDashboardSettingsWorkspaceLabelsRoute =
- LayoutAuthenticatedDashboardSettingsWorkspaceLabelsRouteImport.update({
- id: '/labels',
- path: '/labels',
+const LayoutAuthenticatedDashboardSettingsAccountNotificationsRoute =
+ LayoutAuthenticatedDashboardSettingsAccountNotificationsRouteImport.update({
+ id: '/notifications',
+ path: '/notifications',
+ getParentRoute: () => LayoutAuthenticatedDashboardSettingsAccountRoute,
+ } as any)
+const LayoutAuthenticatedDashboardSettingsAccountPreferencesRoute =
+ LayoutAuthenticatedDashboardSettingsAccountPreferencesRouteImport.update({
+ id: '/preferences',
+ path: '/preferences',
+ getParentRoute: () => LayoutAuthenticatedDashboardSettingsAccountRoute,
+ } as any)
+const LayoutAuthenticatedDashboardSettingsWorkspaceBillingRoute =
+ LayoutAuthenticatedDashboardSettingsWorkspaceBillingRouteImport.update({
+ id: '/billing',
+ path: '/billing',
getParentRoute: () => LayoutAuthenticatedDashboardSettingsWorkspaceRoute,
} as any)
const LayoutAuthenticatedDashboardSettingsWorkspaceGeneralRoute =
@@ -238,43 +239,41 @@ const LayoutAuthenticatedDashboardSettingsWorkspaceGeneralRoute =
path: '/general',
getParentRoute: () => LayoutAuthenticatedDashboardSettingsWorkspaceRoute,
} as any)
-const LayoutAuthenticatedDashboardSettingsAccountPreferencesRoute =
- LayoutAuthenticatedDashboardSettingsAccountPreferencesRouteImport.update({
- id: '/preferences',
- path: '/preferences',
- getParentRoute: () => LayoutAuthenticatedDashboardSettingsAccountRoute,
+const LayoutAuthenticatedDashboardSettingsWorkspaceLabelsRoute =
+ LayoutAuthenticatedDashboardSettingsWorkspaceLabelsRouteImport.update({
+ id: '/labels',
+ path: '/labels',
+ getParentRoute: () => LayoutAuthenticatedDashboardSettingsWorkspaceRoute,
} as any)
-const LayoutAuthenticatedDashboardSettingsAccountNotificationsRoute =
- LayoutAuthenticatedDashboardSettingsAccountNotificationsRouteImport.update({
- id: '/notifications',
- path: '/notifications',
- getParentRoute: () => LayoutAuthenticatedDashboardSettingsAccountRoute,
+const LayoutAuthenticatedDashboardSettingsWorkspaceRolesRoute =
+ LayoutAuthenticatedDashboardSettingsWorkspaceRolesRouteImport.update({
+ id: '/roles',
+ path: '/roles',
+ getParentRoute: () => LayoutAuthenticatedDashboardSettingsWorkspaceRoute,
} as any)
-const LayoutAuthenticatedDashboardSettingsAccountInformationRoute =
- LayoutAuthenticatedDashboardSettingsAccountInformationRouteImport.update({
- id: '/information',
- path: '/information',
- getParentRoute: () => LayoutAuthenticatedDashboardSettingsAccountRoute,
+const LayoutAuthenticatedDashboardWorkspaceWorkspaceIdIndexRoute =
+ LayoutAuthenticatedDashboardWorkspaceWorkspaceIdIndexRouteImport.update({
+ id: '/',
+ path: '/',
+ getParentRoute: () => LayoutAuthenticatedDashboardWorkspaceWorkspaceIdRoute,
} as any)
-const LayoutAuthenticatedDashboardSettingsAccountDeveloperRoute =
- LayoutAuthenticatedDashboardSettingsAccountDeveloperRouteImport.update({
- id: '/developer',
- path: '/developer',
- getParentRoute: () => LayoutAuthenticatedDashboardSettingsAccountRoute,
+const LayoutAuthenticatedDashboardWorkspaceWorkspaceIdMembersRoute =
+ LayoutAuthenticatedDashboardWorkspaceWorkspaceIdMembersRouteImport.update({
+ id: '/members',
+ path: '/members',
+ getParentRoute: () => LayoutAuthenticatedDashboardWorkspaceWorkspaceIdRoute,
} as any)
-const LayoutAuthenticatedDashboardSettingsProjectsProjectIdWorkflowRoute =
- LayoutAuthenticatedDashboardSettingsProjectsProjectIdWorkflowRouteImport.update(
- {
- id: '/$projectId/workflow',
- path: '/$projectId/workflow',
- getParentRoute: () => LayoutAuthenticatedDashboardSettingsProjectsRoute,
- } as any,
- )
-const LayoutAuthenticatedDashboardSettingsProjectsProjectIdVisibilityRoute =
- LayoutAuthenticatedDashboardSettingsProjectsProjectIdVisibilityRouteImport.update(
+const LayoutAuthenticatedDashboardWorkspaceWorkspaceIdSearchRoute =
+ LayoutAuthenticatedDashboardWorkspaceWorkspaceIdSearchRouteImport.update({
+ id: '/search',
+ path: '/search',
+ getParentRoute: () => LayoutAuthenticatedDashboardWorkspaceWorkspaceIdRoute,
+ } as any)
+const LayoutAuthenticatedDashboardSettingsProjectsProjectIdGeneralRoute =
+ LayoutAuthenticatedDashboardSettingsProjectsProjectIdGeneralRouteImport.update(
{
- id: '/$projectId/visibility',
- path: '/$projectId/visibility',
+ id: '/$projectId/general',
+ path: '/$projectId/general',
getParentRoute: () => LayoutAuthenticatedDashboardSettingsProjectsRoute,
} as any,
)
@@ -286,11 +285,19 @@ const LayoutAuthenticatedDashboardSettingsProjectsProjectIdIntegrationsRoute =
getParentRoute: () => LayoutAuthenticatedDashboardSettingsProjectsRoute,
} as any,
)
-const LayoutAuthenticatedDashboardSettingsProjectsProjectIdGeneralRoute =
- LayoutAuthenticatedDashboardSettingsProjectsProjectIdGeneralRouteImport.update(
+const LayoutAuthenticatedDashboardSettingsProjectsProjectIdVisibilityRoute =
+ LayoutAuthenticatedDashboardSettingsProjectsProjectIdVisibilityRouteImport.update(
{
- id: '/$projectId/general',
- path: '/$projectId/general',
+ id: '/$projectId/visibility',
+ path: '/$projectId/visibility',
+ getParentRoute: () => LayoutAuthenticatedDashboardSettingsProjectsRoute,
+ } as any,
+ )
+const LayoutAuthenticatedDashboardSettingsProjectsProjectIdWorkflowRoute =
+ LayoutAuthenticatedDashboardSettingsProjectsProjectIdWorkflowRouteImport.update(
+ {
+ id: '/$projectId/workflow',
+ path: '/$projectId/workflow',
getParentRoute: () => LayoutAuthenticatedDashboardSettingsProjectsRoute,
} as any,
)
@@ -303,11 +310,11 @@ const LayoutAuthenticatedDashboardWorkspaceWorkspaceIdProjectProjectIdIndexRoute
LayoutAuthenticatedDashboardWorkspaceWorkspaceIdRoute,
} as any,
)
-const LayoutAuthenticatedDashboardWorkspaceWorkspaceIdProjectProjectIdGanttRoute =
- LayoutAuthenticatedDashboardWorkspaceWorkspaceIdProjectProjectIdGanttRouteImport.update(
+const LayoutAuthenticatedDashboardWorkspaceWorkspaceIdProjectProjectIdBacklogRoute =
+ LayoutAuthenticatedDashboardWorkspaceWorkspaceIdProjectProjectIdBacklogRouteImport.update(
{
- id: '/project/$projectId/gantt',
- path: '/project/$projectId/gantt',
+ id: '/project/$projectId/backlog',
+ path: '/project/$projectId/backlog',
getParentRoute: () =>
LayoutAuthenticatedDashboardWorkspaceWorkspaceIdRoute,
} as any,
@@ -321,11 +328,11 @@ const LayoutAuthenticatedDashboardWorkspaceWorkspaceIdProjectProjectIdBoardRoute
LayoutAuthenticatedDashboardWorkspaceWorkspaceIdRoute,
} as any,
)
-const LayoutAuthenticatedDashboardWorkspaceWorkspaceIdProjectProjectIdBacklogRoute =
- LayoutAuthenticatedDashboardWorkspaceWorkspaceIdProjectProjectIdBacklogRouteImport.update(
+const LayoutAuthenticatedDashboardWorkspaceWorkspaceIdProjectProjectIdGanttRoute =
+ LayoutAuthenticatedDashboardWorkspaceWorkspaceIdProjectProjectIdGanttRouteImport.update(
{
- id: '/project/$projectId/backlog',
- path: '/project/$projectId/backlog',
+ id: '/project/$projectId/gantt',
+ path: '/project/$projectId/gantt',
getParentRoute: () =>
LayoutAuthenticatedDashboardWorkspaceWorkspaceIdRoute,
} as any,
@@ -370,6 +377,7 @@ export interface FileRoutesByFullPath {
'/dashboard/settings/account/information': typeof LayoutAuthenticatedDashboardSettingsAccountInformationRoute
'/dashboard/settings/account/notifications': typeof LayoutAuthenticatedDashboardSettingsAccountNotificationsRoute
'/dashboard/settings/account/preferences': typeof LayoutAuthenticatedDashboardSettingsAccountPreferencesRoute
+ '/dashboard/settings/workspace/billing': typeof LayoutAuthenticatedDashboardSettingsWorkspaceBillingRoute
'/dashboard/settings/workspace/general': typeof LayoutAuthenticatedDashboardSettingsWorkspaceGeneralRoute
'/dashboard/settings/workspace/labels': typeof LayoutAuthenticatedDashboardSettingsWorkspaceLabelsRoute
'/dashboard/settings/workspace/roles': typeof LayoutAuthenticatedDashboardSettingsWorkspaceRolesRoute
@@ -413,6 +421,7 @@ export interface FileRoutesByTo {
'/dashboard/settings/account/information': typeof LayoutAuthenticatedDashboardSettingsAccountInformationRoute
'/dashboard/settings/account/notifications': typeof LayoutAuthenticatedDashboardSettingsAccountNotificationsRoute
'/dashboard/settings/account/preferences': typeof LayoutAuthenticatedDashboardSettingsAccountPreferencesRoute
+ '/dashboard/settings/workspace/billing': typeof LayoutAuthenticatedDashboardSettingsWorkspaceBillingRoute
'/dashboard/settings/workspace/general': typeof LayoutAuthenticatedDashboardSettingsWorkspaceGeneralRoute
'/dashboard/settings/workspace/labels': typeof LayoutAuthenticatedDashboardSettingsWorkspaceLabelsRoute
'/dashboard/settings/workspace/roles': typeof LayoutAuthenticatedDashboardSettingsWorkspaceRolesRoute
@@ -462,6 +471,7 @@ export interface FileRoutesById {
'/_layout/_authenticated/dashboard/settings/account/information': typeof LayoutAuthenticatedDashboardSettingsAccountInformationRoute
'/_layout/_authenticated/dashboard/settings/account/notifications': typeof LayoutAuthenticatedDashboardSettingsAccountNotificationsRoute
'/_layout/_authenticated/dashboard/settings/account/preferences': typeof LayoutAuthenticatedDashboardSettingsAccountPreferencesRoute
+ '/_layout/_authenticated/dashboard/settings/workspace/billing': typeof LayoutAuthenticatedDashboardSettingsWorkspaceBillingRoute
'/_layout/_authenticated/dashboard/settings/workspace/general': typeof LayoutAuthenticatedDashboardSettingsWorkspaceGeneralRoute
'/_layout/_authenticated/dashboard/settings/workspace/labels': typeof LayoutAuthenticatedDashboardSettingsWorkspaceLabelsRoute
'/_layout/_authenticated/dashboard/settings/workspace/roles': typeof LayoutAuthenticatedDashboardSettingsWorkspaceRolesRoute
@@ -510,6 +520,7 @@ export interface FileRouteTypes {
| '/dashboard/settings/account/information'
| '/dashboard/settings/account/notifications'
| '/dashboard/settings/account/preferences'
+ | '/dashboard/settings/workspace/billing'
| '/dashboard/settings/workspace/general'
| '/dashboard/settings/workspace/labels'
| '/dashboard/settings/workspace/roles'
@@ -553,6 +564,7 @@ export interface FileRouteTypes {
| '/dashboard/settings/account/information'
| '/dashboard/settings/account/notifications'
| '/dashboard/settings/account/preferences'
+ | '/dashboard/settings/workspace/billing'
| '/dashboard/settings/workspace/general'
| '/dashboard/settings/workspace/labels'
| '/dashboard/settings/workspace/roles'
@@ -601,6 +613,7 @@ export interface FileRouteTypes {
| '/_layout/_authenticated/dashboard/settings/account/information'
| '/_layout/_authenticated/dashboard/settings/account/notifications'
| '/_layout/_authenticated/dashboard/settings/account/preferences'
+ | '/_layout/_authenticated/dashboard/settings/workspace/billing'
| '/_layout/_authenticated/dashboard/settings/workspace/general'
| '/_layout/_authenticated/dashboard/settings/workspace/labels'
| '/_layout/_authenticated/dashboard/settings/workspace/roles'
@@ -631,18 +644,18 @@ export interface RootRouteChildren {
declare module '@tanstack/react-router' {
interface FileRoutesByPath {
- '/test-error': {
- id: '/test-error'
- path: '/test-error'
- fullPath: '/test-error'
- preLoaderRoute: typeof TestErrorRouteImport
+ '/': {
+ id: '/'
+ path: '/'
+ fullPath: '/'
+ preLoaderRoute: typeof IndexRouteImport
parentRoute: typeof rootRouteImport
}
- '/device': {
- id: '/device'
- path: '/device'
- fullPath: '/device'
- preLoaderRoute: typeof DeviceRouteImport
+ '/_layout': {
+ id: '/_layout'
+ path: ''
+ fullPath: '/'
+ preLoaderRoute: typeof LayoutRouteImport
parentRoute: typeof rootRouteImport
}
'/auth': {
@@ -652,53 +665,39 @@ declare module '@tanstack/react-router' {
preLoaderRoute: typeof AuthRouteImport
parentRoute: typeof rootRouteImport
}
- '/_layout': {
- id: '/_layout'
- path: ''
- fullPath: '/'
- preLoaderRoute: typeof LayoutRouteImport
- parentRoute: typeof rootRouteImport
- }
- '/': {
- id: '/'
- path: '/'
- fullPath: '/'
- preLoaderRoute: typeof IndexRouteImport
+ '/device': {
+ id: '/device'
+ path: '/device'
+ fullPath: '/device'
+ preLoaderRoute: typeof DeviceRouteImport
parentRoute: typeof rootRouteImport
}
- '/device/': {
- id: '/device/'
- path: '/'
- fullPath: '/device/'
- preLoaderRoute: typeof DeviceIndexRouteImport
- parentRoute: typeof DeviceRoute
- }
- '/public-project/$projectId': {
- id: '/public-project/$projectId'
- path: '/public-project/$projectId'
- fullPath: '/public-project/$projectId'
- preLoaderRoute: typeof PublicProjectProjectIdRouteImport
+ '/test-error': {
+ id: '/test-error'
+ path: '/test-error'
+ fullPath: '/test-error'
+ preLoaderRoute: typeof TestErrorRouteImport
parentRoute: typeof rootRouteImport
}
- '/mcp/authorize': {
- id: '/mcp/authorize'
- path: '/mcp/authorize'
- fullPath: '/mcp/authorize'
- preLoaderRoute: typeof McpAuthorizeRouteImport
- parentRoute: typeof rootRouteImport
+ '/_layout/_authenticated': {
+ id: '/_layout/_authenticated'
+ path: ''
+ fullPath: '/'
+ preLoaderRoute: typeof LayoutAuthenticatedRouteImport
+ parentRoute: typeof LayoutRoute
}
- '/device/approve': {
- id: '/device/approve'
- path: '/approve'
- fullPath: '/device/approve'
- preLoaderRoute: typeof DeviceApproveRouteImport
- parentRoute: typeof DeviceRoute
+ '/auth/check-email': {
+ id: '/auth/check-email'
+ path: '/check-email'
+ fullPath: '/auth/check-email'
+ preLoaderRoute: typeof AuthCheckEmailRouteImport
+ parentRoute: typeof AuthRoute
}
- '/auth/verify-otp': {
- id: '/auth/verify-otp'
- path: '/verify-otp'
- fullPath: '/auth/verify-otp'
- preLoaderRoute: typeof AuthVerifyOtpRouteImport
+ '/auth/sign-in': {
+ id: '/auth/sign-in'
+ path: '/sign-in'
+ fullPath: '/auth/sign-in'
+ preLoaderRoute: typeof AuthSignInRouteImport
parentRoute: typeof AuthRoute
}
'/auth/sign-up': {
@@ -708,39 +707,53 @@ declare module '@tanstack/react-router' {
preLoaderRoute: typeof AuthSignUpRouteImport
parentRoute: typeof AuthRoute
}
- '/auth/sign-in': {
- id: '/auth/sign-in'
- path: '/sign-in'
- fullPath: '/auth/sign-in'
- preLoaderRoute: typeof AuthSignInRouteImport
+ '/auth/verify-otp': {
+ id: '/auth/verify-otp'
+ path: '/verify-otp'
+ fullPath: '/auth/verify-otp'
+ preLoaderRoute: typeof AuthVerifyOtpRouteImport
parentRoute: typeof AuthRoute
}
- '/auth/check-email': {
- id: '/auth/check-email'
- path: '/check-email'
- fullPath: '/auth/check-email'
- preLoaderRoute: typeof AuthCheckEmailRouteImport
- parentRoute: typeof AuthRoute
+ '/device/': {
+ id: '/device/'
+ path: '/'
+ fullPath: '/device/'
+ preLoaderRoute: typeof DeviceIndexRouteImport
+ parentRoute: typeof DeviceRoute
}
- '/_layout/_authenticated': {
- id: '/_layout/_authenticated'
- path: ''
- fullPath: '/'
- preLoaderRoute: typeof LayoutAuthenticatedRouteImport
- parentRoute: typeof LayoutRoute
+ '/device/approve': {
+ id: '/device/approve'
+ path: '/approve'
+ fullPath: '/device/approve'
+ preLoaderRoute: typeof DeviceApproveRouteImport
+ parentRoute: typeof DeviceRoute
}
- '/invitation/accept/$inviteId': {
- id: '/invitation/accept/$inviteId'
- path: '/invitation/accept/$inviteId'
- fullPath: '/invitation/accept/$inviteId'
- preLoaderRoute: typeof InvitationAcceptInviteIdRouteImport
+ '/mcp/authorize': {
+ id: '/mcp/authorize'
+ path: '/mcp/authorize'
+ fullPath: '/mcp/authorize'
+ preLoaderRoute: typeof McpAuthorizeRouteImport
parentRoute: typeof rootRouteImport
}
- '/_layout/_authenticated/profile-setup': {
- id: '/_layout/_authenticated/profile-setup'
- path: '/profile-setup'
- fullPath: '/profile-setup'
- preLoaderRoute: typeof LayoutAuthenticatedProfileSetupRouteImport
+ '/public-project/$projectId': {
+ id: '/public-project/$projectId'
+ path: '/public-project/$projectId'
+ fullPath: '/public-project/$projectId'
+ preLoaderRoute: typeof PublicProjectProjectIdRouteImport
+ parentRoute: typeof rootRouteImport
+ }
+ '/_layout/_authenticated/dashboard': {
+ id: '/_layout/_authenticated/dashboard'
+ path: '/dashboard'
+ fullPath: '/dashboard'
+ preLoaderRoute: typeof LayoutAuthenticatedDashboardRouteImport
+ parentRoute: typeof LayoutAuthenticatedRoute
+ }
+ '/_layout/_authenticated/invitations': {
+ id: '/_layout/_authenticated/invitations'
+ path: '/invitations'
+ fullPath: '/invitations'
+ preLoaderRoute: typeof LayoutAuthenticatedInvitationsRouteImport
parentRoute: typeof LayoutAuthenticatedRoute
}
'/_layout/_authenticated/onboarding': {
@@ -750,19 +763,19 @@ declare module '@tanstack/react-router' {
preLoaderRoute: typeof LayoutAuthenticatedOnboardingRouteImport
parentRoute: typeof LayoutAuthenticatedRoute
}
- '/_layout/_authenticated/invitations': {
- id: '/_layout/_authenticated/invitations'
- path: '/invitations'
- fullPath: '/invitations'
- preLoaderRoute: typeof LayoutAuthenticatedInvitationsRouteImport
+ '/_layout/_authenticated/profile-setup': {
+ id: '/_layout/_authenticated/profile-setup'
+ path: '/profile-setup'
+ fullPath: '/profile-setup'
+ preLoaderRoute: typeof LayoutAuthenticatedProfileSetupRouteImport
parentRoute: typeof LayoutAuthenticatedRoute
}
- '/_layout/_authenticated/dashboard': {
- id: '/_layout/_authenticated/dashboard'
- path: '/dashboard'
- fullPath: '/dashboard'
- preLoaderRoute: typeof LayoutAuthenticatedDashboardRouteImport
- parentRoute: typeof LayoutAuthenticatedRoute
+ '/invitation/accept/$inviteId': {
+ id: '/invitation/accept/$inviteId'
+ path: '/invitation/accept/$inviteId'
+ fullPath: '/invitation/accept/$inviteId'
+ preLoaderRoute: typeof InvitationAcceptInviteIdRouteImport
+ parentRoute: typeof rootRouteImport
}
'/_layout/_authenticated/dashboard/': {
id: '/_layout/_authenticated/dashboard/'
@@ -771,13 +784,6 @@ declare module '@tanstack/react-router' {
preLoaderRoute: typeof LayoutAuthenticatedDashboardIndexRouteImport
parentRoute: typeof LayoutAuthenticatedDashboardRoute
}
- '/_layout/_authenticated/dashboard/settings': {
- id: '/_layout/_authenticated/dashboard/settings'
- path: '/settings'
- fullPath: '/dashboard/settings'
- preLoaderRoute: typeof LayoutAuthenticatedDashboardSettingsRouteImport
- parentRoute: typeof LayoutAuthenticatedDashboardRoute
- }
'/_layout/_authenticated/dashboard/invitations': {
id: '/_layout/_authenticated/dashboard/invitations'
path: '/invitations'
@@ -785,25 +791,18 @@ declare module '@tanstack/react-router' {
preLoaderRoute: typeof LayoutAuthenticatedDashboardInvitationsRouteImport
parentRoute: typeof LayoutAuthenticatedDashboardRoute
}
- '/_layout/_authenticated/dashboard/workspace/create': {
- id: '/_layout/_authenticated/dashboard/workspace/create'
- path: '/workspace/create'
- fullPath: '/dashboard/workspace/create'
- preLoaderRoute: typeof LayoutAuthenticatedDashboardWorkspaceCreateRouteImport
- parentRoute: typeof LayoutAuthenticatedDashboardRoute
- }
- '/_layout/_authenticated/dashboard/workspace/$workspaceId': {
- id: '/_layout/_authenticated/dashboard/workspace/$workspaceId'
- path: '/workspace/$workspaceId'
- fullPath: '/dashboard/workspace/$workspaceId'
- preLoaderRoute: typeof LayoutAuthenticatedDashboardWorkspaceWorkspaceIdRouteImport
+ '/_layout/_authenticated/dashboard/settings': {
+ id: '/_layout/_authenticated/dashboard/settings'
+ path: '/settings'
+ fullPath: '/dashboard/settings'
+ preLoaderRoute: typeof LayoutAuthenticatedDashboardSettingsRouteImport
parentRoute: typeof LayoutAuthenticatedDashboardRoute
}
- '/_layout/_authenticated/dashboard/settings/workspace': {
- id: '/_layout/_authenticated/dashboard/settings/workspace'
- path: '/workspace'
- fullPath: '/dashboard/settings/workspace'
- preLoaderRoute: typeof LayoutAuthenticatedDashboardSettingsWorkspaceRouteImport
+ '/_layout/_authenticated/dashboard/settings/account': {
+ id: '/_layout/_authenticated/dashboard/settings/account'
+ path: '/account'
+ fullPath: '/dashboard/settings/account'
+ preLoaderRoute: typeof LayoutAuthenticatedDashboardSettingsAccountRouteImport
parentRoute: typeof LayoutAuthenticatedDashboardSettingsRoute
}
'/_layout/_authenticated/dashboard/settings/projects': {
@@ -813,46 +812,60 @@ declare module '@tanstack/react-router' {
preLoaderRoute: typeof LayoutAuthenticatedDashboardSettingsProjectsRouteImport
parentRoute: typeof LayoutAuthenticatedDashboardSettingsRoute
}
- '/_layout/_authenticated/dashboard/settings/account': {
- id: '/_layout/_authenticated/dashboard/settings/account'
- path: '/account'
- fullPath: '/dashboard/settings/account'
- preLoaderRoute: typeof LayoutAuthenticatedDashboardSettingsAccountRouteImport
+ '/_layout/_authenticated/dashboard/settings/workspace': {
+ id: '/_layout/_authenticated/dashboard/settings/workspace'
+ path: '/workspace'
+ fullPath: '/dashboard/settings/workspace'
+ preLoaderRoute: typeof LayoutAuthenticatedDashboardSettingsWorkspaceRouteImport
parentRoute: typeof LayoutAuthenticatedDashboardSettingsRoute
}
- '/_layout/_authenticated/dashboard/workspace/$workspaceId/': {
- id: '/_layout/_authenticated/dashboard/workspace/$workspaceId/'
- path: '/'
- fullPath: '/dashboard/workspace/$workspaceId/'
- preLoaderRoute: typeof LayoutAuthenticatedDashboardWorkspaceWorkspaceIdIndexRouteImport
- parentRoute: typeof LayoutAuthenticatedDashboardWorkspaceWorkspaceIdRoute
+ '/_layout/_authenticated/dashboard/workspace/$workspaceId': {
+ id: '/_layout/_authenticated/dashboard/workspace/$workspaceId'
+ path: '/workspace/$workspaceId'
+ fullPath: '/dashboard/workspace/$workspaceId'
+ preLoaderRoute: typeof LayoutAuthenticatedDashboardWorkspaceWorkspaceIdRouteImport
+ parentRoute: typeof LayoutAuthenticatedDashboardRoute
}
- '/_layout/_authenticated/dashboard/workspace/$workspaceId/search': {
- id: '/_layout/_authenticated/dashboard/workspace/$workspaceId/search'
- path: '/search'
- fullPath: '/dashboard/workspace/$workspaceId/search'
- preLoaderRoute: typeof LayoutAuthenticatedDashboardWorkspaceWorkspaceIdSearchRouteImport
- parentRoute: typeof LayoutAuthenticatedDashboardWorkspaceWorkspaceIdRoute
+ '/_layout/_authenticated/dashboard/workspace/create': {
+ id: '/_layout/_authenticated/dashboard/workspace/create'
+ path: '/workspace/create'
+ fullPath: '/dashboard/workspace/create'
+ preLoaderRoute: typeof LayoutAuthenticatedDashboardWorkspaceCreateRouteImport
+ parentRoute: typeof LayoutAuthenticatedDashboardRoute
}
- '/_layout/_authenticated/dashboard/workspace/$workspaceId/members': {
- id: '/_layout/_authenticated/dashboard/workspace/$workspaceId/members'
- path: '/members'
- fullPath: '/dashboard/workspace/$workspaceId/members'
- preLoaderRoute: typeof LayoutAuthenticatedDashboardWorkspaceWorkspaceIdMembersRouteImport
- parentRoute: typeof LayoutAuthenticatedDashboardWorkspaceWorkspaceIdRoute
+ '/_layout/_authenticated/dashboard/settings/account/developer': {
+ id: '/_layout/_authenticated/dashboard/settings/account/developer'
+ path: '/developer'
+ fullPath: '/dashboard/settings/account/developer'
+ preLoaderRoute: typeof LayoutAuthenticatedDashboardSettingsAccountDeveloperRouteImport
+ parentRoute: typeof LayoutAuthenticatedDashboardSettingsAccountRoute
}
- '/_layout/_authenticated/dashboard/settings/workspace/roles': {
- id: '/_layout/_authenticated/dashboard/settings/workspace/roles'
- path: '/roles'
- fullPath: '/dashboard/settings/workspace/roles'
- preLoaderRoute: typeof LayoutAuthenticatedDashboardSettingsWorkspaceRolesRouteImport
- parentRoute: typeof LayoutAuthenticatedDashboardSettingsWorkspaceRoute
+ '/_layout/_authenticated/dashboard/settings/account/information': {
+ id: '/_layout/_authenticated/dashboard/settings/account/information'
+ path: '/information'
+ fullPath: '/dashboard/settings/account/information'
+ preLoaderRoute: typeof LayoutAuthenticatedDashboardSettingsAccountInformationRouteImport
+ parentRoute: typeof LayoutAuthenticatedDashboardSettingsAccountRoute
}
- '/_layout/_authenticated/dashboard/settings/workspace/labels': {
- id: '/_layout/_authenticated/dashboard/settings/workspace/labels'
- path: '/labels'
- fullPath: '/dashboard/settings/workspace/labels'
- preLoaderRoute: typeof LayoutAuthenticatedDashboardSettingsWorkspaceLabelsRouteImport
+ '/_layout/_authenticated/dashboard/settings/account/notifications': {
+ id: '/_layout/_authenticated/dashboard/settings/account/notifications'
+ path: '/notifications'
+ fullPath: '/dashboard/settings/account/notifications'
+ preLoaderRoute: typeof LayoutAuthenticatedDashboardSettingsAccountNotificationsRouteImport
+ parentRoute: typeof LayoutAuthenticatedDashboardSettingsAccountRoute
+ }
+ '/_layout/_authenticated/dashboard/settings/account/preferences': {
+ id: '/_layout/_authenticated/dashboard/settings/account/preferences'
+ path: '/preferences'
+ fullPath: '/dashboard/settings/account/preferences'
+ preLoaderRoute: typeof LayoutAuthenticatedDashboardSettingsAccountPreferencesRouteImport
+ parentRoute: typeof LayoutAuthenticatedDashboardSettingsAccountRoute
+ }
+ '/_layout/_authenticated/dashboard/settings/workspace/billing': {
+ id: '/_layout/_authenticated/dashboard/settings/workspace/billing'
+ path: '/billing'
+ fullPath: '/dashboard/settings/workspace/billing'
+ preLoaderRoute: typeof LayoutAuthenticatedDashboardSettingsWorkspaceBillingRouteImport
parentRoute: typeof LayoutAuthenticatedDashboardSettingsWorkspaceRoute
}
'/_layout/_authenticated/dashboard/settings/workspace/general': {
@@ -862,46 +875,46 @@ declare module '@tanstack/react-router' {
preLoaderRoute: typeof LayoutAuthenticatedDashboardSettingsWorkspaceGeneralRouteImport
parentRoute: typeof LayoutAuthenticatedDashboardSettingsWorkspaceRoute
}
- '/_layout/_authenticated/dashboard/settings/account/preferences': {
- id: '/_layout/_authenticated/dashboard/settings/account/preferences'
- path: '/preferences'
- fullPath: '/dashboard/settings/account/preferences'
- preLoaderRoute: typeof LayoutAuthenticatedDashboardSettingsAccountPreferencesRouteImport
- parentRoute: typeof LayoutAuthenticatedDashboardSettingsAccountRoute
+ '/_layout/_authenticated/dashboard/settings/workspace/labels': {
+ id: '/_layout/_authenticated/dashboard/settings/workspace/labels'
+ path: '/labels'
+ fullPath: '/dashboard/settings/workspace/labels'
+ preLoaderRoute: typeof LayoutAuthenticatedDashboardSettingsWorkspaceLabelsRouteImport
+ parentRoute: typeof LayoutAuthenticatedDashboardSettingsWorkspaceRoute
}
- '/_layout/_authenticated/dashboard/settings/account/notifications': {
- id: '/_layout/_authenticated/dashboard/settings/account/notifications'
- path: '/notifications'
- fullPath: '/dashboard/settings/account/notifications'
- preLoaderRoute: typeof LayoutAuthenticatedDashboardSettingsAccountNotificationsRouteImport
- parentRoute: typeof LayoutAuthenticatedDashboardSettingsAccountRoute
+ '/_layout/_authenticated/dashboard/settings/workspace/roles': {
+ id: '/_layout/_authenticated/dashboard/settings/workspace/roles'
+ path: '/roles'
+ fullPath: '/dashboard/settings/workspace/roles'
+ preLoaderRoute: typeof LayoutAuthenticatedDashboardSettingsWorkspaceRolesRouteImport
+ parentRoute: typeof LayoutAuthenticatedDashboardSettingsWorkspaceRoute
}
- '/_layout/_authenticated/dashboard/settings/account/information': {
- id: '/_layout/_authenticated/dashboard/settings/account/information'
- path: '/information'
- fullPath: '/dashboard/settings/account/information'
- preLoaderRoute: typeof LayoutAuthenticatedDashboardSettingsAccountInformationRouteImport
- parentRoute: typeof LayoutAuthenticatedDashboardSettingsAccountRoute
+ '/_layout/_authenticated/dashboard/workspace/$workspaceId/': {
+ id: '/_layout/_authenticated/dashboard/workspace/$workspaceId/'
+ path: '/'
+ fullPath: '/dashboard/workspace/$workspaceId/'
+ preLoaderRoute: typeof LayoutAuthenticatedDashboardWorkspaceWorkspaceIdIndexRouteImport
+ parentRoute: typeof LayoutAuthenticatedDashboardWorkspaceWorkspaceIdRoute
}
- '/_layout/_authenticated/dashboard/settings/account/developer': {
- id: '/_layout/_authenticated/dashboard/settings/account/developer'
- path: '/developer'
- fullPath: '/dashboard/settings/account/developer'
- preLoaderRoute: typeof LayoutAuthenticatedDashboardSettingsAccountDeveloperRouteImport
- parentRoute: typeof LayoutAuthenticatedDashboardSettingsAccountRoute
+ '/_layout/_authenticated/dashboard/workspace/$workspaceId/members': {
+ id: '/_layout/_authenticated/dashboard/workspace/$workspaceId/members'
+ path: '/members'
+ fullPath: '/dashboard/workspace/$workspaceId/members'
+ preLoaderRoute: typeof LayoutAuthenticatedDashboardWorkspaceWorkspaceIdMembersRouteImport
+ parentRoute: typeof LayoutAuthenticatedDashboardWorkspaceWorkspaceIdRoute
}
- '/_layout/_authenticated/dashboard/settings/projects/$projectId/workflow': {
- id: '/_layout/_authenticated/dashboard/settings/projects/$projectId/workflow'
- path: '/$projectId/workflow'
- fullPath: '/dashboard/settings/projects/$projectId/workflow'
- preLoaderRoute: typeof LayoutAuthenticatedDashboardSettingsProjectsProjectIdWorkflowRouteImport
- parentRoute: typeof LayoutAuthenticatedDashboardSettingsProjectsRoute
+ '/_layout/_authenticated/dashboard/workspace/$workspaceId/search': {
+ id: '/_layout/_authenticated/dashboard/workspace/$workspaceId/search'
+ path: '/search'
+ fullPath: '/dashboard/workspace/$workspaceId/search'
+ preLoaderRoute: typeof LayoutAuthenticatedDashboardWorkspaceWorkspaceIdSearchRouteImport
+ parentRoute: typeof LayoutAuthenticatedDashboardWorkspaceWorkspaceIdRoute
}
- '/_layout/_authenticated/dashboard/settings/projects/$projectId/visibility': {
- id: '/_layout/_authenticated/dashboard/settings/projects/$projectId/visibility'
- path: '/$projectId/visibility'
- fullPath: '/dashboard/settings/projects/$projectId/visibility'
- preLoaderRoute: typeof LayoutAuthenticatedDashboardSettingsProjectsProjectIdVisibilityRouteImport
+ '/_layout/_authenticated/dashboard/settings/projects/$projectId/general': {
+ id: '/_layout/_authenticated/dashboard/settings/projects/$projectId/general'
+ path: '/$projectId/general'
+ fullPath: '/dashboard/settings/projects/$projectId/general'
+ preLoaderRoute: typeof LayoutAuthenticatedDashboardSettingsProjectsProjectIdGeneralRouteImport
parentRoute: typeof LayoutAuthenticatedDashboardSettingsProjectsRoute
}
'/_layout/_authenticated/dashboard/settings/projects/$projectId/integrations': {
@@ -911,11 +924,18 @@ declare module '@tanstack/react-router' {
preLoaderRoute: typeof LayoutAuthenticatedDashboardSettingsProjectsProjectIdIntegrationsRouteImport
parentRoute: typeof LayoutAuthenticatedDashboardSettingsProjectsRoute
}
- '/_layout/_authenticated/dashboard/settings/projects/$projectId/general': {
- id: '/_layout/_authenticated/dashboard/settings/projects/$projectId/general'
- path: '/$projectId/general'
- fullPath: '/dashboard/settings/projects/$projectId/general'
- preLoaderRoute: typeof LayoutAuthenticatedDashboardSettingsProjectsProjectIdGeneralRouteImport
+ '/_layout/_authenticated/dashboard/settings/projects/$projectId/visibility': {
+ id: '/_layout/_authenticated/dashboard/settings/projects/$projectId/visibility'
+ path: '/$projectId/visibility'
+ fullPath: '/dashboard/settings/projects/$projectId/visibility'
+ preLoaderRoute: typeof LayoutAuthenticatedDashboardSettingsProjectsProjectIdVisibilityRouteImport
+ parentRoute: typeof LayoutAuthenticatedDashboardSettingsProjectsRoute
+ }
+ '/_layout/_authenticated/dashboard/settings/projects/$projectId/workflow': {
+ id: '/_layout/_authenticated/dashboard/settings/projects/$projectId/workflow'
+ path: '/$projectId/workflow'
+ fullPath: '/dashboard/settings/projects/$projectId/workflow'
+ preLoaderRoute: typeof LayoutAuthenticatedDashboardSettingsProjectsProjectIdWorkflowRouteImport
parentRoute: typeof LayoutAuthenticatedDashboardSettingsProjectsRoute
}
'/_layout/_authenticated/dashboard/workspace/$workspaceId/project/$projectId/': {
@@ -925,11 +945,11 @@ declare module '@tanstack/react-router' {
preLoaderRoute: typeof LayoutAuthenticatedDashboardWorkspaceWorkspaceIdProjectProjectIdIndexRouteImport
parentRoute: typeof LayoutAuthenticatedDashboardWorkspaceWorkspaceIdRoute
}
- '/_layout/_authenticated/dashboard/workspace/$workspaceId/project/$projectId/gantt': {
- id: '/_layout/_authenticated/dashboard/workspace/$workspaceId/project/$projectId/gantt'
- path: '/project/$projectId/gantt'
- fullPath: '/dashboard/workspace/$workspaceId/project/$projectId/gantt'
- preLoaderRoute: typeof LayoutAuthenticatedDashboardWorkspaceWorkspaceIdProjectProjectIdGanttRouteImport
+ '/_layout/_authenticated/dashboard/workspace/$workspaceId/project/$projectId/backlog': {
+ id: '/_layout/_authenticated/dashboard/workspace/$workspaceId/project/$projectId/backlog'
+ path: '/project/$projectId/backlog'
+ fullPath: '/dashboard/workspace/$workspaceId/project/$projectId/backlog'
+ preLoaderRoute: typeof LayoutAuthenticatedDashboardWorkspaceWorkspaceIdProjectProjectIdBacklogRouteImport
parentRoute: typeof LayoutAuthenticatedDashboardWorkspaceWorkspaceIdRoute
}
'/_layout/_authenticated/dashboard/workspace/$workspaceId/project/$projectId/board': {
@@ -939,11 +959,11 @@ declare module '@tanstack/react-router' {
preLoaderRoute: typeof LayoutAuthenticatedDashboardWorkspaceWorkspaceIdProjectProjectIdBoardRouteImport
parentRoute: typeof LayoutAuthenticatedDashboardWorkspaceWorkspaceIdRoute
}
- '/_layout/_authenticated/dashboard/workspace/$workspaceId/project/$projectId/backlog': {
- id: '/_layout/_authenticated/dashboard/workspace/$workspaceId/project/$projectId/backlog'
- path: '/project/$projectId/backlog'
- fullPath: '/dashboard/workspace/$workspaceId/project/$projectId/backlog'
- preLoaderRoute: typeof LayoutAuthenticatedDashboardWorkspaceWorkspaceIdProjectProjectIdBacklogRouteImport
+ '/_layout/_authenticated/dashboard/workspace/$workspaceId/project/$projectId/gantt': {
+ id: '/_layout/_authenticated/dashboard/workspace/$workspaceId/project/$projectId/gantt'
+ path: '/project/$projectId/gantt'
+ fullPath: '/dashboard/workspace/$workspaceId/project/$projectId/gantt'
+ preLoaderRoute: typeof LayoutAuthenticatedDashboardWorkspaceWorkspaceIdProjectProjectIdGanttRouteImport
parentRoute: typeof LayoutAuthenticatedDashboardWorkspaceWorkspaceIdRoute
}
'/_layout/_authenticated/dashboard/workspace/$workspaceId/project/$projectId/task/$taskId_': {
@@ -1005,6 +1025,7 @@ const LayoutAuthenticatedDashboardSettingsProjectsRouteWithChildren =
)
interface LayoutAuthenticatedDashboardSettingsWorkspaceRouteChildren {
+ LayoutAuthenticatedDashboardSettingsWorkspaceBillingRoute: typeof LayoutAuthenticatedDashboardSettingsWorkspaceBillingRoute
LayoutAuthenticatedDashboardSettingsWorkspaceGeneralRoute: typeof LayoutAuthenticatedDashboardSettingsWorkspaceGeneralRoute
LayoutAuthenticatedDashboardSettingsWorkspaceLabelsRoute: typeof LayoutAuthenticatedDashboardSettingsWorkspaceLabelsRoute
LayoutAuthenticatedDashboardSettingsWorkspaceRolesRoute: typeof LayoutAuthenticatedDashboardSettingsWorkspaceRolesRoute
@@ -1012,6 +1033,8 @@ interface LayoutAuthenticatedDashboardSettingsWorkspaceRouteChildren {
const LayoutAuthenticatedDashboardSettingsWorkspaceRouteChildren: LayoutAuthenticatedDashboardSettingsWorkspaceRouteChildren =
{
+ LayoutAuthenticatedDashboardSettingsWorkspaceBillingRoute:
+ LayoutAuthenticatedDashboardSettingsWorkspaceBillingRoute,
LayoutAuthenticatedDashboardSettingsWorkspaceGeneralRoute:
LayoutAuthenticatedDashboardSettingsWorkspaceGeneralRoute,
LayoutAuthenticatedDashboardSettingsWorkspaceLabelsRoute:
diff --git a/apps/web/src/routes/_layout/_authenticated/dashboard/settings/workspace.tsx b/apps/web/src/routes/_layout/_authenticated/dashboard/settings/workspace.tsx
index dd55ffb6d..451b7c775 100644
--- a/apps/web/src/routes/_layout/_authenticated/dashboard/settings/workspace.tsx
+++ b/apps/web/src/routes/_layout/_authenticated/dashboard/settings/workspace.tsx
@@ -5,7 +5,7 @@ import {
redirect,
useLocation,
} from "@tanstack/react-router";
-import { Settings, Shield, Tag } from "lucide-react";
+import { CreditCard, Settings, Shield, Tag } from "lucide-react";
import { useTranslation } from "react-i18next";
import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar";
import { Button } from "@/components/ui/button";
@@ -17,6 +17,7 @@ import {
SidebarMenuItem,
} from "@/components/ui/sidebar";
import getWorkspaces from "@/fetchers/workspace/get-workspaces";
+import useGetConfig from "@/hooks/queries/config/use-get-config";
import { useWorkspacePermission } from "@/hooks/use-workspace-permission";
import { authClient } from "@/lib/auth-client";
import { cn } from "@/lib/cn";
@@ -50,6 +51,7 @@ export const Route = createFileRoute(
function RouteComponent() {
const { t } = useTranslation();
const { workspace, role } = useWorkspacePermission();
+ const { data: config } = useGetConfig();
const location = useLocation();
const menuItems = [
{
@@ -67,6 +69,15 @@ function RouteComponent() {
url: "/dashboard/settings/workspace/labels",
icon: Tag,
},
+ ...(config?.billingEnabled
+ ? [
+ {
+ title: "Billing",
+ url: "/dashboard/settings/workspace/billing",
+ icon: CreditCard,
+ },
+ ]
+ : []),
];
const isActivePath = (path: string) => location.pathname === path;
const workspaceInitials = getInitials(workspace?.name, "WS");
diff --git a/apps/web/src/routes/_layout/_authenticated/dashboard/settings/workspace/billing.tsx b/apps/web/src/routes/_layout/_authenticated/dashboard/settings/workspace/billing.tsx
new file mode 100644
index 000000000..4e7809df1
--- /dev/null
+++ b/apps/web/src/routes/_layout/_authenticated/dashboard/settings/workspace/billing.tsx
@@ -0,0 +1,217 @@
+import { createFileRoute } from "@tanstack/react-router";
+import { useState } from "react";
+import PageTitle from "@/components/page-title";
+import { Button } from "@/components/ui/button";
+import { Separator } from "@/components/ui/separator";
+import { Spinner } from "@/components/ui/spinner";
+import {
+ useCreateCheckout,
+ useOpenBillingPortal,
+} from "@/hooks/mutations/billing/use-billing-actions";
+import { useGetBilling } from "@/hooks/queries/billing/use-get-billing";
+import { useWorkspacePermission } from "@/hooks/use-workspace-permission";
+
+export const Route = createFileRoute(
+ "/_layout/_authenticated/dashboard/settings/workspace/billing",
+)({
+ component: RouteComponent,
+});
+
+type Interval = "monthly" | "annual";
+
+const PLANS = [
+ {
+ plan: "personal" as const,
+ name: "Cloud Personal",
+ tagline: "For individuals",
+ monthly: "€4 / month",
+ annual: "€40 / year",
+ },
+ {
+ plan: "team" as const,
+ name: "Cloud Team",
+ tagline: "Per user, for teams",
+ monthly: "€5 / user / month",
+ annual: "€50 / user / year",
+ },
+];
+
+const STATUS_LABEL: Record<string, string> = {
+ active: "Active",
+ trialing: "Trial",
+ past_due: "Payment past due",
+ scheduled_cancel: "Cancels at period end",
+ canceled: "Canceled",
+ expired: "Expired",
+ paused: "Paused",
+};
+
+function formatDate(value: string | null | undefined) {
+ if (!value) return null;
+ return new Date(value).toLocaleDateString(undefined, {
+ year: "numeric",
+ month: "long",
+ day: "numeric",
+ });
+}
+
+function RouteComponent() {
+ const { workspace, isAdmin } = useWorkspacePermission();
+ const workspaceId = workspace?.id;
+ const canManage = isAdmin;
+
+ const { data: billing, isLoading } = useGetBilling(workspaceId);
+ const checkout = useCreateCheckout(workspaceId);
+ const portal = useOpenBillingPortal(workspaceId);
+ const [interval, setInterval] = useState<Interval>("monthly");
+
+ if (isLoading) {
+ return (
+ <div className="flex h-40 items-center justify-center">
+ <Spinner />
+ </div>
+ );
+ }
+
+ if (!billing?.billingEnabled) {
+ return (
+ <>
+ <PageTitle title="Billing" />
+ <div className="mx-auto max-w-4xl space-y-2">
+ <h1 className="font-semibold text-2xl">Billing</h1>
+ <p className="text-muted-foreground text-sm">
+ Billing is not enabled on this instance. Self-hosted Kaneo includes
+ every feature for free.
+ </p>
+ </div>
+ </>
+ );
+ }
+
+ const status = billing.status ? STATUS_LABEL[billing.status] : null;
+ const renews = formatDate(billing.currentPeriodEnd);
+ const trialEnds = formatDate(billing.trialEndsAt);
+ const hasSubscription = Boolean(billing.plan && billing.status);
+
+ return (
+ <>
+ <PageTitle title="Billing" />
+ <div className="mx-auto max-w-4xl space-y-8">
+ <div className="space-y-2">
+ <h1 className="font-semibold text-2xl">Billing</h1>
+ <p className="text-muted-foreground text-sm">
+ Manage the Kaneo Cloud subscription for this workspace.
+ </p>
+ </div>
+
+ <div className="space-y-4">
+ <h2 className="font-medium text-md">Current plan</h2>
+ <div className="rounded-lg border border-border p-4">
+ {billing.foundingFree ? (
+ <p className="text-sm">
+ <span className="font-medium">Founding Free.</span> This
+ workspace has free access to Kaneo Cloud. Thank you for being an
+ early user.
+ </p>
+ ) : hasSubscription ? (
+ <div className="space-y-1 text-sm">
+ <p>
+ <span className="font-medium capitalize">
+ {billing.plan} · {billing.billingInterval}
+ </span>
+ {status ? ` · ${status}` : null}
+ </p>
+ {billing.seats > 1 ? <p>{billing.seats} seats</p> : null}
+ {renews ? (
+ <p className="text-muted-foreground">
+ {billing.canceledAt
+ ? `Access ends ${renews}`
+ : `Renews ${renews}`}
+ </p>
+ ) : null}
+ </div>
+ ) : (
+ <div className="space-y-1 text-sm">
+ <p className="font-medium">Free trial</p>
+ <p className="text-muted-foreground">
+ {trialEnds
+ ? `Your trial ends ${trialEnds}. Choose a plan to continue.`
+ : "Choose a plan to continue after your trial."}
+ </p>
+ </div>
+ )}
+ </div>
+
+ {billing.hasCustomer ? (
+ <Button
+ variant="outline"
+ size="sm"
+ disabled={!canManage || portal.isPending}
+ onClick={() => portal.mutate()}
+ >
+ {portal.isPending ? "Opening…" : "Manage billing & invoices"}
+ </Button>
+ ) : null}
+ </div>
+
+ {!billing.foundingFree && !hasSubscription ? (
+ <>
+ <Separator />
+ <div className="space-y-4">
+ <div className="flex items-center justify-between">
+ <h2 className="font-medium text-md">Choose a plan</h2>
+ <div className="flex rounded-lg border border-border p-0.5 text-sm">
+ {(["monthly", "annual"] as const).map((value) => (
+ <button
+ key={value}
+ type="button"
+ onClick={() => setInterval(value)}
+ className={`rounded-md px-3 py-1 capitalize transition-colors ${
+ interval === value
+ ? "bg-accent text-accent-foreground"
+ : "text-muted-foreground"
+ }`}
+ >
+ {value}
+ </button>
+ ))}
+ </div>
+ </div>
+
+ <div className="grid gap-4 sm:grid-cols-2">
+ {PLANS.map((p) => (
+ <div
+ key={p.plan}
+ className="flex flex-col rounded-lg border border-border p-4"
+ >
+ <p className="font-medium text-sm">{p.name}</p>
+ <p className="text-muted-foreground text-sm">{p.tagline}</p>
+ <p className="mt-3 font-medium text-lg">
+ {interval === "monthly" ? p.monthly : p.annual}
+ </p>
+ <Button
+ size="sm"
+ className="mt-4"
+ disabled={!canManage || checkout.isPending}
+ onClick={() =>
+ checkout.mutate({ plan: p.plan, interval })
+ }
+ >
+ {checkout.isPending ? "Starting…" : "Subscribe"}
+ </Button>
+ </div>
+ ))}
+ </div>
+
+ {!canManage ? (
+ <p className="text-muted-foreground text-sm">
+ Only workspace owners and admins can manage billing.
+ </p>
+ ) : null}
+ </div>
+ </>
+ ) : null}
+ </div>
+ </>
+ );
+}
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index b442239ab..8fae47bd3 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -126,6 +126,9 @@ importers:
better-auth:
specifier: 1.6.23
+ creem:
+ specifier: ^1.6.0
+ version: 1.6.0
croner:
specifier: ^10.0.1
version: 10.0.1
@@ -4563,6 +4566,10 @@ packages:
typescript:
optional: true
+ resolution: {integrity: sha512-1dwtrqJ5wWgBVL+0eIqHS4IN99tJeWHa1hbr4AQUNe3r/Zjo0W1/xXvZbhS9TwPNRgsP1gDIsTRQrRHRjG4wzw==}
+ hasBin: true
+
resolution: {integrity: sha512-ixNtAJndqh173VQ4KodSdJEI6nuioBWI0V1ITNKhZZsO0pEMoDxz539T4FTTbSZ/xIOSuDnzxLVRqBVSvPNE2g==}
engines: {node: '>=18.0'}
@@ -5549,6 +5556,10 @@ packages:
resolution: {integrity: sha512-POQXvpdL69+CluYsillJ7SUhKvytYjW9vG/GKpnf+xP8UWgYEM/RaMzHHofbALDiKbbP1W8UEYmgGl39WkPZsg==}
engines: {'0': node >= 0.2.0}
+ resolution: {integrity: sha512-Bj8ldGo67FNvj5nNsxGN7frkUcHZWqszNkfBOvfxOM1+WUa5J0PiGaflroTKOjGo2JQhOC1DZUaTv4tGzBaQLQ==}
+ engines: {node: '>=20'}
+
resolution: {integrity: sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==}
engines: {node: '>=6'}
@@ -11615,6 +11626,15 @@ snapshots:
optionalDependencies:
typescript: 5.8.3
+ dependencies:
+ '@modelcontextprotocol/sdk': 1.29.0([email protected])
+ jsonpath-rfc9535: 1.1.0
+ zod: 4.4.3
+ transitivePeerDependencies:
+ - '@cfworker/json-schema'
+ - supports-color
+
@@ -12528,6 +12548,8 @@ snapshots:
+
diff --git a/tests/api/billing/config.test.ts b/tests/api/billing/config.test.ts
new file mode 100644
index 000000000..fc87715b8
--- /dev/null
+++ b/tests/api/billing/config.test.ts
@@ -0,0 +1,96 @@
+import { afterEach, beforeEach, describe, expect, it } from "vitest";
+import {
+ foundingCutoff,
+ isBillingEnabled,
+ planForProductId,
+ productIdFor,
+ trialDays,
+} from "../../../apps/api/src/billing/config";
+
+const KEYS = [
+ "KANEO_CLOUD",
+ "CREEM_API_KEY",
+ "CREEM_WEBHOOK_SECRET",
+ "CREEM_PRODUCT_PERSONAL_MONTHLY",
+ "CREEM_PRODUCT_PERSONAL_ANNUAL",
+ "CREEM_PRODUCT_TEAM_MONTHLY",
+ "CREEM_PRODUCT_TEAM_ANNUAL",
+ "BILLING_TRIAL_DAYS",
+ "BILLING_FOUNDING_CUTOFF",
+];
+
+let saved: Record<string, string | undefined>;
+
+beforeEach(() => {
+ saved = {};
+ for (const key of KEYS) {
+ saved[key] = process.env[key];
+ delete process.env[key];
+ }
+});
+
+afterEach(() => {
+ for (const key of KEYS) {
+ if (saved[key] === undefined) {
+ delete process.env[key];
+ } else {
+ process.env[key] = saved[key];
+ }
+ }
+});
+
+describe("billing config", () => {
+ it("is disabled unless cloud + both keys are set", () => {
+ expect(isBillingEnabled()).toBe(false);
+
+ process.env.KANEO_CLOUD = "true";
+ expect(isBillingEnabled()).toBe(false);
+
+ process.env.CREEM_API_KEY = "key";
+ expect(isBillingEnabled()).toBe(false);
+
+ process.env.CREEM_WEBHOOK_SECRET = "secret";
+ expect(isBillingEnabled()).toBe(true);
+ });
+
+ it("stays disabled for self-hosted even with keys present", () => {
+ process.env.CREEM_API_KEY = "key";
+ process.env.CREEM_WEBHOOK_SECRET = "secret";
+ expect(isBillingEnabled()).toBe(false);
+ });
+
+ it("maps plan+interval to product id and back", () => {
+ process.env.CREEM_PRODUCT_PERSONAL_MONTHLY = "prod_pm";
+ process.env.CREEM_PRODUCT_TEAM_ANNUAL = "prod_ta";
+
+ expect(productIdFor("personal", "monthly")).toBe("prod_pm");
+ expect(productIdFor("team", "annual")).toBe("prod_ta");
+ expect(productIdFor("personal", "annual")).toBeNull();
+
+ expect(planForProductId("prod_pm")).toEqual({
+ plan: "personal",
+ interval: "monthly",
+ });
+ expect(planForProductId("prod_ta")).toEqual({
+ plan: "team",
+ interval: "annual",
+ });
+ expect(planForProductId("prod_unknown")).toBeNull();
+ });
+
+ it("defaults trial to 14 days and reads override", () => {
+ expect(trialDays()).toBe(14);
+ process.env.BILLING_TRIAL_DAYS = "30";
+ expect(trialDays()).toBe(30);
+ process.env.BILLING_TRIAL_DAYS = "not-a-number";
+ expect(trialDays()).toBe(14);
+ });
+
+ it("parses the founding cutoff date, null when unset or invalid", () => {
+ expect(foundingCutoff()).toBeNull();
+ process.env.BILLING_FOUNDING_CUTOFF = "2026-07-28";
+ expect(foundingCutoff()?.getUTCFullYear()).toBe(2026);
+ process.env.BILLING_FOUNDING_CUTOFF = "garbage";
+ expect(foundingCutoff()).toBeNull();
+ });
+});
diff --git a/tests/api/billing/entitlement.test.ts b/tests/api/billing/entitlement.test.ts
new file mode 100644
index 000000000..5362d8abd
--- /dev/null
+++ b/tests/api/billing/entitlement.test.ts
@@ -0,0 +1,92 @@
+import { afterEach, beforeEach, describe, expect, it } from "vitest";
+import { computeEntitlement } from "../../../apps/api/src/billing/controllers/get-workspace-billing";
+
+type Billing = Parameters<typeof computeEntitlement>[0];
+
+function billing(overrides: Partial<Billing>): Billing {
+ return {
+ id: "b1",
+ workspaceId: "w1",
+ foundingFree: false,
+ trialEndsAt: null,
+ creemCustomerId: null,
+ creemSubscriptionId: null,
+ creemProductId: null,
+ plan: null,
+ billingInterval: null,
+ status: null,
+ seats: 1,
+ currentPeriodEnd: null,
+ canceledAt: null,
+ createdAt: new Date(),
+ updatedAt: new Date(),
+ ...overrides,
+ } as Billing;
+}
+
+const CLOUD_KEYS = ["KANEO_CLOUD", "CREEM_API_KEY", "CREEM_WEBHOOK_SECRET"];
+let saved: Record<string, string | undefined>;
+
+beforeEach(() => {
+ saved = {};
+ for (const key of CLOUD_KEYS) {
+ saved[key] = process.env[key];
+ }
+ process.env.KANEO_CLOUD = "true";
+ process.env.CREEM_API_KEY = "key";
+ process.env.CREEM_WEBHOOK_SECRET = "secret";
+});
+
+afterEach(() => {
+ for (const key of CLOUD_KEYS) {
+ if (saved[key] === undefined) {
+ delete process.env[key];
+ } else {
+ process.env[key] = saved[key];
+ }
+ }
+});
+
+describe("computeEntitlement", () => {
+ it("grants access to everyone when billing is disabled", () => {
+ delete process.env.CREEM_API_KEY;
+ expect(computeEntitlement(billing({})).active).toBe(true);
+ expect(computeEntitlement(billing({})).reason).toBe("billing_disabled");
+ });
+
+ it("grants access to founding-free workspaces", () => {
+ const result = computeEntitlement(billing({ foundingFree: true }));
+ expect(result).toEqual({ active: true, reason: "founding_free" });
+ });
+
+ it("grants access for active subscription statuses", () => {
+ for (const status of [
+ "active",
+ "trialing",
+ "past_due",
+ "scheduled_cancel",
+ ]) {
+ expect(computeEntitlement(billing({ status })).active).toBe(true);
+ }
+ });
+
+ it("grants access during an unexpired trial", () => {
+ const trialEndsAt = new Date(Date.now() + 60_000);
+ expect(computeEntitlement(billing({ trialEndsAt })).reason).toBe("trial");
+ });
+
+ it("denies access when trial expired and no subscription", () => {
+ const trialEndsAt = new Date(Date.now() - 60_000);
+ const result = computeEntitlement(billing({ trialEndsAt }));
+ expect(result).toEqual({ active: false, reason: "expired" });
+ });
+
+ it("denies access for canceled/expired subscriptions", () => {
+ expect(computeEntitlement(billing({ status: "canceled" })).active).toBe(
+ false,
+ );
+ expect(computeEntitlement(billing({ status: "expired" })).active).toBe(
+ false,
+ );
+ });
+});