@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
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
# ServerSessionsApi
|
|
2
|
+
|
|
3
|
+
All URIs are relative to *https://api.smsh.sh*
|
|
4
|
+
|
|
5
|
+
|Method | HTTP request | Description|
|
|
6
|
+
|------------- | ------------- | -------------|
|
|
7
|
+
|[**heartbeat**](#heartbeat) | **PUT** /v1/servers/{id}/heartbeat | Send a heartbeat|
|
|
8
|
+
|[**listAll**](#listall) | **GET** /v1/servers/history | List all server sessions|
|
|
9
|
+
|[**listOnline**](#listonline) | **GET** /v1/servers | List online server sessions|
|
|
10
|
+
|[**markOffline**](#markoffline) | **PUT** /v1/servers/{id}/offline | Mark a session offline|
|
|
11
|
+
|[**register**](#register) | **POST** /v1/servers | Register a server session|
|
|
12
|
+
|
|
13
|
+
# **heartbeat**
|
|
14
|
+
> heartbeat()
|
|
15
|
+
|
|
16
|
+
Updates the `last_heartbeat` timestamp for the given session, keeping it marked as online. Sessions that miss heartbeats for more than 2 minutes are automatically tombstoned by the scheduler. Call this every 30 seconds from the game server.
|
|
17
|
+
|
|
18
|
+
### Example
|
|
19
|
+
|
|
20
|
+
```typescript
|
|
21
|
+
import {
|
|
22
|
+
ServerSessionsApi,
|
|
23
|
+
Configuration
|
|
24
|
+
} from '@rebornteam/reborn-api';
|
|
25
|
+
|
|
26
|
+
const configuration = new Configuration();
|
|
27
|
+
const apiInstance = new ServerSessionsApi(configuration);
|
|
28
|
+
|
|
29
|
+
let id: string; //Session UUID returned from the registration call (default to undefined)
|
|
30
|
+
|
|
31
|
+
const { status, data } = await apiInstance.heartbeat(
|
|
32
|
+
id
|
|
33
|
+
);
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### Parameters
|
|
37
|
+
|
|
38
|
+
|Name | Type | Description | Notes|
|
|
39
|
+
|------------- | ------------- | ------------- | -------------|
|
|
40
|
+
| **id** | [**string**] | Session UUID returned from the registration call | defaults to undefined|
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
### Return type
|
|
44
|
+
|
|
45
|
+
void (empty response body)
|
|
46
|
+
|
|
47
|
+
### Authorization
|
|
48
|
+
|
|
49
|
+
[DiscordAuth](../README.md#DiscordAuth)
|
|
50
|
+
|
|
51
|
+
### HTTP request headers
|
|
52
|
+
|
|
53
|
+
- **Content-Type**: Not defined
|
|
54
|
+
- **Accept**: Not defined
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
### HTTP response details
|
|
58
|
+
| Status code | Description | Response headers |
|
|
59
|
+
|-------------|-------------|------------------|
|
|
60
|
+
|**204** | Heartbeat recorded | - |
|
|
61
|
+
|**401** | Unauthorized | - |
|
|
62
|
+
|**404** | Session not found or already offline | - |
|
|
63
|
+
|
|
64
|
+
[[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)
|
|
65
|
+
|
|
66
|
+
# **listAll**
|
|
67
|
+
> Array<ServerSessionDTO> listAll()
|
|
68
|
+
|
|
69
|
+
Returns all server sessions — both online and historical — ordered by start time descending. Used by the web UI to populate the session filter dropdown.
|
|
70
|
+
|
|
71
|
+
### Example
|
|
72
|
+
|
|
73
|
+
```typescript
|
|
74
|
+
import {
|
|
75
|
+
ServerSessionsApi,
|
|
76
|
+
Configuration
|
|
77
|
+
} from '@rebornteam/reborn-api';
|
|
78
|
+
|
|
79
|
+
const configuration = new Configuration();
|
|
80
|
+
const apiInstance = new ServerSessionsApi(configuration);
|
|
81
|
+
|
|
82
|
+
const { status, data } = await apiInstance.listAll();
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### Parameters
|
|
86
|
+
This endpoint does not have any parameters.
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
### Return type
|
|
90
|
+
|
|
91
|
+
**Array<ServerSessionDTO>**
|
|
92
|
+
|
|
93
|
+
### Authorization
|
|
94
|
+
|
|
95
|
+
[DiscordAuth](../README.md#DiscordAuth)
|
|
96
|
+
|
|
97
|
+
### HTTP request headers
|
|
98
|
+
|
|
99
|
+
- **Content-Type**: Not defined
|
|
100
|
+
- **Accept**: application/json
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
### HTTP response details
|
|
104
|
+
| Status code | Description | Response headers |
|
|
105
|
+
|-------------|-------------|------------------|
|
|
106
|
+
|**200** | List of all sessions | - |
|
|
107
|
+
|**401** | Unauthorized | - |
|
|
108
|
+
|
|
109
|
+
[[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)
|
|
110
|
+
|
|
111
|
+
# **listOnline**
|
|
112
|
+
> Array<ServerSessionDTO> listOnline()
|
|
113
|
+
|
|
114
|
+
Returns all currently online server sessions, ordered by start time descending.
|
|
115
|
+
|
|
116
|
+
### Example
|
|
117
|
+
|
|
118
|
+
```typescript
|
|
119
|
+
import {
|
|
120
|
+
ServerSessionsApi,
|
|
121
|
+
Configuration
|
|
122
|
+
} from '@rebornteam/reborn-api';
|
|
123
|
+
|
|
124
|
+
const configuration = new Configuration();
|
|
125
|
+
const apiInstance = new ServerSessionsApi(configuration);
|
|
126
|
+
|
|
127
|
+
const { status, data } = await apiInstance.listOnline();
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
### Parameters
|
|
131
|
+
This endpoint does not have any parameters.
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
### Return type
|
|
135
|
+
|
|
136
|
+
**Array<ServerSessionDTO>**
|
|
137
|
+
|
|
138
|
+
### Authorization
|
|
139
|
+
|
|
140
|
+
[DiscordAuth](../README.md#DiscordAuth)
|
|
141
|
+
|
|
142
|
+
### HTTP request headers
|
|
143
|
+
|
|
144
|
+
- **Content-Type**: Not defined
|
|
145
|
+
- **Accept**: application/json
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
### HTTP response details
|
|
149
|
+
| Status code | Description | Response headers |
|
|
150
|
+
|-------------|-------------|------------------|
|
|
151
|
+
|**200** | List of online sessions | - |
|
|
152
|
+
|**401** | Unauthorized | - |
|
|
153
|
+
|
|
154
|
+
[[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)
|
|
155
|
+
|
|
156
|
+
# **markOffline**
|
|
157
|
+
> markOffline()
|
|
158
|
+
|
|
159
|
+
Marks the session as offline with the current timestamp as `endedAt`. Call this from the game server\'s shutdown hook for a clean shutdown signal. Sessions that crash without calling this endpoint will be tombstoned automatically by the 2-minute heartbeat scheduler.
|
|
160
|
+
|
|
161
|
+
### Example
|
|
162
|
+
|
|
163
|
+
```typescript
|
|
164
|
+
import {
|
|
165
|
+
ServerSessionsApi,
|
|
166
|
+
Configuration
|
|
167
|
+
} from '@rebornteam/reborn-api';
|
|
168
|
+
|
|
169
|
+
const configuration = new Configuration();
|
|
170
|
+
const apiInstance = new ServerSessionsApi(configuration);
|
|
171
|
+
|
|
172
|
+
let id: string; //Session UUID returned from the registration call (default to undefined)
|
|
173
|
+
|
|
174
|
+
const { status, data } = await apiInstance.markOffline(
|
|
175
|
+
id
|
|
176
|
+
);
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
### Parameters
|
|
180
|
+
|
|
181
|
+
|Name | Type | Description | Notes|
|
|
182
|
+
|------------- | ------------- | ------------- | -------------|
|
|
183
|
+
| **id** | [**string**] | Session UUID returned from the registration call | defaults to undefined|
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
### Return type
|
|
187
|
+
|
|
188
|
+
void (empty response body)
|
|
189
|
+
|
|
190
|
+
### Authorization
|
|
191
|
+
|
|
192
|
+
[DiscordAuth](../README.md#DiscordAuth)
|
|
193
|
+
|
|
194
|
+
### HTTP request headers
|
|
195
|
+
|
|
196
|
+
- **Content-Type**: Not defined
|
|
197
|
+
- **Accept**: Not defined
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
### HTTP response details
|
|
201
|
+
| Status code | Description | Response headers |
|
|
202
|
+
|-------------|-------------|------------------|
|
|
203
|
+
|**204** | Session marked offline | - |
|
|
204
|
+
|**401** | Unauthorized | - |
|
|
205
|
+
|
|
206
|
+
[[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)
|
|
207
|
+
|
|
208
|
+
# **register**
|
|
209
|
+
> ServerSessionDTO register(serverRegisterRequest)
|
|
210
|
+
|
|
211
|
+
Registers a game server instance and returns a session ID used for subsequent heartbeats and chat ingestion. If a `containerId` is provided and an online session already exists for that container (e.g. after a Velocity restart), the existing session is returned unchanged. Otherwise a fresh session is created with an auto-generated instance name.
|
|
212
|
+
|
|
213
|
+
### Example
|
|
214
|
+
|
|
215
|
+
```typescript
|
|
216
|
+
import {
|
|
217
|
+
ServerSessionsApi,
|
|
218
|
+
Configuration,
|
|
219
|
+
ServerRegisterRequest
|
|
220
|
+
} from '@rebornteam/reborn-api';
|
|
221
|
+
|
|
222
|
+
const configuration = new Configuration();
|
|
223
|
+
const apiInstance = new ServerSessionsApi(configuration);
|
|
224
|
+
|
|
225
|
+
let serverRegisterRequest: ServerRegisterRequest; //
|
|
226
|
+
|
|
227
|
+
const { status, data } = await apiInstance.register(
|
|
228
|
+
serverRegisterRequest
|
|
229
|
+
);
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
### Parameters
|
|
233
|
+
|
|
234
|
+
|Name | Type | Description | Notes|
|
|
235
|
+
|------------- | ------------- | ------------- | -------------|
|
|
236
|
+
| **serverRegisterRequest** | **ServerRegisterRequest**| | |
|
|
237
|
+
|
|
238
|
+
|
|
239
|
+
### Return type
|
|
240
|
+
|
|
241
|
+
**ServerSessionDTO**
|
|
242
|
+
|
|
243
|
+
### Authorization
|
|
244
|
+
|
|
245
|
+
[DiscordAuth](../README.md#DiscordAuth)
|
|
246
|
+
|
|
247
|
+
### HTTP request headers
|
|
248
|
+
|
|
249
|
+
- **Content-Type**: application/json
|
|
250
|
+
- **Accept**: application/json
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
### HTTP response details
|
|
254
|
+
| Status code | Description | Response headers |
|
|
255
|
+
|-------------|-------------|------------------|
|
|
256
|
+
|**201** | Session created or resumed | - |
|
|
257
|
+
|**400** | Bad request — missing required fields | - |
|
|
258
|
+
|**401** | Unauthorized | - |
|
|
259
|
+
|
|
260
|
+
[[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)
|
|
261
|
+
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# TokenRequest
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
## Properties
|
|
5
|
+
|
|
6
|
+
Name | Type | Description | Notes
|
|
7
|
+
------------ | ------------- | ------------- | -------------
|
|
8
|
+
**grant_type** | **string** | | [optional] [default to undefined]
|
|
9
|
+
**client_id** | **string** | | [optional] [default to undefined]
|
|
10
|
+
**client_secret** | **string** | | [optional] [default to undefined]
|
|
11
|
+
|
|
12
|
+
## Example
|
|
13
|
+
|
|
14
|
+
```typescript
|
|
15
|
+
import { TokenRequest } from '@rebornteam/reborn-api';
|
|
16
|
+
|
|
17
|
+
const instance: TokenRequest = {
|
|
18
|
+
grant_type,
|
|
19
|
+
client_id,
|
|
20
|
+
client_secret,
|
|
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)
|
package/index.ts
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/package.json
CHANGED
package/docs/DefaultApi.md
DELETED
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
# DefaultApi
|
|
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 | |
|
|
8
|
-
|[**initiateLogin**](#initiatelogin) | **GET** /auth/discord | |
|
|
9
|
-
|
|
10
|
-
# **callback**
|
|
11
|
-
> object callback()
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
### Example
|
|
15
|
-
|
|
16
|
-
```typescript
|
|
17
|
-
import {
|
|
18
|
-
DefaultApi,
|
|
19
|
-
Configuration
|
|
20
|
-
} from '@rebornteam/reborn-api';
|
|
21
|
-
|
|
22
|
-
const configuration = new Configuration();
|
|
23
|
-
const apiInstance = new DefaultApi(configuration);
|
|
24
|
-
|
|
25
|
-
let code: string; // (optional) (default to undefined)
|
|
26
|
-
let error: string; // (optional) (default to undefined)
|
|
27
|
-
|
|
28
|
-
const { status, data } = await apiInstance.callback(
|
|
29
|
-
code,
|
|
30
|
-
error
|
|
31
|
-
);
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
### Parameters
|
|
35
|
-
|
|
36
|
-
|Name | Type | Description | Notes|
|
|
37
|
-
|------------- | ------------- | ------------- | -------------|
|
|
38
|
-
| **code** | [**string**] | | (optional) defaults to undefined|
|
|
39
|
-
| **error** | [**string**] | | (optional) defaults to undefined|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
### Return type
|
|
43
|
-
|
|
44
|
-
**object**
|
|
45
|
-
|
|
46
|
-
### Authorization
|
|
47
|
-
|
|
48
|
-
[DiscordAuth](../README.md#DiscordAuth)
|
|
49
|
-
|
|
50
|
-
### HTTP request headers
|
|
51
|
-
|
|
52
|
-
- **Content-Type**: Not defined
|
|
53
|
-
- **Accept**: application/json
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
### HTTP response details
|
|
57
|
-
| Status code | Description | Response headers |
|
|
58
|
-
|-------------|-------------|------------------|
|
|
59
|
-
|**200** | callback 200 response | - |
|
|
60
|
-
|
|
61
|
-
[[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
|
-
# **initiateLogin**
|
|
64
|
-
> object initiateLogin()
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
### Example
|
|
68
|
-
|
|
69
|
-
```typescript
|
|
70
|
-
import {
|
|
71
|
-
DefaultApi,
|
|
72
|
-
Configuration
|
|
73
|
-
} from '@rebornteam/reborn-api';
|
|
74
|
-
|
|
75
|
-
const configuration = new Configuration();
|
|
76
|
-
const apiInstance = new DefaultApi(configuration);
|
|
77
|
-
|
|
78
|
-
const { status, data } = await apiInstance.initiateLogin();
|
|
79
|
-
```
|
|
80
|
-
|
|
81
|
-
### Parameters
|
|
82
|
-
This endpoint does not have any parameters.
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
### Return type
|
|
86
|
-
|
|
87
|
-
**object**
|
|
88
|
-
|
|
89
|
-
### Authorization
|
|
90
|
-
|
|
91
|
-
[DiscordAuth](../README.md#DiscordAuth)
|
|
92
|
-
|
|
93
|
-
### HTTP request headers
|
|
94
|
-
|
|
95
|
-
- **Content-Type**: Not defined
|
|
96
|
-
- **Accept**: application/json
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
### HTTP response details
|
|
100
|
-
| Status code | Description | Response headers |
|
|
101
|
-
|-------------|-------------|------------------|
|
|
102
|
-
|**200** | initiateLogin 200 response | - |
|
|
103
|
-
|
|
104
|
-
[[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)
|
|
105
|
-
|