@rebornteam/reborn-api 2.6.4 → 2.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/api.js CHANGED
@@ -5,7 +5,7 @@
5
5
  * Reborn API
6
6
  * The Reborn API serves as the central backend for the platform, orchestrating secure communication between game clients and data services. This API supports two authentication methods: - **OAuth 2.0 Client Credentials**: For programmatic API access - **Discord SSO Bearer Token**: For admin endpoints requiring Discord authentication
7
7
  *
8
- * The version of the OpenAPI document: 2.6.4
8
+ * The version of the OpenAPI document: 2.7.0
9
9
  *
10
10
  *
11
11
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -22,7 +22,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
22
22
  });
23
23
  };
24
24
  Object.defineProperty(exports, "__esModule", { value: true });
25
- exports.PunishmentApi = exports.PunishmentApiFactory = exports.PunishmentApiFp = exports.PunishmentApiAxiosParamCreator = exports.PlayerApi = exports.PlayerApiFactory = exports.PlayerApiFp = exports.PlayerApiAxiosParamCreator = exports.DefaultApi = exports.DefaultApiFactory = exports.DefaultApiFp = exports.DefaultApiAxiosParamCreator = exports.ConnectionApi = exports.ConnectionApiFactory = exports.ConnectionApiFp = exports.ConnectionApiAxiosParamCreator = exports.AdminPunishmentsApi = exports.AdminPunishmentsApiFactory = exports.AdminPunishmentsApiFp = exports.AdminPunishmentsApiAxiosParamCreator = exports.AdminPlayersApi = exports.AdminPlayersApiFactory = exports.AdminPlayersApiFp = exports.AdminPlayersApiAxiosParamCreator = exports.AdminDashboardApi = exports.AdminDashboardApiFactory = exports.AdminDashboardApiFp = exports.AdminDashboardApiAxiosParamCreator = exports.AdminConnectionsApi = exports.AdminConnectionsApiFactory = exports.AdminConnectionsApiFp = exports.AdminConnectionsApiAxiosParamCreator = exports.AdminClientCredentialsApi = exports.AdminClientCredentialsApiFactory = exports.AdminClientCredentialsApiFp = exports.AdminClientCredentialsApiAxiosParamCreator = exports.AdminPunishmentSearchResponseKindEnum = exports.AdminCreatePunishmentDraftRequestTypeEnum = exports.AdminApplyPunishmentRequestTypeEnum = void 0;
25
+ exports.ServerSessionsApi = exports.ServerSessionsApiFactory = exports.ServerSessionsApiFp = exports.ServerSessionsApiAxiosParamCreator = exports.PunishmentApi = exports.PunishmentApiFactory = exports.PunishmentApiFp = exports.PunishmentApiAxiosParamCreator = exports.PlayerApi = exports.PlayerApiFactory = exports.PlayerApiFp = exports.PlayerApiAxiosParamCreator = exports.ConnectionApi = exports.ConnectionApiFactory = exports.ConnectionApiFp = exports.ConnectionApiAxiosParamCreator = exports.ChatApi = exports.ChatApiFactory = exports.ChatApiFp = exports.ChatApiAxiosParamCreator = exports.AuthenticationApi = exports.AuthenticationApiFactory = exports.AuthenticationApiFp = exports.AuthenticationApiAxiosParamCreator = exports.AdminPunishmentsApi = exports.AdminPunishmentsApiFactory = exports.AdminPunishmentsApiFp = exports.AdminPunishmentsApiAxiosParamCreator = exports.AdminPlayersApi = exports.AdminPlayersApiFactory = exports.AdminPlayersApiFp = exports.AdminPlayersApiAxiosParamCreator = exports.AdminDashboardApi = exports.AdminDashboardApiFactory = exports.AdminDashboardApiFp = exports.AdminDashboardApiAxiosParamCreator = exports.AdminConnectionsApi = exports.AdminConnectionsApiFactory = exports.AdminConnectionsApiFp = exports.AdminConnectionsApiAxiosParamCreator = exports.AdminClientCredentialsApi = exports.AdminClientCredentialsApiFactory = exports.AdminClientCredentialsApiFp = exports.AdminClientCredentialsApiAxiosParamCreator = exports.AdminPunishmentSearchResponseKindEnum = exports.AdminCreatePunishmentDraftRequestTypeEnum = exports.AdminApplyPunishmentRequestTypeEnum = void 0;
26
26
  const axios_1 = require("axios");
27
27
  // Some imports not used depending on template conditions
28
28
  // @ts-ignore
@@ -1515,26 +1515,20 @@ class AdminPunishmentsApi extends base_1.BaseAPI {
1515
1515
  }
1516
1516
  exports.AdminPunishmentsApi = AdminPunishmentsApi;
1517
1517
  /**
1518
- * ConnectionApi - axios parameter creator
1518
+ * AuthenticationApi - axios parameter creator
1519
1519
  */
