mezon-js 2.12.69 → 2.12.71
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 +19 -125
- package/client.ts +4 -44
- package/dist/api.gen.d.ts +1 -14
- package/dist/client.d.ts +2 -6
- package/dist/mezon-js.cjs.js +9 -105
- package/dist/mezon-js.esm.mjs +9 -105
- package/package.json +1 -1
package/api.gen.ts
CHANGED
@@ -954,22 +954,6 @@ export interface ApiClanDescList {
|
|
954
954
|
clandesc?: Array<ApiClanDesc>;
|
955
955
|
}
|
956
956
|
|
957
|
-
/** */
|
958
|
-
export interface ApiClanDescProfile {
|
959
|
-
//
|
960
|
-
avatar_url?: string;
|
961
|
-
//
|
962
|
-
clan_id?: string;
|
963
|
-
//
|
964
|
-
creator_id?: string;
|
965
|
-
//
|
966
|
-
nick_name?: string;
|
967
|
-
//
|
968
|
-
profile_banner?: string;
|
969
|
-
//
|
970
|
-
profile_theme?: string;
|
971
|
-
}
|
972
|
-
|
973
957
|
/** */
|
974
958
|
export interface ApiClanEmoji {
|
975
959
|
//
|
@@ -4714,38 +4698,37 @@ export class MezonApi {
|
|
4714
4698
|
}
|
4715
4699
|
|
4716
4700
|
/** List all attachment that are part of a channel. */
|
4717
|
-
listChannelAttachment(
|
4718
|
-
|
4719
|
-
|
4720
|
-
|
4721
|
-
|
4722
|
-
|
4723
|
-
|
4724
|
-
|
4725
|
-
|
4726
|
-
|
4701
|
+
listChannelAttachment(bearerToken: string,
|
4702
|
+
channelId:string,
|
4703
|
+
clanId?:string,
|
4704
|
+
fileType?:string,
|
4705
|
+
limit?:number,
|
4706
|
+
state?:number,
|
4707
|
+
before?:number,
|
4708
|
+
after?:number,
|
4709
|
+
around?:number,
|
4710
|
+
options: any = {}): Promise<ApiChannelAttachmentList> {
|
4711
|
+
|
4727
4712
|
if (channelId === null || channelId === undefined) {
|
4728
|
-
throw new Error(
|
4729
|
-
"'channelId' is a required parameter but is null or undefined."
|
4730
|
-
);
|
4713
|
+
throw new Error("'channelId' is a required parameter but is null or undefined.");
|
4731
4714
|
}
|
4732
|
-
const urlPath = "/v2/channel/{channelId}/attachment"
|
4733
|
-
|
4734
|
-
encodeURIComponent(String(channelId))
|
4735
|
-
);
|
4715
|
+
const urlPath = "/v2/channel/{channelId}/attachment"
|
4716
|
+
.replace("{channelId}", encodeURIComponent(String(channelId)));
|
4736
4717
|
const queryParams = new Map<string, any>();
|
4737
4718
|
queryParams.set("clan_id", clanId);
|
4738
4719
|
queryParams.set("file_type", fileType);
|
4739
4720
|
queryParams.set("limit", limit);
|
4740
4721
|
queryParams.set("state", state);
|
4741
|
-
queryParams.set("
|
4722
|
+
queryParams.set("before", before);
|
4723
|
+
queryParams.set("after", after);
|
4724
|
+
queryParams.set("around", around);
|
4742
4725
|
|
4743
|
-
let bodyJson: string = "";
|
4726
|
+
let bodyJson : string = "";
|
4744
4727
|
|
4745
4728
|
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
4746
4729
|
const fetchOptions = buildFetchOptions("GET", options, bodyJson);
|
4747
4730
|
if (bearerToken) {
|
4748
|
-
|
4731
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
4749
4732
|
}
|
4750
4733
|
|
4751
4734
|
return Promise.race([
|
@@ -5590,95 +5573,6 @@ export class MezonApi {
|
|
5590
5573
|
]);
|
5591
5574
|
}
|
5592
5575
|
|
5593
|
-
/** Get a clan desc profile */
|
5594
|
-
getClanDescProfile(
|
5595
|
-
bearerToken: string,
|
5596
|
-
clanId: string,
|
5597
|
-
options: any = {}
|
5598
|
-
): Promise<ApiClanDescProfile> {
|
5599
|
-
if (clanId === null || clanId === undefined) {
|
5600
|
-
throw new Error(
|
5601
|
-
"'clanId' is a required parameter but is null or undefined."
|
5602
|
-
);
|
5603
|
-
}
|
5604
|
-
const urlPath = "/v2/clandescprofile/{clanId}".replace(
|
5605
|
-
"{clanId}",
|
5606
|
-
encodeURIComponent(String(clanId))
|
5607
|
-
);
|
5608
|
-
const queryParams = new Map<string, any>();
|
5609
|
-
|
5610
|
-
let bodyJson: string = "";
|
5611
|
-
|
5612
|
-
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
5613
|
-
const fetchOptions = buildFetchOptions("GET", options, bodyJson);
|
5614
|
-
if (bearerToken) {
|
5615
|
-
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
5616
|
-
}
|
5617
|
-
|
5618
|
-
return Promise.race([
|
5619
|
-
fetch(fullUrl, fetchOptions).then((response) => {
|
5620
|
-
if (response.status == 204) {
|
5621
|
-
return response;
|
5622
|
-
} else if (response.status >= 200 && response.status < 300) {
|
5623
|
-
return response.json();
|
5624
|
-
} else {
|
5625
|
-
throw response;
|
5626
|
-
}
|
5627
|
-
}),
|
5628
|
-
new Promise((_, reject) =>
|
5629
|
-
setTimeout(reject, this.timeoutMs, "Request timed out.")
|
5630
|
-
),
|
5631
|
-
]);
|
5632
|
-
}
|
5633
|
-
|
5634
|
-
/** Update fields in a given clan profile. */
|
5635
|
-
updateClanDescProfile(
|
5636
|
-
bearerToken: string,
|
5637
|
-
clanId: string,
|
5638
|
-
body: {},
|
5639
|
-
options: any = {}
|
5640
|
-
): Promise<any> {
|
5641
|
-
if (clanId === null || clanId === undefined) {
|
5642
|
-
throw new Error(
|
5643
|
-
"'clanId' is a required parameter but is null or undefined."
|
5644
|
-
);
|
5645
|
-
}
|
5646
|
-
if (body === null || body === undefined) {
|
5647
|
-
throw new Error(
|
5648
|
-
"'body' is a required parameter but is null or undefined."
|
5649
|
-
);
|
5650
|
-
}
|
5651
|
-
const urlPath = "/v2/clandescprofile/{clanId}".replace(
|
5652
|
-
"{clanId}",
|
5653
|
-
encodeURIComponent(String(clanId))
|
5654
|
-
);
|
5655
|
-
const queryParams = new Map<string, any>();
|
5656
|
-
|
5657
|
-
let bodyJson: string = "";
|
5658
|
-
bodyJson = JSON.stringify(body || {});
|
5659
|
-
|
5660
|
-
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
5661
|
-
const fetchOptions = buildFetchOptions("PUT", options, bodyJson);
|
5662
|
-
if (bearerToken) {
|
5663
|
-
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
5664
|
-
}
|
5665
|
-
|
5666
|
-
return Promise.race([
|
5667
|
-
fetch(fullUrl, fetchOptions).then((response) => {
|
5668
|
-
if (response.status == 204) {
|
5669
|
-
return response;
|
5670
|
-
} else if (response.status >= 200 && response.status < 300) {
|
5671
|
-
return response.json();
|
5672
|
-
} else {
|
5673
|
-
throw response;
|
5674
|
-
}
|
5675
|
-
}),
|
5676
|
-
new Promise((_, reject) =>
|
5677
|
-
setTimeout(reject, this.timeoutMs, "Request timed out.")
|
5678
|
-
),
|
5679
|
-
]);
|
5680
|
-
}
|
5681
|
-
|
5682
5576
|
/** */
|
5683
5577
|
createCategoryDesc(
|
5684
5578
|
bearerToken: string,
|
package/client.ts
CHANGED
@@ -43,7 +43,6 @@ import {
|
|
43
43
|
ApiUsers,
|
44
44
|
MezonApi,
|
45
45
|
ApiSession,
|
46
|
-
ApiClanDescProfile,
|
47
46
|
ApiClanProfile,
|
48
47
|
ApiChannelUserList,
|
49
48
|
ApiClanUserList,
|
@@ -1436,7 +1435,8 @@ export class Client {
|
|
1436
1435
|
fileType: string,
|
1437
1436
|
state?: number,
|
1438
1437
|
limit?: number,
|
1439
|
-
|
1438
|
+
before?: number,
|
1439
|
+
after?: number,
|
1440
1440
|
): Promise<ApiChannelAttachmentList> {
|
1441
1441
|
if (
|
1442
1442
|
this.autoRefreshSession &&
|
@@ -1454,7 +1454,8 @@ export class Client {
|
|
1454
1454
|
fileType,
|
1455
1455
|
limit,
|
1456
1456
|
state,
|
1457
|
-
|
1457
|
+
before,
|
1458
|
+
after,
|
1458
1459
|
)
|
1459
1460
|
.then((response: ApiChannelAttachmentList) => {
|
1460
1461
|
var result: ApiChannelAttachmentList = {
|
@@ -1744,26 +1745,6 @@ export class Client {
|
|
1744
1745
|
});
|
1745
1746
|
}
|
1746
1747
|
|
1747
|
-
/** Get a clan desc profile */
|
1748
|
-
async getClanDescProfile(
|
1749
|
-
session: Session,
|
1750
|
-
clanId: string
|
1751
|
-
): Promise<ApiClanDescProfile> {
|
1752
|
-
if (
|
1753
|
-
this.autoRefreshSession &&
|
1754
|
-
session.refresh_token &&
|
1755
|
-
session.isexpired(Date.now() / 1000)
|
1756
|
-
) {
|
1757
|
-
await this.sessionRefresh(session);
|
1758
|
-
}
|
1759
|
-
|
1760
|
-
return this.apiClient
|
1761
|
-
.getClanDescProfile(session.token, clanId)
|
1762
|
-
.then((response: ApiClanDescProfile) => {
|
1763
|
-
return Promise.resolve(response);
|
1764
|
-
});
|
1765
|
-
}
|
1766
|
-
|
1767
1748
|
async getUserProfileOnClan(
|
1768
1749
|
session: Session,
|
1769
1750
|
clanId: string
|
@@ -2231,27 +2212,6 @@ export class Client {
|
|
2231
2212
|
});
|
2232
2213
|
}
|
2233
2214
|
|
2234
|
-
/** Update fields in a given clan profile. */
|
2235
|
-
async updateClanDescProfile(
|
2236
|
-
session: Session,
|
2237
|
-
clanId: string,
|
2238
|
-
request: ApiUpdateClanDescProfileRequest
|
2239
|
-
): Promise<boolean> {
|
2240
|
-
if (
|
2241
|
-
this.autoRefreshSession &&
|
2242
|
-
session.refresh_token &&
|
2243
|
-
session.isexpired(Date.now() / 1000)
|
2244
|
-
) {
|
2245
|
-
await this.sessionRefresh(session);
|
2246
|
-
}
|
2247
|
-
|
2248
|
-
return this.apiClient
|
2249
|
-
.updateClanDescProfile(session.token, clanId, request)
|
2250
|
-
.then((response: any) => {
|
2251
|
-
return response !== undefined;
|
2252
|
-
});
|
2253
|
-
}
|
2254
|
-
|
2255
2215
|
async updateUserProfileByClan(
|
2256
2216
|
session: Session,
|
2257
2217
|
clanId: string,
|
package/dist/api.gen.d.ts
CHANGED
@@ -541,15 +541,6 @@ export interface ApiClanDescList {
|
|
541
541
|
clandesc?: Array<ApiClanDesc>;
|
542
542
|
}
|
543
543
|
/** */
|
544
|
-
export interface ApiClanDescProfile {
|
545
|
-
avatar_url?: string;
|
546
|
-
clan_id?: string;
|
547
|
-
creator_id?: string;
|
548
|
-
nick_name?: string;
|
549
|
-
profile_banner?: string;
|
550
|
-
profile_theme?: string;
|
551
|
-
}
|
552
|
-
/** */
|
553
544
|
export interface ApiClanEmoji {
|
554
545
|
category?: string;
|
555
546
|
clan_id?: string;
|
@@ -1986,7 +1977,7 @@ export declare class MezonApi {
|
|
1986
1977
|
/** Add users to a channel. */
|
1987
1978
|
addChannelUsers(bearerToken: string, channelId: string, userIds?: Array<string>, options?: any): Promise<any>;
|
1988
1979
|
/** List all attachment that are part of a channel. */
|
1989
|
-
listChannelAttachment(bearerToken: string, channelId: string, clanId?: string, fileType?: string, limit?: number, state?: number,
|
1980
|
+
listChannelAttachment(bearerToken: string, channelId: string, clanId?: string, fileType?: string, limit?: number, state?: number, before?: number, after?: number, around?: number, options?: any): Promise<ApiChannelAttachmentList>;
|
1990
1981
|
/** get channel encryption method */
|
1991
1982
|
getChanEncryptionMethod(bearerToken: string, channelId: string, method?: string, options?: any): Promise<ApiChanEncryptionMethod>;
|
1992
1983
|
/** store channel encryption method */
|
@@ -2025,10 +2016,6 @@ export declare class MezonApi {
|
|
2025
2016
|
listClanUsers(bearerToken: string, clanId: string, options?: any): Promise<ApiClanUserList>;
|
2026
2017
|
/** check duplicate clan name */
|
2027
2018
|
checkDuplicateClanName(bearerToken: string, clanName: string, options?: any): Promise<ApiCheckDuplicateClanNameResponse>;
|
2028
|
-
/** Get a clan desc profile */
|
2029
|
-
getClanDescProfile(bearerToken: string, clanId: string, options?: any): Promise<ApiClanDescProfile>;
|
2030
|
-
/** Update fields in a given clan profile. */
|
2031
|
-
updateClanDescProfile(bearerToken: string, clanId: string, body: {}, options?: any): Promise<any>;
|
2032
2019
|
/** */
|
2033
2020
|
createCategoryDesc(bearerToken: string, body: ApiCreateCategoryDescRequest, options?: any): Promise<ApiCategoryDesc>;
|
2034
2021
|
/** */
|
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, ApiAccountEmail, ApiChannelDescList, ApiChannelDescription, ApiCreateChannelDescRequest, ApiDeleteRoleRequest, ApiClanDescList, ApiCreateClanDescRequest, ApiClanDesc, ApiCategoryDesc, ApiCategoryDescList, ApiPermissionList, ApiRoleUserList, ApiRole, ApiCreateRoleRequest, ApiAddRoleChannelDescRequest, ApiCreateCategoryDescRequest, ApiUpdateCategoryDescRequest, ApiEvent, ApiNotificationList, ApiUpdateAccountRequest, ApiSession,
|
16
|
+
import { ApiAccount, ApiAccountMezon, ApiAccountEmail, ApiChannelDescList, ApiChannelDescription, ApiCreateChannelDescRequest, ApiDeleteRoleRequest, ApiClanDescList, ApiCreateClanDescRequest, ApiClanDesc, ApiCategoryDesc, ApiCategoryDescList, ApiPermissionList, ApiRoleUserList, ApiRole, ApiCreateRoleRequest, ApiAddRoleChannelDescRequest, ApiCreateCategoryDescRequest, ApiUpdateCategoryDescRequest, ApiEvent, ApiNotificationList, ApiUpdateAccountRequest, ApiSession, 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, ApiListOnboardingResponse, ApiCreateOnboardingRequest, MezonUpdateOnboardingBody, ApiOnboardingItem, ApiGenerateClanWebhookRequest, ApiGenerateClanWebhookResponse, ApiListClanWebhookResponse, MezonUpdateClanWebhookByIdBody, MezonUpdateClanDescBody, ApiUserStatusUpdate, ApiUserStatus, ApiListOnboardingStepResponse, MezonUpdateOnboardingStepByClanIdBody, ApiWalletLedgerList, ApiSdTopicList, ApiSdTopicRequest, ApiSdTopic, MezonUpdateEventBody, ApiTransactionDetail, MezonapiCreateRoomChannelApps, ApiGenerateMeetTokenRequest, ApiGenerateMeetTokenResponse, ApiMezonOauthClientList, ApiMezonOauthClient, ApiCreateHashChannelAppsResponse, ApiEmojiRecentList, ApiUserEventRequest, ApiUpdateRoleOrderRequest, ApiGenerateMezonMeetResponse, ApiGenerateMeetTokenExternalResponse, ApiUpdateClanOrderRequest, ApiMessage2InboxRequest, ApiListClanDiscover, ApiClanDiscoverRequest, ApiQuickMenuAccessList, ApiQuickMenuAccessRequest, ApiUnlockedItemRequest, ApiForSaleItemList, ApiUnlockedItemResponse, ApiIsFollowerResponse, ApiIsFollowerRequest, ApiTransferOwnershipRequest } from "./api.gen";
|
17
17
|
import { Session } from "./session";
|
18
18
|
import { Socket } from "./socket";
|
19
19
|
import { WebSocketAdapter } from "./web_socket_adapter";
|
@@ -409,7 +409,7 @@ export declare class Client {
|
|
409
409
|
/** List a channel's users. */
|
410
410
|
listChannelUsers(session: Session, clanId: string, channelId: string, channelType: number, state?: number, limit?: number, cursor?: string): Promise<ApiChannelUserList>;
|
411
411
|
/** List a channel's attachment. */
|
412
|
-
listChannelAttachments(session: Session, clanId: string, channelId: string, fileType: string, state?: number, limit?: number,
|
412
|
+
listChannelAttachments(session: Session, clanId: string, channelId: string, fileType: string, state?: number, limit?: number, before?: number, after?: number): Promise<ApiChannelAttachmentList>;
|
413
413
|
/** List a channel's users. */
|
414
414
|
listClanUsers(session: Session, clanId: string): Promise<ApiClanUserList>;
|
415
415
|
/** List channels. */
|
@@ -427,8 +427,6 @@ export declare class Client {
|
|
427
427
|
/** List user roles */
|
428
428
|
listRoleUsers(session: Session, roleId: string, limit?: number, cursor?: string): Promise<ApiRoleUserList>;
|
429
429
|
registFCMDeviceToken(session: Session, tokenId: string, deviceId: string, platform: string, voipToken?: string): Promise<ApiRegistFcmDeviceTokenResponse>;
|
430
|
-
/** Get a clan desc profile */
|
431
|
-
getClanDescProfile(session: Session, clanId: string): Promise<ApiClanDescProfile>;
|
432
430
|
getUserProfileOnClan(session: Session, clanId: string): Promise<ApiClanProfile>;
|
433
431
|
closeDirectMess(session: Session, request: ApiDeleteChannelDescRequest): Promise<boolean>;
|
434
432
|
openDirectMess(session: Session, request: ApiDeleteChannelDescRequest): Promise<boolean>;
|
@@ -460,8 +458,6 @@ export declare class Client {
|
|
460
458
|
updateClanDesc(session: Session, clanId: string, request: MezonUpdateClanDescBody): Promise<boolean>;
|
461
459
|
/** Update fields in a given category. */
|
462
460
|
updateCategory(session: Session, clanId: string, request: ApiUpdateCategoryDescRequest): Promise<boolean>;
|
463
|
-
/** Update fields in a given clan profile. */
|
464
|
-
updateClanDescProfile(session: Session, clanId: string, request: ApiUpdateClanDescProfileRequest): Promise<boolean>;
|
465
461
|
updateUserProfileByClan(session: Session, clanId: string, request: ApiUpdateClanProfileRequest): Promise<boolean>;
|
466
462
|
/** Update fields in a given role. */
|
467
463
|
updateRole(session: Session, roleId: string, request: ApiUpdateRoleRequest): Promise<boolean>;
|
package/dist/mezon-js.cjs.js
CHANGED
@@ -1813,22 +1813,19 @@ var MezonApi = class {
|
|
1813
1813
|
]);
|
1814
1814
|
}
|
1815
1815
|
/** List all attachment that are part of a channel. */
|
1816
|
-
listChannelAttachment(bearerToken, channelId, clanId, fileType, limit, state,
|
1816
|
+
listChannelAttachment(bearerToken, channelId, clanId, fileType, limit, state, before, after, around, options = {}) {
|
1817
1817
|
if (channelId === null || channelId === void 0) {
|
1818
|
-
throw new Error(
|
1819
|
-
"'channelId' is a required parameter but is null or undefined."
|
1820
|
-
);
|
1818
|
+
throw new Error("'channelId' is a required parameter but is null or undefined.");
|
1821
1819
|
}
|
1822
|
-
const urlPath = "/v2/channel/{channelId}/attachment".replace(
|
1823
|
-
"{channelId}",
|
1824
|
-
encodeURIComponent(String(channelId))
|
1825
|
-
);
|
1820
|
+
const urlPath = "/v2/channel/{channelId}/attachment".replace("{channelId}", encodeURIComponent(String(channelId)));
|
1826
1821
|
const queryParams = /* @__PURE__ */ new Map();
|
1827
1822
|
queryParams.set("clan_id", clanId);
|
1828
1823
|
queryParams.set("file_type", fileType);
|
1829
1824
|
queryParams.set("limit", limit);
|
1830
1825
|
queryParams.set("state", state);
|
1831
|
-
queryParams.set("
|
1826
|
+
queryParams.set("before", before);
|
1827
|
+
queryParams.set("after", after);
|
1828
|
+
queryParams.set("around", around);
|
1832
1829
|
let bodyJson = "";
|
1833
1830
|
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
1834
1831
|
const fetchOptions = buildFetchOptions("GET", options, bodyJson);
|
@@ -2492,78 +2489,6 @@ var MezonApi = class {
|
|
2492
2489
|
)
|
2493
2490
|
]);
|
2494
2491
|
}
|
2495
|
-
/** Get a clan desc profile */
|
2496
|
-
getClanDescProfile(bearerToken, clanId, options = {}) {
|
2497
|
-
if (clanId === null || clanId === void 0) {
|
2498
|
-
throw new Error(
|
2499
|
-
"'clanId' is a required parameter but is null or undefined."
|
2500
|
-
);
|
2501
|
-
}
|
2502
|
-
const urlPath = "/v2/clandescprofile/{clanId}".replace(
|
2503
|
-
"{clanId}",
|
2504
|
-
encodeURIComponent(String(clanId))
|
2505
|
-
);
|
2506
|
-
const queryParams = /* @__PURE__ */ new Map();
|
2507
|
-
let bodyJson = "";
|
2508
|
-
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
2509
|
-
const fetchOptions = buildFetchOptions("GET", options, bodyJson);
|
2510
|
-
if (bearerToken) {
|
2511
|
-
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
2512
|
-
}
|
2513
|
-
return Promise.race([
|
2514
|
-
fetch(fullUrl, fetchOptions).then((response) => {
|
2515
|
-
if (response.status == 204) {
|
2516
|
-
return response;
|
2517
|
-
} else if (response.status >= 200 && response.status < 300) {
|
2518
|
-
return response.json();
|
2519
|
-
} else {
|
2520
|
-
throw response;
|
2521
|
-
}
|
2522
|
-
}),
|
2523
|
-
new Promise(
|
2524
|
-
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
2525
|
-
)
|
2526
|
-
]);
|
2527
|
-
}
|
2528
|
-
/** Update fields in a given clan profile. */
|
2529
|
-
updateClanDescProfile(bearerToken, clanId, body, options = {}) {
|
2530
|
-
if (clanId === null || clanId === void 0) {
|
2531
|
-
throw new Error(
|
2532
|
-
"'clanId' is a required parameter but is null or undefined."
|
2533
|
-
);
|
2534
|
-
}
|
2535
|
-
if (body === null || body === void 0) {
|
2536
|
-
throw new Error(
|
2537
|
-
"'body' is a required parameter but is null or undefined."
|
2538
|
-
);
|
2539
|
-
}
|
2540
|
-
const urlPath = "/v2/clandescprofile/{clanId}".replace(
|
2541
|
-
"{clanId}",
|
2542
|
-
encodeURIComponent(String(clanId))
|
2543
|
-
);
|
2544
|
-
const queryParams = /* @__PURE__ */ new Map();
|
2545
|
-
let bodyJson = "";
|
2546
|
-
bodyJson = JSON.stringify(body || {});
|
2547
|
-
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
2548
|
-
const fetchOptions = buildFetchOptions("PUT", options, bodyJson);
|
2549
|
-
if (bearerToken) {
|
2550
|
-
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
2551
|
-
}
|
2552
|
-
return Promise.race([
|
2553
|
-
fetch(fullUrl, fetchOptions).then((response) => {
|
2554
|
-
if (response.status == 204) {
|
2555
|
-
return response;
|
2556
|
-
} else if (response.status >= 200 && response.status < 300) {
|
2557
|
-
return response.json();
|
2558
|
-
} else {
|
2559
|
-
throw response;
|
2560
|
-
}
|
2561
|
-
}),
|
2562
|
-
new Promise(
|
2563
|
-
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
2564
|
-
)
|
2565
|
-
]);
|
2566
|
-
}
|
2567
2492
|
/** */
|
2568
2493
|
createCategoryDesc(bearerToken, body, options = {}) {
|
2569
2494
|
if (body === null || body === void 0) {
|
@@ -8766,7 +8691,7 @@ var Client = class {
|
|
8766
8691
|
});
|
8767
8692
|
}
|
8768
8693
|
/** List a channel's attachment. */
|
8769
|
-
listChannelAttachments(session, clanId, channelId, fileType, state, limit,
|
8694
|
+
listChannelAttachments(session, clanId, channelId, fileType, state, limit, before, after) {
|
8770
8695
|
return __async(this, null, function* () {
|
8771
8696
|
if (this.autoRefreshSession && session.refresh_token && session.isexpired(Date.now() / 1e3)) {
|
8772
8697
|
yield this.sessionRefresh(session);
|
@@ -8778,7 +8703,8 @@ var Client = class {
|
|
8778
8703
|
fileType,
|
8779
8704
|
limit,
|
8780
8705
|
state,
|
8781
|
-
|
8706
|
+
before,
|
8707
|
+
after
|
8782
8708
|
).then((response) => {
|
8783
8709
|
var result = {
|
8784
8710
|
attachments: []
|
@@ -8968,17 +8894,6 @@ var Client = class {
|
|
8968
8894
|
});
|
8969
8895
|
});
|
8970
8896
|
}
|
8971
|
-
/** Get a clan desc profile */
|
8972
|
-
getClanDescProfile(session, clanId) {
|
8973
|
-
return __async(this, null, function* () {
|
8974
|
-
if (this.autoRefreshSession && session.refresh_token && session.isexpired(Date.now() / 1e3)) {
|
8975
|
-
yield this.sessionRefresh(session);
|
8976
|
-
}
|
8977
|
-
return this.apiClient.getClanDescProfile(session.token, clanId).then((response) => {
|
8978
|
-
return Promise.resolve(response);
|
8979
|
-
});
|
8980
|
-
});
|
8981
|
-
}
|
8982
8897
|
getUserProfileOnClan(session, clanId) {
|
8983
8898
|
return __async(this, null, function* () {
|
8984
8899
|
if (this.autoRefreshSession && session.refresh_token && session.isexpired(Date.now() / 1e3)) {
|
@@ -9272,17 +9187,6 @@ var Client = class {
|
|
9272
9187
|
});
|
9273
9188
|
});
|
9274
9189
|
}
|
9275
|
-
/** Update fields in a given clan profile. */
|
9276
|
-
updateClanDescProfile(session, clanId, request) {
|
9277
|
-
return __async(this, null, function* () {
|
9278
|
-
if (this.autoRefreshSession && session.refresh_token && session.isexpired(Date.now() / 1e3)) {
|
9279
|
-
yield this.sessionRefresh(session);
|
9280
|
-
}
|
9281
|
-
return this.apiClient.updateClanDescProfile(session.token, clanId, request).then((response) => {
|
9282
|
-
return response !== void 0;
|
9283
|
-
});
|
9284
|
-
});
|
9285
|
-
}
|
9286
9190
|
updateUserProfileByClan(session, clanId, request) {
|
9287
9191
|
return __async(this, null, function* () {
|
9288
9192
|
if (this.autoRefreshSession && session.refresh_token && session.isexpired(Date.now() / 1e3)) {
|
package/dist/mezon-js.esm.mjs
CHANGED
@@ -1779,22 +1779,19 @@ var MezonApi = class {
|
|
1779
1779
|
]);
|
1780
1780
|
}
|
1781
1781
|
/** List all attachment that are part of a channel. */
|
1782
|
-
listChannelAttachment(bearerToken, channelId, clanId, fileType, limit, state,
|
1782
|
+
listChannelAttachment(bearerToken, channelId, clanId, fileType, limit, state, before, after, around, options = {}) {
|
1783
1783
|
if (channelId === null || channelId === void 0) {
|
1784
|
-
throw new Error(
|
1785
|
-
"'channelId' is a required parameter but is null or undefined."
|
1786
|
-
);
|
1784
|
+
throw new Error("'channelId' is a required parameter but is null or undefined.");
|
1787
1785
|
}
|
1788
|
-
const urlPath = "/v2/channel/{channelId}/attachment".replace(
|
1789
|
-
"{channelId}",
|
1790
|
-
encodeURIComponent(String(channelId))
|
1791
|
-
);
|
1786
|
+
const urlPath = "/v2/channel/{channelId}/attachment".replace("{channelId}", encodeURIComponent(String(channelId)));
|
1792
1787
|
const queryParams = /* @__PURE__ */ new Map();
|
1793
1788
|
queryParams.set("clan_id", clanId);
|
1794
1789
|
queryParams.set("file_type", fileType);
|
1795
1790
|
queryParams.set("limit", limit);
|
1796
1791
|
queryParams.set("state", state);
|
1797
|
-
queryParams.set("
|
1792
|
+
queryParams.set("before", before);
|
1793
|
+
queryParams.set("after", after);
|
1794
|
+
queryParams.set("around", around);
|
1798
1795
|
let bodyJson = "";
|
1799
1796
|
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
1800
1797
|
const fetchOptions = buildFetchOptions("GET", options, bodyJson);
|
@@ -2458,78 +2455,6 @@ var MezonApi = class {
|
|
2458
2455
|
)
|
2459
2456
|
]);
|
2460
2457
|
}
|
2461
|
-
/** Get a clan desc profile */
|
2462
|
-
getClanDescProfile(bearerToken, clanId, options = {}) {
|
2463
|
-
if (clanId === null || clanId === void 0) {
|
2464
|
-
throw new Error(
|
2465
|
-
"'clanId' is a required parameter but is null or undefined."
|
2466
|
-
);
|
2467
|
-
}
|
2468
|
-
const urlPath = "/v2/clandescprofile/{clanId}".replace(
|
2469
|
-
"{clanId}",
|
2470
|
-
encodeURIComponent(String(clanId))
|
2471
|
-
);
|
2472
|
-
const queryParams = /* @__PURE__ */ new Map();
|
2473
|
-
let bodyJson = "";
|
2474
|
-
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
2475
|
-
const fetchOptions = buildFetchOptions("GET", options, bodyJson);
|
2476
|
-
if (bearerToken) {
|
2477
|
-
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
2478
|
-
}
|
2479
|
-
return Promise.race([
|
2480
|
-
fetch(fullUrl, fetchOptions).then((response) => {
|
2481
|
-
if (response.status == 204) {
|
2482
|
-
return response;
|
2483
|
-
} else if (response.status >= 200 && response.status < 300) {
|
2484
|
-
return response.json();
|
2485
|
-
} else {
|
2486
|
-
throw response;
|
2487
|
-
}
|
2488
|
-
}),
|
2489
|
-
new Promise(
|
2490
|
-
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
2491
|
-
)
|
2492
|
-
]);
|
2493
|
-
}
|
2494
|
-
/** Update fields in a given clan profile. */
|
2495
|
-
updateClanDescProfile(bearerToken, clanId, body, options = {}) {
|
2496
|
-
if (clanId === null || clanId === void 0) {
|
2497
|
-
throw new Error(
|
2498
|
-
"'clanId' is a required parameter but is null or undefined."
|
2499
|
-
);
|
2500
|
-
}
|
2501
|
-
if (body === null || body === void 0) {
|
2502
|
-
throw new Error(
|
2503
|
-
"'body' is a required parameter but is null or undefined."
|
2504
|
-
);
|
2505
|
-
}
|
2506
|
-
const urlPath = "/v2/clandescprofile/{clanId}".replace(
|
2507
|
-
"{clanId}",
|
2508
|
-
encodeURIComponent(String(clanId))
|
2509
|
-
);
|
2510
|
-
const queryParams = /* @__PURE__ */ new Map();
|
2511
|
-
let bodyJson = "";
|
2512
|
-
bodyJson = JSON.stringify(body || {});
|
2513
|
-
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
2514
|
-
const fetchOptions = buildFetchOptions("PUT", options, bodyJson);
|
2515
|
-
if (bearerToken) {
|
2516
|
-
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
2517
|
-
}
|
2518
|
-
return Promise.race([
|
2519
|
-
fetch(fullUrl, fetchOptions).then((response) => {
|
2520
|
-
if (response.status == 204) {
|
2521
|
-
return response;
|
2522
|
-
} else if (response.status >= 200 && response.status < 300) {
|
2523
|
-
return response.json();
|
2524
|
-
} else {
|
2525
|
-
throw response;
|
2526
|
-
}
|
2527
|
-
}),
|
2528
|
-
new Promise(
|
2529
|
-
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
2530
|
-
)
|
2531
|
-
]);
|
2532
|
-
}
|
2533
2458
|
/** */
|
2534
2459
|
createCategoryDesc(bearerToken, body, options = {}) {
|
2535
2460
|
if (body === null || body === void 0) {
|
@@ -8732,7 +8657,7 @@ var Client = class {
|
|
8732
8657
|
});
|
8733
8658
|
}
|
8734
8659
|
/** List a channel's attachment. */
|
8735
|
-
listChannelAttachments(session, clanId, channelId, fileType, state, limit,
|
8660
|
+
listChannelAttachments(session, clanId, channelId, fileType, state, limit, before, after) {
|
8736
8661
|
return __async(this, null, function* () {
|
8737
8662
|
if (this.autoRefreshSession && session.refresh_token && session.isexpired(Date.now() / 1e3)) {
|
8738
8663
|
yield this.sessionRefresh(session);
|
@@ -8744,7 +8669,8 @@ var Client = class {
|
|
8744
8669
|
fileType,
|
8745
8670
|
limit,
|
8746
8671
|
state,
|
8747
|
-
|
8672
|
+
before,
|
8673
|
+
after
|
8748
8674
|
).then((response) => {
|
8749
8675
|
var result = {
|
8750
8676
|
attachments: []
|
@@ -8934,17 +8860,6 @@ var Client = class {
|
|
8934
8860
|
});
|
8935
8861
|
});
|
8936
8862
|
}
|
8937
|
-
/** Get a clan desc profile */
|
8938
|
-
getClanDescProfile(session, clanId) {
|
8939
|
-
return __async(this, null, function* () {
|
8940
|
-
if (this.autoRefreshSession && session.refresh_token && session.isexpired(Date.now() / 1e3)) {
|
8941
|
-
yield this.sessionRefresh(session);
|
8942
|
-
}
|
8943
|
-
return this.apiClient.getClanDescProfile(session.token, clanId).then((response) => {
|
8944
|
-
return Promise.resolve(response);
|
8945
|
-
});
|
8946
|
-
});
|
8947
|
-
}
|
8948
8863
|
getUserProfileOnClan(session, clanId) {
|
8949
8864
|
return __async(this, null, function* () {
|
8950
8865
|
if (this.autoRefreshSession && session.refresh_token && session.isexpired(Date.now() / 1e3)) {
|
@@ -9238,17 +9153,6 @@ var Client = class {
|
|
9238
9153
|
});
|
9239
9154
|
});
|
9240
9155
|
}
|
9241
|
-
/** Update fields in a given clan profile. */
|
9242
|
-
updateClanDescProfile(session, clanId, request) {
|
9243
|
-
return __async(this, null, function* () {
|
9244
|
-
if (this.autoRefreshSession && session.refresh_token && session.isexpired(Date.now() / 1e3)) {
|
9245
|
-
yield this.sessionRefresh(session);
|
9246
|
-
}
|
9247
|
-
return this.apiClient.updateClanDescProfile(session.token, clanId, request).then((response) => {
|
9248
|
-
return response !== void 0;
|
9249
|
-
});
|
9250
|
-
});
|
9251
|
-
}
|
9252
9156
|
updateUserProfileByClan(session, clanId, request) {
|
9253
9157
|
return __async(this, null, function* () {
|
9254
9158
|
if (this.autoRefreshSession && session.refresh_token && session.isexpired(Date.now() / 1e3)) {
|