@ughuuu/game_server 1.0.374 → 1.0.376

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.
Files changed (100) hide show
  1. package/README.md +66 -5
  2. package/dist/ApiClient.js +1 -1
  3. package/dist/api/AdminKVApi.js +305 -0
  4. package/dist/api/AdminLeaderboardsApi.js +396 -0
  5. package/dist/api/AdminLobbiesApi.js +190 -0
  6. package/dist/api/AdminSessionsApi.js +165 -0
  7. package/dist/api/AdminUsersApi.js +130 -0
  8. package/dist/api/AuthenticationApi.js +82 -1
  9. package/dist/api/FriendsApi.js +6 -4
  10. package/dist/api/HealthApi.js +1 -1
  11. package/dist/api/HooksApi.js +6 -4
  12. package/dist/api/KVApi.js +95 -0
  13. package/dist/api/LeaderboardsApi.js +7 -7
  14. package/dist/api/LobbiesApi.js +6 -6
  15. package/dist/api/UsersApi.js +17 -15
  16. package/dist/index.js +269 -3
  17. package/dist/model/AdminCreateKvEntry200Response.js +91 -0
  18. package/dist/model/AdminCreateKvEntryRequest.js +146 -0
  19. package/dist/model/AdminCreateLeaderboardRequest.js +232 -0
  20. package/dist/model/AdminEndLeaderboard200Response.js +91 -0
  21. package/dist/model/AdminEndLeaderboard200ResponseData.js +231 -0
  22. package/dist/model/AdminListKvEntries200Response.js +124 -0
  23. package/dist/model/AdminListKvEntries200ResponseDataInner.js +147 -0
  24. package/dist/model/AdminListLobbies200Response.js +124 -0
  25. package/dist/model/AdminListLobbies200ResponseDataInner.js +153 -0
  26. package/dist/model/AdminListSessions200Response.js +124 -0
  27. package/dist/model/AdminListSessions200ResponseDataInner.js +133 -0
  28. package/dist/model/AdminSubmitLeaderboardScore200Response.js +91 -0
  29. package/dist/model/AdminSubmitLeaderboardScore200ResponseData.js +141 -0
  30. package/dist/model/AdminSubmitLeaderboardScoreRequest.js +126 -0
  31. package/dist/model/AdminUpdateKvEntryRequest.js +121 -0
  32. package/dist/model/AdminUpdateLeaderboardRecordRequest.js +93 -0
  33. package/dist/model/AdminUpdateLeaderboardRequest.js +125 -0
  34. package/dist/model/AdminUpdateLobby200Response.js +91 -0
  35. package/dist/model/AdminUpdateLobbyRequest.js +133 -0
  36. package/dist/model/AdminUpdateUser200Response.js +91 -0
  37. package/dist/model/AdminUpdateUser200ResponseData.js +149 -0
  38. package/dist/model/AdminUpdateUserRequest.js +105 -0
  39. package/dist/model/CallHook200Response.js +88 -0
  40. package/dist/model/CallHookRequest.js +23 -8
  41. package/dist/model/CreateFriendRequestRequest.js +1 -1
  42. package/dist/model/{KickUser401Response.js → CreateLobby401Response.js} +18 -18
  43. package/dist/model/CreateLobbyRequest.js +1 -1
  44. package/dist/model/DeviceLoginRequest.js +1 -1
  45. package/dist/model/ErrorResponse.js +114 -0
  46. package/dist/model/GetCurrentUser200Response.js +10 -1
  47. package/dist/model/GetCurrentUser200ResponseLinkedProviders.js +1 -1
  48. package/dist/model/GetKv200Response.js +93 -0
  49. package/dist/model/GetMyRecord200Response.js +91 -0
  50. package/dist/model/HealthResponse.js +1 -1
  51. package/dist/model/JoinLobby200Response.js +89 -0
  52. package/dist/model/JoinLobbyRequest.js +1 -1
  53. package/dist/model/KickUser200Response.js +89 -0
  54. package/dist/model/KickUserRequest.js +1 -1
  55. package/dist/model/LeaveLobby200Response.js +89 -0
  56. package/dist/model/LinkDeviceRequest.js +1 -1
  57. package/dist/model/ListBlockedFriends200Response.js +1 -1
  58. package/dist/model/ListBlockedFriends200ResponseDataInner.js +1 -1
  59. package/dist/model/ListBlockedFriends200ResponseDataInnerRequester.js +1 -1
  60. package/dist/model/ListFriendRequests200Response.js +1 -1
  61. package/dist/model/ListFriendRequests200ResponseIncomingInner.js +1 -1
  62. package/dist/model/ListFriendRequests200ResponseIncomingInnerRequester.js +1 -1
  63. package/dist/model/ListFriendRequests200ResponseMeta.js +1 -1
  64. package/dist/model/ListFriends200Response.js +1 -1
  65. package/dist/model/ListFriends200ResponseDataInner.js +9 -1
  66. package/dist/model/ListLeaderboardRecords200Response.js +1 -1
  67. package/dist/model/ListLeaderboardRecords200ResponseDataInner.js +1 -1
  68. package/dist/model/ListLeaderboardRecords200ResponseMeta.js +1 -1
  69. package/dist/model/ListLeaderboards200Response.js +1 -1
  70. package/dist/model/ListLeaderboards200ResponseDataInner.js +1 -1
  71. package/dist/model/ListLobbies200Response.js +1 -1
  72. package/dist/model/ListLobbies200ResponseDataInner.js +1 -1
  73. package/dist/model/ListLobbies200ResponseInner.js +153 -0
  74. package/dist/model/ListLobbies200ResponseMeta.js +125 -0
  75. package/dist/model/ListRecordsAroundUser200Response.js +1 -1
  76. package/dist/model/Login200Response.js +1 -1
  77. package/dist/model/Login200ResponseData.js +1 -1
  78. package/dist/model/Login200ResponseDataUser.js +97 -0
  79. package/dist/model/LoginRequest.js +1 -1
  80. package/dist/model/OAuthSessionData.js +1 -1
  81. package/dist/model/OAuthSessionDataDetails.js +1 -1
  82. package/dist/model/OAuthSessionStatus.js +9 -5
  83. package/dist/model/OauthApiCallback200Response.js +1 -1
  84. package/dist/model/OauthApiCallbackRequest.js +1 -1
  85. package/dist/model/OauthCallbackApiAppleIosRequest.js +113 -0
  86. package/dist/model/OauthGoogleIdTokenRequest.js +113 -0
  87. package/dist/model/OauthRequest200Response.js +1 -1
  88. package/dist/model/OauthSessionStatus404Response.js +126 -0
  89. package/dist/model/QuickJoinRequest.js +1 -1
  90. package/dist/model/RefreshToken200Response.js +1 -1
  91. package/dist/model/RefreshToken200ResponseData.js +1 -1
  92. package/dist/model/RefreshTokenRequest.js +1 -1
  93. package/dist/model/RemoveFriendship401Response.js +89 -0
  94. package/dist/model/SearchUsers200Response.js +124 -0
  95. package/dist/model/SearchUsers200ResponseDataInner.js +130 -0
  96. package/dist/model/UpdateCurrentUserDisplayNameRequest.js +1 -1
  97. package/dist/model/UpdateCurrentUserPassword400Response.js +97 -0
  98. package/dist/model/UpdateCurrentUserPasswordRequest.js +1 -1
  99. package/dist/model/UpdateLobbyRequest.js +1 -1
  100. package/package.json +5 -1
