arnaud-zg / ts-foursquare Goto Github PK
View Code? Open in Web Editor NEWA simple library for Foursquare API
License: MIT License
A simple library for Foursquare API
License: MIT License
N/A
EApiPathnames
, add endpoint for venue exploregetVenuesExploreEpic
adaptGetVenuesSearch
on service callbackEVenuesAction.GET_VENUE_EXPLORE_FAILURE
EVenuesAction.GET_VENUE_EXPLORE_CANCEL
N/A
N/A
Scenario: As a user, I want to do a search for a venue
Given Jeff gave my location information (latitude & longitude)
Then Jeff should see a list of venues
ENDPOINT: venues/search
can now accept parameter PARAMETERS: lat/long = 40.7337621,-74.0095604; intent = checkin
lat/long
are provided automatically set intent = checkin
requestGetVenuesSearch
's payloadWe should do a search like that: requestGetVenuesSearch({ ll: '40.7099,-73.9622' })
type TPayload = IGetVenuesSearchByWord | IGetVenuesSearchByLocation
export const requestGetVenuesSearch = (payload = TPayload) =>
action(EVenuesAction.REQUEST_GET_VENUES_SEARCH, payload)
https://developer.foursquare.com/docs/api/venues/search
N/A
Create an issue or pull request with template
.github
N/A
N/A
N/A
Scenario: As a user, Jeff want to do a search for a venue
Given Jeff type something on the search bar
And he submitted it
Then Jeff should see a list of venues nearby
ENDPOINT: venues/search
can now accept parameter PARAMETERS: lat/long = 40.7629212,-73.9935085; query = ShopMart; intent = browse; radius = 500
TPayload
, IGetVenuesSearchByWordNearby
?radius
by default at 500
We should do a search like that: requestGetVenuesSearch({ ll: '40.7099,-73.9622', query: "Something", intent: "browse", radius: 500 })
type TPayload = IGetVenuesSearchByWord | IGetVenuesSearchByLocation | IGetVenuesSearchByWordNearby
export const requestGetVenuesSearch = (payload = TPayload) =>
action(EVenuesAction.REQUEST_GET_VENUES_SEARCH, payload)
https://developer.foursquare.com/docs/api/venues/search
N/A
Just a test
N/A
N/A
N/A
N/A
We should always specify return type when we create a reducer, example just below.
[ELifeAction.RESOLVE_GET_LIFE]: (state, action): NLife.IState => ({
...state,
...action.payload,
}),
createAsyncAction
epic
middlewareaction.success
action.failure
success
, failure
, cancel
(optional)N/A
N/A
N/A
N/A
venuesReducer
EVenuesAction.GET_VENUE_EXPLORE_SUCCESS
recommendedPlaces
recommendedPlaces: NRecommendedPLaces.IRecommendedPLaces<NVenue.IVenue>
N/A
N/A
From now pipeline should fail if we create a pull request with uncovered code.
coverageThreshold
N/A
N/A
N/A
Scenario: As a user, I want to do a search for a venue
Given Jeff type something on the search bar
And he submitted it
Then Jeff should see a list of venues
And Jeff should see venue's categories
getVenueCategories
We should do a search like that: getVenueCategories(venueList)
export const getVenueCategories = (venueList: IVenue[]): ILocation => {}
N/A
Describe the bug
About async action, we should have a module for every action; for example on venuesActionsAsync
we should have only one object for 4 actions (request, failure, cancel, success).
To Reproduce
Steps to reproduce the behavior:
Expected behavior
{ "getVenuesSearchAsync": { "hasError": false, "isLoading": false } }
Additional context
N/A
Scenario: As a user, Jeff want to do a search for a venue
Given Jeff type something on the search bar
And he submitted it
Then Jeff should see a list of venues
And Jeff sees the icons of the associated categories
icon
enum
for all supported icon size (32
, 44
, 64
, and 88
)key
and url as value
(hashmap
)Pieces needed to construct category icons at various sizes.
Combine prefix with a size (32, 44, 64, and 88 are available) and suffix,
e.g. https://foursquare.com/img/categories/food/default_64.png.
To get an image with a gray background, use bg_ before the size,
e.g. https://foursquare.com/img/categories_v2/food/icecream_bg_32.png.
enum EIconSize {}
interface IIcon {
prefix: string
suffix: string
}
interface IIconUrls {
[EIconSize: string] : string
}
export const getIconUrlList = (icon: IIcon) : IIconUrls => {}
Goal: Increase global code coverage
window.fetch
N/A
N/A
N/A
N/A
In order to have a follow up on code coverage
codecov
test:coverage:report
N/A
N/A
N/A
support asynchronous actions success
Success
button
mock
for responseasyncAction.success
, with created mock as parameter
FormAsyncActions
N/A
interface IProps {
asyncAction: getVenuesSearchAsync | getVenuesExploreAsync
}
N/A
support asynchronous actions failure
Failure
buttonasyncAction.failure
with error: "Unknown error"
FormAsyncActions
N/A
N/A
N/A
N/A
N/A
N/A
N/A
N/A
N/A
N/A
N/A
N/A
N/A
N/A
vscode
prettier
configuration in this folderN/A
N/A
N/A
N/A
Returns a list of recommended venues near the current location. For more robust information about the venues themselves (photos/tips/etc.), please see our venue details endpoint.
fromFetch
getLocationHref
processFetchResponse
and processFetchError
N/A
N/A
Describe the bug
This function getLocationSearch
generate a string, it should handle undefined value and avoid them.
To Reproduce
N/A
Expected behavior
Add this unit test:
expect(getLocationSearch({ param: { name: undefined } })).toEqual(undefined)
Screenshots
N/A
Additional context
N/A
Scenario: As a user, I want to do a search for a venue
Given Jeff type something on the search bar
And he submitted it
Then Jeff should see a list of venues
localStorage
for client appnode-localStorage
for server appGet / Set credentials
client.set(config)
We should do a search like that: getVenuesSearch(payload)
export const CLIENT_ID_KEY = 'apiClientId'
export const CLIENT_SECRET_KEY = 'apiClientSecret'
export interface ICredentials {
[CLIENT_ID_KEY]: string
[CLIENT_SECRET_KEY]: string
}
N/A
Get a list of venues in exploration mode
getVenuesExploreAsync
NRequest
, IVenuesExplorePayloadByPlace
, IVenuesExplorePayloadByLocation
IVenuesExplorePayload
based on query parameters just belowIVenuesExplorePayload
EVenuesAction
getVenuesExploreAsync.success
, NRecommendedPlaces
NVenue.IVenue
ll
near
llAcc
alt
altAcc
radius
section
query
limit
offset
novelty
friendVisits
time
day
lastVenue
openNow
sortByDistance
price
saved
Example of response for GET https://api.foursquare.com/v2/venues/explore
:
{
"meta": {
"code": 200,
"requestId": "5ac51ef86a607143de8eg5cb"
},
"response": {
"warning": {
"text": "There aren't a lot of results near you. Try something more general, reset your filters, or expand the search area."
},
"suggestedRadius": 600,
"headerLocation": "Lower East Side",
"headerFullLocation": "Lower East Side, New York",
"headerLocationGranularity": "neighborhood",
"totalResults": 230,
"suggestedBounds": {
"ne": {
"lat": 40.724216906965616,
"lng": -73.9896507407283
},
"sw": {
"lat": 40.72151724718017,
"lng": -73.98693222860872
}
},
"groups": [
{
"type": "Recommended Places",
"name": "recommended",
"items": [
{
"reasons": {
"count": 0,
"items": [
{
"summary": "This spot is popular",
"type": "general",
"reasonName": "globalInteractionReason"
}
]
},
"venue": {
"id": "49b6e8d2f964a52016531fe3",
"name": "Russ & Daughters",
"location": {
"address": "179 E Houston St",
"crossStreet": "btwn Allen & Orchard St",
"lat": 40.72286707707289,
"lng": -73.98829148466851,
"labeledLatLngs": [
{
"label": "display",
"lat": 40.72286707707289,
"lng": -73.98829148466851
}
],
"distance": 130,
"postalCode": "10002",
"cc": "US",
"city": "New York",
"state": "NY",
"country": "United States",
"formattedAddress": [
"179 E Houston St (btwn Allen & Orchard St)",
"New York, NY 10002",
"United States"
]
},
"categories": [
{
"id": "4bf58dd8d48988d1f5941735",
"name": "Gourmet Shop",
"pluralName": "Gourmet Shops",
"shortName": "Gourmet",
"icon": {
"prefix": "https://ss3.4sqi.net/img/categories_v2/shops/food_gourmet_",
"suffix": ".png"
},
"primary": true
}
],
"venuePage": {
"id": "77298563"
}
}
}
]
}
]
}
}
N/A
If there is no internet connection, every epic should handle error case.
Example:
from(new Promise(...)).pipe(
map(myAction.success),
catchError(pipe(myAction.failure, of)),
takeUntil(action$.pipe(filter(isActionOf(myAction.cancel)))),
)
N/A
N/A
Goal: Increase global code coverage
reducer
N/A
N/A
N/A
N/A
Store the status of the last request in store
createAsyncAction
N/A
N/A
Goal: Increase global code coverage
api.ts
and url.ts
enum
N/A
N/A
N/A
Goal: Increase global code coverage
life.ts
and venues.ts
N/A
N/A
N/A
The idea is to store every action status.
NStatus
statusReducer
action
isLoading
if neededhasError
if neeedeN/A
N/A
N/A
N/A
N/A
adaptGetVenueExplore
payload: NPayload.IPayload<NRecommendedPlaces.IRecommendedPlaces<NVenue.IVenue>>
N/A
N/A
N/A
fromFetch
getLocationHref
processFetchResponse
and processFetchError
N/A
N/A
N/A
N/A
N/A
N/A
N/A
N/A
N/A
N/A
N/A
N/A
N/A
- Technical Debt
http request
), fill credentials in itN/A
N/A
N/A
Don't get credentials from environment variables (process.env
) or localStorage
.
Maybe it's better to find another implementation: Singleton ?
Follow instruction from readme (https://github.com/zalmoxisus/redux-devtools-extension#1-with-redux)
redux-devtools-extension
ts-foursquare-playground
if it worksN/A
N/A
N/A
Goal: Increase global code coverage
EIconSize
testEpic
N/A
N/A
N/A
N/A
Returns a list of recommended venues near the current location. For more robust information about the venues themselves (photos/tips/etc.), please see our venue details endpoint.
getVenuesTrendingAsync
NRequest
, TVenuesTrendingPayload
EVenuesAction
getVenuesTrendingAsync.success
NVenue.IVenue
N/A
<NRequest.TVenuesExplorePayload, NVenue.IVenue[], Error, string>()
N/A
Scenario: As a user, I want to do a search for a venue
Given Jeff type something on the search bar
And he submitted it
Then Jeff should see a list of venues
And Jeff should see venue's location
getVenueLocation
We should do a search like that: getVenueLocation(venueList)
export const getVenueLocation = (venueList: IVenue[]): ILocation => {}
N/A
Returns a list of recommended venues near the current location. For more robust information about the venues themselves (photos/tips/etc.), please see our venue details endpoint.
EApiPathnames
, add endpoint for venue exploregetVenuesTrendingEpic
EVenuesAction.GET_VENUES_TRENDING_SUCCESS
EVenuesAction.GET_VENUES_TRENDING_FAILURE
EVenuesAction.GET_VENUES_TRENDING_CANCEL
N/A
N/A
Scenario: As a user, I want to find a steak house restaurant
Given Jeff type "steak house" on the search bar
And he submitted it
Then Jeff should see a list of venues related to "steak house"
configureStore()
reducers
into store
epics
We should have access to configureStore
, example: import { configureStore } from 'ts-foursquare'
N/A
https://redux.js.org/api/createstore
https://redux.js.org/api/combinereducers
https://redux-observable.js.org/docs/basics/SettingUpTheMiddleware.html
N/A
Scenario: As a user, I want to find a steak house restaurant
Given Jeff type "steak house" on the search bar
And he submitted it
Then Jeff should see a list of venues related to "steak house"
LifeContainer
Life
, which is connected to LifeContainer
putCredentials
when user click on buttonlife.status
in LifeContainer
status |
color |
---|---|
false |
red |
true |
green |
N/A
N/A
N/A
Typescript need type definition for Node.js
@types/node
in devDependencies
N/A
N/A
https://www.npmjs.com/package/@types/node
N/A
N/A
N/A
N/A
N/A
N/A
N/A
support asynchronous actions cancel
Cancel
buttonasyncAction.cancel
with reason: "Action is cancelled by user"
FormAsyncActions
N/A
N/A
We should call getObservableVenuesSearch
with custom parameters.
getObservableVenuesSearch
, pass action.payload
to location params....action.payload,
N/A
N/A
N/A
Describe the bug
lifeSelector
does not work properly
To Reproduce
Use lifeSelector
with a valid state
Expected behavior
It should return whole life state, actually we only have the value of state.life.status
, it should be state.life
. Furthermore it may be interesting to add another selector for state.life.status
(lifeStatusSelector
?).
Additional context
Describe the bug
fix(package): add keywords in npm.com's sidepanel [0,5]
To Reproduce
N/A
Expected behavior
N/A
Screenshots
N/A
Additional context
N/A
Scenario: As a user, I want to find a steak house restaurant
Given Jeff type "steak house" on the search bar
And he submitted it
Then Jeff should see a list of venues related to "steak house"
VenuesSearchContainer
VenuesSearch
, which is connected to VenuesSearchContainer
mapDispatchToProps
and add requestGetVenuesSearch
venues.entities
in VenuesSearch
N/A
N/A
N/A
N/A
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.