(model: Model)
| 132 | } |
| 133 | |
| 134 | export 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 | |
| 144 | export function getIdFields(dm: DataModel) { |
| 145 | return getAllFields(dm) |
no test coverage detected