-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a default export which maps OData names to typescript interfaces #64
Conversation
src/generate.ts
Outdated
` ${sqlNameToODataName(tableName)}: ${modelNameToCamelCaseName(m.tables[tableName].name)};`, | ||
) | ||
.join('\n')} | ||
// Synonyms |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we always want to output this comment even when no synonyms exist?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not that fussed either way personally but I'll look into either removing or replacing it with a // No synonyms
to make it clear that there are no synonyms vs something weird happening/a bug
src/generate.ts
Outdated
@@ -188,5 +188,21 @@ ${Object.keys(m.tables) | |||
return tableToInterface(m, t); | |||
}) | |||
.join('\n\n')} | |||
|
|||
export default interface Model { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about using a weirder name in order to reduce the chance of conflicting w/ an actual resource that consumer might have?
Eg $ModelMap
(in the SDK, as you probably saw, we use the poorly inspired ResourceTypeMap
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@thgreasi I thought because it is a default export that it wouldn't clash, but it turns out it would.. I've renamed it to $Model
to avoid clashes and the name shouldn't usually matter because it should just be accessed via import type Model from ...
ecb9352
to
003f566
Compare
bb7b9f9
to
37a490c
Compare
Change-type: minor
37a490c
to
877a798
Compare
No description provided.