@wix/search 1.0.36 → 1.0.37

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/search",
3
- "version": "1.0.36",
3
+ "version": "1.0.37",
4
4
  "publishConfig": {
5
5
  "registry": "https://registry.npmjs.org/",
6
6
  "access": "public"
@@ -18,8 +18,8 @@
18
18
  "type-bundles"
19
19
  ],
20
20
  "dependencies": {
21
- "@wix/search_site-search": "1.0.23",
22
- "@wix/search_wix-site-search": "1.0.14"
21
+ "@wix/search_site-search": "1.0.24",
22
+ "@wix/search_wix-site-search": "1.0.15"
23
23
  },
24
24
  "devDependencies": {
25
25
  "glob": "^10.4.1",
@@ -44,5 +44,5 @@
44
44
  "fqdn": ""
45
45
  }
46
46
  },
47
- "falconPackageHash": "b0479d3a057bc39aacafaae456145287a381bf362346fa0e2f2052f5"
47
+ "falconPackageHash": "6323dd4dd320358e403019c826eaeaf75534e19c74cbeda637857c36"
48
48
  }
@@ -1,3 +1,37 @@
1
+ type RESTFunctionDescriptor<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient) => T;
2
+ interface HttpClient {
3
+ request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
4
+ fetchWithAuth: typeof fetch;
5
+ wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
6
+ }
7
+ type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
8
+ type HttpResponse<T = any> = {
9
+ data: T;
10
+ status: number;
11
+ statusText: string;
12
+ headers: any;
13
+ request?: any;
14
+ };
15
+ type RequestOptions<_TResponse = any, Data = any> = {
16
+ method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
17
+ url: string;
18
+ data?: Data;
19
+ params?: URLSearchParams;
20
+ } & APIMetadata;
21
+ type APIMetadata = {
22
+ methodFqn?: string;
23
+ entityFqdn?: string;
24
+ packageName?: string;
25
+ };
26
+ type BuildRESTFunction<T extends RESTFunctionDescriptor> = T extends RESTFunctionDescriptor<infer U> ? U : never;
27
+
28
+ declare global {
29
+ // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
30
+ interface SymbolConstructor {
31
+ readonly observable: symbol;
32
+ }
33
+ }
34
+
1
35
  interface SiteDocument$1 {
2
36
  /**
3
37
  * Result ID.
@@ -298,42 +332,20 @@ interface SearchOptions$1 {
298
332
  language?: string | null;
299
333
  }
300
334
 
301
- type RESTFunctionDescriptor<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient) => T;
302
- interface HttpClient {
303
- request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
304
- fetchWithAuth: typeof fetch;
305
- wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
306
- }
307
- type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
308
- type HttpResponse<T = any> = {
309
- data: T;
310
- status: number;
311
- statusText: string;
312
- headers: any;
313
- request?: any;
314
- };
315
- type RequestOptions<_TResponse = any, Data = any> = {
316
- method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
317
- url: string;
318
- data?: Data;
319
- params?: URLSearchParams;
320
- } & APIMetadata;
321
- type APIMetadata = {
322
- methodFqn?: string;
323
- entityFqdn?: string;
324
- packageName?: string;
325
- };
326
- type BuildRESTFunction<T extends RESTFunctionDescriptor> = T extends RESTFunctionDescriptor<infer U> ? U : never;
327
-
328
- declare global {
329
- // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
330
- interface SymbolConstructor {
331
- readonly observable: symbol;
332
- }
335
+ declare function search$3(httpClient: HttpClient): SearchSignature$1;
336
+ interface SearchSignature$1 {
337
+ /**
338
+ * Retrieves a list of site documents that match the provided search query and optionally performs aggregations on the data queried.
339
+ *
340
+ * The Search API supports the document types listed in the [Introduction](https://dev.wix.com/docs/rest/business-management/search/wix-site-search/introduction), each with its own schema. These schemas define the fields available for filtering, sorting, and free-text searching.
341
+ *
342
+ * To learn more about working with the search query, see [API Query Language](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language) and [Sorting and Paging](https://dev.wix.com/docs/rest/articles/getting-started/sorting-and-paging).
343
+ * @param - Search query and aggregation information.
344
+ * @param - Document type to search in.
345
+ */
346
+ (search: Search, documentType: DocumentType, options?: SearchOptions$1 | undefined): Promise<SearchResponse$1 & SearchResponseNonNullableFields$1>;
333
347
  }
334
348
 
335
- declare function search$3(httpClient: HttpClient): (search: Search, documentType: DocumentType, options?: SearchOptions$1) => Promise<SearchResponse$1 & SearchResponseNonNullableFields$1>;
336
-
337
349
  declare function createRESTModule$1<T extends RESTFunctionDescriptor>(descriptor: T, elevated?: boolean): BuildRESTFunction<T> & T;
