import * as _sinclair_typebox from '@sinclair/typebox';

/**
 * @spfn/auth - Invitation API Contracts
 *
 * Type-safe API contracts for user invitation operations
 */
/**
 * GET /_auth/invitations/:token - Get invitation details (public)
 *
 * Retrieves invitation information for acceptance page
 */
declare const getInvitationContract: {
    readonly method: "GET";
    readonly path: "/_auth/invitations/:token";
    readonly params: _sinclair_typebox.TObject<{
        token: _sinclair_typebox.TString;
    }>;
    readonly response: _sinclair_typebox.TUnion<[_sinclair_typebox.TObject<{
        success: _sinclair_typebox.TLiteral<true>;
        data: _sinclair_typebox.TObject<{
            email: _sinclair_typebox.TString;
            role: _sinclair_typebox.TString;
            roleDisplayName: _sinclair_typebox.TString;
            invitedBy: _sinclair_typebox.TString;
            expiresAt: _sinclair_typebox.TString;
            metadata: _sinclair_typebox.TOptional<_sinclair_typebox.TAny>;
        }>;
        message: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
    }>, _sinclair_typebox.TObject<{
        success: _sinclair_typebox.TLiteral<false>;
        error: _sinclair_typebox.TObject<{
            code: _sinclair_typebox.TString;
            message: _sinclair_typebox.TString;
            details: _sinclair_typebox.TOptional<_sinclair_typebox.TAny>;
        }>;
    }>]>;
};
/**
 * POST /_auth/invitations/accept - Accept invitation (public)
 *
 * Accepts invitation and creates user account with provided credentials
 */
declare const acceptInvitationContract: {
    readonly method: "POST";
    readonly path: "/_auth/invitations/accept";
    readonly body: _sinclair_typebox.TObject<{
        token: _sinclair_typebox.TString;
        password: _sinclair_typebox.TString;
        publicKey: _sinclair_typebox.TString;
        keyId: _sinclair_typebox.TString;
        fingerprint: _sinclair_typebox.TString;
        algorithm: _sinclair_typebox.TUnion<[_sinclair_typebox.TLiteral<"ES256">, _sinclair_typebox.TLiteral<"RS256">]>;
    }>;
    readonly response: _sinclair_typebox.TUnion<[_sinclair_typebox.TObject<{
        success: _sinclair_typebox.TLiteral<true>;
        data: _sinclair_typebox.TObject<{
            userId: _sinclair_typebox.TNumber;
            email: _sinclair_typebox.TString;
            role: _sinclair_typebox.TString;
        }>;
        message: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
    }>, _sinclair_typebox.TObject<{
        success: _sinclair_typebox.TLiteral<false>;
        error: _sinclair_typebox.TObject<{
            code: _sinclair_typebox.TString;
            message: _sinclair_typebox.TString;
            details: _sinclair_typebox.TOptional<_sinclair_typebox.TAny>;
        }>;
    }>]>;
};
/**
 * POST /_auth/invitations - Create new invitation (admin)
 *
 * Creates and sends invitation to new user
 * Requires: admin role or user:invite permission
 */
declare const createInvitationContract: {
    readonly method: "POST";
    readonly path: "/_auth/invitations";
    readonly body: _sinclair_typebox.TObject<{
        email: _sinclair_typebox.TString;
        roleId: _sinclair_typebox.TNumber;
        expiresInDays: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
        metadata: _sinclair_typebox.TOptional<_sinclair_typebox.TAny>;
    }>;
    readonly response: _sinclair_typebox.TUnion<[_sinclair_typebox.TObject<{
        success: _sinclair_typebox.TLiteral<true>;
        data: _sinclair_typebox.TObject<{
            id: _sinclair_typebox.TNumber;
            email: _sinclair_typebox.TString;
            token: _sinclair_typebox.TString;
            roleId: _sinclair_typebox.TNumber;
            expiresAt: _sinclair_typebox.TString;
            invitationUrl: _sinclair_typebox.TString;
        }>;
        message: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
    }>, _sinclair_typebox.TObject<{
        success: _sinclair_typebox.TLiteral<false>;
        error: _sinclair_typebox.TObject<{
            code: _sinclair_typebox.TString;
            message: _sinclair_typebox.TString;
            details: _sinclair_typebox.TOptional<_sinclair_typebox.TAny>;
        }>;
    }>]>;
};
/**
 * GET /_auth/invitations - List invitations (admin)
 *
 * Retrieves paginated list of invitations with filtering
 * Requires: admin role
 */
