Skip to content
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 system generated keys for permissions and items #83

Merged
merged 2 commits into from
Jul 31, 2018

Conversation

southpolesteve
Copy link
Contributor

Adds system generated keys to the return bodies for Permission and Item calls

@christopheranderson any thoughts on the approach of using <T & ItemBody> for items? Open to other suggestions, this was the option that made sense to me in the TS docs but seems like <ItemBody<T = any>> could also work.

@christopheranderson
Copy link
Contributor

I sent a follow up PR with some suggested changes: #84

@@ -68,7 +69,9 @@ export class Item {
if ((!options || !options.partitionKey) && this.primaryKey) {
options.partitionKey = this.primaryKey;
}
const response = await (this.client.documentClient.readDocument(this.url, options) as Promise<Response<T>>);
const response = await (this.client.documentClient.readDocument(this.url, options) as Promise<
Response<T & ItemBody>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unless we also change the <any> signature, this won't be seen.

@christopheranderson
Copy link
Contributor

:shipit:

@southpolesteve southpolesteve merged commit 85d02c6 into dev Jul 31, 2018
@southpolesteve southpolesteve deleted the system-generated-keys branch July 31, 2018 00:51
christopheranderson pushed a commit that referenced this pull request Jul 31, 2018
* Add system generated keys for permissions and items

* Add ItemDefinition (#84)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants