@digilogiclabs/platform-core 1.6.0 → 1.8.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.
@@ -1,5 +1,269 @@
1
1
  import { z } from 'zod';
2
2
 
3
+ /**
4
+ * Beta Access Management Interface
5
+ *
6
+ * Provides a vendor-agnostic way to manage beta/early-access programs.
7
+ * Handles invite codes, access gating, settings, and analytics across
8
+ * all DLL Platform applications.
9
+ *
10
+ * Features:
11
+ * - Beta mode settings (mode, require code, custom message)
12
+ * - Invite code management (create, validate, consume, revoke)
13
+ * - Multi-use codes with usage tracking and expiration
14
+ * - Profile tagging (beta tester flag, join date)
15
+ * - Analytics (usage stats, per-code reports)
16
+ * - Live toggling (closed beta → open beta → public launch)
17
+ *
18
+ * @example
19
+ * ```typescript
20
+ * import { MemoryBeta } from '@digilogiclabs/platform-core';
21
+ *
22
+ * const beta = new MemoryBeta();
23
+ *
24
+ * // Check if beta is active
25
+ * const settings = await beta.getSettings();
26
+ * if (settings.requireInviteCode) {
27
+ * const result = await beta.validateCode('BETA2026');
28
+ * if (result.valid) {
29
+ * await beta.consumeCode('BETA2026', 'user_123');
30
+ * }
31
+ * }
32
+ *
33
+ * // Create invite codes
34
+ * const codes = await beta.createCodes({
35
+ * count: 10,
36
+ * prefix: 'DLL',
37
+ * maxUses: 5,
38
+ * createdBy: 'admin',
39
+ * });
40
+ *
41
+ * // Transition to public launch
42
+ * await beta.updateSettings({ betaMode: false, requireInviteCode: false });
43
+ * ```
44
+ */
45
+ /** Beta program settings */
46
+ interface BetaSettings {
47
+ /** Whether the app is in beta mode (shows beta messaging) */
48
+ betaMode: boolean;
49
+ /** Whether an invite code is required to sign up */
50
+ requireInviteCode: boolean;
51
+ /** Custom message to display during beta */
52
+ betaMessage: string;
53
+ }
54
+ /** Options for updating beta settings */
55
+ interface UpdateBetaSettingsOptions {
56
+ betaMode?: boolean;
57
+ requireInviteCode?: boolean;
58
+ betaMessage?: string;
59
+ updatedBy?: string;
60
+ }
61
+ /** A beta invite code */
62
+ interface BetaInviteCode {
63
+ /** Unique identifier */
64
+ id: string;
65
+ /** The invite code string (normalized to uppercase) */
66
+ code: string;
67
+ /** Maximum number of times this code can be used */
68
+ maxUses: number;
69
+ /** Current number of times this code has been used */
70
+ currentUses: number;
71
+ /** Optional expiration date */
72
+ expiresAt: Date | null;
73
+ /** Who created this code */
74
+ createdBy: string;
75
+ /** Admin notes about this code */
76
+ notes: string;
77
+ /** Whether this code is active (soft delete) */
78
+ isActive: boolean;
79
+ /** When this code was created */
80
+ createdAt: Date;
81
+ }
82
+ /** Options for creating invite codes */
83
+ interface CreateBetaCodesOptions {
84
+ /** Number of codes to generate (max 50) */
85
+ count?: number;
86
+ /** Prefix for generated codes (e.g., 'DLL' → 'DLL-A1B2C3D4') */
87
+ prefix?: string;
88
+ /** Specific code string (for named codes like 'BETA2026') */
89
+ code?: string;
90
+ /** Maximum uses per code (default: 1) */
91
+ maxUses?: number;
92
+ /** Optional expiration date */
93
+ expiresAt?: Date;
94
+ /** Who is creating the codes */
95
+ createdBy: string;
96
+ /** Admin notes */
97
+ notes?: string;
98
+ }
99
+ /** Filter for listing invite codes */
100
+ type BetaCodeStatus = "unused" | "partial" | "exhausted" | "expired" | "revoked";
101
+ interface ListBetaCodesOptions {
102
+ /** Filter by status */
103
+ status?: BetaCodeStatus;
104
+ /** Filter by active state */
105
+ isActive?: boolean;
106
+ /** Pagination offset */
107
+ offset?: number;
108
+ /** Pagination limit */
109
+ limit?: number;
110
+ }
111
+ /** Result of validating a beta code (read-only, does not consume) */
112
+ interface BetaValidationResult {
113
+ /** Whether the code is valid */
114
+ valid: boolean;
115
+ /** Human-readable message */
116
+ message: string;
117
+ /** The normalized code (if valid) */
118
+ code?: string;
119
+ /** Remaining uses (if valid) */
120
+ remainingUses?: number;
121
+ }
122
+ /** Result of consuming a beta code */
123
+ interface BetaConsumeResult {
124
+ /** Whether the code was successfully consumed */
125
+ success: boolean;
126
+ /** Human-readable message */
127
+ message: string;
128
+ }
129
+ /** Beta tester profile metadata */
130
+ interface BetaTester {
131
+ /** User identifier */
132
+ userId: string;
133
+ /** The invite code they used */
134
+ inviteCode: string;
135
+ /** Whether they are flagged as a beta tester */
136
+ isBetaTester: boolean;
137
+ /** When they joined beta */
138
+ betaJoinedAt: Date;
139
+ }
140
+ /** Aggregate beta program statistics */
141
+ interface BetaStats {
142
+ /** Total number of beta testers */
143
+ totalBetaTesters: number;
144
+ /** Total invite codes created */
145
+ totalCodes: number;
146
+ /** Number of active (usable) codes */
147
+ activeCodes: number;
148
+ /** Total uses across all codes */
149
+ totalUses: number;
150
+ /** Total remaining capacity across all codes */
151
+ totalRemaining: number;
152
+ /** Earliest beta signup */
153
+ firstBetaSignup: Date | null;
154
+ /** Most recent beta signup */
155
+ latestBetaSignup: Date | null;
156
+ }
157
+ /** Per-code usage report */
158
+ interface BetaCodeUsageReport {
159
+ /** The invite code */
160
+ code: string;
161
+ /** Admin notes */
162
+ notes: string;
163
+ /** Maximum uses */
164
+ maxUses: number;
165
+ /** Current uses */
166
+ currentUses: number;
167
+ /** Remaining uses */
168
+ remainingUses: number;
169
+ /** Usage percentage (0-100) */
170
+ usagePercent: number;
171
+ /** Whether the code is active */
172
+ isActive: boolean;
173
+ /** Expiration date */
174
+ expiresAt: Date | null;
175
+ /** Creation date */
176
+ createdAt: Date;
177
+ }
178
+ /** Configuration for beta adapters */
179
+ interface BetaConfig {
180
+ /** Default beta mode on initialization */
181
+ defaultBetaMode?: boolean;
182
+ /** Default require invite code on initialization */
183
+ defaultRequireInviteCode?: boolean;
184
+ /** Default beta message */
185
+ defaultBetaMessage?: string;
186
+ /** Code prefix for generated codes (e.g., 'DLL', 'WIAN') */
187
+ codePrefix?: string;
188
+ /** Maximum codes per createCodes call (default: 50) */
189
+ maxCodesPerBatch?: number;
190
+ }
191
+ interface IBeta {
192
+ /** Get current beta program settings */
193
+ getSettings(): Promise<BetaSettings>;
194
+ /** Update beta program settings (live toggle, no redeploy needed) */
195
+ updateSettings(options: UpdateBetaSettingsOptions): Promise<void>;
196
+ /** Create one or more invite codes */
197
+ createCodes(options: CreateBetaCodesOptions): Promise<BetaInviteCode[]>;
198
+ /** List invite codes with optional filtering */
199
+ listCodes(options?: ListBetaCodesOptions): Promise<BetaInviteCode[]>;
200
+ /** Get a specific invite code by its code string */
201
+ getCode(code: string): Promise<BetaInviteCode | null>;
202
+ /** Revoke an invite code (soft delete — sets isActive to false) */
203
+ revokeCode(code: string): Promise<void>;
204
+ /**
205
+ * Validate an invite code (read-only, does not consume).
206
+ * If requireInviteCode is false, always returns { valid: true }.
207
+ */
208
+ validateCode(code: string): Promise<BetaValidationResult>;
209
+ /**
210
+ * Consume an invite code for a user (increments usage, tags user).
211
+ * Should be called after successful signup, not before.
212
+ */
213
+ consumeCode(code: string, userId: string): Promise<BetaConsumeResult>;
214
+ /** Check if a user is a beta tester */
215
+ isBetaTester(userId: string): Promise<boolean>;
216
+ /** Get beta tester details for a user */
217
+ getBetaTester(userId: string): Promise<BetaTester | null>;
218
+ /** List all beta testers */
219
+ listBetaTesters(options?: {
220
+ offset?: number;
221
+ limit?: number;
222
+ }): Promise<BetaTester[]>;
223
+ /** Get aggregate beta program statistics */
224
+ getStats(): Promise<BetaStats>;
225
+ /** Get per-code usage reports */
226
+ getCodeUsageReports(): Promise<BetaCodeUsageReport[]>;
227
+ /** Check beta service health */
228
+ healthCheck(): Promise<boolean>;
229
+ }
230
+ /** Generate a random hex code with prefix (e.g., 'DLL-A1B2C3D4') */
231
+ declare function generateBetaCode(prefix?: string): string;
232
+ /** Normalize a code for comparison (trim + uppercase) */
233
+ declare function normalizeBetaCode(code: string): string;
234
+ /** Generate a unique ID for beta records */
235
+ declare function generateBetaId(): string;
236
+ declare class MemoryBeta implements IBeta {
237
+ private settings;
238
+ private codes;
239
+ private testers;
240
+ private config;
241
+ constructor(config?: BetaConfig);
242
+ getSettings(): Promise<BetaSettings>;
243
+ updateSettings(options: UpdateBetaSettingsOptions): Promise<void>;
244
+ createCodes(options: CreateBetaCodesOptions): Promise<BetaInviteCode[]>;
245
+ listCodes(options?: ListBetaCodesOptions): Promise<BetaInviteCode[]>;
246
+ getCode(code: string): Promise<BetaInviteCode | null>;
247
+ revokeCode(code: string): Promise<void>;
248
+ validateCode(code: string): Promise<BetaValidationResult>;
249
+ consumeCode(code: string, userId: string): Promise<BetaConsumeResult>;
250
+ isBetaTester(userId: string): Promise<boolean>;
251
+ getBetaTester(userId: string): Promise<BetaTester | null>;
252
+ listBetaTesters(options?: {
253
+ offset?: number;
254
+ limit?: number;
255
+ }): Promise<BetaTester[]>;
256
+ getStats(): Promise<BetaStats>;
257
+ getCodeUsageReports(): Promise<BetaCodeUsageReport[]>;
258
+ healthCheck(): Promise<boolean>;
259
+ /** Clear all data (for testing) */
260
+ clear(): void;
261
+ /** Get the number of stored codes */
262
+ get codeCount(): number;
263
+ /** Get the number of beta testers */
264
+ get testerCount(): number;
265
+ }
266
+
3
267
  /**
4
268
  * Security Utilities
5
269
  *
@@ -464,7 +728,7 @@ declare function buildKeycloakCallbacks(config: KeycloakCallbacksConfig): {
464
728
  *
465
729
  * Compatible with Auth.js v5 JWT callback signature.
466
730
  */
