toilscript 0.1.26 → 0.1.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.generated.d.ts +46 -2
- package/dist/cli.js +528 -31
- package/dist/cli.js.map +2 -2
- package/dist/importmap.json +2 -2
- package/dist/toilscript.generated.d.ts +46 -2
- package/dist/toilscript.js +179 -177
- package/dist/toilscript.js.map +4 -4
- package/dist/web.js +3 -3
- package/package.json +1 -1
- package/std/assembly/bindings/toildb.ts +169 -0
- package/std/assembly/crypto/subtle.ts +16 -20
- package/std/assembly/crypto.ts +22 -6
- package/std/assembly/index.d.ts +9 -4
- package/std/assembly/toildb.ts +311 -0
- package/std/assembly/toilscript.d.ts +5 -2
|
@@ -72,8 +72,11 @@ declare function options(path: string): ToilRouteDecorator;
|
|
|
72
72
|
/** Cache a route's response: `@cache(edgeMinutes, browserSeconds?, privateScope?, allowAuth?)`. */
|
|
73
73
|
declare function cache(edgeMinutes: i32, browserSeconds?: i32, privateScope?: bool, allowAuth?: bool): ToilRouteDecorator;
|
|
74
74
|
|
|
75
|
-
/** Rate-
|
|
76
|
-
declare
|
|
75
|
+
/** Rate-limiting strategy for `@ratelimit`. Values match the runtime `RateLimit` enum. */
|
|
76
|
+
declare enum RateLimit { FixedWindow, SlidingWindow, TokenBucket }
|
|
77
|
+
|
|
78
|
+
/** Rate-limit a route: `@ratelimit(strategy, limit, window)`. */
|
|
79
|
+
declare function ratelimit(strategy: RateLimit, limit: i32, window: i32): ToilRouteDecorator;
|
|
77
80
|
|
|
78
81
|
/** Require a valid session for a `@rest` class or route method (`@auth`). 401 otherwise. */
|
|
79
82
|
declare function auth(target: Function): void;
|