mezon-js 2.10.73 → 2.10.75
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 +58 -0
- package/client.ts +21 -0
- package/dist/api.gen.d.ts +14 -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,28 @@ 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
|
+
update_time?: string;
|
2308
|
+
//
|
2309
|
+
receiver_id?: string;
|
2310
|
+
//
|
2311
|
+
receiver_username?: string;
|
2312
|
+
//
|
2313
|
+
sender_id?: string;
|
2314
|
+
//
|
2315
|
+
sender_username?: string;
|
2316
|
+
//
|
2317
|
+
metadata?: string;
|
2318
|
+
//
|
2319
|
+
trans_id?: string;
|
2320
|
+
}
|
2321
|
+
|
2300
2322
|
/** Update a user's account details. */
|
2301
2323
|
export interface ApiUpdateAccountRequest {
|
2302
2324
|
//
|
@@ -9842,6 +9864,42 @@ export class MezonApi {
|
|
9842
9864
|
]);
|
9843
9865
|
}
|
9844
9866
|
|
9867
|
+
/** list transaction detail */
|
9868
|
+
listTransactionDetail(bearerToken: string,
|
9869
|
+
transId:string,
|
9870
|
+
options: any = {}): Promise<ApiTransactionDetail> {
|
9871
|
+
|
9872
|
+
if (transId === null || transId === undefined) {
|
9873
|
+
throw new Error("'transId' is a required parameter but is null or undefined.");
|
9874
|
+
}
|
9875
|
+
const urlPath = "/v2/transaction/{transId}"
|
9876
|
+
.replace("{transId}", encodeURIComponent(String(transId)));
|
9877
|
+
const queryParams = new Map<string, any>();
|
9878
|
+
|
9879
|
+
let bodyJson : string = "";
|
9880
|
+
|
9881
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
9882
|
+
const fetchOptions = buildFetchOptions("GET", options, bodyJson);
|
9883
|
+
if (bearerToken) {
|
9884
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
9885
|
+
}
|
9886
|
+
|
9887
|
+
return Promise.race([
|
9888
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
9889
|
+
if (response.status == 204) {
|
9890
|
+
return response;
|
9891
|
+
} else if (response.status >= 200 && response.status < 300) {
|
9892
|
+
return response.json();
|
9893
|
+
} else {
|
9894
|
+
throw response;
|
9895
|
+
}
|
9896
|
+
}),
|
9897
|
+
new Promise((_, reject) =>
|
9898
|
+
setTimeout(reject, this.timeoutMs, "Request timed out.")
|
9899
|
+
),
|
9900
|
+
]);
|
9901
|
+
}
|
9902
|
+
|
9845
9903
|
/** Get user status */
|
9846
9904
|
listWalletLedger(bearerToken: string,
|
9847
9905
|
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,18 @@ 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
|
+
update_time?: string;
|
1337
|
+
receiver_id?: string;
|
1338
|
+
receiver_username?: string;
|
1339
|
+
sender_id?: string;
|
1340
|
+
sender_username?: string;
|
1341
|
+
metadata?: string;
|
1342
|
+
trans_id?: string;
|
1343
|
+
}
|
1332
1344
|
/** Update a user's account details. */
|
1333
1345
|
export interface ApiUpdateAccountRequest {
|
1334
1346
|
about_me?: string;
|
@@ -1976,6 +1988,8 @@ export declare class MezonApi {
|
|
1976
1988
|
getUserStatus(bearerToken: string, options?: any): Promise<ApiUserStatus>;
|
1977
1989
|
/** Update user status */
|
1978
1990
|
updateUserStatus(bearerToken: string, body: ApiUserStatusUpdate, options?: any): Promise<any>;
|
1991
|
+
/** list transaction detail */
|
1992
|
+
listTransactionDetail(bearerToken: string, transId: string, options?: any): Promise<ApiTransactionDetail>;
|
1979
1993
|
/** Get user status */
|
1980
1994
|
listWalletLedger(bearerToken: string, limit?: number, cursor?: string, transactionId?: string, page?: number, options?: any): Promise<ApiWalletLedgerList>;
|
1981
1995
|
/** 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* () {
|