@shellui/core 0.3.0-beta.0 → 0.3.0-beta.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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shellui/core",
|
|
3
|
-
"version": "0.3.0-beta.
|
|
3
|
+
"version": "0.3.0-beta.1",
|
|
4
4
|
"description": "ShellUI Core - Core React application runtime",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"type": "module",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"workbox-routing": "^7.4.0",
|
|
63
63
|
"workbox-strategies": "^7.4.0",
|
|
64
64
|
"workbox-window": "^7.4.0",
|
|
65
|
-
"@shellui/sdk": "0.3.0-beta.
|
|
65
|
+
"@shellui/sdk": "0.3.0-beta.1"
|
|
66
66
|
},
|
|
67
67
|
"peerDependencies": {
|
|
68
68
|
"react": "^18.0.0 || ^19.0.0",
|
|
@@ -140,4 +140,28 @@ describe('buildSettingsForPropagation', () => {
|
|
|
140
140
|
});
|
|
141
141
|
expect(unsafeResult.accessToken).toBeNull();
|
|
142
142
|
});
|
|
143
|
+
|
|
144
|
+
it('injects authBackendBaseUrl when backend type is shellui', () => {
|
|
145
|
+
const config = {
|
|
146
|
+
backend: {
|
|
147
|
+
type: 'shellui' as const,
|
|
148
|
+
url: 'https://id.example.com/',
|
|
149
|
+
},
|
|
150
|
+
} as ShellUIConfig;
|
|
151
|
+
|
|
152
|
+
const result = buildSettingsForPropagation(baseSettings, config, 'en');
|
|
153
|
+
expect(result.authBackendBaseUrl).toBe('https://id.example.com');
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
it('sets authBackendBaseUrl to null when backend is not shellui', () => {
|
|
157
|
+
const config = {
|
|
158
|
+
backend: {
|
|
159
|
+
type: 'supabase' as const,
|
|
160
|
+
url: 'https://xyz.supabase.co',
|
|
161
|
+
},
|
|
162
|
+
} as ShellUIConfig;
|
|
163
|
+
|
|
164
|
+
const result = buildSettingsForPropagation(baseSettings, config, 'en');
|
|
165
|
+
expect(result.authBackendBaseUrl).toBeNull();
|
|
166
|
+
});
|
|
143
167
|
});
|
|
@@ -46,9 +46,15 @@ export const buildSettingsForPropagation = (
|
|
|
46
46
|
result = { ...result, navigation: { items } };
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
+
const authBackendBaseUrl =
|
|
50
|
+
config?.backend?.type === 'shellui' && config.backend.url?.trim()
|
|
51
|
+
? config.backend.url.trim().replace(/\/+$/, '')
|
|
52
|
+
: null;
|
|
53
|
+
|
|
49
54
|
result = {
|
|
50
55
|
...result,
|
|
51
56
|
accessToken: options?.includeAuthAccessToken ? (options.accessToken ?? null) : null,
|
|
57
|
+
authBackendBaseUrl,
|
|
52
58
|
};
|
|
53
59
|
|
|
54
60
|
return result;
|