import '../../../../utils/index.mjs';
import { buildProps, definePropType } from '../../../../utils/props/runtime.mjs';

"use strict";
const DEFAULT_METHOD = "GET";
const requestList = [
  {
    key: "params",
    name: "\u8BF7\u6C42\u53C2\u6570"
  },
  {
    key: "body",
    name: "\u8BF7\u6C42\u62A5\u6587\u4F53"
  },
  {
    key: "headers",
    name: "\u8BF7\u6C42\u5934"
  }
];
const bodyList = [
  {
    key: "none",
    name: "none"
  },
  {
    key: "form-data",
    name: "form-data"
  },
  {
    key: "x-www-form-urlencoded",
    name: "x-www-form-urlencoded"
  },
  {
    key: "json",
    name: "json"
  },
  {
    key: "xml",
    name: "xml"
  },
  {
    key: "raw",
    name: "raw"
  }
];
const apiComponentProps = buildProps({
  value: {
    type: definePropType(Object),
    default: () => ({
      url: "",
      method: DEFAULT_METHOD,
      requestParams: [],
      headerParams: [],
      bodyParams: {
        type: "none",
        parameters: [],
        jsonSchema: [],
        description: ""
      }
    })
  },
  disabled: {
    type: Boolean,
    default: false
  },
  isValid: {
    type: Boolean,
    default: false
  },
  rules: {
    type: definePropType(Object),
    default: () => ({
      url: [
        {
          required: true,
          trigger: "blur",
          message: "\u8BF7\u8F93\u5165url"
        },
        {
          trigger: "change",
          pattern: /^(http|https?:\/\/)?([\da-z.-]+)\.([a-z.]{2,6})([\/\w .-]*)*\/?$/,
          message: "\u8F93\u5165url\u683C\u5F0F\u9519\u8BEF"
        }
      ]
    })
  }
});
const apiComponentEmits = {
  change: (value) => !!value,
  "update:value": (value) => !!value
};

export { DEFAULT_METHOD, apiComponentEmits, apiComponentProps, bodyList, requestList };
//# sourceMappingURL=api-component.mjs.map
