expo-passkey
Version:
Passkey authentication for Expo apps with Better Auth integration
222 lines • 9.26 kB
TypeScript
/**
* @file List passkeys endpoint
* @description Implementation of the endpoint to list user passkeys with WebAuthn info
*/
import type { Logger } from "../utils/logger";
import type { ResolvedSchemaConfig } from "../../types";
/**
* Create endpoint to list user passkeys
*/
export declare const createListEndpoint: (options: {
logger: Logger;
schemaConfig: ResolvedSchemaConfig;
}) => {
<AsResponse extends boolean = false, ReturnHeaders extends boolean = false>(inputCtx_0: {
body?: undefined;
} & {
method?: "GET" | undefined;
} & {
query: {
limit?: string | undefined;
offset?: string | undefined;
};
} & {
params: {
userId: string;
};
} & {
request?: Request;
} & {
headers?: HeadersInit;
} & {
asResponse?: boolean;
returnHeaders?: boolean;
use?: import("better-call").Middleware[];
path?: string;
} & {
asResponse?: AsResponse | undefined;
returnHeaders?: ReturnHeaders | undefined;
}): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? {
headers: Headers;
response: {
passkeys: {
id: string;
userId: string;
credentialId: string;
platform: string;
lastUsed: string;
status: "active" | "revoked";
aaguid: string | null;
createdAt: string;
updatedAt: string;
revokedAt: string | undefined;
revokedReason: string | undefined;
metadata: any;
}[];
nextOffset: number | undefined;
};
} : {
passkeys: {
id: string;
userId: string;
credentialId: string;
platform: string;
lastUsed: string;
status: "active" | "revoked";
aaguid: string | null;
createdAt: string;
updatedAt: string;
revokedAt: string | undefined;
revokedReason: string | undefined;
metadata: any;
}[];
nextOffset: number | undefined;
}>;
options: {
method: "GET";
params: import("zod").ZodObject<{
userId: import("zod").ZodString;
}, "strip", import("zod").ZodTypeAny, {
userId: string;
}, {
userId: string;
}>;
query: import("zod").ZodObject<{
limit: import("zod").ZodOptional<import("zod").ZodString>;
offset: import("zod").ZodOptional<import("zod").ZodString>;
}, "strip", import("zod").ZodTypeAny, {
limit?: string | undefined;
offset?: string | undefined;
}, {
limit?: string | undefined;
offset?: string | undefined;
}>;
use: ((inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
session: {
session: Record<string, any> & {
id: string;
token: string;
userId: string;
expiresAt: Date;
createdAt: Date;
updatedAt: Date;
ipAddress?: string | null | undefined;
userAgent?: string | null | undefined;
};
user: Record<string, any> & {
id: string;
name: string;
emailVerified: boolean;
email: string;
createdAt: Date;
updatedAt: Date;
image?: string | null | undefined;
};
};
}>)[];
metadata: {
openapi: {
description: string;
tags: string[];
responses: {
200: {
description: string;
content: {
"application/json": {
schema: {
type: "object";
properties: {
passkeys: {
type: string;
items: {
type: string;
properties: {
id: {
type: string;
};
userId: {
type: string;
};
credentialId: {
type: string;
};
platform: {
type: string;
};
lastUsed: {
type: string;
format: string;
};
status: {
type: string;
enum: string[];
};
aaguid: {
type: string;
nullable: boolean;
};
createdAt: {
type: string;
format: string;
};
updatedAt: {
type: string;
format: string;
};
revokedAt: {
type: string;
format: string;
nullable: boolean;
};
revokedReason: {
type: string;
nullable: boolean;
};
metadata: {
type: string;
additionalProperties: boolean;
};
};
};
};
nextOffset: {
type: string;
nullable: boolean;
};
};
};
};
};
};
401: {
description: string;
content: {
"application/json": {
schema: {
type: "object";
properties: {
error: {
type: string;
properties: {
code: {
type: string;
};
message: {
type: string;
};
};
};
};
};
};
};
};
};
};
};
} & {
use: any[];
};
path: "/expo-passkey/list/:userId";
};
//# sourceMappingURL=list.d.ts.map