"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  // If the importer is in node compatibility mode or this is not an ESM
  // file that has been converted to a CommonJS file using a Babel-
  // compatible transform (i.e. "__esModule" has not been set), then set
  // "default" to the CommonJS "module.exports" for node compatibility.
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
  mod
));
var sdk = __toESM(require("@botpress/sdk"));
var errors = __toESM(require("../errors"));
var import_vitest = require("vitest");
var import_validate_bot = require("./validate-bot");
import_vitest.describe.concurrent("validateBotDefinition", () => {
  (0, import_vitest.it)("should throw an error if action names are not in camelCase", async () => {
    const bot = new sdk.BotDefinition({
      actions: {
        "invalid-action": {
          input: { schema: sdk.z.object({}) },
          output: { schema: sdk.z.object({}) }
        }
      }
    });
    (0, import_vitest.expect)(() => (0, import_validate_bot.validateBotDefinition)(bot)).toThrowError(errors.BotpressCLIError);
  });
  (0, import_vitest.it)("should throw an error if event names are not in camelCase", async () => {
    const bot = new sdk.BotDefinition({
      events: {
        "invalid-event": {
          schema: sdk.z.object({})
        }
      }
    });
    (0, import_vitest.expect)(() => (0, import_validate_bot.validateBotDefinition)(bot)).toThrowError(errors.BotpressCLIError);
  });
  (0, import_vitest.it)("should throw an error if state names are not in camelCase", async () => {
    const bot = new sdk.BotDefinition({
      states: {
        "invalid-state": {
          type: "bot",
          schema: sdk.z.object({})
        }
      }
    });
    (0, import_vitest.expect)(() => (0, import_validate_bot.validateBotDefinition)(bot)).toThrowError(errors.BotpressCLIError);
  });
  (0, import_vitest.it)("should allow plugin prefix in action names", async () => {
    const bot = new sdk.BotDefinition({
      actions: {
        "plugin#action": {
          input: { schema: sdk.z.object({}) },
          output: { schema: sdk.z.object({}) }
        }
      }
    });
    (0, import_vitest.expect)(() => (0, import_validate_bot.validateBotDefinition)(bot)).not.toThrowError();
  });
  (0, import_vitest.it)("should allow plugin prefix in event names", async () => {
    const bot = new sdk.BotDefinition({
      events: {
        "plugin#event": {
          schema: sdk.z.object({})
        }
      }
    });
    (0, import_vitest.expect)(() => (0, import_validate_bot.validateBotDefinition)(bot)).not.toThrowError();
  });
  (0, import_vitest.it)("should allow plugin prefix in state names", async () => {
    const bot = new sdk.BotDefinition({
      states: {
        "plugin#state": {
          type: "bot",
          schema: sdk.z.object({})
        }
      }
    });
    (0, import_vitest.expect)(() => (0, import_validate_bot.validateBotDefinition)(bot)).not.toThrowError();
  });
});
//# sourceMappingURL=validate-bot.test.js.map
