Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions bindings/nodejs/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
export declare class ZenDecision {
constructor()
evaluate(context: any, opts?: ZenEvaluateOptions | undefined | null): Promise<ZenEngineResponse>
safeEvaluate(context: any, opts?: ZenEvaluateOptions | undefined | null): { success: true, data: ZenEngineResponse } | { success: false; error: any; }
safeEvaluate(context: any, opts?: ZenEvaluateOptions | undefined | null): Promise<{ success: true, data: ZenEngineResponse } | { success: false; error: any; }>
validate(): void
}

Expand All @@ -17,8 +17,8 @@ export declare class ZenEngine {
evaluate(key: string, context: any, opts?: ZenEvaluateOptions | undefined | null): Promise<ZenEngineResponse>
createDecision(content: ZenDecisionContent | Buffer | object): ZenDecision
getDecision(key: string): Promise<ZenDecision>
safeEvaluate(key: string, context: any, opts?: ZenEvaluateOptions | undefined | null): { success: true, data: ZenEngineResponse } | { success: false; error: any; }
safeGetDecision(key: string): { success: true, data: ZenDecision } | { success: false; error: any; }
safeEvaluate(key: string, context: any, opts?: ZenEvaluateOptions | undefined | null): Promise<{ success: true, data: ZenEngineResponse } | { success: false; error: any; }>
safeGetDecision(key: string): Promise<{ success: true, data: ZenDecision } | { success: false; error: any; }>
dispose(): void
}

Expand Down
2 changes: 1 addition & 1 deletion bindings/nodejs/src/decision.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ impl ZenDecision {
}

#[napi(
ts_return_type = "{ success: true, data: ZenEngineResponse } | { success: false; error: any; }"
ts_return_type = "Promise<{ success: true, data: ZenEngineResponse } | { success: false; error: any; }>"
)]
pub async fn safe_evaluate(
&self,
Expand Down
4 changes: 2 additions & 2 deletions bindings/nodejs/src/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ impl ZenEngine {
}

#[napi(
ts_return_type = "{ success: true, data: ZenEngineResponse } | { success: false; error: any; }"
ts_return_type = "Promise<{ success: true, data: ZenEngineResponse } | { success: false; error: any; }>"
)]
pub async fn safe_evaluate(
&self,
Expand All @@ -265,7 +265,7 @@ impl ZenEngine {
}

#[napi(
ts_return_type = "{ success: true, data: ZenDecision } | { success: false; error: any; }"
ts_return_type = "Promise<{ success: true, data: ZenDecision } | { success: false; error: any; }>"
)]
pub async fn safe_get_decision(&self, key: String) -> SafeResult<ZenDecision> {
self.get_decision(key).await.into()
Expand Down
Loading