oauth-store.ts
This file
Path
apps/platform/src/auth/oauth-store.ts
37 lines · 996 bytes · TypeScript
Last changed by
Merge build/comments-platform into mainoscabrielbefore adoptionddf09e8
History of this fileTake it
1234567891011121314151617181920212223242526272829303132333435363738// Only the calls the provider makes, so a `KVNamespace` is one as it is.import { Context } from "effect";import type { Schema } from "effect";
export interface OAuthStoreList { readonly cursor?: string; readonly keys: readonly { readonly metadata?: unknown; readonly name: string; }[]; readonly list_complete: boolean;}
export class OAuthStore extends Context.Service< OAuthStore, { readonly delete: (key: string) => Promise<void>; readonly get: ( key: string, options?: { readonly type: "json" } ) => Promise<Schema.Json>; readonly list: (options?: { readonly cursor?: string; readonly limit?: number; readonly prefix?: string; }) => Promise<OAuthStoreList>; readonly put: ( key: string, value: string, options?: { readonly expiration?: number; readonly expirationTtl?: number; readonly metadata?: unknown; } ) => Promise<void>; }>()("platform/OAuthStore") {}