Add support for OTPs and enhance sensitive apis with OTP verification (#191)
One-Time Password (OTP) package added with comprehensive token management, including OTP verification for team account deletion and ownership transfer.
This commit is contained in:
committed by
GitHub
parent
20f7fd2c22
commit
d31f3eb993
@@ -77,29 +77,7 @@ export type Database = {
|
||||
updated_at?: string | null;
|
||||
updated_by?: string | null;
|
||||
};
|
||||
Relationships: [
|
||||
{
|
||||
foreignKeyName: 'accounts_created_by_fkey';
|
||||
columns: ['created_by'];
|
||||
isOneToOne: false;
|
||||
referencedRelation: 'users';
|
||||
referencedColumns: ['id'];
|
||||
},
|
||||
{
|
||||
foreignKeyName: 'accounts_primary_owner_user_id_fkey';
|
||||
columns: ['primary_owner_user_id'];
|
||||
isOneToOne: false;
|
||||
referencedRelation: 'users';
|
||||
referencedColumns: ['id'];
|
||||
},
|
||||
{
|
||||
foreignKeyName: 'accounts_updated_by_fkey';
|
||||
columns: ['updated_by'];
|
||||
isOneToOne: false;
|
||||
referencedRelation: 'users';
|
||||
referencedColumns: ['id'];
|
||||
},
|
||||
];
|
||||
Relationships: [];
|
||||
};
|
||||
accounts_memberships: {
|
||||
Row: {
|
||||
@@ -158,27 +136,6 @@ export type Database = {
|
||||
referencedRelation: 'roles';
|
||||
referencedColumns: ['name'];
|
||||
},
|
||||
{
|
||||
foreignKeyName: 'accounts_memberships_created_by_fkey';
|
||||
columns: ['created_by'];
|
||||
isOneToOne: false;
|
||||
referencedRelation: 'users';
|
||||
referencedColumns: ['id'];
|
||||
},
|
||||
{
|
||||
foreignKeyName: 'accounts_memberships_updated_by_fkey';
|
||||
columns: ['updated_by'];
|
||||
isOneToOne: false;
|
||||
referencedRelation: 'users';
|
||||
referencedColumns: ['id'];
|
||||
},
|
||||
{
|
||||
foreignKeyName: 'accounts_memberships_user_id_fkey';
|
||||
columns: ['user_id'];
|
||||
isOneToOne: false;
|
||||
referencedRelation: 'users';
|
||||
referencedColumns: ['id'];
|
||||
},
|
||||
];
|
||||
};
|
||||
billing_customers: {
|
||||
@@ -304,13 +261,6 @@ export type Database = {
|
||||
referencedRelation: 'user_accounts';
|
||||
referencedColumns: ['id'];
|
||||
},
|
||||
{
|
||||
foreignKeyName: 'invitations_invited_by_fkey';
|
||||
columns: ['invited_by'];
|
||||
isOneToOne: false;
|
||||
referencedRelation: 'users';
|
||||
referencedColumns: ['id'];
|
||||
},
|
||||
{
|
||||
foreignKeyName: 'invitations_role_fkey';
|
||||
columns: ['role'];
|
||||
@@ -320,6 +270,69 @@ export type Database = {
|
||||
},
|
||||
];
|
||||
};
|
||||
nonces: {
|
||||
Row: {
|
||||
client_token: string;
|
||||
created_at: string;
|
||||
description: string | null;
|
||||
expires_at: string;
|
||||
id: string;
|
||||
last_verification_at: string | null;
|
||||
last_verification_ip: unknown | null;
|
||||
last_verification_user_agent: string | null;
|
||||
metadata: Json | null;
|
||||
nonce: string;
|
||||
purpose: string;
|
||||
revoked: boolean;
|
||||
revoked_reason: string | null;
|
||||
scopes: string[] | null;
|
||||
tags: string[] | null;
|
||||
used_at: string | null;
|
||||
user_id: string | null;
|
||||
verification_attempts: number;
|
||||
};
|
||||
Insert: {
|
||||
client_token: string;
|
||||
created_at?: string;
|
||||
description?: string | null;
|
||||
expires_at: string;
|
||||
id?: string;
|
||||
last_verification_at?: string | null;
|
||||
last_verification_ip?: unknown | null;
|
||||
last_verification_user_agent?: string | null;
|
||||
metadata?: Json | null;
|
||||
nonce: string;
|
||||
purpose: string;
|
||||
revoked?: boolean;
|
||||
revoked_reason?: string | null;
|
||||
scopes?: string[] | null;
|
||||
tags?: string[] | null;
|
||||
used_at?: string | null;
|
||||
user_id?: string | null;
|
||||
verification_attempts?: number;
|
||||
};
|
||||
Update: {
|
||||
client_token?: string;
|
||||
created_at?: string;
|
||||
description?: string | null;
|
||||
expires_at?: string;
|
||||
id?: string;
|
||||
last_verification_at?: string | null;
|
||||
last_verification_ip?: unknown | null;
|
||||
last_verification_user_agent?: string | null;
|
||||
metadata?: Json | null;
|
||||
nonce?: string;
|
||||
purpose?: string;
|
||||
revoked?: boolean;
|
||||
revoked_reason?: string | null;
|
||||
scopes?: string[] | null;
|
||||
tags?: string[] | null;
|
||||
used_at?: string | null;
|
||||
user_id?: string | null;
|
||||
verification_attempts?: number;
|
||||
};
|
||||
Relationships: [];
|
||||
};
|
||||
notifications: {
|
||||
Row: {
|
||||
account_id: string;
|
||||
@@ -727,6 +740,19 @@ export type Database = {
|
||||
updated_at: string;
|
||||
};
|
||||
};
|
||||
create_nonce: {
|
||||
Args: {
|
||||
p_user_id?: string;
|
||||
p_purpose?: string;
|
||||
p_expires_in_seconds?: number;
|
||||
p_metadata?: Json;
|
||||
p_description?: string;
|
||||
p_tags?: string[];
|
||||
p_scopes?: string[];
|
||||
p_revoke_previous?: boolean;
|
||||
};
|
||||
Returns: Json;
|
||||
};
|
||||
create_team_account: {
|
||||
Args: {
|
||||
account_name: string;
|
||||
@@ -785,6 +811,12 @@ export type Database = {
|
||||
Args: Record<PropertyKey, never>;
|
||||
Returns: Json;
|
||||
};
|
||||
get_nonce_status: {
|
||||
Args: {
|
||||
p_id: string;
|
||||
};
|
||||
Returns: Json;
|
||||
};
|
||||
get_upper_system_role: {
|
||||
Args: Record<PropertyKey, never>;
|
||||
Returns: string;
|
||||
@@ -851,6 +883,13 @@ export type Database = {
|
||||
};
|
||||
Returns: boolean;
|
||||
};
|
||||
revoke_nonce: {
|
||||
Args: {
|
||||
p_id: string;
|
||||
p_reason?: string;
|
||||
};
|
||||
Returns: boolean;
|
||||
};
|
||||
team_account_workspace: {
|
||||
Args: {
|
||||
account_slug: string;
|
||||
@@ -930,6 +969,18 @@ export type Database = {
|
||||
updated_at: string;
|
||||
};
|
||||
};
|
||||
verify_nonce: {
|
||||
Args: {
|
||||
p_token: string;
|
||||
p_purpose: string;
|
||||
p_user_id?: string;
|
||||
p_required_scopes?: string[];
|
||||
p_max_verification_attempts?: number;
|
||||
p_ip?: unknown;
|
||||
p_user_agent?: string;
|
||||
};
|
||||
Returns: Json;
|
||||
};
|
||||
};
|
||||
Enums: {
|
||||
app_permissions:
|
||||
@@ -1034,6 +1085,7 @@ export type Database = {
|
||||
owner_id: string | null;
|
||||
path_tokens: string[] | null;
|
||||
updated_at: string | null;
|
||||
user_metadata: Json | null;
|
||||
version: string | null;
|
||||
};
|
||||
Insert: {
|
||||
@@ -1047,6 +1099,7 @@ export type Database = {
|
||||
owner_id?: string | null;
|
||||
path_tokens?: string[] | null;
|
||||
updated_at?: string | null;
|
||||
user_metadata?: Json | null;
|
||||
version?: string | null;
|
||||
};
|
||||
Update: {
|
||||
@@ -1060,6 +1113,7 @@ export type Database = {
|
||||
owner_id?: string | null;
|
||||
path_tokens?: string[] | null;
|
||||
updated_at?: string | null;
|
||||
user_metadata?: Json | null;
|
||||
version?: string | null;
|
||||
};
|
||||
Relationships: [
|
||||
@@ -1081,6 +1135,7 @@ export type Database = {
|
||||
key: string;
|
||||
owner_id: string | null;
|
||||
upload_signature: string;
|
||||
user_metadata: Json | null;
|
||||
version: string;
|
||||
};
|
||||
Insert: {
|
||||
@@ -1091,6 +1146,7 @@ export type Database = {
|
||||
key: string;
|
||||
owner_id?: string | null;
|
||||
upload_signature: string;
|
||||
user_metadata?: Json | null;
|
||||
version: string;
|
||||
};
|
||||
Update: {
|
||||
@@ -1101,6 +1157,7 @@ export type Database = {
|
||||
key?: string;
|
||||
owner_id?: string | null;
|
||||
upload_signature?: string;
|
||||
user_metadata?: Json | null;
|
||||
version?: string;
|
||||
};
|
||||
Relationships: [
|
||||
@@ -1237,6 +1294,10 @@ export type Database = {
|
||||
updated_at: string;
|
||||
}[];
|
||||
};
|
||||
operation: {
|
||||
Args: Record<PropertyKey, never>;
|
||||
Returns: string;
|
||||
};
|
||||
search: {
|
||||
Args: {
|
||||
prefix: string;
|
||||
@@ -1348,3 +1409,18 @@ export type Enums<
|
||||
: PublicEnumNameOrOptions extends keyof PublicSchema['Enums']
|
||||
? PublicSchema['Enums'][PublicEnumNameOrOptions]
|
||||
: never;
|
||||
|
||||
export type CompositeTypes<
|
||||
PublicCompositeTypeNameOrOptions extends
|
||||
| keyof PublicSchema['CompositeTypes']
|
||||
| { schema: keyof Database },
|
||||
CompositeTypeName extends PublicCompositeTypeNameOrOptions extends {
|
||||
schema: keyof Database;
|
||||
}
|
||||
? keyof Database[PublicCompositeTypeNameOrOptions['schema']]['CompositeTypes']
|
||||
: never = never,
|
||||
> = PublicCompositeTypeNameOrOptions extends { schema: keyof Database }
|
||||
? Database[PublicCompositeTypeNameOrOptions['schema']]['CompositeTypes'][CompositeTypeName]
|
||||
: PublicCompositeTypeNameOrOptions extends keyof PublicSchema['CompositeTypes']
|
||||
? PublicSchema['CompositeTypes'][PublicCompositeTypeNameOrOptions]
|
||||
: never;
|
||||
|
||||
Reference in New Issue
Block a user