@fluid-app/portal-sdk 0.1.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +415 -0
- package/dist/ContactsScreen-CB6l0Lf1.mjs +24 -0
- package/dist/ContactsScreen-CB6l0Lf1.mjs.map +1 -0
- package/dist/ContactsScreen-Cqyrl4AQ.cjs +41 -0
- package/dist/ContactsScreen-Cqyrl4AQ.cjs.map +1 -0
- package/dist/CoreScreenPlaceholder-CA2-2V5o.cjs +38 -0
- package/dist/CoreScreenPlaceholder-CA2-2V5o.cjs.map +1 -0
- package/dist/CoreScreenPlaceholder-D93ZYKt2.mjs +32 -0
- package/dist/CoreScreenPlaceholder-D93ZYKt2.mjs.map +1 -0
- package/dist/CustomersScreen-BEar6Leg.mjs +24 -0
- package/dist/CustomersScreen-BEar6Leg.mjs.map +1 -0
- package/dist/CustomersScreen-gFgOzBox.cjs +41 -0
- package/dist/CustomersScreen-gFgOzBox.cjs.map +1 -0
- package/dist/MessagingScreen-BklF48Fn.mjs +1281 -0
- package/dist/MessagingScreen-BklF48Fn.mjs.map +1 -0
- package/dist/MessagingScreen-CHb-scHD.cjs +1454 -0
- package/dist/MessagingScreen-CHb-scHD.cjs.map +1 -0
- package/dist/OrdersScreen-CPGDYvEd.cjs +41 -0
- package/dist/OrdersScreen-CPGDYvEd.cjs.map +1 -0
- package/dist/OrdersScreen-DB1v051q.mjs +24 -0
- package/dist/OrdersScreen-DB1v051q.mjs.map +1 -0
- package/dist/ProductsScreen-B1tlIth6.cjs +41 -0
- package/dist/ProductsScreen-B1tlIth6.cjs.map +1 -0
- package/dist/ProductsScreen-nVDsY6kf.mjs +24 -0
- package/dist/ProductsScreen-nVDsY6kf.mjs.map +1 -0
- package/dist/chunk-D1SwGrFN.mjs +27 -0
- package/dist/index.cjs +3610 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +2500 -0
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.mts +2498 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +2921 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +76 -0
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,2500 @@
|
|
|
1
|
+
import React$1, { AnchorHTMLAttributes, ComponentProps, ComponentType, ReactNode } from "react";
|
|
2
|
+
import { QueryClient, UseQueryResult } from "@tanstack/react-query";
|
|
3
|
+
import * as _fluid_app_portal_core_types0 from "@fluid-app/portal-core/types";
|
|
4
|
+
import { AlignOptions, BackgroundType, BackgroundValue, BorderRadiusOptions, ButtonSizeOptions, ColorOptions, FontSizeOptions, GapOptions, NavigationItem, NavigationItem as NavigationItem$1, PaddingOptions, RepAppData, RepAppData as RepAppData$1, RepAppManifest, RepAppProfile, ResolvedTheme, ScreenDefinition as ScreenDefinition$1, SectionLayoutType, ShareableItem, ThemeColorInput, ThemeDefinition, ThemePayload, TypedWidgetSchema, WIDGET_TYPE_NAMES, WidgetPath, WidgetRegistry, WidgetRegistry as WidgetRegistry$1, WidgetSchema, WidgetSchema as WidgetSchema$1, WidgetType, WidgetTypeName, assertDefined, assertNever, isWidgetType, isWidgetTypeName, sectionLayoutConfig } from "@fluid-app/portal-core/types";
|
|
5
|
+
import { RawApiTheme, RawApiTheme as RawApiTheme$1, buildThemeDefinition, getActiveThemeId, transformThemes } from "@fluid-app/portal-core/theme";
|
|
6
|
+
import { AUTH_CONSTANTS, DEFAULT_AUTH_URL, FluidAuthConfig, FluidAuthContextValue, JWTPayload, STORAGE_KEYS, TokenValidationResult, URL_PARAMS, USER_TYPES, UserType, cleanTokenFromUrl, clearTokens, createDefaultAuthRedirect, decodeToken, extractAllTokensFromUrl, extractCompanyTokenFromUrl, extractTokenFromUrl, getStoredToken, getTokenExpiration, getTokenTimeRemaining, hasStoredToken, hasTokenInUrl, isTokenExpired, isUserType, isValidToken, storeToken, validateToken } from "@fluid-app/auth";
|
|
7
|
+
import { FileUploader, FileUploader as FileUploader$1, MessagingAuthContext, MessagingAuthContext as MessagingAuthContext$1, MessagingCurrentUser, UploadCallbacks, UploadResult } from "@fluid-app/messaging-core";
|
|
8
|
+
import { MessagingApiConfig } from "@fluid-app/messaging-api-client";
|
|
9
|
+
import { AlertWidget, CalendarWidget, CarouselWidget, CatchUpWidget, ChartWidget, ContainerWidget, EmbedWidget, ImageWidget, LayoutWidget, ListWidget, MySiteWidget, NestedWidget, QuickShareWidget, RecentActivityWidget, SpacerWidget, TableWidget, TextWidget, ToDoWidget, VideoWidget, alertWidgetPropertySchema, calendarWidgetPropertySchema, carouselWidgetPropertySchema, catchUpWidgetPropertySchema, chartWidgetPropertySchema, containerWidgetPropertySchema, embedWidgetPropertySchema, imageWidgetPropertySchema, layoutWidgetPropertySchema, listWidgetPropertySchema, mySiteWidgetPropertySchema, nestedWidgetPropertySchema, quickShareWidgetPropertySchema, recentActivityWidgetPropertySchema, spacerWidgetPropertySchema, tableWidgetPropertySchema, textWidgetPropertySchema, toDoWidgetPropertySchema, videoWidgetPropertySchema, widgetPropertySchemas } from "@fluid-app/portal-widgets/widgets";
|
|
10
|
+
import { PROPERTY_FIELD_TYPES, PropertyFieldSchema, PropertyFieldType, TabConfig, WidgetPropertySchema, gapValues, isPropertyFieldType } from "@fluid-app/portal-core/registries";
|
|
11
|
+
import { createScreen, createWidgetFromShareable, createWidgetRegistry, groupChildrenByColumn } from "@fluid-app/portal-core/widget-utils";
|
|
12
|
+
import { ThemeMode, ThemeModeProvider, getThemeModeAttribute, useThemeMode } from "@fluid-app/portal-core/shell/ThemeModeContext";
|
|
13
|
+
|
|
14
|
+
//#region \0rolldown/runtime.js
|
|
15
|
+
//#endregion
|
|
16
|
+
//#region src/types/rep.d.ts
|
|
17
|
+
/**
|
|
18
|
+
* Rep (sales representative) user profile
|
|
19
|
+
*/
|
|
20
|
+
interface Rep {
|
|
21
|
+
readonly id: string;
|
|
22
|
+
email: string;
|
|
23
|
+
first_name: string;
|
|
24
|
+
last_name: string;
|
|
25
|
+
avatar_url?: string;
|
|
26
|
+
phone?: string;
|
|
27
|
+
readonly company_id: string;
|
|
28
|
+
readonly created_at: string;
|
|
29
|
+
readonly updated_at: string;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Data for updating a rep's profile
|
|
33
|
+
*/
|
|
34
|
+
interface UpdateRepData {
|
|
35
|
+
first_name?: string;
|
|
36
|
+
last_name?: string;
|
|
37
|
+
avatar_url?: string;
|
|
38
|
+
phone?: string;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Current user profile from GET /api/me endpoint.
|
|
42
|
+
* Contains recipient_id needed for the messaging system.
|
|
43
|
+
* Field names match the Rails API response (snake_case).
|
|
44
|
+
*/
|
|
45
|
+
interface UserMe {
|
|
46
|
+
readonly id: number;
|
|
47
|
+
readonly first_name: string | null;
|
|
48
|
+
readonly last_name: string | null;
|
|
49
|
+
readonly email: string;
|
|
50
|
+
readonly image_url: string | null;
|
|
51
|
+
readonly jwt: string;
|
|
52
|
+
readonly recipient_id: number | null;
|
|
53
|
+
readonly company_id?: number;
|
|
54
|
+
readonly affiliate_id: number | null;
|
|
55
|
+
}
|
|
56
|
+
//#endregion
|
|
57
|
+
//#region src/types/page-template.d.ts
|
|
58
|
+
/**
|
|
59
|
+
* Category for organizing page templates in the registry
|
|
60
|
+
*/
|
|
61
|
+
interface PageCategory {
|
|
62
|
+
/** Unique identifier for the category */
|
|
63
|
+
readonly id: string;
|
|
64
|
+
/** Display label */
|
|
65
|
+
label: string;
|
|
66
|
+
/** Icon identifier (e.g., lucide icon name) */
|
|
67
|
+
icon?: string;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* A reusable page template that can be shared across multiple navigations
|
|
71
|
+
*/
|
|
72
|
+
interface PageTemplate {
|
|
73
|
+
/** Unique identifier for the template */
|
|
74
|
+
readonly id: string;
|
|
75
|
+
/** URL-friendly slug */
|
|
76
|
+
slug: string;
|
|
77
|
+
/** Display name */
|
|
78
|
+
name: string;
|
|
79
|
+
/** Description of the template's purpose */
|
|
80
|
+
description?: string;
|
|
81
|
+
/** Category ID for organization */
|
|
82
|
+
category: string;
|
|
83
|
+
/** Tags for filtering and search */
|
|
84
|
+
tags?: readonly string[];
|
|
85
|
+
/** The widget tree that defines the page content */
|
|
86
|
+
component_tree: readonly WidgetSchema[];
|
|
87
|
+
/** Semantic version of the template */
|
|
88
|
+
version: string;
|
|
89
|
+
/** Whether this is a core feature that cannot be removed */
|
|
90
|
+
isCore?: boolean;
|
|
91
|
+
/** Default prop values that can be customized */
|
|
92
|
+
defaultProps?: Readonly<Record<string, unknown>>;
|
|
93
|
+
/** Thumbnail image URL for UI display */
|
|
94
|
+
thumbnail?: string;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Reference to a shared page template within a navigation
|
|
98
|
+
*/
|
|
99
|
+
interface PageReference {
|
|
100
|
+
/** ID of the page template being referenced */
|
|
101
|
+
page_template_id: string;
|
|
102
|
+
/** Screen ID to assign to this page in the navigation */
|
|
103
|
+
screen_id: number;
|
|
104
|
+
/** Optional prop overrides (only prop values, not widget structure) */
|
|
105
|
+
overrides?: readonly PageOverride[];
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Override for a specific widget's props within a page template
|
|
109
|
+
*/
|
|
110
|
+
interface PageOverride {
|
|
111
|
+
/** ID of the widget to override (must match WidgetSchema.id in the template) */
|
|
112
|
+
readonly widget_id: string;
|
|
113
|
+
/** Props to override (merged with original props) */
|
|
114
|
+
props: Readonly<Record<string, unknown>>;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Built-in page category IDs
|
|
118
|
+
*/
|
|
119
|
+
declare const PAGE_CATEGORIES: {
|
|
120
|
+
readonly CORE: "core";
|
|
121
|
+
readonly COMMERCE: "commerce";
|
|
122
|
+
readonly COMMUNICATION: "communication";
|
|
123
|
+
readonly DATA: "data";
|
|
124
|
+
readonly CUSTOM: "custom";
|
|
125
|
+
};
|
|
126
|
+
type PageCategoryId = (typeof PAGE_CATEGORIES)[keyof typeof PAGE_CATEGORIES];
|
|
127
|
+
//#endregion
|
|
128
|
+
//#region src/types/navigation.d.ts
|
|
129
|
+
/**
|
|
130
|
+
* Screen definition with its component tree
|
|
131
|
+
*/
|
|
132
|
+
interface ScreenDefinition {
|
|
133
|
+
readonly id: number;
|
|
134
|
+
slug: string;
|
|
135
|
+
name: string;
|
|
136
|
+
component_tree: WidgetSchema[];
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Navigation configuration for the portal
|
|
140
|
+
*/
|
|
141
|
+
interface Navigation {
|
|
142
|
+
readonly definition_id: number;
|
|
143
|
+
readonly id: number;
|
|
144
|
+
name: string;
|
|
145
|
+
navigation_items: _fluid_app_portal_core_types0.NavigationItem[];
|
|
146
|
+
/** Local screen definitions (for backwards compatibility and custom screens) */
|
|
147
|
+
screens: ScreenDefinition[];
|
|
148
|
+
/** References to shared page templates from the registry */
|
|
149
|
+
page_refs?: PageReference[];
|
|
150
|
+
}
|
|
151
|
+
//#endregion
|
|
152
|
+
//#region src/types/profile.d.ts
|
|
153
|
+
/**
|
|
154
|
+
* Portal profile containing themes and navigation configuration
|
|
155
|
+
*/
|
|
156
|
+
interface Profile {
|
|
157
|
+
/** Profile name */
|
|
158
|
+
name: string;
|
|
159
|
+
/** Available themes for the portal */
|
|
160
|
+
themes: ThemeDefinition[];
|
|
161
|
+
/** Navigation structure and screens */
|
|
162
|
+
navigation: Navigation;
|
|
163
|
+
/** Portal definition ID */
|
|
164
|
+
readonly definition_id: number;
|
|
165
|
+
}
|
|
166
|
+
//#endregion
|
|
167
|
+
//#region src/types/permissions.d.ts
|
|
168
|
+
/**
|
|
169
|
+
* Standard permission action constants.
|
|
170
|
+
* Use these constants instead of string literals for type safety.
|
|
171
|
+
*
|
|
172
|
+
* @example
|
|
173
|
+
* ```ts
|
|
174
|
+
* if (permissions[PERMISSION_ACTIONS.view]) { ... }
|
|
175
|
+
* ```
|
|
176
|
+
*/
|
|
177
|
+
declare const PERMISSION_ACTIONS: {
|
|
178
|
+
readonly view: "view";
|
|
179
|
+
readonly create: "create";
|
|
180
|
+
readonly update: "update";
|
|
181
|
+
readonly delete: "delete";
|
|
182
|
+
readonly settings: "settings";
|
|
183
|
+
readonly add: "add";
|
|
184
|
+
readonly manage: "manage";
|
|
185
|
+
readonly send: "send";
|
|
186
|
+
};
|
|
187
|
+
/**
|
|
188
|
+
* Union type of standard permission actions.
|
|
189
|
+
* Derived from PERMISSION_ACTIONS constant to avoid duplication.
|
|
190
|
+
*/
|
|
191
|
+
type PermissionAction = (typeof PERMISSION_ACTIONS)[keyof typeof PERMISSION_ACTIONS];
|
|
192
|
+
/**
|
|
193
|
+
* Permission flags for a single resource.
|
|
194
|
+
* Known actions have explicit properties; index signature allows custom actions.
|
|
195
|
+
*/
|
|
196
|
+
interface ResourcePermissions {
|
|
197
|
+
readonly view?: boolean;
|
|
198
|
+
readonly create?: boolean;
|
|
199
|
+
readonly update?: boolean;
|
|
200
|
+
readonly delete?: boolean;
|
|
201
|
+
readonly settings?: boolean;
|
|
202
|
+
readonly add?: boolean;
|
|
203
|
+
readonly manage?: boolean;
|
|
204
|
+
readonly send?: boolean;
|
|
205
|
+
/** Allow custom action keys beyond the standard set */
|
|
206
|
+
readonly [key: string]: boolean | undefined;
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* Map of resource names to their permissions
|
|
210
|
+
*/
|
|
211
|
+
type Permissions = Record<string, ResourcePermissions>;
|
|
212
|
+
/**
|
|
213
|
+
* User's complete permission profile
|
|
214
|
+
*/
|
|
215
|
+
interface UserPermissions {
|
|
216
|
+
/** Resource permission mappings */
|
|
217
|
+
permissions: Permissions;
|
|
218
|
+
/** User's assigned roles */
|
|
219
|
+
roles: readonly string[];
|
|
220
|
+
/** Super admin bypass flag */
|
|
221
|
+
is_super_admin: boolean;
|
|
222
|
+
}
|
|
223
|
+
//#endregion
|
|
224
|
+
//#region ../../platform/api-client-core/src/fetch-client.d.ts
|
|
225
|
+
interface RequestOptions$1 {
|
|
226
|
+
method?: "GET" | "POST" | "PUT" | "DELETE" | "PATCH";
|
|
227
|
+
headers?: Record<string, string>;
|
|
228
|
+
params?: Record<string, unknown>;
|
|
229
|
+
body?: unknown;
|
|
230
|
+
signal?: AbortSignal;
|
|
231
|
+
}
|
|
232
|
+
interface FetchClientInstance {
|
|
233
|
+
request: <TResponse = unknown>(endpoint: string, options?: RequestOptions$1) => Promise<TResponse>;
|
|
234
|
+
requestWithFormData: <TResponse = unknown>(endpoint: string, formData: FormData, options?: Omit<RequestOptions$1, "body" | "params"> & {
|
|
235
|
+
method?: "POST" | "PUT" | "PATCH";
|
|
236
|
+
}) => Promise<TResponse>;
|
|
237
|
+
get: <TResponse = unknown>(endpoint: string, params?: Record<string, unknown>, options?: Omit<RequestOptions$1, "method" | "params">) => Promise<TResponse>;
|
|
238
|
+
post: <TResponse = unknown>(endpoint: string, body?: unknown, options?: Omit<RequestOptions$1, "method" | "body">) => Promise<TResponse>;
|
|
239
|
+
put: <TResponse = unknown>(endpoint: string, body?: unknown, options?: Omit<RequestOptions$1, "method" | "body">) => Promise<TResponse>;
|
|
240
|
+
patch: <TResponse = unknown>(endpoint: string, body?: unknown, options?: Omit<RequestOptions$1, "method" | "body">) => Promise<TResponse>;
|
|
241
|
+
delete: <TResponse = unknown>(endpoint: string, options?: Omit<RequestOptions$1, "method">) => Promise<TResponse>;
|
|
242
|
+
}
|
|
243
|
+
type FetchClient = FetchClientInstance;
|
|
244
|
+
//#endregion
|
|
245
|
+
//#region ../../fluidos/api-client/src/generated/fluid_os.d.ts
|
|
246
|
+
interface components {
|
|
247
|
+
schemas: {
|
|
248
|
+
ResponseMeta: {
|
|
249
|
+
/** @example 123e4567-e89b-12d3-a456-426614174000 */request_id?: string; /** @example 2021-01-01T00:00:00Z */
|
|
250
|
+
timestamp?: string;
|
|
251
|
+
}; /** @description Pagination metadata for list responses */
|
|
252
|
+
PaginationMeta: {
|
|
253
|
+
/**
|
|
254
|
+
* @description Total number of items across all pages
|
|
255
|
+
* @example 42
|
|
256
|
+
*/
|
|
257
|
+
total_count?: number;
|
|
258
|
+
/**
|
|
259
|
+
* @description Total number of pages
|
|
260
|
+
* @example 5
|
|
261
|
+
*/
|
|
262
|
+
total_pages?: number;
|
|
263
|
+
/**
|
|
264
|
+
* @description Current page number
|
|
265
|
+
* @example 1
|
|
266
|
+
*/
|
|
267
|
+
current_page?: number;
|
|
268
|
+
/**
|
|
269
|
+
* @description Unique identifier for the request
|
|
270
|
+
* @example 123e4567-e89b-12d3-a456-426614174000
|
|
271
|
+
*/
|
|
272
|
+
request_id?: string;
|
|
273
|
+
/**
|
|
274
|
+
* @description Timestamp of the response
|
|
275
|
+
* @example 2021-01-01T00:00:00Z
|
|
276
|
+
*/
|
|
277
|
+
timestamp?: string;
|
|
278
|
+
} & {
|
|
279
|
+
[key: string]: unknown;
|
|
280
|
+
}; /** FluidOS::NavigationItem */
|
|
281
|
+
FluidOSNavigationItem: {
|
|
282
|
+
id: number;
|
|
283
|
+
icon?: string | null;
|
|
284
|
+
label?: string | null;
|
|
285
|
+
parent_id?: number | null;
|
|
286
|
+
position?: number | null;
|
|
287
|
+
screen_id?: number | null;
|
|
288
|
+
slug?: string | null; /** @enum {string} */
|
|
289
|
+
source: "user" | "system" | "code";
|
|
290
|
+
children: components["schemas"]["FluidOSNavigationItem"][];
|
|
291
|
+
}; /** @description Permission configuration object defining access rights. Empty arrays mean 'allow all' for that dimension. */
|
|
292
|
+
FluidOSPermissions: {
|
|
293
|
+
/** @description Array of rank IDs that can access this profile. Empty array allows all ranks. */ranks?: number[]; /** @description Array of roles that can access this profile. Empty array allows all roles. */
|
|
294
|
+
roles?: ("admin" | "rep")[]; /** @description Array of platforms that can access this profile. Empty array allows all platforms. */
|
|
295
|
+
platform?: ("mobile" | "browser")[]; /** @description Array of country IDs that can access this profile. Empty array allows all countries. */
|
|
296
|
+
countries?: number[];
|
|
297
|
+
}; /** @description Standard error response */
|
|
298
|
+
Error: {
|
|
299
|
+
/**
|
|
300
|
+
* @description Simple error message (used for 404 and other simple errors)
|
|
301
|
+
* @example Resource not found
|
|
302
|
+
* @example Unauthorized
|
|
303
|
+
*/
|
|
304
|
+
error?: string;
|
|
305
|
+
/**
|
|
306
|
+
* @description Error message for validation errors
|
|
307
|
+
* @example Invalid parameters
|
|
308
|
+
*/
|
|
309
|
+
error_message?: string;
|
|
310
|
+
/**
|
|
311
|
+
* @description Detailed validation errors by field
|
|
312
|
+
* @example {
|
|
313
|
+
* "definition": {
|
|
314
|
+
* "name": [
|
|
315
|
+
* "must be filled"
|
|
316
|
+
* ]
|
|
317
|
+
* }
|
|
318
|
+
* }
|
|
319
|
+
*/
|
|
320
|
+
errors?: {
|
|
321
|
+
[key: string]: unknown;
|
|
322
|
+
};
|
|
323
|
+
meta?: components["schemas"]["ResponseMeta"];
|
|
324
|
+
} & {
|
|
325
|
+
[key: string]: unknown;
|
|
326
|
+
}; /** @description A profile optimized for rendering, with permissions stripped. Contains only the data needed to render the app. */
|
|
327
|
+
FluidOSRendererProfile: {
|
|
328
|
+
/** @description Unique identifier for the profile */id?: number; /** @description Display name of the profile */
|
|
329
|
+
name?: string; /** @description Whether this is the default profile for its platform */
|
|
330
|
+
default?: boolean; /** @description Navigation configuration for this profile */
|
|
331
|
+
navigation?: {
|
|
332
|
+
/** @description Tree structure of navigation items */navigation_tree?: components["schemas"]["FluidOSNavigationItem"][];
|
|
333
|
+
}; /** @description Array of theme IDs associated with this profile */
|
|
334
|
+
themes?: number[];
|
|
335
|
+
}; /** @description The Fluid OS manifest optimized for rendering. Contains a single matched profile based on platform, country, rank, and role parameters, along with filtered screens and themes. */
|
|
336
|
+
FluidOSRendererManifest: {
|
|
337
|
+
/** @description Name of the Fluid OS app */name?: string; /** @description ID of the Fluid OS definition */
|
|
338
|
+
definition_id?: number; /** @description Version number of the published manifest */
|
|
339
|
+
published_version?: number;
|
|
340
|
+
/**
|
|
341
|
+
* Format: date-time
|
|
342
|
+
* @description When this version was published
|
|
343
|
+
*/
|
|
344
|
+
published_at?: string; /** @description Navigation configurations for the app */
|
|
345
|
+
navigations?: components["schemas"]["FluidOSNavigationBasic"][]; /** @description The best matching profile for the given parameters */
|
|
346
|
+
profile?: components["schemas"]["FluidOSRendererProfile"]; /** @description Screens associated with the matched profile's navigation */
|
|
347
|
+
screens?: components["schemas"]["FluidOSScreen"][]; /** @description Themes associated with the matched profile */
|
|
348
|
+
themes?: components["schemas"]["FluidOSTheme"][];
|
|
349
|
+
}; /** FluidOS::Navigation */
|
|
350
|
+
FluidOSNavigationBasic: {
|
|
351
|
+
id: number;
|
|
352
|
+
name?: string | null;
|
|
353
|
+
definition_id: number; /** @enum {string} */
|
|
354
|
+
platform: "web" | "mobile";
|
|
355
|
+
}; /** FluidOS::Screen */
|
|
356
|
+
FluidOSScreen: {
|
|
357
|
+
id: number;
|
|
358
|
+
name?: string | null;
|
|
359
|
+
slug?: string | null;
|
|
360
|
+
definition_id: number;
|
|
361
|
+
component_tree?: Record<string, unknown> | null;
|
|
362
|
+
}; /** FluidOS::Theme */
|
|
363
|
+
FluidOSTheme: {
|
|
364
|
+
id: number;
|
|
365
|
+
config?: Record<string, unknown> | null;
|
|
366
|
+
active?: boolean | null;
|
|
367
|
+
name?: string | null;
|
|
368
|
+
definition_id: number;
|
|
369
|
+
}; /** FluidOS::Definition */
|
|
370
|
+
FluidOSDefinition: {
|
|
371
|
+
id: number;
|
|
372
|
+
name?: string | null;
|
|
373
|
+
active?: boolean | null;
|
|
374
|
+
profiles: components["schemas"]["FluidOSProfile"][];
|
|
375
|
+
screens: components["schemas"]["FluidOSScreenBasic"][];
|
|
376
|
+
navigations: components["schemas"]["FluidOSNavigationBasic"][];
|
|
377
|
+
themes: components["schemas"]["FluidOSTheme"][];
|
|
378
|
+
}; /** FluidOS::Definition */
|
|
379
|
+
FluidOSDefinitionBasic: {
|
|
380
|
+
id: number;
|
|
381
|
+
name?: string | null;
|
|
382
|
+
active?: boolean | null;
|
|
383
|
+
};
|
|
384
|
+
FluidOSDefinitionCreate: {
|
|
385
|
+
definition: {
|
|
386
|
+
name: string;
|
|
387
|
+
active?: boolean;
|
|
388
|
+
};
|
|
389
|
+
};
|
|
390
|
+
FluidOSDefinitionUpdate: {
|
|
391
|
+
definition: {
|
|
392
|
+
name?: string;
|
|
393
|
+
active?: boolean;
|
|
394
|
+
};
|
|
395
|
+
}; /** FluidOS::Screen */
|
|
396
|
+
FluidOSScreenBasic: {
|
|
397
|
+
id: number;
|
|
398
|
+
name?: string | null;
|
|
399
|
+
slug?: string | null;
|
|
400
|
+
definition_id: number;
|
|
401
|
+
};
|
|
402
|
+
FluidOSScreenCreate: {
|
|
403
|
+
screen: {
|
|
404
|
+
name: string;
|
|
405
|
+
slug: string;
|
|
406
|
+
component_tree?: null | Record<string, unknown>;
|
|
407
|
+
};
|
|
408
|
+
};
|
|
409
|
+
FluidOSScreenUpdate: {
|
|
410
|
+
screen?: unknown;
|
|
411
|
+
}; /** FluidOS::Profile */
|
|
412
|
+
FluidOSProfile: {
|
|
413
|
+
id: number;
|
|
414
|
+
name?: string | null;
|
|
415
|
+
default?: boolean | null;
|
|
416
|
+
permissions?: components["schemas"]["FluidOSPermissions"] | null;
|
|
417
|
+
definition_id: number;
|
|
418
|
+
navigation: components["schemas"]["FluidOSNavigationWithItems"];
|
|
419
|
+
mobile_navigation: components["schemas"]["FluidOSNavigationWithItems"];
|
|
420
|
+
themes: components["schemas"]["FluidOSTheme"][];
|
|
421
|
+
}; /** FluidOS::Profile */
|
|
422
|
+
FluidOSProfileWithScreens: {
|
|
423
|
+
id: number;
|
|
424
|
+
name?: string | null;
|
|
425
|
+
default?: boolean | null;
|
|
426
|
+
permissions?: components["schemas"]["FluidOSPermissions"] | null;
|
|
427
|
+
definition_id: number;
|
|
428
|
+
navigation: components["schemas"]["FluidOSNavigationWithItems"];
|
|
429
|
+
mobile_navigation: components["schemas"]["FluidOSNavigationWithItems"];
|
|
430
|
+
themes: components["schemas"]["FluidOSTheme"][];
|
|
431
|
+
screens: {
|
|
432
|
+
[key: string]: unknown;
|
|
433
|
+
}[];
|
|
434
|
+
};
|
|
435
|
+
FluidOSProfileCreate: {
|
|
436
|
+
profile: {
|
|
437
|
+
name: string;
|
|
438
|
+
default?: boolean; /** @description Mutually exclusive with navigation_attributes */
|
|
439
|
+
navigation_id?: number; /** @description Mutually exclusive with mobile_navigation_attributes */
|
|
440
|
+
mobile_navigation_id?: number; /** @description Mutually exclusive with navigation_id */
|
|
441
|
+
navigation_attributes?: {
|
|
442
|
+
name: string;
|
|
443
|
+
navigation_items_attributes?: {
|
|
444
|
+
screen_id?: number;
|
|
445
|
+
icon?: string;
|
|
446
|
+
label?: string;
|
|
447
|
+
position?: number;
|
|
448
|
+
parent_id?: number;
|
|
449
|
+
slug?: string; /** @enum {null|string} */
|
|
450
|
+
source?: "user" | "system" | "code" | null;
|
|
451
|
+
}[];
|
|
452
|
+
}; /** @description Mutually exclusive with mobile_navigation_id */
|
|
453
|
+
mobile_navigation_attributes?: {
|
|
454
|
+
name: string;
|
|
455
|
+
navigation_items_attributes?: {
|
|
456
|
+
screen_id?: number;
|
|
457
|
+
icon?: string;
|
|
458
|
+
label?: string;
|
|
459
|
+
position?: number;
|
|
460
|
+
parent_id?: number;
|
|
461
|
+
slug?: string; /** @enum {null|string} */
|
|
462
|
+
source?: "user" | "system" | "code" | null;
|
|
463
|
+
}[];
|
|
464
|
+
};
|
|
465
|
+
theme_ids?: number[];
|
|
466
|
+
permissions?: {
|
|
467
|
+
countries?: number[];
|
|
468
|
+
ranks?: number[];
|
|
469
|
+
roles?: string[];
|
|
470
|
+
platform?: string[];
|
|
471
|
+
};
|
|
472
|
+
};
|
|
473
|
+
};
|
|
474
|
+
FluidOSProfileUpdate: {
|
|
475
|
+
profile: {
|
|
476
|
+
name?: string;
|
|
477
|
+
default?: boolean;
|
|
478
|
+
navigation_id?: number;
|
|
479
|
+
mobile_navigation_id?: number;
|
|
480
|
+
theme_ids?: number[];
|
|
481
|
+
permissions?: {
|
|
482
|
+
countries?: number[];
|
|
483
|
+
ranks?: number[];
|
|
484
|
+
roles?: string[];
|
|
485
|
+
platform?: string[];
|
|
486
|
+
};
|
|
487
|
+
};
|
|
488
|
+
};
|
|
489
|
+
FluidOSThemeCreate: {
|
|
490
|
+
theme: {
|
|
491
|
+
name: string;
|
|
492
|
+
config: Record<string, unknown>;
|
|
493
|
+
active?: boolean;
|
|
494
|
+
};
|
|
495
|
+
};
|
|
496
|
+
FluidOSThemeUpdate: {
|
|
497
|
+
theme: {
|
|
498
|
+
name?: string;
|
|
499
|
+
active?: boolean;
|
|
500
|
+
config?: Record<string, unknown>;
|
|
501
|
+
};
|
|
502
|
+
}; /** FluidOS::Navigation */
|
|
503
|
+
FluidOSNavigation: {
|
|
504
|
+
id: number;
|
|
505
|
+
name?: string | null;
|
|
506
|
+
definition_id: number; /** @enum {string} */
|
|
507
|
+
platform: "web" | "mobile";
|
|
508
|
+
screens: {
|
|
509
|
+
id: number;
|
|
510
|
+
name?: string | null;
|
|
511
|
+
slug?: string | null;
|
|
512
|
+
definition_id: number;
|
|
513
|
+
component_tree?: Record<string, unknown> | null;
|
|
514
|
+
}[];
|
|
515
|
+
}; /** FluidOS::Navigation */
|
|
516
|
+
FluidOSNavigationWithItems: {
|
|
517
|
+
id: number;
|
|
518
|
+
name?: string | null;
|
|
519
|
+
definition_id: number; /** @enum {string} */
|
|
520
|
+
platform: "web" | "mobile";
|
|
521
|
+
navigation_items: components["schemas"]["FluidOSNavigationItem"][];
|
|
522
|
+
};
|
|
523
|
+
FluidOSNavigationCreate: {
|
|
524
|
+
navigation: {
|
|
525
|
+
name: string; /** @enum {string} */
|
|
526
|
+
platform: "web" | "mobile";
|
|
527
|
+
};
|
|
528
|
+
};
|
|
529
|
+
FluidOSNavigationUpdate: {
|
|
530
|
+
navigation: {
|
|
531
|
+
name?: string; /** @enum {string} */
|
|
532
|
+
platform?: "web" | "mobile";
|
|
533
|
+
};
|
|
534
|
+
};
|
|
535
|
+
FluidOSNavigationItemCreate: {
|
|
536
|
+
navigation_item: {
|
|
537
|
+
icon?: string;
|
|
538
|
+
label: string;
|
|
539
|
+
position: number;
|
|
540
|
+
parent_id?: null | number;
|
|
541
|
+
screen_id?: null | number;
|
|
542
|
+
slug?: null | string; /** @enum {null|string} */
|
|
543
|
+
source?: "user" | "system" | "code" | null;
|
|
544
|
+
};
|
|
545
|
+
};
|
|
546
|
+
FluidOSNavigationItemUpdate: {
|
|
547
|
+
navigation_item: {
|
|
548
|
+
icon?: string;
|
|
549
|
+
label?: string;
|
|
550
|
+
position?: number;
|
|
551
|
+
parent_id?: null | number;
|
|
552
|
+
screen_id?: null | number;
|
|
553
|
+
slug?: null | string; /** @enum {null|string} */
|
|
554
|
+
source?: "user" | "system" | "code" | null;
|
|
555
|
+
};
|
|
556
|
+
}; /** FluidOS::Version */
|
|
557
|
+
FluidOSVersion: {
|
|
558
|
+
id: number;
|
|
559
|
+
active?: boolean | null;
|
|
560
|
+
manifest?: Record<string, unknown> | null; /** Format: date-time */
|
|
561
|
+
published_at?: string | null;
|
|
562
|
+
definition_id: number;
|
|
563
|
+
};
|
|
564
|
+
FluidOSVersionUpdate: {
|
|
565
|
+
version: {
|
|
566
|
+
active?: boolean;
|
|
567
|
+
};
|
|
568
|
+
};
|
|
569
|
+
};
|
|
570
|
+
responses: never;
|
|
571
|
+
parameters: never;
|
|
572
|
+
requestBodies: never;
|
|
573
|
+
headers: never;
|
|
574
|
+
pathItems: never;
|
|
575
|
+
}
|
|
576
|
+
//#endregion
|
|
577
|
+
//#region src/client/types.d.ts
|
|
578
|
+
/**
|
|
579
|
+
* HTTP methods supported by the API client.
|
|
580
|
+
* Use `as const` for literal type inference and type safety.
|
|
581
|
+
*/
|
|
582
|
+
declare const HTTP_METHODS: {
|
|
583
|
+
readonly GET: "GET";
|
|
584
|
+
readonly POST: "POST";
|
|
585
|
+
readonly PUT: "PUT";
|
|
586
|
+
readonly PATCH: "PATCH";
|
|
587
|
+
readonly DELETE: "DELETE";
|
|
588
|
+
};
|
|
589
|
+
/**
|
|
590
|
+
* Union type of all supported HTTP methods.
|
|
591
|
+
* Derived from HTTP_METHODS constant to avoid duplication.
|
|
592
|
+
*/
|
|
593
|
+
type HttpMethod = (typeof HTTP_METHODS)[keyof typeof HTTP_METHODS];
|
|
594
|
+
/**
|
|
595
|
+
* Configuration for the Fluid SDK client.
|
|
596
|
+
* Use Readonly<FluidSDKConfig> when the config should not be modified after creation.
|
|
597
|
+
*/
|
|
598
|
+
interface FluidSDKConfig {
|
|
599
|
+
/**
|
|
600
|
+
* Base URL for API requests.
|
|
601
|
+
* Accepts either the domain root (e.g., "https://api.fluid.app") or
|
|
602
|
+
* with the /api path (e.g., "https://api.fluid.app/api").
|
|
603
|
+
* The SDK normalizes internally for each consumer.
|
|
604
|
+
*/
|
|
605
|
+
readonly baseUrl: string;
|
|
606
|
+
/**
|
|
607
|
+
* Function to retrieve the authentication token
|
|
608
|
+
* Return null/undefined if no token is available
|
|
609
|
+
*/
|
|
610
|
+
readonly getAuthToken?: () => string | null | Promise<string | null>;
|
|
611
|
+
/**
|
|
612
|
+
* Callback invoked when a 401 authentication error occurs
|
|
613
|
+
* Use this to trigger re-authentication flows
|
|
614
|
+
*/
|
|
615
|
+
readonly onAuthError?: () => void;
|
|
616
|
+
/**
|
|
617
|
+
* Default headers to include in all requests
|
|
618
|
+
* Example: { "x-fluid-client": "portal" }
|
|
619
|
+
*/
|
|
620
|
+
readonly defaultHeaders?: Readonly<Record<string, string>>;
|
|
621
|
+
/**
|
|
622
|
+
* Filestack API key for messaging file uploads.
|
|
623
|
+
* If not provided, file attachments will be disabled in the messaging composer.
|
|
624
|
+
*/
|
|
625
|
+
readonly filestackApiKey?: string;
|
|
626
|
+
/**
|
|
627
|
+
* Override WebSocket URL for real-time messaging.
|
|
628
|
+
* Default: derived from baseUrl by replacing trailing /api with /cable
|
|
629
|
+
*/
|
|
630
|
+
readonly websocketUrl?: string;
|
|
631
|
+
}
|
|
632
|
+
/**
|
|
633
|
+
* Options for individual API requests.
|
|
634
|
+
* Uses HttpMethod type for method to ensure type safety.
|
|
635
|
+
*/
|
|
636
|
+
interface RequestOptions {
|
|
637
|
+
readonly method?: HttpMethod;
|
|
638
|
+
readonly body?: unknown;
|
|
639
|
+
readonly params?: Readonly<Record<string, unknown>>;
|
|
640
|
+
readonly headers?: Readonly<Record<string, string>>;
|
|
641
|
+
readonly signal?: AbortSignal;
|
|
642
|
+
}
|
|
643
|
+
/**
|
|
644
|
+
* Pagination parameters for list endpoints
|
|
645
|
+
*/
|
|
646
|
+
interface PaginationParams {
|
|
647
|
+
readonly page?: number;
|
|
648
|
+
readonly per_page?: number;
|
|
649
|
+
}
|
|
650
|
+
/**
|
|
651
|
+
* Sort order constant - single source of truth for sort direction values.
|
|
652
|
+
* Use SORT_ORDERS.asc instead of "asc" for type-safe comparisons.
|
|
653
|
+
*/
|
|
654
|
+
declare const SORT_ORDERS: {
|
|
655
|
+
readonly asc: "asc";
|
|
656
|
+
readonly desc: "desc";
|
|
657
|
+
};
|
|
658
|
+
/**
|
|
659
|
+
* Union type of sort order values, derived from SORT_ORDERS constant.
|
|
660
|
+
* @see deriving-typeof-for-object-keys pattern
|
|
661
|
+
*/
|
|
662
|
+
type SortOrder = (typeof SORT_ORDERS)[keyof typeof SORT_ORDERS];
|
|
663
|
+
/**
|
|
664
|
+
* Common filter parameters for list endpoints
|
|
665
|
+
*/
|
|
666
|
+
interface BaseListParams extends PaginationParams {
|
|
667
|
+
readonly sort_by?: string;
|
|
668
|
+
readonly sort_order?: SortOrder;
|
|
669
|
+
readonly search?: string;
|
|
670
|
+
}
|
|
671
|
+
//#endregion
|
|
672
|
+
//#region src/transforms/screen-transforms.d.ts
|
|
673
|
+
/** Raw screen from the FluidOS API */
|
|
674
|
+
interface RawApiScreen {
|
|
675
|
+
id: number | string;
|
|
676
|
+
definition_id?: number | string;
|
|
677
|
+
name?: string | null;
|
|
678
|
+
slug?: string | null;
|
|
679
|
+
component_tree?: unknown;
|
|
680
|
+
}
|
|
681
|
+
/**
|
|
682
|
+
* Normalize component_tree to always be an array.
|
|
683
|
+
* The API stores component_tree as a hash (object), but the frontend expects an array.
|
|
684
|
+
*/
|
|
685
|
+
declare function normalizeComponentTree(componentTree: unknown): WidgetSchema$1[];
|
|
686
|
+
/**
|
|
687
|
+
* Convert a raw FluidOS screen to ScreenDefinition.
|
|
688
|
+
* Normalizes component_tree and converts string IDs to numbers.
|
|
689
|
+
*/
|
|
690
|
+
declare function toScreenDefinition(screen: RawApiScreen): ScreenDefinition$1;
|
|
691
|
+
//#endregion
|
|
692
|
+
//#region src/transforms/navigation-transforms.d.ts
|
|
693
|
+
/** Raw navigation item from the FluidOS API (derived from generated types) */
|
|
694
|
+
type RawApiNavigationItem = components["schemas"]["FluidOSNavigationItem"];
|
|
695
|
+
/**
|
|
696
|
+
* Convert a raw FluidOS navigation item to NavigationItem.
|
|
697
|
+
* Recursively transforms children and sorts by position.
|
|
698
|
+
*/
|
|
699
|
+
declare function toNavigationItem(item: RawApiNavigationItem): NavigationItem$1;
|
|
700
|
+
//#endregion
|
|
701
|
+
//#region src/transforms/index.d.ts
|
|
702
|
+
/** Raw manifest shape from the `/fluid_os/definitions/active` API response */
|
|
703
|
+
interface RawManifestResponse {
|
|
704
|
+
manifest: {
|
|
705
|
+
definition_id: number;
|
|
706
|
+
published_version?: number;
|
|
707
|
+
screens?: RawApiScreen[];
|
|
708
|
+
profile?: {
|
|
709
|
+
name?: string;
|
|
710
|
+
definition_id: number;
|
|
711
|
+
themes?: RawApiTheme$1[];
|
|
712
|
+
navigation?: {
|
|
713
|
+
id: number;
|
|
714
|
+
name?: string;
|
|
715
|
+
definition_id: number;
|
|
716
|
+
navigation_items?: RawApiNavigationItem[];
|
|
717
|
+
};
|
|
718
|
+
mobile_navigation?: {
|
|
719
|
+
id: number;
|
|
720
|
+
name?: string;
|
|
721
|
+
definition_id: number;
|
|
722
|
+
navigation_items?: RawApiNavigationItem[];
|
|
723
|
+
};
|
|
724
|
+
};
|
|
725
|
+
};
|
|
726
|
+
}
|
|
727
|
+
/**
|
|
728
|
+
* Transform a raw FluidOS manifest API response into RepAppData.
|
|
729
|
+
*
|
|
730
|
+
* This is the top-level transform used by `FluidClient.app.get()`.
|
|
731
|
+
* It handles:
|
|
732
|
+
* - Theme transformation (legacy and new formats)
|
|
733
|
+
* - Screen normalization (component_tree array wrapping)
|
|
734
|
+
* - Navigation item transformation (recursive with position sorting)
|
|
735
|
+
*/
|
|
736
|
+
declare function transformManifestToRepAppData(response: RawManifestResponse): RepAppData$1;
|
|
737
|
+
//#endregion
|
|
738
|
+
//#region src/client/fluid-client.d.ts
|
|
739
|
+
/**
|
|
740
|
+
* API Error class for structured error handling
|
|
741
|
+
*/
|
|
742
|
+
declare class ApiError extends Error {
|
|
743
|
+
readonly status: number;
|
|
744
|
+
readonly data: unknown;
|
|
745
|
+
constructor(message: string, status: number, data?: unknown);
|
|
746
|
+
toJSON(): {
|
|
747
|
+
name: string;
|
|
748
|
+
message: string;
|
|
749
|
+
status: number;
|
|
750
|
+
data: unknown;
|
|
751
|
+
};
|
|
752
|
+
}
|
|
753
|
+
/**
|
|
754
|
+
* Type guard for ApiError
|
|
755
|
+
*/
|
|
756
|
+
declare function isApiError(error: unknown): error is ApiError;
|
|
757
|
+
/**
|
|
758
|
+
* Discriminated union representing the result of an API call.
|
|
759
|
+
* Use `isApiSuccess` and `isApiFailure` type guards to narrow.
|
|
760
|
+
*/
|
|
761
|
+
type ApiResult<T> = {
|
|
762
|
+
readonly success: true;
|
|
763
|
+
readonly data: T;
|
|
764
|
+
} | {
|
|
765
|
+
readonly success: false;
|
|
766
|
+
readonly error: ApiError;
|
|
767
|
+
};
|
|
768
|
+
interface Product {
|
|
769
|
+
readonly id: number;
|
|
770
|
+
readonly title: string;
|
|
771
|
+
readonly sku?: string | null;
|
|
772
|
+
readonly price: string | number;
|
|
773
|
+
readonly description?: string | null;
|
|
774
|
+
readonly image_url?: string;
|
|
775
|
+
readonly status?: string;
|
|
776
|
+
readonly active?: boolean;
|
|
777
|
+
readonly slug?: string;
|
|
778
|
+
readonly in_stock?: boolean;
|
|
779
|
+
readonly display_price?: string;
|
|
780
|
+
readonly currency_code?: string;
|
|
781
|
+
readonly updated_at?: string;
|
|
782
|
+
}
|
|
783
|
+
interface ProductListParams extends BaseListParams {
|
|
784
|
+
readonly search_query?: string;
|
|
785
|
+
readonly status?: readonly ("active" | "draft" | "archived" | "all")[];
|
|
786
|
+
readonly category_id?: string;
|
|
787
|
+
readonly category_ids?: readonly number[];
|
|
788
|
+
readonly collection_id?: string;
|
|
789
|
+
readonly collection_ids?: readonly number[];
|
|
790
|
+
readonly order_by?: readonly string[];
|
|
791
|
+
readonly country_code?: readonly string[];
|
|
792
|
+
readonly published_stores?: readonly ("retail" | "rep")[];
|
|
793
|
+
}
|
|
794
|
+
interface ProductsResponse {
|
|
795
|
+
readonly products: readonly Product[];
|
|
796
|
+
readonly meta: {
|
|
797
|
+
readonly request_id: string;
|
|
798
|
+
readonly timestamp: string;
|
|
799
|
+
readonly pagination?: {
|
|
800
|
+
readonly current_page: number;
|
|
801
|
+
readonly per_page: number;
|
|
802
|
+
readonly total_pages: number;
|
|
803
|
+
readonly total_count: number;
|
|
804
|
+
};
|
|
805
|
+
};
|
|
806
|
+
}
|
|
807
|
+
interface Order {
|
|
808
|
+
readonly id: string;
|
|
809
|
+
readonly order_number: string;
|
|
810
|
+
readonly status: string;
|
|
811
|
+
readonly total: number;
|
|
812
|
+
readonly customer_id: string;
|
|
813
|
+
readonly rep_id?: string;
|
|
814
|
+
readonly created_at: string;
|
|
815
|
+
readonly updated_at: string;
|
|
816
|
+
}
|
|
817
|
+
interface OrderListParams extends BaseListParams {
|
|
818
|
+
readonly status?: string;
|
|
819
|
+
readonly customer_id?: string;
|
|
820
|
+
readonly date_from?: string;
|
|
821
|
+
readonly date_to?: string;
|
|
822
|
+
}
|
|
823
|
+
interface CreateOrderData {
|
|
824
|
+
readonly customer_id: string;
|
|
825
|
+
readonly line_items: readonly OrderLineItem[];
|
|
826
|
+
readonly notes?: string;
|
|
827
|
+
}
|
|
828
|
+
interface OrderLineItem {
|
|
829
|
+
readonly product_id: string;
|
|
830
|
+
readonly quantity: number;
|
|
831
|
+
readonly price?: number;
|
|
832
|
+
}
|
|
833
|
+
interface DashboardData {
|
|
834
|
+
readonly total_sales: number;
|
|
835
|
+
readonly total_orders: number;
|
|
836
|
+
readonly total_customers: number;
|
|
837
|
+
readonly recent_orders: readonly Order[];
|
|
838
|
+
}
|
|
839
|
+
interface SalesParams {
|
|
840
|
+
readonly date_from?: string;
|
|
841
|
+
readonly date_to?: string;
|
|
842
|
+
readonly group_by?: "day" | "week" | "month";
|
|
843
|
+
}
|
|
844
|
+
interface SalesData {
|
|
845
|
+
readonly total: number;
|
|
846
|
+
readonly data: readonly SalesDataPoint[];
|
|
847
|
+
}
|
|
848
|
+
interface SalesDataPoint {
|
|
849
|
+
readonly date: string;
|
|
850
|
+
readonly amount: number;
|
|
851
|
+
readonly orders: number;
|
|
852
|
+
}
|
|
853
|
+
/**
|
|
854
|
+
* The shape returned by `createFluidClient`.
|
|
855
|
+
* Generic helper methods preserve their type parameters so callers
|
|
856
|
+
* can specify response types at each call site.
|
|
857
|
+
*/
|
|
858
|
+
interface FluidClientReturn {
|
|
859
|
+
readonly fetchClient: FetchClient;
|
|
860
|
+
readonly request: <TResponse = unknown>(endpoint: string, options?: RequestOptions) => Promise<TResponse>;
|
|
861
|
+
readonly requestNullable: <TResponse>(endpoint: string, options?: RequestOptions) => Promise<TResponse | null>;
|
|
862
|
+
readonly safeRequest: <TResponse>(endpoint: string, options?: RequestOptions) => Promise<ApiResult<TResponse>>;
|
|
863
|
+
readonly get: <TResponse = unknown, TParams extends object = Record<string, unknown>>(endpoint: string, params?: TParams, options?: Omit<RequestOptions, "method" | "params">) => Promise<TResponse>;
|
|
864
|
+
readonly post: <TResponse = unknown>(endpoint: string, body?: unknown, options?: Omit<RequestOptions, "method" | "body">) => Promise<TResponse>;
|
|
865
|
+
readonly put: <TResponse = unknown>(endpoint: string, body?: unknown, options?: Omit<RequestOptions, "method" | "body">) => Promise<TResponse>;
|
|
866
|
+
readonly patch: <TResponse = unknown>(endpoint: string, body?: unknown, options?: Omit<RequestOptions, "method" | "body">) => Promise<TResponse>;
|
|
867
|
+
readonly delete: <TResponse = unknown>(endpoint: string, options?: Omit<RequestOptions, "method">) => Promise<TResponse>;
|
|
868
|
+
readonly products: {
|
|
869
|
+
readonly list: (params?: ProductListParams) => Promise<ProductsResponse>;
|
|
870
|
+
readonly get: (id: string | number) => Promise<{
|
|
871
|
+
product: Product;
|
|
872
|
+
}>;
|
|
873
|
+
readonly search: (query: string, params?: ProductListParams) => Promise<ProductsResponse>;
|
|
874
|
+
};
|
|
875
|
+
readonly orders: {
|
|
876
|
+
readonly list: (params?: OrderListParams) => Promise<Order[]>;
|
|
877
|
+
readonly get: (id: string) => Promise<Order>;
|
|
878
|
+
readonly create: (data: CreateOrderData) => Promise<Order>;
|
|
879
|
+
};
|
|
880
|
+
readonly users: {
|
|
881
|
+
readonly me: () => Promise<UserMe>;
|
|
882
|
+
};
|
|
883
|
+
readonly reps: {
|
|
884
|
+
readonly current: () => Promise<Rep>;
|
|
885
|
+
readonly updateProfile: (data: UpdateRepData) => Promise<Rep>;
|
|
886
|
+
};
|
|
887
|
+
readonly profile: {
|
|
888
|
+
readonly get: () => Promise<Profile>;
|
|
889
|
+
};
|
|
890
|
+
readonly app: {
|
|
891
|
+
readonly getRaw: () => Promise<RawManifestResponse>;
|
|
892
|
+
readonly get: () => Promise<RepAppData$1>;
|
|
893
|
+
};
|
|
894
|
+
readonly permissions: {
|
|
895
|
+
readonly get: () => Promise<UserPermissions>;
|
|
896
|
+
};
|
|
897
|
+
readonly analytics: {
|
|
898
|
+
readonly dashboard: () => Promise<DashboardData>;
|
|
899
|
+
readonly sales: (params?: SalesParams) => Promise<SalesData>;
|
|
900
|
+
};
|
|
901
|
+
}
|
|
902
|
+
/**
|
|
903
|
+
* Creates a configured Fluid API client instance
|
|
904
|
+
*/
|
|
905
|
+
declare function createFluidClient(config: FluidSDKConfig): FluidClientReturn;
|
|
906
|
+
type FluidClient = ReturnType<typeof createFluidClient>;
|
|
907
|
+
//#endregion
|
|
908
|
+
//#region src/providers/FluidProvider.d.ts
|
|
909
|
+
/**
|
|
910
|
+
* Context value for FluidProvider.
|
|
911
|
+
* All properties are readonly since context values should not be mutated by consumers.
|
|
912
|
+
*/
|
|
913
|
+
interface FluidContextValue {
|
|
914
|
+
/** Configured API client instance */
|
|
915
|
+
readonly client: FluidClient;
|
|
916
|
+
/** SDK configuration */
|
|
917
|
+
readonly config: FluidSDKConfig;
|
|
918
|
+
}
|
|
919
|
+
interface FluidProviderProps {
|
|
920
|
+
/** SDK configuration (baseUrl, auth, etc.) */
|
|
921
|
+
config: FluidSDKConfig;
|
|
922
|
+
/** React children */
|
|
923
|
+
children: ReactNode;
|
|
924
|
+
/** Optional custom QueryClient instance */
|
|
925
|
+
queryClient?: QueryClient;
|
|
926
|
+
/** Optional initial theme */
|
|
927
|
+
initialTheme?: ThemeDefinition;
|
|
928
|
+
/** Optional container for scoped theme application */
|
|
929
|
+
themeContainer?: HTMLElement | null;
|
|
930
|
+
/** Optional custom widget registry (defaults to all built-in widgets) */
|
|
931
|
+
widgetRegistry?: Record<string, React.ComponentType<any>>;
|
|
932
|
+
/** Dynamic variables for data source endpoint path substitution (e.g., { rep_id: "123" }) */
|
|
933
|
+
variables?: Record<string, string>;
|
|
934
|
+
}
|
|
935
|
+
/**
|
|
936
|
+
* Main provider for the Fluid Portal SDK
|
|
937
|
+
*
|
|
938
|
+
* @example
|
|
939
|
+
* ```tsx
|
|
940
|
+
* import { FluidProvider } from "@fluid-app/portal-sdk";
|
|
941
|
+
*
|
|
942
|
+
* function App() {
|
|
943
|
+
* return (
|
|
944
|
+
* <FluidProvider
|
|
945
|
+
* config={{
|
|
946
|
+
* baseUrl: "https://api.fluid.app/api",
|
|
947
|
+
* getAuthToken: () => localStorage.getItem("token"),
|
|
948
|
+
* }}
|
|
949
|
+
* >
|
|
950
|
+
* <YourApp />
|
|
951
|
+
* </FluidProvider>
|
|
952
|
+
* );
|
|
953
|
+
* }
|
|
954
|
+
* ```
|
|
955
|
+
*/
|
|
956
|
+
declare function FluidProvider({
|
|
957
|
+
config,
|
|
958
|
+
children,
|
|
959
|
+
queryClient,
|
|
960
|
+
initialTheme,
|
|
961
|
+
themeContainer,
|
|
962
|
+
widgetRegistry,
|
|
963
|
+
variables
|
|
964
|
+
}: FluidProviderProps): React.JSX.Element;
|
|
965
|
+
/**
|
|
966
|
+
* Hook to access the Fluid context
|
|
967
|
+
* Must be used within a FluidProvider
|
|
968
|
+
*/
|
|
969
|
+
declare function useFluidContext(): FluidContextValue;
|
|
970
|
+
//#endregion
|
|
971
|
+
//#region src/providers/FluidThemeProvider.d.ts
|
|
972
|
+
type ThemeMode$1 = "light" | "dark";
|
|
973
|
+
/**
|
|
974
|
+
* Context value for theme management.
|
|
975
|
+
* All properties are readonly since context values should not be mutated by consumers.
|
|
976
|
+
*/
|
|
977
|
+
interface ThemeContextValue {
|
|
978
|
+
/** Currently active theme definition */
|
|
979
|
+
readonly currentTheme: ThemeDefinition | null;
|
|
980
|
+
/** Switch to a different theme */
|
|
981
|
+
readonly setTheme: (theme: ThemeDefinition) => void;
|
|
982
|
+
/** Switch between light and dark mode for the current theme */
|
|
983
|
+
readonly setThemeMode: (mode: ThemeMode$1) => void;
|
|
984
|
+
/** Current theme mode */
|
|
985
|
+
readonly mode: ThemeMode$1 | undefined;
|
|
986
|
+
}
|
|
987
|
+
interface FluidThemeProviderProps {
|
|
988
|
+
children: ReactNode;
|
|
989
|
+
/** Initial theme to apply */
|
|
990
|
+
initialTheme?: ThemeDefinition;
|
|
991
|
+
/** Container element for scoped theme application (defaults to document.documentElement) */
|
|
992
|
+
container?: HTMLElement | null;
|
|
993
|
+
}
|
|
994
|
+
declare function FluidThemeProvider({
|
|
995
|
+
children,
|
|
996
|
+
initialTheme,
|
|
997
|
+
container
|
|
998
|
+
}: FluidThemeProviderProps): React.JSX.Element;
|
|
999
|
+
/**
|
|
1000
|
+
* Hook to access theme context
|
|
1001
|
+
* Must be used within a FluidThemeProvider
|
|
1002
|
+
*/
|
|
1003
|
+
declare function useThemeContext(): ThemeContextValue;
|
|
1004
|
+
//#endregion
|
|
1005
|
+
//#region src/providers/FluidAuthProvider.d.ts
|
|
1006
|
+
interface FluidAuthProviderProps {
|
|
1007
|
+
/** React children to wrap with auth context */
|
|
1008
|
+
children: ReactNode;
|
|
1009
|
+
/** Auth configuration options */
|
|
1010
|
+
config?: FluidAuthConfig;
|
|
1011
|
+
}
|
|
1012
|
+
/**
|
|
1013
|
+
* Authentication provider for Fluid portal applications.
|
|
1014
|
+
*
|
|
1015
|
+
* On mount, this provider:
|
|
1016
|
+
* 1. Checks for a token in the URL (passed from parent app)
|
|
1017
|
+
* 2. Cleans token from URL immediately (security)
|
|
1018
|
+
* 3. Falls back to stored token (cookie/localStorage)
|
|
1019
|
+
* 4. Validates the token (checks expiration)
|
|
1020
|
+
* 5. Stores valid tokens for future use
|
|
1021
|
+
* 6. Calls onAuthFailure if no valid token found
|
|
1022
|
+
*
|
|
1023
|
+
* @example
|
|
1024
|
+
* ```tsx
|
|
1025
|
+
* import { FluidAuthProvider } from "@fluid-app/portal-sdk";
|
|
1026
|
+
*
|
|
1027
|
+
* function App() {
|
|
1028
|
+
* return (
|
|
1029
|
+
* <FluidAuthProvider
|
|
1030
|
+
* config={{
|
|
1031
|
+
* onAuthFailure: () => {
|
|
1032
|
+
* window.location.href = "/login";
|
|
1033
|
+
* },
|
|
1034
|
+
* }}
|
|
1035
|
+
* >
|
|
1036
|
+
* <YourApp />
|
|
1037
|
+
* </FluidAuthProvider>
|
|
1038
|
+
* );
|
|
1039
|
+
* }
|
|
1040
|
+
* ```
|
|
1041
|
+
*/
|
|
1042
|
+
declare function FluidAuthProvider({
|
|
1043
|
+
children,
|
|
1044
|
+
config
|
|
1045
|
+
}: FluidAuthProviderProps): React.JSX.Element;
|
|
1046
|
+
/**
|
|
1047
|
+
* Hook to access the auth context directly.
|
|
1048
|
+
* Prefer using `useFluidAuth` for most use cases.
|
|
1049
|
+
*
|
|
1050
|
+
* @throws Error if used outside FluidAuthProvider
|
|
1051
|
+
*/
|
|
1052
|
+
declare function useFluidAuthContext(): FluidAuthContextValue;
|
|
1053
|
+
//#endregion
|
|
1054
|
+
//#region src/types/screen-types.d.ts
|
|
1055
|
+
/**
|
|
1056
|
+
* Screen Types - Type definitions for core feature screens
|
|
1057
|
+
*
|
|
1058
|
+
* All status and type unions are derived from constants for single source of truth.
|
|
1059
|
+
* Use the constants (e.g., CONVERSATION_STATUSES.active) for type-safe comparisons.
|
|
1060
|
+
*/
|
|
1061
|
+
/**
|
|
1062
|
+
* Conversation status constant - single source of truth.
|
|
1063
|
+
*/
|
|
1064
|
+
declare const CONVERSATION_STATUSES: {
|
|
1065
|
+
readonly active: "active";
|
|
1066
|
+
readonly archived: "archived";
|
|
1067
|
+
readonly muted: "muted";
|
|
1068
|
+
};
|
|
1069
|
+
/**
|
|
1070
|
+
* Union type derived from CONVERSATION_STATUSES constant.
|
|
1071
|
+
*/
|
|
1072
|
+
type ConversationStatus = (typeof CONVERSATION_STATUSES)[keyof typeof CONVERSATION_STATUSES];
|
|
1073
|
+
/**
|
|
1074
|
+
* Message type constant - single source of truth.
|
|
1075
|
+
*/
|
|
1076
|
+
declare const MESSAGE_TYPES: {
|
|
1077
|
+
readonly text: "text";
|
|
1078
|
+
readonly image: "image";
|
|
1079
|
+
readonly file: "file";
|
|
1080
|
+
readonly system: "system";
|
|
1081
|
+
};
|
|
1082
|
+
/**
|
|
1083
|
+
* Union type derived from MESSAGE_TYPES constant.
|
|
1084
|
+
*/
|
|
1085
|
+
type MessageType = (typeof MESSAGE_TYPES)[keyof typeof MESSAGE_TYPES];
|
|
1086
|
+
interface Participant {
|
|
1087
|
+
readonly id: string;
|
|
1088
|
+
readonly name: string;
|
|
1089
|
+
readonly email: string;
|
|
1090
|
+
readonly avatarUrl?: string;
|
|
1091
|
+
readonly isOnline?: boolean;
|
|
1092
|
+
}
|
|
1093
|
+
/**
|
|
1094
|
+
* Message attachment type - extracted for reusability and clarity.
|
|
1095
|
+
*/
|
|
1096
|
+
interface MessageAttachment {
|
|
1097
|
+
readonly id: string;
|
|
1098
|
+
readonly name: string;
|
|
1099
|
+
readonly url: string;
|
|
1100
|
+
readonly type: string;
|
|
1101
|
+
readonly size?: number;
|
|
1102
|
+
}
|
|
1103
|
+
interface Message {
|
|
1104
|
+
readonly id: string;
|
|
1105
|
+
readonly conversationId: string;
|
|
1106
|
+
readonly senderId: string;
|
|
1107
|
+
readonly senderName: string;
|
|
1108
|
+
readonly senderAvatarUrl?: string;
|
|
1109
|
+
readonly type: MessageType;
|
|
1110
|
+
readonly content: string;
|
|
1111
|
+
readonly timestamp: string;
|
|
1112
|
+
readonly isRead: boolean;
|
|
1113
|
+
readonly attachments?: readonly MessageAttachment[];
|
|
1114
|
+
}
|
|
1115
|
+
interface Conversation {
|
|
1116
|
+
readonly id: string;
|
|
1117
|
+
readonly title: string;
|
|
1118
|
+
readonly participants: readonly Participant[];
|
|
1119
|
+
readonly lastMessage?: Message;
|
|
1120
|
+
readonly unreadCount: number;
|
|
1121
|
+
readonly status: ConversationStatus;
|
|
1122
|
+
readonly createdAt: string;
|
|
1123
|
+
readonly updatedAt: string;
|
|
1124
|
+
}
|
|
1125
|
+
/**
|
|
1126
|
+
* Contact status constant - single source of truth.
|
|
1127
|
+
*/
|
|
1128
|
+
declare const CONTACT_STATUSES: {
|
|
1129
|
+
readonly active: "active";
|
|
1130
|
+
readonly inactive: "inactive";
|
|
1131
|
+
readonly lead: "lead";
|
|
1132
|
+
readonly prospect: "prospect";
|
|
1133
|
+
};
|
|
1134
|
+
/**
|
|
1135
|
+
* Union type derived from CONTACT_STATUSES constant.
|
|
1136
|
+
*/
|
|
1137
|
+
type ContactStatus = (typeof CONTACT_STATUSES)[keyof typeof CONTACT_STATUSES];
|
|
1138
|
+
/**
|
|
1139
|
+
* Contact type constant - single source of truth.
|
|
1140
|
+
*/
|
|
1141
|
+
declare const CONTACT_TYPES: {
|
|
1142
|
+
readonly individual: "individual";
|
|
1143
|
+
readonly company: "company";
|
|
1144
|
+
};
|
|
1145
|
+
/**
|
|
1146
|
+
* Union type derived from CONTACT_TYPES constant.
|
|
1147
|
+
*/
|
|
1148
|
+
type ContactType = (typeof CONTACT_TYPES)[keyof typeof CONTACT_TYPES];
|
|
1149
|
+
interface ContactAddress {
|
|
1150
|
+
readonly street?: string;
|
|
1151
|
+
readonly city?: string;
|
|
1152
|
+
readonly state?: string;
|
|
1153
|
+
readonly postalCode?: string;
|
|
1154
|
+
readonly country?: string;
|
|
1155
|
+
}
|
|
1156
|
+
interface Contact {
|
|
1157
|
+
readonly id: string;
|
|
1158
|
+
readonly firstName: string;
|
|
1159
|
+
readonly lastName: string;
|
|
1160
|
+
readonly email: string;
|
|
1161
|
+
readonly phone?: string;
|
|
1162
|
+
readonly company?: string;
|
|
1163
|
+
readonly jobTitle?: string;
|
|
1164
|
+
readonly avatarUrl?: string;
|
|
1165
|
+
readonly status: ContactStatus;
|
|
1166
|
+
readonly type: ContactType;
|
|
1167
|
+
readonly address?: ContactAddress;
|
|
1168
|
+
readonly tags?: readonly string[];
|
|
1169
|
+
readonly notes?: string;
|
|
1170
|
+
readonly createdAt: string;
|
|
1171
|
+
readonly updatedAt: string;
|
|
1172
|
+
}
|
|
1173
|
+
//#endregion
|
|
1174
|
+
//#region src/providers/PageTemplateProvider.d.ts
|
|
1175
|
+
/**
|
|
1176
|
+
* Context value for page template resolution.
|
|
1177
|
+
* All properties are readonly since context values should not be mutated by consumers.
|
|
1178
|
+
*/
|
|
1179
|
+
interface PageTemplateContextValue {
|
|
1180
|
+
/**
|
|
1181
|
+
* Resolve a navigation's page_refs and screens into a unified screen list
|
|
1182
|
+
*/
|
|
1183
|
+
readonly resolvePages: (navigation: Navigation) => ScreenDefinition[];
|
|
1184
|
+
/**
|
|
1185
|
+
* Get all available page templates
|
|
1186
|
+
*/
|
|
1187
|
+
readonly listTemplates: () => PageTemplate[];
|
|
1188
|
+
/**
|
|
1189
|
+
* Get a specific template by ID
|
|
1190
|
+
*/
|
|
1191
|
+
readonly getTemplate: (id: string) => PageTemplate | undefined;
|
|
1192
|
+
/**
|
|
1193
|
+
* Check if a template exists
|
|
1194
|
+
*/
|
|
1195
|
+
readonly hasTemplate: (id: string) => boolean;
|
|
1196
|
+
}
|
|
1197
|
+
/**
|
|
1198
|
+
* Props for PageTemplateProvider
|
|
1199
|
+
*/
|
|
1200
|
+
interface PageTemplateProviderProps {
|
|
1201
|
+
children: React$1.ReactNode;
|
|
1202
|
+
/**
|
|
1203
|
+
* Additional custom page templates to register.
|
|
1204
|
+
* These are registered when the provider mounts and unregistered when it unmounts.
|
|
1205
|
+
*/
|
|
1206
|
+
templates?: readonly PageTemplate[];
|
|
1207
|
+
}
|
|
1208
|
+
/**
|
|
1209
|
+
* Provider for page template resolution.
|
|
1210
|
+
*
|
|
1211
|
+
* This provider:
|
|
1212
|
+
* 1. Registers any custom templates passed via props
|
|
1213
|
+
* 2. Provides methods for resolving navigation pages
|
|
1214
|
+
* 3. Cleans up custom templates on unmount
|
|
1215
|
+
*
|
|
1216
|
+
* @example
|
|
1217
|
+
* ```tsx
|
|
1218
|
+
* // With custom templates
|
|
1219
|
+
* const customTemplates: PageTemplate[] = [
|
|
1220
|
+
* {
|
|
1221
|
+
* id: 'custom-dashboard',
|
|
1222
|
+
* slug: 'dashboard',
|
|
1223
|
+
* name: 'Dashboard',
|
|
1224
|
+
* category: 'custom',
|
|
1225
|
+
* version: '1.0.0',
|
|
1226
|
+
* component_tree: [{ type: 'TextWidget', props: { text: 'Custom Dashboard' } }],
|
|
1227
|
+
* },
|
|
1228
|
+
* ];
|
|
1229
|
+
*
|
|
1230
|
+
* <PageTemplateProvider templates={customTemplates}>
|
|
1231
|
+
* <App />
|
|
1232
|
+
* </PageTemplateProvider>
|
|
1233
|
+
*
|
|
1234
|
+
* // Without custom templates (uses only core templates)
|
|
1235
|
+
* <PageTemplateProvider>
|
|
1236
|
+
* <App />
|
|
1237
|
+
* </PageTemplateProvider>
|
|
1238
|
+
* ```
|
|
1239
|
+
*/
|
|
1240
|
+
declare function PageTemplateProvider({
|
|
1241
|
+
children,
|
|
1242
|
+
templates
|
|
1243
|
+
}: PageTemplateProviderProps): React$1.JSX.Element;
|
|
1244
|
+
/**
|
|
1245
|
+
* Hook to access page template functionality.
|
|
1246
|
+
*
|
|
1247
|
+
* @throws Error if used outside of PageTemplateProvider
|
|
1248
|
+
*
|
|
1249
|
+
* @example
|
|
1250
|
+
* ```tsx
|
|
1251
|
+
* function NavigationRenderer({ navigation }: { navigation: Navigation }) {
|
|
1252
|
+
* const { resolvePages } = usePageTemplates();
|
|
1253
|
+
* const screens = resolvePages(navigation);
|
|
1254
|
+
*
|
|
1255
|
+
* return (
|
|
1256
|
+
* <div>
|
|
1257
|
+
* {screens.map((screen) => (
|
|
1258
|
+
* <Screen key={screen.id} definition={screen} />
|
|
1259
|
+
* ))}
|
|
1260
|
+
* </div>
|
|
1261
|
+
* );
|
|
1262
|
+
* }
|
|
1263
|
+
* ```
|
|
1264
|
+
*/
|
|
1265
|
+
declare function usePageTemplates(): PageTemplateContextValue;
|
|
1266
|
+
/**
|
|
1267
|
+
* Hook to resolve navigation pages directly.
|
|
1268
|
+
* Convenience wrapper around usePageTemplates().resolvePages.
|
|
1269
|
+
*
|
|
1270
|
+
* @param navigation - The navigation to resolve
|
|
1271
|
+
* @returns Array of resolved screen definitions
|
|
1272
|
+
*/
|
|
1273
|
+
declare function useResolvedPages(navigation: Navigation): ScreenDefinition[];
|
|
1274
|
+
//#endregion
|
|
1275
|
+
//#region src/hooks/use-fluid-api.d.ts
|
|
1276
|
+
/**
|
|
1277
|
+
* Hook to access the Fluid API client
|
|
1278
|
+
*
|
|
1279
|
+
* @example
|
|
1280
|
+
* ```tsx
|
|
1281
|
+
* function ProductList() {
|
|
1282
|
+
* const api = useFluidApi();
|
|
1283
|
+
*
|
|
1284
|
+
* const { data: products } = useQuery({
|
|
1285
|
+
* queryKey: ["products"],
|
|
1286
|
+
* queryFn: () => api.products.list(),
|
|
1287
|
+
* });
|
|
1288
|
+
*
|
|
1289
|
+
* return <ul>{products?.map(p => <li key={p.id}>{p.name}</li>)}</ul>;
|
|
1290
|
+
* }
|
|
1291
|
+
* ```
|
|
1292
|
+
*/
|
|
1293
|
+
declare function useFluidApi(): FluidClient;
|
|
1294
|
+
//#endregion
|
|
1295
|
+
//#region src/hooks/use-fluid-profile.d.ts
|
|
1296
|
+
/**
|
|
1297
|
+
* Query key for profile data
|
|
1298
|
+
*/
|
|
1299
|
+
declare const PROFILE_QUERY_KEY: readonly ["fluid", "profile"];
|
|
1300
|
+
/**
|
|
1301
|
+
* Hook to fetch the portal profile (themes, navigation, screens)
|
|
1302
|
+
*
|
|
1303
|
+
* @example
|
|
1304
|
+
* ```tsx
|
|
1305
|
+
* function Navigation() {
|
|
1306
|
+
* const { data: profile, isLoading } = useFluidProfile();
|
|
1307
|
+
*
|
|
1308
|
+
* if (isLoading) return <Spinner />;
|
|
1309
|
+
*
|
|
1310
|
+
* return (
|
|
1311
|
+
* <nav>
|
|
1312
|
+
* {profile?.navigation.navigation_items.map(item => (
|
|
1313
|
+
* <NavItem key={item.id} item={item} />
|
|
1314
|
+
* ))}
|
|
1315
|
+
* </nav>
|
|
1316
|
+
* );
|
|
1317
|
+
* }
|
|
1318
|
+
* ```
|
|
1319
|
+
*/
|
|
1320
|
+
declare function useFluidProfile(): UseQueryResult<Profile>;
|
|
1321
|
+
//#endregion
|
|
1322
|
+
//#region src/hooks/use-fluid-app.d.ts
|
|
1323
|
+
/**
|
|
1324
|
+
* Query key for full app data (fluidos endpoint)
|
|
1325
|
+
*/
|
|
1326
|
+
declare const APP_DATA_QUERY_KEY: readonly ["fluid", "app"];
|
|
1327
|
+
/**
|
|
1328
|
+
* Hook to fetch the full portal app data from the fluidos API.
|
|
1329
|
+
*
|
|
1330
|
+
* Returns a `RepAppData` object containing:
|
|
1331
|
+
* - `screens` — all screen definitions with normalized component trees
|
|
1332
|
+
* - `profile.themes` — fully-transformed ThemeDefinition[] (handles legacy + new formats)
|
|
1333
|
+
* - `profile.activeThemeId` — the currently active theme ID
|
|
1334
|
+
* - `profile.navigation.navigation_items` — sorted, recursive navigation tree
|
|
1335
|
+
*
|
|
1336
|
+
* Uses IndexedDB persistence so subsequent page loads hydrate instantly
|
|
1337
|
+
* from cache while revalidating in the background. The raw API response
|
|
1338
|
+
* (plain JSON) is cached; Color objects are recreated from cache via
|
|
1339
|
+
* `select` on every restore — this is fast (CPU only, no network).
|
|
1340
|
+
*
|
|
1341
|
+
* @example
|
|
1342
|
+
* ```tsx
|
|
1343
|
+
* function App() {
|
|
1344
|
+
* const { data: appData, isLoading } = useFluidApp();
|
|
1345
|
+
*
|
|
1346
|
+
* if (isLoading) return <Spinner />;
|
|
1347
|
+
*
|
|
1348
|
+
* return (
|
|
1349
|
+
* <AppShell
|
|
1350
|
+
* appData={appData}
|
|
1351
|
+
* navigation={appData.profile.navigation.navigation_items}
|
|
1352
|
+
* />
|
|
1353
|
+
* );
|
|
1354
|
+
* }
|
|
1355
|
+
* ```
|
|
1356
|
+
*/
|
|
1357
|
+
declare function useFluidApp(options?: {
|
|
1358
|
+
enabled?: boolean;
|
|
1359
|
+
}): UseQueryResult<RepAppData$1>;
|
|
1360
|
+
//#endregion
|
|
1361
|
+
//#region src/hooks/use-fluid-permissions.d.ts
|
|
1362
|
+
/**
|
|
1363
|
+
* Query key for permissions data
|
|
1364
|
+
*/
|
|
1365
|
+
declare const PERMISSIONS_QUERY_KEY: readonly ["fluid", "permissions"];
|
|
1366
|
+
/**
|
|
1367
|
+
* Result of useFluidPermissions hook
|
|
1368
|
+
*/
|
|
1369
|
+
interface UseFluidPermissionsResult {
|
|
1370
|
+
/** Raw permissions query result */
|
|
1371
|
+
query: UseQueryResult<UserPermissions>;
|
|
1372
|
+
/** Permissions data (alias for query.data) */
|
|
1373
|
+
permissions: UserPermissions | undefined;
|
|
1374
|
+
/** Check if user has a specific permission */
|
|
1375
|
+
can: (resource: string, action?: PermissionAction) => boolean;
|
|
1376
|
+
/** Check if user is a super admin */
|
|
1377
|
+
isSuperAdmin: boolean;
|
|
1378
|
+
}
|
|
1379
|
+
/**
|
|
1380
|
+
* Hook to fetch and check user permissions
|
|
1381
|
+
*
|
|
1382
|
+
* @example
|
|
1383
|
+
* ```tsx
|
|
1384
|
+
* function TeamSettings() {
|
|
1385
|
+
* const { can, isSuperAdmin } = useFluidPermissions();
|
|
1386
|
+
*
|
|
1387
|
+
* if (!can("team", "manage")) {
|
|
1388
|
+
* return <AccessDenied />;
|
|
1389
|
+
* }
|
|
1390
|
+
*
|
|
1391
|
+
* return <TeamSettingsForm canDelete={can("team", "delete")} />;
|
|
1392
|
+
* }
|
|
1393
|
+
* ```
|
|
1394
|
+
*/
|
|
1395
|
+
declare function useFluidPermissions(): UseFluidPermissionsResult;
|
|
1396
|
+
//#endregion
|
|
1397
|
+
//#region src/hooks/use-fluid-theme.d.ts
|
|
1398
|
+
/**
|
|
1399
|
+
* Result of useFluidTheme hook
|
|
1400
|
+
*/
|
|
1401
|
+
interface UseFluidThemeResult {
|
|
1402
|
+
/** Currently active theme */
|
|
1403
|
+
currentTheme: ThemeDefinition | null;
|
|
1404
|
+
/** Switch to a different theme */
|
|
1405
|
+
setTheme: (theme: ThemeDefinition) => void;
|
|
1406
|
+
/** Switch between light and dark mode */
|
|
1407
|
+
setThemeMode: (mode: "light" | "dark") => void;
|
|
1408
|
+
/** Current theme mode (convenience accessor) */
|
|
1409
|
+
mode: "light" | "dark" | undefined;
|
|
1410
|
+
}
|
|
1411
|
+
/**
|
|
1412
|
+
* Hook to access and control theme settings
|
|
1413
|
+
*
|
|
1414
|
+
* @example
|
|
1415
|
+
* ```tsx
|
|
1416
|
+
* function ThemeSwitcher({ themes }: { themes: ThemeDefinition[] }) {
|
|
1417
|
+
* const { currentTheme, setTheme, setThemeMode, mode } = useFluidTheme();
|
|
1418
|
+
*
|
|
1419
|
+
* return (
|
|
1420
|
+
* <div>
|
|
1421
|
+
* <select
|
|
1422
|
+
* value={currentTheme?.name}
|
|
1423
|
+
* onChange={(e) => {
|
|
1424
|
+
* const theme = themes.find(t => t.name === e.target.value);
|
|
1425
|
+
* if (theme) setTheme(theme);
|
|
1426
|
+
* }}
|
|
1427
|
+
* >
|
|
1428
|
+
* {themes.map(theme => (
|
|
1429
|
+
* <option key={theme.name} value={theme.name}>
|
|
1430
|
+
* {theme.name}
|
|
1431
|
+
* </option>
|
|
1432
|
+
* ))}
|
|
1433
|
+
* </select>
|
|
1434
|
+
*
|
|
1435
|
+
* <button onClick={() => setThemeMode(mode === "dark" ? "light" : "dark")}>
|
|
1436
|
+
* Toggle {mode === "dark" ? "Light" : "Dark"} Mode
|
|
1437
|
+
* </button>
|
|
1438
|
+
* </div>
|
|
1439
|
+
* );
|
|
1440
|
+
* }
|
|
1441
|
+
* ```
|
|
1442
|
+
*/
|
|
1443
|
+
declare function useFluidTheme(): UseFluidThemeResult;
|
|
1444
|
+
//#endregion
|
|
1445
|
+
//#region src/hooks/use-current-rep.d.ts
|
|
1446
|
+
/**
|
|
1447
|
+
* Query key for current rep data
|
|
1448
|
+
*/
|
|
1449
|
+
declare const CURRENT_REP_QUERY_KEY: readonly ["fluid", "currentRep"];
|
|
1450
|
+
/**
|
|
1451
|
+
* Hook to fetch the currently authenticated rep's profile
|
|
1452
|
+
*
|
|
1453
|
+
* @example
|
|
1454
|
+
* ```tsx
|
|
1455
|
+
* function RepHeader() {
|
|
1456
|
+
* const { data: rep, isLoading } = useCurrentRep();
|
|
1457
|
+
*
|
|
1458
|
+
* if (isLoading) return <Skeleton />;
|
|
1459
|
+
*
|
|
1460
|
+
* return (
|
|
1461
|
+
* <div>
|
|
1462
|
+
* <Avatar src={rep?.avatar_url} />
|
|
1463
|
+
* <span>{rep?.first_name} {rep?.last_name}</span>
|
|
1464
|
+
* </div>
|
|
1465
|
+
* );
|
|
1466
|
+
* }
|
|
1467
|
+
* ```
|
|
1468
|
+
*/
|
|
1469
|
+
declare function useCurrentRep(): UseQueryResult<Rep>;
|
|
1470
|
+
//#endregion
|
|
1471
|
+
//#region src/hooks/use-fluid-auth.d.ts
|
|
1472
|
+
/**
|
|
1473
|
+
* Hook to access authentication state and utilities.
|
|
1474
|
+
*
|
|
1475
|
+
* Must be used within a `FluidAuthProvider`.
|
|
1476
|
+
*
|
|
1477
|
+
* @returns Authentication context with user info, loading state, and utilities
|
|
1478
|
+
* @throws Error if used outside FluidAuthProvider
|
|
1479
|
+
*
|
|
1480
|
+
* @example
|
|
1481
|
+
* ```tsx
|
|
1482
|
+
* function UserProfile() {
|
|
1483
|
+
* const { isAuthenticated, isLoading, user, clearAuth } = useFluidAuth();
|
|
1484
|
+
*
|
|
1485
|
+
* if (isLoading) {
|
|
1486
|
+
* return <Spinner />;
|
|
1487
|
+
* }
|
|
1488
|
+
*
|
|
1489
|
+
* if (!isAuthenticated) {
|
|
1490
|
+
* return <p>Please log in</p>;
|
|
1491
|
+
* }
|
|
1492
|
+
*
|
|
1493
|
+
* return (
|
|
1494
|
+
* <div>
|
|
1495
|
+
* <p>Welcome, {user.full_name}!</p>
|
|
1496
|
+
* <button onClick={clearAuth}>Log out</button>
|
|
1497
|
+
* </div>
|
|
1498
|
+
* );
|
|
1499
|
+
* }
|
|
1500
|
+
* ```
|
|
1501
|
+
*/
|
|
1502
|
+
declare function useFluidAuth(): FluidAuthContextValue;
|
|
1503
|
+
//#endregion
|
|
1504
|
+
//#region src/hooks/hook-types.d.ts
|
|
1505
|
+
/**
|
|
1506
|
+
* Hook type utilities and type predicates.
|
|
1507
|
+
*
|
|
1508
|
+
* This module provides:
|
|
1509
|
+
* - Generic hook result types with default type parameters
|
|
1510
|
+
* - Type predicates for query state narrowing
|
|
1511
|
+
* - Reusable patterns for type-safe property access in hooks
|
|
1512
|
+
*
|
|
1513
|
+
* Following generics best practices:
|
|
1514
|
+
* - generics-default-type-parameters: Default E to Error for common case
|
|
1515
|
+
* - generics-type-predicates: Type predicates for result state narrowing
|
|
1516
|
+
* - generics-constrain-type-parameters: K extends keyof T for property access
|
|
1517
|
+
*/
|
|
1518
|
+
/**
|
|
1519
|
+
* Base result type for query hooks with default error type.
|
|
1520
|
+
* Uses default type parameter for E (generics-default-type-parameters rule).
|
|
1521
|
+
*
|
|
1522
|
+
* @typeParam T - The data type
|
|
1523
|
+
* @typeParam E - The error type (defaults to Error)
|
|
1524
|
+
*
|
|
1525
|
+
* @example
|
|
1526
|
+
* // Error type defaults to Error
|
|
1527
|
+
* type UsersResult = QueryResult<User[]>;
|
|
1528
|
+
*
|
|
1529
|
+
* // Can override when needed
|
|
1530
|
+
* type CustomResult = QueryResult<User[], ApiError>;
|
|
1531
|
+
*/
|
|
1532
|
+
interface QueryResult<T, E = Error> {
|
|
1533
|
+
readonly data: T;
|
|
1534
|
+
readonly isLoading: boolean;
|
|
1535
|
+
readonly isError: boolean;
|
|
1536
|
+
readonly error?: E | undefined;
|
|
1537
|
+
}
|
|
1538
|
+
/**
|
|
1539
|
+
* Result type for hooks that may not have data yet.
|
|
1540
|
+
* Extends QueryResult with nullable data.
|
|
1541
|
+
*
|
|
1542
|
+
* @typeParam T - The data type
|
|
1543
|
+
* @typeParam E - The error type (defaults to Error)
|
|
1544
|
+
*/
|
|
1545
|
+
interface QueryResultNullable<T, E = Error> {
|
|
1546
|
+
readonly data: T | null | undefined;
|
|
1547
|
+
readonly isLoading: boolean;
|
|
1548
|
+
readonly isError: boolean;
|
|
1549
|
+
readonly error?: E | undefined;
|
|
1550
|
+
}
|
|
1551
|
+
/**
|
|
1552
|
+
* Result type for list/collection hooks with aggregates.
|
|
1553
|
+
*
|
|
1554
|
+
* @typeParam T - The item type in the array
|
|
1555
|
+
* @typeParam E - The error type (defaults to Error)
|
|
1556
|
+
*/
|
|
1557
|
+
interface ListQueryResult<T, E = Error> extends QueryResult<T[], E> {
|
|
1558
|
+
readonly totalCount: number;
|
|
1559
|
+
}
|
|
1560
|
+
/**
|
|
1561
|
+
* Result type for list hooks with value aggregation (e.g., deals with total value).
|
|
1562
|
+
*
|
|
1563
|
+
* @typeParam T - The item type in the array
|
|
1564
|
+
* @typeParam E - The error type (defaults to Error)
|
|
1565
|
+
*/
|
|
1566
|
+
interface ValueListQueryResult<T, E = Error> extends ListQueryResult<T, E> {
|
|
1567
|
+
readonly totalValue: number;
|
|
1568
|
+
}
|
|
1569
|
+
/**
|
|
1570
|
+
* Type predicate to check if a query result has successfully loaded data.
|
|
1571
|
+
* Narrows the data type from T | null | undefined to T.
|
|
1572
|
+
*
|
|
1573
|
+
* @example
|
|
1574
|
+
* const result = useContact(id);
|
|
1575
|
+
* if (hasData(result)) {
|
|
1576
|
+
* // TypeScript knows result.data is Contact, not Contact | null
|
|
1577
|
+
* console.log(result.data.name);
|
|
1578
|
+
* }
|
|
1579
|
+
*/
|
|
1580
|
+
declare function hasData<T, E = Error>(result: QueryResultNullable<T, E>): result is QueryResultNullable<T, E> & {
|
|
1581
|
+
readonly data: T;
|
|
1582
|
+
};
|
|
1583
|
+
/**
|
|
1584
|
+
* Type predicate to check if a query result is in loading state.
|
|
1585
|
+
* Useful for conditional rendering.
|
|
1586
|
+
*
|
|
1587
|
+
* @example
|
|
1588
|
+
* if (isLoading(result)) {
|
|
1589
|
+
* return <Spinner />;
|
|
1590
|
+
* }
|
|
1591
|
+
*/
|
|
1592
|
+
declare function isLoading<T, E = Error>(result: QueryResult<T, E> | QueryResultNullable<T, E>): boolean;
|
|
1593
|
+
/**
|
|
1594
|
+
* Type predicate to check if a query result has an error.
|
|
1595
|
+
* Narrows to include the error property.
|
|
1596
|
+
*
|
|
1597
|
+
* @example
|
|
1598
|
+
* if (isErrorResult(result)) {
|
|
1599
|
+
* console.error(result.error); // error is E, not undefined
|
|
1600
|
+
* }
|
|
1601
|
+
*/
|
|
1602
|
+
declare function isErrorResult<T, E = Error>(result: QueryResult<T, E> | QueryResultNullable<T, E>): result is (QueryResult<T, E> | QueryResultNullable<T, E>) & {
|
|
1603
|
+
readonly isError: true;
|
|
1604
|
+
readonly error: E;
|
|
1605
|
+
};
|
|
1606
|
+
/**
|
|
1607
|
+
* Type predicate to check if a query result is in idle state (not loading, no error, has data).
|
|
1608
|
+
*
|
|
1609
|
+
* @example
|
|
1610
|
+
* if (isIdle(result)) {
|
|
1611
|
+
* // Safe to access and render data
|
|
1612
|
+
* }
|
|
1613
|
+
*/
|
|
1614
|
+
declare function isIdle<T, E = Error>(result: QueryResult<T, E> | QueryResultNullable<T, E>): boolean;
|
|
1615
|
+
/**
|
|
1616
|
+
* Type-safe property selector for hook results.
|
|
1617
|
+
* Uses K extends keyof T constraint (generics-function-constraints rule).
|
|
1618
|
+
*
|
|
1619
|
+
* @typeParam T - The data object type
|
|
1620
|
+
* @typeParam K - Key of T (constrained to actual keys)
|
|
1621
|
+
*
|
|
1622
|
+
* @example
|
|
1623
|
+
* const users = [{ name: "Alice", age: 30 }];
|
|
1624
|
+
* const names = selectProperty(users, "name"); // string[]
|
|
1625
|
+
* const ages = selectProperty(users, "age"); // number[]
|
|
1626
|
+
* selectProperty(users, "invalid"); // Error: "invalid" not in "name" | "age"
|
|
1627
|
+
*/
|
|
1628
|
+
declare function selectProperty<T, K extends keyof T>(items: readonly T[], key: K): T[K][];
|
|
1629
|
+
/**
|
|
1630
|
+
* Type-safe property getter for a single item.
|
|
1631
|
+
* Returns undefined if item is null/undefined.
|
|
1632
|
+
*
|
|
1633
|
+
* @typeParam T - The data object type
|
|
1634
|
+
* @typeParam K - Key of T (constrained to actual keys)
|
|
1635
|
+
*/
|
|
1636
|
+
declare function getProperty<T, K extends keyof T>(item: T | null | undefined, key: K): T[K] | undefined;
|
|
1637
|
+
/**
|
|
1638
|
+
* Generic type for hooks that fetch a single resource by ID.
|
|
1639
|
+
* Useful for creating consistent API across different resource types.
|
|
1640
|
+
*
|
|
1641
|
+
* @typeParam T - The resource type
|
|
1642
|
+
* @typeParam E - The error type (defaults to Error)
|
|
1643
|
+
*/
|
|
1644
|
+
type UseSingleResourceHook<T, E = Error> = (id: string) => QueryResultNullable<T, E>;
|
|
1645
|
+
/**
|
|
1646
|
+
* Generic type for hooks that fetch a list of resources with optional params.
|
|
1647
|
+
* Uses generics-default-type-parameters for the params type.
|
|
1648
|
+
*
|
|
1649
|
+
* @typeParam T - The item type
|
|
1650
|
+
* @typeParam P - The params type (defaults to empty object)
|
|
1651
|
+
* @typeParam E - The error type (defaults to Error)
|
|
1652
|
+
*/
|
|
1653
|
+
type UseListResourceHook<T, P extends Record<string, unknown> = Record<string, never>, E = Error> = (params?: P) => ListQueryResult<T, E>;
|
|
1654
|
+
/**
|
|
1655
|
+
* Transforms a nullable result to a non-nullable one if data exists.
|
|
1656
|
+
* Useful when you've already checked hasData().
|
|
1657
|
+
*/
|
|
1658
|
+
type WithData<R extends QueryResultNullable<unknown>> = R extends QueryResultNullable<infer T, infer E> ? QueryResultNullable<T, E> & {
|
|
1659
|
+
readonly data: T;
|
|
1660
|
+
} : never;
|
|
1661
|
+
/**
|
|
1662
|
+
* Activity slug constants as a const object.
|
|
1663
|
+
* Derive the ActivitySlug type from this single source of truth.
|
|
1664
|
+
*/
|
|
1665
|
+
declare const ACTIVITY_SLUGS: {
|
|
1666
|
+
readonly abandonedCart: "abandoned_cart";
|
|
1667
|
+
readonly announcements: "announcements";
|
|
1668
|
+
readonly cartItemsAdded: "cart_items_added";
|
|
1669
|
+
readonly commentReply: "comment_reply";
|
|
1670
|
+
readonly directMessage: "direct_message";
|
|
1671
|
+
readonly fantasyPoint: "fantasy_point";
|
|
1672
|
+
readonly newLead: "new_lead";
|
|
1673
|
+
readonly orderPlaced: "order_placed";
|
|
1674
|
+
readonly pageViews: "page_views";
|
|
1675
|
+
readonly pageViewsContact: "page_views_contact";
|
|
1676
|
+
readonly tasks: "tasks";
|
|
1677
|
+
readonly upcomingEvent: "upcoming_event";
|
|
1678
|
+
readonly video: "video";
|
|
1679
|
+
readonly videoComplete: "video_complete";
|
|
1680
|
+
readonly videoCompleteContact: "video_complete_contact";
|
|
1681
|
+
readonly videoContact: "video_contact";
|
|
1682
|
+
readonly messageReceived: "message_received";
|
|
1683
|
+
readonly messageSent: "message_sent";
|
|
1684
|
+
readonly newCartItemsAdded: "new_cart_items_added";
|
|
1685
|
+
readonly smartLinkClicked: "smart_link_clicked";
|
|
1686
|
+
readonly reviewLeft: "review_left";
|
|
1687
|
+
};
|
|
1688
|
+
/** Activity slug union type derived from ACTIVITY_SLUGS constant. */
|
|
1689
|
+
type ActivitySlug = (typeof ACTIVITY_SLUGS)[keyof typeof ACTIVITY_SLUGS];
|
|
1690
|
+
/** Type predicate to check if a string is a valid ActivitySlug. */
|
|
1691
|
+
declare function isActivitySlug(value: string): value is ActivitySlug;
|
|
1692
|
+
/** Transformed activity for display. */
|
|
1693
|
+
interface Activity {
|
|
1694
|
+
readonly id: number;
|
|
1695
|
+
readonly userName: string;
|
|
1696
|
+
readonly avatarUrl: string | null;
|
|
1697
|
+
readonly activityType: string;
|
|
1698
|
+
readonly targetName: string;
|
|
1699
|
+
readonly timestamp: string;
|
|
1700
|
+
readonly slug: ActivitySlug;
|
|
1701
|
+
}
|
|
1702
|
+
/** Description/rich text metadata for a calendar event. */
|
|
1703
|
+
interface CalendarEventDescription {
|
|
1704
|
+
readonly id?: number | null;
|
|
1705
|
+
readonly name?: string | null;
|
|
1706
|
+
readonly body?: string | null;
|
|
1707
|
+
readonly record_type?: string | null;
|
|
1708
|
+
readonly record_id?: number | null;
|
|
1709
|
+
readonly created_at?: string | null;
|
|
1710
|
+
readonly updated_at?: string | null;
|
|
1711
|
+
readonly locale?: string | null;
|
|
1712
|
+
}
|
|
1713
|
+
/** Calendar event data from the API. */
|
|
1714
|
+
interface CalendarEvent {
|
|
1715
|
+
readonly id: number;
|
|
1716
|
+
readonly title: string;
|
|
1717
|
+
readonly description?: CalendarEventDescription | null;
|
|
1718
|
+
readonly color?: string | null;
|
|
1719
|
+
readonly url?: string | null;
|
|
1720
|
+
readonly start: string;
|
|
1721
|
+
readonly end: string;
|
|
1722
|
+
readonly active?: boolean | null;
|
|
1723
|
+
readonly time_zone?: string | null;
|
|
1724
|
+
readonly status?: string | null;
|
|
1725
|
+
readonly image_url?: string | null;
|
|
1726
|
+
readonly images?: readonly unknown[] | null;
|
|
1727
|
+
readonly venue?: string | null;
|
|
1728
|
+
readonly countries?: readonly string[] | null;
|
|
1729
|
+
readonly hasTomorrow?: boolean | null;
|
|
1730
|
+
readonly hasYesterday?: boolean | null;
|
|
1731
|
+
readonly isAllDay?: boolean;
|
|
1732
|
+
}
|
|
1733
|
+
/** Catch up suggestion data from the API. */
|
|
1734
|
+
interface CatchUp {
|
|
1735
|
+
readonly id: number;
|
|
1736
|
+
readonly suggestion_title: string;
|
|
1737
|
+
}
|
|
1738
|
+
/** MySite data returned by the hook. */
|
|
1739
|
+
interface MySiteData {
|
|
1740
|
+
readonly url: string | null;
|
|
1741
|
+
readonly views: number;
|
|
1742
|
+
readonly leads: number;
|
|
1743
|
+
readonly userName: string;
|
|
1744
|
+
}
|
|
1745
|
+
/** Transformed todo for display. */
|
|
1746
|
+
interface Todo {
|
|
1747
|
+
readonly id: number;
|
|
1748
|
+
readonly body: string;
|
|
1749
|
+
readonly dueAt: string | null;
|
|
1750
|
+
readonly completedAt: string | null;
|
|
1751
|
+
readonly createdAt: string;
|
|
1752
|
+
readonly contactName: string | null;
|
|
1753
|
+
}
|
|
1754
|
+
//#endregion
|
|
1755
|
+
//#region src/hooks/use-calendar-events.d.ts
|
|
1756
|
+
/**
|
|
1757
|
+
* Result type for useCalendarEvents hook.
|
|
1758
|
+
* Uses QueryResult<CalendarEvent[]> with default Error type.
|
|
1759
|
+
*/
|
|
1760
|
+
type UseCalendarEventsResult = QueryResult<CalendarEvent[]>;
|
|
1761
|
+
/**
|
|
1762
|
+
* Hook to fetch calendar events.
|
|
1763
|
+
* This is a stub implementation - override with your own data fetching logic.
|
|
1764
|
+
*/
|
|
1765
|
+
declare function useCalendarEvents(): UseCalendarEventsResult;
|
|
1766
|
+
//#endregion
|
|
1767
|
+
//#region src/hooks/use-todos.d.ts
|
|
1768
|
+
/**
|
|
1769
|
+
* Result type for useTodos hook.
|
|
1770
|
+
* Uses QueryResult<Todo[]> with default Error type.
|
|
1771
|
+
*/
|
|
1772
|
+
type UseTodosResult = QueryResult<Todo[]>;
|
|
1773
|
+
/**
|
|
1774
|
+
* Hook to fetch todo items.
|
|
1775
|
+
* This is a stub implementation - override with your own data fetching logic.
|
|
1776
|
+
*/
|
|
1777
|
+
declare function useTodos(): UseTodosResult;
|
|
1778
|
+
//#endregion
|
|
1779
|
+
//#region src/hooks/use-activities.d.ts
|
|
1780
|
+
/**
|
|
1781
|
+
* Result type for useActivities hook.
|
|
1782
|
+
* Uses QueryResult generic with Activity[] and default Error type.
|
|
1783
|
+
*/
|
|
1784
|
+
type UseActivitiesResult = QueryResult<Activity[]>;
|
|
1785
|
+
/**
|
|
1786
|
+
* Hook to fetch recent activities.
|
|
1787
|
+
* This is a stub implementation - override with your own data fetching logic.
|
|
1788
|
+
*/
|
|
1789
|
+
declare function useActivities(): UseActivitiesResult;
|
|
1790
|
+
//#endregion
|
|
1791
|
+
//#region src/hooks/use-catchups.d.ts
|
|
1792
|
+
/**
|
|
1793
|
+
* Result type for useCatchUps hook.
|
|
1794
|
+
* Uses QueryResult<CatchUp[]> with default Error type.
|
|
1795
|
+
*/
|
|
1796
|
+
type UseCatchUpsResult = QueryResult<CatchUp[]>;
|
|
1797
|
+
/**
|
|
1798
|
+
* Hook to fetch catch up items.
|
|
1799
|
+
* This is a stub implementation - override with your own data fetching logic.
|
|
1800
|
+
*/
|
|
1801
|
+
declare function useCatchUps(): UseCatchUpsResult;
|
|
1802
|
+
//#endregion
|
|
1803
|
+
//#region src/hooks/use-mysite.d.ts
|
|
1804
|
+
/**
|
|
1805
|
+
* Result type for useMySite hook.
|
|
1806
|
+
* Uses QueryResultNullable since MySite data may not be available.
|
|
1807
|
+
*/
|
|
1808
|
+
type UseMySiteResult = QueryResultNullable<MySiteData>;
|
|
1809
|
+
/**
|
|
1810
|
+
* Hook to fetch MySite data.
|
|
1811
|
+
* This is a stub implementation - override with your own data fetching logic.
|
|
1812
|
+
*/
|
|
1813
|
+
declare function useMySite(): UseMySiteResult;
|
|
1814
|
+
//#endregion
|
|
1815
|
+
//#region src/hooks/use-conversations.d.ts
|
|
1816
|
+
/**
|
|
1817
|
+
* Result type for useConversations hook.
|
|
1818
|
+
* Uses QueryResult<Conversation[]> with default Error type.
|
|
1819
|
+
*/
|
|
1820
|
+
type UseConversationsResult = QueryResult<Conversation[]>;
|
|
1821
|
+
/**
|
|
1822
|
+
* Hook to fetch all conversations.
|
|
1823
|
+
* This is a stub implementation - override with your own data fetching logic.
|
|
1824
|
+
*
|
|
1825
|
+
* @returns UseConversationsResult with empty data array
|
|
1826
|
+
*
|
|
1827
|
+
* @example
|
|
1828
|
+
* ```tsx
|
|
1829
|
+
* const { data: conversations, isLoading, isError } = useConversations();
|
|
1830
|
+
*
|
|
1831
|
+
* if (isLoading) return <Loading />;
|
|
1832
|
+
* if (isError) return <Error />;
|
|
1833
|
+
*
|
|
1834
|
+
* return conversations.map(conv => <ConversationItem key={conv.id} {...conv} />);
|
|
1835
|
+
* ```
|
|
1836
|
+
*/
|
|
1837
|
+
declare function useConversations(): UseConversationsResult;
|
|
1838
|
+
/**
|
|
1839
|
+
* Result type for useConversationMessages hook.
|
|
1840
|
+
* Uses QueryResult<Message[]> with default Error type.
|
|
1841
|
+
*/
|
|
1842
|
+
type UseConversationMessagesResult = QueryResult<Message[]>;
|
|
1843
|
+
/**
|
|
1844
|
+
* Hook to fetch messages for a specific conversation.
|
|
1845
|
+
* This is a stub implementation - override with your own data fetching logic.
|
|
1846
|
+
*
|
|
1847
|
+
* @param conversationId - The ID of the conversation to fetch messages for
|
|
1848
|
+
* @returns UseConversationMessagesResult with empty data array
|
|
1849
|
+
*
|
|
1850
|
+
* @example
|
|
1851
|
+
* ```tsx
|
|
1852
|
+
* const { data: messages, isLoading, isError } = useConversationMessages(conversationId);
|
|
1853
|
+
*
|
|
1854
|
+
* if (isLoading) return <Loading />;
|
|
1855
|
+
* if (isError) return <Error />;
|
|
1856
|
+
*
|
|
1857
|
+
* return messages.map(msg => <MessageBubble key={msg.id} {...msg} />);
|
|
1858
|
+
* ```
|
|
1859
|
+
*/
|
|
1860
|
+
declare function useConversationMessages(_conversationId: string): UseConversationMessagesResult;
|
|
1861
|
+
//#endregion
|
|
1862
|
+
//#region src/hooks/use-contacts.d.ts
|
|
1863
|
+
/**
|
|
1864
|
+
* Type predicate to check if a status string is a valid ContactStatus.
|
|
1865
|
+
* Enables runtime validation with type narrowing.
|
|
1866
|
+
*/
|
|
1867
|
+
declare function isContactStatus(value: string): value is ContactStatus;
|
|
1868
|
+
/**
|
|
1869
|
+
* Parameters for filtering and paginating contacts.
|
|
1870
|
+
* Uses readonly properties and proper ContactStatus type for status.
|
|
1871
|
+
*/
|
|
1872
|
+
interface UseContactsParams {
|
|
1873
|
+
/** Search query to filter contacts by name, email, or company */
|
|
1874
|
+
readonly search?: string;
|
|
1875
|
+
/** Filter contacts by status - uses ContactStatus union type for type safety */
|
|
1876
|
+
readonly status?: ContactStatus;
|
|
1877
|
+
/** Maximum number of contacts to return */
|
|
1878
|
+
readonly limit?: number;
|
|
1879
|
+
}
|
|
1880
|
+
/**
|
|
1881
|
+
* Result type for the useContacts hook.
|
|
1882
|
+
* Uses ListQueryResult<Contact> with totalCount and default Error type.
|
|
1883
|
+
*/
|
|
1884
|
+
type UseContactsResult = ListQueryResult<Contact>;
|
|
1885
|
+
/**
|
|
1886
|
+
* Result type for the useContact hook.
|
|
1887
|
+
* Uses QueryResultNullable since a specific contact may not exist.
|
|
1888
|
+
*/
|
|
1889
|
+
type UseContactResult = QueryResultNullable<Contact>;
|
|
1890
|
+
/**
|
|
1891
|
+
* Hook to fetch a list of contacts with optional filtering and pagination.
|
|
1892
|
+
* This is a stub implementation - override with your own data fetching logic.
|
|
1893
|
+
*
|
|
1894
|
+
* @param params - Optional parameters for filtering and pagination
|
|
1895
|
+
* @returns Object containing contacts data, loading state, error state, and total count
|
|
1896
|
+
*
|
|
1897
|
+
* @example
|
|
1898
|
+
* ```tsx
|
|
1899
|
+
* const { data: contacts, isLoading, totalCount } = useContacts({
|
|
1900
|
+
* search: 'john',
|
|
1901
|
+
* status: 'active',
|
|
1902
|
+
* limit: 20
|
|
1903
|
+
* });
|
|
1904
|
+
* ```
|
|
1905
|
+
*/
|
|
1906
|
+
declare function useContacts(_params?: UseContactsParams): UseContactsResult;
|
|
1907
|
+
/**
|
|
1908
|
+
* Hook to fetch a single contact by ID.
|
|
1909
|
+
* This is a stub implementation - override with your own data fetching logic.
|
|
1910
|
+
*
|
|
1911
|
+
* @param contactId - The unique identifier of the contact to fetch
|
|
1912
|
+
* @returns Object containing contact data, loading state, and error state
|
|
1913
|
+
*
|
|
1914
|
+
* @example
|
|
1915
|
+
* ```tsx
|
|
1916
|
+
* const { data: contact, isLoading, isError } = useContact('contact-123');
|
|
1917
|
+
* ```
|
|
1918
|
+
*/
|
|
1919
|
+
declare function useContact(_contactId: string): UseContactResult;
|
|
1920
|
+
//#endregion
|
|
1921
|
+
//#region src/components/RequireAuth.d.ts
|
|
1922
|
+
interface RequireAuthProps {
|
|
1923
|
+
/** Content to render when authenticated */
|
|
1924
|
+
children: ReactNode;
|
|
1925
|
+
/** Component to show while checking authentication (default: AuthLoading) */
|
|
1926
|
+
fallback?: ReactNode;
|
|
1927
|
+
/** Component to show when not authenticated (default: AuthError) */
|
|
1928
|
+
errorComponent?: ReactNode;
|
|
1929
|
+
}
|
|
1930
|
+
/**
|
|
1931
|
+
* Component that protects content requiring authentication.
|
|
1932
|
+
*
|
|
1933
|
+
* **Important:** This provides UX-level protection only. It prevents
|
|
1934
|
+
* unauthenticated users from seeing the UI, but the real security
|
|
1935
|
+
* boundary is the server-side API. Client-side auth can always be
|
|
1936
|
+
* bypassed by modifying browser state.
|
|
1937
|
+
*
|
|
1938
|
+
* For defense-in-depth, configure `jwksUrl` in `FluidAuthConfig`
|
|
1939
|
+
* to enable client-side JWT signature verification.
|
|
1940
|
+
*
|
|
1941
|
+
* Shows different states based on auth status:
|
|
1942
|
+
* - Loading: Shows fallback (spinner by default)
|
|
1943
|
+
* - Not authenticated: Shows errorComponent (AuthError by default)
|
|
1944
|
+
* - Authenticated: Shows children
|
|
1945
|
+
*
|
|
1946
|
+
* @example
|
|
1947
|
+
* ```tsx
|
|
1948
|
+
* // Basic usage - shows default loading/error states
|
|
1949
|
+
* <RequireAuth>
|
|
1950
|
+
* <ProtectedContent />
|
|
1951
|
+
* </RequireAuth>
|
|
1952
|
+
*
|
|
1953
|
+
* // Custom loading state
|
|
1954
|
+
* <RequireAuth fallback={<CustomSpinner />}>
|
|
1955
|
+
* <ProtectedContent />
|
|
1956
|
+
* </RequireAuth>
|
|
1957
|
+
*
|
|
1958
|
+
* // Custom error component
|
|
1959
|
+
* <RequireAuth errorComponent={<LoginPrompt />}>
|
|
1960
|
+
* <ProtectedContent />
|
|
1961
|
+
* </RequireAuth>
|
|
1962
|
+
*
|
|
1963
|
+
* // Both custom
|
|
1964
|
+
* <RequireAuth
|
|
1965
|
+
* fallback={<SkeletonLoader />}
|
|
1966
|
+
* errorComponent={<RedirectToLogin />}
|
|
1967
|
+
* >
|
|
1968
|
+
* <Dashboard />
|
|
1969
|
+
* </RequireAuth>
|
|
1970
|
+
* ```
|
|
1971
|
+
*/
|
|
1972
|
+
declare function RequireAuth({
|
|
1973
|
+
children,
|
|
1974
|
+
fallback,
|
|
1975
|
+
errorComponent
|
|
1976
|
+
}: RequireAuthProps): React.JSX.Element;
|
|
1977
|
+
//#endregion
|
|
1978
|
+
//#region src/components/AuthError.d.ts
|
|
1979
|
+
interface AuthErrorProps {
|
|
1980
|
+
/** Error message to display */
|
|
1981
|
+
message?: string;
|
|
1982
|
+
/** Optional title */
|
|
1983
|
+
title?: string;
|
|
1984
|
+
/** Optional children for custom content */
|
|
1985
|
+
children?: ReactNode;
|
|
1986
|
+
}
|
|
1987
|
+
/**
|
|
1988
|
+
* Default authentication error component.
|
|
1989
|
+
*
|
|
1990
|
+
* Displays a simple error message when authentication fails.
|
|
1991
|
+
* Can be customized via props or replaced entirely in RequireAuth.
|
|
1992
|
+
*
|
|
1993
|
+
* @example
|
|
1994
|
+
* ```tsx
|
|
1995
|
+
* // Use with default message
|
|
1996
|
+
* <AuthError />
|
|
1997
|
+
*
|
|
1998
|
+
* // Use with custom message
|
|
1999
|
+
* <AuthError message="Session expired. Please log in again." />
|
|
2000
|
+
*
|
|
2001
|
+
* // Use with custom content
|
|
2002
|
+
* <AuthError>
|
|
2003
|
+
* <CustomLoginButton />
|
|
2004
|
+
* </AuthError>
|
|
2005
|
+
* ```
|
|
2006
|
+
*/
|
|
2007
|
+
declare function AuthError({
|
|
2008
|
+
message,
|
|
2009
|
+
title,
|
|
2010
|
+
children
|
|
2011
|
+
}: AuthErrorProps): React.JSX.Element;
|
|
2012
|
+
/**
|
|
2013
|
+
* Simple loading spinner component for auth loading state.
|
|
2014
|
+
*/
|
|
2015
|
+
declare function AuthLoading(): React.JSX.Element;
|
|
2016
|
+
//#endregion
|
|
2017
|
+
//#region src/messaging/use-messaging-auth.d.ts
|
|
2018
|
+
declare function useMessagingAuth(): MessagingAuthContext$1;
|
|
2019
|
+
//#endregion
|
|
2020
|
+
//#region src/messaging/use-messaging-config.d.ts
|
|
2021
|
+
interface MessagingConfig {
|
|
2022
|
+
readonly apiConfig: MessagingApiConfig;
|
|
2023
|
+
readonly websocketUrl: string;
|
|
2024
|
+
readonly token: string | null;
|
|
2025
|
+
}
|
|
2026
|
+
declare function useMessagingConfig(): MessagingConfig;
|
|
2027
|
+
//#endregion
|
|
2028
|
+
//#region src/messaging/fluid-file-uploader.d.ts
|
|
2029
|
+
/**
|
|
2030
|
+
* Creates a FileUploader that uploads to Filestack using the REST API.
|
|
2031
|
+
*
|
|
2032
|
+
* @param apiKey - Filestack API key. If falsy, returns a noop uploader
|
|
2033
|
+
* that rejects uploads with a helpful error message.
|
|
2034
|
+
*/
|
|
2035
|
+
declare function createFluidFileUploader(apiKey: string | undefined): FileUploader$1;
|
|
2036
|
+
import * as import__fluid_app_portal_core_theme from "@fluid-app/portal-core/theme";
|
|
2037
|
+
//#endregion
|
|
2038
|
+
//#region src/screens/MessagingScreen.d.ts
|
|
2039
|
+
type MessagingScreenProps = ComponentProps<"div"> & {
|
|
2040
|
+
background?: BackgroundValue;
|
|
2041
|
+
textColor?: ColorOptions;
|
|
2042
|
+
accentColor?: ColorOptions;
|
|
2043
|
+
padding?: PaddingOptions;
|
|
2044
|
+
borderRadius?: BorderRadiusOptions;
|
|
2045
|
+
onToast?: (message: string, type: "success" | "error") => void;
|
|
2046
|
+
filestackApiKey?: string;
|
|
2047
|
+
websocketUrl?: string;
|
|
2048
|
+
};
|
|
2049
|
+
declare function MessagingScreen({
|
|
2050
|
+
onToast,
|
|
2051
|
+
filestackApiKey,
|
|
2052
|
+
websocketUrl: websocketUrlOverride,
|
|
2053
|
+
background,
|
|
2054
|
+
textColor,
|
|
2055
|
+
accentColor,
|
|
2056
|
+
padding,
|
|
2057
|
+
borderRadius,
|
|
2058
|
+
...divProps
|
|
2059
|
+
}: MessagingScreenProps): React.JSX.Element;
|
|
2060
|
+
declare const messagingScreenPropertySchema: WidgetPropertySchema;
|
|
2061
|
+
//#endregion
|
|
2062
|
+
//#region src/screens/ContactsScreen.d.ts
|
|
2063
|
+
type ContactsScreenProps = ComponentProps<"div"> & {
|
|
2064
|
+
background?: BackgroundValue;
|
|
2065
|
+
textColor?: ColorOptions;
|
|
2066
|
+
accentColor?: ColorOptions;
|
|
2067
|
+
padding?: PaddingOptions;
|
|
2068
|
+
borderRadius?: BorderRadiusOptions;
|
|
2069
|
+
defaultViewMode?: "list" | "grid";
|
|
2070
|
+
onContactSelect?: (contactId: string) => void;
|
|
2071
|
+
onCreateContact?: () => void;
|
|
2072
|
+
};
|
|
2073
|
+
declare function ContactsScreen(_props: ContactsScreenProps): React.JSX.Element;
|
|
2074
|
+
declare const contactsScreenPropertySchema: WidgetPropertySchema;
|
|
2075
|
+
//#endregion
|
|
2076
|
+
//#region src/screens/OrdersScreen.d.ts
|
|
2077
|
+
type OrdersScreenProps = ComponentProps<"div"> & {
|
|
2078
|
+
background?: BackgroundValue;
|
|
2079
|
+
textColor?: ColorOptions;
|
|
2080
|
+
accentColor?: ColorOptions;
|
|
2081
|
+
padding?: PaddingOptions;
|
|
2082
|
+
borderRadius?: BorderRadiusOptions;
|
|
2083
|
+
};
|
|
2084
|
+
declare function OrdersScreen(_props: OrdersScreenProps): React.JSX.Element;
|
|
2085
|
+
declare const ordersScreenPropertySchema: WidgetPropertySchema;
|
|
2086
|
+
//#endregion
|
|
2087
|
+
//#region src/screens/CustomersScreen.d.ts
|
|
2088
|
+
type CustomersScreenProps = ComponentProps<"div"> & {
|
|
2089
|
+
background?: BackgroundValue;
|
|
2090
|
+
textColor?: ColorOptions;
|
|
2091
|
+
accentColor?: ColorOptions;
|
|
2092
|
+
padding?: PaddingOptions;
|
|
2093
|
+
borderRadius?: BorderRadiusOptions;
|
|
2094
|
+
};
|
|
2095
|
+
declare function CustomersScreen(_props: CustomersScreenProps): React.JSX.Element;
|
|
2096
|
+
declare const customersScreenPropertySchema: WidgetPropertySchema;
|
|
2097
|
+
//#endregion
|
|
2098
|
+
//#region src/screens/ProductsScreen.d.ts
|
|
2099
|
+
type ProductsScreenProps = ComponentProps<"div"> & {
|
|
2100
|
+
background?: BackgroundValue;
|
|
2101
|
+
textColor?: ColorOptions;
|
|
2102
|
+
accentColor?: ColorOptions;
|
|
2103
|
+
padding?: PaddingOptions;
|
|
2104
|
+
borderRadius?: BorderRadiusOptions;
|
|
2105
|
+
};
|
|
2106
|
+
declare function ProductsScreen(_props: ProductsScreenProps): React.JSX.Element;
|
|
2107
|
+
declare const productsScreenPropertySchema: WidgetPropertySchema;
|
|
2108
|
+
//#endregion
|
|
2109
|
+
//#region src/screens/index.d.ts
|
|
2110
|
+
declare const screenPropertySchemas: Record<string, () => Promise<WidgetPropertySchema>>;
|
|
2111
|
+
/**
|
|
2112
|
+
* Core page template IDs
|
|
2113
|
+
*/
|
|
2114
|
+
declare const CORE_PAGE_IDS: {
|
|
2115
|
+
readonly MESSAGING: "core-messaging";
|
|
2116
|
+
readonly CONTACTS: "core-contacts";
|
|
2117
|
+
readonly ORDERS: "core-orders";
|
|
2118
|
+
readonly CUSTOMERS: "core-customers";
|
|
2119
|
+
readonly PRODUCTS: "core-products";
|
|
2120
|
+
};
|
|
2121
|
+
//#endregion
|
|
2122
|
+
//#region src/core/default-widget-registry.d.ts
|
|
2123
|
+
declare const DEFAULT_SDK_WIDGET_REGISTRY: WidgetRegistry$1;
|
|
2124
|
+
//#endregion
|
|
2125
|
+
//#region src/core/resolve-pages.d.ts
|
|
2126
|
+
/**
|
|
2127
|
+
* Resolve all page references and local screens into a unified screen list.
|
|
2128
|
+
*
|
|
2129
|
+
* This function merges:
|
|
2130
|
+
* 1. Screen definitions from page_refs (shared templates)
|
|
2131
|
+
* 2. Local screen definitions (for backwards compatibility and custom screens)
|
|
2132
|
+
*
|
|
2133
|
+
* When a screen_id appears in both page_refs and screens, the local screen
|
|
2134
|
+
* takes precedence (allows local overrides of template pages).
|
|
2135
|
+
*
|
|
2136
|
+
* @param navigation - The navigation configuration
|
|
2137
|
+
* @returns A unified array of ScreenDefinition objects
|
|
2138
|
+
*
|
|
2139
|
+
* @example
|
|
2140
|
+
* ```ts
|
|
2141
|
+
* const navigation: Navigation = {
|
|
2142
|
+
* definition_id: 1,
|
|
2143
|
+
* id: 1,
|
|
2144
|
+
* name: "Main Nav",
|
|
2145
|
+
* navigation_items: [...],
|
|
2146
|
+
* screens: [
|
|
2147
|
+
* // Local custom screen
|
|
2148
|
+
* { id: 1, slug: "home", name: "Home", component_tree: [...] }
|
|
2149
|
+
* ],
|
|
2150
|
+
* page_refs: [
|
|
2151
|
+
* // Reference to shared messaging template
|
|
2152
|
+
* { page_template_id: "core-messaging", screen_id: 2 }
|
|
2153
|
+
* ],
|
|
2154
|
+
* };
|
|
2155
|
+
*
|
|
2156
|
+
* const allScreens = resolveNavigationPages(navigation);
|
|
2157
|
+
* // Returns: [home screen, messaging screen from template]
|
|
2158
|
+
* ```
|
|
2159
|
+
*/
|
|
2160
|
+
declare function resolveNavigationPages(navigation: Readonly<Navigation>): ScreenDefinition[];
|
|
2161
|
+
/**
|
|
2162
|
+
* Get all available page templates for use in navigation.
|
|
2163
|
+
*
|
|
2164
|
+
* @returns Array of page templates from the registry
|
|
2165
|
+
*/
|
|
2166
|
+
declare function getAvailablePageTemplates(): PageTemplate[];
|
|
2167
|
+
/**
|
|
2168
|
+
* Get core page templates that are required for basic functionality.
|
|
2169
|
+
*
|
|
2170
|
+
* @returns Array of core page templates
|
|
2171
|
+
*/
|
|
2172
|
+
declare function getCorePageTemplates(): PageTemplate[];
|
|
2173
|
+
/**
|
|
2174
|
+
* Get optional page templates that can be added to navigation.
|
|
2175
|
+
*
|
|
2176
|
+
* @returns Array of optional (non-core) page templates
|
|
2177
|
+
*/
|
|
2178
|
+
declare function getOptionalPageTemplates(): PageTemplate[];
|
|
2179
|
+
/**
|
|
2180
|
+
* Check if a navigation has all required core pages.
|
|
2181
|
+
*
|
|
2182
|
+
* @param navigation - The navigation to check
|
|
2183
|
+
* @returns Object with validation result and missing page IDs
|
|
2184
|
+
*/
|
|
2185
|
+
declare function validateNavigationPages(navigation: Readonly<Navigation>): {
|
|
2186
|
+
readonly valid: boolean;
|
|
2187
|
+
readonly missingCorePages: readonly string[];
|
|
2188
|
+
};
|
|
2189
|
+
//#endregion
|
|
2190
|
+
//#region src/registries/page-template-registry.d.ts
|
|
2191
|
+
/**
|
|
2192
|
+
* Registry for managing reusable page templates.
|
|
2193
|
+
*
|
|
2194
|
+
* The registry provides a central store for page templates that can be
|
|
2195
|
+
* shared across multiple navigations. Core pages (like Messaging, Contacts)
|
|
2196
|
+
* are pre-registered and cannot be removed.
|
|
2197
|
+
*
|
|
2198
|
+
* @example
|
|
2199
|
+
* ```ts
|
|
2200
|
+
* // Register a custom page template
|
|
2201
|
+
* PageTemplateRegistry.register({
|
|
2202
|
+
* id: 'custom-dashboard',
|
|
2203
|
+
* slug: 'dashboard',
|
|
2204
|
+
* name: 'Custom Dashboard',
|
|
2205
|
+
* category: 'custom',
|
|
2206
|
+
* version: '1.0.0',
|
|
2207
|
+
* component_tree: [{ type: 'TextWidget', props: { text: 'Hello' } }],
|
|
2208
|
+
* });
|
|
2209
|
+
*
|
|
2210
|
+
* // Get a template by ID
|
|
2211
|
+
* const template = PageTemplateRegistry.get('custom-dashboard');
|
|
2212
|
+
*
|
|
2213
|
+
* // List all templates in a category
|
|
2214
|
+
* const corePages = PageTemplateRegistry.getByCategory('core');
|
|
2215
|
+
* ```
|
|
2216
|
+
*/
|
|
2217
|
+
declare class PageTemplateRegistryImpl {
|
|
2218
|
+
private templates;
|
|
2219
|
+
private categories;
|
|
2220
|
+
constructor();
|
|
2221
|
+
/**
|
|
2222
|
+
* Register a new page template.
|
|
2223
|
+
* @throws Error if a template with the same ID already exists
|
|
2224
|
+
*/
|
|
2225
|
+
register(template: PageTemplate): void;
|
|
2226
|
+
/**
|
|
2227
|
+
* Unregister a page template by ID.
|
|
2228
|
+
* Core templates cannot be unregistered.
|
|
2229
|
+
* @returns true if the template was removed, false if it didn't exist or is a core template
|
|
2230
|
+
*/
|
|
2231
|
+
unregister(id: string): boolean;
|
|
2232
|
+
/**
|
|
2233
|
+
* Get a page template by ID.
|
|
2234
|
+
*/
|
|
2235
|
+
get(id: string): PageTemplate | undefined;
|
|
2236
|
+
/**
|
|
2237
|
+
* Get all page templates in a specific category.
|
|
2238
|
+
*/
|
|
2239
|
+
getByCategory(category: PageCategoryId | string): PageTemplate[];
|
|
2240
|
+
/**
|
|
2241
|
+
* List all registered page templates.
|
|
2242
|
+
*/
|
|
2243
|
+
listAll(): PageTemplate[];
|
|
2244
|
+
/**
|
|
2245
|
+
* List all core page templates (isCore: true).
|
|
2246
|
+
*/
|
|
2247
|
+
listCore(): PageTemplate[];
|
|
2248
|
+
/**
|
|
2249
|
+
* List all non-core page templates.
|
|
2250
|
+
*/
|
|
2251
|
+
listOptional(): PageTemplate[];
|
|
2252
|
+
/**
|
|
2253
|
+
* List all registered categories.
|
|
2254
|
+
*/
|
|
2255
|
+
listCategories(): PageCategory[];
|
|
2256
|
+
/**
|
|
2257
|
+
* Add a custom category.
|
|
2258
|
+
*/
|
|
2259
|
+
addCategory(category: PageCategory): void;
|
|
2260
|
+
/**
|
|
2261
|
+
* Check if a template exists by ID.
|
|
2262
|
+
*/
|
|
2263
|
+
has(id: string): boolean;
|
|
2264
|
+
/**
|
|
2265
|
+
* Get the count of registered templates.
|
|
2266
|
+
*/
|
|
2267
|
+
get size(): number;
|
|
2268
|
+
/**
|
|
2269
|
+
* Clear all non-core templates.
|
|
2270
|
+
* Useful for testing or resetting the registry.
|
|
2271
|
+
*/
|
|
2272
|
+
clearNonCore(): void;
|
|
2273
|
+
}
|
|
2274
|
+
/**
|
|
2275
|
+
* Global page template registry singleton.
|
|
2276
|
+
*
|
|
2277
|
+
* This registry is automatically populated with core page templates
|
|
2278
|
+
* (Messaging, Contacts) when the SDK is imported.
|
|
2279
|
+
*/
|
|
2280
|
+
declare const PageTemplateRegistry: PageTemplateRegistryImpl;
|
|
2281
|
+
//#endregion
|
|
2282
|
+
//#region src/shell/AppShell.d.ts
|
|
2283
|
+
interface AppShellProps {
|
|
2284
|
+
/** Pre-fetched app data (skips internal useFluidApp call if provided) */
|
|
2285
|
+
appData?: RepAppData$1;
|
|
2286
|
+
/** Override navigation items (otherwise derived from appData/API) */
|
|
2287
|
+
navigation?: NavigationItem[];
|
|
2288
|
+
/** Custom page components keyed by slug */
|
|
2289
|
+
customPages?: Record<string, ComponentType<{
|
|
2290
|
+
slug?: string;
|
|
2291
|
+
params?: string;
|
|
2292
|
+
}>>;
|
|
2293
|
+
/** Base path for subpath deployments (e.g. "/portal"). Default: "/" */
|
|
2294
|
+
basePath?: string;
|
|
2295
|
+
/** Controlled current slug */
|
|
2296
|
+
currentSlug?: string;
|
|
2297
|
+
/** Navigation callback */
|
|
2298
|
+
onNavigate?: (slug: string) => void;
|
|
2299
|
+
/** Custom sidebar header slot */
|
|
2300
|
+
sidebarHeader?: ReactNode;
|
|
2301
|
+
/** Custom sidebar footer slot */
|
|
2302
|
+
sidebarFooter?: ReactNode;
|
|
2303
|
+
/** Render prop or static children for the content area */
|
|
2304
|
+
children?: ReactNode | ((props: {
|
|
2305
|
+
currentSlug: string;
|
|
2306
|
+
currentNavItem: NavigationItem | undefined;
|
|
2307
|
+
}) => ReactNode);
|
|
2308
|
+
}
|
|
2309
|
+
declare function AppShell({
|
|
2310
|
+
appData: appDataProp,
|
|
2311
|
+
navigation: navigationProp,
|
|
2312
|
+
customPages,
|
|
2313
|
+
basePath,
|
|
2314
|
+
currentSlug: controlledSlug,
|
|
2315
|
+
onNavigate: onNavigateProp,
|
|
2316
|
+
sidebarHeader,
|
|
2317
|
+
sidebarFooter,
|
|
2318
|
+
children
|
|
2319
|
+
}: AppShellProps): React.JSX.Element;
|
|
2320
|
+
//#endregion
|
|
2321
|
+
//#region src/shell/BuilderScreenView.d.ts
|
|
2322
|
+
interface BuilderScreenViewProps {
|
|
2323
|
+
/** The screen definition to render */
|
|
2324
|
+
screen: ScreenDefinition$1;
|
|
2325
|
+
/** Additional CSS classes for the wrapper div */
|
|
2326
|
+
className?: string;
|
|
2327
|
+
}
|
|
2328
|
+
/**
|
|
2329
|
+
* Renders a builder screen's component_tree with full data source support.
|
|
2330
|
+
* Widgets with `dataSource` config are automatically wrapped with `DataAwareWidget`
|
|
2331
|
+
* which fetches data and merges it with static props before rendering.
|
|
2332
|
+
*/
|
|
2333
|
+
declare function BuilderScreenViewImpl({
|
|
2334
|
+
screen,
|
|
2335
|
+
className
|
|
2336
|
+
}: BuilderScreenViewProps): React$1.JSX.Element | null;
|
|
2337
|
+
declare const BuilderScreenView: React$1.MemoExoticComponent<typeof BuilderScreenViewImpl>;
|
|
2338
|
+
//#endregion
|
|
2339
|
+
//#region src/shell/SdkNavigation.d.ts
|
|
2340
|
+
interface SdkNavigationProps {
|
|
2341
|
+
navItems: NavigationItem[];
|
|
2342
|
+
currentSlug: string;
|
|
2343
|
+
onNavigate: (slug: string) => void;
|
|
2344
|
+
navSlugs: string[];
|
|
2345
|
+
}
|
|
2346
|
+
declare function SdkNavigation({
|
|
2347
|
+
navItems,
|
|
2348
|
+
currentSlug,
|
|
2349
|
+
onNavigate,
|
|
2350
|
+
navSlugs
|
|
2351
|
+
}: SdkNavigationProps): React.JSX.Element;
|
|
2352
|
+
//#endregion
|
|
2353
|
+
//#region src/shell/SdkHeader.d.ts
|
|
2354
|
+
interface SdkHeaderProps {
|
|
2355
|
+
tabs: NavigationItem[];
|
|
2356
|
+
mobileTabs?: NavigationItem[];
|
|
2357
|
+
currentSlug: string;
|
|
2358
|
+
onNavigate: (slug: string) => void;
|
|
2359
|
+
navSlugs: string[];
|
|
2360
|
+
}
|
|
2361
|
+
declare function SdkHeader({
|
|
2362
|
+
tabs,
|
|
2363
|
+
mobileTabs,
|
|
2364
|
+
currentSlug,
|
|
2365
|
+
onNavigate,
|
|
2366
|
+
navSlugs
|
|
2367
|
+
}: SdkHeaderProps): React.JSX.Element;
|
|
2368
|
+
//#endregion
|
|
2369
|
+
//#region src/shell/PageRouter.d.ts
|
|
2370
|
+
interface PageRouterProps {
|
|
2371
|
+
currentSlug: string;
|
|
2372
|
+
currentNavItem?: NavigationItem | undefined;
|
|
2373
|
+
customPages?: Record<string, ComponentType<{
|
|
2374
|
+
slug?: string;
|
|
2375
|
+
params?: string;
|
|
2376
|
+
}>> | undefined;
|
|
2377
|
+
/** Builder screen definitions (from fluidos API) */
|
|
2378
|
+
screens?: ScreenDefinition[] | undefined;
|
|
2379
|
+
baseSlug: string;
|
|
2380
|
+
restParams: string;
|
|
2381
|
+
}
|
|
2382
|
+
declare function PageRouter({
|
|
2383
|
+
currentSlug,
|
|
2384
|
+
currentNavItem,
|
|
2385
|
+
customPages,
|
|
2386
|
+
screens,
|
|
2387
|
+
baseSlug,
|
|
2388
|
+
restParams
|
|
2389
|
+
}: PageRouterProps): React.JSX.Element;
|
|
2390
|
+
//#endregion
|
|
2391
|
+
//#region src/shell/QuickLinksDropdown.d.ts
|
|
2392
|
+
interface QuickLinksDropdownProps {
|
|
2393
|
+
onNavigate: (slug: string) => void;
|
|
2394
|
+
}
|
|
2395
|
+
declare function QuickLinksDropdown({
|
|
2396
|
+
onNavigate
|
|
2397
|
+
}: QuickLinksDropdownProps): React.JSX.Element;
|
|
2398
|
+
//#endregion
|
|
2399
|
+
//#region src/shell/AppNavigationContext.d.ts
|
|
2400
|
+
interface AppNavigationContextValue {
|
|
2401
|
+
/** Current active slug (e.g. "contacts/123") */
|
|
2402
|
+
currentSlug: string;
|
|
2403
|
+
/** Base path for subpath deployments (e.g. "/portal"). Default: "/" */
|
|
2404
|
+
basePath: string;
|
|
2405
|
+
/** Navigate to a slug programmatically */
|
|
2406
|
+
navigate: (slug: string) => void;
|
|
2407
|
+
/** Build a full href for a slug (for use in <a> tags) */
|
|
2408
|
+
buildHref: (slug: string) => string;
|
|
2409
|
+
}
|
|
2410
|
+
interface AppNavigationProviderProps {
|
|
2411
|
+
currentSlug: string;
|
|
2412
|
+
basePath: string;
|
|
2413
|
+
navigate: (slug: string) => void;
|
|
2414
|
+
children: ReactNode;
|
|
2415
|
+
}
|
|
2416
|
+
declare function AppNavigationProvider({
|
|
2417
|
+
currentSlug,
|
|
2418
|
+
basePath,
|
|
2419
|
+
navigate,
|
|
2420
|
+
children
|
|
2421
|
+
}: AppNavigationProviderProps): React.JSX.Element;
|
|
2422
|
+
declare function useAppNavigation(): AppNavigationContextValue;
|
|
2423
|
+
//#endregion
|
|
2424
|
+
//#region src/shell/AppLink.d.ts
|
|
2425
|
+
interface AppLinkProps extends Omit<AnchorHTMLAttributes<HTMLAnchorElement>, "href"> {
|
|
2426
|
+
/** Slug to navigate to (e.g. "contacts/123") */
|
|
2427
|
+
to: string;
|
|
2428
|
+
}
|
|
2429
|
+
/**
|
|
2430
|
+
* SPA-aware link that renders a real `<a href>` for accessibility
|
|
2431
|
+
* (right-click, ctrl+click, screen readers) but intercepts normal
|
|
2432
|
+
* clicks for client-side navigation.
|
|
2433
|
+
*/
|
|
2434
|
+
declare const AppLink: React$1.ForwardRefExoticComponent<AppLinkProps & React$1.RefAttributes<HTMLAnchorElement>>;
|
|
2435
|
+
//#endregion
|
|
2436
|
+
//#region src/shell/slug-utils.d.ts
|
|
2437
|
+
interface SlugMatch {
|
|
2438
|
+
matchedSlug: string;
|
|
2439
|
+
rest: string;
|
|
2440
|
+
}
|
|
2441
|
+
/**
|
|
2442
|
+
* Extract all slugs from a navigation tree, sorted by segment count descending.
|
|
2443
|
+
* Longest slugs first enables greedy prefix matching (e.g. "share/playlists"
|
|
2444
|
+
* is checked before "share").
|
|
2445
|
+
*/
|
|
2446
|
+
declare function collectNavSlugs(items: NavigationItem[]): string[];
|
|
2447
|
+
/**
|
|
2448
|
+
* Find the longest registered nav slug that is a prefix of `fullSlug`.
|
|
2449
|
+
* Uses segment-boundary checking to prevent "shop" from matching "shopping".
|
|
2450
|
+
*/
|
|
2451
|
+
declare function matchSlugPrefix(fullSlug: string, navSlugs: string[]): SlugMatch | undefined;
|
|
2452
|
+
/**
|
|
2453
|
+
* Extract the slug portion from a full pathname by stripping the basePath prefix.
|
|
2454
|
+
* Returns an empty string when the pathname equals the basePath exactly.
|
|
2455
|
+
*
|
|
2456
|
+
* Examples:
|
|
2457
|
+
* extractSlugFromPathname("/contacts/123", "/") → "contacts/123"
|
|
2458
|
+
* extractSlugFromPathname("/portal/contacts", "/portal") → "contacts"
|
|
2459
|
+
* extractSlugFromPathname("/portal", "/portal") → ""
|
|
2460
|
+
* extractSlugFromPathname("/", "/") → ""
|
|
2461
|
+
*/
|
|
2462
|
+
declare function extractSlugFromPathname(pathname: string, basePath: string): string;
|
|
2463
|
+
declare function isSlugInSection(item: NavigationItem, currentSlug: string, navSlugs: string[]): boolean;
|
|
2464
|
+
type DEFAULT_COLORS = import__fluid_app_portal_core_theme.DEFAULT_COLORS;
|
|
2465
|
+
type DEFAULT_FONT_FAMILIES = import__fluid_app_portal_core_theme.DEFAULT_FONT_FAMILIES;
|
|
2466
|
+
type DEFAULT_FONT_SIZES = import__fluid_app_portal_core_theme.DEFAULT_FONT_SIZES;
|
|
2467
|
+
type DEFAULT_RADII = import__fluid_app_portal_core_theme.DEFAULT_RADII;
|
|
2468
|
+
type DEFAULT_SPACING = import__fluid_app_portal_core_theme.DEFAULT_SPACING;
|
|
2469
|
+
type DEFAULT_THEME_ID = import__fluid_app_portal_core_theme.DEFAULT_THEME_ID;
|
|
2470
|
+
type DEFAULT_THEME_NAME = import__fluid_app_portal_core_theme.DEFAULT_THEME_NAME;
|
|
2471
|
+
type FONT_FAMILY_KEYS = import__fluid_app_portal_core_theme.FONT_FAMILY_KEYS;
|
|
2472
|
+
type FONT_SIZE_KEYS = import__fluid_app_portal_core_theme.FONT_SIZE_KEYS;
|
|
2473
|
+
type FontFamilyKey = import__fluid_app_portal_core_theme.FontFamilyKey;
|
|
2474
|
+
type FontSizeKey = import__fluid_app_portal_core_theme.FontSizeKey;
|
|
2475
|
+
type GenerateThemeCSSOptions = import__fluid_app_portal_core_theme.GenerateThemeCSSOptions;
|
|
2476
|
+
type OklchPlain = import__fluid_app_portal_core_theme.OklchPlain;
|
|
2477
|
+
type RADIUS_KEYS = import__fluid_app_portal_core_theme.RADIUS_KEYS;
|
|
2478
|
+
type RadiusKey = import__fluid_app_portal_core_theme.RadiusKey;
|
|
2479
|
+
type ResolvedColorSet = import__fluid_app_portal_core_theme.ResolvedColorSet;
|
|
2480
|
+
type ResolvedSemanticColor = import__fluid_app_portal_core_theme.ResolvedSemanticColor;
|
|
2481
|
+
type SEMANTIC_COLOR_NAMES = import__fluid_app_portal_core_theme.SEMANTIC_COLOR_NAMES;
|
|
2482
|
+
type SHADE_STEPS = import__fluid_app_portal_core_theme.SHADE_STEPS;
|
|
2483
|
+
type SemanticColorName = import__fluid_app_portal_core_theme.SemanticColorName;
|
|
2484
|
+
type ShadeStep = import__fluid_app_portal_core_theme.ShadeStep;
|
|
2485
|
+
type ThemeColorPlain = import__fluid_app_portal_core_theme.ThemeColorPlain;
|
|
2486
|
+
type applyTheme = import__fluid_app_portal_core_theme.applyTheme;
|
|
2487
|
+
type deriveDarkVariant = import__fluid_app_portal_core_theme.deriveDarkVariant;
|
|
2488
|
+
type deserialiseTheme = import__fluid_app_portal_core_theme.deserialiseTheme;
|
|
2489
|
+
type generateShades = import__fluid_app_portal_core_theme.generateShades;
|
|
2490
|
+
type generateThemeCSS = import__fluid_app_portal_core_theme.generateThemeCSS;
|
|
2491
|
+
type getDefaultThemeDefinition = import__fluid_app_portal_core_theme.getDefaultThemeDefinition;
|
|
2492
|
+
type getForegroundColor = import__fluid_app_portal_core_theme.getForegroundColor;
|
|
2493
|
+
type mergeDarkOverrides = import__fluid_app_portal_core_theme.mergeDarkOverrides;
|
|
2494
|
+
type parseColor = import__fluid_app_portal_core_theme.parseColor;
|
|
2495
|
+
type removeAllThemes = import__fluid_app_portal_core_theme.removeAllThemes;
|
|
2496
|
+
type removeTheme = import__fluid_app_portal_core_theme.removeTheme;
|
|
2497
|
+
type resolveTheme = import__fluid_app_portal_core_theme.resolveTheme;
|
|
2498
|
+
type serialiseTheme = import__fluid_app_portal_core_theme.serialiseTheme;
|
|
2499
|
+
export { ACTIVITY_SLUGS, APP_DATA_QUERY_KEY, AUTH_CONSTANTS, type Activity as ActivityItem, type ActivitySlug, AlertWidget, type AlignOptions, ApiError, AppLink, type AppLinkProps, type AppNavigationContextValue, AppNavigationProvider, type AppNavigationProviderProps, AppShell, type AppShellProps, AuthError, type AuthErrorProps, AuthLoading, type BackgroundType, type BackgroundValue, type BaseListParams, type BorderRadiusOptions, BuilderScreenView, type BuilderScreenViewProps, type ButtonSizeOptions, CORE_PAGE_IDS, CURRENT_REP_QUERY_KEY, type CalendarEvent, CalendarWidget, CarouselWidget, type CatchUp as CatchUpItem, CatchUpWidget, ChartWidget, type ColorOptions, type Contact, type ContactAddress, type ContactStatus, type ContactType, ContactsScreen, ContainerWidget, type Conversation, type ConversationStatus, type CreateOrderData, CustomersScreen, DEFAULT_AUTH_URL, DEFAULT_COLORS, DEFAULT_FONT_FAMILIES, DEFAULT_FONT_SIZES, DEFAULT_RADII, DEFAULT_SDK_WIDGET_REGISTRY, DEFAULT_SPACING, DEFAULT_THEME_ID, DEFAULT_THEME_NAME, type DashboardData, EmbedWidget, FONT_FAMILY_KEYS, FONT_SIZE_KEYS, type FileUploader, type FluidAuthConfig, type FluidAuthContextValue, FluidAuthProvider, type FluidAuthProviderProps, type FluidClient, FluidProvider, type FluidProviderProps, type FluidSDKConfig, FluidThemeProvider, type FluidThemeProviderProps, type FontFamilyKey, type FontSizeKey, type FontSizeOptions, type GapOptions, type GenerateThemeCSSOptions, ImageWidget, type JWTPayload, LayoutWidget, type ListQueryResult, ListWidget, type Message, type MessageType, type MessagingAuthContext, type MessagingConfig, type MessagingCurrentUser, MessagingScreen, type MySiteData, MySiteWidget, type Navigation, type NavigationItem, NestedWidget, type OklchPlain, type Order, type OrderLineItem, type OrderListParams, OrdersScreen, PAGE_CATEGORIES, PERMISSIONS_QUERY_KEY, PROFILE_QUERY_KEY, PROPERTY_FIELD_TYPES, type PaddingOptions, type PageCategory, type PageCategoryId, type PageOverride, type PageReference, PageRouter, type PageRouterProps, type PageTemplate, PageTemplateProvider, PageTemplateRegistry, type PaginationParams, type Participant, type PermissionAction, type Permissions, type Product, type ProductListParams, ProductsScreen, type Profile, type PropertyFieldSchema, type PropertyFieldType, type QueryResult, type QueryResultNullable, QuickLinksDropdown, type QuickLinksDropdownProps, QuickShareWidget, RADIUS_KEYS, type RadiusKey, type RawApiNavigationItem, type RawApiScreen, type RawApiTheme, type RawManifestResponse, RecentActivityWidget, type Rep, type RepAppData, type RepAppManifest, type RepAppProfile, type RequestOptions, RequireAuth, type RequireAuthProps, type ResolvedColorSet, type ResolvedSemanticColor, type ResolvedTheme, type ResourcePermissions, SEMANTIC_COLOR_NAMES, SHADE_STEPS, STORAGE_KEYS, type SalesData, type SalesDataPoint, type SalesParams, type ScreenDefinition, SdkHeader, type SdkHeaderProps, SdkNavigation, type SdkNavigationProps, type SectionLayoutType, type SemanticColorName, type ShadeStep, type ShareableItem, type SlugMatch, SpacerWidget, type TabConfig, TableWidget, TextWidget, type ThemeColorInput, type ThemeColorPlain, type ThemeDefinition, type ThemeMode, ThemeModeProvider, type ThemePayload, ToDoWidget, type Todo as TodoItem, type TokenValidationResult, type TypedWidgetSchema, URL_PARAMS, USER_TYPES, type UpdateRepData, type UploadCallbacks, type UploadResult, type UseContactResult, type UseContactsParams, type UseContactsResult, type UseConversationMessagesResult, type UseConversationsResult, type UseFluidPermissionsResult, type UseFluidThemeResult, type UseListResourceHook, type UseSingleResourceHook, type UserMe, type UserPermissions, type UserType, type ValueListQueryResult, VideoWidget, WIDGET_TYPE_NAMES, type WidgetPath, type WidgetPropertySchema, type WidgetRegistry, type WidgetSchema, type WidgetType, type WidgetTypeName, type WithData, alertWidgetPropertySchema, applyTheme, assertDefined, assertNever, buildThemeDefinition, calendarWidgetPropertySchema, carouselWidgetPropertySchema, catchUpWidgetPropertySchema, chartWidgetPropertySchema, cleanTokenFromUrl, clearTokens, collectNavSlugs, contactsScreenPropertySchema, containerWidgetPropertySchema, createDefaultAuthRedirect, createFluidClient, createFluidFileUploader, createScreen, createWidgetFromShareable, createWidgetRegistry, customersScreenPropertySchema, decodeToken, deriveDarkVariant, deserialiseTheme, embedWidgetPropertySchema, extractAllTokensFromUrl, extractCompanyTokenFromUrl, extractSlugFromPathname, extractTokenFromUrl, gapValues, generateShades, generateThemeCSS, getActiveThemeId, getAvailablePageTemplates, getCorePageTemplates, getDefaultThemeDefinition, getForegroundColor, getOptionalPageTemplates, getProperty, getStoredToken, getThemeModeAttribute, getTokenExpiration, getTokenTimeRemaining, groupChildrenByColumn, hasData, hasStoredToken, hasTokenInUrl, imageWidgetPropertySchema, isActivitySlug, isApiError, isContactStatus, isErrorResult, isIdle, isLoading, isPropertyFieldType, isSlugInSection, isTokenExpired, isUserType, isValidToken, isWidgetType, isWidgetTypeName, layoutWidgetPropertySchema, listWidgetPropertySchema, matchSlugPrefix, mergeDarkOverrides, messagingScreenPropertySchema, mySiteWidgetPropertySchema, nestedWidgetPropertySchema, normalizeComponentTree, ordersScreenPropertySchema, parseColor, productsScreenPropertySchema, quickShareWidgetPropertySchema, recentActivityWidgetPropertySchema, removeAllThemes, removeTheme, resolveNavigationPages, resolveTheme, screenPropertySchemas, sectionLayoutConfig, selectProperty, serialiseTheme, spacerWidgetPropertySchema, storeToken, tableWidgetPropertySchema, textWidgetPropertySchema, toDoWidgetPropertySchema, toNavigationItem, toScreenDefinition, transformManifestToRepAppData, transformThemes, useActivities, useAppNavigation, useCalendarEvents, useCatchUps, useContact, useContacts, useConversationMessages, useConversations, useCurrentRep, useFluidApi, useFluidApp, useFluidAuth, useFluidAuthContext, useFluidContext, useFluidPermissions, useFluidProfile, useFluidTheme, useMessagingAuth, useMessagingConfig, useMySite, usePageTemplates, useResolvedPages, useThemeContext, useThemeMode, useTodos, validateNavigationPages, validateToken, videoWidgetPropertySchema, widgetPropertySchemas };
|
|
2500
|
+
//# sourceMappingURL=index.d.cts.map
|