From 6da063bc81f356e11a1087d4c055ab20eddcbb2c Mon Sep 17 00:00:00 2001 From: Jessica Date: Thu, 10 Mar 2022 11:46:26 +1100 Subject: [PATCH] add support for TrackEvent and Experiment (#49) - bump to v4.5.1 - also includes some Promotions changes --- generate/generate.sh | 2 +- package-lock.json | 2 +- package.json | 2 +- src/collections.ts | 12 + src/generated/.openapi-generator/FILES | 7 + src/generated/.openapi-generator/VERSION | 2 +- src/generated/api/collectionsApi.ts | 241 +++++++++++++++++- src/generated/api/pipelinesApi.ts | 8 +- src/generated/api/promotionsApi.ts | 11 +- src/generated/api/recordsApi.ts | 6 +- src/generated/api/redirectsApi.ts | 2 +- src/generated/api/schemaApi.ts | 4 +- src/generated/model/banner.ts | 36 ++- src/generated/model/collection.ts | 2 +- src/generated/model/event.ts | 86 +++++++ src/generated/model/experimentRequest.ts | 65 +++++ .../model/experimentRequestPipeline.ts | 50 ++++ src/generated/model/experimentResponse.ts | 36 +++ .../model/getDefaultVersionRequestView.ts | 2 +- src/generated/model/getPipelineRequestView.ts | 2 +- .../model/listPipelinesRequestView.ts | 2 +- .../listPromotionsRequestPromotionView.ts | 22 ++ src/generated/model/models.ts | 21 ++ src/generated/model/promotionPin.ts | 7 + src/generated/model/promotionPinMode.ts | 21 ++ .../queryCollectionRequestTrackingType.ts | 3 +- .../model/queryCollectionResponse.ts | 19 ++ src/generated/model/queryResult.ts | 16 ++ src/generated/model/textPosition.ts | 25 ++ src/version.ts | 2 +- 30 files changed, 691 insertions(+), 25 deletions(-) create mode 100644 src/generated/model/event.ts create mode 100644 src/generated/model/experimentRequest.ts create mode 100644 src/generated/model/experimentRequestPipeline.ts create mode 100644 src/generated/model/experimentResponse.ts create mode 100644 src/generated/model/listPromotionsRequestPromotionView.ts create mode 100644 src/generated/model/promotionPinMode.ts create mode 100644 src/generated/model/textPosition.ts diff --git a/generate/generate.sh b/generate/generate.sh index 3226604..ef6cd39 100755 --- a/generate/generate.sh +++ b/generate/generate.sh @@ -16,7 +16,7 @@ if [ -z "$TEMPLATES_PATH" ]; then die "TEMPLATES_PATH must be set, e.g. /path/to/sajari/sdk-node/generate/templates" fi -VERSION=4.4.1 +VERSION=4.5.1 docker-entrypoint.sh generate \ -i /openapi.json \ diff --git a/package-lock.json b/package-lock.json index 5cb3101..007529d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@sajari/sdk-node", - "version": "4.4.1", + "version": "4.5.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 3cd070c..b075526 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@sajari/sdk-node", - "version": "4.4.1", + "version": "4.5.1", "repository": "git@github.com:github.com/sajari/sdk-node.git", "author": "Search.io", "license": "MIT", diff --git a/src/collections.ts b/src/collections.ts index 2c93b37..d4dd346 100644 --- a/src/collections.ts +++ b/src/collections.ts @@ -3,12 +3,15 @@ import { CollectionsApi, Collection, QueryCollectionRequest, + Event } from "./generated/api"; import { clientUserAgentHeader, clientUserAgent } from "./user-agent"; import { handleError } from "./api-util"; export { withEndpoint, withKeyCredentials } from "./client"; +type HeaderOptions = { headers: { [name: string]: string }}; + export class CollectionsClient extends Client { client: CollectionsApi; @@ -110,6 +113,15 @@ export class CollectionsClient extends Client { throw handleError(e); } } + + async trackEvent(accountId: string, collectionId: string, event: Event, options?: HeaderOptions) { + try { + const res = await this.client.trackEvent(accountId, collectionId, event, options); + return res.body; + } catch (e) { + throw handleError(e); + } + } } export const setCollectionDisplayName = diff --git a/src/generated/.openapi-generator/FILES b/src/generated/.openapi-generator/FILES index a394859..ca695e8 100644 --- a/src/generated/.openapi-generator/FILES +++ b/src/generated/.openapi-generator/FILES @@ -25,6 +25,10 @@ model/batchUpsertRecordsResponseKey.ts model/batchUpsertRecordsResponseVariables.ts model/collection.ts model/deleteRecordRequest.ts +model/event.ts +model/experimentRequest.ts +model/experimentRequestPipeline.ts +model/experimentResponse.ts model/generatePipelinesRequest.ts model/generatePipelinesResponse.ts model/getDefaultPipelineResponse.ts @@ -34,6 +38,7 @@ model/getRecordRequest.ts model/listCollectionsResponse.ts model/listPipelinesRequestView.ts model/listPipelinesResponse.ts +model/listPromotionsRequestPromotionView.ts model/listPromotionsResponse.ts model/listRedirectsResponse.ts model/listSchemaFieldsResponse.ts @@ -50,6 +55,7 @@ model/promotionExclusion.ts model/promotionFilterBoost.ts model/promotionFilterCondition.ts model/promotionPin.ts +model/promotionPinMode.ts model/promotionRangeBoost.ts model/protobufAny.ts model/protobufFieldMask.ts @@ -82,6 +88,7 @@ model/sendEventRequest.ts model/setDefaultPipelineRequest.ts model/setDefaultVersionRequest.ts model/status.ts +model/textPosition.ts model/updateRecordRequest.ts model/upsertRecordRequest.ts model/upsertRecordRequestPipeline.ts diff --git a/src/generated/.openapi-generator/VERSION b/src/generated/.openapi-generator/VERSION index 7d3cdbf..1e20ec3 100644 --- a/src/generated/.openapi-generator/VERSION +++ b/src/generated/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0 \ No newline at end of file diff --git a/src/generated/api/collectionsApi.ts b/src/generated/api/collectionsApi.ts index b37b322..ea38aff 100644 --- a/src/generated/api/collectionsApi.ts +++ b/src/generated/api/collectionsApi.ts @@ -15,6 +15,9 @@ import http from "http"; /* tslint:disable:no-unused-locals */ import { Collection } from "../model/collection"; +import { Event } from "../model/event"; +import { ExperimentRequest } from "../model/experimentRequest"; +import { ExperimentResponse } from "../model/experimentResponse"; import { ListCollectionsResponse } from "../model/listCollectionsResponse"; import { QueryCollectionRequest } from "../model/queryCollectionRequest"; import { QueryCollectionResponse } from "../model/queryCollectionResponse"; @@ -324,6 +327,116 @@ export class CollectionsApi { ); }); } + /** + * Run a query on a collection with a hypothetical configuration to see what kinds of results it produces. Saved promotions with a start date in the future are enabled during the experiment, unless they are explicitly disabled. The following example demonstrates how to run a simple experiment for a string, against a pipeline and with a proposed promotion: ```json { \"pipeline\": { \"name\": \"my-pipeline\" }, \"variables\": { \"q\": \"search terms\" }, \"promotions\": [{ \"id\": \"1234\", \"condition\": \"q = \'search terms\'\", \"pins\": [{ \"key\": { \"field\": \"id\", \"value\": \"54hdc7h2334h\" }, \"position\": 1 }] }] } ``` + * @summary Experiment + * @param collectionId The collection to query, e.g. `my-collection`. + * @param experimentRequest + */ + public async experiment( + collectionId: string, + experimentRequest: ExperimentRequest, + options: { headers: { [name: string]: string } } = { headers: {} } + ): Promise<{ response: http.IncomingMessage; body: ExperimentResponse }> { + const localVarPath = + this.basePath + + "/v4/collections/{collection_id}:experiment".replace( + "{" + "collection_id" + "}", + encodeURIComponent(String(collectionId)) + ); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign( + {}, + this._defaultHeaders + ); + const produces = ["application/json"]; + // give precedence to 'application/json' + if (produces.indexOf("application/json") >= 0) { + localVarHeaderParams.Accept = "application/json"; + } else { + localVarHeaderParams.Accept = produces.join(","); + } + let localVarFormParams: any = {}; + + // verify required parameter 'collectionId' is not null or undefined + if (collectionId === null || collectionId === undefined) { + throw new Error( + "Required parameter collectionId was null or undefined when calling experiment." + ); + } + + // verify required parameter 'experimentRequest' is not null or undefined + if (experimentRequest === null || experimentRequest === undefined) { + throw new Error( + "Required parameter experimentRequest was null or undefined when calling experiment." + ); + } + + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: "POST", + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + body: ObjectSerializer.serialize(experimentRequest, "ExperimentRequest"), + }; + + let authenticationPromise = Promise.resolve(); + if ( + this.authentications.BasicAuth.username && + this.authentications.BasicAuth.password + ) { + authenticationPromise = authenticationPromise.then(() => + this.authentications.BasicAuth.applyToRequest(localVarRequestOptions) + ); + } + authenticationPromise = authenticationPromise.then(() => + this.authentications.default.applyToRequest(localVarRequestOptions) + ); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => + interceptor(localVarRequestOptions) + ); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ + response: http.IncomingMessage; + body: ExperimentResponse; + }>((resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if ( + response.statusCode && + response.statusCode >= 200 && + response.statusCode <= 299 + ) { + body = ObjectSerializer.deserialize(body, "ExperimentResponse"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + }); + }); + } /** * Retrieve the details of a collection. * @summary Get collection @@ -427,7 +540,7 @@ export class CollectionsApi { * Retrieve a list of collections in an account. * @summary List collections * @param pageSize The maximum number of collections to return. The service may return fewer than this value. If unspecified, at most 50 collections are returned. The maximum value is 100; values above 100 are coerced to 100. - * @param pageToken A page token, received from a previous [ListCollections](/api#operation/ListCollections) call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to [ListCollections](/api#operation/ListCollections) must match the call that provided the page token. + * @param pageToken A page token, received from a previous [ListCollections](/docs/api#operation/ListCollections) call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to [ListCollections](/docs/api#operation/ListCollections) must match the call that provided the page token. */ public async listCollections( pageSize?: number, @@ -534,7 +647,7 @@ export class CollectionsApi { }); } /** - * Query the collection to search for records. The following example demonstrates how to run a simple search for a particular string: ```json { \"variables\": { \"q\": \"search terms\" } } ``` For more information: - See [filtering content](https://docs.search.io/documentation/fundamentals/integrating-search/filters-and-sort-options) - See [tracking in the Go SDK](https://github.com/sajari/sdk-go/blob/v2/session.go) - See [tracking in the JS SDK](https://github.com/sajari/sajari-sdk-js/blob/master/src/session.ts) + * Query the collection to search for records. The following example demonstrates how to run a simple search for a particular string: ```json { \"variables\": { \"q\": \"search terms\" } } ``` For more information: - See [filtering content](https://docs.search.io/documentation/fundamentals/integrating-search/filters-and-sort-options) - See [tracking in the Go SDK](https://github.com/sajari/sdk-go/blob/v2/session.go) - See [tracking in the JS SDK](https://github.com/sajari/sdk-js/blob/554e182e77d3ba99a9c100b208ebf3be414d2067/src/index.ts#L881) Note: Unlike other API calls, the `QueryCollection` call can be called from a browser. When called from a browser, the `Account-Id` header must be set to your account ID. * @summary Query collection * @param collectionId The collection to query, e.g. `my-collection`. * @param queryCollectionRequest @@ -656,7 +769,7 @@ export class CollectionsApi { }); } /** - * Query the collection to search for records. The following example demonstrates how to run a simple search for a particular string: ```json { \"variables\": { \"q\": \"search terms\" } } ``` For more information: - See [filtering content](https://docs.search.io/documentation/fundamentals/integrating-search/filters-and-sort-options) - See [tracking in the Go SDK](https://github.com/sajari/sdk-go/blob/v2/session.go) - See [tracking in the JS SDK](https://github.com/sajari/sajari-sdk-js/blob/master/src/session.ts) + * Query the collection to search for records. The following example demonstrates how to run a simple search for a particular string: ```json { \"variables\": { \"q\": \"search terms\" } } ``` For more information: - See [filtering content](https://docs.search.io/documentation/fundamentals/integrating-search/filters-and-sort-options) - See [tracking in the Go SDK](https://github.com/sajari/sdk-go/blob/v2/session.go) - See [tracking in the JS SDK](https://github.com/sajari/sdk-js/blob/554e182e77d3ba99a9c100b208ebf3be414d2067/src/index.ts#L881) Note: Unlike other API calls, the `QueryCollection` call can be called from a browser. When called from a browser, the `Account-Id` header must be set to your account ID. * @summary Query collection * @param collectionId The collection to query, e.g. `my-collection`. * @param queryCollectionRequest @@ -777,6 +890,128 @@ export class CollectionsApi { }); }); } + /** + * Track an analytics event when a user interacts with an object returned by a [QueryCollection](/docs/api/#operation/QueryCollection) request. An analytics event can be tracked for the following objects: - Results - Promotion banners - Redirects Note: You must pass an `Account-Id` header. + * @summary Track event + * @param accountId The account that owns the collection, e.g. `1618535966441231024`. + * @param collectionId The collection to track the event against, e.g. `my-collection`. + * @param event The details of the event to track. + */ + public async trackEvent( + accountId: string, + collectionId: string, + event: Event, + options: { headers: { [name: string]: string } } = { headers: {} } + ): Promise<{ response: http.IncomingMessage; body: object }> { + const localVarPath = + this.basePath + + "/v4/collections/{collection_id}:trackEvent".replace( + "{" + "collection_id" + "}", + encodeURIComponent(String(collectionId)) + ); + let localVarQueryParameters: any = {}; + let localVarHeaderParams: any = (Object).assign( + {}, + this._defaultHeaders + ); + const produces = ["application/json"]; + // give precedence to 'application/json' + if (produces.indexOf("application/json") >= 0) { + localVarHeaderParams.Accept = "application/json"; + } else { + localVarHeaderParams.Accept = produces.join(","); + } + let localVarFormParams: any = {}; + + // verify required parameter 'accountId' is not null or undefined + if (accountId === null || accountId === undefined) { + throw new Error( + "Required parameter accountId was null or undefined when calling trackEvent." + ); + } + + // verify required parameter 'collectionId' is not null or undefined + if (collectionId === null || collectionId === undefined) { + throw new Error( + "Required parameter collectionId was null or undefined when calling trackEvent." + ); + } + + // verify required parameter 'event' is not null or undefined + if (event === null || event === undefined) { + throw new Error( + "Required parameter event was null or undefined when calling trackEvent." + ); + } + + localVarHeaderParams["Account-Id"] = ObjectSerializer.serialize( + accountId, + "string" + ); + (Object).assign(localVarHeaderParams, options.headers); + + let localVarUseFormData = false; + + let localVarRequestOptions: localVarRequest.Options = { + method: "POST", + qs: localVarQueryParameters, + headers: localVarHeaderParams, + uri: localVarPath, + useQuerystring: this._useQuerystring, + json: true, + body: ObjectSerializer.serialize(event, "Event"), + }; + + let authenticationPromise = Promise.resolve(); + if ( + this.authentications.BasicAuth.username && + this.authentications.BasicAuth.password + ) { + authenticationPromise = authenticationPromise.then(() => + this.authentications.BasicAuth.applyToRequest(localVarRequestOptions) + ); + } + authenticationPromise = authenticationPromise.then(() => + this.authentications.default.applyToRequest(localVarRequestOptions) + ); + + let interceptorPromise = authenticationPromise; + for (const interceptor of this.interceptors) { + interceptorPromise = interceptorPromise.then(() => + interceptor(localVarRequestOptions) + ); + } + + return interceptorPromise.then(() => { + if (Object.keys(localVarFormParams).length) { + if (localVarUseFormData) { + (localVarRequestOptions).formData = localVarFormParams; + } else { + localVarRequestOptions.form = localVarFormParams; + } + } + return new Promise<{ response: http.IncomingMessage; body: object }>( + (resolve, reject) => { + localVarRequest(localVarRequestOptions, (error, response, body) => { + if (error) { + reject(error); + } else { + if ( + response.statusCode && + response.statusCode >= 200 && + response.statusCode <= 299 + ) { + body = ObjectSerializer.deserialize(body, "object"); + resolve({ response: response, body: body }); + } else { + reject(new HttpError(response, body, response.statusCode)); + } + } + }); + } + ); + }); + } /** * Update the details of a collection. * @summary Update collection diff --git a/src/generated/api/pipelinesApi.ts b/src/generated/api/pipelinesApi.ts index 179cffd..7bc2b70 100644 --- a/src/generated/api/pipelinesApi.ts +++ b/src/generated/api/pipelinesApi.ts @@ -476,7 +476,7 @@ export class PipelinesApi { * @param collectionId The collection that owns the pipeline to get the default version of, e.g. `my-collection`. * @param type The type of the pipeline to get the default version of. * @param name The name of the pipeline to get the default version of, e.g. `my-pipeline`. - * @param view The amount of information to include in the retrieved pipeline. - VIEW_UNSPECIFIED: The default / unset value. The API defaults to the `BASIC` view. - BASIC: Include basic information including type, name, version and description but not the full step configuration. This is the default value (for both [ListPipelines](/api#operation/ListPipelines) and [GetPipeline](/api#operation/GetPipeline)). - FULL: Include the information from `BASIC`, plus full step configuration. + * @param view The amount of information to include in the retrieved pipeline. - VIEW_UNSPECIFIED: The default / unset value. The API defaults to the `BASIC` view. - BASIC: Include basic information including type, name, version and description but not the full step configuration. This is the default value (for both [ListPipelines](/docs/api#operation/ListPipelines) and [GetPipeline](/docs/api#operation/GetPipeline)). - FULL: Include the information from `BASIC`, plus full step configuration. */ public async getDefaultVersion( collectionId: string, @@ -606,7 +606,7 @@ export class PipelinesApi { * @param type The type of the pipeline to retrieve. * @param name The name of the pipeline to retrieve, e.g. `my-pipeline`. * @param version The version of the pipeline to retrieve, e.g. `42`. - * @param view The amount of information to include in the retrieved pipeline. - VIEW_UNSPECIFIED: The default / unset value. The API defaults to the `BASIC` view. - BASIC: Include basic information including type, name, version and description but not the full step configuration. This is the default value (for both [ListPipelines](/api#operation/ListPipelines) and [GetPipeline](/api#operation/GetPipeline)). - FULL: Include the information from `BASIC`, plus full step configuration. + * @param view The amount of information to include in the retrieved pipeline. - VIEW_UNSPECIFIED: The default / unset value. The API defaults to the `BASIC` view. - BASIC: Include basic information including type, name, version and description but not the full step configuration. This is the default value (for both [ListPipelines](/docs/api#operation/ListPipelines) and [GetPipeline](/docs/api#operation/GetPipeline)). - FULL: Include the information from `BASIC`, plus full step configuration. */ public async getPipeline( collectionId: string, @@ -743,8 +743,8 @@ export class PipelinesApi { * @summary List pipelines * @param collectionId The collection that owns this set of pipelines, e.g. `my-collection`. * @param pageSize The maximum number of pipelines to return. The service may return fewer than this value. If unspecified, at most 50 pipelines are returned. The maximum value is 1000; values above 1000 are coerced to 1000. - * @param pageToken A page token, received from a previous [ListPipelines](/api#operation/ListPipelines) call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to [ListPipelines](/api#operation/ListPipelines) must match the call that provided the page token. - * @param view The amount of information to include in each retrieved pipeline. - VIEW_UNSPECIFIED: The default / unset value. The API defaults to the `BASIC` view. - BASIC: Include basic information including type, name, version and description but not the full step configuration. This is the default value (for both [ListPipelines](/api#operation/ListPipelines) and [GetPipeline](/api#operation/GetPipeline)). - FULL: Include the information from `BASIC`, plus full step configuration. + * @param pageToken A page token, received from a previous [ListPipelines](/docs/api#operation/ListPipelines) call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to [ListPipelines](/docs/api#operation/ListPipelines) must match the call that provided the page token. + * @param view The amount of information to include in each retrieved pipeline. - VIEW_UNSPECIFIED: The default / unset value. The API defaults to the `BASIC` view. - BASIC: Include basic information including type, name, version and description but not the full step configuration. This is the default value (for both [ListPipelines](/docs/api#operation/ListPipelines) and [GetPipeline](/docs/api#operation/GetPipeline)). - FULL: Include the information from `BASIC`, plus full step configuration. */ public async listPipelines( collectionId: string, diff --git a/src/generated/api/promotionsApi.ts b/src/generated/api/promotionsApi.ts index c997e46..1a86d69 100644 --- a/src/generated/api/promotionsApi.ts +++ b/src/generated/api/promotionsApi.ts @@ -452,12 +452,14 @@ export class PromotionsApi { * @summary List promotions * @param collectionId The collection that owns this set of promotions, e.g. `my-collection`. * @param pageSize The maximum number of promotions to return. The service may return fewer than this value. If unspecified, at most 50 promotions are returned. The maximum value is 1000; values above 1000 are coerced to 1000. - * @param pageToken A page token, received from a previous [ListPromotions](/api#operation/ListPromotions) call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to [ListPromotions](/api#operation/ListPromotions) must match the call that provided the page token. + * @param pageToken A page token, received from a previous [ListPromotions](/docs/api#operation/ListPromotions) call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to [ListPromotions](/docs/api#operation/ListPromotions) must match the call that provided the page token. + * @param view The amount of information to include in each retrieved promotion. - PROMOTION_VIEW_UNSPECIFIED: The default / unset value. The API defaults to the `FULL` view. - BASIC: Include basic information including name, start time and end time, but not detailed information about the promotion effects. - FULL: Returns all information about a promotion. This is the default value. */ public async listPromotions( collectionId: string, pageSize?: number, pageToken?: string, + view?: "PROMOTION_VIEW_UNSPECIFIED" | "BASIC" | "FULL", options: { headers: { [name: string]: string } } = { headers: {} } ): Promise<{ response: http.IncomingMessage; body: ListPromotionsResponse }> { const localVarPath = @@ -501,6 +503,13 @@ export class PromotionsApi { ); } + if (view !== undefined) { + localVarQueryParameters["view"] = ObjectSerializer.serialize( + view, + "'PROMOTION_VIEW_UNSPECIFIED' | 'BASIC' | 'FULL'" + ); + } + (Object).assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; diff --git a/src/generated/api/recordsApi.ts b/src/generated/api/recordsApi.ts index dfd5bd4..2eb309e 100644 --- a/src/generated/api/recordsApi.ts +++ b/src/generated/api/recordsApi.ts @@ -120,7 +120,7 @@ export class RecordsApi { } /** - * The batch version of the [UpdateRecord](/api#operation/UpdateRecord) call. + * The batch version of the [UpdateRecord](/docs/api#operation/UpdateRecord) call. * @summary Batch update records * @param collectionId The collection that contains the records to update, e.g. `my-collection`. * @param batchUpdateRecordsRequest @@ -242,7 +242,7 @@ export class RecordsApi { }); } /** - * The batch version of the [UpsertRecord](/api#operation/UpsertRecord) call. + * The batch version of the [UpsertRecord](/docs/api#operation/UpsertRecord) call. * @summary Batch upsert records * @param collectionId The collection to upsert the records in, e.g. `my-collection`. * @param batchUpsertRecordsRequest @@ -585,7 +585,7 @@ export class RecordsApi { }); } /** - * Add or update specific fields within a record with the given values. The updated record is returned in the response. To replace all fields in a record, you should use the [UpsertRecord](/api#operation/UpsertRecord) call. Note that the update record call cannot be used to add or update indexed or unique fields. For this case use the [UpsertRecord](/api#operation/UpsertRecord) call. + * Add or update specific fields within a record with the given values. The updated record is returned in the response. To replace all fields in a record, you should use the [UpsertRecord](/docs/api#operation/UpsertRecord) call. Note that the update record call cannot be used to add or update indexed or unique fields. For this case use the [UpsertRecord](/docs/api#operation/UpsertRecord) call. * @summary Update record * @param collectionId The collection that contains the record to update, e.g. `my-collection`. * @param updateRecordRequest diff --git a/src/generated/api/redirectsApi.ts b/src/generated/api/redirectsApi.ts index 652f882..369008d 100644 --- a/src/generated/api/redirectsApi.ts +++ b/src/generated/api/redirectsApi.ts @@ -452,7 +452,7 @@ export class RedirectsApi { * @summary List redirects * @param collectionId The collection that owns this set of redirects, e.g. `my-collection`. * @param pageSize The maximum number of redirects to return. The service may return fewer than this value. If unspecified, at most 50 redirects are returned. The maximum value is 1000; values above 1000 are coerced to 1000. - * @param pageToken A page token, received from a previous [ListRedirects](/api#operation/ListRedirects) call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to [ListRedirects](/api#operation/ListRedirects) must match the call that provided the page token. + * @param pageToken A page token, received from a previous [ListRedirects](/docs/api#operation/ListRedirects) call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to [ListRedirects](/docs/api#operation/ListRedirects) must match the call that provided the page token. */ public async listRedirects( collectionId: string, diff --git a/src/generated/api/schemaApi.ts b/src/generated/api/schemaApi.ts index 64fd5cf..ff4a5a3 100644 --- a/src/generated/api/schemaApi.ts +++ b/src/generated/api/schemaApi.ts @@ -115,7 +115,7 @@ export class SchemaApi { } /** - * The batch version of the [CreateSchemaField](/api#operation/CreateSchemaField) call. + * The batch version of the [CreateSchemaField](/docs/api#operation/CreateSchemaField) call. * @summary Batch create schema fields * @param collectionId The collection to create the schema fields in, e.g. `my-collection`. * @param batchCreateSchemaFieldsRequest @@ -350,7 +350,7 @@ export class SchemaApi { * @summary List schema fields * @param collectionId The collection that owns this set of schema fields, e.g. `my-collection`. * @param pageSize The maximum number of schema fields to return. The service may return fewer than this value. If unspecified, at most 50 schema fields are returned. The maximum value is 1000; values above 1000 are coerced to 1000. - * @param pageToken A page token, received from a previous [ListSchemaFields](/api#operation/ListSchemaFields) call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to [ListSchemaFields](/api#operation/ListSchemaFields) must match the call that provided the page token. + * @param pageToken A page token, received from a previous [ListSchemaFields](/docs/api#operation/ListSchemaFields) call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to [ListSchemaFields](/docs/api#operation/ListSchemaFields) must match the call that provided the page token. */ public async listSchemaFields( collectionId: string, diff --git a/src/generated/model/banner.ts b/src/generated/model/banner.ts index f662997..eddc776 100644 --- a/src/generated/model/banner.ts +++ b/src/generated/model/banner.ts @@ -11,13 +11,18 @@ */ import { RequestFile } from "./models"; +import { TextPosition } from "./textPosition"; /** * A synthetic search result that renders as an image. It takes a user to a pre-determined location when clicked. */ export class Banner { /** - * the height the banner occupies in grid cells. + * The description of the banner, displayed in sub-head font. + */ + "description"?: string; + /** + * The height the banner occupies in grid cells. */ "height"?: number; /** @@ -36,6 +41,15 @@ export class Banner { * The URL to redirect the user to when the banner is clicked. */ "targetUrl"?: string; + /** + * The color of the text as a hex code with a # prefix, e.g. #FFCC00 or #FC0. + */ + "textColor"?: string; + "textPosition"?: TextPosition; + /** + * The title of the banner, displayed in header font. + */ + "title"?: string; /** * The width the banner occupies in grid cells. */ @@ -48,6 +62,11 @@ export class Banner { baseName: string; type: string; }> = [ + { + name: "description", + baseName: "description", + type: "string", + }, { name: "height", baseName: "height", @@ -73,6 +92,21 @@ export class Banner { baseName: "target_url", type: "string", }, + { + name: "textColor", + baseName: "text_color", + type: "string", + }, + { + name: "textPosition", + baseName: "text_position", + type: "TextPosition", + }, + { + name: "title", + baseName: "title", + type: "string", + }, { name: "width", baseName: "width", diff --git a/src/generated/model/collection.ts b/src/generated/model/collection.ts index 360a58a..8d7db68 100644 --- a/src/generated/model/collection.ts +++ b/src/generated/model/collection.ts @@ -18,7 +18,7 @@ export class Collection { */ "accountId"?: string; /** - * The list of authorized query domains for the collection. Client-side / browser requests to the [QueryCollection](/api#operation/QueryCollection) call can be made by any authorized query domain or any of its subdomains. This allows your interface to make search requests without having to provide an API key in the client-side request. + * The list of authorized query domains for the collection. Client-side / browser requests to the [QueryCollection](/docs/api#operation/QueryCollection) call can be made by any authorized query domain or any of its subdomains. This allows your interface to make search requests without having to provide an API key in the client-side request. */ "authorizedQueryDomains"?: Array; /** diff --git a/src/generated/model/event.ts b/src/generated/model/event.ts new file mode 100644 index 0000000..d65d5e7 --- /dev/null +++ b/src/generated/model/event.ts @@ -0,0 +1,86 @@ +/** + * Search.io API + * Search.io offers a search and discovery service with Neuralsearch®, the world\'s first instant AI search technology. Businesses of all sizes use Search.io to build site search and discovery solutions that maximize e-commerce revenue, optimize on-site customer experience, and scale their online presence. + * + * The version of the OpenAPI document: v4 + * Contact: support@search.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from "./models"; + +/** + * An analytics event that relates to a query made on a collection. + */ +export class Event { + /** + * The identifier of the promotion banner the event is about. + */ + "bannerId"?: string; + /** + * An object made up of field-value pairs that contains additional metadata to record with the event. + */ + "metadata"?: { [key: string]: object }; + /** + * The query identifier. + */ + "queryId": string; + /** + * The identifier of the redirect the event is about. + */ + "redirectId"?: string; + /** + * The identifier of the result the event is about. + */ + "resultId"?: string; + /** + * The type of event, e.g. `click`, `purchase`, `add_to_cart`. + */ + "type": string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{ + name: string; + baseName: string; + type: string; + }> = [ + { + name: "bannerId", + baseName: "banner_id", + type: "string", + }, + { + name: "metadata", + baseName: "metadata", + type: "{ [key: string]: object; }", + }, + { + name: "queryId", + baseName: "query_id", + type: "string", + }, + { + name: "redirectId", + baseName: "redirect_id", + type: "string", + }, + { + name: "resultId", + baseName: "result_id", + type: "string", + }, + { + name: "type", + baseName: "type", + type: "string", + }, + ]; + + static getAttributeTypeMap() { + return Event.attributeTypeMap; + } +} diff --git a/src/generated/model/experimentRequest.ts b/src/generated/model/experimentRequest.ts new file mode 100644 index 0000000..87a73d5 --- /dev/null +++ b/src/generated/model/experimentRequest.ts @@ -0,0 +1,65 @@ +/** + * Search.io API + * Search.io offers a search and discovery service with Neuralsearch®, the world\'s first instant AI search technology. Businesses of all sizes use Search.io to build site search and discovery solutions that maximize e-commerce revenue, optimize on-site customer experience, and scale their online presence. + * + * The version of the OpenAPI document: v4 + * Contact: support@search.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from "./models"; +import { ExperimentRequestPipeline } from "./experimentRequestPipeline"; +import { Pipeline } from "./pipeline"; +import { Promotion } from "./promotion"; + +/** + * A request to perform a query experiment on a collection using a pipeline. + */ +export class ExperimentRequest { + "customPipeline"?: Pipeline; + "pipeline"?: ExperimentRequestPipeline; + /** + * The promotions to consider active when running the search. Provided promotions override existing promotions with the same ID. + */ + "promotions"?: Array; + /** + * The initial values for the variables the pipeline operates on and transforms throughout its steps. The most important variable is `q` which is the query the user entered, for example: ```json { \"q\": \"search terms\" } ``` To paginate through results, set the variables `page` and `resultsPerPage`, for example: ```json { \"q\": \"search terms\", \"page\": 5, \"resultsPerPage\": 20 } ``` To sort results, set the variable `sort` to the name of one of your collection\'s schema fields, for example: ```json { \"q\": \"search terms\", \"sort\": \"name\" } ``` To sort in reverse, prefix the schema field with a minus sign `-`, for example: ```json { \"q\": \"search terms\", \"sort\": \"-name\" } ``` + */ + "variables": { [key: string]: object }; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{ + name: string; + baseName: string; + type: string; + }> = [ + { + name: "customPipeline", + baseName: "custom_pipeline", + type: "Pipeline", + }, + { + name: "pipeline", + baseName: "pipeline", + type: "ExperimentRequestPipeline", + }, + { + name: "promotions", + baseName: "promotions", + type: "Array", + }, + { + name: "variables", + baseName: "variables", + type: "{ [key: string]: object; }", + }, + ]; + + static getAttributeTypeMap() { + return ExperimentRequest.attributeTypeMap; + } +} diff --git a/src/generated/model/experimentRequestPipeline.ts b/src/generated/model/experimentRequestPipeline.ts new file mode 100644 index 0000000..033ace6 --- /dev/null +++ b/src/generated/model/experimentRequestPipeline.ts @@ -0,0 +1,50 @@ +/** + * Search.io API + * Search.io offers a search and discovery service with Neuralsearch®, the world\'s first instant AI search technology. Businesses of all sizes use Search.io to build site search and discovery solutions that maximize e-commerce revenue, optimize on-site customer experience, and scale their online presence. + * + * The version of the OpenAPI document: v4 + * Contact: support@search.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from "./models"; + +/** + * The pipeline to use when running the experiment. If not provided the default query pipeline is used. + */ +export class ExperimentRequestPipeline { + /** + * The query pipeline\'s name, e.g. `my-pipeline`. + */ + "name": string; + /** + * The query pipeline\'s version, e.g. `42`. If not provided the default version is used. + */ + "version"?: string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{ + name: string; + baseName: string; + type: string; + }> = [ + { + name: "name", + baseName: "name", + type: "string", + }, + { + name: "version", + baseName: "version", + type: "string", + }, + ]; + + static getAttributeTypeMap() { + return ExperimentRequestPipeline.attributeTypeMap; + } +} diff --git a/src/generated/model/experimentResponse.ts b/src/generated/model/experimentResponse.ts new file mode 100644 index 0000000..8a7cd43 --- /dev/null +++ b/src/generated/model/experimentResponse.ts @@ -0,0 +1,36 @@ +/** + * Search.io API + * Search.io offers a search and discovery service with Neuralsearch®, the world\'s first instant AI search technology. Businesses of all sizes use Search.io to build site search and discovery solutions that maximize e-commerce revenue, optimize on-site customer experience, and scale their online presence. + * + * The version of the OpenAPI document: v4 + * Contact: support@search.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from "./models"; +import { QueryCollectionResponse } from "./queryCollectionResponse"; + +export class ExperimentResponse { + "queryResponse"?: QueryCollectionResponse; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{ + name: string; + baseName: string; + type: string; + }> = [ + { + name: "queryResponse", + baseName: "query_response", + type: "QueryCollectionResponse", + }, + ]; + + static getAttributeTypeMap() { + return ExperimentResponse.attributeTypeMap; + } +} diff --git a/src/generated/model/getDefaultVersionRequestView.ts b/src/generated/model/getDefaultVersionRequestView.ts index 70283d6..6f5e6b4 100644 --- a/src/generated/model/getDefaultVersionRequestView.ts +++ b/src/generated/model/getDefaultVersionRequestView.ts @@ -13,7 +13,7 @@ import { RequestFile } from "./models"; /** - * - VIEW_UNSPECIFIED: The default / unset value. The API defaults to the `BASIC` view. - BASIC: Include basic information including type, name, version and description but not the full step configuration. This is the default value (for both [ListPipelines](/api#operation/ListPipelines) and [GetPipeline](/api#operation/GetPipeline)). - FULL: Include the information from `BASIC`, plus full step configuration. + * - VIEW_UNSPECIFIED: The default / unset value. The API defaults to the `BASIC` view. - BASIC: Include basic information including type, name, version and description but not the full step configuration. This is the default value (for both [ListPipelines](/docs/api#operation/ListPipelines) and [GetPipeline](/docs/api#operation/GetPipeline)). - FULL: Include the information from `BASIC`, plus full step configuration. */ export enum GetDefaultVersionRequestView { ViewUnspecified = "VIEW_UNSPECIFIED", diff --git a/src/generated/model/getPipelineRequestView.ts b/src/generated/model/getPipelineRequestView.ts index 05fdd9a..a8fb358 100644 --- a/src/generated/model/getPipelineRequestView.ts +++ b/src/generated/model/getPipelineRequestView.ts @@ -13,7 +13,7 @@ import { RequestFile } from "./models"; /** - * - VIEW_UNSPECIFIED: The default / unset value. The API defaults to the `BASIC` view. - BASIC: Include basic information including type, name, version and description but not the full step configuration. This is the default value (for both [ListPipelines](/api#operation/ListPipelines) and [GetPipeline](/api#operation/GetPipeline)). - FULL: Include the information from `BASIC`, plus full step configuration. + * - VIEW_UNSPECIFIED: The default / unset value. The API defaults to the `BASIC` view. - BASIC: Include basic information including type, name, version and description but not the full step configuration. This is the default value (for both [ListPipelines](/docs/api#operation/ListPipelines) and [GetPipeline](/docs/api#operation/GetPipeline)). - FULL: Include the information from `BASIC`, plus full step configuration. */ export enum GetPipelineRequestView { ViewUnspecified = "VIEW_UNSPECIFIED", diff --git a/src/generated/model/listPipelinesRequestView.ts b/src/generated/model/listPipelinesRequestView.ts index 2a42bee..0898514 100644 --- a/src/generated/model/listPipelinesRequestView.ts +++ b/src/generated/model/listPipelinesRequestView.ts @@ -13,7 +13,7 @@ import { RequestFile } from "./models"; /** - * - VIEW_UNSPECIFIED: The default / unset value. The API defaults to the `BASIC` view. - BASIC: Include basic information including type, name, version and description but not the full step configuration. This is the default value (for both [ListPipelines](/api#operation/ListPipelines) and [GetPipeline](/api#operation/GetPipeline)). - FULL: Include the information from `BASIC`, plus full step configuration. + * - VIEW_UNSPECIFIED: The default / unset value. The API defaults to the `BASIC` view. - BASIC: Include basic information including type, name, version and description but not the full step configuration. This is the default value (for both [ListPipelines](/docs/api#operation/ListPipelines) and [GetPipeline](/docs/api#operation/GetPipeline)). - FULL: Include the information from `BASIC`, plus full step configuration. */ export enum ListPipelinesRequestView { ViewUnspecified = "VIEW_UNSPECIFIED", diff --git a/src/generated/model/listPromotionsRequestPromotionView.ts b/src/generated/model/listPromotionsRequestPromotionView.ts new file mode 100644 index 0000000..6db178b --- /dev/null +++ b/src/generated/model/listPromotionsRequestPromotionView.ts @@ -0,0 +1,22 @@ +/** + * Search.io API + * Search.io offers a search and discovery service with Neuralsearch®, the world\'s first instant AI search technology. Businesses of all sizes use Search.io to build site search and discovery solutions that maximize e-commerce revenue, optimize on-site customer experience, and scale their online presence. + * + * The version of the OpenAPI document: v4 + * Contact: support@search.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from "./models"; + +/** + * - PROMOTION_VIEW_UNSPECIFIED: The default / unset value. The API defaults to the `FULL` view. - BASIC: Include basic information including name, start time and end time, but not detailed information about the promotion effects. - FULL: Returns all information about a promotion. This is the default value. + */ +export enum ListPromotionsRequestPromotionView { + PromotionViewUnspecified = "PROMOTION_VIEW_UNSPECIFIED", + Basic = "BASIC", + Full = "FULL", +} diff --git a/src/generated/model/models.ts b/src/generated/model/models.ts index c8a43e2..05e192b 100644 --- a/src/generated/model/models.ts +++ b/src/generated/model/models.ts @@ -17,6 +17,10 @@ export * from "./batchUpsertRecordsResponseKey"; export * from "./batchUpsertRecordsResponseVariables"; export * from "./collection"; export * from "./deleteRecordRequest"; +export * from "./event"; +export * from "./experimentRequest"; +export * from "./experimentRequestPipeline"; +export * from "./experimentResponse"; export * from "./generatePipelinesRequest"; export * from "./generatePipelinesResponse"; export * from "./getDefaultPipelineResponse"; @@ -26,6 +30,7 @@ export * from "./getRecordRequest"; export * from "./listCollectionsResponse"; export * from "./listPipelinesRequestView"; export * from "./listPipelinesResponse"; +export * from "./listPromotionsRequestPromotionView"; export * from "./listPromotionsResponse"; export * from "./listRedirectsResponse"; export * from "./listSchemaFieldsResponse"; @@ -41,6 +46,7 @@ export * from "./promotionExclusion"; export * from "./promotionFilterBoost"; export * from "./promotionFilterCondition"; export * from "./promotionPin"; +export * from "./promotionPinMode"; export * from "./promotionRangeBoost"; export * from "./protobufAny"; export * from "./protobufFieldMask"; @@ -73,6 +79,7 @@ export * from "./sendEventRequest"; export * from "./setDefaultPipelineRequest"; export * from "./setDefaultVersionRequest"; export * from "./status"; +export * from "./textPosition"; export * from "./updateRecordRequest"; export * from "./upsertRecordRequest"; export * from "./upsertRecordRequestPipeline"; @@ -107,6 +114,10 @@ import { BatchUpsertRecordsResponseKey } from "./batchUpsertRecordsResponseKey"; import { BatchUpsertRecordsResponseVariables } from "./batchUpsertRecordsResponseVariables"; import { Collection } from "./collection"; import { DeleteRecordRequest } from "./deleteRecordRequest"; +import { Event } from "./event"; +import { ExperimentRequest } from "./experimentRequest"; +import { ExperimentRequestPipeline } from "./experimentRequestPipeline"; +import { ExperimentResponse } from "./experimentResponse"; import { GeneratePipelinesRequest } from "./generatePipelinesRequest"; import { GeneratePipelinesResponse } from "./generatePipelinesResponse"; import { GetDefaultPipelineResponse } from "./getDefaultPipelineResponse"; @@ -116,6 +127,7 @@ import { GetRecordRequest } from "./getRecordRequest"; import { ListCollectionsResponse } from "./listCollectionsResponse"; import { ListPipelinesRequestView } from "./listPipelinesRequestView"; import { ListPipelinesResponse } from "./listPipelinesResponse"; +import { ListPromotionsRequestPromotionView } from "./listPromotionsRequestPromotionView"; import { ListPromotionsResponse } from "./listPromotionsResponse"; import { ListRedirectsResponse } from "./listRedirectsResponse"; import { ListSchemaFieldsResponse } from "./listSchemaFieldsResponse"; @@ -131,6 +143,7 @@ import { PromotionExclusion } from "./promotionExclusion"; import { PromotionFilterBoost } from "./promotionFilterBoost"; import { PromotionFilterCondition } from "./promotionFilterCondition"; import { PromotionPin } from "./promotionPin"; +import { PromotionPinMode } from "./promotionPinMode"; import { PromotionRangeBoost } from "./promotionRangeBoost"; import { ProtobufAny } from "./protobufAny"; import { ProtobufFieldMask } from "./protobufFieldMask"; @@ -163,6 +176,7 @@ import { SendEventRequest } from "./sendEventRequest"; import { SetDefaultPipelineRequest } from "./setDefaultPipelineRequest"; import { SetDefaultVersionRequest } from "./setDefaultVersionRequest"; import { Status } from "./status"; +import { TextPosition } from "./textPosition"; import { UpdateRecordRequest } from "./updateRecordRequest"; import { UpsertRecordRequest } from "./upsertRecordRequest"; import { UpsertRecordRequestPipeline } from "./upsertRecordRequestPipeline"; @@ -184,11 +198,14 @@ let enumsMap: { [index: string]: any } = { GetDefaultVersionRequestView: GetDefaultVersionRequestView, GetPipelineRequestView: GetPipelineRequestView, ListPipelinesRequestView: ListPipelinesRequestView, + ListPromotionsRequestPromotionView: ListPromotionsRequestPromotionView, PipelineType: PipelineType, + PromotionPinMode: PromotionPinMode, ProtobufNullValue: ProtobufNullValue, QueryCollectionRequestTrackingType: QueryCollectionRequestTrackingType, SchemaFieldMode: SchemaFieldMode, SchemaFieldType: SchemaFieldType, + TextPosition: TextPosition, }; let typeMap: { [index: string]: any } = { @@ -209,6 +226,10 @@ let typeMap: { [index: string]: any } = { BatchUpsertRecordsResponseVariables: BatchUpsertRecordsResponseVariables, Collection: Collection, DeleteRecordRequest: DeleteRecordRequest, + Event: Event, + ExperimentRequest: ExperimentRequest, + ExperimentRequestPipeline: ExperimentRequestPipeline, + ExperimentResponse: ExperimentResponse, GeneratePipelinesRequest: GeneratePipelinesRequest, GeneratePipelinesResponse: GeneratePipelinesResponse, GetDefaultPipelineResponse: GetDefaultPipelineResponse, diff --git a/src/generated/model/promotionPin.ts b/src/generated/model/promotionPin.ts index e811db8..bbfcae4 100644 --- a/src/generated/model/promotionPin.ts +++ b/src/generated/model/promotionPin.ts @@ -11,10 +11,12 @@ */ import { RequestFile } from "./models"; +import { PromotionPinMode } from "./promotionPinMode"; import { RecordKey } from "./recordKey"; export class PromotionPin { "key"?: RecordKey; + "mode"?: PromotionPinMode; /** * Position the record should occupy in search results. The top position is position 1. Doesn\'t need to be contiguous with other pins, i.e. there can be gaps in the pinned set that are filled with organic results. In the case where there are insufficient search results pinned items are collapsed. */ @@ -32,6 +34,11 @@ export class PromotionPin { baseName: "key", type: "RecordKey", }, + { + name: "mode", + baseName: "mode", + type: "PromotionPinMode", + }, { name: "position", baseName: "position", diff --git a/src/generated/model/promotionPinMode.ts b/src/generated/model/promotionPinMode.ts new file mode 100644 index 0000000..607cdbe --- /dev/null +++ b/src/generated/model/promotionPinMode.ts @@ -0,0 +1,21 @@ +/** + * Search.io API + * Search.io offers a search and discovery service with Neuralsearch®, the world\'s first instant AI search technology. Businesses of all sizes use Search.io to build site search and discovery solutions that maximize e-commerce revenue, optimize on-site customer experience, and scale their online presence. + * + * The version of the OpenAPI document: v4 + * Contact: support@search.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from "./models"; + +/** + * - PIN: The pin applies regardless of whether the pinned item is in the underlying result set of the search. This has the net effect that a search result can be surfaced even if it was not originally a part of the search result set. - PROMOTE: The pin only applies if the pinned item is in the underlying result set of the search. + */ +export enum PromotionPinMode { + Pin = "PIN", + Promote = "PROMOTE", +} diff --git a/src/generated/model/queryCollectionRequestTrackingType.ts b/src/generated/model/queryCollectionRequestTrackingType.ts index de02de2..e910767 100644 --- a/src/generated/model/queryCollectionRequestTrackingType.ts +++ b/src/generated/model/queryCollectionRequestTrackingType.ts @@ -13,11 +13,12 @@ import { RequestFile } from "./models"; /** - * - TYPE_UNSPECIFIED: The default / unset value. The API defaults to `NONE` tracking. - NONE: No tracking. - CLICK: Click tracking. A click token is be generated for each result. Results which do not receive clicks fall down the rankings, and similarly low-ranked records which receive clicks are moved up the rankings. - POS_NEG: Pos/neg tracking. Pos/neg tokens are generated for each result. Each record in the result set can be marked with pos/neg value for the search. This is then fed back into the ranking algorithm to improve future results. Unlike `CLICK`, if no tokens are reported for records then no action is taken. + * - TYPE_UNSPECIFIED: The default / unset value. The API defaults to `NONE` tracking. - NONE: No tracking. - CLICK: Click tracking. A click token is be generated for each result. Results which do not receive clicks fall down the rankings, and similarly low-ranked records which receive clicks are moved up the rankings. - POS_NEG: Pos/neg tracking. Pos/neg tokens are generated for each result. Each record in the result set can be marked with pos/neg value for the search. This is then fed back into the ranking algorithm to improve future results. Unlike `CLICK`, if no tokens are reported for records then no action is taken. - EVENT: Event tracking. A query identifier is returned in the [QueryResponse][sajari.v4.QueryResponse] that can be used to link a user interaction to a specific query. */ export enum QueryCollectionRequestTrackingType { TypeUnspecified = "TYPE_UNSPECIFIED", None = "NONE", Click = "CLICK", PosNeg = "POS_NEG", + Event = "EVENT", } diff --git a/src/generated/model/queryCollectionResponse.ts b/src/generated/model/queryCollectionResponse.ts index e25f6fc..bf7b846 100644 --- a/src/generated/model/queryCollectionResponse.ts +++ b/src/generated/model/queryCollectionResponse.ts @@ -12,6 +12,7 @@ import { RequestFile } from "./models"; import { ActivePromotion } from "./activePromotion"; +import { Banner } from "./banner"; import { QueryAggregateResult } from "./queryAggregateResult"; import { QueryCollectionResponsePipeline } from "./queryCollectionResponsePipeline"; import { QueryResult } from "./queryResult"; @@ -30,6 +31,10 @@ export class QueryCollectionResponse { * The aggregates returned by the query. */ "aggregates"?: { [key: string]: QueryAggregateResult }; + /** + * Banners associated with this query. + */ + "banners"?: Array; /** * The weight applied to the features in the query, used for analyzing the index, neural and feature components for results. For each result: ``` score = max(index_score, neural_score) * (1 - feature_score_weight) + feature_score * feature_score_weight ``` */ @@ -39,6 +44,10 @@ export class QueryCollectionResponse { * The total time taken to perform the query. */ "processingDuration"?: string; + /** + * The query identifier. This uniqely identifies the specific query it was returned on. This is used to link user interactions with a query. + */ + "queryId"?: string; /** * A mapping of redirects triggered for all possible variations of the query. */ @@ -78,6 +87,11 @@ export class QueryCollectionResponse { baseName: "aggregates", type: "{ [key: string]: QueryAggregateResult; }", }, + { + name: "banners", + baseName: "banners", + type: "Array", + }, { name: "featureScoreWeight", baseName: "feature_score_weight", @@ -93,6 +107,11 @@ export class QueryCollectionResponse { baseName: "processing_duration", type: "string", }, + { + name: "queryId", + baseName: "query_id", + type: "string", + }, { name: "redirects", baseName: "redirects", diff --git a/src/generated/model/queryResult.ts b/src/generated/model/queryResult.ts index 29134ee..8394965 100644 --- a/src/generated/model/queryResult.ts +++ b/src/generated/model/queryResult.ts @@ -11,9 +11,11 @@ */ import { RequestFile } from "./models"; +import { Banner } from "./banner"; import { QueryResultToken } from "./queryResultToken"; export class QueryResult { + "banner"?: Banner; /** * The feature score of the result. This is a value between 0 and 1 representing the business-specific ranking of the result as determined by the ranking adjustments. See [Ranking adjustments](https://docs.search.io/documentation/fundamentals/search-settings/ranking-adjustments) for more information. */ @@ -30,6 +32,10 @@ export class QueryResult { * An object made up of field-value pairs that contains the record data. */ "record"?: object; + /** + * The relevance score of the result. This is the best of `index_score` and `neural_score` with any index boosts applied on top. + */ + "relevanceScore"?: number; /** * The overall relevance of the result. This is a value between 0 and 1 that combines the index, neural and feature scores. The higher the score the more relevant the result is. */ @@ -43,6 +49,11 @@ export class QueryResult { baseName: string; type: string; }> = [ + { + name: "banner", + baseName: "banner", + type: "Banner", + }, { name: "featureScore", baseName: "feature_score", @@ -63,6 +74,11 @@ export class QueryResult { baseName: "record", type: "object", }, + { + name: "relevanceScore", + baseName: "relevance_score", + type: "number", + }, { name: "score", baseName: "score", diff --git a/src/generated/model/textPosition.ts b/src/generated/model/textPosition.ts new file mode 100644 index 0000000..263af4d --- /dev/null +++ b/src/generated/model/textPosition.ts @@ -0,0 +1,25 @@ +/** + * Search.io API + * Search.io offers a search and discovery service with Neuralsearch®, the world\'s first instant AI search technology. Businesses of all sizes use Search.io to build site search and discovery solutions that maximize e-commerce revenue, optimize on-site customer experience, and scale their online presence. + * + * The version of the OpenAPI document: v4 + * Contact: support@search.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { RequestFile } from "./models"; + +/** + * TextPosition describes the position of text in a box. - TEXT_POSITION_UNSPECIFIED: No position specified. - TEXT_POSITION_CENTER: The text is positioned in the horizontal and vertical center. - TEXT_POSITION_TOP_LEFT: The text is positioned in the top left corner. - TEXT_POSITION_TOP_RIGHT: The text is positioned in the top right corner. - TEXT_POSITION_BOTTOM_LEFT: The text is positioned in the bottom left corner. - TEXT_POSITION_BOTTOM_RIGHT: The text is positioned in the bottom right corner. + */ +export enum TextPosition { + Unspecified = "TEXT_POSITION_UNSPECIFIED", + Center = "TEXT_POSITION_CENTER", + TopLeft = "TEXT_POSITION_TOP_LEFT", + TopRight = "TEXT_POSITION_TOP_RIGHT", + BottomLeft = "TEXT_POSITION_BOTTOM_LEFT", + BottomRight = "TEXT_POSITION_BOTTOM_RIGHT", +} diff --git a/src/version.ts b/src/version.ts index b1ca33d..d0a16af 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1,3 +1,3 @@ // Code generated by generate-version.ts. DO NOT EDIT. -export const version = "4.4.1"; +export const version = "4.5.1";