@fluid-app/portal-sdk 0.1.106 → 0.1.108
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/{AppDownloadScreen-BBpvNeFO.mjs → AppDownloadScreen-BvcyEKCk.mjs} +2 -2
- package/dist/{AppDownloadScreen-BBpvNeFO.mjs.map → AppDownloadScreen-BvcyEKCk.mjs.map} +1 -1
- package/dist/{AppDownloadScreen-Da79ffTK.cjs → AppDownloadScreen-DzFc_CDn.cjs} +2 -2
- package/dist/{AppDownloadScreen-Da79ffTK.cjs.map → AppDownloadScreen-DzFc_CDn.cjs.map} +1 -1
- package/dist/{AppDownloadScreen-R3rcFWzL.cjs → AppDownloadScreen-Uc9N7K_K.cjs} +2 -2
- package/dist/{ContactsScreen-CGyCNeZy.mjs → ContactsScreen-BNqIi0XS.mjs} +5 -5
- package/dist/{ContactsScreen-CGyCNeZy.mjs.map → ContactsScreen-BNqIi0XS.mjs.map} +1 -1
- package/dist/{ContactsScreen-CFC32ATZ.cjs → ContactsScreen-C6cCTl51.cjs} +5 -5
- package/dist/{ContactsScreen-CFC32ATZ.cjs.map → ContactsScreen-C6cCTl51.cjs.map} +1 -1
- package/dist/{ContactsScreen-D81raD2s.cjs → ContactsScreen-D2DYk3A-.cjs} +6 -6
- package/dist/{FluidProvider-DbYLBGGg.cjs → FluidProvider-NnE6s3O0.cjs} +6 -458
- package/dist/FluidProvider-NnE6s3O0.cjs.map +1 -0
- package/dist/{FluidProvider-B59bzF__.mjs → FluidProvider-dTwaHRzI.mjs} +7 -483
- package/dist/FluidProvider-dTwaHRzI.mjs.map +1 -0
- package/dist/{MessagingScreen-TCOhXTPN.cjs → MessagingScreen-C_tCav2Y.cjs} +4 -4
- package/dist/{MessagingScreen-DsH-L7vB.cjs → MessagingScreen-DH0YxaOG.cjs} +8 -10
- package/dist/{MessagingScreen-DsH-L7vB.cjs.map → MessagingScreen-DH0YxaOG.cjs.map} +1 -1
- package/dist/{MessagingScreen-6SfuZqDC.mjs → MessagingScreen-Dv8HVEt-.mjs} +8 -10
- package/dist/MessagingScreen-Dv8HVEt-.mjs.map +1 -0
- package/dist/{MessagingScreen-Bg-7zNye.mjs → MessagingScreen-IzNlAXvD.mjs} +4 -4
- package/dist/{MySiteScreen-DDX4xcMv.cjs → MySiteScreen-Bda8FzQ9.cjs} +3 -3
- package/dist/{MySiteScreen-BHiMCIZ_.cjs → MySiteScreen-DydtAGvt.cjs} +3 -3
- package/dist/{MySiteScreen-BHiMCIZ_.cjs.map → MySiteScreen-DydtAGvt.cjs.map} +1 -1
- package/dist/{MySiteScreen-BI089vJc.mjs → MySiteScreen-t89PLodk.mjs} +3 -3
- package/dist/{MySiteScreen-BI089vJc.mjs.map → MySiteScreen-t89PLodk.mjs.map} +1 -1
- package/dist/{OrdersScreen-BQVbdyrZ.cjs → OrdersScreen-BhJkW3TG.cjs} +4 -4
- package/dist/{OrdersScreen-BQVbdyrZ.cjs.map → OrdersScreen-BhJkW3TG.cjs.map} +1 -1
- package/dist/{OrdersScreen-CaESWLWt.mjs → OrdersScreen-DP1WdqVT.mjs} +4 -4
- package/dist/{OrdersScreen-CaESWLWt.mjs.map → OrdersScreen-DP1WdqVT.mjs.map} +1 -1
- package/dist/{OrdersScreen-BsPW-2wm.cjs → OrdersScreen-DvaV61fj.cjs} +3 -3
- package/dist/{ProductsScreen-Bp_XLYgP.mjs → ProductsScreen-CFLI7j5s.mjs} +7 -7
- package/dist/{ProductsScreen-BFnsUrY1.cjs → ProductsScreen-CI9G5UJh.cjs} +7 -7
- package/dist/{ProductsScreen-ClC1fTWG.mjs → ProductsScreen-sEcByLGy.mjs} +5 -5
- package/dist/{ProductsScreen-ClC1fTWG.mjs.map → ProductsScreen-sEcByLGy.mjs.map} +1 -1
- package/dist/{ProductsScreen-D-mnWuJW.cjs → ProductsScreen-ssonMzdl.cjs} +5 -5
- package/dist/{ProductsScreen-D-mnWuJW.cjs.map → ProductsScreen-ssonMzdl.cjs.map} +1 -1
- package/dist/{ProfileScreen-COpbffE9.cjs → ProfileScreen-BPvudlCM.cjs} +10 -9
- package/dist/{ProfileScreen-COpbffE9.cjs.map → ProfileScreen-BPvudlCM.cjs.map} +1 -1
- package/dist/{ProfileScreen-B1zSJuVE.mjs → ProfileScreen-BWiBC4y3.mjs} +10 -9
- package/dist/{ProfileScreen-B1zSJuVE.mjs.map → ProfileScreen-BWiBC4y3.mjs.map} +1 -1
- package/dist/{ProfileScreen-p9Zqln4n.cjs → ProfileScreen-Bc4znBmb.cjs} +2 -2
- package/dist/{ShareablesScreen-BSOBA2bP.cjs → ShareablesScreen-BvBfPJ69.cjs} +7 -7
- package/dist/{ShareablesScreen-BOwl9-B0.mjs → ShareablesScreen-CIrWSh5q.mjs} +8 -7
- package/dist/{ShareablesScreen-BOwl9-B0.mjs.map → ShareablesScreen-CIrWSh5q.mjs.map} +1 -1
- package/dist/{ShareablesScreen-Bmghdz71.mjs → ShareablesScreen-CtQckby8.mjs} +7 -7
- package/dist/{ShareablesScreen-9toTptRT.cjs → ShareablesScreen-D3JVKFVA.cjs} +9 -8
- package/dist/{ShareablesScreen-9toTptRT.cjs.map → ShareablesScreen-D3JVKFVA.cjs.map} +1 -1
- package/dist/{ShopScreen-Cbv-zrHK.cjs → ShopScreen-BTTKNmtT.cjs} +6 -7
- package/dist/ShopScreen-BTTKNmtT.cjs.map +1 -0
- package/dist/{ShopScreen-BwNZxqnT.mjs → ShopScreen-CDscN4-a.mjs} +6 -7
- package/dist/{ShopScreen-BwNZxqnT.mjs.map → ShopScreen-CDscN4-a.mjs.map} +1 -1
- package/dist/{ShopScreen-M2hCxrwQ.cjs → ShopScreen-TWpb8sxs.cjs} +2 -2
- package/dist/{SubscriptionsScreen-CJwOjaBY.cjs → SubscriptionsScreen-B0drtNfN.cjs} +4 -4
- package/dist/{SubscriptionsScreen-CJwOjaBY.cjs.map → SubscriptionsScreen-B0drtNfN.cjs.map} +1 -1
- package/dist/{SubscriptionsScreen-YsIehRb5.mjs → SubscriptionsScreen-D-BXah4H.mjs} +4 -4
- package/dist/{SubscriptionsScreen-YsIehRb5.mjs.map → SubscriptionsScreen-D-BXah4H.mjs.map} +1 -1
- package/dist/{SubscriptionsScreen-Bfu-mgGS.cjs → SubscriptionsScreen-WtnN9Ka0.cjs} +4 -4
- package/dist/{UpgradeScreen-DI7DK6qt.cjs → UpgradeScreen-C-aIQL-y.cjs} +1 -1
- package/dist/{UpgradeScreen-DI7DK6qt.cjs.map → UpgradeScreen-C-aIQL-y.cjs.map} +1 -1
- package/dist/{UpgradeScreen-DfDZG52l.cjs → UpgradeScreen-CWgcMBwb.cjs} +1 -1
- package/dist/{UpgradeScreen-CTXUueQY.mjs → UpgradeScreen-GTOZCURK.mjs} +1 -1
- package/dist/{UpgradeScreen-CTXUueQY.mjs.map → UpgradeScreen-GTOZCURK.mjs.map} +1 -1
- package/dist/{dist-oYNtEpKP.mjs → dist-B1HwSrso.mjs} +2 -2
- package/dist/{dist-oYNtEpKP.mjs.map → dist-B1HwSrso.mjs.map} +1 -1
- package/dist/{dist-BSbac3uh.cjs → dist-BF_4vk1z.cjs} +1 -1
- package/dist/{dist-BSbac3uh.cjs.map → dist-BF_4vk1z.cjs.map} +1 -1
- package/dist/{dist-DRVtlgQ1.cjs → dist-BbS_7TvS.cjs} +1 -1
- package/dist/{dist-DRVtlgQ1.cjs.map → dist-BbS_7TvS.cjs.map} +1 -1
- package/dist/{dist-NMbUD0qE.mjs → dist-CMGXkSgZ.mjs} +1 -1
- package/dist/{dist-NMbUD0qE.mjs.map → dist-CMGXkSgZ.mjs.map} +1 -1
- package/dist/{dist-Ck9MGRmE.cjs → dist-DkYXiQQ1.cjs} +2 -2
- package/dist/{dist-Ck9MGRmE.cjs.map → dist-DkYXiQQ1.cjs.map} +1 -1
- package/dist/{es-BCKjXBqj.mjs → es-B84KtbcD.mjs} +1 -1
- package/dist/{es-BCKjXBqj.mjs.map → es-B84KtbcD.mjs.map} +1 -1
- package/dist/{es-DlWO6buB.cjs → es-BSkb3AZk.cjs} +1 -1
- package/dist/{es-DlWO6buB.cjs.map → es-BSkb3AZk.cjs.map} +1 -1
- package/dist/index.cjs +54 -75
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +70 -185
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +70 -185
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +53 -59
- package/dist/index.mjs.map +1 -1
- package/dist/{order-detail-CtTwAXfP.mjs → order-detail-B8jb-YB6.mjs} +1 -1
- package/dist/{order-detail-CtTwAXfP.mjs.map → order-detail-B8jb-YB6.mjs.map} +1 -1
- package/dist/{order-detail-CksE8d5w.cjs → order-detail-Bq7_UZ75.cjs} +1 -1
- package/dist/{order-detail-CksE8d5w.cjs.map → order-detail-Bq7_UZ75.cjs.map} +1 -1
- package/dist/{products-BAtIML76.cjs → products-3BKfOxrs.cjs} +1 -1
- package/dist/{products-BAtIML76.cjs.map → products-3BKfOxrs.cjs.map} +1 -1
- package/dist/{products-StJIeia3.mjs → products-DtutnMu9.mjs} +1 -1
- package/dist/{products-StJIeia3.mjs.map → products-DtutnMu9.mjs.map} +1 -1
- package/dist/{sortable.esm-DSrWP4x9.mjs → sortable.esm-Cz-CP2N8.mjs} +1 -1
- package/dist/{sortable.esm-DSrWP4x9.mjs.map → sortable.esm-Cz-CP2N8.mjs.map} +1 -1
- package/dist/{src-DryOJTBW.mjs → src-CN7diUEw.mjs} +1 -1
- package/dist/{src-DryOJTBW.mjs.map → src-CN7diUEw.mjs.map} +1 -1
- package/dist/{src-xEfkv04t.cjs → src-D5RNExKx.cjs} +6 -6
- package/dist/{src-xEfkv04t.cjs.map → src-D5RNExKx.cjs.map} +1 -1
- package/dist/{src-DjlwUaws.mjs → src-Dhvv96Yt.mjs} +6 -6
- package/dist/{src-DjlwUaws.mjs.map → src-Dhvv96Yt.mjs.map} +1 -1
- package/dist/{src-CMByt6YP.cjs → src-Zv3-NSUf.cjs} +1 -1
- package/dist/{src-CMByt6YP.cjs.map → src-Zv3-NSUf.cjs.map} +1 -1
- package/dist/{use-account-clients-CFM5q2J-.cjs → use-account-clients-CDTUFb6O.cjs} +5 -70
- package/dist/use-account-clients-CDTUFb6O.cjs.map +1 -0
- package/dist/{use-account-clients-BVe69HZV.mjs → use-account-clients-vDDhNW8x.mjs} +6 -65
- package/dist/use-account-clients-vDDhNW8x.mjs.map +1 -0
- package/dist/{use-current-user-CrHH290V.cjs → use-current-user-C7O5SJ_L.cjs} +3 -3
- package/dist/{use-current-user-CrHH290V.cjs.map → use-current-user-C7O5SJ_L.cjs.map} +1 -1
- package/dist/{use-current-user-SmbdS--3.mjs → use-current-user-Czzb9Zc4.mjs} +3 -3
- package/dist/{use-current-user-SmbdS--3.mjs.map → use-current-user-Czzb9Zc4.mjs.map} +1 -1
- package/dist/{use-customer-account-C1ypS2wX.mjs → use-customer-account-DHZ8wLs9.mjs} +6 -7
- package/dist/use-customer-account-DHZ8wLs9.mjs.map +1 -0
- package/dist/{use-customer-account-_IaCM92S.cjs → use-customer-account-zgiEdZ89.cjs} +6 -7
- package/dist/use-customer-account-zgiEdZ89.cjs.map +1 -0
- package/dist/{use-fluid-api-f1PKU6dS.mjs → use-fluid-api-D0kldm0L.mjs} +2 -2
- package/dist/{use-fluid-api-f1PKU6dS.mjs.map → use-fluid-api-D0kldm0L.mjs.map} +1 -1
- package/dist/{use-fluid-api-C2evcv_D.cjs → use-fluid-api-Wjw57-uD.cjs} +2 -2
- package/dist/{use-fluid-api-C2evcv_D.cjs.map → use-fluid-api-Wjw57-uD.cjs.map} +1 -1
- package/dist/use-fluid-auth-BPwsWZNu.cjs +50 -0
- package/dist/use-fluid-auth-BPwsWZNu.cjs.map +1 -0
- package/dist/use-fluid-auth-Dy5K7BQ9.mjs +45 -0
- package/dist/use-fluid-auth-Dy5K7BQ9.mjs.map +1 -0
- package/package.json +9 -9
- package/dist/FluidProvider-B59bzF__.mjs.map +0 -1
- package/dist/FluidProvider-DbYLBGGg.cjs.map +0 -1
- package/dist/MessagingScreen-6SfuZqDC.mjs.map +0 -1
- package/dist/ShopScreen-Cbv-zrHK.cjs.map +0 -1
- package/dist/use-account-clients-BVe69HZV.mjs.map +0 -1
- package/dist/use-account-clients-CFM5q2J-.cjs.map +0 -1
- package/dist/use-customer-account-C1ypS2wX.mjs.map +0 -1
- package/dist/use-customer-account-_IaCM92S.cjs.map +0 -1
- /package/dist/{src-BakNjVTk.mjs → src-B7j_mfeS.mjs} +0 -0
- /package/dist/{src-C_kOrGdZ.cjs → src-Bp-dRR29.cjs} +0 -0
package/dist/index.d.mts
CHANGED
|
@@ -57,7 +57,7 @@ interface JWTPayload {
|
|
|
57
57
|
* Configuration options for FluidAuthProvider.
|
|
58
58
|
* All options have sensible defaults.
|
|
59
59
|
*/
|
|
60
|
-
interface FluidAuthConfig {
|
|
60
|
+
interface FluidAuthConfig$1 {
|
|
61
61
|
/**
|
|
62
62
|
* URL parameter name for the auth token.
|
|
63
63
|
* @default "fluidUserToken"
|
|
@@ -113,37 +113,6 @@ interface FluidAuthConfig {
|
|
|
113
113
|
*/
|
|
114
114
|
jwksUrl?: string;
|
|
115
115
|
}
|
|
116
|
-
/**
|
|
117
|
-
* Value provided by the FluidAuthContext.
|
|
118
|
-
* All properties are readonly since context values should not be mutated by consumers.
|
|
119
|
-
*/
|
|
120
|
-
interface FluidAuthContextValue {
|
|
121
|
-
/** Whether the user is authenticated with a valid token */
|
|
122
|
-
readonly isAuthenticated: boolean;
|
|
123
|
-
/** Whether authentication is still being initialized */
|
|
124
|
-
readonly isLoading: boolean;
|
|
125
|
-
/** Decoded JWT payload if authenticated, null otherwise */
|
|
126
|
-
readonly user: JWTPayload | null;
|
|
127
|
-
/** Raw JWT token string if authenticated, null otherwise */
|
|
128
|
-
readonly token: string | null;
|
|
129
|
-
/** Clear authentication state and stored tokens */
|
|
130
|
-
readonly clearAuth: () => void;
|
|
131
|
-
/** Authentication error if any occurred during initialization */
|
|
132
|
-
readonly error: Error | null;
|
|
133
|
-
}
|
|
134
|
-
/**
|
|
135
|
-
* Result of token validation.
|
|
136
|
-
* Uses a discriminated union for type-safe handling of valid/invalid states.
|
|
137
|
-
*/
|
|
138
|
-
type TokenValidationResult = {
|
|
139
|
-
/** Token is valid */isValid: true; /** Decoded JWT payload */
|
|
140
|
-
payload: JWTPayload; /** No error when valid */
|
|
141
|
-
error?: undefined;
|
|
142
|
-
} | {
|
|
143
|
-
/** Token is invalid */isValid: false; /** Decoded JWT payload if parseable but expired */
|
|
144
|
-
payload?: JWTPayload; /** Error message explaining why validation failed */
|
|
145
|
-
error: string;
|
|
146
|
-
};
|
|
147
116
|
//#endregion
|
|
148
117
|
//#region ../../platform/auth/src/constants.d.ts
|
|
149
118
|
/**
|
|
@@ -168,135 +137,17 @@ declare const AUTH_CONSTANTS: {
|
|
|
168
137
|
*/
|
|
169
138
|
readonly COOKIE_MAX_AGE: 777_600;
|
|
170
139
|
};
|
|
171
|
-
/**
|
|
172
|
-
* Storage keys for auth tokens.
|
|
173
|
-
*/
|
|
174
|
-
declare const STORAGE_KEYS: {
|
|
175
|
-
/** localStorage key for user token */readonly USER_TOKEN: "fluidUserToken"; /** localStorage key for company token (legacy) */
|
|
176
|
-
readonly COMPANY_TOKEN: "fluidCompanyToken"; /** Cookie name for auth token */
|
|
177
|
-
readonly AUTH_COOKIE: "auth_token";
|
|
178
|
-
};
|
|
179
|
-
/**
|
|
180
|
-
* Default URL parameter names for token extraction.
|
|
181
|
-
*/
|
|
182
|
-
declare const URL_PARAMS: {
|
|
183
|
-
/** URL parameter name for user token */readonly USER_TOKEN: "fluidUserToken"; /** URL parameter name for company token (legacy) */
|
|
184
|
-
readonly COMPANY_TOKEN: "fluidCompanyToken";
|
|
185
|
-
};
|
|
186
|
-
//#endregion
|
|
187
|
-
//#region ../../platform/auth/src/token-utils.d.ts
|
|
188
|
-
/**
|
|
189
|
-
* Decode a JWT token and extract its payload.
|
|
190
|
-
*
|
|
191
|
-
* **Security note:** This function does NOT verify the JWT signature.
|
|
192
|
-
* It only decodes the payload. Any valid JWT structure will be accepted,
|
|
193
|
-
* regardless of who signed it.
|
|
194
|
-
*
|
|
195
|
-
* Client-side token decoding is used for UX purposes only (displaying
|
|
196
|
-
* user info, role-based UI). The real security boundary is the server-side
|
|
197
|
-
* API, which verifies the signature on every request.
|
|
198
|
-
*
|
|
199
|
-
* For signature verification, use {@link verifyToken} with a JWKS URL.
|
|
200
|
-
*
|
|
201
|
-
* @param token - The JWT token string
|
|
202
|
-
* @returns The decoded JWT payload, or null if decoding fails
|
|
203
|
-
*/
|
|
204
|
-
declare function decodeToken(token: string): JWTPayload | null;
|
|
205
|
-
/**
|
|
206
|
-
* Check if a token has expired.
|
|
207
|
-
* Includes a configurable grace period to account for clock skew.
|
|
208
|
-
*
|
|
209
|
-
* @param token - The JWT token string
|
|
210
|
-
* @param gracePeriodMs - Grace period in milliseconds (default: 30 seconds)
|
|
211
|
-
* @returns true if the token is expired, false otherwise
|
|
212
|
-
*/
|
|
213
|
-
declare function isTokenExpired(token: string, gracePeriodMs?: number): boolean;
|
|
214
|
-
/**
|
|
215
|
-
* Validate a JWT token for format and expiration.
|
|
216
|
-
*
|
|
217
|
-
* **Security note:** This function checks JWT structure and expiration
|
|
218
|
-
* but does NOT verify the signature. It is a UX-level check only.
|
|
219
|
-
* For signature verification, use {@link verifyToken} with a JWKS URL.
|
|
220
|
-
*
|
|
221
|
-
* @param token - The JWT token string
|
|
222
|
-
* @param gracePeriodMs - Grace period for expiration check (default: 30 seconds)
|
|
223
|
-
* @returns Validation result with status and decoded payload if valid
|
|
224
|
-
*/
|
|
225
|
-
declare function validateToken(token: string, gracePeriodMs?: number): TokenValidationResult;
|
|
226
|
-
/**
|
|
227
|
-
* Type guard to check if a validation result is valid.
|
|
228
|
-
* Enables TypeScript narrowing of the result type.
|
|
229
|
-
*
|
|
230
|
-
* @param result - The validation result to check
|
|
231
|
-
* @returns true if the token is valid (narrows payload to non-optional)
|
|
232
|
-
*/
|
|
233
|
-
declare function isValidToken(result: TokenValidationResult): result is TokenValidationResult & {
|
|
234
|
-
isValid: true;
|
|
235
|
-
payload: JWTPayload;
|
|
236
|
-
};
|
|
237
|
-
/**
|
|
238
|
-
* Get the expiration time of a token as a Date.
|
|
239
|
-
*
|
|
240
|
-
* @param token - The JWT token string
|
|
241
|
-
* @returns The expiration Date, or null if token has no expiration or is invalid
|
|
242
|
-
*/
|
|
243
|
-
declare function getTokenExpiration(token: string): Date | null;
|
|
244
|
-
/**
|
|
245
|
-
* Get the time remaining until token expiration in milliseconds.
|
|
246
|
-
*
|
|
247
|
-
* @param token - The JWT token string
|
|
248
|
-
* @returns Milliseconds until expiration, or 0 if expired/invalid, or Infinity if no expiration
|
|
249
|
-
*/
|
|
250
|
-
declare function getTokenTimeRemaining(token: string): number;
|
|
251
140
|
//#endregion
|
|
252
141
|
//#region ../../platform/auth/src/token-storage.d.ts
|
|
253
142
|
/**
|
|
254
|
-
* Get the stored auth token.
|
|
255
|
-
* Checks cookie first, then falls back to localStorage.
|
|
256
|
-
*
|
|
257
|
-
* @param config - Optional auth config for custom cookie key
|
|
258
|
-
* @returns The stored token or null if not found
|
|
259
|
-
*/
|
|
260
|
-
declare function getStoredToken(config?: FluidAuthConfig): string | null;
|
|
261
|
-
/**
|
|
262
|
-
* Store an auth token in both cookie and localStorage.
|
|
263
|
-
* Using both provides redundancy and compatibility with different auth flows.
|
|
264
|
-
*
|
|
265
|
-
* @param token - The JWT token to store
|
|
266
|
-
* @param config - Optional auth config for custom storage options
|
|
267
|
-
*/
|
|
268
|
-
declare function storeToken(token: string, config?: FluidAuthConfig): void;
|
|
269
|
-
/**
|
|
270
143
|
* Clear all stored auth tokens from cookies and localStorage.
|
|
271
144
|
*
|
|
272
145
|
* @param config - Optional auth config for custom cookie key
|
|
273
146
|
*/
|
|
274
|
-
declare function clearTokens(config?: FluidAuthConfig): void;
|
|
275
|
-
/**
|
|
276
|
-
* Check if any auth token is stored.
|
|
277
|
-
*
|
|
278
|
-
* @param config - Optional auth config
|
|
279
|
-
* @returns true if a token is stored, false otherwise
|
|
280
|
-
*/
|
|
281
|
-
declare function hasStoredToken(config?: FluidAuthConfig): boolean;
|
|
147
|
+
declare function clearTokens(config?: FluidAuthConfig$1): void;
|
|
282
148
|
//#endregion
|
|
283
149
|
//#region ../../platform/auth/src/url-token.d.ts
|
|
284
150
|
/**
|
|
285
|
-
* Extract the auth token from the URL query parameters.
|
|
286
|
-
*
|
|
287
|
-
* @param tokenKey - The URL parameter name (default: "fluidUserToken")
|
|
288
|
-
* @returns The token value or null if not present
|
|
289
|
-
*/
|
|
290
|
-
declare function extractTokenFromUrl(tokenKey?: string): string | null;
|
|
291
|
-
/**
|
|
292
|
-
* Extract the company token from the URL query parameters.
|
|
293
|
-
* This is a legacy parameter that may still be used in some flows.
|
|
294
|
-
*
|
|
295
|
-
* @param tokenKey - The URL parameter name (default: "fluidCompanyToken")
|
|
296
|
-
* @returns The token value or null if not present
|
|
297
|
-
*/
|
|
298
|
-
declare function extractCompanyTokenFromUrl(tokenKey?: string): string | null;
|
|
299
|
-
/**
|
|
300
151
|
* Remove the auth token from the URL without reloading the page.
|
|
301
152
|
* This prevents the token from being accidentally shared via URL copy/paste
|
|
302
153
|
* or appearing in browser history.
|
|
@@ -306,24 +157,6 @@ declare function extractCompanyTokenFromUrl(tokenKey?: string): string | null;
|
|
|
306
157
|
* @param tokenKey - The URL parameter name to remove (default: "fluidUserToken")
|
|
307
158
|
*/
|
|
308
159
|
declare function cleanTokenFromUrl(tokenKey?: string): void;
|
|
309
|
-
/**
|
|
310
|
-
* Check if the URL contains an auth token parameter.
|
|
311
|
-
*
|
|
312
|
-
* @param tokenKey - The URL parameter name (default: "fluidUserToken")
|
|
313
|
-
* @returns true if the URL contains the token parameter
|
|
314
|
-
*/
|
|
315
|
-
declare function hasTokenInUrl(tokenKey?: string): boolean;
|
|
316
|
-
/**
|
|
317
|
-
* Extract all auth-related tokens from the URL at once.
|
|
318
|
-
*
|
|
319
|
-
* @param userTokenKey - The URL parameter name for user token
|
|
320
|
-
* @param companyTokenKey - The URL parameter name for company token
|
|
321
|
-
* @returns Object with both token values (or null if not present)
|
|
322
|
-
*/
|
|
323
|
-
declare function extractAllTokensFromUrl(userTokenKey?: string, companyTokenKey?: string): {
|
|
324
|
-
userToken: string | null;
|
|
325
|
-
companyToken: string | null;
|
|
326
|
-
};
|
|
327
160
|
//#endregion
|
|
328
161
|
//#region ../../platform/api-client-core/src/fetch-client.d.ts
|
|
329
162
|
interface RequestOptions$1 {
|
|
@@ -1802,6 +1635,65 @@ declare function FluidThemeProvider({
|
|
|
1802
1635
|
*/
|
|
1803
1636
|
declare function useThemeContext(): ThemeContextValue;
|
|
1804
1637
|
//#endregion
|
|
1638
|
+
//#region src/auth/types.d.ts
|
|
1639
|
+
/**
|
|
1640
|
+
* Configuration options for FluidAuthProvider.
|
|
1641
|
+
*
|
|
1642
|
+
* JWT-specific fields (tokenKey, cookieKey, cookieMaxAge, gracePeriodMs,
|
|
1643
|
+
* jwksUrl) have been removed. Auth is now fully server-side via Rails
|
|
1644
|
+
* sessions with HTTP-only cookies.
|
|
1645
|
+
*/
|
|
1646
|
+
interface FluidAuthConfig {
|
|
1647
|
+
/**
|
|
1648
|
+
* Callback invoked when authentication fails (no valid session).
|
|
1649
|
+
* When omitted, the page is reloaded — Rails will 302 unauthenticated
|
|
1650
|
+
* HTML requests to the Portal Hub, which works for all hostname patterns
|
|
1651
|
+
* including CNAMEs.
|
|
1652
|
+
*/
|
|
1653
|
+
onAuthFailure?: () => void;
|
|
1654
|
+
}
|
|
1655
|
+
/**
|
|
1656
|
+
* Value provided by the FluidAuthContext.
|
|
1657
|
+
*
|
|
1658
|
+
* The `token` field has been removed. Auth tokens are now managed
|
|
1659
|
+
* server-side via HTTP-only session cookies. The `user` field is
|
|
1660
|
+
* populated from the session API response.
|
|
1661
|
+
*/
|
|
1662
|
+
interface FluidAuthContextValue {
|
|
1663
|
+
/** Whether the user is authenticated with a valid session */
|
|
1664
|
+
readonly isAuthenticated: boolean;
|
|
1665
|
+
/** Whether authentication is still being initialized */
|
|
1666
|
+
readonly isLoading: boolean;
|
|
1667
|
+
/** User data from the session, null if not authenticated */
|
|
1668
|
+
readonly user: SessionUser | null;
|
|
1669
|
+
/** Clear authentication state */
|
|
1670
|
+
readonly clearAuth: () => void;
|
|
1671
|
+
/** Authentication error if any occurred during initialization */
|
|
1672
|
+
readonly error: Error | null;
|
|
1673
|
+
}
|
|
1674
|
+
/**
|
|
1675
|
+
* User data returned from the session check endpoint.
|
|
1676
|
+
*
|
|
1677
|
+
* This replaces the JWT payload — the same fields are available but
|
|
1678
|
+
* they come from the server session instead of a decoded token.
|
|
1679
|
+
*/
|
|
1680
|
+
interface SessionUser {
|
|
1681
|
+
/** User ID */
|
|
1682
|
+
id?: number | undefined;
|
|
1683
|
+
/** User email address */
|
|
1684
|
+
email?: string | undefined;
|
|
1685
|
+
/** Full name of the user */
|
|
1686
|
+
full_name?: string | undefined;
|
|
1687
|
+
/** User role type */
|
|
1688
|
+
user_type: UserType;
|
|
1689
|
+
/** Original user type (for impersonation scenarios) */
|
|
1690
|
+
og_user_type?: UserType | undefined;
|
|
1691
|
+
/** Company ID the user belongs to */
|
|
1692
|
+
company_id?: number | undefined;
|
|
1693
|
+
/** Authentication type (e.g., "standard", "impersonation") */
|
|
1694
|
+
auth_type?: string | undefined;
|
|
1695
|
+
}
|
|
1696
|
+
//#endregion
|
|
1805
1697
|
//#region src/providers/FluidAuthProvider.d.ts
|
|
1806
1698
|
interface FluidAuthProviderProps {
|
|
1807
1699
|
/** React children to wrap with auth context */
|
|
@@ -2178,7 +2070,7 @@ interface PortalConfig {
|
|
|
2178
2070
|
* createPortal({
|
|
2179
2071
|
* customPages,
|
|
2180
2072
|
* fluid: { baseUrl: "https://my-api.example.com" },
|
|
2181
|
-
* auth: {
|
|
2073
|
+
* auth: { onAuthFailure: () => console.log("auth failed") },
|
|
2182
2074
|
* shell: { basePath: "/portal" },
|
|
2183
2075
|
* });
|
|
2184
2076
|
* ```
|
|
@@ -2205,7 +2097,7 @@ declare function createDefaultFluidConfig(overrides?: Partial<FluidSDKConfig>):
|
|
|
2205
2097
|
* The SDK's FluidAuthProvider already applies defaults for all fields,
|
|
2206
2098
|
* so an empty config works out of the box. Use overrides to customize:
|
|
2207
2099
|
* ```ts
|
|
2208
|
-
* const config = createDefaultAuthConfig({
|
|
2100
|
+
* const config = createDefaultAuthConfig({ onAuthFailure: () => navigate("/login") });
|
|
2209
2101
|
* ```
|
|
2210
2102
|
*/
|
|
2211
2103
|
declare function createDefaultAuthConfig(overrides?: Partial<FluidAuthConfig>): FluidAuthConfig;
|
|
@@ -2556,24 +2448,18 @@ declare function useLogout({
|
|
|
2556
2448
|
}?: UseLogoutOptions): () => Promise<void>;
|
|
2557
2449
|
//#endregion
|
|
2558
2450
|
//#region src/hooks/use-company-switch.d.ts
|
|
2559
|
-
interface UseCompanySwitchOptions {
|
|
2560
|
-
/** Auth config forwarded to storeToken so the JWT is written to the correct cookie. */
|
|
2561
|
-
config?: FluidAuthConfig;
|
|
2562
|
-
}
|
|
2451
|
+
interface UseCompanySwitchOptions {}
|
|
2563
2452
|
/**
|
|
2564
2453
|
* Hook that handles company switching for the portal.
|
|
2565
2454
|
*
|
|
2566
2455
|
* Calls PUT /api/authentication/company/{id}/switch, clears the TanStack
|
|
2567
|
-
* Query cache and IndexedDB persisted cache,
|
|
2568
|
-
*
|
|
2569
|
-
*
|
|
2570
|
-
* Cache clearing prevents stale data from the previous company being
|
|
2571
|
-
* rehydrated from the IndexedDB persisted cache after the page reloads.
|
|
2456
|
+
* Query cache and IndexedDB persisted cache, then reloads the page so all
|
|
2457
|
+
* queries re-fetch with the new company context.
|
|
2572
2458
|
*
|
|
2573
|
-
*
|
|
2574
|
-
*
|
|
2459
|
+
* The server updates the session cookie automatically via the switch
|
|
2460
|
+
* endpoint response; no client-side token storage is needed.
|
|
2575
2461
|
*/
|
|
2576
|
-
declare function useCompanySwitch(
|
|
2462
|
+
declare function useCompanySwitch(_options?: UseCompanySwitchOptions): {
|
|
2577
2463
|
switchCompany: (companyId: number) => void;
|
|
2578
2464
|
isPending: boolean;
|
|
2579
2465
|
isError: boolean;
|
|
@@ -3577,7 +3463,6 @@ interface MessagingConfig {
|
|
|
3577
3463
|
readonly apiConfig: MessagingApiConfig;
|
|
3578
3464
|
readonly messagingApi: MessagingApi;
|
|
3579
3465
|
readonly websocketUrl: string;
|
|
3580
|
-
readonly token: string | null;
|
|
3581
3466
|
}
|
|
3582
3467
|
declare function useMessagingConfig(): MessagingConfig;
|
|
3583
3468
|
//#endregion
|
|
@@ -5594,5 +5479,5 @@ declare function useThemeMode(): ThemeModeContextValue;
|
|
|
5594
5479
|
/** Maps a ThemeMode to the value for `data-theme-mode`. Returns undefined for "auto". */
|
|
5595
5480
|
declare function getThemeModeAttribute(mode: ThemeMode): string | undefined;
|
|
5596
5481
|
//#endregion
|
|
5597
|
-
export { ACTIVITY_SLUGS, APP_DATA_QUERY_KEY, AUTH_CONSTANTS, type Activity as ActivityItem, type ActivitySlug, AlertWidget, type AlignOptions, ApiError, AppLink, type AppLinkProps, type AppNavigationContextValue, AppNavigationProvider, type AppNavigationProviderProps, AppShell, type AppShellProps, AuthError, type AuthErrorProps, AuthLoading, type BackgroundType, type BackgroundValue, type BaseListParams, type BorderRadiusOptions, BuilderScreenView, type BuilderScreenViewProps, BulletListWidget, type ButtonSizeOptions, CORE_PAGE_IDS, CURRENT_REP_QUERY_KEY, CURRENT_USER_QUERY_KEY, type CalendarEvent, CalendarWidget, CardWidget, CarouselWidget, type CatchUp as CatchUpItem, CatchUpWidget, ChartWidget, type ColorOptions, type Contact, type ContactAddress, type ContactStatus, type ContactType, ContactsScreen, ContainerWidget, type Conversation, type ConversationStatus, type CreateOrderData, type CursorPagination, CustomersScreen, DEFAULT_AUTH_URL, DEFAULT_COLORS, DEFAULT_FONT_FAMILIES, DEFAULT_FONT_SIZES, DEFAULT_RADII, DEFAULT_SDK_WIDGET_REGISTRY, DEFAULT_SPACING, DEFAULT_THEME_ID, DEFAULT_THEME_NAME, type DashboardData, EmbedWidget, type EnvelopeMeta, FONT_FAMILY_KEYS, FONT_SIZE_KEYS, type FileCategory, type FileUploader, type FluidAuthConfig, type FluidAuthContextValue, FluidAuthProvider, type FluidAuthProviderProps, type FluidClient, FluidProvider, type FluidProviderProps, type FluidSDKConfig, FluidThemeProvider, type FluidThemeProviderProps, type FontFamilyKey, type FontSizeKey, type FontSizeOptions, type GapOptions, type GenerateThemeCSSOptions, ImageWidget, type JWTPayload, LayoutWidget, LinkWidget, type ListQueryResult, ListWidget, type ManifestEntry, type Message, type MessageType, type MessagingAuthContext, type MessagingConfig, type MessagingCurrentUser, MessagingScreen, type MySiteData, MySiteScreen, MySiteWidget, type Navigation, type NavigationItem, NestedWidget, type OklchPlain, type Order, type OrderLineItem, type OrderListParams, OrdersScreen, PAGE_CATEGORIES, PERMISSIONS_QUERY_KEY, PROFILE_QUERY_KEY, PROPERTY_FIELD_TYPES, type PaddingOptions, type PageCategory, type PageCategoryId, type PageOverride, type PageReference, PageRouter, type PageRouterProps, type PageTemplate, PageTemplateProvider, PageTemplateRegistry, type PaginatedResult, type PaginationParams, type Participant, type PermissionAction, type Permissions, PointsWidget, type PortalConfig, type Product, type ProductListParams, type ProductsResponse, ProductsScreen, type Profile, ProfileScreen, type PropertyFieldSchema, type PropertyFieldType, type QueryResult, type QueryResultNullable, QuickLinksDropdown, type QuickLinksDropdownProps, QuickShareWidget, RADIUS_KEYS, type RadiusKey, type RawApiNavigationItem, type RawApiScreen, type RawApiTheme, type RawManifestResponse, RecentActivityWidget, type Rep, type RepAppData, type RepAppManifest, type RepAppProfile, type RequestOptions, RequireAuth, type RequireAuthProps, type ResolvedColorSet, type ResolvedSemanticColor, type ResolvedTheme, type ResourcePermissions, SCAFFOLD_MANIFEST, SEMANTIC_COLOR_NAMES, SHADE_STEPS,
|
|
5482
|
+
export { ACTIVITY_SLUGS, APP_DATA_QUERY_KEY, AUTH_CONSTANTS, type Activity as ActivityItem, type ActivitySlug, AlertWidget, type AlignOptions, ApiError, AppLink, type AppLinkProps, type AppNavigationContextValue, AppNavigationProvider, type AppNavigationProviderProps, AppShell, type AppShellProps, AuthError, type AuthErrorProps, AuthLoading, type BackgroundType, type BackgroundValue, type BaseListParams, type BorderRadiusOptions, BuilderScreenView, type BuilderScreenViewProps, BulletListWidget, type ButtonSizeOptions, CORE_PAGE_IDS, CURRENT_REP_QUERY_KEY, CURRENT_USER_QUERY_KEY, type CalendarEvent, CalendarWidget, CardWidget, CarouselWidget, type CatchUp as CatchUpItem, CatchUpWidget, ChartWidget, type ColorOptions, type Contact, type ContactAddress, type ContactStatus, type ContactType, ContactsScreen, ContainerWidget, type Conversation, type ConversationStatus, type CreateOrderData, type CursorPagination, CustomersScreen, DEFAULT_AUTH_URL, DEFAULT_COLORS, DEFAULT_FONT_FAMILIES, DEFAULT_FONT_SIZES, DEFAULT_RADII, DEFAULT_SDK_WIDGET_REGISTRY, DEFAULT_SPACING, DEFAULT_THEME_ID, DEFAULT_THEME_NAME, type DashboardData, EmbedWidget, type EnvelopeMeta, FONT_FAMILY_KEYS, FONT_SIZE_KEYS, type FileCategory, type FileUploader, type FluidAuthConfig, type FluidAuthContextValue, FluidAuthProvider, type FluidAuthProviderProps, type FluidClient, FluidProvider, type FluidProviderProps, type FluidSDKConfig, FluidThemeProvider, type FluidThemeProviderProps, type FontFamilyKey, type FontSizeKey, type FontSizeOptions, type GapOptions, type GenerateThemeCSSOptions, ImageWidget, type JWTPayload, LayoutWidget, LinkWidget, type ListQueryResult, ListWidget, type ManifestEntry, type Message, type MessageType, type MessagingAuthContext, type MessagingConfig, type MessagingCurrentUser, MessagingScreen, type MySiteData, MySiteScreen, MySiteWidget, type Navigation, type NavigationItem, NestedWidget, type OklchPlain, type Order, type OrderLineItem, type OrderListParams, OrdersScreen, PAGE_CATEGORIES, PERMISSIONS_QUERY_KEY, PROFILE_QUERY_KEY, PROPERTY_FIELD_TYPES, type PaddingOptions, type PageCategory, type PageCategoryId, type PageOverride, type PageReference, PageRouter, type PageRouterProps, type PageTemplate, PageTemplateProvider, PageTemplateRegistry, type PaginatedResult, type PaginationParams, type Participant, type PermissionAction, type Permissions, PointsWidget, type PortalConfig, type Product, type ProductListParams, type ProductsResponse, ProductsScreen, type Profile, ProfileScreen, type PropertyFieldSchema, type PropertyFieldType, type QueryResult, type QueryResultNullable, QuickLinksDropdown, type QuickLinksDropdownProps, QuickShareWidget, RADIUS_KEYS, type RadiusKey, type RawApiNavigationItem, type RawApiScreen, type RawApiTheme, type RawManifestResponse, RecentActivityWidget, type Rep, type RepAppData, type RepAppManifest, type RepAppProfile, type RequestOptions, RequireAuth, type RequireAuthProps, type ResolvedColorSet, type ResolvedSemanticColor, type ResolvedTheme, type ResourcePermissions, SCAFFOLD_MANIFEST, SEMANTIC_COLOR_NAMES, SHADE_STEPS, type SalesData, type SalesDataPoint, type SalesParams, type ScaffoldFile, type ScreenDefinition, SdkCompanySwitcher, SdkHeader, type SdkHeaderProps, SdkNavigation, type SdkNavigationProps, type SectionLayoutType, type SemanticColorName, SeparatorWidget, type SessionUser, type ShadeStep, type ShareableItem, ShareablesScreen, ShopScreen, type SlugMatch, SpacerWidget, SubscriptionsScreen, type SwitchCompanyResponse, type TabConfig, TableWidget, TextWidget, type ThemeColorInput, type ThemeColorPlain, type ThemeDefinition, type ThemeMode, ThemeModeProvider, type ThemePayload, ToDoWidget, type Todo as TodoItem, type TypedWidgetSchema, USER_TYPES, type UpdateRepData, type UploadCallbacks, type UploadResult, type UseCompanySwitchOptions, type UseContactResult, type UseContactsParams, type UseContactsResult, type UseConversationMessagesResult, type UseConversationsResult, type UseFluidPermissionsResult, type UseFluidThemeResult, type UseListResourceHook, type UseLogoutOptions, type UseSingleResourceHook, type UseUserTypeResult, type UserMe, type UserMeCompany, type UserMeCountry, type UserPermissions, type UserType, type ValueListQueryResult, VideoWidget, WIDGET_TYPE_NAMES, type WidgetPath, type WidgetPropertySchema, type WidgetRegistry, type WidgetSchema, type WidgetType, type WidgetTypeName, type WithData, alertWidgetPropertySchema, applyTheme, assertDefined, assertNever, buildThemeDefinition, buildWidgetRegistry, bulletListWidgetPropertySchema, calendarWidgetPropertySchema, cardWidgetPropertySchema, carouselWidgetPropertySchema, catchUpWidgetPropertySchema, chartWidgetPropertySchema, cleanTokenFromUrl, clearTokens, collectNavSlugs, contactsScreenPropertySchema, containerWidgetPropertySchema, createCompanyQueryKey, createDefaultAuthConfig, createDefaultAuthRedirect, createDefaultFluidConfig, createFluidClient, createFluidFileUploader, createPortal, createScreen, createWidgetFromShareable, createWidgetRegistry, customersScreenPropertySchema, deriveDarkVariant, deserialiseTheme, embedWidgetPropertySchema, extractSlugFromPathname, filterRepOnlyNavItems, gapValues, generateShades, generateThemeCSS, getActiveThemeId, getAvailablePageTemplates, getCorePageTemplates, getDefaultThemeDefinition, getForegroundColor, getOptionalPageTemplates, getProperty, getThemeModeAttribute, groupChildrenByColumn, hasData, imageWidgetPropertySchema, isActivitySlug, isApiError, isContactStatus, isErrorResult, isIdle, isLoading, isPropertyFieldType, isSlugInSection, isUserType, isWidgetType, isWidgetTypeName, layoutWidgetPropertySchema, linkWidgetPropertySchema, listWidgetPropertySchema, matchSlugPrefix, mergeDarkOverrides, messagingScreenPropertySchema, mySiteScreenPropertySchema, mySiteWidgetPropertySchema, nestedWidgetPropertySchema, normalizeComponentTree, ordersScreenPropertySchema, parseColor, pointsWidgetPropertySchema, productsScreenPropertySchema, profileScreenPropertySchema, quickShareWidgetPropertySchema, recentActivityWidgetPropertySchema, removeAllThemes, removeTheme, resolveNavigationPages, resolveTheme, screenPropertySchemas, sectionLayoutConfig, selectProperty, separatorWidgetPropertySchema, serialiseTheme, shareablesScreenPropertySchema, shopScreenPropertySchema, spacerWidgetPropertySchema, subscriptionsScreenPropertySchema, tableWidgetPropertySchema, textWidgetPropertySchema, toDoWidgetPropertySchema, toNavigationItem, toRawManifest, toScreenDefinition, transformManifestToRepAppData, transformThemes, useActivities, useAppNavigation, useCalendarEvents, useCatchUps, useCompanyScopedQueryKey, useCompanySwitch, useContact, useContacts, useConversationMessages, useConversations, useCurrentRep, useCurrentUser, useFluidApi, useFluidApp, useFluidAuth, useFluidAuthContext, useFluidContext, useFluidPermissions, useFluidProfile, useFluidTheme, useLogout, useMessagingAuth, useMessagingConfig, useMySite, usePageTemplates, useResolvedPages, useThemeContext, useThemeMode, useTodos, useUserType, validateNavigationPages, videoWidgetPropertySchema, widgetPropertySchemas };
|
|
5598
5483
|
//# sourceMappingURL=index.d.mts.map
|