Skip to content

Commit b8b346f

Browse files
committed
chore!: Remove timeout property on ArcjetRateLimitRule
1 parent 6753117 commit b8b346f

File tree

10 files changed

+0
-26
lines changed

10 files changed

+0
-26
lines changed

arcjet/index.ts

-2
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,6 @@ export type RateLimitOptions = {
377377
characteristics?: string[];
378378
window: string;
379379
max: number;
380-
timeout: string;
381380
};
382381

383382
/**
@@ -539,7 +538,6 @@ export function rateLimit(
539538
characteristics: opt.characteristics,
540539
window: opt.window,
541540
max: opt.max,
542-
timeout: opt.timeout,
543541
});
544542
}
545543

arcjet/test/index.node.test.ts

-16
Original file line numberDiff line numberDiff line change
@@ -1907,7 +1907,6 @@ describe("Primitive > rateLimit", () => {
19071907
characteristics: ["ip.src"],
19081908
window: "1h",
19091909
max: 1,
1910-
timeout: "10m",
19111910
});
19121911
expect(rule.type).toEqual("RATE_LIMIT");
19131912
expect(rule).toHaveProperty("mode", "DRY_RUN");
@@ -1919,7 +1918,6 @@ describe("Primitive > rateLimit", () => {
19191918
characteristics: ["ip.src"],
19201919
window: "1h",
19211920
max: 1,
1922-
timeout: "10m",
19231921
};
19241922

19251923
const rules = rateLimit(options);
@@ -1930,7 +1928,6 @@ describe("Primitive > rateLimit", () => {
19301928
expect(rules[0]).toHaveProperty("characteristics", ["ip.src"]);
19311929
expect(rules[0]).toHaveProperty("window", "1h");
19321930
expect(rules[0]).toHaveProperty("max", 1);
1933-
expect(rules[0]).toHaveProperty("timeout", "10m");
19341931
});
19351932

19361933
test("produces a multiple rules based on multiple `limit` specified", async () => {
@@ -1940,14 +1937,12 @@ describe("Primitive > rateLimit", () => {
19401937
characteristics: ["ip.src"],
19411938
window: "1h",
19421939
max: 1,
1943-
timeout: "10m",
19441940
},
19451941
{
19461942
match: "/test-double",
19471943
characteristics: ["ip.src"],
19481944
window: "2h",
19491945
max: 2,
1950-
timeout: "20m",
19511946
},
19521947
];
19531948

@@ -1961,7 +1956,6 @@ describe("Primitive > rateLimit", () => {
19611956
characteristics: ["ip.src"],
19621957
window: "1h",
19631958
max: 1,
1964-
timeout: "10m",
19651959
}),
19661960
expect.objectContaining({
19671961
type: "RATE_LIMIT",
@@ -1970,7 +1964,6 @@ describe("Primitive > rateLimit", () => {
19701964
characteristics: ["ip.src"],
19711965
window: "2h",
19721966
max: 2,
1973-
timeout: "20m",
19741967
}),
19751968
]);
19761969
});
@@ -1979,7 +1972,6 @@ describe("Primitive > rateLimit", () => {
19791972
const options = {
19801973
window: "1h",
19811974
max: 1,
1982-
timeout: "10m",
19831975
};
19841976

19851977
const [rule] = rateLimit(options);
@@ -1993,12 +1985,10 @@ describe("Primitive > rateLimit", () => {
19931985
{
19941986
window: "1h",
19951987
max: 1,
1996-
timeout: "10m",
19971988
},
19981989
{
19991990
window: "2h",
20001991
max: 2,
2001-
timeout: "20m",
20021992
},
20031993
];
20041994

@@ -2011,7 +2001,6 @@ describe("Primitive > rateLimit", () => {
20112001
characteristics: undefined,
20122002
window: "1h",
20132003
max: 1,
2014-
timeout: "10m",
20152004
}),
20162005
expect.objectContaining({
20172006
type: "RATE_LIMIT",
@@ -2020,7 +2009,6 @@ describe("Primitive > rateLimit", () => {
20202009
characteristics: undefined,
20212010
window: "2h",
20222011
max: 2,
2023-
timeout: "20m",
20242012
}),
20252013
]);
20262014
});
@@ -2360,7 +2348,6 @@ describe("Products > protectSignup", () => {
23602348
characteristics: ["ip.src"],
23612349
window: "1h",
23622350
max: 1,
2363-
timeout: "10m",
23642351
},
23652352
bots: {
23662353
mode: ArcjetMode.DRY_RUN,
@@ -2381,14 +2368,12 @@ describe("Products > protectSignup", () => {
23812368
characteristics: ["ip.src"],
23822369
window: "1h",
23832370
max: 1,
2384-
timeout: "10m",
23852371
},
23862372
{
23872373
match: "/test",
23882374
characteristics: ["ip.src"],
23892375
window: "2h",
23902376
max: 2,
2391-
timeout: "20m",
23922377
},
23932378
],
23942379
});
@@ -3440,7 +3425,6 @@ describe("Arcjet: Env = Serverless Node runtime on Vercel", () => {
34403425
characteristics: ["ip.src"],
34413426
window: "1h",
34423427
max: 1,
3443-
timeout: "10m",
34443428
};
34453429
const fingerprint =
34463430
"fp_1_ac8547705f1f45c5050f1424700dfa3f6f2f681b550ca4f3c19571585aea7a2c";

examples/nextjs-13-pages-wrap/pages/api/arcjet-edge.ts

-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ const aj = arcjet({
1818
//characteristics: ["ip.src"],
1919
window: "1m",
2020
max: 1,
21-
timeout: "10m",
2221
}),
2322
],
2423
});

examples/nextjs-13-pages-wrap/pages/api/arcjet.ts

-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ const aj = arcjet({
1414
//characteristics: ["ip.src"],
1515
window: "1m",
1616
max: 1,
17-
timeout: "10m",
1817
}),
1918
],
2019
});

examples/nextjs-14-app-dir-rl/app/api/arcjet/route.ts

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ const aj = arcjet({
1212
characteristics: ["ip.src"],
1313
window: "1h",
1414
max: 1,
15-
timeout: "10m",
1615
}),
1716
],
1817
});

examples/nextjs-14-openai/app/api/chat/route.ts

-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ const aj = arcjet({
1616
characteristics: ["ip.src"],
1717
window: "1m",
1818
max: 60,
19-
timeout: "10m",
2019
}),
2120
],
2221
});

examples/nextjs-14-pages-wrap/pages/api/arcjet-edge.ts

-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ const aj = arcjet({
1818
//characteristics: ["ip.src"],
1919
window: "1m",
2020
max: 1,
21-
timeout: "10m",
2221
}),
2322
],
2423
});

examples/nextjs-14-pages-wrap/pages/api/arcjet.ts

-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ const aj = arcjet({
1414
//characteristics: ["ip.src"],
1515
window: "1m",
1616
max: 1,
17-
timeout: "10m",
1817
}),
1918
],
2019
});

protocol/convert.ts

-1
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,6 @@ export function ArcjetRuleToProtocol<Props extends { [key: string]: unknown }>(
487487
characteristics: rule.characteristics,
488488
window: rule.window,
489489
max: rule.max,
490-
timeout: rule.timeout,
491490
},
492491
},
493492
});

protocol/index.ts

-1
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,6 @@ export interface ArcjetRateLimitRule<Props extends {}>
404404
characteristics?: string[];
405405
window: string;
406406
max: number;
407-
timeout: string;
408407
}
409408

410409
export interface ArcjetEmailRule<Props extends { email: string }>

0 commit comments

Comments
 (0)