Skip to content

Commit dc3f4e8

Browse files
committed
chore: Regenerate the protobuf bindings
1 parent b8b346f commit dc3f4e8

File tree

2 files changed

+109
-10
lines changed

2 files changed

+109
-10
lines changed

protocol/gen/es/decide/v1alpha1/decide_pb.d.ts

+87-7
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,31 @@ export declare enum SDKStack {
286286
SDK_STACK_DJANGO = 4,
287287
}
288288

289+
/**
290+
* @generated from enum proto.decide.v1alpha1.RateLimitAlgorithm
291+
*/
292+
export declare enum RateLimitAlgorithm {
293+
/**
294+
* @generated from enum value: RATE_LIMIT_ALGORITHM_UNSPECIFIED = 0;
295+
*/
296+
UNSPECIFIED = 0,
297+
298+
/**
299+
* @generated from enum value: RATE_LIMIT_ALGORITHM_TOKEN_BUCKET = 1;
300+
*/
301+
TOKEN_BUCKET = 1,
302+
303+
/**
304+
* @generated from enum value: RATE_LIMIT_ALGORITHM_FIXED_WINDOW = 2;
305+
*/
306+
FIXED_WINDOW = 2,
307+
308+
/**
309+
* @generated from enum value: RATE_LIMIT_ALGORITHM_SLIDING_WINDOW = 3;
310+
*/
311+
SLIDING_WINDOW = 3,
312+
}
313+
289314
/**
290315
* The reason for the decision. This is populated based on the selected rules
291316
* for deny or challenge responses. Additional details can be found in the
@@ -376,21 +401,23 @@ export declare class RateLimitReason extends Message<RateLimitReason> {
376401
/**
377402
* The configured maximum number of requests allowed in the current window.
378403
*
379-
* @generated from field: int32 max = 1;
404+
* @generated from field: uint32 max = 1;
380405
*/
381406
max: number;
382407

383408
/**
384-
* The number of requests which have been made in the current window.
409+
* Deprecated: Always empty. Previously, the number of requests which have
410+
* been made in the current window.
385411
*
386-
* @generated from field: int32 count = 2;
412+
* @generated from field: int32 count = 2 [deprecated = true];
413+
* @deprecated
387414
*/
388415
count: number;
389416

390417
/**
391418
* The number of requests remaining in the current window.
392419
*
393-
* @generated from field: int32 remaining = 3;
420+
* @generated from field: uint32 remaining = 3;
394421
*/
395422
remaining: number;
396423

