@rebornteam/reborn-api 2.6.4 → 2.7.0
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 +8 -1
- package/README.md +19 -5
- package/api.ts +910 -127
- package/base.ts +1 -1
- package/common.ts +1 -1
- package/configuration.ts +1 -1
- package/dist/api.d.ts +448 -69
- package/dist/api.js +823 -111
- package/dist/base.d.ts +1 -1
- package/dist/base.js +1 -1
- package/dist/common.d.ts +1 -1
- package/dist/common.js +1 -1
- package/dist/configuration.d.ts +1 -1
- package/dist/configuration.js +1 -1
- package/dist/esm/api.d.ts +448 -69
- package/dist/esm/api.js +806 -102
- package/dist/esm/base.d.ts +1 -1
- package/dist/esm/base.js +1 -1
- package/dist/esm/common.d.ts +1 -1
- package/dist/esm/common.js +1 -1
- package/dist/esm/configuration.d.ts +1 -1
- package/dist/esm/configuration.js +1 -1
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/docs/AuthenticationApi.md +167 -0
- package/docs/ChatApi.md +121 -0
- package/docs/ChatMessageDTO.md +30 -0
- package/docs/ChatMessageRequest.md +26 -0
- package/docs/PlayerApi.md +56 -3
- package/docs/ServerRegisterRequest.md +24 -0
- package/docs/ServerSessionDTO.md +36 -0
- package/docs/ServerSessionsApi.md +261 -0
- package/docs/TokenRequest.md +24 -0
- package/index.ts +1 -1
- package/package.json +1 -1
- package/docs/DefaultApi.md +0 -105
package/dist/esm/base.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Reborn API
|
|
3
3
|
* The Reborn API serves as the central backend for the platform, orchestrating secure communication between game clients and data services. This API supports two authentication methods: - **OAuth 2.0 Client Credentials**: For programmatic API access - **Discord SSO Bearer Token**: For admin endpoints requiring Discord authentication
|
|
4
4
|
*
|
|
5
|
-
* The version of the OpenAPI document: 2.
|
|
5
|
+
* The version of the OpenAPI document: 2.7.0
|
|
6
6
|
*
|
|
7
7
|
*
|
|
8
8
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
package/dist/esm/base.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Reborn API
|
|
5
5
|
* The Reborn API serves as the central backend for the platform, orchestrating secure communication between game clients and data services. This API supports two authentication methods: - **OAuth 2.0 Client Credentials**: For programmatic API access - **Discord SSO Bearer Token**: For admin endpoints requiring Discord authentication
|
|
6
6
|
*
|
|
7
|
-
* The version of the OpenAPI document: 2.
|
|
7
|
+
* The version of the OpenAPI document: 2.7.0
|
|
8
8
|
*
|
|
9
9
|
*
|
|
10
10
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
package/dist/esm/common.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Reborn API
|
|
3
3
|
* The Reborn API serves as the central backend for the platform, orchestrating secure communication between game clients and data services. This API supports two authentication methods: - **OAuth 2.0 Client Credentials**: For programmatic API access - **Discord SSO Bearer Token**: For admin endpoints requiring Discord authentication
|
|
4
4
|
*
|
|
5
|
-
* The version of the OpenAPI document: 2.
|
|
5
|
+
* The version of the OpenAPI document: 2.7.0
|
|
6
6
|
*
|
|
7
7
|
*
|
|
8
8
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
package/dist/esm/common.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Reborn API
|
|
5
5
|
* The Reborn API serves as the central backend for the platform, orchestrating secure communication between game clients and data services. This API supports two authentication methods: - **OAuth 2.0 Client Credentials**: For programmatic API access - **Discord SSO Bearer Token**: For admin endpoints requiring Discord authentication
|
|
6
6
|
*
|
|
7
|
-
* The version of the OpenAPI document: 2.
|
|
7
|
+
* The version of the OpenAPI document: 2.7.0
|
|
8
8
|
*
|
|
9
9
|
*
|
|
10
10
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Reborn API
|
|
3
3
|
* The Reborn API serves as the central backend for the platform, orchestrating secure communication between game clients and data services. This API supports two authentication methods: - **OAuth 2.0 Client Credentials**: For programmatic API access - **Discord SSO Bearer Token**: For admin endpoints requiring Discord authentication
|
|
4
4
|
*
|
|
5
|
-
* The version of the OpenAPI document: 2.
|
|
5
|
+
* The version of the OpenAPI document: 2.7.0
|
|
6
6
|
*
|
|
7
7
|
*
|
|
8
8
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Reborn API
|
|
4
4
|
* The Reborn API serves as the central backend for the platform, orchestrating secure communication between game clients and data services. This API supports two authentication methods: - **OAuth 2.0 Client Credentials**: For programmatic API access - **Discord SSO Bearer Token**: For admin endpoints requiring Discord authentication
|
|
5
5
|
*
|
|
6
|
-
* The version of the OpenAPI document: 2.
|
|
6
|
+
* The version of the OpenAPI document: 2.7.0
|
|
7
7
|
*
|
|
8
8
|
*
|
|
9
9
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Reborn API
|
|
3
3
|
* The Reborn API serves as the central backend for the platform, orchestrating secure communication between game clients and data services. This API supports two authentication methods: - **OAuth 2.0 Client Credentials**: For programmatic API access - **Discord SSO Bearer Token**: For admin endpoints requiring Discord authentication
|
|
4
4
|
*
|
|
5
|
-
* The version of the OpenAPI document: 2.
|
|
5
|
+
* The version of the OpenAPI document: 2.7.0
|
|
6
6
|
*
|
|
7
7
|
*
|
|
8
8
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
package/dist/esm/index.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Reborn API
|
|
5
5
|
* The Reborn API serves as the central backend for the platform, orchestrating secure communication between game clients and data services. This API supports two authentication methods: - **OAuth 2.0 Client Credentials**: For programmatic API access - **Discord SSO Bearer Token**: For admin endpoints requiring Discord authentication
|
|
6
6
|
*
|
|
7
|
-
* The version of the OpenAPI document: 2.
|
|
7
|
+
* The version of the OpenAPI document: 2.7.0
|
|
8
8
|
*
|
|
9
9
|
*
|
|
10
10
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Reborn API
|
|
3
3
|
* The Reborn API serves as the central backend for the platform, orchestrating secure communication between game clients and data services. This API supports two authentication methods: - **OAuth 2.0 Client Credentials**: For programmatic API access - **Discord SSO Bearer Token**: For admin endpoints requiring Discord authentication
|
|
4
4
|
*
|
|
5
|
-
* The version of the OpenAPI document: 2.
|
|
5
|
+
* The version of the OpenAPI document: 2.7.0
|
|
6
6
|
*
|
|
7
7
|
*
|
|
8
8
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
package/dist/index.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Reborn API
|
|
6
6
|
* The Reborn API serves as the central backend for the platform, orchestrating secure communication between game clients and data services. This API supports two authentication methods: - **OAuth 2.0 Client Credentials**: For programmatic API access - **Discord SSO Bearer Token**: For admin endpoints requiring Discord authentication
|
|
7
7
|
*
|
|
8
|
-
* The version of the OpenAPI document: 2.
|
|
8
|
+
* The version of the OpenAPI document: 2.7.0
|
|
9
9
|
*
|
|
10
10
|
*
|
|
11
11
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
# AuthenticationApi
|
|
2
|
+
|
|
3
|
+
All URIs are relative to *https://api.smsh.sh*
|
|
4
|
+
|
|
5
|
+
|Method | HTTP request | Description|
|
|
6
|
+
|------------- | ------------- | -------------|
|
|
7
|
+
|[**callback**](#callback) | **GET** /auth/discord/callback | Discord - OAuth2 callback|
|
|
8
|
+
|[**initiateLogin**](#initiatelogin) | **GET** /auth/discord | Discord - Initiate login|
|
|
9
|
+
|[**token**](#token) | **POST** /oauth/token | Service - Exchange client credentials for token|
|
|
10
|
+
|
|
11
|
+
# **callback**
|
|
12
|
+
> callback()
|
|
13
|
+
|
|
14
|
+
Receives the authorization code from Discord after the user approves the OAuth2 prompt. Exchanges the code for an access token, verifies the user holds an admin guild role, then redirects back to the admin frontend with a signed JWT in the query string (`?token=...`). On failure, redirects with `?error=<reason>` instead.
|
|
15
|
+
|
|
16
|
+
### Example
|
|
17
|
+
|
|
18
|
+
```typescript
|
|
19
|
+
import {
|
|
20
|
+
AuthenticationApi,
|
|
21
|
+
Configuration
|
|
22
|
+
} from '@rebornteam/reborn-api';
|
|
23
|
+
|
|
24
|
+
const configuration = new Configuration();
|
|
25
|
+
const apiInstance = new AuthenticationApi(configuration);
|
|
26
|
+
|
|
27
|
+
let code: string; //Authorization code provided by Discord on successful approval (optional) (default to undefined)
|
|
28
|
+
let error: string; //Error code provided by Discord if the user denied access (optional) (default to undefined)
|
|
29
|
+
|
|
30
|
+
const { status, data } = await apiInstance.callback(
|
|
31
|
+
code,
|
|
32
|
+
error
|
|
33
|
+
);
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### Parameters
|
|
37
|
+
|
|
38
|
+
|Name | Type | Description | Notes|
|
|
39
|
+
|------------- | ------------- | ------------- | -------------|
|
|
40
|
+
| **code** | [**string**] | Authorization code provided by Discord on successful approval | (optional) defaults to undefined|
|
|
41
|
+
| **error** | [**string**] | Error code provided by Discord if the user denied access | (optional) defaults to undefined|
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
### Return type
|
|
45
|
+
|
|
46
|
+
void (empty response body)
|
|
47
|
+
|
|
48
|
+
### Authorization
|
|
49
|
+
|
|
50
|
+
[DiscordAuth](../README.md#DiscordAuth)
|
|
51
|
+
|
|
52
|
+
### HTTP request headers
|
|
53
|
+
|
|
54
|
+
- **Content-Type**: Not defined
|
|
55
|
+
- **Accept**: Not defined
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
### HTTP response details
|
|
59
|
+
| Status code | Description | Response headers |
|
|
60
|
+
|-------------|-------------|------------------|
|
|
61
|
+
|**302** | Redirect to admin frontend with `?token=<jwt>` on success or `?error=<reason>` on failure | - |
|
|
62
|
+
|
|
63
|
+
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
|
64
|
+
|
|
65
|
+
# **initiateLogin**
|
|
66
|
+
> initiateLogin()
|
|
67
|
+
|
|
68
|
+
Redirects the browser to Discord\'s OAuth2 authorization page. Not called directly — the admin frontend navigates to this URL to begin the login flow.
|
|
69
|
+
|
|
70
|
+
### Example
|
|
71
|
+
|
|
72
|
+
```typescript
|
|
73
|
+
import {
|
|
74
|
+
AuthenticationApi,
|
|
75
|
+
Configuration
|
|
76
|
+
} from '@rebornteam/reborn-api';
|
|
77
|
+
|
|
78
|
+
const configuration = new Configuration();
|
|
79
|
+
const apiInstance = new AuthenticationApi(configuration);
|
|
80
|
+
|
|
81
|
+
const { status, data } = await apiInstance.initiateLogin();
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### Parameters
|
|
85
|
+
This endpoint does not have any parameters.
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
### Return type
|
|
89
|
+
|
|
90
|
+
void (empty response body)
|
|
91
|
+
|
|
92
|
+
### Authorization
|
|
93
|
+
|
|
94
|
+
[DiscordAuth](../README.md#DiscordAuth)
|
|
95
|
+
|
|
96
|
+
### HTTP request headers
|
|
97
|
+
|
|
98
|
+
- **Content-Type**: Not defined
|
|
99
|
+
- **Accept**: Not defined
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
### HTTP response details
|
|
103
|
+
| Status code | Description | Response headers |
|
|
104
|
+
|-------------|-------------|------------------|
|
|
105
|
+
|**302** | Redirect to Discord authorization URL | - |
|
|
106
|
+
|
|
107
|
+
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
|
108
|
+
|
|
109
|
+
# **token**
|
|
110
|
+
> object token()
|
|
111
|
+
|
|
112
|
+
Exchange service client credentials for a Bearer JWT using the OAuth2 client_credentials grant. Used by game server plugins to authenticate against the API.
|
|
113
|
+
|
|
114
|
+
### Example
|
|
115
|
+
|
|
116
|
+
```typescript
|
|
117
|
+
import {
|
|
118
|
+
AuthenticationApi,
|
|
119
|
+
Configuration
|
|
120
|
+
} from '@rebornteam/reborn-api';
|
|
121
|
+
|
|
122
|
+
const configuration = new Configuration();
|
|
123
|
+
const apiInstance = new AuthenticationApi(configuration);
|
|
124
|
+
|
|
125
|
+
let grantType: string; // (optional) (default to undefined)
|
|
126
|
+
let clientId: string; // (optional) (default to undefined)
|
|
127
|
+
let clientSecret: string; // (optional) (default to undefined)
|
|
128
|
+
|
|
129
|
+
const { status, data } = await apiInstance.token(
|
|
130
|
+
grantType,
|
|
131
|
+
clientId,
|
|
132
|
+
clientSecret
|
|
133
|
+
);
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
### Parameters
|
|
137
|
+
|
|
138
|
+
|Name | Type | Description | Notes|
|
|
139
|
+
|------------- | ------------- | ------------- | -------------|
|
|
140
|
+
| **grantType** | [**string**] | | (optional) defaults to undefined|
|
|
141
|
+
| **clientId** | [**string**] | | (optional) defaults to undefined|
|
|
142
|
+
| **clientSecret** | [**string**] | | (optional) defaults to undefined|
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
### Return type
|
|
146
|
+
|
|
147
|
+
**object**
|
|
148
|
+
|
|
149
|
+
### Authorization
|
|
150
|
+
|
|
151
|
+
[DiscordAuth](../README.md#DiscordAuth)
|
|
152
|
+
|
|
153
|
+
### HTTP request headers
|
|
154
|
+
|
|
155
|
+
- **Content-Type**: application/x-www-form-urlencoded, application/json
|
|
156
|
+
- **Accept**: application/json
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
### HTTP response details
|
|
160
|
+
| Status code | Description | Response headers |
|
|
161
|
+
|-------------|-------------|------------------|
|
|
162
|
+
|**200** | Token generated successfully | - |
|
|
163
|
+
|**400** | Invalid request | - |
|
|
164
|
+
|**401** | Invalid credentials | - |
|
|
165
|
+
|
|
166
|
+
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
|
167
|
+
|
package/docs/ChatApi.md
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
# ChatApi
|
|
2
|
+
|
|
3
|
+
All URIs are relative to *https://api.smsh.sh*
|
|
4
|
+
|
|
5
|
+
|Method | HTTP request | Description|
|
|
6
|
+
|------------- | ------------- | -------------|
|
|
7
|
+
|[**history**](#history) | **GET** /v1/chat | Get chat history|
|
|
8
|
+
|[**ingest**](#ingest) | **POST** /v1/chat | Ingest a chat message|
|
|
9
|
+
|
|
10
|
+
# **history**
|
|
11
|
+
> Array<ChatMessageDTO> history()
|
|
12
|
+
|
|
13
|
+
Returns up to `limit` chat messages before the given `before` timestamp (keyset pagination). Results are returned in ascending chronological order. Omit `before` to start from the current time. Scroll back through history by passing the `sentAt` of the oldest message received as the next `before` value.
|
|
14
|
+
|
|
15
|
+
### Example
|
|
16
|
+
|
|
17
|
+
```typescript
|
|
18
|
+
import {
|
|
19
|
+
ChatApi,
|
|
20
|
+
Configuration
|
|
21
|
+
} from '@rebornteam/reborn-api';
|
|
22
|
+
|
|
23
|
+
const configuration = new Configuration();
|
|
24
|
+
const apiInstance = new ChatApi(configuration);
|
|
25
|
+
|
|
26
|
+
let limit: number; //Maximum number of messages to return (1–100) (default to 50)
|
|
27
|
+
let sessionId: string; //Filter to a specific server session. Omit for global history. (optional) (default to undefined)
|
|
28
|
+
let before: string; //ISO-8601 timestamp cursor — return messages sent before this time. Omit to start from now. (optional) (default to undefined)
|
|
29
|
+
|
|
30
|
+
const { status, data } = await apiInstance.history(
|
|
31
|
+
limit,
|
|
32
|
+
sessionId,
|
|
33
|
+
before
|
|
34
|
+
);
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### Parameters
|
|
38
|
+
|
|
39
|
+
|Name | Type | Description | Notes|
|
|
40
|
+
|------------- | ------------- | ------------- | -------------|
|
|
41
|
+
| **limit** | [**number**] | Maximum number of messages to return (1–100) | defaults to 50|
|
|
42
|
+
| **sessionId** | [**string**] | Filter to a specific server session. Omit for global history. | (optional) defaults to undefined|
|
|
43
|
+
| **before** | [**string**] | ISO-8601 timestamp cursor — return messages sent before this time. Omit to start from now. | (optional) defaults to undefined|
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
### Return type
|
|
47
|
+
|
|
48
|
+
**Array<ChatMessageDTO>**
|
|
49
|
+
|
|
50
|
+
### Authorization
|
|
51
|
+
|
|
52
|
+
[DiscordAuth](../README.md#DiscordAuth)
|
|
53
|
+
|
|
54
|
+
### HTTP request headers
|
|
55
|
+
|
|
56
|
+
- **Content-Type**: Not defined
|
|
57
|
+
- **Accept**: application/json
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
### HTTP response details
|
|
61
|
+
| Status code | Description | Response headers |
|
|
62
|
+
|-------------|-------------|------------------|
|
|
63
|
+
|**200** | List of chat messages in ascending chronological order | - |
|
|
64
|
+
|**401** | Unauthorized | - |
|
|
65
|
+
|
|
66
|
+
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
|
67
|
+
|
|
68
|
+
# **ingest**
|
|
69
|
+
> ChatMessageDTO ingest(chatMessageRequest)
|
|
70
|
+
|
|
71
|
+
Stores a chat message from a game server and fans it out to all connected WebSocket clients via PostgreSQL LISTEN/NOTIFY. The session must be currently online. Only the player UUID is stored — usernames are resolved on the web UI from the player database cache.
|
|
72
|
+
|
|
73
|
+
### Example
|
|
74
|
+
|
|
75
|
+
```typescript
|
|
76
|
+
import {
|
|
77
|
+
ChatApi,
|
|
78
|
+
Configuration,
|
|
79
|
+
ChatMessageRequest
|
|
80
|
+
} from '@rebornteam/reborn-api';
|
|
81
|
+
|
|
82
|
+
const configuration = new Configuration();
|
|
83
|
+
const apiInstance = new ChatApi(configuration);
|
|
84
|
+
|
|
85
|
+
let chatMessageRequest: ChatMessageRequest; //
|
|
86
|
+
|
|
87
|
+
const { status, data } = await apiInstance.ingest(
|
|
88
|
+
chatMessageRequest
|
|
89
|
+
);
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### Parameters
|
|
93
|
+
|
|
94
|
+
|Name | Type | Description | Notes|
|
|
95
|
+
|------------- | ------------- | ------------- | -------------|
|
|
96
|
+
| **chatMessageRequest** | **ChatMessageRequest**| | |
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
### Return type
|
|
100
|
+
|
|
101
|
+
**ChatMessageDTO**
|
|
102
|
+
|
|
103
|
+
### Authorization
|
|
104
|
+
|
|
105
|
+
[DiscordAuth](../README.md#DiscordAuth)
|
|
106
|
+
|
|
107
|
+
### HTTP request headers
|
|
108
|
+
|
|
109
|
+
- **Content-Type**: application/json
|
|
110
|
+
- **Accept**: application/json
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
### HTTP response details
|
|
114
|
+
| Status code | Description | Response headers |
|
|
115
|
+
|-------------|-------------|------------------|
|
|
116
|
+
|**201** | Message ingested | - |
|
|
117
|
+
|**400** | Bad request — unknown session ID or validation failure | - |
|
|
118
|
+
|**401** | Unauthorized | - |
|
|
119
|
+
|
|
120
|
+
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
|
121
|
+
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# ChatMessageDTO
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
## Properties
|
|
5
|
+
|
|
6
|
+
Name | Type | Description | Notes
|
|
7
|
+
------------ | ------------- | ------------- | -------------
|
|
8
|
+
**id** | **number** | | [default to undefined]
|
|
9
|
+
**sentAt** | **string** | | [default to undefined]
|
|
10
|
+
**sessionId** | **string** | | [default to undefined]
|
|
11
|
+
**playerUuid** | **string** | | [default to undefined]
|
|
12
|
+
**message** | **string** | | [default to undefined]
|
|
13
|
+
**channel** | **string** | | [default to undefined]
|
|
14
|
+
|
|
15
|
+
## Example
|
|
16
|
+
|
|
17
|
+
```typescript
|
|
18
|
+
import { ChatMessageDTO } from '@rebornteam/reborn-api';
|
|
19
|
+
|
|
20
|
+
const instance: ChatMessageDTO = {
|
|
21
|
+
id,
|
|
22
|
+
sentAt,
|
|
23
|
+
sessionId,
|
|
24
|
+
playerUuid,
|
|
25
|
+
message,
|
|
26
|
+
channel,
|
|
27
|
+
};
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# ChatMessageRequest
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
## Properties
|
|
5
|
+
|
|
6
|
+
Name | Type | Description | Notes
|
|
7
|
+
------------ | ------------- | ------------- | -------------
|
|
8
|
+
**sessionId** | **string** | | [default to undefined]
|
|
9
|
+
**playerUuid** | **string** | | [default to undefined]
|
|
10
|
+
**message** | **string** | | [default to undefined]
|
|
11
|
+
**channel** | **string** | | [optional] [default to undefined]
|
|
12
|
+
|
|
13
|
+
## Example
|
|
14
|
+
|
|
15
|
+
```typescript
|
|
16
|
+
import { ChatMessageRequest } from '@rebornteam/reborn-api';
|
|
17
|
+
|
|
18
|
+
const instance: ChatMessageRequest = {
|
|
19
|
+
sessionId,
|
|
20
|
+
playerUuid,
|
|
21
|
+
message,
|
|
22
|
+
channel,
|
|
23
|
+
};
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
package/docs/PlayerApi.md
CHANGED
|
@@ -4,7 +4,8 @@ All URIs are relative to *https://api.smsh.sh*
|
|
|
4
4
|
|
|
5
5
|
|Method | HTTP request | Description|
|
|
6
6
|
|------------- | ------------- | -------------|
|
|
7
|
-
|[**getPlayer1**](#getplayer1) | **GET** /v1/player/{uuid} | Get
|
|
7
|
+
|[**getPlayer1**](#getplayer1) | **GET** /v1/player/{uuid} | Get player information|
|
|
8
|
+
|[**getUsernames**](#getusernames) | **GET** /v1/player/usernames | Batch resolve UUIDs to usernames|
|
|
8
9
|
|
|
9
10
|
# **getPlayer1**
|
|
10
11
|
> PlayerGetPlayerInformation getPlayer1()
|
|
@@ -54,9 +55,61 @@ const { status, data } = await apiInstance.getPlayer1(
|
|
|
54
55
|
| Status code | Description | Response headers |
|
|
55
56
|
|-------------|-------------|------------------|
|
|
56
57
|
|**200** | Player information retrieved successfully | - |
|
|
57
|
-
|**401** | Unauthorized
|
|
58
|
-
|**400** | Bad
|
|
58
|
+
|**401** | Unauthorized — invalid or missing authentication token | - |
|
|
59
|
+
|**400** | Bad request — invalid UUID format | - |
|
|
59
60
|
|**404** | Player not found | - |
|
|
60
61
|
|
|
61
62
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
|
62
63
|
|
|
64
|
+
# **getUsernames**
|
|
65
|
+
> getUsernames()
|
|
66
|
+
|
|
67
|
+
Accepts a list of player UUIDs and returns a map of `uuid → username` for those that have a recorded username. UUIDs with no username record (e.g. players who have never joined) are omitted from the response. Used by the web UI to display player names in the chat log.
|
|
68
|
+
|
|
69
|
+
### Example
|
|
70
|
+
|
|
71
|
+
```typescript
|
|
72
|
+
import {
|
|
73
|
+
PlayerApi,
|
|
74
|
+
Configuration
|
|
75
|
+
} from '@rebornteam/reborn-api';
|
|
76
|
+
|
|
77
|
+
const configuration = new Configuration();
|
|
78
|
+
const apiInstance = new PlayerApi(configuration);
|
|
79
|
+
|
|
80
|
+
let uuids: Array<string>; //List of player UUIDs to resolve (repeatable query param) (default to undefined)
|
|
81
|
+
|
|
82
|
+
const { status, data } = await apiInstance.getUsernames(
|
|
83
|
+
uuids
|
|
84
|
+
);
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### Parameters
|
|
88
|
+
|
|
89
|
+
|Name | Type | Description | Notes|
|
|
90
|
+
|------------- | ------------- | ------------- | -------------|
|
|
91
|
+
| **uuids** | **Array<string>** | List of player UUIDs to resolve (repeatable query param) | defaults to undefined|
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
### Return type
|
|
95
|
+
|
|
96
|
+
void (empty response body)
|
|
97
|
+
|
|
98
|
+
### Authorization
|
|
99
|
+
|
|
100
|
+
[DiscordAuth](../README.md#DiscordAuth)
|
|
101
|
+
|
|
102
|
+
### HTTP request headers
|
|
103
|
+
|
|
104
|
+
- **Content-Type**: Not defined
|
|
105
|
+
- **Accept**: application/json
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
### HTTP response details
|
|
109
|
+
| Status code | Description | Response headers |
|
|
110
|
+
|-------------|-------------|------------------|
|
|
111
|
+
|**200** | Map of UUID → username for all resolved players | - |
|
|
112
|
+
|**401** | Unauthorized | - |
|
|
113
|
+
|
|
114
|
+
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
|
115
|
+
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# ServerRegisterRequest
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
## Properties
|
|
5
|
+
|
|
6
|
+
Name | Type | Description | Notes
|
|
7
|
+
------------ | ------------- | ------------- | -------------
|
|
8
|
+
**region** | **string** | | [default to undefined]
|
|
9
|
+
**gameType** | **string** | | [default to undefined]
|
|
10
|
+
**containerId** | **string** | | [optional] [default to undefined]
|
|
11
|
+
|
|
12
|
+
## Example
|
|
13
|
+
|
|
14
|
+
```typescript
|
|
15
|
+
import { ServerRegisterRequest } from '@rebornteam/reborn-api';
|
|
16
|
+
|
|
17
|
+
const instance: ServerRegisterRequest = {
|
|
18
|
+
region,
|
|
19
|
+
gameType,
|
|
20
|
+
containerId,
|
|
21
|
+
};
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# ServerSessionDTO
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
## Properties
|
|
5
|
+
|
|
6
|
+
Name | Type | Description | Notes
|
|
7
|
+
------------ | ------------- | ------------- | -------------
|
|
8
|
+
**id** | **string** | | [default to undefined]
|
|
9
|
+
**region** | **string** | | [default to undefined]
|
|
10
|
+
**gameType** | **string** | | [default to undefined]
|
|
11
|
+
**instanceName** | **string** | | [default to undefined]
|
|
12
|
+
**containerId** | **string** | | [optional] [default to undefined]
|
|
13
|
+
**startedAt** | **string** | | [default to undefined]
|
|
14
|
+
**lastHeartbeat** | **string** | | [default to undefined]
|
|
15
|
+
**endedAt** | **string** | | [optional] [default to undefined]
|
|
16
|
+
**online** | **boolean** | | [default to undefined]
|
|
17
|
+
|
|
18
|
+
## Example
|
|
19
|
+
|
|
20
|
+
```typescript
|
|
21
|
+
import { ServerSessionDTO } from '@rebornteam/reborn-api';
|
|
22
|
+
|
|
23
|
+
const instance: ServerSessionDTO = {
|
|
24
|
+
id,
|
|
25
|
+
region,
|
|
26
|
+
gameType,
|
|
27
|
+
instanceName,
|
|
28
|
+
containerId,
|
|
29
|
+
startedAt,
|
|
30
|
+
lastHeartbeat,
|
|
31
|
+
endedAt,
|
|
32
|
+
online,
|
|
33
|
+
};
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|