@xylex-group/athena 2.8.0 → 2.9.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 +165 -68
- package/dist/browser.cjs +1331 -70
- 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 +1325 -71
- package/dist/browser.js.map +1 -1
- package/dist/cli/index.cjs +1354 -117
- 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 +1354 -117
- package/dist/cli/index.js.map +1 -1
- package/dist/{model-form-DMed05gE.d.cts → client-CfAE_QOj.d.cts} +741 -132
- package/dist/{model-form-DXPlOnlI.d.ts → client-D6EIJdQS.d.ts} +741 -132
- package/dist/index.cjs +1391 -71
- 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 +1385 -72
- 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/next/client.cjs +7875 -0
- package/dist/next/client.cjs.map +1 -0
- package/dist/next/client.d.cts +25 -0
- package/dist/next/client.d.ts +25 -0
- package/dist/next/client.js +7873 -0
- package/dist/next/client.js.map +1 -0
- package/dist/next/server.cjs +7993 -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 +7990 -0
- package/dist/next/server.js.map +1 -0
- package/dist/{pipeline-D4sJRKqN.d.cts → pipeline-CmUZsXsi.d.cts} +1 -1
- package/dist/{pipeline-CkMnhwPI.d.ts → pipeline-DZMsPxUg.d.ts} +1 -1
- package/dist/{react-email-DZhDDlEl.d.cts → react-email-BvJ3fj_F.d.cts} +35 -7
- package/dist/{react-email-Lrz9A-BW.d.ts → react-email-PLAJuZuO.d.ts} +35 -7
- package/dist/react.cjs +30 -1
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +39 -10
- package/dist/react.d.ts +39 -10
- package/dist/react.js +30 -2
- package/dist/react.js.map +1 -1
- package/dist/shared-BW6hoLBY.d.cts +33 -0
- package/dist/shared-BiJvoURI.d.ts +33 -0
- package/dist/{types-vikz9YIO.d.cts → types-BeZIHduP.d.cts} +5 -1
- package/dist/{types-vikz9YIO.d.ts → types-BeZIHduP.d.ts} +5 -1
- package/dist/{types-CAtTGGoz.d.cts → types-C-YvfgYh.d.cts} +27 -2
- package/dist/{types-BzY6fETM.d.ts → types-CRjDwmtJ.d.ts} +27 -2
- package/package.json +37 -49
package/dist/react.d.cts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { O as AthenaGatewayHookConfig, P as AthenaGatewayHookResult } from './types-
|
|
2
|
-
export { Q as AthenaDeletePayload, V as AthenaFetchPayload, a as AthenaGatewayCallOptions, d as AthenaGatewayErrorCode, e as AthenaGatewayErrorDetails, W as AthenaGatewayResponse, X as AthenaInsertPayload, f as AthenaJsonArray, g as AthenaJsonObject, h as AthenaJsonPrimitive, i as AthenaJsonValue, k as AthenaRpcCallOptions, l as AthenaRpcFilter, m as AthenaRpcFilterOperator, n as AthenaRpcOrder, o as AthenaRpcPayload, Y as AthenaUpdatePayload } from './types-
|
|
3
|
-
|
|
4
|
-
export { as as AthenaGatewayError, bz as ModelFormAdapter, bA as ModelFormDefaults, bB as ModelFormNullishMode, bC as ModelFormValues, bV as ToModelFormDefaultsOptions, bW as ToModelPayloadOptions, c3 as createModelFormAdapter, c5 as isAthenaGatewayError, cc as toModelFormDefaults, cd as toModelPayload } from './model-form-DMed05gE.cjs';
|
|
1
|
+
import { O as AthenaGatewayHookConfig, P as AthenaGatewayHookResult } from './types-BeZIHduP.cjs';
|
|
2
|
+
export { Q as AthenaDeletePayload, V as AthenaFetchPayload, a as AthenaGatewayCallOptions, d as AthenaGatewayErrorCode, e as AthenaGatewayErrorDetails, W as AthenaGatewayResponse, X as AthenaInsertPayload, f as AthenaJsonArray, g as AthenaJsonObject, h as AthenaJsonPrimitive, i as AthenaJsonValue, k as AthenaRpcCallOptions, l as AthenaRpcFilter, m as AthenaRpcFilterOperator, n as AthenaRpcOrder, o as AthenaRpcPayload, Y as AthenaUpdatePayload } from './types-BeZIHduP.cjs';
|
|
3
|
+
export { A as AthenaGatewayError, M as ModelFormAdapter, a as ModelFormDefaults, b as ModelFormNullishMode, c as ModelFormValues, T as ToModelFormDefaultsOptions, d as ToModelPayloadOptions, e as createModelFormAdapter, i as isAthenaGatewayError, t as toModelFormDefaults, f as toModelPayload } from './model-form-DACdBLYG.cjs';
|
|
5
4
|
import * as react from 'react';
|
|
6
5
|
import { ReactNode } from 'react';
|
|
6
|
+
import { dR as AthenaAuthFetchCompatibleInput, C as AthenaAuthCallOptions, ag as AthenaAuthSessionResponse, N as AthenaAuthErrorDetails, ab as AthenaAuthResult, ay as AthenaClientSessionLike, az as AthenaClientSessionOptions, bL as AthenaStorageFileUploadInput, c3 as AthenaStorageUploadSource, bR as AthenaStorageModule, c2 as AthenaStorageUploadProgressHandler, c1 as AthenaStorageUploadProgress, bO as AthenaStorageFileUploadResult, bv as AthenaStorageCallOptions } from './client-CfAE_QOj.cjs';
|
|
7
7
|
|
|
8
8
|
declare function useAthenaGateway(config?: AthenaGatewayHookConfig): AthenaGatewayHookResult;
|
|
9
9
|
|
|
@@ -249,15 +249,15 @@ interface UseSessionResult<TSessionData extends AthenaAuthSessionResponse = Athe
|
|
|
249
249
|
isRefetching: boolean;
|
|
250
250
|
refetch: () => Promise<TSessionData | null>;
|
|
251
251
|
}
|
|
252
|
-
type SessionGetter<TSessionData extends AthenaAuthSessionResponse> = (input?: AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<TSessionData>>;
|
|
252
|
+
type SessionGetter$1<TSessionData extends AthenaAuthSessionResponse> = (input?: AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<TSessionData>>;
|
|
253
253
|
type UseSessionAuthClient<TSessionData extends AthenaAuthSessionResponse = AthenaAuthSessionResponse> = {
|
|
254
|
-
getSession: SessionGetter<TSessionData>;
|
|
254
|
+
getSession: SessionGetter$1<TSessionData>;
|
|
255
255
|
} | {
|
|
256
256
|
auth: {
|
|
257
|
-
getSession: SessionGetter<TSessionData>;
|
|
257
|
+
getSession: SessionGetter$1<TSessionData>;
|
|
258
258
|
};
|
|
259
259
|
};
|
|
260
|
-
type InferSessionData<TClient> = TClient extends {
|
|
260
|
+
type InferSessionData$1<TClient> = TClient extends {
|
|
261
261
|
getSession: (...args: unknown[]) => Promise<AthenaAuthResult<infer TSessionData>>;
|
|
262
262
|
} ? TSessionData extends AthenaAuthSessionResponse ? TSessionData : AthenaAuthSessionResponse : TClient extends {
|
|
263
263
|
auth: {
|
|
@@ -267,7 +267,36 @@ type InferSessionData<TClient> = TClient extends {
|
|
|
267
267
|
/**
|
|
268
268
|
* Better Auth style session hook parity for Athena auth clients.
|
|
269
269
|
*/
|
|
270
|
-
declare function useSession<TClient extends UseSessionAuthClient>(authClient: TClient, options?: UseSessionOptions): UseSessionResult<InferSessionData<TClient>>;
|
|
270
|
+
declare function useSession<TClient extends UseSessionAuthClient>(authClient: TClient, options?: UseSessionOptions): UseSessionResult<InferSessionData$1<TClient>>;
|
|
271
|
+
|
|
272
|
+
type SessionGetter<TSessionData extends AthenaAuthSessionResponse> = (input?: AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<TSessionData>>;
|
|
273
|
+
type AthenaSessionScopedClient<TSessionData extends AthenaAuthSessionResponse = AthenaAuthSessionResponse> = {
|
|
274
|
+
auth: {
|
|
275
|
+
getSession: SessionGetter<TSessionData>;
|
|
276
|
+
};
|
|
277
|
+
withSession(session?: AthenaClientSessionLike | null, options?: AthenaClientSessionOptions): unknown;
|
|
278
|
+
};
|
|
279
|
+
type InferSessionData<TClient> = TClient extends {
|
|
280
|
+
auth: {
|
|
281
|
+
getSession: (...args: unknown[]) => Promise<AthenaAuthResult<infer TSessionData>>;
|
|
282
|
+
};
|
|
283
|
+
} ? TSessionData extends AthenaAuthSessionResponse ? TSessionData : AthenaAuthSessionResponse : AthenaAuthSessionResponse;
|
|
284
|
+
type InferScopedClient<TClient> = TClient extends {
|
|
285
|
+
withSession(session?: AthenaClientSessionLike | null, options?: AthenaClientSessionOptions): infer TScopedClient;
|
|
286
|
+
} ? TScopedClient : TClient;
|
|
287
|
+
interface UseAthenaSessionClientOptions extends UseSessionOptions {
|
|
288
|
+
}
|
|
289
|
+
interface UseAthenaSessionClientResult<TClient> {
|
|
290
|
+
client: InferScopedClient<TClient>;
|
|
291
|
+
session: UseSessionResult<InferSessionData<TClient>>['data'];
|
|
292
|
+
userId: string | null;
|
|
293
|
+
organizationId: string | null;
|
|
294
|
+
error: AthenaAuthErrorDetails | null;
|
|
295
|
+
isPending: boolean;
|
|
296
|
+
isRefetching: boolean;
|
|
297
|
+
refetch: UseSessionResult<InferSessionData<TClient>>['refetch'];
|
|
298
|
+
}
|
|
299
|
+
declare function useAthenaSessionClient<TClient extends AthenaSessionScopedClient>(baseClient: TClient, options?: UseAthenaSessionClientOptions): UseAthenaSessionClientResult<TClient>;
|
|
271
300
|
|
|
272
301
|
type UseStorageUploadInput = AthenaStorageFileUploadInput | AthenaStorageUploadSource | readonly AthenaStorageUploadSource[] | ArrayLike<AthenaStorageUploadSource>;
|
|
273
302
|
interface UseStorageUploadOptions extends Omit<Partial<AthenaStorageFileUploadInput>, 'files' | 'onProgress'> {
|
|
@@ -286,4 +315,4 @@ interface UseStorageUploadResult {
|
|
|
286
315
|
}
|
|
287
316
|
declare function useStorageUpload(options: UseStorageUploadOptions): UseStorageUploadResult;
|
|
288
317
|
|
|
289
|
-
export { type AthenaCacheMode, type AthenaCachePolicy, AthenaGatewayHookConfig, AthenaGatewayHookResult, type AthenaMutationDefaults, type AthenaMutationEvent, type AthenaMutationRequestLog, type AthenaMutationResultData, type AthenaMutationState, AthenaQueryClient, type AthenaQueryClientConfig, AthenaQueryClientProvider, type AthenaQueryDefaults, type AthenaQueryError, type AthenaQueryEvent, type AthenaQueryRequestLog, type AthenaQueryResult, type AthenaQueryState, type AthenaResponseLike, type AthenaRetryCount, type AthenaRetryDelay, type AthenaRuntimeBaseEvent, type AthenaRuntimeEvent, type AthenaRuntimeEventType, type AthenaStateAdapter, type AthenaUnsubscribe, type QueryKey, type QueryStatus, type UseMutationOptions, type UseMutationResult, type UseQueryOptions, type UseQueryResult, type UseSessionOptions, type UseSessionResult, type UseStorageUploadInput, type UseStorageUploadOptions, type UseStorageUploadResult, attachStateAdapter, createAthenaQueryClient, useAthenaGateway, useAthenaQueryClient, useMutation, useQuery, useSession, useStorageUpload };
|
|
318
|
+
export { type AthenaCacheMode, type AthenaCachePolicy, AthenaGatewayHookConfig, AthenaGatewayHookResult, type AthenaMutationDefaults, type AthenaMutationEvent, type AthenaMutationRequestLog, type AthenaMutationResultData, type AthenaMutationState, AthenaQueryClient, type AthenaQueryClientConfig, AthenaQueryClientProvider, type AthenaQueryDefaults, type AthenaQueryError, type AthenaQueryEvent, type AthenaQueryRequestLog, type AthenaQueryResult, type AthenaQueryState, type AthenaResponseLike, type AthenaRetryCount, type AthenaRetryDelay, type AthenaRuntimeBaseEvent, type AthenaRuntimeEvent, type AthenaRuntimeEventType, type AthenaStateAdapter, type AthenaUnsubscribe, type QueryKey, type QueryStatus, type UseAthenaSessionClientOptions, type UseAthenaSessionClientResult, type UseMutationOptions, type UseMutationResult, type UseQueryOptions, type UseQueryResult, type UseSessionOptions, type UseSessionResult, type UseStorageUploadInput, type UseStorageUploadOptions, type UseStorageUploadResult, attachStateAdapter, createAthenaQueryClient, useAthenaGateway, useAthenaQueryClient, useAthenaSessionClient, useMutation, useQuery, useSession, useStorageUpload };
|
package/dist/react.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { O as AthenaGatewayHookConfig, P as AthenaGatewayHookResult } from './types-
|
|
2
|
-
export { Q as AthenaDeletePayload, V as AthenaFetchPayload, a as AthenaGatewayCallOptions, d as AthenaGatewayErrorCode, e as AthenaGatewayErrorDetails, W as AthenaGatewayResponse, X as AthenaInsertPayload, f as AthenaJsonArray, g as AthenaJsonObject, h as AthenaJsonPrimitive, i as AthenaJsonValue, k as AthenaRpcCallOptions, l as AthenaRpcFilter, m as AthenaRpcFilterOperator, n as AthenaRpcOrder, o as AthenaRpcPayload, Y as AthenaUpdatePayload } from './types-
|
|
3
|
-
|
|
4
|
-
export { as as AthenaGatewayError, bz as ModelFormAdapter, bA as ModelFormDefaults, bB as ModelFormNullishMode, bC as ModelFormValues, bV as ToModelFormDefaultsOptions, bW as ToModelPayloadOptions, c3 as createModelFormAdapter, c5 as isAthenaGatewayError, cc as toModelFormDefaults, cd as toModelPayload } from './model-form-DXPlOnlI.js';
|
|
1
|
+
import { O as AthenaGatewayHookConfig, P as AthenaGatewayHookResult } from './types-BeZIHduP.js';
|
|
2
|
+
export { Q as AthenaDeletePayload, V as AthenaFetchPayload, a as AthenaGatewayCallOptions, d as AthenaGatewayErrorCode, e as AthenaGatewayErrorDetails, W as AthenaGatewayResponse, X as AthenaInsertPayload, f as AthenaJsonArray, g as AthenaJsonObject, h as AthenaJsonPrimitive, i as AthenaJsonValue, k as AthenaRpcCallOptions, l as AthenaRpcFilter, m as AthenaRpcFilterOperator, n as AthenaRpcOrder, o as AthenaRpcPayload, Y as AthenaUpdatePayload } from './types-BeZIHduP.js';
|
|
3
|
+
export { A as AthenaGatewayError, M as ModelFormAdapter, a as ModelFormDefaults, b as ModelFormNullishMode, c as ModelFormValues, T as ToModelFormDefaultsOptions, d as ToModelPayloadOptions, e as createModelFormAdapter, i as isAthenaGatewayError, t as toModelFormDefaults, f as toModelPayload } from './model-form-ByvyyvxB.js';
|
|
5
4
|
import * as react from 'react';
|
|
6
5
|
import { ReactNode } from 'react';
|
|
6
|
+
import { dR as AthenaAuthFetchCompatibleInput, C as AthenaAuthCallOptions, ag as AthenaAuthSessionResponse, N as AthenaAuthErrorDetails, ab as AthenaAuthResult, ay as AthenaClientSessionLike, az as AthenaClientSessionOptions, bL as AthenaStorageFileUploadInput, c3 as AthenaStorageUploadSource, bR as AthenaStorageModule, c2 as AthenaStorageUploadProgressHandler, c1 as AthenaStorageUploadProgress, bO as AthenaStorageFileUploadResult, bv as AthenaStorageCallOptions } from './client-D6EIJdQS.js';
|
|
7
7
|
|
|
8
8
|
declare function useAthenaGateway(config?: AthenaGatewayHookConfig): AthenaGatewayHookResult;
|
|
9
9
|
|
|
@@ -249,15 +249,15 @@ interface UseSessionResult<TSessionData extends AthenaAuthSessionResponse = Athe
|
|
|
249
249
|
isRefetching: boolean;
|
|
250
250
|
refetch: () => Promise<TSessionData | null>;
|
|
251
251
|
}
|
|
252
|
-
type SessionGetter<TSessionData extends AthenaAuthSessionResponse> = (input?: AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<TSessionData>>;
|
|
252
|
+
type SessionGetter$1<TSessionData extends AthenaAuthSessionResponse> = (input?: AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<TSessionData>>;
|
|
253
253
|
type UseSessionAuthClient<TSessionData extends AthenaAuthSessionResponse = AthenaAuthSessionResponse> = {
|
|
254
|
-
getSession: SessionGetter<TSessionData>;
|
|
254
|
+
getSession: SessionGetter$1<TSessionData>;
|
|
255
255
|
} | {
|
|
256
256
|
auth: {
|
|
257
|
-
getSession: SessionGetter<TSessionData>;
|
|
257
|
+
getSession: SessionGetter$1<TSessionData>;
|
|
258
258
|
};
|
|
259
259
|
};
|
|
260
|
-
type InferSessionData<TClient> = TClient extends {
|
|
260
|
+
type InferSessionData$1<TClient> = TClient extends {
|
|
261
261
|
getSession: (...args: unknown[]) => Promise<AthenaAuthResult<infer TSessionData>>;
|
|
262
262
|
} ? TSessionData extends AthenaAuthSessionResponse ? TSessionData : AthenaAuthSessionResponse : TClient extends {
|
|
263
263
|
auth: {
|
|
@@ -267,7 +267,36 @@ type InferSessionData<TClient> = TClient extends {
|
|
|
267
267
|
/**
|
|
268
268
|
* Better Auth style session hook parity for Athena auth clients.
|
|
269
269
|
*/
|
|
270
|
-
declare function useSession<TClient extends UseSessionAuthClient>(authClient: TClient, options?: UseSessionOptions): UseSessionResult<InferSessionData<TClient>>;
|
|
270
|
+
declare function useSession<TClient extends UseSessionAuthClient>(authClient: TClient, options?: UseSessionOptions): UseSessionResult<InferSessionData$1<TClient>>;
|
|
271
|
+
|
|
272
|
+
type SessionGetter<TSessionData extends AthenaAuthSessionResponse> = (input?: AthenaAuthFetchCompatibleInput, options?: AthenaAuthCallOptions) => Promise<AthenaAuthResult<TSessionData>>;
|
|
273
|
+
type AthenaSessionScopedClient<TSessionData extends AthenaAuthSessionResponse = AthenaAuthSessionResponse> = {
|
|
274
|
+
auth: {
|
|
275
|
+
getSession: SessionGetter<TSessionData>;
|
|
276
|
+
};
|
|
277
|
+
withSession(session?: AthenaClientSessionLike | null, options?: AthenaClientSessionOptions): unknown;
|
|
278
|
+
};
|
|
279
|
+
type InferSessionData<TClient> = TClient extends {
|
|
280
|
+
auth: {
|
|
281
|
+
getSession: (...args: unknown[]) => Promise<AthenaAuthResult<infer TSessionData>>;
|
|
282
|
+
};
|
|
283
|
+
} ? TSessionData extends AthenaAuthSessionResponse ? TSessionData : AthenaAuthSessionResponse : AthenaAuthSessionResponse;
|
|
284
|
+
type InferScopedClient<TClient> = TClient extends {
|
|
285
|
+
withSession(session?: AthenaClientSessionLike | null, options?: AthenaClientSessionOptions): infer TScopedClient;
|
|
286
|
+
} ? TScopedClient : TClient;
|
|
287
|
+
interface UseAthenaSessionClientOptions extends UseSessionOptions {
|
|
288
|
+
}
|
|
289
|
+
interface UseAthenaSessionClientResult<TClient> {
|
|
290
|
+
client: InferScopedClient<TClient>;
|
|
291
|
+
session: UseSessionResult<InferSessionData<TClient>>['data'];
|
|
292
|
+
userId: string | null;
|
|
293
|
+
organizationId: string | null;
|
|
294
|
+
error: AthenaAuthErrorDetails | null;
|
|
295
|
+
isPending: boolean;
|
|
296
|
+
isRefetching: boolean;
|
|
297
|
+
refetch: UseSessionResult<InferSessionData<TClient>>['refetch'];
|
|
298
|
+
}
|
|
299
|
+
declare function useAthenaSessionClient<TClient extends AthenaSessionScopedClient>(baseClient: TClient, options?: UseAthenaSessionClientOptions): UseAthenaSessionClientResult<TClient>;
|
|
271
300
|
|
|
272
301
|
type UseStorageUploadInput = AthenaStorageFileUploadInput | AthenaStorageUploadSource | readonly AthenaStorageUploadSource[] | ArrayLike<AthenaStorageUploadSource>;
|
|
273
302
|
interface UseStorageUploadOptions extends Omit<Partial<AthenaStorageFileUploadInput>, 'files' | 'onProgress'> {
|
|
@@ -286,4 +315,4 @@ interface UseStorageUploadResult {
|
|
|
286
315
|
}
|
|
287
316
|
declare function useStorageUpload(options: UseStorageUploadOptions): UseStorageUploadResult;
|
|
288
317
|
|
|
289
|
-
export { type AthenaCacheMode, type AthenaCachePolicy, AthenaGatewayHookConfig, AthenaGatewayHookResult, type AthenaMutationDefaults, type AthenaMutationEvent, type AthenaMutationRequestLog, type AthenaMutationResultData, type AthenaMutationState, AthenaQueryClient, type AthenaQueryClientConfig, AthenaQueryClientProvider, type AthenaQueryDefaults, type AthenaQueryError, type AthenaQueryEvent, type AthenaQueryRequestLog, type AthenaQueryResult, type AthenaQueryState, type AthenaResponseLike, type AthenaRetryCount, type AthenaRetryDelay, type AthenaRuntimeBaseEvent, type AthenaRuntimeEvent, type AthenaRuntimeEventType, type AthenaStateAdapter, type AthenaUnsubscribe, type QueryKey, type QueryStatus, type UseMutationOptions, type UseMutationResult, type UseQueryOptions, type UseQueryResult, type UseSessionOptions, type UseSessionResult, type UseStorageUploadInput, type UseStorageUploadOptions, type UseStorageUploadResult, attachStateAdapter, createAthenaQueryClient, useAthenaGateway, useAthenaQueryClient, useMutation, useQuery, useSession, useStorageUpload };
|
|
318
|
+
export { type AthenaCacheMode, type AthenaCachePolicy, AthenaGatewayHookConfig, AthenaGatewayHookResult, type AthenaMutationDefaults, type AthenaMutationEvent, type AthenaMutationRequestLog, type AthenaMutationResultData, type AthenaMutationState, AthenaQueryClient, type AthenaQueryClientConfig, AthenaQueryClientProvider, type AthenaQueryDefaults, type AthenaQueryError, type AthenaQueryEvent, type AthenaQueryRequestLog, type AthenaQueryResult, type AthenaQueryState, type AthenaResponseLike, type AthenaRetryCount, type AthenaRetryDelay, type AthenaRuntimeBaseEvent, type AthenaRuntimeEvent, type AthenaRuntimeEventType, type AthenaStateAdapter, type AthenaUnsubscribe, type QueryKey, type QueryStatus, type UseAthenaSessionClientOptions, type UseAthenaSessionClientResult, type UseMutationOptions, type UseMutationResult, type UseQueryOptions, type UseQueryResult, type UseSessionOptions, type UseSessionResult, type UseStorageUploadInput, type UseStorageUploadOptions, type UseStorageUploadResult, attachStateAdapter, createAthenaQueryClient, useAthenaGateway, useAthenaQueryClient, useAthenaSessionClient, useMutation, useQuery, useSession, useStorageUpload };
|
package/dist/react.js
CHANGED
|
@@ -166,7 +166,7 @@ var getSessionCookie = (request, config) => {
|
|
|
166
166
|
|
|
167
167
|
// package.json
|
|
168
168
|
var package_default = {
|
|
169
|
-
version: "2.
|
|
169
|
+
version: "2.9.0"
|
|
170
170
|
};
|
|
171
171
|
|
|
172
172
|
// src/sdk-version.ts
|
|
@@ -179,6 +179,7 @@ function buildSdkHeaderValue(sdkName) {
|
|
|
179
179
|
var DEFAULT_CLIENT = "railway_direct";
|
|
180
180
|
var SDK_NAME = "xylex-group/athena";
|
|
181
181
|
var SDK_HEADER_VALUE = buildSdkHeaderValue(SDK_NAME);
|
|
182
|
+
var NO_CACHE_HEADER_VALUE = "no-cache";
|
|
182
183
|
function parseResponseBody(rawText, contentType) {
|
|
183
184
|
if (!rawText) {
|
|
184
185
|
return { parsed: null, parseFailed: false };
|
|
@@ -197,6 +198,9 @@ function parseResponseBody(rawText, contentType) {
|
|
|
197
198
|
function normalizeHeaderValue(value) {
|
|
198
199
|
return value ? value : void 0;
|
|
199
200
|
}
|
|
201
|
+
function isCacheControlHeaderName(name) {
|
|
202
|
+
return name.toLowerCase() === "cache-control";
|
|
203
|
+
}
|
|
200
204
|
function resolveHeaderValue(headers, candidates) {
|
|
201
205
|
for (const candidate of candidates) {
|
|
202
206
|
const direct = normalizeHeaderValue(headers[candidate]);
|
|
@@ -355,6 +359,7 @@ function buildRpcGetEndpoint(payload) {
|
|
|
355
359
|
}
|
|
356
360
|
function buildHeaders(config, options) {
|
|
357
361
|
const mergedStripNulls = options?.stripNulls ?? true;
|
|
362
|
+
const forceNoCache = Boolean(config.forceNoCache || options?.forceNoCache);
|
|
358
363
|
const extraHeaders = {
|
|
359
364
|
...config.headers ?? {},
|
|
360
365
|
...options?.headers ?? {}
|
|
@@ -408,11 +413,15 @@ function buildHeaders(config, options) {
|
|
|
408
413
|
const athenaClientKeys = ["x-athena-client", "X-Athena-Client"];
|
|
409
414
|
Object.entries(extraHeaders).forEach(([key, value]) => {
|
|
410
415
|
if (athenaClientKeys.includes(key)) return;
|
|
416
|
+
if (forceNoCache && isCacheControlHeaderName(key)) return;
|
|
411
417
|
const normalized = normalizeHeaderValue(value);
|
|
412
418
|
if (normalized) {
|
|
413
419
|
headers[key] = normalized;
|
|
414
420
|
}
|
|
415
421
|
});
|
|
422
|
+
if (forceNoCache) {
|
|
423
|
+
headers["Cache-Control"] = NO_CACHE_HEADER_VALUE;
|
|
424
|
+
}
|
|
416
425
|
return headers;
|
|
417
426
|
}
|
|
418
427
|
function toInvalidUrlResponse(error, endpoint, method) {
|
|
@@ -1929,6 +1938,25 @@ function useSession(authClient, options = {}) {
|
|
|
1929
1938
|
refetch
|
|
1930
1939
|
};
|
|
1931
1940
|
}
|
|
1941
|
+
function useAthenaSessionClient(baseClient, options = {}) {
|
|
1942
|
+
const sessionState = useSession(baseClient, options);
|
|
1943
|
+
const scopedClient = useMemo(
|
|
1944
|
+
() => sessionState.data ? baseClient.withSession(sessionState.data) : baseClient,
|
|
1945
|
+
[baseClient, sessionState.data]
|
|
1946
|
+
);
|
|
1947
|
+
const session = sessionState.data;
|
|
1948
|
+
const refetch = sessionState.refetch;
|
|
1949
|
+
return {
|
|
1950
|
+
client: scopedClient,
|
|
1951
|
+
session,
|
|
1952
|
+
userId: sessionState.data?.user.id ?? null,
|
|
1953
|
+
organizationId: sessionState.data?.session.activeOrganizationId ?? null,
|
|
1954
|
+
error: sessionState.error,
|
|
1955
|
+
isPending: sessionState.isPending,
|
|
1956
|
+
isRefetching: sessionState.isRefetching,
|
|
1957
|
+
refetch
|
|
1958
|
+
};
|
|
1959
|
+
}
|
|
1932
1960
|
function useStorageUpload(options) {
|
|
1933
1961
|
const {
|
|
1934
1962
|
storage,
|
|
@@ -2070,6 +2098,6 @@ function createModelFormAdapter(model) {
|
|
|
2070
2098
|
};
|
|
2071
2099
|
}
|
|
2072
2100
|
|
|
2073
|
-
export { AthenaGatewayError, AthenaQueryClient, AthenaQueryClientProvider, attachStateAdapter, createAthenaQueryClient, createModelFormAdapter, isAthenaGatewayError, toModelFormDefaults, toModelPayload, useAthenaGateway, useAthenaQueryClient, useMutation, useQuery, useSession, useStorageUpload };
|
|
2101
|
+
export { AthenaGatewayError, AthenaQueryClient, AthenaQueryClientProvider, attachStateAdapter, createAthenaQueryClient, createModelFormAdapter, isAthenaGatewayError, toModelFormDefaults, toModelPayload, useAthenaGateway, useAthenaQueryClient, useAthenaSessionClient, useMutation, useQuery, useSession, useStorageUpload };
|
|
2074
2102
|
//# sourceMappingURL=react.js.map
|
|
2075
2103
|
//# sourceMappingURL=react.js.map
|