()
| 117 | }; |
| 118 | |
| 119 | async function generateXsd() { |
| 120 | try { |
| 121 | const xsdMetadataPath = "public/schema/metadata"; |
| 122 | const resResources = await fetch( |
| 123 | `https://github.com/api-platform/core/raw/${current}/src/Metadata/Extractor/schema/resources.xsd` |
| 124 | ); |
| 125 | const resProperties = await fetch( |
| 126 | `https://github.com/api-platform/core/raw/${current}/src/Metadata/Extractor/schema/properties.xsd` |
| 127 | ); |
| 128 | const xsd = await fetch( |
| 129 | `https://github.com/api-platform/core/raw/2.7/src/Core/Metadata/schema/metadata.xsd` |
| 130 | ); |
| 131 | checkStatus(resProperties); |
| 132 | checkStatus(resResources); |
| 133 | checkStatus(xsd); |
| 134 | |
| 135 | fs.writeFileSync( |
| 136 | path.resolve(__dirname, `./${xsdMetadataPath}/resources-3.0.xsd`), |
| 137 | await resResources.text() |
| 138 | ); |
| 139 | fs.writeFileSync( |
| 140 | path.resolve(__dirname, `./${xsdMetadataPath}/properties-3.0.xsd`), |
| 141 | await resProperties.text() |
| 142 | ); |
| 143 | fs.writeFileSync( |
| 144 | path.resolve(__dirname, `./${xsdMetadataPath}/metadata-2.0.xsd`), |
| 145 | await xsd.text() |
| 146 | ); |
| 147 | } catch (error) { |
| 148 | console.warn( |
| 149 | "\x1b[31m", |
| 150 | `Failed to retrieve metadata XSD files: ${error}`, |
| 151 | "\x1b[37m" |
| 152 | ); |
| 153 | } |
| 154 | } |
| 155 | |
| 156 | const indexes = [ |
| 157 | "admin", |
no test coverage detected