@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.
- 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 +602 -16
- 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 +593 -17
- package/dist/browser.js.map +1 -1
- package/dist/cli/index.cjs +141 -6
- package/dist/cli/index.cjs.map +1 -1
- package/dist/cli/index.d.cts +2 -2
- package/dist/cli/index.d.ts +2 -2
- package/dist/cli/index.js +141 -6
- 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 +624 -19
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +8 -7
- package/dist/index.d.ts +8 -7
- package/dist/index.js +615 -20
- package/dist/index.js.map +1 -1
- package/dist/{model-form-BhWWsA-7.d.cts → model-form-3Gr8rkdT.d.cts} +24 -2
- package/dist/{model-form-BbdzJ9Uh.d.ts → model-form-CotpEL7z.d.ts} +24 -2
- package/dist/{module-xFd7_Igv.d.cts → module-CQmOaDzP.d.cts} +4 -4
- package/dist/{module-DKkJKOuJ.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-DuKzYGia.d.cts → pipeline-BnRKO_Pd.d.cts} +1 -1
- package/dist/{pipeline-wer2G9xW.d.ts → pipeline-sWCmlFqu.d.ts} +1 -1
- 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 +290 -31
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +59 -9
- package/dist/react.d.ts +59 -9
- package/dist/react.js +290 -32
- 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-CccOiXPo.d.ts → types-BDX8zS7w.d.ts} +12 -0
- 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-1ztXDgPa.d.cts → types-D-Am7YSd.d.cts} +12 -0
- 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/browser.js
CHANGED
|
@@ -2003,7 +2003,7 @@ function buildAthenaGatewayUrl(baseUrl, path) {
|
|
|
2003
2003
|
|
|
2004
2004
|
// package.json
|
|
2005
2005
|
var package_default = {
|
|
2006
|
-
version: "3.
|
|
2006
|
+
version: "3.3.0"
|
|
2007
2007
|
};
|
|
2008
2008
|
|
|
2009
2009
|
// src/sdk-version.ts
|
|
@@ -4763,6 +4763,14 @@ function createAuthModule(config = {}, runtimeOptions = {}) {
|
|
|
4763
4763
|
changeEmailVerify: (input, options) => getWithQuery("/change-email/verify", input, options),
|
|
4764
4764
|
deleteUserVerify: (input, options) => getWithQuery("/delete-user/verify", input, options),
|
|
4765
4765
|
changePassword: (input, options) => postGeneric("/change-password", input, options),
|
|
4766
|
+
// Better Auth UI flat method aliases (also nested under session/account/social/user).
|
|
4767
|
+
listSessions: (input, options) => getGeneric("/list-sessions", input, options),
|
|
4768
|
+
revokeSession: sessionRevokeBinding,
|
|
4769
|
+
revokeOtherSessions,
|
|
4770
|
+
listAccounts: (input, options) => getGeneric("/list-accounts", input, options),
|
|
4771
|
+
unlinkAccount: (input, options) => postGeneric("/unlink-account", input, options),
|
|
4772
|
+
linkSocial: (input, options) => postGeneric("/link-social", input, options),
|
|
4773
|
+
updateUser: (input, options) => postGeneric("/update-user", input, options),
|
|
4766
4774
|
user: {
|
|
4767
4775
|
update: (input, options) => postGeneric("/update-user", input, options),
|
|
4768
4776
|
delete: (input, options) => postGeneric("/delete-user", input, options),
|
|
@@ -10572,6 +10580,82 @@ function mergeAthenaRequestContexts(base, override) {
|
|
|
10572
10580
|
};
|
|
10573
10581
|
}
|
|
10574
10582
|
|
|
10583
|
+
// src/diagnostics.ts
|
|
10584
|
+
function readProcessEnv2() {
|
|
10585
|
+
try {
|
|
10586
|
+
return globalThis.process?.env ?? {};
|
|
10587
|
+
} catch {
|
|
10588
|
+
return {};
|
|
10589
|
+
}
|
|
10590
|
+
}
|
|
10591
|
+
function isTruthyEnv(value) {
|
|
10592
|
+
if (!value) return false;
|
|
10593
|
+
const normalized = value.trim().toLowerCase();
|
|
10594
|
+
return normalized === "1" || normalized === "true" || normalized === "yes" || normalized === "on";
|
|
10595
|
+
}
|
|
10596
|
+
function isQuietAthenaDiagnosticsEnvironment(env = readProcessEnv2()) {
|
|
10597
|
+
const nodeEnv = env.NODE_ENV?.trim().toLowerCase();
|
|
10598
|
+
if (nodeEnv === "production") {
|
|
10599
|
+
return true;
|
|
10600
|
+
}
|
|
10601
|
+
if (isTruthyEnv(env.OPENNEXT_BUILD)) {
|
|
10602
|
+
return true;
|
|
10603
|
+
}
|
|
10604
|
+
const nextPhase = env.NEXT_PHASE?.trim();
|
|
10605
|
+
if (nextPhase === "phase-production-build") {
|
|
10606
|
+
return true;
|
|
10607
|
+
}
|
|
10608
|
+
if (isTruthyEnv(env.CI) && nodeEnv !== "test") {
|
|
10609
|
+
if (nodeEnv === "production" || isTruthyEnv(env.OPENNEXT_BUILD)) {
|
|
10610
|
+
return true;
|
|
10611
|
+
}
|
|
10612
|
+
}
|
|
10613
|
+
return false;
|
|
10614
|
+
}
|
|
10615
|
+
function resolveBooleanFlag(explicit, mode, quiet) {
|
|
10616
|
+
if (typeof explicit === "boolean") {
|
|
10617
|
+
return explicit;
|
|
10618
|
+
}
|
|
10619
|
+
if (mode === true) {
|
|
10620
|
+
return true;
|
|
10621
|
+
}
|
|
10622
|
+
if (mode === false) {
|
|
10623
|
+
return false;
|
|
10624
|
+
}
|
|
10625
|
+
if (mode === "auto") {
|
|
10626
|
+
return false;
|
|
10627
|
+
}
|
|
10628
|
+
return false;
|
|
10629
|
+
}
|
|
10630
|
+
function resolveAthenaClientDiagnostics(input) {
|
|
10631
|
+
const env = input.env ?? readProcessEnv2();
|
|
10632
|
+
const quiet = isQuietAthenaDiagnosticsEnvironment(env);
|
|
10633
|
+
const mode = input.diagnostics;
|
|
10634
|
+
const effectiveMode = mode === "auto" && quiet ? false : mode;
|
|
10635
|
+
const debugAst = resolveBooleanFlag(input.debugAst, effectiveMode);
|
|
10636
|
+
const findManyAst = resolveBooleanFlag(input.findManyAst, effectiveMode);
|
|
10637
|
+
let traceQueries;
|
|
10638
|
+
if (input.traceQueries !== void 0) {
|
|
10639
|
+
if (typeof input.traceQueries === "boolean") {
|
|
10640
|
+
traceQueries = input.traceQueries;
|
|
10641
|
+
} else if (effectiveMode === false || mode === "auto" && quiet) {
|
|
10642
|
+
const enabled = input.traceQueries.enabled;
|
|
10643
|
+
traceQueries = typeof enabled === "boolean" ? enabled ? input.traceQueries : false : false;
|
|
10644
|
+
} else {
|
|
10645
|
+
traceQueries = input.traceQueries;
|
|
10646
|
+
}
|
|
10647
|
+
} else if (effectiveMode === true) {
|
|
10648
|
+
traceQueries = true;
|
|
10649
|
+
} else {
|
|
10650
|
+
traceQueries = false;
|
|
10651
|
+
}
|
|
10652
|
+
return {
|
|
10653
|
+
debugAst,
|
|
10654
|
+
findManyAst,
|
|
10655
|
+
traceQueries
|
|
10656
|
+
};
|
|
10657
|
+
}
|
|
10658
|
+
|
|
10575
10659
|
// src/v3-client.ts
|
|
10576
10660
|
var ENV_URL_KEYS = ["ATHENA_URL", "NEXT_PUBLIC_ATHENA_URL"];
|
|
10577
10661
|
var ENV_DB_URL_KEYS = ["ATHENA_DB_URL", "ATHENA_GATEWAY_URL", "NEXT_PUBLIC_ATHENA_DB_API_URL"];
|
|
@@ -10580,7 +10664,13 @@ var ENV_CHAT_URL_KEYS = ["ATHENA_CHAT_URL", "NEXT_PUBLIC_ATHENA_CHAT_URL"];
|
|
|
10580
10664
|
var ENV_CHAT_WS_URL_KEYS = ["ATHENA_CHAT_WS_URL", "NEXT_PUBLIC_ATHENA_CHAT_WS_URL"];
|
|
10581
10665
|
var ENV_STORAGE_URL_KEYS = ["ATHENA_STORAGE_URL", "NEXT_PUBLIC_ATHENA_STORAGE_URL"];
|
|
10582
10666
|
var ENV_KEY_KEYS = ["ATHENA_API_KEY", "NEXT_PUBLIC_ATHENA_API_KEY", "ATHENA_GATEWAY_API_KEY", "X_API_KEY"];
|
|
10583
|
-
var ENV_CLIENT_KEYS = [
|
|
10667
|
+
var ENV_CLIENT_KEYS = [
|
|
10668
|
+
"ATHENA_CLIENT",
|
|
10669
|
+
"ATHENA_GATEWAY_CLIENT",
|
|
10670
|
+
"ATHENA_GENERATOR_CLIENT",
|
|
10671
|
+
"NEXT_PUBLIC_ATHENA_CLIENT",
|
|
10672
|
+
"NEXT_PUBLIC_ATHENA_GATEWAY_CLIENT"
|
|
10673
|
+
];
|
|
10584
10674
|
var MISSING_DB_SENTINEL = "https://athena.invalid/db";
|
|
10585
10675
|
function readFirstEnv(env, keys) {
|
|
10586
10676
|
for (const key of keys) {
|
|
@@ -10655,6 +10745,13 @@ function createInternalConfig(core) {
|
|
|
10655
10745
|
const { config, urls } = core;
|
|
10656
10746
|
const { url: _authUrl, ...authOptions } = config.auth ?? {};
|
|
10657
10747
|
const { url: _storageUrl, directUpload, ...storageOptions } = config.storage ?? {};
|
|
10748
|
+
const diagnostics = resolveAthenaClientDiagnostics({
|
|
10749
|
+
diagnostics: config.diagnostics,
|
|
10750
|
+
debugAst: config.debugAst,
|
|
10751
|
+
findManyAst: config.findManyAst,
|
|
10752
|
+
traceQueries: config.traceQueries,
|
|
10753
|
+
env: config.env
|
|
10754
|
+
});
|
|
10658
10755
|
return {
|
|
10659
10756
|
baseUrl: urls.db ?? MISSING_DB_SENTINEL,
|
|
10660
10757
|
apiKey: core.key,
|
|
@@ -10671,9 +10768,9 @@ function createInternalConfig(core) {
|
|
|
10671
10768
|
models: config.models,
|
|
10672
10769
|
behavior: {
|
|
10673
10770
|
retryReads: config.retryReads,
|
|
10674
|
-
traceQueries:
|
|
10675
|
-
debugAst:
|
|
10676
|
-
findManyAst:
|
|
10771
|
+
traceQueries: diagnostics.traceQueries,
|
|
10772
|
+
debugAst: diagnostics.debugAst,
|
|
10773
|
+
findManyAst: diagnostics.findManyAst
|
|
10677
10774
|
},
|
|
10678
10775
|
storage: {
|
|
10679
10776
|
...storageOptions,
|
|
@@ -10747,11 +10844,30 @@ function createClientView(core, viewContext) {
|
|
|
10747
10844
|
return resolved.verifyConnection(options);
|
|
10748
10845
|
},
|
|
10749
10846
|
withContext(context) {
|
|
10847
|
+
warnIfEmptyRequestContext(context);
|
|
10750
10848
|
return createClientView(core, mergeAthenaRequestContexts(viewContext, context));
|
|
10751
10849
|
}
|
|
10752
10850
|
};
|
|
10753
10851
|
return Object.freeze(client);
|
|
10754
10852
|
}
|
|
10853
|
+
function isEmptyAthenaRequestContext(context) {
|
|
10854
|
+
if (!context) return true;
|
|
10855
|
+
const hasHeaders = context.headers != null && Object.keys(context.headers).length > 0;
|
|
10856
|
+
return context.userId == null && context.organizationId == null && !normalizeOptionalContextString(context.cookie) && !normalizeOptionalContextString(context.bearerToken) && !normalizeOptionalContextString(context.sessionToken) && !context.forceNoCache && !hasHeaders;
|
|
10857
|
+
}
|
|
10858
|
+
function normalizeOptionalContextString(value) {
|
|
10859
|
+
const trimmed = value?.trim();
|
|
10860
|
+
return trimmed || void 0;
|
|
10861
|
+
}
|
|
10862
|
+
function warnIfEmptyRequestContext(context) {
|
|
10863
|
+
if (!isEmptyAthenaRequestContext(context)) return;
|
|
10864
|
+
if (typeof process !== "undefined" && process.env?.NODE_ENV === "production") {
|
|
10865
|
+
return;
|
|
10866
|
+
}
|
|
10867
|
+
console.warn(
|
|
10868
|
+
"[athena] withContext({}) has no userId, organizationId, cookie, bearerToken, sessionToken, headers, or forceNoCache. Gateway scope headers will not change. Pass identity fields, or use createAthenaServerClient({ session, scope })."
|
|
10869
|
+
);
|
|
10870
|
+
}
|
|
10755
10871
|
function createClient(config) {
|
|
10756
10872
|
return createClientView(resolveCore(config));
|
|
10757
10873
|
}
|
|
@@ -12107,6 +12223,27 @@ function resolveTotalItemsFromPage({
|
|
|
12107
12223
|
}
|
|
12108
12224
|
return clampAthenaReadQueryTotalItems(exactCount, limit);
|
|
12109
12225
|
}
|
|
12226
|
+
function resolveAthenaReadQueryPageFetch({
|
|
12227
|
+
page,
|
|
12228
|
+
pageSize,
|
|
12229
|
+
limit
|
|
12230
|
+
}) {
|
|
12231
|
+
const safePage = Math.max(1, Math.trunc(page) || 1);
|
|
12232
|
+
const safePageSize = Math.max(1, Math.trunc(pageSize) || 1);
|
|
12233
|
+
if (!limit || limit < 1) {
|
|
12234
|
+
return { page: safePage, pageSize: safePageSize, shouldFetch: true };
|
|
12235
|
+
}
|
|
12236
|
+
const totalCap = Math.trunc(limit);
|
|
12237
|
+
const offset = (safePage - 1) * safePageSize;
|
|
12238
|
+
if (offset >= totalCap) {
|
|
12239
|
+
return { page: safePage, pageSize: safePageSize, shouldFetch: false };
|
|
12240
|
+
}
|
|
12241
|
+
return {
|
|
12242
|
+
page: safePage,
|
|
12243
|
+
pageSize: Math.min(safePageSize, totalCap - offset),
|
|
12244
|
+
shouldFetch: true
|
|
12245
|
+
};
|
|
12246
|
+
}
|
|
12110
12247
|
async function executeAthenaReadQuery({
|
|
12111
12248
|
client,
|
|
12112
12249
|
page,
|
|
@@ -12125,15 +12262,29 @@ async function executeAthenaReadQuery({
|
|
|
12125
12262
|
count: "exact",
|
|
12126
12263
|
head: true
|
|
12127
12264
|
});
|
|
12265
|
+
const pageFetch = resolveAthenaReadQueryPageFetch({
|
|
12266
|
+
limit: query.limit,
|
|
12267
|
+
page,
|
|
12268
|
+
pageSize
|
|
12269
|
+
});
|
|
12270
|
+
if (!pageFetch.shouldFetch) {
|
|
12271
|
+
return {
|
|
12272
|
+
rows: [],
|
|
12273
|
+
totalItems: resolveTotalItemsFromPage({
|
|
12274
|
+
countCandidates: [countResult.count],
|
|
12275
|
+
limit: query.limit,
|
|
12276
|
+
page: pageFetch.page,
|
|
12277
|
+
pageSize,
|
|
12278
|
+
rowCount: 0
|
|
12279
|
+
})
|
|
12280
|
+
};
|
|
12281
|
+
}
|
|
12128
12282
|
if ((query.mode ?? "findMany") === "select") {
|
|
12129
|
-
const selectBuilder =
|
|
12130
|
-
|
|
12131
|
-
|
|
12132
|
-
query.orderBy
|
|
12133
|
-
),
|
|
12134
|
-
query.limit
|
|
12283
|
+
const selectBuilder = applyAthenaReadQuerySelectOrder(
|
|
12284
|
+
applyAthenaReadQueryFilters(baseBuilder, query.filters),
|
|
12285
|
+
query.orderBy
|
|
12135
12286
|
);
|
|
12136
|
-
const result2 = await selectBuilder.currentPage(page).pageSize(pageSize).select(buildAthenaReadQuerySelectString(query.columns), {
|
|
12287
|
+
const result2 = await selectBuilder.currentPage(pageFetch.page).pageSize(pageFetch.pageSize).select(buildAthenaReadQuerySelectString(query.columns), {
|
|
12137
12288
|
count: "exact"
|
|
12138
12289
|
});
|
|
12139
12290
|
const rows2 = flattenAthenaReadQueryRows(
|
|
@@ -12147,7 +12298,7 @@ async function executeAthenaReadQuery({
|
|
|
12147
12298
|
totalItems: resolveTotalItemsFromPage({
|
|
12148
12299
|
countCandidates: [countResult.count, result2.count],
|
|
12149
12300
|
limit: query.limit,
|
|
12150
|
-
page,
|
|
12301
|
+
page: pageFetch.page,
|
|
12151
12302
|
pageSize,
|
|
12152
12303
|
rowCount: rows2.length
|
|
12153
12304
|
})
|
|
@@ -12155,12 +12306,11 @@ async function executeAthenaReadQuery({
|
|
|
12155
12306
|
}
|
|
12156
12307
|
const findManyOrderBy = buildAthenaReadQueryFindManyOrderBy(query.orderBy);
|
|
12157
12308
|
const findManyOptions = {
|
|
12158
|
-
...query.limit ? { limit: query.limit } : {},
|
|
12159
12309
|
...findManyOrderBy ? { orderBy: findManyOrderBy } : {},
|
|
12160
12310
|
select: buildAthenaReadQueryFindManySelect(query.columns),
|
|
12161
12311
|
...query.filters?.length ? { where: buildAthenaReadQueryFindManyWhere(query.filters) } : {}
|
|
12162
12312
|
};
|
|
12163
|
-
const result = await baseBuilder.currentPage(page).pageSize(pageSize).findMany(findManyOptions);
|
|
12313
|
+
const result = await baseBuilder.currentPage(pageFetch.page).pageSize(pageFetch.pageSize).findMany(findManyOptions);
|
|
12164
12314
|
const rows = flattenAthenaReadQueryRows(
|
|
12165
12315
|
Array.isArray(result.data) ? result.data : [],
|
|
12166
12316
|
query.columns,
|
|
@@ -12172,7 +12322,7 @@ async function executeAthenaReadQuery({
|
|
|
12172
12322
|
totalItems: resolveTotalItemsFromPage({
|
|
12173
12323
|
countCandidates: [countResult.count, result.count],
|
|
12174
12324
|
limit: query.limit,
|
|
12175
|
-
page,
|
|
12325
|
+
page: pageFetch.page,
|
|
12176
12326
|
pageSize,
|
|
12177
12327
|
rowCount: rows.length
|
|
12178
12328
|
})
|
|
@@ -12180,6 +12330,432 @@ async function executeAthenaReadQuery({
|
|
|
12180
12330
|
}
|
|
12181
12331
|
var executeAthenaTableQuery = executeAthenaReadQuery;
|
|
12182
12332
|
|
|
12333
|
+
// src/tables/catalog.ts
|
|
12334
|
+
var POSTGRES_CATALOG_SQL = {
|
|
12335
|
+
columns: `
|
|
12336
|
+
SELECT
|
|
12337
|
+
n.nspname AS schema_name,
|
|
12338
|
+
c.relname AS table_name,
|
|
12339
|
+
a.attname AS column_name,
|
|
12340
|
+
format_type(a.atttypid, a.atttypmod) AS data_type,
|
|
12341
|
+
NOT a.attnotnull AS is_nullable
|
|
12342
|
+
FROM pg_attribute a
|
|
12343
|
+
JOIN pg_class c ON c.oid = a.attrelid
|
|
12344
|
+
JOIN pg_namespace n ON n.oid = c.relnamespace
|
|
12345
|
+
WHERE c.relkind IN ('r', 'p')
|
|
12346
|
+
AND a.attnum > 0
|
|
12347
|
+
AND NOT a.attisdropped
|
|
12348
|
+
AND n.nspname = ANY($1::text[])
|
|
12349
|
+
ORDER BY n.nspname, c.relname, a.attnum;
|
|
12350
|
+
`,
|
|
12351
|
+
foreignKeys: `
|
|
12352
|
+
SELECT
|
|
12353
|
+
sn.nspname AS source_schema,
|
|
12354
|
+
sc.relname AS source_table,
|
|
12355
|
+
con.conname AS constraint_name,
|
|
12356
|
+
ARRAY_AGG(sa.attname ORDER BY cols.ordinality) AS source_columns,
|
|
12357
|
+
tn.nspname AS target_schema,
|
|
12358
|
+
tc.relname AS target_table,
|
|
12359
|
+
ARRAY_AGG(ta.attname ORDER BY cols.ordinality) AS target_columns,
|
|
12360
|
+
EXISTS (
|
|
12361
|
+
SELECT 1
|
|
12362
|
+
FROM pg_constraint uq
|
|
12363
|
+
WHERE uq.conrelid = con.conrelid
|
|
12364
|
+
AND uq.contype IN ('p', 'u')
|
|
12365
|
+
AND uq.conkey = con.conkey
|
|
12366
|
+
) AS source_is_unique
|
|
12367
|
+
FROM pg_constraint con
|
|
12368
|
+
JOIN pg_class sc ON sc.oid = con.conrelid
|
|
12369
|
+
JOIN pg_namespace sn ON sn.oid = sc.relnamespace
|
|
12370
|
+
JOIN pg_class tc ON tc.oid = con.confrelid
|
|
12371
|
+
JOIN pg_namespace tn ON tn.oid = tc.relnamespace
|
|
12372
|
+
JOIN unnest(con.conkey, con.confkey) WITH ORDINALITY AS cols(source_attnum, target_attnum, ordinality) ON TRUE
|
|
12373
|
+
JOIN pg_attribute sa ON sa.attrelid = con.conrelid AND sa.attnum = cols.source_attnum
|
|
12374
|
+
JOIN pg_attribute ta ON ta.attrelid = con.confrelid AND ta.attnum = cols.target_attnum
|
|
12375
|
+
WHERE con.contype = 'f'
|
|
12376
|
+
AND sn.nspname = ANY($1::text[])
|
|
12377
|
+
AND tn.nspname = ANY($1::text[])
|
|
12378
|
+
GROUP BY
|
|
12379
|
+
sn.nspname,
|
|
12380
|
+
sc.relname,
|
|
12381
|
+
con.conname,
|
|
12382
|
+
tn.nspname,
|
|
12383
|
+
tc.relname,
|
|
12384
|
+
con.conkey,
|
|
12385
|
+
con.conrelid
|
|
12386
|
+
ORDER BY sn.nspname, sc.relname, con.conname;
|
|
12387
|
+
`,
|
|
12388
|
+
primaryKeys: `
|
|
12389
|
+
SELECT
|
|
12390
|
+
n.nspname AS schema_name,
|
|
12391
|
+
c.relname AS table_name,
|
|
12392
|
+
ARRAY_AGG(a.attname ORDER BY ck.ordinality) AS columns
|
|
12393
|
+
FROM pg_constraint con
|
|
12394
|
+
JOIN pg_class c ON c.oid = con.conrelid
|
|
12395
|
+
JOIN pg_namespace n ON n.oid = c.relnamespace
|
|
12396
|
+
JOIN unnest(con.conkey) WITH ORDINALITY AS ck(attnum, ordinality) ON TRUE
|
|
12397
|
+
JOIN pg_attribute a ON a.attrelid = c.oid AND a.attnum = ck.attnum
|
|
12398
|
+
WHERE con.contype = 'p'
|
|
12399
|
+
AND n.nspname = ANY($1::text[])
|
|
12400
|
+
GROUP BY n.nspname, c.relname
|
|
12401
|
+
ORDER BY n.nspname, c.relname;
|
|
12402
|
+
`
|
|
12403
|
+
};
|
|
12404
|
+
function parseAthenaTableSchemaScope(value) {
|
|
12405
|
+
return value.split(",").map((entry) => entry.trim()).filter(
|
|
12406
|
+
(entry, index, values) => entry.length > 0 && values.indexOf(entry) === index
|
|
12407
|
+
);
|
|
12408
|
+
}
|
|
12409
|
+
function escapeSqlLiteral(value) {
|
|
12410
|
+
return value.replace(/'/g, "''");
|
|
12411
|
+
}
|
|
12412
|
+
function buildSchemaArrayLiteral(schemas) {
|
|
12413
|
+
const literals = schemas.map((schema) => `'${escapeSqlLiteral(schema)}'`).join(", ");
|
|
12414
|
+
return `ARRAY[${literals}]`;
|
|
12415
|
+
}
|
|
12416
|
+
function inlineSchemaLiteral(sql, schemas) {
|
|
12417
|
+
return sql.replace(
|
|
12418
|
+
/\$1::text\[\]/g,
|
|
12419
|
+
`${buildSchemaArrayLiteral(schemas)}::text[]`
|
|
12420
|
+
);
|
|
12421
|
+
}
|
|
12422
|
+
function buildAthenaTableCatalogQueries(schemas) {
|
|
12423
|
+
return {
|
|
12424
|
+
columns: inlineSchemaLiteral(POSTGRES_CATALOG_SQL.columns, schemas),
|
|
12425
|
+
foreignKeys: inlineSchemaLiteral(POSTGRES_CATALOG_SQL.foreignKeys, schemas),
|
|
12426
|
+
primaryKeys: inlineSchemaLiteral(POSTGRES_CATALOG_SQL.primaryKeys, schemas)
|
|
12427
|
+
};
|
|
12428
|
+
}
|
|
12429
|
+
function tableKey(schema, table2) {
|
|
12430
|
+
return `${schema}.${table2}`;
|
|
12431
|
+
}
|
|
12432
|
+
function relationKey(...parts) {
|
|
12433
|
+
const base = parts.join("_").replace(/[^A-Za-z0-9_]+/g, "_").replace(/^_+|_+$/g, "");
|
|
12434
|
+
return base.length > 0 ? base : "relation";
|
|
12435
|
+
}
|
|
12436
|
+
function parsePostgresArrayLiteral(text) {
|
|
12437
|
+
const body = text.slice(1, -1).trim();
|
|
12438
|
+
if (!body) {
|
|
12439
|
+
return [];
|
|
12440
|
+
}
|
|
12441
|
+
const values = [];
|
|
12442
|
+
let current = "";
|
|
12443
|
+
let inQuotes = false;
|
|
12444
|
+
let escaped = false;
|
|
12445
|
+
for (const char of body) {
|
|
12446
|
+
if (escaped) {
|
|
12447
|
+
current += char;
|
|
12448
|
+
escaped = false;
|
|
12449
|
+
continue;
|
|
12450
|
+
}
|
|
12451
|
+
if (char === "\\") {
|
|
12452
|
+
escaped = true;
|
|
12453
|
+
continue;
|
|
12454
|
+
}
|
|
12455
|
+
if (char === '"') {
|
|
12456
|
+
inQuotes = !inQuotes;
|
|
12457
|
+
continue;
|
|
12458
|
+
}
|
|
12459
|
+
if (char === "," && !inQuotes) {
|
|
12460
|
+
values.push(current);
|
|
12461
|
+
current = "";
|
|
12462
|
+
continue;
|
|
12463
|
+
}
|
|
12464
|
+
current += char;
|
|
12465
|
+
}
|
|
12466
|
+
values.push(current);
|
|
12467
|
+
return values.map((value) => value.trim()).filter((value) => value.length > 0);
|
|
12468
|
+
}
|
|
12469
|
+
function coerceStringArray(value) {
|
|
12470
|
+
if (value == null) {
|
|
12471
|
+
return [];
|
|
12472
|
+
}
|
|
12473
|
+
if (Array.isArray(value)) {
|
|
12474
|
+
return value.map((entry) => entry.trim()).filter(Boolean);
|
|
12475
|
+
}
|
|
12476
|
+
if (typeof value !== "string") {
|
|
12477
|
+
return [];
|
|
12478
|
+
}
|
|
12479
|
+
const trimmedValue = value.trim();
|
|
12480
|
+
if (!trimmedValue) {
|
|
12481
|
+
return [];
|
|
12482
|
+
}
|
|
12483
|
+
if (trimmedValue.startsWith("{") && trimmedValue.endsWith("}")) {
|
|
12484
|
+
return parsePostgresArrayLiteral(trimmedValue);
|
|
12485
|
+
}
|
|
12486
|
+
return trimmedValue.split(",").map((entry) => entry.trim()).filter(Boolean);
|
|
12487
|
+
}
|
|
12488
|
+
function createTableCatalog() {
|
|
12489
|
+
const tables = /* @__PURE__ */ new Map();
|
|
12490
|
+
const ensureTable = (schema, name) => {
|
|
12491
|
+
const id = tableKey(schema, name);
|
|
12492
|
+
const existingTable = tables.get(id);
|
|
12493
|
+
if (existingTable) {
|
|
12494
|
+
return existingTable;
|
|
12495
|
+
}
|
|
12496
|
+
const nextTable = {
|
|
12497
|
+
columns: [],
|
|
12498
|
+
id,
|
|
12499
|
+
name,
|
|
12500
|
+
primaryKey: [],
|
|
12501
|
+
relationMap: /* @__PURE__ */ new Map(),
|
|
12502
|
+
schema
|
|
12503
|
+
};
|
|
12504
|
+
tables.set(id, nextTable);
|
|
12505
|
+
return nextTable;
|
|
12506
|
+
};
|
|
12507
|
+
const upsertRelation = (table2, key, relation) => {
|
|
12508
|
+
table2.relationMap.set(key, relation);
|
|
12509
|
+
};
|
|
12510
|
+
return {
|
|
12511
|
+
addColumnRows(columnRows) {
|
|
12512
|
+
for (const row of columnRows) {
|
|
12513
|
+
const table2 = ensureTable(row.schema_name, row.table_name);
|
|
12514
|
+
table2.columns.push({
|
|
12515
|
+
dataType: row.data_type,
|
|
12516
|
+
isNullable: row.is_nullable,
|
|
12517
|
+
isPrimaryKey: false,
|
|
12518
|
+
name: row.column_name
|
|
12519
|
+
});
|
|
12520
|
+
}
|
|
12521
|
+
},
|
|
12522
|
+
addForeignKeyRows(foreignKeyRows) {
|
|
12523
|
+
for (const row of foreignKeyRows) {
|
|
12524
|
+
const sourceTable = ensureTable(row.source_schema, row.source_table);
|
|
12525
|
+
const targetTable = ensureTable(row.target_schema, row.target_table);
|
|
12526
|
+
upsertRelation(
|
|
12527
|
+
sourceTable,
|
|
12528
|
+
relationKey(row.constraint_name, row.target_table),
|
|
12529
|
+
{
|
|
12530
|
+
name: row.constraint_name,
|
|
12531
|
+
targetSchema: row.target_schema,
|
|
12532
|
+
targetTable: row.target_table
|
|
12533
|
+
}
|
|
12534
|
+
);
|
|
12535
|
+
upsertRelation(targetTable, relationKey(row.source_table), {
|
|
12536
|
+
name: relationKey(row.source_table, row.constraint_name),
|
|
12537
|
+
targetSchema: row.source_schema,
|
|
12538
|
+
targetTable: row.source_table
|
|
12539
|
+
});
|
|
12540
|
+
}
|
|
12541
|
+
},
|
|
12542
|
+
addManyToManyRows(foreignKeyRows) {
|
|
12543
|
+
const foreignKeysBySourceTable = /* @__PURE__ */ new Map();
|
|
12544
|
+
for (const foreignKey of foreignKeyRows) {
|
|
12545
|
+
const key = tableKey(foreignKey.source_schema, foreignKey.source_table);
|
|
12546
|
+
const current = foreignKeysBySourceTable.get(key) ?? {
|
|
12547
|
+
foreignKeys: [],
|
|
12548
|
+
schema: foreignKey.source_schema,
|
|
12549
|
+
table: foreignKey.source_table
|
|
12550
|
+
};
|
|
12551
|
+
current.foreignKeys.push(foreignKey);
|
|
12552
|
+
foreignKeysBySourceTable.set(key, current);
|
|
12553
|
+
}
|
|
12554
|
+
for (const candidate of foreignKeysBySourceTable.values()) {
|
|
12555
|
+
const bridgeTable = tables.get(
|
|
12556
|
+
tableKey(candidate.schema, candidate.table)
|
|
12557
|
+
);
|
|
12558
|
+
if (!bridgeTable || candidate.foreignKeys.length !== 2) {
|
|
12559
|
+
continue;
|
|
12560
|
+
}
|
|
12561
|
+
const combinedForeignColumns = Array.from(
|
|
12562
|
+
new Set(
|
|
12563
|
+
candidate.foreignKeys.flatMap(
|
|
12564
|
+
(foreignKey) => coerceStringArray(foreignKey.source_columns)
|
|
12565
|
+
)
|
|
12566
|
+
)
|
|
12567
|
+
);
|
|
12568
|
+
if (bridgeTable.primaryKey.length === 0 || combinedForeignColumns.length !== bridgeTable.primaryKey.length || !bridgeTable.primaryKey.every(
|
|
12569
|
+
(column) => combinedForeignColumns.includes(column)
|
|
12570
|
+
)) {
|
|
12571
|
+
continue;
|
|
12572
|
+
}
|
|
12573
|
+
const [firstForeignKey, secondForeignKey] = candidate.foreignKeys;
|
|
12574
|
+
const firstTarget = tables.get(
|
|
12575
|
+
tableKey(firstForeignKey.target_schema, firstForeignKey.target_table)
|
|
12576
|
+
);
|
|
12577
|
+
const secondTarget = tables.get(
|
|
12578
|
+
tableKey(
|
|
12579
|
+
secondForeignKey.target_schema,
|
|
12580
|
+
secondForeignKey.target_table
|
|
12581
|
+
)
|
|
12582
|
+
);
|
|
12583
|
+
if (!(firstTarget && secondTarget)) {
|
|
12584
|
+
continue;
|
|
12585
|
+
}
|
|
12586
|
+
upsertRelation(
|
|
12587
|
+
firstTarget,
|
|
12588
|
+
relationKey(candidate.table, secondForeignKey.target_table),
|
|
12589
|
+
{
|
|
12590
|
+
name: relationKey(
|
|
12591
|
+
candidate.table,
|
|
12592
|
+
secondForeignKey.constraint_name
|
|
12593
|
+
),
|
|
12594
|
+
targetSchema: secondForeignKey.target_schema,
|
|
12595
|
+
targetTable: secondForeignKey.target_table
|
|
12596
|
+
}
|
|
12597
|
+
);
|
|
12598
|
+
upsertRelation(
|
|
12599
|
+
secondTarget,
|
|
12600
|
+
relationKey(candidate.table, firstForeignKey.target_table),
|
|
12601
|
+
{
|
|
12602
|
+
name: relationKey(candidate.table, firstForeignKey.constraint_name),
|
|
12603
|
+
targetSchema: firstForeignKey.target_schema,
|
|
12604
|
+
targetTable: firstForeignKey.target_table
|
|
12605
|
+
}
|
|
12606
|
+
);
|
|
12607
|
+
}
|
|
12608
|
+
},
|
|
12609
|
+
addPrimaryKeyRows(primaryKeyRows) {
|
|
12610
|
+
for (const row of primaryKeyRows) {
|
|
12611
|
+
const table2 = ensureTable(row.schema_name, row.table_name);
|
|
12612
|
+
const primaryKey = coerceStringArray(row.columns);
|
|
12613
|
+
table2.primaryKey = primaryKey;
|
|
12614
|
+
for (const columnName of primaryKey) {
|
|
12615
|
+
const column = table2.columns.find(
|
|
12616
|
+
(candidate) => candidate.name === columnName
|
|
12617
|
+
);
|
|
12618
|
+
if (column) {
|
|
12619
|
+
column.isPrimaryKey = true;
|
|
12620
|
+
}
|
|
12621
|
+
}
|
|
12622
|
+
}
|
|
12623
|
+
},
|
|
12624
|
+
toResponse(database) {
|
|
12625
|
+
return {
|
|
12626
|
+
database,
|
|
12627
|
+
generatedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
12628
|
+
tables: [...tables.values()].map((table2) => ({
|
|
12629
|
+
columns: [...table2.columns].sort(
|
|
12630
|
+
(left, right) => left.name.localeCompare(right.name)
|
|
12631
|
+
),
|
|
12632
|
+
id: table2.id,
|
|
12633
|
+
name: table2.name,
|
|
12634
|
+
primaryKey: [...table2.primaryKey],
|
|
12635
|
+
relations: [...table2.relationMap.values()].map((relation) => ({
|
|
12636
|
+
columns: tables.get(
|
|
12637
|
+
tableKey(relation.targetSchema, relation.targetTable)
|
|
12638
|
+
)?.columns ?? [],
|
|
12639
|
+
name: relation.name,
|
|
12640
|
+
targetSchema: relation.targetSchema,
|
|
12641
|
+
targetTable: relation.targetTable
|
|
12642
|
+
})).sort(
|
|
12643
|
+
(left, right) => left.name.localeCompare(right.name)
|
|
12644
|
+
),
|
|
12645
|
+
schema: table2.schema
|
|
12646
|
+
})).sort(
|
|
12647
|
+
(left, right) => left.id.localeCompare(right.id)
|
|
12648
|
+
)
|
|
12649
|
+
};
|
|
12650
|
+
}
|
|
12651
|
+
};
|
|
12652
|
+
}
|
|
12653
|
+
async function queryRows(client, query) {
|
|
12654
|
+
const result = await client.query(query);
|
|
12655
|
+
if (result.error || result.status < 200 || result.status >= 300) {
|
|
12656
|
+
const errorMessage = typeof result.error === "string" ? result.error : result.error && typeof result.error === "object" && "message" in result.error && typeof result.error.message === "string" ? result.error.message : `Athena gateway query failed with status ${result.status}.`;
|
|
12657
|
+
throw new Error(errorMessage);
|
|
12658
|
+
}
|
|
12659
|
+
return Array.isArray(result.data) ? result.data : [];
|
|
12660
|
+
}
|
|
12661
|
+
function isAthenaTableSchemaConfig(value) {
|
|
12662
|
+
if (typeof value !== "object" || value === null) {
|
|
12663
|
+
return false;
|
|
12664
|
+
}
|
|
12665
|
+
const config = value;
|
|
12666
|
+
return typeof config.gatewayUrl === "string" && typeof config.gatewayKey === "string" && typeof config.gatewayDatabase === "string" && typeof config.schemaScope === "string" && typeof config.clientName === "string";
|
|
12667
|
+
}
|
|
12668
|
+
function hasAthenaTableSchemaCredentials(config) {
|
|
12669
|
+
return config.gatewayUrl.trim().length > 0 && config.gatewayKey.trim().length > 0 && config.gatewayDatabase.trim().length > 0;
|
|
12670
|
+
}
|
|
12671
|
+
async function fetchAthenaTableCatalog(config, options = {}) {
|
|
12672
|
+
const schemas = parseAthenaTableSchemaScope(config.schemaScope);
|
|
12673
|
+
if (schemas.length === 0) {
|
|
12674
|
+
return {
|
|
12675
|
+
database: config.gatewayDatabase,
|
|
12676
|
+
generatedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
12677
|
+
tables: []
|
|
12678
|
+
};
|
|
12679
|
+
}
|
|
12680
|
+
const queries = buildAthenaTableCatalogQueries(schemas);
|
|
12681
|
+
const client = options.client ?? createClient({
|
|
12682
|
+
url: config.gatewayUrl.trim(),
|
|
12683
|
+
key: config.gatewayKey.trim(),
|
|
12684
|
+
client: config.clientName.trim() || void 0
|
|
12685
|
+
});
|
|
12686
|
+
const [columnRows, primaryKeyRows, foreignKeyRows] = await Promise.all([
|
|
12687
|
+
queryRows(client, queries.columns),
|
|
12688
|
+
queryRows(client, queries.primaryKeys),
|
|
12689
|
+
queryRows(client, queries.foreignKeys)
|
|
12690
|
+
]);
|
|
12691
|
+
const catalog = createTableCatalog();
|
|
12692
|
+
catalog.addColumnRows(columnRows);
|
|
12693
|
+
catalog.addPrimaryKeyRows(primaryKeyRows);
|
|
12694
|
+
catalog.addForeignKeyRows(foreignKeyRows);
|
|
12695
|
+
catalog.addManyToManyRows(foreignKeyRows);
|
|
12696
|
+
return catalog.toResponse(config.gatewayDatabase);
|
|
12697
|
+
}
|
|
12698
|
+
var fetchTableCatalog = fetchAthenaTableCatalog;
|
|
12699
|
+
|
|
12700
|
+
// src/tables/schema-handlers.ts
|
|
12701
|
+
var ATHENA_TABLE_SCHEMA_ROUTE = "/api/tables/schema";
|
|
12702
|
+
function json2(body, init) {
|
|
12703
|
+
const headers = new Headers(init?.headers);
|
|
12704
|
+
if (!headers.has("content-type")) {
|
|
12705
|
+
headers.set("content-type", "application/json; charset=utf-8");
|
|
12706
|
+
}
|
|
12707
|
+
return new Response(JSON.stringify(body), {
|
|
12708
|
+
status: init?.status ?? 200,
|
|
12709
|
+
headers
|
|
12710
|
+
});
|
|
12711
|
+
}
|
|
12712
|
+
async function handleAthenaTableSchemaPost(request2, options) {
|
|
12713
|
+
const payload = await request2.json().catch(() => null);
|
|
12714
|
+
let config = isAthenaTableSchemaConfig(
|
|
12715
|
+
payload?.config
|
|
12716
|
+
) ? payload.config : null;
|
|
12717
|
+
if (config && options?.resolveConfig) {
|
|
12718
|
+
config = await options.resolveConfig(config, request2);
|
|
12719
|
+
}
|
|
12720
|
+
if (!config || !isAthenaTableSchemaConfig(config)) {
|
|
12721
|
+
return json2(
|
|
12722
|
+
{
|
|
12723
|
+
error: "The Athena tables showcase config is invalid."
|
|
12724
|
+
},
|
|
12725
|
+
{ status: 400 }
|
|
12726
|
+
);
|
|
12727
|
+
}
|
|
12728
|
+
if (!hasAthenaTableSchemaCredentials(config)) {
|
|
12729
|
+
return json2(
|
|
12730
|
+
{
|
|
12731
|
+
error: "Gateway URL, API key, and database are required for schema introspection."
|
|
12732
|
+
},
|
|
12733
|
+
{ status: 400 }
|
|
12734
|
+
);
|
|
12735
|
+
}
|
|
12736
|
+
try {
|
|
12737
|
+
const response = await fetchAthenaTableCatalog(
|
|
12738
|
+
config,
|
|
12739
|
+
{
|
|
12740
|
+
client: options?.client
|
|
12741
|
+
}
|
|
12742
|
+
);
|
|
12743
|
+
return json2(response);
|
|
12744
|
+
} catch (error) {
|
|
12745
|
+
return json2(
|
|
12746
|
+
{
|
|
12747
|
+
error: error instanceof Error ? error.message : "Athena schema introspection failed."
|
|
12748
|
+
},
|
|
12749
|
+
{ status: 500 }
|
|
12750
|
+
);
|
|
12751
|
+
}
|
|
12752
|
+
}
|
|
12753
|
+
function createAthenaTableSchemaHandlers(options) {
|
|
12754
|
+
return {
|
|
12755
|
+
POST: (request2) => handleAthenaTableSchemaPost(request2, options)
|
|
12756
|
+
};
|
|
12757
|
+
}
|
|
12758
|
+
|
|
12183
12759
|
// src/browser.ts
|
|
12184
12760
|
function throwBrowserUnsupported(apiName) {
|
|
12185
12761
|
throw new Error(
|
|
@@ -12211,6 +12787,6 @@ async function runSchemaGenerator(options = {}) {
|
|
|
12211
12787
|
return throwBrowserUnsupported("runSchemaGenerator");
|
|
12212
12788
|
}
|
|
12213
12789
|
|
|
12214
|
-
export { ATHENA_AUTH_ADMIN_LIMITS, ATHENA_AUTH_BASE_ERROR_CODES, ATHENA_AUTH_MAX_ADMIN_JSON_BYTES, ATHENA_AUTH_MAX_ADMIN_JSON_DEPTH, ATHENA_AUTH_MAX_TEMPLATE_VARIABLES, ATHENA_AUTH_MAX_TEMPLATE_VARIABLE_LENGTH, AthenaBillingError, AthenaChatError, AthenaConfigurationError, AthenaError, AthenaErrorCategory, AthenaErrorCode, AthenaErrorKind, AthenaGatewayError, AthenaStorageError, AthenaStorageErrorCode, Backend, DEFAULT_POSTGRES_SCHEMAS, applyAthenaReadQueryFilters, applyAthenaReadQuerySelectLimit, applyAthenaReadQuerySelectOrder, applyAthenaTableFilters, applyAthenaTableSelectLimit, applyAthenaTableSelectOrder, assertInt, athenaAuth, billingSdkManifest, boolean, buildAthenaReadQueryFindManyOrderBy, buildAthenaReadQueryFindManySelect, buildAthenaReadQueryFindManyWhere, buildAthenaReadQuerySelectString, buildAthenaTableFindManyOrderBy, buildAthenaTableFindManySelect, buildAthenaTableFindManyWhere, buildAthenaTableSelectString, chatSdkManifest, clampAthenaReadQueryTotalItems, clampAthenaTableTotalItems, coerceInt, createAthenaStorageError, createAuthReactEmailInput, createBillingModule, createClient, createModelFormAdapter, createPostgresIntrospectionProvider, defineAthenaAuthConfig, defineAuthEmailTemplate, defineDatabase, defineGeneratorConfig, defineModel, defineRegistry, defineSchema, enumeration, executeAthenaReadQuery, executeAthenaTableQuery, filterIntrospectionSnapshot, findGeneratorConfigPath, flattenAthenaReadQueryRows, flattenAthenaRows, generateArtifactsFromSnapshot, generatorEnv, getAthenaDebugAst, identifier, isAthenaGatewayError, isOk, json, loadGeneratorConfig, normalizeAthenaError, normalizeAthenaGatewayBaseUrl, normalizeAthenaReadQueryOrderBy, normalizeAthenaTableOrderBy, normalizeGeneratorConfig, normalizeSchemaSelection, normalizeTableSelection, number, parseBooleanFlag2 as parseBooleanFlag, renderAthenaReactEmail, requireAffected, requireSuccess, resolveGeneratorProvider, resolvePostgresColumnType, resolveProviderSchemas, runSchemaGenerator, storageSdkManifest, string, table, toModelFormDefaults, toModelPayload, unwrap, unwrapChatMessage, unwrapChatRoom, unwrapOne, unwrapRows, verifyAthenaGatewayUrl, withRetry };
|
|
12790
|
+
export { ATHENA_AUTH_ADMIN_LIMITS, ATHENA_AUTH_BASE_ERROR_CODES, ATHENA_AUTH_MAX_ADMIN_JSON_BYTES, ATHENA_AUTH_MAX_ADMIN_JSON_DEPTH, ATHENA_AUTH_MAX_TEMPLATE_VARIABLES, ATHENA_AUTH_MAX_TEMPLATE_VARIABLE_LENGTH, ATHENA_TABLE_SCHEMA_ROUTE, AthenaBillingError, AthenaChatError, AthenaConfigurationError, AthenaError, AthenaErrorCategory, AthenaErrorCode, AthenaErrorKind, AthenaGatewayError, AthenaStorageError, AthenaStorageErrorCode, Backend, DEFAULT_POSTGRES_SCHEMAS, applyAthenaReadQueryFilters, applyAthenaReadQuerySelectLimit, applyAthenaReadQuerySelectOrder, applyAthenaTableFilters, applyAthenaTableSelectLimit, applyAthenaTableSelectOrder, assertInt, athenaAuth, billingSdkManifest, boolean, buildAthenaReadQueryFindManyOrderBy, buildAthenaReadQueryFindManySelect, buildAthenaReadQueryFindManyWhere, buildAthenaReadQuerySelectString, buildAthenaTableCatalogQueries, buildAthenaTableFindManyOrderBy, buildAthenaTableFindManySelect, buildAthenaTableFindManyWhere, buildAthenaTableSelectString, chatSdkManifest, clampAthenaReadQueryTotalItems, clampAthenaTableTotalItems, coerceInt, createAthenaStorageError, createAthenaTableSchemaHandlers, createAuthReactEmailInput, createBillingModule, createClient, createModelFormAdapter, createPostgresIntrospectionProvider, defineAthenaAuthConfig, defineAuthEmailTemplate, defineDatabase, defineGeneratorConfig, defineModel, defineRegistry, defineSchema, enumeration, executeAthenaReadQuery, executeAthenaTableQuery, fetchAthenaTableCatalog, fetchTableCatalog, filterIntrospectionSnapshot, findGeneratorConfigPath, flattenAthenaReadQueryRows, flattenAthenaRows, generateArtifactsFromSnapshot, generatorEnv, getAthenaDebugAst, handleAthenaTableSchemaPost, hasAthenaTableSchemaCredentials, identifier, isAthenaGatewayError, isAthenaTableSchemaConfig, isOk, json, loadGeneratorConfig, normalizeAthenaError, normalizeAthenaGatewayBaseUrl, normalizeAthenaReadQueryOrderBy, normalizeAthenaTableOrderBy, normalizeGeneratorConfig, normalizeSchemaSelection, normalizeTableSelection, number, parseAthenaTableSchemaScope, parseBooleanFlag2 as parseBooleanFlag, renderAthenaReactEmail, requireAffected, requireSuccess, resolveAthenaReadQueryPageFetch, resolveGeneratorProvider, resolvePostgresColumnType, resolveProviderSchemas, runSchemaGenerator, storageSdkManifest, string, table, toModelFormDefaults, toModelPayload, unwrap, unwrapChatMessage, unwrapChatRoom, unwrapOne, unwrapRows, verifyAthenaGatewayUrl, withRetry };
|
|
12215
12791
|
//# sourceMappingURL=browser.js.map
|
|
12216
12792
|
//# sourceMappingURL=browser.js.map
|