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

feat(users): Add users collection to SDK #52

Merged
merged 35 commits into from
Jan 23, 2019
Merged
Changes from 1 commit
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
3f3c501
Add docs related to adding the users namespace to the API
kwelch Dec 28, 2018
89530c7
updates to users doc based on review
kwelch Dec 31, 2018
174d8b8
more code review updates
kwelch Jan 2, 2019
3f2d2d7
update doc to match emailLookup name
kwelch Jan 2, 2019
6026411
update getById example to use a string for id
kwelch Jan 2, 2019
698b878
Add implementation for users.me
kwelch Jan 2, 2019
ab23e91
add keys to UserObject interface to fix lint issue
kwelch Jan 2, 2019
a3fd6e1
remove unnecessary typing
kwelch Jan 2, 2019
3c16eaa
update users test to use request instead of full sdk
kwelch Jan 2, 2019
5288f3f
add index test for users collection
kwelch Jan 2, 2019
a1f11d4
updated to use instance of instead of any
kwelch Jan 2, 2019
57a0e5c
update doc on each method to remove extra words
kwelch Jan 3, 2019
22b978b
Update type name from collection to methods
kwelch Jan 3, 2019
90b597a
Update type from RequestHelper to JSONRequest
kwelch Jan 3, 2019
c232d53
Add Email type and rename UserObject to User
kwelch Jan 3, 2019
24aae2b
Add transformation of snakeToCamel for objects keys
kwelch Jan 3, 2019
926c305
fixed tests for transformed data
kwelch Jan 3, 2019
ac627ec
fixed test for node@6
kwelch Jan 3, 2019
a71616a
replace Object.entries with keys for node@6 support
kwelch Jan 3, 2019
ab65a28
added rejection case to users.me
kwelch Jan 4, 2019
f1e5574
Added more test and methods to userMethods
kwelch Jan 4, 2019
fcdb247
swap functions for classes
jcreamer898 Jan 7, 2019
28437e5
clean up a bit
jcreamer898 Jan 7, 2019
e05a3b2
a bit more cleanup
jcreamer898 Jan 7, 2019
dfca786
rename interfaces while I make up my mind
jcreamer898 Jan 7, 2019
392ac6d
Merge pull request #1 from jcreamer898/jc-add-users
kwelch Jan 8, 2019
9b6dabb
minor updates to make jsonRequest generic
kwelch Jan 8, 2019
95c2b15
fix(types): update generics in request
jcreamer898 Jan 8, 2019
54dd2b3
add default api response
jcreamer898 Jan 8, 2019
2cb171e
Merge pull request #2 from jcreamer898/jc-add-users
kwelch Jan 9, 2019
817fa36
remove support for emailLookup since it is deprecated
kwelch Jan 10, 2019
7afe721
update test to deconstruct to specific methods
kwelch Jan 10, 2019
2a8c562
avoid async/await for compile purposes
kwelch Jan 10, 2019
1170cc6
fix binding issue with users api functions
kwelch Jan 10, 2019
4c18869
revert arrow functions and fix tests
kwelch Jan 10, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 18 additions & 3 deletions docs/users.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Users
kwelch-eb marked this conversation as resolved.
Show resolved Hide resolved

This is a collection of user methods.
This is a collection of method that are intended to be helpful wrappers around the [Users api endpoints](user-api-docs).
kwelch-eb marked this conversation as resolved.
Show resolved Hide resolved

The definition of the [User response object can be found here](user-object-reference).
kwelch-eb marked this conversation as resolved.
Show resolved Hide resolved

## ToC
kwelch-eb marked this conversation as resolved.
Show resolved Hide resolved

Expand All @@ -13,6 +15,8 @@ This is a collection of user methods.
## `sdk.users.me()`
This method is used to get details about the current logged in user.
kwelch-eb marked this conversation as resolved.
Show resolved Hide resolved

**[Documentation](user-get-me)**
kwelch-eb marked this conversation as resolved.
Show resolved Hide resolved

### API
```js
sdk.users.me(): Promise<User>
Expand All @@ -36,9 +40,11 @@ sdk.users.me().then((user) => {
## `sdk.users.get(id)`
This method is used to load the details for a specific user by their user id.

**[Documentation](user-get-id)**

### API
```js
sdk.users.get(id: number|string): Promise<User>
sdk.users.get(id: string): Promise<User>
```

### Example
Expand All @@ -59,6 +65,8 @@ sdk.users.get(1234567890).then((user) => {
## `sdk.users.lookup(email)`
kwelch marked this conversation as resolved.
Show resolved Hide resolved
This method is used to load the details for a specific user by their email address.

**_Currently, no public documentation page_**

### API
```js
sdk.users.lookup(email: string): Promise<User>
Expand All @@ -75,4 +83,11 @@ const sdk = eventbrite({token: 'OATH_TOKEN_HERE'});
sdk.users.lookup('[email protected]').then((user) => {
console.log(`Hi ${user.name}!`);
});
```
```


<!-- link reference section -->
[user-api-docs]: https://www.eventbrite.com/platform/api#/reference/user
[user-object-reference]: https://www.eventbrite.com/platform/api#/reference/user/retrieve-a-user
[user-by-id]: https://www.eventbrite.com/platform/api#/reference/user/retrieve-a-user
[user-get-me]: https://www.eventbrite.com/platform/api#/reference/user/retrieve/retrieve-your-user