@ughuuu/game_server 1.0.128 → 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
CHANGED
|
@@ -158,12 +158,13 @@ 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
|
|
164
166
|
|
|
165
167
|
- [UghuuuGameServer.GetCurrentUser200Response](docs/GetCurrentUser200Response.md)
|
|
166
|
-
- [UghuuuGameServer.GetCurrentUser200ResponseData](docs/GetCurrentUser200ResponseData.md)
|
|
167
168
|
- [UghuuuGameServer.HealthResponse](docs/HealthResponse.md)
|
|
168
169
|
- [UghuuuGameServer.Login200Response](docs/Login200Response.md)
|
|
169
170
|
- [UghuuuGameServer.Login200ResponseData](docs/Login200ResponseData.md)
|
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
|
}();
|
package/dist/index.js
CHANGED
|
@@ -21,12 +21,6 @@ Object.defineProperty(exports, "GetCurrentUser200Response", {
|
|
|
21
21
|
return _GetCurrentUser200Response["default"];
|
|
22
22
|
}
|
|
23
23
|
});
|
|
24
|
-
Object.defineProperty(exports, "GetCurrentUser200ResponseData", {
|
|
25
|
-
enumerable: true,
|
|
26
|
-
get: function get() {
|
|
27
|
-
return _GetCurrentUser200ResponseData["default"];
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
24
|
Object.defineProperty(exports, "HealthApi", {
|
|
31
25
|
enumerable: true,
|
|
32
26
|
get: function get() {
|
|
@@ -107,7 +101,6 @@ Object.defineProperty(exports, "UsersApi", {
|
|
|
107
101
|
});
|
|
108
102
|
var _ApiClient = _interopRequireDefault(require("./ApiClient"));
|
|
109
103
|
var _GetCurrentUser200Response = _interopRequireDefault(require("./model/GetCurrentUser200Response"));
|
|
110
|
-
var _GetCurrentUser200ResponseData = _interopRequireDefault(require("./model/GetCurrentUser200ResponseData"));
|
|
111
104
|
var _HealthResponse = _interopRequireDefault(require("./model/HealthResponse"));
|
|
112
105
|
var _Login200Response = _interopRequireDefault(require("./model/Login200Response"));
|
|
113
106
|
var _Login200ResponseData = _interopRequireDefault(require("./model/Login200ResponseData"));
|
|
@@ -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 _GetCurrentUser200ResponseData = _interopRequireDefault(require("./GetCurrentUser200ResponseData"));
|
|
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,20 @@ var GetCurrentUser200Response = /*#__PURE__*/function () {
|
|
|
60
59
|
value: function constructFromObject(data, obj) {
|
|
61
60
|
if (data) {
|
|
62
61
|
obj = obj || new GetCurrentUser200Response();
|
|
63
|
-
if (data.hasOwnProperty('
|
|
64
|
-
obj['
|
|
62
|
+
if (data.hasOwnProperty('display_name')) {
|
|
63
|
+
obj['display_name'] = _ApiClient["default"].convertToType(data['display_name'], 'String');
|
|
64
|
+
}
|
|
65
|
+
if (data.hasOwnProperty('email')) {
|
|
66
|
+
obj['email'] = _ApiClient["default"].convertToType(data['email'], 'String');
|
|
67
|
+
}
|
|
68
|
+
if (data.hasOwnProperty('id')) {
|
|
69
|
+
obj['id'] = _ApiClient["default"].convertToType(data['id'], 'Number');
|
|
70
|
+
}
|
|
71
|
+
if (data.hasOwnProperty('metadata')) {
|
|
72
|
+
obj['metadata'] = _ApiClient["default"].convertToType(data['metadata'], Object);
|
|
73
|
+
}
|
|
74
|
+
if (data.hasOwnProperty('profile_url')) {
|
|
75
|
+
obj['profile_url'] = _ApiClient["default"].convertToType(data['profile_url'], 'String');
|
|
65
76
|
}
|
|
66
77
|
}
|
|
67
78
|
return obj;
|
|
@@ -75,17 +86,44 @@ var GetCurrentUser200Response = /*#__PURE__*/function () {
|
|
|
75
86
|
}, {
|
|
76
87
|
key: "validateJSON",
|
|
77
88
|
value: function validateJSON(data) {
|
|
78
|
-
//
|
|
79
|
-
if (data['data']) {
|
|
80
|
-
|
|
81
|
-
|
|
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
|
+
}
|
|
93
|
+
// ensure the json data is a string
|
|
94
|
+
if (data['email'] && !(typeof data['email'] === 'string' || data['email'] instanceof String)) {
|
|
95
|
+
throw new Error("Expected the field `email` to be a primitive type in the JSON string but got " + data['email']);
|
|
96
|
+
}
|
|
97
|
+
// ensure the json data is a string
|
|
98
|
+
if (data['profile_url'] && !(typeof data['profile_url'] === 'string' || data['profile_url'] instanceof String)) {
|
|
99
|
+
throw new Error("Expected the field `profile_url` to be a primitive type in the JSON string but got " + data['profile_url']);
|
|
82
100
|
}
|
|
83
101
|
return true;
|
|
84
102
|
}
|
|
85
103
|
}]);
|
|
86
104
|
}();
|
|
87
105
|
/**
|
|
88
|
-
* @member {
|
|
106
|
+
* @member {String} display_name
|
|
107
|
+
*/
|
|
108
|
+
GetCurrentUser200Response.prototype['display_name'] = undefined;
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* @member {String} email
|
|
112
|
+
*/
|
|
113
|
+
GetCurrentUser200Response.prototype['email'] = undefined;
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* @member {Number} id
|
|
117
|
+
*/
|
|
118
|
+
GetCurrentUser200Response.prototype['id'] = undefined;
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* @member {Object} metadata
|
|
122
|
+
*/
|
|
123
|
+
GetCurrentUser200Response.prototype['metadata'] = undefined;
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* @member {String} profile_url
|
|
89
127
|
*/
|
|
90
|
-
GetCurrentUser200Response.prototype['
|
|
128
|
+
GetCurrentUser200Response.prototype['profile_url'] = undefined;
|
|
91
129
|
var _default = exports["default"] = GetCurrentUser200Response;
|
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",
|
|
@@ -1,125 +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 GetCurrentUser200ResponseData model module.
|
|
28
|
-
* @module model/GetCurrentUser200ResponseData
|
|
29
|
-
* @version 1.0.0
|
|
30
|
-
*/
|
|
31
|
-
var GetCurrentUser200ResponseData = /*#__PURE__*/function () {
|
|
32
|
-
/**
|
|
33
|
-
* Constructs a new <code>GetCurrentUser200ResponseData</code>.
|
|
34
|
-
* @alias module:model/GetCurrentUser200ResponseData
|
|
35
|
-
*/
|
|
36
|
-
function GetCurrentUser200ResponseData() {
|
|
37
|
-
_classCallCheck(this, GetCurrentUser200ResponseData);
|
|
38
|
-
GetCurrentUser200ResponseData.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(GetCurrentUser200ResponseData, null, [{
|
|
47
|
-
key: "initialize",
|
|
48
|
-
value: function initialize(obj) {}
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* Constructs a <code>GetCurrentUser200ResponseData</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/GetCurrentUser200ResponseData} obj Optional instance to populate.
|
|
55
|
-
* @return {module:model/GetCurrentUser200ResponseData} The populated <code>GetCurrentUser200ResponseData</code> instance.
|
|
56
|
-
*/
|
|
57
|
-
}, {
|
|
58
|
-
key: "constructFromObject",
|
|
59
|
-
value: function constructFromObject(data, obj) {
|
|
60
|
-
if (data) {
|
|
61
|
-
obj = obj || new GetCurrentUser200ResponseData();
|
|
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('is_admin')) {
|
|
69
|
-
obj['is_admin'] = _ApiClient["default"].convertToType(data['is_admin'], 'Boolean');
|
|
70
|
-
}
|
|
71
|
-
if (data.hasOwnProperty('metadata')) {
|
|
72
|
-
obj['metadata'] = _ApiClient["default"].convertToType(data['metadata'], Object);
|
|
73
|
-
}
|
|
74
|
-
if (data.hasOwnProperty('profile_url')) {
|
|
75
|
-
obj['profile_url'] = _ApiClient["default"].convertToType(data['profile_url'], 'String');
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
return obj;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
* Validates the JSON data with respect to <code>GetCurrentUser200ResponseData</code>.
|
|
83
|
-
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
84
|
-
* @return {boolean} to indicate whether the JSON data is valid with respect to <code>GetCurrentUser200ResponseData</code>.
|
|
85
|
-
*/
|
|
86
|
-
}, {
|
|
87
|
-
key: "validateJSON",
|
|
88
|
-
value: function validateJSON(data) {
|
|
89
|
-
// ensure the json data is a string
|
|
90
|
-
if (data['email'] && !(typeof data['email'] === 'string' || data['email'] instanceof String)) {
|
|
91
|
-
throw new Error("Expected the field `email` to be a primitive type in the JSON string but got " + data['email']);
|
|
92
|
-
}
|
|
93
|
-
// ensure the json data is a string
|
|
94
|
-
if (data['profile_url'] && !(typeof data['profile_url'] === 'string' || data['profile_url'] instanceof String)) {
|
|
95
|
-
throw new Error("Expected the field `profile_url` to be a primitive type in the JSON string but got " + data['profile_url']);
|
|
96
|
-
}
|
|
97
|
-
return true;
|
|
98
|
-
}
|
|
99
|
-
}]);
|
|
100
|
-
}();
|
|
101
|
-
/**
|
|
102
|
-
* @member {String} email
|
|
103
|
-
*/
|
|
104
|
-
GetCurrentUser200ResponseData.prototype['email'] = undefined;
|
|
105
|
-
|
|
106
|
-
/**
|
|
107
|
-
* @member {Number} id
|
|
108
|
-
*/
|
|
109
|
-
GetCurrentUser200ResponseData.prototype['id'] = undefined;
|
|
110
|
-
|
|
111
|
-
/**
|
|
112
|
-
* @member {Boolean} is_admin
|
|
113
|
-
*/
|
|
114
|
-
GetCurrentUser200ResponseData.prototype['is_admin'] = undefined;
|
|
115
|
-
|
|
116
|
-
/**
|
|
117
|
-
* @member {Object} metadata
|
|
118
|
-
*/
|
|
119
|
-
GetCurrentUser200ResponseData.prototype['metadata'] = undefined;
|
|
120
|
-
|
|
121
|
-
/**
|
|
122
|
-
* @member {String} profile_url
|
|
123
|
-
*/
|
|
124
|
-
GetCurrentUser200ResponseData.prototype['profile_url'] = undefined;
|
|
125
|
-
var _default = exports["default"] = GetCurrentUser200ResponseData;
|