Initalize

This commit is contained in:
Your Name
2026-05-03 12:12:57 -04:00
commit 38652eb9b5
10603 changed files with 1762136 additions and 0 deletions

1875
node_modules/algoliasearch/dist/lite/browser.d.ts generated vendored Normal file

File diff suppressed because it is too large Load Diff

282
node_modules/algoliasearch/dist/lite/builds/browser.js generated vendored Normal file
View File

@@ -0,0 +1,282 @@
// lite/builds/browser.ts
import {
createBrowserLocalStorageCache,
createFallbackableCache,
createMemoryCache,
createNullLogger
} from "@algolia/client-common";
import { createXhrRequester } from "@algolia/requester-browser-xhr";
// lite/src/liteClient.ts
import { createAuth, createTransporter, getAlgoliaAgent, shuffle } from "@algolia/client-common";
var apiClientVersion = "5.52.0";
function getDefaultHosts(appId) {
return [
{
url: `${appId}-dsn.algolia.net`,
accept: "read",
protocol: "https"
},
{
url: `${appId}.algolia.net`,
accept: "write",
protocol: "https"
}
].concat(
shuffle([
{
url: `${appId}-1.algolianet.com`,
accept: "readWrite",
protocol: "https"
},
{
url: `${appId}-2.algolianet.com`,
accept: "readWrite",
protocol: "https"
},
{
url: `${appId}-3.algolianet.com`,
accept: "readWrite",
protocol: "https"
}
])
);
}
function createLiteClient({
appId: appIdOption,
apiKey: apiKeyOption,
authMode,
algoliaAgents,
...options
}) {
const auth = createAuth(appIdOption, apiKeyOption, authMode);
const transporter = createTransporter({
hosts: getDefaultHosts(appIdOption),
...options,
algoliaAgent: getAlgoliaAgent({
algoliaAgents,
client: "Lite",
version: apiClientVersion
}),
baseHeaders: {
"content-type": "text/plain",
...auth.headers(),
...options.baseHeaders
},
baseQueryParameters: {
...auth.queryParameters(),
...options.baseQueryParameters
}
});
return {
transporter,
/**
* The `appId` currently in use.
*/
appId: appIdOption,
/**
* The `apiKey` currently in use.
*/
apiKey: apiKeyOption,
/**
* Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
*/
clearCache() {
return Promise.all([transporter.requestsCache.clear(), transporter.responsesCache.clear()]).then(() => void 0);
},
/**
* Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
*/
get _ua() {
return transporter.algoliaAgent.value;
},
/**
* Adds a `segment` to the `x-algolia-agent` sent with every requests.
*
* @param segment - The algolia agent (user-agent) segment to add.
* @param version - The version of the agent.
*/
addAlgoliaAgent(segment, version) {
transporter.algoliaAgent.add({ segment, version });
},
/**
* Helper method to switch the API key used to authenticate the requests.
*
* @param params - Method params.
* @param params.apiKey - The new API Key to use.
*/
setClientApiKey({ apiKey }) {
if (!authMode || authMode === "WithinHeaders") {
transporter.baseHeaders["x-algolia-api-key"] = apiKey;
} else {
transporter.baseQueryParameters["x-algolia-api-key"] = apiKey;
}
},
/**
* Helper: calls the `search` method but with certainty that we will only request Algolia records (hits) and not facets.
* Disclaimer: We don't assert that the parameters you pass to this method only contains `hits` requests to prevent impacting search performances, this helper is purely for typing purposes.
*
* @summary Search multiple indices for `hits`.
* @param searchMethodParams - Query requests and strategies. Results will be received in the same order as the queries.
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
*/
searchForHits(searchMethodParams, requestOptions) {
return this.search(searchMethodParams, requestOptions);
},
/**
* Helper: calls the `search` method but with certainty that we will only request Algolia facets and not records (hits).
* Disclaimer: We don't assert that the parameters you pass to this method only contains `facets` requests to prevent impacting search performances, this helper is purely for typing purposes.
*
* @summary Search multiple indices for `facets`.
* @param searchMethodParams - Query requests and strategies. Results will be received in the same order as the queries.
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
*/
searchForFacets(searchMethodParams, requestOptions) {
return this.search(searchMethodParams, requestOptions);
},
/**
* This method lets you send requests to the Algolia REST API.
* @param customPost - The customPost object.
* @param customPost.path - Path of the endpoint, for example `1/newFeature`.
* @param customPost.parameters - Query parameters to apply to the current query.
* @param customPost.body - Parameters to send with the custom request.
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
*/
customPost({ path, parameters, body }, requestOptions) {
if (!path) {
throw new Error("Parameter `path` is required when calling `customPost`.");
}
const requestPath = "/{path}".replace("{path}", path);
const headers = {};
const queryParameters = parameters ? parameters : {};
const request = {
method: "POST",
path: requestPath,
queryParameters,
headers,
data: body ? body : {}
};
return transporter.request(request, requestOptions);
},
/**
* Retrieves recommendations from selected AI models.
*
* Required API Key ACLs:
* - search
* @param getRecommendationsParams - The getRecommendationsParams object.
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
*/
getRecommendations(getRecommendationsParams, requestOptions) {
if (getRecommendationsParams && Array.isArray(getRecommendationsParams)) {
const newSignatureRequest = {
requests: getRecommendationsParams
};
getRecommendationsParams = newSignatureRequest;
}
if (!getRecommendationsParams) {
throw new Error("Parameter `getRecommendationsParams` is required when calling `getRecommendations`.");
}
if (!getRecommendationsParams.requests) {
throw new Error("Parameter `getRecommendationsParams.requests` is required when calling `getRecommendations`.");
}
const requestPath = "/1/indexes/*/recommendations";
const headers = {};
const queryParameters = {};
const request = {
method: "POST",
path: requestPath,
queryParameters,
headers,
data: getRecommendationsParams,
useReadTransporter: true,
cacheable: true
};
return transporter.request(request, requestOptions);
},
/**
* Runs multiple search queries against one or more indices in a single API request. Use cases include: - Searching different indices, such as products and marketing content. - Run multiple queries on the same index with different parameters or filters. If you know the expected result type, use the `searchForHits` or `searchForFacets` helper to simplify the response format.
*
* Required API Key ACLs:
* - search
* @param searchMethodParams - Multi-query search request body. Results are returned in the same order as the requests.
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
*/
search(searchMethodParams, requestOptions) {
if (searchMethodParams && Array.isArray(searchMethodParams)) {
const newSignatureRequest = {
requests: searchMethodParams.map(({ params, ...legacyRequest }) => {
if (legacyRequest.type === "facet") {
return {
...legacyRequest,
...params,
type: "facet"
};
}
return {
...legacyRequest,
...params,
facet: void 0,
maxFacetHits: void 0,
facetQuery: void 0
};
})
};
searchMethodParams = newSignatureRequest;
}
if (!searchMethodParams) {
throw new Error("Parameter `searchMethodParams` is required when calling `search`.");
}
if (!searchMethodParams.requests) {
throw new Error("Parameter `searchMethodParams.requests` is required when calling `search`.");
}
const requestPath = "/1/indexes/*/queries";
const headers = {};
const queryParameters = {};
const request = {
method: "POST",
path: requestPath,
queryParameters,
headers,
data: searchMethodParams,
useReadTransporter: true,
cacheable: true
};
return transporter.request(request, requestOptions);
}
};
}
// lite/builds/browser.ts
function liteClient(appId, apiKey, options) {
if (!appId || typeof appId !== "string") {
throw new Error("`appId` is missing.");
}
if (!apiKey || typeof apiKey !== "string") {
throw new Error("`apiKey` is missing.");
}
const { compression: _compression, ...browserOptions } = options || {};
return createLiteClient({
appId,
apiKey,
timeouts: {
connect: 1e3,
read: 2e3,
write: 3e4
},
logger: createNullLogger(),
requester: createXhrRequester(),
algoliaAgents: [{ segment: "Browser" }],
authMode: "WithinQueryParameters",
responsesCache: createMemoryCache(),
requestsCache: createMemoryCache({ serializable: false }),
hostsCache: createFallbackableCache({
caches: [createBrowserLocalStorageCache({ key: `${apiClientVersion}-${appId}` }), createMemoryCache()]
}),
...browserOptions
});
}
export {
apiClientVersion,
liteClient
};
//# sourceMappingURL=browser.js.map

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

