@xylex-group/athena 2.11.0 → 2.12.1

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 (62) hide show
  1. package/README.md +1 -1
  2. package/dist/browser.cjs +299 -240
  3. package/dist/browser.cjs.map +1 -1
  4. package/dist/browser.d.cts +9 -8
  5. package/dist/browser.d.ts +9 -8
  6. package/dist/browser.js +299 -240
  7. package/dist/browser.js.map +1 -1
  8. package/dist/cli/index.cjs +272 -240
  9. package/dist/cli/index.cjs.map +1 -1
  10. package/dist/cli/index.d.cts +4 -3
  11. package/dist/cli/index.d.ts +4 -3
  12. package/dist/cli/index.js +272 -240
  13. package/dist/cli/index.js.map +1 -1
  14. package/dist/{client-DD_UeF3Q.d.ts → client-CMtx5P4D.d.cts} +20 -9
  15. package/dist/{client-WqBuu60O.d.cts → client-Dre8H24u.d.ts} +20 -9
  16. package/dist/index.cjs +299 -240
  17. package/dist/index.cjs.map +1 -1
  18. package/dist/index.d.cts +9 -8
  19. package/dist/index.d.ts +9 -8
  20. package/dist/index.js +299 -240
  21. package/dist/index.js.map +1 -1
  22. package/dist/{model-form-ByvyyvxB.d.ts → model-form-CU0mWrF9.d.ts} +2 -1
  23. package/dist/{model-form-DACdBLYG.d.cts → model-form-DfTi8-D1.d.cts} +2 -1
  24. package/dist/{module-DRkIHtY-.d.ts → module-DBGmbIuh.d.ts} +5 -4
  25. package/dist/{module-BFMyVmwX.d.cts → module-GoijrBXV.d.cts} +5 -4
  26. package/dist/next/client.cjs +299 -240
  27. package/dist/next/client.cjs.map +1 -1
  28. package/dist/next/client.d.cts +4 -3
  29. package/dist/next/client.d.ts +4 -3
  30. package/dist/next/client.js +299 -240
  31. package/dist/next/client.js.map +1 -1
  32. package/dist/next/server.cjs +299 -240
  33. package/dist/next/server.cjs.map +1 -1
  34. package/dist/next/server.d.cts +4 -3
  35. package/dist/next/server.d.ts +4 -3
  36. package/dist/next/server.js +299 -240
  37. package/dist/next/server.js.map +1 -1
  38. package/dist/{pipeline-DZMsPxUg.d.ts → pipeline-DrjU2vNA.d.ts} +1 -1
  39. package/dist/{pipeline-CmUZsXsi.d.cts → pipeline-c7Gdm0qv.d.cts} +1 -1
  40. package/dist/react.cjs +237 -98
  41. package/dist/react.cjs.map +1 -1
  42. package/dist/react.d.cts +5 -4
  43. package/dist/react.d.ts +5 -4
  44. package/dist/react.js +237 -98
  45. package/dist/react.js.map +1 -1
  46. package/dist/{shared-B1ueL-Ox.d.cts → shared-DZSGAmXs.d.cts} +2 -2
  47. package/dist/{shared-GPAprhBb.d.ts → shared-MMnVBBfy.d.ts} +2 -2
  48. package/dist/{types-CRjDwmtJ.d.ts → types-BLizCLd1.d.cts} +2 -1
  49. package/dist/types-BRUHGXo2.d.cts +236 -0
  50. package/dist/types-BRUHGXo2.d.ts +236 -0
  51. package/dist/types-Bez4HSbI.d.cts +204 -0
  52. package/dist/{types-C-YvfgYh.d.cts → types-DRRb0Fd0.d.ts} +2 -1
  53. package/dist/types-kPaHUqUa.d.ts +204 -0
  54. package/dist/utils.cjs +279 -0
  55. package/dist/utils.cjs.map +1 -1
  56. package/dist/utils.d.cts +58 -1
  57. package/dist/utils.d.ts +58 -1
  58. package/dist/utils.js +272 -1
  59. package/dist/utils.js.map +1 -1
  60. package/package.json +1 -1
  61. package/dist/types-BeZIHduP.d.cts +0 -428
  62. package/dist/types-BeZIHduP.d.ts +0 -428
