@xylex-group/athena 3.0.2 → 3.1.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/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 +322 -1
- package/dist/browser.cjs.map +1 -1
- package/dist/browser.d.cts +5 -5
- package/dist/browser.d.ts +5 -5
- package/dist/browser.js +301 -2
- package/dist/browser.js.map +1 -1
- package/dist/cli/index.cjs +5381 -3772
- 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 +5385 -3776
- package/dist/cli/index.js.map +1 -1
- package/dist/index.cjs +1723 -26
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +28 -6
- package/dist/index.d.ts +28 -6
- package/dist/index.js +1695 -28
- package/dist/index.js.map +1 -1
- package/dist/model-form-BbdzJ9Uh.d.ts +259 -0
- package/dist/model-form-BhWWsA-7.d.cts +259 -0
- package/dist/{module-CkUM6v58.d.ts → module-DKkJKOuJ.d.ts} +2 -2
- package/dist/{module-CB25egcO.d.cts → module-xFd7_Igv.d.cts} +2 -2
- package/dist/next/client.cjs +1 -1
- package/dist/next/client.cjs.map +1 -1
- package/dist/next/client.js +1 -1
- package/dist/next/client.js.map +1 -1
- package/dist/next/server.cjs +1 -1
- package/dist/next/server.cjs.map +1 -1
- package/dist/next/server.js +1 -1
- package/dist/next/server.js.map +1 -1
- package/dist/pipeline-DuKzYGia.d.cts +93 -0
- package/dist/pipeline-wer2G9xW.d.ts +93 -0
- package/dist/react.cjs +400 -3
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +67 -2
- package/dist/react.d.ts +67 -2
- package/dist/react.js +400 -4
- package/dist/react.js.map +1 -1
- package/dist/{types-BBm-kEBL.d.cts → types-1ztXDgPa.d.cts} +62 -2
- package/dist/{types-BaAMXCqK.d.ts → types-CccOiXPo.d.ts} +62 -2
- package/package.json +1 -1
- package/dist/model-form-Dh0sisdL.d.ts +0 -97
- package/dist/model-form-oOAJUVd4.d.cts +0 -97
- package/dist/pipeline-B8aN2EHe.d.ts +0 -8
- package/dist/pipeline-D4W-Cc-A.d.cts +0 -8
|
@@ -54,6 +54,21 @@ interface GeneratorOutputTargets {
|
|
|
54
54
|
}
|
|
55
55
|
type GeneratorOutputPreset = 'legacy' | 'athena-direct';
|
|
56
56
|
type GeneratorOutputFormat = 'define-model' | 'table-builder';
|
|
57
|
+
/**
|
|
58
|
+
* How existing database/registry artifacts are handled on regenerate.
|
|
59
|
+
*
|
|
60
|
+
* - `merge` (default): additive smart merge — append missing imports/keys, preserve custom code
|
|
61
|
+
* - `skip`: never rewrite existing files (legacy protect behavior)
|
|
62
|
+
* - `overwrite`: always replace with pure generated content
|
|
63
|
+
*/
|
|
64
|
+
type GeneratorArtifactWritePolicy = 'merge' | 'skip' | 'overwrite';
|
|
65
|
+
/**
|
|
66
|
+
* Per-kind write policy for protected generator artifacts.
|
|
67
|
+
*/
|
|
68
|
+
interface GeneratorArtifactWriteConfig {
|
|
69
|
+
database?: GeneratorArtifactWritePolicy;
|
|
70
|
+
registry?: GeneratorArtifactWritePolicy;
|
|
71
|
+
}
|
|
57
72
|
/**
|
|
58
73
|
* Output configuration including dynamic placeholder aliases.
|
|
59
74
|
*/
|
|
@@ -62,6 +77,7 @@ interface GeneratorOutputConfig {
|
|
|
62
77
|
preset?: GeneratorOutputPreset;
|
|
63
78
|
targets?: Partial<GeneratorOutputTargets>;
|
|
64
79
|
placeholderMap?: Record<string, string>;
|
|
80
|
+
artifactWrite?: GeneratorArtifactWriteConfig;
|
|
65
81
|
}
|
|
66
82
|
/**
|
|
67
83
|
* Normalized output configuration with defaults applied.
|
|
@@ -71,6 +87,10 @@ interface NormalizedGeneratorOutputConfig {
|
|
|
71
87
|
preset: GeneratorOutputPreset;
|
|
72
88
|
targets: GeneratorOutputTargets;
|
|
73
89
|
placeholderMap: Record<string, string>;
|
|
90
|
+
artifactWrite: {
|
|
91
|
+
database: GeneratorArtifactWritePolicy;
|
|
92
|
+
registry: GeneratorArtifactWritePolicy;
|
|
93
|
+
};
|
|
74
94
|
}
|
|
75
95
|
/**
|
|
76
96
|
* Schemas selected for PostgreSQL introspection. Strings may be comma-separated
|
|
@@ -207,6 +227,29 @@ interface RunGeneratorOptions {
|
|
|
207
227
|
configPath?: string;
|
|
208
228
|
dryRun?: boolean;
|
|
209
229
|
provider?: SchemaIntrospectionProvider;
|
|
230
|
+
/**
|
|
231
|
+
* When true (default), ensure/update `athena.config.ts` intelligently:
|
|
232
|
+
* create when missing, auto-fill schemas when discovery finds more,
|
|
233
|
+
* skip writes when nothing changed.
|
|
234
|
+
*
|
|
235
|
+
* Pass false for pure env-only CI runs that must not touch the config file.
|
|
236
|
+
*/
|
|
237
|
+
writeConfig?: boolean;
|
|
238
|
+
/**
|
|
239
|
+
* Discover live PostgreSQL schemas and expand the effective schema list
|
|
240
|
+
* used for introspection. Defaults to true.
|
|
241
|
+
*/
|
|
242
|
+
discoverSchemas?: boolean;
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
* Summary of intelligent config-file ensure work performed during generate.
|
|
246
|
+
*/
|
|
247
|
+
interface GeneratorConfigEnsureSummary {
|
|
248
|
+
action: 'created' | 'updated' | 'unchanged' | 'skipped';
|
|
249
|
+
path: string;
|
|
250
|
+
schemas: string[];
|
|
251
|
+
changes: string[];
|
|
252
|
+
reason?: string;
|
|
210
253
|
}
|
|
211
254
|
/**
|
|
212
255
|
* Generator execution result including files written to disk.
|
|
@@ -215,13 +258,30 @@ interface RunGeneratorResult extends GeneratedArtifacts {
|
|
|
215
258
|
configPath: string;
|
|
216
259
|
config: NormalizedAthenaGeneratorConfig;
|
|
217
260
|
writtenFiles: string[];
|
|
261
|
+
writtenDetails: WrittenGeneratedArtifact[];
|
|
218
262
|
skippedFiles: SkippedGeneratedArtifact[];
|
|
263
|
+
/**
|
|
264
|
+
* Present when generate ran config ensure/sync (even if action is unchanged).
|
|
265
|
+
*/
|
|
266
|
+
configEnsure?: GeneratorConfigEnsureSummary;
|
|
219
267
|
}
|
|
220
|
-
type SkippedGeneratedArtifactReason = 'protected-existing-file';
|
|
268
|
+
type SkippedGeneratedArtifactReason = 'protected-existing-file' | 'merge-conflict' | 'merge-lint-failed' | 'merge-unparseable' | 'already-current';
|
|
269
|
+
type WrittenGeneratedArtifactReason = 'created' | 'overwritten' | 'merged';
|
|
221
270
|
interface SkippedGeneratedArtifact {
|
|
222
271
|
kind: GeneratorArtifactKind;
|
|
223
272
|
path: string;
|
|
224
273
|
reason: SkippedGeneratedArtifactReason;
|
|
274
|
+
detail?: string;
|
|
275
|
+
preservedCustom?: string[];
|
|
276
|
+
conflicts?: string[];
|
|
277
|
+
lintErrors?: string[];
|
|
278
|
+
}
|
|
279
|
+
interface WrittenGeneratedArtifact {
|
|
280
|
+
kind: GeneratorArtifactKind;
|
|
281
|
+
path: string;
|
|
282
|
+
reason: WrittenGeneratedArtifactReason;
|
|
283
|
+
added?: string[];
|
|
284
|
+
preservedCustom?: string[];
|
|
225
285
|
}
|
|
226
286
|
|
|
227
|
-
export type { AthenaGeneratorConfig as A, GeneratedArtifacts as G, LoadGeneratorConfigOptions as L, NormalizedAthenaGeneratorConfig as N, RunGeneratorOptions as R, SkippedGeneratedArtifact as S, LoadedGeneratorConfig as a, GeneratorProviderConfig as b, GeneratorExperimentalFlags as c, RunGeneratorResult as d, GeneratedArtifact as e, GeneratorArtifactKind as f, GeneratorFeatureFlags as g, GeneratorFilterConfig as h, GeneratorInternalConfig as i, GeneratorNamingConfig as j, GeneratorOutputConfig as k, GeneratorOutputFormat as l, GeneratorOutputPreset as m, GeneratorOutputTargets as n, GeneratorSchemaSelection as o, GeneratorTableSelection as p, NamingStyle as q, NormalizedGeneratorFilterConfig as r, NormalizedGeneratorOutputConfig as s, SkippedGeneratedArtifactReason as t };
|
|
287
|
+
export type { AthenaGeneratorConfig as A, GeneratedArtifacts as G, LoadGeneratorConfigOptions as L, NormalizedAthenaGeneratorConfig as N, RunGeneratorOptions as R, SkippedGeneratedArtifact as S, LoadedGeneratorConfig as a, GeneratorProviderConfig as b, GeneratorExperimentalFlags as c, RunGeneratorResult as d, GeneratedArtifact as e, GeneratorArtifactKind as f, GeneratorFeatureFlags as g, GeneratorFilterConfig as h, GeneratorInternalConfig as i, GeneratorNamingConfig as j, GeneratorOutputConfig as k, GeneratorOutputFormat as l, GeneratorOutputPreset as m, GeneratorOutputTargets as n, GeneratorSchemaSelection as o, GeneratorTableSelection as p, NamingStyle as q, NormalizedGeneratorFilterConfig as r, NormalizedGeneratorOutputConfig as s, SkippedGeneratedArtifactReason as t, GeneratorConfigEnsureSummary as u };
|
|
@@ -54,6 +54,21 @@ interface GeneratorOutputTargets {
|
|
|
54
54
|
}
|
|
55
55
|
type GeneratorOutputPreset = 'legacy' | 'athena-direct';
|
|
56
56
|
type GeneratorOutputFormat = 'define-model' | 'table-builder';
|
|
57
|
+
/**
|
|
58
|
+
* How existing database/registry artifacts are handled on regenerate.
|
|
59
|
+
*
|
|
60
|
+
* - `merge` (default): additive smart merge — append missing imports/keys, preserve custom code
|
|
61
|
+
* - `skip`: never rewrite existing files (legacy protect behavior)
|
|
62
|
+
* - `overwrite`: always replace with pure generated content
|
|
63
|
+
*/
|
|
64
|
+
type GeneratorArtifactWritePolicy = 'merge' | 'skip' | 'overwrite';
|
|
65
|
+
/**
|
|
66
|
+
* Per-kind write policy for protected generator artifacts.
|
|
67
|
+
*/
|
|
68
|
+
interface GeneratorArtifactWriteConfig {
|
|
69
|
+
database?: GeneratorArtifactWritePolicy;
|
|
70
|
+
registry?: GeneratorArtifactWritePolicy;
|
|
71
|
+
}
|
|
57
72
|
/**
|
|
58
73
|
* Output configuration including dynamic placeholder aliases.
|
|
59
74
|
*/
|
|
@@ -62,6 +77,7 @@ interface GeneratorOutputConfig {
|
|
|
62
77
|
preset?: GeneratorOutputPreset;
|
|
63
78
|
targets?: Partial<GeneratorOutputTargets>;
|
|
64
79
|
placeholderMap?: Record<string, string>;
|
|
80
|
+
artifactWrite?: GeneratorArtifactWriteConfig;
|
|
65
81
|
}
|
|
66
82
|
/**
|
|
67
83
|
* Normalized output configuration with defaults applied.
|
|
@@ -71,6 +87,10 @@ interface NormalizedGeneratorOutputConfig {
|
|
|
71
87
|
preset: GeneratorOutputPreset;
|
|
72
88
|
targets: GeneratorOutputTargets;
|
|
73
89
|
placeholderMap: Record<string, string>;
|
|
90
|
+
artifactWrite: {
|
|
91
|
+
database: GeneratorArtifactWritePolicy;
|
|
92
|
+
registry: GeneratorArtifactWritePolicy;
|
|
93
|
+
};
|
|
74
94
|
}
|
|
75
95
|
/**
|
|
76
96
|
* Schemas selected for PostgreSQL introspection. Strings may be comma-separated
|
|
@@ -207,6 +227,29 @@ interface RunGeneratorOptions {
|
|
|
207
227
|
configPath?: string;
|
|
208
228
|
dryRun?: boolean;
|
|
209
229
|
provider?: SchemaIntrospectionProvider;
|
|
230
|
+
/**
|
|
231
|
+
* When true (default), ensure/update `athena.config.ts` intelligently:
|
|
232
|
+
* create when missing, auto-fill schemas when discovery finds more,
|
|
233
|
+
* skip writes when nothing changed.
|
|
234
|
+
*
|
|
235
|
+
* Pass false for pure env-only CI runs that must not touch the config file.
|
|
236
|
+
*/
|
|
237
|
+
writeConfig?: boolean;
|
|
238
|
+
/**
|
|
239
|
+
* Discover live PostgreSQL schemas and expand the effective schema list
|
|
240
|
+
* used for introspection. Defaults to true.
|
|
241
|
+
*/
|
|
242
|
+
discoverSchemas?: boolean;
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
* Summary of intelligent config-file ensure work performed during generate.
|
|
246
|
+
*/
|
|
247
|
+
interface GeneratorConfigEnsureSummary {
|
|
248
|
+
action: 'created' | 'updated' | 'unchanged' | 'skipped';
|
|
249
|
+
path: string;
|
|
250
|
+
schemas: string[];
|
|
251
|
+
changes: string[];
|
|
252
|
+
reason?: string;
|
|
210
253
|
}
|
|
211
254
|
/**
|
|
212
255
|
* Generator execution result including files written to disk.
|
|
@@ -215,13 +258,30 @@ interface RunGeneratorResult extends GeneratedArtifacts {
|
|
|
215
258
|
configPath: string;
|
|
216
259
|
config: NormalizedAthenaGeneratorConfig;
|
|
217
260
|
writtenFiles: string[];
|
|
261
|
+
writtenDetails: WrittenGeneratedArtifact[];
|
|
218
262
|
skippedFiles: SkippedGeneratedArtifact[];
|
|
263
|
+
/**
|
|
264
|
+
* Present when generate ran config ensure/sync (even if action is unchanged).
|
|
265
|
+
*/
|
|
266
|
+
configEnsure?: GeneratorConfigEnsureSummary;
|
|
219
267
|
}
|
|
220
|
-
type SkippedGeneratedArtifactReason = 'protected-existing-file';
|
|
268
|
+
type SkippedGeneratedArtifactReason = 'protected-existing-file' | 'merge-conflict' | 'merge-lint-failed' | 'merge-unparseable' | 'already-current';
|
|
269
|
+
type WrittenGeneratedArtifactReason = 'created' | 'overwritten' | 'merged';
|
|
221
270
|
interface SkippedGeneratedArtifact {
|
|
222
271
|
kind: GeneratorArtifactKind;
|
|
223
272
|
path: string;
|
|
224
273
|
reason: SkippedGeneratedArtifactReason;
|
|
274
|
+
detail?: string;
|
|
275
|
+
preservedCustom?: string[];
|
|
276
|
+
conflicts?: string[];
|
|
277
|
+
lintErrors?: string[];
|
|
278
|
+
}
|
|
279
|
+
interface WrittenGeneratedArtifact {
|
|
280
|
+
kind: GeneratorArtifactKind;
|
|
281
|
+
path: string;
|
|
282
|
+
reason: WrittenGeneratedArtifactReason;
|
|
283
|
+
added?: string[];
|
|
284
|
+
preservedCustom?: string[];
|
|
225
285
|
}
|
|
226
286
|
|
|
227
|
-
export type { AthenaGeneratorConfig as A, GeneratedArtifacts as G, LoadGeneratorConfigOptions as L, NormalizedAthenaGeneratorConfig as N, RunGeneratorOptions as R, SkippedGeneratedArtifact as S, LoadedGeneratorConfig as a, GeneratorProviderConfig as b, GeneratorExperimentalFlags as c, RunGeneratorResult as d, GeneratedArtifact as e, GeneratorArtifactKind as f, GeneratorFeatureFlags as g, GeneratorFilterConfig as h, GeneratorInternalConfig as i, GeneratorNamingConfig as j, GeneratorOutputConfig as k, GeneratorOutputFormat as l, GeneratorOutputPreset as m, GeneratorOutputTargets as n, GeneratorSchemaSelection as o, GeneratorTableSelection as p, NamingStyle as q, NormalizedGeneratorFilterConfig as r, NormalizedGeneratorOutputConfig as s, SkippedGeneratedArtifactReason as t };
|
|
287
|
+
export type { AthenaGeneratorConfig as A, GeneratedArtifacts as G, LoadGeneratorConfigOptions as L, NormalizedAthenaGeneratorConfig as N, RunGeneratorOptions as R, SkippedGeneratedArtifact as S, LoadedGeneratorConfig as a, GeneratorProviderConfig as b, GeneratorExperimentalFlags as c, RunGeneratorResult as d, GeneratedArtifact as e, GeneratorArtifactKind as f, GeneratorFeatureFlags as g, GeneratorFilterConfig as h, GeneratorInternalConfig as i, GeneratorNamingConfig as j, GeneratorOutputConfig as k, GeneratorOutputFormat as l, GeneratorOutputPreset as m, GeneratorOutputTargets as n, GeneratorSchemaSelection as o, GeneratorTableSelection as p, NamingStyle as q, NormalizedGeneratorFilterConfig as r, NormalizedGeneratorOutputConfig as s, SkippedGeneratedArtifactReason as t, GeneratorConfigEnsureSummary as u };
|
package/package.json
CHANGED
|
@@ -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-BaAMXCqK.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 };
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { R as RunGeneratorOptions, d as RunGeneratorResult } from './types-BBm-kEBL.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 };
|