blanche-client-sdk 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.openapi-generator/FILES +36 -0
- package/.openapi-generator/VERSION +1 -0
- package/.openapi-generator-ignore +23 -0
- package/README.md +127 -0
- package/dist/apis/SessionsApi.d.ts +51 -0
- package/dist/apis/SessionsApi.js +219 -0
- package/dist/apis/UsersApi.d.ts +49 -0
- package/dist/apis/UsersApi.js +215 -0
- package/dist/apis/index.d.ts +2 -0
- package/dist/apis/index.js +20 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +21 -0
- package/dist/models/ApiV1ProfileGet200Response.d.ts +44 -0
- package/dist/models/ApiV1ProfileGet200Response.js +59 -0
- package/dist/models/ApiV1ProfileGet401Response.d.ts +32 -0
- package/dist/models/ApiV1ProfileGet401Response.js +51 -0
- package/dist/models/ApiV1SessionsPost200Response.d.ts +38 -0
- package/dist/models/ApiV1SessionsPost200Response.js +55 -0
- package/dist/models/ApiV1SessionsPost401Response.d.ts +32 -0
- package/dist/models/ApiV1SessionsPost401Response.js +51 -0
- package/dist/models/ApiV1SessionsPostRequest.d.ts +38 -0
- package/dist/models/ApiV1SessionsPostRequest.js +55 -0
- package/dist/models/ApiV1UsersIdPatch200Response.d.ts +44 -0
- package/dist/models/ApiV1UsersIdPatch200Response.js +59 -0
- package/dist/models/ApiV1UsersIdPatchRequest.d.ts +33 -0
- package/dist/models/ApiV1UsersIdPatchRequest.js +52 -0
- package/dist/models/ApiV1UsersIdPatchRequestUser.d.ts +44 -0
- package/dist/models/ApiV1UsersIdPatchRequestUser.js +53 -0
- package/dist/models/ApiV1UsersPost422Response.d.ts +32 -0
- package/dist/models/ApiV1UsersPost422Response.js +51 -0
- package/dist/models/ApiV1UsersPostRequest.d.ts +33 -0
- package/dist/models/ApiV1UsersPostRequest.js +52 -0
- package/dist/models/ApiV1UsersPostRequestUser.d.ts +44 -0
- package/dist/models/ApiV1UsersPostRequestUser.js +59 -0
- package/dist/models/index.d.ts +11 -0
- package/dist/models/index.js +29 -0
- package/dist/runtime.d.ts +184 -0
- package/dist/runtime.js +564 -0
- package/docs/ApiV1ProfileGet200Response.md +38 -0
- package/docs/ApiV1ProfileGet401Response.md +34 -0
- package/docs/ApiV1SessionsPost200Response.md +36 -0
- package/docs/ApiV1SessionsPost401Response.md +34 -0
- package/docs/ApiV1SessionsPostRequest.md +36 -0
- package/docs/ApiV1UsersIdPatch200Response.md +38 -0
- package/docs/ApiV1UsersIdPatchRequest.md +34 -0
- package/docs/ApiV1UsersIdPatchRequestUser.md +38 -0
- package/docs/ApiV1UsersPost422Response.md +34 -0
- package/docs/ApiV1UsersPostRequest.md +34 -0
- package/docs/ApiV1UsersPostRequestUser.md +38 -0
- package/docs/SessionsApi.md +209 -0
- package/docs/UsersApi.md +205 -0
- package/package.json +19 -0
- package/src/apis/SessionsApi.ts +159 -0
- package/src/apis/UsersApi.ts +155 -0
- package/src/apis/index.ts +4 -0
- package/src/index.ts +5 -0
- package/src/models/ApiV1ProfileGet200Response.ts +84 -0
- package/src/models/ApiV1ProfileGet401Response.ts +66 -0
- package/src/models/ApiV1SessionsPost200Response.ts +75 -0
- package/src/models/ApiV1SessionsPost401Response.ts +66 -0
- package/src/models/ApiV1SessionsPostRequest.ts +75 -0
- package/src/models/ApiV1UsersIdPatch200Response.ts +84 -0
- package/src/models/ApiV1UsersIdPatchRequest.ts +74 -0
- package/src/models/ApiV1UsersIdPatchRequestUser.ts +81 -0
- package/src/models/ApiV1UsersPost422Response.ts +66 -0
- package/src/models/ApiV1UsersPostRequest.ts +74 -0
- package/src/models/ApiV1UsersPostRequestUser.ts +84 -0
- package/src/models/index.ts +13 -0
- package/src/runtime.ts +432 -0
- package/tsconfig.json +20 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
|
|
2
|
+
# ApiV1SessionsPost401Response
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type
|
|
8
|
+
------------ | -------------
|
|
9
|
+
`error` | string
|
|
10
|
+
|
|
11
|
+
## Example
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
import type { ApiV1SessionsPost401Response } from 'blanche-client-sdk'
|
|
15
|
+
|
|
16
|
+
// TODO: Update the object below with actual values
|
|
17
|
+
const example = {
|
|
18
|
+
"error": Invalid email or password,
|
|
19
|
+
} satisfies ApiV1SessionsPost401Response
|
|
20
|
+
|
|
21
|
+
console.log(example)
|
|
22
|
+
|
|
23
|
+
// Convert the instance to a JSON string
|
|
24
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
25
|
+
console.log(exampleJSON)
|
|
26
|
+
|
|
27
|
+
// Parse the JSON string back to an object
|
|
28
|
+
const exampleParsed = JSON.parse(exampleJSON) as ApiV1SessionsPost401Response
|
|
29
|
+
console.log(exampleParsed)
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
33
|
+
|
|
34
|
+
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
|
|
2
|
+
# ApiV1SessionsPostRequest
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type
|
|
8
|
+
------------ | -------------
|
|
9
|
+
`email` | string
|
|
10
|
+
`password` | string
|
|
11
|
+
|
|
12
|
+
## Example
|
|
13
|
+
|
|
14
|
+
```typescript
|
|
15
|
+
import type { ApiV1SessionsPostRequest } from 'blanche-client-sdk'
|
|
16
|
+
|
|
17
|
+
// TODO: Update the object below with actual values
|
|
18
|
+
const example = {
|
|
19
|
+
"email": user@example.com,
|
|
20
|
+
"password": password123,
|
|
21
|
+
} satisfies ApiV1SessionsPostRequest
|
|
22
|
+
|
|
23
|
+
console.log(example)
|
|
24
|
+
|
|
25
|
+
// Convert the instance to a JSON string
|
|
26
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
27
|
+
console.log(exampleJSON)
|
|
28
|
+
|
|
29
|
+
// Parse the JSON string back to an object
|
|
30
|
+
const exampleParsed = JSON.parse(exampleJSON) as ApiV1SessionsPostRequest
|
|
31
|
+
console.log(exampleParsed)
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
35
|
+
|
|
36
|
+
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
|
|
2
|
+
# ApiV1UsersIdPatch200Response
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type
|
|
8
|
+
------------ | -------------
|
|
9
|
+
`id` | string
|
|
10
|
+
`email` | string
|
|
11
|
+
`timezone` | string
|
|
12
|
+
|
|
13
|
+
## Example
|
|
14
|
+
|
|
15
|
+
```typescript
|
|
16
|
+
import type { ApiV1UsersIdPatch200Response } from 'blanche-client-sdk'
|
|
17
|
+
|
|
18
|
+
// TODO: Update the object below with actual values
|
|
19
|
+
const example = {
|
|
20
|
+
"id": 0197df79-a142-74e4-b92c-bb3b8f1aae22,
|
|
21
|
+
"email": updated@example.com,
|
|
22
|
+
"timezone": America/New_York,
|
|
23
|
+
} satisfies ApiV1UsersIdPatch200Response
|
|
24
|
+
|
|
25
|
+
console.log(example)
|
|
26
|
+
|
|
27
|
+
// Convert the instance to a JSON string
|
|
28
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
29
|
+
console.log(exampleJSON)
|
|
30
|
+
|
|
31
|
+
// Parse the JSON string back to an object
|
|
32
|
+
const exampleParsed = JSON.parse(exampleJSON) as ApiV1UsersIdPatch200Response
|
|
33
|
+
console.log(exampleParsed)
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
37
|
+
|
|
38
|
+
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
|
|
2
|
+
# ApiV1UsersIdPatchRequest
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type
|
|
8
|
+
------------ | -------------
|
|
9
|
+
`user` | [ApiV1UsersIdPatchRequestUser](ApiV1UsersIdPatchRequestUser.md)
|
|
10
|
+
|
|
11
|
+
## Example
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
import type { ApiV1UsersIdPatchRequest } from 'blanche-client-sdk'
|
|
15
|
+
|
|
16
|
+
// TODO: Update the object below with actual values
|
|
17
|
+
const example = {
|
|
18
|
+
"user": null,
|
|
19
|
+
} satisfies ApiV1UsersIdPatchRequest
|
|
20
|
+
|
|
21
|
+
console.log(example)
|
|
22
|
+
|
|
23
|
+
// Convert the instance to a JSON string
|
|
24
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
25
|
+
console.log(exampleJSON)
|
|
26
|
+
|
|
27
|
+
// Parse the JSON string back to an object
|
|
28
|
+
const exampleParsed = JSON.parse(exampleJSON) as ApiV1UsersIdPatchRequest
|
|
29
|
+
console.log(exampleParsed)
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
33
|
+
|
|
34
|
+
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
|
|
2
|
+
# ApiV1UsersIdPatchRequestUser
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type
|
|
8
|
+
------------ | -------------
|
|
9
|
+
`email` | string
|
|
10
|
+
`password` | string
|
|
11
|
+
`timezone` | string
|
|
12
|
+
|
|
13
|
+
## Example
|
|
14
|
+
|
|
15
|
+
```typescript
|
|
16
|
+
import type { ApiV1UsersIdPatchRequestUser } from 'blanche-client-sdk'
|
|
17
|
+
|
|
18
|
+
// TODO: Update the object below with actual values
|
|
19
|
+
const example = {
|
|
20
|
+
"email": updated@example.com,
|
|
21
|
+
"password": newpassword123,
|
|
22
|
+
"timezone": America/New_York,
|
|
23
|
+
} satisfies ApiV1UsersIdPatchRequestUser
|
|
24
|
+
|
|
25
|
+
console.log(example)
|
|
26
|
+
|
|
27
|
+
// Convert the instance to a JSON string
|
|
28
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
29
|
+
console.log(exampleJSON)
|
|
30
|
+
|
|
31
|
+
// Parse the JSON string back to an object
|
|
32
|
+
const exampleParsed = JSON.parse(exampleJSON) as ApiV1UsersIdPatchRequestUser
|
|
33
|
+
console.log(exampleParsed)
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
37
|
+
|
|
38
|
+
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
|
|
2
|
+
# ApiV1UsersPost422Response
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type
|
|
8
|
+
------------ | -------------
|
|
9
|
+
`errors` | Array<string>
|
|
10
|
+
|
|
11
|
+
## Example
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
import type { ApiV1UsersPost422Response } from 'blanche-client-sdk'
|
|
15
|
+
|
|
16
|
+
// TODO: Update the object below with actual values
|
|
17
|
+
const example = {
|
|
18
|
+
"errors": ["Email can't be blank"],
|
|
19
|
+
} satisfies ApiV1UsersPost422Response
|
|
20
|
+
|
|
21
|
+
console.log(example)
|
|
22
|
+
|
|
23
|
+
// Convert the instance to a JSON string
|
|
24
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
25
|
+
console.log(exampleJSON)
|
|
26
|
+
|
|
27
|
+
// Parse the JSON string back to an object
|
|
28
|
+
const exampleParsed = JSON.parse(exampleJSON) as ApiV1UsersPost422Response
|
|
29
|
+
console.log(exampleParsed)
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
33
|
+
|
|
34
|
+
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
|
|
2
|
+
# ApiV1UsersPostRequest
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type
|
|
8
|
+
------------ | -------------
|
|
9
|
+
`user` | [ApiV1UsersPostRequestUser](ApiV1UsersPostRequestUser.md)
|
|
10
|
+
|
|
11
|
+
## Example
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
import type { ApiV1UsersPostRequest } from 'blanche-client-sdk'
|
|
15
|
+
|
|
16
|
+
// TODO: Update the object below with actual values
|
|
17
|
+
const example = {
|
|
18
|
+
"user": null,
|
|
19
|
+
} satisfies ApiV1UsersPostRequest
|
|
20
|
+
|
|
21
|
+
console.log(example)
|
|
22
|
+
|
|
23
|
+
// Convert the instance to a JSON string
|
|
24
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
25
|
+
console.log(exampleJSON)
|
|
26
|
+
|
|
27
|
+
// Parse the JSON string back to an object
|
|
28
|
+
const exampleParsed = JSON.parse(exampleJSON) as ApiV1UsersPostRequest
|
|
29
|
+
console.log(exampleParsed)
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
33
|
+
|
|
34
|
+
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
|
|
2
|
+
# ApiV1UsersPostRequestUser
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type
|
|
8
|
+
------------ | -------------
|
|
9
|
+
`email` | string
|
|
10
|
+
`password` | string
|
|
11
|
+
`timezone` | string
|
|
12
|
+
|
|
13
|
+
## Example
|
|
14
|
+
|
|
15
|
+
```typescript
|
|
16
|
+
import type { ApiV1UsersPostRequestUser } from 'blanche-client-sdk'
|
|
17
|
+
|
|
18
|
+
// TODO: Update the object below with actual values
|
|
19
|
+
const example = {
|
|
20
|
+
"email": user@example.com,
|
|
21
|
+
"password": password123,
|
|
22
|
+
"timezone": UTC,
|
|
23
|
+
} satisfies ApiV1UsersPostRequestUser
|
|
24
|
+
|
|
25
|
+
console.log(example)
|
|
26
|
+
|
|
27
|
+
// Convert the instance to a JSON string
|
|
28
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
29
|
+
console.log(exampleJSON)
|
|
30
|
+
|
|
31
|
+
// Parse the JSON string back to an object
|
|
32
|
+
const exampleParsed = JSON.parse(exampleJSON) as ApiV1UsersPostRequestUser
|
|
33
|
+
console.log(exampleParsed)
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
37
|
+
|
|
38
|
+
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
# SessionsApi
|
|
2
|
+
|
|
3
|
+
All URIs are relative to *http://localhost:3000*
|
|
4
|
+
|
|
5
|
+
| Method | HTTP request | Description |
|
|
6
|
+
|------------- | ------------- | -------------|
|
|
7
|
+
| [**apiV1SessionsDelete**](SessionsApi.md#apiv1sessionsdelete) | **DELETE** /api/v1/sessions | Logout user and invalidate refresh token |
|
|
8
|
+
| [**apiV1SessionsPost**](SessionsApi.md#apiv1sessionspostoperation) | **POST** /api/v1/sessions | Authenticate user and return tokens |
|
|
9
|
+
| [**apiV1SessionsRefreshPost**](SessionsApi.md#apiv1sessionsrefreshpost) | **POST** /api/v1/sessions/refresh | Refresh tokens using a valid refresh token |
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
## apiV1SessionsDelete
|
|
14
|
+
|
|
15
|
+
> apiV1SessionsDelete(xRefreshToken)
|
|
16
|
+
|
|
17
|
+
Logout user and invalidate refresh token
|
|
18
|
+
|
|
19
|
+
### Example
|
|
20
|
+
|
|
21
|
+
```ts
|
|
22
|
+
import {
|
|
23
|
+
Configuration,
|
|
24
|
+
SessionsApi,
|
|
25
|
+
} from 'blanche-client-sdk';
|
|
26
|
+
import type { ApiV1SessionsDeleteRequest } from 'blanche-client-sdk';
|
|
27
|
+
|
|
28
|
+
async function example() {
|
|
29
|
+
console.log("🚀 Testing blanche-client-sdk SDK...");
|
|
30
|
+
const api = new SessionsApi();
|
|
31
|
+
|
|
32
|
+
const body = {
|
|
33
|
+
// string | JWT refresh token
|
|
34
|
+
xRefreshToken: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...,
|
|
35
|
+
} satisfies ApiV1SessionsDeleteRequest;
|
|
36
|
+
|
|
37
|
+
try {
|
|
38
|
+
const data = await api.apiV1SessionsDelete(body);
|
|
39
|
+
console.log(data);
|
|
40
|
+
} catch (error) {
|
|
41
|
+
console.error(error);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// Run the test
|
|
46
|
+
example().catch(console.error);
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### Parameters
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
| Name | Type | Description | Notes |
|
|
53
|
+
|------------- | ------------- | ------------- | -------------|
|
|
54
|
+
| **xRefreshToken** | `string` | JWT refresh token | [Defaults to `undefined`] |
|
|
55
|
+
|
|
56
|
+
### Return type
|
|
57
|
+
|
|
58
|
+
`void` (Empty response body)
|
|
59
|
+
|
|
60
|
+
### Authorization
|
|
61
|
+
|
|
62
|
+
No authorization required
|
|
63
|
+
|
|
64
|
+
### HTTP request headers
|
|
65
|
+
|
|
66
|
+
- **Content-Type**: Not defined
|
|
67
|
+
- **Accept**: Not defined
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
### HTTP response details
|
|
71
|
+
| Status code | Description | Response headers |
|
|
72
|
+
|-------------|-------------|------------------|
|
|
73
|
+
| **204** | logged out | - |
|
|
74
|
+
| **401** | invalid refresh token | - |
|
|
75
|
+
|
|
76
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
## apiV1SessionsPost
|
|
80
|
+
|
|
81
|
+
> ApiV1SessionsPost200Response apiV1SessionsPost(apiV1SessionsPostRequest)
|
|
82
|
+
|
|
83
|
+
Authenticate user and return tokens
|
|
84
|
+
|
|
85
|
+
### Example
|
|
86
|
+
|
|
87
|
+
```ts
|
|
88
|
+
import {
|
|
89
|
+
Configuration,
|
|
90
|
+
SessionsApi,
|
|
91
|
+
} from 'blanche-client-sdk';
|
|
92
|
+
import type { ApiV1SessionsPostOperationRequest } from 'blanche-client-sdk';
|
|
93
|
+
|
|
94
|
+
async function example() {
|
|
95
|
+
console.log("🚀 Testing blanche-client-sdk SDK...");
|
|
96
|
+
const api = new SessionsApi();
|
|
97
|
+
|
|
98
|
+
const body = {
|
|
99
|
+
// ApiV1SessionsPostRequest (optional)
|
|
100
|
+
apiV1SessionsPostRequest: ...,
|
|
101
|
+
} satisfies ApiV1SessionsPostOperationRequest;
|
|
102
|
+
|
|
103
|
+
try {
|
|
104
|
+
const data = await api.apiV1SessionsPost(body);
|
|
105
|
+
console.log(data);
|
|
106
|
+
} catch (error) {
|
|
107
|
+
console.error(error);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
// Run the test
|
|
112
|
+
example().catch(console.error);
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### Parameters
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
| Name | Type | Description | Notes |
|
|
119
|
+
|------------- | ------------- | ------------- | -------------|
|
|
120
|
+
| **apiV1SessionsPostRequest** | [ApiV1SessionsPostRequest](ApiV1SessionsPostRequest.md) | | [Optional] |
|
|
121
|
+
|
|
122
|
+
### Return type
|
|
123
|
+
|
|
124
|
+
[**ApiV1SessionsPost200Response**](ApiV1SessionsPost200Response.md)
|
|
125
|
+
|
|
126
|
+
### Authorization
|
|
127
|
+
|
|
128
|
+
No authorization required
|
|
129
|
+
|
|
130
|
+
### HTTP request headers
|
|
131
|
+
|
|
132
|
+
- **Content-Type**: `application/json`
|
|
133
|
+
- **Accept**: `application/json`
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
### HTTP response details
|
|
137
|
+
| Status code | Description | Response headers |
|
|
138
|
+
|-------------|-------------|------------------|
|
|
139
|
+
| **200** | tokens returned | - |
|
|
140
|
+
| **401** | invalid credentials | - |
|
|
141
|
+
|
|
142
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
## apiV1SessionsRefreshPost
|
|
146
|
+
|
|
147
|
+
> ApiV1SessionsPost200Response apiV1SessionsRefreshPost(xRefreshToken)
|
|
148
|
+
|
|
149
|
+
Refresh tokens using a valid refresh token
|
|
150
|
+
|
|
151
|
+
### Example
|
|
152
|
+
|
|
153
|
+
```ts
|
|
154
|
+
import {
|
|
155
|
+
Configuration,
|
|
156
|
+
SessionsApi,
|
|
157
|
+
} from 'blanche-client-sdk';
|
|
158
|
+
import type { ApiV1SessionsRefreshPostRequest } from 'blanche-client-sdk';
|
|
159
|
+
|
|
160
|
+
async function example() {
|
|
161
|
+
console.log("🚀 Testing blanche-client-sdk SDK...");
|
|
162
|
+
const api = new SessionsApi();
|
|
163
|
+
|
|
164
|
+
const body = {
|
|
165
|
+
// string | JWT refresh token
|
|
166
|
+
xRefreshToken: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...,
|
|
167
|
+
} satisfies ApiV1SessionsRefreshPostRequest;
|
|
168
|
+
|
|
169
|
+
try {
|
|
170
|
+
const data = await api.apiV1SessionsRefreshPost(body);
|
|
171
|
+
console.log(data);
|
|
172
|
+
} catch (error) {
|
|
173
|
+
console.error(error);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
// Run the test
|
|
178
|
+
example().catch(console.error);
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
### Parameters
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
| Name | Type | Description | Notes |
|
|
185
|
+
|------------- | ------------- | ------------- | -------------|
|
|
186
|
+
| **xRefreshToken** | `string` | JWT refresh token | [Defaults to `undefined`] |
|
|
187
|
+
|
|
188
|
+
### Return type
|
|
189
|
+
|
|
190
|
+
[**ApiV1SessionsPost200Response**](ApiV1SessionsPost200Response.md)
|
|
191
|
+
|
|
192
|
+
### Authorization
|
|
193
|
+
|
|
194
|
+
No authorization required
|
|
195
|
+
|
|
196
|
+
### HTTP request headers
|
|
197
|
+
|
|
198
|
+
- **Content-Type**: Not defined
|
|
199
|
+
- **Accept**: `application/json`
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
### HTTP response details
|
|
203
|
+
| Status code | Description | Response headers |
|
|
204
|
+
|-------------|-------------|------------------|
|
|
205
|
+
| **200** | tokens refreshed | - |
|
|
206
|
+
| **401** | invalid refresh token | - |
|
|
207
|
+
|
|
208
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
209
|
+
|
package/docs/UsersApi.md
ADDED
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
# UsersApi
|
|
2
|
+
|
|
3
|
+
All URIs are relative to *http://localhost:3000*
|
|
4
|
+
|
|
5
|
+
| Method | HTTP request | Description |
|
|
6
|
+
|------------- | ------------- | -------------|
|
|
7
|
+
| [**apiV1ProfileGet**](UsersApi.md#apiv1profileget) | **GET** /api/v1/profile | Get current user profile |
|
|
8
|
+
| [**apiV1UsersIdPatch**](UsersApi.md#apiv1usersidpatchoperation) | **PATCH** /api/v1/users/{id} | Updates a user |
|
|
9
|
+
| [**apiV1UsersPost**](UsersApi.md#apiv1userspostoperation) | **POST** /api/v1/users | Creates a user |
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
## apiV1ProfileGet
|
|
14
|
+
|
|
15
|
+
> ApiV1ProfileGet200Response apiV1ProfileGet()
|
|
16
|
+
|
|
17
|
+
Get current user profile
|
|
18
|
+
|
|
19
|
+
### Example
|
|
20
|
+
|
|
21
|
+
```ts
|
|
22
|
+
import {
|
|
23
|
+
Configuration,
|
|
24
|
+
UsersApi,
|
|
25
|
+
} from 'blanche-client-sdk';
|
|
26
|
+
import type { ApiV1ProfileGetRequest } from 'blanche-client-sdk';
|
|
27
|
+
|
|
28
|
+
async function example() {
|
|
29
|
+
console.log("🚀 Testing blanche-client-sdk SDK...");
|
|
30
|
+
const api = new UsersApi();
|
|
31
|
+
|
|
32
|
+
try {
|
|
33
|
+
const data = await api.apiV1ProfileGet();
|
|
34
|
+
console.log(data);
|
|
35
|
+
} catch (error) {
|
|
36
|
+
console.error(error);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// Run the test
|
|
41
|
+
example().catch(console.error);
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### Parameters
|
|
45
|
+
|
|
46
|
+
This endpoint does not need any parameter.
|
|
47
|
+
|
|
48
|
+
### Return type
|
|
49
|
+
|
|
50
|
+
[**ApiV1ProfileGet200Response**](ApiV1ProfileGet200Response.md)
|
|
51
|
+
|
|
52
|
+
### Authorization
|
|
53
|
+
|
|
54
|
+
No authorization required
|
|
55
|
+
|
|
56
|
+
### HTTP request headers
|
|
57
|
+
|
|
58
|
+
- **Content-Type**: Not defined
|
|
59
|
+
- **Accept**: `application/json`
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
### HTTP response details
|
|
63
|
+
| Status code | Description | Response headers |
|
|
64
|
+
|-------------|-------------|------------------|
|
|
65
|
+
| **200** | profile returned | - |
|
|
66
|
+
| **401** | unauthorized | - |
|
|
67
|
+
|
|
68
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
## apiV1UsersIdPatch
|
|
72
|
+
|
|
73
|
+
> ApiV1UsersIdPatch200Response apiV1UsersIdPatch(id, apiV1UsersIdPatchRequest)
|
|
74
|
+
|
|
75
|
+
Updates a user
|
|
76
|
+
|
|
77
|
+
### Example
|
|
78
|
+
|
|
79
|
+
```ts
|
|
80
|
+
import {
|
|
81
|
+
Configuration,
|
|
82
|
+
UsersApi,
|
|
83
|
+
} from 'blanche-client-sdk';
|
|
84
|
+
import type { ApiV1UsersIdPatchOperationRequest } from 'blanche-client-sdk';
|
|
85
|
+
|
|
86
|
+
async function example() {
|
|
87
|
+
console.log("🚀 Testing blanche-client-sdk SDK...");
|
|
88
|
+
const api = new UsersApi();
|
|
89
|
+
|
|
90
|
+
const body = {
|
|
91
|
+
// string | User ID
|
|
92
|
+
id: id_example,
|
|
93
|
+
// ApiV1UsersIdPatchRequest (optional)
|
|
94
|
+
apiV1UsersIdPatchRequest: ...,
|
|
95
|
+
} satisfies ApiV1UsersIdPatchOperationRequest;
|
|
96
|
+
|
|
97
|
+
try {
|
|
98
|
+
const data = await api.apiV1UsersIdPatch(body);
|
|
99
|
+
console.log(data);
|
|
100
|
+
} catch (error) {
|
|
101
|
+
console.error(error);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
// Run the test
|
|
106
|
+
example().catch(console.error);
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### Parameters
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
| Name | Type | Description | Notes |
|
|
113
|
+
|------------- | ------------- | ------------- | -------------|
|
|
114
|
+
| **id** | `string` | User ID | [Defaults to `undefined`] |
|
|
115
|
+
| **apiV1UsersIdPatchRequest** | [ApiV1UsersIdPatchRequest](ApiV1UsersIdPatchRequest.md) | | [Optional] |
|
|
116
|
+
|
|
117
|
+
### Return type
|
|
118
|
+
|
|
119
|
+
[**ApiV1UsersIdPatch200Response**](ApiV1UsersIdPatch200Response.md)
|
|
120
|
+
|
|
121
|
+
### Authorization
|
|
122
|
+
|
|
123
|
+
No authorization required
|
|
124
|
+
|
|
125
|
+
### HTTP request headers
|
|
126
|
+
|
|
127
|
+
- **Content-Type**: `application/json`
|
|
128
|
+
- **Accept**: `application/json`
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
### HTTP response details
|
|
132
|
+
| Status code | Description | Response headers |
|
|
133
|
+
|-------------|-------------|------------------|
|
|
134
|
+
| **200** | user updated | - |
|
|
135
|
+
| **401** | unauthorized | - |
|
|
136
|
+
| **422** | invalid request | - |
|
|
137
|
+
|
|
138
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
## apiV1UsersPost
|
|
142
|
+
|
|
143
|
+
> ApiV1ProfileGet200Response apiV1UsersPost(apiV1UsersPostRequest)
|
|
144
|
+
|
|
145
|
+
Creates a user
|
|
146
|
+
|
|
147
|
+
### Example
|
|
148
|
+
|
|
149
|
+
```ts
|
|
150
|
+
import {
|
|
151
|
+
Configuration,
|
|
152
|
+
UsersApi,
|
|
153
|
+
} from 'blanche-client-sdk';
|
|
154
|
+
import type { ApiV1UsersPostOperationRequest } from 'blanche-client-sdk';
|
|
155
|
+
|
|
156
|
+
async function example() {
|
|
157
|
+
console.log("🚀 Testing blanche-client-sdk SDK...");
|
|
158
|
+
const api = new UsersApi();
|
|
159
|
+
|
|
160
|
+
const body = {
|
|
161
|
+
// ApiV1UsersPostRequest (optional)
|
|
162
|
+
apiV1UsersPostRequest: ...,
|
|
163
|
+
} satisfies ApiV1UsersPostOperationRequest;
|
|
164
|
+
|
|
165
|
+
try {
|
|
166
|
+
const data = await api.apiV1UsersPost(body);
|
|
167
|
+
console.log(data);
|
|
168
|
+
} catch (error) {
|
|
169
|
+
console.error(error);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
// Run the test
|
|
174
|
+
example().catch(console.error);
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
### Parameters
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
| Name | Type | Description | Notes |
|
|
181
|
+
|------------- | ------------- | ------------- | -------------|
|
|
182
|
+
| **apiV1UsersPostRequest** | [ApiV1UsersPostRequest](ApiV1UsersPostRequest.md) | | [Optional] |
|
|
183
|
+
|
|
184
|
+
### Return type
|
|
185
|
+
|
|
186
|
+
[**ApiV1ProfileGet200Response**](ApiV1ProfileGet200Response.md)
|
|
187
|
+
|
|
188
|
+
### Authorization
|
|
189
|
+
|
|
190
|
+
No authorization required
|
|
191
|
+
|
|
192
|
+
### HTTP request headers
|
|
193
|
+
|
|
194
|
+
- **Content-Type**: `application/json`
|
|
195
|
+
- **Accept**: `application/json`
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
### HTTP response details
|
|
199
|
+
| Status code | Description | Response headers |
|
|
200
|
+
|-------------|-------------|------------------|
|
|
201
|
+
| **201** | user created | - |
|
|
202
|
+
| **422** | invalid request | - |
|
|
203
|
+
|
|
204
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
205
|
+
|