Skip to main content

novorender-api-docs / namespaces / DataJsAPI / API

Interface: API

Methods​

createScene()​

createScene(scene): Promise<{
error?: string;
success?: boolean;
}>;

Create scene

Parameters​

ParameterTypeDescription
sceneSceneDefinitionSceneDefinition

Returns​

Promise<{ error?: string; success?: boolean; }>

Remarks​

Only administrator may reate a scene. Definition automatically saves to storage for future use.

Throws​

Error in case of insufficient access rights.


deleteResource()​

deleteResource(id): Promise<boolean>;

Delete the specified resource from cloud storage.

Parameters​

ParameterTypeDescription
idstringThe resource id (guid)

Returns​

Promise<boolean>

A boolean promise indicating when the operation is complete succesfully/failed.

Remarks​

Only administrator may delete a resource.

Throws​

Error in case of insufficient access rights.


deleteScene()​

deleteScene(id): Promise<boolean>;

Delete the specified scene from cloud storage.

Parameters​

ParameterTypeDescription
idstringThe scene id (guid)

Returns​

Promise<boolean>

A boolean promise indicating when the operation is complete succesfully/failed.

Remarks​

Only scene owners may delete a scene. The scene will be permanently lost and any references to it becomes invalid.

Throws​

Error in case of insufficient access rights.


fetch()​

fetch(path, init?): Promise<Response>;

Relative custom path request

Parameters​

ParameterType
pathstring
init?RequestInit

Returns​

Promise<Response>


getBookmarks()​

getBookmarks(id, options?): Promise<Bookmark[]>;

Parameters​

ParameterType
idstring
options?{ group?: string; personal?: boolean; }
options.group?string
options.personal?boolean

Returns​

Promise<Bookmark[]>


getGroupIds()​

getGroupIds(sceneId, id): Promise<number[]>;

Parameters​

ParameterType
sceneIdstring
idstring

Returns​

Promise<number[]>


getProcesses()​

getProcesses(): Promise<readonly ActiveProcess[]>;

Get list of active processes.

Returns​

Promise<readonly ActiveProcess[]>


getProcessProgress()​

getProcessProgress(
id,
position?,
signal?): Promise<ProcessProgress>;

Get process progress

Parameters​

ParameterTypeDescription
idstringA process id
position?numberA position returned by previous process progress
signal?AbortSignal-

Returns​

Promise<ProcessProgress>

State of process ProcessProgress


getResource()​

getResource(id): Promise<ResourcePreview>;

Get preview of the specified resource from cloud storage.

Parameters​

ParameterTypeDescription
idstringThe scene id (guid)

Returns​

Promise<ResourcePreview>

Returns ResourcePreview

Remarks​

Only administrator may access resources.

Throws​

Error in case of insufficient access rights.


getResources()​

getResources(): Promise<Resource[]>;

Get list of available resources.

Returns​

Promise<Resource[]>

Remarks​

The list contains only those resources available to the currently authenticated user. Only administrator could access to resources.


getSceneDefinition()​

getSceneDefinition(id): Promise<SceneDefinition>;

Get saved scene definition using for createScene

Parameters​

ParameterType
idstring

Returns​

Promise<SceneDefinition>


getScenes()​

getScenes(): Promise<readonly ScenePreview[]>;

Get list of available scenes.

Returns​

Promise<readonly ScenePreview[]>

Remarks​

The list contains only those scenes available to the currently authenticated user. For anonymous users, only public scenes are available.


getUserInformation()​

getUserInformation(): Promise<{
features: any;
name: string;
organization: string;
role: string;
}>;

Get information about currently authenticated user

Returns​

Promise<{ features: any; name: string; organization: string; role: string; }>


getWKZones()​

getWKZones(): string[];

Returns​

string[]


latLon2tm()​

latLon2tm(coords, tmZone): vec3;

Parameters​

ParameterType
coordsGeoLocation
tmZonestring

Returns​

vec3


loadScene()​

loadScene(id): Promise<SceneData | SceneLoadFail>;

Parameters​

ParameterType
idstring

Returns​

Promise<SceneData | SceneLoadFail>


putScene()​

putScene(scene): Promise<boolean>;

Parameters​

ParameterType
sceneSceneData

Returns​

Promise<boolean>


saveBookmarks()​

saveBookmarks(
id,
bookmarks,
options?): Promise<boolean>;

Parameters​

ParameterType
idstring
bookmarksBookmark[]
options?{ group?: string; personal?: boolean; }
options.group?string
options.personal?boolean

Returns​

Promise<boolean>


tm2LatLon()​

tm2LatLon(position, tmZone): GeoLocation;

Parameters​

ParameterType
positionvec3
tmZonestring

Returns​

GeoLocation


updateResource()​

updateResource(resource): Promise<boolean>;

Update the specified resource in cloud storage.

Parameters​

ParameterTypeDescription
resourceResourceThe Resource

Returns​

Promise<boolean>

A boolean promise indicating when the operation is complete succesfully/failed.

Remarks​

Only administrator may update a resource.

Throws​

Error in case of insufficient access rights.


uploadResource()​

uploadResource(
file,
progress,
revisionOf?,
path?,
split?): Promise<{
error?: string;
processId?: string;
}>;

Upload resource file

Parameters​

ParameterType
fileFile
progress(progress) => void
revisionOf?string
path?string
split?boolean

Returns​

Promise<{ error?: string; processId?: string; }>