@inweb/client 25.8.19 → 25.8.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client.js +13 -13
- package/dist/client.js.map +1 -1
- package/dist/client.min.js +1 -1
- package/dist/client.module.js +2 -2
- package/dist/client.module.js.map +1 -1
- package/lib/Api/Assembly.d.ts +5 -5
- package/lib/Api/File.d.ts +4 -4
- package/lib/Api/IFile.d.ts +1 -1
- package/lib/Api/Model.d.ts +4 -4
- package/package.json +2 -2
- package/src/Api/Assembly.ts +5 -5
- package/src/Api/File.ts +4 -4
- package/src/Api/IFile.ts +1 -1
- package/src/Api/Model.ts +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.module.js","sources":["../src/Api/FetchError.ts","../src/Api/Model.ts","../src/Api/Utils.ts","../src/Api/ClashTest.ts","../src/Api/Assembly.ts","../../eventemitter2/dist/eventemitter2.module.js","../src/Api/Fetch.ts","../src/Api/XMLHttp.ts","../src/Api/HttpClient.ts","../src/Api/Permission.ts","../src/Api/Job.ts","../src/Api/File.ts","../src/Api/Role.ts","../src/Api/Member.ts","../src/Api/Project.ts","../src/Api/User.ts","../src/Api/Client.ts","../src/index.ts"],"sourcesContent":["///////////////////////////////////////////////////////////////////////////////\n// Copyright (C) 2002-2024, Open Design Alliance (the \"Alliance\").\n// All rights reserved.\n//\n// This software and its documentation and related materials are owned by\n// the Alliance. The software may only be incorporated into application\n// programs owned by members of the Alliance, subject to a signed\n// Membership Agreement and Supplemental Software License Agreement with the\n// Alliance. The structure and organization of this software are the valuable\n// trade secrets of the Alliance and its suppliers. The software is also\n// protected by copyright law and international treaty provisions. Application\n// programs incorporating this software must include the following statement\n// with their copyright notices:\n//\n// This application incorporates Open Design Alliance software pursuant to a\n// license agreement with Open Design Alliance.\n// Open Design Alliance Copyright (C) 2002-2024 by Open Design Alliance.\n// All rights reserved.\n//\n// By use of this software, its documentation or related materials, you\n// acknowledge and accept the above terms.\n///////////////////////////////////////////////////////////////////////////////\n\nconst STATUS_CODES = {\n 100: \"Continue\",\n 101: \"Switching Protocols\",\n 102: \"Processing\",\n 103: \"Early Hints\",\n 200: \"OK\",\n 201: \"Created\",\n 202: \"Accepted\",\n 203: \"Non-Authoritative Information\",\n 204: \"No Content\",\n 205: \"Reset Content\",\n 206: \"Partial Content\",\n 207: \"Multi-Status\",\n 208: \"Already Reported\",\n 226: \"IM Used\",\n 300: \"Multiple Choices\",\n 301: \"Moved Permanently\",\n 302: \"Found\",\n 303: \"See Other\",\n 304: \"Not Modified\",\n 305: \"Use Proxy\",\n 307: \"Temporary Redirect\",\n 308: \"Permanent Redirect\",\n 400: \"Bad Request\",\n 401: \"Unauthorized\",\n 402: \"Payment Required\",\n 403: \"Forbidden\",\n 404: \"Not Found\",\n 405: \"Method Not Allowed\",\n 406: \"Not Acceptable\",\n 407: \"Proxy Authentication Required\",\n 408: \"Request Time-out\",\n 409: \"Conflict\",\n 410: \"Gone\",\n 411: \"Length Required\",\n 412: \"Precondition Failed\",\n 413: \"Payload Too Large\",\n 414: \"URI Too Long\",\n 415: \"Unsupported Media Type\",\n 416: \"Range Not Satisfiable\",\n 417: \"Expectation Failed\",\n 418: \"I'm a teapot\",\n 421: \"Misdirected Request\",\n 422: \"Unprocessable Entity\",\n 423: \"Locked\",\n 424: \"Failed Dependency\",\n 425: \"Too Early\",\n 426: \"Upgrade Required\",\n 428: \"Precondition Required\",\n 429: \"Too Many Requests\",\n 431: \"Header Fields Too Large\",\n 451: \"Unavailable For Legal Reasons\",\n 500: \"Internal Server Error\",\n 501: \"Not Implemented\",\n 502: \"Bad Gateway\",\n 503: \"Service Unavailable\",\n 504: \"Gateway Timeout\",\n 505: \"HTTP Version Not Supported\",\n 506: \"Variant Also Negotiates\",\n 507: \"Insufficient Storage\",\n 508: \"Loop Detected\",\n 509: \"Bandwidth Limit Exceeded\",\n 510: \"Not Extended\",\n 511: \"Network Authentication Required\",\n};\n\nexport function statusText(status: number): string {\n return STATUS_CODES[status] || `Error ${status}`;\n}\n\nexport function error400(text: string, _default = \"400\"): string {\n try {\n return JSON.parse(text).description;\n } catch {\n return _default;\n }\n}\n\n/**\n * The `FetchError` object indicates an error when request to Open Cloud Server could not be\n * performed. A `FetchError` is typically (but not exclusively) thrown when a network error\n * occurs, access denied, or object not found.\n */\n\nexport class FetchError extends Error {\n protected status: number;\n protected statusText: string;\n\n /**\n * @property status - The\n * {@link https://developer.mozilla.org/docs/Web/HTTP/Status | HTTP status code} of the response.\n * @property message - Error message.\n */\n constructor(status: number, message?: string) {\n super(message || statusText(status));\n this.name = \"FetchError\";\n this.status = status;\n this.statusText = statusText(status);\n }\n}\n","///////////////////////////////////////////////////////////////////////////////\n// Copyright (C) 2002-2024, Open Design Alliance (the \"Alliance\").\n// All rights reserved.\n//\n// This software and its documentation and related materials are owned by\n// the Alliance. The software may only be incorporated into application\n// programs owned by members of the Alliance, subject to a signed\n// Membership Agreement and Supplemental Software License Agreement with the\n// Alliance. The structure and organization of this software are the valuable\n// trade secrets of the Alliance and its suppliers. The software is also\n// protected by copyright law and international treaty provisions. Application\n// programs incorporating this software must include the following statement\n// with their copyright notices:\n//\n// This application incorporates Open Design Alliance software pursuant to a\n// license agreement with Open Design Alliance.\n// Open Design Alliance Copyright (C) 2002-2024 by Open Design Alliance.\n// All rights reserved.\n//\n// By use of this software, its documentation or related materials, you\n// acknowledge and accept the above terms.\n///////////////////////////////////////////////////////////////////////////////\n\nimport { IHttpClient } from \"./IHttpClient\";\nimport type { File } from \"./File\";\nimport type { Assembly } from \"./Assembly\";\nimport type { IModelTransformMatrix } from \"./IAssembly\";\n\n/**\n * Provides properties and methods for working with view of the file or assembly. For example,\n * for `dwg` it is a `Model` space or layout, and for `rvt` files it is a `3D` view.\n */\nexport class Model {\n private _data: any;\n private _file: File | Assembly;\n public httpClient: IHttpClient;\n public path: string;\n\n /**\n * @param data - Raw model data received from the server.\n * @param file - The file/assembly instance that owns the model.\n */\n constructor(data: any, file: File | Assembly) {\n this.path = `${file.path}/downloads`;\n this.httpClient = file.httpClient;\n this._file = file;\n this._data = data;\n }\n\n /**\n * The `Assembly` instance that owns the model.\n *\n * @readonly\n */\n get assembly(): Assembly {\n return this._file as Assembly;\n }\n\n /**\n * Raw model data received from the server.\n *\n * @readonly\n */\n get data(): any {\n return this._data;\n }\n\n private set data(value: any) {\n this._data = value;\n }\n\n /**\n * Scene description resource file name. Use {@link downloadResource | downloadResource()} to\n * download scene description file.\n *\n * @readonly\n */\n get database(): string {\n return this.data.database;\n }\n\n /**\n * `true` if this is default model.\n *\n * @readonly\n */\n get default(): boolean {\n return this.data.default;\n }\n\n /**\n * The `File` instance that owns the model.\n *\n * @readonly\n */\n get file(): File {\n return this._file as File;\n }\n\n /**\n * The ID of the file that owns the model.\n *\n * @readonly\n */\n get fileId(): string {\n return this.data.fileId;\n }\n\n /**\n * The list of geometry data resource files. Use {@link downloadResource | downloadResource()}\n * to download geometry data files.\n *\n * @readonly\n */\n get geometry(): string[] {\n return this.data.geometry;\n }\n\n /**\n * Unique model ID.\n *\n * @readonly\n */\n get id(): string {\n return this.data.id;\n }\n\n /**\n * Model name.\n *\n * @readonly\n */\n get name(): string {\n return this.data.name;\n }\n\n /**\n * Model owner type, matches the file extension this is model of the file, or `assembly` for\n * assemblies.\n *\n * @readonly\n */\n get type(): string {\n return this.file.type;\n }\n\n // Reserved for future use.\n get version(): string {\n return this.data.version;\n }\n\n /**\n * Returns model list with one item `self`.\n */\n getModels(): Promise<Model[]> {\n return Promise.resolve([this]);\n }\n\n /**\n * Returns a model transformation.\n *\n * @param handle - Model handle.\n */\n getModelTransformMatrix(handle: string): IModelTransformMatrix {\n return this.file.getModelTransformMatrix(handle);\n }\n\n /**\n * Sets or removes a model transformation.\n *\n * @param handle - Model handle.\n * @param transform - Transformation matrix. Specify `undefined` to remove transformation.\n */\n setModelTransformMatrix(handle: string, transform: IModelTransformMatrix): Promise<this> {\n return this.file.setModelTransformMatrix(handle, transform).then(() => this);\n }\n\n /**\n * Returns a list of viewpoints of the owner file/assembly.\n */\n getViewpoints(): Promise<any[]> {\n return this._file\n .getViewpoints()\n .then((array) =>\n array.filter(\n ({ custom_fields = {} }) => custom_fields.modelId === this.id || custom_fields.modelName === this.name\n )\n );\n }\n\n /**\n * Adds a new viewpoint to the owner file/assembly. To create a new viewpoint use\n * `Viewer.createViewpoint()`.\n *\n * @param viewpoint - Viewpoint.\n */\n saveViewpoint(viewpoint: any): Promise<any> {\n return this._file.saveViewpoint({\n ...viewpoint,\n custom_fields: { ...viewpoint.custom_fields, modelId: this.id, modelName: this.name },\n });\n }\n\n /**\n * Deletes the specified viewpoint from the owner file/assembly.\n *\n * @param guid - Viewpoint GUID.\n * @returns Returns the raw data of a deleted viewpoint.\n */\n deleteViewpoint(guid: string): Promise<any> {\n return this._file.deleteViewpoint(guid);\n }\n\n /**\n * Returns viewpoint preview image as\n * {@link https://developer.mozilla.org/docs/Web/HTTP/Basics_of_HTTP/Data_URIs | Data URL}.\n *\n * @param guid - Viewpoint GIID.\n */\n getSnapshot(guid: string): Promise<string> {\n return this._file.getSnapshot(guid);\n }\n\n /**\n * Returns viewpoint snapshot data.\n *\n * @param guid - Viewpoint GUID.\n * @param bitmapGuid - Bitmap GUID.\n */\n getSnapshotData(guid: string, bitmapGuid: string): Promise<string> {\n return this._file.getSnapshotData(guid, bitmapGuid);\n }\n\n /**\n * Downloads a resource file. Resource files are files that contain model scene descriptions,\n * or geometry data.\n *\n * @param dataId - Resource file name.\n * @param onProgress - Download progress callback.\n * @param signal - An\n * {@link https://developer.mozilla.org/docs/Web/API/AbortController | AbortController}\n * signal. Allows to communicate with a fetch request and abort it if desired.\n */\n downloadResource(\n dataId: string,\n onProgress?: (progress: number, chunk: Uint8Array) => void,\n signal?: AbortSignal\n ): Promise<ArrayBuffer> {\n return this._file.downloadResource(dataId, onProgress, signal);\n }\n\n /**\n * Downloads a part of resource file. Resource files are files that contain model scene\n * descriptions, or geometry data.\n *\n * @param dataId - Resource file name.\n * @param ranges - A range of resource file contents to download.\n * @param requestId - Request ID for download progress callback.\n * @param onProgress - Download progress callback.\n * @param signal - An\n * {@link https://developer.mozilla.org/docs/Web/API/AbortController | AbortController}\n * signal. Allows to communicate with a fetch request and abort it if desired.\n */\n downloadResourceRange(\n dataId: string,\n requestId: number,\n ranges: Array<{ begin: number; end: number; requestId: number }>,\n onProgress?: (progress: number, chunk: Uint8Array, requestId: number) => void,\n signal?: AbortSignal\n ): Promise<ArrayBuffer> {\n return this._file.downloadResourceRange(dataId, requestId, ranges, onProgress, signal);\n }\n\n /**\n * Deprecated since `25.3`. Use {@link downloadResource | downloadResource()} instead.\n *\n * @deprecated\n */\n partialDownloadResource(\n dataId: string,\n onProgress?: (progress: number, chunk: Uint8Array) => void,\n signal?: AbortSignal\n ): Promise<ArrayBuffer> {\n console.warn(\n \"Model.partialDownloadResource() has been deprecated since 25.3 and will be removed in a future release, use Model.downloadResource() instead.\"\n );\n return this.downloadResource(dataId, onProgress, signal);\n }\n\n /**\n * Deprecated since `25.3`. Use {@link downloadResourceRange | downloadResourceRange()} instead.\n *\n * @deprecated\n */\n async downloadFileRange(\n requestId: number,\n records: any | null,\n dataId: string,\n onProgress?: (progress: number, chunk: Uint8Array, requestId: number) => void,\n signal?: AbortSignal\n ): Promise<void> {\n if (!records) return;\n\n let ranges = [];\n if (records.length) {\n ranges = records.map((record) => ({\n begin: Number(record.begin),\n end: Number(record.end),\n requestId: record.reqId,\n }));\n } else {\n for (let i = 0; i < records.size(); i++) {\n const record = records.get(i);\n ranges.push({ begin: Number(record.begin), end: Number(record.end), requestId });\n record.delete();\n }\n }\n\n await this.downloadResourceRange(dataId, requestId, ranges, onProgress, signal);\n }\n\n /**\n * Returns a list of references of the owner file/assembly.\n *\n * References are images, fonts, or any other files to correct rendering of the file.\n *\n * @param signal - An\n * {@link https://developer.mozilla.org/docs/Web/API/AbortController | AbortController}\n * signal, which can be used to abort waiting as desired.\n */\n getReferences(signal?: AbortSignal): Promise<any> {\n return this._file.getReferences(signal);\n }\n}\n","///////////////////////////////////////////////////////////////////////////////\n// Copyright (C) 2002-2024, Open Design Alliance (the \"Alliance\").\n// All rights reserved.\n//\n// This software and its documentation and related materials are owned by\n// the Alliance. The software may only be incorporated into application\n// programs owned by members of the Alliance, subject to a signed\n// Membership Agreement and Supplemental Software License Agreement with the\n// Alliance. The structure and organization of this software are the valuable\n// trade secrets of the Alliance and its suppliers. The software is also\n// protected by copyright law and international treaty provisions. Application\n// programs incorporating this software must include the following statement\n// with their copyright notices:\n//\n// This application incorporates Open Design Alliance software pursuant to a\n// license agreement with Open Design Alliance.\n// Open Design Alliance Copyright (C) 2002-2024 by Open Design Alliance.\n// All rights reserved.\n//\n// By use of this software, its documentation or related materials, you\n// acknowledge and accept the above terms.\n///////////////////////////////////////////////////////////////////////////////\n\nfunction delay(ms: number, signal: AbortSignal): Promise<boolean> {\n return new Promise((resolve) => {\n let timeoutId = 0;\n\n const abortHandler = () => {\n clearTimeout(timeoutId);\n resolve(true);\n };\n\n timeoutId = window.setTimeout(() => {\n signal.removeEventListener(\"abort\", abortHandler);\n resolve(false);\n }, ms);\n\n signal.addEventListener(\"abort\", abortHandler, { once: true });\n });\n}\n\nexport async function waitFor(\n func: (params: any) => Promise<boolean>,\n params: {\n timeout?: number;\n interval?: number;\n signal?: AbortSignal;\n abortError?: DOMException;\n timeoutError?: DOMException;\n result?: any;\n } = {}\n): Promise<any> {\n const timeout = params.timeout || 600000;\n const interval = params.interval || 3000;\n const signal = params.signal ?? new AbortController().signal;\n const abortError = params.abortError ?? new DOMException(\"Aborted\", \"AbortError\");\n const timeoutError = params.timeoutError ?? new DOMException(\"Timeout\", \"TimeoutError\");\n\n const end = performance.now() + timeout;\n let count = timeout / interval;\n\n do {\n if (await func(params)) return Promise.resolve(params.result);\n if ((await delay(interval, signal)) || signal.aborted) return Promise.reject(abortError);\n } while (performance.now() < end && --count > 0);\n\n return Promise.reject(timeoutError);\n}\n\nexport function parseArgs(args?: string | object): object {\n if (typeof args === \"string\") {\n const firstArg = args.indexOf(\"--\");\n if (firstArg !== -1) args = args.slice(firstArg);\n const argArray = args\n .split(\"--\")\n .map((x) =>\n x\n .split(\"=\")\n .map((y) => y.split(\" \"))\n .flat()\n )\n .filter((x) => x[0])\n .map((x) => x.concat([\"\"]));\n return Object.fromEntries(argArray);\n }\n return args || {};\n}\n\nexport function userFullName(firstName: string | any, lastName = \"\", userName = \"\"): string {\n if (firstName && typeof firstName !== \"string\") {\n return userFullName(firstName.firstName ?? firstName.name, firstName.lastName, firstName.userName);\n }\n return `${firstName ?? \"\"} ${lastName ?? \"\"}`.trim() || userName;\n}\n\nexport function userInitials(fullName = \"\"): string {\n const names = fullName.split(\" \").filter((x) => x);\n return names\n .reduce((initials, name, index) => {\n if (index === 0 || index === names.length - 1) initials += name.charAt(0);\n return initials;\n }, \"\")\n .toUpperCase();\n}\n","///////////////////////////////////////////////////////////////////////////////\n// Copyright (C) 2002-2024, Open Design Alliance (the \"Alliance\").\n// All rights reserved.\n//\n// This software and its documentation and related materials are owned by\n// the Alliance. The software may only be incorporated into application\n// programs owned by members of the Alliance, subject to a signed\n// Membership Agreement and Supplemental Software License Agreement with the\n// Alliance. The structure and organization of this software are the valuable\n// trade secrets of the Alliance and its suppliers. The software is also\n// protected by copyright law and international treaty provisions. Application\n// programs incorporating this software must include the following statement\n// with their copyright notices:\n//\n// This application incorporates Open Design Alliance software pursuant to a\n// license agreement with Open Design Alliance.\n// Open Design Alliance Copyright (C) 2002-2024 by Open Design Alliance.\n// All rights reserved.\n//\n// By use of this software, its documentation or related materials, you\n// acknowledge and accept the above terms.\n///////////////////////////////////////////////////////////////////////////////\n\nimport { IHttpClient } from \"./IHttpClient\";\nimport { IShortUserDescription } from \"./IUser\";\nimport { waitFor, userFullName, userInitials } from \"./Utils\";\n\n/**\n * Provides properties and methods for obtaining information about a file/assembly clash detection test.\n */\nexport class ClashTest {\n private _data: any;\n public basePath: string;\n public httpClient: IHttpClient;\n\n /**\n * @param data - Raw test data received from the server.\n * @param basePath - The clash test API base path of the file/assembly that owns the test.\n * @param httpClient - HTTP client instance used to send REST API requests to the server.\n */\n constructor(data: any, basePath: string, httpClient: IHttpClient) {\n this.httpClient = httpClient;\n this.basePath = basePath;\n this.data = data;\n }\n\n protected internalGet(relativePath: string): Promise<Response> {\n return this.httpClient.get(`${this.basePath}/clashes/${this.id}${relativePath}`);\n }\n\n protected internalPut(relativePath: string, body?: BodyInit | object): Promise<Response> {\n return this.httpClient.put(`${this.basePath}/clashes/${this.id}${relativePath}`, body);\n }\n\n protected internalDelete(relativePath: string): Promise<Response> {\n return this.httpClient.delete(`${this.basePath}/clashes/${this.id}${relativePath}`);\n }\n\n /**\n * The type of the clashes that the test detects:\n *\n * - `true` - Сlearance clash. A clash in which the object A may or may not intersect with\n * object B, but comes within a distance of less than the {@link tolerance}.\n * - `false` - Hard clash. A clash in which the object A intersects with object B by a distance\n * of more than the {@link tolerance}.\n *\n * @readonly\n */\n get clearance(): boolean {\n return this.data.clearance;\n }\n\n /**\n * Test creation time (UTC) in the format specified in\n * {@link https://www.wikipedia.org/wiki/ISO_8601 | ISO 8601}.\n *\n * @readonly\n */\n get createdAt(): string {\n return this.data.createdAt;\n }\n\n /**\n * Raw test data received from the server.\n *\n * @readonly\n */\n get data(): any {\n return this._data;\n }\n\n private set data(value: any) {\n this._data = value;\n this._data.owner.avatarUrl = `${this.httpClient.serverUrl}/users/${this._data.owner.userId}/avatar`;\n this._data.owner.fullName = userFullName(this._data.owner);\n this._data.owner.initials = userInitials(this._data.owner.fullName);\n }\n\n /**\n * Unique test ID.\n *\n * @readonly\n */\n get id(): string {\n return this.data.id;\n }\n\n /**\n * Test last update (UTC) time in the format specified in\n * {@link https://www.wikipedia.org/wiki/ISO_8601 | ISO 8601}.\n *\n * @readonly\n */\n get lastModifiedAt(): string {\n return this.data.lastModifiedAt;\n }\n\n /**\n * Test name.\n */\n get name(): string {\n return this.data.name;\n }\n\n set name(value: string) {\n this.data.name = value;\n }\n\n /**\n * Test owner information.\n *\n * @property {string} userId - User ID.\n * @property {string} userName - User name.\n * @property {string} name - First name.\n * @property {string} lastName - Last name.\n * @property {string} fullName - Full name.\n * @property {string} initials - Initials.\n * @property {string} email - User email.\n * @property {string} avatarUrl - User avatar image URL.\n * @readonly\n */\n get owner(): IShortUserDescription {\n return this.data.owner;\n }\n\n /**\n * First selection set for clash detection. Objects from `selectionSetA` will be tested\n * against each others by objects from the `selectionSetB` during the test.\n *\n * @readonly\n */\n get selectionSetA(): string[] {\n return this.data.selectionSetA;\n }\n\n /**\n * The type of first selection set for clash detection. Can be one of:\n *\n * - `all` - All file/assembly objects.\n * - `handle` - Objects with original handles specified in the `selectionSetA`.\n * - `models` - All objects of the models with original handles specified in the `selectionSetA`.\n * - `searchquery` - Objects retrieved by the search queries specified in `selectionSetA`.\n *\n * @readonly\n */\n get selectionTypeA(): string {\n return this.data.selectionTypeA;\n }\n\n /**\n * Second selection set for clash detection. Objects from `selectionSetB` will be tested\n * against each others by objects from the `selectionSetA` during the test.\n *\n * @readonly\n */\n get selectionSetB(): string[] {\n return this.data.selectionSetB;\n }\n\n /**\n * The type of second selection set for clash detection. Can be one of:\n *\n * - `all` - All file/assembly objects.\n * - `handle` - Objects with original handles specified in the `selectionSetB`.\n * - `models` - All objects of the models with original handles specified in the `selectionSetB`.\n * - `searchquery` - Objects retrieved by the search queries specified in `selectionSetB`.\n *\n * @readonly\n */\n get selectionTypeB(): string {\n return this.data.selectionTypeB;\n }\n\n /**\n * Test status. Can be `none`, `waiting`, `inprogress`, `done` or `failed`.\n *\n * @readonly\n */\n get status(): string {\n return this.data.status;\n }\n\n /**\n * The distance of separation between objects at which test begins detecting clashes.\n *\n * @readonly\n */\n get tolerance(): number {\n return this.data.tolerance;\n }\n\n /**\n * Reloads test data from the server.\n */\n async checkout(): Promise<this> {\n const response = await this.internalGet(\"\");\n this.data = await response.json();\n return this;\n }\n\n /**\n * Updates test data on the server.\n *\n * @param data - Raw test data.\n */\n async update(data: any): Promise<this> {\n const response = await this.internalPut(\"\", data);\n this.data = await response.json();\n return this;\n }\n\n /**\n * Deletes a test and its results report from the server.\n *\n * @returns Returns the raw data of a deleted test.\n */\n delete(): Promise<any> {\n return this.internalDelete(\"\").then((response) => response.json());\n }\n\n /**\n * Saves test properties changes to the server. Call this method to update test data on the\n * server after any property changes.\n */\n save(): Promise<this> {\n return this.update(this.data);\n }\n\n /**\n * Waits for test to complete. Test is done when it changes to `done` or `failed` status.\n *\n * @param params - An object containing waiting parameters.\n * @param params.timeout - The time, in milliseconds that the function should wait test. If\n * test is not complete during this time, the `TimeoutError` exception will be thrown.\n * @param params.interval - The time, in milliseconds, the function should delay in between\n * checking test status.\n * @param params.signal - An\n * {@link https://developer.mozilla.org/docs/Web/API/AbortController | AbortController}\n * signal, which can be used to abort waiting as desired.\n * @param params.onCheckout - Waiting progress callback. Return `true` to cancel waiting.\n */\n waitForDone(params?: {\n timeout?: number;\n interval?: number;\n signal?: AbortSignal;\n onCheckout?: (test: ClashTest, ready: boolean) => boolean;\n }): Promise<this> {\n const checkDone = () =>\n this.checkout().then((test) => {\n const ready = [\"done\", \"failed\"].includes(test.status);\n const cancel = params?.onCheckout?.(test, ready);\n return cancel || ready;\n });\n return waitFor(checkDone, params).then(() => this);\n }\n\n /**\n * Returns a report with the clash detection results for this test.\n */\n getReport(): Promise<any> {\n return this.internalGet(\"/report\").then((response) => response.json());\n }\n}\n","///////////////////////////////////////////////////////////////////////////////\n// Copyright (C) 2002-2024, Open Design Alliance (the \"Alliance\").\n// All rights reserved.\n//\n// This software and its documentation and related materials are owned by\n// the Alliance. The software may only be incorporated into application\n// programs owned by members of the Alliance, subject to a signed\n// Membership Agreement and Supplemental Software License Agreement with the\n// Alliance. The structure and organization of this software are the valuable\n// trade secrets of the Alliance and its suppliers. The software is also\n// protected by copyright law and international treaty provisions. Application\n// programs incorporating this software must include the following statement\n// with their copyright notices:\n//\n// This application incorporates Open Design Alliance software pursuant to a\n// license agreement with Open Design Alliance.\n// Open Design Alliance Copyright (C) 2002-2024 by Open Design Alliance.\n// All rights reserved.\n//\n// By use of this software, its documentation or related materials, you\n// acknowledge and accept the above terms.\n///////////////////////////////////////////////////////////////////////////////\n\nimport { IHttpClient } from \"./IHttpClient\";\nimport { FetchError } from \"./FetchError\";\nimport { IAssociatedFileData, IAssemblyVersionInfo, IModelTransformMatrix } from \"./IAssembly\";\nimport { IShortUserDescription } from \"./IUser\";\nimport { Model } from \"./Model\";\nimport { ClashTest } from \"./ClashTest\";\nimport { waitFor, userFullName, userInitials } from \"./Utils\";\n\n/**\n * Provides properties and methods for obtaining information about an assembly on the server\n * and managing its data.\n */\nexport class Assembly {\n private _data: any;\n private _useVersion: number | undefined;\n public httpClient: IHttpClient;\n public path: string;\n\n /**\n * @param data - Raw assembly data received from the server.\n * @param httpClient - HTTP client instance used to send REST API requests to the server.\n */\n constructor(data: any, httpClient: IHttpClient) {\n this.path = `/assemblies/${data.id}`;\n this.httpClient = httpClient;\n this.data = data;\n }\n\n public appendVersionParam(relativePath: string): string {\n if (this._useVersion === undefined) return relativePath;\n const delimiter = relativePath.includes(\"?\") ? \"&\" : \"?\";\n return `${relativePath}${delimiter}version=${this._useVersion}`;\n }\n\n protected internalGet(relativePath: string, signal?: AbortSignal): Promise<Response> {\n relativePath = this.appendVersionParam(relativePath);\n return this.httpClient.get(`${this.path}${relativePath}`, signal);\n }\n\n protected internalPost(relativePath: string, body?: BodyInit | object): Promise<Response> {\n relativePath = this.appendVersionParam(relativePath);\n return this.httpClient.post(`${this.path}${relativePath}`, body);\n }\n\n protected internalPut(relativePath: string, body?: BodyInit | object): Promise<Response> {\n relativePath = this.appendVersionParam(relativePath);\n return this.httpClient.put(`${this.path}${relativePath}`, body);\n }\n\n protected internalDelete(relativePath: string): Promise<Response> {\n relativePath = this.appendVersionParam(relativePath);\n return this.httpClient.delete(`${this.path}${relativePath}`);\n }\n\n // Reserved for future use\n\n get activeVersion(): number {\n return this.data.activeVersion;\n }\n\n /**\n * List of unique files from which the assembly was created.\n *\n * @readonly\n */\n get associatedFiles(): IAssociatedFileData[] {\n return this.data.associatedFiles;\n }\n\n /**\n * Assembly creation time (UTC) in the format specified in\n * {@link https://www.wikipedia.org/wiki/ISO_8601 | ISO 8601}.\n *\n * @readonly\n */\n get created(): string {\n return this.data.created;\n }\n\n /**\n * Raw assembly data received from the server.\n *\n * @readonly\n */\n get data(): any {\n return this._data;\n }\n\n private set data(value: any) {\n this._data = value;\n this._data.owner.avatarUrl = `${this.httpClient.serverUrl}/users/${this._data.owner.userId}/avatar`;\n this._data.owner.fullName = userFullName(this._data.owner);\n this._data.owner.initials = userInitials(this._data.owner.fullName);\n // associatedFiles since 23.12\n this._data.associatedFiles ??= [];\n this._data.associatedFiles.forEach((file) => (file.link = `${this.httpClient.serverUrl}/files/${file.fileId}`));\n }\n\n /**\n * List of file IDs from which the assembly was created.\n *\n * @readonly\n */\n get files(): string[] {\n return this.data.files;\n }\n\n /**\n * Assembly geometry data type:\n *\n * - `vsfx` - `VSFX` format, assembly can be opened in `VisualizeJS` viewer.\n *\n * Returns an empty string if the geometry data is not yet ready.\n */\n get geometryType(): string {\n return this.status === \"done\" ? \"vsfx\" : \"\";\n }\n\n /**\n * Unique assembly ID.\n *\n * @readonly\n */\n get id(): string {\n return this.data.id;\n }\n\n /**\n * Assembly name.\n */\n get name(): string {\n return this.data.name;\n }\n\n set name(value: string) {\n this.data.name = value;\n }\n\n // Reserved for future use\n\n get originalAssemblyId(): string {\n return this.data.originalAssemblyId;\n }\n\n /**\n * Assembly owner information.\n *\n * @property {string} userId - User ID.\n * @property {string} userName - User name.\n * @property {string} name - First name.\n * @property {string} lastName - Last name.\n * @property {string} fullName - Full name.\n * @property {string} initials - Initials.\n * @property {string} email - User email.\n * @property {string} avatarUrl - User avatar image URL.\n * @readonly\n */\n get owner(): IShortUserDescription {\n return this.data.owner;\n }\n\n // Reserved for future use\n\n get previewUrl(): string {\n return this.data.previewUrl || \"\";\n }\n\n /**\n * List of assembly related job IDs.\n *\n * @readonly\n */\n get relatedJobs(): string[] {\n return this.data.relatedJobs;\n }\n\n /**\n * Assembly geometry data and properties status. Can be `waiting`, `inprogress`, `done` or `failed`.\n *\n * An assemblies without geometry data cannot be opened in viewer.\n *\n * @readonly\n */\n get status(): string {\n return this.data.status;\n }\n\n /**\n * Assembly type. Returns an `assembly` string.\n *\n * @readonly\n */\n get type(): string {\n return \"assembly\";\n }\n\n // Reserved for future use\n\n get version(): number {\n return this.data.version;\n }\n\n get versions(): IAssemblyVersionInfo[] {\n return this.data.versions;\n }\n\n /**\n * Reloads assembly data from the server.\n */\n async checkout(): Promise<this> {\n const response = await this.internalGet(\"\");\n this.data = await response.json();\n return this;\n }\n\n /**\n * Updates assembly data on the server.\n *\n * @param data - Raw assembly data.\n */\n async update(data: any): Promise<this> {\n const response = await this.internalPut(\"\", data);\n this.data = await response.json();\n return this;\n }\n\n /**\n * Deletes an assembly from the server.\n *\n * @returns Returns the raw data of a deleted assembly.\n */\n delete(): Promise<any> {\n return this.internalDelete(\"\").then((response) => response.json());\n }\n\n /**\n * Saves assembly properties changes to the server. Call this method to update assembly data\n * on the server after any property changes.\n */\n save(): Promise<this> {\n return this.update(this.data);\n }\n\n // Reserved for future use\n\n setPreview(image?: BodyInit | null): Promise<this> {\n console.warn(\"Assembly does not support preview\");\n return Promise.resolve(this);\n }\n\n deletePreview(): Promise<this> {\n console.warn(\"Assembly does not support preview\");\n return Promise.resolve(this);\n }\n\n /**\n * Returns list of assembly models.\n */\n getModels(): Promise<Model[]> {\n return this.internalGet(\"/geometry\")\n .then((response) => response.json())\n .then((array) => array.map((data: any) => new Model(data, this)));\n }\n\n /**\n * Returns a model transformation.\n *\n * @param handle - Model original handle.\n */\n getModelTransformMatrix(handle: string): IModelTransformMatrix {\n return this.data.transform[handle];\n }\n\n /**\n * Sets or removes a model transformation.\n *\n * @param handle - Model original handle.\n * @param transform - Transformation matrix. Specify `undefined` to remove transformation.\n */\n setModelTransformMatrix(handle: string, transform: IModelTransformMatrix): Promise<this> {\n const obj = { ...this.data.transform };\n obj[handle] = transform;\n return this.update({ transform: obj });\n }\n\n /**\n * Returns the properties for an objects in the assembly.\n *\n * @param handles - Object original handle or handles array. Specify `undefined` to get\n * properties for all objects in the assembly.\n * @returns {Promise<any>}\n */\n getProperties(handles?: string | string[]): Promise<any[]> {\n const relativePath = handles !== undefined ? `/properties?handles=${handles}` : \"/properties\";\n return this.internalGet(relativePath).then((response) => response.json());\n }\n\n /**\n * Returns the list of original handles for an objects in the file that match the specified\n * patterns. Search patterns may be combined using query operators.\n *\n * @example <caption>Simple search pattern.</caption>\n * searchPattern = {\n * key: \"Category\",\n * value: \"OST_Stairs\",\n * };\n *\n * @example <caption>Search patterns combination.</caption>\n * searchPattern = {\n * $or: [\n * {\n * $and: [\n * { key: \"Category\", value: \"OST_GenericModel\" },\n * { key: \"Level\", value: \"03 - Floor\" },\n * ],\n * },\n * { key: \"Category\", value: \"OST_Stairs\" },\n * ],\n * };\n *\n * @param searchPattern - Search pattern or combination of the patterns, see example below.\n */\n searchProperties(searchPattern: any): Promise<any[]> {\n return this.internalPost(\"/properties/search\", searchPattern).then((response) => response.json());\n }\n\n /**\n * Returns the CDA tree for an assembly.\n */\n getCdaTree(): Promise<any[]> {\n return this.internalGet(`/properties/tree`).then((response) => response.json());\n }\n\n /**\n * Returns a list of assembly viewpoints.\n */\n getViewpoints(): Promise<any[]> {\n return this.internalGet(\"/viewpoints\")\n .then((response) => response.json())\n .then((viewpoints) => viewpoints.result);\n }\n\n /**\n * Adds a new viewpoint to the assembly. To create a viewpoint use `Viewer.createViewpoint()`.\n *\n * @param viewpoint - Viewpoint.\n */\n saveViewpoint(viewpoint: any): Promise<any> {\n return this.internalPost(\"/viewpoints\", viewpoint).then((response) => response.json());\n }\n\n /**\n * Deletes the specified assembly viewpoint.\n *\n * @param guid - Viewpoint GUID.\n * @returns Returns the raw data of a deleted viewpoint.\n */\n deleteViewpoint(guid: any): Promise<any> {\n return this.internalDelete(`/viewpoints/${guid}`).then((response) => response.json());\n }\n\n /**\n * Returns viewpoint preview image as\n * {@link https://developer.mozilla.org/docs/Web/HTTP/Basics_of_HTTP/Data_URIs | Data URL}.\n *\n * @param guid - Viewpoint GUID.\n */\n getSnapshot(guid: any): Promise<any> {\n return this.internalGet(`/viewpoints/${guid}/snapshot`).then((response) => response.text());\n }\n\n /**\n * Returns viewpoint preview data.\n *\n * @param guid - Viewpoint GUID.\n * @param bitmapGuid - Bitmap GUID.\n */\n getSnapshotData(guid: any, bitmapGuid: any): Promise<string> {\n return this.internalGet(`/viewpoints/${guid}/bitmaps/${bitmapGuid}`).then((response) => response.text());\n }\n\n /**\n * Downloads an assembly resource file. Resource files are files that contain model scene\n * descriptions, or geometry data.\n *\n * @param dataId - Resource file name.\n * @param onProgress - Download progress callback.\n * @param signal - An\n * {@link https://developer.mozilla.org/docs/Web/API/AbortController | AbortController}\n * signal. Allows to communicate with a fetch request and abort it if desired.\n */\n downloadResource(\n dataId: string,\n onProgress?: (progress: number, chunk: Uint8Array) => void,\n signal?: AbortSignal\n ): Promise<ArrayBuffer> {\n const relativePath = this.appendVersionParam(`/downloads/${dataId}`);\n return this.httpClient\n .downloadFile(`${this.path}${relativePath}`, onProgress, signal)\n .then((response) => response.arrayBuffer());\n }\n\n /**\n * Downloads a part of assembly resource file. Resource files are files that contain model\n * scene descriptions, or geometry data.\n *\n * @param dataId - Resource file name.\n * @param ranges - A range of resource file contents to download.\n * @param requestId - Request ID for download progress callback.\n * @param onProgress - Download progress callback.\n * @param signal - An\n * {@link https://developer.mozilla.org/docs/Web/API/AbortController | AbortController}\n * signal. Allows to communicate with a fetch request and abort it if desired.\n */\n downloadResourceRange(\n dataId: string,\n requestId: number,\n ranges: Array<{ begin: number; end: number; requestId: number }>,\n onProgress?: (progress: number, chunk: Uint8Array, requestId: number) => void,\n signal?: AbortSignal\n ): Promise<ArrayBuffer> {\n const relativePath = this.appendVersionParam(`/downloads/${dataId}?requestId=${requestId}`);\n return this.httpClient\n .downloadFileRange(`${this.path}${relativePath}`, requestId, ranges, onProgress, signal)\n .then((response) => response.arrayBuffer());\n }\n\n /**\n * Deprecated since `25.3`. Use {@link downloadResource | downloadResource()} instead.\n *\n * @deprecated\n */\n partialDownloadResource(\n dataId: string,\n onProgress?: (progress: number, chunk: Uint8Array) => void,\n signal?: AbortSignal\n ): Promise<ArrayBuffer> {\n console.warn(\n \"Assembly.partialDownloadResource() has been deprecated since 25.3 and will be removed in a future release, use Assembly.downloadResource() instead.\"\n );\n return this.downloadResource(dataId, onProgress, signal);\n }\n\n /**\n * Deprecated since `25.3`. Use {@link downloadResourceRange | downloadResourceRange()} instead.\n */\n async downloadFileRange(\n requestId: number,\n records: any | null,\n dataId: string,\n onProgress?: (progress: number, chunk: Uint8Array, requestId: number) => void,\n signal?: AbortSignal\n ): Promise<void> {\n await this.downloadResourceRange(dataId, requestId, records, onProgress, signal);\n }\n\n // Reserved for future use\n\n getReferences(signal?: AbortSignal): Promise<any> {\n return Promise.resolve({ fileId: \"\", references: [] });\n }\n\n /**\n * Waits for assembly to be created. Assembly is created when it changes to `done` or `failed` status.\n *\n * @param params - An object containing waiting parameters.\n * @param params.timeout - The time, in milliseconds that the function should wait assembly.\n * If assembly is not created during this time, the `TimeoutError` exception will be thrown.\n * @param params.interval - The time, in milliseconds, the function should delay in between\n * checking assembly status.\n * @param params.signal - An\n * {@link https://developer.mozilla.org/docs/Web/API/AbortController | AbortController}\n * signal, which can be used to abort waiting as desired.\n * @param params.onCheckout - Waiting progress callback. Return `true` to cancel waiting.\n */\n waitForDone(params?: {\n timeout?: number;\n interval?: number;\n signal?: AbortSignal;\n onCheckout?: (assembly: Assembly, ready: boolean) => boolean;\n }): Promise<this> {\n const checkDone = () =>\n this.checkout().then((assembly) => {\n const ready = [\"done\", \"failed\"].includes(assembly.status);\n const cancel = params?.onCheckout?.(assembly, ready);\n return cancel || ready;\n });\n\n return waitFor(checkDone, params).then(() => this);\n }\n\n /**\n * Returns a list of assembly clash tests.\n *\n * @param start - The starting index in the test list. Used for paging.\n * @param limit - The maximum number of tests that should be returned per request. Used for paging.\n * @param name - Filter the tests by part of the name. Case sensitive.\n * @param ids - List of tests IDs to return.\n * @param sortByDesc - Allows to specify the descending order of the result. By default tests\n * are sorted by name in ascending order.\n * @param sortField - Allows to specify sort field.\n */\n getClashTests(\n start?: number,\n limit?: number,\n name?: string,\n ids?: string | string[],\n sortByDesc?: boolean,\n sortField?: string\n ): Promise<{ allSize: number; start: number; limit: number; result: ClashTest[]; size: number }> {\n const searchParams = new URLSearchParams();\n if (start > 0) searchParams.set(\"start\", start.toString());\n if (limit > 0) searchParams.set(\"limit\", limit.toString());\n if (name) searchParams.set(\"name\", name);\n if (ids) {\n if (Array.isArray(ids)) ids = ids.join(\"|\");\n if (typeof ids === \"string\") ids = ids.trim();\n if (ids) searchParams.set(\"id\", ids);\n }\n if (sortByDesc !== undefined) searchParams.set(\"sortBy\", sortByDesc ? \"desc\" : \"asc\");\n if (sortField) searchParams.set(\"sortField\", sortField);\n\n let queryString = searchParams.toString();\n if (queryString) queryString = \"?\" + queryString;\n\n return this.internalGet(`/clashes${queryString}`)\n .then((response) => response.json())\n .then((tests) => {\n return {\n ...tests,\n result: tests.result.map((data) => new ClashTest(data, this.path, this.httpClient)),\n };\n });\n }\n\n /**\n * Returns information about the specified assembly clash test.\n *\n * @param testId - Test ID.\n */\n getClashTest(testId: string): Promise<ClashTest> {\n return this.internalGet(`/clashes/${testId}`)\n .then((response) => response.json())\n .then((data) => new ClashTest(data, this.path, this.httpClient));\n }\n\n /**\n * Creates an assembly clash test. Assembly must be in a `done` state, otherwise the test will fail.\n *\n * @param name - Test name.\n * @param selectionTypeA - The type of first selection set for clash detection. Can be one of:\n *\n * - `all` - All file/assembly objects.\n * - `handle` - Objects with original handles specified in the `selectionSetA`.\n * - `models` - All objects of the models with original handles specified in the `selectionSetA`.\n * - `searchquery` - Objects retrieved by the search queries specified in `selectionSetA`.\n *\n * @param selectionTypeB - The type of second selection set for clash detection. Can be one of:\n *\n * - `all` - All file/assembly objects.\n * - `handle` - Objects with original handles specified in the `selectionSetB`.\n * - `models` - All objects of the models with original handles specified in the `selectionSetB`.\n * - `searchquery` - Objects retrieved by the search queries specified in `selectionSetB`.\n *\n * @param selectionSetA - First selection set for clash detection. Objects from\n * `selectionSetA` will be tested against each others by objects from the `selectionSetB`\n * during the test.\n * @param selectionSetB - Second selection set for clash detection. Objects from\n * `selectionSetB` will be tested against each others by objects from the `selectionSetA`\n * during the test.\n * @param params - An object containing test parameters.\n * @param params.tolerance - The distance of separation between objects at which test begins\n * detecting clashes.\n * @param params.clearance - The type of the clashes that the test detects:\n *\n * - `true` - Сlearance clash. A clash in which the object A may or may not intersect with\n * object B, but comes within a distance of less than the `tolerance`.\n * - `false` - Hard clash. A clash in which the object A intersects with object B by a distance\n * of more than the `tolerance`.\n *\n * @param params.waitForDone - Wait for test to complete.\n * @param params.timeout - The time, in milliseconds that the function should wait test. If\n * test is not complete during this time, the `TimeoutError` exception will be thrown.\n * @param params.interval - The time, in milliseconds, the function should delay in between\n * checking test status.\n * @param params.signal - An\n * {@link https://developer.mozilla.org/docs/Web/API/AbortController | AbortController}\n * signal, which can be used to abort waiting as desired.\n */\n createClashTest(\n name: string,\n selectionTypeA: string,\n selectionTypeB: string,\n selectionSetA?: string | string[],\n selectionSetB?: string | string[],\n params?: {\n tolerance?: number | string;\n clearance?: boolean;\n waitForDone?: boolean;\n timeout?: number;\n interval?: number;\n signal?: AbortSignal;\n }\n ): Promise<ClashTest> {\n const { tolerance, clearance, waitForDone } = params ?? {};\n if (!Array.isArray(selectionSetA)) selectionSetA = [selectionSetA];\n if (!Array.isArray(selectionSetB)) selectionSetB = [selectionSetB];\n\n return this.internalPost(\"/clashes\", {\n name,\n selectionTypeA,\n selectionTypeB,\n selectionSetA,\n selectionSetB,\n tolerance,\n clearance,\n })\n .then((response) => response.json())\n .then((data) => new ClashTest(data, this.path, this.httpClient))\n .then((result) => (waitForDone ? result.waitForDone(params) : result));\n }\n\n /**\n * Deletes the specified assembly clash test.\n *\n * @param testId - Test ID.\n * @returns Returns the raw data of a deleted test.\n */\n deleteClashTest(testId: string): Promise<any> {\n return this.internalDelete(`/clashes/${testId}`).then((response) => response.json());\n }\n\n // Reserved for future use\n\n updateVersion(\n files?: string[],\n params: {\n waitForDone?: boolean;\n timeout?: number;\n interval?: number;\n signal?: AbortSignal;\n onProgress?: (progress: number, file: globalThis.File) => void;\n } = {\n waitForDone: false,\n }\n ): Promise<Assembly> {\n return Promise.reject(new Error(\"Assembly version support will be implemeted in a future release\"));\n }\n\n getVersions(): Promise<Assembly[] | undefined> {\n return Promise.resolve(undefined);\n }\n\n getVersion(version: number): Promise<Assembly> {\n return Promise.reject(new FetchError(404));\n }\n\n deleteVersion(version: number): Promise<any> {\n return Promise.reject(new FetchError(404));\n }\n\n setActiveVersion(version: number): Promise<this> {\n return this.update({ activeVersion: version });\n }\n\n useVersion(version?: number): this {\n this._useVersion = undefined;\n return this;\n }\n}\n","class EventEmitter2 {\n constructor() {\n this._listeners = {};\n }\n addEventListener(type, listener) {\n if (this._listeners[type] === undefined) this._listeners[type] = [];\n this._listeners[type].push(listener);\n return this;\n }\n removeEventListener(type, listener) {\n if (this._listeners[type] === undefined) return this;\n const listeners = this._listeners[type].filter((x => x !== listener));\n if (listeners.length !== 0) this._listeners[type] = listeners; else delete this._listeners[type];\n return this;\n }\n removeAllListeners(type) {\n if (type) delete this._listeners[type]; else this._listeners = {};\n return this;\n }\n emitEvent(event) {\n if (this._listeners[event.type] === undefined) return false;\n const invoke = this._listeners[event.type].slice();\n invoke.forEach((listener => listener.call(this, event)));\n return true;\n }\n on(type, listener) {\n return this.addEventListener(type, listener);\n }\n off(type, listener) {\n return this.removeEventListener(type, listener);\n }\n emit(type, ...args) {\n if (typeof type === \"string\") return this.emitEvent({\n type: type,\n args: args\n }); else if (typeof type === \"object\") return this.emitEvent(type); else return false;\n }\n}\n\nexport { EventEmitter2 };\n//# sourceMappingURL=eventemitter2.module.js.map\n","///////////////////////////////////////////////////////////////////////////////\n// Copyright (C) 2002-2024, Open Design Alliance (the \"Alliance\").\n// All rights reserved.\n//\n// This software and its documentation and related materials are owned by\n// the Alliance. The software may only be incorporated into application\n// programs owned by members of the Alliance, subject to a signed\n// Membership Agreement and Supplemental Software License Agreement with the\n// Alliance. The structure and organization of this software are the valuable\n// trade secrets of the Alliance and its suppliers. The software is also\n// protected by copyright law and international treaty provisions. Application\n// programs incorporating this software must include the following statement\n// with their copyright notices:\n//\n// This application incorporates Open Design Alliance software pursuant to a\n// license agreement with Open Design Alliance.\n// Open Design Alliance Copyright (C) 2002-2024 by Open Design Alliance.\n// All rights reserved.\n//\n// By use of this software, its documentation or related materials, you\n// acknowledge and accept the above terms.\n///////////////////////////////////////////////////////////////////////////////\n\nimport { FetchError, error400 } from \"./FetchError\";\n\nfunction handleFetchError(response: Response): Promise<Response> {\n if (!response.ok) {\n switch (response.status) {\n case 400: {\n return response.text().then((text) => {\n console.error(text);\n return Promise.reject(new FetchError(400, error400(text)));\n });\n }\n case 500: {\n return response.text().then((text) => {\n console.error(error400(text, text));\n return Promise.reject(new FetchError(500));\n });\n }\n default:\n return Promise.reject(new FetchError(response.status));\n }\n }\n return Promise.resolve(response);\n}\n\nexport function $fetch(\n url: string,\n params: {\n method: \"GET\" | \"POST\" | \"PUT\" | \"DELETE\";\n headers?: HeadersInit;\n body?: BodyInit | object;\n signal?: AbortSignal;\n } = { method: \"GET\" }\n): Promise<Response> {\n const headers = { ...params.headers };\n delete headers[\"Content-Type\"];\n\n let body: FormData | string | undefined = undefined;\n if (params.method === \"POST\" || params.method === \"PUT\") {\n if (params.body instanceof FormData) {\n body = params.body;\n } else if (params.body instanceof Blob) {\n body = new FormData();\n body.append(\"file\", params.body);\n } else if (params.body instanceof ArrayBuffer) {\n body = new FormData();\n body.append(\"file\", new Blob([params.body]));\n } else if (typeof params.body === \"object\") {\n body = JSON.stringify(params.body);\n headers[\"Content-Type\"] = \"application/json\";\n } else if (typeof params.body === \"string\") {\n body = params.body;\n headers[\"Content-Type\"] = \"text/plain\";\n }\n }\n\n const init: RequestInit = { method: params.method, headers };\n if (body) init.body = body;\n if (params.signal) init.signal = params.signal;\n\n return fetch(url, init).then(handleFetchError);\n}\n","///////////////////////////////////////////////////////////////////////////////\n// Copyright (C) 2002-2024, Open Design Alliance (the \"Alliance\").\n// All rights reserved.\n//\n// This software and its documentation and related materials are owned by\n// the Alliance. The software may only be incorporated into application\n// programs owned by members of the Alliance, subject to a signed\n// Membership Agreement and Supplemental Software License Agreement with the\n// Alliance. The structure and organization of this software are the valuable\n// trade secrets of the Alliance and its suppliers. The software is also\n// protected by copyright law and international treaty provisions. Application\n// programs incorporating this software must include the following statement\n// with their copyright notices:\n//\n// This application incorporates Open Design Alliance software pursuant to a\n// license agreement with Open Design Alliance.\n// Open Design Alliance Copyright (C) 2002-2024 by Open Design Alliance.\n// All rights reserved.\n//\n// By use of this software, its documentation or related materials, you\n// acknowledge and accept the above terms.\n///////////////////////////////////////////////////////////////////////////////\n\nimport { FetchError, error400 } from \"./FetchError\";\n\nfunction handleXMLHttpError(xhr: XMLHttpRequest): Promise<XMLHttpRequest> {\n if (xhr.status === 0) {\n return Promise.reject(new FetchError(0, \"Network error\"));\n }\n if (xhr.status < 200 || xhr.status > 299) {\n switch (xhr.status) {\n case 400: {\n console.error(xhr.responseText);\n return Promise.reject(new FetchError(400, error400(xhr.responseText)));\n }\n case 500: {\n console.error(error400(xhr.responseText, xhr.responseText));\n return Promise.reject(new FetchError(500));\n }\n default: {\n return Promise.reject(new FetchError(xhr.status));\n }\n }\n }\n return Promise.resolve(xhr);\n}\n\nexport function $xmlhttp(\n url: string,\n params: {\n method: \"GET\" | \"POST\" | \"PUT\" | \"DELETE\";\n headers?: HeadersInit;\n body?: XMLHttpRequestBodyInit;\n uploadProgress?: (progress: number) => void;\n downloadProgress?: (progress: number) => void;\n } = { method: \"GET\" }\n): Promise<XMLHttpRequest> {\n return new Promise((resolve, reject) => {\n const xhr = new XMLHttpRequest();\n xhr.open(params.method, url, true);\n for (const key in params.headers) {\n xhr.setRequestHeader(key, params.headers[key]);\n }\n function calcProgress(event: ProgressEvent): number {\n return event.lengthComputable ? event.loaded / event.total : 1;\n }\n xhr.upload.onprogress = (event) => params.uploadProgress && params.uploadProgress(calcProgress(event));\n xhr.onprogress = (event) => params.downloadProgress && params.downloadProgress(calcProgress(event));\n xhr.onloadend = (event) => handleXMLHttpError(event.target as XMLHttpRequest).then(resolve, reject);\n xhr.send(params.body);\n });\n}\n","///////////////////////////////////////////////////////////////////////////////\n// Copyright (C) 2002-2024, Open Design Alliance (the \"Alliance\").\n// All rights reserved.\n//\n// This software and its documentation and related materials are owned by\n// the Alliance. The software may only be incorporated into application\n// programs owned by members of the Alliance, subject to a signed\n// Membership Agreement and Supplemental Software License Agreement with the\n// Alliance. The structure and organization of this software are the valuable\n// trade secrets of the Alliance and its suppliers. The software is also\n// protected by copyright law and international treaty provisions. Application\n// programs incorporating this software must include the following statement\n// with their copyright notices:\n//\n// This application incorporates Open Design Alliance software pursuant to a\n// license agreement with Open Design Alliance.\n// Open Design Alliance Copyright (C) 2002-2024 by Open Design Alliance.\n// All rights reserved.\n//\n// By use of this software, its documentation or related materials, you\n// acknowledge and accept the above terms.\n///////////////////////////////////////////////////////////////////////////////\n\nimport { IHttpClient } from \"./IHttpClient\";\nimport { $fetch } from \"./Fetch\";\nimport { $xmlhttp } from \"./XMLHttp\";\n\nexport class HttpClient implements IHttpClient {\n public serverUrl: string;\n public headers: HeadersInit = {};\n public signInUserId = \"\";\n public signInUserIsAdmin = false;\n\n constructor(serverUrl: string) {\n this.serverUrl = serverUrl;\n }\n\n get(relativePath: string, signal?: AbortSignal): Promise<Response> {\n return $fetch(`${this.serverUrl}${relativePath}`, { method: \"GET\", headers: this.headers, signal });\n }\n\n post(relativePath: string, body?: BodyInit | object): Promise<Response> {\n return $fetch(`${this.serverUrl}${relativePath}`, { method: \"POST\", headers: this.headers, body });\n }\n\n put(relativePath: string, body?: BodyInit | object): Promise<Response> {\n return $fetch(`${this.serverUrl}${relativePath}`, { method: \"PUT\", headers: this.headers, body });\n }\n\n delete(relativePath: string): Promise<Response> {\n return $fetch(`${this.serverUrl}${relativePath}`, { method: \"DELETE\", headers: this.headers });\n }\n\n uploadFile(relativePath: string, file: File, onProgress?: (progress: number) => void): Promise<XMLHttpRequest> {\n const data = new FormData();\n data.append(\"file\", file);\n return $xmlhttp(`${this.serverUrl}${relativePath}`, {\n method: \"POST\",\n headers: this.headers,\n body: data,\n uploadProgress: onProgress,\n });\n }\n\n // async downloadFile(\n // relativePath: string,\n // onProgress?: (progress: number, chunk: Uint8Array) => void,\n // signal?: AbortSignal\n // ): Promise<Response> {\n // const response = await this.get(relativePath, signal);\n // const teedOff = response.body.tee();\n // if (onProgress) {\n // const contentLength = response.headers.get(\"Content-Length\");\n // const total = parseInt(contentLength, 10) || 1;\n // let loaded = 0;\n // const reader = teedOff[0].getReader();\n // reader.read().then(function processChunk({ done, value }) {\n // if (done) return;\n // loaded += value.length;\n // onProgress(loaded / total, value);\n // reader.read().then(processChunk);\n // });\n // }\n // return new Response(teedOff[1]);\n // }\n\n async downloadFile(\n relativePath: string,\n onProgress?: (progress: number, chunk: Uint8Array) => void,\n signal?: AbortSignal\n ): Promise<Response> {\n const response = await this.get(relativePath, signal);\n const contentLength = response.headers.get(\"Content-Length\");\n const total = parseInt(contentLength || \"\", 10) || 1;\n return new Response(\n new ReadableStream({\n async start(controller) {\n const reader = response.body.getReader();\n let loaded = 0;\n while (true) {\n const { done, value } = await reader.read();\n if (done) break;\n controller.enqueue(value);\n loaded += value.length;\n if (onProgress) onProgress(loaded / total, value);\n }\n controller.close();\n },\n })\n );\n }\n\n async downloadFileRange(\n relativePath: string,\n requestId: number,\n ranges: Array<{ begin: number; end: number; requestId: number }>,\n onProgress?: (progress: number, chunk: Uint8Array, requestId: number) => void,\n signal?: AbortSignal\n ): Promise<Response> {\n const headers = { ...this.headers };\n headers[\"Range\"] = \"bytes=\" + ranges.map((x) => `${x.begin}-${x.end}`).join(\",\");\n const response = await $fetch(`${this.serverUrl}${relativePath}`, { method: \"GET\", headers, signal });\n const contentLength = response.headers.get(\"content-length\");\n const total = parseInt(contentLength || \"\", 10) || 1;\n return new Response(\n new ReadableStream({\n async start(controller) {\n const reader = response.body.getReader();\n let loaded = 0;\n let rangedIndex = 0;\n let rangePos = 0;\n while (true) {\n const { done, value } = await reader.read();\n if (done) break;\n controller.enqueue(value);\n loaded += value.length;\n let chunkLeft = value.length;\n let chunkPos = 0;\n while (chunkLeft > 0) {\n const range = ranges[rangedIndex];\n const rangeLeft = range.end - range.begin - rangePos;\n if (chunkLeft < rangeLeft) {\n const chunk = value.subarray(chunkPos, chunkPos + chunkLeft);\n if (onProgress) onProgress(loaded / total, chunk, range.requestId);\n rangePos += chunkLeft;\n chunkLeft = 0;\n } else {\n const chunk = value.subarray(chunkPos, chunkPos + rangeLeft);\n if (onProgress) onProgress(loaded / total, chunk, range.requestId);\n chunkPos += rangeLeft;\n chunkLeft -= rangeLeft;\n rangedIndex++;\n rangePos = 0;\n }\n }\n }\n controller.close();\n },\n })\n );\n }\n}\n","///////////////////////////////////////////////////////////////////////////////\n// Copyright (C) 2002-2024, Open Design Alliance (the \"Alliance\").\n// All rights reserved.\n//\n// This software and its documentation and related materials are owned by\n// the Alliance. The software may only be incorporated into application\n// programs owned by members of the Alliance, subject to a signed\n// Membership Agreement and Supplemental Software License Agreement with the\n// Alliance. The structure and organization of this software are the valuable\n// trade secrets of the Alliance and its suppliers. The software is also\n// protected by copyright law and international treaty provisions. Application\n// programs incorporating this software must include the following statement\n// with their copyright notices:\n//\n// This application incorporates Open Design Alliance software pursuant to a\n// license agreement with Open Design Alliance.\n// Open Design Alliance Copyright (C) 2002-2024 by Open Design Alliance.\n// All rights reserved.\n//\n// By use of this software, its documentation or related materials, you\n// acknowledge and accept the above terms.\n///////////////////////////////////////////////////////////////////////////////\n\nimport { IHttpClient } from \"./IHttpClient\";\n\n/**\n * Provides properties and methods for obtaining information about {@link File | file} actions\n * granted to a specific {@link User | users}, or project {@link Member | member}.\n */\nexport class Permission {\n private _data: any;\n public fileId: string;\n public httpClient: IHttpClient;\n\n /**\n * @param data - Raw permission data received from the server.\n * @param fileId - Owner file ID.\n * @param httpClient - HTTP client instance used to send REST API requests to the server.\n */\n constructor(data: any, fileId: string, httpClient: IHttpClient) {\n this.httpClient = httpClient;\n this.fileId = fileId;\n this.data = data;\n }\n\n private internalGet(): Promise<Response> {\n return this.httpClient.get(`/files/${this.fileId}/permissions/${this.id}`);\n }\n\n private internalPut(body?: BodyInit | object): Promise<Response> {\n return this.httpClient.put(`/files/${this.fileId}/permissions/${this.id}`, body);\n }\n\n private internalDelete(): Promise<Response> {\n return this.httpClient.delete(`/files/${this.fileId}/permissions/${this.id}`);\n }\n\n /**\n * Defines what actions are allowed to be performed on a file with this permission:\n *\n * - `read` - The ability to read file description, geometry data and properties.\n * - `readSourceFile` - The ability to read source file.\n * - `write` - The ability to modify file name, description and references.\n * - `readViewpoint` - The ability to read file viewpoints.\n * - `createViewpoint` - The ability to create file viewpoints.\n */\n get actions(): string[] {\n return this.data.actions;\n }\n\n set actions(value: string[]) {\n this._data.actions = value;\n }\n\n /**\n * Raw permission data received from the server.\n *\n * @readonly\n */\n get data(): any {\n return this._data;\n }\n\n private set data(value: any) {\n this._data = value;\n }\n\n /**\n * Unique permission ID.\n *\n * @readonly\n */\n get id(): string {\n return this.data.id;\n }\n\n /**\n * Principials are any entity that can be authenticated by the server, such as a any user or\n * project that will get access to the file.\n *\n * @typedef {any} Principial\n * @property {any} user - The user entry that get access to the file.\n * @property {string} user.id - User ID.\n * @property {string} user.name - User name.\n * @property {any} project - The project entry that get access to the file.\n * @property {string} project.id - Project ID.\n * @property {string} project.name - Project name.\n */\n\n /**\n * A list of principials that will get access to the file.\n */\n get grantedTo(): any[] {\n return this.data.grantedTo;\n }\n\n set grantedTo(value: any[]) {\n this.data.grantedTo = value;\n }\n\n /**\n * Specifies whether all users have access to the file or not.\n */\n get public(): boolean {\n return this.data.public;\n }\n\n set public(value: boolean) {\n this.data.public = value;\n }\n\n /**\n * Reloads permission data from the server.\n */\n async checkout(): Promise<this> {\n const response = await this.internalGet();\n this.data = await response.json();\n return this;\n }\n\n /**\n * Updates permission data on the server.\n *\n * @param data - Raw permission data.\n */\n async update(data: any): Promise<this> {\n const response = await this.internalPut(data);\n this.data = await response.json();\n return this;\n }\n\n /**\n * Removes a permission from the file.\n *\n * @returns Returns the raw data of a deleted permission.\n */\n delete(): Promise<any> {\n return this.internalDelete().then((response) => response.json());\n }\n\n /**\n * Saves permission properties changes to the server. Call this method to update permission\n * data on the server after any property changes.\n */\n save(): Promise<this> {\n return this.update(this.data);\n }\n}\n","///////////////////////////////////////////////////////////////////////////////\n// Copyright (C) 2002-2024, Open Design Alliance (the \"Alliance\").\n// All rights reserved.\n//\n// This software and its documentation and related materials are owned by\n// the Alliance. The software may only be incorporated into application\n// programs owned by members of the Alliance, subject to a signed\n// Membership Agreement and Supplemental Software License Agreement with the\n// Alliance. The structure and organization of this software are the valuable\n// trade secrets of the Alliance and its suppliers. The software is also\n// protected by copyright law and international treaty provisions. Application\n// programs incorporating this software must include the following statement\n// with their copyright notices:\n//\n// This application incorporates Open Design Alliance software pursuant to a\n// license agreement with Open Design Alliance.\n// Open Design Alliance Copyright (C) 2002-2024 by Open Design Alliance.\n// All rights reserved.\n//\n// By use of this software, its documentation or related materials, you\n// acknowledge and accept the above terms.\n///////////////////////////////////////////////////////////////////////////////\n\nimport { IHttpClient } from \"./IHttpClient\";\nimport { waitFor } from \"./Utils\";\n\n/**\n * Provides properties and methods for obtaining information about a job on the server.\n */\nexport class Job {\n private _data: any;\n public httpClient: IHttpClient;\n\n /**\n * @param data - Raw job data received from the server.\n * @param httpClient - HTTP client instance used to send REST API requests to the server.\n */\n constructor(data: any, httpClient: IHttpClient) {\n this.httpClient = httpClient;\n this.data = data;\n }\n\n protected internalGet(): Promise<Response> {\n return this.httpClient.get(`/jobs/${this.data.id}`);\n }\n\n protected internalPut(body?: BodyInit | object): Promise<Response> {\n return this.httpClient.put(`/jobs/${this.data.id}`, body);\n }\n\n protected internalDelete(): Promise<Response> {\n return this.httpClient.delete(`/jobs/${this.data.id}`);\n }\n\n /**\n * The ID of the assembly the job is working on (internal).\n *\n * @readonly\n */\n get assemblyId(): string {\n return this.data.assemblyId;\n }\n\n /**\n * Job creator ID. Use {@link Client.getUser | Client.getUser()} to obtain detailed creator information.\n *\n * @readonly\n */\n get authorId(): string {\n return this.data.authorId;\n }\n\n /**\n * Job creation time (UTC) in the format specified in\n * {@link https://www.wikipedia.org/wiki/ISO_8601 | ISO 8601}.\n *\n * @readonly\n */\n get createdAt(): string {\n return this.data.createdAt;\n }\n\n /**\n * Raw job data received from the server.\n *\n * @readonly\n */\n get data(): any {\n return this._data;\n }\n\n private set data(value: any) {\n this._data = value;\n }\n\n /**\n * `true` if job is `done` or `failed`. See {@link status} for more details.\n *\n * @readonly\n */\n get done(): boolean {\n return this.data.status === \"done\" || this.data.status === \"failed\";\n }\n\n /**\n * The ID of the file the job is working on.\n *\n * @readonly\n */\n get fileId(): string {\n return this.data.fileId;\n }\n\n /**\n * Unique job ID.\n *\n * @readonly\n */\n get id(): string {\n return this.data.id;\n }\n\n /**\n * Job last update (UTC) time in the format specified in\n * {@link https://www.wikipedia.org/wiki/ISO_8601 | ISO 8601}.\n *\n * @readonly\n */\n get lastUpdate(): string {\n return this.data.lastUpdate;\n }\n\n /**\n * Job type. Can be `properties`, `geomerty`, `geomertyGltf`, `validation`, `clash`, `dwg`,\n * `obj`, `gltf`, `glb`, `vsf`, `pdf`, `3dpdf` or custom job name.\n *\n * @readonly\n */\n get outputFormat(): string {\n return this.data.outputFormat;\n }\n\n /**\n * Parameters for the job runner.\n *\n * @readonly\n */\n get parameters(): any {\n return this.data.parameters;\n }\n\n /**\n * Job status. Can be `waiting`, `inprogress`, `done` or `failed`.\n *\n * @readonly\n */\n get status(): string {\n return this.data.status;\n }\n\n /**\n * Job status description message.\n *\n * @readonly\n */\n get statusMessage(): string {\n return this.data.statusMessage;\n }\n\n /**\n * Job starting time (UTC) in the format specified in\n * {@link https://www.wikipedia.org/wiki/ISO_8601 | ISO 8601}.\n *\n * @readonly\n */\n get startedAt(): string {\n return this.data.startedAt;\n }\n\n /**\n * Reloads job data from the server.\n */\n async checkout(): Promise<this> {\n const response = await this.internalGet();\n this.data = await response.json();\n return this;\n }\n\n /**\n * Updates job data on the server.\n *\n * Only administrators can update job data. If the current logged in user is not an\n * administrator, an exception will be thrown.\n *\n * @param data - Raw job data.\n */\n async update(data: any): Promise<this> {\n const response = await this.internalPut(data);\n this.data = await response.json();\n return this;\n }\n\n /**\n * Deletes a job from the server job list. Jobs that are in progress or have already been\n * completed cannot be deleted.\n *\n * @returns Returns the raw data of a deleted job.\n */\n delete(): Promise<any> {\n return this.internalDelete().then((response) => response.json());\n }\n\n // /**\n // * Save job properties changes to the server. Call this method to update job data on the server\n // * after any property changes.\n // */\n // save() {\n // return this.update(this.data);\n // }\n\n /**\n * Waits for job to be done. Job is done when it changes to `done` or `failed` status.\n *\n * @param params - An object containing waiting parameters.\n * @param params.timeout - The time, in milliseconds that the function should wait job. If\n * jobs is not done during this time, the `TimeoutError` exception will be thrown.\n * @param params.interval - The time, in milliseconds, the function should delay in between\n * checking job status.\n * @param params.signal - An\n * {@link https://developer.mozilla.org/docs/Web/API/AbortController | AbortController}\n * signal, which can be used to abort waiting as desired.\n * @param params.onCheckout - Waiting progress callback. Return `true` to cancel waiting.\n */\n waitForDone(params?: {\n timeout?: number;\n interval?: number;\n signal?: AbortSignal;\n onCheckout?: (job: Job, ready: boolean) => boolean;\n }): Promise<this> {\n const checkDone = () =>\n this.checkout().then((job) => {\n const ready = [\"done\", \"failed\"].includes(job.status);\n const cancel = params?.onCheckout?.(job, ready);\n return cancel || ready;\n });\n\n return waitFor(checkDone, params).then(() => this);\n }\n}\n","///////////////////////////////////////////////////////////////////////////////\n// Copyright (C) 2002-2024, Open Design Alliance (the \"Alliance\").\n// All rights reserved.\n//\n// This software and its documentation and related materials are owned by\n// the Alliance. The software may only be incorporated into application\n// programs owned by members of the Alliance, subject to a signed\n// Membership Agreement and Supplemental Software License Agreement with the\n// Alliance. The structure and organization of this software are the valuable\n// trade secrets of the Alliance and its suppliers. The software is also\n// protected by copyright law and international treaty provisions. Application\n// programs incorporating this software must include the following statement\n// with their copyright notices:\n//\n// This application incorporates Open Design Alliance software pursuant to a\n// license agreement with Open Design Alliance.\n// Open Design Alliance Copyright (C) 2002-2024 by Open Design Alliance.\n// All rights reserved.\n//\n// By use of this software, its documentation or related materials, you\n// acknowledge and accept the above terms.\n///////////////////////////////////////////////////////////////////////////////\n\nimport { IHttpClient } from \"./IHttpClient\";\nimport { IFileStatus, IFileReferences, IFileVersionInfo } from \"./IFile\";\nimport { IShortUserDescription } from \"./IUser\";\nimport { Model } from \"./Model\";\nimport { Permission } from \"./Permission\";\nimport { Job } from \"./Job\";\nimport { waitFor, parseArgs, userFullName, userInitials } from \"./Utils\";\n\n/**\n * Provides properties and methods for obtaining information about a file on the server and\n * managing its data and versions.\n */\nexport class File {\n private _data: any;\n private _useVersion: number | undefined;\n public httpClient: IHttpClient;\n public path: string;\n\n /**\n * @param data - Raw file data received from the server.\n * @param httpClient - HTTP client instance used to send REST API requests to the server.\n */\n constructor(data: any, httpClient: IHttpClient) {\n this.path = `/files/${data.id}`;\n this.httpClient = httpClient;\n this.data = data;\n }\n\n private appendVersionParam(relativePath: string): string {\n if (this._useVersion === undefined) return relativePath;\n const delimiter = relativePath.includes(\"?\") ? \"&\" : \"?\";\n return `${relativePath}${delimiter}version=${this._useVersion}`;\n }\n\n private internalGet(relativePath: string, signal?: AbortSignal): Promise<Response> {\n relativePath = this.appendVersionParam(relativePath);\n return this.httpClient.get(`${this.path}${relativePath}`, signal);\n }\n\n private internalPost(relativePath: string, body?: BodyInit | object): Promise<Response> {\n relativePath = this.appendVersionParam(relativePath);\n return this.httpClient.post(`${this.path}${relativePath}`, body);\n }\n\n private internalPut(relativePath: string, body?: BodyInit | object): Promise<Response> {\n relativePath = this.appendVersionParam(relativePath);\n return this.httpClient.put(`${this.path}${relativePath}`, body);\n }\n\n private internalDelete(relativePath: string): Promise<Response> {\n relativePath = this.appendVersionParam(relativePath);\n return this.httpClient.delete(`${this.path}${relativePath}`);\n }\n\n /**\n * Active version number of the file.\n *\n * @readonly\n */\n get activeVersion(): number {\n return this.data.activeVersion;\n }\n\n /**\n * File creation time (UTC) in the format specified in\n * {@link https://www.wikipedia.org/wiki/ISO_8601 | ISO 8601}.\n *\n * @readonly\n */\n get created(): string {\n return this.data.created;\n }\n\n /**\n * File custom fields object, to store custom data.\n *\n * @readonly\n */\n get customFields(): any {\n return this.data.customFields;\n }\n\n set customFields(value: any) {\n this.data.customFields = value;\n }\n\n /**\n * Raw file data received from the server.\n *\n * @readonly\n */\n get data(): any {\n return this._data;\n }\n\n private set data(value: any) {\n this._data = value;\n this._data.previewUrl = value.preview\n ? `${this.httpClient.serverUrl}${this.path}/preview?updated=${value.updatedAt}`\n : \"\";\n // owner since 24.8\n if (typeof this._data.owner === \"string\") this._data.owner = { userId: this._data.owner };\n this._data.owner ??= {};\n this._data.owner.avatarUrl = `${this.httpClient.serverUrl}/users/${this._data.owner.userId}/avatar`;\n this._data.owner.fullName = userFullName(this._data.owner);\n this._data.owner.initials = userInitials(this._data.owner.fullName);\n // status since 24.9\n this._data.status ??= {};\n this._data.status.geometry ??= { state: this._data.geometryStatus ?? \"none\" };\n this._data.status.properties ??= { state: this._data.propertiesStatus ?? \"none\" };\n this._data.status.validation ??= { state: this._data.validationStatus ?? \"none\" };\n // updatedBy since 24.10\n this._data.updatedBy ??= {};\n this._data.updatedBy.avatarUrl = `${this.httpClient.serverUrl}/users/${this._data.updatedBy.userId}/avatar`;\n this._data.updatedBy.fullName = userFullName(this._data.updatedBy);\n this._data.updatedBy.initials = userInitials(this._data.updatedBy.fullName);\n // versions since 24.10\n this._data.versions ??= [{ ...value }];\n // geometryGltf status since 24.12\n this._data.status.geometryGltf ??= { state: \"none\" };\n // isFileDeleted since 25.7\n this._data.isFileDeleted ??= false;\n }\n\n /**\n * Returns a list of file formats in which the active version of the file was exported.\n *\n * To export file to one of the supported formats create File Converter job using\n * {@link createJob | createJob()}. To download exported file use\n * {@link downloadResource | downloadResource()}.\n *\n * @readonly\n */\n get exports(): string[] {\n return this.data.exports;\n }\n\n /**\n * Geometry data type of the active file version. Can be one of:\n *\n * - `vsfx` - `VSFX` format, file can be opened in `VisualizeJS` viewer.\n * - `gltf` - `glTF` format, file can be opened in `Three.js` viewer.\n *\n * Returns an empty string if geometry data has not yet been converted. A files without\n * geometry data can be exported to other formas, but cannot be opened in viewer.\n */\n get geometryType(): string {\n if (this.status.geometryGltf.state === \"done\") return \"gltf\";\n else if (this.status.geometry.state === \"done\") return \"vsfx\";\n else return \"\";\n }\n\n /**\n * Unique file ID.\n *\n * @readonly\n */\n get id(): string {\n return this.data.id;\n }\n\n /**\n * Returns `true` if the source file of the active file version has been deleted.\n *\n * A files with deleted source file can be opened in the viewer, but cannot be exported to\n * other formats.\n *\n * @readonly\n */\n get isFileDeleted(): boolean {\n return this.data.isFileDeleted;\n }\n\n /**\n * File name, including the extension.\n */\n get name(): string {\n return this.data.name;\n }\n\n set name(value: string) {\n this.data.name = value;\n }\n\n /**\n * If the file is a version, then returns the ID of the original file. Otherwise, returns the file ID.\n *\n * @readonly\n */\n get originalFileId(): string {\n return this.data.originalFileId;\n }\n\n /**\n * File owner information.\n *\n * @property {string} userId - User ID.\n * @property {string} userName - User name.\n * @property {string} name - First name.\n * @property {string} lastName - Last name.\n * @property {string} fullName - Full name.\n * @property {string} initials - Initials.\n * @property {string} email - User email.\n * @property {string} avatarUrl - User avatar image URL.\n * @readonly\n */\n get owner(): IShortUserDescription {\n return this.data.owner;\n }\n\n /**\n * File preview image URL or empty string if the file does not have a preview. Use\n * {@link setPreview | setPreview()} to change preview image.\n *\n * @readonly\n */\n get previewUrl(): string {\n return this.data.previewUrl;\n }\n\n /**\n * The size of the active version of the file in bytes.\n *\n * @readonly\n */\n get size(): number {\n return this.data.size;\n }\n\n /**\n * Total size of all versions of the file in bytes.\n *\n * @readonly\n */\n get sizeTotal(): number {\n return this.data.sizeTotal;\n }\n\n /**\n * Data status of the active version of the file. Contains:\n *\n * - `geometry` - status of geometry data of `vsfx` type.\n * - `geometryGltf` - status of geometry data of `gltf` type.\n * - `properties` - status of properties.\n * - `validation` - status of validation.\n *\n * Each status entity is a record with properties:\n *\n * - `state` - Data state. Can be `none`, `waiting`, `inprogress`, `done` or `failed`.\n * - `jobId` - Unique ID of the data job.\n *\n * @readonly\n */\n get status(): IFileStatus {\n return this.data.status;\n }\n\n /**\n * File type, matches the file extension.\n *\n * @readonly\n */\n get type(): string {\n return this.data.type;\n }\n\n /**\n * File last update time (UTC) in the format specified in\n * {@link https://www.wikipedia.org/wiki/ISO_8601 | ISO 8601}.\n *\n * @readonly\n */\n get updatedAt(): string {\n return this.data.updatedAt;\n }\n\n /**\n * Information about the user who made the last update.\n *\n * @property {string} userId - User ID.\n * @property {string} userName - User name.\n * @property {string} name - First name.\n * @property {string} lastName - Last name.\n * @property {string} fullName - Full name.\n * @property {string} initials - Initials.\n * @property {string} email - User email.\n * @property {string} avatarUrl - User avatar image URL.\n * @readonly\n */\n get updatedBy(): IShortUserDescription {\n return this.data.updatedBy;\n }\n\n /**\n * Zero-based file version number for version files. The original file has version `0`.\n */\n\n get version(): number {\n return this.data.version;\n }\n\n /**\n * List of the file versions.\n *\n * @readonly\n */\n get versions(): IFileVersionInfo[] {\n return this.data.versions;\n }\n\n /**\n * Reloads file data from the server.\n */\n async checkout(): Promise<this> {\n const response = await this.internalGet(\"\");\n this.data = await response.json();\n return this;\n }\n\n /**\n * Updates file data on the server.\n *\n * @param data - Raw file data.\n */\n async update(data: any): Promise<this> {\n const response = await this.internalPut(\"\", data);\n this.data = await response.json();\n return this;\n }\n\n /**\n * Deletes a file and all its versions from the server.\n *\n * You cannot delete a version file using `delete()`, only the original file. To delete a\n * version file use {@link deleteVersion | deleteVersion()}.\n *\n * @returns Returns the raw data of a deleted file.\n */\n delete(): Promise<any> {\n return this.internalDelete(\"\").then((response) => response.json());\n }\n\n /**\n * Saves file properties changes to the server. Call this method to update file data on the\n * server after any property changes.\n */\n save(): Promise<this> {\n return this.update(this.data);\n }\n\n /**\n * Sets or removes the file preview.\n *\n * @param image - Preview image. Can be a\n * {@link https://developer.mozilla.org/docs/Web/HTTP/Basics_of_HTTP/Data_URIs | Data URL}\n * string,\n * {@link https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer | ArrayBuffer},\n * {@link https://developer.mozilla.org/docs/Web/API/Blob/Blob | Blob} or\n * {@link https://developer.mozilla.org/docs/Web/API/File | Web API File} object. Setting\n * the `image` to `null` will remove the preview.\n */\n async setPreview(image?: BodyInit | null): Promise<this> {\n if (!image) {\n await this.deletePreview();\n } else {\n const response = await this.internalPost(\"/preview\", image);\n this.data = await response.json();\n }\n return this;\n }\n\n /**\n * Removes the file preview.\n */\n async deletePreview(): Promise<this> {\n const response = await this.internalDelete(\"/preview\");\n this.data = await response.json();\n return this;\n }\n\n /**\n * Returns a list of models of the active version of the file.\n */\n getModels(): Promise<Model[]> {\n return this.internalGet(\"/geometry\")\n .then((response) => response.json())\n .then((array) => array.map((data) => new Model(data, this)));\n }\n\n // File does not support model transformation.\n\n getModelTransformMatrix(handle: string): any {\n return undefined;\n }\n\n setModelTransformMatrix(handle: string, transform: any): Promise<this> {\n console.warn(\"File does not support model transformation\");\n return Promise.resolve(this);\n }\n\n /**\n * Object properties.\n *\n * @typedef {any} Properties\n * @property {string} handle - Object original handle.\n * @property {string | any} * - Object property. Can be `any` for nested properties.\n */\n\n /**\n * Returns the properties for an objects in the active version of the file.\n *\n * @param handles - Object original handle or handles array. Specify `undefined` to get\n * properties for all objects in the file.\n */\n getProperties(handles?: string | string[]): Promise<any[]> {\n const relativePath = handles !== undefined ? `/properties?handles=${handles}` : \"/properties\";\n return this.internalGet(relativePath).then((response) => response.json());\n }\n\n /**\n * Search pattern.\n *\n * @typedef {any} SearchPattern\n * @property {string} key - Property name.\n * @property {string} value - Property value.\n */\n\n /**\n * Query operator. Operator name can be `$and`, `$or`, `$not`, `$eq`, `$regex`.\n *\n * @typedef {any} QueryOperator\n * @property {string | SearchPattern[] | QueryOperator[]} * - Array of the query values or\n * patterns for operator.\n */\n\n /**\n * Returns the list of original handles for an objects in the active version of the file that\n * match the specified patterns. Search patterns may be combined using query operators.\n *\n * @example <caption>Simple search pattern.</caption>\n * searchPattern = {\n * key: \"Category\",\n * value: \"OST_Stairs\",\n * };\n *\n * @example <caption>Search patterns combination.</caption>\n * searchPattern = {\n * $or: [\n * {\n * $and: [\n * { key: \"Category\", value: \"OST_GenericModel\" },\n * { key: \"Level\", value: \"03 - Floor\" },\n * ],\n * },\n * { key: \"Category\", value: \"OST_Stairs\" },\n * ],\n * };\n *\n * @param {SeacrhPattern | QueryOperator} searchPattern - Search pattern or combination of\n * the patterns, see example below.\n * @returns {Promise<Properties[]>}\n */\n\n searchProperties(searchPattern: any): Promise<any[]> {\n return this.internalPost(\"/properties/search\", searchPattern).then((response) => response.json());\n }\n\n /**\n * Returns the CDA tree for an active version of the file.\n */\n getCdaTree(): Promise<any[]> {\n return this.internalGet(`/properties/tree`).then((response) => response.json());\n }\n\n /**\n * Returns a list of file viewpoints.\n */\n getViewpoints(): Promise<any[]> {\n return this.internalGet(\"/viewpoints\")\n .then((response) => response.json())\n .then((viewpoints) => viewpoints.result);\n }\n\n /**\n * Adds a new viewpoint to the file. To create a viewpoint use `Viewer.createViewpoint()`.\n *\n * @param viewpoint - Viewpoint.\n */\n saveViewpoint(viewpoint: any): Promise<any> {\n return this.internalPost(\"/viewpoints\", viewpoint).then((response) => response.json());\n }\n\n /**\n * Deletes the specified file viewpoint.\n *\n * @param guid - Viewpoint GUID.\n * @returns Returns the raw data of a deleted viewpoint.\n */\n deleteViewpoint(guid: string): Promise<any> {\n return this.internalDelete(`/viewpoints/${guid}`).then((response) => response.json());\n }\n\n /**\n * Returns viewpoint preview image as\n * {@link https://developer.mozilla.org/docs/Web/HTTP/Basics_of_HTTP/Data_URIs | Data URL}.\n *\n * @param guid - Viewpoint GUID.\n */\n getSnapshot(guid: string): Promise<string> {\n return this.internalGet(`/viewpoints/${guid}/snapshot`).then((response) => response.text());\n }\n\n /**\n * Returns viewpoint preview data.\n *\n * @param guid - Viewpoint GUID.\n * @param bitmapGuid - Bitmap GUID.\n */\n getSnapshotData(guid: string, bitmapGuid: string): Promise<string> {\n return this.internalGet(`/viewpoints/${guid}/bitmaps/${bitmapGuid}`).then((response) => response.text());\n }\n\n /**\n * Downloads the source file of active version of the file from the server.\n *\n * @param onProgress - Download progress callback.\n * @param signal - An\n * {@link https://developer.mozilla.org/docs/Web/API/AbortController | AbortController}\n * signal. Allows to communicate with a fetch request and abort it if desired.\n */\n download(onProgress?: (progress: number) => void, signal?: AbortSignal): Promise<ArrayBuffer> {\n const relativePath = this.appendVersionParam(\"/downloads\");\n return this.httpClient\n .downloadFile(`${this.path}${relativePath}`, onProgress, signal)\n .then((response) => response.arrayBuffer());\n }\n\n /**\n * Downloads a resource file of the active version of the file. Resource files are files that\n * contain model scene descriptions, or geometry data, or exported files.\n *\n * @example <caption>Export file to DWG.</caption>\n * const job = await file.crateJob(\"dwg\");\n * await job.waitForDone();\n * const dwgFileName = file.exports.find((x) => x.endsWith(\".dwg\"));\n * const arrayBuffer = await file.downloadResource(dwgFileName);\n * const blob = new Blob([arrayBuffer]);\n * const fileName = file.name.replace(/\\.[^.]+$/, \"\") + \".dwg\";\n * FileSaver.saveAs(blob, fileName);\n *\n * @param dataId - Resource file name.\n * @param onProgress - Download progress callback.\n * @param signal - An\n * {@link https://developer.mozilla.org/docs/Web/API/AbortController | AbortController}\n * signal. Allows to communicate with a fetch request and abort it if desired.\n */\n downloadResource(\n dataId: string,\n onProgress?: (progress: number, chunk: Uint8Array) => void,\n signal?: AbortSignal\n ): Promise<ArrayBuffer> {\n const relativePath = this.appendVersionParam(`/downloads/${dataId}`);\n return this.httpClient\n .downloadFile(`${this.path}${relativePath}`, onProgress, signal)\n .then((response) => response.arrayBuffer());\n }\n\n /**\n * Downloads a part of resource file of the active version of the file. Resource files are\n * files that contain model scene descriptions, or geometry data, or exported files.\n *\n * @param dataId - Resource file name.\n * @param ranges - A range of resource file contents to download.\n * @param requestId - Request ID for download progress callback.\n * @param onProgress - Download progress callback.\n * @param signal - An\n * {@link https://developer.mozilla.org/docs/Web/API/AbortController | AbortController}\n * signal. Allows to communicate with a fetch request and abort it if desired.\n */\n downloadResourceRange(\n dataId: string,\n requestId: number,\n ranges: Array<{ begin: number; end: number; requestId: number }>,\n onProgress?: (progress: number, chunk: Uint8Array, requestId: number) => void,\n signal?: AbortSignal\n ): Promise<ArrayBuffer> {\n const relativePath = this.appendVersionParam(`/downloads/${dataId}?requestId=${requestId}`);\n return this.httpClient\n .downloadFileRange(`${this.path}${relativePath}`, requestId, ranges, onProgress, signal)\n .then((response) => response.arrayBuffer());\n }\n\n /**\n * Deprecated since `25.3`. Use {@link downloadResource | downloadResource()} instead.\n *\n * @deprecated\n */\n partialDownloadResource(\n dataId: string,\n onProgress?: (progress: number, downloaded: Uint8Array) => void,\n signal?: AbortSignal\n ): Promise<ArrayBuffer> {\n console.warn(\n \"File.partialDownloadResource() has been deprecated since 25.3 and will be removed in a future release, use File.downloadResource() instead.\"\n );\n return this.downloadResource(dataId, onProgress, signal);\n }\n\n /**\n * Deprecated since `25.3`. Use {@link downloadResourceRange | downloadResourceRange()} instead.\n *\n * @deprecated\n */\n async downloadFileRange(\n requestId: number,\n records: any | null,\n dataId: string,\n onProgress?: (progress: number, downloaded: Uint8Array, requestId: number) => void,\n signal?: AbortSignal\n ): Promise<void> {\n await this.downloadResourceRange(dataId, requestId, records, onProgress, signal);\n }\n\n /**\n * Returns a list of file references.\n *\n * References are images, fonts, or any other files to correct rendering of the file.\n *\n * @param signal - An\n * {@link https://developer.mozilla.org/docs/Web/API/AbortController | AbortController}\n * signal, which can be used to abort waiting as desired.\n */\n getReferences(signal?: AbortSignal): Promise<IFileReferences> {\n return this.internalGet(\"/references\", signal).then((response) => response.json());\n }\n\n /**\n * Sets the file references.\n *\n * References are images, fonts, or any other files to correct rendering of the file.\n * Reference files must be uploaded to the server before they can be assigned to the current file.\n *\n * @param references - File references.\n */\n setReferences(references: IFileReferences): Promise<IFileReferences> {\n return this.internalPut(\"/references\", references).then((response) => response.json());\n }\n\n /**\n * Runs a new job on the server for the active version of the file.\n *\n * @param outputFormat - The job type. Can be one of:\n *\n * - `geometry` - Convert file geometry data to `VSFX` format suitable for `VisualizeJS` viewer.\n * - `geometryGltf` - Convert file geometry data to `glTF` format suitable for `Three.js` viewer.\n * - `properties` - Extract file properties.\n * - `validation` - Validate the file. Only for `IFC` files.\n * - `dwg`, `obj`, `gltf`, `glb`, `vsf`, `pdf`, `3dpdf` - Export file to the one of the\n * supported format. Use {@link exports | exports()} to get the list of completed file\n * exports. Use {@link downloadResource | downloadResource()} to download the exported file.\n * - Other custom job name. Custom job runner must be registered in the job templates before\n * creating a job.\n *\n * @param parameters - Parameters for the job runner. Can be given as command line arguments\n * for the File Converter tool in form `--arg=value`.\n */\n createJob(outputFormat: string, parameters?: string | object): Promise<Job> {\n const relativePath = this.appendVersionParam(\"/jobs\");\n return this.httpClient\n .post(relativePath, {\n fileId: this.id,\n outputFormat,\n parameters: parseArgs(parameters),\n })\n .then((response) => response.json())\n .then((data) => new Job(data, this.httpClient));\n }\n\n /**\n * Runs a job to convert geometry data of active version of the file. This is alias to\n * {@link createJob | createJob(\"geometry\")}.\n *\n * @param type - Geometry data type. Can be one of:\n *\n * - `vsfx` - `VSFX` format (default), for opening a file in `VisualizeJS` viewer.\n * - `gltf` - `glTF` format, for opening a file in `Three.js` viewer.\n *\n * @param parameters - Parameters for the job runner. Can be given as command line arguments\n * for the File Converter tool in form `--arg=value`.\n */\n extractGeometry(type?: string, parameters?: string | object): Promise<Job> {\n return this.createJob(type === \"gltf\" ? \"geometryGltf\" : \"geometry\", parameters);\n }\n\n /**\n * Runs a job to extract properties of the active version of the file. This is alias to\n * {@link createJob | createJob(\"properties\")}.\n *\n * @param parameters - Parameters for the job runner. Can be given as command line arguments\n * for the File Converter tool in form `--arg=value`.\n */\n extractProperties(parameters?: string | object): Promise<Job> {\n return this.createJob(\"properties\", parameters);\n }\n\n /**\n * Runs a job to validate the active version of the file. This is alias to\n * {@link createJob | createJob(\"validation\")}.\n *\n * To get validation report use {@link downloadResource | downloadResource(\"validation_report.json\")}.\n *\n * @param parameters - Parameters for the job runner. Can be given as command line arguments\n * for the File Converter tool in form `--arg=value`.\n */\n validate(parameters?: string | object): Promise<Job> {\n return this.createJob(\"validation\", parameters);\n }\n\n /**\n * Waits for jobs of the active version of the file to be done. Job is done when it changes\n * to `none`, `done` or `failed` status.\n *\n * @param jobs - Job or job array to wait on. Can be `geometry`, `geometryGltf`,\n * `properties`, `validation`, `dwg`, `obj`, `gltf`, `glb`, `vsf`, `pdf`, `3dpdf` or custom\n * job name.\n * @param waitAll - If this parameter is `true`, the function returns when all the specified\n * jobs have done. If `false`, the function returns when any one of the jobs are done.\n * @param params - An object containing waiting parameters.\n * @param params.timeout - The time, in milliseconds that the function should wait jobs. If\n * no one jobs are done during this time, the `TimeoutError` exception will be thrown.\n * @param params.interval - The time, in milliseconds, the function should delay in between\n * checking jobs status.\n * @param params.signal - An\n * {@link https://developer.mozilla.org/docs/Web/API/AbortController | AbortController}\n * signal, which can be used to abort waiting as desired.\n * @param params.onCheckout - Waiting progress callback. Return `true` to cancel waiting.\n */\n waitForDone(\n jobs: string | string[],\n waitAll?: boolean,\n params?: {\n timeout?: number;\n interval?: number;\n signal?: AbortSignal;\n onCheckout?: (file: File, ready: boolean) => boolean;\n }\n ): Promise<this> {\n const waitJobs = Array.isArray(jobs) ? jobs : [jobs];\n if (waitAll === undefined) waitAll = true;\n\n const checkDone = () =>\n this.checkout().then((file) => {\n const readyJobs = waitJobs.filter((job: string) => {\n const jobStatus = file.status[job] || {};\n return [\"none\", \"done\", \"failed\"].includes(jobStatus.state || \"none\");\n });\n const ready = waitAll ? readyJobs.length === waitJobs.length : readyJobs.length > 0;\n const cancel = params?.onCheckout?.(file, ready);\n return cancel || ready;\n });\n\n return waitFor(checkDone, params).then(() => this);\n }\n\n /**\n * Returns a list of file permissions.\n */\n getPermissions(): Promise<Permission[]> {\n return this.internalGet(\"/permissions\")\n .then((response) => response.json())\n .then((array) => array.map((data) => new Permission(data, this.id, this.httpClient)));\n }\n\n /**\n * Returns information about specified file permission.\n *\n * @param permissionId - Permission ID.\n */\n getPermission(permissionId: string): Promise<Permission> {\n return this.internalGet(`/permissions/${permissionId}`)\n .then((response) => response.json())\n .then((data) => new Permission(data, this.id, this.httpClient));\n }\n\n /**\n * Creates a new file permission.\n *\n * @param actions - Actions are allowed to be performed on a file with this permission:\n *\n * - `read` - The ability to read file description, geometry data and properties.\n * - `readSourceFile` - The ability to read source file.\n * - `write` - The ability to modify file name, description and references.\n * - `readViewpoint` - The ability to read file viewpoints.\n * - `createViewpoint` - The ability to create file viewpoints.\n *\n * @param grantedTo - A collection of principials that will get access to the file.\n * @param _public - Specifies whether all users have access to the file or not.\n */\n createPermission(actions: string | string[], grantedTo: any[], _public: boolean): Promise<Permission> {\n return this.internalPost(\"/permissions\", {\n actions: Array.isArray(actions) ? actions : [actions],\n grantedTo,\n public: _public,\n })\n .then((response) => response.json())\n .then((data) => new Permission(data, this.id, this.httpClient));\n }\n\n /**\n * Removes the specified permission from the file.\n *\n * @param permissionId - Permission ID.\n * @returns Returns the raw data of a deleted permission.\n */\n deletePermission(permissionId: string): Promise<any> {\n return this.internalDelete(`/permissions/${permissionId}`).then((response) => response.json());\n }\n\n /**\n * Uploads the new version of the file to the server, convert the geometry data and extract\n * properties as needed.\n *\n * @param file - {@link https://developer.mozilla.org/docs/Web/API/File | Web API File} object\n * are generally retrieved from a\n * {@link https://developer.mozilla.org/docs/Web/API/FileList | FileList} object returned as\n * a result of a user selecting files using the HTML `<input>` element.\n * @param params - An object containing upload parameters.\n * @param params.geometry - Create job to convert file geometry data. The geometry data type\n * is the same as the original file.\n * @param params.properties - Create job to extract file properties.\n * @param params.waitForDone - Wait for geometry and properties jobs to complete.\n * @param params.timeout - The time, in milliseconds that the function should wait jobs. If\n * no one jobs are done during this time, the `TimeoutError` exception will be thrown.\n * @param params.interval - The time, in milliseconds, the function should delay in between\n * checking jobs status.\n * @param params.signal - An\n * {@link https://developer.mozilla.org/docs/Web/API/AbortController | AbortController}\n * signal, which can be used to abort waiting as desired.\n * @param params.onProgress - Upload progress callback.\n */\n\n async uploadVersion(\n file: globalThis.File,\n params: {\n geometry?: boolean;\n properties?: boolean;\n waitForDone?: boolean;\n timeout?: number;\n interval?: number;\n signal?: AbortSignal;\n onProgress?: (progress: number, file: globalThis.File) => void;\n } = {\n waitForDone: false,\n }\n ): Promise<File> {\n const result = await this.httpClient\n .uploadFile(`${this.path}/versions`, file, (progress) => params.onProgress?.(progress, file))\n .then((xhr: XMLHttpRequest) => JSON.parse(xhr.responseText))\n .then((data) => new File(data, this.httpClient));\n\n let geometryType = \"\";\n if (this.versions[0].status.geometryGltf.state !== \"none\") geometryType = \"gltf\";\n if (this.versions[0].status.geometry.state !== \"none\") geometryType = \"vsfx\";\n\n params = { ...params };\n if (params.geometry === undefined) params.geometry = geometryType !== \"\";\n if (params.properties === undefined) params.properties = this.versions[0].status.properties.state !== \"none\";\n\n const jobs: string[] = [];\n if (params.geometry) jobs.push((await result.extractGeometry(geometryType)).outputFormat);\n if (params.properties) jobs.push((await result.extractProperties()).outputFormat);\n if (jobs.length > 0)\n if (params.waitForDone) await result.waitForDone(jobs, true, params);\n else await result.checkout();\n\n await this.checkout();\n\n return result;\n }\n\n /**\n * Returns a list of version files.\n */\n getVersions(): Promise<File[]> {\n return this.internalGet(\"/versions\")\n .then((response) => response.json())\n .then((files) => files.map((data) => new File(data, this.httpClient)))\n .then((files) => files.map((file) => (file.id == file.originalFileId ? file.useVersion(0) : file)));\n }\n\n /**\n * Returns information about the specified version file.\n *\n * @param version - Desired version.\n */\n getVersion(version: number): Promise<File> {\n return this.internalGet(`/versions/${version}`)\n .then((response) => response.json())\n .then((data) => new File(data, this.httpClient))\n .then((file) => (file.id == file.originalFileId ? file.useVersion(0) : file));\n }\n\n /**\n * Deletes the specified version file.\n *\n * @param version - Version to delete.\n */\n async deleteVersion(version: number): Promise<any> {\n const response = await this.internalDelete(`/versions/${version}`);\n const data = await response.json();\n await this.checkout();\n return data;\n }\n\n /**\n * Replaces the active version of the file with the selected version.\n *\n * @param version - Desired active version.\n */\n\n setActiveVersion(version: number): Promise<this> {\n return this.update({ activeVersion: version });\n }\n\n /**\n * Makes the given version active on client side. Does not change the active file version on\n * the server.\n *\n * This version change will affect the result:\n *\n * - {@link getModels | getModels()}\n * - {@link getProperties | getProperties()}\n * - {@link searchProperties | searchProperties()}\n * - {@link getCdaTree | getCdaTree()}\n * - {@link download | download()}\n * - {@link downloadResource | downloadResource()}\n * - {@link createJob | createJob()}\n * - {@link extractGeometry | extractGeometry()}\n * - {@link extractProperties | extractProperties()}\n * - {@link validate | validate()}\n * - {@link waitForDone | waitForDone()}\n * - Viewer.open()\n *\n * Other clients will still continue to use the current active version of the file. Use\n * `undefined` to revert back to the active version.\n *\n * You need to reload the file data using {@link checkout | checkout()} to match the size and\n * status fields to the version you selected.\n */\n useVersion(version?: number): this {\n this._useVersion = version;\n return this;\n }\n\n /**\n * Deletes the source file of the active file version from the server.\n */\n async deleteSource(): Promise<this> {\n const response = await this.internalDelete(\"/source\");\n this.data = await response.json();\n return this;\n }\n}\n","///////////////////////////////////////////////////////////////////////////////\n// Copyright (C) 2002-2024, Open Design Alliance (the \"Alliance\").\n// All rights reserved.\n//\n// This software and its documentation and related materials are owned by\n// the Alliance. The software may only be incorporated into application\n// programs owned by members of the Alliance, subject to a signed\n// Membership Agreement and Supplemental Software License Agreement with the\n// Alliance. The structure and organization of this software are the valuable\n// trade secrets of the Alliance and its suppliers. The software is also\n// protected by copyright law and international treaty provisions. Application\n// programs incorporating this software must include the following statement\n// with their copyright notices:\n//\n// This application incorporates Open Design Alliance software pursuant to a\n// license agreement with Open Design Alliance.\n// Open Design Alliance Copyright (C) 2002-2024 by Open Design Alliance.\n// All rights reserved.\n//\n// By use of this software, its documentation or related materials, you\n// acknowledge and accept the above terms.\n///////////////////////////////////////////////////////////////////////////////\n\nimport { IHttpClient } from \"./IHttpClient\";\n\n/**\n * A role determines what actions allowed to be performed by {@link User | users} on a\n * {@link Project | project}.\n */\nexport class Role {\n private _data: any;\n public projectId: string;\n public httpClient: IHttpClient;\n\n /**\n * @param data - Raw role data received from the server.\n * @param projectId - Owner project ID.\n * @param httpClient - HTTP client instance used to send REST API requests to the server.\n */\n constructor(data: any, projectId: string, httpClient: IHttpClient) {\n this.httpClient = httpClient;\n this.projectId = projectId;\n this.data = data;\n }\n\n private internalGet(): Promise<Response> {\n return this.httpClient.get(`/projects/${this.projectId}/roles/${this.name}`);\n }\n\n private internalPut(body?: BodyInit | object): Promise<Response> {\n return this.httpClient.put(`/projects/${this.projectId}/roles/${this.name}`, body);\n }\n\n private internalDelete(): Promise<Response> {\n return this.httpClient.delete(`/projects/${this.projectId}/roles/${this.name}`);\n }\n\n /**\n * Role description.\n */\n get description(): string {\n return this.data.description;\n }\n\n set description(value: string) {\n this._data.description = value;\n }\n\n /**\n * Raw role data received from the server.\n *\n * @readonly\n */\n get data(): any {\n return this._data;\n }\n\n set data(value: any) {\n this._data = value;\n }\n\n /**\n * Role name.\n */\n get name(): string {\n return this.data.name;\n }\n\n set name(value: string) {\n this._data.name = value;\n }\n\n /**\n * Role actions are allowed to be performed.\n *\n * @property {string[]} projectActions - Actions are allowed to be performed at the project\n * level: `update`, `createTopic`, `createDocument`.\n * @property {string[]} topicActions - Actions are allowed to be performed at the topic\n * level: `update`, `updateBimSnippet`, `updateRelatedTopics`, `updateDocumentReferences`,\n * `updateFiles`, `createComment`, `createViewpoint`, `delete`.\n * @property {string[]} commentActions - Actions are allowed to be performed at the comment\n * level: `update`, `delete`.\n * @property {string[]} viewpointActions - Actions are allowed to be performed at the\n * viewpoint level: `delete`.\n * @property {string[]} odaGroupActions - Actions are allowed to be performed at the members\n * level: `update`, `delete`.\n * @property {string[]} odaRoleActions - Actions are allowed to be performed at the roles\n * level: `update`, `delete`.\n */\n get permissions(): any {\n return this.data.permissions;\n }\n\n set permissions(value: any) {\n this.data.permissions = value || {};\n }\n\n /**\n * Reloads role data from the server.\n */\n async checkout(): Promise<this> {\n const response = await this.internalGet();\n this.data = await response.json();\n return this;\n }\n\n /**\n * Updates role data on the server.\n *\n * @param data - Raw role data.\n */\n async update(data: any): Promise<this> {\n const response = await this.internalPut(data);\n this.data = await response.json();\n return this;\n }\n\n /**\n * Deletes a role from the project.\n *\n * @returns Returns the raw data of a deleted role.\n */\n delete(): Promise<any> {\n return this.internalDelete().then((response) => response.json());\n }\n\n /**\n * Saves role properties changes to the server. Call this method to update role data on the\n * server after any property changes.\n */\n save(): Promise<this> {\n return this.update(this.data);\n }\n}\n","///////////////////////////////////////////////////////////////////////////////\n// Copyright (C) 2002-2024, Open Design Alliance (the \"Alliance\").\n// All rights reserved.\n//\n// This software and its documentation and related materials are owned by\n// the Alliance. The software may only be incorporated into application\n// programs owned by members of the Alliance, subject to a signed\n// Membership Agreement and Supplemental Software License Agreement with the\n// Alliance. The structure and organization of this software are the valuable\n// trade secrets of the Alliance and its suppliers. The software is also\n// protected by copyright law and international treaty provisions. Application\n// programs incorporating this software must include the following statement\n// with their copyright notices:\n//\n// This application incorporates Open Design Alliance software pursuant to a\n// license agreement with Open Design Alliance.\n// Open Design Alliance Copyright (C) 2002-2024 by Open Design Alliance.\n// All rights reserved.\n//\n// By use of this software, its documentation or related materials, you\n// acknowledge and accept the above terms.\n///////////////////////////////////////////////////////////////////////////////\n\nimport { IHttpClient } from \"./IHttpClient\";\nimport { IShortUserDescription } from \"./IUser\";\nimport { userFullName, userInitials } from \"./Utils\";\n\n/**\n * Provides properties and methods for obtaining information about a {@link User | user} who has\n * access to the {@link Project | project}.\n */\nexport class Member {\n private _data: any;\n public projectId: string;\n public httpClient: IHttpClient;\n\n /**\n * @param data - Raw member data received from the server.\n * @param projectId - Owner project ID.\n * @param httpClient - HTTP client instance used to send REST API requests to the server.\n */\n constructor(data: any, projectId: string, httpClient: IHttpClient) {\n this.httpClient = httpClient;\n this.projectId = projectId;\n this.data = data;\n }\n\n private internalGet(): Promise<Response> {\n return this.httpClient.get(`/projects/${this.projectId}/members/${this.id}`);\n }\n\n private internalPut(body?: BodyInit | object): Promise<Response> {\n return this.httpClient.put(`/projects/${this.projectId}/members/${this.id}`, body);\n }\n\n private internalDelete(): Promise<Response> {\n return this.httpClient.delete(`/projects/${this.projectId}/members/${this.id}`);\n }\n\n /**\n * Raw member data received from the server.\n *\n * @readonly\n */\n get data(): any {\n return this._data;\n }\n\n private set data(value: any) {\n this._data = value;\n this._data.user.avatarUrl = `${this.httpClient.serverUrl}/users/${this._data.user.userId}/avatar`;\n this._data.user.fullName = userFullName(this._data.user);\n this._data.user.initials = userInitials(this._data.user.fullName);\n }\n\n /**\n * Unique member ID.\n *\n * @readonly\n */\n get id(): string {\n return this.data.id;\n }\n\n /**\n * Member role. See {@link Project.getRoles | Project.getRoles()} for more details.\n */\n get role(): string {\n return this.data.role;\n }\n\n set role(value: string) {\n this.data.role = value;\n }\n\n /**\n * Member type. Can be `owner` or `user`.\n *\n * @readonly\n */\n get type(): string {\n return this.data.type;\n }\n\n /**\n * User information.\n *\n * @property {string} userId - User ID.\n * @property {string} userName - User name.\n * @property {string} name - First name.\n * @property {string} lastName - Last name.\n * @property {string} fullName - Full name.\n * @property {string} initials - Initials.\n * @property {string} email - User email.\n * @property {string} avatarUrl - User avatar image URL.\n * @readonly\n */\n get user(): IShortUserDescription {\n return this.data.user;\n }\n\n /**\n * Reloads member data from the server.\n */\n async checkout(): Promise<this> {\n const response = await this.internalGet();\n this.data = await response.json();\n return this;\n }\n\n /**\n * Updates member data on the server.\n *\n * @param data - Raw member data.\n */\n async update(data: any): Promise<this> {\n const response = await this.internalPut(data);\n this.data = await response.json();\n return this;\n }\n\n /**\n * Removes a member from the project.\n *\n * @returns Returns the raw data of a deleted member.\n */\n delete(): Promise<any> {\n return this.internalDelete().then((response) => response.json());\n }\n\n /**\n * Saves member properties changes to the server. Call this method to update member data on\n * the server after any property changes.\n */\n save(): Promise<this> {\n return this.update(this.data);\n }\n}\n","///////////////////////////////////////////////////////////////////////////////\n// Copyright (C) 2002-2024, Open Design Alliance (the \"Alliance\").\n// All rights reserved.\n//\n// This software and its documentation and related materials are owned by\n// the Alliance. The software may only be incorporated into application\n// programs owned by members of the Alliance, subject to a signed\n// Membership Agreement and Supplemental Software License Agreement with the\n// Alliance. The structure and organization of this software are the valuable\n// trade secrets of the Alliance and its suppliers. The software is also\n// protected by copyright law and international treaty provisions. Application\n// programs incorporating this software must include the following statement\n// with their copyright notices:\n//\n// This application incorporates Open Design Alliance software pursuant to a\n// license agreement with Open Design Alliance.\n// Open Design Alliance Copyright (C) 2002-2024 by Open Design Alliance.\n// All rights reserved.\n//\n// By use of this software, its documentation or related materials, you\n// acknowledge and accept the above terms.\n///////////////////////////////////////////////////////////////////////////////\n\nimport { IHttpClient } from \"./IHttpClient\";\nimport { IShortUserDescription } from \"./IUser\";\nimport { Role } from \"./Role\";\nimport { Member } from \"./Member\";\nimport { userFullName, userInitials } from \"./Utils\";\n\n/**\n * Provides properties and methods for obtaining information about a project on the server and\n * managing its {@link Role | roles}, {@link Member | members} and models.\n */\nexport class Project {\n private _data: any;\n public httpClient: IHttpClient;\n\n /**\n * @param data - Raw project data received from the server.\n * @param httpClient - HTTP client instance used to send REST API requests to the server.\n */\n constructor(data: any, httpClient: IHttpClient) {\n this.httpClient = httpClient;\n this.data = data;\n }\n\n protected internalGet(relativePath: string): Promise<Response> {\n return this.httpClient.get(`/projects/${this.id}${relativePath}`);\n }\n\n protected internalPost(relativePath: string, body?: BodyInit | object): Promise<Response> {\n return this.httpClient.post(`/projects/${this.id}${relativePath}`, body);\n }\n\n protected internalPut(relativePath: string, body?: BodyInit | object): Promise<Response> {\n return this.httpClient.put(`/projects/${this.id}${relativePath}`, body);\n }\n\n protected internalDelete(relativePath: string): Promise<Response> {\n return this.httpClient.delete(`/projects/${this.id}${relativePath}`);\n }\n\n /**\n * Project features the user has access to.\n *\n * @readonly\n */\n get authorization(): {\n /**\n * Actions are allowed to be performed:\n *\n * - `update` - The ability to update the project details.\n * - `createTopic` - The ability to create a new topic.\n * - `createDocument` - The ability to create a new document.\n */\n project_actions: string[];\n } {\n return this.data.authorization;\n }\n\n /**\n * Project creation time (UTC) in the format specified in\n * {@link https://www.wikipedia.org/wiki/ISO_8601 | ISO 8601}.\n *\n * @readonly\n */\n get createdAt(): string {\n return this.data.createdAt;\n }\n\n /**\n * Project custom fields object, to store custom data.\n */\n get customFields(): any {\n return this.data.customFields;\n }\n\n set customFields(value: any) {\n this.data.customFields = value;\n }\n\n /**\n * Raw project data received from the server.\n *\n * @readonly\n */\n get data(): any {\n return this._data;\n }\n\n private set data(value: any) {\n this._data = value;\n this._data.previewUrl = value.avatarUrl\n ? `${this.httpClient.serverUrl}/projects/${this._data.id}/preview?updated=${value.updatedAt}`\n : \"\";\n this._data.owner.avatarUrl = `${this.httpClient.serverUrl}/users/${this._data.owner.userId}/avatar`;\n this._data.owner.fullName = userFullName(this._data.owner);\n this._data.owner.initials = userInitials(this._data.owner.fullName);\n }\n\n /**\n * Project description.\n */\n get description(): string {\n return this.data.description;\n }\n\n set description(value: string) {\n this.data.description = value;\n }\n\n /**\n * Project end date in the format specified in\n * {@link https://www.wikipedia.org/wiki/ISO_8601 | ISO 8601}.\n */\n get endDate(): string {\n return this.data.endDate;\n }\n\n set endDate(value: string | Date) {\n this.data.endDate = value instanceof Date ? value.toISOString() : value;\n }\n\n /**\n * Unique project ID.\n *\n * @readonly\n */\n get id(): string {\n return this.data.id;\n }\n\n /**\n * The number of members in the project.\n *\n * @readonly\n */\n get memberCount(): number {\n return this.data.memberCount;\n }\n\n /**\n * The number of models in the project.\n *\n * @readonly\n */\n get modelCount(): number {\n return this.data.modelCount;\n }\n\n /**\n * Project name.\n */\n get name(): string {\n return this.data.name;\n }\n\n set name(value: string) {\n this.data.name = value;\n }\n\n /**\n * Project owner information.\n *\n * @property {string} userId - User ID.\n * @property {string} userName - User name.\n * @property {string} name - First name.\n * @property {string} lastName - Last name.\n * @property {string} fullName - Full name.\n * @property {string} initials - Initials.\n * @property {string} email - User email.\n * @property {string} avatarUrl - User avatar image URL.\n * @readonly\n */\n get owner(): IShortUserDescription {\n return this.data.owner;\n }\n\n /**\n * Project preview image URL or empty string if the project does not have a preview. Use\n * {@link Project.setPreview | setPreview()} to change preview image.\n *\n * @readonly\n */\n get previewUrl(): string {\n return this._data.previewUrl;\n }\n\n /**\n * `true` if project is shared project.\n */\n get public(): boolean {\n return this.data.public;\n }\n\n set public(value: boolean) {\n this.data.public = value;\n }\n\n /**\n * Project start date in the format specified in\n * {@link https://www.wikipedia.org/wiki/ISO_8601 | ISO 8601}.\n */\n get startDate(): string {\n return this.data.startDate;\n }\n\n set startDate(value: string | Date) {\n this.data.startDate = value instanceof Date ? value.toISOString() : value;\n }\n\n /**\n * The number of topics in the project.\n *\n * @readonly\n */\n get topicCount(): number {\n return this.data.topicCount;\n }\n\n /**\n * Project last update time (UTC) in the format specified in\n * {@link https://www.wikipedia.org/wiki/ISO_8601 | ISO 8601}.\n *\n * @readonly\n */\n get updatedAt(): string {\n return this.data.updatedAt;\n }\n\n /**\n * Reloads project data from the server.\n */\n async checkout(): Promise<this> {\n const response = await this.internalGet(\"\");\n this.data = await response.json();\n return this;\n }\n\n /**\n * Updates project data on the server.\n *\n * @param data - Raw project data.\n */\n async update(data: any): Promise<this> {\n const response = await this.internalPut(\"\", data);\n this.data = await response.json();\n return this;\n }\n\n /**\n * Deletes a project from the server.\n *\n * @returns Returns the raw data of a deleted project.\n */\n delete(): Promise<any> {\n return this.internalDelete(\"\")\n .then((response) => response.text())\n .then((text) => {\n // TODO fix for server 23.5 and below\n try {\n return JSON.parse(text);\n } catch {\n return { id: this.id };\n }\n });\n }\n\n /**\n * Saves project properties changes to the server. Call this method to update project data on\n * the server after any property changes.\n */\n save(): Promise<this> {\n return this.update(this.data);\n }\n\n /**\n * Sets or removes the project preview.\n *\n * @param image - Preview image. Can be a\n * {@link https://developer.mozilla.org/docs/Web/HTTP/Basics_of_HTTP/Data_URIs | Data URL}\n * string,\n * {@link https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer | ArrayBuffer},\n * {@link https://developer.mozilla.org/docs/Web/API/Blob/Blob | Blob} or\n * {@link https://developer.mozilla.org/docs/Web/API/File | Web API File} object. Setting\n * the `image` to `null` will remove the preview.\n */\n\n async setPreview(image?: BodyInit | null): Promise<any> {\n if (!image) {\n await this.deletePreview();\n } else {\n const response = await this.internalPost(\"/preview\", image);\n this.data = await response.json();\n }\n return this;\n }\n\n /**\n * Removes the project preview.\n */\n async deletePreview(): Promise<this> {\n const response = await this.internalDelete(\"/preview\");\n this.data = await response.json();\n return this;\n }\n\n /**\n * Returns a list of project roles. Project members have different abilities depending on the\n * role they have in a project.\n */\n getRoles(): Promise<Role[]> {\n return this.internalGet(\"/roles\")\n .then((response) => response.json())\n .then((array) => array.map((data) => new Role(data, this.id, this.httpClient)));\n }\n\n /**\n * Returns information about the specified project role.\n *\n * @param name - Role name.\n */\n getRole(name: string): Promise<Role> {\n return this.internalGet(`/roles/${name}`)\n .then((response) => response.json())\n .then((data) => new Role(data, this.id, this.httpClient));\n }\n\n /**\n * Creates a new project role.\n *\n * @param name - Role name.\n * @param description - Role description.\n * @param permissions - Actions are allowed to be performed. See {@link Role.permissions} for\n * more details.\n */\n createRole(name: string, description: string, permissions: any): Promise<Role> {\n return this.internalPost(\"/roles\", {\n name,\n description,\n permissions: permissions || {},\n })\n .then((response) => response.json())\n .then((data) => new Role(data, this.id, this.httpClient));\n }\n\n /**\n * Deletes the specified project role.\n *\n * @param name - Role name.\n * @returns Returns the raw data of a deleted role.\n */\n deleteRole(name: string): Promise<any> {\n return this.internalDelete(`/roles/${name}`).then((response) => response.json());\n }\n\n /**\n * Returns a list of project members.\n */\n getMembers(): Promise<Member[]> {\n return this.internalGet(\"/members\")\n .then((response) => response.json())\n .then((array) => array.map((data) => new Member(data, this.id, this.httpClient)));\n }\n\n /**\n * Returns information about the specified project member.\n *\n * @param memberId - Member ID.\n */\n getMember(memberId: string): Promise<Member> {\n return this.internalGet(`/members/${memberId}`)\n .then((response) => response.json())\n .then((data) => new Member(data, this.id, this.httpClient));\n }\n\n /**\n * Add a user to the project to become a member and have permission to perform actions.\n *\n * @param userId - User ID.\n * @param role - Role name from the list of project roles.\n */\n addMember(userId: string, role: string): Promise<Member> {\n return this.internalPost(\"/members\", { userId, role })\n .then((response) => response.json())\n .then((data) => new Member(data, this.id, this.httpClient));\n }\n\n /**\n * Remove the specified member from a project.\n *\n * @param memberId - Member ID.\n * @returns Returns the raw data of a deleted member.\n */\n removeMember(memberId: string): Promise<any> {\n return this.internalDelete(`/members/${memberId}`).then((response) => response.json());\n }\n\n /**\n * Information about the file (model) that can be reference in the project topics.\n *\n * @typedef {any} FileInformation\n * @property {any[]} display_information - The list of fields to allow users to associate the\n * file with a server model.\n * @property {string} display_information.field_display_name - Field display name.\n * @property {string} display_information.field_value - Field value.\n * @property {any} file - The file reference object.\n * @property {string} file.file_name - File name.\n * @property {string} file.reference - File ID.\n */\n\n /**\n * Returns a list of project files. To add a file to this list, create a `project` permission\n * on the file using {@link File.createPermission | File.createPermission()}.\n */\n getFilesInformation(): Promise<any[]> {\n return this.httpClient\n .get(`/bcf/3.0/projects/${this.data.id}/files_information`)\n .then((response) => response.json())\n .then((items) => {\n items.forEach((item) => {\n const getFieldValue = (displayName: string) => {\n return (item.display_information.find((x) => x.field_display_name === displayName) || {}).field_value;\n };\n\n const previewUrl = `${this.httpClient.serverUrl}/files/${item.file.reference}/preview`;\n const ownerAvatarUrl = `${this.httpClient.serverUrl}/users/${getFieldValue(\"Owner\")}/avatar`;\n\n const ownerFirstName = getFieldValue(\"Owner First Name\");\n const ownerLastName = getFieldValue(\"Owner Last Name\");\n const ownerUserName = getFieldValue(\"Owner User Name\");\n const ownerFullName = userFullName(ownerFirstName, ownerLastName, ownerUserName);\n const ownerInitials = userInitials(ownerFullName);\n\n item.display_information.push({ field_display_name: \"Preview URL\", field_value: previewUrl });\n item.display_information.push({ field_display_name: \"Owner Avatar URL\", field_value: ownerAvatarUrl });\n item.display_information.push({ field_display_name: \"Owner Full Name\", field_value: ownerFullName });\n item.display_information.push({ field_display_name: \"Owner Initials\", field_value: ownerInitials });\n\n // updatedBy since 24.10\n\n const updatedByAvatarUrl = `${this.httpClient.serverUrl}/users/${getFieldValue(\"Updated By\")}/avatar`;\n\n const updatedByFirstName = getFieldValue(\"Updated By First Name\");\n const updatedByLastName = getFieldValue(\"Updated By Last Name\");\n const updatedByUserName = getFieldValue(\"Updated By User Name\");\n const updatedByFullName = userFullName(updatedByFirstName, updatedByLastName, updatedByUserName);\n const updatedByInitials = userInitials(updatedByFullName);\n\n item.display_information.push({\n field_display_name: \"Updated By Avatar URL\",\n field_value: updatedByAvatarUrl,\n });\n item.display_information.push({ field_display_name: \"Updated By Full Name\", field_value: updatedByFullName });\n item.display_information.push({ field_display_name: \"Updated By Initials\", field_value: updatedByInitials });\n\n // geometryType since 24.12\n\n const geometry = getFieldValue(\"Geometry Status\");\n const geometryGltf = getFieldValue(\"GeometryGltf Status\");\n const geometryType = geometry === \"done\" ? \"vsfx\" : geometryGltf === \"done\" ? \"gltf\" : \"\";\n\n item.display_information.push({ field_display_name: \"Geometry Type\", field_value: geometryType });\n });\n return items;\n });\n }\n}\n","///////////////////////////////////////////////////////////////////////////////\n// Copyright (C) 2002-2024, Open Design Alliance (the \"Alliance\").\n// All rights reserved.\n//\n// This software and its documentation and related materials are owned by\n// the Alliance. The software may only be incorporated into application\n// programs owned by members of the Alliance, subject to a signed\n// Membership Agreement and Supplemental Software License Agreement with the\n// Alliance. The structure and organization of this software are the valuable\n// trade secrets of the Alliance and its suppliers. The software is also\n// protected by copyright law and international treaty provisions. Application\n// programs incorporating this software must include the following statement\n// with their copyright notices:\n//\n// This application incorporates Open Design Alliance software pursuant to a\n// license agreement with Open Design Alliance.\n// Open Design Alliance Copyright (C) 2002-2024 by Open Design Alliance.\n// All rights reserved.\n//\n// By use of this software, its documentation or related materials, you\n// acknowledge and accept the above terms.\n///////////////////////////////////////////////////////////////////////////////\n\nimport { IHttpClient } from \"./IHttpClient\";\nimport { FetchError } from \"./FetchError\";\nimport { userFullName, userInitials } from \"./Utils\";\n\n/**\n * Provides properties and methods for obtaining information about a server user and manage its data.\n */\nexport class User {\n private _data: any;\n public httpClient: IHttpClient;\n\n /**\n * @param data - Raw user data received from the server.\n * @param httpClient - HTTP client instance used to send REST API requests to the server.\n */\n constructor(data: any, httpClient: IHttpClient) {\n this.httpClient = httpClient;\n this.data = data;\n }\n\n /**\n * User avatar image URL or empty string if the user does not have an avatar. Use\n * {@link setAvatar | setAvatar()} to change avatar image.\n *\n * @readonly\n */\n get avatarUrl(): string {\n return this._data.avatarUrl;\n }\n\n /**\n * `true` if user is allowed to create a projects.\n *\n * Only administrators can change create project permission.\n */\n get canCreateProject(): boolean {\n return this.data.canCreateProject;\n }\n\n set canCreateProject(value: boolean) {\n this._data.canCreateProject = value;\n }\n\n /**\n * Account registration time (UTC) in the format specified in\n * {@link https://www.wikipedia.org/wiki/ISO_8601 | ISO 8601}.\n *\n * @readonly\n */\n get createAt(): string {\n return this.data.createAt;\n }\n\n /**\n * User custom fields object, to store custom data.\n */\n get customFields(): any {\n return this.data.customFields;\n }\n\n set customFields(value: any) {\n this._data.customFields = value;\n }\n\n /**\n * Raw user data received from the server.\n *\n * @readonly\n */\n\n get data(): any {\n return this._data;\n }\n\n private set data(value: any) {\n this._data = value;\n this._data.avatarUrl = value.avatarImage\n ? `${this.httpClient.serverUrl}/users/${this._data.id}/avatar?updated=${value.lastModified}`\n : \"\";\n this._data.fullName = userFullName(this._data);\n this._data.initials = userInitials(this._data.fullName);\n }\n\n /**\n * User email.\n */\n get email(): string {\n return this.data.email;\n }\n\n set email(value: string) {\n this._data.email = value;\n }\n\n /**\n * The user's email confirmation code, or an empty string if the email has already been confirmed.\n *\n * @readonly\n */\n get emailConfirmationId(): string {\n return this.data.emailConfirmationId;\n }\n\n /**\n * First name.\n */\n get firstName(): string {\n return this.data.firstName;\n }\n\n set firstName(value: string) {\n this._data.firstName = value;\n }\n\n /**\n * Full name. Returns the user's first and last name. If first name and last names are empty,\n * returns the user name.\n *\n * @readonly\n */\n get fullName(): string {\n return this.data.fullName;\n }\n\n /**\n * Unique user ID.\n *\n * @readonly\n */\n get id(): string {\n return this.data.id;\n }\n\n /**\n * User initials. Returns a first letters of the user's first and last names. If first name\n * and last names are empty, returns the first letter of the user name.\n *\n * @readonly\n */\n get initials(): string {\n return this.data.initials;\n }\n\n /**\n * `true` if user is an administrator.\n *\n * Only administrators can change user type.\n */\n get isAdmin(): boolean {\n return this.data.isAdmin;\n }\n\n set isAdmin(value: boolean) {\n this._data.isAdmin = value;\n }\n\n /**\n * `false` if the user has not yet confirmed his email address.\n *\n * @readonly\n */\n get isEmailConfirmed(): boolean {\n return this.data.isEmailConfirmed;\n }\n\n /**\n * User last update time (UTC) in the format specified in\n * {@link https://www.wikipedia.org/wiki/ISO_8601 | ISO 8601}.\n */\n get lastModified(): string {\n return this.data.lastModified;\n }\n\n /**\n * Last name.\n */\n get lastName(): string {\n return this.data.lastName;\n }\n\n set lastName(value: string) {\n this._data.lastName = value;\n }\n\n /**\n * User last sign in time (UTC) in the format specified in\n * {@link https://www.wikipedia.org/wiki/ISO_8601 | ISO 8601}.\n */\n get lastSignIn(): string {\n return this.data.lastSignIn;\n }\n\n /**\n * The maximum number of projects that a user can create.\n *\n * Only administrators can change projects limit.\n */\n get projectsLimit(): number {\n return this.data.projectsLimit;\n }\n\n set projectsLimit(value: number) {\n this._data.projectsLimit = value;\n }\n\n /**\n * The identity provider used to create the account. Can be `ldap`, `oauth`, `saml` or empty\n * for local accounts.\n *\n * @readonly\n */\n get providerType(): string {\n return this.data.providerType;\n }\n\n /**\n * User storage size on the server for uploading files.\n *\n * Only administrators can change storage size.\n */\n get storageLimit(): number {\n return this.data.storageLimit;\n }\n\n set storageLimit(value: number) {\n this._data.storageLimit = value;\n }\n\n /**\n * The total size of the user's files in the storage.\n *\n * @readonly\n */\n get storageUsed(): number {\n return this.data.storageUsed;\n }\n\n /**\n * The user's access token (API key). Use\n * {@link Client.signInWithToken | Client.signInWithToken()} to sign in to the server using this token.\n *\n * @readonly\n */\n get token(): string {\n return this.data.tokenInfo.token;\n }\n\n /**\n * User name.\n */\n get userName(): string {\n return this.data.userName;\n }\n\n set userName(value: string) {\n this._data.userName = value;\n }\n\n /**\n * Reloads user data from the server.\n *\n * Only administrators can checkout other users. If the current logged in user is not an\n * administrator, they can only checkout themselves, otherwise an exception will be thrown.\n */\n async checkout(): Promise<this> {\n if (this.httpClient.signInUserIsAdmin) {\n const response = await this.httpClient.get(`/users/${this.id}`);\n const data = await response.json();\n this.data = { id: data.id, ...data.userBrief };\n } else if (this.id === this.httpClient.signInUserId) {\n const response = await this.httpClient.get(\"/user\");\n const data = await response.json();\n this.data = { id: this.id, ...data };\n } else {\n return Promise.reject(new FetchError(403));\n }\n return this;\n }\n\n /**\n * Updates user data on the server.\n *\n * Only administrators can update other users. If the current logged in user is not an\n * administrator, they can only update themself, otherwise an exception will be thrown.\n *\n * @param data - Raw user data.\n */\n async update(data: any): Promise<this> {\n if (this.httpClient.signInUserIsAdmin) {\n const response = await this.httpClient.put(`/users/${this.id}`, { isAdmin: data.isAdmin, userBrief: data });\n const newData = await response.json();\n this.data = { id: newData.id, ...newData.userBrief };\n } else if (this.id === this.httpClient.signInUserId) {\n const response = await this.httpClient.put(\"/user\", data);\n const newData = await response.json();\n this.data = { id: this.id, ...newData };\n } else {\n return Promise.reject(new FetchError(403));\n }\n return this;\n }\n\n /**\n * Deletes a user from the server.\n *\n * Only administrators can delete users. If the current logged in user is not an\n * administrator, an exception will be thrown.\n *\n * Administrators can delete themselves or other administrators. An administrator can only\n * delete themself if they is not the last administrator.\n *\n * You need to re-login after deleting the current logged in user.\n *\n * @returns Returns the raw data of a deleted user.\n */\n delete(): Promise<any> {\n if (this.httpClient.signInUserIsAdmin) {\n return this.httpClient\n .delete(`/users/${this.id}`)\n .then((response) => response.json())\n .then((data) => {\n if (this.id === this.httpClient.signInUserId) {\n this.httpClient.headers = {};\n this.httpClient.signInUserId = \"\";\n this.httpClient.signInUserIsAdmin = false;\n }\n return data;\n });\n } else {\n return Promise.reject(new FetchError(403));\n }\n }\n\n /**\n * Saves user properties changes to the server. Call this method to update user data on the\n * server after any property changes.\n */\n save(): Promise<this> {\n return this.update(this.data);\n }\n\n /**\n * Sets or removes the user avatar.\n *\n * Only administrators can set the avatar of other users. If the current logged in user is\n * not an administrator, they can only set their avatar, otherwise an exception will be thrown.\n *\n * @param image - Avatar image. Can be a\n * {@link https://developer.mozilla.org/docs/Web/HTTP/Basics_of_HTTP/Data_URIs | Data URL}\n * string,\n * {@link https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer | ArrayBuffer},\n * {@link https://developer.mozilla.org/docs/Web/API/Blob/Blob | Blob} or\n * {@link https://developer.mozilla.org/docs/Web/API/File | Web API File} object. Setting\n * the `image` to `null` will remove the avatar.\n */\n async setAvatar(image?: BodyInit | null): Promise<this> {\n if (!image) {\n await this.deleteAvatar();\n } else if (this.httpClient.signInUserIsAdmin) {\n const response = await this.httpClient.post(`/users/${this.id}/avatar`, image);\n const data = await response.json();\n this.data = { id: data.id, ...data.userBrief };\n } else if (this.id === this.httpClient.signInUserId) {\n const response = await this.httpClient.post(\"/user/avatar\", image);\n const data = await response.json();\n this.data = { id: this.id, ...data };\n } else {\n return Promise.reject(new FetchError(403));\n }\n return this;\n }\n\n /**\n * Removes the user avatar.\n *\n * Only administrators can remove the avatar of other users. If the current logged in user is\n * not an administrator, they can only remove their avatar, otherwise an exception will be thrown.\n */\n async deleteAvatar(): Promise<this> {\n if (this.httpClient.signInUserIsAdmin) {\n const response = await this.httpClient.delete(`/users/${this.id}/avatar`);\n const data = await response.json();\n this.data = { id: data.id, ...data.userBrief };\n } else if (this.id === this.httpClient.signInUserId) {\n const response = await this.httpClient.delete(\"/user/avatar\");\n const data = await response.json();\n this.data = { id: this.id, ...data };\n } else {\n return Promise.reject(new FetchError(403));\n }\n return this;\n }\n\n /**\n * Changes the user password.\n *\n * Only administrators can change the passwords of other users. If the current logged in user\n * is not an administrator, they can only change their password, otherwise an exception will\n * be thrown.\n *\n * To change their password, non-administrator users must specify their old password.\n *\n * @param newPassword - New user password.\n * @param oldPassword - Old user password. Only required for non-administrator users to\n * change their password.\n */\n async changePassword(newPassword: string, oldPassword?: string): Promise<this> {\n if (this.httpClient.signInUserIsAdmin) {\n const response = await this.httpClient.put(`/users/${this.id}/password`, { new: newPassword });\n const data = await response.json();\n this.data = { id: data.id, ...data.userBrief };\n } else if (this.id === this.httpClient.signInUserId) {\n const response = await this.httpClient.put(\"/user/password\", { old: oldPassword, new: newPassword });\n const data = await response.json();\n this.data = { id: this.id, ...data };\n } else {\n return Promise.reject(new FetchError(403));\n }\n return this;\n }\n}\n","///////////////////////////////////////////////////////////////////////////////\n// Copyright (C) 2002-2024, Open Design Alliance (the \"Alliance\").\n// All rights reserved.\n//\n// This software and its documentation and related materials are owned by\n// the Alliance. The software may only be incorporated into application\n// programs owned by members of the Alliance, subject to a signed\n// Membership Agreement and Supplemental Software License Agreement with the\n// Alliance. The structure and organization of this software are the valuable\n// trade secrets of the Alliance and its suppliers. The software is also\n// protected by copyright law and international treaty provisions. Application\n// programs incorporating this software must include the following statement\n// with their copyright notices:\n//\n// This application incorporates Open Design Alliance software pursuant to a\n// license agreement with Open Design Alliance.\n// Open Design Alliance Copyright (C) 2002-2024 by Open Design Alliance.\n// All rights reserved.\n//\n// By use of this software, its documentation or related materials, you\n// acknowledge and accept the above terms.\n///////////////////////////////////////////////////////////////////////////////\n\nimport { EventEmitter2 } from \"@inweb/eventemitter2\";\n\nimport { IHttpClient } from \"./IHttpClient\";\nimport { HttpClient } from \"./HttpClient\";\nimport { FetchError } from \"./FetchError\";\nimport { ClientEventMap } from \"./ClientEvents\";\nimport { Assembly } from \"./Assembly\";\nimport { File } from \"./File\";\nimport { Job } from \"./Job\";\nimport { Project } from \"./Project\";\nimport { User } from \"./User\";\nimport { parseArgs } from \"./Utils\";\n\n/**\n * Provides methods for managing server resources such as users, files, assemblies, jobs, projects, etc.\n */\nexport class Client extends EventEmitter2<ClientEventMap> {\n private _serverUrl = \"\";\n private _httpClient: IHttpClient = new HttpClient(\"\");\n private _user: User | null = null;\n public eventEmitter: EventEmitter2 = this;\n\n /**\n * @param params - An object containing client configuration parameters.\n * @param params.serverUrl - Open Cloud Server REST API base URL.\n * @param params.url - Deprecated since `25.8`. Use `serverUrl` instead.\n */\n constructor(params: { serverUrl?: string; url?: string } = {}) {\n super();\n this.configure(params);\n }\n\n /**\n * Open Cloud Server REST API base URL. Use {@link configure | configure()} to change server URL.\n *\n * @readonly\n */\n get serverUrl(): string {\n return this._serverUrl;\n }\n\n /**\n * HTTP client instance used to send REST API requests and receive responses from the server.\n *\n * @readonly\n */\n get httpClient(): IHttpClient {\n return this._httpClient;\n }\n\n /**\n * Deprecated since `25.3`. Use `Viewer.options()` instead to change `Viewer` parameters.\n *\n * @deprecated\n */\n get options(): any {\n console.warn(\n \"Client.options has been deprecated since 25.3 and will be removed in a future release, use Viewer.options instead.\"\n );\n const data = {\n showWCS: true,\n cameraAnimation: true,\n antialiasing: true,\n groundShadow: false,\n shadows: false,\n cameraAxisXSpeed: 4,\n cameraAxisYSpeed: 1,\n ambientOcclusion: false,\n enableStreamingMode: true,\n enablePartialMode: false,\n memoryLimit: 3294967296,\n cuttingPlaneFillColor: { red: 0xff, green: 0x98, blue: 0x00 },\n edgesColor: { r: 0xff, g: 0x98, b: 0x00 },\n facesColor: { r: 0xff, g: 0x98, b: 0x00 },\n edgesVisibility: true,\n edgesOverlap: true,\n facesOverlap: false,\n facesTransparancy: 200,\n enableCustomHighlight: true,\n sceneGraph: false,\n edgeModel: true,\n reverseZoomWheel: false,\n enableZoomWheel: true,\n enableGestures: true,\n };\n return {\n ...data,\n data,\n defaults: () => data,\n resetToDefaults: () => {},\n saveToStorage: () => {},\n loadFromStorage: () => {},\n };\n }\n\n /**\n * Changes the client parameters.\n *\n * After changing the parameters, you must re-login.\n *\n * @param params - An object containing new parameters.\n * @param params.serverUrl - Open Cloud Server REST API base URL.\n */\n configure(params: { serverUrl?: string }): this {\n this._serverUrl = (params.serverUrl || \"\").replace(/\\/+$/, \"\");\n this._httpClient = new HttpClient(this.serverUrl);\n this._user = null;\n return this;\n }\n\n /**\n * The Object represents server version information.\n *\n * @typedef {any} VersionResult\n * @property {string} version - The server version.\n * @property {string} hash - Build hash.\n */\n\n /**\n * Returns client and server versions.\n */\n version(): Promise<any> {\n return this.httpClient\n .get(\"/version\")\n .then((response) => response.json())\n .then((data) => ({\n ...data,\n server: data.version,\n client: \"CLIENT_JS_VERSION\",\n }));\n }\n\n /**\n * Registers a new user on the server.\n *\n * @param email - User email. Cannot be empty. Must be unique within the server.\n * @param password - User password. Cannot be empty. Password can only contain letters (a-z,\n * A-Z), numbers (0-9), and special characters (~!@#$%^&*()_-+={}[]<>|/'\":;.,?).\n * @param userName - User name. Cannot be empty or blank if defined. this to `undefined` to\n * use `username` from email.\n */\n registerUser(email: string, password: string, userName?: string): Promise<any> {\n return this.httpClient\n .post(\"/register\", {\n email,\n password,\n userName: userName ?? (email + \"\").split(\"@\").at(0),\n })\n .then((response) => response.json());\n }\n\n /**\n * Resends a Confirmation Email to the new user. If the user's email is already confirmed, an\n * exception will be thrown.\n *\n * @param email - User email.\n * @param password - User password.\n */\n resendConfirmationEmail(email: string, password: string): Promise<any> {\n return this.httpClient\n .post(\"/register/email-confirmation\", { email, password })\n .then((response) => response.json());\n }\n\n /**\n * Marks the user's email address as confirmed. If the user's email is already confirmed, an\n * exception will be thrown.\n *\n * @param emailConfirmationId - Confirmation code from the Confirmation Email.\n */\n confirmUserEmail(emailConfirmationId: string): Promise<any> {\n return this.httpClient\n .get(`/register/email-confirmation/${emailConfirmationId}`)\n .then((response) => response.json());\n }\n\n /**\n * Log in an existing user using email or user name.\n *\n * @param email - An email or user name for authentication request.\n * @param password - Password for authentication request.\n */\n async signInWithEmail(email: string, password: string): Promise<User> {\n const credentials = btoa(unescape(encodeURIComponent(email + \":\" + password)));\n this.httpClient.headers = { Authorization: \"Basic \" + credentials };\n const response = await this.httpClient.get(\"/token\");\n const data = await response.json();\n return this.setCurrentUser(data);\n }\n\n /**\n * Log in an existing user using access token (API Key).\n *\n * @param token - An access token for authentication request. See {@link User.token} for more details.\n */\n async signInWithToken(token: string): Promise<User> {\n this.httpClient.headers = { Authorization: token };\n const response = await this.httpClient.get(\"/user\");\n const data = await response.json();\n return this.setCurrentUser(data);\n }\n\n // Save the current logged in user information for internal use.\n\n private setCurrentUser(data: any): User {\n this._user = new User(data, this.httpClient);\n this.httpClient.headers = { Authorization: data.tokenInfo.token };\n this.httpClient.signInUserId = this._user.id;\n this.httpClient.signInUserIsAdmin = this._user.isAdmin;\n return this._user;\n }\n\n private clearCurrentUser(): void {\n this._user = null;\n this.httpClient.headers = {};\n this.httpClient.signInUserId = \"\";\n this.httpClient.signInUserIsAdmin = false;\n }\n\n /**\n * Returns the current logged in user. Returns `null` if the user is not logged in or the\n * logged in user has deleted themself.\n */\n getCurrentUser(): User | null {\n if (this._user && !this.httpClient.signInUserId) this._user = null;\n return this._user;\n }\n\n /**\n * Returns the list of server enabled indentity providers.\n */\n getIdentityProviders(): Promise<any> {\n return this.httpClient.get(\"/identity\").then((response) => response.json());\n }\n\n /**\n * Returns the current server settings.\n */\n getServerSettings(): Promise<any> {\n return this.httpClient.get(\"/settings\").then((response) => response.json());\n }\n\n /**\n * Changes the server settings.\n *\n * Only administrators can change server settings. If the current logged in user is not an\n * administrator, an exception will be thrown.\n */\n updateServerSettings(settings: any): Promise<any> {\n return this.httpClient.put(\"/settings\", settings).then((response) => response.json());\n }\n\n /**\n * Returns the list of server users.\n *\n * Only administrators can get a list of users. If the current logged in user is not an\n * administrator, an exception will be thrown.\n */\n getUsers(): Promise<User[]> {\n return this.httpClient\n .get(\"/users\")\n .then((response) => response.json())\n .then((array) => array.map((data) => ({ id: data.id, ...data.userBrief })))\n .then((array) => array.map((data) => new User(data, this.httpClient)));\n }\n\n /**\n * Returns information about the specified user.\n *\n * Only administrators can get other users. If the current logged in user is not an\n * administrator, they can only get themselves, otherwise an exception will be thrown.\n *\n * @param userId - User ID.\n */\n getUser(userId: string): Promise<User> {\n if (this.httpClient.signInUserIsAdmin) {\n return this.httpClient\n .get(`/users/${userId}`)\n .then((response) => response.json())\n .then((data) => ({ id: data.id, ...data.userBrief }))\n .then((data) => new User(data, this.httpClient));\n } else if (userId === this.httpClient.signInUserId) {\n return this.httpClient\n .get(\"/user\")\n .then((response) => response.json())\n .then((data) => ({ id: userId, ...data }))\n .then((data) => new User(data, this.httpClient));\n } else {\n return Promise.reject(new FetchError(403));\n }\n }\n\n /**\n * Creates a new user on the server.\n *\n * Only administrators can create users. If the current logged in user is not an\n * administrator, an exception will be thrown.\n *\n * @param email - User email. Cannot be empty. Must be unique within the server.\n * @param password - User password. Cannot be empty. Password can only contain latin letters\n * (a-z, A-Z), numbers (0-9), and special characters (~!@#$%^&*()_-+={}[]<>|/'\":;.,?).\n * @param params - Additional user data.\n * @param params.isAdmin - `true` if user is an administrator.\n * @param params.userName - User name. Cannot be empty or blank if defined. Specify\n * `undefined` to use `username` from email.\n * @param params.firstName - First name.\n * @param params.lastName - Last name.\n * @param params.canCreateProject - `true` if user is allowed to create a project.\n * @param params.projectsLimit - The maximum number of projects that the user can create.\n * @param params.storageLimit - The size of the file storage available to the user in bytes.\n */\n createUser(\n email: string,\n password: string,\n params: {\n isAdmin?: boolean;\n userName?: string;\n firstName?: string;\n lastName?: string;\n canCreateProject?: boolean;\n projectsLimit?: number;\n storageLimit?: number;\n } = {}\n ): Promise<User> {\n const { isAdmin, userName, ...rest } = params;\n return this.httpClient\n .post(\"/users\", {\n isAdmin,\n userBrief: {\n ...rest,\n email,\n userName: userName ?? (email + \"\").split(\"@\").at(0),\n },\n password,\n })\n .then((response) => response.json())\n .then((data) => ({ id: data.id, ...data.userBrief }))\n .then((data) => new User(data, this.httpClient));\n }\n\n /**\n * Deletes the specified user from the server.\n *\n * Only administrators can delete users. If the current logged in user is not an\n * administrator, an exception will be thrown.\n *\n * Administrators can delete themselves or other administrators. An administrator can only\n * delete themself if they is not the last administrator.\n *\n * You need to re-login after deleting the current logged in user.\n *\n * @param userId - User ID.\n * @returns Returns the raw data of a deleted user.\n */\n deleteUser(userId: string): Promise<any> {\n if (this.httpClient.signInUserIsAdmin) {\n return this.httpClient\n .delete(`/users/${userId}`)\n .then((response) => response.json())\n .then((data) => {\n if (userId === this.httpClient.signInUserId) {\n this.clearCurrentUser();\n }\n return data;\n });\n } else {\n return Promise.reject(new FetchError(403));\n }\n }\n\n /**\n * Result for file list.\n *\n * @typedef {any} FilesResult\n * @property {number} allSize - Total number of files the user has access to.\n * @property {number} start - The starting index in the file list in the request.\n * @property {number} limit - The maximum number of requested files.\n * @property {File[]} result - Result file list.\n * @property {number} size - The number of files in the result list.\n */\n\n /**\n * Returns a list of files that the current logged in user has uploaded to the server or has access to.\n *\n * @param start - The starting index in the file list. Used for paging.\n * @param limit - The maximum number of files that should be returned per request. Used for paging.\n * @param name - Filter the files by part of the name. Case sensitive.\n * @param ext - Filter the files by extension. Extension can be `dgn`, `dwf`, `dwg`, `dxf`,\n * `ifc`, `ifczip`, `nwc`, `nwd`, `obj`, `rcs`, `rfa`, `rvt`, `step`, `stl`, `stp`, `vsf`,\n * or any other file type extension.\n * @param ids - List of file IDs to return.\n * @param sortByDesc - Allows to specify the descending order of the result. By default,\n * files are sorted by name in ascending order.\n * @param {string} sortField - Allows to specify sort field.\n */\n getFiles(\n start?: number,\n limit?: number,\n name?: string,\n ext?: string | string[],\n ids?: string | string[],\n sortByDesc?: boolean,\n sortField?: string\n ): Promise<{ allSize: number; start: number; limit: number; result: File[]; size: number }> {\n const searchParams = new URLSearchParams();\n if (start > 0) searchParams.set(\"start\", start.toString());\n if (limit > 0) searchParams.set(\"limit\", limit.toString());\n if (name) searchParams.set(\"name\", name);\n if (ext) {\n if (Array.isArray(ext)) ext = ext.join(\"|\");\n if (typeof ext === \"string\") ext = ext.toLowerCase();\n if (ext) searchParams.set(\"ext\", ext);\n }\n if (ids) {\n if (Array.isArray(ids)) ids = ids.join(\"|\");\n searchParams.set(\"id\", ids);\n }\n if (sortByDesc !== undefined) searchParams.set(\"sortBy\", sortByDesc ? \"desc\" : \"asc\");\n if (sortField) searchParams.set(\"sortField\", sortField);\n\n let queryString = searchParams.toString();\n if (queryString) queryString = \"?\" + queryString;\n\n return this.httpClient\n .get(`/files${queryString}`)\n .then((response) => response.json())\n .then((files) => {\n return {\n ...files,\n result: files.result.map((data) => new File(data, this.httpClient)),\n };\n });\n }\n\n /**\n * Returns information about the specified file.\n *\n * @param fileId - File ID.\n */\n getFile(fileId: string): Promise<File> {\n return this.httpClient\n .get(`/files/${fileId}`)\n .then((response) => response.json())\n .then((data) => new File(data, this.httpClient));\n }\n\n /**\n * Upload a drawing or reference file to the server.\n *\n * Fires:\n *\n * - {@link UploadProgressEvent | uploadprogress}\n *\n * @param file - {@link https://developer.mozilla.org/docs/Web/API/File | Web API File} object\n * are generally retrieved from a\n * {@link https://developer.mozilla.org/docs/Web/API/FileList | FileList} object returned as\n * a result of a user selecting files using the HTML `<input>` element.\n * @param params - An object containing upload parameters.\n * @param params.geometry - Create job to convert file geometry data. Can be:\n *\n * - `true` - Convert file geometry data to `VSFX` format to open the file in `VisualizeJS` viewer.\n * - `vsfx` - Convert file geometry data to `VSFX` format to open the file in `VisualizeJS` viewer.\n * - `gltf` - Convert file geometry data to `glTF` format to open the file in `Three.js` viewer.\n *\n * @param params.properties - Create job to extract file properties.\n * @param params.waitForDone - Wait for geometry and properties jobs to complete.\n * @param params.timeout - The time, in milliseconds that the function should wait jobs. If\n * no one jobs are done during this time, the `TimeoutError` exception will be thrown.\n * @param params.interval - The time, in milliseconds, the function should delay in between\n * checking jobs status.\n * @param params.signal - An\n * {@link https://developer.mozilla.org/docs/Web/API/AbortController | AbortController}\n * signal, which can be used to abort waiting as desired.\n * @param params.onProgress - Upload progress callback.\n */\n async uploadFile(\n file: globalThis.File,\n params: {\n geometry?: boolean | string;\n properties?: boolean;\n waitForDone?: boolean;\n timeout?: number;\n interval?: number;\n signal?: AbortSignal;\n onProgress?: (progress: number, file: globalThis.File) => void;\n } = {\n geometry: true,\n properties: false,\n waitForDone: false,\n }\n ): Promise<File> {\n const result = await this.httpClient\n .uploadFile(\"/files\", file, (progress) => {\n this.emitEvent({ type: \"uploadprogress\", data: progress, file });\n params.onProgress?.(progress, file);\n })\n .then((xhr: XMLHttpRequest) => JSON.parse(xhr.responseText))\n .then((data) => new File(data, this.httpClient));\n\n const geometryType = typeof params.geometry === \"string\" ? params.geometry : \"vsfx\";\n\n const jobs: string[] = [];\n if (params.geometry) jobs.push((await result.extractGeometry(geometryType)).outputFormat);\n if (params.properties) jobs.push((await result.extractProperties()).outputFormat);\n if (jobs.length > 0)\n if (params.waitForDone) await result.waitForDone(jobs, true, params);\n else await result.checkout();\n\n return result;\n }\n\n /**\n * Deletes the specified file and all its versions from the server.\n *\n * You cannot delete a version file using `deleteFile()`, only the original file. To delete a\n * version file use {@link File.deleteVersion | File.deleteVersion()}.\n *\n * @param fileId - File ID.\n * @returns Returns the raw data of a deleted file.\n */\n deleteFile(fileId: string): Promise<any> {\n return this.httpClient.delete(`/files/${fileId}`).then((response) => response.json());\n }\n\n /**\n * Downloads the specified file from the server.\n *\n * @param fileId - File ID.\n * @param onProgress - Download progress callback.\n * @param signal - An\n * {@link https://developer.mozilla.org/docs/Web/API/AbortController | AbortController}\n * signal. Allows to communicate with a fetch request and abort it if desired.\n */\n downloadFile(fileId: string, onProgress?: (progress: number) => void, signal?: AbortSignal): Promise<ArrayBuffer> {\n return this.httpClient\n .downloadFile(`/files/${fileId}/downloads`, onProgress, signal)\n .then((response) => response.arrayBuffer());\n }\n\n /**\n * Result for job list.\n *\n * @typedef {any} JobsResult\n * @property {number} allSize - Total number of jobs created by the user.\n * @property {number} start - The starting index in the job list in the request.\n * @property {number} limit - The maximum number of requested jobs.\n * @property {Job[]} result - Result job list.\n * @property {number} size - The number of jobs in the result list.\n */\n\n /**\n * Returns a list of jobs started by the current logged in user.\n *\n * @param status - Filter the jobs by status. Status can be `waiting`, `inpogress`, `done` or `failed`.\n * @param limit - The maximum number of jobs that should be returned per request. Used for paging.\n * @param start - The starting index in the job list. Used for paging.\n * @param sortByDesc - Allows to specify the descending order of the result. By default, jobs\n * are sorted by creation time in ascending order.\n * @param {boolean} sortField - Allows to specify sort field.\n */\n getJobs(\n status?: string | string[],\n limit?: number,\n start?: number,\n sortByDesc?: boolean,\n sortField?: string\n ): Promise<{ allSize: number; start: number; limit: number; result: Job[]; size: number }> {\n const searchParams = new URLSearchParams();\n if (start > 0) searchParams.set(\"start\", start.toString());\n if (limit > 0) searchParams.set(\"limit\", limit.toString());\n if (status) {\n if (Array.isArray(status)) status = status.join(\"|\");\n if (typeof status === \"string\") status = status.trim().toLowerCase();\n if (status) searchParams.set(\"status\", status);\n }\n if (sortByDesc !== undefined) searchParams.set(\"sortBy\", sortByDesc ? \"desc\" : \"asc\");\n if (sortField) searchParams.set(\"sortField\", sortField);\n\n let queryString = searchParams.toString();\n if (queryString) queryString = \"?\" + queryString;\n\n return this.httpClient\n .get(`/jobs${queryString}`)\n .then((response) => response.json())\n .then((jobs) => ({\n ...jobs,\n result: jobs.result.map((data) => new Job(data, this.httpClient)),\n }));\n }\n\n /**\n * Returns information about the specified job.\n *\n * @param jobId - Job ID.\n */\n getJob(jobId: string): Promise<Job> {\n return this.httpClient\n .get(`/jobs/${jobId}`)\n .then((response) => response.json())\n .then((data) => new Job(data, this.httpClient));\n }\n\n /**\n * Runs a new job on the server for the sepecified file.\n *\n * @param fileId - File ID.\n * @param outputFormat - The job type. Can be one of:\n *\n * - `geometry` - Convert file geometry data to `VSFX` format suitable for `VisualizeJS` viewer.\n * - `geometryGltf` - Convert file geometry data to `glTF` format suitable for `Three.js` viewer.\n * - `properties` - Extract file properties.\n * - `validation` - Validate the file. Only for `IFC` files.\n * - `dwg`, `obj`, `gltf`, `glb`, `vsf`, `pdf`, `3dpdf` - Export file to the one of the supported format.\n * - Other custom job name. Custom job runner must be registered in the job templates table\n * before creating a job.\n *\n * @param parameters - Parameters for the job runner. Can be given as command line arguments\n * for the File Converter tool in form `--arg=value`.\n */\n createJob(fileId: string, outputFormat: string, parameters?: string | object): Promise<Job> {\n return this.httpClient\n .post(\"/jobs\", {\n fileId,\n outputFormat,\n parameters: parseArgs(parameters),\n })\n .then((response) => response.json())\n .then((data) => new Job(data, this.httpClient));\n }\n\n /**\n * Deletes the specified job from the server job list. Jobs that are in progress or have\n * already been completed cannot be deleted.\n *\n * @param jobId - Job ID.\n * @returns Returns the raw data of a deleted job.\n */\n deleteJob(jobId: string): Promise<any> {\n return this.httpClient.delete(`/jobs/${jobId}`).then((response) => response.json());\n }\n\n /**\n * Result for assembly list.\n *\n * @typedef {any} AssembliesResult\n * @property {number} allSize - Total number of assemblies the user has access to.\n * @property {number} start - The starting index in the assembly list in the request.\n * @property {number} limit - The maximum number of requested assemblies.\n * @property {Assembly[]} result - Result assembly list.\n * @property {number} size - The number of assemblies in the result list.\n */\n\n /**\n * Returns a list of assemblies created by the current logged in user.\n *\n * @param start - The starting index in the assembly list. Used for paging.\n * @param limit - The maximum number of assemblies that should be returned per request. Used\n * for paging.\n * @param name - Filter the assemblies by part of the name. Case sensitive.\n * @param ids - List of assembly IDs to return.\n * @param sortByDesc - Allows to specify the descending order of the result. By default\n * assemblies are sorted by name in ascending order.\n * @param sortField - Allows to specify sort field.\n */\n getAssemblies(\n start?: number,\n limit?: number,\n name?: string,\n ids?: string | string[],\n sortByDesc?: boolean,\n sortField?: string\n ): Promise<{ allSize: number; start: number; limit: number; result: Assembly[]; size: number }> {\n const searchParams = new URLSearchParams();\n if (start > 0) searchParams.set(\"start\", start.toString());\n if (limit > 0) searchParams.set(\"limit\", limit.toString());\n if (name) searchParams.set(\"name\", name);\n if (ids) {\n if (Array.isArray(ids)) ids = ids.join(\"|\");\n if (typeof ids === \"string\") ids = ids.trim();\n if (ids) searchParams.set(\"id\", ids);\n }\n if (sortByDesc !== undefined) searchParams.set(\"sortBy\", sortByDesc ? \"desc\" : \"asc\");\n if (sortField) searchParams.set(\"sortField\", sortField);\n\n let queryString = searchParams.toString();\n if (queryString) queryString = \"?\" + queryString;\n\n return this.httpClient\n .get(`/assemblies${queryString}`)\n .then((response) => response.json())\n .then((assemblies) => {\n return {\n ...assemblies,\n result: assemblies.result.map((data) => new Assembly(data, this.httpClient)),\n };\n });\n }\n\n /**\n * Returns information about the specified assembly.\n *\n * @param assemblyId - Assembly ID.\n */\n getAssembly(assemblyId: string): Promise<Assembly> {\n return this.httpClient\n .get(`/assemblies/${assemblyId}`)\n .then((response) => response.json())\n .then((data) => new Assembly(data, this.httpClient));\n }\n\n /**\n * Creates a new assembly on the server.\n *\n * @param files - List of file IDs.\n * @param name - Assembly name.\n * @param params - Additional assembly creating parameters.\n * @param params.waitForDone - Wait for assembly to be created.\n * @param params.timeout - The time, in milliseconds, that the function should wait for the\n * assembly to be created. If the assembly is not created within this time, a TimeoutError\n * exception will be thrown.\n * @param params.interval - The time, in milliseconds, the function should delay in between\n * checking assembly status.\n * @param params.signal - An\n * {@link https://developer.mozilla.org/docs/Web/API/AbortController | AbortController}\n * signal, which can be used to abort waiting as desired.\n * @param params.onCheckout - Waiting progress callback. Return `true` to cancel waiting.\n */\n createAssembly(\n files: string[],\n name: string,\n params?: {\n waitForDone?: boolean;\n timeout?: number;\n interval?: number;\n signal?: AbortSignal;\n onCheckout?: (assembly: Assembly, ready: boolean) => boolean;\n }\n ): Promise<Assembly> {\n const { waitForDone } = params ?? {};\n return this.httpClient\n .post(\"/assemblies\", { name, files })\n .then((response) => response.json())\n .then((data) => new Assembly(data, this.httpClient))\n .then((result) => (waitForDone ? result.waitForDone(params) : result));\n }\n\n /**\n * Deletes the specified assembly from the server.\n *\n * @param assemblyId - Assembly ID.\n * @returns Returns the raw data of a deleted assembly.\n */\n deleteAssembly(assemblyId: string): Promise<any> {\n return this.httpClient.delete(`/assemblies/${assemblyId}`).then((response) => response.json());\n }\n\n /**\n * Result for project list.\n *\n * @typedef {any} ProjectsResult\n * @property {number} allSize - Total number of projects the user has access to.\n * @property {number} start - The starting index in the project list in the request.\n * @property {number} limit - The maximum number of requested projects.\n * @property {Project[]} result - Result project list.\n * @property {number} size - The number of projects in the result list.\n */\n\n /**\n * Returns a list of projects that the currently logged in user has created or has access to.\n *\n * @param start - The starting index in the project list. Used for paging.\n * @param limit - The maximum number of projects that should be returned per request. Used for paging.\n * @param name - Filter the projects by part of the name. Case sensitive.\n * @param ids - List of project IDs to return.\n * @param sortByDesc - Allows to specify the descending order of the result. By default\n * projects are sorted by name in ascending order.\n */\n getProjects(\n start?: number,\n limit?: number,\n name?: string,\n ids?: string | string[],\n sortByDesc?: boolean\n ): Promise<{ allSize: number; start: number; limit: number; result: Project[]; size: number }> {\n const searchParams = new URLSearchParams();\n if (start > 0) searchParams.set(\"start\", start.toString());\n if (limit > 0) searchParams.set(\"limit\", limit.toString());\n if (name) searchParams.set(\"name\", name);\n if (ids) {\n if (Array.isArray(ids)) ids = ids.join(\"|\");\n if (typeof ids === \"string\") ids = ids.trim();\n if (ids) searchParams.set(\"id\", ids);\n }\n if (sortByDesc !== undefined) searchParams.set(\"sortBy\", sortByDesc ? \"desc\" : \"asc\");\n\n let queryString = searchParams.toString();\n if (queryString) queryString = \"?\" + queryString;\n return this.httpClient\n .get(`/projects${queryString}`)\n .then((response) => response.json())\n .then((projects) => {\n // fix for server 23.5 and below\n if (Array.isArray(projects)) {\n let result = projects;\n if (ids) result = result.filter((x) => ids.includes(x.id));\n if (name) result = result.filter((x) => x.name.includes(name));\n if (limit > 0) {\n const begin = start > 0 ? start : 0;\n result = result.slice(begin, begin + limit);\n }\n return {\n allSize: projects.length,\n start,\n limit,\n result,\n size: result.length,\n };\n }\n return projects;\n })\n .then((projects) => {\n return {\n ...projects,\n result: projects.result.map((data) => new Project(data, this.httpClient)),\n };\n });\n }\n\n /**\n * Returns information about the specified project.\n *\n * @param projectId - Project ID.\n */\n getProject(projectId: string): Promise<Project> {\n return this.httpClient\n .get(`/projects/${projectId}`)\n .then((response) => response.json())\n .then((data) => new Project(data, this.httpClient));\n }\n\n /**\n * Creates a new project on the server.\n *\n * @param name - Project name.\n * @param description - Project description.\n * @param startDate - Project start date.\n * @param endDate - Project end date.\n */\n createProject(\n name: string,\n description?: string,\n startDate?: Date | string,\n endDate?: Date | string\n ): Promise<Project> {\n return this.httpClient\n .post(\"/projects\", {\n name,\n description,\n startDate: startDate instanceof Date ? startDate.toISOString() : startDate,\n endDate: endDate instanceof Date ? endDate.toISOString() : endDate,\n })\n .then((response) => response.json())\n .then((data) => new Project(data, this.httpClient));\n }\n\n /**\n * Deletes the specified project from the server.\n *\n * @param projectId - Project ID.\n * @returns Returns the raw data of a deleted project.\n */\n deleteProject(projectId: string): Promise<any> {\n return this.httpClient\n .delete(`/projects/${projectId}`)\n .then((response) => response.text())\n .then((text) => {\n // fix for server 23.5 and below\n try {\n return JSON.parse(text);\n } catch {\n return { id: projectId };\n }\n });\n }\n}\n","///////////////////////////////////////////////////////////////////////////////\n// Copyright (C) 2002-2024, Open Design Alliance (the \"Alliance\").\n// All rights reserved.\n//\n// This software and its documentation and related materials are owned by\n// the Alliance. The software may only be incorporated into application\n// programs owned by members of the Alliance, subject to a signed\n// Membership Agreement and Supplemental Software License Agreement with the\n// Alliance. The structure and organization of this software are the valuable\n// trade secrets of the Alliance and its suppliers. The software is also\n// protected by copyright law and international treaty provisions. Application\n// programs incorporating this software must include the following statement\n// with their copyright notices:\n//\n// This application incorporates Open Design Alliance software pursuant to a\n// license agreement with Open Design Alliance.\n// Open Design Alliance Copyright (C) 2002-2024 by Open Design Alliance.\n// All rights reserved.\n//\n// By use of this software, its documentation or related materials, you\n// acknowledge and accept the above terms.\n///////////////////////////////////////////////////////////////////////////////\n\nexport { Assembly } from \"./Api/Assembly\";\nexport { Client } from \"./Api/Client\";\nexport { ClashTest } from \"./Api/ClashTest\";\nexport * from \"./Api/ClientEvents\";\nexport { File } from \"./Api/File\";\nexport { FetchError, statusText } from \"./Api/FetchError\";\nexport { Job } from \"./Api/Job\";\nexport { IModelTransformMatrix } from \"./Api/IAssembly\";\nexport { Member } from \"./Api/Member\";\nexport { Model } from \"./Api/Model\";\nexport { Permission } from \"./Api/Permission\";\nexport { Project } from \"./Api/Project\";\nexport { Role } from \"./Api/Role\";\nexport { User } from \"./Api/User\";\nexport { parseArgs, userFullName, userInitials, waitFor } from \"./Api/Utils\";\n\nexport const version = \"CLIENT_JS_VERSION\";\n"],"names":["STATUS_CODES","statusText","status","error400","text","_default","JSON","parse","description","FetchError","Error","constructor","message","super","this","name","Model","data","file","path","httpClient","_file","_data","assembly","value","database","default","fileId","geometry","id","type","version","getModels","Promise","resolve","getModelTransformMatrix","handle","setModelTransformMatrix","transform","then","getViewpoints","array","filter","custom_fields","modelId","modelName","saveViewpoint","viewpoint","deleteViewpoint","guid","getSnapshot","getSnapshotData","bitmapGuid","downloadResource","dataId","onProgress","signal","downloadResourceRange","requestId","ranges","partialDownloadResource","console","warn","downloadFileRange","records","length","map","record","begin","Number","end","reqId","i","size","get","push","delete","getReferences","delay","ms","timeoutId","abortHandler","clearTimeout","window","setTimeout","removeEventListener","addEventListener","once","async","waitFor","func","params","timeout","interval","_a","AbortController","abortError","_b","DOMException","timeoutError","_c","performance","now","count","result","aborted","reject","parseArgs","args","firstArg","indexOf","slice","argArray","split","x","y","flat","concat","Object","fromEntries","userFullName","firstName","lastName","userName","trim","userInitials","fullName","names","reduce","initials","index","charAt","toUpperCase","ClashTest","basePath","internalGet","relativePath","internalPut","body","put","internalDelete","clearance","createdAt","owner","avatarUrl","serverUrl","userId","lastModifiedAt","selectionSetA","selectionTypeA","selectionSetB","selectionTypeB","tolerance","checkout","response","json","update","save","waitForDone","checkDone","test","ready","includes","cancel","onCheckout","call","getReport","Assembly","appendVersionParam","_useVersion","undefined","delimiter","internalPost","post","activeVersion","associatedFiles","created","forEach","link","files","geometryType","originalAssemblyId","previewUrl","relatedJobs","versions","setPreview","image","deletePreview","obj","getProperties","handles","searchProperties","searchPattern","getCdaTree","viewpoints","downloadFile","arrayBuffer","references","getClashTests","start","limit","ids","sortByDesc","sortField","searchParams","URLSearchParams","set","toString","Array","isArray","join","queryString","tests","getClashTest","testId","createClashTest","deleteClashTest","updateVersion","getVersions","getVersion","deleteVersion","setActiveVersion","useVersion","EventEmitter2","_listeners","listener","listeners","removeAllListeners","emitEvent","event","invoke","on","off","emit","handleFetchError","ok","error","$fetch","url","method","headers","FormData","Blob","append","ArrayBuffer","stringify","init","fetch","handleXMLHttpError","xhr","responseText","$xmlhttp","XMLHttpRequest","open","key","setRequestHeader","calcProgress","lengthComputable","loaded","total","upload","onprogress","uploadProgress","downloadProgress","onloadend","target","send","HttpClient","signInUserId","signInUserIsAdmin","uploadFile","contentLength","parseInt","Response","ReadableStream","controller","reader","getReader","done","read","enqueue","close","rangedIndex","rangePos","chunkLeft","chunkPos","range","rangeLeft","chunk","subarray","Permission","actions","grantedTo","public","Job","assemblyId","authorId","lastUpdate","outputFormat","parameters","statusMessage","startedAt","job","File","customFields","preview","updatedAt","_o","_p","_q","state","_d","geometryStatus","_e","_r","properties","_f","propertiesStatus","_g","_s","validation","_h","validationStatus","_j","_t","updatedBy","_k","_u","_l","_v","geometryGltf","_m","_w","isFileDeleted","exports","originalFileId","sizeTotal","download","setReferences","createJob","extractGeometry","extractProperties","validate","jobs","waitAll","waitJobs","readyJobs","jobStatus","getPermissions","getPermission","permissionId","createPermission","_public","deletePermission","uploadVersion","progress","deleteSource","Role","projectId","permissions","Member","user","role","Project","authorization","endDate","Date","toISOString","memberCount","modelCount","startDate","topicCount","getRoles","getRole","createRole","deleteRole","getMembers","getMember","memberId","addMember","removeMember","getFilesInformation","items","item","getFieldValue","displayName","display_information","find","field_display_name","field_value","reference","ownerAvatarUrl","ownerFirstName","ownerLastName","ownerUserName","ownerFullName","ownerInitials","updatedByAvatarUrl","updatedByFirstName","updatedByLastName","updatedByUserName","updatedByFullName","updatedByInitials","User","canCreateProject","createAt","avatarImage","lastModified","email","emailConfirmationId","isAdmin","isEmailConfirmed","lastSignIn","projectsLimit","providerType","storageLimit","storageUsed","token","tokenInfo","userBrief","newData","setAvatar","deleteAvatar","changePassword","newPassword","oldPassword","new","old","Client","_serverUrl","_httpClient","_user","eventEmitter","configure","options","showWCS","cameraAnimation","antialiasing","groundShadow","shadows","cameraAxisXSpeed","cameraAxisYSpeed","ambientOcclusion","enableStreamingMode","enablePartialMode","memoryLimit","cuttingPlaneFillColor","red","green","blue","edgesColor","r","g","b","facesColor","edgesVisibility","edgesOverlap","facesOverlap","facesTransparancy","enableCustomHighlight","sceneGraph","edgeModel","reverseZoomWheel","enableZoomWheel","enableGestures","defaults","resetToDefaults","saveToStorage","loadFromStorage","replace","server","client","registerUser","password","at","resendConfirmationEmail","confirmUserEmail","signInWithEmail","credentials","btoa","unescape","encodeURIComponent","Authorization","setCurrentUser","signInWithToken","clearCurrentUser","getCurrentUser","getIdentityProviders","getServerSettings","updateServerSettings","settings","getUsers","getUser","createUser","rest","deleteUser","getFiles","ext","toLowerCase","getFile","deleteFile","getJobs","getJob","jobId","deleteJob","getAssemblies","assemblies","getAssembly","createAssembly","deleteAssembly","getProjects","projects","allSize","getProject","createProject","deleteProject"],"mappings":"AAuBA,MAAMA,eAAe;IACnB,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;;;AAGD,SAAUC,WAAWC;IACzB,OAAOF,aAAaE,WAAW,SAASA;AAC1C;;SAEgBC,SAASC,MAAcC,WAAW;IAChD;QACE,OAAOC,KAAKC,MAAMH,MAAMI;AACzB,MAAC;QACA,OAAOH;AACR;AACH;;AAQM,MAAOI,mBAAmBC;IAS9B,WAAAC,CAAYT,QAAgBU;QAC1BC,MAAMD,WAAWX,WAAWC;QAC5BY,KAAKC,OAAO;QACZD,KAAKZ,SAASA;QACdY,KAAKb,aAAaA,WAAWC;AAC9B;;;MCzFUc;IAUX,WAAAL,CAAYM,MAAWC;QACrBJ,KAAKK,OAAO,GAAGD,KAAKC;QACpBL,KAAKM,aAAaF,KAAKE;QACvBN,KAAKO,QAAQH;QACbJ,KAAKQ,QAAQL;AACd;IAOD,Y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AA+e,CAAc7J;QACZ,OAAOxV,KAAKM,WACTwD,OAAO,aAAa0R,aACpB/T,MAAMmH,YAAaA,SAAStJ,SAC5BmC,MAAMnC;YAEL;gBACE,OAAOE,KAAKC,MAAMH;AACnB,cAAC;gBACA,OAAO;oBAAEyB,IAAIyU;;AACd;AAAA;AAEN;;;ACn2BI,MAAMvU,UAAU;;"}
|
|
1
|
+
{"version":3,"file":"client.module.js","sources":["../src/Api/FetchError.ts","../src/Api/Model.ts","../src/Api/Utils.ts","../src/Api/ClashTest.ts","../src/Api/Assembly.ts","../../eventemitter2/dist/eventemitter2.module.js","../src/Api/Fetch.ts","../src/Api/XMLHttp.ts","../src/Api/HttpClient.ts","../src/Api/Permission.ts","../src/Api/Job.ts","../src/Api/File.ts","../src/Api/Role.ts","../src/Api/Member.ts","../src/Api/Project.ts","../src/Api/User.ts","../src/Api/Client.ts","../src/index.ts"],"sourcesContent":["///////////////////////////////////////////////////////////////////////////////\n// Copyright (C) 2002-2024, Open Design Alliance (the \"Alliance\").\n// All rights reserved.\n//\n// This software and its documentation and related materials are owned by\n// the Alliance. The software may only be incorporated into application\n// programs owned by members of the Alliance, subject to a signed\n// Membership Agreement and Supplemental Software License Agreement with the\n// Alliance. The structure and organization of this software are the valuable\n// trade secrets of the Alliance and its suppliers. The software is also\n// protected by copyright law and international treaty provisions. Application\n// programs incorporating this software must include the following statement\n// with their copyright notices:\n//\n// This application incorporates Open Design Alliance software pursuant to a\n// license agreement with Open Design Alliance.\n// Open Design Alliance Copyright (C) 2002-2024 by Open Design Alliance.\n// All rights reserved.\n//\n// By use of this software, its documentation or related materials, you\n// acknowledge and accept the above terms.\n///////////////////////////////////////////////////////////////////////////////\n\nconst STATUS_CODES = {\n 100: \"Continue\",\n 101: \"Switching Protocols\",\n 102: \"Processing\",\n 103: \"Early Hints\",\n 200: \"OK\",\n 201: \"Created\",\n 202: \"Accepted\",\n 203: \"Non-Authoritative Information\",\n 204: \"No Content\",\n 205: \"Reset Content\",\n 206: \"Partial Content\",\n 207: \"Multi-Status\",\n 208: \"Already Reported\",\n 226: \"IM Used\",\n 300: \"Multiple Choices\",\n 301: \"Moved Permanently\",\n 302: \"Found\",\n 303: \"See Other\",\n 304: \"Not Modified\",\n 305: \"Use Proxy\",\n 307: \"Temporary Redirect\",\n 308: \"Permanent Redirect\",\n 400: \"Bad Request\",\n 401: \"Unauthorized\",\n 402: \"Payment Required\",\n 403: \"Forbidden\",\n 404: \"Not Found\",\n 405: \"Method Not Allowed\",\n 406: \"Not Acceptable\",\n 407: \"Proxy Authentication Required\",\n 408: \"Request Time-out\",\n 409: \"Conflict\",\n 410: \"Gone\",\n 411: \"Length Required\",\n 412: \"Precondition Failed\",\n 413: \"Payload Too Large\",\n 414: \"URI Too Long\",\n 415: \"Unsupported Media Type\",\n 416: \"Range Not Satisfiable\",\n 417: \"Expectation Failed\",\n 418: \"I'm a teapot\",\n 421: \"Misdirected Request\",\n 422: \"Unprocessable Entity\",\n 423: \"Locked\",\n 424: \"Failed Dependency\",\n 425: \"Too Early\",\n 426: \"Upgrade Required\",\n 428: \"Precondition Required\",\n 429: \"Too Many Requests\",\n 431: \"Header Fields Too Large\",\n 451: \"Unavailable For Legal Reasons\",\n 500: \"Internal Server Error\",\n 501: \"Not Implemented\",\n 502: \"Bad Gateway\",\n 503: \"Service Unavailable\",\n 504: \"Gateway Timeout\",\n 505: \"HTTP Version Not Supported\",\n 506: \"Variant Also Negotiates\",\n 507: \"Insufficient Storage\",\n 508: \"Loop Detected\",\n 509: \"Bandwidth Limit Exceeded\",\n 510: \"Not Extended\",\n 511: \"Network Authentication Required\",\n};\n\nexport function statusText(status: number): string {\n return STATUS_CODES[status] || `Error ${status}`;\n}\n\nexport function error400(text: string, _default = \"400\"): string {\n try {\n return JSON.parse(text).description;\n } catch {\n return _default;\n }\n}\n\n/**\n * The `FetchError` object indicates an error when request to Open Cloud Server could not be\n * performed. A `FetchError` is typically (but not exclusively) thrown when a network error\n * occurs, access denied, or object not found.\n */\n\nexport class FetchError extends Error {\n protected status: number;\n protected statusText: string;\n\n /**\n * @property status - The\n * {@link https://developer.mozilla.org/docs/Web/HTTP/Status | HTTP status code} of the response.\n * @property message - Error message.\n */\n constructor(status: number, message?: string) {\n super(message || statusText(status));\n this.name = \"FetchError\";\n this.status = status;\n this.statusText = statusText(status);\n }\n}\n","///////////////////////////////////////////////////////////////////////////////\n// Copyright (C) 2002-2024, Open Design Alliance (the \"Alliance\").\n// All rights reserved.\n//\n// This software and its documentation and related materials are owned by\n// the Alliance. The software may only be incorporated into application\n// programs owned by members of the Alliance, subject to a signed\n// Membership Agreement and Supplemental Software License Agreement with the\n// Alliance. The structure and organization of this software are the valuable\n// trade secrets of the Alliance and its suppliers. The software is also\n// protected by copyright law and international treaty provisions. Application\n// programs incorporating this software must include the following statement\n// with their copyright notices:\n//\n// This application incorporates Open Design Alliance software pursuant to a\n// license agreement with Open Design Alliance.\n// Open Design Alliance Copyright (C) 2002-2024 by Open Design Alliance.\n// All rights reserved.\n//\n// By use of this software, its documentation or related materials, you\n// acknowledge and accept the above terms.\n///////////////////////////////////////////////////////////////////////////////\n\nimport { IHttpClient } from \"./IHttpClient\";\nimport type { File } from \"./File\";\nimport type { Assembly } from \"./Assembly\";\nimport type { IModelTransformMatrix } from \"./IAssembly\";\n\n/**\n * Provides properties and methods for working with view of the file or assembly. For example,\n * for `dwg` it is a `Model` space or layout, and for `rvt` files it is a `3D` view.\n */\nexport class Model {\n private _data: any;\n private _file: File | Assembly;\n public httpClient: IHttpClient;\n public path: string;\n\n /**\n * @param data - Raw model data received from the server.\n * @param file - The file/assembly instance that owns the model.\n */\n constructor(data: any, file: File | Assembly) {\n this.path = `${file.path}/downloads`;\n this.httpClient = file.httpClient;\n this._file = file;\n this._data = data;\n }\n\n /**\n * The `Assembly` instance that owns the model.\n *\n * @readonly\n */\n get assembly(): Assembly {\n return this._file as Assembly;\n }\n\n /**\n * Raw model data received from the server.\n *\n * @readonly\n */\n get data(): any {\n return this._data;\n }\n\n private set data(value: any) {\n this._data = value;\n }\n\n /**\n * Scene description resource file name. Use {@link downloadResource | downloadResource()} to\n * download scene description file.\n *\n * @readonly\n */\n get database(): string {\n return this.data.database;\n }\n\n /**\n * `true` if this is default model.\n *\n * @readonly\n */\n get default(): boolean {\n return this.data.default;\n }\n\n /**\n * The `File` instance that owns the model.\n *\n * @readonly\n */\n get file(): File {\n return this._file as File;\n }\n\n /**\n * The ID of the file that owns the model.\n *\n * @readonly\n */\n get fileId(): string {\n return this.data.fileId;\n }\n\n /**\n * The list of geometry data resource files. Use {@link downloadResource | downloadResource()}\n * to download geometry data files.\n *\n * @readonly\n */\n get geometry(): string[] {\n return this.data.geometry;\n }\n\n /**\n * Unique model ID.\n *\n * @readonly\n */\n get id(): string {\n return this.data.id;\n }\n\n /**\n * Model name.\n *\n * @readonly\n */\n get name(): string {\n return this.data.name;\n }\n\n /**\n * Model owner type, matches the file extension this is model of the file, or `assembly` for\n * assemblies.\n *\n * @readonly\n */\n get type(): string {\n return this.file.type;\n }\n\n // Reserved for future use.\n get version(): string {\n return this.data.version;\n }\n\n /**\n * Returns model list with one item `self`.\n */\n getModels(): Promise<Model[]> {\n return Promise.resolve([this]);\n }\n\n /**\n * Returns a model transformation.\n *\n * @param handle - Model handle.\n */\n getModelTransformMatrix(handle: string): IModelTransformMatrix {\n return this.file.getModelTransformMatrix(handle);\n }\n\n /**\n * Sets or removes a model transformation.\n *\n * @param handle - Model handle.\n * @param transform - Transformation matrix. Specify `undefined` to remove transformation.\n */\n setModelTransformMatrix(handle: string, transform: IModelTransformMatrix): Promise<this> {\n return this.file.setModelTransformMatrix(handle, transform).then(() => this);\n }\n\n /**\n * Returns a list of viewpoints of the owner file/assembly.\n */\n getViewpoints(): Promise<any[]> {\n return this._file\n .getViewpoints()\n .then((array) =>\n array.filter(\n ({ custom_fields = {} }) => custom_fields.modelId === this.id || custom_fields.modelName === this.name\n )\n );\n }\n\n /**\n * Saves a new model owner file/assembly viewpoint to the server. To create a new viewpoint\n * use `Viewer.createViewpoint()`.\n *\n * @param viewpoint - Viewpoint.\n */\n saveViewpoint(viewpoint: any): Promise<any> {\n return this._file.saveViewpoint({\n ...viewpoint,\n custom_fields: { ...viewpoint.custom_fields, modelId: this.id, modelName: this.name },\n });\n }\n\n /**\n * Deletes the specified viewpoint from the owner file/assembly.\n *\n * @param guid - Viewpoint GUID.\n * @returns Returns the raw data of a deleted viewpoint.\n */\n deleteViewpoint(guid: string): Promise<any> {\n return this._file.deleteViewpoint(guid);\n }\n\n /**\n * Returns viewpoint snapshot as base64-encoded\n * {@link https://developer.mozilla.org/docs/Web/HTTP/Basics_of_HTTP/Data_URIs | Data URL}.\n *\n * @param guid - Viewpoint GUID.\n */\n getSnapshot(guid: string): Promise<string> {\n return this._file.getSnapshot(guid);\n }\n\n /**\n * Returns viewpoint snapshot data.\n *\n * @param guid - Viewpoint GUID.\n * @param bitmapGuid - Bitmap GUID.\n */\n getSnapshotData(guid: string, bitmapGuid: string): Promise<string> {\n return this._file.getSnapshotData(guid, bitmapGuid);\n }\n\n /**\n * Downloads a resource file. Resource files are files that contain model scene descriptions,\n * or geometry data.\n *\n * @param dataId - Resource file name.\n * @param onProgress - Download progress callback.\n * @param signal - An\n * {@link https://developer.mozilla.org/docs/Web/API/AbortController | AbortController}\n * signal. Allows to communicate with a fetch request and abort it if desired.\n */\n downloadResource(\n dataId: string,\n onProgress?: (progress: number, chunk: Uint8Array) => void,\n signal?: AbortSignal\n ): Promise<ArrayBuffer> {\n return this._file.downloadResource(dataId, onProgress, signal);\n }\n\n /**\n * Downloads a part of resource file. Resource files are files that contain model scene\n * descriptions, or geometry data.\n *\n * @param dataId - Resource file name.\n * @param ranges - A range of resource file contents to download.\n * @param requestId - Request ID for download progress callback.\n * @param onProgress - Download progress callback.\n * @param signal - An\n * {@link https://developer.mozilla.org/docs/Web/API/AbortController | AbortController}\n * signal. Allows to communicate with a fetch request and abort it if desired.\n */\n downloadResourceRange(\n dataId: string,\n requestId: number,\n ranges: Array<{ begin: number; end: number; requestId: number }>,\n onProgress?: (progress: number, chunk: Uint8Array, requestId: number) => void,\n signal?: AbortSignal\n ): Promise<ArrayBuffer> {\n return this._file.downloadResourceRange(dataId, requestId, ranges, onProgress, signal);\n }\n\n /**\n * Deprecated since `25.3`. Use {@link downloadResource | downloadResource()} instead.\n *\n * @deprecated\n */\n partialDownloadResource(\n dataId: string,\n onProgress?: (progress: number, chunk: Uint8Array) => void,\n signal?: AbortSignal\n ): Promise<ArrayBuffer> {\n console.warn(\n \"Model.partialDownloadResource() has been deprecated since 25.3 and will be removed in a future release, use Model.downloadResource() instead.\"\n );\n return this.downloadResource(dataId, onProgress, signal);\n }\n\n /**\n * Deprecated since `25.3`. Use {@link downloadResourceRange | downloadResourceRange()} instead.\n *\n * @deprecated\n */\n async downloadFileRange(\n requestId: number,\n records: any | null,\n dataId: string,\n onProgress?: (progress: number, chunk: Uint8Array, requestId: number) => void,\n signal?: AbortSignal\n ): Promise<void> {\n if (!records) return;\n\n let ranges = [];\n if (records.length) {\n ranges = records.map((record) => ({\n begin: Number(record.begin),\n end: Number(record.end),\n requestId: record.reqId,\n }));\n } else {\n for (let i = 0; i < records.size(); i++) {\n const record = records.get(i);\n ranges.push({ begin: Number(record.begin), end: Number(record.end), requestId });\n record.delete();\n }\n }\n\n await this.downloadResourceRange(dataId, requestId, ranges, onProgress, signal);\n }\n\n /**\n * Returns a list of references of the owner file/assembly.\n *\n * References are images, fonts, or any other files to correct rendering of the file.\n *\n * @param signal - An\n * {@link https://developer.mozilla.org/docs/Web/API/AbortController | AbortController}\n * signal, which can be used to abort waiting as desired.\n */\n getReferences(signal?: AbortSignal): Promise<any> {\n return this._file.getReferences(signal);\n }\n}\n","///////////////////////////////////////////////////////////////////////////////\n// Copyright (C) 2002-2024, Open Design Alliance (the \"Alliance\").\n// All rights reserved.\n//\n// This software and its documentation and related materials are owned by\n// the Alliance. The software may only be incorporated into application\n// programs owned by members of the Alliance, subject to a signed\n// Membership Agreement and Supplemental Software License Agreement with the\n// Alliance. The structure and organization of this software are the valuable\n// trade secrets of the Alliance and its suppliers. The software is also\n// protected by copyright law and international treaty provisions. Application\n// programs incorporating this software must include the following statement\n// with their copyright notices:\n//\n// This application incorporates Open Design Alliance software pursuant to a\n// license agreement with Open Design Alliance.\n// Open Design Alliance Copyright (C) 2002-2024 by Open Design Alliance.\n// All rights reserved.\n//\n// By use of this software, its documentation or related materials, you\n// acknowledge and accept the above terms.\n///////////////////////////////////////////////////////////////////////////////\n\nfunction delay(ms: number, signal: AbortSignal): Promise<boolean> {\n return new Promise((resolve) => {\n let timeoutId = 0;\n\n const abortHandler = () => {\n clearTimeout(timeoutId);\n resolve(true);\n };\n\n timeoutId = window.setTimeout(() => {\n signal.removeEventListener(\"abort\", abortHandler);\n resolve(false);\n }, ms);\n\n signal.addEventListener(\"abort\", abortHandler, { once: true });\n });\n}\n\nexport async function waitFor(\n func: (params: any) => Promise<boolean>,\n params: {\n timeout?: number;\n interval?: number;\n signal?: AbortSignal;\n abortError?: DOMException;\n timeoutError?: DOMException;\n result?: any;\n } = {}\n): Promise<any> {\n const timeout = params.timeout || 600000;\n const interval = params.interval || 3000;\n const signal = params.signal ?? new AbortController().signal;\n const abortError = params.abortError ?? new DOMException(\"Aborted\", \"AbortError\");\n const timeoutError = params.timeoutError ?? new DOMException(\"Timeout\", \"TimeoutError\");\n\n const end = performance.now() + timeout;\n let count = timeout / interval;\n\n do {\n if (await func(params)) return Promise.resolve(params.result);\n if ((await delay(interval, signal)) || signal.aborted) return Promise.reject(abortError);\n } while (performance.now() < end && --count > 0);\n\n return Promise.reject(timeoutError);\n}\n\nexport function parseArgs(args?: string | object): object {\n if (typeof args === \"string\") {\n const firstArg = args.indexOf(\"--\");\n if (firstArg !== -1) args = args.slice(firstArg);\n const argArray = args\n .split(\"--\")\n .map((x) =>\n x\n .split(\"=\")\n .map((y) => y.split(\" \"))\n .flat()\n )\n .filter((x) => x[0])\n .map((x) => x.concat([\"\"]));\n return Object.fromEntries(argArray);\n }\n return args || {};\n}\n\nexport function userFullName(firstName: string | any, lastName = \"\", userName = \"\"): string {\n if (firstName && typeof firstName !== \"string\") {\n return userFullName(firstName.firstName ?? firstName.name, firstName.lastName, firstName.userName);\n }\n return `${firstName ?? \"\"} ${lastName ?? \"\"}`.trim() || userName;\n}\n\nexport function userInitials(fullName = \"\"): string {\n const names = fullName.split(\" \").filter((x) => x);\n return names\n .reduce((initials, name, index) => {\n if (index === 0 || index === names.length - 1) initials += name.charAt(0);\n return initials;\n }, \"\")\n .toUpperCase();\n}\n","///////////////////////////////////////////////////////////////////////////////\n// Copyright (C) 2002-2024, Open Design Alliance (the \"Alliance\").\n// All rights reserved.\n//\n// This software and its documentation and related materials are owned by\n// the Alliance. The software may only be incorporated into application\n// programs owned by members of the Alliance, subject to a signed\n// Membership Agreement and Supplemental Software License Agreement with the\n// Alliance. The structure and organization of this software are the valuable\n// trade secrets of the Alliance and its suppliers. The software is also\n// protected by copyright law and international treaty provisions. Application\n// programs incorporating this software must include the following statement\n// with their copyright notices:\n//\n// This application incorporates Open Design Alliance software pursuant to a\n// license agreement with Open Design Alliance.\n// Open Design Alliance Copyright (C) 2002-2024 by Open Design Alliance.\n// All rights reserved.\n//\n// By use of this software, its documentation or related materials, you\n// acknowledge and accept the above terms.\n///////////////////////////////////////////////////////////////////////////////\n\nimport { IHttpClient } from \"./IHttpClient\";\nimport { IShortUserDescription } from \"./IUser\";\nimport { waitFor, userFullName, userInitials } from \"./Utils\";\n\n/**\n * Provides properties and methods for obtaining information about a file/assembly clash detection test.\n */\nexport class ClashTest {\n private _data: any;\n public basePath: string;\n public httpClient: IHttpClient;\n\n /**\n * @param data - Raw test data received from the server.\n * @param basePath - The clash test API base path of the file/assembly that owns the test.\n * @param httpClient - HTTP client instance used to send REST API requests to the server.\n */\n constructor(data: any, basePath: string, httpClient: IHttpClient) {\n this.httpClient = httpClient;\n this.basePath = basePath;\n this.data = data;\n }\n\n protected internalGet(relativePath: string): Promise<Response> {\n return this.httpClient.get(`${this.basePath}/clashes/${this.id}${relativePath}`);\n }\n\n protected internalPut(relativePath: string, body?: BodyInit | object): Promise<Response> {\n return this.httpClient.put(`${this.basePath}/clashes/${this.id}${relativePath}`, body);\n }\n\n protected internalDelete(relativePath: string): Promise<Response> {\n return this.httpClient.delete(`${this.basePath}/clashes/${this.id}${relativePath}`);\n }\n\n /**\n * The type of the clashes that the test detects:\n *\n * - `true` - Сlearance clash. A clash in which the object A may or may not intersect with\n * object B, but comes within a distance of less than the {@link tolerance}.\n * - `false` - Hard clash. A clash in which the object A intersects with object B by a distance\n * of more than the {@link tolerance}.\n *\n * @readonly\n */\n get clearance(): boolean {\n return this.data.clearance;\n }\n\n /**\n * Test creation time (UTC) in the format specified in\n * {@link https://www.wikipedia.org/wiki/ISO_8601 | ISO 8601}.\n *\n * @readonly\n */\n get createdAt(): string {\n return this.data.createdAt;\n }\n\n /**\n * Raw test data received from the server.\n *\n * @readonly\n */\n get data(): any {\n return this._data;\n }\n\n private set data(value: any) {\n this._data = value;\n this._data.owner.avatarUrl = `${this.httpClient.serverUrl}/users/${this._data.owner.userId}/avatar`;\n this._data.owner.fullName = userFullName(this._data.owner);\n this._data.owner.initials = userInitials(this._data.owner.fullName);\n }\n\n /**\n * Unique test ID.\n *\n * @readonly\n */\n get id(): string {\n return this.data.id;\n }\n\n /**\n * Test last update (UTC) time in the format specified in\n * {@link https://www.wikipedia.org/wiki/ISO_8601 | ISO 8601}.\n *\n * @readonly\n */\n get lastModifiedAt(): string {\n return this.data.lastModifiedAt;\n }\n\n /**\n * Test name.\n */\n get name(): string {\n return this.data.name;\n }\n\n set name(value: string) {\n this.data.name = value;\n }\n\n /**\n * Test owner information.\n *\n * @property {string} userId - User ID.\n * @property {string} userName - User name.\n * @property {string} name - First name.\n * @property {string} lastName - Last name.\n * @property {string} fullName - Full name.\n * @property {string} initials - Initials.\n * @property {string} email - User email.\n * @property {string} avatarUrl - User avatar image URL.\n * @readonly\n */\n get owner(): IShortUserDescription {\n return this.data.owner;\n }\n\n /**\n * First selection set for clash detection. Objects from `selectionSetA` will be tested\n * against each others by objects from the `selectionSetB` during the test.\n *\n * @readonly\n */\n get selectionSetA(): string[] {\n return this.data.selectionSetA;\n }\n\n /**\n * The type of first selection set for clash detection. Can be one of:\n *\n * - `all` - All file/assembly objects.\n * - `handle` - Objects with original handles specified in the `selectionSetA`.\n * - `models` - All objects of the models with original handles specified in the `selectionSetA`.\n * - `searchquery` - Objects retrieved by the search queries specified in `selectionSetA`.\n *\n * @readonly\n */\n get selectionTypeA(): string {\n return this.data.selectionTypeA;\n }\n\n /**\n * Second selection set for clash detection. Objects from `selectionSetB` will be tested\n * against each others by objects from the `selectionSetA` during the test.\n *\n * @readonly\n */\n get selectionSetB(): string[] {\n return this.data.selectionSetB;\n }\n\n /**\n * The type of second selection set for clash detection. Can be one of:\n *\n * - `all` - All file/assembly objects.\n * - `handle` - Objects with original handles specified in the `selectionSetB`.\n * - `models` - All objects of the models with original handles specified in the `selectionSetB`.\n * - `searchquery` - Objects retrieved by the search queries specified in `selectionSetB`.\n *\n * @readonly\n */\n get selectionTypeB(): string {\n return this.data.selectionTypeB;\n }\n\n /**\n * Test status. Can be `none`, `waiting`, `inprogress`, `done` or `failed`.\n *\n * @readonly\n */\n get status(): string {\n return this.data.status;\n }\n\n /**\n * The distance of separation between objects at which test begins detecting clashes.\n *\n * @readonly\n */\n get tolerance(): number {\n return this.data.tolerance;\n }\n\n /**\n * Reloads test data from the server.\n */\n async checkout(): Promise<this> {\n const response = await this.internalGet(\"\");\n this.data = await response.json();\n return this;\n }\n\n /**\n * Updates test data on the server.\n *\n * @param data - Raw test data.\n */\n async update(data: any): Promise<this> {\n const response = await this.internalPut(\"\", data);\n this.data = await response.json();\n return this;\n }\n\n /**\n * Deletes a test and its results report from the server.\n *\n * @returns Returns the raw data of a deleted test.\n */\n delete(): Promise<any> {\n return this.internalDelete(\"\").then((response) => response.json());\n }\n\n /**\n * Saves test properties changes to the server. Call this method to update test data on the\n * server after any property changes.\n */\n save(): Promise<this> {\n return this.update(this.data);\n }\n\n /**\n * Waits for test to complete. Test is done when it changes to `done` or `failed` status.\n *\n * @param params - An object containing waiting parameters.\n * @param params.timeout - The time, in milliseconds that the function should wait test. If\n * test is not complete during this time, the `TimeoutError` exception will be thrown.\n * @param params.interval - The time, in milliseconds, the function should delay in between\n * checking test status.\n * @param params.signal - An\n * {@link https://developer.mozilla.org/docs/Web/API/AbortController | AbortController}\n * signal, which can be used to abort waiting as desired.\n * @param params.onCheckout - Waiting progress callback. Return `true` to cancel waiting.\n */\n waitForDone(params?: {\n timeout?: number;\n interval?: number;\n signal?: AbortSignal;\n onCheckout?: (test: ClashTest, ready: boolean) => boolean;\n }): Promise<this> {\n const checkDone = () =>\n this.checkout().then((test) => {\n const ready = [\"done\", \"failed\"].includes(test.status);\n const cancel = params?.onCheckout?.(test, ready);\n return cancel || ready;\n });\n return waitFor(checkDone, params).then(() => this);\n }\n\n /**\n * Returns a report with the clash detection results for this test.\n */\n getReport(): Promise<any> {\n return this.internalGet(\"/report\").then((response) => response.json());\n }\n}\n","///////////////////////////////////////////////////////////////////////////////\n// Copyright (C) 2002-2024, Open Design Alliance (the \"Alliance\").\n// All rights reserved.\n//\n// This software and its documentation and related materials are owned by\n// the Alliance. The software may only be incorporated into application\n// programs owned by members of the Alliance, subject to a signed\n// Membership Agreement and Supplemental Software License Agreement with the\n// Alliance. The structure and organization of this software are the valuable\n// trade secrets of the Alliance and its suppliers. The software is also\n// protected by copyright law and international treaty provisions. Application\n// programs incorporating this software must include the following statement\n// with their copyright notices:\n//\n// This application incorporates Open Design Alliance software pursuant to a\n// license agreement with Open Design Alliance.\n// Open Design Alliance Copyright (C) 2002-2024 by Open Design Alliance.\n// All rights reserved.\n//\n// By use of this software, its documentation or related materials, you\n// acknowledge and accept the above terms.\n///////////////////////////////////////////////////////////////////////////////\n\nimport { IHttpClient } from \"./IHttpClient\";\nimport { FetchError } from \"./FetchError\";\nimport { IAssociatedFileData, IAssemblyVersionInfo, IModelTransformMatrix } from \"./IAssembly\";\nimport { IShortUserDescription } from \"./IUser\";\nimport { Model } from \"./Model\";\nimport { ClashTest } from \"./ClashTest\";\nimport { waitFor, userFullName, userInitials } from \"./Utils\";\n\n/**\n * Provides properties and methods for obtaining information about an assembly on the server\n * and managing its data.\n */\nexport class Assembly {\n private _data: any;\n private _useVersion: number | undefined;\n public httpClient: IHttpClient;\n public path: string;\n\n /**\n * @param data - Raw assembly data received from the server.\n * @param httpClient - HTTP client instance used to send REST API requests to the server.\n */\n constructor(data: any, httpClient: IHttpClient) {\n this.path = `/assemblies/${data.id}`;\n this.httpClient = httpClient;\n this.data = data;\n }\n\n public appendVersionParam(relativePath: string): string {\n if (this._useVersion === undefined) return relativePath;\n const delimiter = relativePath.includes(\"?\") ? \"&\" : \"?\";\n return `${relativePath}${delimiter}version=${this._useVersion}`;\n }\n\n protected internalGet(relativePath: string, signal?: AbortSignal): Promise<Response> {\n relativePath = this.appendVersionParam(relativePath);\n return this.httpClient.get(`${this.path}${relativePath}`, signal);\n }\n\n protected internalPost(relativePath: string, body?: BodyInit | object): Promise<Response> {\n relativePath = this.appendVersionParam(relativePath);\n return this.httpClient.post(`${this.path}${relativePath}`, body);\n }\n\n protected internalPut(relativePath: string, body?: BodyInit | object): Promise<Response> {\n relativePath = this.appendVersionParam(relativePath);\n return this.httpClient.put(`${this.path}${relativePath}`, body);\n }\n\n protected internalDelete(relativePath: string): Promise<Response> {\n relativePath = this.appendVersionParam(relativePath);\n return this.httpClient.delete(`${this.path}${relativePath}`);\n }\n\n // Reserved for future use\n\n get activeVersion(): number {\n return this.data.activeVersion;\n }\n\n /**\n * List of unique files from which the assembly was created.\n *\n * @readonly\n */\n get associatedFiles(): IAssociatedFileData[] {\n return this.data.associatedFiles;\n }\n\n /**\n * Assembly creation time (UTC) in the format specified in\n * {@link https://www.wikipedia.org/wiki/ISO_8601 | ISO 8601}.\n *\n * @readonly\n */\n get created(): string {\n return this.data.created;\n }\n\n /**\n * Raw assembly data received from the server.\n *\n * @readonly\n */\n get data(): any {\n return this._data;\n }\n\n private set data(value: any) {\n this._data = value;\n this._data.owner.avatarUrl = `${this.httpClient.serverUrl}/users/${this._data.owner.userId}/avatar`;\n this._data.owner.fullName = userFullName(this._data.owner);\n this._data.owner.initials = userInitials(this._data.owner.fullName);\n // associatedFiles since 23.12\n this._data.associatedFiles ??= [];\n this._data.associatedFiles.forEach((file) => (file.link = `${this.httpClient.serverUrl}/files/${file.fileId}`));\n }\n\n /**\n * List of file IDs from which the assembly was created.\n *\n * @readonly\n */\n get files(): string[] {\n return this.data.files;\n }\n\n /**\n * Assembly geometry data type:\n *\n * - `vsfx` - `VSFX` format, assembly can be opened in `VisualizeJS` viewer.\n *\n * Returns an empty string if the geometry data is not yet ready.\n */\n get geometryType(): string {\n return this.status === \"done\" ? \"vsfx\" : \"\";\n }\n\n /**\n * Unique assembly ID.\n *\n * @readonly\n */\n get id(): string {\n return this.data.id;\n }\n\n /**\n * Assembly name.\n */\n get name(): string {\n return this.data.name;\n }\n\n set name(value: string) {\n this.data.name = value;\n }\n\n // Reserved for future use\n\n get originalAssemblyId(): string {\n return this.data.originalAssemblyId;\n }\n\n /**\n * Assembly owner information.\n *\n * @property {string} userId - User ID.\n * @property {string} userName - User name.\n * @property {string} name - First name.\n * @property {string} lastName - Last name.\n * @property {string} fullName - Full name.\n * @property {string} initials - Initials.\n * @property {string} email - User email.\n * @property {string} avatarUrl - User avatar image URL.\n * @readonly\n */\n get owner(): IShortUserDescription {\n return this.data.owner;\n }\n\n // Reserved for future use\n\n get previewUrl(): string {\n return this.data.previewUrl || \"\";\n }\n\n /**\n * List of assembly related job IDs.\n *\n * @readonly\n */\n get relatedJobs(): string[] {\n return this.data.relatedJobs;\n }\n\n /**\n * Assembly geometry data and properties status. Can be `waiting`, `inprogress`, `done` or `failed`.\n *\n * An assemblies without geometry data cannot be opened in viewer.\n *\n * @readonly\n */\n get status(): string {\n return this.data.status;\n }\n\n /**\n * Assembly type. Returns an `assembly` string.\n *\n * @readonly\n */\n get type(): string {\n return \"assembly\";\n }\n\n // Reserved for future use\n\n get version(): number {\n return this.data.version;\n }\n\n get versions(): IAssemblyVersionInfo[] {\n return this.data.versions;\n }\n\n /**\n * Reloads assembly data from the server.\n */\n async checkout(): Promise<this> {\n const response = await this.internalGet(\"\");\n this.data = await response.json();\n return this;\n }\n\n /**\n * Updates assembly data on the server.\n *\n * @param data - Raw assembly data.\n */\n async update(data: any): Promise<this> {\n const response = await this.internalPut(\"\", data);\n this.data = await response.json();\n return this;\n }\n\n /**\n * Deletes an assembly from the server.\n *\n * @returns Returns the raw data of a deleted assembly.\n */\n delete(): Promise<any> {\n return this.internalDelete(\"\").then((response) => response.json());\n }\n\n /**\n * Saves assembly properties changes to the server. Call this method to update assembly data\n * on the server after any property changes.\n */\n save(): Promise<this> {\n return this.update(this.data);\n }\n\n // Reserved for future use\n\n setPreview(image?: BodyInit | null): Promise<this> {\n console.warn(\"Assembly does not support preview\");\n return Promise.resolve(this);\n }\n\n deletePreview(): Promise<this> {\n console.warn(\"Assembly does not support preview\");\n return Promise.resolve(this);\n }\n\n /**\n * Returns list of assembly models.\n */\n getModels(): Promise<Model[]> {\n return this.internalGet(\"/geometry\")\n .then((response) => response.json())\n .then((array) => array.map((data: any) => new Model(data, this)));\n }\n\n /**\n * Returns a model transformation.\n *\n * @param handle - Model original handle.\n */\n getModelTransformMatrix(handle: string): IModelTransformMatrix {\n return this.data.transform[handle];\n }\n\n /**\n * Sets or removes a model transformation.\n *\n * @param handle - Model original handle.\n * @param transform - Transformation matrix. Specify `undefined` to remove transformation.\n */\n setModelTransformMatrix(handle: string, transform: IModelTransformMatrix): Promise<this> {\n const obj = { ...this.data.transform };\n obj[handle] = transform;\n return this.update({ transform: obj });\n }\n\n /**\n * Returns the properties for an objects in the assembly.\n *\n * @param handles - Object original handle or handles array. Specify `undefined` to get\n * properties for all objects in the assembly.\n * @returns {Promise<any>}\n */\n getProperties(handles?: string | string[]): Promise<any[]> {\n const relativePath = handles !== undefined ? `/properties?handles=${handles}` : \"/properties\";\n return this.internalGet(relativePath).then((response) => response.json());\n }\n\n /**\n * Returns the list of original handles for an objects in the file that match the specified\n * patterns. Search patterns may be combined using query operators.\n *\n * @example <caption>Simple search pattern.</caption>\n * searchPattern = {\n * key: \"Category\",\n * value: \"OST_Stairs\",\n * };\n *\n * @example <caption>Search patterns combination.</caption>\n * searchPattern = {\n * $or: [\n * {\n * $and: [\n * { key: \"Category\", value: \"OST_GenericModel\" },\n * { key: \"Level\", value: \"03 - Floor\" },\n * ],\n * },\n * { key: \"Category\", value: \"OST_Stairs\" },\n * ],\n * };\n *\n * @param searchPattern - Search pattern or combination of the patterns, see example below.\n */\n searchProperties(searchPattern: any): Promise<any[]> {\n return this.internalPost(\"/properties/search\", searchPattern).then((response) => response.json());\n }\n\n /**\n * Returns the CDA tree for an assembly.\n */\n getCdaTree(): Promise<any[]> {\n return this.internalGet(`/properties/tree`).then((response) => response.json());\n }\n\n /**\n * Returns a list of assembly viewpoints.\n */\n getViewpoints(): Promise<any[]> {\n return this.internalGet(\"/viewpoints\")\n .then((response) => response.json())\n .then((viewpoints) => viewpoints.result);\n }\n\n /**\n * Saves a new assembly viewpoint to the server. To create a viewpoint use `Viewer.createViewpoint()`.\n *\n * @param viewpoint - Viewpoint.\n */\n saveViewpoint(viewpoint: any): Promise<any> {\n return this.internalPost(\"/viewpoints\", viewpoint).then((response) => response.json());\n }\n\n /**\n * Deletes the specified assembly viewpoint.\n *\n * @param guid - Viewpoint GUID.\n * @returns Returns the raw data of a deleted viewpoint.\n */\n deleteViewpoint(guid: string): Promise<any> {\n return this.internalDelete(`/viewpoints/${guid}`).then((response) => response.json());\n }\n\n /**\n * Returns viewpoint snapshot as base64-encoded\n * {@link https://developer.mozilla.org/docs/Web/HTTP/Basics_of_HTTP/Data_URIs | Data URL}.\n *\n * @param guid - Viewpoint GUID.\n */\n getSnapshot(guid: string): Promise<string> {\n return this.internalGet(`/viewpoints/${guid}/snapshot`).then((response) => response.text());\n }\n\n /**\n * Returns viewpoint snapshot data.\n *\n * @param guid - Viewpoint GUID.\n * @param bitmapGuid - Bitmap GUID.\n */\n getSnapshotData(guid: any, bitmapGuid: any): Promise<string> {\n return this.internalGet(`/viewpoints/${guid}/bitmaps/${bitmapGuid}`).then((response) => response.text());\n }\n\n /**\n * Downloads an assembly resource file. Resource files are files that contain model scene\n * descriptions, or geometry data.\n *\n * @param dataId - Resource file name.\n * @param onProgress - Download progress callback.\n * @param signal - An\n * {@link https://developer.mozilla.org/docs/Web/API/AbortController | AbortController}\n * signal. Allows to communicate with a fetch request and abort it if desired.\n */\n downloadResource(\n dataId: string,\n onProgress?: (progress: number, chunk: Uint8Array) => void,\n signal?: AbortSignal\n ): Promise<ArrayBuffer> {\n const relativePath = this.appendVersionParam(`/downloads/${dataId}`);\n return this.httpClient\n .downloadFile(`${this.path}${relativePath}`, onProgress, signal)\n .then((response) => response.arrayBuffer());\n }\n\n /**\n * Downloads a part of assembly resource file. Resource files are files that contain model\n * scene descriptions, or geometry data.\n *\n * @param dataId - Resource file name.\n * @param ranges - A range of resource file contents to download.\n * @param requestId - Request ID for download progress callback.\n * @param onProgress - Download progress callback.\n * @param signal - An\n * {@link https://developer.mozilla.org/docs/Web/API/AbortController | AbortController}\n * signal. Allows to communicate with a fetch request and abort it if desired.\n */\n downloadResourceRange(\n dataId: string,\n requestId: number,\n ranges: Array<{ begin: number; end: number; requestId: number }>,\n onProgress?: (progress: number, chunk: Uint8Array, requestId: number) => void,\n signal?: AbortSignal\n ): Promise<ArrayBuffer> {\n const relativePath = this.appendVersionParam(`/downloads/${dataId}?requestId=${requestId}`);\n return this.httpClient\n .downloadFileRange(`${this.path}${relativePath}`, requestId, ranges, onProgress, signal)\n .then((response) => response.arrayBuffer());\n }\n\n /**\n * Deprecated since `25.3`. Use {@link downloadResource | downloadResource()} instead.\n *\n * @deprecated\n */\n partialDownloadResource(\n dataId: string,\n onProgress?: (progress: number, chunk: Uint8Array) => void,\n signal?: AbortSignal\n ): Promise<ArrayBuffer> {\n console.warn(\n \"Assembly.partialDownloadResource() has been deprecated since 25.3 and will be removed in a future release, use Assembly.downloadResource() instead.\"\n );\n return this.downloadResource(dataId, onProgress, signal);\n }\n\n /**\n * Deprecated since `25.3`. Use {@link downloadResourceRange | downloadResourceRange()} instead.\n */\n async downloadFileRange(\n requestId: number,\n records: any | null,\n dataId: string,\n onProgress?: (progress: number, chunk: Uint8Array, requestId: number) => void,\n signal?: AbortSignal\n ): Promise<void> {\n await this.downloadResourceRange(dataId, requestId, records, onProgress, signal);\n }\n\n // Reserved for future use\n\n getReferences(signal?: AbortSignal): Promise<any> {\n return Promise.resolve({ fileId: \"\", references: [] });\n }\n\n /**\n * Waits for assembly to be created. Assembly is created when it changes to `done` or `failed` status.\n *\n * @param params - An object containing waiting parameters.\n * @param params.timeout - The time, in milliseconds that the function should wait assembly.\n * If assembly is not created during this time, the `TimeoutError` exception will be thrown.\n * @param params.interval - The time, in milliseconds, the function should delay in between\n * checking assembly status.\n * @param params.signal - An\n * {@link https://developer.mozilla.org/docs/Web/API/AbortController | AbortController}\n * signal, which can be used to abort waiting as desired.\n * @param params.onCheckout - Waiting progress callback. Return `true` to cancel waiting.\n */\n waitForDone(params?: {\n timeout?: number;\n interval?: number;\n signal?: AbortSignal;\n onCheckout?: (assembly: Assembly, ready: boolean) => boolean;\n }): Promise<this> {\n const checkDone = () =>\n this.checkout().then((assembly) => {\n const ready = [\"done\", \"failed\"].includes(assembly.status);\n const cancel = params?.onCheckout?.(assembly, ready);\n return cancel || ready;\n });\n\n return waitFor(checkDone, params).then(() => this);\n }\n\n /**\n * Returns a list of assembly clash tests.\n *\n * @param start - The starting index in the test list. Used for paging.\n * @param limit - The maximum number of tests that should be returned per request. Used for paging.\n * @param name - Filter the tests by part of the name. Case sensitive.\n * @param ids - List of tests IDs to return.\n * @param sortByDesc - Allows to specify the descending order of the result. By default tests\n * are sorted by name in ascending order.\n * @param sortField - Allows to specify sort field.\n */\n getClashTests(\n start?: number,\n limit?: number,\n name?: string,\n ids?: string | string[],\n sortByDesc?: boolean,\n sortField?: string\n ): Promise<{ allSize: number; start: number; limit: number; result: ClashTest[]; size: number }> {\n const searchParams = new URLSearchParams();\n if (start > 0) searchParams.set(\"start\", start.toString());\n if (limit > 0) searchParams.set(\"limit\", limit.toString());\n if (name) searchParams.set(\"name\", name);\n if (ids) {\n if (Array.isArray(ids)) ids = ids.join(\"|\");\n if (typeof ids === \"string\") ids = ids.trim();\n if (ids) searchParams.set(\"id\", ids);\n }\n if (sortByDesc !== undefined) searchParams.set(\"sortBy\", sortByDesc ? \"desc\" : \"asc\");\n if (sortField) searchParams.set(\"sortField\", sortField);\n\n let queryString = searchParams.toString();\n if (queryString) queryString = \"?\" + queryString;\n\n return this.internalGet(`/clashes${queryString}`)\n .then((response) => response.json())\n .then((tests) => {\n return {\n ...tests,\n result: tests.result.map((data) => new ClashTest(data, this.path, this.httpClient)),\n };\n });\n }\n\n /**\n * Returns information about the specified assembly clash test.\n *\n * @param testId - Test ID.\n */\n getClashTest(testId: string): Promise<ClashTest> {\n return this.internalGet(`/clashes/${testId}`)\n .then((response) => response.json())\n .then((data) => new ClashTest(data, this.path, this.httpClient));\n }\n\n /**\n * Creates an assembly clash test. Assembly must be in a `done` state, otherwise the test will fail.\n *\n * @param name - Test name.\n * @param selectionTypeA - The type of first selection set for clash detection. Can be one of:\n *\n * - `all` - All file/assembly objects.\n * - `handle` - Objects with original handles specified in the `selectionSetA`.\n * - `models` - All objects of the models with original handles specified in the `selectionSetA`.\n * - `searchquery` - Objects retrieved by the search queries specified in `selectionSetA`.\n *\n * @param selectionTypeB - The type of second selection set for clash detection. Can be one of:\n *\n * - `all` - All file/assembly objects.\n * - `handle` - Objects with original handles specified in the `selectionSetB`.\n * - `models` - All objects of the models with original handles specified in the `selectionSetB`.\n * - `searchquery` - Objects retrieved by the search queries specified in `selectionSetB`.\n *\n * @param selectionSetA - First selection set for clash detection. Objects from\n * `selectionSetA` will be tested against each others by objects from the `selectionSetB`\n * during the test.\n * @param selectionSetB - Second selection set for clash detection. Objects from\n * `selectionSetB` will be tested against each others by objects from the `selectionSetA`\n * during the test.\n * @param params - An object containing test parameters.\n * @param params.tolerance - The distance of separation between objects at which test begins\n * detecting clashes.\n * @param params.clearance - The type of the clashes that the test detects:\n *\n * - `true` - Сlearance clash. A clash in which the object A may or may not intersect with\n * object B, but comes within a distance of less than the `tolerance`.\n * - `false` - Hard clash. A clash in which the object A intersects with object B by a distance\n * of more than the `tolerance`.\n *\n * @param params.waitForDone - Wait for test to complete.\n * @param params.timeout - The time, in milliseconds that the function should wait test. If\n * test is not complete during this time, the `TimeoutError` exception will be thrown.\n * @param params.interval - The time, in milliseconds, the function should delay in between\n * checking test status.\n * @param params.signal - An\n * {@link https://developer.mozilla.org/docs/Web/API/AbortController | AbortController}\n * signal, which can be used to abort waiting as desired.\n */\n createClashTest(\n name: string,\n selectionTypeA: string,\n selectionTypeB: string,\n selectionSetA?: string | string[],\n selectionSetB?: string | string[],\n params?: {\n tolerance?: number | string;\n clearance?: boolean;\n waitForDone?: boolean;\n timeout?: number;\n interval?: number;\n signal?: AbortSignal;\n }\n ): Promise<ClashTest> {\n const { tolerance, clearance, waitForDone } = params ?? {};\n if (!Array.isArray(selectionSetA)) selectionSetA = [selectionSetA];\n if (!Array.isArray(selectionSetB)) selectionSetB = [selectionSetB];\n\n return this.internalPost(\"/clashes\", {\n name,\n selectionTypeA,\n selectionTypeB,\n selectionSetA,\n selectionSetB,\n tolerance,\n clearance,\n })\n .then((response) => response.json())\n .then((data) => new ClashTest(data, this.path, this.httpClient))\n .then((result) => (waitForDone ? result.waitForDone(params) : result));\n }\n\n /**\n * Deletes the specified assembly clash test.\n *\n * @param testId - Test ID.\n * @returns Returns the raw data of a deleted test.\n */\n deleteClashTest(testId: string): Promise<any> {\n return this.internalDelete(`/clashes/${testId}`).then((response) => response.json());\n }\n\n // Reserved for future use\n\n updateVersion(\n files?: string[],\n params: {\n waitForDone?: boolean;\n timeout?: number;\n interval?: number;\n signal?: AbortSignal;\n onProgress?: (progress: number, file: globalThis.File) => void;\n } = {\n waitForDone: false,\n }\n ): Promise<Assembly> {\n return Promise.reject(new Error(\"Assembly version support will be implemeted in a future release\"));\n }\n\n getVersions(): Promise<Assembly[] | undefined> {\n return Promise.resolve(undefined);\n }\n\n getVersion(version: number): Promise<Assembly> {\n return Promise.reject(new FetchError(404));\n }\n\n deleteVersion(version: number): Promise<any> {\n return Promise.reject(new FetchError(404));\n }\n\n setActiveVersion(version: number): Promise<this> {\n return this.update({ activeVersion: version });\n }\n\n useVersion(version?: number): this {\n this._useVersion = undefined;\n return this;\n }\n}\n","class EventEmitter2 {\n constructor() {\n this._listeners = {};\n }\n addEventListener(type, listener) {\n if (this._listeners[type] === undefined) this._listeners[type] = [];\n this._listeners[type].push(listener);\n return this;\n }\n removeEventListener(type, listener) {\n if (this._listeners[type] === undefined) return this;\n const listeners = this._listeners[type].filter((x => x !== listener));\n if (listeners.length !== 0) this._listeners[type] = listeners; else delete this._listeners[type];\n return this;\n }\n removeAllListeners(type) {\n if (type) delete this._listeners[type]; else this._listeners = {};\n return this;\n }\n emitEvent(event) {\n if (this._listeners[event.type] === undefined) return false;\n const invoke = this._listeners[event.type].slice();\n invoke.forEach((listener => listener.call(this, event)));\n return true;\n }\n on(type, listener) {\n return this.addEventListener(type, listener);\n }\n off(type, listener) {\n return this.removeEventListener(type, listener);\n }\n emit(type, ...args) {\n if (typeof type === \"string\") return this.emitEvent({\n type: type,\n args: args\n }); else if (typeof type === \"object\") return this.emitEvent(type); else return false;\n }\n}\n\nexport { EventEmitter2 };\n//# sourceMappingURL=eventemitter2.module.js.map\n","///////////////////////////////////////////////////////////////////////////////\n// Copyright (C) 2002-2024, Open Design Alliance (the \"Alliance\").\n// All rights reserved.\n//\n// This software and its documentation and related materials are owned by\n// the Alliance. The software may only be incorporated into application\n// programs owned by members of the Alliance, subject to a signed\n// Membership Agreement and Supplemental Software License Agreement with the\n// Alliance. The structure and organization of this software are the valuable\n// trade secrets of the Alliance and its suppliers. The software is also\n// protected by copyright law and international treaty provisions. Application\n// programs incorporating this software must include the following statement\n// with their copyright notices:\n//\n// This application incorporates Open Design Alliance software pursuant to a\n// license agreement with Open Design Alliance.\n// Open Design Alliance Copyright (C) 2002-2024 by Open Design Alliance.\n// All rights reserved.\n//\n// By use of this software, its documentation or related materials, you\n// acknowledge and accept the above terms.\n///////////////////////////////////////////////////////////////////////////////\n\nimport { FetchError, error400 } from \"./FetchError\";\n\nfunction handleFetchError(response: Response): Promise<Response> {\n if (!response.ok) {\n switch (response.status) {\n case 400: {\n return response.text().then((text) => {\n console.error(text);\n return Promise.reject(new FetchError(400, error400(text)));\n });\n }\n case 500: {\n return response.text().then((text) => {\n console.error(error400(text, text));\n return Promise.reject(new FetchError(500));\n });\n }\n default:\n return Promise.reject(new FetchError(response.status));\n }\n }\n return Promise.resolve(response);\n}\n\nexport function $fetch(\n url: string,\n params: {\n method: \"GET\" | \"POST\" | \"PUT\" | \"DELETE\";\n headers?: HeadersInit;\n body?: BodyInit | object;\n signal?: AbortSignal;\n } = { method: \"GET\" }\n): Promise<Response> {\n const headers = { ...params.headers };\n delete headers[\"Content-Type\"];\n\n let body: FormData | string | undefined = undefined;\n if (params.method === \"POST\" || params.method === \"PUT\") {\n if (params.body instanceof FormData) {\n body = params.body;\n } else if (params.body instanceof Blob) {\n body = new FormData();\n body.append(\"file\", params.body);\n } else if (params.body instanceof ArrayBuffer) {\n body = new FormData();\n body.append(\"file\", new Blob([params.body]));\n } else if (typeof params.body === \"object\") {\n body = JSON.stringify(params.body);\n headers[\"Content-Type\"] = \"application/json\";\n } else if (typeof params.body === \"string\") {\n body = params.body;\n headers[\"Content-Type\"] = \"text/plain\";\n }\n }\n\n const init: RequestInit = { method: params.method, headers };\n if (body) init.body = body;\n if (params.signal) init.signal = params.signal;\n\n return fetch(url, init).then(handleFetchError);\n}\n","///////////////////////////////////////////////////////////////////////////////\n// Copyright (C) 2002-2024, Open Design Alliance (the \"Alliance\").\n// All rights reserved.\n//\n// This software and its documentation and related materials are owned by\n// the Alliance. The software may only be incorporated into application\n// programs owned by members of the Alliance, subject to a signed\n// Membership Agreement and Supplemental Software License Agreement with the\n// Alliance. The structure and organization of this software are the valuable\n// trade secrets of the Alliance and its suppliers. The software is also\n// protected by copyright law and international treaty provisions. Application\n// programs incorporating this software must include the following statement\n// with their copyright notices:\n//\n// This application incorporates Open Design Alliance software pursuant to a\n// license agreement with Open Design Alliance.\n// Open Design Alliance Copyright (C) 2002-2024 by Open Design Alliance.\n// All rights reserved.\n//\n// By use of this software, its documentation or related materials, you\n// acknowledge and accept the above terms.\n///////////////////////////////////////////////////////////////////////////////\n\nimport { FetchError, error400 } from \"./FetchError\";\n\nfunction handleXMLHttpError(xhr: XMLHttpRequest): Promise<XMLHttpRequest> {\n if (xhr.status === 0) {\n return Promise.reject(new FetchError(0, \"Network error\"));\n }\n if (xhr.status < 200 || xhr.status > 299) {\n switch (xhr.status) {\n case 400: {\n console.error(xhr.responseText);\n return Promise.reject(new FetchError(400, error400(xhr.responseText)));\n }\n case 500: {\n console.error(error400(xhr.responseText, xhr.responseText));\n return Promise.reject(new FetchError(500));\n }\n default: {\n return Promise.reject(new FetchError(xhr.status));\n }\n }\n }\n return Promise.resolve(xhr);\n}\n\nexport function $xmlhttp(\n url: string,\n params: {\n method: \"GET\" | \"POST\" | \"PUT\" | \"DELETE\";\n headers?: HeadersInit;\n body?: XMLHttpRequestBodyInit;\n uploadProgress?: (progress: number) => void;\n downloadProgress?: (progress: number) => void;\n } = { method: \"GET\" }\n): Promise<XMLHttpRequest> {\n return new Promise((resolve, reject) => {\n const xhr = new XMLHttpRequest();\n xhr.open(params.method, url, true);\n for (const key in params.headers) {\n xhr.setRequestHeader(key, params.headers[key]);\n }\n function calcProgress(event: ProgressEvent): number {\n return event.lengthComputable ? event.loaded / event.total : 1;\n }\n xhr.upload.onprogress = (event) => params.uploadProgress && params.uploadProgress(calcProgress(event));\n xhr.onprogress = (event) => params.downloadProgress && params.downloadProgress(calcProgress(event));\n xhr.onloadend = (event) => handleXMLHttpError(event.target as XMLHttpRequest).then(resolve, reject);\n xhr.send(params.body);\n });\n}\n","///////////////////////////////////////////////////////////////////////////////\n// Copyright (C) 2002-2024, Open Design Alliance (the \"Alliance\").\n// All rights reserved.\n//\n// This software and its documentation and related materials are owned by\n// the Alliance. The software may only be incorporated into application\n// programs owned by members of the Alliance, subject to a signed\n// Membership Agreement and Supplemental Software License Agreement with the\n// Alliance. The structure and organization of this software are the valuable\n// trade secrets of the Alliance and its suppliers. The software is also\n// protected by copyright law and international treaty provisions. Application\n// programs incorporating this software must include the following statement\n// with their copyright notices:\n//\n// This application incorporates Open Design Alliance software pursuant to a\n// license agreement with Open Design Alliance.\n// Open Design Alliance Copyright (C) 2002-2024 by Open Design Alliance.\n// All rights reserved.\n//\n// By use of this software, its documentation or related materials, you\n// acknowledge and accept the above terms.\n///////////////////////////////////////////////////////////////////////////////\n\nimport { IHttpClient } from \"./IHttpClient\";\nimport { $fetch } from \"./Fetch\";\nimport { $xmlhttp } from \"./XMLHttp\";\n\nexport class HttpClient implements IHttpClient {\n public serverUrl: string;\n public headers: HeadersInit = {};\n public signInUserId = \"\";\n public signInUserIsAdmin = false;\n\n constructor(serverUrl: string) {\n this.serverUrl = serverUrl;\n }\n\n get(relativePath: string, signal?: AbortSignal): Promise<Response> {\n return $fetch(`${this.serverUrl}${relativePath}`, { method: \"GET\", headers: this.headers, signal });\n }\n\n post(relativePath: string, body?: BodyInit | object): Promise<Response> {\n return $fetch(`${this.serverUrl}${relativePath}`, { method: \"POST\", headers: this.headers, body });\n }\n\n put(relativePath: string, body?: BodyInit | object): Promise<Response> {\n return $fetch(`${this.serverUrl}${relativePath}`, { method: \"PUT\", headers: this.headers, body });\n }\n\n delete(relativePath: string): Promise<Response> {\n return $fetch(`${this.serverUrl}${relativePath}`, { method: \"DELETE\", headers: this.headers });\n }\n\n uploadFile(relativePath: string, file: File, onProgress?: (progress: number) => void): Promise<XMLHttpRequest> {\n const data = new FormData();\n data.append(\"file\", file);\n return $xmlhttp(`${this.serverUrl}${relativePath}`, {\n method: \"POST\",\n headers: this.headers,\n body: data,\n uploadProgress: onProgress,\n });\n }\n\n // async downloadFile(\n // relativePath: string,\n // onProgress?: (progress: number, chunk: Uint8Array) => void,\n // signal?: AbortSignal\n // ): Promise<Response> {\n // const response = await this.get(relativePath, signal);\n // const teedOff = response.body.tee();\n // if (onProgress) {\n // const contentLength = response.headers.get(\"Content-Length\");\n // const total = parseInt(contentLength, 10) || 1;\n // let loaded = 0;\n // const reader = teedOff[0].getReader();\n // reader.read().then(function processChunk({ done, value }) {\n // if (done) return;\n // loaded += value.length;\n // onProgress(loaded / total, value);\n // reader.read().then(processChunk);\n // });\n // }\n // return new Response(teedOff[1]);\n // }\n\n async downloadFile(\n relativePath: string,\n onProgress?: (progress: number, chunk: Uint8Array) => void,\n signal?: AbortSignal\n ): Promise<Response> {\n const response = await this.get(relativePath, signal);\n const contentLength = response.headers.get(\"Content-Length\");\n const total = parseInt(contentLength || \"\", 10) || 1;\n return new Response(\n new ReadableStream({\n async start(controller) {\n const reader = response.body.getReader();\n let loaded = 0;\n while (true) {\n const { done, value } = await reader.read();\n if (done) break;\n controller.enqueue(value);\n loaded += value.length;\n if (onProgress) onProgress(loaded / total, value);\n }\n controller.close();\n },\n })\n );\n }\n\n async downloadFileRange(\n relativePath: string,\n requestId: number,\n ranges: Array<{ begin: number; end: number; requestId: number }>,\n onProgress?: (progress: number, chunk: Uint8Array, requestId: number) => void,\n signal?: AbortSignal\n ): Promise<Response> {\n const headers = { ...this.headers };\n headers[\"Range\"] = \"bytes=\" + ranges.map((x) => `${x.begin}-${x.end}`).join(\",\");\n const response = await $fetch(`${this.serverUrl}${relativePath}`, { method: \"GET\", headers, signal });\n const contentLength = response.headers.get(\"content-length\");\n const total = parseInt(contentLength || \"\", 10) || 1;\n return new Response(\n new ReadableStream({\n async start(controller) {\n const reader = response.body.getReader();\n let loaded = 0;\n let rangedIndex = 0;\n let rangePos = 0;\n while (true) {\n const { done, value } = await reader.read();\n if (done) break;\n controller.enqueue(value);\n loaded += value.length;\n let chunkLeft = value.length;\n let chunkPos = 0;\n while (chunkLeft > 0) {\n const range = ranges[rangedIndex];\n const rangeLeft = range.end - range.begin - rangePos;\n if (chunkLeft < rangeLeft) {\n const chunk = value.subarray(chunkPos, chunkPos + chunkLeft);\n if (onProgress) onProgress(loaded / total, chunk, range.requestId);\n rangePos += chunkLeft;\n chunkLeft = 0;\n } else {\n const chunk = value.subarray(chunkPos, chunkPos + rangeLeft);\n if (onProgress) onProgress(loaded / total, chunk, range.requestId);\n chunkPos += rangeLeft;\n chunkLeft -= rangeLeft;\n rangedIndex++;\n rangePos = 0;\n }\n }\n }\n controller.close();\n },\n })\n );\n }\n}\n","///////////////////////////////////////////////////////////////////////////////\n// Copyright (C) 2002-2024, Open Design Alliance (the \"Alliance\").\n// All rights reserved.\n//\n// This software and its documentation and related materials are owned by\n// the Alliance. The software may only be incorporated into application\n// programs owned by members of the Alliance, subject to a signed\n// Membership Agreement and Supplemental Software License Agreement with the\n// Alliance. The structure and organization of this software are the valuable\n// trade secrets of the Alliance and its suppliers. The software is also\n// protected by copyright law and international treaty provisions. Application\n// programs incorporating this software must include the following statement\n// with their copyright notices:\n//\n// This application incorporates Open Design Alliance software pursuant to a\n// license agreement with Open Design Alliance.\n// Open Design Alliance Copyright (C) 2002-2024 by Open Design Alliance.\n// All rights reserved.\n//\n// By use of this software, its documentation or related materials, you\n// acknowledge and accept the above terms.\n///////////////////////////////////////////////////////////////////////////////\n\nimport { IHttpClient } from \"./IHttpClient\";\n\n/**\n * Provides properties and methods for obtaining information about {@link File | file} actions\n * granted to a specific {@link User | users}, or project {@link Member | member}.\n */\nexport class Permission {\n private _data: any;\n public fileId: string;\n public httpClient: IHttpClient;\n\n /**\n * @param data - Raw permission data received from the server.\n * @param fileId - Owner file ID.\n * @param httpClient - HTTP client instance used to send REST API requests to the server.\n */\n constructor(data: any, fileId: string, httpClient: IHttpClient) {\n this.httpClient = httpClient;\n this.fileId = fileId;\n this.data = data;\n }\n\n private internalGet(): Promise<Response> {\n return this.httpClient.get(`/files/${this.fileId}/permissions/${this.id}`);\n }\n\n private internalPut(body?: BodyInit | object): Promise<Response> {\n return this.httpClient.put(`/files/${this.fileId}/permissions/${this.id}`, body);\n }\n\n private internalDelete(): Promise<Response> {\n return this.httpClient.delete(`/files/${this.fileId}/permissions/${this.id}`);\n }\n\n /**\n * Defines what actions are allowed to be performed on a file with this permission:\n *\n * - `read` - The ability to read file description, geometry data and properties.\n * - `readSourceFile` - The ability to read source file.\n * - `write` - The ability to modify file name, description and references.\n * - `readViewpoint` - The ability to read file viewpoints.\n * - `createViewpoint` - The ability to create file viewpoints.\n */\n get actions(): string[] {\n return this.data.actions;\n }\n\n set actions(value: string[]) {\n this._data.actions = value;\n }\n\n /**\n * Raw permission data received from the server.\n *\n * @readonly\n */\n get data(): any {\n return this._data;\n }\n\n private set data(value: any) {\n this._data = value;\n }\n\n /**\n * Unique permission ID.\n *\n * @readonly\n */\n get id(): string {\n return this.data.id;\n }\n\n /**\n * Principials are any entity that can be authenticated by the server, such as a any user or\n * project that will get access to the file.\n *\n * @typedef {any} Principial\n * @property {any} user - The user entry that get access to the file.\n * @property {string} user.id - User ID.\n * @property {string} user.name - User name.\n * @property {any} project - The project entry that get access to the file.\n * @property {string} project.id - Project ID.\n * @property {string} project.name - Project name.\n */\n\n /**\n * A list of principials that will get access to the file.\n */\n get grantedTo(): any[] {\n return this.data.grantedTo;\n }\n\n set grantedTo(value: any[]) {\n this.data.grantedTo = value;\n }\n\n /**\n * Specifies whether all users have access to the file or not.\n */\n get public(): boolean {\n return this.data.public;\n }\n\n set public(value: boolean) {\n this.data.public = value;\n }\n\n /**\n * Reloads permission data from the server.\n */\n async checkout(): Promise<this> {\n const response = await this.internalGet();\n this.data = await response.json();\n return this;\n }\n\n /**\n * Updates permission data on the server.\n *\n * @param data - Raw permission data.\n */\n async update(data: any): Promise<this> {\n const response = await this.internalPut(data);\n this.data = await response.json();\n return this;\n }\n\n /**\n * Removes a permission from the file.\n *\n * @returns Returns the raw data of a deleted permission.\n */\n delete(): Promise<any> {\n return this.internalDelete().then((response) => response.json());\n }\n\n /**\n * Saves permission properties changes to the server. Call this method to update permission\n * data on the server after any property changes.\n */\n save(): Promise<this> {\n return this.update(this.data);\n }\n}\n","///////////////////////////////////////////////////////////////////////////////\n// Copyright (C) 2002-2024, Open Design Alliance (the \"Alliance\").\n// All rights reserved.\n//\n// This software and its documentation and related materials are owned by\n// the Alliance. The software may only be incorporated into application\n// programs owned by members of the Alliance, subject to a signed\n// Membership Agreement and Supplemental Software License Agreement with the\n// Alliance. The structure and organization of this software are the valuable\n// trade secrets of the Alliance and its suppliers. The software is also\n// protected by copyright law and international treaty provisions. Application\n// programs incorporating this software must include the following statement\n// with their copyright notices:\n//\n// This application incorporates Open Design Alliance software pursuant to a\n// license agreement with Open Design Alliance.\n// Open Design Alliance Copyright (C) 2002-2024 by Open Design Alliance.\n// All rights reserved.\n//\n// By use of this software, its documentation or related materials, you\n// acknowledge and accept the above terms.\n///////////////////////////////////////////////////////////////////////////////\n\nimport { IHttpClient } from \"./IHttpClient\";\nimport { waitFor } from \"./Utils\";\n\n/**\n * Provides properties and methods for obtaining information about a job on the server.\n */\nexport class Job {\n private _data: any;\n public httpClient: IHttpClient;\n\n /**\n * @param data - Raw job data received from the server.\n * @param httpClient - HTTP client instance used to send REST API requests to the server.\n */\n constructor(data: any, httpClient: IHttpClient) {\n this.httpClient = httpClient;\n this.data = data;\n }\n\n protected internalGet(): Promise<Response> {\n return this.httpClient.get(`/jobs/${this.data.id}`);\n }\n\n protected internalPut(body?: BodyInit | object): Promise<Response> {\n return this.httpClient.put(`/jobs/${this.data.id}`, body);\n }\n\n protected internalDelete(): Promise<Response> {\n return this.httpClient.delete(`/jobs/${this.data.id}`);\n }\n\n /**\n * The ID of the assembly the job is working on (internal).\n *\n * @readonly\n */\n get assemblyId(): string {\n return this.data.assemblyId;\n }\n\n /**\n * Job creator ID. Use {@link Client.getUser | Client.getUser()} to obtain detailed creator information.\n *\n * @readonly\n */\n get authorId(): string {\n return this.data.authorId;\n }\n\n /**\n * Job creation time (UTC) in the format specified in\n * {@link https://www.wikipedia.org/wiki/ISO_8601 | ISO 8601}.\n *\n * @readonly\n */\n get createdAt(): string {\n return this.data.createdAt;\n }\n\n /**\n * Raw job data received from the server.\n *\n * @readonly\n */\n get data(): any {\n return this._data;\n }\n\n private set data(value: any) {\n this._data = value;\n }\n\n /**\n * `true` if job is `done` or `failed`. See {@link status} for more details.\n *\n * @readonly\n */\n get done(): boolean {\n return this.data.status === \"done\" || this.data.status === \"failed\";\n }\n\n /**\n * The ID of the file the job is working on.\n *\n * @readonly\n */\n get fileId(): string {\n return this.data.fileId;\n }\n\n /**\n * Unique job ID.\n *\n * @readonly\n */\n get id(): string {\n return this.data.id;\n }\n\n /**\n * Job last update (UTC) time in the format specified in\n * {@link https://www.wikipedia.org/wiki/ISO_8601 | ISO 8601}.\n *\n * @readonly\n */\n get lastUpdate(): string {\n return this.data.lastUpdate;\n }\n\n /**\n * Job type. Can be `properties`, `geomerty`, `geomertyGltf`, `validation`, `clash`, `dwg`,\n * `obj`, `gltf`, `glb`, `vsf`, `pdf`, `3dpdf` or custom job name.\n *\n * @readonly\n */\n get outputFormat(): string {\n return this.data.outputFormat;\n }\n\n /**\n * Parameters for the job runner.\n *\n * @readonly\n */\n get parameters(): any {\n return this.data.parameters;\n }\n\n /**\n * Job status. Can be `waiting`, `inprogress`, `done` or `failed`.\n *\n * @readonly\n */\n get status(): string {\n return this.data.status;\n }\n\n /**\n * Job status description message.\n *\n * @readonly\n */\n get statusMessage(): string {\n return this.data.statusMessage;\n }\n\n /**\n * Job starting time (UTC) in the format specified in\n * {@link https://www.wikipedia.org/wiki/ISO_8601 | ISO 8601}.\n *\n * @readonly\n */\n get startedAt(): string {\n return this.data.startedAt;\n }\n\n /**\n * Reloads job data from the server.\n */\n async checkout(): Promise<this> {\n const response = await this.internalGet();\n this.data = await response.json();\n return this;\n }\n\n /**\n * Updates job data on the server.\n *\n * Only administrators can update job data. If the current logged in user is not an\n * administrator, an exception will be thrown.\n *\n * @param data - Raw job data.\n */\n async update(data: any): Promise<this> {\n const response = await this.internalPut(data);\n this.data = await response.json();\n return this;\n }\n\n /**\n * Deletes a job from the server job list. Jobs that are in progress or have already been\n * completed cannot be deleted.\n *\n * @returns Returns the raw data of a deleted job.\n */\n delete(): Promise<any> {\n return this.internalDelete().then((response) => response.json());\n }\n\n // /**\n // * Save job properties changes to the server. Call this method to update job data on the server\n // * after any property changes.\n // */\n // save() {\n // return this.update(this.data);\n // }\n\n /**\n * Waits for job to be done. Job is done when it changes to `done` or `failed` status.\n *\n * @param params - An object containing waiting parameters.\n * @param params.timeout - The time, in milliseconds that the function should wait job. If\n * jobs is not done during this time, the `TimeoutError` exception will be thrown.\n * @param params.interval - The time, in milliseconds, the function should delay in between\n * checking job status.\n * @param params.signal - An\n * {@link https://developer.mozilla.org/docs/Web/API/AbortController | AbortController}\n * signal, which can be used to abort waiting as desired.\n * @param params.onCheckout - Waiting progress callback. Return `true` to cancel waiting.\n */\n waitForDone(params?: {\n timeout?: number;\n interval?: number;\n signal?: AbortSignal;\n onCheckout?: (job: Job, ready: boolean) => boolean;\n }): Promise<this> {\n const checkDone = () =>\n this.checkout().then((job) => {\n const ready = [\"done\", \"failed\"].includes(job.status);\n const cancel = params?.onCheckout?.(job, ready);\n return cancel || ready;\n });\n\n return waitFor(checkDone, params).then(() => this);\n }\n}\n","///////////////////////////////////////////////////////////////////////////////\n// Copyright (C) 2002-2024, Open Design Alliance (the \"Alliance\").\n// All rights reserved.\n//\n// This software and its documentation and related materials are owned by\n// the Alliance. The software may only be incorporated into application\n// programs owned by members of the Alliance, subject to a signed\n// Membership Agreement and Supplemental Software License Agreement with the\n// Alliance. The structure and organization of this software are the valuable\n// trade secrets of the Alliance and its suppliers. The software is also\n// protected by copyright law and international treaty provisions. Application\n// programs incorporating this software must include the following statement\n// with their copyright notices:\n//\n// This application incorporates Open Design Alliance software pursuant to a\n// license agreement with Open Design Alliance.\n// Open Design Alliance Copyright (C) 2002-2024 by Open Design Alliance.\n// All rights reserved.\n//\n// By use of this software, its documentation or related materials, you\n// acknowledge and accept the above terms.\n///////////////////////////////////////////////////////////////////////////////\n\nimport { IHttpClient } from \"./IHttpClient\";\nimport { IFileStatus, IFileReferences, IFileVersionInfo } from \"./IFile\";\nimport { IShortUserDescription } from \"./IUser\";\nimport { Model } from \"./Model\";\nimport { Permission } from \"./Permission\";\nimport { Job } from \"./Job\";\nimport { waitFor, parseArgs, userFullName, userInitials } from \"./Utils\";\n\n/**\n * Provides properties and methods for obtaining information about a file on the server and\n * managing its data and versions.\n */\nexport class File {\n private _data: any;\n private _useVersion: number | undefined;\n public httpClient: IHttpClient;\n public path: string;\n\n /**\n * @param data - Raw file data received from the server.\n * @param httpClient - HTTP client instance used to send REST API requests to the server.\n */\n constructor(data: any, httpClient: IHttpClient) {\n this.path = `/files/${data.id}`;\n this.httpClient = httpClient;\n this.data = data;\n }\n\n private appendVersionParam(relativePath: string): string {\n if (this._useVersion === undefined) return relativePath;\n const delimiter = relativePath.includes(\"?\") ? \"&\" : \"?\";\n return `${relativePath}${delimiter}version=${this._useVersion}`;\n }\n\n private internalGet(relativePath: string, signal?: AbortSignal): Promise<Response> {\n relativePath = this.appendVersionParam(relativePath);\n return this.httpClient.get(`${this.path}${relativePath}`, signal);\n }\n\n private internalPost(relativePath: string, body?: BodyInit | object): Promise<Response> {\n relativePath = this.appendVersionParam(relativePath);\n return this.httpClient.post(`${this.path}${relativePath}`, body);\n }\n\n private internalPut(relativePath: string, body?: BodyInit | object): Promise<Response> {\n relativePath = this.appendVersionParam(relativePath);\n return this.httpClient.put(`${this.path}${relativePath}`, body);\n }\n\n private internalDelete(relativePath: string): Promise<Response> {\n relativePath = this.appendVersionParam(relativePath);\n return this.httpClient.delete(`${this.path}${relativePath}`);\n }\n\n /**\n * Active version number of the file.\n *\n * @readonly\n */\n get activeVersion(): number {\n return this.data.activeVersion;\n }\n\n /**\n * File creation time (UTC) in the format specified in\n * {@link https://www.wikipedia.org/wiki/ISO_8601 | ISO 8601}.\n *\n * @readonly\n */\n get created(): string {\n return this.data.created;\n }\n\n /**\n * File custom fields object, to store custom data.\n *\n * @readonly\n */\n get customFields(): any {\n return this.data.customFields;\n }\n\n set customFields(value: any) {\n this.data.customFields = value;\n }\n\n /**\n * Raw file data received from the server.\n *\n * @readonly\n */\n get data(): any {\n return this._data;\n }\n\n private set data(value: any) {\n this._data = value;\n this._data.previewUrl = value.preview\n ? `${this.httpClient.serverUrl}${this.path}/preview?updated=${value.updatedAt}`\n : \"\";\n // owner since 24.8\n if (typeof this._data.owner === \"string\") this._data.owner = { userId: this._data.owner };\n this._data.owner ??= {};\n this._data.owner.avatarUrl = `${this.httpClient.serverUrl}/users/${this._data.owner.userId}/avatar`;\n this._data.owner.fullName = userFullName(this._data.owner);\n this._data.owner.initials = userInitials(this._data.owner.fullName);\n // status since 24.9\n this._data.status ??= {};\n this._data.status.geometry ??= { state: this._data.geometryStatus ?? \"none\" };\n this._data.status.properties ??= { state: this._data.propertiesStatus ?? \"none\" };\n this._data.status.validation ??= { state: this._data.validationStatus ?? \"none\" };\n // updatedBy since 24.10\n this._data.updatedBy ??= {};\n this._data.updatedBy.avatarUrl = `${this.httpClient.serverUrl}/users/${this._data.updatedBy.userId}/avatar`;\n this._data.updatedBy.fullName = userFullName(this._data.updatedBy);\n this._data.updatedBy.initials = userInitials(this._data.updatedBy.fullName);\n // versions since 24.10\n this._data.versions ??= [{ ...value }];\n // geometryGltf status since 24.12\n this._data.status.geometryGltf ??= { state: \"none\" };\n // isFileDeleted since 25.7\n this._data.isFileDeleted ??= false;\n }\n\n /**\n * Returns a list of file formats in which the active version of the file was exported.\n *\n * To export file to one of the supported formats create File Converter job using\n * {@link createJob | createJob()}. To download exported file use\n * {@link downloadResource | downloadResource()}.\n *\n * @readonly\n */\n get exports(): string[] {\n return this.data.exports;\n }\n\n /**\n * Geometry data type of the active file version. Can be one of:\n *\n * - `vsfx` - `VSFX` format, file can be opened in `VisualizeJS` viewer.\n * - `gltf` - `glTF` format, file can be opened in `Three.js` viewer.\n *\n * Returns an empty string if geometry data has not yet been converted. A files without\n * geometry data can be exported to other formas, but cannot be opened in viewer.\n */\n get geometryType(): string {\n if (this.status.geometryGltf.state === \"done\") return \"gltf\";\n else if (this.status.geometry.state === \"done\") return \"vsfx\";\n else return \"\";\n }\n\n /**\n * Unique file ID.\n *\n * @readonly\n */\n get id(): string {\n return this.data.id;\n }\n\n /**\n * Returns `true` if the source file of the active file version has been deleted.\n *\n * A files with deleted source file can be opened in the viewer, but cannot be exported to\n * other formats.\n *\n * @readonly\n */\n get isFileDeleted(): boolean {\n return this.data.isFileDeleted;\n }\n\n /**\n * File name, including the extension.\n */\n get name(): string {\n return this.data.name;\n }\n\n set name(value: string) {\n this.data.name = value;\n }\n\n /**\n * If the file is a version, then returns the ID of the original file. Otherwise, returns the file ID.\n *\n * @readonly\n */\n get originalFileId(): string {\n return this.data.originalFileId;\n }\n\n /**\n * File owner information.\n *\n * @property {string} userId - User ID.\n * @property {string} userName - User name.\n * @property {string} name - First name.\n * @property {string} lastName - Last name.\n * @property {string} fullName - Full name.\n * @property {string} initials - Initials.\n * @property {string} email - User email.\n * @property {string} avatarUrl - User avatar image URL.\n * @readonly\n */\n get owner(): IShortUserDescription {\n return this.data.owner;\n }\n\n /**\n * File preview image URL or empty string if the file does not have a preview. Use\n * {@link setPreview | setPreview()} to change preview image.\n *\n * @readonly\n */\n get previewUrl(): string {\n return this.data.previewUrl;\n }\n\n /**\n * The size of the active version of the file in bytes.\n *\n * @readonly\n */\n get size(): number {\n return this.data.size;\n }\n\n /**\n * Total size of all versions of the file in bytes.\n *\n * @readonly\n */\n get sizeTotal(): number {\n return this.data.sizeTotal;\n }\n\n /**\n * Data status of the active version of the file. Contains:\n *\n * - `geometry` - status of geometry data of `vsfx` type.\n * - `geometryGltf` - status of geometry data of `gltf` type.\n * - `properties` - status of properties.\n * - `validation` - status of validation.\n *\n * Each status entity is a record with properties:\n *\n * - `state` - Data state. Can be `none`, `waiting`, `inprogress`, `done` or `failed`.\n * - `jobId` - Unique ID of the data job.\n *\n * @readonly\n */\n get status(): IFileStatus {\n return this.data.status;\n }\n\n /**\n * File type, matches the file extension.\n *\n * @readonly\n */\n get type(): string {\n return this.data.type;\n }\n\n /**\n * File last update time (UTC) in the format specified in\n * {@link https://www.wikipedia.org/wiki/ISO_8601 | ISO 8601}.\n *\n * @readonly\n */\n get updatedAt(): string {\n return this.data.updatedAt;\n }\n\n /**\n * Information about the user who made the last update.\n *\n * @property {string} userId - User ID.\n * @property {string} userName - User name.\n * @property {string} name - First name.\n * @property {string} lastName - Last name.\n * @property {string} fullName - Full name.\n * @property {string} initials - Initials.\n * @property {string} email - User email.\n * @property {string} avatarUrl - User avatar image URL.\n * @readonly\n */\n get updatedBy(): IShortUserDescription {\n return this.data.updatedBy;\n }\n\n /**\n * Zero-based file version number for version files. The original file has version `0`.\n */\n\n get version(): number {\n return this.data.version;\n }\n\n /**\n * List of the file versions.\n *\n * @readonly\n */\n get versions(): IFileVersionInfo[] {\n return this.data.versions;\n }\n\n /**\n * Reloads file data from the server.\n */\n async checkout(): Promise<this> {\n const response = await this.internalGet(\"\");\n this.data = await response.json();\n return this;\n }\n\n /**\n * Updates file data on the server.\n *\n * @param data - Raw file data.\n */\n async update(data: any): Promise<this> {\n const response = await this.internalPut(\"\", data);\n this.data = await response.json();\n return this;\n }\n\n /**\n * Deletes a file and all its versions from the server.\n *\n * You cannot delete a version file using `delete()`, only the original file. To delete a\n * version file use {@link deleteVersion | deleteVersion()}.\n *\n * @returns Returns the raw data of a deleted file.\n */\n delete(): Promise<any> {\n return this.internalDelete(\"\").then((response) => response.json());\n }\n\n /**\n * Saves file properties changes to the server. Call this method to update file data on the\n * server after any property changes.\n */\n save(): Promise<this> {\n return this.update(this.data);\n }\n\n /**\n * Sets or removes the file preview.\n *\n * @param image - Preview image. Can be a\n * {@link https://developer.mozilla.org/docs/Web/HTTP/Basics_of_HTTP/Data_URIs | Data URL}\n * string,\n * {@link https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer | ArrayBuffer},\n * {@link https://developer.mozilla.org/docs/Web/API/Blob/Blob | Blob} or\n * {@link https://developer.mozilla.org/docs/Web/API/File | Web API File} object. Setting\n * the `image` to `null` will remove the preview.\n */\n async setPreview(image?: BodyInit | null): Promise<this> {\n if (!image) {\n await this.deletePreview();\n } else {\n const response = await this.internalPost(\"/preview\", image);\n this.data = await response.json();\n }\n return this;\n }\n\n /**\n * Removes the file preview.\n */\n async deletePreview(): Promise<this> {\n const response = await this.internalDelete(\"/preview\");\n this.data = await response.json();\n return this;\n }\n\n /**\n * Returns a list of models of the active version of the file.\n */\n getModels(): Promise<Model[]> {\n return this.internalGet(\"/geometry\")\n .then((response) => response.json())\n .then((array) => array.map((data) => new Model(data, this)));\n }\n\n // File does not support model transformation.\n\n getModelTransformMatrix(handle: string): any {\n return undefined;\n }\n\n setModelTransformMatrix(handle: string, transform: any): Promise<this> {\n console.warn(\"File does not support model transformation\");\n return Promise.resolve(this);\n }\n\n /**\n * Object properties.\n *\n * @typedef {any} Properties\n * @property {string} handle - Object original handle.\n * @property {string | any} * - Object property. Can be `any` for nested properties.\n */\n\n /**\n * Returns the properties for an objects in the active version of the file.\n *\n * @param handles - Object original handle or handles array. Specify `undefined` to get\n * properties for all objects in the file.\n */\n getProperties(handles?: string | string[]): Promise<any[]> {\n const relativePath = handles !== undefined ? `/properties?handles=${handles}` : \"/properties\";\n return this.internalGet(relativePath).then((response) => response.json());\n }\n\n /**\n * Search pattern.\n *\n * @typedef {any} SearchPattern\n * @property {string} key - Property name.\n * @property {string} value - Property value.\n */\n\n /**\n * Query operator. Operator name can be `$and`, `$or`, `$not`, `$eq`, `$regex`.\n *\n * @typedef {any} QueryOperator\n * @property {string | SearchPattern[] | QueryOperator[]} * - Array of the query values or\n * patterns for operator.\n */\n\n /**\n * Returns the list of original handles for an objects in the active version of the file that\n * match the specified patterns. Search patterns may be combined using query operators.\n *\n * @example <caption>Simple search pattern.</caption>\n * searchPattern = {\n * key: \"Category\",\n * value: \"OST_Stairs\",\n * };\n *\n * @example <caption>Search patterns combination.</caption>\n * searchPattern = {\n * $or: [\n * {\n * $and: [\n * { key: \"Category\", value: \"OST_GenericModel\" },\n * { key: \"Level\", value: \"03 - Floor\" },\n * ],\n * },\n * { key: \"Category\", value: \"OST_Stairs\" },\n * ],\n * };\n *\n * @param {SeacrhPattern | QueryOperator} searchPattern - Search pattern or combination of\n * the patterns, see example below.\n * @returns {Promise<Properties[]>}\n */\n\n searchProperties(searchPattern: any): Promise<any[]> {\n return this.internalPost(\"/properties/search\", searchPattern).then((response) => response.json());\n }\n\n /**\n * Returns the CDA tree for an active version of the file.\n */\n getCdaTree(): Promise<any[]> {\n return this.internalGet(`/properties/tree`).then((response) => response.json());\n }\n\n /**\n * Returns a list of file viewpoints.\n */\n getViewpoints(): Promise<any[]> {\n return this.internalGet(\"/viewpoints\")\n .then((response) => response.json())\n .then((viewpoints) => viewpoints.result);\n }\n\n /**\n * Saves a new file viewpoint to the server. To create a viewpoint use `Viewer.createViewpoint()`.\n *\n * @param viewpoint - Viewpoint.\n */\n saveViewpoint(viewpoint: any): Promise<any> {\n return this.internalPost(\"/viewpoints\", viewpoint).then((response) => response.json());\n }\n\n /**\n * Deletes the specified file viewpoint.\n *\n * @param guid - Viewpoint GUID.\n * @returns Returns the raw data of a deleted viewpoint.\n */\n deleteViewpoint(guid: string): Promise<any> {\n return this.internalDelete(`/viewpoints/${guid}`).then((response) => response.json());\n }\n\n /**\n * Returns viewpoint snapshot as base64-encoded\n * {@link https://developer.mozilla.org/docs/Web/HTTP/Basics_of_HTTP/Data_URIs | Data URL}.\n *\n * @param guid - Viewpoint GUID.\n */\n getSnapshot(guid: string): Promise<string> {\n return this.internalGet(`/viewpoints/${guid}/snapshot`).then((response) => response.text());\n }\n\n /**\n * Returns viewpoint snapshot data.\n *\n * @param guid - Viewpoint GUID.\n * @param bitmapGuid - Bitmap GUID.\n */\n getSnapshotData(guid: string, bitmapGuid: string): Promise<string> {\n return this.internalGet(`/viewpoints/${guid}/bitmaps/${bitmapGuid}`).then((response) => response.text());\n }\n\n /**\n * Downloads the source file of active version of the file from the server.\n *\n * @param onProgress - Download progress callback.\n * @param signal - An\n * {@link https://developer.mozilla.org/docs/Web/API/AbortController | AbortController}\n * signal. Allows to communicate with a fetch request and abort it if desired.\n */\n download(onProgress?: (progress: number) => void, signal?: AbortSignal): Promise<ArrayBuffer> {\n const relativePath = this.appendVersionParam(\"/downloads\");\n return this.httpClient\n .downloadFile(`${this.path}${relativePath}`, onProgress, signal)\n .then((response) => response.arrayBuffer());\n }\n\n /**\n * Downloads a resource file of the active version of the file. Resource files are files that\n * contain model scene descriptions, or geometry data, or exported files.\n *\n * @example <caption>Export file to DWG.</caption>\n * const job = await file.crateJob(\"dwg\");\n * await job.waitForDone();\n * const dwgFileName = file.exports.find((x) => x.endsWith(\".dwg\"));\n * const arrayBuffer = await file.downloadResource(dwgFileName);\n * const blob = new Blob([arrayBuffer]);\n * const fileName = file.name.replace(/\\.[^.]+$/, \"\") + \".dwg\";\n * FileSaver.saveAs(blob, fileName);\n *\n * @param dataId - Resource file name.\n * @param onProgress - Download progress callback.\n * @param signal - An\n * {@link https://developer.mozilla.org/docs/Web/API/AbortController | AbortController}\n * signal. Allows to communicate with a fetch request and abort it if desired.\n */\n downloadResource(\n dataId: string,\n onProgress?: (progress: number, chunk: Uint8Array) => void,\n signal?: AbortSignal\n ): Promise<ArrayBuffer> {\n const relativePath = this.appendVersionParam(`/downloads/${dataId}`);\n return this.httpClient\n .downloadFile(`${this.path}${relativePath}`, onProgress, signal)\n .then((response) => response.arrayBuffer());\n }\n\n /**\n * Downloads a part of resource file of the active version of the file. Resource files are\n * files that contain model scene descriptions, or geometry data, or exported files.\n *\n * @param dataId - Resource file name.\n * @param ranges - A range of resource file contents to download.\n * @param requestId - Request ID for download progress callback.\n * @param onProgress - Download progress callback.\n * @param signal - An\n * {@link https://developer.mozilla.org/docs/Web/API/AbortController | AbortController}\n * signal. Allows to communicate with a fetch request and abort it if desired.\n */\n downloadResourceRange(\n dataId: string,\n requestId: number,\n ranges: Array<{ begin: number; end: number; requestId: number }>,\n onProgress?: (progress: number, chunk: Uint8Array, requestId: number) => void,\n signal?: AbortSignal\n ): Promise<ArrayBuffer> {\n const relativePath = this.appendVersionParam(`/downloads/${dataId}?requestId=${requestId}`);\n return this.httpClient\n .downloadFileRange(`${this.path}${relativePath}`, requestId, ranges, onProgress, signal)\n .then((response) => response.arrayBuffer());\n }\n\n /**\n * Deprecated since `25.3`. Use {@link downloadResource | downloadResource()} instead.\n *\n * @deprecated\n */\n partialDownloadResource(\n dataId: string,\n onProgress?: (progress: number, downloaded: Uint8Array) => void,\n signal?: AbortSignal\n ): Promise<ArrayBuffer> {\n console.warn(\n \"File.partialDownloadResource() has been deprecated since 25.3 and will be removed in a future release, use File.downloadResource() instead.\"\n );\n return this.downloadResource(dataId, onProgress, signal);\n }\n\n /**\n * Deprecated since `25.3`. Use {@link downloadResourceRange | downloadResourceRange()} instead.\n *\n * @deprecated\n */\n async downloadFileRange(\n requestId: number,\n records: any | null,\n dataId: string,\n onProgress?: (progress: number, downloaded: Uint8Array, requestId: number) => void,\n signal?: AbortSignal\n ): Promise<void> {\n await this.downloadResourceRange(dataId, requestId, records, onProgress, signal);\n }\n\n /**\n * Returns a list of file references.\n *\n * References are images, fonts, or any other files to correct rendering of the file.\n *\n * @param signal - An\n * {@link https://developer.mozilla.org/docs/Web/API/AbortController | AbortController}\n * signal, which can be used to abort waiting as desired.\n */\n getReferences(signal?: AbortSignal): Promise<IFileReferences> {\n return this.internalGet(\"/references\", signal).then((response) => response.json());\n }\n\n /**\n * Sets the file references.\n *\n * References are images, fonts, or any other files to correct rendering of the file.\n * Reference files must be uploaded to the server before they can be assigned to the current file.\n *\n * @param references - File references.\n */\n setReferences(references: IFileReferences): Promise<IFileReferences> {\n return this.internalPut(\"/references\", references).then((response) => response.json());\n }\n\n /**\n * Runs a new job on the server for the active version of the file.\n *\n * @param outputFormat - The job type. Can be one of:\n *\n * - `geometry` - Convert file geometry data to `VSFX` format suitable for `VisualizeJS` viewer.\n * - `geometryGltf` - Convert file geometry data to `glTF` format suitable for `Three.js` viewer.\n * - `properties` - Extract file properties.\n * - `validation` - Validate the file. Only for `IFC` files.\n * - `dwg`, `obj`, `gltf`, `glb`, `vsf`, `pdf`, `3dpdf` - Export file to the one of the\n * supported format. Use {@link exports | exports()} to get the list of completed file\n * exports. Use {@link downloadResource | downloadResource()} to download the exported file.\n * - Other custom job name. Custom job runner must be registered in the job templates before\n * creating a job.\n *\n * @param parameters - Parameters for the job runner. Can be given as command line arguments\n * for the File Converter tool in form `--arg=value`.\n */\n createJob(outputFormat: string, parameters?: string | object): Promise<Job> {\n const relativePath = this.appendVersionParam(\"/jobs\");\n return this.httpClient\n .post(relativePath, {\n fileId: this.id,\n outputFormat,\n parameters: parseArgs(parameters),\n })\n .then((response) => response.json())\n .then((data) => new Job(data, this.httpClient));\n }\n\n /**\n * Runs a job to convert geometry data of active version of the file. This is alias to\n * {@link createJob | createJob(\"geometry\")}.\n *\n * @param type - Geometry data type. Can be one of:\n *\n * - `vsfx` - `VSFX` format (default), for opening a file in `VisualizeJS` viewer.\n * - `gltf` - `glTF` format, for opening a file in `Three.js` viewer.\n *\n * @param parameters - Parameters for the job runner. Can be given as command line arguments\n * for the File Converter tool in form `--arg=value`.\n */\n extractGeometry(type?: string, parameters?: string | object): Promise<Job> {\n return this.createJob(type === \"gltf\" ? \"geometryGltf\" : \"geometry\", parameters);\n }\n\n /**\n * Runs a job to extract properties of the active version of the file. This is alias to\n * {@link createJob | createJob(\"properties\")}.\n *\n * @param parameters - Parameters for the job runner. Can be given as command line arguments\n * for the File Converter tool in form `--arg=value`.\n */\n extractProperties(parameters?: string | object): Promise<Job> {\n return this.createJob(\"properties\", parameters);\n }\n\n /**\n * Runs a job to validate the active version of the file. This is alias to\n * {@link createJob | createJob(\"validation\")}.\n *\n * To get validation report use {@link downloadResource | downloadResource(\"validation_report.json\")}.\n *\n * @param parameters - Parameters for the job runner. Can be given as command line arguments\n * for the File Converter tool in form `--arg=value`.\n */\n validate(parameters?: string | object): Promise<Job> {\n return this.createJob(\"validation\", parameters);\n }\n\n /**\n * Waits for jobs of the active version of the file to be done. Job is done when it changes\n * to `none`, `done` or `failed` status.\n *\n * @param jobs - Job or job array to wait on. Can be `geometry`, `geometryGltf`,\n * `properties`, `validation`, `dwg`, `obj`, `gltf`, `glb`, `vsf`, `pdf`, `3dpdf` or custom\n * job name.\n * @param waitAll - If this parameter is `true`, the function returns when all the specified\n * jobs have done. If `false`, the function returns when any one of the jobs are done.\n * @param params - An object containing waiting parameters.\n * @param params.timeout - The time, in milliseconds that the function should wait jobs. If\n * no one jobs are done during this time, the `TimeoutError` exception will be thrown.\n * @param params.interval - The time, in milliseconds, the function should delay in between\n * checking jobs status.\n * @param params.signal - An\n * {@link https://developer.mozilla.org/docs/Web/API/AbortController | AbortController}\n * signal, which can be used to abort waiting as desired.\n * @param params.onCheckout - Waiting progress callback. Return `true` to cancel waiting.\n */\n waitForDone(\n jobs: string | string[],\n waitAll?: boolean,\n params?: {\n timeout?: number;\n interval?: number;\n signal?: AbortSignal;\n onCheckout?: (file: File, ready: boolean) => boolean;\n }\n ): Promise<this> {\n const waitJobs = Array.isArray(jobs) ? jobs : [jobs];\n if (waitAll === undefined) waitAll = true;\n\n const checkDone = () =>\n this.checkout().then((file) => {\n const readyJobs = waitJobs.filter((job: string) => {\n const jobStatus = file.status[job] || {};\n return [\"none\", \"done\", \"failed\"].includes(jobStatus.state || \"none\");\n });\n const ready = waitAll ? readyJobs.length === waitJobs.length : readyJobs.length > 0;\n const cancel = params?.onCheckout?.(file, ready);\n return cancel || ready;\n });\n\n return waitFor(checkDone, params).then(() => this);\n }\n\n /**\n * Returns a list of file permissions.\n */\n getPermissions(): Promise<Permission[]> {\n return this.internalGet(\"/permissions\")\n .then((response) => response.json())\n .then((array) => array.map((data) => new Permission(data, this.id, this.httpClient)));\n }\n\n /**\n * Returns information about specified file permission.\n *\n * @param permissionId - Permission ID.\n */\n getPermission(permissionId: string): Promise<Permission> {\n return this.internalGet(`/permissions/${permissionId}`)\n .then((response) => response.json())\n .then((data) => new Permission(data, this.id, this.httpClient));\n }\n\n /**\n * Creates a new file permission.\n *\n * @param actions - Actions are allowed to be performed on a file with this permission:\n *\n * - `read` - The ability to read file description, geometry data and properties.\n * - `readSourceFile` - The ability to read source file.\n * - `write` - The ability to modify file name, description and references.\n * - `readViewpoint` - The ability to read file viewpoints.\n * - `createViewpoint` - The ability to create file viewpoints.\n *\n * @param grantedTo - A list of principials that will get access to the file.\n * @param _public - Specifies whether all users have access to the file or not.\n */\n createPermission(actions: string | string[], grantedTo: any[], _public: boolean): Promise<Permission> {\n return this.internalPost(\"/permissions\", {\n actions: Array.isArray(actions) ? actions : [actions],\n grantedTo,\n public: _public,\n })\n .then((response) => response.json())\n .then((data) => new Permission(data, this.id, this.httpClient));\n }\n\n /**\n * Removes the specified permission from the file.\n *\n * @param permissionId - Permission ID.\n * @returns Returns the raw data of a deleted permission.\n */\n deletePermission(permissionId: string): Promise<any> {\n return this.internalDelete(`/permissions/${permissionId}`).then((response) => response.json());\n }\n\n /**\n * Uploads the new version of the file to the server, convert the geometry data and extract\n * properties as needed.\n *\n * @param file - {@link https://developer.mozilla.org/docs/Web/API/File | Web API File} object\n * are generally retrieved from a\n * {@link https://developer.mozilla.org/docs/Web/API/FileList | FileList} object returned as\n * a result of a user selecting files using the HTML `<input>` element.\n * @param params - An object containing upload parameters.\n * @param params.geometry - Create job to convert file geometry data. The geometry data type\n * is the same as the original file.\n * @param params.properties - Create job to extract file properties.\n * @param params.waitForDone - Wait for geometry and properties jobs to complete.\n * @param params.timeout - The time, in milliseconds that the function should wait jobs. If\n * no one jobs are done during this time, the `TimeoutError` exception will be thrown.\n * @param params.interval - The time, in milliseconds, the function should delay in between\n * checking jobs status.\n * @param params.signal - An\n * {@link https://developer.mozilla.org/docs/Web/API/AbortController | AbortController}\n * signal, which can be used to abort waiting as desired.\n * @param params.onProgress - Upload progress callback.\n */\n\n async uploadVersion(\n file: globalThis.File,\n params: {\n geometry?: boolean;\n properties?: boolean;\n waitForDone?: boolean;\n timeout?: number;\n interval?: number;\n signal?: AbortSignal;\n onProgress?: (progress: number, file: globalThis.File) => void;\n } = {\n waitForDone: false,\n }\n ): Promise<File> {\n const result = await this.httpClient\n .uploadFile(`${this.path}/versions`, file, (progress) => params.onProgress?.(progress, file))\n .then((xhr: XMLHttpRequest) => JSON.parse(xhr.responseText))\n .then((data) => new File(data, this.httpClient));\n\n let geometryType = \"\";\n if (this.versions[0].status.geometryGltf.state !== \"none\") geometryType = \"gltf\";\n if (this.versions[0].status.geometry.state !== \"none\") geometryType = \"vsfx\";\n\n params = { ...params };\n if (params.geometry === undefined) params.geometry = geometryType !== \"\";\n if (params.properties === undefined) params.properties = this.versions[0].status.properties.state !== \"none\";\n\n const jobs: string[] = [];\n if (params.geometry) jobs.push((await result.extractGeometry(geometryType)).outputFormat);\n if (params.properties) jobs.push((await result.extractProperties()).outputFormat);\n if (jobs.length > 0)\n if (params.waitForDone) await result.waitForDone(jobs, true, params);\n else await result.checkout();\n\n await this.checkout();\n\n return result;\n }\n\n /**\n * Returns a list of version files.\n */\n getVersions(): Promise<File[]> {\n return this.internalGet(\"/versions\")\n .then((response) => response.json())\n .then((files) => files.map((data) => new File(data, this.httpClient)))\n .then((files) => files.map((file) => (file.id == file.originalFileId ? file.useVersion(0) : file)));\n }\n\n /**\n * Returns information about the specified version file.\n *\n * @param version - Desired version.\n */\n getVersion(version: number): Promise<File> {\n return this.internalGet(`/versions/${version}`)\n .then((response) => response.json())\n .then((data) => new File(data, this.httpClient))\n .then((file) => (file.id == file.originalFileId ? file.useVersion(0) : file));\n }\n\n /**\n * Deletes the specified version file.\n *\n * @param version - Version to delete.\n */\n async deleteVersion(version: number): Promise<any> {\n const response = await this.internalDelete(`/versions/${version}`);\n const data = await response.json();\n await this.checkout();\n return data;\n }\n\n /**\n * Replaces the active version of the file with the selected version.\n *\n * @param version - Desired active version.\n */\n\n setActiveVersion(version: number): Promise<this> {\n return this.update({ activeVersion: version });\n }\n\n /**\n * Makes the given version active on client side. Does not change the active file version on\n * the server.\n *\n * This version change will affect the result:\n *\n * - {@link getModels | getModels()}\n * - {@link getProperties | getProperties()}\n * - {@link searchProperties | searchProperties()}\n * - {@link getCdaTree | getCdaTree()}\n * - {@link download | download()}\n * - {@link downloadResource | downloadResource()}\n * - {@link createJob | createJob()}\n * - {@link extractGeometry | extractGeometry()}\n * - {@link extractProperties | extractProperties()}\n * - {@link validate | validate()}\n * - {@link waitForDone | waitForDone()}\n * - Viewer.open()\n *\n * Other clients will still continue to use the current active version of the file. Use\n * `undefined` to revert back to the active version.\n *\n * You need to reload the file data using {@link checkout | checkout()} to match the size and\n * status fields to the version you selected.\n */\n useVersion(version?: number): this {\n this._useVersion = version;\n return this;\n }\n\n /**\n * Deletes the source file of the active file version from the server.\n */\n async deleteSource(): Promise<this> {\n const response = await this.internalDelete(\"/source\");\n this.data = await response.json();\n return this;\n }\n}\n","///////////////////////////////////////////////////////////////////////////////\n// Copyright (C) 2002-2024, Open Design Alliance (the \"Alliance\").\n// All rights reserved.\n//\n// This software and its documentation and related materials are owned by\n// the Alliance. The software may only be incorporated into application\n// programs owned by members of the Alliance, subject to a signed\n// Membership Agreement and Supplemental Software License Agreement with the\n// Alliance. The structure and organization of this software are the valuable\n// trade secrets of the Alliance and its suppliers. The software is also\n// protected by copyright law and international treaty provisions. Application\n// programs incorporating this software must include the following statement\n// with their copyright notices:\n//\n// This application incorporates Open Design Alliance software pursuant to a\n// license agreement with Open Design Alliance.\n// Open Design Alliance Copyright (C) 2002-2024 by Open Design Alliance.\n// All rights reserved.\n//\n// By use of this software, its documentation or related materials, you\n// acknowledge and accept the above terms.\n///////////////////////////////////////////////////////////////////////////////\n\nimport { IHttpClient } from \"./IHttpClient\";\n\n/**\n * A role determines what actions allowed to be performed by {@link User | users} on a\n * {@link Project | project}.\n */\nexport class Role {\n private _data: any;\n public projectId: string;\n public httpClient: IHttpClient;\n\n /**\n * @param data - Raw role data received from the server.\n * @param projectId - Owner project ID.\n * @param httpClient - HTTP client instance used to send REST API requests to the server.\n */\n constructor(data: any, projectId: string, httpClient: IHttpClient) {\n this.httpClient = httpClient;\n this.projectId = projectId;\n this.data = data;\n }\n\n private internalGet(): Promise<Response> {\n return this.httpClient.get(`/projects/${this.projectId}/roles/${this.name}`);\n }\n\n private internalPut(body?: BodyInit | object): Promise<Response> {\n return this.httpClient.put(`/projects/${this.projectId}/roles/${this.name}`, body);\n }\n\n private internalDelete(): Promise<Response> {\n return this.httpClient.delete(`/projects/${this.projectId}/roles/${this.name}`);\n }\n\n /**\n * Role description.\n */\n get description(): string {\n return this.data.description;\n }\n\n set description(value: string) {\n this._data.description = value;\n }\n\n /**\n * Raw role data received from the server.\n *\n * @readonly\n */\n get data(): any {\n return this._data;\n }\n\n set data(value: any) {\n this._data = value;\n }\n\n /**\n * Role name.\n */\n get name(): string {\n return this.data.name;\n }\n\n set name(value: string) {\n this._data.name = value;\n }\n\n /**\n * Role actions are allowed to be performed.\n *\n * @property {string[]} projectActions - Actions are allowed to be performed at the project\n * level: `update`, `createTopic`, `createDocument`.\n * @property {string[]} topicActions - Actions are allowed to be performed at the topic\n * level: `update`, `updateBimSnippet`, `updateRelatedTopics`, `updateDocumentReferences`,\n * `updateFiles`, `createComment`, `createViewpoint`, `delete`.\n * @property {string[]} commentActions - Actions are allowed to be performed at the comment\n * level: `update`, `delete`.\n * @property {string[]} viewpointActions - Actions are allowed to be performed at the\n * viewpoint level: `delete`.\n * @property {string[]} odaGroupActions - Actions are allowed to be performed at the members\n * level: `update`, `delete`.\n * @property {string[]} odaRoleActions - Actions are allowed to be performed at the roles\n * level: `update`, `delete`.\n */\n get permissions(): any {\n return this.data.permissions;\n }\n\n set permissions(value: any) {\n this.data.permissions = value || {};\n }\n\n /**\n * Reloads role data from the server.\n */\n async checkout(): Promise<this> {\n const response = await this.internalGet();\n this.data = await response.json();\n return this;\n }\n\n /**\n * Updates role data on the server.\n *\n * @param data - Raw role data.\n */\n async update(data: any): Promise<this> {\n const response = await this.internalPut(data);\n this.data = await response.json();\n return this;\n }\n\n /**\n * Deletes a role from the project.\n *\n * @returns Returns the raw data of a deleted role.\n */\n delete(): Promise<any> {\n return this.internalDelete().then((response) => response.json());\n }\n\n /**\n * Saves role properties changes to the server. Call this method to update role data on the\n * server after any property changes.\n */\n save(): Promise<this> {\n return this.update(this.data);\n }\n}\n","///////////////////////////////////////////////////////////////////////////////\n// Copyright (C) 2002-2024, Open Design Alliance (the \"Alliance\").\n// All rights reserved.\n//\n// This software and its documentation and related materials are owned by\n// the Alliance. The software may only be incorporated into application\n// programs owned by members of the Alliance, subject to a signed\n// Membership Agreement and Supplemental Software License Agreement with the\n// Alliance. The structure and organization of this software are the valuable\n// trade secrets of the Alliance and its suppliers. The software is also\n// protected by copyright law and international treaty provisions. Application\n// programs incorporating this software must include the following statement\n// with their copyright notices:\n//\n// This application incorporates Open Design Alliance software pursuant to a\n// license agreement with Open Design Alliance.\n// Open Design Alliance Copyright (C) 2002-2024 by Open Design Alliance.\n// All rights reserved.\n//\n// By use of this software, its documentation or related materials, you\n// acknowledge and accept the above terms.\n///////////////////////////////////////////////////////////////////////////////\n\nimport { IHttpClient } from \"./IHttpClient\";\nimport { IShortUserDescription } from \"./IUser\";\nimport { userFullName, userInitials } from \"./Utils\";\n\n/**\n * Provides properties and methods for obtaining information about a {@link User | user} who has\n * access to the {@link Project | project}.\n */\nexport class Member {\n private _data: any;\n public projectId: string;\n public httpClient: IHttpClient;\n\n /**\n * @param data - Raw member data received from the server.\n * @param projectId - Owner project ID.\n * @param httpClient - HTTP client instance used to send REST API requests to the server.\n */\n constructor(data: any, projectId: string, httpClient: IHttpClient) {\n this.httpClient = httpClient;\n this.projectId = projectId;\n this.data = data;\n }\n\n private internalGet(): Promise<Response> {\n return this.httpClient.get(`/projects/${this.projectId}/members/${this.id}`);\n }\n\n private internalPut(body?: BodyInit | object): Promise<Response> {\n return this.httpClient.put(`/projects/${this.projectId}/members/${this.id}`, body);\n }\n\n private internalDelete(): Promise<Response> {\n return this.httpClient.delete(`/projects/${this.projectId}/members/${this.id}`);\n }\n\n /**\n * Raw member data received from the server.\n *\n * @readonly\n */\n get data(): any {\n return this._data;\n }\n\n private set data(value: any) {\n this._data = value;\n this._data.user.avatarUrl = `${this.httpClient.serverUrl}/users/${this._data.user.userId}/avatar`;\n this._data.user.fullName = userFullName(this._data.user);\n this._data.user.initials = userInitials(this._data.user.fullName);\n }\n\n /**\n * Unique member ID.\n *\n * @readonly\n */\n get id(): string {\n return this.data.id;\n }\n\n /**\n * Member role. See {@link Project.getRoles | Project.getRoles()} for more details.\n */\n get role(): string {\n return this.data.role;\n }\n\n set role(value: string) {\n this.data.role = value;\n }\n\n /**\n * Member type. Can be `owner` or `user`.\n *\n * @readonly\n */\n get type(): string {\n return this.data.type;\n }\n\n /**\n * User information.\n *\n * @property {string} userId - User ID.\n * @property {string} userName - User name.\n * @property {string} name - First name.\n * @property {string} lastName - Last name.\n * @property {string} fullName - Full name.\n * @property {string} initials - Initials.\n * @property {string} email - User email.\n * @property {string} avatarUrl - User avatar image URL.\n * @readonly\n */\n get user(): IShortUserDescription {\n return this.data.user;\n }\n\n /**\n * Reloads member data from the server.\n */\n async checkout(): Promise<this> {\n const response = await this.internalGet();\n this.data = await response.json();\n return this;\n }\n\n /**\n * Updates member data on the server.\n *\n * @param data - Raw member data.\n */\n async update(data: any): Promise<this> {\n const response = await this.internalPut(data);\n this.data = await response.json();\n return this;\n }\n\n /**\n * Removes a member from the project.\n *\n * @returns Returns the raw data of a deleted member.\n */\n delete(): Promise<any> {\n return this.internalDelete().then((response) => response.json());\n }\n\n /**\n * Saves member properties changes to the server. Call this method to update member data on\n * the server after any property changes.\n */\n save(): Promise<this> {\n return this.update(this.data);\n }\n}\n","///////////////////////////////////////////////////////////////////////////////\n// Copyright (C) 2002-2024, Open Design Alliance (the \"Alliance\").\n// All rights reserved.\n//\n// This software and its documentation and related materials are owned by\n// the Alliance. The software may only be incorporated into application\n// programs owned by members of the Alliance, subject to a signed\n// Membership Agreement and Supplemental Software License Agreement with the\n// Alliance. The structure and organization of this software are the valuable\n// trade secrets of the Alliance and its suppliers. The software is also\n// protected by copyright law and international treaty provisions. Application\n// programs incorporating this software must include the following statement\n// with their copyright notices:\n//\n// This application incorporates Open Design Alliance software pursuant to a\n// license agreement with Open Design Alliance.\n// Open Design Alliance Copyright (C) 2002-2024 by Open Design Alliance.\n// All rights reserved.\n//\n// By use of this software, its documentation or related materials, you\n// acknowledge and accept the above terms.\n///////////////////////////////////////////////////////////////////////////////\n\nimport { IHttpClient } from \"./IHttpClient\";\nimport { IShortUserDescription } from \"./IUser\";\nimport { Role } from \"./Role\";\nimport { Member } from \"./Member\";\nimport { userFullName, userInitials } from \"./Utils\";\n\n/**\n * Provides properties and methods for obtaining information about a project on the server and\n * managing its {@link Role | roles}, {@link Member | members} and models.\n */\nexport class Project {\n private _data: any;\n public httpClient: IHttpClient;\n\n /**\n * @param data - Raw project data received from the server.\n * @param httpClient - HTTP client instance used to send REST API requests to the server.\n */\n constructor(data: any, httpClient: IHttpClient) {\n this.httpClient = httpClient;\n this.data = data;\n }\n\n protected internalGet(relativePath: string): Promise<Response> {\n return this.httpClient.get(`/projects/${this.id}${relativePath}`);\n }\n\n protected internalPost(relativePath: string, body?: BodyInit | object): Promise<Response> {\n return this.httpClient.post(`/projects/${this.id}${relativePath}`, body);\n }\n\n protected internalPut(relativePath: string, body?: BodyInit | object): Promise<Response> {\n return this.httpClient.put(`/projects/${this.id}${relativePath}`, body);\n }\n\n protected internalDelete(relativePath: string): Promise<Response> {\n return this.httpClient.delete(`/projects/${this.id}${relativePath}`);\n }\n\n /**\n * Project features the user has access to.\n *\n * @readonly\n */\n get authorization(): {\n /**\n * Actions are allowed to be performed:\n *\n * - `update` - The ability to update the project details.\n * - `createTopic` - The ability to create a new topic.\n * - `createDocument` - The ability to create a new document.\n */\n project_actions: string[];\n } {\n return this.data.authorization;\n }\n\n /**\n * Project creation time (UTC) in the format specified in\n * {@link https://www.wikipedia.org/wiki/ISO_8601 | ISO 8601}.\n *\n * @readonly\n */\n get createdAt(): string {\n return this.data.createdAt;\n }\n\n /**\n * Project custom fields object, to store custom data.\n */\n get customFields(): any {\n return this.data.customFields;\n }\n\n set customFields(value: any) {\n this.data.customFields = value;\n }\n\n /**\n * Raw project data received from the server.\n *\n * @readonly\n */\n get data(): any {\n return this._data;\n }\n\n private set data(value: any) {\n this._data = value;\n this._data.previewUrl = value.avatarUrl\n ? `${this.httpClient.serverUrl}/projects/${this._data.id}/preview?updated=${value.updatedAt}`\n : \"\";\n this._data.owner.avatarUrl = `${this.httpClient.serverUrl}/users/${this._data.owner.userId}/avatar`;\n this._data.owner.fullName = userFullName(this._data.owner);\n this._data.owner.initials = userInitials(this._data.owner.fullName);\n }\n\n /**\n * Project description.\n */\n get description(): string {\n return this.data.description;\n }\n\n set description(value: string) {\n this.data.description = value;\n }\n\n /**\n * Project end date in the format specified in\n * {@link https://www.wikipedia.org/wiki/ISO_8601 | ISO 8601}.\n */\n get endDate(): string {\n return this.data.endDate;\n }\n\n set endDate(value: string | Date) {\n this.data.endDate = value instanceof Date ? value.toISOString() : value;\n }\n\n /**\n * Unique project ID.\n *\n * @readonly\n */\n get id(): string {\n return this.data.id;\n }\n\n /**\n * The number of members in the project.\n *\n * @readonly\n */\n get memberCount(): number {\n return this.data.memberCount;\n }\n\n /**\n * The number of models in the project.\n *\n * @readonly\n */\n get modelCount(): number {\n return this.data.modelCount;\n }\n\n /**\n * Project name.\n */\n get name(): string {\n return this.data.name;\n }\n\n set name(value: string) {\n this.data.name = value;\n }\n\n /**\n * Project owner information.\n *\n * @property {string} userId - User ID.\n * @property {string} userName - User name.\n * @property {string} name - First name.\n * @property {string} lastName - Last name.\n * @property {string} fullName - Full name.\n * @property {string} initials - Initials.\n * @property {string} email - User email.\n * @property {string} avatarUrl - User avatar image URL.\n * @readonly\n */\n get owner(): IShortUserDescription {\n return this.data.owner;\n }\n\n /**\n * Project preview image URL or empty string if the project does not have a preview. Use\n * {@link Project.setPreview | setPreview()} to change preview image.\n *\n * @readonly\n */\n get previewUrl(): string {\n return this._data.previewUrl;\n }\n\n /**\n * `true` if project is shared project.\n */\n get public(): boolean {\n return this.data.public;\n }\n\n set public(value: boolean) {\n this.data.public = value;\n }\n\n /**\n * Project start date in the format specified in\n * {@link https://www.wikipedia.org/wiki/ISO_8601 | ISO 8601}.\n */\n get startDate(): string {\n return this.data.startDate;\n }\n\n set startDate(value: string | Date) {\n this.data.startDate = value instanceof Date ? value.toISOString() : value;\n }\n\n /**\n * The number of topics in the project.\n *\n * @readonly\n */\n get topicCount(): number {\n return this.data.topicCount;\n }\n\n /**\n * Project last update time (UTC) in the format specified in\n * {@link https://www.wikipedia.org/wiki/ISO_8601 | ISO 8601}.\n *\n * @readonly\n */\n get updatedAt(): string {\n return this.data.updatedAt;\n }\n\n /**\n * Reloads project data from the server.\n */\n async checkout(): Promise<this> {\n const response = await this.internalGet(\"\");\n this.data = await response.json();\n return this;\n }\n\n /**\n * Updates project data on the server.\n *\n * @param data - Raw project data.\n */\n async update(data: any): Promise<this> {\n const response = await this.internalPut(\"\", data);\n this.data = await response.json();\n return this;\n }\n\n /**\n * Deletes a project from the server.\n *\n * @returns Returns the raw data of a deleted project.\n */\n delete(): Promise<any> {\n return this.internalDelete(\"\")\n .then((response) => response.text())\n .then((text) => {\n // TODO fix for server 23.5 and below\n try {\n return JSON.parse(text);\n } catch {\n return { id: this.id };\n }\n });\n }\n\n /**\n * Saves project properties changes to the server. Call this method to update project data on\n * the server after any property changes.\n */\n save(): Promise<this> {\n return this.update(this.data);\n }\n\n /**\n * Sets or removes the project preview.\n *\n * @param image - Preview image. Can be a\n * {@link https://developer.mozilla.org/docs/Web/HTTP/Basics_of_HTTP/Data_URIs | Data URL}\n * string,\n * {@link https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer | ArrayBuffer},\n * {@link https://developer.mozilla.org/docs/Web/API/Blob/Blob | Blob} or\n * {@link https://developer.mozilla.org/docs/Web/API/File | Web API File} object. Setting\n * the `image` to `null` will remove the preview.\n */\n\n async setPreview(image?: BodyInit | null): Promise<any> {\n if (!image) {\n await this.deletePreview();\n } else {\n const response = await this.internalPost(\"/preview\", image);\n this.data = await response.json();\n }\n return this;\n }\n\n /**\n * Removes the project preview.\n */\n async deletePreview(): Promise<this> {\n const response = await this.internalDelete(\"/preview\");\n this.data = await response.json();\n return this;\n }\n\n /**\n * Returns a list of project roles. Project members have different abilities depending on the\n * role they have in a project.\n */\n getRoles(): Promise<Role[]> {\n return this.internalGet(\"/roles\")\n .then((response) => response.json())\n .then((array) => array.map((data) => new Role(data, this.id, this.httpClient)));\n }\n\n /**\n * Returns information about the specified project role.\n *\n * @param name - Role name.\n */\n getRole(name: string): Promise<Role> {\n return this.internalGet(`/roles/${name}`)\n .then((response) => response.json())\n .then((data) => new Role(data, this.id, this.httpClient));\n }\n\n /**\n * Creates a new project role.\n *\n * @param name - Role name.\n * @param description - Role description.\n * @param permissions - Actions are allowed to be performed. See {@link Role.permissions} for\n * more details.\n */\n createRole(name: string, description: string, permissions: any): Promise<Role> {\n return this.internalPost(\"/roles\", {\n name,\n description,\n permissions: permissions || {},\n })\n .then((response) => response.json())\n .then((data) => new Role(data, this.id, this.httpClient));\n }\n\n /**\n * Deletes the specified project role.\n *\n * @param name - Role name.\n * @returns Returns the raw data of a deleted role.\n */\n deleteRole(name: string): Promise<any> {\n return this.internalDelete(`/roles/${name}`).then((response) => response.json());\n }\n\n /**\n * Returns a list of project members.\n */\n getMembers(): Promise<Member[]> {\n return this.internalGet(\"/members\")\n .then((response) => response.json())\n .then((array) => array.map((data) => new Member(data, this.id, this.httpClient)));\n }\n\n /**\n * Returns information about the specified project member.\n *\n * @param memberId - Member ID.\n */\n getMember(memberId: string): Promise<Member> {\n return this.internalGet(`/members/${memberId}`)\n .then((response) => response.json())\n .then((data) => new Member(data, this.id, this.httpClient));\n }\n\n /**\n * Add a user to the project to become a member and have permission to perform actions.\n *\n * @param userId - User ID.\n * @param role - Role name from the list of project roles.\n */\n addMember(userId: string, role: string): Promise<Member> {\n return this.internalPost(\"/members\", { userId, role })\n .then((response) => response.json())\n .then((data) => new Member(data, this.id, this.httpClient));\n }\n\n /**\n * Remove the specified member from a project.\n *\n * @param memberId - Member ID.\n * @returns Returns the raw data of a deleted member.\n */\n removeMember(memberId: string): Promise<any> {\n return this.internalDelete(`/members/${memberId}`).then((response) => response.json());\n }\n\n /**\n * Information about the file (model) that can be reference in the project topics.\n *\n * @typedef {any} FileInformation\n * @property {any[]} display_information - The list of fields to allow users to associate the\n * file with a server model.\n * @property {string} display_information.field_display_name - Field display name.\n * @property {string} display_information.field_value - Field value.\n * @property {any} file - The file reference object.\n * @property {string} file.file_name - File name.\n * @property {string} file.reference - File ID.\n */\n\n /**\n * Returns a list of project files. To add a file to this list, create a `project` permission\n * on the file using {@link File.createPermission | File.createPermission()}.\n */\n getFilesInformation(): Promise<any[]> {\n return this.httpClient\n .get(`/bcf/3.0/projects/${this.data.id}/files_information`)\n .then((response) => response.json())\n .then((items) => {\n items.forEach((item) => {\n const getFieldValue = (displayName: string) => {\n return (item.display_information.find((x) => x.field_display_name === displayName) || {}).field_value;\n };\n\n const previewUrl = `${this.httpClient.serverUrl}/files/${item.file.reference}/preview`;\n const ownerAvatarUrl = `${this.httpClient.serverUrl}/users/${getFieldValue(\"Owner\")}/avatar`;\n\n const ownerFirstName = getFieldValue(\"Owner First Name\");\n const ownerLastName = getFieldValue(\"Owner Last Name\");\n const ownerUserName = getFieldValue(\"Owner User Name\");\n const ownerFullName = userFullName(ownerFirstName, ownerLastName, ownerUserName);\n const ownerInitials = userInitials(ownerFullName);\n\n item.display_information.push({ field_display_name: \"Preview URL\", field_value: previewUrl });\n item.display_information.push({ field_display_name: \"Owner Avatar URL\", field_value: ownerAvatarUrl });\n item.display_information.push({ field_display_name: \"Owner Full Name\", field_value: ownerFullName });\n item.display_information.push({ field_display_name: \"Owner Initials\", field_value: ownerInitials });\n\n // updatedBy since 24.10\n\n const updatedByAvatarUrl = `${this.httpClient.serverUrl}/users/${getFieldValue(\"Updated By\")}/avatar`;\n\n const updatedByFirstName = getFieldValue(\"Updated By First Name\");\n const updatedByLastName = getFieldValue(\"Updated By Last Name\");\n const updatedByUserName = getFieldValue(\"Updated By User Name\");\n const updatedByFullName = userFullName(updatedByFirstName, updatedByLastName, updatedByUserName);\n const updatedByInitials = userInitials(updatedByFullName);\n\n item.display_information.push({\n field_display_name: \"Updated By Avatar URL\",\n field_value: updatedByAvatarUrl,\n });\n item.display_information.push({ field_display_name: \"Updated By Full Name\", field_value: updatedByFullName });\n item.display_information.push({ field_display_name: \"Updated By Initials\", field_value: updatedByInitials });\n\n // geometryType since 24.12\n\n const geometry = getFieldValue(\"Geometry Status\");\n const geometryGltf = getFieldValue(\"GeometryGltf Status\");\n const geometryType = geometry === \"done\" ? \"vsfx\" : geometryGltf === \"done\" ? \"gltf\" : \"\";\n\n item.display_information.push({ field_display_name: \"Geometry Type\", field_value: geometryType });\n });\n return items;\n });\n }\n}\n","///////////////////////////////////////////////////////////////////////////////\n// Copyright (C) 2002-2024, Open Design Alliance (the \"Alliance\").\n// All rights reserved.\n//\n// This software and its documentation and related materials are owned by\n// the Alliance. The software may only be incorporated into application\n// programs owned by members of the Alliance, subject to a signed\n// Membership Agreement and Supplemental Software License Agreement with the\n// Alliance. The structure and organization of this software are the valuable\n// trade secrets of the Alliance and its suppliers. The software is also\n// protected by copyright law and international treaty provisions. Application\n// programs incorporating this software must include the following statement\n// with their copyright notices:\n//\n// This application incorporates Open Design Alliance software pursuant to a\n// license agreement with Open Design Alliance.\n// Open Design Alliance Copyright (C) 2002-2024 by Open Design Alliance.\n// All rights reserved.\n//\n// By use of this software, its documentation or related materials, you\n// acknowledge and accept the above terms.\n///////////////////////////////////////////////////////////////////////////////\n\nimport { IHttpClient } from \"./IHttpClient\";\nimport { FetchError } from \"./FetchError\";\nimport { userFullName, userInitials } from \"./Utils\";\n\n/**\n * Provides properties and methods for obtaining information about a server user and manage its data.\n */\nexport class User {\n private _data: any;\n public httpClient: IHttpClient;\n\n /**\n * @param data - Raw user data received from the server.\n * @param httpClient - HTTP client instance used to send REST API requests to the server.\n */\n constructor(data: any, httpClient: IHttpClient) {\n this.httpClient = httpClient;\n this.data = data;\n }\n\n /**\n * User avatar image URL or empty string if the user does not have an avatar. Use\n * {@link setAvatar | setAvatar()} to change avatar image.\n *\n * @readonly\n */\n get avatarUrl(): string {\n return this._data.avatarUrl;\n }\n\n /**\n * `true` if user is allowed to create a projects.\n *\n * Only administrators can change create project permission.\n */\n get canCreateProject(): boolean {\n return this.data.canCreateProject;\n }\n\n set canCreateProject(value: boolean) {\n this._data.canCreateProject = value;\n }\n\n /**\n * Account registration time (UTC) in the format specified in\n * {@link https://www.wikipedia.org/wiki/ISO_8601 | ISO 8601}.\n *\n * @readonly\n */\n get createAt(): string {\n return this.data.createAt;\n }\n\n /**\n * User custom fields object, to store custom data.\n */\n get customFields(): any {\n return this.data.customFields;\n }\n\n set customFields(value: any) {\n this._data.customFields = value;\n }\n\n /**\n * Raw user data received from the server.\n *\n * @readonly\n */\n\n get data(): any {\n return this._data;\n }\n\n private set data(value: any) {\n this._data = value;\n this._data.avatarUrl = value.avatarImage\n ? `${this.httpClient.serverUrl}/users/${this._data.id}/avatar?updated=${value.lastModified}`\n : \"\";\n this._data.fullName = userFullName(this._data);\n this._data.initials = userInitials(this._data.fullName);\n }\n\n /**\n * User email.\n */\n get email(): string {\n return this.data.email;\n }\n\n set email(value: string) {\n this._data.email = value;\n }\n\n /**\n * The user's email confirmation code, or an empty string if the email has already been confirmed.\n *\n * @readonly\n */\n get emailConfirmationId(): string {\n return this.data.emailConfirmationId;\n }\n\n /**\n * First name.\n */\n get firstName(): string {\n return this.data.firstName;\n }\n\n set firstName(value: string) {\n this._data.firstName = value;\n }\n\n /**\n * Full name. Returns the user's first and last name. If first name and last names are empty,\n * returns the user name.\n *\n * @readonly\n */\n get fullName(): string {\n return this.data.fullName;\n }\n\n /**\n * Unique user ID.\n *\n * @readonly\n */\n get id(): string {\n return this.data.id;\n }\n\n /**\n * User initials. Returns a first letters of the user's first and last names. If first name\n * and last names are empty, returns the first letter of the user name.\n *\n * @readonly\n */\n get initials(): string {\n return this.data.initials;\n }\n\n /**\n * `true` if user is an administrator.\n *\n * Only administrators can change user type.\n */\n get isAdmin(): boolean {\n return this.data.isAdmin;\n }\n\n set isAdmin(value: boolean) {\n this._data.isAdmin = value;\n }\n\n /**\n * `false` if the user has not yet confirmed his email address.\n *\n * @readonly\n */\n get isEmailConfirmed(): boolean {\n return this.data.isEmailConfirmed;\n }\n\n /**\n * User last update time (UTC) in the format specified in\n * {@link https://www.wikipedia.org/wiki/ISO_8601 | ISO 8601}.\n */\n get lastModified(): string {\n return this.data.lastModified;\n }\n\n /**\n * Last name.\n */\n get lastName(): string {\n return this.data.lastName;\n }\n\n set lastName(value: string) {\n this._data.lastName = value;\n }\n\n /**\n * User last sign in time (UTC) in the format specified in\n * {@link https://www.wikipedia.org/wiki/ISO_8601 | ISO 8601}.\n */\n get lastSignIn(): string {\n return this.data.lastSignIn;\n }\n\n /**\n * The maximum number of projects that a user can create.\n *\n * Only administrators can change projects limit.\n */\n get projectsLimit(): number {\n return this.data.projectsLimit;\n }\n\n set projectsLimit(value: number) {\n this._data.projectsLimit = value;\n }\n\n /**\n * The identity provider used to create the account. Can be `ldap`, `oauth`, `saml` or empty\n * for local accounts.\n *\n * @readonly\n */\n get providerType(): string {\n return this.data.providerType;\n }\n\n /**\n * User storage size on the server for uploading files.\n *\n * Only administrators can change storage size.\n */\n get storageLimit(): number {\n return this.data.storageLimit;\n }\n\n set storageLimit(value: number) {\n this._data.storageLimit = value;\n }\n\n /**\n * The total size of the user's files in the storage.\n *\n * @readonly\n */\n get storageUsed(): number {\n return this.data.storageUsed;\n }\n\n /**\n * The user's access token (API key). Use\n * {@link Client.signInWithToken | Client.signInWithToken()} to sign in to the server using this token.\n *\n * @readonly\n */\n get token(): string {\n return this.data.tokenInfo.token;\n }\n\n /**\n * User name.\n */\n get userName(): string {\n return this.data.userName;\n }\n\n set userName(value: string) {\n this._data.userName = value;\n }\n\n /**\n * Reloads user data from the server.\n *\n * Only administrators can checkout other users. If the current logged in user is not an\n * administrator, they can only checkout themselves, otherwise an exception will be thrown.\n */\n async checkout(): Promise<this> {\n if (this.httpClient.signInUserIsAdmin) {\n const response = await this.httpClient.get(`/users/${this.id}`);\n const data = await response.json();\n this.data = { id: data.id, ...data.userBrief };\n } else if (this.id === this.httpClient.signInUserId) {\n const response = await this.httpClient.get(\"/user\");\n const data = await response.json();\n this.data = { id: this.id, ...data };\n } else {\n return Promise.reject(new FetchError(403));\n }\n return this;\n }\n\n /**\n * Updates user data on the server.\n *\n * Only administrators can update other users. If the current logged in user is not an\n * administrator, they can only update themself, otherwise an exception will be thrown.\n *\n * @param data - Raw user data.\n */\n async update(data: any): Promise<this> {\n if (this.httpClient.signInUserIsAdmin) {\n const response = await this.httpClient.put(`/users/${this.id}`, { isAdmin: data.isAdmin, userBrief: data });\n const newData = await response.json();\n this.data = { id: newData.id, ...newData.userBrief };\n } else if (this.id === this.httpClient.signInUserId) {\n const response = await this.httpClient.put(\"/user\", data);\n const newData = await response.json();\n this.data = { id: this.id, ...newData };\n } else {\n return Promise.reject(new FetchError(403));\n }\n return this;\n }\n\n /**\n * Deletes a user from the server.\n *\n * Only administrators can delete users. If the current logged in user is not an\n * administrator, an exception will be thrown.\n *\n * Administrators can delete themselves or other administrators. An administrator can only\n * delete themself if they is not the last administrator.\n *\n * You need to re-login after deleting the current logged in user.\n *\n * @returns Returns the raw data of a deleted user.\n */\n delete(): Promise<any> {\n if (this.httpClient.signInUserIsAdmin) {\n return this.httpClient\n .delete(`/users/${this.id}`)\n .then((response) => response.json())\n .then((data) => {\n if (this.id === this.httpClient.signInUserId) {\n this.httpClient.headers = {};\n this.httpClient.signInUserId = \"\";\n this.httpClient.signInUserIsAdmin = false;\n }\n return data;\n });\n } else {\n return Promise.reject(new FetchError(403));\n }\n }\n\n /**\n * Saves user properties changes to the server. Call this method to update user data on the\n * server after any property changes.\n */\n save(): Promise<this> {\n return this.update(this.data);\n }\n\n /**\n * Sets or removes the user avatar.\n *\n * Only administrators can set the avatar of other users. If the current logged in user is\n * not an administrator, they can only set their avatar, otherwise an exception will be thrown.\n *\n * @param image - Avatar image. Can be a\n * {@link https://developer.mozilla.org/docs/Web/HTTP/Basics_of_HTTP/Data_URIs | Data URL}\n * string,\n * {@link https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer | ArrayBuffer},\n * {@link https://developer.mozilla.org/docs/Web/API/Blob/Blob | Blob} or\n * {@link https://developer.mozilla.org/docs/Web/API/File | Web API File} object. Setting\n * the `image` to `null` will remove the avatar.\n */\n async setAvatar(image?: BodyInit | null): Promise<this> {\n if (!image) {\n await this.deleteAvatar();\n } else if (this.httpClient.signInUserIsAdmin) {\n const response = await this.httpClient.post(`/users/${this.id}/avatar`, image);\n const data = await response.json();\n this.data = { id: data.id, ...data.userBrief };\n } else if (this.id === this.httpClient.signInUserId) {\n const response = await this.httpClient.post(\"/user/avatar\", image);\n const data = await response.json();\n this.data = { id: this.id, ...data };\n } else {\n return Promise.reject(new FetchError(403));\n }\n return this;\n }\n\n /**\n * Removes the user avatar.\n *\n * Only administrators can remove the avatar of other users. If the current logged in user is\n * not an administrator, they can only remove their avatar, otherwise an exception will be thrown.\n */\n async deleteAvatar(): Promise<this> {\n if (this.httpClient.signInUserIsAdmin) {\n const response = await this.httpClient.delete(`/users/${this.id}/avatar`);\n const data = await response.json();\n this.data = { id: data.id, ...data.userBrief };\n } else if (this.id === this.httpClient.signInUserId) {\n const response = await this.httpClient.delete(\"/user/avatar\");\n const data = await response.json();\n this.data = { id: this.id, ...data };\n } else {\n return Promise.reject(new FetchError(403));\n }\n return this;\n }\n\n /**\n * Changes the user password.\n *\n * Only administrators can change the passwords of other users. If the current logged in user\n * is not an administrator, they can only change their password, otherwise an exception will\n * be thrown.\n *\n * To change their password, non-administrator users must specify their old password.\n *\n * @param newPassword - New user password.\n * @param oldPassword - Old user password. Only required for non-administrator users to\n * change their password.\n */\n async changePassword(newPassword: string, oldPassword?: string): Promise<this> {\n if (this.httpClient.signInUserIsAdmin) {\n const response = await this.httpClient.put(`/users/${this.id}/password`, { new: newPassword });\n const data = await response.json();\n this.data = { id: data.id, ...data.userBrief };\n } else if (this.id === this.httpClient.signInUserId) {\n const response = await this.httpClient.put(\"/user/password\", { old: oldPassword, new: newPassword });\n const data = await response.json();\n this.data = { id: this.id, ...data };\n } else {\n return Promise.reject(new FetchError(403));\n }\n return this;\n }\n}\n","///////////////////////////////////////////////////////////////////////////////\n// Copyright (C) 2002-2024, Open Design Alliance (the \"Alliance\").\n// All rights reserved.\n//\n// This software and its documentation and related materials are owned by\n// the Alliance. The software may only be incorporated into application\n// programs owned by members of the Alliance, subject to a signed\n// Membership Agreement and Supplemental Software License Agreement with the\n// Alliance. The structure and organization of this software are the valuable\n// trade secrets of the Alliance and its suppliers. The software is also\n// protected by copyright law and international treaty provisions. Application\n// programs incorporating this software must include the following statement\n// with their copyright notices:\n//\n// This application incorporates Open Design Alliance software pursuant to a\n// license agreement with Open Design Alliance.\n// Open Design Alliance Copyright (C) 2002-2024 by Open Design Alliance.\n// All rights reserved.\n//\n// By use of this software, its documentation or related materials, you\n// acknowledge and accept the above terms.\n///////////////////////////////////////////////////////////////////////////////\n\nimport { EventEmitter2 } from \"@inweb/eventemitter2\";\n\nimport { IHttpClient } from \"./IHttpClient\";\nimport { HttpClient } from \"./HttpClient\";\nimport { FetchError } from \"./FetchError\";\nimport { ClientEventMap } from \"./ClientEvents\";\nimport { Assembly } from \"./Assembly\";\nimport { File } from \"./File\";\nimport { Job } from \"./Job\";\nimport { Project } from \"./Project\";\nimport { User } from \"./User\";\nimport { parseArgs } from \"./Utils\";\n\n/**\n * Provides methods for managing server resources such as users, files, assemblies, jobs, projects, etc.\n */\nexport class Client extends EventEmitter2<ClientEventMap> {\n private _serverUrl = \"\";\n private _httpClient: IHttpClient = new HttpClient(\"\");\n private _user: User | null = null;\n public eventEmitter: EventEmitter2 = this;\n\n /**\n * @param params - An object containing client configuration parameters.\n * @param params.serverUrl - Open Cloud Server REST API base URL.\n * @param params.url - Deprecated since `25.8`. Use `serverUrl` instead.\n */\n constructor(params: { serverUrl?: string; url?: string } = {}) {\n super();\n this.configure(params);\n }\n\n /**\n * Open Cloud Server REST API base URL. Use {@link configure | configure()} to change server URL.\n *\n * @readonly\n */\n get serverUrl(): string {\n return this._serverUrl;\n }\n\n /**\n * HTTP client instance used to send REST API requests and receive responses from the server.\n *\n * @readonly\n */\n get httpClient(): IHttpClient {\n return this._httpClient;\n }\n\n /**\n * Deprecated since `25.3`. Use `Viewer.options()` instead to change `Viewer` parameters.\n *\n * @deprecated\n */\n get options(): any {\n console.warn(\n \"Client.options has been deprecated since 25.3 and will be removed in a future release, use Viewer.options instead.\"\n );\n const data = {\n showWCS: true,\n cameraAnimation: true,\n antialiasing: true,\n groundShadow: false,\n shadows: false,\n cameraAxisXSpeed: 4,\n cameraAxisYSpeed: 1,\n ambientOcclusion: false,\n enableStreamingMode: true,\n enablePartialMode: false,\n memoryLimit: 3294967296,\n cuttingPlaneFillColor: { red: 0xff, green: 0x98, blue: 0x00 },\n edgesColor: { r: 0xff, g: 0x98, b: 0x00 },\n facesColor: { r: 0xff, g: 0x98, b: 0x00 },\n edgesVisibility: true,\n edgesOverlap: true,\n facesOverlap: false,\n facesTransparancy: 200,\n enableCustomHighlight: true,\n sceneGraph: false,\n edgeModel: true,\n reverseZoomWheel: false,\n enableZoomWheel: true,\n enableGestures: true,\n };\n return {\n ...data,\n data,\n defaults: () => data,\n resetToDefaults: () => {},\n saveToStorage: () => {},\n loadFromStorage: () => {},\n };\n }\n\n /**\n * Changes the client parameters.\n *\n * After changing the parameters, you must re-login.\n *\n * @param params - An object containing new parameters.\n * @param params.serverUrl - Open Cloud Server REST API base URL.\n */\n configure(params: { serverUrl?: string }): this {\n this._serverUrl = (params.serverUrl || \"\").replace(/\\/+$/, \"\");\n this._httpClient = new HttpClient(this.serverUrl);\n this._user = null;\n return this;\n }\n\n /**\n * The Object represents server version information.\n *\n * @typedef {any} VersionResult\n * @property {string} version - The server version.\n * @property {string} hash - Build hash.\n */\n\n /**\n * Returns client and server versions.\n */\n version(): Promise<any> {\n return this.httpClient\n .get(\"/version\")\n .then((response) => response.json())\n .then((data) => ({\n ...data,\n server: data.version,\n client: \"CLIENT_JS_VERSION\",\n }));\n }\n\n /**\n * Registers a new user on the server.\n *\n * @param email - User email. Cannot be empty. Must be unique within the server.\n * @param password - User password. Cannot be empty. Password can only contain letters (a-z,\n * A-Z), numbers (0-9), and special characters (~!@#$%^&*()_-+={}[]<>|/'\":;.,?).\n * @param userName - User name. Cannot be empty or blank if defined. this to `undefined` to\n * use `username` from email.\n */\n registerUser(email: string, password: string, userName?: string): Promise<any> {\n return this.httpClient\n .post(\"/register\", {\n email,\n password,\n userName: userName ?? (email + \"\").split(\"@\").at(0),\n })\n .then((response) => response.json());\n }\n\n /**\n * Resends a Confirmation Email to the new user. If the user's email is already confirmed, an\n * exception will be thrown.\n *\n * @param email - User email.\n * @param password - User password.\n */\n resendConfirmationEmail(email: string, password: string): Promise<any> {\n return this.httpClient\n .post(\"/register/email-confirmation\", { email, password })\n .then((response) => response.json());\n }\n\n /**\n * Marks the user's email address as confirmed. If the user's email is already confirmed, an\n * exception will be thrown.\n *\n * @param emailConfirmationId - Confirmation code from the Confirmation Email.\n */\n confirmUserEmail(emailConfirmationId: string): Promise<any> {\n return this.httpClient\n .get(`/register/email-confirmation/${emailConfirmationId}`)\n .then((response) => response.json());\n }\n\n /**\n * Log in an existing user using email or user name.\n *\n * @param email - An email or user name for authentication request.\n * @param password - Password for authentication request.\n */\n async signInWithEmail(email: string, password: string): Promise<User> {\n const credentials = btoa(unescape(encodeURIComponent(email + \":\" + password)));\n this.httpClient.headers = { Authorization: \"Basic \" + credentials };\n const response = await this.httpClient.get(\"/token\");\n const data = await response.json();\n return this.setCurrentUser(data);\n }\n\n /**\n * Log in an existing user using access token (API Key).\n *\n * @param token - An access token for authentication request. See {@link User.token} for more details.\n */\n async signInWithToken(token: string): Promise<User> {\n this.httpClient.headers = { Authorization: token };\n const response = await this.httpClient.get(\"/user\");\n const data = await response.json();\n return this.setCurrentUser(data);\n }\n\n // Save the current logged in user information for internal use.\n\n private setCurrentUser(data: any): User {\n this._user = new User(data, this.httpClient);\n this.httpClient.headers = { Authorization: data.tokenInfo.token };\n this.httpClient.signInUserId = this._user.id;\n this.httpClient.signInUserIsAdmin = this._user.isAdmin;\n return this._user;\n }\n\n private clearCurrentUser(): void {\n this._user = null;\n this.httpClient.headers = {};\n this.httpClient.signInUserId = \"\";\n this.httpClient.signInUserIsAdmin = false;\n }\n\n /**\n * Returns the current logged in user. Returns `null` if the user is not logged in or the\n * logged in user has deleted themself.\n */\n getCurrentUser(): User | null {\n if (this._user && !this.httpClient.signInUserId) this._user = null;\n return this._user;\n }\n\n /**\n * Returns the list of server enabled indentity providers.\n */\n getIdentityProviders(): Promise<any> {\n return this.httpClient.get(\"/identity\").then((response) => response.json());\n }\n\n /**\n * Returns the current server settings.\n */\n getServerSettings(): Promise<any> {\n return this.httpClient.get(\"/settings\").then((response) => response.json());\n }\n\n /**\n * Changes the server settings.\n *\n * Only administrators can change server settings. If the current logged in user is not an\n * administrator, an exception will be thrown.\n */\n updateServerSettings(settings: any): Promise<any> {\n return this.httpClient.put(\"/settings\", settings).then((response) => response.json());\n }\n\n /**\n * Returns the list of server users.\n *\n * Only administrators can get a list of users. If the current logged in user is not an\n * administrator, an exception will be thrown.\n */\n getUsers(): Promise<User[]> {\n return this.httpClient\n .get(\"/users\")\n .then((response) => response.json())\n .then((array) => array.map((data) => ({ id: data.id, ...data.userBrief })))\n .then((array) => array.map((data) => new User(data, this.httpClient)));\n }\n\n /**\n * Returns information about the specified user.\n *\n * Only administrators can get other users. If the current logged in user is not an\n * administrator, they can only get themselves, otherwise an exception will be thrown.\n *\n * @param userId - User ID.\n */\n getUser(userId: string): Promise<User> {\n if (this.httpClient.signInUserIsAdmin) {\n return this.httpClient\n .get(`/users/${userId}`)\n .then((response) => response.json())\n .then((data) => ({ id: data.id, ...data.userBrief }))\n .then((data) => new User(data, this.httpClient));\n } else if (userId === this.httpClient.signInUserId) {\n return this.httpClient\n .get(\"/user\")\n .then((response) => response.json())\n .then((data) => ({ id: userId, ...data }))\n .then((data) => new User(data, this.httpClient));\n } else {\n return Promise.reject(new FetchError(403));\n }\n }\n\n /**\n * Creates a new user on the server.\n *\n * Only administrators can create users. If the current logged in user is not an\n * administrator, an exception will be thrown.\n *\n * @param email - User email. Cannot be empty. Must be unique within the server.\n * @param password - User password. Cannot be empty. Password can only contain latin letters\n * (a-z, A-Z), numbers (0-9), and special characters (~!@#$%^&*()_-+={}[]<>|/'\":;.,?).\n * @param params - Additional user data.\n * @param params.isAdmin - `true` if user is an administrator.\n * @param params.userName - User name. Cannot be empty or blank if defined. Specify\n * `undefined` to use `username` from email.\n * @param params.firstName - First name.\n * @param params.lastName - Last name.\n * @param params.canCreateProject - `true` if user is allowed to create a project.\n * @param params.projectsLimit - The maximum number of projects that the user can create.\n * @param params.storageLimit - The size of the file storage available to the user in bytes.\n */\n createUser(\n email: string,\n password: string,\n params: {\n isAdmin?: boolean;\n userName?: string;\n firstName?: string;\n lastName?: string;\n canCreateProject?: boolean;\n projectsLimit?: number;\n storageLimit?: number;\n } = {}\n ): Promise<User> {\n const { isAdmin, userName, ...rest } = params;\n return this.httpClient\n .post(\"/users\", {\n isAdmin,\n userBrief: {\n ...rest,\n email,\n userName: userName ?? (email + \"\").split(\"@\").at(0),\n },\n password,\n })\n .then((response) => response.json())\n .then((data) => ({ id: data.id, ...data.userBrief }))\n .then((data) => new User(data, this.httpClient));\n }\n\n /**\n * Deletes the specified user from the server.\n *\n * Only administrators can delete users. If the current logged in user is not an\n * administrator, an exception will be thrown.\n *\n * Administrators can delete themselves or other administrators. An administrator can only\n * delete themself if they is not the last administrator.\n *\n * You need to re-login after deleting the current logged in user.\n *\n * @param userId - User ID.\n * @returns Returns the raw data of a deleted user.\n */\n deleteUser(userId: string): Promise<any> {\n if (this.httpClient.signInUserIsAdmin) {\n return this.httpClient\n .delete(`/users/${userId}`)\n .then((response) => response.json())\n .then((data) => {\n if (userId === this.httpClient.signInUserId) {\n this.clearCurrentUser();\n }\n return data;\n });\n } else {\n return Promise.reject(new FetchError(403));\n }\n }\n\n /**\n * Result for file list.\n *\n * @typedef {any} FilesResult\n * @property {number} allSize - Total number of files the user has access to.\n * @property {number} start - The starting index in the file list in the request.\n * @property {number} limit - The maximum number of requested files.\n * @property {File[]} result - Result file list.\n * @property {number} size - The number of files in the result list.\n */\n\n /**\n * Returns a list of files that the current logged in user has uploaded to the server or has access to.\n *\n * @param start - The starting index in the file list. Used for paging.\n * @param limit - The maximum number of files that should be returned per request. Used for paging.\n * @param name - Filter the files by part of the name. Case sensitive.\n * @param ext - Filter the files by extension. Extension can be `dgn`, `dwf`, `dwg`, `dxf`,\n * `ifc`, `ifczip`, `nwc`, `nwd`, `obj`, `rcs`, `rfa`, `rvt`, `step`, `stl`, `stp`, `vsf`,\n * or any other file type extension.\n * @param ids - List of file IDs to return.\n * @param sortByDesc - Allows to specify the descending order of the result. By default,\n * files are sorted by name in ascending order.\n * @param {string} sortField - Allows to specify sort field.\n */\n getFiles(\n start?: number,\n limit?: number,\n name?: string,\n ext?: string | string[],\n ids?: string | string[],\n sortByDesc?: boolean,\n sortField?: string\n ): Promise<{ allSize: number; start: number; limit: number; result: File[]; size: number }> {\n const searchParams = new URLSearchParams();\n if (start > 0) searchParams.set(\"start\", start.toString());\n if (limit > 0) searchParams.set(\"limit\", limit.toString());\n if (name) searchParams.set(\"name\", name);\n if (ext) {\n if (Array.isArray(ext)) ext = ext.join(\"|\");\n if (typeof ext === \"string\") ext = ext.toLowerCase();\n if (ext) searchParams.set(\"ext\", ext);\n }\n if (ids) {\n if (Array.isArray(ids)) ids = ids.join(\"|\");\n searchParams.set(\"id\", ids);\n }\n if (sortByDesc !== undefined) searchParams.set(\"sortBy\", sortByDesc ? \"desc\" : \"asc\");\n if (sortField) searchParams.set(\"sortField\", sortField);\n\n let queryString = searchParams.toString();\n if (queryString) queryString = \"?\" + queryString;\n\n return this.httpClient\n .get(`/files${queryString}`)\n .then((response) => response.json())\n .then((files) => {\n return {\n ...files,\n result: files.result.map((data) => new File(data, this.httpClient)),\n };\n });\n }\n\n /**\n * Returns information about the specified file.\n *\n * @param fileId - File ID.\n */\n getFile(fileId: string): Promise<File> {\n return this.httpClient\n .get(`/files/${fileId}`)\n .then((response) => response.json())\n .then((data) => new File(data, this.httpClient));\n }\n\n /**\n * Upload a drawing or reference file to the server.\n *\n * Fires:\n *\n * - {@link UploadProgressEvent | uploadprogress}\n *\n * @param file - {@link https://developer.mozilla.org/docs/Web/API/File | Web API File} object\n * are generally retrieved from a\n * {@link https://developer.mozilla.org/docs/Web/API/FileList | FileList} object returned as\n * a result of a user selecting files using the HTML `<input>` element.\n * @param params - An object containing upload parameters.\n * @param params.geometry - Create job to convert file geometry data. Can be:\n *\n * - `true` - Convert file geometry data to `VSFX` format to open the file in `VisualizeJS` viewer.\n * - `vsfx` - Convert file geometry data to `VSFX` format to open the file in `VisualizeJS` viewer.\n * - `gltf` - Convert file geometry data to `glTF` format to open the file in `Three.js` viewer.\n *\n * @param params.properties - Create job to extract file properties.\n * @param params.waitForDone - Wait for geometry and properties jobs to complete.\n * @param params.timeout - The time, in milliseconds that the function should wait jobs. If\n * no one jobs are done during this time, the `TimeoutError` exception will be thrown.\n * @param params.interval - The time, in milliseconds, the function should delay in between\n * checking jobs status.\n * @param params.signal - An\n * {@link https://developer.mozilla.org/docs/Web/API/AbortController | AbortController}\n * signal, which can be used to abort waiting as desired.\n * @param params.onProgress - Upload progress callback.\n */\n async uploadFile(\n file: globalThis.File,\n params: {\n geometry?: boolean | string;\n properties?: boolean;\n waitForDone?: boolean;\n timeout?: number;\n interval?: number;\n signal?: AbortSignal;\n onProgress?: (progress: number, file: globalThis.File) => void;\n } = {\n geometry: true,\n properties: false,\n waitForDone: false,\n }\n ): Promise<File> {\n const result = await this.httpClient\n .uploadFile(\"/files\", file, (progress) => {\n this.emitEvent({ type: \"uploadprogress\", data: progress, file });\n params.onProgress?.(progress, file);\n })\n .then((xhr: XMLHttpRequest) => JSON.parse(xhr.responseText))\n .then((data) => new File(data, this.httpClient));\n\n const geometryType = typeof params.geometry === \"string\" ? params.geometry : \"vsfx\";\n\n const jobs: string[] = [];\n if (params.geometry) jobs.push((await result.extractGeometry(geometryType)).outputFormat);\n if (params.properties) jobs.push((await result.extractProperties()).outputFormat);\n if (jobs.length > 0)\n if (params.waitForDone) await result.waitForDone(jobs, true, params);\n else await result.checkout();\n\n return result;\n }\n\n /**\n * Deletes the specified file and all its versions from the server.\n *\n * You cannot delete a version file using `deleteFile()`, only the original file. To delete a\n * version file use {@link File.deleteVersion | File.deleteVersion()}.\n *\n * @param fileId - File ID.\n * @returns Returns the raw data of a deleted file.\n */\n deleteFile(fileId: string): Promise<any> {\n return this.httpClient.delete(`/files/${fileId}`).then((response) => response.json());\n }\n\n /**\n * Downloads the specified file from the server.\n *\n * @param fileId - File ID.\n * @param onProgress - Download progress callback.\n * @param signal - An\n * {@link https://developer.mozilla.org/docs/Web/API/AbortController | AbortController}\n * signal. Allows to communicate with a fetch request and abort it if desired.\n */\n downloadFile(fileId: string, onProgress?: (progress: number) => void, signal?: AbortSignal): Promise<ArrayBuffer> {\n return this.httpClient\n .downloadFile(`/files/${fileId}/downloads`, onProgress, signal)\n .then((response) => response.arrayBuffer());\n }\n\n /**\n * Result for job list.\n *\n * @typedef {any} JobsResult\n * @property {number} allSize - Total number of jobs created by the user.\n * @property {number} start - The starting index in the job list in the request.\n * @property {number} limit - The maximum number of requested jobs.\n * @property {Job[]} result - Result job list.\n * @property {number} size - The number of jobs in the result list.\n */\n\n /**\n * Returns a list of jobs started by the current logged in user.\n *\n * @param status - Filter the jobs by status. Status can be `waiting`, `inpogress`, `done` or `failed`.\n * @param limit - The maximum number of jobs that should be returned per request. Used for paging.\n * @param start - The starting index in the job list. Used for paging.\n * @param sortByDesc - Allows to specify the descending order of the result. By default, jobs\n * are sorted by creation time in ascending order.\n * @param {boolean} sortField - Allows to specify sort field.\n */\n getJobs(\n status?: string | string[],\n limit?: number,\n start?: number,\n sortByDesc?: boolean,\n sortField?: string\n ): Promise<{ allSize: number; start: number; limit: number; result: Job[]; size: number }> {\n const searchParams = new URLSearchParams();\n if (start > 0) searchParams.set(\"start\", start.toString());\n if (limit > 0) searchParams.set(\"limit\", limit.toString());\n if (status) {\n if (Array.isArray(status)) status = status.join(\"|\");\n if (typeof status === \"string\") status = status.trim().toLowerCase();\n if (status) searchParams.set(\"status\", status);\n }\n if (sortByDesc !== undefined) searchParams.set(\"sortBy\", sortByDesc ? \"desc\" : \"asc\");\n if (sortField) searchParams.set(\"sortField\", sortField);\n\n let queryString = searchParams.toString();\n if (queryString) queryString = \"?\" + queryString;\n\n return this.httpClient\n .get(`/jobs${queryString}`)\n .then((response) => response.json())\n .then((jobs) => ({\n ...jobs,\n result: jobs.result.map((data) => new Job(data, this.httpClient)),\n }));\n }\n\n /**\n * Returns information about the specified job.\n *\n * @param jobId - Job ID.\n */\n getJob(jobId: string): Promise<Job> {\n return this.httpClient\n .get(`/jobs/${jobId}`)\n .then((response) => response.json())\n .then((data) => new Job(data, this.httpClient));\n }\n\n /**\n * Runs a new job on the server for the sepecified file.\n *\n * @param fileId - File ID.\n * @param outputFormat - The job type. Can be one of:\n *\n * - `geometry` - Convert file geometry data to `VSFX` format suitable for `VisualizeJS` viewer.\n * - `geometryGltf` - Convert file geometry data to `glTF` format suitable for `Three.js` viewer.\n * - `properties` - Extract file properties.\n * - `validation` - Validate the file. Only for `IFC` files.\n * - `dwg`, `obj`, `gltf`, `glb`, `vsf`, `pdf`, `3dpdf` - Export file to the one of the supported format.\n * - Other custom job name. Custom job runner must be registered in the job templates table\n * before creating a job.\n *\n * @param parameters - Parameters for the job runner. Can be given as command line arguments\n * for the File Converter tool in form `--arg=value`.\n */\n createJob(fileId: string, outputFormat: string, parameters?: string | object): Promise<Job> {\n return this.httpClient\n .post(\"/jobs\", {\n fileId,\n outputFormat,\n parameters: parseArgs(parameters),\n })\n .then((response) => response.json())\n .then((data) => new Job(data, this.httpClient));\n }\n\n /**\n * Deletes the specified job from the server job list. Jobs that are in progress or have\n * already been completed cannot be deleted.\n *\n * @param jobId - Job ID.\n * @returns Returns the raw data of a deleted job.\n */\n deleteJob(jobId: string): Promise<any> {\n return this.httpClient.delete(`/jobs/${jobId}`).then((response) => response.json());\n }\n\n /**\n * Result for assembly list.\n *\n * @typedef {any} AssembliesResult\n * @property {number} allSize - Total number of assemblies the user has access to.\n * @property {number} start - The starting index in the assembly list in the request.\n * @property {number} limit - The maximum number of requested assemblies.\n * @property {Assembly[]} result - Result assembly list.\n * @property {number} size - The number of assemblies in the result list.\n */\n\n /**\n * Returns a list of assemblies created by the current logged in user.\n *\n * @param start - The starting index in the assembly list. Used for paging.\n * @param limit - The maximum number of assemblies that should be returned per request. Used\n * for paging.\n * @param name - Filter the assemblies by part of the name. Case sensitive.\n * @param ids - List of assembly IDs to return.\n * @param sortByDesc - Allows to specify the descending order of the result. By default\n * assemblies are sorted by name in ascending order.\n * @param sortField - Allows to specify sort field.\n */\n getAssemblies(\n start?: number,\n limit?: number,\n name?: string,\n ids?: string | string[],\n sortByDesc?: boolean,\n sortField?: string\n ): Promise<{ allSize: number; start: number; limit: number; result: Assembly[]; size: number }> {\n const searchParams = new URLSearchParams();\n if (start > 0) searchParams.set(\"start\", start.toString());\n if (limit > 0) searchParams.set(\"limit\", limit.toString());\n if (name) searchParams.set(\"name\", name);\n if (ids) {\n if (Array.isArray(ids)) ids = ids.join(\"|\");\n if (typeof ids === \"string\") ids = ids.trim();\n if (ids) searchParams.set(\"id\", ids);\n }\n if (sortByDesc !== undefined) searchParams.set(\"sortBy\", sortByDesc ? \"desc\" : \"asc\");\n if (sortField) searchParams.set(\"sortField\", sortField);\n\n let queryString = searchParams.toString();\n if (queryString) queryString = \"?\" + queryString;\n\n return this.httpClient\n .get(`/assemblies${queryString}`)\n .then((response) => response.json())\n .then((assemblies) => {\n return {\n ...assemblies,\n result: assemblies.result.map((data) => new Assembly(data, this.httpClient)),\n };\n });\n }\n\n /**\n * Returns information about the specified assembly.\n *\n * @param assemblyId - Assembly ID.\n */\n getAssembly(assemblyId: string): Promise<Assembly> {\n return this.httpClient\n .get(`/assemblies/${assemblyId}`)\n .then((response) => response.json())\n .then((data) => new Assembly(data, this.httpClient));\n }\n\n /**\n * Creates a new assembly on the server.\n *\n * @param files - List of file IDs.\n * @param name - Assembly name.\n * @param params - Additional assembly creating parameters.\n * @param params.waitForDone - Wait for assembly to be created.\n * @param params.timeout - The time, in milliseconds, that the function should wait for the\n * assembly to be created. If the assembly is not created within this time, a TimeoutError\n * exception will be thrown.\n * @param params.interval - The time, in milliseconds, the function should delay in between\n * checking assembly status.\n * @param params.signal - An\n * {@link https://developer.mozilla.org/docs/Web/API/AbortController | AbortController}\n * signal, which can be used to abort waiting as desired.\n * @param params.onCheckout - Waiting progress callback. Return `true` to cancel waiting.\n */\n createAssembly(\n files: string[],\n name: string,\n params?: {\n waitForDone?: boolean;\n timeout?: number;\n interval?: number;\n signal?: AbortSignal;\n onCheckout?: (assembly: Assembly, ready: boolean) => boolean;\n }\n ): Promise<Assembly> {\n const { waitForDone } = params ?? {};\n return this.httpClient\n .post(\"/assemblies\", { name, files })\n .then((response) => response.json())\n .then((data) => new Assembly(data, this.httpClient))\n .then((result) => (waitForDone ? result.waitForDone(params) : result));\n }\n\n /**\n * Deletes the specified assembly from the server.\n *\n * @param assemblyId - Assembly ID.\n * @returns Returns the raw data of a deleted assembly.\n */\n deleteAssembly(assemblyId: string): Promise<any> {\n return this.httpClient.delete(`/assemblies/${assemblyId}`).then((response) => response.json());\n }\n\n /**\n * Result for project list.\n *\n * @typedef {any} ProjectsResult\n * @property {number} allSize - Total number of projects the user has access to.\n * @property {number} start - The starting index in the project list in the request.\n * @property {number} limit - The maximum number of requested projects.\n * @property {Project[]} result - Result project list.\n * @property {number} size - The number of projects in the result list.\n */\n\n /**\n * Returns a list of projects that the currently logged in user has created or has access to.\n *\n * @param start - The starting index in the project list. Used for paging.\n * @param limit - The maximum number of projects that should be returned per request. Used for paging.\n * @param name - Filter the projects by part of the name. Case sensitive.\n * @param ids - List of project IDs to return.\n * @param sortByDesc - Allows to specify the descending order of the result. By default\n * projects are sorted by name in ascending order.\n */\n getProjects(\n start?: number,\n limit?: number,\n name?: string,\n ids?: string | string[],\n sortByDesc?: boolean\n ): Promise<{ allSize: number; start: number; limit: number; result: Project[]; size: number }> {\n const searchParams = new URLSearchParams();\n if (start > 0) searchParams.set(\"start\", start.toString());\n if (limit > 0) searchParams.set(\"limit\", limit.toString());\n if (name) searchParams.set(\"name\", name);\n if (ids) {\n if (Array.isArray(ids)) ids = ids.join(\"|\");\n if (typeof ids === \"string\") ids = ids.trim();\n if (ids) searchParams.set(\"id\", ids);\n }\n if (sortByDesc !== undefined) searchParams.set(\"sortBy\", sortByDesc ? \"desc\" : \"asc\");\n\n let queryString = searchParams.toString();\n if (queryString) queryString = \"?\" + queryString;\n return this.httpClient\n .get(`/projects${queryString}`)\n .then((response) => response.json())\n .then((projects) => {\n // fix for server 23.5 and below\n if (Array.isArray(projects)) {\n let result = projects;\n if (ids) result = result.filter((x) => ids.includes(x.id));\n if (name) result = result.filter((x) => x.name.includes(name));\n if (limit > 0) {\n const begin = start > 0 ? start : 0;\n result = result.slice(begin, begin + limit);\n }\n return {\n allSize: projects.length,\n start,\n limit,\n result,\n size: result.length,\n };\n }\n return projects;\n })\n .then((projects) => {\n return {\n ...projects,\n result: projects.result.map((data) => new Project(data, this.httpClient)),\n };\n });\n }\n\n /**\n * Returns information about the specified project.\n *\n * @param projectId - Project ID.\n */\n getProject(projectId: string): Promise<Project> {\n return this.httpClient\n .get(`/projects/${projectId}`)\n .then((response) => response.json())\n .then((data) => new Project(data, this.httpClient));\n }\n\n /**\n * Creates a new project on the server.\n *\n * @param name - Project name.\n * @param description - Project description.\n * @param startDate - Project start date.\n * @param endDate - Project end date.\n */\n createProject(\n name: string,\n description?: string,\n startDate?: Date | string,\n endDate?: Date | string\n ): Promise<Project> {\n return this.httpClient\n .post(\"/projects\", {\n name,\n description,\n startDate: startDate instanceof Date ? startDate.toISOString() : startDate,\n endDate: endDate instanceof Date ? endDate.toISOString() : endDate,\n })\n .then((response) => response.json())\n .then((data) => new Project(data, this.httpClient));\n }\n\n /**\n * Deletes the specified project from the server.\n *\n * @param projectId - Project ID.\n * @returns Returns the raw data of a deleted project.\n */\n deleteProject(projectId: string): Promise<any> {\n return this.httpClient\n .delete(`/projects/${projectId}`)\n .then((response) => response.text())\n .then((text) => {\n // fix for server 23.5 and below\n try {\n return JSON.parse(text);\n } catch {\n return { id: projectId };\n }\n });\n }\n}\n","///////////////////////////////////////////////////////////////////////////////\n// Copyright (C) 2002-2024, Open Design Alliance (the \"Alliance\").\n// All rights reserved.\n//\n// This software and its documentation and related materials are owned by\n// the Alliance. The software may only be incorporated into application\n// programs owned by members of the Alliance, subject to a signed\n// Membership Agreement and Supplemental Software License Agreement with the\n// Alliance. The structure and organization of this software are the valuable\n// trade secrets of the Alliance and its suppliers. The software is also\n// protected by copyright law and international treaty provisions. Application\n// programs incorporating this software must include the following statement\n// with their copyright notices:\n//\n// This application incorporates Open Design Alliance software pursuant to a\n// license agreement with Open Design Alliance.\n// Open Design Alliance Copyright (C) 2002-2024 by Open Design Alliance.\n// All rights reserved.\n//\n// By use of this software, its documentation or related materials, you\n// acknowledge and accept the above terms.\n///////////////////////////////////////////////////////////////////////////////\n\nexport { Assembly } from \"./Api/Assembly\";\nexport { Client } from \"./Api/Client\";\nexport { ClashTest } from \"./Api/ClashTest\";\nexport * from \"./Api/ClientEvents\";\nexport { File } from \"./Api/File\";\nexport { FetchError, statusText } from \"./Api/FetchError\";\nexport { Job } from \"./Api/Job\";\nexport { IModelTransformMatrix } from \"./Api/IAssembly\";\nexport { Member } from \"./Api/Member\";\nexport { Model } from \"./Api/Model\";\nexport { Permission } from \"./Api/Permission\";\nexport { Project } from \"./Api/Project\";\nexport { Role } from \"./Api/Role\";\nexport { User } from \"./Api/User\";\nexport { parseArgs, userFullName, userInitials, waitFor } from \"./Api/Utils\";\n\nexport const version = \"CLIENT_JS_VERSION\";\n"],"names":["STATUS_CODES","statusText","status","error400","text","_default","JSON","parse","description","FetchError","Error","constructor","message","super","this","name","Model","data","file","path","httpClient","_file","_data","assembly","value","database","default","fileId","geometry","id","type","version","getModels","Promise","resolve","getModelTransformMatrix","handle","setModelTransformMatrix","transform","then","getViewpoints","array","filter","custom_fields","modelId","modelName","saveViewpoint","viewpoint","deleteViewpoint","guid","getSnapshot","getSnapshotData","bitmapGuid","downloadResource","dataId","onProgress","signal","downloadResourceRange","requestId","ranges","partialDownloadResource","console","warn","downloadFileRange","records","length","map","record","begin","Number","end","reqId","i","size","get","push","delete","getReferences","delay","ms","timeoutId","abortHandler","clearTimeout","window","setTimeout","removeEventListener","addEventListener","once","async","waitFor","func","params","timeout","interval","_a","AbortController","abortError","_b","DOMException","timeoutError","_c","performance","now","count","result","aborted","reject","parseArgs","args","firstArg","indexOf","slice","argArray","split","x","y","flat","concat","Object","fromEntries","userFullName","firstName","lastName","userName","trim","userInitials","fullName","names","reduce","initials","index","charAt","toUpperCase","ClashTest","basePath","internalGet","relativePath","internalPut","body","put","internalDelete","clearance","createdAt","owner","avatarUrl","serverUrl","userId","lastModifiedAt","selectionSetA","selectionTypeA","selectionSetB","selectionTypeB","tolerance","checkout","response","json","update","save","waitForDone","checkDone","test","ready","includes","cancel","onCheckout","call","getReport","Assembly","appendVersionParam","_useVersion","undefined","delimiter","internalPost","post","activeVersion","associatedFiles","created","forEach","link","files","geometryType","originalAssemblyId","previewUrl","relatedJobs","versions","setPreview","image","deletePreview","obj","getProperties","handles","searchProperties","searchPattern","getCdaTree","viewpoints","downloadFile","arrayBuffer","references","getClashTests","start","limit","ids","sortByDesc","sortField","searchParams","URLSearchParams","set","toString","Array","isArray","join","queryString","tests","getClashTest","testId","createClashTest","deleteClashTest","updateVersion","getVersions","getVersion","deleteVersion","setActiveVersion","useVersion","EventEmitter2","_listeners","listener","listeners","removeAllListeners","emitEvent","event","invoke","on","off","emit","handleFetchError","ok","error","$fetch","url","method","headers","FormData","Blob","append","ArrayBuffer","stringify","init","fetch","handleXMLHttpError","xhr","responseText","$xmlhttp","XMLHttpRequest","open","key","setRequestHeader","calcProgress","lengthComputable","loaded","total","upload","onprogress","uploadProgress","downloadProgress","onloadend","target","send","HttpClient","signInUserId","signInUserIsAdmin","uploadFile","contentLength","parseInt","Response","ReadableStream","controller","reader","getReader","done","read","enqueue","close","rangedIndex","rangePos","chunkLeft","chunkPos","range","rangeLeft","chunk","subarray","Permission","actions","grantedTo","public","Job","assemblyId","authorId","lastUpdate","outputFormat","parameters","statusMessage","startedAt","job","File","customFields","preview","updatedAt","_o","_p","_q","state","_d","geometryStatus","_e","_r","properties","_f","propertiesStatus","_g","_s","validation","_h","validationStatus","_j","_t","updatedBy","_k","_u","_l","_v","geometryGltf","_m","_w","isFileDeleted","exports","originalFileId","sizeTotal","download","setReferences","createJob","extractGeometry","extractProperties","validate","jobs","waitAll","waitJobs","readyJobs","jobStatus","getPermissions","getPermission","permissionId","createPermission","_public","deletePermission","uploadVersion","progress","deleteSource","Role","projectId","permissions","Member","user","role","Project","authorization","endDate","Date","toISOString","memberCount","modelCount","startDate","topicCount","getRoles","getRole","createRole","deleteRole","getMembers","getMember","memberId","addMember","removeMember","getFilesInformation","items","item","getFieldValue","displayName","display_information","find","field_display_name","field_value","reference","ownerAvatarUrl","ownerFirstName","ownerLastName","ownerUserName","ownerFullName","ownerInitials","updatedByAvatarUrl","updatedByFirstName","updatedByLastName","updatedByUserName","updatedByFullName","updatedByInitials","User","canCreateProject","createAt","avatarImage","lastModified","email","emailConfirmationId","isAdmin","isEmailConfirmed","lastSignIn","projectsLimit","providerType","storageLimit","storageUsed","token","tokenInfo","userBrief","newData","setAvatar","deleteAvatar","changePassword","newPassword","oldPassword","new","old","Client","_serverUrl","_httpClient","_user","eventEmitter","configure","options","showWCS","cameraAnimation","antialiasing","groundShadow","shadows","cameraAxisXSpeed","cameraAxisYSpeed","ambientOcclusion","enableStreamingMode","enablePartialMode","memoryLimit","cuttingPlaneFillColor","red","green","blue","edgesColor","r","g","b","facesColor","edgesVisibility","edgesOverlap","facesOverlap","facesTransparancy","enableCustomHighlight","sceneGraph","edgeModel","reverseZoomWheel","enableZoomWheel","enableGestures","defaults","resetToDefaults","saveToStorage","loadFromStorage","replace","server","client","registerUser","password","at","resendConfirmationEmail","confirmUserEmail","signInWithEmail","credentials","btoa","unescape","encodeURIComponent","Authorization","setCurrentUser","signInWithToken","clearCurrentUser","getCurrentUser","getIdentityProviders","getServerSettings","updateServerSettings","settings","getUsers","getUser","createUser","rest","deleteUser","getFiles","ext","toLowerCase","getFile","deleteFile","getJobs","getJob","jobId","deleteJob","getAssemblies","assemblies","getAssembly","createAssembly","deleteAssembly","getProjects","projects","allSize","getProject","createProject","deleteProject"],"mappings":"AAuBA,MAAMA,eAAe;IACnB,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAA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