@@ -43,6 +43,7 @@ import {
4343import { match } from 'ts-pattern' ;
4444import { ColumnCollector } from './column-collector' ;
4545import { ExpressionTransformer } from './expression-transformer' ;
46+ import type { PolicyPluginOptions } from './options' ;
4647import type { Policy , PolicyOperation } from './types' ;
4748import {
4849 buildIsFalse ,
@@ -64,22 +65,13 @@ export type MutationQueryNode = InsertQueryNode | UpdateQueryNode | DeleteQueryN
6465
6566type FieldLevelPolicyOperations = Exclude < CRUD_EXT , 'create' | 'delete' > ;
6667
67- export type PolicyHandlerOptions = {
68- /**
69- * Dangerously bypasses access-policy enforcement for raw SQL queries.
70- * Raw queries remain in the current transaction, but the policy plugin will
71- * not inspect or reject them.
72- */
73- dangerouslyAllowRawSql ?: boolean ;
74- } ;
75-
7668export class PolicyHandler < Schema extends SchemaDef > extends OperationNodeTransformer {
7769 private readonly dialect : BaseCrudDialect < Schema > ;
7870 private readonly eb = expressionBuilder < any , any > ( ) ;
7971
8072 constructor (
8173 private readonly client : ClientContract < Schema > ,
82- private readonly options : PolicyHandlerOptions = { } ,
74+ private readonly options : PolicyPluginOptions = { } ,
8375 ) {
8476 super ( ) ;
8577 this . dialect = getCrudDialect ( this . client . $schema , this . client . $options ) ;
0 commit comments