@nhost/nhost-js 4.6.0 → 4.7.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/dist/fetch-DjLYNzv8.cjs +2 -0
- package/dist/fetch-DjLYNzv8.cjs.map +1 -0
- package/dist/fetch-DsJJyobH.js +2 -0
- package/dist/fetch-DsJJyobH.js.map +1 -0
- package/dist/graphql-BEFThamT.cjs +2 -0
- package/dist/graphql-BEFThamT.cjs.map +1 -0
- package/dist/graphql-CTZ9QikM.js +2 -0
- package/dist/graphql-CTZ9QikM.js.map +1 -0
- package/dist/nhost-js/auth.cjs +2 -2
- package/dist/nhost-js/auth.cjs.map +1 -1
- package/dist/nhost-js/auth.js +2 -32
- package/dist/nhost-js/auth.js.map +1 -1
- package/dist/nhost-js/fetch.cjs +1 -2
- package/dist/nhost-js/fetch.js +1 -30
- package/dist/nhost-js/functions.cjs +2 -2
- package/dist/nhost-js/functions.cjs.map +1 -1
- package/dist/nhost-js/functions.js +2 -50
- package/dist/nhost-js/functions.js.map +1 -1
- package/dist/nhost-js/graphql.cjs +1 -2
- package/dist/nhost-js/graphql.js +1 -53
- package/dist/nhost-js/session.cjs +1 -2
- package/dist/nhost-js/session.js +1 -242
- package/dist/nhost-js/storage.cjs +2 -2
- package/dist/nhost-js/storage.cjs.map +1 -1
- package/dist/nhost-js/storage.js +2 -342
- package/dist/nhost-js/storage.js.map +1 -1
- package/dist/nhost-js.cjs +2 -2
- package/dist/nhost-js.cjs.map +1 -1
- package/dist/nhost-js.js +2 -241
- package/dist/nhost-js.js.map +1 -1
- package/dist/nhost-js.umd.js +2 -2
- package/dist/nhost-js.umd.js.map +1 -1
- package/dist/refreshSession-BvZuC-Or.js +2 -0
- package/dist/refreshSession-BvZuC-Or.js.map +1 -0
- package/dist/refreshSession-ZW-JniXX.cjs +2 -0
- package/dist/refreshSession-ZW-JniXX.cjs.map +1 -0
- package/dist/session-oECsmiRB.js +2 -0
- package/dist/session-oECsmiRB.js.map +1 -0
- package/dist/session-r_9IPgQp.cjs +2 -0
- package/dist/session-r_9IPgQp.cjs.map +1 -0
- package/dist/src/auth/client.d.ts +227 -5
- package/dist/src/auth/client.d.ts.map +1 -1
- package/dist/src/auth/client.js +138 -0
- package/dist/src/auth/client.js.map +1 -1
- package/dist/src/graphql/client.d.ts +11 -0
- package/dist/src/graphql/client.d.ts.map +1 -1
- package/dist/src/graphql/client.js +31 -1
- package/dist/src/graphql/client.js.map +1 -1
- package/dist/src/graphql/index.d.ts +2 -1
- package/dist/src/graphql/index.d.ts.map +1 -1
- package/dist/src/graphql/index.js +1 -1
- package/dist/src/graphql/index.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -2
- package/dist/client-BL0edWHv.cjs +0 -2
- package/dist/client-BL0edWHv.cjs.map +0 -1
- package/dist/client-BOrTAJrs.js +0 -1304
- package/dist/client-BOrTAJrs.js.map +0 -1
- package/dist/fetch-2PHmQBIJ.js +0 -61
- package/dist/fetch-2PHmQBIJ.js.map +0 -1
- package/dist/fetch-DWXwEnoe.cjs +0 -2
- package/dist/fetch-DWXwEnoe.cjs.map +0 -1
- package/dist/middlewareWithAdminSession-CcuYKs5Y.js +0 -106
- package/dist/middlewareWithAdminSession-CcuYKs5Y.js.map +0 -1
- package/dist/middlewareWithAdminSession-j70iKbBX.cjs +0 -2
- package/dist/middlewareWithAdminSession-j70iKbBX.cjs.map +0 -1
- package/dist/nhost-js/fetch.cjs.map +0 -1
- package/dist/nhost-js/fetch.js.map +0 -1
- package/dist/nhost-js/graphql.cjs.map +0 -1
- package/dist/nhost-js/graphql.js.map +0 -1
- package/dist/nhost-js/session.cjs.map +0 -1
- package/dist/nhost-js/session.js.map +0 -1
- package/dist/refreshSession-Bw715ZmX.cjs +0 -2
- package/dist/refreshSession-Bw715ZmX.cjs.map +0 -1
- package/dist/refreshSession-WwGlzgtM.js +0 -95
- package/dist/refreshSession-WwGlzgtM.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"functions.js","sources":["../../src/functions/client.ts"],"sourcesContent":["/**\n * Functions client for the Nhost JavaScript SDK.\n *\n * This module provides functionality for executing serverless function calls\n * against Nhost serverless functions.\n */\n\nimport {\n type ChainFunction,\n createEnhancedFetch,\n FetchError,\n type FetchResponse,\n} from '../fetch';\n\n/**\n * Functions client interface providing methods for executing serverless function calls\n */\nexport interface Client {\n baseURL: string;\n\n /** Add a middleware function to the fetch chain\n * @param chainFunction - The middleware function to add\n */\n pushChainFunction(chainFunction: ChainFunction): void;\n\n /**\n * Execute a request to a serverless function\n * The response body will be automatically parsed based on the content type into the following types:\n * - Object if the response is application/json\n * - string text string if the response is text/*\n * - Blob if the response is any other type\n *\n * @param path - The path to the serverless function\n * @param options - Additional fetch options to apply to the request\n * @returns Promise with the function response and metadata.\n */\n fetch<T = unknown>(\n path: string,\n options?: RequestInit,\n ): Promise<FetchResponse<T>>;\n\n /**\n * Executes a POST request to a serverless function with a JSON body\n *\n * This is a convenience method assuming the request is a POST with JSON body\n * setting the `Content-Type` and 'Accept' headers to `application/json` and\n * automatically stringifying the body.\n *\n * For a more generic request, use the `fetch` method instead.\n *\n * @param path - The path to the serverless function\n * @param body - The JSON body to send in the request\n * @param options - Additional fetch options to apply to the request\n * @returns Promise with the function response and metadata\n */\n post<T = unknown>(\n path: string,\n body?: unknown,\n options?: RequestInit,\n ): Promise<FetchResponse<T>>;\n}\n\n/**\n * Creates a Functions API client for interacting with serverless functions.\n *\n * This client provides methods for executing requests against serverless functions,\n * with support for middleware functions to handle authentication, error handling,\n * and other cross-cutting concerns.\n *\n * @param baseURL - Base URL for the functions endpoint\n * @param chainFunctions - Array of middleware functions for the fetch chain\n * @returns Functions client with fetch method\n */\nexport const createAPIClient = (\n baseURL: string,\n chainFunctions: ChainFunction[] = [],\n): Client => {\n let enhancedFetch = createEnhancedFetch(chainFunctions);\n\n const pushChainFunction = (chainFunction: ChainFunction) => {\n chainFunctions.push(chainFunction);\n enhancedFetch = createEnhancedFetch(chainFunctions);\n };\n\n /**\n * Executes a request to a serverless function and processes the response\n *\n * @param path - The path to the serverless function\n * @param options - Additional fetch options to apply to the request\n * @returns Promise with the function response and metadata. Body will be either\n * - JSON object if the response is application/json\n - text string if the response is text/*\n - Blob if the response is any other type\n */\n const fetch = async <T = unknown>(\n path: string,\n options?: RequestInit,\n ): Promise<FetchResponse<T | string | Blob>> => {\n const resp = await enhancedFetch(`${baseURL}${path}`, options);\n\n let body: T | string | Blob;\n // Process response based on content type\n if (resp.headers.get('content-type')?.includes('application/json')) {\n body = (await resp.json()) as T;\n } else if (resp.headers.get('content-type')?.startsWith('text/')) {\n body = await resp.text();\n } else {\n body = await resp.blob();\n }\n\n // Throw error for non-OK responses\n if (!resp.ok) {\n throw new FetchError(body, resp.status, resp.headers);\n }\n\n return {\n status: resp.status,\n body,\n headers: resp.headers,\n };\n };\n\n /**\n * Executes a POST request to a serverless function with a JSON body\n *\n * This is a convenience method assuming the request is a POST with JSON body\n * setting the `Content-Type` and 'Accept' headers to `application/json` and\n * automatically stringifying the body.\n *\n * For a more generic request, use the `fetch` method instead.\n *\n * @param path - The path to the serverless function\n * @param body - The JSON body to send in the request\n * @param options - Additional fetch options to apply to the request\n * @returns Promise with the function response and metadata\n */\n const post = async <T = unknown>(\n path: string,\n body?: unknown,\n options: RequestInit = {},\n ): Promise<FetchResponse<T | string | Blob>> => {\n // Ensure the method is POST and set the body\n const requestOptions: RequestInit = {\n ...options,\n method: 'POST',\n headers: {\n Accept: 'application/json',\n 'Content-Type': 'application/json',\n ...options.headers,\n },\n body: body ? JSON.stringify(body) : undefined,\n };\n\n return fetch<T>(path, requestOptions);\n };\n\n // Return client object with the fetch method\n return {\n baseURL,\n fetch,\n post,\n pushChainFunction,\n } as Client;\n};\n"],"
|
|
1
|
+
{"version":3,"file":"functions.js","names":[],"sources":["../../src/functions/client.ts"],"sourcesContent":["/**\n * Functions client for the Nhost JavaScript SDK.\n *\n * This module provides functionality for executing serverless function calls\n * against Nhost serverless functions.\n */\n\nimport {\n type ChainFunction,\n createEnhancedFetch,\n FetchError,\n type FetchResponse,\n} from '../fetch';\n\n/**\n * Functions client interface providing methods for executing serverless function calls\n */\nexport interface Client {\n baseURL: string;\n\n /** Add a middleware function to the fetch chain\n * @param chainFunction - The middleware function to add\n */\n pushChainFunction(chainFunction: ChainFunction): void;\n\n /**\n * Execute a request to a serverless function\n * The response body will be automatically parsed based on the content type into the following types:\n * - Object if the response is application/json\n * - string text string if the response is text/*\n * - Blob if the response is any other type\n *\n * @param path - The path to the serverless function\n * @param options - Additional fetch options to apply to the request\n * @returns Promise with the function response and metadata.\n */\n fetch<T = unknown>(\n path: string,\n options?: RequestInit,\n ): Promise<FetchResponse<T>>;\n\n /**\n * Executes a POST request to a serverless function with a JSON body\n *\n * This is a convenience method assuming the request is a POST with JSON body\n * setting the `Content-Type` and 'Accept' headers to `application/json` and\n * automatically stringifying the body.\n *\n * For a more generic request, use the `fetch` method instead.\n *\n * @param path - The path to the serverless function\n * @param body - The JSON body to send in the request\n * @param options - Additional fetch options to apply to the request\n * @returns Promise with the function response and metadata\n */\n post<T = unknown>(\n path: string,\n body?: unknown,\n options?: RequestInit,\n ): Promise<FetchResponse<T>>;\n}\n\n/**\n * Creates a Functions API client for interacting with serverless functions.\n *\n * This client provides methods for executing requests against serverless functions,\n * with support for middleware functions to handle authentication, error handling,\n * and other cross-cutting concerns.\n *\n * @param baseURL - Base URL for the functions endpoint\n * @param chainFunctions - Array of middleware functions for the fetch chain\n * @returns Functions client with fetch method\n */\nexport const createAPIClient = (\n baseURL: string,\n chainFunctions: ChainFunction[] = [],\n): Client => {\n let enhancedFetch = createEnhancedFetch(chainFunctions);\n\n const pushChainFunction = (chainFunction: ChainFunction) => {\n chainFunctions.push(chainFunction);\n enhancedFetch = createEnhancedFetch(chainFunctions);\n };\n\n /**\n * Executes a request to a serverless function and processes the response\n *\n * @param path - The path to the serverless function\n * @param options - Additional fetch options to apply to the request\n * @returns Promise with the function response and metadata. Body will be either\n * - JSON object if the response is application/json\n - text string if the response is text/*\n - Blob if the response is any other type\n */\n const fetch = async <T = unknown>(\n path: string,\n options?: RequestInit,\n ): Promise<FetchResponse<T | string | Blob>> => {\n const resp = await enhancedFetch(`${baseURL}${path}`, options);\n\n let body: T | string | Blob;\n // Process response based on content type\n if (resp.headers.get('content-type')?.includes('application/json')) {\n body = (await resp.json()) as T;\n } else if (resp.headers.get('content-type')?.startsWith('text/')) {\n body = await resp.text();\n } else {\n body = await resp.blob();\n }\n\n // Throw error for non-OK responses\n if (!resp.ok) {\n throw new FetchError(body, resp.status, resp.headers);\n }\n\n return {\n status: resp.status,\n body,\n headers: resp.headers,\n };\n };\n\n /**\n * Executes a POST request to a serverless function with a JSON body\n *\n * This is a convenience method assuming the request is a POST with JSON body\n * setting the `Content-Type` and 'Accept' headers to `application/json` and\n * automatically stringifying the body.\n *\n * For a more generic request, use the `fetch` method instead.\n *\n * @param path - The path to the serverless function\n * @param body - The JSON body to send in the request\n * @param options - Additional fetch options to apply to the request\n * @returns Promise with the function response and metadata\n */\n const post = async <T = unknown>(\n path: string,\n body?: unknown,\n options: RequestInit = {},\n ): Promise<FetchResponse<T | string | Blob>> => {\n // Ensure the method is POST and set the body\n const requestOptions: RequestInit = {\n ...options,\n method: 'POST',\n headers: {\n Accept: 'application/json',\n 'Content-Type': 'application/json',\n ...options.headers,\n },\n body: body ? JSON.stringify(body) : undefined,\n };\n\n return fetch<T>(path, requestOptions);\n };\n\n // Return client object with the fetch method\n return {\n baseURL,\n fetch,\n post,\n pushChainFunction,\n } as Client;\n};\n"],"mappings":"gDAyEA,IAAa,EAAA,CACX,EACA,EAAkC,MAElC,IAAI,EAAgB,EAAoB,GAExC,MAeM,EAAQ,MACZ,EACA,KAEA,MAAM,QAAa,EAAc,GAAG,IAAU,IAAQ,GAEtD,IAAI,EAWJ,GARE,EADE,EAAK,QAAQ,IAAI,iBAAiB,SAAS,0BAC/B,EAAK,OACV,EAAK,QAAQ,IAAI,iBAAiB,WAAW,eACzC,EAAK,aAEL,EAAK,QAIf,EAAK,GACR,MAAM,IAAI,EAAW,EAAM,EAAK,OAAQ,EAAK,SAG/C,MAAO,CACL,OAAQ,EAAK,OACb,OACA,QAAS,EAAK,QACf,EAsCH,MAAO,CACL,UACA,QACA,KAxBW,MACX,EACA,EACA,EAAuB,CAAA,IAchB,EAAS,EAXoB,IAC/B,EACH,OAAQ,OACR,QAAS,CACP,OAAQ,mBACR,eAAgB,sBACb,EAAQ,SAEb,KAAM,EAAO,KAAK,UAAU,QAAQ,IAWtC,kBAlFyB,IACzB,EAAe,KAAK,GACpB,EAAgB,EAAoB,EAAe,EAiFpD"}
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
//# sourceMappingURL=graphql.cjs.map
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../graphql-BEFThamT.cjs");exports.createAPIClient=e.createAPIClient;
|
package/dist/nhost-js/graphql.js
CHANGED
|
@@ -1,53 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
const createAPIClient = (url, chainFunctions = []) => {
|
|
3
|
-
let enhancedFetch = createEnhancedFetch(chainFunctions);
|
|
4
|
-
const pushChainFunction = (chainFunction) => {
|
|
5
|
-
chainFunctions.push(chainFunction);
|
|
6
|
-
enhancedFetch = createEnhancedFetch(chainFunctions);
|
|
7
|
-
};
|
|
8
|
-
const executeOperation = async (request2, options) => {
|
|
9
|
-
const response = await enhancedFetch(`${url}`, {
|
|
10
|
-
method: "POST",
|
|
11
|
-
headers: {
|
|
12
|
-
"Content-Type": "application/json"
|
|
13
|
-
},
|
|
14
|
-
body: JSON.stringify(request2),
|
|
15
|
-
...options
|
|
16
|
-
});
|
|
17
|
-
const body = await response.text();
|
|
18
|
-
const data = body ? JSON.parse(body) : {};
|
|
19
|
-
const resp = {
|
|
20
|
-
body: data,
|
|
21
|
-
status: response.status,
|
|
22
|
-
headers: response.headers
|
|
23
|
-
};
|
|
24
|
-
if (data.errors) {
|
|
25
|
-
throw new FetchError(data, response.status, response.headers);
|
|
26
|
-
}
|
|
27
|
-
return resp;
|
|
28
|
-
};
|
|
29
|
-
function request(requestOrDocument, variablesOrOptions, options) {
|
|
30
|
-
if (typeof requestOrDocument === "object" && "kind" in requestOrDocument) {
|
|
31
|
-
const definition = requestOrDocument.definitions[0];
|
|
32
|
-
const request2 = {
|
|
33
|
-
query: requestOrDocument.loc?.source.body || "",
|
|
34
|
-
variables: variablesOrOptions,
|
|
35
|
-
operationName: definition && "name" in definition ? definition.name?.value : void 0
|
|
36
|
-
};
|
|
37
|
-
return executeOperation(request2, options);
|
|
38
|
-
} else {
|
|
39
|
-
const request2 = requestOrDocument;
|
|
40
|
-
const requestOptions = variablesOrOptions;
|
|
41
|
-
return executeOperation(request2, requestOptions);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
return {
|
|
45
|
-
request,
|
|
46
|
-
url,
|
|
47
|
-
pushChainFunction
|
|
48
|
-
};
|
|
49
|
-
};
|
|
50
|
-
export {
|
|
51
|
-
createAPIClient
|
|
52
|
-
};
|
|
53
|
-
//# sourceMappingURL=graphql.js.map
|
|
1
|
+
import{t as r}from"../graphql-CTZ9QikM.js";export{r as createAPIClient};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
//# sourceMappingURL=session.cjs.map
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../refreshSession-ZW-JniXX.cjs"),o=require("../session-r_9IPgQp.cjs");exports.CookieStorage=o.CookieStorage,exports.DEFAULT_SESSION_KEY=o.DEFAULT_SESSION_KEY,exports.LocalStorage=o.LocalStorage,exports.MemoryStorage=o.MemoryStorage,exports.SessionStorage=o.SessionStorage,exports.detectStorage=o.detectStorage,exports.refreshSession=e.refreshSession;
|
package/dist/nhost-js/session.js
CHANGED
|
@@ -1,242 +1 @@
|
|
|
1
|
-
import { r }
|
|
2
|
-
const decodeBase64Url = (input) => {
|
|
3
|
-
let base64 = input.replace(/-/g, "+").replace(/_/g, "/");
|
|
4
|
-
const pad = base64.length % 4;
|
|
5
|
-
if (pad) {
|
|
6
|
-
base64 += "=".repeat(4 - pad);
|
|
7
|
-
}
|
|
8
|
-
const binaryString = atob(base64);
|
|
9
|
-
const bytes = Uint8Array.from(binaryString, (c) => c.charCodeAt(0));
|
|
10
|
-
return new TextDecoder().decode(bytes);
|
|
11
|
-
};
|
|
12
|
-
const decodeUserSession = (accessToken) => {
|
|
13
|
-
const s = accessToken.split(".");
|
|
14
|
-
if (s.length !== 3 || !s[1]) {
|
|
15
|
-
throw new Error("Invalid access token format");
|
|
16
|
-
}
|
|
17
|
-
const decodedToken = JSON.parse(decodeBase64Url(s[1]));
|
|
18
|
-
const iat = typeof decodedToken["iat"] === "number" ? decodedToken["iat"] * 1e3 : void 0;
|
|
19
|
-
const exp = typeof decodedToken["exp"] === "number" ? decodedToken["exp"] * 1e3 : void 0;
|
|
20
|
-
const hasuraClaims = decodedToken["https://hasura.io/jwt/claims"];
|
|
21
|
-
const processedClaims = hasuraClaims ? Object.entries(hasuraClaims).reduce(
|
|
22
|
-
(acc, [key, value]) => {
|
|
23
|
-
if (typeof value === "string" && isPostgresArray(value)) {
|
|
24
|
-
acc[key] = parsePostgresArray(value);
|
|
25
|
-
} else {
|
|
26
|
-
acc[key] = value;
|
|
27
|
-
}
|
|
28
|
-
return acc;
|
|
29
|
-
},
|
|
30
|
-
{}
|
|
31
|
-
) : void 0;
|
|
32
|
-
return {
|
|
33
|
-
...decodedToken,
|
|
34
|
-
iat,
|
|
35
|
-
exp,
|
|
36
|
-
"https://hasura.io/jwt/claims": processedClaims
|
|
37
|
-
};
|
|
38
|
-
};
|
|
39
|
-
const isPostgresArray = (value) => {
|
|
40
|
-
return value.startsWith("{") && value.endsWith("}");
|
|
41
|
-
};
|
|
42
|
-
const parsePostgresArray = (value) => {
|
|
43
|
-
if (!value || value === "{}") return [];
|
|
44
|
-
return value.slice(1, -1).split(",").map((item) => item.trim().replace(/^"(.*)"$/, "$1"));
|
|
45
|
-
};
|
|
46
|
-
const DEFAULT_SESSION_KEY = "nhostSession";
|
|
47
|
-
class LocalStorage {
|
|
48
|
-
storageKey;
|
|
49
|
-
/**
|
|
50
|
-
* Creates a new LocalStorage instance
|
|
51
|
-
* @param options - Configuration options
|
|
52
|
-
* @param options.storageKey - The key to use in localStorage (defaults to "nhostSession")
|
|
53
|
-
*/
|
|
54
|
-
constructor(options) {
|
|
55
|
-
this.storageKey = options?.storageKey || DEFAULT_SESSION_KEY;
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* Gets the session from localStorage
|
|
59
|
-
* @returns The stored session or null if not found
|
|
60
|
-
*/
|
|
61
|
-
get() {
|
|
62
|
-
try {
|
|
63
|
-
const value = window.localStorage.getItem(this.storageKey);
|
|
64
|
-
return value ? JSON.parse(value) : null;
|
|
65
|
-
} catch {
|
|
66
|
-
this.remove();
|
|
67
|
-
return null;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* Sets the session in localStorage
|
|
72
|
-
* @param value - The session to store
|
|
73
|
-
*/
|
|
74
|
-
set(value) {
|
|
75
|
-
window.localStorage.setItem(this.storageKey, JSON.stringify(value));
|
|
76
|
-
}
|
|
77
|
-
/**
|
|
78
|
-
* Removes the session from localStorage
|
|
79
|
-
*/
|
|
80
|
-
remove() {
|
|
81
|
-
window.localStorage.removeItem(this.storageKey);
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
class MemoryStorage {
|
|
85
|
-
session = null;
|
|
86
|
-
/**
|
|
87
|
-
* Gets the session from memory
|
|
88
|
-
* @returns The stored session or null if not set
|
|
89
|
-
*/
|
|
90
|
-
get() {
|
|
91
|
-
return this.session;
|
|
92
|
-
}
|
|
93
|
-
/**
|
|
94
|
-
* Sets the session in memory
|
|
95
|
-
* @param value - The session to store
|
|
96
|
-
*/
|
|
97
|
-
set(value) {
|
|
98
|
-
this.session = value;
|
|
99
|
-
}
|
|
100
|
-
/**
|
|
101
|
-
* Clears the session from memory
|
|
102
|
-
*/
|
|
103
|
-
remove() {
|
|
104
|
-
this.session = null;
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
class CookieStorage {
|
|
108
|
-
cookieName;
|
|
109
|
-
expirationDays;
|
|
110
|
-
secure;
|
|
111
|
-
sameSite;
|
|
112
|
-
/**
|
|
113
|
-
* Creates a new CookieStorage instance
|
|
114
|
-
* @param options - Configuration options
|
|
115
|
-
* @param options.cookieName - Name of the cookie to use (defaults to "nhostSession")
|
|
116
|
-
* @param options.expirationDays - Number of days until the cookie expires (defaults to 30)
|
|
117
|
-
* @param options.secure - Whether to set the Secure flag on the cookie (defaults to true)
|
|
118
|
-
* @param options.sameSite - SameSite policy for the cookie (defaults to "lax")
|
|
119
|
-
*/
|
|
120
|
-
constructor(options) {
|
|
121
|
-
this.cookieName = options?.cookieName || DEFAULT_SESSION_KEY;
|
|
122
|
-
this.expirationDays = options?.expirationDays ?? 30;
|
|
123
|
-
this.secure = options?.secure ?? true;
|
|
124
|
-
this.sameSite = options?.sameSite || "lax";
|
|
125
|
-
}
|
|
126
|
-
/**
|
|
127
|
-
* Gets the session from cookies
|
|
128
|
-
* @returns The stored session or null if not found
|
|
129
|
-
*/
|
|
130
|
-
get() {
|
|
131
|
-
const cookies = document.cookie.split(";");
|
|
132
|
-
for (const cookie of cookies) {
|
|
133
|
-
const [name, value] = cookie.trim().split("=");
|
|
134
|
-
if (name === this.cookieName) {
|
|
135
|
-
try {
|
|
136
|
-
return JSON.parse(decodeURIComponent(value || ""));
|
|
137
|
-
} catch {
|
|
138
|
-
this.remove();
|
|
139
|
-
return null;
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
return null;
|
|
144
|
-
}
|
|
145
|
-
/**
|
|
146
|
-
* Sets the session in a cookie
|
|
147
|
-
* @param value - The session to store
|
|
148
|
-
*/
|
|
149
|
-
set(value) {
|
|
150
|
-
const expires = /* @__PURE__ */ new Date();
|
|
151
|
-
expires.setTime(
|
|
152
|
-
expires.getTime() + this.expirationDays * 24 * 60 * 60 * 1e3
|
|
153
|
-
);
|
|
154
|
-
const cookieValue = encodeURIComponent(JSON.stringify(value));
|
|
155
|
-
const cookieString = `${this.cookieName}=${cookieValue}; expires=${expires.toUTCString()}; path=/; ${this.secure ? "secure; " : ""}SameSite=${this.sameSite}`;
|
|
156
|
-
document.cookie = cookieString;
|
|
157
|
-
}
|
|
158
|
-
/**
|
|
159
|
-
* Removes the session cookie
|
|
160
|
-
*/
|
|
161
|
-
remove() {
|
|
162
|
-
document.cookie = `${this.cookieName}=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/; ${this.secure ? "secure; " : ""}SameSite=${this.sameSite}`;
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
class SessionStorage {
|
|
166
|
-
storage;
|
|
167
|
-
subscribers = /* @__PURE__ */ new Set();
|
|
168
|
-
/**
|
|
169
|
-
* Creates a new SessionStorage instance
|
|
170
|
-
* @param storage - The underlying storage implementation to use
|
|
171
|
-
*/
|
|
172
|
-
constructor(storage) {
|
|
173
|
-
this.storage = storage;
|
|
174
|
-
}
|
|
175
|
-
/**
|
|
176
|
-
* Gets the session from the underlying storage
|
|
177
|
-
* @returns The stored session or null if not found
|
|
178
|
-
*/
|
|
179
|
-
get() {
|
|
180
|
-
return this.storage.get();
|
|
181
|
-
}
|
|
182
|
-
/**
|
|
183
|
-
* Sets the session in the underlying storage and notifies subscribers
|
|
184
|
-
* @param value - The session to store
|
|
185
|
-
*/
|
|
186
|
-
set(value) {
|
|
187
|
-
const decodedToken = decodeUserSession(value.accessToken);
|
|
188
|
-
const decodedSession = {
|
|
189
|
-
...value,
|
|
190
|
-
decodedToken
|
|
191
|
-
};
|
|
192
|
-
this.storage.set(decodedSession);
|
|
193
|
-
this.notifySubscribers(decodedSession);
|
|
194
|
-
}
|
|
195
|
-
/**
|
|
196
|
-
* Removes the session from the underlying storage and notifies subscribers
|
|
197
|
-
*/
|
|
198
|
-
remove() {
|
|
199
|
-
this.storage.remove();
|
|
200
|
-
this.notifySubscribers(null);
|
|
201
|
-
}
|
|
202
|
-
/**
|
|
203
|
-
* Subscribe to session changes
|
|
204
|
-
* @param callback - Function that will be called when the session changes
|
|
205
|
-
* @returns An unsubscribe function to remove this subscription
|
|
206
|
-
*/
|
|
207
|
-
onChange(callback) {
|
|
208
|
-
this.subscribers.add(callback);
|
|
209
|
-
return () => {
|
|
210
|
-
this.subscribers.delete(callback);
|
|
211
|
-
};
|
|
212
|
-
}
|
|
213
|
-
/**
|
|
214
|
-
* Notify all subscribers of a session change
|
|
215
|
-
* @param session - The new session value or null if removed
|
|
216
|
-
*/
|
|
217
|
-
notifySubscribers(session) {
|
|
218
|
-
for (const subscriber of this.subscribers) {
|
|
219
|
-
try {
|
|
220
|
-
subscriber(session);
|
|
221
|
-
} catch (error) {
|
|
222
|
-
console.error("Error notifying subscriber:", error);
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
const detectStorage = () => {
|
|
228
|
-
if (typeof window !== "undefined") {
|
|
229
|
-
return new LocalStorage();
|
|
230
|
-
}
|
|
231
|
-
return new MemoryStorage();
|
|
232
|
-
};
|
|
233
|
-
export {
|
|
234
|
-
CookieStorage,
|
|
235
|
-
DEFAULT_SESSION_KEY,
|
|
236
|
-
LocalStorage,
|
|
237
|
-
MemoryStorage,
|
|
238
|
-
SessionStorage,
|
|
239
|
-
detectStorage,
|
|
240
|
-
r as refreshSession
|
|
241
|
-
};
|
|
242
|
-
//# sourceMappingURL=session.js.map
|
|
1
|
+
import{t as s}from"../refreshSession-BvZuC-Or.js";import{a,i as o,n as r,o as e,r as i,t}from"../session-oECsmiRB.js";export{i as CookieStorage,o as DEFAULT_SESSION_KEY,a as LocalStorage,e as MemoryStorage,t as SessionStorage,r as detectStorage,s as refreshSession};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
//# sourceMappingURL=storage.cjs.map
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../fetch-DjLYNzv8.cjs");exports.createAPIClient=(e,s=[])=>{let a=t.createEnhancedFetch(s);return{baseURL:e,pushChainFunction:e=>{s.push(e),a=t.createEnhancedFetch(s)},uploadFiles:async(s,r)=>{const n=`${e}/files`,d=new FormData,o="undefined"!=typeof navigator&&"ReactNative"===navigator.product;void 0!==s["bucket-id"]&&d.append("bucket-id",s["bucket-id"]),void 0!==s["metadata[]"]&&s["metadata[]"].forEach((t=>{o?d.append("metadata[]",{string:JSON.stringify(t),type:"application/json",name:""}):d.append("metadata[]",new Blob([JSON.stringify(t)],{type:"application/json"}),"")})),void 0!==s["file[]"]&&s["file[]"].forEach((t=>{d.append("file[]",t)}));const i=await a(n,{...r,method:"POST",body:d});if(i.status>=300){const e=[412].includes(i.status)?null:await i.text();throw new t.FetchError(e?JSON.parse(e):{},i.status,i.headers)}const u=[204,205,304].includes(i.status)?null:await i.text();return{body:u?JSON.parse(u):{},status:i.status,headers:i.headers}},deleteFile:async(s,r)=>{const n=`${e}/files/${s}`,d=await a(n,{...r,method:"DELETE",headers:{...r?.headers}});if(d.status>=300){const e=[412].includes(d.status)?null:await d.text();throw new t.FetchError(e?JSON.parse(e):{},d.status,d.headers)}return{body:void 0,status:d.status,headers:d.headers}},getFile:async(s,r,n)=>{const d=r&&Object.entries(r).flatMap((([t,e])=>{const s=Array.isArray(e)?e.join(","):"object"==typeof e&&null!==e?JSON.stringify(e):String(e);return[`${t}=${encodeURIComponent(s)}`]})).join("&"),o=d?`${e}/files/${s}?${d}`:`${e}/files/${s}`,i=await a(o,{...n,method:"GET",headers:{...n?.headers}});if(i.status>=300){const e=[412].includes(i.status)?null:await i.text();throw new t.FetchError(e?JSON.parse(e):{},i.status,i.headers)}return{body:await i.blob(),status:i.status,headers:i.headers}},getFileMetadataHeaders:async(s,r,n)=>{const d=r&&Object.entries(r).flatMap((([t,e])=>{const s=Array.isArray(e)?e.join(","):"object"==typeof e&&null!==e?JSON.stringify(e):String(e);return[`${t}=${encodeURIComponent(s)}`]})).join("&"),o=d?`${e}/files/${s}?${d}`:`${e}/files/${s}`,i=await a(o,{...n,method:"HEAD",headers:{...n?.headers}});if(i.status>=300){const e=[412].includes(i.status)?null:await i.text();throw new t.FetchError(e?JSON.parse(e):{},i.status,i.headers)}return{body:void 0,status:i.status,headers:i.headers}},replaceFile:async(s,r,n)=>{const d=`${e}/files/${s}`,o=new FormData,i="undefined"!=typeof navigator&&"ReactNative"===navigator.product;void 0!==r.metadata&&(i?o.append("metadata",{string:JSON.stringify(r.metadata),type:"application/json",name:""}):o.append("metadata",new Blob([JSON.stringify(r.metadata)],{type:"application/json"}),"")),void 0!==r.file&&o.append("file",r.file);const u=await a(d,{...n,method:"PUT",body:o});if(u.status>=300){const e=[412].includes(u.status)?null:await u.text();throw new t.FetchError(e?JSON.parse(e):{},u.status,u.headers)}const l=[204,205,304].includes(u.status)?null:await u.text();return{body:l?JSON.parse(l):{},status:u.status,headers:u.headers}},getFilePresignedURL:async(s,r)=>{const n=`${e}/files/${s}/presignedurl`,d=await a(n,{...r,method:"GET",headers:{...r?.headers}});if(d.status>=300){const e=[412].includes(d.status)?null:await d.text();throw new t.FetchError(e?JSON.parse(e):{},d.status,d.headers)}const o=[204,205,304].includes(d.status)?null:await d.text();return{body:o?JSON.parse(o):{},status:d.status,headers:d.headers}},deleteBrokenMetadata:async s=>{const r=`${e}/ops/delete-broken-metadata`,n=await a(r,{...s,method:"POST",headers:{...s?.headers}});if(n.status>=300){const e=[412].includes(n.status)?null:await n.text();throw new t.FetchError(e?JSON.parse(e):{},n.status,n.headers)}const d=[204,205,304].includes(n.status)?null:await n.text();return{body:d?JSON.parse(d):{},status:n.status,headers:n.headers}},deleteOrphanedFiles:async s=>{const r=`${e}/ops/delete-orphans`,n=await a(r,{...s,method:"POST",headers:{...s?.headers}});if(n.status>=300){const e=[412].includes(n.status)?null:await n.text();throw new t.FetchError(e?JSON.parse(e):{},n.status,n.headers)}const d=[204,205,304].includes(n.status)?null:await n.text();return{body:d?JSON.parse(d):{},status:n.status,headers:n.headers}},listBrokenMetadata:async s=>{const r=`${e}/ops/list-broken-metadata`,n=await a(r,{...s,method:"POST",headers:{...s?.headers}});if(n.status>=300){const e=[412].includes(n.status)?null:await n.text();throw new t.FetchError(e?JSON.parse(e):{},n.status,n.headers)}const d=[204,205,304].includes(n.status)?null:await n.text();return{body:d?JSON.parse(d):{},status:n.status,headers:n.headers}},listFilesNotUploaded:async s=>{const r=`${e}/ops/list-not-uploaded`,n=await a(r,{...s,method:"POST",headers:{...s?.headers}});if(n.status>=300){const e=[412].includes(n.status)?null:await n.text();throw new t.FetchError(e?JSON.parse(e):{},n.status,n.headers)}const d=[204,205,304].includes(n.status)?null:await n.text();return{body:d?JSON.parse(d):{},status:n.status,headers:n.headers}},listOrphanedFiles:async s=>{const r=`${e}/ops/list-orphans`,n=await a(r,{...s,method:"POST",headers:{...s?.headers}});if(n.status>=300){const e=[412].includes(n.status)?null:await n.text();throw new t.FetchError(e?JSON.parse(e):{},n.status,n.headers)}const d=[204,205,304].includes(n.status)?null:await n.text();return{body:d?JSON.parse(d):{},status:n.status,headers:n.headers}},getVersion:async s=>{const r=`${e}/version`,n=await a(r,{...s,method:"GET",headers:{...s?.headers}});if(n.status>=300){const e=[412].includes(n.status)?null:await n.text();throw new t.FetchError(e?JSON.parse(e):{},n.status,n.headers)}const d=[204,205,304].includes(n.status)?null:await n.text();return{body:d?JSON.parse(d):{},status:n.status,headers:n.headers}}}};
|
|
2
|
+
//# sourceMappingURL=storage.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storage.cjs","sources":["../../src/storage/client.ts"],"sourcesContent":["/**\n * This file is auto-generated. Do not edit manually.\n */\n\nimport type { ChainFunction, FetchResponse } from '../fetch';\nimport { createEnhancedFetch, FetchError } from '../fetch';\n\n/**\n * Date in RFC 2822 format\n */\nexport type RFC2822Date = string;\n\n/**\n * Error details.\n @property message (`string`) - Human-readable error message.\n * Example - `\"File not found\"`\n @property data? (`Record<string, unknown>`) - Additional data related to the error, if any.*/\nexport interface ErrorResponseError {\n /**\n * Human-readable error message.\n * Example - `\"File not found\"`\n */\n message: string;\n /**\n * Additional data related to the error, if any.\n */\n data?: Record<string, unknown>;\n}\n\n/**\n * Error information returned by the API.\n @property error? (`ErrorResponseError`) - Error details.*/\nexport interface ErrorResponse {\n /**\n * Error details.\n */\n error?: ErrorResponseError;\n}\n\n/**\n * Error details.\n @property message (`string`) - Human-readable error message.\n * Example - `\"File not found\"`\n @property data? (`Record<string, unknown>`) - Additional data related to the error, if any.*/\nexport interface ErrorResponseWithProcessedFilesError {\n /**\n * Human-readable error message.\n * Example - `\"File not found\"`\n */\n message: string;\n /**\n * Additional data related to the error, if any.\n */\n data?: Record<string, unknown>;\n}\n\n/**\n * Error information returned by the API.\n @property processedFiles? (`FileMetadata[]`) - List of files that were successfully processed before the error occurred.\n @property error? (`ErrorResponseWithProcessedFilesError`) - Error details.*/\nexport interface ErrorResponseWithProcessedFiles {\n /**\n * List of files that were successfully processed before the error occurred.\n */\n processedFiles?: FileMetadata[];\n /**\n * Error details.\n */\n error?: ErrorResponseWithProcessedFilesError;\n}\n\n/**\n * Comprehensive metadata information about a file in storage.\n @property id (`string`) - Unique identifier for the file.\n * Example - `\"d5e76ceb-77a2-4153-b7da-1f7c115b2ff2\"`\n @property name (`string`) - Name of the file including extension.\n * Example - `\"profile-picture.jpg\"`\n @property size (`number`) - Size of the file in bytes.\n * Example - `245678`\n * Format - int64\n @property bucketId (`string`) - ID of the bucket containing the file.\n * Example - `\"users-bucket\"`\n @property etag (`string`) - Entity tag for cache validation.\n * Example - `\"\\\"a1b2c3d4e5f6\\\"\"`\n @property createdAt (`string`) - Timestamp when the file was created.\n * Example - `\"2023-01-15T12:34:56Z\"`\n * Format - date-time\n @property updatedAt (`string`) - Timestamp when the file was last updated.\n * Example - `\"2023-01-16T09:45:32Z\"`\n * Format - date-time\n @property isUploaded (`boolean`) - Whether the file has been successfully uploaded.\n * Example - `true`\n @property mimeType (`string`) - MIME type of the file.\n * Example - `\"image/jpeg\"`\n @property uploadedByUserId? (`string`) - ID of the user who uploaded the file.\n * Example - `\"abc123def456\"`\n @property metadata? (`Record<string, unknown>`) - Custom metadata associated with the file.\n * Example - `{\"alt\":\"Profile picture\",\"category\":\"avatar\"}`*/\nexport interface FileMetadata {\n /**\n * Unique identifier for the file.\n * Example - `\"d5e76ceb-77a2-4153-b7da-1f7c115b2ff2\"`\n */\n id: string;\n /**\n * Name of the file including extension.\n * Example - `\"profile-picture.jpg\"`\n */\n name: string;\n /**\n * Size of the file in bytes.\n * Example - `245678`\n * Format - int64\n */\n size: number;\n /**\n * ID of the bucket containing the file.\n * Example - `\"users-bucket\"`\n */\n bucketId: string;\n /**\n * Entity tag for cache validation.\n * Example - `\"\\\"a1b2c3d4e5f6\\\"\"`\n */\n etag: string;\n /**\n * Timestamp when the file was created.\n * Example - `\"2023-01-15T12:34:56Z\"`\n * Format - date-time\n */\n createdAt: string;\n /**\n * Timestamp when the file was last updated.\n * Example - `\"2023-01-16T09:45:32Z\"`\n * Format - date-time\n */\n updatedAt: string;\n /**\n * Whether the file has been successfully uploaded.\n * Example - `true`\n */\n isUploaded: boolean;\n /**\n * MIME type of the file.\n * Example - `\"image/jpeg\"`\n */\n mimeType: string;\n /**\n * ID of the user who uploaded the file.\n * Example - `\"abc123def456\"`\n */\n uploadedByUserId?: string;\n /**\n * Custom metadata associated with the file.\n * Example - `{\"alt\":\"Profile picture\",\"category\":\"avatar\"}`\n */\n metadata?: Record<string, unknown>;\n}\n\n/**\n * Basic information about a file in storage.\n @property id (`string`) - Unique identifier for the file.\n * Example - `\"d5e76ceb-77a2-4153-b7da-1f7c115b2ff2\"`\n @property name (`string`) - Name of the file including extension.\n * Example - `\"profile-picture.jpg\"`\n @property bucketId (`string`) - ID of the bucket containing the file.\n * Example - `\"users-bucket\"`\n @property isUploaded (`boolean`) - Whether the file has been successfully uploaded.\n * Example - `true`*/\nexport interface FileSummary {\n /**\n * Unique identifier for the file.\n * Example - `\"d5e76ceb-77a2-4153-b7da-1f7c115b2ff2\"`\n */\n id: string;\n /**\n * Name of the file including extension.\n * Example - `\"profile-picture.jpg\"`\n */\n name: string;\n /**\n * ID of the bucket containing the file.\n * Example - `\"users-bucket\"`\n */\n bucketId: string;\n /**\n * Whether the file has been successfully uploaded.\n * Example - `true`\n */\n isUploaded: boolean;\n}\n\n/**\n * Contains a presigned URL for direct file operations.\n @property url (`string`) - The presigned URL for file operations.\n * Example - `\"https://storage.example.com/files/abc123?signature=xyz\"`\n @property expiration (`number`) - The time in seconds until the URL expires.\n * Example - `3600`*/\nexport interface PresignedURLResponse {\n /**\n * The presigned URL for file operations.\n * Example - `\"https://storage.example.com/files/abc123?signature=xyz\"`\n */\n url: string;\n /**\n * The time in seconds until the URL expires.\n * Example - `3600`\n */\n expiration: number;\n}\n\n/**\n * Metadata that can be updated for an existing file.\n @property name? (`string`) - New name to assign to the file.\n * Example - `\"renamed-file.jpg\"`\n @property metadata? (`Record<string, unknown>`) - Updated custom metadata to associate with the file.\n * Example - `{\"alt\":\"Updated image description\",\"category\":\"profile\"}`*/\nexport interface UpdateFileMetadata {\n /**\n * New name to assign to the file.\n * Example - `\"renamed-file.jpg\"`\n */\n name?: string;\n /**\n * Updated custom metadata to associate with the file.\n * Example - `{\"alt\":\"Updated image description\",\"category\":\"profile\"}`\n */\n metadata?: Record<string, unknown>;\n}\n\n/**\n * Metadata provided when uploading a new file.\n @property id? (`string`) - Optional custom ID for the file. If not provided, a UUID will be generated.\n * Example - `\"custom-id-123\"`\n @property name? (`string`) - Name to assign to the file. If not provided, the original filename will be used.\n * Example - `\"custom-filename.png\"`\n @property metadata? (`Record<string, unknown>`) - Custom metadata to associate with the file.\n * Example - `{\"alt\":\"Custom image\",\"category\":\"document\"}`*/\nexport interface UploadFileMetadata {\n /**\n * Optional custom ID for the file. If not provided, a UUID will be generated.\n * Example - `\"custom-id-123\"`\n */\n id?: string;\n /**\n * Name to assign to the file. If not provided, the original filename will be used.\n * Example - `\"custom-filename.png\"`\n */\n name?: string;\n /**\n * Custom metadata to associate with the file.\n * Example - `{\"alt\":\"Custom image\",\"category\":\"document\"}`\n */\n metadata?: Record<string, unknown>;\n}\n\n/**\n * Contains version information about the storage service.\n @property buildVersion (`string`) - The version number of the storage service build.\n * Example - `\"1.2.3\"`*/\nexport interface VersionInformation {\n /**\n * The version number of the storage service build.\n * Example - `\"1.2.3\"`\n */\n buildVersion: string;\n}\n\n/**\n * Output format for image files. Use 'auto' for content negotiation based on Accept header\n */\nexport type OutputImageFormat =\n | 'auto'\n | 'same'\n | 'jpeg'\n | 'webp'\n | 'png'\n | 'avif'\n | 'heic';\n\n/**\n * \n @property bucket-id? (`string`) - Target bucket identifier where files will be stored.\n * Example - `\"user-uploads\"`\n @property metadata[]? (`UploadFileMetadata[]`) - Optional custom metadata for each uploaded file. Must match the order of the file[] array.\n @property file[] (`Blob[]`) - Array of files to upload.*/\nexport interface UploadFilesBody {\n /**\n * Target bucket identifier where files will be stored.\n * Example - `\"user-uploads\"`\n */\n 'bucket-id'?: string;\n /**\n * Optional custom metadata for each uploaded file. Must match the order of the file[] array.\n */\n 'metadata[]'?: UploadFileMetadata[];\n /**\n * Array of files to upload.\n */\n 'file[]': Blob[];\n}\n\n/**\n * \n @property processedFiles (`FileMetadata[]`) - List of successfully processed files with their metadata.*/\nexport interface UploadFilesResponse201 {\n /**\n * List of successfully processed files with their metadata.\n */\n processedFiles: FileMetadata[];\n}\n\n/**\n * \n @property metadata? (`UpdateFileMetadata`) - Metadata that can be updated for an existing file.\n @property file? (`Blob`) - New file content to replace the existing file\n * Format - binary*/\nexport interface ReplaceFileBody {\n /**\n * Metadata that can be updated for an existing file.\n */\n metadata?: UpdateFileMetadata;\n /**\n * New file content to replace the existing file\n * Format - binary\n */\n file?: Blob;\n}\n\n/**\n * \n @property metadata? (`FileSummary[]`) - */\nexport interface DeleteBrokenMetadataResponse200 {\n /**\n *\n */\n metadata?: FileSummary[];\n}\n\n/**\n * \n @property files? (`string[]`) - */\nexport interface DeleteOrphanedFilesResponse200 {\n /**\n *\n */\n files?: string[];\n}\n\n/**\n * \n @property metadata? (`FileSummary[]`) - */\nexport interface ListBrokenMetadataResponse200 {\n /**\n *\n */\n metadata?: FileSummary[];\n}\n\n/**\n * \n @property metadata? (`FileSummary[]`) - */\nexport interface ListFilesNotUploadedResponse200 {\n /**\n *\n */\n metadata?: FileSummary[];\n}\n\n/**\n * \n @property files? (`string[]`) - */\nexport interface ListOrphanedFilesResponse200 {\n /**\n *\n */\n files?: string[];\n}\n\n/**\n * Parameters for the getFile method.\n @property q? (number) - Image quality (1-100). Only applies to JPEG, WebP, AVIF and HEIC files\n \n @property h? (number) - Maximum height to resize image to while maintaining aspect ratio. Only applies to image files\n \n @property w? (number) - Maximum width to resize image to while maintaining aspect ratio. Only applies to image files\n \n @property b? (number) - Blur the image using this sigma value. Only applies to image files\n \n @property f? (OutputImageFormat) - Output format for image files. Use 'auto' for content negotiation based on Accept header\n \n * Output format for image files. Use 'auto' for content negotiation based on Accept header*/\nexport interface GetFileParams {\n /**\n * Image quality (1-100). Only applies to JPEG, WebP, AVIF and HEIC files\n \n */\n q?: number;\n /**\n * Maximum height to resize image to while maintaining aspect ratio. Only applies to image files\n \n */\n h?: number;\n /**\n * Maximum width to resize image to while maintaining aspect ratio. Only applies to image files\n \n */\n w?: number;\n /**\n * Blur the image using this sigma value. Only applies to image files\n \n */\n b?: number;\n /**\n * Output format for image files. Use 'auto' for content negotiation based on Accept header\n \n * Output format for image files. Use 'auto' for content negotiation based on Accept header\n */\n f?: OutputImageFormat;\n}\n/**\n * Parameters for the getFileMetadataHeaders method.\n @property q? (number) - Image quality (1-100). Only applies to JPEG, WebP, AVIF and HEIC files\n \n @property h? (number) - Maximum height to resize image to while maintaining aspect ratio. Only applies to image files\n \n @property w? (number) - Maximum width to resize image to while maintaining aspect ratio. Only applies to image files\n \n @property b? (number) - Blur the image using this sigma value. Only applies to image files\n \n @property f? (OutputImageFormat) - Output format for image files. Use 'auto' for content negotiation based on Accept header\n \n * Output format for image files. Use 'auto' for content negotiation based on Accept header*/\nexport interface GetFileMetadataHeadersParams {\n /**\n * Image quality (1-100). Only applies to JPEG, WebP, AVIF and HEIC files\n \n */\n q?: number;\n /**\n * Maximum height to resize image to while maintaining aspect ratio. Only applies to image files\n \n */\n h?: number;\n /**\n * Maximum width to resize image to while maintaining aspect ratio. Only applies to image files\n \n */\n w?: number;\n /**\n * Blur the image using this sigma value. Only applies to image files\n \n */\n b?: number;\n /**\n * Output format for image files. Use 'auto' for content negotiation based on Accept header\n \n * Output format for image files. Use 'auto' for content negotiation based on Accept header\n */\n f?: OutputImageFormat;\n}\n\nexport interface Client {\n baseURL: string;\n\n /** Add a middleware function to the fetch chain\n * @param chainFunction - The middleware function to add\n */\n pushChainFunction(chainFunction: ChainFunction): void;\n /**\n Summary: Upload files\n Upload one or more files to a specified bucket. Supports batch uploading with optional custom metadata for each file. If uploading multiple files, either provide metadata for all files or none.\n\n This method may return different T based on the response code:\n - 201: UploadFilesResponse201\n */\n uploadFiles(\n body: UploadFilesBody,\n options?: RequestInit,\n ): Promise<FetchResponse<UploadFilesResponse201>>;\n\n /**\n Summary: Delete file\n Permanently delete a file from storage. This removes both the file content and its associated metadata.\n\n This method may return different T based on the response code:\n - 204: void\n */\n deleteFile(id: string, options?: RequestInit): Promise<FetchResponse<void>>;\n\n /**\n Summary: Download file\n Retrieve and download the complete file content. Supports conditional requests, image transformations, and range requests for partial downloads.\n\n This method may return different T based on the response code:\n - 200: void\n - 206: void\n - 304: void\n - 412: void\n */\n getFile(\n id: string,\n params?: GetFileParams,\n options?: RequestInit,\n ): Promise<FetchResponse<Blob>>;\n\n /**\n Summary: Check file information\n Retrieve file metadata headers without downloading the file content. Supports conditional requests and provides caching information.\n\n This method may return different T based on the response code:\n - 200: void\n - 304: void\n - 412: void\n */\n getFileMetadataHeaders(\n id: string,\n params?: GetFileMetadataHeadersParams,\n options?: RequestInit,\n ): Promise<FetchResponse<void>>;\n\n /**\n Summary: Replace file\n Replace an existing file with new content while preserving the file ID. The operation follows these steps:\n1. The isUploaded flag is set to false to mark the file as being updated\n2. The file content is replaced in the storage backend\n3. File metadata is updated (size, mime-type, isUploaded, etc.)\n\nEach step is atomic, but if a step fails, previous steps will not be automatically rolled back.\n\n\n This method may return different T based on the response code:\n - 200: FileMetadata\n */\n replaceFile(\n id: string,\n body: ReplaceFileBody,\n options?: RequestInit,\n ): Promise<FetchResponse<FileMetadata>>;\n\n /**\n Summary: Retrieve presigned URL to retrieve the file\n Retrieve presigned URL to retrieve the file. Expiration of the URL is\ndetermined by bucket configuration\n\n\n This method may return different T based on the response code:\n - 200: PresignedURLResponse\n */\n getFilePresignedURL(\n id: string,\n options?: RequestInit,\n ): Promise<FetchResponse<PresignedURLResponse>>;\n\n /**\n Summary: Delete broken metadata\n Broken metadata is defined as metadata that has isUploaded = true but there is no file in the storage matching it. This is an admin operation that requires the Hasura admin secret.\n\n This method may return different T based on the response code:\n - 200: DeleteBrokenMetadataResponse200\n */\n deleteBrokenMetadata(\n options?: RequestInit,\n ): Promise<FetchResponse<DeleteBrokenMetadataResponse200>>;\n\n /**\n Summary: Deletes orphaned files\n Orphaned files are files that are present in the storage but have no associated metadata. This is an admin operation that requires the Hasura admin secret.\n\n This method may return different T based on the response code:\n - 200: DeleteOrphanedFilesResponse200\n */\n deleteOrphanedFiles(\n options?: RequestInit,\n ): Promise<FetchResponse<DeleteOrphanedFilesResponse200>>;\n\n /**\n Summary: Lists broken metadata\n Broken metadata is defined as metadata that has isUploaded = true but there is no file in the storage matching it. This is an admin operation that requires the Hasura admin secret.\n\n This method may return different T based on the response code:\n - 200: ListBrokenMetadataResponse200\n */\n listBrokenMetadata(\n options?: RequestInit,\n ): Promise<FetchResponse<ListBrokenMetadataResponse200>>;\n\n /**\n Summary: Lists files that haven't been uploaded\n That is, metadata that has isUploaded = false. This is an admin operation that requires the Hasura admin secret.\n\n This method may return different T based on the response code:\n - 200: ListFilesNotUploadedResponse200\n */\n listFilesNotUploaded(\n options?: RequestInit,\n ): Promise<FetchResponse<ListFilesNotUploadedResponse200>>;\n\n /**\n Summary: Lists orphaned files\n Orphaned files are files that are present in the storage but have no associated metadata. This is an admin operation that requires the Hasura admin secret.\n\n This method may return different T based on the response code:\n - 200: ListOrphanedFilesResponse200\n */\n listOrphanedFiles(\n options?: RequestInit,\n ): Promise<FetchResponse<ListOrphanedFilesResponse200>>;\n\n /**\n Summary: Get service version information\n Retrieves build and version information about the storage service. Useful for monitoring and debugging.\n\n This method may return different T based on the response code:\n - 200: VersionInformation\n */\n getVersion(options?: RequestInit): Promise<FetchResponse<VersionInformation>>;\n}\n\nexport const createAPIClient = (\n baseURL: string,\n chainFunctions: ChainFunction[] = [],\n): Client => {\n let fetch = createEnhancedFetch(chainFunctions);\n\n const pushChainFunction = (chainFunction: ChainFunction) => {\n chainFunctions.push(chainFunction);\n fetch = createEnhancedFetch(chainFunctions);\n };\n const uploadFiles = async (\n body: UploadFilesBody,\n options?: RequestInit,\n ): Promise<FetchResponse<UploadFilesResponse201>> => {\n const url = `${baseURL}/files`;\n const formData = new FormData();\n const isReactNative =\n typeof navigator !== 'undefined' &&\n (navigator as { product?: string }).product === 'ReactNative';\n if (body['bucket-id'] !== undefined) {\n formData.append('bucket-id', body['bucket-id']);\n }\n if (body['metadata[]'] !== undefined) {\n body['metadata[]'].forEach((value) => {\n if (isReactNative) {\n formData.append('metadata[]', {\n string: JSON.stringify(value),\n type: 'application/json',\n name: '',\n } as unknown as Blob);\n } else {\n formData.append(\n 'metadata[]',\n new Blob([JSON.stringify(value)], { type: 'application/json' }),\n '',\n );\n }\n });\n }\n if (body['file[]'] !== undefined) {\n body['file[]'].forEach((value) => {\n formData.append('file[]', value);\n });\n }\n\n const res = await fetch(url, {\n ...options,\n method: 'POST',\n body: formData,\n });\n\n if (res.status >= 300) {\n const responseBody = [412].includes(res.status) ? null : await res.text();\n const payload: unknown = responseBody ? JSON.parse(responseBody) : {};\n throw new FetchError(payload, res.status, res.headers);\n }\n\n const responseBody = [204, 205, 304].includes(res.status)\n ? null\n : await res.text();\n const payload: UploadFilesResponse201 = responseBody\n ? JSON.parse(responseBody)\n : {};\n\n return {\n body: payload,\n status: res.status,\n headers: res.headers,\n } as FetchResponse<UploadFilesResponse201>;\n };\n\n const deleteFile = async (\n id: string,\n options?: RequestInit,\n ): Promise<FetchResponse<void>> => {\n const url = `${baseURL}/files/${id}`;\n const res = await fetch(url, {\n ...options,\n method: 'DELETE',\n headers: {\n ...options?.headers,\n },\n });\n\n if (res.status >= 300) {\n const responseBody = [412].includes(res.status) ? null : await res.text();\n const payload: unknown = responseBody ? JSON.parse(responseBody) : {};\n throw new FetchError(payload, res.status, res.headers);\n }\n\n const payload: undefined = undefined;\n\n return {\n body: payload,\n status: res.status,\n headers: res.headers,\n } as FetchResponse<void>;\n };\n\n const getFile = async (\n id: string,\n params?: GetFileParams,\n options?: RequestInit,\n ): Promise<FetchResponse<Blob>> => {\n const encodedParameters =\n params &&\n Object.entries(params)\n .flatMap(([key, value]) => {\n // Default handling (scalars or explode: false)\n const stringValue = Array.isArray(value)\n ? value.join(',')\n : typeof value === 'object' && value !== null\n ? JSON.stringify(value)\n : String(value);\n return [`${key}=${encodeURIComponent(stringValue)}`];\n })\n .join('&');\n\n const url = encodedParameters\n ? `${baseURL}/files/${id}?${encodedParameters}`\n : `${baseURL}/files/${id}`;\n const res = await fetch(url, {\n ...options,\n method: 'GET',\n headers: {\n ...options?.headers,\n },\n });\n\n if (res.status >= 300) {\n const responseBody = [412].includes(res.status) ? null : await res.text();\n const payload: unknown = responseBody ? JSON.parse(responseBody) : {};\n throw new FetchError(payload, res.status, res.headers);\n }\n\n const payload: Blob = await res.blob();\n\n return {\n body: payload,\n status: res.status,\n headers: res.headers,\n } as FetchResponse<Blob>;\n };\n\n const getFileMetadataHeaders = async (\n id: string,\n params?: GetFileMetadataHeadersParams,\n options?: RequestInit,\n ): Promise<FetchResponse<void>> => {\n const encodedParameters =\n params &&\n Object.entries(params)\n .flatMap(([key, value]) => {\n // Default handling (scalars or explode: false)\n const stringValue = Array.isArray(value)\n ? value.join(',')\n : typeof value === 'object' && value !== null\n ? JSON.stringify(value)\n : String(value);\n return [`${key}=${encodeURIComponent(stringValue)}`];\n })\n .join('&');\n\n const url = encodedParameters\n ? `${baseURL}/files/${id}?${encodedParameters}`\n : `${baseURL}/files/${id}`;\n const res = await fetch(url, {\n ...options,\n method: 'HEAD',\n headers: {\n ...options?.headers,\n },\n });\n\n if (res.status >= 300) {\n const responseBody = [412].includes(res.status) ? null : await res.text();\n const payload: unknown = responseBody ? JSON.parse(responseBody) : {};\n throw new FetchError(payload, res.status, res.headers);\n }\n\n const payload: undefined = undefined;\n\n return {\n body: payload,\n status: res.status,\n headers: res.headers,\n } as FetchResponse<void>;\n };\n\n const replaceFile = async (\n id: string,\n body: ReplaceFileBody,\n options?: RequestInit,\n ): Promise<FetchResponse<FileMetadata>> => {\n const url = `${baseURL}/files/${id}`;\n const formData = new FormData();\n const isReactNative =\n typeof navigator !== 'undefined' &&\n (navigator as { product?: string }).product === 'ReactNative';\n if (body['metadata'] !== undefined) {\n if (isReactNative) {\n formData.append('metadata', {\n string: JSON.stringify(body['metadata']),\n type: 'application/json',\n name: '',\n } as unknown as Blob);\n } else {\n formData.append(\n 'metadata',\n new Blob([JSON.stringify(body['metadata'])], {\n type: 'application/json',\n }),\n '',\n );\n }\n }\n if (body['file'] !== undefined) {\n formData.append('file', body['file']);\n }\n\n const res = await fetch(url, {\n ...options,\n method: 'PUT',\n body: formData,\n });\n\n if (res.status >= 300) {\n const responseBody = [412].includes(res.status) ? null : await res.text();\n const payload: unknown = responseBody ? JSON.parse(responseBody) : {};\n throw new FetchError(payload, res.status, res.headers);\n }\n\n const responseBody = [204, 205, 304].includes(res.status)\n ? null\n : await res.text();\n const payload: FileMetadata = responseBody ? JSON.parse(responseBody) : {};\n\n return {\n body: payload,\n status: res.status,\n headers: res.headers,\n } as FetchResponse<FileMetadata>;\n };\n\n const getFilePresignedURL = async (\n id: string,\n options?: RequestInit,\n ): Promise<FetchResponse<PresignedURLResponse>> => {\n const url = `${baseURL}/files/${id}/presignedurl`;\n const res = await fetch(url, {\n ...options,\n method: 'GET',\n headers: {\n ...options?.headers,\n },\n });\n\n if (res.status >= 300) {\n const responseBody = [412].includes(res.status) ? null : await res.text();\n const payload: unknown = responseBody ? JSON.parse(responseBody) : {};\n throw new FetchError(payload, res.status, res.headers);\n }\n\n const responseBody = [204, 205, 304].includes(res.status)\n ? null\n : await res.text();\n const payload: PresignedURLResponse = responseBody\n ? JSON.parse(responseBody)\n : {};\n\n return {\n body: payload,\n status: res.status,\n headers: res.headers,\n } as FetchResponse<PresignedURLResponse>;\n };\n\n const deleteBrokenMetadata = async (\n options?: RequestInit,\n ): Promise<FetchResponse<DeleteBrokenMetadataResponse200>> => {\n const url = `${baseURL}/ops/delete-broken-metadata`;\n const res = await fetch(url, {\n ...options,\n method: 'POST',\n headers: {\n ...options?.headers,\n },\n });\n\n if (res.status >= 300) {\n const responseBody = [412].includes(res.status) ? null : await res.text();\n const payload: unknown = responseBody ? JSON.parse(responseBody) : {};\n throw new FetchError(payload, res.status, res.headers);\n }\n\n const responseBody = [204, 205, 304].includes(res.status)\n ? null\n : await res.text();\n const payload: DeleteBrokenMetadataResponse200 = responseBody\n ? JSON.parse(responseBody)\n : {};\n\n return {\n body: payload,\n status: res.status,\n headers: res.headers,\n } as FetchResponse<DeleteBrokenMetadataResponse200>;\n };\n\n const deleteOrphanedFiles = async (\n options?: RequestInit,\n ): Promise<FetchResponse<DeleteOrphanedFilesResponse200>> => {\n const url = `${baseURL}/ops/delete-orphans`;\n const res = await fetch(url, {\n ...options,\n method: 'POST',\n headers: {\n ...options?.headers,\n },\n });\n\n if (res.status >= 300) {\n const responseBody = [412].includes(res.status) ? null : await res.text();\n const payload: unknown = responseBody ? JSON.parse(responseBody) : {};\n throw new FetchError(payload, res.status, res.headers);\n }\n\n const responseBody = [204, 205, 304].includes(res.status)\n ? null\n : await res.text();\n const payload: DeleteOrphanedFilesResponse200 = responseBody\n ? JSON.parse(responseBody)\n : {};\n\n return {\n body: payload,\n status: res.status,\n headers: res.headers,\n } as FetchResponse<DeleteOrphanedFilesResponse200>;\n };\n\n const listBrokenMetadata = async (\n options?: RequestInit,\n ): Promise<FetchResponse<ListBrokenMetadataResponse200>> => {\n const url = `${baseURL}/ops/list-broken-metadata`;\n const res = await fetch(url, {\n ...options,\n method: 'POST',\n headers: {\n ...options?.headers,\n },\n });\n\n if (res.status >= 300) {\n const responseBody = [412].includes(res.status) ? null : await res.text();\n const payload: unknown = responseBody ? JSON.parse(responseBody) : {};\n throw new FetchError(payload, res.status, res.headers);\n }\n\n const responseBody = [204, 205, 304].includes(res.status)\n ? null\n : await res.text();\n const payload: ListBrokenMetadataResponse200 = responseBody\n ? JSON.parse(responseBody)\n : {};\n\n return {\n body: payload,\n status: res.status,\n headers: res.headers,\n } as FetchResponse<ListBrokenMetadataResponse200>;\n };\n\n const listFilesNotUploaded = async (\n options?: RequestInit,\n ): Promise<FetchResponse<ListFilesNotUploadedResponse200>> => {\n const url = `${baseURL}/ops/list-not-uploaded`;\n const res = await fetch(url, {\n ...options,\n method: 'POST',\n headers: {\n ...options?.headers,\n },\n });\n\n if (res.status >= 300) {\n const responseBody = [412].includes(res.status) ? null : await res.text();\n const payload: unknown = responseBody ? JSON.parse(responseBody) : {};\n throw new FetchError(payload, res.status, res.headers);\n }\n\n const responseBody = [204, 205, 304].includes(res.status)\n ? null\n : await res.text();\n const payload: ListFilesNotUploadedResponse200 = responseBody\n ? JSON.parse(responseBody)\n : {};\n\n return {\n body: payload,\n status: res.status,\n headers: res.headers,\n } as FetchResponse<ListFilesNotUploadedResponse200>;\n };\n\n const listOrphanedFiles = async (\n options?: RequestInit,\n ): Promise<FetchResponse<ListOrphanedFilesResponse200>> => {\n const url = `${baseURL}/ops/list-orphans`;\n const res = await fetch(url, {\n ...options,\n method: 'POST',\n headers: {\n ...options?.headers,\n },\n });\n\n if (res.status >= 300) {\n const responseBody = [412].includes(res.status) ? null : await res.text();\n const payload: unknown = responseBody ? JSON.parse(responseBody) : {};\n throw new FetchError(payload, res.status, res.headers);\n }\n\n const responseBody = [204, 205, 304].includes(res.status)\n ? null\n : await res.text();\n const payload: ListOrphanedFilesResponse200 = responseBody\n ? JSON.parse(responseBody)\n : {};\n\n return {\n body: payload,\n status: res.status,\n headers: res.headers,\n } as FetchResponse<ListOrphanedFilesResponse200>;\n };\n\n const getVersion = async (\n options?: RequestInit,\n ): Promise<FetchResponse<VersionInformation>> => {\n const url = `${baseURL}/version`;\n const res = await fetch(url, {\n ...options,\n method: 'GET',\n headers: {\n ...options?.headers,\n },\n });\n\n if (res.status >= 300) {\n const responseBody = [412].includes(res.status) ? null : await res.text();\n const payload: unknown = responseBody ? JSON.parse(responseBody) : {};\n throw new FetchError(payload, res.status, res.headers);\n }\n\n const responseBody = [204, 205, 304].includes(res.status)\n ? null\n : await res.text();\n const payload: VersionInformation = responseBody\n ? JSON.parse(responseBody)\n : {};\n\n return {\n body: payload,\n status: res.status,\n headers: res.headers,\n } as FetchResponse<VersionInformation>;\n };\n\n return {\n baseURL,\n pushChainFunction,\n uploadFiles,\n deleteFile,\n getFile,\n getFileMetadataHeaders,\n replaceFile,\n getFilePresignedURL,\n deleteBrokenMetadata,\n deleteOrphanedFiles,\n listBrokenMetadata,\n listFilesNotUploaded,\n listOrphanedFiles,\n getVersion,\n };\n};\n"],"names":["baseURL","chainFunctions","fetch","createEnhancedFetch","pushChainFunction","chainFunction","push","uploadFiles","async","body","options","url","formData","FormData","isReactNative","navigator","product","append","forEach","value","string","JSON","stringify","type","name","Blob","res","method","status","responseBody","includes","text","payload","parse","FetchError","headers","deleteFile","id","getFile","params","encodedParameters","Object","entries","flatMap","key","stringValue","Array","isArray","join","String","encodeURIComponent","blob","getFileMetadataHeaders","replaceFile","getFilePresignedURL","deleteBrokenMetadata","deleteOrphanedFiles","listBrokenMetadata","listFilesNotUploaded","listOrphanedFiles","getVersion"],"mappings":"iJA2mB+B,CAC7BA,EACAC,EAAkC,MAElC,IAAIC,EAAQC,EAAAA,oBAAoBF,GAidhC,MAAO,CACLD,UACAI,kBAjdyBC,IACzBJ,EAAeK,KAAKD,GACpBH,EAAQC,EAAAA,oBAAoBF,EAAc,EAgd1CM,YA9ckBC,MAClBC,EACAC,KAEA,MAAMC,EAAM,GAAGX,UACTY,EAAW,IAAIC,SACfC,EACiB,oBAAdC,WACyC,gBAA/CA,UAAmCC,aACZ,IAAtBP,EAAK,cACPG,EAASK,OAAO,YAAaR,EAAK,mBAET,IAAvBA,EAAK,eACPA,EAAK,cAAcS,SAASC,IACtBL,EACFF,EAASK,OAAO,aAAc,CAC5BG,OAAQC,KAAKC,UAAUH,GACvBI,KAAM,mBACNC,KAAM,KAGRZ,EAASK,OACP,aACA,IAAIQ,KAAK,CAACJ,KAAKC,UAAUH,IAAS,CAAEI,KAAM,qBAC1C,GAEJ,SAGmB,IAAnBd,EAAK,WACPA,EAAK,UAAUS,SAASC,IACtBP,EAASK,OAAO,SAAUE,EAAK,IAInC,MAAMO,QAAYxB,EAAMS,EAAK,IACxBD,EACHiB,OAAQ,OACRlB,KAAMG,IAGR,GAAIc,EAAIE,QAAU,IAAK,CACrB,MAAMC,EAAe,CAAC,KAAKC,SAASJ,EAAIE,QAAU,WAAaF,EAAIK,OAC7DC,EAAmBH,EAAeR,KAAKY,MAAMJ,GAAgB,CAAA,EACnE,MAAM,IAAIK,EAAAA,WAAWF,EAASN,EAAIE,OAAQF,EAAIS,QAChD,CAEA,MAAMN,EAAe,CAAC,IAAK,IAAK,KAAKC,SAASJ,EAAIE,QAC9C,WACMF,EAAIK,OAKd,MAAO,CACLtB,KALsCoB,EACpCR,KAAKY,MAAMJ,GACX,C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F,EAAIE,OACZO,QAAST,EAAIS,QAAA,EAkDfyB,WA9CiBpD,MACjBE,IAEA,MAAMC,EAAM,GAAGX,YACT0B,QAAYxB,EAAMS,EAAK,IACxBD,EACHiB,OAAQ,MACRQ,QAAS,IACJzB,GAASyB,WAIhB,GAAIT,EAAIE,QAAU,IAAK,CACrB,MAAMC,EAAe,CAAC,KAAKC,SAASJ,EAAIE,QAAU,WAAaF,EAAIK,OAC7DC,EAAmBH,EAAeR,KAAKY,MAAMJ,GAAgB,CAAA,EACnE,MAAM,IAAIK,EAAAA,WAAWF,EAASN,EAAIE,OAAQF,EAAIS,QAChD,CAEA,MAAMN,EAAe,CAAC,IAAK,IAAK,KAAKC,SAASJ,EAAIE,QAC9C,WACMF,EAAIK,OAKd,MAAO,CACLtB,KALkCoB,EAChCR,KAAKY,MAAMJ,GACX,CAAA,EAIFD,OAAQF,EAAIE,OACZO,QAAST,EAAIS,QAAA,EAkBf"}
|
|
1
|
+
{"version":3,"file":"storage.cjs","names":[],"sources":["../../src/storage/client.ts"],"sourcesContent":["/**\n * This file is auto-generated. Do not edit manually.\n */\n\nimport type { ChainFunction, FetchResponse } from '../fetch';\nimport { createEnhancedFetch, FetchError } from '../fetch';\n\n/**\n * Date in RFC 2822 format\n */\nexport type RFC2822Date = string;\n\n/**\n * Error details.\n @property message (`string`) - Human-readable error message.\n * Example - `\"File not found\"`\n @property data? (`Record<string, unknown>`) - Additional data related to the error, if any.*/\nexport interface ErrorResponseError {\n /**\n * Human-readable error message.\n * Example - `\"File not found\"`\n */\n message: string;\n /**\n * Additional data related to the error, if any.\n */\n data?: Record<string, unknown>;\n}\n\n/**\n * Error information returned by the API.\n @property error? (`ErrorResponseError`) - Error details.*/\nexport interface ErrorResponse {\n /**\n * Error details.\n */\n error?: ErrorResponseError;\n}\n\n/**\n * Error details.\n @property message (`string`) - Human-readable error message.\n * Example - `\"File not found\"`\n @property data? (`Record<string, unknown>`) - Additional data related to the error, if any.*/\nexport interface ErrorResponseWithProcessedFilesError {\n /**\n * Human-readable error message.\n * Example - `\"File not found\"`\n */\n message: string;\n /**\n * Additional data related to the error, if any.\n */\n data?: Record<string, unknown>;\n}\n\n/**\n * Error information returned by the API.\n @property processedFiles? (`FileMetadata[]`) - List of files that were successfully processed before the error occurred.\n @property error? (`ErrorResponseWithProcessedFilesError`) - Error details.*/\nexport interface ErrorResponseWithProcessedFiles {\n /**\n * List of files that were successfully processed before the error occurred.\n */\n processedFiles?: FileMetadata[];\n /**\n * Error details.\n */\n error?: ErrorResponseWithProcessedFilesError;\n}\n\n/**\n * Comprehensive metadata information about a file in storage.\n @property id (`string`) - Unique identifier for the file.\n * Example - `\"d5e76ceb-77a2-4153-b7da-1f7c115b2ff2\"`\n @property name (`string`) - Name of the file including extension.\n * Example - `\"profile-picture.jpg\"`\n @property size (`number`) - Size of the file in bytes.\n * Example - `245678`\n * Format - int64\n @property bucketId (`string`) - ID of the bucket containing the file.\n * Example - `\"users-bucket\"`\n @property etag (`string`) - Entity tag for cache validation.\n * Example - `\"\\\"a1b2c3d4e5f6\\\"\"`\n @property createdAt (`string`) - Timestamp when the file was created.\n * Example - `\"2023-01-15T12:34:56Z\"`\n * Format - date-time\n @property updatedAt (`string`) - Timestamp when the file was last updated.\n * Example - `\"2023-01-16T09:45:32Z\"`\n * Format - date-time\n @property isUploaded (`boolean`) - Whether the file has been successfully uploaded.\n * Example - `true`\n @property mimeType (`string`) - MIME type of the file.\n * Example - `\"image/jpeg\"`\n @property uploadedByUserId? (`string`) - ID of the user who uploaded the file.\n * Example - `\"abc123def456\"`\n @property metadata? (`Record<string, unknown>`) - Custom metadata associated with the file.\n * Example - `{\"alt\":\"Profile picture\",\"category\":\"avatar\"}`*/\nexport interface FileMetadata {\n /**\n * Unique identifier for the file.\n * Example - `\"d5e76ceb-77a2-4153-b7da-1f7c115b2ff2\"`\n */\n id: string;\n /**\n * Name of the file including extension.\n * Example - `\"profile-picture.jpg\"`\n */\n name: string;\n /**\n * Size of the file in bytes.\n * Example - `245678`\n * Format - int64\n */\n size: number;\n /**\n * ID of the bucket containing the file.\n * Example - `\"users-bucket\"`\n */\n bucketId: string;\n /**\n * Entity tag for cache validation.\n * Example - `\"\\\"a1b2c3d4e5f6\\\"\"`\n */\n etag: string;\n /**\n * Timestamp when the file was created.\n * Example - `\"2023-01-15T12:34:56Z\"`\n * Format - date-time\n */\n createdAt: string;\n /**\n * Timestamp when the file was last updated.\n * Example - `\"2023-01-16T09:45:32Z\"`\n * Format - date-time\n */\n updatedAt: string;\n /**\n * Whether the file has been successfully uploaded.\n * Example - `true`\n */\n isUploaded: boolean;\n /**\n * MIME type of the file.\n * Example - `\"image/jpeg\"`\n */\n mimeType: string;\n /**\n * ID of the user who uploaded the file.\n * Example - `\"abc123def456\"`\n */\n uploadedByUserId?: string;\n /**\n * Custom metadata associated with the file.\n * Example - `{\"alt\":\"Profile picture\",\"category\":\"avatar\"}`\n */\n metadata?: Record<string, unknown>;\n}\n\n/**\n * Basic information about a file in storage.\n @property id (`string`) - Unique identifier for the file.\n * Example - `\"d5e76ceb-77a2-4153-b7da-1f7c115b2ff2\"`\n @property name (`string`) - Name of the file including extension.\n * Example - `\"profile-picture.jpg\"`\n @property bucketId (`string`) - ID of the bucket containing the file.\n * Example - `\"users-bucket\"`\n @property isUploaded (`boolean`) - Whether the file has been successfully uploaded.\n * Example - `true`*/\nexport interface FileSummary {\n /**\n * Unique identifier for the file.\n * Example - `\"d5e76ceb-77a2-4153-b7da-1f7c115b2ff2\"`\n */\n id: string;\n /**\n * Name of the file including extension.\n * Example - `\"profile-picture.jpg\"`\n */\n name: string;\n /**\n * ID of the bucket containing the file.\n * Example - `\"users-bucket\"`\n */\n bucketId: string;\n /**\n * Whether the file has been successfully uploaded.\n * Example - `true`\n */\n isUploaded: boolean;\n}\n\n/**\n * Contains a presigned URL for direct file operations.\n @property url (`string`) - The presigned URL for file operations.\n * Example - `\"https://storage.example.com/files/abc123?signature=xyz\"`\n @property expiration (`number`) - The time in seconds until the URL expires.\n * Example - `3600`*/\nexport interface PresignedURLResponse {\n /**\n * The presigned URL for file operations.\n * Example - `\"https://storage.example.com/files/abc123?signature=xyz\"`\n */\n url: string;\n /**\n * The time in seconds until the URL expires.\n * Example - `3600`\n */\n expiration: number;\n}\n\n/**\n * Metadata that can be updated for an existing file.\n @property name? (`string`) - New name to assign to the file.\n * Example - `\"renamed-file.jpg\"`\n @property metadata? (`Record<string, unknown>`) - Updated custom metadata to associate with the file.\n * Example - `{\"alt\":\"Updated image description\",\"category\":\"profile\"}`*/\nexport interface UpdateFileMetadata {\n /**\n * New name to assign to the file.\n * Example - `\"renamed-file.jpg\"`\n */\n name?: string;\n /**\n * Updated custom metadata to associate with the file.\n * Example - `{\"alt\":\"Updated image description\",\"category\":\"profile\"}`\n */\n metadata?: Record<string, unknown>;\n}\n\n/**\n * Metadata provided when uploading a new file.\n @property id? (`string`) - Optional custom ID for the file. If not provided, a UUID will be generated.\n * Example - `\"custom-id-123\"`\n @property name? (`string`) - Name to assign to the file. If not provided, the original filename will be used.\n * Example - `\"custom-filename.png\"`\n @property metadata? (`Record<string, unknown>`) - Custom metadata to associate with the file.\n * Example - `{\"alt\":\"Custom image\",\"category\":\"document\"}`*/\nexport interface UploadFileMetadata {\n /**\n * Optional custom ID for the file. If not provided, a UUID will be generated.\n * Example - `\"custom-id-123\"`\n */\n id?: string;\n /**\n * Name to assign to the file. If not provided, the original filename will be used.\n * Example - `\"custom-filename.png\"`\n */\n name?: string;\n /**\n * Custom metadata to associate with the file.\n * Example - `{\"alt\":\"Custom image\",\"category\":\"document\"}`\n */\n metadata?: Record<string, unknown>;\n}\n\n/**\n * Contains version information about the storage service.\n @property buildVersion (`string`) - The version number of the storage service build.\n * Example - `\"1.2.3\"`*/\nexport interface VersionInformation {\n /**\n * The version number of the storage service build.\n * Example - `\"1.2.3\"`\n */\n buildVersion: string;\n}\n\n/**\n * Output format for image files. Use 'auto' for content negotiation based on Accept header\n */\nexport type OutputImageFormat =\n | 'auto'\n | 'same'\n | 'jpeg'\n | 'webp'\n | 'png'\n | 'avif'\n | 'heic';\n\n/**\n * \n @property bucket-id? (`string`) - Target bucket identifier where files will be stored.\n * Example - `\"user-uploads\"`\n @property metadata[]? (`UploadFileMetadata[]`) - Optional custom metadata for each uploaded file. Must match the order of the file[] array.\n @property file[] (`Blob[]`) - Array of files to upload.*/\nexport interface UploadFilesBody {\n /**\n * Target bucket identifier where files will be stored.\n * Example - `\"user-uploads\"`\n */\n 'bucket-id'?: string;\n /**\n * Optional custom metadata for each uploaded file. Must match the order of the file[] array.\n */\n 'metadata[]'?: UploadFileMetadata[];\n /**\n * Array of files to upload.\n */\n 'file[]': Blob[];\n}\n\n/**\n * \n @property processedFiles (`FileMetadata[]`) - List of successfully processed files with their metadata.*/\nexport interface UploadFilesResponse201 {\n /**\n * List of successfully processed files with their metadata.\n */\n processedFiles: FileMetadata[];\n}\n\n/**\n * \n @property metadata? (`UpdateFileMetadata`) - Metadata that can be updated for an existing file.\n @property file? (`Blob`) - New file content to replace the existing file\n * Format - binary*/\nexport interface ReplaceFileBody {\n /**\n * Metadata that can be updated for an existing file.\n */\n metadata?: UpdateFileMetadata;\n /**\n * New file content to replace the existing file\n * Format - binary\n */\n file?: Blob;\n}\n\n/**\n * \n @property metadata? (`FileSummary[]`) - */\nexport interface DeleteBrokenMetadataResponse200 {\n /**\n *\n */\n metadata?: FileSummary[];\n}\n\n/**\n * \n @property files? (`string[]`) - */\nexport interface DeleteOrphanedFilesResponse200 {\n /**\n *\n */\n files?: string[];\n}\n\n/**\n * \n @property metadata? (`FileSummary[]`) - */\nexport interface ListBrokenMetadataResponse200 {\n /**\n *\n */\n metadata?: FileSummary[];\n}\n\n/**\n * \n @property metadata? (`FileSummary[]`) - */\nexport interface ListFilesNotUploadedResponse200 {\n /**\n *\n */\n metadata?: FileSummary[];\n}\n\n/**\n * \n @property files? (`string[]`) - */\nexport interface ListOrphanedFilesResponse200 {\n /**\n *\n */\n files?: string[];\n}\n\n/**\n * Parameters for the getFile method.\n @property q? (number) - Image quality (1-100). Only applies to JPEG, WebP, AVIF and HEIC files\n \n @property h? (number) - Maximum height to resize image to while maintaining aspect ratio. Only applies to image files\n \n @property w? (number) - Maximum width to resize image to while maintaining aspect ratio. Only applies to image files\n \n @property b? (number) - Blur the image using this sigma value. Only applies to image files\n \n @property f? (OutputImageFormat) - Output format for image files. Use 'auto' for content negotiation based on Accept header\n \n * Output format for image files. Use 'auto' for content negotiation based on Accept header*/\nexport interface GetFileParams {\n /**\n * Image quality (1-100). Only applies to JPEG, WebP, AVIF and HEIC files\n \n */\n q?: number;\n /**\n * Maximum height to resize image to while maintaining aspect ratio. Only applies to image files\n \n */\n h?: number;\n /**\n * Maximum width to resize image to while maintaining aspect ratio. Only applies to image files\n \n */\n w?: number;\n /**\n * Blur the image using this sigma value. Only applies to image files\n \n */\n b?: number;\n /**\n * Output format for image files. Use 'auto' for content negotiation based on Accept header\n \n * Output format for image files. Use 'auto' for content negotiation based on Accept header\n */\n f?: OutputImageFormat;\n}\n/**\n * Parameters for the getFileMetadataHeaders method.\n @property q? (number) - Image quality (1-100). Only applies to JPEG, WebP, AVIF and HEIC files\n \n @property h? (number) - Maximum height to resize image to while maintaining aspect ratio. Only applies to image files\n \n @property w? (number) - Maximum width to resize image to while maintaining aspect ratio. Only applies to image files\n \n @property b? (number) - Blur the image using this sigma value. Only applies to image files\n \n @property f? (OutputImageFormat) - Output format for image files. Use 'auto' for content negotiation based on Accept header\n \n * Output format for image files. Use 'auto' for content negotiation based on Accept header*/\nexport interface GetFileMetadataHeadersParams {\n /**\n * Image quality (1-100). Only applies to JPEG, WebP, AVIF and HEIC files\n \n */\n q?: number;\n /**\n * Maximum height to resize image to while maintaining aspect ratio. Only applies to image files\n \n */\n h?: number;\n /**\n * Maximum width to resize image to while maintaining aspect ratio. Only applies to image files\n \n */\n w?: number;\n /**\n * Blur the image using this sigma value. Only applies to image files\n \n */\n b?: number;\n /**\n * Output format for image files. Use 'auto' for content negotiation based on Accept header\n \n * Output format for image files. Use 'auto' for content negotiation based on Accept header\n */\n f?: OutputImageFormat;\n}\n\nexport interface Client {\n baseURL: string;\n\n /** Add a middleware function to the fetch chain\n * @param chainFunction - The middleware function to add\n */\n pushChainFunction(chainFunction: ChainFunction): void;\n /**\n Summary: Upload files\n Upload one or more files to a specified bucket. Supports batch uploading with optional custom metadata for each file. If uploading multiple files, either provide metadata for all files or none.\n\n This method may return different T based on the response code:\n - 201: UploadFilesResponse201\n */\n uploadFiles(\n body: UploadFilesBody,\n options?: RequestInit,\n ): Promise<FetchResponse<UploadFilesResponse201>>;\n\n /**\n Summary: Delete file\n Permanently delete a file from storage. This removes both the file content and its associated metadata.\n\n This method may return different T based on the response code:\n - 204: void\n */\n deleteFile(id: string, options?: RequestInit): Promise<FetchResponse<void>>;\n\n /**\n Summary: Download file\n Retrieve and download the complete file content. Supports conditional requests, image transformations, and range requests for partial downloads.\n\n This method may return different T based on the response code:\n - 200: void\n - 206: void\n - 304: void\n - 412: void\n */\n getFile(\n id: string,\n params?: GetFileParams,\n options?: RequestInit,\n ): Promise<FetchResponse<Blob>>;\n\n /**\n Summary: Check file information\n Retrieve file metadata headers without downloading the file content. Supports conditional requests and provides caching information.\n\n This method may return different T based on the response code:\n - 200: void\n - 304: void\n - 412: void\n */\n getFileMetadataHeaders(\n id: string,\n params?: GetFileMetadataHeadersParams,\n options?: RequestInit,\n ): Promise<FetchResponse<void>>;\n\n /**\n Summary: Replace file\n Replace an existing file with new content while preserving the file ID. The operation follows these steps:\n1. The isUploaded flag is set to false to mark the file as being updated\n2. The file content is replaced in the storage backend\n3. File metadata is updated (size, mime-type, isUploaded, etc.)\n\nEach step is atomic, but if a step fails, previous steps will not be automatically rolled back.\n\n\n This method may return different T based on the response code:\n - 200: FileMetadata\n */\n replaceFile(\n id: string,\n body: ReplaceFileBody,\n options?: RequestInit,\n ): Promise<FetchResponse<FileMetadata>>;\n\n /**\n Summary: Retrieve presigned URL to retrieve the file\n Retrieve presigned URL to retrieve the file. Expiration of the URL is\ndetermined by bucket configuration\n\n\n This method may return different T based on the response code:\n - 200: PresignedURLResponse\n */\n getFilePresignedURL(\n id: string,\n options?: RequestInit,\n ): Promise<FetchResponse<PresignedURLResponse>>;\n\n /**\n Summary: Delete broken metadata\n Broken metadata is defined as metadata that has isUploaded = true but there is no file in the storage matching it. This is an admin operation that requires the Hasura admin secret.\n\n This method may return different T based on the response code:\n - 200: DeleteBrokenMetadataResponse200\n */\n deleteBrokenMetadata(\n options?: RequestInit,\n ): Promise<FetchResponse<DeleteBrokenMetadataResponse200>>;\n\n /**\n Summary: Deletes orphaned files\n Orphaned files are files that are present in the storage but have no associated metadata. This is an admin operation that requires the Hasura admin secret.\n\n This method may return different T based on the response code:\n - 200: DeleteOrphanedFilesResponse200\n */\n deleteOrphanedFiles(\n options?: RequestInit,\n ): Promise<FetchResponse<DeleteOrphanedFilesResponse200>>;\n\n /**\n Summary: Lists broken metadata\n Broken metadata is defined as metadata that has isUploaded = true but there is no file in the storage matching it. This is an admin operation that requires the Hasura admin secret.\n\n This method may return different T based on the response code:\n - 200: ListBrokenMetadataResponse200\n */\n listBrokenMetadata(\n options?: RequestInit,\n ): Promise<FetchResponse<ListBrokenMetadataResponse200>>;\n\n /**\n Summary: Lists files that haven't been uploaded\n That is, metadata that has isUploaded = false. This is an admin operation that requires the Hasura admin secret.\n\n This method may return different T based on the response code:\n - 200: ListFilesNotUploadedResponse200\n */\n listFilesNotUploaded(\n options?: RequestInit,\n ): Promise<FetchResponse<ListFilesNotUploadedResponse200>>;\n\n /**\n Summary: Lists orphaned files\n Orphaned files are files that are present in the storage but have no associated metadata. This is an admin operation that requires the Hasura admin secret.\n\n This method may return different T based on the response code:\n - 200: ListOrphanedFilesResponse200\n */\n listOrphanedFiles(\n options?: RequestInit,\n ): Promise<FetchResponse<ListOrphanedFilesResponse200>>;\n\n /**\n Summary: Get service version information\n Retrieves build and version information about the storage service. Useful for monitoring and debugging.\n\n This method may return different T based on the response code:\n - 200: VersionInformation\n */\n getVersion(options?: RequestInit): Promise<FetchResponse<VersionInformation>>;\n}\n\nexport const createAPIClient = (\n baseURL: string,\n chainFunctions: ChainFunction[] = [],\n): Client => {\n let fetch = createEnhancedFetch(chainFunctions);\n\n const pushChainFunction = (chainFunction: ChainFunction) => {\n chainFunctions.push(chainFunction);\n fetch = createEnhancedFetch(chainFunctions);\n };\n const uploadFiles = async (\n body: UploadFilesBody,\n options?: RequestInit,\n ): Promise<FetchResponse<UploadFilesResponse201>> => {\n const url = `${baseURL}/files`;\n const formData = new FormData();\n const isReactNative =\n typeof navigator !== 'undefined' &&\n (navigator as { product?: string }).product === 'ReactNative';\n if (body['bucket-id'] !== undefined) {\n formData.append('bucket-id', body['bucket-id']);\n }\n if (body['metadata[]'] !== undefined) {\n body['metadata[]'].forEach((value) => {\n if (isReactNative) {\n formData.append('metadata[]', {\n string: JSON.stringify(value),\n type: 'application/json',\n name: '',\n } as unknown as Blob);\n } else {\n formData.append(\n 'metadata[]',\n new Blob([JSON.stringify(value)], { type: 'application/json' }),\n '',\n );\n }\n });\n }\n if (body['file[]'] !== undefined) {\n body['file[]'].forEach((value) => {\n formData.append('file[]', value);\n });\n }\n\n const res = await fetch(url, {\n ...options,\n method: 'POST',\n body: formData,\n });\n\n if (res.status >= 300) {\n const responseBody = [412].includes(res.status) ? null : await res.text();\n const payload: unknown = responseBody ? JSON.parse(responseBody) : {};\n throw new FetchError(payload, res.status, res.headers);\n }\n\n const responseBody = [204, 205, 304].includes(res.status)\n ? null\n : await res.text();\n const payload: UploadFilesResponse201 = responseBody\n ? JSON.parse(responseBody)\n : {};\n\n return {\n body: payload,\n status: res.status,\n headers: res.headers,\n } as FetchResponse<UploadFilesResponse201>;\n };\n\n const deleteFile = async (\n id: string,\n options?: RequestInit,\n ): Promise<FetchResponse<void>> => {\n const url = `${baseURL}/files/${id}`;\n const res = await fetch(url, {\n ...options,\n method: 'DELETE',\n headers: {\n ...options?.headers,\n },\n });\n\n if (res.status >= 300) {\n const responseBody = [412].includes(res.status) ? null : await res.text();\n const payload: unknown = responseBody ? JSON.parse(responseBody) : {};\n throw new FetchError(payload, res.status, res.headers);\n }\n\n const payload: undefined = undefined;\n\n return {\n body: payload,\n status: res.status,\n headers: res.headers,\n } as FetchResponse<void>;\n };\n\n const getFile = async (\n id: string,\n params?: GetFileParams,\n options?: RequestInit,\n ): Promise<FetchResponse<Blob>> => {\n const encodedParameters =\n params &&\n Object.entries(params)\n .flatMap(([key, value]) => {\n // Default handling (scalars or explode: false)\n const stringValue = Array.isArray(value)\n ? value.join(',')\n : typeof value === 'object' && value !== null\n ? JSON.stringify(value)\n : String(value);\n return [`${key}=${encodeURIComponent(stringValue)}`];\n })\n .join('&');\n\n const url = encodedParameters\n ? `${baseURL}/files/${id}?${encodedParameters}`\n : `${baseURL}/files/${id}`;\n const res = await fetch(url, {\n ...options,\n method: 'GET',\n headers: {\n ...options?.headers,\n },\n });\n\n if (res.status >= 300) {\n const responseBody = [412].includes(res.status) ? null : await res.text();\n const payload: unknown = responseBody ? JSON.parse(responseBody) : {};\n throw new FetchError(payload, res.status, res.headers);\n }\n\n const payload: Blob = await res.blob();\n\n return {\n body: payload,\n status: res.status,\n headers: res.headers,\n } as FetchResponse<Blob>;\n };\n\n const getFileMetadataHeaders = async (\n id: string,\n params?: GetFileMetadataHeadersParams,\n options?: RequestInit,\n ): Promise<FetchResponse<void>> => {\n const encodedParameters =\n params &&\n Object.entries(params)\n .flatMap(([key, value]) => {\n // Default handling (scalars or explode: false)\n const stringValue = Array.isArray(value)\n ? value.join(',')\n : typeof value === 'object' && value !== null\n ? JSON.stringify(value)\n : String(value);\n return [`${key}=${encodeURIComponent(stringValue)}`];\n })\n .join('&');\n\n const url = encodedParameters\n ? `${baseURL}/files/${id}?${encodedParameters}`\n : `${baseURL}/files/${id}`;\n const res = await fetch(url, {\n ...options,\n method: 'HEAD',\n headers: {\n ...options?.headers,\n },\n });\n\n if (res.status >= 300) {\n const responseBody = [412].includes(res.status) ? null : await res.text();\n const payload: unknown = responseBody ? JSON.parse(responseBody) : {};\n throw new FetchError(payload, res.status, res.headers);\n }\n\n const payload: undefined = undefined;\n\n return {\n body: payload,\n status: res.status,\n headers: res.headers,\n } as FetchResponse<void>;\n };\n\n const replaceFile = async (\n id: string,\n body: ReplaceFileBody,\n options?: RequestInit,\n ): Promise<FetchResponse<FileMetadata>> => {\n const url = `${baseURL}/files/${id}`;\n const formData = new FormData();\n const isReactNative =\n typeof navigator !== 'undefined' &&\n (navigator as { product?: string }).product === 'ReactNative';\n if (body['metadata'] !== undefined) {\n if (isReactNative) {\n formData.append('metadata', {\n string: JSON.stringify(body['metadata']),\n type: 'application/json',\n name: '',\n } as unknown as Blob);\n } else {\n formData.append(\n 'metadata',\n new Blob([JSON.stringify(body['metadata'])], {\n type: 'application/json',\n }),\n '',\n );\n }\n }\n if (body['file'] !== undefined) {\n formData.append('file', body['file']);\n }\n\n const res = await fetch(url, {\n ...options,\n method: 'PUT',\n body: formData,\n });\n\n if (res.status >= 300) {\n const responseBody = [412].includes(res.status) ? null : await res.text();\n const payload: unknown = responseBody ? JSON.parse(responseBody) : {};\n throw new FetchError(payload, res.status, res.headers);\n }\n\n const responseBody = [204, 205, 304].includes(res.status)\n ? null\n : await res.text();\n const payload: FileMetadata = responseBody ? JSON.parse(responseBody) : {};\n\n return {\n body: payload,\n status: res.status,\n headers: res.headers,\n } as FetchResponse<FileMetadata>;\n };\n\n const getFilePresignedURL = async (\n id: string,\n options?: RequestInit,\n ): Promise<FetchResponse<PresignedURLResponse>> => {\n const url = `${baseURL}/files/${id}/presignedurl`;\n const res = await fetch(url, {\n ...options,\n method: 'GET',\n headers: {\n ...options?.headers,\n },\n });\n\n if (res.status >= 300) {\n const responseBody = [412].includes(res.status) ? null : await res.text();\n const payload: unknown = responseBody ? JSON.parse(responseBody) : {};\n throw new FetchError(payload, res.status, res.headers);\n }\n\n const responseBody = [204, 205, 304].includes(res.status)\n ? null\n : await res.text();\n const payload: PresignedURLResponse = responseBody\n ? JSON.parse(responseBody)\n : {};\n\n return {\n body: payload,\n status: res.status,\n headers: res.headers,\n } as FetchResponse<PresignedURLResponse>;\n };\n\n const deleteBrokenMetadata = async (\n options?: RequestInit,\n ): Promise<FetchResponse<DeleteBrokenMetadataResponse200>> => {\n const url = `${baseURL}/ops/delete-broken-metadata`;\n const res = await fetch(url, {\n ...options,\n method: 'POST',\n headers: {\n ...options?.headers,\n },\n });\n\n if (res.status >= 300) {\n const responseBody = [412].includes(res.status) ? null : await res.text();\n const payload: unknown = responseBody ? JSON.parse(responseBody) : {};\n throw new FetchError(payload, res.status, res.headers);\n }\n\n const responseBody = [204, 205, 304].includes(res.status)\n ? null\n : await res.text();\n const payload: DeleteBrokenMetadataResponse200 = responseBody\n ? JSON.parse(responseBody)\n : {};\n\n return {\n body: payload,\n status: res.status,\n headers: res.headers,\n } as FetchResponse<DeleteBrokenMetadataResponse200>;\n };\n\n const deleteOrphanedFiles = async (\n options?: RequestInit,\n ): Promise<FetchResponse<DeleteOrphanedFilesResponse200>> => {\n const url = `${baseURL}/ops/delete-orphans`;\n const res = await fetch(url, {\n ...options,\n method: 'POST',\n headers: {\n ...options?.headers,\n },\n });\n\n if (res.status >= 300) {\n const responseBody = [412].includes(res.status) ? null : await res.text();\n const payload: unknown = responseBody ? JSON.parse(responseBody) : {};\n throw new FetchError(payload, res.status, res.headers);\n }\n\n const responseBody = [204, 205, 304].includes(res.status)\n ? null\n : await res.text();\n const payload: DeleteOrphanedFilesResponse200 = responseBody\n ? JSON.parse(responseBody)\n : {};\n\n return {\n body: payload,\n status: res.status,\n headers: res.headers,\n } as FetchResponse<DeleteOrphanedFilesResponse200>;\n };\n\n const listBrokenMetadata = async (\n options?: RequestInit,\n ): Promise<FetchResponse<ListBrokenMetadataResponse200>> => {\n const url = `${baseURL}/ops/list-broken-metadata`;\n const res = await fetch(url, {\n ...options,\n method: 'POST',\n headers: {\n ...options?.headers,\n },\n });\n\n if (res.status >= 300) {\n const responseBody = [412].includes(res.status) ? null : await res.text();\n const payload: unknown = responseBody ? JSON.parse(responseBody) : {};\n throw new FetchError(payload, res.status, res.headers);\n }\n\n const responseBody = [204, 205, 304].includes(res.status)\n ? null\n : await res.text();\n const payload: ListBrokenMetadataResponse200 = responseBody\n ? JSON.parse(responseBody)\n : {};\n\n return {\n body: payload,\n status: res.status,\n headers: res.headers,\n } as FetchResponse<ListBrokenMetadataResponse200>;\n };\n\n const listFilesNotUploaded = async (\n options?: RequestInit,\n ): Promise<FetchResponse<ListFilesNotUploadedResponse200>> => {\n const url = `${baseURL}/ops/list-not-uploaded`;\n const res = await fetch(url, {\n ...options,\n method: 'POST',\n headers: {\n ...options?.headers,\n },\n });\n\n if (res.status >= 300) {\n const responseBody = [412].includes(res.status) ? null : await res.text();\n const payload: unknown = responseBody ? JSON.parse(responseBody) : {};\n throw new FetchError(payload, res.status, res.headers);\n }\n\n const responseBody = [204, 205, 304].includes(res.status)\n ? null\n : await res.text();\n const payload: ListFilesNotUploadedResponse200 = responseBody\n ? JSON.parse(responseBody)\n : {};\n\n return {\n body: payload,\n status: res.status,\n headers: res.headers,\n } as FetchResponse<ListFilesNotUploadedResponse200>;\n };\n\n const listOrphanedFiles = async (\n options?: RequestInit,\n ): Promise<FetchResponse<ListOrphanedFilesResponse200>> => {\n const url = `${baseURL}/ops/list-orphans`;\n const res = await fetch(url, {\n ...options,\n method: 'POST',\n headers: {\n ...options?.headers,\n },\n });\n\n if (res.status >= 300) {\n const responseBody = [412].includes(res.status) ? null : await res.text();\n const payload: unknown = responseBody ? JSON.parse(responseBody) : {};\n throw new FetchError(payload, res.status, res.headers);\n }\n\n const responseBody = [204, 205, 304].includes(res.status)\n ? null\n : await res.text();\n const payload: ListOrphanedFilesResponse200 = responseBody\n ? JSON.parse(responseBody)\n : {};\n\n return {\n body: payload,\n status: res.status,\n headers: res.headers,\n } as FetchResponse<ListOrphanedFilesResponse200>;\n };\n\n const getVersion = async (\n options?: RequestInit,\n ): Promise<FetchResponse<VersionInformation>> => {\n const url = `${baseURL}/version`;\n const res = await fetch(url, {\n ...options,\n method: 'GET',\n headers: {\n ...options?.headers,\n },\n });\n\n if (res.status >= 300) {\n const responseBody = [412].includes(res.status) ? null : await res.text();\n const payload: unknown = responseBody ? JSON.parse(responseBody) : {};\n throw new FetchError(payload, res.status, res.headers);\n }\n\n const responseBody = [204, 205, 304].includes(res.status)\n ? null\n : await res.text();\n const payload: VersionInformation = responseBody\n ? JSON.parse(responseBody)\n : {};\n\n return {\n body: payload,\n status: res.status,\n headers: res.headers,\n } as FetchResponse<VersionInformation>;\n };\n\n return {\n baseURL,\n pushChainFunction,\n uploadFiles,\n deleteFile,\n getFile,\n getFileMetadataHeaders,\n replaceFile,\n getFilePresignedURL,\n deleteBrokenMetadata,\n deleteOrphanedFiles,\n listBrokenMetadata,\n listFilesNotUploaded,\n listOrphanedFiles,\n getVersion,\n };\n};\n"],"mappings":"oIA2mBa,CACX,EACA,EAAkC,MAElC,IAAI,EAAQ,EAAA,oBAAoB,GAidhC,MAAO,CACL,UACA,kBAjdyB,IACzB,EAAe,KAAK,GACpB,EAAQ,EAAA,oBAAoB,EAAe,EAgd3C,YA9ckB,MAClB,EACA,KAEA,MAAM,EAAM,GAAG,UACT,EAAW,IAAI,SACf,EACiB,oBAAd,WACyC,gBAA/C,UAAmC,aACZ,IAAtB,EAAK,cACP,EAAS,OAAO,YAAa,EAAK,mBAET,IAAvB,EAAK,eACP,EAAK,cAAc,SAAS,IACtB,EACF,EAAS,OAAO,aAAc,CAC5B,OAAQ,KAAK,UAAU,GACvB,KAAM,mBACN,KAAM,KAGR,EAAS,OACP,aACA,IAAI,KAAK,CAAC,KAAK,UAAU,IAAS,CAAE,KAAM,qBAC1C,GACD,SAIgB,IAAnB,EAAK,WACP,EAAK,UAAU,SAAS,IACtB,EAAS,OAAO,SAAU,EAAM,IAIpC,MAAM,QAAY,EAAM,EAAK,IACxB,EACH,OAAQ,OACR,KAAM,IAGR,GAAI,EAAI,QAAU,IAA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