@koloseum/types 0.1.7 → 0.1.8
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 +2 -1
- package/types/database.d.ts +2 -1
- package/types/general.d.ts +72 -0
- package/types/public/auth.d.ts +2 -70
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@koloseum/types",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.8",
|
|
4
4
|
"author": "Koloseum Technologies Limited",
|
|
5
5
|
"description": "Type definitions for use across web apps (TypeScript)",
|
|
6
6
|
"keywords": [
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
"exports": {
|
|
19
19
|
"./database": "./types/database.d.ts",
|
|
20
20
|
"./database-generated": "./types/database-generated.d.ts",
|
|
21
|
+
"./general": "./types/general.d.ts",
|
|
21
22
|
"./public/auth": "./types/public/auth.d.ts"
|
|
22
23
|
},
|
|
23
24
|
"files": [
|
package/types/database.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Database as DatabaseGenerated } from "./database-generated";
|
|
2
|
+
import type { AccountType } from "./general";
|
|
2
3
|
import type {
|
|
3
|
-
AccountType,
|
|
4
4
|
BranchAddressObject,
|
|
5
5
|
BranchAmenitiesObject,
|
|
6
6
|
CompanyInformationUpdateJson,
|
|
@@ -23,6 +23,7 @@ import type {
|
|
|
23
23
|
|
|
24
24
|
import { MergeDeep } from "type-fest";
|
|
25
25
|
|
|
26
|
+
/* DATABASE */
|
|
26
27
|
export type Database = MergeDeep<
|
|
27
28
|
DatabaseGenerated,
|
|
28
29
|
{
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import type { Database } from "./database";
|
|
2
|
+
import type { User } from "@supabase/supabase-js";
|
|
3
|
+
|
|
4
|
+
/* GENERAL */
|
|
5
|
+
export type AccountType = "player" | "lounge";
|
|
6
|
+
|
|
7
|
+
export type AuthenticationType = "login" | "register" | "otp";
|
|
8
|
+
|
|
9
|
+
export interface AuthenticationJWT {
|
|
10
|
+
aud: string;
|
|
11
|
+
exp: number;
|
|
12
|
+
iat: number;
|
|
13
|
+
sub: string;
|
|
14
|
+
email: string;
|
|
15
|
+
phone: string;
|
|
16
|
+
app_metadata: {
|
|
17
|
+
provider: string;
|
|
18
|
+
providers: string[];
|
|
19
|
+
roles: string[];
|
|
20
|
+
};
|
|
21
|
+
user_metadata: {
|
|
22
|
+
email_verified: boolean;
|
|
23
|
+
phone_verified: boolean;
|
|
24
|
+
sub: string;
|
|
25
|
+
};
|
|
26
|
+
role: string;
|
|
27
|
+
aal: string;
|
|
28
|
+
amr: [{ method: string; timestamp: number }];
|
|
29
|
+
session_id: string;
|
|
30
|
+
is_anonymous: boolean;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export interface CustomError {
|
|
34
|
+
code: number;
|
|
35
|
+
message: string;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export interface IGDBPlatformsResponse {
|
|
39
|
+
id: number;
|
|
40
|
+
abbreviation: string;
|
|
41
|
+
category: number;
|
|
42
|
+
generation: number;
|
|
43
|
+
name: string;
|
|
44
|
+
platform_family: number;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export type UserWithRoles = User & { app_metadata: { roles: string[] } };
|
|
48
|
+
|
|
49
|
+
/* PHONE OTP */
|
|
50
|
+
export interface PhoneOTPData {
|
|
51
|
+
awaitingOTP: boolean;
|
|
52
|
+
dateUpdated?: Date;
|
|
53
|
+
phoneToVerify?: string;
|
|
54
|
+
verifiedPhone?: string;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export interface OTPInputProperties {
|
|
58
|
+
name: string;
|
|
59
|
+
type: string;
|
|
60
|
+
label: string;
|
|
61
|
+
placeholder: string;
|
|
62
|
+
autocomplete: string;
|
|
63
|
+
buttonLabel: string;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export type PhoneOTPRequestStatus = Database["compliance"]["Enums"]["twilio_verification_status"];
|
|
67
|
+
|
|
68
|
+
export interface PhoneOTPSendCodeAttempt {
|
|
69
|
+
attempt_sid: string;
|
|
70
|
+
channel: string;
|
|
71
|
+
time: string;
|
|
72
|
+
}
|
package/types/public/auth.d.ts
CHANGED
|
@@ -1,50 +1,5 @@
|
|
|
1
|
-
import type { User } from "@supabase/supabase-js";
|
|
2
1
|
import type { Database } from "../database";
|
|
3
|
-
|
|
4
|
-
/* GENERAL */
|
|
5
|
-
export type AccountType = "player" | "lounge";
|
|
6
|
-
|
|
7
|
-
export interface AuthenticationJWT {
|
|
8
|
-
aud: string;
|
|
9
|
-
exp: number;
|
|
10
|
-
iat: number;
|
|
11
|
-
sub: string;
|
|
12
|
-
email: string;
|
|
13
|
-
phone: string;
|
|
14
|
-
app_metadata: {
|
|
15
|
-
provider: string;
|
|
16
|
-
providers: string[];
|
|
17
|
-
role: string;
|
|
18
|
-
};
|
|
19
|
-
user_metadata: {
|
|
20
|
-
email_verified: boolean;
|
|
21
|
-
phone_verified: boolean;
|
|
22
|
-
sub: string;
|
|
23
|
-
};
|
|
24
|
-
role: string;
|
|
25
|
-
aal: string;
|
|
26
|
-
amr: [{ method: string; timestamp: number }];
|
|
27
|
-
session_id: string;
|
|
28
|
-
is_anonymous: boolean;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export type AuthenticationType = "login" | "register" | "otp";
|
|
32
|
-
|
|
33
|
-
export interface CustomError {
|
|
34
|
-
code: number;
|
|
35
|
-
message: string;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export interface IGDBPlatformsResponse {
|
|
39
|
-
id: number;
|
|
40
|
-
abbreviation: string;
|
|
41
|
-
category: number;
|
|
42
|
-
generation: number;
|
|
43
|
-
name: string;
|
|
44
|
-
platform_family: number;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
export type UserWithRole = User & { app_metadata: { role: string } };
|
|
2
|
+
import type { CustomError, PhoneOTPData as PhoneOTPDataGeneral } from "../general";
|
|
48
3
|
|
|
49
4
|
/* REGISTRATION */
|
|
50
5
|
export type PlayerRegistrationStep = Database["compliance"]["Enums"]["registration_step"];
|
|
@@ -71,30 +26,7 @@ export interface RegistrationStepObject<AccountType> {
|
|
|
71
26
|
|
|
72
27
|
/* PLAYER */
|
|
73
28
|
// OTP verification
|
|
74
|
-
export
|
|
75
|
-
awaitingOTP: boolean;
|
|
76
|
-
dateUpdated?: Date;
|
|
77
|
-
phoneToVerify?: string;
|
|
78
|
-
existingMinorRepData?: ExistingMinorRepDataObject;
|
|
79
|
-
verifiedPhone?: string;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
export interface OTPInputProperties {
|
|
83
|
-
name: string;
|
|
84
|
-
type: string;
|
|
85
|
-
label: string;
|
|
86
|
-
placeholder: string;
|
|
87
|
-
autocomplete: string;
|
|
88
|
-
buttonLabel: string;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
export type PhoneOTPRequestStatus = Database["compliance"]["Enums"]["twilio_verification_status"];
|
|
92
|
-
|
|
93
|
-
export interface PhoneOTPSendCodeAttempt {
|
|
94
|
-
attempt_sid: string;
|
|
95
|
-
channel: string;
|
|
96
|
-
time: string;
|
|
97
|
-
}
|
|
29
|
+
export type PhoneOTPData = PhoneOTPDataGeneral & { existingMinorRepData?: ExistingMinorRepDataObject };
|
|
98
30
|
|
|
99
31
|
// ID verification
|
|
100
32
|
export interface IdentityCountry {
|