diff --git a/swagger/definitions/index.yml b/swagger/definitions/index.yml index 872183ca7..b59f0292a 100644 --- a/swagger/definitions/index.yml +++ b/swagger/definitions/index.yml @@ -20,6 +20,14 @@ automation_rule_item: $ref: ./resource/automation_rule_item.yml portal: $ref: ./resource/portal.yml +portal_config: + $ref: ./resource/portal_config.yml +portal_logo: + $ref: ./resource/portal_logo.yml +portal_meta: + $ref: ./resource/portal_meta.yml +portal_item: + $ref: ./resource/portal_item.yml category: $ref: ./resource/category.yml article: diff --git a/swagger/definitions/resource/automation_rule.yml b/swagger/definitions/resource/automation_rule.yml index 37fb0f61e..b561441ff 100644 --- a/swagger/definitions/resource/automation_rule.yml +++ b/swagger/definitions/resource/automation_rule.yml @@ -7,5 +7,7 @@ properties: description: Array of automation rules (for listing endpoint) items: $ref: '#/components/schemas/automation_rule_item' - - $ref: '#/components/schemas/automation_rule_item' - description: Single automation rule (for show/create/update endpoints) \ No newline at end of file + - type: object + description: Single automation rule (for show/create/update endpoints) + allOf: + - $ref: '#/components/schemas/automation_rule_item' \ No newline at end of file diff --git a/swagger/definitions/resource/portal.yml b/swagger/definitions/resource/portal.yml index 5fb13e9b8..5268e48d5 100644 --- a/swagger/definitions/resource/portal.yml +++ b/swagger/definitions/resource/portal.yml @@ -1,34 +1,6 @@ type: object properties: - id: - type: integer - archived: - type: boolean - color: - type: string - config: - type: object - description: Save information about locales, allowed_locales and default portal/help-center locale - custom_domain: - type: string - header_text: - type: string - description: The text content. - homepage_link: - type: string - name: - type: string - slug: - type: string - page_title: - type: string - account_id: - type: integer - categories: + payload: type: array items: - $ref: '#/components/schemas/category' - articles: - type: array - items: - $ref: '#/components/schemas/article' + $ref: '#/components/schemas/portal_item' diff --git a/swagger/definitions/resource/portal_config.yml b/swagger/definitions/resource/portal_config.yml new file mode 100644 index 000000000..176c2ffc8 --- /dev/null +++ b/swagger/definitions/resource/portal_config.yml @@ -0,0 +1,18 @@ +type: object +description: Configuration settings for the portal +properties: + allowed_locales: + type: array + description: List of allowed locales for the portal + items: + type: object + properties: + code: + type: string + description: The language code + articles_count: + type: integer + description: Number of articles in this locale + categories_count: + type: integer + description: Number of categories in this locale \ No newline at end of file diff --git a/swagger/definitions/resource/portal_item.yml b/swagger/definitions/resource/portal_item.yml new file mode 100644 index 000000000..461a64f3a --- /dev/null +++ b/swagger/definitions/resource/portal_item.yml @@ -0,0 +1,40 @@ +type: object +properties: + id: + type: integer + description: The ID of the portal + archived: + type: boolean + description: Whether the portal is archived + color: + type: string + description: The color code for the portal + config: + $ref: '#/components/schemas/portal_config' + custom_domain: + type: string + description: Custom domain for the portal + header_text: + type: string + description: The header text for the portal + homepage_link: + type: string + description: Homepage link for the portal + name: + type: string + description: Name of the portal + slug: + type: string + description: URL slug for the portal + page_title: + type: string + description: Page title for the portal + account_id: + type: integer + description: ID of the account the portal belongs to + inbox: + $ref: '#/components/schemas/inbox' + logo: + $ref: '#/components/schemas/portal_logo' + meta: + $ref: '#/components/schemas/portal_meta' \ No newline at end of file diff --git a/swagger/definitions/resource/portal_logo.yml b/swagger/definitions/resource/portal_logo.yml new file mode 100644 index 000000000..606d655c7 --- /dev/null +++ b/swagger/definitions/resource/portal_logo.yml @@ -0,0 +1,23 @@ +type: object +properties: + id: + type: integer + description: ID of the logo file + portal_id: + type: integer + description: ID of the portal this logo belongs to + file_type: + type: string + description: MIME type of the file + account_id: + type: integer + description: ID of the account + file_url: + type: string + description: URL to access the logo file + blob_id: + type: integer + description: ID of the blob + filename: + type: string + description: Name of the file \ No newline at end of file diff --git a/swagger/definitions/resource/portal_meta.yml b/swagger/definitions/resource/portal_meta.yml new file mode 100644 index 000000000..64b44fc99 --- /dev/null +++ b/swagger/definitions/resource/portal_meta.yml @@ -0,0 +1,23 @@ +type: object +properties: + all_articles_count: + type: integer + description: Total number of articles + archived_articles_count: + type: integer + nullable: true + description: Number of archived articles + published_count: + type: integer + nullable: true + description: Number of published articles + draft_articles_count: + type: integer + nullable: true + description: Number of draft articles + categories_count: + type: integer + description: Number of categories + default_locale: + type: string + description: Default locale for the portal \ No newline at end of file diff --git a/swagger/swagger.json b/swagger/swagger.json index 34788b999..0c35e0635 100644 --- a/swagger/swagger.json +++ b/swagger/swagger.json @@ -7605,7 +7605,13 @@ } }, { - "$ref": "#/components/schemas/automation_rule_item" + "type": "object", + "description": "Single automation rule (for show/create/update endpoints)", + "allOf": [ + { + "$ref": "#/components/schemas/automation_rule_item" + } + ] } ] } @@ -7710,54 +7716,162 @@ } }, "portal": { + "type": "object", + "properties": { + "payload": { + "type": "array", + "items": { + "$ref": "#/components/schemas/portal_item" + } + } + } + }, + "portal_config": { + "type": "object", + "description": "Configuration settings for the portal", + "properties": { + "allowed_locales": { + "type": "array", + "description": "List of allowed locales for the portal", + "items": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "The language code" + }, + "articles_count": { + "type": "integer", + "description": "Number of articles in this locale" + }, + "categories_count": { + "type": "integer", + "description": "Number of categories in this locale" + } + } + } + } + } + }, + "portal_logo": { "type": "object", "properties": { "id": { - "type": "integer" + "type": "integer", + "description": "ID of the logo file" + }, + "portal_id": { + "type": "integer", + "description": "ID of the portal this logo belongs to" + }, + "file_type": { + "type": "string", + "description": "MIME type of the file" + }, + "account_id": { + "type": "integer", + "description": "ID of the account" + }, + "file_url": { + "type": "string", + "description": "URL to access the logo file" + }, + "blob_id": { + "type": "integer", + "description": "ID of the blob" + }, + "filename": { + "type": "string", + "description": "Name of the file" + } + } + }, + "portal_meta": { + "type": "object", + "properties": { + "all_articles_count": { + "type": "integer", + "description": "Total number of articles" + }, + "archived_articles_count": { + "type": "integer", + "nullable": true, + "description": "Number of archived articles" + }, + "published_count": { + "type": "integer", + "nullable": true, + "description": "Number of published articles" + }, + "draft_articles_count": { + "type": "integer", + "nullable": true, + "description": "Number of draft articles" + }, + "categories_count": { + "type": "integer", + "description": "Number of categories" + }, + "default_locale": { + "type": "string", + "description": "Default locale for the portal" + } + } + }, + "portal_item": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "description": "The ID of the portal" }, "archived": { - "type": "boolean" + "type": "boolean", + "description": "Whether the portal is archived" }, "color": { - "type": "string" + "type": "string", + "description": "The color code for the portal" }, "config": { - "type": "object", - "description": "Save information about locales, allowed_locales and default portal/help-center locale" + "$ref": "#/components/schemas/portal_config" }, "custom_domain": { - "type": "string" + "type": "string", + "description": "Custom domain for the portal" }, "header_text": { "type": "string", - "description": "The text content." + "description": "The header text for the portal" }, "homepage_link": { - "type": "string" + "type": "string", + "description": "Homepage link for the portal" }, "name": { - "type": "string" + "type": "string", + "description": "Name of the portal" }, "slug": { - "type": "string" + "type": "string", + "description": "URL slug for the portal" }, "page_title": { - "type": "string" + "type": "string", + "description": "Page title for the portal" }, "account_id": { - "type": "integer" + "type": "integer", + "description": "ID of the account the portal belongs to" }, - "categories": { - "type": "array", - "items": { - "$ref": "#/components/schemas/category" - } + "inbox": { + "$ref": "#/components/schemas/inbox" }, - "articles": { - "type": "array", - "items": { - "$ref": "#/components/schemas/article" - } + "logo": { + "$ref": "#/components/schemas/portal_logo" + }, + "meta": { + "$ref": "#/components/schemas/portal_meta" } } },