@coveo/quantic 3.36.1 → 3.36.3
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/docs/out/quantic-docs.json +12 -12
- package/force-app/main/default/lwc/quanticDidYouMean/quanticDidYouMean.js +1 -1
- package/force-app/main/default/lwc/quanticGeneratedAnswer/quanticGeneratedAnswer.js +1 -1
- package/force-app/main/default/lwc/quanticPlaceholder/quanticPlaceholder.js +1 -1
- package/force-app/main/default/lwc/quanticRecommendationInterface/quanticRecommendationInterface.js +1 -1
- package/force-app/main/default/lwc/quanticRefineModalContent/quanticRefineModalContent.js +1 -1
- package/force-app/main/default/lwc/quanticRefineToggle/quanticRefineToggle.js +1 -1
- package/force-app/main/default/lwc/quanticResultLink/quanticResultLink.js +1 -1
- package/force-app/main/default/lwc/quanticSearchInterface/quanticSearchInterface.js +1 -1
- package/force-app/main/default/lwc/quanticSmartSnippetSuggestions/quanticSmartSnippetSuggestions.js +1 -1
- package/force-app/main/default/staticresources/coveoheadless/case-assist/headless.js +8 -8
- package/force-app/main/default/staticresources/coveoheadless/definitions/api/api-client-utils.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/api/commerce/commerce-api-params.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/api/commerce/common/pagination.d.ts +4 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/api/commerce/common/request.d.ts +2 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/api/commerce/common/response.d.ts +0 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/api/commerce/listing/response.d.ts +2 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/api/commerce/product-enrichment/product-enrichment-request.d.ts +2 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/api/commerce/recommendations/recommendations-request.d.ts +2 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/api/commerce/search/query-suggest/query-suggest-request.d.ts +2 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/api/commerce/search/request.d.ts +2 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/api/commerce/search/response.d.ts +4 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/api/knowledge/answer-generation/endpoints/answer/answer-endpoint.d.ts +1 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/api/knowledge/answer-generation/endpoints/follow-up/follow-up-endpoint.d.ts +25 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/api/knowledge/answer-generation/endpoints/follow-up/url-builders/endpoint-url-builder.d.ts +5 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/api/knowledge/answer-generation/streaming/strategies/streaming-strategy-creators.d.ts +4 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/api/knowledge/stream-answer-api.d.ts +4 -4
- package/force-app/main/default/staticresources/coveoheadless/definitions/api/service/case-assist/get-case-classifications/get-case-classifications-request.d.ts +2 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/api/service/case-assist/get-document-suggestions/get-document-suggestions-request.d.ts +2 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/api/service/insight/get-interface/get-interface-config-request.d.ts +2 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/api/service/insight/query/query-request.d.ts +4 -4
- package/force-app/main/default/staticresources/coveoheadless/definitions/api/service/insight/user-actions/user-actions-request.d.ts +2 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/commerce.index.d.ts +2 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/commerce/core/sub-controller/headless-sub-controller.d.ts +7 -9
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/commerce/product-listing/headless-product-listing.d.ts +4 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/commerce/search/headless-search.d.ts +17 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/commerce/search-box/headless-search-box-options.d.ts +12 -4
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/commerce/triggers/headless-query-trigger.d.ts +15 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/commerce/search/search-actions-loader.d.ts +6 -4
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/commerce/search/search-actions-thunk-processor.d.ts +2 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/commerce/search/search-actions.d.ts +10 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/commerce/search/search-state.d.ts +2 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/configuration/configuration-actions.d.ts +1 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/configuration/configuration-selectors.d.ts +7 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/configuration/configuration-state.d.ts +1 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/follow-up-answers/follow-up-answer-strategy.d.ts +3 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/follow-up-answers/follow-up-answers-actions.d.ts +70 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/follow-up-answers/follow-up-answers-slice.d.ts +4 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/follow-up-answers/follow-up-answers-state.d.ts +6 -4
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/generated-answer/generated-answer-actions.d.ts +29 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/generated-answer/generated-answer-request.d.ts +5 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/generated-answer/generated-answer-state.d.ts +4 -4
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/generated-answer/head-answer-strategy.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/utils/facet-utils.d.ts +1 -2
- package/force-app/main/default/staticresources/coveoheadless/headless.js +10 -10
- package/force-app/main/default/staticresources/coveoheadless/insight/headless.js +9 -9
- package/force-app/main/default/staticresources/coveoheadless/recommendation/headless.js +7 -7
- package/package.json +2 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/api/knowledge/answer-generation/streaming/strategies/streaming-strategies.d.ts +0 -3
package/force-app/main/default/staticresources/coveoheadless/definitions/api/api-client-utils.d.ts
CHANGED
|
@@ -3,5 +3,5 @@ import type { BaseParam } from './platform-service-params.js';
|
|
|
3
3
|
import type { AllSearchAPIResponse } from './search/search-api-client.js';
|
|
4
4
|
import type { SearchAPIErrorWithStatusCode } from './search/search-api-error-response.js';
|
|
5
5
|
import type { AuthenticationParam } from './search/search-api-params.js';
|
|
6
|
-
export declare function pickNonBaseParams<Params extends BaseParam & AuthenticationParam>(req: Params): Omit<Params, "
|
|
6
|
+
export declare function pickNonBaseParams<Params extends BaseParam & AuthenticationParam>(req: Params): Omit<Params, "url" | "accessToken" | "organizationId" | "authentication">;
|
|
7
7
|
export declare const unwrapError: (payload: PlatformResponse<AllSearchAPIResponse>) => SearchAPIErrorWithStatusCode;
|
|
@@ -29,10 +29,10 @@ export declare const getRequestOptions: (req: FilterableCommerceAPIRequest, path
|
|
|
29
29
|
facets: import("../../../features/commerce/facets/facet-set/interfaces/request.js").AnyFacetRequest[] | undefined;
|
|
30
30
|
sort: import("./sort.js").SortOption | undefined;
|
|
31
31
|
};
|
|
32
|
-
accessToken: string;
|
|
33
32
|
url: string;
|
|
34
|
-
method: import("../../platform-client.js").HttpMethods;
|
|
35
33
|
origin: import("../../preprocess-request.js").PlatformClientOrigin;
|
|
34
|
+
accessToken: string;
|
|
35
|
+
method: import("../../platform-client.js").HttpMethods;
|
|
36
36
|
contentType: import("../../platform-client.js").HTTPContentType;
|
|
37
37
|
requestMetadata?: import("../../preprocess-request.js").RequestMetadata | undefined;
|
|
38
38
|
};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { AnyFacetResponse } from '../../../features/commerce/facets/facet-set/interfaces/response.js';
|
|
2
2
|
import type { Trigger } from '../../common/trigger.js';
|
|
3
|
-
import type { SearchAPIErrorWithExceptionInBody, SearchAPIErrorWithStatusCode } from '../../search/search-api-error-response.js';
|
|
4
3
|
import type { Pagination } from './pagination.js';
|
|
5
4
|
import type { BaseProduct } from './product.js';
|
|
6
5
|
import type { Sort } from './sort.js';
|
|
@@ -14,4 +13,3 @@ export interface CommerceSuccessResponse extends BaseCommerceSuccessResponse {
|
|
|
14
13
|
facets: AnyFacetResponse[];
|
|
15
14
|
sort: Sort;
|
|
16
15
|
}
|
|
17
|
-
export type CommerceResponse = CommerceSuccessResponse | SearchAPIErrorWithExceptionInBody | SearchAPIErrorWithStatusCode;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import type { PaginationWithResultTypeCounts } from '../common/pagination.js';
|
|
1
2
|
import type { CommerceSuccessResponse } from '../common/response.js';
|
|
2
3
|
import type { BaseResult } from '../common/result.js';
|
|
3
4
|
export interface ListingCommerceSuccessResponse extends CommerceSuccessResponse {
|
|
4
5
|
results: BaseResult[];
|
|
6
|
+
pagination: PaginationWithResultTypeCounts;
|
|
5
7
|
}
|
|
@@ -21,10 +21,10 @@ export declare const buildProductEnrichmentBadgesRequest: (req: ProductEnrichmen
|
|
|
21
21
|
custom?: Record<string, unknown>;
|
|
22
22
|
};
|
|
23
23
|
};
|
|
24
|
-
accessToken: string;
|
|
25
24
|
url: string;
|
|
26
|
-
method: import("../../platform-client.js").HttpMethods;
|
|
27
25
|
origin: import("../../preprocess-request.js").PlatformClientOrigin;
|
|
26
|
+
accessToken: string;
|
|
27
|
+
method: import("../../platform-client.js").HttpMethods;
|
|
28
28
|
contentType: import("../../platform-client.js").HTTPContentType;
|
|
29
29
|
requestMetadata?: import("../../preprocess-request.js").RequestMetadata | undefined;
|
|
30
30
|
};
|
|
@@ -25,10 +25,10 @@ export declare const buildRecommendationsRequest: (req: CommerceRecommendationsR
|
|
|
25
25
|
page: number | undefined;
|
|
26
26
|
perPage: number | undefined;
|
|
27
27
|
};
|
|
28
|
-
accessToken: string;
|
|
29
28
|
url: string;
|
|
30
|
-
method: import("../../platform-client.js").HttpMethods;
|
|
31
29
|
origin: import("../../preprocess-request.js").PlatformClientOrigin;
|
|
30
|
+
accessToken: string;
|
|
31
|
+
method: import("../../platform-client.js").HttpMethods;
|
|
32
32
|
contentType: import("../../platform-client.js").HTTPContentType;
|
|
33
33
|
requestMetadata?: import("../../preprocess-request.js").RequestMetadata | undefined;
|
|
34
34
|
};
|
|
@@ -22,10 +22,10 @@ export declare const getQuerySuggestRequestOptions: (req: QuerySuggestRequest) =
|
|
|
22
22
|
country: string;
|
|
23
23
|
currency: string;
|
|
24
24
|
};
|
|
25
|
-
accessToken: string;
|
|
26
25
|
url: string;
|
|
27
|
-
method: import("../../../platform-client.js").HttpMethods;
|
|
28
26
|
origin: import("../../../preprocess-request.js").PlatformClientOrigin;
|
|
27
|
+
accessToken: string;
|
|
28
|
+
method: import("../../../platform-client.js").HttpMethods;
|
|
29
29
|
contentType: import("../../../platform-client.js").HTTPContentType;
|
|
30
30
|
requestMetadata?: import("../../../preprocess-request.js").RequestMetadata | undefined;
|
|
31
31
|
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { QueryParam } from '../commerce-api-params.js';
|
|
1
|
+
import type { EnableResultsParam, QueryParam } from '../commerce-api-params.js';
|
|
2
2
|
import type { FilterableCommerceAPIRequest } from '../common/request.js';
|
|
3
|
-
export type CommerceSearchRequest = FilterableCommerceAPIRequest & QueryParam;
|
|
3
|
+
export type CommerceSearchRequest = FilterableCommerceAPIRequest & QueryParam & EnableResultsParam;
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import type { QueryCorrection } from '../../search/search/query-corrections.js';
|
|
2
|
+
import type { PaginationWithResultTypeCounts } from '../common/pagination.js';
|
|
2
3
|
import type { CommerceSuccessResponse } from '../common/response.js';
|
|
4
|
+
import type { BaseResult } from '../common/result.js';
|
|
3
5
|
export interface SearchCommerceSuccessResponse extends CommerceSuccessResponse {
|
|
4
6
|
queryCorrection?: SearchCommerceQueryCorrectionResponse;
|
|
7
|
+
results: BaseResult[];
|
|
8
|
+
pagination: PaginationWithResultTypeCounts;
|
|
5
9
|
}
|
|
6
10
|
interface SearchCommerceQueryCorrectionResponse {
|
|
7
11
|
correctedQuery: string | null;
|
|
@@ -4,7 +4,7 @@ import { type GeneratedAnswerServerState } from '../../answer-generation-api-sta
|
|
|
4
4
|
/**
|
|
5
5
|
* Parameters for answer generation requests.
|
|
6
6
|
*/
|
|
7
|
-
type AnswerParams = {
|
|
7
|
+
export type AnswerParams = {
|
|
8
8
|
q: string;
|
|
9
9
|
facets?: AnyFacetRequest[];
|
|
10
10
|
searchHub?: string;
|
|
@@ -28,4 +28,3 @@ export declare const answerEndpoint: import("@reduxjs/toolkit/query").Api<import
|
|
|
28
28
|
* Initiates an answer generation query with the specified strategy and parameters.
|
|
29
29
|
*/
|
|
30
30
|
export declare const initiateAnswerEndpoint: (args: AnswerEndpointArgs) => import("redux-thunk").ThunkAction<import("@reduxjs/toolkit/query").QueryActionCreatorResult<import("@reduxjs/toolkit/query").QueryDefinition<AnswerEndpointArgs, import("@reduxjs/toolkit/query").BaseQueryFn<string | import("@reduxjs/toolkit/query").FetchArgs, unknown, import("@reduxjs/toolkit/query").FetchBaseQueryError, {} & import("@reduxjs/toolkit/query").RetryOptions, {}>, never, GeneratedAnswerServerState, "answerGenerationApi">>, any, any, import("@reduxjs/toolkit").UnknownAction>;
|
|
31
|
-
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type GeneratedAnswerServerState } from '../../answer-generation-api-state.js';
|
|
2
|
+
/**
|
|
3
|
+
* Parameters for follow-up answer generation requests.
|
|
4
|
+
*/
|
|
5
|
+
type FollowUpAnswerParams = {
|
|
6
|
+
q: string;
|
|
7
|
+
conversationId: string;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Arguments for the follow-up answer endpoint including streaming strategy and request parameters.
|
|
11
|
+
*/
|
|
12
|
+
export type FollowUpEndpointArgs = {
|
|
13
|
+
strategyKey: 'follow-up-answer';
|
|
14
|
+
} & FollowUpAnswerParams;
|
|
15
|
+
/**
|
|
16
|
+
* RTK Query endpoint for streaming follow-up answer generation.
|
|
17
|
+
*/
|
|
18
|
+
export declare const followUpEndpoint: import("@reduxjs/toolkit/query").Api<import("@reduxjs/toolkit/query").BaseQueryFn<string | import("@reduxjs/toolkit/query").FetchArgs, unknown, import("@reduxjs/toolkit/query").FetchBaseQueryError, {} & import("@reduxjs/toolkit/query").RetryOptions, {}>, {
|
|
19
|
+
generateFollowUpAnswer: import("@reduxjs/toolkit/query").QueryDefinition<FollowUpEndpointArgs, import("@reduxjs/toolkit/query").BaseQueryFn<string | import("@reduxjs/toolkit/query").FetchArgs, unknown, import("@reduxjs/toolkit/query").FetchBaseQueryError, {} & import("@reduxjs/toolkit/query").RetryOptions, {}>, never, GeneratedAnswerServerState, "answerGenerationApi">;
|
|
20
|
+
}, "answerGenerationApi", never, typeof import("@reduxjs/toolkit/query").coreModuleName>;
|
|
21
|
+
/**
|
|
22
|
+
* Initiates a follow up answer generation query with the specified strategy and parameters.
|
|
23
|
+
*/
|
|
24
|
+
export declare const initiateFollowUpEndpoint: (args: FollowUpEndpointArgs) => import("redux-thunk").ThunkAction<import("@reduxjs/toolkit/query").QueryActionCreatorResult<import("@reduxjs/toolkit/query").QueryDefinition<FollowUpEndpointArgs, import("@reduxjs/toolkit/query").BaseQueryFn<string | import("@reduxjs/toolkit/query").FetchArgs, unknown, import("@reduxjs/toolkit/query").FetchBaseQueryError, {} & import("@reduxjs/toolkit/query").RetryOptions, {}>, never, GeneratedAnswerServerState, "answerGenerationApi">>, any, any, import("@reduxjs/toolkit").UnknownAction>;
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const streamingStrategyCreators: {
|
|
2
|
+
'head-answer': () => import("../types.js").StreamingStrategy<import("../../answer-generation-api-state.js").AnswerGenerationApiState>;
|
|
3
|
+
'follow-up-answer': () => import("../types.js").StreamingStrategy<import("../../answer-generation-api-state.js").AnswerGenerationApiState>;
|
|
4
|
+
};
|
|
@@ -27,9 +27,9 @@ export declare const selectAnswer: (state: StreamAnswerAPIState) => ({
|
|
|
27
27
|
}) | ({
|
|
28
28
|
status: import("@reduxjs/toolkit/query").QueryStatus.fulfilled;
|
|
29
29
|
error: undefined;
|
|
30
|
-
endpointName: string;
|
|
31
|
-
originalArgs: AnswerApiQueryParams;
|
|
32
30
|
requestId: string;
|
|
31
|
+
originalArgs: AnswerApiQueryParams;
|
|
32
|
+
endpointName: string;
|
|
33
33
|
startedTimeStamp: number;
|
|
34
34
|
data: GeneratedAnswerStream;
|
|
35
35
|
fulfilledTimeStamp: number;
|
|
@@ -56,11 +56,11 @@ export declare const selectAnswer: (state: StreamAnswerAPIState) => ({
|
|
|
56
56
|
isError: false;
|
|
57
57
|
}) | ({
|
|
58
58
|
status: import("@reduxjs/toolkit/query").QueryStatus.rejected;
|
|
59
|
+
requestId: string;
|
|
59
60
|
data?: GeneratedAnswerStream | undefined;
|
|
60
|
-
endpointName: string;
|
|
61
61
|
fulfilledTimeStamp?: number | undefined;
|
|
62
62
|
originalArgs: AnswerApiQueryParams;
|
|
63
|
-
|
|
63
|
+
endpointName: string;
|
|
64
64
|
startedTimeStamp: number;
|
|
65
65
|
error: import("@reduxjs/toolkit").SerializedError | import("@reduxjs/toolkit/query").FetchBaseQueryError;
|
|
66
66
|
} & {
|
|
@@ -11,9 +11,9 @@ export declare const buildGetCaseClassificationsRequest: (req: GetCaseClassifica
|
|
|
11
11
|
};
|
|
12
12
|
};
|
|
13
13
|
};
|
|
14
|
-
accessToken: string;
|
|
15
14
|
url: string;
|
|
16
|
-
method: import("../../../platform-client.js").HttpMethods;
|
|
17
15
|
origin: import("../../../preprocess-request.js").PlatformClientOrigin;
|
|
16
|
+
accessToken: string;
|
|
17
|
+
method: import("../../../platform-client.js").HttpMethods;
|
|
18
18
|
contentType: import("../../../platform-client.js").HTTPContentType;
|
|
19
19
|
};
|
|
@@ -28,9 +28,9 @@ export declare const buildGetDocumentSuggestionsRequest: (req: GetDocumentSugges
|
|
|
28
28
|
source?: string[];
|
|
29
29
|
} | undefined;
|
|
30
30
|
};
|
|
31
|
-
accessToken: string;
|
|
32
31
|
url: string;
|
|
33
|
-
method: import("../../../platform-client.js").HttpMethods;
|
|
34
32
|
origin: import("../../../preprocess-request.js").PlatformClientOrigin;
|
|
33
|
+
accessToken: string;
|
|
34
|
+
method: import("../../../platform-client.js").HttpMethods;
|
|
35
35
|
contentType: import("../../../platform-client.js").HTTPContentType;
|
|
36
36
|
};
|
|
@@ -3,9 +3,9 @@ import { type InsightIdParam } from '../insight-params.js';
|
|
|
3
3
|
export type GetInsightInterfaceConfigRequest = BaseParam & InsightIdParam;
|
|
4
4
|
export declare const buildGetInsightInterfaceConfigRequest: (req: GetInsightInterfaceConfigRequest) => {
|
|
5
5
|
requestParams: {};
|
|
6
|
-
accessToken: string;
|
|
7
6
|
url: string;
|
|
8
|
-
method: import("../../../platform-client.js").HttpMethods;
|
|
9
7
|
origin: import("../../../preprocess-request.js").PlatformClientOrigin;
|
|
8
|
+
accessToken: string;
|
|
9
|
+
method: import("../../../platform-client.js").HttpMethods;
|
|
10
10
|
contentType: import("../../../platform-client.js").HTTPContentType;
|
|
11
11
|
};
|
|
@@ -8,17 +8,17 @@ export interface CaseContextParam {
|
|
|
8
8
|
}
|
|
9
9
|
export declare const buildInsightQueryRequest: (req: InsightQueryRequest) => {
|
|
10
10
|
requestParams: {};
|
|
11
|
-
accessToken: string;
|
|
12
11
|
url: string;
|
|
13
|
-
method: import("../../../platform-client.js").HttpMethods;
|
|
14
12
|
origin: import("../../../preprocess-request.js").PlatformClientOrigin;
|
|
13
|
+
accessToken: string;
|
|
14
|
+
method: import("../../../platform-client.js").HttpMethods;
|
|
15
15
|
contentType: import("../../../platform-client.js").HTTPContentType;
|
|
16
16
|
};
|
|
17
17
|
export declare const buildInsightQuerySuggestRequest: (req: InsightQuerySuggestRequest) => {
|
|
18
18
|
requestParams: {};
|
|
19
|
-
accessToken: string;
|
|
20
19
|
url: string;
|
|
21
|
-
method: import("../../../platform-client.js").HttpMethods;
|
|
22
20
|
origin: import("../../../preprocess-request.js").PlatformClientOrigin;
|
|
21
|
+
accessToken: string;
|
|
22
|
+
method: import("../../../platform-client.js").HttpMethods;
|
|
23
23
|
contentType: import("../../../platform-client.js").HTTPContentType;
|
|
24
24
|
};
|
|
@@ -10,10 +10,10 @@ export declare const buildInsightUserActionsRequest: (req: InsightUserActionsReq
|
|
|
10
10
|
requestParams: {
|
|
11
11
|
objectId: string;
|
|
12
12
|
};
|
|
13
|
-
accessToken: string;
|
|
14
13
|
url: string;
|
|
15
|
-
method: import("../../../platform-client.js").HttpMethods;
|
|
16
14
|
origin: import("../../../preprocess-request.js").PlatformClientOrigin;
|
|
15
|
+
accessToken: string;
|
|
16
|
+
method: import("../../../platform-client.js").HttpMethods;
|
|
17
17
|
contentType: import("../../../platform-client.js").HTTPContentType;
|
|
18
18
|
};
|
|
19
19
|
export {};
|
package/force-app/main/default/staticresources/coveoheadless/definitions/commerce.index.d.ts
CHANGED
|
@@ -114,7 +114,7 @@ export type { Recommendations, RecommendationsOptions, RecommendationsProps, Rec
|
|
|
114
114
|
export { buildRecommendations } from './controllers/commerce/recommendations/headless-recommendations.js';
|
|
115
115
|
export type { RecommendationsSummaryState } from './controllers/commerce/recommendations/summary/headless-recommendations-summary.js';
|
|
116
116
|
export type { DidYouMean, DidYouMeanState, QueryCorrection, WordCorrection, } from './controllers/commerce/search/did-you-mean/headless-did-you-mean.js';
|
|
117
|
-
export type { Search, SearchState, } from './controllers/commerce/search/headless-search.js';
|
|
117
|
+
export type { Search, SearchOptions, SearchState, } from './controllers/commerce/search/headless-search.js';
|
|
118
118
|
export { buildSearch } from './controllers/commerce/search/headless-search.js';
|
|
119
119
|
export type { SearchSummaryState } from './controllers/commerce/search/summary/headless-search-summary.js';
|
|
120
120
|
export type { SearchBox, SearchBoxOptions, SearchBoxProps, SearchBoxState, Suggestion, } from './controllers/commerce/search-box/headless-search-box.js';
|
|
@@ -122,6 +122,7 @@ export { buildSearchBox } from './controllers/commerce/search-box/headless-searc
|
|
|
122
122
|
export type { StandaloneSearchBox, StandaloneSearchBoxState, } from './controllers/commerce/standalone-search-box/headless-standalone-search-box.js';
|
|
123
123
|
export { buildStandaloneSearchBox } from './controllers/commerce/standalone-search-box/headless-standalone-search-box.js';
|
|
124
124
|
export { buildNotifyTrigger } from './controllers/commerce/triggers/headless-notify-trigger.js';
|
|
125
|
+
export type { QueryTriggerOptions } from './controllers/commerce/triggers/headless-query-trigger.js';
|
|
125
126
|
export { buildQueryTrigger } from './controllers/commerce/triggers/headless-query-trigger.js';
|
|
126
127
|
export { buildRedirectionTrigger } from './controllers/commerce/triggers/headless-redirection-trigger.js';
|
|
127
128
|
export type { Controller, Subscribable, } from './controllers/controller/headless-controller.js';
|
|
@@ -70,6 +70,12 @@ export interface SearchAndListingSubControllers<P extends Parameters, S extends
|
|
|
70
70
|
* @returns A `ParameterManager` sub-controller.
|
|
71
71
|
*/
|
|
72
72
|
parameterManager(props?: ParameterManagerProps<P>): ParameterManager<P>;
|
|
73
|
+
/**
|
|
74
|
+
* Creates an `InteractiveSpotlightContent` sub-controller, for use when `enableResults` is set on the controller.
|
|
75
|
+
* @param props - The properties for the `InteractiveSpotlightContent` sub-controller.
|
|
76
|
+
* @returns An `InteractiveSpotlightContent` sub-controller.
|
|
77
|
+
*/
|
|
78
|
+
interactiveSpotlightContent(props: InteractiveSpotlightContentProps): InteractiveSpotlightContent;
|
|
73
79
|
}
|
|
74
80
|
export interface SearchSubControllers extends SearchAndListingSubControllers<CommerceSearchParameters, SearchSummaryState> {
|
|
75
81
|
/**
|
|
@@ -78,14 +84,6 @@ export interface SearchSubControllers extends SearchAndListingSubControllers<Com
|
|
|
78
84
|
*/
|
|
79
85
|
didYouMean(): DidYouMean;
|
|
80
86
|
}
|
|
81
|
-
export interface ProductListingSubControllers extends SearchAndListingSubControllers<ProductListingParameters, ProductListingSummaryState> {
|
|
82
|
-
/**
|
|
83
|
-
* Creates an `InteractiveSpotlightContent` sub-controller, for use when `enableResults` is set on the controller.
|
|
84
|
-
* @param props - The properties for the `InteractiveSpotlightContent` sub-controller.
|
|
85
|
-
* @returns An `InteractiveSpotlightContent` sub-controller.
|
|
86
|
-
*/
|
|
87
|
-
interactiveSpotlightContent(props: InteractiveSpotlightContentProps): InteractiveSpotlightContent;
|
|
88
|
-
}
|
|
89
87
|
interface BaseSubControllerProps<S extends SummaryState> {
|
|
90
88
|
responseIdSelector: (state: CommerceEngineState) => string;
|
|
91
89
|
isLoadingSelector: (state: CommerceEngineState) => boolean;
|
|
@@ -124,7 +122,7 @@ export declare function buildSearchSubControllers(engine: CommerceEngine, subCon
|
|
|
124
122
|
* @param subControllerProps - The properties for the listing sub-controllers.
|
|
125
123
|
* @returns The product listing sub-controllers.
|
|
126
124
|
*/
|
|
127
|
-
export declare function buildProductListingSubControllers(engine: CommerceEngine, subControllerProps: Omit<SearchAndListingSubControllerProps<ProductListingParameters, ProductListingSummaryState>, 'facetSearchType'>):
|
|
125
|
+
export declare function buildProductListingSubControllers(engine: CommerceEngine, subControllerProps: Omit<SearchAndListingSubControllerProps<ProductListingParameters, ProductListingSummaryState>, 'facetSearchType'>): SearchAndListingSubControllers<Parameters, ProductListingSummaryState>;
|
|
128
126
|
/**
|
|
129
127
|
* Builds the sub-controllers for the commerce search and product listing use cases.
|
|
130
128
|
*
|
|
@@ -2,9 +2,11 @@ import type { CommerceAPIErrorStatusResponse } from '../../../api/commerce/comme
|
|
|
2
2
|
import type { ChildProduct, Product } from '../../../api/commerce/common/product.js';
|
|
3
3
|
import type { Result } from '../../../api/commerce/common/result.js';
|
|
4
4
|
import type { CommerceEngine } from '../../../app/commerce-engine/commerce-engine.js';
|
|
5
|
+
import type { Parameters } from '../../../features/commerce/parameters/parameters-actions.js';
|
|
5
6
|
import type { FetchProductListingPayload } from '../../../features/commerce/product-listing/product-listing-actions.js';
|
|
6
7
|
import { type Controller } from '../../controller/headless-controller.js';
|
|
7
|
-
import {
|
|
8
|
+
import type { SearchAndListingSubControllers } from '../core/sub-controller/headless-sub-controller.js';
|
|
9
|
+
import type { ProductListingSummaryState } from './summary/headless-product-listing-summary.js';
|
|
8
10
|
/**
|
|
9
11
|
* The `ProductListing` controller exposes a method for retrieving product listing content in a commerce interface.
|
|
10
12
|
*
|
|
@@ -13,7 +15,7 @@ import { type ProductListingSubControllers } from '../core/sub-controller/headle
|
|
|
13
15
|
* @group Buildable controllers
|
|
14
16
|
* @category ProductListing
|
|
15
17
|
*/
|
|
16
|
-
export interface ProductListing extends Controller,
|
|
18
|
+
export interface ProductListing extends Controller, SearchAndListingSubControllers<Parameters, ProductListingSummaryState> {
|
|
17
19
|
/**
|
|
18
20
|
* Fetches the product listing.
|
|
19
21
|
*/
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { CommerceAPIErrorStatusResponse } from '../../../api/commerce/commerce-api-error-response.js';
|
|
2
2
|
import type { ChildProduct, Product } from '../../../api/commerce/common/product.js';
|
|
3
|
+
import type { Result } from '../../../api/commerce/common/result.js';
|
|
3
4
|
import type { CommerceEngine } from '../../../app/commerce-engine/commerce-engine.js';
|
|
4
5
|
import { type Controller } from '../../controller/headless-controller.js';
|
|
5
6
|
import { type SearchSubControllers } from '../core/sub-controller/headless-sub-controller.js';
|
|
@@ -43,16 +44,31 @@ export interface Search extends Controller, SearchSubControllers {
|
|
|
43
44
|
*/
|
|
44
45
|
export interface SearchState {
|
|
45
46
|
products: Product[];
|
|
47
|
+
results: Result[];
|
|
46
48
|
error: CommerceAPIErrorStatusResponse | null;
|
|
47
49
|
isLoading: boolean;
|
|
48
50
|
responseId: string;
|
|
49
51
|
}
|
|
52
|
+
/**
|
|
53
|
+
* Options for configuring the `Search` controller.
|
|
54
|
+
* @group Buildable controllers
|
|
55
|
+
* @category Search
|
|
56
|
+
*/
|
|
57
|
+
export interface SearchOptions {
|
|
58
|
+
/**
|
|
59
|
+
* When set to true, fills the `results` field rather than the `products` field
|
|
60
|
+
* in the response. It may also include Spotlight Content in the results.
|
|
61
|
+
* @default false
|
|
62
|
+
*/
|
|
63
|
+
enableResults?: boolean;
|
|
64
|
+
}
|
|
50
65
|
/**
|
|
51
66
|
* Builds a `Search` controller for the given commerce engine.
|
|
52
67
|
* @param engine - The commerce engine.
|
|
68
|
+
* @param options - The configurable `Search` controller options.
|
|
53
69
|
* @returns A `Search` controller.
|
|
54
70
|
*
|
|
55
71
|
* @group Buildable controllers
|
|
56
72
|
* @category Search
|
|
57
73
|
*/
|
|
58
|
-
export declare function buildSearch(engine: CommerceEngine): Search;
|
|
74
|
+
export declare function buildSearch(engine: CommerceEngine, { enableResults }?: SearchOptions): Search;
|
|
@@ -1,12 +1,20 @@
|
|
|
1
|
-
import { Schema } from '@coveo/bueno';
|
|
1
|
+
import { BooleanValue, Schema } from '@coveo/bueno';
|
|
2
2
|
import { type SearchBoxOptions as CoreSearchBoxOptions } from '../../core/search-box/headless-core-search-box-options.js';
|
|
3
|
-
export type SearchBoxOptions = Pick<CoreSearchBoxOptions, 'id' | 'highlightOptions' | 'clearFilters'
|
|
4
|
-
|
|
3
|
+
export type SearchBoxOptions = Pick<CoreSearchBoxOptions, 'id' | 'highlightOptions' | 'clearFilters'> & {
|
|
4
|
+
/**
|
|
5
|
+
* When set to true, fills the `results` field rather than the `products` field
|
|
6
|
+
* in the response. It may also include Spotlight Content in the results.
|
|
7
|
+
* @default false
|
|
8
|
+
*/
|
|
9
|
+
enableResults?: boolean;
|
|
10
|
+
};
|
|
11
|
+
type DefaultSearchBoxOptions = Pick<SearchBoxOptions, 'clearFilters' | 'enableResults'>;
|
|
5
12
|
export declare const defaultSearchBoxOptions: Required<DefaultSearchBoxOptions>;
|
|
6
13
|
export declare const searchBoxOptionDefinitions: {
|
|
7
14
|
id: import("@coveo/bueno").StringValue<string>;
|
|
8
15
|
highlightOptions: import("@coveo/bueno").RecordValue;
|
|
9
|
-
clearFilters:
|
|
16
|
+
clearFilters: BooleanValue;
|
|
17
|
+
enableResults: BooleanValue;
|
|
10
18
|
};
|
|
11
19
|
export declare const searchBoxOptionsSchema: Schema<Required<SearchBoxOptions>>;
|
|
12
20
|
export {};
|
|
@@ -1,12 +1,26 @@
|
|
|
1
1
|
import type { CommerceEngine } from '../../../app/commerce-engine/commerce-engine.js';
|
|
2
2
|
import type { QueryTrigger } from '../../core/triggers/headless-core-query-trigger.js';
|
|
3
|
+
/**
|
|
4
|
+
* Options for configuring the `QueryTrigger` controller.
|
|
5
|
+
* @group Buildable controllers
|
|
6
|
+
* @category QueryTrigger
|
|
7
|
+
*/
|
|
8
|
+
export interface QueryTriggerOptions {
|
|
9
|
+
/**
|
|
10
|
+
* When set to true, fills the `results` field rather than the `products` field
|
|
11
|
+
* in the response. It may also include Spotlight Content in the results.
|
|
12
|
+
* @default false
|
|
13
|
+
*/
|
|
14
|
+
enableResults?: boolean;
|
|
15
|
+
}
|
|
3
16
|
/**
|
|
4
17
|
* Creates a `QueryTrigger` controller instance.
|
|
5
18
|
*
|
|
6
19
|
* @param engine - The headless commerce engine.
|
|
20
|
+
* @param options - The configurable `QueryTrigger` controller options.
|
|
7
21
|
* @returns A `QueryTrigger` controller instance.
|
|
8
22
|
*
|
|
9
23
|
* @group Buildable controllers
|
|
10
24
|
* @category QueryTrigger
|
|
11
25
|
* */
|
|
12
|
-
export declare function buildQueryTrigger(engine: CommerceEngine): QueryTrigger;
|
|
26
|
+
export declare function buildQueryTrigger(engine: CommerceEngine, { enableResults }?: QueryTriggerOptions): QueryTrigger;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { AsyncThunkAction, PayloadAction } from '@reduxjs/toolkit';
|
|
2
2
|
import type { AsyncThunkCommerceOptions } from '../../../api/commerce/commerce-api-client.js';
|
|
3
3
|
import type { CommerceEngine } from '../../../app/commerce-engine/commerce-engine.js';
|
|
4
|
-
import { type PrepareForSearchWithQueryPayload, type PromoteChildToParentPayload, type QuerySearchCommerceAPIThunkReturn } from './search-actions.js';
|
|
4
|
+
import { type FetchSearchPayload, type PrepareForSearchWithQueryPayload, type PromoteChildToParentPayload, type QuerySearchCommerceAPIThunkReturn } from './search-actions.js';
|
|
5
5
|
import type { StateNeededByExecuteSearch } from './search-actions-thunk-processor.js';
|
|
6
|
-
export type { PrepareForSearchWithQueryPayload };
|
|
6
|
+
export type { PrepareForSearchWithQueryPayload, FetchSearchPayload };
|
|
7
7
|
/**
|
|
8
8
|
* The search action creators.
|
|
9
9
|
*
|
|
@@ -14,15 +14,17 @@ export interface SearchActionCreators {
|
|
|
14
14
|
/**
|
|
15
15
|
* Executes a search query.
|
|
16
16
|
*
|
|
17
|
+
* @param payload - The action creator payload.
|
|
17
18
|
* @returns A dispatchable action.
|
|
18
19
|
*/
|
|
19
|
-
executeSearch(): AsyncThunkAction<QuerySearchCommerceAPIThunkReturn,
|
|
20
|
+
executeSearch(payload?: FetchSearchPayload): AsyncThunkAction<QuerySearchCommerceAPIThunkReturn, FetchSearchPayload | undefined, AsyncThunkCommerceOptions<StateNeededByExecuteSearch>>;
|
|
20
21
|
/**
|
|
21
22
|
* Fetches and additional page of products and appends it to the current list.
|
|
22
23
|
*
|
|
24
|
+
* @param payload - The action creator payload.
|
|
23
25
|
* @returns A dispatchable action.
|
|
24
26
|
*/
|
|
25
|
-
fetchMoreProducts(): AsyncThunkAction<QuerySearchCommerceAPIThunkReturn | null,
|
|
27
|
+
fetchMoreProducts(payload?: FetchSearchPayload): AsyncThunkAction<QuerySearchCommerceAPIThunkReturn | null, FetchSearchPayload | undefined, AsyncThunkCommerceOptions<StateNeededByExecuteSearch>>;
|
|
26
28
|
/**
|
|
27
29
|
* Updates the query, resets the pagination, and optionally clears all facets in preparation for a new search query.
|
|
28
30
|
*
|
|
@@ -14,6 +14,7 @@ interface FetchedResponse {
|
|
|
14
14
|
duration: number;
|
|
15
15
|
queryExecuted: string;
|
|
16
16
|
requestExecuted: FilterableCommerceAPIRequest;
|
|
17
|
+
enableResults?: boolean;
|
|
17
18
|
}
|
|
18
19
|
export type StateNeededByExecuteSearch = StateNeededForFilterableCommerceAPIRequest & CommerceSearchSection & CommerceQuerySection & CommerceDidYouMeanSection & TriggerSection;
|
|
19
20
|
export interface AsyncThunkConfig {
|
|
@@ -34,6 +35,7 @@ export declare class AsyncSearchThunkProcessor<RejectionType> {
|
|
|
34
35
|
duration: number;
|
|
35
36
|
queryExecuted: string;
|
|
36
37
|
requestExecuted: FilterableCommerceAPIRequest | CommerceSearchRequest;
|
|
38
|
+
enableResults: boolean;
|
|
37
39
|
}>;
|
|
38
40
|
private processSuccessResponse;
|
|
39
41
|
private processQueryErrorOrContinue;
|
|
@@ -10,6 +10,14 @@ export interface QuerySearchCommerceAPIThunkReturn {
|
|
|
10
10
|
/** The original query expression that was received and automatically corrected. */
|
|
11
11
|
originalQuery: string;
|
|
12
12
|
}
|
|
13
|
+
export interface FetchSearchPayload {
|
|
14
|
+
/**
|
|
15
|
+
* When set to true, fills the `results` field rather than the `products` field
|
|
16
|
+
* in the response. It may also include Spotlight Content in the results.
|
|
17
|
+
* @default false
|
|
18
|
+
*/
|
|
19
|
+
enableResults?: boolean;
|
|
20
|
+
}
|
|
13
21
|
export interface PrepareForSearchWithQueryOptions {
|
|
14
22
|
/**
|
|
15
23
|
* Whether to clear all active query filters when the end user submits a new query from the search box.
|
|
@@ -35,7 +43,7 @@ interface FetchInstantProductsThunkReturn {
|
|
|
35
43
|
/** The successful response. */
|
|
36
44
|
response: SearchCommerceSuccessResponse;
|
|
37
45
|
}
|
|
38
|
-
export declare const executeSearch: import("@reduxjs/toolkit").AsyncThunk<QuerySearchCommerceAPIThunkReturn,
|
|
46
|
+
export declare const executeSearch: import("@reduxjs/toolkit").AsyncThunk<QuerySearchCommerceAPIThunkReturn, FetchSearchPayload | undefined, {
|
|
39
47
|
state: StateNeededByExecuteSearch;
|
|
40
48
|
rejectValue: import("../../../api/commerce/commerce-api-error-response.js").CommerceAPIErrorStatusResponse;
|
|
41
49
|
extra: import("../../../app/commerce-thunk-extra-arguments.js").CommerceThunkExtraArguments;
|
|
@@ -45,7 +53,7 @@ export declare const executeSearch: import("@reduxjs/toolkit").AsyncThunk<QueryS
|
|
|
45
53
|
fulfilledMeta?: unknown;
|
|
46
54
|
rejectedMeta?: unknown;
|
|
47
55
|
}>;
|
|
48
|
-
export declare const fetchMoreProducts: import("@reduxjs/toolkit").AsyncThunk<QuerySearchCommerceAPIThunkReturn | null,
|
|
56
|
+
export declare const fetchMoreProducts: import("@reduxjs/toolkit").AsyncThunk<QuerySearchCommerceAPIThunkReturn | null, FetchSearchPayload | undefined, {
|
|
49
57
|
state: StateNeededByExecuteSearch;
|
|
50
58
|
rejectValue: import("../../../api/commerce/commerce-api-error-response.js").CommerceAPIErrorStatusResponse;
|
|
51
59
|
extra: import("../../../app/commerce-thunk-extra-arguments.js").CommerceThunkExtraArguments;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { CommerceAPIErrorStatusResponse } from '../../../api/commerce/commerce-api-error-response.js';
|
|
2
2
|
import type { Product } from '../../../api/commerce/common/product.js';
|
|
3
|
+
import type { Result } from '../../../api/commerce/common/result.js';
|
|
3
4
|
import type { AnyFacetResponse } from '../facets/facet-set/interfaces/response.js';
|
|
4
5
|
export interface CommerceSearchState {
|
|
5
6
|
error: CommerceAPIErrorStatusResponse | null;
|
|
@@ -7,6 +8,7 @@ export interface CommerceSearchState {
|
|
|
7
8
|
requestId: string;
|
|
8
9
|
responseId: string;
|
|
9
10
|
products: Product[];
|
|
11
|
+
results: Result[];
|
|
10
12
|
facets: AnyFacetResponse[];
|
|
11
13
|
queryExecuted: string;
|
|
12
14
|
}
|
|
@@ -140,3 +140,4 @@ export interface SetOriginLevel3ActionCreatorPayload {
|
|
|
140
140
|
originLevel3: string;
|
|
141
141
|
}
|
|
142
142
|
export declare const setOriginLevel3: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[payload: SetOriginLevel3ActionCreatorPayload], SetOriginLevel3ActionCreatorPayload, "configuration/analytics/originlevel3", never, never>;
|
|
143
|
+
export declare const setAgentId: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[payload: string], string, "knowledge/setAgentId", never, never>;
|
|
@@ -5,3 +5,10 @@ export declare const selectLocale: (state: {
|
|
|
5
5
|
export declare const selectTimezone: (state: {
|
|
6
6
|
configuration: ConfigurationState;
|
|
7
7
|
}) => string;
|
|
8
|
+
/**
|
|
9
|
+
* Selects the agent ID from the knowledge configuration.
|
|
10
|
+
* Used for agent-based answer generation via the Agent API.
|
|
11
|
+
*/
|
|
12
|
+
export declare const selectAgentId: (state: {
|
|
13
|
+
configuration: ConfigurationState;
|
|
14
|
+
}) => string | undefined;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { AnswerGenerationApiState } from '../../api/knowledge/answer-generation/answer-generation-api-state.js';
|
|
2
|
+
import type { StreamingStrategy } from '../../api/knowledge/answer-generation/streaming/types.js';
|
|
3
|
+
export declare const createFollowUpAnswerStrategy: () => StreamingStrategy<AnswerGenerationApiState>;
|