@ughuuu/game_server 1.0.376 → 1.0.378
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 +105 -8
- package/dist/ApiClient.js +1 -1
- package/dist/api/AdminChatApi.js +194 -0
- package/dist/api/AdminGroupsApi.js +193 -0
- package/dist/api/AdminKVApi.js +2 -2
- package/dist/api/AdminLeaderboardsApi.js +2 -2
- package/dist/api/AdminLobbiesApi.js +2 -2
- package/dist/api/AdminNotificationsApi.js +179 -0
- package/dist/api/AdminSessionsApi.js +2 -2
- package/dist/api/AdminUsersApi.js +2 -2
- package/dist/api/AuthenticationApi.js +2 -2
- package/dist/api/ChatApi.js +230 -0
- package/dist/api/FriendsApi.js +2 -2
- package/dist/api/GroupsApi.js +1017 -0
- package/dist/api/HealthApi.js +1 -1
- package/dist/api/HooksApi.js +2 -2
- package/dist/api/KVApi.js +2 -2
- package/dist/api/LeaderboardsApi.js +1 -1
- package/dist/api/LobbiesApi.js +6 -6
- package/dist/api/NotificationsApi.js +169 -0
- package/dist/api/PartiesApi.js +354 -0
- package/dist/api/UsersApi.js +2 -2
- package/dist/index.js +374 -17
- package/dist/model/AdminCreateKvEntry200Response.js +1 -1
- package/dist/model/AdminCreateKvEntryRequest.js +1 -1
- package/dist/model/AdminCreateLeaderboardRequest.js +1 -1
- package/dist/model/AdminCreateNotification400Response.js +89 -0
- package/dist/model/AdminCreateNotificationRequest.js +157 -0
- package/dist/model/AdminDeleteChatConversation200Response.js +85 -0
- package/dist/model/AdminEndLeaderboard200Response.js +1 -1
- package/dist/model/AdminEndLeaderboard200ResponseData.js +1 -1
- package/dist/model/AdminListChatMessages200Response.js +124 -0
- package/dist/model/AdminListChatMessages200ResponseDataInner.js +184 -0
- package/dist/model/AdminListGroups200Response.js +124 -0
- package/dist/model/AdminListKvEntries200Response.js +5 -5
- package/dist/model/AdminListKvEntries200ResponseDataInner.js +1 -1
- package/dist/model/AdminListLobbies200Response.js +5 -5
- package/dist/model/AdminListLobbies200ResponseDataInner.js +1 -1
- package/dist/model/AdminListNotifications200Response.js +124 -0
- package/dist/model/AdminListNotifications200ResponseDataInner.js +148 -0
- package/dist/model/AdminListNotifications200ResponseMeta.js +125 -0
- package/dist/model/AdminListSessions200Response.js +5 -5
- package/dist/model/AdminListSessions200ResponseDataInner.js +1 -1
- package/dist/model/AdminSubmitLeaderboardScore200Response.js +1 -1
- package/dist/model/AdminSubmitLeaderboardScore200ResponseData.js +1 -1
- package/dist/model/AdminSubmitLeaderboardScoreRequest.js +1 -1
- package/dist/model/AdminUpdateGroup200Response.js +169 -0
- package/dist/model/AdminUpdateGroupRequest.js +129 -0
- package/dist/model/AdminUpdateKvEntryRequest.js +1 -1
- package/dist/model/AdminUpdateLeaderboardRecordRequest.js +1 -1
- package/dist/model/AdminUpdateLeaderboardRequest.js +1 -1
- package/dist/model/AdminUpdateLobby200Response.js +1 -1
- package/dist/model/AdminUpdateLobbyRequest.js +1 -1
- package/dist/model/AdminUpdateUser200Response.js +1 -1
- package/dist/model/AdminUpdateUser200ResponseData.js +17 -1
- package/dist/model/AdminUpdateUserRequest.js +1 -1
- package/dist/model/CallHook200Response.js +1 -1
- package/dist/model/CallHookRequest.js +1 -1
- package/dist/model/CancelGroupInvite200Response.js +89 -0
- package/dist/model/CancelJoinRequest200Response.js +157 -0
- package/dist/model/ChatUnreadCount200Response.js +85 -0
- package/dist/model/CreateFriendRequestRequest.js +1 -1
- package/dist/model/CreateGroupRequest.js +181 -0
- package/dist/model/CreateLobbyRequest.js +1 -1
- package/dist/model/CreatePartyRequest.js +98 -0
- package/dist/model/DeleteNotifications200Response.js +86 -0
- package/dist/model/DeleteNotificationsRequest.js +113 -0
- package/dist/model/DemoteGroupMemberRequest.js +109 -0
- package/dist/model/DeviceLoginRequest.js +1 -1
- package/dist/model/ErrorResponse.js +1 -1
- package/dist/model/GetCurrentUser200Response.js +30 -1
- package/dist/model/GetCurrentUser200ResponseLinkedProviders.js +1 -1
- package/dist/model/GetKv200Response.js +1 -1
- package/dist/model/GetMyRecord200Response.js +1 -1
- package/dist/model/HealthResponse.js +1 -1
- package/dist/model/InviteToGroupRequest.js +109 -0
- package/dist/model/JoinPartyByCodeRequest.js +113 -0
- package/dist/model/KickGroupMemberRequest.js +109 -0
- package/dist/model/KickUserRequest.js +1 -1
- package/dist/model/LinkDeviceRequest.js +1 -1
- package/dist/model/ListBlockedFriends200Response.js +5 -5
- package/dist/model/ListBlockedFriends200ResponseDataInner.js +1 -1
- package/dist/model/ListBlockedFriends200ResponseDataInnerRequester.js +1 -1
- package/dist/model/ListChatMessages200Response.js +118 -0
- package/dist/model/ListChatMessages200ResponseDataInner.js +170 -0
- package/dist/model/ListFriendRequests200Response.js +1 -1
- package/dist/model/ListFriendRequests200ResponseIncomingInner.js +1 -1
- package/dist/model/ListFriendRequests200ResponseIncomingInnerRequester.js +21 -1
- package/dist/model/ListFriendRequests200ResponseMeta.js +1 -1
- package/dist/model/ListFriends200Response.js +5 -5
- package/dist/model/ListFriends200ResponseDataInner.js +19 -1
- package/dist/model/ListGroupInvitations200Response.js +124 -0
- package/dist/model/ListGroupInvitations200ResponseDataInner.js +122 -0
- package/dist/model/ListGroupMembers200Response.js +124 -0
- package/dist/model/ListGroupMembers200ResponseDataInner.js +180 -0
- package/dist/model/ListJoinRequests200Response.js +124 -0
- package/dist/model/ListLeaderboardRecords200Response.js +5 -5
- package/dist/model/ListLeaderboardRecords200ResponseDataInner.js +1 -1
- package/dist/model/ListLeaderboards200Response.js +5 -5
- package/dist/model/ListLeaderboards200ResponseDataInner.js +1 -1
- package/dist/model/ListLobbies200Response.js +5 -5
- package/dist/model/ListLobbies200ResponseDataInner.js +1 -1
- package/dist/model/ListMyGroups200Response.js +124 -0
- package/dist/model/ListMyGroups200ResponseDataInner.js +200 -0
- package/dist/model/ListNotifications200Response.js +124 -0
- package/dist/model/ListNotifications200ResponseDataInner.js +148 -0
- package/dist/model/ListRecordsAroundUser200Response.js +1 -1
- package/dist/model/ListSentInvitations200Response.js +124 -0
- package/dist/model/ListSentInvitations200ResponseDataInner.js +141 -0
- package/dist/model/Login200Response.js +1 -1
- package/dist/model/Login200ResponseData.js +1 -1
- package/dist/model/LoginRequest.js +1 -1
- package/dist/model/MarkChatReadRequest.js +156 -0
- package/dist/model/NotifyGroup200Response.js +86 -0
- package/dist/model/NotifyGroupRequest.js +137 -0
- package/dist/model/OAuthSessionData.js +1 -1
- package/dist/model/OAuthSessionDataDetails.js +1 -1
- package/dist/model/OAuthSessionStatus.js +1 -1
- package/dist/model/OauthApiCallback200Response.js +1 -1
- package/dist/model/OauthApiCallbackRequest.js +1 -1
- package/dist/model/OauthCallbackApiAppleIosRequest.js +1 -1
- package/dist/model/OauthGoogleIdTokenRequest.js +1 -1
- package/dist/model/OauthRequest200Response.js +1 -1
- package/dist/model/OauthSessionStatus404Response.js +1 -1
- package/dist/model/PartyCreateLobbyRequest.js +139 -0
- package/dist/model/PartyJoinLobbyRequest.js +90 -0
- package/dist/model/PromoteGroupMemberRequest.js +109 -0
- package/dist/model/QuickJoinRequest.js +1 -1
- package/dist/model/RefreshToken200Response.js +1 -1
- package/dist/model/RefreshToken200ResponseData.js +1 -1
- package/dist/model/RefreshTokenRequest.js +1 -1
- package/dist/model/SearchUsers200Response.js +5 -5
- package/dist/model/SearchUsers200ResponseDataInner.js +30 -1
- package/dist/model/SendChatMessageRequest.js +171 -0
- package/dist/model/SendNotificationRequest.js +146 -0
- package/dist/model/ShowParty200Response.js +160 -0
- package/dist/model/ShowParty200ResponseMembersInner.js +137 -0
- package/dist/model/UpdateCurrentUserDisplayNameRequest.js +1 -1
- package/dist/model/UpdateCurrentUserPassword400Response.js +1 -1
- package/dist/model/UpdateCurrentUserPasswordRequest.js +1 -1
- package/dist/model/UpdateGroupRequest.js +152 -0
- package/dist/model/UpdateLobbyRequest.js +1 -1
- package/dist/model/UpdatePartyRequest.js +95 -0
- package/package.json +3 -6
|
@@ -0,0 +1,230 @@
|
|
|
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 _ChatUnreadCount200Response = _interopRequireDefault(require("../model/ChatUnreadCount200Response"));
|
|
9
|
+
var _ListChatMessages200Response = _interopRequireDefault(require("../model/ListChatMessages200Response"));
|
|
10
|
+
var _ListChatMessages200ResponseDataInner = _interopRequireDefault(require("../model/ListChatMessages200ResponseDataInner"));
|
|
11
|
+
var _MarkChatReadRequest = _interopRequireDefault(require("../model/MarkChatReadRequest"));
|
|
12
|
+
var _SendChatMessageRequest = _interopRequireDefault(require("../model/SendChatMessageRequest"));
|
|
13
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
14
|
+
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); }
|
|
15
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
16
|
+
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); } }
|
|
17
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
18
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
19
|
+
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); } /**
|
|
20
|
+
* Game Server API
|
|
21
|
+
* 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 - **Device (SDK)**: POST to `/api/v1/login` with a `device_id` string (creates/returns a device user) - **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 or apple sdk flow - **Steam (OpenID)**: Use `/api/v1/auth/steam` flow 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. ## Users Users endpoints cover the user lifecycle and profile features. Key highlights: - **Registration and login** (email/password, device token for SDKs, and OAuth providers) - **Profile metadata** (JSON blob per user) and editable profile fields - **Account lifecycle**: password reset, email confirmation, and account deletion - **Sessions & tokens**: both browser sessions and JWT-based API tokens are supported ## Friends The Friends domain offers lightweight social features: - **Friend requests** (send / accept / reject / block flows) - **Friend listing & pagination**, with basic privacy controls - **Domain helpers** to manage and query friend relationships from API or UI contexts ## Lobbies Lobbies provide matchmaking / room management primitives. Highlights: - **Create / list / update / delete** lobbies with rich metadata (mode, region, tags) - **Host-managed or hostless** modes (hostless allowed internally, not creatable via public API) - **Membership management**: join, leave, kick users, and automatic host transfer - **Controls & protection**: max users, hidden/locked states, and optional password protection - **Hidden lobbies** are excluded from public listings; public listing endpoints are paginated ## Notifications Persistent user-to-user notifications that survive across sessions: - **Send notifications** to accepted friends with a title, optional content, and optional metadata - **List own notifications** with pagination (ordered oldest-first) - **Delete notifications** by ID (single or batch) - **Real-time delivery** via the user WebSocket channel (`\"notification\"` events) - **Offline delivery**: undeleted notifications are replayed on WebSocket reconnect
|
|
22
|
+
*
|
|
23
|
+
* The version of the OpenAPI document: 1.0.0
|
|
24
|
+
*
|
|
25
|
+
*
|
|
26
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
27
|
+
* https://openapi-generator.tech
|
|
28
|
+
* Do not edit the class manually.
|
|
29
|
+
*
|
|
30
|
+
*/
|
|
31
|
+
/**
|
|
32
|
+
* Chat service.
|
|
33
|
+
* @module api/ChatApi
|
|
34
|
+
* @version 1.0.0
|
|
35
|
+
*/
|
|
36
|
+
var ChatApi = exports["default"] = /*#__PURE__*/function () {
|
|
37
|
+
/**
|
|
38
|
+
* Constructs a new ChatApi.
|
|
39
|
+
* @alias module:api/ChatApi
|
|
40
|
+
* @class
|
|
41
|
+
* @param {module:ApiClient} [apiClient] Optional API client implementation to use,
|
|
42
|
+
* default to {@link module:ApiClient#instance} if unspecified.
|
|
43
|
+
*/
|
|
44
|
+
function ChatApi(apiClient) {
|
|
45
|
+
_classCallCheck(this, ChatApi);
|
|
46
|
+
this.apiClient = apiClient || _ApiClient["default"].instance;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Get unread message count
|
|
51
|
+
* Get the number of unread messages for the current user in a chat conversation.
|
|
52
|
+
* @param {module:model/String} chatType
|
|
53
|
+
* @param {Number} chatRefId
|
|
54
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ChatUnreadCount200Response} and HTTP response
|
|
55
|
+
*/
|
|
56
|
+
return _createClass(ChatApi, [{
|
|
57
|
+
key: "chatUnreadCountWithHttpInfo",
|
|
58
|
+
value: function chatUnreadCountWithHttpInfo(chatType, chatRefId) {
|
|
59
|
+
var postBody = null;
|
|
60
|
+
// verify the required parameter 'chatType' is set
|
|
61
|
+
if (chatType === undefined || chatType === null) {
|
|
62
|
+
throw new Error("Missing the required parameter 'chatType' when calling chatUnreadCount");
|
|
63
|
+
}
|
|
64
|
+
// verify the required parameter 'chatRefId' is set
|
|
65
|
+
if (chatRefId === undefined || chatRefId === null) {
|
|
66
|
+
throw new Error("Missing the required parameter 'chatRefId' when calling chatUnreadCount");
|
|
67
|
+
}
|
|
68
|
+
var pathParams = {};
|
|
69
|
+
var queryParams = {
|
|
70
|
+
'chat_type': chatType,
|
|
71
|
+
'chat_ref_id': chatRefId
|
|
72
|
+
};
|
|
73
|
+
var headerParams = {};
|
|
74
|
+
var formParams = {};
|
|
75
|
+
var authNames = [];
|
|
76
|
+
var contentTypes = [];
|
|
77
|
+
var accepts = ['application/json'];
|
|
78
|
+
var returnType = _ChatUnreadCount200Response["default"];
|
|
79
|
+
return this.apiClient.callApi('/api/v1/chat/unread', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Get unread message count
|
|
84
|
+
* Get the number of unread messages for the current user in a chat conversation.
|
|
85
|
+
* @param {module:model/String} chatType
|
|
86
|
+
* @param {Number} chatRefId
|
|
87
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ChatUnreadCount200Response}
|
|
88
|
+
*/
|
|
89
|
+
}, {
|
|
90
|
+
key: "chatUnreadCount",
|
|
91
|
+
value: function chatUnreadCount(chatType, chatRefId) {
|
|
92
|
+
return this.chatUnreadCountWithHttpInfo(chatType, chatRefId).then(function (response_and_data) {
|
|
93
|
+
return response_and_data.data;
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* List chat messages
|
|
99
|
+
* List messages for a lobby, group, or friend conversation. Paginated, newest first.
|
|
100
|
+
* @param {module:model/String} chatType Type of chat
|
|
101
|
+
* @param {Number} chatRefId Reference ID (lobby_id, group_id, or friend user_id)
|
|
102
|
+
* @param {Object} opts Optional parameters
|
|
103
|
+
* @param {Number} [page = 1)] Page number
|
|
104
|
+
* @param {Number} [pageSize = 25)] Items per page (max 100)
|
|
105
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ListChatMessages200Response} and HTTP response
|
|
106
|
+
*/
|
|
107
|
+
}, {
|
|
108
|
+
key: "listChatMessagesWithHttpInfo",
|
|
109
|
+
value: function listChatMessagesWithHttpInfo(chatType, chatRefId, opts) {
|
|
110
|
+
opts = opts || {};
|
|
111
|
+
var postBody = null;
|
|
112
|
+
// verify the required parameter 'chatType' is set
|
|
113
|
+
if (chatType === undefined || chatType === null) {
|
|
114
|
+
throw new Error("Missing the required parameter 'chatType' when calling listChatMessages");
|
|
115
|
+
}
|
|
116
|
+
// verify the required parameter 'chatRefId' is set
|
|
117
|
+
if (chatRefId === undefined || chatRefId === null) {
|
|
118
|
+
throw new Error("Missing the required parameter 'chatRefId' when calling listChatMessages");
|
|
119
|
+
}
|
|
120
|
+
var pathParams = {};
|
|
121
|
+
var queryParams = {
|
|
122
|
+
'chat_type': chatType,
|
|
123
|
+
'chat_ref_id': chatRefId,
|
|
124
|
+
'page': opts['page'],
|
|
125
|
+
'page_size': opts['pageSize']
|
|
126
|
+
};
|
|
127
|
+
var headerParams = {};
|
|
128
|
+
var formParams = {};
|
|
129
|
+
var authNames = [];
|
|
130
|
+
var contentTypes = [];
|
|
131
|
+
var accepts = ['application/json'];
|
|
132
|
+
var returnType = _ListChatMessages200Response["default"];
|
|
133
|
+
return this.apiClient.callApi('/api/v1/chat/messages', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* List chat messages
|
|
138
|
+
* List messages for a lobby, group, or friend conversation. Paginated, newest first.
|
|
139
|
+
* @param {module:model/String} chatType Type of chat
|
|
140
|
+
* @param {Number} chatRefId Reference ID (lobby_id, group_id, or friend user_id)
|
|
141
|
+
* @param {Object} opts Optional parameters
|
|
142
|
+
* @param {Number} opts.page Page number (default to 1)
|
|
143
|
+
* @param {Number} opts.pageSize Items per page (max 100) (default to 25)
|
|
144
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ListChatMessages200Response}
|
|
145
|
+
*/
|
|
146
|
+
}, {
|
|
147
|
+
key: "listChatMessages",
|
|
148
|
+
value: function listChatMessages(chatType, chatRefId, opts) {
|
|
149
|
+
return this.listChatMessagesWithHttpInfo(chatType, chatRefId, opts).then(function (response_and_data) {
|
|
150
|
+
return response_and_data.data;
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Mark chat as read
|
|
156
|
+
* Update the read cursor for the current user in a chat conversation.
|
|
157
|
+
* @param {Object} opts Optional parameters
|
|
158
|
+
* @param {module:model/MarkChatReadRequest} [markChatReadRequest] Read cursor
|
|
159
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Object} and HTTP response
|
|
160
|
+
*/
|
|
161
|
+
}, {
|
|
162
|
+
key: "markChatReadWithHttpInfo",
|
|
163
|
+
value: function markChatReadWithHttpInfo(opts) {
|
|
164
|
+
opts = opts || {};
|
|
165
|
+
var postBody = opts['markChatReadRequest'];
|
|
166
|
+
var pathParams = {};
|
|
167
|
+
var queryParams = {};
|
|
168
|
+
var headerParams = {};
|
|
169
|
+
var formParams = {};
|
|
170
|
+
var authNames = [];
|
|
171
|
+
var contentTypes = ['application/json'];
|
|
172
|
+
var accepts = ['application/json'];
|
|
173
|
+
var returnType = Object;
|
|
174
|
+
return this.apiClient.callApi('/api/v1/chat/read', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* Mark chat as read
|
|
179
|
+
* Update the read cursor for the current user in a chat conversation.
|
|
180
|
+
* @param {Object} opts Optional parameters
|
|
181
|
+
* @param {module:model/MarkChatReadRequest} opts.markChatReadRequest Read cursor
|
|
182
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Object}
|
|
183
|
+
*/
|
|
184
|
+
}, {
|
|
185
|
+
key: "markChatRead",
|
|
186
|
+
value: function markChatRead(opts) {
|
|
187
|
+
return this.markChatReadWithHttpInfo(opts).then(function (response_and_data) {
|
|
188
|
+
return response_and_data.data;
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* Send a chat message
|
|
194
|
+
* Send a message to a lobby, group, or friend conversation. Requires authentication and membership/friendship.
|
|
195
|
+
* @param {Object} opts Optional parameters
|
|
196
|
+
* @param {module:model/SendChatMessageRequest} [sendChatMessageRequest] Chat message
|
|
197
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ListChatMessages200ResponseDataInner} and HTTP response
|
|
198
|
+
*/
|
|
199
|
+
}, {
|
|
200
|
+
key: "sendChatMessageWithHttpInfo",
|
|
201
|
+
value: function sendChatMessageWithHttpInfo(opts) {
|
|
202
|
+
opts = opts || {};
|
|
203
|
+
var postBody = opts['sendChatMessageRequest'];
|
|
204
|
+
var pathParams = {};
|
|
205
|
+
var queryParams = {};
|
|
206
|
+
var headerParams = {};
|
|
207
|
+
var formParams = {};
|
|
208
|
+
var authNames = [];
|
|
209
|
+
var contentTypes = ['application/json'];
|
|
210
|
+
var accepts = ['application/json'];
|
|
211
|
+
var returnType = _ListChatMessages200ResponseDataInner["default"];
|
|
212
|
+
return this.apiClient.callApi('/api/v1/chat/messages', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* Send a chat message
|
|
217
|
+
* Send a message to a lobby, group, or friend conversation. Requires authentication and membership/friendship.
|
|
218
|
+
* @param {Object} opts Optional parameters
|
|
219
|
+
* @param {module:model/SendChatMessageRequest} opts.sendChatMessageRequest Chat message
|
|
220
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ListChatMessages200ResponseDataInner}
|
|
221
|
+
*/
|
|
222
|
+
}, {
|
|
223
|
+
key: "sendChatMessage",
|
|
224
|
+
value: function sendChatMessage(opts) {
|
|
225
|
+
return this.sendChatMessageWithHttpInfo(opts).then(function (response_and_data) {
|
|
226
|
+
return response_and_data.data;
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
}]);
|
|
230
|
+
}();
|
package/dist/api/FriendsApi.js
CHANGED
|
@@ -5,11 +5,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = void 0;
|
|
7
7
|
var _ApiClient = _interopRequireDefault(require("../ApiClient"));
|
|
8
|
+
var _AdminCreateNotification400Response = _interopRequireDefault(require("../model/AdminCreateNotification400Response"));
|
|
8
9
|
var _CreateFriendRequestRequest = _interopRequireDefault(require("../model/CreateFriendRequestRequest"));
|
|
9
10
|
var _ListBlockedFriends200Response = _interopRequireDefault(require("../model/ListBlockedFriends200Response"));
|
|
10
11
|
var _ListFriendRequests200Response = _interopRequireDefault(require("../model/ListFriendRequests200Response"));
|
|
11
12
|
var _ListFriends200Response = _interopRequireDefault(require("../model/ListFriends200Response"));
|
|
12
|
-
var _RemoveFriendship401Response = _interopRequireDefault(require("../model/RemoveFriendship401Response"));
|
|
13
13
|
var _UpdateCurrentUserPassword400Response = _interopRequireDefault(require("../model/UpdateCurrentUserPassword400Response"));
|
|
14
14
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
15
15
|
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); }
|
|
@@ -19,7 +19,7 @@ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r),
|
|
|
19
19
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
20
20
|
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); } /**
|
|
21
21
|
* Game Server API
|
|
22
|
-
* 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 - **Device (SDK)**: POST to `/api/v1/login` with a `device_id` string (creates/returns a device user) - **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 or apple sdk flow - **Steam (OpenID)**: Use `/api/v1/auth/steam` flow 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. ## Users Users endpoints cover the user lifecycle and profile features. Key highlights: - **Registration and login** (email/password, device token for SDKs, and OAuth providers) - **Profile metadata** (JSON blob per user) and editable profile fields - **Account lifecycle**: password reset, email confirmation, and account deletion - **Sessions & tokens**: both browser sessions and JWT-based API tokens are supported ## Friends The Friends domain offers lightweight social features: - **Friend requests** (send / accept / reject / block flows) - **Friend listing & pagination**, with basic privacy controls - **Domain helpers** to manage and query friend relationships from API or UI contexts ## Lobbies Lobbies provide matchmaking / room management primitives. Highlights: - **Create / list / update / delete** lobbies with rich metadata (mode, region, tags) - **Host-managed or hostless** modes (hostless allowed internally, not creatable via public API) - **Membership management**: join, leave, kick users, and automatic host transfer - **Controls & protection**: max users, hidden/locked states, and optional password protection - **Hidden lobbies** are excluded from public listings; public listing endpoints are paginated
|
|
22
|
+
* 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 - **Device (SDK)**: POST to `/api/v1/login` with a `device_id` string (creates/returns a device user) - **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 or apple sdk flow - **Steam (OpenID)**: Use `/api/v1/auth/steam` flow 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. ## Users Users endpoints cover the user lifecycle and profile features. Key highlights: - **Registration and login** (email/password, device token for SDKs, and OAuth providers) - **Profile metadata** (JSON blob per user) and editable profile fields - **Account lifecycle**: password reset, email confirmation, and account deletion - **Sessions & tokens**: both browser sessions and JWT-based API tokens are supported ## Friends The Friends domain offers lightweight social features: - **Friend requests** (send / accept / reject / block flows) - **Friend listing & pagination**, with basic privacy controls - **Domain helpers** to manage and query friend relationships from API or UI contexts ## Lobbies Lobbies provide matchmaking / room management primitives. Highlights: - **Create / list / update / delete** lobbies with rich metadata (mode, region, tags) - **Host-managed or hostless** modes (hostless allowed internally, not creatable via public API) - **Membership management**: join, leave, kick users, and automatic host transfer - **Controls & protection**: max users, hidden/locked states, and optional password protection - **Hidden lobbies** are excluded from public listings; public listing endpoints are paginated ## Notifications Persistent user-to-user notifications that survive across sessions: - **Send notifications** to accepted friends with a title, optional content, and optional metadata - **List own notifications** with pagination (ordered oldest-first) - **Delete notifications** by ID (single or batch) - **Real-time delivery** via the user WebSocket channel (`\"notification\"` events) - **Offline delivery**: undeleted notifications are replayed on WebSocket reconnect
|
|
23
23
|
*
|
|
24
24
|
* The version of the OpenAPI document: 1.0.0
|
|
25
25
|
*
|