A rewrite of Poly+, my quality-of-life browser extension for Polytoria. Built entirely fresh using the WXT extension framework, Typescript, and with added better overall code quality.
extension
1type itemTypes = "hat" | "tool" | "face" | "shirt" | "pants" | "profileTheme";
2
3export type userApiSchema = {
4 id: number,
5 username: string,
6 description: string,
7 signature: string,
8 thumbnail: {
9 avatar: string,
10 icon: string
11 },
12 playing: null|{},
13 netWorth: number,
14 placeVisits: number,
15 profileViews: number,
16 forumPosts: number,
17 assetSales: number,
18 membershipType: string,
19 isStaff: boolean,
20 registeredAt: string,
21 lastSeenAt: string
22};
23
24export type placeApiSchema = {
25 id: number,
26 name: string,
27 description: string,
28 creator: object,
29 thumbnail: string,
30 genre: string,
31 maxPlayers: number,
32 isActive: boolean,
33 visits: number,
34 uniqueVisits: number,
35 playing: number,
36 rating: object,
37 accessType: string,
38 accessPrice: number|null,
39 createdAt: string,
40 updatedAt: string
41};
42
43export type avatarApiSchema = {
44 id: string,
45 colors: {
46 head: string,
47 torso: string,
48 leftArm: string,
49 rightArm: string,
50 leftLeg: string,
51 rightLeg: string
52 },
53 assets: Array<{
54 id: number,
55 type: itemTypes,
56 accessoryType: string,
57 name: string,
58 thumbnail: string,
59 path: string
60 }>,
61 isDefault: boolean
62};
63
64export type itemApiSchema = {
65 id: number,
66 type: itemTypes,
67 accessoryType: string,
68 name: string,
69 description: string,
70 tags: Array<string>,
71 creator: {
72 type: string,
73 id: number,
74 name: string,
75 thumbnail: string
76 },
77 thumbnail: string,
78 price: number | null,
79 averagePrice: number | null,
80 version: number,
81 sales: number,
82 favorites: number,
83 totalStock: number | null,
84 onSaleUntil: string | null,
85 isLimited: boolean,
86 createdAt: string,
87 updatedAt: string | null
88}
89
90export type meshApiSchema = {
91 success: boolean,
92 url?: string,
93 errors?: Array<{
94 code: string,
95 message: string
96 }>
97};
98
99export type textureApiSchema = {
100 success: boolean,
101 url?: string,
102 errors?: Array<{
103 code: string,
104 message: string
105 }>
106};