@xylex-group/athena 2.1.2 → 2.4.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 +306 -117
- package/dist/browser.cjs +2151 -194
- package/dist/browser.cjs.map +1 -1
- package/dist/browser.d.cts +14 -14
- package/dist/browser.d.ts +14 -14
- package/dist/browser.js +2146 -194
- package/dist/browser.js.map +1 -1
- package/dist/cli/index.cjs +2035 -172
- 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 +2036 -173
- package/dist/cli/index.js.map +1 -1
- package/dist/index.cjs +2166 -190
- 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 +2162 -191
- package/dist/index.js.map +1 -1
- package/dist/{model-form-2hqmoOUX.d.ts → model-form-C0FAbOaf.d.ts} +97 -2
- package/dist/{model-form-Cy-zaO0u.d.cts → model-form-GzTqhEzM.d.cts} +97 -2
- package/dist/{pipeline-BOPszLsL.d.ts → pipeline-CR4V15jF.d.ts} +1 -1
- package/dist/{pipeline-E3FDbs4W.d.cts → pipeline-DZeExYMA.d.cts} +1 -1
- package/dist/{client-BX0NQqOn.d.ts → react-email-BuApZuyG.d.ts} +362 -174
- package/dist/{client-dpAp-NZK.d.cts → react-email-CQJq92zQ.d.cts} +362 -174
- package/dist/react.cjs +279 -21
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +4 -4
- package/dist/react.d.ts +4 -4
- package/dist/react.js +279 -21
- package/dist/react.js.map +1 -1
- package/dist/{types-BaBzjwXr.d.cts → types-09Q4D86N.d.cts} +24 -2
- package/dist/{types-BaBzjwXr.d.ts → types-09Q4D86N.d.ts} +24 -2
- package/dist/{types-CpqL-pZx.d.cts → types-D1JvL21V.d.cts} +1 -1
- package/dist/{types-CeBPrnGj.d.ts → types-DU3gNdFv.d.ts} +1 -1
- package/dist/utils.cjs +153 -0
- package/dist/utils.cjs.map +1 -0
- package/dist/utils.d.cts +23 -0
- package/dist/utils.d.ts +23 -0
- package/dist/utils.js +146 -0
- package/dist/utils.js.map +1 -0
- package/package.json +74 -16
|
@@ -1,175 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as AthenaAuthBindings,
|
|
3
|
-
import { j as GeneratorSchemaSelection, b as GeneratorProviderConfig } from './types-
|
|
4
|
-
|
|
5
|
-
type AthenaRowShape$1 = Record<string, AthenaJsonValue | undefined>;
|
|
6
|
-
type AthenaUpsertOptions<Update> = AthenaGatewayCallOptions & {
|
|
7
|
-
updateBody?: Update;
|
|
8
|
-
onConflict?: string | string[];
|
|
9
|
-
};
|
|
10
|
-
interface AthenaDbModule {
|
|
11
|
-
from<Row = AthenaRowShape$1, Insert = Partial<Row>, Update = Partial<Insert>>(table: string): TableQueryBuilder<Row, Insert, Update>;
|
|
12
|
-
select<Row = AthenaRowShape$1, SelectedRow = Row>(table: string, columns?: string | string[], options?: AthenaGatewayCallOptions): SelectChain<Row, SelectedRow>;
|
|
13
|
-
insert<Row = AthenaRowShape$1, Insert = Partial<Row>>(table: string, values: Insert, options?: AthenaGatewayCallOptions): MutationQuery<Row>;
|
|
14
|
-
insert<Row = AthenaRowShape$1, Insert = Partial<Row>>(table: string, values: Insert[], options?: AthenaGatewayCallOptions): MutationQuery<Row[]>;
|
|
15
|
-
upsert<Row = AthenaRowShape$1, Insert = Partial<Row>, Update = Partial<Insert>>(table: string, values: Insert, options?: AthenaUpsertOptions<Update>): MutationQuery<Row>;
|
|
16
|
-
upsert<Row = AthenaRowShape$1, Insert = Partial<Row>, Update = Partial<Insert>>(table: string, values: Insert[], options?: AthenaUpsertOptions<Update>): MutationQuery<Row[]>;
|
|
17
|
-
update<Row = AthenaRowShape$1, Insert = Partial<Row>, Update = Partial<Insert>>(table: string, values: Update, options?: AthenaGatewayCallOptions): UpdateChain<Row>;
|
|
18
|
-
delete<Row = AthenaRowShape$1>(table: string, options?: AthenaGatewayCallOptions & {
|
|
19
|
-
resourceId?: string;
|
|
20
|
-
}): MutationQuery<Row | null>;
|
|
21
|
-
rpc<Row = unknown, Args extends AthenaJsonObject = AthenaJsonObject>(fn: string, args?: Args, options?: AthenaRpcCallOptions): RpcQueryBuilder<Row>;
|
|
22
|
-
query<Row = unknown>(query: string, options?: AthenaGatewayCallOptions): Promise<AthenaResult<Row[]>>;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
interface AthenaResult<T> {
|
|
26
|
-
data: T | null;
|
|
27
|
-
error: string | null;
|
|
28
|
-
errorDetails?: AthenaGatewayErrorDetails | null;
|
|
29
|
-
status: number;
|
|
30
|
-
count?: number | null;
|
|
31
|
-
raw: unknown;
|
|
32
|
-
}
|
|
33
|
-
interface AthenaClientExperimentalOptions {
|
|
34
|
-
/**
|
|
35
|
-
* Pre-compute and attach normalized error metadata to failed AthenaResult values.
|
|
36
|
-
* Keeps AthenaResult shape intact and enables context-aware normalizeAthenaError(result) usage.
|
|
37
|
-
*/
|
|
38
|
-
enableErrorNormalization?: boolean;
|
|
39
|
-
}
|
|
40
|
-
type MutationSingleResult<Result> = Result extends Array<infer Item> ? Item | null : Result | null;
|
|
41
|
-
type AthenaRowShape = Record<string, AthenaJsonValue | undefined>;
|
|
42
|
-
type FilterColumnKey<Row> = Extract<keyof NonNullable<Row>, string>;
|
|
43
|
-
type ResolvedFilterColumnKey<Row> = [FilterColumnKey<Row>] extends [never] ? string : FilterColumnKey<Row>;
|
|
44
|
-
interface MutationQuery<Result> extends PromiseLike<AthenaResult<Result>> {
|
|
45
|
-
select(columns?: string | string[], options?: AthenaGatewayCallOptions): Promise<AthenaResult<Result>>;
|
|
46
|
-
returning(columns?: string | string[], options?: AthenaGatewayCallOptions): Promise<AthenaResult<Result>>;
|
|
47
|
-
single(columns?: string | string[], options?: AthenaGatewayCallOptions): Promise<AthenaResult<MutationSingleResult<Result>>>;
|
|
48
|
-
maybeSingle(columns?: string | string[], options?: AthenaGatewayCallOptions): Promise<AthenaResult<MutationSingleResult<Result>>>;
|
|
49
|
-
then<TResult1 = AthenaResult<Result>, TResult2 = never>(onfulfilled?: ((value: AthenaResult<Result>) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: unknown) => TResult2 | PromiseLike<TResult2>) | undefined | null): Promise<TResult1 | TResult2>;
|
|
50
|
-
catch<TResult = never>(onrejected?: ((reason: unknown) => TResult | PromiseLike<TResult>) | undefined | null): Promise<AthenaResult<Result> | TResult>;
|
|
51
|
-
finally(onfinally?: (() => void) | undefined | null): Promise<AthenaResult<Result>>;
|
|
52
|
-
}
|
|
53
|
-
interface OrderOptions {
|
|
54
|
-
ascending?: boolean;
|
|
55
|
-
}
|
|
56
|
-
/** Shared filter chain - supports eq, limit, etc. in any order relative to select/update */
|
|
57
|
-
interface FilterChain<Self, Row> {
|
|
58
|
-
eq(column: ResolvedFilterColumnKey<Row>, value: AthenaConditionValue): Self;
|
|
59
|
-
eqCast(column: ResolvedFilterColumnKey<Row>, value: AthenaConditionValue, cast: AthenaConditionCastType): Self;
|
|
60
|
-
eqUuid(column: ResolvedFilterColumnKey<Row>, value: string): Self;
|
|
61
|
-
match(filters: Partial<Record<ResolvedFilterColumnKey<Row>, AthenaConditionValue>>): Self;
|
|
62
|
-
range(from: number, to: number): Self;
|
|
63
|
-
limit(count: number): Self;
|
|
64
|
-
offset(count: number): Self;
|
|
65
|
-
currentPage(value: number): Self;
|
|
66
|
-
pageSize(value: number): Self;
|
|
67
|
-
totalPages(value: number): Self;
|
|
68
|
-
order(column: ResolvedFilterColumnKey<Row>, options?: OrderOptions): Self;
|
|
69
|
-
gt(column: ResolvedFilterColumnKey<Row>, value: AthenaConditionValue): Self;
|
|
70
|
-
gte(column: ResolvedFilterColumnKey<Row>, value: AthenaConditionValue): Self;
|
|
71
|
-
lt(column: ResolvedFilterColumnKey<Row>, value: AthenaConditionValue): Self;
|
|
72
|
-
lte(column: ResolvedFilterColumnKey<Row>, value: AthenaConditionValue): Self;
|
|
73
|
-
neq(column: ResolvedFilterColumnKey<Row>, value: AthenaConditionValue): Self;
|
|
74
|
-
like(column: ResolvedFilterColumnKey<Row>, value: AthenaConditionValue): Self;
|
|
75
|
-
ilike(column: ResolvedFilterColumnKey<Row>, value: AthenaConditionValue): Self;
|
|
76
|
-
is(column: ResolvedFilterColumnKey<Row>, value: AthenaConditionValue): Self;
|
|
77
|
-
in(column: ResolvedFilterColumnKey<Row>, values: AthenaConditionArrayValue): Self;
|
|
78
|
-
contains(column: ResolvedFilterColumnKey<Row>, values: AthenaConditionArrayValue): Self;
|
|
79
|
-
containedBy(column: ResolvedFilterColumnKey<Row>, values: AthenaConditionArrayValue): Self;
|
|
80
|
-
not(columnOrExpression: ResolvedFilterColumnKey<Row> | string, operator?: AthenaConditionOperator, value?: AthenaConditionValue): Self;
|
|
81
|
-
or(expression: string): Self;
|
|
82
|
-
}
|
|
83
|
-
/** Chain returned by select() - supports filters and single/maybeSingle before execution */
|
|
84
|
-
interface SelectChain<Row, SelectedRow = Row> extends FilterChain<SelectChain<Row, SelectedRow>, Row>, PromiseLike<AthenaResult<SelectedRow[]>> {
|
|
85
|
-
single<T = SelectedRow>(columns?: string | string[], options?: AthenaGatewayCallOptions): Promise<AthenaResult<T | null>>;
|
|
86
|
-
maybeSingle<T = SelectedRow>(columns?: string | string[], options?: AthenaGatewayCallOptions): Promise<AthenaResult<T | null>>;
|
|
87
|
-
}
|
|
88
|
-
/** Chain returned by update() - supports filters before execution, plus select/returning */
|
|
89
|
-
interface UpdateChain<Row> extends FilterChain<UpdateChain<Row>, Row>, MutationQuery<Row[]> {
|
|
90
|
-
}
|
|
91
|
-
interface RpcFilterChain<Self> {
|
|
92
|
-
eq(column: string, value: AthenaConditionValue): Self;
|
|
93
|
-
neq(column: string, value: AthenaConditionValue): Self;
|
|
94
|
-
gt(column: string, value: AthenaConditionValue): Self;
|
|
95
|
-
gte(column: string, value: AthenaConditionValue): Self;
|
|
96
|
-
lt(column: string, value: AthenaConditionValue): Self;
|
|
97
|
-
lte(column: string, value: AthenaConditionValue): Self;
|
|
98
|
-
like(column: string, value: AthenaConditionValue): Self;
|
|
99
|
-
ilike(column: string, value: AthenaConditionValue): Self;
|
|
100
|
-
is(column: string, value: AthenaConditionValue): Self;
|
|
101
|
-
in(column: string, values: AthenaConditionArrayValue): Self;
|
|
102
|
-
}
|
|
103
|
-
interface RpcOrderOptions {
|
|
104
|
-
ascending?: boolean;
|
|
105
|
-
}
|
|
106
|
-
interface RpcQueryBuilder<Row> extends RpcFilterChain<RpcQueryBuilder<Row>>, PromiseLike<AthenaResult<Row[]>> {
|
|
107
|
-
select(columns?: string | string[], options?: AthenaRpcCallOptions): Promise<AthenaResult<Row[]>>;
|
|
108
|
-
single<T = Row>(columns?: string | string[], options?: AthenaRpcCallOptions): Promise<AthenaResult<T | null>>;
|
|
109
|
-
maybeSingle<T = Row>(columns?: string | string[], options?: AthenaRpcCallOptions): Promise<AthenaResult<T | null>>;
|
|
110
|
-
order(column: string, options?: RpcOrderOptions): RpcQueryBuilder<Row>;
|
|
111
|
-
limit(count: number): RpcQueryBuilder<Row>;
|
|
112
|
-
offset(count: number): RpcQueryBuilder<Row>;
|
|
113
|
-
range(from: number, to: number): RpcQueryBuilder<Row>;
|
|
114
|
-
}
|
|
115
|
-
interface TableQueryBuilder<Row, Insert = Partial<Row>, Update = Partial<Insert>> extends FilterChain<TableQueryBuilder<Row, Insert, Update>, Row> {
|
|
116
|
-
select<T = Row>(columns?: string | string[], options?: AthenaGatewayCallOptions): SelectChain<Row, T>;
|
|
117
|
-
insert(values: Insert, options?: AthenaGatewayCallOptions): MutationQuery<Row>;
|
|
118
|
-
insert(values: Insert[], options?: AthenaGatewayCallOptions): MutationQuery<Row[]>;
|
|
119
|
-
upsert(values: Insert, options?: AthenaGatewayCallOptions & {
|
|
120
|
-
updateBody?: Update;
|
|
121
|
-
onConflict?: string | string[];
|
|
122
|
-
}): MutationQuery<Row>;
|
|
123
|
-
upsert(values: Insert[], options?: AthenaGatewayCallOptions & {
|
|
124
|
-
updateBody?: Update;
|
|
125
|
-
onConflict?: string | string[];
|
|
126
|
-
}): MutationQuery<Row[]>;
|
|
127
|
-
update(values: Update, options?: AthenaGatewayCallOptions): UpdateChain<Row>;
|
|
128
|
-
delete(options?: AthenaGatewayCallOptions & {
|
|
129
|
-
resourceId?: string;
|
|
130
|
-
}): MutationQuery<Row | null>;
|
|
131
|
-
single<T = Row>(columns?: string | string[], options?: AthenaGatewayCallOptions): Promise<AthenaResult<T | null>>;
|
|
132
|
-
maybeSingle<T = Row>(columns?: string | string[], options?: AthenaGatewayCallOptions): Promise<AthenaResult<T | null>>;
|
|
133
|
-
reset(): TableQueryBuilder<Row, Insert, Update>;
|
|
134
|
-
}
|
|
135
|
-
interface AthenaSdkClient {
|
|
136
|
-
from<Row = AthenaRowShape, Insert = Partial<Row>, Update = Partial<Insert>>(table: string): TableQueryBuilder<Row, Insert, Update>;
|
|
137
|
-
db: AthenaDbModule;
|
|
138
|
-
rpc<Row = unknown, Args extends AthenaJsonObject = AthenaJsonObject>(fn: string, args?: Args, options?: AthenaRpcCallOptions): RpcQueryBuilder<Row>;
|
|
139
|
-
query<Row = unknown>(query: string, options?: AthenaGatewayCallOptions): Promise<AthenaResult<Row[]>>;
|
|
140
|
-
}
|
|
141
|
-
interface AthenaSdkClientWithAuth extends AthenaSdkClient {
|
|
142
|
-
auth: AthenaAuthBindings;
|
|
143
|
-
}
|
|
144
|
-
interface AthenaClientBuilder {
|
|
145
|
-
/** Set the gateway base URL. */
|
|
146
|
-
url(url: string): AthenaClientBuilder;
|
|
147
|
-
/** Set the API key used for all requests. */
|
|
148
|
-
key(apiKey: string): AthenaClientBuilder;
|
|
149
|
-
/** Set the default backend routing strategy. */
|
|
150
|
-
backend(backend: BackendConfig | BackendType): AthenaClientBuilder;
|
|
151
|
-
/** Set the default Athena client routing key. */
|
|
152
|
-
client(clientName: string): AthenaClientBuilder;
|
|
153
|
-
/** Attach static headers to every request. */
|
|
154
|
-
headers(headers: Record<string, string>): AthenaClientBuilder;
|
|
155
|
-
/** Enable or disable health tracking metadata. */
|
|
156
|
-
healthTracking(enabled: boolean): AthenaClientBuilder;
|
|
157
|
-
/** Build the immutable Athena SDK client. */
|
|
158
|
-
build(): AthenaSdkClientWithAuth;
|
|
159
|
-
}
|
|
160
|
-
/** Canonical Athena client factory with builder-based configuration. */
|
|
161
|
-
declare class AthenaClient {
|
|
162
|
-
/** Create a fluent builder for a strongly-typed Athena SDK client. */
|
|
163
|
-
static builder(): AthenaClientBuilder;
|
|
164
|
-
/** Build a client from process environment variables. */
|
|
165
|
-
static fromEnvironment(): AthenaSdkClientWithAuth;
|
|
166
|
-
}
|
|
167
|
-
interface AthenaCreateClientOptions extends Pick<AthenaGatewayCallOptions, 'client' | 'headers' | 'backend'> {
|
|
168
|
-
auth?: AthenaAuthClientConfig;
|
|
169
|
-
experimental?: AthenaClientExperimentalOptions;
|
|
170
|
-
}
|
|
171
|
-
/** Create client (convenience wrapper; use AthenaClient.builder() for full control) */
|
|
172
|
-
declare function createClient(url: string, apiKey: string, options?: AthenaCreateClientOptions): AthenaSdkClientWithAuth;
|
|
1
|
+
import { i as AthenaJsonValue, a as AthenaGatewayCallOptions, g as AthenaJsonObject, j as AthenaRpcCallOptions, J as AthenaConditionValue, K as AthenaConditionArrayValue, R as RegistryDef, D as DatabaseDef, F as SchemaDef, L as AnyModelDef, x as ModelDef, C as ModelRelationMetadata, E as RowOf, o as BackendConfig, p as BackendType, e as AthenaGatewayErrorDetails, A as AthenaConditionCastType, N as AthenaConditionOperator, b as AthenaGatewayConnectionOptions, c as AthenaGatewayConnectionResult, y as ModelMetadata, H as TenantKeyMap, T as TenantContext, M as ModelAt, q as InsertOf, U as UpdateOf, S as SchemaIntrospectionProvider, r as IntrospectionColumn } from './types-09Q4D86N.cjs';
|
|
2
|
+
import { c as AthenaAuthClientConfig, a as AthenaAuthBindings, J as AthenaAuthSdkClient, B as AthenaAuthReactEmailProps, x as AthenaAuthReactEmailComponent, D as AthenaAuthReactEmailRenderInput, h as AthenaAuthEmailTemplateDefinition, f as AthenaAuthEmailTemplateBuilder, E as AthenaAuthReactEmailRenderOptions, C as AthenaAuthReactEmailRenderEvent, y as AthenaAuthReactEmailConfig } from './model-form-GzTqhEzM.cjs';
|
|
3
|
+
import { j as GeneratorSchemaSelection, b as GeneratorProviderConfig } from './types-D1JvL21V.cjs';
|
|
173
4
|
|
|
174
5
|
type AthenaErrorKind = 'unique_violation' | 'not_found' | 'validation' | 'auth' | 'rate_limit' | 'transient' | 'unknown';
|
|
175
6
|
declare const AthenaErrorKind: {
|
|
@@ -346,6 +177,345 @@ declare function assertInt(value: unknown, label?: string, options?: IntCoercion
|
|
|
346
177
|
*/
|
|
347
178
|
declare function withRetry<T>(config: RetryConfig, fn: () => Promise<T>): Promise<T>;
|
|
348
179
|
|
|
180
|
+
type AthenaRowShape$2 = Record<string, AthenaJsonValue | undefined>;
|
|
181
|
+
type AthenaUpsertOptions<Update> = AthenaGatewayCallOptions & {
|
|
182
|
+
updateBody?: Update;
|
|
183
|
+
onConflict?: string | string[];
|
|
184
|
+
};
|
|
185
|
+
interface AthenaDbModule {
|
|
186
|
+
from<Row = AthenaRowShape$2, Insert = Partial<Row>, Update = Partial<Insert>>(table: string, options?: AthenaFromOptions): TableQueryBuilder<Row, Insert, Update>;
|
|
187
|
+
select<Row = AthenaRowShape$2, SelectedRow = Row>(table: string, columns?: string | string[], options?: AthenaGatewayCallOptions): SelectChain<Row, SelectedRow>;
|
|
188
|
+
insert<Row = AthenaRowShape$2, Insert = Partial<Row>>(table: string, values: Insert, options?: AthenaGatewayCallOptions): MutationQuery<Row>;
|
|
189
|
+
insert<Row = AthenaRowShape$2, Insert = Partial<Row>>(table: string, values: Insert[], options?: AthenaGatewayCallOptions): MutationQuery<Row[]>;
|
|
190
|
+
upsert<Row = AthenaRowShape$2, Insert = Partial<Row>, Update = Partial<Insert>>(table: string, values: Insert, options?: AthenaUpsertOptions<Update>): MutationQuery<Row>;
|
|
191
|
+
upsert<Row = AthenaRowShape$2, Insert = Partial<Row>, Update = Partial<Insert>>(table: string, values: Insert[], options?: AthenaUpsertOptions<Update>): MutationQuery<Row[]>;
|
|
192
|
+
update<Row = AthenaRowShape$2, Insert = Partial<Row>, Update = Partial<Insert>>(table: string, values: Update, options?: AthenaGatewayCallOptions): UpdateChain<Row>;
|
|
193
|
+
delete<Row = AthenaRowShape$2>(table: string, options?: AthenaGatewayCallOptions & {
|
|
194
|
+
resourceId?: string;
|
|
195
|
+
}): MutationQuery<Row | null>;
|
|
196
|
+
rpc<Row = unknown, Args extends AthenaJsonObject = AthenaJsonObject>(fn: string, args?: Args, options?: AthenaRpcCallOptions): RpcQueryBuilder<Row>;
|
|
197
|
+
query<Row = unknown>(query: string, options?: AthenaGatewayCallOptions): Promise<AthenaResult<Row[]>>;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
type AthenaRowShape$1 = Record<string, AthenaJsonValue | undefined>;
|
|
201
|
+
type FilterColumnKey$1<Row> = Extract<keyof NonNullable<Row>, string>;
|
|
202
|
+
type ResolvedFilterColumnKey$1<Row> = [FilterColumnKey$1<Row>] extends [never] ? string : FilterColumnKey$1<Row>;
|
|
203
|
+
type AthenaWherePrimitive = AthenaConditionValue;
|
|
204
|
+
type AthenaWhereOperatorInput = {
|
|
205
|
+
eq?: AthenaConditionValue;
|
|
206
|
+
neq?: AthenaConditionValue;
|
|
207
|
+
gt?: AthenaConditionValue;
|
|
208
|
+
gte?: AthenaConditionValue;
|
|
209
|
+
lt?: AthenaConditionValue;
|
|
210
|
+
lte?: AthenaConditionValue;
|
|
211
|
+
like?: AthenaConditionValue;
|
|
212
|
+
ilike?: AthenaConditionValue;
|
|
213
|
+
is?: AthenaConditionValue;
|
|
214
|
+
in?: AthenaConditionArrayValue;
|
|
215
|
+
contains?: AthenaConditionArrayValue;
|
|
216
|
+
containedBy?: AthenaConditionArrayValue;
|
|
217
|
+
};
|
|
218
|
+
type AthenaWhereBooleanOperand<Row = AthenaRowShape$1> = Partial<Record<ResolvedFilterColumnKey$1<Row>, AthenaWherePrimitive | AthenaWhereOperatorInput>>;
|
|
219
|
+
type AthenaWhere<Row = AthenaRowShape$1> = AthenaWhereBooleanOperand<Row> & {
|
|
220
|
+
or?: Array<AthenaWhereBooleanOperand<Row>>;
|
|
221
|
+
not?: AthenaWhereBooleanOperand<Row>;
|
|
222
|
+
};
|
|
223
|
+
interface AthenaRelationSelectNode<TSelect extends AthenaSelectShape = AthenaSelectShape> {
|
|
224
|
+
select: TSelect;
|
|
225
|
+
as?: string;
|
|
226
|
+
via?: string;
|
|
227
|
+
schema?: string;
|
|
228
|
+
}
|
|
229
|
+
type AthenaSelectShape = Record<string, true | AthenaRelationSelectNode<AthenaSelectShape>>;
|
|
230
|
+
type GenericRegistryDef = RegistryDef<Record<string, DatabaseDef<Record<string, SchemaDef<Record<string, AnyModelDef>>>>>>;
|
|
231
|
+
type AthenaOrderByDirectionInput = 'asc' | 'desc' | 'ascending' | 'descending' | boolean | {
|
|
232
|
+
ascending?: boolean;
|
|
233
|
+
};
|
|
234
|
+
type AthenaOrderBy<Row = AthenaRowShape$1> = {
|
|
235
|
+
column: ResolvedFilterColumnKey$1<Row>;
|
|
236
|
+
ascending?: boolean;
|
|
237
|
+
} | Partial<Record<ResolvedFilterColumnKey$1<Row>, AthenaOrderByDirectionInput>>;
|
|
238
|
+
interface AthenaFindManyOptions<Row = AthenaRowShape$1, TSelect extends AthenaSelectShape = AthenaSelectShape> {
|
|
239
|
+
select: TSelect;
|
|
240
|
+
where?: AthenaWhere<Row>;
|
|
241
|
+
orderBy?: AthenaOrderBy<Row>;
|
|
242
|
+
limit?: number;
|
|
243
|
+
}
|
|
244
|
+
type AthenaModelContext<TRegistry extends GenericRegistryDef = GenericRegistryDef, TDatabase extends string = string, TSchema extends string = string, TModel extends AnyModelDef = AnyModelDef> = {
|
|
245
|
+
registry: TRegistry;
|
|
246
|
+
database: TDatabase;
|
|
247
|
+
schema: TSchema;
|
|
248
|
+
model: TModel;
|
|
249
|
+
};
|
|
250
|
+
type Simplify<T> = {
|
|
251
|
+
[K in keyof T]: T[K];
|
|
252
|
+
} & {};
|
|
253
|
+
type ContextRegistry<TContext> = TContext extends AthenaModelContext<infer TRegistry, string, string, AnyModelDef> ? TRegistry : never;
|
|
254
|
+
type ContextDatabase<TContext> = TContext extends AthenaModelContext<GenericRegistryDef, infer TDatabase, string, AnyModelDef> ? TDatabase : never;
|
|
255
|
+
type ContextModel<TContext> = TContext extends AthenaModelContext<GenericRegistryDef, string, string, infer TModel> ? TModel : never;
|
|
256
|
+
type ModelMetaOf<TContext> = ContextModel<TContext> extends ModelDef<unknown, unknown, unknown, infer TMeta> ? TMeta : never;
|
|
257
|
+
type ModelRelationsOf<TContext> = NonNullable<ModelMetaOf<TContext>['relations']>;
|
|
258
|
+
type SelectedResultKey<TKey extends string, TValue> = TValue extends {
|
|
259
|
+
as: infer TAlias extends string;
|
|
260
|
+
} ? TAlias : TKey;
|
|
261
|
+
type ScalarSelectionResult<Row, TSelect extends AthenaSelectShape> = {
|
|
262
|
+
[TKey in Extract<keyof TSelect, string> as TSelect[TKey] extends true ? TKey : never]-?: TKey extends keyof NonNullable<Row> ? NonNullable<Row>[TKey] : unknown;
|
|
263
|
+
};
|
|
264
|
+
type RelationByKey<TContext, TKey extends string> = TKey extends keyof ModelRelationsOf<TContext> ? ModelRelationsOf<TContext>[TKey] : never;
|
|
265
|
+
type RelationByVia<TContext, TVia extends string> = {
|
|
266
|
+
[TKey in keyof ModelRelationsOf<TContext>]: ModelRelationsOf<TContext>[TKey] extends infer TRelation ? TRelation extends ModelRelationMetadata ? TVia extends TRelation['sourceColumns'][number] ? TRelation : never : never : never;
|
|
267
|
+
}[keyof ModelRelationsOf<TContext>];
|
|
268
|
+
type ResolvedRelation<TContext, TKey extends string, TValue> = RelationByKey<TContext, TKey> extends never ? TValue extends {
|
|
269
|
+
via: infer TVia extends string;
|
|
270
|
+
} ? RelationByVia<TContext, TVia> : never : RelationByKey<TContext, TKey>;
|
|
271
|
+
type TargetDatabaseName<TContext, TRelation extends ModelRelationMetadata> = TRelation['targetDatabase'] extends string ? TRelation['targetDatabase'] : ContextDatabase<TContext>;
|
|
272
|
+
type ResolveTargetModel<TContext, TRelation extends ModelRelationMetadata> = ContextRegistry<TContext> extends infer TRegistry ? TRegistry extends GenericRegistryDef ? TargetDatabaseName<TContext, TRelation> extends keyof TRegistry & string ? TRelation['targetSchema'] extends keyof TRegistry[TargetDatabaseName<TContext, TRelation>]['schemas'] & string ? TRelation['targetModel'] extends keyof TRegistry[TargetDatabaseName<TContext, TRelation>]['schemas'][TRelation['targetSchema']]['models'] & string ? TRegistry[TargetDatabaseName<TContext, TRelation>]['schemas'][TRelation['targetSchema']]['models'][TRelation['targetModel']] : never : never : never : never : never;
|
|
273
|
+
type RelationResultValue<TRelation extends ModelRelationMetadata, TValue, TContext> = TValue extends AthenaRelationSelectNode<infer TChildSelect> ? ResolveTargetModel<TContext, TRelation> extends infer TTargetModel ? TTargetModel extends AnyModelDef ? TRelation['kind'] extends 'one-to-many' | 'many-to-many' ? Array<AthenaFindManyResult<RowOf<TTargetModel>, TChildSelect, AthenaModelContext<ContextRegistry<TContext>, TargetDatabaseName<TContext, TRelation>, TRelation['targetSchema'], TTargetModel>>> : AthenaFindManyResult<RowOf<TTargetModel>, TChildSelect, AthenaModelContext<ContextRegistry<TContext>, TargetDatabaseName<TContext, TRelation>, TRelation['targetSchema'], TTargetModel>> | null : unknown : unknown : never;
|
|
274
|
+
type RelationSelectionResult<TContext, TSelect extends AthenaSelectShape> = {
|
|
275
|
+
[TKey in Extract<keyof TSelect, string> as TSelect[TKey] extends AthenaRelationSelectNode<AthenaSelectShape> ? SelectedResultKey<TKey, TSelect[TKey]> : never]-?: ResolvedRelation<TContext, TKey, TSelect[TKey]> extends infer TRelation ? TRelation extends ModelRelationMetadata ? RelationResultValue<TRelation, TSelect[TKey], TContext> : unknown : unknown;
|
|
276
|
+
};
|
|
277
|
+
type AthenaFindManyResult<Row, TSelect extends AthenaSelectShape, TContext = unknown> = Simplify<ScalarSelectionResult<Row, TSelect> & RelationSelectionResult<TContext, TSelect>>;
|
|
278
|
+
|
|
279
|
+
interface AthenaResult<T> {
|
|
280
|
+
data: T | null;
|
|
281
|
+
error: AthenaResultError | null;
|
|
282
|
+
statusText?: string | null;
|
|
283
|
+
/**
|
|
284
|
+
* @deprecated Prefer `error?.gatewayCode`, `error?.hint`, and related fields on `error`.
|
|
285
|
+
*/
|
|
286
|
+
errorDetails?: AthenaGatewayErrorDetails | null;
|
|
287
|
+
status: number;
|
|
288
|
+
count?: number | null;
|
|
289
|
+
raw: unknown;
|
|
290
|
+
}
|
|
291
|
+
interface AthenaResultError {
|
|
292
|
+
message: string;
|
|
293
|
+
code: string | null;
|
|
294
|
+
athenaCode: NormalizedAthenaError['code'];
|
|
295
|
+
gatewayCode?: AthenaGatewayErrorDetails['code'] | null;
|
|
296
|
+
kind: NormalizedAthenaError['kind'];
|
|
297
|
+
category: NormalizedAthenaError['category'];
|
|
298
|
+
retryable: boolean;
|
|
299
|
+
details: unknown | null;
|
|
300
|
+
hint: string | null;
|
|
301
|
+
status: number;
|
|
302
|
+
statusText: string | null;
|
|
303
|
+
constraint?: string;
|
|
304
|
+
table?: string;
|
|
305
|
+
operation?: string;
|
|
306
|
+
endpoint?: AthenaGatewayErrorDetails['endpoint'];
|
|
307
|
+
method?: AthenaGatewayErrorDetails['method'];
|
|
308
|
+
requestId?: string;
|
|
309
|
+
cause?: string;
|
|
310
|
+
raw: unknown;
|
|
311
|
+
}
|
|
312
|
+
interface AthenaClientExperimentalOptions {
|
|
313
|
+
/**
|
|
314
|
+
* @deprecated Failed `AthenaResult` values now include normalized structured `error`
|
|
315
|
+
* envelopes by default. This flag is retained as a no-op compatibility switch.
|
|
316
|
+
*/
|
|
317
|
+
enableErrorNormalization?: boolean;
|
|
318
|
+
/**
|
|
319
|
+
* Emit execution diagnostics for every query/mutation/RPC invocation.
|
|
320
|
+
* Includes payload, synthesized SQL, full outcome, and best-effort callsite metadata.
|
|
321
|
+
*/
|
|
322
|
+
traceQueries?: boolean | AthenaQueryTraceOptions;
|
|
323
|
+
/**
|
|
324
|
+
* Send the original `findMany(...)` AST body for clean object-select reads.
|
|
325
|
+
* This requires gateway support and falls back to legacy compiled transport
|
|
326
|
+
* when a chain carries filter/pagination state that the AST payload cannot
|
|
327
|
+
* represent losslessly yet.
|
|
328
|
+
*/
|
|
329
|
+
findManyAst?: boolean;
|
|
330
|
+
}
|
|
331
|
+
interface AthenaQueryTraceOptions {
|
|
332
|
+
/**
|
|
333
|
+
* Custom sink for trace events. Defaults to console.info.
|
|
334
|
+
*/
|
|
335
|
+
logger?: (event: AthenaQueryTraceEvent) => void;
|
|
336
|
+
}
|
|
337
|
+
interface AthenaQueryTraceCallsite {
|
|
338
|
+
filePath: string;
|
|
339
|
+
fileName: string;
|
|
340
|
+
line: number;
|
|
341
|
+
column: number;
|
|
342
|
+
frame?: string;
|
|
343
|
+
functionName?: string;
|
|
344
|
+
}
|
|
345
|
+
interface AthenaQueryTraceEvent {
|
|
346
|
+
timestamp: string;
|
|
347
|
+
durationMs: number;
|
|
348
|
+
operation: 'select' | 'insert' | 'upsert' | 'update' | 'delete' | 'rpc' | 'query';
|
|
349
|
+
endpoint: '/gateway/fetch' | '/gateway/insert' | '/gateway/update' | '/gateway/delete' | '/gateway/rpc' | '/gateway/query' | `/rpc/${string}`;
|
|
350
|
+
table?: string;
|
|
351
|
+
functionName?: string;
|
|
352
|
+
sql: string;
|
|
353
|
+
payload: unknown;
|
|
354
|
+
options?: AthenaGatewayCallOptions | AthenaRpcCallOptions;
|
|
355
|
+
callsite: AthenaQueryTraceCallsite | null;
|
|
356
|
+
outcome?: {
|
|
357
|
+
status: number;
|
|
358
|
+
error: AthenaResultError | null;
|
|
359
|
+
errorDetails?: AthenaGatewayErrorDetails | null;
|
|
360
|
+
count?: number | null;
|
|
361
|
+
data: unknown;
|
|
362
|
+
raw: unknown;
|
|
363
|
+
};
|
|
364
|
+
thrownError?: unknown;
|
|
365
|
+
}
|
|
366
|
+
type MutationSingleResult<Result> = Result extends Array<infer Item> ? Item | null : Result | null;
|
|
367
|
+
type AthenaRowShape = Record<string, AthenaJsonValue | undefined>;
|
|
368
|
+
type FilterColumnKey<Row> = Extract<keyof NonNullable<Row>, string>;
|
|
369
|
+
type ResolvedFilterColumnKey<Row> = [FilterColumnKey<Row>] extends [never] ? string : FilterColumnKey<Row>;
|
|
370
|
+
interface MutationQuery<Result> extends PromiseLike<AthenaResult<Result>> {
|
|
371
|
+
select(columns?: string | string[], options?: AthenaGatewayCallOptions): Promise<AthenaResult<Result>>;
|
|
372
|
+
returning(columns?: string | string[], options?: AthenaGatewayCallOptions): Promise<AthenaResult<Result>>;
|
|
373
|
+
single(columns?: string | string[], options?: AthenaGatewayCallOptions): Promise<AthenaResult<MutationSingleResult<Result>>>;
|
|
374
|
+
maybeSingle(columns?: string | string[], options?: AthenaGatewayCallOptions): Promise<AthenaResult<MutationSingleResult<Result>>>;
|
|
375
|
+
then<TResult1 = AthenaResult<Result>, TResult2 = never>(onfulfilled?: ((value: AthenaResult<Result>) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: unknown) => TResult2 | PromiseLike<TResult2>) | undefined | null): Promise<TResult1 | TResult2>;
|
|
376
|
+
catch<TResult = never>(onrejected?: ((reason: unknown) => TResult | PromiseLike<TResult>) | undefined | null): Promise<AthenaResult<Result> | TResult>;
|
|
377
|
+
finally(onfinally?: (() => void) | undefined | null): Promise<AthenaResult<Result>>;
|
|
378
|
+
}
|
|
379
|
+
interface OrderOptions {
|
|
380
|
+
ascending?: boolean;
|
|
381
|
+
}
|
|
382
|
+
/** Shared filter chain - supports eq, limit, etc. in any order relative to select/update */
|
|
383
|
+
interface FilterChain<Self, Row> {
|
|
384
|
+
eq(column: ResolvedFilterColumnKey<Row>, value: AthenaConditionValue): Self;
|
|
385
|
+
eqCast(column: ResolvedFilterColumnKey<Row>, value: AthenaConditionValue, cast: AthenaConditionCastType): Self;
|
|
386
|
+
eqUuid(column: ResolvedFilterColumnKey<Row>, value: string): Self;
|
|
387
|
+
match(filters: Partial<Record<ResolvedFilterColumnKey<Row>, AthenaConditionValue>>): Self;
|
|
388
|
+
range(from: number, to: number): Self;
|
|
389
|
+
limit(count: number): Self;
|
|
390
|
+
offset(count: number): Self;
|
|
391
|
+
currentPage(value: number): Self;
|
|
392
|
+
pageSize(value: number): Self;
|
|
393
|
+
totalPages(value: number): Self;
|
|
394
|
+
order(column: ResolvedFilterColumnKey<Row>, options?: OrderOptions): Self;
|
|
395
|
+
gt(column: ResolvedFilterColumnKey<Row>, value: AthenaConditionValue): Self;
|
|
396
|
+
gte(column: ResolvedFilterColumnKey<Row>, value: AthenaConditionValue): Self;
|
|
397
|
+
lt(column: ResolvedFilterColumnKey<Row>, value: AthenaConditionValue): Self;
|
|
398
|
+
lte(column: ResolvedFilterColumnKey<Row>, value: AthenaConditionValue): Self;
|
|
399
|
+
neq(column: ResolvedFilterColumnKey<Row>, value: AthenaConditionValue): Self;
|
|
400
|
+
like(column: ResolvedFilterColumnKey<Row>, value: AthenaConditionValue): Self;
|
|
401
|
+
ilike(column: ResolvedFilterColumnKey<Row>, value: AthenaConditionValue): Self;
|
|
402
|
+
is(column: ResolvedFilterColumnKey<Row>, value: AthenaConditionValue): Self;
|
|
403
|
+
in(column: ResolvedFilterColumnKey<Row>, values: AthenaConditionArrayValue): Self;
|
|
404
|
+
contains(column: ResolvedFilterColumnKey<Row>, values: AthenaConditionArrayValue): Self;
|
|
405
|
+
containedBy(column: ResolvedFilterColumnKey<Row>, values: AthenaConditionArrayValue): Self;
|
|
406
|
+
not(columnOrExpression: ResolvedFilterColumnKey<Row> | string, operator?: AthenaConditionOperator, value?: AthenaConditionValue): Self;
|
|
407
|
+
or(expression: string): Self;
|
|
408
|
+
}
|
|
409
|
+
/** Chain returned by select() - supports filters and single/maybeSingle before execution */
|
|
410
|
+
interface SelectChain<Row, SelectedRow = Row> extends FilterChain<SelectChain<Row, SelectedRow>, Row>, PromiseLike<AthenaResult<SelectedRow[]>> {
|
|
411
|
+
single<T = SelectedRow>(columns?: string | string[], options?: AthenaGatewayCallOptions): Promise<AthenaResult<T | null>>;
|
|
412
|
+
maybeSingle<T = SelectedRow>(columns?: string | string[], options?: AthenaGatewayCallOptions): Promise<AthenaResult<T | null>>;
|
|
413
|
+
}
|
|
414
|
+
/** Chain returned by update() - supports filters before execution, plus select/returning */
|
|
415
|
+
interface UpdateChain<Row> extends FilterChain<UpdateChain<Row>, Row>, MutationQuery<Row[]> {
|
|
416
|
+
}
|
|
417
|
+
interface RpcFilterChain<Self> {
|
|
418
|
+
eq(column: string, value: AthenaConditionValue): Self;
|
|
419
|
+
neq(column: string, value: AthenaConditionValue): Self;
|
|
420
|
+
gt(column: string, value: AthenaConditionValue): Self;
|
|
421
|
+
gte(column: string, value: AthenaConditionValue): Self;
|
|
422
|
+
lt(column: string, value: AthenaConditionValue): Self;
|
|
423
|
+
lte(column: string, value: AthenaConditionValue): Self;
|
|
424
|
+
like(column: string, value: AthenaConditionValue): Self;
|
|
425
|
+
ilike(column: string, value: AthenaConditionValue): Self;
|
|
426
|
+
is(column: string, value: AthenaConditionValue): Self;
|
|
427
|
+
in(column: string, values: AthenaConditionArrayValue): Self;
|
|
428
|
+
}
|
|
429
|
+
interface RpcOrderOptions {
|
|
430
|
+
ascending?: boolean;
|
|
431
|
+
}
|
|
432
|
+
interface RpcQueryBuilder<Row> extends RpcFilterChain<RpcQueryBuilder<Row>>, PromiseLike<AthenaResult<Row[]>> {
|
|
433
|
+
select(columns?: string | string[], options?: AthenaRpcCallOptions): Promise<AthenaResult<Row[]>>;
|
|
434
|
+
single<T = Row>(columns?: string | string[], options?: AthenaRpcCallOptions): Promise<AthenaResult<T | null>>;
|
|
435
|
+
maybeSingle<T = Row>(columns?: string | string[], options?: AthenaRpcCallOptions): Promise<AthenaResult<T | null>>;
|
|
436
|
+
order(column: string, options?: RpcOrderOptions): RpcQueryBuilder<Row>;
|
|
437
|
+
limit(count: number): RpcQueryBuilder<Row>;
|
|
438
|
+
offset(count: number): RpcQueryBuilder<Row>;
|
|
439
|
+
range(from: number, to: number): RpcQueryBuilder<Row>;
|
|
440
|
+
}
|
|
441
|
+
interface AthenaFromOptions {
|
|
442
|
+
schema?: string;
|
|
443
|
+
}
|
|
444
|
+
interface TableQueryBuilder<Row, Insert = Partial<Row>, Update = Partial<Insert>, TContext = unknown> extends FilterChain<TableQueryBuilder<Row, Insert, Update, TContext>, Row> {
|
|
445
|
+
select<T = Row>(columns?: string | string[], options?: AthenaGatewayCallOptions): SelectChain<Row, T>;
|
|
446
|
+
findMany<const TSelect extends AthenaSelectShape>(options: AthenaFindManyOptions<Row, TSelect>): Promise<AthenaResult<Array<AthenaFindManyResult<Row, TSelect, TContext>>>>;
|
|
447
|
+
insert(values: Insert, options?: AthenaGatewayCallOptions): MutationQuery<Row>;
|
|
448
|
+
insert(values: Insert[], options?: AthenaGatewayCallOptions): MutationQuery<Row[]>;
|
|
449
|
+
upsert(values: Insert, options?: AthenaGatewayCallOptions & {
|
|
450
|
+
updateBody?: Update;
|
|
451
|
+
onConflict?: string | string[];
|
|
452
|
+
}): MutationQuery<Row>;
|
|
453
|
+
upsert(values: Insert[], options?: AthenaGatewayCallOptions & {
|
|
454
|
+
updateBody?: Update;
|
|
455
|
+
onConflict?: string | string[];
|
|
456
|
+
}): MutationQuery<Row[]>;
|
|
457
|
+
update(values: Update, options?: AthenaGatewayCallOptions): UpdateChain<Row>;
|
|
458
|
+
delete(options?: AthenaGatewayCallOptions & {
|
|
459
|
+
resourceId?: string;
|
|
460
|
+
}): MutationQuery<Row | null>;
|
|
461
|
+
single<T = Row>(columns?: string | string[], options?: AthenaGatewayCallOptions): Promise<AthenaResult<T | null>>;
|
|
462
|
+
maybeSingle<T = Row>(columns?: string | string[], options?: AthenaGatewayCallOptions): Promise<AthenaResult<T | null>>;
|
|
463
|
+
reset(): TableQueryBuilder<Row, Insert, Update, TContext>;
|
|
464
|
+
}
|
|
465
|
+
interface AthenaSdkClient {
|
|
466
|
+
from<Row = AthenaRowShape, Insert = Partial<Row>, Update = Partial<Insert>>(table: string, options?: AthenaFromOptions): TableQueryBuilder<Row, Insert, Update>;
|
|
467
|
+
db: AthenaDbModule;
|
|
468
|
+
rpc<Row = unknown, Args extends AthenaJsonObject = AthenaJsonObject>(fn: string, args?: Args, options?: AthenaRpcCallOptions): RpcQueryBuilder<Row>;
|
|
469
|
+
query<Row = unknown>(query: string, options?: AthenaGatewayCallOptions): Promise<AthenaResult<Row[]>>;
|
|
470
|
+
verifyConnection(options?: AthenaGatewayConnectionOptions): Promise<AthenaGatewayConnectionResult>;
|
|
471
|
+
}
|
|
472
|
+
interface AthenaSdkClientWithAuth extends AthenaSdkClient {
|
|
473
|
+
auth: AthenaAuthBindings;
|
|
474
|
+
}
|
|
475
|
+
interface AthenaClientBuilder {
|
|
476
|
+
/** Set the gateway base URL. */
|
|
477
|
+
url(url: string): AthenaClientBuilder;
|
|
478
|
+
/** Set the API key used for all requests. */
|
|
479
|
+
key(apiKey: string): AthenaClientBuilder;
|
|
480
|
+
/** Set the default backend routing strategy. */
|
|
481
|
+
backend(backend: BackendConfig | BackendType): AthenaClientBuilder;
|
|
482
|
+
/** Set the default Athena client routing key. */
|
|
483
|
+
client(clientName: string): AthenaClientBuilder;
|
|
484
|
+
/** Attach static headers to every request. */
|
|
485
|
+
headers(headers: Record<string, string>): AthenaClientBuilder;
|
|
486
|
+
/** Configure Athena Auth client behavior for `client.auth.*` methods. */
|
|
487
|
+
auth(config: AthenaAuthClientConfig): AthenaClientBuilder;
|
|
488
|
+
/** Configure experimental client options (for example query tracing or findMany AST transport). */
|
|
489
|
+
experimental(options: AthenaClientExperimentalOptions): AthenaClientBuilder;
|
|
490
|
+
/** Apply the same options object accepted by `createClient(url, key, options)`. */
|
|
491
|
+
options(options: AthenaCreateClientOptions): AthenaClientBuilder;
|
|
492
|
+
/** Enable or disable health tracking metadata. */
|
|
493
|
+
healthTracking(enabled: boolean): AthenaClientBuilder;
|
|
494
|
+
/** Build the immutable Athena SDK client. */
|
|
495
|
+
build(): AthenaSdkClientWithAuth;
|
|
496
|
+
}
|
|
497
|
+
/** Canonical Athena client factory with builder-based configuration. */
|
|
498
|
+
declare class AthenaClient {
|
|
499
|
+
/** Create a fluent builder for a strongly-typed Athena SDK client. */
|
|
500
|
+
static builder(): AthenaClientBuilder;
|
|
501
|
+
/** Build a client from process environment variables. */
|
|
502
|
+
static fromEnvironment(): AthenaSdkClientWithAuth;
|
|
503
|
+
}
|
|
504
|
+
interface AthenaCreateClientOptions extends Pick<AthenaGatewayCallOptions, 'client' | 'headers' | 'backend'> {
|
|
505
|
+
auth?: AthenaAuthClientConfig;
|
|
506
|
+
experimental?: AthenaClientExperimentalOptions;
|
|
507
|
+
}
|
|
508
|
+
/** Create client (convenience wrapper; use AthenaClient.builder() for full control) */
|
|
509
|
+
declare function createClient(url: string, apiKey: string, options?: AthenaCreateClientOptions): AthenaSdkClientWithAuth;
|
|
510
|
+
|
|
511
|
+
declare function verifyAthenaGatewayUrl(baseUrl: string, options?: AthenaGatewayConnectionOptions): Promise<AthenaGatewayConnectionResult>;
|
|
512
|
+
|
|
513
|
+
interface NormalizeAthenaGatewayBaseUrlOptions {
|
|
514
|
+
defaultBaseUrl?: string;
|
|
515
|
+
label?: string;
|
|
516
|
+
}
|
|
517
|
+
declare function normalizeAthenaGatewayBaseUrl(input: string | null | undefined, options?: NormalizeAthenaGatewayBaseUrlOptions): string;
|
|
518
|
+
|
|
349
519
|
/**
|
|
350
520
|
* Immutable identifier object with consistent SQL rendering.
|
|
351
521
|
*/
|
|
@@ -394,7 +564,12 @@ interface TypedAthenaClient<TRegistry extends RegistryConstraint, TTenantMap ext
|
|
|
394
564
|
readonly tenantKeyMap: Readonly<TTenantMap>;
|
|
395
565
|
readonly tenantContext: TenantContext<TTenantMap>;
|
|
396
566
|
withTenantContext(context: TenantContext<TTenantMap>): TypedAthenaClient<TRegistry, TTenantMap>;
|
|
397
|
-
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
|
|
567
|
+
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>>, {
|
|
568
|
+
registry: TRegistry;
|
|
569
|
+
database: TDatabase;
|
|
570
|
+
schema: TSchema;
|
|
571
|
+
model: ModelAt<TRegistry, TDatabase, TSchema, TModel>;
|
|
572
|
+
}>;
|
|
398
573
|
}
|
|
399
574
|
/**
|
|
400
575
|
* Creates a typed client bound to a registry contract and optional tenant header mapping.
|
|
@@ -432,4 +607,17 @@ declare function resolveProviderSchemas(providerConfig: GeneratorProviderConfig)
|
|
|
432
607
|
*/
|
|
433
608
|
declare function createAuthClient(config?: AthenaAuthClientConfig): AthenaAuthSdkClient;
|
|
434
609
|
|
|
435
|
-
|
|
610
|
+
interface AthenaAuthRenderedReactEmail {
|
|
611
|
+
html: string;
|
|
612
|
+
text?: string;
|
|
613
|
+
}
|
|
614
|
+
interface AthenaAuthReactEmailRuntimeOptions {
|
|
615
|
+
route?: string;
|
|
616
|
+
defaults?: AthenaAuthReactEmailRenderOptions;
|
|
617
|
+
observe?: (event: AthenaAuthReactEmailRenderEvent) => void;
|
|
618
|
+
}
|
|
619
|
+
declare function createAuthReactEmailInput<TProps extends AthenaAuthReactEmailProps = AthenaAuthReactEmailProps>(component: AthenaAuthReactEmailComponent<TProps>, props: TProps, overrides?: Omit<AthenaAuthReactEmailRenderInput, 'component' | 'props' | 'element'>): AthenaAuthReactEmailRenderInput;
|
|
620
|
+
declare function defineAuthEmailTemplate<TProps extends AthenaAuthReactEmailProps = AthenaAuthReactEmailProps>(definition: AthenaAuthEmailTemplateDefinition<TProps>): AthenaAuthEmailTemplateBuilder<TProps>;
|
|
621
|
+
declare function renderAthenaReactEmail(input: AthenaAuthReactEmailRenderInput, options?: AthenaAuthReactEmailRuntimeOptions | AthenaAuthReactEmailConfig): Promise<AthenaAuthRenderedReactEmail>;
|
|
622
|
+
|
|
623
|
+
export { isOk as $, AthenaClient as A, type RetryConfig as B, type RpcOrderOptions as C, DEFAULT_POSTGRES_SCHEMAS as D, type RpcQueryBuilder as E, type TypedAthenaClient as F, type TypedClientOptions as G, type UnwrapOptions as H, type IntCoercionOptions as I, assertInt as J, coerceInt as K, createAuthClient as L, createAuthReactEmailInput as M, type NormalizedAthenaError as N, createClient as O, type PostgresIntrospectionProviderOptions as P, createPostgresIntrospectionProvider as Q, type RequireAffectedOptions as R, createTypedClient as S, type TableQueryBuilder as T, type UnwrapOneOptions as U, defineAuthEmailTemplate as V, defineDatabase as W, defineModel as X, defineRegistry as Y, defineSchema as Z, identifier as _, type AthenaClientExperimentalOptions as a, normalizeAthenaError as a0, normalizeAthenaGatewayBaseUrl as a1, normalizeSchemaSelection as a2, parseBooleanFlag as a3, renderAthenaReactEmail as a4, requireAffected as a5, requireSuccess as a6, resolvePostgresColumnType as a7, resolveProviderSchemas as a8, unwrap as a9, unwrapOne as aa, unwrapRows as ab, verifyAthenaGatewayUrl as ac, withRetry as ad, type AthenaCreateClientOptions as b, type AthenaDbModule as c, AthenaError as d, AthenaErrorCategory as e, AthenaErrorCode as f, type AthenaErrorInput as g, AthenaErrorKind as h, type AthenaFindManyOptions as i, type AthenaFindManyResult as j, type AthenaFromOptions as k, type AthenaOperationContext as l, type AthenaOrderBy as m, type AthenaQueryTraceCallsite as n, type AthenaQueryTraceEvent as o, type AthenaQueryTraceOptions as p, type AthenaRelationSelectNode as q, type AthenaResult as r, type AthenaResultError as s, type AthenaSdkClient as t, type AthenaSdkClientWithAuth as u, type AthenaSelectShape as v, type AthenaWhere as w, type AthenaWhereBooleanOperand as x, type AthenaWhereOperatorInput as y, type RetryBackoffStrategy as z };
|