private async resetConsole()

in src/components/operations/operation-details/ko/runtime/operation-console.ts [173:235]


    private async resetConsole(): Promise<void> {
        const selectedOperation = this.operation();
        const selectedApi = this.api();

        if (!selectedApi || !selectedOperation) {
            return;
        }

        this.bodyStash = "";

        this.working(true);
        this.sendingRequest(false);
        this.wsConnected(false);
        this.consoleOperation(null);
        this.secretsRevealed(false);
        this.responseStatusCode(null);
        this.responseStatusText(null);
        this.responseBody(null);
        this.requestError(null);

        const operation = await this.apiService.getOperation(selectedApi.id, selectedOperation.id);
        const consoleOperation = new ConsoleOperation(selectedApi, operation);
        this.consoleOperation(consoleOperation);

        const hostnames = this.hostnames();
        this.hostnameSelectionEnabled(this.hostnames()?.length > 1);

        let hostname = "";

        if (hostnames) {
            hostname = hostnames[0];
            this.selectedHostname(hostname);
        } else {
            this.showHostnameInput(true);
        }

        this.hostnameSelectionEnabled(this.hostnames()?.length > 1);
        consoleOperation.host.hostname(hostname);

        if (this.api().type === TypeOfApi.soap) {
            this.setSoapHeaders();
        }

        if (this.api().type === TypeOfApi.webSocket) {
            this.selectedLanguage("ws_wscat");
        }

        if (this.api().type !== TypeOfApi.webSocket) {
            this.setNoCacheHeader();
        }

        if (this.api().apiVersionSet && this.api().apiVersionSet.versioningScheme === "Header") {
            this.setVersionHeader();
        }

        this.consoleOperation().request.headers().forEach(header => header.value.subscribe(_ => this.updateRequestSummary()));
        this.consoleOperation().request.headers().forEach(header => header.name.subscribe(_ => this.updateRequestSummary()));
        this.consoleOperation().request.body.subscribe(_ => this.updateRequestSummary());
        this.consoleOperation().request.queryParameters().forEach(parameter => parameter.value.subscribe(_ => this.updateRequestSummary()));

        this.updateRequestSummary();
        this.working(false);
    }