@xylex-group/athena 2.8.2 → 2.10.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 +154 -64
- package/dist/browser.cjs +1550 -181
- 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 +1540 -182
- package/dist/browser.js.map +1 -1
- package/dist/cli/index.cjs +1337 -67
- package/dist/cli/index.cjs.map +1 -1
- package/dist/cli/index.d.cts +3 -3
- package/dist/cli/index.d.ts +3 -3
- package/dist/cli/index.js +1337 -67
- package/dist/cli/index.js.map +1 -1
- package/dist/{model-form-Cx3wtvi8.d.ts → client-B7EQ_hPV.d.cts} +606 -118
- package/dist/{model-form-_ugfOXao.d.cts → client-BYii6dU9.d.ts} +606 -118
- package/dist/index.cjs +1540 -113
- 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 +1530 -114
- package/dist/index.js.map +1 -1
- package/dist/model-form-ByvyyvxB.d.ts +96 -0
- package/dist/model-form-DACdBLYG.d.cts +96 -0
- package/dist/{react-email-CiiSVa9F.d.cts → module-DC96HJa3.d.cts} +130 -5
- package/dist/{react-email-WN8UU3AL.d.ts → module-DbHlxpeR.d.ts} +130 -5
- package/dist/next/client.cjs +8591 -0
- package/dist/next/client.cjs.map +1 -0
- package/dist/next/client.d.cts +24 -0
- package/dist/next/client.d.ts +24 -0
- package/dist/next/client.js +8589 -0
- package/dist/next/client.js.map +1 -0
- package/dist/next/server.cjs +8709 -0
- package/dist/next/server.cjs.map +1 -0
- package/dist/next/server.d.cts +52 -0
- package/dist/next/server.d.ts +52 -0
- package/dist/next/server.js +8706 -0
- package/dist/next/server.js.map +1 -0
- package/dist/{pipeline-BtD-Uo5X.d.cts → pipeline-CmUZsXsi.d.cts} +1 -1
- package/dist/{pipeline-yCIZNJHE.d.ts → pipeline-DZMsPxUg.d.ts} +1 -1
- package/dist/react.cjs +30 -1
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +38 -10
- package/dist/react.d.ts +38 -10
- package/dist/react.js +30 -2
- package/dist/react.js.map +1 -1
- package/dist/shared-BMVGMnti.d.cts +35 -0
- package/dist/shared-DRptGBWP.d.ts +35 -0
- package/dist/{types-g8G6J0xE.d.cts → types-BeZIHduP.d.cts} +2 -1
- package/dist/{types-g8G6J0xE.d.ts → types-BeZIHduP.d.ts} +2 -1
- package/dist/{types-C2kiTt6-.d.ts → types-C-YvfgYh.d.cts} +26 -2
- package/dist/{types-89EfjLjV.d.cts → types-CRjDwmtJ.d.ts} +26 -2
- package/package.json +32 -14
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { R as RunGeneratorOptions,
|
|
1
|
+
import { R as RunGeneratorOptions, s as RunGeneratorResult } from './types-C-YvfgYh.cjs';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* End-to-end generator execution: load config, introspect, render, and optionally write files.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { R as RunGeneratorOptions,
|
|
1
|
+
import { R as RunGeneratorOptions, s as RunGeneratorResult } from './types-CRjDwmtJ.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* End-to-end generator execution: load config, introspect, render, and optionally write files.
|
package/dist/react.cjs
CHANGED
|
@@ -187,7 +187,7 @@ var getSessionCookie = (request, config) => {
|
|
|
187
187
|
|
|
188
188
|
// package.json
|
|
189
189
|
var package_default = {
|
|
190
|
-
version: "2.
|
|
190
|
+
version: "2.10.0"
|
|
191
191
|
};
|
|
192
192
|
|
|
193
193
|
// src/sdk-version.ts
|
|
@@ -200,6 +200,7 @@ function buildSdkHeaderValue(sdkName) {
|
|
|
200
200
|
var DEFAULT_CLIENT = "railway_direct";
|
|
201
201
|
var SDK_NAME = "xylex-group/athena";
|
|
202
202
|
var SDK_HEADER_VALUE = buildSdkHeaderValue(SDK_NAME);
|
|
203
|
+
var NO_CACHE_HEADER_VALUE = "no-cache";
|
|
203
204
|
function parseResponseBody(rawText, contentType) {
|
|
204
205
|
if (!rawText) {
|
|
205
206
|
return { parsed: null, parseFailed: false };
|
|
@@ -218,6 +219,9 @@ function parseResponseBody(rawText, contentType) {
|
|
|
218
219
|
function normalizeHeaderValue(value) {
|
|
219
220
|
return value ? value : void 0;
|
|
220
221
|
}
|
|
222
|
+
function isCacheControlHeaderName(name) {
|
|
223
|
+
return name.toLowerCase() === "cache-control";
|
|
224
|
+
}
|
|
221
225
|
function resolveHeaderValue(headers, candidates) {
|
|
222
226
|
for (const candidate of candidates) {
|
|
223
227
|
const direct = normalizeHeaderValue(headers[candidate]);
|
|
@@ -376,6 +380,7 @@ function buildRpcGetEndpoint(payload) {
|
|
|
376
380
|
}
|
|
377
381
|
function buildHeaders(config, options) {
|
|
378
382
|
const mergedStripNulls = options?.stripNulls ?? true;
|
|
383
|
+
const forceNoCache = Boolean(config.forceNoCache || options?.forceNoCache);
|
|
379
384
|
const extraHeaders = {
|
|
380
385
|
...config.headers ?? {},
|
|
381
386
|
...options?.headers ?? {}
|
|
@@ -429,11 +434,15 @@ function buildHeaders(config, options) {
|
|
|
429
434
|
const athenaClientKeys = ["x-athena-client", "X-Athena-Client"];
|
|
430
435
|
Object.entries(extraHeaders).forEach(([key, value]) => {
|
|
431
436
|
if (athenaClientKeys.includes(key)) return;
|
|
437
|
+
if (forceNoCache && isCacheControlHeaderName(key)) return;
|
|
432
438
|
const normalized = normalizeHeaderValue(value);
|
|
433
439
|
if (normalized) {
|
|
434
440
|
headers[key] = normalized;
|
|
435
441
|
}
|
|
436
442
|
});
|
|
443
|
+
if (forceNoCache) {
|
|
444
|
+
headers["Cache-Control"] = NO_CACHE_HEADER_VALUE;
|
|
445
|
+
}
|
|
437
446
|
return headers;
|
|
438
447
|
}
|
|
439
448
|
function toInvalidUrlResponse(error, endpoint, method) {
|
|
@@ -1950,6 +1959,25 @@ function useSession(authClient, options = {}) {
|
|
|
1950
1959
|
refetch
|
|
1951
1960
|
};
|
|
1952
1961
|
}
|
|
1962
|
+
function useAthenaSessionClient(baseClient, options = {}) {
|
|
1963
|
+
const sessionState = useSession(baseClient, options);
|
|
1964
|
+
const scopedClient = React.useMemo(
|
|
1965
|
+
() => sessionState.data ? baseClient.withSession(sessionState.data) : baseClient,
|
|
1966
|
+
[baseClient, sessionState.data]
|
|
1967
|
+
);
|
|
1968
|
+
const session = sessionState.data;
|
|
1969
|
+
const refetch = sessionState.refetch;
|
|
1970
|
+
return {
|
|
1971
|
+
client: scopedClient,
|
|
1972
|
+
session,
|
|
1973
|
+
userId: sessionState.data?.user.id ?? null,
|
|
1974
|
+
organizationId: sessionState.data?.session.activeOrganizationId ?? null,
|
|
1975
|
+
error: sessionState.error,
|
|
1976
|
+
isPending: sessionState.isPending,
|
|
1977
|
+
isRefetching: sessionState.isRefetching,
|
|
1978
|
+
refetch
|
|
1979
|
+
};
|
|
1980
|
+
}
|
|
1953
1981
|
function useStorageUpload(options) {
|
|
1954
1982
|
const {
|
|
1955
1983
|
storage,
|
|
@@ -2102,6 +2130,7 @@ exports.toModelFormDefaults = toModelFormDefaults;
|
|
|
2102
2130
|
exports.toModelPayload = toModelPayload;
|
|
2103
2131
|
exports.useAthenaGateway = useAthenaGateway;
|
|
2104
2132
|
exports.useAthenaQueryClient = useAthenaQueryClient;
|
|
2133
|
+
exports.useAthenaSessionClient = useAthenaSessionClient;
|
|
2105
2134
|
exports.useMutation = useMutation;
|
|
2106
2135
|
exports.useQuery = useQuery;
|
|
2107
2136
|
exports.useSession = useSession;
|