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

Function getAuthDecl

packages/sdk/src/model-utils.ts:134–142  ·  view source on GitHub ↗
(model: Model)

Source from the content-addressed store, hash-verified

132}
133
134export function getAuthDecl(model: Model) {
135 let found = model.declarations.find(
136 (d) => (isDataModel(d) || isTypeDef(d)) && d.attributes.some((attr) => attr.decl.$refText === '@@auth'),
137 );
138 if (!found) {
139 found = model.declarations.find((d) => (isDataModel(d) || isTypeDef(d)) && d.name === 'User');
140 }
141 return found;
142}
143
144export function getIdFields(dm: DataModel) {
145 return getAllFields(dm)

Callers 1

createSchemaClassMethod · 0.90

Calls 3

isDataModelFunction · 0.90
isTypeDefFunction · 0.90
findMethod · 0.80

Tested by

no test coverage detected