@gorules/zen-engine
Advanced tools
| export * from '@gorules/zen-engine-wasm32-wasi' |
+79
-54
@@ -1,25 +0,76 @@ | ||
| /* tslint:disable */ | ||
| /* auto-generated by NAPI-RS */ | ||
| /* eslint-disable */ | ||
| export declare class ZenDecision { | ||
| constructor() | ||
| evaluate(context: any, opts?: ZenEvaluateOptions | undefined | null): Promise<ZenEngineResponse> | ||
| safeEvaluate(context: any, opts?: ZenEvaluateOptions | undefined | null): Promise<SafeResult<ZenEngineResponse>> | ||
| validate(): void | ||
| } | ||
| /* auto-generated by NAPI-RS */ | ||
| export declare class ZenDecisionContent { | ||
| constructor(content: Buffer | object) | ||
| toBuffer(): Buffer | ||
| } | ||
| export declare class ZenEngine { | ||
| constructor(options?: ZenEngineOptions | undefined | null) | ||
| 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): Promise<SafeResult<ZenEngineResponse>> | ||
| safeGetDecision(key: string): Promise<SafeResult<ZenDecision>> | ||
| } | ||
| export declare class ZenEngineHandlerRequest { | ||
| constructor() | ||
| get node(): DecisionNode | ||
| get input(): any | ||
| getField(path: string): unknown | ||
| getFieldRaw(path: string): unknown | ||
| } | ||
| export interface DecisionNode { | ||
| id: string | ||
| name: string | ||
| kind: string | ||
| config: any | ||
| } | ||
| export declare function evaluateExpression(expression: string, context?: any | undefined | null): Promise<any> | ||
| export declare function evaluateExpressionSync(expression: string, context?: any | undefined | null): any | ||
| export declare function evaluateUnaryExpression(expression: string, context: any): Promise<boolean> | ||
| export declare function evaluateUnaryExpressionSync(expression: string, context: any): boolean | ||
| export declare function overrideConfig(config: ZenConfig): void | ||
| export declare function renderTemplate(template: string, context: any): Promise<any> | ||
| export declare function renderTemplateSync(template: string, context: any): any | ||
| export interface ZenConfig { | ||
| nodesInContext?: boolean | ||
| functionTimeoutMillis?: number | ||
| httpAuth?: boolean | ||
| } | ||
| export declare function overrideConfig(config: ZenConfig): void | ||
| export interface ZenEvaluateOptions { | ||
| maxDepth?: number | ||
| trace?: boolean | 'string' | 'reference' | 'referenceString' | ||
| export interface ZenEngineHandlerResponse { | ||
| output: any | ||
| traceData?: any | ||
| } | ||
| export interface ZenEngineOptions { | ||
| loader?: (key: string) => Promise<Buffer | ZenDecisionContent> | ||
| customHandler?: (request: ZenEngineHandlerRequest) => Promise<ZenEngineHandlerResponse> | ||
| httpHandler?: (request: ZenHttpHandlerRequest) => Promise<ZenHttpHandlerResponse> | ||
| } | ||
| export declare function evaluateExpressionSync(expression: string, context?: any | undefined | null): any | ||
| export declare function evaluateUnaryExpressionSync(expression: string, context: any): boolean | ||
| export declare function renderTemplateSync(template: string, context: any): any | ||
| export declare function evaluateExpression(expression: string, context?: any | undefined | null): Promise<any> | ||
| export declare function evaluateUnaryExpression(expression: string, context: any): Promise<boolean> | ||
| export declare function renderTemplate(template: string, context: any): Promise<any> | ||
| export interface ZenEngineResponse { | ||
| performance: string | ||
| result: any | ||
| trace?: Record<string, ZenEngineTrace> | ||
| } | ||
| export interface ZenEngineTrace { | ||
@@ -34,46 +85,20 @@ id: string | ||
| } | ||
| export interface ZenEngineResponse { | ||
| performance: string | ||
| result: any | ||
| trace?: Record<string, ZenEngineTrace> | ||
| export interface ZenEvaluateOptions { | ||
| maxDepth?: number | ||
| trace?: boolean | 'string' | 'reference' | 'referenceString' | ||
| } | ||
| export interface ZenEngineHandlerResponse { | ||
| output: any | ||
| traceData?: any | ||
| export interface ZenHttpHandlerRequest { | ||
| method: string | ||
| url: string | ||
| body?: any | ||
| headers: Record<string, string> | ||
| params: Record<string, string> | ||
| } | ||
| export interface DecisionNode { | ||
| id: string | ||
| name: string | ||
| kind: string | ||
| config: any | ||
| export interface ZenHttpHandlerResponse { | ||
| status: number | ||
| headers: any | ||
| data: any | ||
| } | ||
| export declare class ZenDecisionContent { | ||
| constructor(content: Buffer | object) | ||
| toBuffer(): Buffer | ||
| } | ||
| export declare class ZenDecision { | ||
| constructor() | ||
| evaluate(context: any, opts?: ZenEvaluateOptions | undefined | null): Promise<ZenEngineResponse> | ||
| safeEvaluate(context: any, opts?: ZenEvaluateOptions | undefined | null): Promise<SafeResult<ZenEngineResponse>> | ||
| validate(): void | ||
| } | ||
| export declare class ZenEngine { | ||
| constructor(options?: ZenEngineOptions | undefined | null) | ||
| 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): Promise<SafeResult<ZenEngineResponse>> | ||
| safeGetDecision(key: string): Promise<SafeResult<ZenDecision>> | ||
| /** | ||
| * Function used to dispose memory allocated for loaders | ||
| * In the future, it will likely be removed and made automatic | ||
| */ | ||
| dispose(): void | ||
| } | ||
| export declare class ZenEngineHandlerRequest { | ||
| input: any | ||
| node: DecisionNode | ||
| constructor() | ||
| getField(path: string): unknown | ||
| getFieldRaw(path: string): unknown | ||
| } |
+526
-266
@@ -1,309 +0,570 @@ | ||
| /* tslint:disable */ | ||
| // prettier-ignore | ||
| /* eslint-disable */ | ||
| /* prettier-ignore */ | ||
| // @ts-nocheck | ||
| /* auto-generated by NAPI-RS */ | ||
| const { existsSync, readFileSync } = require('fs') | ||
| const { join } = require('path') | ||
| const { readFileSync } = require('node:fs') | ||
| let nativeBinding = null | ||
| const loadErrors = [] | ||
| const { platform, arch } = process | ||
| const isMusl = () => { | ||
| let musl = false | ||
| if (process.platform === 'linux') { | ||
| musl = isMuslFromFilesystem() | ||
| if (musl === null) { | ||
| musl = isMuslFromReport() | ||
| } | ||
| if (musl === null) { | ||
| musl = isMuslFromChildProcess() | ||
| } | ||
| } | ||
| return musl | ||
| } | ||
| let nativeBinding = null | ||
| let localFileExisted = false | ||
| let loadError = null | ||
| const isFileMusl = (f) => f.includes('libc.musl-') || f.includes('ld-musl-') | ||
| function isMusl() { | ||
| // For Node 10 | ||
| if (!process.report || typeof process.report.getReport !== 'function') { | ||
| try { | ||
| const lddPath = require('child_process').execSync('which ldd').toString().trim() | ||
| return readFileSync(lddPath, 'utf8').includes('musl') | ||
| } catch (e) { | ||
| const isMuslFromFilesystem = () => { | ||
| try { | ||
| return readFileSync('/usr/bin/ldd', 'utf-8').includes('musl') | ||
| } catch { | ||
| return null | ||
| } | ||
| } | ||
| const isMuslFromReport = () => { | ||
| let report = null | ||
| if (typeof process.report?.getReport === 'function') { | ||
| process.report.excludeNetwork = true | ||
| report = process.report.getReport() | ||
| } | ||
| if (!report) { | ||
| return null | ||
| } | ||
| if (report.header && report.header.glibcVersionRuntime) { | ||
| return false | ||
| } | ||
| if (Array.isArray(report.sharedObjects)) { | ||
| if (report.sharedObjects.some(isFileMusl)) { | ||
| return true | ||
| } | ||
| } else { | ||
| const { glibcVersionRuntime } = process.report.getReport().header | ||
| return !glibcVersionRuntime | ||
| } | ||
| return false | ||
| } | ||
| switch (platform) { | ||
| case 'android': | ||
| switch (arch) { | ||
| case 'arm64': | ||
| localFileExisted = existsSync(join(__dirname, 'zen-engine.android-arm64.node')) | ||
| const isMuslFromChildProcess = () => { | ||
| try { | ||
| return require('child_process').execSync('ldd --version', { encoding: 'utf8' }).includes('musl') | ||
| } catch (e) { | ||
| // If we reach this case, we don't know if the system is musl or not, so is better to just fallback to false | ||
| return false | ||
| } | ||
| } | ||
| function requireNative() { | ||
| if (process.env.NAPI_RS_NATIVE_LIBRARY_PATH) { | ||
| try { | ||
| return require(process.env.NAPI_RS_NATIVE_LIBRARY_PATH); | ||
| } catch (err) { | ||
| loadErrors.push(err) | ||
| } | ||
| } else if (process.platform === 'android') { | ||
| if (process.arch === 'arm64') { | ||
| try { | ||
| return require('./zen-engine.android-arm64.node') | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| try { | ||
| const binding = require('@gorules/zen-engine-android-arm64') | ||
| const bindingPackageVersion = require('@gorules/zen-engine-android-arm64/package.json').version | ||
| if (bindingPackageVersion !== '0.50.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.50.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
| return binding | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| } else if (process.arch === 'arm') { | ||
| try { | ||
| return require('./zen-engine.android-arm-eabi.node') | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| try { | ||
| const binding = require('@gorules/zen-engine-android-arm-eabi') | ||
| const bindingPackageVersion = require('@gorules/zen-engine-android-arm-eabi/package.json').version | ||
| if (bindingPackageVersion !== '0.50.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.50.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
| return binding | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| } else { | ||
| loadErrors.push(new Error(`Unsupported architecture on Android ${process.arch}`)) | ||
| } | ||
| } else if (process.platform === 'win32') { | ||
| if (process.arch === 'x64') { | ||
| if (process.config?.variables?.shlib_suffix === 'dll.a' || process.config?.variables?.node_target_type === 'shared_library') { | ||
| try { | ||
| if (localFileExisted) { | ||
| nativeBinding = require('./zen-engine.android-arm64.node') | ||
| } else { | ||
| nativeBinding = require('@gorules/zen-engine-android-arm64') | ||
| } | ||
| return require('./zen-engine.win32-x64-gnu.node') | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| try { | ||
| const binding = require('@gorules/zen-engine-win32-x64-gnu') | ||
| const bindingPackageVersion = require('@gorules/zen-engine-win32-x64-gnu/package.json').version | ||
| if (bindingPackageVersion !== '0.50.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.50.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
| return binding | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| } else { | ||
| try { | ||
| return require('./zen-engine.win32-x64-msvc.node') | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| try { | ||
| const binding = require('@gorules/zen-engine-win32-x64-msvc') | ||
| const bindingPackageVersion = require('@gorules/zen-engine-win32-x64-msvc/package.json').version | ||
| if (bindingPackageVersion !== '0.50.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.50.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
| return binding | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| } | ||
| } else if (process.arch === 'ia32') { | ||
| try { | ||
| return require('./zen-engine.win32-ia32-msvc.node') | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| try { | ||
| const binding = require('@gorules/zen-engine-win32-ia32-msvc') | ||
| const bindingPackageVersion = require('@gorules/zen-engine-win32-ia32-msvc/package.json').version | ||
| if (bindingPackageVersion !== '0.50.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.50.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
| return binding | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| } else if (process.arch === 'arm64') { | ||
| try { | ||
| return require('./zen-engine.win32-arm64-msvc.node') | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| try { | ||
| const binding = require('@gorules/zen-engine-win32-arm64-msvc') | ||
| const bindingPackageVersion = require('@gorules/zen-engine-win32-arm64-msvc/package.json').version | ||
| if (bindingPackageVersion !== '0.50.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.50.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
| return binding | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| } else { | ||
| loadErrors.push(new Error(`Unsupported architecture on Windows: ${process.arch}`)) | ||
| } | ||
| } else if (process.platform === 'darwin') { | ||
| try { | ||
| return require('./zen-engine.darwin-universal.node') | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| try { | ||
| const binding = require('@gorules/zen-engine-darwin-universal') | ||
| const bindingPackageVersion = require('@gorules/zen-engine-darwin-universal/package.json').version | ||
| if (bindingPackageVersion !== '0.50.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.50.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
| return binding | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| if (process.arch === 'x64') { | ||
| try { | ||
| return require('./zen-engine.darwin-x64.node') | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| try { | ||
| const binding = require('@gorules/zen-engine-darwin-x64') | ||
| const bindingPackageVersion = require('@gorules/zen-engine-darwin-x64/package.json').version | ||
| if (bindingPackageVersion !== '0.50.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.50.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
| return binding | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| } else if (process.arch === 'arm64') { | ||
| try { | ||
| return require('./zen-engine.darwin-arm64.node') | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| try { | ||
| const binding = require('@gorules/zen-engine-darwin-arm64') | ||
| const bindingPackageVersion = require('@gorules/zen-engine-darwin-arm64/package.json').version | ||
| if (bindingPackageVersion !== '0.50.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.50.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
| return binding | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| } else { | ||
| loadErrors.push(new Error(`Unsupported architecture on macOS: ${process.arch}`)) | ||
| } | ||
| } else if (process.platform === 'freebsd') { | ||
| if (process.arch === 'x64') { | ||
| try { | ||
| return require('./zen-engine.freebsd-x64.node') | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| try { | ||
| const binding = require('@gorules/zen-engine-freebsd-x64') | ||
| const bindingPackageVersion = require('@gorules/zen-engine-freebsd-x64/package.json').version | ||
| if (bindingPackageVersion !== '0.50.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.50.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
| return binding | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| } else if (process.arch === 'arm64') { | ||
| try { | ||
| return require('./zen-engine.freebsd-arm64.node') | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| try { | ||
| const binding = require('@gorules/zen-engine-freebsd-arm64') | ||
| const bindingPackageVersion = require('@gorules/zen-engine-freebsd-arm64/package.json').version | ||
| if (bindingPackageVersion !== '0.50.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.50.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
| return binding | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| } else { | ||
| loadErrors.push(new Error(`Unsupported architecture on FreeBSD: ${process.arch}`)) | ||
| } | ||
| } else if (process.platform === 'linux') { | ||
| if (process.arch === 'x64') { | ||
| if (isMusl()) { | ||
| try { | ||
| return require('./zen-engine.linux-x64-musl.node') | ||
| } catch (e) { | ||
| loadError = e | ||
| loadErrors.push(e) | ||
| } | ||
| break | ||
| case 'arm': | ||
| localFileExisted = existsSync(join(__dirname, 'zen-engine.android-arm-eabi.node')) | ||
| try { | ||
| if (localFileExisted) { | ||
| nativeBinding = require('./zen-engine.android-arm-eabi.node') | ||
| } else { | ||
| nativeBinding = require('@gorules/zen-engine-android-arm-eabi') | ||
| const binding = require('@gorules/zen-engine-linux-x64-musl') | ||
| const bindingPackageVersion = require('@gorules/zen-engine-linux-x64-musl/package.json').version | ||
| if (bindingPackageVersion !== '0.50.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.50.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
| return binding | ||
| } catch (e) { | ||
| loadError = e | ||
| loadErrors.push(e) | ||
| } | ||
| break | ||
| default: | ||
| throw new Error(`Unsupported architecture on Android ${arch}`) | ||
| } | ||
| break | ||
| case 'win32': | ||
| switch (arch) { | ||
| case 'x64': | ||
| localFileExisted = existsSync( | ||
| join(__dirname, 'zen-engine.win32-x64-msvc.node') | ||
| ) | ||
| } else { | ||
| try { | ||
| if (localFileExisted) { | ||
| nativeBinding = require('./zen-engine.win32-x64-msvc.node') | ||
| } else { | ||
| nativeBinding = require('@gorules/zen-engine-win32-x64-msvc') | ||
| } | ||
| return require('./zen-engine.linux-x64-gnu.node') | ||
| } catch (e) { | ||
| loadError = e | ||
| loadErrors.push(e) | ||
| } | ||
| break | ||
| case 'ia32': | ||
| localFileExisted = existsSync( | ||
| join(__dirname, 'zen-engine.win32-ia32-msvc.node') | ||
| ) | ||
| try { | ||
| if (localFileExisted) { | ||
| nativeBinding = require('./zen-engine.win32-ia32-msvc.node') | ||
| } else { | ||
| nativeBinding = require('@gorules/zen-engine-win32-ia32-msvc') | ||
| const binding = require('@gorules/zen-engine-linux-x64-gnu') | ||
| const bindingPackageVersion = require('@gorules/zen-engine-linux-x64-gnu/package.json').version | ||
| if (bindingPackageVersion !== '0.50.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.50.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
| return binding | ||
| } catch (e) { | ||
| loadError = e | ||
| loadErrors.push(e) | ||
| } | ||
| break | ||
| case 'arm64': | ||
| localFileExisted = existsSync( | ||
| join(__dirname, 'zen-engine.win32-arm64-msvc.node') | ||
| ) | ||
| } | ||
| } else if (process.arch === 'arm64') { | ||
| if (isMusl()) { | ||
| try { | ||
| if (localFileExisted) { | ||
| nativeBinding = require('./zen-engine.win32-arm64-msvc.node') | ||
| } else { | ||
| nativeBinding = require('@gorules/zen-engine-win32-arm64-msvc') | ||
| return require('./zen-engine.linux-arm64-musl.node') | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| try { | ||
| const binding = require('@gorules/zen-engine-linux-arm64-musl') | ||
| const bindingPackageVersion = require('@gorules/zen-engine-linux-arm64-musl/package.json').version | ||
| if (bindingPackageVersion !== '0.50.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.50.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
| return binding | ||
| } catch (e) { | ||
| loadError = e | ||
| loadErrors.push(e) | ||
| } | ||
| break | ||
| default: | ||
| throw new Error(`Unsupported architecture on Windows: ${arch}`) | ||
| } | ||
| break | ||
| case 'darwin': | ||
| localFileExisted = existsSync(join(__dirname, 'zen-engine.darwin-universal.node')) | ||
| try { | ||
| if (localFileExisted) { | ||
| nativeBinding = require('./zen-engine.darwin-universal.node') | ||
| } else { | ||
| nativeBinding = require('@gorules/zen-engine-darwin-universal') | ||
| } | ||
| break | ||
| } catch {} | ||
| switch (arch) { | ||
| case 'x64': | ||
| localFileExisted = existsSync(join(__dirname, 'zen-engine.darwin-x64.node')) | ||
| try { | ||
| if (localFileExisted) { | ||
| nativeBinding = require('./zen-engine.darwin-x64.node') | ||
| } else { | ||
| nativeBinding = require('@gorules/zen-engine-darwin-x64') | ||
| return require('./zen-engine.linux-arm64-gnu.node') | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| try { | ||
| const binding = require('@gorules/zen-engine-linux-arm64-gnu') | ||
| const bindingPackageVersion = require('@gorules/zen-engine-linux-arm64-gnu/package.json').version | ||
| if (bindingPackageVersion !== '0.50.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.50.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
| return binding | ||
| } catch (e) { | ||
| loadError = e | ||
| loadErrors.push(e) | ||
| } | ||
| break | ||
| case 'arm64': | ||
| localFileExisted = existsSync( | ||
| join(__dirname, 'zen-engine.darwin-arm64.node') | ||
| ) | ||
| } | ||
| } else if (process.arch === 'arm') { | ||
| if (isMusl()) { | ||
| try { | ||
| if (localFileExisted) { | ||
| nativeBinding = require('./zen-engine.darwin-arm64.node') | ||
| } else { | ||
| nativeBinding = require('@gorules/zen-engine-darwin-arm64') | ||
| return require('./zen-engine.linux-arm-musleabihf.node') | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| try { | ||
| const binding = require('@gorules/zen-engine-linux-arm-musleabihf') | ||
| const bindingPackageVersion = require('@gorules/zen-engine-linux-arm-musleabihf/package.json').version | ||
| if (bindingPackageVersion !== '0.50.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.50.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
| return binding | ||
| } catch (e) { | ||
| loadError = e | ||
| loadErrors.push(e) | ||
| } | ||
| break | ||
| default: | ||
| throw new Error(`Unsupported architecture on macOS: ${arch}`) | ||
| } | ||
| break | ||
| case 'freebsd': | ||
| if (arch !== 'x64') { | ||
| throw new Error(`Unsupported architecture on FreeBSD: ${arch}`) | ||
| } | ||
| localFileExisted = existsSync(join(__dirname, 'zen-engine.freebsd-x64.node')) | ||
| try { | ||
| if (localFileExisted) { | ||
| nativeBinding = require('./zen-engine.freebsd-x64.node') | ||
| } else { | ||
| nativeBinding = require('@gorules/zen-engine-freebsd-x64') | ||
| } | ||
| } catch (e) { | ||
| loadError = e | ||
| } | ||
| break | ||
| case 'linux': | ||
| switch (arch) { | ||
| case 'x64': | ||
| if (isMusl()) { | ||
| localFileExisted = existsSync( | ||
| join(__dirname, 'zen-engine.linux-x64-musl.node') | ||
| ) | ||
| try { | ||
| if (localFileExisted) { | ||
| nativeBinding = require('./zen-engine.linux-x64-musl.node') | ||
| } else { | ||
| nativeBinding = require('@gorules/zen-engine-linux-x64-musl') | ||
| } | ||
| } catch (e) { | ||
| loadError = e | ||
| try { | ||
| return require('./zen-engine.linux-arm-gnueabihf.node') | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| try { | ||
| const binding = require('@gorules/zen-engine-linux-arm-gnueabihf') | ||
| const bindingPackageVersion = require('@gorules/zen-engine-linux-arm-gnueabihf/package.json').version | ||
| if (bindingPackageVersion !== '0.50.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.50.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
| } else { | ||
| localFileExisted = existsSync( | ||
| join(__dirname, 'zen-engine.linux-x64-gnu.node') | ||
| ) | ||
| try { | ||
| if (localFileExisted) { | ||
| nativeBinding = require('./zen-engine.linux-x64-gnu.node') | ||
| } else { | ||
| nativeBinding = require('@gorules/zen-engine-linux-x64-gnu') | ||
| } | ||
| } catch (e) { | ||
| loadError = e | ||
| } | ||
| return binding | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| break | ||
| case 'arm64': | ||
| if (isMusl()) { | ||
| localFileExisted = existsSync( | ||
| join(__dirname, 'zen-engine.linux-arm64-musl.node') | ||
| ) | ||
| try { | ||
| if (localFileExisted) { | ||
| nativeBinding = require('./zen-engine.linux-arm64-musl.node') | ||
| } else { | ||
| nativeBinding = require('@gorules/zen-engine-linux-arm64-musl') | ||
| } | ||
| } catch (e) { | ||
| loadError = e | ||
| } | ||
| } else if (process.arch === 'loong64') { | ||
| if (isMusl()) { | ||
| try { | ||
| return require('./zen-engine.linux-loong64-musl.node') | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| try { | ||
| const binding = require('@gorules/zen-engine-linux-loong64-musl') | ||
| const bindingPackageVersion = require('@gorules/zen-engine-linux-loong64-musl/package.json').version | ||
| if (bindingPackageVersion !== '0.50.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.50.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
| } else { | ||
| localFileExisted = existsSync( | ||
| join(__dirname, 'zen-engine.linux-arm64-gnu.node') | ||
| ) | ||
| try { | ||
| if (localFileExisted) { | ||
| nativeBinding = require('./zen-engine.linux-arm64-gnu.node') | ||
| } else { | ||
| nativeBinding = require('@gorules/zen-engine-linux-arm64-gnu') | ||
| } | ||
| } catch (e) { | ||
| loadError = e | ||
| } | ||
| return binding | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| break | ||
| case 'arm': | ||
| if (isMusl()) { | ||
| localFileExisted = existsSync( | ||
| join(__dirname, 'zen-engine.linux-arm-musleabihf.node') | ||
| ) | ||
| try { | ||
| if (localFileExisted) { | ||
| nativeBinding = require('./zen-engine.linux-arm-musleabihf.node') | ||
| } else { | ||
| nativeBinding = require('@gorules/zen-engine-linux-arm-musleabihf') | ||
| } | ||
| } catch (e) { | ||
| loadError = e | ||
| } else { | ||
| try { | ||
| return require('./zen-engine.linux-loong64-gnu.node') | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| try { | ||
| const binding = require('@gorules/zen-engine-linux-loong64-gnu') | ||
| const bindingPackageVersion = require('@gorules/zen-engine-linux-loong64-gnu/package.json').version | ||
| if (bindingPackageVersion !== '0.50.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.50.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
| } else { | ||
| localFileExisted = existsSync( | ||
| join(__dirname, 'zen-engine.linux-arm-gnueabihf.node') | ||
| ) | ||
| try { | ||
| if (localFileExisted) { | ||
| nativeBinding = require('./zen-engine.linux-arm-gnueabihf.node') | ||
| } else { | ||
| nativeBinding = require('@gorules/zen-engine-linux-arm-gnueabihf') | ||
| } | ||
| } catch (e) { | ||
| loadError = e | ||
| } | ||
| return binding | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| break | ||
| case 'riscv64': | ||
| if (isMusl()) { | ||
| localFileExisted = existsSync( | ||
| join(__dirname, 'zen-engine.linux-riscv64-musl.node') | ||
| ) | ||
| try { | ||
| if (localFileExisted) { | ||
| nativeBinding = require('./zen-engine.linux-riscv64-musl.node') | ||
| } else { | ||
| nativeBinding = require('@gorules/zen-engine-linux-riscv64-musl') | ||
| } | ||
| } catch (e) { | ||
| loadError = e | ||
| } | ||
| } else if (process.arch === 'riscv64') { | ||
| if (isMusl()) { | ||
| try { | ||
| return require('./zen-engine.linux-riscv64-musl.node') | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| try { | ||
| const binding = require('@gorules/zen-engine-linux-riscv64-musl') | ||
| const bindingPackageVersion = require('@gorules/zen-engine-linux-riscv64-musl/package.json').version | ||
| if (bindingPackageVersion !== '0.50.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.50.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
| } else { | ||
| localFileExisted = existsSync( | ||
| join(__dirname, 'zen-engine.linux-riscv64-gnu.node') | ||
| ) | ||
| try { | ||
| if (localFileExisted) { | ||
| nativeBinding = require('./zen-engine.linux-riscv64-gnu.node') | ||
| } else { | ||
| nativeBinding = require('@gorules/zen-engine-linux-riscv64-gnu') | ||
| } | ||
| } catch (e) { | ||
| loadError = e | ||
| } | ||
| return binding | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| break | ||
| case 's390x': | ||
| localFileExisted = existsSync( | ||
| join(__dirname, 'zen-engine.linux-s390x-gnu.node') | ||
| ) | ||
| } else { | ||
| try { | ||
| if (localFileExisted) { | ||
| nativeBinding = require('./zen-engine.linux-s390x-gnu.node') | ||
| } else { | ||
| nativeBinding = require('@gorules/zen-engine-linux-s390x-gnu') | ||
| return require('./zen-engine.linux-riscv64-gnu.node') | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| try { | ||
| const binding = require('@gorules/zen-engine-linux-riscv64-gnu') | ||
| const bindingPackageVersion = require('@gorules/zen-engine-linux-riscv64-gnu/package.json').version | ||
| if (bindingPackageVersion !== '0.50.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.50.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
| return binding | ||
| } catch (e) { | ||
| loadError = e | ||
| loadErrors.push(e) | ||
| } | ||
| break | ||
| default: | ||
| throw new Error(`Unsupported architecture on Linux: ${arch}`) | ||
| } | ||
| } else if (process.arch === 'ppc64') { | ||
| try { | ||
| return require('./zen-engine.linux-ppc64-gnu.node') | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| try { | ||
| const binding = require('@gorules/zen-engine-linux-ppc64-gnu') | ||
| const bindingPackageVersion = require('@gorules/zen-engine-linux-ppc64-gnu/package.json').version | ||
| if (bindingPackageVersion !== '0.50.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.50.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
| return binding | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| } else if (process.arch === 's390x') { | ||
| try { | ||
| return require('./zen-engine.linux-s390x-gnu.node') | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| try { | ||
| const binding = require('@gorules/zen-engine-linux-s390x-gnu') | ||
| const bindingPackageVersion = require('@gorules/zen-engine-linux-s390x-gnu/package.json').version | ||
| if (bindingPackageVersion !== '0.50.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.50.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
| return binding | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| } else { | ||
| loadErrors.push(new Error(`Unsupported architecture on Linux: ${process.arch}`)) | ||
| } | ||
| break | ||
| default: | ||
| throw new Error(`Unsupported OS: ${platform}, architecture: ${arch}`) | ||
| } else if (process.platform === 'openharmony') { | ||
| if (process.arch === 'arm64') { | ||
| try { | ||
| return require('./zen-engine.openharmony-arm64.node') | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| try { | ||
| const binding = require('@gorules/zen-engine-openharmony-arm64') | ||
| const bindingPackageVersion = require('@gorules/zen-engine-openharmony-arm64/package.json').version | ||
| if (bindingPackageVersion !== '0.50.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.50.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
| return binding | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| } else if (process.arch === 'x64') { | ||
| try { | ||
| return require('./zen-engine.openharmony-x64.node') | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| try { | ||
| const binding = require('@gorules/zen-engine-openharmony-x64') | ||
| const bindingPackageVersion = require('@gorules/zen-engine-openharmony-x64/package.json').version | ||
| if (bindingPackageVersion !== '0.50.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.50.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
| return binding | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| } else if (process.arch === 'arm') { | ||
| try { | ||
| return require('./zen-engine.openharmony-arm.node') | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| try { | ||
| const binding = require('@gorules/zen-engine-openharmony-arm') | ||
| const bindingPackageVersion = require('@gorules/zen-engine-openharmony-arm/package.json').version | ||
| if (bindingPackageVersion !== '0.50.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { | ||
| throw new Error(`Native binding package version mismatch, expected 0.50.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) | ||
| } | ||
| return binding | ||
| } catch (e) { | ||
| loadErrors.push(e) | ||
| } | ||
| } else { | ||
| loadErrors.push(new Error(`Unsupported architecture on OpenHarmony: ${process.arch}`)) | ||
| } | ||
| } else { | ||
| loadErrors.push(new Error(`Unsupported OS: ${process.platform}, architecture: ${process.arch}`)) | ||
| } | ||
| } | ||
| nativeBinding = requireNative() | ||
| if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) { | ||
| let wasiBinding = null | ||
| let wasiBindingError = null | ||
| try { | ||
| wasiBinding = require('./zen-engine.wasi.cjs') | ||
| nativeBinding = wasiBinding | ||
| } catch (err) { | ||
| if (process.env.NAPI_RS_FORCE_WASI) { | ||
| wasiBindingError = err | ||
| } | ||
| } | ||
| if (!nativeBinding) { | ||
| try { | ||
| wasiBinding = require('@gorules/zen-engine-wasm32-wasi') | ||
| nativeBinding = wasiBinding | ||
| } catch (err) { | ||
| if (process.env.NAPI_RS_FORCE_WASI) { | ||
| wasiBindingError.cause = err | ||
| loadErrors.push(err) | ||
| } | ||
| } | ||
| } | ||
| if (process.env.NAPI_RS_FORCE_WASI === 'error' && !wasiBinding) { | ||
| const error = new Error('WASI binding not found and NAPI_RS_FORCE_WASI is set to error') | ||
| error.cause = wasiBindingError | ||
| throw error | ||
| } | ||
| } | ||
| if (!nativeBinding) { | ||
| if (loadError) { | ||
| throw loadError | ||
| if (loadErrors.length > 0) { | ||
| throw new Error( | ||
| `Cannot find native binding. ` + | ||
| `npm has a bug related to optional dependencies (https://github.com/npm/cli/issues/4828). ` + | ||
| 'Please try `npm i` again after removing both package-lock.json and node_modules directory.', | ||
| { | ||
| cause: loadErrors.reduce((err, cur) => { | ||
| cur.cause = err | ||
| return cur | ||
| }), | ||
| }, | ||
| ) | ||
| } | ||
@@ -313,14 +574,13 @@ throw new Error(`Failed to load native binding`) | ||
| const { overrideConfig, ZenDecisionContent, ZenDecision, ZenEngine, evaluateExpressionSync, evaluateUnaryExpressionSync, renderTemplateSync, evaluateExpression, evaluateUnaryExpression, renderTemplate, ZenEngineHandlerRequest } = nativeBinding | ||
| module.exports.overrideConfig = overrideConfig | ||
| module.exports.ZenDecisionContent = ZenDecisionContent | ||
| module.exports.ZenDecision = ZenDecision | ||
| module.exports.ZenEngine = ZenEngine | ||
| module.exports.evaluateExpressionSync = evaluateExpressionSync | ||
| module.exports.evaluateUnaryExpressionSync = evaluateUnaryExpressionSync | ||
| module.exports.renderTemplateSync = renderTemplateSync | ||
| module.exports.evaluateExpression = evaluateExpression | ||
| module.exports.evaluateUnaryExpression = evaluateUnaryExpression | ||
| module.exports.renderTemplate = renderTemplate | ||
| module.exports.ZenEngineHandlerRequest = ZenEngineHandlerRequest | ||
| module.exports = nativeBinding | ||
| module.exports.ZenDecision = nativeBinding.ZenDecision | ||
| module.exports.ZenDecisionContent = nativeBinding.ZenDecisionContent | ||
| module.exports.ZenEngine = nativeBinding.ZenEngine | ||
| module.exports.ZenEngineHandlerRequest = nativeBinding.ZenEngineHandlerRequest | ||
| module.exports.evaluateExpression = nativeBinding.evaluateExpression | ||
| module.exports.evaluateExpressionSync = nativeBinding.evaluateExpressionSync | ||
| module.exports.evaluateUnaryExpression = nativeBinding.evaluateUnaryExpression | ||
| module.exports.evaluateUnaryExpressionSync = nativeBinding.evaluateUnaryExpressionSync | ||
| module.exports.overrideConfig = nativeBinding.overrideConfig | ||
| module.exports.renderTemplate = nativeBinding.renderTemplate | ||
| module.exports.renderTemplateSync = nativeBinding.renderTemplateSync |
+43
-33
| { | ||
| "name": "@gorules/zen-engine", | ||
| "version": "0.50.0", | ||
| "version": "0.51.0", | ||
| "main": "index.js", | ||
| "browser": "browser.js", | ||
| "types": "./index.d.ts", | ||
@@ -11,2 +12,3 @@ "license": "MIT", | ||
| "index.d.ts", | ||
| "browser.js", | ||
| "README.md" | ||
@@ -16,16 +18,20 @@ ], | ||
| "napi": { | ||
| "name": "zen-engine", | ||
| "triples": { | ||
| "defaults": false, | ||
| "additional": [ | ||
| "x86_64-apple-darwin", | ||
| "x86_64-unknown-linux-gnu", | ||
| "x86_64-unknown-linux-musl", | ||
| "x86_64-pc-windows-msvc", | ||
| "aarch64-unknown-linux-gnu", | ||
| "aarch64-unknown-linux-musl", | ||
| "aarch64-apple-darwin" | ||
| ] | ||
| }, | ||
| "npmClient": "yarn" | ||
| "binaryName": "zen-engine", | ||
| "targets": [ | ||
| "x86_64-apple-darwin", | ||
| "x86_64-unknown-linux-gnu", | ||
| "x86_64-unknown-linux-musl", | ||
| "x86_64-pc-windows-msvc", | ||
| "aarch64-unknown-linux-gnu", | ||
| "aarch64-unknown-linux-musl", | ||
| "aarch64-apple-darwin", | ||
| "wasm32-wasi-preview1-threads" | ||
| ], | ||
| "npmClient": "yarn", | ||
| "wasm": { | ||
| "browser": { | ||
| "fs": false, | ||
| "asyncInit": true | ||
| } | ||
| } | ||
| }, | ||
@@ -55,15 +61,17 @@ "keywords": [ | ||
| "devDependencies": { | ||
| "@jest/globals": "^29.7.0", | ||
| "@napi-rs/cli": "^2.18.4", | ||
| "@types/express": "^5.0.1", | ||
| "@types/node": "^22.14.1", | ||
| "babel-jest": "^29.7.0", | ||
| "cross-env": "^10.0.0", | ||
| "@jest/globals": "^30.2.0", | ||
| "@napi-rs/cli": "^3.4.1", | ||
| "@napi-rs/wasm-runtime": "^1.0.7", | ||
| "@types/express": "^5.0.5", | ||
| "@types/node": "^24.10.0", | ||
| "babel-jest": "^30.2.0", | ||
| "cross-env": "^10.1.0", | ||
| "emnapi": "^1.7.0", | ||
| "express": "^5.1.0", | ||
| "jest": "^29.7.0", | ||
| "lerna": "6", | ||
| "ts-jest": "^29.3.2", | ||
| "jest": "^30.2.0", | ||
| "lerna": "6.6.2", | ||
| "ts-jest": "^29.4.5", | ||
| "ts-node": "^10.9.2", | ||
| "tslib": "^2.8.1", | ||
| "typescript": "^5.8.3" | ||
| "typescript": "^5.9.3" | ||
| }, | ||
@@ -87,2 +95,3 @@ "bugs": { | ||
| "artifacts": "napi artifacts -d ../../artifacts", | ||
| "createNpmDirs": "napi create-npm-dirs", | ||
| "prepublishOnly": "napi prepublish", | ||
@@ -94,12 +103,13 @@ "version": "napi version" | ||
| }, | ||
| "gitHead": "94faf6792a3b01e9b4dcfba5d552dab5e72d2854", | ||
| "gitHead": "15b766195235404f0697a8f60f286c300e7d2533", | ||
| "optionalDependencies": { | ||
| "@gorules/zen-engine-darwin-x64": "0.50.0", | ||
| "@gorules/zen-engine-linux-x64-gnu": "0.50.0", | ||
| "@gorules/zen-engine-linux-x64-musl": "0.50.0", | ||
| "@gorules/zen-engine-win32-x64-msvc": "0.50.0", | ||
| "@gorules/zen-engine-linux-arm64-gnu": "0.50.0", | ||
| "@gorules/zen-engine-linux-arm64-musl": "0.50.0", | ||
| "@gorules/zen-engine-darwin-arm64": "0.50.0" | ||
| "@gorules/zen-engine-darwin-x64": "0.51.0", | ||
| "@gorules/zen-engine-linux-x64-gnu": "0.51.0", | ||
| "@gorules/zen-engine-linux-x64-musl": "0.51.0", | ||
| "@gorules/zen-engine-win32-x64-msvc": "0.51.0", | ||
| "@gorules/zen-engine-linux-arm64-gnu": "0.51.0", | ||
| "@gorules/zen-engine-linux-arm64-musl": "0.51.0", | ||
| "@gorules/zen-engine-darwin-arm64": "0.51.0", | ||
| "@gorules/zen-engine-wasm32-wasi": "0.51.0" | ||
| } | ||
| } |
+0
-2
@@ -43,3 +43,2 @@ [](https://opensource.org/licenses/MIT) | ||
| const result = await decision.evaluate({ input: 15 }); | ||
| engine.dispose(); | ||
| })(); | ||
@@ -63,3 +62,2 @@ ``` | ||
| const result = await engine.evaluate('jdm_graph1.json', { input: 5 }); | ||
| engine.dispose(); | ||
| })(); | ||
@@ -66,0 +64,0 @@ ``` |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 3 instances in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
46592
49%6
20%659
68.11%8
14.29%15
15.38%322
-0.62%60
5900%2
100%