@prismshadow/penguin-library-model · library/model/src/model.ts:614

ModelOAuth

interface

ModelOAuth: the mechanism ModelOAuthService implements.

API

@Interface()
export abstract class ModelOAuth {
  abstract start(input: {
      projectId: string;
      userId: string;
      provider: string;
      mode: ModelOAuthMode;
      callbackOrigin: string;
    }): ModelOAuthStartResult;
  abstract deposit(input: { flowId: string; projectId: string; code: string }): void;
  abstract poll(input: { flowId: string; userId: string; projectId: string }): Promise<{
      status: ModelOAuthStatus;
      provider: string;
      error?: ModelOAuthErrorCode;
      applied?: number;
      defaultOffer?: DefaultModelOffer;
    }>;
  abstract complete(input: {
      flowId: string;
      userId: string;
      projectId: string;
      code: string;
    }): Promise<({ ok: true } & GroupKeyApplied) | { ok: false; error: ModelOAuthErrorCode }>;
}

Contract Topology

Static AST wiring across @Module / @Provide / @Use
@Moduleexported by
@Provideprovided by
@Useconsumed by (1)

Members (4)

start

start(input: { projectId: string; userId: string; provider: string; mode: ModelOAuthMode; callbackOrigin: string; }): ModelOAuthStartResult
@paraminput{ projectId: string; userId: string; provider: string; mode: ModelOAuthMode; callbackOrigin: string; }
@returnsModelOAuthStartResult

deposit

deposit(input: { flowId: string; projectId: string; code: string }): void
@paraminput{ flowId: string; projectId: string; code: string }
@returnsvoid

poll

poll(input: { flowId: string; userId: string; projectId: string }): Promise<{ status: ModelOAuthStatus; provider: string; error?: ModelOAuthErrorCode; applied?: number; defaultOffer?: DefaultModelOffer; }>
@paraminput{ flowId: string; userId: string; projectId: string }
@returnsPromise<{ status: ModelOAuthStatus; provider: string; error?: ModelOAuthErrorCode; applied?: number; defaultOffer?: DefaultModelOffer; }>

complete

complete(input: { flowId: string; userId: string; projectId: string; code: string; }): Promise<({ ok: true } & GroupKeyApplied) | { ok: false; error: ModelOAuthErrorCode }>
@paraminput{ flowId: string; userId: string; projectId: string; code: string; }
@returnsPromise<({ ok: true } & GroupKeyApplied) | { ok: false; error: ModelOAuthErrorCode }>