@buildbase/sdk 0.0.50 → 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 +102 -18
- package/dist/css/styles.css +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +9 -0
- 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 -1
- package/dist/react/index.d.ts +446 -62
- package/dist/react/index.mjs +1 -1
- package/package.json +7 -3
- package/dist/react/chunks/SubscriptionDialog-A6oETKbb.cjs +0 -2
- package/dist/react/chunks/SubscriptionDialog-nuMunBn4.mjs +0 -2
- package/dist/react/chunks/ar-BRvKHRYS.cjs +0 -2
- package/dist/react/chunks/ar-IhPhJAZA.mjs +0 -2
- package/dist/react/chunks/de-D3q0vQBG.cjs +0 -2
- package/dist/react/chunks/de-bvh5IFSx.mjs +0 -2
- package/dist/react/chunks/es-B9kiwJmF.cjs +0 -2
- package/dist/react/chunks/es-TyUz4_E1.mjs +0 -2
- package/dist/react/chunks/fr-C500Ytao.cjs +0 -2
- package/dist/react/chunks/fr-CKm-bSvG.mjs +0 -2
- package/dist/react/chunks/hi-CfFhH2uQ.cjs +0 -2
- package/dist/react/chunks/hi-Ck9cPpd-.mjs +0 -2
- package/dist/react/chunks/ja-AM4H1tXw.mjs +0 -2
- package/dist/react/chunks/ja-DfROrx_j.cjs +0 -2
- package/dist/react/chunks/react-CTX0_nOV.cjs +0 -2
- package/dist/react/chunks/react-DzQupoqH.mjs +0 -2
- package/dist/react/chunks/zh-CLmBh-it.cjs +0 -2
- package/dist/react/chunks/zh-DCVPxie-.mjs +0 -2
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<{
|
|
@@ -2230,6 +2266,12 @@ declare function useFullScreenLoader(): FullScreenLoaderContextValue;
|
|
|
2230
2266
|
*/
|
|
2231
2267
|
interface SDKMessages {
|
|
2232
2268
|
security: {
|
|
2269
|
+
connectedAgentsTitle: string;
|
|
2270
|
+
connectedAgentsDescription: string;
|
|
2271
|
+
connectedAgentsDisconnect: string;
|
|
2272
|
+
connectedAgentsEmpty: string;
|
|
2273
|
+
connectedAgentsAccess: string;
|
|
2274
|
+
connectedAgentsGranted: string;
|
|
2233
2275
|
inactive: string;
|
|
2234
2276
|
inactiveHint: string;
|
|
2235
2277
|
passkeysTitle: string;
|
|
@@ -2291,6 +2333,8 @@ interface SDKMessages {
|
|
|
2291
2333
|
noPermissionTitle: string;
|
|
2292
2334
|
noPermissionDescription: string;
|
|
2293
2335
|
billingManageOnly: string;
|
|
2336
|
+
openSettings: string;
|
|
2337
|
+
back: string;
|
|
2294
2338
|
};
|
|
2295
2339
|
};
|
|
2296
2340
|
subscription: {
|
|
@@ -2734,6 +2778,7 @@ interface SDKMessages {
|
|
|
2734
2778
|
searchCurrency: string;
|
|
2735
2779
|
chooseTimezone: string;
|
|
2736
2780
|
searchTimezone: string;
|
|
2781
|
+
noResults: string;
|
|
2737
2782
|
};
|
|
2738
2783
|
push: {
|
|
2739
2784
|
failedToSubscribe: string;
|
|
@@ -2829,9 +2874,19 @@ interface SDKMessages {
|
|
|
2829
2874
|
}
|
|
2830
2875
|
/** Supported locale codes */
|
|
2831
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>;
|
|
2832
2886
|
/**
|
|
2833
2887
|
* Generates a union of all valid dot-separated key paths from SDKMessages.
|
|
2834
|
-
* Supports up to
|
|
2888
|
+
* Supports up to 4 levels of nesting (covers all current keys, e.g.
|
|
2889
|
+
* "notifications.unblock.firefox.step1").
|
|
2835
2890
|
* Used to make `t()` calls compile-time safe with autocomplete.
|
|
2836
2891
|
*
|
|
2837
2892
|
* @example
|
|
@@ -2856,6 +2911,156 @@ type Level4 = {
|
|
|
2856
2911
|
/** Union of all valid translation key paths (e.g. "settings.titles.profile") */
|
|
2857
2912
|
type TranslationKey = Level2 | Level3 | Level4;
|
|
2858
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
|
+
|
|
2859
3064
|
/** Values that can be interpolated into ICU messages */
|
|
2860
3065
|
type TranslationValues = Record<string, string | number | boolean>;
|
|
2861
3066
|
/** All supported locale codes */
|
|
@@ -2891,7 +3096,7 @@ declare function useTranslation(): {
|
|
|
2891
3096
|
};
|
|
2892
3097
|
|
|
2893
3098
|
interface SaaSOSProviderProps extends IOsState {
|
|
2894
|
-
children:
|
|
3099
|
+
children: React__default.ReactNode;
|
|
2895
3100
|
/** SDK UI language. Defaults to 'en'. Supported: en, es, fr, de, ja, zh, hi, ar */
|
|
2896
3101
|
locale?: SDKLocale;
|
|
2897
3102
|
/**
|
|
@@ -2962,26 +3167,49 @@ interface SaaSOSProviderProps extends IOsState {
|
|
|
2962
3167
|
* >
|
|
2963
3168
|
* ```
|
|
2964
3169
|
*/
|
|
2965
|
-
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;
|
|
2966
3187
|
}
|
|
2967
|
-
declare const SaaSOSProvider:
|
|
3188
|
+
declare const SaaSOSProvider: React__default.FC<SaaSOSProviderProps>;
|
|
2968
3189
|
|
|
2969
3190
|
interface IProps$2 {
|
|
2970
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;
|
|
2971
3196
|
}
|
|
2972
3197
|
/**
|
|
2973
3198
|
* Conditional component that renders children only when user is authenticated.
|
|
2974
|
-
*
|
|
3199
|
+
* Optionally pass loadingComponent (while auth resolves) or fallbackComponent
|
|
3200
|
+
* (when unauthenticated) — both default to null, matching the other SDK gates.
|
|
2975
3201
|
*
|
|
2976
3202
|
* @param props - Component props
|
|
2977
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
|
|
2978
3206
|
*
|
|
2979
3207
|
* @example
|
|
2980
3208
|
* ```tsx
|
|
2981
3209
|
* function App() {
|
|
2982
3210
|
* return (
|
|
2983
3211
|
* <SaaSOSProvider {...config}>
|
|
2984
|
-
* <WhenAuthenticated>
|
|
3212
|
+
* <WhenAuthenticated loadingComponent={<Skeleton />}>
|
|
2985
3213
|
* <Dashboard />
|
|
2986
3214
|
* </WhenAuthenticated>
|
|
2987
3215
|
* <WhenUnauthenticated>
|
|
@@ -2993,16 +3221,19 @@ interface IProps$2 {
|
|
|
2993
3221
|
* ```
|
|
2994
3222
|
*/
|
|
2995
3223
|
declare const WhenAuthenticated: {
|
|
2996
|
-
(props: IProps$2):
|
|
3224
|
+
(props: IProps$2): React$1.ReactNode;
|
|
2997
3225
|
displayName: string;
|
|
2998
3226
|
};
|
|
2999
3227
|
/**
|
|
3000
3228
|
* Conditional component that renders children only when user is NOT authenticated.
|
|
3001
|
-
*
|
|
3002
|
-
*
|
|
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.
|
|
3003
3232
|
*
|
|
3004
3233
|
* @param props - Component props
|
|
3005
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
|
|
3006
3237
|
*
|
|
3007
3238
|
* @example
|
|
3008
3239
|
* ```tsx
|
|
@@ -3038,27 +3269,10 @@ declare const WhenAuthenticated: {
|
|
|
3038
3269
|
* ```
|
|
3039
3270
|
*/
|
|
3040
3271
|
declare const WhenUnauthenticated: {
|
|
3041
|
-
(props: IProps$2):
|
|
3272
|
+
(props: IProps$2): React$1.ReactNode;
|
|
3042
3273
|
displayName: string;
|
|
3043
3274
|
};
|
|
3044
3275
|
|
|
3045
|
-
declare const SettingsScreen: {
|
|
3046
|
-
readonly Profile: "profile";
|
|
3047
|
-
readonly Security: "security";
|
|
3048
|
-
readonly General: "general";
|
|
3049
|
-
readonly Users: "users";
|
|
3050
|
-
readonly Subscription: "subscription";
|
|
3051
|
-
readonly Usage: "usage";
|
|
3052
|
-
readonly Credits: "credits";
|
|
3053
|
-
readonly Features: "features";
|
|
3054
|
-
readonly Notifications: "notifications";
|
|
3055
|
-
readonly Permissions: "permissions";
|
|
3056
|
-
readonly Danger: "danger";
|
|
3057
|
-
};
|
|
3058
|
-
type WorkspaceSettingsSection = (typeof SettingsScreen)[keyof typeof SettingsScreen];
|
|
3059
|
-
/** Set of all valid section values — used for runtime validation */
|
|
3060
|
-
declare const SETTINGS_SCREENS: Set<WorkspaceSettingsSection>;
|
|
3061
|
-
|
|
3062
3276
|
declare function useSaaSAuth(): {
|
|
3063
3277
|
signIn: (returnUrl?: string) => Promise<void>;
|
|
3064
3278
|
signOut: () => Promise<void>;
|
|
@@ -3114,7 +3328,7 @@ interface IProps$1 {
|
|
|
3114
3328
|
* ```
|
|
3115
3329
|
*/
|
|
3116
3330
|
declare const WhenRoles: {
|
|
3117
|
-
(props: IProps$1):
|
|
3331
|
+
(props: IProps$1): React$1.ReactNode;
|
|
3118
3332
|
displayName: string;
|
|
3119
3333
|
};
|
|
3120
3334
|
/**
|
|
@@ -3153,7 +3367,7 @@ declare const WhenRoles: {
|
|
|
3153
3367
|
* ```
|
|
3154
3368
|
*/
|
|
3155
3369
|
declare const WhenWorkspaceRoles: {
|
|
3156
|
-
(props: IProps$1):
|
|
3370
|
+
(props: IProps$1): React$1.ReactNode;
|
|
3157
3371
|
displayName: string;
|
|
3158
3372
|
};
|
|
3159
3373
|
|
|
@@ -3184,7 +3398,7 @@ interface WhenPermissionProps {
|
|
|
3184
3398
|
* ```
|
|
3185
3399
|
*/
|
|
3186
3400
|
declare const WhenPermission: {
|
|
3187
|
-
(props: WhenPermissionProps):
|
|
3401
|
+
(props: WhenPermissionProps): React$1.ReactNode;
|
|
3188
3402
|
displayName: string;
|
|
3189
3403
|
};
|
|
3190
3404
|
|
|
@@ -3225,6 +3439,52 @@ declare function usePermissions(workspace?: WorkspaceLike | null): {
|
|
|
3225
3439
|
role: string | null;
|
|
3226
3440
|
};
|
|
3227
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
|
+
|
|
3228
3488
|
interface IProps {
|
|
3229
3489
|
slug: string;
|
|
3230
3490
|
children: React.ReactNode;
|
|
@@ -3266,7 +3526,7 @@ interface IProps {
|
|
|
3266
3526
|
* ```
|
|
3267
3527
|
*/
|
|
3268
3528
|
declare const WhenWorkspaceFeatureEnabled: {
|
|
3269
|
-
(props: IProps):
|
|
3529
|
+
(props: IProps): React$1.ReactNode;
|
|
3270
3530
|
displayName: string;
|
|
3271
3531
|
};
|
|
3272
3532
|
/**
|
|
@@ -3289,7 +3549,7 @@ declare const WhenWorkspaceFeatureEnabled: {
|
|
|
3289
3549
|
* ```
|
|
3290
3550
|
*/
|
|
3291
3551
|
declare const WhenWorkspaceFeatureDisabled: {
|
|
3292
|
-
(props: IProps):
|
|
3552
|
+
(props: IProps): React$1.ReactNode;
|
|
3293
3553
|
displayName: string;
|
|
3294
3554
|
};
|
|
3295
3555
|
/**
|
|
@@ -3328,7 +3588,7 @@ declare const WhenWorkspaceFeatureDisabled: {
|
|
|
3328
3588
|
* ```
|
|
3329
3589
|
*/
|
|
3330
3590
|
declare const WhenUserFeatureEnabled: {
|
|
3331
|
-
(props: IProps):
|
|
3591
|
+
(props: IProps): React$1.ReactNode;
|
|
3332
3592
|
displayName: string;
|
|
3333
3593
|
};
|
|
3334
3594
|
/**
|
|
@@ -3351,7 +3611,7 @@ declare const WhenUserFeatureEnabled: {
|
|
|
3351
3611
|
* ```
|
|
3352
3612
|
*/
|
|
3353
3613
|
declare const WhenUserFeatureDisabled: {
|
|
3354
|
-
(props: IProps):
|
|
3614
|
+
(props: IProps): React$1.ReactNode;
|
|
3355
3615
|
displayName: string;
|
|
3356
3616
|
};
|
|
3357
3617
|
|
|
@@ -3392,7 +3652,7 @@ interface IWhenSubscriptionProps {
|
|
|
3392
3652
|
* ```
|
|
3393
3653
|
*/
|
|
3394
3654
|
declare const WhenSubscription: {
|
|
3395
|
-
(props: IWhenSubscriptionProps):
|
|
3655
|
+
(props: IWhenSubscriptionProps): React$1.ReactNode;
|
|
3396
3656
|
displayName: string;
|
|
3397
3657
|
};
|
|
3398
3658
|
/**
|
|
@@ -3424,7 +3684,7 @@ declare const WhenSubscription: {
|
|
|
3424
3684
|
* ```
|
|
3425
3685
|
*/
|
|
3426
3686
|
declare const WhenNoSubscription: {
|
|
3427
|
-
(props: IWhenSubscriptionProps):
|
|
3687
|
+
(props: IWhenSubscriptionProps): React$1.ReactNode;
|
|
3428
3688
|
displayName: string;
|
|
3429
3689
|
};
|
|
3430
3690
|
interface IWhenSubscriptionToPlansProps {
|
|
@@ -3468,7 +3728,7 @@ interface IWhenSubscriptionToPlansProps {
|
|
|
3468
3728
|
* ```
|
|
3469
3729
|
*/
|
|
3470
3730
|
declare const WhenSubscriptionToPlans: {
|
|
3471
|
-
(props: IWhenSubscriptionToPlansProps):
|
|
3731
|
+
(props: IWhenSubscriptionToPlansProps): React$1.ReactNode;
|
|
3472
3732
|
displayName: string;
|
|
3473
3733
|
};
|
|
3474
3734
|
interface IWhenTrialingProps {
|
|
@@ -3491,7 +3751,7 @@ interface IWhenTrialingProps {
|
|
|
3491
3751
|
* ```
|
|
3492
3752
|
*/
|
|
3493
3753
|
declare const WhenTrialing: {
|
|
3494
|
-
(props: IWhenTrialingProps):
|
|
3754
|
+
(props: IWhenTrialingProps): React$1.ReactNode;
|
|
3495
3755
|
displayName: string;
|
|
3496
3756
|
};
|
|
3497
3757
|
/**
|
|
@@ -3507,7 +3767,7 @@ declare const WhenTrialing: {
|
|
|
3507
3767
|
* ```
|
|
3508
3768
|
*/
|
|
3509
3769
|
declare const WhenNotTrialing: {
|
|
3510
|
-
(props: IWhenTrialingProps):
|
|
3770
|
+
(props: IWhenTrialingProps): React$1.ReactNode;
|
|
3511
3771
|
displayName: string;
|
|
3512
3772
|
};
|
|
3513
3773
|
interface IWhenTrialEndingProps {
|
|
@@ -3517,12 +3777,16 @@ interface IWhenTrialEndingProps {
|
|
|
3517
3777
|
loadingComponent?: React.ReactNode;
|
|
3518
3778
|
/** Optional component/element to show when trial is not ending soon. */
|
|
3519
3779
|
fallbackComponent?: React.ReactNode;
|
|
3520
|
-
/**
|
|
3780
|
+
/**
|
|
3781
|
+
* Number of days threshold to consider "ending soon".
|
|
3782
|
+
* Defaults to `ui.behavior.trialEndingDays` from SaaSOSProvider, or 3.
|
|
3783
|
+
*/
|
|
3521
3784
|
daysThreshold?: number;
|
|
3522
3785
|
}
|
|
3523
3786
|
/**
|
|
3524
3787
|
* Renders children only when the subscription is trialing AND the trial ends within
|
|
3525
|
-
* 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.
|
|
3526
3790
|
* Must be used within SubscriptionContextProvider.
|
|
3527
3791
|
*
|
|
3528
3792
|
* @example
|
|
@@ -3533,7 +3797,7 @@ interface IWhenTrialEndingProps {
|
|
|
3533
3797
|
* ```
|
|
3534
3798
|
*/
|
|
3535
3799
|
declare const WhenTrialEnding: {
|
|
3536
|
-
(props: IWhenTrialEndingProps):
|
|
3800
|
+
(props: IWhenTrialEndingProps): React$1.ReactNode;
|
|
3537
3801
|
displayName: string;
|
|
3538
3802
|
};
|
|
3539
3803
|
|
|
@@ -3574,7 +3838,7 @@ interface IWhenQuotaThresholdProps extends IWhenQuotaProps {
|
|
|
3574
3838
|
* ```
|
|
3575
3839
|
*/
|
|
3576
3840
|
declare const WhenQuotaAvailable: {
|
|
3577
|
-
(props: IWhenQuotaProps):
|
|
3841
|
+
(props: IWhenQuotaProps): React$1.ReactNode;
|
|
3578
3842
|
displayName: string;
|
|
3579
3843
|
};
|
|
3580
3844
|
/**
|
|
@@ -3600,7 +3864,7 @@ declare const WhenQuotaAvailable: {
|
|
|
3600
3864
|
* ```
|
|
3601
3865
|
*/
|
|
3602
3866
|
declare const WhenQuotaExhausted: {
|
|
3603
|
-
(props: IWhenQuotaProps):
|
|
3867
|
+
(props: IWhenQuotaProps): React$1.ReactNode;
|
|
3604
3868
|
displayName: string;
|
|
3605
3869
|
};
|
|
3606
3870
|
/**
|
|
@@ -3626,7 +3890,7 @@ declare const WhenQuotaExhausted: {
|
|
|
3626
3890
|
* ```
|
|
3627
3891
|
*/
|
|
3628
3892
|
declare const WhenQuotaOverage: {
|
|
3629
|
-
(props: IWhenQuotaProps):
|
|
3893
|
+
(props: IWhenQuotaProps): React$1.ReactNode;
|
|
3630
3894
|
displayName: string;
|
|
3631
3895
|
};
|
|
3632
3896
|
/**
|
|
@@ -3654,7 +3918,7 @@ declare const WhenQuotaOverage: {
|
|
|
3654
3918
|
* ```
|
|
3655
3919
|
*/
|
|
3656
3920
|
declare const WhenQuotaThreshold: {
|
|
3657
|
-
(props: IWhenQuotaThresholdProps):
|
|
3921
|
+
(props: IWhenQuotaThresholdProps): React$1.ReactNode;
|
|
3658
3922
|
displayName: string;
|
|
3659
3923
|
};
|
|
3660
3924
|
|
|
@@ -3731,7 +3995,7 @@ interface CreditActionsProviderProps {
|
|
|
3731
3995
|
* ```
|
|
3732
3996
|
*/
|
|
3733
3997
|
declare const CreditActionsProvider: {
|
|
3734
|
-
({ children }: CreditActionsProviderProps):
|
|
3998
|
+
({ children }: CreditActionsProviderProps): React$1.ReactNode;
|
|
3735
3999
|
displayName: string;
|
|
3736
4000
|
};
|
|
3737
4001
|
|
|
@@ -3777,7 +4041,7 @@ interface CreditBalanceProps {
|
|
|
3777
4041
|
* ```
|
|
3778
4042
|
*/
|
|
3779
4043
|
declare const CreditBalance: {
|
|
3780
|
-
({ children }: CreditBalanceProps):
|
|
4044
|
+
({ children }: CreditBalanceProps): React$1.ReactNode;
|
|
3781
4045
|
displayName: string;
|
|
3782
4046
|
};
|
|
3783
4047
|
|
|
@@ -3889,7 +4153,7 @@ interface IWhenCreditsLowProps extends IWhenCreditsProps {
|
|
|
3889
4153
|
* ```
|
|
3890
4154
|
*/
|
|
3891
4155
|
declare const WhenCreditsAvailable: {
|
|
3892
|
-
(props: IWhenCreditsAvailableProps):
|
|
4156
|
+
(props: IWhenCreditsAvailableProps): React$1.ReactNode;
|
|
3893
4157
|
displayName: string;
|
|
3894
4158
|
};
|
|
3895
4159
|
/**
|
|
@@ -3914,7 +4178,7 @@ declare const WhenCreditsAvailable: {
|
|
|
3914
4178
|
* ```
|
|
3915
4179
|
*/
|
|
3916
4180
|
declare const WhenCreditsExhausted: {
|
|
3917
|
-
(props: IWhenCreditsProps):
|
|
4181
|
+
(props: IWhenCreditsProps): React$1.ReactNode;
|
|
3918
4182
|
displayName: string;
|
|
3919
4183
|
};
|
|
3920
4184
|
/**
|
|
@@ -3940,7 +4204,7 @@ declare const WhenCreditsExhausted: {
|
|
|
3940
4204
|
* ```
|
|
3941
4205
|
*/
|
|
3942
4206
|
declare const WhenCreditsLow: {
|
|
3943
|
-
(props: IWhenCreditsLowProps):
|
|
4207
|
+
(props: IWhenCreditsLowProps): React$1.ReactNode;
|
|
3944
4208
|
displayName: string;
|
|
3945
4209
|
};
|
|
3946
4210
|
|
|
@@ -3968,7 +4232,7 @@ interface SubscriptionContextValue {
|
|
|
3968
4232
|
* @param props.children - React tree that may use subscription gates or useSubscriptionContext
|
|
3969
4233
|
* @returns Provider element that supplies subscription context to descendants
|
|
3970
4234
|
*/
|
|
3971
|
-
declare const SubscriptionContextProvider:
|
|
4235
|
+
declare const SubscriptionContextProvider: React__default.FC<{
|
|
3972
4236
|
children: ReactNode;
|
|
3973
4237
|
}>;
|
|
3974
4238
|
/**
|
|
@@ -4003,7 +4267,7 @@ interface QuotaUsageContextValue {
|
|
|
4003
4267
|
* @param props.children - React tree that may use quota gates or useQuotaUsageContext
|
|
4004
4268
|
* @returns Provider element that supplies quota usage context to descendants
|
|
4005
4269
|
*/
|
|
4006
|
-
declare const QuotaUsageContextProvider:
|
|
4270
|
+
declare const QuotaUsageContextProvider: React__default.FC<{
|
|
4007
4271
|
children: ReactNode;
|
|
4008
4272
|
}>;
|
|
4009
4273
|
/**
|
|
@@ -4031,7 +4295,7 @@ interface CreditBalanceContextValue {
|
|
|
4031
4295
|
* (e.g. after consume or purchase).
|
|
4032
4296
|
* Included in SaaSOSProvider by default.
|
|
4033
4297
|
*/
|
|
4034
|
-
declare const CreditBalanceContextProvider:
|
|
4298
|
+
declare const CreditBalanceContextProvider: React__default.FC<{
|
|
4035
4299
|
children: ReactNode;
|
|
4036
4300
|
}>;
|
|
4037
4301
|
/**
|
|
@@ -5292,7 +5556,7 @@ interface BetaFormProps {
|
|
|
5292
5556
|
hideLogo?: boolean;
|
|
5293
5557
|
hideTitles?: boolean;
|
|
5294
5558
|
}
|
|
5295
|
-
declare const BetaForm:
|
|
5559
|
+
declare const BetaForm: React__default.FC<BetaFormProps>;
|
|
5296
5560
|
|
|
5297
5561
|
interface PricingPageDetails {
|
|
5298
5562
|
/** Whether plan data is being fetched */
|
|
@@ -5364,9 +5628,27 @@ interface PricingPageProps {
|
|
|
5364
5628
|
*/
|
|
5365
5629
|
declare function PricingPage({ slug, children, loadingFallback, errorFallback, redirectBaseUrl, }: PricingPageProps): react_jsx_runtime.JSX.Element;
|
|
5366
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
|
+
|
|
5367
5649
|
interface FullScreenLoaderProps {
|
|
5368
5650
|
/** Content to display centered on screen. Falls back to a default spinner + message. */
|
|
5369
|
-
children?:
|
|
5651
|
+
children?: React__default.ReactNode;
|
|
5370
5652
|
/** Message shown below the default spinner (only used when no children are provided). Defaults to "Loading..." */
|
|
5371
5653
|
message?: string;
|
|
5372
5654
|
/** Background color of the overlay. Defaults to white (dark mode: near-black). */
|
|
@@ -5395,6 +5677,84 @@ declare const FullScreenLoader: {
|
|
|
5395
5677
|
displayName: string;
|
|
5396
5678
|
};
|
|
5397
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
|
+
|
|
5398
5758
|
declare function WorkspaceSwitcher(props: {
|
|
5399
5759
|
trigger: (isLoading: boolean, currentWorkspace: IWorkspace | null) => ReactNode;
|
|
5400
5760
|
}): react_jsx_runtime.JSX.Element;
|
|
@@ -5420,19 +5780,43 @@ interface PushNotificationContextValue extends PushNotificationState {
|
|
|
5420
5780
|
unsubscribe: () => Promise<void>;
|
|
5421
5781
|
}
|
|
5422
5782
|
interface PushNotificationProviderProps {
|
|
5423
|
-
children:
|
|
5783
|
+
children: React__default.ReactNode;
|
|
5424
5784
|
/** Path to the service worker file (default: '/push-sw.js') */
|
|
5425
5785
|
serviceWorkerPath?: string;
|
|
5426
5786
|
/** Automatically subscribe after permission is granted on login (default: false) */
|
|
5427
5787
|
autoSubscribe?: boolean;
|
|
5428
5788
|
}
|
|
5429
|
-
declare const PushNotificationProvider:
|
|
5789
|
+
declare const PushNotificationProvider: React__default.FC<PushNotificationProviderProps>;
|
|
5430
5790
|
/**
|
|
5431
5791
|
* Hook to access push notification state and actions.
|
|
5432
5792
|
* Must be used within PushNotificationProvider (included in SaaSOSProvider when push config is provided).
|
|
5433
5793
|
*/
|
|
5434
5794
|
declare function usePushNotifications(): PushNotificationContextValue;
|
|
5435
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
|
+
|
|
5436
5820
|
interface SettingsManagerState {
|
|
5437
5821
|
open: boolean;
|
|
5438
5822
|
section: WorkspaceSettingsSection;
|
|
@@ -5476,5 +5860,5 @@ declare class WorkspaceSettingsManager {
|
|
|
5476
5860
|
}
|
|
5477
5861
|
declare const workspaceSettingsManager: WorkspaceSettingsManager;
|
|
5478
5862
|
|
|
5479
|
-
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 };
|
|
5480
|
-
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 };
|