@xylex-group/athena 3.0.3 → 3.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/admin.cjs +55 -1
- package/dist/admin.cjs.map +1 -1
- package/dist/admin.d.cts +32 -8
- package/dist/admin.d.ts +32 -8
- package/dist/admin.js +54 -2
- package/dist/admin.js.map +1 -1
- package/dist/athena-auth-url-C1FbVmN6.d.cts +200 -0
- package/dist/athena-auth-url-C1FbVmN6.d.ts +200 -0
- package/dist/{athena-request-headers-C7Jy-c_D.d.ts → athena-request-headers-DzimbvOA.d.ts} +48 -200
- package/dist/{athena-request-headers-DujFFyMU.d.cts → athena-request-headers-Lr_m8xCV.d.cts} +48 -200
- package/dist/billing.cjs +1 -1
- package/dist/billing.cjs.map +1 -1
- package/dist/billing.js +1 -1
- package/dist/billing.js.map +1 -1
- package/dist/browser.cjs +912 -5
- package/dist/browser.cjs.map +1 -1
- package/dist/browser.d.cts +8 -7
- package/dist/browser.d.ts +8 -7
- package/dist/browser.js +881 -6
- package/dist/browser.js.map +1 -1
- package/dist/cli/index.cjs +7909 -7061
- package/dist/cli/index.cjs.map +1 -1
- package/dist/cli/index.d.cts +17 -10
- package/dist/cli/index.d.ts +17 -10
- package/dist/cli/index.js +7911 -7063
- package/dist/cli/index.js.map +1 -1
- package/dist/env.cjs +130 -0
- package/dist/env.cjs.map +1 -0
- package/dist/env.d.cts +70 -0
- package/dist/env.d.ts +70 -0
- package/dist/env.js +122 -0
- package/dist/env.js.map +1 -0
- package/dist/index.cjs +1570 -98
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +31 -8
- package/dist/index.d.ts +31 -8
- package/dist/index.js +1532 -100
- package/dist/index.js.map +1 -1
- package/dist/model-form-3Gr8rkdT.d.cts +281 -0
- package/dist/model-form-CotpEL7z.d.ts +281 -0
- package/dist/{module-CPG3ULxQ.d.cts → module-CQmOaDzP.d.cts} +4 -4
- package/dist/{module-BruTcxe0.d.ts → module-CWkUTcUc.d.ts} +4 -4
- package/dist/next/client.cjs +123 -7
- package/dist/next/client.cjs.map +1 -1
- package/dist/next/client.d.cts +4 -3
- package/dist/next/client.d.ts +4 -3
- package/dist/next/client.js +123 -7
- package/dist/next/client.js.map +1 -1
- package/dist/next/server.cjs +1130 -364
- package/dist/next/server.cjs.map +1 -1
- package/dist/next/server.d.cts +121 -8
- package/dist/next/server.d.ts +121 -8
- package/dist/next/server.js +1120 -365
- package/dist/next/server.js.map +1 -1
- package/dist/pipeline-BnRKO_Pd.d.cts +93 -0
- package/dist/pipeline-sWCmlFqu.d.ts +93 -0
- package/dist/{proxy-request-headers-m4D2Tduy.d.ts → proxy-request-headers-CttlcuRb.d.ts} +1 -1
- package/dist/{proxy-request-headers-DGxdoyA0.d.cts → proxy-request-headers-pIBSn1Fw.d.cts} +1 -1
- package/dist/react.cjs +672 -16
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +123 -8
- package/dist/react.d.ts +123 -8
- package/dist/react.js +671 -17
- package/dist/react.js.map +1 -1
- package/dist/schema-handlers-BtT_IQFi.d.cts +138 -0
- package/dist/schema-handlers-VjFDhIMw.d.ts +138 -0
- package/dist/social-providers.d.cts +1 -1
- package/dist/social-providers.d.ts +1 -1
- package/dist/{types-D6tZ9aoq.d.ts → types-BDX8zS7w.d.ts} +40 -1
- package/dist/{types-AOY-GLu8.d.cts → types-BVKpQmfY.d.cts} +11 -0
- package/dist/{types-AOY-GLu8.d.ts → types-BVKpQmfY.d.ts} +11 -0
- package/dist/{types-DFr2cL1N.d.cts → types-D-Am7YSd.d.cts} +40 -1
- package/dist/utils.cjs +30 -0
- package/dist/utils.cjs.map +1 -1
- package/dist/utils.d.cts +3 -2
- package/dist/utils.d.ts +3 -2
- package/dist/utils.js +30 -1
- package/dist/utils.js.map +1 -1
- package/dist/{v3-client-CWfZHcKL.d.cts → v3-client-G1SLeHRa.d.cts} +23 -1
- package/dist/{v3-client-DZp2NEhK.d.ts → v3-client-ao8BWQ8v.d.ts} +23 -1
- package/package.json +16 -2
- package/dist/model-form-Dh0sisdL.d.ts +0 -97
- package/dist/model-form-oOAJUVd4.d.cts +0 -97
- package/dist/pipeline-CIzV9f7b.d.cts +0 -8
- package/dist/pipeline-DNlc8Ayn.d.ts +0 -8
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { F as AthenaAuthClientConfig, D as AthenaAuthBindings } from './types-
|
|
1
|
+
import { F as AthenaAuthClientConfig, D as AthenaAuthBindings } from './types-BVKpQmfY.cjs';
|
|
2
2
|
import { e as AthenaGatewayErrorDetails, a as AthenaGatewayCallOptions, b as AthenaGatewayConnectionOptions, c as AthenaGatewayConnectionResult, x as AthenaFetchPayload, s as AthenaGatewayResponse, y as AthenaInsertPayload, z as AthenaUpdatePayload, w as AthenaDeletePayload, n as AthenaRpcPayload, j as AthenaRpcCallOptions, C as AthenaQueryPayload, i as AthenaJsonValue, g as AthenaJsonObject, q as AthenaGatewayEndpointPath, r as AthenaGatewayMethod, D as AthenaGatewayBaseOptions, E as AthenaConditionValue, F as AthenaConditionArrayValue, G as AthenaGatewayCondition, H as AthenaSortBy, k as AthenaRpcFilter, A as AthenaConditionCastType, I as AthenaConditionOperator, o as BackendConfig, p as BackendType } from './types-Bltx6iL6.cjs';
|
|
3
3
|
import { A as AthenaModelTarget, n as RowOf, a as InsertOf, U as UpdateOf, u as AthenaClientTableName, t as AthenaClientModelForTableName, R as RegistryDef, D as DatabaseDef, o as SchemaDef, s as AnyModelDef, j as ModelDef, m as ModelRelationMetadata, r as AthenaClientModelsInput } from './types-CgCv5o6R.cjs';
|
|
4
4
|
import { a as AthenaBillingClientConfig, c as AthenaBillingModule } from './module-C_ab-MM1.cjs';
|
|
@@ -2663,6 +2663,12 @@ type AthenaQueryDebugAst = AthenaSelectDebugAst | AthenaFindManyDebugAst | Athen
|
|
|
2663
2663
|
declare function getAthenaDebugAst(value: unknown): AthenaQueryDebugAst | null;
|
|
2664
2664
|
|
|
2665
2665
|
interface AthenaQueryTraceOptions {
|
|
2666
|
+
/**
|
|
2667
|
+
* When false, tracing is off even if diagnostics mode would enable it.
|
|
2668
|
+
* When true, tracing stays on even in quiet (`diagnostics: 'auto'`) environments.
|
|
2669
|
+
* When omitted, quiet environments disable object-form trace options.
|
|
2670
|
+
*/
|
|
2671
|
+
enabled?: boolean;
|
|
2666
2672
|
/**
|
|
2667
2673
|
* Custom sink for trace events. Defaults to console.info.
|
|
2668
2674
|
*/
|
|
@@ -2808,6 +2814,15 @@ interface TableQueryBuilder<Row, Insert = Partial<Row>, Update = Partial<Insert>
|
|
|
2808
2814
|
reset(): TableQueryBuilder<Row, Insert, Update, TContext>;
|
|
2809
2815
|
}
|
|
2810
2816
|
|
|
2817
|
+
/**
|
|
2818
|
+
* Resolve query diagnostics flags for {@link createClient}.
|
|
2819
|
+
*
|
|
2820
|
+
* Prefer `diagnostics: 'auto'` in Next/OpenNext apps so production builds stay
|
|
2821
|
+
* quiet without app-local OPENNEXT_BUILD branching.
|
|
2822
|
+
*/
|
|
2823
|
+
|
|
2824
|
+
type AthenaDiagnosticsMode = boolean | 'auto';
|
|
2825
|
+
|
|
2811
2826
|
type MaybePromise<T> = T | Promise<T>;
|
|
2812
2827
|
type ResolvedModels<TModels> = TModels extends AthenaClientModelsInput ? TModels : never;
|
|
2813
2828
|
|
|
@@ -2842,6 +2857,7 @@ interface AthenaBillingConfig extends Omit<AthenaBillingClientConfig, 'baseUrl'
|
|
|
2842
2857
|
/** Optional override; defaults to the unified/root or db Athena URL. */
|
|
2843
2858
|
url?: string | null;
|
|
2844
2859
|
}
|
|
2860
|
+
|
|
2845
2861
|
interface AthenaClientConfig<TModels extends AthenaClientModelsInput | undefined = undefined> {
|
|
2846
2862
|
url?: string | null;
|
|
2847
2863
|
key?: string | null;
|
|
@@ -2857,6 +2873,12 @@ interface AthenaClientConfig<TModels extends AthenaClientModelsInput | undefined
|
|
|
2857
2873
|
storage?: AthenaStorageConfig;
|
|
2858
2874
|
billing?: AthenaBillingConfig;
|
|
2859
2875
|
retryReads?: boolean;
|
|
2876
|
+
/**
|
|
2877
|
+
* Query diagnostics mode. Prefer `'auto'` in Next/OpenNext apps so production
|
|
2878
|
+
* builds stay quiet without app-local OPENNEXT_BUILD branching.
|
|
2879
|
+
* Per-flag `debugAst` / `findManyAst` / `traceQueries` always win when set.
|
|
2880
|
+
*/
|
|
2881
|
+
diagnostics?: AthenaDiagnosticsMode;
|
|
2860
2882
|
traceQueries?: boolean | AthenaQueryTraceOptions;
|
|
2861
2883
|
debugAst?: boolean;
|
|
2862
2884
|
findManyAst?: boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { F as AthenaAuthClientConfig, D as AthenaAuthBindings } from './types-
|
|
1
|
+
import { F as AthenaAuthClientConfig, D as AthenaAuthBindings } from './types-BVKpQmfY.js';
|
|
2
2
|
import { e as AthenaGatewayErrorDetails, a as AthenaGatewayCallOptions, b as AthenaGatewayConnectionOptions, c as AthenaGatewayConnectionResult, x as AthenaFetchPayload, s as AthenaGatewayResponse, y as AthenaInsertPayload, z as AthenaUpdatePayload, w as AthenaDeletePayload, n as AthenaRpcPayload, j as AthenaRpcCallOptions, C as AthenaQueryPayload, i as AthenaJsonValue, g as AthenaJsonObject, q as AthenaGatewayEndpointPath, r as AthenaGatewayMethod, D as AthenaGatewayBaseOptions, E as AthenaConditionValue, F as AthenaConditionArrayValue, G as AthenaGatewayCondition, H as AthenaSortBy, k as AthenaRpcFilter, A as AthenaConditionCastType, I as AthenaConditionOperator, o as BackendConfig, p as BackendType } from './types-Bltx6iL6.js';
|
|
3
3
|
import { A as AthenaModelTarget, n as RowOf, a as InsertOf, U as UpdateOf, u as AthenaClientTableName, t as AthenaClientModelForTableName, R as RegistryDef, D as DatabaseDef, o as SchemaDef, s as AnyModelDef, j as ModelDef, m as ModelRelationMetadata, r as AthenaClientModelsInput } from './types-B75PdABb.js';
|
|
4
4
|
import { a as AthenaBillingClientConfig, c as AthenaBillingModule } from './module-C_ab-MM1.js';
|
|
@@ -2663,6 +2663,12 @@ type AthenaQueryDebugAst = AthenaSelectDebugAst | AthenaFindManyDebugAst | Athen
|
|
|
2663
2663
|
declare function getAthenaDebugAst(value: unknown): AthenaQueryDebugAst | null;
|
|
2664
2664
|
|
|
2665
2665
|
interface AthenaQueryTraceOptions {
|
|
2666
|
+
/**
|
|
2667
|
+
* When false, tracing is off even if diagnostics mode would enable it.
|
|
2668
|
+
* When true, tracing stays on even in quiet (`diagnostics: 'auto'`) environments.
|
|
2669
|
+
* When omitted, quiet environments disable object-form trace options.
|
|
2670
|
+
*/
|
|
2671
|
+
enabled?: boolean;
|
|
2666
2672
|
/**
|
|
2667
2673
|
* Custom sink for trace events. Defaults to console.info.
|
|
2668
2674
|
*/
|
|
@@ -2808,6 +2814,15 @@ interface TableQueryBuilder<Row, Insert = Partial<Row>, Update = Partial<Insert>
|
|
|
2808
2814
|
reset(): TableQueryBuilder<Row, Insert, Update, TContext>;
|
|
2809
2815
|
}
|
|
2810
2816
|
|
|
2817
|
+
/**
|
|
2818
|
+
* Resolve query diagnostics flags for {@link createClient}.
|
|
2819
|
+
*
|
|
2820
|
+
* Prefer `diagnostics: 'auto'` in Next/OpenNext apps so production builds stay
|
|
2821
|
+
* quiet without app-local OPENNEXT_BUILD branching.
|
|
2822
|
+
*/
|
|
2823
|
+
|
|
2824
|
+
type AthenaDiagnosticsMode = boolean | 'auto';
|
|
2825
|
+
|
|
2811
2826
|
type MaybePromise<T> = T | Promise<T>;
|
|
2812
2827
|
type ResolvedModels<TModels> = TModels extends AthenaClientModelsInput ? TModels : never;
|
|
2813
2828
|
|
|
@@ -2842,6 +2857,7 @@ interface AthenaBillingConfig extends Omit<AthenaBillingClientConfig, 'baseUrl'
|
|
|
2842
2857
|
/** Optional override; defaults to the unified/root or db Athena URL. */
|
|
2843
2858
|
url?: string | null;
|
|
2844
2859
|
}
|
|
2860
|
+
|
|
2845
2861
|
interface AthenaClientConfig<TModels extends AthenaClientModelsInput | undefined = undefined> {
|
|
2846
2862
|
url?: string | null;
|
|
2847
2863
|
key?: string | null;
|
|
@@ -2857,6 +2873,12 @@ interface AthenaClientConfig<TModels extends AthenaClientModelsInput | undefined
|
|
|
2857
2873
|
storage?: AthenaStorageConfig;
|
|
2858
2874
|
billing?: AthenaBillingConfig;
|
|
2859
2875
|
retryReads?: boolean;
|
|
2876
|
+
/**
|
|
2877
|
+
* Query diagnostics mode. Prefer `'auto'` in Next/OpenNext apps so production
|
|
2878
|
+
* builds stay quiet without app-local OPENNEXT_BUILD branching.
|
|
2879
|
+
* Per-flag `debugAst` / `findManyAst` / `traceQueries` always win when set.
|
|
2880
|
+
*/
|
|
2881
|
+
diagnostics?: AthenaDiagnosticsMode;
|
|
2860
2882
|
traceQueries?: boolean | AthenaQueryTraceOptions;
|
|
2861
2883
|
debugAst?: boolean;
|
|
2862
2884
|
findManyAst?: boolean;
|
package/package.json
CHANGED
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
},
|
|
17
17
|
"description": "Athena JS SDK",
|
|
18
18
|
"devDependencies": {
|
|
19
|
+
"@biomejs/biome": "^2.5.4",
|
|
19
20
|
"@react-email/components": "^1.0.12",
|
|
20
21
|
"@react-email/render": "^2.0.8",
|
|
21
22
|
"@types/blessed": "^0.1.25",
|
|
@@ -33,7 +34,8 @@
|
|
|
33
34
|
"react-test-renderer": "^18.3.1",
|
|
34
35
|
"tsup": "^8.5.1",
|
|
35
36
|
"tsx": "^4.7.0",
|
|
36
|
-
"typescript": "^5.3.3"
|
|
37
|
+
"typescript": "^5.3.3",
|
|
38
|
+
"ultracite": "^7.9.4"
|
|
37
39
|
},
|
|
38
40
|
"engines": {
|
|
39
41
|
"node": ">=18.0.0"
|
|
@@ -75,6 +77,12 @@
|
|
|
75
77
|
"require": "./dist/cookies.cjs",
|
|
76
78
|
"types": "./dist/cookies.d.ts"
|
|
77
79
|
},
|
|
80
|
+
"./env": {
|
|
81
|
+
"default": "./dist/env.js",
|
|
82
|
+
"import": "./dist/env.js",
|
|
83
|
+
"require": "./dist/env.cjs",
|
|
84
|
+
"types": "./dist/env.d.ts"
|
|
85
|
+
},
|
|
78
86
|
"./next/client": {
|
|
79
87
|
"default": "./dist/next/client.js",
|
|
80
88
|
"import": "./dist/next/client.js",
|
|
@@ -157,6 +165,7 @@
|
|
|
157
165
|
},
|
|
158
166
|
"scripts": {
|
|
159
167
|
"build": "tsup",
|
|
168
|
+
"check": "ultracite check",
|
|
160
169
|
"check:all": "pnpm lint && pnpm typecheck && pnpm test && pnpm build",
|
|
161
170
|
"dev": "tsup --watch",
|
|
162
171
|
"docs:methods": "node scripts/generate-sdk-method-reference.mjs",
|
|
@@ -169,6 +178,8 @@
|
|
|
169
178
|
"example:postgres-connection": "cd examples/postgres-connection && bun run start",
|
|
170
179
|
"example:recurring-invoice": "cd examples/recurring-invoice && bun run start",
|
|
171
180
|
"example:retry-patterns": "cd examples/retry-patterns && bun run start",
|
|
181
|
+
"fix": "ultracite fix",
|
|
182
|
+
"format": "ultracite fix",
|
|
172
183
|
"lint": "eslint \"src/**/*.ts\" \"test/**/*.ts\"",
|
|
173
184
|
"lint:fix": "pnpm lint -- --fix",
|
|
174
185
|
"prepublishOnly": "pnpm typecheck && pnpm build",
|
|
@@ -198,6 +209,9 @@
|
|
|
198
209
|
"cookies": [
|
|
199
210
|
"dist/cookies.d.ts"
|
|
200
211
|
],
|
|
212
|
+
"env": [
|
|
213
|
+
"dist/env.d.ts"
|
|
214
|
+
],
|
|
201
215
|
"next/client": [
|
|
202
216
|
"dist/next/client.d.ts"
|
|
203
217
|
],
|
|
@@ -218,5 +232,5 @@
|
|
|
218
232
|
]
|
|
219
233
|
}
|
|
220
234
|
},
|
|
221
|
-
"version": "3.0
|
|
235
|
+
"version": "3.3.0"
|
|
222
236
|
}
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
import { d as AthenaGatewayErrorCode, q as AthenaGatewayEndpointPath, r as AthenaGatewayMethod, e as AthenaGatewayErrorDetails, s as AthenaGatewayResponse } from './types-Bltx6iL6.js';
|
|
2
|
-
import { s as AnyModelDef, a as InsertOf, n as RowOf, U as UpdateOf } from './types-B75PdABb.js';
|
|
3
|
-
|
|
4
|
-
interface AthenaGatewayErrorInput {
|
|
5
|
-
code: AthenaGatewayErrorCode;
|
|
6
|
-
message: string;
|
|
7
|
-
status?: number;
|
|
8
|
-
endpoint?: AthenaGatewayEndpointPath;
|
|
9
|
-
method?: AthenaGatewayMethod;
|
|
10
|
-
requestId?: string;
|
|
11
|
-
hint?: string;
|
|
12
|
-
cause?: string;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Canonical error for gateway failures.
|
|
16
|
-
* Holds request context and machine-readable classification.
|
|
17
|
-
*/
|
|
18
|
-
declare class AthenaGatewayError extends Error {
|
|
19
|
-
readonly code: AthenaGatewayErrorCode;
|
|
20
|
-
readonly status: number;
|
|
21
|
-
readonly endpoint?: AthenaGatewayEndpointPath;
|
|
22
|
-
readonly method?: AthenaGatewayMethod;
|
|
23
|
-
readonly requestId?: string;
|
|
24
|
-
readonly hint?: string;
|
|
25
|
-
readonly causeDetail?: string;
|
|
26
|
-
constructor(input: AthenaGatewayErrorInput);
|
|
27
|
-
toDetails(): AthenaGatewayErrorDetails;
|
|
28
|
-
static fromResponse<T>(response: AthenaGatewayResponse<T>, fallback: Omit<AthenaGatewayErrorInput, 'code' | 'message' | 'status'>): AthenaGatewayError;
|
|
29
|
-
}
|
|
30
|
-
declare function isAthenaGatewayError(error: unknown): error is AthenaGatewayError;
|
|
31
|
-
|
|
32
|
-
type ModelFormNullishMode = 'empty-string' | 'undefined' | 'null';
|
|
33
|
-
type NullishValueByMode = {
|
|
34
|
-
'empty-string': '';
|
|
35
|
-
undefined: undefined;
|
|
36
|
-
null: null;
|
|
37
|
-
};
|
|
38
|
-
type MapNullableToFormValue<TField, TMode extends ModelFormNullishMode> = null extends TField ? Exclude<TField, null> | NullishValueByMode[TMode] : TField;
|
|
39
|
-
/**
|
|
40
|
-
* Form value shape derived from a model insert payload.
|
|
41
|
-
* Nullable fields are remapped to the selected nullish representation.
|
|
42
|
-
*/
|
|
43
|
-
type ModelFormValues<TModel extends AnyModelDef, TMode extends ModelFormNullishMode = 'empty-string'> = {
|
|
44
|
-
[K in keyof InsertOf<TModel>]: MapNullableToFormValue<InsertOf<TModel>[K], TMode>;
|
|
45
|
-
};
|
|
46
|
-
/**
|
|
47
|
-
* Alias for deriving form value types from any model contract.
|
|
48
|
-
*/
|
|
49
|
-
type FormValuesOf<TModel extends AnyModelDef, TMode extends ModelFormNullishMode = 'empty-string'> = ModelFormValues<TModel, TMode>;
|
|
50
|
-
/**
|
|
51
|
-
* Default value shape for form initialization.
|
|
52
|
-
*/
|
|
53
|
-
type ModelFormDefaults<TModel extends AnyModelDef, TMode extends ModelFormNullishMode = 'empty-string'> = Partial<ModelFormValues<TModel, TMode>>;
|
|
54
|
-
interface ToModelFormDefaultsOptions<TMode extends ModelFormNullishMode = 'empty-string'> {
|
|
55
|
-
/**
|
|
56
|
-
* Controls how nullable model values are represented in form defaults.
|
|
57
|
-
* - `empty-string` (default): `null -> ""`
|
|
58
|
-
* - `undefined`: `null -> undefined`
|
|
59
|
-
* - `null`: keeps `null`
|
|
60
|
-
*/
|
|
61
|
-
nullishMode?: TMode;
|
|
62
|
-
}
|
|
63
|
-
interface ToModelPayloadOptions {
|
|
64
|
-
/**
|
|
65
|
-
* Converts `""` into `null` for nullable model fields.
|
|
66
|
-
* Defaults to `true`.
|
|
67
|
-
*/
|
|
68
|
-
emptyStringAsNull?: boolean;
|
|
69
|
-
/**
|
|
70
|
-
* Omits `undefined` keys from the outgoing payload.
|
|
71
|
-
* Defaults to `true`.
|
|
72
|
-
*/
|
|
73
|
-
stripUndefined?: boolean;
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* Normalizes model data into form-safe defaults using model nullability metadata.
|
|
77
|
-
*/
|
|
78
|
-
declare function toModelFormDefaults<TModel extends AnyModelDef, TMode extends ModelFormNullishMode = 'empty-string'>(model: TModel, values?: Partial<RowOf<TModel>> | Partial<InsertOf<TModel>> | null, options?: ToModelFormDefaultsOptions<TMode>): ModelFormDefaults<TModel, TMode>;
|
|
79
|
-
/**
|
|
80
|
-
* Normalizes form values back into model-compatible insert/update payloads.
|
|
81
|
-
*/
|
|
82
|
-
declare function toModelPayload<TModel extends AnyModelDef>(model: TModel, formValues: Partial<ModelFormValues<TModel, 'empty-string' | 'undefined' | 'null'>>, options?: ToModelPayloadOptions): Partial<InsertOf<TModel>>;
|
|
83
|
-
/**
|
|
84
|
-
* Runtime form adapter bound to a model contract.
|
|
85
|
-
*/
|
|
86
|
-
interface ModelFormAdapter<TModel extends AnyModelDef> {
|
|
87
|
-
model: TModel;
|
|
88
|
-
toDefaults<TMode extends ModelFormNullishMode = 'empty-string'>(values?: Partial<RowOf<TModel>> | Partial<InsertOf<TModel>> | null, options?: ToModelFormDefaultsOptions<TMode>): ModelFormDefaults<TModel, TMode>;
|
|
89
|
-
toInsert(values: Partial<ModelFormValues<TModel, 'empty-string' | 'undefined' | 'null'>>, options?: ToModelPayloadOptions): Partial<InsertOf<TModel>>;
|
|
90
|
-
toUpdate(values: Partial<ModelFormValues<TModel, 'empty-string' | 'undefined' | 'null'>>, options?: ToModelPayloadOptions): Partial<UpdateOf<TModel>>;
|
|
91
|
-
}
|
|
92
|
-
/**
|
|
93
|
-
* Creates a small model-aware adapter for form defaults and payload normalization.
|
|
94
|
-
*/
|
|
95
|
-
declare function createModelFormAdapter<TModel extends AnyModelDef>(model: TModel): ModelFormAdapter<TModel>;
|
|
96
|
-
|
|
97
|
-
export { AthenaGatewayError as A, type FormValuesOf as F, type ModelFormAdapter as M, type ToModelFormDefaultsOptions as T, type ModelFormDefaults as a, type ModelFormNullishMode as b, type ModelFormValues as c, type ToModelPayloadOptions as d, createModelFormAdapter as e, toModelPayload as f, isAthenaGatewayError as i, toModelFormDefaults as t };
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
import { d as AthenaGatewayErrorCode, q as AthenaGatewayEndpointPath, r as AthenaGatewayMethod, e as AthenaGatewayErrorDetails, s as AthenaGatewayResponse } from './types-Bltx6iL6.cjs';
|
|
2
|
-
import { s as AnyModelDef, a as InsertOf, n as RowOf, U as UpdateOf } from './types-CgCv5o6R.cjs';
|
|
3
|
-
|
|
4
|
-
interface AthenaGatewayErrorInput {
|
|
5
|
-
code: AthenaGatewayErrorCode;
|
|
6
|
-
message: string;
|
|
7
|
-
status?: number;
|
|
8
|
-
endpoint?: AthenaGatewayEndpointPath;
|
|
9
|
-
method?: AthenaGatewayMethod;
|
|
10
|
-
requestId?: string;
|
|
11
|
-
hint?: string;
|
|
12
|
-
cause?: string;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Canonical error for gateway failures.
|
|
16
|
-
* Holds request context and machine-readable classification.
|
|
17
|
-
*/
|
|
18
|
-
declare class AthenaGatewayError extends Error {
|
|
19
|
-
readonly code: AthenaGatewayErrorCode;
|
|
20
|
-
readonly status: number;
|
|
21
|
-
readonly endpoint?: AthenaGatewayEndpointPath;
|
|
22
|
-
readonly method?: AthenaGatewayMethod;
|
|
23
|
-
readonly requestId?: string;
|
|
24
|
-
readonly hint?: string;
|
|
25
|
-
readonly causeDetail?: string;
|
|
26
|
-
constructor(input: AthenaGatewayErrorInput);
|
|
27
|
-
toDetails(): AthenaGatewayErrorDetails;
|
|
28
|
-
static fromResponse<T>(response: AthenaGatewayResponse<T>, fallback: Omit<AthenaGatewayErrorInput, 'code' | 'message' | 'status'>): AthenaGatewayError;
|
|
29
|
-
}
|
|
30
|
-
declare function isAthenaGatewayError(error: unknown): error is AthenaGatewayError;
|
|
31
|
-
|
|
32
|
-
type ModelFormNullishMode = 'empty-string' | 'undefined' | 'null';
|
|
33
|
-
type NullishValueByMode = {
|
|
34
|
-
'empty-string': '';
|
|
35
|
-
undefined: undefined;
|
|
36
|
-
null: null;
|
|
37
|
-
};
|
|
38
|
-
type MapNullableToFormValue<TField, TMode extends ModelFormNullishMode> = null extends TField ? Exclude<TField, null> | NullishValueByMode[TMode] : TField;
|
|
39
|
-
/**
|
|
40
|
-
* Form value shape derived from a model insert payload.
|
|
41
|
-
* Nullable fields are remapped to the selected nullish representation.
|
|
42
|
-
*/
|
|
43
|
-
type ModelFormValues<TModel extends AnyModelDef, TMode extends ModelFormNullishMode = 'empty-string'> = {
|
|
44
|
-
[K in keyof InsertOf<TModel>]: MapNullableToFormValue<InsertOf<TModel>[K], TMode>;
|
|
45
|
-
};
|
|
46
|
-
/**
|
|
47
|
-
* Alias for deriving form value types from any model contract.
|
|
48
|
-
*/
|
|
49
|
-
type FormValuesOf<TModel extends AnyModelDef, TMode extends ModelFormNullishMode = 'empty-string'> = ModelFormValues<TModel, TMode>;
|
|
50
|
-
/**
|
|
51
|
-
* Default value shape for form initialization.
|
|
52
|
-
*/
|
|
53
|
-
type ModelFormDefaults<TModel extends AnyModelDef, TMode extends ModelFormNullishMode = 'empty-string'> = Partial<ModelFormValues<TModel, TMode>>;
|
|
54
|
-
interface ToModelFormDefaultsOptions<TMode extends ModelFormNullishMode = 'empty-string'> {
|
|
55
|
-
/**
|
|
56
|
-
* Controls how nullable model values are represented in form defaults.
|
|
57
|
-
* - `empty-string` (default): `null -> ""`
|
|
58
|
-
* - `undefined`: `null -> undefined`
|
|
59
|
-
* - `null`: keeps `null`
|
|
60
|
-
*/
|
|
61
|
-
nullishMode?: TMode;
|
|
62
|
-
}
|
|
63
|
-
interface ToModelPayloadOptions {
|
|
64
|
-
/**
|
|
65
|
-
* Converts `""` into `null` for nullable model fields.
|
|
66
|
-
* Defaults to `true`.
|
|
67
|
-
*/
|
|
68
|
-
emptyStringAsNull?: boolean;
|
|
69
|
-
/**
|
|
70
|
-
* Omits `undefined` keys from the outgoing payload.
|
|
71
|
-
* Defaults to `true`.
|
|
72
|
-
*/
|
|
73
|
-
stripUndefined?: boolean;
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* Normalizes model data into form-safe defaults using model nullability metadata.
|
|
77
|
-
*/
|
|
78
|
-
declare function toModelFormDefaults<TModel extends AnyModelDef, TMode extends ModelFormNullishMode = 'empty-string'>(model: TModel, values?: Partial<RowOf<TModel>> | Partial<InsertOf<TModel>> | null, options?: ToModelFormDefaultsOptions<TMode>): ModelFormDefaults<TModel, TMode>;
|
|
79
|
-
/**
|
|
80
|
-
* Normalizes form values back into model-compatible insert/update payloads.
|
|
81
|
-
*/
|
|
82
|
-
declare function toModelPayload<TModel extends AnyModelDef>(model: TModel, formValues: Partial<ModelFormValues<TModel, 'empty-string' | 'undefined' | 'null'>>, options?: ToModelPayloadOptions): Partial<InsertOf<TModel>>;
|
|
83
|
-
/**
|
|
84
|
-
* Runtime form adapter bound to a model contract.
|
|
85
|
-
*/
|
|
86
|
-
interface ModelFormAdapter<TModel extends AnyModelDef> {
|
|
87
|
-
model: TModel;
|
|
88
|
-
toDefaults<TMode extends ModelFormNullishMode = 'empty-string'>(values?: Partial<RowOf<TModel>> | Partial<InsertOf<TModel>> | null, options?: ToModelFormDefaultsOptions<TMode>): ModelFormDefaults<TModel, TMode>;
|
|
89
|
-
toInsert(values: Partial<ModelFormValues<TModel, 'empty-string' | 'undefined' | 'null'>>, options?: ToModelPayloadOptions): Partial<InsertOf<TModel>>;
|
|
90
|
-
toUpdate(values: Partial<ModelFormValues<TModel, 'empty-string' | 'undefined' | 'null'>>, options?: ToModelPayloadOptions): Partial<UpdateOf<TModel>>;
|
|
91
|
-
}
|
|
92
|
-
/**
|
|
93
|
-
* Creates a small model-aware adapter for form defaults and payload normalization.
|
|
94
|
-
*/
|
|
95
|
-
declare function createModelFormAdapter<TModel extends AnyModelDef>(model: TModel): ModelFormAdapter<TModel>;
|
|
96
|
-
|
|
97
|
-
export { AthenaGatewayError as A, type FormValuesOf as F, type ModelFormAdapter as M, type ToModelFormDefaultsOptions as T, type ModelFormDefaults as a, type ModelFormNullishMode as b, type ModelFormValues as c, type ToModelPayloadOptions as d, createModelFormAdapter as e, toModelPayload as f, isAthenaGatewayError as i, toModelFormDefaults as t };
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { R as RunGeneratorOptions, d as RunGeneratorResult } from './types-DFr2cL1N.cjs';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* End-to-end generator execution: load config, introspect, render, and optionally write files.
|
|
5
|
-
*/
|
|
6
|
-
declare function runSchemaGenerator(options?: RunGeneratorOptions): Promise<RunGeneratorResult>;
|
|
7
|
-
|
|
8
|
-
export { runSchemaGenerator as r };
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { R as RunGeneratorOptions, d as RunGeneratorResult } from './types-D6tZ9aoq.js';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* End-to-end generator execution: load config, introspect, render, and optionally write files.
|
|
5
|
-
*/
|
|
6
|
-
declare function runSchemaGenerator(options?: RunGeneratorOptions): Promise<RunGeneratorResult>;
|
|
7
|
-
|
|
8
|
-
export { runSchemaGenerator as r };
|