@@ -0,0 +1,396 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+ var _ApiClient = _interopRequireDefault(require("../ApiClient"));
8
+ var _AdminCreateLeaderboardRequest = _interopRequireDefault(require("../model/AdminCreateLeaderboardRequest"));
9
+ var _AdminEndLeaderboard200Response = _interopRequireDefault(require("../model/AdminEndLeaderboard200Response"));
10
+ var _AdminSubmitLeaderboardScore200Response = _interopRequireDefault(require("../model/AdminSubmitLeaderboardScore200Response"));
11
+ var _AdminSubmitLeaderboardScoreRequest = _interopRequireDefault(require("../model/AdminSubmitLeaderboardScoreRequest"));
12
+ var _AdminUpdateLeaderboardRecordRequest = _interopRequireDefault(require("../model/AdminUpdateLeaderboardRecordRequest"));
13
+ var _AdminUpdateLeaderboardRequest = _interopRequireDefault(require("../model/AdminUpdateLeaderboardRequest"));
14
+ var _RemoveFriendship401Response = _interopRequireDefault(require("../model/RemoveFriendship401Response"));
15
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
16
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
17
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
18
+ function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
19
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
20
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
21
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
22
+ * Game Server API
23
+ * API for Game Server application ## Authentication This API uses JWT (JSON Web Tokens) with access and refresh tokens: ### Getting Tokens - **Email/Password**: POST to `/api/v1/login` with email and password - **Device (SDK)**: POST to `/api/v1/login` with a `device_id` string (creates/returns a device user) - **Discord OAuth**: Use `/api/v1/auth/discord` flow - **Google OAuth**: Use `/api/v1/auth/google` flow - **Facebook OAuth**: Use `/api/v1/auth/facebook` flow - **Apple Sign In**: Use `/auth/apple` browser flow or apple sdk flow - **Steam (OpenID)**: Use `/api/v1/auth/steam` flow Both methods return: - `access_token` - Short-lived (15 min), use for API requests - `refresh_token` - Long-lived (30 days), use to get new access tokens ### Using Tokens Include the access token in the Authorization header: ``` Authorization: Bearer <access_token> ``` ### Refreshing Tokens When your access token expires, use POST `/api/v1/refresh` with your refresh token to get a new access token. ## Users Users endpoints cover the user lifecycle and profile features. Key highlights: - **Registration and login** (email/password, device token for SDKs, and OAuth providers) - **Profile metadata** (JSON blob per user) and editable profile fields - **Account lifecycle**: password reset, email confirmation, and account deletion - **Sessions & tokens**: both browser sessions and JWT-based API tokens are supported ## Friends The Friends domain offers lightweight social features: - **Friend requests** (send / accept / reject / block flows) - **Friend listing & pagination**, with basic privacy controls - **Domain helpers** to manage and query friend relationships from API or UI contexts ## Lobbies Lobbies provide matchmaking / room management primitives. Highlights: - **Create / list / update / delete** lobbies with rich metadata (mode, region, tags) - **Host-managed or hostless** modes (hostless allowed internally, not creatable via public API) - **Membership management**: join, leave, kick users, and automatic host transfer - **Controls & protection**: max users, hidden/locked states, and optional password protection - **Hidden lobbies** are excluded from public listings; public listing endpoints are paginated
24
+ *
25
+ * The version of the OpenAPI document: 1.0.0
26
+ *
27
+ *
28
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
29
+ * https://openapi-generator.tech
30
+ * Do not edit the class manually.
31
+ *
32
+ */
33
+ /**
34
+ * AdminLeaderboards service.
35
+ * @module api/AdminLeaderboardsApi
36
+ * @version 1.0.0
37
+ */
38
+ var AdminLeaderboardsApi = exports["default"] = /*#__PURE__*/function () {
39
+ /**
40
+ * Constructs a new AdminLeaderboardsApi.
41
+ * @alias module:api/AdminLeaderboardsApi
42
+ * @class
43
+ * @param {module:ApiClient} [apiClient] Optional API client implementation to use,
44
+ * default to {@link module:ApiClient#instance} if unspecified.
45
+ */
46
+ function AdminLeaderboardsApi(apiClient) {
47
+ _classCallCheck(this, AdminLeaderboardsApi);
48
+ this.apiClient = apiClient || _ApiClient["default"].instance;
49
+ }
50
+
51
+ /**
52
+ * Create leaderboard (admin)
53
+ * @param {Object} opts Optional parameters
54
+ * @param {module:model/AdminCreateLeaderboardRequest} [adminCreateLeaderboardRequest] Leaderboard
55
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/AdminEndLeaderboard200Response} and HTTP response
56
+ */
57
+ return _createClass(AdminLeaderboardsApi, [{
58
+ key: "adminCreateLeaderboardWithHttpInfo",
59
+ value: function adminCreateLeaderboardWithHttpInfo(opts) {
60
+ opts = opts || {};
61
+ var postBody = opts['adminCreateLeaderboardRequest'];
62
+ var pathParams = {};
63
+ var queryParams = {};
64
+ var headerParams = {};
65
+ var formParams = {};
66
+ var authNames = ['authorization'];
67
+ var contentTypes = ['application/json'];
68
+ var accepts = ['application/json'];
69
+ var returnType = _AdminEndLeaderboard200Response["default"];
70
+ return this.apiClient.callApi('/api/v1/admin/leaderboards', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
71
+ }
72
+
73
+ /**
74
+ * Create leaderboard (admin)
75
+ * @param {Object} opts Optional parameters
76
+ * @param {module:model/AdminCreateLeaderboardRequest} opts.adminCreateLeaderboardRequest Leaderboard
77
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/AdminEndLeaderboard200Response}
78
+ */
79
+ }, {
80
+ key: "adminCreateLeaderboard",
81
+ value: function adminCreateLeaderboard(opts) {
82
+ return this.adminCreateLeaderboardWithHttpInfo(opts).then(function (response_and_data) {
83
+ return response_and_data.data;
84
+ });
85
+ }
86
+
87
+ /**
88
+ * Delete leaderboard (admin)
89
+ * @param {Number} id
90
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Object} and HTTP response
91
+ */
92
+ }, {
93
+ key: "adminDeleteLeaderboardWithHttpInfo",
94
+ value: function adminDeleteLeaderboardWithHttpInfo(id) {
95
+ var postBody = null;
96
+ // verify the required parameter 'id' is set
97
+ if (id === undefined || id === null) {
98
+ throw new Error("Missing the required parameter 'id' when calling adminDeleteLeaderboard");
99
+ }
100
+ var pathParams = {
101
+ 'id': id
102
+ };
103
+ var queryParams = {};
104
+ var headerParams = {};
105
+ var formParams = {};
106
+ var authNames = ['authorization'];
107
+ var contentTypes = [];
108
+ var accepts = ['application/json'];
109
+ var returnType = Object;
110
+ return this.apiClient.callApi('/api/v1/admin/leaderboards/{id}', 'DELETE', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
111
+ }
112
+
113
+ /**
114
+ * Delete leaderboard (admin)
115
+ * @param {Number} id
116
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Object}
117
+ */
118
+ }, {
119
+ key: "adminDeleteLeaderboard",
120
+ value: function adminDeleteLeaderboard(id) {
121
+ return this.adminDeleteLeaderboardWithHttpInfo(id).then(function (response_and_data) {
122
+ return response_and_data.data;
123
+ });
124
+ }
125
+
126
+ /**
127
+ * Delete leaderboard record (admin)
128
+ * @param {Number} id
129
+ * @param {Number} recordId
130
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Object} and HTTP response
131
+ */
132
+ }, {
133
+ key: "adminDeleteLeaderboardRecordWithHttpInfo",
134
+ value: function adminDeleteLeaderboardRecordWithHttpInfo(id, recordId) {
135
+ var postBody = null;
136
+ // verify the required parameter 'id' is set
137
+ if (id === undefined || id === null) {
138
+ throw new Error("Missing the required parameter 'id' when calling adminDeleteLeaderboardRecord");
139
+ }
140
+ // verify the required parameter 'recordId' is set
141
+ if (recordId === undefined || recordId === null) {
142
+ throw new Error("Missing the required parameter 'recordId' when calling adminDeleteLeaderboardRecord");
143
+ }
144
+ var pathParams = {
145
+ 'id': id,
146
+ 'record_id': recordId
147
+ };
148
+ var queryParams = {};
149
+ var headerParams = {};
150
+ var formParams = {};
151
+ var authNames = ['authorization'];
152
+ var contentTypes = [];
153
+ var accepts = ['application/json'];
154
+ var returnType = Object;
155
+ return this.apiClient.callApi('/api/v1/admin/leaderboards/{id}/records/{record_id}', 'DELETE', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
156
+ }
157
+
158
+ /**
159
+ * Delete leaderboard record (admin)
160
+ * @param {Number} id
161
+ * @param {Number} recordId
162
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Object}
163
+ */
164
+ }, {
165
+ key: "adminDeleteLeaderboardRecord",
166
+ value: function adminDeleteLeaderboardRecord(id, recordId) {
167
+ return this.adminDeleteLeaderboardRecordWithHttpInfo(id, recordId).then(function (response_and_data) {
168
+ return response_and_data.data;
169
+ });
170
+ }
171
+
172
+ /**
173
+ * Delete a user's record (admin)
174
+ * @param {Number} id
175
+ * @param {Number} userId
176
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Object} and HTTP response
177
+ */
178
+ }, {
179
+ key: "adminDeleteLeaderboardUserRecordWithHttpInfo",
180
+ value: function adminDeleteLeaderboardUserRecordWithHttpInfo(id, userId) {
181
+ var postBody = null;
182
+ // verify the required parameter 'id' is set
183
+ if (id === undefined || id === null) {
184
+ throw new Error("Missing the required parameter 'id' when calling adminDeleteLeaderboardUserRecord");
185
+ }
186
+ // verify the required parameter 'userId' is set
187
+ if (userId === undefined || userId === null) {
188
+ throw new Error("Missing the required parameter 'userId' when calling adminDeleteLeaderboardUserRecord");
189
+ }
190
+ var pathParams = {
191
+ 'id': id,
192
+ 'user_id': userId
193
+ };
194
+ var queryParams = {};
195
+ var headerParams = {};
196
+ var formParams = {};
197
+ var authNames = ['authorization'];
198
+ var contentTypes = [];
199
+ var accepts = ['application/json'];
200
+ var returnType = Object;
201
+ return this.apiClient.callApi('/api/v1/admin/leaderboards/{id}/records/user/{user_id}', 'DELETE', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
202
+ }
203
+
204
+ /**
205
+ * Delete a user's record (admin)
206
+ * @param {Number} id
207
+ * @param {Number} userId
208
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Object}
209
+ */
210
+ }, {
211
+ key: "adminDeleteLeaderboardUserRecord",
212
+ value: function adminDeleteLeaderboardUserRecord(id, userId) {
213
+ return this.adminDeleteLeaderboardUserRecordWithHttpInfo(id, userId).then(function (response_and_data) {
214
+ return response_and_data.data;
215
+ });
216
+ }
217
+
218
+ /**
219
+ * End leaderboard (admin)
220
+ * @param {Number} id
221
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/AdminEndLeaderboard200Response} and HTTP response
222
+ */
223
+ }, {
224
+ key: "adminEndLeaderboardWithHttpInfo",
225
+ value: function adminEndLeaderboardWithHttpInfo(id) {
226
+ var postBody = null;
227
+ // verify the required parameter 'id' is set
228
+ if (id === undefined || id === null) {
229
+ throw new Error("Missing the required parameter 'id' when calling adminEndLeaderboard");
230
+ }
231
+ var pathParams = {
232
+ 'id': id
233
+ };
234
+ var queryParams = {};
235
+ var headerParams = {};
236
+ var formParams = {};
237
+ var authNames = ['authorization'];
238
+ var contentTypes = [];
239
+ var accepts = ['application/json'];
240
+ var returnType = _AdminEndLeaderboard200Response["default"];
241
+ return this.apiClient.callApi('/api/v1/admin/leaderboards/{id}/end', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
242
+ }
243
+
244
+ /**
245
+ * End leaderboard (admin)
246
+ * @param {Number} id
247
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/AdminEndLeaderboard200Response}
248
+ */
249
+ }, {
250
+ key: "adminEndLeaderboard",
251
+ value: function adminEndLeaderboard(id) {
252
+ return this.adminEndLeaderboardWithHttpInfo(id).then(function (response_and_data) {
253
+ return response_and_data.data;
254
+ });
255
+ }
256
+
257
+ /**
258
+ * Submit score (admin)
259
+ * @param {Number} id
260
+ * @param {Object} opts Optional parameters
261
+ * @param {module:model/AdminSubmitLeaderboardScoreRequest} [adminSubmitLeaderboardScoreRequest] Score submission
262
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/AdminSubmitLeaderboardScore200Response} and HTTP response
263
+ */
264
+ }, {
265
+ key: "adminSubmitLeaderboardScoreWithHttpInfo",
266
+ value: function adminSubmitLeaderboardScoreWithHttpInfo(id, opts) {
267
+ opts = opts || {};
268
+ var postBody = opts['adminSubmitLeaderboardScoreRequest'];
269
+ // verify the required parameter 'id' is set
270
+ if (id === undefined || id === null) {
271
+ throw new Error("Missing the required parameter 'id' when calling adminSubmitLeaderboardScore");
272
+ }
273
+ var pathParams = {
274
+ 'id': id
275
+ };
276
+ var queryParams = {};
277
+ var headerParams = {};
278
+ var formParams = {};
279
+ var authNames = ['authorization'];
280
+ var contentTypes = ['application/json'];
281
+ var accepts = ['application/json'];
282
+ var returnType = _AdminSubmitLeaderboardScore200Response["default"];
283
+ return this.apiClient.callApi('/api/v1/admin/leaderboards/{id}/records', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
284
+ }
285
+
286
+ /**
287
+ * Submit score (admin)
288
+ * @param {Number} id
289
+ * @param {Object} opts Optional parameters
290
+ * @param {module:model/AdminSubmitLeaderboardScoreRequest} opts.adminSubmitLeaderboardScoreRequest Score submission
291
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/AdminSubmitLeaderboardScore200Response}
292
+ */
293
+ }, {
294
+ key: "adminSubmitLeaderboardScore",
295
+ value: function adminSubmitLeaderboardScore(id, opts) {
296
+ return this.adminSubmitLeaderboardScoreWithHttpInfo(id, opts).then(function (response_and_data) {
297
+ return response_and_data.data;
298
+ });
299
+ }
300
+
301
+ /**
302
+ * Update leaderboard (admin)
303
+ * @param {Number} id
304
+ * @param {Object} opts Optional parameters
305
+ * @param {module:model/AdminUpdateLeaderboardRequest} [adminUpdateLeaderboardRequest] Leaderboard patch
306
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/AdminEndLeaderboard200Response} and HTTP response
307
+ */
308
+ }, {
309
+ key: "adminUpdateLeaderboardWithHttpInfo",
310
+ value: function adminUpdateLeaderboardWithHttpInfo(id, opts) {
311
+ opts = opts || {};
312
+ var postBody = opts['adminUpdateLeaderboardRequest'];
313
+ // verify the required parameter 'id' is set
314
+ if (id === undefined || id === null) {
315
+ throw new Error("Missing the required parameter 'id' when calling adminUpdateLeaderboard");
316
+ }
317
+ var pathParams = {
318
+ 'id': id
319
+ };
320
+ var queryParams = {};
321
+ var headerParams = {};
322
+ var formParams = {};
323
+ var authNames = ['authorization'];
324
+ var contentTypes = ['application/json'];
325
+ var accepts = ['application/json'];
326
+ var returnType = _AdminEndLeaderboard200Response["default"];
327
+ return this.apiClient.callApi('/api/v1/admin/leaderboards/{id}', 'PATCH', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
328
+ }
329
+
330
+ /**
331
+ * Update leaderboard (admin)
332
+ * @param {Number} id
333
+ * @param {Object} opts Optional parameters
334
+ * @param {module:model/AdminUpdateLeaderboardRequest} opts.adminUpdateLeaderboardRequest Leaderboard patch
335
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/AdminEndLeaderboard200Response}
336
+ */
337
+ }, {
338
+ key: "adminUpdateLeaderboard",
339
+ value: function adminUpdateLeaderboard(id, opts) {
340
+ return this.adminUpdateLeaderboardWithHttpInfo(id, opts).then(function (response_and_data) {
341
+ return response_and_data.data;
342
+ });
343
+ }
344
+
345
+ /**
346
+ * Update leaderboard record (admin)
347
+ * @param {Number} id
348
+ * @param {Number} recordId
349
+ * @param {Object} opts Optional parameters
350
+ * @param {module:model/AdminUpdateLeaderboardRecordRequest} [adminUpdateLeaderboardRecordRequest] Record patch
351
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/AdminSubmitLeaderboardScore200Response} and HTTP response
352
+ */
353
+ }, {
354
+ key: "adminUpdateLeaderboardRecordWithHttpInfo",
355
+ value: function adminUpdateLeaderboardRecordWithHttpInfo(id, recordId, opts) {
356
+ opts = opts || {};
357
+ var postBody = opts['adminUpdateLeaderboardRecordRequest'];
358
+ // verify the required parameter 'id' is set
359
+ if (id === undefined || id === null) {
360
+ throw new Error("Missing the required parameter 'id' when calling adminUpdateLeaderboardRecord");
361
+ }
362
+ // verify the required parameter 'recordId' is set
363
+ if (recordId === undefined || recordId === null) {
364
+ throw new Error("Missing the required parameter 'recordId' when calling adminUpdateLeaderboardRecord");
365
+ }
366
+ var pathParams = {
367
+ 'id': id,
368
+ 'record_id': recordId
369
+ };
370
+ var queryParams = {};
371
+ var headerParams = {};
372
+ var formParams = {};
373
+ var authNames = ['authorization'];
374
+ var contentTypes = ['application/json'];
375
+ var accepts = ['application/json'];
376
+ var returnType = _AdminSubmitLeaderboardScore200Response["default"];
377
+ return this.apiClient.callApi('/api/v1/admin/leaderboards/{id}/records/{record_id}', 'PATCH', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
378
+ }
379
+
380
+ /**
381
+ * Update leaderboard record (admin)
382
+ * @param {Number} id
383
+ * @param {Number} recordId
384
+ * @param {Object} opts Optional parameters
385
+ * @param {module:model/AdminUpdateLeaderboardRecordRequest} opts.adminUpdateLeaderboardRecordRequest Record patch
386
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/AdminSubmitLeaderboardScore200Response}
387
+ */
388
+ }, {
389
+ key: "adminUpdateLeaderboardRecord",
390
+ value: function adminUpdateLeaderboardRecord(id, recordId, opts) {
391
+ return this.adminUpdateLeaderboardRecordWithHttpInfo(id, recordId, opts).then(function (response_and_data) {
392
+ return response_and_data.data;
393
+ });
394
+ }
395
+ }]);
396
+ }();
@@ -0,0 +1,190 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+ var _ApiClient = _interopRequireDefault(require("../ApiClient"));
8
+ var _AdminListLobbies200Response = _interopRequireDefault(require("../model/AdminListLobbies200Response"));
9
+ var _AdminUpdateLobby200Response = _interopRequireDefault(require("../model/AdminUpdateLobby200Response"));
10
+ var _AdminUpdateLobbyRequest = _interopRequireDefault(require("../model/AdminUpdateLobbyRequest"));
11
+ var _RemoveFriendship401Response = _interopRequireDefault(require("../model/RemoveFriendship401Response"));
12
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
13
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
14
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
15
+ function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
16
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
17
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
18
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
19
+ * Game Server API
20
+ * API for Game Server application ## Authentication This API uses JWT (JSON Web Tokens) with access and refresh tokens: ### Getting Tokens - **Email/Password**: POST to `/api/v1/login` with email and password - **Device (SDK)**: POST to `/api/v1/login` with a `device_id` string (creates/returns a device user) - **Discord OAuth**: Use `/api/v1/auth/discord` flow - **Google OAuth**: Use `/api/v1/auth/google` flow - **Facebook OAuth**: Use `/api/v1/auth/facebook` flow - **Apple Sign In**: Use `/auth/apple` browser flow or apple sdk flow - **Steam (OpenID)**: Use `/api/v1/auth/steam` flow Both methods return: - `access_token` - Short-lived (15 min), use for API requests - `refresh_token` - Long-lived (30 days), use to get new access tokens ### Using Tokens Include the access token in the Authorization header: ``` Authorization: Bearer <access_token> ``` ### Refreshing Tokens When your access token expires, use POST `/api/v1/refresh` with your refresh token to get a new access token. ## Users Users endpoints cover the user lifecycle and profile features. Key highlights: - **Registration and login** (email/password, device token for SDKs, and OAuth providers) - **Profile metadata** (JSON blob per user) and editable profile fields - **Account lifecycle**: password reset, email confirmation, and account deletion - **Sessions & tokens**: both browser sessions and JWT-based API tokens are supported ## Friends The Friends domain offers lightweight social features: - **Friend requests** (send / accept / reject / block flows) - **Friend listing & pagination**, with basic privacy controls - **Domain helpers** to manage and query friend relationships from API or UI contexts ## Lobbies Lobbies provide matchmaking / room management primitives. Highlights: - **Create / list / update / delete** lobbies with rich metadata (mode, region, tags) - **Host-managed or hostless** modes (hostless allowed internally, not creatable via public API) - **Membership management**: join, leave, kick users, and automatic host transfer - **Controls & protection**: max users, hidden/locked states, and optional password protection - **Hidden lobbies** are excluded from public listings; public listing endpoints are paginated
21
+ *
22
+ * The version of the OpenAPI document: 1.0.0
23
+ *
24
+ *
25
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
26
+ * https://openapi-generator.tech
27
+ * Do not edit the class manually.
28
+ *
29
+ */
30
+ /**
31
+ * AdminLobbies service.
32
+ * @module api/AdminLobbiesApi
33
+ * @version 1.0.0
34
+ */
35
+ var AdminLobbiesApi = exports["default"] = /*#__PURE__*/function () {
36
+ /**
37
+ * Constructs a new AdminLobbiesApi.
38
+ * @alias module:api/AdminLobbiesApi
39
+ * @class
40
+ * @param {module:ApiClient} [apiClient] Optional API client implementation to use,
41
+ * default to {@link module:ApiClient#instance} if unspecified.
42
+ */
43
+ function AdminLobbiesApi(apiClient) {
44
+ _classCallCheck(this, AdminLobbiesApi);
45
+ this.apiClient = apiClient || _ApiClient["default"].instance;
46
+ }
47
+
48
+ /**
49
+ * Delete lobby by id (admin)
50
+ * @param {Number} id
51
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Object} and HTTP response
52
+ */
53
+ return _createClass(AdminLobbiesApi, [{
54
+ key: "adminDeleteLobbyWithHttpInfo",
55
+ value: function adminDeleteLobbyWithHttpInfo(id) {
56
+ var postBody = null;
57
+ // verify the required parameter 'id' is set
58
+ if (id === undefined || id === null) {
59
+ throw new Error("Missing the required parameter 'id' when calling adminDeleteLobby");
60
+ }
61
+ var pathParams = {
62
+ 'id': id
63
+ };
64
+ var queryParams = {};
65
+ var headerParams = {};
66
+ var formParams = {};
67
+ var authNames = ['authorization'];
68
+ var contentTypes = [];
69
+ var accepts = ['application/json'];
70
+ var returnType = Object;
71
+ return this.apiClient.callApi('/api/v1/admin/lobbies/{id}', 'DELETE', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
72
+ }
73
+
74
+ /**
75
+ * Delete lobby by id (admin)
76
+ * @param {Number} id
77
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Object}
78
+ */
79
+ }, {
80
+ key: "adminDeleteLobby",
81
+ value: function adminDeleteLobby(id) {
82
+ return this.adminDeleteLobbyWithHttpInfo(id).then(function (response_and_data) {
83
+ return response_and_data.data;
84
+ });
85
+ }
86
+
87
+ /**
88
+ * List all lobbies (admin)
89
+ * @param {Object} opts Optional parameters
90
+ * @param {String} [title]
91
+ * @param {Boolean} [isHidden]
92
+ * @param {Boolean} [isLocked]
93
+ * @param {Boolean} [hasPassword]
94
+ * @param {Number} [minUsers]
95
+ * @param {Number} [maxUsers]
96
+ * @param {Number} [page]
97
+ * @param {Number} [pageSize]
98
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/AdminListLobbies200Response} and HTTP response
99
+ */
100
+ }, {
101
+ key: "adminListLobbiesWithHttpInfo",
102
+ value: function adminListLobbiesWithHttpInfo(opts) {
103
+ opts = opts || {};
104
+ var postBody = null;
105
+ var pathParams = {};
106
+ var queryParams = {
107
+ 'title': opts['title'],
108
+ 'is_hidden': opts['isHidden'],
109
+ 'is_locked': opts['isLocked'],
110
+ 'has_password': opts['hasPassword'],
111
+ 'min_users': opts['minUsers'],
112
+ 'max_users': opts['maxUsers'],
113
+ 'page': opts['page'],
114
+ 'page_size': opts['pageSize']
115
+ };
116
+ var headerParams = {};
117
+ var formParams = {};
118
+ var authNames = ['authorization'];
119
+ var contentTypes = [];
120
+ var accepts = ['application/json'];
121
+ var returnType = _AdminListLobbies200Response["default"];
122
+ return this.apiClient.callApi('/api/v1/admin/lobbies', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
123
+ }
124
+
125
+ /**
126
+ * List all lobbies (admin)
127
+ * @param {Object} opts Optional parameters
128
+ * @param {String} opts.title
129
+ * @param {Boolean} opts.isHidden
130
+ * @param {Boolean} opts.isLocked
131
+ * @param {Boolean} opts.hasPassword
132
+ * @param {Number} opts.minUsers
133
+ * @param {Number} opts.maxUsers
134
+ * @param {Number} opts.page
135
+ * @param {Number} opts.pageSize
136
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/AdminListLobbies200Response}
137
+ */
138
+ }, {
139
+ key: "adminListLobbies",
140
+ value: function adminListLobbies(opts) {
141
+ return this.adminListLobbiesWithHttpInfo(opts).then(function (response_and_data) {
142
+ return response_and_data.data;
143
+ });
144
+ }
145
+
146
+ /**
147
+ * Update lobby by id (admin)
148
+ * @param {Number} id
149
+ * @param {Object} opts Optional parameters
150
+ * @param {module:model/AdminUpdateLobbyRequest} [adminUpdateLobbyRequest] Lobby patch
151
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/AdminUpdateLobby200Response} and HTTP response
152
+ */
153
+ }, {
154
+ key: "adminUpdateLobbyWithHttpInfo",
155
+ value: function adminUpdateLobbyWithHttpInfo(id, opts) {
156
+ opts = opts || {};
157
+ var postBody = opts['adminUpdateLobbyRequest'];
158
+ // verify the required parameter 'id' is set
159
+ if (id === undefined || id === null) {
160
+ throw new Error("Missing the required parameter 'id' when calling adminUpdateLobby");
161
+ }
162
+ var pathParams = {
163
+ 'id': id
164
+ };
165
+ var queryParams = {};
166
+ var headerParams = {};
167
+ var formParams = {};
168
+ var authNames = ['authorization'];
169
+ var contentTypes = ['application/json'];
170
+ var accepts = ['application/json'];
171
+ var returnType = _AdminUpdateLobby200Response["default"];
172
+ return this.apiClient.callApi('/api/v1/admin/lobbies/{id}', 'PATCH', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
173
+ }
174
+
175
+ /**
176
+ * Update lobby by id (admin)
177
+ * @param {Number} id
178
+ * @param {Object} opts Optional parameters
179
+ * @param {module:model/AdminUpdateLobbyRequest} opts.adminUpdateLobbyRequest Lobby patch
180
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/AdminUpdateLobby200Response}
181
+ */
182
+ }, {
183
+ key: "adminUpdateLobby",
184
+ value: function adminUpdateLobby(id, opts) {
185
+ return this.adminUpdateLobbyWithHttpInfo(id, opts).then(function (response_and_data) {
186
+ return response_and_data.data;
187
+ });
188
+ }
189
+ }]);
190
+ }();