@xylex-group/athena 2.6.0 → 2.7.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 +1 -1
- package/dist/browser.cjs +837 -114
- package/dist/browser.cjs.map +1 -1
- package/dist/browser.d.cts +7 -7
- package/dist/browser.d.ts +7 -7
- package/dist/browser.js +837 -114
- package/dist/browser.js.map +1 -1
- package/dist/cli/index.cjs +830 -107
- package/dist/cli/index.cjs.map +1 -1
- package/dist/cli/index.d.cts +3 -3
- package/dist/cli/index.d.ts +3 -3
- package/dist/cli/index.js +830 -107
- package/dist/cli/index.js.map +1 -1
- package/dist/cookies.cjs +10 -3
- package/dist/cookies.cjs.map +1 -1
- package/dist/cookies.js +10 -3
- package/dist/cookies.js.map +1 -1
- package/dist/index.cjs +837 -114
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -7
- package/dist/index.d.ts +7 -7
- package/dist/index.js +837 -114
- package/dist/index.js.map +1 -1
- package/dist/model-form-AKYrgede.d.ts +2772 -0
- package/dist/model-form-ehfqLuG7.d.cts +2772 -0
- package/dist/{pipeline-Ce3pTw5h.d.ts → pipeline-BUsR9XlO.d.ts} +1 -1
- package/dist/{pipeline-D1ZYeoH7.d.cts → pipeline-BfCWSRYl.d.cts} +1 -1
- package/dist/react-email-BQzmXBDE.d.cts +304 -0
- package/dist/react-email-BrVRp80B.d.ts +304 -0
- package/dist/react.cjs +178 -71
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +22 -5
- package/dist/react.d.ts +22 -5
- package/dist/react.js +92 -5
- package/dist/react.js.map +1 -1
- package/dist/{types-CUuo4NDi.d.cts → types-BSIsyss1.d.cts} +1 -1
- package/dist/{types-DSX6AT5B.d.cts → types-BsyRW49r.d.cts} +1 -1
- package/dist/{types-DSX6AT5B.d.ts → types-BsyRW49r.d.ts} +1 -1
- package/dist/{types-DapchQY5.d.ts → types-t_TVqnmp.d.ts} +1 -1
- package/package.json +193 -193
- package/dist/model-form-BaHWi3gm.d.cts +0 -1383
- package/dist/model-form-Dh6gWjL0.d.ts +0 -1383
- package/dist/react-email-B8O1Jeff.d.cts +0 -1230
- package/dist/react-email-CDEF0jij.d.ts +0 -1230
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { R as RunGeneratorOptions, l as RunGeneratorResult } from './types-
|
|
1
|
+
import { R as RunGeneratorOptions, l as RunGeneratorResult } from './types-t_TVqnmp.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* End-to-end generator execution: load config, introspect, render, and optionally write files.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { R as RunGeneratorOptions, l as RunGeneratorResult } from './types-
|
|
1
|
+
import { R as RunGeneratorOptions, l as RunGeneratorResult } from './types-BSIsyss1.cjs';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* End-to-end generator execution: load config, introspect, render, and optionally write files.
|
|
@@ -0,0 +1,304 @@
|
|
|
1
|
+
import { b as AthenaGatewayConnectionOptions, c as AthenaGatewayConnectionResult, F as SchemaDef, J as AnyModelDef, D as DatabaseDef, y as ModelMetadata, x as ModelDef, R as RegistryDef, H as TenantKeyMap, T as TenantContext, E as RowOf, M as ModelAt, q as InsertOf, U as UpdateOf, a as AthenaGatewayCallOptions, S as SchemaIntrospectionProvider, r as IntrospectionColumn } from './types-BsyRW49r.cjs';
|
|
2
|
+
import { av as AthenaSdkClient, bz as TableQueryBuilder, f as AthenaAuthClientConfig, N as AthenaAuthSdkClient, F as AthenaAuthReactEmailProps, C as AthenaAuthReactEmailComponent, H as AthenaAuthReactEmailRenderInput, k as AthenaAuthEmailTemplateDefinition, i as AthenaAuthEmailTemplateBuilder, I as AthenaAuthReactEmailRenderOptions, G as AthenaAuthReactEmailRenderEvent, D as AthenaAuthReactEmailConfig } from './model-form-ehfqLuG7.cjs';
|
|
3
|
+
import { j as GeneratorSchemaSelection, b as GeneratorProviderConfig } from './types-BSIsyss1.cjs';
|
|
4
|
+
import { A as AthenaCookiesOptions, a as AthenaSessionPair, b as AthenaCookieOptions, c as AthenaAuthCookies, g as getCookieCache, d as getSessionCookie, e as AthenaCookieContextRuntime } from './index-CVcQCGyG.cjs';
|
|
5
|
+
|
|
6
|
+
declare function verifyAthenaGatewayUrl(baseUrl: string, options?: AthenaGatewayConnectionOptions): Promise<AthenaGatewayConnectionResult>;
|
|
7
|
+
|
|
8
|
+
interface NormalizeAthenaGatewayBaseUrlOptions {
|
|
9
|
+
defaultBaseUrl?: string;
|
|
10
|
+
label?: string;
|
|
11
|
+
}
|
|
12
|
+
declare function normalizeAthenaGatewayBaseUrl(input: string | null | undefined, options?: NormalizeAthenaGatewayBaseUrlOptions): string;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Immutable identifier object with consistent SQL rendering.
|
|
16
|
+
*/
|
|
17
|
+
interface SqlIdentifier {
|
|
18
|
+
readonly segments: string[];
|
|
19
|
+
toSql(): string;
|
|
20
|
+
toString(): string;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Creates a quoted identifier object from segment or dotted inputs.
|
|
24
|
+
*/
|
|
25
|
+
declare function identifier(...segments: string[]): SqlIdentifier;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Declares a model contract with explicit metadata and typed row/insert/update shapes.
|
|
29
|
+
*/
|
|
30
|
+
declare function defineModel<Row, Insert = Partial<Row>, Update = Partial<Insert>, Meta extends ModelMetadata<Row> = ModelMetadata<Row>>(input: {
|
|
31
|
+
meta: Meta;
|
|
32
|
+
}): ModelDef<Row, Insert, Update, Meta>;
|
|
33
|
+
/**
|
|
34
|
+
* Declares a schema-level model map.
|
|
35
|
+
*/
|
|
36
|
+
declare function defineSchema<Models extends Record<string, AnyModelDef>>(models: Models): SchemaDef<Models>;
|
|
37
|
+
/**
|
|
38
|
+
* Declares a database-level schema map.
|
|
39
|
+
*/
|
|
40
|
+
declare function defineDatabase<Schemas extends Record<string, SchemaDef<Record<string, AnyModelDef>>>>(schemas: Schemas): DatabaseDef<Schemas>;
|
|
41
|
+
/**
|
|
42
|
+
* Declares a top-level multi-database registry.
|
|
43
|
+
*/
|
|
44
|
+
declare function defineRegistry<Databases extends Record<string, DatabaseDef<Record<string, SchemaDef<Record<string, AnyModelDef>>>>>>(databases: Databases): RegistryDef<Databases>;
|
|
45
|
+
|
|
46
|
+
type RegistryConstraint = RegistryDef<Record<string, DatabaseDef<Record<string, SchemaDef<Record<string, AnyModelDef>>>>>>;
|
|
47
|
+
/**
|
|
48
|
+
* Options for creating typed Athena clients.
|
|
49
|
+
*/
|
|
50
|
+
interface TypedClientOptions<TMap extends TenantKeyMap = TenantKeyMap> extends Pick<AthenaGatewayCallOptions, 'backend' | 'client' | 'headers'> {
|
|
51
|
+
tenantKeyMap?: TMap;
|
|
52
|
+
tenantContext?: TenantContext<TMap>;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Typed Athena client with registry-driven model resolution and tenant-context propagation.
|
|
56
|
+
*/
|
|
57
|
+
interface TypedAthenaClient<TRegistry extends RegistryConstraint, TTenantMap extends TenantKeyMap = Record<never, string>> extends AthenaSdkClient {
|
|
58
|
+
readonly registry: TRegistry;
|
|
59
|
+
readonly tenantKeyMap: Readonly<TTenantMap>;
|
|
60
|
+
readonly tenantContext: TenantContext<TTenantMap>;
|
|
61
|
+
withTenantContext(context: TenantContext<TTenantMap>): TypedAthenaClient<TRegistry, TTenantMap>;
|
|
62
|
+
fromModel<TDatabase extends keyof TRegistry & string, TSchema extends keyof TRegistry[TDatabase]['schemas'] & string, TModel extends keyof TRegistry[TDatabase]['schemas'][TSchema]['models'] & string>(database: TDatabase, schema: TSchema, model: TModel): TableQueryBuilder<RowOf<ModelAt<TRegistry, TDatabase, TSchema, TModel>>, InsertOf<ModelAt<TRegistry, TDatabase, TSchema, TModel>>, UpdateOf<ModelAt<TRegistry, TDatabase, TSchema, TModel>>, {
|
|
63
|
+
registry: TRegistry;
|
|
64
|
+
database: TDatabase;
|
|
65
|
+
schema: TSchema;
|
|
66
|
+
model: ModelAt<TRegistry, TDatabase, TSchema, TModel>;
|
|
67
|
+
}>;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Creates a typed client bound to a registry contract and optional tenant header mapping.
|
|
71
|
+
*/
|
|
72
|
+
declare function createTypedClient<TRegistry extends RegistryConstraint, TTenantMap extends TenantKeyMap = Record<never, string>>(registry: TRegistry, url: string, apiKey: string, options?: TypedClientOptions<TTenantMap>): TypedAthenaClient<TRegistry, TTenantMap>;
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Constructor options for the PostgreSQL introspection provider.
|
|
76
|
+
*/
|
|
77
|
+
interface PostgresIntrospectionProviderOptions {
|
|
78
|
+
connectionString: string;
|
|
79
|
+
database?: string;
|
|
80
|
+
schemas?: readonly string[];
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Creates a PostgreSQL-backed schema introspection provider.
|
|
84
|
+
*/
|
|
85
|
+
declare function createPostgresIntrospectionProvider(options: PostgresIntrospectionProviderOptions): SchemaIntrospectionProvider;
|
|
86
|
+
|
|
87
|
+
interface GeneratorEnvBaseOptions<T> {
|
|
88
|
+
default?: T;
|
|
89
|
+
optional?: boolean;
|
|
90
|
+
}
|
|
91
|
+
type GeneratorEnvStringOptions = GeneratorEnvBaseOptions<string>;
|
|
92
|
+
type GeneratorEnvBooleanOptions = GeneratorEnvBaseOptions<boolean>;
|
|
93
|
+
interface GeneratorEnvListOptions extends GeneratorEnvBaseOptions<readonly string[]> {
|
|
94
|
+
separator?: string;
|
|
95
|
+
}
|
|
96
|
+
type GeneratorEnvJsonOptions<T> = GeneratorEnvBaseOptions<T>;
|
|
97
|
+
type GeneratorEnvOneOfOptions<T extends string> = GeneratorEnvBaseOptions<T>;
|
|
98
|
+
type GeneratorEnvHelper = {
|
|
99
|
+
(key: string, options?: GeneratorEnvStringOptions): string;
|
|
100
|
+
(key: string, options: GeneratorEnvStringOptions & {
|
|
101
|
+
optional: true;
|
|
102
|
+
}): string | undefined;
|
|
103
|
+
boolean(key: string, options?: GeneratorEnvBooleanOptions): boolean;
|
|
104
|
+
boolean(key: string, options: GeneratorEnvBooleanOptions & {
|
|
105
|
+
optional: true;
|
|
106
|
+
}): boolean | undefined;
|
|
107
|
+
list(key: string, options?: GeneratorEnvListOptions): string[];
|
|
108
|
+
list(key: string, options: GeneratorEnvListOptions & {
|
|
109
|
+
optional: true;
|
|
110
|
+
}): string[] | undefined;
|
|
111
|
+
json<T>(key: string, options?: GeneratorEnvJsonOptions<T>): T;
|
|
112
|
+
json<T>(key: string, options: GeneratorEnvJsonOptions<T> & {
|
|
113
|
+
optional: true;
|
|
114
|
+
}): T | undefined;
|
|
115
|
+
oneOf<const T extends string>(key: string, allowedValues: readonly T[], options?: GeneratorEnvOneOfOptions<T>): T;
|
|
116
|
+
oneOf<const T extends string>(key: string, allowedValues: readonly T[], options: GeneratorEnvOneOfOptions<T> & {
|
|
117
|
+
optional: true;
|
|
118
|
+
}): T | undefined;
|
|
119
|
+
};
|
|
120
|
+
/**
|
|
121
|
+
* Typed env reader for generator configs. This keeps `athena.config.*` files
|
|
122
|
+
* declarative while preserving exact field types for booleans, lists, unions,
|
|
123
|
+
* and JSON-backed objects.
|
|
124
|
+
*/
|
|
125
|
+
declare const generatorEnv: GeneratorEnvHelper;
|
|
126
|
+
|
|
127
|
+
declare function resolvePostgresColumnType(column: IntrospectionColumn): string;
|
|
128
|
+
|
|
129
|
+
declare const DEFAULT_POSTGRES_SCHEMAS: readonly ["public"];
|
|
130
|
+
/**
|
|
131
|
+
* Normalizes schema selection from config or env-backed strings into a stable,
|
|
132
|
+
* deduplicated list. Empty selections fall back to PostgreSQL's public schema.
|
|
133
|
+
*/
|
|
134
|
+
declare function normalizeSchemaSelection(input: GeneratorSchemaSelection | undefined): string[];
|
|
135
|
+
/**
|
|
136
|
+
* Resolves the effective schema list for provider-backed generator runs.
|
|
137
|
+
*/
|
|
138
|
+
declare function resolveProviderSchemas(providerConfig: GeneratorProviderConfig): string[];
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* @deprecated Prefer `createClient(...).auth` from `@xylex-group/athena`.
|
|
142
|
+
*/
|
|
143
|
+
declare function createAuthClient(config?: AthenaAuthClientConfig): AthenaAuthSdkClient;
|
|
144
|
+
|
|
145
|
+
type AthenaMaybePromise<T> = T | Promise<T>;
|
|
146
|
+
type AthenaAuthServerCookieOptions = Pick<AthenaCookiesOptions, 'session' | 'advanced'>;
|
|
147
|
+
declare const ATHENA_AUTH_BASE_ERROR_CODES: {
|
|
148
|
+
readonly HANDLER_NOT_CONFIGURED: "HANDLER_NOT_CONFIGURED";
|
|
149
|
+
readonly INVALID_BASE_URL: "INVALID_BASE_URL";
|
|
150
|
+
readonly UNTRUSTED_HOST: "UNTRUSTED_HOST";
|
|
151
|
+
};
|
|
152
|
+
interface AthenaAuthSocialProviderConfig {
|
|
153
|
+
clientId: string;
|
|
154
|
+
clientSecret: string;
|
|
155
|
+
scope?: string[];
|
|
156
|
+
[key: string]: unknown;
|
|
157
|
+
}
|
|
158
|
+
interface AthenaAuthPluginContext {
|
|
159
|
+
path?: string;
|
|
160
|
+
headers?: Headers;
|
|
161
|
+
context: {
|
|
162
|
+
returned?: unknown;
|
|
163
|
+
responseHeaders?: Headers;
|
|
164
|
+
setSession?: AthenaSessionPair | null;
|
|
165
|
+
clearSession?: boolean;
|
|
166
|
+
dontRememberMe?: boolean;
|
|
167
|
+
cookieOverrides?: Partial<AthenaCookieOptions>;
|
|
168
|
+
[key: string]: unknown;
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
interface AthenaAuthPluginHandlerContext extends AthenaAuthPluginContext {
|
|
172
|
+
auth: AthenaAuthServer;
|
|
173
|
+
}
|
|
174
|
+
interface AthenaAuthPlugin {
|
|
175
|
+
id: string;
|
|
176
|
+
version: string;
|
|
177
|
+
$ERROR_CODES?: Record<string, string>;
|
|
178
|
+
hooks?: {
|
|
179
|
+
after?: Array<{
|
|
180
|
+
matcher: (ctx: AthenaAuthPluginContext) => boolean;
|
|
181
|
+
handler: (ctx: AthenaAuthPluginHandlerContext) => Promise<void> | void;
|
|
182
|
+
}>;
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
interface AthenaAuthCookieRuntimeInput {
|
|
186
|
+
headers?: Headers;
|
|
187
|
+
responseHeaders?: Headers;
|
|
188
|
+
cookies?: AthenaAuthCookies;
|
|
189
|
+
getCookie?: (name: string) => string | null | undefined;
|
|
190
|
+
setCookie?: (name: string, value: string, attributes: AthenaCookieOptions) => void;
|
|
191
|
+
logger?: AthenaCookieContextRuntime['logger'];
|
|
192
|
+
setSignedCookie?: AthenaCookieContextRuntime['setSignedCookie'];
|
|
193
|
+
getSignedCookie?: AthenaCookieContextRuntime['getSignedCookie'];
|
|
194
|
+
setNewSession?: AthenaCookieContextRuntime['context']['setNewSession'];
|
|
195
|
+
}
|
|
196
|
+
interface AthenaAuthServerRuntimeOptions {
|
|
197
|
+
baseURL?: string;
|
|
198
|
+
basePath: string;
|
|
199
|
+
secret: string;
|
|
200
|
+
cookies: AthenaAuthServerCookieOptions;
|
|
201
|
+
}
|
|
202
|
+
type AthenaAuthDatabaseFactory<TDatabase = unknown> = (options: AthenaAuthServerRuntimeOptions) => TDatabase;
|
|
203
|
+
type AthenaAuthBaseURLConfig = AthenaCookiesOptions['baseURL'];
|
|
204
|
+
type AthenaAuthTrustedOrigins = string[] | ((request?: Request) => AthenaMaybePromise<string[]>);
|
|
205
|
+
type AthenaAuthTrustedProviders = string[] | ((request?: Request) => AthenaMaybePromise<string[]>);
|
|
206
|
+
interface AthenaAuthHandlerResult {
|
|
207
|
+
response?: Response;
|
|
208
|
+
returned?: unknown;
|
|
209
|
+
setSession?: AthenaSessionPair | null;
|
|
210
|
+
clearSession?: boolean;
|
|
211
|
+
dontRememberMe?: boolean;
|
|
212
|
+
cookieOverrides?: Partial<AthenaCookieOptions>;
|
|
213
|
+
}
|
|
214
|
+
interface AthenaAuthServerConfig<TDatabase = unknown> extends AthenaAuthServerCookieOptions {
|
|
215
|
+
baseURL?: AthenaAuthBaseURLConfig;
|
|
216
|
+
basePath?: string;
|
|
217
|
+
secret: string;
|
|
218
|
+
database: TDatabase | AthenaAuthDatabaseFactory<TDatabase>;
|
|
219
|
+
socialProviders?: Record<string, AthenaAuthSocialProviderConfig>;
|
|
220
|
+
trustedOrigins?: AthenaAuthTrustedOrigins;
|
|
221
|
+
trustedProviders?: AthenaAuthTrustedProviders;
|
|
222
|
+
api?: Record<string, unknown>;
|
|
223
|
+
errorCodes?: Record<string, string>;
|
|
224
|
+
handler?: (ctx: AthenaAuthRequestContext) => AthenaMaybePromise<Response | AthenaAuthHandlerResult>;
|
|
225
|
+
plugins?: AthenaAuthPlugin[];
|
|
226
|
+
}
|
|
227
|
+
type ResolveAthenaAuthDatabase<TConfig extends AthenaAuthServerConfig> = TConfig['database'] extends (...args: never[]) => infer TResult ? TResult : TConfig['database'];
|
|
228
|
+
interface AthenaAuthRequestContext<TConfig extends AthenaAuthServerConfig = AthenaAuthServerConfig> {
|
|
229
|
+
auth: AthenaAuthServer<TConfig>;
|
|
230
|
+
request: Request;
|
|
231
|
+
url: URL;
|
|
232
|
+
path: string;
|
|
233
|
+
basePath: string;
|
|
234
|
+
baseURL: string;
|
|
235
|
+
origin: string;
|
|
236
|
+
headers: Headers;
|
|
237
|
+
cookies: AthenaAuthCookies;
|
|
238
|
+
trustedOrigins: string[];
|
|
239
|
+
trustedProviders: string[];
|
|
240
|
+
options: TConfig;
|
|
241
|
+
runtime: AthenaAuthServerRuntimeOptions;
|
|
242
|
+
database: ResolveAthenaAuthDatabase<TConfig>;
|
|
243
|
+
socialProviders: NonNullable<TConfig['socialProviders']>;
|
|
244
|
+
}
|
|
245
|
+
interface AthenaAuthContext<TConfig extends AthenaAuthServerConfig = AthenaAuthServerConfig> {
|
|
246
|
+
auth: AthenaAuthServer<TConfig>;
|
|
247
|
+
options: TConfig;
|
|
248
|
+
runtime: AthenaAuthServerRuntimeOptions;
|
|
249
|
+
basePath: string;
|
|
250
|
+
baseURL?: string;
|
|
251
|
+
origin?: string;
|
|
252
|
+
database: ResolveAthenaAuthDatabase<TConfig>;
|
|
253
|
+
socialProviders: NonNullable<TConfig['socialProviders']>;
|
|
254
|
+
plugins: AthenaAuthPlugin[];
|
|
255
|
+
cookies: AthenaAuthCookies;
|
|
256
|
+
trustedOrigins: string[];
|
|
257
|
+
trustedProviders: string[];
|
|
258
|
+
}
|
|
259
|
+
interface AthenaAuthServerApi<TConfig extends AthenaAuthServerConfig = AthenaAuthServerConfig> {
|
|
260
|
+
applyResponseCookies: AthenaAuthServer<TConfig>['applyResponseCookies'];
|
|
261
|
+
clearSession: AthenaAuthServer<TConfig>['clearSession'];
|
|
262
|
+
createCookieContext: AthenaAuthServer<TConfig>['createCookieContext'];
|
|
263
|
+
getCookieCache: typeof getCookieCache;
|
|
264
|
+
getSessionCookie: typeof getSessionCookie;
|
|
265
|
+
resolveRequestContext: AthenaAuthServer<TConfig>['resolveRequestContext'];
|
|
266
|
+
runAfterHooks: AthenaAuthServer<TConfig>['runAfterHooks'];
|
|
267
|
+
setSession: AthenaAuthServer<TConfig>['setSession'];
|
|
268
|
+
}
|
|
269
|
+
interface AthenaAuthServer<TConfig extends AthenaAuthServerConfig = AthenaAuthServerConfig> {
|
|
270
|
+
config: TConfig;
|
|
271
|
+
options: TConfig;
|
|
272
|
+
runtime: AthenaAuthServerRuntimeOptions;
|
|
273
|
+
database: ResolveAthenaAuthDatabase<TConfig>;
|
|
274
|
+
socialProviders: NonNullable<TConfig['socialProviders']>;
|
|
275
|
+
plugins: AthenaAuthPlugin[];
|
|
276
|
+
cookies: AthenaAuthCookies;
|
|
277
|
+
api: AthenaAuthServerApi<TConfig> & Record<string, unknown>;
|
|
278
|
+
$context: Promise<AthenaAuthContext<TConfig>>;
|
|
279
|
+
$ERROR_CODES: Record<string, string>;
|
|
280
|
+
createCookieContext: (input?: AthenaAuthCookieRuntimeInput) => AthenaCookieContextRuntime;
|
|
281
|
+
setSession: (input: AthenaAuthCookieRuntimeInput | undefined, session: AthenaSessionPair, dontRememberMe?: boolean, overrides?: Partial<AthenaCookieOptions>) => Promise<void>;
|
|
282
|
+
clearSession: (input?: AthenaAuthCookieRuntimeInput, skipDontRememberMe?: boolean) => void;
|
|
283
|
+
applyResponseCookies: (ctx: AthenaAuthPluginContext) => Promise<Headers>;
|
|
284
|
+
runAfterHooks: (ctx: AthenaAuthPluginContext) => Promise<AthenaAuthPluginContext>;
|
|
285
|
+
resolveRequestContext: (request: Request) => Promise<AthenaAuthRequestContext<TConfig>>;
|
|
286
|
+
handler: (request: Request) => Promise<Response>;
|
|
287
|
+
}
|
|
288
|
+
declare function defineAthenaAuthConfig<TConfig extends AthenaAuthServerConfig>(config: TConfig): TConfig;
|
|
289
|
+
declare function athenaAuth<TConfig extends AthenaAuthServerConfig>(config: TConfig): AthenaAuthServer<TConfig>;
|
|
290
|
+
|
|
291
|
+
interface AthenaAuthRenderedReactEmail {
|
|
292
|
+
html: string;
|
|
293
|
+
text?: string;
|
|
294
|
+
}
|
|
295
|
+
interface AthenaAuthReactEmailRuntimeOptions {
|
|
296
|
+
route?: string;
|
|
297
|
+
defaults?: AthenaAuthReactEmailRenderOptions;
|
|
298
|
+
observe?: (event: AthenaAuthReactEmailRenderEvent) => void;
|
|
299
|
+
}
|
|
300
|
+
declare function createAuthReactEmailInput<TProps extends AthenaAuthReactEmailProps = AthenaAuthReactEmailProps>(component: AthenaAuthReactEmailComponent<TProps>, props: TProps, overrides?: Omit<AthenaAuthReactEmailRenderInput, 'component' | 'props' | 'element'>): AthenaAuthReactEmailRenderInput;
|
|
301
|
+
declare function defineAuthEmailTemplate<TProps extends AthenaAuthReactEmailProps = AthenaAuthReactEmailProps>(definition: AthenaAuthEmailTemplateDefinition<TProps>): AthenaAuthEmailTemplateBuilder<TProps>;
|
|
302
|
+
declare function renderAthenaReactEmail(input: AthenaAuthReactEmailRenderInput, options?: AthenaAuthReactEmailRuntimeOptions | AthenaAuthReactEmailConfig): Promise<AthenaAuthRenderedReactEmail>;
|
|
303
|
+
|
|
304
|
+
export { ATHENA_AUTH_BASE_ERROR_CODES as A, defineAthenaAuthConfig as B, defineAuthEmailTemplate as C, DEFAULT_POSTGRES_SCHEMAS as D, defineDatabase as E, defineModel as F, type GeneratorEnvBooleanOptions as G, defineRegistry as H, defineSchema as I, generatorEnv as J, identifier as K, normalizeAthenaGatewayBaseUrl as L, normalizeSchemaSelection as M, renderAthenaReactEmail as N, resolvePostgresColumnType as O, type PostgresIntrospectionProviderOptions as P, resolveProviderSchemas as Q, verifyAthenaGatewayUrl as R, type TypedAthenaClient as T, type AthenaAuthBaseURLConfig as a, type AthenaAuthContext as b, type AthenaAuthCookieRuntimeInput as c, type AthenaAuthDatabaseFactory as d, type AthenaAuthHandlerResult as e, type AthenaAuthPlugin as f, type AthenaAuthPluginContext as g, type AthenaAuthPluginHandlerContext as h, type AthenaAuthRequestContext as i, type AthenaAuthServer as j, type AthenaAuthServerApi as k, type AthenaAuthServerConfig as l, type AthenaAuthServerRuntimeOptions as m, type AthenaAuthSocialProviderConfig as n, type AthenaAuthTrustedOrigins as o, type AthenaAuthTrustedProviders as p, type GeneratorEnvJsonOptions as q, type GeneratorEnvListOptions as r, type GeneratorEnvOneOfOptions as s, type GeneratorEnvStringOptions as t, type TypedClientOptions as u, athenaAuth as v, createAuthClient as w, createAuthReactEmailInput as x, createPostgresIntrospectionProvider as y, createTypedClient as z };
|
|
@@ -0,0 +1,304 @@
|
|
|
1
|
+
import { b as AthenaGatewayConnectionOptions, c as AthenaGatewayConnectionResult, F as SchemaDef, J as AnyModelDef, D as DatabaseDef, y as ModelMetadata, x as ModelDef, R as RegistryDef, H as TenantKeyMap, T as TenantContext, E as RowOf, M as ModelAt, q as InsertOf, U as UpdateOf, a as AthenaGatewayCallOptions, S as SchemaIntrospectionProvider, r as IntrospectionColumn } from './types-BsyRW49r.js';
|
|
2
|
+
import { av as AthenaSdkClient, bz as TableQueryBuilder, f as AthenaAuthClientConfig, N as AthenaAuthSdkClient, F as AthenaAuthReactEmailProps, C as AthenaAuthReactEmailComponent, H as AthenaAuthReactEmailRenderInput, k as AthenaAuthEmailTemplateDefinition, i as AthenaAuthEmailTemplateBuilder, I as AthenaAuthReactEmailRenderOptions, G as AthenaAuthReactEmailRenderEvent, D as AthenaAuthReactEmailConfig } from './model-form-AKYrgede.js';
|
|
3
|
+
import { j as GeneratorSchemaSelection, b as GeneratorProviderConfig } from './types-t_TVqnmp.js';
|
|
4
|
+
import { A as AthenaCookiesOptions, a as AthenaSessionPair, b as AthenaCookieOptions, c as AthenaAuthCookies, g as getCookieCache, d as getSessionCookie, e as AthenaCookieContextRuntime } from './index-CVcQCGyG.js';
|
|
5
|
+
|
|
6
|
+
declare function verifyAthenaGatewayUrl(baseUrl: string, options?: AthenaGatewayConnectionOptions): Promise<AthenaGatewayConnectionResult>;
|
|
7
|
+
|
|
8
|
+
interface NormalizeAthenaGatewayBaseUrlOptions {
|
|
9
|
+
defaultBaseUrl?: string;
|
|
10
|
+
label?: string;
|
|
11
|
+
}
|
|
12
|
+
declare function normalizeAthenaGatewayBaseUrl(input: string | null | undefined, options?: NormalizeAthenaGatewayBaseUrlOptions): string;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Immutable identifier object with consistent SQL rendering.
|
|
16
|
+
*/
|
|
17
|
+
interface SqlIdentifier {
|
|
18
|
+
readonly segments: string[];
|
|
19
|
+
toSql(): string;
|
|
20
|
+
toString(): string;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Creates a quoted identifier object from segment or dotted inputs.
|
|
24
|
+
*/
|
|
25
|
+
declare function identifier(...segments: string[]): SqlIdentifier;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Declares a model contract with explicit metadata and typed row/insert/update shapes.
|
|
29
|
+
*/
|
|
30
|
+
declare function defineModel<Row, Insert = Partial<Row>, Update = Partial<Insert>, Meta extends ModelMetadata<Row> = ModelMetadata<Row>>(input: {
|
|
31
|
+
meta: Meta;
|
|
32
|
+
}): ModelDef<Row, Insert, Update, Meta>;
|
|
33
|
+
/**
|
|
34
|
+
* Declares a schema-level model map.
|
|
35
|
+
*/
|
|
36
|
+
declare function defineSchema<Models extends Record<string, AnyModelDef>>(models: Models): SchemaDef<Models>;
|
|
37
|
+
/**
|
|
38
|
+
* Declares a database-level schema map.
|
|
39
|
+
*/
|
|
40
|
+
declare function defineDatabase<Schemas extends Record<string, SchemaDef<Record<string, AnyModelDef>>>>(schemas: Schemas): DatabaseDef<Schemas>;
|
|
41
|
+
/**
|
|
42
|
+
* Declares a top-level multi-database registry.
|
|
43
|
+
*/
|
|
44
|
+
declare function defineRegistry<Databases extends Record<string, DatabaseDef<Record<string, SchemaDef<Record<string, AnyModelDef>>>>>>(databases: Databases): RegistryDef<Databases>;
|
|
45
|
+
|
|
46
|
+
type RegistryConstraint = RegistryDef<Record<string, DatabaseDef<Record<string, SchemaDef<Record<string, AnyModelDef>>>>>>;
|
|
47
|
+
/**
|
|
48
|
+
* Options for creating typed Athena clients.
|
|
49
|
+
*/
|
|
50
|
+
interface TypedClientOptions<TMap extends TenantKeyMap = TenantKeyMap> extends Pick<AthenaGatewayCallOptions, 'backend' | 'client' | 'headers'> {
|
|
51
|
+
tenantKeyMap?: TMap;
|
|
52
|
+
tenantContext?: TenantContext<TMap>;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Typed Athena client with registry-driven model resolution and tenant-context propagation.
|
|
56
|
+
*/
|
|
57
|
+
interface TypedAthenaClient<TRegistry extends RegistryConstraint, TTenantMap extends TenantKeyMap = Record<never, string>> extends AthenaSdkClient {
|
|
58
|
+
readonly registry: TRegistry;
|
|
59
|
+
readonly tenantKeyMap: Readonly<TTenantMap>;
|
|
60
|
+
readonly tenantContext: TenantContext<TTenantMap>;
|
|
61
|
+
withTenantContext(context: TenantContext<TTenantMap>): TypedAthenaClient<TRegistry, TTenantMap>;
|
|
62
|
+
fromModel<TDatabase extends keyof TRegistry & string, TSchema extends keyof TRegistry[TDatabase]['schemas'] & string, TModel extends keyof TRegistry[TDatabase]['schemas'][TSchema]['models'] & string>(database: TDatabase, schema: TSchema, model: TModel): TableQueryBuilder<RowOf<ModelAt<TRegistry, TDatabase, TSchema, TModel>>, InsertOf<ModelAt<TRegistry, TDatabase, TSchema, TModel>>, UpdateOf<ModelAt<TRegistry, TDatabase, TSchema, TModel>>, {
|
|
63
|
+
registry: TRegistry;
|
|
64
|
+
database: TDatabase;
|
|
65
|
+
schema: TSchema;
|
|
66
|
+
model: ModelAt<TRegistry, TDatabase, TSchema, TModel>;
|
|
67
|
+
}>;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Creates a typed client bound to a registry contract and optional tenant header mapping.
|
|
71
|
+
*/
|
|
72
|
+
declare function createTypedClient<TRegistry extends RegistryConstraint, TTenantMap extends TenantKeyMap = Record<never, string>>(registry: TRegistry, url: string, apiKey: string, options?: TypedClientOptions<TTenantMap>): TypedAthenaClient<TRegistry, TTenantMap>;
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Constructor options for the PostgreSQL introspection provider.
|
|
76
|
+
*/
|
|
77
|
+
interface PostgresIntrospectionProviderOptions {
|
|
78
|
+
connectionString: string;
|
|
79
|
+
database?: string;
|
|
80
|
+
schemas?: readonly string[];
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Creates a PostgreSQL-backed schema introspection provider.
|
|
84
|
+
*/
|
|
85
|
+
declare function createPostgresIntrospectionProvider(options: PostgresIntrospectionProviderOptions): SchemaIntrospectionProvider;
|
|
86
|
+
|
|
87
|
+
interface GeneratorEnvBaseOptions<T> {
|
|
88
|
+
default?: T;
|
|
89
|
+
optional?: boolean;
|
|
90
|
+
}
|
|
91
|
+
type GeneratorEnvStringOptions = GeneratorEnvBaseOptions<string>;
|
|
92
|
+
type GeneratorEnvBooleanOptions = GeneratorEnvBaseOptions<boolean>;
|
|
93
|
+
interface GeneratorEnvListOptions extends GeneratorEnvBaseOptions<readonly string[]> {
|
|
94
|
+
separator?: string;
|
|
95
|
+
}
|
|
96
|
+
type GeneratorEnvJsonOptions<T> = GeneratorEnvBaseOptions<T>;
|
|
97
|
+
type GeneratorEnvOneOfOptions<T extends string> = GeneratorEnvBaseOptions<T>;
|
|
98
|
+
type GeneratorEnvHelper = {
|
|
99
|
+
(key: string, options?: GeneratorEnvStringOptions): string;
|
|
100
|
+
(key: string, options: GeneratorEnvStringOptions & {
|
|
101
|
+
optional: true;
|
|
102
|
+
}): string | undefined;
|
|
103
|
+
boolean(key: string, options?: GeneratorEnvBooleanOptions): boolean;
|
|
104
|
+
boolean(key: string, options: GeneratorEnvBooleanOptions & {
|
|
105
|
+
optional: true;
|
|
106
|
+
}): boolean | undefined;
|
|
107
|
+
list(key: string, options?: GeneratorEnvListOptions): string[];
|
|
108
|
+
list(key: string, options: GeneratorEnvListOptions & {
|
|
109
|
+
optional: true;
|
|
110
|
+
}): string[] | undefined;
|
|
111
|
+
json<T>(key: string, options?: GeneratorEnvJsonOptions<T>): T;
|
|
112
|
+
json<T>(key: string, options: GeneratorEnvJsonOptions<T> & {
|
|
113
|
+
optional: true;
|
|
114
|
+
}): T | undefined;
|
|
115
|
+
oneOf<const T extends string>(key: string, allowedValues: readonly T[], options?: GeneratorEnvOneOfOptions<T>): T;
|
|
116
|
+
oneOf<const T extends string>(key: string, allowedValues: readonly T[], options: GeneratorEnvOneOfOptions<T> & {
|
|
117
|
+
optional: true;
|
|
118
|
+
}): T | undefined;
|
|
119
|
+
};
|
|
120
|
+
/**
|
|
121
|
+
* Typed env reader for generator configs. This keeps `athena.config.*` files
|
|
122
|
+
* declarative while preserving exact field types for booleans, lists, unions,
|
|
123
|
+
* and JSON-backed objects.
|
|
124
|
+
*/
|
|
125
|
+
declare const generatorEnv: GeneratorEnvHelper;
|
|
126
|
+
|
|
127
|
+
declare function resolvePostgresColumnType(column: IntrospectionColumn): string;
|
|
128
|
+
|
|
129
|
+
declare const DEFAULT_POSTGRES_SCHEMAS: readonly ["public"];
|
|
130
|
+
/**
|
|
131
|
+
* Normalizes schema selection from config or env-backed strings into a stable,
|
|
132
|
+
* deduplicated list. Empty selections fall back to PostgreSQL's public schema.
|
|
133
|
+
*/
|
|
134
|
+
declare function normalizeSchemaSelection(input: GeneratorSchemaSelection | undefined): string[];
|
|
135
|
+
/**
|
|
136
|
+
* Resolves the effective schema list for provider-backed generator runs.
|
|
137
|
+
*/
|
|
138
|
+
declare function resolveProviderSchemas(providerConfig: GeneratorProviderConfig): string[];
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* @deprecated Prefer `createClient(...).auth` from `@xylex-group/athena`.
|
|
142
|
+
*/
|
|
143
|
+
declare function createAuthClient(config?: AthenaAuthClientConfig): AthenaAuthSdkClient;
|
|
144
|
+
|
|
145
|
+
type AthenaMaybePromise<T> = T | Promise<T>;
|
|
146
|
+
type AthenaAuthServerCookieOptions = Pick<AthenaCookiesOptions, 'session' | 'advanced'>;
|
|
147
|
+
declare const ATHENA_AUTH_BASE_ERROR_CODES: {
|
|
148
|
+
readonly HANDLER_NOT_CONFIGURED: "HANDLER_NOT_CONFIGURED";
|
|
149
|
+
readonly INVALID_BASE_URL: "INVALID_BASE_URL";
|
|
150
|
+
readonly UNTRUSTED_HOST: "UNTRUSTED_HOST";
|
|
151
|
+
};
|
|
152
|
+
interface AthenaAuthSocialProviderConfig {
|
|
153
|
+
clientId: string;
|
|
154
|
+
clientSecret: string;
|
|
155
|
+
scope?: string[];
|
|
156
|
+
[key: string]: unknown;
|
|
157
|
+
}
|
|
158
|
+
interface AthenaAuthPluginContext {
|
|
159
|
+
path?: string;
|
|
160
|
+
headers?: Headers;
|
|
161
|
+
context: {
|
|
162
|
+
returned?: unknown;
|
|
163
|
+
responseHeaders?: Headers;
|
|
164
|
+
setSession?: AthenaSessionPair | null;
|
|
165
|
+
clearSession?: boolean;
|
|
166
|
+
dontRememberMe?: boolean;
|
|
167
|
+
cookieOverrides?: Partial<AthenaCookieOptions>;
|
|
168
|
+
[key: string]: unknown;
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
interface AthenaAuthPluginHandlerContext extends AthenaAuthPluginContext {
|
|
172
|
+
auth: AthenaAuthServer;
|
|
173
|
+
}
|
|
174
|
+
interface AthenaAuthPlugin {
|
|
175
|
+
id: string;
|
|
176
|
+
version: string;
|
|
177
|
+
$ERROR_CODES?: Record<string, string>;
|
|
178
|
+
hooks?: {
|
|
179
|
+
after?: Array<{
|
|
180
|
+
matcher: (ctx: AthenaAuthPluginContext) => boolean;
|
|
181
|
+
handler: (ctx: AthenaAuthPluginHandlerContext) => Promise<void> | void;
|
|
182
|
+
}>;
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
interface AthenaAuthCookieRuntimeInput {
|
|
186
|
+
headers?: Headers;
|
|
187
|
+
responseHeaders?: Headers;
|
|
188
|
+
cookies?: AthenaAuthCookies;
|
|
189
|
+
getCookie?: (name: string) => string | null | undefined;
|
|
190
|
+
setCookie?: (name: string, value: string, attributes: AthenaCookieOptions) => void;
|
|
191
|
+
logger?: AthenaCookieContextRuntime['logger'];
|
|
192
|
+
setSignedCookie?: AthenaCookieContextRuntime['setSignedCookie'];
|
|
193
|
+
getSignedCookie?: AthenaCookieContextRuntime['getSignedCookie'];
|
|
194
|
+
setNewSession?: AthenaCookieContextRuntime['context']['setNewSession'];
|
|
195
|
+
}
|
|
196
|
+
interface AthenaAuthServerRuntimeOptions {
|
|
197
|
+
baseURL?: string;
|
|
198
|
+
basePath: string;
|
|
199
|
+
secret: string;
|
|
200
|
+
cookies: AthenaAuthServerCookieOptions;
|
|
201
|
+
}
|
|
202
|
+
type AthenaAuthDatabaseFactory<TDatabase = unknown> = (options: AthenaAuthServerRuntimeOptions) => TDatabase;
|
|
203
|
+
type AthenaAuthBaseURLConfig = AthenaCookiesOptions['baseURL'];
|
|
204
|
+
type AthenaAuthTrustedOrigins = string[] | ((request?: Request) => AthenaMaybePromise<string[]>);
|
|
205
|
+
type AthenaAuthTrustedProviders = string[] | ((request?: Request) => AthenaMaybePromise<string[]>);
|
|
206
|
+
interface AthenaAuthHandlerResult {
|
|
207
|
+
response?: Response;
|
|
208
|
+
returned?: unknown;
|
|
209
|
+
setSession?: AthenaSessionPair | null;
|
|
210
|
+
clearSession?: boolean;
|
|
211
|
+
dontRememberMe?: boolean;
|
|
212
|
+
cookieOverrides?: Partial<AthenaCookieOptions>;
|
|
213
|
+
}
|
|
214
|
+
interface AthenaAuthServerConfig<TDatabase = unknown> extends AthenaAuthServerCookieOptions {
|
|
215
|
+
baseURL?: AthenaAuthBaseURLConfig;
|
|
216
|
+
basePath?: string;
|
|
217
|
+
secret: string;
|
|
218
|
+
database: TDatabase | AthenaAuthDatabaseFactory<TDatabase>;
|
|
219
|
+
socialProviders?: Record<string, AthenaAuthSocialProviderConfig>;
|
|
220
|
+
trustedOrigins?: AthenaAuthTrustedOrigins;
|
|
221
|
+
trustedProviders?: AthenaAuthTrustedProviders;
|
|
222
|
+
api?: Record<string, unknown>;
|
|
223
|
+
errorCodes?: Record<string, string>;
|
|
224
|
+
handler?: (ctx: AthenaAuthRequestContext) => AthenaMaybePromise<Response | AthenaAuthHandlerResult>;
|
|
225
|
+
plugins?: AthenaAuthPlugin[];
|
|
226
|
+
}
|
|
227
|
+
type ResolveAthenaAuthDatabase<TConfig extends AthenaAuthServerConfig> = TConfig['database'] extends (...args: never[]) => infer TResult ? TResult : TConfig['database'];
|
|
228
|
+
interface AthenaAuthRequestContext<TConfig extends AthenaAuthServerConfig = AthenaAuthServerConfig> {
|
|
229
|
+
auth: AthenaAuthServer<TConfig>;
|
|
230
|
+
request: Request;
|
|
231
|
+
url: URL;
|
|
232
|
+
path: string;
|
|
233
|
+
basePath: string;
|
|
234
|
+
baseURL: string;
|
|
235
|
+
origin: string;
|
|
236
|
+
headers: Headers;
|
|
237
|
+
cookies: AthenaAuthCookies;
|
|
238
|
+
trustedOrigins: string[];
|
|
239
|
+
trustedProviders: string[];
|
|
240
|
+
options: TConfig;
|
|
241
|
+
runtime: AthenaAuthServerRuntimeOptions;
|
|
242
|
+
database: ResolveAthenaAuthDatabase<TConfig>;
|
|
243
|
+
socialProviders: NonNullable<TConfig['socialProviders']>;
|
|
244
|
+
}
|
|
245
|
+
interface AthenaAuthContext<TConfig extends AthenaAuthServerConfig = AthenaAuthServerConfig> {
|
|
246
|
+
auth: AthenaAuthServer<TConfig>;
|
|
247
|
+
options: TConfig;
|
|
248
|
+
runtime: AthenaAuthServerRuntimeOptions;
|
|
249
|
+
basePath: string;
|
|
250
|
+
baseURL?: string;
|
|
251
|
+
origin?: string;
|
|
252
|
+
database: ResolveAthenaAuthDatabase<TConfig>;
|
|
253
|
+
socialProviders: NonNullable<TConfig['socialProviders']>;
|
|
254
|
+
plugins: AthenaAuthPlugin[];
|
|
255
|
+
cookies: AthenaAuthCookies;
|
|
256
|
+
trustedOrigins: string[];
|
|
257
|
+
trustedProviders: string[];
|
|
258
|
+
}
|
|
259
|
+
interface AthenaAuthServerApi<TConfig extends AthenaAuthServerConfig = AthenaAuthServerConfig> {
|
|
260
|
+
applyResponseCookies: AthenaAuthServer<TConfig>['applyResponseCookies'];
|
|
261
|
+
clearSession: AthenaAuthServer<TConfig>['clearSession'];
|
|
262
|
+
createCookieContext: AthenaAuthServer<TConfig>['createCookieContext'];
|
|
263
|
+
getCookieCache: typeof getCookieCache;
|
|
264
|
+
getSessionCookie: typeof getSessionCookie;
|
|
265
|
+
resolveRequestContext: AthenaAuthServer<TConfig>['resolveRequestContext'];
|
|
266
|
+
runAfterHooks: AthenaAuthServer<TConfig>['runAfterHooks'];
|
|
267
|
+
setSession: AthenaAuthServer<TConfig>['setSession'];
|
|
268
|
+
}
|
|
269
|
+
interface AthenaAuthServer<TConfig extends AthenaAuthServerConfig = AthenaAuthServerConfig> {
|
|
270
|
+
config: TConfig;
|
|
271
|
+
options: TConfig;
|
|
272
|
+
runtime: AthenaAuthServerRuntimeOptions;
|
|
273
|
+
database: ResolveAthenaAuthDatabase<TConfig>;
|
|
274
|
+
socialProviders: NonNullable<TConfig['socialProviders']>;
|
|
275
|
+
plugins: AthenaAuthPlugin[];
|
|
276
|
+
cookies: AthenaAuthCookies;
|
|
277
|
+
api: AthenaAuthServerApi<TConfig> & Record<string, unknown>;
|
|
278
|
+
$context: Promise<AthenaAuthContext<TConfig>>;
|
|
279
|
+
$ERROR_CODES: Record<string, string>;
|
|
280
|
+
createCookieContext: (input?: AthenaAuthCookieRuntimeInput) => AthenaCookieContextRuntime;
|
|
281
|
+
setSession: (input: AthenaAuthCookieRuntimeInput | undefined, session: AthenaSessionPair, dontRememberMe?: boolean, overrides?: Partial<AthenaCookieOptions>) => Promise<void>;
|
|
282
|
+
clearSession: (input?: AthenaAuthCookieRuntimeInput, skipDontRememberMe?: boolean) => void;
|
|
283
|
+
applyResponseCookies: (ctx: AthenaAuthPluginContext) => Promise<Headers>;
|
|
284
|
+
runAfterHooks: (ctx: AthenaAuthPluginContext) => Promise<AthenaAuthPluginContext>;
|
|
285
|
+
resolveRequestContext: (request: Request) => Promise<AthenaAuthRequestContext<TConfig>>;
|
|
286
|
+
handler: (request: Request) => Promise<Response>;
|
|
287
|
+
}
|
|
288
|
+
declare function defineAthenaAuthConfig<TConfig extends AthenaAuthServerConfig>(config: TConfig): TConfig;
|
|
289
|
+
declare function athenaAuth<TConfig extends AthenaAuthServerConfig>(config: TConfig): AthenaAuthServer<TConfig>;
|
|
290
|
+
|
|
291
|
+
interface AthenaAuthRenderedReactEmail {
|
|
292
|
+
html: string;
|
|
293
|
+
text?: string;
|
|
294
|
+
}
|
|
295
|
+
interface AthenaAuthReactEmailRuntimeOptions {
|
|
296
|
+
route?: string;
|
|
297
|
+
defaults?: AthenaAuthReactEmailRenderOptions;
|
|
298
|
+
observe?: (event: AthenaAuthReactEmailRenderEvent) => void;
|
|
299
|
+
}
|
|
300
|
+
declare function createAuthReactEmailInput<TProps extends AthenaAuthReactEmailProps = AthenaAuthReactEmailProps>(component: AthenaAuthReactEmailComponent<TProps>, props: TProps, overrides?: Omit<AthenaAuthReactEmailRenderInput, 'component' | 'props' | 'element'>): AthenaAuthReactEmailRenderInput;
|
|
301
|
+
declare function defineAuthEmailTemplate<TProps extends AthenaAuthReactEmailProps = AthenaAuthReactEmailProps>(definition: AthenaAuthEmailTemplateDefinition<TProps>): AthenaAuthEmailTemplateBuilder<TProps>;
|
|
302
|
+
declare function renderAthenaReactEmail(input: AthenaAuthReactEmailRenderInput, options?: AthenaAuthReactEmailRuntimeOptions | AthenaAuthReactEmailConfig): Promise<AthenaAuthRenderedReactEmail>;
|
|
303
|
+
|
|
304
|
+
export { ATHENA_AUTH_BASE_ERROR_CODES as A, defineAthenaAuthConfig as B, defineAuthEmailTemplate as C, DEFAULT_POSTGRES_SCHEMAS as D, defineDatabase as E, defineModel as F, type GeneratorEnvBooleanOptions as G, defineRegistry as H, defineSchema as I, generatorEnv as J, identifier as K, normalizeAthenaGatewayBaseUrl as L, normalizeSchemaSelection as M, renderAthenaReactEmail as N, resolvePostgresColumnType as O, type PostgresIntrospectionProviderOptions as P, resolveProviderSchemas as Q, verifyAthenaGatewayUrl as R, type TypedAthenaClient as T, type AthenaAuthBaseURLConfig as a, type AthenaAuthContext as b, type AthenaAuthCookieRuntimeInput as c, type AthenaAuthDatabaseFactory as d, type AthenaAuthHandlerResult as e, type AthenaAuthPlugin as f, type AthenaAuthPluginContext as g, type AthenaAuthPluginHandlerContext as h, type AthenaAuthRequestContext as i, type AthenaAuthServer as j, type AthenaAuthServerApi as k, type AthenaAuthServerConfig as l, type AthenaAuthServerRuntimeOptions as m, type AthenaAuthSocialProviderConfig as n, type AthenaAuthTrustedOrigins as o, type AthenaAuthTrustedProviders as p, type GeneratorEnvJsonOptions as q, type GeneratorEnvListOptions as r, type GeneratorEnvOneOfOptions as s, type GeneratorEnvStringOptions as t, type TypedClientOptions as u, athenaAuth as v, createAuthClient as w, createAuthReactEmailInput as x, createPostgresIntrospectionProvider as y, createTypedClient as z };
|