@rebornteam/reborn-api 4.5.0 → 4.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 +2 -0
- package/README.md +4 -2
- package/api.ts +75 -18
- package/base.ts +1 -1
- package/common.ts +1 -1
- package/configuration.ts +1 -1
- package/dist/api.d.ts +70 -16
- package/dist/api.js +23 -16
- 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 +70 -16
- package/dist/esm/api.js +23 -16
- 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/AdminPlayerSession.md +2 -0
- package/docs/PlayerSessionEndResponse.md +35 -0
- package/docs/PlayerSessionsApi.md +5 -5
- package/docs/ServerHeartbeatRequest.md +21 -0
- package/docs/ServerSessionsApi.md +8 -4
- package/index.ts +1 -1
- package/package.json +1 -1
|
@@ -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: 4.
|
|
6
|
+
* The version of the OpenAPI document: 4.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: 4.
|
|
5
|
+
* The version of the OpenAPI document: 4.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: 4.
|
|
7
|
+
* The version of the OpenAPI document: 4.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: 4.
|
|
5
|
+
* The version of the OpenAPI document: 4.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: 4.
|
|
8
|
+
* The version of the OpenAPI document: 4.7.0
|
|
9
9
|
*
|
|
10
10
|
*
|
|
11
11
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
@@ -12,6 +12,7 @@ Name | Type | Description | Notes
|
|
|
12
12
|
**startedAt** | **string** | When the player joined (ISO-8601) | [default to undefined]
|
|
13
13
|
**endedAt** | **string** | When the player disconnected (ISO-8601). Null while the session is still active. | [optional] [default to undefined]
|
|
14
14
|
**durationSeconds** | **number** | Closed session duration in seconds (ended_at − started_at). Null while active. | [optional] [default to undefined]
|
|
15
|
+
**transferredTo** | **string** | When the player transferred to another server, the id of the session they moved to. Null for a normal disconnect or an active session. | [optional] [default to undefined]
|
|
15
16
|
|
|
16
17
|
## Example
|
|
17
18
|
|
|
@@ -25,6 +26,7 @@ const instance: AdminPlayerSession = {
|
|
|
25
26
|
startedAt,
|
|
26
27
|
endedAt,
|
|
27
28
|
durationSeconds,
|
|
29
|
+
transferredTo,
|
|
28
30
|
};
|
|
29
31
|
```
|
|
30
32
|
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# PlayerSessionEndResponse
|
|
2
|
+
|
|
3
|
+
Result of POST /v1/player-session/end. Confirms whether a session was closed and returns that session\'s lifetime plus the player\'s refreshed aggregate stats.
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type | Description | Notes
|
|
8
|
+
------------ | ------------- | ------------- | -------------
|
|
9
|
+
**playerUuid** | **string** | Player Minecraft UUID, echoed from the request | [default to undefined]
|
|
10
|
+
**serverSessionId** | **string** | Server session id the player was on, echoed from the request | [default to undefined]
|
|
11
|
+
**sessionClosed** | **boolean** | True when an active session was found and closed by this call; false on a no-op (no active session existed, e.g. a duplicate/retried end event). | [default to undefined]
|
|
12
|
+
**sessionId** | **string** | Id of the session that was closed. Null on a no-op. | [optional] [default to undefined]
|
|
13
|
+
**startedAt** | **string** | When the closed session was opened (ISO-8601). Null on a no-op. | [optional] [default to undefined]
|
|
14
|
+
**endedAt** | **string** | When the session was closed (ISO-8601), i.e. now. Null on a no-op. | [optional] [default to undefined]
|
|
15
|
+
**durationSeconds** | **number** | Length of the closed session in seconds (endedAt - startedAt). Null on a no-op. | [optional] [default to undefined]
|
|
16
|
+
**sessionStats** | [**AdminPlayerSessionStats**](AdminPlayerSessionStats.md) | Player\'s aggregate session stats, recomputed after this session was closed (so the just-ended session is included in the totals). | [default to undefined]
|
|
17
|
+
|
|
18
|
+
## Example
|
|
19
|
+
|
|
20
|
+
```typescript
|
|
21
|
+
import { PlayerSessionEndResponse } from '@rebornteam/reborn-api';
|
|
22
|
+
|
|
23
|
+
const instance: PlayerSessionEndResponse = {
|
|
24
|
+
playerUuid,
|
|
25
|
+
serverSessionId,
|
|
26
|
+
sessionClosed,
|
|
27
|
+
sessionId,
|
|
28
|
+
startedAt,
|
|
29
|
+
endedAt,
|
|
30
|
+
durationSeconds,
|
|
31
|
+
sessionStats,
|
|
32
|
+
};
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
@@ -8,9 +8,9 @@ All URIs are relative to *https://api.smsh.sh*
|
|
|
8
8
|
|[**start**](#start) | **POST** /v1/player-session/start | Player join — unified authorization + session-open|
|
|
9
9
|
|
|
10
10
|
# **end**
|
|
11
|
-
> end(playerSessionEndRequest)
|
|
11
|
+
> PlayerSessionEndResponse end(playerSessionEndRequest)
|
|
12
12
|
|
|
13
|
-
Closes the active session for a (playerUuid, serverSessionId) pair. No-op if no active session is found
|
|
13
|
+
Closes the active session for a (playerUuid, serverSessionId) pair and returns an acknowledgment: whether a session was actually closed, that session\'s start / end / duration, and the player\'s aggregate session stats recomputed after the close. No-op if no active session is found — `sessionClosed` is false and the per-session fields are null (stats are still returned) — so duplicate end events from a retry don\'t error.
|
|
14
14
|
|
|
15
15
|
### Example
|
|
16
16
|
|
|
@@ -40,7 +40,7 @@ const { status, data } = await apiInstance.end(
|
|
|
40
40
|
|
|
41
41
|
### Return type
|
|
42
42
|
|
|
43
|
-
|
|
43
|
+
**PlayerSessionEndResponse**
|
|
44
44
|
|
|
45
45
|
### Authorization
|
|
46
46
|
|
|
@@ -49,13 +49,13 @@ void (empty response body)
|
|
|
49
49
|
### HTTP request headers
|
|
50
50
|
|
|
51
51
|
- **Content-Type**: application/json
|
|
52
|
-
- **Accept**:
|
|
52
|
+
- **Accept**: application/json
|
|
53
53
|
|
|
54
54
|
|
|
55
55
|
### HTTP response details
|
|
56
56
|
| Status code | Description | Response headers |
|
|
57
57
|
|-------------|-------------|------------------|
|
|
58
|
-
|**
|
|
58
|
+
|**200** | End handled. Inspect `sessionClosed` to tell whether a session was actually closed. | - |
|
|
59
59
|
|**401** | Unauthorized | - |
|
|
60
60
|
|
|
61
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)
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# ServerHeartbeatRequest
|
|
2
|
+
|
|
3
|
+
Optional heartbeat payload carrying the players currently on this server session.
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type | Description | Notes
|
|
8
|
+
------------ | ------------- | ------------- | -------------
|
|
9
|
+
**activePlayers** | **Array<string>** | UUIDs of players currently on this server session. Open sessions for this server whose player is absent from this list are auto-closed. Omit to heartbeat without reconciling player sessions. | [optional] [default to undefined]
|
|
10
|
+
|
|
11
|
+
## Example
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
import { ServerHeartbeatRequest } from '@rebornteam/reborn-api';
|
|
15
|
+
|
|
16
|
+
const instance: ServerHeartbeatRequest = {
|
|
17
|
+
activePlayers,
|
|
18
|
+
};
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
@@ -13,23 +13,26 @@ All URIs are relative to *https://api.smsh.sh*
|
|
|
13
13
|
# **heartbeat**
|
|
14
14
|
> heartbeat()
|
|
15
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.
|
|
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. Optionally include an `activePlayers` list (the UUIDs currently on this server). When present, the API reconciles player sessions for this server: any open session whose player is absent from the list is closed, and linked to the player\'s new session if they transferred to another server. Omit the body for a plain liveness heartbeat.
|
|
17
17
|
|
|
18
18
|
### Example
|
|
19
19
|
|
|
20
20
|
```typescript
|
|
21
21
|
import {
|
|
22
22
|
ServerSessionsApi,
|
|
23
|
-
Configuration
|
|
23
|
+
Configuration,
|
|
24
|
+
ServerHeartbeatRequest
|
|
24
25
|
} from '@rebornteam/reborn-api';
|
|
25
26
|
|
|
26
27
|
const configuration = new Configuration();
|
|
27
28
|
const apiInstance = new ServerSessionsApi(configuration);
|
|
28
29
|
|
|
29
30
|
let id: string; //Session UUID returned from the registration call (default to undefined)
|
|
31
|
+
let serverHeartbeatRequest: ServerHeartbeatRequest; // (optional)
|
|
30
32
|
|
|
31
33
|
const { status, data } = await apiInstance.heartbeat(
|
|
32
|
-
id
|
|
34
|
+
id,
|
|
35
|
+
serverHeartbeatRequest
|
|
33
36
|
);
|
|
34
37
|
```
|
|
35
38
|
|
|
@@ -37,6 +40,7 @@ const { status, data } = await apiInstance.heartbeat(
|
|
|
37
40
|
|
|
38
41
|
|Name | Type | Description | Notes|
|
|
39
42
|
|------------- | ------------- | ------------- | -------------|
|
|
43
|
+
| **serverHeartbeatRequest** | **ServerHeartbeatRequest**| | |
|
|
40
44
|
| **id** | [**string**] | Session UUID returned from the registration call | defaults to undefined|
|
|
41
45
|
|
|
42
46
|
|
|
@@ -50,7 +54,7 @@ void (empty response body)
|
|
|
50
54
|
|
|
51
55
|
### HTTP request headers
|
|
52
56
|
|
|
53
|
-
- **Content-Type**:
|
|
57
|
+
- **Content-Type**: application/json
|
|
54
58
|
- **Accept**: Not defined
|
|
55
59
|
|
|
56
60
|
|
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: 4.
|
|
7
|
+
* The version of the OpenAPI document: 4.7.0
|
|
8
8
|
*
|
|
9
9
|
*
|
|
10
10
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|