@inweb/client 27.1.6 → 27.1.7
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 +2 -80
- package/dist/client.js.map +1 -1
- package/dist/client.min.js +1 -1
- package/dist/client.module.js +2 -80
- package/dist/client.module.js.map +1 -1
- package/lib/Api/Assembly.d.ts +2 -11
- package/lib/Api/Client.d.ts +0 -8
- package/lib/Api/File.d.ts +5 -15
- package/lib/Api/IFile.d.ts +4 -4
- package/lib/Api/Model.d.ts +1 -13
- package/package.json +2 -2
- package/src/Api/Assembly.ts +2 -30
- package/src/Api/Client.ts +1 -50
- package/src/Api/File.ts +5 -34
- package/src/Api/IFile.ts +4 -4
- package/src/Api/Model.ts +1 -49
package/lib/Api/Assembly.d.ts
CHANGED
|
@@ -265,21 +265,12 @@ export declare class Assembly extends Endpoint {
|
|
|
265
265
|
end: number;
|
|
266
266
|
requestId: number;
|
|
267
267
|
}>, onProgress?: (progress: number, chunk: Uint8Array, requestId: number) => void, signal?: AbortSignal): Promise<ArrayBuffer>;
|
|
268
|
-
/**
|
|
269
|
-
* Deprecated since `25.3`. Use {@link downloadResource | downloadResource()} instead.
|
|
270
|
-
*
|
|
271
|
-
* @deprecated
|
|
272
|
-
*/
|
|
273
|
-
partialDownloadResource(dataId: string, onProgress?: (progress: number, chunk: Uint8Array) => void, signal?: AbortSignal): Promise<ArrayBuffer>;
|
|
274
|
-
/**
|
|
275
|
-
* Deprecated since `25.3`. Use {@link downloadResourceRange | downloadResourceRange()} instead.
|
|
276
|
-
*/
|
|
277
|
-
downloadFileRange(requestId: number, records: any | null, dataId: string, onProgress?: (progress: number, chunk: Uint8Array, requestId: number) => void, signal?: AbortSignal): Promise<void>;
|
|
278
268
|
/**
|
|
279
269
|
* Returns a list of assembly references containing references from all the files from which the
|
|
280
270
|
* assembly was created.
|
|
281
271
|
*
|
|
282
|
-
* References are images, fonts, or any other files to correct rendering of the
|
|
272
|
+
* References are images, fonts, external models or any other files to correct rendering of the
|
|
273
|
+
* assembly.
|
|
283
274
|
*
|
|
284
275
|
* @param signal - An
|
|
285
276
|
* {@link https://developer.mozilla.org/docs/Web/API/AbortController | AbortController} signal, which
|
package/lib/Api/Client.d.ts
CHANGED
|
@@ -22,11 +22,9 @@ export declare class Client extends EventEmitter2<ClientEventMap> {
|
|
|
22
22
|
/**
|
|
23
23
|
* @param params - An object containing client configuration parameters.
|
|
24
24
|
* @param params.serverUrl - Open Cloud REST API server URL.
|
|
25
|
-
* @param params.url - Deprecated since `25.8`. Use `serverUrl` instead.
|
|
26
25
|
*/
|
|
27
26
|
constructor(params?: {
|
|
28
27
|
serverUrl?: string;
|
|
29
|
-
url?: string;
|
|
30
28
|
});
|
|
31
29
|
/**
|
|
32
30
|
* Open Cloud REST API server URL. Use {@link configure | configure()} to change server URL.
|
|
@@ -40,12 +38,6 @@ export declare class Client extends EventEmitter2<ClientEventMap> {
|
|
|
40
38
|
* @readonly
|
|
41
39
|
*/
|
|
42
40
|
get httpClient(): IHttpClient;
|
|
43
|
-
/**
|
|
44
|
-
* Deprecated since `25.3`. Use `Viewer.options()` instead to change `Viewer` parameters.
|
|
45
|
-
*
|
|
46
|
-
* @deprecated
|
|
47
|
-
*/
|
|
48
|
-
get options(): any;
|
|
49
41
|
/**
|
|
50
42
|
* Changes the client parameters.
|
|
51
43
|
*
|
package/lib/Api/File.d.ts
CHANGED
|
@@ -390,22 +390,10 @@ export declare class File extends Endpoint {
|
|
|
390
390
|
end: number;
|
|
391
391
|
requestId: number;
|
|
392
392
|
}>, onProgress?: (progress: number, chunk: Uint8Array, requestId: number) => void, signal?: AbortSignal): Promise<ArrayBuffer>;
|
|
393
|
-
/**
|
|
394
|
-
* Deprecated since `25.3`. Use {@link downloadResource | downloadResource()} instead.
|
|
395
|
-
*
|
|
396
|
-
* @deprecated
|
|
397
|
-
*/
|
|
398
|
-
partialDownloadResource(dataId: string, onProgress?: (progress: number, downloaded: Uint8Array) => void, signal?: AbortSignal): Promise<ArrayBuffer>;
|
|
399
|
-
/**
|
|
400
|
-
* Deprecated since `25.3`. Use {@link downloadResourceRange | downloadResourceRange()} instead.
|
|
401
|
-
*
|
|
402
|
-
* @deprecated
|
|
403
|
-
*/
|
|
404
|
-
downloadFileRange(requestId: number, records: any | null, dataId: string, onProgress?: (progress: number, downloaded: Uint8Array, requestId: number) => void, signal?: AbortSignal): Promise<void>;
|
|
405
393
|
/**
|
|
406
394
|
* Returns a list of file references.
|
|
407
395
|
*
|
|
408
|
-
* References are images, fonts, or any other files to correct rendering of the file.
|
|
396
|
+
* References are images, fonts, external models or any other files to correct rendering of the file.
|
|
409
397
|
*
|
|
410
398
|
* @param signal - An
|
|
411
399
|
* {@link https://developer.mozilla.org/docs/Web/API/AbortController | AbortController} signal, which
|
|
@@ -415,8 +403,10 @@ export declare class File extends Endpoint {
|
|
|
415
403
|
/**
|
|
416
404
|
* Sets the file references.
|
|
417
405
|
*
|
|
418
|
-
* References are images, fonts, or any other files to correct rendering of the file.
|
|
419
|
-
*
|
|
406
|
+
* References are images, fonts, external models or any other files to correct rendering of the file.
|
|
407
|
+
*
|
|
408
|
+
* Reference files must be uploaded to the server before they can be assigned to the current file.
|
|
409
|
+
* Setting reference files must be done before extracting geometry and properties of the main file.
|
|
420
410
|
*
|
|
421
411
|
* @param references - File references.
|
|
422
412
|
*/
|
package/lib/Api/IFile.d.ts
CHANGED
|
@@ -47,17 +47,17 @@ export interface IFileReference {
|
|
|
47
47
|
name: string;
|
|
48
48
|
}
|
|
49
49
|
/**
|
|
50
|
-
* References are images, fonts, or any other files to correct rendering of the file.
|
|
50
|
+
* References are images, fonts, external models or any other files to correct rendering of the file.
|
|
51
51
|
*/
|
|
52
52
|
export interface IFileReferences {
|
|
53
53
|
/**
|
|
54
54
|
* The references list ID, changed after each update of the file references.
|
|
55
55
|
*/
|
|
56
|
-
id
|
|
56
|
+
id?: string;
|
|
57
57
|
/**
|
|
58
|
-
* List of file references or
|
|
58
|
+
* List of file references or an empty list if there are no references.
|
|
59
59
|
*/
|
|
60
|
-
references: IFileReference[]
|
|
60
|
+
references: IFileReference[];
|
|
61
61
|
}
|
|
62
62
|
/**
|
|
63
63
|
* Defines the information about file version.
|
package/lib/Api/Model.d.ts
CHANGED
|
@@ -161,22 +161,10 @@ export declare class Model extends Endpoint {
|
|
|
161
161
|
end: number;
|
|
162
162
|
requestId: number;
|
|
163
163
|
}>, onProgress?: (progress: number, chunk: Uint8Array, requestId: number) => void, signal?: AbortSignal): Promise<ArrayBuffer>;
|
|
164
|
-
/**
|
|
165
|
-
* Deprecated since `25.3`. Use {@link downloadResource | downloadResource()} instead.
|
|
166
|
-
*
|
|
167
|
-
* @deprecated
|
|
168
|
-
*/
|
|
169
|
-
partialDownloadResource(dataId: string, onProgress?: (progress: number, chunk: Uint8Array) => void, signal?: AbortSignal): Promise<ArrayBuffer>;
|
|
170
|
-
/**
|
|
171
|
-
* Deprecated since `25.3`. Use {@link downloadResourceRange | downloadResourceRange()} instead.
|
|
172
|
-
*
|
|
173
|
-
* @deprecated
|
|
174
|
-
*/
|
|
175
|
-
downloadFileRange(requestId: number, records: any | null, dataId: string, onProgress?: (progress: number, chunk: Uint8Array, requestId: number) => void, signal?: AbortSignal): Promise<void>;
|
|
176
164
|
/**
|
|
177
165
|
* Returns a list of references of the owner file/assembly.
|
|
178
166
|
*
|
|
179
|
-
* References are images, fonts, or any other files to correct rendering of the file.
|
|
167
|
+
* References are images, fonts, external models or any other files to correct rendering of the file.
|
|
180
168
|
*
|
|
181
169
|
* @param signal - An
|
|
182
170
|
* {@link https://developer.mozilla.org/docs/Web/API/AbortController | AbortController} signal, which
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inweb/client",
|
|
3
|
-
"version": "27.1.
|
|
3
|
+
"version": "27.1.7",
|
|
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,7 +26,7 @@
|
|
|
26
26
|
"docs": "typedoc"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@inweb/eventemitter2": "~27.1.
|
|
29
|
+
"@inweb/eventemitter2": "~27.1.7"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"fflate": "^0.8.2"
|
package/src/Api/Assembly.ts
CHANGED
|
@@ -463,40 +463,12 @@ export class Assembly extends Endpoint {
|
|
|
463
463
|
.then((response) => response.arrayBuffer());
|
|
464
464
|
}
|
|
465
465
|
|
|
466
|
-
/**
|
|
467
|
-
* Deprecated since `25.3`. Use {@link downloadResource | downloadResource()} instead.
|
|
468
|
-
*
|
|
469
|
-
* @deprecated
|
|
470
|
-
*/
|
|
471
|
-
partialDownloadResource(
|
|
472
|
-
dataId: string,
|
|
473
|
-
onProgress?: (progress: number, chunk: Uint8Array) => void,
|
|
474
|
-
signal?: AbortSignal
|
|
475
|
-
): Promise<ArrayBuffer> {
|
|
476
|
-
console.warn(
|
|
477
|
-
"Assembly.partialDownloadResource() has been deprecated since 25.3 and will be removed in a future release, use Assembly.downloadResource() instead."
|
|
478
|
-
);
|
|
479
|
-
return this.downloadResource(dataId, onProgress, signal);
|
|
480
|
-
}
|
|
481
|
-
|
|
482
|
-
/**
|
|
483
|
-
* Deprecated since `25.3`. Use {@link downloadResourceRange | downloadResourceRange()} instead.
|
|
484
|
-
*/
|
|
485
|
-
async downloadFileRange(
|
|
486
|
-
requestId: number,
|
|
487
|
-
records: any | null,
|
|
488
|
-
dataId: string,
|
|
489
|
-
onProgress?: (progress: number, chunk: Uint8Array, requestId: number) => void,
|
|
490
|
-
signal?: AbortSignal
|
|
491
|
-
): Promise<void> {
|
|
492
|
-
await this.downloadResourceRange(dataId, requestId, records, onProgress, signal);
|
|
493
|
-
}
|
|
494
|
-
|
|
495
466
|
/**
|
|
496
467
|
* Returns a list of assembly references containing references from all the files from which the
|
|
497
468
|
* assembly was created.
|
|
498
469
|
*
|
|
499
|
-
* References are images, fonts, or any other files to correct rendering of the
|
|
470
|
+
* References are images, fonts, external models or any other files to correct rendering of the
|
|
471
|
+
* assembly.
|
|
500
472
|
*
|
|
501
473
|
* @param signal - An
|
|
502
474
|
* {@link https://developer.mozilla.org/docs/Web/API/AbortController | AbortController} signal, which
|
package/src/Api/Client.ts
CHANGED
|
@@ -52,9 +52,8 @@ export class Client extends EventEmitter2<ClientEventMap> {
|
|
|
52
52
|
/**
|
|
53
53
|
* @param params - An object containing client configuration parameters.
|
|
54
54
|
* @param params.serverUrl - Open Cloud REST API server URL.
|
|
55
|
-
* @param params.url - Deprecated since `25.8`. Use `serverUrl` instead.
|
|
56
55
|
*/
|
|
57
|
-
constructor(params: { serverUrl?: string
|
|
56
|
+
constructor(params: { serverUrl?: string } = {}) {
|
|
58
57
|
super();
|
|
59
58
|
this.configure(params);
|
|
60
59
|
}
|
|
@@ -77,54 +76,6 @@ export class Client extends EventEmitter2<ClientEventMap> {
|
|
|
77
76
|
return this._httpClient;
|
|
78
77
|
}
|
|
79
78
|
|
|
80
|
-
/**
|
|
81
|
-
* Deprecated since `25.3`. Use `Viewer.options()` instead to change `Viewer` parameters.
|
|
82
|
-
*
|
|
83
|
-
* @deprecated
|
|
84
|
-
*/
|
|
85
|
-
get options(): any {
|
|
86
|
-
console.warn(
|
|
87
|
-
"Client.options has been deprecated since 25.3 and will be removed in a future release, use Viewer.options instead."
|
|
88
|
-
);
|
|
89
|
-
const data = {
|
|
90
|
-
showWCS: true,
|
|
91
|
-
cameraAnimation: true,
|
|
92
|
-
antialiasing: true,
|
|
93
|
-
groundShadow: false,
|
|
94
|
-
shadows: false,
|
|
95
|
-
cameraAxisXSpeed: 4,
|
|
96
|
-
cameraAxisYSpeed: 1,
|
|
97
|
-
ambientOcclusion: false,
|
|
98
|
-
enableStreamingMode: true,
|
|
99
|
-
enablePartialMode: false,
|
|
100
|
-
memoryLimit: 3294967296,
|
|
101
|
-
cuttingPlaneFillColor: { red: 0xff, green: 0x98, blue: 0x00 },
|
|
102
|
-
edgesColor: { r: 0xff, g: 0x98, b: 0x00 },
|
|
103
|
-
facesColor: { r: 0xff, g: 0x98, b: 0x00 },
|
|
104
|
-
edgesVisibility: true,
|
|
105
|
-
edgesOverlap: true,
|
|
106
|
-
facesOverlap: false,
|
|
107
|
-
facesTransparancy: 200,
|
|
108
|
-
enableCustomHighlight: true,
|
|
109
|
-
sceneGraph: false,
|
|
110
|
-
edgeModel: true,
|
|
111
|
-
reverseZoomWheel: false,
|
|
112
|
-
enableZoomWheel: true,
|
|
113
|
-
enableGestures: true,
|
|
114
|
-
geometryType: "vsfx",
|
|
115
|
-
rulerUnit: "Default",
|
|
116
|
-
cameraMode: "perspective",
|
|
117
|
-
};
|
|
118
|
-
return {
|
|
119
|
-
...data,
|
|
120
|
-
data,
|
|
121
|
-
defaults: () => data,
|
|
122
|
-
resetToDefaults: () => {},
|
|
123
|
-
saveToStorage: () => {},
|
|
124
|
-
loadFromStorage: () => {},
|
|
125
|
-
};
|
|
126
|
-
}
|
|
127
|
-
|
|
128
79
|
/**
|
|
129
80
|
* Changes the client parameters.
|
|
130
81
|
*
|
package/src/Api/File.ts
CHANGED
|
@@ -634,41 +634,10 @@ export class File extends Endpoint {
|
|
|
634
634
|
.then((response) => response.arrayBuffer());
|
|
635
635
|
}
|
|
636
636
|
|
|
637
|
-
/**
|
|
638
|
-
* Deprecated since `25.3`. Use {@link downloadResource | downloadResource()} instead.
|
|
639
|
-
*
|
|
640
|
-
* @deprecated
|
|
641
|
-
*/
|
|
642
|
-
partialDownloadResource(
|
|
643
|
-
dataId: string,
|
|
644
|
-
onProgress?: (progress: number, downloaded: Uint8Array) => void,
|
|
645
|
-
signal?: AbortSignal
|
|
646
|
-
): Promise<ArrayBuffer> {
|
|
647
|
-
console.warn(
|
|
648
|
-
"File.partialDownloadResource() has been deprecated since 25.3 and will be removed in a future release, use File.downloadResource() instead."
|
|
649
|
-
);
|
|
650
|
-
return this.downloadResource(dataId, onProgress, signal);
|
|
651
|
-
}
|
|
652
|
-
|
|
653
|
-
/**
|
|
654
|
-
* Deprecated since `25.3`. Use {@link downloadResourceRange | downloadResourceRange()} instead.
|
|
655
|
-
*
|
|
656
|
-
* @deprecated
|
|
657
|
-
*/
|
|
658
|
-
async downloadFileRange(
|
|
659
|
-
requestId: number,
|
|
660
|
-
records: any | null,
|
|
661
|
-
dataId: string,
|
|
662
|
-
onProgress?: (progress: number, downloaded: Uint8Array, requestId: number) => void,
|
|
663
|
-
signal?: AbortSignal
|
|
664
|
-
): Promise<void> {
|
|
665
|
-
await this.downloadResourceRange(dataId, requestId, records, onProgress, signal);
|
|
666
|
-
}
|
|
667
|
-
|
|
668
637
|
/**
|
|
669
638
|
* Returns a list of file references.
|
|
670
639
|
*
|
|
671
|
-
* References are images, fonts, or any other files to correct rendering of the file.
|
|
640
|
+
* References are images, fonts, external models or any other files to correct rendering of the file.
|
|
672
641
|
*
|
|
673
642
|
* @param signal - An
|
|
674
643
|
* {@link https://developer.mozilla.org/docs/Web/API/AbortController | AbortController} signal, which
|
|
@@ -681,8 +650,10 @@ export class File extends Endpoint {
|
|
|
681
650
|
/**
|
|
682
651
|
* Sets the file references.
|
|
683
652
|
*
|
|
684
|
-
* References are images, fonts, or any other files to correct rendering of the file.
|
|
685
|
-
*
|
|
653
|
+
* References are images, fonts, external models or any other files to correct rendering of the file.
|
|
654
|
+
*
|
|
655
|
+
* Reference files must be uploaded to the server before they can be assigned to the current file.
|
|
656
|
+
* Setting reference files must be done before extracting geometry and properties of the main file.
|
|
686
657
|
*
|
|
687
658
|
* @param references - File references.
|
|
688
659
|
*/
|
package/src/Api/IFile.ts
CHANGED
|
@@ -79,18 +79,18 @@ export interface IFileReference {
|
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
/**
|
|
82
|
-
* References are images, fonts, or any other files to correct rendering of the file.
|
|
82
|
+
* References are images, fonts, external models or any other files to correct rendering of the file.
|
|
83
83
|
*/
|
|
84
84
|
export interface IFileReferences {
|
|
85
85
|
/**
|
|
86
86
|
* The references list ID, changed after each update of the file references.
|
|
87
87
|
*/
|
|
88
|
-
id
|
|
88
|
+
id?: string;
|
|
89
89
|
|
|
90
90
|
/**
|
|
91
|
-
* List of file references or
|
|
91
|
+
* List of file references or an empty list if there are no references.
|
|
92
92
|
*/
|
|
93
|
-
references: IFileReference[]
|
|
93
|
+
references: IFileReference[];
|
|
94
94
|
}
|
|
95
95
|
|
|
96
96
|
/**
|
package/src/Api/Model.ts
CHANGED
|
@@ -273,58 +273,10 @@ export class Model extends Endpoint {
|
|
|
273
273
|
return this._file.downloadResourceRange(dataId, requestId, ranges, onProgress, signal);
|
|
274
274
|
}
|
|
275
275
|
|
|
276
|
-
/**
|
|
277
|
-
* Deprecated since `25.3`. Use {@link downloadResource | downloadResource()} instead.
|
|
278
|
-
*
|
|
279
|
-
* @deprecated
|
|
280
|
-
*/
|
|
281
|
-
partialDownloadResource(
|
|
282
|
-
dataId: string,
|
|
283
|
-
onProgress?: (progress: number, chunk: Uint8Array) => void,
|
|
284
|
-
signal?: AbortSignal
|
|
285
|
-
): Promise<ArrayBuffer> {
|
|
286
|
-
console.warn(
|
|
287
|
-
"Model.partialDownloadResource() has been deprecated since 25.3 and will be removed in a future release, use Model.downloadResource() instead."
|
|
288
|
-
);
|
|
289
|
-
return this.downloadResource(dataId, onProgress, signal);
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
/**
|
|
293
|
-
* Deprecated since `25.3`. Use {@link downloadResourceRange | downloadResourceRange()} instead.
|
|
294
|
-
*
|
|
295
|
-
* @deprecated
|
|
296
|
-
*/
|
|
297
|
-
async downloadFileRange(
|
|
298
|
-
requestId: number,
|
|
299
|
-
records: any | null,
|
|
300
|
-
dataId: string,
|
|
301
|
-
onProgress?: (progress: number, chunk: Uint8Array, requestId: number) => void,
|
|
302
|
-
signal?: AbortSignal
|
|
303
|
-
): Promise<void> {
|
|
304
|
-
if (!records) return;
|
|
305
|
-
|
|
306
|
-
let ranges = [];
|
|
307
|
-
if (records.length) {
|
|
308
|
-
ranges = records.map((record) => ({
|
|
309
|
-
begin: Number(record.begin),
|
|
310
|
-
end: Number(record.end),
|
|
311
|
-
requestId: record.reqId,
|
|
312
|
-
}));
|
|
313
|
-
} else {
|
|
314
|
-
for (let i = 0; i < records.size(); i++) {
|
|
315
|
-
const record = records.get(i);
|
|
316
|
-
ranges.push({ begin: Number(record.begin), end: Number(record.end), requestId });
|
|
317
|
-
record.delete();
|
|
318
|
-
}
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
await this.downloadResourceRange(dataId, requestId, ranges, onProgress, signal);
|
|
322
|
-
}
|
|
323
|
-
|
|
324
276
|
/**
|
|
325
277
|
* Returns a list of references of the owner file/assembly.
|
|
326
278
|
*
|
|
327
|
-
* References are images, fonts, or any other files to correct rendering of the file.
|
|
279
|
+
* References are images, fonts, external models or any other files to correct rendering of the file.
|
|
328
280
|
*
|
|
329
281
|
* @param signal - An
|
|
330
282
|
* {@link https://developer.mozilla.org/docs/Web/API/AbortController | AbortController} signal, which
|