hazo_auth 9.0.1 → 10.0.0
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 +39 -11
- package/SETUP_CHECKLIST.md +35 -16
- package/cli-src/cli/init_users.ts +40 -48
- package/cli-src/lib/auth/auth_types.ts +0 -2
- package/cli-src/lib/auth/hazo_get_auth.server.ts +31 -25
- package/cli-src/lib/auth/hazo_get_tenant_auth.server.ts +9 -13
- package/cli-src/lib/config/config_loader.server.ts +41 -3
- package/cli-src/lib/config/hazo_auth_core_config.ts +1 -1
- package/cli-src/lib/constants.ts +2 -0
- package/cli-src/lib/hazo_connect_setup.server.ts +20 -2
- package/cli-src/lib/profile_pic_menu_config.server.ts +4 -3
- package/cli-src/lib/schema/sqlite_schema.ts +0 -4
- package/cli-src/lib/scope_hierarchy_config.server.ts +1 -9
- package/cli-src/lib/services/invitation_service.ts +1 -1
- package/cli-src/lib/services/scope_service.ts +2 -76
- package/cli-src/lib/services/user_scope_service.ts +7 -61
- package/config/hazo_auth_config.example.ini +3 -1
- package/dist/cli/init_users.d.ts.map +1 -1
- package/dist/cli/init_users.js +42 -42
- package/dist/client.d.ts +1 -1
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +1 -1
- package/dist/components/layouts/shared/components/profile_pic_menu.d.ts.map +1 -1
- package/dist/components/layouts/shared/components/profile_pic_menu.js +7 -1
- package/dist/components/ui/input-otp.d.ts +2 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/lib/auth/auth_types.d.ts +0 -2
- package/dist/lib/auth/auth_types.d.ts.map +1 -1
- package/dist/lib/auth/hazo_get_auth.server.d.ts.map +1 -1
- package/dist/lib/auth/hazo_get_auth.server.js +27 -19
- package/dist/lib/auth/hazo_get_tenant_auth.server.d.ts.map +1 -1
- package/dist/lib/auth/hazo_get_tenant_auth.server.js +10 -10
- package/dist/lib/config/config_loader.server.d.ts.map +1 -1
- package/dist/lib/config/config_loader.server.js +38 -3
- package/dist/lib/config/hazo_auth_core_config.js +1 -1
- package/dist/lib/constants.d.ts +1 -0
- package/dist/lib/constants.d.ts.map +1 -1
- package/dist/lib/constants.js +1 -0
- package/dist/lib/hazo_connect_setup.server.d.ts +1 -0
- package/dist/lib/hazo_connect_setup.server.d.ts.map +1 -1
- package/dist/lib/hazo_connect_setup.server.js +15 -2
- package/dist/lib/profile_pic_menu_config.server.d.ts +2 -1
- package/dist/lib/profile_pic_menu_config.server.d.ts.map +1 -1
- package/dist/lib/profile_pic_menu_config.server.js +1 -1
- package/dist/lib/schema/sqlite_schema.d.ts +1 -1
- package/dist/lib/schema/sqlite_schema.d.ts.map +1 -1
- package/dist/lib/schema/sqlite_schema.js +0 -4
- package/dist/lib/scope_hierarchy_config.server.d.ts +0 -2
- package/dist/lib/scope_hierarchy_config.server.d.ts.map +1 -1
- package/dist/lib/scope_hierarchy_config.server.js +1 -3
- package/dist/lib/services/invitation_service.d.ts +1 -1
- package/dist/lib/services/invitation_service.js +1 -1
- package/dist/lib/services/scope_service.d.ts +1 -14
- package/dist/lib/services/scope_service.d.ts.map +1 -1
- package/dist/lib/services/scope_service.js +2 -67
- package/dist/lib/services/user_scope_service.d.ts +5 -12
- package/dist/lib/services/user_scope_service.d.ts.map +1 -1
- package/dist/lib/services/user_scope_service.js +8 -45
- package/dist/server/routes/invitations.d.ts +1 -1
- package/dist/server/routes/invitations.d.ts.map +1 -1
- package/dist/server/routes/invitations.js +12 -11
- package/dist/server/routes/user_management_users.d.ts +1 -1
- package/package.json +15 -15
|
@@ -22,6 +22,7 @@ import { read_config_section } from "./config/config_loader.server.js";
|
|
|
22
22
|
function get_hazo_connect_config(): {
|
|
23
23
|
type: "sqlite" | "postgrest";
|
|
24
24
|
sqlitePath?: string;
|
|
25
|
+
sqliteDriver?: "sql.js" | "better-sqlite3";
|
|
25
26
|
enableAdminUi: boolean;
|
|
26
27
|
readOnly?: boolean;
|
|
27
28
|
postgrestUrl?: string;
|
|
@@ -89,9 +90,19 @@ function get_hazo_connect_config(): {
|
|
|
89
90
|
});
|
|
90
91
|
}
|
|
91
92
|
|
|
93
|
+
// SQLite driver: 'sql.js' (default, WAL-unaware WASM) or 'better-sqlite3' (native, WAL-aware).
|
|
94
|
+
// Forwarded to hazo_connect's factory as sqlite.driver. Defaults to undefined so hazo_connect
|
|
95
|
+
// keeps its own default ('sql.js') when unset — no behavior change.
|
|
96
|
+
const sqlite_driver_raw =
|
|
97
|
+
hazo_connect_section?.sqlite_driver || process.env.HAZO_CONNECT_SQLITE_DRIVER;
|
|
98
|
+
const sqliteDriver: "sql.js" | "better-sqlite3" | undefined =
|
|
99
|
+
sqlite_driver_raw === "better-sqlite3" || sqlite_driver_raw === "sql.js"
|
|
100
|
+
? sqlite_driver_raw
|
|
101
|
+
: undefined;
|
|
102
|
+
|
|
92
103
|
// Validate config keys for typos
|
|
93
104
|
if (hazo_connect_section) {
|
|
94
|
-
const known_keys = ["type", "sqlite_path", "enable_admin_ui", "read_only", "postgrest_url"];
|
|
105
|
+
const known_keys = ["type", "sqlite_path", "sqlite_driver", "enable_admin_ui", "read_only", "postgrest_url"];
|
|
95
106
|
for (const key of Object.keys(hazo_connect_section)) {
|
|
96
107
|
if (!known_keys.includes(key)) {
|
|
97
108
|
// Simple similarity check for common typos
|
|
@@ -117,6 +128,7 @@ function get_hazo_connect_config(): {
|
|
|
117
128
|
return {
|
|
118
129
|
type: "sqlite",
|
|
119
130
|
sqlitePath: sqlite_path,
|
|
131
|
+
sqliteDriver,
|
|
120
132
|
enableAdminUi,
|
|
121
133
|
readOnly,
|
|
122
134
|
};
|
|
@@ -169,8 +181,12 @@ export function create_sqlite_hazo_connect_server() {
|
|
|
169
181
|
if (config.type === "sqlite") {
|
|
170
182
|
return createHazoConnect({
|
|
171
183
|
type: "sqlite",
|
|
172
|
-
database: config.sqlitePath!,
|
|
173
184
|
enable_admin_ui: config.enableAdminUi,
|
|
185
|
+
sqlite: {
|
|
186
|
+
database_path: config.sqlitePath!,
|
|
187
|
+
read_only: config.readOnly,
|
|
188
|
+
driver: config.sqliteDriver,
|
|
189
|
+
},
|
|
174
190
|
});
|
|
175
191
|
}
|
|
176
192
|
|
|
@@ -196,6 +212,7 @@ export function create_sqlite_hazo_connect_server() {
|
|
|
196
212
|
export function get_hazo_connect_config_options(): {
|
|
197
213
|
type?: "sqlite" | "postgrest";
|
|
198
214
|
sqlitePath?: string;
|
|
215
|
+
sqliteDriver?: "sql.js" | "better-sqlite3";
|
|
199
216
|
enableAdminUi?: boolean;
|
|
200
217
|
readOnly?: boolean;
|
|
201
218
|
baseUrl?: string;
|
|
@@ -207,6 +224,7 @@ export function get_hazo_connect_config_options(): {
|
|
|
207
224
|
return {
|
|
208
225
|
type: "sqlite",
|
|
209
226
|
sqlitePath: config.sqlitePath,
|
|
227
|
+
sqliteDriver: config.sqliteDriver,
|
|
210
228
|
enableAdminUi: config.enableAdminUi,
|
|
211
229
|
readOnly: config.readOnly,
|
|
212
230
|
};
|
|
@@ -8,13 +8,14 @@ import { get_config_value, get_config_boolean, get_config_array } from "./config
|
|
|
8
8
|
// section: types
|
|
9
9
|
// Note: These types are also used in client components, but TypeScript types are erased at runtime
|
|
10
10
|
// so importing from a server file is safe for type-only imports
|
|
11
|
-
export type MenuItemType = "info" | "link" | "separator";
|
|
11
|
+
export type MenuItemType = "info" | "link" | "separator" | "action";
|
|
12
12
|
|
|
13
13
|
export type ProfilePicMenuMenuItem = {
|
|
14
14
|
type: MenuItemType;
|
|
15
|
-
label?: string; // For info and
|
|
15
|
+
label?: string; // For info, link, and action types
|
|
16
16
|
value?: string; // For info type (e.g., user name, email)
|
|
17
17
|
href?: string; // For link type
|
|
18
|
+
onSelect?: () => void; // For action type (client-side callback, not serialisable via INI config)
|
|
18
19
|
order: number; // Ordering within type group
|
|
19
20
|
id: string; // Unique identifier for the item
|
|
20
21
|
};
|
|
@@ -50,7 +51,7 @@ function parse_custom_menu_items(items_string: string[]): ProfilePicMenuMenuItem
|
|
|
50
51
|
|
|
51
52
|
const type = parts[0] as MenuItemType;
|
|
52
53
|
if (type !== "info" && type !== "link" && type !== "separator") {
|
|
53
|
-
return; // Invalid type,
|
|
54
|
+
return; // Invalid type or action (action items carry callbacks, not expressible in INI)
|
|
54
55
|
}
|
|
55
56
|
|
|
56
57
|
if (type === "separator") {
|
|
@@ -97,10 +97,6 @@ CREATE INDEX IF NOT EXISTS idx_hazo_scopes_parent ON hazo_scopes(parent_id);
|
|
|
97
97
|
CREATE INDEX IF NOT EXISTS idx_hazo_scopes_level ON hazo_scopes(level);
|
|
98
98
|
CREATE INDEX IF NOT EXISTS idx_hazo_scopes_slug ON hazo_scopes(slug);
|
|
99
99
|
|
|
100
|
-
-- Super admin scope
|
|
101
|
-
INSERT OR IGNORE INTO hazo_scopes (id, parent_id, name, level, created_at, changed_at)
|
|
102
|
-
VALUES ('00000000-0000-0000-0000-000000000000', NULL, 'Super Admin', 'system', datetime('now'), datetime('now'));
|
|
103
|
-
|
|
104
100
|
-- Default system scope (for non-multi-tenancy mode)
|
|
105
101
|
INSERT OR IGNORE INTO hazo_scopes (id, parent_id, name, level, created_at, changed_at)
|
|
106
102
|
VALUES ('00000000-0000-0000-0000-000000000001', NULL, 'System', 'default', datetime('now'), datetime('now'));
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
get_config_number,
|
|
9
9
|
get_config_boolean,
|
|
10
10
|
} from "./config/config_loader.server.js";
|
|
11
|
-
import {
|
|
11
|
+
import { DEFAULT_SYSTEM_SCOPE_ID } from "./services/scope_service.js";
|
|
12
12
|
|
|
13
13
|
// section: types
|
|
14
14
|
|
|
@@ -23,8 +23,6 @@ export type ScopeHierarchyConfig = {
|
|
|
23
23
|
scope_cache_ttl_minutes: number;
|
|
24
24
|
/** Maximum entries in scope cache (default: 5000) */
|
|
25
25
|
scope_cache_max_entries: number;
|
|
26
|
-
/** Super admin scope ID */
|
|
27
|
-
super_admin_scope_id: string;
|
|
28
26
|
/** Default system scope ID (for non-multi-tenancy mode) */
|
|
29
27
|
default_system_scope_id: string;
|
|
30
28
|
};
|
|
@@ -57,11 +55,6 @@ export function get_scope_hierarchy_config(): ScopeHierarchyConfig {
|
|
|
57
55
|
);
|
|
58
56
|
|
|
59
57
|
// Scope IDs (with defaults)
|
|
60
|
-
const super_admin_scope_id = get_config_value(
|
|
61
|
-
SECTION_NAME,
|
|
62
|
-
"super_admin_scope_id",
|
|
63
|
-
SUPER_ADMIN_SCOPE_ID,
|
|
64
|
-
);
|
|
65
58
|
const default_system_scope_id = get_config_value(
|
|
66
59
|
SECTION_NAME,
|
|
67
60
|
"default_system_scope_id",
|
|
@@ -72,7 +65,6 @@ export function get_scope_hierarchy_config(): ScopeHierarchyConfig {
|
|
|
72
65
|
enable_hrbac,
|
|
73
66
|
scope_cache_ttl_minutes,
|
|
74
67
|
scope_cache_max_entries,
|
|
75
|
-
super_admin_scope_id,
|
|
76
68
|
default_system_scope_id,
|
|
77
69
|
};
|
|
78
70
|
}
|
|
@@ -7,12 +7,6 @@ import { sanitize_error_for_user } from "../utils/error_sanitizer.js";
|
|
|
7
7
|
|
|
8
8
|
// section: constants
|
|
9
9
|
|
|
10
|
-
/**
|
|
11
|
-
* Super admin scope ID - special UUID for system-level administrators
|
|
12
|
-
* Users assigned to this scope have global access
|
|
13
|
-
*/
|
|
14
|
-
export const SUPER_ADMIN_SCOPE_ID = "00000000-0000-0000-0000-000000000000";
|
|
15
|
-
|
|
16
10
|
/**
|
|
17
11
|
* Default system scope ID - for non-multi-tenancy mode
|
|
18
12
|
* All users are assigned to this scope when multi-tenancy is disabled
|
|
@@ -119,13 +113,6 @@ export function has_branding(scope: ScopeRecord): boolean {
|
|
|
119
113
|
return !!(scope.logo_url || scope.primary_color || scope.secondary_color || scope.tagline);
|
|
120
114
|
}
|
|
121
115
|
|
|
122
|
-
/**
|
|
123
|
-
* Checks if the given scope_id is the super admin scope
|
|
124
|
-
*/
|
|
125
|
-
export function is_super_admin_scope(scope_id: string): boolean {
|
|
126
|
-
return scope_id === SUPER_ADMIN_SCOPE_ID;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
116
|
/**
|
|
130
117
|
* Checks if the given scope_id is the default system scope
|
|
131
118
|
*/
|
|
@@ -134,10 +121,10 @@ export function is_default_system_scope(scope_id: string): boolean {
|
|
|
134
121
|
}
|
|
135
122
|
|
|
136
123
|
/**
|
|
137
|
-
* Checks if the given scope_id is a system scope (
|
|
124
|
+
* Checks if the given scope_id is a system scope (default system)
|
|
138
125
|
*/
|
|
139
126
|
export function is_system_scope(scope_id: string): boolean {
|
|
140
|
-
return
|
|
127
|
+
return is_default_system_scope(scope_id);
|
|
141
128
|
}
|
|
142
129
|
|
|
143
130
|
// section: crud operations
|
|
@@ -781,67 +768,6 @@ export async function get_scope_tree(
|
|
|
781
768
|
}
|
|
782
769
|
}
|
|
783
770
|
|
|
784
|
-
/**
|
|
785
|
-
* Ensures the super admin scope exists
|
|
786
|
-
*/
|
|
787
|
-
export async function ensure_super_admin_scope(
|
|
788
|
-
adapter: HazoConnectAdapter,
|
|
789
|
-
): Promise<ScopeServiceResult> {
|
|
790
|
-
try {
|
|
791
|
-
// Check if already exists
|
|
792
|
-
const existing = await get_scope_by_id(adapter, SUPER_ADMIN_SCOPE_ID);
|
|
793
|
-
if (existing.success && existing.scope) {
|
|
794
|
-
return existing;
|
|
795
|
-
}
|
|
796
|
-
|
|
797
|
-
// Create it
|
|
798
|
-
const scope_service = createCrudService(adapter, "hazo_scopes");
|
|
799
|
-
const now = new Date().toISOString();
|
|
800
|
-
|
|
801
|
-
const inserted = await scope_service.insert({
|
|
802
|
-
id: SUPER_ADMIN_SCOPE_ID,
|
|
803
|
-
name: "Super Admin",
|
|
804
|
-
level: "system",
|
|
805
|
-
parent_id: null,
|
|
806
|
-
logo_url: null,
|
|
807
|
-
primary_color: null,
|
|
808
|
-
secondary_color: null,
|
|
809
|
-
tagline: null,
|
|
810
|
-
created_at: now,
|
|
811
|
-
changed_at: now,
|
|
812
|
-
});
|
|
813
|
-
|
|
814
|
-
if (!Array.isArray(inserted) || inserted.length === 0) {
|
|
815
|
-
return {
|
|
816
|
-
success: false,
|
|
817
|
-
error: "Failed to create super admin scope",
|
|
818
|
-
};
|
|
819
|
-
}
|
|
820
|
-
|
|
821
|
-
return {
|
|
822
|
-
success: true,
|
|
823
|
-
scope: normalize_scope_record(inserted[0] as Record<string, unknown>),
|
|
824
|
-
};
|
|
825
|
-
} catch (error) {
|
|
826
|
-
const logger = create_app_logger();
|
|
827
|
-
const error_message = sanitize_error_for_user(error, {
|
|
828
|
-
logToConsole: true,
|
|
829
|
-
logToLogger: true,
|
|
830
|
-
logger,
|
|
831
|
-
context: {
|
|
832
|
-
filename: "scope_service.ts",
|
|
833
|
-
line_number: 0,
|
|
834
|
-
operation: "ensure_super_admin_scope",
|
|
835
|
-
},
|
|
836
|
-
});
|
|
837
|
-
|
|
838
|
-
return {
|
|
839
|
-
success: false,
|
|
840
|
-
error: error_message,
|
|
841
|
-
};
|
|
842
|
-
}
|
|
843
|
-
}
|
|
844
|
-
|
|
845
771
|
/**
|
|
846
772
|
* Ensures the default system scope exists
|
|
847
773
|
*/
|
|
@@ -8,8 +8,6 @@ import {
|
|
|
8
8
|
get_scope_by_id,
|
|
9
9
|
get_scope_ancestors,
|
|
10
10
|
get_root_scope_id,
|
|
11
|
-
SUPER_ADMIN_SCOPE_ID,
|
|
12
|
-
is_super_admin_scope,
|
|
13
11
|
} from "./scope_service.js";
|
|
14
12
|
|
|
15
13
|
// section: constants
|
|
@@ -48,7 +46,6 @@ export type ScopeAccessCheckResult = {
|
|
|
48
46
|
scope_name?: string;
|
|
49
47
|
};
|
|
50
48
|
user_scopes?: UserScope[];
|
|
51
|
-
is_super_admin?: boolean;
|
|
52
49
|
};
|
|
53
50
|
|
|
54
51
|
export type AssignUserScopeData = {
|
|
@@ -365,27 +362,6 @@ export async function update_user_scopes(
|
|
|
365
362
|
}
|
|
366
363
|
}
|
|
367
364
|
|
|
368
|
-
/**
|
|
369
|
-
* Checks if a user is a super admin (has super admin scope assigned)
|
|
370
|
-
*/
|
|
371
|
-
export async function is_user_super_admin(
|
|
372
|
-
adapter: HazoConnectAdapter,
|
|
373
|
-
user_id: string,
|
|
374
|
-
): Promise<boolean> {
|
|
375
|
-
try {
|
|
376
|
-
const user_scopes_result = await get_user_scopes(adapter, user_id);
|
|
377
|
-
if (!user_scopes_result.success || !user_scopes_result.scopes) {
|
|
378
|
-
return false;
|
|
379
|
-
}
|
|
380
|
-
|
|
381
|
-
return user_scopes_result.scopes.some((scope) =>
|
|
382
|
-
is_super_admin_scope(scope.scope_id),
|
|
383
|
-
);
|
|
384
|
-
} catch {
|
|
385
|
-
return false;
|
|
386
|
-
}
|
|
387
|
-
}
|
|
388
|
-
|
|
389
365
|
/**
|
|
390
366
|
* Checks if a user has any scope assigned
|
|
391
367
|
*/
|
|
@@ -408,9 +384,11 @@ export async function user_has_any_scope(
|
|
|
408
384
|
/**
|
|
409
385
|
* Checks if a user has access to a specific scope
|
|
410
386
|
* Access is granted if:
|
|
411
|
-
* 1. User
|
|
412
|
-
* 2. User has
|
|
413
|
-
*
|
|
387
|
+
* 1. User has the exact scope assigned
|
|
388
|
+
* 2. User has access to an ancestor scope (inherited access)
|
|
389
|
+
*
|
|
390
|
+
* Global admin access (hazo_org_global_admin permission) is handled upstream
|
|
391
|
+
* in hazo_get_auth before this function is called.
|
|
414
392
|
*
|
|
415
393
|
* @param adapter - HazoConnect adapter
|
|
416
394
|
* @param user_id - User ID to check
|
|
@@ -430,24 +408,7 @@ export async function check_user_scope_access(
|
|
|
430
408
|
|
|
431
409
|
const user_scopes = user_scopes_result.scopes;
|
|
432
410
|
|
|
433
|
-
// Check 1:
|
|
434
|
-
const has_super_admin = user_scopes.some((scope) =>
|
|
435
|
-
is_super_admin_scope(scope.scope_id),
|
|
436
|
-
);
|
|
437
|
-
|
|
438
|
-
if (has_super_admin) {
|
|
439
|
-
return {
|
|
440
|
-
has_access: true,
|
|
441
|
-
access_via: {
|
|
442
|
-
scope_id: SUPER_ADMIN_SCOPE_ID,
|
|
443
|
-
scope_name: "Super Admin",
|
|
444
|
-
},
|
|
445
|
-
user_scopes,
|
|
446
|
-
is_super_admin: true,
|
|
447
|
-
};
|
|
448
|
-
}
|
|
449
|
-
|
|
450
|
-
// Check 2: Does user have exact scope assigned?
|
|
411
|
+
// Check 1: Does user have exact scope assigned?
|
|
451
412
|
for (const user_scope of user_scopes) {
|
|
452
413
|
if (user_scope.scope_id === target_scope_id) {
|
|
453
414
|
const scope_result = await get_scope_by_id(adapter, target_scope_id);
|
|
@@ -464,7 +425,7 @@ export async function check_user_scope_access(
|
|
|
464
425
|
}
|
|
465
426
|
}
|
|
466
427
|
|
|
467
|
-
// Check
|
|
428
|
+
// Check 2: Does user have access via an ancestor scope?
|
|
468
429
|
const ancestors_result = await get_scope_ancestors(
|
|
469
430
|
adapter,
|
|
470
431
|
target_scope_id,
|
|
@@ -568,18 +529,3 @@ export async function get_user_direct_scopes(
|
|
|
568
529
|
}
|
|
569
530
|
}
|
|
570
531
|
|
|
571
|
-
/**
|
|
572
|
-
* Assigns super admin scope to a user
|
|
573
|
-
*/
|
|
574
|
-
export async function assign_super_admin_scope(
|
|
575
|
-
adapter: HazoConnectAdapter,
|
|
576
|
-
user_id: string,
|
|
577
|
-
role_id: string,
|
|
578
|
-
): Promise<UserScopeResult> {
|
|
579
|
-
return assign_user_scope(adapter, {
|
|
580
|
-
user_id,
|
|
581
|
-
scope_id: SUPER_ADMIN_SCOPE_ID,
|
|
582
|
-
root_scope_id: SUPER_ADMIN_SCOPE_ID,
|
|
583
|
-
role_id,
|
|
584
|
-
});
|
|
585
|
-
}
|
|
@@ -732,6 +732,8 @@ company_name = My Company
|
|
|
732
732
|
; ── Log level overrides (per hazo_logs D-015) ────────────────────────────────
|
|
733
733
|
; Uncomment to tune log verbosity for specific namespaces.
|
|
734
734
|
; Format: namespace = TRACE | DEBUG | INFO | WARN | ERROR
|
|
735
|
-
[log.overrides]
|
|
735
|
+
; NOTE: use [log_overrides] not [log.overrides] — the ini library parses dots as
|
|
736
|
+
; nesting separators and would create a nested object that hazo_config cannot flatten.
|
|
737
|
+
[log_overrides]
|
|
736
738
|
; hazo_auth = DEBUG
|
|
737
739
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init_users.d.ts","sourceRoot":"","sources":["../../src/cli/init_users.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"init_users.d.ts","sourceRoot":"","sources":["../../src/cli/init_users.ts"],"names":[],"mappings":"AA0FA,MAAM,MAAM,gBAAgB,GAAG;IAC7B,6EAA6E;IAC7E,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAGF;;;;;;GAMG;AACH,wBAAsB,iBAAiB,CAAC,OAAO,GAAE,gBAAqB,GAAG,OAAO,CAAC,IAAI,CAAC,CA0RrF;AAGD;;GAEG;AACH,wBAAgB,oBAAoB,IAAI,IAAI,CAmC3C"}
|
package/dist/cli/init_users.js
CHANGED
|
@@ -5,7 +5,8 @@ import { createCrudService } from "hazo_connect/server";
|
|
|
5
5
|
import { get_user_management_config } from "../lib/user_management_config.server.js";
|
|
6
6
|
import { get_config_value } from "../lib/config/config_loader.server.js";
|
|
7
7
|
import { create_app_logger } from "../lib/app_logger.js";
|
|
8
|
-
import {
|
|
8
|
+
import { DEFAULT_SYSTEM_SCOPE_ID } from "../lib/services/scope_service.js";
|
|
9
|
+
import { GLOBAL_ADMIN_PERMISSION } from "../lib/constants.js";
|
|
9
10
|
// section: helpers
|
|
10
11
|
/**
|
|
11
12
|
* Prints a summary of what was inserted vs what already existed
|
|
@@ -45,22 +46,13 @@ function print_summary(summary) {
|
|
|
45
46
|
}
|
|
46
47
|
console.log();
|
|
47
48
|
// v5.x: User-Role assignments are now handled via User-Scope assignments (see below)
|
|
48
|
-
// Super admin scope summary
|
|
49
|
-
console.log("Super Admin Scope:");
|
|
50
|
-
if (summary.super_admin_scope.inserted) {
|
|
51
|
-
console.log(` ✓ Inserted: Super Admin scope (ID: ${SUPER_ADMIN_SCOPE_ID})`);
|
|
52
|
-
}
|
|
53
|
-
if (summary.super_admin_scope.existing) {
|
|
54
|
-
console.log(` ⊙ Already existed: Super Admin scope (ID: ${SUPER_ADMIN_SCOPE_ID})`);
|
|
55
|
-
}
|
|
56
|
-
console.log();
|
|
57
49
|
// User scope summary
|
|
58
50
|
console.log("User-Scope Assignment:");
|
|
59
51
|
if (summary.user_scope.inserted) {
|
|
60
|
-
console.log(` ✓ Inserted: User assigned to
|
|
52
|
+
console.log(` ✓ Inserted: User assigned to default system scope`);
|
|
61
53
|
}
|
|
62
54
|
if (summary.user_scope.existing) {
|
|
63
|
-
console.log(` ⊙ Already existed: User already in
|
|
55
|
+
console.log(` ⊙ Already existed: User already in default system scope`);
|
|
64
56
|
}
|
|
65
57
|
console.log();
|
|
66
58
|
console.log("=".repeat(60));
|
|
@@ -91,10 +83,6 @@ export async function handle_init_users(options = {}) {
|
|
|
91
83
|
existing: 0,
|
|
92
84
|
},
|
|
93
85
|
// v5.x: Removed user_role - roles are now assigned via hazo_user_scopes
|
|
94
|
-
super_admin_scope: {
|
|
95
|
-
inserted: false,
|
|
96
|
-
existing: false,
|
|
97
|
-
},
|
|
98
86
|
user_scope: {
|
|
99
87
|
inserted: false,
|
|
100
88
|
existing: false,
|
|
@@ -113,7 +101,6 @@ export async function handle_init_users(options = {}) {
|
|
|
113
101
|
});
|
|
114
102
|
const users_service = createCrudService(hazoConnect, "hazo_users");
|
|
115
103
|
// v5.x: Removed hazo_user_roles - roles are now assigned via hazo_user_scopes
|
|
116
|
-
const scopes_service = createCrudService(hazoConnect, "hazo_scopes");
|
|
117
104
|
// hazo_user_scopes uses composite primary key (user_id, scope_id), no 'id' column
|
|
118
105
|
const user_scopes_service = createCrudService(hazoConnect, "hazo_user_scopes", {
|
|
119
106
|
primaryKeys: ["user_id", "scope_id"],
|
|
@@ -247,49 +234,61 @@ export async function handle_init_users(options = {}) {
|
|
|
247
234
|
const user_id = user.id;
|
|
248
235
|
console.log(`✓ Found user: ${super_user_email} (ID: ${user_id})`);
|
|
249
236
|
console.log();
|
|
250
|
-
//
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
await scopes_service.insert({
|
|
259
|
-
id: SUPER_ADMIN_SCOPE_ID,
|
|
260
|
-
parent_id: null,
|
|
261
|
-
name: "Super Admin",
|
|
262
|
-
level: "system",
|
|
237
|
+
// 7. Ensure hazo_org_global_admin is in the permission catalog
|
|
238
|
+
const global_admin_perms = await permissions_service.findBy({
|
|
239
|
+
permission_name: GLOBAL_ADMIN_PERMISSION,
|
|
240
|
+
});
|
|
241
|
+
if (!Array.isArray(global_admin_perms) || global_admin_perms.length === 0) {
|
|
242
|
+
await permissions_service.insert({
|
|
243
|
+
permission_name: GLOBAL_ADMIN_PERMISSION,
|
|
244
|
+
description: "Global admin — access to all scopes and operations",
|
|
263
245
|
created_at: now,
|
|
264
246
|
changed_at: now,
|
|
265
247
|
});
|
|
266
|
-
|
|
267
|
-
|
|
248
|
+
console.log(`✓ Created permission: ${GLOBAL_ADMIN_PERMISSION}`);
|
|
249
|
+
}
|
|
250
|
+
else {
|
|
251
|
+
console.log(`✓ Permission already exists: ${GLOBAL_ADMIN_PERMISSION}`);
|
|
252
|
+
}
|
|
253
|
+
console.log();
|
|
254
|
+
// 9. Ensure hazo_org_global_admin is assigned to the super user role
|
|
255
|
+
// (The role already has all configured permissions; this ensures the global admin perm is included)
|
|
256
|
+
const perm_row = await permissions_service.findBy({ permission_name: GLOBAL_ADMIN_PERMISSION });
|
|
257
|
+
const perm_id = Array.isArray(perm_row) && perm_row.length > 0 ? perm_row[0].id : null;
|
|
258
|
+
if (perm_id && role_id) {
|
|
259
|
+
const existing_rp = await role_permissions_service.findBy({ role_id, permission_id: perm_id });
|
|
260
|
+
if (!Array.isArray(existing_rp) || existing_rp.length === 0) {
|
|
261
|
+
await role_permissions_service.insert({ role_id, permission_id: perm_id });
|
|
262
|
+
console.log(`✓ Assigned ${GLOBAL_ADMIN_PERMISSION} to super user role`);
|
|
263
|
+
}
|
|
264
|
+
else {
|
|
265
|
+
console.log(`✓ Super user role already has ${GLOBAL_ADMIN_PERMISSION}`);
|
|
266
|
+
}
|
|
268
267
|
}
|
|
269
268
|
console.log();
|
|
270
|
-
//
|
|
269
|
+
// 10. Assign user to DEFAULT_SYSTEM_SCOPE_ID (global access comes from the permission, not the scope)
|
|
271
270
|
const existing_user_scopes = await user_scopes_service.findBy({
|
|
272
271
|
user_id,
|
|
273
|
-
scope_id:
|
|
272
|
+
scope_id: DEFAULT_SYSTEM_SCOPE_ID,
|
|
274
273
|
});
|
|
275
274
|
if (Array.isArray(existing_user_scopes) && existing_user_scopes.length > 0) {
|
|
276
275
|
summary.user_scope.existing = true;
|
|
277
|
-
console.log(`✓ User already assigned to
|
|
276
|
+
console.log(`✓ User already assigned to default system scope`);
|
|
278
277
|
}
|
|
279
278
|
else {
|
|
280
279
|
await user_scopes_service.insert({
|
|
281
280
|
user_id,
|
|
282
|
-
scope_id:
|
|
283
|
-
root_scope_id:
|
|
281
|
+
scope_id: DEFAULT_SYSTEM_SCOPE_ID,
|
|
282
|
+
root_scope_id: DEFAULT_SYSTEM_SCOPE_ID,
|
|
284
283
|
role_id,
|
|
285
284
|
created_at: now,
|
|
286
285
|
changed_at: now,
|
|
287
286
|
});
|
|
288
287
|
summary.user_scope.inserted = true;
|
|
289
|
-
console.log(`✓ Assigned user to
|
|
288
|
+
console.log(`✓ Assigned user to default system scope`);
|
|
290
289
|
}
|
|
291
290
|
console.log();
|
|
292
|
-
//
|
|
291
|
+
// 11. Print summary
|
|
293
292
|
print_summary(summary);
|
|
294
293
|
logger.info("init_users_completed", {
|
|
295
294
|
filename: "init_users.ts",
|
|
@@ -323,15 +322,16 @@ export function show_init_users_help() {
|
|
|
323
322
|
console.log(`
|
|
324
323
|
hazo_auth init-users
|
|
325
324
|
|
|
326
|
-
Initialize users, roles,
|
|
325
|
+
Initialize users, roles, and permissions from configuration.
|
|
327
326
|
|
|
328
327
|
This command reads from hazo_auth_config.ini and:
|
|
329
328
|
1. Creates permissions from [hazo_auth__user_management] application_permission_list_defaults
|
|
330
329
|
2. Creates a 'default_super_user_role' role
|
|
331
330
|
3. Assigns all permissions to the super user role
|
|
332
331
|
4. Finds user by email (from --email parameter or config)
|
|
333
|
-
5.
|
|
334
|
-
6. Assigns the user to the
|
|
332
|
+
5. Ensures the '${GLOBAL_ADMIN_PERMISSION}' permission exists and is assigned to the super user role
|
|
333
|
+
6. Assigns the user to the default system scope (${DEFAULT_SYSTEM_SCOPE_ID})
|
|
334
|
+
Global admin access is granted via the '${GLOBAL_ADMIN_PERMISSION}' permission, not by scope
|
|
335
335
|
(v5.x: Roles are assigned per-scope via hazo_user_scopes table)
|
|
336
336
|
|
|
337
337
|
Options:
|
package/dist/client.d.ts
CHANGED
|
@@ -7,6 +7,6 @@ export { use_hazo_auth, trigger_hazo_auth_refresh } from "./components/layouts/s
|
|
|
7
7
|
export type { UseHazoAuthOptions, UseHazoAuthResult } from "./components/layouts/shared/hooks/use_hazo_auth";
|
|
8
8
|
export { use_firm_branding, use_current_user_branding } from "./components/layouts/shared/hooks/use_firm_branding.js";
|
|
9
9
|
export type { FirmBranding, UseFirmBrandingOptions, UseFirmBrandingResult } from "./components/layouts/shared/hooks/use_firm_branding";
|
|
10
|
-
export { HAZO_AUTH_PERMISSIONS, ALL_ADMIN_PERMISSIONS } from "./lib/constants.js";
|
|
10
|
+
export { HAZO_AUTH_PERMISSIONS, ALL_ADMIN_PERMISSIONS, GLOBAL_ADMIN_PERMISSION } from "./lib/constants.js";
|
|
11
11
|
export * from "./components/layouts/shared/utils/validation.js";
|
|
12
12
|
//# sourceMappingURL=client.d.ts.map
|
package/dist/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAYA,cAAc,oBAAoB,CAAC;AAInC,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AAInI,OAAO,EAAE,EAAE,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAIpD,cAAc,uBAAuB,CAAC;AAItC,OAAO,EAAE,eAAe,EAAE,2BAA2B,EAAE,MAAM,mDAAmD,CAAC;AACjH,OAAO,EAAE,aAAa,EAAE,yBAAyB,EAAE,MAAM,iDAAiD,CAAC;AAC3G,YAAY,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,iDAAiD,CAAC;AAC7G,OAAO,EAAE,iBAAiB,EAAE,yBAAyB,EAAE,MAAM,qDAAqD,CAAC;AACnH,YAAY,EAAE,YAAY,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,qDAAqD,CAAC;AAGvI,OAAO,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAYA,cAAc,oBAAoB,CAAC;AAInC,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AAInI,OAAO,EAAE,EAAE,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAIpD,cAAc,uBAAuB,CAAC;AAItC,OAAO,EAAE,eAAe,EAAE,2BAA2B,EAAE,MAAM,mDAAmD,CAAC;AACjH,OAAO,EAAE,aAAa,EAAE,yBAAyB,EAAE,MAAM,iDAAiD,CAAC;AAC3G,YAAY,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,iDAAiD,CAAC;AAC7G,OAAO,EAAE,iBAAiB,EAAE,yBAAyB,EAAE,MAAM,qDAAqD,CAAC;AACnH,YAAY,EAAE,YAAY,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,qDAAqD,CAAC;AAGvI,OAAO,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAIxG,cAAc,8CAA8C,CAAC"}
|
package/dist/client.js
CHANGED
|
@@ -25,7 +25,7 @@ export { use_auth_status, trigger_auth_status_refresh } from "./components/layou
|
|
|
25
25
|
export { use_hazo_auth, trigger_hazo_auth_refresh } from "./components/layouts/shared/hooks/use_hazo_auth.js";
|
|
26
26
|
export { use_firm_branding, use_current_user_branding } from "./components/layouts/shared/hooks/use_firm_branding.js";
|
|
27
27
|
// section: constant_exports
|
|
28
|
-
export { HAZO_AUTH_PERMISSIONS, ALL_ADMIN_PERMISSIONS } from "./lib/constants.js";
|
|
28
|
+
export { HAZO_AUTH_PERMISSIONS, ALL_ADMIN_PERMISSIONS, GLOBAL_ADMIN_PERMISSION } from "./lib/constants.js";
|
|
29
29
|
// section: validation_exports
|
|
30
30
|
// Client-side validation utilities
|
|
31
31
|
export * from "./components/layouts/shared/utils/validation.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profile_pic_menu.d.ts","sourceRoot":"","sources":["../../../../../src/components/layouts/shared/components/profile_pic_menu.tsx"],"names":[],"mappings":"AAqCA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,gDAAgD,CAAC;AAI7F,MAAM,MAAM,mBAAmB,GAAG;IAChC,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;;;;;OAOG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iBAAiB,CAAC,EAAE,sBAAsB,EAAE,CAAC;IAC7C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,SAAS,GAAG,IAAI,GAAG,IAAI,CAAC;IACtC,OAAO,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;IACjC,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B,CAAC;AAGF;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,EAC7B,kBAA0B,EAC1B,aAAyB,EACzB,aAAyB,EACzB,aAAqC,EACrC,UAA+B,EAC/B,aAAwC,EACxC,WAAW,EACX,iBAAsB,EACtB,SAAS,EACT,WAAuB,EACvB,OAAoB,EACpB,mBAA+B,GAChC,EAAE,mBAAmB,
|
|
1
|
+
{"version":3,"file":"profile_pic_menu.d.ts","sourceRoot":"","sources":["../../../../../src/components/layouts/shared/components/profile_pic_menu.tsx"],"names":[],"mappings":"AAqCA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,gDAAgD,CAAC;AAI7F,MAAM,MAAM,mBAAmB,GAAG;IAChC,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;;;;;OAOG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iBAAiB,CAAC,EAAE,sBAAsB,EAAE,CAAC;IAC7C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,SAAS,GAAG,IAAI,GAAG,IAAI,CAAC;IACtC,OAAO,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;IACjC,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B,CAAC;AAGF;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,EAC7B,kBAA0B,EAC1B,aAAyB,EACzB,aAAyB,EACzB,aAAqC,EACrC,UAA+B,EAC/B,aAAwC,EACxC,WAAW,EACX,iBAAsB,EACtB,SAAS,EACT,WAAuB,EACvB,OAAoB,EACpB,mBAA+B,GAChC,EAAE,mBAAmB,2CA8gBrB"}
|
|
@@ -141,7 +141,7 @@ export function ProfilePicMenu({ show_single_button = false, sign_up_label = "Si
|
|
|
141
141
|
// Order: info items first, then separators, then links
|
|
142
142
|
items.sort((a, b) => {
|
|
143
143
|
// Define type priority: info = 0, separator = 1, link = 2
|
|
144
|
-
const typePriority = { info: 0, separator: 1, link: 2 };
|
|
144
|
+
const typePriority = { info: 0, separator: 1, link: 2, action: 2 };
|
|
145
145
|
const aPriority = typePriority[a.type];
|
|
146
146
|
const bPriority = typePriority[b.type];
|
|
147
147
|
if (aPriority !== bPriority) {
|
|
@@ -195,6 +195,9 @@ export function ProfilePicMenu({ show_single_button = false, sign_up_label = "Si
|
|
|
195
195
|
// Generic link handling
|
|
196
196
|
return (_jsx(DropdownMenuItem, { asChild: true, className: "cls_profile_pic_menu_link cursor-pointer", children: _jsx(Link, { href: item.href || "#", children: item.label }) }, item.id));
|
|
197
197
|
}
|
|
198
|
+
if (item.type === "action") {
|
|
199
|
+
return (_jsx(DropdownMenuItem, { onClick: item.onSelect, className: "cls_profile_pic_menu_action cursor-pointer", children: item.label }, item.id));
|
|
200
|
+
}
|
|
198
201
|
return null;
|
|
199
202
|
}), shiftKeyHeld && (_jsxs(_Fragment, { children: [_jsx(DropdownMenuSeparator, { className: "cls_profile_pic_menu_separator" }), _jsxs(DropdownMenuItem, { onClick: () => setShowPermissionsDialog(true), className: "cls_profile_pic_menu_permissions cursor-pointer", children: [_jsx(Shield, { className: "mr-2 h-4 w-4" }), "My Permissions"] })] }))] })] }), _jsx(Dialog, { open: showPermissionsDialog, onOpenChange: setShowPermissionsDialog, children: _jsxs(DialogContent, { className: "cls_profile_pic_menu_permissions_dialog max-w-2xl max-h-[80vh] flex flex-col", children: [_jsxs(DialogHeader, { children: [_jsx(DialogTitle, { children: "My Permissions" }), _jsx(DialogDescription, { children: "Your assigned roles and their permissions" })] }), _jsx("div", { className: "flex-1 overflow-y-auto", children: _jsx(RolesMatrix, { user_id: authStatus.user_id, add_button_enabled: false, role_name_selection_enabled: false, permissions_read_only: true, show_save_cancel: false }) })] }) })] }) })] }));
|
|
200
203
|
}
|
|
@@ -219,6 +222,9 @@ export function ProfilePicMenu({ show_single_button = false, sign_up_label = "Si
|
|
|
219
222
|
// Generic link handling
|
|
220
223
|
return (_jsx(DropdownMenuItem, { asChild: true, className: "cls_profile_pic_menu_link cursor-pointer", children: _jsx(Link, { href: item.href || "#", children: item.label }) }, item.id));
|
|
221
224
|
}
|
|
225
|
+
if (item.type === "action") {
|
|
226
|
+
return (_jsx(DropdownMenuItem, { onClick: item.onSelect, className: "cls_profile_pic_menu_action cursor-pointer", children: item.label }, item.id));
|
|
227
|
+
}
|
|
222
228
|
return null;
|
|
223
229
|
}), shiftKeyHeld && (_jsxs(_Fragment, { children: [_jsx(DropdownMenuSeparator, { className: "cls_profile_pic_menu_separator" }), _jsxs(DropdownMenuItem, { onClick: () => setShowPermissionsDialog(true), className: "cls_profile_pic_menu_permissions cursor-pointer", children: [_jsx(Shield, { className: "mr-2 h-4 w-4" }), "My Permissions"] })] }))] })] }), _jsx(Dialog, { open: showPermissionsDialog, onOpenChange: setShowPermissionsDialog, children: _jsxs(DialogContent, { className: "cls_profile_pic_menu_permissions_dialog max-w-2xl max-h-[80vh] flex flex-col", children: [_jsxs(DialogHeader, { children: [_jsx(DialogTitle, { children: "My Permissions" }), _jsx(DialogDescription, { children: "Your assigned roles and their permissions" })] }), _jsx("div", { className: "flex-1 overflow-y-auto", children: _jsx(RolesMatrix, { user_id: authStatus.user_id, add_button_enabled: false, role_name_selection_enabled: false, permissions_read_only: true, show_save_cancel: false }) })] }) })] }));
|
|
224
230
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
declare const InputOTP: React.ForwardRefExoticComponent<(Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "
|
|
2
|
+
declare const InputOTP: React.ForwardRefExoticComponent<(Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "onChange" | "value" | "maxLength" | "textAlign" | "onComplete" | "pushPasswordManagerStrategy" | "pasteTransformer" | "containerClassName" | "noScriptCSSFallback"> & {
|
|
3
3
|
value?: string;
|
|
4
4
|
onChange?: (newValue: string) => unknown;
|
|
5
5
|
maxLength: number;
|
|
@@ -12,7 +12,7 @@ declare const InputOTP: React.ForwardRefExoticComponent<(Omit<Omit<React.InputHT
|
|
|
12
12
|
} & {
|
|
13
13
|
render: (props: import("input-otp").RenderProps) => React.ReactNode;
|
|
14
14
|
children?: never;
|
|
15
|
-
} & React.RefAttributes<HTMLInputElement>, "ref"> | Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "
|
|
15
|
+
} & React.RefAttributes<HTMLInputElement>, "ref"> | Omit<Omit<React.InputHTMLAttributes<HTMLInputElement>, "onChange" | "value" | "maxLength" | "textAlign" | "onComplete" | "pushPasswordManagerStrategy" | "pasteTransformer" | "containerClassName" | "noScriptCSSFallback"> & {
|
|
16
16
|
value?: string;
|
|
17
17
|
onChange?: (newValue: string) => unknown;
|
|
18
18
|
maxLength: number;
|
package/dist/index.d.ts
CHANGED
|
@@ -5,5 +5,5 @@ export type { HazoAuthUser, HazoAuthResult, HazoAuthError, HazoAuthOptions, Scop
|
|
|
5
5
|
export { AuthenticationRequiredError, TenantRequiredError, TenantAccessDeniedError, } from "./lib/auth/auth_types.js";
|
|
6
6
|
export type { LegalDoc, LegalAcceptanceRecord, LegalAcceptanceMap } from './lib/legal/legal_docs_types';
|
|
7
7
|
export { cn, merge_class_names } from "./lib/utils.js";
|
|
8
|
-
export { HAZO_AUTH_PERMISSIONS, ALL_ADMIN_PERMISSIONS } from "./lib/constants.js";
|
|
8
|
+
export { HAZO_AUTH_PERMISSIONS, ALL_ADMIN_PERMISSIONS, GLOBAL_ADMIN_PERMISSION } from "./lib/constants.js";
|
|
9
9
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAQA,cAAc,+BAA+B,CAAC;AAC9C,cAAc,6BAA6B,CAAC;AAG5C,cAAc,oBAAoB,CAAC;AAGnC,YAAY,EACV,YAAY,EACZ,cAAc,EACd,aAAa,EACb,eAAe,EACf,YAAY,EACZ,kBAAkB,EAClB,iBAAiB,EACjB,gBAAgB,EAChB,wBAAwB,GACzB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,2BAA2B,EAC3B,mBAAmB,EACnB,uBAAuB,GACxB,MAAM,uBAAuB,CAAC;AAG/B,YAAY,EAAE,QAAQ,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAGxG,OAAO,EAAE,EAAE,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAGpD,OAAO,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAQA,cAAc,+BAA+B,CAAC;AAC9C,cAAc,6BAA6B,CAAC;AAG5C,cAAc,oBAAoB,CAAC;AAGnC,YAAY,EACV,YAAY,EACZ,cAAc,EACd,aAAa,EACb,eAAe,EACf,YAAY,EACZ,kBAAkB,EAClB,iBAAiB,EACjB,gBAAgB,EAChB,wBAAwB,GACzB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,2BAA2B,EAC3B,mBAAmB,EACnB,uBAAuB,GACxB,MAAM,uBAAuB,CAAC;AAG/B,YAAY,EAAE,QAAQ,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAGxG,OAAO,EAAE,EAAE,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAGpD,OAAO,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -13,4 +13,4 @@ export { AuthenticationRequiredError, TenantRequiredError, TenantAccessDeniedErr
|
|
|
13
13
|
// section: utility_exports (client-safe)
|
|
14
14
|
export { cn, merge_class_names } from "./lib/utils.js";
|
|
15
15
|
// section: constant_exports
|
|
16
|
-
export { HAZO_AUTH_PERMISSIONS, ALL_ADMIN_PERMISSIONS } from "./lib/constants.js";
|
|
16
|
+
export { HAZO_AUTH_PERMISSIONS, ALL_ADMIN_PERMISSIONS, GLOBAL_ADMIN_PERMISSION } from "./lib/constants.js";
|