Socket
Socket
Sign inDemoInstall

@shapediver/viewer.settings

Package Overview
Dependencies
Maintainers
5
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@shapediver/viewer.settings - npm Package Compare versions

Comparing version 0.6.0 to 1.0.0

dist/versions/v5/Converter.d.ts

12

dist/index.d.ts

@@ -36,2 +36,7 @@ import { IGlobalSettings } from "./interfaces/IGlobalSettings";

import { IPostProcessingEffectsArray as IPostProcessingEffectsArrayV4_1 } from "./versions/v4_0/IPostProcessingEffectSettings";
import { ISettings as ISettingsV5 } from "./versions/v5/ISettings";
import { Defaults as DefaultsV5 } from "./versions/v5/Defaults";
import { ICameraSettings as ICameraSettingsV5, ICameraControlsSettings as ICameraControlsSettingsV5, IOrthographicCameraSettings as IOrthographicCameraSettingsV5, IPerspectiveCameraSettings as IPerspectiveCameraSettingsV5 } from "./versions/v5/ICameraSettings";
import { IAmbientLightProperties as IAmbientLightPropertiesV5, IDirectionalLightProperties as IDirectionalLightPropertiesV5, IHemisphereLightProperties as IHemisphereLightPropertiesV5, ILightSceneSettings as ILightSceneSettingsV5, IPointLightProperties as IPointLightPropertiesV5, ISpotLightProperties as ISpotLightPropertiesV5 } from "./versions/v3/ILightSceneSettings";
import { IPostProcessingEffectsArray as IPostProcessingEffectsArrayV5 } from "./versions/v4_0/IPostProcessingEffectSettings";
export { ISettingsV1, DefaultsV1 };

@@ -46,8 +51,9 @@ export { ISettingsV2, DefaultsV2 };

export { ISettingsV4_1, DefaultsV4_1, ICameraSettingsV4_1, IOrthographicCameraSettingsV4_1, IPerspectiveCameraSettingsV4_1, IOrbitControlsSettingsV4_1, IOrthographicControlsSettingsV4_1, ILightSceneSettingsV4_1, IAmbientLightPropertiesV4_1, IDirectionalLightPropertiesV4_1, IHemisphereLightPropertiesV4_1, IPointLightPropertiesV4_1, ISpotLightPropertiesV4_1, IPostProcessingEffectsArrayV4_1 };
export { ISettingsV4_1 as ISettings, DefaultsV4_1 as Defaults, ICameraSettingsV4_1 as ICameraSettings, IOrthographicCameraSettingsV4_1 as IOrthographicCameraSettings, IPerspectiveCameraSettingsV4_1 as IPerspectiveCameraSettings, IOrbitControlsSettingsV4_1 as IOrbitControlsSettings, IOrthographicControlsSettingsV4_1 as IOrthographicControlsSettings, ILightSceneSettingsV4_1 as ILightSceneSettings, IAmbientLightPropertiesV4_1 as IAmbientLightProperties, IDirectionalLightPropertiesV4_1 as IDirectionalLightProperties, IHemisphereLightPropertiesV4_1 as IHemisphereLightProperties, IPointLightPropertiesV4_1 as IPointLightProperties, ISpotLightPropertiesV4_1 as ISpotLightProperties, IPostProcessingEffectsArrayV4_1 as IPostProcessingEffectsArray };
export declare type versions = '1.0' | '2.0' | '3.0' | '3.1' | '3.2' | '3.3' | '3.4' | '4.0' | '4.1';
export { ISettingsV5, DefaultsV5, ICameraSettingsV5, IOrthographicCameraSettingsV5, IPerspectiveCameraSettingsV5, ICameraControlsSettingsV5, ILightSceneSettingsV5, IAmbientLightPropertiesV5, IDirectionalLightPropertiesV5, IHemisphereLightPropertiesV5, IPointLightPropertiesV5, ISpotLightPropertiesV5, IPostProcessingEffectsArrayV5 };
export { ISettingsV5 as ISettings, DefaultsV5 as Defaults, ICameraSettingsV5 as ICameraSettings, IOrthographicCameraSettingsV5 as IOrthographicCameraSettings, IPerspectiveCameraSettingsV5 as IPerspectiveCameraSettings, ICameraControlsSettingsV5 as ICameraControlsSettings, ILightSceneSettingsV5 as ILightSceneSettings, IAmbientLightPropertiesV5 as IAmbientLightProperties, IDirectionalLightPropertiesV5 as IDirectionalLightProperties, IHemisphereLightPropertiesV5 as IHemisphereLightProperties, IPointLightPropertiesV5 as IPointLightProperties, ISpotLightPropertiesV5 as ISpotLightProperties, IPostProcessingEffectsArrayV5 as IPostProcessingEffectsArray };
export declare type versions = '1.0' | '2.0' | '3.0' | '3.1' | '3.2' | '3.3' | '3.4' | '4.0' | '4.1' | '5.0';
export declare const convert: (settings: any, targetVersion: versions) => IGlobalSettings;
export declare const validate: (settings: any, targetVersion?: versions | undefined) => void;
export declare const evaluateSettingsVersion: (viewerVersion?: string | undefined) => versions;
export declare const latestVersion = "4.1";
export declare const latestVersion = "5.0";
//# sourceMappingURL=index.d.ts.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.latestVersion = exports.evaluateSettingsVersion = exports.validate = exports.convert = exports.Defaults = exports.DefaultsV4_1 = exports.DefaultsV4_0 = exports.DefaultsV3_4 = exports.DefaultsV3_3 = exports.DefaultsV3_2 = exports.DefaultsV3_1 = exports.DefaultsV3 = exports.DefaultsV2 = exports.DefaultsV1 = void 0;
exports.latestVersion = exports.evaluateSettingsVersion = exports.validate = exports.convert = exports.Defaults = exports.DefaultsV5 = exports.DefaultsV4_1 = exports.DefaultsV4_0 = exports.DefaultsV3_4 = exports.DefaultsV3_3 = exports.DefaultsV3_2 = exports.DefaultsV3_1 = exports.DefaultsV3 = exports.DefaultsV2 = exports.DefaultsV1 = void 0;
const Defaults_1 = require("./versions/v1/Defaults");

@@ -37,5 +37,9 @@ Object.defineProperty(exports, "DefaultsV1", { enumerable: true, get: function () { return Defaults_1.Defaults; } });

Object.defineProperty(exports, "DefaultsV4_1", { enumerable: true, get: function () { return Defaults_9.Defaults; } });
Object.defineProperty(exports, "Defaults", { enumerable: true, get: function () { return Defaults_9.Defaults; } });
const Validator_9 = require("./versions/v4_1/Validator");
const Converter_8 = require("./versions/v4_1/Converter");
const Defaults_10 = require("./versions/v5/Defaults");
Object.defineProperty(exports, "DefaultsV5", { enumerable: true, get: function () { return Defaults_10.Defaults; } });
Object.defineProperty(exports, "Defaults", { enumerable: true, get: function () { return Defaults_10.Defaults; } });
const Validator_10 = require("./versions/v5/Validator");
const Converter_9 = require("./versions/v5/Converter");
let settingsUtilities = [];

