dna-api 0.3.9 → 0.3.11

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/dist/index.d.ts CHANGED
@@ -1,25 +1,27 @@
1
- export { TimeBasicResponse, RespCode } from "./TimeBasicResponse";
2
1
  export { DNABaseAPI, DNASubModule } from "./modules/base";
3
2
  export { GameAPI } from "./modules/game";
3
+ export * from "./modules/h5";
4
4
  export { HomeAPI } from "./modules/home";
5
5
  export { ProfileAPI } from "./modules/profile";
6
6
  export { SettingAPI } from "./modules/setting";
7
7
  export { TrendAPI } from "./modules/trend";
8
+ export * from "./modules/types";
8
9
  export { UserAPI } from "./modules/user";
9
10
  export { UserGrowingAPI } from "./modules/usergrowing";
10
- export * from "./modules/h5";
11
- export * from "./modules/types";
12
- export * from "./type-generated";
13
11
  export * from "./modules/utils";
12
+ export { RespCode, TimeBasicResponse } from "./TimeBasicResponse";
13
+ export * from "./type-generated";
14
14
  import { DNABaseAPI } from "./modules/base";
15
15
  import { GameAPI } from "./modules/game";
16
+ import { H5API } from "./modules/h5";
16
17
  import { HomeAPI } from "./modules/home";
18
+ import { KFAPI } from "./modules/kf";
17
19
  import { ProfileAPI } from "./modules/profile";
18
20
  import { SettingAPI } from "./modules/setting";
19
21
  import { TrendAPI } from "./modules/trend";
20
22
  import { UserAPI } from "./modules/user";
21
23
  import { UserGrowingAPI } from "./modules/usergrowing";
22
- import { H5API } from "./modules/h5";
24
+ export * from "./modules/kf";
23
25
  /**
24
26
  * DNA API类,用于与DNA游戏服务器交互
25
27
  */
@@ -30,6 +32,7 @@ export declare class DNAAPI extends DNABaseAPI {
30
32
  setting: SettingAPI;
31
33
  trend: TrendAPI;
32
34
  user: UserAPI;
35
+ kf: KFAPI;
33
36
  userGrowing: UserGrowingAPI;
34
37
  h5: H5API;
35
38
  constructor({ dev_code, token, ...options }?: {
@@ -51,6 +54,15 @@ export declare class DNAAPI extends DNABaseAPI {
51
54
  getRoleDetail(char_id: string | number, char_eid: string, otherUserId?: string): Promise<import("./TimeBasicResponse").TimeBasicResponse<import("./type-generated").DNACharDetailEntity>>;
52
55
  getWeaponDetail(weapon_id: string | number, weapon_eid: string, otherUserId?: string): Promise<import("./TimeBasicResponse").TimeBasicResponse<import("./type-generated").DNAWeaponDetailEntity>>;
53
56
  getShortNoteInfo(): Promise<import("./TimeBasicResponse").TimeBasicResponse<import("./type-generated").DNAShortNoteEntity>>;
57
+ /**
58
+ * 获取帖子列表
59
+ * @param forumId 论坛ID,默认48(主论坛)46 全部
60
+ * @param pageIndex 页码,默认1
61
+ * @param pageSize 每页数量,默认20
62
+ * @param searchType 搜索类型,默认1:最新 2:热门
63
+ * @param timeType 时间类型,默认0(全部时间)
64
+ * @returns 帖子列表响应
65
+ */
54
66
  getPostList(forumId?: number, pageIndex?: number, pageSize?: number, searchType?: number, timeType?: number): Promise<import("./TimeBasicResponse").TimeBasicResponse<import("./type-generated").DNADiscussAreaResponse>>;
55
67
  getPostDetail(postId: string | number): Promise<import("./TimeBasicResponse").TimeBasicResponse<import("./type-generated").DNAPostDetailResponse>>;
56
68
  getPostByTopic(topicId?: number, pageIndex?: number, pageSize?: number, searchType?: number, timeType?: number): Promise<import("./TimeBasicResponse").TimeBasicResponse<import("./type-generated").DNATopicListResponse>>;
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
- var E;((s)=>{s[s.ERROR=-999]="ERROR";s[s.OK_ZERO=0]="OK_ZERO";s[s.OK_HTTP=200]="OK_HTTP";s[s.BAD_REQUEST=400]="BAD_REQUEST";s[s.SERVER_ERROR=500]="SERVER_ERROR"})(E||={});class p{code=0;msg="";data;constructor(e){this.code=e.code||0,this.msg=e.msg||"",this.data=e.data}get is_success(){return this.code===200||this.code===0}get success(){return this.is_success}static err(e,n=-999){return new p({code:n,msg:e,data:void 0})}}import*as D from"node-forge";function G(e,n){try{let t=[];for(let o=0;o<n.length;o+=64)t.push(n.slice(o,o+64));let r=`-----BEGIN PUBLIC KEY-----
1
+ var F;((s)=>{s[s.ERROR=-999]="ERROR";s[s.OK_ZERO=0]="OK_ZERO";s[s.OK_HTTP=200]="OK_HTTP";s[s.BAD_REQUEST=400]="BAD_REQUEST";s[s.SERVER_ERROR=500]="SERVER_ERROR"})(F||={});class p{code=0;msg="";data;constructor(e){this.code=e.code||0,this.msg=e.msg||"",this.data=e.data}get is_success(){return this.code===200||this.code===0}get success(){return this.is_success}static err(e,n=-999){return new p({code:n,msg:e,data:void 0})}}import*as D from"node-forge";function M(e,n){try{let t=[];for(let o=0;o<n.length;o+=64)t.push(n.slice(o,o+64));let r=`-----BEGIN PUBLIC KEY-----
2
2
  ${t.join(`
3
3
  `)}
4
- -----END PUBLIC KEY-----`,i=D.pki.publicKeyFromPem(r),s=D.util.encodeUtf8(e),a=i.encrypt(s);return D.util.encode64(a)}catch(t){throw Error(`[DNA] RSA 加密失败: ${t.message}`)}}function v(e=16){let t="";for(let r=0;r<e;r++)t+="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789".charAt(Math.floor(Math.random()*62));return t}function J(e){let n=D.md.md5.create();return n.update(e),n.digest().toHex().toUpperCase()}function Z(e){function n(t,r){let i=t.split("");for(let s=1;s<r.length;s+=2){let a=r[s-1],o=r[s];if(a>=0&&a<i.length&&o>=0&&o<i.length)[i[a],i[o]]=[i[o],i[a]]}return i.join("")}return n(J(e),[1,13,5,17,7,23])}function Q(e,n){let t=[],r=Object.keys(e).sort();for(let s of r){let a=e[s];if(a!==null&&a!==void 0&&a!=="")t.push(`${s}=${a}`)}let i=t.join("&");return Z(`${i}&${n}`)}function V(e,n){let t=Date.now(),r={...e,timestamp:t,token:n},i=v(16),s=Q(r,i);return{s:X(s,i),t,k:i}}function H(e){let n=v(16),t=G(n,e);return{signature:W(t),key:n}}function W(e){let n=e.split(""),t=[[3,23],[11,32],[22,42],[25,48]];for(let[r,i]of t)if(r<n.length&&i<n.length)[n[r],n[i]]=[n[i],n[r]];return n.join("")}function O(e,n){let t=W(e),r=D.util.decode64(t),i=D.cipher.createDecipher("AES-CBC",n);return i.start({iv:"A-16-Byte-String"}),i.update(D.util.createBuffer(r)),i.finish(),i.output.getBytes()}function X(e,n){let t=new TextEncoder,r=t.encode(e),i=t.encode(n),s=[];for(let a=0;a<r.length;a++){let b=(r[a]&255)+(i[a%i.length]&255);s.push(`@${b}`)}return s.join("")}class _{dev_code;token;fetchFn;is_h5=!1;RSA_PUBLIC_KEY="MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDGpdbezK+eknQZQzPOjp8mr/dP+QHwk8CRkQh6C6qFnfLH3tiyl0pnt3dePuFDnM1PUXGhCkQ157ePJCQgkDU2+mimDmXh0oLFn9zuWSp+U8uLSLX3t3PpJ8TmNCROfUDWvzdbnShqg7JfDmnrOJz49qd234W84nrfTHbzdqeigQIDAQAB";BASE_URL="https://dnabbs-api.yingxiong.com/";uploadKey="";sign_api_urls=new Set;constructor(e,n="",t={}){this.dev_code=e;this.token=n;if(this.fetchFn=t.fetchFn,t.is_h5!==void 0)this.is_h5=t.is_h5;if(t.rsa_public_key!==void 0)this.RSA_PUBLIC_KEY=t.rsa_public_key}async fileUpload(e,n){let t=await this._dna_request(e,n,{sign:!0});if(t.is_success&&t.data)t.data=t.data.map((r)=>O(r,this.uploadKey));return t}async getRsaPublicKey(){if(this.RSA_PUBLIC_KEY)return this.RSA_PUBLIC_KEY;let e=await this._dna_request("config/getRsaPublicKey");if(e.is_success&&e.data){let n=e.data.key;if(typeof n==="string")this.RSA_PUBLIC_KEY=n}return this.RSA_PUBLIC_KEY}async getHeaders(e){let{payload:n,exparams:t,dev_code:r=this.dev_code,refer:i,token:s=this.token,tokenSig:a,h5:o}=e||{},b="application/x-www-form-urlencoded; charset=utf-8",q={version:"1.1.3",source:"ios","Content-Type":"application/x-www-form-urlencoded; charset=utf-8","User-Agent":"DoubleHelix/4 CFNetwork/3860.100.1 Darwin/25.0.0"},k={version:"3.11.0",source:"h5","Content-Type":"application/x-www-form-urlencoded; charset=utf-8","User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36"},h=this.is_h5||o||!1,c={...h?k:q};if(r)c.devCode=r;if(i||h)c.origin="https://dnabbs.yingxiong.com",c.refer="https://dnabbs.yingxiong.com/";if(s)c.token=s;if(n instanceof FormData){let N=await this.getRsaPublicKey(),{signature:g,key:d}=H(N);if(c.t=g,this.uploadKey=d,t)for(let[f,B]of Object.entries(t))n.append(f,String(B));delete c["Content-Type"]}else if(typeof n==="object"){let N=V(n,a?s:"");if(Object.assign(n,{sign:N.s,timestamp:N.t}),t)Object.assign(n,t);let g=new URLSearchParams;Object.entries(n).forEach(([S,w])=>{g.append(S,String(w))}),n=g.toString();let d=N.k,f=await this.getRsaPublicKey(),B=G(d,f);if(this.is_h5)c.k=B;else c.rk=d,c.key=B}return{headers:c,payload:n}}async needSign(e){if(this.sign_api_urls.size===0)try{await this.initializeSignConfig()}catch(n){console.error("初始化签名配置失败:",n),this.sign_api_urls=new Set(["/user/sdkLogin","/forum/postPublish","/forum/comment/createComment","/forum/comment/createReply","/user/getSmsCode","/role/defaultRoleForTool","/media/av/cfg/getVideos","/media/av/cfg/getAudios","/media/av/cfg/getImages","/encourage/signin/signin"].map((t)=>t.replace(/^\/+/,"")))}return this.sign_api_urls.has(e)}async initializeSignConfig(){try{let e=await this._dna_request("config/getCommonConfig",void 0,{sign:!1});if(e.is_success&&e.data?.signApiConfigVo?.signApiList)this.sign_api_urls=new Set(e.data.signApiConfigVo.signApiList.map((n)=>n.replace(/^\/+/,"")))}catch(e){console.error("初始化签名配置失败:",e)}}async _dna_request_h5(e,n,t){return await this._dna_request(e,n,{...t,h5:!0})}async _dna_request(e,n,t){let{method:r="POST",sign:i,h5:s,refer:a,params:o,max_retries:b=3,retry_delay:q=1,timeout:k=1e4,token:h,tokenSig:c}=t||{};if(i===void 0&&await this.needSign(e))i=!0;let N;if(i){let{payload:g,headers:d}=await this.getHeaders({payload:n,refer:a,exparams:o,token:h?this.token:void 0,tokenSig:c,h5:s});n=g,N=d}else{let{headers:g}=await this.getHeaders({token:h?this.token:void 0,refer:a,h5:s});N=g}for(let g=0;g<b;g++)try{let d=n;if(n&&typeof n==="object"&&!(n instanceof FormData)){let C=new URLSearchParams;Object.entries(n).forEach(([K,M])=>{if(M!==void 0)C.append(K,String(M))}),d=C.toString()}let f={method:r,headers:N,body:d},B=new AbortController,S=setTimeout(()=>B.abort(),k),w={...f,signal:B.signal},U=this.fetchFn?await this.fetchFn(`${this.BASE_URL}${e}`,w):await fetch(`${this.BASE_URL}${e}`,w);clearTimeout(S);let j=U.headers.get("content-type")||"",A;if(j.includes("text/")){let C=await U.text();A={code:-999,data:C}}else A=await U.json();if(typeof A==="object"&&A!==null)try{if(typeof A.data==="string")A.data=JSON.parse(A.data)}catch(C){}return new p(A)}catch(d){if(console.error(`请求失败: ${d.message}`),g<b-1)await new Promise((f)=>setTimeout(f,q*Math.pow(2,g)))}return p.err("请求服务器失败,已达最大重试次数")}}class m{_base;constructor(e){this._base=e}get dev_code(){return this._base.dev_code}get token(){return this._base.token}set token(e){this._base.token=e}get fetchFn(){return this._base.fetchFn}get is_h5(){return this._base.is_h5}get RSA_PUBLIC_KEY(){return this._base.RSA_PUBLIC_KEY}get BASE_URL(){return this._base.BASE_URL}get uploadKey(){return this._base.uploadKey}async getRsaPublicKey(){return this._base.getRsaPublicKey()}async fileUpload(e,n){return await this._base.fileUpload(e,n)}async _dna_request(e,n,t){return this._base._dna_request(e,n,t)}async _dna_request_h5(e,n,t){return this._base._dna_request_h5(e,n,t)}async getHeaders(e){return this._base.getHeaders(e)}}class y extends m{constructor(e){super(e)}async defaultRoleForTool(e=1,n){let t={otherUserId:n,type:e};if(!n)delete t.otherUserId;return await this._dna_request("role/defaultRoleForTool",t,{sign:!0,token:!0,tokenSig:!0})}async getMhSwitchStatus(){return await this._dna_request("user/push/getMhSwitchStatus")}async getRoleDetail(e,n,t){let r={charId:e,charEid:n,type:1,otherUserId:t};return await this._dna_request("role/getCharDetail",r)}async getShortNoteInfo(){return await this._dna_request("role/getShortNoteInfo")}async getWeaponDetail(e,n,t){let r={weaponId:e,weaponEid:n,type:1,otherUserId:t};return await this._dna_request("role/getWeaponDetail",r)}async updateMhSwitchStatus(e){return await this._dna_request("user/push/updateMhSwitchStatus",{config:e})}async soulTask(){return await this._dna_request("role/soul/task")}}var u=268;class L extends m{constructor(e){super(e)}async adminAdjustScore(e,n,t,r=u){let i={postId:e,gameId:r??u,gameForumId:n,weight:t};return await this._dna_request("forum/moderator/setPostWeight",i)}async adminDelete(e,n,t){let r={postId:e.postId,gameId:e.gameId??u,gameForumId:e.gameForumId,content:n,reasonCode:t};return await this._dna_request("forum/moderator/postDelete",r)}async adminMovePost(e,n,t,r){let i={postId:e.postId,gameId:e.gameId??u,gameForumId:e.gameForumId,newGameId:n,newForumId:t,newTopicIdStr:r};return await this._dna_request("forum/moderator/postMove",i)}async adminRefreshTime(e,n){let t={postId:e.postId,gameId:e.gameId??u,gameForumId:e.gameForumId,refresh:n};return await this._dna_request("forum/moderator/setRefresh",t)}async blockList(){return await this._dna_request("user/block/list")}async blockOther(e,n,t){return await this._dna_request("user/block/other",{blockPostId:e,blockUserId:n,type:t})}async collect(e,n,t=1){let r={operateType:t,postId:e,toUserId:n};return await this._dna_request("forum/collect",r)}async commentDelete(e,n,t,r){let i={id:e.id,gameId:e.gameId,gameForumId:e.gameForumId,entityType:n,content:t,reasonCode:r};return await this._dna_request("forum/commentReplyDelete",i)}async createComment(e,n){let t=JSON.stringify([{content:n,contentType:"1"}]),r={postId:e.postId,forumId:e.gameForumId,postType:"1",content:t};return await this._dna_request("forum/comment/createComment",r,{sign:!0,params:{toUserId:e.userId}})}async createReply(e,n){let r={content:JSON.stringify([{content:n,contentType:"1",imgHeight:0,imgWidth:0,url:""}]),forumId:e.gameForumId,postCommentId:e.postCommentId,postId:e.postId,postType:"1",toUserId:e.userId};return await this._dna_request("forum/comment/createReply",r,{sign:!0,params:{toUserId:e.userId}})}async createReplyList(e,n){let r={content:JSON.stringify([{content:n,contentType:"1",imgHeight:0,imgWidth:0,url:""}]),forumId:e.gameForumId,postCommentId:e.postCommentId,postCommentReplyId:e.postCommentReplyId,postId:e.postId,postType:"1",toUserId:e.userId};return await this._dna_request("forum/comment/createReply",r,{sign:!0,params:{toUserId:e.userId}})}async deletePost(e,n){return await this._dna_request("forum/more/delete",{deleteType:e,id:n},{sign:!0,refer:!0})}async followUser(e,n){let t={followUserId:e,operateType:n?0:1};return await this._dna_request("user/followUser",t,{sign:!0})}async getFollowState(e){let n={followUserId:e};return await this._dna_request("user/isFollow",n)}async gameSignIn(e,n){let t={dayAwardId:e,periodId:n,signinType:1};return await this._dna_request("encourage/signin/signin",t,{sign:!0})}async getDoujin(e){return await this._dna_request("forum/discuss/getDoujin",{forumId:e})}async getExchange(e){return await this._dna_request("forum/discuss/getExchange",{forumId:e})}async getGameBanner(e=u){return await this._dna_request("forum/gameBanner",{gameId:e})}async getPostByTopic(e=177,n=1,t=20,r=1,i=0){let s={topicId:e,gameId:u,pageIndex:n,pageSize:t,searchType:r,timeType:i};return await this._dna_request("forum/getPostByTopic",s)}async getPostCommentList(e,n=1,t=20,r=0){return await this._dna_request("forum/comment/getPostCommentList",{postId:e,pageIndex:n,pageSize:t,isOnlyPublisher:r})}async getPostDetail(e){return await this._dna_request("forum/getPostDetail",{postId:e})}async getPostList(e=48,n=1,t=20,r=1,i=0){let s={forumId:e,gameId:u,pageIndex:n,pageSize:t,searchType:r,timeType:i};return await this._dna_request("forum/list",s)}async getRankList(e){return await this._dna_request("forum/discuss/getRank",{forumId:e})}async getRecommendPosts(e=u,n=1,t=20){return await this._dna_request("forum/getRecommendPosts",{gameId:e,pageIndex:n,pageSize:t})}async getReplyList(e,n,t=1,r=20){return await this._dna_request("forum/comment/getReplyList",{postId:e,postCommentId:n,pageIndex:t,pageSize:r})}async getStatistics(e=u){return await this._dna_request("forum/statistics",{gameId:e})}async getTips(){return await this._dna_request("config/getTips")}async getWalkthrough(e){return await this._dna_request("forum/discuss/getWalkthrough",{forumId:e})}async hotList(e=1,n=u){return await this._dna_request("forum/hot/ranking/list",{gameId:n,type:e})}async haveSignIn(){let e={gameId:u};return await this._dna_request("user/haveSignInNew",e)}async isRedPoint(){return await this._dna_request("forum/dynamic/isRedPoint")}async signCalendar(){let e={gameId:u};return await this._dna_request("encourage/signin/show",e)}async like(e){let n={forumId:e.gameForumId,gameId:u,likeType:"1",operateType:"1",postCommentId:"",postCommentReplyId:"",postId:e.postId,postType:e.postType,toUserId:e.userId};return await this._dna_request("forum/like",n)}async lockPost(e,n){let t={postId:e.postId,gameId:e.gameId??u,gameForumId:e.gameForumId,operateType:n};return await this._dna_request("forum/moderator/postLock",t)}async postDownOrUp(e,n){let t={postId:e.postId,gameId:e.gameId??u,gameForumId:e.gameForumId,operateType:n};return await this._dna_request("forum/moderator/postDownOrUp",t)}async postElite(e,n){let t={postId:e.postId,gameId:e.gameId??u,gameForumId:e.gameForumId,operateType:n};return await this._dna_request("forum/moderator/postElite",t)}async postHide(e,n){let t={postId:e.postId,gameId:e.gameId??u,gameForumId:e.gameForumId,operateType:n};return await this._dna_request("forum/moderator/postHide",t)}async reRank(e,n){let t={postId:e.postId,gameId:e.gameId??u,gameForumId:e.gameForumId,weight:n};return await this._dna_request("forum/moderator/reRank",t)}async receiveLog(e,n,t){let r={periodId:e,pageIndex:n,pageSize:t};return await this._dna_request("encourage/signin/receiveLog",r)}async recommendList(e,n,t,r,i=u){let s={gameId:i,recIndex:e,newIndex:n,size:t,history:r};return await this._dna_request("forum/recommend/list",s)}async report({commentId:e=0,postId:n=0,replyId:t=0},r=1,i=1){let s={commentId:e,postId:n,replyId:t,reportReason:r,reportType:i};return await this._dna_request("forum/more/report",s)}async searchPost(e,n,t,r=u,i=1){let s={gameId:r,keyword:e,pageIndex:n,pageSize:t,searchType:i};return await this._dna_request("forum/searchPost",s)}async searchTopic(e,n,t=20,r=u){let i={gameId:r,keyword:e,pageIndex:n,pageSize:t};return await this._dna_request("forum/searchPost",i)}async searchUser(e,n,t){let r={keyword:e,pageIndex:n,pageSize:t};return await this._dna_request("forum/searchPost",r)}async shareTask(){let e={gameId:u};return await this._dna_request("encourage/level/shareTask",e)}async bbsSign(){let e={gameId:u};return await this._dna_request("user/signIn",e)}async strongRecommend(e,n=1){let t={postId:e.postId,gameId:e.gameId??u,gameForumId:e.gameForumId,operateType:n};return await this._dna_request("forum/moderator/setForceRecommend",t)}async viewCommunity(){return await this._dna_request("encourage/level/viewCommunity")}async viewCount(e,n=u){return await this._dna_request("forum/viewCount",{gameId:n,postId:e})}async getTaskProcess(){let e={gameId:u};return await this._dna_request("encourage/level/getTaskProcess",e)}async soulTask(){return await this._dna_request("role/soul/task")}}class x extends m{constructor(e){super(e)}async blackUser(e,n){return await this._dna_request("user/blackUser",{toUserId:e,type:n})}async cleanFansNew(e,n){return await this._dna_request("user/cleanFansNew",{type:e,userFollowId:n})}async collect(e,n,t=1){return await this._dna_request("forum/collect",{operateType:t,postId:e,toUserId:n})}async defaultRole(e,n=1){return await this._dna_request("user/defaultRole",{otherUserId:e,type:n})}async deleteRole(e){return await this._dna_request("role/remove",{roleBoundId:e})}async draftDelete(e){return await this._dna_request("forum/more/draftDelete",{draftId:e})}async fans(e,n,t,r){return await this._dna_request("user/fans",{otherUserId:e,pageNo:n,pageSize:t,type:r})}async fastBind(){return await this._dna_request("role/quickBound")}async follow(e,n,t,r){return await this._dna_request("user/follow",{otherUserId:e,pageNo:n,pageSize:t,type:r})}async followUser(e,n){return await this._dna_request("user/followUser",{followUserId:e,operateType:n?0:1})}async getApplyStatus(){return await this._dna_request("user/creator/getApplyStatus")}async getDraftList(e,n){return await this._dna_request("forum/getDraftList",{pageIndex:e,pageSize:n})}async getMineComment(e,n,t,r){return await this._dna_request("user/notice/mine",{otherUserId:e,pageIndex:n,pageSize:t,type:r})}async getMinePost(e,n,t,r,i,s){return await this._dna_request("forum/getMinePost",{otherUserId:e,pageIndex:n,pageSize:t,searchType:r,type:i,postType:s})}async getNotifySwitch(){return await this._dna_request("user/push/getSwitchStatus")}async historyView(e,n){return await this._dna_request("forum/historyView",{pageIndex:e,pageSize:n})}async like(e){return await this._dna_request("forum/like",e)}async manualBound(e,n,t){return await this._dna_request("role/manualBound",{roleId:e,type:n,code:t})}async mine(e,n,t,r){let i={otherUserId:e,searchType:n,type:t,postType:r};if(!e)delete i.otherUserId;return await this._dna_request("user/mine",i)}async mineV2(e){return await this._dna_request("user/mineV2",{otherUserId:e})}async moderatorByGame(e){return await this._dna_request("user/moderator/getModeratorByGame",{gameId:e})}async muteCancel(e){return await this._dna_request("forum/moderator/muteCancel",{toUserId:e})}async muteUser(e,n,t,r,i){return await this._dna_request("forum/moderator/muteUser",{toUserId:e,gameIdStr:n,type:t,reason:r,content:i})}async resetDefault(e){return await this._dna_request("role/resetDefault",{roleBoundId:e})}async roleManager(){return await this._dna_request("role/list")}}class I extends m{constructor(e){super(e)}async addAddress(e,n,t){return await this._dna_request("user/more/userAddressAdd",{receiverName:e,receiverMobile:n,receiverAddress:t})}async blackUser(e,n){return await this._dna_request("user/blackUser",{toUserId:e,type:n})}async cancelCode(e){return await this._dna_request("user/more/cancelCode",{code:e})}async cancel(e,n,t,r,i){return await this._dna_request("user/more/cancel",{cancelType:e,operateType:n,position:t,cancelReason:r,reasonDetail:i})}async deleteAddress(e){return await this._dna_request("user/more/deleteUserAddress",{addressId:e})}async editAddress(e,n,t,r){return await this._dna_request("user/more/userAddressEdit",{addressId:e,receiverName:n,receiverMobile:t,receiverAddress:r})}async feedback(e,n,t,r){return await this._dna_request("user/more/feedback",{listPic:e,proDesc:n,mobile:t,isLogin:r})}async getCancelStatus(){return await this._dna_request("user/more/getCancelStatus")}async getNotifySwitch(){return await this._dna_request("user/push/getSwitchStatus")}async getPrivateSet(){return await this._dna_request("user/getPrivateSet")}async getUserAddress(e,n){return await this._dna_request("user/more/getUserAddress",{userId:e,type:n})}async getUserBlackList(e,n){return await this._dna_request("user/getUserBlackList",{pageIndex:e,pageSize:n})}async msgListDetail(e,n,t){return await this._dna_request("user/block/listDetail",{pageNo:e,pageSize:n,type:t})}async postListDetail(e,n,t){return await this._dna_request("user/block/listDetail",{pageNo:e,pageSize:n,type:t})}async privateSet(e,n){return await this._dna_request("user/privateSet",{operateType:e,option:n})}async sendSms(e,n,t){return await this._dna_request("user/sms/sendSms",{mobile:e,timeStamp:n,type:t})}async setDefaultAddress(e){return await this._dna_request("user/more/setDefaultAddress",{addressId:e})}async setNotifySwitch(e,n){return await this._dna_request("user/push/updateSwitchStatus",{operateType:e,switchType:n})}async uploadFeedBack(e){let n=new FormData;return n.append("parts",e),await this.fileUpload("user/img/uploadFeedBack",n)}}class R extends m{constructor(e){super(e)}async draftSave(e,n,t,r,i,s,a){return await this._dna_request("forum/draftSave",{content:e,draftId:n,h5Content:t,postTitle:r,postType:i,gameId:s,videoReUpload:a})}async followUser(e,n){return await this._dna_request("user/followUser",{followUserId:e,operateType:n})}async getConfigTopicByGameId(e,n){return await this._dna_request("config/getConfigTopicByGameId",{name:e,showType:n})}async getPostPublishPage(){return await this._dna_request("forum/getPostPublishPage")}async getRecommend(e,n){return await this._dna_request("user/getRecommend",{history:e,pageSize:n})}async getTips(){return await this._dna_request("config/getTips")}async getVodToken(e,n){return await this._dna_request("forum/getVodToken",{fileName:e,title:n})}async like(e,n,t,r,i,s,a,o,b){return await this._dna_request("forum/like",{forumId:e,gameId:n,likeType:t,operateType:r,postCommentId:i,postCommentReplyId:s,postId:a,postType:o,toUserId:b})}async list(e,n,t){return await this._dna_request("forum/dynamic/list",{pageIndex:e,pageSize:n,userId:t})}async parseLink(e){return await this._dna_request("forum/parseLink",{link:e})}async posAdminEdit(e,n,t,r,i,s,a,o,b){return await this._dna_request("forum/moderator/postEdit",{content:e,gameForumId:n,h5Content:t,postId:r,postTitle:i,topics:s,postType:a,gameId:o,videoReUpload:b})}async postEdit(e,n,t,r,i,s,a,o){return await this._dna_request("forum/postEdit",{content:e,gameForumId:n,h5Content:t,postId:r,postTitle:i,topics:s,postType:a,videoReUpload:o})}async postPublish(e,n,t,r,i,s,a,o){return await this._dna_request("forum/postPublish",{content:e,draftId:n,gameForumId:t,gameId:r,h5Content:i,postTitle:s,postType:a,topics:o})}async safeCheck(e){return await this._dna_request("forum/more/safeCheck",{url:e})}async uploadImage(e){let n=new FormData;return n.append("files",e),n.append("type","post"),await this.fileUpload("config/img/upload",n)}async videoPostPublish(e,n,t,r,i,s,a,o){return await this._dna_request("forum/moderator/postPublish",{content:e,draftId:n,gameForumId:t,gameId:r,h5Content:i,postTitle:s,postType:a,topics:o})}async viewCount(e,n){return await this._dna_request("forum/viewCount",{gameId:e,postId:n})}}var Y;((r)=>{r[r.TEXT=1]="TEXT";r[r.IMAGE=2]="IMAGE";r[r.VIDEO=5]="VIDEO"})(Y||={});var l=268;class P extends m{constructor(e){super(e)}async loginLog(){return await this._dna_request("user/login/log")}async blockList(){return await this._dna_request("user/block/list")}async canEditNickName(){return await this._dna_request("user/canUpdateNameTimes")}async cancel(e,n,t,r,i){return await this._dna_request("user/more/cancel",{cancelType:e,operateType:n,position:t,cancelReason:r,reasonDetail:i})}async cleanToken(){return await this._dna_request("user/cleanToken")}async editGender(e){return await this._dna_request("user/editGender",{gender:e})}async editNickName(e){return await this._dna_request("user/updateName",{userName:e})}async getCommonConfig(){return await this._dna_request("config/getCommonConfig")}async getConfig(){return await this._dna_request("config/getConfig")}async getConfigSwitch(){return await this._dna_request("config/switchAll")}async getModeratorPermission(){return await this._dna_request("user/moderator/getModeratorPermission")}async getOpenScreen(){return await this._dna_request("config/getOpenScreen")}async getPublicKey(){return await this._dna_request("config/getRsaPublicKey")}async getUserGame(){return await this._dna_request("user/getUserGame")}async getWikiData(){return await this._dna_request("config/getGameWiki")}async haveOfficialRole(){return await this._dna_request("role/haveOfficialRole")}async isRedPoint(){return await this._dna_request("forum/dynamic/isRedPoint")}async login(e,n){let t={code:n,devCode:this.dev_code,gameList:l,loginType:1,mobile:e},r=await this._dna_request("user/sdkLogin",t,{sign:!0});if(r.is_success&&r.data){let i=r.data;if(typeof i.token==="string")this.token=i.token}return r}async oneTapLoginRestriction(){return await this._dna_request("user/oneTapLoginRestriction")}async recommendConfig(){return await this._dna_request("forum/recommend/config")}async refreshToken(e){return await this._dna_request("user/refreshToken",{refreshToken:e})}async register(e,n,t,r,i){return await this._dna_request("user/register",{code:e,devCode:n,gameList:t,mobile:r,password:i})}async saveUserInfo(e,n,t,r){return await this._dna_request("user/saveUserInfo",{gender:e,headCode:n,headUrl:t,userName:r})}async sendSms(e,n,t){return await this._dna_request("user/getSmsCode",{mobile:e,isCaptcha:t,vJson:n})}async signature(e){return await this._dna_request("user/edit/signature",{newSignature:e})}async updateHeadCode(e){return await this._dna_request("user/updateHeadCode",{headCode:e})}async updateHeadUrl(e){return await this._dna_request("user/updateHeadUrl",{headUrl:e})}async updateProfileBg(e){return await this._dna_request("user/updateBg",{bgUrl:e})}async uploadHead(e){let n=new FormData;return n.append("parts",e),await this.fileUpload("user/img/uploadHead",n)}async uploadProfileBg(e){let n=new FormData;return n.append("parts",e),await this.fileUpload("user/img/uploadMineBg",n)}async getEmoji(){return await this._dna_request("config/getEmoji")}async getGameConfig(){return await this._dna_request("config/getGameConfig")}async getGameHeadCode(){return await this._dna_request("user/getGameHeadCode")}}class T extends m{constructor(e){super(e)}async addAddress(e,n,t){return await this._dna_request("user/more/userAddressAdd",{receiverName:e,receiverMobile:n,receiverAddress:t})}async apply(e,n,t,r,i,s,a,o){return await this._dna_request("user/creator/apply",{type:e,id:n,concatWay:t,otherPlatform:r,otherPlatformUrl:i,otherPlatformFans:s,materialUrl:a,gameId:o})}async awardList(e){return await this._dna_request("encourage/draw/awardList",{drawId:e})}async awardWin(e,n,t,r){return await this._dna_request("/encourage/draw/awardWin",{drawId:e,fullName:n,mobile:t,address:r})}async buyGold(e,n){return await this._dna_request("encourage/draw/buy",{drawId:e,count:n})}async buyProduct(e,n,t,r){return await this._dna_request("/encourage/store/buyProduct",{address:e,fullName:n,mobile:t,productId:r})}async deleteAddress(e){return await this._dna_request("user/more/deleteUserAddress",{addressId:e})}async drawDetail(e){return await this._dna_request("encourage/draw/detail",{drawId:e})}async editAddress(e,n,t,r){return await this._dna_request("user/more/userAddressEdit",{addressId:e,receiverName:n,receiverMobile:t,receiverAddress:r})}async getAliProductConfig(){return await this._dna_request("encourage/store/ali/getAliStoreConfigAndBanner")}async getAliProductList(e,n,t){return await this._dna_request("encourage/store/ali/productList",{gameId:e,pageIndex:n,pageSize:t})}async getApplyPage(){return await this._dna_request("user/creator/getApplyPage")}async getExpLogsList(e,n,t){return await this._dna_request("encourage/level/getExpLogs",{gameId:e,pageIndex:n,pageSize:t})}async getGameCreator(){return await this._dna_request("config/identification/getGameCreator")}async getGoldDetailList(e,n,t,r){return await this._dna_request("encourage/gold/getGoldLogs",{pageIndex:e,pageSize:n,type:t,storeType:r})}async getProductList(e,n,t,r){return await this._dna_request("encourage/store/productList",{gameId:e,pageIndex:n,pageSize:t,storeType:r})}async getTotalGold(e){if(e!==void 0)return await this._dna_request("encourage/gold/getTotalGold",{type:e});return await this._dna_request("encourage/gold/getTotalGold")}async getUserAddress(e,n){return await this._dna_request("user/more/getUserAddress",{userId:e,type:n})}async getUserGameLevel(e,n,t){return await this._dna_request("encourage/level/getUserGameLevelDetail",{gameId:e,ifProcess:n,otherUserId:t})}async getUserGameTaskProcess(e,n){return await this._dna_request("encourage/level/getTaskProcess",{gameId:e,userId:n})}async list(e,n,t,r){return await this._dna_request("encourage/draw/list",{pageIndex:e,pageSize:n,queryType:t,gameId:r})}async page(){return await this._dna_request("user/creator/page")}async productDetail(e){return await this._dna_request("encourage/store/productDetail",{productId:e})}async setDefaultAddress(e){return await this._dna_request("user/more/setDefaultAddress",{addressId:e})}async uploadImage(e){let n=new FormData;return n.append("parts",e),await this.fileUpload("user/img/uploadHead",n)}}class F extends m{constructor(e){super(e)}async getMapMatterCategorizeOptions(){return await this._dna_request_h5("map/matter/categorize/getOptions")}async getMapCategorizeList(){return await this._dna_request_h5("map/categorize/list")}async getMapDetail(e){return await this._dna_request_h5("map/detail",{id:e})}async getMapSiteDetail(e){return await this._dna_request_h5("map/site/detail",{id:e})}async getEmojiList(){return await this._dna_request_h5("config/getEmoji")}}class $ extends _{game;home;profile;setting;trend;user;userGrowing;h5;constructor({dev_code:e="",token:n="",...t}={}){super(e,n,t);this.game=new y(this),this.home=new L(this),this.profile=new x(this),this.setting=new I(this),this.trend=new R(this),this.user=new P(this),this.userGrowing=new T(this),this.h5=new F(this)}async initialize(){await this.initializeSignConfig()}get GAME_ID(){return l}async getMhSwitchStatus(){return await this.game.getMhSwitchStatus()}async updateMhSwitchStatus(e){return await this.game.updateMhSwitchStatus(e)}async soulTask(){return await this.game.soulTask()}async defaultRoleForTool(e=1,n){return await this.game.defaultRoleForTool(e,n)}async getRoleDetail(e,n,t){return await this.game.getRoleDetail(e,n,t)}async getWeaponDetail(e,n,t){return await this.game.getWeaponDetail(e,n,t)}async getShortNoteInfo(){return await this.game.getShortNoteInfo()}async getPostList(e=48,n=1,t=20,r=1,i=0){return await this.home.getPostList(e,n,t,r,i)}async getPostDetail(e){return await this.home.getPostDetail(e)}async getPostByTopic(e=177,n=1,t=20,r=1,i=0){return await this.home.getPostByTopic(e,n,t,r,i)}async getTaskProcess(){return await this.home.getTaskProcess()}async haveSignIn(){return await this.home.haveSignIn()}async signCalendar(){return await this.home.signCalendar()}async gameSign(e,n){return await this.home.gameSignIn(e,n)}async bbsSign(){return await this.home.bbsSign()}async getRoleList(){return await this.profile.roleManager()}async adminAdjustScore(e,n,t){return await this.home.adminAdjustScore(e,n,t)}async adminDelete(e,n,t){return await this.home.adminDelete(e,n,t)}async adminMovePost(e,n,t,r){return await this.home.adminMovePost(e,n,t,r)}async adminRefreshTime(e,n){return await this.home.adminRefreshTime(e,n)}async blockList(){return await this.home.blockList()}async blockOther(e,n,t){return await this.home.blockOther(e,n,t)}async collect(e,n,t=1){return await this.home.collect(e,n,t)}async commentDelete(e,n,t,r){return await this.home.commentDelete(e,n,t,r)}async createComment(e,n){return await this.home.createComment(e,n)}async createReply(e,n){return await this.home.createReply(e,n)}async createReplyList(e,n){return await this.home.createReplyList(e,n)}async deletePost(e,n){return await this.home.deletePost(e,n)}async followUser(e,n){return await this.home.followUser(e,n)}async getFollowState(e){return await this.home.getFollowState(e)}async getDoujin(e){return await this.home.getDoujin(e)}async getExchange(e){return await this.home.getExchange(e)}async getGameBanner(e=l){return await this.home.getGameBanner(e)}async getPostCommentList(e,n=1,t=20,r=0){return await this.home.getPostCommentList(e,n,t,r)}async getRankList(e){return await this.home.getRankList(e)}async getRecommendPosts(e=l,n=1,t=20){return await this.home.getRecommendPosts(e,n,t)}async getReplyList(e,n,t=1,r=20){return await this.home.getReplyList(e,n,t,r)}async getStatistics(e=l){return await this.home.getStatistics(e)}async getTips(){return await this.home.getTips()}async getWalkthrough(e){return await this.home.getWalkthrough(e)}async hotList(e=1,n=l){return await this.home.hotList(e,n)}async isRedPoint(){return await this.home.isRedPoint()}async likePost(e){return await this.home.like(e)}async lockPost(e,n){return await this.home.lockPost(e,n)}async postDownOrUp(e,n){return await this.home.postDownOrUp(e,n)}async postElite(e,n){return await this.home.postElite(e,n)}async postHide(e,n){return await this.home.postHide(e,n)}async reRank(e,n){return await this.home.reRank(e,n)}async receiveLog(e,n,t){return await this.home.receiveLog(e,n,t)}async recommendList(e,n,t,r,i=l){return await this.home.recommendList(e,n,t,r,i)}async report({commentId:e=0,postId:n=0,replyId:t=0},r=1,i=1){return await this.home.report({commentId:e,postId:n,replyId:t},r,i)}async searchPost(e,n,t,r=l,i=1){return await this.home.searchPost(e,n,t,r,i)}async searchTopic(e,n,t=20,r=l){return await this.home.searchTopic(e,n,t,r)}async searchUser(e,n,t){return await this.home.searchUser(e,n,t)}async shareTask(){return await this.home.shareTask()}async strongRecommend(e,n=1){return await this.home.strongRecommend(e,n)}async viewCommunity(){return await this.home.viewCommunity()}async viewCount(e,n=l){return await this.home.viewCount(e,n)}async loginLog(){return await this.user.loginLog()}async login(e,n){return await this.user.login(e,n)}async getSmsCode(e,n){return await this.user.sendSms(e,n,1)}async getMine(e="",n=1,t=0){return await this.profile.mine(e,n,t)}async getOtherMine(e="709542994134436647",n=1,t=2){return await this.profile.mine(e,n,t)}async canEditNickName(){return await this.user.canEditNickName()}async cleanToken(){return await this.user.cleanToken()}async editGender(e){return await this.user.editGender(e)}async editNickName(e){return await this.user.editNickName(e)}async getCommonConfig(){return await this.user.getCommonConfig()}async getConfig(){return await this.user.getConfig()}async getConfigSwitch(){return await this.user.getConfigSwitch()}async getModeratorPermission(){return await this.user.getModeratorPermission()}async getOpenScreen(){return await this.user.getOpenScreen()}async getPublicKey(){return await this.user.getPublicKey()}async getUserGame(){return await this.user.getUserGame()}async getWikiData(){return await this.user.getWikiData()}async haveOfficialRole(){return await this.user.haveOfficialRole()}async oneTapLoginRestriction(){return await this.user.oneTapLoginRestriction()}async recommendConfig(){return await this.user.recommendConfig()}async refreshToken(e){return await this.user.refreshToken(e)}async register(e,n,t,r,i){return await this.user.register(e,n,t,r,i)}async saveUserInfo(e,n,t,r){return await this.user.saveUserInfo(e,n,t,r)}async signature(e){return await this.user.signature(e)}async updateHeadCode(e){return await this.user.updateHeadCode(e)}async updateHeadUrl(e){return await this.user.updateHeadUrl(e)}async updateProfileBg(e){return await this.user.updateProfileBg(e)}async uploadHead(e){return await this.user.uploadHead(e)}async uploadProfileBg(e){return await this.user.uploadProfileBg(e)}async getEmoji(){return await this.user.getEmoji()}async getGameConfig(){return await this.user.getGameConfig()}async getGameHeadCode(){return await this.user.getGameHeadCode()}async getMapCategorizeList(){return await this.h5.getMapCategorizeList()}async getMapDetail(e){return await this.h5.getMapDetail(e)}async getMapSiteDetail(e){return await this.h5.getMapSiteDetail(e)}async getEmojiList(){return await this.h5.getEmojiList()}async getMapMatterCategorizeOptions(){return await this.h5.getMapMatterCategorizeOptions()}async blackUser(e,n){return await this.profile.blackUser(e,n)}async cleanFansNew(e,n){return await this.profile.cleanFansNew(e,n)}async defaultRole(e,n=1){return await this.profile.defaultRole(e,n)}async deleteRole(e){return await this.profile.deleteRole(e)}async draftDelete(e){return await this.profile.draftDelete(e)}async fans(e,n,t,r){return await this.profile.fans(e,n,t,r)}async fastBind(){return await this.profile.fastBind()}async follow(e,n,t,r){return await this.profile.follow(e,n,t,r)}async getApplyStatus(){return await this.profile.getApplyStatus()}async getDraftList(e,n){return await this.profile.getDraftList(e,n)}async getMineComment(e,n,t,r){return await this.profile.getMineComment(e,n,t,r)}async getMinePost(e,n,t,r,i,s){return await this.profile.getMinePost(e,n,t,r,i,s)}async getProfileNotifySwitch(){return await this.profile.getNotifySwitch()}async historyView(e,n){return await this.profile.historyView(e,n)}async likeProfilePost(e){return await this.profile.like(e)}async manualBound(e,n,t){return await this.profile.manualBound(e,n,t)}async mine(e,n,t,r){return await this.profile.mine(e,n,t,r)}async mineV2(e){return await this.profile.mineV2(e)}async moderatorByGame(e){return await this.profile.moderatorByGame(e)}async muteCancel(e){return await this.profile.muteCancel(e)}async muteUser(e,n,t,r,i){return await this.profile.muteUser(e,n,t,r,i)}async resetDefault(e){return await this.profile.resetDefault(e)}async addAddress(e,n,t){return await this.setting.addAddress(e,n,t)}async cancelCode(e){return await this.setting.cancelCode(e)}async cancel(e,n,t,r,i){return await this.setting.cancel(e,n,t,r,i)}async deleteAddress(e){return await this.setting.deleteAddress(e)}async editAddress(e,n,t,r){return await this.setting.editAddress(e,n,t,r)}async feedback(e,n,t,r){return await this.setting.feedback(e,n,t,r)}async getCancelStatus(){return await this.setting.getCancelStatus()}async getPrivateSet(){return await this.setting.getPrivateSet()}async getUserAddress(e,n){return await this.setting.getUserAddress(e,n)}async getUserBlackList(e,n){return await this.setting.getUserBlackList(e,n)}async msgListDetail(e,n,t){return await this.setting.msgListDetail(e,n,t)}async postListDetail(e,n,t){return await this.setting.postListDetail(e,n,t)}async privateSet(e,n){return await this.setting.privateSet(e,n)}async sendSms(e,n,t){return await this.setting.sendSms(e,n,t)}async setDefaultAddress(e){return await this.setting.setDefaultAddress(e)}async setNotifySwitch(e,n){return await this.setting.setNotifySwitch(e,n)}async uploadFeedBack(e){return await this.setting.uploadFeedBack(e)}async draftSave(e,n,t,r,i,s,a){return await this.trend.draftSave(e,n,t,r,i,s,a)}async getConfigTopicByGameId(e,n){return await this.trend.getConfigTopicByGameId(e,n)}async getPostPublishPage(){return await this.trend.getPostPublishPage()}async getRecommend(e,n){return await this.trend.getRecommend(e,n)}async getVodToken(e,n){return await this.trend.getVodToken(e,n)}async trendList(e,n,t){return await this.trend.list(e,n,t)}async parseLink(e){return await this.trend.parseLink(e)}async posAdminEdit(e,n,t,r,i,s,a,o,b){return await this.trend.posAdminEdit(e,n,t,r,i,s,a,o,b)}async postEdit(e,n,t,r,i,s,a,o){return await this.trend.postEdit(e,n,t,r,i,s,a,o)}async postPublish(e,n,t,r,i,s,a,o){return await this.trend.postPublish(e,n,t,r,i,s,a,o)}async safeCheck(e){return await this.trend.safeCheck(e)}async uploadImage(e){return await this.trend.uploadImage(e)}async videoPostPublish(e,n,t,r,i,s,a,o){return await this.trend.videoPostPublish(e,n,t,r,i,s,a,o)}async apply(e,n,t,r,i,s,a,o){return await this.userGrowing.apply(e,n,t,r,i,s,a,o)}async awardList(e){return await this.userGrowing.awardList(e)}async awardWin(e,n,t,r){return await this.userGrowing.awardWin(e,n,t,r)}async buyGold(e,n){return await this.userGrowing.buyGold(e,n)}async buyProduct(e,n,t,r){return await this.userGrowing.buyProduct(e,n,t,r)}async drawDetail(e){return await this.userGrowing.drawDetail(e)}async getAliProductConfig(){return await this.userGrowing.getAliProductConfig()}async getAliProductList(e,n,t){return await this.userGrowing.getAliProductList(e,n,t)}async getApplyPage(){return await this.userGrowing.getApplyPage()}async getExpLogsList(e,n,t){return await this.userGrowing.getExpLogsList(e,n,t)}async getGameCreator(){return await this.userGrowing.getGameCreator()}async getGoldDetailList(e,n,t,r){return await this.userGrowing.getGoldDetailList(e,n,t,r)}async getProductList(e,n,t,r){return await this.userGrowing.getProductList(e,n,t,r)}async getTotalGold(e){return await this.userGrowing.getTotalGold(e)}async getUserGameLevel(e,n,t){return await this.userGrowing.getUserGameLevel(e,n,t)}async getUserGameTaskProcess(e,n){return await this.userGrowing.getUserGameTaskProcess(e,n)}async list(e,n,t,r){return await this.userGrowing.list(e,n,t,r)}async page(){return await this.userGrowing.page()}async productDetail(e){return await this.userGrowing.productDetail(e)}}export{W as swapForUploadImgApp,Z as signature_hash,G as rsa_encrypt,v as rand_str,J as md5_upper,H as build_upload_signature,V as build_signature,O as aesDecryptImageUrl,T as UserGrowingAPI,P as UserAPI,R as TrendAPI,p as TimeBasicResponse,I as SettingAPI,E as RespCode,x as ProfileAPI,Y as PostContentType,L as HomeAPI,F as H5API,y as GameAPI,l as DNA_GAME_ID,m as DNASubModule,_ as DNABaseAPI,$ as DNAAPI};
4
+ -----END PUBLIC KEY-----`,i=D.pki.publicKeyFromPem(r),s=D.util.encodeUtf8(e),a=i.encrypt(s);return D.util.encode64(a)}catch(t){throw Error(`[DNA] RSA 加密失败: ${t.message}`)}}function O(e=16){let t="";for(let r=0;r<e;r++)t+="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789".charAt(Math.floor(Math.random()*62));return t}function Y(e){let n=D.md.md5.create();return n.update(e),n.digest().toHex().toUpperCase()}function $(e){function n(t,r){let i=t.split("");for(let s=1;s<r.length;s+=2){let a=r[s-1],o=r[s];if(a>=0&&a<i.length&&o>=0&&o<i.length)[i[a],i[o]]=[i[o],i[a]]}return i.join("")}return n(Y(e),[1,13,5,17,7,23])}function z(e,n){let t=[],r=Object.keys(e).sort();for(let s of r){let a=e[s];if(a!==null&&a!==void 0&&a!=="")t.push(`${s}=${a}`)}let i=t.join("&");return $(`${i}&${n}`)}function j(e,n){let t=Date.now(),r={...e,timestamp:t,token:n},i=O(16),s=z(r,i);return{s:ee(s,i),t,k:i}}function K(e){let n=O(16),t=M(n,e);return{signature:J(t),key:n}}function J(e){let n=e.split(""),t=[[3,23],[11,32],[22,42],[25,48]];for(let[r,i]of t)if(r<n.length&&i<n.length)[n[r],n[i]]=[n[i],n[r]];return n.join("")}function Z(e,n){let t=J(e),r=D.util.decode64(t),i=D.cipher.createDecipher("AES-CBC",n);return i.start({iv:"A-16-Byte-String"}),i.update(D.util.createBuffer(r)),i.finish(),i.output.getBytes()}function ee(e,n){let t=new TextEncoder,r=t.encode(e),i=t.encode(n),s=[];for(let a=0;a<r.length;a++){let d=(r[a]&255)+(i[a%i.length]&255);s.push(`@${d}`)}return s.join("")}class L{dev_code;token;fetchFn;is_h5=!1;RSA_PUBLIC_KEY="MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDGpdbezK+eknQZQzPOjp8mr/dP+QHwk8CRkQh6C6qFnfLH3tiyl0pnt3dePuFDnM1PUXGhCkQ157ePJCQgkDU2+mimDmXh0oLFn9zuWSp+U8uLSLX3t3PpJ8TmNCROfUDWvzdbnShqg7JfDmnrOJz49qd234W84nrfTHbzdqeigQIDAQAB";BASE_URL="https://dnabbs-api.yingxiong.com/";KF_BASE_URL="https://kf.yingxiong.com/";uploadKey="";sign_api_urls=new Set;constructor(e,n="",t={}){this.dev_code=e;this.token=n;if(this.fetchFn=t.fetchFn,t.is_h5!==void 0)this.is_h5=t.is_h5;if(t.rsa_public_key!==void 0)this.RSA_PUBLIC_KEY=t.rsa_public_key}async fileUpload(e,n){let t=await this._dna_request(e,n,{sign:!0});if(t.is_success&&t.data)t.data=t.data.map((r)=>Z(r,this.uploadKey));return t}async getRsaPublicKey(){if(this.RSA_PUBLIC_KEY)return this.RSA_PUBLIC_KEY;let e=await this._dna_request("config/getRsaPublicKey");if(e.is_success&&e.data){let n=e.data.key;if(typeof n==="string")this.RSA_PUBLIC_KEY=n}return this.RSA_PUBLIC_KEY}async getHeaders(e){let{payload:n,exparams:t,dev_code:r=this.dev_code,refer:i,token:s=this.token,tokenSig:a,h5:o,kf:d}=e||{},S="application/x-www-form-urlencoded; charset=utf-8",U={version:"1.1.3",source:"ios","Content-Type":"application/x-www-form-urlencoded; charset=utf-8","User-Agent":"DoubleHelix/4 CFNetwork/3860.100.1 Darwin/25.0.0"},E={version:"3.11.0",source:"h5","Content-Type":"application/x-www-form-urlencoded; charset=utf-8","User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36"},h={version:"3.11.0",Referer:`https://kf.yingxiong.com/kf2.0/user-center?game_id=2277&herot=${Date.now()}`,"User-Agent":"Mozilla/5.0 (Linux; Android 16; PLQ110 Build/BP2A.250605.015; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/143.0.7499.192 Mobile Safari/537.36CP6.TgzO Hero/1.1.4"},C=this.is_h5||o||!1,g=d?h:C?E:U;if(r)g.devCode=r;if(i||C)g.origin="https://dnabbs.yingxiong.com",g.refer="https://dnabbs.yingxiong.com/";if(s)g.token=s;if(n instanceof FormData){let c=await this.getRsaPublicKey(),{signature:l,key:N}=K(c);if(g.t=l,this.uploadKey=N,t)for(let[f,B]of Object.entries(t))n.append(f,String(B));delete g["Content-Type"]}else if(typeof n==="object"){let c=j(n,a?s:"");if(Object.assign(n,{sign:c.s,timestamp:c.t}),t)Object.assign(n,t);let l=new URLSearchParams;Object.entries(n).forEach(([w,_])=>{l.append(w,String(_))}),n=l.toString();let N=c.k,f=await this.getRsaPublicKey(),B=M(N,f);if(this.is_h5)g.k=B;else g.rk=N,g.key=B}return{headers:g,payload:n}}async needSign(e){if(this.sign_api_urls.size===0)try{await this.initializeSignConfig()}catch(n){console.error("初始化签名配置失败:",n),this.sign_api_urls=new Set(["/user/sdkLogin","/forum/postPublish","/forum/comment/createComment","/forum/comment/createReply","/user/getSmsCode","/role/defaultRoleForTool","/media/av/cfg/getVideos","/media/av/cfg/getAudios","/media/av/cfg/getImages","/encourage/signin/signin"].map((t)=>t.replace(/^\/+/,"")))}return this.sign_api_urls.has(e)}async initializeSignConfig(){try{let e=await this._dna_request("config/getCommonConfig",void 0,{sign:!1});if(e.is_success&&e.data?.signApiConfigVo?.signApiList)this.sign_api_urls=new Set(e.data.signApiConfigVo.signApiList.map((n)=>n.replace(/^\/+/,"")))}catch(e){console.error("初始化签名配置失败:",e)}}async _dna_request_h5(e,n,t){return await this._dna_request(e,n,{...t,h5:!0})}async _dna_request_kf(e,n,t){return await this._dna_request(e,n,{...t,kf:!0})}async _dna_request(e,n,t){let{method:r="POST",sign:i,h5:s,kf:a,refer:o,params:d,max_retries:S=3,retry_delay:U=1,timeout:E=1e4,token:h,tokenSig:C}=t||{};if(e.startsWith("/"))e=e.slice(1);if(i===void 0&&await this.needSign(e))i=!0;let g;if(i){let{payload:c,headers:l}=await this.getHeaders({payload:n,refer:o,exparams:d,token:h?this.token:void 0,tokenSig:C,h5:s});n=c,g=l}else{let{headers:c}=await this.getHeaders({token:h?this.token:void 0,refer:o,h5:s,kf:a});g=c}for(let c=0;c<S;c++)try{let l=n;if(n&&typeof n==="object"&&!(n instanceof FormData)){let y=new URLSearchParams;Object.entries(n).forEach(([X,W])=>{if(W!==void 0)y.append(X,String(W))}),l=y.toString()}let N=r==="GET"?{method:r,headers:g}:{method:r,headers:g,body:l},f=new AbortController,B=setTimeout(()=>f.abort(),E),w={...N,signal:f.signal},_=a?this.KF_BASE_URL:this.BASE_URL,H=r==="GET"?`${_}${e}${l?`?${l}`:""}`:`${_}${e}`,G=this.fetchFn?await this.fetchFn(H,w):await fetch(H,w);clearTimeout(B);let Q=G.headers.get("content-type")||"",A;if(Q.includes("text/")){let y=await G.text();A={code:-999,data:y}}else A=await G.json();if(typeof A==="object"&&A!==null)try{if(typeof A.data==="string")A.data=JSON.parse(A.data)}catch{}return new p(A)}catch(l){if(console.error(`请求失败: ${l.message}`),c<S-1)await new Promise((N)=>setTimeout(N,U*2**c))}return p.err("请求服务器失败,已达最大重试次数")}}class m{_base;constructor(e){this._base=e}get dev_code(){return this._base.dev_code}get token(){return this._base.token}set token(e){this._base.token=e}get fetchFn(){return this._base.fetchFn}get is_h5(){return this._base.is_h5}get RSA_PUBLIC_KEY(){return this._base.RSA_PUBLIC_KEY}get BASE_URL(){return this._base.BASE_URL}get uploadKey(){return this._base.uploadKey}async getRsaPublicKey(){return this._base.getRsaPublicKey()}async fileUpload(e,n){return await this._base.fileUpload(e,n)}async _dna_request(e,n,t){return this._base._dna_request(e,n,t)}async _dna_request_h5(e,n,t){return this._base._dna_request_h5(e,n,t)}async _dna_request_kf(e,n,t){return this._base._dna_request_kf(e,n,t)}async getHeaders(e){return this._base.getHeaders(e)}}class x extends m{async defaultRoleForTool(e=1,n){let t={otherUserId:n,type:e};if(!n)delete t.otherUserId;return await this._dna_request("role/defaultRoleForTool",t,{sign:!0,token:!0,tokenSig:!0})}async getMhSwitchStatus(){return await this._dna_request("user/push/getMhSwitchStatus")}async getRoleDetail(e,n,t){let r={charId:e,charEid:n,type:1,otherUserId:t};return await this._dna_request("role/getCharDetail",r)}async getShortNoteInfo(){return await this._dna_request("role/getShortNoteInfo")}async getWeaponDetail(e,n,t){let r={weaponId:e,weaponEid:n,type:1,otherUserId:t};return await this._dna_request("role/getWeaponDetail",r)}async updateMhSwitchStatus(e){return await this._dna_request("user/push/updateMhSwitchStatus",{config:e})}async soulTask(){return await this._dna_request("role/soul/task")}}class V extends m{async getMapMatterCategorizeOptions(){return await this._dna_request_h5("map/matter/categorize/getOptions")}async getMapCategorizeList(){return await this._dna_request_h5("map/categorize/list")}async getMapDetail(e){return await this._dna_request_h5("map/detail",{id:e})}async getMapSiteDetail(e){return await this._dna_request_h5("map/site/detail",{id:e})}async getEmojiList(){return await this._dna_request_h5("config/getEmoji")}}var u=268;class R extends m{async adminAdjustScore(e,n,t,r=u){let i={postId:e,gameId:r??u,gameForumId:n,weight:t};return await this._dna_request("forum/moderator/setPostWeight",i)}async adminDelete(e,n,t){let r={postId:e.postId,gameId:e.gameId??u,gameForumId:e.gameForumId,content:n,reasonCode:t};return await this._dna_request("forum/moderator/postDelete",r)}async adminMovePost(e,n,t,r){let i={postId:e.postId,gameId:e.gameId??u,gameForumId:e.gameForumId,newGameId:n,newForumId:t,newTopicIdStr:r};return await this._dna_request("forum/moderator/postMove",i)}async adminRefreshTime(e,n){let t={postId:e.postId,gameId:e.gameId??u,gameForumId:e.gameForumId,refresh:n};return await this._dna_request("forum/moderator/setRefresh",t)}async blockList(){return await this._dna_request("user/block/list")}async blockOther(e,n,t){return await this._dna_request("user/block/other",{blockPostId:e,blockUserId:n,type:t})}async collect(e,n,t=1){let r={operateType:t,postId:e,toUserId:n};return await this._dna_request("forum/collect",r)}async commentDelete(e,n,t,r){let i={id:e.id,gameId:e.gameId,gameForumId:e.gameForumId,entityType:n,content:t,reasonCode:r};return await this._dna_request("forum/commentReplyDelete",i)}async createComment(e,n){let t=JSON.stringify([{content:n,contentType:"1"}]),r={postId:e.postId,forumId:e.gameForumId,postType:"1",content:t};return await this._dna_request("forum/comment/createComment",r,{sign:!0,params:{toUserId:e.userId}})}async createReply(e,n){let r={content:JSON.stringify([{content:n,contentType:"1",imgHeight:0,imgWidth:0,url:""}]),forumId:e.gameForumId,postCommentId:e.postCommentId,postId:e.postId,postType:"1",toUserId:e.userId};return await this._dna_request("forum/comment/createReply",r,{sign:!0,params:{toUserId:e.userId}})}async createReplyList(e,n){let r={content:JSON.stringify([{content:n,contentType:"1",imgHeight:0,imgWidth:0,url:""}]),forumId:e.gameForumId,postCommentId:e.postCommentId,postCommentReplyId:e.postCommentReplyId,postId:e.postId,postType:"1",toUserId:e.userId};return await this._dna_request("forum/comment/createReply",r,{sign:!0,params:{toUserId:e.userId}})}async deletePost(e,n){return await this._dna_request("forum/more/delete",{deleteType:e,id:n},{sign:!0,refer:!0})}async followUser(e,n){let t={followUserId:e,operateType:n?0:1};return await this._dna_request("user/followUser",t,{sign:!0})}async getFollowState(e){let n={followUserId:e};return await this._dna_request("user/isFollow",n)}async gameSignIn(e,n){let t={dayAwardId:e,periodId:n,signinType:1};return await this._dna_request("encourage/signin/signin",t,{sign:!0,tokenSig:!0})}async getDoujin(e){return await this._dna_request("forum/discuss/getDoujin",{forumId:e})}async getExchange(e){return await this._dna_request("forum/discuss/getExchange",{forumId:e})}async getGameBanner(e=u){return await this._dna_request("forum/gameBanner",{gameId:e})}async getPostByTopic(e=177,n=1,t=20,r=1,i=0){let s={topicId:e,gameId:u,pageIndex:n,pageSize:t,searchType:r,timeType:i};return await this._dna_request("forum/getPostByTopic",s)}async getPostCommentList(e,n=1,t=20,r=0){return await this._dna_request("forum/comment/getPostCommentList",{postId:e,pageIndex:n,pageSize:t,isOnlyPublisher:r})}async getPostDetail(e){return await this._dna_request("forum/getPostDetail",{postId:e})}async getPostList(e=48,n=1,t=20,r=1,i=0){let s={forumId:e,gameId:u,pageIndex:n,pageSize:t,searchType:r,timeType:i};return await this._dna_request("forum/list",s)}async getRankList(e){return await this._dna_request("forum/discuss/getRank",{forumId:e})}async getRecommendPosts(e=u,n=1,t=20){return await this._dna_request("forum/getRecommendPosts",{gameId:e,pageIndex:n,pageSize:t})}async getReplyList(e,n,t=1,r=20){return await this._dna_request("forum/comment/getReplyList",{postId:e,postCommentId:n,pageIndex:t,pageSize:r})}async getStatistics(e=u){return await this._dna_request("forum/statistics",{gameId:e})}async getTips(){return await this._dna_request("config/getTips")}async getWalkthrough(e){return await this._dna_request("forum/discuss/getWalkthrough",{forumId:e})}async hotList(e=1,n=u){return await this._dna_request("forum/hot/ranking/list",{gameId:n,type:e})}async haveSignIn(){let e={gameId:u};return await this._dna_request("user/haveSignInNew",e)}async isRedPoint(){return await this._dna_request("forum/dynamic/isRedPoint")}async signCalendar(){let e={gameId:u};return await this._dna_request("encourage/signin/show",e)}async like(e){let n={forumId:e.gameForumId,gameId:u,likeType:"1",operateType:"1",postCommentId:"",postCommentReplyId:"",postId:e.postId,postType:e.postType,toUserId:e.userId};return await this._dna_request("forum/like",n)}async lockPost(e,n){let t={postId:e.postId,gameId:e.gameId??u,gameForumId:e.gameForumId,operateType:n};return await this._dna_request("forum/moderator/postLock",t)}async postDownOrUp(e,n){let t={postId:e.postId,gameId:e.gameId??u,gameForumId:e.gameForumId,operateType:n};return await this._dna_request("forum/moderator/postDownOrUp",t)}async postElite(e,n){let t={postId:e.postId,gameId:e.gameId??u,gameForumId:e.gameForumId,operateType:n};return await this._dna_request("forum/moderator/postElite",t)}async postHide(e,n){let t={postId:e.postId,gameId:e.gameId??u,gameForumId:e.gameForumId,operateType:n};return await this._dna_request("forum/moderator/postHide",t)}async reRank(e,n){let t={postId:e.postId,gameId:e.gameId??u,gameForumId:e.gameForumId,weight:n};return await this._dna_request("forum/moderator/reRank",t)}async receiveLog(e,n,t){let r={periodId:e,pageIndex:n,pageSize:t};return await this._dna_request("encourage/signin/receiveLog",r)}async recommendList(e,n,t,r,i=u){let s={gameId:i,recIndex:e,newIndex:n,size:t,history:r};return await this._dna_request("forum/recommend/list",s)}async report({commentId:e=0,postId:n=0,replyId:t=0},r=1,i=1){let s={commentId:e,postId:n,replyId:t,reportReason:r,reportType:i};return await this._dna_request("forum/more/report",s)}async searchPost(e,n,t,r=u,i=1){let s={gameId:r,keyword:e,pageIndex:n,pageSize:t,searchType:i};return await this._dna_request("forum/searchPost",s)}async searchTopic(e,n,t=20,r=u){let i={gameId:r,keyword:e,pageIndex:n,pageSize:t};return await this._dna_request("forum/searchPost",i)}async searchUser(e,n,t){let r={keyword:e,pageIndex:n,pageSize:t};return await this._dna_request("forum/searchPost",r)}async shareTask(){let e={gameId:u};return await this._dna_request("encourage/level/shareTask",e)}async bbsSign(){let e={gameId:u};return await this._dna_request("user/signIn",e)}async strongRecommend(e,n=1){let t={postId:e.postId,gameId:e.gameId??u,gameForumId:e.gameForumId,operateType:n};return await this._dna_request("forum/moderator/setForceRecommend",t)}async viewCommunity(){return await this._dna_request("encourage/level/viewCommunity")}async viewCount(e,n=u){return await this._dna_request("forum/viewCount",{gameId:n,postId:e})}async getTaskProcess(){let e={gameId:u};return await this._dna_request("encourage/level/getTaskProcess",e)}async soulTask(){return await this._dna_request("role/soul/task")}}class I extends m{async blackUser(e,n){return await this._dna_request("user/blackUser",{toUserId:e,type:n})}async cleanFansNew(e,n){return await this._dna_request("user/cleanFansNew",{type:e,userFollowId:n})}async collect(e,n,t=1){return await this._dna_request("forum/collect",{operateType:t,postId:e,toUserId:n})}async defaultRole(e,n=1){return await this._dna_request("user/defaultRole",{otherUserId:e,type:n})}async deleteRole(e){return await this._dna_request("role/remove",{roleBoundId:e})}async draftDelete(e){return await this._dna_request("forum/more/draftDelete",{draftId:e})}async fans(e,n,t,r){return await this._dna_request("user/fans",{otherUserId:e,pageNo:n,pageSize:t,type:r})}async fastBind(){return await this._dna_request("role/quickBound")}async follow(e,n,t,r){return await this._dna_request("user/follow",{otherUserId:e,pageNo:n,pageSize:t,type:r})}async followUser(e,n){return await this._dna_request("user/followUser",{followUserId:e,operateType:n?0:1})}async getApplyStatus(){return await this._dna_request("user/creator/getApplyStatus")}async getDraftList(e,n){return await this._dna_request("forum/getDraftList",{pageIndex:e,pageSize:n})}async getMineComment(e,n,t,r){return await this._dna_request("user/notice/mine",{otherUserId:e,pageIndex:n,pageSize:t,type:r})}async getMinePost(e,n,t,r,i,s){return await this._dna_request("forum/getMinePost",{otherUserId:e,pageIndex:n,pageSize:t,searchType:r,type:i,postType:s})}async getNotifySwitch(){return await this._dna_request("user/push/getSwitchStatus")}async historyView(e,n){return await this._dna_request("forum/historyView",{pageIndex:e,pageSize:n})}async like(e){return await this._dna_request("forum/like",e)}async manualBound(e,n,t){return await this._dna_request("role/manualBound",{roleId:e,type:n,code:t})}async mine(e,n,t,r){let i={otherUserId:e,searchType:n,type:t,postType:r};if(!e)delete i.otherUserId;return await this._dna_request("user/mine",i)}async mineV2(e){return await this._dna_request("user/mineV2",{otherUserId:e})}async moderatorByGame(e){return await this._dna_request("user/moderator/getModeratorByGame",{gameId:e})}async muteCancel(e){return await this._dna_request("forum/moderator/muteCancel",{toUserId:e})}async muteUser(e,n,t,r,i){return await this._dna_request("forum/moderator/muteUser",{toUserId:e,gameIdStr:n,type:t,reason:r,content:i})}async resetDefault(e){return await this._dna_request("role/resetDefault",{roleBoundId:e})}async roleManager(){return await this._dna_request("role/list")}}class P extends m{async addAddress(e,n,t){return await this._dna_request("user/more/userAddressAdd",{receiverName:e,receiverMobile:n,receiverAddress:t})}async blackUser(e,n){return await this._dna_request("user/blackUser",{toUserId:e,type:n})}async cancelCode(e){return await this._dna_request("user/more/cancelCode",{code:e})}async cancel(e,n,t,r,i){return await this._dna_request("user/more/cancel",{cancelType:e,operateType:n,position:t,cancelReason:r,reasonDetail:i})}async deleteAddress(e){return await this._dna_request("user/more/deleteUserAddress",{addressId:e})}async editAddress(e,n,t,r){return await this._dna_request("user/more/userAddressEdit",{addressId:e,receiverName:n,receiverMobile:t,receiverAddress:r})}async feedback(e,n,t,r){return await this._dna_request("user/more/feedback",{listPic:e,proDesc:n,mobile:t,isLogin:r})}async getCancelStatus(){return await this._dna_request("user/more/getCancelStatus")}async getNotifySwitch(){return await this._dna_request("user/push/getSwitchStatus")}async getPrivateSet(){return await this._dna_request("user/getPrivateSet")}async getUserAddress(e,n){return await this._dna_request("user/more/getUserAddress",{userId:e,type:n})}async getUserBlackList(e,n){return await this._dna_request("user/getUserBlackList",{pageIndex:e,pageSize:n})}async msgListDetail(e,n,t){return await this._dna_request("user/block/listDetail",{pageNo:e,pageSize:n,type:t})}async postListDetail(e,n,t){return await this._dna_request("user/block/listDetail",{pageNo:e,pageSize:n,type:t})}async privateSet(e,n){return await this._dna_request("user/privateSet",{operateType:e,option:n})}async sendSms(e,n,t){return await this._dna_request("user/sms/sendSms",{mobile:e,timeStamp:n,type:t})}async setDefaultAddress(e){return await this._dna_request("user/more/setDefaultAddress",{addressId:e})}async setNotifySwitch(e,n){return await this._dna_request("user/push/updateSwitchStatus",{operateType:e,switchType:n})}async uploadFeedBack(e){let n=new FormData;return n.append("parts",e),await this.fileUpload("user/img/uploadFeedBack",n)}}class T extends m{async draftSave(e,n,t,r,i,s,a){return await this._dna_request("forum/draftSave",{content:e,draftId:n,h5Content:t,postTitle:r,postType:i,gameId:s,videoReUpload:a})}async followUser(e,n){return await this._dna_request("user/followUser",{followUserId:e,operateType:n})}async getConfigTopicByGameId(e,n){return await this._dna_request("config/getConfigTopicByGameId",{name:e,showType:n})}async getPostPublishPage(){return await this._dna_request("forum/getPostPublishPage")}async getRecommend(e,n){return await this._dna_request("user/getRecommend",{history:e,pageSize:n})}async getTips(){return await this._dna_request("config/getTips")}async getVodToken(e,n){return await this._dna_request("forum/getVodToken",{fileName:e,title:n})}async like(e,n,t,r,i,s,a,o,d){return await this._dna_request("forum/like",{forumId:e,gameId:n,likeType:t,operateType:r,postCommentId:i,postCommentReplyId:s,postId:a,postType:o,toUserId:d})}async list(e,n,t){return await this._dna_request("forum/dynamic/list",{pageIndex:e,pageSize:n,userId:t})}async parseLink(e){return await this._dna_request("forum/parseLink",{link:e})}async posAdminEdit(e,n,t,r,i,s,a,o,d){return await this._dna_request("forum/moderator/postEdit",{content:e,gameForumId:n,h5Content:t,postId:r,postTitle:i,topics:s,postType:a,gameId:o,videoReUpload:d})}async postEdit(e,n,t,r,i,s,a,o){return await this._dna_request("forum/postEdit",{content:e,gameForumId:n,h5Content:t,postId:r,postTitle:i,topics:s,postType:a,videoReUpload:o})}async postPublish(e,n,t,r,i,s,a,o){return await this._dna_request("forum/postPublish",{content:e,draftId:n,gameForumId:t,gameId:r,h5Content:i,postTitle:s,postType:a,topics:o})}async safeCheck(e){return await this._dna_request("forum/more/safeCheck",{url:e})}async uploadImage(e){let n=new FormData;return n.append("files",e),n.append("type","post"),await this.fileUpload("config/img/upload",n)}async videoPostPublish(e,n,t,r,i,s,a,o){return await this._dna_request("forum/moderator/postPublish",{content:e,draftId:n,gameForumId:t,gameId:r,h5Content:i,postTitle:s,postType:a,topics:o})}async viewCount(e,n){return await this._dna_request("forum/viewCount",{gameId:e,postId:n})}}var ne;((r)=>{r[r.TEXT=1]="TEXT";r[r.IMAGE=2]="IMAGE";r[r.VIDEO=5]="VIDEO"})(ne||={});var b=268;class q extends m{async loginLog(){return await this._dna_request("user/login/log")}async blockList(){return await this._dna_request("user/block/list")}async canEditNickName(){return await this._dna_request("user/canUpdateNameTimes")}async cancel(e,n,t,r,i){return await this._dna_request("user/more/cancel",{cancelType:e,operateType:n,position:t,cancelReason:r,reasonDetail:i})}async cleanToken(){return await this._dna_request("user/cleanToken")}async editGender(e){return await this._dna_request("user/editGender",{gender:e})}async editNickName(e){return await this._dna_request("user/updateName",{userName:e})}async getCommonConfig(){return await this._dna_request("config/getCommonConfig")}async getConfig(){return await this._dna_request("config/getConfig")}async getConfigSwitch(){return await this._dna_request("config/switchAll")}async getModeratorPermission(){return await this._dna_request("user/moderator/getModeratorPermission")}async getOpenScreen(){return await this._dna_request("config/getOpenScreen")}async getPublicKey(){return await this._dna_request("config/getRsaPublicKey")}async getUserGame(){return await this._dna_request("user/getUserGame")}async getWikiData(){return await this._dna_request("config/getGameWiki")}async haveOfficialRole(){return await this._dna_request("role/haveOfficialRole")}async isRedPoint(){return await this._dna_request("forum/dynamic/isRedPoint")}async login(e,n){let t={code:n,devCode:this.dev_code,gameList:b,loginType:1,mobile:e},r=await this._dna_request("user/sdkLogin",t,{sign:!0});if(r.is_success&&r.data){let i=r.data;if(typeof i.token==="string")this.token=i.token}return r}async oneTapLoginRestriction(){return await this._dna_request("user/oneTapLoginRestriction")}async recommendConfig(){return await this._dna_request("forum/recommend/config")}async refreshToken(e){return await this._dna_request("user/refreshToken",{refreshToken:e})}async register(e,n,t,r,i){return await this._dna_request("user/register",{code:e,devCode:n,gameList:t,mobile:r,password:i})}async saveUserInfo(e,n,t,r){return await this._dna_request("user/saveUserInfo",{gender:e,headCode:n,headUrl:t,userName:r})}async sendSms(e,n,t){return await this._dna_request("user/getSmsCode",{mobile:e,isCaptcha:t,vJson:n})}async signature(e){return await this._dna_request("user/edit/signature",{newSignature:e})}async updateHeadCode(e){return await this._dna_request("user/updateHeadCode",{headCode:e})}async updateHeadUrl(e){return await this._dna_request("user/updateHeadUrl",{headUrl:e})}async updateProfileBg(e){return await this._dna_request("user/updateBg",{bgUrl:e})}async uploadHead(e){let n=new FormData;return n.append("parts",e),await this.fileUpload("user/img/uploadHead",n)}async uploadProfileBg(e){let n=new FormData;return n.append("parts",e),await this.fileUpload("user/img/uploadMineBg",n)}async getEmoji(){return await this._dna_request("config/getEmoji")}async getGameConfig(){return await this._dna_request("config/getGameConfig")}async getGameHeadCode(){return await this._dna_request("user/getGameHeadCode")}}class k extends m{async addAddress(e,n,t){return await this._dna_request("user/more/userAddressAdd",{receiverName:e,receiverMobile:n,receiverAddress:t})}async apply(e,n,t,r,i,s,a,o){return await this._dna_request("user/creator/apply",{type:e,id:n,concatWay:t,otherPlatform:r,otherPlatformUrl:i,otherPlatformFans:s,materialUrl:a,gameId:o})}async awardList(e){return await this._dna_request("encourage/draw/awardList",{drawId:e})}async awardWin(e,n,t,r){return await this._dna_request("/encourage/draw/awardWin",{drawId:e,fullName:n,mobile:t,address:r})}async buyGold(e,n){return await this._dna_request("encourage/draw/buy",{drawId:e,count:n})}async buyProduct(e,n,t,r){return await this._dna_request("/encourage/store/buyProduct",{address:e,fullName:n,mobile:t,productId:r})}async deleteAddress(e){return await this._dna_request("user/more/deleteUserAddress",{addressId:e})}async drawDetail(e){return await this._dna_request("encourage/draw/detail",{drawId:e})}async editAddress(e,n,t,r){return await this._dna_request("user/more/userAddressEdit",{addressId:e,receiverName:n,receiverMobile:t,receiverAddress:r})}async getAliProductConfig(){return await this._dna_request("encourage/store/ali/getAliStoreConfigAndBanner")}async getAliProductList(e,n,t){return await this._dna_request("encourage/store/ali/productList",{gameId:e,pageIndex:n,pageSize:t})}async getApplyPage(){return await this._dna_request("user/creator/getApplyPage")}async getExpLogsList(e,n,t){return await this._dna_request("encourage/level/getExpLogs",{gameId:e,pageIndex:n,pageSize:t})}async getGameCreator(){return await this._dna_request("config/identification/getGameCreator")}async getGoldDetailList(e,n,t,r){return await this._dna_request("encourage/gold/getGoldLogs",{pageIndex:e,pageSize:n,type:t,storeType:r})}async getProductList(e,n,t,r){return await this._dna_request("encourage/store/productList",{gameId:e,pageIndex:n,pageSize:t,storeType:r})}async getTotalGold(e){if(e!==void 0)return await this._dna_request("encourage/gold/getTotalGold",{type:e});return await this._dna_request("encourage/gold/getTotalGold")}async getUserAddress(e,n){return await this._dna_request("user/more/getUserAddress",{userId:e,type:n})}async getUserGameLevel(e,n,t){return await this._dna_request("encourage/level/getUserGameLevelDetail",{gameId:e,ifProcess:n,otherUserId:t})}async getUserGameTaskProcess(e,n){return await this._dna_request("encourage/level/getTaskProcess",{gameId:e,userId:n})}async list(e,n,t,r){return await this._dna_request("encourage/draw/list",{pageIndex:e,pageSize:n,queryType:t,gameId:r})}async page(){return await this._dna_request("user/creator/page")}async productDetail(e){return await this._dna_request("encourage/store/productDetail",{productId:e})}async setDefaultAddress(e){return await this._dna_request("user/more/setDefaultAddress",{addressId:e})}async uploadImage(e){let n=new FormData;return n.append("parts",e),await this.fileUpload("user/img/uploadHead",n)}}class v extends m{base_param={game_id:2277,lang:"zh"};async getUserInfo(){return this._dna_request_kf("/v1/frontend/login/getUserInfo",this.base_param,{method:"GET"})}async getRole(){return this._dna_request_kf("/v1/frontend/role/getRole",this.base_param,{method:"GET"})}async sendGameMail(e,n=29046){return this._dna_request_kf("/v1/public/role/sendGameMail",{...this.base_param,server_id:n,role:e})}async verifyRoleMailCode(e){return this._dna_request_kf("/v1/frontend/role/verify",{...this.base_param,mail_code:e})}async getServerType(e=2277){return this._dna_request_kf("/v1/public/select/serverType",{...this.base_param,game_id:e},{method:"GET"})}async getServerList(e=230){return this._dna_request_kf("/v1/public/select/getServerList",{...this.base_param,type_id:e},{method:"GET"})}async getPropCategory(){return this._dna_request_kf("/v1/public/selfService/getPropCategory",this.base_param,{method:"GET"})}async queryFlow(e,n,t,r="Resource",i=29046){return this._dna_request_kf("/v1/frontend/selfService/queryFlow",{date:e,name:n,role:t,server_id:i,category_id:r})}async bindRole(e,n,t){return this._dna_request_kf("/v1/frontend/role/bindRole",{server_id:e,role:n,mail_code:t})}async bindDefaultRole(){return this._dna_request_kf("/v1/public/role/default",this.base_param)}async getCode(){return this._dna_request_kf("/v1/frontend/selfService/getCode")}async sendVerifyCode(){return this._dna_request_kf("/v1/frontend/selfService/sendVerifyCode")}async changePhone(){return this._dna_request_kf("/v1/frontend/selfService/changePhone")}async chooseRole(){return this._dna_request_kf("/v1/frontend/role/chooseRole")}async decodePhone(e){return this._dna_request_kf("/v1/public/kf/decode",{verify_code:e})}async captcha(){return this._dna_request_kf("/v1/public/login/captcha",void 0,{method:"GET"})}}class te extends L{game;home;profile;setting;trend;user;kf;userGrowing;h5;constructor({dev_code:e="",token:n="",...t}={}){super(e,n,t);this.game=new x(this),this.home=new R(this),this.profile=new I(this),this.setting=new P(this),this.trend=new T(this),this.user=new q(this),this.userGrowing=new k(this),this.h5=new V(this),this.kf=new v(this)}async initialize(){await this.initializeSignConfig()}get GAME_ID(){return b}async getMhSwitchStatus(){return await this.game.getMhSwitchStatus()}async updateMhSwitchStatus(e){return await this.game.updateMhSwitchStatus(e)}async soulTask(){return await this.game.soulTask()}async defaultRoleForTool(e=1,n){return await this.game.defaultRoleForTool(e,n)}async getRoleDetail(e,n,t){return await this.game.getRoleDetail(e,n,t)}async getWeaponDetail(e,n,t){return await this.game.getWeaponDetail(e,n,t)}async getShortNoteInfo(){return await this.game.getShortNoteInfo()}async getPostList(e=48,n=1,t=20,r=1,i=0){return await this.home.getPostList(e,n,t,r,i)}async getPostDetail(e){return await this.home.getPostDetail(e)}async getPostByTopic(e=177,n=1,t=20,r=1,i=0){return await this.home.getPostByTopic(e,n,t,r,i)}async getTaskProcess(){return await this.home.getTaskProcess()}async haveSignIn(){return await this.home.haveSignIn()}async signCalendar(){return await this.home.signCalendar()}async gameSign(e,n){return await this.home.gameSignIn(e,n)}async bbsSign(){return await this.home.bbsSign()}async getRoleList(){return await this.profile.roleManager()}async adminAdjustScore(e,n,t){return await this.home.adminAdjustScore(e,n,t)}async adminDelete(e,n,t){return await this.home.adminDelete(e,n,t)}async adminMovePost(e,n,t,r){return await this.home.adminMovePost(e,n,t,r)}async adminRefreshTime(e,n){return await this.home.adminRefreshTime(e,n)}async blockList(){return await this.home.blockList()}async blockOther(e,n,t){return await this.home.blockOther(e,n,t)}async collect(e,n,t=1){return await this.home.collect(e,n,t)}async commentDelete(e,n,t,r){return await this.home.commentDelete(e,n,t,r)}async createComment(e,n){return await this.home.createComment(e,n)}async createReply(e,n){return await this.home.createReply(e,n)}async createReplyList(e,n){return await this.home.createReplyList(e,n)}async deletePost(e,n){return await this.home.deletePost(e,n)}async followUser(e,n){return await this.home.followUser(e,n)}async getFollowState(e){return await this.home.getFollowState(e)}async getDoujin(e){return await this.home.getDoujin(e)}async getExchange(e){return await this.home.getExchange(e)}async getGameBanner(e=b){return await this.home.getGameBanner(e)}async getPostCommentList(e,n=1,t=20,r=0){return await this.home.getPostCommentList(e,n,t,r)}async getRankList(e){return await this.home.getRankList(e)}async getRecommendPosts(e=b,n=1,t=20){return await this.home.getRecommendPosts(e,n,t)}async getReplyList(e,n,t=1,r=20){return await this.home.getReplyList(e,n,t,r)}async getStatistics(e=b){return await this.home.getStatistics(e)}async getTips(){return await this.home.getTips()}async getWalkthrough(e){return await this.home.getWalkthrough(e)}async hotList(e=1,n=b){return await this.home.hotList(e,n)}async isRedPoint(){return await this.home.isRedPoint()}async likePost(e){return await this.home.like(e)}async lockPost(e,n){return await this.home.lockPost(e,n)}async postDownOrUp(e,n){return await this.home.postDownOrUp(e,n)}async postElite(e,n){return await this.home.postElite(e,n)}async postHide(e,n){return await this.home.postHide(e,n)}async reRank(e,n){return await this.home.reRank(e,n)}async receiveLog(e,n,t){return await this.home.receiveLog(e,n,t)}async recommendList(e,n,t,r,i=b){return await this.home.recommendList(e,n,t,r,i)}async report({commentId:e=0,postId:n=0,replyId:t=0},r=1,i=1){return await this.home.report({commentId:e,postId:n,replyId:t},r,i)}async searchPost(e,n,t,r=b,i=1){return await this.home.searchPost(e,n,t,r,i)}async searchTopic(e,n,t=20,r=b){return await this.home.searchTopic(e,n,t,r)}async searchUser(e,n,t){return await this.home.searchUser(e,n,t)}async shareTask(){return await this.home.shareTask()}async strongRecommend(e,n=1){return await this.home.strongRecommend(e,n)}async viewCommunity(){return await this.home.viewCommunity()}async viewCount(e,n=b){return await this.home.viewCount(e,n)}async loginLog(){return await this.user.loginLog()}async login(e,n){return await this.user.login(e,n)}async getSmsCode(e,n){return await this.user.sendSms(e,n,1)}async getMine(e="",n=1,t=0){return await this.profile.mine(e,n,t)}async getOtherMine(e="709542994134436647",n=1,t=2){return await this.profile.mine(e,n,t)}async canEditNickName(){return await this.user.canEditNickName()}async cleanToken(){return await this.user.cleanToken()}async editGender(e){return await this.user.editGender(e)}async editNickName(e){return await this.user.editNickName(e)}async getCommonConfig(){return await this.user.getCommonConfig()}async getConfig(){return await this.user.getConfig()}async getConfigSwitch(){return await this.user.getConfigSwitch()}async getModeratorPermission(){return await this.user.getModeratorPermission()}async getOpenScreen(){return await this.user.getOpenScreen()}async getPublicKey(){return await this.user.getPublicKey()}async getUserGame(){return await this.user.getUserGame()}async getWikiData(){return await this.user.getWikiData()}async haveOfficialRole(){return await this.user.haveOfficialRole()}async oneTapLoginRestriction(){return await this.user.oneTapLoginRestriction()}async recommendConfig(){return await this.user.recommendConfig()}async refreshToken(e){return await this.user.refreshToken(e)}async register(e,n,t,r,i){return await this.user.register(e,n,t,r,i)}async saveUserInfo(e,n,t,r){return await this.user.saveUserInfo(e,n,t,r)}async signature(e){return await this.user.signature(e)}async updateHeadCode(e){return await this.user.updateHeadCode(e)}async updateHeadUrl(e){return await this.user.updateHeadUrl(e)}async updateProfileBg(e){return await this.user.updateProfileBg(e)}async uploadHead(e){return await this.user.uploadHead(e)}async uploadProfileBg(e){return await this.user.uploadProfileBg(e)}async getEmoji(){return await this.user.getEmoji()}async getGameConfig(){return await this.user.getGameConfig()}async getGameHeadCode(){return await this.user.getGameHeadCode()}async getMapCategorizeList(){return await this.h5.getMapCategorizeList()}async getMapDetail(e){return await this.h5.getMapDetail(e)}async getMapSiteDetail(e){return await this.h5.getMapSiteDetail(e)}async getEmojiList(){return await this.h5.getEmojiList()}async getMapMatterCategorizeOptions(){return await this.h5.getMapMatterCategorizeOptions()}async blackUser(e,n){return await this.profile.blackUser(e,n)}async cleanFansNew(e,n){return await this.profile.cleanFansNew(e,n)}async defaultRole(e,n=1){return await this.profile.defaultRole(e,n)}async deleteRole(e){return await this.profile.deleteRole(e)}async draftDelete(e){return await this.profile.draftDelete(e)}async fans(e,n,t,r){return await this.profile.fans(e,n,t,r)}async fastBind(){return await this.profile.fastBind()}async follow(e,n,t,r){return await this.profile.follow(e,n,t,r)}async getApplyStatus(){return await this.profile.getApplyStatus()}async getDraftList(e,n){return await this.profile.getDraftList(e,n)}async getMineComment(e,n,t,r){return await this.profile.getMineComment(e,n,t,r)}async getMinePost(e,n,t,r,i,s){return await this.profile.getMinePost(e,n,t,r,i,s)}async getProfileNotifySwitch(){return await this.profile.getNotifySwitch()}async historyView(e,n){return await this.profile.historyView(e,n)}async likeProfilePost(e){return await this.profile.like(e)}async manualBound(e,n,t){return await this.profile.manualBound(e,n,t)}async mine(e,n,t,r){return await this.profile.mine(e,n,t,r)}async mineV2(e){return await this.profile.mineV2(e)}async moderatorByGame(e){return await this.profile.moderatorByGame(e)}async muteCancel(e){return await this.profile.muteCancel(e)}async muteUser(e,n,t,r,i){return await this.profile.muteUser(e,n,t,r,i)}async resetDefault(e){return await this.profile.resetDefault(e)}async addAddress(e,n,t){return await this.setting.addAddress(e,n,t)}async cancelCode(e){return await this.setting.cancelCode(e)}async cancel(e,n,t,r,i){return await this.setting.cancel(e,n,t,r,i)}async deleteAddress(e){return await this.setting.deleteAddress(e)}async editAddress(e,n,t,r){return await this.setting.editAddress(e,n,t,r)}async feedback(e,n,t,r){return await this.setting.feedback(e,n,t,r)}async getCancelStatus(){return await this.setting.getCancelStatus()}async getPrivateSet(){return await this.setting.getPrivateSet()}async getUserAddress(e,n){return await this.setting.getUserAddress(e,n)}async getUserBlackList(e,n){return await this.setting.getUserBlackList(e,n)}async msgListDetail(e,n,t){return await this.setting.msgListDetail(e,n,t)}async postListDetail(e,n,t){return await this.setting.postListDetail(e,n,t)}async privateSet(e,n){return await this.setting.privateSet(e,n)}async sendSms(e,n,t){return await this.setting.sendSms(e,n,t)}async setDefaultAddress(e){return await this.setting.setDefaultAddress(e)}async setNotifySwitch(e,n){return await this.setting.setNotifySwitch(e,n)}async uploadFeedBack(e){return await this.setting.uploadFeedBack(e)}async draftSave(e,n,t,r,i,s,a){return await this.trend.draftSave(e,n,t,r,i,s,a)}async getConfigTopicByGameId(e,n){return await this.trend.getConfigTopicByGameId(e,n)}async getPostPublishPage(){return await this.trend.getPostPublishPage()}async getRecommend(e,n){return await this.trend.getRecommend(e,n)}async getVodToken(e,n){return await this.trend.getVodToken(e,n)}async trendList(e,n,t){return await this.trend.list(e,n,t)}async parseLink(e){return await this.trend.parseLink(e)}async posAdminEdit(e,n,t,r,i,s,a,o,d){return await this.trend.posAdminEdit(e,n,t,r,i,s,a,o,d)}async postEdit(e,n,t,r,i,s,a,o){return await this.trend.postEdit(e,n,t,r,i,s,a,o)}async postPublish(e,n,t,r,i,s,a,o){return await this.trend.postPublish(e,n,t,r,i,s,a,o)}async safeCheck(e){return await this.trend.safeCheck(e)}async uploadImage(e){return await this.trend.uploadImage(e)}async videoPostPublish(e,n,t,r,i,s,a,o){return await this.trend.videoPostPublish(e,n,t,r,i,s,a,o)}async apply(e,n,t,r,i,s,a,o){return await this.userGrowing.apply(e,n,t,r,i,s,a,o)}async awardList(e){return await this.userGrowing.awardList(e)}async awardWin(e,n,t,r){return await this.userGrowing.awardWin(e,n,t,r)}async buyGold(e,n){return await this.userGrowing.buyGold(e,n)}async buyProduct(e,n,t,r){return await this.userGrowing.buyProduct(e,n,t,r)}async drawDetail(e){return await this.userGrowing.drawDetail(e)}async getAliProductConfig(){return await this.userGrowing.getAliProductConfig()}async getAliProductList(e,n,t){return await this.userGrowing.getAliProductList(e,n,t)}async getApplyPage(){return await this.userGrowing.getApplyPage()}async getExpLogsList(e,n,t){return await this.userGrowing.getExpLogsList(e,n,t)}async getGameCreator(){return await this.userGrowing.getGameCreator()}async getGoldDetailList(e,n,t,r){return await this.userGrowing.getGoldDetailList(e,n,t,r)}async getProductList(e,n,t,r){return await this.userGrowing.getProductList(e,n,t,r)}async getTotalGold(e){return await this.userGrowing.getTotalGold(e)}async getUserGameLevel(e,n,t){return await this.userGrowing.getUserGameLevel(e,n,t)}async getUserGameTaskProcess(e,n){return await this.userGrowing.getUserGameTaskProcess(e,n)}async list(e,n,t,r){return await this.userGrowing.list(e,n,t,r)}async page(){return await this.userGrowing.page()}async productDetail(e){return await this.userGrowing.productDetail(e)}}export{J as swapForUploadImgApp,$ as signature_hash,M as rsa_encrypt,O as rand_str,Y as md5_upper,K as build_upload_signature,j as build_signature,Z as aesDecryptImageUrl,k as UserGrowingAPI,q as UserAPI,T as TrendAPI,p as TimeBasicResponse,P as SettingAPI,F as RespCode,I as ProfileAPI,ne as PostContentType,v as KFAPI,R as HomeAPI,V as H5API,x as GameAPI,b as DNA_GAME_ID,m as DNASubModule,L as DNABaseAPI,te as DNAAPI};
5
5
 
6
- //# debugId=A949EFB62A49C38064756E2164756E21
6
+ //# debugId=6436B09F5C2381ED64756E2164756E21