@@ -1,5 +1,5 @@
1
- import { bK as AthenaCreateClientAuthOptions, bC as AthenaClientExperimentalOptions, cb as AthenaHeaderBag } from './client-WqBuu60O.cjs';
2
- import { p as BackendConfig, q as BackendType } from './types-BeZIHduP.cjs';
1
+ import { bK as AthenaCreateClientAuthOptions, bC as AthenaClientExperimentalOptions, cb as AthenaHeaderBag } from './client-CMtx5P4D.cjs';
2
+ import { o as BackendConfig, p as BackendType } from './types-BRUHGXo2.cjs';
3
3
 
4
4
  interface AthenaRequestCookiesBag {
5
5
  getAll(): Array<{
@@ -1,5 +1,5 @@
1
- import { bK as AthenaCreateClientAuthOptions, bC as AthenaClientExperimentalOptions, cb as AthenaHeaderBag } from './client-DD_UeF3Q.js';
2
- import { p as BackendConfig, q as BackendType } from './types-BeZIHduP.js';
1
+ import { bK as AthenaCreateClientAuthOptions, bC as AthenaClientExperimentalOptions, cb as AthenaHeaderBag } from './client-Dre8H24u.js';
2
+ import { o as BackendConfig, p as BackendType } from './types-BRUHGXo2.js';
3
3
 
4
4
  interface AthenaRequestCookiesBag {
5
5
  getAll(): Array<{
@@ -1,4 +1,5 @@
1
- import { q as BackendType, I as IntrospectionSnapshot, S as SchemaIntrospectionProvider } from './types-BeZIHduP.js';
1
+ import { p as BackendType } from './types-BRUHGXo2.cjs';
2
+ import { I as IntrospectionSnapshot, S as SchemaIntrospectionProvider } from './types-Bez4HSbI.cjs';
2
3
 
3
4
  /**
4
5
  * Supported case transformations for generated symbols and path token variants.
@@ -0,0 +1,236 @@
1
+ /**
2
+ * athena gateway types
3
+ *
4
+ * type definitions for the athena gateway api client and react hook
5
+ */
6
+ type AthenaGatewayMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
7
+ type AthenaGatewayEndpointPath = '/gateway/fetch' | '/gateway/insert' | '/gateway/update' | '/gateway/delete' | '/gateway/rpc' | '/gateway/query' | `/rpc/${string}` | `/storage/${string}`;
8
+ type AthenaCountOption = 'exact' | 'planned' | 'estimated';
9
+ type AthenaJsonPrimitive = string | number | boolean | null;
10
+ type AthenaJsonValue = AthenaJsonPrimitive | AthenaJsonObject | AthenaJsonArray;
11
+ interface AthenaJsonObject {
12
+ [key: string]: AthenaJsonValue;
13
+ }
14
+ type AthenaJsonArray = AthenaJsonValue[];
15
+ type AthenaConditionValue = AthenaJsonPrimitive;
16
+ type AthenaConditionArrayValue = Array<AthenaConditionValue>;
17
+ type AthenaConditionCastType = string;
18
+ type AthenaConditionOperator = 'eq' | 'neq' | 'gt' | 'gte' | 'lt' | 'lte' | 'like' | 'ilike' | 'is' | 'in' | 'contains' | 'containedBy' | 'not' | 'or';
19
+ interface AthenaGatewayCondition {
20
+ column?: string;
21
+ operator: AthenaConditionOperator;
22
+ value?: AthenaConditionValue | AthenaConditionArrayValue | string;
23
+ /**
24
+ * Optional explicit cast for `value` (for example `"uuid"`).
25
+ * Older gateways ignore unknown fields; newer gateways may use this hint.
26
+ */
27
+ value_cast?: AthenaConditionCastType;
28
+ /**
29
+ * Optional explicit cast for `column` (for example `"text"`).
30
+ * Used by SDK SQL fallback for typed comparisons.
31
+ */
32
+ column_cast?: AthenaConditionCastType;
33
+ /** Back-compat shape expected by older gateway implementations */
34
+ eq_column?: string;
35
+ eq_value?: AthenaConditionValue | AthenaConditionArrayValue | string;
36
+ /** Optional cast hint aligned with legacy eq_* fields */
37
+ eq_value_cast?: AthenaConditionCastType;
38
+ /** Optional cast hint aligned with legacy eq_* fields */
39
+ eq_column_cast?: AthenaConditionCastType;
40
+ }
41
+ type AthenaSortDirection = 'ascending' | 'descending';
42
+ interface AthenaSortBy {
43
+ field: string;
44
+ direction: AthenaSortDirection;
45
+ }
46
+ interface AthenaFetchPayload {
47
+ select?: string | AthenaJsonObject;
48
+ view_name?: string;
49
+ table_name?: string;
50
+ columns?: string[] | string;
51
+ where?: AthenaJsonObject;
52
+ orderBy?: AthenaJsonObject | AthenaJsonArray;
53
+ conditions?: AthenaGatewayCondition[];
54
+ limit?: number;
55
+ offset?: number;
56
+ current_page?: number;
57
+ page_size?: number;
58
+ total_pages?: number;
59
+ strip_nulls?: boolean;
60
+ count?: AthenaCountOption;
61
+ head?: boolean;
62
+ group_by?: string;
63
+ time_granularity?: 'day' | 'hour' | 'minute';
64
+ aggregation_column?: string;
65
+ aggregation_strategy?: 'cumulative_sum';
66
+ aggregation_dedup?: boolean;
67
+ sort_by?: AthenaSortBy;
68
+ }
69
+ interface AthenaInsertPayload<TInsertBody = AthenaJsonObject, TUpdateBody = AthenaJsonObject> {
70
+ table_name: string;
71
+ insert_body: TInsertBody | TInsertBody[];
72
+ update_body?: TUpdateBody;
73
+ columns?: string[] | string;
74
+ count?: AthenaCountOption;
75
+ head?: boolean;
76
+ default_to_null?: boolean;
77
+ on_conflict?: string | string[];
78
+ }
79
+ interface AthenaDeletePayload {
80
+ table_name: string;
81
+ resource_id?: string;
82
+ columns?: string[] | string;
83
+ conditions?: AthenaGatewayCondition[];
84
+ sort_by?: AthenaSortBy;
85
+ current_page?: number;
86
+ page_size?: number;
87
+ total_pages?: number;
88
+ }
89
+ interface AthenaUpdatePayload<TUpdateBody = AthenaJsonObject> extends AthenaFetchPayload {
90
+ set?: TUpdateBody;
91
+ data?: TUpdateBody;
92
+ }
93
+ type AthenaRpcFilterOperator = 'eq' | 'neq' | 'gt' | 'gte' | 'lt' | 'lte' | 'like' | 'ilike' | 'is' | 'in';
94
+ interface AthenaRpcFilter {
95
+ column: string;
96
+ operator: AthenaRpcFilterOperator;
97
+ value?: AthenaConditionValue | AthenaConditionArrayValue | string;
98
+ }
99
+ interface AthenaRpcOrder {
100
+ column: string;
101
+ ascending?: boolean;
102
+ }
103
+ interface AthenaRpcPayload<TArgs = AthenaJsonObject> {
104
+ function: string;
105
+ function_name?: string;
106
+ schema?: string;
107
+ args?: TArgs;
108
+ select?: string;
109
+ filters?: AthenaRpcFilter[];
110
+ count?: AthenaCountOption;
111
+ head?: boolean;
112
+ limit?: number;
113
+ offset?: number;
114
+ order?: AthenaRpcOrder;
115
+ }
116
+ interface AthenaQueryPayload {
117
+ query: string;
118
+ }
119
+ /** Backend type for Athena client (aligns with athena-rs) */
120
+ type BackendType = 'athena' | 'postgrest' | 'postgresql' | 'scylladb';
121
+ /** Backend config: type from SDK + backend-scoped options */
122
+ interface BackendConfig {
123
+ type: BackendType;
124
+ options?: AthenaJsonObject;
125
+ }
126
+ /** Pre-defined backends for lean usage: backend: Backend.Athena */
127
+ declare const Backend: {
128
+ readonly Athena: {
129
+ readonly type: "athena";
130
+ };
131
+ readonly Postgrest: {
132
+ readonly type: "postgrest";
133
+ };
134
+ readonly PostgreSQL: {
135
+ readonly type: "postgresql";
136
+ };
137
+ readonly ScyllaDB: {
138
+ readonly type: "scylladb";
139
+ };
140
+ };
141
+ type BackendOption = BackendConfig | BackendType;
142
+ interface AthenaGatewayBaseOptions {
143
+ baseUrl?: string;
144
+ apiKey?: string;
145
+ /** Overrides `X-Athena-Key` while leaving `apikey` / `x-api-key` / `X-Api-Key` on `apiKey`. */
146
+ athenaKey?: string | null;
147
+ client?: string;
148
+ backend?: BackendOption;
149
+ publishEvent?: string;
150
+ forceNoCache?: boolean;
151
+ headers?: Record<string, string>;
152
+ userId?: string | null;
153
+ organizationId?: string | null;
154
+ /** Direct PostgreSQL URI forwarded as `x-pg-uri` (OpenAPI preferred routing header). */
155
+ pgUri?: string | null;
156
+ /** JDBC/PostgreSQL URI mirrored to `x-athena-jdbc-url` and `x-jdbc-url` compatibility headers. */
157
+ jdbcUrl?: string | null;
158
+ bearerToken?: string | null;
159
+ cookie?: string | null;
160
+ sessionToken?: string | null;
161
+ }
162
+ type AthenaGatewayHookConfig = AthenaGatewayBaseOptions;
163
+ interface AthenaGatewayCallOptions extends AthenaGatewayBaseOptions {
164
+ schema?: string;
165
+ count?: AthenaCountOption;
166
+ head?: boolean;
167
+ defaultToNull?: boolean;
168
+ stripNulls?: boolean;
169
+ onConflict?: string | string[];
170
+ updateBody?: AthenaJsonObject;
171
+ }
172
+ interface AthenaRpcCallOptions extends AthenaGatewayCallOptions {
173
+ count?: AthenaCountOption;
174
+ get?: boolean;
175
+ }
176
+ interface AthenaGatewayResponse<T = unknown> {
177
+ ok: boolean;
178
+ status: number;
179
+ statusText?: string | null;
180
+ data: T | null;
181
+ count?: number | null;
182
+ error?: string;
183
+ errorDetails?: AthenaGatewayErrorDetails | null;
184
+ raw: unknown;
185
+ }
186
+ type AthenaGatewayErrorCode = 'NETWORK_ERROR' | 'INVALID_URL' | 'HTTP_ERROR' | 'INVALID_JSON' | 'UNKNOWN_ERROR';
187
+ interface AthenaGatewayErrorDetails {
188
+ code: AthenaGatewayErrorCode;
189
+ message: string;
190
+ status: number;
191
+ endpoint?: AthenaGatewayEndpointPath;
192
+ method?: AthenaGatewayMethod;
193
+ requestId?: string;
194
+ hint?: string;
195
+ cause?: string;
196
+ }
197
+ interface AthenaGatewayConnectionOptions {
198
+ path?: `/${string}`;
199
+ headers?: Record<string, string>;
200
+ signal?: AbortSignal;
201
+ }
202
+ interface AthenaGatewayConnectionResult {
203
+ ok: boolean;
204
+ reachable: boolean;
205
+ status: number;
206
+ statusText?: string | null;
207
+ baseUrl: string;
208
+ url: string;
209
+ error?: string;
210
+ errorDetails?: AthenaGatewayErrorDetails | null;
211
+ raw: unknown;
212
+ }
213
+ interface AthenaGatewayResponseLog extends AthenaGatewayResponse {
214
+ timestamp: string;
215
+ }
216
+ interface AthenaGatewayCallLog {
217
+ endpoint: AthenaGatewayEndpointPath;
218
+ method: AthenaGatewayMethod;
219
+ payload: unknown;
220
+ headers: Record<string, string>;
221
+ timestamp: string;
222
+ }
223
+ interface AthenaGatewayHookResult {
224
+ fetchGateway: <T = unknown>(payload: AthenaFetchPayload, options?: AthenaGatewayCallOptions) => Promise<AthenaGatewayResponse<T>>;
225
+ insertGateway: <T = unknown>(payload: AthenaInsertPayload, options?: AthenaGatewayCallOptions) => Promise<AthenaGatewayResponse<T>>;
226
+ updateGateway: <T = unknown>(payload: AthenaUpdatePayload, options?: AthenaGatewayCallOptions) => Promise<AthenaGatewayResponse<T>>;
227
+ deleteGateway: <T = unknown>(payload: AthenaDeletePayload, options?: AthenaGatewayCallOptions) => Promise<AthenaGatewayResponse<T>>;
228
+ rpcGateway: <T = unknown>(payload: AthenaRpcPayload, options?: AthenaRpcCallOptions) => Promise<AthenaGatewayResponse<T>>;
229
+ isLoading: boolean;
230
+ error: string | null;
231
+ lastRequest: AthenaGatewayCallLog | null;
232
+ lastResponse: AthenaGatewayResponseLog | null;
233
+ baseUrl: string;
234
+ }
235
+
236
+ export { type AthenaConditionCastType as A, Backend as B, type AthenaGatewayBaseOptions as C, type AthenaConditionValue as D, type AthenaConditionArrayValue as E, type AthenaGatewayCondition as F, type AthenaSortBy as G, type AthenaConditionOperator as H, type BackendOption as I, type AthenaGatewayCallOptions as a, type AthenaGatewayConnectionOptions as b, type AthenaGatewayConnectionResult as c, type AthenaGatewayErrorCode as d, type AthenaGatewayErrorDetails as e, type AthenaJsonArray as f, type AthenaJsonObject as g, type AthenaJsonPrimitive as h, type AthenaJsonValue as i, type AthenaRpcCallOptions as j, type AthenaRpcFilter as k, type AthenaRpcFilterOperator as l, type AthenaRpcOrder as m, type AthenaRpcPayload as n, type BackendConfig as o, type BackendType as p, type AthenaGatewayHookConfig as q, type AthenaGatewayHookResult as r, type AthenaDeletePayload as s, type AthenaFetchPayload as t, type AthenaGatewayResponse as u, type AthenaInsertPayload as v, type AthenaUpdatePayload as w, type AthenaGatewayEndpointPath as x, type AthenaGatewayMethod as y, type AthenaQueryPayload as z };
@@ -0,0 +1,236 @@
1
+ /**
2
+ * athena gateway types
3
+ *
4
+ * type definitions for the athena gateway api client and react hook
5
+ */
6
+ type AthenaGatewayMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
7
+ type AthenaGatewayEndpointPath = '/gateway/fetch' | '/gateway/insert' | '/gateway/update' | '/gateway/delete' | '/gateway/rpc' | '/gateway/query' | `/rpc/${string}` | `/storage/${string}`;
8
+ type AthenaCountOption = 'exact' | 'planned' | 'estimated';
9
+ type AthenaJsonPrimitive = string | number | boolean | null;
10
+ type AthenaJsonValue = AthenaJsonPrimitive | AthenaJsonObject | AthenaJsonArray;
11
+ interface AthenaJsonObject {
12
+ [key: string]: AthenaJsonValue;
13
+ }
14
+ type AthenaJsonArray = AthenaJsonValue[];
15
+ type AthenaConditionValue = AthenaJsonPrimitive;
16
+ type AthenaConditionArrayValue = Array<AthenaConditionValue>;
17
+ type AthenaConditionCastType = string;
18
+ type AthenaConditionOperator = 'eq' | 'neq' | 'gt' | 'gte' | 'lt' | 'lte' | 'like' | 'ilike' | 'is' | 'in' | 'contains' | 'containedBy' | 'not' | 'or';
19
+ interface AthenaGatewayCondition {
20
+ column?: string;
21
+ operator: AthenaConditionOperator;
22
+ value?: AthenaConditionValue | AthenaConditionArrayValue | string;
23
+ /**
24
+ * Optional explicit cast for `value` (for example `"uuid"`).
25
+ * Older gateways ignore unknown fields; newer gateways may use this hint.
26
+ */
27
+ value_cast?: AthenaConditionCastType;
28
+ /**
29
+ * Optional explicit cast for `column` (for example `"text"`).
30
+ * Used by SDK SQL fallback for typed comparisons.
31
+ */
32
+ column_cast?: AthenaConditionCastType;
33
+ /** Back-compat shape expected by older gateway implementations */
34
+ eq_column?: string;
35
+ eq_value?: AthenaConditionValue | AthenaConditionArrayValue | string;
36
+ /** Optional cast hint aligned with legacy eq_* fields */
37
+ eq_value_cast?: AthenaConditionCastType;
38
+ /** Optional cast hint aligned with legacy eq_* fields */
39
+ eq_column_cast?: AthenaConditionCastType;
40
+ }
41
+ type AthenaSortDirection = 'ascending' | 'descending';
42
+ interface AthenaSortBy {
43
+ field: string;
44
+ direction: AthenaSortDirection;
45
+ }
46
+ interface AthenaFetchPayload {
47
+ select?: string | AthenaJsonObject;
48
+ view_name?: string;
49
+ table_name?: string;
50
+ columns?: string[] | string;
51
+ where?: AthenaJsonObject;
52
+ orderBy?: AthenaJsonObject | AthenaJsonArray;
53
+ conditions?: AthenaGatewayCondition[];
54
+ limit?: number;
55
+ offset?: number;
56
+ current_page?: number;
57
+ page_size?: number;
58
+ total_pages?: number;
59
+ strip_nulls?: boolean;
60
+ count?: AthenaCountOption;
61
+ head?: boolean;
62
+ group_by?: string;
63
+ time_granularity?: 'day' | 'hour' | 'minute';
64
+ aggregation_column?: string;
65
+ aggregation_strategy?: 'cumulative_sum';
66
+ aggregation_dedup?: boolean;
67
+ sort_by?: AthenaSortBy;
68
+ }
69
+ interface AthenaInsertPayload<TInsertBody = AthenaJsonObject, TUpdateBody = AthenaJsonObject> {
70
+ table_name: string;
71
+ insert_body: TInsertBody | TInsertBody[];
72
+ update_body?: TUpdateBody;
73
+ columns?: string[] | string;
74
+ count?: AthenaCountOption;
75
+ head?: boolean;
76
+ default_to_null?: boolean;
77
+ on_conflict?: string | string[];
78
+ }
79
+ interface AthenaDeletePayload {
80
+ table_name: string;
81
+ resource_id?: string;
82
+ columns?: string[] | string;
83
+ conditions?: AthenaGatewayCondition[];
84
+ sort_by?: AthenaSortBy;
85
+ current_page?: number;
86
+ page_size?: number;
87
+ total_pages?: number;
88
+ }
89
+ interface AthenaUpdatePayload<TUpdateBody = AthenaJsonObject> extends AthenaFetchPayload {
90
+ set?: TUpdateBody;
91
+ data?: TUpdateBody;
92
+ }
93
+ type AthenaRpcFilterOperator = 'eq' | 'neq' | 'gt' | 'gte' | 'lt' | 'lte' | 'like' | 'ilike' | 'is' | 'in';
94
+ interface AthenaRpcFilter {
95
+ column: string;
96
+ operator: AthenaRpcFilterOperator;
97
+ value?: AthenaConditionValue | AthenaConditionArrayValue | string;
98
+ }
99
+ interface AthenaRpcOrder {
100
+ column: string;
101
+ ascending?: boolean;
102
+ }
103
+ interface AthenaRpcPayload<TArgs = AthenaJsonObject> {
104
+ function: string;
105
+ function_name?: string;
106
+ schema?: string;
107
+ args?: TArgs;
108
+ select?: string;
109
+ filters?: AthenaRpcFilter[];
110
+ count?: AthenaCountOption;
111
+ head?: boolean;
112
+ limit?: number;
113
+ offset?: number;
114
+ order?: AthenaRpcOrder;
115
+ }
116
+ interface AthenaQueryPayload {
117
+ query: string;
118
+ }
119
+ /** Backend type for Athena client (aligns with athena-rs) */
120
+ type BackendType = 'athena' | 'postgrest' | 'postgresql' | 'scylladb';
121
+ /** Backend config: type from SDK + backend-scoped options */
122
+ interface BackendConfig {
123
+ type: BackendType;
124
+ options?: AthenaJsonObject;
125
+ }
126
+ /** Pre-defined backends for lean usage: backend: Backend.Athena */
127
+ declare const Backend: {
128
+ readonly Athena: {
129
+ readonly type: "athena";
130
+ };
131
+ readonly Postgrest: {
132
+ readonly type: "postgrest";
133
+ };
134
+ readonly PostgreSQL: {
135
+ readonly type: "postgresql";
136
+ };
137
+ readonly ScyllaDB: {
138
+ readonly type: "scylladb";
139
+ };
140
+ };
141
+ type BackendOption = BackendConfig | BackendType;
142
+ interface AthenaGatewayBaseOptions {
143
+ baseUrl?: string;
144
+ apiKey?: string;
145
+ /** Overrides `X-Athena-Key` while leaving `apikey` / `x-api-key` / `X-Api-Key` on `apiKey`. */
146
+ athenaKey?: string | null;
147
+ client?: string;
148
+ backend?: BackendOption;
149
+ publishEvent?: string;
150
+ forceNoCache?: boolean;
151
+ headers?: Record<string, string>;
152
+ userId?: string | null;
153
+ organizationId?: string | null;
154
+ /** Direct PostgreSQL URI forwarded as `x-pg-uri` (OpenAPI preferred routing header). */
155
+ pgUri?: string | null;
156
+ /** JDBC/PostgreSQL URI mirrored to `x-athena-jdbc-url` and `x-jdbc-url` compatibility headers. */
157
+ jdbcUrl?: string | null;
158
+ bearerToken?: string | null;
159
+ cookie?: string | null;
160
+ sessionToken?: string | null;
161
+ }
162
+ type AthenaGatewayHookConfig = AthenaGatewayBaseOptions;
163
+ interface AthenaGatewayCallOptions extends AthenaGatewayBaseOptions {
164
+ schema?: string;
165
+ count?: AthenaCountOption;
166
+ head?: boolean;
167
+ defaultToNull?: boolean;
168
+ stripNulls?: boolean;
169
+ onConflict?: string | string[];
170
+ updateBody?: AthenaJsonObject;
171
+ }
172
+ interface AthenaRpcCallOptions extends AthenaGatewayCallOptions {
173
+ count?: AthenaCountOption;
174
+ get?: boolean;
175
+ }
176
+ interface AthenaGatewayResponse<T = unknown> {
177
+ ok: boolean;
178
+ status: number;
179
+ statusText?: string | null;
180
+ data: T | null;
181
+ count?: number | null;
182
+ error?: string;
183
+ errorDetails?: AthenaGatewayErrorDetails | null;
184
+ raw: unknown;
185
+ }
186
+ type AthenaGatewayErrorCode = 'NETWORK_ERROR' | 'INVALID_URL' | 'HTTP_ERROR' | 'INVALID_JSON' | 'UNKNOWN_ERROR';
187
+ interface AthenaGatewayErrorDetails {
188
+ code: AthenaGatewayErrorCode;
189
+ message: string;
190
+ status: number;
191
+ endpoint?: AthenaGatewayEndpointPath;
192
+ method?: AthenaGatewayMethod;
193
+ requestId?: string;
194
+ hint?: string;
195
+ cause?: string;
196
+ }
197
+ interface AthenaGatewayConnectionOptions {
198
+ path?: `/${string}`;
199
+ headers?: Record<string, string>;
200
+ signal?: AbortSignal;
201
+ }
202
+ interface AthenaGatewayConnectionResult {
203
+ ok: boolean;
204
+ reachable: boolean;
205
+ status: number;
206
+ statusText?: string | null;
207
+ baseUrl: string;
208
+ url: string;
209
+ error?: string;
210
+ errorDetails?: AthenaGatewayErrorDetails | null;
211
+ raw: unknown;
212
+ }
213
+ interface AthenaGatewayResponseLog extends AthenaGatewayResponse {
214
+ timestamp: string;
215
+ }
216
+ interface AthenaGatewayCallLog {
217
+ endpoint: AthenaGatewayEndpointPath;
218
+ method: AthenaGatewayMethod;
219
+ payload: unknown;
220
+ headers: Record<string, string>;
221
+ timestamp: string;
222
+ }
223
+ interface AthenaGatewayHookResult {
224
+ fetchGateway: <T = unknown>(payload: AthenaFetchPayload, options?: AthenaGatewayCallOptions) => Promise<AthenaGatewayResponse<T>>;
225
+ insertGateway: <T = unknown>(payload: AthenaInsertPayload, options?: AthenaGatewayCallOptions) => Promise<AthenaGatewayResponse<T>>;
226
+ updateGateway: <T = unknown>(payload: AthenaUpdatePayload, options?: AthenaGatewayCallOptions) => Promise<AthenaGatewayResponse<T>>;
227
+ deleteGateway: <T = unknown>(payload: AthenaDeletePayload, options?: AthenaGatewayCallOptions) => Promise<AthenaGatewayResponse<T>>;
228
+ rpcGateway: <T = unknown>(payload: AthenaRpcPayload, options?: AthenaRpcCallOptions) => Promise<AthenaGatewayResponse<T>>;
229
+ isLoading: boolean;
230
+ error: string | null;
231
+ lastRequest: AthenaGatewayCallLog | null;
232
+ lastResponse: AthenaGatewayResponseLog | null;
233
+ baseUrl: string;
234
+ }
235
+
236
+ export { type AthenaConditionCastType as A, Backend as B, type AthenaGatewayBaseOptions as C, type AthenaConditionValue as D, type AthenaConditionArrayValue as E, type AthenaGatewayCondition as F, type AthenaSortBy as G, type AthenaConditionOperator as H, type BackendOption as I, type AthenaGatewayCallOptions as a, type AthenaGatewayConnectionOptions as b, type AthenaGatewayConnectionResult as c, type AthenaGatewayErrorCode as d, type AthenaGatewayErrorDetails as e, type AthenaJsonArray as f, type AthenaJsonObject as g, type AthenaJsonPrimitive as h, type AthenaJsonValue as i, type AthenaRpcCallOptions as j, type AthenaRpcFilter as k, type AthenaRpcFilterOperator as l, type AthenaRpcOrder as m, type AthenaRpcPayload as n, type BackendConfig as o, type BackendType as p, type AthenaGatewayHookConfig as q, type AthenaGatewayHookResult as r, type AthenaDeletePayload as s, type AthenaFetchPayload as t, type AthenaGatewayResponse as u, type AthenaInsertPayload as v, type AthenaUpdatePayload as w, type AthenaGatewayEndpointPath as x, type AthenaGatewayMethod as y, type AthenaQueryPayload as z };