⚡ Project management that doesn't become the project. Boards, Gantt charts, and GitHub integration. Self-host it or use Kaneo Cloud.
TypeScript honoissue-managementissue-trackerjira-alternativekanbanlinear-alternativemcpproject-managementreactself-hostedtypescript
feat(calendar): add label-filtered project calendar feeds
Tinf18b01ba4039
diff --git a/apps/api/drizzle/0038_calendar_feeds.sql b/apps/api/drizzle/0038_calendar_feeds.sqlnew file mode 100644index 000000000..a60e7b882--- /dev/null+++ b/apps/api/drizzle/0038_calendar_feeds.sql@@ -0,0 +1,12 @@+CREATE TABLE "calendar_feed" (+ "id" text PRIMARY KEY NOT NULL,+ "project_id" text NOT NULL,+ "token" text NOT NULL,+ "label_ids" jsonb NOT NULL,+ "time_zone" text DEFAULT 'UTC' NOT NULL,+ "created_at" timestamp DEFAULT now() NOT NULL,+ CONSTRAINT "calendar_feed_token_unique" UNIQUE("token")+);+--> statement-breakpoint+ALTER TABLE "calendar_feed" ADD CONSTRAINT "calendar_feed_project_id_project_id_fk" FOREIGN KEY ("project_id") REFERENCES "public"."project"("id") ON DELETE cascade ON UPDATE cascade;--> statement-breakpoint+CREATE INDEX "calendar_feed_project_id_idx" ON "calendar_feed" USING btree ("project_id");\ No newline at end of filediff --git a/apps/api/drizzle/meta/0038_snapshot.json b/apps/api/drizzle/meta/0038_snapshot.jsonnew file mode 100644index 000000000..a46c941de--- /dev/null+++ b/apps/api/drizzle/meta/0038_snapshot.json@@ -0,0 +1,4024 @@+{+ "id": "0ea9a390-61b7-425a-935f-85eada83c031",+ "prevId": "0069b9f8-30bf-42e6-9603-13b0db606552",+ "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.calendar_feed": {+ "name": "calendar_feed",+ "schema": "",+ "columns": {+ "id": {+ "name": "id",+ "type": "text",+ "primaryKey": true,+ "notNull": true+ },+ "project_id": {+ "name": "project_id",+ "type": "text",+ "primaryKey": false,+ "notNull": true+ },+ "token": {+ "name": "token",+ "type": "text",+ "primaryKey": false,+ "notNull": true+ },+ "label_ids": {+ "name": "label_ids",+ "type": "jsonb",+ "primaryKey": false,+ "notNull": true+ },+ "time_zone": {+ "name": "time_zone",+ "type": "text",+ "primaryKey": false,+ "notNull": true,+ "default": "'UTC'"+ },+ "created_at": {+ "name": "created_at",+ "type": "timestamp",+ "primaryKey": false,+ "notNull": true,+ "default": "now()"+ }+ },+ "indexes": {+ "calendar_feed_project_id_idx": {+ "name": "calendar_feed_project_id_idx",+ "columns": [+ {+ "expression": "project_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": false,+ "concurrently": false,+ "method": "btree",+ "with": {}+ }+ },+ "foreignKeys": {+ "calendar_feed_project_id_project_id_fk": {+ "name": "calendar_feed_project_id_project_id_fk",+ "tableFrom": "calendar_feed",+ "tableTo": "project",+ "columnsFrom": ["project_id"],+ "columnsTo": ["id"],+ "onDelete": "cascade",+ "onUpdate": "cascade"+ }+ },+ "compositePrimaryKeys": {},+ "uniqueConstraints": {+ "calendar_feed_token_unique": {+ "name": "calendar_feed_token_unique",+ "nullsNotDistinct": false,+ "columns": ["token"]+ }+ },+ "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.mcp_oauth_state": {+ "name": "mcp_oauth_state",+ "schema": "",+ "columns": {+ "id": {+ "name": "id",+ "type": "text",+ "primaryKey": true,+ "notNull": true+ },+ "kind": {+ "name": "kind",+ "type": "text",+ "primaryKey": false,+ "notNull": true+ },+ "key": {+ "name": "key",+ "type": "text",+ "primaryKey": false,+ "notNull": true+ },+ "payload": {+ "name": "payload",+ "type": "jsonb",+ "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": {+ "mcp_oauth_state_kind_key_uidx": {+ "name": "mcp_oauth_state_kind_key_uidx",+ "columns": [+ {+ "expression": "kind",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ },+ {+ "expression": "key",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": true,+ "concurrently": false,+ "method": "btree",+ "with": {}+ },+ "mcp_oauth_state_expiresAt_idx": {+ "name": "mcp_oauth_state_expiresAt_idx",+ "columns": [+ {+ "expression": "expires_at",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": false,+ "concurrently": false,+ "method": "btree",+ "with": {}+ }+ },+ "foreignKeys": {},+ "compositePrimaryKeys": {},+ "uniqueConstraints": {},+ "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+ },+ "position": {+ "name": "position",+ "type": "integer",+ "primaryKey": false,+ "notNull": true,+ "default": 0+ }+ },+ "indexes": {+ "project_workspaceId_position_idx": {+ "name": "project_workspaceId_position_idx",+ "columns": [+ {+ "expression": "workspace_id",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ },+ {+ "expression": "position",+ "isExpression": false,+ "asc": true,+ "nulls": "last"+ }+ ],+ "isUnique": false,+ "concurrently": false,+ "method": "btree",+ "with": {}+ }+ },+ "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.jsonindex 7e42cfe54..801c88ac6 100644--- a/apps/api/drizzle/meta/_journal.json+++ b/apps/api/drizzle/meta/_journal.json@@ -267,6 +267,13 @@"when": 1786185172966,"tag": "0037_tiny_raza","breakpoints": true+ },+ {+ "idx": 38,+ "version": "7",+ "when": 1790157215611,+ "tag": "0038_calendar_feeds",+ "breakpoints": true}]}diff --git a/apps/api/src/calendar-feed/ical.ts b/apps/api/src/calendar-feed/ical.tsnew file mode 100644index 000000000..5eecfe317--- /dev/null+++ b/apps/api/src/calendar-feed/ical.ts@@ -0,0 +1,105 @@+type CalendarTask = {+ id: string;+ title: string;+ description: string | null;+ startDate: Date | null;+ dueDate: Date | null;+ createdAt: Date;+ updatedAt: Date;+};++function escapeText(value: string) {+ return value+ .replaceAll("\\", "\\\\")+ .replace(/\r\n|\r|\n/g, "\\n")+ .replaceAll(";", "\\;")+ .replaceAll(",", "\\,");+}++// RFC 5545 limits physical lines to 75 octets, including continuation spaces.+function foldLine(line: string) {+ const lines: string[] = [];+ let current = "";+ let bytes = 0;+ for (const character of line) {+ const size = Buffer.byteLength(character, "utf8");+ if (bytes + size > 75) {+ lines.push(current);+ current = " ";+ bytes = 1;+ }+ current += character;+ bytes += size;+ }+ lines.push(current);+ return lines.join("\r\n");+}++function timestamp(date: Date) {+ return date+ .toISOString()+ .replace(/[-:]/g, "")+ .replace(/\.\d{3}Z$/, "Z");+}++function calendarDate(date: Date, timeZone: string) {+ const parts = new Intl.DateTimeFormat("en-US", {+ timeZone,+ year: "numeric",+ month: "2-digit",+ day: "2-digit",+ }).formatToParts(date);+ return ["year", "month", "day"]+ .map((type) => parts.find((part) => part.type === type)?.value)+ .join("");+}++function nextDay(date: string) {+ const day = new Date(+ `${date.slice(0, 4)}-${date.slice(4, 6)}-${date.slice(6, 8)}T00:00:00Z`,+ );+ day.setUTCDate(day.getUTCDate() + 1);+ return day.toISOString().slice(0, 10).replaceAll("-", "");+}++export function buildCalendar({+ name,+ timeZone,+ tasks,+}: {+ name: string;+ timeZone: string;+ tasks: CalendarTask[];+}) {+ const lines = [+ "BEGIN:VCALENDAR",+ "VERSION:2.0",+ "PRODID:-//Kaneo//Calendar Feed//EN",+ "CALSCALE:GREGORIAN",+ `X-WR-CALNAME:${escapeText(name)}`,+ ];+ for (const task of tasks) {+ const scheduledDate = task.startDate ?? task.dueDate;+ if (!scheduledDate) continue;+ const start = calendarDate(scheduledDate, timeZone);+ const due = calendarDate(task.dueDate ?? scheduledDate, timeZone);+ lines.push(+ "BEGIN:VEVENT",+ `UID:${task.id}@kaneo`,+ `DTSTAMP:${timestamp(task.updatedAt)}`,+ `CREATED:${timestamp(task.createdAt)}`,+ `LAST-MODIFIED:${timestamp(task.updatedAt)}`,+ `DTSTART;VALUE=DATE:${start}`,+ // Task due dates are inclusive; iCalendar's DTEND is exclusive.+ `DTEND;VALUE=DATE:${nextDay(due < start ? start : due)}`,+ `SUMMARY:${escapeText(task.title)}`,+ ...(task.description+ ? [`DESCRIPTION:${escapeText(task.description)}`]+ : []),+ "TRANSP:TRANSPARENT",+ "END:VEVENT",+ );+ }+ lines.push("END:VCALENDAR");+ return `${lines.map(foldLine).join("\r\n")}\r\n`;+}diff --git a/apps/api/src/calendar-feed/index.ts b/apps/api/src/calendar-feed/index.tsnew file mode 100644index 000000000..515df2a36--- /dev/null+++ b/apps/api/src/calendar-feed/index.ts@@ -0,0 +1,162 @@+import { Hono } from "hono";+import { describeRoute, resolver, validator } from "hono-openapi";+import * as v from "valibot";+import { requireWorkspacePermission } from "../utils/require-workspace-permission";+import { workspaceAccess } from "../utils/workspace-access-middleware";+import {+ createCalendarFeed,+ getCalendarFeed,+ listCalendarFeeds,+ revokeCalendarFeed,+} from "./service";++const feedSchema = v.object({+ id: v.string(),+ projectId: v.string(),+ token: v.string(),+ labelIds: v.array(v.string()),+ timeZone: v.string(),+ createdAt: v.date(),+});+const projectParam = v.object({ projectId: v.string() });+const sharePermission = requireWorkspacePermission({ project: ["share"] });++export const publicCalendarFeed = new Hono().get(+ "/:token/calendar.ics",+ describeRoute({+ operationId: "getCalendarFeed",+ tags: ["Calendar feeds"],+ description:+ "Subscribe to scheduled project tasks using a secret calendar feed link",+ security: [],+ responses: {+ 200: {+ description: "iCalendar feed",+ content: { "text/calendar": { schema: { type: "string" } } },+ },+ },+ }),+ validator(+ "param",+ v.object({ token: v.pipe(v.string(), v.regex(/^[a-f0-9]{64}$/)) }),+ ),+ async (c) => {+ c.header("Cache-Control", "private, no-store");+ c.header("X-Content-Type-Options", "nosniff");+ c.header("Content-Type", "text/calendar; charset=utf-8");+ c.header("Content-Disposition", 'inline; filename="kaneo.ics"');+ return c.body(await getCalendarFeed(c.req.valid("param").token));+ },+);++const calendarFeed = new Hono<{+ Variables: { userId: string; workspaceId: string };+}>()+ .get(+ "/project/:projectId",+ describeRoute({+ operationId: "listCalendarFeeds",+ tags: ["Calendar feeds"],+ description:+ "List project calendar subscriptions (requires project sharing permission)",+ responses: {+ 200: {+ description: "Calendar feeds",+ content: {+ "application/json": { schema: resolver(v.array(feedSchema)) },+ },+ },+ },+ }),+ validator("param", projectParam),+ workspaceAccess.fromProject("projectId"),+ sharePermission,+ async (c) => {+ c.header("Cache-Control", "private, no-store");+ return c.json(await listCalendarFeeds(c.req.valid("param").projectId));+ },+ )+ .post(+ "/project/:projectId",+ describeRoute({+ operationId: "createCalendarFeed",+ tags: ["Calendar feeds"],+ description: "Create a calendar subscription matching any selected label",+ responses: {+ 201: {+ description: "Calendar feed created",+ content: { "application/json": { schema: resolver(feedSchema) } },+ },+ },+ }),+ validator("param", projectParam),+ validator(+ "json",+ v.object({+ labelIds: v.pipe(+ v.array(v.pipe(v.string(), v.minLength(1))),+ v.minLength(1),+ v.maxLength(100),+ ),+ timeZone: v.optional(+ v.pipe(+ v.string(),+ v.check((value) => {+ try {+ new Intl.DateTimeFormat("en-US", { timeZone: value });+ return true;+ } catch {+ return false;+ }+ }, "Invalid time zone"),+ ),+ "UTC",+ ),+ }),+ ),+ workspaceAccess.fromProject("projectId"),+ sharePermission,+ async (c) => {+ const { labelIds, timeZone } = c.req.valid("json");+ c.header("Cache-Control", "private, no-store");+ return c.json(+ await createCalendarFeed(+ c.req.valid("param").projectId,+ c.get("workspaceId"),+ labelIds,+ timeZone,+ ),+ 201,+ );+ },+ )+ .delete(+ "/project/:projectId/:id",+ describeRoute({+ operationId: "revokeCalendarFeed",+ tags: ["Calendar feeds"],+ description: "Revoke a calendar subscription link",+ responses: {+ 200: {+ description: "Calendar feed revoked",+ content: {+ "application/json": {+ schema: resolver(v.object({ success: v.boolean() })),+ },+ },+ },+ },+ }),+ validator("param", v.object({ projectId: v.string(), id: v.string() })),+ workspaceAccess.fromProject("projectId"),+ sharePermission,+ async (c) =>+ c.json(+ await revokeCalendarFeed(+ c.req.valid("param").projectId,+ c.req.valid("param").id,+ ),+ ),+ );++export default calendarFeed;diff --git a/apps/api/src/calendar-feed/service.ts b/apps/api/src/calendar-feed/service.tsnew file mode 100644index 000000000..de72b2646--- /dev/null+++ b/apps/api/src/calendar-feed/service.ts@@ -0,0 +1,115 @@+import { randomBytes } from "node:crypto";+import { and, asc, eq, inArray, isNotNull, or } from "drizzle-orm";+import { HTTPException } from "hono/http-exception";+import db from "../database";+import {+ calendarFeedTable,+ labelTable,+ projectTable,+ taskTable,+} from "../database/schema";+import { buildCalendar } from "./ical";++export async function createCalendarFeed(+ projectId: string,+ workspaceId: string,+ labelIds: string[],+ timeZone: string,+) {+ const ids = [...new Set(labelIds)];+ const labels = await db+ .select({ id: labelTable.id })+ .from(labelTable)+ .where(+ and(eq(labelTable.workspaceId, workspaceId), inArray(labelTable.id, ids)),+ );+ if (labels.length !== ids.length) {+ throw new HTTPException(400, {+ message: "Select labels from this workspace",+ });+ }+ const [feed] = await db+ .insert(calendarFeedTable)+ .values({+ projectId,+ labelIds: ids,+ timeZone,+ token: randomBytes(32).toString("hex"),+ })+ .returning();+ return feed;+}++export function listCalendarFeeds(projectId: string) {+ return db+ .select()+ .from(calendarFeedTable)+ .where(eq(calendarFeedTable.projectId, projectId))+ .orderBy(asc(calendarFeedTable.createdAt), asc(calendarFeedTable.id));+}++export async function revokeCalendarFeed(projectId: string, id: string) {+ const [feed] = await db+ .delete(calendarFeedTable)+ .where(+ and(+ eq(calendarFeedTable.projectId, projectId),+ eq(calendarFeedTable.id, id),+ ),+ )+ .returning({ id: calendarFeedTable.id });+ if (!feed)+ throw new HTTPException(404, { message: "Calendar feed not found" });+ return { success: true };+}++export async function getCalendarFeed(token: string) {+ const [record] = await db+ .select({ feed: calendarFeedTable, project: projectTable })+ .from(calendarFeedTable)+ .innerJoin(projectTable, eq(projectTable.id, calendarFeedTable.projectId))+ .where(eq(calendarFeedTable.token, token));+ if (!record)+ throw new HTTPException(404, { message: "Calendar feed not found" });+ const { feed, project } = record;+ // Resolve IDs on every refresh so renaming a label preserves subscriptions.+ // Missing/deleted labels must never broaden a feed to all project tasks.+ const labels = feed.labelIds.length+ ? await db+ .select({ name: labelTable.name })+ .from(labelTable)+ .where(+ and(+ eq(labelTable.workspaceId, project.workspaceId),+ inArray(labelTable.id, feed.labelIds),+ ),+ )+ : [];+ const tasks = labels.length+ ? await db+ .selectDistinct({+ id: taskTable.id,+ title: taskTable.title,+ description: taskTable.description,+ startDate: taskTable.startDate,+ dueDate: taskTable.dueDate,+ createdAt: taskTable.createdAt,+ updatedAt: taskTable.updatedAt,+ })+ .from(taskTable)+ .innerJoin(labelTable, eq(labelTable.taskId, taskTable.id))+ .where(+ and(+ eq(taskTable.projectId, project.id),+ eq(labelTable.workspaceId, project.workspaceId),+ inArray(+ labelTable.name,+ labels.map((label) => label.name),+ ),+ or(isNotNull(taskTable.startDate), isNotNull(taskTable.dueDate)),+ ),+ )+ .orderBy(asc(taskTable.id))+ : [];+ return buildCalendar({ name: project.name, timeZone: feed.timeZone, tasks });+}diff --git a/apps/api/src/database/index.ts b/apps/api/src/database/index.tsindex 487211735..d0dd7c1a2 100644--- a/apps/api/src/database/index.ts+++ b/apps/api/src/database/index.ts@@ -38,6 +38,7 @@ import {apikeyTable,assetTable,billingEventTable,+ calendarFeedTable,columnTable,commentTable,deviceCodeTable,@@ -74,6 +75,7 @@ export const schema = {activityTable,apikeyTable,billingEventTable,+ calendarFeedTable,workspaceBillingTable,columnTable,commentTable,diff --git a/apps/api/src/database/schema.ts b/apps/api/src/database/schema.tsindex 51f591a65..bff689423 100644--- a/apps/api/src/database/schema.ts+++ b/apps/api/src/database/schema.ts@@ -360,6 +360,26 @@ export const workflowRuleTable = pgTable(],);+export const calendarFeedTable = pgTable(+ "calendar_feed",+ {+ id: text("id")+ .$defaultFn(() => createId())+ .primaryKey(),+ projectId: text("project_id")+ .notNull()+ .references(() => projectTable.id, {+ onDelete: "cascade",+ onUpdate: "cascade",+ }),+ token: text("token").notNull().unique(),+ labelIds: jsonb("label_ids").$type<string[]>().notNull(),+ timeZone: text("time_zone").notNull().default("UTC"),+ createdAt: timestamp("created_at", { mode: "date" }).defaultNow().notNull(),+ },+ (table) => [index("calendar_feed_project_id_idx").on(table.projectId)],+);+export const taskTable = pgTable("task",{diff --git a/apps/api/src/index.ts b/apps/api/src/index.tsindex 308df6a85..e3950779b 100644--- a/apps/api/src/index.ts+++ b/apps/api/src/index.ts@@ -21,6 +21,7 @@ import * as v from "valibot";import activity from "./activity";import { auth } from "./auth";import billing from "./billing";+import calendarFeed, { publicCalendarFeed } from "./calendar-feed";import column from "./column";import comment from "./comment";import config from "./config";@@ -245,6 +246,8 @@ export function createApp() {return c.json(project);});+ api.route("/calendar-feed", publicCalendarFeed);+api.post("/github-integration/webhook", handleGithubWebhookRoute);api.post(@@ -554,6 +557,7 @@ export function createApp() {const billingApi = api.route("/billing", billing);const projectApi = api.route("/project", project);+ const calendarFeedApi = api.route("/calendar-feed", calendarFeed);const taskApi = api.route("/task", task);const columnApi = api.route("/column", column);const activityApi = api.route("/activity", activity);@@ -744,6 +748,7 @@ export function createApp() {notificationApi,notificationPreferencesApi,projectApi,+ calendarFeedApi,publicProjectApi,searchApi,slackIntegrationApi,@@ -861,6 +866,7 @@ const {notificationApi,notificationPreferencesApi,projectApi,+ calendarFeedApi,publicProjectApi,searchApi,slackIntegrationApi,@@ -887,6 +893,7 @@ export type AppType =| typeof billingApi| typeof configApi| typeof projectApi+ | typeof calendarFeedApi| typeof taskApi| typeof columnApi| typeof activityApidiff --git a/apps/web/src/components/project/calendar-feed-settings.test.tsx b/apps/web/src/components/project/calendar-feed-settings.test.tsxnew file mode 100644index 000000000..f3b1dec98--- /dev/null+++ b/apps/web/src/components/project/calendar-feed-settings.test.tsx@@ -0,0 +1,174 @@+import { QueryClient, QueryClientProvider } from "@tanstack/react-query";+import {+ cleanup,+ fireEvent,+ render,+ screen,+ waitFor,+} from "@testing-library/react";+import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";+import {+ createCalendarFeed,+ getCalendarFeeds,+ revokeCalendarFeed,+} from "@/fetchers/calendar-feed";+import { toast } from "@/lib/toast";+import { CalendarFeedSettings } from "./calendar-feed-settings";++let canShare = true;+vi.mock("@/lib/i18n", () => ({ i18n: { t: (key: string) => key } }));+vi.mock("react-i18next", () => ({+ useTranslation: () => ({ t: (key: string) => key }),+}));+vi.mock("@/hooks/use-workspace-permission", () => ({+ useWorkspacePermission: () => ({+ workspace: { id: "workspace-1" },+ canShareProjects: () => canShare,+ isCheckingPermissions: false,+ }),+}));+vi.mock("@/hooks/queries/label/use-get-labels-by-workspace", () => ({+ default: () => ({+ data: [+ { id: "task-copy", name: "Release", taskId: "task-1" },+ { id: "release", name: "Release", taskId: null },+ { id: "maintenance", name: "Maintenance", taskId: null },+ ],+ isLoading: false,+ isError: false,+ }),+}));+vi.mock("@/fetchers/calendar-feed", () => ({+ getCalendarFeeds: vi.fn(),+ createCalendarFeed: vi.fn(),+ revokeCalendarFeed: vi.fn(),+ getCalendarFeedUrl: (token: string) =>+ `https://kaneo.example/api/calendar-feed/${token}/calendar.ics`,+}));+vi.mock("@/lib/toast", () => ({ toast: { success: vi.fn(), error: vi.fn() } }));++const feed = {+ id: "feed-1",+ projectId: "project-1",+ token: "secret",+ labelIds: ["release"],+ timeZone: "Europe/Berlin",+ createdAt: "2026-09-23T12:00:00Z",+};+function renderSettings() {+ const client = new QueryClient({+ defaultOptions: { queries: { retry: false }, mutations: { retry: false } },+ });+ return render(+ <QueryClientProvider client={client}>+ <CalendarFeedSettings projectId="project-1" />+ </QueryClientProvider>,+ );+}++describe("CalendarFeedSettings", () => {+ beforeEach(() => {+ vi.clearAllMocks();+ Object.defineProperty(Element.prototype, "getAnimations", {+ configurable: true,+ value: () => [],+ });+ canShare = true;+ vi.mocked(getCalendarFeeds).mockResolvedValue([]);+ vi.mocked(createCalendarFeed).mockResolvedValue(feed);+ vi.mocked(revokeCalendarFeed).mockResolvedValue({ success: true });+ vi.stubGlobal(+ "ResizeObserver",+ class {+ observe() {}+ unobserve() {}+ disconnect() {}+ },+ );+ });+ afterEach(() => {+ cleanup();+ vi.unstubAllGlobals();+ });++ it("creates a feed from multiple labels using definition IDs instead of task copies", async () => {+ renderSettings();+ const create = screen.getByRole("button", {+ name: "settings:calendarFeeds.create",+ });+ expect(create).toBeDisabled();+ const input = screen.getByRole("combobox");+ fireEvent.change(input, { target: { value: "Release" } });+ fireEvent.keyDown(input, { key: "ArrowDown" });+ fireEvent.click(await screen.findByRole("option", { name: "Release" }), {+ detail: 1,+ });+ await waitFor(() => expect(create).not.toBeDisabled());+ fireEvent.change(input, { target: { value: "Maintenance" } });+ fireEvent.keyDown(input, { key: "ArrowDown" });+ fireEvent.click(+ await screen.findByRole("option", { name: "Maintenance" }),+ { detail: 1 },+ );+ fireEvent.keyDown(input, { key: "Escape" });+ fireEvent.click(create);+ await waitFor(() =>+ expect(createCalendarFeed).toHaveBeenCalledWith(+ "project-1",+ ["release", "maintenance"],+ Intl.DateTimeFormat().resolvedOptions().timeZone,+ ),+ );+ await waitFor(() => expect(create).toBeDisabled());+ expect(toast.success).toHaveBeenCalledWith(+ "settings:calendarFeeds.created",+ );+ });++ it("copies a subscription URL and revokes the selected feed", async () => {+ vi.mocked(getCalendarFeeds).mockResolvedValue([feed]);+ const writeText = vi.fn().mockResolvedValue(undefined);+ Object.defineProperty(navigator, "clipboard", {+ configurable: true,+ value: { writeText },+ });+ renderSettings();+ fireEvent.click(+ await screen.findByRole("button", {+ name: "settings:calendarFeeds.copy",+ }),+ );+ await waitFor(() =>+ expect(writeText).toHaveBeenCalledWith(+ "https://kaneo.example/api/calendar-feed/secret/calendar.ics",+ ),+ );+ fireEvent.click(+ screen.getByRole("button", { name: "settings:calendarFeeds.revoke" }),+ );+ await waitFor(() =>+ expect(revokeCalendarFeed).toHaveBeenCalledWith("project-1", "feed-1"),+ );+ });++ it("does not fetch secret links or show controls without sharing permission", () => {+ canShare = false;+ renderSettings();+ expect(+ screen.getByText("settings:calendarFeeds.permissionRequired"),+ ).toBeInTheDocument();+ expect(getCalendarFeeds).not.toHaveBeenCalled();+ expect(screen.queryByRole("combobox")).not.toBeInTheDocument();+ });++ it("reports loading failures without presenting a misleading empty state", async () => {+ vi.mocked(getCalendarFeeds).mockRejectedValue(new Error("Offline"));+ renderSettings();+ expect(await screen.findByRole("alert")).toHaveTextContent(+ "settings:calendarFeeds.loadError",+ );+ expect(+ screen.queryByText("settings:calendarFeeds.empty"),+ ).not.toBeInTheDocument();+ });+});diff --git a/apps/web/src/components/project/calendar-feed-settings.tsx b/apps/web/src/components/project/calendar-feed-settings.tsxnew file mode 100644index 000000000..c70d0e26b--- /dev/null+++ b/apps/web/src/components/project/calendar-feed-settings.tsx@@ -0,0 +1,254 @@+import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";+import { useState } from "react";+import { useTranslation } from "react-i18next";+import { Button } from "@/components/ui/button";+import {+ Combobox,+ ComboboxChip,+ ComboboxChips,+ ComboboxChipsInput,+ ComboboxEmpty,+ ComboboxItem,+ ComboboxList,+ ComboboxPopup,+ ComboboxValue,+} from "@/components/ui/combobox";+import { Input } from "@/components/ui/input";+import { Label } from "@/components/ui/label";+import {+ createCalendarFeed,+ getCalendarFeeds,+ getCalendarFeedUrl,+ revokeCalendarFeed,+} from "@/fetchers/calendar-feed";+import useGetLabelsByWorkspace from "@/hooks/queries/label/use-get-labels-by-workspace";+import { useWorkspacePermission } from "@/hooks/use-workspace-permission";+import { toast } from "@/lib/toast";++type LabelOption = { value: string; label: string };++export function CalendarFeedSettings({ projectId }: { projectId: string }) {+ const { t } = useTranslation();+ const { workspace, canShareProjects, isCheckingPermissions } =+ useWorkspacePermission();+ const canShare = canShareProjects();+ const labelsQuery = useGetLabelsByWorkspace(workspace?.id ?? "");+ const labels = labelsQuery.data ?? [];+ // Labels have separate IDs for the workspace definition and each task copy.+ const byName = new Map<string, (typeof labels)[number]>();+ for (const label of labels) {+ if (!byName.has(label.name) || label.taskId === null)+ byName.set(label.name, label);+ }+ const options = [...byName.values()]+ .map((label) => ({ value: label.id, label: label.name }))+ .sort((a, b) => a.label.localeCompare(b.label));+ const [selected, setSelected] = useState<LabelOption[]>([]);+ const timeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;+ const queryClient = useQueryClient();+ const queryKey = ["calendar-feeds", projectId];+ const feedsQuery = useQuery({+ queryKey,+ queryFn: () => getCalendarFeeds(projectId),+ enabled: canShare,+ });+ const create = useMutation({+ mutationFn: () =>+ createCalendarFeed(+ projectId,+ selected.map((label) => label.value),+ timeZone,+ ),+ onSuccess: async () => {+ setSelected([]);+ await queryClient.invalidateQueries({ queryKey });+ toast.success(t("settings:calendarFeeds.created"));+ },+ onError: () => toast.error(t("settings:calendarFeeds.createError")),+ });+ const revoke = useMutation({+ mutationFn: (id: string) => revokeCalendarFeed(projectId, id),+ onSuccess: async () => {+ await queryClient.invalidateQueries({ queryKey });+ toast.success(t("settings:calendarFeeds.revoked"));+ },+ onError: () => toast.error(t("settings:calendarFeeds.revokeError")),+ });++ if (isCheckingPermissions)+ return (+ <p className="text-sm text-muted-foreground">+ {t("common:empty.loading")}+ </p>+ );+ if (!canShare)+ return (+ <p className="text-sm text-muted-foreground">+ {t("settings:calendarFeeds.permissionRequired")}+ </p>+ );++ return (+ <div className="space-y-6">+ <div className="space-y-4 rounded-xl border border-border p-4">+ <div className="space-y-1">+ <h2 className="text-sm font-medium">+ {t("settings:calendarFeeds.createTitle")}+ </h2>+ <p className="text-xs text-muted-foreground">+ {t("settings:calendarFeeds.filterHint")}+ </p>+ </div>+ <div className="space-y-2">+ <Label htmlFor="calendar-feed-labels">+ {t("settings:calendarFeeds.labels")}+ </Label>+ <Combobox+ items={options}+ multiple+ value={selected}+ onValueChange={setSelected}+ isItemEqualToValue={(item, value) => item.value === value.value}+ disabled={+ create.isPending || labelsQuery.isLoading || labelsQuery.isError+ }+ >+ <ComboboxChips>+ <ComboboxValue>+ {(value: LabelOption[]) => (+ <>+ {value.map((item) => (+ <ComboboxChip aria-label={item.label} key={item.value}>+ {item.label}+ </ComboboxChip>+ ))}+ <ComboboxChipsInput+ id="calendar-feed-labels"+ placeholder={t("settings:calendarFeeds.selectLabels")}+ />+ </>+ )}+ </ComboboxValue>+ </ComboboxChips>+ <ComboboxPopup>+ <ComboboxEmpty>+ {t("settings:calendarFeeds.noLabels")}+ </ComboboxEmpty>+ <ComboboxList>+ {(item: LabelOption) => (+ <ComboboxItem key={item.value} value={item}>+ {item.label}+ </ComboboxItem>+ )}+ </ComboboxList>+ </ComboboxPopup>+ </Combobox>+ {labelsQuery.isError && (+ <p role="alert" className="text-xs text-destructive">+ {t("settings:calendarFeeds.loadError")}+ </p>+ )}+ <p className="text-xs text-muted-foreground">+ {t("settings:calendarFeeds.timeZoneHint", { timeZone })}+ </p>+ </div>+ <p className="text-xs text-muted-foreground">+ {t("settings:calendarFeeds.accessHint")}+ </p>+ <Button+ disabled={+ !selected.length ||+ selected.length > 100 ||+ create.isPending ||+ labelsQuery.isError+ }+ onClick={() => create.mutate()}+ >+ {t(+ create.isPending+ ? "settings:calendarFeeds.creating"+ : "settings:calendarFeeds.create",+ )}+ </Button>+ </div>+ <div className="space-y-3">+ <h2 className="text-sm font-medium">+ {t("settings:calendarFeeds.activeFeeds")}+ </h2>+ <p className="text-xs text-muted-foreground">+ {t("settings:calendarFeeds.subscribeHint")}+ </p>+ {feedsQuery.isLoading && (+ <p className="text-sm text-muted-foreground">+ {t("common:empty.loading")}+ </p>+ )}+ {feedsQuery.isError && (+ <p role="alert" className="text-sm text-destructive">+ {t("settings:calendarFeeds.loadError")}+ </p>+ )}+ {feedsQuery.data?.length === 0 && (+ <p className="text-sm text-muted-foreground">+ {t("settings:calendarFeeds.empty")}+ </p>+ )}+ {feedsQuery.data?.map((feed) => {+ const url = getCalendarFeedUrl(feed.token);+ return (+ <div+ key={feed.id}+ className="space-y-3 rounded-xl border border-border p-4"+ >+ <p className="text-sm font-medium">+ {feed.labelIds+ .map(+ (id) =>+ labels.find((label) => label.id === id)?.name ??+ t("settings:calendarFeeds.deletedLabel"),+ )+ .join(", ")}+ </p>+ <div className="flex flex-col gap-2 sm:flex-row">+ <Input+ aria-label={t("settings:calendarFeeds.feedUrl")}+ readOnly+ value={url}+ className="min-w-0 flex-1"+ onFocus={(event) => event.target.select()}+ />+ <div className="flex gap-2">+ <Button+ variant="outline"+ onClick={async () => {+ try {+ await navigator.clipboard.writeText(url);+ toast.success(t("settings:calendarFeeds.copied"));+ } catch {+ toast.error(t("settings:calendarFeeds.copyError"));+ }+ }}+ >+ {t("settings:calendarFeeds.copy")}+ </Button>+ <Button+ variant="destructive"+ disabled={revoke.isPending}+ onClick={() => revoke.mutate(feed.id)}+ >+ {t("settings:calendarFeeds.revoke")}+ </Button>+ </div>+ </div>+ <p className="text-xs text-muted-foreground">+ {t("settings:calendarFeeds.timeZoneHint", {+ timeZone: feed.timeZone,+ })}+ </p>+ </div>+ );+ })}+ </div>+ </div>+ );+}diff --git a/apps/web/src/fetchers/calendar-feed.ts b/apps/web/src/fetchers/calendar-feed.tsnew file mode 100644index 000000000..d7b400f9e--- /dev/null+++ b/apps/web/src/fetchers/calendar-feed.ts@@ -0,0 +1,36 @@+import { client } from "@kaneo/libs";+import { getApiUrl } from "./get-api-url";++const endpoint = client["calendar-feed"].project[":projectId"];++export async function getCalendarFeeds(projectId: string) {+ const response = await endpoint.$get({ param: { projectId } });+ if (!response.ok) throw new Error(await response.text());+ return response.json();+}++export async function createCalendarFeed(+ projectId: string,+ labelIds: string[],+ timeZone: string,+) {+ const response = await endpoint.$post({+ param: { projectId },+ json: { labelIds, timeZone },+ });+ if (!response.ok) throw new Error(await response.text());+ return response.json();+}++export async function revokeCalendarFeed(projectId: string, id: string) {+ const response = await endpoint[":id"].$delete({ param: { projectId, id } });+ if (!response.ok) throw new Error(await response.text());+ return response.json();+}++export function getCalendarFeedUrl(token: string) {+ return new URL(+ getApiUrl(`/calendar-feed/${encodeURIComponent(token)}/calendar.ics`),+ window.location.origin,+ ).href;+}diff --git a/apps/web/src/hooks/use-workspace-permission.ts b/apps/web/src/hooks/use-workspace-permission.tsindex 5ace854d8..146ca619f 100644--- a/apps/web/src/hooks/use-workspace-permission.ts+++ b/apps/web/src/hooks/use-workspace-permission.ts@@ -16,6 +16,7 @@ const CAPABILITIES = {manageProjects: { project: ["create", "update", "delete"] },createProjects: { project: ["create"] },updateProjects: { project: ["update"] },+ shareProjects: { project: ["share"] },deleteProjects: { project: ["delete"] },manageTasks: { task: ["create", "update", "delete"] },createTasks: { task: ["create"] },@@ -91,6 +92,7 @@ export function useWorkspacePermission() {canManageProjects: () => can.manageProjects,canCreateProjects: () => can.createProjects,canUpdateProjects: () => can.updateProjects,+ canShareProjects: () => can.shareProjects,canDeleteProjects: () => can.deleteProjects,canManageTasks: () => can.manageTasks,canCreateTasks: () => can.createTasks,diff --git a/apps/web/src/routeTree.gen.ts b/apps/web/src/routeTree.gen.tsindex b81d097d3..2b07fb042 100644--- a/apps/web/src/routeTree.gen.ts+++ b/apps/web/src/routeTree.gen.ts@@ -47,6 +47,7 @@ import { Route as LayoutAuthenticatedDashboardSettingsWorkspaceRolesRouteImportimport { Route as LayoutAuthenticatedDashboardWorkspaceWorkspaceIdIndexRouteImport } from './routes/_layout/_authenticated/dashboard/workspace/$workspaceId/index'import { Route as LayoutAuthenticatedDashboardWorkspaceWorkspaceIdMembersRouteImport } from './routes/_layout/_authenticated/dashboard/workspace/$workspaceId/members'import { Route as LayoutAuthenticatedDashboardWorkspaceWorkspaceIdSearchRouteImport } from './routes/_layout/_authenticated/dashboard/workspace/$workspaceId/search'+import { Route as LayoutAuthenticatedDashboardSettingsProjectsProjectIdCalendarRouteImport } from './routes/_layout/_authenticated/dashboard/settings/projects/$projectId/calendar'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'@@ -269,6 +270,14 @@ const LayoutAuthenticatedDashboardWorkspaceWorkspaceIdSearchRoute =path: '/search',getParentRoute: () => LayoutAuthenticatedDashboardWorkspaceWorkspaceIdRoute,} as any)+const LayoutAuthenticatedDashboardSettingsProjectsProjectIdCalendarRoute =+ LayoutAuthenticatedDashboardSettingsProjectsProjectIdCalendarRouteImport.update(+ {+ id: '/$projectId/calendar',+ path: '/$projectId/calendar',+ getParentRoute: () => LayoutAuthenticatedDashboardSettingsProjectsRoute,+ } as any,+ )const LayoutAuthenticatedDashboardSettingsProjectsProjectIdGeneralRoute =LayoutAuthenticatedDashboardSettingsProjectsProjectIdGeneralRouteImport.update({@@ -384,6 +393,7 @@ export interface FileRoutesByFullPath {'/dashboard/workspace/$workspaceId/members': typeof LayoutAuthenticatedDashboardWorkspaceWorkspaceIdMembersRoute'/dashboard/workspace/$workspaceId/search': typeof LayoutAuthenticatedDashboardWorkspaceWorkspaceIdSearchRoute'/dashboard/workspace/$workspaceId/': typeof LayoutAuthenticatedDashboardWorkspaceWorkspaceIdIndexRoute+ '/dashboard/settings/projects/$projectId/calendar': typeof LayoutAuthenticatedDashboardSettingsProjectsProjectIdCalendarRoute'/dashboard/settings/projects/$projectId/general': typeof LayoutAuthenticatedDashboardSettingsProjectsProjectIdGeneralRoute'/dashboard/settings/projects/$projectId/integrations': typeof LayoutAuthenticatedDashboardSettingsProjectsProjectIdIntegrationsRoute'/dashboard/settings/projects/$projectId/visibility': typeof LayoutAuthenticatedDashboardSettingsProjectsProjectIdVisibilityRoute@@ -428,6 +438,7 @@ export interface FileRoutesByTo {'/dashboard/workspace/$workspaceId/members': typeof LayoutAuthenticatedDashboardWorkspaceWorkspaceIdMembersRoute'/dashboard/workspace/$workspaceId/search': typeof LayoutAuthenticatedDashboardWorkspaceWorkspaceIdSearchRoute'/dashboard/workspace/$workspaceId': typeof LayoutAuthenticatedDashboardWorkspaceWorkspaceIdIndexRoute+ '/dashboard/settings/projects/$projectId/calendar': typeof LayoutAuthenticatedDashboardSettingsProjectsProjectIdCalendarRoute'/dashboard/settings/projects/$projectId/general': typeof LayoutAuthenticatedDashboardSettingsProjectsProjectIdGeneralRoute'/dashboard/settings/projects/$projectId/integrations': typeof LayoutAuthenticatedDashboardSettingsProjectsProjectIdIntegrationsRoute'/dashboard/settings/projects/$projectId/visibility': typeof LayoutAuthenticatedDashboardSettingsProjectsProjectIdVisibilityRoute@@ -478,6 +489,7 @@ export interface FileRoutesById {'/_layout/_authenticated/dashboard/workspace/$workspaceId/members': typeof LayoutAuthenticatedDashboardWorkspaceWorkspaceIdMembersRoute'/_layout/_authenticated/dashboard/workspace/$workspaceId/search': typeof LayoutAuthenticatedDashboardWorkspaceWorkspaceIdSearchRoute'/_layout/_authenticated/dashboard/workspace/$workspaceId/': typeof LayoutAuthenticatedDashboardWorkspaceWorkspaceIdIndexRoute+ '/_layout/_authenticated/dashboard/settings/projects/$projectId/calendar': typeof LayoutAuthenticatedDashboardSettingsProjectsProjectIdCalendarRoute'/_layout/_authenticated/dashboard/settings/projects/$projectId/general': typeof LayoutAuthenticatedDashboardSettingsProjectsProjectIdGeneralRoute'/_layout/_authenticated/dashboard/settings/projects/$projectId/integrations': typeof LayoutAuthenticatedDashboardSettingsProjectsProjectIdIntegrationsRoute'/_layout/_authenticated/dashboard/settings/projects/$projectId/visibility': typeof LayoutAuthenticatedDashboardSettingsProjectsProjectIdVisibilityRoute@@ -527,6 +539,7 @@ export interface FileRouteTypes {| '/dashboard/workspace/$workspaceId/members'| '/dashboard/workspace/$workspaceId/search'| '/dashboard/workspace/$workspaceId/'+ | '/dashboard/settings/projects/$projectId/calendar'| '/dashboard/settings/projects/$projectId/general'| '/dashboard/settings/projects/$projectId/integrations'| '/dashboard/settings/projects/$projectId/visibility'@@ -571,6 +584,7 @@ export interface FileRouteTypes {| '/dashboard/workspace/$workspaceId/members'| '/dashboard/workspace/$workspaceId/search'| '/dashboard/workspace/$workspaceId'+ | '/dashboard/settings/projects/$projectId/calendar'| '/dashboard/settings/projects/$projectId/general'| '/dashboard/settings/projects/$projectId/integrations'| '/dashboard/settings/projects/$projectId/visibility'@@ -620,6 +634,7 @@ export interface FileRouteTypes {| '/_layout/_authenticated/dashboard/workspace/$workspaceId/members'| '/_layout/_authenticated/dashboard/workspace/$workspaceId/search'| '/_layout/_authenticated/dashboard/workspace/$workspaceId/'+ | '/_layout/_authenticated/dashboard/settings/projects/$projectId/calendar'| '/_layout/_authenticated/dashboard/settings/projects/$projectId/general'| '/_layout/_authenticated/dashboard/settings/projects/$projectId/integrations'| '/_layout/_authenticated/dashboard/settings/projects/$projectId/visibility'@@ -910,6 +925,13 @@ declare module '@tanstack/react-router' {preLoaderRoute: typeof LayoutAuthenticatedDashboardWorkspaceWorkspaceIdSearchRouteImportparentRoute: typeof LayoutAuthenticatedDashboardWorkspaceWorkspaceIdRoute}+ '/_layout/_authenticated/dashboard/settings/projects/$projectId/calendar': {+ id: '/_layout/_authenticated/dashboard/settings/projects/$projectId/calendar'+ path: '/$projectId/calendar'+ fullPath: '/dashboard/settings/projects/$projectId/calendar'+ preLoaderRoute: typeof LayoutAuthenticatedDashboardSettingsProjectsProjectIdCalendarRouteImport+ parentRoute: typeof LayoutAuthenticatedDashboardSettingsProjectsRoute+ }'/_layout/_authenticated/dashboard/settings/projects/$projectId/general': {id: '/_layout/_authenticated/dashboard/settings/projects/$projectId/general'path: '/$projectId/general'@@ -1001,6 +1023,7 @@ const LayoutAuthenticatedDashboardSettingsAccountRouteWithChildren =)interface LayoutAuthenticatedDashboardSettingsProjectsRouteChildren {+ LayoutAuthenticatedDashboardSettingsProjectsProjectIdCalendarRoute: typeof LayoutAuthenticatedDashboardSettingsProjectsProjectIdCalendarRouteLayoutAuthenticatedDashboardSettingsProjectsProjectIdGeneralRoute: typeof LayoutAuthenticatedDashboardSettingsProjectsProjectIdGeneralRouteLayoutAuthenticatedDashboardSettingsProjectsProjectIdIntegrationsRoute: typeof LayoutAuthenticatedDashboardSettingsProjectsProjectIdIntegrationsRouteLayoutAuthenticatedDashboardSettingsProjectsProjectIdVisibilityRoute: typeof LayoutAuthenticatedDashboardSettingsProjectsProjectIdVisibilityRoute@@ -1009,6 +1032,8 @@ interface LayoutAuthenticatedDashboardSettingsProjectsRouteChildren {const LayoutAuthenticatedDashboardSettingsProjectsRouteChildren: LayoutAuthenticatedDashboardSettingsProjectsRouteChildren ={+ LayoutAuthenticatedDashboardSettingsProjectsProjectIdCalendarRoute:+ LayoutAuthenticatedDashboardSettingsProjectsProjectIdCalendarRoute,LayoutAuthenticatedDashboardSettingsProjectsProjectIdGeneralRoute:LayoutAuthenticatedDashboardSettingsProjectsProjectIdGeneralRoute,LayoutAuthenticatedDashboardSettingsProjectsProjectIdIntegrationsRoute:diff --git a/apps/web/src/routes/_layout/_authenticated/dashboard/settings/projects.tsx b/apps/web/src/routes/_layout/_authenticated/dashboard/settings/projects.tsxindex 3dea561bc..78cf4f23b 100644--- a/apps/web/src/routes/_layout/_authenticated/dashboard/settings/projects.tsx+++ b/apps/web/src/routes/_layout/_authenticated/dashboard/settings/projects.tsx@@ -5,7 +5,7 @@ import {useLocation,useNavigate,} from "@tanstack/react-router";-import { Eye, GitBranch, Plug, Settings } from "lucide-react";+import { CalendarDays, Eye, GitBranch, Plug, Settings } from "lucide-react";import { useEffect } from "react";import { useTranslation } from "react-i18next";import SettingsSidebar from "@/components/SettingsSidebar";@@ -51,6 +51,11 @@ function RouteComponent() {icon: Eye,segment: "visibility",},+ {+ title: t("settings:calendarFeeds.title"),+ icon: CalendarDays,+ segment: "calendar",+ },{title: t("settings:projectIntegrations.title"),icon: Plug,diff --git a/apps/web/src/routes/_layout/_authenticated/dashboard/settings/projects/$projectId/calendar.tsx b/apps/web/src/routes/_layout/_authenticated/dashboard/settings/projects/$projectId/calendar.tsxnew file mode 100644index 000000000..5a4735390--- /dev/null+++ b/apps/web/src/routes/_layout/_authenticated/dashboard/settings/projects/$projectId/calendar.tsx@@ -0,0 +1,29 @@+import { createFileRoute } from "@tanstack/react-router";+import { useTranslation } from "react-i18next";+import PageTitle from "@/components/page-title";+import { CalendarFeedSettings } from "@/components/project/calendar-feed-settings";++export const Route = createFileRoute(+ "/_layout/_authenticated/dashboard/settings/projects/$projectId/calendar",+)({ component: CalendarSettings });++function CalendarSettings() {+ const { t } = useTranslation();+ const { projectId } = Route.useParams();+ return (+ <>+ <PageTitle title={t("settings:calendarFeeds.title")} />+ <div className="max-w-4xl mx-auto space-y-8">+ <div className="space-y-2">+ <h1 className="text-2xl font-semibold">+ {t("settings:calendarFeeds.title")}+ </h1>+ <p className="text-muted-foreground">+ {t("settings:calendarFeeds.subtitle")}+ </p>+ </div>+ <CalendarFeedSettings key={projectId} projectId={projectId} />+ </div>+ </>+ );+}diff --git a/i18n/de-DE.json b/i18n/de-DE.jsonindex e83136d52..85de30de2 100644--- a/i18n/de-DE.json+++ b/i18n/de-DE.json@@ -1223,6 +1223,34 @@"updateError": "Label konnte nicht aktualisiert werden","deleteError": "Label konnte nicht gelöscht werden","nameRequired": "Label-Name ist erforderlich"+ },+ "calendarFeeds": {+ "title": "Kalender-Feeds",+ "subtitle": "Abonniere geplante Projektaufgaben in deiner Kalender-App.",+ "createTitle": "Kalender-Feed erstellen",+ "filterHint": "Enthält Aufgaben mit einem Start- oder Fälligkeitsdatum und mindestens einem der ausgewählten Labels.",+ "labels": "Labels",+ "selectLabels": "Labels suchen und auswählen…",+ "noLabels": "Keine Labels gefunden.",+ "timeZoneHint": "Ganztägige Termine verwenden {{timeZone}}.",+ "accessHint": "Jeder mit einem Feed-Link kann die Titel, Beschreibungen und Termine der passenden Aufgaben lesen. Widerrufe einen Link, um den künftigen Zugriff zu beenden.",+ "create": "Feed erstellen",+ "creating": "Wird erstellt…",+ "created": "Kalender-Feed erstellt.",+ "createError": "Kalender-Feed konnte nicht erstellt werden.",+ "activeFeeds": "Aktive Feeds",+ "subscribeHint": "Kopiere einen Link und füge ihn als Kalenderabonnement hinzu. Änderungen erscheinen, sobald deine Kalender-App den Feed aktualisiert.",+ "empty": "Noch keine Kalender-Feeds.",+ "feedUrl": "Kalender-Feed-URL",+ "copy": "Link kopieren",+ "copied": "Kalender-Feed-Link kopiert.",+ "copyError": "Link konnte nicht kopiert werden. Wähle die URL aus und kopiere sie manuell.",+ "revoke": "Widerrufen",+ "revoked": "Kalender-Feed widerrufen.",+ "revokeError": "Kalender-Feed konnte nicht widerrufen werden.",+ "loadError": "Kalender-Feeds oder Labels konnten nicht geladen werden. Bitte versuche es erneut.",+ "deletedLabel": "Gelöschtes Label",+ "permissionRequired": "Du benötigst die Berechtigung zum Teilen von Projekten, um Kalender-Feeds zu verwalten."}},"navigation": {diff --git a/i18n/el-GR.json b/i18n/el-GR.jsonindex 4bac9ec62..a74184ccb 100644--- a/i18n/el-GR.json+++ b/i18n/el-GR.json@@ -1223,6 +1223,34 @@"updateError": "Αποτυχία ενημέρωσης ετικέτας","deleteError": "Αποτυχία διαγραφής ετικέτας","nameRequired": "Το όνομα ετικέτας είναι υποχρεωτικό"+ },+ "calendarFeeds": {+ "title": "Calendar feeds",+ "subtitle": "Subscribe to scheduled project tasks in your calendar app.",+ "createTitle": "Create a calendar feed",+ "filterHint": "Include tasks with a start or due date and at least one of the selected labels.",+ "labels": "Labels",+ "selectLabels": "Search and select labels…",+ "noLabels": "No labels found.",+ "timeZoneHint": "All-day dates use {{timeZone}}.",+ "accessHint": "Anyone with a feed link can read the matching task titles, descriptions, and dates. Revoke a link to stop future access.",+ "create": "Create feed",+ "creating": "Creating…",+ "created": "Calendar feed created.",+ "createError": "Could not create the calendar feed.",+ "activeFeeds": "Active feeds",+ "subscribeHint": "Copy a link and add it as a calendar subscription. Updates appear when your calendar app refreshes the feed.",+ "empty": "No calendar feeds yet.",+ "feedUrl": "Calendar feed URL",+ "copy": "Copy link",+ "copied": "Calendar feed link copied.",+ "copyError": "Could not copy the link. Select the URL and copy it manually.",+ "revoke": "Revoke",+ "revoked": "Calendar feed revoked.",+ "revokeError": "Could not revoke the calendar feed.",+ "loadError": "Could not load calendar feeds or labels. Please try again.",+ "deletedLabel": "Deleted label",+ "permissionRequired": "You need project-sharing permission to manage calendar feeds."}},"navigation": {diff --git a/i18n/en-US.json b/i18n/en-US.jsonindex eadd54aff..f5fc73bcc 100644--- a/i18n/en-US.json+++ b/i18n/en-US.json@@ -1223,6 +1223,34 @@"merged": "Merged","draft": "Draft","open": "Open"+ },+ "calendarFeeds": {+ "title": "Calendar feeds",+ "subtitle": "Subscribe to scheduled project tasks in your calendar app.",+ "createTitle": "Create a calendar feed",+ "filterHint": "Include tasks with a start or due date and at least one of the selected labels.",+ "labels": "Labels",+ "selectLabels": "Search and select labels…",+ "noLabels": "No labels found.",+ "timeZoneHint": "All-day dates use {{timeZone}}.",+ "accessHint": "Anyone with a feed link can read the matching task titles, descriptions, and dates. Revoke a link to stop future access.",+ "create": "Create feed",+ "creating": "Creating…",+ "created": "Calendar feed created.",+ "createError": "Could not create the calendar feed.",+ "activeFeeds": "Active feeds",+ "subscribeHint": "Copy a link and add it as a calendar subscription. Updates appear when your calendar app refreshes the feed.",+ "empty": "No calendar feeds yet.",+ "feedUrl": "Calendar feed URL",+ "copy": "Copy link",+ "copied": "Calendar feed link copied.",+ "copyError": "Could not copy the link. Select the URL and copy it manually.",+ "revoke": "Revoke",+ "revoked": "Calendar feed revoked.",+ "revokeError": "Could not revoke the calendar feed.",+ "loadError": "Could not load calendar feeds or labels. Please try again.",+ "deletedLabel": "Deleted label",+ "permissionRequired": "You need project-sharing permission to manage calendar feeds."}},"navigation": {diff --git a/i18n/es-ES.json b/i18n/es-ES.jsonindex 56afed379..e32a12648 100644--- a/i18n/es-ES.json+++ b/i18n/es-ES.json@@ -1223,6 +1223,34 @@"connect": "Conectar Telegram","saveChanges": "Guardar cambios","disconnect": "Desconectar"+ },+ "calendarFeeds": {+ "title": "Calendar feeds",+ "subtitle": "Subscribe to scheduled project tasks in your calendar app.",+ "createTitle": "Create a calendar feed",+ "filterHint": "Include tasks with a start or due date and at least one of the selected labels.",+ "labels": "Labels",+ "selectLabels": "Search and select labels…",+ "noLabels": "No labels found.",+ "timeZoneHint": "All-day dates use {{timeZone}}.",+ "accessHint": "Anyone with a feed link can read the matching task titles, descriptions, and dates. Revoke a link to stop future access.",+ "create": "Create feed",+ "creating": "Creating…",+ "created": "Calendar feed created.",+ "createError": "Could not create the calendar feed.",+ "activeFeeds": "Active feeds",+ "subscribeHint": "Copy a link and add it as a calendar subscription. Updates appear when your calendar app refreshes the feed.",+ "empty": "No calendar feeds yet.",+ "feedUrl": "Calendar feed URL",+ "copy": "Copy link",+ "copied": "Calendar feed link copied.",+ "copyError": "Could not copy the link. Select the URL and copy it manually.",+ "revoke": "Revoke",+ "revoked": "Calendar feed revoked.",+ "revokeError": "Could not revoke the calendar feed.",+ "loadError": "Could not load calendar feeds or labels. Please try again.",+ "deletedLabel": "Deleted label",+ "permissionRequired": "You need project-sharing permission to manage calendar feeds."}},"navigation": {diff --git a/i18n/fr-FR.json b/i18n/fr-FR.jsonindex 6ec21ae9c..351d1c241 100644--- a/i18n/fr-FR.json+++ b/i18n/fr-FR.json@@ -1223,6 +1223,34 @@"updateError": "Échec de la mise à jour du label","deleteError": "Échec de la suppression du label","nameRequired": "Le nom du label est requis"+ },+ "calendarFeeds": {+ "title": "Calendar feeds",+ "subtitle": "Subscribe to scheduled project tasks in your calendar app.",+ "createTitle": "Create a calendar feed",+ "filterHint": "Include tasks with a start or due date and at least one of the selected labels.",+ "labels": "Labels",+ "selectLabels": "Search and select labels…",+ "noLabels": "No labels found.",+ "timeZoneHint": "All-day dates use {{timeZone}}.",+ "accessHint": "Anyone with a feed link can read the matching task titles, descriptions, and dates. Revoke a link to stop future access.",+ "create": "Create feed",+ "creating": "Creating…",+ "created": "Calendar feed created.",+ "createError": "Could not create the calendar feed.",+ "activeFeeds": "Active feeds",+ "subscribeHint": "Copy a link and add it as a calendar subscription. Updates appear when your calendar app refreshes the feed.",+ "empty": "No calendar feeds yet.",+ "feedUrl": "Calendar feed URL",+ "copy": "Copy link",+ "copied": "Calendar feed link copied.",+ "copyError": "Could not copy the link. Select the URL and copy it manually.",+ "revoke": "Revoke",+ "revoked": "Calendar feed revoked.",+ "revokeError": "Could not revoke the calendar feed.",+ "loadError": "Could not load calendar feeds or labels. Please try again.",+ "deletedLabel": "Deleted label",+ "permissionRequired": "You need project-sharing permission to manage calendar feeds."}},"navigation": {diff --git a/i18n/hi-IN.json b/i18n/hi-IN.jsonindex f79d29b1f..7f441045e 100644--- a/i18n/hi-IN.json+++ b/i18n/hi-IN.json@@ -1223,6 +1223,34 @@"merged": "मर्ज किया","draft": "ड्राफ़्ट","open": "खुला"+ },+ "calendarFeeds": {+ "title": "Calendar feeds",+ "subtitle": "Subscribe to scheduled project tasks in your calendar app.",+ "createTitle": "Create a calendar feed",+ "filterHint": "Include tasks with a start or due date and at least one of the selected labels.",+ "labels": "Labels",+ "selectLabels": "Search and select labels…",+ "noLabels": "No labels found.",+ "timeZoneHint": "All-day dates use {{timeZone}}.",+ "accessHint": "Anyone with a feed link can read the matching task titles, descriptions, and dates. Revoke a link to stop future access.",+ "create": "Create feed",+ "creating": "Creating…",+ "created": "Calendar feed created.",+ "createError": "Could not create the calendar feed.",+ "activeFeeds": "Active feeds",+ "subscribeHint": "Copy a link and add it as a calendar subscription. Updates appear when your calendar app refreshes the feed.",+ "empty": "No calendar feeds yet.",+ "feedUrl": "Calendar feed URL",+ "copy": "Copy link",+ "copied": "Calendar feed link copied.",+ "copyError": "Could not copy the link. Select the URL and copy it manually.",+ "revoke": "Revoke",+ "revoked": "Calendar feed revoked.",+ "revokeError": "Could not revoke the calendar feed.",+ "loadError": "Could not load calendar feeds or labels. Please try again.",+ "deletedLabel": "Deleted label",+ "permissionRequired": "You need project-sharing permission to manage calendar feeds."}},"navigation": {diff --git a/i18n/id-ID.json b/i18n/id-ID.jsonindex 65b08ef39..1b3c707bb 100644--- a/i18n/id-ID.json+++ b/i18n/id-ID.json@@ -1223,6 +1223,34 @@"updateError": "Gagal memperbarui label","deleteError": "Gagal menghapus label","nameRequired": "Nama label wajib diisi"+ },+ "calendarFeeds": {+ "title": "Calendar feeds",+ "subtitle": "Subscribe to scheduled project tasks in your calendar app.",+ "createTitle": "Create a calendar feed",+ "filterHint": "Include tasks with a start or due date and at least one of the selected labels.",+ "labels": "Labels",+ "selectLabels": "Search and select labels…",+ "noLabels": "No labels found.",+ "timeZoneHint": "All-day dates use {{timeZone}}.",+ "accessHint": "Anyone with a feed link can read the matching task titles, descriptions, and dates. Revoke a link to stop future access.",+ "create": "Create feed",+ "creating": "Creating…",+ "created": "Calendar feed created.",+ "createError": "Could not create the calendar feed.",+ "activeFeeds": "Active feeds",+ "subscribeHint": "Copy a link and add it as a calendar subscription. Updates appear when your calendar app refreshes the feed.",+ "empty": "No calendar feeds yet.",+ "feedUrl": "Calendar feed URL",+ "copy": "Copy link",+ "copied": "Calendar feed link copied.",+ "copyError": "Could not copy the link. Select the URL and copy it manually.",+ "revoke": "Revoke",+ "revoked": "Calendar feed revoked.",+ "revokeError": "Could not revoke the calendar feed.",+ "loadError": "Could not load calendar feeds or labels. Please try again.",+ "deletedLabel": "Deleted label",+ "permissionRequired": "You need project-sharing permission to manage calendar feeds."}},"navigation": {diff --git a/i18n/it-IT.json b/i18n/it-IT.jsonindex b3b9d2631..af6023b89 100644--- a/i18n/it-IT.json+++ b/i18n/it-IT.json@@ -1223,6 +1223,34 @@"merged": "Unito","draft": "Bozza","open": "Aperto"+ },+ "calendarFeeds": {+ "title": "Calendar feeds",+ "subtitle": "Subscribe to scheduled project tasks in your calendar app.",+ "createTitle": "Create a calendar feed",+ "filterHint": "Include tasks with a start or due date and at least one of the selected labels.",+ "labels": "Labels",+ "selectLabels": "Search and select labels…",+ "noLabels": "No labels found.",+ "timeZoneHint": "All-day dates use {{timeZone}}.",+ "accessHint": "Anyone with a feed link can read the matching task titles, descriptions, and dates. Revoke a link to stop future access.",+ "create": "Create feed",+ "creating": "Creating…",+ "created": "Calendar feed created.",+ "createError": "Could not create the calendar feed.",+ "activeFeeds": "Active feeds",+ "subscribeHint": "Copy a link and add it as a calendar subscription. Updates appear when your calendar app refreshes the feed.",+ "empty": "No calendar feeds yet.",+ "feedUrl": "Calendar feed URL",+ "copy": "Copy link",+ "copied": "Calendar feed link copied.",+ "copyError": "Could not copy the link. Select the URL and copy it manually.",+ "revoke": "Revoke",+ "revoked": "Calendar feed revoked.",+ "revokeError": "Could not revoke the calendar feed.",+ "loadError": "Could not load calendar feeds or labels. Please try again.",+ "deletedLabel": "Deleted label",+ "permissionRequired": "You need project-sharing permission to manage calendar feeds."}},"navigation": {diff --git a/i18n/ko-KR.json b/i18n/ko-KR.jsonindex 8c0c17aad..c65545d2a 100644--- a/i18n/ko-KR.json+++ b/i18n/ko-KR.json@@ -1223,6 +1223,34 @@"updateError": "라벨 업데이트에 실패했습니다","deleteError": "라벨 삭제에 실패했습니다","nameRequired": "라벨 이름은 필수입니다"+ },+ "calendarFeeds": {+ "title": "Calendar feeds",+ "subtitle": "Subscribe to scheduled project tasks in your calendar app.",+ "createTitle": "Create a calendar feed",+ "filterHint": "Include tasks with a start or due date and at least one of the selected labels.",+ "labels": "Labels",+ "selectLabels": "Search and select labels…",+ "noLabels": "No labels found.",+ "timeZoneHint": "All-day dates use {{timeZone}}.",+ "accessHint": "Anyone with a feed link can read the matching task titles, descriptions, and dates. Revoke a link to stop future access.",+ "create": "Create feed",+ "creating": "Creating…",+ "created": "Calendar feed created.",+ "createError": "Could not create the calendar feed.",+ "activeFeeds": "Active feeds",+ "subscribeHint": "Copy a link and add it as a calendar subscription. Updates appear when your calendar app refreshes the feed.",+ "empty": "No calendar feeds yet.",+ "feedUrl": "Calendar feed URL",+ "copy": "Copy link",+ "copied": "Calendar feed link copied.",+ "copyError": "Could not copy the link. Select the URL and copy it manually.",+ "revoke": "Revoke",+ "revoked": "Calendar feed revoked.",+ "revokeError": "Could not revoke the calendar feed.",+ "loadError": "Could not load calendar feeds or labels. Please try again.",+ "deletedLabel": "Deleted label",+ "permissionRequired": "You need project-sharing permission to manage calendar feeds."}},"navigation": {diff --git a/i18n/mk-MK.json b/i18n/mk-MK.jsonindex 718ae47a9..6a46bca55 100644--- a/i18n/mk-MK.json+++ b/i18n/mk-MK.json@@ -1223,6 +1223,34 @@"updateError": "Неуспешно ажурирање на ознака","deleteError": "Неуспешно бришење на ознака","nameRequired": "Името на ознаката е задолжително"+ },+ "calendarFeeds": {+ "title": "Calendar feeds",+ "subtitle": "Subscribe to scheduled project tasks in your calendar app.",+ "createTitle": "Create a calendar feed",+ "filterHint": "Include tasks with a start or due date and at least one of the selected labels.",+ "labels": "Labels",+ "selectLabels": "Search and select labels…",+ "noLabels": "No labels found.",+ "timeZoneHint": "All-day dates use {{timeZone}}.",+ "accessHint": "Anyone with a feed link can read the matching task titles, descriptions, and dates. Revoke a link to stop future access.",+ "create": "Create feed",+ "creating": "Creating…",+ "created": "Calendar feed created.",+ "createError": "Could not create the calendar feed.",+ "activeFeeds": "Active feeds",+ "subscribeHint": "Copy a link and add it as a calendar subscription. Updates appear when your calendar app refreshes the feed.",+ "empty": "No calendar feeds yet.",+ "feedUrl": "Calendar feed URL",+ "copy": "Copy link",+ "copied": "Calendar feed link copied.",+ "copyError": "Could not copy the link. Select the URL and copy it manually.",+ "revoke": "Revoke",+ "revoked": "Calendar feed revoked.",+ "revokeError": "Could not revoke the calendar feed.",+ "loadError": "Could not load calendar feeds or labels. Please try again.",+ "deletedLabel": "Deleted label",+ "permissionRequired": "You need project-sharing permission to manage calendar feeds."}},"navigation": {diff --git a/i18n/nl-NL.json b/i18n/nl-NL.jsonindex 47b72e0bb..e96dddac0 100644--- a/i18n/nl-NL.json+++ b/i18n/nl-NL.json@@ -1223,6 +1223,34 @@"connect": "Verbind Telegram","saveChanges": "Wijzigingen opslaan","disconnect": "Ontkoppelen"+ },+ "calendarFeeds": {+ "title": "Calendar feeds",+ "subtitle": "Subscribe to scheduled project tasks in your calendar app.",+ "createTitle": "Create a calendar feed",+ "filterHint": "Include tasks with a start or due date and at least one of the selected labels.",+ "labels": "Labels",+ "selectLabels": "Search and select labels…",+ "noLabels": "No labels found.",+ "timeZoneHint": "All-day dates use {{timeZone}}.",+ "accessHint": "Anyone with a feed link can read the matching task titles, descriptions, and dates. Revoke a link to stop future access.",+ "create": "Create feed",+ "creating": "Creating…",+ "created": "Calendar feed created.",+ "createError": "Could not create the calendar feed.",+ "activeFeeds": "Active feeds",+ "subscribeHint": "Copy a link and add it as a calendar subscription. Updates appear when your calendar app refreshes the feed.",+ "empty": "No calendar feeds yet.",+ "feedUrl": "Calendar feed URL",+ "copy": "Copy link",+ "copied": "Calendar feed link copied.",+ "copyError": "Could not copy the link. Select the URL and copy it manually.",+ "revoke": "Revoke",+ "revoked": "Calendar feed revoked.",+ "revokeError": "Could not revoke the calendar feed.",+ "loadError": "Could not load calendar feeds or labels. Please try again.",+ "deletedLabel": "Deleted label",+ "permissionRequired": "You need project-sharing permission to manage calendar feeds."}},"navigation": {diff --git a/i18n/pt-BR.json b/i18n/pt-BR.jsonindex 6d1e50082..e43df9124 100644--- a/i18n/pt-BR.json+++ b/i18n/pt-BR.json@@ -1223,6 +1223,34 @@"merged": "Mesclado","draft": "Rascunho","open": "Aberto"+ },+ "calendarFeeds": {+ "title": "Calendar feeds",+ "subtitle": "Subscribe to scheduled project tasks in your calendar app.",+ "createTitle": "Create a calendar feed",+ "filterHint": "Include tasks with a start or due date and at least one of the selected labels.",+ "labels": "Labels",+ "selectLabels": "Search and select labels…",+ "noLabels": "No labels found.",+ "timeZoneHint": "All-day dates use {{timeZone}}.",+ "accessHint": "Anyone with a feed link can read the matching task titles, descriptions, and dates. Revoke a link to stop future access.",+ "create": "Create feed",+ "creating": "Creating…",+ "created": "Calendar feed created.",+ "createError": "Could not create the calendar feed.",+ "activeFeeds": "Active feeds",+ "subscribeHint": "Copy a link and add it as a calendar subscription. Updates appear when your calendar app refreshes the feed.",+ "empty": "No calendar feeds yet.",+ "feedUrl": "Calendar feed URL",+ "copy": "Copy link",+ "copied": "Calendar feed link copied.",+ "copyError": "Could not copy the link. Select the URL and copy it manually.",+ "revoke": "Revoke",+ "revoked": "Calendar feed revoked.",+ "revokeError": "Could not revoke the calendar feed.",+ "loadError": "Could not load calendar feeds or labels. Please try again.",+ "deletedLabel": "Deleted label",+ "permissionRequired": "You need project-sharing permission to manage calendar feeds."}},"navigation": {diff --git a/i18n/ru-RU.json b/i18n/ru-RU.jsonindex 394ab9929..0c0a09541 100644--- a/i18n/ru-RU.json+++ b/i18n/ru-RU.json@@ -1233,6 +1233,34 @@"updateError": "Не удалось обновить метку","deleteError": "Не удалось удалить метку","nameRequired": "Название метки обязательно"+ },+ "calendarFeeds": {+ "title": "Calendar feeds",+ "subtitle": "Subscribe to scheduled project tasks in your calendar app.",+ "createTitle": "Create a calendar feed",+ "filterHint": "Include tasks with a start or due date and at least one of the selected labels.",+ "labels": "Labels",+ "selectLabels": "Search and select labels…",+ "noLabels": "No labels found.",+ "timeZoneHint": "All-day dates use {{timeZone}}.",+ "accessHint": "Anyone with a feed link can read the matching task titles, descriptions, and dates. Revoke a link to stop future access.",+ "create": "Create feed",+ "creating": "Creating…",+ "created": "Calendar feed created.",+ "createError": "Could not create the calendar feed.",+ "activeFeeds": "Active feeds",+ "subscribeHint": "Copy a link and add it as a calendar subscription. Updates appear when your calendar app refreshes the feed.",+ "empty": "No calendar feeds yet.",+ "feedUrl": "Calendar feed URL",+ "copy": "Copy link",+ "copied": "Calendar feed link copied.",+ "copyError": "Could not copy the link. Select the URL and copy it manually.",+ "revoke": "Revoke",+ "revoked": "Calendar feed revoked.",+ "revokeError": "Could not revoke the calendar feed.",+ "loadError": "Could not load calendar feeds or labels. Please try again.",+ "deletedLabel": "Deleted label",+ "permissionRequired": "You need project-sharing permission to manage calendar feeds."}},"navigation": {diff --git a/i18n/schema.json b/i18n/schema.jsonindex ddc040f66..d453b5259 100644--- a/i18n/schema.json+++ b/i18n/schema.json@@ -4818,6 +4818,118 @@"draft","open"]+ },+ "calendarFeeds": {+ "type": "object",+ "additionalProperties": false,+ "properties": {+ "title": {+ "type": "string"+ },+ "subtitle": {+ "type": "string"+ },+ "createTitle": {+ "type": "string"+ },+ "filterHint": {+ "type": "string"+ },+ "labels": {+ "type": "string"+ },+ "selectLabels": {+ "type": "string"+ },+ "noLabels": {+ "type": "string"+ },+ "timeZoneHint": {+ "type": "string"+ },+ "accessHint": {+ "type": "string"+ },+ "create": {+ "type": "string"+ },+ "creating": {+ "type": "string"+ },+ "created": {+ "type": "string"+ },+ "createError": {+ "type": "string"+ },+ "activeFeeds": {+ "type": "string"+ },+ "subscribeHint": {+ "type": "string"+ },+ "empty": {+ "type": "string"+ },+ "feedUrl": {+ "type": "string"+ },+ "copy": {+ "type": "string"+ },+ "copied": {+ "type": "string"+ },+ "copyError": {+ "type": "string"+ },+ "revoke": {+ "type": "string"+ },+ "revoked": {+ "type": "string"+ },+ "revokeError": {+ "type": "string"+ },+ "loadError": {+ "type": "string"+ },+ "deletedLabel": {+ "type": "string"+ },+ "permissionRequired": {+ "type": "string"+ }+ },+ "required": [+ "title",+ "subtitle",+ "createTitle",+ "filterHint",+ "labels",+ "selectLabels",+ "noLabels",+ "timeZoneHint",+ "accessHint",+ "create",+ "creating",+ "created",+ "createError",+ "activeFeeds",+ "subscribeHint",+ "empty",+ "feedUrl",+ "copy",+ "copied",+ "copyError",+ "revoke",+ "revoked",+ "revokeError",+ "loadError",+ "deletedLabel",+ "permissionRequired"+ ]}},"required": [@@ -4850,7 +4962,8 @@"repositoryBrowser","tasksImportExport","workflowEditor",- "externalLinks"+ "externalLinks",+ "calendarFeeds"]},"navigation": {diff --git a/i18n/tr-TR.json b/i18n/tr-TR.jsonindex b5db61d9d..76496b89f 100644--- a/i18n/tr-TR.json+++ b/i18n/tr-TR.json@@ -1223,6 +1223,34 @@"updateError": "Etiket güncellenemedi","deleteError": "Etiket silinemedi","nameRequired": "Etiket adı gereklidir"+ },+ "calendarFeeds": {+ "title": "Calendar feeds",+ "subtitle": "Subscribe to scheduled project tasks in your calendar app.",+ "createTitle": "Create a calendar feed",+ "filterHint": "Include tasks with a start or due date and at least one of the selected labels.",+ "labels": "Labels",+ "selectLabels": "Search and select labels…",+ "noLabels": "No labels found.",+ "timeZoneHint": "All-day dates use {{timeZone}}.",+ "accessHint": "Anyone with a feed link can read the matching task titles, descriptions, and dates. Revoke a link to stop future access.",+ "create": "Create feed",+ "creating": "Creating…",+ "created": "Calendar feed created.",+ "createError": "Could not create the calendar feed.",+ "activeFeeds": "Active feeds",+ "subscribeHint": "Copy a link and add it as a calendar subscription. Updates appear when your calendar app refreshes the feed.",+ "empty": "No calendar feeds yet.",+ "feedUrl": "Calendar feed URL",+ "copy": "Copy link",+ "copied": "Calendar feed link copied.",+ "copyError": "Could not copy the link. Select the URL and copy it manually.",+ "revoke": "Revoke",+ "revoked": "Calendar feed revoked.",+ "revokeError": "Could not revoke the calendar feed.",+ "loadError": "Could not load calendar feeds or labels. Please try again.",+ "deletedLabel": "Deleted label",+ "permissionRequired": "You need project-sharing permission to manage calendar feeds."}},"navigation": {diff --git a/i18n/uk-UA.json b/i18n/uk-UA.jsonindex c63ff5b7d..e2eb95d63 100644--- a/i18n/uk-UA.json+++ b/i18n/uk-UA.json@@ -1225,6 +1225,34 @@"updateError": "Не вдалося оновити мітку","deleteError": "Не вдалося видалити мітку","nameRequired": "Назва мітки є обов'язковою"+ },+ "calendarFeeds": {+ "title": "Calendar feeds",+ "subtitle": "Subscribe to scheduled project tasks in your calendar app.",+ "createTitle": "Create a calendar feed",+ "filterHint": "Include tasks with a start or due date and at least one of the selected labels.",+ "labels": "Labels",+ "selectLabels": "Search and select labels…",+ "noLabels": "No labels found.",+ "timeZoneHint": "All-day dates use {{timeZone}}.",+ "accessHint": "Anyone with a feed link can read the matching task titles, descriptions, and dates. Revoke a link to stop future access.",+ "create": "Create feed",+ "creating": "Creating…",+ "created": "Calendar feed created.",+ "createError": "Could not create the calendar feed.",+ "activeFeeds": "Active feeds",+ "subscribeHint": "Copy a link and add it as a calendar subscription. Updates appear when your calendar app refreshes the feed.",+ "empty": "No calendar feeds yet.",+ "feedUrl": "Calendar feed URL",+ "copy": "Copy link",+ "copied": "Calendar feed link copied.",+ "copyError": "Could not copy the link. Select the URL and copy it manually.",+ "revoke": "Revoke",+ "revoked": "Calendar feed revoked.",+ "revokeError": "Could not revoke the calendar feed.",+ "loadError": "Could not load calendar feeds or labels. Please try again.",+ "deletedLabel": "Deleted label",+ "permissionRequired": "You need project-sharing permission to manage calendar feeds."}},"navigation": {diff --git a/i18n/vi-VN.json b/i18n/vi-VN.jsonindex 4105aba25..b40b139df 100644--- a/i18n/vi-VN.json+++ b/i18n/vi-VN.json@@ -1223,6 +1223,34 @@"merged": "Đã gộp","draft": "Bản nháp","open": "Đang mở"+ },+ "calendarFeeds": {+ "title": "Calendar feeds",+ "subtitle": "Subscribe to scheduled project tasks in your calendar app.",+ "createTitle": "Create a calendar feed",+ "filterHint": "Include tasks with a start or due date and at least one of the selected labels.",+ "labels": "Labels",+ "selectLabels": "Search and select labels…",+ "noLabels": "No labels found.",+ "timeZoneHint": "All-day dates use {{timeZone}}.",+ "accessHint": "Anyone with a feed link can read the matching task titles, descriptions, and dates. Revoke a link to stop future access.",+ "create": "Create feed",+ "creating": "Creating…",+ "created": "Calendar feed created.",+ "createError": "Could not create the calendar feed.",+ "activeFeeds": "Active feeds",+ "subscribeHint": "Copy a link and add it as a calendar subscription. Updates appear when your calendar app refreshes the feed.",+ "empty": "No calendar feeds yet.",+ "feedUrl": "Calendar feed URL",+ "copy": "Copy link",+ "copied": "Calendar feed link copied.",+ "copyError": "Could not copy the link. Select the URL and copy it manually.",+ "revoke": "Revoke",+ "revoked": "Calendar feed revoked.",+ "revokeError": "Could not revoke the calendar feed.",+ "loadError": "Could not load calendar feeds or labels. Please try again.",+ "deletedLabel": "Deleted label",+ "permissionRequired": "You need project-sharing permission to manage calendar feeds."}},"navigation": {diff --git a/i18n/zh-CN.json b/i18n/zh-CN.jsonindex 6a6af3b3e..50124e029 100644--- a/i18n/zh-CN.json+++ b/i18n/zh-CN.json@@ -1223,6 +1223,34 @@"merged": "已合并","draft": "草稿","open": "打开"+ },+ "calendarFeeds": {+ "title": "Calendar feeds",+ "subtitle": "Subscribe to scheduled project tasks in your calendar app.",+ "createTitle": "Create a calendar feed",+ "filterHint": "Include tasks with a start or due date and at least one of the selected labels.",+ "labels": "Labels",+ "selectLabels": "Search and select labels…",+ "noLabels": "No labels found.",+ "timeZoneHint": "All-day dates use {{timeZone}}.",+ "accessHint": "Anyone with a feed link can read the matching task titles, descriptions, and dates. Revoke a link to stop future access.",+ "create": "Create feed",+ "creating": "Creating…",+ "created": "Calendar feed created.",+ "createError": "Could not create the calendar feed.",+ "activeFeeds": "Active feeds",+ "subscribeHint": "Copy a link and add it as a calendar subscription. Updates appear when your calendar app refreshes the feed.",+ "empty": "No calendar feeds yet.",+ "feedUrl": "Calendar feed URL",+ "copy": "Copy link",+ "copied": "Calendar feed link copied.",+ "copyError": "Could not copy the link. Select the URL and copy it manually.",+ "revoke": "Revoke",+ "revoked": "Calendar feed revoked.",+ "revokeError": "Could not revoke the calendar feed.",+ "loadError": "Could not load calendar feeds or labels. Please try again.",+ "deletedLabel": "Deleted label",+ "permissionRequired": "You need project-sharing permission to manage calendar feeds."}},"navigation": {diff --git a/tests/api-integration/calendar-feed.test.ts b/tests/api-integration/calendar-feed.test.tsnew file mode 100644index 000000000..695d1f3a7--- /dev/null+++ b/tests/api-integration/calendar-feed.test.ts@@ -0,0 +1,281 @@+import { eq } from "drizzle-orm";+import { beforeEach, describe, expect, it } from "vitest";+import db, { schema } from "../../apps/api/src/database";+import { calendarFeedTable } from "../../apps/api/src/database/schema";+import { createApp } from "../../apps/api/src/index";+import updateLabel from "../../apps/api/src/label/controllers/update-label";+import { mockAnonymousSession, mockAuthenticatedSession } from "./helpers/auth";+import { resetTestDatabase } from "./helpers/database";+import {+ createProjectFixture,+ createWorkspaceMember,+} from "./helpers/fixtures";++async function setup(role = "owner") {+ const member = await createWorkspaceMember({ role });+ const { project } = await createProjectFixture({+ workspaceId: member.workspace.id,+ });+ const labels = await db+ .insert(schema.labelTable)+ .values(+ ["Release", "Maintenance"].map((name) => ({+ name,+ color: "gray",+ workspaceId: member.workspace.id,+ })),+ )+ .returning();+ const session = mockAuthenticatedSession(member.user);+ const { app } = createApp();+ const endpoint = `/api/calendar-feed/project/${project.id}`;+ const create = (+ body: unknown = {+ labelIds: labels.map((label) => label.id),+ timeZone: "Europe/Berlin",+ },+ ) =>+ app.request(endpoint, {+ method: "POST",+ headers: { "content-type": "application/json" },+ body: JSON.stringify(body),+ });+ return { member, project, labels, session, app, endpoint, create };+}++type Feed = typeof calendarFeedTable.$inferSelect;+const feedPath = (feed: Feed) =>+ `/api/calendar-feed/${feed.token}/calendar.ics`;++describe("API integration: calendar feeds", () => {+ beforeEach(resetTestDatabase);++ it("creates distinct persistent subscriptions and exposes only scheduled matching project tasks without a session", async () => {+ const { member, project, labels, session, app, create, endpoint } =+ await setup();+ const { project: otherProject } = await createProjectFixture({+ workspaceId: member.workspace.id,+ });+ const tasks = await db+ .insert(schema.taskTable)+ .values([+ {+ title: "Both labels",+ projectId: project.id,+ number: 1,+ startDate: new Date("2026-09-22T22:00:00Z"),+ dueDate: new Date("2026-09-24T22:00:00Z"),+ },+ {+ title: "Only maintenance",+ projectId: project.id,+ number: 2,+ dueDate: new Date("2026-09-25T22:00:00Z"),+ },+ {+ title: "Start only",+ projectId: project.id,+ number: 3,+ startDate: new Date("2026-09-27T22:00:00Z"),+ },+ { title: "Unscheduled", projectId: project.id, number: 4 },+ {+ title: "No matching label",+ projectId: project.id,+ number: 5,+ dueDate: new Date(),+ },+ {+ title: "Another project",+ projectId: otherProject.id,+ number: 1,+ dueDate: new Date(),+ },+ ])+ .returning();+ await db.insert(schema.labelTable).values([+ ...tasks+ .filter((task) => task.title !== "No matching label")+ .map((task) => ({+ name:+ task.title === "Only maintenance" ? labels[1].name : labels[0].name,+ color: "gray",+ workspaceId: member.workspace.id,+ taskId: task.id,+ })),+ {+ name: labels[1].name,+ color: "gray",+ workspaceId: member.workspace.id,+ taskId: tasks[0].id,+ },+ ]);+ const created = await create();+ expect(created.status).toBe(201);+ const feed = (await created.json()) as Feed;+ expect(feed.token).toMatch(/^[a-f0-9]{64}$/);+ const second = (await (await create()).json()) as Feed;+ expect(second.token).not.toBe(feed.token);+ expect(await (await app.request(endpoint)).json()).toHaveLength(2);+ session.mockResolvedValue(null);+ const response = await app.request(feedPath(feed));+ expect(response.status).toBe(200);+ expect(response.headers.get("content-type")).toBe(+ "text/calendar; charset=utf-8",+ );+ expect(response.headers.get("cache-control")).toBe("private, no-store");+ const ics = await response.text();+ expect(ics.match(/BEGIN:VEVENT/g)).toHaveLength(3);+ for (const title of ["Both labels", "Only maintenance", "Start only"])+ expect(ics).toContain(`SUMMARY:${title}`);+ for (const title of ["Unscheduled", "No matching label", "Another project"])+ expect(ics).not.toContain(title);+ expect(ics).toContain(+ "DTSTART;VALUE=DATE:20260923\r\nDTEND;VALUE=DATE:20260926",+ );+ await db+ .update(schema.taskTable)+ .set({ title: "Rescheduled", dueDate: new Date("2026-10-01T22:00:00Z") })+ .where(eq(schema.taskTable.id, tasks[0].id));+ const refreshed = await (await app.request(feedPath(feed))).text();+ expect(refreshed).toContain("SUMMARY:Rescheduled");+ expect(refreshed).toContain(`UID:${tasks[0].id}@kaneo`);+ expect(refreshed).toContain("DTEND;VALUE=DATE:20261003");+ await db+ .update(schema.taskTable)+ .set({ projectId: otherProject.id, number: 10 })+ .where(eq(schema.taskTable.id, tasks[0].id));+ expect(await (await app.request(feedPath(feed))).text()).not.toContain(+ "Rescheduled",+ );+ });++ it("preserves label renames and never broadens the feed when labels are deleted", async () => {+ const { member, project, labels, app, create } = await setup();+ const [task] = await db+ .insert(schema.taskTable)+ .values({+ title: "Release task",+ projectId: project.id,+ dueDate: new Date(),+ })+ .returning();+ await db.insert(schema.labelTable).values({+ name: labels[0].name,+ color: "gray",+ workspaceId: member.workspace.id,+ taskId: task.id,+ });+ const feed = (await (+ await create({ labelIds: [labels[0].id] })+ ).json()) as Feed;+ await updateLabel(labels[0].id, "Renamed", "gray");+ expect(await (await app.request(feedPath(feed))).text()).toContain(+ "SUMMARY:Release task",+ );+ await db+ .delete(schema.labelTable)+ .where(eq(schema.labelTable.id, labels[0].id));+ const result = await (await app.request(feedPath(feed))).text();+ expect(result).toContain("BEGIN:VCALENDAR");+ expect(result).not.toContain("BEGIN:VEVENT");+ });++ it("revokes one link without affecting others and cascades project deletion", async () => {+ const { app, project, endpoint, create } = await setup();+ const first = (await (await create()).json()) as Feed;+ const second = (await (await create()).json()) as Feed;+ expect(+ (await app.request(`${endpoint}/${first.id}`, { method: "DELETE" }))+ .status,+ ).toBe(200);+ expect((await app.request(feedPath(first))).status).toBe(404);+ expect((await app.request(feedPath(second))).status).toBe(200);+ await db+ .delete(schema.projectTable)+ .where(eq(schema.projectTable.id, project.id));+ expect((await app.request(feedPath(second))).status).toBe(404);+ expect(await db.select().from(calendarFeedTable)).toHaveLength(0);+ });++ it.each(["member", "viewer"])(+ "denies feed creation, listing, and revocation to %s roles",+ async (role) => {+ const { app, endpoint, create } = await setup(role);+ expect((await create()).status).toBe(403);+ expect((await app.request(endpoint)).status).toBe(403);+ expect(+ (await app.request(`${endpoint}/anything`, { method: "DELETE" }))+ .status,+ ).toBe(403);+ },+ );++ it("rejects unauthenticated management requests and invalid secret links", async () => {+ mockAnonymousSession();+ const { app } = createApp();+ for (const method of ["GET", "POST", "DELETE"]) {+ const path = `/api/calendar-feed/project/missing${method === "DELETE" ? "/feed" : ""}`;+ expect((await app.request(path, { method })).status).toBe(401);+ }+ expect(+ (await app.request(`/api/calendar-feed/${"a".repeat(64)}/calendar.ics`))+ .status,+ ).toBe(404);+ expect(+ (await app.request("/api/calendar-feed/invalid/calendar.ics")).status,+ ).toBe(400);+ });++ it("rejects foreign-workspace labels, empty selections, and invalid time zones", async () => {+ const { create, labels } = await setup();+ const foreign = await createWorkspaceMember();+ const [foreignLabel] = await db+ .insert(schema.labelTable)+ .values({+ name: "Foreign",+ color: "gray",+ workspaceId: foreign.workspace.id,+ })+ .returning();+ for (const body of [+ { labelIds: [foreignLabel.id] },+ { labelIds: [] },+ { labelIds: ["missing"] },+ { labelIds: [labels[0].id], timeZone: "Not/A_Zone" },+ { labelIds: Array(101).fill(labels[0].id) },+ ])+ expect((await create(body)).status).toBe(400);+ const response = await create({ labelIds: [labels[0].id, labels[0].id] });+ expect(response.status).toBe(201);+ expect(((await response.json()) as Feed).labelIds).toEqual([labels[0].id]);+ });++ it("does not allow a project or workspace ID to authorize another project's feed", async () => {+ const { app, endpoint, create, session } = await setup();+ const feed = (await (await create()).json()) as Feed;+ const outsider = await createWorkspaceMember({ role: "owner" });+ const { project: outsiderProject } = await createProjectFixture({+ workspaceId: outsider.workspace.id,+ });+ session.mockRestore();+ mockAuthenticatedSession(outsider.user);+ expect(+ (await app.request(`${endpoint}?workspaceId=${outsider.workspace.id}`))+ .status,+ ).toBe(403);+ expect(+ (+ await app.request(+ `/api/calendar-feed/project/${outsiderProject.id}/${feed.id}`,+ { method: "DELETE" },+ )+ ).status,+ ).toBe(404);+ expect(+ (await app.request(`${endpoint}/${feed.id}`, { method: "DELETE" }))+ .status,+ ).toBe(403);+ expect((await app.request(feedPath(feed))).status).toBe(200);+ });+});diff --git a/tests/api/calendar-feed/ical.test.ts b/tests/api/calendar-feed/ical.test.tsnew file mode 100644index 000000000..a8a1c9a32--- /dev/null+++ b/tests/api/calendar-feed/ical.test.ts@@ -0,0 +1,96 @@+import { describe, expect, it } from "vitest";+import { buildCalendar } from "../../../apps/api/src/calendar-feed/ical";++const task: Parameters<typeof buildCalendar>[0]["tasks"][number] = {+ id: "task-1",+ title: "Deploy",+ description: null,+ startDate: null,+ dueDate: new Date("2026-09-23T00:00:00Z"),+ createdAt: new Date("2026-09-01T12:00:00Z"),+ updatedAt: new Date("2026-09-22T10:30:00Z"),+};+const calendar = (tasks = [task], timeZone = "UTC") =>+ buildCalendar({ name: "Changes", timeZone, tasks });++describe("iCalendar serialization", () => {+ it("exports an inclusive all-day range with stable identity and revision timestamps", () => {+ const result = calendar([+ { ...task, startDate: new Date("2026-09-21T00:00:00Z") },+ ]);+ expect(result).toContain("UID:task-1@kaneo\r\n");+ expect(result).toContain(+ "DTSTART;VALUE=DATE:20260921\r\nDTEND;VALUE=DATE:20260924",+ );+ expect(result).toContain("DTSTAMP:20260922T103000Z");+ expect(result).toContain("LAST-MODIFIED:20260922T103000Z");+ expect(result).toBe(+ calendar([{ ...task, startDate: new Date("2026-09-21T00:00:00Z") }]),+ );+ });++ it("handles due-only, start-only, unscheduled, and reversed legacy dates", () => {+ expect(calendar()).toContain(+ "DTSTART;VALUE=DATE:20260923\r\nDTEND;VALUE=DATE:20260924",+ );+ expect(+ calendar([{ ...task, dueDate: null, startDate: task.dueDate }]),+ ).toContain("DTEND;VALUE=DATE:20260924");+ expect(calendar([{ ...task, dueDate: null }])).not.toContain(+ "BEGIN:VEVENT",+ );+ expect(+ calendar([{ ...task, startDate: new Date("2026-09-30T00:00:00Z") }]),+ ).toContain("DTEND;VALUE=DATE:20261001");+ });++ it("keeps local dates across UTC offsets and daylight saving changes", () => {+ const result = calendar(+ [+ {+ ...task,+ startDate: new Date("2026-10-24T22:00:00Z"),+ dueDate: new Date("2026-10-25T23:00:00Z"),+ },+ ],+ "Europe/Berlin",+ );+ expect(result).toContain(+ "DTSTART;VALUE=DATE:20261025\r\nDTEND;VALUE=DATE:20261027",+ );+ expect(+ calendar(+ [{ ...task, dueDate: new Date("2026-01-01T02:00:00Z") }],+ "America/Los_Angeles",+ ),+ ).toContain("DTSTART;VALUE=DATE:20251231\r\nDTEND;VALUE=DATE:20260101");+ });++ it("escapes text and prevents newlines from injecting calendar properties", () => {+ const result = buildCalendar({+ name: "Changes, ops; team",+ timeZone: "UTC",+ tasks: [+ {+ ...task,+ title: "A\\B, C; D\r\nEND:VEVENT",+ description: "First\rSecond\nThird",+ },+ ],+ });+ expect(result).toContain("X-WR-CALNAME:Changes\\, ops\\; team");+ expect(result).toContain("SUMMARY:A\\\\B\\, C\\; D\\nEND:VEVENT\r\n");+ expect(result).toContain("DESCRIPTION:First\\nSecond\\nThird");+ expect(result.match(/\r\nEND:VEVENT/g)).toHaveLength(1);+ });++ it("folds at 75 UTF-8 octets without splitting characters and uses CRLF", () => {+ const title = "Änderung 日本語 🚀 ".repeat(20);+ const result = calendar([{ ...task, title }]);+ for (const line of result.split("\r\n"))+ expect(Buffer.byteLength(line)).toBeLessThanOrEqual(75);+ expect(result.replaceAll("\r\n ", "")).toContain(`SUMMARY:${title}\r\n`);+ expect(result.replaceAll("\r\n", "")).not.toMatch(/[\r\n]/);+ expect(result.endsWith("END:VCALENDAR\r\n")).toBe(true);+ });+});