@abcagency/hc-ui-components 1.7.5 → 1.7.6

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.
Files changed (49) hide show
  1. package/dist/components/HireControlMap.js +95 -165
  2. package/dist/components/HireControlMap.js.map +1 -1
  3. package/dist/components/modules/accordions/default.js +1 -1
  4. package/dist/components/modules/buttons/button-group-apply.js +1 -1
  5. package/dist/components/modules/buttons/default.js +1 -1
  6. package/dist/components/modules/cards/default.js +1 -1
  7. package/dist/components/modules/filter/sort.js +1 -1
  8. package/dist/components/modules/grid.js +1 -1
  9. package/dist/components/modules/list/header.js +1 -1
  10. package/dist/components/modules/list/item-expand-card/index.js +1 -1
  11. package/dist/contexts/mapListContext.js +33 -38
  12. package/dist/contexts/mapListContext.js.map +1 -1
  13. package/dist/styles/index.css +1 -1
  14. package/dist/util/algoliaSearchUtil.js +1 -1
  15. package/dist/util/filterUtil.js +1 -1
  16. package/dist/util/twMerge.js +1 -1
  17. package/package.json +1 -1
  18. package/src/apis/hcApi.ts +9 -2
  19. package/src/components/HireControlMap.js +19 -54
  20. package/src/contexts/mapListContext.tsx +34 -37
  21. package/src/index.js +1 -0
  22. package/dist/apis/hcApi.js +0 -91
  23. package/dist/apis/hcApi.js.map +0 -1
  24. package/dist/clientToken.js +0 -10
  25. package/dist/clientToken.js.map +0 -1
  26. package/dist/components/modules/skeleton/map-skeleton.js +0 -50
  27. package/dist/components/modules/skeleton/map-skeleton.js.map +0 -1
  28. package/dist/node_modules/@algolia/client-common/dist/common.js +0 -541
  29. package/dist/node_modules/@algolia/client-common/dist/common.js.map +0 -1
  30. package/dist/node_modules/@algolia/requester-browser-xhr/dist/requester.xhr.js +0 -4
  31. package/dist/node_modules/@algolia/requester-browser-xhr/dist/requester.xhr.js.map +0 -1
  32. package/dist/node_modules/@algolia/requester-node-http/dist/requester.http.js +0 -82
  33. package/dist/node_modules/@algolia/requester-node-http/dist/requester.http.js.map +0 -1
  34. package/dist/node_modules/algoliasearch/dist/lite/builds/browser.js +0 -272
  35. package/dist/node_modules/algoliasearch/dist/lite/builds/browser.js.map +0 -1
  36. package/dist/node_modules/algoliasearch/dist/lite/builds/node.js +0 -269
  37. package/dist/node_modules/algoliasearch/dist/lite/builds/node.js.map +0 -1
  38. package/dist/node_modules/fuse.js/dist/fuse.js +0 -1779
  39. package/dist/node_modules/fuse.js/dist/fuse.js.map +0 -1
  40. package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +0 -2580
  41. package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js.map +0 -1
  42. package/dist/services/configService.js +0 -15
  43. package/dist/services/configService.js.map +0 -1
  44. package/dist/services/listingAggregatorService.js +0 -41
  45. package/dist/services/listingAggregatorService.js.map +0 -1
  46. package/dist/services/listingEntityService.js +0 -16
  47. package/dist/services/listingEntityService.js.map +0 -1
  48. package/dist/services/listingService.js +0 -15
  49. package/dist/services/listingService.js.map +0 -1
