@ughuuu/game_server 1.0.142 → 1.0.146
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/README.md +15 -0
- package/dist/api/LobbiesApi.js +316 -0
- package/dist/index.js +70 -0
- package/dist/model/CreateLobby401Response.js +89 -0
- package/dist/model/CreateLobbyRequest.js +146 -0
- package/dist/model/JoinLobby200Response.js +89 -0
- package/dist/model/JoinLobbyRequest.js +90 -0
- package/dist/model/KickUser200Response.js +89 -0
- package/dist/model/KickUserRequest.js +109 -0
- package/dist/model/LeaveLobby200Response.js +89 -0
- package/dist/model/ListLobbies200ResponseInner.js +166 -0
- package/dist/model/UpdateLobbyRequest.js +139 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -157,6 +157,12 @@ Class | Method | HTTP request | Description
|
|
|
157
157
|
*UghuuuGameServer.AuthenticationApi* | [**refreshToken**](docs/AuthenticationApi.md#refreshToken) | **POST** /api/v1/refresh | Refresh access token
|
|
158
158
|
*UghuuuGameServer.AuthenticationApi* | [**unlinkProvider**](docs/AuthenticationApi.md#unlinkProvider) | **DELETE** /api/v1/me/providers/{provider} | Unlink OAuth provider
|
|
159
159
|
*UghuuuGameServer.HealthApi* | [**index**](docs/HealthApi.md#index) | **GET** /api/v1/health | Health check
|
|
160
|
+
*UghuuuGameServer.LobbiesApi* | [**createLobby**](docs/LobbiesApi.md#createLobby) | **POST** /api/v1/lobbies | Create a lobby
|
|
161
|
+
*UghuuuGameServer.LobbiesApi* | [**joinLobby**](docs/LobbiesApi.md#joinLobby) | **POST** /api/v1/lobbies/{id}/join | Join a lobby
|
|
162
|
+
*UghuuuGameServer.LobbiesApi* | [**kickUser**](docs/LobbiesApi.md#kickUser) | **POST** /api/v1/lobbies/{id}/kick | Kick a user from the lobby
|
|
163
|
+
*UghuuuGameServer.LobbiesApi* | [**leaveLobby**](docs/LobbiesApi.md#leaveLobby) | **POST** /api/v1/lobbies/{id}/leave | Leave the current lobby
|
|
164
|
+
*UghuuuGameServer.LobbiesApi* | [**listLobbies**](docs/LobbiesApi.md#listLobbies) | **GET** /api/v1/lobbies | List lobbies
|
|
165
|
+
*UghuuuGameServer.LobbiesApi* | [**updateLobby**](docs/LobbiesApi.md#updateLobby) | **PATCH** /api/v1/lobbies/{id} | Update lobby (host only)
|
|
160
166
|
*UghuuuGameServer.UsersApi* | [**getCurrentUser**](docs/UsersApi.md#getCurrentUser) | **GET** /api/v1/me | Return current user info
|
|
161
167
|
*UghuuuGameServer.UsersApi* | [**updateCurrentUserDisplayName**](docs/UsersApi.md#updateCurrentUserDisplayName) | **PATCH** /api/v1/me/display_name | Update current user's display name
|
|
162
168
|
*UghuuuGameServer.UsersApi* | [**updateCurrentUserPassword**](docs/UsersApi.md#updateCurrentUserPassword) | **PATCH** /api/v1/me/password | Update current user password
|
|
@@ -164,8 +170,16 @@ Class | Method | HTTP request | Description
|
|
|
164
170
|
|
|
165
171
|
## Documentation for Models
|
|
166
172
|
|
|
173
|
+
- [UghuuuGameServer.CreateLobby401Response](docs/CreateLobby401Response.md)
|
|
174
|
+
- [UghuuuGameServer.CreateLobbyRequest](docs/CreateLobbyRequest.md)
|
|
167
175
|
- [UghuuuGameServer.GetCurrentUser200Response](docs/GetCurrentUser200Response.md)
|
|
168
176
|
- [UghuuuGameServer.HealthResponse](docs/HealthResponse.md)
|
|
177
|
+
- [UghuuuGameServer.JoinLobby200Response](docs/JoinLobby200Response.md)
|
|
178
|
+
- [UghuuuGameServer.JoinLobbyRequest](docs/JoinLobbyRequest.md)
|
|
179
|
+
- [UghuuuGameServer.KickUser200Response](docs/KickUser200Response.md)
|
|
180
|
+
- [UghuuuGameServer.KickUserRequest](docs/KickUserRequest.md)
|
|
181
|
+
- [UghuuuGameServer.LeaveLobby200Response](docs/LeaveLobby200Response.md)
|
|
182
|
+
- [UghuuuGameServer.ListLobbies200ResponseInner](docs/ListLobbies200ResponseInner.md)
|
|
169
183
|
- [UghuuuGameServer.Login200Response](docs/Login200Response.md)
|
|
170
184
|
- [UghuuuGameServer.Login200ResponseData](docs/Login200ResponseData.md)
|
|
171
185
|
- [UghuuuGameServer.Login200ResponseDataUser](docs/Login200ResponseDataUser.md)
|
|
@@ -176,6 +190,7 @@ Class | Method | HTTP request | Description
|
|
|
176
190
|
- [UghuuuGameServer.OauthRequest200Response](docs/OauthRequest200Response.md)
|
|
177
191
|
- [UghuuuGameServer.RefreshToken200Response](docs/RefreshToken200Response.md)
|
|
178
192
|
- [UghuuuGameServer.RefreshTokenRequest](docs/RefreshTokenRequest.md)
|
|
193
|
+
- [UghuuuGameServer.UpdateLobbyRequest](docs/UpdateLobbyRequest.md)
|
|
179
194
|
|
|
180
195
|
|
|
181
196
|
## Documentation for Authorization
|
|
@@ -0,0 +1,316 @@
|
|
|
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 _CreateLobby401Response = _interopRequireDefault(require("../model/CreateLobby401Response"));
|
|
9
|
+
var _CreateLobbyRequest = _interopRequireDefault(require("../model/CreateLobbyRequest"));
|
|
10
|
+
var _JoinLobby200Response = _interopRequireDefault(require("../model/JoinLobby200Response"));
|
|
11
|
+
var _JoinLobbyRequest = _interopRequireDefault(require("../model/JoinLobbyRequest"));
|
|
12
|
+
var _KickUser200Response = _interopRequireDefault(require("../model/KickUser200Response"));
|
|
13
|
+
var _KickUserRequest = _interopRequireDefault(require("../model/KickUserRequest"));
|
|
14
|
+
var _LeaveLobby200Response = _interopRequireDefault(require("../model/LeaveLobby200Response"));
|
|
15
|
+
var _ListLobbies200ResponseInner = _interopRequireDefault(require("../model/ListLobbies200ResponseInner"));
|
|
16
|
+
var _UpdateLobbyRequest = _interopRequireDefault(require("../model/UpdateLobbyRequest"));
|
|
17
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
18
|
+
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); }
|
|
19
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
20
|
+
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); } }
|
|
21
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
22
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
23
|
+
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); } /**
|
|
24
|
+
* Game Server API
|
|
25
|
+
* 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 - **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 (API flow not yet implemented) 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. ## Endpoints All API endpoints are under `/api/v1`
|
|
26
|
+
*
|
|
27
|
+
* The version of the OpenAPI document: 1.0.0
|
|
28
|
+
*
|
|
29
|
+
*
|
|
30
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
31
|
+
* https://openapi-generator.tech
|
|
32
|
+
* Do not edit the class manually.
|
|
33
|
+
*
|
|
34
|
+
*/
|
|
35
|
+
/**
|
|
36
|
+
* Lobbies service.
|
|
37
|
+
* @module api/LobbiesApi
|
|
38
|
+
* @version 1.0.0
|
|
39
|
+
*/
|
|
40
|
+
var LobbiesApi = exports["default"] = /*#__PURE__*/function () {
|
|
41
|
+
/**
|
|
42
|
+
* Constructs a new LobbiesApi.
|
|
43
|
+
* @alias module:api/LobbiesApi
|
|
44
|
+
* @class
|
|
45
|
+
* @param {module:ApiClient} [apiClient] Optional API client implementation to use,
|
|
46
|
+
* default to {@link module:ApiClient#instance} if unspecified.
|
|
47
|
+
*/
|
|
48
|
+
function LobbiesApi(apiClient) {
|
|
49
|
+
_classCallCheck(this, LobbiesApi);
|
|
50
|
+
this.apiClient = apiClient || _ApiClient["default"].instance;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Create a lobby
|
|
55
|
+
* Create a new lobby. The authenticated user becomes the host and is automatically joined.
|
|
56
|
+
* @param {Object} opts Optional parameters
|
|
57
|
+
* @param {module:model/CreateLobbyRequest} [createLobbyRequest] Lobby creation parameters
|
|
58
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ListLobbies200ResponseInner} and HTTP response
|
|
59
|
+
*/
|
|
60
|
+
return _createClass(LobbiesApi, [{
|
|
61
|
+
key: "createLobbyWithHttpInfo",
|
|
62
|
+
value: function createLobbyWithHttpInfo(opts) {
|
|
63
|
+
opts = opts || {};
|
|
64
|
+
var postBody = opts['createLobbyRequest'];
|
|
65
|
+
var pathParams = {};
|
|
66
|
+
var queryParams = {};
|
|
67
|
+
var headerParams = {};
|
|
68
|
+
var formParams = {};
|
|
69
|
+
var authNames = ['authorization'];
|
|
70
|
+
var contentTypes = ['application/json'];
|
|
71
|
+
var accepts = ['application/json'];
|
|
72
|
+
var returnType = _ListLobbies200ResponseInner["default"];
|
|
73
|
+
return this.apiClient.callApi('/api/v1/lobbies', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Create a lobby
|
|
78
|
+
* Create a new lobby. The authenticated user becomes the host and is automatically joined.
|
|
79
|
+
* @param {Object} opts Optional parameters
|
|
80
|
+
* @param {module:model/CreateLobbyRequest} opts.createLobbyRequest Lobby creation parameters
|
|
81
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ListLobbies200ResponseInner}
|
|
82
|
+
*/
|
|
83
|
+
}, {
|
|
84
|
+
key: "createLobby",
|
|
85
|
+
value: function createLobby(opts) {
|
|
86
|
+
return this.createLobbyWithHttpInfo(opts).then(function (response_and_data) {
|
|
87
|
+
return response_and_data.data;
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Join a lobby
|
|
93
|
+
* Join an existing lobby. If the lobby requires a password, include it in the request body.
|
|
94
|
+
* @param {Number} id Lobby ID
|
|
95
|
+
* @param {Object} opts Optional parameters
|
|
96
|
+
* @param {module:model/JoinLobbyRequest} [joinLobbyRequest] Join parameters (optional)
|
|
97
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/JoinLobby200Response} and HTTP response
|
|
98
|
+
*/
|
|
99
|
+
}, {
|
|
100
|
+
key: "joinLobbyWithHttpInfo",
|
|
101
|
+
value: function joinLobbyWithHttpInfo(id, opts) {
|
|
102
|
+
opts = opts || {};
|
|
103
|
+
var postBody = opts['joinLobbyRequest'];
|
|
104
|
+
// verify the required parameter 'id' is set
|
|
105
|
+
if (id === undefined || id === null) {
|
|
106
|
+
throw new Error("Missing the required parameter 'id' when calling joinLobby");
|
|
107
|
+
}
|
|
108
|
+
var pathParams = {
|
|
109
|
+
'id': id
|
|
110
|
+
};
|
|
111
|
+
var queryParams = {};
|
|
112
|
+
var headerParams = {};
|
|
113
|
+
var formParams = {};
|
|
114
|
+
var authNames = ['authorization'];
|
|
115
|
+
var contentTypes = ['application/json'];
|
|
116
|
+
var accepts = ['application/json'];
|
|
117
|
+
var returnType = _JoinLobby200Response["default"];
|
|
118
|
+
return this.apiClient.callApi('/api/v1/lobbies/{id}/join', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Join a lobby
|
|
123
|
+
* Join an existing lobby. If the lobby requires a password, include it in the request body.
|
|
124
|
+
* @param {Number} id Lobby ID
|
|
125
|
+
* @param {Object} opts Optional parameters
|
|
126
|
+
* @param {module:model/JoinLobbyRequest} opts.joinLobbyRequest Join parameters (optional)
|
|
127
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/JoinLobby200Response}
|
|
128
|
+
*/
|
|
129
|
+
}, {
|
|
130
|
+
key: "joinLobby",
|
|
131
|
+
value: function joinLobby(id, opts) {
|
|
132
|
+
return this.joinLobbyWithHttpInfo(id, opts).then(function (response_and_data) {
|
|
133
|
+
return response_and_data.data;
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Kick a user from the lobby
|
|
139
|
+
* Remove a user from the lobby. Only the host can kick users.
|
|
140
|
+
* @param {Number} id Lobby ID
|
|
141
|
+
* @param {Object} opts Optional parameters
|
|
142
|
+
* @param {module:model/KickUserRequest} [kickUserRequest] Kick parameters
|
|
143
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/KickUser200Response} and HTTP response
|
|
144
|
+
*/
|
|
145
|
+
}, {
|
|
146
|
+
key: "kickUserWithHttpInfo",
|
|
147
|
+
value: function kickUserWithHttpInfo(id, opts) {
|
|
148
|
+
opts = opts || {};
|
|
149
|
+
var postBody = opts['kickUserRequest'];
|
|
150
|
+
// verify the required parameter 'id' is set
|
|
151
|
+
if (id === undefined || id === null) {
|
|
152
|
+
throw new Error("Missing the required parameter 'id' when calling kickUser");
|
|
153
|
+
}
|
|
154
|
+
var pathParams = {
|
|
155
|
+
'id': id
|
|
156
|
+
};
|
|
157
|
+
var queryParams = {};
|
|
158
|
+
var headerParams = {};
|
|
159
|
+
var formParams = {};
|
|
160
|
+
var authNames = ['authorization'];
|
|
161
|
+
var contentTypes = ['application/json'];
|
|
162
|
+
var accepts = ['application/json'];
|
|
163
|
+
var returnType = _KickUser200Response["default"];
|
|
164
|
+
return this.apiClient.callApi('/api/v1/lobbies/{id}/kick', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* Kick a user from the lobby
|
|
169
|
+
* Remove a user from the lobby. Only the host can kick users.
|
|
170
|
+
* @param {Number} id Lobby ID
|
|
171
|
+
* @param {Object} opts Optional parameters
|
|
172
|
+
* @param {module:model/KickUserRequest} opts.kickUserRequest Kick parameters
|
|
173
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/KickUser200Response}
|
|
174
|
+
*/
|
|
175
|
+
}, {
|
|
176
|
+
key: "kickUser",
|
|
177
|
+
value: function kickUser(id, opts) {
|
|
178
|
+
return this.kickUserWithHttpInfo(id, opts).then(function (response_and_data) {
|
|
179
|
+
return response_and_data.data;
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* Leave the current lobby
|
|
185
|
+
* Leave the lobby you are currently in.
|
|
186
|
+
* @param {Number} id Lobby ID
|
|
187
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/LeaveLobby200Response} and HTTP response
|
|
188
|
+
*/
|
|
189
|
+
}, {
|
|
190
|
+
key: "leaveLobbyWithHttpInfo",
|
|
191
|
+
value: function leaveLobbyWithHttpInfo(id) {
|
|
192
|
+
var postBody = null;
|
|
193
|
+
// verify the required parameter 'id' is set
|
|
194
|
+
if (id === undefined || id === null) {
|
|
195
|
+
throw new Error("Missing the required parameter 'id' when calling leaveLobby");
|
|
196
|
+
}
|
|
197
|
+
var pathParams = {
|
|
198
|
+
'id': id
|
|
199
|
+
};
|
|
200
|
+
var queryParams = {};
|
|
201
|
+
var headerParams = {};
|
|
202
|
+
var formParams = {};
|
|
203
|
+
var authNames = ['authorization'];
|
|
204
|
+
var contentTypes = [];
|
|
205
|
+
var accepts = ['application/json'];
|
|
206
|
+
var returnType = _LeaveLobby200Response["default"];
|
|
207
|
+
return this.apiClient.callApi('/api/v1/lobbies/{id}/leave', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* Leave the current lobby
|
|
212
|
+
* Leave the lobby you are currently in.
|
|
213
|
+
* @param {Number} id Lobby ID
|
|
214
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/LeaveLobby200Response}
|
|
215
|
+
*/
|
|
216
|
+
}, {
|
|
217
|
+
key: "leaveLobby",
|
|
218
|
+
value: function leaveLobby(id) {
|
|
219
|
+
return this.leaveLobbyWithHttpInfo(id).then(function (response_and_data) {
|
|
220
|
+
return response_and_data.data;
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* List lobbies
|
|
226
|
+
* Return all non-hidden lobbies. Supports optional text search via 'q' and metadata filters.
|
|
227
|
+
* @param {Object} opts Optional parameters
|
|
228
|
+
* @param {String} [q] Search term for name or title
|
|
229
|
+
* @param {String} [metadataKey] Optional metadata key to filter by
|
|
230
|
+
* @param {String} [metadataValue] Optional metadata value to match (used with metadata_key)
|
|
231
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Array.<module:model/ListLobbies200ResponseInner>} and HTTP response
|
|
232
|
+
*/
|
|
233
|
+
}, {
|
|
234
|
+
key: "listLobbiesWithHttpInfo",
|
|
235
|
+
value: function listLobbiesWithHttpInfo(opts) {
|
|
236
|
+
opts = opts || {};
|
|
237
|
+
var postBody = null;
|
|
238
|
+
var pathParams = {};
|
|
239
|
+
var queryParams = {
|
|
240
|
+
'q': opts['q'],
|
|
241
|
+
'metadata_key': opts['metadataKey'],
|
|
242
|
+
'metadata_value': opts['metadataValue']
|
|
243
|
+
};
|
|
244
|
+
var headerParams = {};
|
|
245
|
+
var formParams = {};
|
|
246
|
+
var authNames = [];
|
|
247
|
+
var contentTypes = [];
|
|
248
|
+
var accepts = ['application/json'];
|
|
249
|
+
var returnType = [_ListLobbies200ResponseInner["default"]];
|
|
250
|
+
return this.apiClient.callApi('/api/v1/lobbies', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
/**
|
|
254
|
+
* List lobbies
|
|
255
|
+
* Return all non-hidden lobbies. Supports optional text search via 'q' and metadata filters.
|
|
256
|
+
* @param {Object} opts Optional parameters
|
|
257
|
+
* @param {String} opts.q Search term for name or title
|
|
258
|
+
* @param {String} opts.metadataKey Optional metadata key to filter by
|
|
259
|
+
* @param {String} opts.metadataValue Optional metadata value to match (used with metadata_key)
|
|
260
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Array.<module:model/ListLobbies200ResponseInner>}
|
|
261
|
+
*/
|
|
262
|
+
}, {
|
|
263
|
+
key: "listLobbies",
|
|
264
|
+
value: function listLobbies(opts) {
|
|
265
|
+
return this.listLobbiesWithHttpInfo(opts).then(function (response_and_data) {
|
|
266
|
+
return response_and_data.data;
|
|
267
|
+
});
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
/**
|
|
271
|
+
* Update lobby (host only)
|
|
272
|
+
* Update lobby settings. Only the host can update the lobby.
|
|
273
|
+
* @param {Number} id Lobby ID
|
|
274
|
+
* @param {Object} opts Optional parameters
|
|
275
|
+
* @param {module:model/UpdateLobbyRequest} [updateLobbyRequest] Lobby update parameters
|
|
276
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ListLobbies200ResponseInner} and HTTP response
|
|
277
|
+
*/
|
|
278
|
+
}, {
|
|
279
|
+
key: "updateLobbyWithHttpInfo",
|
|
280
|
+
value: function updateLobbyWithHttpInfo(id, opts) {
|
|
281
|
+
opts = opts || {};
|
|
282
|
+
var postBody = opts['updateLobbyRequest'];
|
|
283
|
+
// verify the required parameter 'id' is set
|
|
284
|
+
if (id === undefined || id === null) {
|
|
285
|
+
throw new Error("Missing the required parameter 'id' when calling updateLobby");
|
|
286
|
+
}
|
|
287
|
+
var pathParams = {
|
|
288
|
+
'id': id
|
|
289
|
+
};
|
|
290
|
+
var queryParams = {};
|
|
291
|
+
var headerParams = {};
|
|
292
|
+
var formParams = {};
|
|
293
|
+
var authNames = ['authorization'];
|
|
294
|
+
var contentTypes = ['application/json'];
|
|
295
|
+
var accepts = ['application/json'];
|
|
296
|
+
var returnType = _ListLobbies200ResponseInner["default"];
|
|
297
|
+
return this.apiClient.callApi('/api/v1/lobbies/{id}', 'PATCH', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
/**
|
|
301
|
+
* Update lobby (host only)
|
|
302
|
+
* Update lobby settings. Only the host can update the lobby.
|
|
303
|
+
* @param {Number} id Lobby ID
|
|
304
|
+
* @param {Object} opts Optional parameters
|
|
305
|
+
* @param {module:model/UpdateLobbyRequest} opts.updateLobbyRequest Lobby update parameters
|
|
306
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ListLobbies200ResponseInner}
|
|
307
|
+
*/
|
|
308
|
+
}, {
|
|
309
|
+
key: "updateLobby",
|
|
310
|
+
value: function updateLobby(id, opts) {
|
|
311
|
+
return this.updateLobbyWithHttpInfo(id, opts).then(function (response_and_data) {
|
|
312
|
+
return response_and_data.data;
|
|
313
|
+
});
|
|
314
|
+
}
|
|
315
|
+
}]);
|
|
316
|
+
}();
|
package/dist/index.js
CHANGED
|
@@ -15,6 +15,18 @@ Object.defineProperty(exports, "AuthenticationApi", {
|
|
|
15
15
|
return _AuthenticationApi["default"];
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
|
+
Object.defineProperty(exports, "CreateLobby401Response", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function get() {
|
|
21
|
+
return _CreateLobby401Response["default"];
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(exports, "CreateLobbyRequest", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function get() {
|
|
27
|
+
return _CreateLobbyRequest["default"];
|
|
28
|
+
}
|
|
29
|
+
});
|
|
18
30
|
Object.defineProperty(exports, "GetCurrentUser200Response", {
|
|
19
31
|
enumerable: true,
|
|
20
32
|
get: function get() {
|
|
@@ -33,6 +45,48 @@ Object.defineProperty(exports, "HealthResponse", {
|
|
|
33
45
|
return _HealthResponse["default"];
|
|
34
46
|
}
|
|
35
47
|
});
|
|
48
|
+
Object.defineProperty(exports, "JoinLobby200Response", {
|
|
49
|
+
enumerable: true,
|
|
50
|
+
get: function get() {
|
|
51
|
+
return _JoinLobby200Response["default"];
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
Object.defineProperty(exports, "JoinLobbyRequest", {
|
|
55
|
+
enumerable: true,
|
|
56
|
+
get: function get() {
|
|
57
|
+
return _JoinLobbyRequest["default"];
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
Object.defineProperty(exports, "KickUser200Response", {
|
|
61
|
+
enumerable: true,
|
|
62
|
+
get: function get() {
|
|
63
|
+
return _KickUser200Response["default"];
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
Object.defineProperty(exports, "KickUserRequest", {
|
|
67
|
+
enumerable: true,
|
|
68
|
+
get: function get() {
|
|
69
|
+
return _KickUserRequest["default"];
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
Object.defineProperty(exports, "LeaveLobby200Response", {
|
|
73
|
+
enumerable: true,
|
|
74
|
+
get: function get() {
|
|
75
|
+
return _LeaveLobby200Response["default"];
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
Object.defineProperty(exports, "ListLobbies200ResponseInner", {
|
|
79
|
+
enumerable: true,
|
|
80
|
+
get: function get() {
|
|
81
|
+
return _ListLobbies200ResponseInner["default"];
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
Object.defineProperty(exports, "LobbiesApi", {
|
|
85
|
+
enumerable: true,
|
|
86
|
+
get: function get() {
|
|
87
|
+
return _LobbiesApi["default"];
|
|
88
|
+
}
|
|
89
|
+
});
|
|
36
90
|
Object.defineProperty(exports, "Login200Response", {
|
|
37
91
|
enumerable: true,
|
|
38
92
|
get: function get() {
|
|
@@ -93,6 +147,12 @@ Object.defineProperty(exports, "RefreshTokenRequest", {
|
|
|
93
147
|
return _RefreshTokenRequest["default"];
|
|
94
148
|
}
|
|
95
149
|
});
|
|
150
|
+
Object.defineProperty(exports, "UpdateLobbyRequest", {
|
|
151
|
+
enumerable: true,
|
|
152
|
+
get: function get() {
|
|
153
|
+
return _UpdateLobbyRequest["default"];
|
|
154
|
+
}
|
|
155
|
+
});
|
|
96
156
|
Object.defineProperty(exports, "UsersApi", {
|
|
97
157
|
enumerable: true,
|
|
98
158
|
get: function get() {
|
|
@@ -100,8 +160,16 @@ Object.defineProperty(exports, "UsersApi", {
|
|
|
100
160
|
}
|
|
101
161
|
});
|
|
102
162
|
var _ApiClient = _interopRequireDefault(require("./ApiClient"));
|
|
163
|
+
var _CreateLobby401Response = _interopRequireDefault(require("./model/CreateLobby401Response"));
|
|
164
|
+
var _CreateLobbyRequest = _interopRequireDefault(require("./model/CreateLobbyRequest"));
|
|
103
165
|
var _GetCurrentUser200Response = _interopRequireDefault(require("./model/GetCurrentUser200Response"));
|
|
104
166
|
var _HealthResponse = _interopRequireDefault(require("./model/HealthResponse"));
|
|
167
|
+
var _JoinLobby200Response = _interopRequireDefault(require("./model/JoinLobby200Response"));
|
|
168
|
+
var _JoinLobbyRequest = _interopRequireDefault(require("./model/JoinLobbyRequest"));
|
|
169
|
+
var _KickUser200Response = _interopRequireDefault(require("./model/KickUser200Response"));
|
|
170
|
+
var _KickUserRequest = _interopRequireDefault(require("./model/KickUserRequest"));
|
|
171
|
+
var _LeaveLobby200Response = _interopRequireDefault(require("./model/LeaveLobby200Response"));
|
|
172
|
+
var _ListLobbies200ResponseInner = _interopRequireDefault(require("./model/ListLobbies200ResponseInner"));
|
|
105
173
|
var _Login200Response = _interopRequireDefault(require("./model/Login200Response"));
|
|
106
174
|
var _Login200ResponseData = _interopRequireDefault(require("./model/Login200ResponseData"));
|
|
107
175
|
var _Login200ResponseDataUser = _interopRequireDefault(require("./model/Login200ResponseDataUser"));
|
|
@@ -112,7 +180,9 @@ var _OAuthSessionStatus = _interopRequireDefault(require("./model/OAuthSessionSt
|
|
|
112
180
|
var _OauthRequest200Response = _interopRequireDefault(require("./model/OauthRequest200Response"));
|
|
113
181
|
var _RefreshToken200Response = _interopRequireDefault(require("./model/RefreshToken200Response"));
|
|
114
182
|
var _RefreshTokenRequest = _interopRequireDefault(require("./model/RefreshTokenRequest"));
|
|
183
|
+
var _UpdateLobbyRequest = _interopRequireDefault(require("./model/UpdateLobbyRequest"));
|
|
115
184
|
var _AuthenticationApi = _interopRequireDefault(require("./api/AuthenticationApi"));
|
|
116
185
|
var _HealthApi = _interopRequireDefault(require("./api/HealthApi"));
|
|
186
|
+
var _LobbiesApi = _interopRequireDefault(require("./api/LobbiesApi"));
|
|
117
187
|
var _UsersApi = _interopRequireDefault(require("./api/UsersApi"));
|
|
118
188
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
@@ -0,0 +1,89 @@
|
|
|
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
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
9
|
+
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); }
|
|
10
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
11
|
+
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); } }
|
|
12
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
13
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
14
|
+
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); } /**
|
|
15
|
+
* Game Server API
|
|
16
|
+
* 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 - **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 (API flow not yet implemented) 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. ## Endpoints All API endpoints are under `/api/v1`
|
|
17
|
+
*
|
|
18
|
+
* The version of the OpenAPI document: 1.0.0
|
|
19
|
+
*
|
|
20
|
+
*
|
|
21
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
22
|
+
* https://openapi-generator.tech
|
|
23
|
+
* Do not edit the class manually.
|
|
24
|
+
*
|
|
25
|
+
*/
|
|
26
|
+
/**
|
|
27
|
+
* The CreateLobby401Response model module.
|
|
28
|
+
* @module model/CreateLobby401Response
|
|
29
|
+
* @version 1.0.0
|
|
30
|
+
*/
|
|
31
|
+
var CreateLobby401Response = /*#__PURE__*/function () {
|
|
32
|
+
/**
|
|
33
|
+
* Constructs a new <code>CreateLobby401Response</code>.
|
|
34
|
+
* @alias module:model/CreateLobby401Response
|
|
35
|
+
*/
|
|
36
|
+
function CreateLobby401Response() {
|
|
37
|
+
_classCallCheck(this, CreateLobby401Response);
|
|
38
|
+
CreateLobby401Response.initialize(this);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Initializes the fields of this object.
|
|
43
|
+
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
|
|
44
|
+
* Only for internal use.
|
|
45
|
+
*/
|
|
46
|
+
return _createClass(CreateLobby401Response, null, [{
|
|
47
|
+
key: "initialize",
|
|
48
|
+
value: function initialize(obj) {}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Constructs a <code>CreateLobby401Response</code> from a plain JavaScript object, optionally creating a new instance.
|
|
52
|
+
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
|
|
53
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
54
|
+
* @param {module:model/CreateLobby401Response} obj Optional instance to populate.
|
|
55
|
+
* @return {module:model/CreateLobby401Response} The populated <code>CreateLobby401Response</code> instance.
|
|
56
|
+
*/
|
|
57
|
+
}, {
|
|
58
|
+
key: "constructFromObject",
|
|
59
|
+
value: function constructFromObject(data, obj) {
|
|
60
|
+
if (data) {
|
|
61
|
+
obj = obj || new CreateLobby401Response();
|
|
62
|
+
if (data.hasOwnProperty('error')) {
|
|
63
|
+
obj['error'] = _ApiClient["default"].convertToType(data['error'], 'String');
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
return obj;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Validates the JSON data with respect to <code>CreateLobby401Response</code>.
|
|
71
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
72
|
+
* @return {boolean} to indicate whether the JSON data is valid with respect to <code>CreateLobby401Response</code>.
|
|
73
|
+
*/
|
|
74
|
+
}, {
|
|
75
|
+
key: "validateJSON",
|
|
76
|
+
value: function validateJSON(data) {
|
|
77
|
+
// ensure the json data is a string
|
|
78
|
+
if (data['error'] && !(typeof data['error'] === 'string' || data['error'] instanceof String)) {
|
|
79
|
+
throw new Error("Expected the field `error` to be a primitive type in the JSON string but got " + data['error']);
|
|
80
|
+
}
|
|
81
|
+
return true;
|
|
82
|
+
}
|
|
83
|
+
}]);
|
|
84
|
+
}();
|
|
85
|
+
/**
|
|
86
|
+
* @member {String} error
|
|
87
|
+
*/
|
|
88
|
+
CreateLobby401Response.prototype['error'] = undefined;
|
|
89
|
+
var _default = exports["default"] = CreateLobby401Response;
|