mezon-js 2.9.45 → 2.9.47
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 +151 -48
- package/client.ts +39 -0
- package/dist/api.gen.d.ts +30 -2
- package/dist/client.d.ts +4 -1
- package/dist/mezon-js.cjs.js +106 -36
- package/dist/mezon-js.esm.mjs +106 -36
- package/package.json +1 -1
package/api.gen.ts
CHANGED
|
@@ -952,6 +952,22 @@ export interface ApiClanUserList {
|
|
|
952
952
|
cursor?: string;
|
|
953
953
|
}
|
|
954
954
|
|
|
955
|
+
/** */
|
|
956
|
+
export interface ApiCreateActivityRequest {
|
|
957
|
+
//
|
|
958
|
+
activity_description?: string;
|
|
959
|
+
//
|
|
960
|
+
activity_name?: string;
|
|
961
|
+
//
|
|
962
|
+
activity_type?: number;
|
|
963
|
+
//
|
|
964
|
+
application_id?: string;
|
|
965
|
+
//
|
|
966
|
+
start_time?: string;
|
|
967
|
+
//
|
|
968
|
+
status?: number;
|
|
969
|
+
}
|
|
970
|
+
|
|
955
971
|
/** */
|
|
956
972
|
export interface ApiCreateCategoryDescRequest {
|
|
957
973
|
//
|
|
@@ -1349,6 +1365,11 @@ export interface ApiMessageDeleted {
|
|
|
1349
1365
|
//
|
|
1350
1366
|
message_id?: string;
|
|
1351
1367
|
}
|
|
1368
|
+
/** */
|
|
1369
|
+
export interface ApiListUserActivity {
|
|
1370
|
+
//
|
|
1371
|
+
activities?: Array<ApiUserActivity>;
|
|
1372
|
+
}
|
|
1352
1373
|
|
|
1353
1374
|
/** */
|
|
1354
1375
|
export interface ApiMarkAsReadRequest {
|
|
@@ -2136,6 +2157,26 @@ export interface ApiUser {
|
|
|
2136
2157
|
username?: string;
|
|
2137
2158
|
}
|
|
2138
2159
|
|
|
2160
|
+
/** */
|
|
2161
|
+
export interface ApiUserActivity {
|
|
2162
|
+
//
|
|
2163
|
+
activity_description?: string;
|
|
2164
|
+
//
|
|
2165
|
+
activity_name?: string;
|
|
2166
|
+
//
|
|
2167
|
+
activity_type?: number;
|
|
2168
|
+
//
|
|
2169
|
+
application_id?: string;
|
|
2170
|
+
//
|
|
2171
|
+
end_time?: string;
|
|
2172
|
+
//
|
|
2173
|
+
start_time?: string;
|
|
2174
|
+
//
|
|
2175
|
+
status?: number;
|
|
2176
|
+
//
|
|
2177
|
+
user_id?: string;
|
|
2178
|
+
}
|
|
2179
|
+
|
|
2139
2180
|
/** */
|
|
2140
2181
|
export interface ApiUserPermissionInChannelListResponse {
|
|
2141
2182
|
//
|
|
@@ -3549,7 +3590,74 @@ export class MezonApi {
|
|
|
3549
3590
|
const urlPath = "/v2/account/unlink/steam";
|
|
3550
3591
|
const queryParams = new Map<string, any>();
|
|
3551
3592
|
|
|
3552
|
-
let bodyJson: string = "";
|
|
3593
|
+
let bodyJson : string = "";
|
|
3594
|
+
bodyJson = JSON.stringify(body || {});
|
|
3595
|
+
|
|
3596
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
|
3597
|
+
const fetchOptions = buildFetchOptions("POST", options, bodyJson);
|
|
3598
|
+
if (bearerToken) {
|
|
3599
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
|
3600
|
+
}
|
|
3601
|
+
|
|
3602
|
+
return Promise.race([
|
|
3603
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
|
3604
|
+
if (response.status == 204) {
|
|
3605
|
+
return response;
|
|
3606
|
+
} else if (response.status >= 200 && response.status < 300) {
|
|
3607
|
+
return response.json();
|
|
3608
|
+
} else {
|
|
3609
|
+
throw response;
|
|
3610
|
+
}
|
|
3611
|
+
}),
|
|
3612
|
+
new Promise((_, reject) =>
|
|
3613
|
+
setTimeout(reject, this.timeoutMs, "Request timed out.")
|
|
3614
|
+
),
|
|
3615
|
+
]);
|
|
3616
|
+
}
|
|
3617
|
+
|
|
3618
|
+
/** List activity */
|
|
3619
|
+
listActivity(bearerToken: string,
|
|
3620
|
+
options: any = {}): Promise<ApiListUserActivity> {
|
|
3621
|
+
|
|
3622
|
+
const urlPath = "/v2/activity";
|
|
3623
|
+
const queryParams = new Map<string, any>();
|
|
3624
|
+
|
|
3625
|
+
let bodyJson : string = "";
|
|
3626
|
+
|
|
3627
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
|
3628
|
+
const fetchOptions = buildFetchOptions("GET", options, bodyJson);
|
|
3629
|
+
if (bearerToken) {
|
|
3630
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
|
3631
|
+
}
|
|
3632
|
+
|
|
3633
|
+
return Promise.race([
|
|
3634
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
|
3635
|
+
if (response.status == 204) {
|
|
3636
|
+
return response;
|
|
3637
|
+
} else if (response.status >= 200 && response.status < 300) {
|
|
3638
|
+
return response.json();
|
|
3639
|
+
} else {
|
|
3640
|
+
throw response;
|
|
3641
|
+
}
|
|
3642
|
+
}),
|
|
3643
|
+
new Promise((_, reject) =>
|
|
3644
|
+
setTimeout(reject, this.timeoutMs, "Request timed out.")
|
|
3645
|
+
),
|
|
3646
|
+
]);
|
|
3647
|
+
}
|
|
3648
|
+
|
|
3649
|
+
/** Create user activity */
|
|
3650
|
+
createActiviy(bearerToken: string,
|
|
3651
|
+
body:ApiCreateActivityRequest,
|
|
3652
|
+
options: any = {}): Promise<any> {
|
|
3653
|
+
|
|
3654
|
+
if (body === null || body === undefined) {
|
|
3655
|
+
throw new Error("'body' is a required parameter but is null or undefined.");
|
|
3656
|
+
}
|
|
3657
|
+
const urlPath = "/v2/activity";
|
|
3658
|
+
const queryParams = new Map<string, any>();
|
|
3659
|
+
|
|
3660
|
+
let bodyJson : string = "";
|
|
3553
3661
|
bodyJson = JSON.stringify(body || {});
|
|
3554
3662
|
|
|
3555
3663
|
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
|
@@ -4010,6 +4118,48 @@ export class MezonApi {
|
|
|
4010
4118
|
]);
|
|
4011
4119
|
}
|
|
4012
4120
|
|
|
4121
|
+
/** */
|
|
4122
|
+
getChannelCanvasList(bearerToken: string,
|
|
4123
|
+
channelId:string,
|
|
4124
|
+
clanId?:string,
|
|
4125
|
+
limit?:number,
|
|
4126
|
+
page?:number,
|
|
4127
|
+
options: any = {}): Promise<ApiChannelCanvasListResponse> {
|
|
4128
|
+
|
|
4129
|
+
if (channelId === null || channelId === undefined) {
|
|
4130
|
+
throw new Error("'channelId' is a required parameter but is null or undefined.");
|
|
4131
|
+
}
|
|
4132
|
+
const urlPath = "/v2/channel-canvases/{channelId}"
|
|
4133
|
+
.replace("{channelId}", encodeURIComponent(String(channelId)));
|
|
4134
|
+
const queryParams = new Map<string, any>();
|
|
4135
|
+
queryParams.set("clan_id", clanId);
|
|
4136
|
+
queryParams.set("limit", limit);
|
|
4137
|
+
queryParams.set("page", page);
|
|
4138
|
+
|
|
4139
|
+
let bodyJson : string = "";
|
|
4140
|
+
|
|
4141
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
|
4142
|
+
const fetchOptions = buildFetchOptions("GET", options, bodyJson);
|
|
4143
|
+
if (bearerToken) {
|
|
4144
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
|
4145
|
+
}
|
|
4146
|
+
|
|
4147
|
+
return Promise.race([
|
|
4148
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
|
4149
|
+
if (response.status == 204) {
|
|
4150
|
+
return response;
|
|
4151
|
+
} else if (response.status >= 200 && response.status < 300) {
|
|
4152
|
+
return response.json();
|
|
4153
|
+
} else {
|
|
4154
|
+
throw response;
|
|
4155
|
+
}
|
|
4156
|
+
}),
|
|
4157
|
+
new Promise((_, reject) =>
|
|
4158
|
+
setTimeout(reject, this.timeoutMs, "Request timed out.")
|
|
4159
|
+
),
|
|
4160
|
+
]);
|
|
4161
|
+
}
|
|
4162
|
+
|
|
4013
4163
|
/** */
|
|
4014
4164
|
addChannelFavorite(bearerToken: string,
|
|
4015
4165
|
body:ApiAddFavoriteChannelRequest,
|
|
@@ -8852,53 +9002,6 @@ export class MezonApi {
|
|
|
8852
9002
|
]);
|
|
8853
9003
|
}
|
|
8854
9004
|
|
|
8855
|
-
/** */
|
|
8856
|
-
getChannelCanvasList(
|
|
8857
|
-
bearerToken: string,
|
|
8858
|
-
channelId: string,
|
|
8859
|
-
clanId?: string,
|
|
8860
|
-
limit?: number,
|
|
8861
|
-
page?: number,
|
|
8862
|
-
options: any = {}
|
|
8863
|
-
): Promise<ApiChannelCanvasListResponse> {
|
|
8864
|
-
if (channelId === null || channelId === undefined) {
|
|
8865
|
-
throw new Error(
|
|
8866
|
-
"'channelId' is a required parameter but is null or undefined."
|
|
8867
|
-
);
|
|
8868
|
-
}
|
|
8869
|
-
const urlPath = "/v2/channel_canvases/{channelId}".replace(
|
|
8870
|
-
"{channelId}",
|
|
8871
|
-
encodeURIComponent(String(channelId))
|
|
8872
|
-
);
|
|
8873
|
-
const queryParams = new Map<string, any>();
|
|
8874
|
-
queryParams.set("clan_id", clanId);
|
|
8875
|
-
queryParams.set("limit", limit);
|
|
8876
|
-
queryParams.set("page", page);
|
|
8877
|
-
|
|
8878
|
-
let bodyJson: string = "";
|
|
8879
|
-
|
|
8880
|
-
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
|
8881
|
-
const fetchOptions = buildFetchOptions("GET", options, bodyJson);
|
|
8882
|
-
if (bearerToken) {
|
|
8883
|
-
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
|
8884
|
-
}
|
|
8885
|
-
|
|
8886
|
-
return Promise.race([
|
|
8887
|
-
fetch(fullUrl, fetchOptions).then((response) => {
|
|
8888
|
-
if (response.status == 204) {
|
|
8889
|
-
return response;
|
|
8890
|
-
} else if (response.status >= 200 && response.status < 300) {
|
|
8891
|
-
return response.json();
|
|
8892
|
-
} else {
|
|
8893
|
-
throw response;
|
|
8894
|
-
}
|
|
8895
|
-
}),
|
|
8896
|
-
new Promise((_, reject) =>
|
|
8897
|
-
setTimeout(reject, this.timeoutMs, "Request timed out.")
|
|
8898
|
-
),
|
|
8899
|
-
]);
|
|
8900
|
-
}
|
|
8901
|
-
|
|
8902
9005
|
/** */
|
|
8903
9006
|
deleteChannelCanvas(
|
|
8904
9007
|
bearerToken: string,
|
package/client.ts
CHANGED
|
@@ -126,6 +126,8 @@ import {
|
|
|
126
126
|
ApiChannelSettingListResponse,
|
|
127
127
|
ApiAddFavoriteChannelResponse,
|
|
128
128
|
ApiRegistFcmDeviceTokenResponse,
|
|
129
|
+
ApiListUserActivity,
|
|
130
|
+
ApiCreateActivityRequest,
|
|
129
131
|
} from "./api.gen";
|
|
130
132
|
|
|
131
133
|
import { Session } from "./session";
|
|
@@ -4170,4 +4172,41 @@ export class Client {
|
|
|
4170
4172
|
return response;
|
|
4171
4173
|
});
|
|
4172
4174
|
}
|
|
4175
|
+
/** List activity */
|
|
4176
|
+
async listActivity(
|
|
4177
|
+
session: Session
|
|
4178
|
+
): Promise<ApiListUserActivity> {
|
|
4179
|
+
if (
|
|
4180
|
+
this.autoRefreshSession &&
|
|
4181
|
+
session.refresh_token &&
|
|
4182
|
+
session.isexpired((Date.now() + this.expiredTimespanMs) / 1000)
|
|
4183
|
+
) {
|
|
4184
|
+
await this.sessionRefresh(session);
|
|
4185
|
+
}
|
|
4186
|
+
|
|
4187
|
+
return this.apiClient
|
|
4188
|
+
.listActivity(session.token)
|
|
4189
|
+
.then((response: any) => {
|
|
4190
|
+
return response;
|
|
4191
|
+
});
|
|
4192
|
+
}
|
|
4193
|
+
|
|
4194
|
+
async createActiviy(
|
|
4195
|
+
session: Session,
|
|
4196
|
+
request: ApiCreateActivityRequest
|
|
4197
|
+
): Promise<any> {
|
|
4198
|
+
if (
|
|
4199
|
+
this.autoRefreshSession &&
|
|
4200
|
+
session.refresh_token &&
|
|
4201
|
+
session.isexpired((Date.now() + this.expiredTimespanMs) / 1000)
|
|
4202
|
+
) {
|
|
4203
|
+
await this.sessionRefresh(session);
|
|
4204
|
+
}
|
|
4205
|
+
|
|
4206
|
+
return this.apiClient
|
|
4207
|
+
.createActiviy(session.token, request)
|
|
4208
|
+
.then((response: any) => {
|
|
4209
|
+
return response;
|
|
4210
|
+
});
|
|
4211
|
+
}
|
|
4173
4212
|
}
|
package/dist/api.gen.d.ts
CHANGED
|
@@ -549,6 +549,15 @@ export interface ApiClanUserList {
|
|
|
549
549
|
cursor?: string;
|
|
550
550
|
}
|
|
551
551
|
/** */
|
|
552
|
+
export interface ApiCreateActivityRequest {
|
|
553
|
+
activity_description?: string;
|
|
554
|
+
activity_name?: string;
|
|
555
|
+
activity_type?: number;
|
|
556
|
+
application_id?: string;
|
|
557
|
+
start_time?: string;
|
|
558
|
+
status?: number;
|
|
559
|
+
}
|
|
560
|
+
/** */
|
|
552
561
|
export interface ApiCreateCategoryDescRequest {
|
|
553
562
|
category_name?: string;
|
|
554
563
|
clan_id?: string;
|
|
@@ -782,6 +791,10 @@ export interface ApiMessageDeleted {
|
|
|
782
791
|
message_id?: string;
|
|
783
792
|
}
|
|
784
793
|
/** */
|
|
794
|
+
export interface ApiListUserActivity {
|
|
795
|
+
activities?: Array<ApiUserActivity>;
|
|
796
|
+
}
|
|
797
|
+
/** */
|
|
785
798
|
export interface ApiMarkAsReadRequest {
|
|
786
799
|
category_id?: string;
|
|
787
800
|
channel_id?: string;
|
|
@@ -1240,6 +1253,17 @@ export interface ApiUser {
|
|
|
1240
1253
|
username?: string;
|
|
1241
1254
|
}
|
|
1242
1255
|
/** */
|
|
1256
|
+
export interface ApiUserActivity {
|
|
1257
|
+
activity_description?: string;
|
|
1258
|
+
activity_name?: string;
|
|
1259
|
+
activity_type?: number;
|
|
1260
|
+
application_id?: string;
|
|
1261
|
+
end_time?: string;
|
|
1262
|
+
start_time?: string;
|
|
1263
|
+
status?: number;
|
|
1264
|
+
user_id?: string;
|
|
1265
|
+
}
|
|
1266
|
+
/** */
|
|
1243
1267
|
export interface ApiUserPermissionInChannelListResponse {
|
|
1244
1268
|
channel_id?: string;
|
|
1245
1269
|
clan_id?: string;
|
|
@@ -1378,6 +1402,10 @@ export declare class MezonApi {
|
|
|
1378
1402
|
unlinkGoogle(bearerToken: string, body: ApiAccountGoogle, options?: any): Promise<any>;
|
|
1379
1403
|
/** Remove Steam from the social profiles on the current user's account. */
|
|
1380
1404
|
unlinkSteam(bearerToken: string, body: ApiAccountSteam, options?: any): Promise<any>;
|
|
1405
|
+
/** List activity */
|
|
1406
|
+
listActivity(bearerToken: string, options?: any): Promise<ApiListUserActivity>;
|
|
1407
|
+
/** Create user activity */
|
|
1408
|
+
createActiviy(bearerToken: string, body: ApiCreateActivityRequest, options?: any): Promise<any>;
|
|
1381
1409
|
/** Add a new apps. */
|
|
1382
1410
|
addApp(bearerToken: string, body: ApiAddAppRequest, options?: any): Promise<any>;
|
|
1383
1411
|
/** List (and optionally filter) accounts. */
|
|
@@ -1401,6 +1429,8 @@ export declare class MezonApi {
|
|
|
1401
1429
|
/** List channel apps. */
|
|
1402
1430
|
listChannelApps(bearerToken: string, clanId?: string, options?: any): Promise<ApiListChannelAppsResponse>;
|
|
1403
1431
|
/** */
|
|
1432
|
+
getChannelCanvasList(bearerToken: string, channelId: string, clanId?: string, limit?: number, page?: number, options?: any): Promise<ApiChannelCanvasListResponse>;
|
|
1433
|
+
/** */
|
|
1404
1434
|
addChannelFavorite(bearerToken: string, body: ApiAddFavoriteChannelRequest, options?: any): Promise<any>;
|
|
1405
1435
|
/** */
|
|
1406
1436
|
removeChannelFavorite(bearerToken: string, channelId: string, options?: any): Promise<any>;
|
|
@@ -1642,7 +1672,5 @@ export declare class MezonApi {
|
|
|
1642
1672
|
/** */
|
|
1643
1673
|
getChannelCanvasDetail(bearerToken: string, id: string, clanId?: string, channelId?: string, options?: any): Promise<ApiChannelCanvasDetailResponse>;
|
|
1644
1674
|
/** */
|
|
1645
|
-
getChannelCanvasList(bearerToken: string, channelId: string, clanId?: string, limit?: number, page?: number, options?: any): Promise<ApiChannelCanvasListResponse>;
|
|
1646
|
-
/** */
|
|
1647
1675
|
deleteChannelCanvas(bearerToken: string, canvasId: string, clanId?: string, channelId?: string, options?: any): Promise<any>;
|
|
1648
1676
|
}
|
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, ApiPermissionList, ApiRoleUserList, ApiRole, ApiCreateRoleRequest, ApiAddRoleChannelDescRequest, ApiCreateCategoryDescRequest, ApiUpdateCategoryDescRequest, ApiEvent, ApiUpdateAccountRequest, ApiAccountApple, ApiLinkSteamRequest, ApiClanDescProfile, ApiClanProfile, ApiChannelUserList, ApiClanUserList, ApiLinkInviteUserRequest, ApiUpdateEventRequest, 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, ApiEditChannelCanvasRequest, ApiChannelSettingListResponse, ApiAddFavoriteChannelResponse, ApiRegistFcmDeviceTokenResponse } from "./api.gen";
|
|
16
|
+
import { ApiAccount, ApiAccountCustom, 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, ApiUpdateEventRequest, 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, ApiEditChannelCanvasRequest, ApiChannelSettingListResponse, ApiAddFavoriteChannelResponse, ApiRegistFcmDeviceTokenResponse, ApiListUserActivity, ApiCreateActivityRequest } from "./api.gen";
|
|
17
17
|
import { Session } from "./session";
|
|
18
18
|
import { Socket } from "./socket";
|
|
19
19
|
import { WebSocketAdapter } from "./web_socket_adapter";
|
|
@@ -588,4 +588,7 @@ export declare class Client {
|
|
|
588
588
|
addFavoriteChannel(session: Session, channelId: string, clanId: string): Promise<ApiAddFavoriteChannelResponse>;
|
|
589
589
|
removeFavoriteChannel(session: Session, channelId: string): Promise<any>;
|
|
590
590
|
getListFavoriteChannel(session: Session, clanId: string): Promise<any>;
|
|
591
|
+
/** List activity */
|
|
592
|
+
listActivity(session: Session): Promise<ApiListUserActivity>;
|
|
593
|
+
createActiviy(session: Session, request: ApiCreateActivityRequest): Promise<any>;
|
|
591
594
|
}
|
package/dist/mezon-js.cjs.js
CHANGED
|
@@ -1712,6 +1712,60 @@ var MezonApi = class {
|
|
|
1712
1712
|
)
|
|
1713
1713
|
]);
|
|
1714
1714
|
}
|
|
1715
|
+
/** List activity */
|
|
1716
|
+
listActivity(bearerToken, options = {}) {
|
|
1717
|
+
const urlPath = "/v2/activity";
|
|
1718
|
+
const queryParams = /* @__PURE__ */ new Map();
|
|
1719
|
+
let bodyJson = "";
|
|
1720
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
|
1721
|
+
const fetchOptions = buildFetchOptions("GET", options, bodyJson);
|
|
1722
|
+
if (bearerToken) {
|
|
1723
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
|
1724
|
+
}
|
|
1725
|
+
return Promise.race([
|
|
1726
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
|
1727
|
+
if (response.status == 204) {
|
|
1728
|
+
return response;
|
|
1729
|
+
} else if (response.status >= 200 && response.status < 300) {
|
|
1730
|
+
return response.json();
|
|
1731
|
+
} else {
|
|
1732
|
+
throw response;
|
|
1733
|
+
}
|
|
1734
|
+
}),
|
|
1735
|
+
new Promise(
|
|
1736
|
+
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
|
1737
|
+
)
|
|
1738
|
+
]);
|
|
1739
|
+
}
|
|
1740
|
+
/** Create user activity */
|
|
1741
|
+
createActiviy(bearerToken, body, options = {}) {
|
|
1742
|
+
if (body === null || body === void 0) {
|
|
1743
|
+
throw new Error("'body' is a required parameter but is null or undefined.");
|
|
1744
|
+
}
|
|
1745
|
+
const urlPath = "/v2/activity";
|
|
1746
|
+
const queryParams = /* @__PURE__ */ new Map();
|
|
1747
|
+
let bodyJson = "";
|
|
1748
|
+
bodyJson = JSON.stringify(body || {});
|
|
1749
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
|
1750
|
+
const fetchOptions = buildFetchOptions("POST", options, bodyJson);
|
|
1751
|
+
if (bearerToken) {
|
|
1752
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
|
1753
|
+
}
|
|
1754
|
+
return Promise.race([
|
|
1755
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
|
1756
|
+
if (response.status == 204) {
|
|
1757
|
+
return response;
|
|
1758
|
+
} else if (response.status >= 200 && response.status < 300) {
|
|
1759
|
+
return response.json();
|
|
1760
|
+
} else {
|
|
1761
|
+
throw response;
|
|
1762
|
+
}
|
|
1763
|
+
}),
|
|
1764
|
+
new Promise(
|
|
1765
|
+
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
|
1766
|
+
)
|
|
1767
|
+
]);
|
|
1768
|
+
}
|
|
1715
1769
|
/** Add a new apps. */
|
|
1716
1770
|
addApp(bearerToken, body, options = {}) {
|
|
1717
1771
|
if (body === null || body === void 0) {
|
|
@@ -2063,6 +2117,37 @@ var MezonApi = class {
|
|
|
2063
2117
|
]);
|
|
2064
2118
|
}
|
|
2065
2119
|
/** */
|
|
2120
|
+
getChannelCanvasList(bearerToken, channelId, clanId, limit, page, options = {}) {
|
|
2121
|
+
if (channelId === null || channelId === void 0) {
|
|
2122
|
+
throw new Error("'channelId' is a required parameter but is null or undefined.");
|
|
2123
|
+
}
|
|
2124
|
+
const urlPath = "/v2/channel-canvases/{channelId}".replace("{channelId}", encodeURIComponent(String(channelId)));
|
|
2125
|
+
const queryParams = /* @__PURE__ */ new Map();
|
|
2126
|
+
queryParams.set("clan_id", clanId);
|
|
2127
|
+
queryParams.set("limit", limit);
|
|
2128
|
+
queryParams.set("page", page);
|
|
2129
|
+
let bodyJson = "";
|
|
2130
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
|
2131
|
+
const fetchOptions = buildFetchOptions("GET", options, bodyJson);
|
|
2132
|
+
if (bearerToken) {
|
|
2133
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
|
2134
|
+
}
|
|
2135
|
+
return Promise.race([
|
|
2136
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
|
2137
|
+
if (response.status == 204) {
|
|
2138
|
+
return response;
|
|
2139
|
+
} else if (response.status >= 200 && response.status < 300) {
|
|
2140
|
+
return response.json();
|
|
2141
|
+
} else {
|
|
2142
|
+
throw response;
|
|
2143
|
+
}
|
|
2144
|
+
}),
|
|
2145
|
+
new Promise(
|
|
2146
|
+
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
|
2147
|
+
)
|
|
2148
|
+
]);
|
|
2149
|
+
}
|
|
2150
|
+
/** */
|
|
2066
2151
|
addChannelFavorite(bearerToken, body, options = {}) {
|
|
2067
2152
|
if (body === null || body === void 0) {
|
|
2068
2153
|
throw new Error("'body' is a required parameter but is null or undefined.");
|
|
@@ -5846,42 +5931,6 @@ var MezonApi = class {
|
|
|
5846
5931
|
]);
|
|
5847
5932
|
}
|
|
5848
5933
|
/** */
|
|
5849
|
-
getChannelCanvasList(bearerToken, channelId, clanId, limit, page, options = {}) {
|
|
5850
|
-
if (channelId === null || channelId === void 0) {
|
|
5851
|
-
throw new Error(
|
|
5852
|
-
"'channelId' is a required parameter but is null or undefined."
|
|
5853
|
-
);
|
|
5854
|
-
}
|
|
5855
|
-
const urlPath = "/v2/channel_canvases/{channelId}".replace(
|
|
5856
|
-
"{channelId}",
|
|
5857
|
-
encodeURIComponent(String(channelId))
|
|
5858
|
-
);
|
|
5859
|
-
const queryParams = /* @__PURE__ */ new Map();
|
|
5860
|
-
queryParams.set("clan_id", clanId);
|
|
5861
|
-
queryParams.set("limit", limit);
|
|
5862
|
-
queryParams.set("page", page);
|
|
5863
|
-
let bodyJson = "";
|
|
5864
|
-
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
|
5865
|
-
const fetchOptions = buildFetchOptions("GET", options, bodyJson);
|
|
5866
|
-
if (bearerToken) {
|
|
5867
|
-
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
|
5868
|
-
}
|
|
5869
|
-
return Promise.race([
|
|
5870
|
-
fetch(fullUrl, fetchOptions).then((response) => {
|
|
5871
|
-
if (response.status == 204) {
|
|
5872
|
-
return response;
|
|
5873
|
-
} else if (response.status >= 200 && response.status < 300) {
|
|
5874
|
-
return response.json();
|
|
5875
|
-
} else {
|
|
5876
|
-
throw response;
|
|
5877
|
-
}
|
|
5878
|
-
}),
|
|
5879
|
-
new Promise(
|
|
5880
|
-
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
|
5881
|
-
)
|
|
5882
|
-
]);
|
|
5883
|
-
}
|
|
5884
|
-
/** */
|
|
5885
5934
|
deleteChannelCanvas(bearerToken, canvasId, clanId, channelId, options = {}) {
|
|
5886
5935
|
if (canvasId === null || canvasId === void 0) {
|
|
5887
5936
|
throw new Error(
|
|
@@ -8894,4 +8943,25 @@ var Client = class {
|
|
|
8894
8943
|
});
|
|
8895
8944
|
});
|
|
8896
8945
|
}
|
|
8946
|
+
/** List activity */
|
|
8947
|
+
listActivity(session) {
|
|
8948
|
+
return __async(this, null, function* () {
|
|
8949
|
+
if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
|
|
8950
|
+
yield this.sessionRefresh(session);
|
|
8951
|
+
}
|
|
8952
|
+
return this.apiClient.listActivity(session.token).then((response) => {
|
|
8953
|
+
return response;
|
|
8954
|
+
});
|
|
8955
|
+
});
|
|
8956
|
+
}
|
|
8957
|
+
createActiviy(session, request) {
|
|
8958
|
+
return __async(this, null, function* () {
|
|
8959
|
+
if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
|
|
8960
|
+
yield this.sessionRefresh(session);
|
|
8961
|
+
}
|
|
8962
|
+
return this.apiClient.createActiviy(session.token, request).then((response) => {
|
|
8963
|
+
return response;
|
|
8964
|
+
});
|
|
8965
|
+
});
|
|
8966
|
+
}
|
|
8897
8967
|
};
|
package/dist/mezon-js.esm.mjs
CHANGED
|
@@ -1683,6 +1683,60 @@ var MezonApi = class {
|
|
|
1683
1683
|
)
|
|
1684
1684
|
]);
|
|
1685
1685
|
}
|
|
1686
|
+
/** List activity */
|
|
1687
|
+
listActivity(bearerToken, options = {}) {
|
|
1688
|
+
const urlPath = "/v2/activity";
|
|
1689
|
+
const queryParams = /* @__PURE__ */ new Map();
|
|
1690
|
+
let bodyJson = "";
|
|
1691
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
|
1692
|
+
const fetchOptions = buildFetchOptions("GET", options, bodyJson);
|
|
1693
|
+
if (bearerToken) {
|
|
1694
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
|
1695
|
+
}
|
|
1696
|
+
return Promise.race([
|
|
1697
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
|
1698
|
+
if (response.status == 204) {
|
|
1699
|
+
return response;
|
|
1700
|
+
} else if (response.status >= 200 && response.status < 300) {
|
|
1701
|
+
return response.json();
|
|
1702
|
+
} else {
|
|
1703
|
+
throw response;
|
|
1704
|
+
}
|
|
1705
|
+
}),
|
|
1706
|
+
new Promise(
|
|
1707
|
+
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
|
1708
|
+
)
|
|
1709
|
+
]);
|
|
1710
|
+
}
|
|
1711
|
+
/** Create user activity */
|
|
1712
|
+
createActiviy(bearerToken, body, options = {}) {
|
|
1713
|
+
if (body === null || body === void 0) {
|
|
1714
|
+
throw new Error("'body' is a required parameter but is null or undefined.");
|
|
1715
|
+
}
|
|
1716
|
+
const urlPath = "/v2/activity";
|
|
1717
|
+
const queryParams = /* @__PURE__ */ new Map();
|
|
1718
|
+
let bodyJson = "";
|
|
1719
|
+
bodyJson = JSON.stringify(body || {});
|
|
1720
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
|
1721
|
+
const fetchOptions = buildFetchOptions("POST", options, bodyJson);
|
|
1722
|
+
if (bearerToken) {
|
|
1723
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
|
1724
|
+
}
|
|
1725
|
+
return Promise.race([
|
|
1726
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
|
1727
|
+
if (response.status == 204) {
|
|
1728
|
+
return response;
|
|
1729
|
+
} else if (response.status >= 200 && response.status < 300) {
|
|
1730
|
+
return response.json();
|
|
1731
|
+
} else {
|
|
1732
|
+
throw response;
|
|
1733
|
+
}
|
|
1734
|
+
}),
|
|
1735
|
+
new Promise(
|
|
1736
|
+
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
|
1737
|
+
)
|
|
1738
|
+
]);
|
|
1739
|
+
}
|
|
1686
1740
|
/** Add a new apps. */
|
|
1687
1741
|
addApp(bearerToken, body, options = {}) {
|
|
1688
1742
|
if (body === null || body === void 0) {
|
|
@@ -2034,6 +2088,37 @@ var MezonApi = class {
|
|
|
2034
2088
|
]);
|
|
2035
2089
|
}
|
|
2036
2090
|
/** */
|
|
2091
|
+
getChannelCanvasList(bearerToken, channelId, clanId, limit, page, options = {}) {
|
|
2092
|
+
if (channelId === null || channelId === void 0) {
|
|
2093
|
+
throw new Error("'channelId' is a required parameter but is null or undefined.");
|
|
2094
|
+
}
|
|
2095
|
+
const urlPath = "/v2/channel-canvases/{channelId}".replace("{channelId}", encodeURIComponent(String(channelId)));
|
|
2096
|
+
const queryParams = /* @__PURE__ */ new Map();
|
|
2097
|
+
queryParams.set("clan_id", clanId);
|
|
2098
|
+
queryParams.set("limit", limit);
|
|
2099
|
+
queryParams.set("page", page);
|
|
2100
|
+
let bodyJson = "";
|
|
2101
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
|
2102
|
+
const fetchOptions = buildFetchOptions("GET", options, bodyJson);
|
|
2103
|
+
if (bearerToken) {
|
|
2104
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
|
2105
|
+
}
|
|
2106
|
+
return Promise.race([
|
|
2107
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
|
2108
|
+
if (response.status == 204) {
|
|
2109
|
+
return response;
|
|
2110
|
+
} else if (response.status >= 200 && response.status < 300) {
|
|
2111
|
+
return response.json();
|
|
2112
|
+
} else {
|
|
2113
|
+
throw response;
|
|
2114
|
+
}
|
|
2115
|
+
}),
|
|
2116
|
+
new Promise(
|
|
2117
|
+
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
|
2118
|
+
)
|
|
2119
|
+
]);
|
|
2120
|
+
}
|
|
2121
|
+
/** */
|
|
2037
2122
|
addChannelFavorite(bearerToken, body, options = {}) {
|
|
2038
2123
|
if (body === null || body === void 0) {
|
|
2039
2124
|
throw new Error("'body' is a required parameter but is null or undefined.");
|
|
@@ -5817,42 +5902,6 @@ var MezonApi = class {
|
|
|
5817
5902
|
]);
|
|
5818
5903
|
}
|
|
5819
5904
|
/** */
|
|
5820
|
-
getChannelCanvasList(bearerToken, channelId, clanId, limit, page, options = {}) {
|
|
5821
|
-
if (channelId === null || channelId === void 0) {
|
|
5822
|
-
throw new Error(
|
|
5823
|
-
"'channelId' is a required parameter but is null or undefined."
|
|
5824
|
-
);
|
|
5825
|
-
}
|
|
5826
|
-
const urlPath = "/v2/channel_canvases/{channelId}".replace(
|
|
5827
|
-
"{channelId}",
|
|
5828
|
-
encodeURIComponent(String(channelId))
|
|
5829
|
-
);
|
|
5830
|
-
const queryParams = /* @__PURE__ */ new Map();
|
|
5831
|
-
queryParams.set("clan_id", clanId);
|
|
5832
|
-
queryParams.set("limit", limit);
|
|
5833
|
-
queryParams.set("page", page);
|
|
5834
|
-
let bodyJson = "";
|
|
5835
|
-
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
|
5836
|
-
const fetchOptions = buildFetchOptions("GET", options, bodyJson);
|
|
5837
|
-
if (bearerToken) {
|
|
5838
|
-
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
|
5839
|
-
}
|
|
5840
|
-
return Promise.race([
|
|
5841
|
-
fetch(fullUrl, fetchOptions).then((response) => {
|
|
5842
|
-
if (response.status == 204) {
|
|
5843
|
-
return response;
|
|
5844
|
-
} else if (response.status >= 200 && response.status < 300) {
|
|
5845
|
-
return response.json();
|
|
5846
|
-
} else {
|
|
5847
|
-
throw response;
|
|
5848
|
-
}
|
|
5849
|
-
}),
|
|
5850
|
-
new Promise(
|
|
5851
|
-
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
|
5852
|
-
)
|
|
5853
|
-
]);
|
|
5854
|
-
}
|
|
5855
|
-
/** */
|
|
5856
5905
|
deleteChannelCanvas(bearerToken, canvasId, clanId, channelId, options = {}) {
|
|
5857
5906
|
if (canvasId === null || canvasId === void 0) {
|
|
5858
5907
|
throw new Error(
|
|
@@ -8865,6 +8914,27 @@ var Client = class {
|
|
|
8865
8914
|
});
|
|
8866
8915
|
});
|
|
8867
8916
|
}
|
|
8917
|
+
/** List activity */
|
|
8918
|
+
listActivity(session) {
|
|
8919
|
+
return __async(this, null, function* () {
|
|
8920
|
+
if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
|
|
8921
|
+
yield this.sessionRefresh(session);
|
|
8922
|
+
}
|
|
8923
|
+
return this.apiClient.listActivity(session.token).then((response) => {
|
|
8924
|
+
return response;
|
|
8925
|
+
});
|
|
8926
|
+
});
|
|
8927
|
+
}
|
|
8928
|
+
createActiviy(session, request) {
|
|
8929
|
+
return __async(this, null, function* () {
|
|
8930
|
+
if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
|
|
8931
|
+
yield this.sessionRefresh(session);
|
|
8932
|
+
}
|
|
8933
|
+
return this.apiClient.createActiviy(session.token, request).then((response) => {
|
|
8934
|
+
return response;
|
|
8935
|
+
});
|
|
8936
|
+
});
|
|
8937
|
+
}
|
|
8868
8938
|
};
|
|
8869
8939
|
export {
|
|
8870
8940
|
ChannelStreamMode,
|