feat(openapi): complete upload preview and UI evidence
This commit is contained in:
+22
-6
@@ -409,13 +409,29 @@
|
||||
}
|
||||
return result;
|
||||
},
|
||||
previewOpenApiImport: function(workspaceId, documentText) {
|
||||
return post('/workspaces/' + encodeURIComponent(workspaceId) + '/imports/openapi/preview', {
|
||||
document: documentText,
|
||||
});
|
||||
previewOpenApiImport: function(workspaceId, file, options) {
|
||||
var form = new FormData();
|
||||
form.append('file', file, file.name);
|
||||
return request(
|
||||
API_BASE + '/workspaces/' + encodeURIComponent(workspaceId) + '/imports/openapi/preview',
|
||||
{
|
||||
method: 'POST',
|
||||
// Do not set Content-Type here: the browser owns the multipart boundary.
|
||||
headers: headers({
|
||||
'Accept-Language': localStorage.getItem('crank_lang') === 'ru' ? 'ru' : 'en',
|
||||
}),
|
||||
body: form,
|
||||
signal: options && options.signal,
|
||||
}
|
||||
);
|
||||
},
|
||||
createOpenApiImport: function(workspaceId, jobId, payload) {
|
||||
return post('/workspaces/' + encodeURIComponent(workspaceId) + '/imports/openapi/' + encodeURIComponent(jobId) + '/create', payload);
|
||||
createOpenApiImport: function(workspaceId, jobId, payload, options) {
|
||||
return request(API_BASE + '/workspaces/' + encodeURIComponent(workspaceId) + '/imports/openapi/' + encodeURIComponent(jobId) + '/create', {
|
||||
method: 'POST',
|
||||
headers: headers({ 'Content-Type': 'application/json' }),
|
||||
body: JSON.stringify(payload),
|
||||
signal: options && options.signal,
|
||||
});
|
||||
},
|
||||
listAgents: function(workspaceId) {
|
||||
return get('/workspaces/' + encodeURIComponent(workspaceId) + '/agents');
|
||||
|
||||
Reference in New Issue
Block a user