@xylex-group/athena 2.14.0 → 3.0.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 +91 -1398
- package/dist/admin.d.cts +1 -1
- package/dist/admin.d.ts +1 -1
- package/dist/billing.cjs +1199 -0
- package/dist/billing.cjs.map +1 -0
- package/dist/billing.d.cts +230 -0
- package/dist/billing.d.ts +230 -0
- package/dist/billing.js +1194 -0
- package/dist/billing.js.map +1 -0
- package/dist/browser.cjs +8892 -8533
- package/dist/browser.cjs.map +1 -1
- package/dist/browser.d.cts +11 -10
- package/dist/browser.d.ts +11 -10
- package/dist/browser.js +8889 -8531
- package/dist/browser.js.map +1 -1
- package/dist/cli/index.cjs +8294 -7528
- package/dist/cli/index.cjs.map +1 -1
- package/dist/cli/index.d.cts +4 -4
- package/dist/cli/index.d.ts +4 -4
- package/dist/cli/index.js +8294 -7528
- package/dist/cli/index.js.map +1 -1
- package/dist/index.cjs +8869 -8504
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +11 -10
- package/dist/index.d.ts +11 -10
- package/dist/index.js +8862 -8502
- package/dist/index.js.map +1 -1
- package/dist/{model-form-BE1_Bmdd.d.cts → model-form-BEfCGB5b.d.cts} +2 -2
- package/dist/{model-form-DcH3R7WD.d.ts → model-form-BKetpu6Q.d.ts} +2 -2
- package/dist/module-8dSMcy0K.d.cts +326 -0
- package/dist/module-8dSMcy0K.d.ts +326 -0
- package/dist/{module-Ca3_OQqR.d.ts → module-Bef_MAPO.d.ts} +6 -52
- package/dist/{module-DFGZXCtt.d.cts → module-CrrSmpML.d.cts} +6 -52
- package/dist/next/client.cjs +2 -9168
- package/dist/next/client.cjs.map +1 -1
- package/dist/next/client.d.cts +1 -27
- package/dist/next/client.d.ts +1 -27
- package/dist/next/client.js +3 -9168
- package/dist/next/client.js.map +1 -1
- package/dist/next/server.cjs +79 -9279
- package/dist/next/server.cjs.map +1 -1
- package/dist/next/server.d.cts +30 -46
- package/dist/next/server.d.ts +30 -46
- package/dist/next/server.js +79 -9279
- package/dist/next/server.js.map +1 -1
- package/dist/{payload-BbSCmILD.d.ts → payload-DWI1rw-e.d.cts} +1 -35
- package/dist/{payload-zXIwKTQf.d.cts → payload-DWI1rw-e.d.ts} +1 -35
- package/dist/{pipeline-DqwehoQV.d.ts → pipeline-BXFQbsUW.d.ts} +1 -1
- package/dist/{pipeline-CwQoD5G9.d.cts → pipeline-Dfsed4VD.d.cts} +1 -1
- package/dist/react.cjs +114 -13
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +46 -16
- package/dist/react.d.ts +46 -16
- package/dist/react.js +113 -14
- package/dist/react.js.map +1 -1
- package/dist/social-providers.cjs +9 -9
- package/dist/social-providers.cjs.map +1 -1
- package/dist/social-providers.d.cts +79 -82
- package/dist/social-providers.d.ts +79 -82
- package/dist/social-providers.js +9 -9
- package/dist/social-providers.js.map +1 -1
- package/dist/{types-eAKAh71s.d.cts → types-AOY-GLu8.d.cts} +27 -54
- package/dist/{types-eAKAh71s.d.ts → types-AOY-GLu8.d.ts} +27 -54
- package/dist/{types-YQUR7wu0.d.cts → types-Bltx6iL6.d.cts} +3 -5
- package/dist/{types-YQUR7wu0.d.ts → types-Bltx6iL6.d.ts} +3 -5
- package/dist/{types-C1swabT5.d.ts → types-CK7cBQbC.d.ts} +2 -2
- package/dist/{types-dHnjluBC.d.cts → types-Z3-rsiM3.d.cts} +2 -2
- package/dist/{types-CD6K05JQ.d.ts → types-jClgDy1J.d.ts} +2 -2
- package/dist/{types-6H575ITc.d.cts → types-kO_Ut5wU.d.cts} +2 -2
- package/dist/utils.cjs +7 -8
- package/dist/utils.cjs.map +1 -1
- package/dist/utils.d.cts +2 -5
- package/dist/utils.d.ts +2 -5
- package/dist/utils.js +7 -8
- package/dist/utils.js.map +1 -1
- package/dist/{client-uthENhaf.d.ts → v3-client-CuCNy-JJ.d.ts} +380 -515
- package/dist/{client-wU2J9yqb.d.cts → v3-client-G8JMOilK.d.cts} +380 -515
- package/package.json +10 -1
|
@@ -1,37 +1,3 @@
|
|
|
1
|
-
import { an as AthenaCreateClientAuthOptions, af as AthenaClientExperimentalOptions, aI as AthenaHeaderBag } from './client-uthENhaf.js';
|
|
2
|
-
import { o as BackendConfig, p as BackendType } from './types-YQUR7wu0.js';
|
|
3
|
-
|
|
4
|
-
interface AthenaRequestCookiesBag {
|
|
5
|
-
getAll(): Array<{
|
|
6
|
-
name: string;
|
|
7
|
-
value: string;
|
|
8
|
-
}>;
|
|
9
|
-
}
|
|
10
|
-
type AthenaRequestHeadersInput = AthenaHeaderBag | Record<string, string | null | undefined>;
|
|
11
|
-
type AthenaRequestCookiesInput = AthenaRequestCookiesBag | string | null | undefined;
|
|
12
|
-
type AthenaAdapterExperimentalOptions = Omit<AthenaClientExperimentalOptions, 'athenaStorageBackend'>;
|
|
13
|
-
interface AthenaAdapterBaseOptions {
|
|
14
|
-
env?: Record<string, string | undefined>;
|
|
15
|
-
url?: string | null | undefined;
|
|
16
|
-
gatewayUrl?: string | null | undefined;
|
|
17
|
-
authUrl?: string | null | undefined;
|
|
18
|
-
chatUrl?: string | null | undefined;
|
|
19
|
-
chatWsUrl?: string | null | undefined;
|
|
20
|
-
storageUrl?: string | null | undefined;
|
|
21
|
-
key?: string | null | undefined;
|
|
22
|
-
client?: string | null | undefined;
|
|
23
|
-
backend?: BackendConfig | BackendType;
|
|
24
|
-
headers?: Record<string, string>;
|
|
25
|
-
auth?: AthenaCreateClientAuthOptions;
|
|
26
|
-
forceNoCache?: boolean;
|
|
27
|
-
storage?: boolean;
|
|
28
|
-
experimental?: AthenaAdapterExperimentalOptions;
|
|
29
|
-
}
|
|
30
|
-
interface AthenaServerRequestOptions {
|
|
31
|
-
requestHeaders?: AthenaRequestHeadersInput;
|
|
32
|
-
requestCookies?: AthenaRequestCookiesInput;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
1
|
/**
|
|
36
2
|
* Default App Router path for the Athena Auth session cookie bridge.
|
|
37
3
|
*
|
|
@@ -216,4 +182,4 @@ declare function clearAthenaAuthSessionOnAppHost(options?: AthenaAuthSessionBrid
|
|
|
216
182
|
*/
|
|
217
183
|
declare function resolveSessionBridgePayload(payload: AthenaAuthSessionBridgeSource | null | undefined): AthenaAuthSessionBridgePayload | null;
|
|
218
184
|
|
|
219
|
-
export {
|
|
185
|
+
export { ATHENA_AUTH_SESSION_BRIDGE_ROUTE as A, ATHENA_AUTH_SESSION_COOKIE_NAME as a, ATHENA_AUTH_SESSION_COOKIE_NAMES as b, type AthenaAuthSessionBridgeClientOptions as c, type AthenaAuthSessionBridgePayload as d, type AthenaAuthSessionBridgeSource as e, clearAthenaAuthSessionOnAppHost as f, type AthenaAuthSessionBridgeOptions as g, type AthenaAuthSessionBridgePathOptions as h, persistAthenaAuthSessionOnAppHost as p, resolveSessionBridgePayload as r };
|
|
@@ -1,37 +1,3 @@
|
|
|
1
|
-
import { an as AthenaCreateClientAuthOptions, af as AthenaClientExperimentalOptions, aI as AthenaHeaderBag } from './client-wU2J9yqb.cjs';
|
|
2
|
-
import { o as BackendConfig, p as BackendType } from './types-YQUR7wu0.cjs';
|
|
3
|
-
|
|
4
|
-
interface AthenaRequestCookiesBag {
|
|
5
|
-
getAll(): Array<{
|
|
6
|
-
name: string;
|
|
7
|
-
value: string;
|
|
8
|
-
}>;
|
|
9
|
-
}
|
|
10
|
-
type AthenaRequestHeadersInput = AthenaHeaderBag | Record<string, string | null | undefined>;
|
|
11
|
-
type AthenaRequestCookiesInput = AthenaRequestCookiesBag | string | null | undefined;
|
|
12
|
-
type AthenaAdapterExperimentalOptions = Omit<AthenaClientExperimentalOptions, 'athenaStorageBackend'>;
|
|
13
|
-
interface AthenaAdapterBaseOptions {
|
|
14
|
-
env?: Record<string, string | undefined>;
|
|
15
|
-
url?: string | null | undefined;
|
|
16
|
-
gatewayUrl?: string | null | undefined;
|
|
17
|
-
authUrl?: string | null | undefined;
|
|
18
|
-
chatUrl?: string | null | undefined;
|
|
19
|
-
chatWsUrl?: string | null | undefined;
|
|
20
|
-
storageUrl?: string | null | undefined;
|
|
21
|
-
key?: string | null | undefined;
|
|
22
|
-
client?: string | null | undefined;
|
|
23
|
-
backend?: BackendConfig | BackendType;
|
|
24
|
-
headers?: Record<string, string>;
|
|
25
|
-
auth?: AthenaCreateClientAuthOptions;
|
|
26
|
-
forceNoCache?: boolean;
|
|
27
|
-
storage?: boolean;
|
|
28
|
-
experimental?: AthenaAdapterExperimentalOptions;
|
|
29
|
-
}
|
|
30
|
-
interface AthenaServerRequestOptions {
|
|
31
|
-
requestHeaders?: AthenaRequestHeadersInput;
|
|
32
|
-
requestCookies?: AthenaRequestCookiesInput;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
1
|
/**
|
|
36
2
|
* Default App Router path for the Athena Auth session cookie bridge.
|
|
37
3
|
*
|
|
@@ -216,4 +182,4 @@ declare function clearAthenaAuthSessionOnAppHost(options?: AthenaAuthSessionBrid
|
|
|
216
182
|
*/
|
|
217
183
|
declare function resolveSessionBridgePayload(payload: AthenaAuthSessionBridgeSource | null | undefined): AthenaAuthSessionBridgePayload | null;
|
|
218
184
|
|
|
219
|
-
export {
|
|
185
|
+
export { ATHENA_AUTH_SESSION_BRIDGE_ROUTE as A, ATHENA_AUTH_SESSION_COOKIE_NAME as a, ATHENA_AUTH_SESSION_COOKIE_NAMES as b, type AthenaAuthSessionBridgeClientOptions as c, type AthenaAuthSessionBridgePayload as d, type AthenaAuthSessionBridgeSource as e, clearAthenaAuthSessionOnAppHost as f, type AthenaAuthSessionBridgeOptions as g, type AthenaAuthSessionBridgePathOptions as h, persistAthenaAuthSessionOnAppHost as p, resolveSessionBridgePayload as r };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { R as RunGeneratorOptions, d as RunGeneratorResult } from './types-
|
|
1
|
+
import { R as RunGeneratorOptions, d as RunGeneratorResult } from './types-CK7cBQbC.js';
|
|
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, d as RunGeneratorResult } from './types-
|
|
1
|
+
import { R as RunGeneratorOptions, d as RunGeneratorResult } from './types-Z3-rsiM3.cjs';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* End-to-end generator execution: load config, introspect, render, and optionally write files.
|
package/dist/react.cjs
CHANGED
|
@@ -109,14 +109,14 @@ function normalizeAthenaGatewayBaseUrl(input, options = {}) {
|
|
|
109
109
|
if (candidate === void 0 || candidate === null) {
|
|
110
110
|
throw invalidBaseUrlError(
|
|
111
111
|
`${label} must be a non-empty absolute http(s) URL. Received ${describeReceivedValue(input)}.`,
|
|
112
|
-
'Set ATHENA_URL (or pass createClient(url,
|
|
112
|
+
'Set ATHENA_URL in the explicit env object (or pass createClient({ url, key })) to a full URL such as "https://mirror3.athena-db.com".'
|
|
113
113
|
);
|
|
114
114
|
}
|
|
115
115
|
const trimmed = candidate.trim();
|
|
116
116
|
if (!trimmed) {
|
|
117
117
|
throw invalidBaseUrlError(
|
|
118
118
|
`${label} must be a non-empty absolute http(s) URL. Received ${describeReceivedValue(candidate)}.`,
|
|
119
|
-
'Set ATHENA_URL (or pass createClient(url,
|
|
119
|
+
'Set ATHENA_URL in the explicit env object (or pass createClient({ url, key })) to a full URL such as "https://mirror3.athena-db.com".'
|
|
120
120
|
);
|
|
121
121
|
}
|
|
122
122
|
let parsed;
|
|
@@ -198,7 +198,7 @@ var PROFILE_RULES = {
|
|
|
198
198
|
gateway: { apiKeys: true, routing: true, authMirror: true, authBearer: false, contentType: true, stripNullsDefault: true },
|
|
199
199
|
chat: { apiKeys: true, routing: true, authMirror: true, authBearer: true, accept: true },
|
|
200
200
|
storage: { apiKeys: true, routing: true, authMirror: true, authBearer: false, contentType: true },
|
|
201
|
-
auth: { apiKeys: true, routing:
|
|
201
|
+
auth: { apiKeys: true, routing: true, authMirror: false, authBearer: true, contentType: true },
|
|
202
202
|
minimal: { apiKeys: false, routing: false, authMirror: false, authBearer: false }
|
|
203
203
|
};
|
|
204
204
|
function normalizeHeaderValue(value) {
|
|
@@ -258,7 +258,6 @@ function resolveBackendType(backend) {
|
|
|
258
258
|
function resolveRequestHeaderOverrides(config, options, defaults) {
|
|
259
259
|
return {
|
|
260
260
|
apiKey: options?.apiKey ?? config.apiKey,
|
|
261
|
-
athenaKey: options?.athenaKey ?? config.athenaKey,
|
|
262
261
|
client: options?.client ?? config.client ?? defaults?.client,
|
|
263
262
|
userId: options?.userId ?? config.userId,
|
|
264
263
|
organizationId: options?.organizationId ?? config.organizationId,
|
|
@@ -288,10 +287,10 @@ function buildServiceRequestHeaders(profile, sdkHeaderValue, config, options, ex
|
|
|
288
287
|
accept: extras?.accept ?? (rules.accept ? "application/json" : void 0)
|
|
289
288
|
});
|
|
290
289
|
}
|
|
291
|
-
function applyAthenaApiKeyHeaders(headers, apiKey
|
|
292
|
-
const
|
|
293
|
-
if (
|
|
294
|
-
headers["X-Athena-Key"] =
|
|
290
|
+
function applyAthenaApiKeyHeaders(headers, apiKey) {
|
|
291
|
+
const resolvedApiKey = normalizeHeaderValue(apiKey);
|
|
292
|
+
if (resolvedApiKey && !hasHeaderIgnoreCase(headers, "X-Athena-Key")) {
|
|
293
|
+
headers["X-Athena-Key"] = resolvedApiKey;
|
|
295
294
|
}
|
|
296
295
|
}
|
|
297
296
|
function applyAthenaAuthContextHeaders(headers, input) {
|
|
@@ -355,7 +354,7 @@ function buildAthenaRequestHeaders(input) {
|
|
|
355
354
|
const headerClient = resolveHeaderValue(mergedExtraHeaders, CLIENT_HEADER_CANDIDATES);
|
|
356
355
|
const finalClient = normalizeHeaderValue(input.client) ?? headerClient;
|
|
357
356
|
const finalApiKey = normalizeHeaderValue(input.apiKey) ?? resolveHeaderValue(mergedExtraHeaders, API_KEY_HEADER_CANDIDATES);
|
|
358
|
-
const finalAthenaKey =
|
|
357
|
+
const finalAthenaKey = resolveHeaderValue(mergedExtraHeaders, ATHENA_KEY_HEADER_CANDIDATES) ?? finalApiKey;
|
|
359
358
|
const headers = {
|
|
360
359
|
"X-Athena-Sdk": input.sdkHeaderValue
|
|
361
360
|
};
|
|
@@ -389,7 +388,7 @@ function buildAthenaRequestHeaders(input) {
|
|
|
389
388
|
}
|
|
390
389
|
}
|
|
391
390
|
if (rules.apiKeys && (finalApiKey || finalAthenaKey)) {
|
|
392
|
-
applyAthenaApiKeyHeaders(headers,
|
|
391
|
+
applyAthenaApiKeyHeaders(headers, finalAthenaKey);
|
|
393
392
|
}
|
|
394
393
|
applyAthenaAuthContextHeaders(headers, input);
|
|
395
394
|
applyAthenaPgUriHeaders(headers, input);
|
|
@@ -414,7 +413,7 @@ function buildAthenaRequestHeaders(input) {
|
|
|
414
413
|
|
|
415
414
|
// package.json
|
|
416
415
|
var package_default = {
|
|
417
|
-
version: "
|
|
416
|
+
version: "3.0.0"
|
|
418
417
|
};
|
|
419
418
|
|
|
420
419
|
// src/sdk-version.ts
|
|
@@ -841,6 +840,9 @@ function createAthenaGatewayClient(config = {}) {
|
|
|
841
840
|
buildHeaders(options) {
|
|
842
841
|
return buildHeaders(normalizedConfig, options);
|
|
843
842
|
},
|
|
843
|
+
async resolveCallOptions(options) {
|
|
844
|
+
return options;
|
|
845
|
+
},
|
|
844
846
|
verifyConnection(options) {
|
|
845
847
|
return performConnectionCheck(
|
|
846
848
|
normalizedBaseUrl,
|
|
@@ -2002,7 +2004,7 @@ function resolveGetSession(authClient) {
|
|
|
2002
2004
|
if ("auth" in authClient && authClient.auth && typeof authClient.auth.getSession === "function") {
|
|
2003
2005
|
return authClient.auth.getSession;
|
|
2004
2006
|
}
|
|
2005
|
-
throw new Error("useSession requires an auth-capable client (createClient(...).auth
|
|
2007
|
+
throw new Error("useSession requires an auth-capable client (createClient(...).auth)");
|
|
2006
2008
|
}
|
|
2007
2009
|
function useSession(authClient, options = {}) {
|
|
2008
2010
|
const enabled = options.enabled ?? true;
|
|
@@ -2090,7 +2092,12 @@ function useSession(authClient, options = {}) {
|
|
|
2090
2092
|
function useAthenaSessionClient(baseClient, options = {}) {
|
|
2091
2093
|
const sessionState = useSession(baseClient, options);
|
|
2092
2094
|
const scopedClient = React.useMemo(
|
|
2093
|
-
() => sessionState.data ? baseClient.
|
|
2095
|
+
() => sessionState.data ? baseClient.withContext({
|
|
2096
|
+
userId: sessionState.data.user.id,
|
|
2097
|
+
organizationId: sessionState.data.session.activeOrganizationId,
|
|
2098
|
+
bearerToken: sessionState.data.session.token,
|
|
2099
|
+
sessionToken: sessionState.data.session.token
|
|
2100
|
+
}) : baseClient,
|
|
2094
2101
|
[baseClient, sessionState.data]
|
|
2095
2102
|
);
|
|
2096
2103
|
const session = sessionState.data;
|
|
@@ -2185,6 +2192,98 @@ function normalizeHookUploadInput(defaults, input, onProgress) {
|
|
|
2185
2192
|
function isStorageUploadInput(input) {
|
|
2186
2193
|
return Boolean(input) && typeof input === "object" && "files" in input && "s3_id" in input;
|
|
2187
2194
|
}
|
|
2195
|
+
function useStorageFiles(options) {
|
|
2196
|
+
const { storage, input, enabled = true, callOptions, refreshIntervalMs } = options;
|
|
2197
|
+
const [data, setData] = React__namespace.useState(null);
|
|
2198
|
+
const [loading, setLoading] = React__namespace.useState(false);
|
|
2199
|
+
const [error, setError] = React__namespace.useState(null);
|
|
2200
|
+
const requestIdRef = React__namespace.useRef(0);
|
|
2201
|
+
const refetch = React__namespace.useCallback(async () => {
|
|
2202
|
+
if (!input || !enabled) {
|
|
2203
|
+
setData(null);
|
|
2204
|
+
setError(null);
|
|
2205
|
+
setLoading(false);
|
|
2206
|
+
return null;
|
|
2207
|
+
}
|
|
2208
|
+
const requestId = requestIdRef.current + 1;
|
|
2209
|
+
requestIdRef.current = requestId;
|
|
2210
|
+
setLoading(true);
|
|
2211
|
+
setError(null);
|
|
2212
|
+
try {
|
|
2213
|
+
const result = await storage.file.list(input, callOptions);
|
|
2214
|
+
if (requestIdRef.current === requestId) {
|
|
2215
|
+
setData(result);
|
|
2216
|
+
}
|
|
2217
|
+
return result;
|
|
2218
|
+
} catch (listError) {
|
|
2219
|
+
if (requestIdRef.current === requestId) {
|
|
2220
|
+
setError(listError);
|
|
2221
|
+
setData(null);
|
|
2222
|
+
}
|
|
2223
|
+
throw listError;
|
|
2224
|
+
} finally {
|
|
2225
|
+
if (requestIdRef.current === requestId) {
|
|
2226
|
+
setLoading(false);
|
|
2227
|
+
}
|
|
2228
|
+
}
|
|
2229
|
+
}, [callOptions, enabled, input, storage]);
|
|
2230
|
+
React__namespace.useEffect(() => {
|
|
2231
|
+
void refetch().catch(() => {
|
|
2232
|
+
});
|
|
2233
|
+
}, [refetch]);
|
|
2234
|
+
React__namespace.useEffect(() => {
|
|
2235
|
+
if (!enabled || !input || !refreshIntervalMs || refreshIntervalMs <= 0) {
|
|
2236
|
+
return;
|
|
2237
|
+
}
|
|
2238
|
+
const globalObject = globalThis;
|
|
2239
|
+
const timer = globalObject.setInterval(() => {
|
|
2240
|
+
void refetch().catch(() => {
|
|
2241
|
+
});
|
|
2242
|
+
}, refreshIntervalMs);
|
|
2243
|
+
return () => globalObject.clearInterval(timer);
|
|
2244
|
+
}, [enabled, input, refetch, refreshIntervalMs]);
|
|
2245
|
+
return {
|
|
2246
|
+
files: data?.files ?? [],
|
|
2247
|
+
count: data?.count ?? data?.files?.length ?? 0,
|
|
2248
|
+
loading,
|
|
2249
|
+
error,
|
|
2250
|
+
data,
|
|
2251
|
+
refetch
|
|
2252
|
+
};
|
|
2253
|
+
}
|
|
2254
|
+
function useStorageFileDelete(options) {
|
|
2255
|
+
const { storage, onSuccess, onError } = options;
|
|
2256
|
+
const [deleting, setDeleting] = React__namespace.useState(false);
|
|
2257
|
+
const [error, setError] = React__namespace.useState(null);
|
|
2258
|
+
const reset = React__namespace.useCallback(() => {
|
|
2259
|
+
setDeleting(false);
|
|
2260
|
+
setError(null);
|
|
2261
|
+
}, []);
|
|
2262
|
+
const deleteFile = React__namespace.useCallback(
|
|
2263
|
+
async (fileId, callOptions) => {
|
|
2264
|
+
setDeleting(true);
|
|
2265
|
+
setError(null);
|
|
2266
|
+
try {
|
|
2267
|
+
const result = await storage.file.delete(fileId, callOptions);
|
|
2268
|
+
onSuccess?.(result);
|
|
2269
|
+
return result;
|
|
2270
|
+
} catch (deleteError) {
|
|
2271
|
+
setError(deleteError);
|
|
2272
|
+
onError?.(deleteError);
|
|
2273
|
+
throw deleteError;
|
|
2274
|
+
} finally {
|
|
2275
|
+
setDeleting(false);
|
|
2276
|
+
}
|
|
2277
|
+
},
|
|
2278
|
+
[onError, onSuccess, storage]
|
|
2279
|
+
);
|
|
2280
|
+
return {
|
|
2281
|
+
deleting,
|
|
2282
|
+
error,
|
|
2283
|
+
deleteFile,
|
|
2284
|
+
reset
|
|
2285
|
+
};
|
|
2286
|
+
}
|
|
2188
2287
|
|
|
2189
2288
|
// src/schema/model-form.ts
|
|
2190
2289
|
function resolveNullishValue(mode) {
|
|
@@ -2262,6 +2361,8 @@ exports.useAthenaSessionClient = useAthenaSessionClient;
|
|
|
2262
2361
|
exports.useMutation = useMutation;
|
|
2263
2362
|
exports.useQuery = useQuery;
|
|
2264
2363
|
exports.useSession = useSession;
|
|
2364
|
+
exports.useStorageFileDelete = useStorageFileDelete;
|
|
2365
|
+
exports.useStorageFiles = useStorageFiles;
|
|
2265
2366
|
exports.useStorageUpload = useStorageUpload;
|
|
2266
2367
|
//# sourceMappingURL=react.cjs.map
|
|
2267
2368
|
//# sourceMappingURL=react.cjs.map
|