Skip to content

Commit 2cbb1f5

Browse files
feat(specs): add fields for metadata in composition injectedItems (generated)
algolia/api-clients-automation#5241 Co-authored-by: algolia-bot <[email protected]> Co-authored-by: Gavin Wade <[email protected]>
1 parent 725f770 commit 2cbb1f5

File tree

9 files changed

+61
-0
lines changed

9 files changed

+61
-0
lines changed

packages/client-composition/model/hit.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.
22

33
import type { HighlightResult } from './highlightResult';
4+
import type { HitMetadata } from './hitMetadata';
45
import type { HitRankingInfo } from './hitRankingInfo';
56
import type { SnippetResult } from './snippetResult';
67

@@ -26,4 +27,6 @@ export type Hit<T = Record<string, unknown>> = T & {
2627
_rankingInfo?: HitRankingInfo | undefined;
2728

2829
_distinctSeqID?: number | undefined;
30+
31+
_extra?: HitMetadata | undefined;
2932
};
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.
2+
3+
/**
4+
* An object that contains the extra key-value pairs provided in the injectedItem definition.
5+
*/
6+
export type HitMetadata = Record<string, any> & {
7+
/**
8+
* The key of the injectedItem that inserted this metadata.
9+
*/
10+
_injectedItemKey?: string | undefined;
11+
};

packages/client-composition/model/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,12 @@ export * from './getTaskResponse';
4646
export * from './highlightResult';
4747
export * from './highlightResultOption';
4848
export * from './hit';
49+
export * from './hitMetadata';
4950
export * from './hitRankingInfo';
5051
export * from './ignorePlurals';
5152
export * from './injectedItem';
53+
export * from './injectedItemHitsMetadata';
54+
export * from './injectedItemMetadata';
5255
export * from './injectedItemSource';
5356
export * from './injectedItemSourceSearch';
5457
export * from './injection';

packages/client-composition/model/injectedItem.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.
22

3+
import type { InjectedItemMetadata } from './injectedItemMetadata';
34
import type { InjectedItemSource } from './injectedItemSource';
45

56
export type InjectedItem = {
@@ -13,4 +14,6 @@ export type InjectedItem = {
1314
position: number;
1415

1516
length: number;
17+
18+
metadata?: InjectedItemMetadata | undefined;
1619
};
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.
2+
3+
/**
4+
* Adds the provided metadata to each injected hit via an `_extra` attribute.
5+
*/
6+
export type InjectedItemHitsMetadata = {
7+
/**
8+
* When true, the `_injectedItemKey` field is set in the `_extra` object of each affected hit.
9+
*/
10+
addItemKey?: boolean | undefined;
11+
12+
/**
13+
* The user-defined key-value pairs that will be placed in the `_extra` field of each affected hit.
14+
*/
15+
extra?: { [key: string]: any } | undefined;
16+
};
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.
2+
3+
import type { InjectedItemHitsMetadata } from './injectedItemHitsMetadata';
4+
5+
/**
6+
* Used to add metadata to the results of the injectedItem.
7+
*/
8+
export type InjectedItemMetadata = {
9+
hits?: InjectedItemHitsMetadata | undefined;
10+
};

packages/composition/model/hit.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.
22

33
import type { HighlightResult } from './highlightResult';
4+
import type { HitMetadata } from './hitMetadata';
45
import type { HitRankingInfo } from './hitRankingInfo';
56
import type { SnippetResult } from './snippetResult';
67

@@ -26,4 +27,6 @@ export type Hit<T = Record<string, unknown>> = T & {
2627
_rankingInfo?: HitRankingInfo | undefined;
2728

2829
_distinctSeqID?: number | undefined;
30+
31+
_extra?: HitMetadata | undefined;
2932
};
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.
2+
3+
/**
4+
* An object that contains the extra key-value pairs provided in the injectedItem definition.
5+
*/
6+
export type HitMetadata = Record<string, any> & {
7+
/**
8+
* The key of the injectedItem that inserted this metadata.
9+
*/
10+
_injectedItemKey?: string | undefined;
11+
};

packages/composition/model/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ export * from './facetStats';
2525
export * from './highlightResult';
2626
export * from './highlightResultOption';
2727
export * from './hit';
28+
export * from './hitMetadata';
2829
export * from './hitRankingInfo';
2930
export * from './insideBoundingBox';
3031
export * from './matchedGeoLocation';

0 commit comments

Comments
 (0)