declare const listInvitationsContract: {
    readonly method: "GET";
    readonly path: "/_auth/invitations";
    readonly query: _sinclair_typebox.TObject<{
        status: _sinclair_typebox.TOptional<_sinclair_typebox.TUnion<[_sinclair_typebox.TLiteral<"pending">, _sinclair_typebox.TLiteral<"accepted">, _sinclair_typebox.TLiteral<"expired">, _sinclair_typebox.TLiteral<"cancelled">]>>;
        page: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
        limit: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
    }>;
    readonly response: _sinclair_typebox.TUnion<[_sinclair_typebox.TObject<{
        success: _sinclair_typebox.TLiteral<true>;
        data: _sinclair_typebox.TObject<{
            invitations: _sinclair_typebox.TArray<_sinclair_typebox.TObject<{
                id: _sinclair_typebox.TNumber;
                email: _sinclair_typebox.TString;
                status: _sinclair_typebox.TString;
                role: _sinclair_typebox.TObject<{
                    id: _sinclair_typebox.TNumber;
                    name: _sinclair_typebox.TString;
                    displayName: _sinclair_typebox.TString;
                }>;
                inviter: _sinclair_typebox.TObject<{
                    id: _sinclair_typebox.TNumber;
                    email: _sinclair_typebox.TString;
                }>;
                createdAt: _sinclair_typebox.TString;
                expiresAt: _sinclair_typebox.TString;
                acceptedAt: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
                cancelledAt: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
            }>>;
            total: _sinclair_typebox.TNumber;
            page: _sinclair_typebox.TNumber;
            limit: _sinclair_typebox.TNumber;
            totalPages: _sinclair_typebox.TNumber;
        }>;
        message: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
    }>, _sinclair_typebox.TObject<{
        success: _sinclair_typebox.TLiteral<false>;
        error: _sinclair_typebox.TObject<{
            code: _sinclair_typebox.TString;
            message: _sinclair_typebox.TString;
            details: _sinclair_typebox.TOptional<_sinclair_typebox.TAny>;
        }>;
    }>]>;
};
/**
 * POST /_auth/invitations/cancel - Cancel invitation (admin)
 *
 * Cancels pending invitation
 * Requires: admin role or invitation owner
 */
declare const cancelInvitationContract: {
    readonly method: "POST";
    readonly path: "/_auth/invitations/cancel";
    readonly body: _sinclair_typebox.TObject<{
        id: _sinclair_typebox.TNumber;
        reason: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
    }>;
    readonly response: _sinclair_typebox.TUnion<[_sinclair_typebox.TObject<{
        success: _sinclair_typebox.TLiteral<true>;
        data: _sinclair_typebox.TObject<{
            success: _sinclair_typebox.TBoolean;
            cancelledAt: _sinclair_typebox.TString;
        }>;
        message: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
    }>, _sinclair_typebox.TObject<{
        success: _sinclair_typebox.TLiteral<false>;
        error: _sinclair_typebox.TObject<{
            code: _sinclair_typebox.TString;
            message: _sinclair_typebox.TString;
            details: _sinclair_typebox.TOptional<_sinclair_typebox.TAny>;
        }>;
    }>]>;
};
/**
 * POST /_auth/invitations/resend - Resend invitation (admin)
 *
 * Resends invitation email and extends expiration
 * Requires: admin role
 */
declare const resendInvitationContract: {
    readonly method: "POST";
    readonly path: "/_auth/invitations/resend";
    readonly body: _sinclair_typebox.TObject<{
        id: _sinclair_typebox.TNumber;
        expiresInDays: _sinclair_typebox.TOptional<_sinclair_typebox.TNumber>;
    }>;
    readonly response: _sinclair_typebox.TUnion<[_sinclair_typebox.TObject<{
        success: _sinclair_typebox.TLiteral<true>;
        data: _sinclair_typebox.TObject<{
            success: _sinclair_typebox.TBoolean;
            expiresAt: _sinclair_typebox.TString;
        }>;
        message: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
    }>, _sinclair_typebox.TObject<{
        success: _sinclair_typebox.TLiteral<false>;
        error: _sinclair_typebox.TObject<{
            code: _sinclair_typebox.TString;
            message: _sinclair_typebox.TString;
            details: _sinclair_typebox.TOptional<_sinclair_typebox.TAny>;
        }>;
    }>]>;
};
/**
 * DELETE /_auth/invitations/delete - Delete invitation (superadmin)
 *
 * Permanently deletes invitation record
 * Requires: superadmin role
 */
declare const deleteInvitationContract: {
    readonly method: "POST";
    readonly path: "/_auth/invitations/delete";
    readonly body: _sinclair_typebox.TObject<{
        id: _sinclair_typebox.TNumber;
    }>;
    readonly response: _sinclair_typebox.TUnion<[_sinclair_typebox.TObject<{
        success: _sinclair_typebox.TLiteral<true>;
        data: _sinclair_typebox.TObject<{
            success: _sinclair_typebox.TBoolean;
        }>;
        message: _sinclair_typebox.TOptional<_sinclair_typebox.TString>;
    }>, _sinclair_typebox.TObject<{
        success: _sinclair_typebox.TLiteral<false>;
        error: _sinclair_typebox.TObject<{
            code: _sinclair_typebox.TString;
            message: _sinclair_typebox.TString;
            details: _sinclair_typebox.TOptional<_sinclair_typebox.TAny>;
        }>;
    }>]>;
};

export { acceptInvitationContract, cancelInvitationContract, createInvitationContract, deleteInvitationContract, getInvitationContract, listInvitationsContract, resendInvitationContract };
