@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.
Files changed (144) hide show
  1. package/README.md +105 -8
  2. package/dist/ApiClient.js +1 -1
  3. package/dist/api/AdminChatApi.js +194 -0
  4. package/dist/api/AdminGroupsApi.js +193 -0
  5. package/dist/api/AdminKVApi.js +2 -2
  6. package/dist/api/AdminLeaderboardsApi.js +2 -2
  7. package/dist/api/AdminLobbiesApi.js +2 -2
  8. package/dist/api/AdminNotificationsApi.js +179 -0
  9. package/dist/api/AdminSessionsApi.js +2 -2
  10. package/dist/api/AdminUsersApi.js +2 -2
  11. package/dist/api/AuthenticationApi.js +2 -2
  12. package/dist/api/ChatApi.js +230 -0
  13. package/dist/api/FriendsApi.js +2 -2
  14. package/dist/api/GroupsApi.js +1017 -0
  15. package/dist/api/HealthApi.js +1 -1
  16. package/dist/api/HooksApi.js +2 -2
  17. package/dist/api/KVApi.js +2 -2
  18. package/dist/api/LeaderboardsApi.js +1 -1
  19. package/dist/api/LobbiesApi.js +6 -6
  20. package/dist/api/NotificationsApi.js +169 -0
  21. package/dist/api/PartiesApi.js +354 -0
  22. package/dist/api/UsersApi.js +2 -2
  23. package/dist/index.js +374 -17
  24. package/dist/model/AdminCreateKvEntry200Response.js +1 -1
  25. package/dist/model/AdminCreateKvEntryRequest.js +1 -1
  26. package/dist/model/AdminCreateLeaderboardRequest.js +1 -1
  27. package/dist/model/AdminCreateNotification400Response.js +89 -0
  28. package/dist/model/AdminCreateNotificationRequest.js +157 -0
  29. package/dist/model/AdminDeleteChatConversation200Response.js +85 -0
  30. package/dist/model/AdminEndLeaderboard200Response.js +1 -1
  31. package/dist/model/AdminEndLeaderboard200ResponseData.js +1 -1
  32. package/dist/model/AdminListChatMessages200Response.js +124 -0
  33. package/dist/model/AdminListChatMessages200ResponseDataInner.js +184 -0
  34. package/dist/model/AdminListGroups200Response.js +124 -0
  35. package/dist/model/AdminListKvEntries200Response.js +5 -5
  36. package/dist/model/AdminListKvEntries200ResponseDataInner.js +1 -1
  37. package/dist/model/AdminListLobbies200Response.js +5 -5
  38. package/dist/model/AdminListLobbies200ResponseDataInner.js +1 -1
  39. package/dist/model/AdminListNotifications200Response.js +124 -0
  40. package/dist/model/AdminListNotifications200ResponseDataInner.js +148 -0
  41. package/dist/model/AdminListNotifications200ResponseMeta.js +125 -0
  42. package/dist/model/AdminListSessions200Response.js +5 -5
  43. package/dist/model/AdminListSessions200ResponseDataInner.js +1 -1
  44. package/dist/model/AdminSubmitLeaderboardScore200Response.js +1 -1
  45. package/dist/model/AdminSubmitLeaderboardScore200ResponseData.js +1 -1
  46. package/dist/model/AdminSubmitLeaderboardScoreRequest.js +1 -1
  47. package/dist/model/AdminUpdateGroup200Response.js +169 -0
  48. package/dist/model/AdminUpdateGroupRequest.js +129 -0
  49. package/dist/model/AdminUpdateKvEntryRequest.js +1 -1
  50. package/dist/model/AdminUpdateLeaderboardRecordRequest.js +1 -1
  51. package/dist/model/AdminUpdateLeaderboardRequest.js +1 -1
  52. package/dist/model/AdminUpdateLobby200Response.js +1 -1
  53. package/dist/model/AdminUpdateLobbyRequest.js +1 -1
  54. package/dist/model/AdminUpdateUser200Response.js +1 -1
  55. package/dist/model/AdminUpdateUser200ResponseData.js +17 -1
  56. package/dist/model/AdminUpdateUserRequest.js +1 -1
  57. package/dist/model/CallHook200Response.js +1 -1
  58. package/dist/model/CallHookRequest.js +1 -1
  59. package/dist/model/CancelGroupInvite200Response.js +89 -0
  60. package/dist/model/CancelJoinRequest200Response.js +157 -0
  61. package/dist/model/ChatUnreadCount200Response.js +85 -0
  62. package/dist/model/CreateFriendRequestRequest.js +1 -1
  63. package/dist/model/CreateGroupRequest.js +181 -0
  64. package/dist/model/CreateLobbyRequest.js +1 -1
  65. package/dist/model/CreatePartyRequest.js +98 -0
  66. package/dist/model/DeleteNotifications200Response.js +86 -0
  67. package/dist/model/DeleteNotificationsRequest.js +113 -0
  68. package/dist/model/DemoteGroupMemberRequest.js +109 -0
  69. package/dist/model/DeviceLoginRequest.js +1 -1
  70. package/dist/model/ErrorResponse.js +1 -1
  71. package/dist/model/GetCurrentUser200Response.js +30 -1
  72. package/dist/model/GetCurrentUser200ResponseLinkedProviders.js +1 -1
  73. package/dist/model/GetKv200Response.js +1 -1
  74. package/dist/model/GetMyRecord200Response.js +1 -1
  75. package/dist/model/HealthResponse.js +1 -1
  76. package/dist/model/InviteToGroupRequest.js +109 -0
  77. package/dist/model/JoinPartyByCodeRequest.js +113 -0
  78. package/dist/model/KickGroupMemberRequest.js +109 -0
  79. package/dist/model/KickUserRequest.js +1 -1
  80. package/dist/model/LinkDeviceRequest.js +1 -1
  81. package/dist/model/ListBlockedFriends200Response.js +5 -5
  82. package/dist/model/ListBlockedFriends200ResponseDataInner.js +1 -1
  83. package/dist/model/ListBlockedFriends200ResponseDataInnerRequester.js +1 -1
  84. package/dist/model/ListChatMessages200Response.js +118 -0
  85. package/dist/model/ListChatMessages200ResponseDataInner.js +170 -0
  86. package/dist/model/ListFriendRequests200Response.js +1 -1
  87. package/dist/model/ListFriendRequests200ResponseIncomingInner.js +1 -1
  88. package/dist/model/ListFriendRequests200ResponseIncomingInnerRequester.js +21 -1
  89. package/dist/model/ListFriendRequests200ResponseMeta.js +1 -1
  90. package/dist/model/ListFriends200Response.js +5 -5
  91. package/dist/model/ListFriends200ResponseDataInner.js +19 -1
  92. package/dist/model/ListGroupInvitations200Response.js +124 -0
  93. package/dist/model/ListGroupInvitations200ResponseDataInner.js +122 -0
  94. package/dist/model/ListGroupMembers200Response.js +124 -0
  95. package/dist/model/ListGroupMembers200ResponseDataInner.js +180 -0
  96. package/dist/model/ListJoinRequests200Response.js +124 -0
  97. package/dist/model/ListLeaderboardRecords200Response.js +5 -5
  98. package/dist/model/ListLeaderboardRecords200ResponseDataInner.js +1 -1
  99. package/dist/model/ListLeaderboards200Response.js +5 -5
  100. package/dist/model/ListLeaderboards200ResponseDataInner.js +1 -1
  101. package/dist/model/ListLobbies200Response.js +5 -5
  102. package/dist/model/ListLobbies200ResponseDataInner.js +1 -1
  103. package/dist/model/ListMyGroups200Response.js +124 -0
  104. package/dist/model/ListMyGroups200ResponseDataInner.js +200 -0
  105. package/dist/model/ListNotifications200Response.js +124 -0
  106. package/dist/model/ListNotifications200ResponseDataInner.js +148 -0
  107. package/dist/model/ListRecordsAroundUser200Response.js +1 -1
  108. package/dist/model/ListSentInvitations200Response.js +124 -0
  109. package/dist/model/ListSentInvitations200ResponseDataInner.js +141 -0
  110. package/dist/model/Login200Response.js +1 -1
  111. package/dist/model/Login200ResponseData.js +1 -1
  112. package/dist/model/LoginRequest.js +1 -1
  113. package/dist/model/MarkChatReadRequest.js +156 -0
  114. package/dist/model/NotifyGroup200Response.js +86 -0
  115. package/dist/model/NotifyGroupRequest.js +137 -0
  116. package/dist/model/OAuthSessionData.js +1 -1
  117. package/dist/model/OAuthSessionDataDetails.js +1 -1
  118. package/dist/model/OAuthSessionStatus.js +1 -1
  119. package/dist/model/OauthApiCallback200Response.js +1 -1
  120. package/dist/model/OauthApiCallbackRequest.js +1 -1
  121. package/dist/model/OauthCallbackApiAppleIosRequest.js +1 -1
  122. package/dist/model/OauthGoogleIdTokenRequest.js +1 -1
  123. package/dist/model/OauthRequest200Response.js +1 -1
  124. package/dist/model/OauthSessionStatus404Response.js +1 -1
  125. package/dist/model/PartyCreateLobbyRequest.js +139 -0
  126. package/dist/model/PartyJoinLobbyRequest.js +90 -0
  127. package/dist/model/PromoteGroupMemberRequest.js +109 -0
  128. package/dist/model/QuickJoinRequest.js +1 -1
  129. package/dist/model/RefreshToken200Response.js +1 -1
  130. package/dist/model/RefreshToken200ResponseData.js +1 -1
  131. package/dist/model/RefreshTokenRequest.js +1 -1
  132. package/dist/model/SearchUsers200Response.js +5 -5
  133. package/dist/model/SearchUsers200ResponseDataInner.js +30 -1
  134. package/dist/model/SendChatMessageRequest.js +171 -0
  135. package/dist/model/SendNotificationRequest.js +146 -0
  136. package/dist/model/ShowParty200Response.js +160 -0
  137. package/dist/model/ShowParty200ResponseMembersInner.js +137 -0
  138. package/dist/model/UpdateCurrentUserDisplayNameRequest.js +1 -1
  139. package/dist/model/UpdateCurrentUserPassword400Response.js +1 -1
  140. package/dist/model/UpdateCurrentUserPasswordRequest.js +1 -1
  141. package/dist/model/UpdateGroupRequest.js +152 -0
  142. package/dist/model/UpdateLobbyRequest.js +1 -1
  143. package/dist/model/UpdatePartyRequest.js +95 -0
  144. package/package.json +3 -6