338
350
 
339
351
  type _publicSearchType$1 = typeof search$3;
@@ -1180,14 +1192,68 @@ interface TrendingOptions {
1180
1192
  includeSeoHidden?: boolean | null;
1181
1193
  }
1182
1194
 
1183
- declare function search$1(httpClient: HttpClient): (options?: SearchOptions) => Promise<SearchResponse & SearchResponseNonNullableFields>;
1184
- declare function federatedSearch$1(httpClient: HttpClient): (options?: FederatedSearchOptions) => Promise<FederatedSearchResponse & FederatedSearchResponseNonNullableFields>;
1185
- declare function suggest$1(httpClient: HttpClient): (options?: SuggestOptions) => Promise<SuggestResponse>;
1186
- declare function federatedSuggest$1(httpClient: HttpClient): (options?: FederatedSuggestOptions) => Promise<FederatedSuggestResponse>;
1187
- declare function related$1(httpClient: HttpClient): (options?: RelatedOptions) => Promise<RelatedResponse>;
1188
- declare function autocomplete$1(httpClient: HttpClient): (options?: AutocompleteOptions) => Promise<AutocompleteResponse & AutocompleteResponseNonNullableFields>;
1189
- declare function federatedAutocomplete$1(httpClient: HttpClient): (options?: FederatedAutocompleteOptions) => Promise<FederatedAutocompleteResponse & FederatedAutocompleteResponseNonNullableFields>;
1190
- declare function trending$1(httpClient: HttpClient): (options?: TrendingOptions) => Promise<TrendingResponse & TrendingResponseNonNullableFields>;
1195
+ declare function search$1(httpClient: HttpClient): SearchSignature;
1196
+ interface SearchSignature {
1197
+ /**
1198
+ * Executes a regular search query.
1199
+ * If you are unsure, this is likely the search method you want to used.
1200
+ */
1201
+ (options?: SearchOptions | undefined): Promise<SearchResponse & SearchResponseNonNullableFields>;
1202
+ }
1203
+ declare function federatedSearch$1(httpClient: HttpClient): FederatedSearchSignature;
1204
+ interface FederatedSearchSignature {
1205
+ /**
1206
+ * Searches in multiple document types at once.
1207
+ */
1208
+ (options?: FederatedSearchOptions | undefined): Promise<FederatedSearchResponse & FederatedSearchResponseNonNullableFields>;
1209
+ }
1210
+ declare function suggest$1(httpClient: HttpClient): SuggestSignature;
1211
+ interface SuggestSignature {
1212
+ /**
1213
+ * Executes search query to fetch suggested items. Unlike search query suggest will match
1214
+ * partial phrases (for example "blu" will match documents containing "blue", "blues" and "blunt").
1215
+ * Phrase needs to be at least 3 symbols long. Suggestions can also perform optimisations in search
1216
+ * results and generally do not guarantee the same level of quality as regular Search endpoint.
1217
+ */
1218
+ (options?: SuggestOptions | undefined): Promise<SuggestResponse>;
1219
+ }
1220
+ declare function federatedSuggest$1(httpClient: HttpClient): FederatedSuggestSignature;
1221
+ interface FederatedSuggestSignature {
1222
+ /**
1223
+ * Searches for suggestions in multiple document types at once.
1224
+ */
1225
+ (options?: FederatedSuggestOptions | undefined): Promise<FederatedSuggestResponse>;
1226
+ }
1227
+ declare function related$1(httpClient: HttpClient): RelatedSignature;
1228
+ interface RelatedSignature {
1229
+ /**
1230
+ * Fetches documents similar to one single document.
1231
+ * This is typically used to implement "related to" scenarios (for example to fetch related store products when
1232
+ * consumer is already viewing one).
1233
+ */
1234
+ (options?: RelatedOptions | undefined): Promise<RelatedResponse>;
1235
+ }
1236
+ declare function autocomplete$1(httpClient: HttpClient): AutocompleteSignature;
1237
+ interface AutocompleteSignature {
1238
+ /**
1239
+ * Provides phrase completion. For example "blu" could return "blue", "blues" and "blunt" as candidate phrases. This operation is resource heavy at index time and is reserved for special use cases.
1240
+ */
1241
+ (options?: AutocompleteOptions | undefined): Promise<AutocompleteResponse & AutocompleteResponseNonNullableFields>;
1242
+ }
1243
+ declare function federatedAutocomplete$1(httpClient: HttpClient): FederatedAutocompleteSignature;
1244
+ interface FederatedAutocompleteSignature {
1245
+ /**
1246
+ * Provides phrase completion from multiple document types at once
1247
+ */
1248
+ (options?: FederatedAutocompleteOptions | undefined): Promise<FederatedAutocompleteResponse & FederatedAutocompleteResponseNonNullableFields>;
1249
+ }
1250
+ declare function trending$1(httpClient: HttpClient): TrendingSignature;
1251
+ interface TrendingSignature {
1252
+ /**
1253
+ * Returns trending documents for given document types
1254
+ */
1255
+ (options?: TrendingOptions | undefined): Promise<TrendingResponse & TrendingResponseNonNullableFields>;
1256
+ }
1191
1257
 
