import * as v from "../../shared/src/valita.js";
import { conditionSchema } from "../../zero-protocol/src/ast.js";
const ruleSchema = v.tuple([v.literal('allow'), conditionSchema]);
const policySchema = v.array(ruleSchema);
const assetSchema = v.object({
    select: policySchema.optional(),
    insert: policySchema.optional(),
    update: v
        .object({
        preMutation: policySchema.optional(),
        postMutation: policySchema.optional(),
    })
        .optional(),
    delete: policySchema.optional(),
});
export const permissionsConfigSchema = v.object({
    tables: v.record(v.object({
        row: assetSchema.optional(),
        cell: v.record(assetSchema).optional(),
    })),
});
//# sourceMappingURL=compiled-permissions.js.map