@buildbase/sdk 0.0.49 → 0.0.51
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/AGENTS.md +29 -11
- package/CHANGELOG.md +53 -0
- package/README.md +110 -21
- package/dist/css/styles.css +1 -1
- package/dist/data/index.cjs +1 -1
- package/dist/data/index.mjs +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +105 -5
- package/dist/index.mjs +1 -1
- package/dist/react/chunks/SettingsDialog-DitAiAqr.cjs +2 -0
- package/dist/react/chunks/SettingsDialog-uVKFxlal.mjs +2 -0
- package/dist/react/chunks/SubscriptionDialog-Cg-qYVKr.cjs +2 -0
- package/dist/react/chunks/SubscriptionDialog-P0GlXEyn.mjs +2 -0
- package/dist/react/chunks/ar-SrPOJXdL.mjs +2 -0
- package/dist/react/chunks/ar-a3aRbPCs.cjs +2 -0
- package/dist/react/chunks/de-DE3_z7r0.cjs +2 -0
- package/dist/react/chunks/de-xnPl61SS.mjs +2 -0
- package/dist/react/chunks/es-C_xcyGtp.cjs +2 -0
- package/dist/react/chunks/es-CyuBtosP.mjs +2 -0
- package/dist/react/chunks/fr-BMu7Bk4k.cjs +2 -0
- package/dist/react/chunks/fr-CxuDLZ27.mjs +2 -0
- package/dist/react/chunks/hi-CQ215yc9.cjs +2 -0
- package/dist/react/chunks/hi-CpuvyorS.mjs +2 -0
- package/dist/react/chunks/ja-DIJ_xCIi.mjs +2 -0
- package/dist/react/chunks/ja-DK6Buuws.cjs +2 -0
- package/dist/react/chunks/react-C2ikFWBG.cjs +2 -0
- package/dist/react/chunks/react-CCukNQ4q.mjs +2 -0
- package/dist/react/chunks/zh-CYQwZiBL.mjs +2 -0
- package/dist/react/chunks/zh-Dt-apS2s.cjs +2 -0
- package/dist/react/index.cjs +1 -35
- package/dist/react/index.d.ts +453 -63
- package/dist/react/index.mjs +1 -35
- package/package.json +21 -3
package/dist/react/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import
|
|
1
|
+
import * as React$1 from 'react';
|
|
2
|
+
import React__default, { ReactNode } from 'react';
|
|
3
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
4
|
|
|
5
5
|
interface IDocument {
|
|
@@ -1148,6 +1148,15 @@ declare abstract class BaseApi {
|
|
|
1148
1148
|
* Tries to parse JSON error body; falls back to status-based message.
|
|
1149
1149
|
*/
|
|
1150
1150
|
protected throwResponseError(response: Response, defaultMsg: string): Promise<never>;
|
|
1151
|
+
/**
|
|
1152
|
+
* Tagged template that URI-encodes interpolated path segments, so IDs
|
|
1153
|
+
* containing `/ ? # ..` can't retarget the request path.
|
|
1154
|
+
* Use for PATH segments only — never for pre-built query strings.
|
|
1155
|
+
*
|
|
1156
|
+
* @example
|
|
1157
|
+
* this.apiPath`workspaces/${workspaceId}/users/${userId}`
|
|
1158
|
+
*/
|
|
1159
|
+
protected apiPath(strings: TemplateStringsArray, ...values: Array<string | number>): string;
|
|
1151
1160
|
/**
|
|
1152
1161
|
* Parse JSON and unwrap `{ success, data }` envelope if present.
|
|
1153
1162
|
* Throws if `success` is explicitly `false`.
|
|
@@ -1209,6 +1218,33 @@ interface IBetaConfig extends IDocument {
|
|
|
1209
1218
|
};
|
|
1210
1219
|
}
|
|
1211
1220
|
|
|
1221
|
+
/**
|
|
1222
|
+
* API client for the signed-in user's "connected agents" — the AI agents they
|
|
1223
|
+
* have authorized to access their account. Session-authed (x-session-id),
|
|
1224
|
+
* scoped to the current user. Extends BaseApi for shared URL/auth/request handling.
|
|
1225
|
+
*/
|
|
1226
|
+
|
|
1227
|
+
/** An agent the user has connected to their account. */
|
|
1228
|
+
interface IConnectedAgent {
|
|
1229
|
+
/** OAuth client id of the connected agent. */
|
|
1230
|
+
clientId: string;
|
|
1231
|
+
/** Display name of the agent. */
|
|
1232
|
+
title: string;
|
|
1233
|
+
/** Scopes the user granted it. */
|
|
1234
|
+
scope: string[];
|
|
1235
|
+
/** When the grant was last (re)approved (ISO string). */
|
|
1236
|
+
lastGrantedAt?: string;
|
|
1237
|
+
}
|
|
1238
|
+
declare class ConnectedAgentsApi extends BaseApi {
|
|
1239
|
+
constructor(config: Pick<IOsConfig, 'serverUrl' | 'version'> & {
|
|
1240
|
+
sessionId?: string;
|
|
1241
|
+
});
|
|
1242
|
+
/** List the agents the current user has connected. */
|
|
1243
|
+
list(signal?: AbortSignal): Promise<IConnectedAgent[]>;
|
|
1244
|
+
/** Disconnect one agent from the current user's account. */
|
|
1245
|
+
revoke(clientId: string): Promise<void>;
|
|
1246
|
+
}
|
|
1247
|
+
|
|
1212
1248
|
declare class PushApi extends BaseApi {
|
|
1213
1249
|
constructor(config: Pick<IBaseApiConfig, 'serverUrl' | 'version' | 'orgId' | 'sessionId'>);
|
|
1214
1250
|
getVapidPublicKey(): Promise<{
|
|
@@ -1842,8 +1878,14 @@ declare function validateRedirectUrl(url: string | null | undefined): string | n
|
|
|
1842
1878
|
/**
|
|
1843
1879
|
* Safely redirect to a URL after validating it.
|
|
1844
1880
|
* Falls back to fallbackUrl if the target URL is invalid.
|
|
1881
|
+
*
|
|
1882
|
+
* Browser-only: navigation requires `window.location`. On non-browser runtimes
|
|
1883
|
+
* (Node, edge, Deno, Bun) there is nothing to navigate, so this is a no-op that
|
|
1884
|
+
* returns `false`. Returns `true` when a navigation was initiated. Server code
|
|
1885
|
+
* that needs the resolved target should call {@link validateRedirectUrl} and
|
|
1886
|
+
* issue the redirect with its own framework (e.g. `Response.redirect`).
|
|
1845
1887
|
*/
|
|
1846
|
-
declare function safeRedirect(url: string | null | undefined, fallbackUrl?: string):
|
|
1888
|
+
declare function safeRedirect(url: string | null | undefined, fallbackUrl?: string): boolean;
|
|
1847
1889
|
|
|
1848
1890
|
/**
|
|
1849
1891
|
* Auth intent preservation — saves and restores the URL the user was on
|
|
@@ -2224,6 +2266,12 @@ declare function useFullScreenLoader(): FullScreenLoaderContextValue;
|
|
|
2224
2266
|
*/
|
|
2225
2267
|
interface SDKMessages {
|
|
2226
2268
|
security: {
|
|
2269
|
+
connectedAgentsTitle: string;
|
|
2270
|
+
connectedAgentsDescription: string;
|
|
2271
|
+
connectedAgentsDisconnect: string;
|
|
2272
|
+
connectedAgentsEmpty: string;
|
|
2273
|
+
connectedAgentsAccess: string;
|
|
2274
|
+
connectedAgentsGranted: string;
|
|
2227
2275
|
inactive: string;
|
|
2228
2276
|
inactiveHint: string;
|
|
2229
2277
|
passkeysTitle: string;
|
|
@@ -2285,6 +2333,8 @@ interface SDKMessages {
|
|
|
2285
2333
|
noPermissionTitle: string;
|
|
2286
2334
|
noPermissionDescription: string;
|
|
2287
2335
|
billingManageOnly: string;
|
|
2336
|
+
openSettings: string;
|
|
2337
|
+
back: string;
|
|
2288
2338
|
};
|
|
2289
2339
|
};
|
|
2290
2340
|
subscription: {
|
|
@@ -2728,6 +2778,7 @@ interface SDKMessages {
|
|
|
2728
2778
|
searchCurrency: string;
|
|
2729
2779
|
chooseTimezone: string;
|
|
2730
2780
|
searchTimezone: string;
|
|
2781
|
+
noResults: string;
|
|
2731
2782
|
};
|
|
2732
2783
|
push: {
|
|
2733
2784
|
failedToSubscribe: string;
|
|
@@ -2823,9 +2874,19 @@ interface SDKMessages {
|
|
|
2823
2874
|
}
|
|
2824
2875
|
/** Supported locale codes */
|
|
2825
2876
|
type SDKLocale = 'en' | 'es' | 'fr' | 'de' | 'ja' | 'zh' | 'hi' | 'ar';
|
|
2877
|
+
/** Recursively optional version of a message tree (leaves stay strings) */
|
|
2878
|
+
type DeepPartialMessages<T> = {
|
|
2879
|
+
[K in keyof T]?: T[K] extends string ? string : DeepPartialMessages<T[K]>;
|
|
2880
|
+
};
|
|
2881
|
+
/**
|
|
2882
|
+
* Per-key overrides for SDK UI strings — any subset of the SDKMessages tree.
|
|
2883
|
+
* Deep-merged over the active locale bundle by the translation provider.
|
|
2884
|
+
*/
|
|
2885
|
+
type PartialSDKMessages = DeepPartialMessages<SDKMessages>;
|
|
2826
2886
|
/**
|
|
2827
2887
|
* Generates a union of all valid dot-separated key paths from SDKMessages.
|
|
2828
|
-
* Supports up to
|
|
2888
|
+
* Supports up to 4 levels of nesting (covers all current keys, e.g.
|
|
2889
|
+
* "notifications.unblock.firefox.step1").
|
|
2829
2890
|
* Used to make `t()` calls compile-time safe with autocomplete.
|
|
2830
2891
|
*
|
|
2831
2892
|
* @example
|
|
@@ -2850,6 +2911,156 @@ type Level4 = {
|
|
|
2850
2911
|
/** Union of all valid translation key paths (e.g. "settings.titles.profile") */
|
|
2851
2912
|
type TranslationKey = Level2 | Level3 | Level4;
|
|
2852
2913
|
|
|
2914
|
+
/**
|
|
2915
|
+
* Settings screen identifiers — kept in a leaf module (no component imports)
|
|
2916
|
+
* so consumers of `SettingsScreen` don't pull the whole settings dialog
|
|
2917
|
+
* (and its 12 screens) into their bundle. The dialog itself is lazy-loaded.
|
|
2918
|
+
*/
|
|
2919
|
+
declare const SettingsScreen: {
|
|
2920
|
+
readonly Profile: "profile";
|
|
2921
|
+
readonly Security: "security";
|
|
2922
|
+
readonly ConnectedAgents: "connected-agents";
|
|
2923
|
+
readonly General: "general";
|
|
2924
|
+
readonly Users: "users";
|
|
2925
|
+
readonly Subscription: "subscription";
|
|
2926
|
+
readonly Usage: "usage";
|
|
2927
|
+
readonly Credits: "credits";
|
|
2928
|
+
readonly Features: "features";
|
|
2929
|
+
readonly Notifications: "notifications";
|
|
2930
|
+
readonly Permissions: "permissions";
|
|
2931
|
+
readonly Danger: "danger";
|
|
2932
|
+
};
|
|
2933
|
+
type WorkspaceSettingsSection = (typeof SettingsScreen)[keyof typeof SettingsScreen];
|
|
2934
|
+
/** Set of all valid section values — used for runtime validation */
|
|
2935
|
+
declare const SETTINGS_SCREENS: Set<WorkspaceSettingsSection>;
|
|
2936
|
+
|
|
2937
|
+
/**
|
|
2938
|
+
* Implementor-facing UI configuration for the SDK.
|
|
2939
|
+
*
|
|
2940
|
+
* Every option is additive and defaults to the current behavior, so the
|
|
2941
|
+
* config is never required. Visibility options can only HIDE UI — they
|
|
2942
|
+
* never bypass platform permissions, which remain the security floor.
|
|
2943
|
+
*/
|
|
2944
|
+
interface SDKUIConfig {
|
|
2945
|
+
/** Workspace settings dialog. */
|
|
2946
|
+
settings?: {
|
|
2947
|
+
/**
|
|
2948
|
+
* Show/hide sidebar sections of the workspace settings dialog.
|
|
2949
|
+
* Omitted sections stay visible. Hiding a section also prevents its
|
|
2950
|
+
* screen from rendering via deep links or `defaultSection`.
|
|
2951
|
+
*
|
|
2952
|
+
* @example
|
|
2953
|
+
* ```tsx
|
|
2954
|
+
* ui={{ settings: { sections: { credits: false, 'connected-agents': false } } }}
|
|
2955
|
+
* ```
|
|
2956
|
+
*/
|
|
2957
|
+
sections?: Partial<Record<WorkspaceSettingsSection, boolean>>;
|
|
2958
|
+
/** Profile screen — hide individual preference fields. */
|
|
2959
|
+
profile?: {
|
|
2960
|
+
language?: boolean;
|
|
2961
|
+
country?: boolean;
|
|
2962
|
+
currency?: boolean;
|
|
2963
|
+
timezone?: boolean;
|
|
2964
|
+
};
|
|
2965
|
+
/** Security screen — hide passkey row actions. */
|
|
2966
|
+
security?: {
|
|
2967
|
+
passkeyRename?: boolean;
|
|
2968
|
+
passkeyDelete?: boolean;
|
|
2969
|
+
};
|
|
2970
|
+
/** General screen — hide workspace editing affordances. */
|
|
2971
|
+
general?: {
|
|
2972
|
+
nameEdit?: boolean;
|
|
2973
|
+
iconEditor?: boolean;
|
|
2974
|
+
};
|
|
2975
|
+
/** Users screen — hide member-management affordances. */
|
|
2976
|
+
users?: {
|
|
2977
|
+
invite?: boolean;
|
|
2978
|
+
roleChange?: boolean;
|
|
2979
|
+
remove?: boolean;
|
|
2980
|
+
/** Seat usage / seat pricing block above the member list. */
|
|
2981
|
+
seatPricing?: boolean;
|
|
2982
|
+
};
|
|
2983
|
+
/** Subscription screen — hide billing actions. */
|
|
2984
|
+
subscription?: {
|
|
2985
|
+
changePlan?: boolean;
|
|
2986
|
+
cancel?: boolean;
|
|
2987
|
+
managePayment?: boolean;
|
|
2988
|
+
invoicesTab?: boolean;
|
|
2989
|
+
/** Expandable plan features/limits/quotas breakdown. */
|
|
2990
|
+
planDetails?: boolean;
|
|
2991
|
+
};
|
|
2992
|
+
/** Credits screen — hide purchase/history blocks. */
|
|
2993
|
+
credits?: {
|
|
2994
|
+
buyButton?: boolean;
|
|
2995
|
+
transactions?: boolean;
|
|
2996
|
+
};
|
|
2997
|
+
/** Notifications screen — hide the push block or preference columns. */
|
|
2998
|
+
notifications?: {
|
|
2999
|
+
/** Browser push-notification block (subscribe/unsubscribe). */
|
|
3000
|
+
push?: boolean;
|
|
3001
|
+
/** Per-event email preference column. */
|
|
3002
|
+
emailToggles?: boolean;
|
|
3003
|
+
/** Per-event push preference column. */
|
|
3004
|
+
pushToggles?: boolean;
|
|
3005
|
+
};
|
|
3006
|
+
};
|
|
3007
|
+
/** Workspace switcher dialog (client-side; ANDed with server settings). */
|
|
3008
|
+
workspaceSwitcher?: {
|
|
3009
|
+
/** Overrides `settings.workspace.showSwitcher` to hide the switcher UI. */
|
|
3010
|
+
show?: boolean;
|
|
3011
|
+
createButton?: boolean;
|
|
3012
|
+
/** Subscription plan badge on each workspace row. */
|
|
3013
|
+
planBadge?: boolean;
|
|
3014
|
+
memberCount?: boolean;
|
|
3015
|
+
};
|
|
3016
|
+
/** SDK behaviors that are currently automatic. */
|
|
3017
|
+
behavior?: {
|
|
3018
|
+
/**
|
|
3019
|
+
* Auto-open the plan picker dialog when a workspace has no
|
|
3020
|
+
* subscription. Default true (current behavior).
|
|
3021
|
+
*/
|
|
3022
|
+
autoOpenPlanDialog?: boolean;
|
|
3023
|
+
/** Default `daysThreshold` for `WhenTrialEnding` (default 3). */
|
|
3024
|
+
trialEndingDays?: number;
|
|
3025
|
+
};
|
|
3026
|
+
/**
|
|
3027
|
+
* Per-key overrides for SDK UI strings, deep-merged over the active
|
|
3028
|
+
* locale bundle. Use to rebrand terms (e.g. "Credits" → "Tokens")
|
|
3029
|
+
* without forking locale files.
|
|
3030
|
+
*
|
|
3031
|
+
* @example
|
|
3032
|
+
* ```tsx
|
|
3033
|
+
* ui={{ messages: { settings: { sidebar: { credits: 'Tokens' } } } }}
|
|
3034
|
+
* ```
|
|
3035
|
+
*/
|
|
3036
|
+
messages?: PartialSDKMessages;
|
|
3037
|
+
/**
|
|
3038
|
+
* Strings for the top-level error boundary's default fallback.
|
|
3039
|
+
* Plain strings (not i18n keys) — the boundary renders even when the
|
|
3040
|
+
* translation layer itself has crashed.
|
|
3041
|
+
*/
|
|
3042
|
+
errorBoundary?: {
|
|
3043
|
+
title?: string;
|
|
3044
|
+
retryLabel?: string;
|
|
3045
|
+
};
|
|
3046
|
+
/** Locale-aware formatting defaults. */
|
|
3047
|
+
formats?: {
|
|
3048
|
+
/**
|
|
3049
|
+
* Options for dates the SDK renders (passkey activity, connected agents,
|
|
3050
|
+
* etc.). Default: `{ dateStyle: 'medium' }`.
|
|
3051
|
+
*/
|
|
3052
|
+
date?: Intl.DateTimeFormatOptions;
|
|
3053
|
+
};
|
|
3054
|
+
}
|
|
3055
|
+
/** Access the implementor-provided UI config (empty object when unset). */
|
|
3056
|
+
declare function useUIConfig(): SDKUIConfig;
|
|
3057
|
+
/**
|
|
3058
|
+
* Deep-merge a per-instance UI config over a base (provider-global) one.
|
|
3059
|
+
* Instance leaves win; objects merge recursively. Used by components that
|
|
3060
|
+
* accept their own `ui` prop (e.g. WorkspaceSettingsDialog).
|
|
3061
|
+
*/
|
|
3062
|
+
declare function mergeUIConfig(base: SDKUIConfig, override?: SDKUIConfig): SDKUIConfig;
|
|
3063
|
+
|
|
2853
3064
|
/** Values that can be interpolated into ICU messages */
|
|
2854
3065
|
type TranslationValues = Record<string, string | number | boolean>;
|
|
2855
3066
|
/** All supported locale codes */
|
|
@@ -2885,7 +3096,7 @@ declare function useTranslation(): {
|
|
|
2885
3096
|
};
|
|
2886
3097
|
|
|
2887
3098
|
interface SaaSOSProviderProps extends IOsState {
|
|
2888
|
-
children:
|
|
3099
|
+
children: React__default.ReactNode;
|
|
2889
3100
|
/** SDK UI language. Defaults to 'en'. Supported: en, es, fr, de, ja, zh, hi, ar */
|
|
2890
3101
|
locale?: SDKLocale;
|
|
2891
3102
|
/**
|
|
@@ -2956,26 +3167,49 @@ interface SaaSOSProviderProps extends IOsState {
|
|
|
2956
3167
|
* >
|
|
2957
3168
|
* ```
|
|
2958
3169
|
*/
|
|
2959
|
-
loadingComponent?:
|
|
3170
|
+
loadingComponent?: React__default.ReactNode | ((props: LoadingProps) => React__default.ReactNode);
|
|
3171
|
+
/**
|
|
3172
|
+
* UI configuration — control which parts of the SDK UI are shown and
|
|
3173
|
+
* override individual UI strings. Everything defaults to visible/current
|
|
3174
|
+
* behavior; visibility options only hide UI and never bypass permissions.
|
|
3175
|
+
*
|
|
3176
|
+
* @example Hide settings sections and rebrand a label
|
|
3177
|
+
* ```tsx
|
|
3178
|
+
* <SaaSOSProvider
|
|
3179
|
+
* ui={{
|
|
3180
|
+
* settings: { sections: { credits: false, notifications: false } },
|
|
3181
|
+
* messages: { settings: { sidebar: { subscription: 'Billing' } } },
|
|
3182
|
+
* }}
|
|
3183
|
+
* >
|
|
3184
|
+
* ```
|
|
3185
|
+
*/
|
|
3186
|
+
ui?: SDKUIConfig;
|
|
2960
3187
|
}
|
|
2961
|
-
declare const SaaSOSProvider:
|
|
3188
|
+
declare const SaaSOSProvider: React__default.FC<SaaSOSProviderProps>;
|
|
2962
3189
|
|
|
2963
3190
|
interface IProps$2 {
|
|
2964
3191
|
children: React.ReactNode;
|
|
3192
|
+
/** Optional component/element to show while auth status is still loading. */
|
|
3193
|
+
loadingComponent?: React.ReactNode;
|
|
3194
|
+
/** Optional component/element to show when the condition is not met. */
|
|
3195
|
+
fallbackComponent?: React.ReactNode;
|
|
2965
3196
|
}
|
|
2966
3197
|
/**
|
|
2967
3198
|
* Conditional component that renders children only when user is authenticated.
|
|
2968
|
-
*
|
|
3199
|
+
* Optionally pass loadingComponent (while auth resolves) or fallbackComponent
|
|
3200
|
+
* (when unauthenticated) — both default to null, matching the other SDK gates.
|
|
2969
3201
|
*
|
|
2970
3202
|
* @param props - Component props
|
|
2971
3203
|
* @param props.children - Content to render when authenticated
|
|
3204
|
+
* @param props.loadingComponent - Optional content while auth status resolves
|
|
3205
|
+
* @param props.fallbackComponent - Optional content when not authenticated
|
|
2972
3206
|
*
|
|
2973
3207
|
* @example
|
|
2974
3208
|
* ```tsx
|
|
2975
3209
|
* function App() {
|
|
2976
3210
|
* return (
|
|
2977
3211
|
* <SaaSOSProvider {...config}>
|
|
2978
|
-
* <WhenAuthenticated>
|
|
3212
|
+
* <WhenAuthenticated loadingComponent={<Skeleton />}>
|
|
2979
3213
|
* <Dashboard />
|
|
2980
3214
|
* </WhenAuthenticated>
|
|
2981
3215
|
* <WhenUnauthenticated>
|
|
@@ -2987,16 +3221,19 @@ interface IProps$2 {
|
|
|
2987
3221
|
* ```
|
|
2988
3222
|
*/
|
|
2989
3223
|
declare const WhenAuthenticated: {
|
|
2990
|
-
(props: IProps$2):
|
|
3224
|
+
(props: IProps$2): React$1.ReactNode;
|
|
2991
3225
|
displayName: string;
|
|
2992
3226
|
};
|
|
2993
3227
|
/**
|
|
2994
3228
|
* Conditional component that renders children only when user is NOT authenticated.
|
|
2995
|
-
*
|
|
2996
|
-
*
|
|
3229
|
+
* Optionally pass loadingComponent (while auth resolves) or fallbackComponent
|
|
3230
|
+
* (when authenticated) — both default to null, matching the other SDK gates.
|
|
3231
|
+
* Note: without loadingComponent, nothing renders during loading/redirecting states.
|
|
2997
3232
|
*
|
|
2998
3233
|
* @param props - Component props
|
|
2999
3234
|
* @param props.children - Content to render when unauthenticated
|
|
3235
|
+
* @param props.loadingComponent - Optional content while auth status resolves
|
|
3236
|
+
* @param props.fallbackComponent - Optional content when authenticated
|
|
3000
3237
|
*
|
|
3001
3238
|
* @example
|
|
3002
3239
|
* ```tsx
|
|
@@ -3032,27 +3269,10 @@ declare const WhenAuthenticated: {
|
|
|
3032
3269
|
* ```
|
|
3033
3270
|
*/
|
|
3034
3271
|
declare const WhenUnauthenticated: {
|
|
3035
|
-
(props: IProps$2):
|
|
3272
|
+
(props: IProps$2): React$1.ReactNode;
|
|
3036
3273
|
displayName: string;
|
|
3037
3274
|
};
|
|
3038
3275
|
|
|
3039
|
-
declare const SettingsScreen: {
|
|
3040
|
-
readonly Profile: "profile";
|
|
3041
|
-
readonly Security: "security";
|
|
3042
|
-
readonly General: "general";
|
|
3043
|
-
readonly Users: "users";
|
|
3044
|
-
readonly Subscription: "subscription";
|
|
3045
|
-
readonly Usage: "usage";
|
|
3046
|
-
readonly Credits: "credits";
|
|
3047
|
-
readonly Features: "features";
|
|
3048
|
-
readonly Notifications: "notifications";
|
|
3049
|
-
readonly Permissions: "permissions";
|
|
3050
|
-
readonly Danger: "danger";
|
|
3051
|
-
};
|
|
3052
|
-
type WorkspaceSettingsSection = (typeof SettingsScreen)[keyof typeof SettingsScreen];
|
|
3053
|
-
/** Set of all valid section values — used for runtime validation */
|
|
3054
|
-
declare const SETTINGS_SCREENS: Set<WorkspaceSettingsSection>;
|
|
3055
|
-
|
|
3056
3276
|
declare function useSaaSAuth(): {
|
|
3057
3277
|
signIn: (returnUrl?: string) => Promise<void>;
|
|
3058
3278
|
signOut: () => Promise<void>;
|
|
@@ -3108,7 +3328,7 @@ interface IProps$1 {
|
|
|
3108
3328
|
* ```
|
|
3109
3329
|
*/
|
|
3110
3330
|
declare const WhenRoles: {
|
|
3111
|
-
(props: IProps$1):
|
|
3331
|
+
(props: IProps$1): React$1.ReactNode;
|
|
3112
3332
|
displayName: string;
|
|
3113
3333
|
};
|
|
3114
3334
|
/**
|
|
@@ -3147,7 +3367,7 @@ declare const WhenRoles: {
|
|
|
3147
3367
|
* ```
|
|
3148
3368
|
*/
|
|
3149
3369
|
declare const WhenWorkspaceRoles: {
|
|
3150
|
-
(props: IProps$1):
|
|
3370
|
+
(props: IProps$1): React$1.ReactNode;
|
|
3151
3371
|
displayName: string;
|
|
3152
3372
|
};
|
|
3153
3373
|
|
|
@@ -3178,7 +3398,7 @@ interface WhenPermissionProps {
|
|
|
3178
3398
|
* ```
|
|
3179
3399
|
*/
|
|
3180
3400
|
declare const WhenPermission: {
|
|
3181
|
-
(props: WhenPermissionProps):
|
|
3401
|
+
(props: WhenPermissionProps): React$1.ReactNode;
|
|
3182
3402
|
displayName: string;
|
|
3183
3403
|
};
|
|
3184
3404
|
|
|
@@ -3219,6 +3439,52 @@ declare function usePermissions(workspace?: WorkspaceLike | null): {
|
|
|
3219
3439
|
role: string | null;
|
|
3220
3440
|
};
|
|
3221
3441
|
|
|
3442
|
+
/** Memoized ConnectedAgentsApi instance. Recreates only when serverUrl/version change. */
|
|
3443
|
+
declare function useConnectedAgentsApi(): ConnectedAgentsApi;
|
|
3444
|
+
|
|
3445
|
+
interface UseConnectedAgents {
|
|
3446
|
+
/** The agents the current user has connected to their account. */
|
|
3447
|
+
agents: IConnectedAgent[];
|
|
3448
|
+
/** True while the initial list is loading. */
|
|
3449
|
+
loading: boolean;
|
|
3450
|
+
/** Error message from the last list/revoke, if any. */
|
|
3451
|
+
error: string | null;
|
|
3452
|
+
/** The clientId currently being disconnected, or null. */
|
|
3453
|
+
revoking: string | null;
|
|
3454
|
+
/** Re-fetch the list. */
|
|
3455
|
+
refresh: () => Promise<void>;
|
|
3456
|
+
/** Disconnect an agent, then optimistically drop it from the list. */
|
|
3457
|
+
revoke: (clientId: string) => Promise<void>;
|
|
3458
|
+
}
|
|
3459
|
+
/**
|
|
3460
|
+
* Headless data + actions for a "Connected agents" screen. Session-authed and
|
|
3461
|
+
* scoped to the signed-in user. Wrap your UI around it, or use the ready-made
|
|
3462
|
+
* `<ConnectedAgents />` component.
|
|
3463
|
+
*/
|
|
3464
|
+
declare function useConnectedAgents(): UseConnectedAgents;
|
|
3465
|
+
|
|
3466
|
+
interface ConnectedAgentsProps {
|
|
3467
|
+
/** Extra classes for the root element. */
|
|
3468
|
+
className?: string;
|
|
3469
|
+
/** Heading text. Defaults to the translated title; set to null to hide. */
|
|
3470
|
+
title?: string | null;
|
|
3471
|
+
/** Sub-heading under the title. Defaults to the translated description; set to null to hide. */
|
|
3472
|
+
description?: string | null;
|
|
3473
|
+
/** Label for the disconnect button. Defaults to the translated label. */
|
|
3474
|
+
disconnectLabel?: string;
|
|
3475
|
+
/** Text shown when the user has no connected agents. Defaults to the translated label. */
|
|
3476
|
+
emptyLabel?: string;
|
|
3477
|
+
}
|
|
3478
|
+
/**
|
|
3479
|
+
* A ready-made "Connected agents" screen: lists the AI agents the signed-in user
|
|
3480
|
+
* has authorized to access their account, with a per-row Disconnect action.
|
|
3481
|
+
* Session-authed and scoped to the current user — no config beyond having the
|
|
3482
|
+
* app wrapped in <SaaSOSProvider>.
|
|
3483
|
+
*
|
|
3484
|
+
* For a fully custom UI, use the `useConnectedAgents()` hook instead.
|
|
3485
|
+
*/
|
|
3486
|
+
declare function ConnectedAgents({ className, title, description, disconnectLabel, emptyLabel, }: ConnectedAgentsProps): react_jsx_runtime.JSX.Element;
|
|
3487
|
+
|
|
3222
3488
|
interface IProps {
|
|
3223
3489
|
slug: string;
|
|
3224
3490
|
children: React.ReactNode;
|
|
@@ -3260,7 +3526,7 @@ interface IProps {
|
|
|
3260
3526
|
* ```
|
|
3261
3527
|
*/
|
|
3262
3528
|
declare const WhenWorkspaceFeatureEnabled: {
|
|
3263
|
-
(props: IProps):
|
|
3529
|
+
(props: IProps): React$1.ReactNode;
|
|
3264
3530
|
displayName: string;
|
|
3265
3531
|
};
|
|
3266
3532
|
/**
|
|
@@ -3283,7 +3549,7 @@ declare const WhenWorkspaceFeatureEnabled: {
|
|
|
3283
3549
|
* ```
|
|
3284
3550
|
*/
|
|
3285
3551
|
declare const WhenWorkspaceFeatureDisabled: {
|
|
3286
|
-
(props: IProps):
|
|
3552
|
+
(props: IProps): React$1.ReactNode;
|
|
3287
3553
|
displayName: string;
|
|
3288
3554
|
};
|
|
3289
3555
|
/**
|
|
@@ -3322,7 +3588,7 @@ declare const WhenWorkspaceFeatureDisabled: {
|
|
|
3322
3588
|
* ```
|
|
3323
3589
|
*/
|
|
3324
3590
|
declare const WhenUserFeatureEnabled: {
|
|
3325
|
-
(props: IProps):
|
|
3591
|
+
(props: IProps): React$1.ReactNode;
|
|
3326
3592
|
displayName: string;
|
|
3327
3593
|
};
|
|
3328
3594
|
/**
|
|
@@ -3345,7 +3611,7 @@ declare const WhenUserFeatureEnabled: {
|
|
|
3345
3611
|
* ```
|
|
3346
3612
|
*/
|
|
3347
3613
|
declare const WhenUserFeatureDisabled: {
|
|
3348
|
-
(props: IProps):
|
|
3614
|
+
(props: IProps): React$1.ReactNode;
|
|
3349
3615
|
displayName: string;
|
|
3350
3616
|
};
|
|
3351
3617
|
|
|
@@ -3386,7 +3652,7 @@ interface IWhenSubscriptionProps {
|
|
|
3386
3652
|
* ```
|
|
3387
3653
|
*/
|
|
3388
3654
|
declare const WhenSubscription: {
|
|
3389
|
-
(props: IWhenSubscriptionProps):
|
|
3655
|
+
(props: IWhenSubscriptionProps): React$1.ReactNode;
|
|
3390
3656
|
displayName: string;
|
|
3391
3657
|
};
|
|
3392
3658
|
/**
|
|
@@ -3418,7 +3684,7 @@ declare const WhenSubscription: {
|
|
|
3418
3684
|
* ```
|
|
3419
3685
|
*/
|
|
3420
3686
|
declare const WhenNoSubscription: {
|
|
3421
|
-
(props: IWhenSubscriptionProps):
|
|
3687
|
+
(props: IWhenSubscriptionProps): React$1.ReactNode;
|
|
3422
3688
|
displayName: string;
|
|
3423
3689
|
};
|
|
3424
3690
|
interface IWhenSubscriptionToPlansProps {
|
|
@@ -3462,7 +3728,7 @@ interface IWhenSubscriptionToPlansProps {
|
|
|
3462
3728
|
* ```
|
|
3463
3729
|
*/
|
|
3464
3730
|
declare const WhenSubscriptionToPlans: {
|
|
3465
|
-
(props: IWhenSubscriptionToPlansProps):
|
|
3731
|
+
(props: IWhenSubscriptionToPlansProps): React$1.ReactNode;
|
|
3466
3732
|
displayName: string;
|
|
3467
3733
|
};
|
|
3468
3734
|
interface IWhenTrialingProps {
|
|
@@ -3485,7 +3751,7 @@ interface IWhenTrialingProps {
|
|
|
3485
3751
|
* ```
|
|
3486
3752
|
*/
|
|
3487
3753
|
declare const WhenTrialing: {
|
|
3488
|
-
(props: IWhenTrialingProps):
|
|
3754
|
+
(props: IWhenTrialingProps): React$1.ReactNode;
|
|
3489
3755
|
displayName: string;
|
|
3490
3756
|
};
|
|
3491
3757
|
/**
|
|
@@ -3501,7 +3767,7 @@ declare const WhenTrialing: {
|
|
|
3501
3767
|
* ```
|
|
3502
3768
|
*/
|
|
3503
3769
|
declare const WhenNotTrialing: {
|
|
3504
|
-
(props: IWhenTrialingProps):
|
|
3770
|
+
(props: IWhenTrialingProps): React$1.ReactNode;
|
|
3505
3771
|
displayName: string;
|
|
3506
3772
|
};
|
|
3507
3773
|
interface IWhenTrialEndingProps {
|
|
@@ -3511,12 +3777,16 @@ interface IWhenTrialEndingProps {
|
|
|
3511
3777
|
loadingComponent?: React.ReactNode;
|
|
3512
3778
|
/** Optional component/element to show when trial is not ending soon. */
|
|
3513
3779
|
fallbackComponent?: React.ReactNode;
|
|
3514
|
-
/**
|
|
3780
|
+
/**
|
|
3781
|
+
* Number of days threshold to consider "ending soon".
|
|
3782
|
+
* Defaults to `ui.behavior.trialEndingDays` from SaaSOSProvider, or 3.
|
|
3783
|
+
*/
|
|
3515
3784
|
daysThreshold?: number;
|
|
3516
3785
|
}
|
|
3517
3786
|
/**
|
|
3518
3787
|
* Renders children only when the subscription is trialing AND the trial ends within
|
|
3519
|
-
* the given threshold (default 3 days
|
|
3788
|
+
* the given threshold (default 3 days, configurable globally via
|
|
3789
|
+
* `ui.behavior.trialEndingDays`). Useful for showing urgent upgrade prompts.
|
|
3520
3790
|
* Must be used within SubscriptionContextProvider.
|
|
3521
3791
|
*
|
|
3522
3792
|
* @example
|
|
@@ -3527,7 +3797,7 @@ interface IWhenTrialEndingProps {
|
|
|
3527
3797
|
* ```
|
|
3528
3798
|
*/
|
|
3529
3799
|
declare const WhenTrialEnding: {
|
|
3530
|
-
(props: IWhenTrialEndingProps):
|
|
3800
|
+
(props: IWhenTrialEndingProps): React$1.ReactNode;
|
|
3531
3801
|
displayName: string;
|
|
3532
3802
|
};
|
|
3533
3803
|
|
|
@@ -3568,7 +3838,7 @@ interface IWhenQuotaThresholdProps extends IWhenQuotaProps {
|
|
|
3568
3838
|
* ```
|
|
3569
3839
|
*/
|
|
3570
3840
|
declare const WhenQuotaAvailable: {
|
|
3571
|
-
(props: IWhenQuotaProps):
|
|
3841
|
+
(props: IWhenQuotaProps): React$1.ReactNode;
|
|
3572
3842
|
displayName: string;
|
|
3573
3843
|
};
|
|
3574
3844
|
/**
|
|
@@ -3594,7 +3864,7 @@ declare const WhenQuotaAvailable: {
|
|
|
3594
3864
|
* ```
|
|
3595
3865
|
*/
|
|
3596
3866
|
declare const WhenQuotaExhausted: {
|
|
3597
|
-
(props: IWhenQuotaProps):
|
|
3867
|
+
(props: IWhenQuotaProps): React$1.ReactNode;
|
|
3598
3868
|
displayName: string;
|
|
3599
3869
|
};
|
|
3600
3870
|
/**
|
|
@@ -3620,7 +3890,7 @@ declare const WhenQuotaExhausted: {
|
|
|
3620
3890
|
* ```
|
|
3621
3891
|
*/
|
|
3622
3892
|
declare const WhenQuotaOverage: {
|
|
3623
|
-
(props: IWhenQuotaProps):
|
|
3893
|
+
(props: IWhenQuotaProps): React$1.ReactNode;
|
|
3624
3894
|
displayName: string;
|
|
3625
3895
|
};
|
|
3626
3896
|
/**
|
|
@@ -3648,7 +3918,7 @@ declare const WhenQuotaOverage: {
|
|
|
3648
3918
|
* ```
|
|
3649
3919
|
*/
|
|
3650
3920
|
declare const WhenQuotaThreshold: {
|
|
3651
|
-
(props: IWhenQuotaThresholdProps):
|
|
3921
|
+
(props: IWhenQuotaThresholdProps): React$1.ReactNode;
|
|
3652
3922
|
displayName: string;
|
|
3653
3923
|
};
|
|
3654
3924
|
|
|
@@ -3725,7 +3995,7 @@ interface CreditActionsProviderProps {
|
|
|
3725
3995
|
* ```
|
|
3726
3996
|
*/
|
|
3727
3997
|
declare const CreditActionsProvider: {
|
|
3728
|
-
({ children }: CreditActionsProviderProps):
|
|
3998
|
+
({ children }: CreditActionsProviderProps): React$1.ReactNode;
|
|
3729
3999
|
displayName: string;
|
|
3730
4000
|
};
|
|
3731
4001
|
|
|
@@ -3771,7 +4041,7 @@ interface CreditBalanceProps {
|
|
|
3771
4041
|
* ```
|
|
3772
4042
|
*/
|
|
3773
4043
|
declare const CreditBalance: {
|
|
3774
|
-
({ children }: CreditBalanceProps):
|
|
4044
|
+
({ children }: CreditBalanceProps): React$1.ReactNode;
|
|
3775
4045
|
displayName: string;
|
|
3776
4046
|
};
|
|
3777
4047
|
|
|
@@ -3883,7 +4153,7 @@ interface IWhenCreditsLowProps extends IWhenCreditsProps {
|
|
|
3883
4153
|
* ```
|
|
3884
4154
|
*/
|
|
3885
4155
|
declare const WhenCreditsAvailable: {
|
|
3886
|
-
(props: IWhenCreditsAvailableProps):
|
|
4156
|
+
(props: IWhenCreditsAvailableProps): React$1.ReactNode;
|
|
3887
4157
|
displayName: string;
|
|
3888
4158
|
};
|
|
3889
4159
|
/**
|
|
@@ -3908,7 +4178,7 @@ declare const WhenCreditsAvailable: {
|
|
|
3908
4178
|
* ```
|
|
3909
4179
|
*/
|
|
3910
4180
|
declare const WhenCreditsExhausted: {
|
|
3911
|
-
(props: IWhenCreditsProps):
|
|
4181
|
+
(props: IWhenCreditsProps): React$1.ReactNode;
|
|
3912
4182
|
displayName: string;
|
|
3913
4183
|
};
|
|
3914
4184
|
/**
|
|
@@ -3934,7 +4204,7 @@ declare const WhenCreditsExhausted: {
|
|
|
3934
4204
|
* ```
|
|
3935
4205
|
*/
|
|
3936
4206
|
declare const WhenCreditsLow: {
|
|
3937
|
-
(props: IWhenCreditsLowProps):
|
|
4207
|
+
(props: IWhenCreditsLowProps): React$1.ReactNode;
|
|
3938
4208
|
displayName: string;
|
|
3939
4209
|
};
|
|
3940
4210
|
|
|
@@ -3962,7 +4232,7 @@ interface SubscriptionContextValue {
|
|
|
3962
4232
|
* @param props.children - React tree that may use subscription gates or useSubscriptionContext
|
|
3963
4233
|
* @returns Provider element that supplies subscription context to descendants
|
|
3964
4234
|
*/
|
|
3965
|
-
declare const SubscriptionContextProvider:
|
|
4235
|
+
declare const SubscriptionContextProvider: React__default.FC<{
|
|
3966
4236
|
children: ReactNode;
|
|
3967
4237
|
}>;
|
|
3968
4238
|
/**
|
|
@@ -3997,7 +4267,7 @@ interface QuotaUsageContextValue {
|
|
|
3997
4267
|
* @param props.children - React tree that may use quota gates or useQuotaUsageContext
|
|
3998
4268
|
* @returns Provider element that supplies quota usage context to descendants
|
|
3999
4269
|
*/
|
|
4000
|
-
declare const QuotaUsageContextProvider:
|
|
4270
|
+
declare const QuotaUsageContextProvider: React__default.FC<{
|
|
4001
4271
|
children: ReactNode;
|
|
4002
4272
|
}>;
|
|
4003
4273
|
/**
|
|
@@ -4025,7 +4295,7 @@ interface CreditBalanceContextValue {
|
|
|
4025
4295
|
* (e.g. after consume or purchase).
|
|
4026
4296
|
* Included in SaaSOSProvider by default.
|
|
4027
4297
|
*/
|
|
4028
|
-
declare const CreditBalanceContextProvider:
|
|
4298
|
+
declare const CreditBalanceContextProvider: React__default.FC<{
|
|
4029
4299
|
children: ReactNode;
|
|
4030
4300
|
}>;
|
|
4031
4301
|
/**
|
|
@@ -5286,7 +5556,7 @@ interface BetaFormProps {
|
|
|
5286
5556
|
hideLogo?: boolean;
|
|
5287
5557
|
hideTitles?: boolean;
|
|
5288
5558
|
}
|
|
5289
|
-
declare const BetaForm:
|
|
5559
|
+
declare const BetaForm: React__default.FC<BetaFormProps>;
|
|
5290
5560
|
|
|
5291
5561
|
interface PricingPageDetails {
|
|
5292
5562
|
/** Whether plan data is being fetched */
|
|
@@ -5358,9 +5628,27 @@ interface PricingPageProps {
|
|
|
5358
5628
|
*/
|
|
5359
5629
|
declare function PricingPage({ slug, children, loadingFallback, errorFallback, redirectBaseUrl, }: PricingPageProps): react_jsx_runtime.JSX.Element;
|
|
5360
5630
|
|
|
5631
|
+
interface EmptyStateProps {
|
|
5632
|
+
/** Icon shown above the text, e.g. `<KeyRound className="h-5 w-5 text-muted-foreground" />` */
|
|
5633
|
+
icon?: React$1.ReactNode;
|
|
5634
|
+
/** Short headline. Optional — many empty states only need a description. */
|
|
5635
|
+
title?: string;
|
|
5636
|
+
/** Muted explanatory text. */
|
|
5637
|
+
description?: string;
|
|
5638
|
+
/** Optional call-to-action rendered under the text (e.g. a Button). */
|
|
5639
|
+
action?: React$1.ReactNode;
|
|
5640
|
+
className?: string;
|
|
5641
|
+
}
|
|
5642
|
+
/**
|
|
5643
|
+
* Standard empty-list placeholder: dashed border card with a centered icon,
|
|
5644
|
+
* muted text and an optional action. Use for every "nothing here yet" state
|
|
5645
|
+
* so all screens share the same look.
|
|
5646
|
+
*/
|
|
5647
|
+
declare function EmptyState({ icon, title, description, action, className }: EmptyStateProps): react_jsx_runtime.JSX.Element;
|
|
5648
|
+
|
|
5361
5649
|
interface FullScreenLoaderProps {
|
|
5362
5650
|
/** Content to display centered on screen. Falls back to a default spinner + message. */
|
|
5363
|
-
children?:
|
|
5651
|
+
children?: React__default.ReactNode;
|
|
5364
5652
|
/** Message shown below the default spinner (only used when no children are provided). Defaults to "Loading..." */
|
|
5365
5653
|
message?: string;
|
|
5366
5654
|
/** Background color of the overlay. Defaults to white (dark mode: near-black). */
|
|
@@ -5389,6 +5677,84 @@ declare const FullScreenLoader: {
|
|
|
5389
5677
|
displayName: string;
|
|
5390
5678
|
};
|
|
5391
5679
|
|
|
5680
|
+
interface LoadingStateProps {
|
|
5681
|
+
/** Text next to the spinner. Defaults to the translated "Loading…". */
|
|
5682
|
+
label?: string;
|
|
5683
|
+
className?: string;
|
|
5684
|
+
}
|
|
5685
|
+
/**
|
|
5686
|
+
* Standard inline loading box: gray bordered bar with a spinner and label.
|
|
5687
|
+
* Use for in-place refreshes where a skeleton would be too heavy;
|
|
5688
|
+
* use `Skeleton`/`SettingSkeleton` for initial screen loads.
|
|
5689
|
+
*/
|
|
5690
|
+
declare function LoadingState({ label, className }: LoadingStateProps): react_jsx_runtime.JSX.Element;
|
|
5691
|
+
|
|
5692
|
+
interface SectionHeaderProps {
|
|
5693
|
+
/** Section title. Pass null to hide (e.g. when a parent already renders it). */
|
|
5694
|
+
title?: string | null;
|
|
5695
|
+
/** Muted description under the title. */
|
|
5696
|
+
description?: string | null;
|
|
5697
|
+
/** Optional element aligned to the end of the title row (e.g. a badge or button). */
|
|
5698
|
+
actions?: React$1.ReactNode;
|
|
5699
|
+
className?: string;
|
|
5700
|
+
/** Extra classes for the title, e.g. `text-destructive` for danger sections. */
|
|
5701
|
+
titleClassName?: string;
|
|
5702
|
+
}
|
|
5703
|
+
/**
|
|
5704
|
+
* Standard section heading used across settings screens:
|
|
5705
|
+
* `h3 text-sm font-medium` title + muted `text-sm` description.
|
|
5706
|
+
* Renders nothing when both title and description are empty.
|
|
5707
|
+
*/
|
|
5708
|
+
declare function SectionHeader({ title, description, actions, className, titleClassName, }: SectionHeaderProps): react_jsx_runtime.JSX.Element | null;
|
|
5709
|
+
|
|
5710
|
+
interface SidebarNavSectionProps {
|
|
5711
|
+
/** Uppercase group label shown above the items. */
|
|
5712
|
+
title: string;
|
|
5713
|
+
children: React$1.ReactNode;
|
|
5714
|
+
className?: string;
|
|
5715
|
+
}
|
|
5716
|
+
/** Labeled group of sidebar items. */
|
|
5717
|
+
declare function SidebarNavSection({ title, children, className }: SidebarNavSectionProps): react_jsx_runtime.JSX.Element;
|
|
5718
|
+
interface SidebarNavItemProps {
|
|
5719
|
+
/** Leading icon, e.g. `<UserIcon className="h-3.5 w-3.5" />` */
|
|
5720
|
+
icon?: React$1.ReactNode;
|
|
5721
|
+
label: string;
|
|
5722
|
+
/** Highlights the item as the current selection. */
|
|
5723
|
+
active?: boolean;
|
|
5724
|
+
onClick?: () => void;
|
|
5725
|
+
className?: string;
|
|
5726
|
+
}
|
|
5727
|
+
/**
|
|
5728
|
+
* Single sidebar navigation entry with the standard active/hover styling.
|
|
5729
|
+
* Mobile-friendly by default: comfortable ~44px touch target and a trailing
|
|
5730
|
+
* chevron affordance below the `sm` breakpoint; compact rows on desktop.
|
|
5731
|
+
*/
|
|
5732
|
+
declare function SidebarNavItem({ icon, label, active, onClick, className }: SidebarNavItemProps): react_jsx_runtime.JSX.Element;
|
|
5733
|
+
|
|
5734
|
+
type StatusBannerVariant = 'error' | 'success' | 'warning' | 'info';
|
|
5735
|
+
interface StatusBannerProps {
|
|
5736
|
+
variant: StatusBannerVariant;
|
|
5737
|
+
/** Bold first line, e.g. "Error loading subscription data". */
|
|
5738
|
+
title?: string;
|
|
5739
|
+
/** Body text under the title (or standalone when there is no title). */
|
|
5740
|
+
message?: string;
|
|
5741
|
+
/** Small hint line under the message, e.g. "Retrying may resolve this." */
|
|
5742
|
+
description?: string;
|
|
5743
|
+
/** Optional leading icon, e.g. `<CheckCircle2 className="h-4 w-4 shrink-0" />`. */
|
|
5744
|
+
icon?: React$1.ReactNode;
|
|
5745
|
+
/** Label for the action button (Retry, Dismiss, …). Button renders only when set. */
|
|
5746
|
+
actionLabel?: string;
|
|
5747
|
+
onAction?: () => void;
|
|
5748
|
+
actionDisabled?: boolean;
|
|
5749
|
+
className?: string;
|
|
5750
|
+
}
|
|
5751
|
+
/**
|
|
5752
|
+
* Standard status banner for error / success / warning / info feedback,
|
|
5753
|
+
* with an optional Retry/Dismiss action. Use for every inline status box
|
|
5754
|
+
* so all screens share the same look.
|
|
5755
|
+
*/
|
|
5756
|
+
declare function StatusBanner({ variant, title, message, description, icon, actionLabel, onAction, actionDisabled, className, }: StatusBannerProps): react_jsx_runtime.JSX.Element;
|
|
5757
|
+
|
|
5392
5758
|
declare function WorkspaceSwitcher(props: {
|
|
5393
5759
|
trigger: (isLoading: boolean, currentWorkspace: IWorkspace | null) => ReactNode;
|
|
5394
5760
|
}): react_jsx_runtime.JSX.Element;
|
|
@@ -5414,19 +5780,43 @@ interface PushNotificationContextValue extends PushNotificationState {
|
|
|
5414
5780
|
unsubscribe: () => Promise<void>;
|
|
5415
5781
|
}
|
|
5416
5782
|
interface PushNotificationProviderProps {
|
|
5417
|
-
children:
|
|
5783
|
+
children: React__default.ReactNode;
|
|
5418
5784
|
/** Path to the service worker file (default: '/push-sw.js') */
|
|
5419
5785
|
serviceWorkerPath?: string;
|
|
5420
5786
|
/** Automatically subscribe after permission is granted on login (default: false) */
|
|
5421
5787
|
autoSubscribe?: boolean;
|
|
5422
5788
|
}
|
|
5423
|
-
declare const PushNotificationProvider:
|
|
5789
|
+
declare const PushNotificationProvider: React__default.FC<PushNotificationProviderProps>;
|
|
5424
5790
|
/**
|
|
5425
5791
|
* Hook to access push notification state and actions.
|
|
5426
5792
|
* Must be used within PushNotificationProvider (included in SaaSOSProvider when push config is provided).
|
|
5427
5793
|
*/
|
|
5428
5794
|
declare function usePushNotifications(): PushNotificationContextValue;
|
|
5429
5795
|
|
|
5796
|
+
/**
|
|
5797
|
+
* Single-call visibility decisions combining the implementor's `ui` config
|
|
5798
|
+
* with platform permissions.
|
|
5799
|
+
*
|
|
5800
|
+
* A piece of UI is visible when its config flag is not explicitly `false`
|
|
5801
|
+
* AND the optional permission check passes. Config can only hide UI —
|
|
5802
|
+
* permissions remain the security floor.
|
|
5803
|
+
*
|
|
5804
|
+
* @example
|
|
5805
|
+
* ```tsx
|
|
5806
|
+
* const { visible } = useUIVisibility();
|
|
5807
|
+
*
|
|
5808
|
+
* // Config flag only
|
|
5809
|
+
* visible(ui => ui.settings?.credits?.buyButton)
|
|
5810
|
+
*
|
|
5811
|
+
* // Config flag AND permission — one line decides show/hide
|
|
5812
|
+
* visible(ui => ui.settings?.sections?.users, Permission.WORKSPACE_MEMBERS_VIEW)
|
|
5813
|
+
* ```
|
|
5814
|
+
*/
|
|
5815
|
+
declare function useUIVisibility(): {
|
|
5816
|
+
visible: (select: (ui: SDKUIConfig) => boolean | undefined, permission?: string | string[]) => boolean;
|
|
5817
|
+
ui: SDKUIConfig;
|
|
5818
|
+
};
|
|
5819
|
+
|
|
5430
5820
|
interface SettingsManagerState {
|
|
5431
5821
|
open: boolean;
|
|
5432
5822
|
section: WorkspaceSettingsSection;
|
|
@@ -5470,5 +5860,5 @@ declare class WorkspaceSettingsManager {
|
|
|
5470
5860
|
}
|
|
5471
5861
|
declare const workspaceSettingsManager: WorkspaceSettingsManager;
|
|
5472
5862
|
|
|
5473
|
-
export { ApiVersion, AuthApi, AuthStatus, BBAction, BBScreen, BBStatus, BB_PARAM, BaseApi, BetaForm, BillingIntervals, CURRENCY_DISPLAY, CURRENCY_FLAG, CreditActionsProvider, CreditBalance, CreditBalanceContextProvider, CreditBucketSource, CreditBucketStatus, CreditStorePage, CreditTransactionType, DEFAULT_ROLE_PERMISSIONS, DunningState, EventEmitter, FullScreenLoader, InvoiceStatuses, PLAN_CURRENCY_CODES, PLAN_CURRENCY_OPTIONS, PUSH_SERVICE_WORKER_SCRIPT, Permission, PricingPage, PushApi, PushNotificationProvider, QuotaUsageContextProvider, SDKEvent, SETTINGS_SCREENS, SUPPORTED_LOCALES, SaaSOSProvider, SettingsApi, SettingsScreen, SubscriptionContextProvider, SubscriptionItemType, SubscriptionStatus, UserApi, WhenAuthenticated, WhenCreditsAvailable, WhenCreditsExhausted, WhenCreditsLow, WhenNoSubscription, WhenNotTrialing, WhenPermission, WhenQuotaAvailable, WhenQuotaExhausted, WhenQuotaOverage, WhenQuotaThreshold, WhenRoles, WhenSubscription, WhenSubscriptionToPlans, WhenTrialEnding, WhenTrialing, WhenUnauthenticated, WhenUserFeatureDisabled, WhenUserFeatureEnabled, WhenWorkspaceFeatureDisabled, WhenWorkspaceFeatureEnabled, WhenWorkspaceRoles, WorkspaceApi, WorkspaceSwitcher, calculateBillableSeats, calculateSeatOverageCents, calculateTotalSubscriptionCents, cleanBBParams, clearAuthIntent, consumeAuthIntent, createBBUrl, createCheckoutRedirectUrls, createCreditPurchaseRedirectUrls, eventEmitter, formatCents, formatOverageRate, formatOverageRateWithLabel, formatQuotaIncludedOverage, formatQuotaWithPrice, getAvailableCurrenciesFromPlans, getBasePriceCents, getBillingIntervalAndCurrencyFromPriceId, getCurrencyFlag, getCurrencySymbol, getDisplayCurrency, getPerSeatPriceCents, getPricingVariant, getQuotaDisplayValue, getQuotaDisplayWithVariant, getQuotaOverageCents, getQuotaUnitLabelFromName, getSeatPricing, getStripePriceIdForInterval, hasPermission, invalidateCreditBalance, invalidateQuotaUsage, invalidateSubscription, readBBParams, resolveMaxUsers, resolvePermissions, safeRedirect, saveAuthIntent, useAllQuotaUsage, useBillingPortal, useCancelSubscription, useConsumeCredits, useCreateCheckoutSession, useCreditBalance, useCreditBalanceContext, useCreditPackages, useCreditTransactions, useExpiringCredits, useFullScreenLoader, useInvoice, useInvoices, usePermissions, usePlanGroup, usePlanGroupVersions, usePublicCreditPackages, usePublicPlanGroupVersion, usePublicPlans, usePurchaseCredits, usePushNotifications, useQuotaUsageContext, useQuotaUsageStatus, useRecordUsage, useResumeSubscription, useSaaSAuth, useSaaSOs, useSaaSSettings, useSaaSWorkspaces, useSeatStatus, useSubscription, useSubscriptionContext, useSubscriptionManagement, useTranslation, useTrialStatus, useUpdateSubscription, useUsageLogs, useUserAttributes, useUserFeatures, validateInvite, validateRedirectUrl, workspaceSettingsManager };
|
|
5474
|
-
export type { BBActionType, BBScreenType, BBStatusType, BetaFormData, BetaFormResponse, BillingInterval, CheckoutResult, CreditActionsDetails, CreditBalanceContextValue, CreditBalanceDetails, CreditBucketSourceType, CreditBucketStatusType, CreditStorePageDetails, CreditTransactionTypeValue, DunningStateType, EventData, EventType, FormatQuotaWithPriceOptions, FullScreenLoaderProps, GetCheckoutStripeParams, IAllQuotaUsageResponse, IBaseApiConfig, IBasePricing, IBetaConfig, ICheckoutSessionRequest, ICheckoutSessionResponse, ICheckoutStripeOptions, IConsumeCreditsRequest, IConsumeCreditsResponse, ICreditBalance, ICreditBucket, ICreditBucketsQuery, ICreditBucketsResponse, ICreditPackage, ICreditPackagePricingVariant, ICreditPurchaseRequest, ICreditPurchaseResponse, ICreditTransaction, ICreditTransactionsQuery, ICreditTransactionsResponse, IEventCallbacks, IExpiringCreditsResponse, IInvoice, IInvoiceListResponse, IInvoiceResponse, IOsConfig, IOsState, IPlan, IPlanGroup, IPlanGroupInfo, IPlanGroupLatestVersion, IPlanGroupResponse, IPlanGroupVersion, IPlanGroupVersionWithPlans, IPlanGroupVersionsResponse, IPlanVersion, IPlanVersionSummary, IPlanVersionWithPlan, IPricingVariant, IPublicCreditPackage, IPublicCreditPackagesResponse, IPublicPlanItem, IPublicPlanItemCategory, IPublicPlanVersion, IPublicPlansResponse, IQuotaByInterval, IQuotaIntervalValue, IQuotaOveragePriceIdsByInterval, IQuotaOveragesByInterval, IQuotaUsageStatus, IQuotaUsageStatusResponse, IRecordUsageRequest, IRecordUsageResponse, IStripePricesByInterval, ISubscription, ISubscriptionItem, ISubscriptionResponse, ISubscriptionUpdateRequest, ISubscriptionUpdateResponse, IUsageLogEntry, IUsageLogsQuery, IUsageLogsResponse, InviteBlockReason, InviteValidation, InvoiceStatus, InvoiceStatusType, LoadingProps, MaxUsersConfig, NotificationData, NotificationEvent, NotificationResult, OnWorkspaceChangeParams, PermissionContext, PermissionKey, PlanVersionWithPricingVariants, PricingPageDetails, PricingPageProps, QuotaDisplayValue, QuotaDisplayWithOverage, QuotaUsageContextValue, RolePermissionMap, SDKLocale, SDKMessages, SaaSOSProviderProps, SeatStatus, SettingsManagerState, SubscriptionContextValue, SubscriptionItemTypeValue, SubscriptionStatusType, TrialStatus, UserCreatedEventData, UserUpdatedEventData, WorkspaceChangedEventData, WorkspaceCreatedEventData, WorkspaceDeletedEventData, WorkspaceSettingsSection, WorkspaceUpdatedEventData, WorkspaceUserAddedEventData, WorkspaceUserRemovedEventData, WorkspaceUserRoleChangedEventData };
|
|
5863
|
+
export { ApiVersion, AuthApi, AuthStatus, BBAction, BBScreen, BBStatus, BB_PARAM, BaseApi, BetaForm, BillingIntervals, CURRENCY_DISPLAY, CURRENCY_FLAG, ConnectedAgents, ConnectedAgentsApi, CreditActionsProvider, CreditBalance, CreditBalanceContextProvider, CreditBucketSource, CreditBucketStatus, CreditStorePage, CreditTransactionType, DEFAULT_ROLE_PERMISSIONS, DunningState, EmptyState, EventEmitter, FullScreenLoader, InvoiceStatuses, LoadingState, PLAN_CURRENCY_CODES, PLAN_CURRENCY_OPTIONS, PUSH_SERVICE_WORKER_SCRIPT, Permission, PricingPage, PushApi, PushNotificationProvider, QuotaUsageContextProvider, SDKEvent, SETTINGS_SCREENS, SUPPORTED_LOCALES, SaaSOSProvider, SectionHeader, SettingsApi, SettingsScreen, SidebarNavItem, SidebarNavSection, StatusBanner, SubscriptionContextProvider, SubscriptionItemType, SubscriptionStatus, UserApi, WhenAuthenticated, WhenCreditsAvailable, WhenCreditsExhausted, WhenCreditsLow, WhenNoSubscription, WhenNotTrialing, WhenPermission, WhenQuotaAvailable, WhenQuotaExhausted, WhenQuotaOverage, WhenQuotaThreshold, WhenRoles, WhenSubscription, WhenSubscriptionToPlans, WhenTrialEnding, WhenTrialing, WhenUnauthenticated, WhenUserFeatureDisabled, WhenUserFeatureEnabled, WhenWorkspaceFeatureDisabled, WhenWorkspaceFeatureEnabled, WhenWorkspaceRoles, WorkspaceApi, WorkspaceSwitcher, calculateBillableSeats, calculateSeatOverageCents, calculateTotalSubscriptionCents, cleanBBParams, clearAuthIntent, consumeAuthIntent, createBBUrl, createCheckoutRedirectUrls, createCreditPurchaseRedirectUrls, eventEmitter, formatCents, formatOverageRate, formatOverageRateWithLabel, formatQuotaIncludedOverage, formatQuotaWithPrice, getAvailableCurrenciesFromPlans, getBasePriceCents, getBillingIntervalAndCurrencyFromPriceId, getCurrencyFlag, getCurrencySymbol, getDisplayCurrency, getPerSeatPriceCents, getPricingVariant, getQuotaDisplayValue, getQuotaDisplayWithVariant, getQuotaOverageCents, getQuotaUnitLabelFromName, getSeatPricing, getStripePriceIdForInterval, hasPermission, invalidateCreditBalance, invalidateQuotaUsage, invalidateSubscription, mergeUIConfig, readBBParams, resolveMaxUsers, resolvePermissions, safeRedirect, saveAuthIntent, useAllQuotaUsage, useBillingPortal, useCancelSubscription, useConnectedAgents, useConnectedAgentsApi, useConsumeCredits, useCreateCheckoutSession, useCreditBalance, useCreditBalanceContext, useCreditPackages, useCreditTransactions, useExpiringCredits, useFullScreenLoader, useInvoice, useInvoices, usePermissions, usePlanGroup, usePlanGroupVersions, usePublicCreditPackages, usePublicPlanGroupVersion, usePublicPlans, usePurchaseCredits, usePushNotifications, useQuotaUsageContext, useQuotaUsageStatus, useRecordUsage, useResumeSubscription, useSaaSAuth, useSaaSOs, useSaaSSettings, useSaaSWorkspaces, useSeatStatus, useSubscription, useSubscriptionContext, useSubscriptionManagement, useTranslation, useTrialStatus, useUIConfig, useUIVisibility, useUpdateSubscription, useUsageLogs, useUserAttributes, useUserFeatures, validateInvite, validateRedirectUrl, workspaceSettingsManager };
|
|
5864
|
+
export type { BBActionType, BBScreenType, BBStatusType, BetaFormData, BetaFormResponse, BillingInterval, CheckoutResult, ConnectedAgentsProps, CreditActionsDetails, CreditBalanceContextValue, CreditBalanceDetails, CreditBucketSourceType, CreditBucketStatusType, CreditStorePageDetails, CreditTransactionTypeValue, DunningStateType, EmptyStateProps, EventData, EventType, FormatQuotaWithPriceOptions, FullScreenLoaderProps, GetCheckoutStripeParams, IAllQuotaUsageResponse, IBaseApiConfig, IBasePricing, IBetaConfig, ICheckoutSessionRequest, ICheckoutSessionResponse, ICheckoutStripeOptions, IConnectedAgent, IConsumeCreditsRequest, IConsumeCreditsResponse, ICreditBalance, ICreditBucket, ICreditBucketsQuery, ICreditBucketsResponse, ICreditPackage, ICreditPackagePricingVariant, ICreditPurchaseRequest, ICreditPurchaseResponse, ICreditTransaction, ICreditTransactionsQuery, ICreditTransactionsResponse, IEventCallbacks, IExpiringCreditsResponse, IInvoice, IInvoiceListResponse, IInvoiceResponse, IOsConfig, IOsState, IPlan, IPlanGroup, IPlanGroupInfo, IPlanGroupLatestVersion, IPlanGroupResponse, IPlanGroupVersion, IPlanGroupVersionWithPlans, IPlanGroupVersionsResponse, IPlanVersion, IPlanVersionSummary, IPlanVersionWithPlan, IPricingVariant, IPublicCreditPackage, IPublicCreditPackagesResponse, IPublicPlanItem, IPublicPlanItemCategory, IPublicPlanVersion, IPublicPlansResponse, IQuotaByInterval, IQuotaIntervalValue, IQuotaOveragePriceIdsByInterval, IQuotaOveragesByInterval, IQuotaUsageStatus, IQuotaUsageStatusResponse, IRecordUsageRequest, IRecordUsageResponse, IStripePricesByInterval, ISubscription, ISubscriptionItem, ISubscriptionResponse, ISubscriptionUpdateRequest, ISubscriptionUpdateResponse, IUsageLogEntry, IUsageLogsQuery, IUsageLogsResponse, InviteBlockReason, InviteValidation, InvoiceStatus, InvoiceStatusType, LoadingProps, LoadingStateProps, MaxUsersConfig, NotificationData, NotificationEvent, NotificationResult, OnWorkspaceChangeParams, PartialSDKMessages, PermissionContext, PermissionKey, PlanVersionWithPricingVariants, PricingPageDetails, PricingPageProps, QuotaDisplayValue, QuotaDisplayWithOverage, QuotaUsageContextValue, RolePermissionMap, SDKLocale, SDKMessages, SDKUIConfig, SaaSOSProviderProps, SeatStatus, SectionHeaderProps, SettingsManagerState, SidebarNavItemProps, SidebarNavSectionProps, StatusBannerProps, StatusBannerVariant, SubscriptionContextValue, SubscriptionItemTypeValue, SubscriptionStatusType, TrialStatus, UseConnectedAgents, UserCreatedEventData, UserUpdatedEventData, WorkspaceChangedEventData, WorkspaceCreatedEventData, WorkspaceDeletedEventData, WorkspaceSettingsSection, WorkspaceUpdatedEventData, WorkspaceUserAddedEventData, WorkspaceUserRemovedEventData, WorkspaceUserRoleChangedEventData };
|