@koloseum/types 0.1.2 → 0.1.4
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/package.json +6 -1
- package/types/database-generated.d.ts +80 -65
- package/types/database.d.ts +7 -8
- package/types/public/auth.d.ts +13 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@koloseum/types",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"author": "Koloseum Technologies Limited",
|
|
5
5
|
"description": "Type definitions for use across web apps (TypeScript)",
|
|
6
6
|
"keywords": [
|
|
@@ -24,8 +24,13 @@
|
|
|
24
24
|
"./types/**/*.d.ts",
|
|
25
25
|
"./types/public/**/*.d.ts"
|
|
26
26
|
],
|
|
27
|
+
"scripts": {
|
|
28
|
+
"check": "prettier --check .",
|
|
29
|
+
"format": "prettier --write ."
|
|
30
|
+
},
|
|
27
31
|
"devDependencies": {
|
|
28
32
|
"@supabase/supabase-js": "^2.48.1",
|
|
33
|
+
"prettier": "^3.5.1",
|
|
29
34
|
"typescript": "^5.0.0"
|
|
30
35
|
},
|
|
31
36
|
"dependencies": {
|
|
@@ -140,7 +140,7 @@ export type Database = {
|
|
|
140
140
|
company_number: string;
|
|
141
141
|
country_code: string;
|
|
142
142
|
created_at: string;
|
|
143
|
-
id:
|
|
143
|
+
id: string;
|
|
144
144
|
user_id: string;
|
|
145
145
|
};
|
|
146
146
|
Insert: {
|
|
@@ -148,7 +148,7 @@ export type Database = {
|
|
|
148
148
|
company_number: string;
|
|
149
149
|
country_code: string;
|
|
150
150
|
created_at?: string;
|
|
151
|
-
id?:
|
|
151
|
+
id?: string;
|
|
152
152
|
user_id?: string;
|
|
153
153
|
};
|
|
154
154
|
Update: {
|
|
@@ -156,7 +156,7 @@ export type Database = {
|
|
|
156
156
|
company_number?: string;
|
|
157
157
|
country_code?: string;
|
|
158
158
|
created_at?: string;
|
|
159
|
-
id?:
|
|
159
|
+
id?: string;
|
|
160
160
|
user_id?: string;
|
|
161
161
|
};
|
|
162
162
|
Relationships: [];
|
|
@@ -179,7 +179,7 @@ export type Database = {
|
|
|
179
179
|
phone: string;
|
|
180
180
|
phone_updated_at: string | null;
|
|
181
181
|
pronouns: Database["compliance"]["Enums"]["pronouns"][] | null;
|
|
182
|
-
role:
|
|
182
|
+
role: string;
|
|
183
183
|
sex: Database["compliance"]["Enums"]["sex"] | null;
|
|
184
184
|
show_pronouns: boolean | null;
|
|
185
185
|
user_id: string;
|
|
@@ -201,7 +201,7 @@ export type Database = {
|
|
|
201
201
|
phone: string;
|
|
202
202
|
phone_updated_at?: string | null;
|
|
203
203
|
pronouns?: Database["compliance"]["Enums"]["pronouns"][] | null;
|
|
204
|
-
role:
|
|
204
|
+
role: string;
|
|
205
205
|
sex?: Database["compliance"]["Enums"]["sex"] | null;
|
|
206
206
|
show_pronouns?: boolean | null;
|
|
207
207
|
user_id?: string;
|
|
@@ -223,7 +223,7 @@ export type Database = {
|
|
|
223
223
|
phone?: string;
|
|
224
224
|
phone_updated_at?: string | null;
|
|
225
225
|
pronouns?: Database["compliance"]["Enums"]["pronouns"][] | null;
|
|
226
|
-
role?:
|
|
226
|
+
role?: string;
|
|
227
227
|
sex?: Database["compliance"]["Enums"]["sex"] | null;
|
|
228
228
|
show_pronouns?: boolean | null;
|
|
229
229
|
user_id?: string;
|
|
@@ -235,13 +235,20 @@ export type Database = {
|
|
|
235
235
|
isOneToOne: false;
|
|
236
236
|
referencedRelation: "lounges";
|
|
237
237
|
referencedColumns: ["id"];
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
foreignKeyName: "lounge_staff_role_fkey";
|
|
241
|
+
columns: ["role"];
|
|
242
|
+
isOneToOne: false;
|
|
243
|
+
referencedRelation: "user_roles";
|
|
244
|
+
referencedColumns: ["name"];
|
|
238
245
|
}
|
|
239
246
|
];
|
|
240
247
|
};
|
|
241
248
|
lounge_staff_verification_attempts: {
|
|
242
249
|
Row: {
|
|
243
250
|
created_at: string;
|
|
244
|
-
id:
|
|
251
|
+
id: string;
|
|
245
252
|
id_country: string;
|
|
246
253
|
id_number: string;
|
|
247
254
|
id_type: Database["compliance"]["Enums"]["id_type"];
|
|
@@ -250,7 +257,7 @@ export type Database = {
|
|
|
250
257
|
};
|
|
251
258
|
Insert: {
|
|
252
259
|
created_at?: string;
|
|
253
|
-
id?:
|
|
260
|
+
id?: string;
|
|
254
261
|
id_country: string;
|
|
255
262
|
id_number: string;
|
|
256
263
|
id_type: Database["compliance"]["Enums"]["id_type"];
|
|
@@ -259,7 +266,7 @@ export type Database = {
|
|
|
259
266
|
};
|
|
260
267
|
Update: {
|
|
261
268
|
created_at?: string;
|
|
262
|
-
id?:
|
|
269
|
+
id?: string;
|
|
263
270
|
id_country?: string;
|
|
264
271
|
id_number?: string;
|
|
265
272
|
id_type?: Database["compliance"]["Enums"]["id_type"];
|
|
@@ -893,7 +900,7 @@ export type Database = {
|
|
|
893
900
|
nationality: string;
|
|
894
901
|
pronouns: Database["compliance"]["Enums"]["pronouns"][] | null;
|
|
895
902
|
pseudonym: string | null;
|
|
896
|
-
role:
|
|
903
|
+
role: string;
|
|
897
904
|
sex: Database["compliance"]["Enums"]["sex"] | null;
|
|
898
905
|
show_birth_date: boolean;
|
|
899
906
|
show_pronouns: boolean | null;
|
|
@@ -912,7 +919,7 @@ export type Database = {
|
|
|
912
919
|
nationality: string;
|
|
913
920
|
pronouns?: Database["compliance"]["Enums"]["pronouns"][] | null;
|
|
914
921
|
pseudonym?: string | null;
|
|
915
|
-
role?:
|
|
922
|
+
role?: string;
|
|
916
923
|
sex?: Database["compliance"]["Enums"]["sex"] | null;
|
|
917
924
|
show_birth_date: boolean;
|
|
918
925
|
show_pronouns?: boolean | null;
|
|
@@ -931,29 +938,34 @@ export type Database = {
|
|
|
931
938
|
nationality?: string;
|
|
932
939
|
pronouns?: Database["compliance"]["Enums"]["pronouns"][] | null;
|
|
933
940
|
pseudonym?: string | null;
|
|
934
|
-
role?:
|
|
941
|
+
role?: string;
|
|
935
942
|
sex?: Database["compliance"]["Enums"]["sex"] | null;
|
|
936
943
|
show_birth_date?: boolean;
|
|
937
944
|
show_pronouns?: boolean | null;
|
|
938
945
|
user_id?: string | null;
|
|
939
946
|
};
|
|
940
|
-
Relationships: [
|
|
947
|
+
Relationships: [
|
|
948
|
+
{
|
|
949
|
+
foreignKeyName: "players_role_fkey";
|
|
950
|
+
columns: ["role"];
|
|
951
|
+
isOneToOne: false;
|
|
952
|
+
referencedRelation: "user_roles";
|
|
953
|
+
referencedColumns: ["name"];
|
|
954
|
+
}
|
|
955
|
+
];
|
|
941
956
|
};
|
|
942
957
|
role_permissions: {
|
|
943
958
|
Row: {
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
role: Database["compliance"]["Enums"]["app_role"];
|
|
959
|
+
permission: string;
|
|
960
|
+
role: string;
|
|
947
961
|
};
|
|
948
962
|
Insert: {
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
role: Database["compliance"]["Enums"]["app_role"];
|
|
963
|
+
permission: string;
|
|
964
|
+
role: string;
|
|
952
965
|
};
|
|
953
966
|
Update: {
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
role?: Database["compliance"]["Enums"]["app_role"];
|
|
967
|
+
permission?: string;
|
|
968
|
+
role?: string;
|
|
957
969
|
};
|
|
958
970
|
Relationships: [];
|
|
959
971
|
};
|
|
@@ -1026,11 +1038,29 @@ export type Database = {
|
|
|
1026
1038
|
};
|
|
1027
1039
|
Relationships: [];
|
|
1028
1040
|
};
|
|
1041
|
+
user_roles: {
|
|
1042
|
+
Row: {
|
|
1043
|
+
created_at: string;
|
|
1044
|
+
id: number;
|
|
1045
|
+
name: string;
|
|
1046
|
+
};
|
|
1047
|
+
Insert: {
|
|
1048
|
+
created_at?: string;
|
|
1049
|
+
id?: number;
|
|
1050
|
+
name: string;
|
|
1051
|
+
};
|
|
1052
|
+
Update: {
|
|
1053
|
+
created_at?: string;
|
|
1054
|
+
id?: number;
|
|
1055
|
+
name?: string;
|
|
1056
|
+
};
|
|
1057
|
+
Relationships: [];
|
|
1058
|
+
};
|
|
1029
1059
|
};
|
|
1030
1060
|
Views: {
|
|
1031
1061
|
active_user_roles: {
|
|
1032
1062
|
Row: {
|
|
1033
|
-
app_role:
|
|
1063
|
+
app_role: string | null;
|
|
1034
1064
|
user_id: string | null;
|
|
1035
1065
|
};
|
|
1036
1066
|
Relationships: [];
|
|
@@ -1039,7 +1069,7 @@ export type Database = {
|
|
|
1039
1069
|
Functions: {
|
|
1040
1070
|
authorize: {
|
|
1041
1071
|
Args: {
|
|
1042
|
-
requested_permission:
|
|
1072
|
+
requested_permission: string;
|
|
1043
1073
|
};
|
|
1044
1074
|
Returns: boolean;
|
|
1045
1075
|
};
|
|
@@ -1063,7 +1093,7 @@ export type Database = {
|
|
|
1063
1093
|
p_birth_date: string;
|
|
1064
1094
|
p_nationality: string;
|
|
1065
1095
|
p_sex: Database["compliance"]["Enums"]["sex"];
|
|
1066
|
-
p_role:
|
|
1096
|
+
p_role: string;
|
|
1067
1097
|
p_middle_names?: string;
|
|
1068
1098
|
p_gender_identity?: Database["compliance"]["Enums"]["gender_identity"];
|
|
1069
1099
|
p_pronouns?: Database["compliance"]["Enums"]["pronouns"][];
|
|
@@ -1222,12 +1252,6 @@ export type Database = {
|
|
|
1222
1252
|
};
|
|
1223
1253
|
Returns: undefined;
|
|
1224
1254
|
};
|
|
1225
|
-
validate_country_code: {
|
|
1226
|
-
Args: {
|
|
1227
|
-
country_code: string;
|
|
1228
|
-
};
|
|
1229
|
-
Returns: boolean;
|
|
1230
|
-
};
|
|
1231
1255
|
validate_pronouns: {
|
|
1232
1256
|
Args: {
|
|
1233
1257
|
pronouns: Database["compliance"]["Enums"]["pronouns"][];
|
|
@@ -1237,15 +1261,6 @@ export type Database = {
|
|
|
1237
1261
|
};
|
|
1238
1262
|
Enums: {
|
|
1239
1263
|
account_type: "player" | "lounge";
|
|
1240
|
-
app_permission:
|
|
1241
|
-
| "players.player"
|
|
1242
|
-
| "lounges.superuser"
|
|
1243
|
-
| "lounges.manager"
|
|
1244
|
-
| "lounges.desk"
|
|
1245
|
-
| "lounges.inventory"
|
|
1246
|
-
| "lounges.kitchen"
|
|
1247
|
-
| "lounges.human_resources";
|
|
1248
|
-
app_role: "player" | "lounge_superuser";
|
|
1249
1264
|
data_update_request_status: "pending" | "approved" | "rejected" | "cancelled";
|
|
1250
1265
|
gender_identity: "cisgender" | "transgender" | "nonbinary";
|
|
1251
1266
|
id_type: "national" | "alien" | "passport" | "driver_licence";
|
|
@@ -1850,16 +1865,16 @@ export type Tables<
|
|
|
1850
1865
|
? (Database[PublicTableNameOrOptions["schema"]]["Tables"] &
|
|
1851
1866
|
Database[PublicTableNameOrOptions["schema"]]["Views"])[TableName] extends {
|
|
1852
1867
|
Row: infer R;
|
|
1853
|
-
|
|
1868
|
+
}
|
|
1854
1869
|
? R
|
|
1855
1870
|
: never
|
|
1856
1871
|
: PublicTableNameOrOptions extends keyof (PublicSchema["Tables"] & PublicSchema["Views"])
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1872
|
+
? (PublicSchema["Tables"] & PublicSchema["Views"])[PublicTableNameOrOptions] extends {
|
|
1873
|
+
Row: infer R;
|
|
1874
|
+
}
|
|
1875
|
+
? R
|
|
1876
|
+
: never
|
|
1877
|
+
: never;
|
|
1863
1878
|
|
|
1864
1879
|
export type TablesInsert<
|
|
1865
1880
|
PublicTableNameOrOptions extends keyof PublicSchema["Tables"] | { schema: keyof Database },
|
|
@@ -1869,16 +1884,16 @@ export type TablesInsert<
|
|
|
1869
1884
|
> = PublicTableNameOrOptions extends { schema: keyof Database }
|
|
1870
1885
|
? Database[PublicTableNameOrOptions["schema"]]["Tables"][TableName] extends {
|
|
1871
1886
|
Insert: infer I;
|
|
1872
|
-
|
|
1887
|
+
}
|
|
1873
1888
|
? I
|
|
1874
1889
|
: never
|
|
1875
1890
|
: PublicTableNameOrOptions extends keyof PublicSchema["Tables"]
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1891
|
+
? PublicSchema["Tables"][PublicTableNameOrOptions] extends {
|
|
1892
|
+
Insert: infer I;
|
|
1893
|
+
}
|
|
1894
|
+
? I
|
|
1895
|
+
: never
|
|
1896
|
+
: never;
|
|
1882
1897
|
|
|
1883
1898
|
export type TablesUpdate<
|
|
1884
1899
|
PublicTableNameOrOptions extends keyof PublicSchema["Tables"] | { schema: keyof Database },
|
|
@@ -1888,16 +1903,16 @@ export type TablesUpdate<
|
|
|
1888
1903
|
> = PublicTableNameOrOptions extends { schema: keyof Database }
|
|
1889
1904
|
? Database[PublicTableNameOrOptions["schema"]]["Tables"][TableName] extends {
|
|
1890
1905
|
Update: infer U;
|
|
1891
|
-
|
|
1906
|
+
}
|
|
1892
1907
|
? U
|
|
1893
1908
|
: never
|
|
1894
1909
|
: PublicTableNameOrOptions extends keyof PublicSchema["Tables"]
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1910
|
+
? PublicSchema["Tables"][PublicTableNameOrOptions] extends {
|
|
1911
|
+
Update: infer U;
|
|
1912
|
+
}
|
|
1913
|
+
? U
|
|
1914
|
+
: never
|
|
1915
|
+
: never;
|
|
1901
1916
|
|
|
1902
1917
|
export type Enums<
|
|
1903
1918
|
PublicEnumNameOrOptions extends keyof PublicSchema["Enums"] | { schema: keyof Database },
|
|
@@ -1907,8 +1922,8 @@ export type Enums<
|
|
|
1907
1922
|
> = PublicEnumNameOrOptions extends { schema: keyof Database }
|
|
1908
1923
|
? Database[PublicEnumNameOrOptions["schema"]]["Enums"][EnumName]
|
|
1909
1924
|
: PublicEnumNameOrOptions extends keyof PublicSchema["Enums"]
|
|
1910
|
-
|
|
1911
|
-
|
|
1925
|
+
? PublicSchema["Enums"][PublicEnumNameOrOptions]
|
|
1926
|
+
: never;
|
|
1912
1927
|
|
|
1913
1928
|
export type CompositeTypes<
|
|
1914
1929
|
PublicCompositeTypeNameOrOptions extends keyof PublicSchema["CompositeTypes"] | { schema: keyof Database },
|
|
@@ -1920,5 +1935,5 @@ export type CompositeTypes<
|
|
|
1920
1935
|
> = PublicCompositeTypeNameOrOptions extends { schema: keyof Database }
|
|
1921
1936
|
? Database[PublicCompositeTypeNameOrOptions["schema"]]["CompositeTypes"][CompositeTypeName]
|
|
1922
1937
|
: PublicCompositeTypeNameOrOptions extends keyof PublicSchema["CompositeTypes"]
|
|
1923
|
-
|
|
1924
|
-
|
|
1938
|
+
? PublicSchema["CompositeTypes"][PublicCompositeTypeNameOrOptions]
|
|
1939
|
+
: never;
|
package/types/database.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { Database as DatabaseGenerated } from "./database-generated";
|
|
2
2
|
import type {
|
|
3
3
|
AccountType,
|
|
4
|
-
AppRole,
|
|
5
4
|
BranchAddressObject,
|
|
6
5
|
BranchAmenitiesObject,
|
|
7
6
|
CompanyInformationUpdateJson,
|
|
@@ -87,32 +86,32 @@ export type Database = MergeDeep<
|
|
|
87
86
|
};
|
|
88
87
|
lounge_company_verification_attempts: {
|
|
89
88
|
Row: {
|
|
90
|
-
company_data: Omit<CompanyVerificationDataObject, "companyNumber" | "
|
|
89
|
+
company_data: Omit<CompanyVerificationDataObject, "companyNumber" | "countryCode">;
|
|
91
90
|
};
|
|
92
91
|
Insert: {
|
|
93
|
-
company_data: Omit<CompanyVerificationDataObject, "companyNumber" | "
|
|
92
|
+
company_data: Omit<CompanyVerificationDataObject, "companyNumber" | "countryCode">;
|
|
94
93
|
};
|
|
95
94
|
Update: {
|
|
96
|
-
company_data?: Omit<CompanyVerificationDataObject, "companyNumber" | "
|
|
95
|
+
company_data?: Omit<CompanyVerificationDataObject, "companyNumber" | "countryCode">;
|
|
97
96
|
};
|
|
98
97
|
};
|
|
99
98
|
lounge_staff: {
|
|
100
99
|
Row: {
|
|
101
100
|
gender_identity: GenderIdentity | null;
|
|
102
101
|
pronouns: PronounsItem[] | null;
|
|
103
|
-
role:
|
|
102
|
+
role: string;
|
|
104
103
|
sex: Sex;
|
|
105
104
|
};
|
|
106
105
|
Insert: {
|
|
107
106
|
gender_identity?: GenderIdentity | null;
|
|
108
107
|
pronouns?: PronounsItem[] | null;
|
|
109
|
-
role:
|
|
108
|
+
role: string;
|
|
110
109
|
sex?: Sex;
|
|
111
110
|
};
|
|
112
111
|
Update: {
|
|
113
112
|
gender_identity?: GenderIdentity | null;
|
|
114
113
|
pronouns?: PronounsItem[] | null;
|
|
115
|
-
role?:
|
|
114
|
+
role?: string;
|
|
116
115
|
sex?: Sex;
|
|
117
116
|
};
|
|
118
117
|
};
|
|
@@ -220,7 +219,7 @@ export type Database = MergeDeep<
|
|
|
220
219
|
create_lounge_staff: {
|
|
221
220
|
Args: {
|
|
222
221
|
p_sex: Sex;
|
|
223
|
-
p_role?:
|
|
222
|
+
p_role?: string;
|
|
224
223
|
p_gender_identity?: GenderIdentity;
|
|
225
224
|
p_pronouns?: PronounsItem[];
|
|
226
225
|
};
|
package/types/public/auth.d.ts
CHANGED
|
@@ -4,8 +4,6 @@ import type { Database } from "../database";
|
|
|
4
4
|
/* GENERAL */
|
|
5
5
|
export type AccountType = "player" | "lounge";
|
|
6
6
|
|
|
7
|
-
export type AppRole = Database["compliance"]["Enums"]["app_role"] | null;
|
|
8
|
-
|
|
9
7
|
export interface AuthenticationJWT {
|
|
10
8
|
aud: string;
|
|
11
9
|
exp: number;
|
|
@@ -16,7 +14,7 @@ export interface AuthenticationJWT {
|
|
|
16
14
|
app_metadata: {
|
|
17
15
|
provider: string;
|
|
18
16
|
providers: string[];
|
|
19
|
-
role:
|
|
17
|
+
role: string;
|
|
20
18
|
};
|
|
21
19
|
user_metadata: {
|
|
22
20
|
email_verified: boolean;
|
|
@@ -46,7 +44,7 @@ export interface IGDBPlatformsResponse {
|
|
|
46
44
|
platform_family: number;
|
|
47
45
|
}
|
|
48
46
|
|
|
49
|
-
export type UserWithRole = User & { app_metadata: { role:
|
|
47
|
+
export type UserWithRole = User & { app_metadata: { role: string } };
|
|
50
48
|
|
|
51
49
|
/* REGISTRATION */
|
|
52
50
|
export type PlayerRegistrationStep = Database["compliance"]["Enums"]["registration_step"];
|
|
@@ -283,6 +281,8 @@ export interface GamingSocialsDataObject {
|
|
|
283
281
|
export interface CompanyDataObject {
|
|
284
282
|
companyNumber: string;
|
|
285
283
|
countryCode: string;
|
|
284
|
+
postalBoxNumber?: string;
|
|
285
|
+
postalCode?: string;
|
|
286
286
|
}
|
|
287
287
|
|
|
288
288
|
export interface CompanyPerson {
|
|
@@ -292,7 +292,8 @@ export interface CompanyPerson {
|
|
|
292
292
|
number: string;
|
|
293
293
|
}
|
|
294
294
|
|
|
295
|
-
export interface
|
|
295
|
+
export interface RawCompanyVerificationDataObject {
|
|
296
|
+
attemptId: string;
|
|
296
297
|
companyName: string;
|
|
297
298
|
companyNumber: string;
|
|
298
299
|
companyType: string;
|
|
@@ -302,6 +303,13 @@ export interface CompanyVerificationDataObject {
|
|
|
302
303
|
persons: CompanyPerson[];
|
|
303
304
|
}
|
|
304
305
|
|
|
306
|
+
export type CompanyVerificationLogDataObject = Omit<
|
|
307
|
+
CompanyVerificationDataObject,
|
|
308
|
+
"attemptId" | "companyName" | "companyType" | "dateOfRegistration" | "dateOfDissolution" | "persons"
|
|
309
|
+
>;
|
|
310
|
+
|
|
311
|
+
export type CompanyVerificationDataObject = Omit<RawCompanyVerificationDataObject, "attemptId">;
|
|
312
|
+
|
|
305
313
|
export interface CompanyInformationObject {
|
|
306
314
|
companyName: string;
|
|
307
315
|
dateOfRegistration: string;
|