toilscript 0.1.51 → 0.1.53

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.51/dist/toilscript.js",
4
- "toilscript/cli": "https://cdn.jsdelivr.net/npm/toilscript@0.1.51/dist/cli.js",
3
+ "toilscript": "https://cdn.jsdelivr.net/npm/toilscript@0.1.53/dist/toilscript.js",
4
+ "toilscript/cli": "https://cdn.jsdelivr.net/npm/toilscript@0.1.53/dist/cli.js",
5
5
  "binaryen": "https://cdn.jsdelivr.net/npm/binaryen@130.0.0-nightly.20260609/index.js",
6
6
  "long": "https://cdn.jsdelivr.net/npm/long@5.3.2/index.js"
7
7
  }
@@ -3271,6 +3271,14 @@ declare module "types:toilscript/src/parser" {
3271
3271
  * `AuthUser` (a natural compile error).
3272
3272
  */
3273
3273
  private injectUserBinding;
3274
+ /** Built-in auth (`server.auth`) reserves `toilUserId` + `username` as the FIRST two `@user` fields, so an
3275
+ * app can add its own fields to the authenticated user without repeating the identity boilerplate. Errors
3276
+ * if the class already declares either reserved name. Prepended toilUserId-first so `AuthService.userId()`
3277
+ * recovers the stable id straight from the session codec. Runs before `injectDataCodec` so the codec
3278
+ * covers the injected fields. */
3279
+ private injectAuthIdentityFields;
3280
+ /** Parse one synthesized field for {@link injectAuthIdentityFields}: returns the member (does not push). */
3281
+ private parseAuthField;
3274
3282
  /** True if `decorators` carries a decorator of `kind` (e.g. `@auth`). */
3275
3283
  private hasDecoratorKind;
3276
3284
  /** The mount prefix from `@rest("api")` -> "/api"; "" for the bare/object form (root). */
@@ -5157,6 +5165,10 @@ declare module "types:toilscript/src/compiler" {
5157
5165
  /** Toil compile surface mode. null = default request artifact. "hot" = request + stream surface.
5158
5166
  * "cold" = daemon surface. */
5159
5167
  targetMode: string | null;
5168
+ /** Built-in auth (`server.auth`): inject the reserved `toilUserId` + `username` identity fields into the
5169
+ * single `@user` so an app can extend the authenticated user with its own fields. Set by the toiljs build
5170
+ * when it detects the app declares its own `@user` under `server.auth`. */
5171
+ authUser: boolean;
5160
5172
  /** Runtime type. Defaults to Incremental GC. */
5161
5173
  runtime: Runtime;
5162
5174
  /** If true, indicates that debug information will be emitted by Binaryen. */
@@ -10069,6 +10081,8 @@ declare module "types:toilscript/src/index-wasm" {
10069
10081
  export function setNoUnsafe(options: Options, noUnsafe: boolean): void;
10070
10082
  /** Sets the `targetMode` option ("hot", "cold", or null for the default request artifact). */
10071
10083
  export function setTargetMode(options: Options, targetMode: string | null): void;
10084
+ /** Enables built-in-auth `@user` field injection (reserved `toilUserId` + `username`). */
10085
+ export function setAuthUser(options: Options, authUser: boolean): void;
10072
10086
  /** Sets the `lowMemoryLimit` option. */
10073
10087
  export function setLowMemoryLimit(options: Options, lowMemoryLimit: number): void;
10074
10088
  /** Sets the `exportRuntime` option. */