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?
optionalcommit:CommitLifecycleFunction<CommitParams,CommitAllowResult,CommitDenyResult>
commitAllowResultSchema?
optionalcommitAllowResultSchema:CommitAllowResult
commitDenyResultSchema?
optionalcommitDenyResultSchema:CommitDenyResult
commitParamsSchema?
optionalcommitParamsSchema:CommitParams
evalAllowResultSchema?
optionalevalAllowResultSchema:EvalAllowResult
evalDenyResultSchema?
optionalevalDenyResultSchema:EvalDenyResult
evaluate
evaluate: PolicyLifecycleFunction
packageName
packageName: PackageName
precheck?
optionalprecheck:PolicyLifecycleFunction<PolicyAbilityParams,UserParams,PrecheckAllowResult,PrecheckDenyResult>
precheckAllowResultSchema?
optionalprecheckAllowResultSchema:PrecheckAllowResult
precheckDenyResultSchema?
optionalprecheckDenyResultSchema:PrecheckDenyResult
userParamsSchema?
optionaluserParamsSchema:UserParams

