"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.Resource = void 0;
const validate_1 = require("@midwayjs/validate");
/**
 * 资源定义
 */
class Resource {
}
__decorate([
    (0, validate_1.Rule)(validate_1.RuleType.string().empty('')),
    __metadata("design:type", String)
], Resource.prototype, "id", void 0);
__decorate([
    (0, validate_1.Rule)(validate_1.RuleType.string().allow('')),
    __metadata("design:type", String)
], Resource.prototype, "method", void 0);
__decorate([
    (0, validate_1.Rule)(validate_1.RuleType.string().allow('')),
    __metadata("design:type", String)
], Resource.prototype, "fileName", void 0);
__decorate([
    (0, validate_1.Rule)(validate_1.RuleType.string().allow('')),
    __metadata("design:type", String)
], Resource.prototype, "path", void 0);
__decorate([
    (0, validate_1.Rule)(validate_1.RuleType.string().allow('')),
    __metadata("design:type", String)
], Resource.prototype, "type", void 0);
__decorate([
    (0, validate_1.Rule)(validate_1.RuleType.string().default('0')),
    __metadata("design:type", String)
], Resource.prototype, "groupId", void 0);
__decorate([
    (0, validate_1.Rule)(validate_1.RuleType.string().allow('').allow(null).default('')),
    __metadata("design:type", String)
], Resource.prototype, "script", void 0);
__decorate([
    (0, validate_1.Rule)(validate_1.RuleType.string().allow('').allow(null).default('')),
    __metadata("design:type", String)
], Resource.prototype, "description", void 0);
__decorate([
    (0, validate_1.Rule)(validate_1.RuleType.alternatives([validate_1.RuleType.boolean(), validate_1.RuleType.number()])
        .required()
        .default(false)),
    __metadata("design:type", Boolean)
], Resource.prototype, "fileLock", void 0);
__decorate([
    (0, validate_1.Rule)(validate_1.RuleType.alternatives([validate_1.RuleType.boolean(), validate_1.RuleType.number()])
        .required()
        .default(true)),
    __metadata("design:type", Boolean)
], Resource.prototype, "enabled", void 0);
__decorate([
    (0, validate_1.Rule)(validate_1.RuleType.alternatives([validate_1.RuleType.boolean(), validate_1.RuleType.number()])
        .required()
        .default(false)),
    __metadata("design:type", Boolean)
], Resource.prototype, "isFolder", void 0);
__decorate([
    (0, validate_1.Rule)(validate_1.RuleType.string().allow('').allow(null).default('')),
    __metadata("design:type", String)
], Resource.prototype, "returnType", void 0);
__decorate([
    (0, validate_1.Rule)(validate_1.RuleType.object().default({})),
    __metadata("design:type", Object)
], Resource.prototype, "definition", void 0);
__decorate([
    (0, validate_1.Rule)(validate_1.RuleType.string().allow('').allow(null).default('')),
    __metadata("design:type", String)
], Resource.prototype, "updatedAt", void 0);
__decorate([
    (0, validate_1.Rule)(validate_1.RuleType.string().allow('').allow(null).default('')),
    __metadata("design:type", String)
], Resource.prototype, "createdAt", void 0);
__decorate([
    (0, validate_1.Rule)(validate_1.RuleType.string().allow('').allow(null).default('')),
    __metadata("design:type", String)
], Resource.prototype, "createdBy", void 0);
__decorate([
    (0, validate_1.Rule)(validate_1.RuleType.string().allow('').allow(null).default('')),
    __metadata("design:type", String)
], Resource.prototype, "updatedBy", void 0);
exports.Resource = Resource;
