@fluido/dreno-core
Advanced tools
Comparing version
import type { DrenoCoreClientThis } from '../impl'; | ||
export declare function signInWithCode(this: DrenoCoreClientThis, code: string): Promise<boolean>; | ||
export declare function signinWithCode(this: DrenoCoreClientThis, code: string): Promise<boolean>; | ||
export declare function signinWithProviderCode(this: DrenoCoreClientThis, _: { | ||
code: string; | ||
provider: string; | ||
}): Promise<void>; |
import type { DrenoCoreClientThis } from '../impl'; | ||
export declare function sendEmailPin(this: DrenoCoreClientThis, args: { | ||
export declare function sendEmail(this: DrenoCoreClientThis, { type, ...args }: { | ||
email: string | string[]; | ||
pin: number; | ||
type: string; | ||
data: Record<string, any>; | ||
}): Promise<boolean>; |
import type { DrenoCoreClientThis } from '../impl'; | ||
export declare function signInWithPassword(this: DrenoCoreClientThis, args: { | ||
export declare function signinWithPassword(this: DrenoCoreClientThis, args: { | ||
identity: string; | ||
password: string; | ||
}): Promise<boolean>; | ||
export declare function signUpWithPassword(this: DrenoCoreClientThis, args: { | ||
export declare function setPassword(this: DrenoCoreClientThis, args: { | ||
identity: string; | ||
password: string; | ||
}): Promise<boolean>; | ||
export declare function definePassword(this: DrenoCoreClientThis, args: { | ||
identity: string; | ||
password: string; | ||
}): Promise<boolean>; |
import type { GeneratedVolatilePin } from '../schemas'; | ||
import type { DrenoCoreClientThis } from '../impl'; | ||
export declare function genVolatilePin(this: DrenoCoreClientThis, identity: string): Promise<GeneratedVolatilePin | null>; | ||
export declare function signInWithVolatilePin(this: DrenoCoreClientThis, args: { | ||
export declare function signinWithVolatilePin(this: DrenoCoreClientThis, args: { | ||
identity: string; | ||
@@ -6,0 +6,0 @@ pin: number; |
import type { DrenoCoreClientThis, JwtPayload } from '../impl'; | ||
import type { UserSignInMetadata, UserWithMetadata } from '../schemas'; | ||
import type { UserSigninMetadata, UserSignupMetadata, UserWithMetadata } from '../schemas'; | ||
export type UserDataResult = { | ||
user: UserWithMetadata | null; | ||
payload: (UserWithMetadata & JwtPayload) | null; | ||
jwt: JwtPayload | null; | ||
token: string | null; | ||
accessExpired: boolean; | ||
isAuthorized: boolean; | ||
}; | ||
@@ -14,3 +14,4 @@ export declare function getUserData(this: DrenoCoreClientThis, { ignoreExpiration, accessToken, refreshToken, }?: { | ||
}): Promise<UserDataResult>; | ||
export declare function getUserSignInMetadata(this: DrenoCoreClientThis, identity: string): Promise<UserSignInMetadata | null>; | ||
export declare function getUserSigninMetadata(this: DrenoCoreClientThis, identity: string): Promise<UserSigninMetadata | null>; | ||
export declare function getUserSignupMetadata(this: DrenoCoreClientThis, identity: string): Promise<UserSignupMetadata | null>; | ||
export declare function getUserIssuesMetadata(this: DrenoCoreClientThis, userId?: string): Promise<({ | ||
@@ -20,5 +21,10 @@ id: string; | ||
} & JwtPayload) | null>; | ||
export declare function redirectSignIn(this: DrenoCoreClientThis, { successRedirect, failedRedirect, }?: { | ||
export declare function redirectSignin(this: DrenoCoreClientThis, { successRedirect, failedRedirect, }?: { | ||
successRedirect?: string; | ||
failedRedirect?: string; | ||
}): Promise<void>; | ||
export declare function updateUserData(this: DrenoCoreClientThis, { userId, ...args }: { | ||
name?: string; | ||
imageURL?: string; | ||
userId?: string; | ||
}): Promise<boolean>; |
@@ -26,2 +26,7 @@ import type { DrenoKeysLoaderStrategy } from './impl'; | ||
} | undefined) => Promise<import("./client-methods/user").UserDataResult>; | ||
updateUserData: (args_0: { | ||
name?: string | undefined; | ||
imageURL?: string | undefined; | ||
userId?: string | undefined; | ||
}) => Promise<boolean>; | ||
getUserIssuesMetadata: (userId?: string | undefined) => Promise<({ | ||
@@ -31,24 +36,24 @@ id: string; | ||
} & import("./impl").JwtPayload) | null>; | ||
getUserSignInMetadata: (identity: string) => Promise<import("./schemas").UserSignInMetadata | null>; | ||
signInWithPassword: (args: { | ||
identity: string; | ||
password: string; | ||
getUserSigninMetadata: (identity: string) => Promise<import("./schemas").UserSigninMetadata | null>; | ||
getUserSignupMetadata: (identity: string) => Promise<import("./schemas").UserSignupMetadata | null>; | ||
setUserMetadata: (args_0: { | ||
type: "private" | "public" | "editable"; | ||
data: Record<string, any>; | ||
userId?: string | undefined; | ||
}) => Promise<boolean>; | ||
signUpWithPassword: (args: { | ||
signinWithPassword: (args: { | ||
identity: string; | ||
password: string; | ||
}) => Promise<boolean>; | ||
definePassword: (args: { | ||
setPassword: (args: { | ||
identity: string; | ||
password: string; | ||
}) => Promise<boolean>; | ||
signInWithCode: (code: string) => Promise<boolean>; | ||
genVolatileHash: (identity: string) => Promise<import("./schemas").GeneratedVolatileHash | null>; | ||
signInWithVolatileHash: (args: { | ||
hash: string; | ||
number: number; | ||
isRecovery?: boolean | undefined; | ||
}) => Promise<boolean>; | ||
signinWithCode: (code: string) => Promise<boolean>; | ||
signinWithProviderCode: (_: { | ||
code: string; | ||
provider: string; | ||
}) => Promise<void>; | ||
genVolatilePin: (identity: string) => Promise<import("./schemas").GeneratedVolatilePin | null>; | ||
signInWithVolatilePin: (args: { | ||
signinWithVolatilePin: (args: { | ||
identity: string; | ||
@@ -58,13 +63,17 @@ pin: number; | ||
}) => Promise<boolean>; | ||
redirectSignIn: (args_0?: { | ||
redirectSignin: (args_0?: { | ||
successRedirect?: string | undefined; | ||
failedRedirect?: string | undefined; | ||
} | undefined) => Promise<void>; | ||
email: { | ||
sendEmailPin: (args: { | ||
email: string | string[]; | ||
pin: number; | ||
}) => Promise<boolean>; | ||
}; | ||
inviteUserToGroup: (args_0: { | ||
identity: string; | ||
group: string; | ||
scope: "owner" | "admin" | "member"; | ||
}) => Promise<boolean>; | ||
sendEmail: (args_0: { | ||
email: string | string[]; | ||
type: string; | ||
data: Record<string, any>; | ||
}) => Promise<boolean>; | ||
}>; | ||
export type DrenoClient = Awaited<ReturnType<typeof createDrenoClient>>; |
export declare const URLS: { | ||
API: string; | ||
WEB: string; | ||
}; | ||
@@ -4,0 +5,0 @@ export declare const COOKIES_KEYS: { |
@@ -6,2 +6,2 @@ import type { DrenoMethodsThis } from '../instance'; | ||
isRecovery?: boolean; | ||
}): Promise<boolean>; | ||
}): Promise<any>; |
import type { AuthenticationDrenoClient } from '../instance'; | ||
export declare function bindInstance<Add extends Record<string, Function>>(getInstance: () => Promise<AuthenticationDrenoClient>, additionalMethods?: Add): ExtractRecordThis<{ | ||
getUserSignature(this: import("../instance").DrenoMethodsThis): Promise<import("..").UserDataResult>; | ||
getUser(this: import("../instance").DrenoMethodsThis): Promise<{ | ||
user: import("..").UserWithMetadata | null; | ||
jwt: import("..").JwtPayload | null; | ||
token: string | null; | ||
}>; | ||
getUsers(this: import("../instance").DrenoMethodsThis): Promise<{ | ||
user: import("..").UserWithMetadata; | ||
accessExpired: boolean; | ||
isAuthorized: boolean; | ||
}[]>; | ||
@@ -12,25 +16,23 @@ removeUser(this: import("../instance").DrenoMethodsThis, userId?: string | undefined): Promise<void>; | ||
signOutAll(this: import("../instance").DrenoMethodsThis): Promise<void>; | ||
setUserMetadata(this: import("../instance").DrenoMethodsThis, _: { | ||
setUserMetadata(this: import("../instance").DrenoMethodsThis, args: { | ||
type: "private" | "public" | "editable"; | ||
value: Record<string, any>; | ||
data: Record<string, any>; | ||
userId?: string | undefined; | ||
}): Promise<void>; | ||
updateUserName(this: import("../instance").DrenoMethodsThis, { name }: { | ||
updateUserName(this: import("../instance").DrenoMethodsThis, { name, userId }: { | ||
name: string; | ||
userId?: string | undefined; | ||
}): Promise<void>; | ||
updateUserImage(this: import("../instance").DrenoMethodsThis, { image }: { | ||
updateUserImage(this: import("../instance").DrenoMethodsThis, { image, userId }: { | ||
image: string | File; | ||
userId?: string | undefined; | ||
}): Promise<void>; | ||
getUserSignInMetadata(this: import("../instance").DrenoMethodsThis, identity: string): Promise<import("..").UserSignInMetadata | null>; | ||
redirectSignIn(this: import("../instance").DrenoMethodsThis, args?: { | ||
getUserSigninMetadata(this: import("../instance").DrenoMethodsThis, identity: string): Promise<import("..").UserSigninMetadata | null>; | ||
getUserSignupMetadata(this: import("../instance").DrenoMethodsThis, identity: string): Promise<import("..").UserSignupMetadata | null>; | ||
redirectSignin(this: import("../instance").DrenoMethodsThis, args?: { | ||
successRedirect?: string | undefined; | ||
failedRedirect?: string | undefined; | ||
} | undefined): Promise<void>; | ||
redirectSignUp(this: import("../instance").DrenoMethodsThis, _?: { | ||
successRedirect?: string | undefined; | ||
failedRedirect?: string | undefined; | ||
} | undefined): Promise<void>; | ||
getProjectId(this: import("../instance").DrenoMethodsThis): Promise<string>; | ||
signInWithVolatilePin(this: import("../instance").DrenoMethodsThis, args: { | ||
signinWithPin(this: import("../instance").DrenoMethodsThis, args: { | ||
identity: string; | ||
@@ -40,17 +42,11 @@ pin: number; | ||
}): Promise<boolean>; | ||
signInWithPassword(this: import("../instance").DrenoMethodsThis, args: { | ||
signinWithPassword(this: import("../instance").DrenoMethodsThis, args: { | ||
identity: string; | ||
password: string; | ||
}): Promise<boolean>; | ||
signUpWithPassword(this: import("../instance").DrenoMethodsThis, _: { | ||
inviteUserToGroup(this: import("../instance").DrenoMethodsThis, args: { | ||
identity: string; | ||
password: string; | ||
}): Promise<void>; | ||
getPasswordCredentials(this: import("../instance").DrenoMethodsThis): Promise<void>; | ||
signInWithMagicLink(this: import("../instance").DrenoMethodsThis, _: { | ||
sendTo: ("email" | "sms" | "whatsapp" | "telegram")[]; | ||
}): Promise<void>; | ||
signUpWithMagicLink(this: import("../instance").DrenoMethodsThis, _: { | ||
sendTo: ("email" | "sms" | "whatsapp" | "telegram")[]; | ||
}): Promise<void>; | ||
group: string; | ||
scope: "owner" | "admin" | "member"; | ||
}): Promise<boolean>; | ||
getIdentities(this: import("../instance").DrenoMethodsThis): Promise<void>; | ||
@@ -63,21 +59,2 @@ addIdentity(this: import("../instance").DrenoMethodsThis, _: { | ||
}): Promise<void>; | ||
signInWithVolatileHash(this: import("../instance").DrenoMethodsThis, args: { | ||
hash: string; | ||
number: number; | ||
isRecovery?: boolean | undefined; | ||
}): Promise<boolean>; | ||
signInWithFido2(this: import("../instance").DrenoMethodsThis, _: { | ||
identity: string; | ||
}): Promise<void>; | ||
signUpWithFido2(this: import("../instance").DrenoMethodsThis, _: { | ||
identity: string; | ||
}): Promise<void>; | ||
getDeviceCredentials(this: import("../instance").DrenoMethodsThis): Promise<void>; | ||
addDeviceCredential(this: import("../instance").DrenoMethodsThis): Promise<void>; | ||
removeDeviceCredential(this: import("../instance").DrenoMethodsThis, cid: string): Promise<void>; | ||
signInWithExternalAccount(this: import("../instance").DrenoMethodsThis, provider: string): Promise<void>; | ||
signUpWithExternalAccount(this: import("../instance").DrenoMethodsThis, provider: string): Promise<void>; | ||
getExternalAccounts(this: import("../instance").DrenoMethodsThis): Promise<void>; | ||
connectExternalAccount(this: import("../instance").DrenoMethodsThis, provider: string): Promise<void>; | ||
disconnectExternalAccount(this: import("../instance").DrenoMethodsThis, provider: string): Promise<void>; | ||
sendEmailPin(this: import("../instance").DrenoMethodsThis, args: { | ||
@@ -84,0 +61,0 @@ email: string | string[]; |
import type { DrenoMethodsThis } from '../instance'; | ||
export declare function signInWithPassword(this: DrenoMethodsThis, args: { | ||
export declare function signinWithPassword(this: DrenoMethodsThis, args: { | ||
identity: string; | ||
password: string; | ||
}): Promise<boolean>; | ||
export declare function signUpWithPassword(this: DrenoMethodsThis, _: { | ||
identity: string; | ||
password: string; | ||
}): Promise<void>; | ||
export declare function getPasswordCredentials(this: DrenoMethodsThis): Promise<void>; |
import type { DrenoMethodsThis } from '../instance'; | ||
export declare function signInWithVolatilePin(this: DrenoMethodsThis, args: { | ||
export declare function signinWithPin(this: DrenoMethodsThis, args: { | ||
identity: string; | ||
@@ -4,0 +4,0 @@ pin: number; |
import type { DrenoMethodsThis } from '../instance'; | ||
export declare function getUserSignature(this: DrenoMethodsThis): Promise<import("..").UserDataResult>; | ||
export declare function getUser(this: DrenoMethodsThis): Promise<{ | ||
user: import("..").UserWithMetadata | null; | ||
jwt: import("..").JwtPayload | null; | ||
token: string | null; | ||
}>; | ||
export declare function getUsers(this: DrenoMethodsThis): Promise<{ | ||
user: import("..").UserWithMetadata; | ||
accessExpired: boolean; | ||
isAuthorized: boolean; | ||
}[]>; | ||
@@ -11,22 +15,20 @@ export declare function removeUser(this: DrenoMethodsThis, userId?: string): Promise<void>; | ||
export declare function signOutAll(this: DrenoMethodsThis): Promise<void>; | ||
export declare function setUserMetadata(this: DrenoMethodsThis, _: { | ||
export declare function setUserMetadata(this: DrenoMethodsThis, args: { | ||
type: 'private' | 'public' | 'editable'; | ||
value: Record<string, any>; | ||
data: Record<string, any>; | ||
userId?: string; | ||
}): Promise<void>; | ||
export declare function updateUserName(this: DrenoMethodsThis, { name }: { | ||
export declare function updateUserName(this: DrenoMethodsThis, { name, userId }: { | ||
name: string; | ||
userId?: string; | ||
}): Promise<void>; | ||
export declare function updateUserImage(this: DrenoMethodsThis, { image }: { | ||
export declare function updateUserImage(this: DrenoMethodsThis, { image, userId }: { | ||
image: string | File; | ||
userId?: string; | ||
}): Promise<void>; | ||
export declare function getUserSignInMetadata(this: DrenoMethodsThis, identity: string): Promise<import("..").UserSignInMetadata | null>; | ||
export declare function redirectSignIn(this: DrenoMethodsThis, args?: { | ||
export declare function getUserSigninMetadata(this: DrenoMethodsThis, identity: string): Promise<import("..").UserSigninMetadata | null>; | ||
export declare function getUserSignupMetadata(this: DrenoMethodsThis, identity: string): Promise<import("..").UserSignupMetadata | null>; | ||
export declare function redirectSignin(this: DrenoMethodsThis, args?: { | ||
successRedirect?: string; | ||
failedRedirect?: string; | ||
}): Promise<void>; | ||
export declare function redirectSignUp(this: DrenoMethodsThis, _?: { | ||
successRedirect?: string; | ||
failedRedirect?: string; | ||
}): Promise<void>; |
@@ -14,3 +14,3 @@ import { type DrenoClientArgs } from './client'; | ||
user: UserWithMetadata; | ||
accessExpired: boolean; | ||
isAuthorized: boolean; | ||
}[]>; | ||
@@ -26,2 +26,7 @@ keysLoader: import("./impl").DrenoKeysLoaderStrategy; | ||
} | undefined) => Promise<import(".").UserDataResult>; | ||
updateUserData: (args_0: { | ||
name?: string | undefined; | ||
imageURL?: string | undefined; | ||
userId?: string | undefined; | ||
}) => Promise<boolean>; | ||
getUserIssuesMetadata: (userId?: string | undefined) => Promise<({ | ||
@@ -31,24 +36,24 @@ id: string; | ||
} & import("./impl").JwtPayload) | null>; | ||
getUserSignInMetadata: (identity: string) => Promise<import("./schemas").UserSignInMetadata | null>; | ||
signInWithPassword: (args: { | ||
identity: string; | ||
password: string; | ||
getUserSigninMetadata: (identity: string) => Promise<import("./schemas").UserSigninMetadata | null>; | ||
getUserSignupMetadata: (identity: string) => Promise<import("./schemas").UserSignupMetadata | null>; | ||
setUserMetadata: (args_0: { | ||
type: "private" | "public" | "editable"; | ||
data: Record<string, any>; | ||
userId?: string | undefined; | ||
}) => Promise<boolean>; | ||
signUpWithPassword: (args: { | ||
signinWithPassword: (args: { | ||
identity: string; | ||
password: string; | ||
}) => Promise<boolean>; | ||
definePassword: (args: { | ||
setPassword: (args: { | ||
identity: string; | ||
password: string; | ||
}) => Promise<boolean>; | ||
signInWithCode: (code: string) => Promise<boolean>; | ||
genVolatileHash: (identity: string) => Promise<import("./schemas").GeneratedVolatileHash | null>; | ||
signInWithVolatileHash: (args: { | ||
hash: string; | ||
number: number; | ||
isRecovery?: boolean | undefined; | ||
}) => Promise<boolean>; | ||
signinWithCode: (code: string) => Promise<boolean>; | ||
signinWithProviderCode: (_: { | ||
code: string; | ||
provider: string; | ||
}) => Promise<void>; | ||
genVolatilePin: (identity: string) => Promise<import("./schemas").GeneratedVolatilePin | null>; | ||
signInWithVolatilePin: (args: { | ||
signinWithVolatilePin: (args: { | ||
identity: string; | ||
@@ -58,12 +63,16 @@ pin: number; | ||
}) => Promise<boolean>; | ||
redirectSignIn: (args_0?: { | ||
redirectSignin: (args_0?: { | ||
successRedirect?: string | undefined; | ||
failedRedirect?: string | undefined; | ||
} | undefined) => Promise<void>; | ||
email: { | ||
sendEmailPin: (args: { | ||
email: string | string[]; | ||
pin: number; | ||
}) => Promise<boolean>; | ||
}; | ||
inviteUserToGroup: (args_0: { | ||
identity: string; | ||
group: string; | ||
scope: "owner" | "admin" | "member"; | ||
}) => Promise<boolean>; | ||
sendEmail: (args_0: { | ||
email: string | string[]; | ||
type: string; | ||
data: Record<string, any>; | ||
}) => Promise<boolean>; | ||
}>; |
import { type Output } from 'valibot'; | ||
export declare const StatusSchema: import("valibot").EnumSchema<["active", "suspended", "deleted"], "active" | "suspended" | "deleted">; | ||
export declare const StatusSchema: import("valibot").PicklistSchema<("active" | "inactive" | "deleted")[], "active" | "inactive" | "deleted">; | ||
export type StatusData = Output<typeof StatusSchema>; | ||
@@ -15,5 +15,5 @@ export declare const DateCoerce: import("valibot").DateSchema<Date>; | ||
createdAt: import("valibot").DateSchema<Date>; | ||
}, { | ||
}, undefined, { | ||
type: string; | ||
id: string; | ||
type: string; | ||
action: string; | ||
@@ -20,0 +20,0 @@ metadata: { |
import { type Output } from 'valibot'; | ||
export declare const OAuthConfigSchema: import("valibot").ObjectSchema<{ | ||
id: import("valibot").StringSchema<string>; | ||
pid: import("valibot").StringSchema<string>; | ||
provider: import("valibot").StringSchema<string>; | ||
clientId: import("valibot").StringSchema<string>; | ||
clientSecret: import("valibot").StringSchema<string>; | ||
status: import("valibot").EnumSchema<["active", "suspended", "deleted"], "active" | "suspended" | "deleted">; | ||
keys: import("valibot").ObjectSchema<{ | ||
clientId: import("valibot").StringSchema<string>; | ||
secretKey: import("valibot").StringSchema<string>; | ||
}, undefined, { | ||
clientId: string; | ||
secretKey: string; | ||
}>; | ||
urls: import("valibot").ObjectSchema<{ | ||
authorize: import("valibot").StringSchema<string>; | ||
token: import("valibot").StringSchema<string>; | ||
}, undefined, { | ||
authorize: string; | ||
token: string; | ||
}>; | ||
status: import("valibot").PicklistSchema<("active" | "inactive" | "deleted")[], "active" | "inactive" | "deleted">; | ||
createdAt: import("valibot").DateSchema<Date>; | ||
updatedAt: import("valibot").DateSchema<Date>; | ||
}, { | ||
}, undefined, { | ||
id: string; | ||
createdAt: Date; | ||
status: "active" | "suspended" | "deleted"; | ||
pid: string; | ||
status: "active" | "inactive" | "deleted"; | ||
updatedAt: Date; | ||
provider: string; | ||
clientId: string; | ||
clientSecret: string; | ||
keys: { | ||
clientId: string; | ||
secretKey: string; | ||
}; | ||
urls: { | ||
authorize: string; | ||
token: string; | ||
}; | ||
}>; | ||
export type OAuthConfigData = Output<typeof OAuthConfigSchema>; |
import { type Output } from 'valibot'; | ||
import type { UserData } from './user'; | ||
export declare const OrganizationTypeSchema: import("valibot").EnumSchema<["personal", "business"], "personal" | "business">; | ||
export declare const OrganizationTypeSchema: import("valibot").PicklistSchema<("group" | "personal" | "business")[], "group" | "personal" | "business">; | ||
export type OrganizationType = Output<typeof OrganizationTypeSchema>; | ||
export declare const OrganizationSchema: import("valibot").ObjectSchema<{ | ||
id: import("valibot").StringSchema<string>; | ||
pid: import("valibot").StringSchema<string>; | ||
name: import("valibot").StringSchema<string>; | ||
description: import("valibot").OptionalSchema<import("valibot").StringSchema<string>, undefined, string | undefined>; | ||
imageURL: import("valibot").OptionalSchema<import("valibot").StringSchema<string>, undefined, string | undefined>; | ||
type: import("valibot").EnumSchema<["personal", "business"], "personal" | "business">; | ||
ownerId: import("valibot").StringSchema<string>; | ||
type: import("valibot").PicklistSchema<("group" | "personal" | "business")[], "group" | "personal" | "business">; | ||
createdAt: import("valibot").DateSchema<Date>; | ||
updatedAt: import("valibot").DateSchema<Date>; | ||
}, { | ||
}, undefined, { | ||
type: "group" | "personal" | "business"; | ||
id: string; | ||
type: "personal" | "business"; | ||
createdAt: Date; | ||
pid: string; | ||
name: string; | ||
updatedAt: Date; | ||
ownerId: string; | ||
imageURL?: string | undefined; | ||
@@ -22,0 +22,0 @@ description?: string | undefined; |
@@ -6,19 +6,15 @@ import { type Output } from 'valibot'; | ||
name: import("valibot").StringSchema<string>; | ||
slug: import("valibot").StringSchema<string>; | ||
description: import("valibot").OptionalSchema<import("valibot").StringSchema<string>, undefined, string | undefined>; | ||
imageURL: import("valibot").OptionalSchema<import("valibot").StringSchema<string>, undefined, string | undefined>; | ||
type: import("valibot").EnumSchema<["personal", "business"], "personal" | "business">; | ||
ownerId: import("valibot").StringSchema<string>; | ||
version: import("valibot").NumberSchema<number>; | ||
status: import("valibot").EnumSchema<["active", "suspended", "deleted"], "active" | "suspended" | "deleted">; | ||
status: import("valibot").PicklistSchema<("active" | "inactive" | "deleted")[], "active" | "inactive" | "deleted">; | ||
createdAt: import("valibot").DateSchema<Date>; | ||
updatedAt: import("valibot").DateSchema<Date>; | ||
}, { | ||
}, undefined, { | ||
id: string; | ||
type: "personal" | "business"; | ||
createdAt: Date; | ||
name: string; | ||
status: "active" | "suspended" | "deleted"; | ||
status: "active" | "inactive" | "deleted"; | ||
updatedAt: Date; | ||
ownerId: string; | ||
version: number; | ||
slug: string; | ||
imageURL?: string | undefined; | ||
@@ -36,18 +32,18 @@ description?: string | undefined; | ||
pid: import("valibot").StringSchema<string>; | ||
keyValue: import("valibot").StringSchema<string>; | ||
data: import("valibot").StringSchema<string>; | ||
name: import("valibot").StringSchema<string>; | ||
description: import("valibot").OptionalSchema<import("valibot").StringSchema<string>, undefined, string | undefined>; | ||
status: import("valibot").EnumSchema<["active", "suspended", "deleted"], "active" | "suspended" | "deleted">; | ||
status: import("valibot").PicklistSchema<("active" | "inactive" | "deleted")[], "active" | "inactive" | "deleted">; | ||
createdAt: import("valibot").DateSchema<Date>; | ||
updatedAt: import("valibot").DateSchema<Date>; | ||
}, { | ||
}, undefined, { | ||
data: string; | ||
id: string; | ||
createdAt: Date; | ||
pid: string; | ||
name: string; | ||
status: "active" | "suspended" | "deleted"; | ||
status: "active" | "inactive" | "deleted"; | ||
updatedAt: Date; | ||
pid: string; | ||
keyValue: string; | ||
description?: string | undefined; | ||
}>; | ||
export type ProjectKeyData = Output<typeof ProjectKeySchema>; |
import { type Output } from 'valibot'; | ||
export declare const UserSchema: import("valibot").ObjectSchema<{ | ||
id: import("valibot").StringSchema<string>; | ||
pid: import("valibot").StringSchema<string>; | ||
name: import("valibot").StringSchema<string>; | ||
imageURL: import("valibot").OptionalSchema<import("valibot").StringSchema<string>, undefined, string | undefined>; | ||
externalId: import("valibot").OptionalSchema<import("valibot").StringSchema<string>, undefined, string | undefined>; | ||
description: import("valibot").OptionalSchema<import("valibot").StringSchema<string>, undefined, string | undefined>; | ||
mainIdentity: import("valibot").OptionalSchema<import("valibot").StringSchema<string>, undefined, string | undefined>; | ||
status: import("valibot").UnionSchema<[import("valibot").EnumSchema<["active", "suspended", "deleted"], "active" | "suspended" | "deleted">, import("valibot").LiteralSchema<"banished", "banished">], "active" | "suspended" | "deleted" | "banished">; | ||
status: import("valibot").UnionSchema<(import("valibot").PicklistSchema<("active" | "inactive" | "deleted")[], "active" | "inactive" | "deleted"> | import("valibot").LiteralSchema<"banished", "banished">)[], "active" | "inactive" | "deleted" | "banished">; | ||
createdAt: import("valibot").DateSchema<Date>; | ||
updatedAt: import("valibot").DateSchema<Date>; | ||
lastSignInAt: import("valibot").DateSchema<Date>; | ||
}, { | ||
lastSigninAt: import("valibot").DateSchema<Date>; | ||
}, undefined, { | ||
id: string; | ||
createdAt: Date; | ||
pid: string; | ||
name: string; | ||
status: "active" | "suspended" | "deleted" | "banished"; | ||
status: "active" | "inactive" | "deleted" | "banished"; | ||
updatedAt: Date; | ||
lastSignInAt: Date; | ||
lastSigninAt: Date; | ||
imageURL?: string | undefined; | ||
externalId?: string | undefined; | ||
description?: string | undefined; | ||
@@ -29,3 +29,3 @@ mainIdentity?: string | undefined; | ||
issues: import("valibot").ArraySchema<import("valibot").StringSchema<string>, string[]>; | ||
}, { | ||
}, undefined, { | ||
id: string; | ||
@@ -35,17 +35,19 @@ issues: string[]; | ||
export type RefreshData = Output<typeof RefreshSchema>; | ||
export declare const UserMetadataTypeSchema: import("valibot").PicklistSchema<("private" | "public" | "editable")[], "private" | "public" | "editable">; | ||
export type UserMetadataType = Output<typeof UserMetadataTypeSchema>; | ||
export declare const MetadataSchema: import("valibot").ObjectSchema<{ | ||
id: import("valibot").StringSchema<string>; | ||
uid: import("valibot").StringSchema<string>; | ||
value: import("valibot").RecordSchema<import("valibot").StringSchema<string>, import("valibot").AnySchema<any>, { | ||
data: import("valibot").RecordSchema<import("valibot").StringSchema<string>, import("valibot").AnySchema<any>, { | ||
[x: string]: any; | ||
}>; | ||
type: import("valibot").EnumSchema<["private", "public", "editable"], "private" | "public" | "editable">; | ||
type: import("valibot").PicklistSchema<("private" | "public" | "editable")[], "private" | "public" | "editable">; | ||
createdAt: import("valibot").DateSchema<Date>; | ||
updatedAt: import("valibot").DateSchema<Date>; | ||
}, { | ||
value: { | ||
}, undefined, { | ||
type: "private" | "public" | "editable"; | ||
data: { | ||
[x: string]: any; | ||
}; | ||
id: string; | ||
type: "private" | "public" | "editable"; | ||
uid: string; | ||
@@ -56,25 +58,36 @@ createdAt: Date; | ||
export type MetadataData = Output<typeof MetadataSchema>; | ||
export declare const DeviceCredentialSchema: import("valibot").ObjectSchema<{ | ||
export declare const CredentialSchema: import("valibot").ObjectSchema<{ | ||
id: import("valibot").StringSchema<string>; | ||
cid: import("valibot").StringSchema<string>; | ||
uid: import("valibot").StringSchema<string>; | ||
deviceType: import("valibot").StringSchema<string>; | ||
publicKey: import("valibot").StringSchema<string>; | ||
prevCounter: import("valibot").NumberSchema<number>; | ||
pid: import("valibot").StringSchema<string>; | ||
externalId: import("valibot").OptionalSchema<import("valibot").StringSchema<string>, undefined, string | undefined>; | ||
type: import("valibot").PicklistSchema<("password" | "fido2")[], "password" | "fido2">; | ||
state: import("valibot").PicklistSchema<("active" | "inactive")[], "active" | "inactive">; | ||
data: import("valibot").StringSchema<string>; | ||
metadata: import("valibot").OptionalSchema<import("valibot").RecordSchema<import("valibot").StringSchema<string>, import("valibot").AnySchema<any>, { | ||
[x: string]: any; | ||
}>, undefined, { | ||
[x: string]: any; | ||
} | undefined>; | ||
createdAt: import("valibot").DateSchema<Date>; | ||
updatedAt: import("valibot").DateSchema<Date>; | ||
}, { | ||
}, undefined, { | ||
type: "password" | "fido2"; | ||
data: string; | ||
id: string; | ||
uid: string; | ||
createdAt: Date; | ||
pid: string; | ||
updatedAt: Date; | ||
cid: string; | ||
deviceType: string; | ||
publicKey: string; | ||
prevCounter: number; | ||
state: "active" | "inactive"; | ||
metadata?: { | ||
[x: string]: any; | ||
} | undefined; | ||
externalId?: string | undefined; | ||
}>; | ||
export type DeviceCredentialData = Output<typeof DeviceCredentialSchema>; | ||
export type CredentialData = Output<typeof CredentialSchema>; | ||
export declare const ExternalAccountSchema: import("valibot").ObjectSchema<{ | ||
id: import("valibot").StringSchema<string>; | ||
uid: import("valibot").StringSchema<string>; | ||
pid: import("valibot").StringSchema<string>; | ||
providerId: import("valibot").StringSchema<string>; | ||
@@ -85,3 +98,3 @@ provider: import("valibot").StringSchema<string>; | ||
}>; | ||
userData: import("valibot").ObjectSchema<{ | ||
data: import("valibot").ObjectSchema<{ | ||
name: import("valibot").StringSchema<string>; | ||
@@ -91,3 +104,3 @@ imageURL: import("valibot").OptionalSchema<import("valibot").StringSchema<string>, undefined, string | undefined>; | ||
phones: import("valibot").ArraySchema<import("valibot").StringSchema<string>, string[]>; | ||
}, { | ||
}, undefined, { | ||
name: string; | ||
@@ -100,6 +113,13 @@ emails: string[]; | ||
updatedAt: import("valibot").DateSchema<Date>; | ||
}, { | ||
}, undefined, { | ||
data: { | ||
name: string; | ||
emails: string[]; | ||
phones: string[]; | ||
imageURL?: string | undefined; | ||
}; | ||
id: string; | ||
uid: string; | ||
createdAt: Date; | ||
pid: string; | ||
updatedAt: Date; | ||
@@ -111,25 +131,5 @@ providerId: string; | ||
}; | ||
userData: { | ||
name: string; | ||
emails: string[]; | ||
phones: string[]; | ||
imageURL?: string | undefined; | ||
}; | ||
}>; | ||
export type ExternalAccountData = Output<typeof ExternalAccountSchema>; | ||
export declare const PasswordCredentialSchema: import("valibot").ObjectSchema<{ | ||
id: import("valibot").StringSchema<string>; | ||
uid: import("valibot").StringSchema<string>; | ||
hash: import("valibot").StringSchema<string>; | ||
forRedefine: import("valibot").OptionalSchema<import("valibot").BooleanSchema<boolean>, false, boolean>; | ||
createdAt: import("valibot").DateSchema<Date>; | ||
}, { | ||
id: string; | ||
uid: string; | ||
createdAt: Date; | ||
hash: string; | ||
forRedefine: boolean; | ||
}>; | ||
export type PasswordCredentialData = Output<typeof PasswordCredentialSchema>; | ||
export declare const IdentityTypeSchema: import("valibot").EnumSchema<["username", "email", "phone"], "username" | "email" | "phone">; | ||
export declare const IdentityTypeSchema: import("valibot").PicklistSchema<("email" | "username" | "phone")[], "email" | "username" | "phone">; | ||
export type IdentityType = Output<typeof IdentityTypeSchema>; | ||
@@ -139,4 +139,5 @@ export declare const UserIdentitySchema: import("valibot").ObjectSchema<{ | ||
uid: import("valibot").StringSchema<string>; | ||
type: import("valibot").EnumSchema<["username", "email", "phone"], "username" | "email" | "phone">; | ||
value: import("valibot").StringSchema<string>; | ||
pid: import("valibot").StringSchema<string>; | ||
type: import("valibot").PicklistSchema<("email" | "username" | "phone")[], "email" | "username" | "phone">; | ||
data: import("valibot").StringSchema<string>; | ||
origin: import("valibot").OptionalSchema<import("valibot").StringSchema<string>, undefined, string | undefined>; | ||
@@ -147,8 +148,9 @@ main: import("valibot").OptionalSchema<import("valibot").BooleanSchema<boolean>, false, boolean>; | ||
updatedAt: import("valibot").DateSchema<Date>; | ||
}, { | ||
value: string; | ||
}, undefined, { | ||
type: "email" | "username" | "phone"; | ||
data: string; | ||
id: string; | ||
type: "username" | "email" | "phone"; | ||
uid: string; | ||
createdAt: Date; | ||
pid: string; | ||
updatedAt: Date; | ||
@@ -160,20 +162,2 @@ main: boolean; | ||
export type UserIdentityData = Output<typeof UserIdentitySchema>; | ||
export declare const VolatileHashSchema: import("valibot").ObjectSchema<{ | ||
id: import("valibot").StringSchema<string>; | ||
uid: import("valibot").StringSchema<string>; | ||
hash: import("valibot").StringSchema<string>; | ||
number: import("valibot").NumberSchema<number>; | ||
numbers: import("valibot").ArraySchema<import("valibot").NumberSchema<number>, number[]>; | ||
ttl: import("valibot").DateSchema<Date>; | ||
createdAt: import("valibot").DateSchema<Date>; | ||
}, { | ||
number: number; | ||
id: string; | ||
uid: string; | ||
createdAt: Date; | ||
hash: string; | ||
numbers: number[]; | ||
ttl: Date; | ||
}>; | ||
export type VolatileHashData = Output<typeof VolatileHashSchema>; | ||
export declare const VolatilePinSchema: import("valibot").ObjectSchema<{ | ||
@@ -185,16 +169,14 @@ id: import("valibot").StringSchema<string>; | ||
createdAt: import("valibot").DateSchema<Date>; | ||
}, { | ||
}, undefined, { | ||
id: string; | ||
uid: string; | ||
createdAt: Date; | ||
pin: number; | ||
ttl: Date; | ||
pin: number; | ||
}>; | ||
export type VolatilePinData = Output<typeof VolatilePinSchema>; | ||
export declare const UserMetadataTypeSchema: import("valibot").EnumSchema<["public", "private", "editable"], "private" | "public" | "editable">; | ||
export type UserMetadataType = Output<typeof UserMetadataTypeSchema>; | ||
export type UserWithMetadata = UserData & { | ||
metadata: Record<UserMetadataType, Record<string, any>>; | ||
}; | ||
export type UserSignInMetadata = { | ||
export type UserSigninMetadata = { | ||
identity: string; | ||
@@ -204,2 +186,6 @@ identities: string[]; | ||
}; | ||
export type UserSignupMetadata = { | ||
identityTypes: string[]; | ||
credentialTypes: string[]; | ||
}; | ||
export type GeneratedVolatileHash = { | ||
@@ -206,0 +192,0 @@ hash: string; |
@@ -0,2 +1,7 @@ | ||
import { type BaseSchema } from 'valibot'; | ||
import type { JwtPayload } from './impl'; | ||
export declare function extractPayloadFromJwt<T = Record<string, any>>(token?: string): Promise<(T & JwtPayload) | null>; | ||
export declare function parseJSON<T extends Record<string, any>>({ schema, property, }?: { | ||
schema?: BaseSchema<T>; | ||
property?: string; | ||
}): (res: Response) => Promise<T>; |
{ | ||
"name": "@fluido/dreno-core", | ||
"version": "0.5.6-alpha", | ||
"version": "0.6.0-alpha", | ||
"description": "Dreno library", | ||
@@ -33,14 +33,15 @@ "license": "MIT", | ||
"dependencies": { | ||
"@types/js-cookie": "^3.0.4", | ||
"@types/js-cookie": "^3.0.6", | ||
"base64url": "^3.0.1", | ||
"http-status-codes": "^2.3.0", | ||
"js-cookie": "^3.0.5", | ||
"lodash": "^4.17.21", | ||
"valibot": "^0.19.0" | ||
"valibot": "^0.24.1" | ||
}, | ||
"devDependencies": { | ||
"@types/node": "^20.8.4", | ||
"esbuild": "^0.19.4", | ||
"@types/node": "^20.10.4", | ||
"esbuild": "^0.19.9", | ||
"npm-run-all": "^4.1.5", | ||
"typescript": "^5.2.2" | ||
"typescript": "^5.3.3" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 4 instances in 1 package
38
11.76%100478
-0.96%6
20%2903
-0.21%19
72.73%32
23.08%+ Added
+ Added
+ Added
- Removed
Updated
Updated