This repository has been archived by the owner on Nov 22, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
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 #8 from Lyduz/feature/new-project-structure
v1.00 bump stable version release
- Loading branch information
Showing
27 changed files
with
1,864 additions
and
409 deletions.
There are no files selected for viewing
This file was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,5 +9,4 @@ hooks | |
platforms | ||
|
||
# Root Variables | ||
.env | ||
**/.DS_Store |
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,24 +1,27 @@ | ||
import Vue from 'nativescript-vue' | ||
// FIXME: run vue dev tools and enable | ||
//import VueDevtools from 'nativescript-vue-devtools' | ||
import Navigator from 'nativescript-vue-navigator' | ||
import { VNode } from 'vue/types/umd' | ||
|
||
// global dependency | ||
import routes from './router' | ||
import store from './store' | ||
|
||
// main files | ||
import App from './App.vue' | ||
import './styles.scss' | ||
import Navigator from 'nativescript-vue-navigator' | ||
import VueDevtools from 'nativescript-vue-devtools' | ||
|
||
// register global components | ||
Vue.use(Navigator, { routes }) | ||
|
||
if (TNS_ENV !== 'production') { | ||
//Vue.use(VueDevtools); | ||
Vue.use(VueDevtools) | ||
} | ||
|
||
// Prints Vue logs when --env.production is *NOT* set while building | ||
Vue.config.silent = TNS_ENV === 'production' | ||
|
||
new Vue({ | ||
store, | ||
render: (h) => h(App), | ||
render: (h): VNode => h(App), | ||
}).$start() |
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,38 @@ | ||
import { AxiosError, AxiosRequestConfig, AxiosResponse } from 'axios' | ||
import { API, Config } from '@/repository' | ||
import { UserInterface } from './auth.types' | ||
|
||
/** | ||
* AuthAPI class contains http requests for the auth module. | ||
*/ | ||
class AuthAPI extends API { | ||
/** | ||
* @param {AxiosRequestConfig} config | ||
* | ||
* @return | ||
*/ | ||
public constructor(config: AxiosRequestConfig) { | ||
super(config) | ||
} | ||
|
||
/** | ||
* Get all users. | ||
* | ||
* @return {Promise<UserInterface[]>} | ||
*/ | ||
public async getUsers(): Promise<UserInterface[]> { | ||
return await this.get<UserInterface[]>('/users') | ||
.then((response: AxiosResponse<UserInterface[]>) => { | ||
const { data } = response | ||
|
||
const users: UserInterface[] = data | ||
|
||
return users | ||
}) | ||
.catch((error: AxiosError) => { | ||
throw error | ||
}) | ||
} | ||
} | ||
|
||
export const AuthRepository = new AuthAPI(Config) |
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,14 @@ | ||
interface UserAddressInterface { | ||
readonly street: string | ||
readonly suite: string | ||
} | ||
|
||
export interface UserInterface { | ||
readonly id: number | ||
readonly name: string | ||
readonly username: string | ||
readonly email: string | ||
readonly address: UserAddressInterface | ||
readonly phone?: string | ||
readonly website?: string | ||
} |
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 @@ | ||
export { AuthRepository } from './auth.api' |
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
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
Oops, something went wrong.