-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8bbb51d
commit 68c35dd
Showing
7 changed files
with
82 additions
and
1 deletion.
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
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import {AbstractPrivateEndpoint} from '@/model/endpoint/AbstractPrivateEndpoint'; | ||
import type {CreateDefinition} from '@/model/endpoint/AbstractEndpoint.types'; | ||
import type {User} from './User.types'; | ||
|
||
type GetUserDefinition = CreateDefinition<{ | ||
name: typeof GetUser.name; | ||
response: User[]; | ||
}>; | ||
|
||
/** | ||
* Retrieve single user by id. The endpoint can be called with multiple ids, separated by semicolon. | ||
*/ | ||
export class GetUser extends AbstractPrivateEndpoint<GetUserDefinition> { | ||
public readonly name = 'getUser'; | ||
public readonly path = 'users/:id'; | ||
public readonly property = 'users'; | ||
} |
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 {type CreateDefinition, PaginatedResponse} from '@/model/endpoint/AbstractEndpoint.types'; | ||
import {AbstractPrivateEndpoint} from '@/model/endpoint/AbstractPrivateEndpoint'; | ||
import type {PaginationParameters} from '@/types'; | ||
import type {User} from './User.types'; | ||
|
||
type GetUserDefinition = CreateDefinition<{ | ||
name: typeof GetUsers.name; | ||
parameters: PaginationParameters; | ||
response: PaginatedResponse<User[]>; | ||
}>; | ||
|
||
/** | ||
* Retrieve users. Accepts pagination parameters. | ||
*/ | ||
export class GetUsers extends AbstractPrivateEndpoint<GetUserDefinition> { | ||
public readonly name = 'getUsers'; | ||
public readonly path = 'users'; | ||
public readonly property = 'users'; | ||
} | ||
|
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 @@ | ||
export interface User { | ||
id: number; | ||
account_id: number; | ||
username: string; | ||
created: string; | ||
remember_token: string | null; | ||
all_shop_access: boolean; | ||
sortPayload: number[]; | ||
contact: Contact; | ||
roles: Role[]; | ||
} | ||
|
||
interface Contact { | ||
id: number; | ||
gender: string; | ||
first_name: string; | ||
last_name: string; | ||
email: string; | ||
phone: string | null; | ||
company: string | null; | ||
street: string; | ||
number: string; | ||
number_suffix: string; | ||
box_number: string; | ||
postal_code: string; | ||
city: string; | ||
cc: string | null; | ||
street_additional_info: string; | ||
region: string; | ||
} | ||
|
||
interface Role { | ||
id: number; | ||
description: string; | ||
name: string; | ||
role_type: 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,2 @@ | ||
export * from './GetUser'; | ||
export * from './GetUsers'; |