@ughuuu/game_server 1.0.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.
Files changed (36) hide show
  1. package/README.md +188 -0
  2. package/dist/ApiClient.js +703 -0
  3. package/dist/api/AuthenticationApi.js +340 -0
  4. package/dist/api/HealthApi.js +78 -0
  5. package/dist/api/UsersApi.js +127 -0
  6. package/dist/index.js +125 -0
  7. package/dist/model/GameServerWebApiV1MeControllerShow200Response.js +91 -0
  8. package/dist/model/GameServerWebApiV1MeControllerShow200ResponseData.js +125 -0
  9. package/dist/model/GameServerWebApiV1SessionControllerCreate200Response.js +91 -0
  10. package/dist/model/GameServerWebApiV1SessionControllerCreate200ResponseData.js +139 -0
  11. package/dist/model/GameServerWebApiV1SessionControllerCreate200ResponseDataUser.js +97 -0
  12. package/dist/model/GameServerWebApiV1SessionControllerCreateRequest.js +128 -0
  13. package/dist/model/GameServerWebApiV1SessionControllerDelete200Response.js +89 -0
  14. package/dist/model/GameServerWebApiV1SessionControllerRefresh200Response.js +91 -0
  15. package/dist/model/GameServerWebApiV1SessionControllerRefresh200ResponseData.js +126 -0
  16. package/dist/model/GameServerWebApiV1SessionControllerRefreshRequest.js +113 -0
  17. package/dist/model/GameServerWebAuthControllerApiCallback200Response.js +91 -0
  18. package/dist/model/GameServerWebAuthControllerApiCallback200ResponseData.js +139 -0
  19. package/dist/model/GameServerWebAuthControllerApiCallback200ResponseDataUser.js +109 -0
  20. package/dist/model/GameServerWebAuthControllerApiCallback409Response.js +97 -0
  21. package/dist/model/GameServerWebAuthControllerApiRequest200Response.js +103 -0
  22. package/dist/model/GameServerWebAuthControllerApiSessionStatus200Response.js +140 -0
  23. package/dist/model/GetCurrentUser200Response.js +91 -0
  24. package/dist/model/GetCurrentUser200ResponseData.js +125 -0
  25. package/dist/model/HealthResponse.js +129 -0
  26. package/dist/model/Login200Response.js +91 -0
  27. package/dist/model/Login200ResponseData.js +139 -0
  28. package/dist/model/Login200ResponseDataUser.js +97 -0
  29. package/dist/model/LoginRequest.js +128 -0
  30. package/dist/model/Logout200Response.js +89 -0
  31. package/dist/model/OauthRequest200Response.js +103 -0
  32. package/dist/model/OauthSessionStatus200Response.js +140 -0
  33. package/dist/model/RefreshToken200Response.js +91 -0
  34. package/dist/model/RefreshToken200ResponseData.js +126 -0
  35. package/dist/model/RefreshTokenRequest.js +113 -0
  36. package/package.json +46 -0
