@ughuuu/game_server 1.0.116 → 1.0.128

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 CHANGED
@@ -158,7 +158,6 @@ Class | Method | HTTP request | Description
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
160
  *UghuuuGameServer.UsersApi* | [**getCurrentUser**](docs/UsersApi.md#getCurrentUser) | **GET** /api/v1/me | Return current user info
161
- *UghuuuGameServer.UsersApi* | [**getUserMetadata**](docs/UsersApi.md#getUserMetadata) | **GET** /api/v1/me/metadata | Return current user's metadata
162
161
 
163
162
 
164
163
  ## Documentation for Models
@@ -170,11 +169,11 @@ Class | Method | HTTP request | Description
170
169
  - [UghuuuGameServer.Login200ResponseData](docs/Login200ResponseData.md)
171
170
  - [UghuuuGameServer.Login200ResponseDataUser](docs/Login200ResponseDataUser.md)
172
171
  - [UghuuuGameServer.LoginRequest](docs/LoginRequest.md)
173
- - [UghuuuGameServer.Logout200Response](docs/Logout200Response.md)
172
+ - [UghuuuGameServer.OAuthSessionData](docs/OAuthSessionData.md)
173
+ - [UghuuuGameServer.OAuthSessionDataDetails](docs/OAuthSessionDataDetails.md)
174
+ - [UghuuuGameServer.OAuthSessionStatus](docs/OAuthSessionStatus.md)
174
175
  - [UghuuuGameServer.OauthRequest200Response](docs/OauthRequest200Response.md)
175
- - [UghuuuGameServer.OauthSessionStatus200Response](docs/OauthSessionStatus200Response.md)
176
176
  - [UghuuuGameServer.RefreshToken200Response](docs/RefreshToken200Response.md)
177
- - [UghuuuGameServer.RefreshToken200ResponseData](docs/RefreshToken200ResponseData.md)
178
177
  - [UghuuuGameServer.RefreshTokenRequest](docs/RefreshTokenRequest.md)
179
178
 
180
179
 
@@ -7,9 +7,8 @@ exports["default"] = void 0;
7
7
  var _ApiClient = _interopRequireDefault(require("../ApiClient"));
8
8
  var _Login200Response = _interopRequireDefault(require("../model/Login200Response"));
9
9
  var _LoginRequest = _interopRequireDefault(require("../model/LoginRequest"));
10
- var _Logout200Response = _interopRequireDefault(require("../model/Logout200Response"));
10
+ var _OAuthSessionStatus = _interopRequireDefault(require("../model/OAuthSessionStatus"));
11
11
  var _OauthRequest200Response = _interopRequireDefault(require("../model/OauthRequest200Response"));
12
- var _OauthSessionStatus200Response = _interopRequireDefault(require("../model/OauthSessionStatus200Response"));
13
12
  var _RefreshToken200Response = _interopRequireDefault(require("../model/RefreshToken200Response"));
14
13
  var _RefreshTokenRequest = _interopRequireDefault(require("../model/RefreshTokenRequest"));
15
14
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
@@ -89,40 +88,32 @@ var AuthenticationApi = exports["default"] = /*#__PURE__*/function () {
89
88
  /**
90
89
  * Logout
91
90
  * 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
91
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
94
92
  */
95
93
  }, {
96
94
  key: "logoutWithHttpInfo",
97
- value: function logoutWithHttpInfo(authorization) {
95
+ value: function logoutWithHttpInfo() {
98
96
  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
97
  var pathParams = {};
104
98
  var queryParams = {};
105
- var headerParams = {
106
- 'Authorization': authorization
107
- };
99
+ var headerParams = {};
108
100
  var formParams = {};
109
101
  var authNames = ['authorization'];
110
102
  var contentTypes = [];
111
103
  var accepts = ['application/json'];
112
- var returnType = _Logout200Response["default"];
104
+ var returnType = null;
113
105
  return this.apiClient.callApi('/api/v1/logout', 'DELETE', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
114
106
  }
115
107
 
116
108
  /**
117
109
  * Logout
118
110
  * 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}
111
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}
121
112
  */
122
113
  }, {
123
114
  key: "logout",
124
- value: function logout(authorization) {
125
- return this.logoutWithHttpInfo(authorization).then(function (response_and_data) {
115
+ value: function logout() {
116
+ return this.logoutWithHttpInfo().then(function (response_and_data) {
126
117
  return response_and_data.data;
127
118
  });
128
119
  }
@@ -154,7 +145,7 @@ var AuthenticationApi = exports["default"] = /*#__PURE__*/function () {
154
145
  };
155
146
  var headerParams = {};
156
147
  var formParams = {};
157
- var authNames = [];
148
+ var authNames = ['authorization'];
158
149
  var contentTypes = [];
159
150
  var accepts = ['application/json'];
160
151
  var returnType = Object;
@@ -221,7 +212,7 @@ var AuthenticationApi = exports["default"] = /*#__PURE__*/function () {
221
212
  * Get OAuth session status
222
213
  * Check the status of an OAuth session for API clients
223
214
  * @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
215
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/OAuthSessionStatus} and HTTP response
225
216
  */
226
217
  }, {
227
218
  key: "oauthSessionStatusWithHttpInfo",
@@ -240,7 +231,7 @@ var AuthenticationApi = exports["default"] = /*#__PURE__*/function () {
240
231
  var authNames = [];
241
232
  var contentTypes = [];
242
233
  var accepts = ['application/json'];
243
- var returnType = _OauthSessionStatus200Response["default"];
234
+ var returnType = _OAuthSessionStatus["default"];
244
235
  return this.apiClient.callApi('/api/v1/auth/session/{session_id}', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
245
236
  }
246
237
 
@@ -248,7 +239,7 @@ var AuthenticationApi = exports["default"] = /*#__PURE__*/function () {
248
239
  * Get OAuth session status
249
240
  * Check the status of an OAuth session for API clients
250
241
  * @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}
242
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/OAuthSessionStatus}
252
243
  */
253
244
  }, {
254
245
  key: "oauthSessionStatus",
@@ -274,7 +265,7 @@ var AuthenticationApi = exports["default"] = /*#__PURE__*/function () {
274
265
  var queryParams = {};
275
266
  var headerParams = {};
276
267
  var formParams = {};
277
- var authNames = [];
268
+ var authNames = ['authorization'];
278
269
  var contentTypes = ['application/json'];
279
270
  var accepts = ['application/json'];
280
271
  var returnType = _RefreshToken200Response["default"];
@@ -316,7 +307,7 @@ var AuthenticationApi = exports["default"] = /*#__PURE__*/function () {
316
307
  var queryParams = {};
317
308
  var headerParams = {};
318
309
  var formParams = {};
319
- var authNames = [];
310
+ var authNames = ['authorization'];
320
311
  var contentTypes = [];
321
312
  var accepts = ['application/json'];
322
313
  var returnType = Object;
@@ -82,46 +82,5 @@ var UsersApi = exports["default"] = /*#__PURE__*/function () {
82
82
  return response_and_data.data;
83
83
  });
84
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
85
  }]);
127
86
  }();
package/dist/index.js CHANGED
@@ -63,34 +63,34 @@ Object.defineProperty(exports, "LoginRequest", {
63
63
  return _LoginRequest["default"];
64
64
  }
65
65
  });
66
- Object.defineProperty(exports, "Logout200Response", {
66
+ Object.defineProperty(exports, "OAuthSessionData", {
67
67
  enumerable: true,
68
68
  get: function get() {
69
- return _Logout200Response["default"];
69
+ return _OAuthSessionData["default"];
70
70
  }
71
71
  });
72
- Object.defineProperty(exports, "OauthRequest200Response", {
72
+ Object.defineProperty(exports, "OAuthSessionDataDetails", {
73
73
  enumerable: true,
74
74
  get: function get() {
75
- return _OauthRequest200Response["default"];
75
+ return _OAuthSessionDataDetails["default"];
76
76
  }
77
77
  });
78
- Object.defineProperty(exports, "OauthSessionStatus200Response", {
78
+ Object.defineProperty(exports, "OAuthSessionStatus", {
79
79
  enumerable: true,
80
80
  get: function get() {
81
- return _OauthSessionStatus200Response["default"];
81
+ return _OAuthSessionStatus["default"];
82
82
  }
83
83
  });
84
- Object.defineProperty(exports, "RefreshToken200Response", {
84
+ Object.defineProperty(exports, "OauthRequest200Response", {
85
85
  enumerable: true,
86
86
  get: function get() {
87
- return _RefreshToken200Response["default"];
87
+ return _OauthRequest200Response["default"];
88
88
  }
89
89
  });
90
- Object.defineProperty(exports, "RefreshToken200ResponseData", {
90
+ Object.defineProperty(exports, "RefreshToken200Response", {
91
91
  enumerable: true,
92
92
  get: function get() {
93
- return _RefreshToken200ResponseData["default"];
93
+ return _RefreshToken200Response["default"];
94
94
  }
95
95
  });
96
96
  Object.defineProperty(exports, "RefreshTokenRequest", {
@@ -113,11 +113,11 @@ var _Login200Response = _interopRequireDefault(require("./model/Login200Response
113
113
  var _Login200ResponseData = _interopRequireDefault(require("./model/Login200ResponseData"));
114
114
  var _Login200ResponseDataUser = _interopRequireDefault(require("./model/Login200ResponseDataUser"));
115
115
  var _LoginRequest = _interopRequireDefault(require("./model/LoginRequest"));
116
- var _Logout200Response = _interopRequireDefault(require("./model/Logout200Response"));
116
+ var _OAuthSessionData = _interopRequireDefault(require("./model/OAuthSessionData"));
117
+ var _OAuthSessionDataDetails = _interopRequireDefault(require("./model/OAuthSessionDataDetails"));
118
+ var _OAuthSessionStatus = _interopRequireDefault(require("./model/OAuthSessionStatus"));
117
119
  var _OauthRequest200Response = _interopRequireDefault(require("./model/OauthRequest200Response"));
118
- var _OauthSessionStatus200Response = _interopRequireDefault(require("./model/OauthSessionStatus200Response"));
119
120
  var _RefreshToken200Response = _interopRequireDefault(require("./model/RefreshToken200Response"));
120
- var _RefreshToken200ResponseData = _interopRequireDefault(require("./model/RefreshToken200ResponseData"));
121
121
  var _RefreshTokenRequest = _interopRequireDefault(require("./model/RefreshTokenRequest"));
122
122
  var _AuthenticationApi = _interopRequireDefault(require("./api/AuthenticationApi"));
123
123
  var _HealthApi = _interopRequireDefault(require("./api/HealthApi"));
@@ -69,9 +69,6 @@ var Login200ResponseData = /*#__PURE__*/function () {
69
69
  if (data.hasOwnProperty('refresh_token')) {
70
70
  obj['refresh_token'] = _ApiClient["default"].convertToType(data['refresh_token'], 'String');
71
71
  }
72
- if (data.hasOwnProperty('token_type')) {
73
- obj['token_type'] = _ApiClient["default"].convertToType(data['token_type'], 'String');
74
- }
75
72
  if (data.hasOwnProperty('user')) {
76
73
  obj['user'] = _Login200ResponseDataUser["default"].constructFromObject(data['user']);
77
74
  }
@@ -95,10 +92,6 @@ var Login200ResponseData = /*#__PURE__*/function () {
95
92
  if (data['refresh_token'] && !(typeof data['refresh_token'] === 'string' || data['refresh_token'] instanceof String)) {
96
93
  throw new Error("Expected the field `refresh_token` to be a primitive type in the JSON string but got " + data['refresh_token']);
97
94
  }
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
95
  // validate the optional field `user`
103
96
  if (data['user']) {
104
97
  // data not null
@@ -126,12 +119,6 @@ Login200ResponseData.prototype['expires_in'] = undefined;
126
119
  */
127
120
  Login200ResponseData.prototype['refresh_token'] = undefined;
128
121
 
129
- /**
130
- * Token type
131
- * @member {String} token_type
132
- */
133
- Login200ResponseData.prototype['token_type'] = undefined;
134
-
135
122
  /**
136
123
  * @member {module:model/Login200ResponseDataUser} user
137
124
  */
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports["default"] = void 0;
7
7
  var _ApiClient = _interopRequireDefault(require("../ApiClient"));
8
- var _Login200ResponseDataUser = _interopRequireDefault(require("./Login200ResponseDataUser"));
8
+ var _OAuthSessionDataDetails = _interopRequireDefault(require("./OAuthSessionDataDetails"));
9
9
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
10
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
11
  function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
@@ -25,18 +25,19 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
25
25
  *
26
26
  */
27
27
  /**
28
- * The RefreshToken200ResponseData model module.
29
- * @module model/RefreshToken200ResponseData
28
+ * The OAuthSessionData model module.
29
+ * @module model/OAuthSessionData
30
30
  * @version 1.0.0
31
31
  */
32
- var RefreshToken200ResponseData = /*#__PURE__*/function () {
32
+ var OAuthSessionData = /*#__PURE__*/function () {
33
33
  /**
34
- * Constructs a new <code>RefreshToken200ResponseData</code>.
35
- * @alias module:model/RefreshToken200ResponseData
34
+ * Constructs a new <code>OAuthSessionData</code>.
35
+ * Payload stored on completed or errored OAuth sessions
36
+ * @alias module:model/OAuthSessionData
36
37
  */
37
- function RefreshToken200ResponseData() {
38
- _classCallCheck(this, RefreshToken200ResponseData);
39
- RefreshToken200ResponseData.initialize(this);
38
+ function OAuthSessionData() {
39
+ _classCallCheck(this, OAuthSessionData);
40
+ OAuthSessionData.initialize(this);
40
41
  }
41
42
 
42
43
  /**
@@ -44,42 +45,42 @@ var RefreshToken200ResponseData = /*#__PURE__*/function () {
44
45
  * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
45
46
  * Only for internal use.
46
47
  */
47
- return _createClass(RefreshToken200ResponseData, null, [{
48
+ return _createClass(OAuthSessionData, null, [{
48
49
  key: "initialize",
49
50
  value: function initialize(obj) {}
50
51
 
51
52
  /**
52
- * Constructs a <code>RefreshToken200ResponseData</code> from a plain JavaScript object, optionally creating a new instance.
53
+ * Constructs a <code>OAuthSessionData</code> from a plain JavaScript object, optionally creating a new instance.
53
54
  * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
54
55
  * @param {Object} data The plain JavaScript object bearing properties of interest.
55
- * @param {module:model/RefreshToken200ResponseData} obj Optional instance to populate.
56
- * @return {module:model/RefreshToken200ResponseData} The populated <code>RefreshToken200ResponseData</code> instance.
56
+ * @param {module:model/OAuthSessionData} obj Optional instance to populate.
57
+ * @return {module:model/OAuthSessionData} The populated <code>OAuthSessionData</code> instance.
57
58
  */
58
59
  }, {
59
60
  key: "constructFromObject",
60
61
  value: function constructFromObject(data, obj) {
61
62
  if (data) {
62
- obj = obj || new RefreshToken200ResponseData();
63
+ obj = obj || new OAuthSessionData();
63
64
  if (data.hasOwnProperty('access_token')) {
64
65
  obj['access_token'] = _ApiClient["default"].convertToType(data['access_token'], 'String');
65
66
  }
67
+ if (data.hasOwnProperty('details')) {
68
+ obj['details'] = _OAuthSessionDataDetails["default"].constructFromObject(data['details']);
69
+ }
66
70
  if (data.hasOwnProperty('expires_in')) {
67
71
  obj['expires_in'] = _ApiClient["default"].convertToType(data['expires_in'], 'Number');
68
72
  }
69
- if (data.hasOwnProperty('token_type')) {
70
- obj['token_type'] = _ApiClient["default"].convertToType(data['token_type'], 'String');
71
- }
72
- if (data.hasOwnProperty('user')) {
73
- obj['user'] = _Login200ResponseDataUser["default"].constructFromObject(data['user']);
73
+ if (data.hasOwnProperty('refresh_token')) {
74
+ obj['refresh_token'] = _ApiClient["default"].convertToType(data['refresh_token'], 'String');
74
75
  }
75
76
  }
76
77
  return obj;
77
78
  }
78
79
 
79
80
  /**
80
- * Validates the JSON data with respect to <code>RefreshToken200ResponseData</code>.
81
+ * Validates the JSON data with respect to <code>OAuthSessionData</code>.
81
82
  * @param {Object} data The plain JavaScript object bearing properties of interest.
82
- * @return {boolean} to indicate whether the JSON data is valid with respect to <code>RefreshToken200ResponseData</code>.
83
+ * @return {boolean} to indicate whether the JSON data is valid with respect to <code>OAuthSessionData</code>.
83
84
  */
84
85
  }, {
85
86
  key: "validateJSON",
@@ -88,39 +89,39 @@ var RefreshToken200ResponseData = /*#__PURE__*/function () {
88
89
  if (data['access_token'] && !(typeof data['access_token'] === 'string' || data['access_token'] instanceof String)) {
89
90
  throw new Error("Expected the field `access_token` to be a primitive type in the JSON string but got " + data['access_token']);
90
91
  }
91
- // ensure the json data is a string
92
- if (data['token_type'] && !(typeof data['token_type'] === 'string' || data['token_type'] instanceof String)) {
93
- throw new Error("Expected the field `token_type` to be a primitive type in the JSON string but got " + data['token_type']);
94
- }
95
- // validate the optional field `user`
96
- if (data['user']) {
92
+ // validate the optional field `details`
93
+ if (data['details']) {
97
94
  // data not null
98
- _Login200ResponseDataUser["default"].validateJSON(data['user']);
95
+ _OAuthSessionDataDetails["default"].validateJSON(data['details']);
96
+ }
97
+ // ensure the json data is a string
98
+ if (data['refresh_token'] && !(typeof data['refresh_token'] === 'string' || data['refresh_token'] instanceof String)) {
99
+ throw new Error("Expected the field `refresh_token` to be a primitive type in the JSON string but got " + data['refresh_token']);
99
100
  }
100
101
  return true;
101
102
  }
102
103
  }]);
103
104
  }();
104
105
  /**
105
- * New access token
106
+ * Short-lived access token
106
107
  * @member {String} access_token
107
108
  */
108
- RefreshToken200ResponseData.prototype['access_token'] = undefined;
109
+ OAuthSessionData.prototype['access_token'] = undefined;
109
110
 
110
111
  /**
111
- * Seconds until expiry
112
- * @member {Number} expires_in
112
+ * @member {module:model/OAuthSessionDataDetails} details
113
113
  */
114
- RefreshToken200ResponseData.prototype['expires_in'] = undefined;
114
+ OAuthSessionData.prototype['details'] = undefined;
115
115
 
116
116
  /**
117
- * Token type
118
- * @member {String} token_type
117
+ * Seconds until access_token expires
118
+ * @member {Number} expires_in
119
119
  */
120
- RefreshToken200ResponseData.prototype['token_type'] = undefined;
120
+ OAuthSessionData.prototype['expires_in'] = undefined;
121
121
 
122
122
  /**
123
- * @member {module:model/Login200ResponseDataUser} user
123
+ * Long-lived refresh token
124
+ * @member {String} refresh_token
124
125
  */
125
- RefreshToken200ResponseData.prototype['user'] = undefined;
126
- var _default = exports["default"] = RefreshToken200ResponseData;
126
+ OAuthSessionData.prototype['refresh_token'] = undefined;
127
+ var _default = exports["default"] = OAuthSessionData;
@@ -0,0 +1,128 @@
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 _OAuthSessionDataDetails;
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 _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
15
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
16
+ 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); } /**
17
+ * Game Server API
18
+ * 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`
19
+ *
20
+ * The version of the OpenAPI document: 1.0.0
21
+ *
22
+ *
23
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
24
+ * https://openapi-generator.tech
25
+ * Do not edit the class manually.
26
+ *
27
+ */
28
+ /**
29
+ * The OAuthSessionDataDetails model module.
30
+ * @module model/OAuthSessionDataDetails
31
+ * @version 1.0.0
32
+ */
33
+ var OAuthSessionDataDetails = /*#__PURE__*/function () {
34
+ /**
35
+ * Constructs a new <code>OAuthSessionDataDetails</code>.
36
+ * Error details (string or object). When present the session failed
37
+ * @alias module:model/OAuthSessionDataDetails
38
+ * @param {(module:model/Object|module:model/String)} instance The actual instance to initialize OAuthSessionDataDetails.
39
+ */
40
+ function OAuthSessionDataDetails() {
41
+ var instance = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
42
+ _classCallCheck(this, OAuthSessionDataDetails);
43
+ /**
44
+ * Returns the JSON representation of the actual instance.
45
+ * @return {string}
46
+ */
47
+ _defineProperty(this, "toJSON", function () {
48
+ return this.getActualInstance();
49
+ });
50
+ if (instance === null) {
51
+ this.actualInstance = null;
52
+ return;
53
+ }
54
+ var match = 0;
55
+ var errorMessages = [];
56
+ try {
57
+ // validate string
58
+ if (!(typeof instance === 'string')) {
59
+ throw new Error("Invalid value. Must be string. Input: " + JSON.stringify(instance));
60
+ }
61
+ this.actualInstance = instance;
62
+ match++;
63
+ } catch (err) {
64
+ // json data failed to deserialize into String
65
+ errorMessages.push("Failed to construct String: " + err);
66
+ }
67
+ try {
68
+ this.actualInstance = instance;
69
+ match++;
70
+ } catch (err) {
71
+ // json data failed to deserialize into Object
72
+ errorMessages.push("Failed to construct Object: " + err);
73
+ }
74
+ if (match > 1) {
75
+ throw new Error("Multiple matches found constructing `OAuthSessionDataDetails` with oneOf schemas Object, String. Input: " + JSON.stringify(instance));
76
+ } else if (match === 0) {
77
+ this.actualInstance = null; // clear the actual instance in case there are multiple matches
78
+ throw new Error("No match found constructing `OAuthSessionDataDetails` with oneOf schemas Object, String. Details: " + errorMessages.join(", "));
79
+ } else {// only 1 match
80
+ // the input is valid
81
+ }
82
+ }
83
+
84
+ /**
85
+ * Constructs a <code>OAuthSessionDataDetails</code> from a plain JavaScript object, optionally creating a new instance.
86
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
87
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
88
+ * @param {module:model/OAuthSessionDataDetails} obj Optional instance to populate.
89
+ * @return {module:model/OAuthSessionDataDetails} The populated <code>OAuthSessionDataDetails</code> instance.
90
+ */
91
+ return _createClass(OAuthSessionDataDetails, [{
92
+ key: "getActualInstance",
93
+ value:
94
+ /**
95
+ * Gets the actual instance, which can be <code>Object</code>, <code>String</code>.
96
+ * @return {(module:model/Object|module:model/String)} The actual instance.
97
+ */
98
+ function getActualInstance() {
99
+ return this.actualInstance;
100
+ }
101
+
102
+ /**
103
+ * Sets the actual instance, which can be <code>Object</code>, <code>String</code>.
104
+ * @param {(module:model/Object|module:model/String)} obj The actual instance.
105
+ */
106
+ }, {
107
+ key: "setActualInstance",
108
+ value: function setActualInstance(obj) {
109
+ this.actualInstance = OAuthSessionDataDetails.constructFromObject(obj).getActualInstance();
110
+ }
111
+ }], [{
112
+ key: "constructFromObject",
113
+ value: function constructFromObject(data, obj) {
114
+ return new OAuthSessionDataDetails(data);
115
+ }
116
+ }]);
117
+ }();
118
+ _OAuthSessionDataDetails = OAuthSessionDataDetails;
119
+ /**
120
+ * Create an instance of OAuthSessionDataDetails from a JSON string.
121
+ * @param {string} json_string JSON string.
122
+ * @return {module:model/OAuthSessionDataDetails} An instance of OAuthSessionDataDetails.
123
+ */
124
+ _defineProperty(OAuthSessionDataDetails, "fromJSON", function (json_string) {
125
+ return _OAuthSessionDataDetails.constructFromObject(JSON.parse(json_string));
126
+ });
127
+ OAuthSessionDataDetails.OneOf = ["Object", "String"];
128
+ var _default = exports["default"] = OAuthSessionDataDetails;
@@ -5,8 +5,12 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports["default"] = void 0;
7
7
  var _ApiClient = _interopRequireDefault(require("../ApiClient"));
8
+ var _OAuthSessionData = _interopRequireDefault(require("./OAuthSessionData"));
8
9
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
9
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 _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
12
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
13
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
10
14
  function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
11
15
  function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
12
16
  function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
@@ -24,18 +28,20 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
24
28
  *
25
29
  */
26
30
  /**
27
- * The OauthSessionStatus200Response model module.
28
- * @module model/OauthSessionStatus200Response
31
+ * The OAuthSessionStatus model module.
32
+ * @module model/OAuthSessionStatus
29
33
  * @version 1.0.0
30
34
  */
31
- var OauthSessionStatus200Response = /*#__PURE__*/function () {
35
+ var OAuthSessionStatus = /*#__PURE__*/function () {
32
36
  /**
33
- * Constructs a new <code>OauthSessionStatus200Response</code>.
34
- * @alias module:model/OauthSessionStatus200Response
37
+ * Constructs a new <code>OAuthSessionStatus</code>.
38
+ * Status payload returned when querying an OAuth session
39
+ * @alias module:model/OAuthSessionStatus
40
+ * @param status {module:model/OAuthSessionStatus.StatusEnum} Current session status
35
41
  */
36
- function OauthSessionStatus200Response() {
37
- _classCallCheck(this, OauthSessionStatus200Response);
38
- OauthSessionStatus200Response.initialize(this);
42
+ function OAuthSessionStatus(status) {
43
+ _classCallCheck(this, OAuthSessionStatus);
44
+ OAuthSessionStatus.initialize(this, status);
39
45
  }
40
46
 
41
47
  /**
@@ -43,24 +49,26 @@ var OauthSessionStatus200Response = /*#__PURE__*/function () {
43
49
  * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
44
50
  * Only for internal use.
45
51
  */
46
- return _createClass(OauthSessionStatus200Response, null, [{
52
+ return _createClass(OAuthSessionStatus, null, [{
47
53
  key: "initialize",
48
- value: function initialize(obj) {}
54
+ value: function initialize(obj, status) {
55
+ obj['status'] = status;
56
+ }
49
57
 
50
58
  /**
51
- * Constructs a <code>OauthSessionStatus200Response</code> from a plain JavaScript object, optionally creating a new instance.
59
+ * Constructs a <code>OAuthSessionStatus</code> from a plain JavaScript object, optionally creating a new instance.
52
60
  * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
53
61
  * @param {Object} data The plain JavaScript object bearing properties of interest.
54
- * @param {module:model/OauthSessionStatus200Response} obj Optional instance to populate.
55
- * @return {module:model/OauthSessionStatus200Response} The populated <code>OauthSessionStatus200Response</code> instance.
62
+ * @param {module:model/OAuthSessionStatus} obj Optional instance to populate.
63
+ * @return {module:model/OAuthSessionStatus} The populated <code>OAuthSessionStatus</code> instance.
56
64
  */
57
65
  }, {
58
66
  key: "constructFromObject",
59
67
  value: function constructFromObject(data, obj) {
60
68
  if (data) {
61
- obj = obj || new OauthSessionStatus200Response();
69
+ obj = obj || new OAuthSessionStatus();
62
70
  if (data.hasOwnProperty('data')) {
63
- obj['data'] = _ApiClient["default"].convertToType(data['data'], Object);
71
+ obj['data'] = _OAuthSessionData["default"].constructFromObject(data['data']);
64
72
  }
65
73
  if (data.hasOwnProperty('message')) {
66
74
  obj['message'] = _ApiClient["default"].convertToType(data['message'], 'String');
@@ -73,13 +81,33 @@ var OauthSessionStatus200Response = /*#__PURE__*/function () {
73
81
  }
74
82
 
75
83
  /**
76
- * Validates the JSON data with respect to <code>OauthSessionStatus200Response</code>.
84
+ * Validates the JSON data with respect to <code>OAuthSessionStatus</code>.
77
85
  * @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>OauthSessionStatus200Response</code>.
86
+ * @return {boolean} to indicate whether the JSON data is valid with respect to <code>OAuthSessionStatus</code>.
79
87
  */
80
88
  }, {
81
89
  key: "validateJSON",
82
90
  value: function validateJSON(data) {
91
+ // check to make sure all required properties are present in the JSON string
92
+ var _iterator = _createForOfIteratorHelper(OAuthSessionStatus.RequiredProperties),
93
+ _step;
94
+ try {
95
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
96
+ var property = _step.value;
97
+ if (!data.hasOwnProperty(property)) {
98
+ throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
99
+ }
100
+ }
101
+ // validate the optional field `data`
102
+ } catch (err) {
103
+ _iterator.e(err);
104
+ } finally {
105
+ _iterator.f();
106
+ }
107
+ if (data['data']) {
108
+ // data not null
109
+ _OAuthSessionData["default"].validateJSON(data['data']);
110
+ }
83
111
  // ensure the json data is a string
84
112
  if (data['message'] && !(typeof data['message'] === 'string' || data['message'] instanceof String)) {
85
113
  throw new Error("Expected the field `message` to be a primitive type in the JSON string but got " + data['message']);
@@ -92,30 +120,31 @@ var OauthSessionStatus200Response = /*#__PURE__*/function () {
92
120
  }
93
121
  }]);
94
122
  }();
123
+ OAuthSessionStatus.RequiredProperties = ["status"];
124
+
95
125
  /**
96
- * Session data when completed
97
- * @member {Object} data
126
+ * @member {module:model/OAuthSessionData} data
98
127
  */
99
- OauthSessionStatus200Response.prototype['data'] = undefined;
128
+ OAuthSessionStatus.prototype['data'] = undefined;
100
129
 
101
130
  /**
102
- * Optional status message
131
+ * Optional human-readable message describing the current status
103
132
  * @member {String} message
104
133
  */
105
- OauthSessionStatus200Response.prototype['message'] = undefined;
134
+ OAuthSessionStatus.prototype['message'] = undefined;
106
135
 
107
136
  /**
108
137
  * Current session status
109
- * @member {module:model/OauthSessionStatus200Response.StatusEnum} status
138
+ * @member {module:model/OAuthSessionStatus.StatusEnum} status
110
139
  */
111
- OauthSessionStatus200Response.prototype['status'] = undefined;
140
+ OAuthSessionStatus.prototype['status'] = undefined;
112
141
 
113
142
  /**
114
143
  * Allowed values for the <code>status</code> property.
115
144
  * @enum {String}
116
145
  * @readonly
117
146
  */
118
- OauthSessionStatus200Response['StatusEnum'] = {
147
+ OAuthSessionStatus['StatusEnum'] = {
119
148
  /**
120
149
  * value: "pending"
121
150
  * @const
@@ -137,4 +166,4 @@ OauthSessionStatus200Response['StatusEnum'] = {
137
166
  */
138
167
  "conflict": "conflict"
139
168
  };
140
- var _default = exports["default"] = OauthSessionStatus200Response;
169
+ var _default = exports["default"] = OAuthSessionStatus;
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports["default"] = void 0;
7
7
  var _ApiClient = _interopRequireDefault(require("../ApiClient"));
8
- var _RefreshToken200ResponseData = _interopRequireDefault(require("./RefreshToken200ResponseData"));
9
8
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
10
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); }
11
10
  function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
@@ -60,8 +59,11 @@ var RefreshToken200Response = /*#__PURE__*/function () {
60
59
  value: function constructFromObject(data, obj) {
61
60
  if (data) {
62
61
  obj = obj || new RefreshToken200Response();
63
- if (data.hasOwnProperty('data')) {
64
- obj['data'] = _RefreshToken200ResponseData["default"].constructFromObject(data['data']);
62
+ if (data.hasOwnProperty('access_token')) {
63
+ obj['access_token'] = _ApiClient["default"].convertToType(data['access_token'], 'String');
64
+ }
65
+ if (data.hasOwnProperty('expires_in')) {
66
+ obj['expires_in'] = _ApiClient["default"].convertToType(data['expires_in'], 'Number');
65
67
  }
66
68
  }
67
69
  return obj;
@@ -75,17 +77,23 @@ var RefreshToken200Response = /*#__PURE__*/function () {
75
77
  }, {
76
78
  key: "validateJSON",
77
79
  value: function validateJSON(data) {
78
- // validate the optional field `data`
79
- if (data['data']) {
80
- // data not null
81
- _RefreshToken200ResponseData["default"].validateJSON(data['data']);
80
+ // ensure the json data is a string
81
+ if (data['access_token'] && !(typeof data['access_token'] === 'string' || data['access_token'] instanceof String)) {
82
+ throw new Error("Expected the field `access_token` to be a primitive type in the JSON string but got " + data['access_token']);
82
83
  }
83
84
  return true;
84
85
  }
85
86
  }]);
86
87
  }();
87
88
  /**
88
- * @member {module:model/RefreshToken200ResponseData} data
89
+ * New access token
90
+ * @member {String} access_token
91
+ */
92
+ RefreshToken200Response.prototype['access_token'] = undefined;
93
+
94
+ /**
95
+ * Seconds until expiry
96
+ * @member {Number} expires_in
89
97
  */
90
- RefreshToken200Response.prototype['data'] = undefined;
98
+ RefreshToken200Response.prototype['expires_in'] = undefined;
91
99
  var _default = exports["default"] = RefreshToken200Response;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ughuuu/game_server",
3
- "version": "1.0.116",
3
+ "version": "1.0.128",
4
4
  "description": "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` ",
5
5
  "license": "Unlicense",
6
6
  "main": "dist/index.js",
@@ -1,89 +0,0 @@
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 Logout200Response model module.
28
- * @module model/Logout200Response
29
- * @version 1.0.0
30
- */
31
- var Logout200Response = /*#__PURE__*/function () {
32
- /**
33
- * Constructs a new <code>Logout200Response</code>.
34
- * @alias module:model/Logout200Response
35
- */
36
- function Logout200Response() {
37
- _classCallCheck(this, Logout200Response);
38
- Logout200Response.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(Logout200Response, null, [{
47
- key: "initialize",
48
- value: function initialize(obj) {}
49
-
50
- /**
51
- * Constructs a <code>Logout200Response</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/Logout200Response} obj Optional instance to populate.
55
- * @return {module:model/Logout200Response} The populated <code>Logout200Response</code> instance.
56
- */
57
- }, {
58
- key: "constructFromObject",
59
- value: function constructFromObject(data, obj) {
60
- if (data) {
61
- obj = obj || new Logout200Response();
62
- if (data.hasOwnProperty('message')) {
63
- obj['message'] = _ApiClient["default"].convertToType(data['message'], 'String');
64
- }
65
- }
66
- return obj;
67
- }
68
-
69
- /**
70
- * Validates the JSON data with respect to <code>Logout200Response</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>Logout200Response</code>.
73
- */
74
- }, {
75
- key: "validateJSON",
76
- value: function validateJSON(data) {
77
- // ensure the json data is a string
78
- if (data['message'] && !(typeof data['message'] === 'string' || data['message'] instanceof String)) {
79
- throw new Error("Expected the field `message` to be a primitive type in the JSON string but got " + data['message']);
80
- }
81
- return true;
82
- }
83
- }]);
84
- }();
85
- /**
86
- * @member {String} message
87
- */
88
- Logout200Response.prototype['message'] = undefined;
89
- var _default = exports["default"] = Logout200Response;