"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
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 __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var integration_ruleset_exports = {};
__export(integration_ruleset_exports, {
  INTEGRATION_RULESET: () => INTEGRATION_RULESET
});
module.exports = __toCommonJS(integration_ruleset_exports);
var import_spectral_functions = require("@stoplight/spectral-functions");
var import_spectral_functions2 = require("../spectral-functions");
const INTEGRATION_RULESET = {
  extends: [],
  rules: {
    "integration-title-must-be-present": {
      description: "The integration MUST have a non-empty title",
      severity: "error",
      given: "$",
      then: [{ field: "title", function: import_spectral_functions.truthy }]
    },
    "integration-description-must-be-present": {
      description: "The integration MUST have a non-empty description",
      severity: "error",
      given: "$",
      then: [{ field: "description", function: import_spectral_functions.truthy }]
    },
    "integration-must-have-an-icon": {
      description: "The integration MUST have an icon",
      severity: "error",
      given: "$",
      then: [{ field: "icon", function: import_spectral_functions.truthy }]
    },
    "integration-must-have-a-readme-file": {
      description: "The integration MUST have a readme file",
      severity: "error",
      given: "$",
      then: [{ field: "readme", function: import_spectral_functions.truthy }]
    },
    "actions-should-have-a-title": {
      description: "All actions SHOULD have a title",
      message: "{{description}}: {{error}} SHOULD have a non-empty title",
      severity: "warn",
      given: "$.actions[*]",
      then: [{ field: "title", function: (0, import_spectral_functions2.truthyWithMessage)(({ path }) => `action "${path[1]}"`) }]
    },
    "actions-must-have-a-description": {
      description: "All actions MUST have a description",
      message: "{{description}}: {{error}} MUST have a non-empty description",
      severity: "error",
      given: "$.actions[*]",
      then: [{ field: "description", function: (0, import_spectral_functions2.truthyWithMessage)(({ path }) => `action "${path[1]}"`) }]
    },
    "action-inputparams-should-have-a-title": {
      description: "All action input parameters SHOULD have a title",
      message: "{{description}}: {{error}} SHOULD provide a non-empty title by using .title() in its Zod schema",
      severity: "warn",
      given: "$.actions[*].input..schema.properties[*]",
      then: [
        {
          field: "x-zui.title",
          function: (0, import_spectral_functions2.truthyWithMessage)(({ path }) => `input parameter "${path.at(-3)}" of action "${path[1]}"`)
        }
      ]
    },
    "action-inputparams-must-have-a-description": {
      description: "All action input parameters MUST have a description",
      message: "{{description}}: {{error}} MUST provide a non-empty description by using .describe() in its Zod schema",
      severity: "error",
      given: "$.actions[*].input..schema.properties[*]",
      then: [
        {
          field: "description",
          function: (0, import_spectral_functions2.truthyWithMessage)(({ path }) => `input parameter "${path.at(-2)}" of action "${path[1]}"`)
        }
      ]
    },
    "action-outputparams-should-have-a-title": {
      description: "All action output parameters SHOULD have a title",
      message: "{{description}}: {{error}} SHOULD provide a non-empty title by using .title() in its Zod schema",
      severity: "warn",
      given: "$.actions[*].output..schema.properties[*].x-zui",
      then: [
        {
          field: "title",
          function: (0, import_spectral_functions2.truthyWithMessage)(({ path }) => `output parameter "${path.at(-3)}" of action "${path[1]}"`)
        }
      ]
    },
    "action-outputparams-must-have-a-description": {
      description: "All action output parameters MUST have a description",
      message: "{{description}}: {{error}} MUST provide a non-empty description by using .describe() in its Zod schema",
      severity: "error",
      given: "$.actions[*].output..schema.properties[*]",
      then: [
        {
          field: "description",
          function: (0, import_spectral_functions2.truthyWithMessage)(({ path }) => `output parameter "${path.at(-2)}" of action "${path[1]}"`)
        }
      ]
    },
    "event-outputparams-should-have-title": {
      description: "All event output parameters SHOULD have a title",
      message: "{{description}}: {{error}} SHOULD provide a non-empty title by using .title() in its Zod schema",
      severity: "warn",
      given: "$.events[*]..schema.properties[*]",
      then: [
        {
          field: "x-zui.title",
          function: (0, import_spectral_functions2.truthyWithMessage)(({ path }) => `output parameter "${path.at(-3)}" of event "${path[1]}"`)
        }
      ]
    },
    "event-outputparams-must-have-description": {
      description: "All event output parameters MUST have a description",
      message: "{{description}}: {{error}} SHOULD provide a non-empty description by using .describe() in its Zod schema",
      severity: "error",
      given: "$.events[*]..schema.properties[*]",
      then: [
        {
          field: "description",
          function: (0, import_spectral_functions2.truthyWithMessage)(({ path }) => `output parameter "${path.at(-2)}" of event "${path[1]}"`)
        }
      ]
    },
    "events-must-have-a-title": {
      description: "All events MUST have a title",
      message: "{{description}}: {{error}} MUST be a non-empty string",
      severity: "error",
      given: "$.events[*]",
      then: [{ field: "title", function: (0, import_spectral_functions2.truthyWithMessage)(({ path }) => `event "${path[1]}"`) }]
    },
    "events-must-have-a-description": {
      description: "All events MUST have a description",
      message: "{{description}}: {{error}} MUST be a non-empty string",
      severity: "error",
      given: "$.events[*]",
      then: [{ field: "description", function: (0, import_spectral_functions2.truthyWithMessage)(({ path }) => `event "${path[1]}"`) }]
    },
    "consider-migrating-to-configurations": {
      description: 'Consider migrating to the new multiple configuration format: you MAY move your configuration from "configuration" to "configurations" and remove the "configuration" property',
      severity: "off",
      given: "$",
      then: [
        { field: "configuration", function: import_spectral_functions.falsy },
        { field: "configurations", function: import_spectral_functions.truthy }
      ]
    },
    "configuration-fields-must-have-a-title": {
      description: "All configuration fields MUST have a title",
      message: "{{description}}: {{error}} MUST provide a non-empty title by using .title() in its Zod schema",
      severity: "error",
      given: "$.configuration..schema.properties[*].x-zui",
      then: [
        {
          field: "title",
          function: (0, import_spectral_functions2.truthyWithMessage)(({ path }) => `configuration parameter "${path.at(-3)}"`)
        }
      ]
    },
    "configuration-fields-must-have-a-description": {
      description: "All configuration fields MUST have a description",
      message: "{{description}}: {{error}} MUST provide a non-empty description by using .describe() in its Zod schema",
      severity: "error",
      given: "$.configuration..schema.properties[*]",
      then: [
        {
          field: "description",
          function: (0, import_spectral_functions2.truthyWithMessage)(({ path }) => `configuration parameter "${path.at(-2)}"`)
        }
      ]
    },
    "multiple-configurations-must-have-a-title": {
      description: "Multiple configuration definitions MUST have a title",
      message: "{{description}}: {{error}} MUST have a title",
      severity: "error",
      given: "$.configurations[*]",
      then: [{ field: "title", function: (0, import_spectral_functions2.truthyWithMessage)(({ path }) => `configuration "${path[1]}"`) }]
    },
    "multiple-configurations-must-have-a-description": {
      description: "Multiple configuration definitions MUST have a description",
      message: "{{description}}: {{error}} MUST have a description",
      severity: "error",
      given: "$.configurations[*]",
      then: [{ field: "description", function: (0, import_spectral_functions2.truthyWithMessage)(({ path }) => `configuration "${path[1]}"`) }]
    },
    "multipes-configurations-fields-must-have-a-title": {
      description: "All configuration fields in multiple configurations MUST have a title",
      message: "{{description}}: {{error}} MUST provide a non-empty title by using .title() in its Zod schema",
      severity: "error",
      given: "$.configurations[*]..schema.properties[*].x-zui",
      then: [
        {
          field: "title",
          function: (0, import_spectral_functions2.truthyWithMessage)(
            ({ path }) => `configuration field "${path.at(-3)}" of configuration "${path[1]}"`
          )
        }
      ]
    },
    "multipes-configurations-fields-must-have-a-description": {
      description: "All configuration fields in multiple configurations MUST have a description",
      message: "{{description}}: {{error}} MUST provide a non-empty description by using .describe() in its Zod schema",
      severity: "error",
      given: "$.configurations[*]..schema.properties[*]",
      then: [
        {
          field: "description",
          function: (0, import_spectral_functions2.truthyWithMessage)(
            ({ path }) => `configuration field "${path.at(-2)}" of configuration "${path[1]}"`
          )
        }
      ]
    },
    "user-tags-should-have-a-title": {
      description: "All user tags SHOULD have a title",
      message: "{{description}}: {{error}} SHOULD have a non-empty title",
      severity: "warn",
      given: "$.user.tags[*]",
      then: [
        {
          field: "title",
          function: (0, import_spectral_functions2.truthyWithMessage)(({ path }) => `user tag "${path[2]}"`)
        }
      ]
    },
    "user-tags-must-have-a-description": {
      description: "All user tags MUST have a description",
      message: "{{description}}: {{error}} MUST have a non-empty description",
      severity: "error",
      given: "$.user.tags[*]",
      then: [
        {
          field: "description",
          function: (0, import_spectral_functions2.truthyWithMessage)(({ path }) => `user tag "${path[2]}"`)
        }
      ]
    },
    "channels-should-have-a-title": {
      description: "All channels SHOULD have a title",
      message: "{{description}}: {{error}} SHOULD have a non-empty title",
      severity: "warn",
      given: "$.channels[*]",
      then: [
        {
          field: "title",
          function: (0, import_spectral_functions2.truthyWithMessage)(({ path }) => `channel "${path[1]}"`)
        }
      ]
    },
    "channels-must-have-a-description": {
      description: "All channels MUST have a description",
      message: "{{description}}: {{error}} MUST have a non-empty description",
      severity: "error",
      given: "$.channels[*]",
      then: [
        {
          field: "description",
          function: (0, import_spectral_functions2.truthyWithMessage)(({ path }) => `channel "${path[1]}"`)
        }
      ]
    },
    "channels-conversation-tags-should-have-a-title": {
      description: "All conversation tags SHOULD have a title",
      message: "{{description}}: {{error}} SHOULD have a non-empty title",
      severity: "warn",
      given: "$.channels[*].conversation.tags[*]",
      then: [
        {
          field: "title",
          function: (0, import_spectral_functions2.truthyWithMessage)(({ path }) => `conversation tag "${path.at(-2)}" of channel "${path[1]}"`)
        }
      ]
    },
    "channels-conversation-tags-must-have-a-description": {
      description: "All conversation tags MUST have a description",
      message: "{{description}}: {{error}} MUST have a non-empty description",
      severity: "error",
      given: "$.channels[*].conversation.tags[*]",
      then: [
        {
          field: "description",
          function: (0, import_spectral_functions2.truthyWithMessage)(({ path }) => `conversation tag "${path.at(-2)}" of channel "${path[1]}"`)
        }
      ]
    },
    "channels-message-tags-should-have-a-title": {
      description: "All message tags SHOULD have a title",
      message: "{{description}}: {{error}} SHOULD have a non-empty title",
      severity: "warn",
      given: "$.channels[*].message.tags[*]",
      then: [
        {
          field: "title",
          function: (0, import_spectral_functions2.truthyWithMessage)(({ path }) => `message tag "${path.at(-2)}" of channel "${path[1]}"`)
        }
      ]
    },
    "channels-message-tags-must-have-a-description": {
      description: "All message tags MUST have a description",
      message: "{{description}}: {{error}} MUST have a non-empty description",
      severity: "error",
      given: "$.channels[*].message.tags[*]",
      then: [
        {
          field: "description",
          function: (0, import_spectral_functions2.truthyWithMessage)(({ path }) => `message tag "${path.at(-2)}" of channel "${path[1]}"`)
        }
      ]
    },
    "legacy-zui-title-should-be-removed": {
      description: "Legacy ZUI title fields (ui.title) SHOULD be removed. Please use .title() in your Zod schemas instead",
      severity: "error",
      given: "$..ui[*].title",
      then: [{ function: import_spectral_functions.falsy }]
    },
    "legacy-zui-examples-should-be-removed": {
      description: "Legacy ZUI examples fields (ui.examples) SHOULD be removed. There are currently no alternatives",
      severity: "hint",
      given: "$..ui[*].examples",
      then: [{ function: import_spectral_functions.falsy }]
    },
    "state-fields-should-have-title": {
      description: "All state fields SHOULD have a title",
      message: "{{description}}: {{error}} SHOULD provide a non-empty title by using .title() in its Zod schema",
      severity: "warn",
      given: "$.states[*]..schema.properties[*]",
      then: [
        {
          field: "x-zui.title",
          function: (0, import_spectral_functions2.truthyWithMessage)(({ path }) => `field "${path.at(-3)}" of state "${path[1]}"`)
        }
      ]
    },
    "state-fields-must-have-description": {
      description: "All state fields MUST have a description",
      message: "{{description}}: {{error}} SHOULD provide a non-empty description by using .describe() in its Zod schema",
      severity: "error",
      given: "$.states[*]..schema.properties[*]",
      then: [
        {
          field: "description",
          function: (0, import_spectral_functions2.truthyWithMessage)(({ path }) => `field "${path.at(-2)}" of state "${path[1]}"`)
        }
      ]
    },
    "secrets-must-have-a-description": {
      description: "All secrets MUST have a description",
      message: "{{description}}: {{error}} MUST have a non-empty description",
      severity: "error",
      given: "$.secrets[*]",
      then: [
        {
          field: "description",
          function: (0, import_spectral_functions2.truthyWithMessage)(({ path }) => `secret "${path[1]}"`)
        }
      ]
    }
  }
};
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  INTEGRATION_RULESET
});
//# sourceMappingURL=integration.ruleset.js.map
