summary refs log tree commit diff
path: root/src/api/routes/store
diff options
context:
space:
mode:
Diffstat (limited to 'src/api/routes/store')
-rw-r--r--src/api/routes/store/published-listings/applications.ts79
-rw-r--r--src/api/routes/store/published-listings/applications/#id/subscription-plans.ts25
-rw-r--r--src/api/routes/store/published-listings/skus.ts79
-rw-r--r--src/api/routes/store/published-listings/skus/#sku_id/subscription-plans.ts153
4 files changed, 336 insertions, 0 deletions
diff --git a/src/api/routes/store/published-listings/applications.ts b/src/api/routes/store/published-listings/applications.ts
new file mode 100644
index 00000000..060a4c3d
--- /dev/null
+++ b/src/api/routes/store/published-listings/applications.ts
@@ -0,0 +1,79 @@
+import { Request, Response, Router } from "express";
+import { route } from "@fosscord/api";
+
+const router: Router = Router();
+
+router.get("/:id", route({}), async (req: Request, res: Response) => {
+	//TODO
+	const id = req.params.id;
+	res.json({
+		id: "",
+		summary: "",
+		sku: {
+			id: "",
+			type: 1,
+			dependent_sku_id: null,
+			application_id: "",
+			manifets_labels: [],
+			access_type: 2,
+			name: "",
+			features: [],
+			release_date: "",
+			premium: false,
+			slug: "",
+			flags: 4,
+			genres: [],
+			legal_notice: "",
+			application: {
+				id: "",
+				name: "",
+				icon: "",
+				description: "",
+				summary: "",
+				cover_image: "",
+				primary_sku_id: "",
+				hook: true,
+				slug: "",
+				guild_id: "",
+				bot_public: "",
+				bot_require_code_grant: false,
+				verify_key: "",
+				publishers: [
+					{
+						id: "",
+						name: ""
+					}
+				],
+				developers: [
+					{
+						id: "",
+						name: ""
+					}
+				],
+				system_requirements: {},
+				show_age_gate: false,
+				price: {
+					amount: 0,
+					currency: "EUR"
+				},
+				locales: []
+			},
+			tagline: "",
+			description: "",
+			carousel_items: [
+				{
+					asset_id: ""
+				}
+			],
+			header_logo_dark_theme: {}, //{id: "", size: 4665, mime_type: "image/gif", width 160, height: 160}
+			header_logo_light_theme: {},
+			box_art: {},
+			thumbnail: {},
+			header_background: {},
+			hero_background: {},
+			assets: []
+		}
+	}).status(200);
+});
+
+export default router;
diff --git a/src/api/routes/store/published-listings/applications/#id/subscription-plans.ts b/src/api/routes/store/published-listings/applications/#id/subscription-plans.ts
new file mode 100644
index 00000000..54151ae5
--- /dev/null
+++ b/src/api/routes/store/published-listings/applications/#id/subscription-plans.ts
@@ -0,0 +1,25 @@
+import { Request, Response, Router } from "express";
+import { route } from "@fosscord/api";
+
+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);
+});
+
+export default router;
diff --git a/src/api/routes/store/published-listings/skus.ts b/src/api/routes/store/published-listings/skus.ts
new file mode 100644
index 00000000..060a4c3d
--- /dev/null
+++ b/src/api/routes/store/published-listings/skus.ts
@@ -0,0 +1,79 @@
+import { Request, Response, Router } from "express";
+import { route } from "@fosscord/api";
+
+const router: Router = Router();
+
+router.get("/:id", route({}), async (req: Request, res: Response) => {
+	//TODO
+	const id = req.params.id;
+	res.json({
+		id: "",
+		summary: "",
+		sku: {
+			id: "",
+			type: 1,
+			dependent_sku_id: null,
+			application_id: "",
+			manifets_labels: [],
+			access_type: 2,
+			name: "",
+			features: [],
+			release_date: "",
+			premium: false,
+			slug: "",
+			flags: 4,
+			genres: [],
+			legal_notice: "",
+			application: {
+				id: "",
+				name: "",
+				icon: "",
+				description: "",
+				summary: "",
+				cover_image: "",
+				primary_sku_id: "",
+				hook: true,
+				slug: "",
+				guild_id: "",
+				bot_public: "",
+				bot_require_code_grant: false,
+				verify_key: "",
+				publishers: [
+					{
+						id: "",
+						name: ""
+					}
+				],
+				developers: [
+					{
+						id: "",
+						name: ""
+					}
+				],
+				system_requirements: {},
+				show_age_gate: false,
+				price: {
+					amount: 0,
+					currency: "EUR"
+				},
+				locales: []
+			},
+			tagline: "",
+			description: "",
+			carousel_items: [
+				{
+					asset_id: ""
+				}
+			],
+			header_logo_dark_theme: {}, //{id: "", size: 4665, mime_type: "image/gif", width 160, height: 160}
+			header_logo_light_theme: {},
+			box_art: {},
+			thumbnail: {},
+			header_background: {},
+			hero_background: {},
+			assets: []
+		}
+	}).status(200);
+});
+
+export default router;
diff --git a/src/api/routes/store/published-listings/skus/#sku_id/subscription-plans.ts b/src/api/routes/store/published-listings/skus/#sku_id/subscription-plans.ts
new file mode 100644
index 00000000..e7f44ded
--- /dev/null
+++ b/src/api/routes/store/published-listings/skus/#sku_id/subscription-plans.ts
@@ -0,0 +1,153 @@
+import { Request, Response, Router } from "express";
+import { route } from "@fosscord/api";
+
+const router: Router = Router();
+
+const skus = new Map([
+	[
+		"521842865731534868",
+		[
+			{
+				id: "511651856145973248",
+				name: "Individual Premium Tier 2 Monthly (Legacy)",
+				interval: 1,
+				interval_count: 1,
+				tax_inclusive: true,
+				sku_id: "521842865731534868",
+				currency: "eur",
+				price: 0,
+				price_tier: null
+			},
+			{
+				id: "511651860671627264",
+				name: "Individiual Premium Tier 2 Yearly (Legacy)",
+				interval: 2,
+				interval_count: 1,
+				tax_inclusive: true,
+				sku_id: "521842865731534868",
+				currency: "eur",
+				price: 0,
+				price_tier: null
+			}
+		]
+	],
+	[
+		"521846918637420545",
+		[
+			{
+				id: "511651871736201216",
+				name: "Individual Premium Tier 1 Monthly",
+				interval: 1,
+				interval_count: 1,
+				tax_inclusive: true,
+				sku_id: "521846918637420545",
+				currency: "eur",
+				price: 0,
+				price_tier: null
+			},
+			{
+				id: "511651876987469824",
+				name: "Individual Premum Tier 1 Yearly",
+				interval: 2,
+				interval_count: 1,
+				tax_inclusive: true,
+				sku_id: "521846918637420545",
+				currency: "eur",
+				price: 0,
+				price_tier: null
+			},
+			{
+				id: "978380684370378761",
+				name: "Individual Premum Tier 0",
+				interval: 2,
+				interval_count: 1,
+				tax_inclusive: true,
+				sku_id: "521846918637420545",
+				currency: "eur",
+				price: 0,
+				price_tier: null
+			}
+		]
+	],
+	[
+		"521847234246082599",
+		[
+			{
+				id: "642251038925127690",
+				name: "Individual Premium Tier 2 Quarterly",
+				interval: 1,
+				interval_count: 3,
+				tax_inclusive: true,
+				sku_id: "521847234246082599",
+				currency: "eur",
+				price: 0,
+				price_tier: null
+			},
+			{
+				id: "511651880837840896",
+				name: "Individual Premium Tier 2 Monthly",
+				interval: 1,
+				interval_count: 1,
+				tax_inclusive: true,
+				sku_id: "521847234246082599",
+				currency: "eur",
+				price: 0,
+				price_tier: null
+			},
+			{
+				id: "511651885459963904",
+				name: "Individual Premium Tier 2 Yearly",
+				interval: 2,
+				interval_count: 1,
+				tax_inclusive: true,
+				sku_id: "521847234246082599",
+				currency: "eur",
+				price: 0,
+				price_tier: null
+			}
+		]
+	],
+	[
+		"590663762298667008",
+		[
+			{
+				id: "590665532894740483",
+				name: "Crowd Premium Monthly",
+				interval: 1,
+				interval_count: 1,
+				tax_inclusive: true,
+				sku_id: "590663762298667008",
+				discount_price: 0,
+				currency: "eur",
+				price: 0,
+				price_tier: null
+			},
+			{
+				id: "590665538238152709",
+				name: "Crowd Premium Yearly",
+				interval: 2,
+				interval_count: 1,
+				tax_inclusive: true,
+				sku_id: "590663762298667008",
+				discount_price: 0,
+				currency: "eur",
+				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)) {
+		console.log(`Request for invalid SKU ${sku_id}! Please report this!`);
+		res.sendStatus(404);
+	} else {
+		res.json(skus.get(sku_id)).status(200);
+	}
+});
+
+export default router;