diff --git a/src/resources/MachineLearning/Document.ts b/src/resources/MachineLearning/Document.ts new file mode 100644 index 000000000..088cb683c --- /dev/null +++ b/src/resources/MachineLearning/Document.ts @@ -0,0 +1 @@ +export type DocumentRequirementStatus = 'OK' | 'INSUFFICIENT_DOCUMENTS' | 'NB_OF_DOCUMENTS_OVER_LIMIT'; diff --git a/src/resources/MachineLearning/SESConfiguration/SESConfiguration.ts b/src/resources/MachineLearning/SESConfiguration/SESConfiguration.ts new file mode 100644 index 000000000..83efa56a1 --- /dev/null +++ b/src/resources/MachineLearning/SESConfiguration/SESConfiguration.ts @@ -0,0 +1,12 @@ +import API from '../../../APICore.js'; +import Resource from '../../Resource.js'; +import {SESDocumentGroupPreviewParams, SESDocumentGroupPreview} from './SESConfigurationInterfaces.js'; + +export default class SESConfiguration extends Resource { + static baseUrl = `/rest/organizations/${API.orgPlaceholder}/machinelearning/configuration/ses`; + static previewUrl = `${SESConfiguration.baseUrl}/preview`; + + preview(params: SESDocumentGroupPreviewParams) { + return this.api.post(SESConfiguration.previewUrl, params); + } +} diff --git a/src/resources/MachineLearning/SESConfiguration/SESConfigurationInterfaces.ts b/src/resources/MachineLearning/SESConfiguration/SESConfigurationInterfaces.ts new file mode 100644 index 000000000..27c9d1975 --- /dev/null +++ b/src/resources/MachineLearning/SESConfiguration/SESConfigurationInterfaces.ts @@ -0,0 +1,50 @@ +import {DocumentRequirementStatus} from '../Document.js'; +import {FilterConditions} from '../FilterConditions.js'; + +export interface SESDocumentGroupPreviewParams { + /** + * The sources to consider. + */ + sources: string[]; + /** + * An array of filtering conditions. + */ + filterConditions: FilterConditions[]; + /** + * The query that determines the documents to extract + */ + advancedQuery: string; +} + +export interface SESDocumentGroupPreview { + /** + * The query that was used to fetch document information. + * + * @Example @source==("Salesforce Notifier") + */ + query: string; + /** + * The total number of documents in the selected sources. + */ + numberOfDocumentsInSources: number; + /** + * The number of documents that are candidates for learning. + */ + numberOfValidDocuments: number; + /** + * The number of documents in the selected sources that match the conditions. + */ + numberOfDocumentsInSourcesMatchingFilters: number; + /** + * The number of documents in the selected sources that match the conditions and have a permanentid + */ + numberOfDocumentsInSourcesMatchingFiltersWithPermanentId: number; + /** + * The limit of documents that are candidates for learning. + */ + documentLimit: number; + /** + * Status for the number of required documents to build the model. + */ + documentRequirementStatus: DocumentRequirementStatus; +} diff --git a/src/resources/MachineLearning/SESConfiguration/index.ts b/src/resources/MachineLearning/SESConfiguration/index.ts new file mode 100644 index 000000000..bea44d114 --- /dev/null +++ b/src/resources/MachineLearning/SESConfiguration/index.ts @@ -0,0 +1,2 @@ +export * from './SESConfiguration.js'; +export * from './SESConfigurationInterfaces.js'; diff --git a/src/resources/MachineLearning/SmartSnippetsConfiguration/SmartSnippetsConfigurationInterfaces.ts b/src/resources/MachineLearning/SmartSnippetsConfiguration/SmartSnippetsConfigurationInterfaces.ts index 496491f8f..28ba5dece 100644 --- a/src/resources/MachineLearning/SmartSnippetsConfiguration/SmartSnippetsConfigurationInterfaces.ts +++ b/src/resources/MachineLearning/SmartSnippetsConfiguration/SmartSnippetsConfigurationInterfaces.ts @@ -1,3 +1,4 @@ +import {DocumentRequirementStatus} from '../Document.js'; import {FilterConditions} from '../FilterConditions.js'; export interface DocumentType { @@ -39,8 +40,6 @@ export interface SmartSnippetsConfigurationModel { documentTypes?: DocumentType[]; } -export type SmartSnippetsDocumentRequirementStatus = 'OK' | 'INSUFFICIENT_DOCUMENTS' | 'NB_OF_DOCUMENTS_OVER_LIMIT'; - export interface SmartSnippetsDocumentGroupPreviewParams { /** * The sources to consider. @@ -94,7 +93,7 @@ export interface SmartSnippetsDocumentGroupPreview { /** * Status for the number of required documents to build the model. */ - documentRequirementStatus: SmartSnippetsDocumentRequirementStatus; + documentRequirementStatus: DocumentRequirementStatus; } export interface SmartSnippetsContentFieldsParams { diff --git a/src/resources/MachineLearning/index.ts b/src/resources/MachineLearning/index.ts index 3ecc061a4..317458f33 100644 --- a/src/resources/MachineLearning/index.ts +++ b/src/resources/MachineLearning/index.ts @@ -8,5 +8,6 @@ export * from './DNEConfiguration/index.js'; export * from './CaseClassificationConfiguration/index.js'; export * from './SmartSnippetsConfiguration/index.js'; export * from './PQSConfiguration/index.js'; +export * from './SESConfiguration/index.js'; export * from './IAPRConfiguration/index.js'; export * from './UserActionHistoryConfiguration/index.js';