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