Reference
The client, its methods, and every option and result of the Node.js SDK.
This reference follows @vizbl/node 0.1.0. Each method lists the Developer API endpoint it calls, whose page has the full request and response.
Client
import Vizbl from '@vizbl/node';
const vizbl = new Vizbl(options?: ClientOptions);Throws a VizblApiError with code missing_api_key if there is no key. See Errors.
Client options
Prop
Type
objects.importModel()
vizbl.objects.importModel(options: ImportModelOptions): Promise<ImportJob>Uploads the files, starts the import and, with wait, waits for it. Resolves with the finished job when you wait, and with the queued job otherwise. Calls POST /developer-api/uploads/presign for each file, uploads it to storage, then calls POST /developer-api/objects/imports. Guide: Import models.
Import options
Prop
Type
Variant
One item of variants.
Prop
Type
Wait options
The object form of wait, and the options of objects.imports.wait().
Prop
Type
Import job
What importModel(), objects.imports.create(), objects.imports.get() and objects.imports.wait() resolve with. After wait, status is succeeded and tinuuid and url are set.
Prop
Type
objects.imports.create()
vizbl.objects.imports.create(request: CreateImportRequest, options?: CreateImportOptions): Promise<ImportJob>Starts an import of files you have uploaded. Calls POST /developer-api/objects/imports.
Import request
Prop
Type
Request options
Prop
Type
objects.imports.get()
vizbl.objects.imports.get(jobId: string, options?: { signal?: AbortSignal }): Promise<ImportJob>Reads an import job once. Calls GET /developer-api/objects/imports/{jobId}.
objects.imports.wait()
vizbl.objects.imports.wait(jobId: string, options?: WaitForImportOptions): Promise<ImportJob>Reads an import job until it finishes. Resolves with the succeeded job, with tinuuid and url. Throws a VizblImportError if the job fails or doesn't finish within maxWaitMs. Calls GET /developer-api/objects/imports/{jobId}.
uploads.presign()
vizbl.uploads.presign(request: PresignUploadRequest, options?: { signal?: AbortSignal }): Promise<PresignUploadResponse>Gets a URL to upload a 3D file to. Calls POST /developer-api/uploads/presign. Import step by step shows the upload.
Presign request
Prop
Type
Presign response
Prop
Type
objects.delete()
vizbl.objects.delete(tinuuid: string, options?: { signal?: AbortSignal }): Promise<DeleteObjectResponse>Deletes an object. Calls DELETE /developer-api/objects/{tinuuid}.
Prop
Type
Errors
Both error classes are exported by the package. Their methods and codes are in Errors.
VizblApiError
Extends Error. Thrown for API, upload, validation and timeout failures.
Prop
Type
VizblImportError
Extends VizblApiError and has the same properties. Thrown by objects.imports.wait(), and by importModel() with wait, when the import fails or doesn't finish within maxWaitMs. code is the job's error code or import_wait_timeout, and details is the import job.