MCPcopy Create free account
hub / github.com/zenstackhq/zenstack / requireDataSourceUrl

Function requireDataSourceUrl

packages/cli/src/actions/action-utils.ts:167–173  ·  view source on GitHub ↗
(schemaFile: string)

Source from the content-addressed store, hash-verified

165}
166
167export async function requireDataSourceUrl(schemaFile: string) {
168 const zmodel = await loadSchemaDocument(schemaFile);
169 const dataSource = zmodel.declarations.find(isDataSource);
170 if (!dataSource?.fields.some((f) => f.name === 'url')) {
171 throw new CliError('The schema\'s "datasource" must have a "url" field to use this command.');
172 }
173}
174
175export function getOutputPath(options: { output?: string }, schemaFile: string) {
176 if (options.output) {

Callers 2

runPushFunction · 0.90
runFunction · 0.90

Calls 2

loadSchemaDocumentFunction · 0.85
findMethod · 0.80

Tested by

no test coverage detected