Add OpenAPI docs, frontend, migrations, and API updates
- OpenAPI: add missing endpoints (add-from-url, subscriptions, public availability) - OpenAPI: CalendarSubscription schema, Subscriptions tag - Frontend app - Migrations: count_for_availability, subscriptions_sync, user_preferences, calendar_settings - Config, rate limit, auth, calendar, booking, ICS, availability, user service updates Made-with: Cursor
This commit is contained in:
@@ -1,5 +1,51 @@
|
||||
{
|
||||
"paths": {
|
||||
"/calendars/add-from-url": {
|
||||
"post": {
|
||||
"tags": ["ICS"],
|
||||
"summary": "Add calendar from iCal URL",
|
||||
"description": "Creates a new calendar, fetches the iCal feed from the given URL, imports all events, and creates a subscription for future syncs. One-step flow for adding external calendars. Requires calendars:write scope.",
|
||||
"operationId": "addCalendarFromURL",
|
||||
"requestBody": {
|
||||
"required": true,
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"required": ["url"],
|
||||
"properties": {
|
||||
"url": { "type": "string", "format": "uri", "description": "iCal feed URL (http, https, or webcal)", "example": "https://example.com/calendar.ics" },
|
||||
"name": { "type": "string", "description": "Optional calendar name", "example": "Work" },
|
||||
"color": { "type": "string", "pattern": "^#[0-9A-Fa-f]{6}$", "example": "#3B82F6" }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Calendar created and events imported",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"required": ["ok", "calendar", "imported", "source"],
|
||||
"properties": {
|
||||
"ok": { "type": "boolean", "example": true },
|
||||
"calendar": { "$ref": "#/components/schemas/Calendar" },
|
||||
"imported": { "type": "object", "properties": { "events": { "type": "integer", "example": 12 } } },
|
||||
"source": { "type": "string", "format": "uri", "description": "The URL that was imported" }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"400": { "description": "Validation error, unreachable URL, or invalid ICS", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } },
|
||||
"401": { "description": "Not authenticated", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } },
|
||||
"403": { "description": "Insufficient scope or permission", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }
|
||||
}
|
||||
}
|
||||
},
|
||||
"/calendars/{id}/export.ics": {
|
||||
"get": {
|
||||
"tags": ["ICS"],
|
||||
@@ -130,16 +176,16 @@
|
||||
"/cal/{token}/feed.ics": {
|
||||
"get": {
|
||||
"tags": ["ICS"],
|
||||
"summary": "Public iCal feed",
|
||||
"description": "Returns a public iCal feed for a calendar that has been marked as public. No authentication required. This URL can be used to subscribe to the calendar in Google Calendar, Apple Calendar, Outlook, etc. The `ical_url` is returned in the Calendar object when `is_public` is true.",
|
||||
"operationId": "publicCalendarFeed",
|
||||
"summary": "iCal feed",
|
||||
"description": "Returns an iCal feed for a calendar. Works for both public and private calendars. No authentication required. Public calendars use a shorter base64url token; private calendars use a 64-character SHA256 hex token. The `ical_url` is returned in the Calendar object. Subscribe in Google Calendar, Apple Calendar, Outlook, etc.",
|
||||
"operationId": "calendarFeed",
|
||||
"parameters": [
|
||||
{
|
||||
"name": "token",
|
||||
"in": "path",
|
||||
"required": true,
|
||||
"schema": { "type": "string" },
|
||||
"description": "Public calendar token (from the calendar's ical_url)"
|
||||
"description": "Calendar token from ical_url (public or private)"
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
@@ -151,7 +197,7 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"404": { "description": "Calendar not found or not public", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }
|
||||
"404": { "description": "Calendar not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }
|
||||
},
|
||||
"security": []
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user