@@ -105,2 +109,9 @@ settingsUtilities.push({

});
settingsUtilities.push({
version: '5.0',
defaults: Defaults_10.Defaults,
convertToPrevious: Converter_9.convertToPrevious,
convertFromPrevious: Converter_9.convertFromPrevious,
validate: Validator_10.validate
});
const convert = (settings, targetVersion) => {

@@ -168,3 +179,6 @@ const original_version = settings.settings_version || '1.0';

.map(match => parseInt(match));
if ((upgradeVersions[1] === 2 && upgradeVersions[2] >= 11) || upgradeVersions[1] > 2) {
if (upgradeVersions[1] >= 3) {
return '5.0';
}
else if ((upgradeVersions[1] === 2 && upgradeVersions[2] >= 11) || upgradeVersions[1] > 2) {
return '4.1';

@@ -194,3 +208,3 @@ }

exports.evaluateSettingsVersion = evaluateSettingsVersion;
exports.latestVersion = '4.1';
exports.latestVersion = '5.0';
//# sourceMappingURL=index.js.map
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.validate = void 0;
const joi_1 = __importDefault(require("joi"));
const lightSchema = joi_1.default.object({
id: joi_1.default.string().optional(),
name: joi_1.default.string().optional(),
type: joi_1.default.string().optional(),
properties: joi_1.default.object({
color: joi_1.default.alternatives([joi_1.default.number().unsafe(), joi_1.default.string()]).optional(),
direction: joi_1.default.object({ x: joi_1.default.number().unsafe(), y: joi_1.default.number().unsafe(), z: joi_1.default.number().unsafe() }).optional(),
position: joi_1.default.object({ x: joi_1.default.number().unsafe(), y: joi_1.default.number().unsafe(), z: joi_1.default.number().unsafe() }).optional(),
target: joi_1.default.object({ x: joi_1.default.number().unsafe(), y: joi_1.default.number().unsafe(), z: joi_1.default.number().unsafe() }).optional(),
castShadow: joi_1.default.boolean().optional(),
skyColor: joi_1.default.alternatives([joi_1.default.number().unsafe(), joi_1.default.string()]).optional(),
groundColor: joi_1.default.alternatives([joi_1.default.number().unsafe(), joi_1.default.string()]).optional(),
intensity: joi_1.default.number().unsafe().optional(),
distance: joi_1.default.number().unsafe().optional(),
angle: joi_1.default.number().unsafe().optional(),
penumbra: joi_1.default.number().unsafe().optional(),
decay: joi_1.default.number().unsafe().optional(),
shadowMapResolution: joi_1.default.number().unsafe().optional(),
shadowMapBias: joi_1.default.number().unsafe().optional()
const zod_1 = require("zod");
const lightSchema = zod_1.z.object({
id: zod_1.z.string().optional(),
name: zod_1.z.string().optional(),
type: zod_1.z.string().optional(),
properties: zod_1.z.object({
color: zod_1.z.union([zod_1.z.number(), zod_1.z.string()]).optional(),
direction: zod_1.z.object({ x: zod_1.z.number(), y: zod_1.z.number(), z: zod_1.z.number() }).optional(),
position: zod_1.z.object({ x: zod_1.z.number(), y: zod_1.z.number(), z: zod_1.z.number() }).optional(),
target: zod_1.z.object({ x: zod_1.z.number(), y: zod_1.z.number(), z: zod_1.z.number() }).optional(),
castShadow: zod_1.z.boolean().optional(),
skyColor: zod_1.z.union([zod_1.z.number(), zod_1.z.string()]).optional(),
groundColor: zod_1.z.union([zod_1.z.number(), zod_1.z.string()]).optional(),
intensity: zod_1.z.number().optional(),
distance: zod_1.z.number().optional(),
angle: zod_1.z.number().optional(),
penumbra: zod_1.z.number().optional(),
decay: zod_1.z.number().optional(),
shadowMapResolution: zod_1.z.number().optional(),
shadowMapBias: zod_1.z.number().optional()
})
}).optional();
const lightsSchema = joi_1.default.object().pattern(/^/, [lightSchema]);
const lightScenesSchema = joi_1.default.object().pattern(/^/, [
joi_1.default.object({
id: joi_1.default.string(),
name: joi_1.default.string().optional(),
lights: lightsSchema.schema()
})
]);
const schema = joi_1.default.object({
build_date: joi_1.default.string().allow('').optional(),
build_version: joi_1.default.string().allow('').optional(),
settings_version: joi_1.default.string().optional(),
ambientOcclusion: joi_1.default.boolean().optional(),
autoRotateSpeed: joi_1.default.number().unsafe().optional(),
backgroundColor: joi_1.default.string().optional(),
bumpAmplitude: joi_1.default.number().unsafe().optional(),
camera: joi_1.default.object({ position: joi_1.default.object({ x: joi_1.default.number().unsafe().optional(), y: joi_1.default.number().unsafe().optional(), z: joi_1.default.number().unsafe().optional() }).optional(), target: joi_1.default.object({ x: joi_1.default.number().unsafe().optional(), y: joi_1.default.number().unsafe().optional(), z: joi_1.default.number().unsafe().optional() }).optional() }).optional(),
cameraAutoAdjust: joi_1.default.boolean().optional(),
cameraMovementDuration: joi_1.default.number().unsafe().optional(),
cameraOrtho: joi_1.default.object({ position: joi_1.default.object({ x: joi_1.default.number().unsafe().optional(), y: joi_1.default.number().unsafe().optional(), z: joi_1.default.number().unsafe().optional() }).optional(), target: joi_1.default.object({ x: joi_1.default.number().unsafe().optional(), y: joi_1.default.number().unsafe().optional(), z: joi_1.default.number().unsafe().optional() }).optional() }).optional(),
cameraRevertAtMouseUp: joi_1.default.boolean().optional(),
clearAlpha: joi_1.default.number().unsafe().optional(),
clearColor: joi_1.default.string().optional(),
commitParameters: joi_1.default.boolean().optional(),
controlDamping: joi_1.default.number().unsafe().optional(),
controlNames: joi_1.default.object().pattern(/.*/, [joi_1.default.string()]).optional(),
controlOrder: joi_1.default.array().items(joi_1.default.string()).optional(),
defaultMaterialColor: joi_1.default.alternatives([joi_1.default.string(), joi_1.default.array().items(joi_1.default.number().unsafe())]).optional(),
disablePan: joi_1.default.boolean().optional(),
disableZoom: joi_1.default.boolean().optional(),
enableAutoRotation: joi_1.default.boolean().optional(),
enableRotation: joi_1.default.boolean().optional(),
environmentMap: joi_1.default.alternatives([joi_1.default.string(), joi_1.default.array().items(joi_1.default.string())]).optional(),
environmentMapResolution: joi_1.default.string().optional(),
fov: joi_1.default.number().unsafe().positive().optional(),
lightScene: joi_1.default.string().optional(),
lightScenes: lightScenesSchema.allow(null).optional(),
panSpeed: joi_1.default.number().unsafe().optional(),
parametersHidden: joi_1.default.array().items(joi_1.default.string()).optional(),
pointSize: joi_1.default.number().unsafe().optional(),
revertAtMouseUpDuration: joi_1.default.number().unsafe().optional(),
rotateSpeed: joi_1.default.number().unsafe().optional(),
showEnvironmentMap: joi_1.default.boolean().optional(),
showGrid: joi_1.default.boolean().optional(),
showGroundPlane: joi_1.default.boolean().optional(),
showShadows: joi_1.default.boolean().optional(),
topView: joi_1.default.boolean().optional(),
zoomExtentFactor: joi_1.default.number().unsafe().optional(),
zoomSpeed: joi_1.default.number().unsafe().optional(),
}).options({ allowUnknown: true });
const lightsSchema = zod_1.z.record(lightSchema);
const lightScenesSchema = zod_1.z.record(zod_1.z.object({
id: zod_1.z.string(),
name: zod_1.z.string().optional(),
lights: lightsSchema
}));
const schema = zod_1.z.object({
build_date: zod_1.z.string().optional(),
build_version: zod_1.z.string().optional(),
settings_version: zod_1.z.string().optional(),
ambientOcclusion: zod_1.z.boolean().optional(),
autoRotateSpeed: zod_1.z.number().optional(),
backgroundColor: zod_1.z.string().optional(),
bumpAmplitude: zod_1.z.number().optional(),
camera: zod_1.z.object({ position: zod_1.z.object({ x: zod_1.z.number().optional(), y: zod_1.z.number().optional(), z: zod_1.z.number().optional() }).optional(), target: zod_1.z.object({ x: zod_1.z.number().optional(), y: zod_1.z.number().optional(), z: zod_1.z.number().optional() }).optional() }).optional(),
cameraAutoAdjust: zod_1.z.boolean().optional(),
cameraMovementDuration: zod_1.z.number().optional(),
cameraOrtho: zod_1.z.object({ position: zod_1.z.object({ x: zod_1.z.number().optional(), y: zod_1.z.number().optional(), z: zod_1.z.number().optional() }).optional(), target: zod_1.z.object({ x: zod_1.z.number().optional(), y: zod_1.z.number().optional(), z: zod_1.z.number().optional() }).optional() }).optional(),
cameraRevertAtMouseUp: zod_1.z.boolean().optional(),
clearAlpha: zod_1.z.number().optional(),
clearColor: zod_1.z.string().optional(),
commitParameters: zod_1.z.boolean().optional(),
controlDamping: zod_1.z.number().optional(),
controlNames: zod_1.z.record(zod_1.z.string()).optional(),
controlOrder: zod_1.z.string().array().optional(),
defaultMaterialColor: zod_1.z.union([zod_1.z.string(), zod_1.z.number().array().optional()]),
disablePan: zod_1.z.boolean().optional(),
disableZoom: zod_1.z.boolean().optional(),
enableAutoRotation: zod_1.z.boolean().optional(),
enableRotation: zod_1.z.boolean().optional(),
environmentMap: zod_1.z.union([zod_1.z.string(), zod_1.z.string().array().optional()]),
environmentMapResolution: zod_1.z.string().optional(),
fov: zod_1.z.number().positive().optional(),
lightScene: zod_1.z.string().optional(),
lightScenes: lightScenesSchema.nullable().optional(),
panSpeed: zod_1.z.number().optional(),
parametersHidden: zod_1.z.string().array().optional(),
pointSize: zod_1.z.number().optional(),
revertAtMouseUpDuration: zod_1.z.number().optional(),
rotateSpeed: zod_1.z.number().optional(),
showEnvironmentMap: zod_1.z.boolean().optional(),
showGrid: zod_1.z.boolean().optional(),
showGroundPlane: zod_1.z.boolean().optional(),
showShadows: zod_1.z.boolean().optional(),
topView: zod_1.z.boolean().optional(),
zoomExtentFactor: zod_1.z.number().optional(),
zoomSpeed: zod_1.z.number().optional(),
}).passthrough();
const validate = (s) => {
const result = joi_1.default.attempt(s, schema);
s = result.value;
const result = schema.parse(s);
s = result;
};
exports.validate = validate;
//# sourceMappingURL=Validator.js.map
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.validate = void 0;
const joi_1 = __importDefault(require("joi"));
const lightSchema = joi_1.default.object({
id: joi_1.default.string(),
name: joi_1.default.string().optional(),
type: joi_1.default.string(),
order: joi_1.default.number().unsafe().optional(),
properties: {
color: joi_1.default.alternatives([joi_1.default.number().unsafe(), joi_1.default.string()]).optional(),
direction: joi_1.default.object({ x: joi_1.default.number().unsafe(), y: joi_1.default.number().unsafe(), z: joi_1.default.number().unsafe() }).optional(),
position: joi_1.default.object({ x: joi_1.default.number().unsafe(), y: joi_1.default.number().unsafe(), z: joi_1.default.number().unsafe() }).optional(),
target: joi_1.default.object({ x: joi_1.default.number().unsafe(), y: joi_1.default.number().unsafe(), z: joi_1.default.number().unsafe() }).optional(),
castShadow: joi_1.default.boolean().optional(),
skyColor: joi_1.default.alternatives([joi_1.default.number().unsafe(), joi_1.default.string()]).optional(),
groundColor: joi_1.default.alternatives([joi_1.default.number().unsafe(), joi_1.default.string()]).optional(),
intensity: joi_1.default.number().unsafe().optional(),
distance: joi_1.default.number().unsafe().optional(),
angle: joi_1.default.number().unsafe().optional(),
penumbra: joi_1.default.number().unsafe().optional(),
decay: joi_1.default.number().unsafe().optional(),
shadowMapResolution: joi_1.default.number().unsafe().optional(),
shadowMapBias: joi_1.default.number().unsafe().optional()
}
const zod_1 = require("zod");
const lightSchema = zod_1.z.object({
id: zod_1.z.string(),
name: zod_1.z.string().optional(),
type: zod_1.z.string(),
order: zod_1.z.number().optional(),
properties: zod_1.z.object({
color: zod_1.z.union([zod_1.z.number(), zod_1.z.string()]).optional(),
direction: zod_1.z.object({ x: zod_1.z.number(), y: zod_1.z.number(), z: zod_1.z.number() }).optional(),
position: zod_1.z.object({ x: zod_1.z.number(), y: zod_1.z.number(), z: zod_1.z.number() }).optional(),
target: zod_1.z.object({ x: zod_1.z.number(), y: zod_1.z.number(), z: zod_1.z.number() }).optional(),
castShadow: zod_1.z.boolean().optional(),
skyColor: zod_1.z.union([zod_1.z.number(), zod_1.z.string()]).optional(),
groundColor: zod_1.z.union([zod_1.z.number(), zod_1.z.string()]).optional(),
intensity: zod_1.z.number().optional(),
distance: zod_1.z.number().optional(),
angle: zod_1.z.number().optional(),
penumbra: zod_1.z.number().optional(),
decay: zod_1.z.number().optional(),
shadowMapResolution: zod_1.z.number().optional(),
shadowMapBias: zod_1.z.number().optional()
})
});
const lightScenesSchema = joi_1.default.object().pattern(/^/, [
joi_1.default.object({
id: joi_1.default.string(),
name: joi_1.default.string().optional(),
lights: joi_1.default.object().pattern(/^/, [lightSchema])
})
]);
const schema = joi_1.default.object({
build_date: joi_1.default.string().allow('').optional(),
build_version: joi_1.default.string().allow('').optional(),
settings_version: joi_1.default.string(),
ar: joi_1.default.object({
enableCameraSync: joi_1.default.boolean().optional(),
enableCameraSyncInitial: joi_1.default.boolean().optional(),
enableLightingEstimation: joi_1.default.boolean().optional(),
enableTouchControls: joi_1.default.boolean().optional(),
enableTouchControlRotation: joi_1.default.boolean().optional(),
enableAutomaticPlacement: joi_1.default.boolean().optional(),
defaultHitTestType: joi_1.default.string().optional(),
const lightScenesSchema = zod_1.z.record(zod_1.z.object({
id: zod_1.z.string(),
name: zod_1.z.string().optional(),
lights: zod_1.z.record(lightSchema)
}));
const schema = zod_1.z.object({
build_date: zod_1.z.string().optional(),
build_version: zod_1.z.string().optional(),
settings_version: zod_1.z.string(),
ar: zod_1.z.object({
enableCameraSync: zod_1.z.boolean().optional(),
enableCameraSyncInitial: zod_1.z.boolean().optional(),
enableLightingEstimation: zod_1.z.boolean().optional(),
enableTouchControls: zod_1.z.boolean().optional(),
enableTouchControlRotation: zod_1.z.boolean().optional(),
enableAutomaticPlacement: zod_1.z.boolean().optional(),
defaultHitTestType: zod_1.z.string().optional(),
}).optional(),
defaultMaterial: {
bumpAmplitude: joi_1.default.number().unsafe().optional(),
color: joi_1.default.alternatives([joi_1.default.string(), joi_1.default.array().items(joi_1.default.number().unsafe())]).optional(),
metalness: joi_1.default.number().unsafe().optional(),
roughness: joi_1.default.number().unsafe().optional(),
},
parameters: joi_1.default.object({
controlOrder: joi_1.default.array().items(joi_1.default.string()).optional(),
controlNames: joi_1.default.object().pattern(/.*/, [joi_1.default.string()]).optional(),
parametersHidden: joi_1.default.array().items(joi_1.default.string()).optional(),
defaultMaterial: zod_1.z.object({
bumpAmplitude: zod_1.z.number().optional(),
color: zod_1.z.union([zod_1.z.string(), zod_1.z.number().array()]).optional(),
metalness: zod_1.z.number().optional(),
roughness: zod_1.z.number().optional(),
}),
parameters: zod_1.z.object({
controlOrder: zod_1.z.string().array().optional(),
controlNames: zod_1.z.record(zod_1.z.string()).optional(),
parametersHidden: zod_1.z.string().array().optional(),
}).optional(),
viewer: {
blurSceneWhenBusy: joi_1.default.boolean(),
ignoreSuperseded: joi_1.default.boolean().optional(),
loggingLevel: joi_1.default.number().unsafe().optional(),
messageLoggingLevel: joi_1.default.number().unsafe().optional(),
viewerRuntimeId: joi_1.default.string().allow('').optional(),
hasRestoredSettings: joi_1.default.boolean().optional(),
useModelSettings: joi_1.default.boolean().optional(),
showMessages: joi_1.default.boolean().optional(),
commitSettings: joi_1.default.boolean(),
commitParameters: joi_1.default.boolean(),
scene: {
show: joi_1.default.boolean().optional(),
showSceneTransition: joi_1.default.string().optional(),
duration: joi_1.default.number().unsafe().optional(),
fullscreen: joi_1.default.boolean().optional(),
gridVisibility: joi_1.default.boolean(),
groundPlaneReflectionThreshold: joi_1.default.number().unsafe().optional(),
groundPlaneReflectionVisibility: joi_1.default.boolean().optional(),
groundPlaneVisibility: joi_1.default.boolean(),
camera: {
autoAdjust: joi_1.default.boolean(),
cameraMovementDuration: joi_1.default.number().unsafe(),
cameraTypes: {
perspective: {
default: { position: { x: joi_1.default.number().unsafe(), y: joi_1.default.number().unsafe(), z: joi_1.default.number().unsafe() }, target: { x: joi_1.default.number().unsafe(), y: joi_1.default.number().unsafe(), z: joi_1.default.number().unsafe() } },
fov: joi_1.default.number().unsafe(),
controls: joi_1.default.number().unsafe().optional(),
},
orthographic: {
default: { position: { x: joi_1.default.number().unsafe(), y: joi_1.default.number().unsafe(), z: joi_1.default.number().unsafe() }, target: { x: joi_1.default.number().unsafe(), y: joi_1.default.number().unsafe(), z: joi_1.default.number().unsafe() } },
},
active: joi_1.default.number().unsafe()
},
controls: {
orbit: {
autoRotationSpeed: joi_1.default.number().unsafe(),
damping: joi_1.default.number().unsafe(),
enableAutoRotation: joi_1.default.boolean(),
enableKeyPan: joi_1.default.boolean(),
enablePan: joi_1.default.boolean(),
enableRotation: joi_1.default.boolean(),
enableZoom: joi_1.default.boolean(),
input: { keys: { up: joi_1.default.number().unsafe(), down: joi_1.default.number().unsafe(), left: joi_1.default.number().unsafe(), right: joi_1.default.number().unsafe() }, mouse: { rotate: joi_1.default.number().unsafe(), zoom: joi_1.default.number().unsafe(), pan: joi_1.default.number().unsafe() }, touch: { rotate: joi_1.default.number().unsafe(), zoom: joi_1.default.number().unsafe(), pan: joi_1.default.number().unsafe() }, },
keyPanSpeed: joi_1.default.number().unsafe(),
movementSmoothness: joi_1.default.number().unsafe(),
restrictions: {
position: joi_1.default.object({
cube: joi_1.default.object({ min: { x: joi_1.default.number().unsafe().allow(-Infinity).allow(null), y: joi_1.default.number().unsafe().allow(-Infinity).allow(null), z: joi_1.default.number().unsafe().allow(-Infinity).allow(null) }, max: { x: joi_1.default.number().unsafe().allow(Infinity).allow(null), y: joi_1.default.number().unsafe().allow(Infinity).allow(null), z: joi_1.default.number().unsafe().allow(Infinity).allow(null) } }).optional(),
sphere: joi_1.default.object({ center: { x: joi_1.default.number().unsafe(), y: joi_1.default.number().unsafe(), z: joi_1.default.number().unsafe() }, radius: joi_1.default.number().unsafe().allow(Infinity).allow(null) }).optional(),
viewer: zod_1.z.object({
blurSceneWhenBusy: zod_1.z.boolean(),
ignoreSuperseded: zod_1.z.boolean().optional(),
loggingLevel: zod_1.z.number().optional(),
messageLoggingLevel: zod_1.z.number().optional(),
viewerRuntimeId: zod_1.z.string().optional(),
hasRestoredSettings: zod_1.z.boolean().optional(),
useModelSettings: zod_1.z.boolean().optional(),
showMessages: zod_1.z.boolean().optional(),
commitSettings: zod_1.z.boolean(),
commitParameters: zod_1.z.boolean(),
scene: zod_1.z.object({
show: zod_1.z.boolean().optional(),
showSceneTransition: zod_1.z.string().optional(),
duration: zod_1.z.number().optional(),
fullscreen: zod_1.z.boolean().optional(),
gridVisibility: zod_1.z.boolean(),
groundPlaneReflectionThreshold: zod_1.z.number().optional(),
groundPlaneReflectionVisibility: zod_1.z.boolean().optional(),
groundPlaneVisibility: zod_1.z.boolean(),
camera: zod_1.z.object({
autoAdjust: zod_1.z.boolean(),
cameraMovementDuration: zod_1.z.number(),
cameraTypes: zod_1.z.object({
perspective: zod_1.z.object({
default: zod_1.z.object({ position: zod_1.z.object({ x: zod_1.z.number(), y: zod_1.z.number(), z: zod_1.z.number() }), target: zod_1.z.object({ x: zod_1.z.number(), y: zod_1.z.number(), z: zod_1.z.number() }) }),
fov: zod_1.z.number(),
controls: zod_1.z.number().optional(),
}),
orthographic: zod_1.z.object({
default: zod_1.z.object({ position: zod_1.z.object({ x: zod_1.z.number(), y: zod_1.z.number(), z: zod_1.z.number() }), target: zod_1.z.object({ x: zod_1.z.number(), y: zod_1.z.number(), z: zod_1.z.number() }) }),
}),
active: zod_1.z.number()
}),
controls: zod_1.z.object({
orbit: zod_1.z.object({
autoRotationSpeed: zod_1.z.number(),
damping: zod_1.z.number(),
enableAutoRotation: zod_1.z.boolean(),
enableKeyPan: zod_1.z.boolean(),
enablePan: zod_1.z.boolean(),
enableRotation: zod_1.z.boolean(),
enableZoom: zod_1.z.boolean(),
input: zod_1.z.object({ keys: zod_1.z.object({ up: zod_1.z.number(), down: zod_1.z.number(), left: zod_1.z.number(), right: zod_1.z.number() }), mouse: zod_1.z.object({ rotate: zod_1.z.number(), zoom: zod_1.z.number(), pan: zod_1.z.number() }), touch: zod_1.z.object({ rotate: zod_1.z.number(), zoom: zod_1.z.number(), pan: zod_1.z.number() }), }),
keyPanSpeed: zod_1.z.number(),
movementSmoothness: zod_1.z.number(),
restrictions: zod_1.z.object({
position: zod_1.z.object({
cube: zod_1.z.object({ min: zod_1.z.object({ x: zod_1.z.number().nullable(), y: zod_1.z.number().nullable(), z: zod_1.z.number().nullable() }), max: zod_1.z.object({ x: zod_1.z.number().nullable(), y: zod_1.z.number().nullable(), z: zod_1.z.number().nullable() }) }).optional(),
sphere: zod_1.z.object({ center: zod_1.z.object({ x: zod_1.z.number(), y: zod_1.z.number(), z: zod_1.z.number() }), radius: zod_1.z.number().nullable() }).optional(),
}).optional(),
target: joi_1.default.object({
cube: joi_1.default.object({ min: { x: joi_1.default.number().unsafe().allow(-Infinity).allow(null), y: joi_1.default.number().unsafe().allow(-Infinity).allow(null), z: joi_1.default.number().unsafe().allow(-Infinity).allow(null) }, max: { x: joi_1.default.number().unsafe().allow(Infinity).allow(null), y: joi_1.default.number().unsafe().allow(Infinity).allow(null), z: joi_1.default.number().unsafe().allow(Infinity).allow(null) } }).optional(),
sphere: joi_1.default.object({ center: { x: joi_1.default.number().unsafe(), y: joi_1.default.number().unsafe(), z: joi_1.default.number().unsafe() }, radius: joi_1.default.number().unsafe().allow(Infinity).allow(null) }).optional(),
target: zod_1.z.object({
cube: zod_1.z.object({ min: zod_1.z.object({ x: zod_1.z.number().nullable(), y: zod_1.z.number().nullable(), z: zod_1.z.number().nullable() }), max: zod_1.z.object({ x: zod_1.z.number().nullable(), y: zod_1.z.number().nullable(), z: zod_1.z.number().nullable() }) }).optional(),
sphere: zod_1.z.object({ center: zod_1.z.object({ x: zod_1.z.number(), y: zod_1.z.number(), z: zod_1.z.number() }), radius: zod_1.z.number().nullable() }).optional(),
}).optional(),
rotation: joi_1.default.object({ minPolarAngle: joi_1.default.number().unsafe(), maxPolarAngle: joi_1.default.number().unsafe(), minAzimuthAngle: joi_1.default.number().unsafe().allow(-Infinity).allow(null), maxAzimuthAngle: joi_1.default.number().unsafe().allow(Infinity).allow(null) }).optional(),
zoom: joi_1.default.object({ minDistance: joi_1.default.number().unsafe(), maxDistance: joi_1.default.number().unsafe().allow(Infinity).allow(null) }).optional(),
},
rotationSpeed: joi_1.default.number().unsafe(),
panSpeed: joi_1.default.number().unsafe(),
zoomSpeed: joi_1.default.number().unsafe(),
},
fps: {},
orthographic: {
damping: joi_1.default.number().unsafe(),
enableKeyPan: joi_1.default.boolean(),
enablePan: joi_1.default.boolean(),
enableZoom: joi_1.default.boolean(),
input: { keys: { up: joi_1.default.number().unsafe(), down: joi_1.default.number().unsafe(), left: joi_1.default.number().unsafe(), right: joi_1.default.number().unsafe() }, mouse: { rotate: joi_1.default.number().unsafe(), zoom: joi_1.default.number().unsafe(), pan: joi_1.default.number().unsafe() }, touch: { rotate: joi_1.default.number().unsafe(), zoom: joi_1.default.number().unsafe(), pan: joi_1.default.number().unsafe() }, },
keyPanSpeed: joi_1.default.number().unsafe(),
movementSmoothness: joi_1.default.number().unsafe(),
panSpeed: joi_1.default.number().unsafe(),
zoomSpeed: joi_1.default.number().unsafe(),
}
},
enableCameraControls: joi_1.default.boolean(),
revertAtMouseUp: joi_1.default.boolean(),
revertAtMouseUpDuration: joi_1.default.number().unsafe(),
zoomExtentsFactor: joi_1.default.number().unsafe().positive(),
},
lights: {
helper: joi_1.default.boolean().optional(),
lightScene: joi_1.default.string().allow(''),
lightScenes: lightScenesSchema.allow(null)
},
material: {
environmentMap: joi_1.default.alternatives([joi_1.default.string().allow(''), joi_1.default.array().items(joi_1.default.string())]),
environmentMapAsBackground: joi_1.default.boolean(),
environmentMapResolution: joi_1.default.string().valid('256', '512', '1024', '2048')
},
render: {
ambientOcclusion: joi_1.default.boolean(),
beautyRenderDelay: joi_1.default.number().unsafe(),
beautyRenderBlendingDuration: joi_1.default.number().unsafe().optional(),
clearAlpha: joi_1.default.number().unsafe(),
clearColor: joi_1.default.string(),
pointSize: joi_1.default.number().unsafe(),
shadows: joi_1.default.boolean(),
sao: {
samples: joi_1.default.number().unsafe().positive().optional(),
kernelRadius: joi_1.default.number().unsafe().positive().optional(),
intensity: joi_1.default.number().unsafe().positive().optional(),
standardDev: joi_1.default.number().unsafe().optional(),
}
},
},
},
}).options({ presence: 'required' });
rotation: zod_1.z.object({ minPolarAngle: zod_1.z.number(), maxPolarAngle: zod_1.z.number(), minAzimuthAngle: zod_1.z.number().nullable(), maxAzimuthAngle: zod_1.z.number().nullable() }).optional(),
zoom: zod_1.z.object({ minDistance: zod_1.z.number(), maxDistance: zod_1.z.number().nullable() }).optional(),
}),
rotationSpeed: zod_1.z.number(),
panSpeed: zod_1.z.number(),
zoomSpeed: zod_1.z.number(),
}),
fps: zod_1.z.object({}),
orthographic: zod_1.z.object({
damping: zod_1.z.number(),
enableKeyPan: zod_1.z.boolean(),
enablePan: zod_1.z.boolean(),
enableZoom: zod_1.z.boolean(),
input: zod_1.z.object({ keys: zod_1.z.object({ up: zod_1.z.number(), down: zod_1.z.number(), left: zod_1.z.number(), right: zod_1.z.number() }), mouse: zod_1.z.object({ rotate: zod_1.z.number(), zoom: zod_1.z.number(), pan: zod_1.z.number() }), touch: zod_1.z.object({ rotate: zod_1.z.number(), zoom: zod_1.z.number(), pan: zod_1.z.number() }), }),
keyPanSpeed: zod_1.z.number(),
movementSmoothness: zod_1.z.number(),
panSpeed: zod_1.z.number(),
zoomSpeed: zod_1.z.number(),
})
}),
enableCameraControls: zod_1.z.boolean(),
revertAtMouseUp: zod_1.z.boolean(),
revertAtMouseUpDuration: zod_1.z.number(),
zoomExtentsFactor: zod_1.z.number().positive(),
}),
lights: zod_1.z.object({
helper: zod_1.z.boolean().optional(),
lightScene: zod_1.z.string(),
lightScenes: lightScenesSchema.nullable()
}),
material: zod_1.z.object({
environmentMap: zod_1.z.union([zod_1.z.string(), zod_1.z.string().array()]),
environmentMapAsBackground: zod_1.z.boolean(),
environmentMapResolution: zod_1.z.enum(['256', '512', '1024', '2048'])
}),
render: zod_1.z.object({
ambientOcclusion: zod_1.z.boolean(),
beautyRenderDelay: zod_1.z.number(),
beautyRenderBlendingDuration: zod_1.z.number().optional(),
clearAlpha: zod_1.z.number(),
clearColor: zod_1.z.string(),
pointSize: zod_1.z.number(),
shadows: zod_1.z.boolean(),
sao: zod_1.z.object({
samples: zod_1.z.number().positive().optional(),
kernelRadius: zod_1.z.number().positive().optional(),
intensity: zod_1.z.number().positive().optional(),
standardDev: zod_1.z.number().optional(),
})
}),
}),
}),
}).strict().required();
const validate = (s) => {
const result = joi_1.default.attempt(s, schema);
s = result.value;
const result = schema.parse(s);
s = result;
};
exports.validate = validate;
//# sourceMappingURL=Validator.js.map
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.validate = void 0;
const joi_1 = __importDefault(require("joi"));
const orbitControlsSchema = joi_1.default.object({
autoRotationSpeed: joi_1.default.number().unsafe(),
damping: joi_1.default.number().unsafe(),
enableAutoRotation: joi_1.default.boolean(),
enableKeyPan: joi_1.default.boolean(),
enablePan: joi_1.default.boolean(),
enableRotation: joi_1.default.boolean(),
enableZoom: joi_1.default.boolean(),
input: { keys: { up: joi_1.default.number().unsafe(), down: joi_1.default.number().unsafe(), left: joi_1.default.number().unsafe(), right: joi_1.default.number().unsafe() }, mouse: { rotate: joi_1.default.number().unsafe(), zoom: joi_1.default.number().unsafe(), pan: joi_1.default.number().unsafe() }, touch: { rotate: joi_1.default.number().unsafe(), zoom: joi_1.default.number().unsafe(), pan: joi_1.default.number().unsafe() }, },
keyPanSpeed: joi_1.default.number().unsafe(),
movementSmoothness: joi_1.default.number().unsafe(),
restrictions: joi_1.default.object({
position: {
cube: { min: { x: joi_1.default.number().unsafe().allow(-Infinity).allow(null), y: joi_1.default.number().unsafe().allow(-Infinity).allow(null), z: joi_1.default.number().unsafe().allow(-Infinity).allow(null) }, max: { x: joi_1.default.number().unsafe().allow(Infinity).allow(null), y: joi_1.default.number().unsafe().allow(Infinity).allow(null), z: joi_1.default.number().unsafe().allow(Infinity).allow(null) } },
sphere: { center: { x: joi_1.default.number().unsafe(), y: joi_1.default.number().unsafe(), z: joi_1.default.number().unsafe() }, radius: joi_1.default.number().unsafe().allow(Infinity).allow(null) },
},
target: {
cube: { min: { x: joi_1.default.number().unsafe().allow(-Infinity).allow(null), y: joi_1.default.number().unsafe().allow(-Infinity).allow(null), z: joi_1.default.number().unsafe().allow(-Infinity).allow(null) }, max: { x: joi_1.default.number().unsafe().allow(Infinity).allow(null), y: joi_1.default.number().unsafe().allow(Infinity).allow(null), z: joi_1.default.number().unsafe().allow(Infinity).allow(null) } },
sphere: { center: { x: joi_1.default.number().unsafe(), y: joi_1.default.number().unsafe(), z: joi_1.default.number().unsafe() }, radius: joi_1.default.number().unsafe().allow(Infinity).allow(null) },
},
rotation: { minPolarAngle: joi_1.default.number().unsafe(), maxPolarAngle: joi_1.default.number().unsafe(), minAzimuthAngle: joi_1.default.number().unsafe().allow(-Infinity).allow(null), maxAzimuthAngle: joi_1.default.number().unsafe().allow(Infinity).allow(null) },
zoom: { minDistance: joi_1.default.number().unsafe(), maxDistance: joi_1.default.number().unsafe().allow(Infinity).allow(null) },
const zod_1 = require("zod");
const orbitControlsSchema = zod_1.z.object({
autoRotationSpeed: zod_1.z.number(),
damping: zod_1.z.number(),
enableAutoRotation: zod_1.z.boolean(),
enableKeyPan: zod_1.z.boolean(),
enablePan: zod_1.z.boolean(),
enableRotation: zod_1.z.boolean(),
enableZoom: zod_1.z.boolean(),
input: zod_1.z.object({ keys: zod_1.z.object({ up: zod_1.z.number(), down: zod_1.z.number(), left: zod_1.z.number(), right: zod_1.z.number() }), mouse: zod_1.z.object({ rotate: zod_1.z.number(), zoom: zod_1.z.number(), pan: zod_1.z.number() }), touch: zod_1.z.object({ rotate: zod_1.z.number(), zoom: zod_1.z.number(), pan: zod_1.z.number() }), }),
keyPanSpeed: zod_1.z.number(),
movementSmoothness: zod_1.z.number(),
restrictions: zod_1.z.object({
position: zod_1.z.object({
cube: zod_1.z.object({ min: zod_1.z.object({ x: zod_1.z.number().nullable(), y: zod_1.z.number().nullable(), z: zod_1.z.number().nullable() }), max: zod_1.z.object({ x: zod_1.z.number().nullable(), y: zod_1.z.number().nullable(), z: zod_1.z.number().nullable() }) }),
sphere: zod_1.z.object({ center: zod_1.z.object({ x: zod_1.z.number(), y: zod_1.z.number(), z: zod_1.z.number() }), radius: zod_1.z.number().nullable() }),
}),
target: zod_1.z.object({
cube: zod_1.z.object({ min: zod_1.z.object({ x: zod_1.z.number().nullable(), y: zod_1.z.number().nullable(), z: zod_1.z.number().nullable() }), max: zod_1.z.object({ x: zod_1.z.number().nullable(), y: zod_1.z.number().nullable(), z: zod_1.z.number().nullable() }) }),
sphere: zod_1.z.object({ center: zod_1.z.object({ x: zod_1.z.number(), y: zod_1.z.number(), z: zod_1.z.number() }), radius: zod_1.z.number().nullable() }),
}),
rotation: zod_1.z.object({ minPolarAngle: zod_1.z.number(), maxPolarAngle: zod_1.z.number(), minAzimuthAngle: zod_1.z.number().nullable(), maxAzimuthAngle: zod_1.z.number().nullable() }),
zoom: zod_1.z.object({ minDistance: zod_1.z.number(), maxDistance: zod_1.z.number().nullable() }),
}),
rotationSpeed: joi_1.default.number().unsafe(),
panSpeed: joi_1.default.number().unsafe(),
zoomSpeed: joi_1.default.number().unsafe(),
rotationSpeed: zod_1.z.number(),
panSpeed: zod_1.z.number(),
zoomSpeed: zod_1.z.number(),
});
const orthographicControlsSchema = joi_1.default.object({
damping: joi_1.default.number().unsafe(),
enableKeyPan: joi_1.default.boolean(),
enablePan: joi_1.default.boolean(),
enableZoom: joi_1.default.boolean(),
input: { keys: { up: joi_1.default.number().unsafe(), down: joi_1.default.number().unsafe(), left: joi_1.default.number().unsafe(), right: joi_1.default.number().unsafe() }, mouse: { rotate: joi_1.default.number().unsafe(), zoom: joi_1.default.number().unsafe(), pan: joi_1.default.number().unsafe() }, touch: { rotate: joi_1.default.number().unsafe(), zoom: joi_1.default.number().unsafe(), pan: joi_1.default.number().unsafe() }, },
keyPanSpeed: joi_1.default.number().unsafe(),
movementSmoothness: joi_1.default.number().unsafe(),
panSpeed: joi_1.default.number().unsafe(),
zoomSpeed: joi_1.default.number().unsafe(),
const orthographicControlsSchema = zod_1.z.object({
damping: zod_1.z.number(),
enableKeyPan: zod_1.z.boolean(),
enablePan: zod_1.z.boolean(),
enableZoom: zod_1.z.boolean(),
input: zod_1.z.object({ keys: zod_1.z.object({ up: zod_1.z.number(), down: zod_1.z.number(), left: zod_1.z.number(), right: zod_1.z.number() }), mouse: zod_1.z.object({ rotate: zod_1.z.number(), zoom: zod_1.z.number(), pan: zod_1.z.number() }), touch: zod_1.z.object({ rotate: zod_1.z.number(), zoom: zod_1.z.number(), pan: zod_1.z.number() }), }),
keyPanSpeed: zod_1.z.number(),
movementSmoothness: zod_1.z.number(),
panSpeed: zod_1.z.number(),
zoomSpeed: zod_1.z.number(),
});
const orthographicCameraSchema = joi_1.default.object({
name: joi_1.default.string().optional(),
type: joi_1.default.string(),
autoAdjust: joi_1.default.boolean(),
cameraMovementDuration: joi_1.default.number().unsafe(),
const orthographicCameraSchema = zod_1.z.object({
name: zod_1.z.string().optional(),
type: zod_1.z.string(),
autoAdjust: zod_1.z.boolean(),
cameraMovementDuration: zod_1.z.number(),
controls: orthographicControlsSchema,
enableCameraControls: joi_1.default.boolean(),
position: { x: joi_1.default.number().unsafe().allow(null), y: joi_1.default.number().unsafe().allow(null), z: joi_1.default.number().unsafe().allow(null) },
revertAtMouseUp: joi_1.default.boolean(),
revertAtMouseUpDuration: joi_1.default.number().unsafe(),
target: { x: joi_1.default.number().unsafe().allow(null), y: joi_1.default.number().unsafe().allow(null), z: joi_1.default.number().unsafe().allow(null) },
zoomExtentsFactor: joi_1.default.number().unsafe().positive(),
enableCameraControls: zod_1.z.boolean(),
position: zod_1.z.object({ x: zod_1.z.number().nullable(), y: zod_1.z.number().nullable(), z: zod_1.z.number().nullable() }),
revertAtMouseUp: zod_1.z.boolean(),
revertAtMouseUpDuration: zod_1.z.number(),
target: zod_1.z.object({ x: zod_1.z.number().nullable(), y: zod_1.z.number().nullable(), z: zod_1.z.number().nullable() }),
zoomExtentsFactor: zod_1.z.number().positive(),
});
const perspectiveCameraSchema = joi_1.default.object({
name: joi_1.default.string().optional(),
type: joi_1.default.string(),
autoAdjust: joi_1.default.boolean(),
cameraMovementDuration: joi_1.default.number().unsafe(),
const perspectiveCameraSchema = zod_1.z.object({
name: zod_1.z.string().optional(),
type: zod_1.z.string(),
autoAdjust: zod_1.z.boolean(),
cameraMovementDuration: zod_1.z.number(),
controls: orbitControlsSchema,
enableCameraControls: joi_1.default.boolean(),
fov: joi_1.default.number().unsafe().positive(),
position: { x: joi_1.default.number().unsafe().allow(null), y: joi_1.default.number().unsafe().allow(null), z: joi_1.default.number().unsafe().allow(null) },
revertAtMouseUp: joi_1.default.boolean(),
revertAtMouseUpDuration: joi_1.default.number().unsafe(),
target: { x: joi_1.default.number().unsafe().allow(null), y: joi_1.default.number().unsafe().allow(null), z: joi_1.default.number().unsafe().allow(null) },
zoomExtentsFactor: joi_1.default.number().unsafe().positive(),
enableCameraControls: zod_1.z.boolean(),
fov: zod_1.z.number().positive(),
position: zod_1.z.object({ x: zod_1.z.number().nullable(), y: zod_1.z.number().nullable(), z: zod_1.z.number().nullable() }),
revertAtMouseUp: zod_1.z.boolean(),
revertAtMouseUpDuration: zod_1.z.number(),
target: zod_1.z.object({ x: zod_1.z.number().nullable(), y: zod_1.z.number().nullable(), z: zod_1.z.number().nullable() }),
zoomExtentsFactor: zod_1.z.number().positive(),
});
const cameraSchema = joi_1.default.object().pattern(/^/, [perspectiveCameraSchema, orthographicCameraSchema]);
const ambientLightSchema = joi_1.default.object({
color: joi_1.default.alternatives([joi_1.default.number().unsafe(), joi_1.default.string()]),
intensity: joi_1.default.number().unsafe()
const cameraSchema = zod_1.z.record(zod_1.z.union([perspectiveCameraSchema, orthographicCameraSchema]));
const ambientLightSchema = zod_1.z.object({
color: zod_1.z.union([zod_1.z.number(), zod_1.z.string()]),
intensity: zod_1.z.number()
});
const directionalLightSchema = joi_1.default.object({
color: joi_1.default.alternatives([joi_1.default.number().unsafe(), joi_1.default.string()]),
intensity: joi_1.default.number().unsafe(),
direction: { x: joi_1.default.number().unsafe(), y: joi_1.default.number().unsafe(), z: joi_1.default.number().unsafe() },
castShadow: joi_1.default.boolean(),
shadowMapResolution: joi_1.default.number().unsafe().optional(),
shadowMapBias: joi_1.default.number().unsafe().optional()
const directionalLightSchema = zod_1.z.object({
color: zod_1.z.union([zod_1.z.number(), zod_1.z.string()]),
intensity: zod_1.z.number(),
direction: zod_1.z.object({ x: zod_1.z.number(), y: zod_1.z.number(), z: zod_1.z.number() }),
castShadow: zod_1.z.boolean(),
shadowMapResolution: zod_1.z.number().optional(),
shadowMapBias: zod_1.z.number().optional()
});
const hemisphereLightSchema = joi_1.default.object({
skyColor: joi_1.default.alternatives([joi_1.default.number().unsafe(), joi_1.default.string()]),
intensity: joi_1.default.number().unsafe(),
groundColor: joi_1.default.alternatives([joi_1.default.number().unsafe(), joi_1.default.string()]),
const hemisphereLightSchema = zod_1.z.object({
skyColor: zod_1.z.union([zod_1.z.number(), zod_1.z.string()]),
intensity: zod_1.z.number(),
groundColor: zod_1.z.union([zod_1.z.number(), zod_1.z.string()]),
});
const pointLightSchema = joi_1.default.object({
color: joi_1.default.alternatives([joi_1.default.number().unsafe(), joi_1.default.string()]),
intensity: joi_1.default.number().unsafe(),
position: { x: joi_1.default.number().unsafe(), y: joi_1.default.number().unsafe(), z: joi_1.default.number().unsafe() },
distance: joi_1.default.number().unsafe(),
decay: joi_1.default.number().unsafe(),
const pointLightSchema = zod_1.z.object({
color: zod_1.z.union([zod_1.z.number(), zod_1.z.string()]),
intensity: zod_1.z.number(),
position: zod_1.z.object({ x: zod_1.z.number(), y: zod_1.z.number(), z: zod_1.z.number() }),
distance: zod_1.z.number(),
decay: zod_1.z.number(),
});
const spotLightSchema = joi_1.default.object({
color: joi_1.default.alternatives([joi_1.default.number().unsafe(), joi_1.default.string()]),
intensity: joi_1.default.number().unsafe(),
position: { x: joi_1.default.number().unsafe(), y: joi_1.default.number().unsafe(), z: joi_1.default.number().unsafe() },
target: { x: joi_1.default.number().unsafe(), y: joi_1.default.number().unsafe(), z: joi_1.default.number().unsafe() },
distance: joi_1.default.number().unsafe(),
decay: joi_1.default.number().unsafe(),
angle: joi_1.default.number().unsafe(),
penumbra: joi_1.default.number().unsafe(),
const spotLightSchema = zod_1.z.object({
color: zod_1.z.union([zod_1.z.number(), zod_1.z.string()]),
intensity: zod_1.z.number(),
position: zod_1.z.object({ x: zod_1.z.number(), y: zod_1.z.number(), z: zod_1.z.number() }),
target: zod_1.z.object({ x: zod_1.z.number(), y: zod_1.z.number(), z: zod_1.z.number() }),
distance: zod_1.z.number(),
decay: zod_1.z.number(),
angle: zod_1.z.number(),
penumbra: zod_1.z.number(),
});
const lightSchema = joi_1.default.object().pattern(/^/, [
joi_1.default.object({
name: joi_1.default.string().optional(),
lights: joi_1.default.object().pattern(/^/, [
joi_1.default.object({
name: joi_1.default.string().optional(),
type: joi_1.default.string(),
order: joi_1.default.number().unsafe().optional(),
properties: joi_1.default.alternatives([ambientLightSchema, directionalLightSchema, hemisphereLightSchema, pointLightSchema, spotLightSchema])
})
])
})
]);
const schema = joi_1.default.object({
build_date: joi_1.default.string().allow('').optional(),
build_version: joi_1.default.string().allow('').optional(),
settings_version: joi_1.default.string(),
ar: joi_1.default.object({
enable: joi_1.default.boolean(),
autoScaling: joi_1.default.boolean(),
const lightSchema = zod_1.z.record(zod_1.z.object({
name: zod_1.z.string().optional(),
lights: zod_1.z.record(zod_1.z.object({
name: zod_1.z.string().optional(),
type: zod_1.z.string(),
order: zod_1.z.number().optional(),
properties: zod_1.z.union([ambientLightSchema, directionalLightSchema, hemisphereLightSchema, pointLightSchema, spotLightSchema])
}))
}));
const schema = zod_1.z.object({
build_date: zod_1.z.string().optional(),
build_version: zod_1.z.string().optional(),
settings_version: zod_1.z.string(),
ar: zod_1.z.object({
enable: zod_1.z.boolean(),
autoScaling: zod_1.z.boolean(),
}).optional(),
camera: {
cameraId: joi_1.default.string().allow(''),
camera: zod_1.z.object({
cameraId: zod_1.z.string(),
cameras: cameraSchema
},
environment: {
clearAlpha: joi_1.default.number().unsafe(),
clearColor: joi_1.default.string(),
map: joi_1.default.alternatives([joi_1.default.string().allow(''), joi_1.default.array().items(joi_1.default.string())]),
mapAsBackground: joi_1.default.boolean(),
mapResolution: joi_1.default.string()
},
environmentGeometry: {
gridColor: joi_1.default.string(),
gridVisibility: joi_1.default.boolean(),
groundPlaneColor: joi_1.default.string(),
groundPlaneVisibility: joi_1.default.boolean(),
},
general: {
transformation: {
scale: { x: joi_1.default.number().unsafe(), y: joi_1.default.number().unsafe(), z: joi_1.default.number().unsafe() },
translation: { x: joi_1.default.number().unsafe(), y: joi_1.default.number().unsafe(), z: joi_1.default.number().unsafe() },
rotation: { x: joi_1.default.number().unsafe(), y: joi_1.default.number().unsafe(), z: joi_1.default.number().unsafe() }
},
blurWhenBusy: joi_1.default.boolean(),
commitSettings: joi_1.default.boolean(),
commitParameters: joi_1.default.boolean(),
pointSize: joi_1.default.number().unsafe(),
showMessages: joi_1.default.boolean(),
},
light: {
lightSceneId: joi_1.default.string().allow('').optional(),
}),
environment: zod_1.z.object({
clearAlpha: zod_1.z.number(),
clearColor: zod_1.z.string(),
map: zod_1.z.union([zod_1.z.string(), zod_1.z.string().array()]),
mapAsBackground: zod_1.z.boolean(),
mapResolution: zod_1.z.string()
}),
environmentGeometry: zod_1.z.object({
gridColor: zod_1.z.string(),
gridVisibility: zod_1.z.boolean(),
groundPlaneColor: zod_1.z.string(),
groundPlaneVisibility: zod_1.z.boolean(),
}),
general: zod_1.z.object({
transformation: zod_1.z.object({
scale: zod_1.z.object({ x: zod_1.z.number(), y: zod_1.z.number(), z: zod_1.z.number() }),
translation: zod_1.z.object({ x: zod_1.z.number(), y: zod_1.z.number(), z: zod_1.z.number() }),
rotation: zod_1.z.object({ x: zod_1.z.number(), y: zod_1.z.number(), z: zod_1.z.number() })
}),
blurWhenBusy: zod_1.z.boolean(),
commitSettings: zod_1.z.boolean(),
commitParameters: zod_1.z.boolean(),
pointSize: zod_1.z.number(),
showMessages: zod_1.z.boolean(),
}),
light: zod_1.z.object({
lightSceneId: zod_1.z.string().optional(),
lightScenes: lightSchema,
},
rendering: {
ambientOcclusion: joi_1.default.boolean(),
ambientOcclusionIntensity: joi_1.default.number().unsafe().min(0),
beautyRenderDelay: joi_1.default.number().unsafe(),
beautyRenderBlendingDuration: joi_1.default.number().unsafe(),
outputEncoding: joi_1.default.string(),
physicallyCorrectLights: joi_1.default.boolean(),
shadows: joi_1.default.boolean(),
textureEncoding: joi_1.default.string(),
toneMapping: joi_1.default.string(),
toneMappingExposure: joi_1.default.number().unsafe(),
},
session: joi_1.default.object().pattern(/^/, [
joi_1.default.object({
order: joi_1.default.number().unsafe().optional(),
displayname: joi_1.default.string().allow('').optional(),
hidden: joi_1.default.boolean().optional()
})
]),
}).options({ presence: 'required' });
}),
rendering: zod_1.z.object({
ambientOcclusion: zod_1.z.boolean(),
ambientOcclusionIntensity: zod_1.z.number().min(0),
beautyRenderDelay: zod_1.z.number(),
beautyRenderBlendingDuration: zod_1.z.number(),
outputEncoding: zod_1.z.string(),
physicallyCorrectLights: zod_1.z.boolean(),
shadows: zod_1.z.boolean(),
textureEncoding: zod_1.z.string(),
toneMapping: zod_1.z.string(),
toneMappingExposure: zod_1.z.number(),
}),
session: zod_1.z.record(zod_1.z.object({
order: zod_1.z.number().optional(),
displayname: zod_1.z.string().optional(),
hidden: zod_1.z.boolean().optional()
})),
}).strict().required();
const validate = (s) => {
const result = joi_1.default.attempt(s, schema);
s = result.value;
const result = schema.parse(s);
s = result;
};
exports.validate = validate;
//# sourceMappingURL=Validator.js.map
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.validate = void 0;
const joi_1 = __importDefault(require("joi"));
const orbitControlsSchema = joi_1.default.object({
autoRotationSpeed: joi_1.default.number().unsafe(),
damping: joi_1.default.number().unsafe(),
enableAutoRotation: joi_1.default.boolean(),
enableKeyPan: joi_1.default.boolean(),
enablePan: joi_1.default.boolean(),
enableRotation: joi_1.default.boolean(),
enableZoom: joi_1.default.boolean(),
input: { keys: { up: joi_1.default.number().unsafe(), down: joi_1.default.number().unsafe(), left: joi_1.default.number().unsafe(), right: joi_1.default.number().unsafe() }, mouse: { rotate: joi_1.default.number().unsafe(), zoom: joi_1.default.number().unsafe(), pan: joi_1.default.number().unsafe() }, touch: { rotate: joi_1.default.number().unsafe(), zoom: joi_1.default.number().unsafe(), pan: joi_1.default.number().unsafe() }, },
keyPanSpeed: joi_1.default.number().unsafe(),
movementSmoothness: joi_1.default.number().unsafe(),
restrictions: joi_1.default.object({
position: {
cube: { min: { x: joi_1.default.number().unsafe().allow(-Infinity).allow(null), y: joi_1.default.number().unsafe().allow(-Infinity).allow(null), z: joi_1.default.number().unsafe().allow(-Infinity).allow(null) }, max: { x: joi_1.default.number().unsafe().allow(Infinity).allow(null), y: joi_1.default.number().unsafe().allow(Infinity).allow(null), z: joi_1.default.number().unsafe().allow(Infinity).allow(null) } },
sphere: { center: { x: joi_1.default.number().unsafe(), y: joi_1.default.number().unsafe(), z: joi_1.default.number().unsafe() }, radius: joi_1.default.number().unsafe().allow(Infinity).allow(null) },
},
target: {
cube: { min: { x: joi_1.default.number().unsafe().allow(-Infinity).allow(null), y: joi_1.default.number().unsafe().allow(-Infinity).allow(null), z: joi_1.default.number().unsafe().allow(-Infinity).allow(null) }, max: { x: joi_1.default.number().unsafe().allow(Infinity).allow(null), y: joi_1.default.number().unsafe().allow(Infinity).allow(null), z: joi_1.default.number().unsafe().allow(Infinity).allow(null) } },
sphere: { center: { x: joi_1.default.number().unsafe(), y: joi_1.default.number().unsafe(), z: joi_1.default.number().unsafe() }, radius: joi_1.default.number().unsafe().allow(Infinity).allow(null) },
},
rotation: { minPolarAngle: joi_1.default.number().unsafe(), maxPolarAngle: joi_1.default.number().unsafe(), minAzimuthAngle: joi_1.default.number().unsafe().allow(-Infinity).allow(null), maxAzimuthAngle: joi_1.default.number().unsafe().allow(Infinity).allow(null) },
zoom: { minDistance: joi_1.default.number().unsafe(), maxDistance: joi_1.default.number().unsafe().allow(Infinity).allow(null) },
const zod_1 = require("zod");
const orbitControlsSchema = zod_1.z.object({
autoRotationSpeed: zod_1.z.number(),
damping: zod_1.z.number(),
enableAutoRotation: zod_1.z.boolean(),
enableKeyPan: zod_1.z.boolean(),
enablePan: zod_1.z.boolean(),
enableRotation: zod_1.z.boolean(),
enableZoom: zod_1.z.boolean(),
input: zod_1.z.object({ keys: zod_1.z.object({ up: zod_1.z.number(), down: zod_1.z.number(), left: zod_1.z.number(), right: zod_1.z.number() }), mouse: zod_1.z.object({ rotate: zod_1.z.number(), zoom: zod_1.z.number(), pan: zod_1.z.number() }), touch: zod_1.z.object({ rotate: zod_1.z.number(), zoom: zod_1.z.number(), pan: zod_1.z.number() }), }),
keyPanSpeed: zod_1.z.number(),
movementSmoothness: zod_1.z.number(),
restrictions: zod_1.z.object({
position: zod_1.z.object({
cube: zod_1.z.object({ min: zod_1.z.object({ x: zod_1.z.number().nullable(), y: zod_1.z.number().nullable(), z: zod_1.z.number().nullable() }), max: zod_1.z.object({ x: zod_1.z.number().nullable(), y: zod_1.z.number().nullable(), z: zod_1.z.number().nullable() }) }),
sphere: zod_1.z.object({ center: zod_1.z.object({ x: zod_1.z.number(), y: zod_1.z.number(), z: zod_1.z.number() }), radius: zod_1.z.number().nullable() }),
}),
target: zod_1.z.object({
cube: zod_1.z.object({ min: zod_1.z.object({ x: zod_1.z.number().nullable(), y: zod_1.z.number().nullable(), z: zod_1.z.number().nullable() }), max: zod_1.z.object({ x: zod_1.z.number().nullable(), y: zod_1.z.number().nullable(), z: zod_1.z.number().nullable() }) }),
sphere: zod_1.z.object({ center: zod_1.z.object({ x: zod_1.z.number(), y: zod_1.z.number(), z: zod_1.z.number() }), radius: zod_1.z.number().nullable() }),
}),
rotation: zod_1.z.object({ minPolarAngle: zod_1.z.number(), maxPolarAngle: zod_1.z.number(), minAzimuthAngle: zod_1.z.number().nullable(), maxAzimuthAngle: zod_1.z.number().nullable() }),
zoom: zod_1.z.object({ minDistance: zod_1.z.number(), maxDistance: zod_1.z.number().nullable() }),
}),
rotationSpeed: joi_1.default.number().unsafe(),
panSpeed: joi_1.default.number().unsafe(),
zoomSpeed: joi_1.default.number().unsafe(),
rotationSpeed: zod_1.z.number(),
panSpeed: zod_1.z.number(),
zoomSpeed: zod_1.z.number(),
});
const orthographicControlsSchema = joi_1.default.object({
damping: joi_1.default.number().unsafe(),
enableKeyPan: joi_1.default.boolean(),
enablePan: joi_1.default.boolean(),
enableZoom: joi_1.default.boolean(),
input: { keys: { up: joi_1.default.number().unsafe(), down: joi_1.default.number().unsafe(), left: joi_1.default.number().unsafe(), right: joi_1.default.number().unsafe() }, mouse: { rotate: joi_1.default.number().unsafe(), zoom: joi_1.default.number().unsafe(), pan: joi_1.default.number().unsafe() }, touch: { rotate: joi_1.default.number().unsafe(), zoom: joi_1.default.number().unsafe(), pan: joi_1.default.number().unsafe() }, },
keyPanSpeed: joi_1.default.number().unsafe(),
movementSmoothness: joi_1.default.number().unsafe(),
panSpeed: joi_1.default.number().unsafe(),
zoomSpeed: joi_1.default.number().unsafe(),
const orthographicControlsSchema = zod_1.z.object({
damping: zod_1.z.number(),
enableKeyPan: zod_1.z.boolean(),
enablePan: zod_1.z.boolean(),
enableZoom: zod_1.z.boolean(),
input: zod_1.z.object({ keys: zod_1.z.object({ up: zod_1.z.number(), down: zod_1.z.number(), left: zod_1.z.number(), right: zod_1.z.number() }), mouse: zod_1.z.object({ rotate: zod_1.z.number(), zoom: zod_1.z.number(), pan: zod_1.z.number() }), touch: zod_1.z.object({ rotate: zod_1.z.number(), zoom: zod_1.z.number(), pan: zod_1.z.number() }), }),
keyPanSpeed: zod_1.z.number(),
movementSmoothness: zod_1.z.number(),
panSpeed: zod_1.z.number(),
zoomSpeed: zod_1.z.number(),
});
const orthographicCameraSchema = joi_1.default.object({
name: joi_1.default.string().optional(),
type: joi_1.default.string(),
autoAdjust: joi_1.default.boolean(),
cameraMovementDuration: joi_1.default.number().unsafe(),
const orthographicCameraSchema = zod_1.z.object({
name: zod_1.z.string().optional(),
type: zod_1.z.string(),
autoAdjust: zod_1.z.boolean(),
cameraMovementDuration: zod_1.z.number(),
controls: orthographicControlsSchema,
enableCameraControls: joi_1.default.boolean(),
position: { x: joi_1.default.number().unsafe().allow(null), y: joi_1.default.number().unsafe().allow(null), z: joi_1.default.number().unsafe().allow(null) },
revertAtMouseUp: joi_1.default.boolean(),
revertAtMouseUpDuration: joi_1.default.number().unsafe(),
target: { x: joi_1.default.number().unsafe().allow(null), y: joi_1.default.number().unsafe().allow(null), z: joi_1.default.number().unsafe().allow(null) },
zoomExtentsFactor: joi_1.default.number().unsafe().positive(),
enableCameraControls: zod_1.z.boolean(),
position: zod_1.z.object({ x: zod_1.z.number().nullable(), y: zod_1.z.number().nullable(), z: zod_1.z.number().nullable() }),
revertAtMouseUp: zod_1.z.boolean(),
revertAtMouseUpDuration: zod_1.z.number(),
target: zod_1.z.object({ x: zod_1.z.number().nullable(), y: zod_1.z.number().nullable(), z: zod_1.z.number().nullable() }),
zoomExtentsFactor: zod_1.z.number().positive(),
});
const perspectiveCameraSchema = joi_1.default.object({
name: joi_1.default.string().optional(),
type: joi_1.default.string(),
autoAdjust: joi_1.default.boolean(),
cameraMovementDuration: joi_1.default.number().unsafe(),
const perspectiveCameraSchema = zod_1.z.object({
name: zod_1.z.string().optional(),
type: zod_1.z.string(),
autoAdjust: zod_1.z.boolean(),
cameraMovementDuration: zod_1.z.number(),
controls: orbitControlsSchema,
enableCameraControls: joi_1.default.boolean(),
fov: joi_1.default.number().unsafe().positive(),
position: { x: joi_1.default.number().unsafe().allow(null), y: joi_1.default.number().unsafe().allow(null), z: joi_1.default.number().unsafe().allow(null) },
revertAtMouseUp: joi_1.default.boolean(),
revertAtMouseUpDuration: joi_1.default.number().unsafe(),
target: { x: joi_1.default.number().unsafe().allow(null), y: joi_1.default.number().unsafe().allow(null), z: joi_1.default.number().unsafe().allow(null) },
zoomExtentsFactor: joi_1.default.number().unsafe().positive(),
enableCameraControls: zod_1.z.boolean(),
fov: zod_1.z.number().positive(),
position: zod_1.z.object({ x: zod_1.z.number().nullable(), y: zod_1.z.number().nullable(), z: zod_1.z.number().nullable() }),
revertAtMouseUp: zod_1.z.boolean(),
revertAtMouseUpDuration: zod_1.z.number(),
target: zod_1.z.object({ x: zod_1.z.number().nullable(), y: zod_1.z.number().nullable(), z: zod_1.z.number().nullable() }),
zoomExtentsFactor: zod_1.z.number().positive(),
});
const cameraSchema = joi_1.default.object().pattern(/^/, [perspectiveCameraSchema, orthographicCameraSchema]);
const ambientLightSchema = joi_1.default.object({
color: joi_1.default.alternatives([joi_1.default.number().unsafe(), joi_1.default.string()]),
intensity: joi_1.default.number().unsafe()
const cameraSchema = zod_1.z.record(zod_1.z.union([perspectiveCameraSchema, orthographicCameraSchema]));
const ambientLightSchema = zod_1.z.object({
color: zod_1.z.union([zod_1.z.number(), zod_1.z.string()]),
intensity: zod_1.z.number()
});
const directionalLightSchema = joi_1.default.object({
color: joi_1.default.alternatives([joi_1.default.number().unsafe(), joi_1.default.string()]),
intensity: joi_1.default.number().unsafe(),
direction: { x: joi_1.default.number().unsafe(), y: joi_1.default.number().unsafe(), z: joi_1.default.number().unsafe() },
castShadow: joi_1.default.boolean(),
shadowMapResolution: joi_1.default.number().unsafe().optional(),
shadowMapBias: joi_1.default.number().unsafe().optional()
const directionalLightSchema = zod_1.z.object({
color: zod_1.z.union([zod_1.z.number(), zod_1.z.string()]),
intensity: zod_1.z.number(),
direction: zod_1.z.object({ x: zod_1.z.number(), y: zod_1.z.number(), z: zod_1.z.number() }),
castShadow: zod_1.z.boolean(),
shadowMapResolution: zod_1.z.number().optional(),
shadowMapBias: zod_1.z.number().optional()
});
const hemisphereLightSchema = joi_1.default.object({
skyColor: joi_1.default.alternatives([joi_1.default.number().unsafe(), joi_1.default.string()]),
intensity: joi_1.default.number().unsafe(),
groundColor: joi_1.default.alternatives([joi_1.default.number().unsafe(), joi_1.default.string()]),
const hemisphereLightSchema = zod_1.z.object({
skyColor: zod_1.z.union([zod_1.z.number(), zod_1.z.string()]),
intensity: zod_1.z.number(),
groundColor: zod_1.z.union([zod_1.z.number(), zod_1.z.string()]),
});
const pointLightSchema = joi_1.default.object({
color: joi_1.default.alternatives([joi_1.default.number().unsafe(), joi_1.default.string()]),
intensity: joi_1.default.number().unsafe(),
position: { x: joi_1.default.number().unsafe(), y: joi_1.default.number().unsafe(), z: joi_1.default.number().unsafe() },
distance: joi_1.default.number().unsafe(),
decay: joi_1.default.number().unsafe(),
const pointLightSchema = zod_1.z.object({
color: zod_1.z.union([zod_1.z.number(), zod_1.z.string()]),
intensity: zod_1.z.number(),
position: zod_1.z.object({ x: zod_1.z.number(), y: zod_1.z.number(), z: zod_1.z.number() }),
distance: zod_1.z.number(),
decay: zod_1.z.number(),
});
const spotLightSchema = joi_1.default.object({
color: joi_1.default.alternatives([joi_1.default.number().unsafe(), joi_1.default.string()]),
intensity: joi_1.default.number().unsafe(),
position: { x: joi_1.default.number().unsafe(), y: joi_1.default.number().unsafe(), z: joi_1.default.number().unsafe() },
target: { x: joi_1.default.number().unsafe(), y: joi_1.default.number().unsafe(), z: joi_1.default.number().unsafe() },
distance: joi_1.default.number().unsafe(),
decay: joi_1.default.number().unsafe(),
angle: joi_1.default.number().unsafe(),
penumbra: joi_1.default.number().unsafe(),
const spotLightSchema = zod_1.z.object({
color: zod_1.z.union([zod_1.z.number(), zod_1.z.string()]),
intensity: zod_1.z.number(),
position: zod_1.z.object({ x: zod_1.z.number(), y: zod_1.z.number(), z: zod_1.z.number() }),
target: zod_1.z.object({ x: zod_1.z.number(), y: zod_1.z.number(), z: zod_1.z.number() }),
distance: zod_1.z.number(),
decay: zod_1.z.number(),
angle: zod_1.z.number(),
penumbra: zod_1.z.number(),
});
const lightSchema = joi_1.default.object().pattern(/^/, [
joi_1.default.object({
name: joi_1.default.string().optional(),
lights: joi_1.default.object().pattern(/^/, [
joi_1.default.object({
name: joi_1.default.string().optional(),
type: joi_1.default.string(),
order: joi_1.default.number().unsafe().optional(),
properties: joi_1.default.alternatives([ambientLightSchema, directionalLightSchema, hemisphereLightSchema, pointLightSchema, spotLightSchema])
})
])
})
]);
const schema = joi_1.default.object({
build_date: joi_1.default.string().allow('').optional(),
build_version: joi_1.default.string().allow('').optional(),
settings_version: joi_1.default.string(),
ar: joi_1.default.object({
enable: joi_1.default.boolean(),
autoScaling: joi_1.default.boolean(),
const lightSchema = zod_1.z.record(zod_1.z.object({
name: zod_1.z.string().optional(),
lights: zod_1.z.record(zod_1.z.object({
name: zod_1.z.string().optional(),
type: zod_1.z.string(),
order: zod_1.z.number().optional(),
properties: zod_1.z.union([ambientLightSchema, directionalLightSchema, hemisphereLightSchema, pointLightSchema, spotLightSchema])
}))
}));
const schema = zod_1.z.object({
build_date: zod_1.z.string().optional(),
build_version: zod_1.z.string().optional(),
settings_version: zod_1.z.string(),
ar: zod_1.z.object({
enable: zod_1.z.boolean(),
autoScaling: zod_1.z.boolean(),
}).optional(),
camera: {
cameraId: joi_1.default.string().allow(''),
camera: zod_1.z.object({
cameraId: zod_1.z.string(),
cameras: cameraSchema
},
environment: {
clearAlpha: joi_1.default.number().unsafe(),
clearColor: joi_1.default.string(),
map: joi_1.default.alternatives([joi_1.default.string().allow(''), joi_1.default.array().items(joi_1.default.string())]),
mapAsBackground: joi_1.default.boolean(),
mapResolution: joi_1.default.string()
},
environmentGeometry: {
gridColor: joi_1.default.string(),
gridVisibility: joi_1.default.boolean(),
groundPlaneColor: joi_1.default.string(),
groundPlaneVisibility: joi_1.default.boolean(),
groundPlaneShadowColor: joi_1.default.string(),
groundPlaneShadowVisibility: joi_1.default.boolean(),
},
general: {
transformation: {
scale: { x: joi_1.default.number().unsafe(), y: joi_1.default.number().unsafe(), z: joi_1.default.number().unsafe() },
translation: { x: joi_1.default.number().unsafe(), y: joi_1.default.number().unsafe(), z: joi_1.default.number().unsafe() },
rotation: { x: joi_1.default.number().unsafe(), y: joi_1.default.number().unsafe(), z: joi_1.default.number().unsafe() }
},
blurWhenBusy: joi_1.default.boolean(),
commitSettings: joi_1.default.boolean(),
commitParameters: joi_1.default.boolean(),
pointSize: joi_1.default.number().unsafe(),
showMessages: joi_1.default.boolean(),
},
light: {
lightSceneId: joi_1.default.string().allow('').optional(),
}),
environment: zod_1.z.object({
clearAlpha: zod_1.z.number(),
clearColor: zod_1.z.string(),
map: zod_1.z.union([zod_1.z.string(), zod_1.z.string().array()]),
mapAsBackground: zod_1.z.boolean(),
mapResolution: zod_1.z.string()
}),
environmentGeometry: zod_1.z.object({
gridColor: zod_1.z.string(),
gridVisibility: zod_1.z.boolean(),
groundPlaneColor: zod_1.z.string(),
groundPlaneVisibility: zod_1.z.boolean(),
groundPlaneShadowColor: zod_1.z.string(),
groundPlaneShadowVisibility: zod_1.z.boolean(),
}),
general: zod_1.z.object({
transformation: zod_1.z.object({
scale: zod_1.z.object({ x: zod_1.z.number(), y: zod_1.z.number(), z: zod_1.z.number() }),
translation: zod_1.z.object({ x: zod_1.z.number(), y: zod_1.z.number(), z: zod_1.z.number() }),
rotation: zod_1.z.object({ x: zod_1.z.number(), y: zod_1.z.number(), z: zod_1.z.number() })
}),
blurWhenBusy: zod_1.z.boolean(),
commitSettings: zod_1.z.boolean(),
commitParameters: zod_1.z.boolean(),
pointSize: zod_1.z.number(),
showMessages: zod_1.z.boolean(),
}),
light: zod_1.z.object({
lightSceneId: zod_1.z.string().optional(),
lightScenes: lightSchema,
},
rendering: {
ambientOcclusion: joi_1.default.boolean(),
ambientOcclusionIntensity: joi_1.default.number().unsafe().min(0),
beautyRenderDelay: joi_1.default.number().unsafe(),
beautyRenderBlendingDuration: joi_1.default.number().unsafe(),
lights: joi_1.default.boolean(),
outputEncoding: joi_1.default.string(),
physicallyCorrectLights: joi_1.default.boolean(),
shadows: joi_1.default.boolean(),
textureEncoding: joi_1.default.string(),
toneMapping: joi_1.default.string(),
toneMappingExposure: joi_1.default.number().unsafe(),
},
session: joi_1.default.object().pattern(/^/, [
joi_1.default.object({
order: joi_1.default.number().unsafe().optional(),
displayname: joi_1.default.string().allow('').optional(),
hidden: joi_1.default.boolean().optional()
})
]),
}).options({ presence: 'required' });
}),
rendering: zod_1.z.object({
ambientOcclusion: zod_1.z.boolean(),
ambientOcclusionIntensity: zod_1.z.number().min(0),
beautyRenderDelay: zod_1.z.number(),
beautyRenderBlendingDuration: zod_1.z.number(),
lights: zod_1.z.boolean(),
outputEncoding: zod_1.z.string(),
physicallyCorrectLights: zod_1.z.boolean(),
shadows: zod_1.z.boolean(),
textureEncoding: zod_1.z.string(),
toneMapping: zod_1.z.string(),
toneMappingExposure: zod_1.z.number(),
}),
session: zod_1.z.record(zod_1.z.object({
order: zod_1.z.number().optional(),
displayname: zod_1.z.string().optional(),
hidden: zod_1.z.boolean().optional()
})),
}).strict().required();
const validate = (s) => {
const result = joi_1.default.attempt(s, schema);
s = result.value;
const result = schema.parse(s);
s = result;
};
exports.validate = validate;
//# sourceMappingURL=Validator.js.map
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.validate = void 0;
const joi_1 = __importDefault(require("joi"));
const orbitControlsSchema = joi_1.default.object({
autoRotationSpeed: joi_1.default.number().unsafe(),
damping: joi_1.default.number().unsafe(),
enableAutoRotation: joi_1.default.boolean(),
enableKeyPan: joi_1.default.boolean(),
enablePan: joi_1.default.boolean(),
enableRotation: joi_1.default.boolean(),
enableZoom: joi_1.default.boolean(),
input: { keys: { up: joi_1.default.number().unsafe(), down: joi_1.default.number().unsafe(), left: joi_1.default.number().unsafe(), right: joi_1.default.number().unsafe() }, mouse: { rotate: joi_1.default.number().unsafe(), zoom: joi_1.default.number().unsafe(), pan: joi_1.default.number().unsafe() }, touch: { rotate: joi_1.default.number().unsafe(), zoom: joi_1.default.number().unsafe(), pan: joi_1.default.number().unsafe() }, },
keyPanSpeed: joi_1.default.number().unsafe(),
movementSmoothness: joi_1.default.number().unsafe(),
restrictions: joi_1.default.object({
position: {
cube: { min: { x: joi_1.default.number().unsafe().allow(-Infinity).allow(null), y: joi_1.default.number().unsafe().allow(-Infinity).allow(null), z: joi_1.default.number().unsafe().allow(-Infinity).allow(null) }, max: { x: joi_1.default.number().unsafe().allow(Infinity).allow(null), y: joi_1.default.number().unsafe().allow(Infinity).allow(null), z: joi_1.default.number().unsafe().allow(Infinity).allow(null) } },
sphere: { center: { x: joi_1.default.number().unsafe(), y: joi_1.default.number().unsafe(), z: joi_1.default.number().unsafe() }, radius: joi_1.default.number().unsafe().allow(Infinity).allow(null) },
},
target: {
cube: { min: { x: joi_1.default.number().unsafe().allow(-Infinity).allow(null), y: joi_1.default.number().unsafe().allow(-Infinity).allow(null), z: joi_1.default.number().unsafe().allow(-Infinity).allow(null) }, max: { x: joi_1.default.number().unsafe().allow(Infinity).allow(null), y: joi_1.default.number().unsafe().allow(Infinity).allow(null), z: joi_1.default.number().unsafe().allow(Infinity).allow(null) } },
sphere: { center: { x: joi_1.default.number().unsafe(), y: joi_1.default.number().unsafe(), z: joi_1.default.number().unsafe() }, radius: joi_1.default.number().unsafe().allow(Infinity).allow(null) },
},
rotation: { minPolarAngle: joi_1.default.number().unsafe(), maxPolarAngle: joi_1.default.number().unsafe(), minAzimuthAngle: joi_1.default.number().unsafe().allow(-Infinity).allow(null), maxAzimuthAngle: joi_1.default.number().unsafe().allow(Infinity).allow(null) },
zoom: { minDistance: joi_1.default.number().unsafe(), maxDistance: joi_1.default.number().unsafe().allow(Infinity).allow(null) },
const zod_1 = require("zod");
const orbitControlsSchema = zod_1.z.object({
autoRotationSpeed: zod_1.z.number(),
damping: zod_1.z.number(),
enableAutoRotation: zod_1.z.boolean(),
enableKeyPan: zod_1.z.boolean(),
enablePan: zod_1.z.boolean(),
enableRotation: zod_1.z.boolean(),
enableZoom: zod_1.z.boolean(),
input: zod_1.z.object({ keys: zod_1.z.object({ up: zod_1.z.number(), down: zod_1.z.number(), left: zod_1.z.number(), right: zod_1.z.number() }), mouse: zod_1.z.object({ rotate: zod_1.z.number(), zoom: zod_1.z.number(), pan: zod_1.z.number() }), touch: zod_1.z.object({ rotate: zod_1.z.number(), zoom: zod_1.z.number(), pan: zod_1.z.number() }), }),
keyPanSpeed: zod_1.z.number(),
movementSmoothness: zod_1.z.number(),
restrictions: zod_1.z.object({
position: zod_1.z.object({
cube: zod_1.z.object({ min: zod_1.z.object({ x: zod_1.z.number().nullable(), y: zod_1.z.number().nullable(), z: zod_1.z.number().nullable() }), max: zod_1.z.object({ x: zod_1.z.number().nullable(), y: zod_1.z.number().nullable(), z: zod_1.z.number().nullable() }) }),
sphere: zod_1.z.object({ center: zod_1.z.object({ x: zod_1.z.number(), y: zod_1.z.number(), z: zod_1.z.number() }), radius: zod_1.z.number().nullable() }),
}),
target: zod_1.z.object({
cube: zod_1.z.object({ min: zod_1.z.object({ x: zod_1.z.number().nullable(), y: zod_1.z.number().nullable(), z: zod_1.z.number().nullable() }), max: zod_1.z.object({ x: zod_1.z.number().nullable(), y: zod_1.z.number().nullable(), z: zod_1.z.number().nullable() }) }),
sphere: zod_1.z.object({ center: zod_1.z.object({ x: zod_1.z.number(), y: zod_1.z.number(), z: zod_1.z.number() }), radius: zod_1.z.number().nullable() }),
}),
rotation: zod_1.z.object({ minPolarAngle: zod_1.z.number(), maxPolarAngle: zod_1.z.number(), minAzimuthAngle: zod_1.z.number().nullable(), maxAzimuthAngle: zod_1.z.number().nullable() }),
zoom: zod_1.z.object({ minDistance: zod_1.z.number(), maxDistance: zod_1.z.number().nullable() }),
}),
rotationSpeed: joi_1.default.number().unsafe(),
panSpeed: joi_1.default.number().unsafe(),
zoomSpeed: joi_1.default.number().unsafe(),
rotationSpeed: zod_1.z.number(),
panSpeed: zod_1.z.number(),
zoomSpeed: zod_1.z.number(),
});
const orthographicControlsSchema = joi_1.default.object({
damping: joi_1.default.number().unsafe(),
enableKeyPan: joi_1.default.boolean(),
enablePan: joi_1.default.boolean(),
enableZoom: joi_1.default.boolean(),
input: { keys: { up: joi_1.default.number().unsafe(), down: joi_1.default.number().unsafe(), left: joi_1.default.number().unsafe(), right: joi_1.default.number().unsafe() }, mouse: { rotate: joi_1.default.number().unsafe(), zoom: joi_1.default.number().unsafe(), pan: joi_1.default.number().unsafe() }, touch: { rotate: joi_1.default.number().unsafe(), zoom: joi_1.default.number().unsafe(), pan: joi_1.default.number().unsafe() }, },
keyPanSpeed: joi_1.default.number().unsafe(),
movementSmoothness: joi_1.default.number().unsafe(),
panSpeed: joi_1.default.number().unsafe(),
zoomSpeed: joi_1.default.number().unsafe(),
const orthographicControlsSchema = zod_1.z.object({
damping: zod_1.z.number(),
enableKeyPan: zod_1.z.boolean(),
enablePan: zod_1.z.boolean(),
enableZoom: zod_1.z.boolean(),
input: zod_1.z.object({ keys: zod_1.z.object({ up: zod_1.z.number(), down: zod_1.z.number(), left: zod_1.z.number(), right: zod_1.z.number() }), mouse: zod_1.z.object({ rotate: zod_1.z.number(), zoom: zod_1.z.number(), pan: zod_1.z.number() }), touch: zod_1.z.object({ rotate: zod_1.z.number(), zoom: zod_1.z.number(), pan: zod_1.z.number() }), }),
keyPanSpeed: zod_1.z.number(),
movementSmoothness: zod_1.z.number(),
panSpeed: zod_1.z.number(),
zoomSpeed: zod_1.z.number(),
});
const orthographicCameraSchema = joi_1.default.object({
name: joi_1.default.string().optional(),
type: joi_1.default.string(),
autoAdjust: joi_1.default.boolean(),
cameraMovementDuration: joi_1.default.number().unsafe(),
const orthographicCameraSchema = zod_1.z.object({
name: zod_1.z.string().optional(),
type: zod_1.z.string(),
autoAdjust: zod_1.z.boolean(),
cameraMovementDuration: zod_1.z.number(),
controls: orthographicControlsSchema,
enableCameraControls: joi_1.default.boolean(),
position: { x: joi_1.default.number().unsafe().allow(null), y: joi_1.default.number().unsafe().allow(null), z: joi_1.default.number().unsafe().allow(null) },
revertAtMouseUp: joi_1.default.boolean(),
revertAtMouseUpDuration: joi_1.default.number().unsafe(),
target: { x: joi_1.default.number().unsafe().allow(null), y: joi_1.default.number().unsafe().allow(null), z: joi_1.default.number().unsafe().allow(null) },
zoomExtentsFactor: joi_1.default.number().unsafe().positive(),
enableCameraControls: zod_1.z.boolean(),
position: zod_1.z.object({ x: zod_1.z.number().nullable(), y: zod_1.z.number().nullable(), z: zod_1.z.number().nullable() }),
revertAtMouseUp: zod_1.z.boolean(),
revertAtMouseUpDuration: zod_1.z.number(),
target: zod_1.z.object({ x: zod_1.z.number().nullable(), y: zod_1.z.number().nullable(), z: zod_1.z.number().nullable() }),
zoomExtentsFactor: zod_1.z.number().positive(),
});
const perspectiveCameraSchema = joi_1.default.object({
name: joi_1.default.string().optional(),
type: joi_1.default.string(),
autoAdjust: joi_1.default.boolean(),
cameraMovementDuration: joi_1.default.number().unsafe(),
const perspectiveCameraSchema = zod_1.z.object({
name: zod_1.z.string().optional(),
type: zod_1.z.string(),
autoAdjust: zod_1.z.boolean(),
cameraMovementDuration: zod_1.z.number(),
controls: orbitControlsSchema,
enableCameraControls: joi_1.default.boolean(),
fov: joi_1.default.number().unsafe().positive(),
position: { x: joi_1.default.number().unsafe().allow(null), y: joi_1.default.number().unsafe().allow(null), z: joi_1.default.number().unsafe().allow(null) },
revertAtMouseUp: joi_1.default.boolean(),
revertAtMouseUpDuration: joi_1.default.number().unsafe(),
target: { x: joi_1.default.number().unsafe().allow(null), y: joi_1.default.number().unsafe().allow(null), z: joi_1.default.number().unsafe().allow(null) },
zoomExtentsFactor: joi_1.default.number().unsafe().positive(),
enableCameraControls: zod_1.z.boolean(),
fov: zod_1.z.number().positive(),
position: zod_1.z.object({ x: zod_1.z.number().nullable(), y: zod_1.z.number().nullable(), z: zod_1.z.number().nullable() }),
revertAtMouseUp: zod_1.z.boolean(),
revertAtMouseUpDuration: zod_1.z.number(),
target: zod_1.z.object({ x: zod_1.z.number().nullable(), y: zod_1.z.number().nullable(), z: zod_1.z.number().nullable() }),
zoomExtentsFactor: zod_1.z.number().positive(),
});
const cameraSchema = joi_1.default.object().pattern(/^/, [perspectiveCameraSchema, orthographicCameraSchema]);
const ambientLightSchema = joi_1.default.object({
color: joi_1.default.alternatives([joi_1.default.number().unsafe(), joi_1.default.string()]),
intensity: joi_1.default.number().unsafe()
const cameraSchema = zod_1.z.record(zod_1.z.union([perspectiveCameraSchema, orthographicCameraSchema]));
const ambientLightSchema = zod_1.z.object({
color: zod_1.z.union([zod_1.z.number(), zod_1.z.string()]),
intensity: zod_1.z.number()
});
const directionalLightSchema = joi_1.default.object({
color: joi_1.default.alternatives([joi_1.default.number().unsafe(), joi_1.default.string()]),
intensity: joi_1.default.number().unsafe(),
direction: { x: joi_1.default.number().unsafe(), y: joi_1.default.number().unsafe(), z: joi_1.default.number().unsafe() },
castShadow: joi_1.default.boolean(),
shadowMapResolution: joi_1.default.number().unsafe().optional(),
shadowMapBias: joi_1.default.number().unsafe().optional()
const directionalLightSchema = zod_1.z.object({
color: zod_1.z.union([zod_1.z.number(), zod_1.z.string()]),
intensity: zod_1.z.number(),
direction: zod_1.z.object({ x: zod_1.z.number(), y: zod_1.z.number(), z: zod_1.z.number() }),
castShadow: zod_1.z.boolean(),
shadowMapResolution: zod_1.z.number().optional(),
shadowMapBias: zod_1.z.number().optional()
});
const hemisphereLightSchema = joi_1.default.object({
skyColor: joi_1.default.alternatives([joi_1.default.number().unsafe(), joi_1.default.string()]),
intensity: joi_1.default.number().unsafe(),
groundColor: joi_1.default.alternatives([joi_1.default.number().unsafe(), joi_1.default.string()]),
const hemisphereLightSchema = zod_1.z.object({
skyColor: zod_1.z.union([zod_1.z.number(), zod_1.z.string()]),
intensity: zod_1.z.number(),
groundColor: zod_1.z.union([zod_1.z.number(), zod_1.z.string()]),
});
const pointLightSchema = joi_1.default.object({
color: joi_1.default.alternatives([joi_1.default.number().unsafe(), joi_1.default.string()]),
intensity: joi_1.default.number().unsafe(),
position: { x: joi_1.default.number().unsafe(), y: joi_1.default.number().unsafe(), z: joi_1.default.number().unsafe() },
distance: joi_1.default.number().unsafe(),
decay: joi_1.default.number().unsafe(),
const pointLightSchema = zod_1.z.object({
color: zod_1.z.union([zod_1.z.number(), zod_1.z.string()]),
intensity: zod_1.z.number(),
position: zod_1.z.object({ x: zod_1.z.number(), y: zod_1.z.number(), z: zod_1.z.number() }),
distance: zod_1.z.number(),
decay: zod_1.z.number(),
});
const spotLightSchema = joi_1.default.object({
color: joi_1.default.alternatives([joi_1.default.number().unsafe(), joi_1.default.string()]),
intensity: joi_1.default.number().unsafe(),
position: { x: joi_1.default.number().unsafe(), y: joi_1.default.number().unsafe(), z: joi_1.default.number().unsafe() },
target: { x: joi_1.default.number().unsafe(), y: joi_1.default.number().unsafe(), z: joi_1.default.number().unsafe() },
distance: joi_1.default.number().unsafe(),
decay: joi_1.default.number().unsafe(),
angle: joi_1.default.number().unsafe(),
penumbra: joi_1.default.number().unsafe(),
const spotLightSchema = zod_1.z.object({
color: zod_1.z.union([zod_1.z.number(), zod_1.z.string()]),
intensity: zod_1.z.number(),
position: zod_1.z.object({ x: zod_1.z.number(), y: zod_1.z.number(), z: zod_1.z.number() }),
target: zod_1.z.object({ x: zod_1.z.number(), y: zod_1.z.number(), z: zod_1.z.number() }),
distance: zod_1.z.number(),
decay: zod_1.z.number(),
angle: zod_1.z.number(),
penumbra: zod_1.z.number(),
});
const lightSchema = joi_1.default.object().pattern(/^/, [
joi_1.default.object({
name: joi_1.default.string().optional(),
lights: joi_1.default.object().pattern(/^/, [
joi_1.default.object({
name: joi_1.default.string().optional(),
type: joi_1.default.string(),
order: joi_1.default.number().unsafe().optional(),
properties: joi_1.default.alternatives([ambientLightSchema, directionalLightSchema, hemisphereLightSchema, pointLightSchema, spotLightSchema])
})
])
})
]);
const schema = joi_1.default.object({
build_date: joi_1.default.string().allow('').optional(),
build_version: joi_1.default.string().allow('').optional(),
settings_version: joi_1.default.string(),
ar: joi_1.default.object({
enable: joi_1.default.boolean(),
autoScaling: joi_1.default.boolean(),
const lightSchema = zod_1.z.record(zod_1.z.object({
name: zod_1.z.string().optional(),
lights: zod_1.z.record(zod_1.z.object({
name: zod_1.z.string().optional(),
type: zod_1.z.string(),
order: zod_1.z.number().optional(),
properties: zod_1.z.union([ambientLightSchema, directionalLightSchema, hemisphereLightSchema, pointLightSchema, spotLightSchema])
}))
}));
const schema = zod_1.z.object({
build_date: zod_1.z.string().optional(),
build_version: zod_1.z.string().optional(),
settings_version: zod_1.z.string(),
ar: zod_1.z.object({
enable: zod_1.z.boolean(),
autoScaling: zod_1.z.boolean(),
}).optional(),
camera: {
cameraId: joi_1.default.string().allow(''),
camera: zod_1.z.object({
cameraId: zod_1.z.string(),
cameras: cameraSchema
},
environment: {
clearAlpha: joi_1.default.number().unsafe(),
clearColor: joi_1.default.string(),
map: joi_1.default.alternatives([joi_1.default.string().allow(''), joi_1.default.array().items(joi_1.default.string())]),
mapAsBackground: joi_1.default.boolean(),
mapResolution: joi_1.default.string()
},
environmentGeometry: {
gridColor: joi_1.default.string(),
gridVisibility: joi_1.default.boolean(),
groundPlaneColor: joi_1.default.string(),
groundPlaneVisibility: joi_1.default.boolean(),
groundPlaneShadowColor: joi_1.default.string(),
groundPlaneShadowVisibility: joi_1.default.boolean(),
},
general: {
transformation: {
scale: { x: joi_1.default.number().unsafe(), y: joi_1.default.number().unsafe(), z: joi_1.default.number().unsafe() },
translation: { x: joi_1.default.number().unsafe(), y: joi_1.default.number().unsafe(), z: joi_1.default.number().unsafe() },
rotation: { x: joi_1.default.number().unsafe(), y: joi_1.default.number().unsafe(), z: joi_1.default.number().unsafe() }
},
blurWhenBusy: joi_1.default.boolean(),
commitSettings: joi_1.default.boolean(),
commitParameters: joi_1.default.boolean(),
pointSize: joi_1.default.number().unsafe(),
showMessages: joi_1.default.boolean(),
},
light: {
lightSceneId: joi_1.default.string().allow('').optional(),
}),
environment: zod_1.z.object({
clearAlpha: zod_1.z.number(),
clearColor: zod_1.z.string(),
map: zod_1.z.union([zod_1.z.string(), zod_1.z.string().array()]),
mapAsBackground: zod_1.z.boolean(),
mapResolution: zod_1.z.string()
}),
environmentGeometry: zod_1.z.object({
gridColor: zod_1.z.string(),
gridVisibility: zod_1.z.boolean(),
groundPlaneColor: zod_1.z.string(),
groundPlaneVisibility: zod_1.z.boolean(),
groundPlaneShadowColor: zod_1.z.string(),
groundPlaneShadowVisibility: zod_1.z.boolean(),
}),
general: zod_1.z.object({
transformation: zod_1.z.object({
scale: zod_1.z.object({ x: zod_1.z.number(), y: zod_1.z.number(), z: zod_1.z.number() }),
translation: zod_1.z.object({ x: zod_1.z.number(), y: zod_1.z.number(), z: zod_1.z.number() }),
rotation: zod_1.z.object({ x: zod_1.z.number(), y: zod_1.z.number(), z: zod_1.z.number() })
}),
blurWhenBusy: zod_1.z.boolean(),
commitSettings: zod_1.z.boolean(),
commitParameters: zod_1.z.boolean(),
pointSize: zod_1.z.number(),
showMessages: zod_1.z.boolean(),
}),
light: zod_1.z.object({
lightSceneId: zod_1.z.string().optional(),
lightScenes: lightSchema,
},
rendering: {
ambientOcclusion: joi_1.default.boolean(),
ambientOcclusionIntensity: joi_1.default.number().unsafe().min(0),
automaticColorAdjustment: joi_1.default.boolean(),
beautyRenderDelay: joi_1.default.number().unsafe(),
beautyRenderBlendingDuration: joi_1.default.number().unsafe(),
lights: joi_1.default.boolean(),
outputEncoding: joi_1.default.string(),
physicallyCorrectLights: joi_1.default.boolean(),
shadows: joi_1.default.boolean(),
textureEncoding: joi_1.default.string(),
toneMapping: joi_1.default.string(),
toneMappingExposure: joi_1.default.number().unsafe(),
},
session: joi_1.default.object().pattern(/^/, [
joi_1.default.object({
order: joi_1.default.number().unsafe().optional(),
displayname: joi_1.default.string().allow('').optional(),
hidden: joi_1.default.boolean().optional()
})
]),
}).options({ presence: 'required' });
}),
rendering: zod_1.z.object({
ambientOcclusion: zod_1.z.boolean(),
ambientOcclusionIntensity: zod_1.z.number().min(0),
automaticColorAdjustment: zod_1.z.boolean(),
beautyRenderDelay: zod_1.z.number(),
beautyRenderBlendingDuration: zod_1.z.number(),
lights: zod_1.z.boolean(),
outputEncoding: zod_1.z.string(),
physicallyCorrectLights: zod_1.z.boolean(),
shadows: zod_1.z.boolean(),
textureEncoding: zod_1.z.string(),
toneMapping: zod_1.z.string(),
toneMappingExposure: zod_1.z.number(),
}),
session: zod_1.z.record(zod_1.z.object({
order: zod_1.z.number().optional(),
displayname: zod_1.z.string().optional(),
hidden: zod_1.z.boolean().optional()
})),
}).strict().required();
const validate = (s) => {
const result = joi_1.default.attempt(s, schema);
s = result.value;
const result = schema.parse(s);
s = result;
};
exports.validate = validate;
//# sourceMappingURL=Validator.js.map
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.validate = void 0;
const joi_1 = __importDefault(require("joi"));
const orbitControlsSchema = joi_1.default.object({
autoRotationSpeed: joi_1.default.number().unsafe(),
damping: joi_1.default.number().unsafe(),
enableAutoRotation: joi_1.default.boolean(),
enableKeyPan: joi_1.default.boolean(),
enablePan: joi_1.default.boolean(),
enableRotation: joi_1.default.boolean(),
enableZoom: joi_1.default.boolean(),
input: { keys: { up: joi_1.default.number().unsafe(), down: joi_1.default.number().unsafe(), left: joi_1.default.number().unsafe(), right: joi_1.default.number().unsafe() }, mouse: { rotate: joi_1.default.number().unsafe(), zoom: joi_1.default.number().unsafe(), pan: joi_1.default.number().unsafe() }, touch: { rotate: joi_1.default.number().unsafe(), zoom: joi_1.default.number().unsafe(), pan: joi_1.default.number().unsafe() }, },
keyPanSpeed: joi_1.default.number().unsafe(),
movementSmoothness: joi_1.default.number().unsafe(),
restrictions: joi_1.default.object({
position: {
cube: { min: { x: joi_1.default.number().unsafe().allow(-Infinity).allow(null), y: joi_1.default.number().unsafe().allow(-Infinity).allow(null), z: joi_1.default.number().unsafe().allow(-Infinity).allow(null) }, max: { x: joi_1.default.number().unsafe().allow(Infinity).allow(null), y: joi_1.default.number().unsafe().allow(Infinity).allow(null), z: joi_1.default.number().unsafe().allow(Infinity).allow(null) } },
sphere: { center: { x: joi_1.default.number().unsafe(), y: joi_1.default.number().unsafe(), z: joi_1.default.number().unsafe() }, radius: joi_1.default.number().unsafe().allow(Infinity).allow(null) },
},
target: {
cube: { min: { x: joi_1.default.number().unsafe().allow(-Infinity).allow(null), y: joi_1.default.number().unsafe().allow(-Infinity).allow(null), z: joi_1.default.number().unsafe().allow(-Infinity).allow(null) }, max: { x: joi_1.default.number().unsafe().allow(Infinity).allow(null), y: joi_1.default.number().unsafe().allow(Infinity).allow(null), z: joi_1.default.number().unsafe().allow(Infinity).allow(null) } },
sphere: { center: { x: joi_1.default.number().unsafe(), y: joi_1.default.number().unsafe(), z: joi_1.default.number().unsafe() }, radius: joi_1.default.number().unsafe().allow(Infinity).allow(null) },
},
rotation: { minPolarAngle: joi_1.default.number().unsafe(), maxPolarAngle: joi_1.default.number().unsafe(), minAzimuthAngle: joi_1.default.number().unsafe().allow(-Infinity).allow(null), maxAzimuthAngle: joi_1.default.number().unsafe().allow(Infinity).allow(null) },
zoom: { minDistance: joi_1.default.number().unsafe(), maxDistance: joi_1.default.number().unsafe().allow(Infinity).allow(null) },
const zod_1 = require("zod");
const orbitControlsSchema = zod_1.z.object({
autoRotationSpeed: zod_1.z.number(),
damping: zod_1.z.number(),
enableAutoRotation: zod_1.z.boolean(),
enableKeyPan: zod_1.z.boolean(),
enablePan: zod_1.z.boolean(),
enableRotation: zod_1.z.boolean(),
enableZoom: zod_1.z.boolean(),
input: zod_1.z.object({ keys: zod_1.z.object({ up: zod_1.z.number(), down: zod_1.z.number(), left: zod_1.z.number(), right: zod_1.z.number() }), mouse: zod_1.z.object({ rotate: zod_1.z.number(), zoom: zod_1.z.number(), pan: zod_1.z.number() }), touch: zod_1.z.object({ rotate: zod_1.z.number(), zoom: zod_1.z.number(), pan: zod_1.z.number() }), }),
keyPanSpeed: zod_1.z.number(),
movementSmoothness: zod_1.z.number(),
restrictions: zod_1.z.object({
position: zod_1.z.object({
cube: zod_1.z.object({ min: zod_1.z.object({ x: zod_1.z.number().nullable(), y: zod_1.z.number().nullable(), z: zod_1.z.number().nullable() }), max: zod_1.z.object({ x: zod_1.z.number().nullable(), y: zod_1.z.number().nullable(), z: zod_1.z.number().nullable() }) }),
sphere: zod_1.z.object({ center: zod_1.z.object({ x: zod_1.z.number(), y: zod_1.z.number(), z: zod_1.z.number() }), radius: zod_1.z.number().nullable() }),
}),
target: zod_1.z.object({
cube: zod_1.z.object({ min: zod_1.z.object({ x: zod_1.z.number().nullable(), y: zod_1.z.number().nullable(), z: zod_1.z.number().nullable() }), max: zod_1.z.object({ x: zod_1.z.number().nullable(), y: zod_1.z.number().nullable(), z: zod_1.z.number().nullable() }) }),
sphere: zod_1.z.object({ center: zod_1.z.object({ x: zod_1.z.number(), y: zod_1.z.number(), z: zod_1.z.number() }), radius: zod_1.z.number().nullable() }),
}),
rotation: zod_1.z.object({ minPolarAngle: zod_1.z.number(), maxPolarAngle: zod_1.z.number(), minAzimuthAngle: zod_1.z.number().nullable(), maxAzimuthAngle: zod_1.z.number().nullable() }),
zoom: zod_1.z.object({ minDistance: zod_1.z.number(), maxDistance: zod_1.z.number().nullable() }),
}),
rotationSpeed: joi_1.default.number().unsafe(),
panSpeed: joi_1.default.number().unsafe(),
zoomSpeed: joi_1.default.number().unsafe(),
rotationSpeed: zod_1.z.number(),
panSpeed: zod_1.z.number(),
zoomSpeed: zod_1.z.number(),
});
const orthographicControlsSchema = joi_1.default.object({
damping: joi_1.default.number().unsafe(),
enableKeyPan: joi_1.default.boolean(),
enablePan: joi_1.default.boolean(),
enableZoom: joi_1.default.boolean(),
input: { keys: { up: joi_1.default.number().unsafe(), down: joi_1.default.number().unsafe(), left: joi_1.default.number().unsafe(), right: joi_1.default.number().unsafe() }, mouse: { rotate: joi_1.default.number().unsafe(), zoom: joi_1.default.number().unsafe(), pan: joi_1.default.number().unsafe() }, touch: { rotate: joi_1.default.number().unsafe(), zoom: joi_1.default.number().unsafe(), pan: joi_1.default.number().unsafe() }, },
keyPanSpeed: joi_1.default.number().unsafe(),
movementSmoothness: joi_1.default.number().unsafe(),
panSpeed: joi_1.default.number().unsafe(),
zoomSpeed: joi_1.default.number().unsafe(),
const orthographicControlsSchema = zod_1.z.object({
damping: zod_1.z.number(),
enableKeyPan: zod_1.z.boolean(),
enablePan: zod_1.z.boolean(),
enableZoom: zod_1.z.boolean(),
input: zod_1.z.object({ keys: zod_1.z.object({ up: zod_1.z.number(), down: zod_1.z.number(), left: zod_1.z.number(), right: zod_1.z.number() }), mouse: zod_1.z.object({ rotate: zod_1.z.number(), zoom: zod_1.z.number(), pan: zod_1.z.number() }), touch: zod_1.z.object({ rotate: zod_1.z.number(), zoom: zod_1.z.number(), pan: zod_1.z.number() }), }),
keyPanSpeed: zod_1.z.number(),
movementSmoothness: zod_1.z.number(),
panSpeed: zod_1.z.number(),
zoomSpeed: zod_1.z.number(),
});
const orthographicCameraSchema = joi_1.default.object({
name: joi_1.default.string().optional(),
type: joi_1.default.string(),
autoAdjust: joi_1.default.boolean(),
cameraMovementDuration: joi_1.default.number().unsafe(),
const orthographicCameraSchema = zod_1.z.object({
name: zod_1.z.string().optional(),
type: zod_1.z.string(),
autoAdjust: zod_1.z.boolean(),
cameraMovementDuration: zod_1.z.number(),
controls: orthographicControlsSchema,
enableCameraControls: joi_1.default.boolean(),
position: { x: joi_1.default.number().unsafe().allow(null), y: joi_1.default.number().unsafe().allow(null), z: joi_1.default.number().unsafe().allow(null) },
revertAtMouseUp: joi_1.default.boolean(),
revertAtMouseUpDuration: joi_1.default.number().unsafe(),
target: { x: joi_1.default.number().unsafe().allow(null), y: joi_1.default.number().unsafe().allow(null), z: joi_1.default.number().unsafe().allow(null) },
zoomExtentsFactor: joi_1.default.number().unsafe().positive(),
enableCameraControls: zod_1.z.boolean(),
position: zod_1.z.object({ x: zod_1.z.number().nullable(), y: zod_1.z.number().nullable(), z: zod_1.z.number().nullable() }),
revertAtMouseUp: zod_1.z.boolean(),
revertAtMouseUpDuration: zod_1.z.number(),
target: zod_1.z.object({ x: zod_1.z.number().nullable(), y: zod_1.z.number().nullable(), z: zod_1.z.number().nullable() }),
zoomExtentsFactor: zod_1.z.number().positive(),
});
const perspectiveCameraSchema = joi_1.default.object({
name: joi_1.default.string().optional(),
type: joi_1.default.string(),
autoAdjust: joi_1.default.boolean(),
cameraMovementDuration: joi_1.default.number().unsafe(),
const perspectiveCameraSchema = zod_1.z.object({
name: zod_1.z.string().optional(),
type: zod_1.z.string(),
autoAdjust: zod_1.z.boolean(),
cameraMovementDuration: zod_1.z.number(),
controls: orbitControlsSchema,
enableCameraControls: joi_1.default.boolean(),
fov: joi_1.default.number().unsafe().positive(),
position: { x: joi_1.default.number().unsafe().allow(null), y: joi_1.default.number().unsafe().allow(null), z: joi_1.default.number().unsafe().allow(null) },
revertAtMouseUp: joi_1.default.boolean(),
revertAtMouseUpDuration: joi_1.default.number().unsafe(),
target: { x: joi_1.default.number().unsafe().allow(null), y: joi_1.default.number().unsafe().allow(null), z: joi_1.default.number().unsafe().allow(null) },
zoomExtentsFactor: joi_1.default.number().unsafe().positive(),
enableCameraControls: zod_1.z.boolean(),
fov: zod_1.z.number().positive(),
position: zod_1.z.object({ x: zod_1.z.number().nullable(), y: zod_1.z.number().nullable(), z: zod_1.z.number().nullable() }),
revertAtMouseUp: zod_1.z.boolean(),
revertAtMouseUpDuration: zod_1.z.number(),
target: zod_1.z.object({ x: zod_1.z.number().nullable(), y: zod_1.z.number().nullable(), z: zod_1.z.number().nullable() }),
zoomExtentsFactor: zod_1.z.number().positive(),
});
const cameraSchema = joi_1.default.object().pattern(/^/, [perspectiveCameraSchema, orthographicCameraSchema]);
const ambientLightSchema = joi_1.default.object({
color: joi_1.default.alternatives([joi_1.default.number().unsafe(), joi_1.default.string()]),
intensity: joi_1.default.number().unsafe()
const cameraSchema = zod_1.z.record(zod_1.z.union([perspectiveCameraSchema, orthographicCameraSchema]));
const ambientLightSchema = zod_1.z.object({
color: zod_1.z.union([zod_1.z.number(), zod_1.z.string()]),
intensity: zod_1.z.number()
});
const directionalLightSchema = joi_1.default.object({
color: joi_1.default.alternatives([joi_1.default.number().unsafe(), joi_1.default.string()]),
intensity: joi_1.default.number().unsafe(),
direction: { x: joi_1.default.number().unsafe(), y: joi_1.default.number().unsafe(), z: joi_1.default.number().unsafe() },
castShadow: joi_1.default.boolean(),
shadowMapResolution: joi_1.default.number().unsafe().optional(),
shadowMapBias: joi_1.default.number().unsafe().optional()
const directionalLightSchema = zod_1.z.object({
color: zod_1.z.union([zod_1.z.number(), zod_1.z.string()]),
intensity: zod_1.z.number(),
direction: zod_1.z.object({ x: zod_1.z.number(), y: zod_1.z.number(), z: zod_1.z.number() }),
castShadow: zod_1.z.boolean(),
shadowMapResolution: zod_1.z.number().optional(),
shadowMapBias: zod_1.z.number().optional()
});
const hemisphereLightSchema = joi_1.default.object({
skyColor: joi_1.default.alternatives([joi_1.default.number().unsafe(), joi_1.default.string()]),
intensity: joi_1.default.number().unsafe(),
groundColor: joi_1.default.alternatives([joi_1.default.number().unsafe(), joi_1.default.string()]),
const hemisphereLightSchema = zod_1.z.object({
skyColor: zod_1.z.union([zod_1.z.number(), zod_1.z.string()]),
intensity: zod_1.z.number(),
groundColor: zod_1.z.union([zod_1.z.number(), zod_1.z.string()]),
});
const pointLightSchema = joi_1.default.object({
color: joi_1.default.alternatives([joi_1.default.number().unsafe(), joi_1.default.string()]),
intensity: joi_1.default.number().unsafe(),
position: { x: joi_1.default.number().unsafe(), y: joi_1.default.number().unsafe(), z: joi_1.default.number().unsafe() },
distance: joi_1.default.number().unsafe(),
decay: joi_1.default.number().unsafe(),
const pointLightSchema = zod_1.z.object({
color: zod_1.z.union([zod_1.z.number(), zod_1.z.string()]),
intensity: zod_1.z.number(),
position: zod_1.z.object({ x: zod_1.z.number(), y: zod_1.z.number(), z: zod_1.z.number() }),
distance: zod_1.z.number(),
decay: zod_1.z.number(),
});
const spotLightSchema = joi_1.default.object({
color: joi_1.default.alternatives([joi_1.default.number().unsafe(), joi_1.default.string()]),
intensity: joi_1.default.number().unsafe(),
position: { x: joi_1.default.number().unsafe(), y: joi_1.default.number().unsafe(), z: joi_1.default.number().unsafe() },
target: { x: joi_1.default.number().unsafe(), y: joi_1.default.number().unsafe(), z: joi_1.default.number().unsafe() },
distance: joi_1.default.number().unsafe(),
decay: joi_1.default.number().unsafe(),
angle: joi_1.default.number().unsafe(),
penumbra: joi_1.default.number().unsafe(),
const spotLightSchema = zod_1.z.object({
color: zod_1.z.union([zod_1.z.number(), zod_1.z.string()]),
intensity: zod_1.z.number(),
position: zod_1.z.object({ x: zod_1.z.number(), y: zod_1.z.number(), z: zod_1.z.number() }),
target: zod_1.z.object({ x: zod_1.z.number(), y: zod_1.z.number(), z: zod_1.z.number() }),
distance: zod_1.z.number(),
decay: zod_1.z.number(),
angle: zod_1.z.number(),
penumbra: zod_1.z.number(),
});
const lightSchema = joi_1.default.object().pattern(/^/, [
joi_1.default.object({
name: joi_1.default.string().optional(),
lights: joi_1.default.object().pattern(/^/, [
joi_1.default.object({
name: joi_1.default.string().optional(),
type: joi_1.default.string(),
order: joi_1.default.number().unsafe().optional(),
properties: joi_1.default.alternatives([ambientLightSchema, directionalLightSchema, hemisphereLightSchema, pointLightSchema, spotLightSchema])
})
])
})
]);
const schema = joi_1.default.object({
build_date: joi_1.default.string().allow('').optional(),
build_version: joi_1.default.string().allow('').optional(),
settings_version: joi_1.default.string(),
ar: joi_1.default.object({
enable: joi_1.default.boolean(),
autoScaling: joi_1.default.boolean(),
const lightSchema = zod_1.z.record(zod_1.z.object({
name: zod_1.z.string().optional(),
lights: zod_1.z.record(zod_1.z.object({
name: zod_1.z.string().optional(),
type: zod_1.z.string(),
order: zod_1.z.number().optional(),
properties: zod_1.z.union([ambientLightSchema, directionalLightSchema, hemisphereLightSchema, pointLightSchema, spotLightSchema])
}))
}));
const schema = zod_1.z.object({
build_date: zod_1.z.string().optional(),
build_version: zod_1.z.string().optional(),
settings_version: zod_1.z.string(),
ar: zod_1.z.object({
enable: zod_1.z.boolean(),
autoScaling: zod_1.z.boolean(),
}).optional(),
camera: {
cameraId: joi_1.default.string().allow(''),
camera: zod_1.z.object({
cameraId: zod_1.z.string(),
cameras: cameraSchema
},
environment: {
clearAlpha: joi_1.default.number().unsafe(),
clearColor: joi_1.default.string(),
map: joi_1.default.alternatives([joi_1.default.string().allow(''), joi_1.default.array().items(joi_1.default.string())]),
mapAsBackground: joi_1.default.boolean(),
mapResolution: joi_1.default.string(),
rotation: { x: joi_1.default.number().unsafe(), y: joi_1.default.number().unsafe(), z: joi_1.default.number().unsafe(), w: joi_1.default.number().unsafe() },
blurriness: joi_1.default.number().unsafe(),
intensity: joi_1.default.number().unsafe(),
},
environmentGeometry: {
gridColor: joi_1.default.string(),
gridVisibility: joi_1.default.boolean(),
groundPlaneColor: joi_1.default.string(),
groundPlaneVisibility: joi_1.default.boolean(),
groundPlaneShadowColor: joi_1.default.string(),
groundPlaneShadowVisibility: joi_1.default.boolean(),
},
general: {
transformation: {
scale: { x: joi_1.default.number().unsafe(), y: joi_1.default.number().unsafe(), z: joi_1.default.number().unsafe() },
translation: { x: joi_1.default.number().unsafe(), y: joi_1.default.number().unsafe(), z: joi_1.default.number().unsafe() },
rotation: { x: joi_1.default.number().unsafe(), y: joi_1.default.number().unsafe(), z: joi_1.default.number().unsafe() }
},
blurWhenBusy: joi_1.default.boolean(),
commitSettings: joi_1.default.boolean(),
commitParameters: joi_1.default.boolean(),
pointSize: joi_1.default.number().unsafe(),
showMessages: joi_1.default.boolean(),
defaultMaterialColor: joi_1.default.string(),
},
light: {
lightSceneId: joi_1.default.string().allow('').optional(),
}),
environment: zod_1.z.object({
clearAlpha: zod_1.z.number(),
clearColor: zod_1.z.string(),
map: zod_1.z.union([zod_1.z.string(), zod_1.z.string().array()]),
mapAsBackground: zod_1.z.boolean(),
mapResolution: zod_1.z.string(),
rotation: zod_1.z.object({ x: zod_1.z.number(), y: zod_1.z.number(), z: zod_1.z.number(), w: zod_1.z.number() }),
blurriness: zod_1.z.number(),
intensity: zod_1.z.number(),
}),
environmentGeometry: zod_1.z.object({
gridColor: zod_1.z.string(),
gridVisibility: zod_1.z.boolean(),
groundPlaneColor: zod_1.z.string(),
groundPlaneVisibility: zod_1.z.boolean(),
groundPlaneShadowColor: zod_1.z.string(),
groundPlaneShadowVisibility: zod_1.z.boolean(),
}),
general: zod_1.z.object({
transformation: zod_1.z.object({
scale: zod_1.z.object({ x: zod_1.z.number(), y: zod_1.z.number(), z: zod_1.z.number() }),
translation: zod_1.z.object({ x: zod_1.z.number(), y: zod_1.z.number(), z: zod_1.z.number() }),
rotation: zod_1.z.object({ x: zod_1.z.number(), y: zod_1.z.number(), z: zod_1.z.number() })
}),
blurWhenBusy: zod_1.z.boolean(),
commitSettings: zod_1.z.boolean(),
commitParameters: zod_1.z.boolean(),
pointSize: zod_1.z.number(),
showMessages: zod_1.z.boolean(),
defaultMaterialColor: zod_1.z.string(),
}),
light: zod_1.z.object({
lightSceneId: zod_1.z.string().optional(),
lightScenes: lightSchema,
},
rendering: {
ambientOcclusion: joi_1.default.boolean(),
ambientOcclusionIntensity: joi_1.default.number().unsafe().min(0),
automaticColorAdjustment: joi_1.default.boolean(),
beautyRenderDelay: joi_1.default.number().unsafe(),
beautyRenderBlendingDuration: joi_1.default.number().unsafe(),
lights: joi_1.default.boolean(),
outputEncoding: joi_1.default.string(),
physicallyCorrectLights: joi_1.default.boolean(),
shadows: joi_1.default.boolean(),
textureEncoding: joi_1.default.string(),
toneMapping: joi_1.default.string(),
toneMappingExposure: joi_1.default.number().unsafe(),
},
session: joi_1.default.object().pattern(/^/, [
joi_1.default.object({
order: joi_1.default.number().unsafe().optional(),
displayname: joi_1.default.string().allow('').optional(),
hidden: joi_1.default.boolean().optional()
})
]),
}).options({ presence: 'required' });
}),
rendering: zod_1.z.object({
ambientOcclusion: zod_1.z.boolean(),
ambientOcclusionIntensity: zod_1.z.number().min(0),
automaticColorAdjustment: zod_1.z.boolean(),
beautyRenderDelay: zod_1.z.number(),
beautyRenderBlendingDuration: zod_1.z.number(),
lights: zod_1.z.boolean(),
outputEncoding: zod_1.z.string(),
physicallyCorrectLights: zod_1.z.boolean(),
shadows: zod_1.z.boolean(),
textureEncoding: zod_1.z.string(),
toneMapping: zod_1.z.string(),
toneMappingExposure: zod_1.z.number(),
}),
session: zod_1.z.record(zod_1.z.object({
order: zod_1.z.number().optional(),
displayname: zod_1.z.string().optional(),
hidden: zod_1.z.boolean().optional()
})),
}).strict().required();
const validate = (s) => {
const result = joi_1.default.attempt(s, schema);
s = result.value;
const result = schema.parse(s);
s = result;
};
exports.validate = validate;
//# sourceMappingURL=Validator.js.map
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.validate = void 0;
const joi_1 = __importDefault(require("joi"));
const orbitControlsSchema = joi_1.default.object({
autoRotationSpeed: joi_1.default.number().unsafe(),
damping: joi_1.default.number().unsafe(),
enableAutoRotation: joi_1.default.boolean(),
enableKeyPan: joi_1.default.boolean(),
enablePan: joi_1.default.boolean(),
enableRotation: joi_1.default.boolean(),
enableZoom: joi_1.default.boolean(),
input: { keys: { up: joi_1.default.number().unsafe(), down: joi_1.default.number().unsafe(), left: joi_1.default.number().unsafe(), right: joi_1.default.number().unsafe() }, mouse: { rotate: joi_1.default.number().unsafe(), zoom: joi_1.default.number().unsafe(), pan: joi_1.default.number().unsafe() }, touch: { rotate: joi_1.default.number().unsafe(), zoom: joi_1.default.number().unsafe(), pan: joi_1.default.number().unsafe() }, },
keyPanSpeed: joi_1.default.number().unsafe(),
movementSmoothness: joi_1.default.number().unsafe(),
restrictions: joi_1.default.object({
position: {
cube: { min: { x: joi_1.default.number().unsafe().allow(-Infinity).allow(null), y: joi_1.default.number().unsafe().allow(-Infinity).allow(null), z: joi_1.default.number().unsafe().allow(-Infinity).allow(null) }, max: { x: joi_1.default.number().unsafe().allow(Infinity).allow(null), y: joi_1.default.number().unsafe().allow(Infinity).allow(null), z: joi_1.default.number().unsafe().allow(Infinity).allow(null) } },
sphere: { center: { x: joi_1.default.number().unsafe(), y: joi_1.default.number().unsafe(), z: joi_1.default.number().unsafe() }, radius: joi_1.default.number().unsafe().allow(Infinity).allow(null) },
},
target: {
cube: { min: { x: joi_1.default.number().unsafe().allow(-Infinity).allow(null), y: joi_1.default.number().unsafe().allow(-Infinity).allow(null), z: joi_1.default.number().unsafe().allow(-Infinity).allow(null) }, max: { x: joi_1.default.number().unsafe().allow(Infinity).allow(null), y: joi_1.default.number().unsafe().allow(Infinity).allow(null), z: joi_1.default.number().unsafe().allow(Infinity).allow(null) } },
sphere: { center: { x: joi_1.default.number().unsafe(), y: joi_1.default.number().unsafe(), z: joi_1.default.number().unsafe() }, radius: joi_1.default.number().unsafe().allow(Infinity).allow(null) },
},
rotation: { minPolarAngle: joi_1.default.number().unsafe(), maxPolarAngle: joi_1.default.number().unsafe(), minAzimuthAngle: joi_1.default.number().unsafe().allow(-Infinity).allow(null), maxAzimuthAngle: joi_1.default.number().unsafe().allow(Infinity).allow(null) },
zoom: { minDistance: joi_1.default.number().unsafe(), maxDistance: joi_1.default.number().unsafe().allow(Infinity).allow(null) },
const zod_1 = require("zod");
const orbitControlsSchema = zod_1.z.object({
autoRotationSpeed: zod_1.z.number(),
damping: zod_1.z.number(),
enableAutoRotation: zod_1.z.boolean(),
enableKeyPan: zod_1.z.boolean(),
enablePan: zod_1.z.boolean(),
enableRotation: zod_1.z.boolean(),
enableZoom: zod_1.z.boolean(),
input: zod_1.z.object({ keys: zod_1.z.object({ up: zod_1.z.number(), down: zod_1.z.number(), left: zod_1.z.number(), right: zod_1.z.number() }), mouse: zod_1.z.object({ rotate: zod_1.z.number(), zoom: zod_1.z.number(), pan: zod_1.z.number() }), touch: zod_1.z.object({ rotate: zod_1.z.number(), zoom: zod_1.z.number(), pan: zod_1.z.number() }), }),
keyPanSpeed: zod_1.z.number(),
movementSmoothness: zod_1.z.number(),
restrictions: zod_1.z.object({
position: zod_1.z.object({
cube: zod_1.z.object({ min: zod_1.z.object({ x: zod_1.z.number().nullable(), y: zod_1.z.number().nullable(), z: zod_1.z.number().nullable() }), max: zod_1.z.object({ x: zod_1.z.number().nullable(), y: zod_1.z.number().nullable(), z: zod_1.z.number().nullable() }) }),
sphere: zod_1.z.object({ center: zod_1.z.object({ x: zod_1.z.number(), y: zod_1.z.number(), z: zod_1.z.number() }), radius: zod_1.z.number().nullable() }),
}),
target: zod_1.z.object({
cube: zod_1.z.object({ min: zod_1.z.object({ x: zod_1.z.number().nullable(), y: zod_1.z.number().nullable(), z: zod_1.z.number().nullable() }), max: zod_1.z.object({ x: zod_1.z.number().nullable(), y: zod_1.z.number().nullable(), z: zod_1.z.number().nullable() }) }),
sphere: zod_1.z.object({ center: zod_1.z.object({ x: zod_1.z.number(), y: zod_1.z.number(), z: zod_1.z.number() }), radius: zod_1.z.number().nullable() }),
}),
rotation: zod_1.z.object({ minPolarAngle: zod_1.z.number(), maxPolarAngle: zod_1.z.number(), minAzimuthAngle: zod_1.z.number().nullable(), maxAzimuthAngle: zod_1.z.number().nullable() }),
zoom: zod_1.z.object({ minDistance: zod_1.z.number(), maxDistance: zod_1.z.number().nullable() }),
}),
rotationSpeed: joi_1.default.number().unsafe(),
panSpeed: joi_1.default.number().unsafe(),
zoomSpeed: joi_1.default.number().unsafe(),
rotationSpeed: zod_1.z.number(),
panSpeed: zod_1.z.number(),
zoomSpeed: zod_1.z.number(),
});
const orthographicControlsSchema = joi_1.default.object({
damping: joi_1.default.number().unsafe(),
enableKeyPan: joi_1.default.boolean(),
enablePan: joi_1.default.boolean(),
enableZoom: joi_1.default.boolean(),
input: { keys: { up: joi_1.default.number().unsafe(), down: joi_1.default.number().unsafe(), left: joi_1.default.number().unsafe(), right: joi_1.default.number().unsafe() }, mouse: { rotate: joi_1.default.number().unsafe(), zoom: joi_1.default.number().unsafe(), pan: joi_1.default.number().unsafe() }, touch: { rotate: joi_1.default.number().unsafe(), zoom: joi_1.default.number().unsafe(), pan: joi_1.default.number().unsafe() }, },
keyPanSpeed: joi_1.default.number().unsafe(),
movementSmoothness: joi_1.default.number().unsafe(),
panSpeed: joi_1.default.number().unsafe(),
zoomSpeed: joi_1.default.number().unsafe(),
const orthographicControlsSchema = zod_1.z.object({
damping: zod_1.z.number(),
enableKeyPan: zod_1.z.boolean(),
enablePan: zod_1.z.boolean(),
enableZoom: zod_1.z.boolean(),
input: zod_1.z.object({ keys: zod_1.z.object({ up: zod_1.z.number(), down: zod_1.z.number(), left: zod_1.z.number(), right: zod_1.z.number() }), mouse: zod_1.z.object({ rotate: zod_1.z.number(), zoom: zod_1.z.number(), pan: zod_1.z.number() }), touch: zod_1.z.object({ rotate: zod_1.z.number(), zoom: zod_1.z.number(), pan: zod_1.z.number() }), }),
keyPanSpeed: zod_1.z.number(),
movementSmoothness: zod_1.z.number(),
panSpeed: zod_1.z.number(),
zoomSpeed: zod_1.z.number(),
});
const orthographicCameraSchema = joi_1.default.object({
name: joi_1.default.string().optional(),
type: joi_1.default.string(),
autoAdjust: joi_1.default.boolean(),
cameraMovementDuration: joi_1.default.number().unsafe(),
const orthographicCameraSchema = zod_1.z.object({
name: zod_1.z.string().optional(),
type: zod_1.z.string(),
autoAdjust: zod_1.z.boolean(),
cameraMovementDuration: zod_1.z.number(),
controls: orthographicControlsSchema,
enableCameraControls: joi_1.default.boolean(),
position: { x: joi_1.default.number().unsafe().allow(null), y: joi_1.default.number().unsafe().allow(null), z: joi_1.default.number().unsafe().allow(null) },
revertAtMouseUp: joi_1.default.boolean(),
revertAtMouseUpDuration: joi_1.default.number().unsafe(),
target: { x: joi_1.default.number().unsafe().allow(null), y: joi_1.default.number().unsafe().allow(null), z: joi_1.default.number().unsafe().allow(null) },
zoomExtentsFactor: joi_1.default.number().unsafe().positive(),
enableCameraControls: zod_1.z.boolean(),
position: zod_1.z.object({ x: zod_1.z.number().nullable(), y: zod_1.z.number().nullable(), z: zod_1.z.number().nullable() }),
revertAtMouseUp: zod_1.z.boolean(),
revertAtMouseUpDuration: zod_1.z.number(),
target: zod_1.z.object({ x: zod_1.z.number().nullable(), y: zod_1.z.number().nullable(), z: zod_1.z.number().nullable() }),
zoomExtentsFactor: zod_1.z.number().positive(),
});
const perspectiveCameraSchema = joi_1.default.object({
name: joi_1.default.string().optional(),
type: joi_1.default.string(),
autoAdjust: joi_1.default.boolean(),
cameraMovementDuration: joi_1.default.number().unsafe(),
const perspectiveCameraSchema = zod_1.z.object({
name: zod_1.z.string().optional(),
type: zod_1.z.string(),
autoAdjust: zod_1.z.boolean(),
cameraMovementDuration: zod_1.z.number(),
controls: orbitControlsSchema,
enableCameraControls: joi_1.default.boolean(),
fov: joi_1.default.number().unsafe().positive(),
position: { x: joi_1.default.number().unsafe().allow(null), y: joi_1.default.number().unsafe().allow(null), z: joi_1.default.number().unsafe().allow(null) },
revertAtMouseUp: joi_1.default.boolean(),
revertAtMouseUpDuration: joi_1.default.number().unsafe(),
target: { x: joi_1.default.number().unsafe().allow(null), y: joi_1.default.number().unsafe().allow(null), z: joi_1.default.number().unsafe().allow(null) },
zoomExtentsFactor: joi_1.default.number().unsafe().positive(),
enableCameraControls: zod_1.z.boolean(),
fov: zod_1.z.number().positive(),
position: zod_1.z.object({ x: zod_1.z.number().nullable(), y: zod_1.z.number().nullable(), z: zod_1.z.number().nullable() }),
revertAtMouseUp: zod_1.z.boolean(),
revertAtMouseUpDuration: zod_1.z.number(),
target: zod_1.z.object({ x: zod_1.z.number().nullable(), y: zod_1.z.number().nullable(), z: zod_1.z.number().nullable() }),
zoomExtentsFactor: zod_1.z.number().positive(),
});
const cameraSchema = joi_1.default.object().pattern(/^/, [perspectiveCameraSchema, orthographicCameraSchema]);
const ambientLightSchema = joi_1.default.object({
color: joi_1.default.alternatives([joi_1.default.number().unsafe(), joi_1.default.string()]),
intensity: joi_1.default.number().unsafe()
const cameraSchema = zod_1.z.record(zod_1.z.union([perspectiveCameraSchema, orthographicCameraSchema]));
const ambientLightSchema = zod_1.z.object({
color: zod_1.z.union([zod_1.z.number(), zod_1.z.string()]),
intensity: zod_1.z.number()
});
const directionalLightSchema = joi_1.default.object({
color: joi_1.default.alternatives([joi_1.default.number().unsafe(), joi_1.default.string()]),
intensity: joi_1.default.number().unsafe(),
direction: { x: joi_1.default.number().unsafe(), y: joi_1.default.number().unsafe(), z: joi_1.default.number().unsafe() },
castShadow: joi_1.default.boolean(),
shadowMapResolution: joi_1.default.number().unsafe().optional(),
shadowMapBias: joi_1.default.number().unsafe().optional()
const directionalLightSchema = zod_1.z.object({
color: zod_1.z.union([zod_1.z.number(), zod_1.z.string()]),
intensity: zod_1.z.number(),
direction: zod_1.z.object({ x: zod_1.z.number(), y: zod_1.z.number(), z: zod_1.z.number() }),
castShadow: zod_1.z.boolean(),
shadowMapResolution: zod_1.z.number().optional(),
shadowMapBias: zod_1.z.number().optional()
});
const hemisphereLightSchema = joi_1.default.object({
skyColor: joi_1.default.alternatives([joi_1.default.number().unsafe(), joi_1.default.string()]),
intensity: joi_1.default.number().unsafe(),
groundColor: joi_1.default.alternatives([joi_1.default.number().unsafe(), joi_1.default.string()]),
const hemisphereLightSchema = zod_1.z.object({
skyColor: zod_1.z.union([zod_1.z.number(), zod_1.z.string()]),
intensity: zod_1.z.number(),
groundColor: zod_1.z.union([zod_1.z.number(), zod_1.z.string()]),
});
const pointLightSchema = joi_1.default.object({
color: joi_1.default.alternatives([joi_1.default.number().unsafe(), joi_1.default.string()]),
intensity: joi_1.default.number().unsafe(),
position: { x: joi_1.default.number().unsafe(), y: joi_1.default.number().unsafe(), z: joi_1.default.number().unsafe() },
distance: joi_1.default.number().unsafe(),
decay: joi_1.default.number().unsafe(),
const pointLightSchema = zod_1.z.object({
color: zod_1.z.union([zod_1.z.number(), zod_1.z.string()]),
intensity: zod_1.z.number(),
position: zod_1.z.object({ x: zod_1.z.number(), y: zod_1.z.number(), z: zod_1.z.number() }),
distance: zod_1.z.number(),
decay: zod_1.z.number(),
});
const spotLightSchema = joi_1.default.object({
color: joi_1.default.alternatives([joi_1.default.number().unsafe(), joi_1.default.string()]),
intensity: joi_1.default.number().unsafe(),
position: { x: joi_1.default.number().unsafe(), y: joi_1.default.number().unsafe(), z: joi_1.default.number().unsafe() },
target: { x: joi_1.default.number().unsafe(), y: joi_1.default.number().unsafe(), z: joi_1.default.number().unsafe() },
distance: joi_1.default.number().unsafe(),
decay: joi_1.default.number().unsafe(),
angle: joi_1.default.number().unsafe(),
penumbra: joi_1.default.number().unsafe(),
const spotLightSchema = zod_1.z.object({
color: zod_1.z.union([zod_1.z.number(), zod_1.z.string()]),
intensity: zod_1.z.number(),
position: zod_1.z.object({ x: zod_1.z.number(), y: zod_1.z.number(), z: zod_1.z.number() }),
target: zod_1.z.object({ x: zod_1.z.number(), y: zod_1.z.number(), z: zod_1.z.number() }),
distance: zod_1.z.number(),
decay: zod_1.z.number(),
angle: zod_1.z.number(),
penumbra: zod_1.z.number(),
});
const lightSchema = joi_1.default.object().pattern(/^/, [
joi_1.default.object({
name: joi_1.default.string().optional(),
lights: joi_1.default.object().pattern(/^/, [
joi_1.default.object({
name: joi_1.default.string().optional(),
type: joi_1.default.string(),
order: joi_1.default.number().unsafe().optional(),
properties: joi_1.default.alternatives([ambientLightSchema, directionalLightSchema, hemisphereLightSchema, pointLightSchema, spotLightSchema])
})
])
})
]);
const schema = joi_1.default.object({
build_date: joi_1.default.string().allow('').optional(),
build_version: joi_1.default.string().allow('').optional(),
settings_version: joi_1.default.string(),
ar: joi_1.default.object({
enable: joi_1.default.boolean(),
autoScaling: joi_1.default.boolean(),
const lightSchema = zod_1.z.record(zod_1.z.object({
name: zod_1.z.string().optional(),
lights: zod_1.z.record(zod_1.z.object({
name: zod_1.z.string().optional(),
type: zod_1.z.string(),
order: zod_1.z.number().optional(),
properties: zod_1.z.union([ambientLightSchema, directionalLightSchema, hemisphereLightSchema, pointLightSchema, spotLightSchema])
}))
}));
const schema = zod_1.z.object({
build_date: zod_1.z.string().optional(),
build_version: zod_1.z.string().optional(),
settings_version: zod_1.z.string(),
ar: zod_1.z.object({
enable: zod_1.z.boolean(),
autoScaling: zod_1.z.boolean(),
}).optional(),
camera: {
cameraId: joi_1.default.string().allow(''),
camera: zod_1.z.object({
cameraId: zod_1.z.string(),
cameras: cameraSchema
},
environment: {
clearAlpha: joi_1.default.number().unsafe(),
clearColor: joi_1.default.string(),
map: joi_1.default.alternatives([joi_1.default.string().allow(''), joi_1.default.array().items(joi_1.default.string())]),
mapAsBackground: joi_1.default.boolean(),
mapResolution: joi_1.default.string()
},
environmentGeometry: {
gridVisibility: joi_1.default.boolean(),
groundPlaneVisibility: joi_1.default.boolean(),
},
general: {
transformation: {
scale: { x: joi_1.default.number().unsafe(), y: joi_1.default.number().unsafe(), z: joi_1.default.number().unsafe() },
translation: { x: joi_1.default.number().unsafe(), y: joi_1.default.number().unsafe(), z: joi_1.default.number().unsafe() },
rotation: { x: joi_1.default.number().unsafe(), y: joi_1.default.number().unsafe(), z: joi_1.default.number().unsafe() }
},
blurWhenBusy: joi_1.default.boolean(),
commitSettings: joi_1.default.boolean(),
commitParameters: joi_1.default.boolean(),
pointSize: joi_1.default.number().unsafe(),
showMessages: joi_1.default.boolean(),
},
light: {
lightSceneId: joi_1.default.string().allow('').optional(),
}),
environment: zod_1.z.object({
clearAlpha: zod_1.z.number(),
clearColor: zod_1.z.string(),
map: zod_1.z.union([zod_1.z.string(), zod_1.z.string().array()]),
mapAsBackground: zod_1.z.boolean(),
mapResolution: zod_1.z.string()
}),
environmentGeometry: zod_1.z.object({
gridVisibility: zod_1.z.boolean(),
groundPlaneVisibility: zod_1.z.boolean(),
}),
general: zod_1.z.object({
transformation: zod_1.z.object({
scale: zod_1.z.object({ x: zod_1.z.number(), y: zod_1.z.number(), z: zod_1.z.number() }),
translation: zod_1.z.object({ x: zod_1.z.number(), y: zod_1.z.number(), z: zod_1.z.number() }),
rotation: zod_1.z.object({ x: zod_1.z.number(), y: zod_1.z.number(), z: zod_1.z.number() })
}),
blurWhenBusy: zod_1.z.boolean(),
commitSettings: zod_1.z.boolean(),
commitParameters: zod_1.z.boolean(),
pointSize: zod_1.z.number(),
showMessages: zod_1.z.boolean(),
}),
light: zod_1.z.object({
lightSceneId: zod_1.z.string().optional(),
lightScenes: lightSchema,
},
rendering: {
ambientOcclusion: joi_1.default.boolean(),
ambientOcclusionIntensity: joi_1.default.number().unsafe().min(0),
beautyRenderDelay: joi_1.default.number().unsafe(),
beautyRenderBlendingDuration: joi_1.default.number().unsafe(),
shadows: joi_1.default.boolean(),
},
session: joi_1.default.object().pattern(/^/, [
joi_1.default.object({
order: joi_1.default.number().unsafe().optional(),
displayname: joi_1.default.string().allow('').optional(),
hidden: joi_1.default.boolean().optional()
})
]),
}).options({ presence: 'required' });
}),
rendering: zod_1.z.object({
ambientOcclusion: zod_1.z.boolean(),
ambientOcclusionIntensity: zod_1.z.number().min(0),
beautyRenderDelay: zod_1.z.number(),
beautyRenderBlendingDuration: zod_1.z.number(),
shadows: zod_1.z.boolean(),
}),
session: zod_1.z.record(zod_1.z.object({
order: zod_1.z.number().optional(),
displayname: zod_1.z.string().optional(),
hidden: zod_1.z.boolean().optional()
})),
}).strict().required();
const validate = (s) => {
const result = joi_1.default.attempt(s, schema);
s = result.value;
const result = schema.parse(s);
s = result;
};
exports.validate = validate;
//# sourceMappingURL=Validator.js.map
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.validate = void 0;
const joi_1 = __importDefault(require("joi"));
const orbitControlsSchema = joi_1.default.object({
autoRotationSpeed: joi_1.default.number().unsafe(),
damping: joi_1.default.number().unsafe(),
enableAutoRotation: joi_1.default.boolean(),
enableKeyPan: joi_1.default.boolean(),
enablePan: joi_1.default.boolean(),
enableRotation: joi_1.default.boolean(),
enableZoom: joi_1.default.boolean(),
input: { keys: { up: joi_1.default.number().unsafe(), down: joi_1.default.number().unsafe(), left: joi_1.default.number().unsafe(), right: joi_1.default.number().unsafe() }, mouse: { rotate: joi_1.default.number().unsafe(), zoom: joi_1.default.number().unsafe(), pan: joi_1.default.number().unsafe() }, touch: { rotate: joi_1.default.number().unsafe(), zoom: joi_1.default.number().unsafe(), pan: joi_1.default.number().unsafe() }, },
keyPanSpeed: joi_1.default.number().unsafe(),
movementSmoothness: joi_1.default.number().unsafe(),
restrictions: joi_1.default.object({
position: {
cube: { min: { x: joi_1.default.number().unsafe().allow(-Infinity).allow(null), y: joi_1.default.number().unsafe().allow(-Infinity).allow(null), z: joi_1.default.number().unsafe().allow(-Infinity).allow(null) }, max: { x: joi_1.default.number().unsafe().allow(Infinity).allow(null), y: joi_1.default.number().unsafe().allow(Infinity).allow(null), z: joi_1.default.number().unsafe().allow(Infinity).allow(null) } },
sphere: { center: { x: joi_1.default.number().unsafe(), y: joi_1.default.number().unsafe(), z: joi_1.default.number().unsafe() }, radius: joi_1.default.number().unsafe().allow(Infinity).allow(null) },
},
target: {
cube: { min: { x: joi_1.default.number().unsafe().allow(-Infinity).allow(null), y: joi_1.default.number().unsafe().allow(-Infinity).allow(null), z: joi_1.default.number().unsafe().allow(-Infinity).allow(null) }, max: { x: joi_1.default.number().unsafe().allow(Infinity).allow(null), y: joi_1.default.number().unsafe().allow(Infinity).allow(null), z: joi_1.default.number().unsafe().allow(Infinity).allow(null) } },
sphere: { center: { x: joi_1.default.number().unsafe(), y: joi_1.default.number().unsafe(), z: joi_1.default.number().unsafe() }, radius: joi_1.default.number().unsafe().allow(Infinity).allow(null) },
},
rotation: { minPolarAngle: joi_1.default.number().unsafe(), maxPolarAngle: joi_1.default.number().unsafe(), minAzimuthAngle: joi_1.default.number().unsafe().allow(-Infinity).allow(null), maxAzimuthAngle: joi_1.default.number().unsafe().allow(Infinity).allow(null) },
zoom: { minDistance: joi_1.default.number().unsafe(), maxDistance: joi_1.default.number().unsafe().allow(Infinity).allow(null) },
const zod_1 = require("zod");
const orbitControlsSchema = zod_1.z.object({
autoRotationSpeed: zod_1.z.number(),
damping: zod_1.z.number(),
enableAutoRotation: zod_1.z.boolean(),
enableKeyPan: zod_1.z.boolean(),
enablePan: zod_1.z.boolean(),
enableRotation: zod_1.z.boolean(),
enableZoom: zod_1.z.boolean(),
input: zod_1.z.object({ keys: zod_1.z.object({ up: zod_1.z.number(), down: zod_1.z.number(), left: zod_1.z.number(), right: zod_1.z.number() }), mouse: zod_1.z.object({ rotate: zod_1.z.number(), zoom: zod_1.z.number(), pan: zod_1.z.number() }), touch: zod_1.z.object({ rotate: zod_1.z.number(), zoom: zod_1.z.number(), pan: zod_1.z.number() }), }),
keyPanSpeed: zod_1.z.number(),
movementSmoothness: zod_1.z.number(),
restrictions: zod_1.z.object({
position: zod_1.z.object({
cube: zod_1.z.object({ min: zod_1.z.object({ x: zod_1.z.number().nullable(), y: zod_1.z.number().nullable(), z: zod_1.z.number().nullable() }), max: zod_1.z.object({ x: zod_1.z.number().nullable(), y: zod_1.z.number().nullable(), z: zod_1.z.number().nullable() }) }),
sphere: zod_1.z.object({ center: zod_1.z.object({ x: zod_1.z.number(), y: zod_1.z.number(), z: zod_1.z.number() }), radius: zod_1.z.number().nullable() }),
}),
target: zod_1.z.object({
cube: zod_1.z.object({ min: zod_1.z.object({ x: zod_1.z.number().nullable(), y: zod_1.z.number().nullable(), z: zod_1.z.number().nullable() }), max: zod_1.z.object({ x: zod_1.z.number().nullable(), y: zod_1.z.number().nullable(), z: zod_1.z.number().nullable() }) }),
sphere: zod_1.z.object({ center: zod_1.z.object({ x: zod_1.z.number(), y: zod_1.z.number(), z: zod_1.z.number() }), radius: zod_1.z.number().nullable() }),
}),
rotation: zod_1.z.object({ minPolarAngle: zod_1.z.number(), maxPolarAngle: zod_1.z.number(), minAzimuthAngle: zod_1.z.number().nullable(), maxAzimuthAngle: zod_1.z.number().nullable() }),
zoom: zod_1.z.object({ minDistance: zod_1.z.number(), maxDistance: zod_1.z.number().nullable() }),
}),
rotationSpeed: joi_1.default.number().unsafe(),
panSpeed: joi_1.default.number().unsafe(),
zoomSpeed: joi_1.default.number().unsafe(),
rotationSpeed: zod_1.z.number(),
panSpeed: zod_1.z.number(),
zoomSpeed: zod_1.z.number(),
});
const orthographicControlsSchema = joi_1.default.object({
damping: joi_1.default.number().unsafe(),
enableKeyPan: joi_1.default.boolean(),
enablePan: joi_1.default.boolean(),
enableZoom: joi_1.default.boolean(),
input: { keys: { up: joi_1.default.number().unsafe(), down: joi_1.default.number().unsafe(), left: joi_1.default.number().unsafe(), right: joi_1.default.number().unsafe() }, mouse: { rotate: joi_1.default.number().unsafe(), zoom: joi_1.default.number().unsafe(), pan: joi_1.default.number().unsafe() }, touch: { rotate: joi_1.default.number().unsafe(), zoom: joi_1.default.number().unsafe(), pan: joi_1.default.number().unsafe() }, },
keyPanSpeed: joi_1.default.number().unsafe(),
movementSmoothness: joi_1.default.number().unsafe(),
panSpeed: joi_1.default.number().unsafe(),
zoomSpeed: joi_1.default.number().unsafe(),
const orthographicControlsSchema = zod_1.z.object({
damping: zod_1.z.number(),
enableKeyPan: zod_1.z.boolean(),
enablePan: zod_1.z.boolean(),
enableZoom: zod_1.z.boolean(),
input: zod_1.z.object({ keys: zod_1.z.object({ up: zod_1.z.number(), down: zod_1.z.number(), left: zod_1.z.number(), right: zod_1.z.number() }), mouse: zod_1.z.object({ rotate: zod_1.z.number(), zoom: zod_1.z.number(), pan: zod_1.z.number() }), touch: zod_1.z.object({ rotate: zod_1.z.number(), zoom: zod_1.z.number(), pan: zod_1.z.number() }), }),
keyPanSpeed: zod_1.z.number(),
movementSmoothness: zod_1.z.number(),
panSpeed: zod_1.z.number(),
zoomSpeed: zod_1.z.number(),
});
const orthographicCameraSchema = joi_1.default.object({
name: joi_1.default.string().optional(),
type: joi_1.default.string(),
autoAdjust: joi_1.default.boolean(),
cameraMovementDuration: joi_1.default.number().unsafe(),
const orthographicCameraSchema = zod_1.z.object({
name: zod_1.z.string().optional(),
type: zod_1.z.string(),
autoAdjust: zod_1.z.boolean(),
cameraMovementDuration: zod_1.z.number(),
controls: orthographicControlsSchema,
enableCameraControls: joi_1.default.boolean(),
position: { x: joi_1.default.number().unsafe().allow(null), y: joi_1.default.number().unsafe().allow(null), z: joi_1.default.number().unsafe().allow(null) },
revertAtMouseUp: joi_1.default.boolean(),
revertAtMouseUpDuration: joi_1.default.number().unsafe(),
target: { x: joi_1.default.number().unsafe().allow(null), y: joi_1.default.number().unsafe().allow(null), z: joi_1.default.number().unsafe().allow(null) },
zoomExtentsFactor: joi_1.default.number().unsafe().positive(),
enableCameraControls: zod_1.z.boolean(),
position: zod_1.z.object({ x: zod_1.z.number().nullable(), y: zod_1.z.number().nullable(), z: zod_1.z.number().nullable() }),
revertAtMouseUp: zod_1.z.boolean(),
revertAtMouseUpDuration: zod_1.z.number(),
target: zod_1.z.object({ x: zod_1.z.number().nullable(), y: zod_1.z.number().nullable(), z: zod_1.z.number().nullable() }),
zoomExtentsFactor: zod_1.z.number().positive(),
});
const perspectiveCameraSchema = joi_1.default.object({
name: joi_1.default.string().optional(),
type: joi_1.default.string(),
autoAdjust: joi_1.default.boolean(),
cameraMovementDuration: joi_1.default.number().unsafe(),
const perspectiveCameraSchema = zod_1.z.object({
name: zod_1.z.string().optional(),
type: zod_1.z.string(),
autoAdjust: zod_1.z.boolean(),
cameraMovementDuration: zod_1.z.number(),
controls: orbitControlsSchema,
enableCameraControls: joi_1.default.boolean(),
fov: joi_1.default.number().unsafe().positive(),
position: { x: joi_1.default.number().unsafe().allow(null), y: joi_1.default.number().unsafe().allow(null), z: joi_1.default.number().unsafe().allow(null) },
revertAtMouseUp: joi_1.default.boolean(),
revertAtMouseUpDuration: joi_1.default.number().unsafe(),
target: { x: joi_1.default.number().unsafe().allow(null), y: joi_1.default.number().unsafe().allow(null), z: joi_1.default.number().unsafe().allow(null) },
zoomExtentsFactor: joi_1.default.number().unsafe().positive(),
enableCameraControls: zod_1.z.boolean(),
fov: zod_1.z.number().positive(),
position: zod_1.z.object({ x: zod_1.z.number().nullable(), y: zod_1.z.number().nullable(), z: zod_1.z.number().nullable() }),
revertAtMouseUp: zod_1.z.boolean(),
revertAtMouseUpDuration: zod_1.z.number(),
target: zod_1.z.object({ x: zod_1.z.number().nullable(), y: zod_1.z.number().nullable(), z: zod_1.z.number().nullable() }),
zoomExtentsFactor: zod_1.z.number().positive(),
});
const cameraSchema = joi_1.default.object().pattern(/^/, [perspectiveCameraSchema, orthographicCameraSchema]);
const ambientLightSchema = joi_1.default.object({
color: joi_1.default.alternatives([joi_1.default.number().unsafe(), joi_1.default.string()]),
intensity: joi_1.default.number().unsafe()
const cameraSchema = zod_1.z.record(zod_1.z.union([perspectiveCameraSchema, orthographicCameraSchema]));
const ambientLightSchema = zod_1.z.object({
color: zod_1.z.union([zod_1.z.number(), zod_1.z.string()]),
intensity: zod_1.z.number()
});
const directionalLightSchema = joi_1.default.object({
color: joi_1.default.alternatives([joi_1.default.number().unsafe(), joi_1.default.string()]),
intensity: joi_1.default.number().unsafe(),
direction: { x: joi_1.default.number().unsafe(), y: joi_1.default.number().unsafe(), z: joi_1.default.number().unsafe() },
castShadow: joi_1.default.boolean(),
shadowMapResolution: joi_1.default.number().unsafe().optional(),
shadowMapBias: joi_1.default.number().unsafe().optional()
const directionalLightSchema = zod_1.z.object({
color: zod_1.z.union([zod_1.z.number(), zod_1.z.string()]),
intensity: zod_1.z.number(),
direction: zod_1.z.object({ x: zod_1.z.number(), y: zod_1.z.number(), z: zod_1.z.number() }),
castShadow: zod_1.z.boolean(),
shadowMapResolution: zod_1.z.number().optional(),
shadowMapBias: zod_1.z.number().optional()
});
const hemisphereLightSchema = joi_1.default.object({
skyColor: joi_1.default.alternatives([joi_1.default.number().unsafe(), joi_1.default.string()]),
intensity: joi_1.default.number().unsafe(),
groundColor: joi_1.default.alternatives([joi_1.default.number().unsafe(), joi_1.default.string()]),
const hemisphereLightSchema = zod_1.z.object({
skyColor: zod_1.z.union([zod_1.z.number(), zod_1.z.string()]),
intensity: zod_1.z.number(),
groundColor: zod_1.z.union([zod_1.z.number(), zod_1.z.string()]),
});
const pointLightSchema = joi_1.default.object({
color: joi_1.default.alternatives([joi_1.default.number().unsafe(), joi_1.default.string()]),
intensity: joi_1.default.number().unsafe(),
position: { x: joi_1.default.number().unsafe(), y: joi_1.default.number().unsafe(), z: joi_1.default.number().unsafe() },
distance: joi_1.default.number().unsafe(),
decay: joi_1.default.number().unsafe(),
const pointLightSchema = zod_1.z.object({
color: zod_1.z.union([zod_1.z.number(), zod_1.z.string()]),
intensity: zod_1.z.number(),
position: zod_1.z.object({ x: zod_1.z.number(), y: zod_1.z.number(), z: zod_1.z.number() }),
distance: zod_1.z.number(),
decay: zod_1.z.number(),
});
const spotLightSchema = joi_1.default.object({
color: joi_1.default.alternatives([joi_1.default.number().unsafe(), joi_1.default.string()]),
intensity: joi_1.default.number().unsafe(),
position: { x: joi_1.default.number().unsafe(), y: joi_1.default.number().unsafe(), z: joi_1.default.number().unsafe() },
target: { x: joi_1.default.number().unsafe(), y: joi_1.default.number().unsafe(), z: joi_1.default.number().unsafe() },
distance: joi_1.default.number().unsafe(),
decay: joi_1.default.number().unsafe(),
angle: joi_1.default.number().unsafe(),
penumbra: joi_1.default.number().unsafe(),
const spotLightSchema = zod_1.z.object({
color: zod_1.z.union([zod_1.z.number(), zod_1.z.string()]),
intensity: zod_1.z.number(),
position: zod_1.z.object({ x: zod_1.z.number(), y: zod_1.z.number(), z: zod_1.z.number() }),
target: zod_1.z.object({ x: zod_1.z.number(), y: zod_1.z.number(), z: zod_1.z.number() }),
distance: zod_1.z.number(),
decay: zod_1.z.number(),
angle: zod_1.z.number(),
penumbra: zod_1.z.number(),
});
const lightSchema = joi_1.default.object().pattern(/^/, [
joi_1.default.object({
name: joi_1.default.string().optional(),
lights: joi_1.default.object().pattern(/^/, [
joi_1.default.object({
name: joi_1.default.string().optional(),
type: joi_1.default.string(),
order: joi_1.default.number().unsafe().optional(),
properties: joi_1.default.alternatives([ambientLightSchema, directionalLightSchema, hemisphereLightSchema, pointLightSchema, spotLightSchema])
})
])
})
]);
const bloomEffectSchema = joi_1.default.object({
properties: joi_1.default.object({
blendFunction: joi_1.default.number().unsafe().optional(),
intensity: joi_1.default.number().unsafe().optional(),
kernelSize: joi_1.default.number().unsafe().optional(),
luminanceSmoothing: joi_1.default.number().unsafe().optional(),
luminanceThreshold: joi_1.default.number().unsafe().optional(),
mipmapBlur: joi_1.default.boolean(),
const lightSchema = zod_1.z.record(zod_1.z.object({
name: zod_1.z.string().optional(),
lights: zod_1.z.record(zod_1.z.object({
name: zod_1.z.string().optional(),
type: zod_1.z.string(),
order: zod_1.z.number().optional(),
properties: zod_1.z.union([ambientLightSchema, directionalLightSchema, hemisphereLightSchema, pointLightSchema, spotLightSchema])
}))
}));
const bloomEffectSchema = zod_1.z.object({
properties: zod_1.z.object({
blendFunction: zod_1.z.number().optional(),
intensity: zod_1.z.number().optional(),
kernelSize: zod_1.z.number().optional(),
luminanceSmoothing: zod_1.z.number().optional(),
luminanceThreshold: zod_1.z.number().optional(),
mipmapBlur: zod_1.z.boolean(),
}).optional(),
type: joi_1.default.string()
type: zod_1.z.string()
});
const chromaticAberrationEffectSchema = joi_1.default.object({
properties: joi_1.default.object({
blendFunction: joi_1.default.number().unsafe().optional(),
modulationOffset: joi_1.default.number().unsafe().optional(),
offset: joi_1.default.object({ x: joi_1.default.number().unsafe(), y: joi_1.default.number().unsafe() }).optional(),
radialModulation: joi_1.default.boolean().optional(),
const chromaticAberrationEffectSchema = zod_1.z.object({
properties: zod_1.z.object({
blendFunction: zod_1.z.number().optional(),
modulationOffset: zod_1.z.number().optional(),
offset: zod_1.z.object({ x: zod_1.z.number(), y: zod_1.z.number() }).optional(),
radialModulation: zod_1.z.boolean().optional(),
}).optional(),
type: joi_1.default.string()
type: zod_1.z.string()
});
const depthOfFieldEffectSchema = joi_1.default.object({
properties: joi_1.default.object({
blendFunction: joi_1.default.number().unsafe().optional(),
bokehScale: joi_1.default.number().unsafe().optional(),
focusDistance: joi_1.default.number().unsafe().optional(),
focusRange: joi_1.default.number().unsafe().optional(),
const depthOfFieldEffectSchema = zod_1.z.object({
properties: zod_1.z.object({
blendFunction: zod_1.z.number().optional(),
bokehScale: zod_1.z.number().optional(),
focusDistance: zod_1.z.number().optional(),
focusRange: zod_1.z.number().optional(),
}).optional(),
type: joi_1.default.string()
type: zod_1.z.string()
});
const dotScreenEffectSchema = joi_1.default.object({
properties: joi_1.default.object({
angle: joi_1.default.number().unsafe().optional(),
blendFunction: joi_1.default.number().unsafe().optional(),
scale: joi_1.default.number().unsafe().optional(),
const dotScreenEffectSchema = zod_1.z.object({
properties: zod_1.z.object({
angle: zod_1.z.number().optional(),
blendFunction: zod_1.z.number().optional(),
scale: zod_1.z.number().optional(),
}).optional(),
type: joi_1.default.string()
type: zod_1.z.string()
});
const gridEffectSchema = joi_1.default.object({
properties: joi_1.default.object({
blendFunction: joi_1.default.number().unsafe().optional(),
scale: joi_1.default.number().unsafe().optional(),
const gridEffectSchema = zod_1.z.object({
properties: zod_1.z.object({
blendFunction: zod_1.z.number().optional(),
scale: zod_1.z.number().optional(),
}).optional(),
type: joi_1.default.string()
type: zod_1.z.string()
});
const hbaoEffectSchema = joi_1.default.object({
properties: joi_1.default.object({
resolutionScale: joi_1.default.number().unsafe().optional(),
spp: joi_1.default.number().unsafe().optional(),
distance: joi_1.default.number().unsafe().optional(),
distanceIntensity: joi_1.default.number().unsafe().optional(),
intensity: joi_1.default.number().unsafe().optional(),
color: joi_1.default.string().optional(),
bias: joi_1.default.number().unsafe().optional(),
thickness: joi_1.default.number().unsafe().optional(),
iterations: joi_1.default.number().unsafe().optional(),
radius: joi_1.default.number().unsafe().optional(),
rings: joi_1.default.number().unsafe().optional(),
lumaPhi: joi_1.default.number().unsafe().optional(),
depthPhi: joi_1.default.number().unsafe().optional(),
normalPhi: joi_1.default.number().unsafe().optional(),
samples: joi_1.default.number().unsafe().optional(),
const hbaoEffectSchema = zod_1.z.object({
properties: zod_1.z.object({
resolutionScale: zod_1.z.number().optional(),
spp: zod_1.z.number().optional(),
distance: zod_1.z.number().optional(),
distanceIntensity: zod_1.z.number().optional(),
intensity: zod_1.z.number().optional(),
color: zod_1.z.string().optional(),
bias: zod_1.z.number().optional(),
thickness: zod_1.z.number().optional(),
iterations: zod_1.z.number().optional(),
radius: zod_1.z.number().optional(),
rings: zod_1.z.number().optional(),
lumaPhi: zod_1.z.number().optional(),
depthPhi: zod_1.z.number().optional(),
normalPhi: zod_1.z.number().optional(),
samples: zod_1.z.number().optional(),
}).optional(),
type: joi_1.default.string()
type: zod_1.z.string()
});
const hueSaturationEffectSchema = joi_1.default.object({
properties: joi_1.default.object({
blendFunction: joi_1.default.number().unsafe().optional(),
hue: joi_1.default.number().unsafe().optional(),
saturation: joi_1.default.number().unsafe().optional(),
const hueSaturationEffectSchema = zod_1.z.object({
properties: zod_1.z.object({
blendFunction: zod_1.z.number().optional(),
hue: zod_1.z.number().optional(),
saturation: zod_1.z.number().optional(),
}).optional(),
type: joi_1.default.string()
type: zod_1.z.string()
});
const noiseEffectSchema = joi_1.default.object({
properties: joi_1.default.object({
blendFunction: joi_1.default.number().unsafe().optional(),
premultiply: joi_1.default.boolean().optional(),
const noiseEffectSchema = zod_1.z.object({
properties: zod_1.z.object({
blendFunction: zod_1.z.number().optional(),
premultiply: zod_1.z.boolean().optional(),
}).optional(),
type: joi_1.default.string()
type: zod_1.z.string()
});
const pixelationEffectSchema = joi_1.default.object({
properties: joi_1.default.object({
blendFunction: joi_1.default.number().unsafe().optional(),
granularity: joi_1.default.number().unsafe().optional(),
const pixelationEffectSchema = zod_1.z.object({
properties: zod_1.z.object({
blendFunction: zod_1.z.number().optional(),
granularity: zod_1.z.number().optional(),
}).optional(),
type: joi_1.default.string()
type: zod_1.z.string()
});
const scanlineEffectSchema = joi_1.default.object({
properties: joi_1.default.object({
blendFunction: joi_1.default.number().unsafe().optional(),
density: joi_1.default.number().unsafe().optional(),
const scanlineEffectSchema = zod_1.z.object({
properties: zod_1.z.object({
blendFunction: zod_1.z.number().optional(),
density: zod_1.z.number().optional(),
}).optional(),
type: joi_1.default.string()
type: zod_1.z.string()
});
const ssaoEffectSchema = joi_1.default.object({
properties: joi_1.default.object({
resolutionScale: joi_1.default.number().unsafe().optional(),
spp: joi_1.default.number().unsafe().optional(),
distance: joi_1.default.number().unsafe().optional(),
distanceIntensity: joi_1.default.number().unsafe().optional(),
intensity: joi_1.default.number().unsafe().optional(),
color: joi_1.default.string().optional(),
iterations: joi_1.default.number().unsafe().optional(),
radius: joi_1.default.number().unsafe().optional(),
rings: joi_1.default.number().unsafe().optional(),
lumaPhi: joi_1.default.number().unsafe().optional(),
depthPhi: joi_1.default.number().unsafe().optional(),
normalPhi: joi_1.default.number().unsafe().optional(),
samples: joi_1.default.number().unsafe().optional(),
const ssaoEffectSchema = zod_1.z.object({
properties: zod_1.z.object({
resolutionScale: zod_1.z.number().optional(),
spp: zod_1.z.number().optional(),
distance: zod_1.z.number().optional(),
distanceIntensity: zod_1.z.number().optional(),
intensity: zod_1.z.number().optional(),
color: zod_1.z.string().optional(),
iterations: zod_1.z.number().optional(),
radius: zod_1.z.number().optional(),
rings: zod_1.z.number().optional(),
lumaPhi: zod_1.z.number().optional(),
depthPhi: zod_1.z.number().optional(),
normalPhi: zod_1.z.number().optional(),
samples: zod_1.z.number().optional(),
}).optional(),
type: joi_1.default.string()
type: zod_1.z.string()
});
const tiltShiftEffectSchema = joi_1.default.object({
properties: joi_1.default.object({
blendFunction: joi_1.default.number().unsafe().optional(),
feather: joi_1.default.number().unsafe().optional(),
focusArea: joi_1.default.number().unsafe().optional(),
kernelSize: joi_1.default.number().unsafe().optional(),
offset: joi_1.default.number().unsafe().optional(),
rotation: joi_1.default.number().unsafe().optional(),
const tiltShiftEffectSchema = zod_1.z.object({
properties: zod_1.z.object({
blendFunction: zod_1.z.number().optional(),
feather: zod_1.z.number().optional(),
focusArea: zod_1.z.number().optional(),
kernelSize: zod_1.z.number().optional(),
offset: zod_1.z.number().optional(),
rotation: zod_1.z.number().optional(),
}).optional(),
type: joi_1.default.string()
type: zod_1.z.string()
});
const vignetteEffectSchema = joi_1.default.object({
properties: joi_1.default.object({
blendFunction: joi_1.default.number().unsafe().optional(),
darkness: joi_1.default.number().unsafe().optional(),
offset: joi_1.default.number().unsafe().optional(),
technique: joi_1.default.number().unsafe().optional(),
const vignetteEffectSchema = zod_1.z.object({
properties: zod_1.z.object({
blendFunction: zod_1.z.number().optional(),
darkness: zod_1.z.number().optional(),
offset: zod_1.z.number().optional(),
technique: zod_1.z.number().optional(),
}).optional(),
type: joi_1.default.string()
type: zod_1.z.string()
});
const postProcessingSchema = joi_1.default.array().items(bloomEffectSchema, chromaticAberrationEffectSchema, depthOfFieldEffectSchema, dotScreenEffectSchema, gridEffectSchema, hbaoEffectSchema, hueSaturationEffectSchema, noiseEffectSchema, pixelationEffectSchema, scanlineEffectSchema, ssaoEffectSchema, tiltShiftEffectSchema, vignetteEffectSchema);
const schema = joi_1.default.object({
build_date: joi_1.default.string().allow('').optional(),
build_version: joi_1.default.string().allow('').optional(),
settings_version: joi_1.default.string(),
ar: joi_1.default.object({
enable: joi_1.default.boolean(),
autoScaling: joi_1.default.boolean(),
const postProcessingSchema = zod_1.z.array(zod_1.z.union([bloomEffectSchema, chromaticAberrationEffectSchema, depthOfFieldEffectSchema, dotScreenEffectSchema, gridEffectSchema, hbaoEffectSchema, hueSaturationEffectSchema, noiseEffectSchema, pixelationEffectSchema, scanlineEffectSchema, ssaoEffectSchema, tiltShiftEffectSchema, vignetteEffectSchema]));
const schema = zod_1.z.object({
build_date: zod_1.z.string().optional(),
build_version: zod_1.z.string().optional(),
settings_version: zod_1.z.string(),
ar: zod_1.z.object({
enable: zod_1.z.boolean(),
autoScaling: zod_1.z.boolean(),
}).optional(),
camera: {
cameraId: joi_1.default.string().allow(''),
camera: zod_1.z.object({
cameraId: zod_1.z.string(),
cameras: cameraSchema
},
environment: {
clearAlpha: joi_1.default.number().unsafe(),
clearColor: joi_1.default.string(),
map: joi_1.default.alternatives([joi_1.default.string().allow(''), joi_1.default.array().items(joi_1.default.string())]),
mapAsBackground: joi_1.default.boolean(),
mapResolution: joi_1.default.string(),
rotation: { x: joi_1.default.number().unsafe(), y: joi_1.default.number().unsafe(), z: joi_1.default.number().unsafe(), w: joi_1.default.number().unsafe() },
blurriness: joi_1.default.number().unsafe(),
intensity: joi_1.default.number().unsafe(),
},
environmentGeometry: {
gridColor: joi_1.default.string(),
gridVisibility: joi_1.default.boolean(),
groundPlaneColor: joi_1.default.string(),
groundPlaneVisibility: joi_1.default.boolean(),
groundPlaneShadowColor: joi_1.default.string(),
groundPlaneShadowVisibility: joi_1.default.boolean(),
},
general: {
transformation: {
scale: { x: joi_1.default.number().unsafe(), y: joi_1.default.number().unsafe(), z: joi_1.default.number().unsafe() },
translation: { x: joi_1.default.number().unsafe(), y: joi_1.default.number().unsafe(), z: joi_1.default.number().unsafe() },
rotation: { x: joi_1.default.number().unsafe(), y: joi_1.default.number().unsafe(), z: joi_1.default.number().unsafe() }
},
blurWhenBusy: joi_1.default.boolean(),
commitSettings: joi_1.default.boolean(),
commitParameters: joi_1.default.boolean(),
pointSize: joi_1.default.number().unsafe(),
showMessages: joi_1.default.boolean(),
defaultMaterialColor: joi_1.default.string(),
},
light: {
lightSceneId: joi_1.default.string().allow('').optional(),
}),
environment: zod_1.z.object({
clearAlpha: zod_1.z.number(),
clearColor: zod_1.z.string(),
map: zod_1.z.union([zod_1.z.string(), zod_1.z.string().array()]),
mapAsBackground: zod_1.z.boolean(),
mapResolution: zod_1.z.string(),
rotation: zod_1.z.object({ x: zod_1.z.number(), y: zod_1.z.number(), z: zod_1.z.number(), w: zod_1.z.number() }),
blurriness: zod_1.z.number(),
intensity: zod_1.z.number(),
}),
environmentGeometry: zod_1.z.object({
gridColor: zod_1.z.string(),
gridVisibility: zod_1.z.boolean(),
groundPlaneColor: zod_1.z.string(),
groundPlaneVisibility: zod_1.z.boolean(),
groundPlaneShadowColor: zod_1.z.string(),
groundPlaneShadowVisibility: zod_1.z.boolean(),
}),
general: zod_1.z.object({
transformation: zod_1.z.object({
scale: zod_1.z.object({ x: zod_1.z.number(), y: zod_1.z.number(), z: zod_1.z.number() }),
translation: zod_1.z.object({ x: zod_1.z.number(), y: zod_1.z.number(), z: zod_1.z.number() }),
rotation: zod_1.z.object({ x: zod_1.z.number(), y: zod_1.z.number(), z: zod_1.z.number() })
}),
blurWhenBusy: zod_1.z.boolean(),
commitSettings: zod_1.z.boolean(),
commitParameters: zod_1.z.boolean(),
pointSize: zod_1.z.number(),
showMessages: zod_1.z.boolean(),
defaultMaterialColor: zod_1.z.string(),
}),
light: zod_1.z.object({
lightSceneId: zod_1.z.string().optional(),
lightScenes: lightSchema,
},
postprocessing: {
antiAliasingTechnique: joi_1.default.string(),
antiAliasingTechniqueMobile: joi_1.default.string(),
enablePostProcessingOnMobile: joi_1.default.boolean(),
ssaaSampleLevel: joi_1.default.number().unsafe(),
}),
postprocessing: zod_1.z.object({
antiAliasingTechnique: zod_1.z.string(),
antiAliasingTechniqueMobile: zod_1.z.string(),
enablePostProcessingOnMobile: zod_1.z.boolean(),
ssaaSampleLevel: zod_1.z.number(),
effects: postProcessingSchema
},
rendering: {
automaticColorAdjustment: joi_1.default.boolean(),
beautyRenderDelay: joi_1.default.number().unsafe(),
beautyRenderBlendingDuration: joi_1.default.number().unsafe(),
lights: joi_1.default.boolean(),
outputEncoding: joi_1.default.string(),
physicallyCorrectLights: joi_1.default.boolean(),
shadows: joi_1.default.boolean(),
softShadows: joi_1.default.boolean(),
textureEncoding: joi_1.default.string(),
toneMapping: joi_1.default.string(),
toneMappingExposure: joi_1.default.number().unsafe(),
},
session: joi_1.default.object().pattern(/^/, [
joi_1.default.object({
order: joi_1.default.number().unsafe().optional(),
displayname: joi_1.default.string().allow('').optional(),
hidden: joi_1.default.boolean().optional()
})
]),
}).options({ presence: 'required' });
}),
rendering: zod_1.z.object({
automaticColorAdjustment: zod_1.z.boolean(),
beautyRenderDelay: zod_1.z.number(),
beautyRenderBlendingDuration: zod_1.z.number(),
lights: zod_1.z.boolean(),
outputEncoding: zod_1.z.string(),
physicallyCorrectLights: zod_1.z.boolean(),
shadows: zod_1.z.boolean(),
softShadows: zod_1.z.boolean(),
textureEncoding: zod_1.z.string(),
toneMapping: zod_1.z.string(),
toneMappingExposure: zod_1.z.number(),
}),
session: zod_1.z.record(zod_1.z.object({
order: zod_1.z.number().optional(),
displayname: zod_1.z.string().optional(),
hidden: zod_1.z.boolean().optional()
})),
}).strict().required();
const validate = (s) => {
const result = joi_1.default.attempt(s, schema);
s = result.value;
const result = schema.parse(s);
s = result;
};
exports.validate = validate;
//# sourceMappingURL=Validator.js.map
{
"name": "@shapediver/viewer.settings",
"version": "0.6.0",
"version": "1.0.0",
"description": "",

@@ -42,5 +42,5 @@ "license": "polyform-noncommercial-1.0.0",

"dependencies": {
"joi": "^17.4.2",
"zod": "^3.22.4",
"uuid": "^8.3.2"
}
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc