@xylex-group/athena 3.1.0 → 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.
Files changed (82) hide show
  1. package/README.md +1 -1
  2. package/dist/admin.cjs +55 -1
  3. package/dist/admin.cjs.map +1 -1
  4. package/dist/admin.d.cts +32 -8
  5. package/dist/admin.d.ts +32 -8
  6. package/dist/admin.js +54 -2
  7. package/dist/admin.js.map +1 -1
  8. package/dist/athena-auth-url-C1FbVmN6.d.cts +200 -0
  9. package/dist/athena-auth-url-C1FbVmN6.d.ts +200 -0
  10. package/dist/{athena-request-headers-C7Jy-c_D.d.ts → athena-request-headers-DzimbvOA.d.ts} +48 -200
  11. package/dist/{athena-request-headers-DujFFyMU.d.cts → athena-request-headers-Lr_m8xCV.d.cts} +48 -200
  12. package/dist/billing.cjs +1 -1
  13. package/dist/billing.cjs.map +1 -1
  14. package/dist/billing.js +1 -1
  15. package/dist/billing.js.map +1 -1
  16. package/dist/browser.cjs +602 -16
  17. package/dist/browser.cjs.map +1 -1
  18. package/dist/browser.d.cts +8 -7
  19. package/dist/browser.d.ts +8 -7
  20. package/dist/browser.js +593 -17
  21. package/dist/browser.js.map +1 -1
  22. package/dist/cli/index.cjs +141 -6
  23. package/dist/cli/index.cjs.map +1 -1
  24. package/dist/cli/index.d.cts +2 -2
  25. package/dist/cli/index.d.ts +2 -2
  26. package/dist/cli/index.js +141 -6
  27. package/dist/cli/index.js.map +1 -1
  28. package/dist/env.cjs +130 -0
  29. package/dist/env.cjs.map +1 -0
  30. package/dist/env.d.cts +70 -0
  31. package/dist/env.d.ts +70 -0
  32. package/dist/env.js +122 -0
  33. package/dist/env.js.map +1 -0
  34. package/dist/index.cjs +624 -19
  35. package/dist/index.cjs.map +1 -1
  36. package/dist/index.d.cts +8 -7
  37. package/dist/index.d.ts +8 -7
  38. package/dist/index.js +615 -20
  39. package/dist/index.js.map +1 -1
  40. package/dist/{model-form-BhWWsA-7.d.cts → model-form-3Gr8rkdT.d.cts} +24 -2
  41. package/dist/{model-form-BbdzJ9Uh.d.ts → model-form-CotpEL7z.d.ts} +24 -2
  42. package/dist/{module-xFd7_Igv.d.cts → module-CQmOaDzP.d.cts} +4 -4
  43. package/dist/{module-DKkJKOuJ.d.ts → module-CWkUTcUc.d.ts} +4 -4
  44. package/dist/next/client.cjs +123 -7
  45. package/dist/next/client.cjs.map +1 -1
  46. package/dist/next/client.d.cts +4 -3
  47. package/dist/next/client.d.ts +4 -3
  48. package/dist/next/client.js +123 -7
  49. package/dist/next/client.js.map +1 -1
  50. package/dist/next/server.cjs +1130 -364
  51. package/dist/next/server.cjs.map +1 -1
  52. package/dist/next/server.d.cts +121 -8
  53. package/dist/next/server.d.ts +121 -8
  54. package/dist/next/server.js +1120 -365
  55. package/dist/next/server.js.map +1 -1
  56. package/dist/{pipeline-DuKzYGia.d.cts → pipeline-BnRKO_Pd.d.cts} +1 -1
  57. package/dist/{pipeline-wer2G9xW.d.ts → pipeline-sWCmlFqu.d.ts} +1 -1
  58. package/dist/{proxy-request-headers-m4D2Tduy.d.ts → proxy-request-headers-CttlcuRb.d.ts} +1 -1
  59. package/dist/{proxy-request-headers-DGxdoyA0.d.cts → proxy-request-headers-pIBSn1Fw.d.cts} +1 -1
  60. package/dist/react.cjs +290 -31
  61. package/dist/react.cjs.map +1 -1
  62. package/dist/react.d.cts +59 -9
  63. package/dist/react.d.ts +59 -9
  64. package/dist/react.js +290 -32
  65. package/dist/react.js.map +1 -1
  66. package/dist/schema-handlers-BtT_IQFi.d.cts +138 -0
  67. package/dist/schema-handlers-VjFDhIMw.d.ts +138 -0
  68. package/dist/social-providers.d.cts +1 -1
  69. package/dist/social-providers.d.ts +1 -1
  70. package/dist/{types-CccOiXPo.d.ts → types-BDX8zS7w.d.ts} +12 -0
  71. package/dist/{types-AOY-GLu8.d.cts → types-BVKpQmfY.d.cts} +11 -0
  72. package/dist/{types-AOY-GLu8.d.ts → types-BVKpQmfY.d.ts} +11 -0
  73. package/dist/{types-1ztXDgPa.d.cts → types-D-Am7YSd.d.cts} +12 -0
  74. package/dist/utils.cjs +30 -0
  75. package/dist/utils.cjs.map +1 -1
  76. package/dist/utils.d.cts +3 -2
  77. package/dist/utils.d.ts +3 -2
  78. package/dist/utils.js +30 -1
  79. package/dist/utils.js.map +1 -1
  80. package/dist/{v3-client-CWfZHcKL.d.cts → v3-client-G1SLeHRa.d.cts} +23 -1
  81. package/dist/{v3-client-DZp2NEhK.d.ts → v3-client-ao8BWQ8v.d.ts} +23 -1
  82. package/package.json +16 -2
@@ -1,4 +1,4 @@
1
- import { F as AthenaAuthClientConfig, D as AthenaAuthBindings } from './types-AOY-GLu8.cjs';
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-AOY-GLu8.js';
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.1.0"
235
+ "version": "3.3.0"
222
236
  }