-
Notifications
You must be signed in to change notification settings - Fork 7
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 #351 from Instanssi/admin-users
admin: Add users panel
- Loading branch information
Showing
26 changed files
with
1,404 additions
and
173 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/* generated using openapi-typescript-codegen -- do not edit */ | ||
/* istanbul ignore file */ | ||
/* tslint:disable */ | ||
/* eslint-disable */ | ||
export type Group = { | ||
name: 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,7 @@ | ||
/* generated using openapi-typescript-codegen -- do not edit */ | ||
/* istanbul ignore file */ | ||
/* tslint:disable */ | ||
/* eslint-disable */ | ||
export type GroupRequest = { | ||
name: 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,15 @@ | ||
/* generated using openapi-typescript-codegen -- do not edit */ | ||
|
||
/* istanbul ignore file */ | ||
|
||
/* tslint:disable */ | ||
|
||
/* eslint-disable */ | ||
import type { User } from "./User"; | ||
|
||
export type PaginatedUserList = { | ||
count: number; | ||
next?: string | null; | ||
previous?: string | null; | ||
results: Array<User>; | ||
}; |
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 @@ | ||
/* generated using openapi-typescript-codegen -- do not edit */ | ||
/* istanbul ignore file */ | ||
/* tslint:disable */ | ||
/* eslint-disable */ | ||
export type PatchedUserRequest = { | ||
/** | ||
* Vaaditaan. Enintään 150 merkkiä. Vain kirjaimet, numerot ja @/./+/-/_ ovat sallittuja. | ||
*/ | ||
username?: string; | ||
first_name?: string; | ||
last_name?: string; | ||
email?: string; | ||
/** | ||
* Määrää, voiko käyttäjä kirjautua sisään. Tällä voi estää käyttäjätilin käytön poistamatta sitä. | ||
*/ | ||
is_active?: boolean; | ||
}; |
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 @@ | ||
/* generated using openapi-typescript-codegen -- do not edit */ | ||
/* istanbul ignore file */ | ||
/* tslint:disable */ | ||
/* eslint-disable */ | ||
export type PermissionRequest = { | ||
name: string; | ||
codename: 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,31 @@ | ||
/* generated using openapi-typescript-codegen -- do not edit */ | ||
|
||
/* istanbul ignore file */ | ||
|
||
/* tslint:disable */ | ||
|
||
/* eslint-disable */ | ||
import type { Group } from "./Group"; | ||
import type { Permission } from "./Permission"; | ||
|
||
export type User = { | ||
readonly id: number; | ||
/** | ||
* Vaaditaan. Enintään 150 merkkiä. Vain kirjaimet, numerot ja @/./+/-/_ ovat sallittuja. | ||
*/ | ||
username: string; | ||
first_name?: string; | ||
last_name?: string; | ||
email?: string; | ||
readonly user_permissions: Array<Permission>; | ||
/** | ||
* Antaa käyttäjälle kaikki oikeudet ilman, että niitä täytyy erikseen luetella. | ||
*/ | ||
readonly is_superuser: boolean; | ||
readonly date_joined: string; | ||
readonly groups: Array<Group>; | ||
/** | ||
* Määrää, voiko käyttäjä kirjautua sisään. Tällä voi estää käyttäjätilin käytön poistamatta sitä. | ||
*/ | ||
is_active?: boolean; | ||
}; |
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 @@ | ||
/* generated using openapi-typescript-codegen -- do not edit */ | ||
/* istanbul ignore file */ | ||
/* tslint:disable */ | ||
/* eslint-disable */ | ||
export type UserRequest = { | ||
/** | ||
* Vaaditaan. Enintään 150 merkkiä. Vain kirjaimet, numerot ja @/./+/-/_ ovat sallittuja. | ||
*/ | ||
username: string; | ||
first_name?: string; | ||
last_name?: string; | ||
email?: string; | ||
/** | ||
* Määrää, voiko käyttäjä kirjautua sisään. Tällä voi estää käyttäjätilin käytön poistamatta sitä. | ||
*/ | ||
is_active?: boolean; | ||
}; |
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,126 @@ | ||
/* generated using openapi-typescript-codegen -- do not edit */ | ||
|
||
/* istanbul ignore file */ | ||
|
||
/* tslint:disable */ | ||
|
||
/* eslint-disable */ | ||
import type { BaseHttpRequest } from "../core/BaseHttpRequest"; | ||
import type { CancelablePromise } from "../core/CancelablePromise"; | ||
import type { PaginatedUserList } from "../models/PaginatedUserList"; | ||
import type { PatchedUserRequest } from "../models/PatchedUserRequest"; | ||
import type { User } from "../models/User"; | ||
import type { UserRequest } from "../models/UserRequest"; | ||
|
||
export class UsersService { | ||
constructor(public readonly httpRequest: BaseHttpRequest) {} | ||
/** | ||
* @param email | ||
* @param limit Number of results to return per page. | ||
* @param offset The initial index from which to return the results. | ||
* @param ordering Which field to use when ordering the results. | ||
* @param search A search term. | ||
* @param username | ||
* @returns PaginatedUserList | ||
* @throws ApiError | ||
*/ | ||
public usersList( | ||
email?: string, | ||
limit?: number, | ||
offset?: number, | ||
ordering?: string, | ||
search?: string, | ||
username?: string | ||
): CancelablePromise<PaginatedUserList> { | ||
return this.httpRequest.request({ | ||
method: "GET", | ||
url: "/api/v2/users/", | ||
query: { | ||
email: email, | ||
limit: limit, | ||
offset: offset, | ||
ordering: ordering, | ||
search: search, | ||
username: username, | ||
}, | ||
}); | ||
} | ||
/** | ||
* @param requestBody | ||
* @returns User | ||
* @throws ApiError | ||
*/ | ||
public usersCreate(requestBody: UserRequest): CancelablePromise<User> { | ||
return this.httpRequest.request({ | ||
method: "POST", | ||
url: "/api/v2/users/", | ||
body: requestBody, | ||
mediaType: "application/json", | ||
}); | ||
} | ||
/** | ||
* @param id A unique integer value identifying this käyttäjä. | ||
* @returns User | ||
* @throws ApiError | ||
*/ | ||
public usersRetrieve(id: number): CancelablePromise<User> { | ||
return this.httpRequest.request({ | ||
method: "GET", | ||
url: "/api/v2/users/{id}/", | ||
path: { | ||
id: id, | ||
}, | ||
}); | ||
} | ||
/** | ||
* @param id A unique integer value identifying this käyttäjä. | ||
* @param requestBody | ||
* @returns User | ||
* @throws ApiError | ||
*/ | ||
public usersUpdate(id: number, requestBody: UserRequest): CancelablePromise<User> { | ||
return this.httpRequest.request({ | ||
method: "PUT", | ||
url: "/api/v2/users/{id}/", | ||
path: { | ||
id: id, | ||
}, | ||
body: requestBody, | ||
mediaType: "application/json", | ||
}); | ||
} | ||
/** | ||
* @param id A unique integer value identifying this käyttäjä. | ||
* @param requestBody | ||
* @returns User | ||
* @throws ApiError | ||
*/ | ||
public usersPartialUpdate( | ||
id: number, | ||
requestBody?: PatchedUserRequest | ||
): CancelablePromise<User> { | ||
return this.httpRequest.request({ | ||
method: "PATCH", | ||
url: "/api/v2/users/{id}/", | ||
path: { | ||
id: id, | ||
}, | ||
body: requestBody, | ||
mediaType: "application/json", | ||
}); | ||
} | ||
/** | ||
* @param id A unique integer value identifying this käyttäjä. | ||
* @returns void | ||
* @throws ApiError | ||
*/ | ||
public usersDestroy(id: number): CancelablePromise<void> { | ||
return this.httpRequest.request({ | ||
method: "DELETE", | ||
url: "/api/v2/users/{id}/", | ||
path: { | ||
id: id, | ||
}, | ||
}); | ||
} | ||
} |
Oops, something went wrong.