@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,91 @@
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 _GameServerWebAuthControllerApiCallback200ResponseData = _interopRequireDefault(require("./GameServerWebAuthControllerApiCallback200ResponseData"));
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 API
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
+ * The GameServerWebAuthControllerApiCallback200Response model module.
29
+ * @module model/GameServerWebAuthControllerApiCallback200Response
30
+ * @version 1.0.0
31
+ */
32
+ var GameServerWebAuthControllerApiCallback200Response = /*#__PURE__*/function () {
33
+ /**
34
+ * Constructs a new <code>GameServerWebAuthControllerApiCallback200Response</code>.
35
+ * @alias module:model/GameServerWebAuthControllerApiCallback200Response
36
+ */
37
+ function GameServerWebAuthControllerApiCallback200Response() {
38
+ _classCallCheck(this, GameServerWebAuthControllerApiCallback200Response);
39
+ GameServerWebAuthControllerApiCallback200Response.initialize(this);
40
+ }
41
+
42
+ /**
43
+ * Initializes the fields of this object.
44
+ * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
45
+ * Only for internal use.
46
+ */
47
+ return _createClass(GameServerWebAuthControllerApiCallback200Response, null, [{
48
+ key: "initialize",
49
+ value: function initialize(obj) {}
50
+
51
+ /**
52
+ * Constructs a <code>GameServerWebAuthControllerApiCallback200Response</code> from a plain JavaScript object, optionally creating a new instance.
53
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
54
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
55
+ * @param {module:model/GameServerWebAuthControllerApiCallback200Response} obj Optional instance to populate.
56
+ * @return {module:model/GameServerWebAuthControllerApiCallback200Response} The populated <code>GameServerWebAuthControllerApiCallback200Response</code> instance.
57
+ */
58
+ }, {
59
+ key: "constructFromObject",
60
+ value: function constructFromObject(data, obj) {
61
+ if (data) {
62
+ obj = obj || new GameServerWebAuthControllerApiCallback200Response();
63
+ if (data.hasOwnProperty('data')) {
64
+ obj['data'] = _GameServerWebAuthControllerApiCallback200ResponseData["default"].constructFromObject(data['data']);
65
+ }
66
+ }
67
+ return obj;
68
+ }
69
+
70
+ /**
71
+ * Validates the JSON data with respect to <code>GameServerWebAuthControllerApiCallback200Response</code>.
72
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
73
+ * @return {boolean} to indicate whether the JSON data is valid with respect to <code>GameServerWebAuthControllerApiCallback200Response</code>.
74
+ */
75
+ }, {
76
+ key: "validateJSON",
77
+ value: function validateJSON(data) {
78
+ // validate the optional field `data`
79
+ if (data['data']) {
80
+ // data not null
81
+ _GameServerWebAuthControllerApiCallback200ResponseData["default"].validateJSON(data['data']);
82
+ }
83
+ return true;
84
+ }
85
+ }]);
86
+ }();
87
+ /**
88
+ * @member {module:model/GameServerWebAuthControllerApiCallback200ResponseData} data
89
+ */
90
+ GameServerWebAuthControllerApiCallback200Response.prototype['data'] = undefined;
91
+ var _default = exports["default"] = GameServerWebAuthControllerApiCallback200Response;
@@ -0,0 +1,139 @@
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 _GameServerWebAuthControllerApiCallback200ResponseDataUser = _interopRequireDefault(require("./GameServerWebAuthControllerApiCallback200ResponseDataUser"));
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 API
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
+ * The GameServerWebAuthControllerApiCallback200ResponseData model module.
29
+ * @module model/GameServerWebAuthControllerApiCallback200ResponseData
30
+ * @version 1.0.0
31
+ */
32
+ var GameServerWebAuthControllerApiCallback200ResponseData = /*#__PURE__*/function () {
33
+ /**
34
+ * Constructs a new <code>GameServerWebAuthControllerApiCallback200ResponseData</code>.
35
+ * @alias module:model/GameServerWebAuthControllerApiCallback200ResponseData
36
+ */
37
+ function GameServerWebAuthControllerApiCallback200ResponseData() {
38
+ _classCallCheck(this, GameServerWebAuthControllerApiCallback200ResponseData);
39
+ GameServerWebAuthControllerApiCallback200ResponseData.initialize(this);
40
+ }
41
+
42
+ /**
43
+ * Initializes the fields of this object.
44
+ * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
45
+ * Only for internal use.
46
+ */
47
+ return _createClass(GameServerWebAuthControllerApiCallback200ResponseData, null, [{
48
+ key: "initialize",
49
+ value: function initialize(obj) {}
50
+
51
+ /**
52
+ * Constructs a <code>GameServerWebAuthControllerApiCallback200ResponseData</code> from a plain JavaScript object, optionally creating a new instance.
53
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
54
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
55
+ * @param {module:model/GameServerWebAuthControllerApiCallback200ResponseData} obj Optional instance to populate.
56
+ * @return {module:model/GameServerWebAuthControllerApiCallback200ResponseData} The populated <code>GameServerWebAuthControllerApiCallback200ResponseData</code> instance.
57
+ */
58
+ }, {
59
+ key: "constructFromObject",
60
+ value: function constructFromObject(data, obj) {
61
+ if (data) {
62
+ obj = obj || new GameServerWebAuthControllerApiCallback200ResponseData();
63
+ if (data.hasOwnProperty('access_token')) {
64
+ obj['access_token'] = _ApiClient["default"].convertToType(data['access_token'], 'String');
65
+ }
66
+ if (data.hasOwnProperty('expires_in')) {
67
+ obj['expires_in'] = _ApiClient["default"].convertToType(data['expires_in'], 'Number');
68
+ }
69
+ if (data.hasOwnProperty('refresh_token')) {
70
+ obj['refresh_token'] = _ApiClient["default"].convertToType(data['refresh_token'], 'String');
71
+ }
72
+ if (data.hasOwnProperty('token_type')) {
73
+ obj['token_type'] = _ApiClient["default"].convertToType(data['token_type'], 'String');
74
+ }
75
+ if (data.hasOwnProperty('user')) {
76
+ obj['user'] = _GameServerWebAuthControllerApiCallback200ResponseDataUser["default"].constructFromObject(data['user']);
77
+ }
78
+ }
79
+ return obj;
80
+ }
81
+
82
+ /**
83
+ * Validates the JSON data with respect to <code>GameServerWebAuthControllerApiCallback200ResponseData</code>.
84
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
85
+ * @return {boolean} to indicate whether the JSON data is valid with respect to <code>GameServerWebAuthControllerApiCallback200ResponseData</code>.
86
+ */
87
+ }, {
88
+ key: "validateJSON",
89
+ value: function validateJSON(data) {
90
+ // ensure the json data is a string
91
+ if (data['access_token'] && !(typeof data['access_token'] === 'string' || data['access_token'] instanceof String)) {
92
+ throw new Error("Expected the field `access_token` to be a primitive type in the JSON string but got " + data['access_token']);
93
+ }
94
+ // ensure the json data is a string
95
+ if (data['refresh_token'] && !(typeof data['refresh_token'] === 'string' || data['refresh_token'] instanceof String)) {
96
+ throw new Error("Expected the field `refresh_token` to be a primitive type in the JSON string but got " + data['refresh_token']);
97
+ }
98
+ // ensure the json data is a string
99
+ if (data['token_type'] && !(typeof data['token_type'] === 'string' || data['token_type'] instanceof String)) {
100
+ throw new Error("Expected the field `token_type` to be a primitive type in the JSON string but got " + data['token_type']);
101
+ }
102
+ // validate the optional field `user`
103
+ if (data['user']) {
104
+ // data not null
105
+ _GameServerWebAuthControllerApiCallback200ResponseDataUser["default"].validateJSON(data['user']);
106
+ }
107
+ return true;
108
+ }
109
+ }]);
110
+ }();
111
+ /**
112
+ * JWT access token (15 min)
113
+ * @member {String} access_token
114
+ */
115
+ GameServerWebAuthControllerApiCallback200ResponseData.prototype['access_token'] = undefined;
116
+
117
+ /**
118
+ * Seconds until access token expires
119
+ * @member {Number} expires_in
120
+ */
121
+ GameServerWebAuthControllerApiCallback200ResponseData.prototype['expires_in'] = undefined;
122
+
123
+ /**
124
+ * JWT refresh token (30 days)
125
+ * @member {String} refresh_token
126
+ */
127
+ GameServerWebAuthControllerApiCallback200ResponseData.prototype['refresh_token'] = undefined;
128
+
129
+ /**
130
+ * Token type
131
+ * @member {String} token_type
132
+ */
133
+ GameServerWebAuthControllerApiCallback200ResponseData.prototype['token_type'] = undefined;
134
+
135
+ /**
136
+ * @member {module:model/GameServerWebAuthControllerApiCallback200ResponseDataUser} user
137
+ */
138
+ GameServerWebAuthControllerApiCallback200ResponseData.prototype['user'] = undefined;
139
+ var _default = exports["default"] = GameServerWebAuthControllerApiCallback200ResponseData;
@@ -0,0 +1,109 @@
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 GameServerWebAuthControllerApiCallback200ResponseDataUser model module.
28
+ * @module model/GameServerWebAuthControllerApiCallback200ResponseDataUser
29
+ * @version 1.0.0
30
+ */
31
+ var GameServerWebAuthControllerApiCallback200ResponseDataUser = /*#__PURE__*/function () {
32
+ /**
33
+ * Constructs a new <code>GameServerWebAuthControllerApiCallback200ResponseDataUser</code>.
34
+ * @alias module:model/GameServerWebAuthControllerApiCallback200ResponseDataUser
35
+ */
36
+ function GameServerWebAuthControllerApiCallback200ResponseDataUser() {
37
+ _classCallCheck(this, GameServerWebAuthControllerApiCallback200ResponseDataUser);
38
+ GameServerWebAuthControllerApiCallback200ResponseDataUser.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(GameServerWebAuthControllerApiCallback200ResponseDataUser, null, [{
47
+ key: "initialize",
48
+ value: function initialize(obj) {}
49
+
50
+ /**
51
+ * Constructs a <code>GameServerWebAuthControllerApiCallback200ResponseDataUser</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/GameServerWebAuthControllerApiCallback200ResponseDataUser} obj Optional instance to populate.
55
+ * @return {module:model/GameServerWebAuthControllerApiCallback200ResponseDataUser} The populated <code>GameServerWebAuthControllerApiCallback200ResponseDataUser</code> instance.
56
+ */
57
+ }, {
58
+ key: "constructFromObject",
59
+ value: function constructFromObject(data, obj) {
60
+ if (data) {
61
+ obj = obj || new GameServerWebAuthControllerApiCallback200ResponseDataUser();
62
+ if (data.hasOwnProperty('email')) {
63
+ obj['email'] = _ApiClient["default"].convertToType(data['email'], 'String');
64
+ }
65
+ if (data.hasOwnProperty('id')) {
66
+ obj['id'] = _ApiClient["default"].convertToType(data['id'], 'Number');
67
+ }
68
+ if (data.hasOwnProperty('profile_url')) {
69
+ obj['profile_url'] = _ApiClient["default"].convertToType(data['profile_url'], 'String');
70
+ }
71
+ }
72
+ return obj;
73
+ }
74
+
75
+ /**
76
+ * Validates the JSON data with respect to <code>GameServerWebAuthControllerApiCallback200ResponseDataUser</code>.
77
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
78
+ * @return {boolean} to indicate whether the JSON data is valid with respect to <code>GameServerWebAuthControllerApiCallback200ResponseDataUser</code>.
79
+ */
80
+ }, {
81
+ key: "validateJSON",
82
+ value: function validateJSON(data) {
83
+ // ensure the json data is a string
84
+ if (data['email'] && !(typeof data['email'] === 'string' || data['email'] instanceof String)) {
85
+ throw new Error("Expected the field `email` to be a primitive type in the JSON string but got " + data['email']);
86
+ }
87
+ // ensure the json data is a string
88
+ if (data['profile_url'] && !(typeof data['profile_url'] === 'string' || data['profile_url'] instanceof String)) {
89
+ throw new Error("Expected the field `profile_url` to be a primitive type in the JSON string but got " + data['profile_url']);
90
+ }
91
+ return true;
92
+ }
93
+ }]);
94
+ }();
95
+ /**
96
+ * @member {String} email
97
+ */
98
+ GameServerWebAuthControllerApiCallback200ResponseDataUser.prototype['email'] = undefined;
99
+
100
+ /**
101
+ * @member {Number} id
102
+ */
103
+ GameServerWebAuthControllerApiCallback200ResponseDataUser.prototype['id'] = undefined;
104
+
105
+ /**
106
+ * @member {String} profile_url
107
+ */
108
+ GameServerWebAuthControllerApiCallback200ResponseDataUser.prototype['profile_url'] = undefined;
109
+ var _default = exports["default"] = GameServerWebAuthControllerApiCallback200ResponseDataUser;
@@ -0,0 +1,97 @@
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 GameServerWebAuthControllerApiCallback409Response model module.
28
+ * @module model/GameServerWebAuthControllerApiCallback409Response
29
+ * @version 1.0.0
30
+ */
31
+ var GameServerWebAuthControllerApiCallback409Response = /*#__PURE__*/function () {
32
+ /**
33
+ * Constructs a new <code>GameServerWebAuthControllerApiCallback409Response</code>.
34
+ * @alias module:model/GameServerWebAuthControllerApiCallback409Response
35
+ */
36
+ function GameServerWebAuthControllerApiCallback409Response() {
37
+ _classCallCheck(this, GameServerWebAuthControllerApiCallback409Response);
38
+ GameServerWebAuthControllerApiCallback409Response.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(GameServerWebAuthControllerApiCallback409Response, null, [{
47
+ key: "initialize",
48
+ value: function initialize(obj) {}
49
+
50
+ /**
51
+ * Constructs a <code>GameServerWebAuthControllerApiCallback409Response</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/GameServerWebAuthControllerApiCallback409Response} obj Optional instance to populate.
55
+ * @return {module:model/GameServerWebAuthControllerApiCallback409Response} The populated <code>GameServerWebAuthControllerApiCallback409Response</code> instance.
56
+ */
57
+ }, {
58
+ key: "constructFromObject",
59
+ value: function constructFromObject(data, obj) {
60
+ if (data) {
61
+ obj = obj || new GameServerWebAuthControllerApiCallback409Response();
62
+ if (data.hasOwnProperty('conflict_user_id')) {
63
+ obj['conflict_user_id'] = _ApiClient["default"].convertToType(data['conflict_user_id'], 'Number');
64
+ }
65
+ if (data.hasOwnProperty('error')) {
66
+ obj['error'] = _ApiClient["default"].convertToType(data['error'], 'String');
67
+ }
68
+ }
69
+ return obj;
70
+ }
71
+
72
+ /**
73
+ * Validates the JSON data with respect to <code>GameServerWebAuthControllerApiCallback409Response</code>.
74
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
75
+ * @return {boolean} to indicate whether the JSON data is valid with respect to <code>GameServerWebAuthControllerApiCallback409Response</code>.
76
+ */
77
+ }, {
78
+ key: "validateJSON",
79
+ value: function validateJSON(data) {
80
+ // ensure the json data is a string
81
+ if (data['error'] && !(typeof data['error'] === 'string' || data['error'] instanceof String)) {
82
+ throw new Error("Expected the field `error` to be a primitive type in the JSON string but got " + data['error']);
83
+ }
84
+ return true;
85
+ }
86
+ }]);
87
+ }();
88
+ /**
89
+ * @member {Number} conflict_user_id
90
+ */
91
+ GameServerWebAuthControllerApiCallback409Response.prototype['conflict_user_id'] = undefined;
92
+
93
+ /**
94
+ * @member {String} error
95
+ */
96
+ GameServerWebAuthControllerApiCallback409Response.prototype['error'] = undefined;
97
+ var _default = exports["default"] = GameServerWebAuthControllerApiCallback409Response;
@@ -0,0 +1,103 @@
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 GameServerWebAuthControllerApiRequest200Response model module.
28
+ * @module model/GameServerWebAuthControllerApiRequest200Response
29
+ * @version 1.0.0
30
+ */
31
+ var GameServerWebAuthControllerApiRequest200Response = /*#__PURE__*/function () {
32
+ /**
33
+ * Constructs a new <code>GameServerWebAuthControllerApiRequest200Response</code>.
34
+ * @alias module:model/GameServerWebAuthControllerApiRequest200Response
35
+ */
36
+ function GameServerWebAuthControllerApiRequest200Response() {
37
+ _classCallCheck(this, GameServerWebAuthControllerApiRequest200Response);
38
+ GameServerWebAuthControllerApiRequest200Response.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(GameServerWebAuthControllerApiRequest200Response, null, [{
47
+ key: "initialize",
48
+ value: function initialize(obj) {}
49
+
50
+ /**
51
+ * Constructs a <code>GameServerWebAuthControllerApiRequest200Response</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/GameServerWebAuthControllerApiRequest200Response} obj Optional instance to populate.
55
+ * @return {module:model/GameServerWebAuthControllerApiRequest200Response} The populated <code>GameServerWebAuthControllerApiRequest200Response</code> instance.
56
+ */
57
+ }, {
58
+ key: "constructFromObject",
59
+ value: function constructFromObject(data, obj) {
60
+ if (data) {
61
+ obj = obj || new GameServerWebAuthControllerApiRequest200Response();
62
+ if (data.hasOwnProperty('authorization_url')) {
63
+ obj['authorization_url'] = _ApiClient["default"].convertToType(data['authorization_url'], 'String');
64
+ }
65
+ if (data.hasOwnProperty('session_id')) {
66
+ obj['session_id'] = _ApiClient["default"].convertToType(data['session_id'], 'String');
67
+ }
68
+ }
69
+ return obj;
70
+ }
71
+
72
+ /**
73
+ * Validates the JSON data with respect to <code>GameServerWebAuthControllerApiRequest200Response</code>.
74
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
75
+ * @return {boolean} to indicate whether the JSON data is valid with respect to <code>GameServerWebAuthControllerApiRequest200Response</code>.
76
+ */
77
+ }, {
78
+ key: "validateJSON",
79
+ value: function validateJSON(data) {
80
+ // ensure the json data is a string
81
+ if (data['authorization_url'] && !(typeof data['authorization_url'] === 'string' || data['authorization_url'] instanceof String)) {
82
+ throw new Error("Expected the field `authorization_url` to be a primitive type in the JSON string but got " + data['authorization_url']);
83
+ }
84
+ // ensure the json data is a string
85
+ if (data['session_id'] && !(typeof data['session_id'] === 'string' || data['session_id'] instanceof String)) {
86
+ throw new Error("Expected the field `session_id` to be a primitive type in the JSON string but got " + data['session_id']);
87
+ }
88
+ return true;
89
+ }
90
+ }]);
91
+ }();
92
+ /**
93
+ * URL to redirect user to for OAuth
94
+ * @member {String} authorization_url
95
+ */
96
+ GameServerWebAuthControllerApiRequest200Response.prototype['authorization_url'] = undefined;
97
+
98
+ /**
99
+ * Unique session ID to track this OAuth request
100
+ * @member {String} session_id
101
+ */
102
+ GameServerWebAuthControllerApiRequest200Response.prototype['session_id'] = undefined;
103
+ var _default = exports["default"] = GameServerWebAuthControllerApiRequest200Response;