@cfxlabsinc/b2b-services
    Preparing search index...

    Type Alias CognitoInviteeServices<TUser>

    What admitting a Cognito invitee needs of a dashboard's user, invite and membership services.

    type CognitoInviteeServices<TUser extends { id: string }> = {
        acceptInvites(
            input: { email: string; userId: TUser["id"] },
        ): Promise<void>;
        createUser(
            input: {
                identity: Pick<
                    CognitoIdentity,
                    "sub"
                    | "email"
                    | "givenName"
                    | "familyName",
                >;
                timeZone: string | undefined;
            },
        ): Promise<TUser>;
        hasPendingInvite(email: string): Promise<boolean>;
        hasUserWithEmail(email: string, sub: string): Promise<boolean>;
    }

    Type Parameters

    • TUser extends { id: string }
    Index
    • The login's row, created for it; returns the existing one on a race. timeZone is the browser's, unvalidated: stored when it is a valid zone.

      Parameters

      • input: {
            identity: Pick<
                CognitoIdentity,
                "sub"
                | "email"
                | "givenName"
                | "familyName",
            >;
            timeZone: string | undefined;
        }

      Returns Promise<TUser>

    • Whether a dashboard user row holds the address, unlinked or linked to a login other than sub.

      Parameters

      • email: string
      • sub: string

      Returns Promise<boolean>