"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ChannelSchema = void 0;
const ChannelBusinessRules_1 = require("./ChannelBusinessRules");
/**
 * @private
 * The channel editor schema
 */
exports.ChannelSchema = {
    type: "object",
    properties: {
        name: {
            type: "string",
        },
        blockWords: {
            type: "string",
            // eslint-disable-next-line @typescript-eslint/ban-ts-comment
            // @ts-ignore
            format: "blockWords",
        },
        publicConfigs: {
            type: "array",
            items: {
                type: "object",
                properties: {
                    key: { type: "string" },
                    entityId: { type: "string" },
                    entityType: { type: "string" },
                    roles: {
                        type: "object",
                        properties: {
                            anonymous: {
                                type: "object",
                                properties: {
                                    value: {
                                        type: "string",
                                        enum: [
                                            ChannelBusinessRules_1.ChannelNonePermission,
                                            ChannelBusinessRules_1.CHANNEL_PERMISSIONS.channelRead,
                                        ],
                                        default: ChannelBusinessRules_1.ChannelNonePermission,
                                    },
                                    id: { type: "string" },
                                },
                            },
                            authenticated: {
                                type: "object",
                                properties: {
                                    value: {
                                        type: "string",
                                        enum: [
                                            ChannelBusinessRules_1.ChannelNonePermission,
                                            ChannelBusinessRules_1.CHANNEL_PERMISSIONS.channelRead,
                                            ChannelBusinessRules_1.CHANNEL_PERMISSIONS.channelWrite,
                                            ChannelBusinessRules_1.CHANNEL_PERMISSIONS.channelReadWrite,
                                        ],
                                        default: ChannelBusinessRules_1.ChannelNonePermission,
                                    },
                                    id: { type: "string" },
                                },
                            },
                        },
                    },
                },
            },
        },
        orgConfigs: {
            type: "array",
            items: {
                type: "object",
                properties: {
                    key: { type: "string" },
                    entityId: { type: "string" },
                    entityType: { type: "string" },
                    roles: {
                        type: "object",
                        properties: {
                            member: {
                                type: "object",
                                properties: {
                                    value: {
                                        type: "string",
                                        enum: [
                                            ChannelBusinessRules_1.ChannelNonePermission,
                                            ChannelBusinessRules_1.CHANNEL_PERMISSIONS.channelRead,
                                            ChannelBusinessRules_1.CHANNEL_PERMISSIONS.channelWrite,
                                            ChannelBusinessRules_1.CHANNEL_PERMISSIONS.channelReadWrite,
                                        ],
                                        default: ChannelBusinessRules_1.ChannelNonePermission,
                                    },
                                    id: { type: "string" },
                                },
                            },
                            admin: {
                                type: "object",
                                properties: {
                                    value: {
                                        type: "string",
                                        enum: [ChannelBusinessRules_1.CHANNEL_PERMISSIONS.channelOwner],
                                        default: ChannelBusinessRules_1.CHANNEL_PERMISSIONS.channelOwner,
                                    },
                                    id: { type: "string" },
                                },
                            },
                        },
                    },
                },
            },
        },
        groupConfigs: {
            type: "array",
            items: {
                type: "object",
                properties: {
                    key: { type: "string" },
                    entityId: { type: "string" },
                    entityType: { type: "string" },
                    roles: {
                        type: "object",
                        properties: {
                            member: {
                                type: "object",
                                properties: {
                                    value: {
                                        type: "string",
                                        enum: [
                                            ChannelBusinessRules_1.ChannelNonePermission,
                                            ChannelBusinessRules_1.CHANNEL_PERMISSIONS.channelRead,
                                            ChannelBusinessRules_1.CHANNEL_PERMISSIONS.channelWrite,
                                            ChannelBusinessRules_1.CHANNEL_PERMISSIONS.channelReadWrite,
                                            ChannelBusinessRules_1.CHANNEL_PERMISSIONS.channelModerate,
                                            ChannelBusinessRules_1.CHANNEL_PERMISSIONS.channelManage,
                                            ChannelBusinessRules_1.CHANNEL_PERMISSIONS.channelOwner,
                                        ],
                                        default: ChannelBusinessRules_1.ChannelNonePermission,
                                    },
                                    id: { type: "string" },
                                },
                            },
                            admin: {
                                type: "object",
                                properties: {
                                    value: {
                                        type: "string",
                                        enum: [
                                            ChannelBusinessRules_1.ChannelNonePermission,
                                            ChannelBusinessRules_1.CHANNEL_PERMISSIONS.channelRead,
                                            ChannelBusinessRules_1.CHANNEL_PERMISSIONS.channelWrite,
                                            ChannelBusinessRules_1.CHANNEL_PERMISSIONS.channelReadWrite,
                                            ChannelBusinessRules_1.CHANNEL_PERMISSIONS.channelModerate,
                                            ChannelBusinessRules_1.CHANNEL_PERMISSIONS.channelManage,
                                            ChannelBusinessRules_1.CHANNEL_PERMISSIONS.channelOwner,
                                        ],
                                        default: ChannelBusinessRules_1.ChannelNonePermission,
                                    },
                                    id: { type: "string" },
                                },
                            },
                        },
                    },
                },
            },
        },
        userConfigs: {
            type: "array",
            items: {
                type: "object",
                properties: {
                    key: { type: "string" },
                    entityId: { type: "string" },
                    entityType: { type: "string" },
                    roles: {
                        type: "object",
                        properties: {
                            user: {
                                type: "object",
                                properties: {
                                    value: {
                                        type: "string",
                                        enum: [
                                            ChannelBusinessRules_1.ChannelNonePermission,
                                            ChannelBusinessRules_1.CHANNEL_PERMISSIONS.channelRead,
                                            ChannelBusinessRules_1.CHANNEL_PERMISSIONS.channelReadWrite,
                                        ],
                                        default: ChannelBusinessRules_1.ChannelNonePermission,
                                    },
                                    id: { type: "string" },
                                },
                            },
                        },
                    },
                },
            },
        },
        allowAsAnonymous: {
            type: "boolean",
            default: false,
        },
    },
    required: ["name"],
};
//# sourceMappingURL=ChannelSchema.js.map