hazo_auth 5.2.0 → 5.3.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/SETUP_CHECKLIST.md +46 -0
- package/cli-src/lib/services/email_service.ts +136 -289
- package/cli-src/lib/services/email_template_manifest.ts +104 -0
- package/cli-src/lib/services/email_templates/email_verification.html +18 -0
- package/cli-src/lib/services/email_templates/email_verification.txt +9 -0
- package/cli-src/lib/services/email_templates/forgot_password.html +18 -0
- package/cli-src/lib/services/email_templates/forgot_password.txt +9 -0
- package/cli-src/lib/services/email_templates/password_changed.html +14 -0
- package/cli-src/lib/services/email_templates/password_changed.txt +9 -0
- package/dist/components/ui/button.d.ts +2 -2
- package/dist/lib/services/email_service.d.ts +17 -4
- package/dist/lib/services/email_service.d.ts.map +1 -1
- package/dist/lib/services/email_service.js +93 -221
- package/dist/lib/services/email_template_manifest.d.ts +11 -0
- package/dist/lib/services/email_template_manifest.d.ts.map +1 -0
- package/dist/lib/services/email_template_manifest.js +95 -0
- package/dist/lib/services/email_templates/email_verification.html +18 -0
- package/dist/lib/services/email_templates/email_verification.txt +9 -0
- package/dist/lib/services/email_templates/forgot_password.html +18 -0
- package/dist/lib/services/email_templates/forgot_password.txt +9 -0
- package/dist/lib/services/email_templates/password_changed.html +14 -0
- package/dist/lib/services/email_templates/password_changed.txt +9 -0
- package/dist/server-lib.d.ts +1 -0
- package/dist/server-lib.d.ts.map +1 -1
- package/dist/server-lib.js +1 -0
- package/package.json +4 -3
- package/cli-src/assets/images/new_firm_default.jpg +0 -0
- package/cli-src/lib/auth/org_cache.ts +0 -148
- package/cli-src/lib/index.ts +0 -48
- package/cli-src/lib/services/org_service.ts +0 -965
- package/cli-src/lib/services/scope_labels_service.ts +0 -348
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
// file_description: manifest of system email templates shipped by hazo_auth
|
|
2
|
+
// section: server_only_guard
|
|
3
|
+
import "server-only";
|
|
4
|
+
// section: imports
|
|
5
|
+
import fs from "fs";
|
|
6
|
+
import path from "path";
|
|
7
|
+
import { fileURLToPath } from "url";
|
|
8
|
+
// section: constants
|
|
9
|
+
const TEMPLATE_DIR = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "email_templates");
|
|
10
|
+
const SYSTEM_CATEGORY = "Auth";
|
|
11
|
+
// section: helpers
|
|
12
|
+
function read_template(template_name, extension) {
|
|
13
|
+
const file_path = path.join(TEMPLATE_DIR, `${template_name}.${extension}`);
|
|
14
|
+
return fs.readFileSync(file_path, "utf-8");
|
|
15
|
+
}
|
|
16
|
+
// section: manifest
|
|
17
|
+
/**
|
|
18
|
+
* System email templates shipped by hazo_auth.
|
|
19
|
+
*
|
|
20
|
+
* Consumers feed this into `init_template_manager({ manifests: [...hazo_auth_template_manifest] })`
|
|
21
|
+
* at boot. hazo_notify seeds/syncs the templates into its scope-aware database.
|
|
22
|
+
* Per-scope overrides are managed through the hazo_notify admin UI.
|
|
23
|
+
*/
|
|
24
|
+
export const hazo_auth_template_manifest = [
|
|
25
|
+
{
|
|
26
|
+
template_name: "email_verification",
|
|
27
|
+
template_label: "Email verification",
|
|
28
|
+
category: SYSTEM_CATEGORY,
|
|
29
|
+
html: read_template("email_verification", "html"),
|
|
30
|
+
text: read_template("email_verification", "txt"),
|
|
31
|
+
variables: [
|
|
32
|
+
{
|
|
33
|
+
variable_name: "user_name",
|
|
34
|
+
variable_description: "Recipient display name",
|
|
35
|
+
default_value: "",
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
variable_name: "user_email",
|
|
39
|
+
variable_description: "Recipient email",
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
variable_name: "verification_url",
|
|
43
|
+
variable_description: "Verification link with embedded token",
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
variable_name: "token",
|
|
47
|
+
variable_description: "Raw verification token",
|
|
48
|
+
},
|
|
49
|
+
],
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
template_name: "forgot_password",
|
|
53
|
+
template_label: "Forgot password",
|
|
54
|
+
category: SYSTEM_CATEGORY,
|
|
55
|
+
html: read_template("forgot_password", "html"),
|
|
56
|
+
text: read_template("forgot_password", "txt"),
|
|
57
|
+
variables: [
|
|
58
|
+
{
|
|
59
|
+
variable_name: "user_name",
|
|
60
|
+
variable_description: "Recipient display name",
|
|
61
|
+
default_value: "",
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
variable_name: "user_email",
|
|
65
|
+
variable_description: "Recipient email",
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
variable_name: "reset_url",
|
|
69
|
+
variable_description: "Password reset link",
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
variable_name: "token",
|
|
73
|
+
variable_description: "Raw reset token",
|
|
74
|
+
},
|
|
75
|
+
],
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
template_name: "password_changed",
|
|
79
|
+
template_label: "Password changed",
|
|
80
|
+
category: SYSTEM_CATEGORY,
|
|
81
|
+
html: read_template("password_changed", "html"),
|
|
82
|
+
text: read_template("password_changed", "txt"),
|
|
83
|
+
variables: [
|
|
84
|
+
{
|
|
85
|
+
variable_name: "user_name",
|
|
86
|
+
variable_description: "Recipient display name",
|
|
87
|
+
default_value: "",
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
variable_name: "user_email",
|
|
91
|
+
variable_description: "Recipient email",
|
|
92
|
+
},
|
|
93
|
+
],
|
|
94
|
+
},
|
|
95
|
+
];
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<title>Verify Your Email</title>
|
|
6
|
+
</head>
|
|
7
|
+
<body style="font-family: Arial, sans-serif; line-height: 1.6; color: #333; max-width: 600px; margin: 0 auto; padding: 20px;">
|
|
8
|
+
<h1 style="color: #0f172a;">Verify Your Email Address</h1>
|
|
9
|
+
<p>Thank you for registering! Please click the link below to verify your email address:</p>
|
|
10
|
+
<p style="margin: 20px 0;">
|
|
11
|
+
<a href="{{verification_url}}" style="display: inline-block; padding: 12px 24px; background-color: #0f172a; color: #ffffff; text-decoration: none; border-radius: 4px;">Verify Email Address</a>
|
|
12
|
+
</p>
|
|
13
|
+
<p>Or copy and paste this link into your browser:</p>
|
|
14
|
+
<p style="word-break: break-all; color: #666;">{{verification_url}}</p>
|
|
15
|
+
<p>This link will expire in 48 hours.</p>
|
|
16
|
+
<p style="margin-top: 30px; color: #666; font-size: 12px;">If you didn't create an account, you can safely ignore this email.</p>
|
|
17
|
+
</body>
|
|
18
|
+
</html>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<title>Reset Your Password</title>
|
|
6
|
+
</head>
|
|
7
|
+
<body style="font-family: Arial, sans-serif; line-height: 1.6; color: #333; max-width: 600px; margin: 0 auto; padding: 20px;">
|
|
8
|
+
<h1 style="color: #0f172a;">Reset Your Password</h1>
|
|
9
|
+
<p>We received a request to reset your password. Click the link below to reset it:</p>
|
|
10
|
+
<p style="margin: 20px 0;">
|
|
11
|
+
<a href="{{reset_url}}" style="display: inline-block; padding: 12px 24px; background-color: #0f172a; color: #ffffff; text-decoration: none; border-radius: 4px;">Reset Password</a>
|
|
12
|
+
</p>
|
|
13
|
+
<p>Or copy and paste this link into your browser:</p>
|
|
14
|
+
<p style="word-break: break-all; color: #666;">{{reset_url}}</p>
|
|
15
|
+
<p>This link will expire in 10 minutes.</p>
|
|
16
|
+
<p style="margin-top: 30px; color: #666; font-size: 12px;">If you didn't request a password reset, you can safely ignore this email.</p>
|
|
17
|
+
</body>
|
|
18
|
+
</html>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<title>Password Changed</title>
|
|
6
|
+
</head>
|
|
7
|
+
<body style="font-family: Arial, sans-serif; line-height: 1.6; color: #333; max-width: 600px; margin: 0 auto; padding: 20px;">
|
|
8
|
+
<h1 style="color: #0f172a;">Password Changed Successfully</h1>
|
|
9
|
+
<p>Hello {{user_name}},</p>
|
|
10
|
+
<p>This email confirms that your password has been changed successfully.</p>
|
|
11
|
+
<p>If you did not make this change, please contact support immediately to secure your account.</p>
|
|
12
|
+
<p style="margin-top: 30px; color: #666; font-size: 12px;">This is an automated notification. Please do not reply to this email.</p>
|
|
13
|
+
</body>
|
|
14
|
+
</html>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
Password Changed Successfully
|
|
2
|
+
|
|
3
|
+
Hello {{user_name}},
|
|
4
|
+
|
|
5
|
+
This email confirms that your password has been changed successfully.
|
|
6
|
+
|
|
7
|
+
If you did not make this change, please contact support immediately to secure your account.
|
|
8
|
+
|
|
9
|
+
This is an automated notification. Please do not reply to this email.
|
package/dist/server-lib.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import "server-only";
|
|
2
2
|
export * from "./lib/auth/index.js";
|
|
3
3
|
export * from "./lib/services/index.js";
|
|
4
|
+
export { hazo_auth_template_manifest } from "./lib/services/email_template_manifest.js";
|
|
4
5
|
export { get_config_value, get_config_number, get_config_boolean, get_config_array, read_config_section, } from "./lib/config/config_loader.server.js";
|
|
5
6
|
export { get_login_config } from "./lib/login_config.server.js";
|
|
6
7
|
export { get_register_config } from "./lib/register_config.server.js";
|
package/dist/server-lib.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server-lib.d.ts","sourceRoot":"","sources":["../src/server-lib.ts"],"names":[],"mappings":"AAYA,OAAO,aAAa,CAAC;AAGrB,cAAc,kBAAkB,CAAC;AAGjC,cAAc,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"server-lib.d.ts","sourceRoot":"","sources":["../src/server-lib.ts"],"names":[],"mappings":"AAYA,OAAO,aAAa,CAAC;AAGrB,cAAc,kBAAkB,CAAC;AAGjC,cAAc,sBAAsB,CAAC;AACrC,OAAO,EAAE,2BAA2B,EAAE,MAAM,wCAAwC,CAAC;AAGrF,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,kBAAkB,EAClB,gBAAgB,EAChB,mBAAmB,GACpB,MAAM,mCAAmC,CAAC;AAG3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EAAE,0BAA0B,EAAE,MAAM,qCAAqC,CAAC;AACjF,OAAO,EAAE,yBAAyB,EAAE,MAAM,oCAAoC,CAAC;AAC/E,OAAO,EAAE,6BAA6B,EAAE,MAAM,wCAAwC,CAAC;AACvF,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AACzE,OAAO,EAAE,0BAA0B,EAAE,MAAM,qCAAqC,CAAC;AACjF,OAAO,EAAE,0BAA0B,EAAE,MAAM,qCAAqC,CAAC;AACjF,OAAO,EAAE,2BAA2B,EAAE,MAAM,sCAAsC,CAAC;AACnF,OAAO,EAAE,4BAA4B,EAAE,MAAM,uCAAuC,CAAC;AACrF,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAC3E,OAAO,EAAE,gCAAgC,EAAE,MAAM,2CAA2C,CAAC;AAC7F,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AACzE,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AACvE,OAAO,EACL,gBAAgB,EAChB,uBAAuB,EACvB,yBAAyB,GAC1B,MAAM,2BAA2B,CAAC;AACnC,YAAY,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,sBAAsB,EACtB,uBAAuB,GACxB,MAAM,8BAA8B,CAAC;AACtC,YAAY,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAGvE,OAAO,EAAE,0BAA0B,EAAE,MAAM,0BAA0B,CAAC;AACtE,OAAO,EAAE,yBAAyB,EAAE,MAAM,oCAAoC,CAAC;AAG/E,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAGrD,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AACtE,YAAY,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AAC5E,cAAc,+BAA+B,CAAC"}
|
package/dist/server-lib.js
CHANGED
|
@@ -14,6 +14,7 @@ import "server-only";
|
|
|
14
14
|
export * from "./lib/auth/index.js";
|
|
15
15
|
// section: service_exports
|
|
16
16
|
export * from "./lib/services/index.js";
|
|
17
|
+
export { hazo_auth_template_manifest } from "./lib/services/email_template_manifest.js";
|
|
17
18
|
// section: config_exports
|
|
18
19
|
export { get_config_value, get_config_number, get_config_boolean, get_config_array, read_config_section, } from "./lib/config/config_loader.server.js";
|
|
19
20
|
// section: config_server_exports
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hazo_auth",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.3.0",
|
|
4
4
|
"description": "Zero-config authentication UI components for Next.js with RBAC, OAuth, scope-based multi-tenancy, and invitations",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"authentication",
|
|
@@ -193,6 +193,7 @@
|
|
|
193
193
|
"dev": "next dev",
|
|
194
194
|
"build": "next build",
|
|
195
195
|
"build:pkg": "tsc --jsx react-jsx --skipLibCheck -p tsconfig.build.json && tsx scripts/copy_assets.ts",
|
|
196
|
+
"prepare": "npm run build:pkg",
|
|
196
197
|
"prepublishOnly": "npm run build:pkg",
|
|
197
198
|
"validate": "tsx scripts/validate_setup.ts",
|
|
198
199
|
"generate-routes": "tsx scripts/generate_routes.ts",
|
|
@@ -251,7 +252,7 @@
|
|
|
251
252
|
"hazo_config": "^2.1.0",
|
|
252
253
|
"hazo_connect": "^2.4.0",
|
|
253
254
|
"hazo_logs": "^1.0.13",
|
|
254
|
-
"hazo_notify": "^
|
|
255
|
+
"hazo_notify": "^3.0.0",
|
|
255
256
|
"hazo_ui": "^2.7.0",
|
|
256
257
|
"lucide-react": "^0.553.0",
|
|
257
258
|
"next": ">=14.0.0",
|
|
@@ -375,7 +376,7 @@
|
|
|
375
376
|
"hazo_config": "^2.1.0",
|
|
376
377
|
"hazo_connect": "^2.4.0",
|
|
377
378
|
"hazo_logs": "^1.0.13",
|
|
378
|
-
"hazo_notify": "^
|
|
379
|
+
"hazo_notify": "^3.0.0",
|
|
379
380
|
"hazo_ui": "^2.7.0",
|
|
380
381
|
"jest": "^30.2.0",
|
|
381
382
|
"jest-environment-jsdom": "^30.0.0",
|
|
Binary file
|
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
// file_description: LRU cache implementation for organization lookups with TTL and size limits
|
|
2
|
-
// section: types
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Cached organization info for hazo_get_auth
|
|
6
|
-
*/
|
|
7
|
-
export type OrgCacheEntry = {
|
|
8
|
-
org_id: string;
|
|
9
|
-
org_name: string;
|
|
10
|
-
parent_org_id: string | null;
|
|
11
|
-
parent_org_name: string | null;
|
|
12
|
-
root_org_id: string | null;
|
|
13
|
-
root_org_name: string | null;
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Internal cache entry with metadata
|
|
18
|
-
*/
|
|
19
|
-
type CacheItem = {
|
|
20
|
-
entry: OrgCacheEntry;
|
|
21
|
-
timestamp: number; // Unix timestamp in milliseconds
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* LRU cache implementation for organization lookups
|
|
26
|
-
* Uses Map to maintain insertion order for LRU eviction
|
|
27
|
-
*/
|
|
28
|
-
class OrgCache {
|
|
29
|
-
private cache: Map<string, CacheItem>;
|
|
30
|
-
private max_size: number;
|
|
31
|
-
private ttl_ms: number;
|
|
32
|
-
|
|
33
|
-
constructor(max_size: number, ttl_minutes: number) {
|
|
34
|
-
this.cache = new Map();
|
|
35
|
-
this.max_size = max_size;
|
|
36
|
-
this.ttl_ms = ttl_minutes * 60 * 1000;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* Gets a cache entry for an organization
|
|
41
|
-
* Returns undefined if not found or expired
|
|
42
|
-
* @param org_id - Organization ID to look up
|
|
43
|
-
* @returns Cache entry or undefined
|
|
44
|
-
*/
|
|
45
|
-
get(org_id: string): OrgCacheEntry | undefined {
|
|
46
|
-
const item = this.cache.get(org_id);
|
|
47
|
-
|
|
48
|
-
if (!item) {
|
|
49
|
-
return undefined;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
const now = Date.now();
|
|
53
|
-
const age = now - item.timestamp;
|
|
54
|
-
|
|
55
|
-
// Check if entry is expired (TTL)
|
|
56
|
-
if (age > this.ttl_ms) {
|
|
57
|
-
this.cache.delete(org_id);
|
|
58
|
-
return undefined;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
// Move to end (most recently used)
|
|
62
|
-
this.cache.delete(org_id);
|
|
63
|
-
this.cache.set(org_id, item);
|
|
64
|
-
|
|
65
|
-
return item.entry;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* Sets a cache entry for an organization
|
|
70
|
-
* Evicts least recently used entries if cache is full
|
|
71
|
-
* @param org_id - Organization ID
|
|
72
|
-
* @param entry - Organization cache entry
|
|
73
|
-
*/
|
|
74
|
-
set(org_id: string, entry: OrgCacheEntry): void {
|
|
75
|
-
// Evict LRU entries if cache is full
|
|
76
|
-
while (this.cache.size >= this.max_size) {
|
|
77
|
-
const first_key = this.cache.keys().next().value;
|
|
78
|
-
if (first_key) {
|
|
79
|
-
this.cache.delete(first_key);
|
|
80
|
-
} else {
|
|
81
|
-
break;
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
const item: CacheItem = {
|
|
86
|
-
entry,
|
|
87
|
-
timestamp: Date.now(),
|
|
88
|
-
};
|
|
89
|
-
|
|
90
|
-
this.cache.set(org_id, item);
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
/**
|
|
94
|
-
* Invalidates cache for a specific organization
|
|
95
|
-
* @param org_id - Organization ID to invalidate
|
|
96
|
-
*/
|
|
97
|
-
invalidate(org_id: string): void {
|
|
98
|
-
this.cache.delete(org_id);
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
/**
|
|
102
|
-
* Invalidates all cache entries
|
|
103
|
-
*/
|
|
104
|
-
invalidate_all(): void {
|
|
105
|
-
this.cache.clear();
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
/**
|
|
109
|
-
* Gets cache statistics
|
|
110
|
-
* @returns Object with cache size and max size
|
|
111
|
-
*/
|
|
112
|
-
get_stats(): {
|
|
113
|
-
size: number;
|
|
114
|
-
max_size: number;
|
|
115
|
-
} {
|
|
116
|
-
return {
|
|
117
|
-
size: this.cache.size,
|
|
118
|
-
max_size: this.max_size,
|
|
119
|
-
};
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
// section: singleton
|
|
124
|
-
// Global org cache instance (initialized with defaults, will be configured on first use)
|
|
125
|
-
let org_cache_instance: OrgCache | null = null;
|
|
126
|
-
|
|
127
|
-
/**
|
|
128
|
-
* Gets or creates the global org cache instance
|
|
129
|
-
* @param max_size - Maximum cache size (default: 1000)
|
|
130
|
-
* @param ttl_minutes - TTL in minutes (default: 15)
|
|
131
|
-
* @returns Org cache instance
|
|
132
|
-
*/
|
|
133
|
-
export function get_org_cache(
|
|
134
|
-
max_size: number = 1000,
|
|
135
|
-
ttl_minutes: number = 15,
|
|
136
|
-
): OrgCache {
|
|
137
|
-
if (!org_cache_instance) {
|
|
138
|
-
org_cache_instance = new OrgCache(max_size, ttl_minutes);
|
|
139
|
-
}
|
|
140
|
-
return org_cache_instance;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
/**
|
|
144
|
-
* Resets the global org cache instance (useful for testing)
|
|
145
|
-
*/
|
|
146
|
-
export function reset_org_cache(): void {
|
|
147
|
-
org_cache_instance = null;
|
|
148
|
-
}
|
package/cli-src/lib/index.ts
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
// file_description: barrel export for lib utilities
|
|
2
|
-
// section: auth_exports
|
|
3
|
-
export * from "./auth/index.js";
|
|
4
|
-
|
|
5
|
-
// section: service_exports
|
|
6
|
-
export * from "./services/index.js";
|
|
7
|
-
|
|
8
|
-
// section: utility_exports
|
|
9
|
-
export { cn, merge_class_names } from "./utils.js";
|
|
10
|
-
|
|
11
|
-
// section: config_exports
|
|
12
|
-
export { get_config_value, get_config_number, get_config_boolean, get_config_array, read_config_section } from "./config/config_loader.server.js";
|
|
13
|
-
|
|
14
|
-
// section: hazo_connect_exports
|
|
15
|
-
export { create_sqlite_hazo_connect } from "./hazo_connect_setup.js";
|
|
16
|
-
export { get_hazo_connect_instance } from "./hazo_connect_instance.server.js";
|
|
17
|
-
|
|
18
|
-
// section: logger_exports
|
|
19
|
-
export { create_app_logger } from "./app_logger.js";
|
|
20
|
-
|
|
21
|
-
// section: config_server_exports
|
|
22
|
-
export { get_login_config } from "./login_config.server.js";
|
|
23
|
-
export { get_register_config } from "./register_config.server.js";
|
|
24
|
-
export { get_forgot_password_config } from "./forgot_password_config.server.js";
|
|
25
|
-
export { get_reset_password_config } from "./reset_password_config.server.js";
|
|
26
|
-
export { get_email_verification_config } from "./email_verification_config.server.js";
|
|
27
|
-
export { get_my_settings_config } from "./my_settings_config.server.js";
|
|
28
|
-
export { get_user_management_config } from "./user_management_config.server.js";
|
|
29
|
-
export { get_profile_picture_config } from "./profile_picture_config.server.js";
|
|
30
|
-
export { get_profile_pic_menu_config } from "./profile_pic_menu_config.server.js";
|
|
31
|
-
export { get_already_logged_in_config } from "./already_logged_in_config.server.js";
|
|
32
|
-
export { get_ui_shell_config } from "./ui_shell_config.server.js";
|
|
33
|
-
export { get_ui_sizes_config } from "./ui_sizes_config.server.js";
|
|
34
|
-
export { get_auth_utility_config } from "./auth_utility_config.server.js";
|
|
35
|
-
export { get_password_requirements_config } from "./password_requirements_config.server.js";
|
|
36
|
-
export { get_messages_config } from "./messages_config.server.js";
|
|
37
|
-
export { get_user_fields_config } from "./user_fields_config.server.js";
|
|
38
|
-
export { get_file_types_config } from "./file_types_config.server.js";
|
|
39
|
-
export { get_oauth_config, is_google_oauth_enabled, is_email_password_enabled } from "./oauth_config.server.js";
|
|
40
|
-
export type { OAuthConfig } from "./oauth_config.server";
|
|
41
|
-
export { get_branding_config, is_branding_enabled, is_allowed_logo_format, get_max_logo_size_bytes } from "./branding_config.server.js";
|
|
42
|
-
export type { FirmBrandingConfig } from "./branding_config.server";
|
|
43
|
-
|
|
44
|
-
// section: util_exports
|
|
45
|
-
export { sanitize_error_for_user } from "./utils/error_sanitizer.js";
|
|
46
|
-
export type { ErrorSanitizationOptions } from "./utils/error_sanitizer";
|
|
47
|
-
export * from "./utils/api_route_helpers.js";
|
|
48
|
-
|