301
node_modules/algoliasearch/dist/lite/builds/node.cjs generated vendored Normal file
View File

@@ -0,0 +1,301 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// lite/builds/node.ts
var node_exports = {};
__export(node_exports, {
apiClientVersion: () => apiClientVersion,
liteClient: () => liteClient
});
module.exports = __toCommonJS(node_exports);
var import_node_zlib = require("zlib");
var import_client_common2 = require("@algolia/client-common");
var import_requester_node_http = require("@algolia/requester-node-http");
// lite/src/liteClient.ts
var import_client_common = require("@algolia/client-common");
var apiClientVersion = "5.52.0";
function getDefaultHosts(appId) {
return [
{
url: `${appId}-dsn.algolia.net`,
accept: "read",
protocol: "https"
},
{
url: `${appId}.algolia.net`,
accept: "write",
protocol: "https"
}
].concat(
(0, import_client_common.shuffle)([
{
url: `${appId}-1.algolianet.com`,
accept: "readWrite",
protocol: "https"
},
{
url: `${appId}-2.algolianet.com`,
accept: "readWrite",
protocol: "https"
},
{
url: `${appId}-3.algolianet.com`,
accept: "readWrite",
protocol: "https"
}
])
);
}
function createLiteClient({
appId: appIdOption,
apiKey: apiKeyOption,
authMode,
algoliaAgents,
...options
}) {
const auth = (0, import_client_common.createAuth)(appIdOption, apiKeyOption, authMode);
const transporter = (0, import_client_common.createTransporter)({
hosts: getDefaultHosts(appIdOption),
...options,
algoliaAgent: (0, import_client_common.getAlgoliaAgent)({
algoliaAgents,
client: "Lite",
version: apiClientVersion
}),
baseHeaders: {
"content-type": "text/plain",
...auth.headers(),
...options.baseHeaders
},
baseQueryParameters: {
...auth.queryParameters(),
...options.baseQueryParameters
}
});
return {
transporter,
/**
* The `appId` currently in use.
*/
appId: appIdOption,
/**
* The `apiKey` currently in use.
*/
apiKey: apiKeyOption,
/**
* Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
*/
clearCache() {
return Promise.all([transporter.requestsCache.clear(), transporter.responsesCache.clear()]).then(() => void 0);
},
/**
* Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
*/
get _ua() {
return transporter.algoliaAgent.value;
},
/**
* Adds a `segment` to the `x-algolia-agent` sent with every requests.
*
* @param segment - The algolia agent (user-agent) segment to add.
* @param version - The version of the agent.
*/
addAlgoliaAgent(segment, version) {
transporter.algoliaAgent.add({ segment, version });
},
/**
* Helper method to switch the API key used to authenticate the requests.
*
* @param params - Method params.
* @param params.apiKey - The new API Key to use.
*/
setClientApiKey({ apiKey }) {
if (!authMode || authMode === "WithinHeaders") {
transporter.baseHeaders["x-algolia-api-key"] = apiKey;
} else {
transporter.baseQueryParameters["x-algolia-api-key"] = apiKey;
}
},
/**
* Helper: calls the `search` method but with certainty that we will only request Algolia records (hits) and not facets.
* Disclaimer: We don't assert that the parameters you pass to this method only contains `hits` requests to prevent impacting search performances, this helper is purely for typing purposes.
*
* @summary Search multiple indices for `hits`.
* @param searchMethodParams - Query requests and strategies. Results will be received in the same order as the queries.
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
*/
searchForHits(searchMethodParams, requestOptions) {
return this.search(searchMethodParams, requestOptions);
},
/**
* Helper: calls the `search` method but with certainty that we will only request Algolia facets and not records (hits).
* Disclaimer: We don't assert that the parameters you pass to this method only contains `facets` requests to prevent impacting search performances, this helper is purely for typing purposes.
*
* @summary Search multiple indices for `facets`.
* @param searchMethodParams - Query requests and strategies. Results will be received in the same order as the queries.
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
*/
searchForFacets(searchMethodParams, requestOptions) {
return this.search(searchMethodParams, requestOptions);
},
/**
* This method lets you send requests to the Algolia REST API.
* @param customPost - The customPost object.
* @param customPost.path - Path of the endpoint, for example `1/newFeature`.
* @param customPost.parameters - Query parameters to apply to the current query.
* @param customPost.body - Parameters to send with the custom request.
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
*/
customPost({ path, parameters, body }, requestOptions) {
if (!path) {
throw new Error("Parameter `path` is required when calling `customPost`.");
}
const requestPath = "/{path}".replace("{path}", path);
const headers = {};
const queryParameters = parameters ? parameters : {};
const request = {
method: "POST",
path: requestPath,
queryParameters,
headers,
data: body ? body : {}
};
return transporter.request(request, requestOptions);
},
/**
* Retrieves recommendations from selected AI models.
*
* Required API Key ACLs:
* - search
* @param getRecommendationsParams - The getRecommendationsParams object.
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
*/
getRecommendations(getRecommendationsParams, requestOptions) {
if (getRecommendationsParams && Array.isArray(getRecommendationsParams)) {
const newSignatureRequest = {
requests: getRecommendationsParams
};
getRecommendationsParams = newSignatureRequest;
}
if (!getRecommendationsParams) {
throw new Error("Parameter `getRecommendationsParams` is required when calling `getRecommendations`.");
}
if (!getRecommendationsParams.requests) {
throw new Error("Parameter `getRecommendationsParams.requests` is required when calling `getRecommendations`.");
}
const requestPath = "/1/indexes/*/recommendations";
const headers = {};
const queryParameters = {};
const request = {
method: "POST",
path: requestPath,
queryParameters,
headers,
data: getRecommendationsParams,
useReadTransporter: true,
cacheable: true
};
return transporter.request(request, requestOptions);
},
/**
* Runs multiple search queries against one or more indices in a single API request. Use cases include: - Searching different indices, such as products and marketing content. - Run multiple queries on the same index with different parameters or filters. If you know the expected result type, use the `searchForHits` or `searchForFacets` helper to simplify the response format.
*
* Required API Key ACLs:
* - search
* @param searchMethodParams - Multi-query search request body. Results are returned in the same order as the requests.
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
*/
search(searchMethodParams, requestOptions) {
if (searchMethodParams && Array.isArray(searchMethodParams)) {
const newSignatureRequest = {
requests: searchMethodParams.map(({ params, ...legacyRequest }) => {
if (legacyRequest.type === "facet") {
return {
...legacyRequest,
...params,
type: "facet"
};
}
return {
...legacyRequest,
...params,
facet: void 0,
maxFacetHits: void 0,
facetQuery: void 0
};
})
};
searchMethodParams = newSignatureRequest;
}
if (!searchMethodParams) {
throw new Error("Parameter `searchMethodParams` is required when calling `search`.");
}
if (!searchMethodParams.requests) {
throw new Error("Parameter `searchMethodParams.requests` is required when calling `search`.");
}
const requestPath = "/1/indexes/*/queries";
const headers = {};
const queryParameters = {};
const request = {
method: "POST",
path: requestPath,
queryParameters,
headers,
data: searchMethodParams,
useReadTransporter: true,
cacheable: true
};
return transporter.request(request, requestOptions);
}
};
}
// lite/builds/node.ts
function liteClient(appId, apiKey, options) {
if (!appId || typeof appId !== "string") {
throw new Error("`appId` is missing.");
}
if (!apiKey || typeof apiKey !== "string") {
throw new Error("`apiKey` is missing.");
}
return createLiteClient({
appId,
apiKey,
timeouts: {
connect: 2e3,
read: 5e3,
write: 3e4
},
logger: (0, import_client_common2.createNullLogger)(),
requester: (0, import_requester_node_http.createHttpRequester)(),
algoliaAgents: [{ segment: "Node.js", version: process.versions.node }],
responsesCache: (0, import_client_common2.createNullCache)(),
requestsCache: (0, import_client_common2.createNullCache)(),
hostsCache: (0, import_client_common2.createMemoryCache)(),
compress: async (data) => (0, import_node_zlib.gzipSync)(Buffer.from(data)),
...options
});
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
apiClientVersion,
liteClient
});
//# sourceMappingURL=node.cjs.map

