@wix/search 1.0.43 → 1.0.45

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.43",
3
+ "version": "1.0.45",
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.28",
22
- "@wix/search_wix-site-search": "1.0.20"
21
+ "@wix/search_site-search": "1.0.29",
22
+ "@wix/search_wix-site-search": "1.0.21"
23
23
  },
24
24
  "devDependencies": {
25
25
  "glob": "^10.4.1",
@@ -44,5 +44,5 @@
44
44
  "fqdn": ""
45
45
  }
46
46
  },
47
- "falconPackageHash": "bb418f4be5dfcd9cb89b029f462209b98cb9a5e8c303afb82a37750c"
47
+ "falconPackageHash": "3452857f955659e2c276b1c34137433c21c44b76bc842927dc46b990"
48
48
  }
@@ -12,6 +12,10 @@ type Host<Environment = unknown> = {
12
12
  }>;
13
13
  };
14
14
  environment?: Environment;
15
+ /**
16
+ * Optional name of the environment, use for logging
17
+ */
18
+ name?: string;
15
19
  /**
16
20
  * Optional bast url to use for API requests, for example `www.wixapis.com`
17
21
  */
@@ -271,6 +275,72 @@ type Except<ObjectType, KeysType extends keyof ObjectType, Options extends Excep
271
275
  ? Partial<Record<KeysType, never>>
272
276
  : {});
273
277
 
278
+ /**
279
+ Returns a boolean for whether the given type is `never`.
280
+
281
+ @link https://github.com/microsoft/TypeScript/issues/31751#issuecomment-498526919
282
+ @link https://stackoverflow.com/a/53984913/10292952
283
+ @link https://www.zhenghao.io/posts/ts-never
284
+
285
+ Useful in type utilities, such as checking if something does not occur.
286
+
287
+ @example
288
+ ```
289
+ import type {IsNever, And} from 'type-fest';
290
+
291
+ // https://github.com/andnp/SimplyTyped/blob/master/src/types/strings.ts
292
+ type AreStringsEqual<A extends string, B extends string> =
293
+ And<
294
+ IsNever<Exclude<A, B>> extends true ? true : false,
295
+ IsNever<Exclude<B, A>> extends true ? true : false
296
+ >;
297
+
298
+ type EndIfEqual<I extends string, O extends string> =
299
+ AreStringsEqual<I, O> extends true
300
+ ? never
301
+ : void;
302
+
303
+ function endIfEqual<I extends string, O extends string>(input: I, output: O): EndIfEqual<I, O> {
304
+ if (input === output) {
305
+ process.exit(0);
306
+ }
307
+ }
308
+
309
+ endIfEqual('abc', 'abc');
310
+ //=> never
311
+
312
+ endIfEqual('abc', '123');
313
+ //=> void
314
+ ```
315
+
316
+ @category Type Guard
317
+ @category Utilities
318
+ */
319
+ type IsNever<T> = [T] extends [never] ? true : false;
320
+
321
+ /**
322
+ An if-else-like type that resolves depending on whether the given type is `never`.
323
+
324
+ @see {@link IsNever}
325
+
326
+ @example
327
+ ```
328
+ import type {IfNever} from 'type-fest';
329
+
330
+ type ShouldBeTrue = IfNever<never>;
331
+ //=> true
332
+
333
+ type ShouldBeBar = IfNever<'not never', 'foo', 'bar'>;
334
+ //=> 'bar'
335
+ ```
336
+
337
+ @category Type Guard
338
+ @category Utilities
339
+ */
340
+ type IfNever<T, TypeIfNever = true, TypeIfNotNever = false> = (
341
+ IsNever<T> extends true ? TypeIfNever : TypeIfNotNever
342
+ );
343
+
274
344
  /**
275
345
  Extract the keys from a type where the value type of the key extends the given `Condition`.
276
346
 
@@ -303,21 +373,19 @@ type StringKeysAndUndefined = ConditionalKeys<Example, string | undefined>;
303
373
 
304
374
  @category Object
305
375
  */
306
- type ConditionalKeys<Base, Condition> = NonNullable<
307
- // Wrap in `NonNullable` to strip away the `undefined` type from the produced union.
376
+ type ConditionalKeys<Base, Condition> =
308
377
  {
309
378
  // Map through all the keys of the given base type.
310
- [Key in keyof Base]:
379
+ [Key in keyof Base]-?:
311
380
  // Pick only keys with types extending the given `Condition` type.
312
381
  Base[Key] extends Condition
313
- // Retain this key since the condition passes.
314
- ? Key
382
+ // Retain this key
383
+ // If the value for the key extends never, only include it if `Condition` also extends never
384
+ ? IfNever<Base[Key], IfNever<Condition, Key, never>, Key>
315
385
  // Discard this key since the condition fails.
316
386
  : never;
317
-
318
387
  // Convert the produced object into a union type of the keys which passed the conditional test.
319
- }[keyof Base]
320
- >;
388
+ }[keyof Base];
321
389
 
