mezon-js 2.11.6 → 2.11.7
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/api.gen.ts +11 -3
- package/client.ts +12 -10
- package/dist/api.gen.d.ts +6 -3
- package/dist/client.d.ts +3 -3
- package/dist/mezon-js.cjs.js +13 -11
- package/dist/mezon-js.esm.mjs +13 -11
- package/dist/socket.d.ts +3 -3
- package/package.json +1 -1
- package/socket.ts +2 -2
package/api.gen.ts
CHANGED
@@ -1780,7 +1780,7 @@ export interface ApiNotification {
|
|
1780
1780
|
//
|
1781
1781
|
channel_id?: string;
|
1782
1782
|
//
|
1783
|
-
channel_type?:
|
1783
|
+
channel_type?: number;
|
1784
1784
|
//
|
1785
1785
|
clan_id?: string;
|
1786
1786
|
//Category code for this notification.
|
@@ -1797,6 +1797,12 @@ export interface ApiNotification {
|
|
1797
1797
|
sender_id?: string;
|
1798
1798
|
//Subject of the notification.
|
1799
1799
|
subject?: string;
|
1800
|
+
//category.
|
1801
|
+
category?: number;
|
1802
|
+
//
|
1803
|
+
topic_id?: string;
|
1804
|
+
//
|
1805
|
+
channel?: ApiChannelDescription;
|
1800
1806
|
}
|
1801
1807
|
|
1802
1808
|
/** */
|
@@ -7828,11 +7834,13 @@ export class MezonApi {
|
|
7828
7834
|
deleteNotifications(
|
7829
7835
|
bearerToken: string,
|
7830
7836
|
ids?: Array<string>,
|
7837
|
+
category?: number,
|
7831
7838
|
options: any = {}
|
7832
7839
|
): Promise<any> {
|
7833
7840
|
const urlPath = "/v2/notification";
|
7834
7841
|
const queryParams = new Map<string, any>();
|
7835
7842
|
queryParams.set("ids", ids);
|
7843
|
+
queryParams.set("category", category);
|
7836
7844
|
|
7837
7845
|
let bodyJson: string = "";
|
7838
7846
|
|
@@ -7864,7 +7872,7 @@ export class MezonApi {
|
|
7864
7872
|
limit?: number,
|
7865
7873
|
clanId?: string,
|
7866
7874
|
notificationId?: string,
|
7867
|
-
|
7875
|
+
category?: number,
|
7868
7876
|
direction?: number,
|
7869
7877
|
options: any = {}
|
7870
7878
|
): Promise<ApiNotificationList> {
|
@@ -7873,7 +7881,7 @@ export class MezonApi {
|
|
7873
7881
|
queryParams.set("limit", limit);
|
7874
7882
|
queryParams.set("clan_id", clanId);
|
7875
7883
|
queryParams.set("notification_id", notificationId);
|
7876
|
-
|
7884
|
+
queryParams.set("category", category);
|
7877
7885
|
queryParams.set("direction", direction);
|
7878
7886
|
|
7879
7887
|
let bodyJson: string = "";
|
package/client.ts
CHANGED
@@ -1167,7 +1167,8 @@ export class Client {
|
|
1167
1167
|
/** Delete one or more notifications */
|
1168
1168
|
async deleteNotifications(
|
1169
1169
|
session: Session,
|
1170
|
-
ids?: Array<string
|
1170
|
+
ids?: Array<string>,
|
1171
|
+
category?: number
|
1171
1172
|
): Promise<boolean> {
|
1172
1173
|
if (
|
1173
1174
|
this.autoRefreshSession &&
|
@@ -1178,7 +1179,7 @@ export class Client {
|
|
1178
1179
|
}
|
1179
1180
|
|
1180
1181
|
return this.apiClient
|
1181
|
-
.deleteNotifications(session.token, ids)
|
1182
|
+
.deleteNotifications(session.token, ids, category)
|
1182
1183
|
.then((response: any) => {
|
1183
1184
|
return Promise.resolve(response != undefined);
|
1184
1185
|
});
|
@@ -2254,9 +2255,9 @@ export class Client {
|
|
2254
2255
|
clanId: string,
|
2255
2256
|
limit?: number,
|
2256
2257
|
notificationId?: string,
|
2257
|
-
|
2258
|
+
category?: number,
|
2258
2259
|
direction?: number
|
2259
|
-
): Promise<
|
2260
|
+
): Promise<ApiNotificationList> {
|
2260
2261
|
if (
|
2261
2262
|
this.autoRefreshSession &&
|
2262
2263
|
session.refresh_token &&
|
@@ -2271,11 +2272,11 @@ export class Client {
|
|
2271
2272
|
limit,
|
2272
2273
|
clanId,
|
2273
2274
|
notificationId,
|
2274
|
-
|
2275
|
+
category,
|
2275
2276
|
direction
|
2276
2277
|
)
|
2277
2278
|
.then((response: ApiNotificationList) => {
|
2278
|
-
var result:
|
2279
|
+
var result: ApiNotificationList = {
|
2279
2280
|
cacheable_cursor: response.cacheable_cursor,
|
2280
2281
|
notifications: [],
|
2281
2282
|
};
|
@@ -2286,13 +2287,14 @@ export class Client {
|
|
2286
2287
|
|
2287
2288
|
response.notifications!.forEach((n) => {
|
2288
2289
|
result.notifications!.push({
|
2289
|
-
code: n.code ? Number(n.code) : 0,
|
2290
|
-
create_time: n.create_time,
|
2291
2290
|
id: n.id,
|
2292
|
-
persistent: n.persistent,
|
2293
|
-
sender_id: n.sender_id,
|
2294
2291
|
subject: n.subject,
|
2295
2292
|
content: n.content ? safeJSONParse(n.content) : undefined,
|
2293
|
+
code: n.code ? Number(n.code) : 0,
|
2294
|
+
sender_id: n.sender_id,
|
2295
|
+
create_time: n.create_time,
|
2296
|
+
persistent: n.persistent,
|
2297
|
+
category: n.category,
|
2296
2298
|
});
|
2297
2299
|
});
|
2298
2300
|
return Promise.resolve(result);
|
package/dist/api.gen.d.ts
CHANGED
@@ -1021,7 +1021,7 @@ export interface ApiMessageRef {
|
|
1021
1021
|
export interface ApiNotification {
|
1022
1022
|
avatar_url?: string;
|
1023
1023
|
channel_id?: string;
|
1024
|
-
channel_type?:
|
1024
|
+
channel_type?: number;
|
1025
1025
|
clan_id?: string;
|
1026
1026
|
code?: number;
|
1027
1027
|
content?: string;
|
@@ -1030,6 +1030,9 @@ export interface ApiNotification {
|
|
1030
1030
|
persistent?: boolean;
|
1031
1031
|
sender_id?: string;
|
1032
1032
|
subject?: string;
|
1033
|
+
category?: number;
|
1034
|
+
topic_id?: string;
|
1035
|
+
channel?: ApiChannelDescription;
|
1033
1036
|
}
|
1034
1037
|
/** */
|
1035
1038
|
export interface ApiNotificationChannel {
|
@@ -2010,9 +2013,9 @@ export declare class MezonApi {
|
|
2010
2013
|
/** set mute notification user channel. */
|
2011
2014
|
setMuteNotificationChannel(bearerToken: string, body: ApiSetMuteNotificationRequest, options?: any): Promise<any>;
|
2012
2015
|
/** Delete one or more notifications for the current user. */
|
2013
|
-
deleteNotifications(bearerToken: string, ids?: Array<string>, options?: any): Promise<any>;
|
2016
|
+
deleteNotifications(bearerToken: string, ids?: Array<string>, category?: number, options?: any): Promise<any>;
|
2014
2017
|
/** Fetch list of notifications. */
|
2015
|
-
listNotifications(bearerToken: string, limit?: number, clanId?: string, notificationId?: string,
|
2018
|
+
listNotifications(bearerToken: string, limit?: number, clanId?: string, notificationId?: string, category?: number, direction?: number, options?: any): Promise<ApiNotificationList>;
|
2016
2019
|
/** set notification user channel. */
|
2017
2020
|
setNotificationChannelSetting(bearerToken: string, body: ApiSetNotificationRequest, options?: any): Promise<any>;
|
2018
2021
|
/** set notification user channel. */
|
package/dist/client.d.ts
CHANGED
@@ -13,7 +13,7 @@
|
|
13
13
|
* See the License for the specific language governing permissions and
|
14
14
|
* limitations under the License.
|
15
15
|
*/
|
16
|
-
import { ApiAccount, ApiAccountMezon, ApiAccountDevice, ApiAccountEmail, ApiAccountFacebook, ApiAccountFacebookInstantGame, ApiAccountGoogle, ApiAccountGameCenter, ApiAccountSteam, ApiChannelDescList, ApiChannelDescription, ApiCreateChannelDescRequest, ApiDeleteRoleRequest, ApiClanDescList, ApiCreateClanDescRequest, ApiClanDesc, ApiCategoryDesc, ApiCategoryDescList, ApiPermissionList, ApiRoleUserList, ApiRole, ApiCreateRoleRequest, ApiAddRoleChannelDescRequest, ApiCreateCategoryDescRequest, ApiUpdateCategoryDescRequest, ApiEvent, ApiUpdateAccountRequest, ApiAccountApple, ApiLinkSteamRequest, ApiClanDescProfile, ApiClanProfile, ApiChannelUserList, ApiClanUserList, ApiLinkInviteUserRequest, ApiLinkInviteUser, ApiInviteUserRes, ApiUploadAttachmentRequest, ApiUploadAttachment, ApiMessageReaction, ApiMessageMention, ApiMessageAttachment, ApiMessageRef, ApiChannelMessageHeader, ApiVoiceChannelUserList, ApiChannelAttachmentList, ApiCreateEventRequest, ApiEventManagement, ApiEventList, ApiDeleteEventRequest, ApiSetDefaultNotificationRequest, ApiSetNotificationRequest, ApiSetMuteNotificationRequest, ApiSearchMessageRequest, ApiSearchMessageResponse, ApiPinMessageRequest, ApiPinMessagesList, ApiDeleteChannelDescRequest, ApiChangeChannelPrivateRequest, ApiClanEmojiCreateRequest, MezonUpdateClanEmojiByIdBody, ApiWebhookCreateRequest, ApiWebhookListResponse, MezonUpdateWebhookByIdBody, ApiWebhookGenerateResponse, ApiCheckDuplicateClanNameResponse, ApiClanStickerAddRequest, MezonUpdateClanStickerByIdBody, MezonChangeChannelCategoryBody, ApiUpdateRoleChannelRequest, ApiAddAppRequest, ApiAppList, ApiApp, MezonUpdateAppBody, ApiSystemMessagesList, ApiSystemMessage, ApiSystemMessageRequest, MezonUpdateSystemMessageBody, ApiUpdateCategoryOrderRequest, ApiGiveCoffeeEvent, ApiListStreamingChannelsResponse, ApiStreamingChannelUserList, ApiRegisterStreamingChannelRequest, ApiRoleList, ApiListChannelAppsResponse, ApiNotificationChannelCategorySettingList, ApiNotificationUserChannel, ApiNotificationSetting, ApiNotifiReactMessage, ApiHashtagDmList, ApiEmojiListedResponse, ApiStickerListedResponse, ApiAllUsersAddChannelResponse, ApiRoleListEventResponse, ApiAllUserClans, ApiUserPermissionInChannelListResponse, ApiPermissionRoleChannelListEventResponse, ApiMarkAsReadRequest, ApiChannelCanvasListResponse, ApiEditChannelCanvasRequest, ApiChannelSettingListResponse, ApiAddFavoriteChannelResponse, ApiRegistFcmDeviceTokenResponse, ApiListUserActivity, ApiCreateActivityRequest, ApiLoginIDResponse, ApiLoginRequest, ApiConfirmLoginRequest, ApiUserActivity, ApiChanEncryptionMethod, ApiGetPubKeysResponse, ApiPubKey, ApiGetKeyServerResp, MezonapiListAuditLog, ApiTokenSentEvent, MezonDeleteWebhookByIdBody, ApiWithdrawTokenRequest, ApiListOnboardingResponse, ApiCreateOnboardingRequest, MezonUpdateOnboardingBody, ApiOnboardingItem, ApiGenerateClanWebhookRequest, ApiGenerateClanWebhookResponse, ApiListClanWebhookResponse, MezonUpdateClanWebhookByIdBody, MezonUpdateClanDescBody, ApiUserStatusUpdate, ApiUserStatus, ApiListOnboardingStepResponse, MezonUpdateOnboardingStepByClanIdBody, ApiWalletLedgerList, ApiSdTopicList, ApiSdTopicRequest, ApiSdTopic, MezonUpdateEventBody, ApiTransactionDetail, MezonapiCreateRoomChannelApps, ApiGenerateMeetTokenRequest, ApiGenerateMeetTokenResponse, ApiHandleParticipantMeetStateRequest, ApiMezonOauthClientList, ApiMezonOauthClient, ApiCreateHashChannelAppsResponse } from "./api.gen";
|
16
|
+
import { ApiAccount, ApiAccountMezon, ApiAccountDevice, ApiAccountEmail, ApiAccountFacebook, ApiAccountFacebookInstantGame, ApiAccountGoogle, ApiAccountGameCenter, ApiAccountSteam, ApiChannelDescList, ApiChannelDescription, ApiCreateChannelDescRequest, ApiDeleteRoleRequest, ApiClanDescList, ApiCreateClanDescRequest, ApiClanDesc, ApiCategoryDesc, ApiCategoryDescList, ApiPermissionList, ApiRoleUserList, ApiRole, ApiCreateRoleRequest, ApiAddRoleChannelDescRequest, ApiCreateCategoryDescRequest, ApiUpdateCategoryDescRequest, ApiEvent, ApiNotificationList, ApiUpdateAccountRequest, ApiAccountApple, ApiLinkSteamRequest, ApiClanDescProfile, ApiClanProfile, ApiChannelUserList, ApiClanUserList, ApiLinkInviteUserRequest, ApiLinkInviteUser, ApiInviteUserRes, ApiUploadAttachmentRequest, ApiUploadAttachment, ApiMessageReaction, ApiMessageMention, ApiMessageAttachment, ApiMessageRef, ApiChannelMessageHeader, ApiVoiceChannelUserList, ApiChannelAttachmentList, ApiCreateEventRequest, ApiEventManagement, ApiEventList, ApiDeleteEventRequest, ApiSetDefaultNotificationRequest, ApiSetNotificationRequest, ApiSetMuteNotificationRequest, ApiSearchMessageRequest, ApiSearchMessageResponse, ApiPinMessageRequest, ApiPinMessagesList, ApiDeleteChannelDescRequest, ApiChangeChannelPrivateRequest, ApiClanEmojiCreateRequest, MezonUpdateClanEmojiByIdBody, ApiWebhookCreateRequest, ApiWebhookListResponse, MezonUpdateWebhookByIdBody, ApiWebhookGenerateResponse, ApiCheckDuplicateClanNameResponse, ApiClanStickerAddRequest, MezonUpdateClanStickerByIdBody, MezonChangeChannelCategoryBody, ApiUpdateRoleChannelRequest, ApiAddAppRequest, ApiAppList, ApiApp, MezonUpdateAppBody, ApiSystemMessagesList, ApiSystemMessage, ApiSystemMessageRequest, MezonUpdateSystemMessageBody, ApiUpdateCategoryOrderRequest, ApiGiveCoffeeEvent, ApiListStreamingChannelsResponse, ApiStreamingChannelUserList, ApiRegisterStreamingChannelRequest, ApiRoleList, ApiListChannelAppsResponse, ApiNotificationChannelCategorySettingList, ApiNotificationUserChannel, ApiNotificationSetting, ApiNotifiReactMessage, ApiHashtagDmList, ApiEmojiListedResponse, ApiStickerListedResponse, ApiAllUsersAddChannelResponse, ApiRoleListEventResponse, ApiAllUserClans, ApiUserPermissionInChannelListResponse, ApiPermissionRoleChannelListEventResponse, ApiMarkAsReadRequest, ApiChannelCanvasListResponse, ApiEditChannelCanvasRequest, ApiChannelSettingListResponse, ApiAddFavoriteChannelResponse, ApiRegistFcmDeviceTokenResponse, ApiListUserActivity, ApiCreateActivityRequest, ApiLoginIDResponse, ApiLoginRequest, ApiConfirmLoginRequest, ApiUserActivity, ApiChanEncryptionMethod, ApiGetPubKeysResponse, ApiPubKey, ApiGetKeyServerResp, MezonapiListAuditLog, ApiTokenSentEvent, MezonDeleteWebhookByIdBody, ApiWithdrawTokenRequest, ApiListOnboardingResponse, ApiCreateOnboardingRequest, MezonUpdateOnboardingBody, ApiOnboardingItem, ApiGenerateClanWebhookRequest, ApiGenerateClanWebhookResponse, ApiListClanWebhookResponse, MezonUpdateClanWebhookByIdBody, MezonUpdateClanDescBody, ApiUserStatusUpdate, ApiUserStatus, ApiListOnboardingStepResponse, MezonUpdateOnboardingStepByClanIdBody, ApiWalletLedgerList, ApiSdTopicList, ApiSdTopicRequest, ApiSdTopic, MezonUpdateEventBody, ApiTransactionDetail, MezonapiCreateRoomChannelApps, ApiGenerateMeetTokenRequest, ApiGenerateMeetTokenResponse, ApiHandleParticipantMeetStateRequest, ApiMezonOauthClientList, ApiMezonOauthClient, ApiCreateHashChannelAppsResponse } from "./api.gen";
|
17
17
|
import { Session } from "./session";
|
18
18
|
import { Socket } from "./socket";
|
19
19
|
import { WebSocketAdapter } from "./web_socket_adapter";
|
@@ -400,7 +400,7 @@ export declare class Client {
|
|
400
400
|
/** Delete a category by ID. */
|
401
401
|
deleteCategoryDesc(session: Session, categoryId: string, clanId: string, categoryLabel?: string): Promise<boolean>;
|
402
402
|
/** Delete one or more notifications */
|
403
|
-
deleteNotifications(session: Session, ids?: Array<string
|
403
|
+
deleteNotifications(session: Session, ids?: Array<string>, category?: number): Promise<boolean>;
|
404
404
|
/** Delete a role by ID. */
|
405
405
|
deleteRole(session: Session, roleId: string, clanId: string, roleLabel?: string): Promise<boolean>;
|
406
406
|
/** Delete a event by ID. */
|
@@ -472,7 +472,7 @@ export declare class Client {
|
|
472
472
|
/** List all friends for the current user. */
|
473
473
|
listFriends(session: Session, state?: number, limit?: number, cursor?: string): Promise<Friends>;
|
474
474
|
/** Fetch list of notifications. */
|
475
|
-
listNotifications(session: Session, clanId: string, limit?: number, notificationId?: string,
|
475
|
+
listNotifications(session: Session, clanId: string, limit?: number, notificationId?: string, category?: number, direction?: number): Promise<ApiNotificationList>;
|
476
476
|
/** Execute an RPC function on the server. */
|
477
477
|
rpc(session: Session, basicAuthUsername: string, basicAuthPassword: string, id: string, input: object): Promise<RpcResponse>;
|
478
478
|
/** Execute an RPC function on the server. */
|
package/dist/mezon-js.cjs.js
CHANGED
@@ -4440,10 +4440,11 @@ var MezonApi = class {
|
|
4440
4440
|
]);
|
4441
4441
|
}
|
4442
4442
|
/** Delete one or more notifications for the current user. */
|
4443
|
-
deleteNotifications(bearerToken, ids, options = {}) {
|
4443
|
+
deleteNotifications(bearerToken, ids, category, options = {}) {
|
4444
4444
|
const urlPath = "/v2/notification";
|
4445
4445
|
const queryParams = /* @__PURE__ */ new Map();
|
4446
4446
|
queryParams.set("ids", ids);
|
4447
|
+
queryParams.set("category", category);
|
4447
4448
|
let bodyJson = "";
|
4448
4449
|
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
4449
4450
|
const fetchOptions = buildFetchOptions("DELETE", options, bodyJson);
|
@@ -4466,13 +4467,13 @@ var MezonApi = class {
|
|
4466
4467
|
]);
|
4467
4468
|
}
|
4468
4469
|
/** Fetch list of notifications. */
|
4469
|
-
listNotifications(bearerToken, limit, clanId, notificationId,
|
4470
|
+
listNotifications(bearerToken, limit, clanId, notificationId, category, direction, options = {}) {
|
4470
4471
|
const urlPath = "/v2/notification";
|
4471
4472
|
const queryParams = /* @__PURE__ */ new Map();
|
4472
4473
|
queryParams.set("limit", limit);
|
4473
4474
|
queryParams.set("clan_id", clanId);
|
4474
4475
|
queryParams.set("notification_id", notificationId);
|
4475
|
-
queryParams.set("
|
4476
|
+
queryParams.set("category", category);
|
4476
4477
|
queryParams.set("direction", direction);
|
4477
4478
|
let bodyJson = "";
|
4478
4479
|
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
@@ -8715,12 +8716,12 @@ var Client = class {
|
|
8715
8716
|
});
|
8716
8717
|
}
|
8717
8718
|
/** Delete one or more notifications */
|
8718
|
-
deleteNotifications(session, ids) {
|
8719
|
+
deleteNotifications(session, ids, category) {
|
8719
8720
|
return __async(this, null, function* () {
|
8720
8721
|
if (this.autoRefreshSession && session.refresh_token && session.isexpired(Date.now() / 1e3)) {
|
8721
8722
|
yield this.sessionRefresh(session);
|
8722
8723
|
}
|
8723
|
-
return this.apiClient.deleteNotifications(session.token, ids).then((response) => {
|
8724
|
+
return this.apiClient.deleteNotifications(session.token, ids, category).then((response) => {
|
8724
8725
|
return Promise.resolve(response != void 0);
|
8725
8726
|
});
|
8726
8727
|
});
|
@@ -9406,7 +9407,7 @@ var Client = class {
|
|
9406
9407
|
});
|
9407
9408
|
}
|
9408
9409
|
/** Fetch list of notifications. */
|
9409
|
-
listNotifications(session, clanId, limit, notificationId,
|
9410
|
+
listNotifications(session, clanId, limit, notificationId, category, direction) {
|
9410
9411
|
return __async(this, null, function* () {
|
9411
9412
|
if (this.autoRefreshSession && session.refresh_token && session.isexpired(Date.now() / 1e3)) {
|
9412
9413
|
yield this.sessionRefresh(session);
|
@@ -9416,7 +9417,7 @@ var Client = class {
|
|
9416
9417
|
limit,
|
9417
9418
|
clanId,
|
9418
9419
|
notificationId,
|
9419
|
-
|
9420
|
+
category,
|
9420
9421
|
direction
|
9421
9422
|
).then((response) => {
|
9422
9423
|
var result = {
|
@@ -9428,13 +9429,14 @@ var Client = class {
|
|
9428
9429
|
}
|
9429
9430
|
response.notifications.forEach((n) => {
|
9430
9431
|
result.notifications.push({
|
9432
|
+
id: n.id,
|
9433
|
+
subject: n.subject,
|
9434
|
+
content: n.content ? safeJSONParse(n.content) : void 0,
|
9431
9435
|
code: n.code ? Number(n.code) : 0,
|
9436
|
+
sender_id: n.sender_id,
|
9432
9437
|
create_time: n.create_time,
|
9433
|
-
id: n.id,
|
9434
9438
|
persistent: n.persistent,
|
9435
|
-
|
9436
|
-
subject: n.subject,
|
9437
|
-
content: n.content ? safeJSONParse(n.content) : void 0
|
9439
|
+
category: n.category
|
9438
9440
|
});
|
9439
9441
|
});
|
9440
9442
|
return Promise.resolve(result);
|
package/dist/mezon-js.esm.mjs
CHANGED
@@ -4406,10 +4406,11 @@ var MezonApi = class {
|
|
4406
4406
|
]);
|
4407
4407
|
}
|
4408
4408
|
/** Delete one or more notifications for the current user. */
|
4409
|
-
deleteNotifications(bearerToken, ids, options = {}) {
|
4409
|
+
deleteNotifications(bearerToken, ids, category, options = {}) {
|
4410
4410
|
const urlPath = "/v2/notification";
|
4411
4411
|
const queryParams = /* @__PURE__ */ new Map();
|
4412
4412
|
queryParams.set("ids", ids);
|
4413
|
+
queryParams.set("category", category);
|
4413
4414
|
let bodyJson = "";
|
4414
4415
|
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
4415
4416
|
const fetchOptions = buildFetchOptions("DELETE", options, bodyJson);
|
@@ -4432,13 +4433,13 @@ var MezonApi = class {
|
|
4432
4433
|
]);
|
4433
4434
|
}
|
4434
4435
|
/** Fetch list of notifications. */
|
4435
|
-
listNotifications(bearerToken, limit, clanId, notificationId,
|
4436
|
+
listNotifications(bearerToken, limit, clanId, notificationId, category, direction, options = {}) {
|
4436
4437
|
const urlPath = "/v2/notification";
|
4437
4438
|
const queryParams = /* @__PURE__ */ new Map();
|
4438
4439
|
queryParams.set("limit", limit);
|
4439
4440
|
queryParams.set("clan_id", clanId);
|
4440
4441
|
queryParams.set("notification_id", notificationId);
|
4441
|
-
queryParams.set("
|
4442
|
+
queryParams.set("category", category);
|
4442
4443
|
queryParams.set("direction", direction);
|
4443
4444
|
let bodyJson = "";
|
4444
4445
|
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
@@ -8681,12 +8682,12 @@ var Client = class {
|
|
8681
8682
|
});
|
8682
8683
|
}
|
8683
8684
|
/** Delete one or more notifications */
|
8684
|
-
deleteNotifications(session, ids) {
|
8685
|
+
deleteNotifications(session, ids, category) {
|
8685
8686
|
return __async(this, null, function* () {
|
8686
8687
|
if (this.autoRefreshSession && session.refresh_token && session.isexpired(Date.now() / 1e3)) {
|
8687
8688
|
yield this.sessionRefresh(session);
|
8688
8689
|
}
|
8689
|
-
return this.apiClient.deleteNotifications(session.token, ids).then((response) => {
|
8690
|
+
return this.apiClient.deleteNotifications(session.token, ids, category).then((response) => {
|
8690
8691
|
return Promise.resolve(response != void 0);
|
8691
8692
|
});
|
8692
8693
|
});
|
@@ -9372,7 +9373,7 @@ var Client = class {
|
|
9372
9373
|
});
|
9373
9374
|
}
|
9374
9375
|
/** Fetch list of notifications. */
|
9375
|
-
listNotifications(session, clanId, limit, notificationId,
|
9376
|
+
listNotifications(session, clanId, limit, notificationId, category, direction) {
|
9376
9377
|
return __async(this, null, function* () {
|
9377
9378
|
if (this.autoRefreshSession && session.refresh_token && session.isexpired(Date.now() / 1e3)) {
|
9378
9379
|
yield this.sessionRefresh(session);
|
@@ -9382,7 +9383,7 @@ var Client = class {
|
|
9382
9383
|
limit,
|
9383
9384
|
clanId,
|
9384
9385
|
notificationId,
|
9385
|
-
|
9386
|
+
category,
|
9386
9387
|
direction
|
9387
9388
|
).then((response) => {
|
9388
9389
|
var result = {
|
@@ -9394,13 +9395,14 @@ var Client = class {
|
|
9394
9395
|
}
|
9395
9396
|
response.notifications.forEach((n) => {
|
9396
9397
|
result.notifications.push({
|
9398
|
+
id: n.id,
|
9399
|
+
subject: n.subject,
|
9400
|
+
content: n.content ? safeJSONParse(n.content) : void 0,
|
9397
9401
|
code: n.code ? Number(n.code) : 0,
|
9402
|
+
sender_id: n.sender_id,
|
9398
9403
|
create_time: n.create_time,
|
9399
|
-
id: n.id,
|
9400
9404
|
persistent: n.persistent,
|
9401
|
-
|
9402
|
-
subject: n.subject,
|
9403
|
-
content: n.content ? safeJSONParse(n.content) : void 0
|
9405
|
+
category: n.category
|
9404
9406
|
});
|
9405
9407
|
});
|
9406
9408
|
return Promise.resolve(result);
|
package/dist/socket.d.ts
CHANGED
@@ -13,7 +13,7 @@
|
|
13
13
|
* See the License for the specific language governing permissions and
|
14
14
|
* limitations under the License.
|
15
15
|
*/
|
16
|
-
import { ApiChannelDescription, ApiChannelMessage, ApiChannelMessageHeader, ApiCreateEventRequest, ApiGiveCoffeeEvent, ApiMessageAttachment, ApiMessageMention, ApiMessageReaction, ApiMessageRef, ApiNotificationUserChannel, ApiPermissionUpdate, ApiRole, ApiRpc, ApiTokenSentEvent, ApiUserActivity, ApiWebhook } from "./api.gen";
|
16
|
+
import { ApiChannelDescription, ApiChannelMessage, ApiChannelMessageHeader, ApiCreateEventRequest, ApiGiveCoffeeEvent, ApiMessageAttachment, ApiMessageMention, ApiMessageReaction, ApiMessageRef, ApiNotification, ApiNotificationUserChannel, ApiPermissionUpdate, ApiRole, ApiRpc, ApiTokenSentEvent, ApiUserActivity, ApiWebhook } from "./api.gen";
|
17
17
|
import { Session } from "./session";
|
18
18
|
import { ChannelMessage } from "./client";
|
19
19
|
import { WebSocketAdapter } from "./web_socket_adapter";
|
@@ -768,7 +768,7 @@ export interface Socket {
|
|
768
768
|
/** Handle error events received from the socket. */
|
769
769
|
onerror: (evt: Event) => void;
|
770
770
|
/** Receive notifications from the socket. */
|
771
|
-
onnotification: (notification:
|
771
|
+
onnotification: (notification: ApiNotification) => void;
|
772
772
|
/** Receive status presence updates. */
|
773
773
|
onstatuspresence: (statusPresence: StatusPresenceEvent) => void;
|
774
774
|
/** Receive stream presence updates. */
|
@@ -884,7 +884,7 @@ export declare class DefaultSocket implements Socket {
|
|
884
884
|
onuserchannelremoved(user: UserChannelRemovedEvent): void;
|
885
885
|
onremovefriend(user: RemoveFriend): void;
|
886
886
|
onuserclanremoved(user: UserClanRemovedEvent): void;
|
887
|
-
onnotification(notification:
|
887
|
+
onnotification(notification: ApiNotification): void;
|
888
888
|
onstatuspresence(statusPresence: StatusPresenceEvent): void;
|
889
889
|
onpinmessage(pin: LastPinMessageEvent): void;
|
890
890
|
onvoiceended(voice: VoiceEndedEvent): void;
|
package/package.json
CHANGED
package/socket.ts
CHANGED
@@ -1235,7 +1235,7 @@ export interface Socket {
|
|
1235
1235
|
onerror: (evt: Event) => void;
|
1236
1236
|
|
1237
1237
|
/** Receive notifications from the socket. */
|
1238
|
-
onnotification: (notification:
|
1238
|
+
onnotification: (notification: ApiNotification) => void;
|
1239
1239
|
|
1240
1240
|
/** Receive status presence updates. */
|
1241
1241
|
onstatuspresence: (statusPresence: StatusPresenceEvent) => void;
|
@@ -1804,7 +1804,7 @@ export class DefaultSocket implements Socket {
|
|
1804
1804
|
}
|
1805
1805
|
}
|
1806
1806
|
|
1807
|
-
onnotification(notification:
|
1807
|
+
onnotification(notification: ApiNotification) {
|
1808
1808
|
if (this.verbose && window && window.console) {
|
1809
1809
|
console.log(notification);
|
1810
1810
|
}
|