-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23 from dscdut/feat/change_to_mapbox
feat: change to mapbox
- Loading branch information
Showing
14 changed files
with
279 additions
and
117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,50 @@ | ||
# development | production | ||
NODE_ENV=development | ||
|
||
PORT=3000 | ||
|
||
API_VERSION=v1.0.0 | ||
|
||
# Examples: all, ["error", "info", "log", "migration", "query", "schema", "warn"] | ||
SYSTEM_LOG_INFO=all | ||
|
||
# JWT Authentication Strategy | ||
JWT_SECRET=e267edf0f1a4a62d496a6738aed12266fd1f17136f1d019c88b57e5439855307458b0a2652a5bb6246f636ff265ad2be7c193d155ce46df6e7287de143b2f55b | ||
JWT_EXPIRES_IN=1d | ||
|
||
# TypeORM config | ||
TYPEORM_HOST=localhost | ||
TYPEORM_PORT=5432 | ||
TYPEORM_USERNAME=postgres | ||
TYPEORM_PASSWORD=postgres | ||
TYPEORM_DATABASE=MapSorter | ||
|
||
# Google OAuth2 | ||
GOOGLE_CLIENT_ID= | ||
GOOGLE_CLIENT_SECRET= | ||
GOOGLE_CALLBACK_URL= | ||
|
||
# Cloudinary | ||
CLOUDINARY_NAME= | ||
CLOUDINARY_API_KEY= | ||
CLOUDINARY_API_SECRET= | ||
|
||
# Local Storage | ||
STORAGE_TYPE=local | ||
LOCAL_STORAGE_PATH=/uploads/media | ||
LIMIT_FILE_UPLOAD=10 | ||
MAX_FILE_SIZE=5242880 # 5mb | ||
|
||
# Google Maps API | ||
GOOGLE_MAPS_API_KEY= | ||
|
||
# Sentry | ||
SENTRY_DSN= | ||
|
||
# Discord bot | ||
DISCORD_WEBHOOK= | ||
DISCORD_BOT_NAME= | ||
DISCORD_BOT_AVATAR_URL= | ||
# development | production | ||
NODE_ENV=development | ||
|
||
PORT=3000 | ||
|
||
API_VERSION=v1.0.0 | ||
|
||
# Examples: all, ["error", "info", "log", "migration", "query", "schema", "warn"] | ||
SYSTEM_LOG_INFO=all | ||
|
||
# JWT Authentication Strategy | ||
JWT_SECRET=e267edf0f1a4a62d496a6738aed12266fd1f17136f1d019c88b57e5439855307458b0a2652a5bb6246f636ff265ad2be7c193d155ce46df6e7287de143b2f55b | ||
JWT_EXPIRES_IN=1d | ||
|
||
# TypeORM config | ||
TYPEORM_HOST=localhost | ||
TYPEORM_PORT=5432 | ||
TYPEORM_USERNAME=postgres | ||
TYPEORM_PASSWORD=postgres | ||
TYPEORM_DATABASE=MapSorter | ||
|
||
# Google OAuth2 | ||
GOOGLE_CLIENT_ID= | ||
GOOGLE_CLIENT_SECRET= | ||
GOOGLE_CALLBACK_URL= | ||
|
||
# Cloudinary | ||
CLOUDINARY_NAME= | ||
CLOUDINARY_API_KEY= | ||
CLOUDINARY_API_SECRET= | ||
|
||
# Local Storage | ||
STORAGE_TYPE=local | ||
LOCAL_STORAGE_PATH=/uploads/media | ||
LIMIT_FILE_UPLOAD=10 | ||
MAX_FILE_SIZE=5242880 # 5mb | ||
|
||
# Google Maps API | ||
GOOGLE_MAPS_API_KEY= | ||
|
||
# MapBox API | ||
MAPBOX_TOKEN= | ||
|
||
# Sentry | ||
SENTRY_DSN= | ||
|
||
# Discord bot | ||
DISCORD_WEBHOOK= | ||
DISCORD_BOT_NAME= | ||
DISCORD_BOT_AVATAR_URL= |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
export const WAYPOINT_LIMIT = 23; | ||
export const WAYPOINT_LIMIT = 12; |
1 change: 0 additions & 1 deletion
1
src/modules/maps/services/dtos/directions-response.interface.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
src/modules/maps/services/dtos/providers/mapbox/mapbox-directions-request.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { IDirectionsRequest } from '../../directions-request.interface'; | ||
import { ApiKeyParams } from '@modules/maps/services/api-key-param.interface'; | ||
|
||
export class MapBoxDirectionsRequest implements IDirectionsRequest { | ||
params: { | ||
origin: { | ||
lat: number; | ||
lng: number; | ||
}; | ||
destination: { | ||
lat: number; | ||
lng: number; | ||
}; | ||
waypoints?: { | ||
lat: number; | ||
lng: number; | ||
}[]; | ||
optimize?: boolean; | ||
} & ApiKeyParams; | ||
} |
19 changes: 19 additions & 0 deletions
19
src/modules/maps/services/dtos/providers/mapbox/mapbox-directions-response.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { IDirectionsResponse } from '../../directions-response.interface'; | ||
|
||
export interface WaypointsResponseData { | ||
distance?: number; | ||
name?: string; | ||
location: [number, number]; | ||
waypoint_index: number; | ||
} | ||
|
||
export class MapBoxDirectionsResponse implements IDirectionsResponse { | ||
data: { | ||
status: string; | ||
routes: { | ||
waypoints?: WaypointsResponseData; | ||
legs: []; | ||
overview_polyline: string; | ||
}[]; | ||
}; | ||
} |
7 changes: 7 additions & 0 deletions
7
src/modules/maps/services/dtos/providers/mapbox/mapbox-geocode-request.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { ApiKeyParams } from '@modules/maps/services/api-key-param.interface'; | ||
import { IGeocodeRequest } from '../../geocode-request.interface'; | ||
export class MapBoxGeocodeRequest implements IGeocodeRequest { | ||
params: { | ||
address?: string; | ||
} & ApiKeyParams; | ||
} |
8 changes: 8 additions & 0 deletions
8
src/modules/maps/services/dtos/providers/mapbox/mapbox-geocode-response.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { | ||
IGeocodeResponse, | ||
IGeocodeResponseData, | ||
} from '../../geocode-response.interface'; | ||
|
||
export class MapBoxGeocodeResponse implements IGeocodeResponse { | ||
data: IGeocodeResponseData; | ||
} |
Oops, something went wrong.