mezon-js 2.9.81 → 2.9.83
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 +95 -10
- package/client.ts +47 -5
- package/dist/api.gen.d.ts +17 -2
- package/dist/client.d.ts +4 -2
- package/dist/mezon-js.cjs.js +83 -7
- package/dist/mezon-js.esm.mjs +83 -7
- package/package.json +1 -1
package/api.gen.ts
CHANGED
|
@@ -2324,6 +2324,24 @@ export interface ApiUserPermissionInChannelListResponse {
|
|
|
2324
2324
|
permissions?: ApiPermissionList;
|
|
2325
2325
|
}
|
|
2326
2326
|
|
|
2327
|
+
/** */
|
|
2328
|
+
export interface ApiUserStatus {
|
|
2329
|
+
//
|
|
2330
|
+
status?: string;
|
|
2331
|
+
//
|
|
2332
|
+
user_id?: string;
|
|
2333
|
+
}
|
|
2334
|
+
|
|
2335
|
+
/** */
|
|
2336
|
+
export interface ApiUserStatusUpdate {
|
|
2337
|
+
//
|
|
2338
|
+
minutes?: number;
|
|
2339
|
+
//
|
|
2340
|
+
status?: string;
|
|
2341
|
+
//
|
|
2342
|
+
until_turn_on?: boolean;
|
|
2343
|
+
}
|
|
2344
|
+
|
|
2327
2345
|
/** A collection of zero or more users. */
|
|
2328
2346
|
export interface ApiUsers {
|
|
2329
2347
|
//The User objects.
|
|
@@ -2591,7 +2609,7 @@ export interface ApiListClanWebhookResponse {
|
|
|
2591
2609
|
}
|
|
2592
2610
|
|
|
2593
2611
|
/** */
|
|
2594
|
-
export interface
|
|
2612
|
+
export interface MezonUpdateOnboardingStepByClanIdBody {
|
|
2595
2613
|
//onboarding step.
|
|
2596
2614
|
onboarding_step?: number;
|
|
2597
2615
|
}
|
|
@@ -9397,6 +9415,73 @@ pushPubKey(bearerToken: string,
|
|
|
9397
9415
|
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
|
9398
9416
|
}
|
|
9399
9417
|
|
|
9418
|
+
return Promise.race([
|
|
9419
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
|
9420
|
+
if (response.status == 204) {
|
|
9421
|
+
return response;
|
|
9422
|
+
} else if (response.status >= 200 && response.status < 300) {
|
|
9423
|
+
return response.json();
|
|
9424
|
+
} else {
|
|
9425
|
+
throw response;
|
|
9426
|
+
}
|
|
9427
|
+
}),
|
|
9428
|
+
new Promise((_, reject) =>
|
|
9429
|
+
setTimeout(reject, this.timeoutMs, "Request timed out.")
|
|
9430
|
+
),
|
|
9431
|
+
]);
|
|
9432
|
+
}
|
|
9433
|
+
|
|
9434
|
+
/** Get user status */
|
|
9435
|
+
getUserStatus(bearerToken: string,
|
|
9436
|
+
options: any = {}): Promise<ApiUserStatus> {
|
|
9437
|
+
|
|
9438
|
+
const urlPath = "/v2/userstatus";
|
|
9439
|
+
const queryParams = new Map<string, any>();
|
|
9440
|
+
|
|
9441
|
+
let bodyJson : string = "";
|
|
9442
|
+
|
|
9443
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
|
9444
|
+
const fetchOptions = buildFetchOptions("GET", options, bodyJson);
|
|
9445
|
+
if (bearerToken) {
|
|
9446
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
|
9447
|
+
}
|
|
9448
|
+
|
|
9449
|
+
return Promise.race([
|
|
9450
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
|
9451
|
+
if (response.status == 204) {
|
|
9452
|
+
return response;
|
|
9453
|
+
} else if (response.status >= 200 && response.status < 300) {
|
|
9454
|
+
return response.json();
|
|
9455
|
+
} else {
|
|
9456
|
+
throw response;
|
|
9457
|
+
}
|
|
9458
|
+
}),
|
|
9459
|
+
new Promise((_, reject) =>
|
|
9460
|
+
setTimeout(reject, this.timeoutMs, "Request timed out.")
|
|
9461
|
+
),
|
|
9462
|
+
]);
|
|
9463
|
+
}
|
|
9464
|
+
|
|
9465
|
+
/** Update user status */
|
|
9466
|
+
updateUserStatus(bearerToken: string,
|
|
9467
|
+
body:ApiUserStatusUpdate,
|
|
9468
|
+
options: any = {}): Promise<any> {
|
|
9469
|
+
|
|
9470
|
+
if (body === null || body === undefined) {
|
|
9471
|
+
throw new Error("'body' is a required parameter but is null or undefined.");
|
|
9472
|
+
}
|
|
9473
|
+
const urlPath = "/v2/userstatus";
|
|
9474
|
+
const queryParams = new Map<string, any>();
|
|
9475
|
+
|
|
9476
|
+
let bodyJson : string = "";
|
|
9477
|
+
bodyJson = JSON.stringify(body || {});
|
|
9478
|
+
|
|
9479
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
|
9480
|
+
const fetchOptions = buildFetchOptions("PUT", options, bodyJson);
|
|
9481
|
+
if (bearerToken) {
|
|
9482
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
|
9483
|
+
}
|
|
9484
|
+
|
|
9400
9485
|
return Promise.race([
|
|
9401
9486
|
fetch(fullUrl, fetchOptions).then((response) => {
|
|
9402
9487
|
if (response.status == 204) {
|
|
@@ -10149,20 +10234,20 @@ pushPubKey(bearerToken: string,
|
|
|
10149
10234
|
]);
|
|
10150
10235
|
}
|
|
10151
10236
|
|
|
10152
|
-
/** Update onboarding step. */
|
|
10153
|
-
|
|
10154
|
-
|
|
10155
|
-
body:
|
|
10237
|
+
/** Update onboarding step. */
|
|
10238
|
+
updateOnboardingStepByClanId(bearerToken: string,
|
|
10239
|
+
clanId:string,
|
|
10240
|
+
body:MezonUpdateOnboardingStepByClanIdBody,
|
|
10156
10241
|
options: any = {}): Promise<any> {
|
|
10157
|
-
|
|
10158
|
-
if (
|
|
10159
|
-
throw new Error("'
|
|
10242
|
+
|
|
10243
|
+
if (clanId === null || clanId === undefined) {
|
|
10244
|
+
throw new Error("'clanId' is a required parameter but is null or undefined.");
|
|
10160
10245
|
}
|
|
10161
10246
|
if (body === null || body === undefined) {
|
|
10162
10247
|
throw new Error("'body' is a required parameter but is null or undefined.");
|
|
10163
10248
|
}
|
|
10164
|
-
const urlPath = "/v2/onboardingsteps/{
|
|
10165
|
-
.replace("{
|
|
10249
|
+
const urlPath = "/v2/onboardingsteps/{clanId}"
|
|
10250
|
+
.replace("{clanId}", encodeURIComponent(String(clanId)));
|
|
10166
10251
|
const queryParams = new Map<string, any>();
|
|
10167
10252
|
|
|
10168
10253
|
let bodyJson : string = "";
|
package/client.ts
CHANGED
|
@@ -149,8 +149,10 @@ import {
|
|
|
149
149
|
ApiListClanWebhookResponse,
|
|
150
150
|
MezonUpdateClanWebhookByIdBody,
|
|
151
151
|
MezonUpdateClanDescBody,
|
|
152
|
+
ApiUserStatusUpdate,
|
|
153
|
+
ApiUserStatus,
|
|
152
154
|
ApiListOnboardingStepResponse,
|
|
153
|
-
|
|
155
|
+
MezonUpdateOnboardingStepByClanIdBody,
|
|
154
156
|
} from "./api.gen";
|
|
155
157
|
|
|
156
158
|
import { Session } from "./session";
|
|
@@ -4550,7 +4552,7 @@ export class Client {
|
|
|
4550
4552
|
}
|
|
4551
4553
|
|
|
4552
4554
|
return this.apiClient
|
|
4553
|
-
.
|
|
4555
|
+
.generateClanWebhook(session.token, request)
|
|
4554
4556
|
.then((response: any) => {
|
|
4555
4557
|
return Promise.resolve(response);
|
|
4556
4558
|
});
|
|
@@ -4641,10 +4643,10 @@ export class Client {
|
|
|
4641
4643
|
}
|
|
4642
4644
|
|
|
4643
4645
|
//**update onboarding step by id */
|
|
4644
|
-
async
|
|
4646
|
+
async updateOnboardingStepByClanId(
|
|
4645
4647
|
session: Session,
|
|
4646
4648
|
id: string,
|
|
4647
|
-
request:
|
|
4649
|
+
request: MezonUpdateOnboardingStepByClanIdBody
|
|
4648
4650
|
) {
|
|
4649
4651
|
if (
|
|
4650
4652
|
this.autoRefreshSession &&
|
|
@@ -4655,9 +4657,49 @@ export class Client {
|
|
|
4655
4657
|
}
|
|
4656
4658
|
|
|
4657
4659
|
return this.apiClient
|
|
4658
|
-
.
|
|
4660
|
+
.updateOnboardingStepByClanId(session.token, id, request)
|
|
4659
4661
|
.then((response: any) => {
|
|
4660
4662
|
return response !== undefined;
|
|
4661
4663
|
});
|
|
4662
4664
|
}
|
|
4665
|
+
|
|
4666
|
+
//**update status */
|
|
4667
|
+
async updateUserStatus(
|
|
4668
|
+
session: Session,
|
|
4669
|
+
request: ApiUserStatusUpdate
|
|
4670
|
+
) {
|
|
4671
|
+
if (
|
|
4672
|
+
this.autoRefreshSession &&
|
|
4673
|
+
session.refresh_token &&
|
|
4674
|
+
session.isexpired((Date.now() + this.expiredTimespanMs) / 1000)
|
|
4675
|
+
) {
|
|
4676
|
+
await this.sessionRefresh(session);
|
|
4677
|
+
}
|
|
4678
|
+
|
|
4679
|
+
return this.apiClient
|
|
4680
|
+
.updateUserStatus(session.token, request)
|
|
4681
|
+
.then((response: any) => {
|
|
4682
|
+
return response !== undefined;
|
|
4683
|
+
});
|
|
4684
|
+
}
|
|
4685
|
+
|
|
4686
|
+
//**get user status */
|
|
4687
|
+
async getUserStatus(
|
|
4688
|
+
session: Session
|
|
4689
|
+
): Promise<ApiUserStatus> {
|
|
4690
|
+
if (
|
|
4691
|
+
this.autoRefreshSession &&
|
|
4692
|
+
session.refresh_token &&
|
|
4693
|
+
session.isexpired((Date.now() + this.expiredTimespanMs) / 1000)
|
|
4694
|
+
) {
|
|
4695
|
+
await this.sessionRefresh(session);
|
|
4696
|
+
}
|
|
4697
|
+
|
|
4698
|
+
return this.apiClient
|
|
4699
|
+
.getUserStatus(session.token)
|
|
4700
|
+
.then((response: ApiUserStatus) => {
|
|
4701
|
+
return Promise.resolve(response);
|
|
4702
|
+
});
|
|
4703
|
+
}
|
|
4704
|
+
|
|
4663
4705
|
}
|
package/dist/api.gen.d.ts
CHANGED
|
@@ -1350,6 +1350,17 @@ export interface ApiUserPermissionInChannelListResponse {
|
|
|
1350
1350
|
clan_id?: string;
|
|
1351
1351
|
permissions?: ApiPermissionList;
|
|
1352
1352
|
}
|
|
1353
|
+
/** */
|
|
1354
|
+
export interface ApiUserStatus {
|
|
1355
|
+
status?: string;
|
|
1356
|
+
user_id?: string;
|
|
1357
|
+
}
|
|
1358
|
+
/** */
|
|
1359
|
+
export interface ApiUserStatusUpdate {
|
|
1360
|
+
minutes?: number;
|
|
1361
|
+
status?: string;
|
|
1362
|
+
until_turn_on?: boolean;
|
|
1363
|
+
}
|
|
1353
1364
|
/** A collection of zero or more users. */
|
|
1354
1365
|
export interface ApiUsers {
|
|
1355
1366
|
users?: Array<ApiUser>;
|
|
@@ -1507,7 +1518,7 @@ export interface ApiListClanWebhookResponse {
|
|
|
1507
1518
|
list_clan_webhooks?: Array<ApiClanWebhook>;
|
|
1508
1519
|
}
|
|
1509
1520
|
/** */
|
|
1510
|
-
export interface
|
|
1521
|
+
export interface MezonUpdateOnboardingStepByClanIdBody {
|
|
1511
1522
|
onboarding_step?: number;
|
|
1512
1523
|
}
|
|
1513
1524
|
/** */
|
|
@@ -1868,6 +1879,10 @@ export declare class MezonApi {
|
|
|
1868
1879
|
listUserClansByUserId(bearerToken: string, options?: any): Promise<ApiAllUserClans>;
|
|
1869
1880
|
/** ListUserPermissionInChannel */
|
|
1870
1881
|
listUserPermissionInChannel(bearerToken: string, clanId?: string, channelId?: string, options?: any): Promise<ApiUserPermissionInChannelListResponse>;
|
|
1882
|
+
/** Get user status */
|
|
1883
|
+
getUserStatus(bearerToken: string, options?: any): Promise<ApiUserStatus>;
|
|
1884
|
+
/** Update user status */
|
|
1885
|
+
updateUserStatus(bearerToken: string, body: ApiUserStatusUpdate, options?: any): Promise<any>;
|
|
1871
1886
|
/** create webhook */
|
|
1872
1887
|
generateWebhook(bearerToken: string, body: ApiWebhookCreateRequest, options?: any): Promise<any>;
|
|
1873
1888
|
/** update webhook name by id */
|
|
@@ -1906,5 +1921,5 @@ export declare class MezonApi {
|
|
|
1906
1921
|
/** List onboarding step. */
|
|
1907
1922
|
listOnboardingStep(bearerToken: string, clanId?: string, limit?: number, page?: number, options?: any): Promise<ApiListOnboardingStepResponse>;
|
|
1908
1923
|
/** Update onboarding step. */
|
|
1909
|
-
|
|
1924
|
+
updateOnboardingStepByClanId(bearerToken: string, clanId: string, body: MezonUpdateOnboardingStepByClanIdBody, options?: any): Promise<any>;
|
|
1910
1925
|
}
|
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, ApiListUserActivity, ApiCreateActivityRequest, ApiLoginIDResponse, ApiLoginRequest, ApiConfirmLoginRequest, ApiUserActivity, ApiChanEncryptionMethod, ApiGetPubKeysResponse, ApiPubKey, ApiGetKeyServerResp, MezonapiListAuditLog, ApiTokenSentEvent, MezonDeleteWebhookByIdBody, ApiWithdrawTokenRequest, ApiListOnboardingResponse, ApiCreateOnboardingRequest, MezonUpdateOnboardingBody, ApiOnboardingItem, ApiGenerateClanWebhookRequest, ApiGenerateClanWebhookResponse, ApiListClanWebhookResponse, MezonUpdateClanWebhookByIdBody, MezonUpdateClanDescBody, ApiListOnboardingStepResponse,
|
|
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, 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 } from "./api.gen";
|
|
17
17
|
import { Session } from "./session";
|
|
18
18
|
import { Socket } from "./socket";
|
|
19
19
|
import { WebSocketAdapter } from "./web_socket_adapter";
|
|
@@ -620,5 +620,7 @@ export declare class Client {
|
|
|
620
620
|
deleteClanWebhookById(session: Session, id: string, clan_id: string): Promise<boolean>;
|
|
621
621
|
updateClanWebhookById(session: Session, id: string, request: MezonUpdateClanWebhookByIdBody): Promise<boolean>;
|
|
622
622
|
listOnboardingStep(session: Session, clan_id?: string, limit?: number, page?: number): Promise<ApiListOnboardingStepResponse>;
|
|
623
|
-
|
|
623
|
+
updateOnboardingStepByClanId(session: Session, id: string, request: MezonUpdateOnboardingStepByClanIdBody): Promise<boolean>;
|
|
624
|
+
updateUserStatus(session: Session, request: ApiUserStatusUpdate): Promise<boolean>;
|
|
625
|
+
getUserStatus(session: Session): Promise<ApiUserStatus>;
|
|
624
626
|
}
|
package/dist/mezon-js.cjs.js
CHANGED
|
@@ -6005,6 +6005,60 @@ var MezonApi = class {
|
|
|
6005
6005
|
)
|
|
6006
6006
|
]);
|
|
6007
6007
|
}
|
|
6008
|
+
/** Get user status */
|
|
6009
|
+
getUserStatus(bearerToken, options = {}) {
|
|
6010
|
+
const urlPath = "/v2/userstatus";
|
|
6011
|
+
const queryParams = /* @__PURE__ */ new Map();
|
|
6012
|
+
let bodyJson = "";
|
|
6013
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
|
6014
|
+
const fetchOptions = buildFetchOptions("GET", options, bodyJson);
|
|
6015
|
+
if (bearerToken) {
|
|
6016
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
|
6017
|
+
}
|
|
6018
|
+
return Promise.race([
|
|
6019
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
|
6020
|
+
if (response.status == 204) {
|
|
6021
|
+
return response;
|
|
6022
|
+
} else if (response.status >= 200 && response.status < 300) {
|
|
6023
|
+
return response.json();
|
|
6024
|
+
} else {
|
|
6025
|
+
throw response;
|
|
6026
|
+
}
|
|
6027
|
+
}),
|
|
6028
|
+
new Promise(
|
|
6029
|
+
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
|
6030
|
+
)
|
|
6031
|
+
]);
|
|
6032
|
+
}
|
|
6033
|
+
/** Update user status */
|
|
6034
|
+
updateUserStatus(bearerToken, body, options = {}) {
|
|
6035
|
+
if (body === null || body === void 0) {
|
|
6036
|
+
throw new Error("'body' is a required parameter but is null or undefined.");
|
|
6037
|
+
}
|
|
6038
|
+
const urlPath = "/v2/userstatus";
|
|
6039
|
+
const queryParams = /* @__PURE__ */ new Map();
|
|
6040
|
+
let bodyJson = "";
|
|
6041
|
+
bodyJson = JSON.stringify(body || {});
|
|
6042
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
|
6043
|
+
const fetchOptions = buildFetchOptions("PUT", options, bodyJson);
|
|
6044
|
+
if (bearerToken) {
|
|
6045
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
|
6046
|
+
}
|
|
6047
|
+
return Promise.race([
|
|
6048
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
|
6049
|
+
if (response.status == 204) {
|
|
6050
|
+
return response;
|
|
6051
|
+
} else if (response.status >= 200 && response.status < 300) {
|
|
6052
|
+
return response.json();
|
|
6053
|
+
} else {
|
|
6054
|
+
throw response;
|
|
6055
|
+
}
|
|
6056
|
+
}),
|
|
6057
|
+
new Promise(
|
|
6058
|
+
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
|
6059
|
+
)
|
|
6060
|
+
]);
|
|
6061
|
+
}
|
|
6008
6062
|
/** create webhook */
|
|
6009
6063
|
generateWebhook(bearerToken, body, options = {}) {
|
|
6010
6064
|
if (body === null || body === void 0) {
|
|
@@ -6577,14 +6631,14 @@ var MezonApi = class {
|
|
|
6577
6631
|
]);
|
|
6578
6632
|
}
|
|
6579
6633
|
/** Update onboarding step. */
|
|
6580
|
-
|
|
6581
|
-
if (
|
|
6582
|
-
throw new Error("'
|
|
6634
|
+
updateOnboardingStepByClanId(bearerToken, clanId, body, options = {}) {
|
|
6635
|
+
if (clanId === null || clanId === void 0) {
|
|
6636
|
+
throw new Error("'clanId' is a required parameter but is null or undefined.");
|
|
6583
6637
|
}
|
|
6584
6638
|
if (body === null || body === void 0) {
|
|
6585
6639
|
throw new Error("'body' is a required parameter but is null or undefined.");
|
|
6586
6640
|
}
|
|
6587
|
-
const urlPath = "/v2/onboardingsteps/{
|
|
6641
|
+
const urlPath = "/v2/onboardingsteps/{clanId}".replace("{clanId}", encodeURIComponent(String(clanId)));
|
|
6588
6642
|
const queryParams = /* @__PURE__ */ new Map();
|
|
6589
6643
|
let bodyJson = "";
|
|
6590
6644
|
bodyJson = JSON.stringify(body || {});
|
|
@@ -10030,7 +10084,7 @@ var Client = class {
|
|
|
10030
10084
|
if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
|
|
10031
10085
|
yield this.sessionRefresh(session);
|
|
10032
10086
|
}
|
|
10033
|
-
return this.apiClient.
|
|
10087
|
+
return this.apiClient.generateClanWebhook(session.token, request).then((response) => {
|
|
10034
10088
|
return Promise.resolve(response);
|
|
10035
10089
|
});
|
|
10036
10090
|
});
|
|
@@ -10080,14 +10134,36 @@ var Client = class {
|
|
|
10080
10134
|
});
|
|
10081
10135
|
}
|
|
10082
10136
|
//**update onboarding step by id */
|
|
10083
|
-
|
|
10137
|
+
updateOnboardingStepByClanId(session, id, request) {
|
|
10138
|
+
return __async(this, null, function* () {
|
|
10139
|
+
if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
|
|
10140
|
+
yield this.sessionRefresh(session);
|
|
10141
|
+
}
|
|
10142
|
+
return this.apiClient.updateOnboardingStepByClanId(session.token, id, request).then((response) => {
|
|
10143
|
+
return response !== void 0;
|
|
10144
|
+
});
|
|
10145
|
+
});
|
|
10146
|
+
}
|
|
10147
|
+
//**update status */
|
|
10148
|
+
updateUserStatus(session, request) {
|
|
10084
10149
|
return __async(this, null, function* () {
|
|
10085
10150
|
if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
|
|
10086
10151
|
yield this.sessionRefresh(session);
|
|
10087
10152
|
}
|
|
10088
|
-
return this.apiClient.
|
|
10153
|
+
return this.apiClient.updateUserStatus(session.token, request).then((response) => {
|
|
10089
10154
|
return response !== void 0;
|
|
10090
10155
|
});
|
|
10091
10156
|
});
|
|
10092
10157
|
}
|
|
10158
|
+
//**get user status */
|
|
10159
|
+
getUserStatus(session) {
|
|
10160
|
+
return __async(this, null, function* () {
|
|
10161
|
+
if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
|
|
10162
|
+
yield this.sessionRefresh(session);
|
|
10163
|
+
}
|
|
10164
|
+
return this.apiClient.getUserStatus(session.token).then((response) => {
|
|
10165
|
+
return Promise.resolve(response);
|
|
10166
|
+
});
|
|
10167
|
+
});
|
|
10168
|
+
}
|
|
10093
10169
|
};
|
package/dist/mezon-js.esm.mjs
CHANGED
|
@@ -5975,6 +5975,60 @@ var MezonApi = class {
|
|
|
5975
5975
|
)
|
|
5976
5976
|
]);
|
|
5977
5977
|
}
|
|
5978
|
+
/** Get user status */
|
|
5979
|
+
getUserStatus(bearerToken, options = {}) {
|
|
5980
|
+
const urlPath = "/v2/userstatus";
|
|
5981
|
+
const queryParams = /* @__PURE__ */ new Map();
|
|
5982
|
+
let bodyJson = "";
|
|
5983
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
|
5984
|
+
const fetchOptions = buildFetchOptions("GET", options, bodyJson);
|
|
5985
|
+
if (bearerToken) {
|
|
5986
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
|
5987
|
+
}
|
|
5988
|
+
return Promise.race([
|
|
5989
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
|
5990
|
+
if (response.status == 204) {
|
|
5991
|
+
return response;
|
|
5992
|
+
} else if (response.status >= 200 && response.status < 300) {
|
|
5993
|
+
return response.json();
|
|
5994
|
+
} else {
|
|
5995
|
+
throw response;
|
|
5996
|
+
}
|
|
5997
|
+
}),
|
|
5998
|
+
new Promise(
|
|
5999
|
+
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
|
6000
|
+
)
|
|
6001
|
+
]);
|
|
6002
|
+
}
|
|
6003
|
+
/** Update user status */
|
|
6004
|
+
updateUserStatus(bearerToken, body, options = {}) {
|
|
6005
|
+
if (body === null || body === void 0) {
|
|
6006
|
+
throw new Error("'body' is a required parameter but is null or undefined.");
|
|
6007
|
+
}
|
|
6008
|
+
const urlPath = "/v2/userstatus";
|
|
6009
|
+
const queryParams = /* @__PURE__ */ new Map();
|
|
6010
|
+
let bodyJson = "";
|
|
6011
|
+
bodyJson = JSON.stringify(body || {});
|
|
6012
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
|
6013
|
+
const fetchOptions = buildFetchOptions("PUT", options, bodyJson);
|
|
6014
|
+
if (bearerToken) {
|
|
6015
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
|
6016
|
+
}
|
|
6017
|
+
return Promise.race([
|
|
6018
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
|
6019
|
+
if (response.status == 204) {
|
|
6020
|
+
return response;
|
|
6021
|
+
} else if (response.status >= 200 && response.status < 300) {
|
|
6022
|
+
return response.json();
|
|
6023
|
+
} else {
|
|
6024
|
+
throw response;
|
|
6025
|
+
}
|
|
6026
|
+
}),
|
|
6027
|
+
new Promise(
|
|
6028
|
+
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
|
6029
|
+
)
|
|
6030
|
+
]);
|
|
6031
|
+
}
|
|
5978
6032
|
/** create webhook */
|
|
5979
6033
|
generateWebhook(bearerToken, body, options = {}) {
|
|
5980
6034
|
if (body === null || body === void 0) {
|
|
@@ -6547,14 +6601,14 @@ var MezonApi = class {
|
|
|
6547
6601
|
]);
|
|
6548
6602
|
}
|
|
6549
6603
|
/** Update onboarding step. */
|
|
6550
|
-
|
|
6551
|
-
if (
|
|
6552
|
-
throw new Error("'
|
|
6604
|
+
updateOnboardingStepByClanId(bearerToken, clanId, body, options = {}) {
|
|
6605
|
+
if (clanId === null || clanId === void 0) {
|
|
6606
|
+
throw new Error("'clanId' is a required parameter but is null or undefined.");
|
|
6553
6607
|
}
|
|
6554
6608
|
if (body === null || body === void 0) {
|
|
6555
6609
|
throw new Error("'body' is a required parameter but is null or undefined.");
|
|
6556
6610
|
}
|
|
6557
|
-
const urlPath = "/v2/onboardingsteps/{
|
|
6611
|
+
const urlPath = "/v2/onboardingsteps/{clanId}".replace("{clanId}", encodeURIComponent(String(clanId)));
|
|
6558
6612
|
const queryParams = /* @__PURE__ */ new Map();
|
|
6559
6613
|
let bodyJson = "";
|
|
6560
6614
|
bodyJson = JSON.stringify(body || {});
|
|
@@ -10000,7 +10054,7 @@ var Client = class {
|
|
|
10000
10054
|
if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
|
|
10001
10055
|
yield this.sessionRefresh(session);
|
|
10002
10056
|
}
|
|
10003
|
-
return this.apiClient.
|
|
10057
|
+
return this.apiClient.generateClanWebhook(session.token, request).then((response) => {
|
|
10004
10058
|
return Promise.resolve(response);
|
|
10005
10059
|
});
|
|
10006
10060
|
});
|
|
@@ -10050,16 +10104,38 @@ var Client = class {
|
|
|
10050
10104
|
});
|
|
10051
10105
|
}
|
|
10052
10106
|
//**update onboarding step by id */
|
|
10053
|
-
|
|
10107
|
+
updateOnboardingStepByClanId(session, id, request) {
|
|
10108
|
+
return __async(this, null, function* () {
|
|
10109
|
+
if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
|
|
10110
|
+
yield this.sessionRefresh(session);
|
|
10111
|
+
}
|
|
10112
|
+
return this.apiClient.updateOnboardingStepByClanId(session.token, id, request).then((response) => {
|
|
10113
|
+
return response !== void 0;
|
|
10114
|
+
});
|
|
10115
|
+
});
|
|
10116
|
+
}
|
|
10117
|
+
//**update status */
|
|
10118
|
+
updateUserStatus(session, request) {
|
|
10054
10119
|
return __async(this, null, function* () {
|
|
10055
10120
|
if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
|
|
10056
10121
|
yield this.sessionRefresh(session);
|
|
10057
10122
|
}
|
|
10058
|
-
return this.apiClient.
|
|
10123
|
+
return this.apiClient.updateUserStatus(session.token, request).then((response) => {
|
|
10059
10124
|
return response !== void 0;
|
|
10060
10125
|
});
|
|
10061
10126
|
});
|
|
10062
10127
|
}
|
|
10128
|
+
//**get user status */
|
|
10129
|
+
getUserStatus(session) {
|
|
10130
|
+
return __async(this, null, function* () {
|
|
10131
|
+
if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
|
|
10132
|
+
yield this.sessionRefresh(session);
|
|
10133
|
+
}
|
|
10134
|
+
return this.apiClient.getUserStatus(session.token).then((response) => {
|
|
10135
|
+
return Promise.resolve(response);
|
|
10136
|
+
});
|
|
10137
|
+
});
|
|
10138
|
+
}
|
|
10063
10139
|
};
|
|
10064
10140
|
export {
|
|
10065
10141
|
ChannelStreamMode,
|