@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,151 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
3
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
4
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
5
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
6
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
7
|
+
};
|
|
8
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
9
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
10
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
11
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
12
|
+
};
|
|
13
|
+
var _ParameterApi_inputValidator, _ParameterApi_logger, _ParameterApi_parameter;
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.ParameterApi = void 0;
|
|
16
|
+
const viewer_shared_services_1 = require("@shapediver/viewer.shared.services");
|
|
17
|
+
class ParameterApi {
|
|
18
|
+
// #endregion Properties (3)
|
|
19
|
+
// #region Constructors (1)
|
|
20
|
+
constructor(parameter) {
|
|
21
|
+
// #region Properties (3)
|
|
22
|
+
_ParameterApi_inputValidator.set(this, viewer_shared_services_1.InputValidator.instance);
|
|
23
|
+
_ParameterApi_logger.set(this, viewer_shared_services_1.Logger.instance);
|
|
24
|
+
_ParameterApi_parameter.set(this, void 0);
|
|
25
|
+
__classPrivateFieldSet(this, _ParameterApi_parameter, parameter, "f");
|
|
26
|
+
}
|
|
27
|
+
// #endregion Constructors (1)
|
|
28
|
+
// #region Public Getters And Setters (25)
|
|
29
|
+
get choices() {
|
|
30
|
+
return __classPrivateFieldGet(this, _ParameterApi_parameter, "f").choices;
|
|
31
|
+
}
|
|
32
|
+
get decimalplaces() {
|
|
33
|
+
return __classPrivateFieldGet(this, _ParameterApi_parameter, "f").decimalplaces;
|
|
34
|
+
}
|
|
35
|
+
get defval() {
|
|
36
|
+
return __classPrivateFieldGet(this, _ParameterApi_parameter, "f").defval;
|
|
37
|
+
}
|
|
38
|
+
get displayname() {
|
|
39
|
+
return __classPrivateFieldGet(this, _ParameterApi_parameter, "f").displayname;
|
|
40
|
+
}
|
|
41
|
+
set displayname(value) {
|
|
42
|
+
const scope = 'displayname';
|
|
43
|
+
__classPrivateFieldGet(this, _ParameterApi_inputValidator, "f").validateAndError(`ParameterApi.${scope}`, value, 'string', false);
|
|
44
|
+
__classPrivateFieldGet(this, _ParameterApi_parameter, "f").displayname = value;
|
|
45
|
+
__classPrivateFieldGet(this, _ParameterApi_logger, "f").debug(`ParameterApi.${scope}: ${scope} was set to ${__classPrivateFieldGet(this, _ParameterApi_parameter, "f").displayname}.`);
|
|
46
|
+
}
|
|
47
|
+
get expression() {
|
|
48
|
+
return __classPrivateFieldGet(this, _ParameterApi_parameter, "f").expression;
|
|
49
|
+
}
|
|
50
|
+
get format() {
|
|
51
|
+
return __classPrivateFieldGet(this, _ParameterApi_parameter, "f").format;
|
|
52
|
+
}
|
|
53
|
+
get group() {
|
|
54
|
+
return __classPrivateFieldGet(this, _ParameterApi_parameter, "f").group;
|
|
55
|
+
}
|
|
56
|
+
get hidden() {
|
|
57
|
+
return __classPrivateFieldGet(this, _ParameterApi_parameter, "f").hidden;
|
|
58
|
+
}
|
|
59
|
+
set hidden(value) {
|
|
60
|
+
const scope = 'hidden';
|
|
61
|
+
__classPrivateFieldGet(this, _ParameterApi_inputValidator, "f").validateAndError(`ParameterApi.${scope}`, value, 'boolean');
|
|
62
|
+
__classPrivateFieldGet(this, _ParameterApi_parameter, "f").hidden = value;
|
|
63
|
+
__classPrivateFieldGet(this, _ParameterApi_logger, "f").debug(`ParameterApi.${scope}: ${scope} was set to ${__classPrivateFieldGet(this, _ParameterApi_parameter, "f").hidden}.`);
|
|
64
|
+
}
|
|
65
|
+
get id() {
|
|
66
|
+
return __classPrivateFieldGet(this, _ParameterApi_parameter, "f").id;
|
|
67
|
+
}
|
|
68
|
+
get max() {
|
|
69
|
+
return __classPrivateFieldGet(this, _ParameterApi_parameter, "f").max;
|
|
70
|
+
}
|
|
71
|
+
get min() {
|
|
72
|
+
return __classPrivateFieldGet(this, _ParameterApi_parameter, "f").min;
|
|
73
|
+
}
|
|
74
|
+
get name() {
|
|
75
|
+
return __classPrivateFieldGet(this, _ParameterApi_parameter, "f").name;
|
|
76
|
+
}
|
|
77
|
+
get order() {
|
|
78
|
+
return __classPrivateFieldGet(this, _ParameterApi_parameter, "f").order;
|
|
79
|
+
}
|
|
80
|
+
set order(value) {
|
|
81
|
+
const scope = 'order';
|
|
82
|
+
__classPrivateFieldGet(this, _ParameterApi_inputValidator, "f").validateAndError(`ParameterApi.${scope}`, value, 'number', false);
|
|
83
|
+
__classPrivateFieldGet(this, _ParameterApi_parameter, "f").order = value;
|
|
84
|
+
__classPrivateFieldGet(this, _ParameterApi_logger, "f").debug(`ParameterApi.${scope}: ${scope} was set to ${__classPrivateFieldGet(this, _ParameterApi_parameter, "f").order}.`);
|
|
85
|
+
}
|
|
86
|
+
get sessionValue() {
|
|
87
|
+
return __classPrivateFieldGet(this, _ParameterApi_parameter, "f").sessionValue;
|
|
88
|
+
}
|
|
89
|
+
set sessionValue(value) {
|
|
90
|
+
const scope = 'sessionValue';
|
|
91
|
+
__classPrivateFieldGet(this, _ParameterApi_parameter, "f").sessionValue = value;
|
|
92
|
+
__classPrivateFieldGet(this, _ParameterApi_logger, "f").debug(`ParameterApi.${scope}: ${scope} was set to ${__classPrivateFieldGet(this, _ParameterApi_parameter, "f").value}.`);
|
|
93
|
+
}
|
|
94
|
+
get structure() {
|
|
95
|
+
return __classPrivateFieldGet(this, _ParameterApi_parameter, "f").structure;
|
|
96
|
+
}
|
|
97
|
+
get tooltip() {
|
|
98
|
+
return __classPrivateFieldGet(this, _ParameterApi_parameter, "f").tooltip;
|
|
99
|
+
}
|
|
100
|
+
set tooltip(value) {
|
|
101
|
+
const scope = 'tooltip';
|
|
102
|
+
__classPrivateFieldGet(this, _ParameterApi_inputValidator, "f").validateAndError(`ParameterApi.${scope}`, value, 'string', false);
|
|
103
|
+
__classPrivateFieldGet(this, _ParameterApi_parameter, "f").tooltip = value;
|
|
104
|
+
__classPrivateFieldGet(this, _ParameterApi_logger, "f").debug(`ParameterApi.${scope}: ${scope} was set to ${__classPrivateFieldGet(this, _ParameterApi_parameter, "f").tooltip}.`);
|
|
105
|
+
}
|
|
106
|
+
get type() {
|
|
107
|
+
return __classPrivateFieldGet(this, _ParameterApi_parameter, "f").type;
|
|
108
|
+
}
|
|
109
|
+
get value() {
|
|
110
|
+
return __classPrivateFieldGet(this, _ParameterApi_parameter, "f").value;
|
|
111
|
+
}
|
|
112
|
+
set value(value) {
|
|
113
|
+
const scope = 'value';
|
|
114
|
+
this.isValid(value, true);
|
|
115
|
+
__classPrivateFieldGet(this, _ParameterApi_parameter, "f").value = value;
|
|
116
|
+
__classPrivateFieldGet(this, _ParameterApi_logger, "f").debug(`ParameterApi.${scope}: ${scope} was set to ${__classPrivateFieldGet(this, _ParameterApi_parameter, "f").value}.`);
|
|
117
|
+
}
|
|
118
|
+
get visualization() {
|
|
119
|
+
return __classPrivateFieldGet(this, _ParameterApi_parameter, "f").visualization;
|
|
120
|
+
}
|
|
121
|
+
// #endregion Public Getters And Setters (25)
|
|
122
|
+
// #region Public Methods (4)
|
|
123
|
+
isValid(value, throwError) {
|
|
124
|
+
const scope = 'isValid';
|
|
125
|
+
__classPrivateFieldGet(this, _ParameterApi_inputValidator, "f").validateAndError(`ParameterApi.${scope}`, throwError, 'boolean', false);
|
|
126
|
+
if (throwError === false) {
|
|
127
|
+
try {
|
|
128
|
+
__classPrivateFieldGet(this, _ParameterApi_parameter, "f").isValid(value);
|
|
129
|
+
}
|
|
130
|
+
catch (e) {
|
|
131
|
+
return false;
|
|
132
|
+
}
|
|
133
|
+
return true;
|
|
134
|
+
}
|
|
135
|
+
else {
|
|
136
|
+
return __classPrivateFieldGet(this, _ParameterApi_parameter, "f").isValid(value);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
resetToDefaultValue() {
|
|
140
|
+
return __classPrivateFieldGet(this, _ParameterApi_parameter, "f").resetToDefaultValue();
|
|
141
|
+
}
|
|
142
|
+
resetToSessionValue() {
|
|
143
|
+
return __classPrivateFieldGet(this, _ParameterApi_parameter, "f").resetToSessionValue();
|
|
144
|
+
}
|
|
145
|
+
stringify() {
|
|
146
|
+
return __classPrivateFieldGet(this, _ParameterApi_parameter, "f").stringify();
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
exports.ParameterApi = ParameterApi;
|
|
150
|
+
_ParameterApi_inputValidator = new WeakMap(), _ParameterApi_logger = new WeakMap(), _ParameterApi_parameter = new WeakMap();
|
|
151
|
+
//# sourceMappingURL=ParameterApi.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ParameterApi.js","sourceRoot":"","sources":["../../src/implementation/ParameterApi.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,+EAA4E;AAM5E,MAAa,YAAY;IAOrB,4BAA4B;IAE5B,2BAA2B;IAE3B,YAAY,SAAwB;QAVpC,yBAAyB;QAEzB,uCAA2C,uCAAc,CAAC,QAAQ,EAAC;QACnE,+BAA2B,+BAAM,CAAC,QAAQ,EAAC;QAC3C,0CAAmC;QAO/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AAC;IAED,6CAA6C;IAE7C,6BAA6B;IAEtB,OAAO,CAAC,KAAc,EAAE,UAAoB;QAC/C,MAAM,KAAK,GAAG,SAAS,CAAC;QACxB,uBAAA,IAAI,oCAAgB,CAAC,gBAAgB,CAAC,gBAAgB,KAAK,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC;QAE7F,IAAI,UAAU,KAAK,KAAK,EAAE;YACtB,IAAI;gBACA,uBAAA,IAAI,+BAAW,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;aAClC;YAAC,OAAO,CAAC,EAAE;gBACR,OAAO,KAAK,CAAC;aAChB;YACD,OAAO,IAAI,CAAC;SACf;aAAM;YACH,OAAO,uBAAA,IAAI,+BAAW,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;SACzC;IACL,CAAC;IAEM,mBAAmB;QACtB,OAAO,uBAAA,IAAI,+BAAW,CAAC,mBAAmB,EAAE,CAAC;IACjD,CAAC;IAEM,mBAAmB;QACtB,OAAO,uBAAA,IAAI,+BAAW,CAAC,mBAAmB,EAAE,CAAC;IACjD,CAAC;IAEM,SAAS;QACZ,OAAO,uBAAA,IAAI,+BAAW,CAAC,SAAS,EAAE,CAAC;IACvC,CAAC;CAGJ;AAzKD,oCAyKC"}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { SessionEngine } from '@shapediver/viewer.session-engine.session-engine';
|
|
2
|
+
import { IExportApi } from '../interfaces/IExportApi';
|
|
3
|
+
import { IOutputApi } from '../interfaces/IOutputApi';
|
|
4
|
+
import { IParameterApi } from '../interfaces//IParameterApi';
|
|
5
|
+
import { ISessionApi } from '../interfaces/ISessionApi';
|
|
6
|
+
import { ISettingsSections } from '@shapediver/viewer.shared.types';
|
|
7
|
+
import { ITreeNode } from '@shapediver/viewer.shared.node-tree';
|
|
8
|
+
import { ShapeDiverRequestExport, ShapeDiverResponseDto } from '@shapediver/sdk.geometry-api-sdk-v2';
|
|
9
|
+
export declare class SessionApi implements ISessionApi {
|
|
10
|
+
#private;
|
|
11
|
+
constructor(sessionEngine: SessionEngine);
|
|
12
|
+
get automaticSceneUpdate(): boolean;
|
|
13
|
+
set automaticSceneUpdate(value: boolean);
|
|
14
|
+
get commitParameters(): boolean;
|
|
15
|
+
set commitParameters(value: boolean);
|
|
16
|
+
get commitSettings(): boolean;
|
|
17
|
+
set commitSettings(value: boolean);
|
|
18
|
+
get customizeOnParameterChange(): boolean;
|
|
19
|
+
set customizeOnParameterChange(value: boolean);
|
|
20
|
+
get excludeViewports(): string[];
|
|
21
|
+
set excludeViewports(value: string[]);
|
|
22
|
+
get exports(): {
|
|
23
|
+
[key: string]: IExportApi;
|
|
24
|
+
};
|
|
25
|
+
get guid(): string | undefined;
|
|
26
|
+
get id(): string;
|
|
27
|
+
get initialized(): boolean;
|
|
28
|
+
get jwtToken(): string | undefined;
|
|
29
|
+
get loadSdtf(): boolean;
|
|
30
|
+
set loadSdtf(value: boolean);
|
|
31
|
+
get modelViewUrl(): string;
|
|
32
|
+
get node(): ITreeNode;
|
|
33
|
+
get outputs(): {
|
|
34
|
+
[key: string]: IOutputApi;
|
|
35
|
+
};
|
|
36
|
+
get parameterDefaultValues(): {
|
|
37
|
+
[key: string]: unknown;
|
|
38
|
+
};
|
|
39
|
+
get parameterSessionValues(): {
|
|
40
|
+
[key: string]: unknown;
|
|
41
|
+
};
|
|
42
|
+
get parameterValues(): {
|
|
43
|
+
[key: string]: unknown;
|
|
44
|
+
};
|
|
45
|
+
get parameters(): {
|
|
46
|
+
[key: string]: IParameterApi<unknown>;
|
|
47
|
+
};
|
|
48
|
+
get refreshJwtToken(): (() => Promise<string>) | undefined;
|
|
49
|
+
set refreshJwtToken(value: (() => Promise<string>) | undefined);
|
|
50
|
+
get ticket(): string | undefined;
|
|
51
|
+
get updateCallback(): ((newNode: ITreeNode, oldNode: ITreeNode) => void | Promise<void>) | null;
|
|
52
|
+
set updateCallback(value: ((newNode: ITreeNode, oldNode: ITreeNode) => void | Promise<void>) | null);
|
|
53
|
+
applySettings(response: ShapeDiverResponseDto, sections?: ISettingsSections): Promise<void>;
|
|
54
|
+
canGoBack(): boolean;
|
|
55
|
+
canGoForward(): boolean;
|
|
56
|
+
cancelCustomization(): void;
|
|
57
|
+
close(): Promise<void>;
|
|
58
|
+
convertToGlTF(): Promise<Blob>;
|
|
59
|
+
customize(parameterValues?: {
|
|
60
|
+
[key: string]: unknown;
|
|
61
|
+
}, force?: boolean, waitForViewportUpdate?: boolean): Promise<ITreeNode>;
|
|
62
|
+
customizeParallel(parameterValues: {
|
|
63
|
+
[key: string]: unknown;
|
|
64
|
+
}): Promise<ITreeNode>;
|
|
65
|
+
customizeResult(parameterValues: {
|
|
66
|
+
[key: string]: unknown;
|
|
67
|
+
}): Promise<ShapeDiverResponseDto>;
|
|
68
|
+
getExportById(id: string): IExportApi | null;
|
|
69
|
+
getExportByName(name: string): IExportApi[];
|
|
70
|
+
getExportByType(type: string): IExportApi[];
|
|
71
|
+
getOutputByFormat(format: string): IOutputApi[];
|
|
72
|
+
getOutputById(id: string): IOutputApi | null;
|
|
73
|
+
getOutputByName(name: string): IOutputApi[];
|
|
74
|
+
getParameterById(id: string): IParameterApi<unknown> | null;
|
|
75
|
+
getParameterByName(name: string): IParameterApi<unknown>[];
|
|
76
|
+
getParameterByType(type: string): IParameterApi<unknown>[];
|
|
77
|
+
goBack(): Promise<ITreeNode>;
|
|
78
|
+
goForward(): Promise<ITreeNode>;
|
|
79
|
+
loadCachedOutputs(outputs: {
|
|
80
|
+
[key: string]: string;
|
|
81
|
+
}): Promise<{
|
|
82
|
+
[key: string]: ITreeNode | undefined;
|
|
83
|
+
}>;
|
|
84
|
+
requestExports(body: ShapeDiverRequestExport, loadOutputs?: boolean, maxWaitMsec?: number): Promise<ShapeDiverResponseDto>;
|
|
85
|
+
resetParameterValues(force?: boolean, waitForViewportUpdate?: boolean): Promise<ITreeNode>;
|
|
86
|
+
resetSettings(sections?: ISettingsSections): Promise<void>;
|
|
87
|
+
saveDefaultParameterValues(): Promise<boolean>;
|
|
88
|
+
saveSettings(viewportId?: string): Promise<boolean>;
|
|
89
|
+
saveUiProperties(): Promise<boolean>;
|
|
90
|
+
setJwtToken(value: string): Promise<void>;
|
|
91
|
+
updateOutputs(waitForViewportUpdate?: boolean): Promise<ITreeNode>;
|
|
92
|
+
uploadFileParameters(values: {
|
|
93
|
+
[key: string]: string | File | Blob;
|
|
94
|
+
}): Promise<{
|
|
95
|
+
[key: string]: string;
|
|
96
|
+
}>;
|
|
97
|
+
}
|
|
98
|
+
//# sourceMappingURL=SessionApi.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SessionApi.d.ts","sourceRoot":"","sources":["../../src/implementation/SessionApi.ts"],"names":[],"mappings":"AAEA,OAAO,EAAiB,aAAa,EAAE,MAAM,kDAAkD,CAAC;AAGhG,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAOtD,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAC;AAIhE,OAAO,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AAErG,qBAAa,UAAW,YAAW,WAAW;;gBAiB9B,aAAa,EAAE,aAAa;IAgCxC,IAAW,oBAAoB,IAAI,OAAO,CAEzC;IAED,IAAW,oBAAoB,CAAC,KAAK,EAAE,OAAO,EAK7C;IAED,IAAW,gBAAgB,IAAI,OAAO,CAErC;IAED,IAAW,gBAAgB,CAAC,KAAK,EAAE,OAAO,EAKzC;IAED,IAAW,cAAc,IAAI,OAAO,CAEnC;IAED,IAAW,cAAc,CAAC,KAAK,EAAE,OAAO,EAK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,CAAC;IAInE,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;CAOzH"}
|
|
@@ -0,0 +1,361 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
12
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
13
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
14
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
15
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
16
|
+
};
|
|
17
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
18
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
19
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
20
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
21
|
+
};
|
|
22
|
+
var _SessionApi_creationControlCenterSession, _SessionApi_exports, _SessionApi_gltfConverter, _SessionApi_inputValidator, _SessionApi_logger, _SessionApi_outputs, _SessionApi_parameters, _SessionApi_sessionEngine, _SessionApi_stateEngine;
|
|
23
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
+
exports.SessionApi = void 0;
|
|
25
|
+
const viewer_creation_control_center_session_1 = require("@shapediver/viewer.creation-control-center.session");
|
|
26
|
+
const ExportApi_1 = require("./ExportApi");
|
|
27
|
+
const viewer_session_engine_session_engine_1 = require("@shapediver/viewer.session-engine.session-engine");
|
|
28
|
+
const FileParameterApi_1 = require("./FileParameterApi");
|
|
29
|
+
const viewer_data_engine_gltf_converter_1 = require("@shapediver/viewer.data-engine.gltf-converter");
|
|
30
|
+
const viewer_shared_services_1 = require("@shapediver/viewer.shared.services");
|
|
31
|
+
const OutputApi_1 = require("./OutputApi");
|
|
32
|
+
const ParameterApi_1 = require("./ParameterApi");
|
|
33
|
+
const SessionApiData_1 = require("./data/SessionApiData");
|
|
34
|
+
class SessionApi {
|
|
35
|
+
// #endregion Properties (9)
|
|
36
|
+
// #region Constructors (1)
|
|
37
|
+
constructor(sessionEngine) {
|
|
38
|
+
// #region Properties (9)
|
|
39
|
+
_SessionApi_creationControlCenterSession.set(this, viewer_creation_control_center_session_1.CreationControlCenterSession.instance);
|
|
40
|
+
_SessionApi_exports.set(this, {});
|
|
41
|
+
_SessionApi_gltfConverter.set(this, viewer_data_engine_gltf_converter_1.GLTFConverter.instance);
|
|
42
|
+
_SessionApi_inputValidator.set(this, viewer_shared_services_1.InputValidator.instance);
|
|
43
|
+
_SessionApi_logger.set(this, viewer_shared_services_1.Logger.instance);
|
|
44
|
+
_SessionApi_outputs.set(this, {});
|
|
45
|
+
_SessionApi_parameters.set(this, {});
|
|
46
|
+
_SessionApi_sessionEngine.set(this, void 0);
|
|
47
|
+
_SessionApi_stateEngine.set(this, viewer_shared_services_1.StateEngine.instance);
|
|
48
|
+
__classPrivateFieldSet(this, _SessionApi_sessionEngine, sessionEngine, "f");
|
|
49
|
+
if (!__classPrivateFieldGet(this, _SessionApi_sessionEngine, "f").initialized)
|
|
50
|
+
throw new viewer_shared_services_1.ShapeDiverViewerSessionError('Session could not be initialized.');
|
|
51
|
+
__classPrivateFieldGet(this, _SessionApi_sessionEngine, "f").updateCallback = (newNode) => {
|
|
52
|
+
if (!newNode)
|
|
53
|
+
return;
|
|
54
|
+
if (newNode.data.findIndex(d => d instanceof SessionApiData_1.SessionApiData) === -1)
|
|
55
|
+
newNode.addData(new SessionApiData_1.SessionApiData(this));
|
|
56
|
+
};
|
|
57
|
+
__classPrivateFieldGet(this, _SessionApi_sessionEngine, "f").updateCallback(this.node, this.node);
|
|
58
|
+
for (const o in __classPrivateFieldGet(this, _SessionApi_sessionEngine, "f").outputs)
|
|
59
|
+
__classPrivateFieldGet(this, _SessionApi_outputs, "f")[o] = new OutputApi_1.OutputApi(__classPrivateFieldGet(this, _SessionApi_sessionEngine, "f").outputs[o]);
|
|
60
|
+
for (const e in __classPrivateFieldGet(this, _SessionApi_sessionEngine, "f").exports)
|
|
61
|
+
__classPrivateFieldGet(this, _SessionApi_exports, "f")[e] = new ExportApi_1.ExportApi(__classPrivateFieldGet(this, _SessionApi_sessionEngine, "f").exports[e]);
|
|
62
|
+
for (const p in __classPrivateFieldGet(this, _SessionApi_sessionEngine, "f").parameters) {
|
|
63
|
+
if (__classPrivateFieldGet(this, _SessionApi_sessionEngine, "f").parameters[p] instanceof viewer_session_engine_session_engine_1.FileParameter) {
|
|
64
|
+
__classPrivateFieldGet(this, _SessionApi_parameters, "f")[p] = new FileParameterApi_1.FileParameterApi(__classPrivateFieldGet(this, _SessionApi_sessionEngine, "f").parameters[p]);
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
__classPrivateFieldGet(this, _SessionApi_parameters, "f")[p] = new ParameterApi_1.ParameterApi(__classPrivateFieldGet(this, _SessionApi_sessionEngine, "f").parameters[p]);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
// #endregion Constructors (1)
|
|
72
|
+
// #region Public Getters And Setters (28)
|
|
73
|
+
get automaticSceneUpdate() {
|
|
74
|
+
return __classPrivateFieldGet(this, _SessionApi_sessionEngine, "f").automaticSceneUpdate;
|
|
75
|
+
}
|
|
76
|
+
set automaticSceneUpdate(value) {
|
|
77
|
+
const scope = 'automaticSceneUpdate';
|
|
78
|
+
__classPrivateFieldGet(this, _SessionApi_inputValidator, "f").validateAndError(`SessionApi.${scope}`, value, 'boolean');
|
|
79
|
+
__classPrivateFieldGet(this, _SessionApi_sessionEngine, "f").automaticSceneUpdate = value;
|
|
80
|
+
__classPrivateFieldGet(this, _SessionApi_logger, "f").debug(`SessionApi.${scope}: ${scope} was set to ${value}`);
|
|
81
|
+
}
|
|
82
|
+
get commitParameters() {
|
|
83
|
+
return __classPrivateFieldGet(this, _SessionApi_sessionEngine, "f").settingsEngine.general.commitParameters;
|
|
84
|
+
}
|
|
85
|
+
set commitParameters(value) {
|
|
86
|
+
const scope = 'commitParameters';
|
|
87
|
+
__classPrivateFieldGet(this, _SessionApi_inputValidator, "f").validateAndError(`SessionApi.${scope}`, value, 'boolean');
|
|
88
|
+
__classPrivateFieldGet(this, _SessionApi_sessionEngine, "f").settingsEngine.general.commitParameters = value;
|
|
89
|
+
__classPrivateFieldGet(this, _SessionApi_logger, "f").debug(`SessionApi.${scope}: ${scope} was set to ${value}`);
|
|
90
|
+
}
|
|
91
|
+
get commitSettings() {
|
|
92
|
+
return __classPrivateFieldGet(this, _SessionApi_sessionEngine, "f").settingsEngine.general.commitSettings;
|
|
93
|
+
}
|
|
94
|
+
set commitSettings(value) {
|
|
95
|
+
const scope = 'commitSettings';
|
|
96
|
+
__classPrivateFieldGet(this, _SessionApi_inputValidator, "f").validateAndError(`SessionApi.${scope}`, value, 'boolean');
|
|
97
|
+
__classPrivateFieldGet(this, _SessionApi_sessionEngine, "f").settingsEngine.general.commitSettings = value;
|
|
98
|
+
__classPrivateFieldGet(this, _SessionApi_logger, "f").debug(`SessionApi.${scope}: ${scope} was set to ${value}`);
|
|
99
|
+
}
|
|
100
|
+
get customizeOnParameterChange() {
|
|
101
|
+
return __classPrivateFieldGet(this, _SessionApi_sessionEngine, "f").customizeOnParameterChange;
|
|
102
|
+
}
|
|
103
|
+
set customizeOnParameterChange(value) {
|
|
104
|
+
const scope = 'customizeOnParameterChange';
|
|
105
|
+
__classPrivateFieldGet(this, _SessionApi_inputValidator, "f").validateAndError(`SessionApi.${scope}`, value, 'boolean');
|
|
106
|
+
__classPrivateFieldGet(this, _SessionApi_sessionEngine, "f").customizeOnParameterChange = value;
|
|
107
|
+
__classPrivateFieldGet(this, _SessionApi_logger, "f").debug(`SessionApi.${scope}: ${scope} was set to ${value}`);
|
|
108
|
+
}
|
|
109
|
+
get excludeViewports() {
|
|
110
|
+
return __classPrivateFieldGet(this, _SessionApi_sessionEngine, "f").excludeViewports;
|
|
111
|
+
}
|
|
112
|
+
set excludeViewports(value) {
|
|
113
|
+
const scope = 'excludeViewports';
|
|
114
|
+
__classPrivateFieldGet(this, _SessionApi_inputValidator, "f").validateAndError(`SessionApi.${scope}`, value, 'stringArray');
|
|
115
|
+
__classPrivateFieldGet(this, _SessionApi_sessionEngine, "f").excludeViewports = value;
|
|
116
|
+
__classPrivateFieldGet(this, _SessionApi_logger, "f").debug(`SessionApi.${scope}: ${scope} was set to ${value}`);
|
|
117
|
+
}
|
|
118
|
+
get exports() {
|
|
119
|
+
return __classPrivateFieldGet(this, _SessionApi_exports, "f");
|
|
120
|
+
}
|
|
121
|
+
get guid() {
|
|
122
|
+
return __classPrivateFieldGet(this, _SessionApi_sessionEngine, "f").guid;
|
|
123
|
+
}
|
|
124
|
+
get id() {
|
|
125
|
+
return __classPrivateFieldGet(this, _SessionApi_sessionEngine, "f").id;
|
|
126
|
+
}
|
|
127
|
+
get initialized() {
|
|
128
|
+
return __classPrivateFieldGet(this, _SessionApi_sessionEngine, "f").initialized;
|
|
129
|
+
}
|
|
130
|
+
get jwtToken() {
|
|
131
|
+
return __classPrivateFieldGet(this, _SessionApi_sessionEngine, "f").jwtToken;
|
|
132
|
+
}
|
|
133
|
+
get loadSdtf() {
|
|
134
|
+
return __classPrivateFieldGet(this, _SessionApi_sessionEngine, "f").loadSdtf;
|
|
135
|
+
}
|
|
136
|
+
set loadSdtf(value) {
|
|
137
|
+
const scope = 'loadSdtf';
|
|
138
|
+
__classPrivateFieldGet(this, _SessionApi_inputValidator, "f").validateAndError(`SessionApi.${scope}`, value, 'boolean');
|
|
139
|
+
__classPrivateFieldGet(this, _SessionApi_sessionEngine, "f").loadSdtf = value;
|
|
140
|
+
__classPrivateFieldGet(this, _SessionApi_logger, "f").debug(`SessionApi.${scope}: ${scope} was set to ${value}`);
|
|
141
|
+
}
|
|
142
|
+
get modelViewUrl() {
|
|
143
|
+
return __classPrivateFieldGet(this, _SessionApi_sessionEngine, "f").modelViewUrl;
|
|
144
|
+
}
|
|
145
|
+
get node() {
|
|
146
|
+
return __classPrivateFieldGet(this, _SessionApi_sessionEngine, "f").node;
|
|
147
|
+
}
|
|
148
|
+
get outputs() {
|
|
149
|
+
return __classPrivateFieldGet(this, _SessionApi_outputs, "f");
|
|
150
|
+
}
|
|
151
|
+
get parameterDefaultValues() {
|
|
152
|
+
const parameterDefaultValues = {};
|
|
153
|
+
for (const key in this.parameters)
|
|
154
|
+
parameterDefaultValues[key] = this.parameters[key].defval;
|
|
155
|
+
return parameterDefaultValues;
|
|
156
|
+
}
|
|
157
|
+
get parameterSessionValues() {
|
|
158
|
+
const parameterSessionValues = {};
|
|
159
|
+
for (const key in this.parameters)
|
|
160
|
+
parameterSessionValues[key] = this.parameters[key].sessionValue;
|
|
161
|
+
return parameterSessionValues;
|
|
162
|
+
}
|
|
163
|
+
get parameterValues() {
|
|
164
|
+
const parameterValues = {};
|
|
165
|
+
for (const key in this.parameters)
|
|
166
|
+
parameterValues[key] = this.parameters[key].value;
|
|
167
|
+
return parameterValues;
|
|
168
|
+
}
|
|
169
|
+
get parameters() {
|
|
170
|
+
return __classPrivateFieldGet(this, _SessionApi_parameters, "f");
|
|
171
|
+
}
|
|
172
|
+
get refreshJwtToken() {
|
|
173
|
+
return __classPrivateFieldGet(this, _SessionApi_sessionEngine, "f").refreshJwtToken;
|
|
174
|
+
}
|
|
175
|
+
set refreshJwtToken(value) {
|
|
176
|
+
const scope = 'refreshJwtToken';
|
|
177
|
+
__classPrivateFieldGet(this, _SessionApi_inputValidator, "f").validateAndError(`SessionApi.${scope}`, value, 'function', false);
|
|
178
|
+
__classPrivateFieldGet(this, _SessionApi_sessionEngine, "f").refreshJwtToken = value;
|
|
179
|
+
__classPrivateFieldGet(this, _SessionApi_logger, "f").debug(`SessionApi.${scope}: ${scope} was set to ${value}`);
|
|
180
|
+
}
|
|
181
|
+
get ticket() {
|
|
182
|
+
return __classPrivateFieldGet(this, _SessionApi_sessionEngine, "f").ticket;
|
|
183
|
+
}
|
|
184
|
+
get updateCallback() {
|
|
185
|
+
return __classPrivateFieldGet(this, _SessionApi_sessionEngine, "f").updateCallback;
|
|
186
|
+
}
|
|
187
|
+
set updateCallback(value) {
|
|
188
|
+
const scope = 'updateCallback';
|
|
189
|
+
if (value)
|
|
190
|
+
__classPrivateFieldGet(this, _SessionApi_inputValidator, "f").validateAndError(`SessionApi.${scope}`, value, 'function', false);
|
|
191
|
+
__classPrivateFieldGet(this, _SessionApi_sessionEngine, "f").updateCallback = (newNode, oldNode) => __awaiter(this, void 0, void 0, function* () {
|
|
192
|
+
if (newNode.data.findIndex(d => d instanceof SessionApiData_1.SessionApiData) === -1)
|
|
193
|
+
newNode.addData(new SessionApiData_1.SessionApiData(this));
|
|
194
|
+
if (value)
|
|
195
|
+
yield Promise.resolve(value(newNode, oldNode));
|
|
196
|
+
});
|
|
197
|
+
__classPrivateFieldGet(this, _SessionApi_logger, "f").debug(`SessionApi.${scope}: ${scope} was updated to ${value}.`);
|
|
198
|
+
}
|
|
199
|
+
// #endregion Public Getters And Setters (28)
|
|
200
|
+
// #region Public Methods (31)
|
|
201
|
+
applySettings(response, sections) {
|
|
202
|
+
const scope = 'applySettings';
|
|
203
|
+
__classPrivateFieldGet(this, _SessionApi_inputValidator, "f").validateAndError(`SessionApi.${scope}`, response, 'object');
|
|
204
|
+
__classPrivateFieldGet(this, _SessionApi_inputValidator, "f").validateAndError(`SessionApi.${scope}`, sections, 'object', false);
|
|
205
|
+
return __classPrivateFieldGet(this, _SessionApi_creationControlCenterSession, "f").applySettings(this.id, response, sections);
|
|
206
|
+
}
|
|
207
|
+
canGoBack() {
|
|
208
|
+
return __classPrivateFieldGet(this, _SessionApi_sessionEngine, "f").canGoBack();
|
|
209
|
+
}
|
|
210
|
+
canGoForward() {
|
|
211
|
+
return __classPrivateFieldGet(this, _SessionApi_sessionEngine, "f").canGoForward();
|
|
212
|
+
}
|
|
213
|
+
cancelCustomization() {
|
|
214
|
+
__classPrivateFieldGet(this, _SessionApi_sessionEngine, "f").cancelCustomization();
|
|
215
|
+
}
|
|
216
|
+
close() {
|
|
217
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
218
|
+
return yield __classPrivateFieldGet(this, _SessionApi_creationControlCenterSession, "f").closeSessionEngine(this.id);
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
convertToGlTF() {
|
|
222
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
223
|
+
for (const r in __classPrivateFieldGet(this, _SessionApi_stateEngine, "f").viewportEngines)
|
|
224
|
+
__classPrivateFieldGet(this, _SessionApi_stateEngine, "f").viewportEngines[r].update('SessionApi.convertToGlTF');
|
|
225
|
+
const result = yield __classPrivateFieldGet(this, _SessionApi_gltfConverter, "f").convert(this.node, false);
|
|
226
|
+
return new Blob([result], { type: 'application/octet-stream' });
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
customize(parameterValues, force = false, waitForViewportUpdate = false) {
|
|
230
|
+
const scope = 'customize';
|
|
231
|
+
__classPrivateFieldGet(this, _SessionApi_inputValidator, "f").validateAndError(`SessionApi.${scope}`, parameterValues, 'object', false);
|
|
232
|
+
// if there are parameter values specified, we set them directly
|
|
233
|
+
// the validation happens in the setter of the ParameterApi
|
|
234
|
+
if (parameterValues)
|
|
235
|
+
for (const p in parameterValues)
|
|
236
|
+
this.parameters[p].value = parameterValues[p];
|
|
237
|
+
__classPrivateFieldGet(this, _SessionApi_inputValidator, "f").validateAndError(`SessionApi.${scope}`, force, 'boolean', false);
|
|
238
|
+
__classPrivateFieldGet(this, _SessionApi_inputValidator, "f").validateAndError(`SessionApi.${scope}`, waitForViewportUpdate, 'boolean', false);
|
|
239
|
+
return __classPrivateFieldGet(this, _SessionApi_sessionEngine, "f").customize(force, waitForViewportUpdate);
|
|
240
|
+
}
|
|
241
|
+
customizeParallel(parameterValues) {
|
|
242
|
+
const scope = 'customizeParallel';
|
|
243
|
+
__classPrivateFieldGet(this, _SessionApi_inputValidator, "f").validateAndError(`SessionApi.${scope}`, parameterValues, 'object');
|
|
244
|
+
return __classPrivateFieldGet(this, _SessionApi_sessionEngine, "f").customizeParallel(parameterValues);
|
|
245
|
+
}
|
|
246
|
+
customizeResult(parameterValues) {
|
|
247
|
+
const scope = 'customizeResult';
|
|
248
|
+
__classPrivateFieldGet(this, _SessionApi_inputValidator, "f").validateAndError(`SessionApi.${scope}`, parameterValues, 'object');
|
|
249
|
+
return __classPrivateFieldGet(this, _SessionApi_sessionEngine, "f").customizeParallel(parameterValues, false);
|
|
250
|
+
}
|
|
251
|
+
getExportById(id) {
|
|
252
|
+
const scope = 'getExportById';
|
|
253
|
+
__classPrivateFieldGet(this, _SessionApi_inputValidator, "f").validateAndError(`SessionApi.${scope}`, id, 'string');
|
|
254
|
+
return __classPrivateFieldGet(this, _SessionApi_exports, "f")[id];
|
|
255
|
+
}
|
|
256
|
+
getExportByName(name) {
|
|
257
|
+
const scope = 'getExportByName';
|
|
258
|
+
__classPrivateFieldGet(this, _SessionApi_inputValidator, "f").validateAndError(`SessionApi.${scope}`, name, 'string');
|
|
259
|
+
return Object.values(__classPrivateFieldGet(this, _SessionApi_exports, "f")).filter(e => e.name === name);
|
|
260
|
+
}
|
|
261
|
+
getExportByType(type) {
|
|
262
|
+
const scope = 'getExportByType';
|
|
263
|
+
__classPrivateFieldGet(this, _SessionApi_inputValidator, "f").validateAndError(`SessionApi.${scope}`, type, 'string');
|
|
264
|
+
return Object.values(__classPrivateFieldGet(this, _SessionApi_exports, "f")).filter(e => e.type === type);
|
|
265
|
+
}
|
|
266
|
+
getOutputByFormat(format) {
|
|
267
|
+
const scope = 'getOutputByFormat';
|
|
268
|
+
__classPrivateFieldGet(this, _SessionApi_inputValidator, "f").validateAndError(`SessionApi.${scope}`, format, 'string');
|
|
269
|
+
return Object.values(__classPrivateFieldGet(this, _SessionApi_outputs, "f")).filter(o => o.format.includes(format));
|
|
270
|
+
}
|
|
271
|
+
getOutputById(id) {
|
|
272
|
+
const scope = 'getOutputById';
|
|
273
|
+
__classPrivateFieldGet(this, _SessionApi_inputValidator, "f").validateAndError(`SessionApi.${scope}`, id, 'string');
|
|
274
|
+
return __classPrivateFieldGet(this, _SessionApi_outputs, "f")[id];
|
|
275
|
+
}
|
|
276
|
+
getOutputByName(name) {
|
|
277
|
+
const scope = 'getOutputByName';
|
|
278
|
+
__classPrivateFieldGet(this, _SessionApi_inputValidator, "f").validateAndError(`SessionApi.${scope}`, name, 'string');
|
|
279
|
+
return Object.values(__classPrivateFieldGet(this, _SessionApi_outputs, "f")).filter(o => o.name === name);
|
|
280
|
+
}
|
|
281
|
+
getParameterById(id) {
|
|
282
|
+
const scope = 'getParameterById';
|
|
283
|
+
__classPrivateFieldGet(this, _SessionApi_inputValidator, "f").validateAndError(`SessionApi.${scope}`, id, 'string');
|
|
284
|
+
return __classPrivateFieldGet(this, _SessionApi_parameters, "f")[id];
|
|
285
|
+
}
|
|
286
|
+
getParameterByName(name) {
|
|
287
|
+
const scope = 'getParameterByName';
|
|
288
|
+
__classPrivateFieldGet(this, _SessionApi_inputValidator, "f").validateAndError(`SessionApi.${scope}`, name, 'string');
|
|
289
|
+
return Object.values(__classPrivateFieldGet(this, _SessionApi_parameters, "f")).filter(p => p.name === name);
|
|
290
|
+
}
|
|
291
|
+
getParameterByType(type) {
|
|
292
|
+
const scope = 'getParameterByType';
|
|
293
|
+
__classPrivateFieldGet(this, _SessionApi_inputValidator, "f").validateAndError(`SessionApi.${scope}`, type, 'string');
|
|
294
|
+
return Object.values(__classPrivateFieldGet(this, _SessionApi_parameters, "f")).filter(p => p.type === type);
|
|
295
|
+
}
|
|
296
|
+
goBack() {
|
|
297
|
+
return __classPrivateFieldGet(this, _SessionApi_sessionEngine, "f").goBack();
|
|
298
|
+
}
|
|
299
|
+
goForward() {
|
|
300
|
+
return __classPrivateFieldGet(this, _SessionApi_sessionEngine, "f").goForward();
|
|
301
|
+
}
|
|
302
|
+
loadCachedOutputs(outputs) {
|
|
303
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
304
|
+
return yield __classPrivateFieldGet(this, _SessionApi_sessionEngine, "f").loadCachedOutputsParallel(outputs);
|
|
305
|
+
});
|
|
306
|
+
}
|
|
307
|
+
requestExports(body, loadOutputs, maxWaitMsec) {
|
|
308
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
309
|
+
const scope = 'requestExports';
|
|
310
|
+
__classPrivateFieldGet(this, _SessionApi_inputValidator, "f").validateAndError(`SessionApi.${scope}`, body, 'object');
|
|
311
|
+
__classPrivateFieldGet(this, _SessionApi_inputValidator, "f").validateAndError(`SessionApi.${scope}`, loadOutputs, 'boolean', false);
|
|
312
|
+
__classPrivateFieldGet(this, _SessionApi_inputValidator, "f").validateAndError(`SessionApi.${scope}`, maxWaitMsec, 'number', false);
|
|
313
|
+
return __classPrivateFieldGet(this, _SessionApi_sessionEngine, "f").requestExports(body, loadOutputs, maxWaitMsec);
|
|
314
|
+
});
|
|
315
|
+
}
|
|
316
|
+
resetParameterValues(force = false, waitForViewportUpdate = false) {
|
|
317
|
+
const scope = 'resetParameterValues';
|
|
318
|
+
for (const p in this.parameters)
|
|
319
|
+
this.parameters[p].value = this.parameters[p].defval;
|
|
320
|
+
__classPrivateFieldGet(this, _SessionApi_inputValidator, "f").validateAndError(`SessionApi.${scope}`, force, 'boolean', false);
|
|
321
|
+
return __classPrivateFieldGet(this, _SessionApi_sessionEngine, "f").customize(force, waitForViewportUpdate);
|
|
322
|
+
}
|
|
323
|
+
resetSettings(sections) {
|
|
324
|
+
const scope = 'applySettings';
|
|
325
|
+
__classPrivateFieldGet(this, _SessionApi_inputValidator, "f").validateAndError(`SessionApi.${scope}`, sections, 'object', false);
|
|
326
|
+
return __classPrivateFieldGet(this, _SessionApi_creationControlCenterSession, "f").resetSettings(this.id, sections);
|
|
327
|
+
}
|
|
328
|
+
saveDefaultParameterValues() {
|
|
329
|
+
return __classPrivateFieldGet(this, _SessionApi_sessionEngine, "f").saveDefaultParameterValues();
|
|
330
|
+
}
|
|
331
|
+
saveSettings(viewportId) {
|
|
332
|
+
const scope = 'saveDefaultParameterValues';
|
|
333
|
+
__classPrivateFieldGet(this, _SessionApi_inputValidator, "f").validateAndError(`SessionApi.${scope}`, viewportId, 'string', false);
|
|
334
|
+
return __classPrivateFieldGet(this, _SessionApi_creationControlCenterSession, "f").saveSettings(this.id, viewportId);
|
|
335
|
+
}
|
|
336
|
+
saveUiProperties() {
|
|
337
|
+
return __classPrivateFieldGet(this, _SessionApi_sessionEngine, "f").saveUiProperties();
|
|
338
|
+
}
|
|
339
|
+
setJwtToken(value) {
|
|
340
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
341
|
+
const scope = 'setJwtToken';
|
|
342
|
+
__classPrivateFieldGet(this, _SessionApi_inputValidator, "f").validateAndError(`SessionApi.${scope}`, value, 'string', false);
|
|
343
|
+
yield __classPrivateFieldGet(this, _SessionApi_sessionEngine, "f").setJwtToken(value);
|
|
344
|
+
__classPrivateFieldGet(this, _SessionApi_logger, "f").debug(`SessionApi.${scope}: ${scope} was set to ${value}`);
|
|
345
|
+
return;
|
|
346
|
+
});
|
|
347
|
+
}
|
|
348
|
+
updateOutputs(waitForViewportUpdate = false) {
|
|
349
|
+
return __classPrivateFieldGet(this, _SessionApi_sessionEngine, "f").updateOutputs(undefined, waitForViewportUpdate);
|
|
350
|
+
}
|
|
351
|
+
uploadFileParameters(values) {
|
|
352
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
353
|
+
const fileParameters = values || {};
|
|
354
|
+
const fileParameterIds = yield __classPrivateFieldGet(this, _SessionApi_sessionEngine, "f").uploadFileParameters(fileParameters);
|
|
355
|
+
return fileParameterIds;
|
|
356
|
+
});
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
exports.SessionApi = SessionApi;
|
|
360
|
+
_SessionApi_creationControlCenterSession = new WeakMap(), _SessionApi_exports = new WeakMap(), _SessionApi_gltfConverter = new WeakMap(), _SessionApi_inputValidator = new WeakMap(), _SessionApi_logger = new WeakMap(), _SessionApi_outputs = new WeakMap(), _SessionApi_parameters = new WeakMap(), _SessionApi_sessionEngine = new WeakMap(), _SessionApi_stateEngine = new WeakMap();
|
|
361
|
+
//# sourceMappingURL=SessionApi.js.map
|