@@ -0,0 +1,1017 @@
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 _AdminCreateNotification400Response = _interopRequireDefault(require("../model/AdminCreateNotification400Response"));
9
+ var _CancelGroupInvite200Response = _interopRequireDefault(require("../model/CancelGroupInvite200Response"));
10
+ var _CancelJoinRequest200Response = _interopRequireDefault(require("../model/CancelJoinRequest200Response"));
11
+ var _CreateGroupRequest = _interopRequireDefault(require("../model/CreateGroupRequest"));
12
+ var _DemoteGroupMemberRequest = _interopRequireDefault(require("../model/DemoteGroupMemberRequest"));
13
+ var _InviteToGroupRequest = _interopRequireDefault(require("../model/InviteToGroupRequest"));
14
+ var _KickGroupMemberRequest = _interopRequireDefault(require("../model/KickGroupMemberRequest"));
15
+ var _ListGroupInvitations200Response = _interopRequireDefault(require("../model/ListGroupInvitations200Response"));
16
+ var _ListGroupMembers200Response = _interopRequireDefault(require("../model/ListGroupMembers200Response"));
17
+ var _ListGroupMembers200ResponseDataInner = _interopRequireDefault(require("../model/ListGroupMembers200ResponseDataInner"));
18
+ var _ListJoinRequests200Response = _interopRequireDefault(require("../model/ListJoinRequests200Response"));
19
+ var _ListMyGroups200Response = _interopRequireDefault(require("../model/ListMyGroups200Response"));
20
+ var _ListMyGroups200ResponseDataInner = _interopRequireDefault(require("../model/ListMyGroups200ResponseDataInner"));
21
+ var _ListSentInvitations200Response = _interopRequireDefault(require("../model/ListSentInvitations200Response"));
22
+ var _NotifyGroup200Response = _interopRequireDefault(require("../model/NotifyGroup200Response"));
23
+ var _NotifyGroupRequest = _interopRequireDefault(require("../model/NotifyGroupRequest"));
24
+ var _PromoteGroupMemberRequest = _interopRequireDefault(require("../model/PromoteGroupMemberRequest"));
25
+ var _UpdateGroupRequest = _interopRequireDefault(require("../model/UpdateGroupRequest"));
26
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
27
+ 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); }
28
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
29
+ 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); } }
30
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
31
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
32
+ 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); } /**
33
+ * Game Server API
34
+ * 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
35
+ *
36
+ * The version of the OpenAPI document: 1.0.0
37
+ *
38
+ *
39
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
40
+ * https://openapi-generator.tech
41
+ * Do not edit the class manually.
42
+ *
43
+ */
44
+ /**
45
+ * Groups service.
46
+ * @module api/GroupsApi
47
+ * @version 1.0.0
48
+ */
49
+ var GroupsApi = exports["default"] = /*#__PURE__*/function () {
50
+ /**
51
+ * Constructs a new GroupsApi.
52
+ * @alias module:api/GroupsApi
53
+ * @class
54
+ * @param {module:ApiClient} [apiClient] Optional API client implementation to use,
55
+ * default to {@link module:ApiClient#instance} if unspecified.
56
+ */
57
+ function GroupsApi(apiClient) {
58
+ _classCallCheck(this, GroupsApi);
59
+ this.apiClient = apiClient || _ApiClient["default"].instance;
60
+ }
61
+
62
+ /**
63
+ * Accept a group invitation
64
+ * Accept an invitation to join a hidden group.
65
+ * @param {Number} id Group ID
66
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ListGroupMembers200ResponseDataInner} and HTTP response
67
+ */
68
+ return _createClass(GroupsApi, [{
69
+ key: "acceptGroupInviteWithHttpInfo",
70
+ value: function acceptGroupInviteWithHttpInfo(id) {
71
+ var postBody = null;
72
+ // verify the required parameter 'id' is set
73
+ if (id === undefined || id === null) {
74
+ throw new Error("Missing the required parameter 'id' when calling acceptGroupInvite");
75
+ }
76
+ var pathParams = {
77
+ 'id': id
78
+ };
79
+ var queryParams = {};
80
+ var headerParams = {};
81
+ var formParams = {};
82
+ var authNames = ['authorization'];
83
+ var contentTypes = [];
84
+ var accepts = ['application/json'];
85
+ var returnType = _ListGroupMembers200ResponseDataInner["default"];
86
+ return this.apiClient.callApi('/api/v1/groups/{id}/accept_invite', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
87
+ }
88
+
89
+ /**
90
+ * Accept a group invitation
91
+ * Accept an invitation to join a hidden group.
92
+ * @param {Number} id Group ID
93
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ListGroupMembers200ResponseDataInner}
94
+ */
95
+ }, {
96
+ key: "acceptGroupInvite",
97
+ value: function acceptGroupInvite(id) {
98
+ return this.acceptGroupInviteWithHttpInfo(id).then(function (response_and_data) {
99
+ return response_and_data.data;
100
+ });
101
+ }
102
+
103
+ /**
104
+ * Approve a join request (admin only)
105
+ * Approve a pending join request. The user becomes a member.
106
+ * @param {Number} id Group ID
107
+ * @param {Number} requestId Join request ID
108
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ListGroupMembers200ResponseDataInner} and HTTP response
109
+ */
110
+ }, {
111
+ key: "approveJoinRequestWithHttpInfo",
112
+ value: function approveJoinRequestWithHttpInfo(id, requestId) {
113
+ var postBody = null;
114
+ // verify the required parameter 'id' is set
115
+ if (id === undefined || id === null) {
116
+ throw new Error("Missing the required parameter 'id' when calling approveJoinRequest");
117
+ }
118
+ // verify the required parameter 'requestId' is set
119
+ if (requestId === undefined || requestId === null) {
120
+ throw new Error("Missing the required parameter 'requestId' when calling approveJoinRequest");
121
+ }
122
+ var pathParams = {
123
+ 'id': id,
124
+ 'request_id': requestId
125
+ };
126
+ var queryParams = {};
127
+ var headerParams = {};
128
+ var formParams = {};
129
+ var authNames = ['authorization'];
130
+ var contentTypes = [];
131
+ var accepts = ['application/json'];
132
+ var returnType = _ListGroupMembers200ResponseDataInner["default"];
133
+ return this.apiClient.callApi('/api/v1/groups/{id}/join_requests/{request_id}/approve', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
134
+ }
135
+
136
+ /**
137
+ * Approve a join request (admin only)
138
+ * Approve a pending join request. The user becomes a member.
139
+ * @param {Number} id Group ID
140
+ * @param {Number} requestId Join request ID
141
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ListGroupMembers200ResponseDataInner}
142
+ */
143
+ }, {
144
+ key: "approveJoinRequest",
145
+ value: function approveJoinRequest(id, requestId) {
146
+ return this.approveJoinRequestWithHttpInfo(id, requestId).then(function (response_and_data) {
147
+ return response_and_data.data;
148
+ });
149
+ }
150
+
151
+ /**
152
+ * Cancel a sent group invitation
153
+ * Cancel (delete) a group invitation that the authenticated user sent.
154
+ * @param {Number} inviteId Notification ID of the invitation to cancel
155
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/CancelGroupInvite200Response} and HTTP response
156
+ */
157
+ }, {
158
+ key: "cancelGroupInviteWithHttpInfo",
159
+ value: function cancelGroupInviteWithHttpInfo(inviteId) {
160
+ var postBody = null;
161
+ // verify the required parameter 'inviteId' is set
162
+ if (inviteId === undefined || inviteId === null) {
163
+ throw new Error("Missing the required parameter 'inviteId' when calling cancelGroupInvite");
164
+ }
165
+ var pathParams = {
166
+ 'invite_id': inviteId
167
+ };
168
+ var queryParams = {};
169
+ var headerParams = {};
170
+ var formParams = {};
171
+ var authNames = ['authorization'];
172
+ var contentTypes = [];
173
+ var accepts = ['application/json'];
174
+ var returnType = _CancelGroupInvite200Response["default"];
175
+ return this.apiClient.callApi('/api/v1/groups/sent_invitations/{invite_id}', 'DELETE', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
176
+ }
177
+
178
+ /**
179
+ * Cancel a sent group invitation
180
+ * Cancel (delete) a group invitation that the authenticated user sent.
181
+ * @param {Number} inviteId Notification ID of the invitation to cancel
182
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/CancelGroupInvite200Response}
183
+ */
184
+ }, {
185
+ key: "cancelGroupInvite",
186
+ value: function cancelGroupInvite(inviteId) {
187
+ return this.cancelGroupInviteWithHttpInfo(inviteId).then(function (response_and_data) {
188
+ return response_and_data.data;
189
+ });
190
+ }
191
+
192
+ /**
193
+ * Cancel your own pending join request
194
+ * Cancel a join request that the current user previously sent.
195
+ * @param {Number} id Group ID
196
+ * @param {Number} requestId Join request ID
197
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/CancelJoinRequest200Response} and HTTP response
198
+ */
199
+ }, {
200
+ key: "cancelJoinRequestWithHttpInfo",
201
+ value: function cancelJoinRequestWithHttpInfo(id, requestId) {
202
+ var postBody = null;
203
+ // verify the required parameter 'id' is set
204
+ if (id === undefined || id === null) {
205
+ throw new Error("Missing the required parameter 'id' when calling cancelJoinRequest");
206
+ }
207
+ // verify the required parameter 'requestId' is set
208
+ if (requestId === undefined || requestId === null) {
209
+ throw new Error("Missing the required parameter 'requestId' when calling cancelJoinRequest");
210
+ }
211
+ var pathParams = {
212
+ 'id': id,
213
+ 'request_id': requestId
214
+ };
215
+ var queryParams = {};
216
+ var headerParams = {};
217
+ var formParams = {};
218
+ var authNames = ['authorization'];
219
+ var contentTypes = [];
220
+ var accepts = ['application/json'];
221
+ var returnType = _CancelJoinRequest200Response["default"];
222
+ return this.apiClient.callApi('/api/v1/groups/{id}/join_requests/{request_id}', 'DELETE', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
223
+ }
224
+
225
+ /**
226
+ * Cancel your own pending join request
227
+ * Cancel a join request that the current user previously sent.
228
+ * @param {Number} id Group ID
229
+ * @param {Number} requestId Join request ID
230
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/CancelJoinRequest200Response}
231
+ */
232
+ }, {
233
+ key: "cancelJoinRequest",
234
+ value: function cancelJoinRequest(id, requestId) {
235
+ return this.cancelJoinRequestWithHttpInfo(id, requestId).then(function (response_and_data) {
236
+ return response_and_data.data;
237
+ });
238
+ }
239
+
240
+ /**
241
+ * Create a group
242
+ * Create a new group. The authenticated user becomes an admin member automatically.
243
+ * @param {Object} opts Optional parameters
244
+ * @param {module:model/CreateGroupRequest} [createGroupRequest] Group creation parameters
245
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ListMyGroups200ResponseDataInner} and HTTP response
246
+ */
247
+ }, {
248
+ key: "createGroupWithHttpInfo",
249
+ value: function createGroupWithHttpInfo(opts) {
250
+ opts = opts || {};
251
+ var postBody = opts['createGroupRequest'];
252
+ var pathParams = {};
253
+ var queryParams = {};
254
+ var headerParams = {};
255
+ var formParams = {};
256
+ var authNames = ['authorization'];
257
+ var contentTypes = ['application/json'];
258
+ var accepts = ['application/json'];
259
+ var returnType = _ListMyGroups200ResponseDataInner["default"];
260
+ return this.apiClient.callApi('/api/v1/groups', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
261
+ }
262
+
263
+ /**
264
+ * Create a group
265
+ * Create a new group. The authenticated user becomes an admin member automatically.
266
+ * @param {Object} opts Optional parameters
267
+ * @param {module:model/CreateGroupRequest} opts.createGroupRequest Group creation parameters
268
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ListMyGroups200ResponseDataInner}
269
+ */
270
+ }, {
271
+ key: "createGroup",
272
+ value: function createGroup(opts) {
273
+ return this.createGroupWithHttpInfo(opts).then(function (response_and_data) {
274
+ return response_and_data.data;
275
+ });
276
+ }
277
+
278
+ /**
279
+ * Demote admin to member
280
+ * Demote an admin to regular member. Only admins can demote.
281
+ * @param {Number} id Group ID
282
+ * @param {Object} opts Optional parameters
283
+ * @param {module:model/DemoteGroupMemberRequest} [demoteGroupMemberRequest] Demote parameters
284
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ListGroupMembers200ResponseDataInner} and HTTP response
285
+ */
286
+ }, {
287
+ key: "demoteGroupMemberWithHttpInfo",
288
+ value: function demoteGroupMemberWithHttpInfo(id, opts) {
289
+ opts = opts || {};
290
+ var postBody = opts['demoteGroupMemberRequest'];
291
+ // verify the required parameter 'id' is set
292
+ if (id === undefined || id === null) {
293
+ throw new Error("Missing the required parameter 'id' when calling demoteGroupMember");
294
+ }
295
+ var pathParams = {
296
+ 'id': id
297
+ };
298
+ var queryParams = {};
299
+ var headerParams = {};
300
+ var formParams = {};
301
+ var authNames = ['authorization'];
302
+ var contentTypes = ['application/json'];
303
+ var accepts = ['application/json'];
304
+ var returnType = _ListGroupMembers200ResponseDataInner["default"];
305
+ return this.apiClient.callApi('/api/v1/groups/{id}/demote', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
306
+ }
307
+
308
+ /**
309
+ * Demote admin to member
310
+ * Demote an admin to regular member. Only admins can demote.
311
+ * @param {Number} id Group ID
312
+ * @param {Object} opts Optional parameters
313
+ * @param {module:model/DemoteGroupMemberRequest} opts.demoteGroupMemberRequest Demote parameters
314
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ListGroupMembers200ResponseDataInner}
315
+ */
316
+ }, {
317
+ key: "demoteGroupMember",
318
+ value: function demoteGroupMember(id, opts) {
319
+ return this.demoteGroupMemberWithHttpInfo(id, opts).then(function (response_and_data) {
320
+ return response_and_data.data;
321
+ });
322
+ }
323
+
324
+ /**
325
+ * Get group details
326
+ * Get a single group by ID including member count.
327
+ * @param {Number} id Group ID
328
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ListMyGroups200ResponseDataInner} and HTTP response
329
+ */
330
+ }, {
331
+ key: "getGroupWithHttpInfo",
332
+ value: function getGroupWithHttpInfo(id) {
333
+ var postBody = null;
334
+ // verify the required parameter 'id' is set
335
+ if (id === undefined || id === null) {
336
+ throw new Error("Missing the required parameter 'id' when calling getGroup");
337
+ }
338
+ var pathParams = {
339
+ 'id': id
340
+ };
341
+ var queryParams = {};
342
+ var headerParams = {};
343
+ var formParams = {};
344
+ var authNames = [];
345
+ var contentTypes = [];
346
+ var accepts = ['application/json'];
347
+ var returnType = _ListMyGroups200ResponseDataInner["default"];
348
+ return this.apiClient.callApi('/api/v1/groups/{id}', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
349
+ }
350
+
351
+ /**
352
+ * Get group details
353
+ * Get a single group by ID including member count.
354
+ * @param {Number} id Group ID
355
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ListMyGroups200ResponseDataInner}
356
+ */
357
+ }, {
358
+ key: "getGroup",
359
+ value: function getGroup(id) {
360
+ return this.getGroupWithHttpInfo(id).then(function (response_and_data) {
361
+ return response_and_data.data;
362
+ });
363
+ }
364
+
365
+ /**
366
+ * Invite a user to a hidden group (admin only)
367
+ * Send an invitation notification to a user for a hidden group. The user can then accept it.
368
+ * @param {Number} id Group ID
369
+ * @param {Object} opts Optional parameters
370
+ * @param {module:model/InviteToGroupRequest} [inviteToGroupRequest] Invite parameters
371
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Object} and HTTP response
372
+ */
373
+ }, {
374
+ key: "inviteToGroupWithHttpInfo",
375
+ value: function inviteToGroupWithHttpInfo(id, opts) {
376
+ opts = opts || {};
377
+ var postBody = opts['inviteToGroupRequest'];
378
+ // verify the required parameter 'id' is set
379
+ if (id === undefined || id === null) {
380
+ throw new Error("Missing the required parameter 'id' when calling inviteToGroup");
381
+ }
382
+ var pathParams = {
383
+ 'id': id
384
+ };
385
+ var queryParams = {};
386
+ var headerParams = {};
387
+ var formParams = {};
388
+ var authNames = ['authorization'];
389
+ var contentTypes = ['application/json'];
390
+ var accepts = ['application/json'];
391
+ var returnType = Object;
392
+ return this.apiClient.callApi('/api/v1/groups/{id}/invite', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
393
+ }
394
+
395
+ /**
396
+ * Invite a user to a hidden group (admin only)
397
+ * Send an invitation notification to a user for a hidden group. The user can then accept it.
398
+ * @param {Number} id Group ID
399
+ * @param {Object} opts Optional parameters
400
+ * @param {module:model/InviteToGroupRequest} opts.inviteToGroupRequest Invite parameters
401
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Object}
402
+ */
403
+ }, {
404
+ key: "inviteToGroup",
405
+ value: function inviteToGroup(id, opts) {
406
+ return this.inviteToGroupWithHttpInfo(id, opts).then(function (response_and_data) {
407
+ return response_and_data.data;
408
+ });
409
+ }
410
+
411
+ /**
412
+ * Join a group
413
+ * Join a group. For public groups the user is added immediately. For private groups a join request is created (an admin must approve it). Hidden groups require an invite and cannot be joined directly.
414
+ * @param {Number} id Group ID
415
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ListGroupMembers200ResponseDataInner} and HTTP response
416
+ */
417
+ }, {
418
+ key: "joinGroupWithHttpInfo",
419
+ value: function joinGroupWithHttpInfo(id) {
420
+ var postBody = null;
421
+ // verify the required parameter 'id' is set
422
+ if (id === undefined || id === null) {
423
+ throw new Error("Missing the required parameter 'id' when calling joinGroup");
424
+ }
425
+ var pathParams = {
426
+ 'id': id
427
+ };
428
+ var queryParams = {};
429
+ var headerParams = {};
430
+ var formParams = {};
431
+ var authNames = ['authorization'];
432
+ var contentTypes = [];
433
+ var accepts = ['application/json'];
434
+ var returnType = _ListGroupMembers200ResponseDataInner["default"];
435
+ return this.apiClient.callApi('/api/v1/groups/{id}/join', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
436
+ }
437
+
438
+ /**
439
+ * Join a group
440
+ * Join a group. For public groups the user is added immediately. For private groups a join request is created (an admin must approve it). Hidden groups require an invite and cannot be joined directly.
441
+ * @param {Number} id Group ID
442
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ListGroupMembers200ResponseDataInner}
443
+ */
444
+ }, {
445
+ key: "joinGroup",
446
+ value: function joinGroup(id) {
447
+ return this.joinGroupWithHttpInfo(id).then(function (response_and_data) {
448
+ return response_and_data.data;
449
+ });
450
+ }
451
+
452
+ /**
453
+ * Kick a member (admin only)
454
+ * Remove a member from the group. Only group admins can kick.
455
+ * @param {Number} id Group ID
456
+ * @param {Object} opts Optional parameters
457
+ * @param {module:model/KickGroupMemberRequest} [kickGroupMemberRequest] Kick parameters
458
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Object} and HTTP response
459
+ */
460
+ }, {
461
+ key: "kickGroupMemberWithHttpInfo",
462
+ value: function kickGroupMemberWithHttpInfo(id, opts) {
463
+ opts = opts || {};
464
+ var postBody = opts['kickGroupMemberRequest'];
465
+ // verify the required parameter 'id' is set
466
+ if (id === undefined || id === null) {
467
+ throw new Error("Missing the required parameter 'id' when calling kickGroupMember");
468
+ }
469
+ var pathParams = {
470
+ 'id': id
471
+ };
472
+ var queryParams = {};
473
+ var headerParams = {};
474
+ var formParams = {};
475
+ var authNames = ['authorization'];
476
+ var contentTypes = ['application/json'];
477
+ var accepts = ['application/json'];
478
+ var returnType = Object;
479
+ return this.apiClient.callApi('/api/v1/groups/{id}/kick', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
480
+ }
481
+
482
+ /**
483
+ * Kick a member (admin only)
484
+ * Remove a member from the group. Only group admins can kick.
485
+ * @param {Number} id Group ID
486
+ * @param {Object} opts Optional parameters
487
+ * @param {module:model/KickGroupMemberRequest} opts.kickGroupMemberRequest Kick parameters
488
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Object}
489
+ */
490
+ }, {
491
+ key: "kickGroupMember",
492
+ value: function kickGroupMember(id, opts) {
493
+ return this.kickGroupMemberWithHttpInfo(id, opts).then(function (response_and_data) {
494
+ return response_and_data.data;
495
+ });
496
+ }
497
+
498
+ /**
499
+ * Leave a group
500
+ * Leave a group you are a member of.
501
+ * @param {Number} id Group ID
502
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Object} and HTTP response
503
+ */
504
+ }, {
505
+ key: "leaveGroupWithHttpInfo",
506
+ value: function leaveGroupWithHttpInfo(id) {
507
+ var postBody = null;
508
+ // verify the required parameter 'id' is set
509
+ if (id === undefined || id === null) {
510
+ throw new Error("Missing the required parameter 'id' when calling leaveGroup");
511
+ }
512
+ var pathParams = {
513
+ 'id': id
514
+ };
515
+ var queryParams = {};
516
+ var headerParams = {};
517
+ var formParams = {};
518
+ var authNames = ['authorization'];
519
+ var contentTypes = [];
520
+ var accepts = ['application/json'];
521
+ var returnType = Object;
522
+ return this.apiClient.callApi('/api/v1/groups/{id}/leave', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
523
+ }
524
+
525
+ /**
526
+ * Leave a group
527
+ * Leave a group you are a member of.
528
+ * @param {Number} id Group ID
529
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Object}
530
+ */
531
+ }, {
532
+ key: "leaveGroup",
533
+ value: function leaveGroup(id) {
534
+ return this.leaveGroupWithHttpInfo(id).then(function (response_and_data) {
535
+ return response_and_data.data;
536
+ });
537
+ }
538
+
539
+ /**
540
+ * List my group invitations
541
+ * List pending group invitations for the authenticated user, with pagination.
542
+ * @param {Object} opts Optional parameters
543
+ * @param {Number} [page] Page number (default: 1)
544
+ * @param {Number} [pageSize] Items per page (default: 25)
545
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ListGroupInvitations200Response} and HTTP response
546
+ */
547
+ }, {
548
+ key: "listGroupInvitationsWithHttpInfo",
549
+ value: function listGroupInvitationsWithHttpInfo(opts) {
550
+ opts = opts || {};
551
+ var postBody = null;
552
+ var pathParams = {};
553
+ var queryParams = {
554
+ 'page': opts['page'],
555
+ 'page_size': opts['pageSize']
556
+ };
557
+ var headerParams = {};
558
+ var formParams = {};
559
+ var authNames = ['authorization'];
560
+ var contentTypes = [];
561
+ var accepts = ['application/json'];
562
+ var returnType = _ListGroupInvitations200Response["default"];
563
+ return this.apiClient.callApi('/api/v1/groups/invitations', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
564
+ }
565
+
566
+ /**
567
+ * List my group invitations
568
+ * List pending group invitations for the authenticated user, with pagination.
569
+ * @param {Object} opts Optional parameters
570
+ * @param {Number} opts.page Page number (default: 1)
571
+ * @param {Number} opts.pageSize Items per page (default: 25)
572
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ListGroupInvitations200Response}
573
+ */
574
+ }, {
575
+ key: "listGroupInvitations",
576
+ value: function listGroupInvitations(opts) {
577
+ return this.listGroupInvitationsWithHttpInfo(opts).then(function (response_and_data) {
578
+ return response_and_data.data;
579
+ });
580
+ }
581
+
582
+ /**
583
+ * List group members
584
+ * Get paginated members of a group with their roles.
585
+ * @param {Number} id Group ID
586
+ * @param {Object} opts Optional parameters
587
+ * @param {Number} [page] Page number (default: 1)
588
+ * @param {Number} [pageSize] Items per page (default: 25)
589
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ListGroupMembers200Response} and HTTP response
590
+ */
591
+ }, {
592
+ key: "listGroupMembersWithHttpInfo",
593
+ value: function listGroupMembersWithHttpInfo(id, opts) {
594
+ opts = opts || {};
595
+ var postBody = null;
596
+ // verify the required parameter 'id' is set
597
+ if (id === undefined || id === null) {
598
+ throw new Error("Missing the required parameter 'id' when calling listGroupMembers");
599
+ }
600
+ var pathParams = {
601
+ 'id': id
602
+ };
603
+ var queryParams = {
604
+ 'page': opts['page'],
605
+ 'page_size': opts['pageSize']
606
+ };
607
+ var headerParams = {};
608
+ var formParams = {};
609
+ var authNames = [];
610
+ var contentTypes = [];
611
+ var accepts = ['application/json'];
612
+ var returnType = _ListGroupMembers200Response["default"];
613
+ return this.apiClient.callApi('/api/v1/groups/{id}/members', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
614
+ }
615
+
616
+ /**
617
+ * List group members
618
+ * Get paginated members of a group with their roles.
619
+ * @param {Number} id Group ID
620
+ * @param {Object} opts Optional parameters
621
+ * @param {Number} opts.page Page number (default: 1)
622
+ * @param {Number} opts.pageSize Items per page (default: 25)
623
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ListGroupMembers200Response}
624
+ */
625
+ }, {
626
+ key: "listGroupMembers",
627
+ value: function listGroupMembers(id, opts) {
628
+ return this.listGroupMembersWithHttpInfo(id, opts).then(function (response_and_data) {
629
+ return response_and_data.data;
630
+ });
631
+ }
632
+
633
+ /**
634
+ * List groups
635
+ * Return all non-hidden groups. Supports filtering by title, type, max_members, and metadata.
636
+ * @param {Object} opts Optional parameters
637
+ * @param {String} [title] Search by title (prefix)
638
+ * @param {module:model/String} [type] Filter by group type
639
+ * @param {Number} [minMembers] Minimum max_members to include
640
+ * @param {Number} [maxMembers] Maximum max_members to include
641
+ * @param {String} [metadataKey] Metadata key to filter by
642
+ * @param {String} [metadataValue] Metadata value to match (with metadata_key)
643
+ * @param {Number} [page] Page number
644
+ * @param {Number} [pageSize] Page size
645
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ListMyGroups200Response} and HTTP response
646
+ */
647
+ }, {
648
+ key: "listGroupsWithHttpInfo",
649
+ value: function listGroupsWithHttpInfo(opts) {
650
+ opts = opts || {};
651
+ var postBody = null;
652
+ var pathParams = {};
653
+ var queryParams = {
654
+ 'title': opts['title'],
655
+ 'type': opts['type'],
656
+ 'min_members': opts['minMembers'],
657
+ 'max_members': opts['maxMembers'],
658
+ 'metadata_key': opts['metadataKey'],
659
+ 'metadata_value': opts['metadataValue'],
660
+ 'page': opts['page'],
661
+ 'page_size': opts['pageSize']
662
+ };
663
+ var headerParams = {};
664
+ var formParams = {};
665
+ var authNames = [];
666
+ var contentTypes = [];
667
+ var accepts = ['application/json'];
668
+ var returnType = _ListMyGroups200Response["default"];
669
+ return this.apiClient.callApi('/api/v1/groups', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
670
+ }
671
+
672
+ /**
673
+ * List groups
674
+ * Return all non-hidden groups. Supports filtering by title, type, max_members, and metadata.
675
+ * @param {Object} opts Optional parameters
676
+ * @param {String} opts.title Search by title (prefix)
677
+ * @param {module:model/String} opts.type Filter by group type
678
+ * @param {Number} opts.minMembers Minimum max_members to include
679
+ * @param {Number} opts.maxMembers Maximum max_members to include
680
+ * @param {String} opts.metadataKey Metadata key to filter by
681
+ * @param {String} opts.metadataValue Metadata value to match (with metadata_key)
682
+ * @param {Number} opts.page Page number
683
+ * @param {Number} opts.pageSize Page size
684
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ListMyGroups200Response}
685
+ */
686
+ }, {
687
+ key: "listGroups",
688
+ value: function listGroups(opts) {
689
+ return this.listGroupsWithHttpInfo(opts).then(function (response_and_data) {
690
+ return response_and_data.data;
691
+ });
692
+ }
693
+
694
+ /**
695
+ * List pending join requests (admin only)
696
+ * List pending join requests for a group. Only group admins can view.
697
+ * @param {Number} id Group ID
698
+ * @param {Object} opts Optional parameters
699
+ * @param {Number} [page] Page number
700
+ * @param {Number} [pageSize] Page size
701
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ListJoinRequests200Response} and HTTP response
702
+ */
703
+ }, {
704
+ key: "listJoinRequestsWithHttpInfo",
705
+ value: function listJoinRequestsWithHttpInfo(id, opts) {
706
+ opts = opts || {};
707
+ var postBody = null;
708
+ // verify the required parameter 'id' is set
709
+ if (id === undefined || id === null) {
710
+ throw new Error("Missing the required parameter 'id' when calling listJoinRequests");
711
+ }
712
+ var pathParams = {
713
+ 'id': id
714
+ };
715
+ var queryParams = {
716
+ 'page': opts['page'],
717
+ 'page_size': opts['pageSize']
718
+ };
719
+ var headerParams = {};
720
+ var formParams = {};
721
+ var authNames = ['authorization'];
722
+ var contentTypes = [];
723
+ var accepts = ['application/json'];
724
+ var returnType = _ListJoinRequests200Response["default"];
725
+ return this.apiClient.callApi('/api/v1/groups/{id}/join_requests', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
726
+ }
727
+
728
+ /**
729
+ * List pending join requests (admin only)
730
+ * List pending join requests for a group. Only group admins can view.
731
+ * @param {Number} id Group ID
732
+ * @param {Object} opts Optional parameters
733
+ * @param {Number} opts.page Page number
734
+ * @param {Number} opts.pageSize Page size
735
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ListJoinRequests200Response}
736
+ */
737
+ }, {
738
+ key: "listJoinRequests",
739
+ value: function listJoinRequests(id, opts) {
740
+ return this.listJoinRequestsWithHttpInfo(id, opts).then(function (response_and_data) {
741
+ return response_and_data.data;
742
+ });
743
+ }
744
+
745
+ /**
746
+ * List groups I belong to
747
+ * List groups the authenticated user is a member of, with pagination.
748
+ * @param {Object} opts Optional parameters
749
+ * @param {Number} [page] Page number (default: 1)
750
+ * @param {Number} [pageSize] Items per page (default: 25)
751
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ListMyGroups200Response} and HTTP response
752
+ */
753
+ }, {
754
+ key: "listMyGroupsWithHttpInfo",
755
+ value: function listMyGroupsWithHttpInfo(opts) {
756
+ opts = opts || {};
757
+ var postBody = null;
758
+ var pathParams = {};
759
+ var queryParams = {
760
+ 'page': opts['page'],
761
+ 'page_size': opts['pageSize']
762
+ };
763
+ var headerParams = {};
764
+ var formParams = {};
765
+ var authNames = ['authorization'];
766
+ var contentTypes = [];
767
+ var accepts = ['application/json'];
768
+ var returnType = _ListMyGroups200Response["default"];
769
+ return this.apiClient.callApi('/api/v1/groups/me', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
770
+ }
771
+
772
+ /**
773
+ * List groups I belong to
774
+ * List groups the authenticated user is a member of, with pagination.
775
+ * @param {Object} opts Optional parameters
776
+ * @param {Number} opts.page Page number (default: 1)
777
+ * @param {Number} opts.pageSize Items per page (default: 25)
778
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ListMyGroups200Response}
779
+ */
780
+ }, {
781
+ key: "listMyGroups",
782
+ value: function listMyGroups(opts) {
783
+ return this.listMyGroupsWithHttpInfo(opts).then(function (response_and_data) {
784
+ return response_and_data.data;
785
+ });
786
+ }
787
+
788
+ /**
789
+ * List group invitations I have sent
790
+ * List group invitations sent by the authenticated user, with pagination.
791
+ * @param {Object} opts Optional parameters
792
+ * @param {Number} [page] Page number (default: 1)
793
+ * @param {Number} [pageSize] Items per page (default: 25)
794
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ListSentInvitations200Response} and HTTP response
795
+ */
796
+ }, {
797
+ key: "listSentInvitationsWithHttpInfo",
798
+ value: function listSentInvitationsWithHttpInfo(opts) {
799
+ opts = opts || {};
800
+ var postBody = null;
801
+ var pathParams = {};
802
+ var queryParams = {
803
+ 'page': opts['page'],
804
+ 'page_size': opts['pageSize']
805
+ };
806
+ var headerParams = {};
807
+ var formParams = {};
808
+ var authNames = ['authorization'];
809
+ var contentTypes = [];
810
+ var accepts = ['application/json'];
811
+ var returnType = _ListSentInvitations200Response["default"];
812
+ return this.apiClient.callApi('/api/v1/groups/sent_invitations', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
813
+ }
814
+
815
+ /**
816
+ * List group invitations I have sent
817
+ * List group invitations sent by the authenticated user, with pagination.
818
+ * @param {Object} opts Optional parameters
819
+ * @param {Number} opts.page Page number (default: 1)
820
+ * @param {Number} opts.pageSize Items per page (default: 25)
821
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ListSentInvitations200Response}
822
+ */
823
+ }, {
824
+ key: "listSentInvitations",
825
+ value: function listSentInvitations(opts) {
826
+ return this.listSentInvitationsWithHttpInfo(opts).then(function (response_and_data) {
827
+ return response_and_data.data;
828
+ });
829
+ }
830
+
831
+ /**
832
+ * Send a notification to all group members
833
+ * Broadcasts a notification to every member of the group (except the sender). Any group member can send. Sending again from the same user with the same title replaces the previous notification (upsert, prevents spam).
834
+ * @param {Number} id Group ID
835
+ * @param {Object} opts Optional parameters
836
+ * @param {module:model/NotifyGroupRequest} [notifyGroupRequest] Notification payload
837
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/NotifyGroup200Response} and HTTP response
838
+ */
839
+ }, {
840
+ key: "notifyGroupWithHttpInfo",
841
+ value: function notifyGroupWithHttpInfo(id, opts) {
842
+ opts = opts || {};
843
+ var postBody = opts['notifyGroupRequest'];
844
+ // verify the required parameter 'id' is set
845
+ if (id === undefined || id === null) {
846
+ throw new Error("Missing the required parameter 'id' when calling notifyGroup");
847
+ }
848
+ var pathParams = {
849
+ 'id': id
850
+ };
851
+ var queryParams = {};
852
+ var headerParams = {};
853
+ var formParams = {};
854
+ var authNames = ['authorization'];
855
+ var contentTypes = ['application/json'];
856
+ var accepts = ['application/json'];
857
+ var returnType = _NotifyGroup200Response["default"];
858
+ return this.apiClient.callApi('/api/v1/groups/{id}/notify', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
859
+ }
860
+
861
+ /**
862
+ * Send a notification to all group members
863
+ * Broadcasts a notification to every member of the group (except the sender). Any group member can send. Sending again from the same user with the same title replaces the previous notification (upsert, prevents spam).
864
+ * @param {Number} id Group ID
865
+ * @param {Object} opts Optional parameters
866
+ * @param {module:model/NotifyGroupRequest} opts.notifyGroupRequest Notification payload
867
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/NotifyGroup200Response}
868
+ */
869
+ }, {
870
+ key: "notifyGroup",
871
+ value: function notifyGroup(id, opts) {
872
+ return this.notifyGroupWithHttpInfo(id, opts).then(function (response_and_data) {
873
+ return response_and_data.data;
874
+ });
875
+ }
876
+
877
+ /**
878
+ * Promote member to admin
879
+ * Promote a member to admin role. Only admins can promote.
880
+ * @param {Number} id Group ID
881
+ * @param {Object} opts Optional parameters
882
+ * @param {module:model/PromoteGroupMemberRequest} [promoteGroupMemberRequest] Promote parameters
883
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ListGroupMembers200ResponseDataInner} and HTTP response
884
+ */
885
+ }, {
886
+ key: "promoteGroupMemberWithHttpInfo",
887
+ value: function promoteGroupMemberWithHttpInfo(id, opts) {
888
+ opts = opts || {};
889
+ var postBody = opts['promoteGroupMemberRequest'];
890
+ // verify the required parameter 'id' is set
891
+ if (id === undefined || id === null) {
892
+ throw new Error("Missing the required parameter 'id' when calling promoteGroupMember");
893
+ }
894
+ var pathParams = {
895
+ 'id': id
896
+ };
897
+ var queryParams = {};
898
+ var headerParams = {};
899
+ var formParams = {};
900
+ var authNames = ['authorization'];
901
+ var contentTypes = ['application/json'];
902
+ var accepts = ['application/json'];
903
+ var returnType = _ListGroupMembers200ResponseDataInner["default"];
904
+ return this.apiClient.callApi('/api/v1/groups/{id}/promote', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
905
+ }
906
+
907
+ /**
908
+ * Promote member to admin
909
+ * Promote a member to admin role. Only admins can promote.
910
+ * @param {Number} id Group ID
911
+ * @param {Object} opts Optional parameters
912
+ * @param {module:model/PromoteGroupMemberRequest} opts.promoteGroupMemberRequest Promote parameters
913
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ListGroupMembers200ResponseDataInner}
914
+ */
915
+ }, {
916
+ key: "promoteGroupMember",
917
+ value: function promoteGroupMember(id, opts) {
918
+ return this.promoteGroupMemberWithHttpInfo(id, opts).then(function (response_and_data) {
919
+ return response_and_data.data;
920
+ });
921
+ }
922
+
923
+ /**
924
+ * Reject a join request (admin only)
925
+ * Reject a pending join request.
926
+ * @param {Number} id Group ID
927
+ * @param {Number} requestId Join request ID
928
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/CancelJoinRequest200Response} and HTTP response
929
+ */
930
+ }, {
931
+ key: "rejectJoinRequestWithHttpInfo",
932
+ value: function rejectJoinRequestWithHttpInfo(id, requestId) {
933
+ var postBody = null;
934
+ // verify the required parameter 'id' is set
935
+ if (id === undefined || id === null) {
936
+ throw new Error("Missing the required parameter 'id' when calling rejectJoinRequest");
937
+ }
938
+ // verify the required parameter 'requestId' is set
939
+ if (requestId === undefined || requestId === null) {
940
+ throw new Error("Missing the required parameter 'requestId' when calling rejectJoinRequest");
941
+ }
942
+ var pathParams = {
943
+ 'id': id,
944
+ 'request_id': requestId
945
+ };
946
+ var queryParams = {};
947
+ var headerParams = {};
948
+ var formParams = {};
949
+ var authNames = ['authorization'];
950
+ var contentTypes = [];
951
+ var accepts = ['application/json'];
952
+ var returnType = _CancelJoinRequest200Response["default"];
953
+ return this.apiClient.callApi('/api/v1/groups/{id}/join_requests/{request_id}/reject', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
954
+ }
955
+
956
+ /**
957
+ * Reject a join request (admin only)
958
+ * Reject a pending join request.
959
+ * @param {Number} id Group ID
960
+ * @param {Number} requestId Join request ID
961
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/CancelJoinRequest200Response}
962
+ */
963
+ }, {
964
+ key: "rejectJoinRequest",
965
+ value: function rejectJoinRequest(id, requestId) {
966
+ return this.rejectJoinRequestWithHttpInfo(id, requestId).then(function (response_and_data) {
967
+ return response_and_data.data;
968
+ });
969
+ }
970
+
971
+ /**
972
+ * Update a group (admin only)
973
+ * Update group settings. Only group admins can update. Cannot reduce max_members below current member count.
974
+ * @param {Number} id Group ID
975
+ * @param {Object} opts Optional parameters
976
+ * @param {module:model/UpdateGroupRequest} [updateGroupRequest] Group update parameters
977
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ListMyGroups200ResponseDataInner} and HTTP response
978
+ */
979
+ }, {
980
+ key: "updateGroupWithHttpInfo",
981
+ value: function updateGroupWithHttpInfo(id, opts) {
982
+ opts = opts || {};
983
+ var postBody = opts['updateGroupRequest'];
984
+ // verify the required parameter 'id' is set
985
+ if (id === undefined || id === null) {
986
+ throw new Error("Missing the required parameter 'id' when calling updateGroup");
987
+ }
988
+ var pathParams = {
989
+ 'id': id
990
+ };
991
+ var queryParams = {};
992
+ var headerParams = {};
993
+ var formParams = {};
994
+ var authNames = ['authorization'];
995
+ var contentTypes = ['application/json'];
996
+ var accepts = ['application/json'];
997
+ var returnType = _ListMyGroups200ResponseDataInner["default"];
998
+ return this.apiClient.callApi('/api/v1/groups/{id}', 'PATCH', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
999
+ }
1000
+
1001
+ /**
1002
+ * Update a group (admin only)
1003
+ * Update group settings. Only group admins can update. Cannot reduce max_members below current member count.
1004
+ * @param {Number} id Group ID
1005
+ * @param {Object} opts Optional parameters
1006
+ * @param {module:model/UpdateGroupRequest} opts.updateGroupRequest Group update parameters
1007
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ListMyGroups200ResponseDataInner}
1008
+ */
1009
+ }, {
1010
+ key: "updateGroup",
1011
+ value: function updateGroup(id, opts) {
1012
+ return this.updateGroupWithHttpInfo(id, opts).then(function (response_and_data) {
1013
+ return response_and_data.data;
1014
+ });
1015
+ }
1016
+ }]);
1017
+ }();