toilscript 0.1.23 → 0.1.24

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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "imports": {
3
- "toilscript": "https://cdn.jsdelivr.net/npm/toilscript@0.1.23/dist/toilscript.js",
4
- "toilscript/cli": "https://cdn.jsdelivr.net/npm/toilscript@0.1.23/dist/cli.js",
3
+ "toilscript": "https://cdn.jsdelivr.net/npm/toilscript@0.1.24/dist/toilscript.js",
4
+ "toilscript/cli": "https://cdn.jsdelivr.net/npm/toilscript@0.1.24/dist/cli.js",
5
5
  "binaryen": "https://cdn.jsdelivr.net/npm/binaryen@129.0.0-nightly.20260428/index.js",
6
6
  "long": "https://cdn.jsdelivr.net/npm/long@5.3.2/index.js"
7
7
  }
package/dist/web.js CHANGED
@@ -1,8 +1,8 @@
1
- var ASSEMBLYSCRIPT_VERSION = "0.1.23";
1
+ var ASSEMBLYSCRIPT_VERSION = "0.1.24";
2
2
  var ASSEMBLYSCRIPT_IMPORTMAP = {
3
3
  "imports": {
4
- "toilscript": "https://cdn.jsdelivr.net/npm/toilscript@0.1.23/dist/toilscript.js",
5
- "toilscript/cli": "https://cdn.jsdelivr.net/npm/toilscript@0.1.23/dist/cli.js",
4
+ "toilscript": "https://cdn.jsdelivr.net/npm/toilscript@0.1.24/dist/toilscript.js",
5
+ "toilscript/cli": "https://cdn.jsdelivr.net/npm/toilscript@0.1.24/dist/cli.js",
6
6
  "binaryen": "https://cdn.jsdelivr.net/npm/binaryen@129.0.0-nightly.20260428/index.js",
7
7
  "long": "https://cdn.jsdelivr.net/npm/long@5.3.2/index.js"
8
8
  }
package/package.json CHANGED
@@ -8,7 +8,7 @@
8
8
  "toilscript",
9
9
  "wasm"
10
10
  ],
11
- "version": "0.1.23",
11
+ "version": "0.1.24",
12
12
  "author": "Daniel Wirtz <dcode+assemblyscript@dcode.io>",
13
13
  "license": "Apache-2.0",
14
14
  "homepage": "https://github.com/dacely-cloud/toilscript",
@@ -67,6 +67,21 @@ declare function patch(path: string): ToilRouteDecorator;
67
67
  declare function head(path: string): ToilRouteDecorator;
68
68
  declare function options(path: string): ToilRouteDecorator;
69
69
 
70
+ // --- route response/security decorators, handled natively by the compiler ---
71
+
72
+ /** Cache a route's response: `@cache(edgeMinutes, browserSeconds?, privateScope?, allowAuth?)`. */
73
+ declare function cache(edgeMinutes: i32, browserSeconds?: i32, privateScope?: bool, allowAuth?: bool): ToilRouteDecorator;
74
+
75
+ /** Rate-limit a route: `@ratelimit(strategy, limit, window)` (strategy = a `RateLimit` member). */
76
+ declare function ratelimit(strategy: i32, limit: i32, window: i32): ToilRouteDecorator;
77
+
78
+ /** Require a valid session for a `@rest` class or route method (`@auth`). 401 otherwise. */
79
+ declare function auth(target: Function): void;
80
+ declare function auth(target: Object, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor<any>): void;
81
+
82
+ /** Declare the authenticated-user type (`@user class User { ... }`); enables `AuthService.getUser()`. */
83
+ declare function user(target: Function): void;
84
+
70
85
  // Big integers, native globals implemented in std/assembly/bignum. The
71
86
  // arithmetic/bitwise/comparison operators
72
87
  // (+ - * / % & | ^ << >> == != < > <= >=) are operator overloads resolved by