@xylex-group/athena 1.7.0 → 1.9.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 +24 -11
- package/bin/athena-js.js +0 -0
- package/dist/cli/index.cjs +73 -35
- package/dist/cli/index.cjs.map +1 -1
- package/dist/cli/index.d.cts +2 -2
- package/dist/cli/index.d.ts +2 -2
- package/dist/cli/index.js +73 -35
- package/dist/cli/index.js.map +1 -1
- package/dist/index.cjs +139 -37
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +44 -41
- package/dist/index.d.ts +44 -41
- package/dist/index.js +137 -38
- package/dist/index.js.map +1 -1
- package/dist/model-form-Bm_kqCn2.d.ts +92 -0
- package/dist/model-form-DkS48fsh.d.cts +92 -0
- package/dist/pipeline-C-cN0ACi.d.cts +164 -0
- package/dist/pipeline-CQgV-Yfo.d.ts +164 -0
- package/dist/react.cjs +64 -0
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +3 -3
- package/dist/react.d.ts +3 -3
- package/dist/react.js +62 -1
- package/dist/react.js.map +1 -1
- package/dist/types-BnzoaNRC.d.cts +380 -0
- package/dist/types-BnzoaNRC.d.ts +380 -0
- package/package.json +15 -14
- package/dist/errors-BJGgjHcI.d.cts +0 -31
- package/dist/errors-Bcf5Sftv.d.ts +0 -31
- package/dist/pipeline-BsKuBqmE.d.cts +0 -343
- package/dist/pipeline-xQSjGbqF.d.ts +0 -343
- package/dist/types-wPA1Z4vQ.d.cts +0 -195
- package/dist/types-wPA1Z4vQ.d.ts +0 -195
package/dist/index.d.cts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { B as BackendConfig, a as BackendType, A as
|
|
2
|
-
export {
|
|
3
|
-
export { A as AthenaGatewayError, i as isAthenaGatewayError } from './
|
|
4
|
-
import {
|
|
5
|
-
export {
|
|
1
|
+
import { B as BackendConfig, a as BackendType, A as AthenaJsonValue, b as AthenaConditionValue, c as AthenaConditionCastType, d as AthenaConditionArrayValue, e as AthenaConditionOperator, f as AthenaGatewayCallOptions, g as AthenaGatewayErrorDetails, h as AthenaJsonObject, i as AthenaRpcCallOptions, S as SchemaDef, j as AnyModelDef, D as DatabaseDef, M as ModelMetadata, k as ModelDef, R as RegistryDef, T as TenantKeyMap, l as TenantContext, m as RowOf, n as ModelAt, I as InsertOf, U as UpdateOf, o as SchemaIntrospectionProvider, p as IntrospectionSnapshot, q as IntrospectionColumn } from './types-BnzoaNRC.cjs';
|
|
2
|
+
export { r as AthenaGatewayErrorCode, s as AthenaJsonArray, t as AthenaJsonPrimitive, u as AthenaRpcFilter, v as AthenaRpcFilterOperator, w as AthenaRpcOrder, x as AthenaRpcPayload, y as Backend, z as IntrospectionInspectOptions, C as IntrospectionRelation, E as IntrospectionSchema, F as IntrospectionTable, G as IntrospectionTypeKind, H as ModelRelationKind, J as ModelRelationMetadata, K as TenantContextValue } from './types-BnzoaNRC.cjs';
|
|
3
|
+
export { A as AthenaGatewayError, M as ModelFormAdapter, a as ModelFormDefaults, b as ModelFormNullishMode, c as ModelFormValues, T as ToModelFormDefaultsOptions, d as ToModelPayloadOptions, e as createModelFormAdapter, i as isAthenaGatewayError, t as toModelFormDefaults, f as toModelPayload } from './model-form-DkS48fsh.cjs';
|
|
4
|
+
import { A as AthenaGeneratorConfig, L as LoadGeneratorConfigOptions, a as LoadedGeneratorConfig, N as NormalizedAthenaGeneratorConfig, G as GeneratedArtifacts, b as GeneratorProviderConfig, c as GeneratorExperimentalFlags, d as GeneratorSchemaSelection } from './pipeline-C-cN0ACi.cjs';
|
|
5
|
+
export { e as GeneratedArtifact, f as GeneratorArtifactKind, g as GeneratorFeatureFlags, h as GeneratorNamingConfig, i as GeneratorOutputConfig, j as GeneratorOutputTargets, k as NamingStyle, R as RunGeneratorOptions, l as RunGeneratorResult, r as runSchemaGenerator } from './pipeline-C-cN0ACi.cjs';
|
|
6
6
|
|
|
7
7
|
interface AthenaResult<T> {
|
|
8
8
|
data: T | null;
|
|
@@ -13,6 +13,9 @@ interface AthenaResult<T> {
|
|
|
13
13
|
raw: unknown;
|
|
14
14
|
}
|
|
15
15
|
type MutationSingleResult<Result> = Result extends Array<infer Item> ? Item | null : Result | null;
|
|
16
|
+
type AthenaRowShape = Record<string, AthenaJsonValue | undefined>;
|
|
17
|
+
type FilterColumnKey<Row> = Extract<keyof NonNullable<Row>, string>;
|
|
18
|
+
type ResolvedFilterColumnKey<Row> = [FilterColumnKey<Row>] extends [never] ? string : FilterColumnKey<Row>;
|
|
16
19
|
interface MutationQuery<Result> extends PromiseLike<AthenaResult<Result>> {
|
|
17
20
|
select(columns?: string | string[], options?: AthenaGatewayCallOptions): Promise<AthenaResult<Result>>;
|
|
18
21
|
returning(columns?: string | string[], options?: AthenaGatewayCallOptions): Promise<AthenaResult<Result>>;
|
|
@@ -26,39 +29,39 @@ interface OrderOptions {
|
|
|
26
29
|
ascending?: boolean;
|
|
27
30
|
}
|
|
28
31
|
/** Shared filter chain - supports eq, limit, etc. in any order relative to select/update */
|
|
29
|
-
interface FilterChain<Self> {
|
|
30
|
-
eq(column:
|
|
31
|
-
eqCast(column:
|
|
32
|
-
eqUuid(column:
|
|
33
|
-
match(filters: Record<
|
|
32
|
+
interface FilterChain<Self, Row> {
|
|
33
|
+
eq(column: ResolvedFilterColumnKey<Row>, value: AthenaConditionValue): Self;
|
|
34
|
+
eqCast(column: ResolvedFilterColumnKey<Row>, value: AthenaConditionValue, cast: AthenaConditionCastType): Self;
|
|
35
|
+
eqUuid(column: ResolvedFilterColumnKey<Row>, value: string): Self;
|
|
36
|
+
match(filters: Partial<Record<ResolvedFilterColumnKey<Row>, AthenaConditionValue>>): Self;
|
|
34
37
|
range(from: number, to: number): Self;
|
|
35
38
|
limit(count: number): Self;
|
|
36
39
|
offset(count: number): Self;
|
|
37
40
|
currentPage(value: number): Self;
|
|
38
41
|
pageSize(value: number): Self;
|
|
39
42
|
totalPages(value: number): Self;
|
|
40
|
-
order(column:
|
|
41
|
-
gt(column:
|
|
42
|
-
gte(column:
|
|
43
|
-
lt(column:
|
|
44
|
-
lte(column:
|
|
45
|
-
neq(column:
|
|
46
|
-
like(column:
|
|
47
|
-
ilike(column:
|
|
48
|
-
is(column:
|
|
49
|
-
in(column:
|
|
50
|
-
contains(column:
|
|
51
|
-
containedBy(column:
|
|
52
|
-
not(columnOrExpression: string, operator?: AthenaConditionOperator, value?: AthenaConditionValue): Self;
|
|
43
|
+
order(column: ResolvedFilterColumnKey<Row>, options?: OrderOptions): Self;
|
|
44
|
+
gt(column: ResolvedFilterColumnKey<Row>, value: AthenaConditionValue): Self;
|
|
45
|
+
gte(column: ResolvedFilterColumnKey<Row>, value: AthenaConditionValue): Self;
|
|
46
|
+
lt(column: ResolvedFilterColumnKey<Row>, value: AthenaConditionValue): Self;
|
|
47
|
+
lte(column: ResolvedFilterColumnKey<Row>, value: AthenaConditionValue): Self;
|
|
48
|
+
neq(column: ResolvedFilterColumnKey<Row>, value: AthenaConditionValue): Self;
|
|
49
|
+
like(column: ResolvedFilterColumnKey<Row>, value: AthenaConditionValue): Self;
|
|
50
|
+
ilike(column: ResolvedFilterColumnKey<Row>, value: AthenaConditionValue): Self;
|
|
51
|
+
is(column: ResolvedFilterColumnKey<Row>, value: AthenaConditionValue): Self;
|
|
52
|
+
in(column: ResolvedFilterColumnKey<Row>, values: AthenaConditionArrayValue): Self;
|
|
53
|
+
contains(column: ResolvedFilterColumnKey<Row>, values: AthenaConditionArrayValue): Self;
|
|
54
|
+
containedBy(column: ResolvedFilterColumnKey<Row>, values: AthenaConditionArrayValue): Self;
|
|
55
|
+
not(columnOrExpression: ResolvedFilterColumnKey<Row> | string, operator?: AthenaConditionOperator, value?: AthenaConditionValue): Self;
|
|
53
56
|
or(expression: string): Self;
|
|
54
57
|
}
|
|
55
58
|
/** Chain returned by select() - supports filters and single/maybeSingle before execution */
|
|
56
|
-
interface SelectChain<Row> extends FilterChain<SelectChain<Row
|
|
57
|
-
single<T =
|
|
58
|
-
maybeSingle<T =
|
|
59
|
+
interface SelectChain<Row, SelectedRow = Row> extends FilterChain<SelectChain<Row, SelectedRow>, Row>, PromiseLike<AthenaResult<SelectedRow[]>> {
|
|
60
|
+
single<T = SelectedRow>(columns?: string | string[], options?: AthenaGatewayCallOptions): Promise<AthenaResult<T | null>>;
|
|
61
|
+
maybeSingle<T = SelectedRow>(columns?: string | string[], options?: AthenaGatewayCallOptions): Promise<AthenaResult<T | null>>;
|
|
59
62
|
}
|
|
60
63
|
/** Chain returned by update() - supports filters before execution, plus select/returning */
|
|
61
|
-
interface UpdateChain<Row> extends FilterChain<UpdateChain<Row
|
|
64
|
+
interface UpdateChain<Row> extends FilterChain<UpdateChain<Row>, Row>, MutationQuery<Row[]> {
|
|
62
65
|
}
|
|
63
66
|
interface RpcFilterChain<Self> {
|
|
64
67
|
eq(column: string, value: AthenaConditionValue): Self;
|
|
@@ -84,29 +87,29 @@ interface RpcQueryBuilder<Row> extends RpcFilterChain<RpcQueryBuilder<Row>>, Pro
|
|
|
84
87
|
offset(count: number): RpcQueryBuilder<Row>;
|
|
85
88
|
range(from: number, to: number): RpcQueryBuilder<Row>;
|
|
86
89
|
}
|
|
87
|
-
interface TableQueryBuilder<Row
|
|
88
|
-
select<T = Row>(columns?: string | string[], options?: AthenaGatewayCallOptions): SelectChain<T>;
|
|
89
|
-
insert(values:
|
|
90
|
-
insert(values:
|
|
91
|
-
upsert(values:
|
|
92
|
-
updateBody?:
|
|
90
|
+
interface TableQueryBuilder<Row, Insert = Partial<Row>, Update = Partial<Insert>> extends FilterChain<TableQueryBuilder<Row, Insert, Update>, Row> {
|
|
91
|
+
select<T = Row>(columns?: string | string[], options?: AthenaGatewayCallOptions): SelectChain<Row, T>;
|
|
92
|
+
insert(values: Insert, options?: AthenaGatewayCallOptions): MutationQuery<Row>;
|
|
93
|
+
insert(values: Insert[], options?: AthenaGatewayCallOptions): MutationQuery<Row[]>;
|
|
94
|
+
upsert(values: Insert, options?: AthenaGatewayCallOptions & {
|
|
95
|
+
updateBody?: Update;
|
|
93
96
|
onConflict?: string | string[];
|
|
94
97
|
}): MutationQuery<Row>;
|
|
95
|
-
upsert(values:
|
|
96
|
-
updateBody?:
|
|
98
|
+
upsert(values: Insert[], options?: AthenaGatewayCallOptions & {
|
|
99
|
+
updateBody?: Update;
|
|
97
100
|
onConflict?: string | string[];
|
|
98
101
|
}): MutationQuery<Row[]>;
|
|
99
|
-
update(values:
|
|
102
|
+
update(values: Update, options?: AthenaGatewayCallOptions): UpdateChain<Row>;
|
|
100
103
|
delete(options?: AthenaGatewayCallOptions & {
|
|
101
104
|
resourceId?: string;
|
|
102
105
|
}): MutationQuery<Row | null>;
|
|
103
106
|
single<T = Row>(columns?: string | string[], options?: AthenaGatewayCallOptions): Promise<AthenaResult<T | null>>;
|
|
104
107
|
maybeSingle<T = Row>(columns?: string | string[], options?: AthenaGatewayCallOptions): Promise<AthenaResult<T | null>>;
|
|
105
|
-
reset(): TableQueryBuilder<Row>;
|
|
108
|
+
reset(): TableQueryBuilder<Row, Insert, Update>;
|
|
106
109
|
}
|
|
107
110
|
interface AthenaSdkClient {
|
|
108
|
-
from<Row =
|
|
109
|
-
rpc<Row = unknown, Args extends
|
|
111
|
+
from<Row = AthenaRowShape, Insert = Partial<Row>, Update = Partial<Insert>>(table: string): TableQueryBuilder<Row, Insert, Update>;
|
|
112
|
+
rpc<Row = unknown, Args extends AthenaJsonObject = AthenaJsonObject>(fn: string, args?: Args, options?: AthenaRpcCallOptions): RpcQueryBuilder<Row>;
|
|
110
113
|
query<Row = unknown>(query: string, options?: AthenaGatewayCallOptions): Promise<AthenaResult<Row[]>>;
|
|
111
114
|
}
|
|
112
115
|
interface AthenaClientBuilder {
|
|
@@ -352,7 +355,7 @@ interface TypedAthenaClient<TRegistry extends RegistryConstraint, TTenantMap ext
|
|
|
352
355
|
readonly tenantKeyMap: Readonly<TTenantMap>;
|
|
353
356
|
readonly tenantContext: TenantContext<TTenantMap>;
|
|
354
357
|
withTenantContext(context: TenantContext<TTenantMap>): TypedAthenaClient<TRegistry, TTenantMap>;
|
|
355
|
-
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>>>;
|
|
358
|
+
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>>>;
|
|
356
359
|
}
|
|
357
360
|
/**
|
|
358
361
|
* Creates a typed client bound to a registry contract and optional tenant header mapping.
|
|
@@ -660,4 +663,4 @@ interface AthenaAuthSdkClient {
|
|
|
660
663
|
|
|
661
664
|
declare function createAuthClient(config?: AthenaAuthClientConfig): AthenaAuthSdkClient;
|
|
662
665
|
|
|
663
|
-
export { type AthenaAuthCallOptions, type AthenaAuthClientConfig, type AthenaAuthCredentials, type AthenaAuthEmailChangeResponse, type AthenaAuthEndpointPath, type AthenaAuthErrorCode, type AthenaAuthErrorDetails, type AthenaAuthLinkedAccount, type AthenaAuthMethod, type AthenaAuthQueryPrimitive, type AthenaAuthQueryValue, type AthenaAuthRequestInput, type AthenaAuthResult, type AthenaAuthRevokeSessionRequest, type AthenaAuthSdkClient, type AthenaAuthSession, type AthenaAuthSessionResponse, type AthenaAuthSignInResponse, type AthenaAuthSignOutResponse, type AthenaAuthSocialRedirectResponse, type AthenaAuthStatusResponse, type AthenaAuthUser, type AthenaChangeEmailRequest, type AthenaChangePasswordRequest, AthenaClient, AthenaConditionCastType, type AthenaDeleteUserCallbackRequest, type AthenaDeleteUserRequest, type AthenaDeleteUserResponse, type AthenaEmailSignInRequest, type AthenaEmailSignUpRequest, AthenaError, AthenaErrorCategory, AthenaErrorCode, type AthenaErrorInput, AthenaErrorKind, type AthenaForgetPasswordRequest, AthenaGatewayCallOptions, AthenaGatewayErrorDetails, AthenaGeneratorConfig, type AthenaLinkSocialRequest, type AthenaOAuthAccountTokenRequest, type AthenaOAuthTokenBundle, type AthenaOperationContext, type AthenaResetPasswordRequest, type AthenaResult, AthenaRpcCallOptions, type AthenaSdkClient, type AthenaSendVerificationEmailRequest, type AthenaSocialSignInRequest, type AthenaUnlinkAccountRequest, type AthenaUpdateUserRequest, type AthenaUsernameSignInRequest, type AthenaVerifyEmailRequest, BackendConfig, BackendType, DEFAULT_POSTGRES_SCHEMAS, DatabaseDef, GeneratedArtifacts, GeneratorExperimentalFlags, GeneratorProviderConfig, GeneratorSchemaSelection, type IntCoercionOptions, IntrospectionColumn, IntrospectionSnapshot, LoadGeneratorConfigOptions, LoadedGeneratorConfig, ModelAt, ModelDef, ModelMetadata, type NormalizedAthenaError, NormalizedAthenaGeneratorConfig, type PostgresIntrospectionProviderOptions, RegistryDef, type RequireAffectedOptions, type RetryBackoffStrategy, type RetryConfig, RowOf, type RpcOrderOptions, type RpcQueryBuilder, SchemaDef, SchemaIntrospectionProvider, type TableQueryBuilder, TenantContext, TenantKeyMap, type TypedAthenaClient, type TypedClientOptions, type UnwrapOneOptions, type UnwrapOptions, assertInt, coerceInt, createAuthClient, createClient, createPostgresIntrospectionProvider, createTypedClient, defineDatabase, defineGeneratorConfig, defineModel, defineRegistry, defineSchema, findGeneratorConfigPath, generateArtifactsFromSnapshot, identifier, isOk, loadGeneratorConfig, normalizeAthenaError, normalizeGeneratorConfig, normalizeSchemaSelection, requireAffected, requireSuccess, resolveGeneratorProvider, resolvePostgresColumnType, resolveProviderSchemas, unwrap, unwrapOne, unwrapRows, withRetry };
|
|
666
|
+
export { type AthenaAuthCallOptions, type AthenaAuthClientConfig, type AthenaAuthCredentials, type AthenaAuthEmailChangeResponse, type AthenaAuthEndpointPath, type AthenaAuthErrorCode, type AthenaAuthErrorDetails, type AthenaAuthLinkedAccount, type AthenaAuthMethod, type AthenaAuthQueryPrimitive, type AthenaAuthQueryValue, type AthenaAuthRequestInput, type AthenaAuthResult, type AthenaAuthRevokeSessionRequest, type AthenaAuthSdkClient, type AthenaAuthSession, type AthenaAuthSessionResponse, type AthenaAuthSignInResponse, type AthenaAuthSignOutResponse, type AthenaAuthSocialRedirectResponse, type AthenaAuthStatusResponse, type AthenaAuthUser, type AthenaChangeEmailRequest, type AthenaChangePasswordRequest, AthenaClient, AthenaConditionCastType, type AthenaDeleteUserCallbackRequest, type AthenaDeleteUserRequest, type AthenaDeleteUserResponse, type AthenaEmailSignInRequest, type AthenaEmailSignUpRequest, AthenaError, AthenaErrorCategory, AthenaErrorCode, type AthenaErrorInput, AthenaErrorKind, type AthenaForgetPasswordRequest, AthenaGatewayCallOptions, AthenaGatewayErrorDetails, AthenaGeneratorConfig, AthenaJsonObject, AthenaJsonValue, type AthenaLinkSocialRequest, type AthenaOAuthAccountTokenRequest, type AthenaOAuthTokenBundle, type AthenaOperationContext, type AthenaResetPasswordRequest, type AthenaResult, AthenaRpcCallOptions, type AthenaSdkClient, type AthenaSendVerificationEmailRequest, type AthenaSocialSignInRequest, type AthenaUnlinkAccountRequest, type AthenaUpdateUserRequest, type AthenaUsernameSignInRequest, type AthenaVerifyEmailRequest, BackendConfig, BackendType, DEFAULT_POSTGRES_SCHEMAS, DatabaseDef, GeneratedArtifacts, GeneratorExperimentalFlags, GeneratorProviderConfig, GeneratorSchemaSelection, InsertOf, type IntCoercionOptions, IntrospectionColumn, IntrospectionSnapshot, LoadGeneratorConfigOptions, LoadedGeneratorConfig, ModelAt, ModelDef, ModelMetadata, type NormalizedAthenaError, NormalizedAthenaGeneratorConfig, type PostgresIntrospectionProviderOptions, RegistryDef, type RequireAffectedOptions, type RetryBackoffStrategy, type RetryConfig, RowOf, type RpcOrderOptions, type RpcQueryBuilder, SchemaDef, SchemaIntrospectionProvider, type TableQueryBuilder, TenantContext, TenantKeyMap, type TypedAthenaClient, type TypedClientOptions, type UnwrapOneOptions, type UnwrapOptions, UpdateOf, assertInt, coerceInt, createAuthClient, createClient, createPostgresIntrospectionProvider, createTypedClient, defineDatabase, defineGeneratorConfig, defineModel, defineRegistry, defineSchema, findGeneratorConfigPath, generateArtifactsFromSnapshot, identifier, isOk, loadGeneratorConfig, normalizeAthenaError, normalizeGeneratorConfig, normalizeSchemaSelection, requireAffected, requireSuccess, resolveGeneratorProvider, resolvePostgresColumnType, resolveProviderSchemas, unwrap, unwrapOne, unwrapRows, withRetry };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { B as BackendConfig, a as BackendType, A as
|
|
2
|
-
export {
|
|
3
|
-
export { A as AthenaGatewayError, i as isAthenaGatewayError } from './
|
|
4
|
-
import {
|
|
5
|
-
export {
|
|
1
|
+
import { B as BackendConfig, a as BackendType, A as AthenaJsonValue, b as AthenaConditionValue, c as AthenaConditionCastType, d as AthenaConditionArrayValue, e as AthenaConditionOperator, f as AthenaGatewayCallOptions, g as AthenaGatewayErrorDetails, h as AthenaJsonObject, i as AthenaRpcCallOptions, S as SchemaDef, j as AnyModelDef, D as DatabaseDef, M as ModelMetadata, k as ModelDef, R as RegistryDef, T as TenantKeyMap, l as TenantContext, m as RowOf, n as ModelAt, I as InsertOf, U as UpdateOf, o as SchemaIntrospectionProvider, p as IntrospectionSnapshot, q as IntrospectionColumn } from './types-BnzoaNRC.js';
|
|
2
|
+
export { r as AthenaGatewayErrorCode, s as AthenaJsonArray, t as AthenaJsonPrimitive, u as AthenaRpcFilter, v as AthenaRpcFilterOperator, w as AthenaRpcOrder, x as AthenaRpcPayload, y as Backend, z as IntrospectionInspectOptions, C as IntrospectionRelation, E as IntrospectionSchema, F as IntrospectionTable, G as IntrospectionTypeKind, H as ModelRelationKind, J as ModelRelationMetadata, K as TenantContextValue } from './types-BnzoaNRC.js';
|
|
3
|
+
export { A as AthenaGatewayError, M as ModelFormAdapter, a as ModelFormDefaults, b as ModelFormNullishMode, c as ModelFormValues, T as ToModelFormDefaultsOptions, d as ToModelPayloadOptions, e as createModelFormAdapter, i as isAthenaGatewayError, t as toModelFormDefaults, f as toModelPayload } from './model-form-Bm_kqCn2.js';
|
|
4
|
+
import { A as AthenaGeneratorConfig, L as LoadGeneratorConfigOptions, a as LoadedGeneratorConfig, N as NormalizedAthenaGeneratorConfig, G as GeneratedArtifacts, b as GeneratorProviderConfig, c as GeneratorExperimentalFlags, d as GeneratorSchemaSelection } from './pipeline-CQgV-Yfo.js';
|
|
5
|
+
export { e as GeneratedArtifact, f as GeneratorArtifactKind, g as GeneratorFeatureFlags, h as GeneratorNamingConfig, i as GeneratorOutputConfig, j as GeneratorOutputTargets, k as NamingStyle, R as RunGeneratorOptions, l as RunGeneratorResult, r as runSchemaGenerator } from './pipeline-CQgV-Yfo.js';
|
|
6
6
|
|
|
7
7
|
interface AthenaResult<T> {
|
|
8
8
|
data: T | null;
|
|
@@ -13,6 +13,9 @@ interface AthenaResult<T> {
|
|
|
13
13
|
raw: unknown;
|
|
14
14
|
}
|
|
15
15
|
type MutationSingleResult<Result> = Result extends Array<infer Item> ? Item | null : Result | null;
|
|
16
|
+
type AthenaRowShape = Record<string, AthenaJsonValue | undefined>;
|
|
17
|
+
type FilterColumnKey<Row> = Extract<keyof NonNullable<Row>, string>;
|
|
18
|
+
type ResolvedFilterColumnKey<Row> = [FilterColumnKey<Row>] extends [never] ? string : FilterColumnKey<Row>;
|
|
16
19
|
interface MutationQuery<Result> extends PromiseLike<AthenaResult<Result>> {
|
|
17
20
|
select(columns?: string | string[], options?: AthenaGatewayCallOptions): Promise<AthenaResult<Result>>;
|
|
18
21
|
returning(columns?: string | string[], options?: AthenaGatewayCallOptions): Promise<AthenaResult<Result>>;
|
|
@@ -26,39 +29,39 @@ interface OrderOptions {
|
|
|
26
29
|
ascending?: boolean;
|
|
27
30
|
}
|
|
28
31
|
/** Shared filter chain - supports eq, limit, etc. in any order relative to select/update */
|
|
29
|
-
interface FilterChain<Self> {
|
|
30
|
-
eq(column:
|
|
31
|
-
eqCast(column:
|
|
32
|
-
eqUuid(column:
|
|
33
|
-
match(filters: Record<
|
|
32
|
+
interface FilterChain<Self, Row> {
|
|
33
|
+
eq(column: ResolvedFilterColumnKey<Row>, value: AthenaConditionValue): Self;
|
|
34
|
+
eqCast(column: ResolvedFilterColumnKey<Row>, value: AthenaConditionValue, cast: AthenaConditionCastType): Self;
|
|
35
|
+
eqUuid(column: ResolvedFilterColumnKey<Row>, value: string): Self;
|
|
36
|
+
match(filters: Partial<Record<ResolvedFilterColumnKey<Row>, AthenaConditionValue>>): Self;
|
|
34
37
|
range(from: number, to: number): Self;
|
|
35
38
|
limit(count: number): Self;
|
|
36
39
|
offset(count: number): Self;
|
|
37
40
|
currentPage(value: number): Self;
|
|
38
41
|
pageSize(value: number): Self;
|
|
39
42
|
totalPages(value: number): Self;
|
|
40
|
-
order(column:
|
|
41
|
-
gt(column:
|
|
42
|
-
gte(column:
|
|
43
|
-
lt(column:
|
|
44
|
-
lte(column:
|
|
45
|
-
neq(column:
|
|
46
|
-
like(column:
|
|
47
|
-
ilike(column:
|
|
48
|
-
is(column:
|
|
49
|
-
in(column:
|
|
50
|
-
contains(column:
|
|
51
|
-
containedBy(column:
|
|
52
|
-
not(columnOrExpression: string, operator?: AthenaConditionOperator, value?: AthenaConditionValue): Self;
|
|
43
|
+
order(column: ResolvedFilterColumnKey<Row>, options?: OrderOptions): Self;
|
|
44
|
+
gt(column: ResolvedFilterColumnKey<Row>, value: AthenaConditionValue): Self;
|
|
45
|
+
gte(column: ResolvedFilterColumnKey<Row>, value: AthenaConditionValue): Self;
|
|
46
|
+
lt(column: ResolvedFilterColumnKey<Row>, value: AthenaConditionValue): Self;
|
|
47
|
+
lte(column: ResolvedFilterColumnKey<Row>, value: AthenaConditionValue): Self;
|
|
48
|
+
neq(column: ResolvedFilterColumnKey<Row>, value: AthenaConditionValue): Self;
|
|
49
|
+
like(column: ResolvedFilterColumnKey<Row>, value: AthenaConditionValue): Self;
|
|
50
|
+
ilike(column: ResolvedFilterColumnKey<Row>, value: AthenaConditionValue): Self;
|
|
51
|
+
is(column: ResolvedFilterColumnKey<Row>, value: AthenaConditionValue): Self;
|
|
52
|
+
in(column: ResolvedFilterColumnKey<Row>, values: AthenaConditionArrayValue): Self;
|
|
53
|
+
contains(column: ResolvedFilterColumnKey<Row>, values: AthenaConditionArrayValue): Self;
|
|
54
|
+
containedBy(column: ResolvedFilterColumnKey<Row>, values: AthenaConditionArrayValue): Self;
|
|
55
|
+
not(columnOrExpression: ResolvedFilterColumnKey<Row> | string, operator?: AthenaConditionOperator, value?: AthenaConditionValue): Self;
|
|
53
56
|
or(expression: string): Self;
|
|
54
57
|
}
|
|
55
58
|
/** Chain returned by select() - supports filters and single/maybeSingle before execution */
|
|
56
|
-
interface SelectChain<Row> extends FilterChain<SelectChain<Row
|
|
57
|
-
single<T =
|
|
58
|
-
maybeSingle<T =
|
|
59
|
+
interface SelectChain<Row, SelectedRow = Row> extends FilterChain<SelectChain<Row, SelectedRow>, Row>, PromiseLike<AthenaResult<SelectedRow[]>> {
|
|
60
|
+
single<T = SelectedRow>(columns?: string | string[], options?: AthenaGatewayCallOptions): Promise<AthenaResult<T | null>>;
|
|
61
|
+
maybeSingle<T = SelectedRow>(columns?: string | string[], options?: AthenaGatewayCallOptions): Promise<AthenaResult<T | null>>;
|
|
59
62
|
}
|
|
60
63
|
/** Chain returned by update() - supports filters before execution, plus select/returning */
|
|
61
|
-
interface UpdateChain<Row> extends FilterChain<UpdateChain<Row
|
|
64
|
+
interface UpdateChain<Row> extends FilterChain<UpdateChain<Row>, Row>, MutationQuery<Row[]> {
|
|
62
65
|
}
|
|
63
66
|
interface RpcFilterChain<Self> {
|
|
64
67
|
eq(column: string, value: AthenaConditionValue): Self;
|
|
@@ -84,29 +87,29 @@ interface RpcQueryBuilder<Row> extends RpcFilterChain<RpcQueryBuilder<Row>>, Pro
|
|
|
84
87
|
offset(count: number): RpcQueryBuilder<Row>;
|
|
85
88
|
range(from: number, to: number): RpcQueryBuilder<Row>;
|
|
86
89
|
}
|
|
87
|
-
interface TableQueryBuilder<Row
|
|
88
|
-
select<T = Row>(columns?: string | string[], options?: AthenaGatewayCallOptions): SelectChain<T>;
|
|
89
|
-
insert(values:
|
|
90
|
-
insert(values:
|
|
91
|
-
upsert(values:
|
|
92
|
-
updateBody?:
|
|
90
|
+
interface TableQueryBuilder<Row, Insert = Partial<Row>, Update = Partial<Insert>> extends FilterChain<TableQueryBuilder<Row, Insert, Update>, Row> {
|
|
91
|
+
select<T = Row>(columns?: string | string[], options?: AthenaGatewayCallOptions): SelectChain<Row, T>;
|
|
92
|
+
insert(values: Insert, options?: AthenaGatewayCallOptions): MutationQuery<Row>;
|
|
93
|
+
insert(values: Insert[], options?: AthenaGatewayCallOptions): MutationQuery<Row[]>;
|
|
94
|
+
upsert(values: Insert, options?: AthenaGatewayCallOptions & {
|
|
95
|
+
updateBody?: Update;
|
|
93
96
|
onConflict?: string | string[];
|
|
94
97
|
}): MutationQuery<Row>;
|
|
95
|
-
upsert(values:
|
|
96
|
-
updateBody?:
|
|
98
|
+
upsert(values: Insert[], options?: AthenaGatewayCallOptions & {
|
|
99
|
+
updateBody?: Update;
|
|
97
100
|
onConflict?: string | string[];
|
|
98
101
|
}): MutationQuery<Row[]>;
|
|
99
|
-
update(values:
|
|
102
|
+
update(values: Update, options?: AthenaGatewayCallOptions): UpdateChain<Row>;
|
|
100
103
|
delete(options?: AthenaGatewayCallOptions & {
|
|
101
104
|
resourceId?: string;
|
|
102
105
|
}): MutationQuery<Row | null>;
|
|
103
106
|
single<T = Row>(columns?: string | string[], options?: AthenaGatewayCallOptions): Promise<AthenaResult<T | null>>;
|
|
104
107
|
maybeSingle<T = Row>(columns?: string | string[], options?: AthenaGatewayCallOptions): Promise<AthenaResult<T | null>>;
|
|
105
|
-
reset(): TableQueryBuilder<Row>;
|
|
108
|
+
reset(): TableQueryBuilder<Row, Insert, Update>;
|
|
106
109
|
}
|
|
107
110
|
interface AthenaSdkClient {
|
|
108
|
-
from<Row =
|
|
109
|
-
rpc<Row = unknown, Args extends
|
|
111
|
+
from<Row = AthenaRowShape, Insert = Partial<Row>, Update = Partial<Insert>>(table: string): TableQueryBuilder<Row, Insert, Update>;
|
|
112
|
+
rpc<Row = unknown, Args extends AthenaJsonObject = AthenaJsonObject>(fn: string, args?: Args, options?: AthenaRpcCallOptions): RpcQueryBuilder<Row>;
|
|
110
113
|
query<Row = unknown>(query: string, options?: AthenaGatewayCallOptions): Promise<AthenaResult<Row[]>>;
|
|
111
114
|
}
|
|
112
115
|
interface AthenaClientBuilder {
|
|
@@ -352,7 +355,7 @@ interface TypedAthenaClient<TRegistry extends RegistryConstraint, TTenantMap ext
|
|
|
352
355
|
readonly tenantKeyMap: Readonly<TTenantMap>;
|
|
353
356
|
readonly tenantContext: TenantContext<TTenantMap>;
|
|
354
357
|
withTenantContext(context: TenantContext<TTenantMap>): TypedAthenaClient<TRegistry, TTenantMap>;
|
|
355
|
-
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>>>;
|
|
358
|
+
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>>>;
|
|
356
359
|
}
|
|
357
360
|
/**
|
|
358
361
|
* Creates a typed client bound to a registry contract and optional tenant header mapping.
|
|
@@ -660,4 +663,4 @@ interface AthenaAuthSdkClient {
|
|
|
660
663
|
|
|
661
664
|
declare function createAuthClient(config?: AthenaAuthClientConfig): AthenaAuthSdkClient;
|
|
662
665
|
|
|
663
|
-
export { type AthenaAuthCallOptions, type AthenaAuthClientConfig, type AthenaAuthCredentials, type AthenaAuthEmailChangeResponse, type AthenaAuthEndpointPath, type AthenaAuthErrorCode, type AthenaAuthErrorDetails, type AthenaAuthLinkedAccount, type AthenaAuthMethod, type AthenaAuthQueryPrimitive, type AthenaAuthQueryValue, type AthenaAuthRequestInput, type AthenaAuthResult, type AthenaAuthRevokeSessionRequest, type AthenaAuthSdkClient, type AthenaAuthSession, type AthenaAuthSessionResponse, type AthenaAuthSignInResponse, type AthenaAuthSignOutResponse, type AthenaAuthSocialRedirectResponse, type AthenaAuthStatusResponse, type AthenaAuthUser, type AthenaChangeEmailRequest, type AthenaChangePasswordRequest, AthenaClient, AthenaConditionCastType, type AthenaDeleteUserCallbackRequest, type AthenaDeleteUserRequest, type AthenaDeleteUserResponse, type AthenaEmailSignInRequest, type AthenaEmailSignUpRequest, AthenaError, AthenaErrorCategory, AthenaErrorCode, type AthenaErrorInput, AthenaErrorKind, type AthenaForgetPasswordRequest, AthenaGatewayCallOptions, AthenaGatewayErrorDetails, AthenaGeneratorConfig, type AthenaLinkSocialRequest, type AthenaOAuthAccountTokenRequest, type AthenaOAuthTokenBundle, type AthenaOperationContext, type AthenaResetPasswordRequest, type AthenaResult, AthenaRpcCallOptions, type AthenaSdkClient, type AthenaSendVerificationEmailRequest, type AthenaSocialSignInRequest, type AthenaUnlinkAccountRequest, type AthenaUpdateUserRequest, type AthenaUsernameSignInRequest, type AthenaVerifyEmailRequest, BackendConfig, BackendType, DEFAULT_POSTGRES_SCHEMAS, DatabaseDef, GeneratedArtifacts, GeneratorExperimentalFlags, GeneratorProviderConfig, GeneratorSchemaSelection, type IntCoercionOptions, IntrospectionColumn, IntrospectionSnapshot, LoadGeneratorConfigOptions, LoadedGeneratorConfig, ModelAt, ModelDef, ModelMetadata, type NormalizedAthenaError, NormalizedAthenaGeneratorConfig, type PostgresIntrospectionProviderOptions, RegistryDef, type RequireAffectedOptions, type RetryBackoffStrategy, type RetryConfig, RowOf, type RpcOrderOptions, type RpcQueryBuilder, SchemaDef, SchemaIntrospectionProvider, type TableQueryBuilder, TenantContext, TenantKeyMap, type TypedAthenaClient, type TypedClientOptions, type UnwrapOneOptions, type UnwrapOptions, assertInt, coerceInt, createAuthClient, createClient, createPostgresIntrospectionProvider, createTypedClient, defineDatabase, defineGeneratorConfig, defineModel, defineRegistry, defineSchema, findGeneratorConfigPath, generateArtifactsFromSnapshot, identifier, isOk, loadGeneratorConfig, normalizeAthenaError, normalizeGeneratorConfig, normalizeSchemaSelection, requireAffected, requireSuccess, resolveGeneratorProvider, resolvePostgresColumnType, resolveProviderSchemas, unwrap, unwrapOne, unwrapRows, withRetry };
|
|
666
|
+
export { type AthenaAuthCallOptions, type AthenaAuthClientConfig, type AthenaAuthCredentials, type AthenaAuthEmailChangeResponse, type AthenaAuthEndpointPath, type AthenaAuthErrorCode, type AthenaAuthErrorDetails, type AthenaAuthLinkedAccount, type AthenaAuthMethod, type AthenaAuthQueryPrimitive, type AthenaAuthQueryValue, type AthenaAuthRequestInput, type AthenaAuthResult, type AthenaAuthRevokeSessionRequest, type AthenaAuthSdkClient, type AthenaAuthSession, type AthenaAuthSessionResponse, type AthenaAuthSignInResponse, type AthenaAuthSignOutResponse, type AthenaAuthSocialRedirectResponse, type AthenaAuthStatusResponse, type AthenaAuthUser, type AthenaChangeEmailRequest, type AthenaChangePasswordRequest, AthenaClient, AthenaConditionCastType, type AthenaDeleteUserCallbackRequest, type AthenaDeleteUserRequest, type AthenaDeleteUserResponse, type AthenaEmailSignInRequest, type AthenaEmailSignUpRequest, AthenaError, AthenaErrorCategory, AthenaErrorCode, type AthenaErrorInput, AthenaErrorKind, type AthenaForgetPasswordRequest, AthenaGatewayCallOptions, AthenaGatewayErrorDetails, AthenaGeneratorConfig, AthenaJsonObject, AthenaJsonValue, type AthenaLinkSocialRequest, type AthenaOAuthAccountTokenRequest, type AthenaOAuthTokenBundle, type AthenaOperationContext, type AthenaResetPasswordRequest, type AthenaResult, AthenaRpcCallOptions, type AthenaSdkClient, type AthenaSendVerificationEmailRequest, type AthenaSocialSignInRequest, type AthenaUnlinkAccountRequest, type AthenaUpdateUserRequest, type AthenaUsernameSignInRequest, type AthenaVerifyEmailRequest, BackendConfig, BackendType, DEFAULT_POSTGRES_SCHEMAS, DatabaseDef, GeneratedArtifacts, GeneratorExperimentalFlags, GeneratorProviderConfig, GeneratorSchemaSelection, InsertOf, type IntCoercionOptions, IntrospectionColumn, IntrospectionSnapshot, LoadGeneratorConfigOptions, LoadedGeneratorConfig, ModelAt, ModelDef, ModelMetadata, type NormalizedAthenaError, NormalizedAthenaGeneratorConfig, type PostgresIntrospectionProviderOptions, RegistryDef, type RequireAffectedOptions, type RetryBackoffStrategy, type RetryConfig, RowOf, type RpcOrderOptions, type RpcQueryBuilder, SchemaDef, SchemaIntrospectionProvider, type TableQueryBuilder, TenantContext, TenantKeyMap, type TypedAthenaClient, type TypedClientOptions, type UnwrapOneOptions, type UnwrapOptions, UpdateOf, assertInt, coerceInt, createAuthClient, createClient, createPostgresIntrospectionProvider, createTypedClient, defineDatabase, defineGeneratorConfig, defineModel, defineRegistry, defineSchema, findGeneratorConfigPath, generateArtifactsFromSnapshot, identifier, isOk, loadGeneratorConfig, normalizeAthenaError, normalizeGeneratorConfig, normalizeSchemaSelection, requireAffected, requireSuccess, resolveGeneratorProvider, resolvePostgresColumnType, resolveProviderSchemas, unwrap, unwrapOne, unwrapRows, withRetry };
|