@inweb/client 25.9.5 → 25.9.6
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 +20 -5
- package/dist/client.js.map +1 -1
- package/dist/client.min.js +1 -1
- package/dist/client.module.js +8 -7
- package/dist/client.module.js.map +1 -1
- package/lib/Api/Assembly.d.ts +12 -1
- package/package.json +2 -2
- package/src/Api/Assembly.ts +21 -4
package/lib/Api/Assembly.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { IHttpClient } from "./IHttpClient";
|
|
2
|
+
import { IFileReferences } from "./IFile";
|
|
2
3
|
import { IAssociatedFileData, IAssemblyVersionInfo, IModelTransformMatrix } from "./IAssembly";
|
|
3
4
|
import { IShortUserDesc } from "./IUser";
|
|
4
5
|
import { Model } from "./Model";
|
|
@@ -245,7 +246,17 @@ export declare class Assembly {
|
|
|
245
246
|
* Deprecated since `25.3`. Use {@link downloadResourceRange | downloadResourceRange()} instead.
|
|
246
247
|
*/
|
|
247
248
|
downloadFileRange(requestId: number, records: any | null, dataId: string, onProgress?: (progress: number, chunk: Uint8Array, requestId: number) => void, signal?: AbortSignal): Promise<void>;
|
|
248
|
-
|
|
249
|
+
/**
|
|
250
|
+
* Returns a list of assembly references containing references from all the files from which
|
|
251
|
+
* the assembly was created.
|
|
252
|
+
*
|
|
253
|
+
* References are images, fonts, or any other files to correct rendering of the assembly.
|
|
254
|
+
*
|
|
255
|
+
* @param signal - An
|
|
256
|
+
* {@link https://developer.mozilla.org/docs/Web/API/AbortController | AbortController}
|
|
257
|
+
* signal, which can be used to abort waiting as desired.
|
|
258
|
+
*/
|
|
259
|
+
getReferences(signal?: AbortSignal): Promise<IFileReferences>;
|
|
249
260
|
/**
|
|
250
261
|
* Waits for assembly to be created. Assembly is created when it changes to `done` or `failed` status.
|
|
251
262
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inweb/client",
|
|
3
|
-
"version": "25.9.
|
|
3
|
+
"version": "25.9.6",
|
|
4
4
|
"description": "JavaScript REST API client for the Open Cloud Server",
|
|
5
5
|
"homepage": "https://cloud.opendesign.com/docs/index.html",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE",
|
|
@@ -26,6 +26,6 @@
|
|
|
26
26
|
"docs": "typedoc"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@inweb/eventemitter2": "~25.9.
|
|
29
|
+
"@inweb/eventemitter2": "~25.9.6"
|
|
30
30
|
}
|
|
31
31
|
}
|
package/src/Api/Assembly.ts
CHANGED
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
|
|
24
24
|
import { IHttpClient } from "./IHttpClient";
|
|
25
25
|
import { FetchError } from "./FetchError";
|
|
26
|
+
import { IFileReferences } from "./IFile";
|
|
26
27
|
import { IAssociatedFileData, IAssemblyVersionInfo, IModelTransformMatrix } from "./IAssembly";
|
|
27
28
|
import { IShortUserDesc } from "./IUser";
|
|
28
29
|
import { Model } from "./Model";
|
|
@@ -469,10 +470,26 @@ export class Assembly {
|
|
|
469
470
|
await this.downloadResourceRange(dataId, requestId, records, onProgress, signal);
|
|
470
471
|
}
|
|
471
472
|
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
473
|
+
/**
|
|
474
|
+
* Returns a list of assembly references containing references from all the files from which
|
|
475
|
+
* the assembly was created.
|
|
476
|
+
*
|
|
477
|
+
* References are images, fonts, or any other files to correct rendering of the assembly.
|
|
478
|
+
*
|
|
479
|
+
* @param signal - An
|
|
480
|
+
* {@link https://developer.mozilla.org/docs/Web/API/AbortController | AbortController}
|
|
481
|
+
* signal, which can be used to abort waiting as desired.
|
|
482
|
+
*/
|
|
483
|
+
async getReferences(signal?: AbortSignal): Promise<IFileReferences> {
|
|
484
|
+
const references = await Promise.all(
|
|
485
|
+
this.associatedFiles
|
|
486
|
+
.map((file) => `/files/${file.fileId}/references`)
|
|
487
|
+
.map((link) => this.httpClient.get(link, signal).then((response) => response.json()))
|
|
488
|
+
)
|
|
489
|
+
.then((references) => references.map((x) => x.references))
|
|
490
|
+
.then((references) => references.reduce((x, v) => [...v, ...x], []))
|
|
491
|
+
.then((references) => [...new Set(references.map(JSON.stringify))].map((x: string) => JSON.parse(x)));
|
|
492
|
+
return { id: "", references };
|
|
476
493
|
}
|
|
477
494
|
|
|
478
495
|
/**
|