@elastic/enterprise-search
Version:
Official Node.js client for Elastic Enterprise Search, App Search, and Workplace Search.
1,518 lines • 66 kB
TypeScript
export interface CreateContentSourceRequest {
/**
* Definition to create a Workplace Search Content Source
*/
body: {
/**
* The human readable display name for this Content Source.
*/
name: string;
/**
* The schema that each document in this Content Source will adhere to.
*/
schema?: {
[k: string]: 'text' | 'geolocation' | 'number' | 'date';
};
/**
* The display details which governs which fields will be displayed, and in what order, in the search results.
*/
display?: {
title_field: string;
url_field: string;
color?: string;
description_field?: string | null;
subtitle_field?: string | null;
type_field?: string | null;
media_type_field?: string | null;
created_by_field?: string | null;
updated_by_field?: string | null;
detail_fields?: Array<{
label: string;
field_name: string;
}>;
};
/**
* Whether or not this Content Source will be searchable on the search page.
*/
is_searchable?: boolean;
/**
* Rules for indexing the content for this Content Source
*/
indexing?: {
enabled?: boolean;
features?: {
thumbnails: {
enabled: boolean;
};
content_extraction: {
enabled: boolean;
};
};
default_action: 'include' | 'exclude';
rules?: Array<{
exclude?: string;
include?: string;
filter_type?: 'object_type' | 'path_template' | 'file_extension';
fields?: Array<{
remote: string;
target: string;
}> | null;
}>;
/**
* Schedule defining when and how often the content source should be synchronized
*/
schedule?: {
/**
* How often a full data synchronization should be performed, as an ISO-8601 duration
*/
full?: string;
/**
* How often to synchronize new changes, as an ISO-8601 duration
*/
incremental?: string;
/**
* How often to purge deleted documents, as an ISO-8601 duration
*/
delete?: string;
/**
* How often to update user permissions, as an ISO-8601 duration
*/
permissions?: string;
blocked_windows?: Array<{
job_type: 'full' | 'incremental' | 'delete' | 'permissions' | 'all';
day: 'all' | 'sunday' | 'monday' | 'tuesday' | 'wednesday' | 'thursday' | 'friday' | 'saturday';
/**
* The start of the time window, in the format of HH:mm:ssZ
*/
start?: string;
/**
* The end of the time window, in the format of HH:mm:ssZ
*/
end?: string;
}>;
} | null;
} | null;
/**
* Facet customizations
*/
facets?: {
overrides: Array<{
field: string;
enabled: boolean;
display_name?: string | null;
transform?: 'capitalize' | 'titleize' | 'mime_type' | null;
}>;
} | null;
/**
* Automatic query refinement customizations
*/
automatic_query_refinement?: {
overrides: Array<{
field: string;
enabled: boolean;
query_expansion_phrases: string[];
is_person?: boolean;
}>;
} | null;
};
}
/**
* Workplace Search Content Source
*/
export interface CreateContentSourceResponse {
/**
* The Content Source Identifier.
*/
id: string;
/**
* The Content Source's Service Type. For example, for Google Drive the Service Type is "google_drive".
*/
service_type: string;
/**
* The date/time at which this Content Source was originally created.
*/
created_at: string;
/**
* The date/time at which this Content Source was last updated.
*/
last_updated_at: string;
/**
* Whether or not this Content Source is a "remote" content source. See https://www.elastic.co/guide/en/workplace-search/current/workplace-search-content-sources.html#remote
*/
is_remote: boolean;
/**
* A list of key/value metadata for the Content Source and the account which authenticated/connected it.
*/
details: Array<{
[k: string]: unknown;
}>;
/**
* A list of Workplace Search Group names and IDs which have access to this Content Source.
*/
groups: Array<{
id: string;
name: string;
}>;
/**
* The human readable display name of this Content Source.
*/
name: string;
/**
* The schema that each document in this Content Source must adhere to.
*/
schema?: {
[k: string]: 'text' | 'geolocation' | 'number' | 'date';
};
/**
* The display details which governs which fields are displayed, and in what order, in the search results.
*/
display?: {
title_field: string;
url_field: string;
color?: string;
description_field?: string | null;
subtitle_field?: string | null;
type_field?: string | null;
media_type_field?: string | null;
created_by_field?: string | null;
updated_by_field?: string | null;
detail_fields?: Array<{
label: string;
field_name: string;
}>;
};
/**
* Can be either "organization" or "private." This specifies whether this Content Source is available to groups of users, or a single user.
*/
context: 'organization' | 'private';
/**
* Whether or not this Content Source can currently be searched over on the search page.
*/
is_searchable: boolean;
/**
* Rules for indexing the content for this Content Source
*/
indexing?: {
enabled?: boolean;
features?: {
thumbnails: {
enabled: boolean;
};
content_extraction: {
enabled: boolean;
};
};
default_action: 'include' | 'exclude';
rules?: Array<{
exclude?: string;
include?: string;
filter_type?: 'object_type' | 'path_template' | 'file_extension';
fields?: Array<{
remote: string;
target: string;
}> | null;
}>;
/**
* Schedule defining when and how often the content source should be synchronized
*/
schedule?: {
/**
* How often a full data synchronization should be performed, as an ISO-8601 duration
*/
full?: string;
/**
* How often to synchronize new changes, as an ISO-8601 duration
*/
incremental?: string;
/**
* How often to purge deleted documents, as an ISO-8601 duration
*/
delete?: string;
/**
* How often to update user permissions, as an ISO-8601 duration
*/
permissions?: string;
blocked_windows?: Array<{
job_type: 'full' | 'incremental' | 'delete' | 'permissions' | 'all';
day: 'all' | 'sunday' | 'monday' | 'tuesday' | 'wednesday' | 'thursday' | 'friday' | 'saturday';
/**
* The start of the time window, in the format of HH:mm:ssZ
*/
start?: string;
/**
* The end of the time window, in the format of HH:mm:ssZ
*/
end?: string;
}>;
/**
* Estimates of when the next sync of each type will be run and average execution time
*/
estimates?: {
full?: {
/**
* The last run time
*/
last_run?: string;
/**
* The average execution time of the last 5 completed jobs, in ISO-8601 format
*/
duration?: string;
/**
* The estimated next execution time
*/
next_start?: string;
};
incremental?: {
/**
* The last run time
*/
last_run?: string;
/**
* The average execution time of the last 5 completed jobs, in ISO-8601 format
*/
duration?: string;
/**
* The estimated next execution time
*/
next_start?: string;
};
delete?: {
/**
* The last run time
*/
last_run?: string;
/**
* The average execution time of the last 5 completed jobs, in ISO-8601 format
*/
duration?: string;
/**
* The estimated next execution time
*/
next_start?: string;
};
permissions?: {
/**
* The last run time
*/
last_run?: string;
/**
* The average execution time of the last 5 completed jobs, in ISO-8601 format
*/
duration?: string;
/**
* The estimated next execution time
*/
next_start?: string;
};
};
} | null;
} | null;
/**
* Facet customizations
*/
facets?: {
overrides: Array<{
field: string;
enabled: boolean;
display_name?: string | null;
transform?: 'capitalize' | 'titleize' | 'mime_type' | null;
}>;
} | null;
/**
* Automatic query refinement customizations
*/
automatic_query_refinement?: {
overrides: Array<{
field: string;
enabled: boolean;
query_expansion_phrases: string[];
is_person?: boolean;
}>;
} | null;
/**
* How many documents are currently indexed in this Content Source. Note, this field is not applicable to Remote Content Sources.
*/
document_count?: number;
/**
* The date/time when documents were last indexed into this Content Source. This may be "null" if documents have not yet been indexed. Note, this field is not applicable to Remote Content Sources.
*/
last_indexed_at?: string | null;
}
export interface ListContentSourcesRequest {
page?: {
/**
* Which page of results to request
*/
current?: number;
/**
* The number of results to return in a page
*/
size?: number;
};
}
export interface ListContentSourcesResponse {
meta: {
page: {
current: number;
total_pages: number;
total_results: number;
size: number;
};
};
results: Array<{
/**
* The Content Source Identifier.
*/
id: string;
/**
* The Content Source's Service Type. For example, for Google Drive the Service Type is "google_drive".
*/
service_type: string;
/**
* The date/time at which this Content Source was originally created.
*/
created_at: string;
/**
* The date/time at which this Content Source was last updated.
*/
last_updated_at: string;
/**
* Whether or not this Content Source is a "remote" content source. See https://www.elastic.co/guide/en/workplace-search/current/workplace-search-content-sources.html#remote
*/
is_remote: boolean;
/**
* A list of key/value metadata for the Content Source and the account which authenticated/connected it.
*/
details: Array<{
[k: string]: unknown;
}>;
/**
* A list of Workplace Search Group names and IDs which have access to this Content Source.
*/
groups: Array<{
id: string;
name: string;
}>;
/**
* The human readable display name of this Content Source.
*/
name: string;
/**
* The schema that each document in this Content Source must adhere to.
*/
schema?: {
[k: string]: 'text' | 'geolocation' | 'number' | 'date';
};
/**
* The display details which governs which fields are displayed, and in what order, in the search results.
*/
display?: {
title_field: string;
url_field: string;
color?: string;
description_field?: string | null;
subtitle_field?: string | null;
type_field?: string | null;
media_type_field?: string | null;
created_by_field?: string | null;
updated_by_field?: string | null;
detail_fields?: Array<{
label: string;
field_name: string;
}>;
};
/**
* Can be either "organization" or "private." This specifies whether this Content Source is available to groups of users, or a single user.
*/
context: 'organization' | 'private';
/**
* Whether or not this Content Source can currently be searched over on the search page.
*/
is_searchable: boolean;
/**
* Rules for indexing the content for this Content Source
*/
indexing?: {
enabled?: boolean;
features?: {
thumbnails: {
enabled: boolean;
};
content_extraction: {
enabled: boolean;
};
};
default_action: 'include' | 'exclude';
rules?: Array<{
exclude?: string;
include?: string;
filter_type?: 'object_type' | 'path_template' | 'file_extension';
fields?: Array<{
remote: string;
target: string;
}> | null;
}>;
/**
* Schedule defining when and how often the content source should be synchronized
*/
schedule?: {
/**
* How often a full data synchronization should be performed, as an ISO-8601 duration
*/
full?: string;
/**
* How often to synchronize new changes, as an ISO-8601 duration
*/
incremental?: string;
/**
* How often to purge deleted documents, as an ISO-8601 duration
*/
delete?: string;
/**
* How often to update user permissions, as an ISO-8601 duration
*/
permissions?: string;
blocked_windows?: Array<{
job_type: 'full' | 'incremental' | 'delete' | 'permissions' | 'all';
day: 'all' | 'sunday' | 'monday' | 'tuesday' | 'wednesday' | 'thursday' | 'friday' | 'saturday';
/**
* The start of the time window, in the format of HH:mm:ssZ
*/
start?: string;
/**
* The end of the time window, in the format of HH:mm:ssZ
*/
end?: string;
}>;
/**
* Estimates of when the next sync of each type will be run and average execution time
*/
estimates?: {
full?: {
/**
* The last run time
*/
last_run?: string;
/**
* The average execution time of the last 5 completed jobs, in ISO-8601 format
*/
duration?: string;
/**
* The estimated next execution time
*/
next_start?: string;
};
incremental?: {
/**
* The last run time
*/
last_run?: string;
/**
* The average execution time of the last 5 completed jobs, in ISO-8601 format
*/
duration?: string;
/**
* The estimated next execution time
*/
next_start?: string;
};
delete?: {
/**
* The last run time
*/
last_run?: string;
/**
* The average execution time of the last 5 completed jobs, in ISO-8601 format
*/
duration?: string;
/**
* The estimated next execution time
*/
next_start?: string;
};
permissions?: {
/**
* The last run time
*/
last_run?: string;
/**
* The average execution time of the last 5 completed jobs, in ISO-8601 format
*/
duration?: string;
/**
* The estimated next execution time
*/
next_start?: string;
};
};
} | null;
} | null;
/**
* Facet customizations
*/
facets?: {
overrides: Array<{
field: string;
enabled: boolean;
display_name?: string | null;
transform?: 'capitalize' | 'titleize' | 'mime_type' | null;
}>;
} | null;
/**
* Automatic query refinement customizations
*/
automatic_query_refinement?: {
overrides: Array<{
field: string;
enabled: boolean;
query_expansion_phrases: string[];
is_person?: boolean;
}>;
} | null;
/**
* How many documents are currently indexed in this Content Source. Note, this field is not applicable to Remote Content Sources.
*/
document_count?: number;
/**
* The date/time when documents were last indexed into this Content Source. This may be "null" if documents have not yet been indexed. Note, this field is not applicable to Remote Content Sources.
*/
last_indexed_at?: string | null;
}>;
}
export interface GetContentSourceRequest {
/**
* Unique ID for a Custom API source, provided upon creation of a Custom API Source
*/
content_source_id: string;
}
/**
* Workplace Search Content Source
*/
export interface GetContentSourceResponse {
/**
* The Content Source Identifier.
*/
id: string;
/**
* The Content Source's Service Type. For example, for Google Drive the Service Type is "google_drive".
*/
service_type: string;
/**
* The date/time at which this Content Source was originally created.
*/
created_at: string;
/**
* The date/time at which this Content Source was last updated.
*/
last_updated_at: string;
/**
* Whether or not this Content Source is a "remote" content source. See https://www.elastic.co/guide/en/workplace-search/current/workplace-search-content-sources.html#remote
*/
is_remote: boolean;
/**
* A list of key/value metadata for the Content Source and the account which authenticated/connected it.
*/
details: Array<{
[k: string]: unknown;
}>;
/**
* A list of Workplace Search Group names and IDs which have access to this Content Source.
*/
groups: Array<{
id: string;
name: string;
}>;
/**
* The human readable display name of this Content Source.
*/
name: string;
/**
* The schema that each document in this Content Source must adhere to.
*/
schema?: {
[k: string]: 'text' | 'geolocation' | 'number' | 'date';
};
/**
* The display details which governs which fields are displayed, and in what order, in the search results.
*/
display?: {
title_field: string;
url_field: string;
color?: string;
description_field?: string | null;
subtitle_field?: string | null;
type_field?: string | null;
media_type_field?: string | null;
created_by_field?: string | null;
updated_by_field?: string | null;
detail_fields?: Array<{
label: string;
field_name: string;
}>;
};
/**
* Can be either "organization" or "private." This specifies whether this Content Source is available to groups of users, or a single user.
*/
context: 'organization' | 'private';
/**
* Whether or not this Content Source can currently be searched over on the search page.
*/
is_searchable: boolean;
/**
* Rules for indexing the content for this Content Source
*/
indexing?: {
enabled?: boolean;
features?: {
thumbnails: {
enabled: boolean;
};
content_extraction: {
enabled: boolean;
};
};
default_action: 'include' | 'exclude';
rules?: Array<{
exclude?: string;
include?: string;
filter_type?: 'object_type' | 'path_template' | 'file_extension';
fields?: Array<{
remote: string;
target: string;
}> | null;
}>;
/**
* Schedule defining when and how often the content source should be synchronized
*/
schedule?: {
/**
* How often a full data synchronization should be performed, as an ISO-8601 duration
*/
full?: string;
/**
* How often to synchronize new changes, as an ISO-8601 duration
*/
incremental?: string;
/**
* How often to purge deleted documents, as an ISO-8601 duration
*/
delete?: string;
/**
* How often to update user permissions, as an ISO-8601 duration
*/
permissions?: string;
blocked_windows?: Array<{
job_type: 'full' | 'incremental' | 'delete' | 'permissions' | 'all';
day: 'all' | 'sunday' | 'monday' | 'tuesday' | 'wednesday' | 'thursday' | 'friday' | 'saturday';
/**
* The start of the time window, in the format of HH:mm:ssZ
*/
start?: string;
/**
* The end of the time window, in the format of HH:mm:ssZ
*/
end?: string;
}>;
/**
* Estimates of when the next sync of each type will be run and average execution time
*/
estimates?: {
full?: {
/**
* The last run time
*/
last_run?: string;
/**
* The average execution time of the last 5 completed jobs, in ISO-8601 format
*/
duration?: string;
/**
* The estimated next execution time
*/
next_start?: string;
};
incremental?: {
/**
* The last run time
*/
last_run?: string;
/**
* The average execution time of the last 5 completed jobs, in ISO-8601 format
*/
duration?: string;
/**
* The estimated next execution time
*/
next_start?: string;
};
delete?: {
/**
* The last run time
*/
last_run?: string;
/**
* The average execution time of the last 5 completed jobs, in ISO-8601 format
*/
duration?: string;
/**
* The estimated next execution time
*/
next_start?: string;
};
permissions?: {
/**
* The last run time
*/
last_run?: string;
/**
* The average execution time of the last 5 completed jobs, in ISO-8601 format
*/
duration?: string;
/**
* The estimated next execution time
*/
next_start?: string;
};
};
} | null;
} | null;
/**
* Facet customizations
*/
facets?: {
overrides: Array<{
field: string;
enabled: boolean;
display_name?: string | null;
transform?: 'capitalize' | 'titleize' | 'mime_type' | null;
}>;
} | null;
/**
* Automatic query refinement customizations
*/
automatic_query_refinement?: {
overrides: Array<{
field: string;
enabled: boolean;
query_expansion_phrases: string[];
is_person?: boolean;
}>;
} | null;
/**
* How many documents are currently indexed in this Content Source. Note, this field is not applicable to Remote Content Sources.
*/
document_count?: number;
/**
* The date/time when documents were last indexed into this Content Source. This may be "null" if documents have not yet been indexed. Note, this field is not applicable to Remote Content Sources.
*/
last_indexed_at?: string | null;
}
export interface PutContentSourceRequest {
/**
* Unique ID for a Custom API source, provided upon creation of a Custom API Source
*/
content_source_id: string;
/**
* Definition to update a Workplace Search Content Source
*/
body: {
/**
* The human readable display name for this Content Source.
*/
name: string;
/**
* The schema that each document in this Content Source will adhere to.
*/
schema?: {
[k: string]: 'text' | 'geolocation' | 'number' | 'date';
};
/**
* The display details which governs which fields will be displayed, and in what order, in the search results.
*/
display?: {
title_field: string;
url_field: string;
color?: string;
description_field?: string | null;
subtitle_field?: string | null;
type_field?: string | null;
media_type_field?: string | null;
created_by_field?: string | null;
updated_by_field?: string | null;
detail_fields?: Array<{
label: string;
field_name: string;
}>;
};
/**
* Whether or not this Content Source will be searchable on the search page.
*/
is_searchable: boolean;
/**
* Rules for indexing the content for this Content Source
*/
indexing?: {
enabled?: boolean;
features?: {
thumbnails: {
enabled: boolean;
};
content_extraction: {
enabled: boolean;
};
};
default_action: 'include' | 'exclude';
rules?: Array<{
exclude?: string;
include?: string;
filter_type?: 'object_type' | 'path_template' | 'file_extension';
fields?: Array<{
remote: string;
target: string;
}> | null;
}>;
/**
* Schedule defining when and how often the content source should be synchronized
*/
schedule?: {
/**
* How often a full data synchronization should be performed, as an ISO-8601 duration
*/
full?: string;
/**
* How often to synchronize new changes, as an ISO-8601 duration
*/
incremental?: string;
/**
* How often to purge deleted documents, as an ISO-8601 duration
*/
delete?: string;
/**
* How often to update user permissions, as an ISO-8601 duration
*/
permissions?: string;
blocked_windows?: Array<{
job_type: 'full' | 'incremental' | 'delete' | 'permissions' | 'all';
day: 'all' | 'sunday' | 'monday' | 'tuesday' | 'wednesday' | 'thursday' | 'friday' | 'saturday';
/**
* The start of the time window, in the format of HH:mm:ssZ
*/
start?: string;
/**
* The end of the time window, in the format of HH:mm:ssZ
*/
end?: string;
}>;
} | null;
} | null;
/**
* Facet customizations
*/
facets?: {
overrides: Array<{
field: string;
enabled: boolean;
display_name?: string | null;
transform?: 'capitalize' | 'titleize' | 'mime_type' | null;
}>;
} | null;
/**
* Automatic query refinement customizations
*/
automatic_query_refinement?: {
overrides: Array<{
field: string;
enabled: boolean;
query_expansion_phrases: string[];
is_person?: boolean;
}>;
} | null;
};
}
/**
* Workplace Search Content Source
*/
export interface PutContentSourceResponse {
/**
* The Content Source Identifier.
*/
id: string;
/**
* The Content Source's Service Type. For example, for Google Drive the Service Type is "google_drive".
*/
service_type: string;
/**
* The date/time at which this Content Source was originally created.
*/
created_at: string;
/**
* The date/time at which this Content Source was last updated.
*/
last_updated_at: string;
/**
* Whether or not this Content Source is a "remote" content source. See https://www.elastic.co/guide/en/workplace-search/current/workplace-search-content-sources.html#remote
*/
is_remote: boolean;
/**
* A list of key/value metadata for the Content Source and the account which authenticated/connected it.
*/
details: Array<{
[k: string]: unknown;
}>;
/**
* A list of Workplace Search Group names and IDs which have access to this Content Source.
*/
groups: Array<{
id: string;
name: string;
}>;
/**
* The human readable display name of this Content Source.
*/
name: string;
/**
* The schema that each document in this Content Source must adhere to.
*/
schema?: {
[k: string]: 'text' | 'geolocation' | 'number' | 'date';
};
/**
* The display details which governs which fields are displayed, and in what order, in the search results.
*/
display?: {
title_field: string;
url_field: string;
color?: string;
description_field?: string | null;
subtitle_field?: string | null;
type_field?: string | null;
media_type_field?: string | null;
created_by_field?: string | null;
updated_by_field?: string | null;
detail_fields?: Array<{
label: string;
field_name: string;
}>;
};
/**
* Can be either "organization" or "private." This specifies whether this Content Source is available to groups of users, or a single user.
*/
context: 'organization' | 'private';
/**
* Whether or not this Content Source can currently be searched over on the search page.
*/
is_searchable: boolean;
/**
* Rules for indexing the content for this Content Source
*/
indexing?: {
enabled?: boolean;
features?: {
thumbnails: {
enabled: boolean;
};
content_extraction: {
enabled: boolean;
};
};
default_action: 'include' | 'exclude';
rules?: Array<{
exclude?: string;
include?: string;
filter_type?: 'object_type' | 'path_template' | 'file_extension';
fields?: Array<{
remote: string;
target: string;
}> | null;
}>;
/**
* Schedule defining when and how often the content source should be synchronized
*/
schedule?: {
/**
* How often a full data synchronization should be performed, as an ISO-8601 duration
*/
full?: string;
/**
* How often to synchronize new changes, as an ISO-8601 duration
*/
incremental?: string;
/**
* How often to purge deleted documents, as an ISO-8601 duration
*/
delete?: string;
/**
* How often to update user permissions, as an ISO-8601 duration
*/
permissions?: string;
blocked_windows?: Array<{
job_type: 'full' | 'incremental' | 'delete' | 'permissions' | 'all';
day: 'all' | 'sunday' | 'monday' | 'tuesday' | 'wednesday' | 'thursday' | 'friday' | 'saturday';
/**
* The start of the time window, in the format of HH:mm:ssZ
*/
start?: string;
/**
* The end of the time window, in the format of HH:mm:ssZ
*/
end?: string;
}>;
/**
* Estimates of when the next sync of each type will be run and average execution time
*/
estimates?: {
full?: {
/**
* The last run time
*/
last_run?: string;
/**
* The average execution time of the last 5 completed jobs, in ISO-8601 format
*/
duration?: string;
/**
* The estimated next execution time
*/
next_start?: string;
};
incremental?: {
/**
* The last run time
*/
last_run?: string;
/**
* The average execution time of the last 5 completed jobs, in ISO-8601 format
*/
duration?: string;
/**
* The estimated next execution time
*/
next_start?: string;
};
delete?: {
/**
* The last run time
*/
last_run?: string;
/**
* The average execution time of the last 5 completed jobs, in ISO-8601 format
*/
duration?: string;
/**
* The estimated next execution time
*/
next_start?: string;
};
permissions?: {
/**
* The last run time
*/
last_run?: string;
/**
* The average execution time of the last 5 completed jobs, in ISO-8601 format
*/
duration?: string;
/**
* The estimated next execution time
*/
next_start?: string;
};
};
} | null;
} | null;
/**
* Facet customizations
*/
facets?: {
overrides: Array<{
field: string;
enabled: boolean;
display_name?: string | null;
transform?: 'capitalize' | 'titleize' | 'mime_type' | null;
}>;
} | null;
/**
* Automatic query refinement customizations
*/
automatic_query_refinement?: {
overrides: Array<{
field: string;
enabled: boolean;
query_expansion_phrases: string[];
is_person?: boolean;
}>;
} | null;
/**
* How many documents are currently indexed in this Content Source. Note, this field is not applicable to Remote Content Sources.
*/
document_count?: number;
/**
* The date/time when documents were last indexed into this Content Source. This may be "null" if documents have not yet been indexed. Note, this field is not applicable to Remote Content Sources.
*/
last_indexed_at?: string | null;
}
export interface DeleteContentSourceRequest {
/**
* Unique ID for a Custom API source, provided upon creation of a Custom API Source
*/
content_source_id: string;
}
export interface DeleteContentSourceResponse {
deleted: true;
}
export interface PutContentSourceIconsRequest {
/**
* Unique ID for a Custom API source, provided upon creation of a Custom API Source
*/
content_source_id: string;
/**
* Definition to upload Workplace Search Custom Source icons
*/
body: {
main_icon?: string;
alt_icon?: string;
};
}
export interface PutContentSourceIconsResponse {
results: {
main_icon?: string;
alt_icon?: string;
};
}
export interface DeleteDocumentsByQueryRequest {
/**
* Unique ID for a Custom API source, provided upon creation of a Custom API Source
*/
content_source_id: string;
/**
* Definition to delete documents by query in a content source
*/
body?: {
filters?: {
/**
* The range filter for field last_updated
*/
last_updated?: {
/**
* The start of the range, inclusive
*/
from?: string;
/**
* The end of the range, exclusive
*/
to?: string;
};
};
};
}
export interface DeleteDocumentsByQueryResponse {
total: number;
deleted: number;
failures: Array<{
[k: string]: unknown;
}>;
}
export interface ListDocumentsRequest {
/**
* Unique ID for a Custom API source, provided upon creation of a Custom API Source
*/
content_source_id: string;
body?: {
/**
* Paging controls for the result set
*/
page?: {
size?: number;
current?: number;
};
filters?: {
[k: string]: ((string | number) | Array<string | number>) | {
/**
* The start of the range, inclusive
*/
from?: string | number;
/**
* The end of the range, exclusive
*/
to?: string | number;
} | {
/**
* The base unit of measurement [mm, cm, m (meters), km, in, ft, yd, or mi (miles)]
*/
unit: 'm' | 'mi' | 'in' | 'ft' | 'yd' | 'km' | 'cm' | 'mm';
/**
* The mode of the distribution as a "lat, lon" string, "POINT(lon lat)" WKT POINT string, Geohash string, or [lon, lat] array
*/
center: string | [number, number];
/**
* Inclusive lower bound of the range. Is required if to is not provided
*/
from?: string | number;
/**
* Exclusive upper bound of the range. Is required if from is not provided
*/
to?: string | number;
} | {
/**
* The base unit of measurement [mm, cm, m (meters), km, in, ft, yd, or mi (miles)]
*/
unit: 'm' | 'mi' | 'in' | 'ft' | 'yd' | 'km' | 'cm' | 'mm';
/**
* The mode of the distribution as a "lat, lon" string, "POINT(lon lat)" WKT POINT string, Geohash string, or [lon, lat] array
*/
center: string | [number, number];
/**
* A number representing the distance unit
*/
distance: number;
};
};
sort?: {
[k: string]: 'asc' | 'desc';
} | Array<{
[k: string]: 'asc' | 'desc';
}>;
cursor?: string;
};
}
export interface ListDocumentsResponse {
meta: {
page: {
current: null | number;
total_pages: number;
total_results: number;
size: number;
};
cursor: {
current: null | string;
next: null | string;
};
warnings: string[];
};
results: Array<{
[k: string]: unknown;
}>;
}
export interface IndexDocumentsRequest {
/**
* Unique ID for a Custom API source, provided upon creation of a Custom API Source
*/
content_source_id: string;
documents: Array<{
[k: string]: unknown;
}>;
}
export interface IndexDocumentsResponse {
results: Array<{
id: string;
errors: string[];
}>;
}
export interface DeleteDocumentsRequest {
/**
* Unique ID for a Custom API source, provided upon creation of a Custom API Source
*/
content_source_id: string;
document_ids: string[];
}
export interface DeleteDocumentsResponse {
results: Array<{
id: string;
success: boolean;
}>;
}
export interface GetDocumentRequest {
/**
* Unique ID for a Custom API source, provided upon creation of a Custom API Source
*/
content_source_id: string;
/**
* Unique ID for a content source document. Provided upon or returned at creation.
*/
document_id: string;
}
export interface GetDocumentResponse {
[k: string]: unknown;
}
export interface ListExternalIdentitiesRequest {
/**
* Unique ID for a Custom API source, provided upon creation of a Custom API Source
*/
content_source_id: string;
page?: {
/**
* Which page of results to request
*/
current?: number;
/**
* The number of results to return in a page
*/
size?: number;
};
}
export interface ListExternalIdentitiesResponse {
meta: {
page: {
current: number;
total_pages: number;
total_results: number;
size: number;
};
};
results: Array<{
content_source_id: string;
external_user_id: string;
/**
* List of external user properties
*/
external_user_properties?: Array<{
attribute_name: '_elasticsearch_username';
attribute_value: string;
}>;
/**
* List of permissions
*/
permissions?: string[];
}>;
}
export interface CreateExternalIdentityRequest {
/**
* Unique ID for a Custom API source, provided upon creation of a Custom API Source
*/
content_source_id: string;
/**
* Definition to create Workplace Search External User Identity
*/
body: {
external_user_id: string;
/**
* A list of external user properties, where each property is an object with an attribute_name and attribute_value.
*/
external_user_properties: Array<{
attribute_name: '_elasticsearch_username';
attribute_value: string;
}>;
/**
* A list of user permissions.
*/
permissions: string[];
};
}
export interface CreateExternalIdentityResponse {
content_source_id: string;
external_user_id: string;
/**
* List of external user properties
*/
external_user_properties?: Array<{
attribute_name: '_elasticsearch_username';
attribute_value: string;
}>;
/**
* List of permissions
*/
permissions?: string[];
}
export interface GetExternalIdentityRequest {
/**
* Unique ID for a Custom API source, provided upon creation of a Custom API Source
*/
content_source_id: string;
/**
* Unique identifier of an external user, such as username or email address.
*/
external_user_id: string;
}
export interface GetExternalIdentityResponse {
content_source_id: string;
external_user_id: string;
/**
* List of external user properties
*/
external_user_properties?: Array<{
attribute_name: '_elasticsearch_username';
attribute_value: string;
}>;
/**
* List of permissions
*/
permissions?: string[];
}
export interface PutExternalIdentityRequest {
/**
* Unique ID for a Custom API source, provided upon creation of a Custom API Source
*/
content_source_id: string;
/**
* Unique identifier of an external user, such as username or email address.
*/
external_user_id: string;
/**
* Definition to update Workplace Search External User Identity
*/
body: {
external_user_id: string;
/**
* A list of external user properties, where each property is an object with an attribute_name and attribute_value.
*/
external_user_properties?: Array<{
attribute_name: '_elasticsearch_username';
attribute_value: string;
}> | null;
/**
* A list of user permissions.
*/
permissions?: string[] | null;
};
}
export interface PutExternalIdentityResponse {
content_source_id: string;
external_user_id: string;
/**
* List of external user properties
*/
external_user_properties?: Array<{
attribute_name: '_elasticsearch_username';
attribute_value: string;
}>;
/**
* List of permissions
*/
permissions?: string[];
}
export interface DeleteExternalIdentityRequest {
/**
* Unique ID for a Custom API source, provided upon creation of a Custom API Source
*/
content_source_id: string;
/**
* Unique identifier of an external user, such as username or email address.
*/
external_user_id: string;
}
export type DeleteExternalIdentityResponse = 'ok';
export interface CommandSyncJobsRequest {
/**
* Unique ID for a Custom API source, provided upon creation of a Custom API Source
*/
content_source_id: string;
/**
* The type of sync job to consider
*/
job_type?: unknown[];
body: ({
[k: string]: unknown;
} & {
force_interrupt?: boolean;
command?: 'start';
}) | ({
[k: string]: unknown;
} & {
command?: 'interrupt';
});
}
export interface CommandSyncJobsResponse {
results: {
started: Array<{
id: string;
job_type: 'full' | 'incremen