@base44-preview/sdk 0.8.53-pr.326.dba1b54 → 0.8.53-pr.327.797dbc6
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,49 +1,66 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The app's access
|
|
3
|
-
*
|
|
2
|
+
* The app's [visibility](/Setting-up-your-app/Managing-access#setting-your-app-visibility).
|
|
3
|
+
*
|
|
4
|
+
* You can set and manage the app's visibility in the app's dashboard or with the Base44 CLI [`visibility`](/developers/references/cli/commands/visibility) command.
|
|
5
|
+
*
|
|
6
|
+
* The following table shows the supported values and the visibility each one represents:
|
|
7
|
+
*
|
|
8
|
+
* | Value | Visibility |
|
|
9
|
+
* | --- | --- |
|
|
10
|
+
* | `private_with_login` | **Private**: Only [invited users](/Setting-up-your-app/Managing-access#inviting-users-to-your-app) |
|
|
11
|
+
* | `workspace_with_login` | **Workspace**: Users in your Base44 [workspace](/documentation/account-and-billing/about-workspaces) |
|
|
12
|
+
* | `public_with_login` | **Public (login required)**: Visitors must log in |
|
|
13
|
+
* | `public_without_login` | **Public (no login)**: Anyone |
|
|
14
|
+
*
|
|
15
|
+
* <Note>
|
|
16
|
+
* If your workspace [enforces SSO for apps](/Enterprise/Enterprise-SSO-and-app-visibility), apps set to `public_without_login` also require sign-in.
|
|
17
|
+
* </Note>
|
|
4
18
|
*/
|
|
5
19
|
export type AppPublicSettings = "private_with_login" | "public_with_login" | "public_without_login" | "workspace_with_login" | string;
|
|
6
20
|
/**
|
|
7
|
-
* The app's public
|
|
21
|
+
* The app's public settings.
|
|
8
22
|
*/
|
|
9
23
|
export interface AppPublicSettingsResponse {
|
|
10
24
|
/** The app's ID. */
|
|
11
25
|
id: string;
|
|
12
|
-
/**
|
|
26
|
+
/**
|
|
27
|
+
* The app's visibility.
|
|
28
|
+
* For supported values, see [`AppPublicSettings`](#apppublicsettings).
|
|
29
|
+
*/
|
|
13
30
|
public_settings: AppPublicSettings;
|
|
14
31
|
}
|
|
15
32
|
/**
|
|
16
|
-
* App module for reading
|
|
33
|
+
* App module for reading an app's public settings.
|
|
34
|
+
*
|
|
35
|
+
* Use it to read the app's visibility and determine whether the current visitor can access the app.
|
|
36
|
+
* If the app requires login, use `redirectToLogin()` from the {@link AuthModule | auth module} to send the visitor to the login page.
|
|
17
37
|
*
|
|
18
|
-
*
|
|
19
|
-
* can send the visitor to login instead of rendering an empty shell.
|
|
38
|
+
* Learn more about [app visibility](/Setting-up-your-app/Managing-access#setting-your-app-visibility).
|
|
20
39
|
*
|
|
21
|
-
* ## Authentication
|
|
40
|
+
* ## Authentication modes
|
|
22
41
|
*
|
|
23
|
-
*
|
|
24
|
-
* client's token, when it has one, is sent with the request — a signed-in visitor
|
|
25
|
-
* who has no access to the app is reported differently from an anonymous one.
|
|
42
|
+
* You can use this module with a client in any authentication mode. The client sends its token, if it has one, with the request.
|
|
26
43
|
*/
|
|
27
44
|
export interface AppModule {
|
|
28
45
|
/**
|
|
29
|
-
*
|
|
46
|
+
* Retrieves the app's public settings.
|
|
30
47
|
*
|
|
31
|
-
* Rejects with a {@linkcode Base44Error} when the visitor
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
* visitor
|
|
48
|
+
* Rejects with a {@linkcode Base44Error} that has a `status` of `403` when the visitor can't access the app.
|
|
49
|
+
* Check `data.extra_data.reason` to find the cause:
|
|
50
|
+
* - `auth_required`: The visitor must sign in.
|
|
51
|
+
* - `user_not_registered`: The visitor is signed in but doesn't have access.
|
|
35
52
|
*
|
|
36
|
-
* @returns Promise resolving to the app's ID and
|
|
53
|
+
* @returns Promise resolving to the app's ID and visibility.
|
|
37
54
|
*
|
|
38
55
|
* @example
|
|
39
56
|
* ```typescript
|
|
40
|
-
* //
|
|
57
|
+
* // Redirect a visitor who isn't signed in
|
|
41
58
|
* try {
|
|
42
59
|
* const { public_settings } = await base44.app.getPublicSettings();
|
|
43
|
-
* console.log('App
|
|
60
|
+
* console.log('App visibility:', public_settings);
|
|
44
61
|
* } catch (error) {
|
|
45
|
-
* if (error.status === 403) {
|
|
46
|
-
*
|
|
62
|
+
* if (error.status === 403 && error.data?.extra_data?.reason === 'auth_required') {
|
|
63
|
+
* base44.auth.redirectToLogin('<URL to return to after login>');
|
|
47
64
|
* }
|
|
48
65
|
* }
|
|
49
66
|
* ```
|
|
@@ -19,7 +19,7 @@ export type IntegrationEndpointFunction = (data: Record<string, any>) => Promise
|
|
|
19
19
|
* ```typescript
|
|
20
20
|
* await base44.integrations.Core.InvokeLLM({
|
|
21
21
|
* prompt: 'Explain quantum computing',
|
|
22
|
-
* model: '
|
|
22
|
+
* model: 'gemini_3_8_flash'
|
|
23
23
|
* });
|
|
24
24
|
* ```
|
|
25
25
|
*
|
|
@@ -43,9 +43,9 @@ export interface InvokeLLMParams {
|
|
|
43
43
|
prompt: string;
|
|
44
44
|
/** Optionally specify a model to override the app-level model setting for this specific call.
|
|
45
45
|
*
|
|
46
|
-
* Options: `"
|
|
46
|
+
* Options: `"gemini_3_8_flash"`, `"gpt_6_luna"`, `"claude-sonnet-5"`, `"claude_opus_5_5"`, `"gpt_6_sol"`, `"gpt_6_astra"`, `"claude_fable_5_1"`, `"glm_5_2"`, `"gemini_3_1_pro"`, `"gpt_5_4"`, `"claude_sonnet_4_6"`, `"claude_opus_4_6"`, `"claude_opus_4_7"`, `"claude_opus_4_8"`, `"claude_opus_5"`, `"gpt_5_6_terra"`, `"gpt_5_6_sol"`, `"gpt_5_6_luna"`
|
|
47
47
|
*/
|
|
48
|
-
model?: '
|
|
48
|
+
model?: 'gemini_3_8_flash' | 'gpt_6_luna' | 'claude-sonnet-5' | 'claude_opus_5_5' | 'gpt_6_sol' | 'gpt_6_astra' | 'claude_fable_5_1' | 'glm_5_2' | 'gemini_3_1_pro' | 'gpt_5_4' | 'claude_sonnet_4_6' | 'claude_opus_4_6' | 'claude_opus_4_7' | 'claude_opus_4_8' | 'claude_opus_5' | 'gpt_5_6_terra' | 'gpt_5_6_sol' | 'gpt_5_6_luna';
|
|
49
49
|
/** If set to `true`, the LLM will use Google Search, Maps, and News to gather real-time context before answering.
|
|
50
50
|
* @default false
|
|
51
51
|
*/
|