-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathauthentication.ts
More file actions
106 lines (97 loc) · 2.93 KB
/
Copy pathauthentication.ts
File metadata and controls
106 lines (97 loc) · 2.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
// File generated from our OpenAPI spec by Scalar. See README.md for details.
import { APIResource } from "../resource";
import { APIPromise } from "../api-promise";
import type { RequestOptions } from "../internal/request-options";
export class Authentication extends APIResource {
/**
* Time to create a user account, eh?
*
* @param {AuthenticationCreateUserParams} [body] - The request body to send.
* @param {RequestOptions} [options] - Options to apply to the request, such as headers and an abort signal.
* @returns {APIPromise<User>} Created
*
* @example
* ```ts
* const user = await client.authentication.createUser();
* ```
*/
createUser(body: AuthenticationCreateUserParams | null | undefined = undefined, options?: RequestOptions): APIPromise<User> {
return this._client.post("/user/signup", { body: body, ...options });
}
/**
* Yeah, this is the boring security stuff. Just get your super secret token and move on.
*
* @param {AuthenticationCreateTokenParams} [body] - The request body to send.
* @param {RequestOptions} [options] - Options to apply to the request, such as headers and an abort signal.
* @returns {APIPromise<AuthenticationCreateTokenResponse>} Token Created
*
* @example
* ```ts
* const createToken = await client.authentication.createToken();
* ```
*/
createToken(body: AuthenticationCreateTokenParams | null | undefined = undefined, options?: RequestOptions): APIPromise<AuthenticationCreateTokenResponse> {
return this._client.post("/auth/token", { body: body, ...options });
}
/**
* Find yourself they say. That's what you can do here.
*
* @param {RequestOptions} [options] - Options to apply to the request, such as headers and an abort signal.
* @returns {APIPromise<User>} OK
*
* @example
* ```ts
* const user = await client.authentication.listMe();
* ```
*/
listMe(options?: RequestOptions): APIPromise<User> {
return this._client.get("/me", options);
}
}
/**
* A user
*/
export interface User {
/**
* @format int64
*/
id?: number;
name?: string;
}
/**
* Credentials to authenticate a user
*/
export interface Credentials {
/**
* @format email
*/
email: string;
}
export interface AuthenticationCreateUserParams {
/**
* @format email
*/
email: string;
password: string;
name?: string;
}
export interface AuthenticationCreateTokenParams {
/**
* @format email
*/
email: string;
password: string;
}
export interface AuthenticationCreateTokenResponse {
token?: string;
}
export declare namespace Authentication {
export {
type User as User,
type Credentials as Credentials,
type AuthenticationCreateTokenResponse as AuthenticationCreateTokenResponse,
type AuthenticationCreateUserParams as AuthenticationCreateUserParams,
type AuthenticationCreateTokenParams as AuthenticationCreateTokenParams,
};
}
export { Authentication as AuthenticationResource };