createVincentPolicy<Defined in: policyCore/vincentPolicy.ts:56 ThePackageName
,PolicyAbilityParams
,UserParams
,PrecheckAllowResult
,PrecheckDenyResult
,EvalAllowResult
,EvalDenyResult
,CommitParams
,CommitAllowResult
,CommitDenyResult
>(PolicyConfig
):object
createVincentPolicy()
method is used to define a policy’s lifecycle methods and ensure that arguments provided to the ability’s
lifecycle methods, as well as their return values, are validated and fully type-safe by defining ZOD schemas for them.
Type Parameters
PackageName
PackageName
extends string
PolicyAbilityParams
PolicyAbilityParams
extends ZodType
<any
, ZodTypeDef
, any
>
UserParams
UserParams
extends ZodType
<any
, ZodTypeDef
, any
> = ZodUndefined
PrecheckAllowResult
PrecheckAllowResult
extends ZodType
<any
, ZodTypeDef
, any
> = ZodUndefined
PrecheckDenyResult
PrecheckDenyResult
extends ZodType
<any
, ZodTypeDef
, any
> = ZodUndefined
EvalAllowResult
EvalAllowResult
extends ZodType
<any
, ZodTypeDef
, any
> = ZodUndefined
EvalDenyResult
EvalDenyResult
extends ZodType
<any
, ZodTypeDef
, any
> = ZodUndefined
CommitParams
CommitParams
extends ZodType
<any
, ZodTypeDef
, any
> = ZodUndefined
CommitAllowResult
CommitAllowResult
extends ZodType
<any
, ZodTypeDef
, any
> = ZodUndefined
CommitDenyResult
CommitDenyResult
extends ZodType
<any
, ZodTypeDef
, any
> = ZodUndefined
Parameters
PolicyConfig
VincentPolicyConfig
<PackageName
, PolicyAbilityParams
, UserParams
, PrecheckAllowResult
, PrecheckDenyResult
, EvalAllowResult
, EvalDenyResult
, CommitParams
, CommitAllowResult
, CommitDenyResult
, PolicyConfigLifecycleFunction
<PolicyAbilityParams
, UserParams
, EvalAllowResult
, EvalDenyResult
>, PolicyConfigLifecycleFunction
<PolicyAbilityParams
, UserParams
, PrecheckAllowResult
, PrecheckDenyResult
>, PolicyConfigCommitFunction
<CommitParams
, CommitAllowResult
, CommitDenyResult
>>
Returns
object
abilityParamsSchema
abilityParamsSchema: PolicyAbilityParams
commit?
optional
commit:CommitLifecycleFunction
<CommitParams
,CommitAllowResult
,CommitDenyResult
>
commitAllowResultSchema?
optional
commitAllowResultSchema:CommitAllowResult
commitDenyResultSchema?
optional
commitDenyResultSchema:CommitDenyResult
commitParamsSchema?
optional
commitParamsSchema:CommitParams
evalAllowResultSchema?
optional
evalAllowResultSchema:EvalAllowResult
evalDenyResultSchema?
optional
evalDenyResultSchema:EvalDenyResult
evaluate
evaluate: PolicyLifecycleFunction
packageName
packageName: PackageName
precheck?
optional
precheck:PolicyLifecycleFunction
<PolicyAbilityParams
,UserParams
,PrecheckAllowResult
,PrecheckDenyResult
>
precheckAllowResultSchema?
optional
precheckAllowResultSchema:PrecheckAllowResult
precheckDenyResultSchema?
optional
precheckDenyResultSchema:PrecheckDenyResult
userParamsSchema?
optional
userParamsSchema:UserParams