@unisim/sdk 0.37.0 → 0.38.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/README.md +107 -107
- package/dist/ChangelogMenu.js +3 -3
- package/dist/SuiteSwitcher.js +3 -3
- package/dist/UniversalAppsNavBar.d.ts.map +1 -1
- package/dist/UniversalAppsNavBar.js +5 -9
- package/dist/UniversalAppsNavBar.js.map +1 -1
- package/dist/auth.d.ts.map +1 -1
- package/dist/auth.js +17 -5
- package/dist/auth.js.map +1 -1
- package/package.json +63 -63
package/README.md
CHANGED
|
@@ -1,107 +1,107 @@
|
|
|
1
|
-
# @unisim/sdk
|
|
2
|
-
|
|
3
|
-
Shared React SDK for the **Universal Suite** — Ergo Assess UK, Cyber Assess UK, Workplace Assess, plus the central hub at `app.unisim.co.uk`. One package for auth, multi-tenant org data, branding, entitlements, changelog, and trial gating, so every product reads the same source of truth.
|
|
4
|
-
|
|
5
|
-
**No product should import `@supabase/supabase-js` directly** — go through the SDK so the underlying backend stays swappable.
|
|
6
|
-
|
|
7
|
-
## Install
|
|
8
|
-
|
|
9
|
-
```bash
|
|
10
|
-
npm install @unisim/sdk @supabase/supabase-js react
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
React 18+ is a peer dependency.
|
|
14
|
-
|
|
15
|
-
## Quick start
|
|
16
|
-
|
|
17
|
-
Wrap your app in `<UniversalProvider>` once, then call hooks anywhere.
|
|
18
|
-
|
|
19
|
-
```tsx
|
|
20
|
-
import { UniversalProvider, useUser, useOrgBranding } from '@unisim/sdk'
|
|
21
|
-
|
|
22
|
-
const config = {
|
|
23
|
-
supabaseUrl: process.env.NEXT_PUBLIC_PLATFORM_SUPABASE_URL!,
|
|
24
|
-
supabaseAnonKey: process.env.NEXT_PUBLIC_PLATFORM_SUPABASE_ANON_KEY!,
|
|
25
|
-
product: 'ergo_assess',
|
|
26
|
-
cookieDomain: process.env.NODE_ENV === 'production' ? '.unisim.co.uk' : undefined,
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
function App() {
|
|
30
|
-
return (
|
|
31
|
-
<UniversalProvider config={config}>
|
|
32
|
-
<Header />
|
|
33
|
-
{/* … */}
|
|
34
|
-
</UniversalProvider>
|
|
35
|
-
)
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
function Header() {
|
|
39
|
-
const { user } = useUser()
|
|
40
|
-
const branding = useOrgBranding()
|
|
41
|
-
return (
|
|
42
|
-
<header>
|
|
43
|
-
{branding.logo_url && <img src={branding.logo_url} alt="" />}
|
|
44
|
-
<span>{user?.email ?? 'Guest'}</span>
|
|
45
|
-
</header>
|
|
46
|
-
)
|
|
47
|
-
}
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
## What you get
|
|
51
|
-
|
|
52
|
-
### Auth + session
|
|
53
|
-
- `useUniversal()` — raw `{ supabase, session, activeOrgId, … }`
|
|
54
|
-
- `useUser()` — `{ user, loading }`
|
|
55
|
-
- `useOrg()` — active org + list of orgs the user belongs to
|
|
56
|
-
- `signInWithPassword(supabase, email, password)`
|
|
57
|
-
- `signOut(supabase)`
|
|
58
|
-
|
|
59
|
-
### Trial mode (anonymous-auth users)
|
|
60
|
-
- `useTrialMode()` — `{ isTrial, hasSession, email }` for gating exports / multi-user
|
|
61
|
-
- `<TrialBadge />` — small "PRO" chip you append to gated buttons
|
|
62
|
-
- `<UpgradeWall feature="export PDFs" />` — full feature-replacement card
|
|
63
|
-
|
|
64
|
-
### Suite-wide entities (all org-scoped, RLS-gated)
|
|
65
|
-
- `usePeople()` + `createPerson` / `deletePerson`
|
|
66
|
-
- `useTeams()` + `useTeamMemberships()` + `createTeam` / `assignPersonToTeam` / …
|
|
67
|
-
- `usePlaces()` + `createPlace` / `deletePlace`
|
|
68
|
-
- `useProjects()` + `createProject` / `updateProjectStatus` / `deleteProject`
|
|
69
|
-
- `useOrgBranding()` — logo URL + brand colour
|
|
70
|
-
- `useOrgMembers()` — org membership list with profile data
|
|
71
|
-
|
|
72
|
-
### Subscriptions + entitlements
|
|
73
|
-
- `useSubscription()` — `{ tier, status, seat_count, current_period_end, credits }`
|
|
74
|
-
- `useCredits()` — convenience wrapper for the metered balance
|
|
75
|
-
- `useHasAccess(productCode)` — feature/product entitlement check
|
|
76
|
-
- `useHasFeature(productCode, feature)`
|
|
77
|
-
- `useSeat(productCode)`
|
|
78
|
-
|
|
79
|
-
### Org admin
|
|
80
|
-
- `useOrgMembers()` / `useOrgSeats()` / `useAuditLog()`
|
|
81
|
-
- `assignSeat` / `revokeSeat` / `reassignSeat`
|
|
82
|
-
|
|
83
|
-
### Suite navigation
|
|
84
|
-
- `<SuiteSwitcher current="ergo_assess" />` — top-right product switcher with the canonical product list
|
|
85
|
-
- `<CompanyMenu />` — "My Company" dropdown linking to the central hub
|
|
86
|
-
- `<UniversalBar />` — the 4 px gradient brand strip across every product header
|
|
87
|
-
- `<UKFlag />` — region indicator for UK products
|
|
88
|
-
|
|
89
|
-
### Changelog
|
|
90
|
-
- `useChangelog()` — fetches the suite-wide changelog feed (defaults to `https://changelog.unisim.co.uk/changelog.json`)
|
|
91
|
-
|
|
92
|
-
## Multi-tenant model
|
|
93
|
-
|
|
94
|
-
This SDK is the client side of a Supabase-backed multi-tenant schema (see `universal-platform/supabase/migrations`). Every read/write is scoped to the user's active org via the `is_org_member()` helper in RLS policies. Anonymous-auth users get the same hooks; trial caps (3 people / 1 team / 2 places / 1 project) are enforced server-side by the `enforce_anonymous_trial_caps()` trigger.
|
|
95
|
-
|
|
96
|
-
## Publishing
|
|
97
|
-
|
|
98
|
-
```bash
|
|
99
|
-
cd packages/sdk
|
|
100
|
-
./publish.sh patch # or minor / major
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
This runs `npm version`, builds, publishes, commits the version bump, and pushes — see `publish.sh` for the exact sequence. `prepublishOnly` runs `typecheck && build` as a safety net, and the `dist/` folder is the only thing shipped (per `files`).
|
|
104
|
-
|
|
105
|
-
## License
|
|
106
|
-
|
|
107
|
-
MIT © Universal Simulation Ltd
|
|
1
|
+
# @unisim/sdk
|
|
2
|
+
|
|
3
|
+
Shared React SDK for the **Universal Suite** — Ergo Assess UK, Cyber Assess UK, Workplace Assess, plus the central hub at `app.unisim.co.uk`. One package for auth, multi-tenant org data, branding, entitlements, changelog, and trial gating, so every product reads the same source of truth.
|
|
4
|
+
|
|
5
|
+
**No product should import `@supabase/supabase-js` directly** — go through the SDK so the underlying backend stays swappable.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install @unisim/sdk @supabase/supabase-js react
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
React 18+ is a peer dependency.
|
|
14
|
+
|
|
15
|
+
## Quick start
|
|
16
|
+
|
|
17
|
+
Wrap your app in `<UniversalProvider>` once, then call hooks anywhere.
|
|
18
|
+
|
|
19
|
+
```tsx
|
|
20
|
+
import { UniversalProvider, useUser, useOrgBranding } from '@unisim/sdk'
|
|
21
|
+
|
|
22
|
+
const config = {
|
|
23
|
+
supabaseUrl: process.env.NEXT_PUBLIC_PLATFORM_SUPABASE_URL!,
|
|
24
|
+
supabaseAnonKey: process.env.NEXT_PUBLIC_PLATFORM_SUPABASE_ANON_KEY!,
|
|
25
|
+
product: 'ergo_assess',
|
|
26
|
+
cookieDomain: process.env.NODE_ENV === 'production' ? '.unisim.co.uk' : undefined,
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function App() {
|
|
30
|
+
return (
|
|
31
|
+
<UniversalProvider config={config}>
|
|
32
|
+
<Header />
|
|
33
|
+
{/* … */}
|
|
34
|
+
</UniversalProvider>
|
|
35
|
+
)
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function Header() {
|
|
39
|
+
const { user } = useUser()
|
|
40
|
+
const branding = useOrgBranding()
|
|
41
|
+
return (
|
|
42
|
+
<header>
|
|
43
|
+
{branding.logo_url && <img src={branding.logo_url} alt="" />}
|
|
44
|
+
<span>{user?.email ?? 'Guest'}</span>
|
|
45
|
+
</header>
|
|
46
|
+
)
|
|
47
|
+
}
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## What you get
|
|
51
|
+
|
|
52
|
+
### Auth + session
|
|
53
|
+
- `useUniversal()` — raw `{ supabase, session, activeOrgId, … }`
|
|
54
|
+
- `useUser()` — `{ user, loading }`
|
|
55
|
+
- `useOrg()` — active org + list of orgs the user belongs to
|
|
56
|
+
- `signInWithPassword(supabase, email, password)`
|
|
57
|
+
- `signOut(supabase)`
|
|
58
|
+
|
|
59
|
+
### Trial mode (anonymous-auth users)
|
|
60
|
+
- `useTrialMode()` — `{ isTrial, hasSession, email }` for gating exports / multi-user
|
|
61
|
+
- `<TrialBadge />` — small "PRO" chip you append to gated buttons
|
|
62
|
+
- `<UpgradeWall feature="export PDFs" />` — full feature-replacement card
|
|
63
|
+
|
|
64
|
+
### Suite-wide entities (all org-scoped, RLS-gated)
|
|
65
|
+
- `usePeople()` + `createPerson` / `deletePerson`
|
|
66
|
+
- `useTeams()` + `useTeamMemberships()` + `createTeam` / `assignPersonToTeam` / …
|
|
67
|
+
- `usePlaces()` + `createPlace` / `deletePlace`
|
|
68
|
+
- `useProjects()` + `createProject` / `updateProjectStatus` / `deleteProject`
|
|
69
|
+
- `useOrgBranding()` — logo URL + brand colour
|
|
70
|
+
- `useOrgMembers()` — org membership list with profile data
|
|
71
|
+
|
|
72
|
+
### Subscriptions + entitlements
|
|
73
|
+
- `useSubscription()` — `{ tier, status, seat_count, current_period_end, credits }`
|
|
74
|
+
- `useCredits()` — convenience wrapper for the metered balance
|
|
75
|
+
- `useHasAccess(productCode)` — feature/product entitlement check
|
|
76
|
+
- `useHasFeature(productCode, feature)`
|
|
77
|
+
- `useSeat(productCode)`
|
|
78
|
+
|
|
79
|
+
### Org admin
|
|
80
|
+
- `useOrgMembers()` / `useOrgSeats()` / `useAuditLog()`
|
|
81
|
+
- `assignSeat` / `revokeSeat` / `reassignSeat`
|
|
82
|
+
|
|
83
|
+
### Suite navigation
|
|
84
|
+
- `<SuiteSwitcher current="ergo_assess" />` — top-right product switcher with the canonical product list
|
|
85
|
+
- `<CompanyMenu />` — "My Company" dropdown linking to the central hub
|
|
86
|
+
- `<UniversalBar />` — the 4 px gradient brand strip across every product header
|
|
87
|
+
- `<UKFlag />` — region indicator for UK products
|
|
88
|
+
|
|
89
|
+
### Changelog
|
|
90
|
+
- `useChangelog()` — fetches the suite-wide changelog feed (defaults to `https://changelog.unisim.co.uk/changelog.json`)
|
|
91
|
+
|
|
92
|
+
## Multi-tenant model
|
|
93
|
+
|
|
94
|
+
This SDK is the client side of a Supabase-backed multi-tenant schema (see `universal-platform/supabase/migrations`). Every read/write is scoped to the user's active org via the `is_org_member()` helper in RLS policies. Anonymous-auth users get the same hooks; trial caps (3 people / 1 team / 2 places / 1 project) are enforced server-side by the `enforce_anonymous_trial_caps()` trigger.
|
|
95
|
+
|
|
96
|
+
## Publishing
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
cd packages/sdk
|
|
100
|
+
./publish.sh patch # or minor / major
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
This runs `npm version`, builds, publishes, commits the version bump, and pushes — see `publish.sh` for the exact sequence. `prepublishOnly` runs `typecheck && build` as a safety net, and the `dist/` folder is the only thing shipped (per `files`).
|
|
104
|
+
|
|
105
|
+
## License
|
|
106
|
+
|
|
107
|
+
MIT © Universal Simulation Ltd
|
package/dist/ChangelogMenu.js
CHANGED
|
@@ -9,9 +9,9 @@ import { DropdownSurface } from './DropdownSurface.js';
|
|
|
9
9
|
// Component
|
|
10
10
|
// ──────────────────────────────────────────────────────────────────────────────
|
|
11
11
|
const DEFAULT_TRIGGER_ICON = 'data:image/svg+xml;utf8,' +
|
|
12
|
-
encodeURIComponent(`<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'>
|
|
13
|
-
<rect width='32' height='32' rx='8' fill='#e05504'/>
|
|
14
|
-
<text x='16' y='21' text-anchor='middle' font-family='-apple-system,Segoe UI,Helvetica,Arial,sans-serif' font-weight='800' font-size='13' fill='white' letter-spacing='-0.5'>US</text>
|
|
12
|
+
encodeURIComponent(`<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'>
|
|
13
|
+
<rect width='32' height='32' rx='8' fill='#e05504'/>
|
|
14
|
+
<text x='16' y='21' text-anchor='middle' font-family='-apple-system,Segoe UI,Helvetica,Arial,sans-serif' font-weight='800' font-size='13' fill='white' letter-spacing='-0.5'>US</text>
|
|
15
15
|
</svg>`);
|
|
16
16
|
/**
|
|
17
17
|
* Dropdown on the UNI·SIM icon that surfaces the suite-wide changelog
|
package/dist/SuiteSwitcher.js
CHANGED
|
@@ -187,9 +187,9 @@ export const DEFAULT_APP_GROUPS = [
|
|
|
187
187
|
];
|
|
188
188
|
// Inline UNI·SIM monogram so the SDK has zero asset dependencies.
|
|
189
189
|
const DEFAULT_TRIGGER_ICON = 'data:image/svg+xml;utf8,' +
|
|
190
|
-
encodeURIComponent(`<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'>
|
|
191
|
-
<rect width='32' height='32' rx='8' fill='#e05504'/>
|
|
192
|
-
<text x='16' y='21' text-anchor='middle' font-family='-apple-system,Segoe UI,Helvetica,Arial,sans-serif' font-weight='800' font-size='13' fill='white' letter-spacing='-0.5'>US</text>
|
|
190
|
+
encodeURIComponent(`<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'>
|
|
191
|
+
<rect width='32' height='32' rx='8' fill='#e05504'/>
|
|
192
|
+
<text x='16' y='21' text-anchor='middle' font-family='-apple-system,Segoe UI,Helvetica,Arial,sans-serif' font-weight='800' font-size='13' fill='white' letter-spacing='-0.5'>US</text>
|
|
193
193
|
</svg>`);
|
|
194
194
|
// ──────────────────────────────────────────────────────────────────────────────
|
|
195
195
|
// Component
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UniversalAppsNavBar.d.ts","sourceRoot":"","sources":["../src/UniversalAppsNavBar.tsx"],"names":[],"mappings":"AAEA,OAAO,EAA+B,KAAK,aAAa,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAEvF,OAAO,EAIL,KAAK,YAAY,EACjB,KAAK,cAAc,EACpB,MAAM,oBAAoB,CAAA;AAY3B,MAAM,WAAW,wBAAwB;IACvC,gDAAgD;IAChD,OAAO,EAAE,cAAc,CAAA;IACvB;;;;;;;OAOG;IACH,WAAW,EAAE,SAAS,CAAA;IACtB;;;;;;;;;OASG;IACH,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAA;IACpB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,YAAY,EAAE,CAAA;IACzB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB;;;;OAIG;IACH,oBAAoB,CAAC,EAAE,MAAM,CAAA;IAC7B,4DAA4D;IAC5D,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACjC,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,KAAK,CAAC,EAAE,aAAa,CAAA;CACtB;AAMD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,OAAO,EACP,WAAW,EACX,eAAe,EACf,QAAQ,EACR,QAA0C,EAC1C,UAA8C,EAC9C,UAA0D,EAC1D,YAA+C,EAC/C,oBAAoB,EACpB,cAAqB,EACrB,eAAsB,EACtB,SAAS,EACT,KAAK,GACN,EAAE,wBAAwB,
|
|
1
|
+
{"version":3,"file":"UniversalAppsNavBar.d.ts","sourceRoot":"","sources":["../src/UniversalAppsNavBar.tsx"],"names":[],"mappings":"AAEA,OAAO,EAA+B,KAAK,aAAa,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAEvF,OAAO,EAIL,KAAK,YAAY,EACjB,KAAK,cAAc,EACpB,MAAM,oBAAoB,CAAA;AAY3B,MAAM,WAAW,wBAAwB;IACvC,gDAAgD;IAChD,OAAO,EAAE,cAAc,CAAA;IACvB;;;;;;;OAOG;IACH,WAAW,EAAE,SAAS,CAAA;IACtB;;;;;;;;;OASG;IACH,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAA;IACpB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,YAAY,EAAE,CAAA;IACzB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB;;;;OAIG;IACH,oBAAoB,CAAC,EAAE,MAAM,CAAA;IAC7B,4DAA4D;IAC5D,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACjC,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,KAAK,CAAC,EAAE,aAAa,CAAA;CACtB;AAMD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,OAAO,EACP,WAAW,EACX,eAAe,EACf,QAAQ,EACR,QAA0C,EAC1C,UAA8C,EAC9C,UAA0D,EAC1D,YAA+C,EAC/C,oBAAoB,EACpB,cAAqB,EACrB,eAAsB,EACtB,SAAS,EACT,KAAK,GACN,EAAE,wBAAwB,2CA0J1B"}
|
|
@@ -49,10 +49,8 @@ export function UniversalAppsNavBar({ product, productLogo, productHomeHref, fil
|
|
|
49
49
|
// app passes a full wordmark or an icon-only logo. Apps should pass an
|
|
50
50
|
// icon-only `productLogo` so the name isn't duplicated.
|
|
51
51
|
const productName = products.find((p) => p.id === product)?.name;
|
|
52
|
-
// The current product's marketing family — drives
|
|
53
|
-
// collapsible groups below
|
|
54
|
-
// everyday apps are free forever; the business apps are open source but
|
|
55
|
-
// not pitched as free).
|
|
52
|
+
// The current product's marketing family — drives the cross-category
|
|
53
|
+
// collapsible groups below (the brand claim is now uniform across families).
|
|
56
54
|
const currentCategory = products.find((p) => p.id === product)?.category;
|
|
57
55
|
// Build collapsible groups for the categories the current product is NOT in.
|
|
58
56
|
// e.g. on an 'everyday' app the switcher main list shows only everyday apps,
|
|
@@ -119,7 +117,7 @@ export function UniversalAppsNavBar({ product, productLogo, productHomeHref, fil
|
|
|
119
117
|
eyebrow: t(language, 'suite.portal_eyebrow'),
|
|
120
118
|
title: t(language, 'suite.portal_title_apps'),
|
|
121
119
|
}, appGroups: crossCategoryGroups.length > 0 ? crossCategoryGroups : undefined, children: identityTrigger }), fileMenu && (_jsxs(_Fragment, { children: [_jsx("span", { style: separatorStyle, "aria-hidden": true, children: "\u00B7" }), _jsx("div", { style: fileMenuWrapStyle, children: fileMenu })] }))] }));
|
|
122
|
-
return (_jsxs("div", { className: className, style: style, children: [showBrandStrip && _jsx(UniversalBar, {}), _jsxs("div", { style: { ...headerOuterStyle, position: 'relative' }, children: [_jsx("header", { style: { ...(isMobile ? mobileHeaderInnerStyle : headerInnerStyle), maxWidth }, children: identityBlock }), showClaim && githubHref && (_jsxs("a", { href: githubHref, target: "_blank", rel: "noreferrer", style: brandClaimStyle, children: [
|
|
120
|
+
return (_jsxs("div", { className: className, style: style, children: [showBrandStrip && _jsx(UniversalBar, {}), _jsxs("div", { style: { ...headerOuterStyle, position: 'relative' }, children: [_jsx("header", { style: { ...(isMobile ? mobileHeaderInnerStyle : headerInnerStyle), maxWidth }, children: identityBlock }), showClaim && githubHref && (_jsxs("a", { href: githubHref, target: "_blank", rel: "noreferrer", style: brandClaimStyle, children: [_jsx("span", { style: brandClaimPctStyle, children: "100%" }), _jsx("span", { style: brandClaimSegStyle, children: t(language, 'apps.open_source') }), _jsxs("span", { style: brandClaimFreeStyle, children: ["(", t(language, 'apps.free'), ")"] })] })), _jsxs("div", { style: changelogFloatStyle, children: [_jsx(UserProfile, { ...resolvedUser, menuAlign: "right" }), _jsx(ChangelogMenu, { iconSrc: suiteSwitcherIconSrc })] })] })] }));
|
|
123
121
|
}
|
|
124
122
|
// ──────────────────────────────────────────────────────────────────────────────
|
|
125
123
|
// useMobile — SSR-safe matchMedia hook (mirrors UniversalNavBar's)
|
|
@@ -248,12 +246,10 @@ const brandClaimPctStyle = {
|
|
|
248
246
|
color: '#ea580c',
|
|
249
247
|
fontWeight: 700,
|
|
250
248
|
};
|
|
251
|
-
const
|
|
252
|
-
color: '#cbd5e1',
|
|
253
|
-
};
|
|
254
|
-
const brandClaimForeverStyle = {
|
|
249
|
+
const brandClaimFreeStyle = {
|
|
255
250
|
color: '#fe8c01',
|
|
256
251
|
fontWeight: 700,
|
|
257
252
|
letterSpacing: '0.04em',
|
|
253
|
+
textTransform: 'uppercase',
|
|
258
254
|
};
|
|
259
255
|
//# sourceMappingURL=UniversalAppsNavBar.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UniversalAppsNavBar.js","sourceRoot":"","sources":["../src/UniversalAppsNavBar.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAsC,MAAM,OAAO,CAAA;AACvF,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAClD,OAAO,EACL,aAAa,EACb,+BAA+B,GAIhC,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAChD,OAAO,EAAE,CAAC,EAAE,MAAM,WAAW,CAAA;AAC7B,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,UAAU,EAAE,M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GAAkB;IACxC,KAAK,EAAO,SAAS;IACrB,UAAU,EAAE,GAAG;CAChB,CAAA;AAED,MAAM,mBAAmB,GAAkB;IACzC,KAAK,EAAU,SAAS;IACxB,UAAU,EAAK,GAAG;IAClB,aAAa,EAAE,QAAQ;IACvB,aAAa,EAAE,WAAW;CAC3B,CAAA"}
|
package/dist/auth.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAC5C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAE9C,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,GAAG,IAAI,CAAA;IACjD,OAAO,EAAE,OAAO,CAAA;CACjB;AAED,wBAAgB,OAAO,IAAI,aAAa,CAMvC;AAED,MAAM,WAAW,YAAY;IAC3B,GAAG,EAAE,YAAY,GAAG,IAAI,CAAA;IACxB,IAAI,EAAE,YAAY,EAAE,CAAA;IACpB,OAAO,EAAE,OAAO,CAAA;IAChB,YAAY,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAA;CAC7C;AAED,wBAAgB,MAAM,IAAI,YAAY,
|
|
1
|
+
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAC5C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAE9C,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,GAAG,IAAI,CAAA;IACjD,OAAO,EAAE,OAAO,CAAA;CACjB;AAED,wBAAgB,OAAO,IAAI,aAAa,CAMvC;AAED,MAAM,WAAW,YAAY;IAC3B,GAAG,EAAE,YAAY,GAAG,IAAI,CAAA;IACxB,IAAI,EAAE,YAAY,EAAE,CAAA;IACpB,OAAO,EAAE,OAAO,CAAA;IAChB,YAAY,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAA;CAC7C;AAED,wBAAgB,MAAM,IAAI,YAAY,CAoDrC;AAED,wBAAsB,kBAAkB,CACtC,QAAQ,EAAE,UAAU,CAAC,OAAO,YAAY,CAAC,CAAC,UAAU,CAAC,EACrD,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,MAAM,kEAGjB;AAED,wBAAsB,OAAO,CAAC,QAAQ,EAAE,UAAU,CAAC,OAAO,YAAY,CAAC,CAAC,UAAU,CAAC;;GAElF"}
|
package/dist/auth.js
CHANGED
|
@@ -20,9 +20,14 @@ export function useOrg() {
|
|
|
20
20
|
}
|
|
21
21
|
let cancelled = false;
|
|
22
22
|
setLoading(true);
|
|
23
|
+
// Join through org_members so the query is scoped to actual memberships.
|
|
24
|
+
// Querying organisations directly leaks via the platform-admin RLS policy,
|
|
25
|
+
// which grants read-all — causing the platform admin to see every org in
|
|
26
|
+
// the platform and land on a random customer's (free) org as the default.
|
|
23
27
|
supabase
|
|
24
|
-
.from('
|
|
25
|
-
.select('id, slug, name, logo_url, icon_url, brand_color, billing_email, people_marked_complete, places_marked_complete, projects_marked_complete')
|
|
28
|
+
.from('org_members')
|
|
29
|
+
.select('organisations(id, slug, name, logo_url, icon_url, brand_color, billing_email, people_marked_complete, places_marked_complete, projects_marked_complete)')
|
|
30
|
+
.eq('user_id', session.user.id)
|
|
26
31
|
.then(({ data, error }) => {
|
|
27
32
|
if (cancelled)
|
|
28
33
|
return;
|
|
@@ -31,9 +36,16 @@ export function useOrg() {
|
|
|
31
36
|
setOrgs([]);
|
|
32
37
|
}
|
|
33
38
|
else {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
39
|
+
// Supabase infers the embedded `organisations` relation as an array,
|
|
40
|
+
// but a member belongs to exactly one org so it's a single object at
|
|
41
|
+
// runtime. Cast to the runtime-correct shape before mapping.
|
|
42
|
+
const rows = (data ?? []);
|
|
43
|
+
const orgsFromMembers = rows
|
|
44
|
+
.map((row) => row.organisations)
|
|
45
|
+
.filter((o) => o !== null);
|
|
46
|
+
setOrgs(orgsFromMembers);
|
|
47
|
+
if (!activeOrgId && orgsFromMembers.length > 0) {
|
|
48
|
+
setActiveOrgId(orgsFromMembers[0].id);
|
|
37
49
|
}
|
|
38
50
|
}
|
|
39
51
|
setLoading(false);
|
package/dist/auth.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAAA,YAAY,CAAA;AAEZ,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAQ5C,MAAM,UAAU,OAAO;IACrB,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,YAAY,EAAE,CAAA;IAC3C,OAAO;QACL,IAAI,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,OAAO,CAAC,IAAI,CAAC,EAAE,EAAE,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,KAAK,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI;QACvF,OAAO;KACR,CAAA;AACH,CAAC;AASD,MAAM,UAAU,MAAM;IACpB,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,GAAG,YAAY,EAAE,CAAA;IACzE,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAiB,EAAE,CAAC,CAAA;IACpD,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,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,EAAE,WAAW,EAAE,cAAc,CAAC,CAAC,CAAA;IAEpD,MAAM,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,WAAW,CAAC,IAAI,IAAI,CAAA;IAE1D,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,CAAA;AAC7D,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,QAAqD,EACrD,KAAa,EACb,QAAgB;IAEhB,OAAO,QAAQ,CAAC,IAAI,CAAC,kBAAkB,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAA;AAC9D,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,OAAO,CAAC,QAAqD;IACjF,OAAO,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAE,CAAA;AAChC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,63 +1,63 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@unisim/sdk",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Shared React SDK for the Universal Suite — auth, entitlements, usage telemetry, changelog, org admin.",
|
|
5
|
-
"license": "MIT",
|
|
6
|
-
"author": "Universal Simulation Ltd",
|
|
7
|
-
"keywords": [
|
|
8
|
-
"supabase",
|
|
9
|
-
"react",
|
|
10
|
-
"hooks",
|
|
11
|
-
"saas",
|
|
12
|
-
"multi-tenant",
|
|
13
|
-
"auth",
|
|
14
|
-
"rbac",
|
|
15
|
-
"universal-simulation"
|
|
16
|
-
],
|
|
17
|
-
"homepage": "https://github.com/universal-simulation-ltd/universal-platform/tree/main/packages/sdk#readme",
|
|
18
|
-
"repository": {
|
|
19
|
-
"type": "git",
|
|
20
|
-
"url": "git+https://github.com/universal-simulation-ltd/universal-platform.git",
|
|
21
|
-
"directory": "packages/sdk"
|
|
22
|
-
},
|
|
23
|
-
"bugs": {
|
|
24
|
-
"url": "https://github.com/universal-simulation-ltd/universal-platform/issues"
|
|
25
|
-
},
|
|
26
|
-
"type": "module",
|
|
27
|
-
"main": "./dist/index.js",
|
|
28
|
-
"module": "./dist/index.js",
|
|
29
|
-
"types": "./dist/index.d.ts",
|
|
30
|
-
"sideEffects": false,
|
|
31
|
-
"exports": {
|
|
32
|
-
".": {
|
|
33
|
-
"types": "./dist/index.d.ts",
|
|
34
|
-
"import": "./dist/index.js"
|
|
35
|
-
}
|
|
36
|
-
},
|
|
37
|
-
"files": [
|
|
38
|
-
"dist",
|
|
39
|
-
"README.md"
|
|
40
|
-
],
|
|
41
|
-
"scripts": {
|
|
42
|
-
"build": "tsc -p tsconfig.build.json",
|
|
43
|
-
"dev": "tsc -p tsconfig.build.json --watch",
|
|
44
|
-
"typecheck": "tsc --noEmit",
|
|
45
|
-
"prepublishOnly": "npm run typecheck && npm run build"
|
|
46
|
-
},
|
|
47
|
-
"peerDependencies": {
|
|
48
|
-
"@supabase/supabase-js": "^2.45.0",
|
|
49
|
-
"react": "^18.0.0 || ^19.0.0",
|
|
50
|
-
"react-dom": "^18.0.0 || ^19.0.0"
|
|
51
|
-
},
|
|
52
|
-
"devDependencies": {
|
|
53
|
-
"@supabase/supabase-js": "^2.45.0",
|
|
54
|
-
"@types/react": "^18.3.0",
|
|
55
|
-
"@types/react-dom": "^18.3.7",
|
|
56
|
-
"react": "^18.3.0",
|
|
57
|
-
"react-dom": "^18.3.1",
|
|
58
|
-
"typescript": "^5.7.2"
|
|
59
|
-
},
|
|
60
|
-
"publishConfig": {
|
|
61
|
-
"access": "public"
|
|
62
|
-
}
|
|
63
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@unisim/sdk",
|
|
3
|
+
"version": "0.38.0",
|
|
4
|
+
"description": "Shared React SDK for the Universal Suite — auth, entitlements, usage telemetry, changelog, org admin.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "Universal Simulation Ltd",
|
|
7
|
+
"keywords": [
|
|
8
|
+
"supabase",
|
|
9
|
+
"react",
|
|
10
|
+
"hooks",
|
|
11
|
+
"saas",
|
|
12
|
+
"multi-tenant",
|
|
13
|
+
"auth",
|
|
14
|
+
"rbac",
|
|
15
|
+
"universal-simulation"
|
|
16
|
+
],
|
|
17
|
+
"homepage": "https://github.com/universal-simulation-ltd/universal-platform/tree/main/packages/sdk#readme",
|
|
18
|
+
"repository": {
|
|
19
|
+
"type": "git",
|
|
20
|
+
"url": "git+https://github.com/universal-simulation-ltd/universal-platform.git",
|
|
21
|
+
"directory": "packages/sdk"
|
|
22
|
+
},
|
|
23
|
+
"bugs": {
|
|
24
|
+
"url": "https://github.com/universal-simulation-ltd/universal-platform/issues"
|
|
25
|
+
},
|
|
26
|
+
"type": "module",
|
|
27
|
+
"main": "./dist/index.js",
|
|
28
|
+
"module": "./dist/index.js",
|
|
29
|
+
"types": "./dist/index.d.ts",
|
|
30
|
+
"sideEffects": false,
|
|
31
|
+
"exports": {
|
|
32
|
+
".": {
|
|
33
|
+
"types": "./dist/index.d.ts",
|
|
34
|
+
"import": "./dist/index.js"
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"files": [
|
|
38
|
+
"dist",
|
|
39
|
+
"README.md"
|
|
40
|
+
],
|
|
41
|
+
"scripts": {
|
|
42
|
+
"build": "tsc -p tsconfig.build.json",
|
|
43
|
+
"dev": "tsc -p tsconfig.build.json --watch",
|
|
44
|
+
"typecheck": "tsc --noEmit",
|
|
45
|
+
"prepublishOnly": "npm run typecheck && npm run build"
|
|
46
|
+
},
|
|
47
|
+
"peerDependencies": {
|
|
48
|
+
"@supabase/supabase-js": "^2.45.0",
|
|
49
|
+
"react": "^18.0.0 || ^19.0.0",
|
|
50
|
+
"react-dom": "^18.0.0 || ^19.0.0"
|
|
51
|
+
},
|
|
52
|
+
"devDependencies": {
|
|
53
|
+
"@supabase/supabase-js": "^2.45.0",
|
|
54
|
+
"@types/react": "^18.3.0",
|
|
55
|
+
"@types/react-dom": "^18.3.7",
|
|
56
|
+
"react": "^18.3.0",
|
|
57
|
+
"react-dom": "^18.3.1",
|
|
58
|
+
"typescript": "^5.7.2"
|
|
59
|
+
},
|
|
60
|
+
"publishConfig": {
|
|
61
|
+
"access": "public"
|
|
62
|
+
}
|
|
63
|
+
}
|