mezon-js 2.10.73 → 2.10.74
Sign up to get free protection for your applications and to get access to all the features.
- package/api.gen.ts +54 -0
- package/client.ts +21 -0
- package/dist/api.gen.d.ts +12 -0
- package/dist/client.d.ts +3 -1
- package/dist/mezon-js.cjs.js +39 -0
- package/dist/mezon-js.esm.mjs +39 -0
- package/package.json +1 -1
package/api.gen.ts
CHANGED
@@ -2297,6 +2297,24 @@ export interface ApiTokenSentEvent {
|
|
2297
2297
|
transaction_id?: string;
|
2298
2298
|
}
|
2299
2299
|
|
2300
|
+
/** */
|
2301
|
+
export interface ApiTransactionDetail {
|
2302
|
+
//
|
2303
|
+
amount?: number;
|
2304
|
+
//
|
2305
|
+
create_time?: string;
|
2306
|
+
//
|
2307
|
+
receiver_id?: string;
|
2308
|
+
//
|
2309
|
+
receiver_username?: string;
|
2310
|
+
//
|
2311
|
+
sender_id?: string;
|
2312
|
+
//
|
2313
|
+
sender_username?: string;
|
2314
|
+
//
|
2315
|
+
trans_id?: string;
|
2316
|
+
}
|
2317
|
+
|
2300
2318
|
/** Update a user's account details. */
|
2301
2319
|
export interface ApiUpdateAccountRequest {
|
2302
2320
|
//
|
@@ -9842,6 +9860,42 @@ export class MezonApi {
|
|
9842
9860
|
]);
|
9843
9861
|
}
|
9844
9862
|
|
9863
|
+
/** list transaction detail */
|
9864
|
+
listTransactionDetail(bearerToken: string,
|
9865
|
+
transId:string,
|
9866
|
+
options: any = {}): Promise<ApiTransactionDetail> {
|
9867
|
+
|
9868
|
+
if (transId === null || transId === undefined) {
|
9869
|
+
throw new Error("'transId' is a required parameter but is null or undefined.");
|
9870
|
+
}
|
9871
|
+
const urlPath = "/v2/transaction/{transId}"
|
9872
|
+
.replace("{transId}", encodeURIComponent(String(transId)));
|
9873
|
+
const queryParams = new Map<string, any>();
|
9874
|
+
|
9875
|
+
let bodyJson : string = "";
|
9876
|
+
|
9877
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
9878
|
+
const fetchOptions = buildFetchOptions("GET", options, bodyJson);
|
9879
|
+
if (bearerToken) {
|
9880
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
9881
|
+
}
|
9882
|
+
|
9883
|
+
return Promise.race([
|
9884
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
9885
|
+
if (response.status == 204) {
|
9886
|
+
return response;
|
9887
|
+
} else if (response.status >= 200 && response.status < 300) {
|
9888
|
+
return response.json();
|
9889
|
+
} else {
|
9890
|
+
throw response;
|
9891
|
+
}
|
9892
|
+
}),
|
9893
|
+
new Promise((_, reject) =>
|
9894
|
+
setTimeout(reject, this.timeoutMs, "Request timed out.")
|
9895
|
+
),
|
9896
|
+
]);
|
9897
|
+
}
|
9898
|
+
|
9845
9899
|
/** Get user status */
|
9846
9900
|
listWalletLedger(bearerToken: string,
|
9847
9901
|
limit?:number,
|
package/client.ts
CHANGED
@@ -157,6 +157,7 @@ import {
|
|
157
157
|
ApiSdTopicRequest,
|
158
158
|
ApiSdTopic,
|
159
159
|
MezonUpdateEventBody,
|
160
|
+
ApiTransactionDetail,
|
160
161
|
} from "./api.gen";
|
161
162
|
|
162
163
|
import { Session } from "./session";
|
@@ -4763,6 +4764,26 @@ export class Client {
|
|
4763
4764
|
});
|
4764
4765
|
}
|
4765
4766
|
|
4767
|
+
/** list transaction detail */
|
4768
|
+
async listTransactionDetail(
|
4769
|
+
session: Session,
|
4770
|
+
transId:string
|
4771
|
+
): Promise<ApiTransactionDetail> {
|
4772
|
+
if (
|
4773
|
+
this.autoRefreshSession &&
|
4774
|
+
session.refresh_token &&
|
4775
|
+
session.isexpired((Date.now() + this.expiredTimespanMs) / 1000)
|
4776
|
+
) {
|
4777
|
+
await this.sessionRefresh(session);
|
4778
|
+
}
|
4779
|
+
|
4780
|
+
return this.apiClient
|
4781
|
+
.listTransactionDetail(session.token, transId)
|
4782
|
+
.then((response: ApiTransactionDetail) => {
|
4783
|
+
return Promise.resolve(response);
|
4784
|
+
});
|
4785
|
+
}
|
4786
|
+
|
4766
4787
|
//**list wallet ledger */
|
4767
4788
|
async listWalletLedger(
|
4768
4789
|
session: Session,
|
package/dist/api.gen.d.ts
CHANGED
@@ -1329,6 +1329,16 @@ export interface ApiTokenSentEvent {
|
|
1329
1329
|
extra_attribute?: string;
|
1330
1330
|
transaction_id?: string;
|
1331
1331
|
}
|
1332
|
+
/** */
|
1333
|
+
export interface ApiTransactionDetail {
|
1334
|
+
amount?: number;
|
1335
|
+
create_time?: string;
|
1336
|
+
receiver_id?: string;
|
1337
|
+
receiver_username?: string;
|
1338
|
+
sender_id?: string;
|
1339
|
+
sender_username?: string;
|
1340
|
+
trans_id?: string;
|
1341
|
+
}
|
1332
1342
|
/** Update a user's account details. */
|
1333
1343
|
export interface ApiUpdateAccountRequest {
|
1334
1344
|
about_me?: string;
|
@@ -1976,6 +1986,8 @@ export declare class MezonApi {
|
|
1976
1986
|
getUserStatus(bearerToken: string, options?: any): Promise<ApiUserStatus>;
|
1977
1987
|
/** Update user status */
|
1978
1988
|
updateUserStatus(bearerToken: string, body: ApiUserStatusUpdate, options?: any): Promise<any>;
|
1989
|
+
/** list transaction detail */
|
1990
|
+
listTransactionDetail(bearerToken: string, transId: string, options?: any): Promise<ApiTransactionDetail>;
|
1979
1991
|
/** Get user status */
|
1980
1992
|
listWalletLedger(bearerToken: string, limit?: number, cursor?: string, transactionId?: string, page?: number, options?: any): Promise<ApiWalletLedgerList>;
|
1981
1993
|
/** create webhook */
|
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, 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, ApiWithdrawTokenRequest, ApiListOnboardingResponse, ApiCreateOnboardingRequest, MezonUpdateOnboardingBody, ApiOnboardingItem, ApiGenerateClanWebhookRequest, ApiGenerateClanWebhookResponse, ApiListClanWebhookResponse, MezonUpdateClanWebhookByIdBody, MezonUpdateClanDescBody, ApiUserStatusUpdate, ApiUserStatus, ApiListOnboardingStepResponse, MezonUpdateOnboardingStepByClanIdBody, ApiWalletLedgerList, ApiSdTopicList, ApiSdTopicRequest, ApiSdTopic, MezonUpdateEventBody } 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, 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, ApiWithdrawTokenRequest, ApiListOnboardingResponse, ApiCreateOnboardingRequest, MezonUpdateOnboardingBody, ApiOnboardingItem, ApiGenerateClanWebhookRequest, ApiGenerateClanWebhookResponse, ApiListClanWebhookResponse, MezonUpdateClanWebhookByIdBody, MezonUpdateClanDescBody, ApiUserStatusUpdate, ApiUserStatus, ApiListOnboardingStepResponse, MezonUpdateOnboardingStepByClanIdBody, ApiWalletLedgerList, ApiSdTopicList, ApiSdTopicRequest, ApiSdTopic, MezonUpdateEventBody, ApiTransactionDetail } from "./api.gen";
|
17
17
|
import { Session } from "./session";
|
18
18
|
import { Socket } from "./socket";
|
19
19
|
import { WebSocketAdapter } from "./web_socket_adapter";
|
@@ -633,6 +633,8 @@ export declare class Client {
|
|
633
633
|
updateOnboardingStepByClanId(session: Session, clan_id: string, request: MezonUpdateOnboardingStepByClanIdBody): Promise<boolean>;
|
634
634
|
updateUserStatus(session: Session, request: ApiUserStatusUpdate): Promise<boolean>;
|
635
635
|
getUserStatus(session: Session): Promise<ApiUserStatus>;
|
636
|
+
/** list transaction detail */
|
637
|
+
listTransactionDetail(session: Session, transId: string): Promise<ApiTransactionDetail>;
|
636
638
|
listWalletLedger(session: Session, limit?: number, cursor?: string, transactionId?: string, page?: number): Promise<ApiWalletLedgerList>;
|
637
639
|
listSdTopic(session: Session, clanId?: string, limit?: number): Promise<ApiSdTopicList>;
|
638
640
|
createSdTopic(session: Session, request: ApiSdTopicRequest): Promise<ApiSdTopic>;
|
package/dist/mezon-js.cjs.js
CHANGED
@@ -6229,6 +6229,34 @@ var MezonApi = class {
|
|
6229
6229
|
)
|
6230
6230
|
]);
|
6231
6231
|
}
|
6232
|
+
/** list transaction detail */
|
6233
|
+
listTransactionDetail(bearerToken, transId, options = {}) {
|
6234
|
+
if (transId === null || transId === void 0) {
|
6235
|
+
throw new Error("'transId' is a required parameter but is null or undefined.");
|
6236
|
+
}
|
6237
|
+
const urlPath = "/v2/transaction/{transId}".replace("{transId}", encodeURIComponent(String(transId)));
|
6238
|
+
const queryParams = /* @__PURE__ */ new Map();
|
6239
|
+
let bodyJson = "";
|
6240
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
6241
|
+
const fetchOptions = buildFetchOptions("GET", options, bodyJson);
|
6242
|
+
if (bearerToken) {
|
6243
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
6244
|
+
}
|
6245
|
+
return Promise.race([
|
6246
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
6247
|
+
if (response.status == 204) {
|
6248
|
+
return response;
|
6249
|
+
} else if (response.status >= 200 && response.status < 300) {
|
6250
|
+
return response.json();
|
6251
|
+
} else {
|
6252
|
+
throw response;
|
6253
|
+
}
|
6254
|
+
}),
|
6255
|
+
new Promise(
|
6256
|
+
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
6257
|
+
)
|
6258
|
+
]);
|
6259
|
+
}
|
6232
6260
|
/** Get user status */
|
6233
6261
|
listWalletLedger(bearerToken, limit, cursor, transactionId, page, options = {}) {
|
6234
6262
|
const urlPath = "/v2/walletledger";
|
@@ -10568,6 +10596,17 @@ var Client = class {
|
|
10568
10596
|
});
|
10569
10597
|
});
|
10570
10598
|
}
|
10599
|
+
/** list transaction detail */
|
10600
|
+
listTransactionDetail(session, transId) {
|
10601
|
+
return __async(this, null, function* () {
|
10602
|
+
if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
|
10603
|
+
yield this.sessionRefresh(session);
|
10604
|
+
}
|
10605
|
+
return this.apiClient.listTransactionDetail(session.token, transId).then((response) => {
|
10606
|
+
return Promise.resolve(response);
|
10607
|
+
});
|
10608
|
+
});
|
10609
|
+
}
|
10571
10610
|
//**list wallet ledger */
|
10572
10611
|
listWalletLedger(session, limit, cursor, transactionId, page) {
|
10573
10612
|
return __async(this, null, function* () {
|
package/dist/mezon-js.esm.mjs
CHANGED
@@ -6195,6 +6195,34 @@ var MezonApi = class {
|
|
6195
6195
|
)
|
6196
6196
|
]);
|
6197
6197
|
}
|
6198
|
+
/** list transaction detail */
|
6199
|
+
listTransactionDetail(bearerToken, transId, options = {}) {
|
6200
|
+
if (transId === null || transId === void 0) {
|
6201
|
+
throw new Error("'transId' is a required parameter but is null or undefined.");
|
6202
|
+
}
|
6203
|
+
const urlPath = "/v2/transaction/{transId}".replace("{transId}", encodeURIComponent(String(transId)));
|
6204
|
+
const queryParams = /* @__PURE__ */ new Map();
|
6205
|
+
let bodyJson = "";
|
6206
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
6207
|
+
const fetchOptions = buildFetchOptions("GET", options, bodyJson);
|
6208
|
+
if (bearerToken) {
|
6209
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
6210
|
+
}
|
6211
|
+
return Promise.race([
|
6212
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
6213
|
+
if (response.status == 204) {
|
6214
|
+
return response;
|
6215
|
+
} else if (response.status >= 200 && response.status < 300) {
|
6216
|
+
return response.json();
|
6217
|
+
} else {
|
6218
|
+
throw response;
|
6219
|
+
}
|
6220
|
+
}),
|
6221
|
+
new Promise(
|
6222
|
+
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
6223
|
+
)
|
6224
|
+
]);
|
6225
|
+
}
|
6198
6226
|
/** Get user status */
|
6199
6227
|
listWalletLedger(bearerToken, limit, cursor, transactionId, page, options = {}) {
|
6200
6228
|
const urlPath = "/v2/walletledger";
|
@@ -10534,6 +10562,17 @@ var Client = class {
|
|
10534
10562
|
});
|
10535
10563
|
});
|
10536
10564
|
}
|
10565
|
+
/** list transaction detail */
|
10566
|
+
listTransactionDetail(session, transId) {
|
10567
|
+
return __async(this, null, function* () {
|
10568
|
+
if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
|
10569
|
+
yield this.sessionRefresh(session);
|
10570
|
+
}
|
10571
|
+
return this.apiClient.listTransactionDetail(session.token, transId).then((response) => {
|
10572
|
+
return Promise.resolve(response);
|
10573
|
+
});
|
10574
|
+
});
|
10575
|
+
}
|
10537
10576
|
//**list wallet ledger */
|
10538
10577
|
listWalletLedger(session, limit, cursor, transactionId, page) {
|
10539
10578
|
return __async(this, null, function* () {
|