322
390
  /**
323
391
  Exclude keys from a shape that matches the given `Condition`.
@@ -800,7 +868,7 @@ interface UpdateInternalDocumentsEvent extends UpdateInternalDocumentsEventOpera
800
868
  /** id to pass to processing notification */
801
869
  correlationId?: string | null;
802
870
  /** when event was created / issued */
803
- issuedAt?: Date;
871
+ issuedAt?: Date | null;
804
872
  }
805
873
  /** @oneof */
806
874
  interface UpdateInternalDocumentsEventOperationOneOf {
@@ -1352,6 +1420,8 @@ interface TrendingRequest {
1352
1420
  language?: string | null;
1353
1421
  /** Include seo hidden documents. Defaults to false if not provided. */
1354
1422
  includeSeoHidden?: boolean | null;
1423
+ /** The properties/overrides/experiments to enable for this request. Currently supported: `scoring_profile`, `result-format`. */
1424
+ properties?: SearchProperty[];
1355
1425
  }
1356
1426
  interface TrendingResponse {
1357
1427
  results?: TrendingItems[];
@@ -1573,6 +1643,8 @@ interface TrendingOptions {
1573
1643
  language?: string | null;
1574
1644
  /** Include seo hidden documents. Defaults to false if not provided. */
1575
1645
  includeSeoHidden?: boolean | null;
1646
+ /** The properties/overrides/experiments to enable for this request. Currently supported: `scoring_profile`, `result-format`. */
1647
+ properties?: SearchProperty[];
1576
1648
  }
1577
1649
 
1578
1650
  declare function search$1(httpClient: HttpClient): SearchSignature;
@@ -12,6 +12,10 @@ type Host<Environment = unknown> = {
12
12
  }>;
13
13
  };
14
14
  environment?: Environment;
15
+ /**
16
+ * Optional name of the environment, use for logging
17
+ */
18
+ name?: string;
15
19
  /**
16
20
  * Optional bast url to use for API requests, for example `www.wixapis.com`
17
21
  */
@@ -271,6 +275,72 @@ type Except<ObjectType, KeysType extends keyof ObjectType, Options extends Excep
271
275
  ? Partial<Record<KeysType, never>>
272
276
  : {});
273
277
 
278
+ /**
279
+ Returns a boolean for whether the given type is `never`.
280
+
281
+ @link https://github.com/microsoft/TypeScript/issues/31751#issuecomment-498526919
282
+ @link https://stackoverflow.com/a/53984913/10292952
283
+ @link https://www.zhenghao.io/posts/ts-never
284
+
285
+ Useful in type utilities, such as checking if something does not occur.
286
+
287
+ @example
288
+ ```
289
+ import type {IsNever, And} from 'type-fest';
290
+
291
+ // https://github.com/andnp/SimplyTyped/blob/master/src/types/strings.ts
292
+ type AreStringsEqual<A extends string, B extends string> =
293
+ And<
294
+ IsNever<Exclude<A, B>> extends true ? true : false,
295
+ IsNever<Exclude<B, A>> extends true ? true : false
296
+ >;
297
+
298
+ type EndIfEqual<I extends string, O extends string> =
299
+ AreStringsEqual<I, O> extends true
300
+ ? never
301
+ : void;
302
+
303
+ function endIfEqual<I extends string, O extends string>(input: I, output: O): EndIfEqual<I, O> {
304
+ if (input === output) {
305
+ process.exit(0);
306
+ }
307
+ }
308
+
309
+ endIfEqual('abc', 'abc');
310
+ //=> never
311
+
312
+ endIfEqual('abc', '123');
313
+ //=> void
314
+ ```
315
+
316
+ @category Type Guard
317
+ @category Utilities
318
+ */
319
+ type IsNever<T> = [T] extends [never] ? true : false;
320
+
321
+ /**
322
+ An if-else-like type that resolves depending on whether the given type is `never`.
323
+
324
+ @see {@link IsNever}
325
+
326
+ @example
327
+ ```
328
+ import type {IfNever} from 'type-fest';
329
+
330
+ type ShouldBeTrue = IfNever<never>;
331
+ //=> true
332
+
333
+ type ShouldBeBar = IfNever<'not never', 'foo', 'bar'>;
334
+ //=> 'bar'
335
+ ```
336
+
337
+ @category Type Guard
338
+ @category Utilities
339
+ */
340
+ type IfNever<T, TypeIfNever = true, TypeIfNotNever = false> = (
341
+ IsNever<T> extends true ? TypeIfNever : TypeIfNotNever
342
+ );
343
+
274
344
  /**
275
345
  Extract the keys from a type where the value type of the key extends the given `Condition`.
276
346
 
@@ -303,21 +373,19 @@ type StringKeysAndUndefined = ConditionalKeys<Example, string | undefined>;
303
373
 
304
374
  @category Object
305
375
  */
