mezon-js 2.7.28 → 2.7.29
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/api.gen.d.ts +9 -0
- package/dist/client.d.ts +3 -1
- package/dist/mezon-js.cjs.js +40 -0
- package/dist/mezon-js.esm.mjs +40 -0
- package/package.json +1 -1
package/dist/api.gen.d.ts
CHANGED
@@ -438,6 +438,7 @@ export interface ApiNotificationSetting {
|
|
438
438
|
}
|
439
439
|
/** */
|
440
440
|
export interface ApiNotificationUserChannel {
|
441
|
+
active?: number;
|
441
442
|
id?: string;
|
442
443
|
notification_setting_type?: string;
|
443
444
|
time_mute?: string;
|
@@ -523,6 +524,12 @@ export interface ApiSetDefaultNotificationRequest {
|
|
523
524
|
notification_type?: string;
|
524
525
|
}
|
525
526
|
/** */
|
527
|
+
export interface ApiSetMuteNotificationRequest {
|
528
|
+
active?: number;
|
529
|
+
channel_id?: string;
|
530
|
+
notification_type?: string;
|
531
|
+
}
|
532
|
+
/** */
|
526
533
|
export interface ApiSetNotificationRequest {
|
527
534
|
channel_id?: string;
|
528
535
|
notification_type?: string;
|
@@ -799,6 +806,8 @@ export declare class MezonApi {
|
|
799
806
|
getLinkInvite(bearerToken: string, inviteId: string, options?: any): Promise<ApiInviteUserRes>;
|
800
807
|
/** Add users to a channel. */
|
801
808
|
inviteUser(bearerToken: string, inviteId: string, options?: any): Promise<ApiInviteUserRes>;
|
809
|
+
/** set mute notification user channel. */
|
810
|
+
setMuteNotificationChannel(bearerToken: string, body: ApiSetMuteNotificationRequest, options?: any): Promise<any>;
|
802
811
|
/** Delete one or more notifications for the current user. */
|
803
812
|
deleteNotifications(bearerToken: string, ids?: Array<string>, options?: any): Promise<any>;
|
804
813
|
/** Fetch list of notifications. */
|
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, ApiAccountCustom, ApiAccountDevice, ApiAccountEmail, ApiAccountFacebook, ApiAccountFacebookInstantGame, ApiAccountGoogle, ApiAccountGameCenter, ApiAccountSteam, ApiChannelDescList, ApiChannelDescription, ApiCreateChannelDescRequest, ApiDeleteRoleRequest, ApiClanDescList, ApiCreateClanDescRequest, ApiClanDesc, ApiCategoryDesc, ApiCategoryDescList, ApiRoleList, ApiPermissionList, ApiRoleUserList, ApiRole, ApiCreateRoleRequest, ApiAddRoleChannelDescRequest, ApiCreateCategoryDescRequest, ApiUpdateCategoryDescRequest, ApiDeleteStorageObjectsRequest, ApiEvent, ApiReadStorageObjectsRequest, ApiStorageObjectAcks, ApiUpdateAccountRequest, ApiAccountApple, ApiLinkSteamRequest, ApiClanDescProfile, ApiClanProfile, ApiChannelUserList, ApiClanUserList, ApiLinkInviteUserRequest, ApiUpdateEventRequest, ApiLinkInviteUser, ApiInviteUserRes, ApiUploadAttachmentRequest, ApiUploadAttachment, ApiMessageReaction, ApiMessageMention, ApiMessageAttachment, ApiMessageRef, ApiChannelMessageHeader, ApiVoiceChannelUserList, ApiChannelAttachmentList, ApiCreateEventRequest, ApiEventManagement, ApiEventList, ApiDeleteEventRequest, ApiNotificationChannelCategoySettingsList, ApiNotificationSetting, ApiSetDefaultNotificationRequest, ApiNotificationUserChannel, ApiSetNotificationRequest, ApiNotifiReactMessage } from "./api.gen";
|
16
|
+
import { ApiAccount, ApiAccountCustom, ApiAccountDevice, ApiAccountEmail, ApiAccountFacebook, ApiAccountFacebookInstantGame, ApiAccountGoogle, ApiAccountGameCenter, ApiAccountSteam, ApiChannelDescList, ApiChannelDescription, ApiCreateChannelDescRequest, ApiDeleteRoleRequest, ApiClanDescList, ApiCreateClanDescRequest, ApiClanDesc, ApiCategoryDesc, ApiCategoryDescList, ApiRoleList, ApiPermissionList, ApiRoleUserList, ApiRole, ApiCreateRoleRequest, ApiAddRoleChannelDescRequest, ApiCreateCategoryDescRequest, ApiUpdateCategoryDescRequest, ApiDeleteStorageObjectsRequest, ApiEvent, ApiReadStorageObjectsRequest, ApiStorageObjectAcks, ApiUpdateAccountRequest, ApiAccountApple, ApiLinkSteamRequest, ApiClanDescProfile, ApiClanProfile, ApiChannelUserList, ApiClanUserList, ApiLinkInviteUserRequest, ApiUpdateEventRequest, ApiLinkInviteUser, ApiInviteUserRes, ApiUploadAttachmentRequest, ApiUploadAttachment, ApiMessageReaction, ApiMessageMention, ApiMessageAttachment, ApiMessageRef, ApiChannelMessageHeader, ApiVoiceChannelUserList, ApiChannelAttachmentList, ApiCreateEventRequest, ApiEventManagement, ApiEventList, ApiDeleteEventRequest, ApiNotificationChannelCategoySettingsList, ApiNotificationSetting, ApiSetDefaultNotificationRequest, ApiNotificationUserChannel, ApiSetNotificationRequest, ApiNotifiReactMessage, ApiSetMuteNotificationRequest } from "./api.gen";
|
17
17
|
import { Session } from "./session";
|
18
18
|
import { Socket } from "./socket";
|
19
19
|
import { WebSocketAdapter } from "./web_socket_adapter";
|
@@ -547,6 +547,8 @@ export declare class Client {
|
|
547
547
|
getNotificationClanSetting(session: Session, clanId: string): Promise<ApiNotificationSetting>;
|
548
548
|
/** Set notification channel*/
|
549
549
|
setNotificationChannel(session: Session, request: ApiSetNotificationRequest): Promise<boolean>;
|
550
|
+
/** Set notification channel*/
|
551
|
+
setMuteNotificationChannel(session: Session, request: ApiSetMuteNotificationRequest): Promise<boolean>;
|
550
552
|
/** get default notification clan */
|
551
553
|
getNotificationChannel(session: Session, channelId: string): Promise<ApiNotificationUserChannel>;
|
552
554
|
/** Set default notification category*/
|
package/dist/mezon-js.cjs.js
CHANGED
@@ -2717,6 +2717,35 @@ var MezonApi = class {
|
|
2717
2717
|
)
|
2718
2718
|
]);
|
2719
2719
|
}
|
2720
|
+
/** set mute notification user channel. */
|
2721
|
+
setMuteNotificationChannel(bearerToken, body, options = {}) {
|
2722
|
+
if (body === null || body === void 0) {
|
2723
|
+
throw new Error("'body' is a required parameter but is null or undefined.");
|
2724
|
+
}
|
2725
|
+
const urlPath = "/v2/mutenotificationchannel/set";
|
2726
|
+
const queryParams = /* @__PURE__ */ new Map();
|
2727
|
+
let bodyJson = "";
|
2728
|
+
bodyJson = JSON.stringify(body || {});
|
2729
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
2730
|
+
const fetchOptions = buildFetchOptions("POST", options, bodyJson);
|
2731
|
+
if (bearerToken) {
|
2732
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
2733
|
+
}
|
2734
|
+
return Promise.race([
|
2735
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
2736
|
+
if (response.status == 204) {
|
2737
|
+
return response;
|
2738
|
+
} else if (response.status >= 200 && response.status < 300) {
|
2739
|
+
return response.json();
|
2740
|
+
} else {
|
2741
|
+
throw response;
|
2742
|
+
}
|
2743
|
+
}),
|
2744
|
+
new Promise(
|
2745
|
+
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
2746
|
+
)
|
2747
|
+
]);
|
2748
|
+
}
|
2720
2749
|
/** Delete one or more notifications for the current user. */
|
2721
2750
|
deleteNotifications(bearerToken, ids, options = {}) {
|
2722
2751
|
const urlPath = "/v2/notification";
|
@@ -5842,6 +5871,17 @@ var Client = class {
|
|
5842
5871
|
});
|
5843
5872
|
});
|
5844
5873
|
}
|
5874
|
+
/** Set notification channel*/
|
5875
|
+
setMuteNotificationChannel(session, request) {
|
5876
|
+
return __async(this, null, function* () {
|
5877
|
+
if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
|
5878
|
+
yield this.sessionRefresh(session);
|
5879
|
+
}
|
5880
|
+
return this.apiClient.setMuteNotificationChannel(session.token, request).then((response) => {
|
5881
|
+
return response !== void 0;
|
5882
|
+
});
|
5883
|
+
});
|
5884
|
+
}
|
5845
5885
|
/** get default notification clan */
|
5846
5886
|
getNotificationChannel(session, channelId) {
|
5847
5887
|
return __async(this, null, function* () {
|
package/dist/mezon-js.esm.mjs
CHANGED
@@ -2688,6 +2688,35 @@ var MezonApi = class {
|
|
2688
2688
|
)
|
2689
2689
|
]);
|
2690
2690
|
}
|
2691
|
+
/** set mute notification user channel. */
|
2692
|
+
setMuteNotificationChannel(bearerToken, body, options = {}) {
|
2693
|
+
if (body === null || body === void 0) {
|
2694
|
+
throw new Error("'body' is a required parameter but is null or undefined.");
|
2695
|
+
}
|
2696
|
+
const urlPath = "/v2/mutenotificationchannel/set";
|
2697
|
+
const queryParams = /* @__PURE__ */ new Map();
|
2698
|
+
let bodyJson = "";
|
2699
|
+
bodyJson = JSON.stringify(body || {});
|
2700
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
2701
|
+
const fetchOptions = buildFetchOptions("POST", options, bodyJson);
|
2702
|
+
if (bearerToken) {
|
2703
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
2704
|
+
}
|
2705
|
+
return Promise.race([
|
2706
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
2707
|
+
if (response.status == 204) {
|
2708
|
+
return response;
|
2709
|
+
} else if (response.status >= 200 && response.status < 300) {
|
2710
|
+
return response.json();
|
2711
|
+
} else {
|
2712
|
+
throw response;
|
2713
|
+
}
|
2714
|
+
}),
|
2715
|
+
new Promise(
|
2716
|
+
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
2717
|
+
)
|
2718
|
+
]);
|
2719
|
+
}
|
2691
2720
|
/** Delete one or more notifications for the current user. */
|
2692
2721
|
deleteNotifications(bearerToken, ids, options = {}) {
|
2693
2722
|
const urlPath = "/v2/notification";
|
@@ -5813,6 +5842,17 @@ var Client = class {
|
|
5813
5842
|
});
|
5814
5843
|
});
|
5815
5844
|
}
|
5845
|
+
/** Set notification channel*/
|
5846
|
+
setMuteNotificationChannel(session, request) {
|
5847
|
+
return __async(this, null, function* () {
|
5848
|
+
if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
|
5849
|
+
yield this.sessionRefresh(session);
|
5850
|
+
}
|
5851
|
+
return this.apiClient.setMuteNotificationChannel(session.token, request).then((response) => {
|
5852
|
+
return response !== void 0;
|
5853
|
+
});
|
5854
|
+
});
|
5855
|
+
}
|
5816
5856
|
/** get default notification clan */
|
5817
5857
|
getNotificationChannel(session, channelId) {
|
5818
5858
|
return __async(this, null, function* () {
|