@kontrolia/shared 1.0.0 → 1.1.0

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/types.d.ts CHANGED
@@ -19,10 +19,18 @@ export interface KontroliaMembership {
19
19
  status: "active" | "invited" | "suspended";
20
20
  roles: string[];
21
21
  }
22
+ /** A membership with its organization resolved — what a "switch company" selector needs to render. */
23
+ export interface KontroliaMembershipWithOrganization extends KontroliaMembership {
24
+ organization: KontroliaOrganization;
25
+ }
22
26
  /**
23
27
  * Shape of the custom claims injected by kontrolia.custom_access_token_hook
24
- * (see packages/db/migrations/0007_custom_access_token_hook.sql). Present
25
- * under the top-level JWT claims, decoded by @kontrolia/auth.
28
+ * (see packages/db/migrations/0007_custom_access_token_hook.sql), plus the
29
+ * standard GoTrue claims every Supabase-issued access token already carries
30
+ * (`email`, `user_metadata`) — present under the top-level JWT claims,
31
+ * decoded by @kontrolia/auth. `user_metadata` is whatever was passed at
32
+ * signup / `updateProfile()`; only the keys @kontrolia/auth itself reads and
33
+ * writes are typed here.
26
34
  */
27
35
  export interface KontroliaTokenClaims {
28
36
  sub: string;
@@ -31,7 +39,23 @@ export interface KontroliaTokenClaims {
31
39
  organization_id: string | null;
32
40
  roles: string[];
33
41
  permissions: string[];
42
+ /**
43
+ * True for a user granted platform-admin status (see
44
+ * kontrolia.platform_admins) — a reserved claim outside the app
45
+ * permission-key namespace, for support/ops tooling that needs to see
46
+ * across every organization instead of just the active one. Not
47
+ * something an app's own role/permission catalog can grant.
48
+ */
49
+ is_platform_admin?: boolean;
34
50
  exp: number;
51
+ email?: string | null;
52
+ user_metadata?: {
53
+ full_name?: string | null;
54
+ avatar_url?: string | null;
55
+ locale?: string | null;
56
+ timezone?: string | null;
57
+ [key: string]: unknown;
58
+ } | null;
35
59
  [key: string]: unknown;
36
60
  }
37
61
  export interface KontroliaInvitation {
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/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I,CAAC;IACtB,aAAa,CAAC,EAAE;QACd,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QAC1B,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QAC3B,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QACvB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QACzB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;KACxB,GAAG,IAAI,CAAC;IACT,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,cAAc,EAAE,MAAM,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,oFAAoF;AACpF,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kontrolia/shared",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "license": "MIT",
5
5
  "description": "Shared TypeScript types and utilities used across every KontrolIA Auth package and app.",
6
6
  "keywords": [