1192
1258
  declare function createRESTModule<T extends RESTFunctionDescriptor>(descriptor: T, elevated?: boolean): BuildRESTFunction<T> & T;
1193
1259
 
@@ -1,3 +1,37 @@
1
+ type RESTFunctionDescriptor<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient) => T;
2
+ interface HttpClient {
3
+ request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
4
+ fetchWithAuth: typeof fetch;
5
+ wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
6
+ }
7
+ type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
8
+ type HttpResponse<T = any> = {
9
+ data: T;
10
+ status: number;
11
+ statusText: string;
12
+ headers: any;
13
+ request?: any;
14
+ };
15
+ type RequestOptions<_TResponse = any, Data = any> = {
16
+ method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
17
+ url: string;
18
+ data?: Data;
19
+ params?: URLSearchParams;
20
+ } & APIMetadata;
21
+ type APIMetadata = {
22
+ methodFqn?: string;
23
+ entityFqdn?: string;
24
+ packageName?: string;
25
+ };
26
+ type BuildRESTFunction<T extends RESTFunctionDescriptor> = T extends RESTFunctionDescriptor<infer U> ? U : never;
27
+
28
+ declare global {
29
+ // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
30
+ interface SymbolConstructor {
31
+ readonly observable: symbol;
32
+ }
33
+ }
34
+
1
35
  interface SiteDocument$1 {
2
36
  /**
3
37
  * Result ID.
@@ -298,42 +332,20 @@ interface SearchOptions$1 {
298
332
  language?: string | null;
299
333
  }
300
334
 
301
- type RESTFunctionDescriptor<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient) => T;
302
- interface HttpClient {
303
- request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
304
- fetchWithAuth: typeof fetch;
305
- wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
306
- }
307
- type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
308
- type HttpResponse<T = any> = {
309
- data: T;
310
- status: number;
311
- statusText: string;
312
- headers: any;
313
- request?: any;
314
- };
315
- type RequestOptions<_TResponse = any, Data = any> = {
316
- method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
317
- url: string;
318
- data?: Data;
319
- params?: URLSearchParams;
320
- } & APIMetadata;
321
- type APIMetadata = {
322
- methodFqn?: string;
323
- entityFqdn?: string;
324
- packageName?: string;
325
- };
326
- type BuildRESTFunction<T extends RESTFunctionDescriptor> = T extends RESTFunctionDescriptor<infer U> ? U : never;
327
-
328
- declare global {
329
- // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
330
- interface SymbolConstructor {
331
- readonly observable: symbol;
332
- }
335
+ declare function search$3(httpClient: HttpClient): SearchSignature$1;
336
+ interface SearchSignature$1 {
337
+ /**
338
+ * Retrieves a list of site documents that match the provided search query and optionally performs aggregations on the data queried.
339
+ *
340
+ * The Search API supports the document types listed in the [Introduction](https://dev.wix.com/docs/rest/business-management/search/wix-site-search/introduction), each with its own schema. These schemas define the fields available for filtering, sorting, and free-text searching.
341
+ *
342
+ * To learn more about working with the search query, see [API Query Language](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language) and [Sorting and Paging](https://dev.wix.com/docs/rest/articles/getting-started/sorting-and-paging).
343
+ * @param - Search query and aggregation information.
344
+ * @param - Document type to search in.
345
+ */
346
+ (search: Search, documentType: DocumentType, options?: SearchOptions$1 | undefined): Promise<SearchResponse$1 & SearchResponseNonNullableFields$1>;
333
347
  }
334
348
 
335
- declare function search$3(httpClient: HttpClient): (search: Search, documentType: DocumentType, options?: SearchOptions$1) => Promise<SearchResponse$1 & SearchResponseNonNullableFields$1>;
336
-
337
349
  declare function createRESTModule$1<T extends RESTFunctionDescriptor>(descriptor: T, elevated?: boolean): BuildRESTFunction<T> & T;
338
350
 
339
351
  type _publicSearchType$1 = typeof search$3;
@@ -1180,14 +1192,68 @@ interface TrendingOptions {
1180
1192
  includeSeoHidden?: boolean | null;
1181
1193
  }
1182
1194
 
