@zestic/oauth-core
Version:
Framework-agnostic OAuth authentication library with support for multiple OAuth flows
75 lines • 2.32 kB
TypeScript
/**
* Example implementation showing how to use OAuth Core with GraphQL
*/
import type { ExtendedOAuthAdapters, MagicLinkConfig } from '../types/ServiceTypes';
/**
* Create example adapters
*/
export declare function createExampleAdapters(): ExtendedOAuthAdapters;
/**
* Create example magic link configuration
*/
export declare function createExampleMagicLinkConfig(): MagicLinkConfig;
/**
* Example GraphQL server setup (pseudo-code)
*/
export declare function createExampleGraphQLSetup(): {
typeDefs: string;
resolvers: {
Query: {
_empty: () => string;
};
Mutation: {
register: (_parent: unknown, { input }: {
input: import("../types/ServiceTypes").RegistrationInput;
}, context: import("./resolvers").GraphQLContext) => Promise<import("../types/ServiceTypes").RegistrationResponse>;
sendMagicLink: (_parent: unknown, { input }: {
input: import("../types/ServiceTypes").SendMagicLinkInput;
}, context: import("./resolvers").GraphQLContext) => Promise<import("../types/ServiceTypes").MagicLinkResponse>;
};
JSON: {
serialize: (value: unknown) => unknown;
parseValue: (value: unknown) => unknown;
parseLiteral: (ast: import("./resolvers").ASTNode) => unknown;
};
};
context: import("./resolvers").GraphQLContext;
};
/**
* Example GraphQL queries and mutations
*/
export declare const exampleQueries: {
register: string;
sendMagicLink: string;
};
/**
* Example variables for the mutations
*/
export declare const exampleVariables: {
register: {
input: {
email: string;
additionalData: {
firstName: string;
lastName: string;
preferences: {
newsletter: boolean;
};
};
codeChallenge: string;
codeChallengeMethod: string;
redirectUri: string;
state: string;
};
};
sendMagicLink: {
input: {
email: string;
codeChallenge: string;
codeChallengeMethod: string;
redirectUri: string;
state: string;
};
};
};
//# sourceMappingURL=example.d.ts.map