mezon-js 2.7.28 → 2.7.30
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 +2 -0
- package/client.ts +2 -1
- package/dist/api.gen.d.ts +10 -0
- package/dist/client.d.ts +3 -1
- package/dist/mezon-js.cjs.js +42 -1
- package/dist/mezon-js.esm.mjs +42 -1
- package/package.json +1 -1
package/api.gen.ts
CHANGED
package/client.ts
CHANGED
@@ -1061,7 +1061,8 @@ export class Client {
|
|
1061
1061
|
result.voice_channel_users!.push({
|
1062
1062
|
jid: gu.jid,
|
1063
1063
|
channel_id: gu.channel_id,
|
1064
|
-
user_id: gu.user_id
|
1064
|
+
user_id: gu.user_id,
|
1065
|
+
participant: gu.participant
|
1065
1066
|
})
|
1066
1067
|
});
|
1067
1068
|
return Promise.resolve(result);
|
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;
|
@@ -624,6 +631,7 @@ export interface ApiUsers {
|
|
624
631
|
export interface ApiVoiceChannelUser {
|
625
632
|
channel_id?: string;
|
626
633
|
jid?: string;
|
634
|
+
participant?: string;
|
627
635
|
user_id?: string;
|
628
636
|
}
|
629
637
|
/** A list of users belonging to a channel, along with their role. */
|
@@ -799,6 +807,8 @@ export declare class MezonApi {
|
|
799
807
|
getLinkInvite(bearerToken: string, inviteId: string, options?: any): Promise<ApiInviteUserRes>;
|
800
808
|
/** Add users to a channel. */
|
801
809
|
inviteUser(bearerToken: string, inviteId: string, options?: any): Promise<ApiInviteUserRes>;
|
810
|
+
/** set mute notification user channel. */
|
811
|
+
setMuteNotificationChannel(bearerToken: string, body: ApiSetMuteNotificationRequest, options?: any): Promise<any>;
|
802
812
|
/** Delete one or more notifications for the current user. */
|
803
813
|
deleteNotifications(bearerToken: string, ids?: Array<string>, options?: any): Promise<any>;
|
804
814
|
/** 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";
|
@@ -4999,7 +5028,8 @@ var Client = class {
|
|
4999
5028
|
result.voice_channel_users.push({
|
5000
5029
|
jid: gu.jid,
|
5001
5030
|
channel_id: gu.channel_id,
|
5002
|
-
user_id: gu.user_id
|
5031
|
+
user_id: gu.user_id,
|
5032
|
+
participant: gu.participant
|
5003
5033
|
});
|
5004
5034
|
});
|
5005
5035
|
return Promise.resolve(result);
|
@@ -5842,6 +5872,17 @@ var Client = class {
|
|
5842
5872
|
});
|
5843
5873
|
});
|
5844
5874
|
}
|
5875
|
+
/** Set notification channel*/
|
5876
|
+
setMuteNotificationChannel(session, request) {
|
5877
|
+
return __async(this, null, function* () {
|
5878
|
+
if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
|
5879
|
+
yield this.sessionRefresh(session);
|
5880
|
+
}
|
5881
|
+
return this.apiClient.setMuteNotificationChannel(session.token, request).then((response) => {
|
5882
|
+
return response !== void 0;
|
5883
|
+
});
|
5884
|
+
});
|
5885
|
+
}
|
5845
5886
|
/** get default notification clan */
|
5846
5887
|
getNotificationChannel(session, channelId) {
|
5847
5888
|
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";
|
@@ -4970,7 +4999,8 @@ var Client = class {
|
|
4970
4999
|
result.voice_channel_users.push({
|
4971
5000
|
jid: gu.jid,
|
4972
5001
|
channel_id: gu.channel_id,
|
4973
|
-
user_id: gu.user_id
|
5002
|
+
user_id: gu.user_id,
|
5003
|
+
participant: gu.participant
|
4974
5004
|
});
|
4975
5005
|
});
|
4976
5006
|
return Promise.resolve(result);
|
@@ -5813,6 +5843,17 @@ var Client = class {
|
|
5813
5843
|
});
|
5814
5844
|
});
|
5815
5845
|
}
|
5846
|
+
/** Set notification channel*/
|
5847
|
+
setMuteNotificationChannel(session, request) {
|
5848
|
+
return __async(this, null, function* () {
|
5849
|
+
if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
|
5850
|
+
yield this.sessionRefresh(session);
|
5851
|
+
}
|
5852
|
+
return this.apiClient.setMuteNotificationChannel(session.token, request).then((response) => {
|
5853
|
+
return response !== void 0;
|
5854
|
+
});
|
5855
|
+
});
|
5856
|
+
}
|
5816
5857
|
/** get default notification clan */
|
5817
5858
|
getNotificationChannel(session, channelId) {
|
5818
5859
|
return __async(this, null, function* () {
|