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

Method requireModel

packages/server/src/api/rest/index.ts:1805–1811  ·  view source on GitHub ↗
(model: string)

Source from the content-addressed store, hash-verified

1803 //#region utilities
1804
1805 private requireModel(model: string): ModelDef {
1806 const modelDef = this.schema.models[model];
1807 if (!modelDef) {
1808 throw new Error(`Model ${model} is not defined in the schema`);
1809 }
1810 return modelDef;
1811 }
1812
1813 private getIdFields(model: string): FieldDef[] {
1814 const modelDef = this.requireModel(model);

Callers 15

getUniqueFieldSetsMethod · 0.95
getIdFieldsMethod · 0.95
requireFieldMethod · 0.95
buildSerializersMethod · 0.95
onlyReturningIdMethod · 0.80
getModelPoliciesMethod · 0.80
createFunction · 0.80
createManyFunction · 0.80
updateFunction · 0.80
updateManyFunction · 0.80
deleteFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected