first-commit
Some checks failed
CI Pipeline / build (push) Failing after 3m23s

This commit is contained in:
2025-08-27 14:05:33 +08:00
commit 9e1b8bdc9d
5159 changed files with 1081326 additions and 0 deletions

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

File diff suppressed because it is too large Load Diff

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

@@ -0,0 +1,281 @@
// lite/builds/browser.ts
import { createXhrRequester } from "@algolia/requester-browser-xhr";
import {
createBrowserLocalStorageCache,
createFallbackableCache,
createMemoryCache,
createNullLogger
} from "@algolia/client-common";
// lite/src/liteClient.ts
import { createAuth, createTransporter, getAlgoliaAgent, shuffle } from "@algolia/client-common";
var apiClientVersion = "5.34.1";
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);
},
/**
* Sends multiple search requests to one or more indices. This can be useful in these cases: - Different indices for different purposes, such as, one index for products, another one for marketing content. - Multiple searches to the same index—for example, with different filters. Use the helper `searchForHits` or `searchForFacets` to get the results in a more convenient format, if you already know the return type you want.
*
* Required API Key ACLs:
* - search
* @param searchMethodParams - Muli-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.");
}
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()]
}),
...options
});
}
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

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

@@ -0,0 +1,299 @@
"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_requester_node_http = require("@algolia/requester-node-http");
var import_client_common2 = require("@algolia/client-common");
// lite/src/liteClient.ts
var import_client_common = require("@algolia/client-common");
var apiClientVersion = "5.34.1";
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);
},
/**
* Sends multiple search requests to one or more indices. This can be useful in these cases: - Different indices for different purposes, such as, one index for products, another one for marketing content. - Multiple searches to the same index—for example, with different filters. Use the helper `searchForHits` or `searchForFacets` to get the results in a more convenient format, if you already know the return type you want.
*
* Required API Key ACLs:
* - search
* @param searchMethodParams - Muli-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)(),
...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

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

@@ -0,0 +1,273 @@
// lite/builds/node.ts
import { createHttpRequester } from "@algolia/requester-node-http";
import { createMemoryCache, createNullCache, createNullLogger } from "@algolia/client-common";
// lite/src/liteClient.ts
import { createAuth, createTransporter, getAlgoliaAgent, shuffle } from "@algolia/client-common";
var apiClientVersion = "5.34.1";
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);
},
/**
* Sends multiple search requests to one or more indices. This can be useful in these cases: - Different indices for different purposes, such as, one index for products, another one for marketing content. - Multiple searches to the same index—for example, with different filters. Use the helper `searchForHits` or `searchForFacets` to get the results in a more convenient format, if you already know the return type you want.
*
* Required API Key ACLs:
* - search
* @param searchMethodParams - Muli-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(),
...options
});
}
export {
apiClientVersion,
liteClient
};
//# sourceMappingURL=node.js.map

File diff suppressed because one or more lines are too long

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

File diff suppressed because it is too large Load Diff

1757
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.34.1";
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);
},
/**
* Sends multiple search requests to one or more indices. This can be useful in these cases: - Different indices for different purposes, such as, one index for products, another one for marketing content. - Multiple searches to the same index—for example, with different filters. Use the helper `searchForHits` or `searchForFacets` to get the results in a more convenient format, if you already know the return type you want.
*
* Required API Key ACLs:
* - search
* @param searchMethodParams - Muli-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.34.1";
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);
},
/**
* Sends multiple search requests to one or more indices. This can be useful in these cases: - Different indices for different purposes, such as, one index for products, another one for marketing content. - Multiple searches to the same index—for example, with different filters. Use the helper `searchForHits` or `searchForFacets` to get the results in a more convenient format, if you already know the return type you want.
*
* Required API Key ACLs:
* - search
* @param searchMethodParams - Muli-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