File diff suppressed because one or more lines are too long

275
node_modules/algoliasearch/dist/lite/builds/node.js generated vendored Normal file
View File

@@ -0,0 +1,275 @@
// lite/builds/node.ts
import { gzipSync } from "zlib";
import { createMemoryCache, createNullCache, createNullLogger } from "@algolia/client-common";
import { createHttpRequester } from "@algolia/requester-node-http";
// lite/src/liteClient.ts
import { createAuth, createTransporter, getAlgoliaAgent, shuffle } from "@algolia/client-common";
var apiClientVersion = "5.52.0";
function getDefaultHosts(appId) {
return [
{
url: `${appId}-dsn.algolia.net`,
accept: "read",
protocol: "https"
},
{
url: `${appId}.algolia.net`,
accept: "write",
protocol: "https"
}
].concat(
shuffle([
{
url: `${appId}-1.algolianet.com`,
accept: "readWrite",
protocol: "https"
},
{
url: `${appId}-2.algolianet.com`,
accept: "readWrite",
protocol: "https"
},
{
url: `${appId}-3.algolianet.com`,
accept: "readWrite",
protocol: "https"
}
])
);
}
function createLiteClient({
appId: appIdOption,
apiKey: apiKeyOption,
authMode,
algoliaAgents,
...options
}) {
const auth = createAuth(appIdOption, apiKeyOption, authMode);
const transporter = createTransporter({
hosts: getDefaultHosts(appIdOption),
...options,
algoliaAgent: getAlgoliaAgent({
algoliaAgents,
client: "Lite",
version: apiClientVersion
}),
baseHeaders: {
"content-type": "text/plain",
...auth.headers(),
...options.baseHeaders
},
baseQueryParameters: {
...auth.queryParameters(),
...options.baseQueryParameters
}
});
return {
transporter,
/**
* The `appId` currently in use.
*/
appId: appIdOption,
/**
* The `apiKey` currently in use.
*/
apiKey: apiKeyOption,
/**
* Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
*/
clearCache() {
return Promise.all([transporter.requestsCache.clear(), transporter.responsesCache.clear()]).then(() => void 0);
},
/**
* Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
*/
get _ua() {
return transporter.algoliaAgent.value;
},
/**
* Adds a `segment` to the `x-algolia-agent` sent with every requests.
*
* @param segment - The algolia agent (user-agent) segment to add.
* @param version - The version of the agent.
*/
addAlgoliaAgent(segment, version) {
transporter.algoliaAgent.add({ segment, version });
},
/**
* Helper method to switch the API key used to authenticate the requests.
*
* @param params - Method params.
* @param params.apiKey - The new API Key to use.
*/
setClientApiKey({ apiKey }) {
if (!authMode || authMode === "WithinHeaders") {
transporter.baseHeaders["x-algolia-api-key"] = apiKey;
} else {
transporter.baseQueryParameters["x-algolia-api-key"] = apiKey;
}
},
/**
* Helper: calls the `search` method but with certainty that we will only request Algolia records (hits) and not facets.
* Disclaimer: We don't assert that the parameters you pass to this method only contains `hits` requests to prevent impacting search performances, this helper is purely for typing purposes.
*
* @summary Search multiple indices for `hits`.
* @param searchMethodParams - Query requests and strategies. Results will be received in the same order as the queries.
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
*/
searchForHits(searchMethodParams, requestOptions) {
return this.search(searchMethodParams, requestOptions);
},
/**
* Helper: calls the `search` method but with certainty that we will only request Algolia facets and not records (hits).
* Disclaimer: We don't assert that the parameters you pass to this method only contains `facets` requests to prevent impacting search performances, this helper is purely for typing purposes.
*
* @summary Search multiple indices for `facets`.
* @param searchMethodParams - Query requests and strategies. Results will be received in the same order as the queries.
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
*/
searchForFacets(searchMethodParams, requestOptions) {
return this.search(searchMethodParams, requestOptions);
},
/**
* This method lets you send requests to the Algolia REST API.
* @param customPost - The customPost object.
* @param customPost.path - Path of the endpoint, for example `1/newFeature`.
* @param customPost.parameters - Query parameters to apply to the current query.
* @param customPost.body - Parameters to send with the custom request.
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
*/
customPost({ path, parameters, body }, requestOptions) {
if (!path) {
throw new Error("Parameter `path` is required when calling `customPost`.");
}
const requestPath = "/{path}".replace("{path}", path);
const headers = {};
const queryParameters = parameters ? parameters : {};
const request = {
method: "POST",
path: requestPath,
queryParameters,
headers,
data: body ? body : {}
};
return transporter.request(request, requestOptions);
},
/**
* Retrieves recommendations from selected AI models.
*
* Required API Key ACLs:
* - search
* @param getRecommendationsParams - The getRecommendationsParams object.
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
*/
getRecommendations(getRecommendationsParams, requestOptions) {
if (getRecommendationsParams && Array.isArray(getRecommendationsParams)) {
const newSignatureRequest = {
requests: getRecommendationsParams
};
getRecommendationsParams = newSignatureRequest;
}
if (!getRecommendationsParams) {
throw new Error("Parameter `getRecommendationsParams` is required when calling `getRecommendations`.");
}
if (!getRecommendationsParams.requests) {
throw new Error("Parameter `getRecommendationsParams.requests` is required when calling `getRecommendations`.");
}
const requestPath = "/1/indexes/*/recommendations";
const headers = {};
const queryParameters = {};
const request = {
method: "POST",
path: requestPath,
queryParameters,
headers,
data: getRecommendationsParams,
useReadTransporter: true,
cacheable: true
};
return transporter.request(request, requestOptions);
},
/**
* Runs multiple search queries against one or more indices in a single API request. Use cases include: - Searching different indices, such as products and marketing content. - Run multiple queries on the same index with different parameters or filters. If you know the expected result type, use the `searchForHits` or `searchForFacets` helper to simplify the response format.
*
* Required API Key ACLs:
* - search
* @param searchMethodParams - Multi-query search request body. Results are returned in the same order as the requests.
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
*/
search(searchMethodParams, requestOptions) {
if (searchMethodParams && Array.isArray(searchMethodParams)) {
const newSignatureRequest = {
requests: searchMethodParams.map(({ params, ...legacyRequest }) => {
if (legacyRequest.type === "facet") {
return {
...legacyRequest,
...params,
type: "facet"
};
}
return {
...legacyRequest,
...params,
facet: void 0,
maxFacetHits: void 0,
facetQuery: void 0
};
})
};
searchMethodParams = newSignatureRequest;
}
if (!searchMethodParams) {
throw new Error("Parameter `searchMethodParams` is required when calling `search`.");
}
if (!searchMethodParams.requests) {
throw new Error("Parameter `searchMethodParams.requests` is required when calling `search`.");
}
const requestPath = "/1/indexes/*/queries";
const headers = {};
const queryParameters = {};
const request = {
method: "POST",
path: requestPath,
queryParameters,
headers,
data: searchMethodParams,
useReadTransporter: true,
cacheable: true
};
return transporter.request(request, requestOptions);
}
};
}
// lite/builds/node.ts
function liteClient(appId, apiKey, options) {
if (!appId || typeof appId !== "string") {
throw new Error("`appId` is missing.");
}
if (!apiKey || typeof apiKey !== "string") {
throw new Error("`apiKey` is missing.");
}
return createLiteClient({
appId,
apiKey,
timeouts: {
connect: 2e3,
read: 5e3,
write: 3e4
},
logger: createNullLogger(),
requester: createHttpRequester(),
algoliaAgents: [{ segment: "Node.js", version: process.versions.node }],
responsesCache: createNullCache(),
requestsCache: createNullCache(),
hostsCache: createMemoryCache(),
compress: async (data) => gzipSync(Buffer.from(data)),
...options
});
}
export {
apiClientVersion,
liteClient
};
//# sourceMappingURL=node.js.map

File diff suppressed because one or more lines are too long

1876
node_modules/algoliasearch/dist/lite/node.d.cts generated vendored Normal file

File diff suppressed because it is too large Load Diff

1876
node_modules/algoliasearch/dist/lite/node.d.ts generated vendored Normal file

File diff suppressed because it is too large Load Diff

269
node_modules/algoliasearch/dist/lite/src/liteClient.cjs generated vendored Normal file
View File

@@ -0,0 +1,269 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// lite/src/liteClient.ts
var liteClient_exports = {};
__export(liteClient_exports, {
apiClientVersion: () => apiClientVersion,
createLiteClient: () => createLiteClient
});
module.exports = __toCommonJS(liteClient_exports);
var import_client_common = require("@algolia/client-common");
var apiClientVersion = "5.52.0";
function getDefaultHosts(appId) {
return [
{
url: `${appId}-dsn.algolia.net`,
accept: "read",
protocol: "https"
},
{
url: `${appId}.algolia.net`,
accept: "write",
protocol: "https"
}
].concat(
(0, import_client_common.shuffle)([
{
url: `${appId}-1.algolianet.com`,
accept: "readWrite",
protocol: "https"
},
{
url: `${appId}-2.algolianet.com`,
accept: "readWrite",
protocol: "https"
},
{
url: `${appId}-3.algolianet.com`,
accept: "readWrite",
protocol: "https"
}
])
);
}
function createLiteClient({
appId: appIdOption,
apiKey: apiKeyOption,
authMode,
algoliaAgents,
...options
}) {
const auth = (0, import_client_common.createAuth)(appIdOption, apiKeyOption, authMode);
const transporter = (0, import_client_common.createTransporter)({
hosts: getDefaultHosts(appIdOption),
...options,
algoliaAgent: (0, import_client_common.getAlgoliaAgent)({
algoliaAgents,
client: "Lite",
version: apiClientVersion
}),
baseHeaders: {
"content-type": "text/plain",
...auth.headers(),
...options.baseHeaders
},
baseQueryParameters: {
...auth.queryParameters(),
...options.baseQueryParameters
}
});
return {
transporter,
/**
* The `appId` currently in use.
*/
appId: appIdOption,
/**
* The `apiKey` currently in use.
*/
apiKey: apiKeyOption,
/**
* Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
*/
clearCache() {
return Promise.all([transporter.requestsCache.clear(), transporter.responsesCache.clear()]).then(() => void 0);
},
/**
* Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
*/
get _ua() {
return transporter.algoliaAgent.value;
},
/**
* Adds a `segment` to the `x-algolia-agent` sent with every requests.
*
* @param segment - The algolia agent (user-agent) segment to add.
* @param version - The version of the agent.
*/
addAlgoliaAgent(segment, version) {
transporter.algoliaAgent.add({ segment, version });
},
/**
* Helper method to switch the API key used to authenticate the requests.
*
* @param params - Method params.
* @param params.apiKey - The new API Key to use.
*/
setClientApiKey({ apiKey }) {
if (!authMode || authMode === "WithinHeaders") {
transporter.baseHeaders["x-algolia-api-key"] = apiKey;
} else {
transporter.baseQueryParameters["x-algolia-api-key"] = apiKey;
}
},
/**
* Helper: calls the `search` method but with certainty that we will only request Algolia records (hits) and not facets.
* Disclaimer: We don't assert that the parameters you pass to this method only contains `hits` requests to prevent impacting search performances, this helper is purely for typing purposes.
*
* @summary Search multiple indices for `hits`.
* @param searchMethodParams - Query requests and strategies. Results will be received in the same order as the queries.
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
*/
searchForHits(searchMethodParams, requestOptions) {
return this.search(searchMethodParams, requestOptions);
},
/**
* Helper: calls the `search` method but with certainty that we will only request Algolia facets and not records (hits).
* Disclaimer: We don't assert that the parameters you pass to this method only contains `facets` requests to prevent impacting search performances, this helper is purely for typing purposes.
*
* @summary Search multiple indices for `facets`.
* @param searchMethodParams - Query requests and strategies. Results will be received in the same order as the queries.
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
*/
searchForFacets(searchMethodParams, requestOptions) {
return this.search(searchMethodParams, requestOptions);
},
/**
* This method lets you send requests to the Algolia REST API.
* @param customPost - The customPost object.
* @param customPost.path - Path of the endpoint, for example `1/newFeature`.
* @param customPost.parameters - Query parameters to apply to the current query.
* @param customPost.body - Parameters to send with the custom request.
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
*/
customPost({ path, parameters, body }, requestOptions) {
if (!path) {
throw new Error("Parameter `path` is required when calling `customPost`.");
}
const requestPath = "/{path}".replace("{path}", path);
const headers = {};
const queryParameters = parameters ? parameters : {};
const request = {
method: "POST",
path: requestPath,
queryParameters,
headers,
data: body ? body : {}
};
return transporter.request(request, requestOptions);
},
/**
* Retrieves recommendations from selected AI models.
*
* Required API Key ACLs:
* - search
* @param getRecommendationsParams - The getRecommendationsParams object.
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
*/
getRecommendations(getRecommendationsParams, requestOptions) {
if (getRecommendationsParams && Array.isArray(getRecommendationsParams)) {
const newSignatureRequest = {
requests: getRecommendationsParams
};
getRecommendationsParams = newSignatureRequest;
}
if (!getRecommendationsParams) {
throw new Error("Parameter `getRecommendationsParams` is required when calling `getRecommendations`.");
}
if (!getRecommendationsParams.requests) {
throw new Error("Parameter `getRecommendationsParams.requests` is required when calling `getRecommendations`.");
}
const requestPath = "/1/indexes/*/recommendations";
const headers = {};
const queryParameters = {};
const request = {
method: "POST",
path: requestPath,
queryParameters,
headers,
data: getRecommendationsParams,
useReadTransporter: true,
cacheable: true
};
return transporter.request(request, requestOptions);
},
/**
* Runs multiple search queries against one or more indices in a single API request. Use cases include: - Searching different indices, such as products and marketing content. - Run multiple queries on the same index with different parameters or filters. If you know the expected result type, use the `searchForHits` or `searchForFacets` helper to simplify the response format.
*
* Required API Key ACLs:
* - search
* @param searchMethodParams - Multi-query search request body. Results are returned in the same order as the requests.
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
*/
search(searchMethodParams, requestOptions) {
if (searchMethodParams && Array.isArray(searchMethodParams)) {
const newSignatureRequest = {
requests: searchMethodParams.map(({ params, ...legacyRequest }) => {
if (legacyRequest.type === "facet") {
return {
...legacyRequest,
...params,
type: "facet"
};
}
return {
...legacyRequest,
...params,
facet: void 0,
maxFacetHits: void 0,
facetQuery: void 0
};
})
};
searchMethodParams = newSignatureRequest;
}
if (!searchMethodParams) {
throw new Error("Parameter `searchMethodParams` is required when calling `search`.");
}
if (!searchMethodParams.requests) {
throw new Error("Parameter `searchMethodParams.requests` is required when calling `search`.");
}
const requestPath = "/1/indexes/*/queries";
const headers = {};
const queryParameters = {};
const request = {
method: "POST",
path: requestPath,
queryParameters,
headers,
data: searchMethodParams,
useReadTransporter: true,
cacheable: true
};
return transporter.request(request, requestOptions);
}
};
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
apiClientVersion,
createLiteClient
});
//# sourceMappingURL=liteClient.cjs.map

