@ughuuu/game_server 1.0.130 → 1.0.131
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 +2 -0
- package/dist/api/UsersApi.js +62 -0
- package/dist/model/GetCurrentUser200Response.js +12 -0
- package/package.json +1 -1
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
|
package/dist/api/UsersApi.js
CHANGED
|
@@ -82,5 +82,67 @@ var UsersApi = exports["default"] = /*#__PURE__*/function () {
|
|
|
82
82
|
return response_and_data.data;
|
|
83
83
|
});
|
|
84
84
|
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Update current user's display name
|
|
88
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
|
|
89
|
+
*/
|
|
90
|
+
}, {
|
|
91
|
+
key: "updateCurrentUserDisplayNameWithHttpInfo",
|
|
92
|
+
value: function updateCurrentUserDisplayNameWithHttpInfo() {
|
|
93
|
+
var postBody = null;
|
|
94
|
+
var pathParams = {};
|
|
95
|
+
var queryParams = {};
|
|
96
|
+
var headerParams = {};
|
|
97
|
+
var formParams = {};
|
|
98
|
+
var authNames = ['authorization'];
|
|
99
|
+
var contentTypes = [];
|
|
100
|
+
var accepts = ['application/json'];
|
|
101
|
+
var returnType = null;
|
|
102
|
+
return this.apiClient.callApi('/api/v1/me/display_name', 'PATCH', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Update current user's display name
|
|
107
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}
|
|
108
|
+
*/
|
|
109
|
+
}, {
|
|
110
|
+
key: "updateCurrentUserDisplayName",
|
|
111
|
+
value: function updateCurrentUserDisplayName() {
|
|
112
|
+
return this.updateCurrentUserDisplayNameWithHttpInfo().then(function (response_and_data) {
|
|
113
|
+
return response_and_data.data;
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Update current user password
|
|
119
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
|
|
120
|
+
*/
|
|
121
|
+
}, {
|
|
122
|
+
key: "updateCurrentUserPasswordWithHttpInfo",
|
|
123
|
+
value: function updateCurrentUserPasswordWithHttpInfo() {
|
|
124
|
+
var postBody = null;
|
|
125
|
+
var pathParams = {};
|
|
126
|
+
var queryParams = {};
|
|
127
|
+
var headerParams = {};
|
|
128
|
+
var formParams = {};
|
|
129
|
+
var authNames = ['authorization'];
|
|
130
|
+
var contentTypes = [];
|
|
131
|
+
var accepts = ['application/json'];
|
|
132
|
+
var returnType = null;
|
|
133
|
+
return this.apiClient.callApi('/api/v1/me/password', 'PATCH', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Update current user password
|
|
138
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}
|
|
139
|
+
*/
|
|
140
|
+
}, {
|
|
141
|
+
key: "updateCurrentUserPassword",
|
|
142
|
+
value: function updateCurrentUserPassword() {
|
|
143
|
+
return this.updateCurrentUserPasswordWithHttpInfo().then(function (response_and_data) {
|
|
144
|
+
return response_and_data.data;
|
|
145
|
+
});
|
|
146
|
+
}
|
|
85
147
|
}]);
|
|
86
148
|
}();
|
|
@@ -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.
|
|
3
|
+
"version": "1.0.131",
|
|
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",
|