@@ -0,0 +1,340 @@
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 _Login200Response = _interopRequireDefault(require("../model/Login200Response"));
9
+ var _LoginRequest = _interopRequireDefault(require("../model/LoginRequest"));
10
+ var _Logout200Response = _interopRequireDefault(require("../model/Logout200Response"));
11
+ var _OauthRequest200Response = _interopRequireDefault(require("../model/OauthRequest200Response"));
12
+ var _OauthSessionStatus200Response = _interopRequireDefault(require("../model/OauthSessionStatus200Response"));
13
+ var _RefreshToken200Response = _interopRequireDefault(require("../model/RefreshToken200Response"));
14
+ var _RefreshTokenRequest = _interopRequireDefault(require("../model/RefreshTokenRequest"));
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
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 - **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`
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
+ * Authentication service.
35
+ * @module api/AuthenticationApi
36
+ * @version 1.0.0
37
+ */
38
+ var AuthenticationApi = exports["default"] = /*#__PURE__*/function () {
39
+ /**
40
+ * Constructs a new AuthenticationApi.
41
+ * @alias module:api/AuthenticationApi
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 AuthenticationApi(apiClient) {
47
+ _classCallCheck(this, AuthenticationApi);
48
+ this.apiClient = apiClient || _ApiClient["default"].instance;
49
+ }
50
+
51
+ /**
52
+ * Login
53
+ * Authenticate user with email and password
54
+ * @param {Object} opts Optional parameters
55
+ * @param {module:model/LoginRequest} [loginRequest] Login credentials
56
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/Login200Response} and HTTP response
57
+ */
58
+ return _createClass(AuthenticationApi, [{
59
+ key: "loginWithHttpInfo",
60
+ value: function loginWithHttpInfo(opts) {
61
+ opts = opts || {};
62
+ var postBody = opts['loginRequest'];
63
+ var pathParams = {};
64
+ var queryParams = {};
65
+ var headerParams = {};
66
+ var formParams = {};
67
+ var authNames = [];
68
+ var contentTypes = ['application/json'];
69
+ var accepts = ['application/json'];
70
+ var returnType = _Login200Response["default"];
71
+ return this.apiClient.callApi('/api/v1/login', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
72
+ }
73
+
74
+ /**
75
+ * Login
76
+ * Authenticate user with email and password
77
+ * @param {Object} opts Optional parameters
78
+ * @param {module:model/LoginRequest} opts.loginRequest Login credentials
79
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Login200Response}
80
+ */
81
+ }, {
82
+ key: "login",
83
+ value: function login(opts) {
84
+ return this.loginWithHttpInfo(opts).then(function (response_and_data) {
85
+ return response_and_data.data;
86
+ });
87
+ }
88
+
89
+ /**
90
+ * Logout
91
+ * Invalidate user session token
92
+ * @param {String} authorization Bearer token
93
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/Logout200Response} and HTTP response
94
+ */
95
+ }, {
96
+ key: "logoutWithHttpInfo",
97
+ value: function logoutWithHttpInfo(authorization) {
98
+ var postBody = null;
99
+ // verify the required parameter 'authorization' is set
100
+ if (authorization === undefined || authorization === null) {
101
+ throw new Error("Missing the required parameter 'authorization' when calling logout");
102
+ }
103
+ var pathParams = {};
104
+ var queryParams = {};
105
+ var headerParams = {
106
+ 'Authorization': authorization
107
+ };
108
+ var formParams = {};
109
+ var authNames = ['authorization'];
110
+ var contentTypes = [];
111
+ var accepts = ['application/json'];
112
+ var returnType = _Logout200Response["default"];
113
+ return this.apiClient.callApi('/api/v1/logout', 'DELETE', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
114
+ }
115
+
116
+ /**
117
+ * Logout
118
+ * Invalidate user session token
119
+ * @param {String} authorization Bearer token
120
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Logout200Response}
121
+ */
122
+ }, {
123
+ key: "logout",
124
+ value: function logout(authorization) {
125
+ return this.logoutWithHttpInfo(authorization).then(function (response_and_data) {
126
+ return response_and_data.data;
127
+ });
128
+ }
129
+
130
+ /**
131
+ * Delete conflicting provider account
132
+ * Deletes a conflicting account that owns a provider ID when allowed (must be authenticated). Only allowed when the conflicting account either has no password (provider-only) or has the same email as the current user.
133
+ * @param {module:model/String} provider
134
+ * @param {Number} conflictUserId
135
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Object} and HTTP response
136
+ */
137
+ }, {
138
+ key: "oauthConflictDeleteWithHttpInfo",
139
+ value: function oauthConflictDeleteWithHttpInfo(provider, conflictUserId) {
140
+ var postBody = null;
141
+ // verify the required parameter 'provider' is set
142
+ if (provider === undefined || provider === null) {
143
+ throw new Error("Missing the required parameter 'provider' when calling oauthConflictDelete");
144
+ }
145
+ // verify the required parameter 'conflictUserId' is set
146
+ if (conflictUserId === undefined || conflictUserId === null) {
147
+ throw new Error("Missing the required parameter 'conflictUserId' when calling oauthConflictDelete");
148
+ }
149
+ var pathParams = {
150
+ 'provider': provider
151
+ };
152
+ var queryParams = {
153
+ 'conflict_user_id': conflictUserId
154
+ };
155
+ var headerParams = {};
156
+ var formParams = {};
157
+ var authNames = [];
158
+ var contentTypes = [];
159
+ var accepts = ['application/json'];
160
+ var returnType = Object;
161
+ return this.apiClient.callApi('/api/v1/auth/{provider}/conflict-delete', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
162
+ }
163
+
164
+ /**
165
+ * Delete conflicting provider account
166
+ * Deletes a conflicting account that owns a provider ID when allowed (must be authenticated). Only allowed when the conflicting account either has no password (provider-only) or has the same email as the current user.
167
+ * @param {module:model/String} provider
168
+ * @param {Number} conflictUserId
169
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Object}
170
+ */
171
+ }, {
172
+ key: "oauthConflictDelete",
173
+ value: function oauthConflictDelete(provider, conflictUserId) {
174
+ return this.oauthConflictDeleteWithHttpInfo(provider, conflictUserId).then(function (response_and_data) {
175
+ return response_and_data.data;
176
+ });
177
+ }
178
+
179
+ /**
180
+ * Initiate API OAuth
181
+ * Returns OAuth authorization URL for API clients
182
+ * @param {module:model/String} provider OAuth provider
183
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/OauthRequest200Response} and HTTP response
184
+ */
185
+ }, {
186
+ key: "oauthRequestWithHttpInfo",
187
+ value: function oauthRequestWithHttpInfo(provider) {
188
+ var postBody = null;
189
+ // verify the required parameter 'provider' is set
190
+ if (provider === undefined || provider === null) {
191
+ throw new Error("Missing the required parameter 'provider' when calling oauthRequest");
192
+ }
193
+ var pathParams = {
194
+ 'provider': provider
195
+ };
196
+ var queryParams = {};
197
+ var headerParams = {};
198
+ var formParams = {};
199
+ var authNames = [];
200
+ var contentTypes = [];
201
+ var accepts = ['application/json'];
202
+ var returnType = _OauthRequest200Response["default"];
203
+ return this.apiClient.callApi('/api/v1/auth/{provider}', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
204
+ }
205
+
206
+ /**
207
+ * Initiate API OAuth
208
+ * Returns OAuth authorization URL for API clients
209
+ * @param {module:model/String} provider OAuth provider
210
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/OauthRequest200Response}
211
+ */
212
+ }, {
213
+ key: "oauthRequest",
214
+ value: function oauthRequest(provider) {
215
+ return this.oauthRequestWithHttpInfo(provider).then(function (response_and_data) {
216
+ return response_and_data.data;
217
+ });
218
+ }
219
+
220
+ /**
221
+ * Get OAuth session status
222
+ * Check the status of an OAuth session for API clients
223
+ * @param {String} sessionId Session ID from OAuth request
224
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/OauthSessionStatus200Response} and HTTP response
225
+ */
226
+ }, {
227
+ key: "oauthSessionStatusWithHttpInfo",
228
+ value: function oauthSessionStatusWithHttpInfo(sessionId) {
229
+ var postBody = null;
230
+ // verify the required parameter 'sessionId' is set
231
+ if (sessionId === undefined || sessionId === null) {
232
+ throw new Error("Missing the required parameter 'sessionId' when calling oauthSessionStatus");
233
+ }
234
+ var pathParams = {
235
+ 'session_id': sessionId
236
+ };
237
+ var queryParams = {};
238
+ var headerParams = {};
239
+ var formParams = {};
240
+ var authNames = [];
241
+ var contentTypes = [];
242
+ var accepts = ['application/json'];
243
+ var returnType = _OauthSessionStatus200Response["default"];
244
+ return this.apiClient.callApi('/api/v1/auth/session/{session_id}', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
245
+ }
246
+
247
+ /**
248
+ * Get OAuth session status
249
+ * Check the status of an OAuth session for API clients
250
+ * @param {String} sessionId Session ID from OAuth request
251
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/OauthSessionStatus200Response}
252
+ */
253
+ }, {
254
+ key: "oauthSessionStatus",
255
+ value: function oauthSessionStatus(sessionId) {
256
+ return this.oauthSessionStatusWithHttpInfo(sessionId).then(function (response_and_data) {
257
+ return response_and_data.data;
258
+ });
259
+ }
260
+
261
+ /**
262
+ * Refresh access token
263
+ * Exchange a valid refresh token for a new access token
264
+ * @param {Object} opts Optional parameters
265
+ * @param {module:model/RefreshTokenRequest} [refreshTokenRequest] Refresh token
266
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/RefreshToken200Response} and HTTP response
267
+ */
268
+ }, {
269
+ key: "refreshTokenWithHttpInfo",
270
+ value: function refreshTokenWithHttpInfo(opts) {
271
+ opts = opts || {};
272
+ var postBody = opts['refreshTokenRequest'];
273
+ var pathParams = {};
274
+ var queryParams = {};
275
+ var headerParams = {};
276
+ var formParams = {};
277
+ var authNames = [];
278
+ var contentTypes = ['application/json'];
279
+ var accepts = ['application/json'];
280
+ var returnType = _RefreshToken200Response["default"];
281
+ return this.apiClient.callApi('/api/v1/refresh', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
282
+ }
283
+
284
+ /**
285
+ * Refresh access token
286
+ * Exchange a valid refresh token for a new access token
287
+ * @param {Object} opts Optional parameters
288
+ * @param {module:model/RefreshTokenRequest} opts.refreshTokenRequest Refresh token
289
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/RefreshToken200Response}
290
+ */
291
+ }, {
292
+ key: "refreshToken",
293
+ value: function refreshToken(opts) {
294
+ return this.refreshTokenWithHttpInfo(opts).then(function (response_and_data) {
295
+ return response_and_data.data;
296
+ });
297
+ }
298
+
299
+ /**
300
+ * Unlink OAuth provider
301
+ * Unlinks a provider from the current authenticated user.
302
+ * @param {module:model/String} provider
303
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Object} and HTTP response
304
+ */
305
+ }, {
306
+ key: "unlinkProviderWithHttpInfo",
307
+ value: function unlinkProviderWithHttpInfo(provider) {
308
+ var postBody = null;
309
+ // verify the required parameter 'provider' is set
310
+ if (provider === undefined || provider === null) {
311
+ throw new Error("Missing the required parameter 'provider' when calling unlinkProvider");
312
+ }
313
+ var pathParams = {
314
+ 'provider': provider
315
+ };
316
+ var queryParams = {};
317
+ var headerParams = {};
318
+ var formParams = {};
319
+ var authNames = [];
320
+ var contentTypes = [];
321
+ var accepts = ['application/json'];
322
+ var returnType = Object;
323
+ return this.apiClient.callApi('/api/v1/me/providers/{provider}', 'DELETE', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
324
+ }
325
+
326
+ /**
327
+ * Unlink OAuth provider
328
+ * Unlinks a provider from the current authenticated user.
329
+ * @param {module:model/String} provider
330
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Object}
331
+ */
332
+ }, {
333
+ key: "unlinkProvider",
334
+ value: function unlinkProvider(provider) {
335
+ return this.unlinkProviderWithHttpInfo(provider).then(function (response_and_data) {
336
+ return response_and_data.data;
337
+ });
338
+ }
339
+ }]);
340
+ }();
@@ -0,0 +1,78 @@
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 _HealthResponse = _interopRequireDefault(require("../model/HealthResponse"));
9
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
10
+ 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); }
11
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
12
+ 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); } }
13
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
14
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
15
+ 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); } /**
16
+ * Game Server
17
+ * 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`
18
+ *
19
+ * The version of the OpenAPI document: 1.0.0
20
+ *
21
+ *
22
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
23
+ * https://openapi-generator.tech
24
+ * Do not edit the class manually.
25
+ *
26
+ */
27
+ /**
28
+ * Health service.
29
+ * @module api/HealthApi
30
+ * @version 1.0.0
31
+ */
32
+ var HealthApi = exports["default"] = /*#__PURE__*/function () {
33
+ /**
34
+ * Constructs a new HealthApi.
35
+ * @alias module:api/HealthApi
36
+ * @class
37
+ * @param {module:ApiClient} [apiClient] Optional API client implementation to use,
38
+ * default to {@link module:ApiClient#instance} if unspecified.
39
+ */
40
+ function HealthApi(apiClient) {
41
+ _classCallCheck(this, HealthApi);
42
+ this.apiClient = apiClient || _ApiClient["default"].instance;
43
+ }
44
+
45
+ /**
46
+ * Health check
47
+ * Returns the health status of the API
48
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/HealthResponse} and HTTP response
49
+ */
50
+ return _createClass(HealthApi, [{
51
+ key: "indexWithHttpInfo",
52
+ value: function indexWithHttpInfo() {
53
+ var postBody = null;
54
+ var pathParams = {};
55
+ var queryParams = {};
56
+ var headerParams = {};
57
+ var formParams = {};
58
+ var authNames = [];
59
+ var contentTypes = [];
60
+ var accepts = ['application/json'];
61
+ var returnType = _HealthResponse["default"];
62
+ return this.apiClient.callApi('/api/v1/health', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
63
+ }
64
+
65
+ /**
66
+ * Health check
67
+ * Returns the health status of the API
68
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/HealthResponse}
69
+ */
70
+ }, {
71
+ key: "index",
72
+ value: function index() {
73
+ return this.indexWithHttpInfo().then(function (response_and_data) {
74
+ return response_and_data.data;
75
+ });
76
+ }
77
+ }]);
78
+ }();
@@ -0,0 +1,127 @@
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 _GetCurrentUser200Response = _interopRequireDefault(require("../model/GetCurrentUser200Response"));
9
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
10
+ 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); }
11
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
12
+ 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); } }
13
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
14
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
15
+ 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); } /**
16
+ * Game Server
17
+ * 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`
18
+ *
19
+ * The version of the OpenAPI document: 1.0.0
20
+ *
21
+ *
22
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
23
+ * https://openapi-generator.tech
24
+ * Do not edit the class manually.
25
+ *
26
+ */
27
+ /**
28
+ * Users service.
29
+ * @module api/UsersApi
30
+ * @version 1.0.0
31
+ */
32
+ var UsersApi = exports["default"] = /*#__PURE__*/function () {
33
+ /**
34
+ * Constructs a new UsersApi.
35
+ * @alias module:api/UsersApi
36
+ * @class
37
+ * @param {module:ApiClient} [apiClient] Optional API client implementation to use,
38
+ * default to {@link module:ApiClient#instance} if unspecified.
39
+ */
40
+ function UsersApi(apiClient) {
41
+ _classCallCheck(this, UsersApi);
42
+ this.apiClient = apiClient || _ApiClient["default"].instance;
43
+ }
44
+
45
+ /**
46
+ * Return current user info
47
+ * Returns the current authenticated user's basic information.
48
+ * @param {String} authorization Bearer token
49
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/GetCurrentUser200Response} and HTTP response
50
+ */
51
+ return _createClass(UsersApi, [{
52
+ key: "getCurrentUserWithHttpInfo",
53
+ value: function getCurrentUserWithHttpInfo(authorization) {
54
+ var postBody = null;
55
+ // verify the required parameter 'authorization' is set
56
+ if (authorization === undefined || authorization === null) {
57
+ throw new Error("Missing the required parameter 'authorization' when calling getCurrentUser");
58
+ }
59
+ var pathParams = {};
60
+ var queryParams = {};
61
+ var headerParams = {
62
+ 'Authorization': authorization
63
+ };
64
+ var formParams = {};
65
+ var authNames = ['authorization'];
66
+ var contentTypes = [];
67
+ var accepts = ['application/json'];
68
+ var returnType = _GetCurrentUser200Response["default"];
69
+ return this.apiClient.callApi('/api/v1/me', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
70
+ }
71
+
72
+ /**
73
+ * Return current user info
74
+ * Returns the current authenticated user's basic information.
75
+ * @param {String} authorization Bearer token
76
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/GetCurrentUser200Response}
77
+ */
78
+ }, {
79
+ key: "getCurrentUser",
80
+ value: function getCurrentUser(authorization) {
81
+ return this.getCurrentUserWithHttpInfo(authorization).then(function (response_and_data) {
82
+ return response_and_data.data;
83
+ });
84
+ }
85
+
86
+ /**
87
+ * Return current user's metadata
88
+ * Returns only the metadata map for the authenticated user.
89
+ * @param {String} authorization Bearer token
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: "getUserMetadataWithHttpInfo",
94
+ value: function getUserMetadataWithHttpInfo(authorization) {
95
+ var postBody = null;
96
+ // verify the required parameter 'authorization' is set
97
+ if (authorization === undefined || authorization === null) {
98
+ throw new Error("Missing the required parameter 'authorization' when calling getUserMetadata");
99
+ }
100
+ var pathParams = {};
101
+ var queryParams = {};
102
+ var headerParams = {
103
+ 'Authorization': authorization
104
+ };
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/me/metadata', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
111
+ }
112
+
113
+ /**
114
+ * Return current user's metadata
115
+ * Returns only the metadata map for the authenticated user.
116
+ * @param {String} authorization Bearer token
117
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Object}
118
+ */
119
+ }, {
120
+ key: "getUserMetadata",
121
+ value: function getUserMetadata(authorization) {
122
+ return this.getUserMetadataWithHttpInfo(authorization).then(function (response_and_data) {
123
+ return response_and_data.data;
124
+ });
125
+ }
126
+ }]);
127
+ }();
package/dist/index.js ADDED
@@ -0,0 +1,125 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "ApiClient", {
7
+ enumerable: true,
8
+ get: function get() {
9
+ return _ApiClient["default"];
10
+ }
11
+ });
12
+ Object.defineProperty(exports, "AuthenticationApi", {
13
+ enumerable: true,
14
+ get: function get() {
15
+ return _AuthenticationApi["default"];
16
+ }
17
+ });
18
+ Object.defineProperty(exports, "GetCurrentUser200Response", {
19
+ enumerable: true,
20
+ get: function get() {
21
+ return _GetCurrentUser200Response["default"];
22
+ }
23
+ });
24
+ Object.defineProperty(exports, "GetCurrentUser200ResponseData", {
25
+ enumerable: true,
26
+ get: function get() {
27
+ return _GetCurrentUser200ResponseData["default"];
28
+ }
29
+ });
30
+ Object.defineProperty(exports, "HealthApi", {
31
+ enumerable: true,
32
+ get: function get() {
33
+ return _HealthApi["default"];
34
+ }
35
+ });
36
+ Object.defineProperty(exports, "HealthResponse", {
37
+ enumerable: true,
38
+ get: function get() {
39
+ return _HealthResponse["default"];
40
+ }
41
+ });
42
+ Object.defineProperty(exports, "Login200Response", {
43
+ enumerable: true,
44
+ get: function get() {
45
+ return _Login200Response["default"];
46
+ }
47
+ });
48
+ Object.defineProperty(exports, "Login200ResponseData", {
49
+ enumerable: true,
50
+ get: function get() {
51
+ return _Login200ResponseData["default"];
52
+ }
53
+ });
54
+ Object.defineProperty(exports, "Login200ResponseDataUser", {
55
+ enumerable: true,
56
+ get: function get() {
57
+ return _Login200ResponseDataUser["default"];
58
+ }
59
+ });
60
+ Object.defineProperty(exports, "LoginRequest", {
61
+ enumerable: true,
62
+ get: function get() {
63
+ return _LoginRequest["default"];
64
+ }
65
+ });
66
+ Object.defineProperty(exports, "Logout200Response", {
67
+ enumerable: true,
68
+ get: function get() {
69
+ return _Logout200Response["default"];
70
+ }
71
+ });
72
+ Object.defineProperty(exports, "OauthRequest200Response", {
73
+ enumerable: true,
74
+ get: function get() {
75
+ return _OauthRequest200Response["default"];
76
+ }
77
+ });
78
+ Object.defineProperty(exports, "OauthSessionStatus200Response", {
79
+ enumerable: true,
80
+ get: function get() {
81
+ return _OauthSessionStatus200Response["default"];
82
+ }
83
+ });
84
+ Object.defineProperty(exports, "RefreshToken200Response", {
85
+ enumerable: true,
86
+ get: function get() {
87
+ return _RefreshToken200Response["default"];
88
+ }
89
+ });
90
+ Object.defineProperty(exports, "RefreshToken200ResponseData", {
91
+ enumerable: true,
92
+ get: function get() {
93
+ return _RefreshToken200ResponseData["default"];
94
+ }
95
+ });
96
+ Object.defineProperty(exports, "RefreshTokenRequest", {
97
+ enumerable: true,
98
+ get: function get() {
99
+ return _RefreshTokenRequest["default"];
100
+ }
101
+ });
102
+ Object.defineProperty(exports, "UsersApi", {
103
+ enumerable: true,
104
+ get: function get() {
105
+ return _UsersApi["default"];
106
+ }
107
+ });
108
+ var _ApiClient = _interopRequireDefault(require("./ApiClient"));
109
+ var _GetCurrentUser200Response = _interopRequireDefault(require("./model/GetCurrentUser200Response"));
110
+ var _GetCurrentUser200ResponseData = _interopRequireDefault(require("./model/GetCurrentUser200ResponseData"));
111
+ var _HealthResponse = _interopRequireDefault(require("./model/HealthResponse"));
112
+ var _Login200Response = _interopRequireDefault(require("./model/Login200Response"));
113
+ var _Login200ResponseData = _interopRequireDefault(require("./model/Login200ResponseData"));
114
+ var _Login200ResponseDataUser = _interopRequireDefault(require("./model/Login200ResponseDataUser"));
115
+ var _LoginRequest = _interopRequireDefault(require("./model/LoginRequest"));
116
+ var _Logout200Response = _interopRequireDefault(require("./model/Logout200Response"));
117
+ var _OauthRequest200Response = _interopRequireDefault(require("./model/OauthRequest200Response"));
118
+ var _OauthSessionStatus200Response = _interopRequireDefault(require("./model/OauthSessionStatus200Response"));
119
+ var _RefreshToken200Response = _interopRequireDefault(require("./model/RefreshToken200Response"));
120
+ var _RefreshToken200ResponseData = _interopRequireDefault(require("./model/RefreshToken200ResponseData"));
121
+ var _RefreshTokenRequest = _interopRequireDefault(require("./model/RefreshTokenRequest"));
122
+ var _AuthenticationApi = _interopRequireDefault(require("./api/AuthenticationApi"));
123
+ var _HealthApi = _interopRequireDefault(require("./api/HealthApi"));
124
+ var _UsersApi = _interopRequireDefault(require("./api/UsersApi"));
125
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }