{
  "openapi": "3.1.0",
  "info": {
    "title": "صُنّاع القمم — Content API",
    "summary": "واجهة قراءة عامة لمحتوى منصة صُنّاع القمم التعليمية",
    "description": "واجهة قراءة فقط تعرض فهرس الصفحات العامة للمنصة (أدوات المعلم، دليل المعلم، المزايا، الأسعار). لا تحتوي أي بيانات طلبة أو معلمين ولا تتيح الكتابة. جميع الردود JSON بترميز UTF-8.",
    "version": "1.0.0",
    "contact": {
      "name": "DIYOMX",
      "url": "https://peak-makers.com/about/"
    },
    "license": {
      "name": "Content is copyrighted; API access is provided for read-only discovery",
      "url": "https://peak-makers.com/terms/"
    }
  },
  "servers": [
    {
      "url": "https://peak-makers.com",
      "description": "الإنتاج"
    }
  ],
  "tags": [
    {
      "name": "Content",
      "description": "فهرس الصفحات العامة"
    },
    {
      "name": "Meta",
      "description": "حالة الخدمة وبياناتها الوصفية"
    }
  ],
  "paths": {
    "/api/v1/pages.json": {
      "get": {
        "tags": ["Content"],
        "operationId": "listPublicPages",
        "summary": "فهرس الصفحات العامة",
        "description": "يعيد قائمة بكل الصفحات العامة المنشورة: المسار، الرابط المطلق، العنوان، والوصف. تُستبعد الصفحات الداخلية الموسومة noindex تلقائياً أثناء البناء.",
        "responses": {
          "200": {
            "description": "فهرس الصفحات",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/PageIndex" }
              }
            }
          }
        }
      }
    },
    "/.well-known/api-catalog": {
      "get": {
        "tags": ["Meta"],
        "operationId": "getApiCatalog",
        "summary": "كتالوج الواجهات (RFC 9727)",
        "description": "مستند Linkset بصيغة application/linkset+json يصف الواجهات المنشورة، وفق RFC 9727.",
        "responses": {
          "200": {
            "description": "كتالوج الواجهات",
            "content": {
              "application/linkset+json": {
                "schema": { "type": "object" }
              }
            }
          }
        }
      }
    },
    "/api/v1/status.json": {
      "get": {
        "tags": ["Meta"],
        "operationId": "getStatus",
        "summary": "حالة الخدمة",
        "description": "رد صحي بسيط يتحقق منه الكتالوج عبر علاقة status.",
        "responses": {
          "200": {
            "description": "الخدمة تعمل",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/Status" }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "PageIndex": {
        "type": "object",
        "required": ["site", "name", "language", "updated", "count", "pages"],
        "properties": {
          "site": {
            "type": "string",
            "format": "uri",
            "description": "أصل الموقع"
          },
          "name": {
            "type": "string",
            "description": "اسم المنصة"
          },
          "language": {
            "type": "string",
            "description": "رمز اللغة (BCP 47)"
          },
          "updated": {
            "type": "string",
            "format": "date",
            "description": "تاريخ آخر بناء للفهرس"
          },
          "count": {
            "type": "integer",
            "description": "عدد الصفحات"
          },
          "pages": {
            "type": "array",
            "items": { "$ref": "#/components/schemas/Page" }
          }
        }
      },
      "Page": {
        "type": "object",
        "required": ["path", "url", "title"],
        "properties": {
          "path": {
            "type": "string",
            "description": "مسار نسبي داخل الموقع، بشرطة أخيرة"
          },
          "url": {
            "type": "string",
            "format": "uri",
            "description": "الرابط المطلق"
          },
          "title": {
            "type": "string",
            "description": "عنوان الصفحة"
          },
          "description": {
            "type": "string",
            "description": "وصف الصفحة"
          }
        }
      },
      "Status": {
        "type": "object",
        "required": ["status"],
        "properties": {
          "status": {
            "type": "string",
            "enum": ["ok"]
          },
          "name": { "type": "string" },
          "updated": { "type": "string", "format": "date" }
        }
      }
    }
  }
}
