From 95d7e3d9df511b095d918cccaecce6aa030ad691 Mon Sep 17 00:00:00 2001 From: Jedr Blaszyk Date: Wed, 10 Apr 2024 11:46:16 +0200 Subject: [PATCH 1/8] Add json spec --- .../_json_spec/connector_sync_job.cancel.json | 31 ++++++++++++ .../_json_spec/connector_sync_job.delete.json | 31 ++++++++++++ .../_json_spec/connector_sync_job.get.json | 31 ++++++++++++ .../_json_spec/connector_sync_job.list.json | 49 +++++++++++++++++++ .../_json_spec/connector_sync_job.post.json | 32 ++++++++++++ 5 files changed, 174 insertions(+) create mode 100644 specification/_json_spec/connector_sync_job.cancel.json create mode 100644 specification/_json_spec/connector_sync_job.delete.json create mode 100644 specification/_json_spec/connector_sync_job.get.json create mode 100644 specification/_json_spec/connector_sync_job.list.json create mode 100644 specification/_json_spec/connector_sync_job.post.json diff --git a/specification/_json_spec/connector_sync_job.cancel.json b/specification/_json_spec/connector_sync_job.cancel.json new file mode 100644 index 0000000000..1e8cf154cf --- /dev/null +++ b/specification/_json_spec/connector_sync_job.cancel.json @@ -0,0 +1,31 @@ +{ + "connector_sync_job.cancel": { + "documentation": { + "url": "https://www.elastic.co/guide/en/elasticsearch/reference/master/cancel-connector-sync-job-api.html", + "description": "Cancels a connector sync job." + }, + "stability": "experimental", + "visibility": "public", + "headers": { + "accept": [ + "application/json" + ] + }, + "url": { + "paths": [ + { + "path": "/_connector/_sync_job/{connector_sync_job_id}/_cancel", + "methods": [ + "PUT" + ], + "parts": { + "connector_sync_job_id": { + "type": "string", + "description": "The unique identifier of the connector sync job to be canceled" + } + } + } + ] + } + } +} diff --git a/specification/_json_spec/connector_sync_job.delete.json b/specification/_json_spec/connector_sync_job.delete.json new file mode 100644 index 0000000000..11894a48db --- /dev/null +++ b/specification/_json_spec/connector_sync_job.delete.json @@ -0,0 +1,31 @@ +{ + "connector_sync_job.delete": { + "documentation": { + "url": "https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-connector-sync-job-api.html", + "description": "Deletes a connector sync job." + }, + "stability": "experimental", + "visibility": "public", + "headers": { + "accept": [ + "application/json" + ] + }, + "url": { + "paths": [ + { + "path": "/_connector/_sync_job/{connector_sync_job_id}", + "methods": [ + "DELETE" + ], + "parts": { + "connector_sync_job_id": { + "type": "string", + "description": "The unique identifier of the connector sync job to be deleted." + } + } + } + ] + } + } +} diff --git a/specification/_json_spec/connector_sync_job.get.json b/specification/_json_spec/connector_sync_job.get.json new file mode 100644 index 0000000000..6dd29069ba --- /dev/null +++ b/specification/_json_spec/connector_sync_job.get.json @@ -0,0 +1,31 @@ +{ + "connector_sync_job.get": { + "documentation": { + "url": "https://www.elastic.co/guide/en/elasticsearch/reference/master/get-connector-sync-job-api.html", + "description": "Returns the details about a connector sync job." + }, + "stability": "experimental", + "visibility": "public", + "headers": { + "accept": [ + "application/json" + ] + }, + "url": { + "paths": [ + { + "path": "/_connector/_sync_job/{connector_sync_job_id}", + "methods": [ + "GET" + ], + "parts": { + "connector_sync_job_id": { + "type": "string", + "description": "The unique identifier of the connector sync job to be returned." + } + } + } + ] + } + } +} diff --git a/specification/_json_spec/connector_sync_job.list.json b/specification/_json_spec/connector_sync_job.list.json new file mode 100644 index 0000000000..6b5a43d167 --- /dev/null +++ b/specification/_json_spec/connector_sync_job.list.json @@ -0,0 +1,49 @@ +{ + "connector_sync_job.list": { + "documentation": { + "url": "https://www.elastic.co/guide/en/elasticsearch/reference/master/list-connector-sync-jobs-api.html", + "description": "Lists all connector sync jobs." + }, + "stability": "experimental", + "visibility": "public", + "headers": { + "accept": [ + "application/json" + ] + }, + "url": { + "paths": [ + { + "path": "/_connector/_sync_job", + "methods": [ + "GET" + ] + } + ] + }, + "params": { + "from": { + "type": "int", + "default": 0, + "description": "Starting offset (default: 0)" + }, + "size": { + "type": "int", + "default": 100, + "description": "specifies a max number of results to get (default: 100)" + }, + "status": { + "type": "string", + "description": "Sync job status, which sync jobs are fetched for" + }, + "connector_id": { + "type": "string", + "description": "Id of the connector to fetch the sync jobs for" + }, + "job_type": { + "type": "list", + "description": "A comma-separated list of job types" + } + } + } +} diff --git a/specification/_json_spec/connector_sync_job.post.json b/specification/_json_spec/connector_sync_job.post.json new file mode 100644 index 0000000000..8050b34014 --- /dev/null +++ b/specification/_json_spec/connector_sync_job.post.json @@ -0,0 +1,32 @@ +{ + "connector_sync_job.post": { + "documentation": { + "url": "https://www.elastic.co/guide/en/elasticsearch/reference/master/create-connector-sync-job-api.html", + "description": "Creates a connector sync job." + }, + "stability": "experimental", + "visibility": "public", + "headers": { + "accept": [ + "application/json" + ], + "content_type": [ + "application/json" + ] + }, + "url": { + "paths": [ + { + "path": "/_connector/_sync_job", + "methods": [ + "POST" + ] + } + ] + }, + "body": { + "description": "The connector sync job data.", + "required": true + } + } +} From 51c021d03faa7b8231b98f4a34e45b82bd3c0af0 Mon Sep 17 00:00:00 2001 From: Jedr Blaszyk Date: Wed, 10 Apr 2024 14:28:15 +0200 Subject: [PATCH 2/8] [Connector API] Define sync job API spec --- .../elasticsearch-serverless-openapi.json | 896 +++++++- output/schema/schema.json | 1953 +++++++++++++++++ output/schema/validation-errors.json | 12 + output/typescript/types.ts | 199 ++ specification/_doc_ids/table.csv | 5 + .../_json_spec/connector_sync_job.cancel.json | 8 +- .../_json_spec/connector_sync_job.delete.json | 8 +- .../_json_spec/connector_sync_job.get.json | 8 +- .../_json_spec/connector_sync_job.list.json | 8 +- .../_json_spec/connector_sync_job.post.json | 12 +- specification/connector/_types/Connector.ts | 267 +++ .../connector_sync_job/_types/SyncJob.ts | 53 + .../cancel/SyncJobCancelRequest.ts | 36 + .../cancel/SyncJobCancelResponse.ts | 26 + .../delete/SyncJobDeleteRequest.ts | 36 + .../delete/SyncJobDeleteResponse.ts | 24 + .../get/SyncJobGetRequest.ts | 36 + .../get/SyncJobGetResponse.ts | 24 + .../list/SyncJobListRequest.ts | 53 + .../list/SyncJobListResponse.ts | 28 + .../post/SyncJobPostRequest.ts | 40 + .../post/SyncJobPostResponse.ts | 26 + 22 files changed, 3715 insertions(+), 43 deletions(-) create mode 100644 specification/connector/_types/Connector.ts create mode 100644 specification/connector_sync_job/_types/SyncJob.ts create mode 100644 specification/connector_sync_job/cancel/SyncJobCancelRequest.ts create mode 100644 specification/connector_sync_job/cancel/SyncJobCancelResponse.ts create mode 100644 specification/connector_sync_job/delete/SyncJobDeleteRequest.ts create mode 100644 specification/connector_sync_job/delete/SyncJobDeleteResponse.ts create mode 100644 specification/connector_sync_job/get/SyncJobGetRequest.ts create mode 100644 specification/connector_sync_job/get/SyncJobGetResponse.ts create mode 100644 specification/connector_sync_job/list/SyncJobListRequest.ts create mode 100644 specification/connector_sync_job/list/SyncJobListResponse.ts create mode 100644 specification/connector_sync_job/post/SyncJobPostRequest.ts create mode 100644 specification/connector_sync_job/post/SyncJobPostResponse.ts diff --git a/output/openapi/elasticsearch-serverless-openapi.json b/output/openapi/elasticsearch-serverless-openapi.json index 049e2830cf..e68d646cd2 100644 --- a/output/openapi/elasticsearch-serverless-openapi.json +++ b/output/openapi/elasticsearch-serverless-openapi.json @@ -1810,6 +1810,273 @@ } } }, + "/_connector/_sync_job/{connector_sync_job_id}/_cancel": { + "put": { + "tags": [ + "connector_sync_job.cancel" + ], + "summary": "Cancels a connector sync job.", + "description": "Cancels a connector sync job.", + "externalDocs": { + "url": "https://www.elastic.co/guide/en/elasticsearch/reference/current/cancel-connector-sync-job-api.html" + }, + "operationId": "connector-sync-job-cancel", + "parameters": [ + { + "in": "path", + "name": "connector_sync_job_id", + "description": "The unique identifier of the connector sync job", + "required": true, + "deprecated": false, + "schema": { + "$ref": "#/components/schemas/_types:Id" + }, + "style": "simple" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "result": { + "$ref": "#/components/schemas/_types:Result" + } + }, + "required": [ + "result" + ] + } + } + } + } + } + } + }, + "/_connector/_sync_job/{connector_sync_job_id}": { + "get": { + "tags": [ + "connector_sync_job.get" + ], + "summary": "Returns the details about a connector sync job.", + "description": "Returns the details about a connector sync job.", + "externalDocs": { + "url": "https://www.elastic.co/guide/en/elasticsearch/reference/current/get-connector-sync-job-api.html" + }, + "operationId": "connector-sync-job-get", + "parameters": [ + { + "in": "path", + "name": "connector_sync_job_id", + "description": "The unique identifier of the connector sync job", + "required": true, + "deprecated": false, + "schema": { + "$ref": "#/components/schemas/_types:Id" + }, + "style": "simple" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/connector_sync_job._types:ConnectorSyncJob" + } + } + } + } + } + }, + "delete": { + "tags": [ + "connector_sync_job.delete" + ], + "summary": "Deletes a connector sync job.", + "description": "Deletes a connector sync job.", + "externalDocs": { + "url": "https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-connector-sync-job-api.html" + }, + "operationId": "connector-sync-job-delete", + "parameters": [ + { + "in": "path", + "name": "connector_sync_job_id", + "description": "The unique identifier of the connector sync job to be deleted", + "required": true, + "deprecated": false, + "schema": { + "$ref": "#/components/schemas/_types:Id" + }, + "style": "simple" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/_types:AcknowledgedResponseBase" + } + } + } + } + } + } + }, + "/_connector/_sync_job": { + "get": { + "tags": [ + "connector_sync_job.list" + ], + "summary": "Lists all connector sync jobs.", + "description": "Lists all connector sync jobs.", + "externalDocs": { + "url": "https://www.elastic.co/guide/en/elasticsearch/reference/{list}/list-connector-sync-jobs-api.html" + }, + "operationId": "connector-sync-job-list", + "parameters": [ + { + "in": "query", + "name": "from", + "description": "Starting offset (default: 0)", + "deprecated": false, + "schema": { + "type": "number" + }, + "style": "form" + }, + { + "in": "query", + "name": "size", + "description": "Specifies a max number of results to get", + "deprecated": false, + "schema": { + "type": "number" + }, + "style": "form" + }, + { + "in": "query", + "name": "status", + "description": "A sync job status to fetch connector sync jobs for", + "deprecated": false, + "schema": { + "type": "string" + }, + "style": "form" + }, + { + "in": "query", + "name": "connector_id", + "description": "A connector id to fetch connector sync jobs for", + "deprecated": false, + "schema": { + "$ref": "#/components/schemas/_types:Id" + }, + "style": "form" + }, + { + "in": "query", + "name": "job_type", + "description": "A comma-separated list of job types to fetch the sync jobs for", + "deprecated": false, + "schema": { + "$ref": "#/components/schemas/_types:Fields" + }, + "style": "form" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "count": { + "type": "number" + }, + "results": { + "type": "array", + "items": { + "$ref": "#/components/schemas/connector_sync_job._types:ConnectorSyncJob" + } + } + }, + "required": [ + "count", + "results" + ] + } + } + } + } + } + }, + "post": { + "tags": [ + "connector_sync_job.post" + ], + "summary": "Creates a connector sync job.", + "description": "Creates a connector sync job.", + "externalDocs": { + "url": "https://www.elastic.co/guide/en/elasticsearch/reference/current/create-connector-sync-job-api.html" + }, + "operationId": "connector-sync-job-post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "$ref": "#/components/schemas/_types:Id" + }, + "job_type": { + "type": "string" + }, + "trigger_method": { + "type": "string" + } + }, + "required": [ + "id" + ] + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "$ref": "#/components/schemas/_types:Id" + } + }, + "required": [ + "id" + ] + } + } + } + } + } + } + }, "/_count": { "get": { "tags": [ @@ -47995,6 +48262,625 @@ } } }, + "_types:Result": { + "type": "string", + "enum": [ + "created", + "updated", + "deleted", + "not_found", + "noop" + ] + }, + "connector_sync_job._types:ConnectorSyncJob": { + "type": "object", + "properties": { + "cancelation_requested_at": { + "type": "string" + }, + "canceled_at": { + "type": "string" + }, + "completed_at": { + "type": "string" + }, + "connector": { + "$ref": "#/components/schemas/connector_sync_job._types:SyncJobConnectorReference" + }, + "created_at": { + "type": "string" + }, + "deleted_document_count": { + "type": "number" + }, + "error": { + "$ref": "#/components/schemas/_spec_utils:WithNullValuestring" + }, + "id": { + "$ref": "#/components/schemas/_types:Id" + }, + "indexed_document_count": { + "type": "number" + }, + "indexed_document_volume": { + "type": "number" + }, + "job_type": { + "$ref": "#/components/schemas/connector_sync_job._types:SyncJobType" + }, + "last_seen": { + "type": "string" + }, + "metadata": { + "type": "object", + "additionalProperties": { + "type": "object" + } + }, + "started_at": { + "type": "string" + }, + "status": { + "$ref": "#/components/schemas/connector._types:SyncStatus" + }, + "total_document_count": { + "type": "number" + }, + "trigger_method": { + "$ref": "#/components/schemas/connector_sync_job._types:TriggerMethod" + }, + "worker_hostname": { + "type": "string" + } + }, + "required": [ + "connector", + "created_at", + "deleted_document_count", + "error", + "id", + "indexed_document_count", + "indexed_document_volume", + "job_type", + "metadata", + "status", + "trigger_method" + ] + }, + "connector_sync_job._types:SyncJobConnectorReference": { + "type": "object", + "properties": { + "configuration": { + "$ref": "#/components/schemas/connector._types:ConnectorConfiguration" + }, + "filtering": { + "$ref": "#/components/schemas/connector._types:FilteringConfig" + }, + "id": { + "$ref": "#/components/schemas/_types:Id" + }, + "index_name": { + "type": "string" + }, + "language": { + "type": "string" + }, + "pipeline": { + "$ref": "#/components/schemas/connector._types:IngestPipelineParams" + }, + "service_type": { + "type": "string" + } + }, + "required": [ + "configuration", + "filtering", + "id", + "index_name", + "pipeline", + "service_type" + ] + }, + "connector._types:ConnectorConfiguration": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/connector._types:ConnectorConfigProperties" + } + }, + "connector._types:ConnectorConfigProperties": { + "type": "object", + "properties": { + "category": { + "type": "string" + }, + "default_value": { + "$ref": "#/components/schemas/_types:ScalarValue" + }, + "depends_on": { + "type": "array", + "items": { + "$ref": "#/components/schemas/connector._types:Dependency" + } + }, + "display": { + "$ref": "#/components/schemas/connector._types:DisplayType" + }, + "label": { + "type": "string" + }, + "options": { + "type": "array", + "items": { + "$ref": "#/components/schemas/connector._types:SelectOption" + } + }, + "order": { + "type": "number" + }, + "placeholder": { + "type": "string" + }, + "required": { + "type": "boolean" + }, + "sensitive": { + "type": "boolean" + }, + "tooltip": { + "type": "string" + }, + "type": { + "$ref": "#/components/schemas/connector._types:ConnectorFieldType" + }, + "ui_restrictions": { + "type": "array", + "items": { + "type": "string" + } + }, + "validations": { + "type": "array", + "items": { + "$ref": "#/components/schemas/connector._types:Validation" + } + }, + "value": { + "$ref": "#/components/schemas/_types:ScalarValue" + } + }, + "required": [ + "default_value", + "depends_on", + "display", + "label", + "options", + "required", + "sensitive", + "type", + "ui_restrictions", + "validations", + "value" + ] + }, + "_types:ScalarValue": { + "description": "A scalar value.", + "oneOf": [ + { + "type": "number" + }, + { + "type": "number" + }, + { + "type": "string" + }, + { + "type": "boolean" + }, + { + "nullable": true, + "type": "string" + } + ] + }, + "connector._types:Dependency": { + "type": "object", + "properties": { + "field": { + "type": "string" + }, + "value": { + "$ref": "#/components/schemas/_types:ScalarValue" + } + }, + "required": [ + "field", + "value" + ] + }, + "connector._types:DisplayType": { + "type": "string", + "enum": [ + "textbox", + "textarea", + "numeric", + "toggle", + "dropdown" + ] + }, + "connector._types:SelectOption": { + "type": "object", + "properties": { + "label": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "required": [ + "label", + "value" + ] + }, + "connector._types:ConnectorFieldType": { + "type": "string", + "enum": [ + "str", + "int", + "list", + "bool" + ] + }, + "connector._types:Validation": { + "discriminator": { + "propertyName": "type" + }, + "oneOf": [ + { + "$ref": "#/components/schemas/connector._types:LessThanValidation" + }, + { + "$ref": "#/components/schemas/connector._types:GreaterThanValidation" + }, + { + "$ref": "#/components/schemas/connector._types:ListTypeValidation" + }, + { + "$ref": "#/components/schemas/connector._types:IncludedInValidation" + }, + { + "$ref": "#/components/schemas/connector._types:RegexValidation" + } + ] + }, + "connector._types:LessThanValidation": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "less_than" + ] + }, + "constraint": { + "type": "number" + } + }, + "required": [ + "type", + "constraint" + ] + }, + "connector._types:GreaterThanValidation": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "greater_than" + ] + }, + "constraint": { + "type": "number" + } + }, + "required": [ + "type", + "constraint" + ] + }, + "connector._types:ListTypeValidation": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "list_type" + ] + }, + "constraint": { + "type": "array", + "items": { + "$ref": "#/components/schemas/_types:ScalarValue" + } + } + }, + "required": [ + "type", + "constraint" + ] + }, + "connector._types:IncludedInValidation": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "included_in" + ] + }, + "constraint": { + "type": "string" + } + }, + "required": [ + "type", + "constraint" + ] + }, + "connector._types:RegexValidation": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "regex" + ] + }, + "constraint": { + "type": "string" + } + }, + "required": [ + "type", + "constraint" + ] + }, + "connector._types:FilteringConfig": { + "type": "object", + "properties": { + "active": { + "$ref": "#/components/schemas/connector._types:FilteringRules" + }, + "domain": { + "type": "string" + }, + "draft": { + "$ref": "#/components/schemas/connector._types:FilteringRules" + } + }, + "required": [ + "active", + "domain", + "draft" + ] + }, + "connector._types:FilteringRules": { + "type": "object", + "properties": { + "advanced_snippet": { + "$ref": "#/components/schemas/connector._types:FilteringAdvancedSnippet" + }, + "rules": { + "type": "array", + "items": { + "$ref": "#/components/schemas/connector._types:FilteringRule" + } + }, + "validation": { + "$ref": "#/components/schemas/connector._types:FilteringRulesValidation" + } + }, + "required": [ + "advanced_snippet", + "rules", + "validation" + ] + }, + "connector._types:FilteringAdvancedSnippet": { + "type": "object", + "properties": { + "created_at": { + "type": "string" + }, + "updated_at": { + "type": "string" + }, + "value": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + }, + "required": [ + "created_at", + "updated_at", + "value" + ] + }, + "connector._types:FilteringRule": { + "type": "object", + "properties": { + "created_at": { + "type": "string" + }, + "field": { + "type": "string" + }, + "id": { + "type": "string" + }, + "order": { + "type": "number" + }, + "policy": { + "$ref": "#/components/schemas/connector._types:FilteringPolicy" + }, + "rule": { + "$ref": "#/components/schemas/connector._types:FilteringRuleRule" + }, + "updated_at": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "required": [ + "created_at", + "field", + "id", + "order", + "policy", + "rule", + "updated_at", + "value" + ] + }, + "connector._types:FilteringPolicy": { + "type": "string", + "enum": [ + "exclude", + "include" + ] + }, + "connector._types:FilteringRuleRule": { + "type": "string", + "enum": [ + "contains", + "ends_with", + "equals", + "regex", + "starts_with", + ">", + "<" + ] + }, + "connector._types:FilteringRulesValidation": { + "type": "object", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/connector._types:FilteringValidation" + } + }, + "state": { + "$ref": "#/components/schemas/connector._types:FilteringValidationState" + } + }, + "required": [ + "errors", + "state" + ] + }, + "connector._types:FilteringValidation": { + "type": "object", + "properties": { + "ids": { + "type": "array", + "items": { + "type": "string" + } + }, + "messages": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "ids", + "messages" + ] + }, + "connector._types:FilteringValidationState": { + "type": "string", + "enum": [ + "edited", + "invalid", + "valid" + ] + }, + "connector._types:IngestPipelineParams": { + "type": "object", + "properties": { + "extract_binary_content": { + "type": "boolean" + }, + "name": { + "type": "string" + }, + "reduce_whitespace": { + "type": "boolean" + }, + "run_ml_inference": { + "type": "boolean" + } + }, + "required": [ + "extract_binary_content", + "name", + "reduce_whitespace", + "run_ml_inference" + ] + }, + "_spec_utils:WithNullValuestring": { + "description": "`WithNullValue` allows for explicit null assignments in contexts where `null` should be interpreted as an\nactual value.", + "oneOf": [ + { + "type": "string" + }, + { + "$ref": "#/components/schemas/_spec_utils:NullValue" + } + ] + }, + "_spec_utils:NullValue": { + "nullable": true, + "description": "A `null` value that is to be interpreted as an actual value, unless other uses of `null` that are equivalent\nto a missing value. It is used for exemple in settings, where using the `NullValue` for a setting will reset\nit to its default value.", + "type": "string" + }, + "connector_sync_job._types:SyncJobType": { + "type": "string", + "enum": [ + "full", + "incremental", + "access_control" + ] + }, + "connector._types:SyncStatus": { + "type": "string", + "enum": [ + "canceling", + "canceled", + "completed", + "error", + "in_progress", + "pending", + "suspended" + ] + }, + "connector_sync_job._types:TriggerMethod": { + "type": "string", + "enum": [ + "on_demand", + "scheduled" + ] + }, "_types:WriteResponseBase": { "type": "object", "properties": { @@ -48032,16 +48918,6 @@ "_version" ] }, - "_types:Result": { - "type": "string", - "enum": [ - "created", - "updated", - "deleted", - "not_found", - "noop" - ] - }, "_types:Conflicts": { "type": "string", "enum": [ diff --git a/output/schema/schema.json b/output/schema/schema.json index 5ad5b346dd..3f8b253fd1 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -3073,6 +3073,204 @@ ], "visibility": "public" }, + { + "availability": { + "serverless": { + "stability": "experimental", + "visibility": "public" + }, + "stack": { + "since": "8.12.0", + "stability": "experimental" + } + }, + "description": "Cancels a connector sync job.", + "docId": "connector-sync-job-cancel", + "docUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/cancel-connector-sync-job-api.html", + "name": "connector_sync_job.cancel", + "request": { + "name": "Request", + "namespace": "connector_sync_job.cancel" + }, + "requestBodyRequired": false, + "response": { + "name": "Response", + "namespace": "connector_sync_job.cancel" + }, + "responseMediaType": [ + "application/json" + ], + "since": "8.12.0", + "stability": "experimental", + "urls": [ + { + "methods": [ + "PUT" + ], + "path": "/_connector/_sync_job/{connector_sync_job_id}/_cancel" + } + ], + "visibility": "public" + }, + { + "availability": { + "serverless": { + "stability": "experimental", + "visibility": "public" + }, + "stack": { + "since": "8.12.0", + "stability": "experimental" + } + }, + "description": "Deletes a connector sync job.", + "docId": "connector-sync-job-delete", + "docUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/delete-connector-sync-job-api.html", + "name": "connector_sync_job.delete", + "request": { + "name": "Request", + "namespace": "connector_sync_job.delete" + }, + "requestBodyRequired": false, + "response": { + "name": "Response", + "namespace": "connector_sync_job.delete" + }, + "responseMediaType": [ + "application/json" + ], + "since": "8.12.0", + "stability": "experimental", + "urls": [ + { + "methods": [ + "DELETE" + ], + "path": "/_connector/_sync_job/{connector_sync_job_id}" + } + ], + "visibility": "public" + }, + { + "availability": { + "serverless": { + "stability": "experimental", + "visibility": "public" + }, + "stack": { + "since": "8.12.0", + "stability": "experimental" + } + }, + "description": "Returns the details about a connector sync job.", + "docId": "connector-sync-job-get", + "docUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/get-connector-sync-job-api.html", + "name": "connector_sync_job.get", + "request": { + "name": "Request", + "namespace": "connector_sync_job.get" + }, + "requestBodyRequired": false, + "response": { + "name": "Response", + "namespace": "connector_sync_job.get" + }, + "responseMediaType": [ + "application/json" + ], + "since": "8.12.0", + "stability": "experimental", + "urls": [ + { + "methods": [ + "GET" + ], + "path": "/_connector/_sync_job/{connector_sync_job_id}" + } + ], + "visibility": "public" + }, + { + "availability": { + "serverless": { + "stability": "experimental", + "visibility": "public" + }, + "stack": { + "since": "8.12.0", + "stability": "experimental" + } + }, + "description": "Lists all connector sync jobs.", + "docId": "connector-sync-job-list", + "docUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/{list}/list-connector-sync-jobs-api.html", + "name": "connector_sync_job.list", + "request": { + "name": "Request", + "namespace": "connector_sync_job.list" + }, + "requestBodyRequired": false, + "response": { + "name": "Response", + "namespace": "connector_sync_job.list" + }, + "responseMediaType": [ + "application/json" + ], + "since": "8.12.0", + "stability": "experimental", + "urls": [ + { + "methods": [ + "GET" + ], + "path": "/_connector/_sync_job" + } + ], + "visibility": "public" + }, + { + "availability": { + "serverless": { + "stability": "experimental", + "visibility": "public" + }, + "stack": { + "since": "8.12.0", + "stability": "experimental" + } + }, + "description": "Creates a connector sync job.", + "docId": "connector-sync-job-post", + "docUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/create-connector-sync-job-api.html", + "name": "connector_sync_job.post", + "request": { + "name": "Request", + "namespace": "connector_sync_job.post" + }, + "requestBodyRequired": true, + "requestMediaType": [ + "application/json" + ], + "response": { + "name": "Response", + "namespace": "connector_sync_job.post" + }, + "responseMediaType": [ + "application/json" + ], + "since": "8.12.0", + "stability": "experimental", + "urls": [ + { + "methods": [ + "POST" + ], + "path": "/_connector/_sync_job" + } + ], + "visibility": "public" + }, { "availability": { "serverless": { @@ -40423,6 +40621,22 @@ ], "specLocation": "_spec_utils/BaseNode.ts#L25-L32" }, + { + "description": "A `null` value that is to be interpreted as an actual value, unless other uses of `null` that are equivalent\nto a missing value. It is used for exemple in settings, where using the `NullValue` for a setting will reset\nit to its default value.", + "kind": "type_alias", + "name": { + "name": "NullValue", + "namespace": "_spec_utils" + }, + "specLocation": "_spec_utils/utils.ts#L22-L27", + "type": { + "kind": "instance_of", + "type": { + "name": "null", + "namespace": "_builtins" + } + } + }, { "description": "A set of flags that can be represented as a single enum value or a set of values that are encoded\nas a pipe-separated string\n\nDepending on the target language, code generators can use this hint to generate language specific\nflags enum constructs and the corresponding (de-)serialization code.", "generics": [ @@ -40507,6 +40721,40 @@ } } }, + { + "description": "`WithNullValue` allows for explicit null assignments in contexts where `null` should be interpreted as an\nactual value.", + "generics": [ + { + "name": "T", + "namespace": "_spec_utils" + } + ], + "kind": "type_alias", + "name": { + "name": "WithNullValue", + "namespace": "_spec_utils" + }, + "specLocation": "_spec_utils/utils.ts#L29-L33", + "type": { + "items": [ + { + "kind": "instance_of", + "type": { + "name": "T", + "namespace": "_spec_utils" + } + }, + { + "kind": "instance_of", + "type": { + "name": "NullValue", + "namespace": "_spec_utils" + } + } + ], + "kind": "union_of" + } + }, { "kind": "interface", "name": { @@ -104757,6 +105005,1711 @@ ], "specLocation": "cluster/stats/ClusterStatsResponse.ts#L25-L51" }, + { + "kind": "interface", + "name": { + "name": "ConnectorConfigProperties", + "namespace": "connector._types" + }, + "properties": [ + { + "name": "category", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + }, + { + "name": "default_value", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "ScalarValue", + "namespace": "_types" + } + } + }, + { + "name": "depends_on", + "required": true, + "type": { + "kind": "array_of", + "value": { + "kind": "instance_of", + "type": { + "name": "Dependency", + "namespace": "connector._types" + } + } + } + }, + { + "name": "display", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "DisplayType", + "namespace": "connector._types" + } + } + }, + { + "name": "label", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + }, + { + "name": "options", + "required": true, + "type": { + "kind": "array_of", + "value": { + "kind": "instance_of", + "type": { + "name": "SelectOption", + "namespace": "connector._types" + } + } + } + }, + { + "name": "order", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "integer", + "namespace": "_types" + } + } + }, + { + "name": "placeholder", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + }, + { + "name": "required", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "boolean", + "namespace": "_builtins" + } + } + }, + { + "name": "sensitive", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "boolean", + "namespace": "_builtins" + } + } + }, + { + "name": "tooltip", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + }, + { + "name": "type", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "ConnectorFieldType", + "namespace": "connector._types" + } + } + }, + { + "name": "ui_restrictions", + "required": true, + "type": { + "kind": "array_of", + "value": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + } + }, + { + "name": "validations", + "required": true, + "type": { + "kind": "array_of", + "value": { + "kind": "instance_of", + "type": { + "name": "Validation", + "namespace": "connector._types" + } + } + } + }, + { + "name": "value", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "ScalarValue", + "namespace": "_types" + } + } + } + ], + "specLocation": "connector/_types/Connector.ts#L83-L99" + }, + { + "kind": "type_alias", + "name": { + "name": "ConnectorConfiguration", + "namespace": "connector._types" + }, + "specLocation": "connector/_types/Connector.ts#L101-L104", + "type": { + "key": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + }, + "kind": "dictionary_of", + "singleKey": false, + "value": { + "kind": "instance_of", + "type": { + "name": "ConnectorConfigProperties", + "namespace": "connector._types" + } + } + } + }, + { + "kind": "enum", + "members": [ + { + "name": "str" + }, + { + "name": "int" + }, + { + "name": "list" + }, + { + "name": "bool" + } + ], + "name": { + "name": "ConnectorFieldType", + "namespace": "connector._types" + }, + "specLocation": "connector/_types/Connector.ts#L43-L48" + }, + { + "kind": "interface", + "name": { + "name": "Dependency", + "namespace": "connector._types" + }, + "properties": [ + { + "name": "field", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + }, + { + "name": "value", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "ScalarValue", + "namespace": "_types" + } + } + } + ], + "specLocation": "connector/_types/Connector.ts#L30-L33" + }, + { + "kind": "enum", + "members": [ + { + "name": "textbox" + }, + { + "name": "textarea" + }, + { + "name": "numeric" + }, + { + "name": "toggle" + }, + { + "name": "dropdown" + } + ], + "name": { + "name": "DisplayType", + "namespace": "connector._types" + }, + "specLocation": "connector/_types/Connector.ts#L35-L41" + }, + { + "kind": "interface", + "name": { + "name": "FilteringAdvancedSnippet", + "namespace": "connector._types" + }, + "properties": [ + { + "name": "created_at", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + }, + { + "name": "updated_at", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + }, + { + "name": "value", + "required": true, + "type": { + "key": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + }, + "kind": "dictionary_of", + "singleKey": false, + "value": { + "kind": "user_defined_value" + } + } + } + ], + "specLocation": "connector/_types/Connector.ts#L192-L196" + }, + { + "kind": "interface", + "name": { + "name": "FilteringConfig", + "namespace": "connector._types" + }, + "properties": [ + { + "name": "active", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "FilteringRules", + "namespace": "connector._types" + } + } + }, + { + "name": "domain", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + }, + { + "name": "draft", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "FilteringRules", + "namespace": "connector._types" + } + } + } + ], + "specLocation": "connector/_types/Connector.ts#L209-L213" + }, + { + "kind": "enum", + "members": [ + { + "name": "exclude" + }, + { + "name": "include" + } + ], + "name": { + "name": "FilteringPolicy", + "namespace": "connector._types" + }, + "specLocation": "connector/_types/Connector.ts#L155-L158" + }, + { + "kind": "interface", + "name": { + "name": "FilteringRule", + "namespace": "connector._types" + }, + "properties": [ + { + "name": "created_at", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + }, + { + "name": "field", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + }, + { + "name": "id", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + }, + { + "name": "order", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "integer", + "namespace": "_types" + } + } + }, + { + "name": "policy", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "FilteringPolicy", + "namespace": "connector._types" + } + } + }, + { + "name": "rule", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "FilteringRuleRule", + "namespace": "connector._types" + } + } + }, + { + "name": "updated_at", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + }, + { + "name": "value", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + } + ], + "specLocation": "connector/_types/Connector.ts#L170-L179" + }, + { + "kind": "enum", + "members": [ + { + "name": "contains" + }, + { + "name": "ends_with" + }, + { + "name": "equals" + }, + { + "name": "regex" + }, + { + "name": "starts_with" + }, + { + "codegenName": "greater_than", + "name": ">" + }, + { + "codegenName": "less_than", + "name": "<" + } + ], + "name": { + "name": "FilteringRuleRule", + "namespace": "connector._types" + }, + "specLocation": "connector/_types/Connector.ts#L160-L168" + }, + { + "kind": "interface", + "name": { + "name": "FilteringRules", + "namespace": "connector._types" + }, + "properties": [ + { + "name": "advanced_snippet", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "FilteringAdvancedSnippet", + "namespace": "connector._types" + } + } + }, + { + "name": "rules", + "required": true, + "type": { + "kind": "array_of", + "value": { + "kind": "instance_of", + "type": { + "name": "FilteringRule", + "namespace": "connector._types" + } + } + } + }, + { + "name": "validation", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "FilteringRulesValidation", + "namespace": "connector._types" + } + } + } + ], + "specLocation": "connector/_types/Connector.ts#L203-L207" + }, + { + "kind": "interface", + "name": { + "name": "FilteringRulesValidation", + "namespace": "connector._types" + }, + "properties": [ + { + "name": "errors", + "required": true, + "type": { + "kind": "array_of", + "value": { + "kind": "instance_of", + "type": { + "name": "FilteringValidation", + "namespace": "connector._types" + } + } + } + }, + { + "name": "state", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "FilteringValidationState", + "namespace": "connector._types" + } + } + } + ], + "specLocation": "connector/_types/Connector.ts#L198-L201" + }, + { + "kind": "interface", + "name": { + "name": "FilteringValidation", + "namespace": "connector._types" + }, + "properties": [ + { + "name": "ids", + "required": true, + "type": { + "kind": "array_of", + "value": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + } + }, + { + "name": "messages", + "required": true, + "type": { + "kind": "array_of", + "value": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + } + } + ], + "specLocation": "connector/_types/Connector.ts#L181-L184" + }, + { + "kind": "enum", + "members": [ + { + "name": "edited" + }, + { + "name": "invalid" + }, + { + "name": "valid" + } + ], + "name": { + "name": "FilteringValidationState", + "namespace": "connector._types" + }, + "specLocation": "connector/_types/Connector.ts#L186-L190" + }, + { + "kind": "interface", + "name": { + "name": "GreaterThanValidation", + "namespace": "connector._types" + }, + "properties": [ + { + "name": "type", + "required": true, + "type": { + "kind": "literal_value", + "value": "greater_than" + } + }, + { + "name": "constraint", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "double", + "namespace": "_types" + } + } + } + ], + "specLocation": "connector/_types/Connector.ts#L63-L66" + }, + { + "kind": "interface", + "name": { + "name": "IncludedInValidation", + "namespace": "connector._types" + }, + "properties": [ + { + "name": "type", + "required": true, + "type": { + "kind": "literal_value", + "value": "included_in" + } + }, + { + "name": "constraint", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + } + ], + "specLocation": "connector/_types/Connector.ts#L73-L76" + }, + { + "kind": "interface", + "name": { + "name": "IngestPipelineParams", + "namespace": "connector._types" + }, + "properties": [ + { + "name": "extract_binary_content", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "boolean", + "namespace": "_builtins" + } + } + }, + { + "name": "name", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + }, + { + "name": "reduce_whitespace", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "boolean", + "namespace": "_builtins" + } + } + }, + { + "name": "run_ml_inference", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "boolean", + "namespace": "_builtins" + } + } + } + ], + "specLocation": "connector/_types/Connector.ts#L148-L153" + }, + { + "kind": "interface", + "name": { + "name": "LessThanValidation", + "namespace": "connector._types" + }, + "properties": [ + { + "name": "type", + "required": true, + "type": { + "kind": "literal_value", + "value": "less_than" + } + }, + { + "name": "constraint", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "double", + "namespace": "_types" + } + } + } + ], + "specLocation": "connector/_types/Connector.ts#L58-L61" + }, + { + "kind": "interface", + "name": { + "name": "ListTypeValidation", + "namespace": "connector._types" + }, + "properties": [ + { + "name": "type", + "required": true, + "type": { + "kind": "literal_value", + "value": "list_type" + } + }, + { + "name": "constraint", + "required": true, + "type": { + "kind": "array_of", + "value": { + "kind": "instance_of", + "type": { + "name": "ScalarValue", + "namespace": "_types" + } + } + } + } + ], + "specLocation": "connector/_types/Connector.ts#L68-L71" + }, + { + "kind": "interface", + "name": { + "name": "RegexValidation", + "namespace": "connector._types" + }, + "properties": [ + { + "name": "type", + "required": true, + "type": { + "kind": "literal_value", + "value": "regex" + } + }, + { + "name": "constraint", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + } + ], + "specLocation": "connector/_types/Connector.ts#L78-L81" + }, + { + "kind": "interface", + "name": { + "name": "SelectOption", + "namespace": "connector._types" + }, + "properties": [ + { + "name": "label", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + }, + { + "name": "value", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + } + ], + "specLocation": "connector/_types/Connector.ts#L25-L28" + }, + { + "kind": "enum", + "members": [ + { + "name": "canceling" + }, + { + "name": "canceled" + }, + { + "name": "completed" + }, + { + "name": "error" + }, + { + "name": "in_progress" + }, + { + "name": "pending" + }, + { + "name": "suspended" + } + ], + "name": { + "name": "SyncStatus", + "namespace": "connector._types" + }, + "specLocation": "connector/_types/Connector.ts#L138-L146" + }, + { + "kind": "type_alias", + "name": { + "name": "Validation", + "namespace": "connector._types" + }, + "specLocation": "connector/_types/Connector.ts#L50-L56", + "type": { + "items": [ + { + "kind": "instance_of", + "type": { + "name": "LessThanValidation", + "namespace": "connector._types" + } + }, + { + "kind": "instance_of", + "type": { + "name": "GreaterThanValidation", + "namespace": "connector._types" + } + }, + { + "kind": "instance_of", + "type": { + "name": "ListTypeValidation", + "namespace": "connector._types" + } + }, + { + "kind": "instance_of", + "type": { + "name": "IncludedInValidation", + "namespace": "connector._types" + } + }, + { + "kind": "instance_of", + "type": { + "name": "RegexValidation", + "namespace": "connector._types" + } + } + ], + "kind": "union_of" + }, + "variants": { + "kind": "internal_tag", + "tag": "type" + } + }, + { + "kind": "interface", + "name": { + "name": "ConnectorSyncJob", + "namespace": "connector_sync_job._types" + }, + "properties": [ + { + "name": "cancelation_requested_at", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + }, + { + "name": "canceled_at", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + }, + { + "name": "completed_at", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + }, + { + "name": "connector", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "SyncJobConnectorReference", + "namespace": "connector_sync_job._types" + } + } + }, + { + "name": "created_at", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + }, + { + "name": "deleted_document_count", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "long", + "namespace": "_types" + } + } + }, + { + "name": "error", + "required": true, + "type": { + "generics": [ + { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + ], + "kind": "instance_of", + "type": { + "name": "WithNullValue", + "namespace": "_spec_utils" + } + } + }, + { + "name": "id", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "Id", + "namespace": "_types" + } + } + }, + { + "name": "indexed_document_count", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "long", + "namespace": "_types" + } + } + }, + { + "name": "indexed_document_volume", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "long", + "namespace": "_types" + } + } + }, + { + "name": "job_type", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "SyncJobType", + "namespace": "connector_sync_job._types" + } + } + }, + { + "name": "last_seen", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + }, + { + "name": "metadata", + "required": true, + "type": { + "key": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + }, + "kind": "dictionary_of", + "singleKey": false, + "value": { + "kind": "user_defined_value" + } + } + }, + { + "name": "started_at", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + }, + { + "name": "status", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "SyncStatus", + "namespace": "connector._types" + } + } + }, + { + "name": "total_document_count", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "long", + "namespace": "_types" + } + } + }, + { + "name": "trigger_method", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "TriggerMethod", + "namespace": "connector_sync_job._types" + } + } + }, + { + "name": "worker_hostname", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + } + ], + "specLocation": "connector_sync_job/_types/SyncJob.ts#L34-L53" + }, + { + "kind": "interface", + "name": { + "name": "SyncJobConnectorReference", + "namespace": "connector_sync_job._types" + }, + "properties": [ + { + "name": "configuration", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "ConnectorConfiguration", + "namespace": "connector._types" + } + } + }, + { + "name": "filtering", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "FilteringConfig", + "namespace": "connector._types" + } + } + }, + { + "name": "id", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "Id", + "namespace": "_types" + } + } + }, + { + "name": "index_name", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + }, + { + "name": "language", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + }, + { + "name": "pipeline", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "IngestPipelineParams", + "namespace": "connector._types" + } + } + }, + { + "name": "service_type", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + } + ], + "specLocation": "connector_sync_job/_types/SyncJob.ts#L13-L21" + }, + { + "kind": "enum", + "members": [ + { + "name": "full" + }, + { + "name": "incremental" + }, + { + "name": "access_control" + } + ], + "name": { + "name": "SyncJobType", + "namespace": "connector_sync_job._types" + }, + "specLocation": "connector_sync_job/_types/SyncJob.ts#L23-L27" + }, + { + "kind": "enum", + "members": [ + { + "name": "on_demand" + }, + { + "name": "scheduled" + } + ], + "name": { + "name": "TriggerMethod", + "namespace": "connector_sync_job._types" + }, + "specLocation": "connector_sync_job/_types/SyncJob.ts#L29-L32" + }, + { + "attachedBehaviors": [ + "CommonQueryParameters" + ], + "body": { + "kind": "no_body" + }, + "description": "Cancels a connector sync job.", + "inherits": { + "type": { + "name": "RequestBase", + "namespace": "_types" + } + }, + "kind": "request", + "name": { + "name": "Request", + "namespace": "connector_sync_job.cancel" + }, + "path": [ + { + "description": "The unique identifier of the connector sync job", + "name": "connector_sync_job_id", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "Id", + "namespace": "_types" + } + } + } + ], + "query": [], + "specLocation": "connector_sync_job/cancel/SyncJobCancelRequest.ts#L22-L36" + }, + { + "body": { + "kind": "properties", + "properties": [ + { + "name": "result", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "Result", + "namespace": "_types" + } + } + } + ] + }, + "kind": "response", + "name": { + "name": "Response", + "namespace": "connector_sync_job.cancel" + }, + "specLocation": "connector_sync_job/cancel/SyncJobCancelResponse.ts#L22-L26" + }, + { + "attachedBehaviors": [ + "CommonQueryParameters" + ], + "body": { + "kind": "no_body" + }, + "description": "Deletes a sync job.", + "inherits": { + "type": { + "name": "RequestBase", + "namespace": "_types" + } + }, + "kind": "request", + "name": { + "name": "Request", + "namespace": "connector_sync_job.delete" + }, + "path": [ + { + "description": "The unique identifier of the connector sync job to be deleted", + "name": "connector_sync_job_id", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "Id", + "namespace": "_types" + } + } + } + ], + "query": [], + "specLocation": "connector_sync_job/delete/SyncJobDeleteRequest.ts#L22-L36" + }, + { + "body": { + "kind": "value", + "value": { + "kind": "instance_of", + "type": { + "name": "AcknowledgedResponseBase", + "namespace": "_types" + } + } + }, + "kind": "response", + "name": { + "name": "Response", + "namespace": "connector_sync_job.delete" + }, + "specLocation": "connector_sync_job/delete/SyncJobDeleteResponse.ts#L22-L24" + }, + { + "attachedBehaviors": [ + "CommonQueryParameters" + ], + "body": { + "kind": "no_body" + }, + "description": "Retrieves a connector sync job.", + "inherits": { + "type": { + "name": "RequestBase", + "namespace": "_types" + } + }, + "kind": "request", + "name": { + "name": "Request", + "namespace": "connector_sync_job.get" + }, + "path": [ + { + "description": "The unique identifier of the connector sync job", + "name": "connector_sync_job_id", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "Id", + "namespace": "_types" + } + } + } + ], + "query": [], + "specLocation": "connector_sync_job/get/SyncJobGetRequest.ts#L22-L36" + }, + { + "body": { + "kind": "value", + "value": { + "kind": "instance_of", + "type": { + "name": "ConnectorSyncJob", + "namespace": "connector_sync_job._types" + } + } + }, + "kind": "response", + "name": { + "name": "Response", + "namespace": "connector_sync_job.get" + }, + "specLocation": "connector_sync_job/get/SyncJobGetResponse.ts#L22-L24" + }, + { + "attachedBehaviors": [ + "CommonQueryParameters" + ], + "body": { + "kind": "no_body" + }, + "description": "Lists connector sync jobs.", + "inherits": { + "type": { + "name": "RequestBase", + "namespace": "_types" + } + }, + "kind": "request", + "name": { + "name": "Request", + "namespace": "connector_sync_job.list" + }, + "path": [], + "query": [ + { + "description": "Starting offset (default: 0)", + "name": "from", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "integer", + "namespace": "_types" + } + } + }, + { + "description": "Specifies a max number of results to get", + "name": "size", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "integer", + "namespace": "_types" + } + } + }, + { + "description": "A sync job status to fetch connector sync jobs for", + "name": "status", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + }, + { + "description": "A connector id to fetch connector sync jobs for", + "name": "connector_id", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "Id", + "namespace": "_types" + } + } + }, + { + "description": "A comma-separated list of job types to fetch the sync jobs for", + "name": "job_type", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "Fields", + "namespace": "_types" + } + } + } + ], + "specLocation": "connector_sync_job/list/SyncJobListRequest.ts#L23-L53" + }, + { + "body": { + "kind": "properties", + "properties": [ + { + "name": "count", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "long", + "namespace": "_types" + } + } + }, + { + "name": "results", + "required": true, + "type": { + "kind": "array_of", + "value": { + "kind": "instance_of", + "type": { + "name": "ConnectorSyncJob", + "namespace": "connector_sync_job._types" + } + } + } + } + ] + }, + "kind": "response", + "name": { + "name": "Response", + "namespace": "connector_sync_job.list" + }, + "specLocation": "connector_sync_job/list/SyncJobListResponse.ts#L23-L28" + }, + { + "attachedBehaviors": [ + "CommonQueryParameters" + ], + "body": { + "kind": "properties", + "properties": [ + { + "name": "id", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "Id", + "namespace": "_types" + } + } + }, + { + "name": "job_type", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + }, + { + "name": "trigger_method", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + } + ] + }, + "description": "Creates a connector sync job.", + "inherits": { + "type": { + "name": "RequestBase", + "namespace": "_types" + } + }, + "kind": "request", + "name": { + "name": "Request", + "namespace": "connector_sync_job.post" + }, + "path": [], + "query": [], + "specLocation": "connector_sync_job/post/SyncJobPostRequest.ts#L23-L40" + }, + { + "body": { + "kind": "properties", + "properties": [ + { + "name": "id", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "Id", + "namespace": "_types" + } + } + } + ] + }, + "kind": "response", + "name": { + "name": "Response", + "namespace": "connector_sync_job.post" + }, + "specLocation": "connector_sync_job/post/SyncJobPostResponse.ts#L22-L26" + }, { "attachedBehaviors": [ "CommonQueryParameters" diff --git a/output/schema/validation-errors.json b/output/schema/validation-errors.json index 1b8b94e75b..6a696f13dd 100644 --- a/output/schema/validation-errors.json +++ b/output/schema/validation-errors.json @@ -482,6 +482,18 @@ "response definition cluster.put_component_template:Response / body / instance_of - Non-leaf type cannot be used here: '_types:AcknowledgedResponseBase'" ] }, + "connector_sync_job.delete": { + "request": [], + "response": [ + "response definition connector_sync_job.delete:Response / body / instance_of - Non-leaf type cannot be used here: '_types:AcknowledgedResponseBase'" + ] + }, + "connector_sync_job.get": { + "request": [], + "response": [ + "type_alias definition _spec_utils:WithNullValue / union_of / instance_of - No type definition for '_spec_utils:T'" + ] + }, "create": { "request": [], "response": [ diff --git a/output/typescript/types.ts b/output/typescript/types.ts index ec81d6868f..4a05044e9a 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -2027,12 +2027,16 @@ export interface SpecUtilsBaseNode { transport_address: TransportAddress } +export type SpecUtilsNullValue = null + export type SpecUtilsPipeSeparatedFlags = T | string export type SpecUtilsStringified = T | string export type SpecUtilsVoid = void +export type SpecUtilsWithNullValue = T | SpecUtilsNullValue + export interface AcknowledgedResponseBase { acknowledged: boolean } @@ -9066,6 +9070,201 @@ export interface ClusterStatsStatsResponseBase extends NodesNodesResponseBase { timestamp: long } +export interface ConnectorConnectorConfigProperties { + category?: string + default_value: ScalarValue + depends_on: ConnectorDependency[] + display: ConnectorDisplayType + label: string + options: ConnectorSelectOption[] + order?: integer + placeholder?: string + required: boolean + sensitive: boolean + tooltip?: string + type: ConnectorConnectorFieldType + ui_restrictions: string[] + validations: ConnectorValidation[] + value: ScalarValue +} + +export type ConnectorConnectorConfiguration = Record + +export type ConnectorConnectorFieldType = 'str' | 'int' | 'list' | 'bool' + +export interface ConnectorDependency { + field: string + value: ScalarValue +} + +export type ConnectorDisplayType = 'textbox' | 'textarea' | 'numeric' | 'toggle' | 'dropdown' + +export interface ConnectorFilteringAdvancedSnippet { + created_at: string + updated_at: string + value: Record +} + +export interface ConnectorFilteringConfig { + active: ConnectorFilteringRules + domain: string + draft: ConnectorFilteringRules +} + +export type ConnectorFilteringPolicy = 'exclude' | 'include' + +export interface ConnectorFilteringRule { + created_at: string + field: string + id: string + order: integer + policy: ConnectorFilteringPolicy + rule: ConnectorFilteringRuleRule + updated_at: string + value: string +} + +export type ConnectorFilteringRuleRule = 'contains' | 'ends_with' | 'equals' | 'regex' | 'starts_with' | '>' | '<' + +export interface ConnectorFilteringRules { + advanced_snippet: ConnectorFilteringAdvancedSnippet + rules: ConnectorFilteringRule[] + validation: ConnectorFilteringRulesValidation +} + +export interface ConnectorFilteringRulesValidation { + errors: ConnectorFilteringValidation[] + state: ConnectorFilteringValidationState +} + +export interface ConnectorFilteringValidation { + ids: string[] + messages: string[] +} + +export type ConnectorFilteringValidationState = 'edited' | 'invalid' | 'valid' + +export interface ConnectorGreaterThanValidation { + type: 'greater_than' + constraint: double +} + +export interface ConnectorIncludedInValidation { + type: 'included_in' + constraint: string +} + +export interface ConnectorIngestPipelineParams { + extract_binary_content: boolean + name: string + reduce_whitespace: boolean + run_ml_inference: boolean +} + +export interface ConnectorLessThanValidation { + type: 'less_than' + constraint: double +} + +export interface ConnectorListTypeValidation { + type: 'list_type' + constraint: ScalarValue[] +} + +export interface ConnectorRegexValidation { + type: 'regex' + constraint: string +} + +export interface ConnectorSelectOption { + label: string + value: string +} + +export type ConnectorSyncStatus = 'canceling' | 'canceled' | 'completed' | 'error' | 'in_progress' | 'pending' | 'suspended' + +export type ConnectorValidation = ConnectorLessThanValidation | ConnectorGreaterThanValidation | ConnectorListTypeValidation | ConnectorIncludedInValidation | ConnectorRegexValidation + +export interface ConnectorSyncJobConnectorSyncJob { + cancelation_requested_at?: string + canceled_at?: string + completed_at?: string + connector: ConnectorSyncJobSyncJobConnectorReference + created_at: string + deleted_document_count: long + error: SpecUtilsWithNullValue + id: Id + indexed_document_count: long + indexed_document_volume: long + job_type: ConnectorSyncJobSyncJobType + last_seen?: string + metadata: Record + started_at?: string + status: ConnectorSyncStatus + total_document_count?: long + trigger_method: ConnectorSyncJobTriggerMethod + worker_hostname?: string +} + +export interface ConnectorSyncJobSyncJobConnectorReference { + configuration: ConnectorConnectorConfiguration + filtering: ConnectorFilteringConfig + id: Id + index_name: string + language?: string + pipeline: ConnectorIngestPipelineParams + service_type: string +} + +export type ConnectorSyncJobSyncJobType = 'full' | 'incremental' | 'access_control' + +export type ConnectorSyncJobTriggerMethod = 'on_demand' | 'scheduled' + +export interface ConnectorSyncJobCancelRequest extends RequestBase { + connector_sync_job_id: Id +} + +export interface ConnectorSyncJobCancelResponse { + result: Result +} + +export interface ConnectorSyncJobDeleteRequest extends RequestBase { + connector_sync_job_id: Id +} + +export type ConnectorSyncJobDeleteResponse = AcknowledgedResponseBase + +export interface ConnectorSyncJobGetRequest extends RequestBase { + connector_sync_job_id: Id +} + +export type ConnectorSyncJobGetResponse = ConnectorSyncJobConnectorSyncJob + +export interface ConnectorSyncJobListRequest extends RequestBase { + from?: integer + size?: integer + status?: string + connector_id?: Id + job_type?: Fields +} + +export interface ConnectorSyncJobListResponse { + count: long + results: ConnectorSyncJobConnectorSyncJob[] +} + +export interface ConnectorSyncJobPostRequest extends RequestBase { + body?: { + id: Id + job_type?: string + trigger_method?: string + } +} + +export interface ConnectorSyncJobPostResponse { + id: Id +} + export interface DanglingIndicesDeleteDanglingIndexRequest extends RequestBase { index_uuid: Uuid accept_data_loss: boolean diff --git a/specification/_doc_ids/table.csv b/specification/_doc_ids/table.csv index 7d74196563..0cecf564de 100644 --- a/specification/_doc_ids/table.csv +++ b/specification/_doc_ids/table.csv @@ -78,6 +78,11 @@ cluster-stats,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/c cluster-update-settings,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/cluster-update-settings.html cluster,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/cluster.html common-options,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/common-options.html +connector-sync-job-cancel,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/cancel-connector-sync-job-api.html +connector-sync-job-delete,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/delete-connector-sync-job-api.html +connector-sync-job-get,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/get-connector-sync-job-api.html +connector-sync-job-post,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/create-connector-sync-job-api.html +connector-sync-job-list,https://www.elastic.co/guide/en/elasticsearch/reference/{list}/list-connector-sync-jobs-api.html convert-processor,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/convert-processor.html cron-expressions,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/api-conventions.html#api-cron-expressions csv-processor,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/csv-processor.html diff --git a/specification/_json_spec/connector_sync_job.cancel.json b/specification/_json_spec/connector_sync_job.cancel.json index 1e8cf154cf..00571ef9e9 100644 --- a/specification/_json_spec/connector_sync_job.cancel.json +++ b/specification/_json_spec/connector_sync_job.cancel.json @@ -7,17 +7,13 @@ "stability": "experimental", "visibility": "public", "headers": { - "accept": [ - "application/json" - ] + "accept": ["application/json"] }, "url": { "paths": [ { "path": "/_connector/_sync_job/{connector_sync_job_id}/_cancel", - "methods": [ - "PUT" - ], + "methods": ["PUT"], "parts": { "connector_sync_job_id": { "type": "string", diff --git a/specification/_json_spec/connector_sync_job.delete.json b/specification/_json_spec/connector_sync_job.delete.json index 11894a48db..45b737763f 100644 --- a/specification/_json_spec/connector_sync_job.delete.json +++ b/specification/_json_spec/connector_sync_job.delete.json @@ -7,17 +7,13 @@ "stability": "experimental", "visibility": "public", "headers": { - "accept": [ - "application/json" - ] + "accept": ["application/json"] }, "url": { "paths": [ { "path": "/_connector/_sync_job/{connector_sync_job_id}", - "methods": [ - "DELETE" - ], + "methods": ["DELETE"], "parts": { "connector_sync_job_id": { "type": "string", diff --git a/specification/_json_spec/connector_sync_job.get.json b/specification/_json_spec/connector_sync_job.get.json index 6dd29069ba..48e596c969 100644 --- a/specification/_json_spec/connector_sync_job.get.json +++ b/specification/_json_spec/connector_sync_job.get.json @@ -7,17 +7,13 @@ "stability": "experimental", "visibility": "public", "headers": { - "accept": [ - "application/json" - ] + "accept": ["application/json"] }, "url": { "paths": [ { "path": "/_connector/_sync_job/{connector_sync_job_id}", - "methods": [ - "GET" - ], + "methods": ["GET"], "parts": { "connector_sync_job_id": { "type": "string", diff --git a/specification/_json_spec/connector_sync_job.list.json b/specification/_json_spec/connector_sync_job.list.json index 6b5a43d167..3e8ca5bc9c 100644 --- a/specification/_json_spec/connector_sync_job.list.json +++ b/specification/_json_spec/connector_sync_job.list.json @@ -7,17 +7,13 @@ "stability": "experimental", "visibility": "public", "headers": { - "accept": [ - "application/json" - ] + "accept": ["application/json"] }, "url": { "paths": [ { "path": "/_connector/_sync_job", - "methods": [ - "GET" - ] + "methods": ["GET"] } ] }, diff --git a/specification/_json_spec/connector_sync_job.post.json b/specification/_json_spec/connector_sync_job.post.json index 8050b34014..33e34b7b92 100644 --- a/specification/_json_spec/connector_sync_job.post.json +++ b/specification/_json_spec/connector_sync_job.post.json @@ -7,20 +7,14 @@ "stability": "experimental", "visibility": "public", "headers": { - "accept": [ - "application/json" - ], - "content_type": [ - "application/json" - ] + "accept": ["application/json"], + "content_type": ["application/json"] }, "url": { "paths": [ { "path": "/_connector/_sync_job", - "methods": [ - "POST" - ] + "methods": ["POST"] } ] }, diff --git a/specification/connector/_types/Connector.ts b/specification/connector/_types/Connector.ts new file mode 100644 index 0000000000..7b2874d984 --- /dev/null +++ b/specification/connector/_types/Connector.ts @@ -0,0 +1,267 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +import { Id, ScalarValue } from '@_types/common' +import { double, integer, long } from '@_types/Numeric' +import { Dictionary } from '@spec_utils/Dictionary' +import { UserDefinedValue } from '@spec_utils/UserDefinedValue' +import { WithNullValue } from '@spec_utils/utils' + +interface SelectOption { + label: string + value: string +} + +interface Dependency { + field: string + value: ScalarValue +} + +enum DisplayType { + textbox, + textarea, + numeric, + toggle, + dropdown +} + +enum ConnectorFieldType { + str, + int, + list, + bool +} + +/** @variants internal tag='type' */ +type Validation = + | LessThanValidation + | GreaterThanValidation + | ListTypeValidation + | IncludedInValidation + | RegexValidation + +export interface LessThanValidation { + type: 'less_than' + constraint: double +} + +export interface GreaterThanValidation { + type: 'greater_than' + constraint: double +} + +export interface ListTypeValidation { + type: 'list_type' + constraint: ScalarValue[] +} + +export interface IncludedInValidation { + type: 'included_in' + constraint: string +} + +export interface RegexValidation { + type: 'regex' + constraint: string +} + +export interface ConnectorConfigProperties { + category?: string + default_value: ScalarValue + depends_on: Dependency[] + display: DisplayType + label: string + options: SelectOption[] + order?: integer + placeholder?: string + required: boolean + sensitive: boolean + tooltip?: string + type: ConnectorFieldType + ui_restrictions: string[] + validations: Validation[] + value: ScalarValue +} + +export type ConnectorConfiguration = Dictionary< + string, + ConnectorConfigProperties +> + +export interface ConnectorScheduling { + enabled: boolean + /** The interval is expressed using the crontab syntax */ + interval: string +} + +interface CustomSchedulingConfigurationOverrides { + max_crawl_depth?: integer + sitemap_discovery_disabled?: boolean + domain_allowlist?: string[] + sitemap_urls?: string[] + seed_urls?: string[] +} + +interface CustomScheduling { + configuration_overrides: CustomSchedulingConfigurationOverrides + enabled: boolean + interval: string + last_synced?: string + name: string +} + +export type ConnectorCustomScheduling = Dictionary + +export enum ConnectorStatus { + created, + needs_configuration, + configured, + connected, + error +} + +export enum SyncStatus { + canceling, + canceled, + completed, + error, + in_progress, + pending, + suspended +} + +export interface IngestPipelineParams { + extract_binary_content: boolean + name: string + reduce_whitespace: boolean + run_ml_inference: boolean +} + +enum FilteringPolicy { + exclude, + include +} + +enum FilteringRuleRule { + contains, + ends_with, + equals, + regex, + starts_with, + greater_than = '>', + less_than = '<' +} + +interface FilteringRule { + created_at: string + field: string + id: string + order: integer + policy: FilteringPolicy + rule: FilteringRuleRule + updated_at: string + value: string +} + +interface FilteringValidation { + ids: string[] + messages: string[] +} + +enum FilteringValidationState { + edited, + invalid, + valid +} + +interface FilteringAdvancedSnippet { + created_at: string + updated_at: string + value: Dictionary +} + +interface FilteringRulesValidation { + errors: FilteringValidation[] + state: FilteringValidationState +} + +interface FilteringRules { + advanced_snippet: FilteringAdvancedSnippet + rules: FilteringRule[] + validation: FilteringRulesValidation +} + +export interface FilteringConfig { + active: FilteringRules + domain: string + draft: FilteringRules +} + +interface FeatureEnabled { + enabled: boolean +} + +interface SyncRulesFeature { + advanced?: FeatureEnabled + basic?: FeatureEnabled +} + +export interface ConnectorFeatures { + document_level_security?: FeatureEnabled + filtering_advanced_config?: boolean + filtering_rules?: boolean + incremental_sync?: FeatureEnabled + sync_rules?: SyncRulesFeature +} + +export interface SchedulingConfiguration { + access_control?: ConnectorScheduling + full?: ConnectorScheduling + incremental?: ConnectorScheduling +} + +export interface Connector { + api_key_id?: string + configuration: ConnectorConfiguration + custom_scheduling: ConnectorCustomScheduling + description?: string + error: WithNullValue + features: ConnectorFeatures + filtering: FilteringConfig[] + id?: Id + index_name: WithNullValue + is_native: boolean + language?: string + last_access_control_sync_error?: WithNullValue + last_access_control_sync_scheduled_at?: string + last_access_control_sync_status?: SyncStatus + last_deleted_document_count?: long + last_incremental_sync_scheduled_at?: string + last_indexed_document_count?: long + last_seen?: WithNullValue + last_sync_error?: WithNullValue + last_sync_scheduled_at?: string + last_sync_status?: SyncStatus + last_synced?: string + name?: string + pipeline?: IngestPipelineParams + scheduling: SchedulingConfiguration + service_type: string + status: ConnectorStatus + sync_now: boolean +} diff --git a/specification/connector_sync_job/_types/SyncJob.ts b/specification/connector_sync_job/_types/SyncJob.ts new file mode 100644 index 0000000000..3ba49663b9 --- /dev/null +++ b/specification/connector_sync_job/_types/SyncJob.ts @@ -0,0 +1,53 @@ +import { Id } from '@_types/common' +import { long } from '@_types/Numeric' +import { Dictionary } from '@spec_utils/Dictionary' +import { UserDefinedValue } from '@spec_utils/UserDefinedValue' +import { WithNullValue } from '@spec_utils/utils' +import { + ConnectorConfiguration, + FilteringConfig, + IngestPipelineParams, + SyncStatus +} from '../../connector/_types/Connector' + +interface SyncJobConnectorReference { + configuration: ConnectorConfiguration + filtering: FilteringConfig + id: Id + index_name: string + language?: string + pipeline: IngestPipelineParams + service_type: string +} + +enum SyncJobType { + full, + incremental, + access_control +} + +enum TriggerMethod { + on_demand, + scheduled +} + +export interface ConnectorSyncJob { + cancelation_requested_at?: string + canceled_at?: string + completed_at?: string + connector: SyncJobConnectorReference + created_at: string + deleted_document_count: long + error: WithNullValue + id: Id + indexed_document_count: long + indexed_document_volume: long + job_type: SyncJobType + last_seen?: string + metadata: Dictionary + started_at?: string + status: SyncStatus + total_document_count?: long + trigger_method: TriggerMethod + worker_hostname?: string +} diff --git a/specification/connector_sync_job/cancel/SyncJobCancelRequest.ts b/specification/connector_sync_job/cancel/SyncJobCancelRequest.ts new file mode 100644 index 0000000000..781e16882c --- /dev/null +++ b/specification/connector_sync_job/cancel/SyncJobCancelRequest.ts @@ -0,0 +1,36 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +import { RequestBase } from '@_types/Base' +import { Id } from '@_types/common' + +/** + * Cancels a connector sync job. + * @rest_spec_name connector_sync_job.cancel + * @availability stack since=8.12.0 stability=experimental + * @availability serverless stability=experimental visibility=public + * @doc_id connector-sync-job-cancel + */ +export interface Request extends RequestBase { + path_parts: { + /** + * The unique identifier of the connector sync job + */ + connector_sync_job_id: Id + } +} diff --git a/specification/connector_sync_job/cancel/SyncJobCancelResponse.ts b/specification/connector_sync_job/cancel/SyncJobCancelResponse.ts new file mode 100644 index 0000000000..fc194d6f20 --- /dev/null +++ b/specification/connector_sync_job/cancel/SyncJobCancelResponse.ts @@ -0,0 +1,26 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import { Result } from '@_types/Result' + +export class Response { + body: { + result: Result + } +} diff --git a/specification/connector_sync_job/delete/SyncJobDeleteRequest.ts b/specification/connector_sync_job/delete/SyncJobDeleteRequest.ts new file mode 100644 index 0000000000..c5ba975d8f --- /dev/null +++ b/specification/connector_sync_job/delete/SyncJobDeleteRequest.ts @@ -0,0 +1,36 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +import { RequestBase } from '@_types/Base' +import { Id } from '@_types/common' + +/** + * Deletes a sync job. + * @rest_spec_name connector_sync_job.delete + * @availability stack since=8.12.0 stability=experimental + * @availability serverless stability=experimental visibility=public + * @doc_id connector-sync-job-delete + */ +export interface Request extends RequestBase { + path_parts: { + /** + * The unique identifier of the connector sync job to be deleted + */ + connector_sync_job_id: Id + } +} diff --git a/specification/connector_sync_job/delete/SyncJobDeleteResponse.ts b/specification/connector_sync_job/delete/SyncJobDeleteResponse.ts new file mode 100644 index 0000000000..7374da4a4c --- /dev/null +++ b/specification/connector_sync_job/delete/SyncJobDeleteResponse.ts @@ -0,0 +1,24 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import { AcknowledgedResponseBase } from '@_types/Base' + +export class Response { + body: AcknowledgedResponseBase +} diff --git a/specification/connector_sync_job/get/SyncJobGetRequest.ts b/specification/connector_sync_job/get/SyncJobGetRequest.ts new file mode 100644 index 0000000000..f6cd2b46df --- /dev/null +++ b/specification/connector_sync_job/get/SyncJobGetRequest.ts @@ -0,0 +1,36 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +import { RequestBase } from '@_types/Base' +import { Id } from '@_types/common' + +/** + * Retrieves a connector sync job. + * @rest_spec_name connector_sync_job.get + * @availability stack since=8.12.0 stability=experimental + * @availability serverless stability=experimental visibility=public + * @doc_id connector-sync-job-get + */ +export interface Request extends RequestBase { + path_parts: { + /** + * The unique identifier of the connector sync job + */ + connector_sync_job_id: Id + } +} diff --git a/specification/connector_sync_job/get/SyncJobGetResponse.ts b/specification/connector_sync_job/get/SyncJobGetResponse.ts new file mode 100644 index 0000000000..d99c57ee7f --- /dev/null +++ b/specification/connector_sync_job/get/SyncJobGetResponse.ts @@ -0,0 +1,24 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import { ConnectorSyncJob } from '../_types/SyncJob' + +export class Response { + body: ConnectorSyncJob +} diff --git a/specification/connector_sync_job/list/SyncJobListRequest.ts b/specification/connector_sync_job/list/SyncJobListRequest.ts new file mode 100644 index 0000000000..8b40dc8df5 --- /dev/null +++ b/specification/connector_sync_job/list/SyncJobListRequest.ts @@ -0,0 +1,53 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +import { RequestBase } from '@_types/Base' +import { Fields, Id } from '@_types/common' +import { integer } from '@_types/Numeric' + +/** + * Lists connector sync jobs. + * @rest_spec_name connector_sync_job.list + * @availability stack since=8.12.0 stability=experimental + * @availability serverless stability=experimental visibility=public + * @doc_id connector-sync-job-list + */ +export interface Request extends RequestBase { + query_parameters: { + /** + * Starting offset (default: 0) + */ + from?: integer + /** + * Specifies a max number of results to get + */ + size?: integer + /** + * A sync job status to fetch connector sync jobs for + */ + status?: string + /** + * A connector id to fetch connector sync jobs for + */ + connector_id?: Id + /** + * A comma-separated list of job types to fetch the sync jobs for + */ + job_type?: Fields + } +} diff --git a/specification/connector_sync_job/list/SyncJobListResponse.ts b/specification/connector_sync_job/list/SyncJobListResponse.ts new file mode 100644 index 0000000000..f695d6fab6 --- /dev/null +++ b/specification/connector_sync_job/list/SyncJobListResponse.ts @@ -0,0 +1,28 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import { long } from '@_types/Numeric' +import { ConnectorSyncJob } from '../_types/SyncJob' + +export class Response { + body: { + count: long + results: ConnectorSyncJob[] + } +} diff --git a/specification/connector_sync_job/post/SyncJobPostRequest.ts b/specification/connector_sync_job/post/SyncJobPostRequest.ts new file mode 100644 index 0000000000..9d8f9d5f24 --- /dev/null +++ b/specification/connector_sync_job/post/SyncJobPostRequest.ts @@ -0,0 +1,40 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +import { RequestBase } from '@_types/Base' +import { Id } from '@_types/common' +import { WithNullValue } from '@spec_utils/utils' + +/** + * Creates a connector sync job. + * @rest_spec_name connector_sync_job.post + * @availability stack since=8.12.0 stability=experimental + * @availability serverless stability=experimental visibility=public + * @doc_id connector-sync-job-post + */ +export interface Request extends RequestBase { + /** + * The sync job to be created + */ + /** @codegen_name sync_job */ + body: { + id: Id + job_type?: string + trigger_method?: string + } +} diff --git a/specification/connector_sync_job/post/SyncJobPostResponse.ts b/specification/connector_sync_job/post/SyncJobPostResponse.ts new file mode 100644 index 0000000000..69e3a38113 --- /dev/null +++ b/specification/connector_sync_job/post/SyncJobPostResponse.ts @@ -0,0 +1,26 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import { Id } from '@_types/common' + +export class Response { + body: { + id: Id + } +} From 6a35f12d15352f7b4644501b7b39a5b598a29a0d Mon Sep 17 00:00:00 2001 From: Jedr Blaszyk Date: Thu, 11 Apr 2024 13:53:22 +0200 Subject: [PATCH 3/8] Prepare to merge with main --- specification/connector/_types/Connector.ts | 267 -------------------- 1 file changed, 267 deletions(-) delete mode 100644 specification/connector/_types/Connector.ts diff --git a/specification/connector/_types/Connector.ts b/specification/connector/_types/Connector.ts deleted file mode 100644 index 7b2874d984..0000000000 --- a/specification/connector/_types/Connector.ts +++ /dev/null @@ -1,267 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -import { Id, ScalarValue } from '@_types/common' -import { double, integer, long } from '@_types/Numeric' -import { Dictionary } from '@spec_utils/Dictionary' -import { UserDefinedValue } from '@spec_utils/UserDefinedValue' -import { WithNullValue } from '@spec_utils/utils' - -interface SelectOption { - label: string - value: string -} - -interface Dependency { - field: string - value: ScalarValue -} - -enum DisplayType { - textbox, - textarea, - numeric, - toggle, - dropdown -} - -enum ConnectorFieldType { - str, - int, - list, - bool -} - -/** @variants internal tag='type' */ -type Validation = - | LessThanValidation - | GreaterThanValidation - | ListTypeValidation - | IncludedInValidation - | RegexValidation - -export interface LessThanValidation { - type: 'less_than' - constraint: double -} - -export interface GreaterThanValidation { - type: 'greater_than' - constraint: double -} - -export interface ListTypeValidation { - type: 'list_type' - constraint: ScalarValue[] -} - -export interface IncludedInValidation { - type: 'included_in' - constraint: string -} - -export interface RegexValidation { - type: 'regex' - constraint: string -} - -export interface ConnectorConfigProperties { - category?: string - default_value: ScalarValue - depends_on: Dependency[] - display: DisplayType - label: string - options: SelectOption[] - order?: integer - placeholder?: string - required: boolean - sensitive: boolean - tooltip?: string - type: ConnectorFieldType - ui_restrictions: string[] - validations: Validation[] - value: ScalarValue -} - -export type ConnectorConfiguration = Dictionary< - string, - ConnectorConfigProperties -> - -export interface ConnectorScheduling { - enabled: boolean - /** The interval is expressed using the crontab syntax */ - interval: string -} - -interface CustomSchedulingConfigurationOverrides { - max_crawl_depth?: integer - sitemap_discovery_disabled?: boolean - domain_allowlist?: string[] - sitemap_urls?: string[] - seed_urls?: string[] -} - -interface CustomScheduling { - configuration_overrides: CustomSchedulingConfigurationOverrides - enabled: boolean - interval: string - last_synced?: string - name: string -} - -export type ConnectorCustomScheduling = Dictionary - -export enum ConnectorStatus { - created, - needs_configuration, - configured, - connected, - error -} - -export enum SyncStatus { - canceling, - canceled, - completed, - error, - in_progress, - pending, - suspended -} - -export interface IngestPipelineParams { - extract_binary_content: boolean - name: string - reduce_whitespace: boolean - run_ml_inference: boolean -} - -enum FilteringPolicy { - exclude, - include -} - -enum FilteringRuleRule { - contains, - ends_with, - equals, - regex, - starts_with, - greater_than = '>', - less_than = '<' -} - -interface FilteringRule { - created_at: string - field: string - id: string - order: integer - policy: FilteringPolicy - rule: FilteringRuleRule - updated_at: string - value: string -} - -interface FilteringValidation { - ids: string[] - messages: string[] -} - -enum FilteringValidationState { - edited, - invalid, - valid -} - -interface FilteringAdvancedSnippet { - created_at: string - updated_at: string - value: Dictionary -} - -interface FilteringRulesValidation { - errors: FilteringValidation[] - state: FilteringValidationState -} - -interface FilteringRules { - advanced_snippet: FilteringAdvancedSnippet - rules: FilteringRule[] - validation: FilteringRulesValidation -} - -export interface FilteringConfig { - active: FilteringRules - domain: string - draft: FilteringRules -} - -interface FeatureEnabled { - enabled: boolean -} - -interface SyncRulesFeature { - advanced?: FeatureEnabled - basic?: FeatureEnabled -} - -export interface ConnectorFeatures { - document_level_security?: FeatureEnabled - filtering_advanced_config?: boolean - filtering_rules?: boolean - incremental_sync?: FeatureEnabled - sync_rules?: SyncRulesFeature -} - -export interface SchedulingConfiguration { - access_control?: ConnectorScheduling - full?: ConnectorScheduling - incremental?: ConnectorScheduling -} - -export interface Connector { - api_key_id?: string - configuration: ConnectorConfiguration - custom_scheduling: ConnectorCustomScheduling - description?: string - error: WithNullValue - features: ConnectorFeatures - filtering: FilteringConfig[] - id?: Id - index_name: WithNullValue - is_native: boolean - language?: string - last_access_control_sync_error?: WithNullValue - last_access_control_sync_scheduled_at?: string - last_access_control_sync_status?: SyncStatus - last_deleted_document_count?: long - last_incremental_sync_scheduled_at?: string - last_indexed_document_count?: long - last_seen?: WithNullValue - last_sync_error?: WithNullValue - last_sync_scheduled_at?: string - last_sync_status?: SyncStatus - last_synced?: string - name?: string - pipeline?: IngestPipelineParams - scheduling: SchedulingConfiguration - service_type: string - status: ConnectorStatus - sync_now: boolean -} From 7cbe82d4c1d9afb5ce935da06d9b22228019c22e Mon Sep 17 00:00:00 2001 From: Jedr Blaszyk Date: Thu, 11 Apr 2024 14:13:30 +0200 Subject: [PATCH 4/8] Adjust types, merge with Connector API --- .../elasticsearch-serverless-openapi.json | 11 +++-- output/schema/schema.json | 42 ++++++++----------- output/typescript/types.ts | 10 ++--- .../connector_sync_job/_types/SyncJob.ts | 3 +- .../delete/SyncJobDeleteRequest.ts | 2 +- .../list/SyncJobListRequest.ts | 6 +-- .../post/SyncJobPostRequest.ts | 10 +++-- 7 files changed, 38 insertions(+), 46 deletions(-) diff --git a/output/openapi/elasticsearch-serverless-openapi.json b/output/openapi/elasticsearch-serverless-openapi.json index 53f123574b..53ce0a5e67 100644 --- a/output/openapi/elasticsearch-serverless-openapi.json +++ b/output/openapi/elasticsearch-serverless-openapi.json @@ -3135,7 +3135,7 @@ "description": "A sync job status to fetch connector sync jobs for", "deprecated": false, "schema": { - "type": "string" + "$ref": "#/components/schemas/_types:Name" }, "style": "form" }, @@ -3155,7 +3155,7 @@ "description": "A comma-separated list of job types to fetch the sync jobs for", "deprecated": false, "schema": { - "$ref": "#/components/schemas/_types:Fields" + "$ref": "#/components/schemas/_types:Names" }, "style": "form" } @@ -3208,10 +3208,10 @@ "$ref": "#/components/schemas/_types:Id" }, "job_type": { - "type": "string" + "$ref": "#/components/schemas/_types:Name" }, "trigger_method": { - "type": "string" + "$ref": "#/components/schemas/_types:Name" } }, "required": [ @@ -50189,7 +50189,7 @@ "type": "number" }, "error": { - "$ref": "#/components/schemas/_spec_utils:WithNullValuestring" + "type": "string" }, "id": { "$ref": "#/components/schemas/_types:Id" @@ -50232,7 +50232,6 @@ "connector", "created_at", "deleted_document_count", - "error", "id", "indexed_document_count", "indexed_document_volume", diff --git a/output/schema/schema.json b/output/schema/schema.json index 30e41ac289..7681b6abbc 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -109171,21 +109171,12 @@ }, { "name": "error", - "required": true, + "required": false, "type": { - "generics": [ - { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "_builtins" - } - } - ], "kind": "instance_of", "type": { - "name": "WithNullValue", - "namespace": "_spec_utils" + "name": "string", + "namespace": "_builtins" } } }, @@ -109318,7 +109309,7 @@ } } ], - "specLocation": "connector_sync_job/_types/SyncJob.ts#L52-L71" + "specLocation": "connector_sync_job/_types/SyncJob.ts#L51-L70" }, { "kind": "interface", @@ -109405,7 +109396,7 @@ } } ], - "specLocation": "connector_sync_job/_types/SyncJob.ts#L31-L39" + "specLocation": "connector_sync_job/_types/SyncJob.ts#L30-L38" }, { "kind": "enum", @@ -109424,7 +109415,7 @@ "name": "SyncJobType", "namespace": "connector_sync_job._types" }, - "specLocation": "connector_sync_job/_types/SyncJob.ts#L41-L45" + "specLocation": "connector_sync_job/_types/SyncJob.ts#L40-L44" }, { "kind": "enum", @@ -109440,7 +109431,7 @@ "name": "TriggerMethod", "namespace": "connector_sync_job._types" }, - "specLocation": "connector_sync_job/_types/SyncJob.ts#L47-L50" + "specLocation": "connector_sync_job/_types/SyncJob.ts#L46-L49" }, { "attachedBehaviors": [ @@ -109509,7 +109500,7 @@ "body": { "kind": "no_body" }, - "description": "Deletes a sync job.", + "description": "Deletes a connector sync job.", "inherits": { "type": { "name": "RequestBase", @@ -109662,8 +109653,8 @@ "type": { "kind": "instance_of", "type": { - "name": "string", - "namespace": "_builtins" + "name": "Name", + "namespace": "_types" } } }, @@ -109686,7 +109677,7 @@ "type": { "kind": "instance_of", "type": { - "name": "Fields", + "name": "Names", "namespace": "_types" } } @@ -109740,6 +109731,7 @@ "kind": "properties", "properties": [ { + "description": "The id of the associated connector", "name": "id", "required": true, "type": { @@ -109756,8 +109748,8 @@ "type": { "kind": "instance_of", "type": { - "name": "string", - "namespace": "_builtins" + "name": "Name", + "namespace": "_types" } } }, @@ -109767,8 +109759,8 @@ "type": { "kind": "instance_of", "type": { - "name": "string", - "namespace": "_builtins" + "name": "Name", + "namespace": "_types" } } } @@ -109788,7 +109780,7 @@ }, "path": [], "query": [], - "specLocation": "connector_sync_job/post/SyncJobPostRequest.ts#L23-L40" + "specLocation": "connector_sync_job/post/SyncJobPostRequest.ts#L22-L42" }, { "body": { diff --git a/output/typescript/types.ts b/output/typescript/types.ts index 9173763dba..19442b3d35 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -9481,7 +9481,7 @@ export interface ConnectorSyncJobConnectorSyncJob { connector: ConnectorSyncJobSyncJobConnectorReference created_at: string deleted_document_count: long - error: SpecUtilsWithNullValue + error?: string id: Id indexed_document_count: long indexed_document_volume: long @@ -9532,9 +9532,9 @@ export type ConnectorSyncJobGetResponse = ConnectorSyncJobConnectorSyncJob export interface ConnectorSyncJobListRequest extends RequestBase { from?: integer size?: integer - status?: string + status?: Name connector_id?: Id - job_type?: Fields + job_type?: Names } export interface ConnectorSyncJobListResponse { @@ -9545,8 +9545,8 @@ export interface ConnectorSyncJobListResponse { export interface ConnectorSyncJobPostRequest extends RequestBase { body?: { id: Id - job_type?: string - trigger_method?: string + job_type?: Name + trigger_method?: Name } } diff --git a/specification/connector_sync_job/_types/SyncJob.ts b/specification/connector_sync_job/_types/SyncJob.ts index 51332c1fae..fdd3c44949 100644 --- a/specification/connector_sync_job/_types/SyncJob.ts +++ b/specification/connector_sync_job/_types/SyncJob.ts @@ -20,7 +20,6 @@ import { Id } from '@_types/common' import { long } from '@_types/Numeric' import { Dictionary } from '@spec_utils/Dictionary' import { UserDefinedValue } from '@spec_utils/UserDefinedValue' -import { WithNullValue } from '@spec_utils/utils' import { ConnectorConfiguration, FilteringConfig, @@ -56,7 +55,7 @@ export interface ConnectorSyncJob { connector: SyncJobConnectorReference created_at: string deleted_document_count: long - error: WithNullValue + error?: string id: Id indexed_document_count: long indexed_document_volume: long diff --git a/specification/connector_sync_job/delete/SyncJobDeleteRequest.ts b/specification/connector_sync_job/delete/SyncJobDeleteRequest.ts index c5ba975d8f..23341f0191 100644 --- a/specification/connector_sync_job/delete/SyncJobDeleteRequest.ts +++ b/specification/connector_sync_job/delete/SyncJobDeleteRequest.ts @@ -20,7 +20,7 @@ import { RequestBase } from '@_types/Base' import { Id } from '@_types/common' /** - * Deletes a sync job. + * Deletes a connector sync job. * @rest_spec_name connector_sync_job.delete * @availability stack since=8.12.0 stability=experimental * @availability serverless stability=experimental visibility=public diff --git a/specification/connector_sync_job/list/SyncJobListRequest.ts b/specification/connector_sync_job/list/SyncJobListRequest.ts index 8b40dc8df5..9354cfad40 100644 --- a/specification/connector_sync_job/list/SyncJobListRequest.ts +++ b/specification/connector_sync_job/list/SyncJobListRequest.ts @@ -17,7 +17,7 @@ * under the License. */ import { RequestBase } from '@_types/Base' -import { Fields, Id } from '@_types/common' +import { Names, Id, Name } from '@_types/common' import { integer } from '@_types/Numeric' /** @@ -40,7 +40,7 @@ export interface Request extends RequestBase { /** * A sync job status to fetch connector sync jobs for */ - status?: string + status?: Name /** * A connector id to fetch connector sync jobs for */ @@ -48,6 +48,6 @@ export interface Request extends RequestBase { /** * A comma-separated list of job types to fetch the sync jobs for */ - job_type?: Fields + job_type?: Names } } diff --git a/specification/connector_sync_job/post/SyncJobPostRequest.ts b/specification/connector_sync_job/post/SyncJobPostRequest.ts index 9d8f9d5f24..2bbe51b46b 100644 --- a/specification/connector_sync_job/post/SyncJobPostRequest.ts +++ b/specification/connector_sync_job/post/SyncJobPostRequest.ts @@ -17,8 +17,7 @@ * under the License. */ import { RequestBase } from '@_types/Base' -import { Id } from '@_types/common' -import { WithNullValue } from '@spec_utils/utils' +import { Id, Name } from '@_types/common' /** * Creates a connector sync job. @@ -33,8 +32,11 @@ export interface Request extends RequestBase { */ /** @codegen_name sync_job */ body: { + /** + * The id of the associated connector + */ id: Id - job_type?: string - trigger_method?: string + job_type?: Name + trigger_method?: Name } } From 952436e47a652256395edaed27a9d8d75f3bf526 Mon Sep 17 00:00:00 2001 From: Jedr Blaszyk Date: Wed, 17 Apr 2024 10:42:51 +0200 Subject: [PATCH 5/8] Move sync job endpoints under connector namespace --- output/schema/schema.json | 1802 ++++++++--------- output/schema/validation-errors.json | 4 +- output/typescript/types.ts | 160 +- ...el.json => connector.sync_job_cancel.json} | 10 +- ...te.json => connector.sync_job_delete.json} | 10 +- ...b.get.json => connector.sync_job_get.json} | 10 +- ...list.json => connector.sync_job_list.json} | 10 +- ...post.json => connector.sync_job_post.json} | 14 +- .../_types/SyncJob.ts | 66 +- .../sync_job_cancel}/SyncJobCancelRequest.ts | 10 +- .../sync_job_cancel}/SyncJobCancelResponse.ts | 0 .../sync_job_delete}/SyncJobDeleteRequest.ts | 10 +- .../sync_job_delete}/SyncJobDeleteResponse.ts | 0 .../sync_job_get}/SyncJobGetRequest.ts | 10 +- .../sync_job_get}/SyncJobGetResponse.ts | 4 +- .../sync_job_list}/SyncJobListRequest.ts | 20 +- .../sync_job_list}/SyncJobListResponse.ts | 10 +- .../sync_job_post}/SyncJobPostRequest.ts | 14 +- .../sync_job_post}/SyncJobPostResponse.ts | 0 19 files changed, 1093 insertions(+), 1071 deletions(-) rename specification/_json_spec/{connector_sync_job.cancel.json => connector.sync_job_cancel.json} (82%) rename specification/_json_spec/{connector_sync_job.delete.json => connector.sync_job_delete.json} (81%) rename specification/_json_spec/{connector_sync_job.get.json => connector.sync_job_get.json} (82%) rename specification/_json_spec/{connector_sync_job.list.json => connector.sync_job_list.json} (88%) rename specification/_json_spec/{connector_sync_job.post.json => connector.sync_job_post.json} (71%) rename specification/{connector_sync_job => connector}/_types/SyncJob.ts (52%) rename specification/{connector_sync_job/cancel => connector/sync_job_cancel}/SyncJobCancelRequest.ts (87%) rename specification/{connector_sync_job/cancel => connector/sync_job_cancel}/SyncJobCancelResponse.ts (100%) rename specification/{connector_sync_job/delete => connector/sync_job_delete}/SyncJobDeleteRequest.ts (87%) rename specification/{connector_sync_job/delete => connector/sync_job_delete}/SyncJobDeleteResponse.ts (100%) rename specification/{connector_sync_job/get => connector/sync_job_get}/SyncJobGetRequest.ts (87%) rename specification/{connector_sync_job/get => connector/sync_job_get}/SyncJobGetResponse.ts (91%) rename specification/{connector_sync_job/list => connector/sync_job_list}/SyncJobListRequest.ts (83%) rename specification/{connector_sync_job/list => connector/sync_job_list}/SyncJobListResponse.ts (84%) rename specification/{connector_sync_job/post => connector/sync_job_post}/SyncJobPostRequest.ts (85%) rename specification/{connector_sync_job/post => connector/sync_job_post}/SyncJobPostResponse.ts (100%) diff --git a/output/schema/schema.json b/output/schema/schema.json index 7681b6abbc..c8de0fef3a 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -3366,21 +3366,18 @@ "stability": "experimental" } }, - "description": "Updates the API key id and/or API key secret id fields in the connector document.", - "docId": "connector-update-api-key-id", - "docUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/update-connector-api-key-id-api.html", - "name": "connector.update_api_key_id", + "description": "Cancels a connector sync job.", + "docId": "connector-sync-job-cancel", + "docUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/cancel-connector-sync-job-api.html", + "name": "connector.sync_job_cancel", "request": { "name": "Request", - "namespace": "connector.update_api_key_id" + "namespace": "connector.sync_job_cancel" }, - "requestBodyRequired": true, - "requestMediaType": [ - "application/json" - ], + "requestBodyRequired": false, "response": { "name": "Response", - "namespace": "connector.update_api_key_id" + "namespace": "connector.sync_job_cancel" }, "responseMediaType": [ "application/json" @@ -3392,7 +3389,7 @@ "methods": [ "PUT" ], - "path": "/_connector/{connector_id}/_api_key_id" + "path": "/_connector/_sync_job/{connector_sync_job_id}/_cancel" } ], "visibility": "public" @@ -3408,21 +3405,18 @@ "stability": "experimental" } }, - "description": "Updates the connector configuration.", - "docId": "connector-configuration", - "docUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/update-connector-configuration-api.html", - "name": "connector.update_configuration", + "description": "Deletes a connector sync job.", + "docId": "connector-sync-job-delete", + "docUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/delete-connector-sync-job-api.html", + "name": "connector.sync_job_delete", "request": { "name": "Request", - "namespace": "connector.update_configuration" + "namespace": "connector.sync_job_delete" }, - "requestBodyRequired": true, - "requestMediaType": [ - "application/json" - ], + "requestBodyRequired": false, "response": { "name": "Response", - "namespace": "connector.update_configuration" + "namespace": "connector.sync_job_delete" }, "responseMediaType": [ "application/json" @@ -3432,9 +3426,9 @@ "urls": [ { "methods": [ - "PUT" + "DELETE" ], - "path": "/_connector/{connector_id}/_configuration" + "path": "/_connector/_sync_job/{connector_sync_job_id}" } ], "visibility": "public" @@ -3450,21 +3444,18 @@ "stability": "experimental" } }, - "description": "Updates the error field in the connector document.", - "docId": "connector-update-error", - "docUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/update-connector-error-api.html", - "name": "connector.update_error", + "description": "Returns the details about a connector sync job.", + "docId": "connector-sync-job-get", + "docUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/get-connector-sync-job-api.html", + "name": "connector.sync_job_get", "request": { "name": "Request", - "namespace": "connector.update_error" + "namespace": "connector.sync_job_get" }, - "requestBodyRequired": true, - "requestMediaType": [ - "application/json" - ], + "requestBodyRequired": false, "response": { "name": "Response", - "namespace": "connector.update_error" + "namespace": "connector.sync_job_get" }, "responseMediaType": [ "application/json" @@ -3474,9 +3465,9 @@ "urls": [ { "methods": [ - "PUT" + "GET" ], - "path": "/_connector/{connector_id}/_error" + "path": "/_connector/_sync_job/{connector_sync_job_id}" } ], "visibility": "public" @@ -3492,21 +3483,18 @@ "stability": "experimental" } }, - "description": "Updates the filtering field in the connector document.", - "docId": "connector-update-filtering", - "docUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/update-connector-filtering-api.html", - "name": "connector.update_filtering", + "description": "Lists all connector sync jobs.", + "docId": "connector-sync-job-list", + "docUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/{list}/list-connector-sync-jobs-api.html", + "name": "connector.sync_job_list", "request": { "name": "Request", - "namespace": "connector.update_filtering" + "namespace": "connector.sync_job_list" }, - "requestBodyRequired": true, - "requestMediaType": [ - "application/json" - ], + "requestBodyRequired": false, "response": { "name": "Response", - "namespace": "connector.update_filtering" + "namespace": "connector.sync_job_list" }, "responseMediaType": [ "application/json" @@ -3516,9 +3504,9 @@ "urls": [ { "methods": [ - "PUT" + "GET" ], - "path": "/_connector/{connector_id}/_filtering" + "path": "/_connector/_sync_job" } ], "visibility": "public" @@ -3534,13 +3522,13 @@ "stability": "experimental" } }, - "description": "Updates the index name of the connector.", - "docId": "connector-update-index-name", - "docUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/update-connector-index-name-api.html", - "name": "connector.update_index_name", + "description": "Creates a connector sync job.", + "docId": "connector-sync-job-post", + "docUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/create-connector-sync-job-api.html", + "name": "connector.sync_job_post", "request": { "name": "Request", - "namespace": "connector.update_index_name" + "namespace": "connector.sync_job_post" }, "requestBodyRequired": true, "requestMediaType": [ @@ -3548,7 +3536,7 @@ ], "response": { "name": "Response", - "namespace": "connector.update_index_name" + "namespace": "connector.sync_job_post" }, "responseMediaType": [ "application/json" @@ -3558,9 +3546,9 @@ "urls": [ { "methods": [ - "PUT" + "POST" ], - "path": "/_connector/{connector_id}/_index_name" + "path": "/_connector/_sync_job" } ], "visibility": "public" @@ -3576,13 +3564,13 @@ "stability": "experimental" } }, - "description": "Updates the name and/or description fields in the connector document.", - "docId": "connector-update-name", - "docUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/update-connector-name-description-api.html", - "name": "connector.update_name", + "description": "Updates the API key id and/or API key secret id fields in the connector document.", + "docId": "connector-update-api-key-id", + "docUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/update-connector-api-key-id-api.html", + "name": "connector.update_api_key_id", "request": { "name": "Request", - "namespace": "connector.update_name" + "namespace": "connector.update_api_key_id" }, "requestBodyRequired": true, "requestMediaType": [ @@ -3590,7 +3578,7 @@ ], "response": { "name": "Response", - "namespace": "connector.update_name" + "namespace": "connector.update_api_key_id" }, "responseMediaType": [ "application/json" @@ -3602,7 +3590,7 @@ "methods": [ "PUT" ], - "path": "/_connector/{connector_id}/_name" + "path": "/_connector/{connector_id}/_api_key_id" } ], "visibility": "public" @@ -3618,13 +3606,13 @@ "stability": "experimental" } }, - "description": "Updates the is_native flag of the connector.", - "docId": "connector-update-native", - "docUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/update-connector-native-api.html", - "name": "connector.update_native", + "description": "Updates the connector configuration.", + "docId": "connector-configuration", + "docUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/update-connector-configuration-api.html", + "name": "connector.update_configuration", "request": { "name": "Request", - "namespace": "connector.update_native" + "namespace": "connector.update_configuration" }, "requestBodyRequired": true, "requestMediaType": [ @@ -3632,7 +3620,7 @@ ], "response": { "name": "Response", - "namespace": "connector.update_native" + "namespace": "connector.update_configuration" }, "responseMediaType": [ "application/json" @@ -3644,7 +3632,7 @@ "methods": [ "PUT" ], - "path": "/_connector/{connector_id}/_native" + "path": "/_connector/{connector_id}/_configuration" } ], "visibility": "public" @@ -3660,13 +3648,13 @@ "stability": "experimental" } }, - "description": "Updates the pipeline field in the connector document.", - "docId": "connector-update-pipeline", - "docUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/update-connector-pipeline-api.html", - "name": "connector.update_pipeline", + "description": "Updates the error field in the connector document.", + "docId": "connector-update-error", + "docUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/update-connector-error-api.html", + "name": "connector.update_error", "request": { "name": "Request", - "namespace": "connector.update_pipeline" + "namespace": "connector.update_error" }, "requestBodyRequired": true, "requestMediaType": [ @@ -3674,7 +3662,7 @@ ], "response": { "name": "Response", - "namespace": "connector.update_pipeline" + "namespace": "connector.update_error" }, "responseMediaType": [ "application/json" @@ -3686,7 +3674,7 @@ "methods": [ "PUT" ], - "path": "/_connector/{connector_id}/_pipeline" + "path": "/_connector/{connector_id}/_error" } ], "visibility": "public" @@ -3702,13 +3690,13 @@ "stability": "experimental" } }, - "description": "Updates the scheduling field in the connector document.", - "docId": "connector-update-scheduling", - "docUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/update-connector-scheduling-api.html", - "name": "connector.update_scheduling", + "description": "Updates the filtering field in the connector document.", + "docId": "connector-update-filtering", + "docUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/update-connector-filtering-api.html", + "name": "connector.update_filtering", "request": { "name": "Request", - "namespace": "connector.update_scheduling" + "namespace": "connector.update_filtering" }, "requestBodyRequired": true, "requestMediaType": [ @@ -3716,7 +3704,7 @@ ], "response": { "name": "Response", - "namespace": "connector.update_scheduling" + "namespace": "connector.update_filtering" }, "responseMediaType": [ "application/json" @@ -3728,7 +3716,7 @@ "methods": [ "PUT" ], - "path": "/_connector/{connector_id}/_scheduling" + "path": "/_connector/{connector_id}/_filtering" } ], "visibility": "public" @@ -3744,13 +3732,13 @@ "stability": "experimental" } }, - "description": "Updates the service type of the connector.", - "docId": "connector-update-service-type", - "docUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/update-connector-service-type-api.html", - "name": "connector.update_service_type", + "description": "Updates the index name of the connector.", + "docId": "connector-update-index-name", + "docUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/update-connector-index-name-api.html", + "name": "connector.update_index_name", "request": { "name": "Request", - "namespace": "connector.update_service_type" + "namespace": "connector.update_index_name" }, "requestBodyRequired": true, "requestMediaType": [ @@ -3758,7 +3746,7 @@ ], "response": { "name": "Response", - "namespace": "connector.update_service_type" + "namespace": "connector.update_index_name" }, "responseMediaType": [ "application/json" @@ -3770,7 +3758,7 @@ "methods": [ "PUT" ], - "path": "/_connector/{connector_id}/_service_type" + "path": "/_connector/{connector_id}/_index_name" } ], "visibility": "public" @@ -3786,13 +3774,13 @@ "stability": "experimental" } }, - "description": "Updates the status of the connector.", - "docId": "connector-update-status", - "docUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/update-connector-status-api.html", - "name": "connector.update_status", + "description": "Updates the name and/or description fields in the connector document.", + "docId": "connector-update-name", + "docUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/update-connector-name-description-api.html", + "name": "connector.update_name", "request": { "name": "Request", - "namespace": "connector.update_status" + "namespace": "connector.update_name" }, "requestBodyRequired": true, "requestMediaType": [ @@ -3800,7 +3788,7 @@ ], "response": { "name": "Response", - "namespace": "connector.update_status" + "namespace": "connector.update_name" }, "responseMediaType": [ "application/json" @@ -3812,7 +3800,7 @@ "methods": [ "PUT" ], - "path": "/_connector/{connector_id}/_status" + "path": "/_connector/{connector_id}/_name" } ], "visibility": "public" @@ -3828,18 +3816,21 @@ "stability": "experimental" } }, - "description": "Cancels a connector sync job.", - "docId": "connector-sync-job-cancel", - "docUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/cancel-connector-sync-job-api.html", - "name": "connector_sync_job.cancel", + "description": "Updates the is_native flag of the connector.", + "docId": "connector-update-native", + "docUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/update-connector-native-api.html", + "name": "connector.update_native", "request": { "name": "Request", - "namespace": "connector_sync_job.cancel" + "namespace": "connector.update_native" }, - "requestBodyRequired": false, + "requestBodyRequired": true, + "requestMediaType": [ + "application/json" + ], "response": { "name": "Response", - "namespace": "connector_sync_job.cancel" + "namespace": "connector.update_native" }, "responseMediaType": [ "application/json" @@ -3851,7 +3842,7 @@ "methods": [ "PUT" ], - "path": "/_connector/_sync_job/{connector_sync_job_id}/_cancel" + "path": "/_connector/{connector_id}/_native" } ], "visibility": "public" @@ -3867,18 +3858,21 @@ "stability": "experimental" } }, - "description": "Deletes a connector sync job.", - "docId": "connector-sync-job-delete", - "docUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/delete-connector-sync-job-api.html", - "name": "connector_sync_job.delete", + "description": "Updates the pipeline field in the connector document.", + "docId": "connector-update-pipeline", + "docUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/update-connector-pipeline-api.html", + "name": "connector.update_pipeline", "request": { "name": "Request", - "namespace": "connector_sync_job.delete" + "namespace": "connector.update_pipeline" }, - "requestBodyRequired": false, + "requestBodyRequired": true, + "requestMediaType": [ + "application/json" + ], "response": { "name": "Response", - "namespace": "connector_sync_job.delete" + "namespace": "connector.update_pipeline" }, "responseMediaType": [ "application/json" @@ -3888,9 +3882,9 @@ "urls": [ { "methods": [ - "DELETE" + "PUT" ], - "path": "/_connector/_sync_job/{connector_sync_job_id}" + "path": "/_connector/{connector_id}/_pipeline" } ], "visibility": "public" @@ -3906,18 +3900,21 @@ "stability": "experimental" } }, - "description": "Returns the details about a connector sync job.", - "docId": "connector-sync-job-get", - "docUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/get-connector-sync-job-api.html", - "name": "connector_sync_job.get", + "description": "Updates the scheduling field in the connector document.", + "docId": "connector-update-scheduling", + "docUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/update-connector-scheduling-api.html", + "name": "connector.update_scheduling", "request": { "name": "Request", - "namespace": "connector_sync_job.get" + "namespace": "connector.update_scheduling" }, - "requestBodyRequired": false, + "requestBodyRequired": true, + "requestMediaType": [ + "application/json" + ], "response": { "name": "Response", - "namespace": "connector_sync_job.get" + "namespace": "connector.update_scheduling" }, "responseMediaType": [ "application/json" @@ -3927,9 +3924,9 @@ "urls": [ { "methods": [ - "GET" + "PUT" ], - "path": "/_connector/_sync_job/{connector_sync_job_id}" + "path": "/_connector/{connector_id}/_scheduling" } ], "visibility": "public" @@ -3945,18 +3942,21 @@ "stability": "experimental" } }, - "description": "Lists all connector sync jobs.", - "docId": "connector-sync-job-list", - "docUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/{list}/list-connector-sync-jobs-api.html", - "name": "connector_sync_job.list", + "description": "Updates the service type of the connector.", + "docId": "connector-update-service-type", + "docUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/update-connector-service-type-api.html", + "name": "connector.update_service_type", "request": { "name": "Request", - "namespace": "connector_sync_job.list" + "namespace": "connector.update_service_type" }, - "requestBodyRequired": false, + "requestBodyRequired": true, + "requestMediaType": [ + "application/json" + ], "response": { "name": "Response", - "namespace": "connector_sync_job.list" + "namespace": "connector.update_service_type" }, "responseMediaType": [ "application/json" @@ -3966,9 +3966,9 @@ "urls": [ { "methods": [ - "GET" + "PUT" ], - "path": "/_connector/_sync_job" + "path": "/_connector/{connector_id}/_service_type" } ], "visibility": "public" @@ -3984,13 +3984,13 @@ "stability": "experimental" } }, - "description": "Creates a connector sync job.", - "docId": "connector-sync-job-post", - "docUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/create-connector-sync-job-api.html", - "name": "connector_sync_job.post", + "description": "Updates the status of the connector.", + "docId": "connector-update-status", + "docUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/update-connector-status-api.html", + "name": "connector.update_status", "request": { "name": "Request", - "namespace": "connector_sync_job.post" + "namespace": "connector.update_status" }, "requestBodyRequired": true, "requestMediaType": [ @@ -3998,7 +3998,7 @@ ], "response": { "name": "Response", - "namespace": "connector_sync_job.post" + "namespace": "connector.update_status" }, "responseMediaType": [ "application/json" @@ -4008,9 +4008,9 @@ "urls": [ { "methods": [ - "POST" + "PUT" ], - "path": "/_connector/_sync_job" + "path": "/_connector/{connector_id}/_status" } ], "visibility": "public" @@ -106454,6 +106454,221 @@ }, "specLocation": "connector/_types/Connector.ts#L129-L135" }, + { + "kind": "interface", + "name": { + "name": "ConnectorSyncJob", + "namespace": "connector._types" + }, + "properties": [ + { + "name": "cancelation_requested_at", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + }, + { + "name": "canceled_at", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + }, + { + "name": "completed_at", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + }, + { + "name": "connector", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "SyncJobConnectorReference", + "namespace": "connector._types" + } + } + }, + { + "name": "created_at", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + }, + { + "name": "deleted_document_count", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "long", + "namespace": "_types" + } + } + }, + { + "name": "error", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + }, + { + "name": "id", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "Id", + "namespace": "_types" + } + } + }, + { + "name": "indexed_document_count", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "long", + "namespace": "_types" + } + } + }, + { + "name": "indexed_document_volume", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "long", + "namespace": "_types" + } + } + }, + { + "name": "job_type", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "SyncJobType", + "namespace": "connector._types" + } + } + }, + { + "name": "last_seen", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + }, + { + "name": "metadata", + "required": true, + "type": { + "key": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + }, + "kind": "dictionary_of", + "singleKey": false, + "value": { + "kind": "user_defined_value" + } + } + }, + { + "name": "started_at", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + }, + { + "name": "status", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "SyncStatus", + "namespace": "connector._types" + } + } + }, + { + "name": "total_document_count", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "long", + "namespace": "_types" + } + } + }, + { + "name": "trigger_method", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "TriggerMethod", + "namespace": "connector._types" + } + } + }, + { + "name": "worker_hostname", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + } + ], + "specLocation": "connector/_types/SyncJob.ts#L51-L70" + }, { "kind": "interface", "name": { @@ -107326,6 +107541,112 @@ ], "specLocation": "connector/_types/Connector.ts#L24-L27" }, + { + "kind": "interface", + "name": { + "name": "SyncJobConnectorReference", + "namespace": "connector._types" + }, + "properties": [ + { + "name": "configuration", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "ConnectorConfiguration", + "namespace": "connector._types" + } + } + }, + { + "name": "filtering", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "FilteringConfig", + "namespace": "connector._types" + } + } + }, + { + "name": "id", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "Id", + "namespace": "_types" + } + } + }, + { + "name": "index_name", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + }, + { + "name": "language", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + }, + { + "name": "pipeline", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "IngestPipelineParams", + "namespace": "connector._types" + } + } + }, + { + "name": "service_type", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + } + ], + "specLocation": "connector/_types/SyncJob.ts#L30-L38" + }, + { + "kind": "enum", + "members": [ + { + "name": "full" + }, + { + "name": "incremental" + }, + { + "name": "access_control" + } + ], + "name": { + "name": "SyncJobType", + "namespace": "connector._types" + }, + "specLocation": "connector/_types/SyncJob.ts#L40-L44" + }, { "kind": "interface", "name": { @@ -107389,6 +107710,22 @@ }, "specLocation": "connector/_types/Connector.ts#L137-L145" }, + { + "kind": "enum", + "members": [ + { + "name": "on_demand" + }, + { + "name": "scheduled" + } + ], + "name": { + "name": "TriggerMethod", + "namespace": "connector._types" + }, + "specLocation": "connector/_types/SyncJob.ts#L46-L49" + }, { "kind": "type_alias", "name": { @@ -108218,52 +108555,124 @@ "attachedBehaviors": [ "CommonQueryParameters" ], + "body": { + "kind": "no_body" + }, + "description": "Cancels a connector sync job.", + "inherits": { + "type": { + "name": "RequestBase", + "namespace": "_types" + } + }, + "kind": "request", + "name": { + "name": "Request", + "namespace": "connector.sync_job_cancel" + }, + "path": [ + { + "description": "The unique identifier of the connector sync job", + "name": "connector_sync_job_id", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "Id", + "namespace": "_types" + } + } + } + ], + "query": [], + "specLocation": "connector/sync_job_cancel/SyncJobCancelRequest.ts#L22-L36" + }, + { "body": { "kind": "properties", "properties": [ { - "name": "api_key_id", - "required": false, + "name": "result", + "required": true, "type": { - "generics": [ - { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "_builtins" - } - } - ], "kind": "instance_of", "type": { - "name": "WithNullValue", - "namespace": "_spec_utils" + "name": "Result", + "namespace": "_types" } } - }, - { - "name": "api_key_secret_id", - "required": false, + } + ] + }, + "kind": "response", + "name": { + "name": "Response", + "namespace": "connector.sync_job_cancel" + }, + "specLocation": "connector/sync_job_cancel/SyncJobCancelResponse.ts#L22-L26" + }, + { + "attachedBehaviors": [ + "CommonQueryParameters" + ], + "body": { + "kind": "no_body" + }, + "description": "Deletes a connector sync job.", + "inherits": { + "type": { + "name": "RequestBase", + "namespace": "_types" + } + }, + "kind": "request", + "name": { + "name": "Request", + "namespace": "connector.sync_job_delete" + }, + "path": [ + { + "description": "The unique identifier of the connector sync job to be deleted", + "name": "connector_sync_job_id", + "required": true, + "type": { + "kind": "instance_of", "type": { - "generics": [ - { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "_builtins" - } - } - ], - "kind": "instance_of", - "type": { - "name": "WithNullValue", - "namespace": "_spec_utils" - } + "name": "Id", + "namespace": "_types" } } - ] + } + ], + "query": [], + "specLocation": "connector/sync_job_delete/SyncJobDeleteRequest.ts#L22-L36" + }, + { + "body": { + "kind": "value", + "value": { + "kind": "instance_of", + "type": { + "name": "AcknowledgedResponseBase", + "namespace": "_types" + } + } }, - "description": "Updates the API key id in the connector document", + "kind": "response", + "name": { + "name": "Response", + "namespace": "connector.sync_job_delete" + }, + "specLocation": "connector/sync_job_delete/SyncJobDeleteResponse.ts#L22-L24" + }, + { + "attachedBehaviors": [ + "CommonQueryParameters" + ], + "body": { + "kind": "no_body" + }, + "description": "Retrieves a connector sync job.", "inherits": { "type": { "name": "RequestBase", @@ -108273,12 +108682,12 @@ "kind": "request", "name": { "name": "Request", - "namespace": "connector.update_api_key_id" + "namespace": "connector.sync_job_get" }, "path": [ { - "description": "The unique identifier of the connector to be updated", - "name": "connector_id", + "description": "The unique identifier of the connector sync job", + "name": "connector_sync_job_id", "required": true, "type": { "kind": "instance_of", @@ -108290,31 +108699,147 @@ } ], "query": [], - "specLocation": "connector/update_api_key_id/ConnectorUpdateAPIKeyIDRequest.ts#L23-L44" + "specLocation": "connector/sync_job_get/SyncJobGetRequest.ts#L22-L36" + }, + { + "body": { + "kind": "value", + "value": { + "kind": "instance_of", + "type": { + "name": "ConnectorSyncJob", + "namespace": "connector._types" + } + } + }, + "kind": "response", + "name": { + "name": "Response", + "namespace": "connector.sync_job_get" + }, + "specLocation": "connector/sync_job_get/SyncJobGetResponse.ts#L22-L24" + }, + { + "attachedBehaviors": [ + "CommonQueryParameters" + ], + "body": { + "kind": "no_body" + }, + "description": "Lists connector sync jobs.", + "inherits": { + "type": { + "name": "RequestBase", + "namespace": "_types" + } + }, + "kind": "request", + "name": { + "name": "Request", + "namespace": "connector.sync_job_list" + }, + "path": [], + "query": [ + { + "description": "Starting offset (default: 0)", + "name": "from", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "integer", + "namespace": "_types" + } + } + }, + { + "description": "Specifies a max number of results to get", + "name": "size", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "integer", + "namespace": "_types" + } + } + }, + { + "description": "A sync job status to fetch connector sync jobs for", + "name": "status", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "Name", + "namespace": "_types" + } + } + }, + { + "description": "A connector id to fetch connector sync jobs for", + "name": "connector_id", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "Id", + "namespace": "_types" + } + } + }, + { + "description": "A comma-separated list of job types to fetch the sync jobs for", + "name": "job_type", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "Names", + "namespace": "_types" + } + } + } + ], + "specLocation": "connector/sync_job_list/SyncJobListRequest.ts#L23-L53" }, { "body": { "kind": "properties", "properties": [ { - "name": "result", + "name": "count", "required": true, "type": { "kind": "instance_of", "type": { - "name": "Result", + "name": "long", "namespace": "_types" } } + }, + { + "name": "results", + "required": true, + "type": { + "kind": "array_of", + "value": { + "kind": "instance_of", + "type": { + "name": "ConnectorSyncJob", + "namespace": "connector._types" + } + } + } } ] }, "kind": "response", "name": { "name": "Response", - "namespace": "connector.update_api_key_id" + "namespace": "connector.sync_job_list" }, - "specLocation": "connector/update_api_key_id/ConnectorUpdateAPIKeyIDResponse.ts#L22-L26" + "specLocation": "connector/sync_job_list/SyncJobListResponse.ts#L23-L28" }, { "attachedBehaviors": [ @@ -108324,37 +108849,42 @@ "kind": "properties", "properties": [ { - "name": "configuration", + "description": "The id of the associated connector", + "name": "id", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "Id", + "namespace": "_types" + } + } + }, + { + "name": "job_type", "required": false, "type": { "kind": "instance_of", "type": { - "name": "ConnectorConfiguration", - "namespace": "connector._types" + "name": "Name", + "namespace": "_types" } } }, { - "name": "values", + "name": "trigger_method", "required": false, "type": { - "key": { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "_builtins" - } - }, - "kind": "dictionary_of", - "singleKey": false, - "value": { - "kind": "user_defined_value" + "kind": "instance_of", + "type": { + "name": "Name", + "namespace": "_types" } } } ] }, - "description": "Updates the configuration field in the connector document", + "description": "Creates a connector sync job.", "inherits": { "type": { "name": "RequestBase", @@ -108364,36 +108894,23 @@ "kind": "request", "name": { "name": "Request", - "namespace": "connector.update_configuration" + "namespace": "connector.sync_job_post" }, - "path": [ - { - "description": "The unique identifier of the connector to be updated", - "name": "connector_id", - "required": true, - "type": { - "kind": "instance_of", - "type": { - "name": "Id", - "namespace": "_types" - } - } - } - ], + "path": [], "query": [], - "specLocation": "connector/update_configuration/ConnectorUpdateConfigurationRequest.ts#L25-L47" + "specLocation": "connector/sync_job_post/SyncJobPostRequest.ts#L22-L42" }, { "body": { "kind": "properties", "properties": [ { - "name": "result", + "name": "id", "required": true, "type": { "kind": "instance_of", "type": { - "name": "Result", + "name": "Id", "namespace": "_types" } } @@ -108403,9 +108920,9 @@ "kind": "response", "name": { "name": "Response", - "namespace": "connector.update_configuration" + "namespace": "connector.sync_job_post" }, - "specLocation": "connector/update_configuration/ConnectorUpdateConfigurationResponse.ts#L22-L26" + "specLocation": "connector/sync_job_post/SyncJobPostResponse.ts#L22-L26" }, { "attachedBehaviors": [ @@ -108415,8 +108932,28 @@ "kind": "properties", "properties": [ { - "name": "error", - "required": true, + "name": "api_key_id", + "required": false, + "type": { + "generics": [ + { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + ], + "kind": "instance_of", + "type": { + "name": "WithNullValue", + "namespace": "_spec_utils" + } + } + }, + { + "name": "api_key_secret_id", + "required": false, "type": { "generics": [ { @@ -108436,7 +108973,7 @@ } ] }, - "description": "Updates the filtering field in the connector document", + "description": "Updates the API key id in the connector document", "inherits": { "type": { "name": "RequestBase", @@ -108446,7 +108983,7 @@ "kind": "request", "name": { "name": "Request", - "namespace": "connector.update_error" + "namespace": "connector.update_api_key_id" }, "path": [ { @@ -108463,7 +109000,7 @@ } ], "query": [], - "specLocation": "connector/update_error/ConnectorUpdateErrorRequest.ts#L23-L44" + "specLocation": "connector/update_api_key_id/ConnectorUpdateAPIKeyIDRequest.ts#L23-L44" }, { "body": { @@ -108485,9 +109022,9 @@ "kind": "response", "name": { "name": "Response", - "namespace": "connector.update_error" + "namespace": "connector.update_api_key_id" }, - "specLocation": "connector/update_error/ConnectorUpdateErrorResponse.ts#L22-L26" + "specLocation": "connector/update_api_key_id/ConnectorUpdateAPIKeyIDResponse.ts#L22-L26" }, { "attachedBehaviors": [ @@ -108497,22 +109034,37 @@ "kind": "properties", "properties": [ { - "name": "filtering", - "required": true, + "name": "configuration", + "required": false, "type": { - "kind": "array_of", - "value": { + "kind": "instance_of", + "type": { + "name": "ConnectorConfiguration", + "namespace": "connector._types" + } + } + }, + { + "name": "values", + "required": false, + "type": { + "key": { "kind": "instance_of", "type": { - "name": "FilteringConfig", - "namespace": "connector._types" + "name": "string", + "namespace": "_builtins" } + }, + "kind": "dictionary_of", + "singleKey": false, + "value": { + "kind": "user_defined_value" } } } ] }, - "description": "Updates the filtering field in the connector document", + "description": "Updates the configuration field in the connector document", "inherits": { "type": { "name": "RequestBase", @@ -108522,7 +109074,7 @@ "kind": "request", "name": { "name": "Request", - "namespace": "connector.update_filtering" + "namespace": "connector.update_configuration" }, "path": [ { @@ -108539,7 +109091,7 @@ } ], "query": [], - "specLocation": "connector/update_filtering/ConnectorUpdateFilteringRequest.ts#L23-L44" + "specLocation": "connector/update_configuration/ConnectorUpdateConfigurationRequest.ts#L25-L47" }, { "body": { @@ -108561,9 +109113,9 @@ "kind": "response", "name": { "name": "Response", - "namespace": "connector.update_filtering" + "namespace": "connector.update_configuration" }, - "specLocation": "connector/update_filtering/ConnectorUpdateFilteringResponse.ts#L22-L26" + "specLocation": "connector/update_configuration/ConnectorUpdateConfigurationResponse.ts#L22-L26" }, { "attachedBehaviors": [ @@ -108573,7 +109125,7 @@ "kind": "properties", "properties": [ { - "name": "index_name", + "name": "error", "required": true, "type": { "generics": [ @@ -108594,7 +109146,7 @@ } ] }, - "description": "Updates the index_name in the connector document", + "description": "Updates the filtering field in the connector document", "inherits": { "type": { "name": "RequestBase", @@ -108604,7 +109156,7 @@ "kind": "request", "name": { "name": "Request", - "namespace": "connector.update_index_name" + "namespace": "connector.update_error" }, "path": [ { @@ -108621,7 +109173,7 @@ } ], "query": [], - "specLocation": "connector/update_index_name/ConnectorUpdateIndexNameRequest.ts#L23-L43" + "specLocation": "connector/update_error/ConnectorUpdateErrorRequest.ts#L23-L44" }, { "body": { @@ -108643,9 +109195,9 @@ "kind": "response", "name": { "name": "Response", - "namespace": "connector.update_index_name" + "namespace": "connector.update_error" }, - "specLocation": "connector/update_index_name/ConnectorUpdateIndexNameResponse.ts#L22-L26" + "specLocation": "connector/update_error/ConnectorUpdateErrorResponse.ts#L22-L26" }, { "attachedBehaviors": [ @@ -108655,30 +109207,22 @@ "kind": "properties", "properties": [ { - "name": "name", + "name": "filtering", "required": true, "type": { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "_builtins" - } - } - }, - { - "name": "description", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "_builtins" + "kind": "array_of", + "value": { + "kind": "instance_of", + "type": { + "name": "FilteringConfig", + "namespace": "connector._types" + } } } } ] }, - "description": "Updates the name and description fields in the connector document", + "description": "Updates the filtering field in the connector document", "inherits": { "type": { "name": "RequestBase", @@ -108688,7 +109232,7 @@ "kind": "request", "name": { "name": "Request", - "namespace": "connector.update_name" + "namespace": "connector.update_filtering" }, "path": [ { @@ -108705,7 +109249,7 @@ } ], "query": [], - "specLocation": "connector/update_name/ConnectorUpdateNameRequest.ts#L22-L43" + "specLocation": "connector/update_filtering/ConnectorUpdateFilteringRequest.ts#L23-L44" }, { "body": { @@ -108727,9 +109271,9 @@ "kind": "response", "name": { "name": "Response", - "namespace": "connector.update_name" + "namespace": "connector.update_filtering" }, - "specLocation": "connector/update_name/ConnectorUpdateNameResponse.ts#L22-L26" + "specLocation": "connector/update_filtering/ConnectorUpdateFilteringResponse.ts#L22-L26" }, { "attachedBehaviors": [ @@ -108739,19 +109283,28 @@ "kind": "properties", "properties": [ { - "name": "is_native", + "name": "index_name", "required": true, "type": { + "generics": [ + { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + ], "kind": "instance_of", "type": { - "name": "boolean", - "namespace": "_builtins" + "name": "WithNullValue", + "namespace": "_spec_utils" } } } ] }, - "description": "Updates the is_native flag in the connector document", + "description": "Updates the index_name in the connector document", "inherits": { "type": { "name": "RequestBase", @@ -108761,7 +109314,7 @@ "kind": "request", "name": { "name": "Request", - "namespace": "connector.update_native" + "namespace": "connector.update_index_name" }, "path": [ { @@ -108778,7 +109331,7 @@ } ], "query": [], - "specLocation": "connector/update_native/ConnectorUpdateNativeRequest.ts#L22-L42" + "specLocation": "connector/update_index_name/ConnectorUpdateIndexNameRequest.ts#L23-L43" }, { "body": { @@ -108800,9 +109353,9 @@ "kind": "response", "name": { "name": "Response", - "namespace": "connector.update_native" + "namespace": "connector.update_index_name" }, - "specLocation": "connector/update_native/ConnectorUpdateNativeResponse.ts#L22-L26" + "specLocation": "connector/update_index_name/ConnectorUpdateIndexNameResponse.ts#L22-L26" }, { "attachedBehaviors": [ @@ -108812,19 +109365,30 @@ "kind": "properties", "properties": [ { - "name": "pipeline", + "name": "name", "required": true, "type": { "kind": "instance_of", "type": { - "name": "IngestPipelineParams", - "namespace": "connector._types" + "name": "string", + "namespace": "_builtins" + } + } + }, + { + "name": "description", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" } } } ] }, - "description": "Updates the pipeline field in the connector document", + "description": "Updates the name and description fields in the connector document", "inherits": { "type": { "name": "RequestBase", @@ -108834,7 +109398,7 @@ "kind": "request", "name": { "name": "Request", - "namespace": "connector.update_pipeline" + "namespace": "connector.update_name" }, "path": [ { @@ -108851,7 +109415,7 @@ } ], "query": [], - "specLocation": "connector/update_pipeline/ConnectorUpdatePipelineRequest.ts#L23-L44" + "specLocation": "connector/update_name/ConnectorUpdateNameRequest.ts#L22-L43" }, { "body": { @@ -108873,9 +109437,9 @@ "kind": "response", "name": { "name": "Response", - "namespace": "connector.update_pipeline" + "namespace": "connector.update_name" }, - "specLocation": "connector/update_pipeline/ConnectorUpdatePipelineResponse.ts#L22-L26" + "specLocation": "connector/update_name/ConnectorUpdateNameResponse.ts#L22-L26" }, { "attachedBehaviors": [ @@ -108885,19 +109449,19 @@ "kind": "properties", "properties": [ { - "name": "scheduling", + "name": "is_native", "required": true, "type": { "kind": "instance_of", "type": { - "name": "SchedulingConfiguration", - "namespace": "connector._types" + "name": "boolean", + "namespace": "_builtins" } } } ] }, - "description": "Updates the scheduling field in the connector document", + "description": "Updates the is_native flag in the connector document", "inherits": { "type": { "name": "RequestBase", @@ -108907,7 +109471,7 @@ "kind": "request", "name": { "name": "Request", - "namespace": "connector.update_scheduling" + "namespace": "connector.update_native" }, "path": [ { @@ -108924,7 +109488,7 @@ } ], "query": [], - "specLocation": "connector/update_scheduling/ConnectorUpdateSchedulingRequest.ts#L23-L44" + "specLocation": "connector/update_native/ConnectorUpdateNativeRequest.ts#L22-L42" }, { "body": { @@ -108946,9 +109510,9 @@ "kind": "response", "name": { "name": "Response", - "namespace": "connector.update_scheduling" + "namespace": "connector.update_native" }, - "specLocation": "connector/update_scheduling/ConnectorUpdateSchedulingResponse.ts#L22-L26" + "specLocation": "connector/update_native/ConnectorUpdateNativeResponse.ts#L22-L26" }, { "attachedBehaviors": [ @@ -108958,19 +109522,19 @@ "kind": "properties", "properties": [ { - "name": "service_type", + "name": "pipeline", "required": true, "type": { "kind": "instance_of", "type": { - "name": "string", - "namespace": "_builtins" + "name": "IngestPipelineParams", + "namespace": "connector._types" } } } ] }, - "description": "Updates the service type of the connector", + "description": "Updates the pipeline field in the connector document", "inherits": { "type": { "name": "RequestBase", @@ -108980,7 +109544,7 @@ "kind": "request", "name": { "name": "Request", - "namespace": "connector.update_service_type" + "namespace": "connector.update_pipeline" }, "path": [ { @@ -108997,7 +109561,7 @@ } ], "query": [], - "specLocation": "connector/update_service_type/ConnectorUpdateServiceTypeRequest.ts#L22-L42" + "specLocation": "connector/update_pipeline/ConnectorUpdatePipelineRequest.ts#L23-L44" }, { "body": { @@ -109019,9 +109583,9 @@ "kind": "response", "name": { "name": "Response", - "namespace": "connector.update_service_type" + "namespace": "connector.update_pipeline" }, - "specLocation": "connector/update_service_type/ConnectorUpdateServiceTypeResponse.ts#L22-L26" + "specLocation": "connector/update_pipeline/ConnectorUpdatePipelineResponse.ts#L22-L26" }, { "attachedBehaviors": [ @@ -109031,19 +109595,19 @@ "kind": "properties", "properties": [ { - "name": "status", + "name": "scheduling", "required": true, "type": { "kind": "instance_of", "type": { - "name": "ConnectorStatus", + "name": "SchedulingConfiguration", "namespace": "connector._types" } } } ] }, - "description": "Updates the status of the connector", + "description": "Updates the scheduling field in the connector document", "inherits": { "type": { "name": "RequestBase", @@ -109053,7 +109617,7 @@ "kind": "request", "name": { "name": "Request", - "namespace": "connector.update_status" + "namespace": "connector.update_scheduling" }, "path": [ { @@ -109070,7 +109634,7 @@ } ], "query": [], - "specLocation": "connector/update_status/ConnectorUpdateStatusRequest.ts#L23-L43" + "specLocation": "connector/update_scheduling/ConnectorUpdateSchedulingRequest.ts#L23-L44" }, { "body": { @@ -109092,469 +109656,31 @@ "kind": "response", "name": { "name": "Response", - "namespace": "connector.update_status" - }, - "specLocation": "connector/update_status/ConnectorUpdateStatusResponse.ts#L22-L26" - }, - { - "kind": "interface", - "name": { - "name": "ConnectorSyncJob", - "namespace": "connector_sync_job._types" - }, - "properties": [ - { - "name": "cancelation_requested_at", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "_builtins" - } - } - }, - { - "name": "canceled_at", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "_builtins" - } - } - }, - { - "name": "completed_at", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "_builtins" - } - } - }, - { - "name": "connector", - "required": true, - "type": { - "kind": "instance_of", - "type": { - "name": "SyncJobConnectorReference", - "namespace": "connector_sync_job._types" - } - } - }, - { - "name": "created_at", - "required": true, - "type": { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "_builtins" - } - } - }, - { - "name": "deleted_document_count", - "required": true, - "type": { - "kind": "instance_of", - "type": { - "name": "long", - "namespace": "_types" - } - } - }, - { - "name": "error", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "_builtins" - } - } - }, - { - "name": "id", - "required": true, - "type": { - "kind": "instance_of", - "type": { - "name": "Id", - "namespace": "_types" - } - } - }, - { - "name": "indexed_document_count", - "required": true, - "type": { - "kind": "instance_of", - "type": { - "name": "long", - "namespace": "_types" - } - } - }, - { - "name": "indexed_document_volume", - "required": true, - "type": { - "kind": "instance_of", - "type": { - "name": "long", - "namespace": "_types" - } - } - }, - { - "name": "job_type", - "required": true, - "type": { - "kind": "instance_of", - "type": { - "name": "SyncJobType", - "namespace": "connector_sync_job._types" - } - } - }, - { - "name": "last_seen", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "_builtins" - } - } - }, - { - "name": "metadata", - "required": true, - "type": { - "key": { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "_builtins" - } - }, - "kind": "dictionary_of", - "singleKey": false, - "value": { - "kind": "user_defined_value" - } - } - }, - { - "name": "started_at", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "_builtins" - } - } - }, - { - "name": "status", - "required": true, - "type": { - "kind": "instance_of", - "type": { - "name": "SyncStatus", - "namespace": "connector._types" - } - } - }, - { - "name": "total_document_count", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "long", - "namespace": "_types" - } - } - }, - { - "name": "trigger_method", - "required": true, - "type": { - "kind": "instance_of", - "type": { - "name": "TriggerMethod", - "namespace": "connector_sync_job._types" - } - } - }, - { - "name": "worker_hostname", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "_builtins" - } - } - } - ], - "specLocation": "connector_sync_job/_types/SyncJob.ts#L51-L70" - }, - { - "kind": "interface", - "name": { - "name": "SyncJobConnectorReference", - "namespace": "connector_sync_job._types" - }, - "properties": [ - { - "name": "configuration", - "required": true, - "type": { - "kind": "instance_of", - "type": { - "name": "ConnectorConfiguration", - "namespace": "connector._types" - } - } - }, - { - "name": "filtering", - "required": true, - "type": { - "kind": "instance_of", - "type": { - "name": "FilteringConfig", - "namespace": "connector._types" - } - } - }, - { - "name": "id", - "required": true, - "type": { - "kind": "instance_of", - "type": { - "name": "Id", - "namespace": "_types" - } - } - }, - { - "name": "index_name", - "required": true, - "type": { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "_builtins" - } - } - }, - { - "name": "language", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "_builtins" - } - } - }, - { - "name": "pipeline", - "required": true, - "type": { - "kind": "instance_of", - "type": { - "name": "IngestPipelineParams", - "namespace": "connector._types" - } - } - }, - { - "name": "service_type", - "required": true, - "type": { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "_builtins" - } - } - } - ], - "specLocation": "connector_sync_job/_types/SyncJob.ts#L30-L38" - }, - { - "kind": "enum", - "members": [ - { - "name": "full" - }, - { - "name": "incremental" - }, - { - "name": "access_control" - } - ], - "name": { - "name": "SyncJobType", - "namespace": "connector_sync_job._types" - }, - "specLocation": "connector_sync_job/_types/SyncJob.ts#L40-L44" - }, - { - "kind": "enum", - "members": [ - { - "name": "on_demand" - }, - { - "name": "scheduled" - } - ], - "name": { - "name": "TriggerMethod", - "namespace": "connector_sync_job._types" + "namespace": "connector.update_scheduling" }, - "specLocation": "connector_sync_job/_types/SyncJob.ts#L46-L49" + "specLocation": "connector/update_scheduling/ConnectorUpdateSchedulingResponse.ts#L22-L26" }, { "attachedBehaviors": [ "CommonQueryParameters" ], - "body": { - "kind": "no_body" - }, - "description": "Cancels a connector sync job.", - "inherits": { - "type": { - "name": "RequestBase", - "namespace": "_types" - } - }, - "kind": "request", - "name": { - "name": "Request", - "namespace": "connector_sync_job.cancel" - }, - "path": [ - { - "description": "The unique identifier of the connector sync job", - "name": "connector_sync_job_id", - "required": true, - "type": { - "kind": "instance_of", - "type": { - "name": "Id", - "namespace": "_types" - } - } - } - ], - "query": [], - "specLocation": "connector_sync_job/cancel/SyncJobCancelRequest.ts#L22-L36" - }, - { "body": { "kind": "properties", "properties": [ { - "name": "result", + "name": "service_type", "required": true, "type": { "kind": "instance_of", "type": { - "name": "Result", - "namespace": "_types" + "name": "string", + "namespace": "_builtins" } } } ] }, - "kind": "response", - "name": { - "name": "Response", - "namespace": "connector_sync_job.cancel" - }, - "specLocation": "connector_sync_job/cancel/SyncJobCancelResponse.ts#L22-L26" - }, - { - "attachedBehaviors": [ - "CommonQueryParameters" - ], - "body": { - "kind": "no_body" - }, - "description": "Deletes a connector sync job.", - "inherits": { - "type": { - "name": "RequestBase", - "namespace": "_types" - } - }, - "kind": "request", - "name": { - "name": "Request", - "namespace": "connector_sync_job.delete" - }, - "path": [ - { - "description": "The unique identifier of the connector sync job to be deleted", - "name": "connector_sync_job_id", - "required": true, - "type": { - "kind": "instance_of", - "type": { - "name": "Id", - "namespace": "_types" - } - } - } - ], - "query": [], - "specLocation": "connector_sync_job/delete/SyncJobDeleteRequest.ts#L22-L36" - }, - { - "body": { - "kind": "value", - "value": { - "kind": "instance_of", - "type": { - "name": "AcknowledgedResponseBase", - "namespace": "_types" - } - } - }, - "kind": "response", - "name": { - "name": "Response", - "namespace": "connector_sync_job.delete" - }, - "specLocation": "connector_sync_job/delete/SyncJobDeleteResponse.ts#L22-L24" - }, - { - "attachedBehaviors": [ - "CommonQueryParameters" - ], - "body": { - "kind": "no_body" - }, - "description": "Retrieves a connector sync job.", + "description": "Updates the service type of the connector", "inherits": { "type": { "name": "RequestBase", @@ -109564,12 +109690,12 @@ "kind": "request", "name": { "name": "Request", - "namespace": "connector_sync_job.get" + "namespace": "connector.update_service_type" }, "path": [ { - "description": "The unique identifier of the connector sync job", - "name": "connector_sync_job_id", + "description": "The unique identifier of the connector to be updated", + "name": "connector_id", "required": true, "type": { "kind": "instance_of", @@ -109581,147 +109707,31 @@ } ], "query": [], - "specLocation": "connector_sync_job/get/SyncJobGetRequest.ts#L22-L36" - }, - { - "body": { - "kind": "value", - "value": { - "kind": "instance_of", - "type": { - "name": "ConnectorSyncJob", - "namespace": "connector_sync_job._types" - } - } - }, - "kind": "response", - "name": { - "name": "Response", - "namespace": "connector_sync_job.get" - }, - "specLocation": "connector_sync_job/get/SyncJobGetResponse.ts#L22-L24" - }, - { - "attachedBehaviors": [ - "CommonQueryParameters" - ], - "body": { - "kind": "no_body" - }, - "description": "Lists connector sync jobs.", - "inherits": { - "type": { - "name": "RequestBase", - "namespace": "_types" - } - }, - "kind": "request", - "name": { - "name": "Request", - "namespace": "connector_sync_job.list" - }, - "path": [], - "query": [ - { - "description": "Starting offset (default: 0)", - "name": "from", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "integer", - "namespace": "_types" - } - } - }, - { - "description": "Specifies a max number of results to get", - "name": "size", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "integer", - "namespace": "_types" - } - } - }, - { - "description": "A sync job status to fetch connector sync jobs for", - "name": "status", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "Name", - "namespace": "_types" - } - } - }, - { - "description": "A connector id to fetch connector sync jobs for", - "name": "connector_id", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "Id", - "namespace": "_types" - } - } - }, - { - "description": "A comma-separated list of job types to fetch the sync jobs for", - "name": "job_type", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "Names", - "namespace": "_types" - } - } - } - ], - "specLocation": "connector_sync_job/list/SyncJobListRequest.ts#L23-L53" + "specLocation": "connector/update_service_type/ConnectorUpdateServiceTypeRequest.ts#L22-L42" }, { "body": { "kind": "properties", "properties": [ { - "name": "count", + "name": "result", "required": true, "type": { "kind": "instance_of", "type": { - "name": "long", + "name": "Result", "namespace": "_types" } } - }, - { - "name": "results", - "required": true, - "type": { - "kind": "array_of", - "value": { - "kind": "instance_of", - "type": { - "name": "ConnectorSyncJob", - "namespace": "connector_sync_job._types" - } - } - } } ] }, "kind": "response", "name": { "name": "Response", - "namespace": "connector_sync_job.list" + "namespace": "connector.update_service_type" }, - "specLocation": "connector_sync_job/list/SyncJobListResponse.ts#L23-L28" + "specLocation": "connector/update_service_type/ConnectorUpdateServiceTypeResponse.ts#L22-L26" }, { "attachedBehaviors": [ @@ -109731,42 +109741,19 @@ "kind": "properties", "properties": [ { - "description": "The id of the associated connector", - "name": "id", + "name": "status", "required": true, "type": { "kind": "instance_of", "type": { - "name": "Id", - "namespace": "_types" - } - } - }, - { - "name": "job_type", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "Name", - "namespace": "_types" - } - } - }, - { - "name": "trigger_method", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "Name", - "namespace": "_types" + "name": "ConnectorStatus", + "namespace": "connector._types" } } } ] }, - "description": "Creates a connector sync job.", + "description": "Updates the status of the connector", "inherits": { "type": { "name": "RequestBase", @@ -109776,23 +109763,36 @@ "kind": "request", "name": { "name": "Request", - "namespace": "connector_sync_job.post" + "namespace": "connector.update_status" }, - "path": [], + "path": [ + { + "description": "The unique identifier of the connector to be updated", + "name": "connector_id", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "Id", + "namespace": "_types" + } + } + } + ], "query": [], - "specLocation": "connector_sync_job/post/SyncJobPostRequest.ts#L22-L42" + "specLocation": "connector/update_status/ConnectorUpdateStatusRequest.ts#L23-L43" }, { "body": { "kind": "properties", "properties": [ { - "name": "id", + "name": "result", "required": true, "type": { "kind": "instance_of", "type": { - "name": "Id", + "name": "Result", "namespace": "_types" } } @@ -109802,9 +109802,9 @@ "kind": "response", "name": { "name": "Response", - "namespace": "connector_sync_job.post" + "namespace": "connector.update_status" }, - "specLocation": "connector_sync_job/post/SyncJobPostResponse.ts#L22-L26" + "specLocation": "connector/update_status/ConnectorUpdateStatusResponse.ts#L22-L26" }, { "attachedBehaviors": [ diff --git a/output/schema/validation-errors.json b/output/schema/validation-errors.json index bfde0af41d..faf56dfc57 100644 --- a/output/schema/validation-errors.json +++ b/output/schema/validation-errors.json @@ -494,10 +494,10 @@ ], "response": [] }, - "connector_sync_job.delete": { + "connector.sync_job_delete": { "request": [], "response": [ - "response definition connector_sync_job.delete:Response / body / instance_of - Non-leaf type cannot be used here: '_types:AcknowledgedResponseBase'" + "response definition connector.sync_job_delete:Response / body / instance_of - Non-leaf type cannot be used here: '_types:AcknowledgedResponseBase'" ] }, "create": { diff --git a/output/typescript/types.ts b/output/typescript/types.ts index 19442b3d35..4781ba9e72 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -9140,6 +9140,27 @@ export interface ConnectorConnectorScheduling { export type ConnectorConnectorStatus = 'created' | 'needs_configuration' | 'configured' | 'connected' | 'error' +export interface ConnectorConnectorSyncJob { + cancelation_requested_at?: string + canceled_at?: string + completed_at?: string + connector: ConnectorSyncJobConnectorReference + created_at: string + deleted_document_count: long + error?: string + id: Id + indexed_document_count: long + indexed_document_volume: long + job_type: ConnectorSyncJobType + last_seen?: string + metadata: Record + started_at?: string + status: ConnectorSyncStatus + total_document_count?: long + trigger_method: ConnectorTriggerMethod + worker_hostname?: string +} + export interface ConnectorCustomScheduling { configuration_overrides: ConnectorCustomSchedulingConfigurationOverrides enabled: boolean @@ -9255,6 +9276,18 @@ export interface ConnectorSelectOption { value: string } +export interface ConnectorSyncJobConnectorReference { + configuration: ConnectorConnectorConfiguration + filtering: ConnectorFilteringConfig + id: Id + index_name: string + language?: string + pipeline: ConnectorIngestPipelineParams + service_type: string +} + +export type ConnectorSyncJobType = 'full' | 'incremental' | 'access_control' + export interface ConnectorSyncRulesFeature { advanced?: ConnectorFeatureEnabled basic?: ConnectorFeatureEnabled @@ -9262,6 +9295,8 @@ export interface ConnectorSyncRulesFeature { export type ConnectorSyncStatus = 'canceling' | 'canceled' | 'completed' | 'error' | 'in_progress' | 'pending' | 'suspended' +export type ConnectorTriggerMethod = 'on_demand' | 'scheduled' + export type ConnectorValidation = ConnectorLessThanValidation | ConnectorGreaterThanValidation | ConnectorListTypeValidation | ConnectorIncludedInValidation | ConnectorRegexValidation export interface ConnectorCheckInRequest extends RequestBase { @@ -9350,6 +9385,51 @@ export interface ConnectorPutResponse { result: Result } +export interface ConnectorSyncJobCancelRequest extends RequestBase { + connector_sync_job_id: Id +} + +export interface ConnectorSyncJobCancelResponse { + result: Result +} + +export interface ConnectorSyncJobDeleteRequest extends RequestBase { + connector_sync_job_id: Id +} + +export type ConnectorSyncJobDeleteResponse = AcknowledgedResponseBase + +export interface ConnectorSyncJobGetRequest extends RequestBase { + connector_sync_job_id: Id +} + +export type ConnectorSyncJobGetResponse = ConnectorConnectorSyncJob + +export interface ConnectorSyncJobListRequest extends RequestBase { + from?: integer + size?: integer + status?: Name + connector_id?: Id + job_type?: Names +} + +export interface ConnectorSyncJobListResponse { + count: long + results: ConnectorConnectorSyncJob[] +} + +export interface ConnectorSyncJobPostRequest extends RequestBase { + body?: { + id: Id + job_type?: Name + trigger_method?: Name + } +} + +export interface ConnectorSyncJobPostResponse { + id: Id +} + export interface ConnectorUpdateApiKeyIdRequest extends RequestBase { connector_id: Id body?: { @@ -9474,86 +9554,6 @@ export interface ConnectorUpdateStatusResponse { result: Result } -export interface ConnectorSyncJobConnectorSyncJob { - cancelation_requested_at?: string - canceled_at?: string - completed_at?: string - connector: ConnectorSyncJobSyncJobConnectorReference - created_at: string - deleted_document_count: long - error?: string - id: Id - indexed_document_count: long - indexed_document_volume: long - job_type: ConnectorSyncJobSyncJobType - last_seen?: string - metadata: Record - started_at?: string - status: ConnectorSyncStatus - total_document_count?: long - trigger_method: ConnectorSyncJobTriggerMethod - worker_hostname?: string -} - -export interface ConnectorSyncJobSyncJobConnectorReference { - configuration: ConnectorConnectorConfiguration - filtering: ConnectorFilteringConfig - id: Id - index_name: string - language?: string - pipeline: ConnectorIngestPipelineParams - service_type: string -} - -export type ConnectorSyncJobSyncJobType = 'full' | 'incremental' | 'access_control' - -export type ConnectorSyncJobTriggerMethod = 'on_demand' | 'scheduled' - -export interface ConnectorSyncJobCancelRequest extends RequestBase { - connector_sync_job_id: Id -} - -export interface ConnectorSyncJobCancelResponse { - result: Result -} - -export interface ConnectorSyncJobDeleteRequest extends RequestBase { - connector_sync_job_id: Id -} - -export type ConnectorSyncJobDeleteResponse = AcknowledgedResponseBase - -export interface ConnectorSyncJobGetRequest extends RequestBase { - connector_sync_job_id: Id -} - -export type ConnectorSyncJobGetResponse = ConnectorSyncJobConnectorSyncJob - -export interface ConnectorSyncJobListRequest extends RequestBase { - from?: integer - size?: integer - status?: Name - connector_id?: Id - job_type?: Names -} - -export interface ConnectorSyncJobListResponse { - count: long - results: ConnectorSyncJobConnectorSyncJob[] -} - -export interface ConnectorSyncJobPostRequest extends RequestBase { - body?: { - id: Id - job_type?: Name - trigger_method?: Name - } -} - -export interface ConnectorSyncJobPostResponse { - id: Id -} - export interface DanglingIndicesDeleteDanglingIndexRequest extends RequestBase { index_uuid: Uuid accept_data_loss: boolean diff --git a/specification/_json_spec/connector_sync_job.cancel.json b/specification/_json_spec/connector.sync_job_cancel.json similarity index 82% rename from specification/_json_spec/connector_sync_job.cancel.json rename to specification/_json_spec/connector.sync_job_cancel.json index 00571ef9e9..4f0729a3a1 100644 --- a/specification/_json_spec/connector_sync_job.cancel.json +++ b/specification/_json_spec/connector.sync_job_cancel.json @@ -1,5 +1,5 @@ { - "connector_sync_job.cancel": { + "connector.sync_job_cancel": { "documentation": { "url": "https://www.elastic.co/guide/en/elasticsearch/reference/master/cancel-connector-sync-job-api.html", "description": "Cancels a connector sync job." @@ -7,13 +7,17 @@ "stability": "experimental", "visibility": "public", "headers": { - "accept": ["application/json"] + "accept": [ + "application/json" + ] }, "url": { "paths": [ { "path": "/_connector/_sync_job/{connector_sync_job_id}/_cancel", - "methods": ["PUT"], + "methods": [ + "PUT" + ], "parts": { "connector_sync_job_id": { "type": "string", diff --git a/specification/_json_spec/connector_sync_job.delete.json b/specification/_json_spec/connector.sync_job_delete.json similarity index 81% rename from specification/_json_spec/connector_sync_job.delete.json rename to specification/_json_spec/connector.sync_job_delete.json index 45b737763f..591cb8f0cc 100644 --- a/specification/_json_spec/connector_sync_job.delete.json +++ b/specification/_json_spec/connector.sync_job_delete.json @@ -1,5 +1,5 @@ { - "connector_sync_job.delete": { + "connector.sync_job_delete": { "documentation": { "url": "https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-connector-sync-job-api.html", "description": "Deletes a connector sync job." @@ -7,13 +7,17 @@ "stability": "experimental", "visibility": "public", "headers": { - "accept": ["application/json"] + "accept": [ + "application/json" + ] }, "url": { "paths": [ { "path": "/_connector/_sync_job/{connector_sync_job_id}", - "methods": ["DELETE"], + "methods": [ + "DELETE" + ], "parts": { "connector_sync_job_id": { "type": "string", diff --git a/specification/_json_spec/connector_sync_job.get.json b/specification/_json_spec/connector.sync_job_get.json similarity index 82% rename from specification/_json_spec/connector_sync_job.get.json rename to specification/_json_spec/connector.sync_job_get.json index 48e596c969..8a46a1eecc 100644 --- a/specification/_json_spec/connector_sync_job.get.json +++ b/specification/_json_spec/connector.sync_job_get.json @@ -1,5 +1,5 @@ { - "connector_sync_job.get": { + "connector.sync_job_get": { "documentation": { "url": "https://www.elastic.co/guide/en/elasticsearch/reference/master/get-connector-sync-job-api.html", "description": "Returns the details about a connector sync job." @@ -7,13 +7,17 @@ "stability": "experimental", "visibility": "public", "headers": { - "accept": ["application/json"] + "accept": [ + "application/json" + ] }, "url": { "paths": [ { "path": "/_connector/_sync_job/{connector_sync_job_id}", - "methods": ["GET"], + "methods": [ + "GET" + ], "parts": { "connector_sync_job_id": { "type": "string", diff --git a/specification/_json_spec/connector_sync_job.list.json b/specification/_json_spec/connector.sync_job_list.json similarity index 88% rename from specification/_json_spec/connector_sync_job.list.json rename to specification/_json_spec/connector.sync_job_list.json index 3e8ca5bc9c..737028ce78 100644 --- a/specification/_json_spec/connector_sync_job.list.json +++ b/specification/_json_spec/connector.sync_job_list.json @@ -1,5 +1,5 @@ { - "connector_sync_job.list": { + "connector.sync_job_list": { "documentation": { "url": "https://www.elastic.co/guide/en/elasticsearch/reference/master/list-connector-sync-jobs-api.html", "description": "Lists all connector sync jobs." @@ -7,13 +7,17 @@ "stability": "experimental", "visibility": "public", "headers": { - "accept": ["application/json"] + "accept": [ + "application/json" + ] }, "url": { "paths": [ { "path": "/_connector/_sync_job", - "methods": ["GET"] + "methods": [ + "GET" + ] } ] }, diff --git a/specification/_json_spec/connector_sync_job.post.json b/specification/_json_spec/connector.sync_job_post.json similarity index 71% rename from specification/_json_spec/connector_sync_job.post.json rename to specification/_json_spec/connector.sync_job_post.json index 33e34b7b92..88069718db 100644 --- a/specification/_json_spec/connector_sync_job.post.json +++ b/specification/_json_spec/connector.sync_job_post.json @@ -1,5 +1,5 @@ { - "connector_sync_job.post": { + "connector.sync_job_post": { "documentation": { "url": "https://www.elastic.co/guide/en/elasticsearch/reference/master/create-connector-sync-job-api.html", "description": "Creates a connector sync job." @@ -7,14 +7,20 @@ "stability": "experimental", "visibility": "public", "headers": { - "accept": ["application/json"], - "content_type": ["application/json"] + "accept": [ + "application/json" + ], + "content_type": [ + "application/json" + ] }, "url": { "paths": [ { "path": "/_connector/_sync_job", - "methods": ["POST"] + "methods": [ + "POST" + ] } ] }, diff --git a/specification/connector_sync_job/_types/SyncJob.ts b/specification/connector/_types/SyncJob.ts similarity index 52% rename from specification/connector_sync_job/_types/SyncJob.ts rename to specification/connector/_types/SyncJob.ts index fdd3c44949..5ce81ff529 100644 --- a/specification/connector_sync_job/_types/SyncJob.ts +++ b/specification/connector/_types/SyncJob.ts @@ -16,55 +16,55 @@ * specific language governing permissions and limitations * under the License. */ -import { Id } from '@_types/common' -import { long } from '@_types/Numeric' -import { Dictionary } from '@spec_utils/Dictionary' -import { UserDefinedValue } from '@spec_utils/UserDefinedValue' +import { Id } from "@_types/common"; +import { long } from "@_types/Numeric"; +import { Dictionary } from "@spec_utils/Dictionary"; +import { UserDefinedValue } from "@spec_utils/UserDefinedValue"; import { ConnectorConfiguration, FilteringConfig, IngestPipelineParams, - SyncStatus -} from '../../connector/_types/Connector' + SyncStatus, +} from "./Connector"; interface SyncJobConnectorReference { - configuration: ConnectorConfiguration - filtering: FilteringConfig - id: Id - index_name: string - language?: string - pipeline: IngestPipelineParams - service_type: string + configuration: ConnectorConfiguration; + filtering: FilteringConfig; + id: Id; + index_name: string; + language?: string; + pipeline: IngestPipelineParams; + service_type: string; } enum SyncJobType { full, incremental, - access_control + access_control, } enum TriggerMethod { on_demand, - scheduled + scheduled, } export interface ConnectorSyncJob { - cancelation_requested_at?: string - canceled_at?: string - completed_at?: string - connector: SyncJobConnectorReference - created_at: string - deleted_document_count: long - error?: string - id: Id - indexed_document_count: long - indexed_document_volume: long - job_type: SyncJobType - last_seen?: string - metadata: Dictionary - started_at?: string - status: SyncStatus - total_document_count?: long - trigger_method: TriggerMethod - worker_hostname?: string + cancelation_requested_at?: string; + canceled_at?: string; + completed_at?: string; + connector: SyncJobConnectorReference; + created_at: string; + deleted_document_count: long; + error?: string; + id: Id; + indexed_document_count: long; + indexed_document_volume: long; + job_type: SyncJobType; + last_seen?: string; + metadata: Dictionary; + started_at?: string; + status: SyncStatus; + total_document_count?: long; + trigger_method: TriggerMethod; + worker_hostname?: string; } diff --git a/specification/connector_sync_job/cancel/SyncJobCancelRequest.ts b/specification/connector/sync_job_cancel/SyncJobCancelRequest.ts similarity index 87% rename from specification/connector_sync_job/cancel/SyncJobCancelRequest.ts rename to specification/connector/sync_job_cancel/SyncJobCancelRequest.ts index 781e16882c..2260fdf469 100644 --- a/specification/connector_sync_job/cancel/SyncJobCancelRequest.ts +++ b/specification/connector/sync_job_cancel/SyncJobCancelRequest.ts @@ -16,12 +16,12 @@ * specific language governing permissions and limitations * under the License. */ -import { RequestBase } from '@_types/Base' -import { Id } from '@_types/common' +import { RequestBase } from "@_types/Base"; +import { Id } from "@_types/common"; /** * Cancels a connector sync job. - * @rest_spec_name connector_sync_job.cancel + * @rest_spec_name connector.sync_job_cancel * @availability stack since=8.12.0 stability=experimental * @availability serverless stability=experimental visibility=public * @doc_id connector-sync-job-cancel @@ -31,6 +31,6 @@ export interface Request extends RequestBase { /** * The unique identifier of the connector sync job */ - connector_sync_job_id: Id - } + connector_sync_job_id: Id; + }; } diff --git a/specification/connector_sync_job/cancel/SyncJobCancelResponse.ts b/specification/connector/sync_job_cancel/SyncJobCancelResponse.ts similarity index 100% rename from specification/connector_sync_job/cancel/SyncJobCancelResponse.ts rename to specification/connector/sync_job_cancel/SyncJobCancelResponse.ts diff --git a/specification/connector_sync_job/delete/SyncJobDeleteRequest.ts b/specification/connector/sync_job_delete/SyncJobDeleteRequest.ts similarity index 87% rename from specification/connector_sync_job/delete/SyncJobDeleteRequest.ts rename to specification/connector/sync_job_delete/SyncJobDeleteRequest.ts index 23341f0191..cfc9efa67f 100644 --- a/specification/connector_sync_job/delete/SyncJobDeleteRequest.ts +++ b/specification/connector/sync_job_delete/SyncJobDeleteRequest.ts @@ -16,12 +16,12 @@ * specific language governing permissions and limitations * under the License. */ -import { RequestBase } from '@_types/Base' -import { Id } from '@_types/common' +import { RequestBase } from "@_types/Base"; +import { Id } from "@_types/common"; /** * Deletes a connector sync job. - * @rest_spec_name connector_sync_job.delete + * @rest_spec_name connector.sync_job_delete * @availability stack since=8.12.0 stability=experimental * @availability serverless stability=experimental visibility=public * @doc_id connector-sync-job-delete @@ -31,6 +31,6 @@ export interface Request extends RequestBase { /** * The unique identifier of the connector sync job to be deleted */ - connector_sync_job_id: Id - } + connector_sync_job_id: Id; + }; } diff --git a/specification/connector_sync_job/delete/SyncJobDeleteResponse.ts b/specification/connector/sync_job_delete/SyncJobDeleteResponse.ts similarity index 100% rename from specification/connector_sync_job/delete/SyncJobDeleteResponse.ts rename to specification/connector/sync_job_delete/SyncJobDeleteResponse.ts diff --git a/specification/connector_sync_job/get/SyncJobGetRequest.ts b/specification/connector/sync_job_get/SyncJobGetRequest.ts similarity index 87% rename from specification/connector_sync_job/get/SyncJobGetRequest.ts rename to specification/connector/sync_job_get/SyncJobGetRequest.ts index f6cd2b46df..a919093163 100644 --- a/specification/connector_sync_job/get/SyncJobGetRequest.ts +++ b/specification/connector/sync_job_get/SyncJobGetRequest.ts @@ -16,12 +16,12 @@ * specific language governing permissions and limitations * under the License. */ -import { RequestBase } from '@_types/Base' -import { Id } from '@_types/common' +import { RequestBase } from "@_types/Base"; +import { Id } from "@_types/common"; /** * Retrieves a connector sync job. - * @rest_spec_name connector_sync_job.get + * @rest_spec_name connector.sync_job_get * @availability stack since=8.12.0 stability=experimental * @availability serverless stability=experimental visibility=public * @doc_id connector-sync-job-get @@ -31,6 +31,6 @@ export interface Request extends RequestBase { /** * The unique identifier of the connector sync job */ - connector_sync_job_id: Id - } + connector_sync_job_id: Id; + }; } diff --git a/specification/connector_sync_job/get/SyncJobGetResponse.ts b/specification/connector/sync_job_get/SyncJobGetResponse.ts similarity index 91% rename from specification/connector_sync_job/get/SyncJobGetResponse.ts rename to specification/connector/sync_job_get/SyncJobGetResponse.ts index d99c57ee7f..4c05cedc67 100644 --- a/specification/connector_sync_job/get/SyncJobGetResponse.ts +++ b/specification/connector/sync_job_get/SyncJobGetResponse.ts @@ -17,8 +17,8 @@ * under the License. */ -import { ConnectorSyncJob } from '../_types/SyncJob' +import { ConnectorSyncJob } from "../_types/SyncJob"; export class Response { - body: ConnectorSyncJob + body: ConnectorSyncJob; } diff --git a/specification/connector_sync_job/list/SyncJobListRequest.ts b/specification/connector/sync_job_list/SyncJobListRequest.ts similarity index 83% rename from specification/connector_sync_job/list/SyncJobListRequest.ts rename to specification/connector/sync_job_list/SyncJobListRequest.ts index 9354cfad40..d1a8367eda 100644 --- a/specification/connector_sync_job/list/SyncJobListRequest.ts +++ b/specification/connector/sync_job_list/SyncJobListRequest.ts @@ -16,13 +16,13 @@ * specific language governing permissions and limitations * under the License. */ -import { RequestBase } from '@_types/Base' -import { Names, Id, Name } from '@_types/common' -import { integer } from '@_types/Numeric' +import { RequestBase } from "@_types/Base"; +import { Names, Id, Name } from "@_types/common"; +import { integer } from "@_types/Numeric"; /** * Lists connector sync jobs. - * @rest_spec_name connector_sync_job.list + * @rest_spec_name connector.sync_job_list * @availability stack since=8.12.0 stability=experimental * @availability serverless stability=experimental visibility=public * @doc_id connector-sync-job-list @@ -32,22 +32,22 @@ export interface Request extends RequestBase { /** * Starting offset (default: 0) */ - from?: integer + from?: integer; /** * Specifies a max number of results to get */ - size?: integer + size?: integer; /** * A sync job status to fetch connector sync jobs for */ - status?: Name + status?: Name; /** * A connector id to fetch connector sync jobs for */ - connector_id?: Id + connector_id?: Id; /** * A comma-separated list of job types to fetch the sync jobs for */ - job_type?: Names - } + job_type?: Names; + }; } diff --git a/specification/connector_sync_job/list/SyncJobListResponse.ts b/specification/connector/sync_job_list/SyncJobListResponse.ts similarity index 84% rename from specification/connector_sync_job/list/SyncJobListResponse.ts rename to specification/connector/sync_job_list/SyncJobListResponse.ts index f695d6fab6..cd76395714 100644 --- a/specification/connector_sync_job/list/SyncJobListResponse.ts +++ b/specification/connector/sync_job_list/SyncJobListResponse.ts @@ -17,12 +17,12 @@ * under the License. */ -import { long } from '@_types/Numeric' -import { ConnectorSyncJob } from '../_types/SyncJob' +import { long } from "@_types/Numeric"; +import { ConnectorSyncJob } from "../_types/SyncJob"; export class Response { body: { - count: long - results: ConnectorSyncJob[] - } + count: long; + results: ConnectorSyncJob[]; + }; } diff --git a/specification/connector_sync_job/post/SyncJobPostRequest.ts b/specification/connector/sync_job_post/SyncJobPostRequest.ts similarity index 85% rename from specification/connector_sync_job/post/SyncJobPostRequest.ts rename to specification/connector/sync_job_post/SyncJobPostRequest.ts index 2bbe51b46b..89986e7739 100644 --- a/specification/connector_sync_job/post/SyncJobPostRequest.ts +++ b/specification/connector/sync_job_post/SyncJobPostRequest.ts @@ -16,12 +16,12 @@ * specific language governing permissions and limitations * under the License. */ -import { RequestBase } from '@_types/Base' -import { Id, Name } from '@_types/common' +import { RequestBase } from "@_types/Base"; +import { Id, Name } from "@_types/common"; /** * Creates a connector sync job. - * @rest_spec_name connector_sync_job.post + * @rest_spec_name connector.sync_job_post * @availability stack since=8.12.0 stability=experimental * @availability serverless stability=experimental visibility=public * @doc_id connector-sync-job-post @@ -35,8 +35,8 @@ export interface Request extends RequestBase { /** * The id of the associated connector */ - id: Id - job_type?: Name - trigger_method?: Name - } + id: Id; + job_type?: Name; + trigger_method?: Name; + }; } diff --git a/specification/connector_sync_job/post/SyncJobPostResponse.ts b/specification/connector/sync_job_post/SyncJobPostResponse.ts similarity index 100% rename from specification/connector_sync_job/post/SyncJobPostResponse.ts rename to specification/connector/sync_job_post/SyncJobPostResponse.ts From fcc4833c126ef25399a52509ff4d8bc03c94ed07 Mon Sep 17 00:00:00 2001 From: Jedr Blaszyk Date: Wed, 17 Apr 2024 11:30:13 +0200 Subject: [PATCH 6/8] Address review feedback --- .../elasticsearch-serverless-openapi.json | 562 +++++++++--------- output/schema/schema.json | 36 +- output/typescript/types.ts | 16 +- .../_json_spec/connector.sync_job_cancel.json | 8 +- .../_json_spec/connector.sync_job_delete.json | 8 +- .../_json_spec/connector.sync_job_get.json | 8 +- .../_json_spec/connector.sync_job_list.json | 8 +- .../_json_spec/connector.sync_job_post.json | 12 +- specification/connector/_types/SyncJob.ts | 67 ++- .../sync_job_cancel/SyncJobCancelRequest.ts | 8 +- .../sync_job_delete/SyncJobDeleteRequest.ts | 8 +- .../sync_job_get/SyncJobGetRequest.ts | 8 +- .../sync_job_get/SyncJobGetResponse.ts | 4 +- .../sync_job_list/SyncJobListRequest.ts | 18 +- .../sync_job_list/SyncJobListResponse.ts | 10 +- .../sync_job_post/SyncJobPostRequest.ts | 12 +- 16 files changed, 386 insertions(+), 407 deletions(-) diff --git a/output/openapi/elasticsearch-serverless-openapi.json b/output/openapi/elasticsearch-serverless-openapi.json index 53ce0a5e67..b90fa3ebee 100644 --- a/output/openapi/elasticsearch-serverless-openapi.json +++ b/output/openapi/elasticsearch-serverless-openapi.json @@ -2264,6 +2264,273 @@ } } }, + "/_connector/_sync_job/{connector_sync_job_id}/_cancel": { + "put": { + "tags": [ + "connector.sync_job_cancel" + ], + "summary": "Cancels a connector sync job.", + "description": "Cancels a connector sync job.", + "externalDocs": { + "url": "https://www.elastic.co/guide/en/elasticsearch/reference/current/cancel-connector-sync-job-api.html" + }, + "operationId": "connector-sync-job-cancel", + "parameters": [ + { + "in": "path", + "name": "connector_sync_job_id", + "description": "The unique identifier of the connector sync job", + "required": true, + "deprecated": false, + "schema": { + "$ref": "#/components/schemas/_types:Id" + }, + "style": "simple" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "result": { + "$ref": "#/components/schemas/_types:Result" + } + }, + "required": [ + "result" + ] + } + } + } + } + } + } + }, + "/_connector/_sync_job/{connector_sync_job_id}": { + "get": { + "tags": [ + "connector.sync_job_get" + ], + "summary": "Returns the details about a connector sync job.", + "description": "Returns the details about a connector sync job.", + "externalDocs": { + "url": "https://www.elastic.co/guide/en/elasticsearch/reference/current/get-connector-sync-job-api.html" + }, + "operationId": "connector-sync-job-get", + "parameters": [ + { + "in": "path", + "name": "connector_sync_job_id", + "description": "The unique identifier of the connector sync job", + "required": true, + "deprecated": false, + "schema": { + "$ref": "#/components/schemas/_types:Id" + }, + "style": "simple" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/connector._types:ConnectorSyncJob" + } + } + } + } + } + }, + "delete": { + "tags": [ + "connector.sync_job_delete" + ], + "summary": "Deletes a connector sync job.", + "description": "Deletes a connector sync job.", + "externalDocs": { + "url": "https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-connector-sync-job-api.html" + }, + "operationId": "connector-sync-job-delete", + "parameters": [ + { + "in": "path", + "name": "connector_sync_job_id", + "description": "The unique identifier of the connector sync job to be deleted", + "required": true, + "deprecated": false, + "schema": { + "$ref": "#/components/schemas/_types:Id" + }, + "style": "simple" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/_types:AcknowledgedResponseBase" + } + } + } + } + } + } + }, + "/_connector/_sync_job": { + "get": { + "tags": [ + "connector.sync_job_list" + ], + "summary": "Lists all connector sync jobs.", + "description": "Lists all connector sync jobs.", + "externalDocs": { + "url": "https://www.elastic.co/guide/en/elasticsearch/reference/{list}/list-connector-sync-jobs-api.html" + }, + "operationId": "connector-sync-job-list", + "parameters": [ + { + "in": "query", + "name": "from", + "description": "Starting offset (default: 0)", + "deprecated": false, + "schema": { + "type": "number" + }, + "style": "form" + }, + { + "in": "query", + "name": "size", + "description": "Specifies a max number of results to get", + "deprecated": false, + "schema": { + "type": "number" + }, + "style": "form" + }, + { + "in": "query", + "name": "status", + "description": "A sync job status to fetch connector sync jobs for", + "deprecated": false, + "schema": { + "$ref": "#/components/schemas/_types:Name" + }, + "style": "form" + }, + { + "in": "query", + "name": "connector_id", + "description": "A connector id to fetch connector sync jobs for", + "deprecated": false, + "schema": { + "$ref": "#/components/schemas/_types:Id" + }, + "style": "form" + }, + { + "in": "query", + "name": "job_type", + "description": "A comma-separated list of job types to fetch the sync jobs for", + "deprecated": false, + "schema": { + "$ref": "#/components/schemas/_types:Names" + }, + "style": "form" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "count": { + "type": "number" + }, + "results": { + "type": "array", + "items": { + "$ref": "#/components/schemas/connector._types:ConnectorSyncJob" + } + } + }, + "required": [ + "count", + "results" + ] + } + } + } + } + } + }, + "post": { + "tags": [ + "connector.sync_job_post" + ], + "summary": "Creates a connector sync job.", + "description": "Creates a connector sync job.", + "externalDocs": { + "url": "https://www.elastic.co/guide/en/elasticsearch/reference/current/create-connector-sync-job-api.html" + }, + "operationId": "connector-sync-job-post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "$ref": "#/components/schemas/_types:Id" + }, + "job_type": { + "$ref": "#/components/schemas/_types:Name" + }, + "trigger_method": { + "$ref": "#/components/schemas/_types:Name" + } + }, + "required": [ + "id" + ] + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "$ref": "#/components/schemas/_types:Id" + } + }, + "required": [ + "id" + ] + } + } + } + } + } + } + }, "/_connector/{connector_id}/_api_key_id": { "put": { "tags": [ @@ -2977,273 +3244,6 @@ } } }, - "/_connector/_sync_job/{connector_sync_job_id}/_cancel": { - "put": { - "tags": [ - "connector_sync_job.cancel" - ], - "summary": "Cancels a connector sync job.", - "description": "Cancels a connector sync job.", - "externalDocs": { - "url": "https://www.elastic.co/guide/en/elasticsearch/reference/current/cancel-connector-sync-job-api.html" - }, - "operationId": "connector-sync-job-cancel", - "parameters": [ - { - "in": "path", - "name": "connector_sync_job_id", - "description": "The unique identifier of the connector sync job", - "required": true, - "deprecated": false, - "schema": { - "$ref": "#/components/schemas/_types:Id" - }, - "style": "simple" - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "result": { - "$ref": "#/components/schemas/_types:Result" - } - }, - "required": [ - "result" - ] - } - } - } - } - } - } - }, - "/_connector/_sync_job/{connector_sync_job_id}": { - "get": { - "tags": [ - "connector_sync_job.get" - ], - "summary": "Returns the details about a connector sync job.", - "description": "Returns the details about a connector sync job.", - "externalDocs": { - "url": "https://www.elastic.co/guide/en/elasticsearch/reference/current/get-connector-sync-job-api.html" - }, - "operationId": "connector-sync-job-get", - "parameters": [ - { - "in": "path", - "name": "connector_sync_job_id", - "description": "The unique identifier of the connector sync job", - "required": true, - "deprecated": false, - "schema": { - "$ref": "#/components/schemas/_types:Id" - }, - "style": "simple" - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/connector_sync_job._types:ConnectorSyncJob" - } - } - } - } - } - }, - "delete": { - "tags": [ - "connector_sync_job.delete" - ], - "summary": "Deletes a connector sync job.", - "description": "Deletes a connector sync job.", - "externalDocs": { - "url": "https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-connector-sync-job-api.html" - }, - "operationId": "connector-sync-job-delete", - "parameters": [ - { - "in": "path", - "name": "connector_sync_job_id", - "description": "The unique identifier of the connector sync job to be deleted", - "required": true, - "deprecated": false, - "schema": { - "$ref": "#/components/schemas/_types:Id" - }, - "style": "simple" - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/_types:AcknowledgedResponseBase" - } - } - } - } - } - } - }, - "/_connector/_sync_job": { - "get": { - "tags": [ - "connector_sync_job.list" - ], - "summary": "Lists all connector sync jobs.", - "description": "Lists all connector sync jobs.", - "externalDocs": { - "url": "https://www.elastic.co/guide/en/elasticsearch/reference/{list}/list-connector-sync-jobs-api.html" - }, - "operationId": "connector-sync-job-list", - "parameters": [ - { - "in": "query", - "name": "from", - "description": "Starting offset (default: 0)", - "deprecated": false, - "schema": { - "type": "number" - }, - "style": "form" - }, - { - "in": "query", - "name": "size", - "description": "Specifies a max number of results to get", - "deprecated": false, - "schema": { - "type": "number" - }, - "style": "form" - }, - { - "in": "query", - "name": "status", - "description": "A sync job status to fetch connector sync jobs for", - "deprecated": false, - "schema": { - "$ref": "#/components/schemas/_types:Name" - }, - "style": "form" - }, - { - "in": "query", - "name": "connector_id", - "description": "A connector id to fetch connector sync jobs for", - "deprecated": false, - "schema": { - "$ref": "#/components/schemas/_types:Id" - }, - "style": "form" - }, - { - "in": "query", - "name": "job_type", - "description": "A comma-separated list of job types to fetch the sync jobs for", - "deprecated": false, - "schema": { - "$ref": "#/components/schemas/_types:Names" - }, - "style": "form" - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "count": { - "type": "number" - }, - "results": { - "type": "array", - "items": { - "$ref": "#/components/schemas/connector_sync_job._types:ConnectorSyncJob" - } - } - }, - "required": [ - "count", - "results" - ] - } - } - } - } - } - }, - "post": { - "tags": [ - "connector_sync_job.post" - ], - "summary": "Creates a connector sync job.", - "description": "Creates a connector sync job.", - "externalDocs": { - "url": "https://www.elastic.co/guide/en/elasticsearch/reference/current/create-connector-sync-job-api.html" - }, - "operationId": "connector-sync-job-post", - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "id": { - "$ref": "#/components/schemas/_types:Id" - }, - "job_type": { - "$ref": "#/components/schemas/_types:Name" - }, - "trigger_method": { - "$ref": "#/components/schemas/_types:Name" - } - }, - "required": [ - "id" - ] - } - } - }, - "required": true - }, - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "id": { - "$ref": "#/components/schemas/_types:Id" - } - }, - "required": [ - "id" - ] - } - } - } - } - } - } - }, "/_count": { "get": { "tags": [ @@ -50167,23 +50167,23 @@ "description": "A `null` value that is to be interpreted as an actual value, unless other uses of `null` that are equivalent\nto a missing value. It is used for exemple in settings, where using the `NullValue` for a setting will reset\nit to its default value.", "type": "string" }, - "connector_sync_job._types:ConnectorSyncJob": { + "connector._types:ConnectorSyncJob": { "type": "object", "properties": { "cancelation_requested_at": { - "type": "string" + "$ref": "#/components/schemas/_types:DateTime" }, "canceled_at": { - "type": "string" + "$ref": "#/components/schemas/_types:DateTime" }, "completed_at": { - "type": "string" + "$ref": "#/components/schemas/_types:DateTime" }, "connector": { - "$ref": "#/components/schemas/connector_sync_job._types:SyncJobConnectorReference" + "$ref": "#/components/schemas/connector._types:SyncJobConnectorReference" }, "created_at": { - "type": "string" + "$ref": "#/components/schemas/_types:DateTime" }, "deleted_document_count": { "type": "number" @@ -50201,10 +50201,10 @@ "type": "number" }, "job_type": { - "$ref": "#/components/schemas/connector_sync_job._types:SyncJobType" + "$ref": "#/components/schemas/connector._types:SyncJobType" }, "last_seen": { - "type": "string" + "$ref": "#/components/schemas/_types:DateTime" }, "metadata": { "type": "object", @@ -50213,7 +50213,7 @@ } }, "started_at": { - "type": "string" + "$ref": "#/components/schemas/_types:DateTime" }, "status": { "$ref": "#/components/schemas/connector._types:SyncStatus" @@ -50222,7 +50222,7 @@ "type": "number" }, "trigger_method": { - "$ref": "#/components/schemas/connector_sync_job._types:TriggerMethod" + "$ref": "#/components/schemas/connector._types:TriggerMethod" }, "worker_hostname": { "type": "string" @@ -50238,10 +50238,11 @@ "job_type", "metadata", "status", + "total_document_count", "trigger_method" ] }, - "connector_sync_job._types:SyncJobConnectorReference": { + "connector._types:SyncJobConnectorReference": { "type": "object", "properties": { "configuration": { @@ -50271,11 +50272,10 @@ "filtering", "id", "index_name", - "pipeline", "service_type" ] }, - "connector_sync_job._types:SyncJobType": { + "connector._types:SyncJobType": { "type": "string", "enum": [ "full", @@ -50283,7 +50283,7 @@ "access_control" ] }, - "connector_sync_job._types:TriggerMethod": { + "connector._types:TriggerMethod": { "type": "string", "enum": [ "on_demand", diff --git a/output/schema/schema.json b/output/schema/schema.json index c8de0fef3a..1a3303620f 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -106467,8 +106467,8 @@ "type": { "kind": "instance_of", "type": { - "name": "string", - "namespace": "_builtins" + "name": "DateTime", + "namespace": "_types" } } }, @@ -106478,8 +106478,8 @@ "type": { "kind": "instance_of", "type": { - "name": "string", - "namespace": "_builtins" + "name": "DateTime", + "namespace": "_types" } } }, @@ -106489,8 +106489,8 @@ "type": { "kind": "instance_of", "type": { - "name": "string", - "namespace": "_builtins" + "name": "DateTime", + "namespace": "_types" } } }, @@ -106511,8 +106511,8 @@ "type": { "kind": "instance_of", "type": { - "name": "string", - "namespace": "_builtins" + "name": "DateTime", + "namespace": "_types" } } }, @@ -106588,8 +106588,8 @@ "type": { "kind": "instance_of", "type": { - "name": "string", - "namespace": "_builtins" + "name": "DateTime", + "namespace": "_types" } } }, @@ -106617,8 +106617,8 @@ "type": { "kind": "instance_of", "type": { - "name": "string", - "namespace": "_builtins" + "name": "DateTime", + "namespace": "_types" } } }, @@ -106635,7 +106635,7 @@ }, { "name": "total_document_count", - "required": false, + "required": true, "type": { "kind": "instance_of", "type": { @@ -106667,7 +106667,7 @@ } } ], - "specLocation": "connector/_types/SyncJob.ts#L51-L70" + "specLocation": "connector/_types/SyncJob.ts#L52-L71" }, { "kind": "interface", @@ -107605,7 +107605,7 @@ }, { "name": "pipeline", - "required": true, + "required": false, "type": { "kind": "instance_of", "type": { @@ -107626,7 +107626,7 @@ } } ], - "specLocation": "connector/_types/SyncJob.ts#L30-L38" + "specLocation": "connector/_types/SyncJob.ts#L31-L39" }, { "kind": "enum", @@ -107645,7 +107645,7 @@ "name": "SyncJobType", "namespace": "connector._types" }, - "specLocation": "connector/_types/SyncJob.ts#L40-L44" + "specLocation": "connector/_types/SyncJob.ts#L41-L45" }, { "kind": "interface", @@ -107724,7 +107724,7 @@ "name": "TriggerMethod", "namespace": "connector._types" }, - "specLocation": "connector/_types/SyncJob.ts#L46-L49" + "specLocation": "connector/_types/SyncJob.ts#L47-L50" }, { "kind": "type_alias", diff --git a/output/typescript/types.ts b/output/typescript/types.ts index 4781ba9e72..8eb824e158 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -9141,22 +9141,22 @@ export interface ConnectorConnectorScheduling { export type ConnectorConnectorStatus = 'created' | 'needs_configuration' | 'configured' | 'connected' | 'error' export interface ConnectorConnectorSyncJob { - cancelation_requested_at?: string - canceled_at?: string - completed_at?: string + cancelation_requested_at?: DateTime + canceled_at?: DateTime + completed_at?: DateTime connector: ConnectorSyncJobConnectorReference - created_at: string + created_at: DateTime deleted_document_count: long error?: string id: Id indexed_document_count: long indexed_document_volume: long job_type: ConnectorSyncJobType - last_seen?: string + last_seen?: DateTime metadata: Record - started_at?: string + started_at?: DateTime status: ConnectorSyncStatus - total_document_count?: long + total_document_count: long trigger_method: ConnectorTriggerMethod worker_hostname?: string } @@ -9282,7 +9282,7 @@ export interface ConnectorSyncJobConnectorReference { id: Id index_name: string language?: string - pipeline: ConnectorIngestPipelineParams + pipeline?: ConnectorIngestPipelineParams service_type: string } diff --git a/specification/_json_spec/connector.sync_job_cancel.json b/specification/_json_spec/connector.sync_job_cancel.json index 4f0729a3a1..443ba76d0c 100644 --- a/specification/_json_spec/connector.sync_job_cancel.json +++ b/specification/_json_spec/connector.sync_job_cancel.json @@ -7,17 +7,13 @@ "stability": "experimental", "visibility": "public", "headers": { - "accept": [ - "application/json" - ] + "accept": ["application/json"] }, "url": { "paths": [ { "path": "/_connector/_sync_job/{connector_sync_job_id}/_cancel", - "methods": [ - "PUT" - ], + "methods": ["PUT"], "parts": { "connector_sync_job_id": { "type": "string", diff --git a/specification/_json_spec/connector.sync_job_delete.json b/specification/_json_spec/connector.sync_job_delete.json index 591cb8f0cc..32de4b18a1 100644 --- a/specification/_json_spec/connector.sync_job_delete.json +++ b/specification/_json_spec/connector.sync_job_delete.json @@ -7,17 +7,13 @@ "stability": "experimental", "visibility": "public", "headers": { - "accept": [ - "application/json" - ] + "accept": ["application/json"] }, "url": { "paths": [ { "path": "/_connector/_sync_job/{connector_sync_job_id}", - "methods": [ - "DELETE" - ], + "methods": ["DELETE"], "parts": { "connector_sync_job_id": { "type": "string", diff --git a/specification/_json_spec/connector.sync_job_get.json b/specification/_json_spec/connector.sync_job_get.json index 8a46a1eecc..52c2285cd0 100644 --- a/specification/_json_spec/connector.sync_job_get.json +++ b/specification/_json_spec/connector.sync_job_get.json @@ -7,17 +7,13 @@ "stability": "experimental", "visibility": "public", "headers": { - "accept": [ - "application/json" - ] + "accept": ["application/json"] }, "url": { "paths": [ { "path": "/_connector/_sync_job/{connector_sync_job_id}", - "methods": [ - "GET" - ], + "methods": ["GET"], "parts": { "connector_sync_job_id": { "type": "string", diff --git a/specification/_json_spec/connector.sync_job_list.json b/specification/_json_spec/connector.sync_job_list.json index 737028ce78..7a58ea257d 100644 --- a/specification/_json_spec/connector.sync_job_list.json +++ b/specification/_json_spec/connector.sync_job_list.json @@ -7,17 +7,13 @@ "stability": "experimental", "visibility": "public", "headers": { - "accept": [ - "application/json" - ] + "accept": ["application/json"] }, "url": { "paths": [ { "path": "/_connector/_sync_job", - "methods": [ - "GET" - ] + "methods": ["GET"] } ] }, diff --git a/specification/_json_spec/connector.sync_job_post.json b/specification/_json_spec/connector.sync_job_post.json index 88069718db..2fd0eb5577 100644 --- a/specification/_json_spec/connector.sync_job_post.json +++ b/specification/_json_spec/connector.sync_job_post.json @@ -7,20 +7,14 @@ "stability": "experimental", "visibility": "public", "headers": { - "accept": [ - "application/json" - ], - "content_type": [ - "application/json" - ] + "accept": ["application/json"], + "content_type": ["application/json"] }, "url": { "paths": [ { "path": "/_connector/_sync_job", - "methods": [ - "POST" - ] + "methods": ["POST"] } ] }, diff --git a/specification/connector/_types/SyncJob.ts b/specification/connector/_types/SyncJob.ts index 5ce81ff529..525536a9e7 100644 --- a/specification/connector/_types/SyncJob.ts +++ b/specification/connector/_types/SyncJob.ts @@ -16,55 +16,56 @@ * specific language governing permissions and limitations * under the License. */ -import { Id } from "@_types/common"; -import { long } from "@_types/Numeric"; -import { Dictionary } from "@spec_utils/Dictionary"; -import { UserDefinedValue } from "@spec_utils/UserDefinedValue"; +import { Id } from '@_types/common' +import { long } from '@_types/Numeric' +import { DateTime } from '@_types/Time' +import { Dictionary } from '@spec_utils/Dictionary' +import { UserDefinedValue } from '@spec_utils/UserDefinedValue' import { ConnectorConfiguration, FilteringConfig, IngestPipelineParams, - SyncStatus, -} from "./Connector"; + SyncStatus +} from './Connector' interface SyncJobConnectorReference { - configuration: ConnectorConfiguration; - filtering: FilteringConfig; - id: Id; - index_name: string; - language?: string; - pipeline: IngestPipelineParams; - service_type: string; + configuration: ConnectorConfiguration + filtering: FilteringConfig + id: Id + index_name: string + language?: string + pipeline?: IngestPipelineParams + service_type: string } enum SyncJobType { full, incremental, - access_control, + access_control } enum TriggerMethod { on_demand, - scheduled, + scheduled } export interface ConnectorSyncJob { - cancelation_requested_at?: string; - canceled_at?: string; - completed_at?: string; - connector: SyncJobConnectorReference; - created_at: string; - deleted_document_count: long; - error?: string; - id: Id; - indexed_document_count: long; - indexed_document_volume: long; - job_type: SyncJobType; - last_seen?: string; - metadata: Dictionary; - started_at?: string; - status: SyncStatus; - total_document_count?: long; - trigger_method: TriggerMethod; - worker_hostname?: string; + cancelation_requested_at?: DateTime + canceled_at?: DateTime + completed_at?: DateTime + connector: SyncJobConnectorReference + created_at: DateTime + deleted_document_count: long + error?: string + id: Id + indexed_document_count: long + indexed_document_volume: long + job_type: SyncJobType + last_seen?: DateTime + metadata: Dictionary + started_at?: DateTime + status: SyncStatus + total_document_count: long + trigger_method: TriggerMethod + worker_hostname?: string } diff --git a/specification/connector/sync_job_cancel/SyncJobCancelRequest.ts b/specification/connector/sync_job_cancel/SyncJobCancelRequest.ts index 2260fdf469..49509568d6 100644 --- a/specification/connector/sync_job_cancel/SyncJobCancelRequest.ts +++ b/specification/connector/sync_job_cancel/SyncJobCancelRequest.ts @@ -16,8 +16,8 @@ * specific language governing permissions and limitations * under the License. */ -import { RequestBase } from "@_types/Base"; -import { Id } from "@_types/common"; +import { RequestBase } from '@_types/Base' +import { Id } from '@_types/common' /** * Cancels a connector sync job. @@ -31,6 +31,6 @@ export interface Request extends RequestBase { /** * The unique identifier of the connector sync job */ - connector_sync_job_id: Id; - }; + connector_sync_job_id: Id + } } diff --git a/specification/connector/sync_job_delete/SyncJobDeleteRequest.ts b/specification/connector/sync_job_delete/SyncJobDeleteRequest.ts index cfc9efa67f..3e70880363 100644 --- a/specification/connector/sync_job_delete/SyncJobDeleteRequest.ts +++ b/specification/connector/sync_job_delete/SyncJobDeleteRequest.ts @@ -16,8 +16,8 @@ * specific language governing permissions and limitations * under the License. */ -import { RequestBase } from "@_types/Base"; -import { Id } from "@_types/common"; +import { RequestBase } from '@_types/Base' +import { Id } from '@_types/common' /** * Deletes a connector sync job. @@ -31,6 +31,6 @@ export interface Request extends RequestBase { /** * The unique identifier of the connector sync job to be deleted */ - connector_sync_job_id: Id; - }; + connector_sync_job_id: Id + } } diff --git a/specification/connector/sync_job_get/SyncJobGetRequest.ts b/specification/connector/sync_job_get/SyncJobGetRequest.ts index a919093163..877ffa9998 100644 --- a/specification/connector/sync_job_get/SyncJobGetRequest.ts +++ b/specification/connector/sync_job_get/SyncJobGetRequest.ts @@ -16,8 +16,8 @@ * specific language governing permissions and limitations * under the License. */ -import { RequestBase } from "@_types/Base"; -import { Id } from "@_types/common"; +import { RequestBase } from '@_types/Base' +import { Id } from '@_types/common' /** * Retrieves a connector sync job. @@ -31,6 +31,6 @@ export interface Request extends RequestBase { /** * The unique identifier of the connector sync job */ - connector_sync_job_id: Id; - }; + connector_sync_job_id: Id + } } diff --git a/specification/connector/sync_job_get/SyncJobGetResponse.ts b/specification/connector/sync_job_get/SyncJobGetResponse.ts index 4c05cedc67..d99c57ee7f 100644 --- a/specification/connector/sync_job_get/SyncJobGetResponse.ts +++ b/specification/connector/sync_job_get/SyncJobGetResponse.ts @@ -17,8 +17,8 @@ * under the License. */ -import { ConnectorSyncJob } from "../_types/SyncJob"; +import { ConnectorSyncJob } from '../_types/SyncJob' export class Response { - body: ConnectorSyncJob; + body: ConnectorSyncJob } diff --git a/specification/connector/sync_job_list/SyncJobListRequest.ts b/specification/connector/sync_job_list/SyncJobListRequest.ts index d1a8367eda..d9f521873a 100644 --- a/specification/connector/sync_job_list/SyncJobListRequest.ts +++ b/specification/connector/sync_job_list/SyncJobListRequest.ts @@ -16,9 +16,9 @@ * specific language governing permissions and limitations * under the License. */ -import { RequestBase } from "@_types/Base"; -import { Names, Id, Name } from "@_types/common"; -import { integer } from "@_types/Numeric"; +import { RequestBase } from '@_types/Base' +import { Names, Id, Name } from '@_types/common' +import { integer } from '@_types/Numeric' /** * Lists connector sync jobs. @@ -32,22 +32,22 @@ export interface Request extends RequestBase { /** * Starting offset (default: 0) */ - from?: integer; + from?: integer /** * Specifies a max number of results to get */ - size?: integer; + size?: integer /** * A sync job status to fetch connector sync jobs for */ - status?: Name; + status?: Name /** * A connector id to fetch connector sync jobs for */ - connector_id?: Id; + connector_id?: Id /** * A comma-separated list of job types to fetch the sync jobs for */ - job_type?: Names; - }; + job_type?: Names + } } diff --git a/specification/connector/sync_job_list/SyncJobListResponse.ts b/specification/connector/sync_job_list/SyncJobListResponse.ts index cd76395714..f695d6fab6 100644 --- a/specification/connector/sync_job_list/SyncJobListResponse.ts +++ b/specification/connector/sync_job_list/SyncJobListResponse.ts @@ -17,12 +17,12 @@ * under the License. */ -import { long } from "@_types/Numeric"; -import { ConnectorSyncJob } from "../_types/SyncJob"; +import { long } from '@_types/Numeric' +import { ConnectorSyncJob } from '../_types/SyncJob' export class Response { body: { - count: long; - results: ConnectorSyncJob[]; - }; + count: long + results: ConnectorSyncJob[] + } } diff --git a/specification/connector/sync_job_post/SyncJobPostRequest.ts b/specification/connector/sync_job_post/SyncJobPostRequest.ts index 89986e7739..5c22d62c34 100644 --- a/specification/connector/sync_job_post/SyncJobPostRequest.ts +++ b/specification/connector/sync_job_post/SyncJobPostRequest.ts @@ -16,8 +16,8 @@ * specific language governing permissions and limitations * under the License. */ -import { RequestBase } from "@_types/Base"; -import { Id, Name } from "@_types/common"; +import { RequestBase } from '@_types/Base' +import { Id, Name } from '@_types/common' /** * Creates a connector sync job. @@ -35,8 +35,8 @@ export interface Request extends RequestBase { /** * The id of the associated connector */ - id: Id; - job_type?: Name; - trigger_method?: Name; - }; + id: Id + job_type?: Name + trigger_method?: Name + } } From ba2f719ceb963c4a8e6c13cd170031190f17bca8 Mon Sep 17 00:00:00 2001 From: Jedr Blaszyk Date: Wed, 17 Apr 2024 11:36:51 +0200 Subject: [PATCH 7/8] Make types in sync_job_post more specific --- .../elasticsearch-serverless-openapi.json | 8 ++-- output/schema/schema.json | 44 +++++++++---------- output/typescript/types.ts | 10 ++--- specification/connector/_types/SyncJob.ts | 6 +-- .../sync_job_post/SyncJobPostRequest.ts | 7 +-- 5 files changed, 38 insertions(+), 37 deletions(-) diff --git a/output/openapi/elasticsearch-serverless-openapi.json b/output/openapi/elasticsearch-serverless-openapi.json index b90fa3ebee..7389a8e330 100644 --- a/output/openapi/elasticsearch-serverless-openapi.json +++ b/output/openapi/elasticsearch-serverless-openapi.json @@ -2495,10 +2495,10 @@ "$ref": "#/components/schemas/_types:Id" }, "job_type": { - "$ref": "#/components/schemas/_types:Name" + "$ref": "#/components/schemas/connector._types:SyncJobType" }, "trigger_method": { - "$ref": "#/components/schemas/_types:Name" + "$ref": "#/components/schemas/connector._types:SyncJobTriggerMethod" } }, "required": [ @@ -50222,7 +50222,7 @@ "type": "number" }, "trigger_method": { - "$ref": "#/components/schemas/connector._types:TriggerMethod" + "$ref": "#/components/schemas/connector._types:SyncJobTriggerMethod" }, "worker_hostname": { "type": "string" @@ -50283,7 +50283,7 @@ "access_control" ] }, - "connector._types:TriggerMethod": { + "connector._types:SyncJobTriggerMethod": { "type": "string", "enum": [ "on_demand", diff --git a/output/schema/schema.json b/output/schema/schema.json index 1a3303620f..530c7876c7 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -106650,7 +106650,7 @@ "type": { "kind": "instance_of", "type": { - "name": "TriggerMethod", + "name": "SyncJobTriggerMethod", "namespace": "connector._types" } } @@ -107628,6 +107628,22 @@ ], "specLocation": "connector/_types/SyncJob.ts#L31-L39" }, + { + "kind": "enum", + "members": [ + { + "name": "on_demand" + }, + { + "name": "scheduled" + } + ], + "name": { + "name": "SyncJobTriggerMethod", + "namespace": "connector._types" + }, + "specLocation": "connector/_types/SyncJob.ts#L47-L50" + }, { "kind": "enum", "members": [ @@ -107710,22 +107726,6 @@ }, "specLocation": "connector/_types/Connector.ts#L137-L145" }, - { - "kind": "enum", - "members": [ - { - "name": "on_demand" - }, - { - "name": "scheduled" - } - ], - "name": { - "name": "TriggerMethod", - "namespace": "connector._types" - }, - "specLocation": "connector/_types/SyncJob.ts#L47-L50" - }, { "kind": "type_alias", "name": { @@ -108866,8 +108866,8 @@ "type": { "kind": "instance_of", "type": { - "name": "Name", - "namespace": "_types" + "name": "SyncJobType", + "namespace": "connector._types" } } }, @@ -108877,8 +108877,8 @@ "type": { "kind": "instance_of", "type": { - "name": "Name", - "namespace": "_types" + "name": "SyncJobTriggerMethod", + "namespace": "connector._types" } } } @@ -108898,7 +108898,7 @@ }, "path": [], "query": [], - "specLocation": "connector/sync_job_post/SyncJobPostRequest.ts#L22-L42" + "specLocation": "connector/sync_job_post/SyncJobPostRequest.ts#L23-L43" }, { "body": { diff --git a/output/typescript/types.ts b/output/typescript/types.ts index 8eb824e158..6b0007c957 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -9157,7 +9157,7 @@ export interface ConnectorConnectorSyncJob { started_at?: DateTime status: ConnectorSyncStatus total_document_count: long - trigger_method: ConnectorTriggerMethod + trigger_method: ConnectorSyncJobTriggerMethod worker_hostname?: string } @@ -9286,6 +9286,8 @@ export interface ConnectorSyncJobConnectorReference { service_type: string } +export type ConnectorSyncJobTriggerMethod = 'on_demand' | 'scheduled' + export type ConnectorSyncJobType = 'full' | 'incremental' | 'access_control' export interface ConnectorSyncRulesFeature { @@ -9295,8 +9297,6 @@ export interface ConnectorSyncRulesFeature { export type ConnectorSyncStatus = 'canceling' | 'canceled' | 'completed' | 'error' | 'in_progress' | 'pending' | 'suspended' -export type ConnectorTriggerMethod = 'on_demand' | 'scheduled' - export type ConnectorValidation = ConnectorLessThanValidation | ConnectorGreaterThanValidation | ConnectorListTypeValidation | ConnectorIncludedInValidation | ConnectorRegexValidation export interface ConnectorCheckInRequest extends RequestBase { @@ -9421,8 +9421,8 @@ export interface ConnectorSyncJobListResponse { export interface ConnectorSyncJobPostRequest extends RequestBase { body?: { id: Id - job_type?: Name - trigger_method?: Name + job_type?: ConnectorSyncJobType + trigger_method?: ConnectorSyncJobTriggerMethod } } diff --git a/specification/connector/_types/SyncJob.ts b/specification/connector/_types/SyncJob.ts index 525536a9e7..c8ac3deed2 100644 --- a/specification/connector/_types/SyncJob.ts +++ b/specification/connector/_types/SyncJob.ts @@ -38,13 +38,13 @@ interface SyncJobConnectorReference { service_type: string } -enum SyncJobType { +export enum SyncJobType { full, incremental, access_control } -enum TriggerMethod { +export enum SyncJobTriggerMethod { on_demand, scheduled } @@ -66,6 +66,6 @@ export interface ConnectorSyncJob { started_at?: DateTime status: SyncStatus total_document_count: long - trigger_method: TriggerMethod + trigger_method: SyncJobTriggerMethod worker_hostname?: string } diff --git a/specification/connector/sync_job_post/SyncJobPostRequest.ts b/specification/connector/sync_job_post/SyncJobPostRequest.ts index 5c22d62c34..cccc2e59a8 100644 --- a/specification/connector/sync_job_post/SyncJobPostRequest.ts +++ b/specification/connector/sync_job_post/SyncJobPostRequest.ts @@ -17,7 +17,8 @@ * under the License. */ import { RequestBase } from '@_types/Base' -import { Id, Name } from '@_types/common' +import { Id } from '@_types/common' +import { SyncJobType, SyncJobTriggerMethod } from '../_types/SyncJob' /** * Creates a connector sync job. @@ -36,7 +37,7 @@ export interface Request extends RequestBase { * The id of the associated connector */ id: Id - job_type?: Name - trigger_method?: Name + job_type?: SyncJobType + trigger_method?: SyncJobTriggerMethod } } From b73b1e292306e1246905670cf336c164033683b3 Mon Sep 17 00:00:00 2001 From: Jedr Blaszyk Date: Thu, 18 Apr 2024 10:59:43 +0200 Subject: [PATCH 8/8] Address review feedback --- .../elasticsearch-serverless-openapi.json | 7 +++++-- output/schema/schema.json | 17 ++++++++++------- output/typescript/types.ts | 4 ++-- .../sync_job_list/SyncJobListRequest.ts | 8 +++++--- 4 files changed, 22 insertions(+), 14 deletions(-) diff --git a/output/openapi/elasticsearch-serverless-openapi.json b/output/openapi/elasticsearch-serverless-openapi.json index 66a85d6abf..a40076b038 100644 --- a/output/openapi/elasticsearch-serverless-openapi.json +++ b/output/openapi/elasticsearch-serverless-openapi.json @@ -2428,7 +2428,7 @@ "description": "A sync job status to fetch connector sync jobs for", "deprecated": false, "schema": { - "$ref": "#/components/schemas/_types:Name" + "$ref": "#/components/schemas/connector._types:SyncStatus" }, "style": "form" }, @@ -2448,7 +2448,10 @@ "description": "A comma-separated list of job types to fetch the sync jobs for", "deprecated": false, "schema": { - "$ref": "#/components/schemas/_types:Names" + "type": "array", + "items": { + "$ref": "#/components/schemas/connector._types:SyncJobType" + } }, "style": "form" } diff --git a/output/schema/schema.json b/output/schema/schema.json index 6eb61b12b7..ab00978449 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -108914,8 +108914,8 @@ "type": { "kind": "instance_of", "type": { - "name": "Name", - "namespace": "_types" + "name": "SyncStatus", + "namespace": "connector._types" } } }, @@ -108936,15 +108936,18 @@ "name": "job_type", "required": false, "type": { - "kind": "instance_of", - "type": { - "name": "Names", - "namespace": "_types" + "kind": "array_of", + "value": { + "kind": "instance_of", + "type": { + "name": "SyncJobType", + "namespace": "connector._types" + } } } } ], - "specLocation": "connector/sync_job_list/SyncJobListRequest.ts#L23-L53" + "specLocation": "connector/sync_job_list/SyncJobListRequest.ts#L25-L55" }, { "body": { diff --git a/output/typescript/types.ts b/output/typescript/types.ts index 70dfbaf4d8..be1a9263bf 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -9420,9 +9420,9 @@ export type ConnectorSyncJobGetResponse = ConnectorConnectorSyncJob export interface ConnectorSyncJobListRequest extends RequestBase { from?: integer size?: integer - status?: Name + status?: ConnectorSyncStatus connector_id?: Id - job_type?: Names + job_type?: ConnectorSyncJobType[] } export interface ConnectorSyncJobListResponse { diff --git a/specification/connector/sync_job_list/SyncJobListRequest.ts b/specification/connector/sync_job_list/SyncJobListRequest.ts index d9f521873a..00f4f0254f 100644 --- a/specification/connector/sync_job_list/SyncJobListRequest.ts +++ b/specification/connector/sync_job_list/SyncJobListRequest.ts @@ -17,8 +17,10 @@ * under the License. */ import { RequestBase } from '@_types/Base' -import { Names, Id, Name } from '@_types/common' +import { Id } from '@_types/common' import { integer } from '@_types/Numeric' +import { SyncJobType } from '../_types/SyncJob' +import { SyncStatus } from '../_types/Connector' /** * Lists connector sync jobs. @@ -40,7 +42,7 @@ export interface Request extends RequestBase { /** * A sync job status to fetch connector sync jobs for */ - status?: Name + status?: SyncStatus /** * A connector id to fetch connector sync jobs for */ @@ -48,6 +50,6 @@ export interface Request extends RequestBase { /** * A comma-separated list of job types to fetch the sync jobs for */ - job_type?: Names + job_type?: SyncJobType[] } }