@@ -1,82 +0,0 @@
1
- import http from 'http';
2
- import https from 'https';
3
- import { URL } from 'url';
4
-
5
- // src/createHttpRequester.ts
6
- var agentOptions = { keepAlive: true };
7
- var defaultHttpAgent = new http.Agent(agentOptions);
8
- var defaultHttpsAgent = new https.Agent(agentOptions);
9
- function createHttpRequester({
10
- agent: userGlobalAgent,
11
- httpAgent: userHttpAgent,
12
- httpsAgent: userHttpsAgent,
13
- requesterOptions = {}
14
- } = {}) {
15
- const httpAgent = userHttpAgent || userGlobalAgent || defaultHttpAgent;
16
- const httpsAgent = userHttpsAgent || userGlobalAgent || defaultHttpsAgent;
17
- function send(request) {
18
- return new Promise((resolve) => {
19
- let responseTimeout;
20
- let connectTimeout;
21
- const url = new URL(request.url);
22
- const path = url.search === null ? url.pathname : `${url.pathname}${url.search}`;
23
- const options = {
24
- agent: url.protocol === "https:" ? httpsAgent : httpAgent,
25
- hostname: url.hostname,
26
- path,
27
- method: request.method,
28
- ...requesterOptions,
29
- headers: {
30
- ...request.headers,
31
- ...requesterOptions.headers
32
- }
33
- };
34
- if (url.port && !requesterOptions.port) {
35
- options.port = url.port;
36
- }
37
- const req = (url.protocol === "https:" ? https : http).request(options, (response) => {
38
- let contentBuffers = [];
39
- response.on("data", (chunk) => {
40
- contentBuffers = contentBuffers.concat(chunk);
41
- });
42
- response.on("end", () => {
43
- clearTimeout(connectTimeout);
44
- clearTimeout(responseTimeout);
45
- resolve({
46
- status: response.statusCode || 0,
47
- content: Buffer.concat(contentBuffers).toString(),
48
- isTimedOut: false
49
- });
50
- });
51
- });
52
- const createTimeout = (timeout, content) => {
53
- return setTimeout(() => {
54
- req.destroy();
55
- resolve({
56
- status: 0,
57
- content,
58
- isTimedOut: true
59
- });
60
- }, timeout);
61
- };
62
- connectTimeout = createTimeout(request.connectTimeout, "Connection timeout");
63
- req.on("error", (error) => {
64
- clearTimeout(connectTimeout);
65
- clearTimeout(responseTimeout);
66
- resolve({ status: 0, content: error.message, isTimedOut: false });
67
- });
68
- req.once("response", () => {
69
- clearTimeout(connectTimeout);
70
- responseTimeout = createTimeout(request.responseTimeout, "Socket timeout");
71
- });
72
- if (request.data !== void 0) {
73
- req.write(request.data);
74
- }
75
- req.end();
76
- });
77
- }
78
- return { send };
79
- }
80
-
81
- export { createHttpRequester };
82
- //# sourceMappingURL=requester.http.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"requester.http.js","sources":["../../../../../node_modules/@algolia/requester-node-http/dist/requester.http.js"],"sourcesContent":["// src/createHttpRequester.ts\nimport http from \"http\";\nimport https from \"https\";\nimport { URL } from \"url\";\nvar agentOptions = { keepAlive: true };\nvar defaultHttpAgent = new http.Agent(agentOptions);\nvar defaultHttpsAgent = new https.Agent(agentOptions);\nfunction createHttpRequester({\n agent: userGlobalAgent,\n httpAgent: userHttpAgent,\n httpsAgent: userHttpsAgent,\n requesterOptions = {}\n} = {}) {\n const httpAgent = userHttpAgent || userGlobalAgent || defaultHttpAgent;\n const httpsAgent = userHttpsAgent || userGlobalAgent || defaultHttpsAgent;\n function send(request) {\n return new Promise((resolve) => {\n let responseTimeout;\n let connectTimeout;\n const url = new URL(request.url);\n const path = url.search === null ? url.pathname : `${url.pathname}${url.search}`;\n const options = {\n agent: url.protocol === \"https:\" ? httpsAgent : httpAgent,\n hostname: url.hostname,\n path,\n method: request.method,\n ...requesterOptions,\n headers: {\n ...request.headers,\n ...requesterOptions.headers\n }\n };\n if (url.port && !requesterOptions.port) {\n options.port = url.port;\n }\n const req = (url.protocol === \"https:\" ? https : http).request(options, (response) => {\n let contentBuffers = [];\n response.on(\"data\", (chunk) => {\n contentBuffers = contentBuffers.concat(chunk);\n });\n response.on(\"end\", () => {\n clearTimeout(connectTimeout);\n clearTimeout(responseTimeout);\n resolve({\n status: response.statusCode || 0,\n content: Buffer.concat(contentBuffers).toString(),\n isTimedOut: false\n });\n });\n });\n const createTimeout = (timeout, content) => {\n return setTimeout(() => {\n req.destroy();\n resolve({\n status: 0,\n content,\n isTimedOut: true\n });\n }, timeout);\n };\n connectTimeout = createTimeout(request.connectTimeout, \"Connection timeout\");\n req.on(\"error\", (error) => {\n clearTimeout(connectTimeout);\n clearTimeout(responseTimeout);\n resolve({ status: 0, content: error.message, isTimedOut: false });\n });\n req.once(\"response\", () => {\n clearTimeout(connectTimeout);\n responseTimeout = createTimeout(request.responseTimeout, \"Socket timeout\");\n });\n if (request.data !== void 0) {\n req.write(request.data);\n }\n req.end();\n });\n }\n return { send };\n}\nexport {\n createHttpRequester\n};\n//# sourceMappingURL=requester.http.js.map"],"names":[],"mappings":";;;;AAAA;AAIA,IAAI,YAAY,GAAG,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;AACvC,IAAI,gBAAgB,GAAG,IAAI,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;AACpD,IAAI,iBAAiB,GAAG,IAAI,KAAK,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;AACtD,SAAS,mBAAmB,CAAC;AAC7B,EAAE,KAAK,EAAE,eAAe;AACxB,EAAE,SAAS,E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CAAC,CAAC;AACtC,QAAQ,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC,CAAC;AAC1E,OAAO,CAAC,CAAC;AACT,MAAM,GAAG,CAAC,IAAI,CAAC,UAAU,EAAE,MAAM;AACjC,QAAQ,YAAY,CAAC,cAAc,CAAC,CAAC;AACrC,QAAQ,eAAe,GAAG,aAAa,CAAC,OAAO,CAAC,eAAe,EAAE,gBAAgB,CAAC,CAAC;AACnF,OAAO,CAAC,CAAC;AACT,MAAM,IAAI,OAAO,CAAC,IAAI,KAAK,KAAK,CAAC,EAAE;AACnC,QAAQ,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AAChC,OAAO;AACP,MAAM,GAAG,CAAC,GAAG,EAAE,CAAC;AAChB,KAAK,CAAC,CAAC;AACP,GAAG;AACH,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;AAClB;;;;","x_google_ignoreList":[0]}
@@ -1,272 +0,0 @@
1
- import { createXhrRequester as m } from '../../../../@algolia/requester-browser-xhr/dist/requester.xhr.js';
2
- import { createNullLogger, createMemoryCache, createFallbackableCache, createTransporter, getAlgoliaAgent, createBrowserLocalStorageCache, shuffle, createAuth } from '../../../../@algolia/client-common/dist/common.js';
3
-
4
- // lite/builds/browser.ts
5
- var apiClientVersion = "5.40.0";
6
- function getDefaultHosts(appId) {
7
- return [
8
- {
9
- url: `${appId}-dsn.algolia.net`,
10
- accept: "read",
11
- protocol: "https"
12
- },
13
- {
14
- url: `${appId}.algolia.net`,
15
- accept: "write",
16
- protocol: "https"
17
- }
18
- ].concat(
19
- shuffle([
20
- {
21
- url: `${appId}-1.algolianet.com`,
22
- accept: "readWrite",
23
- protocol: "https"
24
- },
25
- {
26
- url: `${appId}-2.algolianet.com`,
27
- accept: "readWrite",
28
- protocol: "https"
29
- },
30
- {
31
- url: `${appId}-3.algolianet.com`,
32
- accept: "readWrite",
33
- protocol: "https"
34
- }
35
- ])
36
- );
37
- }
38
- function createLiteClient({
39
- appId: appIdOption,
40
- apiKey: apiKeyOption,
41
- authMode,
42
- algoliaAgents,
43
- ...options
44
- }) {
45
- const auth = createAuth(appIdOption, apiKeyOption, authMode);
46
- const transporter = createTransporter({
47
- hosts: getDefaultHosts(appIdOption),
48
- ...options,
49
- algoliaAgent: getAlgoliaAgent({
50
- algoliaAgents,
51
- client: "Lite",
52
- version: apiClientVersion
53
- }),
54
- baseHeaders: {
55
- "content-type": "text/plain",
56
- ...auth.headers(),
57
- ...options.baseHeaders
58
- },
59
- baseQueryParameters: {
60
- ...auth.queryParameters(),
61
- ...options.baseQueryParameters
62
- }
63
- });
64
- return {
65
- transporter,
66
- /**
67
- * The `appId` currently in use.
68
- */
69
- appId: appIdOption,
70
- /**
71
- * The `apiKey` currently in use.
72
- */
73
- apiKey: apiKeyOption,
74
- /**
75
- * Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
76
- */
77
- clearCache() {
78
- return Promise.all([transporter.requestsCache.clear(), transporter.responsesCache.clear()]).then(() => void 0);
79
- },
80
- /**
81
- * Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
82
- */
83
- get _ua() {
84
- return transporter.algoliaAgent.value;
85
- },
86
- /**
87
- * Adds a `segment` to the `x-algolia-agent` sent with every requests.
88
- *
89
- * @param segment - The algolia agent (user-agent) segment to add.
90
- * @param version - The version of the agent.
91
- */
92
- addAlgoliaAgent(segment, version) {
93
- transporter.algoliaAgent.add({ segment, version });
94
- },
95
- /**
96
- * Helper method to switch the API key used to authenticate the requests.
97
- *
98
- * @param params - Method params.
99
- * @param params.apiKey - The new API Key to use.
100
- */
101
- setClientApiKey({ apiKey }) {
102
- if (!authMode || authMode === "WithinHeaders") {
103
- transporter.baseHeaders["x-algolia-api-key"] = apiKey;
104
- } else {
105
- transporter.baseQueryParameters["x-algolia-api-key"] = apiKey;
106
- }
107
- },
108
- /**
109
- * Helper: calls the `search` method but with certainty that we will only request Algolia records (hits) and not facets.
110
- * 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.
111
- *
112
- * @summary Search multiple indices for `hits`.
113
- * @param searchMethodParams - Query requests and strategies. Results will be received in the same order as the queries.
114
- * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
115
- */
116
- searchForHits(searchMethodParams, requestOptions) {
117
- return this.search(searchMethodParams, requestOptions);
118
- },
119
- /**
120
- * Helper: calls the `search` method but with certainty that we will only request Algolia facets and not records (hits).
121
- * 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.
122
- *
123
- * @summary Search multiple indices for `facets`.
124
- * @param searchMethodParams - Query requests and strategies. Results will be received in the same order as the queries.
125
- * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
126
- */
127
- searchForFacets(searchMethodParams, requestOptions) {
128
- return this.search(searchMethodParams, requestOptions);
129
- },
130
- /**
131
- * This method lets you send requests to the Algolia REST API.
132
- * @param customPost - The customPost object.
133
- * @param customPost.path - Path of the endpoint, for example `1/newFeature`.
134
- * @param customPost.parameters - Query parameters to apply to the current query.
135
- * @param customPost.body - Parameters to send with the custom request.
136
- * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
137
- */
138
- customPost({ path, parameters, body }, requestOptions) {
139
- if (!path) {
140
- throw new Error("Parameter `path` is required when calling `customPost`.");
141
- }
142
- const requestPath = "/{path}".replace("{path}", path);
143
- const headers = {};
144
- const queryParameters = parameters ? parameters : {};
145
- const request = {
146
- method: "POST",
147
- path: requestPath,
148
- queryParameters,
149
- headers,
150
- data: body ? body : {}
151
- };
152
- return transporter.request(request, requestOptions);
153
- },
154
- /**
155
- * Retrieves recommendations from selected AI models.
156
- *
157
- * Required API Key ACLs:
158
- * - search
159
- * @param getRecommendationsParams - The getRecommendationsParams object.
160
- * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
161
- */
162
- getRecommendations(getRecommendationsParams, requestOptions) {
163
- if (getRecommendationsParams && Array.isArray(getRecommendationsParams)) {
164
- const newSignatureRequest = {
165
- requests: getRecommendationsParams
166
- };
167
- getRecommendationsParams = newSignatureRequest;
168
- }
169
- if (!getRecommendationsParams) {
170
- throw new Error("Parameter `getRecommendationsParams` is required when calling `getRecommendations`.");
171
- }
172
- if (!getRecommendationsParams.requests) {
173
- throw new Error("Parameter `getRecommendationsParams.requests` is required when calling `getRecommendations`.");
174
- }
175
- const requestPath = "/1/indexes/*/recommendations";
176
- const headers = {};
177
- const queryParameters = {};
178
- const request = {
179
- method: "POST",
180
- path: requestPath,
181
- queryParameters,
182
- headers,
183
- data: getRecommendationsParams,
184
- useReadTransporter: true,
185
- cacheable: true
186
- };
187
- return transporter.request(request, requestOptions);
188
- },
189
- /**
190
- * 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.
191
- *
192
- * Required API Key ACLs:
193
- * - search
194
- * @param searchMethodParams - Muli-search request body. Results are returned in the same order as the requests.
195
- * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
196
- */
197
- search(searchMethodParams, requestOptions) {
198
- if (searchMethodParams && Array.isArray(searchMethodParams)) {
199
- const newSignatureRequest = {
200
- requests: searchMethodParams.map(({ params, ...legacyRequest }) => {
201
- if (legacyRequest.type === "facet") {
202
- return {
203
- ...legacyRequest,
204
- ...params,
205
- type: "facet"
206
- };
207
- }
208
- return {
209
- ...legacyRequest,
210
- ...params,
211
- facet: void 0,
212
- maxFacetHits: void 0,
213
- facetQuery: void 0
214
- };
215
- })
216
- };
217
- searchMethodParams = newSignatureRequest;
218
- }
219
- if (!searchMethodParams) {
220
- throw new Error("Parameter `searchMethodParams` is required when calling `search`.");
221
- }
222
- if (!searchMethodParams.requests) {
223
- throw new Error("Parameter `searchMethodParams.requests` is required when calling `search`.");
224
- }
225
- const requestPath = "/1/indexes/*/queries";
226
- const headers = {};
227
- const queryParameters = {};
228
- const request = {
229
- method: "POST",
230
- path: requestPath,
231
- queryParameters,
232
- headers,
233
- data: searchMethodParams,
234
- useReadTransporter: true,
235
- cacheable: true
236
- };
237
- return transporter.request(request, requestOptions);
238
- }
239
- };
240
- }
241
-
242
- // lite/builds/browser.ts
243
- function liteClient(appId, apiKey, options) {
244
- if (!appId || typeof appId !== "string") {
245
- throw new Error("`appId` is missing.");
246
- }
247
- if (!apiKey || typeof apiKey !== "string") {
248
- throw new Error("`apiKey` is missing.");
249
- }
250
- return createLiteClient({
251
- appId,
252
- apiKey,
253
- timeouts: {
254
- connect: 1e3,
255
- read: 2e3,
256
- write: 3e4
257
- },
258
- logger: createNullLogger(),
259
- requester: m(),
260
- algoliaAgents: [{ segment: "Browser" }],
261
- authMode: "WithinQueryParameters",
262
- responsesCache: createMemoryCache(),
263
- requestsCache: createMemoryCache({ serializable: false }),
264
- hostsCache: createFallbackableCache({
265
- caches: [createBrowserLocalStorageCache({ key: `${apiClientVersion}-${appId}` }), createMemoryCache()]
266
- }),
267
- ...options
268
- });
269
- }
270
-
271
- export { apiClientVersion, liteClient };
272
- //# sourceMappingURL=browser.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"browser.js","sources":["../../../../../../node_modules/algoliasearch/dist/lite/builds/browser.js"],"sourcesContent":["// lite/builds/browser.ts\nimport { createXhrRequester } from \"@algolia/requester-browser-xhr\";\nimport {\n createBrowserLocalStorageCache,\n createFallbackableCache,\n createMemoryCache,\n createNullLogger\n} from \"@algolia/client-common\";\n\n// lite/src/liteClient.ts\nimport { createAuth, createTransporter, getAlgoliaAgent, shuffle } from \"@algolia/client-common\";\nvar apiClientVersion = \"5.40.0\";\nfunction getDefaultHosts(appId) {\n return [\n {\n url: `${appId}-dsn.algolia.net`,\n accept: \"read\",\n protocol: \"https\"\n },\n {\n url: `${appId}.algolia.net`,\n accept: \"write\",\n protocol: \"https\"\n }\n ].concat(\n shuffle([\n {\n url: `${appId}-1.algolianet.com`,\n accept: \"readWrite\",\n protocol: \"https\"\n },\n {\n url: `${appId}-2.algolianet.com`,\n accept: \"readWrite\",\n protocol: \"https\"\n },\n {\n url: `${appId}-3.algolianet.com`,\n accept: \"readWrite\",\n protocol: \"https\"\n }\n ])\n );\n}\nfunction createLiteClient({\n appId: appIdOption,\n apiKey: apiKeyOption,\n authMode,\n algoliaAgents,\n ...options\n}) {\n const auth = createAuth(appIdOption, apiKeyOption, authMode);\n const transporter = createTransporter({\n hosts: getDefaultHosts(appIdOption),\n ...options,\n algoliaAgent: getAlgoliaAgent({\n algoliaAgents,\n client: \"Lite\",\n version: apiClientVersion\n }),\n baseHeaders: {\n \"content-type\": \"text/plain\",\n ...auth.headers(),\n ...options.baseHeaders\n },\n baseQueryParameters: {\n ...auth.queryParameters(),\n ...options.baseQueryParameters\n }\n });\n return {\n transporter,\n /**\n * The `appId` currently in use.\n */\n appId: appIdOption,\n /**\n * The `apiKey` currently in use.\n */\n apiKey: apiKeyOption,\n /**\n * Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.\n */\n clearCache() {\n return Promise.all([transporter.requestsCache.clear(), transporter.responsesCache.clear()]).then(() => void 0);\n },\n /**\n * Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.\n */\n get _ua() {\n return transporter.algoliaAgent.value;\n },\n /**\n * Adds a `segment` to the `x-algolia-agent` sent with every requests.\n *\n * @param segment - The algolia agent (user-agent) segment to add.\n * @param version - The version of the agent.\n */\n addAlgoliaAgent(segment, version) {\n transporter.algoliaAgent.add({ segment, version });\n },\n /**\n * Helper method to switch the API key used to authenticate the requests.\n *\n * @param params - Method params.\n * @param params.apiKey - The new API Key to use.\n */\n setClientApiKey({ apiKey }) {\n if (!authMode || authMode === \"WithinHeaders\") {\n transporter.baseHeaders[\"x-algolia-api-key\"] = apiKey;\n } else {\n transporter.baseQueryParameters[\"x-algolia-api-key\"] = apiKey;\n }\n },\n /**\n * Helper: calls the `search` method but with certainty that we will only request Algolia records (hits) and not facets.\n * 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.\n *\n * @summary Search multiple indices for `hits`.\n * @param searchMethodParams - Query requests and strategies. Results will be received in the same order as the queries.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n searchForHits(searchMethodParams, requestOptions) {\n return this.search(searchMethodParams, requestOptions);\n },\n /**\n * Helper: calls the `search` method but with certainty that we will only request Algolia facets and not records (hits).\n * 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.\n *\n * @summary Search multiple indices for `facets`.\n * @param searchMethodParams - Query requests and strategies. Results will be received in the same order as the queries.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n searchForFacets(searchMethodParams, requestOptions) {\n return this.search(searchMethodParams, requestOptions);\n },\n /**\n * This method lets you send requests to the Algolia REST API.\n * @param customPost - The customPost object.\n * @param customPost.path - Path of the endpoint, for example `1/newFeature`.\n * @param customPost.parameters - Query parameters to apply to the current query.\n * @param customPost.body - Parameters to send with the custom request.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n customPost({ path, parameters, body }, requestOptions) {\n if (!path) {\n throw new Error(\"Parameter `path` is required when calling `customPost`.\");\n }\n const requestPath = \"/{path}\".replace(\"{path}\", path);\n const headers = {};\n const queryParameters = parameters ? parameters : {};\n const request = {\n method: \"POST\",\n path: requestPath,\n queryParameters,\n headers,\n data: body ? body : {}\n };\n return transporter.request(request, requestOptions);\n },\n /**\n * Retrieves recommendations from selected AI models.\n *\n * Required API Key ACLs:\n * - search\n * @param getRecommendationsParams - The getRecommendationsParams object.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n getRecommendations(getRecommendationsParams, requestOptions) {\n if (getRecommendationsParams && Array.isArray(getRecommendationsParams)) {\n const newSignatureRequest = {\n requests: getRecommendationsParams\n };\n getRecommendationsParams = newSignatureRequest;\n }\n if (!getRecommendationsParams) {\n throw new Error(\"Parameter `getRecommendationsParams` is required when calling `getRecommendations`.\");\n }\n if (!getRecommendationsParams.requests) {\n throw new Error(\"Parameter `getRecommendationsParams.requests` is required when calling `getRecommendations`.\");\n }\n const requestPath = \"/1/indexes/*/recommendations\";\n const headers = {};\n const queryParameters = {};\n const request = {\n method: \"POST\",\n path: requestPath,\n queryParameters,\n headers,\n data: getRecommendationsParams,\n useReadTransporter: true,\n cacheable: true\n };\n return transporter.request(request, requestOptions);\n },\n /**\n * 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.\n *\n * Required API Key ACLs:\n * - search\n * @param searchMethodParams - Muli-search request body. Results are returned in the same order as the requests.\n * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.\n */\n search(searchMethodParams, requestOptions) {\n if (searchMethodParams && Array.isArray(searchMethodParams)) {\n const newSignatureRequest = {\n requests: searchMethodParams.map(({ params, ...legacyRequest }) => {\n if (legacyRequest.type === \"facet\") {\n return {\n ...legacyRequest,\n ...params,\n type: \"facet\"\n };\n }\n return {\n ...legacyRequest,\n ...params,\n facet: void 0,\n maxFacetHits: void 0,\n facetQuery: void 0\n };\n })\n };\n searchMethodParams = newSignatureRequest;\n }\n if (!searchMethodParams) {\n throw new Error(\"Parameter `searchMethodParams` is required when calling `search`.\");\n }\n if (!searchMethodParams.requests) {\n throw new Error(\"Parameter `searchMethodParams.requests` is required when calling `search`.\");\n }\n const requestPath = \"/1/indexes/*/queries\";\n const headers = {};\n const queryParameters = {};\n const request = {\n method: \"POST\",\n path: requestPath,\n queryParameters,\n headers,\n data: searchMethodParams,\n useReadTransporter: true,\n cacheable: true\n };\n return transporter.request(request, requestOptions);\n }\n };\n}\n\n// lite/builds/browser.ts\nfunction liteClient(appId, apiKey, options) {\n if (!appId || typeof appId !== \"string\") {\n throw new Error(\"`appId` is missing.\");\n }\n if (!apiKey || typeof apiKey !== \"string\") {\n throw new Error(\"`apiKey` is missing.\");\n }\n return createLiteClient({\n appId,\n apiKey,\n timeouts: {\n connect: 1e3,\n read: 2e3,\n write: 3e4\n },\n logger: createNullLogger(),\n requester: createXhrRequester(),\n algoliaAgents: [{ segment: \"Browser\" }],\n authMode: \"WithinQueryParameters\",\n responsesCache: createMemoryCache(),\n requestsCache: createMemoryCache({ serializable: false }),\n hostsCache: createFallbackableCache({\n caches: [createBrowserLocalStorageCache({ key: `${apiClientVersion}-${appId}` }), createMemoryCache()]\n }),\n ...options\n });\n}\nexport {\n apiClientVersion,\n liteClient\n};\n//# sourceMappingURL=browser.js.map"],"names":["createXhrRequester"],"mappings":";;;AAAA;AAWG,IAAC,gBAAgB,GAAG,SAAS;AAChC,SAAS,eAAe,CAAC,KAAK,EAAE;AAChC,EAAE,OAAO;AACT,IAAI;AACJ,MAAM,GAAG,EAAE,CAAC,EAAE,KAAK,CAAC,gBAAgB,CAAC;AACrC,MAAM,MAAM,EAAE,MAAM;AACpB,MAAM,QAAQ,EAAE,OAAO;AACvB,KAAK;AACL,IAAI;AACJ,MAAM,GAAG,EAAE,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC;AACjC,MAAM,MAAM,EAAE,OAAO;AACrB,MAAM,QAAQ,EAAE,OAAO;AACvB,KAAK;AACL,GAAG,CAAC,MAAM;AACV,IAAI,OAAO,CAAC;AACZ,MAAM;AACN,QAAQ,GAAG,EAAE,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC;AACxC,QAAQ,MAAM,EAAE,WAAW;AAC3B,QAAQ,QAAQ,EAAE,OAAO;AACzB,OAAO;AACP,MAAM;AACN,QAAQ,GAAG,EAAE,CAAC,EAAE,KAAK,C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B,EAAE;AAC9B,IAAI,SAAS,EAAEA,CAAkB,EAAE;AACnC,IAAI,aAAa,EAAE,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC;AAC3C,IAAI,QAAQ,EAAE,uBAAuB;AACrC,IAAI,cAAc,EAAE,iBAAiB,EAAE;AACvC,IAAI,aAAa,EAAE,iBAAiB,CAAC,EAAE,YAAY,EAAE,KAAK,EAAE,CAAC;AAC7D,IAAI,UAAU,EAAE,uBAAuB,CAAC;AACxC,MAAM,MAAM,EAAE,CAAC,8BAA8B,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,gBAAgB,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,iBAAiB,EAAE,CAAC;AAC5G,KAAK,CAAC;AACN,IAAI,GAAG,OAAO;AACd,GAAG,CAAC,CAAC;AACL;;;;","x_google_ignoreList":[0]}
@@ -1,269 +0,0 @@
1
- import { createHttpRequester } from '../../../../@algolia/requester-node-http/dist/requester.http.js';
2
- import { createNullLogger, createNullCache, createMemoryCache, createTransporter, getAlgoliaAgent, shuffle, createAuth } from '../../../../@algolia/client-common/dist/common.js';
3
-
4
- // lite/builds/node.ts
5
- var apiClientVersion = "5.40.0";
6
- function getDefaultHosts(appId) {
7
- return [
8
- {
9
- url: `${appId}-dsn.algolia.net`,
10
- accept: "read",
11
- protocol: "https"
12
- },
13
- {
14
- url: `${appId}.algolia.net`,
15
- accept: "write",
16
- protocol: "https"
17
- }
18
- ].concat(
19
- shuffle([
20
- {
21
- url: `${appId}-1.algolianet.com`,
22
- accept: "readWrite",
23
- protocol: "https"
24
- },
25
- {
26
- url: `${appId}-2.algolianet.com`,
27
- accept: "readWrite",
28
- protocol: "https"
29
- },
30
- {
31
- url: `${appId}-3.algolianet.com`,
32
- accept: "readWrite",
33
- protocol: "https"
34
- }
35
- ])
36
- );
37
- }
38
- function createLiteClient({
39
- appId: appIdOption,
40
- apiKey: apiKeyOption,
41
- authMode,
42
- algoliaAgents,
43
- ...options
44
- }) {
45
- const auth = createAuth(appIdOption, apiKeyOption, authMode);
46
- const transporter = createTransporter({
47
- hosts: getDefaultHosts(appIdOption),
48
- ...options,
49
- algoliaAgent: getAlgoliaAgent({
50
- algoliaAgents,
51
- client: "Lite",
52
- version: apiClientVersion
53
- }),
54
- baseHeaders: {
55
- "content-type": "text/plain",
56
- ...auth.headers(),
57
- ...options.baseHeaders
58
- },
59
- baseQueryParameters: {
60
- ...auth.queryParameters(),
61
- ...options.baseQueryParameters
62
- }
63
- });
64
- return {
65
- transporter,
66
- /**
67
- * The `appId` currently in use.
68
- */
69
- appId: appIdOption,
70
- /**
71
- * The `apiKey` currently in use.
72
- */
73
- apiKey: apiKeyOption,
74
- /**
75
- * Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
76
- */
77
- clearCache() {
78
- return Promise.all([transporter.requestsCache.clear(), transporter.responsesCache.clear()]).then(() => void 0);
79
- },
80
- /**
81
- * Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
82
- */
83
- get _ua() {
84
- return transporter.algoliaAgent.value;
85
- },
86
- /**
87
- * Adds a `segment` to the `x-algolia-agent` sent with every requests.
88
- *
89
- * @param segment - The algolia agent (user-agent) segment to add.
90
- * @param version - The version of the agent.
91
- */
92
- addAlgoliaAgent(segment, version) {
93
- transporter.algoliaAgent.add({ segment, version });
94
- },
95
- /**
96
- * Helper method to switch the API key used to authenticate the requests.
97
- *
98
- * @param params - Method params.
99
- * @param params.apiKey - The new API Key to use.
100
- */
101
- setClientApiKey({ apiKey }) {
102
- if (!authMode || authMode === "WithinHeaders") {
103
- transporter.baseHeaders["x-algolia-api-key"] = apiKey;
104
- } else {
105
- transporter.baseQueryParameters["x-algolia-api-key"] = apiKey;
106
- }
107
- },
108
- /**
109
- * Helper: calls the `search` method but with certainty that we will only request Algolia records (hits) and not facets.
110
- * 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.
111
- *
112
- * @summary Search multiple indices for `hits`.
113
- * @param searchMethodParams - Query requests and strategies. Results will be received in the same order as the queries.
114
- * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
115
- */
116
- searchForHits(searchMethodParams, requestOptions) {
117
- return this.search(searchMethodParams, requestOptions);
118
- },
119
- /**
120
- * Helper: calls the `search` method but with certainty that we will only request Algolia facets and not records (hits).
121
- * 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.
122
- *
123
- * @summary Search multiple indices for `facets`.
124
- * @param searchMethodParams - Query requests and strategies. Results will be received in the same order as the queries.
125
- * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
126
- */
127
- searchForFacets(searchMethodParams, requestOptions) {
128
- return this.search(searchMethodParams, requestOptions);
129
- },
130
- /**
131
- * This method lets you send requests to the Algolia REST API.
132
- * @param customPost - The customPost object.
133
- * @param customPost.path - Path of the endpoint, for example `1/newFeature`.
134
- * @param customPost.parameters - Query parameters to apply to the current query.
135
- * @param customPost.body - Parameters to send with the custom request.
136
- * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
137
- */
138
- customPost({ path, parameters, body }, requestOptions) {
139
- if (!path) {
140
- throw new Error("Parameter `path` is required when calling `customPost`.");
141
- }
142
- const requestPath = "/{path}".replace("{path}", path);
143
- const headers = {};
144
- const queryParameters = parameters ? parameters : {};
145
- const request = {
146
- method: "POST",
147
- path: requestPath,
148
- queryParameters,
149
- headers,
150
- data: body ? body : {}
151
- };
152
- return transporter.request(request, requestOptions);
153
- },
154
- /**
155
- * Retrieves recommendations from selected AI models.
156
- *
157
- * Required API Key ACLs:
158
- * - search
159
- * @param getRecommendationsParams - The getRecommendationsParams object.
160
- * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
161
- */
162
- getRecommendations(getRecommendationsParams, requestOptions) {
163
- if (getRecommendationsParams && Array.isArray(getRecommendationsParams)) {
164
- const newSignatureRequest = {
165
- requests: getRecommendationsParams
166
- };
167
- getRecommendationsParams = newSignatureRequest;
168
- }
169
- if (!getRecommendationsParams) {
170
- throw new Error("Parameter `getRecommendationsParams` is required when calling `getRecommendations`.");
171
- }
172
- if (!getRecommendationsParams.requests) {
173
- throw new Error("Parameter `getRecommendationsParams.requests` is required when calling `getRecommendations`.");
174
- }
175
- const requestPath = "/1/indexes/*/recommendations";
176
- const headers = {};
177
- const queryParameters = {};
178
- const request = {
179
- method: "POST",
180
- path: requestPath,
181
- queryParameters,
182
- headers,
183
- data: getRecommendationsParams,
184
- useReadTransporter: true,
185
- cacheable: true
186
- };
187
- return transporter.request(request, requestOptions);
188
- },
189
- /**
190
- * 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.
191
- *
192
- * Required API Key ACLs:
193
- * - search
194
- * @param searchMethodParams - Muli-search request body. Results are returned in the same order as the requests.
195
- * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
196
- */
197
- search(searchMethodParams, requestOptions) {
198
- if (searchMethodParams && Array.isArray(searchMethodParams)) {
199
- const newSignatureRequest = {
200
- requests: searchMethodParams.map(({ params, ...legacyRequest }) => {
201
- if (legacyRequest.type === "facet") {
202
- return {
203
- ...legacyRequest,
204
- ...params,
205
- type: "facet"
206
- };
207
- }
208
- return {
209
- ...legacyRequest,
210
- ...params,
211
- facet: void 0,
212
- maxFacetHits: void 0,
213
- facetQuery: void 0
214
- };
215
- })
216
- };
217
- searchMethodParams = newSignatureRequest;
218
- }
219
- if (!searchMethodParams) {
220
- throw new Error("Parameter `searchMethodParams` is required when calling `search`.");
221
- }
222
- if (!searchMethodParams.requests) {
223
- throw new Error("Parameter `searchMethodParams.requests` is required when calling `search`.");
224
- }
225
- const requestPath = "/1/indexes/*/queries";
226
- const headers = {};
227
- const queryParameters = {};
228
- const request = {
229
- method: "POST",
230
- path: requestPath,
231
- queryParameters,
232
- headers,
233
- data: searchMethodParams,
234
- useReadTransporter: true,
235
- cacheable: true
236
- };
237
- return transporter.request(request, requestOptions);
238
- }
239
- };
240
- }
241
-
242
- // lite/builds/node.ts
243
- function liteClient(appId, apiKey, options) {
244
- if (!appId || typeof appId !== "string") {
245
- throw new Error("`appId` is missing.");
246
- }
247
- if (!apiKey || typeof apiKey !== "string") {
248
- throw new Error("`apiKey` is missing.");
249
- }
250
- return createLiteClient({
251
- appId,
252
- apiKey,
253
- timeouts: {
254
- connect: 2e3,
255
- read: 5e3,
256
- write: 3e4
257
- },
258
- logger: createNullLogger(),
259
- requester: createHttpRequester(),
260
- algoliaAgents: [{ segment: "Node.js", version: process.versions.node }],
261
- responsesCache: createNullCache(),
262
- requestsCache: createNullCache(),
263
- hostsCache: createMemoryCache(),
264
- ...options
265
- });
266
- }
267
-
268
- export { apiClientVersion, liteClient };
269
- //# sourceMappingURL=node.js.map