@xylex-group/athena 3.0.3 → 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.
Files changed (50) hide show
  1. package/README.md +1 -1
  2. package/dist/billing.cjs +1 -1
  3. package/dist/billing.cjs.map +1 -1
  4. package/dist/billing.js +1 -1
  5. package/dist/billing.js.map +1 -1
  6. package/dist/browser.cjs +322 -1
  7. package/dist/browser.cjs.map +1 -1
  8. package/dist/browser.d.cts +5 -5
  9. package/dist/browser.d.ts +5 -5
  10. package/dist/browser.js +301 -2
  11. package/dist/browser.js.map +1 -1
  12. package/dist/cli/index.cjs +7771 -7058
  13. package/dist/cli/index.cjs.map +1 -1
  14. package/dist/cli/index.d.cts +17 -10
  15. package/dist/cli/index.d.ts +17 -10
  16. package/dist/cli/index.js +7773 -7060
  17. package/dist/cli/index.js.map +1 -1
  18. package/dist/index.cjs +885 -18
  19. package/dist/index.cjs.map +1 -1
  20. package/dist/index.d.cts +28 -6
  21. package/dist/index.d.ts +28 -6
  22. package/dist/index.js +857 -20
  23. package/dist/index.js.map +1 -1
  24. package/dist/model-form-BbdzJ9Uh.d.ts +259 -0
  25. package/dist/model-form-BhWWsA-7.d.cts +259 -0
  26. package/dist/{module-BruTcxe0.d.ts → module-DKkJKOuJ.d.ts} +2 -2
  27. package/dist/{module-CPG3ULxQ.d.cts → module-xFd7_Igv.d.cts} +2 -2
  28. package/dist/next/client.cjs +1 -1
  29. package/dist/next/client.cjs.map +1 -1
  30. package/dist/next/client.js +1 -1
  31. package/dist/next/client.js.map +1 -1
  32. package/dist/next/server.cjs +1 -1
  33. package/dist/next/server.cjs.map +1 -1
  34. package/dist/next/server.js +1 -1
  35. package/dist/next/server.js.map +1 -1
  36. package/dist/pipeline-DuKzYGia.d.cts +93 -0
  37. package/dist/pipeline-wer2G9xW.d.ts +93 -0
  38. package/dist/react.cjs +400 -3
  39. package/dist/react.cjs.map +1 -1
  40. package/dist/react.d.cts +67 -2
  41. package/dist/react.d.ts +67 -2
  42. package/dist/react.js +400 -4
  43. package/dist/react.js.map +1 -1
  44. package/dist/{types-DFr2cL1N.d.cts → types-1ztXDgPa.d.cts} +28 -1
  45. package/dist/{types-D6tZ9aoq.d.ts → types-CccOiXPo.d.ts} +28 -1
  46. package/package.json +1 -1
  47. package/dist/model-form-Dh0sisdL.d.ts +0 -97
  48. package/dist/model-form-oOAJUVd4.d.cts +0 -97
  49. package/dist/pipeline-CIzV9f7b.d.cts +0 -8
  50. package/dist/pipeline-DNlc8Ayn.d.ts +0 -8
@@ -227,6 +227,29 @@ interface RunGeneratorOptions {
227
227
  configPath?: string;
228
228
  dryRun?: boolean;
229
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;
230
253
  }
231
254
  /**
232
255
  * Generator execution result including files written to disk.
@@ -237,6 +260,10 @@ interface RunGeneratorResult extends GeneratedArtifacts {
237
260
  writtenFiles: string[];
238
261
  writtenDetails: WrittenGeneratedArtifact[];
239
262
  skippedFiles: SkippedGeneratedArtifact[];
263
+ /**
264
+ * Present when generate ran config ensure/sync (even if action is unchanged).
265
+ */
266
+ configEnsure?: GeneratorConfigEnsureSummary;
240
267
  }
241
268
  type SkippedGeneratedArtifactReason = 'protected-existing-file' | 'merge-conflict' | 'merge-lint-failed' | 'merge-unparseable' | 'already-current';
242
269
  type WrittenGeneratedArtifactReason = 'created' | 'overwritten' | 'merged';
@@ -257,4 +284,4 @@ interface WrittenGeneratedArtifact {
257
284
  preservedCustom?: string[];
258
285
  }
259
286
 
260
- 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 };
@@ -227,6 +227,29 @@ interface RunGeneratorOptions {
227
227
  configPath?: string;
228
228
  dryRun?: boolean;
229
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;
230
253
  }
231
254
  /**
232
255
  * Generator execution result including files written to disk.
@@ -237,6 +260,10 @@ interface RunGeneratorResult extends GeneratedArtifacts {
237
260
  writtenFiles: string[];
238
261
  writtenDetails: WrittenGeneratedArtifact[];
239
262
  skippedFiles: SkippedGeneratedArtifact[];
263
+ /**
264
+ * Present when generate ran config ensure/sync (even if action is unchanged).
265
+ */
266
+ configEnsure?: GeneratorConfigEnsureSummary;
240
267
  }
241
268
  type SkippedGeneratedArtifactReason = 'protected-existing-file' | 'merge-conflict' | 'merge-lint-failed' | 'merge-unparseable' | 'already-current';
242
269
  type WrittenGeneratedArtifactReason = 'created' | 'overwritten' | 'merged';
@@ -257,4 +284,4 @@ interface WrittenGeneratedArtifact {
257
284
  preservedCustom?: string[];
258
285
  }
259
286
 
260
- 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
@@ -218,5 +218,5 @@
218
218
  ]
219
219
  }
220
220
  },
221
- "version": "3.0.3"
221
+ "version": "3.1.0"
222
222
  }
@@ -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 };