@ughuuu/game_server 1.0.130 → 1.0.134

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,6 +158,8 @@ 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* | [**updateCurrentUserDisplayName**](docs/UsersApi.md#updateCurrentUserDisplayName) | **PATCH** /api/v1/me/display_name | Update current user's display name
162
+ *UghuuuGameServer.UsersApi* | [**updateCurrentUserPassword**](docs/UsersApi.md#updateCurrentUserPassword) | **PATCH** /api/v1/me/password | Update current user password
161
163
 
162
164
 
163
165
  ## Documentation for Models
@@ -45,22 +45,15 @@ var UsersApi = exports["default"] = /*#__PURE__*/function () {
45
45
  /**
46
46
  * Return current user info
47
47
  * Returns the current authenticated user's basic information.
48
- * @param {String} authorization Bearer token
49
48
  * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/GetCurrentUser200Response} and HTTP response
50
49
  */
51
50
  return _createClass(UsersApi, [{
52
51
  key: "getCurrentUserWithHttpInfo",
53
- value: function getCurrentUserWithHttpInfo(authorization) {
52
+ value: function getCurrentUserWithHttpInfo() {
54
53
  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
54
  var pathParams = {};
60
55
  var queryParams = {};
61
- var headerParams = {
62
- 'Authorization': authorization
63
- };
56
+ var headerParams = {};
64
57
  var formParams = {};
65
58
  var authNames = ['authorization'];
66
59
  var contentTypes = [];
@@ -72,13 +65,74 @@ var UsersApi = exports["default"] = /*#__PURE__*/function () {
72
65
  /**
73
66
  * Return current user info
74
67
  * Returns the current authenticated user's basic information.
75
- * @param {String} authorization Bearer token
76
68
  * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/GetCurrentUser200Response}
77
69
  */
78
70
  }, {
79
71
  key: "getCurrentUser",
80
- value: function getCurrentUser(authorization) {
81
- return this.getCurrentUserWithHttpInfo(authorization).then(function (response_and_data) {
72
+ value: function getCurrentUser() {
73
+ return this.getCurrentUserWithHttpInfo().then(function (response_and_data) {
74
+ return response_and_data.data;
75
+ });
76
+ }
77
+
78
+ /**
79
+ * Update current user's display name
80
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
81
+ */
82
+ }, {
83
+ key: "updateCurrentUserDisplayNameWithHttpInfo",
84
+ value: function updateCurrentUserDisplayNameWithHttpInfo() {
85
+ var postBody = null;
86
+ var pathParams = {};
87
+ var queryParams = {};
88
+ var headerParams = {};
89
+ var formParams = {};
90
+ var authNames = ['authorization'];
91
+ var contentTypes = [];
92
+ var accepts = ['application/json'];
93
+ var returnType = null;
94
+ return this.apiClient.callApi('/api/v1/me/display_name', 'PATCH', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
95
+ }
96
+
97
+ /**
98
+ * Update current user's display name
99
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}
100
+ */
101
+ }, {
102
+ key: "updateCurrentUserDisplayName",
103
+ value: function updateCurrentUserDisplayName() {
104
+ return this.updateCurrentUserDisplayNameWithHttpInfo().then(function (response_and_data) {
105
+ return response_and_data.data;
106
+ });
107
+ }
108
+
109
+ /**
110
+ * Update current user password
111
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
112
+ */
113
+ }, {
114
+ key: "updateCurrentUserPasswordWithHttpInfo",
115
+ value: function updateCurrentUserPasswordWithHttpInfo() {
116
+ var postBody = null;
117
+ var pathParams = {};
118
+ var queryParams = {};
119
+ var headerParams = {};
120
+ var formParams = {};
121
+ var authNames = ['authorization'];
122
+ var contentTypes = [];
123
+ var accepts = ['application/json'];
124
+ var returnType = null;
125
+ return this.apiClient.callApi('/api/v1/me/password', 'PATCH', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
126
+ }
127
+
128
+ /**
129
+ * Update current user password
130
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}
131
+ */
132
+ }, {
133
+ key: "updateCurrentUserPassword",
134
+ value: function updateCurrentUserPassword() {
135
+ return this.updateCurrentUserPasswordWithHttpInfo().then(function (response_and_data) {
82
136
  return response_and_data.data;
83
137
  });
84
138
  }
@@ -59,6 +59,9 @@ var GetCurrentUser200Response = /*#__PURE__*/function () {
59
59
  value: function constructFromObject(data, obj) {
60
60
  if (data) {
61
61
  obj = obj || new GetCurrentUser200Response();
62
+ if (data.hasOwnProperty('display_name')) {
63
+ obj['display_name'] = _ApiClient["default"].convertToType(data['display_name'], 'String');
64
+ }
62
65
  if (data.hasOwnProperty('email')) {
63
66
  obj['email'] = _ApiClient["default"].convertToType(data['email'], 'String');
64
67
  }
@@ -83,6 +86,10 @@ var GetCurrentUser200Response = /*#__PURE__*/function () {
83
86
  }, {
84
87
  key: "validateJSON",
85
88
  value: function validateJSON(data) {
89
+ // ensure the json data is a string
90
+ if (data['display_name'] && !(typeof data['display_name'] === 'string' || data['display_name'] instanceof String)) {
91
+ throw new Error("Expected the field `display_name` to be a primitive type in the JSON string but got " + data['display_name']);
92
+ }
86
93
  // ensure the json data is a string
87
94
  if (data['email'] && !(typeof data['email'] === 'string' || data['email'] instanceof String)) {
88
95
  throw new Error("Expected the field `email` to be a primitive type in the JSON string but got " + data['email']);
@@ -95,6 +102,11 @@ var GetCurrentUser200Response = /*#__PURE__*/function () {
95
102
  }
96
103
  }]);
97
104
  }();
105
+ /**
106
+ * @member {String} display_name
107
+ */
108
+ GetCurrentUser200Response.prototype['display_name'] = undefined;
109
+
98
110
  /**
99
111
  * @member {String} email
100
112
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ughuuu/game_server",
3
- "version": "1.0.130",
3
+ "version": "1.0.134",
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",