@cosmicdrift/kumiko-types 0.167.0 → 0.167.1
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/package.json +1 -1
- package/src/handlers.ts +12 -6
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cosmicdrift/kumiko-types",
|
|
3
|
-
"version": "0.167.
|
|
3
|
+
"version": "0.167.1",
|
|
4
4
|
"description": "Framework-Type-Definitions für Kumiko — FeatureDefinition, BootCheck-Types und die reinen Engine-Types. Erlaubt Downstream-Konsumenten, gegen die Type-Contracts zu bauen, ohne das ganze Framework-Package zu importieren. Enthaelt keine identitaets-sensitiven Runtime-Werte mehr (Error-Klassen leben seit #1629 in kumiko-framework, Brand-Symbole nutzen Symbol.for) und ist deshalb eine plain dependency, keine peerDependency.",
|
|
5
5
|
"license": "BUSL-1.1",
|
|
6
6
|
"author": "Marc Frost <marc@cosmicdriftgamestudio.com>",
|
package/src/handlers.ts
CHANGED
|
@@ -30,6 +30,10 @@ export type SessionUser = {
|
|
|
30
30
|
readonly id: string;
|
|
31
31
|
readonly tenantId: TenantId;
|
|
32
32
|
readonly roles: readonly string[];
|
|
33
|
+
// IANA zone from user.timezone, set at login. Absent → ctx.tz falls back
|
|
34
|
+
// to tenant.timezone, then "UTC" (buildHandlerContext, fw#1636). Stale
|
|
35
|
+
// until re-login — same tradeoff as `roles`.
|
|
36
|
+
readonly timezone?: string;
|
|
33
37
|
// App-specific identity facts baked into the JWT at login time.
|
|
34
38
|
// Populated by `r.authClaims()` hooks (not yet implemented — see the
|
|
35
39
|
// auth-claims design note in docs/plans). Reserved here so the type shape
|
|
@@ -479,12 +483,14 @@ export type HandlerContext<TMap extends object = KumikoEventTypeMap> = SharedCon
|
|
|
479
483
|
readonly metrics: MetricsHandle;
|
|
480
484
|
readonly tracer: Tracer;
|
|
481
485
|
|
|
482
|
-
// Time + TZ helper. Feature
|
|
483
|
-
// ctx.tz.now()
|
|
484
|
-
//
|
|
485
|
-
// API
|
|
486
|
-
//
|
|
487
|
-
//
|
|
486
|
+
// Time + TZ helper. Feature code MUST go through this instead of
|
|
487
|
+
// `new Date()` — ctx.tz.now() returns Temporal.Instant, ctx.tz.parse
|
|
488
|
+
// (wallClock, tz) produces a ZonedDateTime, ctx.tz.toLocatedJson
|
|
489
|
+
// serializes for the API boundary. The lint rule against `new Date()`
|
|
490
|
+
// lands once all internal usages are migrated. tenant reads
|
|
491
|
+
// tenant:config:timezone (falls back to "UTC" when no config feature is
|
|
492
|
+
// mounted or the value is unset); user reads SessionUser.timezone (falls
|
|
493
|
+
// back to tenant).
|
|
488
494
|
readonly tz: TzContext;
|
|
489
495
|
|
|
490
496
|
// Resolve every registered r.authClaims() hook against `user` and return
|