@@ -653,10 +680,12 @@ export declare class RateLimitRule extends Message<RateLimitRule> {
653680
window: string;
654681

655682
/**
656-
* The maximum number of requests allowed in the time period. This is an
657-
* integer value e.g. 100.
683+
* The maximum number of requests allowed in the time period. This is a
684+
* positive integer value e.g. 100.
685+
*
686+
* Required by "fixed window", "sliding window", and unspecified algorithms.
658687
*
659-
* @generated from field: int32 max = 5;
688+
* @generated from field: uint32 max = 5;
660689
*/
661690
max: number;
662691

@@ -673,6 +702,42 @@ export declare class RateLimitRule extends Message<RateLimitRule> {
673702
*/
674703
timeout: string;
675704

705+
/**
706+
* The algorithm to use for rate limiting a request. If unspecified, we will
707+
* fallback to the "fixed window" algorithm. The chosen algorithm will
708+
* affect which other fields must be specified to be a valid configuration.
709+
*
710+
* @generated from field: proto.decide.v1alpha1.RateLimitAlgorithm algorithm = 7;
711+
*/
712+
algorithm: RateLimitAlgorithm;
713+
714+
/**
715+
* The amount of tokens that are refilled at the provided interval.
716+
*
717+
* Required by "token bucket" algorithm.
718+
*
719+
* @generated from field: uint32 refill_rate = 8;
720+
*/
721+
refillRate: number;
722+
723+
/**
724+
* The interval in which a rate limit is applied or tokens refilled.
725+
*
726+
* Required by "token bucket" and "sliding window" algorithms.
727+
*
728+
* @generated from field: uint32 interval = 9;
729+
*/
730+
interval: number;
731+
732+
/**
733+
* The maximum number of tokens that can exist in a token bucket.
734+
*
735+
* Required by "token bucket" algorithm.
736+
*
737+
* @generated from field: uint32 capacity = 10;
738+
*/
739+
capacity: number;
740+
676741
constructor(data?: PartialMessage<RateLimitRule>);
677742

678743
static readonly runtime: typeof proto3;
@@ -954,6 +1019,21 @@ export declare class RequestDetails extends Message<RequestDetails> {
9541019
*/
9551020
email: string;
9561021

1022+
/**
1023+
* The string representing semicolon-separated Cookies for a request.
1024+
*
1025+
* @generated from field: string cookies = 10;
1026+
*/
1027+
cookies: string;
1028+
1029+
/**
1030+
* The `?`-prefixed string representing the Query for a request. Commonly
1031+
* referred to as a "querystring".
1032+
*
1033+
* @generated from field: string query = 11;
1034+
*/
1035+
query: string;
1036+
9571037
constructor(data?: PartialMessage<RequestDetails>);
9581038

9591039
static readonly runtime: typeof proto3;

protocol/gen/es/decide/v1alpha1/decide_pb.js

+22-3
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,19 @@ export const SDKStack = proto3.makeEnum(
105105
],
106106
);
107107

108+
/**
109+
* @generated from enum proto.decide.v1alpha1.RateLimitAlgorithm
110+
*/
111+
export const RateLimitAlgorithm = proto3.makeEnum(
112+
"proto.decide.v1alpha1.RateLimitAlgorithm",
113+
[
114+
{no: 0, name: "RATE_LIMIT_ALGORITHM_UNSPECIFIED", localName: "UNSPECIFIED"},
115+
{no: 1, name: "RATE_LIMIT_ALGORITHM_TOKEN_BUCKET", localName: "TOKEN_BUCKET"},
116+
{no: 2, name: "RATE_LIMIT_ALGORITHM_FIXED_WINDOW", localName: "FIXED_WINDOW"},
117+
{no: 3, name: "RATE_LIMIT_ALGORITHM_SLIDING_WINDOW", localName: "SLIDING_WINDOW"},
118+
],
119+
);
120+
108121
/**
109122
* The reason for the decision. This is populated based on the selected rules
110123
* for deny or challenge responses. Additional details can be found in the
@@ -133,9 +146,9 @@ export const Reason = proto3.makeMessageType(
133146
export const RateLimitReason = proto3.makeMessageType(
134147
"proto.decide.v1alpha1.RateLimitReason",
135148
() => [
136-
{ no: 1, name: "max", kind: "scalar", T: 5 /* ScalarType.INT32 */ },
149+
{ no: 1, name: "max", kind: "scalar", T: 13 /* ScalarType.UINT32 */ },
137150
{ no: 2, name: "count", kind: "scalar", T: 5 /* ScalarType.INT32 */ },
138-
{ no: 3, name: "remaining", kind: "scalar", T: 5 /* ScalarType.INT32 */ },
151+
{ no: 3, name: "remaining", kind: "scalar", T: 13 /* ScalarType.UINT32 */ },
139152
{ no: 4, name: "reset_time", kind: "message", T: Timestamp },
140153
],
141154
);
@@ -218,8 +231,12 @@ export const RateLimitRule = proto3.makeMessageType(
218231
{ no: 2, name: "match", kind: "scalar", T: 9 /* ScalarType.STRING */ },
219232
{ no: 3, name: "characteristics", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true },
220233
{ no: 4, name: "window", kind: "scalar", T: 9 /* ScalarType.STRING */ },
221-
{ no: 5, name: "max", kind: "scalar", T: 5 /* ScalarType.INT32 */ },
234+
{ no: 5, name: "max", kind: "scalar", T: 13 /* ScalarType.UINT32 */ },
222235
{ no: 6, name: "timeout", kind: "scalar", T: 9 /* ScalarType.STRING */ },
236+
{ no: 7, name: "algorithm", kind: "enum", T: proto3.getEnumType(RateLimitAlgorithm) },
237+
{ no: 8, name: "refill_rate", kind: "scalar", T: 13 /* ScalarType.UINT32 */ },
238+
{ no: 9, name: "interval", kind: "scalar", T: 13 /* ScalarType.UINT32 */ },
239+
{ no: 10, name: "capacity", kind: "scalar", T: 13 /* ScalarType.UINT32 */ },
223240
],
224241
);
225242

@@ -309,6 +326,8 @@ export const RequestDetails = proto3.makeMessageType(
309326
{ no: 7, name: "body", kind: "scalar", T: 12 /* ScalarType.BYTES */ },
310327
{ no: 8, name: "extra", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "scalar", T: 9 /* ScalarType.STRING */} },
311328
{ no: 9, name: "email", kind: "scalar", T: 9 /* ScalarType.STRING */ },
329+
{ no: 10, name: "cookies", kind: "scalar", T: 9 /* ScalarType.STRING */ },
330+
{ no: 11, name: "query", kind: "scalar", T: 9 /* ScalarType.STRING */ },
312331
],
313332
);
314333

0 commit comments

Comments
 (0)