@cedros/login-react 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +142 -2
- package/dist/AuthenticationSettings-CMQhep61.js +9 -0
- package/dist/AuthenticationSettings-CMQhep61.js.map +1 -0
- package/dist/AuthenticationSettings-Cro76kIC.cjs +1 -0
- package/dist/AuthenticationSettings-Cro76kIC.cjs.map +1 -0
- package/dist/CreditSystemSettings-AM7qDk1E.js +9 -0
- package/dist/CreditSystemSettings-AM7qDk1E.js.map +1 -0
- package/dist/CreditSystemSettings-CGR-uzuh.cjs +1 -0
- package/dist/CreditSystemSettings-CGR-uzuh.cjs.map +1 -0
- package/dist/DepositsSection-BVNd63B7.js +47 -0
- package/dist/DepositsSection-BVNd63B7.js.map +1 -0
- package/dist/DepositsSection-Ct1gjgIg.cjs +1 -0
- package/dist/DepositsSection-Ct1gjgIg.cjs.map +1 -0
- package/dist/EmailRegisterForm-B-ys4E3C.cjs +1 -0
- package/dist/EmailRegisterForm-B-ys4E3C.cjs.map +1 -0
- package/dist/EmailRegisterForm-BChCiZ5B.js +961 -0
- package/dist/EmailRegisterForm-BChCiZ5B.js.map +1 -0
- package/dist/EmailSettings-DFZ13JbX.cjs +1 -0
- package/dist/EmailSettings-DFZ13JbX.cjs.map +1 -0
- package/dist/EmailSettings-Di4GSWgb.js +9 -0
- package/dist/EmailSettings-Di4GSWgb.js.map +1 -0
- package/dist/EmbeddedWalletSettings-Cmn_aVL7.js +9 -0
- package/dist/EmbeddedWalletSettings-Cmn_aVL7.js.map +1 -0
- package/dist/EmbeddedWalletSettings-DRWeIJKb.cjs +1 -0
- package/dist/EmbeddedWalletSettings-DRWeIJKb.cjs.map +1 -0
- package/dist/{ErrorMessage-Bm1j5mBT.js → ErrorMessage-C8vKB0JG.js} +9 -9
- package/dist/ErrorMessage-C8vKB0JG.js.map +1 -0
- package/dist/ErrorMessage-CntMyn93.cjs.map +1 -1
- package/dist/{GoogleLoginButton-CvDoOc-0.js → GoogleLoginButton-Ceo2sYvX.js} +1 -1
- package/dist/{GoogleLoginButton-CvDoOc-0.js.map → GoogleLoginButton-Ceo2sYvX.js.map} +1 -1
- package/dist/ServerSettings-D8w8EpoE.cjs +1 -0
- package/dist/ServerSettings-D8w8EpoE.cjs.map +1 -0
- package/dist/ServerSettings-Wg_odW46.js +9 -0
- package/dist/ServerSettings-Wg_odW46.js.map +1 -0
- package/dist/{SolanaLoginButton-h32xN2PQ.js → SolanaLoginButton-CqVOcPa7.js} +1 -1
- package/dist/{SolanaLoginButton-h32xN2PQ.js.map → SolanaLoginButton-CqVOcPa7.js.map} +1 -1
- package/dist/TeamSection-Bj89WSC0.js +128 -0
- package/dist/TeamSection-Bj89WSC0.js.map +1 -0
- package/dist/TeamSection-DQ4nfUHN.cjs +1 -0
- package/dist/TeamSection-DQ4nfUHN.cjs.map +1 -0
- package/dist/UsersSection-BiZceDV3.cjs +1 -0
- package/dist/UsersSection-BiZceDV3.cjs.map +1 -0
- package/dist/UsersSection-W19ddPsw.js +81 -0
- package/dist/UsersSection-W19ddPsw.js.map +1 -0
- package/dist/WebhookSettings-a1c4iMvr.js +9 -0
- package/dist/WebhookSettings-a1c4iMvr.js.map +1 -0
- package/dist/WebhookSettings-onJWLytD.cjs +1 -0
- package/dist/WebhookSettings-onJWLytD.cjs.map +1 -0
- package/dist/WithdrawalsSection-BBw9gWMR.js +20 -0
- package/dist/WithdrawalsSection-BBw9gWMR.js.map +1 -0
- package/dist/WithdrawalsSection-Cws8inf6.cjs +1 -0
- package/dist/WithdrawalsSection-Cws8inf6.cjs.map +1 -0
- package/dist/admin/AdminShell.d.ts +38 -0
- package/dist/admin/icons.d.ts +2 -0
- package/dist/admin/index.d.ts +10 -0
- package/dist/admin/plugin.d.ts +3 -0
- package/dist/admin/sections/AuthenticationSettings.d.ts +3 -0
- package/dist/admin/sections/CreditSystemSettings.d.ts +3 -0
- package/dist/admin/sections/DepositsSection.d.ts +3 -0
- package/dist/admin/sections/EmailSettings.d.ts +3 -0
- package/dist/admin/sections/EmbeddedWalletSettings.d.ts +3 -0
- package/dist/admin/sections/FeatureSettings.d.ts +3 -0
- package/dist/admin/sections/InvitesSection.d.ts +3 -0
- package/dist/admin/sections/MembersSection.d.ts +3 -0
- package/dist/admin/sections/ServerSettings.d.ts +3 -0
- package/dist/admin/sections/SettingsSections.d.ts +7 -0
- package/dist/admin/sections/TeamSection.d.ts +3 -0
- package/dist/admin/sections/UsersSection.d.ts +3 -0
- package/dist/admin/sections/WebhookSettings.d.ts +3 -0
- package/dist/admin/sections/WithdrawalsSection.d.ts +3 -0
- package/dist/admin/types.d.ts +167 -0
- package/dist/components/admin/AdminUserDetail.d.ts +3 -1
- package/dist/components/admin/AdminUserList.d.ts +3 -7
- package/dist/components/admin/CedrosAdminDashboard.d.ts +7 -3
- package/dist/components/admin/PermissionsSection.d.ts +7 -0
- package/dist/components/admin/ProfileDropdown.d.ts +34 -0
- package/dist/components/admin/SetupWizard.d.ts +30 -0
- package/dist/components/admin/StatsBar.d.ts +17 -0
- package/dist/components/admin/settings/AuthenticationSettings.d.ts +4 -0
- package/dist/components/admin/settings/AutosaveStatus.d.ts +6 -0
- package/dist/components/admin/settings/CreditSystemSettings.d.ts +6 -0
- package/dist/components/admin/settings/EmailSettings.d.ts +4 -0
- package/dist/components/admin/settings/EmbeddedWalletSettings.d.ts +4 -0
- package/dist/components/admin/settings/FeatureSettings.d.ts +4 -0
- package/dist/components/admin/settings/MessagingSettings.d.ts +4 -0
- package/dist/components/admin/settings/SecuritySettings.d.ts +4 -0
- package/dist/components/admin/settings/ServerSettings.d.ts +4 -0
- package/dist/components/admin/settings/SettingsPageLayout.d.ts +16 -0
- package/dist/components/admin/settings/SsoProvidersSettings.d.ts +4 -0
- package/dist/components/admin/settings/WebhookSettings.d.ts +4 -0
- package/dist/components/admin/settings/index.d.ts +31 -0
- package/dist/components/admin/settings/settingsInputs.d.ts +79 -0
- package/dist/components/admin/settings/settingsMetadata.d.ts +18 -0
- package/dist/components/deposit/admin/AdminWithdrawalStats.d.ts +10 -0
- package/dist/components/deposit/admin/FeatureDisabledMessage.d.ts +15 -0
- package/dist/components/deposit/admin/featureDisabled.d.ts +9 -0
- package/dist/components/deposit/admin/index.d.ts +5 -0
- package/dist/components/invites/InviteForm.d.ts +1 -1
- package/dist/components/org/OrgSelector.d.ts +2 -1
- package/dist/components/profile/UserProfileSettings.d.ts +35 -0
- package/dist/components/profile/index.d.ts +2 -0
- package/dist/crypto/secureWipe.d.ts +0 -19
- package/dist/crypto/webauthnPrf.d.ts +0 -10
- package/dist/email-only.cjs +1 -1
- package/dist/email-only.js +2 -2
- package/dist/google-only.js +2 -2
- package/dist/hooks/useDashboardPermissions.d.ts +45 -0
- package/dist/hooks/useProfile.d.ts +35 -0
- package/dist/hooks/useServerFeatures.d.ts +55 -0
- package/dist/hooks/useSettingsAutosave.d.ts +29 -0
- package/dist/hooks/useSetup.d.ts +25 -0
- package/dist/hooks/useSsoProviders.d.ts +52 -0
- package/dist/index-BHR_WTP2.js +19636 -0
- package/dist/index-BHR_WTP2.js.map +1 -0
- package/dist/index-JsIJkPin.cjs +2061 -0
- package/dist/index-JsIJkPin.cjs.map +1 -0
- package/dist/index.cjs +1 -2061
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +21 -3
- package/dist/index.js +117 -14908
- package/dist/index.js.map +1 -1
- package/dist/login-react.css +1 -1
- package/dist/silentWalletEnroll-CQK5i65l.js +42 -0
- package/dist/silentWalletEnroll-CQK5i65l.js.map +1 -0
- package/dist/silentWalletEnroll-DBfS2sLe.cjs +1 -0
- package/dist/silentWalletEnroll-DBfS2sLe.cjs.map +1 -0
- package/dist/solana-only.js +2 -2
- package/dist/solanaKeypair-BD7Kq1Mw.js +1932 -0
- package/dist/solanaKeypair-BD7Kq1Mw.js.map +1 -0
- package/dist/solanaKeypair-CBQxm2hw.cjs +1 -0
- package/dist/solanaKeypair-CBQxm2hw.cjs.map +1 -0
- package/dist/types/adminUser.d.ts +56 -0
- package/dist/types/deposit.d.ts +2 -0
- package/dist/types/index.d.ts +4 -2
- package/dist/types/org.d.ts +34 -2
- package/dist/types/profile.d.ts +56 -0
- package/dist/types/setup.d.ts +45 -0
- package/dist/types/systemSettings.d.ts +5 -1
- package/dist/utils/adminUserApi.d.ts +10 -1
- package/dist/utils/profileApi.d.ts +26 -0
- package/dist/utils/setupApi.d.ts +21 -0
- package/package.json +1 -1
- package/dist/EmailRegisterForm-D_uCEdX9.cjs +0 -1
- package/dist/EmailRegisterForm-D_uCEdX9.cjs.map +0 -1
- package/dist/EmailRegisterForm-m3rX3A6X.js +0 -2923
- package/dist/EmailRegisterForm-m3rX3A6X.js.map +0 -1
- package/dist/ErrorMessage-Bm1j5mBT.js.map +0 -1
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Settings components barrel export
|
|
3
|
+
*/
|
|
4
|
+
export { SettingsPageLayout } from './SettingsPageLayout';
|
|
5
|
+
export type { SettingsPageLayoutProps } from './SettingsPageLayout';
|
|
6
|
+
export { AutosaveStatus } from './AutosaveStatus';
|
|
7
|
+
export type { AutosaveStatusProps } from './AutosaveStatus';
|
|
8
|
+
export { SettingsSection, SettingRow, DurationInput, PercentageInput, SelectInput, NumberInput, BooleanInput, SecretInput, TokenListInput, TokenSymbolListInput, } from './settingsInputs';
|
|
9
|
+
export type { SettingsSectionProps } from './settingsInputs';
|
|
10
|
+
export { SETTING_METADATA, CATEGORY_METADATA, PRESET_TOKEN_SYMBOLS, formatDuration, secondsToDuration, } from './settingsMetadata';
|
|
11
|
+
export type { DurationParts, CategoryMeta } from './settingsMetadata';
|
|
12
|
+
export { AuthenticationSettings } from './AuthenticationSettings';
|
|
13
|
+
export type { AuthenticationSettingsProps } from './AuthenticationSettings';
|
|
14
|
+
export { SsoProvidersSettings } from './SsoProvidersSettings';
|
|
15
|
+
export type { SsoProvidersSettingsProps } from './SsoProvidersSettings';
|
|
16
|
+
export { EmbeddedWalletSettings } from './EmbeddedWalletSettings';
|
|
17
|
+
export type { EmbeddedWalletSettingsProps } from './EmbeddedWalletSettings';
|
|
18
|
+
export { FeatureSettings } from './FeatureSettings';
|
|
19
|
+
export type { FeatureSettingsProps } from './FeatureSettings';
|
|
20
|
+
export { SecuritySettings } from './SecuritySettings';
|
|
21
|
+
export type { SecuritySettingsProps } from './SecuritySettings';
|
|
22
|
+
export { EmailSettings } from './EmailSettings';
|
|
23
|
+
export type { EmailSettingsProps } from './EmailSettings';
|
|
24
|
+
export { WebhookSettings } from './WebhookSettings';
|
|
25
|
+
export type { WebhookSettingsProps } from './WebhookSettings';
|
|
26
|
+
export { MessagingSettings } from './MessagingSettings';
|
|
27
|
+
export type { MessagingSettingsProps } from './MessagingSettings';
|
|
28
|
+
export { CreditSystemSettings, PrivacyCashSettings } from './CreditSystemSettings';
|
|
29
|
+
export type { CreditSystemSettingsProps, PrivacyCashSettingsProps } from './CreditSystemSettings';
|
|
30
|
+
export { ServerSettings } from './ServerSettings';
|
|
31
|
+
export type { ServerSettingsProps } from './ServerSettings';
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { SystemSetting } from '../../../types';
|
|
2
|
+
export interface SettingsSectionProps {
|
|
3
|
+
settings: SystemSetting[];
|
|
4
|
+
edits: Record<string, string>;
|
|
5
|
+
onChange: (key: string, value: string) => void;
|
|
6
|
+
/** External warnings keyed by setting key */
|
|
7
|
+
externalWarnings?: Record<string, string>;
|
|
8
|
+
}
|
|
9
|
+
export declare function SettingsSection({ settings, edits, onChange, externalWarnings, }: SettingsSectionProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
interface SettingRowProps {
|
|
11
|
+
setting: SystemSetting;
|
|
12
|
+
editValue?: string;
|
|
13
|
+
onChange: (key: string, value: string) => void;
|
|
14
|
+
/** External warning message that overrides threshold-based warnings */
|
|
15
|
+
externalWarning?: string;
|
|
16
|
+
}
|
|
17
|
+
export declare function SettingRow({ setting, editValue, onChange, externalWarning }: SettingRowProps): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
interface DurationInputProps {
|
|
19
|
+
value: string;
|
|
20
|
+
onChange: (value: string) => void;
|
|
21
|
+
presets?: {
|
|
22
|
+
label: string;
|
|
23
|
+
value: string;
|
|
24
|
+
}[];
|
|
25
|
+
min?: number;
|
|
26
|
+
}
|
|
27
|
+
export declare function DurationInput({ value, onChange, presets, min }: DurationInputProps): import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
interface PercentageInputProps {
|
|
29
|
+
value: string;
|
|
30
|
+
onChange: (value: string) => void;
|
|
31
|
+
min: number;
|
|
32
|
+
max: number;
|
|
33
|
+
step: number;
|
|
34
|
+
presets?: {
|
|
35
|
+
label: string;
|
|
36
|
+
value: string;
|
|
37
|
+
}[];
|
|
38
|
+
}
|
|
39
|
+
export declare function PercentageInput({ value, onChange, min, max, step, presets }: PercentageInputProps): import("react/jsx-runtime").JSX.Element;
|
|
40
|
+
interface SelectInputProps {
|
|
41
|
+
value: string;
|
|
42
|
+
onChange: (value: string) => void;
|
|
43
|
+
presets: {
|
|
44
|
+
label: string;
|
|
45
|
+
value: string;
|
|
46
|
+
}[];
|
|
47
|
+
unit?: string;
|
|
48
|
+
}
|
|
49
|
+
export declare function SelectInput({ value, onChange, presets, unit }: SelectInputProps): import("react/jsx-runtime").JSX.Element;
|
|
50
|
+
interface NumberInputProps {
|
|
51
|
+
value: string;
|
|
52
|
+
onChange: (value: string) => void;
|
|
53
|
+
min?: number;
|
|
54
|
+
max?: number;
|
|
55
|
+
unit?: string;
|
|
56
|
+
}
|
|
57
|
+
export declare function NumberInput({ value, onChange, min, max, unit }: NumberInputProps): import("react/jsx-runtime").JSX.Element;
|
|
58
|
+
interface BooleanInputProps {
|
|
59
|
+
value: string;
|
|
60
|
+
onChange: (value: string) => void;
|
|
61
|
+
}
|
|
62
|
+
export declare function BooleanInput({ value, onChange }: BooleanInputProps): import("react/jsx-runtime").JSX.Element;
|
|
63
|
+
interface SecretInputProps {
|
|
64
|
+
value: string;
|
|
65
|
+
onChange: (value: string) => void;
|
|
66
|
+
multiline?: boolean;
|
|
67
|
+
}
|
|
68
|
+
export declare function SecretInput({ value, onChange, multiline }: SecretInputProps): import("react/jsx-runtime").JSX.Element;
|
|
69
|
+
interface TokenListInputProps {
|
|
70
|
+
value: string;
|
|
71
|
+
onChange: (value: string) => void;
|
|
72
|
+
}
|
|
73
|
+
export declare function TokenListInput({ value, onChange }: TokenListInputProps): import("react/jsx-runtime").JSX.Element;
|
|
74
|
+
interface TokenSymbolListInputProps {
|
|
75
|
+
value: string;
|
|
76
|
+
onChange: (value: string) => void;
|
|
77
|
+
}
|
|
78
|
+
export declare function TokenSymbolListInput({ value, onChange }: TokenSymbolListInputProps): import("react/jsx-runtime").JSX.Element;
|
|
79
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { SettingMeta } from '../../../types';
|
|
2
|
+
export interface DurationParts {
|
|
3
|
+
days: number;
|
|
4
|
+
hours: number;
|
|
5
|
+
minutes: number;
|
|
6
|
+
seconds: number;
|
|
7
|
+
}
|
|
8
|
+
export declare function secondsToDuration(totalSeconds: number): DurationParts;
|
|
9
|
+
export declare function formatDuration(totalSeconds: number): string;
|
|
10
|
+
export declare const SETTING_METADATA: Record<string, SettingMeta>;
|
|
11
|
+
export interface CategoryMeta {
|
|
12
|
+
label: string;
|
|
13
|
+
description: string;
|
|
14
|
+
icon: string;
|
|
15
|
+
}
|
|
16
|
+
export declare const CATEGORY_METADATA: Record<string, CategoryMeta>;
|
|
17
|
+
/** Preset tokens that are always available without needing to be redefined */
|
|
18
|
+
export declare const PRESET_TOKEN_SYMBOLS: string[];
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { AdminDepositStatsResponse } from '../../../types/deposit';
|
|
2
|
+
export interface AdminWithdrawalStatsProps {
|
|
3
|
+
/** Auto-refresh interval in milliseconds (0 to disable) */
|
|
4
|
+
refreshInterval?: number;
|
|
5
|
+
/** Additional CSS classes */
|
|
6
|
+
className?: string;
|
|
7
|
+
/** Callback when stats are loaded */
|
|
8
|
+
onLoad?: (stats: AdminDepositStatsResponse) => void;
|
|
9
|
+
}
|
|
10
|
+
export declare function AdminWithdrawalStats({ refreshInterval, className, onLoad, }: AdminWithdrawalStatsProps): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Feature disabled message component
|
|
3
|
+
*
|
|
4
|
+
* Shows a helpful message when Privacy Cash is not enabled on the server.
|
|
5
|
+
*/
|
|
6
|
+
export interface FeatureDisabledMessageProps {
|
|
7
|
+
/** Feature name to display */
|
|
8
|
+
feature?: string;
|
|
9
|
+
/** Additional CSS classes */
|
|
10
|
+
className?: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Message shown when Privacy Cash features are not enabled
|
|
14
|
+
*/
|
|
15
|
+
export declare function FeatureDisabledMessage({ feature, className, }: FeatureDisabledMessageProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Feature disabled error detection utilities
|
|
3
|
+
*
|
|
4
|
+
* Helper functions for detecting if an error indicates a feature is disabled.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Check if an error indicates a feature is disabled (404 or specific message)
|
|
8
|
+
*/
|
|
9
|
+
export declare function isFeatureDisabledError(error: string | null | undefined): boolean;
|
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
*/
|
|
6
6
|
export { AdminDepositStats } from './AdminDepositStats';
|
|
7
7
|
export type { AdminDepositStatsProps } from './AdminDepositStats';
|
|
8
|
+
export { AdminWithdrawalStats } from './AdminWithdrawalStats';
|
|
9
|
+
export type { AdminWithdrawalStatsProps } from './AdminWithdrawalStats';
|
|
8
10
|
export { AdminDepositList } from './AdminDepositList';
|
|
9
11
|
export type { AdminDepositListProps } from './AdminDepositList';
|
|
10
12
|
export { AdminWithdrawalQueue } from './AdminWithdrawalQueue';
|
|
@@ -15,3 +17,6 @@ export { AdminWithdrawalHistory } from './AdminWithdrawalHistory';
|
|
|
15
17
|
export type { AdminWithdrawalHistoryProps } from './AdminWithdrawalHistory';
|
|
16
18
|
export { PrivacySystemStatus } from './PrivacySystemStatus';
|
|
17
19
|
export type { PrivacySystemStatusProps } from './PrivacySystemStatus';
|
|
20
|
+
export { FeatureDisabledMessage } from './FeatureDisabledMessage';
|
|
21
|
+
export type { FeatureDisabledMessageProps } from './FeatureDisabledMessage';
|
|
22
|
+
export { isFeatureDisabledError } from './featureDisabled';
|
|
@@ -7,7 +7,7 @@ export interface InviteFormProps {
|
|
|
7
7
|
isLoading?: boolean;
|
|
8
8
|
/** Error message */
|
|
9
9
|
error?: DisplayError;
|
|
10
|
-
/** Available roles for invite (default: admin, member
|
|
10
|
+
/** Available roles for invite (default: admin, member) */
|
|
11
11
|
availableRoles?: InviteRole[];
|
|
12
12
|
/** Default role for new invites */
|
|
13
13
|
defaultRole?: InviteRole;
|
|
@@ -25,12 +25,13 @@ export interface OrgSelectorProps {
|
|
|
25
25
|
* - Escape: Close dropdown
|
|
26
26
|
* - Enter/Space: Select focused item
|
|
27
27
|
*
|
|
28
|
-
*
|
|
28
|
+
* FUTURE: Consider implementing arrow key navigation for enhanced accessibility:
|
|
29
29
|
* - ArrowUp/ArrowDown: Navigate between items in the list
|
|
30
30
|
* - Home/End: Jump to first/last item
|
|
31
31
|
* - Type-ahead: Focus item starting with typed character
|
|
32
32
|
*
|
|
33
33
|
* See WAI-ARIA Listbox Pattern for reference implementation.
|
|
34
|
+
* Currently the component meets basic accessibility requirements.
|
|
34
35
|
*
|
|
35
36
|
* @example
|
|
36
37
|
* ```tsx
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* User Profile Settings component
|
|
3
|
+
*
|
|
4
|
+
* Allows users to:
|
|
5
|
+
* - View their profile information
|
|
6
|
+
* - Change their password
|
|
7
|
+
* - (Future) Update name and picture when backend supports it
|
|
8
|
+
*/
|
|
9
|
+
export interface UserProfileSettingsProps {
|
|
10
|
+
/** Called when password is changed successfully */
|
|
11
|
+
onPasswordChange?: () => void;
|
|
12
|
+
/** Called when user requests to close/cancel */
|
|
13
|
+
onClose?: () => void;
|
|
14
|
+
/** Additional CSS class */
|
|
15
|
+
className?: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* User profile settings panel.
|
|
19
|
+
*
|
|
20
|
+
* Shows user profile information and provides controls for
|
|
21
|
+
* changing password and managing profile settings.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```tsx
|
|
25
|
+
* function SettingsPage() {
|
|
26
|
+
* return (
|
|
27
|
+
* <UserProfileSettings
|
|
28
|
+
* onPasswordChange={() => console.log('Password changed')}
|
|
29
|
+
* onClose={() => navigate('/dashboard')}
|
|
30
|
+
* />
|
|
31
|
+
* );
|
|
32
|
+
* }
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
export declare function UserProfileSettings({ onPasswordChange, onClose, className, }: UserProfileSettingsProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -9,7 +9,6 @@
|
|
|
9
9
|
* IMPORTANT - String vs Uint8Array:
|
|
10
10
|
* - Uint8Array CAN be wiped (wipeBytes) - use for keys, seeds, passwords
|
|
11
11
|
* - Strings CANNOT be wiped in JavaScript - they are immutable
|
|
12
|
-
* - The wipeString() function returns '' but does NOT clear memory
|
|
13
12
|
* - Always prefer Uint8Array for sensitive cryptographic material
|
|
14
13
|
*
|
|
15
14
|
* Best practices:
|
|
@@ -33,24 +32,6 @@ export declare function wipeBytes(data: Uint8Array): void;
|
|
|
33
32
|
* @param arrays - Arrays to wipe
|
|
34
33
|
*/
|
|
35
34
|
export declare function wipeAll(...arrays: (Uint8Array | undefined | null)[]): void;
|
|
36
|
-
/**
|
|
37
|
-
* Best-effort wipe of a string by replacing with spaces
|
|
38
|
-
*
|
|
39
|
-
* @security CRYPTO-2: JavaScript strings are immutable - this is a BEST-EFFORT
|
|
40
|
-
* operation only. The original string content WILL persist in memory until
|
|
41
|
-
* garbage collected, and may be copied by the JS engine's string interning.
|
|
42
|
-
* There is NO WAY to securely wipe strings in JavaScript.
|
|
43
|
-
*
|
|
44
|
-
* DO NOT rely on this for security-critical wiping. Always prefer Uint8Array
|
|
45
|
-
* for sensitive data (keys, passwords, seeds) which CAN be securely wiped.
|
|
46
|
-
*
|
|
47
|
-
* @deprecated This function provides NO security guarantee. It exists only
|
|
48
|
-
* for API completeness. Use Uint8Array + wipeBytes() for sensitive data.
|
|
49
|
-
*
|
|
50
|
-
* @param _str - String to "wipe" (cannot actually be cleared)
|
|
51
|
-
* @returns Empty string (original cannot be modified)
|
|
52
|
-
*/
|
|
53
|
-
export declare function wipeString(_str: string): string;
|
|
54
35
|
/**
|
|
55
36
|
* Execute a function with automatic cleanup of byte arrays
|
|
56
37
|
*
|
|
@@ -1,14 +1,4 @@
|
|
|
1
1
|
import { PrfSalt } from './types';
|
|
2
|
-
/**
|
|
3
|
-
* SEC-004: Validate the current hostname against allowed RP domains.
|
|
4
|
-
*
|
|
5
|
-
* This prevents WebAuthn credential creation/usage on unexpected domains,
|
|
6
|
-
* which could be used in phishing attacks.
|
|
7
|
-
*
|
|
8
|
-
* @param allowedDomains - List of allowed domain names. Empty means validation is skipped.
|
|
9
|
-
* @throws Error if hostname is not in allowed list (production only)
|
|
10
|
-
*/
|
|
11
|
-
export declare function validateRpDomain(allowedDomains?: string[]): void;
|
|
12
2
|
/** Result of registering a new passkey with PRF */
|
|
13
3
|
export interface PasskeyRegistrationResult {
|
|
14
4
|
/** Base64-encoded credential ID */
|
package/dist/email-only.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./ErrorMessage-CntMyn93.cjs"),r=require("./EmailRegisterForm-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./ErrorMessage-CntMyn93.cjs"),r=require("./EmailRegisterForm-B-ys4E3C.cjs"),o=require("./validation-BeXIfuHB.cjs");exports.CedrosLoginProvider=e.CedrosLoginProvider;exports.ErrorMessage=e.ErrorMessage;exports.LoadingSpinner=e.LoadingSpinner;exports.useAuth=e.useAuth;exports.useCedrosLogin=e.useCedrosLogin;exports.EmailLoginForm=r.EmailLoginForm;exports.EmailRegisterForm=r.EmailRegisterForm;exports.PasswordInput=r.PasswordInput;exports.useEmailAuth=r.useEmailAuth;exports.validatePassword=o.validatePassword;
|
package/dist/email-only.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as r, E as o, L as e, a as i, u as m } from "./ErrorMessage-
|
|
2
|
-
import { E as u, a as d, P as n, u as g } from "./EmailRegisterForm-
|
|
1
|
+
import { C as r, E as o, L as e, a as i, u as m } from "./ErrorMessage-C8vKB0JG.js";
|
|
2
|
+
import { E as u, a as d, P as n, u as g } from "./EmailRegisterForm-BChCiZ5B.js";
|
|
3
3
|
import { v as p } from "./validation-BebL7hMF.js";
|
|
4
4
|
export {
|
|
5
5
|
r as CedrosLoginProvider,
|
package/dist/google-only.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as e, E as r, L as a, a as u, u as g } from "./ErrorMessage-
|
|
2
|
-
import { G as i, u as t } from "./GoogleLoginButton-
|
|
1
|
+
import { C as e, E as r, L as a, a as u, u as g } from "./ErrorMessage-C8vKB0JG.js";
|
|
2
|
+
import { G as i, u as t } from "./GoogleLoginButton-Ceo2sYvX.js";
|
|
3
3
|
export {
|
|
4
4
|
e as CedrosLoginProvider,
|
|
5
5
|
r as ErrorMessage,
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { DashboardSection, DashboardPermissions, AuthError } from '../types';
|
|
2
|
+
export interface UseDashboardPermissionsReturn {
|
|
3
|
+
/** Current dashboard permissions config */
|
|
4
|
+
permissions: DashboardPermissions;
|
|
5
|
+
/** Whether the current user can access a specific section */
|
|
6
|
+
canAccess: (section: DashboardSection) => boolean;
|
|
7
|
+
/** Update permissions (owner only) */
|
|
8
|
+
updatePermissions: (permissions: DashboardPermissions) => Promise<void>;
|
|
9
|
+
/** Loading state */
|
|
10
|
+
isLoading: boolean;
|
|
11
|
+
/** Updating state */
|
|
12
|
+
isUpdating: boolean;
|
|
13
|
+
/** Error state */
|
|
14
|
+
error: AuthError | null;
|
|
15
|
+
/** Refresh permissions from server */
|
|
16
|
+
fetchPermissions: () => Promise<void>;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Hook for managing dashboard permissions per role.
|
|
20
|
+
*
|
|
21
|
+
* Allows org owners to configure which dashboard sections each role can access.
|
|
22
|
+
* - Owner always has full access (not configurable)
|
|
23
|
+
* - Admin and Member roles are configurable
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```tsx
|
|
27
|
+
* function AdminDashboard() {
|
|
28
|
+
* const { canAccess, permissions, updatePermissions } = useDashboardPermissions();
|
|
29
|
+
*
|
|
30
|
+
* // Check if current user can access a section
|
|
31
|
+
* if (!canAccess('deposits')) {
|
|
32
|
+
* return <div>You don't have access to deposits</div>;
|
|
33
|
+
* }
|
|
34
|
+
*
|
|
35
|
+
* // Update permissions (owner only)
|
|
36
|
+
* const toggleMemberDeposits = () => {
|
|
37
|
+
* updatePermissions({
|
|
38
|
+
* ...permissions,
|
|
39
|
+
* member: { ...permissions.member, deposits: !permissions.member.deposits },
|
|
40
|
+
* });
|
|
41
|
+
* };
|
|
42
|
+
* }
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
45
|
+
export declare function useDashboardPermissions(): UseDashboardPermissionsReturn;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { UseProfileReturn } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Hook for managing user profile operations.
|
|
4
|
+
*
|
|
5
|
+
* Provides methods for updating profile information and changing password.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```tsx
|
|
9
|
+
* function ProfileSettings() {
|
|
10
|
+
* const { isLoading, error, changePassword, clearError } = useProfile();
|
|
11
|
+
*
|
|
12
|
+
* const handlePasswordChange = async () => {
|
|
13
|
+
* try {
|
|
14
|
+
* await changePassword({
|
|
15
|
+
* currentPassword: 'oldpass',
|
|
16
|
+
* newPassword: 'newpass123',
|
|
17
|
+
* });
|
|
18
|
+
* // Success - other sessions have been revoked
|
|
19
|
+
* } catch (err) {
|
|
20
|
+
* // Error is available via the error property
|
|
21
|
+
* }
|
|
22
|
+
* };
|
|
23
|
+
*
|
|
24
|
+
* return (
|
|
25
|
+
* <div>
|
|
26
|
+
* {error && <p className="error">{error.message}</p>}
|
|
27
|
+
* <button onClick={handlePasswordChange} disabled={isLoading}>
|
|
28
|
+
* Change Password
|
|
29
|
+
* </button>
|
|
30
|
+
* </div>
|
|
31
|
+
* );
|
|
32
|
+
* }
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
export declare function useProfile(): UseProfileReturn;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Server-side feature flags stored in system settings.
|
|
3
|
+
*
|
|
4
|
+
* These control which features are available in the application.
|
|
5
|
+
* Unlike client-side FeatureFlags (passed to CedrosLoginProvider),
|
|
6
|
+
* these can be toggled at runtime via the admin dashboard.
|
|
7
|
+
*/
|
|
8
|
+
export interface ServerFeatures {
|
|
9
|
+
/** Enable multi-tenant organizations. Controls: Team, Invites sections */
|
|
10
|
+
organizations: boolean;
|
|
11
|
+
/** Enable Enterprise SSO for organizations */
|
|
12
|
+
sso: boolean;
|
|
13
|
+
/** Enable two-factor authentication (TOTP) */
|
|
14
|
+
mfa: boolean;
|
|
15
|
+
/** Enable embedded wallet for transaction signing */
|
|
16
|
+
walletSigning: boolean;
|
|
17
|
+
/** Enable deposits and credits system. Controls: Deposits, Withdrawals, Credit System sections */
|
|
18
|
+
credits: boolean;
|
|
19
|
+
/** Enable Cedros Pay integration. Controls: Products, Transactions, Refunds, etc. */
|
|
20
|
+
cedrosPay: boolean;
|
|
21
|
+
}
|
|
22
|
+
export interface UseServerFeaturesReturn {
|
|
23
|
+
/** Current feature flag states */
|
|
24
|
+
features: ServerFeatures;
|
|
25
|
+
/** Whether settings are still loading */
|
|
26
|
+
isLoading: boolean;
|
|
27
|
+
/** Error if settings failed to load */
|
|
28
|
+
error: Error | null;
|
|
29
|
+
/** Refresh feature flags from server */
|
|
30
|
+
refetch: () => Promise<void>;
|
|
31
|
+
/** Check if a specific feature is enabled */
|
|
32
|
+
isEnabled: (feature: keyof ServerFeatures) => boolean;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Hook for reading server-side feature flags from system settings.
|
|
36
|
+
*
|
|
37
|
+
* Use this to conditionally show/hide features based on admin settings.
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```tsx
|
|
41
|
+
* function AdminDashboard() {
|
|
42
|
+
* const { features, isLoading, isEnabled } = useServerFeatures();
|
|
43
|
+
*
|
|
44
|
+
* if (isLoading) return <LoadingSpinner />;
|
|
45
|
+
*
|
|
46
|
+
* return (
|
|
47
|
+
* <nav>
|
|
48
|
+
* {isEnabled('organizations') && <NavItem>Team</NavItem>}
|
|
49
|
+
* {isEnabled('credits') && <NavItem>Deposits</NavItem>}
|
|
50
|
+
* </nav>
|
|
51
|
+
* );
|
|
52
|
+
* }
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
55
|
+
export declare function useServerFeatures(): UseServerFeaturesReturn;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/** Autosave status */
|
|
2
|
+
export type AutosaveStatus = 'idle' | 'pending' | 'saving' | 'saved' | 'error';
|
|
3
|
+
export interface UseSettingsAutosaveReturn {
|
|
4
|
+
/** Settings grouped by category */
|
|
5
|
+
settings: Record<string, import('../types').SystemSetting[]>;
|
|
6
|
+
/** Current edits (key -> value) */
|
|
7
|
+
edits: Record<string, string>;
|
|
8
|
+
/** Whether initial load is in progress */
|
|
9
|
+
isLoading: boolean;
|
|
10
|
+
/** Current autosave status */
|
|
11
|
+
autosaveStatus: AutosaveStatus;
|
|
12
|
+
/** Error message if autosave failed */
|
|
13
|
+
autosaveError: string | null;
|
|
14
|
+
/** Loading error */
|
|
15
|
+
error: Error | null;
|
|
16
|
+
/** Fetch settings from server */
|
|
17
|
+
fetchSettings: () => Promise<void>;
|
|
18
|
+
/** Handle a setting change (triggers autosave) */
|
|
19
|
+
handleChange: (key: string, value: string) => void;
|
|
20
|
+
/** Get effective value (edit or original) */
|
|
21
|
+
getEffectiveValue: (key: string) => string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Hook for managing system settings with autosave.
|
|
25
|
+
*
|
|
26
|
+
* Automatically saves changes after a debounce period.
|
|
27
|
+
* Provides status feedback for the autosave process.
|
|
28
|
+
*/
|
|
29
|
+
export declare function useSettingsAutosave(): UseSettingsAutosaveReturn;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { UseSetupReturn } from '../types/setup';
|
|
2
|
+
/**
|
|
3
|
+
* Hook for first-run setup operations.
|
|
4
|
+
*
|
|
5
|
+
* Checks if setup is needed (no admin exists) and provides
|
|
6
|
+
* ability to create the first admin user.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```tsx
|
|
10
|
+
* function SetupCheck() {
|
|
11
|
+
* const { status, isLoading, checkStatus, createAdmin } = useSetup();
|
|
12
|
+
*
|
|
13
|
+
* useEffect(() => {
|
|
14
|
+
* checkStatus();
|
|
15
|
+
* }, [checkStatus]);
|
|
16
|
+
*
|
|
17
|
+
* if (isLoading) return <Loading />;
|
|
18
|
+
* if (status?.needsSetup) {
|
|
19
|
+
* return <SetupWizard onCreateAdmin={createAdmin} />;
|
|
20
|
+
* }
|
|
21
|
+
* return <Dashboard />;
|
|
22
|
+
* }
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
export declare function useSetup(): UseSetupReturn;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
export interface SsoProvider {
|
|
2
|
+
id: string;
|
|
3
|
+
orgId: string;
|
|
4
|
+
name: string;
|
|
5
|
+
issuerUrl: string;
|
|
6
|
+
clientId: string;
|
|
7
|
+
scopes: string[];
|
|
8
|
+
enabled: boolean;
|
|
9
|
+
allowRegistration: boolean;
|
|
10
|
+
emailDomain: string | null;
|
|
11
|
+
createdAt: string;
|
|
12
|
+
updatedAt: string;
|
|
13
|
+
}
|
|
14
|
+
export interface CreateSsoProviderInput {
|
|
15
|
+
orgId: string;
|
|
16
|
+
name: string;
|
|
17
|
+
issuerUrl: string;
|
|
18
|
+
clientId: string;
|
|
19
|
+
clientSecret: string;
|
|
20
|
+
scopes?: string[];
|
|
21
|
+
enabled?: boolean;
|
|
22
|
+
allowRegistration?: boolean;
|
|
23
|
+
emailDomain?: string | null;
|
|
24
|
+
}
|
|
25
|
+
export interface UpdateSsoProviderInput {
|
|
26
|
+
name?: string;
|
|
27
|
+
issuerUrl?: string;
|
|
28
|
+
clientId?: string;
|
|
29
|
+
clientSecret?: string;
|
|
30
|
+
scopes?: string[];
|
|
31
|
+
enabled?: boolean;
|
|
32
|
+
allowRegistration?: boolean;
|
|
33
|
+
emailDomain?: string | null;
|
|
34
|
+
}
|
|
35
|
+
interface ListResponse {
|
|
36
|
+
providers: SsoProvider[];
|
|
37
|
+
total: number;
|
|
38
|
+
limit: number;
|
|
39
|
+
offset: number;
|
|
40
|
+
}
|
|
41
|
+
export declare function useSsoProviders(): {
|
|
42
|
+
providers: SsoProvider[];
|
|
43
|
+
total: number;
|
|
44
|
+
isLoading: boolean;
|
|
45
|
+
error: Error | null;
|
|
46
|
+
fetchProviders: (orgId?: string, limit?: number, offset?: number) => Promise<ListResponse>;
|
|
47
|
+
createProvider: (input: CreateSsoProviderInput) => Promise<SsoProvider>;
|
|
48
|
+
updateProvider: (id: string, input: UpdateSsoProviderInput) => Promise<SsoProvider>;
|
|
49
|
+
deleteProvider: (id: string) => Promise<void>;
|
|
50
|
+
toggleProvider: (id: string, enabled: boolean) => Promise<SsoProvider>;
|
|
51
|
+
};
|
|
52
|
+
export {};
|