"use strict";
/**
 * Note, there is some functionality in this that is not currently exposed as it
 * is complex and maybe better to be opinionated here.
 * GET/DELETE requests cannot handle body elements so they will not be sent if configured.
 */
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
};
exports.definition = {
    name: "Backend log",
    tagline: "Console log a value in the backend",
    icon: "Monitoring",
    description: "Logs the given text to the server (using console.log)",
    type: "ACTION",
    internal: true,
    stepId: "SERVER_LOG",
    inputs: {
        text: "",
    },
    schema: {
        inputs: {
            properties: {
                text: {
                    type: "string",
                    title: "Log",
                },
            },
            required: ["text"],
        },
        outputs: {
            properties: {
                success: {
                    type: "boolean",
                    description: "Whether the action was successful",
                },
            },
            required: ["success"],
        },
    },
};
exports.run = function ({ inputs, appId }) {
    return __awaiter(this, void 0, void 0, function* () {
        console.log(`App ${appId} - ${inputs.text}`);
        return {
            success: true,
        };
    });
};
