@shapediver/viewer.session-engine.session-engine 3.3.4 → 3.3.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.
Files changed (45) hide show
  1. package/dist/implementation/SessionEngine.d.ts.map +1 -1
  2. package/dist/implementation/SessionEngine.js +18 -3
  3. package/dist/implementation/SessionEngine.js.map +1 -1
  4. package/dist/implementation/dto/DrawingParameter.d.ts +13 -0
  5. package/dist/implementation/dto/DrawingParameter.d.ts.map +1 -0
  6. package/dist/implementation/dto/DrawingParameter.js +43 -0
  7. package/dist/implementation/dto/DrawingParameter.js.map +1 -0
  8. package/dist/index.d.ts +3 -1
  9. package/dist/index.d.ts.map +1 -1
  10. package/dist/index.js +3 -1
  11. package/dist/index.js.map +1 -1
  12. package/dist/interfaces/dto/IDrawingParameter.d.ts +5 -0
  13. package/dist/interfaces/dto/IDrawingParameter.d.ts.map +1 -0
  14. package/dist/interfaces/dto/IDrawingParameter.js +3 -0
  15. package/dist/interfaces/dto/IDrawingParameter.js.map +1 -0
  16. package/dist/interfaces/dto/IDrawingToolsParameter.d.ts +5 -0
  17. package/dist/interfaces/dto/IDrawingToolsParameter.d.ts.map +1 -0
  18. package/dist/interfaces/dto/IDrawingToolsParameter.js +3 -0
  19. package/dist/interfaces/dto/IDrawingToolsParameter.js.map +1 -0
  20. package/package.json +10 -11
  21. package/src/implementation/OutputDelayException.ts +0 -22
  22. package/src/implementation/OutputLoader.ts +0 -378
  23. package/src/implementation/SessionData.ts +0 -44
  24. package/src/implementation/SessionEngine.ts +0 -2006
  25. package/src/implementation/SessionOutputData.ts +0 -44
  26. package/src/implementation/SessionTreeNode.ts +0 -44
  27. package/src/implementation/dto/Export.ts +0 -231
  28. package/src/implementation/dto/FileParameter.ts +0 -117
  29. package/src/implementation/dto/Output.ts +0 -223
  30. package/src/implementation/dto/Parameter.ts +0 -370
  31. package/src/implementation/dto/interaction/GumballParameter.ts +0 -78
  32. package/src/implementation/dto/interaction/SelectionParameter.ts +0 -66
  33. package/src/index.ts +0 -27
  34. package/src/interfaces/ISessionData.ts +0 -16
  35. package/src/interfaces/ISessionEngine.ts +0 -69
  36. package/src/interfaces/ISessionOutputData.ts +0 -16
  37. package/src/interfaces/ISessionTreeNode.ts +0 -9
  38. package/src/interfaces/dto/IExport.ts +0 -17
  39. package/src/interfaces/dto/IFileParameter.ts +0 -10
  40. package/src/interfaces/dto/IOutput.ts +0 -58
  41. package/src/interfaces/dto/IParameter.ts +0 -19
  42. package/src/interfaces/dto/interaction/IGumballParameter.ts +0 -5
  43. package/src/interfaces/dto/interaction/IInteractionParameter.ts +0 -10
  44. package/src/interfaces/dto/interaction/ISelectionParameter.ts +0 -5
  45. package/tsconfig.json +0 -17
@@ -1,370 +0,0 @@
1
- import * as MimeTypeUtils from '@shapediver/viewer.utils.mime-type';
2
- import {
3
- Converter,
4
- EVENTTYPE_PARAMETER,
5
- EVENTTYPE_SESSION,
6
- EventEngine,
7
- InputValidator,
8
- Logger,
9
- ShapeDiverViewerSessionError
10
- } from '@shapediver/viewer.shared.services';
11
- import { IParameter } from '../../interfaces/dto/IParameter';
12
- import { ISessionEvent, PARAMETER_TYPE, PARAMETER_VISUALIZATION } from '@shapediver/viewer.shared.types';
13
- import { SessionEngine } from '../SessionEngine';
14
- import { ShapeDiverResponseParameter, ShapeDiverResponseParameterGroup, ShapeDiverResponseParameterStructure } from '@shapediver/sdk.geometry-api-sdk-v2';
15
-
16
- export class Parameter<T> implements IParameter<T> {
17
- // #region Properties (25)
18
-
19
- readonly #choices?: string[];
20
- readonly #converter: Converter = Converter.instance;
21
- readonly #decimalplaces?: number;
22
- readonly #defaultValue: T | string;
23
- readonly #defval: string;
24
- readonly #eventEngine = EventEngine.instance;
25
- readonly #expression?: string;
26
- readonly #format?: string[];
27
- readonly #group?: ShapeDiverResponseParameterGroup;
28
- readonly #id: string;
29
- readonly #inputValidator: InputValidator = InputValidator.instance;
30
- readonly #logger: Logger = Logger.instance;
31
- readonly #max?: number;
32
- readonly #min?: number;
33
- readonly #name: string;
34
- readonly #sessionEngine: SessionEngine;
35
- readonly #settings?: Record<string, unknown>;
36
- readonly #structure?: ShapeDiverResponseParameterStructure;
37
- readonly #type: PARAMETER_TYPE;
38
- readonly #visualization?: PARAMETER_VISUALIZATION;
39
-
40
- #displayname?: string;
41
- #hidden: boolean = false;
42
- #lastValidatedValue: T | string;
43
- #order?: number;
44
- #sessionValue: T | string;
45
- #tooltip?: string;
46
- #value: T | string;
47
-
48
- // #endregion Properties (25)
49
-
50
- // #region Constructors (1)
51
-
52
- constructor(paramDef: ShapeDiverResponseParameter, sessionEngine: SessionEngine) {
53
- this.#sessionEngine = sessionEngine;
54
-
55
- this.#id = paramDef.id;
56
- this.#defval = paramDef.defval;
57
- this.#name = paramDef.name;
58
- this.#type = <PARAMETER_TYPE>paramDef.type;
59
- if (paramDef.choices !== undefined) this.#choices = paramDef.choices;
60
- if (paramDef.decimalplaces !== undefined) this.#decimalplaces = +paramDef.decimalplaces;
61
- if (paramDef.expression !== undefined) this.#expression = paramDef.expression;
62
-
63
- if (paramDef.format !== undefined)
64
- this.#format = MimeTypeUtils.extendMimeTypes(paramDef.format);
65
-
66
- if (paramDef.min !== undefined) this.#min = +paramDef.min;
67
- if (paramDef.max !== undefined) this.#max = +paramDef.max;
68
- if (paramDef.visualization !== undefined) this.#visualization = <PARAMETER_VISUALIZATION>paramDef.visualization;
69
- if (paramDef.structure !== undefined) this.#structure = paramDef.structure;
70
- if (paramDef.group !== undefined) this.#group = paramDef.group;
71
- if (paramDef.settings !== undefined) this.#settings = paramDef.settings;
72
- if (paramDef.tooltip !== undefined) this.#tooltip = paramDef.tooltip;
73
-
74
- if (paramDef.displayname !== undefined) this.#displayname = paramDef.displayname;
75
- if (paramDef.order !== undefined) this.#order = paramDef.order;
76
- if (paramDef.hidden !== undefined) this.#hidden = paramDef.hidden;
77
-
78
- if (this.#type === PARAMETER_TYPE.BOOL) {
79
- this.#defaultValue = <T><unknown>(this.#defval === 'true');
80
- } else if (this.#type === PARAMETER_TYPE.EVEN || this.#type === PARAMETER_TYPE.FLOAT || this.#type === PARAMETER_TYPE.INT || this.#type === PARAMETER_TYPE.ODD) {
81
- this.#defaultValue = <T><unknown>+this.#defval;
82
- } else {
83
- this.#defaultValue = this.#defval;
84
- }
85
-
86
- if (this.#type === PARAMETER_TYPE.COLOR) {
87
- (this as unknown as { convertColor: (color: unknown) => string }).convertColor = (color: unknown): string => {
88
- return this.#converter.toHexColor(color);
89
- };
90
- }
91
-
92
- this.#value = this.#defaultValue;
93
- this.#sessionValue = this.#value;
94
- this.#lastValidatedValue = this.#value;
95
- }
96
-
97
- // #endregion Constructors (1)
98
-
99
- // #region Public Getters And Setters (26)
100
-
101
- public get choices(): string[] | undefined {
102
- return this.#choices;
103
- }
104
-
105
- public get decimalplaces(): number | undefined {
106
- return this.#decimalplaces;
107
- }
108
-
109
- public get defval(): string {
110
- return this.#defval;
111
- }
112
-
113
- public get displayname(): string | undefined {
114
- return this.#displayname;
115
- }
116
-
117
- public set displayname(value: string | undefined) {
118
- this.#displayname = value;
119
- }
120
-
121
- public get expression(): string | undefined {
122
- return this.#expression;
123
- }
124
-
125
- public get format(): string[] | undefined {
126
- return this.#format;
127
- }
128
-
129
- public get group(): ShapeDiverResponseParameterGroup | undefined {
130
- return this.#group;
131
- }
132
-
133
- public get hidden(): boolean {
134
- return this.#hidden;
135
- }
136
-
137
- public set hidden(value: boolean) {
138
- this.#hidden = value;
139
- }
140
-
141
- public get id(): string {
142
- return this.#id;
143
- }
144
-
145
- public get lastValidatedValue(): T | string {
146
- return this.#lastValidatedValue;
147
- }
148
-
149
- public get max(): number | undefined {
150
- return this.#max;
151
- }
152
-
153
- public get min(): number | undefined {
154
- return this.#min;
155
- }
156
-
157
- public get name(): string {
158
- return this.#name;
159
- }
160
-
161
- public get order(): number | undefined {
162
- return this.#order;
163
- }
164
-
165
- public set order(value: number | undefined) {
166
- this.#order = value;
167
- }
168
-
169
- public get sessionValue(): T | string {
170
- return this.#sessionValue;
171
- }
172
-
173
- public set sessionValue(value: T | string) {
174
- this.#sessionValue = value;
175
-
176
- // emit event
177
- this.#eventEngine.emitEvent(EVENTTYPE_PARAMETER.PARAMETER_SESSION_VALUE_CHANGED, <ISessionEvent>{
178
- sessionId: this.#sessionEngine.id,
179
- parameterId: this.#id,
180
- value: value
181
- });
182
- }
183
-
184
- public get settings(): Record<string, unknown> | undefined {
185
- return this.#settings;
186
- }
187
-
188
- public get structure(): ShapeDiverResponseParameterStructure | undefined {
189
- return this.#structure;
190
- }
191
-
192
- public get tooltip(): string | undefined {
193
- return this.#tooltip;
194
- }
195
-
196
- public set tooltip(value: string | undefined) {
197
- this.#tooltip = value;
198
- }
199
-
200
- public get type(): PARAMETER_TYPE {
201
- return this.#type;
202
- }
203
-
204
- public get value(): T | string {
205
- return this.#value;
206
- }
207
-
208
- public set value(value: T | string) {
209
- this.#value = value;
210
-
211
- // emit event
212
- this.#eventEngine.emitEvent(EVENTTYPE_PARAMETER.PARAMETER_VALUE_CHANGED, <ISessionEvent>{
213
- sessionId: this.#sessionEngine.id,
214
- parameterId: this.#id,
215
- value: value
216
- });
217
-
218
- // if customizeOnParameterChange is true, customize the session
219
- if (this.#sessionEngine.customizeOnParameterChange) this.#sessionEngine.customize();
220
- }
221
-
222
- public get visualization(): PARAMETER_VISUALIZATION | undefined {
223
- return this.#visualization;
224
- }
225
-
226
- // #endregion Public Getters And Setters (26)
227
-
228
- // #region Public Methods (4)
229
-
230
- public isValid(value: unknown): boolean {
231
- switch (true) {
232
- case this.type === PARAMETER_TYPE.BOOL:
233
- if (typeof value === 'string') {
234
- if (!(value === 'true' || value === 'false'))
235
- throw new ShapeDiverViewerSessionError(`Parameter(${this.#id}).isValid: The value ${value} is a string that is neither true or false.`);
236
- } else {
237
- this.#inputValidator.validateAndError(`Parameter(${this.#id}).isValid`, value, 'boolean');
238
- }
239
- break;
240
- case this.type === PARAMETER_TYPE.COLOR:
241
- this.#inputValidator.validateAndError(`Parameter(${this.#id}).isValid`, value, 'color');
242
- break;
243
- case this.type === PARAMETER_TYPE.FILE:
244
- this.#inputValidator.validateAndError(`Parameter(${this.#id}).isValid`, value, 'file');
245
- break;
246
- case this.type === PARAMETER_TYPE.EVEN || this.type === PARAMETER_TYPE.FLOAT || this.type === PARAMETER_TYPE.INT || this.type === PARAMETER_TYPE.ODD:
247
- {
248
- let temp = value as number;
249
- if (typeof value === 'string')
250
- temp = +value;
251
- this.#inputValidator.validateAndError(`Parameter(${this.#id}).isValid`, temp, 'number');
252
- if (this.type === PARAMETER_TYPE.EVEN) {
253
- if (temp % 2 !== 0)
254
- throw new ShapeDiverViewerSessionError(`Parameter(${this.#id}).isValid: The value ${value} is not even.`);
255
- } else if (this.type === PARAMETER_TYPE.ODD) {
256
- if (temp % 2 === 0)
257
- throw new ShapeDiverViewerSessionError(`Parameter(${this.#id}).isValid: The value ${value} is not odd.`);
258
- } else if (this.type === PARAMETER_TYPE.INT) {
259
- if (!Number.isInteger(temp))
260
- throw new ShapeDiverViewerSessionError(`Parameter(${this.#id}).isValid: The value ${value} is not an integer.`);
261
- }
262
- if (this.min || this.min === 0)
263
- if (temp < this.min)
264
- throw new ShapeDiverViewerSessionError(`Parameter(${this.#id}).isValid: The value ${value} is smaller than the minimum ${this.min}.`);
265
-
266
- if (this.max || this.max === 0)
267
- if (temp > this.max)
268
- throw new ShapeDiverViewerSessionError(`Parameter(${this.#id}).isValid: The value ${value} is larger than the maximum ${this.max}.`);
269
-
270
- if (this.decimalplaces || this.decimalplaces === 0) {
271
- const numStr = temp + '';
272
- let decimalplaces = 0;
273
- if (numStr.includes('.'))
274
- decimalplaces = numStr.split('.')[1].length;
275
- if (this.decimalplaces < decimalplaces)
276
- throw new ShapeDiverViewerSessionError(`Parameter(${this.#id}).isValid: The value ${value} has not the correct number of decimalplaces (${this.decimalplaces}).`);
277
- }
278
- }
279
- break;
280
- case this.type === PARAMETER_TYPE.STRINGLIST:
281
- {
282
- this.#inputValidator.validateAndError(`Parameter(${this.#id}).isValid`, value, 'string');
283
- const choicesChecker = (v: string) => {
284
- // has to be a single value that is
285
- // 1. convertible to number
286
- // 2. between 0 and choices.length -1
287
- const temp = +v;
288
- this.#inputValidator.validateAndError(`Parameter(${this.#id}).isValid`, temp, 'number');
289
- if (temp < 0 || temp > this.choices!.length - 1)
290
- throw new ShapeDiverViewerSessionError(`Parameter(${this.#id}).isValid: The value ${v} is not within the range of the defined number choices.`);
291
- };
292
-
293
- if (this.visualization === PARAMETER_VISUALIZATION.CHECKLIST) {
294
- // comma separated numbers
295
- if ((value as string).includes(',')) {
296
- const values: string[] = (value as string).split(',');
297
- for (let i = 0; i < values.length; i++) {
298
- if (values.filter(item => item === values[i]).length !== 1)
299
- throw new ShapeDiverViewerSessionError(`Parameter(${this.#id}).isValid: The value ${values[i]} exists multiple times, but should only exist once.`);
300
- choicesChecker(values[i]);
301
- }
302
- } else {
303
- // to number
304
- let temp = value as number;
305
- if (typeof value === 'string')
306
- temp = +value;
307
- this.#inputValidator.validateAndError(`Parameter(${this.#id}).isValid`, temp, 'number');
308
- choicesChecker(value as string);
309
- }
310
- } else {
311
- // to number
312
- let temp = value as number;
313
- if (typeof value === 'string')
314
- temp = +value;
315
- this.#inputValidator.validateAndError(`Parameter(${this.#id}).isValid`, temp, 'number');
316
- choicesChecker(value as string);
317
- }
318
- break;
319
- }
320
- default:
321
- this.#inputValidator.validateAndError(`Parameter(${this.#id}).isValid`, value, 'string');
322
- break;
323
- }
324
- return true;
325
- }
326
-
327
- public resetToDefaultValue() {
328
- this.#value = this.#defaultValue;
329
- }
330
-
331
- public resetToSessionValue() {
332
- this.#value = this.sessionValue;
333
- }
334
-
335
- public stringify(val?: unknown): string {
336
- const value = val !== undefined ? val : this.value;
337
-
338
- switch (true) {
339
- case this.type === PARAMETER_TYPE.BOOL:
340
- return typeof value === 'string' ? value : (<boolean><unknown>value) + '';
341
- case this.type === PARAMETER_TYPE.COLOR:
342
- return this.#converter.toHex8Color(value);
343
- case this.type === PARAMETER_TYPE.FILE:
344
- if (typeof value !== 'string')
345
- throw new ShapeDiverViewerSessionError(`Parameter(${this.#id}).stringify: Error in stringify. Cannot stringify FileParameter that has not been uploaded yet.`);
346
- return <string>value;
347
- case this.type === PARAMETER_TYPE.EVEN || this.type === PARAMETER_TYPE.FLOAT || this.type === PARAMETER_TYPE.INT || this.type === PARAMETER_TYPE.ODD:
348
- if (typeof value === 'string') {
349
- // cast to number and round to decimalplaces if they exist
350
- if (this.decimalplaces || this.decimalplaces === 0) {
351
- const number = +value;
352
- return number.toFixed(this.#decimalplaces);
353
- } else {
354
- return value;
355
- }
356
- } else {
357
- // round to decimalplaces if they exist
358
- if (this.decimalplaces || this.decimalplaces === 0) {
359
- return (<number><unknown>value).toFixed(this.#decimalplaces);
360
- } else {
361
- return (<number><unknown>value) + '';
362
- }
363
- }
364
- default:
365
- return <string>value;
366
- }
367
- }
368
-
369
- // #endregion Public Methods (4)
370
- }
@@ -1,78 +0,0 @@
1
- import {
2
- IInteractionParameterSettings,
3
- InteractionParameterSettingsType,
4
- IGumballParameterProps,
5
- validateGumballParameterSettings
6
- } from '@shapediver/viewer.shared.types';
7
- import { IGumballParameter } from '../../../interfaces/dto/interaction/IGumballParameter';
8
- import { Parameter } from '../Parameter';
9
- import { SessionEngine } from '../../SessionEngine';
10
- import { ShapeDiverResponseParameter } from '@shapediver/sdk.geometry-api-sdk-v2';
11
-
12
- export class GumballParameter extends Parameter<string> implements IGumballParameter {
13
- // #region Properties (1)
14
-
15
- readonly #sessionEngine: SessionEngine;
16
-
17
- // #endregion Properties (1)
18
-
19
- // #region Constructors (1)
20
-
21
- constructor(paramDef: ShapeDiverResponseParameter, sessionEngine: SessionEngine) {
22
- super(paramDef, sessionEngine);
23
- this.#sessionEngine = sessionEngine;
24
- }
25
-
26
- // #endregion Constructors (1)
27
-
28
- // #region Public Getters And Setters (9)
29
-
30
- public get enableRotation(): boolean | undefined {
31
- return this.getGumballProperties()?.enableRotation;
32
- }
33
-
34
- public get enableScaling(): boolean | undefined {
35
- return this.getGumballProperties()?.enableScaling;
36
- }
37
-
38
- public get enableTranslation(): boolean | undefined {
39
- return this.getGumballProperties()?.enableTranslation;
40
- }
41
-
42
- public get hover(): boolean | undefined {
43
- return this.getGumballProperties()?.hover;
44
- }
45
-
46
- public get interactionType(): InteractionParameterSettingsType {
47
- return 'gumball';
48
- }
49
-
50
- public get nameFilter(): string[] | undefined {
51
- return this.getGumballProperties()?.nameFilter;
52
- }
53
-
54
- public get scale(): number | undefined {
55
- return this.getGumballProperties()?.scale;
56
- }
57
-
58
- public get selectionColor(): string | undefined {
59
- return this.getGumballProperties()?.selectionColor;
60
- }
61
-
62
- public get space(): 'local' | 'world' | undefined {
63
- return this.getGumballProperties()?.space;
64
- }
65
-
66
- // #endregion Public Getters And Setters (9)
67
-
68
- // #region Private Methods (1)
69
-
70
- private getGumballProperties(): IGumballParameterProps | undefined {
71
- const result = validateGumballParameterSettings((this.settings as unknown as IInteractionParameterSettings));
72
- if (result.success) {
73
- return (this.settings as unknown as IInteractionParameterSettings).props;
74
- }
75
- }
76
-
77
- // #endregion Private Methods (1)
78
- }
@@ -1,66 +0,0 @@
1
- import {
2
- IInteractionParameterSettings,
3
- InteractionParameterSettingsType,
4
- ISelectionParameterProps,
5
- validateSelectionParameterSettings
6
- } from '@shapediver/viewer.shared.types';
7
- import { ISelectionParameter } from '../../../interfaces/dto/interaction/ISelectionParameter';
8
- import { Parameter } from '../Parameter';
9
- import { SessionEngine } from '../../SessionEngine';
10
- import { ShapeDiverResponseParameter } from '@shapediver/sdk.geometry-api-sdk-v2';
11
-
12
- export class SelectionParameter extends Parameter<string> implements ISelectionParameter {
13
- // #region Properties (1)
14
-
15
- readonly #sessionEngine: SessionEngine;
16
-
17
- // #endregion Properties (1)
18
-
19
- // #region Constructors (1)
20
-
21
- constructor(paramDef: ShapeDiverResponseParameter, sessionEngine: SessionEngine) {
22
- super(paramDef, sessionEngine);
23
- this.#sessionEngine = sessionEngine;
24
- }
25
-
26
- // #endregion Constructors (1)
27
-
28
- // #region Public Getters And Setters (6)
29
-
30
- public get hover(): boolean | undefined {
31
- return this.getSelectionProperties()?.hover;
32
- }
33
-
34
- public get interactionType(): InteractionParameterSettingsType {
35
- return 'selection';
36
- }
37
-
38
- public get maximumSelection(): number | undefined {
39
- return this.getSelectionProperties()?.maximumSelection;
40
- }
41
-
42
- public get minimumSelection(): number | undefined {
43
- return this.getSelectionProperties()?.minimumSelection;
44
- }
45
-
46
- public get nameFilter(): string[] | undefined {
47
- return this.getSelectionProperties()?.nameFilter;
48
- }
49
-
50
- public get selectionColor(): string | undefined {
51
- return this.getSelectionProperties()?.selectionColor;
52
- }
53
-
54
- // #endregion Public Getters And Setters (6)
55
-
56
- // #region Private Methods (1)
57
-
58
- private getSelectionProperties(): ISelectionParameterProps | undefined {
59
- const result = validateSelectionParameterSettings((this.settings as unknown as IInteractionParameterSettings));
60
- if (result.success) {
61
- return (this.settings as unknown as IInteractionParameterSettings).props;
62
- }
63
- }
64
-
65
- // #endregion Private Methods (1)
66
- }
package/src/index.ts DELETED
@@ -1,27 +0,0 @@
1
- import { Export } from './implementation/dto/Export';
2
- import { FileParameter } from './implementation/dto/FileParameter';
3
- import { GumballParameter } from './implementation/dto/interaction/GumballParameter';
4
- import { IExport } from './interfaces/dto/IExport';
5
- import { IFileParameter } from './interfaces/dto/IFileParameter';
6
- import { IGumballParameter } from './interfaces/dto/interaction/IGumballParameter';
7
- import { IInteractionParameter } from './interfaces/dto/interaction/IInteractionParameter';
8
- import { IOutput, ShapeDiverResponseOutputChunk, ShapeDiverResponseOutputContent } from './interfaces/dto/IOutput';
9
- import { IParameter } from './interfaces/dto/IParameter';
10
- import { ISelectionParameter } from './interfaces/dto/interaction/ISelectionParameter';
11
- import { ISessionData } from './interfaces/ISessionData';
12
- import { ISessionEngine } from './interfaces/ISessionEngine';
13
- import { ISessionOutputData } from './interfaces/ISessionOutputData';
14
- import { Output } from './implementation/dto/Output';
15
- import { Parameter } from './implementation/dto/Parameter';
16
- import { SelectionParameter } from './implementation/dto/interaction/SelectionParameter';
17
- import { SessionData } from './implementation/SessionData';
18
- import { SessionEngine } from './implementation/SessionEngine';
19
- import { SessionOutputData } from './implementation/SessionOutputData';
20
-
21
- export {
22
- ISessionData, SessionData, ISessionOutputData, SessionOutputData
23
- };
24
-
25
- export {
26
- ISessionEngine, SessionEngine, IOutput, Output, IParameter, Parameter, IFileParameter, FileParameter, IInteractionParameter, ISelectionParameter, SelectionParameter, IGumballParameter, GumballParameter, IExport, Export, ShapeDiverResponseOutputContent, ShapeDiverResponseOutputChunk
27
- };
@@ -1,16 +0,0 @@
1
- import { ITreeNodeData } from '@shapediver/viewer.shared.node-tree';
2
- import { ShapeDiverResponseDto } from '@shapediver/sdk.geometry-api-sdk-v2';
3
-
4
- export interface ISessionData extends ITreeNodeData {
5
- // #region Properties (1)
6
-
7
- responseDto: ShapeDiverResponseDto;
8
-
9
- // #endregion Properties (1)
10
-
11
- // #region Public Methods (1)
12
-
13
- clone(): ISessionData;
14
-
15
- // #endregion Public Methods (1)
16
- }
@@ -1,69 +0,0 @@
1
- import { IExport } from './dto/IExport';
2
- import { IOutput } from './dto/IOutput';
3
- import { IParameter } from './dto/IParameter';
4
- import { ISettingsSections } from '@shapediver/viewer.shared.types';
5
- import { ITreeNode } from '@shapediver/viewer.shared.node-tree';
6
- import { OutputLoaderTaskEventInfo } from '../implementation/OutputLoader';
7
- import { SettingsEngine } from '@shapediver/viewer.shared.services';
8
- import {
9
- ShapeDiverRequestCustomization,
10
- ShapeDiverRequestExport,
11
- ShapeDiverRequestGltfUploadQueryConversion,
12
- ShapeDiverResponseDto,
13
- ShapeDiverResponseExport,
14
- ShapeDiverResponseFileInfo,
15
- ShapeDiverResponseModelState
16
- } from '@shapediver/sdk.geometry-api-sdk-v2';
17
-
18
- export interface ISessionEngine {
19
- // #region Properties (15)
20
-
21
- readonly jwtToken?: string;
22
-
23
- canUploadGLTF: boolean;
24
- exports: { [key: string]: IExport };
25
- guid?: string;
26
- id: string;
27
- initialized: boolean;
28
- loadSdtf: boolean;
29
- modelState?: ShapeDiverResponseModelState;
30
- modelViewUrl: string;
31
- outputs: { [key: string]: IOutput };
32
- parameters: { [key: string]: IParameter<unknown> };
33
- refreshJwtToken: (() => Promise<string>) | undefined;
34
- settingsEngine: SettingsEngine;
35
- ticket?: string;
36
- updateCallback: ((newNode: ITreeNode, oldNode: ITreeNode) => void) | null;
37
-
38
- // #endregion Properties (15)
39
-
40
- // #region Public Methods (25)
41
-
42
- applySettings(response: ShapeDiverResponseDto, sections?: ISettingsSections): void;
43
- canGoBack(): boolean;
44
- canGoForward(): boolean;
45
- close(): Promise<void>;
46
- createModelState(parameterValues?: { [key: string]: unknown; }, omitSessionParameterValues?: boolean, image?: (() => string) | string | Blob | File, data?: Record<string, any>, arScene?: (() => Promise<ArrayBuffer>) | ArrayBuffer | (() => Promise<Blob>) | Blob | File): Promise<string>;
47
- customize(force: boolean, waitForViewportUpdate?: boolean): Promise<ITreeNode | ShapeDiverResponseDto>;
48
- customizeParallel(parameterValues: { [key: string]: string }, loadOutputs: boolean): Promise<ITreeNode | ShapeDiverResponseDto>;
49
- getFileInfo(parameterId: string, fileId: string): Promise<ShapeDiverResponseFileInfo>
50
- goBack(): Promise<ITreeNode>;
51
- goForward(): Promise<ITreeNode>;
52
- init(parameterValues?: { [key: string]: string; }): Promise<void>;
53
- loadCachedOutputsParallel(outputMapping: { [key: string]: string }, taskEventInfo?: OutputLoaderTaskEventInfo, retry?: boolean): Promise<{ [key: string]: ITreeNode | undefined }>;
54
- loadOutputs(cancelRequest: () => boolean, taskEventInfo: OutputLoaderTaskEventInfo): Promise<ITreeNode>;
55
- loadOutputsParallel(responseDto: ShapeDiverResponseDto, cancelRequest: () => boolean, taskEventInfo: OutputLoaderTaskEventInfo): Promise<ITreeNode>;
56
- requestExport(exportId: string, parameters: ShapeDiverRequestCustomization, maxWaitTime: number): Promise<ShapeDiverResponseExport>;
57
- requestExports(body: ShapeDiverRequestExport, loadOutputs?: boolean, maxWaitMsec?: number): Promise<ShapeDiverResponseDto>;
58
- resetSettings(sections?: ISettingsSections): void;
59
- saveDefaultParameterValues(): Promise<boolean>;
60
- saveSettings(viewportId?: string): Promise<boolean>;
61
- saveUiProperties(): Promise<boolean>;
62
- setJwtToken(token: string): Promise<void>;
63
- updateOutputs(taskEventInfo?: OutputLoaderTaskEventInfo, waitForViewportUpdate?: boolean): Promise<ITreeNode>;
64
- uploadFile(parameterId: string, data: File, type: string): Promise<string>;
65
- uploadFileParameters(parameterValues?: { [key: string]: string | File | Blob }): Promise<{ [key: string]: string }>
66
- uploadGLTF(blob: Blob, conversion?: ShapeDiverRequestGltfUploadQueryConversion): Promise<ShapeDiverResponseDto>;
67
-
68
- // #endregion Public Methods (25)
69
- }
@@ -1,16 +0,0 @@
1
- import { ITreeNodeData } from '@shapediver/viewer.shared.node-tree';
2
- import { ShapeDiverResponseOutput } from '@shapediver/sdk.geometry-api-sdk-v2';
3
-
4
- export interface ISessionOutputData extends ITreeNodeData {
5
- // #region Properties (1)
6
-
7
- responseOutput: ShapeDiverResponseOutput
8
-
9
- // #endregion Properties (1)
10
-
11
- // #region Public Methods (1)
12
-
13
- clone(): ISessionOutputData;
14
-
15
- // #endregion Public Methods (1)
16
- }
@@ -1,9 +0,0 @@
1
- import { ITreeNode } from '@shapediver/viewer.shared.node-tree';
2
-
3
- export interface ISessionTreeNode extends ITreeNode {
4
- // #region Properties (1)
5
-
6
- readonly sessionNode: boolean;
7
-
8
- // #endregion Properties (1)
9
- }
@@ -1,17 +0,0 @@
1
- import { ShapeDiverResponseExport } from '@shapediver/sdk.geometry-api-sdk-v2';
2
-
3
- export interface IExport extends ShapeDiverResponseExport {
4
- // #region Properties (1)
5
-
6
- maxWaitTime: number;
7
-
8
- // #endregion Properties (1)
9
-
10
- // #region Public Methods (3)
11
-
12
- request(parameters?: { [key: string]: unknown }): Promise<ShapeDiverResponseExport>;
13
- updateExport(): void;
14
- updateExportDefinition(exportDef: ShapeDiverResponseExport): void;
15
-
16
- // #endregion Public Methods (3)
17
- }