File diff suppressed because one or more lines are too long

243
node_modules/algoliasearch/dist/lite/src/liteClient.js generated vendored Normal file
View File

@@ -0,0 +1,243 @@
// lite/src/liteClient.ts
import { createAuth, createTransporter, getAlgoliaAgent, shuffle } from "@algolia/client-common";
var apiClientVersion = "5.52.0";
function getDefaultHosts(appId) {
return [
{
url: `${appId}-dsn.algolia.net`,
accept: "read",
protocol: "https"
},
{
url: `${appId}.algolia.net`,
accept: "write",
protocol: "https"
}
].concat(
shuffle([
{
url: `${appId}-1.algolianet.com`,
accept: "readWrite",
protocol: "https"
},
{
url: `${appId}-2.algolianet.com`,
accept: "readWrite",
protocol: "https"
},
{
url: `${appId}-3.algolianet.com`,
accept: "readWrite",
protocol: "https"
}
])
);
}
function createLiteClient({
appId: appIdOption,
apiKey: apiKeyOption,
authMode,
algoliaAgents,
...options
}) {
const auth = createAuth(appIdOption, apiKeyOption, authMode);
const transporter = createTransporter({
hosts: getDefaultHosts(appIdOption),
...options,
algoliaAgent: getAlgoliaAgent({
algoliaAgents,
client: "Lite",
version: apiClientVersion
}),
baseHeaders: {
"content-type": "text/plain",
...auth.headers(),
...options.baseHeaders
},
baseQueryParameters: {
...auth.queryParameters(),
...options.baseQueryParameters
}
});
return {
transporter,
/**
* The `appId` currently in use.
*/
appId: appIdOption,
/**
* The `apiKey` currently in use.
*/
apiKey: apiKeyOption,
/**
* Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
*/
clearCache() {
return Promise.all([transporter.requestsCache.clear(), transporter.responsesCache.clear()]).then(() => void 0);
},
/**
* Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
*/
get _ua() {
return transporter.algoliaAgent.value;
},
/**
* Adds a `segment` to the `x-algolia-agent` sent with every requests.
*
* @param segment - The algolia agent (user-agent) segment to add.
* @param version - The version of the agent.
*/
addAlgoliaAgent(segment, version) {
transporter.algoliaAgent.add({ segment, version });
},
/**
* Helper method to switch the API key used to authenticate the requests.
*
* @param params - Method params.
* @param params.apiKey - The new API Key to use.
*/
setClientApiKey({ apiKey }) {
if (!authMode || authMode === "WithinHeaders") {
transporter.baseHeaders["x-algolia-api-key"] = apiKey;
} else {
transporter.baseQueryParameters["x-algolia-api-key"] = apiKey;
}
},
/**
* Helper: calls the `search` method but with certainty that we will only request Algolia records (hits) and not facets.
* Disclaimer: We don't assert that the parameters you pass to this method only contains `hits` requests to prevent impacting search performances, this helper is purely for typing purposes.
*
* @summary Search multiple indices for `hits`.
* @param searchMethodParams - Query requests and strategies. Results will be received in the same order as the queries.
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
*/
searchForHits(searchMethodParams, requestOptions) {
return this.search(searchMethodParams, requestOptions);
},
/**
* Helper: calls the `search` method but with certainty that we will only request Algolia facets and not records (hits).
* Disclaimer: We don't assert that the parameters you pass to this method only contains `facets` requests to prevent impacting search performances, this helper is purely for typing purposes.
*
* @summary Search multiple indices for `facets`.
* @param searchMethodParams - Query requests and strategies. Results will be received in the same order as the queries.
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
*/
searchForFacets(searchMethodParams, requestOptions) {
return this.search(searchMethodParams, requestOptions);
},
/**
* This method lets you send requests to the Algolia REST API.
* @param customPost - The customPost object.
* @param customPost.path - Path of the endpoint, for example `1/newFeature`.
* @param customPost.parameters - Query parameters to apply to the current query.
* @param customPost.body - Parameters to send with the custom request.
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
*/
customPost({ path, parameters, body }, requestOptions) {
if (!path) {
throw new Error("Parameter `path` is required when calling `customPost`.");
}
const requestPath = "/{path}".replace("{path}", path);
const headers = {};
const queryParameters = parameters ? parameters : {};
const request = {
method: "POST",
path: requestPath,
queryParameters,
headers,
data: body ? body : {}
};
return transporter.request(request, requestOptions);
},
/**
* Retrieves recommendations from selected AI models.
*
* Required API Key ACLs:
* - search
* @param getRecommendationsParams - The getRecommendationsParams object.
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
*/
getRecommendations(getRecommendationsParams, requestOptions) {
if (getRecommendationsParams && Array.isArray(getRecommendationsParams)) {
const newSignatureRequest = {
requests: getRecommendationsParams
};
getRecommendationsParams = newSignatureRequest;
}
if (!getRecommendationsParams) {
throw new Error("Parameter `getRecommendationsParams` is required when calling `getRecommendations`.");
}
if (!getRecommendationsParams.requests) {
throw new Error("Parameter `getRecommendationsParams.requests` is required when calling `getRecommendations`.");
}
const requestPath = "/1/indexes/*/recommendations";
const headers = {};
const queryParameters = {};
const request = {
method: "POST",
path: requestPath,
queryParameters,
headers,
data: getRecommendationsParams,
useReadTransporter: true,
cacheable: true
};
return transporter.request(request, requestOptions);
},
/**
* Runs multiple search queries against one or more indices in a single API request. Use cases include: - Searching different indices, such as products and marketing content. - Run multiple queries on the same index with different parameters or filters. If you know the expected result type, use the `searchForHits` or `searchForFacets` helper to simplify the response format.
*
* Required API Key ACLs:
* - search
* @param searchMethodParams - Multi-query search request body. Results are returned in the same order as the requests.
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
*/
search(searchMethodParams, requestOptions) {
if (searchMethodParams && Array.isArray(searchMethodParams)) {
const newSignatureRequest = {
requests: searchMethodParams.map(({ params, ...legacyRequest }) => {
if (legacyRequest.type === "facet") {
return {
...legacyRequest,
...params,
type: "facet"
};
}
return {
...legacyRequest,
...params,
facet: void 0,
maxFacetHits: void 0,
facetQuery: void 0
};
})
};
searchMethodParams = newSignatureRequest;
}
if (!searchMethodParams) {
throw new Error("Parameter `searchMethodParams` is required when calling `search`.");
}
if (!searchMethodParams.requests) {
throw new Error("Parameter `searchMethodParams.requests` is required when calling `search`.");
}
const requestPath = "/1/indexes/*/queries";
const headers = {};
const queryParameters = {};
const request = {
method: "POST",
path: requestPath,
queryParameters,
headers,
data: searchMethodParams,
useReadTransporter: true,
cacheable: true
};
return transporter.request(request, requestOptions);
}
};
}
export {
apiClientVersion,
createLiteClient
};
//# sourceMappingURL=liteClient.js.map

File diff suppressed because one or more lines are too long