@ughuuu/game_server 1.0.142 → 1.0.149

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.
@@ -0,0 +1,153 @@
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 ListLobbies200ResponseInner model module.
28
+ * @module model/ListLobbies200ResponseInner
29
+ * @version 1.0.0
30
+ */
31
+ var ListLobbies200ResponseInner = /*#__PURE__*/function () {
32
+ /**
33
+ * Constructs a new <code>ListLobbies200ResponseInner</code>.
34
+ * @alias module:model/ListLobbies200ResponseInner
35
+ */
36
+ function ListLobbies200ResponseInner() {
37
+ _classCallCheck(this, ListLobbies200ResponseInner);
38
+ ListLobbies200ResponseInner.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(ListLobbies200ResponseInner, null, [{
47
+ key: "initialize",
48
+ value: function initialize(obj) {}
49
+
50
+ /**
51
+ * Constructs a <code>ListLobbies200ResponseInner</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/ListLobbies200ResponseInner} obj Optional instance to populate.
55
+ * @return {module:model/ListLobbies200ResponseInner} The populated <code>ListLobbies200ResponseInner</code> instance.
56
+ */
57
+ }, {
58
+ key: "constructFromObject",
59
+ value: function constructFromObject(data, obj) {
60
+ if (data) {
61
+ obj = obj || new ListLobbies200ResponseInner();
62
+ if (data.hasOwnProperty('host_id')) {
63
+ obj['host_id'] = _ApiClient["default"].convertToType(data['host_id'], 'Number');
64
+ }
65
+ if (data.hasOwnProperty('hostless')) {
66
+ obj['hostless'] = _ApiClient["default"].convertToType(data['hostless'], 'Boolean');
67
+ }
68
+ if (data.hasOwnProperty('id')) {
69
+ obj['id'] = _ApiClient["default"].convertToType(data['id'], 'Number');
70
+ }
71
+ if (data.hasOwnProperty('is_hidden')) {
72
+ obj['is_hidden'] = _ApiClient["default"].convertToType(data['is_hidden'], 'Boolean');
73
+ }
74
+ if (data.hasOwnProperty('is_locked')) {
75
+ obj['is_locked'] = _ApiClient["default"].convertToType(data['is_locked'], 'Boolean');
76
+ }
77
+ if (data.hasOwnProperty('max_users')) {
78
+ obj['max_users'] = _ApiClient["default"].convertToType(data['max_users'], 'Number');
79
+ }
80
+ if (data.hasOwnProperty('metadata')) {
81
+ obj['metadata'] = _ApiClient["default"].convertToType(data['metadata'], Object);
82
+ }
83
+ if (data.hasOwnProperty('title')) {
84
+ obj['title'] = _ApiClient["default"].convertToType(data['title'], 'String');
85
+ }
86
+ }
87
+ return obj;
88
+ }
89
+
90
+ /**
91
+ * Validates the JSON data with respect to <code>ListLobbies200ResponseInner</code>.
92
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
93
+ * @return {boolean} to indicate whether the JSON data is valid with respect to <code>ListLobbies200ResponseInner</code>.
94
+ */
95
+ }, {
96
+ key: "validateJSON",
97
+ value: function validateJSON(data) {
98
+ // ensure the json data is a string
99
+ if (data['title'] && !(typeof data['title'] === 'string' || data['title'] instanceof String)) {
100
+ throw new Error("Expected the field `title` to be a primitive type in the JSON string but got " + data['title']);
101
+ }
102
+ return true;
103
+ }
104
+ }]);
105
+ }();
106
+ /**
107
+ * User ID of the host
108
+ * @member {Number} host_id
109
+ */
110
+ ListLobbies200ResponseInner.prototype['host_id'] = undefined;
111
+
112
+ /**
113
+ * Whether this is a server-managed lobby
114
+ * @member {Boolean} hostless
115
+ */
116
+ ListLobbies200ResponseInner.prototype['hostless'] = undefined;
117
+
118
+ /**
119
+ * Lobby ID
120
+ * @member {Number} id
121
+ */
122
+ ListLobbies200ResponseInner.prototype['id'] = undefined;
123
+
124
+ /**
125
+ * Hidden from public listings
126
+ * @member {Boolean} is_hidden
127
+ */
128
+ ListLobbies200ResponseInner.prototype['is_hidden'] = undefined;
129
+
130
+ /**
131
+ * Locked - no new joins allowed
132
+ * @member {Boolean} is_locked
133
+ */
134
+ ListLobbies200ResponseInner.prototype['is_locked'] = undefined;
135
+
136
+ /**
137
+ * Maximum number of users allowed
138
+ * @member {Number} max_users
139
+ */
140
+ ListLobbies200ResponseInner.prototype['max_users'] = undefined;
141
+
142
+ /**
143
+ * Arbitrary metadata
144
+ * @member {Object} metadata
145
+ */
146
+ ListLobbies200ResponseInner.prototype['metadata'] = undefined;
147
+
148
+ /**
149
+ * Display title
150
+ * @member {String} title
151
+ */
152
+ ListLobbies200ResponseInner.prototype['title'] = undefined;
153
+ var _default = exports["default"] = ListLobbies200ResponseInner;
@@ -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
+ 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 UpdateLobbyRequest model module.
28
+ * @module model/UpdateLobbyRequest
29
+ * @version 1.0.0
30
+ */
31
+ var UpdateLobbyRequest = /*#__PURE__*/function () {
32
+ /**
33
+ * Constructs a new <code>UpdateLobbyRequest</code>.
34
+ * @alias module:model/UpdateLobbyRequest
35
+ */
36
+ function UpdateLobbyRequest() {
37
+ _classCallCheck(this, UpdateLobbyRequest);
38
+ UpdateLobbyRequest.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(UpdateLobbyRequest, null, [{
47
+ key: "initialize",
48
+ value: function initialize(obj) {}
49
+
50
+ /**
51
+ * Constructs a <code>UpdateLobbyRequest</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/UpdateLobbyRequest} obj Optional instance to populate.
55
+ * @return {module:model/UpdateLobbyRequest} The populated <code>UpdateLobbyRequest</code> instance.
56
+ */
57
+ }, {
58
+ key: "constructFromObject",
59
+ value: function constructFromObject(data, obj) {
60
+ if (data) {
61
+ obj = obj || new UpdateLobbyRequest();
62
+ if (data.hasOwnProperty('is_hidden')) {
63
+ obj['is_hidden'] = _ApiClient["default"].convertToType(data['is_hidden'], 'Boolean');
64
+ }
65
+ if (data.hasOwnProperty('is_locked')) {
66
+ obj['is_locked'] = _ApiClient["default"].convertToType(data['is_locked'], 'Boolean');
67
+ }
68
+ if (data.hasOwnProperty('max_users')) {
69
+ obj['max_users'] = _ApiClient["default"].convertToType(data['max_users'], 'Number');
70
+ }
71
+ if (data.hasOwnProperty('metadata')) {
72
+ obj['metadata'] = _ApiClient["default"].convertToType(data['metadata'], Object);
73
+ }
74
+ if (data.hasOwnProperty('password')) {
75
+ obj['password'] = _ApiClient["default"].convertToType(data['password'], 'String');
76
+ }
77
+ if (data.hasOwnProperty('title')) {
78
+ obj['title'] = _ApiClient["default"].convertToType(data['title'], 'String');
79
+ }
80
+ }
81
+ return obj;
82
+ }
83
+
84
+ /**
85
+ * Validates the JSON data with respect to <code>UpdateLobbyRequest</code>.
86
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
87
+ * @return {boolean} to indicate whether the JSON data is valid with respect to <code>UpdateLobbyRequest</code>.
88
+ */
89
+ }, {
90
+ key: "validateJSON",
91
+ value: function validateJSON(data) {
92
+ // ensure the json data is a string
93
+ if (data['password'] && !(typeof data['password'] === 'string' || data['password'] instanceof String)) {
94
+ throw new Error("Expected the field `password` to be a primitive type in the JSON string but got " + data['password']);
95
+ }
96
+ // ensure the json data is a string
97
+ if (data['title'] && !(typeof data['title'] === 'string' || data['title'] instanceof String)) {
98
+ throw new Error("Expected the field `title` to be a primitive type in the JSON string but got " + data['title']);
99
+ }
100
+ return true;
101
+ }
102
+ }]);
103
+ }();
104
+ /**
105
+ * Hide from public listings
106
+ * @member {Boolean} is_hidden
107
+ */
108
+ UpdateLobbyRequest.prototype['is_hidden'] = undefined;
109
+
110
+ /**
111
+ * Lock the lobby
112
+ * @member {Boolean} is_locked
113
+ */
114
+ UpdateLobbyRequest.prototype['is_locked'] = undefined;
115
+
116
+ /**
117
+ * New maximum users
118
+ * @member {Number} max_users
119
+ */
120
+ UpdateLobbyRequest.prototype['max_users'] = undefined;
121
+
122
+ /**
123
+ * New metadata
124
+ * @member {Object} metadata
125
+ */
126
+ UpdateLobbyRequest.prototype['metadata'] = undefined;
127
+
128
+ /**
129
+ * New password (empty string to clear)
130
+ * @member {String} password
131
+ */
132
+ UpdateLobbyRequest.prototype['password'] = undefined;
133
+
134
+ /**
135
+ * New display title
136
+ * @member {String} title
137
+ */
138
+ UpdateLobbyRequest.prototype['title'] = undefined;
139
+ var _default = exports["default"] = UpdateLobbyRequest;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ughuuu/game_server",
3
- "version": "1.0.142",
3
+ "version": "1.0.149",
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",