1520
- const ConnectionApiAxiosParamCreator = function (configuration) {
1520
+ const AuthenticationApiAxiosParamCreator = function (configuration) {
1521
1521
  return {
1522
1522
  /**
1523
- * 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.
1524
- * @summary Check Connection and Detect VPN/Proxy
1525
- * @param {string} ip IPv4 address to analyze for VPN/proxy detection and geolocation
1526
- * @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
1527
- * @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.
1523
+ * 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.
1524
+ * @summary Discord - OAuth2 callback
1525
+ * @param {string | null} [code] Authorization code provided by Discord on successful approval
1526
+ * @param {string | null} [error] Error code provided by Discord if the user denied access
1528
1527
  * @param {*} [options] Override http request option.
1529
1528
  * @throws {RequiredError}
1530
1529
  */
1531
- getConnectionDetails: (ip_1, forceRecheck_1, associateUuid_1, ...args_1) => __awaiter(this, [ip_1, forceRecheck_1, associateUuid_1, ...args_1], void 0, function* (ip, forceRecheck, associateUuid, options = {}) {
1532
- // verify required parameter 'ip' is not null or undefined
1533
- (0, common_1.assertParamExists)('getConnectionDetails', 'ip', ip);
1534
- // verify required parameter 'forceRecheck' is not null or undefined
1535
- (0, common_1.assertParamExists)('getConnectionDetails', 'forceRecheck', forceRecheck);
1536
- const localVarPath = `/v1/connection/get-connection-details/{ip}`
1537
- .replace(`{${"ip"}}`, encodeURIComponent(String(ip)));
1530
+ callback: (code_1, error_1, ...args_1) => __awaiter(this, [code_1, error_1, ...args_1], void 0, function* (code, error, options = {}) {
1531
+ const localVarPath = `/auth/discord/callback`;
1538
1532
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
1539
1533
  const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
1540
1534
  let baseOptions;
@@ -1547,16 +1541,87 @@ const ConnectionApiAxiosParamCreator = function (configuration) {
1547
1541
  // authentication DiscordAuth required
1548
1542
  // http bearer authentication required
1549
1543
  yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
1550
- if (forceRecheck !== undefined) {
1551
- localVarQueryParameter['force_recheck'] = forceRecheck;
1544
+ if (code !== undefined) {
1545
+ localVarQueryParameter['code'] = code;
1552
1546
  }
1553
- if (associateUuid !== undefined) {
1554
- localVarQueryParameter['associate_uuid'] = associateUuid;
1547
+ if (error !== undefined) {
1548
+ localVarQueryParameter['error'] = error;
1555
1549
  }
1550
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
1551
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1552
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
1553
+ return {
1554
+ url: (0, common_1.toPathString)(localVarUrlObj),
1555
+ options: localVarRequestOptions,
1556
+ };
1557
+ }),
1558
+ /**
1559
+ * Redirects the browser to Discord\'s OAuth2 authorization page. Not called directly — the admin frontend navigates to this URL to begin the login flow.
1560
+ * @summary Discord - Initiate login
1561
+ * @param {*} [options] Override http request option.
1562
+ * @throws {RequiredError}
1563
+ */
1564
+ initiateLogin: (...args_1) => __awaiter(this, [...args_1], void 0, function* (options = {}) {
1565
+ const localVarPath = `/auth/discord`;
1566
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
1567
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
1568
+ let baseOptions;
1569
+ if (configuration) {
1570
+ baseOptions = configuration.baseOptions;
1571
+ }
1572
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
1573
+ const localVarHeaderParameter = {};
1574
+ const localVarQueryParameter = {};
1575
+ // authentication DiscordAuth required
1576
+ // http bearer authentication required
1577
+ yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
1578
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
1579
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1580
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
1581
+ return {
1582
+ url: (0, common_1.toPathString)(localVarUrlObj),
1583
+ options: localVarRequestOptions,
1584
+ };
1585
+ }),
1586
+ /**
1587
+ * Exchange service client credentials for a Bearer JWT using the OAuth2 client_credentials grant. Used by game server plugins to authenticate against the API.
1588
+ * @summary Service - Exchange client credentials for token
1589
+ * @param {string | null} [grantType]
1590
+ * @param {string | null} [clientId]
1591
+ * @param {string | null} [clientSecret]
1592
+ * @param {*} [options] Override http request option.
1593
+ * @throws {RequiredError}
1594
+ */
1595
+ token: (grantType_1, clientId_1, clientSecret_1, ...args_1) => __awaiter(this, [grantType_1, clientId_1, clientSecret_1, ...args_1], void 0, function* (grantType, clientId, clientSecret, options = {}) {
1596
+ const localVarPath = `/oauth/token`;
1597
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
1598
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
1599
+ let baseOptions;
1600
+ if (configuration) {
1601
+ baseOptions = configuration.baseOptions;
1602
+ }
1603
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
1604
+ const localVarHeaderParameter = {};
1605
+ const localVarQueryParameter = {};
1606
+ const localVarFormParams = new URLSearchParams();
1607
+ // authentication DiscordAuth required
1608
+ // http bearer authentication required
1609
+ yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
1610
+ if (grantType !== undefined) {
1611
+ localVarFormParams.set('grant_type', grantType);
1612
+ }
1613
+ if (clientId !== undefined) {
1614
+ localVarFormParams.set('client_id', clientId);
1615
+ }
1616
+ if (clientSecret !== undefined) {
1617
+ localVarFormParams.set('client_secret', clientSecret);
1618
+ }
1619
+ localVarHeaderParameter['Content-Type'] = 'application/x-www-form-urlencoded';
1556
1620
  localVarHeaderParameter['Accept'] = 'application/json';
1557
1621
  (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
1558
1622
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1559
1623
  localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
1624
+ localVarRequestOptions.data = localVarFormParams.toString();
1560
1625
  return {
1561
1626
  url: (0, common_1.toPathString)(localVarUrlObj),
1562
1627
  options: localVarRequestOptions,
@@ -1564,87 +1629,163 @@ const ConnectionApiAxiosParamCreator = function (configuration) {
1564
1629
  }),
1565
1630
  };
1566
1631
  };
1567
- exports.ConnectionApiAxiosParamCreator = ConnectionApiAxiosParamCreator;
1632
+ exports.AuthenticationApiAxiosParamCreator = AuthenticationApiAxiosParamCreator;
1568
1633
  /**
1569
- * ConnectionApi - functional programming interface
1634
+ * AuthenticationApi - functional programming interface
1570
1635
  */
1571
- const ConnectionApiFp = function (configuration) {
1572
- const localVarAxiosParamCreator = (0, exports.ConnectionApiAxiosParamCreator)(configuration);
1636
+ const AuthenticationApiFp = function (configuration) {
1637
+ const localVarAxiosParamCreator = (0, exports.AuthenticationApiAxiosParamCreator)(configuration);
1573
1638
  return {
1574
1639
  /**
1575
- * 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.
1576
- * @summary Check Connection and Detect VPN/Proxy
1577
- * @param {string} ip IPv4 address to analyze for VPN/proxy detection and geolocation
1578
- * @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
1579
- * @param {string | null} [associateUuid] Minecraft player UUID to associate with this IP address. When provided, the API will: - Link this connection to the player\&#39;s history - Update the player\&#39;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\&#39;t block the response.
1640
+ * 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.
1641
+ * @summary Discord - OAuth2 callback
1642
+ * @param {string | null} [code] Authorization code provided by Discord on successful approval
1643
+ * @param {string | null} [error] Error code provided by Discord if the user denied access
1580
1644
  * @param {*} [options] Override http request option.
1581
1645
  * @throws {RequiredError}
1582
1646
  */
1583
- getConnectionDetails(ip, forceRecheck, associateUuid, options) {
1647
+ callback(code, error, options) {
1584
1648
  return __awaiter(this, void 0, void 0, function* () {
1585
1649
  var _a, _b, _c;
1586
- const localVarAxiosArgs = yield localVarAxiosParamCreator.getConnectionDetails(ip, forceRecheck, associateUuid, options);
1650
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.callback(code, error, options);
1587
1651
  const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
1588
- const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['ConnectionApi.getConnectionDetails']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
1652
+ const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['AuthenticationApi.callback']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
1653
+ return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
1654
+ });
1655
+ },
1656
+ /**
1657
+ * Redirects the browser to Discord\'s OAuth2 authorization page. Not called directly — the admin frontend navigates to this URL to begin the login flow.
1658
+ * @summary Discord - Initiate login
1659
+ * @param {*} [options] Override http request option.
1660
+ * @throws {RequiredError}
1661
+ */
1662
+ initiateLogin(options) {
1663
+ return __awaiter(this, void 0, void 0, function* () {
1664
+ var _a, _b, _c;
1665
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.initiateLogin(options);
1666
+ const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
1667
+ const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['AuthenticationApi.initiateLogin']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
1668
+ return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
1669
+ });
1670
+ },
1671
+ /**
1672
+ * Exchange service client credentials for a Bearer JWT using the OAuth2 client_credentials grant. Used by game server plugins to authenticate against the API.
1673
+ * @summary Service - Exchange client credentials for token
1674
+ * @param {string | null} [grantType]
1675
+ * @param {string | null} [clientId]
1676
+ * @param {string | null} [clientSecret]
1677
+ * @param {*} [options] Override http request option.
1678
+ * @throws {RequiredError}
1679
+ */
1680
+ token(grantType, clientId, clientSecret, options) {
1681
+ return __awaiter(this, void 0, void 0, function* () {
1682
+ var _a, _b, _c;
1683
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.token(grantType, clientId, clientSecret, options);
1684
+ const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
1685
+ const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['AuthenticationApi.token']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
1589
1686
  return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
1590
1687
  });
1591
1688
  },
1592
1689
  };
1593
1690
  };
1594
- exports.ConnectionApiFp = ConnectionApiFp;
1691
+ exports.AuthenticationApiFp = AuthenticationApiFp;
1595
1692
  /**
1596
- * ConnectionApi - factory interface
1693
+ * AuthenticationApi - factory interface
1597
1694
  */
1598
- const ConnectionApiFactory = function (configuration, basePath, axios) {
1599
- const localVarFp = (0, exports.ConnectionApiFp)(configuration);
1695
+ const AuthenticationApiFactory = function (configuration, basePath, axios) {
1696
+ const localVarFp = (0, exports.AuthenticationApiFp)(configuration);
1600
1697
  return {
1601
1698
  /**
1602
- * 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.
1603
- * @summary Check Connection and Detect VPN/Proxy
1604
- * @param {string} ip IPv4 address to analyze for VPN/proxy detection and geolocation
1605
- * @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
1606
- * @param {string | null} [associateUuid] Minecraft player UUID to associate with this IP address. When provided, the API will: - Link this connection to the player\&#39;s history - Update the player\&#39;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\&#39;t block the response.
1699
+ * 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.
1700
+ * @summary Discord - OAuth2 callback
1701
+ * @param {string | null} [code] Authorization code provided by Discord on successful approval
1702
+ * @param {string | null} [error] Error code provided by Discord if the user denied access
1607
1703
  * @param {*} [options] Override http request option.
1608
1704
  * @throws {RequiredError}
1609
1705
  */
1610
- getConnectionDetails(ip, forceRecheck, associateUuid, options) {
1611
- return localVarFp.getConnectionDetails(ip, forceRecheck, associateUuid, options).then((request) => request(axios, basePath));
1706
+ callback(code, error, options) {
1707
+ return localVarFp.callback(code, error, options).then((request) => request(axios, basePath));
1708
+ },
1709
+ /**
1710
+ * Redirects the browser to Discord\'s OAuth2 authorization page. Not called directly — the admin frontend navigates to this URL to begin the login flow.
1711
+ * @summary Discord - Initiate login
1712
+ * @param {*} [options] Override http request option.
1713
+ * @throws {RequiredError}
1714
+ */
1715
+ initiateLogin(options) {
1716
+ return localVarFp.initiateLogin(options).then((request) => request(axios, basePath));
1717
+ },
1718
+ /**
1719
+ * Exchange service client credentials for a Bearer JWT using the OAuth2 client_credentials grant. Used by game server plugins to authenticate against the API.
1720
+ * @summary Service - Exchange client credentials for token
1721
+ * @param {string | null} [grantType]
1722
+ * @param {string | null} [clientId]
1723
+ * @param {string | null} [clientSecret]
1724
+ * @param {*} [options] Override http request option.
1725
+ * @throws {RequiredError}
1726
+ */
1727
+ token(grantType, clientId, clientSecret, options) {
1728
+ return localVarFp.token(grantType, clientId, clientSecret, options).then((request) => request(axios, basePath));
1612
1729
  },
1613
1730
  };
1614
1731
  };
1615
- exports.ConnectionApiFactory = ConnectionApiFactory;
1732
+ exports.AuthenticationApiFactory = AuthenticationApiFactory;
1616
1733
  /**
1617
- * ConnectionApi - object-oriented interface
1734
+ * AuthenticationApi - object-oriented interface
1618
1735
  */
1619
- class ConnectionApi extends base_1.BaseAPI {
1736
+ class AuthenticationApi extends base_1.BaseAPI {
1620
1737
  /**
1621
- * 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.
1622
- * @summary Check Connection and Detect VPN/Proxy
1623
- * @param {string} ip IPv4 address to analyze for VPN/proxy detection and geolocation
1624
- * @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
1625
- * @param {string | null} [associateUuid] Minecraft player UUID to associate with this IP address. When provided, the API will: - Link this connection to the player\&#39;s history - Update the player\&#39;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\&#39;t block the response.
1738
+ * 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.
1739
+ * @summary Discord - OAuth2 callback
1740
+ * @param {string | null} [code] Authorization code provided by Discord on successful approval
1741
+ * @param {string | null} [error] Error code provided by Discord if the user denied access
1626
1742
  * @param {*} [options] Override http request option.
1627
1743
  * @throws {RequiredError}
1628
1744
  */
1629
- getConnectionDetails(ip, forceRecheck, associateUuid, options) {
1630
- return (0, exports.ConnectionApiFp)(this.configuration).getConnectionDetails(ip, forceRecheck, associateUuid, options).then((request) => request(this.axios, this.basePath));
1745
+ callback(code, error, options) {
1746
+ return (0, exports.AuthenticationApiFp)(this.configuration).callback(code, error, options).then((request) => request(this.axios, this.basePath));
1747
+ }
1748
+ /**
1749
+ * Redirects the browser to Discord\'s OAuth2 authorization page. Not called directly — the admin frontend navigates to this URL to begin the login flow.
1750
+ * @summary Discord - Initiate login
1751
+ * @param {*} [options] Override http request option.
1752
+ * @throws {RequiredError}
1753
+ */
1754
+ initiateLogin(options) {
1755
+ return (0, exports.AuthenticationApiFp)(this.configuration).initiateLogin(options).then((request) => request(this.axios, this.basePath));
1756
+ }
1757
+ /**
1758
+ * Exchange service client credentials for a Bearer JWT using the OAuth2 client_credentials grant. Used by game server plugins to authenticate against the API.
1759
+ * @summary Service - Exchange client credentials for token
1760
+ * @param {string | null} [grantType]
1761
+ * @param {string | null} [clientId]
1762
+ * @param {string | null} [clientSecret]
1763
+ * @param {*} [options] Override http request option.
1764
+ * @throws {RequiredError}
1765
+ */
1766
+ token(grantType, clientId, clientSecret, options) {
1767
+ return (0, exports.AuthenticationApiFp)(this.configuration).token(grantType, clientId, clientSecret, options).then((request) => request(this.axios, this.basePath));
1631
1768
  }
1632
1769
  }
1633
- exports.ConnectionApi = ConnectionApi;
1770
+ exports.AuthenticationApi = AuthenticationApi;
1634
1771
  /**
1635
- * DefaultApi - axios parameter creator
1772
+ * ChatApi - axios parameter creator
1636
1773
  */
1637
- const DefaultApiAxiosParamCreator = function (configuration) {
1774
+ const ChatApiAxiosParamCreator = function (configuration) {
1638
1775
  return {
1639
1776
  /**
1640
- *
1641
- * @param {string | null} [code]
1642
- * @param {string | null} [error]
1777
+ * 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.
1778
+ * @summary Get chat history
1779
+ * @param {number} limit Maximum number of messages to return (1–100)
1780
+ * @param {string | null} [sessionId] Filter to a specific server session. Omit for global history.
1781
+ * @param {string | null} [before] ISO-8601 timestamp cursor — return messages sent before this time. Omit to start from now.
1643
1782
  * @param {*} [options] Override http request option.
1644
1783
  * @throws {RequiredError}
1645
1784
  */
1646
- callback: (code_1, error_1, ...args_1) => __awaiter(this, [code_1, error_1, ...args_1], void 0, function* (code, error, options = {}) {
1647
- const localVarPath = `/auth/discord/callback`;
1785
+ history: (limit_1, sessionId_1, before_1, ...args_1) => __awaiter(this, [limit_1, sessionId_1, before_1, ...args_1], void 0, function* (limit, sessionId, before, options = {}) {
1786
+ // verify required parameter 'limit' is not null or undefined
1787
+ (0, common_1.assertParamExists)('history', 'limit', limit);
1788
+ const localVarPath = `/v1/chat`;
1648
1789
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
1649
1790
  const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
1650
1791
  let baseOptions;
@@ -1657,11 +1798,14 @@ const DefaultApiAxiosParamCreator = function (configuration) {
1657
1798
  // authentication DiscordAuth required
1658
1799
  // http bearer authentication required
1659
1800
  yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
1660
- if (code !== undefined) {
1661
- localVarQueryParameter['code'] = code;
1801
+ if (sessionId !== undefined) {
1802
+ localVarQueryParameter['sessionId'] = sessionId;
1662
1803
  }
1663
- if (error !== undefined) {
1664
- localVarQueryParameter['error'] = error;
1804
+ if (before !== undefined) {
1805
+ localVarQueryParameter['before'] = before;
1806
+ }
1807
+ if (limit !== undefined) {
1808
+ localVarQueryParameter['limit'] = limit;
1665
1809
  }
1666
1810
  localVarHeaderParameter['Accept'] = 'application/json';
1667
1811
  (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
@@ -1673,28 +1817,34 @@ const DefaultApiAxiosParamCreator = function (configuration) {
1673
1817
  };
1674
1818
  }),
1675
1819
  /**
1676
- *
1820
+ * 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.
1821
+ * @summary Ingest a chat message
1822
+ * @param {ChatMessageRequest} chatMessageRequest
1677
1823
  * @param {*} [options] Override http request option.
1678
1824
  * @throws {RequiredError}
1679
1825
  */
1680
- initiateLogin: (...args_1) => __awaiter(this, [...args_1], void 0, function* (options = {}) {
1681
- const localVarPath = `/auth/discord`;
1826
+ ingest: (chatMessageRequest_1, ...args_1) => __awaiter(this, [chatMessageRequest_1, ...args_1], void 0, function* (chatMessageRequest, options = {}) {
1827
+ // verify required parameter 'chatMessageRequest' is not null or undefined
1828
+ (0, common_1.assertParamExists)('ingest', 'chatMessageRequest', chatMessageRequest);
1829
+ const localVarPath = `/v1/chat`;
1682
1830
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
1683
1831
  const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
1684
1832
  let baseOptions;
1685
1833
  if (configuration) {
1686
1834
  baseOptions = configuration.baseOptions;
1687
1835
  }
1688
- const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
1836
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
1689
1837
  const localVarHeaderParameter = {};
1690
1838
  const localVarQueryParameter = {};
1691
1839
  // authentication DiscordAuth required
1692
1840
  // http bearer authentication required
1693
1841
  yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
1842
+ localVarHeaderParameter['Content-Type'] = 'application/json';
1694
1843
  localVarHeaderParameter['Accept'] = 'application/json';
1695
1844
  (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
1696
1845
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1697
1846
  localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
1847
+ localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(chatMessageRequest, localVarRequestOptions, configuration);
1698
1848
  return {
1699
1849
  url: (0, common_1.toPathString)(localVarUrlObj),
1700
1850
  options: localVarRequestOptions,
@@ -1702,97 +1852,226 @@ const DefaultApiAxiosParamCreator = function (configuration) {
1702
1852
  }),
1703
1853
  };
1704
1854
  };
1705
- exports.DefaultApiAxiosParamCreator = DefaultApiAxiosParamCreator;
1855
+ exports.ChatApiAxiosParamCreator = ChatApiAxiosParamCreator;
1706
1856
  /**
1707
- * DefaultApi - functional programming interface
1857
+ * ChatApi - functional programming interface
1708
1858
  */
1709
- const DefaultApiFp = function (configuration) {
1710
- const localVarAxiosParamCreator = (0, exports.DefaultApiAxiosParamCreator)(configuration);
1859
+ const ChatApiFp = function (configuration) {
1860
+ const localVarAxiosParamCreator = (0, exports.ChatApiAxiosParamCreator)(configuration);
1711
1861
  return {
1712
1862
  /**
1713
- *
1714
- * @param {string | null} [code]
1715
- * @param {string | null} [error]
1863
+ * 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.
1864
+ * @summary Get chat history
1865
+ * @param {number} limit Maximum number of messages to return (1–100)
1866
+ * @param {string | null} [sessionId] Filter to a specific server session. Omit for global history.
1867
+ * @param {string | null} [before] ISO-8601 timestamp cursor — return messages sent before this time. Omit to start from now.
1716
1868
  * @param {*} [options] Override http request option.
1717
1869
  * @throws {RequiredError}
1718
1870
  */
1719
- callback(code, error, options) {
1871
+ history(limit, sessionId, before, options) {
1720
1872
  return __awaiter(this, void 0, void 0, function* () {
1721
1873
  var _a, _b, _c;
1722
- const localVarAxiosArgs = yield localVarAxiosParamCreator.callback(code, error, options);
1874
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.history(limit, sessionId, before, options);
1723
1875
  const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
1724
- const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['DefaultApi.callback']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
1876
+ const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['ChatApi.history']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
1725
1877
  return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
1726
1878
  });
1727
1879
  },
1728
1880
  /**
1729
- *
1881
+ * 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.
1882
+ * @summary Ingest a chat message
1883
+ * @param {ChatMessageRequest} chatMessageRequest
1730
1884
  * @param {*} [options] Override http request option.
1731
1885
  * @throws {RequiredError}
1732
1886
  */
1733
- initiateLogin(options) {
1887
+ ingest(chatMessageRequest, options) {
1734
1888
  return __awaiter(this, void 0, void 0, function* () {
1735
1889
  var _a, _b, _c;
1736
- const localVarAxiosArgs = yield localVarAxiosParamCreator.initiateLogin(options);
1890
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.ingest(chatMessageRequest, options);
1737
1891
  const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
1738
- const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['DefaultApi.initiateLogin']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
1892
+ const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['ChatApi.ingest']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
1739
1893
  return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
1740
1894
  });
1741
1895
  },
1742
1896
  };
1743
1897
  };
1744
- exports.DefaultApiFp = DefaultApiFp;
1898
+ exports.ChatApiFp = ChatApiFp;
1745
1899
  /**
1746
- * DefaultApi - factory interface
1900
+ * ChatApi - factory interface
1747
1901
  */
1748
- const DefaultApiFactory = function (configuration, basePath, axios) {
1749
- const localVarFp = (0, exports.DefaultApiFp)(configuration);
1902
+ const ChatApiFactory = function (configuration, basePath, axios) {
1903
+ const localVarFp = (0, exports.ChatApiFp)(configuration);
1750
1904
  return {
1751
1905
  /**
1752
- *
1753
- * @param {string | null} [code]
1754
- * @param {string | null} [error]
1906
+ * 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.
1907
+ * @summary Get chat history
1908
+ * @param {number} limit Maximum number of messages to return (1–100)
1909
+ * @param {string | null} [sessionId] Filter to a specific server session. Omit for global history.
1910
+ * @param {string | null} [before] ISO-8601 timestamp cursor — return messages sent before this time. Omit to start from now.
1755
1911
  * @param {*} [options] Override http request option.
1756
1912
  * @throws {RequiredError}
1757
1913
  */
1758
- callback(code, error, options) {
1759
- return localVarFp.callback(code, error, options).then((request) => request(axios, basePath));
1914
+ history(limit, sessionId, before, options) {
1915
+ return localVarFp.history(limit, sessionId, before, options).then((request) => request(axios, basePath));
1760
1916
  },
1761
1917
  /**
1762
- *
1918
+ * 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.
1919
+ * @summary Ingest a chat message
1920
+ * @param {ChatMessageRequest} chatMessageRequest
1763
1921
  * @param {*} [options] Override http request option.
1764
1922
  * @throws {RequiredError}
1765
1923
  */
1766
- initiateLogin(options) {
1767
- return localVarFp.initiateLogin(options).then((request) => request(axios, basePath));
1924
+ ingest(chatMessageRequest, options) {
1925
+ return localVarFp.ingest(chatMessageRequest, options).then((request) => request(axios, basePath));
1768
1926
  },
1769
1927
  };
1770
1928
  };
1771
- exports.DefaultApiFactory = DefaultApiFactory;
1929
+ exports.ChatApiFactory = ChatApiFactory;
1772
1930
  /**
1773
- * DefaultApi - object-oriented interface
1931
+ * ChatApi - object-oriented interface
1774
1932
  */
1775
- class DefaultApi extends base_1.BaseAPI {
1933
+ class ChatApi extends base_1.BaseAPI {
1776
1934
  /**
1777
- *
1778
- * @param {string | null} [code]
1779
- * @param {string | null} [error]
1935
+ * 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.
1936
+ * @summary Get chat history
1937
+ * @param {number} limit Maximum number of messages to return (1–100)
1938
+ * @param {string | null} [sessionId] Filter to a specific server session. Omit for global history.
1939
+ * @param {string | null} [before] ISO-8601 timestamp cursor — return messages sent before this time. Omit to start from now.
1780
1940
  * @param {*} [options] Override http request option.
1781
1941
  * @throws {RequiredError}
1782
1942
  */
1783
- callback(code, error, options) {
1784
- return (0, exports.DefaultApiFp)(this.configuration).callback(code, error, options).then((request) => request(this.axios, this.basePath));
1943
+ history(limit, sessionId, before, options) {
1944
+ return (0, exports.ChatApiFp)(this.configuration).history(limit, sessionId, before, options).then((request) => request(this.axios, this.basePath));
1785
1945
  }
1786
1946
  /**
1787
- *
1947
+ * 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.
1948
+ * @summary Ingest a chat message
1949
+ * @param {ChatMessageRequest} chatMessageRequest
1788
1950
  * @param {*} [options] Override http request option.
1789
1951
  * @throws {RequiredError}
1790
1952
  */
1791
- initiateLogin(options) {
1792
- return (0, exports.DefaultApiFp)(this.configuration).initiateLogin(options).then((request) => request(this.axios, this.basePath));
1953
+ ingest(chatMessageRequest, options) {
1954
+ return (0, exports.ChatApiFp)(this.configuration).ingest(chatMessageRequest, options).then((request) => request(this.axios, this.basePath));
1793
1955
  }
1794
1956
  }
1795
- exports.DefaultApi = DefaultApi;
1957
+ exports.ChatApi = ChatApi;
1958
+ /**
1959
+ * ConnectionApi - axios parameter creator
1960
+ */
1961
+ const ConnectionApiAxiosParamCreator = function (configuration) {
1962
+ return {
1963
+ /**
1964
+ * 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.
1965
+ * @summary Check Connection and Detect VPN/Proxy
1966
+ * @param {string} ip IPv4 address to analyze for VPN/proxy detection and geolocation
1967
+ * @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
1968
+ * @param {string | null} [associateUuid] Minecraft player UUID to associate with this IP address. When provided, the API will: - Link this connection to the player\&#39;s history - Update the player\&#39;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\&#39;t block the response.
1969
+ * @param {*} [options] Override http request option.
1970
+ * @throws {RequiredError}
1971
+ */
1972
+ getConnectionDetails: (ip_1, forceRecheck_1, associateUuid_1, ...args_1) => __awaiter(this, [ip_1, forceRecheck_1, associateUuid_1, ...args_1], void 0, function* (ip, forceRecheck, associateUuid, options = {}) {
1973
+ // verify required parameter 'ip' is not null or undefined
1974
+ (0, common_1.assertParamExists)('getConnectionDetails', 'ip', ip);
1975
+ // verify required parameter 'forceRecheck' is not null or undefined
1976
+ (0, common_1.assertParamExists)('getConnectionDetails', 'forceRecheck', forceRecheck);
1977
+ const localVarPath = `/v1/connection/get-connection-details/{ip}`
1978
+ .replace(`{${"ip"}}`, encodeURIComponent(String(ip)));
1979
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
1980
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
1981
+ let baseOptions;
1982
+ if (configuration) {
1983
+ baseOptions = configuration.baseOptions;
1984
+ }
1985
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
1986
+ const localVarHeaderParameter = {};
1987
+ const localVarQueryParameter = {};
1988
+ // authentication DiscordAuth required
1989
+ // http bearer authentication required
1990
+ yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
1991
+ if (forceRecheck !== undefined) {
1992
+ localVarQueryParameter['force_recheck'] = forceRecheck;
1993
+ }
1994
+ if (associateUuid !== undefined) {
1995
+ localVarQueryParameter['associate_uuid'] = associateUuid;
1996
+ }
1997
+ localVarHeaderParameter['Accept'] = 'application/json';
1998
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
1999
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
2000
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
2001
+ return {
2002
+ url: (0, common_1.toPathString)(localVarUrlObj),
2003
+ options: localVarRequestOptions,
2004
+ };
2005
+ }),
2006
+ };
2007
+ };
2008
+ exports.ConnectionApiAxiosParamCreator = ConnectionApiAxiosParamCreator;
2009
+ /**
2010
+ * ConnectionApi - functional programming interface
2011
+ */
2012
+ const ConnectionApiFp = function (configuration) {
2013
+ const localVarAxiosParamCreator = (0, exports.ConnectionApiAxiosParamCreator)(configuration);
2014
+ return {
2015
+ /**
2016
+ * 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.
2017
+ * @summary Check Connection and Detect VPN/Proxy
2018
+ * @param {string} ip IPv4 address to analyze for VPN/proxy detection and geolocation
2019
+ * @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
2020
+ * @param {string | null} [associateUuid] Minecraft player UUID to associate with this IP address. When provided, the API will: - Link this connection to the player\&#39;s history - Update the player\&#39;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\&#39;t block the response.
2021
+ * @param {*} [options] Override http request option.
2022
+ * @throws {RequiredError}
2023
+ */
2024
+ getConnectionDetails(ip, forceRecheck, associateUuid, options) {
2025
+ return __awaiter(this, void 0, void 0, function* () {
2026
+ var _a, _b, _c;
2027
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.getConnectionDetails(ip, forceRecheck, associateUuid, options);
2028
+ const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
2029
+ const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['ConnectionApi.getConnectionDetails']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
2030
+ return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
2031
+ });
2032
+ },
2033
+ };
2034
+ };
2035
+ exports.ConnectionApiFp = ConnectionApiFp;
2036
+ /**
2037
+ * ConnectionApi - factory interface
2038
+ */
2039
+ const ConnectionApiFactory = function (configuration, basePath, axios) {
2040
+ const localVarFp = (0, exports.ConnectionApiFp)(configuration);
2041
+ return {
2042
+ /**
2043
+ * 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.
2044
+ * @summary Check Connection and Detect VPN/Proxy
2045
+ * @param {string} ip IPv4 address to analyze for VPN/proxy detection and geolocation
2046
+ * @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
2047
+ * @param {string | null} [associateUuid] Minecraft player UUID to associate with this IP address. When provided, the API will: - Link this connection to the player\&#39;s history - Update the player\&#39;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\&#39;t block the response.
2048
+ * @param {*} [options] Override http request option.
2049
+ * @throws {RequiredError}
2050
+ */
2051
+ getConnectionDetails(ip, forceRecheck, associateUuid, options) {
2052
+ return localVarFp.getConnectionDetails(ip, forceRecheck, associateUuid, options).then((request) => request(axios, basePath));
2053
+ },
2054
+ };
2055
+ };
2056
+ exports.ConnectionApiFactory = ConnectionApiFactory;
2057
+ /**
2058
+ * ConnectionApi - object-oriented interface
2059
+ */
2060
+ class ConnectionApi extends base_1.BaseAPI {
2061
+ /**
2062
+ * 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.
2063
+ * @summary Check Connection and Detect VPN/Proxy
2064
+ * @param {string} ip IPv4 address to analyze for VPN/proxy detection and geolocation
2065
+ * @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
2066
+ * @param {string | null} [associateUuid] Minecraft player UUID to associate with this IP address. When provided, the API will: - Link this connection to the player\&#39;s history - Update the player\&#39;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\&#39;t block the response.
2067
+ * @param {*} [options] Override http request option.
2068
+ * @throws {RequiredError}
2069
+ */
2070
+ getConnectionDetails(ip, forceRecheck, associateUuid, options) {
2071
+ return (0, exports.ConnectionApiFp)(this.configuration).getConnectionDetails(ip, forceRecheck, associateUuid, options).then((request) => request(this.axios, this.basePath));
2072
+ }
2073
+ }
2074
+ exports.ConnectionApi = ConnectionApi;
1796
2075
  /**
1797
2076
  * PlayerApi - axios parameter creator
1798
2077
  */
@@ -1800,7 +2079,7 @@ const PlayerApiAxiosParamCreator = function (configuration) {
1800
2079
  return {
1801
2080
  /**
1802
2081
  * 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.
1803
- * @summary Get Player Information
2082
+ * @summary Get player information
1804
2083
  * @param {string} uuid The Minecraft player UUID (with or without dashes)
1805
2084
  * @param {*} [options] Override http request option.
1806
2085
  * @throws {RequiredError}
@@ -1831,6 +2110,41 @@ const PlayerApiAxiosParamCreator = function (configuration) {
1831
2110
  options: localVarRequestOptions,
1832
2111
  };
1833
2112
  }),
2113
+ /**
2114
+ * 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.
2115
+ * @summary Batch resolve UUIDs to usernames
2116
+ * @param {Array<string>} uuids List of player UUIDs to resolve (repeatable query param)
2117
+ * @param {*} [options] Override http request option.
2118
+ * @throws {RequiredError}
2119
+ */
2120
+ getUsernames: (uuids_1, ...args_1) => __awaiter(this, [uuids_1, ...args_1], void 0, function* (uuids, options = {}) {
2121
+ // verify required parameter 'uuids' is not null or undefined
2122
+ (0, common_1.assertParamExists)('getUsernames', 'uuids', uuids);
2123
+ const localVarPath = `/v1/player/usernames`;
2124
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
2125
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
2126
+ let baseOptions;
2127
+ if (configuration) {
2128
+ baseOptions = configuration.baseOptions;
2129
+ }
2130
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
2131
+ const localVarHeaderParameter = {};
2132
+ const localVarQueryParameter = {};
2133
+ // authentication DiscordAuth required
2134
+ // http bearer authentication required
2135
+ yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
2136
+ if (uuids) {
2137
+ localVarQueryParameter['uuids'] = uuids.join(base_1.COLLECTION_FORMATS.csv);
2138
+ }
2139
+ localVarHeaderParameter['Accept'] = 'application/json';
2140
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
2141
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
2142
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
2143
+ return {
2144
+ url: (0, common_1.toPathString)(localVarUrlObj),
2145
+ options: localVarRequestOptions,
2146
+ };
2147
+ }),
1834
2148
  };
1835
2149
  };
1836
2150
  exports.PlayerApiAxiosParamCreator = PlayerApiAxiosParamCreator;
@@ -1842,7 +2156,7 @@ const PlayerApiFp = function (configuration) {
1842
2156
  return {
1843
2157
  /**
1844
2158
  * 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.
1845
- * @summary Get Player Information
2159
+ * @summary Get player information
1846
2160
  * @param {string} uuid The Minecraft player UUID (with or without dashes)
1847
2161
  * @param {*} [options] Override http request option.
1848
2162
  * @throws {RequiredError}
@@ -1856,6 +2170,22 @@ const PlayerApiFp = function (configuration) {
1856
2170
  return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
1857
2171
  });
1858
2172
  },
2173
+ /**
2174
+ * 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.
2175
+ * @summary Batch resolve UUIDs to usernames
2176
+ * @param {Array<string>} uuids List of player UUIDs to resolve (repeatable query param)
2177
+ * @param {*} [options] Override http request option.
2178
+ * @throws {RequiredError}
2179
+ */
2180
+ getUsernames(uuids, options) {
2181
+ return __awaiter(this, void 0, void 0, function* () {
2182
+ var _a, _b, _c;
2183
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.getUsernames(uuids, options);
2184
+ const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
2185
+ const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['PlayerApi.getUsernames']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
2186
+ return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
2187
+ });
2188
+ },
1859
2189
  };
1860
2190
  };
1861
2191
  exports.PlayerApiFp = PlayerApiFp;
@@ -1867,7 +2197,7 @@ const PlayerApiFactory = function (configuration, basePath, axios) {
1867
2197
  return {
1868
2198
  /**
1869
2199
  * 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.
1870
- * @summary Get Player Information
2200
+ * @summary Get player information
1871
2201
  * @param {string} uuid The Minecraft player UUID (with or without dashes)
1872
2202
  * @param {*} [options] Override http request option.
1873
2203
  * @throws {RequiredError}
@@ -1875,6 +2205,16 @@ const PlayerApiFactory = function (configuration, basePath, axios) {
1875
2205
  getPlayer1(uuid, options) {
1876
2206
  return localVarFp.getPlayer1(uuid, options).then((request) => request(axios, basePath));
1877
2207
  },
2208
+ /**
2209
+ * 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.
2210
+ * @summary Batch resolve UUIDs to usernames
2211
+ * @param {Array<string>} uuids List of player UUIDs to resolve (repeatable query param)
2212
+ * @param {*} [options] Override http request option.
2213
+ * @throws {RequiredError}
2214
+ */
2215
+ getUsernames(uuids, options) {
2216
+ return localVarFp.getUsernames(uuids, options).then((request) => request(axios, basePath));
2217
+ },
1878
2218
  };
1879
2219
  };
1880
2220
  exports.PlayerApiFactory = PlayerApiFactory;
@@ -1884,7 +2224,7 @@ exports.PlayerApiFactory = PlayerApiFactory;
1884
2224
  class PlayerApi extends base_1.BaseAPI {
1885
2225
  /**
1886
2226
  * 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.
1887
- * @summary Get Player Information
2227
+ * @summary Get player information
1888
2228
  * @param {string} uuid The Minecraft player UUID (with or without dashes)
1889
2229
  * @param {*} [options] Override http request option.
1890
2230
  * @throws {RequiredError}
@@ -1892,6 +2232,16 @@ class PlayerApi extends base_1.BaseAPI {
1892
2232
  getPlayer1(uuid, options) {
1893
2233
  return (0, exports.PlayerApiFp)(this.configuration).getPlayer1(uuid, options).then((request) => request(this.axios, this.basePath));
1894
2234
  }
2235
+ /**
2236
+ * 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.
2237
+ * @summary Batch resolve UUIDs to usernames
2238
+ * @param {Array<string>} uuids List of player UUIDs to resolve (repeatable query param)
2239
+ * @param {*} [options] Override http request option.
2240
+ * @throws {RequiredError}
2241
+ */
2242
+ getUsernames(uuids, options) {
2243
+ return (0, exports.PlayerApiFp)(this.configuration).getUsernames(uuids, options).then((request) => request(this.axios, this.basePath));
2244
+ }
1895
2245
  }
1896
2246
  exports.PlayerApi = PlayerApi;
1897
2247
  /**
@@ -2278,3 +2628,365 @@ class PunishmentApi extends base_1.BaseAPI {
2278
2628
  }
2279
2629
  }
2280
2630
  exports.PunishmentApi = PunishmentApi;
2631
+ /**
2632
+ * ServerSessionsApi - axios parameter creator
2633
+ */
2634
+ const ServerSessionsApiAxiosParamCreator = function (configuration) {
2635
+ return {
2636
+ /**
2637
+ * 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.
2638
+ * @summary Send a heartbeat
2639
+ * @param {string} id Session UUID returned from the registration call
2640
+ * @param {*} [options] Override http request option.
2641
+ * @throws {RequiredError}
2642
+ */
2643
+ heartbeat: (id_1, ...args_1) => __awaiter(this, [id_1, ...args_1], void 0, function* (id, options = {}) {
2644
+ // verify required parameter 'id' is not null or undefined
2645
+ (0, common_1.assertParamExists)('heartbeat', 'id', id);
2646
+ const localVarPath = `/v1/servers/{id}/heartbeat`
2647
+ .replace(`{${"id"}}`, encodeURIComponent(String(id)));
2648
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
2649
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
2650
+ let baseOptions;
2651
+ if (configuration) {
2652
+ baseOptions = configuration.baseOptions;
2653
+ }
2654
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'PUT' }, baseOptions), options);
2655
+ const localVarHeaderParameter = {};
2656
+ const localVarQueryParameter = {};
2657
+ // authentication DiscordAuth required
2658
+ // http bearer authentication required
2659
+ yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
2660
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
2661
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
2662
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
2663
+ return {
2664
+ url: (0, common_1.toPathString)(localVarUrlObj),
2665
+ options: localVarRequestOptions,
2666
+ };
2667
+ }),
2668
+ /**
2669
+ * Returns all server sessions — both online and historical — ordered by start time descending. Used by the web UI to populate the session filter dropdown.
2670
+ * @summary List all server sessions
2671
+ * @param {*} [options] Override http request option.
2672
+ * @throws {RequiredError}
2673
+ */
2674
+ listAll: (...args_1) => __awaiter(this, [...args_1], void 0, function* (options = {}) {
2675
+ const localVarPath = `/v1/servers/history`;
2676
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
2677
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
2678
+ let baseOptions;
2679
+ if (configuration) {
2680
+ baseOptions = configuration.baseOptions;
2681
+ }
2682
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
2683
+ const localVarHeaderParameter = {};
2684
+ const localVarQueryParameter = {};
2685
+ // authentication DiscordAuth required
2686
+ // http bearer authentication required
2687
+ yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
2688
+ localVarHeaderParameter['Accept'] = 'application/json';
2689
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
2690
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
2691
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
2692
+ return {
2693
+ url: (0, common_1.toPathString)(localVarUrlObj),
2694
+ options: localVarRequestOptions,
2695
+ };
2696
+ }),
2697
+ /**
2698
+ * Returns all currently online server sessions, ordered by start time descending.
2699
+ * @summary List online server sessions
2700
+ * @param {*} [options] Override http request option.
2701
+ * @throws {RequiredError}
2702
+ */
2703
+ listOnline: (...args_1) => __awaiter(this, [...args_1], void 0, function* (options = {}) {
2704
+ const localVarPath = `/v1/servers`;
2705
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
2706
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
2707
+ let baseOptions;
2708
+ if (configuration) {
2709
+ baseOptions = configuration.baseOptions;
2710
+ }
2711
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
2712
+ const localVarHeaderParameter = {};
2713
+ const localVarQueryParameter = {};
2714
+ // authentication DiscordAuth required
2715
+ // http bearer authentication required
2716
+ yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
2717
+ localVarHeaderParameter['Accept'] = 'application/json';
2718
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
2719
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
2720
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
2721
+ return {
2722
+ url: (0, common_1.toPathString)(localVarUrlObj),
2723
+ options: localVarRequestOptions,
2724
+ };
2725
+ }),
2726
+ /**
2727
+ * 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.
2728
+ * @summary Mark a session offline
2729
+ * @param {string} id Session UUID returned from the registration call
2730
+ * @param {*} [options] Override http request option.
2731
+ * @throws {RequiredError}
2732
+ */
2733
+ markOffline: (id_1, ...args_1) => __awaiter(this, [id_1, ...args_1], void 0, function* (id, options = {}) {
2734
+ // verify required parameter 'id' is not null or undefined
2735
+ (0, common_1.assertParamExists)('markOffline', 'id', id);
2736
+ const localVarPath = `/v1/servers/{id}/offline`
2737
+ .replace(`{${"id"}}`, encodeURIComponent(String(id)));
2738
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
2739
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
2740
+ let baseOptions;
2741
+ if (configuration) {
2742
+ baseOptions = configuration.baseOptions;
2743
+ }
2744
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'PUT' }, baseOptions), options);
2745
+ const localVarHeaderParameter = {};
2746
+ const localVarQueryParameter = {};
2747
+ // authentication DiscordAuth required
2748
+ // http bearer authentication required
2749
+ yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
2750
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
2751
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
2752
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
2753
+ return {
2754
+ url: (0, common_1.toPathString)(localVarUrlObj),
2755
+ options: localVarRequestOptions,
2756
+ };
2757
+ }),
2758
+ /**
2759
+ * 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.
2760
+ * @summary Register a server session
2761
+ * @param {ServerRegisterRequest} serverRegisterRequest
2762
+ * @param {*} [options] Override http request option.
2763
+ * @throws {RequiredError}
2764
+ */
2765
+ register: (serverRegisterRequest_1, ...args_1) => __awaiter(this, [serverRegisterRequest_1, ...args_1], void 0, function* (serverRegisterRequest, options = {}) {
2766
+ // verify required parameter 'serverRegisterRequest' is not null or undefined
2767
+ (0, common_1.assertParamExists)('register', 'serverRegisterRequest', serverRegisterRequest);
2768
+ const localVarPath = `/v1/servers`;
2769
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
2770
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
2771
+ let baseOptions;
2772
+ if (configuration) {
2773
+ baseOptions = configuration.baseOptions;
2774
+ }
2775
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
2776
+ const localVarHeaderParameter = {};
2777
+ const localVarQueryParameter = {};
2778
+ // authentication DiscordAuth required
2779
+ // http bearer authentication required
2780
+ yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
2781
+ localVarHeaderParameter['Content-Type'] = 'application/json';
2782
+ localVarHeaderParameter['Accept'] = 'application/json';
2783
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
2784
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
2785
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
2786
+ localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(serverRegisterRequest, localVarRequestOptions, configuration);
2787
+ return {
2788
+ url: (0, common_1.toPathString)(localVarUrlObj),
2789
+ options: localVarRequestOptions,
2790
+ };
2791
+ }),
2792
+ };
2793
+ };
2794
+ exports.ServerSessionsApiAxiosParamCreator = ServerSessionsApiAxiosParamCreator;
2795
+ /**
2796
+ * ServerSessionsApi - functional programming interface
2797
+ */
2798
+ const ServerSessionsApiFp = function (configuration) {
2799
+ const localVarAxiosParamCreator = (0, exports.ServerSessionsApiAxiosParamCreator)(configuration);
2800
+ return {
2801
+ /**
2802
+ * 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.
2803
+ * @summary Send a heartbeat
2804
+ * @param {string} id Session UUID returned from the registration call
2805
+ * @param {*} [options] Override http request option.
2806
+ * @throws {RequiredError}
2807
+ */
2808
+ heartbeat(id, options) {
2809
+ return __awaiter(this, void 0, void 0, function* () {
2810
+ var _a, _b, _c;
2811
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.heartbeat(id, options);
2812
+ const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
2813
+ const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['ServerSessionsApi.heartbeat']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
2814
+ return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
2815
+ });
2816
+ },
2817
+ /**
2818
+ * Returns all server sessions — both online and historical — ordered by start time descending. Used by the web UI to populate the session filter dropdown.
2819
+ * @summary List all server sessions
2820
+ * @param {*} [options] Override http request option.
2821
+ * @throws {RequiredError}
2822
+ */
2823
+ listAll(options) {
2824
+ return __awaiter(this, void 0, void 0, function* () {
2825
+ var _a, _b, _c;
2826
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.listAll(options);
2827
+ const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
2828
+ const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['ServerSessionsApi.listAll']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
2829
+ return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
2830
+ });
2831
+ },
2832
+ /**
2833
+ * Returns all currently online server sessions, ordered by start time descending.
2834
+ * @summary List online server sessions
2835
+ * @param {*} [options] Override http request option.
2836
+ * @throws {RequiredError}
2837
+ */
2838
+ listOnline(options) {
2839
+ return __awaiter(this, void 0, void 0, function* () {
2840
+ var _a, _b, _c;
2841
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.listOnline(options);
2842
+ const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
2843
+ const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['ServerSessionsApi.listOnline']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
2844
+ return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
2845
+ });
2846
+ },
2847
+ /**
2848
+ * 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.
2849
+ * @summary Mark a session offline
2850
+ * @param {string} id Session UUID returned from the registration call
2851
+ * @param {*} [options] Override http request option.
2852
+ * @throws {RequiredError}
2853
+ */
2854
+ markOffline(id, options) {
2855
+ return __awaiter(this, void 0, void 0, function* () {
2856
+ var _a, _b, _c;
2857
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.markOffline(id, options);
2858
+ const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
2859
+ const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['ServerSessionsApi.markOffline']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
2860
+ return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
2861
+ });
2862
+ },
2863
+ /**
2864
+ * 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.
2865
+ * @summary Register a server session
2866
+ * @param {ServerRegisterRequest} serverRegisterRequest
2867
+ * @param {*} [options] Override http request option.
2868
+ * @throws {RequiredError}
2869
+ */
2870
+ register(serverRegisterRequest, options) {
2871
+ return __awaiter(this, void 0, void 0, function* () {
2872
+ var _a, _b, _c;
2873
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.register(serverRegisterRequest, options);
2874
+ const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
2875
+ const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['ServerSessionsApi.register']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
2876
+ return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
2877
+ });
2878
+ },
2879
+ };
2880
+ };
2881
+ exports.ServerSessionsApiFp = ServerSessionsApiFp;
2882
+ /**
2883
+ * ServerSessionsApi - factory interface
2884
+ */
2885
+ const ServerSessionsApiFactory = function (configuration, basePath, axios) {
2886
+ const localVarFp = (0, exports.ServerSessionsApiFp)(configuration);
2887
+ return {
2888
+ /**
2889
+ * 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.
2890
+ * @summary Send a heartbeat
2891
+ * @param {string} id Session UUID returned from the registration call
2892
+ * @param {*} [options] Override http request option.
2893
+ * @throws {RequiredError}
2894
+ */
2895
+ heartbeat(id, options) {
2896
+ return localVarFp.heartbeat(id, options).then((request) => request(axios, basePath));
2897
+ },
2898
+ /**
2899
+ * Returns all server sessions — both online and historical — ordered by start time descending. Used by the web UI to populate the session filter dropdown.
2900
+ * @summary List all server sessions
2901
+ * @param {*} [options] Override http request option.
2902
+ * @throws {RequiredError}
2903
+ */
2904
+ listAll(options) {
2905
+ return localVarFp.listAll(options).then((request) => request(axios, basePath));
2906
+ },
2907
+ /**
2908
+ * Returns all currently online server sessions, ordered by start time descending.
2909
+ * @summary List online server sessions
2910
+ * @param {*} [options] Override http request option.
2911
+ * @throws {RequiredError}
2912
+ */
2913
+ listOnline(options) {
2914
+ return localVarFp.listOnline(options).then((request) => request(axios, basePath));
2915
+ },
2916
+ /**
2917
+ * 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.
2918
+ * @summary Mark a session offline
2919
+ * @param {string} id Session UUID returned from the registration call
2920
+ * @param {*} [options] Override http request option.
2921
+ * @throws {RequiredError}
2922
+ */
2923
+ markOffline(id, options) {
2924
+ return localVarFp.markOffline(id, options).then((request) => request(axios, basePath));
2925
+ },
2926
+ /**
2927
+ * 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.
2928
+ * @summary Register a server session
2929
+ * @param {ServerRegisterRequest} serverRegisterRequest
2930
+ * @param {*} [options] Override http request option.
2931
+ * @throws {RequiredError}
2932
+ */
2933
+ register(serverRegisterRequest, options) {
2934
+ return localVarFp.register(serverRegisterRequest, options).then((request) => request(axios, basePath));
2935
+ },
2936
+ };
2937
+ };
2938
+ exports.ServerSessionsApiFactory = ServerSessionsApiFactory;
2939
+ /**
2940
+ * ServerSessionsApi - object-oriented interface
2941
+ */
2942
+ class ServerSessionsApi extends base_1.BaseAPI {
2943
+ /**
2944
+ * 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.
2945
+ * @summary Send a heartbeat
2946
+ * @param {string} id Session UUID returned from the registration call
2947
+ * @param {*} [options] Override http request option.
2948
+ * @throws {RequiredError}
2949
+ */
2950
+ heartbeat(id, options) {
2951
+ return (0, exports.ServerSessionsApiFp)(this.configuration).heartbeat(id, options).then((request) => request(this.axios, this.basePath));
2952
+ }
2953
+ /**
2954
+ * Returns all server sessions — both online and historical — ordered by start time descending. Used by the web UI to populate the session filter dropdown.
2955
+ * @summary List all server sessions
2956
+ * @param {*} [options] Override http request option.
2957
+ * @throws {RequiredError}
2958
+ */
2959
+ listAll(options) {
2960
+ return (0, exports.ServerSessionsApiFp)(this.configuration).listAll(options).then((request) => request(this.axios, this.basePath));
2961
+ }
2962
+ /**
2963
+ * Returns all currently online server sessions, ordered by start time descending.
2964
+ * @summary List online server sessions
2965
+ * @param {*} [options] Override http request option.
2966
+ * @throws {RequiredError}
2967
+ */
2968
+ listOnline(options) {
2969
+ return (0, exports.ServerSessionsApiFp)(this.configuration).listOnline(options).then((request) => request(this.axios, this.basePath));
2970
+ }
2971
+ /**
2972
+ * 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.
2973
+ * @summary Mark a session offline
2974
+ * @param {string} id Session UUID returned from the registration call
2975
+ * @param {*} [options] Override http request option.
2976
+ * @throws {RequiredError}
2977
+ */
2978
+ markOffline(id, options) {
2979
+ return (0, exports.ServerSessionsApiFp)(this.configuration).markOffline(id, options).then((request) => request(this.axios, this.basePath));
2980
+ }
2981
+ /**
2982
+ * 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.
2983
+ * @summary Register a server session
2984
+ * @param {ServerRegisterRequest} serverRegisterRequest
2985
+ * @param {*} [options] Override http request option.
2986
+ * @throws {RequiredError}
2987
+ */
2988
+ register(serverRegisterRequest, options) {
2989
+ return (0, exports.ServerSessionsApiFp)(this.configuration).register(serverRegisterRequest, options).then((request) => request(this.axios, this.basePath));
2990
+ }
2991
+ }
2992
+ exports.ServerSessionsApi = ServerSessionsApi;