@atproto/oauth-client
Version:
OAuth client for ATPROTO PDS. This package serves as common base for environment-specific implementations (NodeJS, Browser, React-Native).
110 lines • 5.59 kB
TypeScript
import { z, TypeOf } from 'zod';
import { SpaceSeparatedValue } from './util';
export type AtprotoScope = SpaceSeparatedValue<'atproto'>;
export declare const isAtprotoScope: (input: string) => input is AtprotoScope;
export declare const atprotoScopeSchema: z.ZodEffects<z.ZodString, AtprotoScope, string>;
export declare const atprotoTokenResponseSchema: z.ZodObject<z.objectUtil.extendShape<{
access_token: z.ZodString;
token_type: z.ZodUnion<[z.ZodEffects<z.ZodString, "DPoP", string>, z.ZodEffects<z.ZodString, "Bearer", string>]>;
scope: z.ZodOptional<z.ZodString>;
refresh_token: z.ZodOptional<z.ZodString>;
expires_in: z.ZodOptional<z.ZodNumber>;
id_token: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, `${string}.${string}.${string}`, string>>;
authorization_details: z.ZodOptional<z.ZodArray<z.ZodObject<{
type: z.ZodString;
locations: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, `${string}:${string}`, string>, "many">>;
actions: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
datatypes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
identifier: z.ZodOptional<z.ZodString>;
privileges: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
}, "strip", z.ZodTypeAny, {
type: string;
locations?: `${string}:${string}`[] | undefined;
actions?: string[] | undefined;
datatypes?: string[] | undefined;
identifier?: string | undefined;
privileges?: string[] | undefined;
}, {
type: string;
locations?: string[] | undefined;
actions?: string[] | undefined;
datatypes?: string[] | undefined;
identifier?: string | undefined;
privileges?: string[] | undefined;
}>, "many">>;
}, {
token_type: z.ZodLiteral<"DPoP">;
sub: z.ZodEffects<z.ZodString, `did:plc:${string}` | `did:web:${string}`, string>;
scope: z.ZodEffects<z.ZodString, AtprotoScope, string>;
id_token: z.ZodOptional<z.ZodNever>;
}>, "passthrough", z.ZodTypeAny, z.objectOutputType<z.objectUtil.extendShape<{
access_token: z.ZodString;
token_type: z.ZodUnion<[z.ZodEffects<z.ZodString, "DPoP", string>, z.ZodEffects<z.ZodString, "Bearer", string>]>;
scope: z.ZodOptional<z.ZodString>;
refresh_token: z.ZodOptional<z.ZodString>;
expires_in: z.ZodOptional<z.ZodNumber>;
id_token: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, `${string}.${string}.${string}`, string>>;
authorization_details: z.ZodOptional<z.ZodArray<z.ZodObject<{
type: z.ZodString;
locations: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, `${string}:${string}`, string>, "many">>;
actions: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
datatypes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
identifier: z.ZodOptional<z.ZodString>;
privileges: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
}, "strip", z.ZodTypeAny, {
type: string;
locations?: `${string}:${string}`[] | undefined;
actions?: string[] | undefined;
datatypes?: string[] | undefined;
identifier?: string | undefined;
privileges?: string[] | undefined;
}, {
type: string;
locations?: string[] | undefined;
actions?: string[] | undefined;
datatypes?: string[] | undefined;
identifier?: string | undefined;
privileges?: string[] | undefined;
}>, "many">>;
}, {
token_type: z.ZodLiteral<"DPoP">;
sub: z.ZodEffects<z.ZodString, `did:plc:${string}` | `did:web:${string}`, string>;
scope: z.ZodEffects<z.ZodString, AtprotoScope, string>;
id_token: z.ZodOptional<z.ZodNever>;
}>, z.ZodTypeAny, "passthrough">, z.objectInputType<z.objectUtil.extendShape<{
access_token: z.ZodString;
token_type: z.ZodUnion<[z.ZodEffects<z.ZodString, "DPoP", string>, z.ZodEffects<z.ZodString, "Bearer", string>]>;
scope: z.ZodOptional<z.ZodString>;
refresh_token: z.ZodOptional<z.ZodString>;
expires_in: z.ZodOptional<z.ZodNumber>;
id_token: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, `${string}.${string}.${string}`, string>>;
authorization_details: z.ZodOptional<z.ZodArray<z.ZodObject<{
type: z.ZodString;
locations: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, `${string}:${string}`, string>, "many">>;
actions: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
datatypes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
identifier: z.ZodOptional<z.ZodString>;
privileges: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
}, "strip", z.ZodTypeAny, {
type: string;
locations?: `${string}:${string}`[] | undefined;
actions?: string[] | undefined;
datatypes?: string[] | undefined;
identifier?: string | undefined;
privileges?: string[] | undefined;
}, {
type: string;
locations?: string[] | undefined;
actions?: string[] | undefined;
datatypes?: string[] | undefined;
identifier?: string | undefined;
privileges?: string[] | undefined;
}>, "many">>;
}, {
token_type: z.ZodLiteral<"DPoP">;
sub: z.ZodEffects<z.ZodString, `did:plc:${string}` | `did:web:${string}`, string>;
scope: z.ZodEffects<z.ZodString, AtprotoScope, string>;
id_token: z.ZodOptional<z.ZodNever>;
}>, z.ZodTypeAny, "passthrough">>;
export type AtprotoTokenResponse = TypeOf<typeof atprotoTokenResponseSchema>;
//# sourceMappingURL=atproto-token-response.d.ts.map