1183
- declare function search$1(httpClient: HttpClient): (options?: SearchOptions) => Promise<SearchResponse & SearchResponseNonNullableFields>;
1184
- declare function federatedSearch$1(httpClient: HttpClient): (options?: FederatedSearchOptions) => Promise<FederatedSearchResponse & FederatedSearchResponseNonNullableFields>;
1185
- declare function suggest$1(httpClient: HttpClient): (options?: SuggestOptions) => Promise<SuggestResponse>;
1186
- declare function federatedSuggest$1(httpClient: HttpClient): (options?: FederatedSuggestOptions) => Promise<FederatedSuggestResponse>;
1187
- declare function related$1(httpClient: HttpClient): (options?: RelatedOptions) => Promise<RelatedResponse>;
1188
- declare function autocomplete$1(httpClient: HttpClient): (options?: AutocompleteOptions) => Promise<AutocompleteResponse & AutocompleteResponseNonNullableFields>;
1189
- declare function federatedAutocomplete$1(httpClient: HttpClient): (options?: FederatedAutocompleteOptions) => Promise<FederatedAutocompleteResponse & FederatedAutocompleteResponseNonNullableFields>;
1190
- declare function trending$1(httpClient: HttpClient): (options?: TrendingOptions) => Promise<TrendingResponse & TrendingResponseNonNullableFields>;
1195
+ declare function search$1(httpClient: HttpClient): SearchSignature;
1196
+ interface SearchSignature {
1197
+ /**
1198
+ * Executes a regular search query.
1199
+ * If you are unsure, this is likely the search method you want to used.
1200
+ */
1201
+ (options?: SearchOptions | undefined): Promise<SearchResponse & SearchResponseNonNullableFields>;
1202
+ }
1203
+ declare function federatedSearch$1(httpClient: HttpClient): FederatedSearchSignature;
1204
+ interface FederatedSearchSignature {
1205
+ /**
1206
+ * Searches in multiple document types at once.
1207
+ */
1208
+ (options?: FederatedSearchOptions | undefined): Promise<FederatedSearchResponse & FederatedSearchResponseNonNullableFields>;
1209
+ }
1210
+ declare function suggest$1(httpClient: HttpClient): SuggestSignature;
1211
+ interface SuggestSignature {
1212
+ /**
1213
+ * Executes search query to fetch suggested items. Unlike search query suggest will match
1214
+ * partial phrases (for example "blu" will match documents containing "blue", "blues" and "blunt").
1215
+ * Phrase needs to be at least 3 symbols long. Suggestions can also perform optimisations in search
1216
+ * results and generally do not guarantee the same level of quality as regular Search endpoint.
1217
+ */
1218
+ (options?: SuggestOptions | undefined): Promise<SuggestResponse>;
1219
+ }
1220
+ declare function federatedSuggest$1(httpClient: HttpClient): FederatedSuggestSignature;
1221
+ interface FederatedSuggestSignature {
1222
+ /**
1223
+ * Searches for suggestions in multiple document types at once.
1224
+ */
1225
+ (options?: FederatedSuggestOptions | undefined): Promise<FederatedSuggestResponse>;
1226
+ }
1227
+ declare function related$1(httpClient: HttpClient): RelatedSignature;
1228
+ interface RelatedSignature {
1229
+ /**
1230
+ * Fetches documents similar to one single document.
1231
+ * This is typically used to implement "related to" scenarios (for example to fetch related store products when
1232
+ * consumer is already viewing one).
1233
+ */
1234
+ (options?: RelatedOptions | undefined): Promise<RelatedResponse>;
1235
+ }
1236
+ declare function autocomplete$1(httpClient: HttpClient): AutocompleteSignature;
1237
+ interface AutocompleteSignature {
1238
+ /**
1239
+ * Provides phrase completion. For example "blu" could return "blue", "blues" and "blunt" as candidate phrases. This operation is resource heavy at index time and is reserved for special use cases.
1240
+ */
1241
+ (options?: AutocompleteOptions | undefined): Promise<AutocompleteResponse & AutocompleteResponseNonNullableFields>;
1242
+ }
1243
+ declare function federatedAutocomplete$1(httpClient: HttpClient): FederatedAutocompleteSignature;
1244
+ interface FederatedAutocompleteSignature {
1245
+ /**
1246
+ * Provides phrase completion from multiple document types at once
1247
+ */
1248
+ (options?: FederatedAutocompleteOptions | undefined): Promise<FederatedAutocompleteResponse & FederatedAutocompleteResponseNonNullableFields>;
1249
+ }
1250
+ declare function trending$1(httpClient: HttpClient): TrendingSignature;
1251
+ interface TrendingSignature {
1252
+ /**
1253
+ * Returns trending documents for given document types
1254
+ */
1255
+ (options?: TrendingOptions | undefined): Promise<TrendingResponse & TrendingResponseNonNullableFields>;
1256
+ }
1191
1257
 
1192
1258
  declare function createRESTModule<T extends RESTFunctionDescriptor>(descriptor: T, elevated?: boolean): BuildRESTFunction<T> & T;
1193
1259