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