feat(import): complete OpenAPI onboarding and verify delivery
This commit is contained in:
1 parent
bb3e376767
commit
e93de7015a
244 files changed
+57020
-5139
No files matched your search
@@ -328,6 +328,12 @@
|
||||
expected_revision: expectedRevision,
|
||||
});
|
||||
},
|
||||
registerOnboardingImportContext: function(workspaceId, payload) {
|
||||
return post('/workspaces/' + encodeURIComponent(workspaceId) + '/onboarding/import-context', payload);
|
||||
},
|
||||
selectOnboardingImportDraft: function(workspaceId, payload) {
|
||||
return post('/workspaces/' + encodeURIComponent(workspaceId) + '/onboarding/select-draft', payload);
|
||||
},
|
||||
updateWorkspace: function(workspaceId, payload) {
|
||||
return patch('/workspaces/' + encodeURIComponent(workspaceId), payload);
|
||||
},
|
||||
@@ -436,6 +442,35 @@
|
||||
signal: options && options.signal,
|
||||
});
|
||||
},
|
||||
createOpenApiImportPlan: function(workspaceId, jobId, payload, options) {
|
||||
return request(API_BASE + '/workspaces/' + encodeURIComponent(workspaceId) + '/imports/openapi/' + encodeURIComponent(jobId) + '/plans', {
|
||||
method: 'POST',
|
||||
headers: headers({
|
||||
'Content-Type': 'application/json',
|
||||
'Accept-Language': localStorage.getItem('crank_lang') === 'ru' ? 'ru' : 'en',
|
||||
}),
|
||||
body: JSON.stringify(payload),
|
||||
signal: options && options.signal,
|
||||
});
|
||||
},
|
||||
revalidateOpenApiImportPlan: function(workspaceId, planReference, options) {
|
||||
return request(API_BASE + '/workspaces/' + encodeURIComponent(workspaceId) + '/imports/openapi/plans/' + encodeURIComponent(planReference), {
|
||||
method: 'GET',
|
||||
headers: headers({ 'Accept-Language': localStorage.getItem('crank_lang') === 'ru' ? 'ru' : 'en' }),
|
||||
signal: options && options.signal,
|
||||
});
|
||||
},
|
||||
applyOpenApiImportPlan: function(workspaceId, planReference, payload, options) {
|
||||
return request(API_BASE + '/workspaces/' + encodeURIComponent(workspaceId) + '/imports/openapi/' + encodeURIComponent(planReference) + '/apply', {
|
||||
method: 'POST',
|
||||
headers: headers({
|
||||
'Content-Type': 'application/json',
|
||||
'Accept-Language': localStorage.getItem('crank_lang') === 'ru' ? 'ru' : 'en',
|
||||
}),
|
||||
body: JSON.stringify(payload),
|
||||
signal: options && options.signal,
|
||||
});
|
||||
},
|
||||
listAgents: function(workspaceId) {
|
||||
return get('/workspaces/' + encodeURIComponent(workspaceId) + '/agents');
|
||||
},
|
||||
|
||||
+216
-3
@@ -611,6 +611,27 @@ var TRANSLATIONS = {
|
||||
'wizard.step2.auth_mode.none': 'No auth',
|
||||
'wizard.step2.auth_mode.existing': 'Use existing authorization profile',
|
||||
'wizard.step2.auth_mode.create': 'Create authorization profile now',
|
||||
'openapi.error.plan_too_large': 'Select at most 512 operations and leave at most 512 excluded operations.',
|
||||
'openapi.security.alternative_label': 'Security alternative',
|
||||
'openapi.security.alternative_placeholder': 'Choose a security alternative',
|
||||
'openapi.security.no_auth': 'No authentication',
|
||||
'openapi.security.unsupported': 'unsupported',
|
||||
'openapi.security.profile_label': 'Auth Profile',
|
||||
'openapi.security.profile_placeholder': 'Choose an Auth Profile',
|
||||
'openapi.security.status_no_auth': 'No authentication',
|
||||
'openapi.security.status_required': 'Authentication required',
|
||||
'openapi.security.status_unresolved': 'Unresolved',
|
||||
'openapi.security.status_unverified': 'Unverified',
|
||||
'openapi.security.status_resolved': 'Resolved',
|
||||
'openapi.security.status_blocked': 'Blocked',
|
||||
'openapi.security.empty_profiles': 'No compatible Auth Profiles for the selected alternative. Choose another alternative or create a plan to revalidate.',
|
||||
'openapi.finding.unsupported_security_scheme': 'Some security requirements could not be imported. Choose a supported alternative or remove the unsupported requirement.',
|
||||
'openapi.finding.unsupported_security_and_requirement': 'This security requirement cannot be satisfied with a supported scheme or an available Auth Profile.',
|
||||
'openapi.error.security_with_skip': 'A skipped operation cannot be bound to an Auth Profile or a security alternative.',
|
||||
'openapi.error.auth_unavailable': 'The selected Auth Profile is unavailable or its required Secret is missing. Choose another compatible profile and create a new plan.',
|
||||
'openapi.error.auth_incompatible': 'The Auth Profile scheme does not match the selected security alternative. Choose a compatible alternative or profile and create a new plan.',
|
||||
'openapi.error.auth_profile_required': 'This operation requires an Auth Profile. Choose a compatible profile and create a new plan.',
|
||||
'openapi.error.security_alternative_required': 'The Auth Profile matches multiple security alternatives. Select the exact alternative and create a new plan.',
|
||||
'wizard.step2.auth_profile': 'Authorization profile',
|
||||
'wizard.step2.auth_profile_hint': 'The selected profile is applied automatically on every tool call.',
|
||||
'wizard.step2.auth_profile_empty': 'No authorization profiles yet. Create one below.',
|
||||
@@ -1658,6 +1679,27 @@ var TRANSLATIONS = {
|
||||
'wizard.step2.auth_mode.none': 'Без авторизации',
|
||||
'wizard.step2.auth_mode.existing': 'Использовать существующий профиль авторизации',
|
||||
'wizard.step2.auth_mode.create': 'Создать профиль авторизации сейчас',
|
||||
'openapi.error.plan_too_large': 'Выберите не более 512 операций и оставьте не более 512 исключённых операций.',
|
||||
'openapi.security.alternative_label': 'Вариант безопасности',
|
||||
'openapi.security.alternative_placeholder': 'Выберите вариант безопасности',
|
||||
'openapi.security.no_auth': 'Без аутентификации',
|
||||
'openapi.security.unsupported': 'не поддерживается',
|
||||
'openapi.security.profile_label': 'Профиль авторизации',
|
||||
'openapi.security.profile_placeholder': 'Выберите профиль авторизации',
|
||||
'openapi.security.status_no_auth': 'Без аутентификации',
|
||||
'openapi.security.status_required': 'Требуется аутентификация',
|
||||
'openapi.security.status_unresolved': 'Не разрешено',
|
||||
'openapi.security.status_unverified': 'Не проверено',
|
||||
'openapi.security.status_resolved': 'Разрешено',
|
||||
'openapi.security.status_blocked': 'Заблокировано',
|
||||
'openapi.security.empty_profiles': 'Для выбранного варианта нет совместимых профилей авторизации. Выберите другой вариант или создайте план для повторной проверки.',
|
||||
'openapi.finding.unsupported_security_scheme': 'Некоторые security requirements нельзя импортировать. Выберите поддерживаемый вариант или уберите неподдерживаемое требование.',
|
||||
'openapi.finding.unsupported_security_and_requirement': 'Это security requirement невозможно выполнить со схемой, поддержанной Crank, или доступным профилем авторизации.',
|
||||
'openapi.error.security_with_skip': 'Пропускаемая операция не может быть связана с профилем авторизации или вариантом безопасности.',
|
||||
'openapi.error.auth_unavailable': 'Выбранный профиль авторизации недоступен, либо отсутствует его обязательный Secret. Выберите другой совместимый профиль и создайте новый план.',
|
||||
'openapi.error.auth_incompatible': 'Схема профиля авторизации не совпадает с выбранным вариантом безопасности. Выберите совместимый вариант или профиль и создайте новый план.',
|
||||
'openapi.error.auth_profile_required': 'Для этой операции требуется профиль авторизации. Выберите совместимый профиль и создайте новый план.',
|
||||
'openapi.error.security_alternative_required': 'Профиль авторизации подходит к нескольким вариантам безопасности. Выберите точный вариант и создайте новый план.',
|
||||
'wizard.step2.auth_profile': 'Профиль авторизации',
|
||||
'wizard.step2.auth_profile_hint': 'Выбранный профиль применяется автоматически при каждом вызове инструмента.',
|
||||
'wizard.step2.auth_profile_empty': 'Профилей авторизации пока нет. Создайте профиль ниже.',
|
||||
@@ -2092,12 +2134,81 @@ Object.assign(TRANSLATIONS.en, {
|
||||
'openapi.method.all': 'All methods',
|
||||
'openapi.select_visible': 'Select visible',
|
||||
'openapi.clear_visible': 'Clear visible',
|
||||
'openapi.partial_mode': 'Enable partial import',
|
||||
'openapi.pagination.previous': 'Previous',
|
||||
'openapi.pagination.next': 'Next',
|
||||
'openapi.pagination.label': 'Preview pages',
|
||||
'openapi.pagination.plan_label': 'Import plan candidates',
|
||||
'openapi.pagination.result_label': 'Import results',
|
||||
'openapi.findings.summary': 'Findings: {count}',
|
||||
'openapi.pagination.status': 'Page {page} of {pages} · {total} matching operations',
|
||||
'openapi.create': 'Create drafts',
|
||||
'openapi.plan.create': 'Review import plan',
|
||||
'openapi.plan.confirm_title': 'Confirm import plan',
|
||||
'openapi.plan.confirm_intro': 'Review the exact server plan before applying it.',
|
||||
'openapi.plan.reopen': 'Reopen and check current plan',
|
||||
'openapi.plan.version': 'Review {version} · reference {reference} · digest {digest}',
|
||||
'openapi.plan.revalidation_pending': 'Checking this saved plan…',
|
||||
'openapi.plan.revalidation_current': 'The saved plan is current.',
|
||||
'openapi.plan.revalidation_stale': 'The saved plan is stale.',
|
||||
'openapi.plan.revalidation_error': 'The saved plan could not be verified.',
|
||||
'openapi.plan.revalidation_guidance': 'Return to the preview and create a new plan before applying.',
|
||||
'openapi.plan.back': 'Back to selection',
|
||||
'openapi.plan.back_fix': 'Back to fix decisions',
|
||||
'openapi.plan.apply': 'Apply import',
|
||||
'openapi.plan.blocked_help': 'Fix the decisions for blocked operations, then create a new plan.',
|
||||
'openapi.plan.exact_target': 'Exact operation',
|
||||
'openapi.plan.confirmed_name': 'Confirmed name',
|
||||
'openapi.decision.action_label': 'Import decision',
|
||||
'openapi.decision.create': 'Create',
|
||||
'openapi.decision.skip': 'Skip existing operation',
|
||||
'openapi.decision.rename': 'Create with a confirmed name',
|
||||
'openapi.decision.new_version': 'Create a new Draft Version',
|
||||
'openapi.decision.target_label': 'Existing operation',
|
||||
'openapi.decision.target_placeholder': 'Choose the exact operation',
|
||||
'openapi.decision.confirmed_name_label': 'Confirmed name',
|
||||
'openapi.decision.confirmed_name_placeholder': 'Enter the exact new name',
|
||||
'openapi.plan.selected': 'Selected: {count}',
|
||||
'openapi.plan.excluded': 'Excluded: {count}',
|
||||
'openapi.plan.actionable': 'Actionable: {count}',
|
||||
'openapi.plan.blocked': 'Blocked: {count}',
|
||||
'openapi.plan.versioning_new': 'Creates a new Draft Version. The Published Version and history remain unchanged.',
|
||||
'openapi.plan.action.create': 'Create a new Draft',
|
||||
'openapi.plan.action.new_version': 'Create a new Draft Version',
|
||||
'openapi.plan.action.rename': 'Create a separate Draft with the confirmed name',
|
||||
'openapi.plan.action.skip': 'Keep the existing operation unchanged',
|
||||
'openapi.plan.action.excluded': 'Excluded from this partial import',
|
||||
'openapi.plan.action.blocked': 'Blocked and will not be applied',
|
||||
'openapi.plan.result_title': 'Import plan result',
|
||||
'openapi.plan.outcome.created': 'Created',
|
||||
'openapi.plan.outcome.versioned': 'New Draft Version',
|
||||
'openapi.plan.outcome.renamed': 'Created with confirmed name',
|
||||
'openapi.plan.outcome.skipped': 'Skipped',
|
||||
'openapi.plan.outcome.excluded': 'Excluded',
|
||||
'openapi.plan.outcome.rejected': 'Rejected',
|
||||
'openapi.plan.summary': 'Applied: {applied}; skipped: {skipped}; excluded: {excluded}; rejected: {rejected}.',
|
||||
'openapi.plan.repreview': 'This plan is stale or could not be verified. Create a fresh preview and review a new plan.',
|
||||
'openapi.plan.resolve_conflict': 'Review the conflict decision and create a new plan before applying again.',
|
||||
'openapi.plan.retry_unknown': 'The Apply result is unknown. Retry sends the same plan reference, digest and idempotency key.',
|
||||
'openapi.status.planning': 'Preparing the import plan…',
|
||||
'openapi.status.plan_ready': 'Review the server plan and confirm to apply it.',
|
||||
'openapi.status.applying': 'Applying the import plan…',
|
||||
'openapi.status.applied': 'Import plan applied.',
|
||||
'openapi.error.plan': 'The import plan could not be created.',
|
||||
'openapi.error.apply': 'The import plan could not be applied.',
|
||||
'openapi.error.operations_unavailable': 'The workspace operations could not be loaded. Retry the preview before creating a plan.',
|
||||
'openapi.error.decision_target': 'Choose an exact existing operation for this decision.',
|
||||
'openapi.error.confirmed_name': 'Enter the exact confirmed name for the rename decision.',
|
||||
'openapi.error.decision_action': 'Choose a valid import decision.',
|
||||
'openapi.status.loading_operations': 'Checking existing workspace operations…',
|
||||
'openapi.selection.empty': 'Selected: 0',
|
||||
'openapi.selection': 'Selected: {selected} of {total}, shown: {visible}',
|
||||
'openapi.group.selection': 'selected {selected} of {total}, shown {visible}',
|
||||
'openapi.group.select': 'Select group',
|
||||
'openapi.group.select': 'Select group on this page',
|
||||
'openapi.operation.fields': 'inputs: {input} · outputs: {output}',
|
||||
'openapi.operation.readiness_actionable': 'Actionable',
|
||||
'openapi.operation.readiness_blocked': 'Blocked',
|
||||
'openapi.operation.readiness_unresolved': 'Authentication required',
|
||||
'openapi.mapping.path': 'Path',
|
||||
'openapi.mapping.query': 'Query',
|
||||
'openapi.mapping.header': 'Header',
|
||||
@@ -2106,6 +2217,8 @@ Object.assign(TRANSLATIONS.en, {
|
||||
'openapi.source.summary': '{name} · {size} · methods: {count}',
|
||||
'openapi.status.file_ready': 'File is ready for preview.',
|
||||
'openapi.status.previewing': 'Uploading and parsing the document…',
|
||||
'openapi.status.uploading': 'Uploading the document…',
|
||||
'openapi.status.parsing': 'Parsing the OpenAPI document…',
|
||||
'openapi.status.preview_ready': 'Document is ready. Select methods to import.',
|
||||
'openapi.status.creating': 'Creating drafts…',
|
||||
'openapi.status.created': 'Created: {created}; skipped: {skipped}.',
|
||||
@@ -2150,6 +2263,21 @@ Object.assign(TRANSLATIONS.en, {
|
||||
'openapi.result.fix': 'Fix in wizard',
|
||||
'openapi.result.open': 'Open in wizard',
|
||||
'openapi.result.skipped': 'Skipped',
|
||||
'openapi.result.skipped_count': 'Skipped: {count} candidates',
|
||||
'openapi.blockers.summary': 'Blocked operations: {count}',
|
||||
'onboarding.openapi_path': 'Start from an OpenAPI document',
|
||||
'onboarding.openapi_hint': 'Use the canonical OpenAPI import: preview, review the exact plan, then apply it atomically.',
|
||||
'onboarding.import.choose_draft': 'Choose one Draft to continue with test and publish',
|
||||
'onboarding.import.report_title': 'OpenAPI import report and Draft choices',
|
||||
'onboarding.import.continue': 'Continue with this Draft',
|
||||
'onboarding.import.selected': 'Selected for onboarding',
|
||||
'onboarding.import.drift': 'The selected Draft changed or is unavailable. Review the report and choose an available Draft again.',
|
||||
'onboarding.import.registration_pending': 'Import report is being registered. Refresh onboarding before selecting.',
|
||||
'onboarding.import.registration_failed': 'The import was applied, but its onboarding context could not be confirmed. Refresh to recover the report before continuing.',
|
||||
'onboarding.import.selection_failed': 'This Draft could not be selected. Refresh the report and review the current Draft choices.',
|
||||
'onboarding.import.conflict_reload': 'The onboarding state changed. The latest report has been loaded; review it before trying again.',
|
||||
'onboarding.import.retry_registration': 'Retry report recovery',
|
||||
'onboarding.import.view_report': 'View the full import report',
|
||||
|
||||
});
|
||||
|
||||
@@ -2208,12 +2336,81 @@ Object.assign(TRANSLATIONS.ru, {
|
||||
'openapi.method.all': 'Все методы',
|
||||
'openapi.select_visible': 'Выбрать видимые',
|
||||
'openapi.clear_visible': 'Снять видимые',
|
||||
'openapi.partial_mode': 'Включить частичный импорт',
|
||||
'openapi.pagination.previous': 'Назад',
|
||||
'openapi.pagination.next': 'Далее',
|
||||
'openapi.pagination.label': 'Страницы предпросмотра',
|
||||
'openapi.pagination.plan_label': 'Кандидаты плана импорта',
|
||||
'openapi.pagination.result_label': 'Результаты импорта',
|
||||
'openapi.findings.summary': 'Замечаний: {count}',
|
||||
'openapi.pagination.status': 'Страница {page} из {pages} · операций по фильтру: {total}',
|
||||
'openapi.create': 'Создать черновики',
|
||||
'openapi.plan.create': 'Проверить план импорта',
|
||||
'openapi.plan.confirm_title': 'Подтвердите план импорта',
|
||||
'openapi.plan.confirm_intro': 'Перед применением проверьте точный план сервера.',
|
||||
'openapi.plan.reopen': 'Повторно открыть и проверить план',
|
||||
'openapi.plan.version': 'Проверка {version} · ссылка {reference} · digest {digest}',
|
||||
'openapi.plan.revalidation_pending': 'Проверяем сохранённый план…',
|
||||
'openapi.plan.revalidation_current': 'Сохранённый план актуален.',
|
||||
'openapi.plan.revalidation_stale': 'Сохранённый план устарел.',
|
||||
'openapi.plan.revalidation_error': 'Не удалось проверить сохранённый план.',
|
||||
'openapi.plan.revalidation_guidance': 'Вернитесь к предпросмотру и создайте новый план перед применением.',
|
||||
'openapi.plan.back': 'Назад к выбору',
|
||||
'openapi.plan.back_fix': 'Назад к исправлению решений',
|
||||
'openapi.plan.apply': 'Применить импорт',
|
||||
'openapi.plan.blocked_help': 'Исправьте решения для заблокированных операций и создайте новый план.',
|
||||
'openapi.plan.exact_target': 'Точная операция',
|
||||
'openapi.plan.confirmed_name': 'Подтверждённое имя',
|
||||
'openapi.decision.action_label': 'Решение для импорта',
|
||||
'openapi.decision.create': 'Создать',
|
||||
'openapi.decision.skip': 'Пропустить существующую операцию',
|
||||
'openapi.decision.rename': 'Создать с подтверждённым именем',
|
||||
'openapi.decision.new_version': 'Создать новую версию черновика',
|
||||
'openapi.decision.target_label': 'Существующая операция',
|
||||
'openapi.decision.target_placeholder': 'Выберите точную операцию',
|
||||
'openapi.decision.confirmed_name_label': 'Подтверждённое имя',
|
||||
'openapi.decision.confirmed_name_placeholder': 'Введите точное новое имя',
|
||||
'openapi.plan.selected': 'Выбрано: {count}',
|
||||
'openapi.plan.excluded': 'Исключено: {count}',
|
||||
'openapi.plan.actionable': 'Можно применить: {count}',
|
||||
'openapi.plan.blocked': 'Заблокировано: {count}',
|
||||
'openapi.plan.versioning_new': 'Будет создана новая версия черновика. Опубликованная версия и история останутся без изменений.',
|
||||
'openapi.plan.action.create': 'Создать черновик',
|
||||
'openapi.plan.action.new_version': 'Создать новую версию черновика',
|
||||
'openapi.plan.action.rename': 'Создать отдельный черновик с подтверждённым именем',
|
||||
'openapi.plan.action.skip': 'Оставить существующую операцию без изменений',
|
||||
'openapi.plan.action.excluded': 'Исключено из частичного импорта',
|
||||
'openapi.plan.action.blocked': 'Заблокировано и не будет применено',
|
||||
'openapi.plan.result_title': 'Результат плана импорта',
|
||||
'openapi.plan.outcome.created': 'Создано',
|
||||
'openapi.plan.outcome.versioned': 'Новая версия черновика',
|
||||
'openapi.plan.outcome.renamed': 'Создано с подтверждённым именем',
|
||||
'openapi.plan.outcome.skipped': 'Пропущено',
|
||||
'openapi.plan.outcome.excluded': 'Исключено',
|
||||
'openapi.plan.outcome.rejected': 'Отклонено',
|
||||
'openapi.plan.summary': 'Применено: {applied}; пропущено: {skipped}; исключено: {excluded}; отклонено: {rejected}.',
|
||||
'openapi.plan.repreview': 'План устарел или не прошёл проверку. Создайте новый предпросмотр и проверьте новый план.',
|
||||
'openapi.plan.resolve_conflict': 'Проверьте решение конфликта и создайте новый план перед повторным применением.',
|
||||
'openapi.plan.retry_unknown': 'Результат применения неизвестен. Повтор отправит те же ссылку, digest и ключ идемпотентности.',
|
||||
'openapi.status.planning': 'Подготавливаю план импорта…',
|
||||
'openapi.status.plan_ready': 'Проверьте план сервера и подтвердите его применение.',
|
||||
'openapi.status.applying': 'Применяю план импорта…',
|
||||
'openapi.status.applied': 'План импорта применён.',
|
||||
'openapi.error.plan': 'Не удалось создать план импорта.',
|
||||
'openapi.error.apply': 'Не удалось применить план импорта.',
|
||||
'openapi.error.operations_unavailable': 'Не удалось загрузить операции workspace. Повторите предпросмотр перед созданием плана.',
|
||||
'openapi.error.decision_target': 'Выберите точную существующую операцию для этого решения.',
|
||||
'openapi.error.confirmed_name': 'Введите точное подтверждённое имя для переименования.',
|
||||
'openapi.error.decision_action': 'Выберите допустимое решение для импорта.',
|
||||
'openapi.status.loading_operations': 'Проверяю существующие операции workspace…',
|
||||
'openapi.selection.empty': 'Выбрано: 0',
|
||||
'openapi.selection': 'Выбрано: {selected} из {total}, показано: {visible}',
|
||||
'openapi.group.selection': 'выбрано {selected} из {total}, показано {visible}',
|
||||
'openapi.group.select': 'Выбрать группу',
|
||||
'openapi.group.select': 'Выбрать группу на этой странице',
|
||||
'openapi.operation.fields': 'входов: {input} · выходов: {output}',
|
||||
'openapi.operation.readiness_actionable': 'Можно импортировать',
|
||||
'openapi.operation.readiness_blocked': 'Заблокировано',
|
||||
'openapi.operation.readiness_unresolved': 'Требуется авторизация',
|
||||
'openapi.mapping.path': 'Path',
|
||||
'openapi.mapping.query': 'Query',
|
||||
'openapi.mapping.header': 'Header',
|
||||
@@ -2222,6 +2419,8 @@ Object.assign(TRANSLATIONS.ru, {
|
||||
'openapi.source.summary': '{name} · {size} · методов: {count}',
|
||||
'openapi.status.file_ready': 'Файл готов к разбору.',
|
||||
'openapi.status.previewing': 'Загружаю и разбираю документ…',
|
||||
'openapi.status.uploading': 'Загружаю документ…',
|
||||
'openapi.status.parsing': 'Разбираю документ OpenAPI…',
|
||||
'openapi.status.preview_ready': 'Документ готов. Выберите методы для импорта.',
|
||||
'openapi.status.creating': 'Создаю черновики…',
|
||||
'openapi.status.created': 'Создано: {created}; пропущено: {skipped}.',
|
||||
@@ -2266,7 +2465,21 @@ Object.assign(TRANSLATIONS.ru, {
|
||||
'openapi.result.fix': 'Исправить в мастере',
|
||||
'openapi.result.open': 'Открыть в мастере',
|
||||
'openapi.result.skipped': 'Пропущено',
|
||||
|
||||
'openapi.result.skipped_count': 'Пропущено кандидатов: {count}',
|
||||
'openapi.blockers.summary': 'Заблокированные операции: {count}',
|
||||
'onboarding.openapi_path': 'Начать с документа OpenAPI',
|
||||
'onboarding.openapi_hint': 'Используйте канонический импорт OpenAPI: предпросмотр, проверка точного плана и атомарное применение.',
|
||||
'onboarding.import.choose_draft': 'Выберите один черновик для продолжения тестирования и публикации',
|
||||
'onboarding.import.report_title': 'Отчёт OpenAPI и выбор черновика',
|
||||
'onboarding.import.continue': 'Продолжить с этим черновиком',
|
||||
'onboarding.import.selected': 'Выбран для onboarding',
|
||||
'onboarding.import.drift': 'Выбранный черновик изменился или недоступен. Проверьте отчёт и явно выберите доступный черновик.',
|
||||
'onboarding.import.registration_pending': 'Отчёт импорта регистрируется. Обновите onboarding перед выбором.',
|
||||
'onboarding.import.registration_failed': 'Импорт применён, но его контекст onboarding не подтверждён. Обновите страницу, чтобы восстановить отчёт.',
|
||||
'onboarding.import.selection_failed': 'Не удалось выбрать этот черновик. Обновите отчёт и проверьте актуальные варианты.',
|
||||
'onboarding.import.conflict_reload': 'Состояние onboarding изменилось. Загружен актуальный отчёт; проверьте его перед новой попыткой.',
|
||||
'onboarding.import.retry_registration': 'Повторить восстановление отчёта',
|
||||
'onboarding.import.view_report': 'Открыть полный отчёт импорта',
|
||||
|
||||
});
|
||||
|
||||
|
||||
+243
-1
@@ -12,6 +12,7 @@
|
||||
refreshPromise: null,
|
||||
refreshQueued: false,
|
||||
startedRequested: false,
|
||||
importError: null,
|
||||
};
|
||||
var channel = null;
|
||||
var trigger = null;
|
||||
@@ -79,7 +80,7 @@
|
||||
function actionLabel(id) { return tKey('onboarding.action.' + id); }
|
||||
function deepLink(step) {
|
||||
var snapshot = state.snapshot || {};
|
||||
var returnTo = encodeURIComponent(window.location.pathname + window.location.search);
|
||||
var returnTo = encodeURIComponent(boundedReturnContext());
|
||||
if (step.id === 'operation') return '/wizard/?onboarding=1&return=' + returnTo;
|
||||
if (step.id === 'test' || step.id === 'publish_operation') {
|
||||
if (!snapshot.operation_id) return '/wizard/?onboarding=1&return=' + returnTo;
|
||||
@@ -100,6 +101,220 @@
|
||||
return '/logs?agent_id=' + encodeURIComponent(snapshot.agent_id || '');
|
||||
}
|
||||
function navigate(step) { window.location.href = deepLink(step); }
|
||||
function safeReturnContext(raw) {
|
||||
if (typeof raw !== 'string' || raw.charAt(0) !== '/' || raw.indexOf('//') === 0
|
||||
|| /[\u0000-\u001f\\]/.test(raw) || raw.length > 2048) return null;
|
||||
var url;
|
||||
try { url = new URL(raw, window.location.origin); } catch (_error) { return null; }
|
||||
if (url.origin !== window.location.origin) return null;
|
||||
var allowed = {
|
||||
'/': [],
|
||||
'/agents': ['onboarding', 'action', 'operationId', 'operationVersion'],
|
||||
'/api-keys': ['onboarding', 'action', 'agentId', 'agentRevision'],
|
||||
'/logs': ['log_id', 'agent_id', 'operation_id'],
|
||||
'/secrets': [],
|
||||
'/settings': [],
|
||||
'/usage': [],
|
||||
'/workspace-setup': [],
|
||||
'/wizard/': ['mode', 'operationId', 'step', 'onboarding'],
|
||||
};
|
||||
var keys = allowed[url.pathname];
|
||||
if (!keys) return null;
|
||||
var safe = new URLSearchParams();
|
||||
url.searchParams.forEach(function(value, key) {
|
||||
if (keys.indexOf(key) < 0) return;
|
||||
if (key === 'onboarding' && value === '1') safe.set(key, value);
|
||||
else if (key === 'action' && value === 'create') safe.set(key, value);
|
||||
else if (key === 'mode' && (value === 'create' || value === 'edit')) safe.set(key, value);
|
||||
else if ((key === 'operationVersion' || key === 'agentRevision' || key === 'step')
|
||||
&& /^[0-9]{1,16}$/.test(value)) safe.set(key, value);
|
||||
else if (/^(?:operationId|agentId|log_id|agent_id|operation_id)$/.test(key)
|
||||
&& /^[A-Za-z0-9_-]{1,128}$/.test(value)) safe.set(key, value);
|
||||
});
|
||||
var context = url.pathname + (safe.size ? '?' + safe.toString() : '');
|
||||
return context.length <= 256 ? context : url.pathname;
|
||||
}
|
||||
function boundedReturnContext() {
|
||||
return safeReturnContext(window.location.pathname + window.location.search) || '/';
|
||||
}
|
||||
function returnContextFromQuery() {
|
||||
var candidate = new URLSearchParams(window.location.search).get('return');
|
||||
return safeReturnContext(candidate) || boundedReturnContext();
|
||||
}
|
||||
function openOpenApiPath() {
|
||||
if (!window.CrankOpenApiImport || typeof window.CrankOpenApiImport.open !== 'function') {
|
||||
window.location.href = '/?onboarding_openapi=1&return=' + encodeURIComponent(boundedReturnContext());
|
||||
return;
|
||||
}
|
||||
window.CrankOpenApiImport.open({
|
||||
workspaceId: state.workspaceId,
|
||||
onboarding: true,
|
||||
returnContext: returnContextFromQuery(),
|
||||
importContext: state.snapshot && state.snapshot.import_context,
|
||||
onImported: function(identity) { return registerImportedApplication(identity); },
|
||||
onSelectDraft: function(operationId, version, identity) { return selectImportedDraft(operationId, version, identity); },
|
||||
});
|
||||
}
|
||||
async function registerImportedApplication(identity) {
|
||||
var workspaceId = state.workspaceId;
|
||||
var epoch = state.epoch;
|
||||
if (!identity || !identity.applicationIdempotencyKey || !identity.planDigest
|
||||
|| !window.CrankApi || typeof window.CrankApi.registerOnboardingImportContext !== 'function') {
|
||||
throw new Error(tKey('onboarding.import.registration_failed'));
|
||||
}
|
||||
try {
|
||||
var authoritative = await window.CrankApi.getOnboarding(workspaceId);
|
||||
if (epoch !== state.epoch || workspaceId !== state.workspaceId || workspaceId !== (currentWorkspace() && currentWorkspace().id)) {
|
||||
throw new Error(tKey('onboarding.import.registration_failed'));
|
||||
}
|
||||
state.snapshot = authoritative;
|
||||
render();
|
||||
var response = await window.CrankApi.registerOnboardingImportContext(workspaceId, {
|
||||
application_idempotency_key: identity.applicationIdempotencyKey,
|
||||
plan_digest: identity.planDigest,
|
||||
expected_revision: Number(authoritative && authoritative.revision || 0),
|
||||
});
|
||||
if (epoch !== state.epoch || workspaceId !== state.workspaceId || workspaceId !== (currentWorkspace() && currentWorkspace().id)) {
|
||||
throw new Error(tKey('onboarding.import.registration_failed'));
|
||||
}
|
||||
var current = response && response.onboarding ? response.onboarding : response;
|
||||
if (!current || !current.import_context) throw new Error(tKey('onboarding.import.registration_failed'));
|
||||
state.snapshot = current;
|
||||
render();
|
||||
return current;
|
||||
} catch (error) {
|
||||
if (epoch === state.epoch && workspaceId === state.workspaceId) {
|
||||
await refresh();
|
||||
var recovered = state.snapshot && state.snapshot.import_context;
|
||||
if (recovered
|
||||
&& recovered.application_idempotency_key === identity.applicationIdempotencyKey
|
||||
&& recovered.plan_digest === identity.planDigest) return state.snapshot;
|
||||
}
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
async function selectImportedDraft(operationId, version, identity) {
|
||||
if (!operationId || !window.CrankApi || typeof window.CrankApi.selectOnboardingImportDraft !== 'function') return null;
|
||||
var workspaceId = state.workspaceId;
|
||||
var epoch = state.epoch;
|
||||
var context = state.snapshot && state.snapshot.import_context;
|
||||
var applicationKey = identity && identity.applicationIdempotencyKey || (context && context.application_idempotency_key);
|
||||
var digest = identity && identity.planDigest || (context && context.plan_digest);
|
||||
if (!applicationKey || !digest || !Number.isInteger(version) || version < 1) {
|
||||
throw new Error(tKey('onboarding.import.selection_failed'));
|
||||
}
|
||||
try {
|
||||
var response = await window.CrankApi.selectOnboardingImportDraft(workspaceId, {
|
||||
application_idempotency_key: applicationKey,
|
||||
plan_digest: digest,
|
||||
operation_id: operationId,
|
||||
operation_version: version,
|
||||
expected_revision: Number(state.snapshot && state.snapshot.revision || 0),
|
||||
});
|
||||
var current = response && response.onboarding ? response.onboarding : response;
|
||||
if (epoch !== state.epoch || workspaceId !== state.workspaceId || workspaceId !== (currentWorkspace() && currentWorkspace().id)) {
|
||||
throw new Error(tKey('onboarding.import.selection_failed'));
|
||||
}
|
||||
if (!current || !current.import_context
|
||||
|| current.import_context.selected_operation_id !== operationId
|
||||
|| Number(current.import_context.selected_operation_version) !== version) {
|
||||
throw new Error(tKey('onboarding.import.selection_failed'));
|
||||
}
|
||||
if (current && typeof current === 'object' && 'revision' in current) {
|
||||
state.snapshot = current;
|
||||
render();
|
||||
}
|
||||
return response;
|
||||
} catch (error) {
|
||||
if (error && error.status === 409 && epoch === state.epoch && workspaceId === state.workspaceId) {
|
||||
await refresh();
|
||||
}
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
function renderOpenApiPath() {
|
||||
var section = document.createElement('div');
|
||||
section.className = 'onboarding-openapi-path';
|
||||
var hint = document.createElement('p');
|
||||
hint.className = 'onboarding-openapi-hint';
|
||||
hint.textContent = tKey('onboarding.openapi_hint');
|
||||
var openButton = button(tKey('onboarding.openapi_path'), 'onboarding-openapi-path', openOpenApiPath, 'onboarding-step-action');
|
||||
section.appendChild(hint);
|
||||
section.appendChild(openButton);
|
||||
return section;
|
||||
}
|
||||
async function continueWithImportedDraft(choice) {
|
||||
var context = state.snapshot && state.snapshot.import_context;
|
||||
if (!context || !choice || choice.selectable !== true) return;
|
||||
state.importError = null;
|
||||
render();
|
||||
try {
|
||||
await selectImportedDraft(choice.operation_id, choice.version, null);
|
||||
window.location.href = '/wizard/?mode=edit&operationId=' + encodeURIComponent(choice.operation_id)
|
||||
+ '&operationVersion=' + encodeURIComponent(choice.version) + '&onboarding=1'
|
||||
+ '&return=' + encodeURIComponent(boundedReturnContext());
|
||||
} catch (_error) {
|
||||
state.importError = tKey('onboarding.import.selection_failed');
|
||||
render();
|
||||
}
|
||||
}
|
||||
function renderImportContext() {
|
||||
var context = state.snapshot && state.snapshot.import_context;
|
||||
if (!context) return null;
|
||||
var section = document.createElement('section');
|
||||
section.className = 'onboarding-import-report';
|
||||
section.dataset.testid = 'onboarding-import-context';
|
||||
var title = document.createElement('h3');
|
||||
title.textContent = tKey('onboarding.import.report_title');
|
||||
section.appendChild(title);
|
||||
if (context.drift) {
|
||||
var drift = document.createElement('p');
|
||||
drift.className = 'onboarding-import-drift';
|
||||
drift.setAttribute('role', 'alert');
|
||||
drift.textContent = tKey('onboarding.import.drift');
|
||||
section.appendChild(drift);
|
||||
}
|
||||
if (state.importError) {
|
||||
var error = document.createElement('p');
|
||||
error.className = 'onboarding-import-error';
|
||||
error.setAttribute('role', 'alert');
|
||||
error.textContent = state.importError;
|
||||
section.appendChild(error);
|
||||
}
|
||||
var choices = Array.isArray(context.choices) ? context.choices : [];
|
||||
function outcomeLabel(outcome) {
|
||||
var key = 'openapi.plan.outcome.' + String(outcome || '');
|
||||
return tKey(key) === key ? tKey('openapi.plan.outcome.rejected') : tKey(key);
|
||||
}
|
||||
function reasonLabel(reason) {
|
||||
if (!reason) return '';
|
||||
return window.CrankOpenApiImport && typeof window.CrankOpenApiImport.describeFinding === 'function'
|
||||
? window.CrankOpenApiImport.describeFinding(reason)
|
||||
: tKey('openapi.finding.generic');
|
||||
}
|
||||
var list = document.createElement('ul');
|
||||
list.className = 'onboarding-import-report-list';
|
||||
choices.forEach(function(choice) {
|
||||
var item = document.createElement('li');
|
||||
item.className = 'onboarding-import-report-item';
|
||||
var summary = document.createElement('span');
|
||||
summary.textContent = [choice.name || choice.key || '', outcomeLabel(choice.outcome), choice.version ? 'v' + choice.version : '', reasonLabel(choice.reason)]
|
||||
.filter(Boolean).join(' · ');
|
||||
item.appendChild(summary);
|
||||
if (choice.selectable === true && (!context.selected_operation_id || context.drift)) {
|
||||
item.appendChild(button(tKey('onboarding.import.continue'), null, function() { continueWithImportedDraft(choice); }, 'onboarding-step-action'));
|
||||
} else if (choice.operation_id === context.selected_operation_id && Number(choice.version) === Number(context.selected_operation_version)) {
|
||||
var selected = document.createElement('span');
|
||||
selected.className = 'onboarding-import-selected';
|
||||
selected.textContent = tKey('onboarding.import.selected');
|
||||
item.appendChild(selected);
|
||||
}
|
||||
list.appendChild(item);
|
||||
});
|
||||
section.appendChild(list);
|
||||
section.appendChild(button(tKey('onboarding.import.view_report'), null, openOpenApiPath, 'onboarding-link-button'));
|
||||
return section;
|
||||
}
|
||||
function recordStarted() {
|
||||
if (state.startedRequested || !state.snapshot || state.snapshot.completed) return;
|
||||
state.startedRequested = true;
|
||||
@@ -240,6 +455,17 @@
|
||||
});
|
||||
body.appendChild(list);
|
||||
}
|
||||
var returnContext = document.createElement('span');
|
||||
returnContext.className = 'onboarding-return-context';
|
||||
returnContext.dataset.testid = 'onboarding-return-context';
|
||||
returnContext.hidden = true;
|
||||
returnContext.textContent = returnContextFromQuery();
|
||||
body.appendChild(returnContext);
|
||||
if (!state.snapshot.completed) {
|
||||
body.appendChild(renderOpenApiPath());
|
||||
}
|
||||
var importReport = renderImportContext();
|
||||
if (importReport) body.appendChild(importReport);
|
||||
var footer = document.createElement('div');
|
||||
footer.className = 'onboarding-footer';
|
||||
footer.appendChild(button(tKey('onboarding.refresh'), 'onboarding-refresh', refresh, 'onboarding-link-button'));
|
||||
@@ -295,6 +521,7 @@
|
||||
var snapshot = await window.CrankApi.getOnboarding(workspaceId);
|
||||
if (epoch !== state.epoch || workspaceId !== (currentWorkspace() && currentWorkspace().id)) return;
|
||||
state.snapshot = snapshot;
|
||||
state.importError = null;
|
||||
var preference = safePreference();
|
||||
if (window.location.pathname === '/'
|
||||
&& !preference.opened
|
||||
@@ -304,6 +531,21 @@
|
||||
setOpen(true);
|
||||
}
|
||||
renderDeepLinkRecovery(snapshot);
|
||||
if (window.location.pathname === '/' && new URLSearchParams(window.location.search).get('onboarding_openapi') === '1'
|
||||
&& window.CrankOpenApiImport && typeof window.CrankOpenApiImport.open === 'function') {
|
||||
var openUrl = new URL(window.location.href);
|
||||
openUrl.searchParams.delete('onboarding_openapi');
|
||||
window.history.replaceState(window.history.state, '', openUrl.pathname + openUrl.search + openUrl.hash);
|
||||
window.CrankOpenApiImport.open({
|
||||
workspaceId: workspaceId,
|
||||
onboarding: true,
|
||||
returnContext: returnContextFromQuery(),
|
||||
importContext: snapshot.import_context || null,
|
||||
onImported: function(identity) { return registerImportedApplication(identity); },
|
||||
onSelectDraft: function(operationId, version, identity) { return selectImportedDraft(operationId, version, identity); },
|
||||
});
|
||||
}
|
||||
return snapshot;
|
||||
} catch (error) {
|
||||
if (epoch !== state.epoch) return;
|
||||
state.error = error;
|
||||
|
||||
+1789
-183
File diff suppressed because it is too large.
Load diff
@@ -1,6 +1,8 @@
|
||||
var wizardOperationLoadGeneration = 0;
|
||||
var wizardLifecycleActionBusy = false;
|
||||
var wizardTestConfirmationToken = null;
|
||||
var wizardSavedDraftPayload = null;
|
||||
var wizardPinnedVersionStale = false;
|
||||
|
||||
function operationErrorCode(error) {
|
||||
return error && error.payload && error.payload.error
|
||||
@@ -130,12 +132,33 @@ async function saveOperation(stayOnPage) {
|
||||
async function loadOperationForEdit() {
|
||||
if (!wizardWorkspaceId || !wizardEditId) return;
|
||||
var generation = ++wizardOperationLoadGeneration;
|
||||
wizardCurrentOperation = null;
|
||||
wizardCurrentVersion = null;
|
||||
wizardSavedDraftPayload = null;
|
||||
wizardPinnedVersionStale = false;
|
||||
var pinnedVersionValue = new URLSearchParams(window.location.search).get('operationVersion');
|
||||
var pinnedVersion = null;
|
||||
if (pinnedVersionValue !== null) {
|
||||
pinnedVersion = Number(pinnedVersionValue);
|
||||
if (!/^[0-9]{1,10}$/.test(pinnedVersionValue) || !Number.isSafeInteger(pinnedVersion) || pinnedVersion < 1) {
|
||||
wizardPinnedVersionStale = true;
|
||||
showWizardLiveStatus(tKey('wizard.stale.title'), tKey('wizard.stale.body'), true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
var requestedWorkspaceId = wizardWorkspaceId;
|
||||
var requestedOperationId = wizardEditId;
|
||||
var detail = await window.CrankApi.getOperation(requestedWorkspaceId, requestedOperationId);
|
||||
if (generation !== wizardOperationLoadGeneration
|
||||
|| requestedWorkspaceId !== wizardWorkspaceId
|
||||
|| requestedOperationId !== wizardEditId) return;
|
||||
var detailDraftVersion = Number(detail.draft_version_ref && detail.draft_version_ref.version
|
||||
|| detail.current_draft_version);
|
||||
if (pinnedVersion !== null && detailDraftVersion !== pinnedVersion) {
|
||||
wizardPinnedVersionStale = true;
|
||||
showWizardLiveStatus(tKey('wizard.stale.title'), tKey('wizard.stale.body'), true);
|
||||
return;
|
||||
}
|
||||
wizardProtocol = detail.protocol || 'rest';
|
||||
await loadWizardPanels([3]);
|
||||
var draftVersion = await window.CrankApi.getOperationVersion(
|
||||
@@ -146,9 +169,24 @@ async function loadOperationForEdit() {
|
||||
if (generation !== wizardOperationLoadGeneration
|
||||
|| requestedWorkspaceId !== wizardWorkspaceId
|
||||
|| requestedOperationId !== wizardEditId) return;
|
||||
if (pinnedVersion !== null) {
|
||||
var currentDetail = await window.CrankApi.getOperation(requestedWorkspaceId, requestedOperationId);
|
||||
if (generation !== wizardOperationLoadGeneration
|
||||
|| requestedWorkspaceId !== wizardWorkspaceId
|
||||
|| requestedOperationId !== wizardEditId) return;
|
||||
var currentDraftVersion = Number(currentDetail.draft_version_ref && currentDetail.draft_version_ref.version
|
||||
|| currentDetail.current_draft_version);
|
||||
if (currentDraftVersion !== pinnedVersion) {
|
||||
wizardPinnedVersionStale = true;
|
||||
showWizardLiveStatus(tKey('wizard.stale.title'), tKey('wizard.stale.body'), true);
|
||||
return;
|
||||
}
|
||||
detail = currentDetail;
|
||||
}
|
||||
wizardCurrentOperation = detail;
|
||||
wizardCurrentVersion = draftVersion;
|
||||
prefillWizardFromEdit(detail, draftVersion);
|
||||
wizardSavedDraftPayload = updateOperationPayload(collectWizardPayload());
|
||||
renderAgentFacingPreview();
|
||||
renderImportQualityFindings(draftVersion);
|
||||
}
|
||||
@@ -375,6 +413,27 @@ function updateOperationPayload(payload) {
|
||||
};
|
||||
}
|
||||
|
||||
function canonicalDraftPayload(payload) {
|
||||
var editablePayload = updateOperationPayload(payload);
|
||||
delete editablePayload.category;
|
||||
|
||||
function sortKeys(value) {
|
||||
if (Array.isArray(value)) return value.map(sortKeys);
|
||||
if (!value || typeof value !== 'object') return value;
|
||||
return Object.keys(value).sort().reduce(function(sorted, key) {
|
||||
sorted[key] = sortKeys(value[key]);
|
||||
return sorted;
|
||||
}, {});
|
||||
}
|
||||
|
||||
return JSON.stringify(sortKeys(editablePayload));
|
||||
}
|
||||
|
||||
function draftPayloadMatchesBaseline(payload) {
|
||||
return wizardSavedDraftPayload !== null
|
||||
&& canonicalDraftPayload(payload) === canonicalDraftPayload(wizardSavedDraftPayload);
|
||||
}
|
||||
|
||||
async function refreshCurrentOperationState() {
|
||||
if (!wizardWorkspaceId || !wizardEditId) return null;
|
||||
var detail = await window.CrankApi.getOperation(wizardWorkspaceId, wizardEditId);
|
||||
@@ -396,6 +455,9 @@ async function refreshCurrentOperationState() {
|
||||
}
|
||||
|
||||
async function persistCurrentDraft(stayOnPage) {
|
||||
if (wizardPinnedVersionStale) {
|
||||
throw new Error(tKey('wizard.stale.body'));
|
||||
}
|
||||
if (!wizardWorkspaceId) {
|
||||
throw new Error(tKey('wizard.error.no_workspace'));
|
||||
}
|
||||
@@ -405,14 +467,33 @@ async function persistCurrentDraft(stayOnPage) {
|
||||
var createdNow = false;
|
||||
|
||||
if (wizardMode === 'edit' && wizardEditId) {
|
||||
if (draftPayloadMatchesBaseline(payload)) {
|
||||
if (stayOnPage) {
|
||||
var unchangedSaveDraftBtn = document.querySelector('.btn-save-draft');
|
||||
if (unchangedSaveDraftBtn) {
|
||||
var unchangedLabel = unchangedSaveDraftBtn.textContent;
|
||||
unchangedSaveDraftBtn.textContent = tKey('wizard.save.saved');
|
||||
setTimeout(function() {
|
||||
unchangedSaveDraftBtn.textContent = unchangedLabel;
|
||||
}, 1400);
|
||||
}
|
||||
}
|
||||
return {
|
||||
operation_id: wizardEditId,
|
||||
version: currentDraftVersion(),
|
||||
status: 'draft',
|
||||
};
|
||||
}
|
||||
response = await window.CrankApi.updateOperation(
|
||||
wizardWorkspaceId,
|
||||
wizardEditId,
|
||||
updateOperationPayload(payload)
|
||||
);
|
||||
wizardSavedDraftPayload = updateOperationPayload(payload);
|
||||
} else {
|
||||
response = await window.CrankApi.createOperation(wizardWorkspaceId, payload);
|
||||
createdNow = true;
|
||||
wizardSavedDraftPayload = updateOperationPayload(payload);
|
||||
wizardEditId = response.operation_id;
|
||||
wizardMode = 'edit';
|
||||
history.replaceState(
|
||||
|
||||
@@ -253,7 +253,7 @@
|
||||
var source = mappingEntrySource(parsed[outputField]);
|
||||
return {
|
||||
output: outputField,
|
||||
responsePath: responseSourceToPath(source) || outputField,
|
||||
responsePath: responseSourceToPath(source),
|
||||
};
|
||||
});
|
||||
}
|
||||
@@ -492,7 +492,7 @@
|
||||
responseRows.forEach(function(row) {
|
||||
var responsePath = valueIn(row, 'responsePath');
|
||||
var output = valueIn(row, 'output') || outputNameFromPath(responsePath);
|
||||
if (!responsePath || !output) return;
|
||||
if (!output) return;
|
||||
responseMapping[output] = joinJsonPath('$.response.body', responsePath);
|
||||
});
|
||||
writeText('tool-output-mapping', dumpYaml(responseMapping));
|
||||
|
||||
@@ -371,7 +371,7 @@ function startNewUpstream() {
|
||||
setValue('new-auth-profile-password-secret', '');
|
||||
updateUpstreamAuthUi();
|
||||
var first = form.querySelector('input');
|
||||
if (first) setTimeout(function() { first.focus(); }, 50);
|
||||
if (first) first.focus();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user