diff options
author | developomp <developomp@gmail.com> | 2021-10-20 09:13:22 +0900 |
---|---|---|
committer | developomp <developomp@gmail.com> | 2021-10-20 09:13:22 +0900 |
commit | 2ce3fbc6525cd8c1ddd060c54f833c5b6a2623c7 (patch) | |
tree | 717ad10f33462c0298733407d8773c595828c32f /api/src/routes/store | |
parent | prettier formatted /bundle (diff) | |
download | server-2ce3fbc6525cd8c1ddd060c54f833c5b6a2623c7.tar.xz |
prettier formatted /api
Diffstat (limited to 'api/src/routes/store')
-rw-r--r-- | api/src/routes/store/published-listings/applications/#id/subscription-plans.ts | 27 | ||||
-rw-r--r-- | api/src/routes/store/published-listings/skus/#sku_id/subscription-plans.ts | 129 |
2 files changed, 137 insertions, 19 deletions
diff --git a/api/src/routes/store/published-listings/applications/#id/subscription-plans.ts b/api/src/routes/store/published-listings/applications/#id/subscription-plans.ts index 77f949d9..54151ae5 100644 --- a/api/src/routes/store/published-listings/applications/#id/subscription-plans.ts +++ b/api/src/routes/store/published-listings/applications/#id/subscription-plans.ts @@ -6,19 +6,20 @@ const router: Router = Router(); router.get("/", route({}), async (req: Request, res: Response) => { //TODO res.json([ - { - id: "", - name: "", - interval: 1, - interval_count: 1, - tax_inclusive: true, - sku_id: "", - fallback_price: 499, - fallback_currency: "eur", - currency: "eur", - price: 4199, - price_tier: null - }]).status(200); + { + id: "", + name: "", + interval: 1, + interval_count: 1, + tax_inclusive: true, + sku_id: "", + fallback_price: 499, + fallback_currency: "eur", + currency: "eur", + price: 4199, + price_tier: null + } + ]).status(200); }); export default router; diff --git a/api/src/routes/store/published-listings/skus/#sku_id/subscription-plans.ts b/api/src/routes/store/published-listings/skus/#sku_id/subscription-plans.ts index 54c01607..723a5160 100644 --- a/api/src/routes/store/published-listings/skus/#sku_id/subscription-plans.ts +++ b/api/src/routes/store/published-listings/skus/#sku_id/subscription-plans.ts @@ -4,17 +4,134 @@ import { route } from "@fosscord/api"; const router: Router = Router(); const skus = new Map([ - ["521842865731534868", [{"id": "511651856145973248", "name": "Premium Monthly (Legacy)", "interval": 1, "interval_count": 1, "tax_inclusive": true, "sku_id": "521842865731534868", "currency": "usd", "price": 0, "price_tier": null}, {"id": "511651860671627264", "name": "Premium Yearly (Legacy)", "interval": 2, "interval_count": 1, "tax_inclusive": true, "sku_id": "521842865731534868", "currency": "usd", "price": 0, "price_tier": null}]], - ["521846918637420545", [{"id": "511651871736201216", "name": "Premium Classic Monthly", "interval": 1, "interval_count": 1, "tax_inclusive": true, "sku_id": "521846918637420545", "currency": "usd", "price": 0, "price_tier": null}, {"id": "511651876987469824", "name": "Premium Classic Yearly", "interval": 2, "interval_count": 1, "tax_inclusive": true, "sku_id": "521846918637420545", "currency": "usd", "price": 0, "price_tier": null}]], - ["521847234246082599", [{"id": "642251038925127690", "name": "Premium Quarterly", "interval": 1, "interval_count": 3, "tax_inclusive": true, "sku_id": "521847234246082599", "currency": "usd", "price": 0, "price_tier": null}, {"id": "511651880837840896", "name": "Premium Monthly", "interval": 1, "interval_count": 1, "tax_inclusive": true, "sku_id": "521847234246082599", "currency": "usd", "price": 0, "price_tier": null}, {"id": "511651885459963904", "name": "Premium Yearly", "interval": 2, "interval_count": 1, "tax_inclusive": true, "sku_id": "521847234246082599", "currency": "usd", "price": 0, "price_tier": null}]], - ["590663762298667008", [{"id": "590665532894740483", "name": "Server Boost Monthly", "interval": 1, "interval_count": 1, "tax_inclusive": true, "sku_id": "590663762298667008", "discount_price": 0, "currency": "usd", "price": 0, "price_tier": null}, {"id": "590665538238152709", "name": "Server Boost Yearly", "interval": 2, "interval_count": 1, "tax_inclusive": true, "sku_id": "590663762298667008", "discount_price": 0, "currency": "usd", "price": 0, "price_tier": null}]], + [ + "521842865731534868", + [ + { + id: "511651856145973248", + name: "Premium Monthly (Legacy)", + interval: 1, + interval_count: 1, + tax_inclusive: true, + sku_id: "521842865731534868", + currency: "usd", + price: 0, + price_tier: null + }, + { + id: "511651860671627264", + name: "Premium Yearly (Legacy)", + interval: 2, + interval_count: 1, + tax_inclusive: true, + sku_id: "521842865731534868", + currency: "usd", + price: 0, + price_tier: null + } + ] + ], + [ + "521846918637420545", + [ + { + id: "511651871736201216", + name: "Premium Classic Monthly", + interval: 1, + interval_count: 1, + tax_inclusive: true, + sku_id: "521846918637420545", + currency: "usd", + price: 0, + price_tier: null + }, + { + id: "511651876987469824", + name: "Premium Classic Yearly", + interval: 2, + interval_count: 1, + tax_inclusive: true, + sku_id: "521846918637420545", + currency: "usd", + price: 0, + price_tier: null + } + ] + ], + [ + "521847234246082599", + [ + { + id: "642251038925127690", + name: "Premium Quarterly", + interval: 1, + interval_count: 3, + tax_inclusive: true, + sku_id: "521847234246082599", + currency: "usd", + price: 0, + price_tier: null + }, + { + id: "511651880837840896", + name: "Premium Monthly", + interval: 1, + interval_count: 1, + tax_inclusive: true, + sku_id: "521847234246082599", + currency: "usd", + price: 0, + price_tier: null + }, + { + id: "511651885459963904", + name: "Premium Yearly", + interval: 2, + interval_count: 1, + tax_inclusive: true, + sku_id: "521847234246082599", + currency: "usd", + price: 0, + price_tier: null + } + ] + ], + [ + "590663762298667008", + [ + { + id: "590665532894740483", + name: "Server Boost Monthly", + interval: 1, + interval_count: 1, + tax_inclusive: true, + sku_id: "590663762298667008", + discount_price: 0, + currency: "usd", + price: 0, + price_tier: null + }, + { + id: "590665538238152709", + name: "Server Boost Yearly", + interval: 2, + interval_count: 1, + tax_inclusive: true, + sku_id: "590663762298667008", + discount_price: 0, + currency: "usd", + price: 0, + price_tier: null + } + ] + ] ]); router.get("/", route({}), async (req: Request, res: Response) => { // TODO: add the ability to add custom const { sku_id } = req.params; - - if(!skus.has(sku_id)) { + + if (!skus.has(sku_id)) { console.log(`Request for invalid SKU ${sku_id}! Please report this!`); res.sendStatus(404); } else { |