import { IStepConnectorForm } from '../catalogo-protocol'; import { icon } from './mock-connectors'; const steps: IStepConnectorForm[] = [ { title: 'REST WITH AUTHENTICATION CONNECTOR OVERVIEW', description: 'Complete Rest Connector Service', version: '1.0.0', type: "overview", url: 'https://sysmapsolutions.atlassian.net/wiki/spaces/QKSDOC/pages/690028581/Catalogo', image: icon }, { title: 'REST WITH AUTHENTICATION CONNECTOR DEFINITION', description: 'Define which API will be target', version: '1.0.0', type: "step", content: { metadata: { init: [], data: { "title": "", "type": "object", "properties": { "apiURL": { "title": "Enter a valid URL for contract", "type": "string" }, "contentBase64": { "title": "Or Upload a file", "type": "string" }, "hasAuthentication": { "title": " ", "type": "boolean" }, "username": { "title": "If authentication set username", "type": "string" }, "password": { "title": "So set password", "type": "string" } }, "dependencies": { } } }, ui: { "apiURL": { "ui:widget": "AntdInput" }, "contentBase64": { "ui:widget": "AntdUpload", "ui:options": { title: 'Click or drag file to this area to upload', hint: 'Suport .json, .yaml or .yml files', accept: '.json,.yaml,.yml' } }, "hasAuthentication": { "ui:widget": "AntdCheckBox", "ui:options": { checkBoxText: 'Has Autentication?', } }, "username": { "ui:widget": "AntdInput" }, "password": { "ui:widget": "AntdPassword" } }, relationships: [ ], submit: { request: { base: "http://openapi-parser.studio.quarks-ecosystem.io", endpoint: { source: '/openapi/details', params: [] }, data: {}, header: { "Content-Type": "application/json" }, headerParser: { formatter: { format: { 'Authorization': 'Basic <%= username %> : <%= password %>' }, params: [ { param: 'username', source: 'formData(username)' }, { param: 'password', source: 'encode(formData(password))' } ] } }, method: "post", bodyParser: { formatter: { format: { apiURL: '<%= apiURL %>', contentBase64: '<%= contentBase64 %>' }, params: [ { param: 'apiURL', source: 'formData(apiURL)' }, { param: 'contentBase64', source: 'fileContent(formData(contentBase64))' } ] } } }, styles: { text: 'Send', position: 'right' } } } }, { title: 'REST WITH AUTHENTICATION CONNECTOR CONFIGURATION', description: 'Finish Configuration Connector', version: '1.0.0', type: "submit", content: { metadata: { init: [ { resolve: 'context.step_1.paths', populate: { target: 'connectorEndpoint', enum: { source: '<%= path %>', params: [ { param: 'path', source: 'key(0)' } ] }, enumNames: { source: '<%= path %>', params: [ { param: 'path', source: 'key(0)' } ] } } } ], data: { "title": "", "type": "object", "properties": { "taskRetryConfiguration": { "title": "Retry Configuration(only for Long Running)", "type": "string" }, "replyConnectorErrors": { "title": " ", "type": "boolean" }, "mappingResponseHeaders": { "title": " ", "type": "boolean" }, "connectorEndpoint": { "title": "Select Endpoint", "type": "string", "enum": [ ], "enumNames": [ ] }, "connectorMethod": { "title": "Select Method", "type": "string", "enum": [ ], "enumNames": [ ] }, "authEndpoint": { "title": "REST Authentication Endpoint", "type": "string" }, "authMethod": { "title": "REST Authentication URI", "type": "string", "enum": [ 'get', 'head', 'post', 'put', 'delete', 'connect', 'options', 'trace' ], "enumNames": [ 'GET', 'HEAD', 'POST', 'PUT', 'DELETE', 'CONNECT', 'OPTIONS', 'TRACE' ] }, "authUri": { "title": "REST Authentication Uri", "type": "string" }, "authTTL": { "title": "REST Authentication TTL Cache", "type": "string" } }, "dependencies": { } } }, ui: { "taskRetryConfiguration": { "ui:widget": "AntdInput", "ui:options": { hint: `
Configuração de retry para task (Referência)
ex: R3/PT1M - 3 repetições com intervalo de 1 min
` } }, "replyConnectorErrors": { "ui:widget": "AntdCheckBox", "ui:options": { checkBoxText: 'Reply Connector Errors', hint: 'Defines whether connector error (statusCode and response body) will be propagated to the stream' } }, "mappingResponseHeaders": { "ui:widget": "AntdCheckBox", "ui:options": { checkBoxText: 'Mapping Response Headers', hint: 'Defines whether response headers will be added to the task output data context (json response only)' } }, "connectorEndpoint": { "ui:widget": "AntdSelect", "ui:options": { disabled: false, hidden: false, hint: 'REST operation endpoint (protocol + host + port)' } }, "connectorMethod": { "ui:widget": "AntdSelect", "ui:options": { disabled: false, hidden: false, hint: 'REST operation HTTP Method' } }, "authEndpoint": { "ui:widget": "AntdInput", "ui:options": { hint: 'Authentication REST operation endpoint (protocol + host + port)' } }, "authMethod": { "ui:widget": "AntdSelect", "ui:options": { disabled: false, hidden: false, hint: 'HTTP Method of Authentication REST Operation' } }, "authUri": { "ui:widget": "AntdInput", "ui:options": { disabled: false, hidden: false, hint: ` Authentication REST operation URI (path + parameters only)Examples: