|
1649 | 1649 | } |
1650 | 1650 | }, |
1651 | 1651 | "not": { |
1652 | | - "required": ["openAPI"] |
| 1652 | + "anyOf": [{ "required": ["openAPI"] }, { "required": ["restAPI"] }] |
1653 | 1653 | } |
1654 | 1654 | } |
1655 | 1655 | ] |
|
1829 | 1829 | } |
1830 | 1830 | ] |
1831 | 1831 | }, |
| 1832 | + "RestAPIAuthV1": { |
| 1833 | + "type": "object", |
| 1834 | + "description": "Authentication configuration for REST API extraction", |
| 1835 | + "properties": { |
| 1836 | + "type": { |
| 1837 | + "type": "string", |
| 1838 | + "description": "Authentication type", |
| 1839 | + "enum": ["bearer", "api_key", "basic", "oauth2_client_credentials"] |
| 1840 | + }, |
| 1841 | + "token": { |
| 1842 | + "$ref": "#/definitions/ConvertibleToString", |
| 1843 | + "description": "Bearer token value. Supports {{ENV_VAR}} syntax." |
| 1844 | + }, |
| 1845 | + "key": { |
| 1846 | + "$ref": "#/definitions/ConvertibleToString", |
| 1847 | + "description": "API key value for api_key auth." |
| 1848 | + }, |
| 1849 | + "header": { |
| 1850 | + "$ref": "#/definitions/ConvertibleToString", |
| 1851 | + "description": "Header name for api_key auth. Defaults to X-API-Key." |
| 1852 | + }, |
| 1853 | + "username": { |
| 1854 | + "$ref": "#/definitions/ConvertibleToString", |
| 1855 | + "description": "Username for basic auth." |
| 1856 | + }, |
| 1857 | + "password": { |
| 1858 | + "$ref": "#/definitions/ConvertibleToString", |
| 1859 | + "description": "Password for basic auth." |
| 1860 | + }, |
| 1861 | + "tokenUrl": { |
| 1862 | + "$ref": "#/definitions/ConvertibleToString", |
| 1863 | + "description": "Token endpoint URL for OAuth2 client credentials." |
| 1864 | + }, |
| 1865 | + "clientId": { |
| 1866 | + "$ref": "#/definitions/ConvertibleToString", |
| 1867 | + "description": "Client ID for OAuth2." |
| 1868 | + }, |
| 1869 | + "clientSecret": { |
| 1870 | + "$ref": "#/definitions/ConvertibleToString", |
| 1871 | + "description": "Client secret for OAuth2." |
| 1872 | + }, |
| 1873 | + "scope": { |
| 1874 | + "$ref": "#/definitions/ConvertibleToString", |
| 1875 | + "description": "OAuth2 scope (optional)." |
| 1876 | + } |
| 1877 | + }, |
| 1878 | + "required": ["type"] |
| 1879 | + }, |
| 1880 | + "RestAPIPaginationV1": { |
| 1881 | + "type": "object", |
| 1882 | + "description": "Pagination strategy for REST API endpoints", |
| 1883 | + "properties": { |
| 1884 | + "type": { |
| 1885 | + "type": "string", |
| 1886 | + "description": "Pagination strategy type", |
| 1887 | + "enum": ["offset", "cursor", "link_header", "page_number"] |
| 1888 | + }, |
| 1889 | + "limitParam": { |
| 1890 | + "$ref": "#/definitions/ConvertibleToString", |
| 1891 | + "description": "Query parameter name for page size limit." |
| 1892 | + }, |
| 1893 | + "offsetParam": { |
| 1894 | + "$ref": "#/definitions/ConvertibleToString", |
| 1895 | + "description": "Query parameter name for offset (offset pagination)." |
| 1896 | + }, |
| 1897 | + "cursorParam": { |
| 1898 | + "$ref": "#/definitions/ConvertibleToString", |
| 1899 | + "description": "Query parameter name for cursor value (cursor pagination)." |
| 1900 | + }, |
| 1901 | + "cursorPath": { |
| 1902 | + "$ref": "#/definitions/ConvertibleToString", |
| 1903 | + "description": "JSONPath to extract cursor from response (e.g. $.meta.next_cursor)." |
| 1904 | + }, |
| 1905 | + "pageParam": { |
| 1906 | + "$ref": "#/definitions/ConvertibleToString", |
| 1907 | + "description": "Query parameter name for page number (page_number pagination)." |
| 1908 | + }, |
| 1909 | + "pageSize": { |
| 1910 | + "type": "integer", |
| 1911 | + "description": "Number of records per page. Defaults to 100.", |
| 1912 | + "default": 100 |
| 1913 | + } |
| 1914 | + }, |
| 1915 | + "required": ["type"] |
| 1916 | + }, |
| 1917 | + "RestAPIEndpointV1": { |
| 1918 | + "type": "object", |
| 1919 | + "description": "REST API endpoint definition for data extraction", |
| 1920 | + "properties": { |
| 1921 | + "path": { |
| 1922 | + "$ref": "#/definitions/ConvertibleToString", |
| 1923 | + "description": "API endpoint path (e.g. /api/v2/customers)." |
| 1924 | + }, |
| 1925 | + "method": { |
| 1926 | + "type": "string", |
| 1927 | + "description": "HTTP method. Defaults to GET.", |
| 1928 | + "enum": ["GET", "POST"], |
| 1929 | + "default": "GET" |
| 1930 | + }, |
| 1931 | + "as": { |
| 1932 | + "$ref": "#/definitions/ConvertibleToString", |
| 1933 | + "description": "Table name override. If not set, derived from the last path segment." |
| 1934 | + }, |
| 1935 | + "domain": { |
| 1936 | + "$ref": "#/definitions/ConvertibleToString", |
| 1937 | + "description": "Domain name to group this endpoint under. Defaults to 'default'.", |
| 1938 | + "default": "default" |
| 1939 | + }, |
| 1940 | + "headers": { |
| 1941 | + "$ref": "#/definitions/MapString", |
| 1942 | + "description": "Additional HTTP headers for this endpoint." |
| 1943 | + }, |
| 1944 | + "queryParams": { |
| 1945 | + "$ref": "#/definitions/MapString", |
| 1946 | + "description": "Additional query parameters for this endpoint." |
| 1947 | + }, |
| 1948 | + "requestBody": { |
| 1949 | + "$ref": "#/definitions/ConvertibleToString", |
| 1950 | + "description": "JSON request body for POST endpoints." |
| 1951 | + }, |
| 1952 | + "pagination": { |
| 1953 | + "$ref": "#/definitions/RestAPIPaginationV1", |
| 1954 | + "description": "Pagination strategy for this endpoint. Overrides defaults." |
| 1955 | + }, |
| 1956 | + "responsePath": { |
| 1957 | + "$ref": "#/definitions/ConvertibleToString", |
| 1958 | + "description": "JSONPath to the data array in the response (e.g. $.data or $.results)." |
| 1959 | + }, |
| 1960 | + "incrementalField": { |
| 1961 | + "$ref": "#/definitions/ConvertibleToString", |
| 1962 | + "description": "Field name used for incremental extraction. The max value is saved between runs." |
| 1963 | + }, |
| 1964 | + "children": { |
| 1965 | + "type": "array", |
| 1966 | + "description": "Child endpoints that depend on parent records. Use {parent.fieldName} in path.", |
| 1967 | + "items": { |
| 1968 | + "$ref": "#/definitions/RestAPIEndpointV1" |
| 1969 | + } |
| 1970 | + }, |
| 1971 | + "excludeFields": { |
| 1972 | + "type": "array", |
| 1973 | + "description": "List of regex patterns to exclude fields from extraction.", |
| 1974 | + "items": { |
| 1975 | + "$ref": "#/definitions/ConvertibleToString" |
| 1976 | + } |
| 1977 | + } |
| 1978 | + }, |
| 1979 | + "required": ["path"] |
| 1980 | + }, |
| 1981 | + "RestAPIDefaultsV1": { |
| 1982 | + "type": "object", |
| 1983 | + "description": "Default settings applied to all endpoints", |
| 1984 | + "properties": { |
| 1985 | + "pagination": { |
| 1986 | + "$ref": "#/definitions/RestAPIPaginationV1", |
| 1987 | + "description": "Default pagination strategy for all endpoints." |
| 1988 | + }, |
| 1989 | + "headers": { |
| 1990 | + "$ref": "#/definitions/MapString", |
| 1991 | + "description": "Default headers applied to all endpoints." |
| 1992 | + }, |
| 1993 | + "queryParams": { |
| 1994 | + "$ref": "#/definitions/MapString", |
| 1995 | + "description": "Default query parameters applied to all endpoints." |
| 1996 | + } |
| 1997 | + } |
| 1998 | + }, |
| 1999 | + "RestAPIRateLimitV1": { |
| 2000 | + "type": "object", |
| 2001 | + "properties": { |
| 2002 | + "requestsPerSecond": { |
| 2003 | + "type": "integer", |
| 2004 | + "description": "Maximum number of requests per second. Defaults to 10.", |
| 2005 | + "default": 10 |
| 2006 | + } |
| 2007 | + } |
| 2008 | + }, |
| 2009 | + "RestAPIV1": { |
| 2010 | + "type": "object", |
| 2011 | + "description": "REST API extraction configuration", |
| 2012 | + "properties": { |
| 2013 | + "baseUrl": { |
| 2014 | + "$ref": "#/definitions/ConvertibleToString", |
| 2015 | + "description": "Base URL of the REST API (e.g. https://api.example.com/v2)." |
| 2016 | + }, |
| 2017 | + "auth": { |
| 2018 | + "$ref": "#/definitions/RestAPIAuthV1", |
| 2019 | + "description": "Authentication configuration." |
| 2020 | + }, |
| 2021 | + "headers": { |
| 2022 | + "$ref": "#/definitions/MapString", |
| 2023 | + "description": "Global HTTP headers applied to all requests." |
| 2024 | + }, |
| 2025 | + "rateLimit": { |
| 2026 | + "$ref": "#/definitions/RestAPIRateLimitV1", |
| 2027 | + "description": "Rate limiting configuration." |
| 2028 | + }, |
| 2029 | + "defaults": { |
| 2030 | + "$ref": "#/definitions/RestAPIDefaultsV1", |
| 2031 | + "description": "Default settings applied to all endpoints." |
| 2032 | + }, |
| 2033 | + "endpoints": { |
| 2034 | + "type": "array", |
| 2035 | + "description": "List of API endpoints to extract data from.", |
| 2036 | + "minItems": 1, |
| 2037 | + "items": { |
| 2038 | + "$ref": "#/definitions/RestAPIEndpointV1" |
| 2039 | + } |
| 2040 | + } |
| 2041 | + }, |
| 2042 | + "required": ["baseUrl", "endpoints"] |
| 2043 | + }, |
| 2044 | + "RestAPIsV1": { |
| 2045 | + "type": "object", |
| 2046 | + "allOf": [ |
| 2047 | + { |
| 2048 | + "$ref": "#/definitions/ExtractV1Base" |
| 2049 | + }, |
| 2050 | + { |
| 2051 | + "properties": { |
| 2052 | + "restAPI": { |
| 2053 | + "$ref": "#/definitions/RestAPIV1", |
| 2054 | + "description": "Describe how to extract data from REST API endpoints" |
| 2055 | + } |
| 2056 | + }, |
| 2057 | + "required": ["restAPI"] |
| 2058 | + } |
| 2059 | + ] |
| 2060 | + }, |
1832 | 2061 | "ExtractV1Base": { |
1833 | 2062 | "type": "object", |
1834 | 2063 | "properties": { |
|
2406 | 2635 | { |
2407 | 2636 | "$ref": "#/definitions/OpenAPIsV1", |
2408 | 2637 | "description": "Defines OpenAPI schemas extraction" |
| 2638 | + }, |
| 2639 | + { |
| 2640 | + "$ref": "#/definitions/RestAPIsV1", |
| 2641 | + "description": "Defines REST API data extraction" |
2409 | 2642 | } |
2410 | 2643 | ] |
2411 | 2644 | }, |
|
0 commit comments