306
- type ConditionalKeys<Base, Condition> = NonNullable<
307
- // Wrap in `NonNullable` to strip away the `undefined` type from the produced union.
376
+ type ConditionalKeys<Base, Condition> =
308
377
  {
309
378
  // Map through all the keys of the given base type.
310
- [Key in keyof Base]:
379
+ [Key in keyof Base]-?:
311
380
  // Pick only keys with types extending the given `Condition` type.
312
381
  Base[Key] extends Condition
313
- // Retain this key since the condition passes.
314
- ? Key
382
+ // Retain this key
383
+ // If the value for the key extends never, only include it if `Condition` also extends never
384
+ ? IfNever<Base[Key], IfNever<Condition, Key, never>, Key>
315
385
  // Discard this key since the condition fails.
316
386
  : never;
317
-
318
387
  // Convert the produced object into a union type of the keys which passed the conditional test.
319
- }[keyof Base]
320
- >;
388
+ }[keyof Base];
321
389
 
322
390
  /**
323
391
  Exclude keys from a shape that matches the given `Condition`.
@@ -800,7 +868,7 @@ interface UpdateInternalDocumentsEvent extends UpdateInternalDocumentsEventOpera
800
868
  /** id to pass to processing notification */
801
869
  correlationId?: string | null;
802
870
  /** when event was created / issued */
803
- issuedAt?: Date;
871
+ issuedAt?: Date | null;
804
872
  }
805
873
  /** @oneof */
806
874
  interface UpdateInternalDocumentsEventOperationOneOf {
@@ -1352,6 +1420,8 @@ interface TrendingRequest {
1352
1420
  language?: string | null;
1353
1421
  /** Include seo hidden documents. Defaults to false if not provided. */
1354
1422
  includeSeoHidden?: boolean | null;
1423
+ /** The properties/overrides/experiments to enable for this request. Currently supported: `scoring_profile`, `result-format`. */
1424
+ properties?: SearchProperty[];
1355
1425
  }
1356
1426
  interface TrendingResponse {
1357
1427
  results?: TrendingItems[];
@@ -1573,6 +1643,8 @@ interface TrendingOptions {
1573
1643
  language?: string | null;
1574
1644
  /** Include seo hidden documents. Defaults to false if not provided. */
1575
1645
  includeSeoHidden?: boolean | null;
1646
+ /** The properties/overrides/experiments to enable for this request. Currently supported: `scoring_profile`, `result-format`. */
1647
+ properties?: SearchProperty[];
1576
1648
  }
1577
1649
 
1578
1650
  declare function search$1(httpClient: HttpClient): SearchSignature;
@@ -948,6 +948,8 @@ interface TrendingRequest$1 {
948
948
  language?: string | null;
949
949
  /** Include seo hidden documents. Defaults to false if not provided. */
950
950
  includeSeoHidden?: boolean | null;
951
+ /** The properties/overrides/experiments to enable for this request. Currently supported: `scoring_profile`, `result-format`. */
952
+ properties?: SearchProperty$1[];
951
953
  }
952
954
  interface TrendingResponse$1 {
953
955
  results?: TrendingItems$1[];
@@ -1369,6 +1371,8 @@ interface TrendingRequest {
1369
1371
  language?: string | null;
1370
1372
  /** Include seo hidden documents. Defaults to false if not provided. */
1371
1373
  includeSeoHidden?: boolean | null;
1374
+ /** The properties/overrides/experiments to enable for this request. Currently supported: `scoring_profile`, `result-format`. */
1375
+ properties?: SearchProperty[];
1372
1376
  }
1373
1377
  interface TrendingResponse {
1374
1378
  results?: TrendingItems[];