feat(openapi): complete upload preview and UI evidence

This commit is contained in:
2026-08-28 15:38:14 +03:00
parent d2849ea3fe
commit 2c94af6791
35 changed files with 3655 additions and 537 deletions
+22 -6
View File
@@ -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');