-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add 'server' as aliases for 'zone' parameter, add Zenless Zone Zero, …
…update README - plan to support POST request?
- Loading branch information
Showing
5 changed files
with
113 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,14 @@ | ||
export { default as aov } from './aov'; | ||
export { default as cod } from './cod'; | ||
export { default as ff } from './ff'; | ||
export { default as ml } from './ml'; | ||
export { default as gi } from './gi'; | ||
export { default as hi } from './hi'; | ||
export { default as hsr } from './hsr'; | ||
export { default as la } from './la'; | ||
export { default as ml } from './ml'; | ||
export { default as pb } from './pb'; | ||
export { default as pgr } from './pgr'; | ||
export { default as sm } from './sm'; | ||
export { default as sus } from './sus'; | ||
export { default as aov } from './aov'; | ||
export { default as cod } from './cod'; | ||
export { default as valo } from './valo'; | ||
export { default as pgr } from './pgr'; | ||
export { default as la } from './la'; | ||
export { default as zzz } from './zzz'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import { endpoint, headers, Result } from '../utils'; | ||
|
||
export default async function zzz(id: number): Promise<Result> { | ||
let sn = ''; | ||
let sv = ''; | ||
const idStr = id.toString().substring(0, 2); | ||
switch (idStr) { | ||
case '10': | ||
sn = 'America'; | ||
sv = 'prod_gf_us'; | ||
break; | ||
case '13': | ||
sn = 'Asia'; | ||
sv = 'prod_gf_jp'; | ||
break; | ||
case '15': | ||
sn = 'Europe'; | ||
sv = 'prod_gf_eu'; | ||
break; | ||
case '17': | ||
sn = 'SAR (Taiwan, Hong Kong, Macao)'; | ||
sv = 'prod_gf_sg'; | ||
break; | ||
default: | ||
return { | ||
success: false, | ||
message: 'Bad request' | ||
}; | ||
} | ||
const body = `voucherPricePoint.id=946399&voucherPricePoint.price=16000&voucherPricePoint.variablePrice=0&user.userId=${id}&user.zoneId=${sv}&voucherTypeName=ZENLESS_ZONE_ZERO&shopLang=id_ID`; | ||
const response = await fetch(endpoint, { | ||
method: 'POST', | ||
headers, | ||
body | ||
}); | ||
const data = await response.json(); | ||
return { | ||
success: true, | ||
game: 'Zenless Zone Zero', | ||
id, | ||
server: sn, | ||
name: data.confirmationFields.username | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters