@shapediver/viewer.session 3.0.0
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/LICENSE +73 -0
- package/README.md +1 -0
- package/dist/implementation/ExportApi.d.ts +36 -0
- package/dist/implementation/ExportApi.d.ts.map +1 -0
- package/dist/implementation/ExportApi.js +140 -0
- package/dist/implementation/ExportApi.js.map +1 -0
- package/dist/implementation/FileParameterApi.d.ts +10 -0
- package/dist/implementation/FileParameterApi.d.ts.map +1 -0
- package/dist/implementation/FileParameterApi.js +50 -0
- package/dist/implementation/FileParameterApi.js.map +1 -0
- package/dist/implementation/OutputApi.d.ts +38 -0
- package/dist/implementation/OutputApi.d.ts.map +1 -0
- package/dist/implementation/OutputApi.js +165 -0
- package/dist/implementation/OutputApi.js.map +1 -0
- package/dist/implementation/ParameterApi.d.ts +38 -0
- package/dist/implementation/ParameterApi.d.ts.map +1 -0
- package/dist/implementation/ParameterApi.js +151 -0
- package/dist/implementation/ParameterApi.js.map +1 -0
- package/dist/implementation/SessionApi.d.ts +98 -0
- package/dist/implementation/SessionApi.d.ts.map +1 -0
- package/dist/implementation/SessionApi.js +361 -0
- package/dist/implementation/SessionApi.js.map +1 -0
- package/dist/implementation/data/OutputApiData.d.ts +20 -0
- package/dist/implementation/data/OutputApiData.d.ts.map +1 -0
- package/dist/implementation/data/OutputApiData.js +51 -0
- package/dist/implementation/data/OutputApiData.js.map +1 -0
- package/dist/implementation/data/SessionApiData.d.ts +20 -0
- package/dist/implementation/data/SessionApiData.d.ts.map +1 -0
- package/dist/implementation/data/SessionApiData.js +51 -0
- package/dist/implementation/data/SessionApiData.js.map +1 -0
- package/dist/index.d.ts +40 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +120 -0
- package/dist/index.js.map +1 -0
- package/dist/interfaces/IExportApi.d.ts +27 -0
- package/dist/interfaces/IExportApi.d.ts.map +1 -0
- package/dist/interfaces/IExportApi.js +3 -0
- package/dist/interfaces/IExportApi.js.map +1 -0
- package/dist/interfaces/IFileParameterApi.d.ts +35 -0
- package/dist/interfaces/IFileParameterApi.d.ts.map +1 -0
- package/dist/interfaces/IFileParameterApi.js +3 -0
- package/dist/interfaces/IFileParameterApi.js.map +1 -0
- package/dist/interfaces/IOutputApi.d.ts +75 -0
- package/dist/interfaces/IOutputApi.d.ts.map +1 -0
- package/dist/interfaces/IOutputApi.js +3 -0
- package/dist/interfaces/IOutputApi.js.map +1 -0
- package/dist/interfaces/IParameterApi.d.ts +46 -0
- package/dist/interfaces/IParameterApi.d.ts.map +1 -0
- package/dist/interfaces/IParameterApi.js +3 -0
- package/dist/interfaces/IParameterApi.js.map +1 -0
- package/dist/interfaces/ISessionApi.d.ts +477 -0
- package/dist/interfaces/ISessionApi.d.ts.map +1 -0
- package/dist/interfaces/ISessionApi.js +3 -0
- package/dist/interfaces/ISessionApi.js.map +1 -0
- package/dist/interfaces/data/IOutputApiData.d.ts +7 -0
- package/dist/interfaces/data/IOutputApiData.d.ts.map +1 -0
- package/dist/interfaces/data/IOutputApiData.js +3 -0
- package/dist/interfaces/data/IOutputApiData.js.map +1 -0
- package/dist/interfaces/data/ISessionApiData.d.ts +7 -0
- package/dist/interfaces/data/ISessionApiData.d.ts.map +1 -0
- package/dist/interfaces/data/ISessionApiData.js +3 -0
- package/dist/interfaces/data/ISessionApiData.js.map +1 -0
- package/dist/main.d.ts +37 -0
- package/dist/main.d.ts.map +1 -0
- package/dist/main.js +96 -0
- package/dist/main.js.map +1 -0
- package/package.json +63 -0
- package/src/implementation/ExportApi.ts +158 -0
- package/src/implementation/FileParameterApi.ts +34 -0
- package/src/implementation/OutputApi.ts +178 -0
- package/src/implementation/ParameterApi.ts +176 -0
- package/src/implementation/SessionApi.ts +408 -0
- package/src/implementation/data/OutputApiData.ts +53 -0
- package/src/implementation/data/SessionApiData.ts +53 -0
- package/src/index.ts +225 -0
- package/src/interfaces/IExportApi.ts +29 -0
- package/src/interfaces/IFileParameterApi.ts +39 -0
- package/src/interfaces/IOutputApi.ts +85 -0
- package/src/interfaces/IParameterApi.ts +55 -0
- package/src/interfaces/ISessionApi.ts +461 -0
- package/src/interfaces/data/IOutputApiData.ts +16 -0
- package/src/interfaces/data/ISessionApiData.ts +16 -0
- package/src/main.ts +95 -0
- package/tsconfig.json +17 -0
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { ShapeDiverResponseParameter } from '@shapediver/sdk.geometry-api-sdk-v2';
|
|
2
|
+
/**
|
|
3
|
+
* The api for a parameter of a corresponding [session]{@link ISessionApi}.
|
|
4
|
+
*
|
|
5
|
+
* Parameters represent the channels through which data can be input into the model
|
|
6
|
+
* represented by a session.
|
|
7
|
+
*
|
|
8
|
+
* The current value can be changed by setting the {@link value} property.
|
|
9
|
+
*/
|
|
10
|
+
export interface IParameterApi<T> extends ShapeDiverResponseParameter {
|
|
11
|
+
/**
|
|
12
|
+
* The value that corresponds to the latest successful call to {@link ISessionApi.customize}.
|
|
13
|
+
* This property will be updated immediately before {@link ISessionApi.customize} returns.
|
|
14
|
+
*/
|
|
15
|
+
sessionValue: T | string;
|
|
16
|
+
/**
|
|
17
|
+
* The current value.
|
|
18
|
+
*
|
|
19
|
+
* Validation happens immediately when setting this property. An error will be thrown in case
|
|
20
|
+
* validation fails. Use {@link isValid} to test whether a value passes validation.
|
|
21
|
+
*
|
|
22
|
+
* In case {@link ISessionApi.automaticSceneUpdate} is true, setting the value will immediately
|
|
23
|
+
* trigger a customization (see {@link ISessionApi.customize}).
|
|
24
|
+
*/
|
|
25
|
+
value: T | string;
|
|
26
|
+
/**
|
|
27
|
+
* Evaluates if a given value is valid for this parameter.
|
|
28
|
+
*
|
|
29
|
+
* @param value the value to evaluate
|
|
30
|
+
* @param throwError if true, an error is thrown if validation does not pass (default: false)
|
|
31
|
+
*/
|
|
32
|
+
isValid(value: unknown, throwError?: boolean): boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Resets the value to the default value.
|
|
35
|
+
*/
|
|
36
|
+
resetToDefaultValue(): void;
|
|
37
|
+
/**
|
|
38
|
+
* Resets the value to {@link sessionValue}.
|
|
39
|
+
*/
|
|
40
|
+
resetToSessionValue(): void;
|
|
41
|
+
/**
|
|
42
|
+
* Returns the current value as a string
|
|
43
|
+
*/
|
|
44
|
+
stringify(): string;
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=IParameterApi.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IParameterApi.d.ts","sourceRoot":"","sources":["../../src/interfaces/IParameterApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,qCAAqC,CAAC;AAElF;;;;;;;GAOG;AACH,MAAM,WAAW,aAAa,CAAC,CAAC,CAAE,SAAQ,2BAA2B;IAGjE;;;OAGG;IACH,YAAY,EAAE,CAAC,GAAG,MAAM,CAAC;IACzB;;;;;;;;OAQG;IACH,KAAK,EAAE,CAAC,GAAG,MAAM,CAAC;IAMlB;;;;;OAKG;IACH,OAAO,CAAC,KAAK,EAAE,OAAO,EAAE,UAAU,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC;IACvD;;OAEG;IACH,mBAAmB,IAAI,IAAI,CAAC;IAC5B;;OAEG;IACH,mBAAmB,IAAI,IAAI,CAAC;IAC5B;;OAEG;IACH,SAAS,IAAI,MAAM,CAAC;CAGvB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IParameterApi.js","sourceRoot":"","sources":["../../src/interfaces/IParameterApi.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,477 @@
|
|
|
1
|
+
import { IExportApi } from './IExportApi';
|
|
2
|
+
import { IOutputApi } from './IOutputApi';
|
|
3
|
+
import { IParameterApi } from './IParameterApi';
|
|
4
|
+
import { ISettingsSections } from '@shapediver/viewer.shared.types';
|
|
5
|
+
import { ITreeNode } from '@shapediver/viewer.shared.node-tree';
|
|
6
|
+
import { ShapeDiverRequestExport, ShapeDiverResponseDto } from '@shapediver/sdk.geometry-api-sdk-v2';
|
|
7
|
+
/**
|
|
8
|
+
* The api for sessions.
|
|
9
|
+
*
|
|
10
|
+
* A session represents an instance of a model hosted on a
|
|
11
|
+
* {@link https://help.shapediver.com/doc/Geometry-Backend.1863942173.html|ShapeDiver Geometry Backend}.
|
|
12
|
+
*
|
|
13
|
+
* Sessions are created by calling {@link createSession}.
|
|
14
|
+
*
|
|
15
|
+
* The session contains representations of the model's {@link parameters}, {@link outputs} and {@link exports}.
|
|
16
|
+
* Each session corresponds to a {@link node} in the scene tree, which reflects the status of the outputs
|
|
17
|
+
* for the current parameter values.
|
|
18
|
+
*
|
|
19
|
+
* On change of parameter values (aka _customizations_), the session makes the necessary calls to the Geometry Backend
|
|
20
|
+
* to trigger a computation of the model (if required), wait for its completion, download the resulting assets,
|
|
21
|
+
* and create an updated scene tree.
|
|
22
|
+
*
|
|
23
|
+
* A model may define {@link exports}, whose data is not reflected in the scene tree, but can
|
|
24
|
+
* be requested by functionality of the session.
|
|
25
|
+
*/
|
|
26
|
+
export interface ISessionApi {
|
|
27
|
+
/**
|
|
28
|
+
* The [exports]{@link IExportApi} defined by the model.
|
|
29
|
+
* This object maps export ids to export definitions.
|
|
30
|
+
*/
|
|
31
|
+
readonly exports: {
|
|
32
|
+
[key: string]: IExportApi;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* The geometry backend model id (guid).
|
|
36
|
+
* This identifies the model on the Geometry Backend. A {@link jwtToken} is needed for authentication.
|
|
37
|
+
*/
|
|
38
|
+
readonly guid?: string;
|
|
39
|
+
/**
|
|
40
|
+
* The unique identifier of the session that was specified
|
|
41
|
+
* or automatically chosen on creation of the session.
|
|
42
|
+
*/
|
|
43
|
+
readonly id: string;
|
|
44
|
+
/**
|
|
45
|
+
* The JWT used for authorizing API calls to the Geometry Backend.
|
|
46
|
+
*
|
|
47
|
+
* @see setJwtToken
|
|
48
|
+
*/
|
|
49
|
+
readonly jwtToken: string | undefined;
|
|
50
|
+
/**
|
|
51
|
+
* The modelViewUrl of the
|
|
52
|
+
* {@link https://help.shapediver.com/doc/Geometry-Backend.1863942173.html|ShapeDiver Geometry Backend}
|
|
53
|
+
* hosting the model.
|
|
54
|
+
*/
|
|
55
|
+
readonly modelViewUrl: string;
|
|
56
|
+
/**
|
|
57
|
+
* The node of the session in the [scene tree]{@link ITree}.
|
|
58
|
+
*/
|
|
59
|
+
readonly node: ITreeNode;
|
|
60
|
+
/**
|
|
61
|
+
* The [outputs]{@link IOutputApi} defined by the model.
|
|
62
|
+
* This object maps output ids to output definitions.
|
|
63
|
+
*/
|
|
64
|
+
readonly outputs: {
|
|
65
|
+
[key: string]: IOutputApi;
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* The parameter values that are the defaults of the session.
|
|
69
|
+
* Changing these values does not have any affect. The values in this dictionary only reflect the _defval_ of the [parameters]{@link IParameterApi}.
|
|
70
|
+
*/
|
|
71
|
+
readonly parameterDefaultValues: {
|
|
72
|
+
[key: string]: unknown;
|
|
73
|
+
};
|
|
74
|
+
/**
|
|
75
|
+
* The parameter values that were used in the last successful session customization.
|
|
76
|
+
* These values may not reflect the current state in the [parameters]{@link IParameterApi} if there was a change in parameters after the last customization call.
|
|
77
|
+
* Changing these values does not have any affect. The values in this dictionary only reflect the _sessionValue_ of the [parameters]{@link IParameterApi}.
|
|
78
|
+
*/
|
|
79
|
+
readonly parameterSessionValues: {
|
|
80
|
+
[key: string]: unknown;
|
|
81
|
+
};
|
|
82
|
+
/**
|
|
83
|
+
* The parameter values that are currently set in the API.
|
|
84
|
+
* These values may not reflect the current state in the scene if there was a change in parameters after the last customization call.
|
|
85
|
+
* Changing these values does not have any affect. The values in this dictionary only reflect the _value_ of the [parameters]{@link IParameterApi}.
|
|
86
|
+
*/
|
|
87
|
+
readonly parameterValues: {
|
|
88
|
+
[key: string]: unknown;
|
|
89
|
+
};
|
|
90
|
+
/**
|
|
91
|
+
* The [parameters]{@link IParameterApi} defined by the model.
|
|
92
|
+
* This object maps parameter ids to parameter definitions.
|
|
93
|
+
*/
|
|
94
|
+
readonly parameters: {
|
|
95
|
+
[key: string]: IParameterApi<unknown>;
|
|
96
|
+
};
|
|
97
|
+
/**
|
|
98
|
+
* The ticket for direct embedding of the model represented by the session.
|
|
99
|
+
* This identifies the model on the Geometry Backend.
|
|
100
|
+
*/
|
|
101
|
+
readonly ticket?: string;
|
|
102
|
+
/**
|
|
103
|
+
* Option to automatically update the session's scene tree node whenever a customization finishes. (default: true)
|
|
104
|
+
*
|
|
105
|
+
* In case this is set to false, the session's scene tree {@link node} will not be automatically replaced
|
|
106
|
+
* by the node returned from {@link customize}. This can be used to plug the result of {@link customize}
|
|
107
|
+
* into other parts of the scene tree.
|
|
108
|
+
*/
|
|
109
|
+
automaticSceneUpdate: boolean;
|
|
110
|
+
/**
|
|
111
|
+
* (Platform specific) Option to enable commit-mode for parameters.
|
|
112
|
+
* This setting is used purely for UI purposes, it does not have any influence on the session itself.
|
|
113
|
+
*/
|
|
114
|
+
commitParameters: boolean;
|
|
115
|
+
/**
|
|
116
|
+
* (Platform specific) Option to enable commit-mode for settings.
|
|
117
|
+
* This setting is used purely for UI purposes, it does not have any influence on the session itself.
|
|
118
|
+
*/
|
|
119
|
+
commitSettings: boolean;
|
|
120
|
+
/**
|
|
121
|
+
* Option to trigger a call to {@link customize} whenever a parameter value is changed.
|
|
122
|
+
*
|
|
123
|
+
* Use this with care as this might max out the rate limit for your model on the Geometry Backend.
|
|
124
|
+
*/
|
|
125
|
+
customizeOnParameterChange: boolean;
|
|
126
|
+
/**
|
|
127
|
+
* The ids of the viewports in which the session's scene tree {@link node} should not be shown.
|
|
128
|
+
*/
|
|
129
|
+
excludeViewports: string[];
|
|
130
|
+
/**
|
|
131
|
+
* Option to load the SDTF data. The data is not loaded by default as it can be quite large. (default: false)
|
|
132
|
+
*/
|
|
133
|
+
loadSdtf: boolean;
|
|
134
|
+
/**
|
|
135
|
+
* Optional callback which can be specified for refreshing the JWT.
|
|
136
|
+
* This will be called by the session once the JWT expires.
|
|
137
|
+
* The callback is required to provide a fresh JWT.
|
|
138
|
+
*/
|
|
139
|
+
refreshJwtToken: (() => Promise<string>) | undefined;
|
|
140
|
+
/**
|
|
141
|
+
* A callback that is executed whenever a session's {@link node} is to be replaced
|
|
142
|
+
* due to an update of the session's content.
|
|
143
|
+
* Provides the new scene tree node and the old one, so that data can be carried over.
|
|
144
|
+
* If the callback is a promise it will be awaited in the execution chain.
|
|
145
|
+
*/
|
|
146
|
+
updateCallback: ((newNode: ITreeNode, oldNode: ITreeNode) => void | Promise<void>) | null;
|
|
147
|
+
/**
|
|
148
|
+
* Update all or some settings of the current session and the viewports based on the Geometry Backend
|
|
149
|
+
* response object of another model.
|
|
150
|
+
*
|
|
151
|
+
* @see {@link IViewportApi.sessionSettingsMode}
|
|
152
|
+
* @see {@link IViewportApi.sessionSettingsId}
|
|
153
|
+
*
|
|
154
|
+
* @param response the ShapeDiverResponseDto of the model whose settings shall be applied
|
|
155
|
+
* @param sections specify true for those parts of the settings that should be applied
|
|
156
|
+
*
|
|
157
|
+
* @throws {@link ShapeDiverViewerError}
|
|
158
|
+
*/
|
|
159
|
+
applySettings(response: ShapeDiverResponseDto, sections?: ISettingsSections): Promise<void>;
|
|
160
|
+
/**
|
|
161
|
+
* Check if the session's history allows to go back to a previous state of parameter values.
|
|
162
|
+
* The session history is recorded whenever {@link customize} is called.
|
|
163
|
+
*
|
|
164
|
+
* A further state of parameter values is recorded whenever a successful _customization_ happens.
|
|
165
|
+
*
|
|
166
|
+
* @see {@link customize}
|
|
167
|
+
* @see {@link canGoBack}
|
|
168
|
+
* @see {@link canGoForward}
|
|
169
|
+
* @see {@link goBack}
|
|
170
|
+
* @see {@link goForward}
|
|
171
|
+
*/
|
|
172
|
+
canGoBack(): boolean;
|
|
173
|
+
/**
|
|
174
|
+
* Check if the session's history allows to go forward to a next state of parameter values.
|
|
175
|
+
* The session history is recorded whenever {@link customize} is called.
|
|
176
|
+
*
|
|
177
|
+
* A further state of parameter values is recorded whenever a successful _customization_ happens.
|
|
178
|
+
*
|
|
179
|
+
* @see {@link customize}
|
|
180
|
+
* @see {@link canGoBack}
|
|
181
|
+
* @see {@link canGoForward}
|
|
182
|
+
* @see {@link goBack}
|
|
183
|
+
* @see {@link goForward}
|
|
184
|
+
*/
|
|
185
|
+
canGoForward(): boolean;
|
|
186
|
+
/**
|
|
187
|
+
* Cancel the current customization if there is one in progress.
|
|
188
|
+
* Requests that were already sent will still be received, but not further processed.
|
|
189
|
+
*/
|
|
190
|
+
cancelCustomization(): void;
|
|
191
|
+
/**
|
|
192
|
+
* Close the session.
|
|
193
|
+
* This removes the {@link node} from the scene tree and closes the session
|
|
194
|
+
* with the Geometry Backend.
|
|
195
|
+
*
|
|
196
|
+
* @throws {@type ShapeDiverViewerError}
|
|
197
|
+
*/
|
|
198
|
+
close(): Promise<void>;
|
|
199
|
+
/**
|
|
200
|
+
* Convert the session into a glTF file.
|
|
201
|
+
*
|
|
202
|
+
* The ground plane and grid will not be included, as well as additionally added data that was added to the scene other than through a {@link GeometryData} property.
|
|
203
|
+
*
|
|
204
|
+
* @throws {@type ShapeDiverViewerError}
|
|
205
|
+
*/
|
|
206
|
+
convertToGlTF(): Promise<Blob>;
|
|
207
|
+
/**
|
|
208
|
+
* Customize the session.
|
|
209
|
+
*
|
|
210
|
+
* The current state of parameter values is used to request the outputs
|
|
211
|
+
* of the model from the Geometry Backend. The specific version of an
|
|
212
|
+
* output for a given set of parameter values is called _output version_.
|
|
213
|
+
* In case the Geometry Backend has already cached the requested output versions,
|
|
214
|
+
* it will reply immediately, otherwise a computation request for the missing
|
|
215
|
+
* output versions of the model will be triggered and awaited.
|
|
216
|
+
* Once the output versions are available, the resulting assets will be
|
|
217
|
+
* downloaded, extracted, and the resulting scene tree node will be created.
|
|
218
|
+
*
|
|
219
|
+
* Unless {@link automaticSceneUpdate} is set to false, the session's {@link node}
|
|
220
|
+
* will be updated and viewports will be rendered.
|
|
221
|
+
*
|
|
222
|
+
* Independent of {@link automaticSceneUpdate}, right before returning the following
|
|
223
|
+
* will happen:
|
|
224
|
+
*
|
|
225
|
+
* * for each parameter {@link IParameterApi.sessionValue} will be updated.
|
|
226
|
+
* * for each output affected by the customization, {@link IOutputApi.updateCallback}
|
|
227
|
+
* will be invoked, and {@link IOutputApi.node} will be updated (outputs for which
|
|
228
|
+
* {@link IOutputApi.freeze} is true will be skipped).
|
|
229
|
+
*
|
|
230
|
+
* @param parameterValues The set of parameter values to use. Map from parameter id to parameter value. The current value will be used for any parameter not specified.
|
|
231
|
+
* @param force If force is set to true, the customization call will even be called if no parameters have changed. (Default: false)
|
|
232
|
+
* @param waitForViewportUpdate If waitForViewportUpdate is set to true, the promise will only resolve when the geometry was processed by the viewport(s) and is visible in the scene. (Default: false)
|
|
233
|
+
*
|
|
234
|
+
* @throws {@type ShapeDiverViewerError}
|
|
235
|
+
*/
|
|
236
|
+
customize(parameterValues?: {
|
|
237
|
+
[key: string]: unknown;
|
|
238
|
+
}, force?: boolean, waitForViewportUpdate?: boolean): Promise<ITreeNode>;
|
|
239
|
+
/**
|
|
240
|
+
* Customize the session, parallel mode.
|
|
241
|
+
*
|
|
242
|
+
* Use this instead of {@link customize} in case you want to run several
|
|
243
|
+
* _customizations_ in parallel, or you do not want the customization to
|
|
244
|
+
* affect the current state of the {@link outputs} or {@link parameters}.
|
|
245
|
+
* The node resulting from this call has to be manually inserted into the scene.
|
|
246
|
+
*
|
|
247
|
+
* Calls to this function will not update the session's {@link node}
|
|
248
|
+
* nor the outputs' {@link IOutputApi.node|nodes}, and also not update
|
|
249
|
+
* {@link IParameterApi.sessionValue} of the parameters.
|
|
250
|
+
* Note that {@link IOutputApi.updateCallback} will not be called, and
|
|
251
|
+
* {@link IOutputApi.freeze} will be ignored.
|
|
252
|
+
*
|
|
253
|
+
* @param parameterValues The set of parameter values to use. Map from parameter id to parameter value. The current value will be used for any parameter not specified.
|
|
254
|
+
*
|
|
255
|
+
* @throws {@type ShapeDiverViewerError}
|
|
256
|
+
*/
|
|
257
|
+
customizeParallel(parameterValues: {
|
|
258
|
+
[key: string]: unknown;
|
|
259
|
+
}): Promise<ITreeNode>;
|
|
260
|
+
/**
|
|
261
|
+
* Customize the session and only receive the result of the customization call.
|
|
262
|
+
*
|
|
263
|
+
* Use this instead of {@link customize} in case you want to run
|
|
264
|
+
* _customizations_ and only work with the data of the customization result
|
|
265
|
+
*
|
|
266
|
+
* Calls to this function will not update the session's {@link node}
|
|
267
|
+
* nor the outputs' {@link IOutputApi.node|nodes}, and also not update
|
|
268
|
+
* {@link IParameterApi.sessionValue} of the parameters.
|
|
269
|
+
* Note that {@link IOutputApi.updateCallback} will not be called, and
|
|
270
|
+
* {@link IOutputApi.freeze} will be ignored.
|
|
271
|
+
*
|
|
272
|
+
* @param parameterValues The set of parameter values to use. Map from parameter id to parameter value. The current value will be used for any parameter not specified.
|
|
273
|
+
*
|
|
274
|
+
* @throws {@type ShapeDiverViewerError}
|
|
275
|
+
*/
|
|
276
|
+
customizeResult(parameterValues: {
|
|
277
|
+
[key: string]: unknown;
|
|
278
|
+
}): Promise<ShapeDiverResponseDto>;
|
|
279
|
+
/**
|
|
280
|
+
* Get an export definition by id.
|
|
281
|
+
*
|
|
282
|
+
* @param id The id of the export.
|
|
283
|
+
*/
|
|
284
|
+
getExportById(id: string): IExportApi | null;
|
|
285
|
+
/**
|
|
286
|
+
* Get export definitions by name.
|
|
287
|
+
* Please note that a model may define multiple exports for a given name.
|
|
288
|
+
*
|
|
289
|
+
* @param name The name of the exports.
|
|
290
|
+
*/
|
|
291
|
+
getExportByName(name: string): IExportApi[];
|
|
292
|
+
/**
|
|
293
|
+
* Get export definitions by type.
|
|
294
|
+
* Please note that a model may define multiple exports for a given type.
|
|
295
|
+
*
|
|
296
|
+
* @param type The type of the exports.
|
|
297
|
+
*/
|
|
298
|
+
getExportByType(type: string): IExportApi[];
|
|
299
|
+
/**
|
|
300
|
+
* Get output definitions by format of the output's current content.
|
|
301
|
+
*
|
|
302
|
+
* This function filters output definitions by the format of the output's
|
|
303
|
+
* current content, which depends on the current state of the output's {@link IOutputApi.node}.
|
|
304
|
+
* The results of this function may vary depending on this state.
|
|
305
|
+
*
|
|
306
|
+
* @param format The format of the output's content.
|
|
307
|
+
*/
|
|
308
|
+
getOutputByFormat(format: string): IOutputApi[];
|
|
309
|
+
/**
|
|
310
|
+
* Get an output definition by id.
|
|
311
|
+
*
|
|
312
|
+
* @param id The id of the output.
|
|
313
|
+
*/
|
|
314
|
+
getOutputById(id: string): IOutputApi | null;
|
|
315
|
+
/**
|
|
316
|
+
* Get output definitions by name.
|
|
317
|
+
* Please note that a model may define multiple outputs for a given name.
|
|
318
|
+
*
|
|
319
|
+
* @param name The name of the outputs.
|
|
320
|
+
*/
|
|
321
|
+
getOutputByName(name: string): IOutputApi[];
|
|
322
|
+
/**
|
|
323
|
+
* Get parameter definition by id.
|
|
324
|
+
*
|
|
325
|
+
* @param id The id of the parameters.
|
|
326
|
+
*/
|
|
327
|
+
getParameterById(id: string): IParameterApi<unknown> | null;
|
|
328
|
+
/**
|
|
329
|
+
* Get parameter definitions by name.
|
|
330
|
+
* Note that a model may define multiple parameters for a given name.
|
|
331
|
+
*
|
|
332
|
+
* @param name The name of the parameters.
|
|
333
|
+
*/
|
|
334
|
+
getParameterByName(name: string): IParameterApi<unknown>[];
|
|
335
|
+
/**
|
|
336
|
+
* Get parameter definitions by type.
|
|
337
|
+
* Note that a model may define multiple parameters for a given type.
|
|
338
|
+
*
|
|
339
|
+
* @param type The type of the parameters.
|
|
340
|
+
*/
|
|
341
|
+
getParameterByType(type: string): IParameterApi<unknown>[];
|
|
342
|
+
/**
|
|
343
|
+
* Go back to the previous recorded state of parameter values.
|
|
344
|
+
* The session history is recorded whenever {@link customize} is called.
|
|
345
|
+
*
|
|
346
|
+
* @see {@link customize}
|
|
347
|
+
* @see {@link canGoBack}
|
|
348
|
+
* @see {@link canGoForward}
|
|
349
|
+
* @see {@link goBack}
|
|
350
|
+
* @see {@link goForward}
|
|
351
|
+
*
|
|
352
|
+
* @throws {@type ShapeDiverViewerError}
|
|
353
|
+
*/
|
|
354
|
+
goBack(): Promise<ITreeNode>;
|
|
355
|
+
/**
|
|
356
|
+
* Go forward to the next recorded state of parameter values.
|
|
357
|
+
* The session history is recorded whenever {@link customize} is called.
|
|
358
|
+
*
|
|
359
|
+
* @see {@link customize}
|
|
360
|
+
* @see {@link canGoBack}
|
|
361
|
+
* @see {@link canGoForward}
|
|
362
|
+
* @see {@link goBack}
|
|
363
|
+
* @see {@link goForward}
|
|
364
|
+
*
|
|
365
|
+
* @throws {@type ShapeDiverViewerError}
|
|
366
|
+
*/
|
|
367
|
+
goForward(): Promise<ITreeNode>;
|
|
368
|
+
/**
|
|
369
|
+
* Load cached outputs to be able to insert them into the scene manually.
|
|
370
|
+
*
|
|
371
|
+
* Only outputs that are cached on the backend are loaded.
|
|
372
|
+
* If an output is not cached, undefined is returned instead.
|
|
373
|
+
*
|
|
374
|
+
* @param outputs The set of outputs. Map from output id to output version.
|
|
375
|
+
*
|
|
376
|
+
* @throws {@type ShapeDiverViewerError}
|
|
377
|
+
*/
|
|
378
|
+
loadCachedOutputs(outputs: {
|
|
379
|
+
[key: string]: string;
|
|
380
|
+
}): Promise<{
|
|
381
|
+
[key: string]: ITreeNode | undefined;
|
|
382
|
+
}>;
|
|
383
|
+
/**
|
|
384
|
+
* Request one or multiple exports.
|
|
385
|
+
*
|
|
386
|
+
* @param body The body of the export request.
|
|
387
|
+
* @param body.parameters Parameter values to be used for this export request. Map from parameter id to parameter value. The current value will be used for any parameter not specified.
|
|
388
|
+
* @param body.exports The ids of the exports to request.
|
|
389
|
+
* @param body.outputs The ids of the outputs to request.
|
|
390
|
+
* @param body.max_wait_time Maximum amount of milliseconds to wait for completion of export request before responding.
|
|
391
|
+
* @param loadOutputs If loadOutputs is set to true, if result of the export request contains outputs, they will be loaded into the session. (Default: false)
|
|
392
|
+
* @param maxWaitTime Maximum amount of milliseconds to wait for completion of the complete request.
|
|
393
|
+
*
|
|
394
|
+
* @throws {@type ShapeDiverViewerError}
|
|
395
|
+
*/
|
|
396
|
+
requestExports(body: ShapeDiverRequestExport, loadOutputs?: boolean, maxWaitMsec?: number): Promise<ShapeDiverResponseDto>;
|
|
397
|
+
/**
|
|
398
|
+
* Reset the parameters to their stored default values and customize the scene.
|
|
399
|
+
*
|
|
400
|
+
* @param force If force is set to true, the customization call will even be called if no parameters have changed. (Default: false)
|
|
401
|
+
*
|
|
402
|
+
* @throws {@type ShapeDiverViewerError}
|
|
403
|
+
*/
|
|
404
|
+
resetParameterValues(force?: boolean): Promise<ITreeNode>;
|
|
405
|
+
/**
|
|
406
|
+
* Reset all or some settings of the current session and the viewports.
|
|
407
|
+
*
|
|
408
|
+
* @param sections specify false for those parts of the settings that should not be applied
|
|
409
|
+
*
|
|
410
|
+
* @throws {@type ShapeDiverViewerError}
|
|
411
|
+
*/
|
|
412
|
+
resetSettings(sections?: ISettingsSections): Promise<void>;
|
|
413
|
+
/**
|
|
414
|
+
* Save the current state of parameter values of this session as the default parameter values of the model.
|
|
415
|
+
*
|
|
416
|
+
* This call will throw an exception if the ticket and JWT do not grant the required permission to
|
|
417
|
+
* save parameter default values for the model.
|
|
418
|
+
*
|
|
419
|
+
* @throws {@type ShapeDiverViewerError}
|
|
420
|
+
*/
|
|
421
|
+
saveDefaultParameterValues(): Promise<boolean>;
|
|
422
|
+
/**
|
|
423
|
+
* Save the 3D viewport related settings of this session to the model hosted on the Geometry Backend.
|
|
424
|
+
*
|
|
425
|
+
* If a viewportId is provided, the settings of that viewport will be used for saving.
|
|
426
|
+
*
|
|
427
|
+
* This call will throw an exception if the ticket and JWT do not grant the required permission to
|
|
428
|
+
* save viewport settings for the model.
|
|
429
|
+
*
|
|
430
|
+
* @param viewportId The optional viewport id.
|
|
431
|
+
*
|
|
432
|
+
* @throws {@type ShapeDiverViewerError}
|
|
433
|
+
*/
|
|
434
|
+
saveSettings(viewportId?: string): Promise<boolean>;
|
|
435
|
+
/**
|
|
436
|
+
* Save UI-related properties of parameter, output, and export definitions (displayname, order, hidden and tooltip, etc).
|
|
437
|
+
*
|
|
438
|
+
* This call will throw an exception if the ticket and JWT do not grant the required permissions for the model.
|
|
439
|
+
*
|
|
440
|
+
* @throws {@type ShapeDiverViewerError}
|
|
441
|
+
*/
|
|
442
|
+
saveUiProperties(): Promise<boolean>;
|
|
443
|
+
/**
|
|
444
|
+
* Set a new JWT used for authorizing API calls to the Geometry Backend.
|
|
445
|
+
* If a change of the JWT would result in different parameters / exports / outputs of the model,
|
|
446
|
+
* please create a new session with that token instead.
|
|
447
|
+
*
|
|
448
|
+
* @see jwtToken
|
|
449
|
+
* @param token
|
|
450
|
+
*/
|
|
451
|
+
setJwtToken(token: string): Promise<void>;
|
|
452
|
+
/**
|
|
453
|
+
* Update the current available outputs.
|
|
454
|
+
* Calling this function makes sense if you have updated one of
|
|
455
|
+
* the outputs manually by calling {@link IOutputApi.updateOutputContent}.
|
|
456
|
+
*
|
|
457
|
+
* @param waitForViewportUpdate If waitForViewportUpdate is set to true, the promise will only resolve when the geometry was processed by the viewport(s) and is visible in the scene. (Default: false)
|
|
458
|
+
*
|
|
459
|
+
* @throws {@type ShapeDiverViewerError}
|
|
460
|
+
*/
|
|
461
|
+
updateOutputs(waitForViewportUpdate?: boolean): Promise<ITreeNode>;
|
|
462
|
+
/**
|
|
463
|
+
* Upload the files that are specified in the provided values.
|
|
464
|
+
* If a file parameter is not specified in the values, the current value will be used.
|
|
465
|
+
* The ids of the uploaded files are returned in a map from parameter id to file id.
|
|
466
|
+
*
|
|
467
|
+
* Note: The currently set file parameters will be uploaded automatically by {@link customize}, {@link customizeParallel}, {@link requestExports}, and {@link requestExport}.
|
|
468
|
+
|
|
469
|
+
* @param values The set of file parameters to upload. If a parameter is not a file parameter, the current value will be used.
|
|
470
|
+
*/
|
|
471
|
+
uploadFileParameters(values: {
|
|
472
|
+
[key: string]: string | File | Blob;
|
|
473
|
+
}): Promise<{
|
|
474
|
+
[key: string]: string;
|
|
475
|
+
}>;
|
|
476
|
+
}
|
|
477
|
+
//# sourceMappingURL=ISessionApi.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ISessionApi.d.ts","sourceRoot":"","sources":["../../src/interfaces/ISessionApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAC;AAChE,OAAO,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AAErG;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,WAAW,WAAW;IAGxB;;;OAGG;IACH,QAAQ,CAAC,OAAO,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAAC;KAAE,CAAC;IACjD;;;OAGG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IACtC;;;;OAIG;IACH,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IACzB;;;OAGG;IACH,QAAQ,CAAC,OAAO,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAAC;KAAE,CAAC;IACjD;;;OAGG;IACH,QAAQ,CAAC,sBAAsB,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAC;IAC5D;;;;OAIG;IACH,Q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G;IACH,aAAa,CAAC,qBAAqB,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;IACnE;;;;;;;;OAQG;IACH,oBAAoB,CAAC,MAAM,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,IAAI,CAAA;KAAE,GAAG,OAAO,CAAC;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC,CAAC;CAG7G"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ISessionApi.js","sourceRoot":"","sources":["../../src/interfaces/ISessionApi.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { IOutputApi } from '../IOutputApi';
|
|
2
|
+
import { ITreeNodeData } from '@shapediver/viewer.shared.node-tree';
|
|
3
|
+
export interface IOutputApiData extends ITreeNodeData {
|
|
4
|
+
api: IOutputApi;
|
|
5
|
+
clone(): IOutputApiData;
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=IOutputApiData.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IOutputApiData.d.ts","sourceRoot":"","sources":["../../../src/interfaces/data/IOutputApiData.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AAEpE,MAAM,WAAW,cAAe,SAAQ,aAAa;IAGjD,GAAG,EAAE,UAAU,CAAC;IAMhB,KAAK,IAAI,cAAc,CAAC;CAG3B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IOutputApiData.js","sourceRoot":"","sources":["../../../src/interfaces/data/IOutputApiData.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ISessionApi } from '../ISessionApi';
|
|
2
|
+
import { ITreeNodeData } from '@shapediver/viewer.shared.node-tree';
|
|
3
|
+
export interface ISessionApiData extends ITreeNodeData {
|
|
4
|
+
api: ISessionApi;
|
|
5
|
+
clone(): ISessionApiData;
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=ISessionApiData.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ISessionApiData.d.ts","sourceRoot":"","sources":["../../../src/interfaces/data/ISessionApiData.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AAEpE,MAAM,WAAW,eAAgB,SAAQ,aAAa;IAGlD,GAAG,EAAE,WAAW,CAAC;IAMjB,KAAK,IAAI,eAAe,CAAC;CAG5B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ISessionApiData.js","sourceRoot":"","sources":["../../../src/interfaces/data/ISessionApiData.ts"],"names":[],"mappings":""}
|
package/dist/main.d.ts
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { SessionCreationDefinition } from '@shapediver/viewer.creation-control-center.session';
|
|
2
|
+
import { ISessionApi } from './interfaces/ISessionApi';
|
|
3
|
+
/**
|
|
4
|
+
* The sessions that are currently being used.
|
|
5
|
+
*/
|
|
6
|
+
export declare const sessions: {
|
|
7
|
+
[key: string]: ISessionApi;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Create and initialize a session with a model hosted on a
|
|
11
|
+
* {@link https://help.shapediver.com/doc/Geometry-Backend.1863942173.html|ShapeDiver Geometry Backend},
|
|
12
|
+
* using the provided ticket/guid and modelViewUrl.
|
|
13
|
+
* Returns a session api object allowing to control the session.
|
|
14
|
+
*
|
|
15
|
+
* A JWT can be specified for authorizing the API calls to the Geometry Backend.
|
|
16
|
+
* The model's settings on the Geometry Backend might require a JWT to be provided.
|
|
17
|
+
*
|
|
18
|
+
* By default the outputs of the model for its default parameter values will be loaded.
|
|
19
|
+
*
|
|
20
|
+
* An optional identifier for the session can be provided. This identifier can be used to retrieve the
|
|
21
|
+
* api object from {@link sessions}. In case no identifier is provided, a unique one will be generated.
|
|
22
|
+
*
|
|
23
|
+
* @param properties.ticket The ticket for direct embedding of the model represented by the session. This identifies the model on the Geometry Backend. If no ticket was provided, a {@link guid} has to be provided instead.
|
|
24
|
+
* @param properties.guid The geometry backend model id (guid). This identifies the model on the Geometry Backend. A {@link jwtToken} is needed for authentication. If no guid was provided, a {@link ticket} has to be provided instead.
|
|
25
|
+
* @param properties.modelViewUrl The modelViewUrl of the {@link https://help.shapediver.com/doc/Geometry-Backend.1863942173.html|ShapeDiver Geometry Backend} hosting the model.
|
|
26
|
+
* @param properties.jwtToken The JWT to use for authorizing the API calls to the Geometry Backend.
|
|
27
|
+
* @param properties.id The unique identifier to use for the session.
|
|
28
|
+
* @param properties.waitForOutputs Option to wait for the outputs to be loaded, or return immediately after creation of the session. (default: true)
|
|
29
|
+
* @param properties.loadOutputs Option to load the outputs, or not load them until the first call of {@link ISession.customize}. (default: true)
|
|
30
|
+
* @param properties.loadSdtf Option to load the SDTF data. The data is not loaded by default as it can be quite large. (default: false)
|
|
31
|
+
* @param properties.excludeViewports Option to exclude some viewports from the start. Can be accessed via {@link ISession.excludeViewports}.
|
|
32
|
+
* @param properties.initialParameterValues The initial set of parameter values to use. Map from parameter id to parameter value. The default value will be used for any parameter not specified.
|
|
33
|
+
* @param properties.allowOutputLoading Option to allow the outputs to be loaded, or to prevent them from being loaded. (default: true)
|
|
34
|
+
* @returns
|
|
35
|
+
*/
|
|
36
|
+
export declare const createSession: (properties: SessionCreationDefinition) => Promise<ISessionApi>;
|
|
37
|
+
//# sourceMappingURL=main.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":"AAAA,OAAO,EAA+D,yBAAyB,EAAE,MAAM,oDAAoD,CAAC;AAE5J,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AASvD;;GAEG;AACH,eAAO,MAAM,QAAQ,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,WAAW,CAAC;CAAO,CAAC;AAe5D;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,eAAO,MAAM,aAAa,eAAsB,yBAAyB,KAAG,QAAQ,WAAW,CAsC9F,CAAC"}
|