@rebornteam/reborn-api 2.6.4 → 2.8.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/api.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.8.0
|
|
8
8
|
*
|
|
9
9
|
*
|
|
10
10
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
@@ -518,6 +518,20 @@ export interface AdminUsernameHistoryEntry {
|
|
|
518
518
|
*/
|
|
519
519
|
'changedAt'?: string;
|
|
520
520
|
}
|
|
521
|
+
export interface ChatMessageDTO {
|
|
522
|
+
'id': number;
|
|
523
|
+
'sentAt': string;
|
|
524
|
+
'sessionId': string;
|
|
525
|
+
'playerUuid': string;
|
|
526
|
+
'message': string;
|
|
527
|
+
'channel': string;
|
|
528
|
+
}
|
|
529
|
+
export interface ChatMessageRequest {
|
|
530
|
+
'sessionId': string;
|
|
531
|
+
'playerUuid': string;
|
|
532
|
+
'message': string;
|
|
533
|
+
'channel'?: string | null;
|
|
534
|
+
}
|
|
521
535
|
/**
|
|
522
536
|
* Request to create new client credentials
|
|
523
537
|
*/
|
|
@@ -675,6 +689,27 @@ export interface PunishmentSeveritiesResponseSeverityInfo {
|
|
|
675
689
|
*/
|
|
676
690
|
'durationSeconds'?: number;
|
|
677
691
|
}
|
|
692
|
+
export interface ServerRegisterRequest {
|
|
693
|
+
'region': string;
|
|
694
|
+
'gameType': string;
|
|
695
|
+
'containerId'?: string | null;
|
|
696
|
+
}
|
|
697
|
+
export interface ServerSessionDTO {
|
|
698
|
+
'id': string;
|
|
699
|
+
'region': string;
|
|
700
|
+
'gameType': string;
|
|
701
|
+
'instanceName': string;
|
|
702
|
+
'containerId'?: string | null;
|
|
703
|
+
'startedAt': string;
|
|
704
|
+
'lastHeartbeat': string;
|
|
705
|
+
'endedAt'?: string | null;
|
|
706
|
+
'online': boolean;
|
|
707
|
+
}
|
|
708
|
+
export interface TokenRequest {
|
|
709
|
+
'grant_type'?: string | null;
|
|
710
|
+
'client_id'?: string | null;
|
|
711
|
+
'client_secret'?: string | null;
|
|
712
|
+
}
|
|
678
713
|
/**
|
|
679
714
|
* Request to update client metadata
|
|
680
715
|
*/
|
|
@@ -2241,26 +2276,20 @@ export class AdminPunishmentsApi extends BaseAPI {
|
|
|
2241
2276
|
|
|
2242
2277
|
|
|
2243
2278
|
/**
|
|
2244
|
-
*
|
|
2279
|
+
* AuthenticationApi - axios parameter creator
|
|
2245
2280
|
*/
|
|
2246
|
-
export const
|
|
2281
|
+
export const AuthenticationApiAxiosParamCreator = function (configuration?: Configuration) {
|
|
2247
2282
|
return {
|
|
2248
2283
|
/**
|
|
2249
|
-
*
|
|
2250
|
-
* @summary
|
|
2251
|
-
* @param {string}
|
|
2252
|
-
* @param {
|
|
2253
|
-
* @param {string | null} [associateUuid] Minecraft player UUID to associate with this IP address. When provided, the API will: - Link this connection to the player\'s history - Update the player\'s username from Mojang API - Return player information (first join status, first login time) in the response - Track connection history for fraud detection This operation is asynchronous and won\'t block the response.
|
|
2284
|
+
* 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.
|
|
2285
|
+
* @summary Discord - OAuth2 callback
|
|
2286
|
+
* @param {string | null} [code] Authorization code provided by Discord on successful approval
|
|
2287
|
+
* @param {string | null} [error] Error code provided by Discord if the user denied access
|
|
2254
2288
|
* @param {*} [options] Override http request option.
|
|
2255
2289
|
* @throws {RequiredError}
|
|
2256
2290
|
*/
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
assertParamExists('getConnectionDetails', 'ip', ip)
|
|
2260
|
-
// verify required parameter 'forceRecheck' is not null or undefined
|
|
2261
|
-
assertParamExists('getConnectionDetails', 'forceRecheck', forceRecheck)
|
|
2262
|
-
const localVarPath = `/v1/connection/get-connection-details/{ip}`
|
|
2263
|
-
.replace(`{${"ip"}}`, encodeURIComponent(String(ip)));
|
|
2291
|
+
callback: async (code?: string | null, error?: string | null, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
2292
|
+
const localVarPath = `/auth/discord/callback`;
|
|
2264
2293
|
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
2265
2294
|
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
2266
2295
|
let baseOptions;
|
|
@@ -2276,19 +2305,103 @@ export const ConnectionApiAxiosParamCreator = function (configuration?: Configur
|
|
|
2276
2305
|
// http bearer authentication required
|
|
2277
2306
|
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
|
2278
2307
|
|
|
2279
|
-
if (
|
|
2280
|
-
localVarQueryParameter['
|
|
2308
|
+
if (code !== undefined) {
|
|
2309
|
+
localVarQueryParameter['code'] = code;
|
|
2281
2310
|
}
|
|
2282
2311
|
|
|
2283
|
-
if (
|
|
2284
|
-
localVarQueryParameter['
|
|
2312
|
+
if (error !== undefined) {
|
|
2313
|
+
localVarQueryParameter['error'] = error;
|
|
2314
|
+
}
|
|
2315
|
+
|
|
2316
|
+
|
|
2317
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
2318
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
2319
|
+
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
2320
|
+
|
|
2321
|
+
return {
|
|
2322
|
+
url: toPathString(localVarUrlObj),
|
|
2323
|
+
options: localVarRequestOptions,
|
|
2324
|
+
};
|
|
2325
|
+
},
|
|
2326
|
+
/**
|
|
2327
|
+
* Redirects the browser to Discord\'s OAuth2 authorization page. Not called directly — the admin frontend navigates to this URL to begin the login flow.
|
|
2328
|
+
* @summary Discord - Initiate login
|
|
2329
|
+
* @param {*} [options] Override http request option.
|
|
2330
|
+
* @throws {RequiredError}
|
|
2331
|
+
*/
|
|
2332
|
+
initiateLogin: async (options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
2333
|
+
const localVarPath = `/auth/discord`;
|
|
2334
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
2335
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
2336
|
+
let baseOptions;
|
|
2337
|
+
if (configuration) {
|
|
2338
|
+
baseOptions = configuration.baseOptions;
|
|
2339
|
+
}
|
|
2340
|
+
|
|
2341
|
+
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
|
|
2342
|
+
const localVarHeaderParameter = {} as any;
|
|
2343
|
+
const localVarQueryParameter = {} as any;
|
|
2344
|
+
|
|
2345
|
+
// authentication DiscordAuth required
|
|
2346
|
+
// http bearer authentication required
|
|
2347
|
+
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
|
2348
|
+
|
|
2349
|
+
|
|
2350
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
2351
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
2352
|
+
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
2353
|
+
|
|
2354
|
+
return {
|
|
2355
|
+
url: toPathString(localVarUrlObj),
|
|
2356
|
+
options: localVarRequestOptions,
|
|
2357
|
+
};
|
|
2358
|
+
},
|
|
2359
|
+
/**
|
|
2360
|
+
* Exchange service client credentials for a Bearer JWT using the OAuth2 client_credentials grant. Used by game server plugins to authenticate against the API.
|
|
2361
|
+
* @summary Service - Exchange client credentials for token
|
|
2362
|
+
* @param {string | null} [grantType]
|
|
2363
|
+
* @param {string | null} [clientId]
|
|
2364
|
+
* @param {string | null} [clientSecret]
|
|
2365
|
+
* @param {*} [options] Override http request option.
|
|
2366
|
+
* @throws {RequiredError}
|
|
2367
|
+
*/
|
|
2368
|
+
token: async (grantType?: string | null, clientId?: string | null, clientSecret?: string | null, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
2369
|
+
const localVarPath = `/oauth/token`;
|
|
2370
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
2371
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
2372
|
+
let baseOptions;
|
|
2373
|
+
if (configuration) {
|
|
2374
|
+
baseOptions = configuration.baseOptions;
|
|
2375
|
+
}
|
|
2376
|
+
|
|
2377
|
+
const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
|
|
2378
|
+
const localVarHeaderParameter = {} as any;
|
|
2379
|
+
const localVarQueryParameter = {} as any;
|
|
2380
|
+
const localVarFormParams = new URLSearchParams();
|
|
2381
|
+
|
|
2382
|
+
// authentication DiscordAuth required
|
|
2383
|
+
// http bearer authentication required
|
|
2384
|
+
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
|
2385
|
+
|
|
2386
|
+
|
|
2387
|
+
if (grantType !== undefined) {
|
|
2388
|
+
localVarFormParams.set('grant_type', grantType as any);
|
|
2389
|
+
}
|
|
2390
|
+
|
|
2391
|
+
if (clientId !== undefined) {
|
|
2392
|
+
localVarFormParams.set('client_id', clientId as any);
|
|
2285
2393
|
}
|
|
2286
2394
|
|
|
2395
|
+
if (clientSecret !== undefined) {
|
|
2396
|
+
localVarFormParams.set('client_secret', clientSecret as any);
|
|
2397
|
+
}
|
|
2398
|
+
localVarHeaderParameter['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
2287
2399
|
localVarHeaderParameter['Accept'] = 'application/json';
|
|
2288
2400
|
|
|
2289
2401
|
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
2290
2402
|
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
2291
2403
|
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
2404
|
+
localVarRequestOptions.data = localVarFormParams.toString();
|
|
2292
2405
|
|
|
2293
2406
|
return {
|
|
2294
2407
|
url: toPathString(localVarUrlObj),
|
|
@@ -2299,84 +2412,156 @@ export const ConnectionApiAxiosParamCreator = function (configuration?: Configur
|
|
|
2299
2412
|
};
|
|
2300
2413
|
|
|
2301
2414
|
/**
|
|
2302
|
-
*
|
|
2415
|
+
* AuthenticationApi - functional programming interface
|
|
2303
2416
|
*/
|
|
2304
|
-
export const
|
|
2305
|
-
const localVarAxiosParamCreator =
|
|
2417
|
+
export const AuthenticationApiFp = function(configuration?: Configuration) {
|
|
2418
|
+
const localVarAxiosParamCreator = AuthenticationApiAxiosParamCreator(configuration)
|
|
2306
2419
|
return {
|
|
2307
2420
|
/**
|
|
2308
|
-
*
|
|
2309
|
-
* @summary
|
|
2310
|
-
* @param {string}
|
|
2311
|
-
* @param {
|
|
2312
|
-
* @param {string | null} [associateUuid] Minecraft player UUID to associate with this IP address. When provided, the API will: - Link this connection to the player\'s history - Update the player\'s username from Mojang API - Return player information (first join status, first login time) in the response - Track connection history for fraud detection This operation is asynchronous and won\'t block the response.
|
|
2421
|
+
* 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.
|
|
2422
|
+
* @summary Discord - OAuth2 callback
|
|
2423
|
+
* @param {string | null} [code] Authorization code provided by Discord on successful approval
|
|
2424
|
+
* @param {string | null} [error] Error code provided by Discord if the user denied access
|
|
2313
2425
|
* @param {*} [options] Override http request option.
|
|
2314
2426
|
* @throws {RequiredError}
|
|
2315
2427
|
*/
|
|
2316
|
-
async
|
|
2317
|
-
const localVarAxiosArgs = await localVarAxiosParamCreator.
|
|
2428
|
+
async callback(code?: string | null, error?: string | null, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
|
|
2429
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.callback(code, error, options);
|
|
2318
2430
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
2319
|
-
const localVarOperationServerBasePath = operationServerMap['
|
|
2431
|
+
const localVarOperationServerBasePath = operationServerMap['AuthenticationApi.callback']?.[localVarOperationServerIndex]?.url;
|
|
2432
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
2433
|
+
},
|
|
2434
|
+
/**
|
|
2435
|
+
* Redirects the browser to Discord\'s OAuth2 authorization page. Not called directly — the admin frontend navigates to this URL to begin the login flow.
|
|
2436
|
+
* @summary Discord - Initiate login
|
|
2437
|
+
* @param {*} [options] Override http request option.
|
|
2438
|
+
* @throws {RequiredError}
|
|
2439
|
+
*/
|
|
2440
|
+
async initiateLogin(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
|
|
2441
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.initiateLogin(options);
|
|
2442
|
+
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
2443
|
+
const localVarOperationServerBasePath = operationServerMap['AuthenticationApi.initiateLogin']?.[localVarOperationServerIndex]?.url;
|
|
2444
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
2445
|
+
},
|
|
2446
|
+
/**
|
|
2447
|
+
* Exchange service client credentials for a Bearer JWT using the OAuth2 client_credentials grant. Used by game server plugins to authenticate against the API.
|
|
2448
|
+
* @summary Service - Exchange client credentials for token
|
|
2449
|
+
* @param {string | null} [grantType]
|
|
2450
|
+
* @param {string | null} [clientId]
|
|
2451
|
+
* @param {string | null} [clientSecret]
|
|
2452
|
+
* @param {*} [options] Override http request option.
|
|
2453
|
+
* @throws {RequiredError}
|
|
2454
|
+
*/
|
|
2455
|
+
async token(grantType?: string | null, clientId?: string | null, clientSecret?: string | null, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<object>> {
|
|
2456
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.token(grantType, clientId, clientSecret, options);
|
|
2457
|
+
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
2458
|
+
const localVarOperationServerBasePath = operationServerMap['AuthenticationApi.token']?.[localVarOperationServerIndex]?.url;
|
|
2320
2459
|
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
2321
2460
|
},
|
|
2322
2461
|
}
|
|
2323
2462
|
};
|
|
2324
2463
|
|
|
2325
2464
|
/**
|
|
2326
|
-
*
|
|
2465
|
+
* AuthenticationApi - factory interface
|
|
2327
2466
|
*/
|
|
2328
|
-
export const
|
|
2329
|
-
const localVarFp =
|
|
2467
|
+
export const AuthenticationApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
|
|
2468
|
+
const localVarFp = AuthenticationApiFp(configuration)
|
|
2330
2469
|
return {
|
|
2331
2470
|
/**
|
|
2332
|
-
*
|
|
2333
|
-
* @summary
|
|
2334
|
-
* @param {string}
|
|
2335
|
-
* @param {
|
|
2336
|
-
* @param {string | null} [associateUuid] Minecraft player UUID to associate with this IP address. When provided, the API will: - Link this connection to the player\'s history - Update the player\'s username from Mojang API - Return player information (first join status, first login time) in the response - Track connection history for fraud detection This operation is asynchronous and won\'t block the response.
|
|
2471
|
+
* 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.
|
|
2472
|
+
* @summary Discord - OAuth2 callback
|
|
2473
|
+
* @param {string | null} [code] Authorization code provided by Discord on successful approval
|
|
2474
|
+
* @param {string | null} [error] Error code provided by Discord if the user denied access
|
|
2337
2475
|
* @param {*} [options] Override http request option.
|
|
2338
2476
|
* @throws {RequiredError}
|
|
2339
2477
|
*/
|
|
2340
|
-
|
|
2341
|
-
return localVarFp.
|
|
2478
|
+
callback(code?: string | null, error?: string | null, options?: RawAxiosRequestConfig): AxiosPromise<void> {
|
|
2479
|
+
return localVarFp.callback(code, error, options).then((request) => request(axios, basePath));
|
|
2480
|
+
},
|
|
2481
|
+
/**
|
|
2482
|
+
* Redirects the browser to Discord\'s OAuth2 authorization page. Not called directly — the admin frontend navigates to this URL to begin the login flow.
|
|
2483
|
+
* @summary Discord - Initiate login
|
|
2484
|
+
* @param {*} [options] Override http request option.
|
|
2485
|
+
* @throws {RequiredError}
|
|
2486
|
+
*/
|
|
2487
|
+
initiateLogin(options?: RawAxiosRequestConfig): AxiosPromise<void> {
|
|
2488
|
+
return localVarFp.initiateLogin(options).then((request) => request(axios, basePath));
|
|
2489
|
+
},
|
|
2490
|
+
/**
|
|
2491
|
+
* Exchange service client credentials for a Bearer JWT using the OAuth2 client_credentials grant. Used by game server plugins to authenticate against the API.
|
|
2492
|
+
* @summary Service - Exchange client credentials for token
|
|
2493
|
+
* @param {string | null} [grantType]
|
|
2494
|
+
* @param {string | null} [clientId]
|
|
2495
|
+
* @param {string | null} [clientSecret]
|
|
2496
|
+
* @param {*} [options] Override http request option.
|
|
2497
|
+
* @throws {RequiredError}
|
|
2498
|
+
*/
|
|
2499
|
+
token(grantType?: string | null, clientId?: string | null, clientSecret?: string | null, options?: RawAxiosRequestConfig): AxiosPromise<object> {
|
|
2500
|
+
return localVarFp.token(grantType, clientId, clientSecret, options).then((request) => request(axios, basePath));
|
|
2342
2501
|
},
|
|
2343
2502
|
};
|
|
2344
2503
|
};
|
|
2345
2504
|
|
|
2346
2505
|
/**
|
|
2347
|
-
*
|
|
2506
|
+
* AuthenticationApi - object-oriented interface
|
|
2348
2507
|
*/
|
|
2349
|
-
export class
|
|
2508
|
+
export class AuthenticationApi extends BaseAPI {
|
|
2350
2509
|
/**
|
|
2351
|
-
*
|
|
2352
|
-
* @summary
|
|
2353
|
-
* @param {string}
|
|
2354
|
-
* @param {
|
|
2355
|
-
* @param {string | null} [associateUuid] Minecraft player UUID to associate with this IP address. When provided, the API will: - Link this connection to the player\'s history - Update the player\'s username from Mojang API - Return player information (first join status, first login time) in the response - Track connection history for fraud detection This operation is asynchronous and won\'t block the response.
|
|
2510
|
+
* 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.
|
|
2511
|
+
* @summary Discord - OAuth2 callback
|
|
2512
|
+
* @param {string | null} [code] Authorization code provided by Discord on successful approval
|
|
2513
|
+
* @param {string | null} [error] Error code provided by Discord if the user denied access
|
|
2356
2514
|
* @param {*} [options] Override http request option.
|
|
2357
2515
|
* @throws {RequiredError}
|
|
2358
2516
|
*/
|
|
2359
|
-
public
|
|
2360
|
-
return
|
|
2517
|
+
public callback(code?: string | null, error?: string | null, options?: RawAxiosRequestConfig) {
|
|
2518
|
+
return AuthenticationApiFp(this.configuration).callback(code, error, options).then((request) => request(this.axios, this.basePath));
|
|
2519
|
+
}
|
|
2520
|
+
|
|
2521
|
+
/**
|
|
2522
|
+
* Redirects the browser to Discord\'s OAuth2 authorization page. Not called directly — the admin frontend navigates to this URL to begin the login flow.
|
|
2523
|
+
* @summary Discord - Initiate login
|
|
2524
|
+
* @param {*} [options] Override http request option.
|
|
2525
|
+
* @throws {RequiredError}
|
|
2526
|
+
*/
|
|
2527
|
+
public initiateLogin(options?: RawAxiosRequestConfig) {
|
|
2528
|
+
return AuthenticationApiFp(this.configuration).initiateLogin(options).then((request) => request(this.axios, this.basePath));
|
|
2529
|
+
}
|
|
2530
|
+
|
|
2531
|
+
/**
|
|
2532
|
+
* Exchange service client credentials for a Bearer JWT using the OAuth2 client_credentials grant. Used by game server plugins to authenticate against the API.
|
|
2533
|
+
* @summary Service - Exchange client credentials for token
|
|
2534
|
+
* @param {string | null} [grantType]
|
|
2535
|
+
* @param {string | null} [clientId]
|
|
2536
|
+
* @param {string | null} [clientSecret]
|
|
2537
|
+
* @param {*} [options] Override http request option.
|
|
2538
|
+
* @throws {RequiredError}
|
|
2539
|
+
*/
|
|
2540
|
+
public token(grantType?: string | null, clientId?: string | null, clientSecret?: string | null, options?: RawAxiosRequestConfig) {
|
|
2541
|
+
return AuthenticationApiFp(this.configuration).token(grantType, clientId, clientSecret, options).then((request) => request(this.axios, this.basePath));
|
|
2361
2542
|
}
|
|
2362
2543
|
}
|
|
2363
2544
|
|
|
2364
2545
|
|
|
2365
2546
|
|
|
2366
2547
|
/**
|
|
2367
|
-
*
|
|
2548
|
+
* ChatApi - axios parameter creator
|
|
2368
2549
|
*/
|
|
2369
|
-
export const
|
|
2550
|
+
export const ChatApiAxiosParamCreator = function (configuration?: Configuration) {
|
|
2370
2551
|
return {
|
|
2371
2552
|
/**
|
|
2372
|
-
*
|
|
2373
|
-
* @
|
|
2374
|
-
* @param {
|
|
2553
|
+
* 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.
|
|
2554
|
+
* @summary Get chat history
|
|
2555
|
+
* @param {number} limit Maximum number of messages to return (1–100)
|
|
2556
|
+
* @param {string | null} [sessionId] Filter to a specific server session. Omit for global history.
|
|
2557
|
+
* @param {string | null} [before] ISO-8601 timestamp cursor — return messages sent before this time. Omit to start from now.
|
|
2375
2558
|
* @param {*} [options] Override http request option.
|
|
2376
2559
|
* @throws {RequiredError}
|
|
2377
2560
|
*/
|
|
2378
|
-
|
|
2379
|
-
|
|
2561
|
+
history: async (limit: number, sessionId?: string | null, before?: string | null, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
2562
|
+
// verify required parameter 'limit' is not null or undefined
|
|
2563
|
+
assertParamExists('history', 'limit', limit)
|
|
2564
|
+
const localVarPath = `/v1/chat`;
|
|
2380
2565
|
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
2381
2566
|
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
2382
2567
|
let baseOptions;
|
|
@@ -2392,12 +2577,16 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati
|
|
|
2392
2577
|
// http bearer authentication required
|
|
2393
2578
|
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
|
2394
2579
|
|
|
2395
|
-
if (
|
|
2396
|
-
localVarQueryParameter['
|
|
2580
|
+
if (sessionId !== undefined) {
|
|
2581
|
+
localVarQueryParameter['sessionId'] = sessionId;
|
|
2397
2582
|
}
|
|
2398
2583
|
|
|
2399
|
-
if (
|
|
2400
|
-
localVarQueryParameter['
|
|
2584
|
+
if (before !== undefined) {
|
|
2585
|
+
localVarQueryParameter['before'] = before;
|
|
2586
|
+
}
|
|
2587
|
+
|
|
2588
|
+
if (limit !== undefined) {
|
|
2589
|
+
localVarQueryParameter['limit'] = limit;
|
|
2401
2590
|
}
|
|
2402
2591
|
|
|
2403
2592
|
localVarHeaderParameter['Accept'] = 'application/json';
|
|
@@ -2412,12 +2601,16 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati
|
|
|
2412
2601
|
};
|
|
2413
2602
|
},
|
|
2414
2603
|
/**
|
|
2415
|
-
*
|
|
2604
|
+
* 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.
|
|
2605
|
+
* @summary Ingest a chat message
|
|
2606
|
+
* @param {ChatMessageRequest} chatMessageRequest
|
|
2416
2607
|
* @param {*} [options] Override http request option.
|
|
2417
2608
|
* @throws {RequiredError}
|
|
2418
2609
|
*/
|
|
2419
|
-
|
|
2420
|
-
|
|
2610
|
+
ingest: async (chatMessageRequest: ChatMessageRequest, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
2611
|
+
// verify required parameter 'chatMessageRequest' is not null or undefined
|
|
2612
|
+
assertParamExists('ingest', 'chatMessageRequest', chatMessageRequest)
|
|
2613
|
+
const localVarPath = `/v1/chat`;
|
|
2421
2614
|
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
2422
2615
|
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
2423
2616
|
let baseOptions;
|
|
@@ -2425,7 +2618,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati
|
|
|
2425
2618
|
baseOptions = configuration.baseOptions;
|
|
2426
2619
|
}
|
|
2427
2620
|
|
|
2428
|
-
const localVarRequestOptions = { method: '
|
|
2621
|
+
const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
|
|
2429
2622
|
const localVarHeaderParameter = {} as any;
|
|
2430
2623
|
const localVarQueryParameter = {} as any;
|
|
2431
2624
|
|
|
@@ -2433,11 +2626,13 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati
|
|
|
2433
2626
|
// http bearer authentication required
|
|
2434
2627
|
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
|
2435
2628
|
|
|
2629
|
+
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
2436
2630
|
localVarHeaderParameter['Accept'] = 'application/json';
|
|
2437
2631
|
|
|
2438
2632
|
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
2439
2633
|
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
2440
2634
|
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
2635
|
+
localVarRequestOptions.data = serializeDataIfNeeded(chatMessageRequest, localVarRequestOptions, configuration)
|
|
2441
2636
|
|
|
2442
2637
|
return {
|
|
2443
2638
|
url: toPathString(localVarUrlObj),
|
|
@@ -2448,109 +2643,125 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati
|
|
|
2448
2643
|
};
|
|
2449
2644
|
|
|
2450
2645
|
/**
|
|
2451
|
-
*
|
|
2646
|
+
* ChatApi - functional programming interface
|
|
2452
2647
|
*/
|
|
2453
|
-
export const
|
|
2454
|
-
const localVarAxiosParamCreator =
|
|
2648
|
+
export const ChatApiFp = function(configuration?: Configuration) {
|
|
2649
|
+
const localVarAxiosParamCreator = ChatApiAxiosParamCreator(configuration)
|
|
2455
2650
|
return {
|
|
2456
2651
|
/**
|
|
2457
|
-
*
|
|
2458
|
-
* @
|
|
2459
|
-
* @param {
|
|
2652
|
+
* 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.
|
|
2653
|
+
* @summary Get chat history
|
|
2654
|
+
* @param {number} limit Maximum number of messages to return (1–100)
|
|
2655
|
+
* @param {string | null} [sessionId] Filter to a specific server session. Omit for global history.
|
|
2656
|
+
* @param {string | null} [before] ISO-8601 timestamp cursor — return messages sent before this time. Omit to start from now.
|
|
2460
2657
|
* @param {*} [options] Override http request option.
|
|
2461
2658
|
* @throws {RequiredError}
|
|
2462
2659
|
*/
|
|
2463
|
-
async
|
|
2464
|
-
const localVarAxiosArgs = await localVarAxiosParamCreator.
|
|
2660
|
+
async history(limit: number, sessionId?: string | null, before?: string | null, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<ChatMessageDTO>>> {
|
|
2661
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.history(limit, sessionId, before, options);
|
|
2465
2662
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
2466
|
-
const localVarOperationServerBasePath = operationServerMap['
|
|
2663
|
+
const localVarOperationServerBasePath = operationServerMap['ChatApi.history']?.[localVarOperationServerIndex]?.url;
|
|
2467
2664
|
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
2468
2665
|
},
|
|
2469
2666
|
/**
|
|
2470
|
-
*
|
|
2667
|
+
* 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.
|
|
2668
|
+
* @summary Ingest a chat message
|
|
2669
|
+
* @param {ChatMessageRequest} chatMessageRequest
|
|
2471
2670
|
* @param {*} [options] Override http request option.
|
|
2472
2671
|
* @throws {RequiredError}
|
|
2473
2672
|
*/
|
|
2474
|
-
async
|
|
2475
|
-
const localVarAxiosArgs = await localVarAxiosParamCreator.
|
|
2673
|
+
async ingest(chatMessageRequest: ChatMessageRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ChatMessageDTO>> {
|
|
2674
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.ingest(chatMessageRequest, options);
|
|
2476
2675
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
2477
|
-
const localVarOperationServerBasePath = operationServerMap['
|
|
2676
|
+
const localVarOperationServerBasePath = operationServerMap['ChatApi.ingest']?.[localVarOperationServerIndex]?.url;
|
|
2478
2677
|
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
2479
2678
|
},
|
|
2480
2679
|
}
|
|
2481
2680
|
};
|
|
2482
2681
|
|
|
2483
2682
|
/**
|
|
2484
|
-
*
|
|
2683
|
+
* ChatApi - factory interface
|
|
2485
2684
|
*/
|
|
2486
|
-
export const
|
|
2487
|
-
const localVarFp =
|
|
2685
|
+
export const ChatApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
|
|
2686
|
+
const localVarFp = ChatApiFp(configuration)
|
|
2488
2687
|
return {
|
|
2489
2688
|
/**
|
|
2490
|
-
*
|
|
2491
|
-
* @
|
|
2492
|
-
* @param {
|
|
2689
|
+
* 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.
|
|
2690
|
+
* @summary Get chat history
|
|
2691
|
+
* @param {number} limit Maximum number of messages to return (1–100)
|
|
2692
|
+
* @param {string | null} [sessionId] Filter to a specific server session. Omit for global history.
|
|
2693
|
+
* @param {string | null} [before] ISO-8601 timestamp cursor — return messages sent before this time. Omit to start from now.
|
|
2493
2694
|
* @param {*} [options] Override http request option.
|
|
2494
2695
|
* @throws {RequiredError}
|
|
2495
2696
|
*/
|
|
2496
|
-
|
|
2497
|
-
return localVarFp.
|
|
2697
|
+
history(limit: number, sessionId?: string | null, before?: string | null, options?: RawAxiosRequestConfig): AxiosPromise<Array<ChatMessageDTO>> {
|
|
2698
|
+
return localVarFp.history(limit, sessionId, before, options).then((request) => request(axios, basePath));
|
|
2498
2699
|
},
|
|
2499
2700
|
/**
|
|
2500
|
-
*
|
|
2701
|
+
* 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.
|
|
2702
|
+
* @summary Ingest a chat message
|
|
2703
|
+
* @param {ChatMessageRequest} chatMessageRequest
|
|
2501
2704
|
* @param {*} [options] Override http request option.
|
|
2502
2705
|
* @throws {RequiredError}
|
|
2503
2706
|
*/
|
|
2504
|
-
|
|
2505
|
-
return localVarFp.
|
|
2707
|
+
ingest(chatMessageRequest: ChatMessageRequest, options?: RawAxiosRequestConfig): AxiosPromise<ChatMessageDTO> {
|
|
2708
|
+
return localVarFp.ingest(chatMessageRequest, options).then((request) => request(axios, basePath));
|
|
2506
2709
|
},
|
|
2507
2710
|
};
|
|
2508
2711
|
};
|
|
2509
2712
|
|
|
2510
2713
|
/**
|
|
2511
|
-
*
|
|
2714
|
+
* ChatApi - object-oriented interface
|
|
2512
2715
|
*/
|
|
2513
|
-
export class
|
|
2716
|
+
export class ChatApi extends BaseAPI {
|
|
2514
2717
|
/**
|
|
2515
|
-
*
|
|
2516
|
-
* @
|
|
2517
|
-
* @param {
|
|
2718
|
+
* 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.
|
|
2719
|
+
* @summary Get chat history
|
|
2720
|
+
* @param {number} limit Maximum number of messages to return (1–100)
|
|
2721
|
+
* @param {string | null} [sessionId] Filter to a specific server session. Omit for global history.
|
|
2722
|
+
* @param {string | null} [before] ISO-8601 timestamp cursor — return messages sent before this time. Omit to start from now.
|
|
2518
2723
|
* @param {*} [options] Override http request option.
|
|
2519
2724
|
* @throws {RequiredError}
|
|
2520
2725
|
*/
|
|
2521
|
-
public
|
|
2522
|
-
return
|
|
2726
|
+
public history(limit: number, sessionId?: string | null, before?: string | null, options?: RawAxiosRequestConfig) {
|
|
2727
|
+
return ChatApiFp(this.configuration).history(limit, sessionId, before, options).then((request) => request(this.axios, this.basePath));
|
|
2523
2728
|
}
|
|
2524
2729
|
|
|
2525
2730
|
/**
|
|
2526
|
-
*
|
|
2731
|
+
* 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.
|
|
2732
|
+
* @summary Ingest a chat message
|
|
2733
|
+
* @param {ChatMessageRequest} chatMessageRequest
|
|
2527
2734
|
* @param {*} [options] Override http request option.
|
|
2528
2735
|
* @throws {RequiredError}
|
|
2529
2736
|
*/
|
|
2530
|
-
public
|
|
2531
|
-
return
|
|
2737
|
+
public ingest(chatMessageRequest: ChatMessageRequest, options?: RawAxiosRequestConfig) {
|
|
2738
|
+
return ChatApiFp(this.configuration).ingest(chatMessageRequest, options).then((request) => request(this.axios, this.basePath));
|
|
2532
2739
|
}
|
|
2533
2740
|
}
|
|
2534
2741
|
|
|
2535
2742
|
|
|
2536
2743
|
|
|
2537
2744
|
/**
|
|
2538
|
-
*
|
|
2745
|
+
* ConnectionApi - axios parameter creator
|
|
2539
2746
|
*/
|
|
2540
|
-
export const
|
|
2747
|
+
export const ConnectionApiAxiosParamCreator = function (configuration?: Configuration) {
|
|
2541
2748
|
return {
|
|
2542
2749
|
/**
|
|
2543
|
-
*
|
|
2544
|
-
* @summary
|
|
2545
|
-
* @param {string}
|
|
2750
|
+
* Performs comprehensive analysis of an IPv4 address to detect VPN, proxy, or suspicious connections. **Features:** - Multi-provider VPN/proxy detection with aggregated confidence scoring - Approximate geolocation lookup (city and country) - Connection bypass status and expiration tracking - Optional player UUID association for connection history **Use Cases:** - Prevent VPN/proxy usage during player authentication - Track player connection history across sessions - Implement temporary bypass systems for false positives - Monitor suspicious connection patterns **Query Parameters:** - `force_recheck`: Bypass cache and re-run all detection services - `associate_uuid`: Link this IP to a player UUID and return player info **Caching:** Results are cached unless `force_recheck=true` is specified, reducing API costs and improving response times.
|
|
2751
|
+
* @summary Check Connection and Detect VPN/Proxy
|
|
2752
|
+
* @param {string} ip IPv4 address to analyze for VPN/proxy detection and geolocation
|
|
2753
|
+
* @param {boolean} forceRecheck When true, bypasses cached results and re-runs all VPN detection services. Use this when you need the most up-to-date analysis or suspect cached data may be stale. Default: false
|
|
2754
|
+
* @param {string | null} [associateUuid] Minecraft player UUID to associate with this IP address. When provided, the API will: - Link this connection to the player\'s history - Update the player\'s username from Mojang API - Return player information (first join status, first login time) in the response - Track connection history for fraud detection This operation is asynchronous and won\'t block the response.
|
|
2546
2755
|
* @param {*} [options] Override http request option.
|
|
2547
2756
|
* @throws {RequiredError}
|
|
2548
2757
|
*/
|
|
2549
|
-
|
|
2550
|
-
// verify required parameter '
|
|
2551
|
-
assertParamExists('
|
|
2552
|
-
|
|
2553
|
-
|
|
2758
|
+
getConnectionDetails: async (ip: string, forceRecheck: boolean, associateUuid?: string | null, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
2759
|
+
// verify required parameter 'ip' is not null or undefined
|
|
2760
|
+
assertParamExists('getConnectionDetails', 'ip', ip)
|
|
2761
|
+
// verify required parameter 'forceRecheck' is not null or undefined
|
|
2762
|
+
assertParamExists('getConnectionDetails', 'forceRecheck', forceRecheck)
|
|
2763
|
+
const localVarPath = `/v1/connection/get-connection-details/{ip}`
|
|
2764
|
+
.replace(`{${"ip"}}`, encodeURIComponent(String(ip)));
|
|
2554
2765
|
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
2555
2766
|
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
2556
2767
|
let baseOptions;
|
|
@@ -2566,6 +2777,14 @@ export const PlayerApiAxiosParamCreator = function (configuration?: Configuratio
|
|
|
2566
2777
|
// http bearer authentication required
|
|
2567
2778
|
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
|
2568
2779
|
|
|
2780
|
+
if (forceRecheck !== undefined) {
|
|
2781
|
+
localVarQueryParameter['force_recheck'] = forceRecheck;
|
|
2782
|
+
}
|
|
2783
|
+
|
|
2784
|
+
if (associateUuid !== undefined) {
|
|
2785
|
+
localVarQueryParameter['associate_uuid'] = associateUuid;
|
|
2786
|
+
}
|
|
2787
|
+
|
|
2569
2788
|
localVarHeaderParameter['Accept'] = 'application/json';
|
|
2570
2789
|
|
|
2571
2790
|
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
@@ -2581,43 +2800,218 @@ export const PlayerApiAxiosParamCreator = function (configuration?: Configuratio
|
|
|
2581
2800
|
};
|
|
2582
2801
|
|
|
2583
2802
|
/**
|
|
2584
|
-
*
|
|
2803
|
+
* ConnectionApi - functional programming interface
|
|
2585
2804
|
*/
|
|
2586
|
-
export const
|
|
2587
|
-
const localVarAxiosParamCreator =
|
|
2805
|
+
export const ConnectionApiFp = function(configuration?: Configuration) {
|
|
2806
|
+
const localVarAxiosParamCreator = ConnectionApiAxiosParamCreator(configuration)
|
|
2588
2807
|
return {
|
|
2589
2808
|
/**
|
|
2590
|
-
*
|
|
2591
|
-
* @summary
|
|
2592
|
-
* @param {string}
|
|
2809
|
+
* Performs comprehensive analysis of an IPv4 address to detect VPN, proxy, or suspicious connections. **Features:** - Multi-provider VPN/proxy detection with aggregated confidence scoring - Approximate geolocation lookup (city and country) - Connection bypass status and expiration tracking - Optional player UUID association for connection history **Use Cases:** - Prevent VPN/proxy usage during player authentication - Track player connection history across sessions - Implement temporary bypass systems for false positives - Monitor suspicious connection patterns **Query Parameters:** - `force_recheck`: Bypass cache and re-run all detection services - `associate_uuid`: Link this IP to a player UUID and return player info **Caching:** Results are cached unless `force_recheck=true` is specified, reducing API costs and improving response times.
|
|
2810
|
+
* @summary Check Connection and Detect VPN/Proxy
|
|
2811
|
+
* @param {string} ip IPv4 address to analyze for VPN/proxy detection and geolocation
|
|
2812
|
+
* @param {boolean} forceRecheck When true, bypasses cached results and re-runs all VPN detection services. Use this when you need the most up-to-date analysis or suspect cached data may be stale. Default: false
|
|
2813
|
+
* @param {string | null} [associateUuid] Minecraft player UUID to associate with this IP address. When provided, the API will: - Link this connection to the player\'s history - Update the player\'s username from Mojang API - Return player information (first join status, first login time) in the response - Track connection history for fraud detection This operation is asynchronous and won\'t block the response.
|
|
2593
2814
|
* @param {*} [options] Override http request option.
|
|
2594
2815
|
* @throws {RequiredError}
|
|
2595
2816
|
*/
|
|
2596
|
-
async
|
|
2597
|
-
const localVarAxiosArgs = await localVarAxiosParamCreator.
|
|
2817
|
+
async getConnectionDetails(ip: string, forceRecheck: boolean, associateUuid?: string | null, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ConnectionGetConnectionDetailsResponse>> {
|
|
2818
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.getConnectionDetails(ip, forceRecheck, associateUuid, options);
|
|
2598
2819
|
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
2599
|
-
const localVarOperationServerBasePath = operationServerMap['
|
|
2820
|
+
const localVarOperationServerBasePath = operationServerMap['ConnectionApi.getConnectionDetails']?.[localVarOperationServerIndex]?.url;
|
|
2600
2821
|
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
2601
2822
|
},
|
|
2602
2823
|
}
|
|
2603
2824
|
};
|
|
2604
2825
|
|
|
2605
2826
|
/**
|
|
2606
|
-
*
|
|
2827
|
+
* ConnectionApi - factory interface
|
|
2607
2828
|
*/
|
|
2608
|
-
export const
|
|
2609
|
-
const localVarFp =
|
|
2829
|
+
export const ConnectionApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
|
|
2830
|
+
const localVarFp = ConnectionApiFp(configuration)
|
|
2610
2831
|
return {
|
|
2611
2832
|
/**
|
|
2612
|
-
*
|
|
2613
|
-
* @summary
|
|
2614
|
-
* @param {string}
|
|
2833
|
+
* Performs comprehensive analysis of an IPv4 address to detect VPN, proxy, or suspicious connections. **Features:** - Multi-provider VPN/proxy detection with aggregated confidence scoring - Approximate geolocation lookup (city and country) - Connection bypass status and expiration tracking - Optional player UUID association for connection history **Use Cases:** - Prevent VPN/proxy usage during player authentication - Track player connection history across sessions - Implement temporary bypass systems for false positives - Monitor suspicious connection patterns **Query Parameters:** - `force_recheck`: Bypass cache and re-run all detection services - `associate_uuid`: Link this IP to a player UUID and return player info **Caching:** Results are cached unless `force_recheck=true` is specified, reducing API costs and improving response times.
|
|
2834
|
+
* @summary Check Connection and Detect VPN/Proxy
|
|
2835
|
+
* @param {string} ip IPv4 address to analyze for VPN/proxy detection and geolocation
|
|
2836
|
+
* @param {boolean} forceRecheck When true, bypasses cached results and re-runs all VPN detection services. Use this when you need the most up-to-date analysis or suspect cached data may be stale. Default: false
|
|
2837
|
+
* @param {string | null} [associateUuid] Minecraft player UUID to associate with this IP address. When provided, the API will: - Link this connection to the player\'s history - Update the player\'s username from Mojang API - Return player information (first join status, first login time) in the response - Track connection history for fraud detection This operation is asynchronous and won\'t block the response.
|
|
2615
2838
|
* @param {*} [options] Override http request option.
|
|
2616
2839
|
* @throws {RequiredError}
|
|
2617
2840
|
*/
|
|
2618
|
-
|
|
2619
|
-
return localVarFp.
|
|
2620
|
-
},
|
|
2841
|
+
getConnectionDetails(ip: string, forceRecheck: boolean, associateUuid?: string | null, options?: RawAxiosRequestConfig): AxiosPromise<ConnectionGetConnectionDetailsResponse> {
|
|
2842
|
+
return localVarFp.getConnectionDetails(ip, forceRecheck, associateUuid, options).then((request) => request(axios, basePath));
|
|
2843
|
+
},
|
|
2844
|
+
};
|
|
2845
|
+
};
|
|
2846
|
+
|
|
2847
|
+
/**
|
|
2848
|
+
* ConnectionApi - object-oriented interface
|
|
2849
|
+
*/
|
|
2850
|
+
export class ConnectionApi extends BaseAPI {
|
|
2851
|
+
/**
|
|
2852
|
+
* Performs comprehensive analysis of an IPv4 address to detect VPN, proxy, or suspicious connections. **Features:** - Multi-provider VPN/proxy detection with aggregated confidence scoring - Approximate geolocation lookup (city and country) - Connection bypass status and expiration tracking - Optional player UUID association for connection history **Use Cases:** - Prevent VPN/proxy usage during player authentication - Track player connection history across sessions - Implement temporary bypass systems for false positives - Monitor suspicious connection patterns **Query Parameters:** - `force_recheck`: Bypass cache and re-run all detection services - `associate_uuid`: Link this IP to a player UUID and return player info **Caching:** Results are cached unless `force_recheck=true` is specified, reducing API costs and improving response times.
|
|
2853
|
+
* @summary Check Connection and Detect VPN/Proxy
|
|
2854
|
+
* @param {string} ip IPv4 address to analyze for VPN/proxy detection and geolocation
|
|
2855
|
+
* @param {boolean} forceRecheck When true, bypasses cached results and re-runs all VPN detection services. Use this when you need the most up-to-date analysis or suspect cached data may be stale. Default: false
|
|
2856
|
+
* @param {string | null} [associateUuid] Minecraft player UUID to associate with this IP address. When provided, the API will: - Link this connection to the player\'s history - Update the player\'s username from Mojang API - Return player information (first join status, first login time) in the response - Track connection history for fraud detection This operation is asynchronous and won\'t block the response.
|
|
2857
|
+
* @param {*} [options] Override http request option.
|
|
2858
|
+
* @throws {RequiredError}
|
|
2859
|
+
*/
|
|
2860
|
+
public getConnectionDetails(ip: string, forceRecheck: boolean, associateUuid?: string | null, options?: RawAxiosRequestConfig) {
|
|
2861
|
+
return ConnectionApiFp(this.configuration).getConnectionDetails(ip, forceRecheck, associateUuid, options).then((request) => request(this.axios, this.basePath));
|
|
2862
|
+
}
|
|
2863
|
+
}
|
|
2864
|
+
|
|
2865
|
+
|
|
2866
|
+
|
|
2867
|
+
/**
|
|
2868
|
+
* PlayerApi - axios parameter creator
|
|
2869
|
+
*/
|
|
2870
|
+
export const PlayerApiAxiosParamCreator = function (configuration?: Configuration) {
|
|
2871
|
+
return {
|
|
2872
|
+
/**
|
|
2873
|
+
* Retrieves player information by their Minecraft UUID. Returns whether this is the player\'s first join and their first login timestamp. This endpoint is useful for tracking player join history and implementing first-join rewards or tutorials.
|
|
2874
|
+
* @summary Get player information
|
|
2875
|
+
* @param {string} uuid The Minecraft player UUID (with or without dashes)
|
|
2876
|
+
* @param {*} [options] Override http request option.
|
|
2877
|
+
* @throws {RequiredError}
|
|
2878
|
+
*/
|
|
2879
|
+
getPlayer1: async (uuid: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
2880
|
+
// verify required parameter 'uuid' is not null or undefined
|
|
2881
|
+
assertParamExists('getPlayer1', 'uuid', uuid)
|
|
2882
|
+
const localVarPath = `/v1/player/{uuid}`
|
|
2883
|
+
.replace(`{${"uuid"}}`, encodeURIComponent(String(uuid)));
|
|
2884
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
2885
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
2886
|
+
let baseOptions;
|
|
2887
|
+
if (configuration) {
|
|
2888
|
+
baseOptions = configuration.baseOptions;
|
|
2889
|
+
}
|
|
2890
|
+
|
|
2891
|
+
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
|
|
2892
|
+
const localVarHeaderParameter = {} as any;
|
|
2893
|
+
const localVarQueryParameter = {} as any;
|
|
2894
|
+
|
|
2895
|
+
// authentication DiscordAuth required
|
|
2896
|
+
// http bearer authentication required
|
|
2897
|
+
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
|
2898
|
+
|
|
2899
|
+
localVarHeaderParameter['Accept'] = 'application/json';
|
|
2900
|
+
|
|
2901
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
2902
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
2903
|
+
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
2904
|
+
|
|
2905
|
+
return {
|
|
2906
|
+
url: toPathString(localVarUrlObj),
|
|
2907
|
+
options: localVarRequestOptions,
|
|
2908
|
+
};
|
|
2909
|
+
},
|
|
2910
|
+
/**
|
|
2911
|
+
* 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.
|
|
2912
|
+
* @summary Batch resolve UUIDs to usernames
|
|
2913
|
+
* @param {Array<string>} uuids List of player UUIDs to resolve (repeatable query param)
|
|
2914
|
+
* @param {*} [options] Override http request option.
|
|
2915
|
+
* @throws {RequiredError}
|
|
2916
|
+
*/
|
|
2917
|
+
getUsernames: async (uuids: Array<string>, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
2918
|
+
// verify required parameter 'uuids' is not null or undefined
|
|
2919
|
+
assertParamExists('getUsernames', 'uuids', uuids)
|
|
2920
|
+
const localVarPath = `/v1/player/usernames`;
|
|
2921
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
2922
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
2923
|
+
let baseOptions;
|
|
2924
|
+
if (configuration) {
|
|
2925
|
+
baseOptions = configuration.baseOptions;
|
|
2926
|
+
}
|
|
2927
|
+
|
|
2928
|
+
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
|
|
2929
|
+
const localVarHeaderParameter = {} as any;
|
|
2930
|
+
const localVarQueryParameter = {} as any;
|
|
2931
|
+
|
|
2932
|
+
// authentication DiscordAuth required
|
|
2933
|
+
// http bearer authentication required
|
|
2934
|
+
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
|
2935
|
+
|
|
2936
|
+
if (uuids) {
|
|
2937
|
+
localVarQueryParameter['uuids'] = uuids.join(COLLECTION_FORMATS.csv);
|
|
2938
|
+
}
|
|
2939
|
+
|
|
2940
|
+
localVarHeaderParameter['Accept'] = 'application/json';
|
|
2941
|
+
|
|
2942
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
2943
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
2944
|
+
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
2945
|
+
|
|
2946
|
+
return {
|
|
2947
|
+
url: toPathString(localVarUrlObj),
|
|
2948
|
+
options: localVarRequestOptions,
|
|
2949
|
+
};
|
|
2950
|
+
},
|
|
2951
|
+
}
|
|
2952
|
+
};
|
|
2953
|
+
|
|
2954
|
+
/**
|
|
2955
|
+
* PlayerApi - functional programming interface
|
|
2956
|
+
*/
|
|
2957
|
+
export const PlayerApiFp = function(configuration?: Configuration) {
|
|
2958
|
+
const localVarAxiosParamCreator = PlayerApiAxiosParamCreator(configuration)
|
|
2959
|
+
return {
|
|
2960
|
+
/**
|
|
2961
|
+
* Retrieves player information by their Minecraft UUID. Returns whether this is the player\'s first join and their first login timestamp. This endpoint is useful for tracking player join history and implementing first-join rewards or tutorials.
|
|
2962
|
+
* @summary Get player information
|
|
2963
|
+
* @param {string} uuid The Minecraft player UUID (with or without dashes)
|
|
2964
|
+
* @param {*} [options] Override http request option.
|
|
2965
|
+
* @throws {RequiredError}
|
|
2966
|
+
*/
|
|
2967
|
+
async getPlayer1(uuid: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<PlayerGetPlayerInformation>> {
|
|
2968
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.getPlayer1(uuid, options);
|
|
2969
|
+
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
2970
|
+
const localVarOperationServerBasePath = operationServerMap['PlayerApi.getPlayer1']?.[localVarOperationServerIndex]?.url;
|
|
2971
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
2972
|
+
},
|
|
2973
|
+
/**
|
|
2974
|
+
* 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.
|
|
2975
|
+
* @summary Batch resolve UUIDs to usernames
|
|
2976
|
+
* @param {Array<string>} uuids List of player UUIDs to resolve (repeatable query param)
|
|
2977
|
+
* @param {*} [options] Override http request option.
|
|
2978
|
+
* @throws {RequiredError}
|
|
2979
|
+
*/
|
|
2980
|
+
async getUsernames(uuids: Array<string>, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
|
|
2981
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.getUsernames(uuids, options);
|
|
2982
|
+
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
2983
|
+
const localVarOperationServerBasePath = operationServerMap['PlayerApi.getUsernames']?.[localVarOperationServerIndex]?.url;
|
|
2984
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
2985
|
+
},
|
|
2986
|
+
}
|
|
2987
|
+
};
|
|
2988
|
+
|
|
2989
|
+
/**
|
|
2990
|
+
* PlayerApi - factory interface
|
|
2991
|
+
*/
|
|
2992
|
+
export const PlayerApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
|
|
2993
|
+
const localVarFp = PlayerApiFp(configuration)
|
|
2994
|
+
return {
|
|
2995
|
+
/**
|
|
2996
|
+
* Retrieves player information by their Minecraft UUID. Returns whether this is the player\'s first join and their first login timestamp. This endpoint is useful for tracking player join history and implementing first-join rewards or tutorials.
|
|
2997
|
+
* @summary Get player information
|
|
2998
|
+
* @param {string} uuid The Minecraft player UUID (with or without dashes)
|
|
2999
|
+
* @param {*} [options] Override http request option.
|
|
3000
|
+
* @throws {RequiredError}
|
|
3001
|
+
*/
|
|
3002
|
+
getPlayer1(uuid: string, options?: RawAxiosRequestConfig): AxiosPromise<PlayerGetPlayerInformation> {
|
|
3003
|
+
return localVarFp.getPlayer1(uuid, options).then((request) => request(axios, basePath));
|
|
3004
|
+
},
|
|
3005
|
+
/**
|
|
3006
|
+
* 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.
|
|
3007
|
+
* @summary Batch resolve UUIDs to usernames
|
|
3008
|
+
* @param {Array<string>} uuids List of player UUIDs to resolve (repeatable query param)
|
|
3009
|
+
* @param {*} [options] Override http request option.
|
|
3010
|
+
* @throws {RequiredError}
|
|
3011
|
+
*/
|
|
3012
|
+
getUsernames(uuids: Array<string>, options?: RawAxiosRequestConfig): AxiosPromise<void> {
|
|
3013
|
+
return localVarFp.getUsernames(uuids, options).then((request) => request(axios, basePath));
|
|
3014
|
+
},
|
|
2621
3015
|
};
|
|
2622
3016
|
};
|
|
2623
3017
|
|
|
@@ -2627,7 +3021,7 @@ export const PlayerApiFactory = function (configuration?: Configuration, basePat
|
|
|
2627
3021
|
export class PlayerApi extends BaseAPI {
|
|
2628
3022
|
/**
|
|
2629
3023
|
* Retrieves player information by their Minecraft UUID. Returns whether this is the player\'s first join and their first login timestamp. This endpoint is useful for tracking player join history and implementing first-join rewards or tutorials.
|
|
2630
|
-
* @summary Get
|
|
3024
|
+
* @summary Get player information
|
|
2631
3025
|
* @param {string} uuid The Minecraft player UUID (with or without dashes)
|
|
2632
3026
|
* @param {*} [options] Override http request option.
|
|
2633
3027
|
* @throws {RequiredError}
|
|
@@ -2635,6 +3029,17 @@ export class PlayerApi extends BaseAPI {
|
|
|
2635
3029
|
public getPlayer1(uuid: string, options?: RawAxiosRequestConfig) {
|
|
2636
3030
|
return PlayerApiFp(this.configuration).getPlayer1(uuid, options).then((request) => request(this.axios, this.basePath));
|
|
2637
3031
|
}
|
|
3032
|
+
|
|
3033
|
+
/**
|
|
3034
|
+
* 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.
|
|
3035
|
+
* @summary Batch resolve UUIDs to usernames
|
|
3036
|
+
* @param {Array<string>} uuids List of player UUIDs to resolve (repeatable query param)
|
|
3037
|
+
* @param {*} [options] Override http request option.
|
|
3038
|
+
* @throws {RequiredError}
|
|
3039
|
+
*/
|
|
3040
|
+
public getUsernames(uuids: Array<string>, options?: RawAxiosRequestConfig) {
|
|
3041
|
+
return PlayerApiFp(this.configuration).getUsernames(uuids, options).then((request) => request(this.axios, this.basePath));
|
|
3042
|
+
}
|
|
2638
3043
|
}
|
|
2639
3044
|
|
|
2640
3045
|
|
|
@@ -3050,3 +3455,381 @@ export class PunishmentApi extends BaseAPI {
|
|
|
3050
3455
|
|
|
3051
3456
|
|
|
3052
3457
|
|
|
3458
|
+
/**
|
|
3459
|
+
* ServerSessionsApi - axios parameter creator
|
|
3460
|
+
*/
|
|
3461
|
+
export const ServerSessionsApiAxiosParamCreator = function (configuration?: Configuration) {
|
|
3462
|
+
return {
|
|
3463
|
+
/**
|
|
3464
|
+
* 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.
|
|
3465
|
+
* @summary Send a heartbeat
|
|
3466
|
+
* @param {string} id Session UUID returned from the registration call
|
|
3467
|
+
* @param {*} [options] Override http request option.
|
|
3468
|
+
* @throws {RequiredError}
|
|
3469
|
+
*/
|
|
3470
|
+
heartbeat: async (id: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
3471
|
+
// verify required parameter 'id' is not null or undefined
|
|
3472
|
+
assertParamExists('heartbeat', 'id', id)
|
|
3473
|
+
const localVarPath = `/v1/servers/{id}/heartbeat`
|
|
3474
|
+
.replace(`{${"id"}}`, encodeURIComponent(String(id)));
|
|
3475
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
3476
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
3477
|
+
let baseOptions;
|
|
3478
|
+
if (configuration) {
|
|
3479
|
+
baseOptions = configuration.baseOptions;
|
|
3480
|
+
}
|
|
3481
|
+
|
|
3482
|
+
const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options};
|
|
3483
|
+
const localVarHeaderParameter = {} as any;
|
|
3484
|
+
const localVarQueryParameter = {} as any;
|
|
3485
|
+
|
|
3486
|
+
// authentication DiscordAuth required
|
|
3487
|
+
// http bearer authentication required
|
|
3488
|
+
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
|
3489
|
+
|
|
3490
|
+
|
|
3491
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
3492
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
3493
|
+
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
3494
|
+
|
|
3495
|
+
return {
|
|
3496
|
+
url: toPathString(localVarUrlObj),
|
|
3497
|
+
options: localVarRequestOptions,
|
|
3498
|
+
};
|
|
3499
|
+
},
|
|
3500
|
+
/**
|
|
3501
|
+
* Returns all server sessions — both online and historical — ordered by start time descending. Used by the web UI to populate the session filter dropdown.
|
|
3502
|
+
* @summary List all server sessions
|
|
3503
|
+
* @param {*} [options] Override http request option.
|
|
3504
|
+
* @throws {RequiredError}
|
|
3505
|
+
*/
|
|
3506
|
+
listAll: async (options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
3507
|
+
const localVarPath = `/v1/servers/history`;
|
|
3508
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
3509
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
3510
|
+
let baseOptions;
|
|
3511
|
+
if (configuration) {
|
|
3512
|
+
baseOptions = configuration.baseOptions;
|
|
3513
|
+
}
|
|
3514
|
+
|
|
3515
|
+
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
|
|
3516
|
+
const localVarHeaderParameter = {} as any;
|
|
3517
|
+
const localVarQueryParameter = {} as any;
|
|
3518
|
+
|
|
3519
|
+
// authentication DiscordAuth required
|
|
3520
|
+
// http bearer authentication required
|
|
3521
|
+
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
|
3522
|
+
|
|
3523
|
+
localVarHeaderParameter['Accept'] = 'application/json';
|
|
3524
|
+
|
|
3525
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
3526
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
3527
|
+
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
3528
|
+
|
|
3529
|
+
return {
|
|
3530
|
+
url: toPathString(localVarUrlObj),
|
|
3531
|
+
options: localVarRequestOptions,
|
|
3532
|
+
};
|
|
3533
|
+
},
|
|
3534
|
+
/**
|
|
3535
|
+
* Returns all currently online server sessions, ordered by start time descending.
|
|
3536
|
+
* @summary List online server sessions
|
|
3537
|
+
* @param {*} [options] Override http request option.
|
|
3538
|
+
* @throws {RequiredError}
|
|
3539
|
+
*/
|
|
3540
|
+
listOnline: async (options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
3541
|
+
const localVarPath = `/v1/servers`;
|
|
3542
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
3543
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
3544
|
+
let baseOptions;
|
|
3545
|
+
if (configuration) {
|
|
3546
|
+
baseOptions = configuration.baseOptions;
|
|
3547
|
+
}
|
|
3548
|
+
|
|
3549
|
+
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
|
|
3550
|
+
const localVarHeaderParameter = {} as any;
|
|
3551
|
+
const localVarQueryParameter = {} as any;
|
|
3552
|
+
|
|
3553
|
+
// authentication DiscordAuth required
|
|
3554
|
+
// http bearer authentication required
|
|
3555
|
+
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
|
3556
|
+
|
|
3557
|
+
localVarHeaderParameter['Accept'] = 'application/json';
|
|
3558
|
+
|
|
3559
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
3560
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
3561
|
+
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
3562
|
+
|
|
3563
|
+
return {
|
|
3564
|
+
url: toPathString(localVarUrlObj),
|
|
3565
|
+
options: localVarRequestOptions,
|
|
3566
|
+
};
|
|
3567
|
+
},
|
|
3568
|
+
/**
|
|
3569
|
+
* 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.
|
|
3570
|
+
* @summary Mark a session offline
|
|
3571
|
+
* @param {string} id Session UUID returned from the registration call
|
|
3572
|
+
* @param {*} [options] Override http request option.
|
|
3573
|
+
* @throws {RequiredError}
|
|
3574
|
+
*/
|
|
3575
|
+
markOffline: async (id: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
3576
|
+
// verify required parameter 'id' is not null or undefined
|
|
3577
|
+
assertParamExists('markOffline', 'id', id)
|
|
3578
|
+
const localVarPath = `/v1/servers/{id}/offline`
|
|
3579
|
+
.replace(`{${"id"}}`, encodeURIComponent(String(id)));
|
|
3580
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
3581
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
3582
|
+
let baseOptions;
|
|
3583
|
+
if (configuration) {
|
|
3584
|
+
baseOptions = configuration.baseOptions;
|
|
3585
|
+
}
|
|
3586
|
+
|
|
3587
|
+
const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options};
|
|
3588
|
+
const localVarHeaderParameter = {} as any;
|
|
3589
|
+
const localVarQueryParameter = {} as any;
|
|
3590
|
+
|
|
3591
|
+
// authentication DiscordAuth required
|
|
3592
|
+
// http bearer authentication required
|
|
3593
|
+
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
|
3594
|
+
|
|
3595
|
+
|
|
3596
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
3597
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
3598
|
+
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
3599
|
+
|
|
3600
|
+
return {
|
|
3601
|
+
url: toPathString(localVarUrlObj),
|
|
3602
|
+
options: localVarRequestOptions,
|
|
3603
|
+
};
|
|
3604
|
+
},
|
|
3605
|
+
/**
|
|
3606
|
+
* 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.
|
|
3607
|
+
* @summary Register a server session
|
|
3608
|
+
* @param {ServerRegisterRequest} serverRegisterRequest
|
|
3609
|
+
* @param {*} [options] Override http request option.
|
|
3610
|
+
* @throws {RequiredError}
|
|
3611
|
+
*/
|
|
3612
|
+
register: async (serverRegisterRequest: ServerRegisterRequest, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
3613
|
+
// verify required parameter 'serverRegisterRequest' is not null or undefined
|
|
3614
|
+
assertParamExists('register', 'serverRegisterRequest', serverRegisterRequest)
|
|
3615
|
+
const localVarPath = `/v1/servers`;
|
|
3616
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
3617
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
3618
|
+
let baseOptions;
|
|
3619
|
+
if (configuration) {
|
|
3620
|
+
baseOptions = configuration.baseOptions;
|
|
3621
|
+
}
|
|
3622
|
+
|
|
3623
|
+
const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
|
|
3624
|
+
const localVarHeaderParameter = {} as any;
|
|
3625
|
+
const localVarQueryParameter = {} as any;
|
|
3626
|
+
|
|
3627
|
+
// authentication DiscordAuth required
|
|
3628
|
+
// http bearer authentication required
|
|
3629
|
+
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
|
3630
|
+
|
|
3631
|
+
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
3632
|
+
localVarHeaderParameter['Accept'] = 'application/json';
|
|
3633
|
+
|
|
3634
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
3635
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
3636
|
+
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
3637
|
+
localVarRequestOptions.data = serializeDataIfNeeded(serverRegisterRequest, localVarRequestOptions, configuration)
|
|
3638
|
+
|
|
3639
|
+
return {
|
|
3640
|
+
url: toPathString(localVarUrlObj),
|
|
3641
|
+
options: localVarRequestOptions,
|
|
3642
|
+
};
|
|
3643
|
+
},
|
|
3644
|
+
}
|
|
3645
|
+
};
|
|
3646
|
+
|
|
3647
|
+
/**
|
|
3648
|
+
* ServerSessionsApi - functional programming interface
|
|
3649
|
+
*/
|
|
3650
|
+
export const ServerSessionsApiFp = function(configuration?: Configuration) {
|
|
3651
|
+
const localVarAxiosParamCreator = ServerSessionsApiAxiosParamCreator(configuration)
|
|
3652
|
+
return {
|
|
3653
|
+
/**
|
|
3654
|
+
* 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.
|
|
3655
|
+
* @summary Send a heartbeat
|
|
3656
|
+
* @param {string} id Session UUID returned from the registration call
|
|
3657
|
+
* @param {*} [options] Override http request option.
|
|
3658
|
+
* @throws {RequiredError}
|
|
3659
|
+
*/
|
|
3660
|
+
async heartbeat(id: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
|
|
3661
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.heartbeat(id, options);
|
|
3662
|
+
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
3663
|
+
const localVarOperationServerBasePath = operationServerMap['ServerSessionsApi.heartbeat']?.[localVarOperationServerIndex]?.url;
|
|
3664
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
3665
|
+
},
|
|
3666
|
+
/**
|
|
3667
|
+
* Returns all server sessions — both online and historical — ordered by start time descending. Used by the web UI to populate the session filter dropdown.
|
|
3668
|
+
* @summary List all server sessions
|
|
3669
|
+
* @param {*} [options] Override http request option.
|
|
3670
|
+
* @throws {RequiredError}
|
|
3671
|
+
*/
|
|
3672
|
+
async listAll(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<ServerSessionDTO>>> {
|
|
3673
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.listAll(options);
|
|
3674
|
+
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
3675
|
+
const localVarOperationServerBasePath = operationServerMap['ServerSessionsApi.listAll']?.[localVarOperationServerIndex]?.url;
|
|
3676
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
3677
|
+
},
|
|
3678
|
+
/**
|
|
3679
|
+
* Returns all currently online server sessions, ordered by start time descending.
|
|
3680
|
+
* @summary List online server sessions
|
|
3681
|
+
* @param {*} [options] Override http request option.
|
|
3682
|
+
* @throws {RequiredError}
|
|
3683
|
+
*/
|
|
3684
|
+
async listOnline(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<ServerSessionDTO>>> {
|
|
3685
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.listOnline(options);
|
|
3686
|
+
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
3687
|
+
const localVarOperationServerBasePath = operationServerMap['ServerSessionsApi.listOnline']?.[localVarOperationServerIndex]?.url;
|
|
3688
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
3689
|
+
},
|
|
3690
|
+
/**
|
|
3691
|
+
* 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.
|
|
3692
|
+
* @summary Mark a session offline
|
|
3693
|
+
* @param {string} id Session UUID returned from the registration call
|
|
3694
|
+
* @param {*} [options] Override http request option.
|
|
3695
|
+
* @throws {RequiredError}
|
|
3696
|
+
*/
|
|
3697
|
+
async markOffline(id: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
|
|
3698
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.markOffline(id, options);
|
|
3699
|
+
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
3700
|
+
const localVarOperationServerBasePath = operationServerMap['ServerSessionsApi.markOffline']?.[localVarOperationServerIndex]?.url;
|
|
3701
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
3702
|
+
},
|
|
3703
|
+
/**
|
|
3704
|
+
* 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.
|
|
3705
|
+
* @summary Register a server session
|
|
3706
|
+
* @param {ServerRegisterRequest} serverRegisterRequest
|
|
3707
|
+
* @param {*} [options] Override http request option.
|
|
3708
|
+
* @throws {RequiredError}
|
|
3709
|
+
*/
|
|
3710
|
+
async register(serverRegisterRequest: ServerRegisterRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ServerSessionDTO>> {
|
|
3711
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.register(serverRegisterRequest, options);
|
|
3712
|
+
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
3713
|
+
const localVarOperationServerBasePath = operationServerMap['ServerSessionsApi.register']?.[localVarOperationServerIndex]?.url;
|
|
3714
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
3715
|
+
},
|
|
3716
|
+
}
|
|
3717
|
+
};
|
|
3718
|
+
|
|
3719
|
+
/**
|
|
3720
|
+
* ServerSessionsApi - factory interface
|
|
3721
|
+
*/
|
|
3722
|
+
export const ServerSessionsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
|
|
3723
|
+
const localVarFp = ServerSessionsApiFp(configuration)
|
|
3724
|
+
return {
|
|
3725
|
+
/**
|
|
3726
|
+
* 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.
|
|
3727
|
+
* @summary Send a heartbeat
|
|
3728
|
+
* @param {string} id Session UUID returned from the registration call
|
|
3729
|
+
* @param {*} [options] Override http request option.
|
|
3730
|
+
* @throws {RequiredError}
|
|
3731
|
+
*/
|
|
3732
|
+
heartbeat(id: string, options?: RawAxiosRequestConfig): AxiosPromise<void> {
|
|
3733
|
+
return localVarFp.heartbeat(id, options).then((request) => request(axios, basePath));
|
|
3734
|
+
},
|
|
3735
|
+
/**
|
|
3736
|
+
* Returns all server sessions — both online and historical — ordered by start time descending. Used by the web UI to populate the session filter dropdown.
|
|
3737
|
+
* @summary List all server sessions
|
|
3738
|
+
* @param {*} [options] Override http request option.
|
|
3739
|
+
* @throws {RequiredError}
|
|
3740
|
+
*/
|
|
3741
|
+
listAll(options?: RawAxiosRequestConfig): AxiosPromise<Array<ServerSessionDTO>> {
|
|
3742
|
+
return localVarFp.listAll(options).then((request) => request(axios, basePath));
|
|
3743
|
+
},
|
|
3744
|
+
/**
|
|
3745
|
+
* Returns all currently online server sessions, ordered by start time descending.
|
|
3746
|
+
* @summary List online server sessions
|
|
3747
|
+
* @param {*} [options] Override http request option.
|
|
3748
|
+
* @throws {RequiredError}
|
|
3749
|
+
*/
|
|
3750
|
+
listOnline(options?: RawAxiosRequestConfig): AxiosPromise<Array<ServerSessionDTO>> {
|
|
3751
|
+
return localVarFp.listOnline(options).then((request) => request(axios, basePath));
|
|
3752
|
+
},
|
|
3753
|
+
/**
|
|
3754
|
+
* 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.
|
|
3755
|
+
* @summary Mark a session offline
|
|
3756
|
+
* @param {string} id Session UUID returned from the registration call
|
|
3757
|
+
* @param {*} [options] Override http request option.
|
|
3758
|
+
* @throws {RequiredError}
|
|
3759
|
+
*/
|
|
3760
|
+
markOffline(id: string, options?: RawAxiosRequestConfig): AxiosPromise<void> {
|
|
3761
|
+
return localVarFp.markOffline(id, options).then((request) => request(axios, basePath));
|
|
3762
|
+
},
|
|
3763
|
+
/**
|
|
3764
|
+
* 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.
|
|
3765
|
+
* @summary Register a server session
|
|
3766
|
+
* @param {ServerRegisterRequest} serverRegisterRequest
|
|
3767
|
+
* @param {*} [options] Override http request option.
|
|
3768
|
+
* @throws {RequiredError}
|
|
3769
|
+
*/
|
|
3770
|
+
register(serverRegisterRequest: ServerRegisterRequest, options?: RawAxiosRequestConfig): AxiosPromise<ServerSessionDTO> {
|
|
3771
|
+
return localVarFp.register(serverRegisterRequest, options).then((request) => request(axios, basePath));
|
|
3772
|
+
},
|
|
3773
|
+
};
|
|
3774
|
+
};
|
|
3775
|
+
|
|
3776
|
+
/**
|
|
3777
|
+
* ServerSessionsApi - object-oriented interface
|
|
3778
|
+
*/
|
|
3779
|
+
export class ServerSessionsApi extends BaseAPI {
|
|
3780
|
+
/**
|
|
3781
|
+
* 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.
|
|
3782
|
+
* @summary Send a heartbeat
|
|
3783
|
+
* @param {string} id Session UUID returned from the registration call
|
|
3784
|
+
* @param {*} [options] Override http request option.
|
|
3785
|
+
* @throws {RequiredError}
|
|
3786
|
+
*/
|
|
3787
|
+
public heartbeat(id: string, options?: RawAxiosRequestConfig) {
|
|
3788
|
+
return ServerSessionsApiFp(this.configuration).heartbeat(id, options).then((request) => request(this.axios, this.basePath));
|
|
3789
|
+
}
|
|
3790
|
+
|
|
3791
|
+
/**
|
|
3792
|
+
* Returns all server sessions — both online and historical — ordered by start time descending. Used by the web UI to populate the session filter dropdown.
|
|
3793
|
+
* @summary List all server sessions
|
|
3794
|
+
* @param {*} [options] Override http request option.
|
|
3795
|
+
* @throws {RequiredError}
|
|
3796
|
+
*/
|
|
3797
|
+
public listAll(options?: RawAxiosRequestConfig) {
|
|
3798
|
+
return ServerSessionsApiFp(this.configuration).listAll(options).then((request) => request(this.axios, this.basePath));
|
|
3799
|
+
}
|
|
3800
|
+
|
|
3801
|
+
/**
|
|
3802
|
+
* Returns all currently online server sessions, ordered by start time descending.
|
|
3803
|
+
* @summary List online server sessions
|
|
3804
|
+
* @param {*} [options] Override http request option.
|
|
3805
|
+
* @throws {RequiredError}
|
|
3806
|
+
*/
|
|
3807
|
+
public listOnline(options?: RawAxiosRequestConfig) {
|
|
3808
|
+
return ServerSessionsApiFp(this.configuration).listOnline(options).then((request) => request(this.axios, this.basePath));
|
|
3809
|
+
}
|
|
3810
|
+
|
|
3811
|
+
/**
|
|
3812
|
+
* 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.
|
|
3813
|
+
* @summary Mark a session offline
|
|
3814
|
+
* @param {string} id Session UUID returned from the registration call
|
|
3815
|
+
* @param {*} [options] Override http request option.
|
|
3816
|
+
* @throws {RequiredError}
|
|
3817
|
+
*/
|
|
3818
|
+
public markOffline(id: string, options?: RawAxiosRequestConfig) {
|
|
3819
|
+
return ServerSessionsApiFp(this.configuration).markOffline(id, options).then((request) => request(this.axios, this.basePath));
|
|
3820
|
+
}
|
|
3821
|
+
|
|
3822
|
+
/**
|
|
3823
|
+
* 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.
|
|
3824
|
+
* @summary Register a server session
|
|
3825
|
+
* @param {ServerRegisterRequest} serverRegisterRequest
|
|
3826
|
+
* @param {*} [options] Override http request option.
|
|
3827
|
+
* @throws {RequiredError}
|
|
3828
|
+
*/
|
|
3829
|
+
public register(serverRegisterRequest: ServerRegisterRequest, options?: RawAxiosRequestConfig) {
|
|
3830
|
+
return ServerSessionsApiFp(this.configuration).register(serverRegisterRequest, options).then((request) => request(this.axios, this.basePath));
|
|
3831
|
+
}
|
|
3832
|
+
}
|
|
3833
|
+
|
|
3834
|
+
|
|
3835
|
+
|