467
- jwt({ token, user, account }: {
731
+ jwt({ token, user, account, }: {
468
732
  token: any;
469
733
  user?: any;
470
734
  account?: any;
@@ -1279,6 +1543,100 @@ declare function createAuditLogger(options?: OpsAuditLoggerOptions): {
1279
1543
  };
1280
1544
  };
1281
1545
 
1546
+ /**
1547
+ * Beta Client Utilities
1548
+ *
1549
+ * Shared client-side helpers for beta access management.
1550
+ * These run in the browser and talk to your app's beta API endpoints.
1551
+ *
1552
+ * Standardizes the pattern used across DLL, WIAN, and future apps:
1553
+ * - Fetch beta settings from API
1554
+ * - Validate invite codes
1555
+ * - Store/retrieve beta code across OAuth redirect flows (sessionStorage)
1556
+ *
1557
+ * @example
1558
+ * ```typescript
1559
+ * import {
1560
+ * fetchBetaSettings,
1561
+ * validateBetaCode,
1562
+ * storeBetaCode,
1563
+ * getStoredBetaCode,
1564
+ * clearStoredBetaCode,
1565
+ * } from '@digilogiclabs/platform-core/auth';
1566
+ *
1567
+ * // On sign-in page mount
1568
+ * const settings = await fetchBetaSettings();
1569
+ * if (settings.requireInviteCode) {
1570
+ * const result = await validateBetaCode(userInput);
1571
+ * if (result.valid) {
1572
+ * storeBetaCode(userInput); // Survives OAuth redirect
1573
+ * // Proceed with sign-in
1574
+ * }
1575
+ * }
1576
+ * ```
1577
+ */
1578
+
1579
+ interface BetaClientConfig {
1580
+ /** Base URL for API calls (default: '' for same-origin) */
1581
+ baseUrl?: string;
1582
+ /** API endpoint for settings (default: '/api/beta-settings') */
1583
+ settingsEndpoint?: string;
1584
+ /** API endpoint for validation (default: '/api/validate-beta-code') */
1585
+ validateEndpoint?: string;
1586
+ /** sessionStorage key for storing beta code (default: 'beta_code') */
1587
+ storageKey?: string;
1588
+ /** Default settings to use when fetch fails */
1589
+ failSafeDefaults?: Partial<BetaSettings>;
1590
+ }
1591
+ /**
1592
+ * Create a configured beta client with app-specific settings.
1593
+ *
1594
+ * @example
1595
+ * ```typescript
1596
+ * // DLL app
1597
+ * const betaClient = createBetaClient({
1598
+ * storageKey: 'dll_beta_code',
1599
+ * validateEndpoint: '/api/validate-beta-code',
1600
+ * });
1601
+ *
1602
+ * // WIAN app
1603
+ * const betaClient = createBetaClient({
1604
+ * storageKey: 'wian_beta_code',
1605
+ * validateEndpoint: '/api/validate-invite-code',
1606
+ * });
1607
+ * ```
1608
+ */
1609
+ declare function createBetaClient(config?: BetaClientConfig): {
1610
+ fetchSettings: () => Promise<BetaSettings>;
1611
+ validateCode: (code: string) => Promise<BetaValidationResult>;
1612
+ storeCode: (code: string) => void;
1613
+ getStoredCode: () => string | null;
1614
+ clearStoredCode: () => void;
1615
+ };
1616
+ /**
1617
+ * Fetch beta settings from the server.
1618
+ * Returns fail-safe defaults if the fetch fails.
1619
+ */
1620
+ declare function fetchBetaSettings(config?: BetaClientConfig): Promise<BetaSettings>;
1621
+ /**
1622
+ * Validate a beta invite code against the server.
1623
+ * Handles rate limiting (429) gracefully.
1624
+ */
1625
+ declare function validateBetaCode(code: string, config?: BetaClientConfig): Promise<BetaValidationResult>;
1626
+ /**
1627
+ * Store a validated beta code in sessionStorage.
1628
+ * Used to pass the code through OAuth redirect flows.
1629
+ */
1630
+ declare function storeBetaCode(code: string, config?: BetaClientConfig): void;
1631
+ /**
1632
+ * Retrieve stored beta code from sessionStorage.
1633
+ */
1634
+ declare function getStoredBetaCode(config?: BetaClientConfig): string | null;
1635
+ /**
1636
+ * Clear stored beta code from sessionStorage.
1637
+ */
1638
+ declare function clearStoredBetaCode(config?: BetaClientConfig): void;
1639
+
1282
1640
  /**
1283
1641
  * Environment Variable Helpers
1284
1642
  *
@@ -1364,4 +1722,4 @@ declare function checkEnvVars(config: EnvValidationConfig): EnvValidationResult;
1364
1722
  */
1365
1723
  declare function getEnvSummary(keys: string[]): Record<string, boolean>;
1366
1724
 
1367
- export { type ApiSecurityContext as $, ApiErrorCode as A, type KeycloakConfig as B, CommonApiErrors as C, type KeycloakTokenSet as D, buildKeycloakCallbacks as E, buildAuthCookies as F, buildRedirectCallback as G, HTML_TAG_PATTERN as H, type KeycloakCallbacksConfig as I, type KeycloakJwtFields as J, KEYCLOAK_DEFAULT_ROLES as K, type AuthCookiesConfig as L, resolveRateLimitIdentifier as M, extractClientIp as N, buildRateLimitHeaders as O, PG_ERROR_MAP as P, buildErrorBody as Q, type RedirectCallbackConfig as R, StandardRateLimitPresets as S, type TokenRefreshResult as T, URL_PROTOCOL_PATTERN as U, type AuthMethod as V, WrapperPresets as W, type RouteAuditConfig as X, type RateLimitPreset as Y, type ApiSecurityConfig as Z, type SecuritySession as _, containsHtml as a, EmailSchema as a0, PasswordSchema as a1, SlugSchema as a2, PhoneSchema as a3, PersonNameSchema as a4, PaginationSchema as a5, DateRangeSchema as a6, SearchQuerySchema as a7, LoginSchema as a8, SignupSchema as a9, type RateLimitStore as aA, type RateLimitOptions as aB, createAuditLogger as aC, createAuditActor as aD, extractAuditIp as aE, extractAuditUserAgent as aF, extractAuditRequestId as aG, StandardAuditActions as aH, type OpsAuditActor as aI, type OpsAuditResource as aJ, type OpsAuditEvent as aK, type OpsAuditRecord as aL, type OpsAuditLoggerOptions as aM, type AuditRequest as aN, type StandardAuditActionType as aO, getRequiredEnv as aP, getOptionalEnv as aQ, getBoolEnv as aR, getIntEnv as aS, validateEnvVars as aT, checkEnvVars as aU, getEnvSummary as aV, type EnvValidationConfig as aW, type EnvValidationResult as aX, createSafeTextSchema as aa, type EmailInput as ab, type PaginationInput as ac, type DateRangeInput as ad, type SearchQueryInput as ae, type LoginInput as af, type SignupInput as ag, createFeatureFlags as ah, detectStage as ai, buildAllowlist as aj, isAllowlisted as ak, type DeploymentStage as al, type FlagValue as am, type FlagDefinition as an, type FlagDefinitions as ao, type ResolvedFlags as ap, type AllowlistConfig as aq, checkRateLimit as ar, getRateLimitStatus as as, resetRateLimitForKey as at, createMemoryRateLimitStore as au, buildRateLimitResponseHeaders as av, resolveIdentifier as aw, CommonRateLimits as ax, type RateLimitRule as ay, type RateLimitCheckResult as az, sanitizeForEmail as b, containsUrls as c, defangUrl as d, escapeHtml as e, constantTimeEqual as f, sanitizeApiError as g, getCorrelationId as h, URL_DOMAIN_PATTERN as i, ApiError as j, isApiError as k, classifyError as l, buildPagination as m, type ApiErrorCodeType as n, type ApiSuccessResponse as o, type ApiPaginatedResponse as p, parseKeycloakRoles as q, hasRole as r, stripHtml as s, hasAnyRole as t, hasAllRoles as u, isTokenExpired as v, buildTokenRefreshParams as w, getTokenEndpoint as x, getEndSessionEndpoint as y, refreshKeycloakToken as z };
1725
+ export { type SecuritySession as $, ApiError as A, parseKeycloakRoles as B, CommonApiErrors as C, hasRole as D, type EnvValidationConfig as E, hasAnyRole as F, hasAllRoles as G, isTokenExpired as H, buildTokenRefreshParams as I, getTokenEndpoint as J, type KeycloakConfig as K, getEndSessionEndpoint as L, refreshKeycloakToken as M, type KeycloakCallbacksConfig as N, type KeycloakJwtFields as O, type AuthCookiesConfig as P, buildAuthCookies as Q, type RateLimitStore as R, type RedirectCallbackConfig as S, type TokenRefreshResult as T, buildRedirectCallback as U, buildKeycloakCallbacks as V, type AuthMethod as W, type RouteAuditConfig as X, type RateLimitPreset as Y, StandardRateLimitPresets as Z, type ApiSecurityConfig as _, type RateLimitRule as a, type BetaSettings as a$, type ApiSecurityContext as a0, resolveRateLimitIdentifier as a1, extractClientIp as a2, buildRateLimitHeaders as a3, buildErrorBody as a4, WrapperPresets as a5, EmailSchema as a6, PasswordSchema as a7, SlugSchema as a8, PhoneSchema as a9, checkRateLimit as aA, getRateLimitStatus as aB, resetRateLimitForKey as aC, buildRateLimitResponseHeaders as aD, resolveIdentifier as aE, type OpsAuditActor as aF, type OpsAuditResource as aG, type OpsAuditEvent as aH, type OpsAuditRecord as aI, type OpsAuditLoggerOptions as aJ, type AuditRequest as aK, StandardAuditActions as aL, type StandardAuditActionType as aM, extractAuditIp as aN, extractAuditUserAgent as aO, extractAuditRequestId as aP, createAuditActor as aQ, createAuditLogger as aR, type BetaClientConfig as aS, createBetaClient as aT, fetchBetaSettings as aU, validateBetaCode as aV, storeBetaCode as aW, getStoredBetaCode as aX, clearStoredBetaCode as aY, type IBeta as aZ, type BetaConfig as a_, PersonNameSchema as aa, createSafeTextSchema as ab, PaginationSchema as ac, DateRangeSchema as ad, SearchQuerySchema as ae, LoginSchema as af, SignupSchema as ag, type EmailInput as ah, type PaginationInput as ai, type DateRangeInput as aj, type SearchQueryInput as ak, type LoginInput as al, type SignupInput as am, type DeploymentStage as an, type FlagValue as ao, type FlagDefinition as ap, type FlagDefinitions as aq, type ResolvedFlags as ar, type AllowlistConfig as as, detectStage as at, createFeatureFlags as au, buildAllowlist as av, isAllowlisted as aw, type RateLimitCheckResult as ax, CommonRateLimits as ay, createMemoryRateLimitStore as az, type RateLimitOptions as b, type UpdateBetaSettingsOptions as b0, type CreateBetaCodesOptions as b1, type BetaInviteCode as b2, type ListBetaCodesOptions as b3, type BetaValidationResult as b4, type BetaConsumeResult as b5, type BetaTester as b6, type BetaStats as b7, type BetaCodeUsageReport as b8, MemoryBeta as b9, generateBetaCode as ba, normalizeBetaCode as bb, generateBetaId as bc, type BetaCodeStatus as bd, defangUrl as be, sanitizeForEmail as bf, URL_PROTOCOL_PATTERN as bg, URL_DOMAIN_PATTERN as bh, HTML_TAG_PATTERN as bi, PG_ERROR_MAP as bj, constantTimeEqual as c, containsUrls as d, escapeHtml as e, containsHtml as f, sanitizeApiError as g, getCorrelationId as h, classifyError as i, isApiError as j, ApiErrorCode as k, buildPagination as l, type ApiErrorCodeType as m, type ApiSuccessResponse as n, type ApiPaginatedResponse as o, getRequiredEnv as p, getOptionalEnv as q, getBoolEnv as r, stripHtml as s, getIntEnv as t, checkEnvVars as u, validateEnvVars as v, getEnvSummary as w, type EnvValidationResult as x, type KeycloakTokenSet as y, KEYCLOAK_DEFAULT_ROLES as z };
@@ -431,6 +431,17 @@ declare const createTenantUsageTable: Migration;
431
431
  * SSO Sessions Table Migration
432
432
  */
433
433
  declare const createSsoSessionsTable: Migration;
434
+ /**
435
+ * Beta Access Management Tables Migration
436
+ *
437
+ * Creates the tables needed for beta invite code management:
438
+ * - beta_settings: Feature flags for beta mode (live toggleable)
439
+ * - beta_invites: Invite codes with usage tracking and expiration
440
+ * - beta_testers: User beta participation records
441
+ */
442
+ declare const createBetaSettingsTable: Migration;
443
+ declare const createBetaInvitesTable: Migration;
444
+ declare const createBetaTestersTable: Migration;
434
445
  /**
435
446
  * All enterprise migrations in order
436
447
  */
@@ -441,6 +452,7 @@ declare const enterpriseMigrations: Migration[];
441
452
  declare function getEnterpriseMigrations(features: {
442
453
  sso?: boolean;
443
454
  tenancy?: boolean;
455
+ beta?: boolean;
444
456
  }): Migration[];
445
457
 
446
- export { type IMigrator as I, Migrator as M, SQL as S, getEnterpriseMigrations as a, createSsoOidcConfigsTable as b, createMigration as c, defineMigration as d, enterpriseMigrations as e, createDomainVerificationsTable as f, generateVersion as g, createVerifiedDomainsTable as h, createTenantsTable as i, createTenantMembersTable as j, createTenantInvitationsTable as k, createTenantUsageTable as l, createSsoSessionsTable as m, type Migration as n, type MigrationRecord as o, type MigrationResult as p, type MigrationStatus as q, type MigratorConfig as r, sqlMigration as s, type IMigrationDatabase as t };
458
+ export { type IMigrator as I, Migrator as M, SQL as S, getEnterpriseMigrations as a, createSsoOidcConfigsTable as b, createMigration as c, defineMigration as d, enterpriseMigrations as e, createDomainVerificationsTable as f, generateVersion as g, createVerifiedDomainsTable as h, createTenantsTable as i, createTenantMembersTable as j, createTenantInvitationsTable as k, createTenantUsageTable as l, createSsoSessionsTable as m, createBetaSettingsTable as n, createBetaInvitesTable as o, createBetaTestersTable as p, type Migration as q, type MigrationRecord as r, sqlMigration as s, type MigrationResult as t, type MigrationStatus as u, type MigratorConfig as v, type IMigrationDatabase as w };
@@ -431,6 +431,17 @@ declare const createTenantUsageTable: Migration;
431
431
  * SSO Sessions Table Migration
432
432
  */
433
433
  declare const createSsoSessionsTable: Migration;
434
+ /**
435
+ * Beta Access Management Tables Migration
436
+ *
437
+ * Creates the tables needed for beta invite code management:
438
+ * - beta_settings: Feature flags for beta mode (live toggleable)
439
+ * - beta_invites: Invite codes with usage tracking and expiration
440
+ * - beta_testers: User beta participation records
441
+ */
442
+ declare const createBetaSettingsTable: Migration;
443
+ declare const createBetaInvitesTable: Migration;
444
+ declare const createBetaTestersTable: Migration;
434
445
  /**
435
446
  * All enterprise migrations in order
436
447
  */
@@ -441,6 +452,7 @@ declare const enterpriseMigrations: Migration[];
441
452
  declare function getEnterpriseMigrations(features: {
442
453
  sso?: boolean;
443
454
  tenancy?: boolean;
455
+ beta?: boolean;
444
456
  }): Migration[];
445
457
 
446
- export { type IMigrator as I, Migrator as M, SQL as S, getEnterpriseMigrations as a, createSsoOidcConfigsTable as b, createMigration as c, defineMigration as d, enterpriseMigrations as e, createDomainVerificationsTable as f, generateVersion as g, createVerifiedDomainsTable as h, createTenantsTable as i, createTenantMembersTable as j, createTenantInvitationsTable as k, createTenantUsageTable as l, createSsoSessionsTable as m, type Migration as n, type MigrationRecord as o, type MigrationResult as p, type MigrationStatus as q, type MigratorConfig as r, sqlMigration as s, type IMigrationDatabase as t };
458
+ export { type IMigrator as I, Migrator as M, SQL as S, getEnterpriseMigrations as a, createSsoOidcConfigsTable as b, createMigration as c, defineMigration as d, enterpriseMigrations as e, createDomainVerificationsTable as f, generateVersion as g, createVerifiedDomainsTable as h, createTenantsTable as i, createTenantMembersTable as j, createTenantInvitationsTable as k, createTenantUsageTable as l, createSsoSessionsTable as m, createBetaSettingsTable as n, createBetaInvitesTable as o, createBetaTestersTable as p, type Migration as q, type MigrationRecord as r, sqlMigration as s, type MigrationResult as t, type MigrationStatus as u, type MigratorConfig as v, type IMigrationDatabase as w };
package/dist/index.d.mts CHANGED
@@ -1,7 +1,8 @@
1
1
  import { p as ILogger, q as IMetrics, I as IPlatform, P as PlatformHealthStatus, u as MetricsSummary, v as ICrypto, w as EncryptOptions, x as EncryptedField, D as DeterministicEncryptedField, K as KeyRotationResult, y as CryptoKeyMetadata, e as IDatabase, k as IQueryBuilder, Q as QueryResult, l as ICache, m as IStorage, U as UploadOptions, S as StorageFile, n as IEmail, t as EmailMessage, z as EmailResult, o as IQueue, s as JobOptions, J as Job, R as RepeatOptions, A as JobState, B as JobEventType, F as JobEventHandler, G as IAI, H as AIConfig, L as AIChatRequest, O as AIChatResponse, T as AIStreamChunk, V as AIStreamCallback, W as AICompletionRequest, X as AICompletionResponse, Y as AIEmbeddingRequest, Z as AIEmbeddingResponse, _ as AIModelConfig, $ as AIModelType, a0 as AIProvider, a1 as IRAG, a2 as RAGConfig, a3 as CreateCollectionOptions, a4 as RAGCollection, a5 as RAGDocument, a6 as IngestionOptions, a7 as BulkIngestionResult, a8 as IngestionResult, a9 as DocumentStatus, aa as RAGChunk, ab as RAGSearchQuery, ac as RAGSearchResponse, ad as RAGSearchResult, ae as ContextAssemblyConfig, af as AssembledContext, ag as RAGPipeline } from './ConsoleEmail-ubSVWgTa.mjs';
2
2
  export { aI as AIChatChoice, br as AIConfigSchema, aO as AIError, aN as AIErrorCode, aC as AIErrorMessages, aJ as AIFinishReason, aF as AIMessage, bk as AIProviderSchema, aE as AIRole, aM as AIRouterConfig, aH as AITool, aG as AIToolCall, aK as AIUsageInfo, am as BackoffOptions, by as BulkheadConfigSchema, bI as CacheConfig, bn as CacheConfigSchema, be as CacheProviderSchema, aS as ChunkingConfig, aQ as ChunkingPresets, aR as ChunkingStrategy, bw as CircuitBreakerConfigSchema, C as ConsoleEmail, h as ConsoleLogger, aX as CryptoAlgorithm, bP as CryptoConfig, bt as CryptoConfigSchema, aW as CryptoKeyStatus, bH as DatabaseConfig, bm as DatabaseConfigSchema, bd as DatabaseProviderSchema, b7 as EmailAddress, b8 as EmailAttachment, bK as EmailConfig, bp as EmailConfigSchema, bg as EmailProviderSchema, E as EnvSecrets, aw as GetSecretOptions, as as HistogramStats, ah as ICacheOptions, r as ISecrets, b1 as ISpan, b0 as ITracing, aj as JobContext, ak as JobEvent, ai as JobResult, ap as LogEntry, an as LogLevel, bj as LogLevelSchema, ao as LogMeta, aq as LoggerConfig, bA as LoggingConfigSchema, aD as MemoryAI, a as MemoryCache, M as MemoryDatabase, c as MemoryEmail, i as MemoryMetrics, d as MemoryQueue, aP as MemoryRAG, f as MemorySecrets, b as MemoryStorage, a_ as MemoryTracing, ar as MetricTags, bB as MetricsConfigSchema, bO as MiddlewareConfig, bE as MiddlewareConfigSchema, N as NoopLogger, j as NoopMetrics, a$ as NoopTracing, bN as ObservabilityConfig, bD as ObservabilityConfigSchema, bG as PlatformConfig, bF as PlatformConfigSchema, bL as QueueConfig, bq as QueueConfigSchema, bh as QueueProviderSchema, al as QueueStats, bs as RAGConfigSchema, aU as RAGFilter, aV as RAGPipelineStep, bl as RAGProviderSchema, bM as ResilienceConfig, bz as ResilienceConfigSchema, bv as RetryConfigSchema, ay as RotateSecretOptions, az as RotationResult, aL as RoutingStrategy, aT as SearchMode, au as Secret, av as SecretMetadata, bQ as SecurityConfig, bu as SecurityConfigSchema, ax as SetSecretOptions, b2 as SpanContext, bc as SpanEvent, b5 as SpanKind, b3 as SpanOptions, b4 as SpanStatus, bb as SpanStatusCode, bJ as StorageConfig, bo as StorageConfigSchema, bf as StorageProviderSchema, bx as TimeoutConfigSchema, at as TimingStats, b6 as TracingConfig, bC as TracingConfigSchema, bi as TracingProviderSchema, b9 as calculateBackoff, aA as createAIError, g as createPlatform, aY as createPlatformAsync, aZ as createScopedMetrics, ba as generateJobId, bU as getDefaultConfig, aB as isAIError, bR as loadConfig, bT as safeValidateConfig, bS as validateConfig } from './ConsoleEmail-ubSVWgTa.mjs';
3
- export { t as IMigrationDatabase, I as IMigrator, n as Migration, o as MigrationRecord, p as MigrationResult, q as MigrationStatus, M as Migrator, r as MigratorConfig, S as SQL, f as createDomainVerificationsTable, c as createMigration, b as createSsoOidcConfigsTable, m as createSsoSessionsTable, k as createTenantInvitationsTable, j as createTenantMembersTable, l as createTenantUsageTable, i as createTenantsTable, h as createVerifiedDomainsTable, d as defineMigration, e as enterpriseMigrations, g as generateVersion, a as getEnterpriseMigrations, s as sqlMigration } from './index-CepDdu7h.mjs';
4
- export { aq as AllowlistConfig, j as ApiError, A as ApiErrorCode, n as ApiErrorCodeType, p as ApiPaginatedResponse, Z as ApiSecurityConfig, $ as ApiSecurityContext, o as ApiSuccessResponse, aN as AuditRequest, L as AuthCookiesConfig, V as AuthMethod, C as CommonApiErrors, ax as CommonRateLimits, ad as DateRangeInput, a6 as DateRangeSchema, al as DeploymentStage, ab as EmailInput, a0 as EmailSchema, aW as EnvValidationConfig, aX as EnvValidationResult, an as FlagDefinition, ao as FlagDefinitions, am as FlagValue, H as HTML_TAG_PATTERN, K as KEYCLOAK_DEFAULT_ROLES, I as KeycloakCallbacksConfig, B as KeycloakConfig, J as KeycloakJwtFields, D as KeycloakTokenSet, af as LoginInput, a8 as LoginSchema, aI as OpsAuditActor, aK as OpsAuditEvent, aM as OpsAuditLoggerOptions, aL as OpsAuditRecord, aJ as OpsAuditResource, P as PG_ERROR_MAP, ac as PaginationInput, a5 as PaginationSchema, a1 as PasswordSchema, a4 as PersonNameSchema, a3 as PhoneSchema, az as RateLimitCheckResult, aB as RateLimitOptions, Y as RateLimitPreset, ay as RateLimitRule, aA as RateLimitStore, R as RedirectCallbackConfig, ap as ResolvedFlags, X as RouteAuditConfig, ae as SearchQueryInput, a7 as SearchQuerySchema, _ as SecuritySession, ag as SignupInput, a9 as SignupSchema, a2 as SlugSchema, aO as StandardAuditActionType, aH as StandardAuditActions, S as StandardRateLimitPresets, T as TokenRefreshResult, i as URL_DOMAIN_PATTERN, U as URL_PROTOCOL_PATTERN, W as WrapperPresets, aj as buildAllowlist, F as buildAuthCookies, Q as buildErrorBody, E as buildKeycloakCallbacks, m as buildPagination, O as buildRateLimitHeaders, av as buildRateLimitResponseHeaders, G as buildRedirectCallback, w as buildTokenRefreshParams, aU as checkEnvVars, ar as checkRateLimit, l as classifyError, f as constantTimeEqual, a as containsHtml, c as containsUrls, aD as createAuditActor, aC as createAuditLogger, ah as createFeatureFlags, au as createMemoryRateLimitStore, aa as createSafeTextSchema, d as defangUrl, ai as detectStage, e as escapeHtml, aE as extractAuditIp, aG as extractAuditRequestId, aF as extractAuditUserAgent, N as extractClientIp, aR as getBoolEnv, h as getCorrelationId, y as getEndSessionEndpoint, aV as getEnvSummary, aS as getIntEnv, aQ as getOptionalEnv, as as getRateLimitStatus, aP as getRequiredEnv, x as getTokenEndpoint, u as hasAllRoles, t as hasAnyRole, r as hasRole, ak as isAllowlisted, k as isApiError, v as isTokenExpired, q as parseKeycloakRoles, z as refreshKeycloakToken, at as resetRateLimitForKey, aw as resolveIdentifier, M as resolveRateLimitIdentifier, g as sanitizeApiError, b as sanitizeForEmail, s as stripHtml, aT as validateEnvVars } from './index-CkyVz0hQ.mjs';
3
+ export { w as IMigrationDatabase, I as IMigrator, q as Migration, r as MigrationRecord, t as MigrationResult, u as MigrationStatus, M as Migrator, v as MigratorConfig, S as SQL, o as createBetaInvitesTable, n as createBetaSettingsTable, p as createBetaTestersTable, f as createDomainVerificationsTable, c as createMigration, b as createSsoOidcConfigsTable, m as createSsoSessionsTable, k as createTenantInvitationsTable, j as createTenantMembersTable, l as createTenantUsageTable, i as createTenantsTable, h as createVerifiedDomainsTable, d as defineMigration, e as enterpriseMigrations, g as generateVersion, a as getEnterpriseMigrations, s as sqlMigration } from './index-DzQ0Js5Z.mjs';
4
+ import { aZ as IBeta, a_ as BetaConfig, a$ as BetaSettings, b0 as UpdateBetaSettingsOptions, b1 as CreateBetaCodesOptions, b2 as BetaInviteCode, b3 as ListBetaCodesOptions, b4 as BetaValidationResult, b5 as BetaConsumeResult, b6 as BetaTester, b7 as BetaStats, b8 as BetaCodeUsageReport } from './env-jqNJdZVt.mjs';
5
+ export { as as AllowlistConfig, A as ApiError, k as ApiErrorCode, m as ApiErrorCodeType, o as ApiPaginatedResponse, _ as ApiSecurityConfig, a0 as ApiSecurityContext, n as ApiSuccessResponse, aK as AuditRequest, P as AuthCookiesConfig, W as AuthMethod, aS as BetaClientConfig, bd as BetaCodeStatus, C as CommonApiErrors, ay as CommonRateLimits, aj as DateRangeInput, ad as DateRangeSchema, an as DeploymentStage, ah as EmailInput, a6 as EmailSchema, E as EnvValidationConfig, x as EnvValidationResult, ap as FlagDefinition, aq as FlagDefinitions, ao as FlagValue, bi as HTML_TAG_PATTERN, z as KEYCLOAK_DEFAULT_ROLES, N as KeycloakCallbacksConfig, K as KeycloakConfig, O as KeycloakJwtFields, y as KeycloakTokenSet, al as LoginInput, af as LoginSchema, b9 as MemoryBeta, aF as OpsAuditActor, aH as OpsAuditEvent, aJ as OpsAuditLoggerOptions, aI as OpsAuditRecord, aG as OpsAuditResource, bj as PG_ERROR_MAP, ai as PaginationInput, ac as PaginationSchema, a7 as PasswordSchema, aa as PersonNameSchema, a9 as PhoneSchema, ax as RateLimitCheckResult, b as RateLimitOptions, Y as RateLimitPreset, a as RateLimitRule, R as RateLimitStore, S as RedirectCallbackConfig, ar as ResolvedFlags, X as RouteAuditConfig, ak as SearchQueryInput, ae as SearchQuerySchema, $ as SecuritySession, am as SignupInput, ag as SignupSchema, a8 as SlugSchema, aM as StandardAuditActionType, aL as StandardAuditActions, Z as StandardRateLimitPresets, T as TokenRefreshResult, bh as URL_DOMAIN_PATTERN, bg as URL_PROTOCOL_PATTERN, a5 as WrapperPresets, av as buildAllowlist, Q as buildAuthCookies, a4 as buildErrorBody, V as buildKeycloakCallbacks, l as buildPagination, a3 as buildRateLimitHeaders, aD as buildRateLimitResponseHeaders, U as buildRedirectCallback, I as buildTokenRefreshParams, u as checkEnvVars, aA as checkRateLimit, i as classifyError, aY as clearStoredBetaCode, c as constantTimeEqual, f as containsHtml, d as containsUrls, aQ as createAuditActor, aR as createAuditLogger, aT as createBetaClient, au as createFeatureFlags, az as createMemoryRateLimitStore, ab as createSafeTextSchema, be as defangUrl, at as detectStage, e as escapeHtml, aN as extractAuditIp, aP as extractAuditRequestId, aO as extractAuditUserAgent, a2 as extractClientIp, aU as fetchBetaSettings, ba as generateBetaCode, bc as generateBetaId, r as getBoolEnv, h as getCorrelationId, L as getEndSessionEndpoint, w as getEnvSummary, t as getIntEnv, q as getOptionalEnv, aB as getRateLimitStatus, p as getRequiredEnv, aX as getStoredBetaCode, J as getTokenEndpoint, G as hasAllRoles, F as hasAnyRole, D as hasRole, aw as isAllowlisted, j as isApiError, H as isTokenExpired, bb as normalizeBetaCode, B as parseKeycloakRoles, M as refreshKeycloakToken, aC as resetRateLimitForKey, aE as resolveIdentifier, a1 as resolveRateLimitIdentifier, g as sanitizeApiError, bf as sanitizeForEmail, aW as storeBetaCode, s as stripHtml, aV as validateBetaCode, v as validateEnvVars } from './env-jqNJdZVt.mjs';
5
6
  export { NextHeaderEntry, SecurityHeaderPresets, SecurityHeadersConfig, generateSecurityHeaders } from './security-headers.mjs';
6
7
  import { SupabaseClient } from '@supabase/supabase-js';
7
8
  import { Pool } from 'pg';
@@ -13041,6 +13042,100 @@ declare class PostgresTenant implements ITenant {
13041
13042
  private mapRowToInvitation;
13042
13043
  }
13043
13044
 
13045
+ /**
13046
+ * PostgreSQL Beta Access Management Adapter
13047
+ *
13048
+ * Production implementation of IBeta using PostgreSQL for persistent
13049
+ * beta settings, invite codes, and tester tracking.
13050
+ *
13051
+ * Supports two configuration sources:
13052
+ * - **Database** (default): Settings stored in `beta_settings` table,
13053
+ * toggleable live without redeploy. Best for apps needing live toggles.
13054
+ * - **Environment + Database hybrid**: Settings from env vars (BETA_MODE,
13055
+ * REQUIRE_INVITE_CODE, BETA_MESSAGE), codes from database. Best for
13056
+ * apps wanting simple env-var control with database code management.
13057
+ *
13058
+ * Uses `FOR UPDATE` row locking on code consumption to prevent race conditions.
13059
+ *
13060
+ * @example
13061
+ * ```typescript
13062
+ * import { Pool } from 'pg';
13063
+ * import { PostgresBeta } from '@digilogiclabs/platform-core';
13064
+ *
13065
+ * const pool = new Pool({ connectionString: process.env.DATABASE_URL });
13066
+ *
13067
+ * // Database-driven settings (live toggleable)
13068
+ * const beta = new PostgresBeta({ pool });
13069
+ * await beta.initialize();
13070
+ *
13071
+ * // Environment-driven settings (deploy to change)
13072
+ * const beta = new PostgresBeta({
13073
+ * pool,
13074
+ * settingsSource: 'env',
13075
+ * envPrefix: 'BETA',
13076
+ * });
13077
+ * ```
13078
+ */
13079
+
13080
+ interface PostgresBetaConfig extends BetaConfig {
13081
+ /** PostgreSQL connection pool (pg.Pool) */
13082
+ pool: unknown;
13083
+ /** Schema for beta tables (default: 'public') */
13084
+ schema?: string;
13085
+ /**
13086
+ * Where to read settings from:
13087
+ * - 'database' (default): Read/write beta_settings table
13088
+ * - 'env': Read from environment variables, write is a no-op
13089
+ */
13090
+ settingsSource?: "database" | "env";
13091
+ /**
13092
+ * Environment variable prefix when settingsSource is 'env'.
13093
+ * Maps to: {PREFIX}_MODE, {PREFIX}_REQUIRE_INVITE_CODE, {PREFIX}_MESSAGE
13094
+ * Default: 'BETA'
13095
+ */
13096
+ envPrefix?: string;
13097
+ /**
13098
+ * Additional static codes that are always valid (e.g., from env vars).
13099
+ * These bypass database lookup entirely.
13100
+ * Useful for default/hardcoded codes like 'DLLBETA', 'EARLYACCESS'.
13101
+ */
13102
+ staticCodes?: string[];
13103
+ }
13104
+ declare class PostgresBeta implements IBeta {
13105
+ private pool;
13106
+ private schema;
13107
+ private settingsSource;
13108
+ private envPrefix;
13109
+ private staticCodes;
13110
+ private config;
13111
+ constructor(pgConfig: PostgresBetaConfig);
13112
+ private t;
13113
+ /**
13114
+ * Initialize beta tables. Call once at app startup.
13115
+ * Creates tables if they don't exist and seeds default settings.
13116
+ */
13117
+ initialize(): Promise<void>;
13118
+ getSettings(): Promise<BetaSettings>;
13119
+ private getEnvSettings;
13120
+ updateSettings(options: UpdateBetaSettingsOptions): Promise<void>;
13121
+ createCodes(options: CreateBetaCodesOptions): Promise<BetaInviteCode[]>;
13122
+ listCodes(options?: ListBetaCodesOptions): Promise<BetaInviteCode[]>;
13123
+ getCode(code: string): Promise<BetaInviteCode | null>;
13124
+ revokeCode(code: string): Promise<void>;
13125
+ validateCode(code: string): Promise<BetaValidationResult>;
13126
+ consumeCode(code: string, userId: string): Promise<BetaConsumeResult>;
13127
+ private tagBetaTester;
13128
+ isBetaTester(userId: string): Promise<boolean>;
13129
+ getBetaTester(userId: string): Promise<BetaTester | null>;
13130
+ listBetaTesters(options?: {
13131
+ offset?: number;
13132
+ limit?: number;
13133
+ }): Promise<BetaTester[]>;
13134
+ getStats(): Promise<BetaStats>;
13135
+ getCodeUsageReports(): Promise<BetaCodeUsageReport[]>;
13136
+ healthCheck(): Promise<boolean>;
13137
+ }
13138
+
13044
13139
  /**
13045
13140
  * Application Logger
13046
13141
  *
@@ -13176,4 +13271,4 @@ declare function getSharedRedis(): Redis$2 | null;
13176
13271
  */
13177
13272
  declare function closeSharedRedis(): Promise<void>;
13178
13273
 
13179
- export { AIChatRequest, AIChatResponse, AICompletionRequest, AICompletionResponse, AIConfig, AIEmbeddingRequest, AIEmbeddingResponse, AIModelConfig, AIModelType, AIProvider, AIStreamCallback, AIStreamChunk, type AIUsageConfig, type AccountCapabilities, type AccountLink, type AccountType, type Address, type AlertType, AnthropicAdapter, type AnthropicAdapterConfig, type ApiAuthentication, type ApiChangelog, type ApiDocumentation, type ApiEndpoint, type ApiExample, type ApiKey, type ApiKeyStatus, type ApiKeyType, type ApiKeyValidationResult, type ApiParameter, type ApiResponse, type ApiSchema, type ApiSchemaProperty, type ApiUsageStats, type ApiUsageTimeSeries, type AppLogContext, type AppLogger, type AppLoggerOptions, AssembledContext, type AuditActor, type AuditCategory, type AuditEvent, AuditEvents, type AuditEvidence, type AuditLogConfig, type AuditOutcome, type AuditQuery, type AuditQueryResult, type AuditRetentionPolicy, type AuditStats, type AuditTarget, type AuthConfig, type AuthError, type AuthErrorCode, AuthErrorMessages, type AuthEventType, type AuthResult, type AuthSession, type AuthStateChangeCallback, type AuthStorage, type AuthUser, type Balance, type BalanceAmount, type BankAccountDetails, type BatchNotificationOptions, type BillingConfig, type BillingDetails, type BillingPeriod, type Breadcrumb, type Budget, type BudgetStatus, BulkIngestionResult, Bulkhead, type BulkheadOptions, BulkheadRegistry, BulkheadRejectedError, type BulkheadStats, type BullMQConfig, BullMQQueue, type BusinessProfile, type CancelationReason, type CaptureOptions, type CapturePaymentIntentOptions, type CardBrand, type CardDetails, type ChainExecutionResult, CircuitBreaker, type CircuitBreakerOptions, CircuitBreakerRegistry, type CircuitBreakerStats, CircuitOpenError, type CircuitState, type CommandStatus, type ComplianceConfig, type ComplianceReport, type ConfirmPaymentIntentOptions, type ConnectedAccount, type ConnectedAccountStatus, type ConsentPreferences, type ConsentPurpose, type ConsentRecord, type ConsentStatus, ContextAssemblyConfig, type ControlFramework, type ControlStatus, type CorrelationData, type CostBreakdown, type Coupon, type CreateAccountLinkOptions, type CreateApiKeyOptions, CreateCollectionOptions, type CreateConnectedAccountOptions, type CreateCustomerOptions, type CreateDsarOptions, type CreatePaymentIntentOptions, type CreatePayoutOptions, type CreateRefundOptions, type CreateSandboxOptions, type CreateScheduleOptions, type CreateTenantOptions, type CreateTransferOptions, type CreateWebhookOptions, type CreditBalance, type CreditTransaction, type CreditType, type CronExpression, CronPresets, CryptoKeyMetadata, type Currency, type Customer, DEFAULT_BULKHEAD_OPTIONS, DEFAULT_CIRCUIT_BREAKER_OPTIONS, DEFAULT_RETRY_OPTIONS, type DataBreachRecord, type DataCategory, type DataInventoryItem, type DataMap, type DataSensitivity, type DataSubjectRequest, type DataType, DatabaseAIUsage, type DatabaseAIUsageConfig, DatabaseAuditLog, type DatabaseAuditLogConfig, DatabaseBilling, type DatabaseBillingConfig, DatabaseCompliance, DatabaseErrorReporter, type DatabaseErrorReporterConfig, DatabaseNotification, type DatabaseNotificationConfig, DatabasePromptStore, type DatabasePromptStoreConfig, DefaultTimeouts, type DeleteAccountOptions, type DeleteHookContext, type DeliveryAttempt, type DeliveryQuery, type DeliveryStatus, type DetailedHealthResponse, DeterministicEncryptedField, type DevPortalConfig, type DeveloperMetrics, type Device, type DeviceAuthMethod, type DeviceCommand, type DeviceConfig, type DeviceConnectionState, type DeviceCredentials, type DeviceGroup, type DeviceGroupQuery, type DeviceLocation, type DeviceQuery, type DeviceQueryResult, type DeviceShadow, type DeviceStatus, type DirectoryAttributeMapping, type DirectoryConfig, DocumentStatus, type DsarAttachment, type DsarNote, type DsarStatus, type DsarType, type DunningActionType, type DunningAttempt, type DunningConfig, type EmailHookContext, EmailMessage, EmailResult, EncryptOptions, EncryptedField, type EnrollMfaOptions, type EnrollMfaResult, type ErrorContext, type ErrorHookContext, type ErrorLevel, type ErrorReport, type ErrorReporterConfig, type EvidenceType, type ExperimentMetrics, type FallbackOptions, type FallbackResult, FallbackStrategies, type FirmwareStatus, type FirmwareUpdate, type FirmwareVersion, type GeneratedSdk, GenericOIDCAuthSSO, type GenericOIDCConfig, GoogleAIAdapter, type GoogleAIAdapterConfig, type HealthCheckResult, type HealthEndpoints, type HealthEndpointsOptions, type HealthStatus, type HookRegistry, type HttpMethod, HttpWebhook, type HttpWebhookConfig, IAI, type IAIUsage, type IAuditLog, type IAuth, type IAuthSSO, type IBilling, ICache, type ICompliance, ICrypto, IDatabase, type IDevPortal, type IDevice, IEmail, type IErrorReporter, type IHealth, type IHealthCheckable, ILogger, IMetrics, type INotification, type IPayment, IPlatform, type IPromptStore, IQueryBuilder, IQueue, IRAG, type IScheduler, IStorage, type ITenant, type IWebhook, type InboundWebhookConfig, type InboundWebhookContext, IngestionOptions, IngestionResult, type InsertHookContext, type InviteMemberOptions, type Invoice, type InvoiceLineItem, type InvoiceQuery, type InvoiceStatus, Job, JobEventHandler, JobEventType, type JobHookContext, JobOptions, JobState, KeyRotationResult, type ListTenantsOptions, type LivenessResponse, MemoryAIUsage, MemoryAuditLog, type MemoryAuditLogConfig, MemoryAuth, MemoryAuthSSO, MemoryBilling, MemoryCompliance, MemoryCrypto, MemoryDevPortal, MemoryDevice, MemoryErrorReporter, type MemoryErrorReporterConfig, MemoryNotification, type MemoryNotificationConfig, MemoryPayment, MemoryPromptStore, MemoryRateLimiterStorage, MemoryScheduler, type MemorySchedulerConfig, MemoryTenant, MemoryWebhook, type MemoryWebhookConfig, type Meter, type MetricsEndpoint, type MetricsEndpointOptions, MetricsSummary, type MfaChallenge, type MfaFactor, type MfaFactorType, type Middleware, type MiddlewareChain, type MiddlewareChainOptions, type MiddlewareContext, NodeCrypto, type NodeCryptoConfig, type NotificationAction, type NotificationCategory, type NotificationChannel, type NotificationConfig, type NotificationData, type NotificationPreferences, type NotificationPriority, type NotificationQuery, type NotificationResult, type NotificationStats, type NotificationStatus, type NotificationTarget, NotificationTemplates, type OAuthOptions, type OAuthProvider, type OAuthResult, type OidcAuthRequest, type OidcAuthResponse, type OidcClaimMapping, type OidcIdpConfig, OpenAIAdapter, type OpenAIAdapterConfig, type ParameterLocation, type PaymentConfig, type PaymentError, type PaymentErrorCode, PaymentErrorMessages, type PaymentEventType, type PaymentIntent, type PaymentMethod, type PaymentMethodType, type PaymentStatus, type PaymentWebhookEvent, type Payout, type PayoutStatus, type PiaMitigation, type PiaRisk, type PiaStatus, PineconeRAG, type PineconeRAGConfig, type PlatformHealthResult, PlatformHealthStatus, type PlatformHooks, type PostgresConfig, PostgresDatabase, PostgresTenant, type PostgresTenantConfig, type Price, type PricingModel, type PricingTier, type PrivacyImpactAssessment, type Product, type Prompt, type PromptChain, type PromptChainStep, type PromptExperiment, type PromptQuery, type PromptQueryResult, type PromptStatus, type PromptStoreConfig, type PromptType, type PromptUsageRecord, type PromptUsageStats, type PromptVariable, type PromptVariant, type PromptVersion, type ProvisioningConfig, type ProvisioningRequest, type ProvisioningResult, type ProvisioningStatus, type PushSubscription, type QueryHookContext, QueryResult, QueueScheduler, type QueueSchedulerConfig, type Quota, type QuotaStatus, type QuotaType, RAGChunk, RAGCollection, RAGConfig, RAGDocument, RAGPipeline, RAGSearchQuery, RAGSearchResponse, RAGSearchResult, type RateLimitAlgorithm, RateLimitError, type RateLimitInfo, RateLimitPresets, type RateLimiterStorage, type ReadinessResponse, type RecordConsentOptions, RedisCache, type RedisClientOptions, type RedisConfig, type Refund, type RefundReason, type RefundStatus, type RenderOptions, type RenderedPrompt, RepeatOptions, ResendEmail, type ResetPasswordOptions, type RetentionAction, type RetentionExecution, type RetentionPolicy, RetryConfigs, type RetryOptions, RetryPredicates, type RetryResult, type RevenueMetrics, type RiskLevel, S3Storage, type SamlAssertion, type SamlAttributeMapping, type SamlAuthRequest, type SamlAuthResponse, type SamlIdpConfig, type SamlNameIdFormat, type SamlSpConfig, type Sandbox, type SandboxConfig, type SandboxLimits, type SandboxStatus, type SandboxUsage, type ScheduleContext, type ScheduleExecution, type ScheduleHandler, type ScheduleQuery, type ScheduleState, type ScheduleUpdateOptions, type ScheduledJob, type SchedulerConfig, type SchedulerStats, type ScimConfig, type ScimUser, type SdkConfig, type SdkFile, type SdkLanguage, type SendCommandOptions, type SendNotificationOptions, type ServiceHealth, type ShadowDelta, type ShadowMetadata, type ShadowUpdate, type SignInWithEmailOptions, type SignInWithMagicLinkOptions, type SignInWithPhoneOptions, type SignUpWithEmailOptions, type SignatureAlgorithm, type SlidingWindowRateLimitOptions, type SmtpConfig, SmtpEmail, type SsoSession, type StartupResponse, StorageFile, type StoredAuditEvent, type StoredNotification, StripePayment, type StripePaymentConfig, type Subscription, type SubscriptionDiscount, type SubscriptionItem, type SubscriptionMetrics, type SubscriptionQuery, type SubscriptionStatus, SupabaseAuth, type SupabaseAuthConfig, SupabaseDatabase, SupabaseStorage, type SupabaseStorageConfig, type TaxBreakdown, type TelemetryMessage, type TelemetryQuery, type TelemetryResult, type Tenant, type TenantBranding, type TenantContext, type TenantDatabaseConfig, type TenantInvitation, type TenantIsolationModel, type TenantMember, type TenantMemberStatus, type TenantQuotas, type TenantResolutionOptions, type TenantResolutionStrategy, type TenantRole, type TenantSecuritySettings, type TenantSettings, type TenantStatus, type TenantUsage, TimeoutError, type TimeoutOptions, type TokenBucketOptions, type TosAcceptance, type Transfer, type TransferStatus, type Unsubscribe, type UpdateCustomerOptions, type UpdateHookContext, type UpdatePasswordOptions, type UpdatePaymentIntentOptions, type UpdateScheduleOptions, type UpdateStatus, type UpdateTenantOptions, type UpdateUserOptions, type UpdateWebhookOptions, type UploadHookContext, UploadOptions, UpstashCache, type UsageAlert, type UsageCategory, type UsageEvent, type UsageInterval, type UsageInvoice, type UsageInvoiceItem, type UsageQuery, type UsageQueryResult, type UsageRecord, type UsageSummary, type UsageSummaryRecord, type UsageTrend, type VerificationResult, type VerifyMfaOptions, type VerifyPhoneOtpOptions, type VerifyWebhookOptions, WeaviateRAG, type WeaviateRAGConfig, type WebhookConfig, type WebhookDelivery, type WebhookEndpoint, type WebhookEvent, WebhookEventTypes, type WebhookQuery, type WebhookState, type WebhookStats, type WebhookTestEndpoint, type WebhookTestEvent, calculateRetryDelay, closeSharedRedis, composeHookRegistries, correlationContext, createAnthropicAdapter, createAppLogger, createAuthError, createBulkhead, createCacheMiddleware, createCachedFallback, createCircuitBreaker, createDefaultPreferences, createErrorReport, createExpressHealthHandlers, createExpressMetricsHandler, createGoogleAIAdapter, createHealthEndpoints, createHealthServer, createHookRegistry, createIpKeyGenerator, createJobContext, createLoggingMiddleware, createMetricsEndpoint, createMetricsMiddleware, createMetricsServer, createMiddlewareChain, createMiddlewareContext, createObservabilityServer, createOpenAIAdapter, createPaymentError, createPineconeRAG, createRateLimitMiddleware, createRedisClient, createRequestContext, createRequestIdMiddleware, createSlowQueryMiddleware, createTenantMiddleware, createTimeoutMiddleware, createUserKeyGenerator, createWeaviateRAG, describeCron, filterChannelsByPreferences, formatAmount, generateAuditId, generateChecksum, generateDeliveryId, generateErrorId, generateEventId, generateFingerprint, generateNotificationId, generatePaymentId, generateScheduleId, generateSecureToken, generateWebhookId, generateWebhookSecret, getContext, getLogMeta, getNextCronRun, getRequestId, getSharedRedis, getTenantId, getTraceId, getUserId, isAuthError, isInContext, isInQuietHours, isPaymentError, isValidCron, matchAction, matchEventType, raceTimeout, retryable, runWithContext, runWithContextAsync, timedHealthCheck, toHealthCheckResult, withCorrelation, withCorrelationAsync, withFallback, withFallbackChain, withFallbackResult, withRetry, withRetryResult, withTimeout, withTimeoutWrapper };
13274
+ export { AIChatRequest, AIChatResponse, AICompletionRequest, AICompletionResponse, AIConfig, AIEmbeddingRequest, AIEmbeddingResponse, AIModelConfig, AIModelType, AIProvider, AIStreamCallback, AIStreamChunk, type AIUsageConfig, type AccountCapabilities, type AccountLink, type AccountType, type Address, type AlertType, AnthropicAdapter, type AnthropicAdapterConfig, type ApiAuthentication, type ApiChangelog, type ApiDocumentation, type ApiEndpoint, type ApiExample, type ApiKey, type ApiKeyStatus, type ApiKeyType, type ApiKeyValidationResult, type ApiParameter, type ApiResponse, type ApiSchema, type ApiSchemaProperty, type ApiUsageStats, type ApiUsageTimeSeries, type AppLogContext, type AppLogger, type AppLoggerOptions, AssembledContext, type AuditActor, type AuditCategory, type AuditEvent, AuditEvents, type AuditEvidence, type AuditLogConfig, type AuditOutcome, type AuditQuery, type AuditQueryResult, type AuditRetentionPolicy, type AuditStats, type AuditTarget, type AuthConfig, type AuthError, type AuthErrorCode, AuthErrorMessages, type AuthEventType, type AuthResult, type AuthSession, type AuthStateChangeCallback, type AuthStorage, type AuthUser, type Balance, type BalanceAmount, type BankAccountDetails, type BatchNotificationOptions, BetaCodeUsageReport, BetaConfig, BetaConsumeResult, BetaInviteCode, BetaSettings, BetaStats, BetaTester, BetaValidationResult, type BillingConfig, type BillingDetails, type BillingPeriod, type Breadcrumb, type Budget, type BudgetStatus, BulkIngestionResult, Bulkhead, type BulkheadOptions, BulkheadRegistry, BulkheadRejectedError, type BulkheadStats, type BullMQConfig, BullMQQueue, type BusinessProfile, type CancelationReason, type CaptureOptions, type CapturePaymentIntentOptions, type CardBrand, type CardDetails, type ChainExecutionResult, CircuitBreaker, type CircuitBreakerOptions, CircuitBreakerRegistry, type CircuitBreakerStats, CircuitOpenError, type CircuitState, type CommandStatus, type ComplianceConfig, type ComplianceReport, type ConfirmPaymentIntentOptions, type ConnectedAccount, type ConnectedAccountStatus, type ConsentPreferences, type ConsentPurpose, type ConsentRecord, type ConsentStatus, ContextAssemblyConfig, type ControlFramework, type ControlStatus, type CorrelationData, type CostBreakdown, type Coupon, type CreateAccountLinkOptions, type CreateApiKeyOptions, CreateBetaCodesOptions, CreateCollectionOptions, type CreateConnectedAccountOptions, type CreateCustomerOptions, type CreateDsarOptions, type CreatePaymentIntentOptions, type CreatePayoutOptions, type CreateRefundOptions, type CreateSandboxOptions, type CreateScheduleOptions, type CreateTenantOptions, type CreateTransferOptions, type CreateWebhookOptions, type CreditBalance, type CreditTransaction, type CreditType, type CronExpression, CronPresets, CryptoKeyMetadata, type Currency, type Customer, DEFAULT_BULKHEAD_OPTIONS, DEFAULT_CIRCUIT_BREAKER_OPTIONS, DEFAULT_RETRY_OPTIONS, type DataBreachRecord, type DataCategory, type DataInventoryItem, type DataMap, type DataSensitivity, type DataSubjectRequest, type DataType, DatabaseAIUsage, type DatabaseAIUsageConfig, DatabaseAuditLog, type DatabaseAuditLogConfig, DatabaseBilling, type DatabaseBillingConfig, DatabaseCompliance, DatabaseErrorReporter, type DatabaseErrorReporterConfig, DatabaseNotification, type DatabaseNotificationConfig, DatabasePromptStore, type DatabasePromptStoreConfig, DefaultTimeouts, type DeleteAccountOptions, type DeleteHookContext, type DeliveryAttempt, type DeliveryQuery, type DeliveryStatus, type DetailedHealthResponse, DeterministicEncryptedField, type DevPortalConfig, type DeveloperMetrics, type Device, type DeviceAuthMethod, type DeviceCommand, type DeviceConfig, type DeviceConnectionState, type DeviceCredentials, type DeviceGroup, type DeviceGroupQuery, type DeviceLocation, type DeviceQuery, type DeviceQueryResult, type DeviceShadow, type DeviceStatus, type DirectoryAttributeMapping, type DirectoryConfig, DocumentStatus, type DsarAttachment, type DsarNote, type DsarStatus, type DsarType, type DunningActionType, type DunningAttempt, type DunningConfig, type EmailHookContext, EmailMessage, EmailResult, EncryptOptions, EncryptedField, type EnrollMfaOptions, type EnrollMfaResult, type ErrorContext, type ErrorHookContext, type ErrorLevel, type ErrorReport, type ErrorReporterConfig, type EvidenceType, type ExperimentMetrics, type FallbackOptions, type FallbackResult, FallbackStrategies, type FirmwareStatus, type FirmwareUpdate, type FirmwareVersion, type GeneratedSdk, GenericOIDCAuthSSO, type GenericOIDCConfig, GoogleAIAdapter, type GoogleAIAdapterConfig, type HealthCheckResult, type HealthEndpoints, type HealthEndpointsOptions, type HealthStatus, type HookRegistry, type HttpMethod, HttpWebhook, type HttpWebhookConfig, IAI, type IAIUsage, type IAuditLog, type IAuth, type IAuthSSO, IBeta, type IBilling, ICache, type ICompliance, ICrypto, IDatabase, type IDevPortal, type IDevice, IEmail, type IErrorReporter, type IHealth, type IHealthCheckable, ILogger, IMetrics, type INotification, type IPayment, IPlatform, type IPromptStore, IQueryBuilder, IQueue, IRAG, type IScheduler, IStorage, type ITenant, type IWebhook, type InboundWebhookConfig, type InboundWebhookContext, IngestionOptions, IngestionResult, type InsertHookContext, type InviteMemberOptions, type Invoice, type InvoiceLineItem, type InvoiceQuery, type InvoiceStatus, Job, JobEventHandler, JobEventType, type JobHookContext, JobOptions, JobState, KeyRotationResult, ListBetaCodesOptions, type ListTenantsOptions, type LivenessResponse, MemoryAIUsage, MemoryAuditLog, type MemoryAuditLogConfig, MemoryAuth, MemoryAuthSSO, MemoryBilling, MemoryCompliance, MemoryCrypto, MemoryDevPortal, MemoryDevice, MemoryErrorReporter, type MemoryErrorReporterConfig, MemoryNotification, type MemoryNotificationConfig, MemoryPayment, MemoryPromptStore, MemoryRateLimiterStorage, MemoryScheduler, type MemorySchedulerConfig, MemoryTenant, MemoryWebhook, type MemoryWebhookConfig, type Meter, type MetricsEndpoint, type MetricsEndpointOptions, MetricsSummary, type MfaChallenge, type MfaFactor, type MfaFactorType, type Middleware, type MiddlewareChain, type MiddlewareChainOptions, type MiddlewareContext, NodeCrypto, type NodeCryptoConfig, type NotificationAction, type NotificationCategory, type NotificationChannel, type NotificationConfig, type NotificationData, type NotificationPreferences, type NotificationPriority, type NotificationQuery, type NotificationResult, type NotificationStats, type NotificationStatus, type NotificationTarget, NotificationTemplates, type OAuthOptions, type OAuthProvider, type OAuthResult, type OidcAuthRequest, type OidcAuthResponse, type OidcClaimMapping, type OidcIdpConfig, OpenAIAdapter, type OpenAIAdapterConfig, type ParameterLocation, type PaymentConfig, type PaymentError, type PaymentErrorCode, PaymentErrorMessages, type PaymentEventType, type PaymentIntent, type PaymentMethod, type PaymentMethodType, type PaymentStatus, type PaymentWebhookEvent, type Payout, type PayoutStatus, type PiaMitigation, type PiaRisk, type PiaStatus, PineconeRAG, type PineconeRAGConfig, type PlatformHealthResult, PlatformHealthStatus, type PlatformHooks, PostgresBeta, type PostgresBetaConfig, type PostgresConfig, PostgresDatabase, PostgresTenant, type PostgresTenantConfig, type Price, type PricingModel, type PricingTier, type PrivacyImpactAssessment, type Product, type Prompt, type PromptChain, type PromptChainStep, type PromptExperiment, type PromptQuery, type PromptQueryResult, type PromptStatus, type PromptStoreConfig, type PromptType, type PromptUsageRecord, type PromptUsageStats, type PromptVariable, type PromptVariant, type PromptVersion, type ProvisioningConfig, type ProvisioningRequest, type ProvisioningResult, type ProvisioningStatus, type PushSubscription, type QueryHookContext, QueryResult, QueueScheduler, type QueueSchedulerConfig, type Quota, type QuotaStatus, type QuotaType, RAGChunk, RAGCollection, RAGConfig, RAGDocument, RAGPipeline, RAGSearchQuery, RAGSearchResponse, RAGSearchResult, type RateLimitAlgorithm, RateLimitError, type RateLimitInfo, RateLimitPresets, type RateLimiterStorage, type ReadinessResponse, type RecordConsentOptions, RedisCache, type RedisClientOptions, type RedisConfig, type Refund, type RefundReason, type RefundStatus, type RenderOptions, type RenderedPrompt, RepeatOptions, ResendEmail, type ResetPasswordOptions, type RetentionAction, type RetentionExecution, type RetentionPolicy, RetryConfigs, type RetryOptions, RetryPredicates, type RetryResult, type RevenueMetrics, type RiskLevel, S3Storage, type SamlAssertion, type SamlAttributeMapping, type SamlAuthRequest, type SamlAuthResponse, type SamlIdpConfig, type SamlNameIdFormat, type SamlSpConfig, type Sandbox, type SandboxConfig, type SandboxLimits, type SandboxStatus, type SandboxUsage, type ScheduleContext, type ScheduleExecution, type ScheduleHandler, type ScheduleQuery, type ScheduleState, type ScheduleUpdateOptions, type ScheduledJob, type SchedulerConfig, type SchedulerStats, type ScimConfig, type ScimUser, type SdkConfig, type SdkFile, type SdkLanguage, type SendCommandOptions, type SendNotificationOptions, type ServiceHealth, type ShadowDelta, type ShadowMetadata, type ShadowUpdate, type SignInWithEmailOptions, type SignInWithMagicLinkOptions, type SignInWithPhoneOptions, type SignUpWithEmailOptions, type SignatureAlgorithm, type SlidingWindowRateLimitOptions, type SmtpConfig, SmtpEmail, type SsoSession, type StartupResponse, StorageFile, type StoredAuditEvent, type StoredNotification, StripePayment, type StripePaymentConfig, type Subscription, type SubscriptionDiscount, type SubscriptionItem, type SubscriptionMetrics, type SubscriptionQuery, type SubscriptionStatus, SupabaseAuth, type SupabaseAuthConfig, SupabaseDatabase, SupabaseStorage, type SupabaseStorageConfig, type TaxBreakdown, type TelemetryMessage, type TelemetryQuery, type TelemetryResult, type Tenant, type TenantBranding, type TenantContext, type TenantDatabaseConfig, type TenantInvitation, type TenantIsolationModel, type TenantMember, type TenantMemberStatus, type TenantQuotas, type TenantResolutionOptions, type TenantResolutionStrategy, type TenantRole, type TenantSecuritySettings, type TenantSettings, type TenantStatus, type TenantUsage, TimeoutError, type TimeoutOptions, type TokenBucketOptions, type TosAcceptance, type Transfer, type TransferStatus, type Unsubscribe, UpdateBetaSettingsOptions, type UpdateCustomerOptions, type UpdateHookContext, type UpdatePasswordOptions, type UpdatePaymentIntentOptions, type UpdateScheduleOptions, type UpdateStatus, type UpdateTenantOptions, type UpdateUserOptions, type UpdateWebhookOptions, type UploadHookContext, UploadOptions, UpstashCache, type UsageAlert, type UsageCategory, type UsageEvent, type UsageInterval, type UsageInvoice, type UsageInvoiceItem, type UsageQuery, type UsageQueryResult, type UsageRecord, type UsageSummary, type UsageSummaryRecord, type UsageTrend, type VerificationResult, type VerifyMfaOptions, type VerifyPhoneOtpOptions, type VerifyWebhookOptions, WeaviateRAG, type WeaviateRAGConfig, type WebhookConfig, type WebhookDelivery, type WebhookEndpoint, type WebhookEvent, WebhookEventTypes, type WebhookQuery, type WebhookState, type WebhookStats, type WebhookTestEndpoint, type WebhookTestEvent, calculateRetryDelay, closeSharedRedis, composeHookRegistries, correlationContext, createAnthropicAdapter, createAppLogger, createAuthError, createBulkhead, createCacheMiddleware, createCachedFallback, createCircuitBreaker, createDefaultPreferences, createErrorReport, createExpressHealthHandlers, createExpressMetricsHandler, createGoogleAIAdapter, createHealthEndpoints, createHealthServer, createHookRegistry, createIpKeyGenerator, createJobContext, createLoggingMiddleware, createMetricsEndpoint, createMetricsMiddleware, createMetricsServer, createMiddlewareChain, createMiddlewareContext, createObservabilityServer, createOpenAIAdapter, createPaymentError, createPineconeRAG, createRateLimitMiddleware, createRedisClient, createRequestContext, createRequestIdMiddleware, createSlowQueryMiddleware, createTenantMiddleware, createTimeoutMiddleware, createUserKeyGenerator, createWeaviateRAG, describeCron, filterChannelsByPreferences, formatAmount, generateAuditId, generateChecksum, generateDeliveryId, generateErrorId, generateEventId, generateFingerprint, generateNotificationId, generatePaymentId, generateScheduleId, generateSecureToken, generateWebhookId, generateWebhookSecret, getContext, getLogMeta, getNextCronRun, getRequestId, getSharedRedis, getTenantId, getTraceId, getUserId, isAuthError, isInContext, isInQuietHours, isPaymentError, isValidCron, matchAction, matchEventType, raceTimeout, retryable, runWithContext, runWithContextAsync, timedHealthCheck, toHealthCheckResult, withCorrelation, withCorrelationAsync, withFallback, withFallbackChain, withFallbackResult, withRetry, withRetryResult, withTimeout, withTimeoutWrapper };