import { Injectable } from '@nestjs/common';
export interface RateLimitResult {
allowed: boolean;
remaining: number;
limit: number;
package com.example.ratelimit;
public class TokenBucket {
private final long capacity;
private final long refillTokens;
import { Exclude, Expose } from 'class-transformer';
export class User {
id: string;
firstName: string;
import { AxiosError } from 'axios';
export const RETRY_CONFIG = {
maxRetries: 4,
baseDelayMs: 200,
maxDelayMs: 5_000,
@Entity
@Table(name = "invoices")
@FilterDef(
name = "tenantFilter",
parameters = @ParamDef(name = "tenantId", type = String.class)
)